| Download
Play around with sieves and benchmarking...
Project: 🧮 JSage: wasm - sagemath - zig
Views: 276Image: ubuntu2004
12// Support for growable heap + pthreads, where the buffer may change, so JS views3// must be updated.4function GROWABLE_HEAP_I8() {5if (wasmMemory.buffer != buffer) {6updateGlobalBufferAndViews(wasmMemory.buffer);7}8return HEAP8;9}10function GROWABLE_HEAP_U8() {11if (wasmMemory.buffer != buffer) {12updateGlobalBufferAndViews(wasmMemory.buffer);13}14return HEAPU8;15}16function GROWABLE_HEAP_I16() {17if (wasmMemory.buffer != buffer) {18updateGlobalBufferAndViews(wasmMemory.buffer);19}20return HEAP16;21}22function GROWABLE_HEAP_U16() {23if (wasmMemory.buffer != buffer) {24updateGlobalBufferAndViews(wasmMemory.buffer);25}26return HEAPU16;27}28function GROWABLE_HEAP_I32() {29if (wasmMemory.buffer != buffer) {30updateGlobalBufferAndViews(wasmMemory.buffer);31}32return HEAP32;33}34function GROWABLE_HEAP_U32() {35if (wasmMemory.buffer != buffer) {36updateGlobalBufferAndViews(wasmMemory.buffer);37}38return HEAPU32;39}40function GROWABLE_HEAP_F32() {41if (wasmMemory.buffer != buffer) {42updateGlobalBufferAndViews(wasmMemory.buffer);43}44return HEAPF32;45}46function GROWABLE_HEAP_F64() {47if (wasmMemory.buffer != buffer) {48updateGlobalBufferAndViews(wasmMemory.buffer);49}50return HEAPF64;51}5253var Module = typeof Module !== "undefined" ? Module : {};5455var moduleOverrides = {};5657var key;5859for (key in Module) {60if (Module.hasOwnProperty(key)) {61moduleOverrides[key] = Module[key];62}63}6465var arguments_ = [];6667var thisProgram = "./this.program";6869var quit_ = function(status, toThrow) {70throw toThrow;71};7273var ENVIRONMENT_IS_WEB = false;7475var ENVIRONMENT_IS_WORKER = false;7677var ENVIRONMENT_IS_NODE = false;7879var ENVIRONMENT_IS_SHELL = false;8081ENVIRONMENT_IS_WEB = typeof window === "object";8283ENVIRONMENT_IS_WORKER = typeof importScripts === "function";8485ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string";8687ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;8889if (Module["ENVIRONMENT"]) {90throw 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)");91}9293var ENVIRONMENT_IS_PTHREAD = Module["ENVIRONMENT_IS_PTHREAD"] || false;9495var _scriptDir = typeof document !== "undefined" && document.currentScript ? document.currentScript.src : undefined;9697if (ENVIRONMENT_IS_WORKER) {98_scriptDir = self.location.href;99} else if (ENVIRONMENT_IS_NODE) {100_scriptDir = __filename;101}102103var scriptDirectory = "";104105function locateFile(path) {106if (Module["locateFile"]) {107return Module["locateFile"](path, scriptDirectory);108}109return scriptDirectory + path;110}111112var read_, readAsync, readBinary, setWindowTitle;113114var nodeFS;115116var nodePath;117118if (ENVIRONMENT_IS_NODE) {119if (ENVIRONMENT_IS_WORKER) {120scriptDirectory = require("path").dirname(scriptDirectory) + "/";121} else {122scriptDirectory = __dirname + "/";123}124read_ = function shell_read(filename, binary) {125if (!nodeFS) nodeFS = require("fs");126if (!nodePath) nodePath = require("path");127filename = nodePath["normalize"](filename);128return nodeFS["readFileSync"](filename, binary ? null : "utf8");129};130readBinary = function readBinary(filename) {131var ret = read_(filename, true);132if (!ret.buffer) {133ret = new Uint8Array(ret);134}135assert(ret.buffer);136return ret;137};138if (process["argv"].length > 1) {139thisProgram = process["argv"][1].replace(/\\/g, "/");140}141arguments_ = process["argv"].slice(2);142if (typeof module !== "undefined") {143module["exports"] = Module;144}145process["on"]("uncaughtException", function(ex) {146if (!(ex instanceof ExitStatus)) {147throw ex;148}149});150process["on"]("unhandledRejection", abort);151quit_ = function(status) {152process["exit"](status);153};154Module["inspect"] = function() {155return "[Emscripten Module object]";156};157var nodeWorkerThreads;158try {159nodeWorkerThreads = require("worker_threads");160} catch (e) {161console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');162throw e;163}164global.Worker = nodeWorkerThreads.Worker;165} else if (ENVIRONMENT_IS_SHELL) {166if (typeof read != "undefined") {167read_ = function shell_read(f) {168return read(f);169};170}171readBinary = function readBinary(f) {172var data;173if (typeof readbuffer === "function") {174return new Uint8Array(readbuffer(f));175}176data = read(f, "binary");177assert(typeof data === "object");178return data;179};180if (typeof scriptArgs != "undefined") {181arguments_ = scriptArgs;182} else if (typeof arguments != "undefined") {183arguments_ = arguments;184}185if (typeof quit === "function") {186quit_ = function(status) {187quit(status);188};189}190if (typeof print !== "undefined") {191if (typeof console === "undefined") console = {};192console.log = print;193console.warn = console.error = typeof printErr !== "undefined" ? printErr : print;194}195} else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {196if (ENVIRONMENT_IS_WORKER) {197scriptDirectory = self.location.href;198} else if (typeof document !== "undefined" && document.currentScript) {199scriptDirectory = document.currentScript.src;200}201if (scriptDirectory.indexOf("blob:") !== 0) {202scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1);203} else {204scriptDirectory = "";205}206if (ENVIRONMENT_IS_NODE) {207read_ = function shell_read(filename, binary) {208if (!nodeFS) nodeFS = require("fs");209if (!nodePath) nodePath = require("path");210filename = nodePath["normalize"](filename);211return nodeFS["readFileSync"](filename, binary ? null : "utf8");212};213readBinary = function readBinary(filename) {214var ret = read_(filename, true);215if (!ret.buffer) {216ret = new Uint8Array(ret);217}218assert(ret.buffer);219return ret;220};221} else {222read_ = function(url) {223var xhr = new XMLHttpRequest();224xhr.open("GET", url, false);225xhr.send(null);226return xhr.responseText;227};228if (ENVIRONMENT_IS_WORKER) {229readBinary = function(url) {230var xhr = new XMLHttpRequest();231xhr.open("GET", url, false);232xhr.responseType = "arraybuffer";233xhr.send(null);234return new Uint8Array(xhr.response);235};236}237readAsync = function(url, onload, onerror) {238var xhr = new XMLHttpRequest();239xhr.open("GET", url, true);240xhr.responseType = "arraybuffer";241xhr.onload = function() {242if (xhr.status == 200 || xhr.status == 0 && xhr.response) {243onload(xhr.response);244return;245}246onerror();247};248xhr.onerror = onerror;249xhr.send(null);250};251}252setWindowTitle = function(title) {253document.title = title;254};255} else {256throw new Error("environment detection error");257}258259if (ENVIRONMENT_IS_NODE) {260if (typeof performance === "undefined") {261global.performance = require("perf_hooks").performance;262}263}264265var out = Module["print"] || console.log.bind(console);266267var err = Module["printErr"] || console.warn.bind(console);268269for (key in moduleOverrides) {270if (moduleOverrides.hasOwnProperty(key)) {271Module[key] = moduleOverrides[key];272}273}274275moduleOverrides = null;276277if (Module["arguments"]) arguments_ = Module["arguments"];278279if (!Object.getOwnPropertyDescriptor(Module, "arguments")) {280Object.defineProperty(Module, "arguments", {281configurable: true,282get: function() {283abort("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");284}285});286}287288if (Module["thisProgram"]) thisProgram = Module["thisProgram"];289290if (!Object.getOwnPropertyDescriptor(Module, "thisProgram")) {291Object.defineProperty(Module, "thisProgram", {292configurable: true,293get: function() {294abort("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");295}296});297}298299if (Module["quit"]) quit_ = Module["quit"];300301if (!Object.getOwnPropertyDescriptor(Module, "quit")) {302Object.defineProperty(Module, "quit", {303configurable: true,304get: function() {305abort("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");306}307});308}309310assert(typeof Module["memoryInitializerPrefixURL"] === "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");311312assert(typeof Module["pthreadMainPrefixURL"] === "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");313314assert(typeof Module["cdInitializerPrefixURL"] === "undefined", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");315316assert(typeof Module["filePackagePrefixURL"] === "undefined", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead");317318assert(typeof Module["read"] === "undefined", "Module.read option was removed (modify read_ in JS)");319320assert(typeof Module["readAsync"] === "undefined", "Module.readAsync option was removed (modify readAsync in JS)");321322assert(typeof Module["readBinary"] === "undefined", "Module.readBinary option was removed (modify readBinary in JS)");323324assert(typeof Module["setWindowTitle"] === "undefined", "Module.setWindowTitle option was removed (modify setWindowTitle in JS)");325326assert(typeof Module["TOTAL_MEMORY"] === "undefined", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");327328if (!Object.getOwnPropertyDescriptor(Module, "read")) {329Object.defineProperty(Module, "read", {330configurable: true,331get: function() {332abort("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");333}334});335}336337if (!Object.getOwnPropertyDescriptor(Module, "readAsync")) {338Object.defineProperty(Module, "readAsync", {339configurable: true,340get: function() {341abort("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");342}343});344}345346if (!Object.getOwnPropertyDescriptor(Module, "readBinary")) {347Object.defineProperty(Module, "readBinary", {348configurable: true,349get: function() {350abort("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");351}352});353}354355if (!Object.getOwnPropertyDescriptor(Module, "setWindowTitle")) {356Object.defineProperty(Module, "setWindowTitle", {357configurable: true,358get: function() {359abort("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");360}361});362}363364var IDBFS = "IDBFS is no longer included by default; build with -lidbfs.js";365366var PROXYFS = "PROXYFS is no longer included by default; build with -lproxyfs.js";367368var WORKERFS = "WORKERFS is no longer included by default; build with -lworkerfs.js";369370var NODEFS = "NODEFS is no longer included by default; build with -lnodefs.js";371372assert(ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER || ENVIRONMENT_IS_NODE, "Pthreads do not work in this environment yet (need Web Workers, or an alternative to them)");373374var STACK_ALIGN = 16;375376function alignMemory(size, factor) {377if (!factor) factor = STACK_ALIGN;378return Math.ceil(size / factor) * factor;379}380381function getNativeTypeSize(type) {382switch (type) {383case "i1":384case "i8":385return 1;386387case "i16":388return 2;389390case "i32":391return 4;392393case "i64":394return 8;395396case "float":397return 4;398399case "double":400return 8;401402default:403{404if (type[type.length - 1] === "*") {405return 4;406} else if (type[0] === "i") {407var bits = Number(type.substr(1));408assert(bits % 8 === 0, "getNativeTypeSize invalid bits " + bits + ", type " + type);409return bits / 8;410} else {411return 0;412}413}414}415}416417function warnOnce(text) {418if (!warnOnce.shown) warnOnce.shown = {};419if (!warnOnce.shown[text]) {420warnOnce.shown[text] = 1;421err(text);422}423}424425function convertJsFunctionToWasm(func, sig) {426if (typeof WebAssembly.Function === "function") {427var typeNames = {428"i": "i32",429"j": "i64",430"f": "f32",431"d": "f64"432};433var type = {434parameters: [],435results: sig[0] == "v" ? [] : [ typeNames[sig[0]] ]436};437for (var i = 1; i < sig.length; ++i) {438type.parameters.push(typeNames[sig[i]]);439}440return new WebAssembly.Function(type, func);441}442var typeSection = [ 1, 0, 1, 96 ];443var sigRet = sig.slice(0, 1);444var sigParam = sig.slice(1);445var typeCodes = {446"i": 127,447"j": 126,448"f": 125,449"d": 124450};451typeSection.push(sigParam.length);452for (var i = 0; i < sigParam.length; ++i) {453typeSection.push(typeCodes[sigParam[i]]);454}455if (sigRet == "v") {456typeSection.push(0);457} else {458typeSection = typeSection.concat([ 1, typeCodes[sigRet] ]);459}460typeSection[1] = typeSection.length - 2;461var bytes = new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0 ].concat(typeSection, [ 2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0 ]));462var module = new WebAssembly.Module(bytes);463var instance = new WebAssembly.Instance(module, {464"e": {465"f": func466}467});468var wrappedFunc = instance.exports["f"];469return wrappedFunc;470}471472var freeTableIndexes = [];473474var functionsInTableMap;475476function getEmptyTableSlot() {477if (freeTableIndexes.length) {478return freeTableIndexes.pop();479}480try {481wasmTable.grow(1);482} catch (err) {483if (!(err instanceof RangeError)) {484throw err;485}486throw "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";487}488return wasmTable.length - 1;489}490491function addFunctionWasm(func, sig) {492if (!functionsInTableMap) {493functionsInTableMap = new WeakMap();494for (var i = 0; i < wasmTable.length; i++) {495var item = wasmTable.get(i);496if (item) {497functionsInTableMap.set(item, i);498}499}500}501if (functionsInTableMap.has(func)) {502return functionsInTableMap.get(func);503}504var ret = getEmptyTableSlot();505try {506wasmTable.set(ret, func);507} catch (err) {508if (!(err instanceof TypeError)) {509throw err;510}511assert(typeof sig !== "undefined", "Missing signature argument to addFunction: " + func);512var wrapped = convertJsFunctionToWasm(func, sig);513wasmTable.set(ret, wrapped);514}515functionsInTableMap.set(func, ret);516return ret;517}518519function removeFunction(index) {520functionsInTableMap.delete(wasmTable.get(index));521freeTableIndexes.push(index);522}523524function addFunction(func, sig) {525assert(typeof func !== "undefined");526return addFunctionWasm(func, sig);527}528529var tempRet0 = 0;530531var setTempRet0 = function(value) {532tempRet0 = value;533};534535var getTempRet0 = function() {536return tempRet0;537};538539var Atomics_load = Atomics.load;540541var Atomics_store = Atomics.store;542543var Atomics_compareExchange = Atomics.compareExchange;544545var wasmBinary;546547if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];548549if (!Object.getOwnPropertyDescriptor(Module, "wasmBinary")) {550Object.defineProperty(Module, "wasmBinary", {551configurable: true,552get: function() {553abort("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");554}555});556}557558var noExitRuntime = Module["noExitRuntime"] || true;559560if (!Object.getOwnPropertyDescriptor(Module, "noExitRuntime")) {561Object.defineProperty(Module, "noExitRuntime", {562configurable: true,563get: function() {564abort("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");565}566});567}568569if (typeof WebAssembly !== "object") {570abort("no native wasm support detected");571}572573function setValue(ptr, value, type, noSafe) {574type = type || "i8";575if (type.charAt(type.length - 1) === "*") type = "i32";576switch (type) {577case "i1":578GROWABLE_HEAP_I8()[ptr >> 0] = value;579break;580581case "i8":582GROWABLE_HEAP_I8()[ptr >> 0] = value;583break;584585case "i16":586GROWABLE_HEAP_I16()[ptr >> 1] = value;587break;588589case "i32":590GROWABLE_HEAP_I32()[ptr >> 2] = value;591break;592593case "i64":594tempI64 = [ 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) ],595GROWABLE_HEAP_I32()[ptr >> 2] = tempI64[0], GROWABLE_HEAP_I32()[ptr + 4 >> 2] = tempI64[1];596break;597598case "float":599GROWABLE_HEAP_F32()[ptr >> 2] = value;600break;601602case "double":603GROWABLE_HEAP_F64()[ptr >> 3] = value;604break;605606default:607abort("invalid type for setValue: " + type);608}609}610611function getValue(ptr, type, noSafe) {612type = type || "i8";613if (type.charAt(type.length - 1) === "*") type = "i32";614switch (type) {615case "i1":616return GROWABLE_HEAP_I8()[ptr >> 0];617618case "i8":619return GROWABLE_HEAP_I8()[ptr >> 0];620621case "i16":622return GROWABLE_HEAP_I16()[ptr >> 1];623624case "i32":625return GROWABLE_HEAP_I32()[ptr >> 2];626627case "i64":628return GROWABLE_HEAP_I32()[ptr >> 2];629630case "float":631return GROWABLE_HEAP_F32()[ptr >> 2];632633case "double":634return GROWABLE_HEAP_F64()[ptr >> 3];635636default:637abort("invalid type for getValue: " + type);638}639return null;640}641642var wasmMemory;643644var wasmModule;645646var ABORT = false;647648var EXITSTATUS;649650function assert(condition, text) {651if (!condition) {652abort("Assertion failed: " + text);653}654}655656function getCFunc(ident) {657var func = Module["_" + ident];658assert(func, "Cannot call unknown function " + ident + ", make sure it is exported");659return func;660}661662function ccall(ident, returnType, argTypes, args, opts) {663var toC = {664"string": function(str) {665var ret = 0;666if (str !== null && str !== undefined && str !== 0) {667var len = (str.length << 2) + 1;668ret = stackAlloc(len);669stringToUTF8(str, ret, len);670}671return ret;672},673"array": function(arr) {674var ret = stackAlloc(arr.length);675writeArrayToMemory(arr, ret);676return ret;677}678};679function convertReturnValue(ret) {680if (returnType === "string") return UTF8ToString(ret);681if (returnType === "boolean") return Boolean(ret);682return ret;683}684var func = getCFunc(ident);685var cArgs = [];686var stack = 0;687assert(returnType !== "array", 'Return type should not be "array".');688if (args) {689for (var i = 0; i < args.length; i++) {690var converter = toC[argTypes[i]];691if (converter) {692if (stack === 0) stack = stackSave();693cArgs[i] = converter(args[i]);694} else {695cArgs[i] = args[i];696}697}698}699var ret = func.apply(null, cArgs);700ret = convertReturnValue(ret);701if (stack !== 0) stackRestore(stack);702return ret;703}704705function cwrap(ident, returnType, argTypes, opts) {706return function() {707return ccall(ident, returnType, argTypes, arguments, opts);708};709}710711var ALLOC_NORMAL = 0;712713var ALLOC_STACK = 1;714715function allocate(slab, allocator) {716var ret;717assert(typeof allocator === "number", "allocate no longer takes a type argument");718assert(typeof slab !== "number", "allocate no longer takes a number as arg0");719if (allocator == ALLOC_STACK) {720ret = stackAlloc(slab.length);721} else {722ret = _malloc(slab.length);723}724if (slab.subarray || slab.slice) {725GROWABLE_HEAP_U8().set(slab, ret);726} else {727GROWABLE_HEAP_U8().set(new Uint8Array(slab), ret);728}729return ret;730}731732function TextDecoderWrapper(encoding) {733var textDecoder = new TextDecoder(encoding);734this.decode = function(data) {735assert(data instanceof Uint8Array);736if (data.buffer instanceof SharedArrayBuffer) {737data = new Uint8Array(data);738}739return textDecoder.decode.call(textDecoder, data);740};741}742743var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoderWrapper("utf8") : undefined;744745function UTF8ArrayToString(heap, idx, maxBytesToRead) {746var endIdx = idx + maxBytesToRead;747var endPtr = idx;748while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr;749if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) {750return UTF8Decoder.decode(heap.subarray(idx, endPtr));751} else {752var str = "";753while (idx < endPtr) {754var u0 = heap[idx++];755if (!(u0 & 128)) {756str += String.fromCharCode(u0);757continue;758}759var u1 = heap[idx++] & 63;760if ((u0 & 224) == 192) {761str += String.fromCharCode((u0 & 31) << 6 | u1);762continue;763}764var u2 = heap[idx++] & 63;765if ((u0 & 240) == 224) {766u0 = (u0 & 15) << 12 | u1 << 6 | u2;767} else {768if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!");769u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63;770}771if (u0 < 65536) {772str += String.fromCharCode(u0);773} else {774var ch = u0 - 65536;775str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);776}777}778}779return str;780}781782function UTF8ToString(ptr, maxBytesToRead) {783return ptr ? UTF8ArrayToString(GROWABLE_HEAP_U8(), ptr, maxBytesToRead) : "";784}785786function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {787if (!(maxBytesToWrite > 0)) return 0;788var startIdx = outIdx;789var endIdx = outIdx + maxBytesToWrite - 1;790for (var i = 0; i < str.length; ++i) {791var u = str.charCodeAt(i);792if (u >= 55296 && u <= 57343) {793var u1 = str.charCodeAt(++i);794u = 65536 + ((u & 1023) << 10) | u1 & 1023;795}796if (u <= 127) {797if (outIdx >= endIdx) break;798heap[outIdx++] = u;799} else if (u <= 2047) {800if (outIdx + 1 >= endIdx) break;801heap[outIdx++] = 192 | u >> 6;802heap[outIdx++] = 128 | u & 63;803} else if (u <= 65535) {804if (outIdx + 2 >= endIdx) break;805heap[outIdx++] = 224 | u >> 12;806heap[outIdx++] = 128 | u >> 6 & 63;807heap[outIdx++] = 128 | u & 63;808} else {809if (outIdx + 3 >= endIdx) break;810if (u >= 2097152) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x1FFFFF).");811heap[outIdx++] = 240 | u >> 18;812heap[outIdx++] = 128 | u >> 12 & 63;813heap[outIdx++] = 128 | u >> 6 & 63;814heap[outIdx++] = 128 | u & 63;815}816}817heap[outIdx] = 0;818return outIdx - startIdx;819}820821function stringToUTF8(str, outPtr, maxBytesToWrite) {822assert(typeof maxBytesToWrite == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");823return stringToUTF8Array(str, GROWABLE_HEAP_U8(), outPtr, maxBytesToWrite);824}825826function lengthBytesUTF8(str) {827var len = 0;828for (var i = 0; i < str.length; ++i) {829var u = str.charCodeAt(i);830if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023;831if (u <= 127) ++len; else if (u <= 2047) len += 2; else if (u <= 65535) len += 3; else len += 4;832}833return len;834}835836function AsciiToString(ptr) {837var str = "";838while (1) {839var ch = GROWABLE_HEAP_U8()[ptr++ >> 0];840if (!ch) return str;841str += String.fromCharCode(ch);842}843}844845function stringToAscii(str, outPtr) {846return writeAsciiToMemory(str, outPtr, false);847}848849var UTF16Decoder = typeof TextDecoder !== "undefined" ? new TextDecoderWrapper("utf-16le") : undefined;850851function UTF16ToString(ptr, maxBytesToRead) {852assert(ptr % 2 == 0, "Pointer passed to UTF16ToString must be aligned to two bytes!");853var endPtr = ptr;854var idx = endPtr >> 1;855var maxIdx = idx + maxBytesToRead / 2;856while (!(idx >= maxIdx) && GROWABLE_HEAP_U16()[idx]) ++idx;857endPtr = idx << 1;858if (endPtr - ptr > 32 && UTF16Decoder) {859return UTF16Decoder.decode(GROWABLE_HEAP_U8().subarray(ptr, endPtr));860} else {861var str = "";862for (var i = 0; !(i >= maxBytesToRead / 2); ++i) {863var codeUnit = GROWABLE_HEAP_I16()[ptr + i * 2 >> 1];864if (codeUnit == 0) break;865str += String.fromCharCode(codeUnit);866}867return str;868}869}870871function stringToUTF16(str, outPtr, maxBytesToWrite) {872assert(outPtr % 2 == 0, "Pointer passed to stringToUTF16 must be aligned to two bytes!");873assert(typeof maxBytesToWrite == "number", "stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");874if (maxBytesToWrite === undefined) {875maxBytesToWrite = 2147483647;876}877if (maxBytesToWrite < 2) return 0;878maxBytesToWrite -= 2;879var startPtr = outPtr;880var numCharsToWrite = maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length;881for (var i = 0; i < numCharsToWrite; ++i) {882var codeUnit = str.charCodeAt(i);883GROWABLE_HEAP_I16()[outPtr >> 1] = codeUnit;884outPtr += 2;885}886GROWABLE_HEAP_I16()[outPtr >> 1] = 0;887return outPtr - startPtr;888}889890function lengthBytesUTF16(str) {891return str.length * 2;892}893894function UTF32ToString(ptr, maxBytesToRead) {895assert(ptr % 4 == 0, "Pointer passed to UTF32ToString must be aligned to four bytes!");896var i = 0;897var str = "";898while (!(i >= maxBytesToRead / 4)) {899var utf32 = GROWABLE_HEAP_I32()[ptr + i * 4 >> 2];900if (utf32 == 0) break;901++i;902if (utf32 >= 65536) {903var ch = utf32 - 65536;904str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);905} else {906str += String.fromCharCode(utf32);907}908}909return str;910}911912function stringToUTF32(str, outPtr, maxBytesToWrite) {913assert(outPtr % 4 == 0, "Pointer passed to stringToUTF32 must be aligned to four bytes!");914assert(typeof maxBytesToWrite == "number", "stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");915if (maxBytesToWrite === undefined) {916maxBytesToWrite = 2147483647;917}918if (maxBytesToWrite < 4) return 0;919var startPtr = outPtr;920var endPtr = startPtr + maxBytesToWrite - 4;921for (var i = 0; i < str.length; ++i) {922var codeUnit = str.charCodeAt(i);923if (codeUnit >= 55296 && codeUnit <= 57343) {924var trailSurrogate = str.charCodeAt(++i);925codeUnit = 65536 + ((codeUnit & 1023) << 10) | trailSurrogate & 1023;926}927GROWABLE_HEAP_I32()[outPtr >> 2] = codeUnit;928outPtr += 4;929if (outPtr + 4 > endPtr) break;930}931GROWABLE_HEAP_I32()[outPtr >> 2] = 0;932return outPtr - startPtr;933}934935function lengthBytesUTF32(str) {936var len = 0;937for (var i = 0; i < str.length; ++i) {938var codeUnit = str.charCodeAt(i);939if (codeUnit >= 55296 && codeUnit <= 57343) ++i;940len += 4;941}942return len;943}944945function allocateUTF8(str) {946var size = lengthBytesUTF8(str) + 1;947var ret = _malloc(size);948if (ret) stringToUTF8Array(str, GROWABLE_HEAP_I8(), ret, size);949return ret;950}951952function allocateUTF8OnStack(str) {953var size = lengthBytesUTF8(str) + 1;954var ret = stackAlloc(size);955stringToUTF8Array(str, GROWABLE_HEAP_I8(), ret, size);956return ret;957}958959function writeStringToMemory(string, buffer, dontAddNull) {960warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");961var lastChar, end;962if (dontAddNull) {963end = buffer + lengthBytesUTF8(string);964lastChar = GROWABLE_HEAP_I8()[end];965}966stringToUTF8(string, buffer, Infinity);967if (dontAddNull) GROWABLE_HEAP_I8()[end] = lastChar;968}969970function writeArrayToMemory(array, buffer) {971assert(array.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)");972GROWABLE_HEAP_I8().set(array, buffer);973}974975function writeAsciiToMemory(str, buffer, dontAddNull) {976for (var i = 0; i < str.length; ++i) {977assert(str.charCodeAt(i) === str.charCodeAt(i) & 255);978GROWABLE_HEAP_I8()[buffer++ >> 0] = str.charCodeAt(i);979}980if (!dontAddNull) GROWABLE_HEAP_I8()[buffer >> 0] = 0;981}982983function alignUp(x, multiple) {984if (x % multiple > 0) {985x += multiple - x % multiple;986}987return x;988}989990var HEAP, buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;991992if (ENVIRONMENT_IS_PTHREAD) {993buffer = Module["buffer"];994}995996function updateGlobalBufferAndViews(buf) {997buffer = buf;998Module["HEAP8"] = HEAP8 = new Int8Array(buf);999Module["HEAP16"] = HEAP16 = new Int16Array(buf);1000Module["HEAP32"] = HEAP32 = new Int32Array(buf);1001Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf);1002Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf);1003Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf);1004Module["HEAPF32"] = HEAPF32 = new Float32Array(buf);1005Module["HEAPF64"] = HEAPF64 = new Float64Array(buf);1006}10071008var TOTAL_STACK = 5242880;10091010if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime");10111012var INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216;10131014if (!Object.getOwnPropertyDescriptor(Module, "INITIAL_MEMORY")) {1015Object.defineProperty(Module, "INITIAL_MEMORY", {1016configurable: true,1017get: function() {1018abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");1019}1020});1021}10221023assert(INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")");10241025assert(typeof Int32Array !== "undefined" && typeof Float64Array !== "undefined" && Int32Array.prototype.subarray !== undefined && Int32Array.prototype.set !== undefined, "JS engine does not provide full typed array support");10261027if (ENVIRONMENT_IS_PTHREAD) {1028wasmMemory = Module["wasmMemory"];1029buffer = Module["buffer"];1030} else {1031if (Module["wasmMemory"]) {1032wasmMemory = Module["wasmMemory"];1033} else {1034wasmMemory = new WebAssembly.Memory({1035"initial": INITIAL_MEMORY / 65536,1036"maximum": 2147483648 / 65536,1037"shared": true1038});1039if (!(wasmMemory.buffer instanceof SharedArrayBuffer)) {1040err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");1041if (ENVIRONMENT_IS_NODE) {1042console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)");1043}1044throw Error("bad memory");1045}1046}1047}10481049if (wasmMemory) {1050buffer = wasmMemory.buffer;1051}10521053INITIAL_MEMORY = buffer.byteLength;10541055assert(INITIAL_MEMORY % 65536 === 0);10561057updateGlobalBufferAndViews(buffer);10581059var wasmTable;10601061function writeStackCookie() {1062var max = _emscripten_stack_get_end();1063assert((max & 3) == 0);1064GROWABLE_HEAP_U32()[(max >> 2) + 1] = 34821223;1065GROWABLE_HEAP_U32()[(max >> 2) + 2] = 2310721022;1066GROWABLE_HEAP_I32()[0] = 1668509029;1067}10681069function checkStackCookie() {1070if (ABORT) return;1071var max = _emscripten_stack_get_end();1072var cookie1 = GROWABLE_HEAP_U32()[(max >> 2) + 1];1073var cookie2 = GROWABLE_HEAP_U32()[(max >> 2) + 2];1074if (cookie1 != 34821223 || cookie2 != 2310721022) {1075abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " " + cookie1.toString(16));1076}1077if (GROWABLE_HEAP_I32()[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!");1078}10791080(function() {1081var h16 = new Int16Array(1);1082var h8 = new Int8Array(h16.buffer);1083h16[0] = 25459;1084if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)";1085})();10861087var __ATPRERUN__ = [];10881089var __ATINIT__ = [];10901091var __ATMAIN__ = [];10921093var __ATEXIT__ = [];10941095var __ATPOSTRUN__ = [];10961097var runtimeInitialized = false;10981099var runtimeExited = false;11001101function preRun() {1102if (ENVIRONMENT_IS_PTHREAD) return;1103if (Module["preRun"]) {1104if (typeof Module["preRun"] == "function") Module["preRun"] = [ Module["preRun"] ];1105while (Module["preRun"].length) {1106addOnPreRun(Module["preRun"].shift());1107}1108}1109callRuntimeCallbacks(__ATPRERUN__);1110}11111112function initRuntime() {1113checkStackCookie();1114assert(!runtimeInitialized);1115runtimeInitialized = true;1116if (ENVIRONMENT_IS_PTHREAD) return;1117callRuntimeCallbacks(__ATINIT__);1118}11191120function preMain() {1121checkStackCookie();1122if (ENVIRONMENT_IS_PTHREAD) return;1123callRuntimeCallbacks(__ATMAIN__);1124}11251126function exitRuntime() {1127checkStackCookie();1128if (ENVIRONMENT_IS_PTHREAD) return;1129runtimeExited = true;1130}11311132function postRun() {1133checkStackCookie();1134if (ENVIRONMENT_IS_PTHREAD) return;1135if (Module["postRun"]) {1136if (typeof Module["postRun"] == "function") Module["postRun"] = [ Module["postRun"] ];1137while (Module["postRun"].length) {1138addOnPostRun(Module["postRun"].shift());1139}1140}1141callRuntimeCallbacks(__ATPOSTRUN__);1142}11431144function addOnPreRun(cb) {1145__ATPRERUN__.unshift(cb);1146}11471148function addOnInit(cb) {1149__ATINIT__.unshift(cb);1150}11511152function addOnPreMain(cb) {1153__ATMAIN__.unshift(cb);1154}11551156function addOnExit(cb) {}11571158function addOnPostRun(cb) {1159__ATPOSTRUN__.unshift(cb);1160}11611162assert(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");11631164assert(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");11651166assert(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");11671168assert(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");11691170var runDependencies = 0;11711172var runDependencyWatcher = null;11731174var dependenciesFulfilled = null;11751176var runDependencyTracking = {};11771178function getUniqueRunDependency(id) {1179var orig = id;1180while (1) {1181if (!runDependencyTracking[id]) return id;1182id = orig + Math.random();1183}1184}11851186function addRunDependency(id) {1187assert(!ENVIRONMENT_IS_PTHREAD, "addRunDependency cannot be used in a pthread worker");1188runDependencies++;1189if (Module["monitorRunDependencies"]) {1190Module["monitorRunDependencies"](runDependencies);1191}1192if (id) {1193assert(!runDependencyTracking[id]);1194runDependencyTracking[id] = 1;1195if (runDependencyWatcher === null && typeof setInterval !== "undefined") {1196runDependencyWatcher = setInterval(function() {1197if (ABORT) {1198clearInterval(runDependencyWatcher);1199runDependencyWatcher = null;1200return;1201}1202var shown = false;1203for (var dep in runDependencyTracking) {1204if (!shown) {1205shown = true;1206err("still waiting on run dependencies:");1207}1208err("dependency: " + dep);1209}1210if (shown) {1211err("(end of list)");1212}1213}, 1e4);1214}1215} else {1216err("warning: run dependency added without ID");1217}1218}12191220function removeRunDependency(id) {1221runDependencies--;1222if (Module["monitorRunDependencies"]) {1223Module["monitorRunDependencies"](runDependencies);1224}1225if (id) {1226assert(runDependencyTracking[id]);1227delete runDependencyTracking[id];1228} else {1229err("warning: run dependency removed without ID");1230}1231if (runDependencies == 0) {1232if (runDependencyWatcher !== null) {1233clearInterval(runDependencyWatcher);1234runDependencyWatcher = null;1235}1236if (dependenciesFulfilled) {1237var callback = dependenciesFulfilled;1238dependenciesFulfilled = null;1239callback();1240}1241}1242}12431244Module["preloadedImages"] = {};12451246Module["preloadedAudios"] = {};12471248function abort(what) {1249if (Module["onAbort"]) {1250Module["onAbort"](what);1251}1252if (ENVIRONMENT_IS_PTHREAD) console.error("Pthread aborting at " + new Error().stack);1253what += "";1254err(what);1255ABORT = true;1256EXITSTATUS = 1;1257var output = "abort(" + what + ") at " + stackTrace();1258what = output;1259var e = new WebAssembly.RuntimeError(what);1260throw e;1261}12621263var FS = {1264error: function() {1265abort("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1");1266},1267init: function() {1268FS.error();1269},1270createDataFile: function() {1271FS.error();1272},1273createPreloadedFile: function() {1274FS.error();1275},1276createLazyFile: function() {1277FS.error();1278},1279open: function() {1280FS.error();1281},1282mkdev: function() {1283FS.error();1284},1285registerDevice: function() {1286FS.error();1287},1288analyzePath: function() {1289FS.error();1290},1291loadFilesFromDB: function() {1292FS.error();1293},1294ErrnoError: function ErrnoError() {1295FS.error();1296}1297};12981299Module["FS_createDataFile"] = FS.createDataFile;13001301Module["FS_createPreloadedFile"] = FS.createPreloadedFile;13021303var dataURIPrefix = "data:application/octet-stream;base64,";13041305function isDataURI(filename) {1306return filename.startsWith(dataURIPrefix);1307}13081309function isFileURI(filename) {1310return filename.startsWith("file://");1311}13121313function createExportWrapper(name, fixedasm) {1314return function() {1315var displayName = name;1316var asm = fixedasm;1317if (!fixedasm) {1318asm = Module["asm"];1319}1320assert(runtimeInitialized, "native function `" + displayName + "` called before runtime initialization");1321assert(!runtimeExited, "native function `" + displayName + "` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)");1322if (!asm[name]) {1323assert(asm[name], "exported native function `" + displayName + "` not found");1324}1325return asm[name].apply(null, arguments);1326};1327}13281329var wasmBinaryFile;13301331wasmBinaryFile = "sieve.wasm";13321333if (!isDataURI(wasmBinaryFile)) {1334wasmBinaryFile = locateFile(wasmBinaryFile);1335}13361337function getBinary(file) {1338try {1339if (file == wasmBinaryFile && wasmBinary) {1340return new Uint8Array(wasmBinary);1341}1342if (readBinary) {1343return readBinary(file);1344} else {1345throw "both async and sync fetching of the wasm failed";1346}1347} catch (err) {1348abort(err);1349}1350}13511352function getBinaryPromise() {1353if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {1354if (typeof fetch === "function" && !isFileURI(wasmBinaryFile)) {1355return fetch(wasmBinaryFile, {1356credentials: "same-origin"1357}).then(function(response) {1358if (!response["ok"]) {1359throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";1360}1361return response["arrayBuffer"]();1362}).catch(function() {1363return getBinary(wasmBinaryFile);1364});1365} else {1366if (readAsync) {1367return new Promise(function(resolve, reject) {1368readAsync(wasmBinaryFile, function(response) {1369resolve(new Uint8Array(response));1370}, reject);1371});1372}1373}1374}1375return Promise.resolve().then(function() {1376return getBinary(wasmBinaryFile);1377});1378}13791380function createWasm() {1381var info = {1382"env": asmLibraryArg,1383"wasi_snapshot_preview1": asmLibraryArg1384};1385function receiveInstance(instance, module) {1386var exports = instance.exports;1387Module["asm"] = exports;1388wasmTable = Module["asm"]["__indirect_function_table"];1389assert(wasmTable, "table not found in wasm exports");1390addOnInit(Module["asm"]["__wasm_call_ctors"]);1391PThread.tlsInitFunctions.push(Module["asm"]["emscripten_tls_init"]);1392wasmModule = module;1393if (!ENVIRONMENT_IS_PTHREAD) {1394removeRunDependency("wasm-instantiate");1395}1396}1397if (!ENVIRONMENT_IS_PTHREAD) {1398addRunDependency("wasm-instantiate");1399}1400var trueModule = Module;1401function receiveInstantiationResult(result) {1402assert(Module === trueModule, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");1403trueModule = null;1404receiveInstance(result["instance"], result["module"]);1405}1406function instantiateArrayBuffer(receiver) {1407return getBinaryPromise().then(function(binary) {1408var result = WebAssembly.instantiate(binary, info);1409return result;1410}).then(receiver, function(reason) {1411err("failed to asynchronously prepare wasm: " + reason);1412if (isFileURI(wasmBinaryFile)) {1413err("warning: Loading from a file URI (" + wasmBinaryFile + ") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing");1414}1415abort(reason);1416});1417}1418function instantiateAsync() {1419if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") {1420return fetch(wasmBinaryFile, {1421credentials: "same-origin"1422}).then(function(response) {1423var result = WebAssembly.instantiateStreaming(response, info);1424return result.then(receiveInstantiationResult, function(reason) {1425err("wasm streaming compile failed: " + reason);1426err("falling back to ArrayBuffer instantiation");1427return instantiateArrayBuffer(receiveInstantiationResult);1428});1429});1430} else {1431return instantiateArrayBuffer(receiveInstantiationResult);1432}1433}1434if (Module["instantiateWasm"]) {1435try {1436var exports = Module["instantiateWasm"](info, receiveInstance);1437return exports;1438} catch (e) {1439err("Module.instantiateWasm callback failed with error: " + e);1440return false;1441}1442}1443instantiateAsync();1444return {};1445}14461447var tempDouble;14481449var tempI64;14501451var ASM_CONSTS = {14522172: function() {1453throw "Canceled!";1454},14552190: function($0, $1) {1456setTimeout(function() {1457__emscripten_do_dispatch_to_thread($0, $1);1458}, 0);1459}1460};14611462function initPthreadsJS() {1463PThread.initRuntime();1464}14651466function callRuntimeCallbacks(callbacks) {1467while (callbacks.length > 0) {1468var callback = callbacks.shift();1469if (typeof callback == "function") {1470callback(Module);1471continue;1472}1473var func = callback.func;1474if (typeof func === "number") {1475if (callback.arg === undefined) {1476wasmTable.get(func)();1477} else {1478wasmTable.get(func)(callback.arg);1479}1480} else {1481func(callback.arg === undefined ? null : callback.arg);1482}1483}1484}14851486function demangle(func) {1487warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");1488return func;1489}14901491function demangleAll(text) {1492var regex = /\b_Z[\w\d_]+/g;1493return text.replace(regex, function(x) {1494var y = demangle(x);1495return x === y ? x : y + " [" + x + "]";1496});1497}14981499var ERRNO_CODES = {1500EPERM: 63,1501ENOENT: 44,1502ESRCH: 71,1503EINTR: 27,1504EIO: 29,1505ENXIO: 60,1506E2BIG: 1,1507ENOEXEC: 45,1508EBADF: 8,1509ECHILD: 12,1510EAGAIN: 6,1511EWOULDBLOCK: 6,1512ENOMEM: 48,1513EACCES: 2,1514EFAULT: 21,1515ENOTBLK: 105,1516EBUSY: 10,1517EEXIST: 20,1518EXDEV: 75,1519ENODEV: 43,1520ENOTDIR: 54,1521EISDIR: 31,1522EINVAL: 28,1523ENFILE: 41,1524EMFILE: 33,1525ENOTTY: 59,1526ETXTBSY: 74,1527EFBIG: 22,1528ENOSPC: 51,1529ESPIPE: 70,1530EROFS: 69,1531EMLINK: 34,1532EPIPE: 64,1533EDOM: 18,1534ERANGE: 68,1535ENOMSG: 49,1536EIDRM: 24,1537ECHRNG: 106,1538EL2NSYNC: 156,1539EL3HLT: 107,1540EL3RST: 108,1541ELNRNG: 109,1542EUNATCH: 110,1543ENOCSI: 111,1544EL2HLT: 112,1545EDEADLK: 16,1546ENOLCK: 46,1547EBADE: 113,1548EBADR: 114,1549EXFULL: 115,1550ENOANO: 104,1551EBADRQC: 103,1552EBADSLT: 102,1553EDEADLOCK: 16,1554EBFONT: 101,1555ENOSTR: 100,1556ENODATA: 116,1557ETIME: 117,1558ENOSR: 118,1559ENONET: 119,1560ENOPKG: 120,1561EREMOTE: 121,1562ENOLINK: 47,1563EADV: 122,1564ESRMNT: 123,1565ECOMM: 124,1566EPROTO: 65,1567EMULTIHOP: 36,1568EDOTDOT: 125,1569EBADMSG: 9,1570ENOTUNIQ: 126,1571EBADFD: 127,1572EREMCHG: 128,1573ELIBACC: 129,1574ELIBBAD: 130,1575ELIBSCN: 131,1576ELIBMAX: 132,1577ELIBEXEC: 133,1578ENOSYS: 52,1579ENOTEMPTY: 55,1580ENAMETOOLONG: 37,1581ELOOP: 32,1582EOPNOTSUPP: 138,1583EPFNOSUPPORT: 139,1584ECONNRESET: 15,1585ENOBUFS: 42,1586EAFNOSUPPORT: 5,1587EPROTOTYPE: 67,1588ENOTSOCK: 57,1589ENOPROTOOPT: 50,1590ESHUTDOWN: 140,1591ECONNREFUSED: 14,1592EADDRINUSE: 3,1593ECONNABORTED: 13,1594ENETUNREACH: 40,1595ENETDOWN: 38,1596ETIMEDOUT: 73,1597EHOSTDOWN: 142,1598EHOSTUNREACH: 23,1599EINPROGRESS: 26,1600EALREADY: 7,1601EDESTADDRREQ: 17,1602EMSGSIZE: 35,1603EPROTONOSUPPORT: 66,1604ESOCKTNOSUPPORT: 137,1605EADDRNOTAVAIL: 4,1606ENETRESET: 39,1607EISCONN: 30,1608ENOTCONN: 53,1609ETOOMANYREFS: 141,1610EUSERS: 136,1611EDQUOT: 19,1612ESTALE: 72,1613ENOTSUP: 138,1614ENOMEDIUM: 148,1615EILSEQ: 25,1616EOVERFLOW: 61,1617ECANCELED: 11,1618ENOTRECOVERABLE: 56,1619EOWNERDEAD: 62,1620ESTRPIPE: 1351621};16221623function _emscripten_futex_wake(addr, count) {1624if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0 || count < 0) return -28;1625if (count == 0) return 0;1626if (count >= 2147483647) count = Infinity;1627assert(__emscripten_main_thread_futex > 0);1628var mainThreadWaitAddress = Atomics.load(GROWABLE_HEAP_I32(), __emscripten_main_thread_futex >> 2);1629var mainThreadWoken = 0;1630if (mainThreadWaitAddress == addr) {1631assert(!ENVIRONMENT_IS_WEB);1632var loadedAddr = Atomics.compareExchange(GROWABLE_HEAP_I32(), __emscripten_main_thread_futex >> 2, mainThreadWaitAddress, 0);1633if (loadedAddr == mainThreadWaitAddress) {1634--count;1635mainThreadWoken = 1;1636if (count <= 0) return 1;1637}1638}1639var ret = Atomics.notify(GROWABLE_HEAP_I32(), addr >> 2, count);1640if (ret >= 0) return ret + mainThreadWoken;1641throw "Atomics.notify returned an unexpected value " + ret;1642}16431644Module["_emscripten_futex_wake"] = _emscripten_futex_wake;16451646function killThread(pthread_ptr) {1647if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! killThread() can only ever be called from main application thread!";1648if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in killThread!";1649GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0;1650var pthread = PThread.pthreads[pthread_ptr];1651pthread.worker.terminate();1652PThread.freeThreadData(pthread);1653PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker), 1);1654pthread.worker.pthread = undefined;1655}16561657function cancelThread(pthread_ptr) {1658if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! cancelThread() can only ever be called from main application thread!";1659if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in cancelThread!";1660var pthread = PThread.pthreads[pthread_ptr];1661pthread.worker.postMessage({1662"cmd": "cancel"1663});1664}16651666function cleanupThread(pthread_ptr) {1667if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! cleanupThread() can only ever be called from main application thread!";1668if (!pthread_ptr) throw "Internal Error! Null pthread_ptr in cleanupThread!";1669var pthread = PThread.pthreads[pthread_ptr];1670if (pthread) {1671GROWABLE_HEAP_I32()[pthread_ptr + 12 >> 2] = 0;1672var worker = pthread.worker;1673PThread.returnWorkerToPool(worker);1674}1675}16761677var PThread = {1678unusedWorkers: [],1679runningWorkers: [],1680tlsInitFunctions: [],1681initMainThreadBlock: function() {1682assert(!ENVIRONMENT_IS_PTHREAD);1683},1684initRuntime: function() {1685var tb = _malloc(228);1686for (var i = 0; i < 228 / 4; ++i) GROWABLE_HEAP_U32()[tb / 4 + i] = 0;1687GROWABLE_HEAP_I32()[tb + 12 >> 2] = tb;1688var headPtr = tb + 152;1689GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr;1690var tlsMemory = _malloc(512);1691for (var i = 0; i < 128; ++i) GROWABLE_HEAP_U32()[tlsMemory / 4 + i] = 0;1692Atomics.store(GROWABLE_HEAP_U32(), tb + 100 >> 2, tlsMemory);1693Atomics.store(GROWABLE_HEAP_U32(), tb + 40 >> 2, tb);1694__emscripten_thread_init(tb, !ENVIRONMENT_IS_WORKER, 1);1695_emscripten_register_main_browser_thread_id(tb);1696PThread.mainRuntimeThread = true;1697},1698initWorker: function() {},1699pthreads: {},1700threadExitHandlers: [],1701runExitHandlers: function() {1702while (PThread.threadExitHandlers.length > 0) {1703PThread.threadExitHandlers.pop()();1704}1705if (ENVIRONMENT_IS_PTHREAD && _pthread_self()) ___pthread_tsd_run_dtors();1706},1707runExitHandlersAndDeinitThread: function(tb, exitCode) {1708Atomics.store(GROWABLE_HEAP_U32(), tb + 56 >> 2, 1);1709Atomics.store(GROWABLE_HEAP_U32(), tb + 60 >> 2, 0);1710PThread.runExitHandlers();1711Atomics.store(GROWABLE_HEAP_U32(), tb + 4 >> 2, exitCode);1712Atomics.store(GROWABLE_HEAP_U32(), tb + 0 >> 2, 1);1713_emscripten_futex_wake(tb + 0, 2147483647);1714__emscripten_thread_init(0, 0, 0);1715},1716setExitStatus: function(status) {1717EXITSTATUS = status;1718},1719threadExit: function(exitCode) {1720var tb = _pthread_self();1721if (tb) {1722err("Pthread 0x" + tb.toString(16) + " exited.");1723PThread.runExitHandlersAndDeinitThread(tb, exitCode);1724if (ENVIRONMENT_IS_PTHREAD) {1725postMessage({1726"cmd": "exit"1727});1728}1729}1730},1731threadCancel: function() {1732PThread.runExitHandlersAndDeinitThread(_pthread_self(), -1);1733postMessage({1734"cmd": "cancelDone"1735});1736},1737terminateAllThreads: function() {1738for (var t in PThread.pthreads) {1739var pthread = PThread.pthreads[t];1740if (pthread && pthread.worker) {1741PThread.returnWorkerToPool(pthread.worker);1742}1743}1744PThread.pthreads = {};1745for (var i = 0; i < PThread.unusedWorkers.length; ++i) {1746var worker = PThread.unusedWorkers[i];1747assert(!worker.pthread);1748worker.terminate();1749}1750PThread.unusedWorkers = [];1751for (var i = 0; i < PThread.runningWorkers.length; ++i) {1752var worker = PThread.runningWorkers[i];1753var pthread = worker.pthread;1754assert(pthread, "This Worker should have a pthread it is executing");1755PThread.freeThreadData(pthread);1756worker.terminate();1757}1758PThread.runningWorkers = [];1759},1760freeThreadData: function(pthread) {1761if (!pthread) return;1762if (pthread.threadInfoStruct) {1763var tlsMemory = GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 100 >> 2];1764GROWABLE_HEAP_I32()[pthread.threadInfoStruct + 100 >> 2] = 0;1765_free(tlsMemory);1766_free(pthread.threadInfoStruct);1767}1768pthread.threadInfoStruct = 0;1769if (pthread.allocatedOwnStack && pthread.stackBase) _free(pthread.stackBase);1770pthread.stackBase = 0;1771if (pthread.worker) pthread.worker.pthread = null;1772},1773returnWorkerToPool: function(worker) {1774PThread.runWithoutMainThreadQueuedCalls(function() {1775delete PThread.pthreads[worker.pthread.threadInfoStruct];1776PThread.unusedWorkers.push(worker);1777PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker), 1);1778PThread.freeThreadData(worker.pthread);1779worker.pthread = undefined;1780});1781},1782runWithoutMainThreadQueuedCalls: function(func) {1783assert(PThread.mainRuntimeThread, "runWithoutMainThreadQueuedCalls must be done on the main runtime thread");1784assert(__emscripten_allow_main_runtime_queued_calls);1785GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls >> 2] = 0;1786try {1787func();1788} finally {1789GROWABLE_HEAP_I32()[__emscripten_allow_main_runtime_queued_calls >> 2] = 1;1790}1791},1792receiveObjectTransfer: function(data) {},1793threadInit: function() {1794for (var i in PThread.tlsInitFunctions) {1795PThread.tlsInitFunctions[i]();1796}1797},1798loadWasmModuleToWorker: function(worker, onFinishedLoading) {1799worker.onmessage = function(e) {1800var d = e["data"];1801var cmd = d["cmd"];1802if (worker.pthread) PThread.currentProxiedOperationCallerThread = worker.pthread.threadInfoStruct;1803if (d["targetThread"] && d["targetThread"] != _pthread_self()) {1804var thread = PThread.pthreads[d.targetThread];1805if (thread) {1806thread.worker.postMessage(e.data, d["transferList"]);1807} else {1808console.error('Internal error! Worker sent a message "' + cmd + '" to target pthread ' + d["targetThread"] + ", but that thread no longer exists!");1809}1810PThread.currentProxiedOperationCallerThread = undefined;1811return;1812}1813if (cmd === "processQueuedMainThreadWork") {1814_emscripten_main_thread_process_queued_calls();1815} else if (cmd === "spawnThread") {1816spawnThread(e.data);1817} else if (cmd === "cleanupThread") {1818cleanupThread(d["thread"]);1819} else if (cmd === "killThread") {1820killThread(d["thread"]);1821} else if (cmd === "cancelThread") {1822cancelThread(d["thread"]);1823} else if (cmd === "loaded") {1824worker.loaded = true;1825if (onFinishedLoading) onFinishedLoading(worker);1826if (worker.runPthread) {1827worker.runPthread();1828delete worker.runPthread;1829}1830} else if (cmd === "print") {1831out("Thread " + d["threadId"] + ": " + d["text"]);1832} else if (cmd === "printErr") {1833err("Thread " + d["threadId"] + ": " + d["text"]);1834} else if (cmd === "alert") {1835alert("Thread " + d["threadId"] + ": " + d["text"]);1836} else if (cmd === "exit") {1837var detached = worker.pthread && Atomics.load(GROWABLE_HEAP_U32(), worker.pthread.threadInfoStruct + 64 >> 2);1838if (detached) {1839PThread.returnWorkerToPool(worker);1840}1841} else if (cmd === "exitProcess") {1842err("exitProcess requested by worker");1843try {1844exit(d["returnCode"]);1845} catch (e) {1846if (e instanceof ExitStatus) return;1847throw e;1848}1849} else if (cmd === "cancelDone") {1850PThread.returnWorkerToPool(worker);1851} else if (cmd === "objectTransfer") {1852PThread.receiveObjectTransfer(e.data);1853} else if (e.data.target === "setimmediate") {1854worker.postMessage(e.data);1855} else {1856err("worker sent an unknown command " + cmd);1857}1858PThread.currentProxiedOperationCallerThread = undefined;1859};1860worker.onerror = function(e) {1861err("pthread sent an error! " + e.filename + ":" + e.lineno + ": " + e.message);1862};1863if (ENVIRONMENT_IS_NODE) {1864worker.on("message", function(data) {1865worker.onmessage({1866data: data1867});1868});1869worker.on("error", function(data) {1870worker.onerror(data);1871});1872worker.on("exit", function(data) {});1873}1874assert(wasmMemory instanceof WebAssembly.Memory, "WebAssembly memory should have been loaded by now!");1875assert(wasmModule instanceof WebAssembly.Module, "WebAssembly Module should have been loaded by now!");1876worker.postMessage({1877"cmd": "load",1878"urlOrBlob": Module["mainScriptUrlOrBlob"] || _scriptDir,1879"wasmMemory": wasmMemory,1880"wasmModule": wasmModule1881});1882},1883allocateUnusedWorker: function() {1884var pthreadMainJs = locateFile("sieve.worker.js");1885PThread.unusedWorkers.push(new Worker(pthreadMainJs));1886},1887getNewWorker: function() {1888if (PThread.unusedWorkers.length == 0) {1889PThread.allocateUnusedWorker();1890PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0]);1891}1892return PThread.unusedWorkers.pop();1893},1894busySpinWait: function(msecs) {1895var t = performance.now() + msecs;1896while (performance.now() < t) {1897}1898}1899};19001901function establishStackSpace(stackTop, stackMax) {1902_emscripten_stack_set_limits(stackTop, stackMax);1903stackRestore(stackTop);1904writeStackCookie();1905}19061907Module["establishStackSpace"] = establishStackSpace;19081909function invokeEntryPoint(ptr, arg) {1910return wasmTable.get(ptr)(arg);1911}19121913Module["invokeEntryPoint"] = invokeEntryPoint;19141915function jsStackTrace() {1916var error = new Error();1917if (!error.stack) {1918try {1919throw new Error();1920} catch (e) {1921error = e;1922}1923if (!error.stack) {1924return "(no stack trace available)";1925}1926}1927return error.stack.toString();1928}19291930var runtimeKeepaliveCounter = 0;19311932function keepRuntimeAlive() {1933return noExitRuntime || runtimeKeepaliveCounter > 0;1934}19351936Module["keepRuntimeAlive"] = keepRuntimeAlive;19371938function stackTrace() {1939var js = jsStackTrace();1940if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"]();1941return demangleAll(js);1942}19431944function ___assert_fail(condition, filename, line, func) {1945abort("Assertion failed: " + UTF8ToString(condition) + ", at: " + [ filename ? UTF8ToString(filename) : "unknown filename", line, func ? UTF8ToString(func) : "unknown function" ]);1946}19471948function ___call_main(argc, argv) {1949var returnCode = _main(argc, argv);1950out("Proxied main thread 0x" + _pthread_self().toString(16) + " finished with return code " + returnCode + ". EXIT_RUNTIME=0 set, so keeping main thread alive for asynchronous event operations.");1951}19521953var _emscripten_get_now;19541955if (ENVIRONMENT_IS_NODE) {1956_emscripten_get_now = function() {1957var t = process["hrtime"]();1958return t[0] * 1e3 + t[1] / 1e6;1959};1960} else if (ENVIRONMENT_IS_PTHREAD) {1961_emscripten_get_now = function() {1962return performance.now() - Module["__performance_now_clock_drift"];1963};1964} else if (typeof dateNow !== "undefined") {1965_emscripten_get_now = dateNow;1966} else _emscripten_get_now = function() {1967return performance.now();1968};19691970var _emscripten_get_now_is_monotonic = true;19711972function setErrNo(value) {1973GROWABLE_HEAP_I32()[___errno_location() >> 2] = value;1974return value;1975}19761977function _clock_gettime(clk_id, tp) {1978var now;1979if (clk_id === 0) {1980now = Date.now();1981} else if ((clk_id === 1 || clk_id === 4) && _emscripten_get_now_is_monotonic) {1982now = _emscripten_get_now();1983} else {1984setErrNo(28);1985return -1;1986}1987GROWABLE_HEAP_I32()[tp >> 2] = now / 1e3 | 0;1988GROWABLE_HEAP_I32()[tp + 4 >> 2] = now % 1e3 * 1e3 * 1e3 | 0;1989return 0;1990}19911992function ___clock_gettime(a0, a1) {1993return _clock_gettime(a0, a1);1994}19951996function _pthread_cleanup_push(routine, arg) {1997PThread.threadExitHandlers.push(function() {1998wasmTable.get(routine)(arg);1999});2000}20012002function ___cxa_thread_atexit(a0, a1) {2003return _pthread_cleanup_push(a0, a1);2004}20052006function __emscripten_notify_thread_queue(targetThreadId, mainThreadId) {2007if (targetThreadId == mainThreadId) {2008postMessage({2009"cmd": "processQueuedMainThreadWork"2010});2011} else if (ENVIRONMENT_IS_PTHREAD) {2012postMessage({2013"targetThread": targetThreadId,2014"cmd": "processThreadQueue"2015});2016} else {2017var pthread = PThread.pthreads[targetThreadId];2018var worker = pthread && pthread.worker;2019if (!worker) {2020err("Cannot send message to thread with ID " + targetThreadId + ", unknown thread ID!");2021return;2022}2023worker.postMessage({2024"cmd": "processThreadQueue"2025});2026}2027return 1;2028}20292030var readAsmConstArgsArray = [];20312032function readAsmConstArgs(sigPtr, buf) {2033assert(Array.isArray(readAsmConstArgsArray));2034assert(buf % 16 == 0);2035readAsmConstArgsArray.length = 0;2036var ch;2037buf >>= 2;2038while (ch = GROWABLE_HEAP_U8()[sigPtr++]) {2039assert(ch === 100 || ch === 102 || ch === 105);2040var double = ch < 105;2041if (double && buf & 1) buf++;2042readAsmConstArgsArray.push(double ? GROWABLE_HEAP_F64()[buf++ >> 1] : GROWABLE_HEAP_I32()[buf]);2043++buf;2044}2045return readAsmConstArgsArray;2046}20472048function _emscripten_asm_const_int(code, sigPtr, argbuf) {2049var args = readAsmConstArgs(sigPtr, argbuf);2050if (!ASM_CONSTS.hasOwnProperty(code)) abort("No EM_ASM constant found at address " + code);2051return ASM_CONSTS[code].apply(null, args);2052}20532054function _emscripten_conditional_set_current_thread_status_js(expectedStatus, newStatus) {}20552056function _emscripten_conditional_set_current_thread_status(expectedStatus, newStatus) {}20572058function _emscripten_futex_wait(addr, val, timeout) {2059if (addr <= 0 || addr > GROWABLE_HEAP_I8().length || addr & 3 != 0) return -28;2060if (!ENVIRONMENT_IS_WEB) {2061var ret = Atomics.wait(GROWABLE_HEAP_I32(), addr >> 2, val, timeout);2062if (ret === "timed-out") return -73;2063if (ret === "not-equal") return -6;2064if (ret === "ok") return 0;2065throw "Atomics.wait returned an unexpected value " + ret;2066} else {2067if (Atomics.load(GROWABLE_HEAP_I32(), addr >> 2) != val) {2068return -6;2069}2070var tNow = performance.now();2071var tEnd = tNow + timeout;2072assert(__emscripten_main_thread_futex > 0);2073var lastAddr = Atomics.exchange(GROWABLE_HEAP_I32(), __emscripten_main_thread_futex >> 2, addr);2074assert(lastAddr == 0);2075while (1) {2076tNow = performance.now();2077if (tNow > tEnd) {2078lastAddr = Atomics.exchange(GROWABLE_HEAP_I32(), __emscripten_main_thread_futex >> 2, 0);2079assert(lastAddr == addr || lastAddr == 0);2080return -73;2081}2082lastAddr = Atomics.exchange(GROWABLE_HEAP_I32(), __emscripten_main_thread_futex >> 2, 0);2083assert(lastAddr == addr || lastAddr == 0);2084if (lastAddr == 0) {2085break;2086}2087_emscripten_main_thread_process_queued_calls();2088if (Atomics.load(GROWABLE_HEAP_I32(), addr >> 2) != val) {2089return -6;2090}2091lastAddr = Atomics.exchange(GROWABLE_HEAP_I32(), __emscripten_main_thread_futex >> 2, addr);2092assert(lastAddr == 0);2093}2094return 0;2095}2096}20972098function _emscripten_memcpy_big(dest, src, num) {2099GROWABLE_HEAP_U8().copyWithin(dest, src, src + num);2100}21012102function _emscripten_proxy_to_main_thread_js(index, sync) {2103var numCallArgs = arguments.length - 2;2104if (numCallArgs > 20 - 1) throw "emscripten_proxy_to_main_thread_js: Too many arguments " + numCallArgs + " to proxied function idx=" + index + ", maximum supported is " + (20 - 1) + "!";2105var stack = stackSave();2106var serializedNumCallArgs = numCallArgs;2107var args = stackAlloc(serializedNumCallArgs * 8);2108var b = args >> 3;2109for (var i = 0; i < numCallArgs; i++) {2110var arg = arguments[2 + i];2111GROWABLE_HEAP_F64()[b + i] = arg;2112}2113var ret = _emscripten_run_in_main_runtime_thread_js(index, serializedNumCallArgs, args, sync);2114stackRestore(stack);2115return ret;2116}21172118var _emscripten_receive_on_main_thread_js_callArgs = [];21192120function _emscripten_receive_on_main_thread_js(index, numCallArgs, args) {2121_emscripten_receive_on_main_thread_js_callArgs.length = numCallArgs;2122var b = args >> 3;2123for (var i = 0; i < numCallArgs; i++) {2124_emscripten_receive_on_main_thread_js_callArgs[i] = GROWABLE_HEAP_F64()[b + i];2125}2126var isEmAsmConst = index < 0;2127var func = !isEmAsmConst ? proxiedFunctionTable[index] : ASM_CONSTS[-index - 1];2128assert(func.length == numCallArgs, "Call args mismatch in emscripten_receive_on_main_thread_js");2129return func.apply(null, _emscripten_receive_on_main_thread_js_callArgs);2130}21312132function emscripten_realloc_buffer(size) {2133try {2134wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16);2135updateGlobalBufferAndViews(wasmMemory.buffer);2136return 1;2137} catch (e) {2138console.error("emscripten_realloc_buffer: Attempted to grow heap from " + buffer.byteLength + " bytes to " + size + " bytes, but got error: " + e);2139}2140}21412142function _emscripten_resize_heap(requestedSize) {2143var oldSize = GROWABLE_HEAP_U8().length;2144requestedSize = requestedSize >>> 0;2145if (requestedSize <= oldSize) {2146return false;2147}2148var maxHeapSize = 2147483648;2149if (requestedSize > maxHeapSize) {2150err("Cannot enlarge memory, asked to go up to " + requestedSize + " bytes, but the limit is " + maxHeapSize + " bytes!");2151return false;2152}2153for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {2154var overGrownHeapSize = oldSize * (1 + .2 / cutDown);2155overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);2156var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536));2157var replacement = emscripten_realloc_buffer(newSize);2158if (replacement) {2159return true;2160}2161}2162err("Failed to grow the heap from " + oldSize + " bytes to " + newSize + " bytes, not enough memory!");2163return false;2164}21652166var JSEvents = {2167inEventHandler: 0,2168removeAllEventListeners: function() {2169for (var i = JSEvents.eventHandlers.length - 1; i >= 0; --i) {2170JSEvents._removeHandler(i);2171}2172JSEvents.eventHandlers = [];2173JSEvents.deferredCalls = [];2174},2175registerRemoveEventListeners: function() {2176if (!JSEvents.removeEventListenersRegistered) {2177__ATEXIT__.push(JSEvents.removeAllEventListeners);2178JSEvents.removeEventListenersRegistered = true;2179}2180},2181deferredCalls: [],2182deferCall: function(targetFunction, precedence, argsList) {2183function arraysHaveEqualContent(arrA, arrB) {2184if (arrA.length != arrB.length) return false;2185for (var i in arrA) {2186if (arrA[i] != arrB[i]) return false;2187}2188return true;2189}2190for (var i in JSEvents.deferredCalls) {2191var call = JSEvents.deferredCalls[i];2192if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) {2193return;2194}2195}2196JSEvents.deferredCalls.push({2197targetFunction: targetFunction,2198precedence: precedence,2199argsList: argsList2200});2201JSEvents.deferredCalls.sort(function(x, y) {2202return x.precedence < y.precedence;2203});2204},2205removeDeferredCalls: function(targetFunction) {2206for (var i = 0; i < JSEvents.deferredCalls.length; ++i) {2207if (JSEvents.deferredCalls[i].targetFunction == targetFunction) {2208JSEvents.deferredCalls.splice(i, 1);2209--i;2210}2211}2212},2213canPerformEventHandlerRequests: function() {2214return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls;2215},2216runDeferredCalls: function() {2217if (!JSEvents.canPerformEventHandlerRequests()) {2218return;2219}2220for (var i = 0; i < JSEvents.deferredCalls.length; ++i) {2221var call = JSEvents.deferredCalls[i];2222JSEvents.deferredCalls.splice(i, 1);2223--i;2224call.targetFunction.apply(null, call.argsList);2225}2226},2227eventHandlers: [],2228removeAllHandlersOnTarget: function(target, eventTypeString) {2229for (var i = 0; i < JSEvents.eventHandlers.length; ++i) {2230if (JSEvents.eventHandlers[i].target == target && (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) {2231JSEvents._removeHandler(i--);2232}2233}2234},2235_removeHandler: function(i) {2236var h = JSEvents.eventHandlers[i];2237h.target.removeEventListener(h.eventTypeString, h.eventListenerFunc, h.useCapture);2238JSEvents.eventHandlers.splice(i, 1);2239},2240registerOrRemoveHandler: function(eventHandler) {2241var jsEventHandler = function jsEventHandler(event) {2242++JSEvents.inEventHandler;2243JSEvents.currentEventHandler = eventHandler;2244JSEvents.runDeferredCalls();2245eventHandler.handlerFunc(event);2246JSEvents.runDeferredCalls();2247--JSEvents.inEventHandler;2248};2249if (eventHandler.callbackfunc) {2250eventHandler.eventListenerFunc = jsEventHandler;2251eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture);2252JSEvents.eventHandlers.push(eventHandler);2253JSEvents.registerRemoveEventListeners();2254} else {2255for (var i = 0; i < JSEvents.eventHandlers.length; ++i) {2256if (JSEvents.eventHandlers[i].target == eventHandler.target && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) {2257JSEvents._removeHandler(i--);2258}2259}2260}2261},2262queueEventHandlerOnThread_iiii: function(targetThread, eventHandlerFunc, eventTypeId, eventData, userData) {2263var stackTop = stackSave();2264var varargs = stackAlloc(12);2265GROWABLE_HEAP_I32()[varargs >> 2] = eventTypeId;2266GROWABLE_HEAP_I32()[varargs + 4 >> 2] = eventData;2267GROWABLE_HEAP_I32()[varargs + 8 >> 2] = userData;2268__emscripten_call_on_thread(0, targetThread, 637534208, eventHandlerFunc, eventData, varargs);2269stackRestore(stackTop);2270},2271getTargetThreadForEventCallback: function(targetThread) {2272switch (targetThread) {2273case 1:2274return 0;22752276case 2:2277return PThread.currentProxiedOperationCallerThread;22782279default:2280return targetThread;2281}2282},2283getNodeNameForTarget: function(target) {2284if (!target) return "";2285if (target == window) return "#window";2286if (target == screen) return "#screen";2287return target && target.nodeName ? target.nodeName : "";2288},2289fullscreenEnabled: function() {2290return document.fullscreenEnabled || document.webkitFullscreenEnabled;2291}2292};22932294function stringToNewUTF8(jsString) {2295var length = lengthBytesUTF8(jsString) + 1;2296var cString = _malloc(length);2297stringToUTF8(jsString, cString, length);2298return cString;2299}23002301function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height) {2302var stackTop = stackSave();2303var varargs = stackAlloc(12);2304var targetCanvasPtr = 0;2305if (targetCanvas) {2306targetCanvasPtr = stringToNewUTF8(targetCanvas);2307}2308GROWABLE_HEAP_I32()[varargs >> 2] = targetCanvasPtr;2309GROWABLE_HEAP_I32()[varargs + 4 >> 2] = width;2310GROWABLE_HEAP_I32()[varargs + 8 >> 2] = height;2311__emscripten_call_on_thread(0, targetThread, 657457152, 0, targetCanvasPtr, varargs);2312stackRestore(stackTop);2313}23142315function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread, targetCanvas, width, height) {2316targetCanvas = targetCanvas ? UTF8ToString(targetCanvas) : "";2317_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread, targetCanvas, width, height);2318}23192320function maybeCStringToJsString(cString) {2321return cString > 2 ? UTF8ToString(cString) : cString;2322}23232324var specialHTMLTargets = [ 0, typeof document !== "undefined" ? document : 0, typeof window !== "undefined" ? window : 0 ];23252326function findEventTarget(target) {2327target = maybeCStringToJsString(target);2328var domElement = specialHTMLTargets[target] || (typeof document !== "undefined" ? document.querySelector(target) : undefined);2329return domElement;2330}23312332function findCanvasEventTarget(target) {2333return findEventTarget(target);2334}23352336function _emscripten_set_canvas_element_size_calling_thread(target, width, height) {2337var canvas = findCanvasEventTarget(target);2338if (!canvas) return -4;2339if (canvas.canvasSharedPtr) {2340GROWABLE_HEAP_I32()[canvas.canvasSharedPtr >> 2] = width;2341GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 4 >> 2] = height;2342}2343if (canvas.offscreenCanvas || !canvas.controlTransferredOffscreen) {2344if (canvas.offscreenCanvas) canvas = canvas.offscreenCanvas;2345var autoResizeViewport = false;2346if (canvas.GLctxObject && canvas.GLctxObject.GLctx) {2347var prevViewport = canvas.GLctxObject.GLctx.getParameter(2978);2348autoResizeViewport = prevViewport[0] === 0 && prevViewport[1] === 0 && prevViewport[2] === canvas.width && prevViewport[3] === canvas.height;2349}2350canvas.width = width;2351canvas.height = height;2352if (autoResizeViewport) {2353canvas.GLctxObject.GLctx.viewport(0, 0, width, height);2354}2355} else if (canvas.canvasSharedPtr) {2356var targetThread = GROWABLE_HEAP_I32()[canvas.canvasSharedPtr + 8 >> 2];2357_emscripten_set_offscreencanvas_size_on_target_thread(targetThread, target, width, height);2358return 1;2359} else {2360return -4;2361}2362return 0;2363}23642365function _emscripten_set_canvas_element_size_main_thread(target, width, height) {2366if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(1, 1, target, width, height);2367return _emscripten_set_canvas_element_size_calling_thread(target, width, height);2368}23692370function _emscripten_set_canvas_element_size(target, width, height) {2371var canvas = findCanvasEventTarget(target);2372if (canvas) {2373return _emscripten_set_canvas_element_size_calling_thread(target, width, height);2374} else {2375return _emscripten_set_canvas_element_size_main_thread(target, width, height);2376}2377}23782379function _emscripten_set_current_thread_status_js(newStatus) {}23802381function _emscripten_set_current_thread_status(newStatus) {}23822383function _emscripten_set_thread_name(threadId, name) {}23842385function __webgl_enable_ANGLE_instanced_arrays(ctx) {2386var ext = ctx.getExtension("ANGLE_instanced_arrays");2387if (ext) {2388ctx["vertexAttribDivisor"] = function(index, divisor) {2389ext["vertexAttribDivisorANGLE"](index, divisor);2390};2391ctx["drawArraysInstanced"] = function(mode, first, count, primcount) {2392ext["drawArraysInstancedANGLE"](mode, first, count, primcount);2393};2394ctx["drawElementsInstanced"] = function(mode, count, type, indices, primcount) {2395ext["drawElementsInstancedANGLE"](mode, count, type, indices, primcount);2396};2397return 1;2398}2399}24002401function __webgl_enable_OES_vertex_array_object(ctx) {2402var ext = ctx.getExtension("OES_vertex_array_object");2403if (ext) {2404ctx["createVertexArray"] = function() {2405return ext["createVertexArrayOES"]();2406};2407ctx["deleteVertexArray"] = function(vao) {2408ext["deleteVertexArrayOES"](vao);2409};2410ctx["bindVertexArray"] = function(vao) {2411ext["bindVertexArrayOES"](vao);2412};2413ctx["isVertexArray"] = function(vao) {2414return ext["isVertexArrayOES"](vao);2415};2416return 1;2417}2418}24192420function __webgl_enable_WEBGL_draw_buffers(ctx) {2421var ext = ctx.getExtension("WEBGL_draw_buffers");2422if (ext) {2423ctx["drawBuffers"] = function(n, bufs) {2424ext["drawBuffersWEBGL"](n, bufs);2425};2426return 1;2427}2428}24292430function __webgl_enable_WEBGL_multi_draw(ctx) {2431return !!(ctx.multiDrawWebgl = ctx.getExtension("WEBGL_multi_draw"));2432}24332434var GL = {2435counter: 1,2436buffers: [],2437programs: [],2438framebuffers: [],2439renderbuffers: [],2440textures: [],2441shaders: [],2442vaos: [],2443contexts: {},2444offscreenCanvases: {},2445queries: [],2446stringCache: {},2447unpackAlignment: 4,2448recordError: function recordError(errorCode) {2449if (!GL.lastError) {2450GL.lastError = errorCode;2451}2452},2453getNewId: function(table) {2454var ret = GL.counter++;2455for (var i = table.length; i < ret; i++) {2456table[i] = null;2457}2458return ret;2459},2460getSource: function(shader, count, string, length) {2461var source = "";2462for (var i = 0; i < count; ++i) {2463var len = length ? GROWABLE_HEAP_I32()[length + i * 4 >> 2] : -1;2464source += UTF8ToString(GROWABLE_HEAP_I32()[string + i * 4 >> 2], len < 0 ? undefined : len);2465}2466return source;2467},2468createContext: function(canvas, webGLContextAttributes) {2469if (!canvas.getContextSafariWebGL2Fixed) {2470canvas.getContextSafariWebGL2Fixed = canvas.getContext;2471canvas.getContext = function(ver, attrs) {2472var gl = canvas.getContextSafariWebGL2Fixed(ver, attrs);2473return ver == "webgl" == gl instanceof WebGLRenderingContext ? gl : null;2474};2475}2476var ctx = canvas.getContext("webgl", webGLContextAttributes);2477if (!ctx) return 0;2478var handle = GL.registerContext(ctx, webGLContextAttributes);2479return handle;2480},2481registerContext: function(ctx, webGLContextAttributes) {2482var handle = _malloc(8);2483GROWABLE_HEAP_I32()[handle + 4 >> 2] = _pthread_self();2484var context = {2485handle: handle,2486attributes: webGLContextAttributes,2487version: webGLContextAttributes.majorVersion,2488GLctx: ctx2489};2490if (ctx.canvas) ctx.canvas.GLctxObject = context;2491GL.contexts[handle] = context;2492if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) {2493GL.initExtensions(context);2494}2495return handle;2496},2497makeContextCurrent: function(contextHandle) {2498GL.currentContext = GL.contexts[contextHandle];2499Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx;2500return !(contextHandle && !GLctx);2501},2502getContext: function(contextHandle) {2503return GL.contexts[contextHandle];2504},2505deleteContext: function(contextHandle) {2506if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null;2507if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);2508if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined;2509_free(GL.contexts[contextHandle].handle);2510GL.contexts[contextHandle] = null;2511},2512initExtensions: function(context) {2513if (!context) context = GL.currentContext;2514if (context.initExtensionsDone) return;2515context.initExtensionsDone = true;2516var GLctx = context.GLctx;2517__webgl_enable_ANGLE_instanced_arrays(GLctx);2518__webgl_enable_OES_vertex_array_object(GLctx);2519__webgl_enable_WEBGL_draw_buffers(GLctx);2520{2521GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query");2522}2523__webgl_enable_WEBGL_multi_draw(GLctx);2524var exts = GLctx.getSupportedExtensions() || [];2525exts.forEach(function(ext) {2526if (!ext.includes("lose_context") && !ext.includes("debug")) {2527GLctx.getExtension(ext);2528}2529});2530}2531};25322533var __emscripten_webgl_power_preferences = [ "default", "low-power", "high-performance" ];25342535function _emscripten_webgl_do_create_context(target, attributes) {2536assert(attributes);2537var a = attributes >> 2;2538var powerPreference = GROWABLE_HEAP_I32()[a + (24 >> 2)];2539var contextAttributes = {2540"alpha": !!GROWABLE_HEAP_I32()[a + (0 >> 2)],2541"depth": !!GROWABLE_HEAP_I32()[a + (4 >> 2)],2542"stencil": !!GROWABLE_HEAP_I32()[a + (8 >> 2)],2543"antialias": !!GROWABLE_HEAP_I32()[a + (12 >> 2)],2544"premultipliedAlpha": !!GROWABLE_HEAP_I32()[a + (16 >> 2)],2545"preserveDrawingBuffer": !!GROWABLE_HEAP_I32()[a + (20 >> 2)],2546"powerPreference": __emscripten_webgl_power_preferences[powerPreference],2547"failIfMajorPerformanceCaveat": !!GROWABLE_HEAP_I32()[a + (28 >> 2)],2548majorVersion: GROWABLE_HEAP_I32()[a + (32 >> 2)],2549minorVersion: GROWABLE_HEAP_I32()[a + (36 >> 2)],2550enableExtensionsByDefault: GROWABLE_HEAP_I32()[a + (40 >> 2)],2551explicitSwapControl: GROWABLE_HEAP_I32()[a + (44 >> 2)],2552proxyContextToMainThread: GROWABLE_HEAP_I32()[a + (48 >> 2)],2553renderViaOffscreenBackBuffer: GROWABLE_HEAP_I32()[a + (52 >> 2)]2554};2555var canvas = findCanvasEventTarget(target);2556if (!canvas) {2557return 0;2558}2559if (contextAttributes.explicitSwapControl) {2560return 0;2561}2562var contextHandle = GL.createContext(canvas, contextAttributes);2563return contextHandle;2564}25652566function _emscripten_webgl_create_context(a0, a1) {2567return _emscripten_webgl_do_create_context(a0, a1);2568}25692570function flush_NO_FILESYSTEM() {2571if (typeof _fflush !== "undefined") _fflush(0);2572var buffers = SYSCALLS.buffers;2573if (buffers[1].length) SYSCALLS.printChar(1, 10);2574if (buffers[2].length) SYSCALLS.printChar(2, 10);2575}25762577var SYSCALLS = {2578mappings: {},2579buffers: [ null, [], [] ],2580printChar: function(stream, curr) {2581var buffer = SYSCALLS.buffers[stream];2582assert(buffer);2583if (curr === 0 || curr === 10) {2584(stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));2585buffer.length = 0;2586} else {2587buffer.push(curr);2588}2589},2590varargs: undefined,2591get: function() {2592assert(SYSCALLS.varargs != undefined);2593SYSCALLS.varargs += 4;2594var ret = GROWABLE_HEAP_I32()[SYSCALLS.varargs - 4 >> 2];2595return ret;2596},2597getStr: function(ptr) {2598var ret = UTF8ToString(ptr);2599return ret;2600},2601get64: function(low, high) {2602if (low >= 0) assert(high === 0); else assert(high === -1);2603return low;2604}2605};26062607function _fd_write(fd, iov, iovcnt, pnum) {2608if (ENVIRONMENT_IS_PTHREAD) return _emscripten_proxy_to_main_thread_js(2, 1, fd, iov, iovcnt, pnum);2609var num = 0;2610for (var i = 0; i < iovcnt; i++) {2611var ptr = GROWABLE_HEAP_I32()[iov + i * 8 >> 2];2612var len = GROWABLE_HEAP_I32()[iov + (i * 8 + 4) >> 2];2613for (var j = 0; j < len; j++) {2614SYSCALLS.printChar(fd, GROWABLE_HEAP_U8()[ptr + j]);2615}2616num += len;2617}2618GROWABLE_HEAP_I32()[pnum >> 2] = num;2619return 0;2620}26212622function spawnThread(threadParams) {2623if (ENVIRONMENT_IS_PTHREAD) throw "Internal Error! spawnThread() can only ever be called from main application thread!";2624var worker = PThread.getNewWorker();2625if (!worker) {2626return 6;2627}2628if (worker.pthread !== undefined) throw "Internal error!";2629if (!threadParams.pthread_ptr) throw "Internal error, no pthread ptr!";2630PThread.runningWorkers.push(worker);2631var tlsMemory = _malloc(128 * 4);2632for (var i = 0; i < 128; ++i) {2633GROWABLE_HEAP_I32()[tlsMemory + i * 4 >> 2] = 0;2634}2635var stackHigh = threadParams.stackBase + threadParams.stackSize;2636var pthread = PThread.pthreads[threadParams.pthread_ptr] = {2637worker: worker,2638stackBase: threadParams.stackBase,2639stackSize: threadParams.stackSize,2640allocatedOwnStack: threadParams.allocatedOwnStack,2641threadInfoStruct: threadParams.pthread_ptr2642};2643var tis = pthread.threadInfoStruct >> 2;2644Atomics.store(GROWABLE_HEAP_U32(), tis + (64 >> 2), threadParams.detached);2645Atomics.store(GROWABLE_HEAP_U32(), tis + (100 >> 2), tlsMemory);2646Atomics.store(GROWABLE_HEAP_U32(), tis + (40 >> 2), pthread.threadInfoStruct);2647Atomics.store(GROWABLE_HEAP_U32(), tis + (80 >> 2), threadParams.stackSize);2648Atomics.store(GROWABLE_HEAP_U32(), tis + (76 >> 2), stackHigh);2649Atomics.store(GROWABLE_HEAP_U32(), tis + (104 >> 2), threadParams.stackSize);2650Atomics.store(GROWABLE_HEAP_U32(), tis + (104 + 8 >> 2), stackHigh);2651Atomics.store(GROWABLE_HEAP_U32(), tis + (104 + 12 >> 2), threadParams.detached);2652var global_libc = _emscripten_get_global_libc();2653var global_locale = global_libc + 40;2654Atomics.store(GROWABLE_HEAP_U32(), tis + (172 >> 2), global_locale);2655worker.pthread = pthread;2656var msg = {2657"cmd": "run",2658"start_routine": threadParams.startRoutine,2659"arg": threadParams.arg,2660"threadInfoStruct": threadParams.pthread_ptr,2661"stackBase": threadParams.stackBase,2662"stackSize": threadParams.stackSize2663};2664worker.runPthread = function() {2665msg.time = performance.now();2666worker.postMessage(msg, threadParams.transferList);2667};2668if (worker.loaded) {2669worker.runPthread();2670delete worker.runPthread;2671}2672return 0;2673}26742675function _pthread_create(pthread_ptr, attr, start_routine, arg) {2676if (typeof SharedArrayBuffer === "undefined") {2677err("Current environment does not support SharedArrayBuffer, pthreads are not available!");2678return 6;2679}2680if (!pthread_ptr) {2681err("pthread_create called with a null thread pointer!");2682return 28;2683}2684var transferList = [];2685var error = 0;2686if (ENVIRONMENT_IS_PTHREAD && (transferList.length === 0 || error)) {2687return _emscripten_sync_run_in_main_thread_4(687865856, pthread_ptr, attr, start_routine, arg);2688}2689if (error) return error;2690var stackSize = 0;2691var stackBase = 0;2692var detached = 0;2693if (attr && attr != -1) {2694stackSize = GROWABLE_HEAP_I32()[attr >> 2];2695stackSize += 81920;2696stackBase = GROWABLE_HEAP_I32()[attr + 8 >> 2];2697detached = GROWABLE_HEAP_I32()[attr + 12 >> 2] !== 0;2698} else {2699stackSize = 2097152;2700}2701var allocatedOwnStack = stackBase == 0;2702if (allocatedOwnStack) {2703stackBase = _memalign(16, stackSize);2704} else {2705stackBase -= stackSize;2706assert(stackBase > 0);2707}2708var threadInfoStruct = _malloc(228);2709for (var i = 0; i < 228 >> 2; ++i) GROWABLE_HEAP_U32()[(threadInfoStruct >> 2) + i] = 0;2710GROWABLE_HEAP_I32()[pthread_ptr >> 2] = threadInfoStruct;2711GROWABLE_HEAP_I32()[threadInfoStruct + 12 >> 2] = threadInfoStruct;2712var headPtr = threadInfoStruct + 152;2713GROWABLE_HEAP_I32()[headPtr >> 2] = headPtr;2714var threadParams = {2715stackBase: stackBase,2716stackSize: stackSize,2717allocatedOwnStack: allocatedOwnStack,2718detached: detached,2719startRoutine: start_routine,2720pthread_ptr: threadInfoStruct,2721arg: arg,2722transferList: transferList2723};2724if (ENVIRONMENT_IS_PTHREAD) {2725threadParams.cmd = "spawnThread";2726postMessage(threadParams, transferList);2727return 0;2728}2729return spawnThread(threadParams);2730}27312732function _setTempRet0(val) {2733setTempRet0(val);2734}27352736if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock();27372738var GLctx;27392740var proxiedFunctionTable = [ null, _emscripten_set_canvas_element_size_main_thread, _fd_write ];27412742var ASSERTIONS = true;27432744function intArrayFromString(stringy, dontAddNull, length) {2745var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;2746var u8array = new Array(len);2747var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);2748if (dontAddNull) u8array.length = numBytesWritten;2749return u8array;2750}27512752function intArrayToString(array) {2753var ret = [];2754for (var i = 0; i < array.length; i++) {2755var chr = array[i];2756if (chr > 255) {2757if (ASSERTIONS) {2758assert(false, "Character code " + chr + " (" + String.fromCharCode(chr) + ") at offset " + i + " not in 0x00-0xFF.");2759}2760chr &= 255;2761}2762ret.push(String.fromCharCode(chr));2763}2764return ret.join("");2765}27662767var asmLibraryArg = {2768"__assert_fail": ___assert_fail,2769"__call_main": ___call_main,2770"__clock_gettime": ___clock_gettime,2771"__cxa_thread_atexit": ___cxa_thread_atexit,2772"_emscripten_notify_thread_queue": __emscripten_notify_thread_queue,2773"emscripten_asm_const_int": _emscripten_asm_const_int,2774"emscripten_conditional_set_current_thread_status": _emscripten_conditional_set_current_thread_status,2775"emscripten_futex_wait": _emscripten_futex_wait,2776"emscripten_futex_wake": _emscripten_futex_wake,2777"emscripten_get_now": _emscripten_get_now,2778"emscripten_memcpy_big": _emscripten_memcpy_big,2779"emscripten_receive_on_main_thread_js": _emscripten_receive_on_main_thread_js,2780"emscripten_resize_heap": _emscripten_resize_heap,2781"emscripten_set_canvas_element_size": _emscripten_set_canvas_element_size,2782"emscripten_set_current_thread_status": _emscripten_set_current_thread_status,2783"emscripten_set_thread_name": _emscripten_set_thread_name,2784"emscripten_webgl_create_context": _emscripten_webgl_create_context,2785"fd_write": _fd_write,2786"initPthreadsJS": initPthreadsJS,2787"memory": wasmMemory,2788"pthread_create": _pthread_create,2789"setTempRet0": _setTempRet02790};27912792var asm = createWasm();27932794var ___wasm_call_ctors = Module["___wasm_call_ctors"] = createExportWrapper("__wasm_call_ctors");27952796var _malloc = Module["_malloc"] = createExportWrapper("malloc");27972798var _free = Module["_free"] = createExportWrapper("free");27992800var _fflush = Module["_fflush"] = createExportWrapper("fflush");28012802var _main = Module["_main"] = createExportWrapper("main");28032804var _emscripten_tls_init = Module["_emscripten_tls_init"] = createExportWrapper("emscripten_tls_init");28052806var _emscripten_current_thread_process_queued_calls = Module["_emscripten_current_thread_process_queued_calls"] = createExportWrapper("emscripten_current_thread_process_queued_calls");28072808var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = createExportWrapper("emscripten_register_main_browser_thread_id");28092810var _emscripten_main_browser_thread_id = Module["_emscripten_main_browser_thread_id"] = createExportWrapper("emscripten_main_browser_thread_id");28112812var __emscripten_do_dispatch_to_thread = Module["__emscripten_do_dispatch_to_thread"] = createExportWrapper("_emscripten_do_dispatch_to_thread");28132814var _emscripten_sync_run_in_main_thread_2 = Module["_emscripten_sync_run_in_main_thread_2"] = createExportWrapper("emscripten_sync_run_in_main_thread_2");28152816var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = createExportWrapper("emscripten_sync_run_in_main_thread_4");28172818var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = createExportWrapper("emscripten_main_thread_process_queued_calls");28192820var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = createExportWrapper("emscripten_run_in_main_runtime_thread_js");28212822var __emscripten_call_on_thread = Module["__emscripten_call_on_thread"] = createExportWrapper("_emscripten_call_on_thread");28232824var _emscripten_proxy_main = Module["_emscripten_proxy_main"] = createExportWrapper("emscripten_proxy_main");28252826var __emscripten_thread_init = Module["__emscripten_thread_init"] = createExportWrapper("_emscripten_thread_init");28272828var _pthread_self = Module["_pthread_self"] = createExportWrapper("pthread_self");28292830var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = createExportWrapper("__pthread_tsd_run_dtors");28312832var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = createExportWrapper("emscripten_get_global_libc");28332834var ___errno_location = Module["___errno_location"] = createExportWrapper("__errno_location");28352836var ___emscripten_pthread_data_constructor = Module["___emscripten_pthread_data_constructor"] = createExportWrapper("__emscripten_pthread_data_constructor");28372838var stackSave = Module["stackSave"] = createExportWrapper("stackSave");28392840var stackRestore = Module["stackRestore"] = createExportWrapper("stackRestore");28412842var stackAlloc = Module["stackAlloc"] = createExportWrapper("stackAlloc");28432844var _emscripten_stack_init = Module["_emscripten_stack_init"] = function() {2845return (_emscripten_stack_init = Module["_emscripten_stack_init"] = Module["asm"]["emscripten_stack_init"]).apply(null, arguments);2846};28472848var _emscripten_stack_set_limits = Module["_emscripten_stack_set_limits"] = function() {2849return (_emscripten_stack_set_limits = Module["_emscripten_stack_set_limits"] = Module["asm"]["emscripten_stack_set_limits"]).apply(null, arguments);2850};28512852var _emscripten_stack_get_free = Module["_emscripten_stack_get_free"] = function() {2853return (_emscripten_stack_get_free = Module["_emscripten_stack_get_free"] = Module["asm"]["emscripten_stack_get_free"]).apply(null, arguments);2854};28552856var _emscripten_stack_get_end = Module["_emscripten_stack_get_end"] = function() {2857return (_emscripten_stack_get_end = Module["_emscripten_stack_get_end"] = Module["asm"]["emscripten_stack_get_end"]).apply(null, arguments);2858};28592860var _memalign = Module["_memalign"] = createExportWrapper("memalign");28612862var dynCall_jiji = Module["dynCall_jiji"] = createExportWrapper("dynCall_jiji");28632864var __emscripten_allow_main_runtime_queued_calls = Module["__emscripten_allow_main_runtime_queued_calls"] = 2164;28652866var __emscripten_main_thread_futex = Module["__emscripten_main_thread_futex"] = 3416;28672868if (!Object.getOwnPropertyDescriptor(Module, "intArrayFromString")) Module["intArrayFromString"] = function() {2869abort("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2870};28712872if (!Object.getOwnPropertyDescriptor(Module, "intArrayToString")) Module["intArrayToString"] = function() {2873abort("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2874};28752876if (!Object.getOwnPropertyDescriptor(Module, "ccall")) Module["ccall"] = function() {2877abort("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2878};28792880if (!Object.getOwnPropertyDescriptor(Module, "cwrap")) Module["cwrap"] = function() {2881abort("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2882};28832884if (!Object.getOwnPropertyDescriptor(Module, "setValue")) Module["setValue"] = function() {2885abort("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2886};28872888if (!Object.getOwnPropertyDescriptor(Module, "getValue")) Module["getValue"] = function() {2889abort("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2890};28912892if (!Object.getOwnPropertyDescriptor(Module, "allocate")) Module["allocate"] = function() {2893abort("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2894};28952896if (!Object.getOwnPropertyDescriptor(Module, "UTF8ArrayToString")) Module["UTF8ArrayToString"] = function() {2897abort("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2898};28992900if (!Object.getOwnPropertyDescriptor(Module, "UTF8ToString")) Module["UTF8ToString"] = function() {2901abort("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2902};29032904if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8Array")) Module["stringToUTF8Array"] = function() {2905abort("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2906};29072908if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF8")) Module["stringToUTF8"] = function() {2909abort("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2910};29112912if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF8")) Module["lengthBytesUTF8"] = function() {2913abort("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2914};29152916if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function() {2917abort("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2918};29192920if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun"] = function() {2921abort("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2922};29232924if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function() {2925abort("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2926};29272928if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function() {2929abort("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2930};29312932if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function() {2933abort("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2934};29352936if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function() {2937abort("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2938};29392940if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function() {2941abort("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2942};29432944if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function() {2945abort("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2946};29472948if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function() {2949abort("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2950};29512952if (!Object.getOwnPropertyDescriptor(Module, "addRunDependency")) Module["addRunDependency"] = function() {2953abort("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");2954};29552956if (!Object.getOwnPropertyDescriptor(Module, "removeRunDependency")) Module["removeRunDependency"] = function() {2957abort("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");2958};29592960if (!Object.getOwnPropertyDescriptor(Module, "FS_createFolder")) Module["FS_createFolder"] = function() {2961abort("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2962};29632964if (!Object.getOwnPropertyDescriptor(Module, "FS_createPath")) Module["FS_createPath"] = function() {2965abort("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");2966};29672968if (!Object.getOwnPropertyDescriptor(Module, "FS_createDataFile")) Module["FS_createDataFile"] = function() {2969abort("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");2970};29712972if (!Object.getOwnPropertyDescriptor(Module, "FS_createPreloadedFile")) Module["FS_createPreloadedFile"] = function() {2973abort("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");2974};29752976if (!Object.getOwnPropertyDescriptor(Module, "FS_createLazyFile")) Module["FS_createLazyFile"] = function() {2977abort("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");2978};29792980if (!Object.getOwnPropertyDescriptor(Module, "FS_createLink")) Module["FS_createLink"] = function() {2981abort("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2982};29832984if (!Object.getOwnPropertyDescriptor(Module, "FS_createDevice")) Module["FS_createDevice"] = function() {2985abort("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");2986};29872988if (!Object.getOwnPropertyDescriptor(Module, "FS_unlink")) Module["FS_unlink"] = function() {2989abort("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");2990};29912992if (!Object.getOwnPropertyDescriptor(Module, "getLEB")) Module["getLEB"] = function() {2993abort("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2994};29952996if (!Object.getOwnPropertyDescriptor(Module, "getFunctionTables")) Module["getFunctionTables"] = function() {2997abort("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");2998};29993000if (!Object.getOwnPropertyDescriptor(Module, "alignFunctionTables")) Module["alignFunctionTables"] = function() {3001abort("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3002};30033004if (!Object.getOwnPropertyDescriptor(Module, "registerFunctions")) Module["registerFunctions"] = function() {3005abort("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3006};30073008if (!Object.getOwnPropertyDescriptor(Module, "addFunction")) Module["addFunction"] = function() {3009abort("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3010};30113012if (!Object.getOwnPropertyDescriptor(Module, "removeFunction")) Module["removeFunction"] = function() {3013abort("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3014};30153016if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function() {3017abort("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3018};30193020if (!Object.getOwnPropertyDescriptor(Module, "prettyPrint")) Module["prettyPrint"] = function() {3021abort("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3022};30233024if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function() {3025abort("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3026};30273028if (!Object.getOwnPropertyDescriptor(Module, "getCompilerSetting")) Module["getCompilerSetting"] = function() {3029abort("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3030};30313032if (!Object.getOwnPropertyDescriptor(Module, "print")) Module["print"] = function() {3033abort("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3034};30353036if (!Object.getOwnPropertyDescriptor(Module, "printErr")) Module["printErr"] = function() {3037abort("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3038};30393040if (!Object.getOwnPropertyDescriptor(Module, "getTempRet0")) Module["getTempRet0"] = function() {3041abort("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3042};30433044if (!Object.getOwnPropertyDescriptor(Module, "setTempRet0")) Module["setTempRet0"] = function() {3045abort("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3046};30473048if (!Object.getOwnPropertyDescriptor(Module, "callMain")) Module["callMain"] = function() {3049abort("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3050};30513052if (!Object.getOwnPropertyDescriptor(Module, "abort")) Module["abort"] = function() {3053abort("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3054};30553056if (!Object.getOwnPropertyDescriptor(Module, "stringToNewUTF8")) Module["stringToNewUTF8"] = function() {3057abort("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3058};30593060if (!Object.getOwnPropertyDescriptor(Module, "setFileTime")) Module["setFileTime"] = function() {3061abort("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3062};30633064if (!Object.getOwnPropertyDescriptor(Module, "emscripten_realloc_buffer")) Module["emscripten_realloc_buffer"] = function() {3065abort("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3066};30673068if (!Object.getOwnPropertyDescriptor(Module, "ENV")) Module["ENV"] = function() {3069abort("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3070};30713072if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_CODES")) Module["ERRNO_CODES"] = function() {3073abort("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3074};30753076if (!Object.getOwnPropertyDescriptor(Module, "ERRNO_MESSAGES")) Module["ERRNO_MESSAGES"] = function() {3077abort("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3078};30793080if (!Object.getOwnPropertyDescriptor(Module, "setErrNo")) Module["setErrNo"] = function() {3081abort("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3082};30833084if (!Object.getOwnPropertyDescriptor(Module, "inetPton4")) Module["inetPton4"] = function() {3085abort("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3086};30873088if (!Object.getOwnPropertyDescriptor(Module, "inetNtop4")) Module["inetNtop4"] = function() {3089abort("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3090};30913092if (!Object.getOwnPropertyDescriptor(Module, "inetPton6")) Module["inetPton6"] = function() {3093abort("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3094};30953096if (!Object.getOwnPropertyDescriptor(Module, "inetNtop6")) Module["inetNtop6"] = function() {3097abort("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3098};30993100if (!Object.getOwnPropertyDescriptor(Module, "readSockaddr")) Module["readSockaddr"] = function() {3101abort("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3102};31033104if (!Object.getOwnPropertyDescriptor(Module, "writeSockaddr")) Module["writeSockaddr"] = function() {3105abort("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3106};31073108if (!Object.getOwnPropertyDescriptor(Module, "DNS")) Module["DNS"] = function() {3109abort("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3110};31113112if (!Object.getOwnPropertyDescriptor(Module, "getHostByName")) Module["getHostByName"] = function() {3113abort("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3114};31153116if (!Object.getOwnPropertyDescriptor(Module, "GAI_ERRNO_MESSAGES")) Module["GAI_ERRNO_MESSAGES"] = function() {3117abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3118};31193120if (!Object.getOwnPropertyDescriptor(Module, "Protocols")) Module["Protocols"] = function() {3121abort("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3122};31233124if (!Object.getOwnPropertyDescriptor(Module, "Sockets")) Module["Sockets"] = function() {3125abort("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3126};31273128if (!Object.getOwnPropertyDescriptor(Module, "getRandomDevice")) Module["getRandomDevice"] = function() {3129abort("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3130};31313132if (!Object.getOwnPropertyDescriptor(Module, "traverseStack")) Module["traverseStack"] = function() {3133abort("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3134};31353136if (!Object.getOwnPropertyDescriptor(Module, "UNWIND_CACHE")) Module["UNWIND_CACHE"] = function() {3137abort("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3138};31393140if (!Object.getOwnPropertyDescriptor(Module, "withBuiltinMalloc")) Module["withBuiltinMalloc"] = function() {3141abort("'withBuiltinMalloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3142};31433144if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgsArray")) Module["readAsmConstArgsArray"] = function() {3145abort("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3146};31473148if (!Object.getOwnPropertyDescriptor(Module, "readAsmConstArgs")) Module["readAsmConstArgs"] = function() {3149abort("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3150};31513152if (!Object.getOwnPropertyDescriptor(Module, "mainThreadEM_ASM")) Module["mainThreadEM_ASM"] = function() {3153abort("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3154};31553156if (!Object.getOwnPropertyDescriptor(Module, "jstoi_q")) Module["jstoi_q"] = function() {3157abort("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3158};31593160if (!Object.getOwnPropertyDescriptor(Module, "jstoi_s")) Module["jstoi_s"] = function() {3161abort("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3162};31633164if (!Object.getOwnPropertyDescriptor(Module, "getExecutableName")) Module["getExecutableName"] = function() {3165abort("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3166};31673168if (!Object.getOwnPropertyDescriptor(Module, "listenOnce")) Module["listenOnce"] = function() {3169abort("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3170};31713172if (!Object.getOwnPropertyDescriptor(Module, "autoResumeAudioContext")) Module["autoResumeAudioContext"] = function() {3173abort("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3174};31753176if (!Object.getOwnPropertyDescriptor(Module, "dynCallLegacy")) Module["dynCallLegacy"] = function() {3177abort("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3178};31793180if (!Object.getOwnPropertyDescriptor(Module, "getDynCaller")) Module["getDynCaller"] = function() {3181abort("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3182};31833184if (!Object.getOwnPropertyDescriptor(Module, "dynCall")) Module["dynCall"] = function() {3185abort("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3186};31873188if (!Object.getOwnPropertyDescriptor(Module, "callRuntimeCallbacks")) Module["callRuntimeCallbacks"] = function() {3189abort("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3190};31913192if (!Object.getOwnPropertyDescriptor(Module, "runtimeKeepaliveCounter")) Module["runtimeKeepaliveCounter"] = function() {3193abort("'runtimeKeepaliveCounter' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3194};31953196if (!Object.getOwnPropertyDescriptor(Module, "keepRuntimeAlive")) Module["keepRuntimeAlive"] = function() {3197abort("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3198};31993200if (!Object.getOwnPropertyDescriptor(Module, "runtimeKeepalivePush")) Module["runtimeKeepalivePush"] = function() {3201abort("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3202};32033204if (!Object.getOwnPropertyDescriptor(Module, "runtimeKeepalivePop")) Module["runtimeKeepalivePop"] = function() {3205abort("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3206};32073208if (!Object.getOwnPropertyDescriptor(Module, "callUserCallback")) Module["callUserCallback"] = function() {3209abort("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3210};32113212if (!Object.getOwnPropertyDescriptor(Module, "maybeExit")) Module["maybeExit"] = function() {3213abort("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3214};32153216if (!Object.getOwnPropertyDescriptor(Module, "asmjsMangle")) Module["asmjsMangle"] = function() {3217abort("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3218};32193220if (!Object.getOwnPropertyDescriptor(Module, "reallyNegative")) Module["reallyNegative"] = function() {3221abort("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3222};32233224if (!Object.getOwnPropertyDescriptor(Module, "unSign")) Module["unSign"] = function() {3225abort("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3226};32273228if (!Object.getOwnPropertyDescriptor(Module, "reSign")) Module["reSign"] = function() {3229abort("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3230};32313232if (!Object.getOwnPropertyDescriptor(Module, "formatString")) Module["formatString"] = function() {3233abort("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3234};32353236if (!Object.getOwnPropertyDescriptor(Module, "PATH")) Module["PATH"] = function() {3237abort("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3238};32393240if (!Object.getOwnPropertyDescriptor(Module, "PATH_FS")) Module["PATH_FS"] = function() {3241abort("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3242};32433244if (!Object.getOwnPropertyDescriptor(Module, "SYSCALLS")) Module["SYSCALLS"] = function() {3245abort("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3246};32473248if (!Object.getOwnPropertyDescriptor(Module, "syscallMmap2")) Module["syscallMmap2"] = function() {3249abort("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3250};32513252if (!Object.getOwnPropertyDescriptor(Module, "syscallMunmap")) Module["syscallMunmap"] = function() {3253abort("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3254};32553256if (!Object.getOwnPropertyDescriptor(Module, "getSocketFromFD")) Module["getSocketFromFD"] = function() {3257abort("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3258};32593260if (!Object.getOwnPropertyDescriptor(Module, "getSocketAddress")) Module["getSocketAddress"] = function() {3261abort("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3262};32633264if (!Object.getOwnPropertyDescriptor(Module, "JSEvents")) Module["JSEvents"] = function() {3265abort("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3266};32673268if (!Object.getOwnPropertyDescriptor(Module, "registerKeyEventCallback")) Module["registerKeyEventCallback"] = function() {3269abort("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3270};32713272if (!Object.getOwnPropertyDescriptor(Module, "specialHTMLTargets")) Module["specialHTMLTargets"] = function() {3273abort("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3274};32753276if (!Object.getOwnPropertyDescriptor(Module, "maybeCStringToJsString")) Module["maybeCStringToJsString"] = function() {3277abort("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3278};32793280if (!Object.getOwnPropertyDescriptor(Module, "findEventTarget")) Module["findEventTarget"] = function() {3281abort("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3282};32833284if (!Object.getOwnPropertyDescriptor(Module, "findCanvasEventTarget")) Module["findCanvasEventTarget"] = function() {3285abort("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3286};32873288if (!Object.getOwnPropertyDescriptor(Module, "getBoundingClientRect")) Module["getBoundingClientRect"] = function() {3289abort("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3290};32913292if (!Object.getOwnPropertyDescriptor(Module, "fillMouseEventData")) Module["fillMouseEventData"] = function() {3293abort("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3294};32953296if (!Object.getOwnPropertyDescriptor(Module, "registerMouseEventCallback")) Module["registerMouseEventCallback"] = function() {3297abort("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3298};32993300if (!Object.getOwnPropertyDescriptor(Module, "registerWheelEventCallback")) Module["registerWheelEventCallback"] = function() {3301abort("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3302};33033304if (!Object.getOwnPropertyDescriptor(Module, "registerUiEventCallback")) Module["registerUiEventCallback"] = function() {3305abort("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3306};33073308if (!Object.getOwnPropertyDescriptor(Module, "registerFocusEventCallback")) Module["registerFocusEventCallback"] = function() {3309abort("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3310};33113312if (!Object.getOwnPropertyDescriptor(Module, "fillDeviceOrientationEventData")) Module["fillDeviceOrientationEventData"] = function() {3313abort("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3314};33153316if (!Object.getOwnPropertyDescriptor(Module, "registerDeviceOrientationEventCallback")) Module["registerDeviceOrientationEventCallback"] = function() {3317abort("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3318};33193320if (!Object.getOwnPropertyDescriptor(Module, "fillDeviceMotionEventData")) Module["fillDeviceMotionEventData"] = function() {3321abort("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3322};33233324if (!Object.getOwnPropertyDescriptor(Module, "registerDeviceMotionEventCallback")) Module["registerDeviceMotionEventCallback"] = function() {3325abort("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3326};33273328if (!Object.getOwnPropertyDescriptor(Module, "screenOrientation")) Module["screenOrientation"] = function() {3329abort("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3330};33313332if (!Object.getOwnPropertyDescriptor(Module, "fillOrientationChangeEventData")) Module["fillOrientationChangeEventData"] = function() {3333abort("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3334};33353336if (!Object.getOwnPropertyDescriptor(Module, "registerOrientationChangeEventCallback")) Module["registerOrientationChangeEventCallback"] = function() {3337abort("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3338};33393340if (!Object.getOwnPropertyDescriptor(Module, "fillFullscreenChangeEventData")) Module["fillFullscreenChangeEventData"] = function() {3341abort("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3342};33433344if (!Object.getOwnPropertyDescriptor(Module, "registerFullscreenChangeEventCallback")) Module["registerFullscreenChangeEventCallback"] = function() {3345abort("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3346};33473348if (!Object.getOwnPropertyDescriptor(Module, "registerRestoreOldStyle")) Module["registerRestoreOldStyle"] = function() {3349abort("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3350};33513352if (!Object.getOwnPropertyDescriptor(Module, "hideEverythingExceptGivenElement")) Module["hideEverythingExceptGivenElement"] = function() {3353abort("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3354};33553356if (!Object.getOwnPropertyDescriptor(Module, "restoreHiddenElements")) Module["restoreHiddenElements"] = function() {3357abort("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3358};33593360if (!Object.getOwnPropertyDescriptor(Module, "setLetterbox")) Module["setLetterbox"] = function() {3361abort("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3362};33633364if (!Object.getOwnPropertyDescriptor(Module, "currentFullscreenStrategy")) Module["currentFullscreenStrategy"] = function() {3365abort("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3366};33673368if (!Object.getOwnPropertyDescriptor(Module, "restoreOldWindowedStyle")) Module["restoreOldWindowedStyle"] = function() {3369abort("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3370};33713372if (!Object.getOwnPropertyDescriptor(Module, "softFullscreenResizeWebGLRenderTarget")) Module["softFullscreenResizeWebGLRenderTarget"] = function() {3373abort("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3374};33753376if (!Object.getOwnPropertyDescriptor(Module, "doRequestFullscreen")) Module["doRequestFullscreen"] = function() {3377abort("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3378};33793380if (!Object.getOwnPropertyDescriptor(Module, "fillPointerlockChangeEventData")) Module["fillPointerlockChangeEventData"] = function() {3381abort("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3382};33833384if (!Object.getOwnPropertyDescriptor(Module, "registerPointerlockChangeEventCallback")) Module["registerPointerlockChangeEventCallback"] = function() {3385abort("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3386};33873388if (!Object.getOwnPropertyDescriptor(Module, "registerPointerlockErrorEventCallback")) Module["registerPointerlockErrorEventCallback"] = function() {3389abort("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3390};33913392if (!Object.getOwnPropertyDescriptor(Module, "requestPointerLock")) Module["requestPointerLock"] = function() {3393abort("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3394};33953396if (!Object.getOwnPropertyDescriptor(Module, "fillVisibilityChangeEventData")) Module["fillVisibilityChangeEventData"] = function() {3397abort("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3398};33993400if (!Object.getOwnPropertyDescriptor(Module, "registerVisibilityChangeEventCallback")) Module["registerVisibilityChangeEventCallback"] = function() {3401abort("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3402};34033404if (!Object.getOwnPropertyDescriptor(Module, "registerTouchEventCallback")) Module["registerTouchEventCallback"] = function() {3405abort("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3406};34073408if (!Object.getOwnPropertyDescriptor(Module, "fillGamepadEventData")) Module["fillGamepadEventData"] = function() {3409abort("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3410};34113412if (!Object.getOwnPropertyDescriptor(Module, "registerGamepadEventCallback")) Module["registerGamepadEventCallback"] = function() {3413abort("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3414};34153416if (!Object.getOwnPropertyDescriptor(Module, "registerBeforeUnloadEventCallback")) Module["registerBeforeUnloadEventCallback"] = function() {3417abort("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3418};34193420if (!Object.getOwnPropertyDescriptor(Module, "fillBatteryEventData")) Module["fillBatteryEventData"] = function() {3421abort("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3422};34233424if (!Object.getOwnPropertyDescriptor(Module, "battery")) Module["battery"] = function() {3425abort("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3426};34273428if (!Object.getOwnPropertyDescriptor(Module, "registerBatteryEventCallback")) Module["registerBatteryEventCallback"] = function() {3429abort("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3430};34313432if (!Object.getOwnPropertyDescriptor(Module, "setCanvasElementSize")) Module["setCanvasElementSize"] = function() {3433abort("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3434};34353436if (!Object.getOwnPropertyDescriptor(Module, "getCanvasElementSize")) Module["getCanvasElementSize"] = function() {3437abort("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3438};34393440if (!Object.getOwnPropertyDescriptor(Module, "polyfillSetImmediate")) Module["polyfillSetImmediate"] = function() {3441abort("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3442};34433444if (!Object.getOwnPropertyDescriptor(Module, "demangle")) Module["demangle"] = function() {3445abort("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3446};34473448if (!Object.getOwnPropertyDescriptor(Module, "demangleAll")) Module["demangleAll"] = function() {3449abort("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3450};34513452if (!Object.getOwnPropertyDescriptor(Module, "jsStackTrace")) Module["jsStackTrace"] = function() {3453abort("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3454};34553456if (!Object.getOwnPropertyDescriptor(Module, "stackTrace")) Module["stackTrace"] = function() {3457abort("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3458};34593460if (!Object.getOwnPropertyDescriptor(Module, "getEnvStrings")) Module["getEnvStrings"] = function() {3461abort("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3462};34633464if (!Object.getOwnPropertyDescriptor(Module, "checkWasiClock")) Module["checkWasiClock"] = function() {3465abort("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3466};34673468if (!Object.getOwnPropertyDescriptor(Module, "flush_NO_FILESYSTEM")) Module["flush_NO_FILESYSTEM"] = function() {3469abort("'flush_NO_FILESYSTEM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3470};34713472if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64")) Module["writeI53ToI64"] = function() {3473abort("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3474};34753476if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Clamped")) Module["writeI53ToI64Clamped"] = function() {3477abort("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3478};34793480if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToI64Signaling")) Module["writeI53ToI64Signaling"] = function() {3481abort("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3482};34833484if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Clamped")) Module["writeI53ToU64Clamped"] = function() {3485abort("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3486};34873488if (!Object.getOwnPropertyDescriptor(Module, "writeI53ToU64Signaling")) Module["writeI53ToU64Signaling"] = function() {3489abort("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3490};34913492if (!Object.getOwnPropertyDescriptor(Module, "readI53FromI64")) Module["readI53FromI64"] = function() {3493abort("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3494};34953496if (!Object.getOwnPropertyDescriptor(Module, "readI53FromU64")) Module["readI53FromU64"] = function() {3497abort("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3498};34993500if (!Object.getOwnPropertyDescriptor(Module, "convertI32PairToI53")) Module["convertI32PairToI53"] = function() {3501abort("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3502};35033504if (!Object.getOwnPropertyDescriptor(Module, "convertU32PairToI53")) Module["convertU32PairToI53"] = function() {3505abort("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3506};35073508if (!Object.getOwnPropertyDescriptor(Module, "uncaughtExceptionCount")) Module["uncaughtExceptionCount"] = function() {3509abort("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3510};35113512if (!Object.getOwnPropertyDescriptor(Module, "exceptionLast")) Module["exceptionLast"] = function() {3513abort("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3514};35153516if (!Object.getOwnPropertyDescriptor(Module, "exceptionCaught")) Module["exceptionCaught"] = function() {3517abort("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3518};35193520if (!Object.getOwnPropertyDescriptor(Module, "ExceptionInfoAttrs")) Module["ExceptionInfoAttrs"] = function() {3521abort("'ExceptionInfoAttrs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3522};35233524if (!Object.getOwnPropertyDescriptor(Module, "ExceptionInfo")) Module["ExceptionInfo"] = function() {3525abort("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3526};35273528if (!Object.getOwnPropertyDescriptor(Module, "CatchInfo")) Module["CatchInfo"] = function() {3529abort("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3530};35313532if (!Object.getOwnPropertyDescriptor(Module, "exception_addRef")) Module["exception_addRef"] = function() {3533abort("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3534};35353536if (!Object.getOwnPropertyDescriptor(Module, "exception_decRef")) Module["exception_decRef"] = function() {3537abort("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3538};35393540if (!Object.getOwnPropertyDescriptor(Module, "Browser")) Module["Browser"] = function() {3541abort("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3542};35433544if (!Object.getOwnPropertyDescriptor(Module, "funcWrappers")) Module["funcWrappers"] = function() {3545abort("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3546};35473548if (!Object.getOwnPropertyDescriptor(Module, "getFuncWrapper")) Module["getFuncWrapper"] = function() {3549abort("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3550};35513552if (!Object.getOwnPropertyDescriptor(Module, "setMainLoop")) Module["setMainLoop"] = function() {3553abort("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3554};35553556if (!Object.getOwnPropertyDescriptor(Module, "tempFixedLengthArray")) Module["tempFixedLengthArray"] = function() {3557abort("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3558};35593560if (!Object.getOwnPropertyDescriptor(Module, "miniTempWebGLFloatBuffers")) Module["miniTempWebGLFloatBuffers"] = function() {3561abort("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3562};35633564if (!Object.getOwnPropertyDescriptor(Module, "heapObjectForWebGLType")) Module["heapObjectForWebGLType"] = function() {3565abort("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3566};35673568if (!Object.getOwnPropertyDescriptor(Module, "heapAccessShiftForWebGLHeap")) Module["heapAccessShiftForWebGLHeap"] = function() {3569abort("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3570};35713572if (!Object.getOwnPropertyDescriptor(Module, "GL")) Module["GL"] = function() {3573abort("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3574};35753576if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGet")) Module["emscriptenWebGLGet"] = function() {3577abort("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3578};35793580if (!Object.getOwnPropertyDescriptor(Module, "computeUnpackAlignedImageSize")) Module["computeUnpackAlignedImageSize"] = function() {3581abort("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3582};35833584if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetTexPixelData")) Module["emscriptenWebGLGetTexPixelData"] = function() {3585abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3586};35873588if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetUniform")) Module["emscriptenWebGLGetUniform"] = function() {3589abort("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3590};35913592if (!Object.getOwnPropertyDescriptor(Module, "webglGetUniformLocation")) Module["webglGetUniformLocation"] = function() {3593abort("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3594};35953596if (!Object.getOwnPropertyDescriptor(Module, "webglPrepareUniformLocationsBeforeFirstUse")) Module["webglPrepareUniformLocationsBeforeFirstUse"] = function() {3597abort("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3598};35993600if (!Object.getOwnPropertyDescriptor(Module, "webglGetLeftBracePos")) Module["webglGetLeftBracePos"] = function() {3601abort("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3602};36033604if (!Object.getOwnPropertyDescriptor(Module, "emscriptenWebGLGetVertexAttrib")) Module["emscriptenWebGLGetVertexAttrib"] = function() {3605abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3606};36073608if (!Object.getOwnPropertyDescriptor(Module, "writeGLArray")) Module["writeGLArray"] = function() {3609abort("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3610};36113612if (!Object.getOwnPropertyDescriptor(Module, "FS")) Module["FS"] = function() {3613abort("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3614};36153616if (!Object.getOwnPropertyDescriptor(Module, "mmapAlloc")) Module["mmapAlloc"] = function() {3617abort("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3618};36193620if (!Object.getOwnPropertyDescriptor(Module, "MEMFS")) Module["MEMFS"] = function() {3621abort("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3622};36233624if (!Object.getOwnPropertyDescriptor(Module, "TTY")) Module["TTY"] = function() {3625abort("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3626};36273628if (!Object.getOwnPropertyDescriptor(Module, "PIPEFS")) Module["PIPEFS"] = function() {3629abort("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3630};36313632if (!Object.getOwnPropertyDescriptor(Module, "SOCKFS")) Module["SOCKFS"] = function() {3633abort("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3634};36353636if (!Object.getOwnPropertyDescriptor(Module, "_setNetworkCallback")) Module["_setNetworkCallback"] = function() {3637abort("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3638};36393640if (!Object.getOwnPropertyDescriptor(Module, "AL")) Module["AL"] = function() {3641abort("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3642};36433644if (!Object.getOwnPropertyDescriptor(Module, "SDL_unicode")) Module["SDL_unicode"] = function() {3645abort("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3646};36473648if (!Object.getOwnPropertyDescriptor(Module, "SDL_ttfContext")) Module["SDL_ttfContext"] = function() {3649abort("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3650};36513652if (!Object.getOwnPropertyDescriptor(Module, "SDL_audio")) Module["SDL_audio"] = function() {3653abort("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3654};36553656if (!Object.getOwnPropertyDescriptor(Module, "SDL")) Module["SDL"] = function() {3657abort("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3658};36593660if (!Object.getOwnPropertyDescriptor(Module, "SDL_gfx")) Module["SDL_gfx"] = function() {3661abort("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3662};36633664if (!Object.getOwnPropertyDescriptor(Module, "GLUT")) Module["GLUT"] = function() {3665abort("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3666};36673668if (!Object.getOwnPropertyDescriptor(Module, "EGL")) Module["EGL"] = function() {3669abort("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3670};36713672if (!Object.getOwnPropertyDescriptor(Module, "GLFW_Window")) Module["GLFW_Window"] = function() {3673abort("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3674};36753676if (!Object.getOwnPropertyDescriptor(Module, "GLFW")) Module["GLFW"] = function() {3677abort("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3678};36793680if (!Object.getOwnPropertyDescriptor(Module, "GLEW")) Module["GLEW"] = function() {3681abort("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3682};36833684if (!Object.getOwnPropertyDescriptor(Module, "IDBStore")) Module["IDBStore"] = function() {3685abort("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3686};36873688if (!Object.getOwnPropertyDescriptor(Module, "runAndAbortIfError")) Module["runAndAbortIfError"] = function() {3689abort("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3690};36913692Module["PThread"] = PThread;36933694if (!Object.getOwnPropertyDescriptor(Module, "killThread")) Module["killThread"] = function() {3695abort("'killThread' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3696};36973698if (!Object.getOwnPropertyDescriptor(Module, "cleanupThread")) Module["cleanupThread"] = function() {3699abort("'cleanupThread' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3700};37013702if (!Object.getOwnPropertyDescriptor(Module, "cancelThread")) Module["cancelThread"] = function() {3703abort("'cancelThread' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3704};37053706if (!Object.getOwnPropertyDescriptor(Module, "spawnThread")) Module["spawnThread"] = function() {3707abort("'spawnThread' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3708};37093710if (!Object.getOwnPropertyDescriptor(Module, "establishStackSpace")) Module["establishStackSpace"] = function() {3711abort("'establishStackSpace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3712};37133714if (!Object.getOwnPropertyDescriptor(Module, "invokeEntryPoint")) Module["invokeEntryPoint"] = function() {3715abort("'invokeEntryPoint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3716};37173718if (!Object.getOwnPropertyDescriptor(Module, "warnOnce")) Module["warnOnce"] = function() {3719abort("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3720};37213722if (!Object.getOwnPropertyDescriptor(Module, "stackSave")) Module["stackSave"] = function() {3723abort("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3724};37253726if (!Object.getOwnPropertyDescriptor(Module, "stackRestore")) Module["stackRestore"] = function() {3727abort("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3728};37293730if (!Object.getOwnPropertyDescriptor(Module, "stackAlloc")) Module["stackAlloc"] = function() {3731abort("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3732};37333734if (!Object.getOwnPropertyDescriptor(Module, "AsciiToString")) Module["AsciiToString"] = function() {3735abort("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3736};37373738if (!Object.getOwnPropertyDescriptor(Module, "stringToAscii")) Module["stringToAscii"] = function() {3739abort("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3740};37413742if (!Object.getOwnPropertyDescriptor(Module, "UTF16ToString")) Module["UTF16ToString"] = function() {3743abort("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3744};37453746if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF16")) Module["stringToUTF16"] = function() {3747abort("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3748};37493750if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF16")) Module["lengthBytesUTF16"] = function() {3751abort("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3752};37533754if (!Object.getOwnPropertyDescriptor(Module, "UTF32ToString")) Module["UTF32ToString"] = function() {3755abort("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3756};37573758if (!Object.getOwnPropertyDescriptor(Module, "stringToUTF32")) Module["stringToUTF32"] = function() {3759abort("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3760};37613762if (!Object.getOwnPropertyDescriptor(Module, "lengthBytesUTF32")) Module["lengthBytesUTF32"] = function() {3763abort("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3764};37653766if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8")) Module["allocateUTF8"] = function() {3767abort("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3768};37693770if (!Object.getOwnPropertyDescriptor(Module, "allocateUTF8OnStack")) Module["allocateUTF8OnStack"] = function() {3771abort("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3772};37733774Module["writeStackCookie"] = writeStackCookie;37753776Module["checkStackCookie"] = checkStackCookie;37773778Module["PThread"] = PThread;37793780Module["wasmMemory"] = wasmMemory;37813782Module["ExitStatus"] = ExitStatus;37833784if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_NORMAL")) Object.defineProperty(Module, "ALLOC_NORMAL", {3785configurable: true,3786get: function() {3787abort("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3788}3789});37903791if (!Object.getOwnPropertyDescriptor(Module, "ALLOC_STACK")) Object.defineProperty(Module, "ALLOC_STACK", {3792configurable: true,3793get: function() {3794abort("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");3795}3796});37973798var calledRun;37993800function ExitStatus(status) {3801this.name = "ExitStatus";3802this.message = "Program terminated with exit(" + status + ")";3803this.status = status;3804}38053806var calledMain = false;38073808dependenciesFulfilled = function runCaller() {3809if (!calledRun) run();3810if (!calledRun) dependenciesFulfilled = runCaller;3811};38123813function callMain(args) {3814assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])');3815assert(__ATPRERUN__.length == 0, "cannot call main when preRun functions remain to be called");3816var entryFunction = Module["_emscripten_proxy_main"];3817args = args || [];3818var argc = args.length + 1;3819var argv = stackAlloc((argc + 1) * 4);3820GROWABLE_HEAP_I32()[argv >> 2] = allocateUTF8OnStack(thisProgram);3821for (var i = 1; i < argc; i++) {3822GROWABLE_HEAP_I32()[(argv >> 2) + i] = allocateUTF8OnStack(args[i - 1]);3823}3824GROWABLE_HEAP_I32()[(argv >> 2) + argc] = 0;3825try {3826var ret = entryFunction(argc, argv);3827assert(ret == 0, "_emscripten_proxy_main failed to start proxy thread: " + ret);3828} finally {3829calledMain = true;3830}3831}38323833function stackCheckInit() {3834_emscripten_stack_init();3835writeStackCookie();3836}38373838function run(args) {3839args = args || arguments_;3840if (runDependencies > 0) {3841return;3842}3843stackCheckInit();3844if (ENVIRONMENT_IS_PTHREAD) {3845initRuntime();3846postMessage({3847"cmd": "loaded"3848});3849return;3850}3851preRun();3852if (runDependencies > 0) {3853return;3854}3855function doRun() {3856if (calledRun) return;3857calledRun = true;3858Module["calledRun"] = true;3859if (ABORT) return;3860initRuntime();3861preMain();3862if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();3863if (shouldRunNow) callMain(args);3864postRun();3865}3866if (Module["setStatus"]) {3867Module["setStatus"]("Running...");3868setTimeout(function() {3869setTimeout(function() {3870Module["setStatus"]("");3871}, 1);3872doRun();3873}, 1);3874} else {3875doRun();3876}3877checkStackCookie();3878}38793880Module["run"] = run;38813882function checkUnflushedContent() {3883var oldOut = out;3884var oldErr = err;3885var has = false;3886out = err = function(x) {3887has = true;3888};3889try {3890var flush = flush_NO_FILESYSTEM;3891if (flush) flush();3892} catch (e) {}3893out = oldOut;3894err = oldErr;3895if (has) {3896warnOnce("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.");3897warnOnce("(this may also be due to not including full filesystem support - try building with -s FORCE_FILESYSTEM=1)");3898}3899}39003901function exit(status, implicit) {3902EXITSTATUS = status;3903checkUnflushedContent();3904if (implicit && keepRuntimeAlive() && status === 0) {3905return;3906}3907if (!implicit) {3908if (ENVIRONMENT_IS_PTHREAD) {3909err("Pthread 0x" + _pthread_self().toString(16) + " called exit(), posting exitProcess.");3910postMessage({3911"cmd": "exitProcess",3912"returnCode": status3913});3914throw new ExitStatus(status);3915} else {3916err("main thread called exit: keepRuntimeAlive=" + keepRuntimeAlive() + " (counter=" + runtimeKeepaliveCounter + ")");3917}3918}3919if (keepRuntimeAlive()) {3920if (!implicit) {3921var msg = "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)";3922err(msg);3923}3924} else {3925PThread.terminateAllThreads();3926exitRuntime();3927if (Module["onExit"]) Module["onExit"](status);3928ABORT = true;3929}3930quit_(status, new ExitStatus(status));3931}39323933if (Module["preInit"]) {3934if (typeof Module["preInit"] == "function") Module["preInit"] = [ Module["preInit"] ];3935while (Module["preInit"].length > 0) {3936Module["preInit"].pop()();3937}3938}39393940var shouldRunNow = true;39413942if (Module["noInitialRun"]) shouldRunNow = false;39433944if (ENVIRONMENT_IS_PTHREAD) {3945noExitRuntime = false;3946PThread.initWorker();3947}39483949run();395039513952