diff --git a/adventure-capitalist/index.html b/adventure-capitalist/index.html index b1ba44be..58334acb 100644 --- a/adventure-capitalist/index.html +++ b/adventure-capitalist/index.html @@ -22,8 +22,8 @@ // connect to canvas var Module = { TOTAL_MEMORY: 201326592, - filePackagePrefixURL: "https://raw.githubusercontent.com/EmulatorOS/gfile/main/adcap/Release/", - memoryInitializerPrefixURL: "https://rawcdn.githack.com/EmulatorOS/gfile/main/adcap/Release/", + filePackagePrefixURL: "https://rawcdn.githack.com/EmulatorOS/gfile/a353d35ac44f2c72439d6d765636765f0fd9b0f0/adcap/Release/", + memoryInitializerPrefixURL: "https://rawcdn.githack.com/EmulatorOS/gfile/a353d35ac44f2c72439d6d765636765f0fd9b0f0/adcap/Release/", preRun: [], postRun: [], print: (function() { @@ -62,16 +62,16 @@ }; Module.setStatus('Downloading (0.0/1)'); - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/amazing-rope-police/sdk.js b/amazing-rope-police/sdk.js new file mode 100644 index 00000000..7a98dd12 --- /dev/null +++ b/amazing-rope-police/sdk.js @@ -0,0 +1 @@ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var r=function(){function e(){this.gameFrame=this.getGameframe(),this.eventHandler=this.eventHandler.bind(this),this.initialized=!1}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.init=function(e){if(!this.initialized){this.initialized=!0;var t=e.crazySDKObjectName;this.crazySDKObjectName=t,this.registerEventHandlers()}},e.prototype.requestAd=function(e){this.gameFrame.requestAd(e)},e.prototype.getGameframe=function(){return window.Crazygames},e.prototype.registerEventHandlers=function(){var e=this,t=this.gameFrame.constants;[t.AD_STARTED,t.AD_COMPLETED,t.AD_ERROR,t.AD_FINISHED].forEach(function(t){e.registerEventHandler(t)})},e.prototype.registerEventHandler=function(e){var t=this;document.addEventListener(e,function(e){return t.eventHandler(e)},!1)},e.prototype.eventHandler=function(e){var t=this.gameFrame.getUnityInstance();if(t&&this.crazySDKObjectName){var n=this.createUnityEventString(e);t.SendMessage(this.crazySDKObjectName,"AdEvent",n)}},e.prototype.createUnityEventString=function(e){var t=this.gameFrame.constants,n=t.AD_STARTED,r=t.AD_COMPLETED,i=t.AD_ERROR,a=t.AD_FINISHED;switch(e.type){case n:return"adStarted";case r:return"adCompleted";case i:return"adError";case a:return"adFinished";default:throw new Error("[CrazySDK] Unexpected Event Type "+e.type)}},e}().getInstance();window.CrazySDK=r}]); \ No newline at end of file diff --git a/amazing-rope-police/spider.asm.code.unityweb b/amazing-rope-police/spider.asm.code.unityweb new file mode 100644 index 00000000..148b4cbe Binary files /dev/null and b/amazing-rope-police/spider.asm.code.unityweb differ diff --git a/amazing-rope-police/spider.asm.framework.unityweb b/amazing-rope-police/spider.asm.framework.unityweb new file mode 100644 index 00000000..7d086009 Binary files /dev/null and b/amazing-rope-police/spider.asm.framework.unityweb differ diff --git a/amazing-rope-police/spider.asm.memory.unityweb b/amazing-rope-police/spider.asm.memory.unityweb new file mode 100644 index 00000000..f8b96ed2 Binary files /dev/null and b/amazing-rope-police/spider.asm.memory.unityweb differ diff --git a/amazing-rope-police/spider.json b/amazing-rope-police/spider.json new file mode 100644 index 00000000..3374e60d --- /dev/null +++ b/amazing-rope-police/spider.json @@ -0,0 +1,13 @@ +{ +"companyName": "hgamesartspider", +"productName": "Amazing Strange Rope Police - Vice Spider Vegas", +"dataUrl": "https://raw.githubusercontent.com/3kh0/3kh0-Assets/main/amazing-rope-police/spider.data.unityweb", +"asmCodeUrl": "spider.asm.code.unityweb", +"asmMemoryUrl": "spider.asm.memory.unityweb", +"asmFrameworkUrl": "spider.asm.framework.unityweb", +"TOTAL_MEMORY": 536870912, +"graphicsAPI": ["WebGL 2.0", "WebGL 1.0"], +"webglContextAttributes": {"preserveDrawingBuffer": false}, +"splashScreenStyle": "Dark", +"backgroundColor": "#231F20" +} \ No newline at end of file diff --git a/amazing-rope-police/spiderUnityLoader.js b/amazing-rope-police/spiderUnityLoader.js new file mode 100644 index 00000000..f2bd1956 --- /dev/null +++ b/amazing-rope-police/spiderUnityLoader.js @@ -0,0 +1 @@ +var UnityLoader=UnityLoader||{compatibilityCheck:function(e,t,r){UnityLoader.SystemInfo.hasWebGL?UnityLoader.SystemInfo.mobile?e.popup("Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway.",[{text:"OK",callback:t}]):["Firefox","Chrome","Safari"].indexOf(UnityLoader.SystemInfo.browser)==-1?e.popup("Please note that your browser is not currently supported for this Unity WebGL content. Press OK if you wish to continue anyway.",[{text:"OK",callback:t}]):t():e.popup("Your browser does not support WebGL",[{text:"OK",callback:r}])},Blobs:{},loadCode:function(e,t,r){var n=[].slice.call(UnityLoader.Cryptography.md5(e)).map(function(e){return("0"+e.toString(16)).substr(-2)}).join(""),o=document.createElement("script"),a=URL.createObjectURL(new Blob(['UnityLoader["'+n+'"]=',e],{type:"text/javascript"}));UnityLoader.Blobs[a]=r,o.src=a,o.onload=function(){URL.revokeObjectURL(a),t(n)},document.body.appendChild(o)},allocateHeapJob:function(e,t){for(var r=e.TOTAL_STACK||5242880,n=e.TOTAL_MEMORY||(e.buffer?e.buffer.byteLength:268435456),o=65536,a=16777216,i=o;i0;f=c,c=u.indexOf("/",f)+1)e.FS_createPath(u.substring(0,f),u.substring(f,c-1),!0,!0);e.FS_createDataFile(u,null,r.subarray(s,s+d),!0,!0,!0)}e.removeRunDependency("processDataJob"),t.complete()},downloadJob:function(e,t){var r=t.parameters.objParameters?new UnityLoader.XMLHttpRequest(t.parameters.objParameters):new XMLHttpRequest;r.open("GET",t.parameters.url),r.responseType="arraybuffer",r.onload=function(){UnityLoader.Compression.decompress(new Uint8Array(r.response),function(e){t.complete(e)})},t.parameters.onprogress&&r.addEventListener("progress",t.parameters.onprogress),t.parameters.onload&&r.addEventListener("load",t.parameters.onload),r.send()},scheduleBuildDownloadJob:function(e,t,r){UnityLoader.Progress.update(e,t),UnityLoader.Job.schedule(e,t,[],UnityLoader.downloadJob,{url:e.resolveBuildUrl(e[r]),onprogress:function(r){UnityLoader.Progress.update(e,t,r)},onload:function(r){UnityLoader.Progress.update(e,t,r)},objParameters:e.companyName&&e.productName&&e.cacheControl&&e.cacheControl[r]?{companyName:e.companyName,productName:e.productName,cacheControl:e.cacheControl[r]}:null})},loadModule:function(e){if(e.useWasm=e.wasmCodeUrl&&UnityLoader.SystemInfo.hasWasm,e.useWasm)UnityLoader.scheduleBuildDownloadJob(e,"downloadWasmCode","wasmCodeUrl"),UnityLoader.Job.schedule(e,"processWasmCode",["downloadWasmCode"],UnityLoader.processWasmCodeJob),UnityLoader.scheduleBuildDownloadJob(e,"downloadWasmFramework","wasmFrameworkUrl"),UnityLoader.Job.schedule(e,"processWasmFramework",["downloadWasmFramework","processWasmCode","setupIndexedDB"],UnityLoader.processWasmFrameworkJob);else{if(!e.asmCodeUrl)throw"WebAssembly support is not detected in this browser.";UnityLoader.scheduleBuildDownloadJob(e,"downloadAsmCode","asmCodeUrl"),UnityLoader.Job.schedule(e,"processAsmCode",["downloadAsmCode"],UnityLoader.processAsmCodeJob),UnityLoader.scheduleBuildDownloadJob(e,"downloadAsmMemory","asmMemoryUrl"),UnityLoader.Job.schedule(e,"processAsmMemory",["downloadAsmMemory"],UnityLoader.processAsmMemoryJob),e.memoryInitializerRequest={addEventListener:function(t,r){e.memoryInitializerRequest.callback=r}},e.asmLibraryUrl&&(e.dynamicLibraries=[e.asmLibraryUrl].map(e.resolveBuildUrl)),UnityLoader.scheduleBuildDownloadJob(e,"downloadAsmFramework","asmFrameworkUrl"),UnityLoader.Job.schedule(e,"processAsmFramework",["downloadAsmFramework","processAsmCode","setupIndexedDB"],UnityLoader.processAsmFrameworkJob)}UnityLoader.scheduleBuildDownloadJob(e,"downloadData","dataUrl"),UnityLoader.Job.schedule(e,"setupIndexedDB",[],UnityLoader.setupIndexedDBJob),e.preRun.push(function(){e.addRunDependency("processDataJob"),UnityLoader.Job.schedule(e,"processData",["downloadData"],UnityLoader.processDataJob)})},instantiate:function(e,t,r){function n(e,r){if("string"==typeof e&&!(e=document.getElementById(e)))return!1;e.innerHTML="",e.style.border=e.style.margin=e.style.padding=0,"static"==getComputedStyle(e).getPropertyValue("position")&&(e.style.position="relative"),e.style.width=r.width||e.style.width,e.style.height=r.height||e.style.height,r.container=e;var n=r.Module;return n.canvas=document.createElement("canvas"),n.canvas.style.width="100%",n.canvas.style.height="100%",n.canvas.addEventListener("contextmenu",function(e){e.preventDefault()}),n.canvas.id="#canvas",e.appendChild(n.canvas),r.compatibilityCheck(r,function(){var t=new XMLHttpRequest;t.open("GET",r.url,!0),t.responseType="text",t.onerror=function(){n.print("Could not download "+r.url),0==document.URL.indexOf("file:")&&alert("It seems your browser does not support running Unity WebGL content from file:// urls. Please upload it to an http server, or try a different browser.")},t.onload=function(){var o=JSON.parse(t.responseText);for(var a in o)"undefined"==typeof n[a]&&(n[a]=o[a]);for(var i=!1,s=0;s=1?i=!0:n.print("Warning: Unsupported graphics API "+d)}return i?(e.style.background=n.backgroundUrl?"center/cover url('"+n.resolveBuildUrl(n.backgroundUrl)+"')":n.backgroundColor?" "+n.backgroundColor:"",r.onProgress(r,0),void UnityLoader.loadModule(n)):void r.popup("Your browser does not support any of the required graphics API for this content: "+n.graphicsAPI,[{text:"OK"}])},t.send()},function(){n.print("Instantiation of the '"+t+"' terminated due to the failed compatibility check.")}),!0}var o={url:t,onProgress:UnityLoader.Progress.handler,compatibilityCheck:UnityLoader.compatibilityCheck,Module:{preRun:[],postRun:[],print:function(e){console.log(e)},printErr:function(e){console.error(e)},Jobs:{},buildDownloadProgress:{},resolveBuildUrl:function(e){return e.match(/(http|https|ftp|file):\/\//)?e:t.substring(0,t.lastIndexOf("/")+1)+e}},SetFullscreen:function(){if(o.Module.SetFullscreen)return o.Module.SetFullscreen.apply(o.Module,arguments)},SendMessage:function(){if(o.Module.SendMessage)return o.Module.SendMessage.apply(o.Module,arguments)}};o.Module.gameInstance=o,o.popup=function(e,t){return UnityLoader.Error.popup(o,e,t)},o.Module.postRun.push(function(){o.onProgress(o,1)});for(var a in r)if("Module"==a)for(var i in r[a])o.Module[i]=r[a][i];else o[a]=r[a];return n(e,o)||document.addEventListener("DOMContentLoaded",function(){n(e,o)}),o},SystemInfo:function(){var e,t,r,n="-",o=navigator.appVersion,a=navigator.userAgent,i=navigator.appName,s=navigator.appVersion,d=parseInt(navigator.appVersion,10);(t=a.indexOf("Opera"))!=-1?(i="Opera",s=a.substring(t+6),(t=a.indexOf("Version"))!=-1&&(s=a.substring(t+8))):(t=a.indexOf("MSIE"))!=-1?(i="Microsoft Internet Explorer",s=a.substring(t+5)):(t=a.indexOf("Chrome"))!=-1?(i="Chrome",s=a.substring(t+7)):(t=a.indexOf("Safari"))!=-1?(i="Safari",s=a.substring(t+7),(t=a.indexOf("Version"))!=-1&&(s=a.substring(t+8))):(t=a.indexOf("Firefox"))!=-1?(i="Firefox",s=a.substring(t+8)):a.indexOf("Trident/")!=-1?(i="Microsoft Internet Explorer",s=a.substring(a.indexOf("rv:")+3)):(e=a.lastIndexOf(" ")+1)<(t=a.lastIndexOf("/"))&&(i=a.substring(e,t),s=a.substring(t+1),i.toLowerCase()==i.toUpperCase()&&(i=navigator.appName)),(r=s.indexOf(";"))!=-1&&(s=s.substring(0,r)),(r=s.indexOf(" "))!=-1&&(s=s.substring(0,r)),(r=s.indexOf(")"))!=-1&&(s=s.substring(0,r)),d=parseInt(""+s,10),isNaN(d)?(s=""+parseFloat(navigator.appVersion),d=parseInt(navigator.appVersion,10)):s=""+parseFloat(s);var l=/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(o),u=n,f=[{s:"Windows 3.11",r:/Win16/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 10",r:/(Windows 10|Windows NT 10.0)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows ME",r:/Windows ME/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(var c in f){var h=f[c];if(h.r.test(a)){u=h.s;break}}var p=n;switch(/Windows/.test(u)&&(p=/Windows (.*)/.exec(u)[1],u="Windows"),u){case"Mac OS X":p=/Mac OS X (10[\.\_\d]+)/.exec(a)[1];break;case"Android":p=/Android ([\.\_\d]+)/.exec(a)[1];break;case"iOS":p=/OS (\d+)_(\d+)_?(\d+)?/.exec(o),p=p[1]+"."+p[2]+"."+(0|p[3])}return{width:screen.width?screen.width:0,height:screen.height?screen.height:0,browser:i,browserVersion:s,mobile:l,os:u,osVersion:p,gpu:function(){var e=document.createElement("canvas"),t=e.getContext("experimental-webgl");if(t){var r=t.getExtension("WEBGL_debug_renderer_info");if(r)return t.getParameter(r.UNMASKED_RENDERER_WEBGL)}return n}(),language:window.navigator.userLanguage||window.navigator.language,hasWebGL:function(){if(!window.WebGLRenderingContext)return 0;var e=document.createElement("canvas"),t=e.getContext("webgl2");return t?2:(t=e.getContext("experimental-webgl2"),t?2:(t=e.getContext("webgl"),t||(t=e.getContext("experimental-webgl"))?1:0))}(),hasCursorLock:function(){var e=document.createElement("canvas");return e.requestPointerLock||e.mozRequestPointerLock||e.webkitRequestPointerLock||e.msRequestPointerLock?1:0}(),hasFullscreen:function(){var e=document.createElement("canvas");return(e.requestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen||e.webkitRequestFullScreen)&&(i.indexOf("Safari")==-1||s>=10.1)?1:0}(),hasWasm:"object"==typeof WebAssembly&&"function"==typeof WebAssembly.validate&&"function"==typeof WebAssembly.compile}}(),Error:{init:function(){return Error.stackTraceLimit=50,window.addEventListener("error",function(e){var t=UnityLoader.Error.getModule(e);if(!t)return UnityLoader.Error.handler(e);var r=t.useWasm?t.wasmSymbolsUrl:t.asmSymbolsUrl;if(!r)return UnityLoader.Error.handler(e,t);var n=new XMLHttpRequest;n.open("GET",t.resolveBuildUrl(r)),n.responseType="arraybuffer",n.onload=function(){UnityLoader.loadCode(UnityLoader.Compression.decompress(new Uint8Array(n.response)),function(r){t.demangleSymbol=UnityLoader[r](),UnityLoader.Error.handler(e,t)})},n.send()}),!0}(),stackTraceFormat:navigator.userAgent.indexOf("Chrome")!=-1?"(\\s+at\\s+)(([\\w\\d_\\.]*?)([\\w\\d_$]+)(/[\\w\\d_\\./]+|))(\\s+\\[.*\\]|)\\s*\\((blob:.*)\\)":"(\\s*)(([\\w\\d_\\.]*?)([\\w\\d_$]+)(/[\\w\\d_\\./]+|))(\\s+\\[.*\\]|)\\s*@(blob:.*)",stackTraceFormatWasm:navigator.userAgent.indexOf("Chrome")!=-1?"((\\s+at\\s*)\\s\\(\\[(\\d+)\\]\\+\\d+\\))()":"((\\s*)wasm-function\\[(\\d+)\\])@(blob:.*)",blobParseRegExp:new RegExp("^(blob:.*)(:\\d+:\\d+)$"),getModule:function(e){var t=e.message.match(new RegExp(this.stackTraceFormat,"g"));for(var r in t){var n=t[r].match(new RegExp("^"+this.stackTraceFormat+"$")),o=n[7].match(this.blobParseRegExp);if(o&&UnityLoader.Blobs[o[1]]&&UnityLoader.Blobs[o[1]].Module)return UnityLoader.Blobs[o[1]].Module}},demangle:function(e,t){var r=e.message;return t?(r=r.replace(new RegExp(this.stackTraceFormat,"g"),function(e){var r=e.match(new RegExp("^"+this.stackTraceFormat+"$")),n=r[7].match(this.blobParseRegExp),o=t.demangleSymbol?t.demangleSymbol(r[4]):r[4],a=n&&UnityLoader.Blobs[n[1]]&&UnityLoader.Blobs[n[1]].url?UnityLoader.Blobs[n[1]].url:"blob";return r[1]+o+(r[2]!=o?" ["+r[2]+"]":"")+" ("+(n?a.substr(a.lastIndexOf("/")+1)+n[2]:r[7])+")"}.bind(this)),t.useWasm&&(r=r.replace(new RegExp(this.stackTraceFormatWasm,"g"),function(e){var r=e.match(new RegExp("^"+this.stackTraceFormatWasm+"$")),n=t.demangleSymbol?t.demangleSymbol(r[3]):r[3],o=r[4].match(this.blobParseRegExp),a=o&&UnityLoader.Blobs[o[1]]&&UnityLoader.Blobs[o[1]].url?UnityLoader.Blobs[o[1]].url:"blob";return(n==r[3]?r[1]:r[2]+n+" [wasm:"+r[3]+"]")+(r[4]?" ("+(o?a.substr(a.lastIndexOf("/")+1)+o[2]:r[4])+")":"")}.bind(this))),r):r},handler:function(e,t){var r=t?this.demangle(e,t):e.message;if(!(t&&t.errorhandler&&t.errorhandler(r,e.filename,e.lineno)||(console.log("Invoking error handler due to\n"+r),"function"==typeof dump&&dump("Invoking error handler due to\n"+r),r.indexOf("UnknownError")!=-1||r.indexOf("Program terminated with exit(0)")!=-1||this.didShowErrorMessage))){var r="An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:\n"+r;r.indexOf("DISABLE_EXCEPTION_CATCHING")!=-1?r="An exception has occurred, but exception handling has been disabled in this build. If you are the developer of this content, enable exceptions in your project WebGL player settings to be able to catch the exception or see the stack trace.":r.indexOf("Cannot enlarge memory arrays")!=-1?r="Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings.":r.indexOf("Invalid array buffer length")==-1&&r.indexOf("Invalid typed array length")==-1&&r.indexOf("out of memory")==-1||(r="The browser could not allocate enough memory for the WebGL content. If you are the developer of this content, try allocating less memory to your WebGL build in the WebGL player settings."),alert(r),this.didShowErrorMessage=!0}},popup:function(e,t,r){r=r||[{text:"OK"}];var n=document.createElement("div");n.style.cssText="position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); text-align: center; border: 1px solid black; padding: 5px; background: #E8E8E8";var o=document.createElement("span");o.textContent=t,n.appendChild(o),n.appendChild(document.createElement("br"));for(var a=0;a>2]|0;t;e=e+1|0,t=t-1|0)r=o[(r&255^n[e])<<2>>2]^r>>>8^4278190080;o[1024>>2]=r}return{process:a}}({Uint8Array:Uint8Array,Uint32Array:Uint32Array},null,r);t=UnityLoader.Cryptography.crc32.module={buffer:r,HEAPU8:new Uint8Array(r),HEAPU32:new Uint32Array(r),process:n.process,crc32:1024,data:1028};for(var o=0;o<256;o++){for(var a=255^o,i=0;i<8;i++)a=a>>>1^(1&a?3988292384:0);t.HEAPU32[o]=a}}t.HEAPU32[t.crc32>>2]=0;for(var s=0;s>2];return new Uint8Array([l>>24,l>>16,l>>8,l])},md5:function(e){var t=UnityLoader.Cryptography.md5.module;if(!t){var r=new ArrayBuffer(16777216),n=function(e,t,r){"use asm";var n=new e.Uint32Array(r);function o(e,t){e=e|0;t=t|0;var r=0,o=0,a=0,i=0,s=0,d=0,l=0,u=0,f=0,c=0,h=0,p=0;r=n[128]|0,o=n[129]|0,a=n[130]|0,i=n[131]|0;for(;t;e=e+64|0,t=t-1|0){s=r;d=o;l=a;u=i;for(c=0;(c|0)<512;c=c+8|0){p=n[c>>2]|0;r=r+(n[c+4>>2]|0)+(n[e+(p>>>14)>>2]|0)+((c|0)<128?i^o&(a^i):(c|0)<256?a^i&(o^a):(c|0)<384?o^a^i:a^(o|~i))|0;h=(r<<(p&31)|r>>>32-(p&31))+o|0;r=i;i=a;a=o;o=h}r=r+s|0;o=o+d|0;a=a+l|0;i=i+u|0}n[128]=r;n[129]=o;n[130]=a;n[131]=i}return{process:o}}({Uint32Array:Uint32Array},null,r);t=UnityLoader.Cryptography.md5.module={buffer:r,HEAPU8:new Uint8Array(r),HEAPU32:new Uint32Array(r),process:n.process,md5:512,data:576},t.HEAPU32.set(new Uint32Array([7,3614090360,65548,3905402710,131089,606105819,196630,3250441966,262151,4118548399,327692,1200080426,393233,2821735955,458774,4249261313,524295,1770035416,589836,2336552879,655377,4294925233,720918,2304563134,786439,1804603682,851980,4254626195,917521,2792965006,983062,1236535329,65541,4129170786,393225,3225465664,720910,643717713,20,3921069994,327685,3593408605,655369,38016083,983054,3634488961,262164,3889429448,589829,568446438,917513,3275163606,196622,4107603335,524308,1163531501,851973,2850285829,131081,4243563512,458766,1735328473,786452,2368359562,327684,4294588738,524299,2272392833,720912,1839030562,917527,4259657740,65540,2763975236,262155,1272893353,458768,4139469664,655383,3200236656,851972,681279174,11,3936430074,196624,3572445317,393239,76029189,589828,3654602809,786443,3873151461,983056,530742520,131095,3299628645,6,4096336452,458762,1126891415,917519,2878612391,327701,4237533241,786438,1700485571,196618,2399980690,655375,4293915773,65557,2240044497,524294,1873313359,983050,4264355552,393231,2734768916,851989,1309151649,262150,4149444226,720906,3174756917,131087,718787259,589845,3951481745]))}t.HEAPU32.set(new Uint32Array([1732584193,4023233417,2562383102,271733878]),t.md5>>2);for(var o=0;o>6),e.length-o<64){if(a=e.length-o,t.HEAPU8.set(e.subarray(e.length-a,e.length),t.data),o+=a,t.HEAPU8[t.data+a++]=128,a>56){for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;t.process(t.data,1),a=0}for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;for(var s=e.length,d=0,i=56;i<64;i++,d=(224&s)>>5,s/=256)t.HEAPU8[t.data+i]=((31&s)<<3)+d;t.process(t.data,1)}}return new Uint8Array(t.HEAPU8.subarray(t.md5,t.md5+16))},sha1:function(e){var t=UnityLoader.Cryptography.sha1.module;if(!t){var r=new ArrayBuffer(16777216),n=function(e,t,r){"use asm";var n=new e.Uint32Array(r);function o(e,t){e=e|0;t=t|0;var r=0,o=0,a=0,i=0,s=0,d=0,l=0,u=0,f=0,c=0,h=0,p=0;r=n[80]|0,o=n[81]|0,a=n[82]|0,i=n[83]|0,s=n[84]|0;for(;t;e=e+64|0,t=t-1|0){d=r;l=o;u=a;f=i;c=s;for(p=0;(p|0)<320;p=p+4|0,s=i,i=a,a=o<<30|o>>>2,o=r,r=h){if((p|0)<64){h=n[e+p>>2]|0;h=h<<24&4278190080|h<<8&16711680|h>>>8&65280|h>>>24&255}else{h=n[p-12>>2]^n[p-32>>2]^n[p-56>>2]^n[p-64>>2];h=h<<1|h>>>31}n[p>>2]=h;h=h+((r<<5|r>>>27)+s)+((p|0)<80?(o&a|~o&i|0)+1518500249|0:(p|0)<160?(o^a^i)+1859775393|0:(p|0)<240?(o&a|o&i|a&i)+2400959708|0:(o^a^i)+3395469782|0)|0}r=r+d|0;o=o+l|0;a=a+u|0;i=i+f|0;s=s+c|0}n[80]=r;n[81]=o;n[82]=a;n[83]=i;n[84]=s}return{process:o}}({Uint32Array:Uint32Array},null,r);t=UnityLoader.Cryptography.sha1.module={buffer:r,HEAPU8:new Uint8Array(r),HEAPU32:new Uint32Array(r),process:n.process,sha1:320,data:384}}t.HEAPU32.set(new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),t.sha1>>2);for(var o=0;o>6),e.length-o<64){if(a=e.length-o,t.HEAPU8.set(e.subarray(e.length-a,e.length),t.data),o+=a,t.HEAPU8[t.data+a++]=128,a>56){for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;t.process(t.data,1),a=0}for(var i=a;i<64;i++)t.HEAPU8[t.data+i]=0;for(var s=e.length,d=0,i=63;i>=56;i--,d=(224&s)>>5,s/=256)t.HEAPU8[t.data+i]=((31&s)<<3)+d;t.process(t.data,1)}}for(var l=new Uint8Array(20),i=0;i=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0===(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var r=i.inflateInit2(this.strm,t.windowBits);if(r!==l.Z_OK)throw new Error(u[r]);this.header=new c,i.inflateGetHeader(this.strm,this.header)}function o(e,t){var r=new n(t);if(r.push(e,!0),r.err)throw r.msg||u[r.err];return r.result}function a(e,t){return t=t||{},t.raw=!0,o(e,t)}var i=e("./zlib/inflate"),s=e("./utils/common"),d=e("./utils/strings"),l=e("./zlib/constants"),u=e("./zlib/messages"),f=e("./zlib/zstream"),c=e("./zlib/gzheader"),h=Object.prototype.toString;n.prototype.push=function(e,t){var r,n,o,a,u,f,c=this.strm,p=this.options.chunkSize,w=this.options.dictionary,m=!1;if(this.ended)return!1;n=t===~~t?t:t===!0?l.Z_FINISH:l.Z_NO_FLUSH,"string"==typeof e?c.input=d.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?c.input=new Uint8Array(e):c.input=e,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new s.Buf8(p),c.next_out=0,c.avail_out=p),r=i.inflate(c,l.Z_NO_FLUSH),r===l.Z_NEED_DICT&&w&&(f="string"==typeof w?d.string2buf(w):"[object ArrayBuffer]"===h.call(w)?new Uint8Array(w):w,r=i.inflateSetDictionary(this.strm,f)),r===l.Z_BUF_ERROR&&m===!0&&(r=l.Z_OK,m=!1),r!==l.Z_STREAM_END&&r!==l.Z_OK)return this.onEnd(r),this.ended=!0,!1;c.next_out&&(0!==c.avail_out&&r!==l.Z_STREAM_END&&(0!==c.avail_in||n!==l.Z_FINISH&&n!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(o=d.utf8border(c.output,c.next_out),a=c.next_out-o,u=d.buf2string(c.output,o),c.next_out=a,c.avail_out=p-a,a&&s.arraySet(c.output,c.output,o,a,0),this.onData(u)):this.onData(s.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(m=!0)}while((c.avail_in>0||0===c.avail_out)&&r!==l.Z_STREAM_END);return r===l.Z_STREAM_END&&(n=l.Z_FINISH),n===l.Z_FINISH?(r=i.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===l.Z_OK):n!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),c.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=n,r.inflate=o,r.inflateRaw=a,r.ungzip=o},"utils/common.js":function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,o){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+n),o);for(var a=0;a=252?6:d>=248?5:d>=240?4:d>=224?3:d>=192?2:1;s[254]=s[254]=1,r.string2buf=function(e){var t,r,n,a,i,s=e.length,d=0;for(a=0;a>>6,t[i++]=128|63&r):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|63&r):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|63&r);return t},r.buf2binstring=function(e){return n(e,e.length)},r.binstring2buf=function(e){for(var t=new o.Buf8(e.length),r=0,n=t.length;r4)l[o++]=65533,r+=i-1;else{for(a&=2===i?31:3===i?15:7;i>1&&r1?l[o++]=65533:a<65536?l[o++]=a:(a-=65536,l[o++]=55296|a>>10&1023,l[o++]=56320|1023&a)}return n(l,o)},r.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&128===(192&e[r]);)r--;return r<0?t:0===r?t:r+s[e[r]]>t?r:t}},"zlib/inflate.js":function(e,t,r){"use strict";function n(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function o(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new y.Buf16(320),this.work=new y.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=I,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new y.Buf32(we),t.distcode=t.distdyn=new y.Buf32(me),t.sane=1,t.back=-1,O):R}function i(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,a(e)):R}function s(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?R:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,i(e))):R}function d(e,t){var r,n;return e?(n=new o,e.state=n,n.window=null,r=s(e,t),r!==O&&(e.state=null),r):R}function l(e){return d(e,ye)}function u(e){if(ge){var t;for(m=new y.Buf32(512),b=new y.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(U(E,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;U(k,e.lens,0,32,b,0,e.work,{bits:5}),ge=!1}e.lencode=m,e.lenbits=9,e.distcode=b,e.distbits=5}function f(e,t,r,n){var o,a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(y.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(o=a.wsize-a.wnext,o>n&&(o=n),y.arraySet(a.window,t,r-n,o,a.wnext),n-=o,n?(y.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=v(r.check,Le,2,0),c=0,h=0,r.mode=P;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=ce;break}if((15&c)!==T){e.msg="unknown compression method",r.mode=ce;break}if(c>>>=4,h-=4,Ue=(15&c)+8,0===r.wbits)r.wbits=Ue;else if(Ue>r.wbits){e.msg="invalid window size",r.mode=ce;break}r.dmax=1<>8&1),512&r.flags&&(Le[0]=255&c,Le[1]=c>>>8&255,r.check=v(r.check,Le,2,0)),c=0,h=0,r.mode=D;case D:for(;h<32;){if(0===d)break e;d--,c+=o[i++]<>>8&255,Le[2]=c>>>16&255,Le[3]=c>>>24&255,r.check=v(r.check,Le,4,0)),c=0,h=0,r.mode=F;case F:for(;h<16;){if(0===d)break e;d--,c+=o[i++]<>8),512&r.flags&&(Le[0]=255&c,Le[1]=c>>>8&255,r.check=v(r.check,Le,2,0)),c=0,h=0,r.mode=q;case q:if(1024&r.flags){for(;h<16;){if(0===d)break e;d--,c+=o[i++]<>>8&255,r.check=v(r.check,Le,2,0)),c=0,h=0}else r.head&&(r.head.extra=null);r.mode=V;case V:if(1024&r.flags&&(m=r.length,m>d&&(m=d),m&&(r.head&&(Ue=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),y.arraySet(r.head.extra,o,i,m,Ue)),512&r.flags&&(r.check=v(r.check,o,m,i)),d-=m,i+=m,r.length-=m),r.length))break e;r.length=0,r.mode=Z;case Z:if(2048&r.flags){if(0===d)break e;m=0;do Ue=o[i+m++],r.head&&Ue&&r.length<65536&&(r.head.name+=String.fromCharCode(Ue));while(Ue&&m>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=j;break;case G:for(;h<32;){if(0===d)break e;d--,c+=o[i++]<>>=7&h,h-=7&h,r.mode=le;break}for(;h<3;){if(0===d)break e;d--,c+=o[i++]<>>=1,h-=1,3&c){case 0:r.mode=K;break;case 1:if(u(r),r.mode=re,t===W){c>>>=2,h-=2;break e}break;case 2:r.mode=$;break;case 3:e.msg="invalid block type",r.mode=ce}c>>>=2,h-=2;break;case K:for(c>>>=7&h,h-=7&h;h<32;){if(0===d)break e;d--,c+=o[i++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=ce;break}if(r.length=65535&c,c=0,h=0,r.mode=Q,t===W)break e;case Q:r.mode=_;case _:if(m=r.length){if(m>d&&(m=d),m>l&&(m=l),0===m)break e;y.arraySet(a,o,i,m,s),d-=m,i+=m,l-=m,s+=m,r.length-=m;break}r.mode=j;break;case $:for(;h<14;){if(0===d)break e;d--,c+=o[i++]<>>=5,h-=5,r.ndist=(31&c)+1,c>>>=5,h-=5,r.ncode=(15&c)+4,c>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=ce;break}r.have=0,r.mode=ee;case ee:for(;r.have>>=3,h-=3}for(;r.have<19;)r.lens[We[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},xe=U(x,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,xe){e.msg="invalid code lengths set",r.mode=ce;break}r.have=0,r.mode=te;case te:for(;r.have>>24,be=Be>>>16&255,ye=65535&Be,!(me<=h);){if(0===d)break e;d--,c+=o[i++]<>>=me,h-=me,r.lens[r.have++]=ye;else{if(16===ye){for(ke=me+2;h>>=me,h-=me,0===r.have){e.msg="invalid bit length repeat",r.mode=ce;break}Ue=r.lens[r.have-1],m=3+(3&c),c>>>=2,h-=2}else if(17===ye){for(ke=me+3;h>>=me,h-=me,Ue=0,m=3+(7&c),c>>>=3,h-=3}else{for(ke=me+7;h>>=me,h-=me,Ue=0,m=11+(127&c),c>>>=7,h-=7}if(r.have+m>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=ce;break}for(;m--;)r.lens[r.have++]=Ue}}if(r.mode===ce)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=ce;break}if(r.lenbits=9,Ee={bits:r.lenbits},xe=U(E,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,xe){e.msg="invalid literal/lengths set",r.mode=ce;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},xe=U(k,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,xe){e.msg="invalid distances set",r.mode=ce;break}if(r.mode=re,t===W)break e;case re:r.mode=ne;case ne:if(d>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=i,e.avail_in=d,r.hold=c,r.bits=h,A(e,w),s=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,o=e.input,d=e.avail_in,c=r.hold,h=r.bits,r.mode===j&&(r.back=-1);break}for(r.back=0;Be=r.lencode[c&(1<>>24,be=Be>>>16&255,ye=65535&Be,!(me<=h);){if(0===d)break e;d--,c+=o[i++]<>ge)],me=Be>>>24,be=Be>>>16&255,ye=65535&Be,!(ge+me<=h);){if(0===d)break e;d--,c+=o[i++]<>>=ge,h-=ge,r.back+=ge}if(c>>>=me,h-=me,r.back+=me,r.length=ye,0===be){r.mode=de;break}if(32&be){r.back=-1,r.mode=j;break}if(64&be){e.msg="invalid literal/length code",r.mode=ce;break}r.extra=15&be,r.mode=oe;case oe:if(r.extra){for(ke=r.extra;h>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ae;case ae:for(;Be=r.distcode[c&(1<>>24,be=Be>>>16&255,ye=65535&Be,!(me<=h);){if(0===d)break e;d--,c+=o[i++]<>ge)],me=Be>>>24,be=Be>>>16&255,ye=65535&Be,!(ge+me<=h);){if(0===d)break e;d--,c+=o[i++]<>>=ge,h-=ge,r.back+=ge}if(c>>>=me,h-=me,r.back+=me,64&be){e.msg="invalid distance code",r.mode=ce;break}r.offset=ye,r.extra=15&be,r.mode=ie;case ie:if(r.extra){for(ke=r.extra;h>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=ce;break}r.mode=se;case se:if(0===l)break e;if(m=w-l,r.offset>m){if(m=r.offset-m,m>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=ce;break}m>r.wnext?(m-=r.wnext,b=r.wsize-m):b=r.wnext-m,m>r.length&&(m=r.length),we=r.window}else we=a,b=s-r.offset,m=r.length;m>l&&(m=l),l-=m,r.length-=m;do a[s++]=we[b++];while(--m);0===r.length&&(r.mode=ne);break;case de:if(0===l)break e;a[s++]=r.length,l--,r.mode=ne;break;case le:if(r.wrap){for(;h<32;){if(0===d)break e;d--,c|=o[i++]<>>16&65535|0,i=0;0!==r;){i=r>2e3?2e3:r,r-=i;do o=o+t[n++]|0,a=a+o|0;while(--i);o%=65521,a%=65521}return o|a<<16|0}t.exports=n},"zlib/crc32.js":function(e,t,r){"use strict";function n(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}function o(e,t,r,n){var o=a,i=n+r;e^=-1;for(var s=n;s>>8^o[255&(e^t[s])];return e^-1}var a=n();t.exports=o},"zlib/inffast.js":function(e,t,r){"use strict";var n=30,o=12;t.exports=function(e,t){var r,a,i,s,d,l,u,f,c,h,p,w,m,b,y,g,v,A,U,x,E,k,B,L,W;r=e.state,a=e.next_in,L=e.input,i=a+(e.avail_in-5),s=e.next_out,W=e.output,d=s-(t-e.avail_out),l=s+(e.avail_out-257),u=r.dmax,f=r.wsize,c=r.whave,h=r.wnext,p=r.window,w=r.hold,m=r.bits,b=r.lencode,y=r.distcode,g=(1<>>24,w>>>=U,m-=U,U=A>>>16&255,0===U)W[s++]=65535&A;else{if(!(16&U)){if(0===(64&U)){A=b[(65535&A)+(w&(1<>>=U,m-=U),m<15&&(w+=L[a++]<>>24,w>>>=U,m-=U,U=A>>>16&255,!(16&U)){if(0===(64&U)){A=y[(65535&A)+(w&(1<u){e.msg="invalid distance too far back",r.mode=n;break e}if(w>>>=U,m-=U,U=s-d,E>U){if(U=E-U,U>c&&r.sane){e.msg="invalid distance too far back",r.mode=n;break e}if(k=0,B=p,0===h){if(k+=f-U,U2;)W[s++]=B[k++],W[s++]=B[k++],W[s++]=B[k++],x-=3;x&&(W[s++]=B[k++],x>1&&(W[s++]=B[k++]))}else{k=s-E;do W[s++]=W[k++],W[s++]=W[k++],W[s++]=W[k++],x-=3;while(x>2);x&&(W[s++]=W[k++],x>1&&(W[s++]=W[k++]))}break}}break}}while(a>3,a-=x,m-=x<<3,w&=(1<=1&&0===q[R];R--);if(C>R&&(C=R),0===R)return w[m++]=20971520,w[m++]=20971520,y.bits=1,0;for(N=1;N0&&(e===s||1!==R))return-1;for(V[1]=0,O=1;Oa||e===l&&I>i)return 1;for(;;){k=O-S,b[M]E?(B=Z[Y+b[M]],L=D[F+b[M]]):(B=96,L=0),g=1<>S)+v]=k<<24|B<<16|L|0;while(0!==v);for(g=1<>=1;if(0!==g?(P&=g-1,P+=g):P=0,M++,0===--q[O]){if(O===R)break;O=t[r+b[M]]}if(O>C&&(P&U)!==A){for(0===S&&(S=C),x+=N,H=O-S,T=1<a||e===l&&I>i)return 1;A=P&U,w[A]=C<<24|H<<16|x-m|0}}return 0!==P&&(w[x+P]=O-S<<24|64<<16|0),y.bits=C,0}}};for(var r in t)t[r].folder=r.substring(0,r.lastIndexOf("/")+1);var n=function(e){var r=[];return e=e.split("/").every(function(e){return".."==e?r.pop():"."==e||""==e||r.push(e)})?r.join("/"):null,e?t[e]||t[e+".js"]||t[e+"/index.js"]:null},o=function(e,t){return e?n(e.folder+"node_modules/"+t)||o(e.parent,t):null},a=function(e,t){var r=t.match(/^\//)?null:e?t.match(/^\.\.?\//)?n(e.folder+t):o(e,t):n(t);if(!r)throw"module not found: "+t;return r.exports||(r.parent=e,r(a.bind(null,r),r,r.exports={})),r.exports};return a(null,e)},decompress:function(e){this.exports||(this.exports=this.require("inflate.js"));try{return this.exports.inflate(e)}catch(e){}},hasUnityMarker:function(e){var t=10,r="UnityWeb Compressed Content (gzip)";if(t>e.length||31!=e[0]||139!=e[1])return!1;var n=e[3];if(4&n){if(t+2>e.length)return!1;if(t+=2+e[t]+(e[t+1]<<8),t>e.length)return!1}if(8&n){for(;te.length)return!1;t++}return 16&n&&String.fromCharCode.apply(null,e.subarray(t,t+r.length+1))==r+"\0"}},brotli:{require:function(e){var t={"decompress.js":function(e,t,r){t.exports=e("./dec/decode").BrotliDecompressBuffer},"dec/bit_reader.js":function(e,t,r){function n(e){this.buf_=new Uint8Array(a),this.input_=e,this.reset()}const o=4096,a=8224,i=8191,s=new Uint32Array([0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215]);n.READ_SIZE=o,n.IBUF_MASK=i,n.prototype.reset=function(){this.buf_ptr_=0,this.val_=0,this.pos_=0,this.bit_pos_=0,this.bit_end_pos_=0,this.eos_=0,this.readMoreInput();for(var e=0;e<4;e++)this.val_|=this.buf_[this.pos_]<<8*e,++this.pos_;return this.bit_end_pos_>0},n.prototype.readMoreInput=function(){if(!(this.bit_end_pos_>256))if(this.eos_){if(this.bit_pos_>this.bit_end_pos_)throw new Error("Unexpected end of input "+this.bit_pos_+" "+this.bit_end_pos_)}else{var e=this.buf_ptr_,t=this.input_.read(this.buf_,e,o);if(t<0)throw new Error("Unexpected end of input");if(t=8;)this.val_>>>=8,this.val_|=this.buf_[this.pos_&i]<<24,++this.pos_,this.bit_pos_=this.bit_pos_-8>>>0,this.bit_end_pos_=this.bit_end_pos_-8>>>0},n.prototype.readBits=function(e){32-this.bit_pos_>>this.bit_pos_&s[e];return this.bit_pos_+=e,t},t.exports=n},"dec/context.js":function(e,t,r){r.lookup=new Uint8Array([0,0,0,0,0,0,0,0,0,4,4,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,12,16,12,12,20,12,16,24,28,12,12,32,12,36,12,44,44,44,44,44,44,44,44,44,44,32,32,24,40,28,12,12,48,52,52,52,48,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,24,12,28,12,12,12,56,60,60,60,56,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,24,12,28,12,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,59,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),r.lookupOffsets=new Uint16Array([1024,1536,1280,1536,0,256,768,512])},"dec/decode.js":function(e,t,r){function n(e){var t;return 0===e.readBits(1)?16:(t=e.readBits(3),t>0?17+t:(t=e.readBits(3),t>0?8+t:17))}function o(e){if(e.readBits(1)){var t=e.readBits(3);return 0===t?1:e.readBits(t)+(1<1&&0===i)throw new Error("Invalid size byte");o.meta_block_length|=i<<8*n}}else for(n=0;n4&&0===s)throw new Error("Invalid size nibble");o.meta_block_length|=s<<4*n}return++o.meta_block_length,o.input_end||o.is_metadata||(o.is_uncompressed=e.readBits(1)),o}function s(e,t,r){var n;return r.fillBitWindow(),t+=r.val_>>>r.bit_pos_&D,n=e[t].bits-P,n>0&&(r.bit_pos_+=P,t+=e[t].value,t+=r.val_>>>r.bit_pos_&(1<0;){var f,c=0;if(n.readMoreInput(),n.fillBitWindow(),c+=n.val_>>>n.bit_pos_&31,n.bit_pos_+=l[c].bits,f=255&l[c].value,f>f);else{var h,p,w=f-14,m=0;if(f===R&&(m=a),s!==m&&(i=0,s=m),h=i,i>0&&(i-=2,i<<=w),i+=n.readBits(w)+3,p=i-h,o+p>t)throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");for(var b=0;b0;++s){var b,y=V[s],g=0;n.fillBitWindow(),g+=n.val_>>>n.bit_pos_&15,n.bit_pos_+=m[g].bits,b=m[g].value,h[y]=b,0!==b&&(p-=32>>b,++w)}if(1!==w&&0!==p)throw new Error("[ReadHuffmanCode] invalid num_codes or space");d(h,e,i,n)}if(a=L(t,r,P,i,e),0===a)throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");return a}function u(e,t,r){var n,o;return n=s(e,t,r),o=O.kBlockLengthPrefixCode[n].nbits,O.kBlockLengthPrefixCode[n].offset+r.readBits(o)}function f(e,t,r){var n;return e>>5]),this.htrees=new Uint32Array(t)}function w(e,t){var r,n,a,i={num_htrees:null,context_map:null},d=0;t.readMoreInput();var u=i.num_htrees=o(t)+1,f=i.context_map=new Uint8Array(e);if(u<=1)return i;for(r=t.readBits(1),r&&(d=t.readBits(4)+1),n=[],a=0;a=e)throw new Error("[DecodeContextMap] i >= context_map_size");f[a]=0,++a}else f[a]=c-d,++a}return t.readBits(1)&&h(f,e),i}function m(e,t,r,n,o,a,i){var d,l=2*r,u=r,f=s(t,r*F,i);d=0===f?o[l+(1&a[u])]:1===f?o[l+(a[u]-1&1)]+1:f-2,d>=e&&(d-=e),n[r]=d,o[l+(1&a[u])]=d,++a[u]}function b(e,t,r,n,o,a){var i,s=o+1,d=r&o,l=a.pos_&E.IBUF_MASK;if(t<8||a.bit_pos_+(t<<3)0;)a.readMoreInput(),n[d++]=a.readBits(8),d===s&&(e.write(n,s),d=0);else{if(a.bit_end_pos_<32)throw new Error("[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32");for(;a.bit_pos_<32;)n[d]=a.val_>>>a.bit_pos_,a.bit_pos_+=8,++d,--t;if(i=a.bit_end_pos_-a.bit_pos_>>3,l+i>E.IBUF_MASK){for(var u=E.IBUF_MASK+1-l,f=0;f=s){e.write(n,s),d-=s;for(var f=0;f=s;){if(i=s-d,a.input_.read(n,d,i)t.buffer.length){var ve=new Uint8Array(x+re);ve.set(t.buffer),t.buffer=ve}if(L=ge.input_end,J=ge.is_uncompressed,ge.is_metadata)for(y(U);re>0;--re)U.readMoreInput(),U.readBits(8);else if(0!==re)if(J)U.bit_pos_=U.bit_pos_+7&-8,b(t,re,x,h,c,U),x+=re;else{for(r=0;r<3;++r)ae[r]=o(U)+1,ae[r]>=2&&(l(ae[r]+2,v,r*F,U),l(S,A,r*F,U),ne[r]=u(A,r*F,U),se[r]=1);for(U.readMoreInput(),j=U.readBits(2),X=Z+(U.readBits(4)<0;){var xe,Ee,ke,Be,Le,We,Oe,Me,Ne,Re,Ce;for(U.readMoreInput(),0===ne[1]&&(m(ae[1],v,1,oe,ie,se,U),ne[1]=u(A,F,U),te=Y[1].htrees[oe[1]]),--ne[1],xe=s(Y[1].codes,te,U),Ee=xe>>6,Ee>=2?(Ee-=2,Oe=-1):Oe=0,ke=O.kInsertRangeLut[Ee]+(xe>>3&7),Be=O.kCopyRangeLut[Ee]+(7&xe),Le=O.kInsertLengthPrefixCode[ke].offset+U.readBits(O.kInsertLengthPrefixCode[ke].nbits),We=O.kCopyLengthPrefixCode[Be].offset+U.readBits(O.kCopyLengthPrefixCode[Be].nbits),q=h[x-1&c],V=h[x-2&c],Re=0;Re4?3:We-2),me=ue[we+Ne],Oe=s(Y[2].codes,Y[2].htrees[me],U),Oe>=X){var He,Se,Te;Oe-=X,Se=Oe&K,Oe>>=j,He=(Oe>>1)+1,Te=(2+(1&Oe)<R){if(!(We>=k.minDictionaryWordLength&&We<=k.maxDictionaryWordLength))throw new Error("Invalid backward reference. pos: "+x+" distance: "+Me+" len: "+We+" bytes left: "+re);var Te=k.offsetsByLength[We],Ie=Me-R-1,Pe=k.sizeBitsByLength[We],De=(1<>Pe;if(Te+=Fe*We,!(qe=g){t.write(h,d);for(var Ze=0;Ze0&&(P[3&D]=Me,++D),We>re)throw new Error("Invalid backward reference. pos: "+x+" distance: "+Me+" len: "+We+" bytes left: "+re);for(Re=0;Re>=1;return(e&r-1)+r}function a(e,t,r,o,a){do o-=r,e[t+o]=new n(a.bits,a.value);while(o>0)}function i(e,t,r){for(var n=1<0;--U[f])u=new n(255&f,65535&v[c++]),a(e,t+h,p,y,u),h=o(h,f);for(m=g-1,w=-1,f=r+1,p=2;f<=s;++f,p<<=1)for(;U[f]>0;--U[f])(h&m)!==w&&(t+=y,b=i(U,f,r),y=1<>r),p,y,u),h=o(h,f);return g}},"dec/prefix.js":function(e,t,r){function n(e,t){this.offset=e,this.nbits=t}r.kBlockLengthPrefixCode=[new n(1,2),new n(5,2),new n(9,2),new n(13,2),new n(17,3),new n(25,3),new n(33,3),new n(41,3),new n(49,4),new n(65,4),new n(81,4),new n(97,4),new n(113,5),new n(145,5),new n(177,5),new n(209,5),new n(241,6),new n(305,6),new n(369,7),new n(497,8),new n(753,9),new n(1265,10),new n(2289,11),new n(4337,12),new n(8433,13),new n(16625,24)],r.kInsertLengthPrefixCode=[new n(0,0),new n(1,0),new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,1),new n(8,1),new n(10,2),new n(14,2),new n(18,3),new n(26,3),new n(34,4),new n(50,4),new n(66,5),new n(98,5),new n(130,6),new n(194,7),new n(322,8),new n(578,9),new n(1090,10),new n(2114,12),new n(6210,14),new n(22594,24)],r.kCopyLengthPrefixCode=[new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,0),new n(7,0),new n(8,0),new n(9,0),new n(10,1),new n(12,1),new n(14,2),new n(18,2),new n(22,3),new n(30,3),new n(38,4),new n(54,4),new n(70,5),new n(102,5),new n(134,6),new n(198,7),new n(326,8),new n(582,9),new n(1094,10),new n(2118,24)],r.kInsertRangeLut=[0,0,8,8,0,16,8,16,16],r.kCopyRangeLut=[0,8,0,8,16,0,16,8,16]},"dec/streams.js":function(e,t,r){function n(e){this.buffer=e,this.pos=0}function o(e){this.buffer=e,this.pos=0}n.prototype.read=function(e,t,r){this.pos+r>this.buffer.length&&(r=this.buffer.length-this.pos);for(var n=0;nthis.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(e.subarray(0,t),this.pos),this.pos+=t,t},r.BrotliOutput=o},"dec/transform.js":function(e,t,r){function n(e,t,r){this.prefix=new Uint8Array(e.length),this.transform=t,this.suffix=new Uint8Array(r.length);for(var n=0;n=97&&e[t]<=122&&(e[t]^=32),1):e[t]<224?(e[t+1]^=32,2):(e[t+2]^=5,3)}var a=e("./dictionary");const i=0,s=1,d=2,l=3,u=4,f=5,c=6,h=7,p=8,w=9,m=10,b=11,y=12,g=13,v=14,A=15,U=16,x=17,E=18,k=20;var B=[new n("",i,""),new n("",i," "),new n(" ",i," "),new n("",y,""),new n("",m," "),new n("",i," the "),new n(" ",i,""),new n("s ",i," "),new n("",i," of "),new n("",m,""),new n("",i," and "),new n("",g,""),new n("",s,""),new n(", ",i," "),new n("",i,", "),new n(" ",m," "),new n("",i," in "),new n("",i," to "),new n("e ",i," "),new n("",i,'"'),new n("",i,"."),new n("",i,'">'),new n("",i,"\n"),new n("",l,""),new n("",i,"]"),new n("",i," for "),new n("",v,""),new n("",d,""),new n("",i," a "),new n("",i," that "),new n(" ",m,""),new n("",i,". "),new n(".",i,""),new n(" ",i,", "),new n("",A,""),new n("",i," with "),new n("",i,"'"),new n("",i," from "),new n("",i," by "),new n("",U,""),new n("",x,""),new n(" the ",i,""),new n("",u,""),new n("",i,". The "),new n("",b,""),new n("",i," on "),new n("",i," as "),new n("",i," is "),new n("",h,""),new n("",s,"ing "),new n("",i,"\n\t"),new n("",i,":"),new n(" ",i,". "),new n("",i,"ed "),new n("",k,""),new n("",E,""),new n("",c,""),new n("",i,"("),new n("",m,", "),new n("",p,""),new n("",i," at "),new n("",i,"ly "),new n(" the ",i," of "),new n("",f,""),new n("",w,""),new n(" ",m,", "),new n("",m,'"'),new n(".",i,"("),new n("",b," "),new n("",m,'">'),new n("",i,'="'),new n(" ",i,"."),new n(".com/",i,""),new n(" the ",i," of the "),new n("",m,"'"),new n("",i,". This "),new n("",i,","),new n(".",i," "),new n("",m,"("),new n("",m,"."),new n("",i," not "),new n(" ",i,'="'),new n("",i,"er "),new n(" ",b," "),new n("",i,"al "),new n(" ",b,""),new n("",i,"='"),new n("",b,'"'),new n("",m,". "),new n(" ",i,"("),new n("",i,"ful "),new n(" ",m,". "),new n("",i,"ive "),new n("",i,"less "),new n("",b,"'"),new n("",i,"est "),new n(" ",m,"."),new n("",b,'">'),new n(" ",i,"='"),new n("",m,","),new n("",i,"ize "),new n("",b,"."),new n("\xc2\xa0",i,""),new n(" ",i,","),new n("",m,'="'),new n("",b,'="'),new n("",i,"ous "),new n("",b,", "),new n("",m,"='"),new n(" ",m,","),new n(" ",b,'="'),new n(" ",b,", "),new n("",b,","),new n("",b,"("),new n("",b,". "),new n(" ",b,"."),new n("",b,"='"),new n(" ",b,". "),new n(" ",m,'="'),new n(" ",b,"='"),new n(" ",m,"='")];r.kTransforms=B,r.kNumTransforms=B.length,r.transformDictionaryWord=function(e,t,r,n,i){var s,d=B[i].prefix,l=B[i].suffix,u=B[i].transform,f=un&&(f=n);for(var p=0;p0;){var g=o(e,s);s+=g,n-=g}for(var v=0;v0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function o(e){return 3*e.length/4-n(e)}function a(e){var t,r,o,a,i,s,d=e.length;i=n(e),s=new f(3*d/4-i),o=i>0?d-4:d;var l=0;for(t=0,r=0;t>16&255,s[l++]=a>>8&255,s[l++]=255&a;return 2===i?(a=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,s[l++]=255&a):1===i&&(a=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,s[l++]=a>>8&255,s[l++]=255&a),s}function i(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function s(e,t,r){for(var n,o=[],a=t;au?u:d+i));return 1===n?(t=e[r-1],o+=l[t>>2],o+=l[t<<4&63],o+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],o+=l[t>>10],o+=l[t>>4&63],o+=l[t<<2&63],o+="="),a.push(o),a.join("")}r.byteLength=o,r.toByteArray=a,r.fromByteArray=d;for(var l=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,p=c.length;h>3);if(commentOffset=r+1+2+1+2+(o<<3)+7>>3,17==n||commentOffset>e.length)return!1;for(var a=n+(6+(o<<4)+(t.length-1<<6)<>>=8)if(e[i]!=(255&a))return!1;return String.fromCharCode.apply(null,e.subarray(commentOffset,commentOffset+t.length))==t}},decompress:function(e,t){var r=this.gzip.hasUnityMarker(e)?this.gzip:this.brotli.hasUnityMarker(e)?this.brotli:this.identity;if(this.serverSetupWarningEnabled&&r!=this.identity&&(console.log("You can reduce your startup time if you configure your web server to host .unityweb files using "+(r==this.gzip?"gzip":"brotli")+" compression."),this.serverSetupWarningEnabled=!1),"function"!=typeof t)return r.decompress(e);if(!r.worker){var n=URL.createObjectURL(new Blob(["this.require = ",r.require.toString(),"; this.decompress = ",r.decompress.toString(),"; this.onmessage = ",function(e){var t={id:e.data.id,decompressed:this.decompress(e.data.compressed)};postMessage(t,t.decompressed?[t.decompressed.buffer]:[])}.toString(),"; postMessage({ ready: true });"],{type:"text/javascript"}));r.worker=new Worker(n),r.worker.onmessage=function(e){return e.data.ready?void URL.revokeObjectURL(n):(this.callbacks[e.data.id](e.data.decompressed),void delete this.callbacks[e.data.id])},r.worker.callbacks={},r.worker.nextCallbackId=0}var o=r.worker.nextCallbackId++;r.worker.callbacks[o]=t,r.worker.postMessage({id:o,compressed:e},[e.buffer])},serverSetupWarningEnabled:!0}}; \ No newline at end of file diff --git a/amazing-rope-police/spired.html b/amazing-rope-police/spired.html new file mode 100644 index 00000000..5f240207 --- /dev/null +++ b/amazing-rope-police/spired.html @@ -0,0 +1,38 @@ + + + +Amazing Strange Rope Police Game Files | Crazy Games + + + + + + + + + + + + + \ No newline at end of file diff --git a/amazing-rope-police/spired1.html b/amazing-rope-police/spired1.html new file mode 100644 index 00000000..7f579ab9 --- /dev/null +++ b/amazing-rope-police/spired1.html @@ -0,0 +1,38 @@ + + + +Amazing Strange Rope Police Game Files | Crazy Games + + + + + + + + + + + + + \ No newline at end of file diff --git a/amazing-rope-police/splash.jpeg b/amazing-rope-police/splash.jpeg new file mode 100644 index 00000000..f70af540 Binary files /dev/null and b/amazing-rope-police/splash.jpeg differ diff --git a/amazing-rope-police/vaxoo.html b/amazing-rope-police/vaxoo.html new file mode 100644 index 00000000..7f579ab9 --- /dev/null +++ b/amazing-rope-police/vaxoo.html @@ -0,0 +1,38 @@ + + + +Amazing Strange Rope Police Game Files | Crazy Games + + + + + + + + + + + + + \ No newline at end of file diff --git a/ducklife6/Build/WebGL5MP.json b/ducklife6/Build/WebGL5MP.json index ba5630dd..73fde0a3 100644 --- a/ducklife6/Build/WebGL5MP.json +++ b/ducklife6/Build/WebGL5MP.json @@ -1,7 +1,7 @@ { "companyName": "Mofunzone", "productName": "Duck Life: Space", - "dataUrl": "https://rawcdn.githack.com/Edward358-AI/HTML5-games/3c35856e44aea5d93ebe781cb1af84570dd8512c/html5/ducklife5/play/Build/WebGL5MP-DATA.unityweb", + "dataUrl": "https://raw.githubusercontent.com/Edward358-AI/HTML5-games/3c35856e44aea5d93ebe781cb1af84570dd8512c/html5/ducklife5/play/Build/WebGL5MP-DATA.unityweb", "asmCodeUrl": "WebGL5MP-CODE.unityweb", "asmMemoryUrl": "WebGL5MP-MEMORY.unityweb", "asmFrameworkUrl": "WebGL5MP-FRAMEWORK.unityweb", diff --git a/emulatorjs/data/GameManager.js b/emulatorjs/data/GameManager.js new file mode 100644 index 00000000..2aa3cd61 --- /dev/null +++ b/emulatorjs/data/GameManager.js @@ -0,0 +1,345 @@ +class EJS_GameManager { + constructor(Module, EJS) { + this.EJS = EJS; + this.Module = Module; + this.FS = this.Module.FS; + this.functions = { + restart: this.Module.cwrap('system_restart', '', []), + getStateInfo: this.Module.cwrap('get_state_info', 'string', []), //these names are dumb + saveStateInfo: this.Module.cwrap('save_state_info', 'null', []), + loadState: this.Module.cwrap('load_state', 'number', ['string', 'number']), + screenshot: this.Module.cwrap('cmd_take_screenshot', '', []), + simulateInput: this.Module.cwrap('simulate_input', 'null', ['number', 'number', 'number']), + toggleMainLoop: this.Module.cwrap('toggleMainLoop', 'null', ['number']), + getCoreOptions: this.Module.cwrap('get_core_options', 'string', []), + setVariable: this.Module.cwrap('ejs_set_variable', 'null', ['string', 'string']), + setCheat: this.Module.cwrap('set_cheat', 'null', ['number', 'number', 'string']), + resetCheat: this.Module.cwrap('reset_cheat', 'null', []), + toggleShader: this.Module.cwrap('shader_enable', 'null', ['number']), + getDiskCount: this.Module.cwrap('get_disk_count', 'number', []), + getCurrentDisk: this.Module.cwrap('get_current_disk', 'number', []), + setCurrentDisk: this.Module.cwrap('set_current_disk', 'null', ['number']), + getSaveFilePath: this.Module.cwrap('save_file_path', 'string', []), + saveSaveFiles: this.Module.cwrap('cmd_savefiles', '', []), + supportsStates: this.Module.cwrap('supports_states', 'number', []), + loadSaveFiles: this.Module.cwrap('refresh_save_files', 'null', []), + toggleFastForward: this.Module.cwrap('toggle_fastforward', 'null', ['number']), + setFastForwardRatio: this.Module.cwrap('set_ff_ratio', 'null', ['number']), + toggleRewind: this.Module.cwrap('toggle_rewind', 'null', ['number']), + setRewindGranularity: this.Module.cwrap('set_rewind_granularity', 'null', ['number']), + toggleSlowMotion: this.Module.cwrap('toggle_slow_motion', 'null', ['number']), + setSlowMotionRatio: this.Module.cwrap('set_sm_ratio', 'null', ['number']), + getFrameNum: this.Module.cwrap('get_current_frame_count', 'number', ['']) + } + this.mkdir("/home"); + this.mkdir("/home/web_user"); + this.mkdir("/home/web_user/retroarch"); + this.mkdir("/home/web_user/retroarch/userdata"); + this.mkdir("/home/web_user/retroarch/userdata/config"); + this.mkdir("/home/web_user/retroarch/userdata/config/Beetle PSX HW"); + this.FS.writeFile("/home/web_user/retroarch/userdata/config/Beetle PSX HW/Beetle PSX HW.opt", 'beetle_psx_hw_renderer = "software"\n'); + + this.mkdir("/data"); + this.mkdir("/data/saves"); + + this.FS.writeFile("/home/web_user/retroarch/userdata/retroarch.cfg", this.getRetroArchCfg()); + + this.FS.mount(IDBFS, {}, '/data/saves'); + this.FS.syncfs(true, () => {}); + + this.initShaders(); + + this.EJS.addEventListener(window, "beforeunload", () => { + this.saveSaveFiles(); + this.FS.syncfs(() => {}); + }) + } + mkdir(path) { + try { + this.FS.mkdir(path); + } catch(e) {} + } + getRetroArchCfg() { + return "autosave_interval = 60\n" + + "screenshot_directory = \"/\"\n" + + "block_sram_overwrite = false\n" + + "video_gpu_screenshot = false\n" + + "audio_latency = 64\n" + + "video_top_portrait_viewport = true\n" + + "video_vsync = true\n" + + "video_smooth = false\n" + + "fastforward_ratio = 3.0\n" + + "slowmotion_ratio = 3.0\n" + + (this.EJS.rewindEnabled ? "rewind_enable = true\n" : "") + + (this.EJS.rewindEnabled ? "rewind_granularity = 6\n" : "") + + "savefile_directory = \"/data/saves\"\n"; + } + initShaders() { + if (!window.EJS_SHADERS) return; + this.mkdir("/shader"); + for (const shader in window.EJS_SHADERS) { + this.FS.writeFile('/shader/'+shader, window.EJS_SHADERS[shader]); + } + } + clearEJSResetTimer() { + if (this.EJS.resetTimeout) { + clearTimeout(this.EJS.resetTimeout); + delete this.EJS.resetTimeout; + } + } + restart() { + this.clearEJSResetTimer(); + this.functions.restart(); + } + getState() { + return new Promise(async (resolve, reject) => { + const stateInfo = (await this.getStateInfo()).split('|') + let state; + let size = stateInfo[0] >> 0; + if (size > 0) { + state = new Uint8Array(size); + let start = stateInfo[1] >> 0; + for (let i=0; i { + let a; + let b = setInterval(() => { + a = this.functions.getStateInfo(); + if (a) { + clearInterval(b); + resolve(a); + } + }, 50) + }); + } + loadState(state) { + try { + this.FS.unlink('game.state'); + } catch(e){} + this.FS.writeFile('/game.state', state); + this.clearEJSResetTimer(); + this.functions.loadState("game.state", 0); + setTimeout(() => { + try { + this.FS.unlink('game.state'); + } catch(e){} + }, 5000) + } + screenshot() { + this.functions.screenshot(); + return this.FS.readFile('screenshot.png'); + } + quickSave(slot) { + if (!slot) slot = 1; + (async () => { + let name = slot + '-quick.state'; + try { + this.FS.unlink(name); + } catch (e) {} + let data = await this.getState(); + this.FS.writeFile('/'+name, data); + })(); + } + quickLoad(slot) { + if (!slot) slot = 1; + (async () => { + let name = slot + '-quick.state'; + this.clearEJSResetTimer(); + this.functions.loadState(name, 0); + })(); + } + simulateInput(player, index, value) { + if (this.EJS.isNetplay) { + this.EJS.netplay.simulateInput(player, index, value); + return; + } + if ([24, 25, 26, 27, 28, 29].includes(index)) { + if (index === 24 && value === 1) { + const slot = this.EJS.settings['save-state-slot'] ? this.EJS.settings['save-state-slot'] : "1"; + this.quickSave(slot); + this.EJS.displayMessage(this.EJS.localization("SAVED STATE TO SLOT")+" "+slot); + } + if (index === 25 && value === 1) { + const slot = this.EJS.settings['save-state-slot'] ? this.EJS.settings['save-state-slot'] : "1"; + this.quickLoad(slot); + this.EJS.displayMessage(this.EJS.localization("LOADED STATE FROM SLOT")+" "+slot); + } + if (index === 26 && value === 1) { + let newSlot; + try { + newSlot = parseFloat(this.EJS.settings['save-state-slot'] ? this.EJS.settings['save-state-slot'] : "1") + 1; + } catch(e) { + newSlot = 1; + } + if (newSlot > 9) newSlot = 1; + this.EJS.displayMessage(this.EJS.localization("SET SAVE STATE SLOT TO")+" "+newSlot); + this.EJS.changeSettingOption('save-state-slot', newSlot.toString()); + } + if (index === 27) { + this.functions.toggleFastForward(this.EJS.isFastForward ? !value : value); + } + if (index === 29) { + this.functions.toggleSlowMotion(this.EJS.isSlowMotion ? !value : value); + } + if (index === 28) { + if (this.EJS.rewindEnabled) { + this.functions.toggleRewind(value); + } + } + return; + } + this.functions.simulateInput(player, index, value); + } + getFileNames() { + if (this.EJS.getCore() === "picodrive") { + return ["bin", "gen", "smd", "md", "32x", "cue", "iso", "sms", "68k", "chd"]; + } else { + return ["toc", "ccd", "exe", "pbp", "chd", "img", "bin", "iso"]; + } + } + createCueFile(fileNames) { + try { + if (fileNames.length > 1) { + fileNames = fileNames.filter((item) => { + return this.getFileNames().includes(item.split(".").pop().toLowerCase()); + }) + fileNames = fileNames.sort((a, b) => { + if (isNaN(a.charAt()) || isNaN(b.charAt())) throw new Error("Incorrect file name format"); + return (parseInt(a.charAt()) > parseInt(b.charAt())) ? 1 : -1; + }) + } + } catch(e) { + if (fileNames.length > 1) { + console.warn("Could not auto-create cue file(s)."); + return null; + } + } + for (let i=0; i 1) { + let contents = ""; + for (let i=0; i { + this.EJS.downloadFile('cores/ppsspp-assets.zip', (res) => { + this.EJS.checkCompression(new Uint8Array(res.data), this.EJS.localization("Decompress Game Data")).then((pspassets) => { + if (pspassets === -1) { + this.EJS.textElem.innerText = this.localization('Network Error'); + this.EJS.textElem.style.color = "red"; + return; + } + this.mkdir("/PPSSPP"); + + for (const file in pspassets) { + const data = pspassets[file]; + const path = "/PPSSPP/"+file; + const paths = path.split("/"); + let cp = ""; + for (let i=0; i {}); + } + supportsStates() { + return !!this.functions.supportsStates(); + } + getSaveFile() { + this.saveSaveFiles(); + const exists = FS.analyzePath(this.getSaveFilePath()).exists; + return (exists ? FS.readFile(this.getSaveFilePath()) : null); + } + loadSaveFiles() { + this.clearEJSResetTimer(); + this.functions.loadSaveFiles(); + } + setFastForwardRatio(ratio) { + this.functions.setFastForwardRatio(ratio); + } + toggleFastForward(active) { + this.functions.toggleFastForward(active); + } + setSlowMotionRatio(ratio) { + this.functions.setSlowMotionRatio(ratio); + } + toggleSlowMotion(active) { + this.functions.toggleSlowMotion(active); + } + setRewindGranularity(value) { + this.functions.setRewindGranularity(value); + } + getFrameNum() { + return this.functions.getFrameNum(); + } +} + +window.EJS_GameManager = EJS_GameManager; diff --git a/emulatorjs/data/compression/extract7z.js b/emulatorjs/data/compression/extract7z.js new file mode 100644 index 00000000..c48b7453 --- /dev/null +++ b/emulatorjs/data/compression/extract7z.js @@ -0,0 +1 @@ +var Module,Module=Module||((void 0!==Module?Module:null)||{}),moduleOverrides={},key;for(key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1,nodeFS,nodePath,TRY_USE_DUMP,key;if(Module.ENVIRONMENT)if("WEB"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if("WORKER"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if("NODE"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if("SHELL"!==Module.ENVIRONMENT)throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE)Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn),Module.read=function(e,r){nodeFS=nodeFS||require("fs"),e=(nodePath=nodePath||require("path")).normalize(e);e=nodeFS.readFileSync(e);return r?e:e.toString()},Module.readBinary=function(e){e=Module.read(e,!0);return e.buffer||(e=new Uint8Array(e)),assert(e.buffer),e},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(1>2],e=-16&(r+e+15|0);if((HEAP32[DYNAMICTOP_PTR>>2]=e,TOTAL_MEMORY<=e)&&!enlargeMemory())return HEAP32[DYNAMICTOP_PTR>>2]=r,0;return r},alignMemory:function(e,r){return e=Math.ceil(e/(r||16))*(r||16)},makeBigInt:function(e,r,t){return t?+(e>>>0)+4294967296*(r>>>0):+(e>>>0)+4294967296*(0|r)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0,cwrap,ccall;function assert(e,r){e||abort("Assertion failed: "+r)}function getCFunc(_0x222174){var _0x54cf7b=Module["_"+_0x222174];if(!_0x54cf7b)try{_0x54cf7b=eval("_"+_0x222174)}catch(_0x4b65d1){}return assert(_0x54cf7b,"Cannot call unknown function "+_0x222174+" (perhaps LLVM optimizations or closure removed it?)"),_0x54cf7b}function setValue(e,r,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":HEAP8[e>>0]=r;break;case"i16":HEAP16[e>>1]=r;break;case"i32":HEAP32[e>>2]=r;break;case"i64":tempI64=[r>>>0,(tempDouble=r,1<=+Math_abs(tempDouble)?0>>0:~~+Math_ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=r;break;case"double":HEAPF64[e>>3]=r;break;default:abort("invalid type for setValue: "+t)}}function getValue(e,r,t){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+r)}return null}!function(){var _0x17b09f={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var r=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,r),r},stringToC:function(e){var r,t=0;return null!=e&&0!==e&&(r=1+(e.length<<2),stringToUTF8(e,t=Runtime.stackAlloc(r),r)),t}},_0x237e8c={string:_0x17b09f.stringToC,array:_0x17b09f.arrayToC};ccall=function(e,r,t,n,i){var e=getCFunc(e),o=[],a=0;if(assert("array"!==r,'Return type should not be "array".'),n)for(var u=0;u>2]=0;for(s=u+o;n>0]=0;return u}if("i8"===a)return e.subarray||e.slice?HEAPU8.set(e,u):HEAPU8.set(new Uint8Array(e),u),u;for(var f,l,c,d=0;d>0],(0!=t||r)&&(i++,!r||i!=r););r=r||i;var o="";if(n<128){for(var a;0>0];if(!t)return r;r+=String.fromCharCode(t)}}function stringToAscii(e,r){return writeAsciiToMemory(e,r,!1)}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,r){for(var t=r;e[t];)++t;if(16>10,56320|1023&i))):s+=String.fromCharCode((31&a)<<6|u)):s+=String.fromCharCode(a)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,r,t,n){if(!(0>6,r[t++]=128|63&u}else if(u<=65535){if(o<=t+2)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|63&u}else if(u<=2097151){if(o<=t+3)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}else if(u<=67108863){if(o<=t+4)break;r[t++]=248|u>>24,r[t++]=128|u>>18&63,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}else{if(o<=t+5)break;r[t++]=252|u>>30,r[t++]=128|u>>24&63,r[t++]=128|u>>18&63,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}}return r[t]=0,t-i}function stringToUTF8(e,r,t){return assert("number"==typeof t,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),stringToUTF8Array(e,HEAPU8,r,t)}function lengthBytesUTF8(e){for(var r=0,t=0;t>2)-1]=34821223,HEAPU32[(STACK_MAX>>2)-2]=2310721022}function checkStackCookie(){if(34821223==HEAPU32[(STACK_MAX>>2)-1]&&2310721022==HEAPU32[(STACK_MAX>>2)-2]||abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+HEAPU32[(STACK_MAX>>2)-2].toString(16)+" "+HEAPU32[(STACK_MAX>>2)-1].toString(16)),1668509029!==HEAP32[0])throw"Runtime error: The application has corrupted its heap memory area (address zero)!"}function abortStackOverflow(e){abort("Stack overflow! Attempted to allocate "+e+" bytes on the stack, but stack has only "+(STACK_MAX-asm.stackSave()+e)+" bytes available!")}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){assert(HEAP32[DYNAMICTOP_PTR>>2]>TOTAL_MEMORY),assert(4>2]>=r)return!1;for(;TOTAL_MEMORY>2];)if(TOTAL_MEMORY>0]=e.charCodeAt(n);t||(HEAP8[r>>0]=0)}Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,r){var t=65535&e,n=65535&r;return t*n+((e>>>16)*n+t*(r>>>16)<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var r=0;r<32;r++)if(e&1<<31-r)return r;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null,runDependencyTracking={};function getUniqueRunDependency(e){for(var r=e;;){if(!runDependencyTracking[e])return e;e=r+Math.random()}return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(!runDependencyTracking[e]),runDependencyTracking[e]=1,null===runDependencyWatcher&&"undefined"!=typeof setInterval&&(runDependencyWatcher=setInterval(function(){if(ABORT)return clearInterval(runDependencyWatcher),void(runDependencyWatcher=null);var e,r=!1;for(e in runDependencyTracking)r||(r=!0,Module.printErr("still waiting on run dependencies:")),Module.printErr("dependency: "+e);r&&Module.printErr("(end of list)")},1e4))):Module.printErr("warning: run dependency added without ID")}function removeRunDependency(e){runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(runDependencyTracking[e]),delete runDependencyTracking[e]):Module.printErr("warning: run dependency removed without ID"),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled&&(e=dependenciesFulfilled,dependenciesFulfilled=null,e()))}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(e,r,t){for(var n=new Uint8Array(r),i=0;i>2]=e:Module.printErr("failed to set errno from JS"),e}var PATH={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,r){for(var t=0,n=e.length-1;0<=n;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t--;)e.unshift("..");return e},normalize:function(e){var r="/"===e.charAt(0),t="/"===e.substr(-1);return(e=PATH.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:function(e){var r=PATH.splitPath(e),e=r[0],r=r[1];return e||r?e+(r=r&&r.substr(0,r.length-1)):"."},basename:function(e){if("/"===e)return"/";var r=e.lastIndexOf("/");return-1===r?e:e.substr(r+1)},extname:function(e){return PATH.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return PATH.normalize(e.join("/"))},join2:function(e,r){return PATH.normalize(e+"/"+r)},resolve:function(){for(var e="",r=!1,t=arguments.length-1;-1<=t&&!r;t--){var n=0<=t?arguments[t]:FS.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r="/"===n.charAt(0)}return(r?"/":"")+(e=PATH.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||"."},relative:function(e,r){function t(e){for(var r=0;re.contents.length&&(e.contents=MEMFS.getFileDataAsRegularArray(e),e.usedBytes=e.contents.length),!e.contents||e.contents.subarray){var t=e.contents?e.contents.buffer.byteLength:0;if(r<=t)return;r=Math.max(r,t*(t<1048576?2:1.125)|0),0!=t&&(r=Math.max(r,256));t=e.contents;return e.contents=new Uint8Array(r),void(0r)e.contents.length=r;else for(;e.contents.length=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-i,n);if(assert(0<=a),8t.timestamp)&&(a.push(e),o++)});var t=[];if(Object.keys(i.entries).forEach(function(e){i.entries[e];n.entries[e]||(t.push(e),o++)}),!o)return r(null);var u=0,e=("remote"===n.type?n:i).db.transaction([IDBFS.DB_STORE_NAME],"readwrite"),s=e.objectStore(IDBFS.DB_STORE_NAME);function f(e){return e?f.errored?void 0:(f.errored=!0,r(e)):++u>=o?r(null):void 0}e.onerror=function(e){f(this.error),e.preventDefault()},a.sort().forEach(function(t){"local"===i.type?IDBFS.loadRemoteEntry(s,t,function(e,r){return e?f(e):void IDBFS.storeLocalEntry(t,r,f)}):IDBFS.loadLocalEntry(t,function(e,r){return e?f(e):void IDBFS.storeRemoteEntry(s,t,r,f)})}),t.sort().reverse().forEach(function(e){"local"===i.type?IDBFS.removeLocalEntry(e,f):IDBFS.removeRemoteEntry(s,e,f)})}},NODEFS={isWindows:!1,staticInit:function(){NODEFS.isWindows=!!process.platform.match(/^win/)},mount:function(e){return assert(ENVIRONMENT_IS_NODE),NODEFS.createNode(null,"/",NODEFS.getMode(e.opts.root),0)},createNode:function(e,r,t,n){if(!FS.isDir(t)&&!FS.isFile(t)&&!FS.isLink(t))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);t=FS.createNode(e,r,t);return t.node_ops=NODEFS.node_ops,t.stream_ops=NODEFS.stream_ops,t},getMode:function(e){var r;try{r=fs.lstatSync(e),NODEFS.isWindows&&(r.mode=r.mode|(146&r.mode)>>1)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return r.mode},realPath:function(e){for(var r=[];e.parent!==e;)r.push(e.name),e=e.parent;return r.push(e.mount.opts.root),r.reverse(),PATH.join.apply(null,r)},flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:function(e){if(e&=-2097153,e&=-2049,e&=-32769,(e&=-524289)in NODEFS.flagsToPermissionStringMap)return NODEFS.flagsToPermissionStringMap[e];throw new FS.ErrnoError(ERRNO_CODES.EINVAL)},node_ops:{getattr:function(e){var r,t=NODEFS.realPath(e);try{r=fs.lstatSync(t)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return NODEFS.isWindows&&!r.blksize&&(r.blksize=4096),NODEFS.isWindows&&!r.blocks&&(r.blocks=(r.size+r.blksize-1)/r.blksize|0),{dev:r.dev,ino:r.ino,mode:r.mode,nlink:r.nlink,uid:r.uid,gid:r.gid,rdev:r.rdev,size:r.size,atime:r.atime,mtime:r.mtime,ctime:r.ctime,blksize:r.blksize,blocks:r.blocks}},setattr:function(e,r){var t,n=NODEFS.realPath(e);try{void 0!==r.mode&&(fs.chmodSync(n,r.mode),e.mode=r.mode),void 0!==r.timestamp&&(t=new Date(r.timestamp),fs.utimesSync(n,t,t)),void 0!==r.size&&fs.truncateSync(n,r.size)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},lookup:function(e,r){var t=PATH.join2(NODEFS.realPath(e),r),t=NODEFS.getMode(t);return NODEFS.createNode(e,r,t)},mknod:function(e,r,t,n){var i=NODEFS.createNode(e,r,t,n),o=NODEFS.realPath(i);try{FS.isDir(i.mode)?fs.mkdirSync(o,i.mode):fs.writeFileSync(o,"",{mode:i.mode})}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return i},rename:function(e,r,t){var n=NODEFS.realPath(e),i=PATH.join2(NODEFS.realPath(r),t);try{fs.renameSync(n,i)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},unlink:function(e,r){var t=PATH.join2(NODEFS.realPath(e),r);try{fs.unlinkSync(t)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},rmdir:function(e,r){var t=PATH.join2(NODEFS.realPath(e),r);try{fs.rmdirSync(t)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},readdir:function(e){var r=NODEFS.realPath(e);try{return fs.readdirSync(r)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},symlink:function(e,r,t){var n=PATH.join2(NODEFS.realPath(e),r);try{fs.symlinkSync(t,n)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},readlink:function(e){var r=NODEFS.realPath(e);try{return r=fs.readlinkSync(r),NODEJS_PATH.relative(NODEJS_PATH.resolve(e.mount.opts.root),r)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}},stream_ops:{open:function(e){var r=NODEFS.realPath(e.node);try{FS.isFile(e.node.mode)&&(e.nfd=fs.openSync(r,NODEFS.flagsToPermissionString(e.flags)))}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},close:function(e){try{FS.isFile(e.node.mode)&&e.nfd&&fs.closeSync(e.nfd)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},read:function(e,r,t,n,i){if(0===n)return 0;var o,a=new Buffer(n);try{o=fs.readSync(e.nfd,a,0,n,i)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(0=e.node.size)return 0;i=e.node.contents.slice(i,i+n),n=WORKERFS.reader.readAsArrayBuffer(i);return r.set(new Uint8Array(n),t),i.size},write:function(e,r,t,n,i){throw new FS.ErrnoError(ERRNO_CODES.EIO)},llseek:function(e,r,t){if(1===t?r+=e.position:2===t&&FS.isFile(e.node.mode)&&(r+=e.node.size),r<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return r}}};STATICTOP+=16,STATICTOP+=16,STATICTOP+=16;var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)},lookupPath:function(e,r){if(r=r||{},!(e=PATH.resolve(FS.cwd(),e)))return{path:"",node:null};var t,n={follow_mount:!0,recurse_count:0};for(t in n)void 0===r[t]&&(r[t]=n[t]);if(8>>0)%FS.nameTable.length},hashAddNode:function(e){var r=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[r],FS.nameTable[r]=e},hashRemoveNode:function(e){var r=FS.hashName(e.parent.id,e.name);if(FS.nameTable[r]===e)FS.nameTable[r]=e.name_next;else for(var t=FS.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:function(e,r){var t=FS.mayLookup(e);if(t)throw new FS.ErrnoError(t,e);for(var t=FS.hashName(e.id,r),n=FS.nameTable[t];n;n=n.name_next){var i=n.name;if(n.parent.id===e.id&&i===r)return n}return FS.lookup(e,r)},createNode:function(e,r,t,n){FS.FSNode||(FS.FSNode=function(e,r,t,n){e=e||this,this.parent=e,this.mount=e.mount,this.mounted=null,this.id=FS.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},FS.FSNode.prototype={},Object.defineProperties(FS.FSNode.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}}));n=new FS.FSNode(e,r,t,n);return FS.hashAddNode(n),n},destroyNode:function(e){FS.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var r=FS.flagModes[e];if(void 0===r)throw new Error("Unknown file open mode: "+e);return r},flagsToPermissionString:function(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:function(e,r){return FS.ignorePermissions||(-1===r.indexOf("r")||292&e.mode)&&(-1===r.indexOf("w")||146&e.mode)&&(-1===r.indexOf("x")||73&e.mode)?0:ERRNO_CODES.EACCES},mayLookup:function(e){var r=FS.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:ERRNO_CODES.EACCES)},mayCreate:function(e,r){try{FS.lookupNode(e,r);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(e,"wx")},mayDelete:function(e,r,t){var n;try{n=FS.lookupNode(e,r)}catch(e){return e.errno}var i=FS.nodePermissions(e,"wx");if(i)return i;if(t){if(!FS.isDir(n.mode))return ERRNO_CODES.ENOTDIR;if(FS.isRoot(n)||FS.getPath(n)===FS.cwd())return ERRNO_CODES.EBUSY}else if(FS.isDir(n.mode))return ERRNO_CODES.EISDIR;return 0},mayOpen:function(e,r){return e?FS.isLink(e.mode)?ERRNO_CODES.ELOOP:FS.isDir(e.mode)&&("r"!==FS.flagsToPermissionString(r)||512&r)?ERRNO_CODES.EISDIR:FS.nodePermissions(e,FS.flagsToPermissionString(r)):ERRNO_CODES.ENOENT},MAX_OPEN_FDS:4096,nextfd:function(e,r){e=e||0,r=r||FS.MAX_OPEN_FDS;for(var t=e;t<=r;t++)if(!FS.streams[t])return t;throw new FS.ErrnoError(ERRNO_CODES.EMFILE)},getStream:function(e){return FS.streams[e]},createStream:function(e,r,t){FS.FSStream||(FS.FSStream=function(){},FS.FSStream.prototype={},Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}));var n,i=new FS.FSStream;for(n in e)i[n]=e[n];e=i;t=FS.nextfd(r,t);return e.fd=t,FS.streams[t]=e},closeStream:function(e){FS.streams[e]=null},chrdev_stream_ops:{open:function(e){var r=FS.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,r){return e<<8|r},registerDevice:function(e,r){FS.devices[e]={stream_ops:r}},getDevice:function(e){return FS.devices[e]},getMounts:function(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:function(r,t){"function"==typeof r&&(t=r,r=!1),FS.syncFSRequests++,1=n.length&&o(null)}n.forEach(function(e){return e.type.syncfs?void e.type.syncfs(e,r,a):a(null)})},mount:function(e,r,t){var n="/"===t,i=!t;if(n&&FS.root)throw new FS.ErrnoError(ERRNO_CODES.EBUSY);if(!n&&!i){var o=FS.lookupPath(t,{follow_mount:!1});if(t=o.path,o=o.node,FS.isMountpoint(o))throw new FS.ErrnoError(ERRNO_CODES.EBUSY);if(!FS.isDir(o.mode))throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}t={type:e,opts:r,mountpoint:t,mounts:[]},e=e.mount(t);return(e.mount=t).root=e,n?FS.root=e:o&&(o.mounted=t,o.mount&&o.mount.mounts.push(t)),e},unmount:function(e){var r=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(r.node))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var e=r.node,r=e.mounted,n=FS.getMounts(r);Object.keys(FS.nameTable).forEach(function(e){for(var r=FS.nameTable[e];r;){var t=r.name_next;-1!==n.indexOf(r.mount)&&FS.destroyNode(r),r=t}}),e.mounted=null;r=e.mount.mounts.indexOf(r);assert(-1!==r),e.mount.mounts.splice(r,1)},lookup:function(e,r){return e.node_ops.lookup(e,r)},mknod:function(e,r,t){var n=FS.lookupPath(e,{parent:!0}).node,i=PATH.basename(e);if(!i||"."===i||".."===i)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);e=FS.mayCreate(n,i);if(e)throw new FS.ErrnoError(e);if(!n.node_ops.mknod)throw new FS.ErrnoError(ERRNO_CODES.EPERM);return n.node_ops.mknod(n,i,r,t)},create:function(e,r){return r=void 0!==r?r:438,r&=4095,r|=32768,FS.mknod(e,r,0)},mkdir:function(e,r){return r=void 0!==r?r:511,r&=1023,r|=16384,FS.mknod(e,r,0)},mkdirTree:function(e,r){for(var t=e.split("/"),n="",i=0;ithis.length-1||e<0)){var r=e%this.chunkSize,e=e/this.chunkSize|0;return this.getter(e)[r]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",a,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw new Error("Couldn't load "+a+". Status: "+e.status);var n=Number(e.getResponseHeader("Content-length")),r=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,t=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;r||(i=n);var o=this;o.setDataGetter(function(e){var r=e*i,t=(e+1)*i-1,t=Math.min(t,n-1);if(void 0===o.chunks[e]&&(o.chunks[e]=function(e,r){if(r=o.length)return 0;var a=Math.min(o.length-i,n);if(assert(0<=a),o.slice)for(var u=0;u>2]=n.dev,HEAP32[t+4>>2]=0,HEAP32[t+8>>2]=n.ino,HEAP32[t+12>>2]=n.mode,HEAP32[t+16>>2]=n.nlink,HEAP32[t+20>>2]=n.uid,HEAP32[t+24>>2]=n.gid,HEAP32[t+28>>2]=n.rdev,HEAP32[t+32>>2]=0,HEAP32[t+36>>2]=n.size,HEAP32[t+40>>2]=4096,HEAP32[t+44>>2]=n.blocks,HEAP32[t+48>>2]=n.atime.getTime()/1e3|0,HEAP32[t+52>>2]=0,HEAP32[t+56>>2]=n.mtime.getTime()/1e3|0,HEAP32[t+60>>2]=0,HEAP32[t+64>>2]=n.ctime.getTime()/1e3|0,HEAP32[t+68>>2]=0,HEAP32[t+72>>2]=n.ino,0},doMsync:function(e,r,t,n){e=new Uint8Array(HEAPU8.subarray(e,e+t));FS.msync(r,e,0,t,n)},doMkdir:function(e,r){return"/"===(e=PATH.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),FS.mkdir(e,r,0),0},doMknod:function(e,r,t){switch(61440&r){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}return FS.mknod(e,r,t),0},doReadlink:function(e,r,t){if(t<=0)return-ERRNO_CODES.EINVAL;var n=FS.readlink(e),i=Math.min(t,lengthBytesUTF8(n)),e=HEAP8[r+i];return stringToUTF8(n,r,t+1),HEAP8[r+i]=e,i},doAccess:function(e,r){if(-8&r)return-ERRNO_CODES.EINVAL;var t=FS.lookupPath(e,{follow:!0}).node,e="";return 4&r&&(e+="r"),2&r&&(e+="w"),1&r&&(e+="x"),e&&FS.nodePermissions(t,e)?-ERRNO_CODES.EACCES:0},doDup:function(e,r,t){var n=FS.getStream(t);return n&&FS.close(n),FS.open(e,r,0,t,t).fd},doReadv:function(e,r,t,n){for(var i=0,o=0;o>2],u=HEAP32[r+(8*o+4)>>2],a=FS.read(e,HEAP8,a,u,n);if(a<0)return-1;if(i+=a,a>2],u=HEAP32[r+(8*o+4)>>2],u=FS.write(e,HEAP8,a,u,n);if(u<0)return-1;i+=u}return i},varargs:0,get:function(e){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},getStreamFromFD:function(){var e=FS.getStream(SYSCALLS.get());if(!e)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return e},getSocketFromFD:function(){var e=SOCKFS.getSocket(SYSCALLS.get());if(!e)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return e},getSocketAddress:function(e){var r=SYSCALLS.get(),t=SYSCALLS.get();if(e&&0===r)return null;t=__read_sockaddr(r,t);if(t.errno)throw new FS.ErrnoError(t.errno);return t.addr=DNS.lookup_addr(t.addr)||t.addr,t},get64:function(){var e=SYSCALLS.get(),r=SYSCALLS.get();return assert(0<=e?0===r:-1===r),e},getZero:function(){assert(0===SYSCALLS.get())}};function ___syscall5(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStr(),n=SYSCALLS.get(),i=SYSCALLS.get();return FS.open(t,n,i).fd}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___lock(){}function ___unlock(){}function ___syscall6(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD();return FS.close(t),0}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC),fs,NODEJS_PATH;function _emscripten_memcpy_big(e,r,t){return HEAPU8.set(HEAPU8.subarray(r,r+t),e),e}function ___syscall140(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD(),n=SYSCALLS.get(),i=SYSCALLS.get(),o=SYSCALLS.get(),a=SYSCALLS.get(),i=i;return assert(0===n),FS.llseek(t,i,a),HEAP32[o>>2]=t.position,t.getdents&&0===i&&0===a&&(t.getdents=null),0}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD(),n=SYSCALLS.get(),i=SYSCALLS.get();return SYSCALLS.doWritev(t,n,i)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD(),n=SYSCALLS.get();switch(n){case 21505:case 21506:return t.tty?0:-ERRNO_CODES.ENOTTY;case 21519:if(!t.tty)return-ERRNO_CODES.ENOTTY;var i=SYSCALLS.get();return HEAP32[i>>2]=0;case 21520:return t.tty?-ERRNO_CODES.EINVAL:-ERRNO_CODES.ENOTTY;case 21531:i=SYSCALLS.get();return FS.ioctl(t,n,i);default:abort("bad ioctl syscall "+n)}}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall221(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD();switch(SYSCALLS.get()){case 0:return(n=SYSCALLS.get())<0?-ERRNO_CODES.EINVAL:FS.open(t.path,t.flags,0,n).fd;case 1:case 2:return 0;case 3:return t.flags;case 4:var n=SYSCALLS.get();return t.flags|=n,0;case 12:case 12:n=SYSCALLS.get();return HEAP16[n+0>>1]=2,0;case 13:case 14:case 13:case 14:return 0;case 16:case 8:return-ERRNO_CODES.EINVAL;case 9:return ___setErrNo(ERRNO_CODES.EINVAL),-1;default:return-ERRNO_CODES.EINVAL}}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall145(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD(),n=SYSCALLS.get(),i=SYSCALLS.get();return SYSCALLS.doReadv(t,n,i)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function nullFunc_iiii(e){Module.printErr("Invalid function pointer called with signature 'iiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),Module.printErr("Build with ASSERTIONS=2 for more info."),abort(e)}function nullFunc_vi(e){Module.printErr("Invalid function pointer called with signature 'vi'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),Module.printErr("Build with ASSERTIONS=2 for more info."),abort(e)}function nullFunc_vii(e){Module.printErr("Invalid function pointer called with signature 'vii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),Module.printErr("Build with ASSERTIONS=2 for more info."),abort(e)}function nullFunc_ii(e){Module.printErr("Invalid function pointer called with signature 'ii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),Module.printErr("Build with ASSERTIONS=2 for more info."),abort(e)}function nullFunc_iiiii(e){Module.printErr("Invalid function pointer called with signature 'iiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),Module.printErr("Build with ASSERTIONS=2 for more info."),abort(e)}function nullFunc_iii(e){Module.printErr("Invalid function pointer called with signature 'iii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),Module.printErr("Build with ASSERTIONS=2 for more info."),abort(e)}function invoke_iiii(e,r,t,n){try{return Module.dynCall_iiii(e,r,t,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_vi(e,r){try{Module.dynCall_vi(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_vii(e,r,t){try{Module.dynCall_vii(e,r,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_ii(e,r){try{return Module.dynCall_ii(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_iiiii(e,r,t,n,i){try{return Module.dynCall_iiiii(e,r,t,n,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_iii(e,r,t){try{return Module.dynCall_iii(e,r,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}Module._llvm_cttz_i32=_llvm_cttz_i32,Module.___udivmoddi4=___udivmoddi4,Module.___udivdi3=___udivdi3,Module._sbrk=_sbrk,Module.___uremdi3=___uremdi3,Module._memcpy=_memcpy,Module._pthread_self=_pthread_self,FS.staticInit(),__ATINIT__.unshift(function(){Module.noFSInit||FS.init.initialized||FS.init()}),__ATMAIN__.push(function(){FS.ignorePermissions=!1}),__ATEXIT__.push(function(){FS.quit()}),Module.FS_createFolder=FS.createFolder,Module.FS_createPath=FS.createPath,Module.FS_createDataFile=FS.createDataFile,Module.FS_createPreloadedFile=FS.createPreloadedFile,Module.FS_createLazyFile=FS.createLazyFile,Module.FS_createLink=FS.createLink,Module.FS_createDevice=FS.createDevice,Module.FS_unlink=FS.unlink,__ATINIT__.unshift(function(){TTY.init()}),__ATEXIT__.push(function(){TTY.shutdown()}),ENVIRONMENT_IS_NODE&&(fs=require("fs"),NODEJS_PATH=require("path"),NODEFS.staticInit()),DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0,assert(DYNAMIC_BASE>2])+(t<<2)>>2];if(St[a>>2]=0,-1==((St[u>>2]=0)|h))return or[3&St[s+4>>2]](s,0|St[i>>2]),St[n>>2]=-1,St[i>>2]=0,(p=St[o>>2]=0)|p;if(0==(0|St[i>>2])||(0|St[n>>2])!=(0|h)){if(E=0|G(d=(b=0|St[e+12>>2])+(40*h|0)|0),_=Ft,S=0|function(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,o=0,a=0;(0|(pt=(n=pt)+16|0))>=(0|bt)&&yt(16);return o=n+4|0,St[(i=(a=n)+8|0)>>2]=e,St[o>>2]=r,St[a>>2]=t,t=40+(0|St[i>>2])|0,r=(0|St[52+(0|St[i>>2])>>2])+((0|St[(0|St[48+(0|St[i>>2])>>2])+(St[o>>2]<<2)>>2])+(0|St[a>>2])<<3)|0,a=0|Dt(0|St[t>>2],0|St[t+4>>2],0|St[r>>2],0|St[r+4>>2]),pt=n,0|a}(e,h,0),m=Ft,!((0|E)==(0|E)&0==(0|_)))return 0|(p=2);if(St[n>>2]=h,or[3&St[s+4>>2]](s,0|St[i>>2]),(St[i>>2]=0)|(n=0|he(r,S,m)))return 0|(p=n);if(St[o>>2]=E){if(n=0|sr[3&St[s>>2]](s,E),!(St[i>>2]=n))return 0|(p=2);k=n}else k=0|St[i>>2];if(0|(n=0|Re(d,(0|St[e>>2])+(St[(0|St[e+48>>2])+(h<<2)>>2]<<3)|0,r,S,m,k,E,f,l,c)))return 0|(p=n);if(0|St[b+(40*h|0)+28>>2]&&(0|(n=0|Pe(0|St[i>>2],E)))!=(0|St[b+(40*h|0)+32>>2]))return 0|(p=3)}if(b=0|St[e+16>>2],(n=(St[a>>2]=0)|St[(0|St[e+56>>2])+(h<<2)>>2])>>>0>>0){for(h=n,n=0;n=n+(0|St[b+(h<<5)+8>>2])|0,h=h+1|0,(0|h)!=(0|t););St[a>>2]=n}return n=0|St[b+(t<<5)+8>>2],St[u>>2]=n,((u=0|St[a>>2])+n|0)>>>0>(0|St[o>>2])>>>0?0|(p=11):0|Et[b+(t<<5)+27>>0]?0|(p=(0|(o=0|Pe((0|St[i>>2])+u|0,n)))==(0|St[b+(t<<5)+16>>2])?0:3):(p=0)|p}function j(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,o,a,u,s,f,l,c,d,E,_=0,S=0,m=pt;(0|bt)<=(0|(pt=pt+48|0))&&yt(48),i=m+36|0,a=m+28|0,u=m+24|0,s=m+20|0,f=m+16|0,l=m+12|0,c=m+8|0,d=m+4|0,St[(o=(E=m)+32|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[s>>2]=n,St[f>>2]=0,St[l>>2]=0;e:for(;;){if((0|St[l>>2])==(0|St[s>>2])){_=3;break}if(n=0|St[l>>2],St[l>>2]=n+1,St[d>>2]=re[(0|St[u>>2])+(n<<1)>>1],(0|St[d>>2])>>>0<128)0|St[o>>2]&&(Et[(0|St[o>>2])+(0|St[f>>2])>>0]=St[d>>2]),St[f>>2]=1+(0|St[f>>2]);else{if(55296<=(0|St[d>>2])>>>0&(0|St[d>>2])>>>0<57344){if(56320<=(0|St[d>>2])>>>0){_=23;break}if((0|St[l>>2])==(0|St[s>>2])){_=23;break}if(n=0|St[l>>2],St[l>>2]=n+1,St[E>>2]=re[(0|St[u>>2])+(n<<1)>>1],(0|St[E>>2])>>>0<56320|57344<=(0|St[E>>2])>>>0){_=23;break}St[d>>2]=65536+((0|St[d>>2])-55296<<10|(0|St[E>>2])-56320)}for(St[c>>2]=1;!(5<=(0|St[c>>2])>>>0||(0|St[d>>2])>>>0<1<<6+(5*(0|St[c>>2])|0)>>>0);)St[c>>2]=1+(0|St[c>>2]);for(0|St[o>>2]&&(Et[(0|St[o>>2])+(0|St[f>>2])>>0]=(0|mt[(0|St[c>>2])-1+341>>0])+((0|St[d>>2])>>>(6*(0|St[c>>2])|0))),St[f>>2]=1+(0|St[f>>2]);;)if(St[c>>2]=(0|St[c>>2])-1,0|St[o>>2]&&(Et[(0|St[o>>2])+(0|St[f>>2])>>0]=128+((0|St[d>>2])>>>(6*(0|St[c>>2])|0)&63)),St[f>>2]=1+(0|St[f>>2]),!(0|St[c>>2]))continue e}}return 3==(0|_)?(St[St[a>>2]>>2]=St[f>>2],Et[i>>0]=1,S=0|Et[i>>0],pt=m,0|1&S):23==(0|_)?(St[St[a>>2]>>2]=St[f>>2],S=(Et[i>>0]=0)|Et[i>>0],pt=m,0|1&S):0}function X(e){e|=0;var r,t=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(r=t)>>2]=e,Ce(16+(0|St[r>>2])|0),pt=t}function P(e){e|=0;var r,t=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(r=t)>>2]=e,St[St[r>>2]>>2]=0,St[4+(0|St[r>>2])>>2]=0,St[8+(0|St[r>>2])>>2]=0,St[12+(0|St[r>>2])>>2]=0,St[16+(0|St[r>>2])>>2]=0,St[20+(0|St[r>>2])>>2]=0,St[24+(0|St[r>>2])>>2]=0,St[28+(0|St[r>>2])>>2]=0,St[32+(0|St[r>>2])>>2]=0,St[36+(0|St[r>>2])>>2]=0,pt=t}function N(e,r){e|=0,r|=0;var t,n,i,o=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),n=o+4|0,St[(t=(i=o)+8|0)>>2]=e,St[n>>2]=r;e:do{if(0|St[St[t>>2]>>2])for(St[i>>2]=0;;){if((0|St[i>>2])>>>0>=(0|St[16+(0|St[t>>2])>>2])>>>0)break e;!function(e,r){e|=0,r|=0;var t,n,i=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(t=(n=i)+4|0)>>2]=e,St[n>>2]=r,Le(16+(0|St[t>>2])|0,0|St[n>>2]),X(0|St[t>>2]),pt=i}((0|St[St[t>>2]>>2])+(24*(0|St[i>>2])|0)|0,0|St[n>>2]),St[i>>2]=1+(0|St[i>>2])}}while(0);or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[St[t>>2]>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[4+(0|St[t>>2])>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[8+(0|St[t>>2])>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[12+(0|St[t>>2])>>2]),P(0|St[t>>2]),pt=o}function C(e){e|=0;var r,t,n,i=pt;for((0|bt)<=(0|(pt=pt+16|0))&&yt(16),t=i+4|0,St[(r=(n=i)+8|0)>>2]=e,St[t>>2]=0,St[n>>2]=0;!((0|St[n>>2])>>>0>=(0|St[16+(0|St[r>>2])>>2])>>>0);)St[t>>2]=(0|St[t>>2])+(0|St[(0|St[St[r>>2]>>2])+(24*(0|St[n>>2])|0)+4>>2]),St[n>>2]=1+(0|St[n>>2]);return pt=i,0|St[t>>2]}function G(e){e|=0;var r,t,n,i,o=0,a=0,u=0,s=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),n=(r=s)+8|0,St[(t=s+12|0)>>2]=e,e=0|C(0|St[t>>2]),St[n>>2]=e;do{if(0|St[n>>2]){for(St[n>>2]=(0|St[n>>2])-1;;){if((0|St[n>>2])<0){o=8;break}if(e=(0|function(e,r){e|=0,r|=0;var t,n,i,o,a=0,u=0,s=0,f=pt;for((0|bt)<=(0|(pt=pt+16|0))&&yt(16),t=f+12|0,i=f+4|0,St[(n=(o=f)+8|0)>>2]=e,St[i>>2]=r,St[o>>2]=0;;){if((0|St[o>>2])>>>0>=(0|St[20+(0|St[n>>2])>>2])>>>0){a=6;break}if(u=0|St[o>>2],(0|St[(0|St[4+(0|St[n>>2])>>2])+(St[o>>2]<<3)+4>>2])==(0|St[i>>2])){a=4;break}St[o>>2]=u+1}return 4==(0|a)?(St[t>>2]=u,s=0|St[t>>2],pt=f,0|s):6==(0|a)?(St[t>>2]=-1,s=0|St[t>>2],pt=f,0|s):0}(0|St[t>>2],0|St[n>>2]))<0,a=0|St[n>>2],e){o=6;break}St[n>>2]=a+-1}if(6==(0|o)){e=(0|St[12+(0|St[t>>2])>>2])+(a<<3)|0,u=0|St[e+4>>2],St[(i=r)>>2]=St[e>>2],St[i+4>>2]=u;break}if(8==(0|o)){St[(u=r)>>2]=0,St[u+4>>2]=0;break}}else St[(u=r)>>2]=0,St[u+4>>2]=0}while(0);return Ft=0|St[(o=r)+4>>2],pt=s,0|St[o>>2]}function q(e){e|=0;var r,t=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(r=t)>>2]=e,St[St[r>>2]>>2]=0,St[4+(0|St[r>>2])>>2]=0,St[8+(0|St[r>>2])>>2]=0,St[12+(0|St[r>>2])>>2]=0,St[16+(0|St[r>>2])>>2]=0,St[20+(0|St[r>>2])>>2]=0,St[24+(0|St[r>>2])>>2]=0,St[28+(0|St[r>>2])>>2]=0,pt=t}function Z(e,r){e|=0,r|=0;var t,n,i,o=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),n=o+4|0,St[(t=(i=o)+8|0)>>2]=e,St[n>>2]=r;e:do{if(0|St[12+(0|St[t>>2])>>2])for(St[i>>2]=0;;){if((0|St[i>>2])>>>0>=(0|St[24+(0|St[t>>2])>>2])>>>0)break e;N((0|St[12+(0|St[t>>2])>>2])+(40*(0|St[i>>2])|0)|0,0|St[n>>2]),St[i>>2]=1+(0|St[i>>2])}}while(0);or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[St[t>>2]>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[4+(0|St[t>>2])>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[8+(0|St[t>>2])>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[12+(0|St[t>>2])>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[16+(0|St[t>>2])>>2]),q(0|St[t>>2]),pt=o}function J(e){e|=0;var r,t=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(r=t)>>2]=e,q(0|St[r>>2]),St[48+(0|St[r>>2])>>2]=0,St[52+(0|St[r>>2])>>2]=0,St[56+(0|St[r>>2])>>2]=0,St[60+(0|St[r>>2])>>2]=0,Ce(68+((St[64+(0|St[r>>2])>>2]=0)|St[r>>2])|0),pt=t}function $(e,r){e|=0,r|=0;var t,n,i=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(t=(n=i)+4|0)>>2]=e,St[n>>2]=r,or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[48+(0|St[t>>2])>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[52+(0|St[t>>2])>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[56+(0|St[t>>2])>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[60+(0|St[t>>2])>>2]),or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[64+(0|St[t>>2])>>2]),Le(68+(0|St[t>>2])|0,0|St[n>>2]),Z(0|St[t>>2],0|St[n>>2]),J(0|St[t>>2]),pt=i}function ee(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s,f=0,l=pt;if((0|bt)<=(0|(pt=pt+32|0))&&yt(32),i=l+16|0,o=l+12|0,a=l+8|0,u=l+4|0,St[(n=(s=l)+20|0)>>2]=e,St[i>>2]=r,St[o>>2]=t,St[a>>2]=(0|St[(0|St[64+(0|St[n>>2])>>2])+(1+(0|St[i>>2])<<2)>>2])-(0|St[(0|St[64+(0|St[n>>2])>>2])+(St[i>>2]<<2)>>2]),!(0|St[o>>2]))return f=0|St[a>>2],pt=l,0|f;for(St[s>>2]=(0|St[68+(0|St[n>>2])>>2])+(St[(0|St[64+(0|St[n>>2])>>2])+(St[i>>2]<<2)>>2]<<1),St[u>>2]=0;!((0|St[u>>2])>>>0>=(0|St[a>>2])>>>0);)_t[(0|St[o>>2])+(St[u>>2]<<1)>>1]=0|mt[(0|St[s>>2])+(St[u>>2]<<1)>>0]|(65535&(0|mt[(0|St[s>>2])+(St[u>>2]<<1)+1>>0]))<<8,St[u>>2]=1+(0|St[u>>2]);return f=0|St[a>>2],pt=l,0|f}function ue(e,r){e|=0,r|=0;var t,n,i=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(t=(n=i)+4|0)>>2]=e,St[n>>2]=r,r=0|le(0|St[t>>2],0|St[n>>2]),pt=i,0|r}function se(e,r,t,n,i,o,a,u,s){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0,a|=0,u|=0,s|=0;var f,l,c,d,E,_,S,m,h,p,b,k,F,w,y,v=0,M=0,O=pt;(0|bt)<=(0|(pt=pt+64|0))&&yt(64),f=O+60|0,c=O+52|0,d=O+48|0,E=O+44|0,_=O+40|0,S=O+36|0,m=O+32|0,h=O+28|0,p=O+24|0,k=(b=O)+20|0,F=O+16|0,w=O+12|0,y=O+8|0,St[(l=O+56|0)>>2]=e,St[c>>2]=r,St[d>>2]=t,St[E>>2]=n,St[_>>2]=i,St[S>>2]=o,St[m>>2]=a,St[h>>2]=u,St[p>>2]=s;e:for(;;){if(s=0|ue(0|St[l>>2],b),St[k>>2]=s,0|St[k>>2]){v=3;break}if((0|(s=0|St[b>>2]))!=(0|St[(u=b)>>2])||(((0|s)<0)<<31>>31|0)!=(0|St[u+4>>2])){v=5;break}switch(0|St[b>>2]){case 0:v=7;break e;case 6:if(u=0|function(e,r,t,n,i,o,a){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0,a|=0;var u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0;(0|(pt=(u=pt)+80|0))>=(0|bt)&&yt(80);if(s=u+68|0,l=u+60|0,c=u+56|0,d=u+52|0,E=u+48|0,_=u+44|0,S=u+40|0,m=u+36|0,h=u+32|0,p=u+28|0,b=u+24|0,k=u+20|0,w=(F=u)+16|0,y=u+12|0,v=u+8|0,St[(f=u+64|0)>>2]=e,St[l>>2]=r,St[c>>2]=t,St[d>>2]=n,St[E>>2]=i,St[_>>2]=o,St[S>>2]=a,a=0|le(0|St[f>>2],0|St[l>>2]),St[h>>2]=a,0|St[h>>2])return St[s>>2]=St[h>>2],M=0|St[s>>2],pt=u,0|M;if(h=0|fe(0|St[f>>2],0|St[c>>2]),St[p>>2]=h,0|St[p>>2])return St[s>>2]=St[p>>2],M=0|St[s>>2],pt=u,0|M;if(p=0|I(0|St[f>>2],9,0),St[b>>2]=p,0|St[b>>2])return St[s>>2]=St[b>>2],M=0|St[s>>2],pt=u,0|M;if(0|St[St[c>>2]>>2]){if(b=0|sr[3&St[St[S>>2]>>2]](0|St[S>>2],St[St[c>>2]>>2]<<3),!(St[St[d>>2]>>2]=b))return St[s>>2]=2,M=0|St[s>>2],pt=u,0|M}else St[St[d>>2]>>2]=0;St[m>>2]=0;for(;!((0|St[m>>2])>>>0>=(0|St[St[c>>2]>>2])>>>0);){if(b=0|le(0|St[f>>2],(0|St[St[d>>2]>>2])+(St[m>>2]<<3)|0),St[k>>2]=b,0|St[k>>2]){O=14;break}St[m>>2]=1+(0|St[m>>2])}if(14==(0|O))return St[s>>2]=St[k>>2],M=0|St[s>>2],pt=u,0|M;for(;;){if(k=0|ue(0|St[f>>2],F),St[w>>2]=k,0|St[w>>2]){O=17;break}if(0==(0|St[(k=F)>>2])&0==(0|St[k+4>>2])){O=24;break}if(k=F,d=0|St[f>>2],10==(0|St[k>>2])&0==(0|St[k+4>>2])){if(k=0|ne(d,0|St[St[c>>2]>>2],0|St[E>>2],0|St[_>>2],0|St[S>>2]),St[y>>2]=k,0|St[y>>2]){O=21;break}}else if(k=0|me(d),St[v>>2]=k,0|St[v>>2]){O=23;break}}{if(17==(0|O))return St[s>>2]=St[w>>2],M=0|St[s>>2],pt=u,0|M;if(21==(0|O))return St[s>>2]=St[y>>2],M=0|St[s>>2],pt=u,0|M;if(23==(0|O))return St[s>>2]=St[v>>2],M=0|St[s>>2],pt=u,0|M;if(24==(0|O)){r:do{if(!(0|St[St[E>>2]>>2])){if(0|St[St[c>>2]>>2]){if(O=0|sr[3&St[St[S>>2]>>2]](0|St[S>>2],0|St[St[c>>2]>>2]),!(St[St[E>>2]>>2]=O))return St[s>>2]=2,M=0|St[s>>2],pt=u,0|M}else St[St[E>>2]>>2]=0;if(0|St[St[c>>2]>>2]){if(O=0|sr[3&St[St[S>>2]>>2]](0|St[S>>2],St[St[c>>2]>>2]<<2),!(St[St[_>>2]>>2]=O))return St[s>>2]=2,M=0|St[s>>2],pt=u,0|M}else St[St[_>>2]>>2]=0;for(St[m>>2]=0;;){if((0|St[m>>2])>>>0>=(0|St[St[c>>2]>>2])>>>0)break r;Et[(0|St[St[E>>2]>>2])+(0|St[m>>2])>>0]=0,St[(0|St[St[_>>2]>>2])+(St[m>>2]<<2)>>2]=0,St[m>>2]=1+(0|St[m>>2])}}}while(0);return St[s>>2]=0,M=0|St[s>>2],pt=u,0|M}}return 0}(0|St[l>>2],0|St[c>>2],20+(0|St[d>>2])|0,0|St[d>>2],4+(0|St[d>>2])|0,8+(0|St[d>>2])|0,0|St[h>>2]),St[F>>2]=u,0|St[F>>2]){v=9;break e}continue e;case 7:if(u=0|function(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0,i|=0;var o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0,N=0,D=0;(0|(pt=(o=pt)+112|0))>=(0|bt)&&yt(112);if(a=o+96|0,s=o+88|0,f=o+84|0,l=o+80|0,c=o+76|0,d=o+72|0,E=o+68|0,_=o+64|0,S=o+60|0,m=o+56|0,h=o+52|0,p=o+48|0,b=o+44|0,k=o+40|0,F=o+36|0,y=(w=o)+32|0,v=o+28|0,M=o+24|0,O=o+20|0,A=o+16|0,R=o+12|0,g=o+8|0,St[(u=o+92|0)>>2]=e,St[s>>2]=r,St[f>>2]=t,St[l>>2]=n,St[c>>2]=i,i=0|I(0|St[u>>2],11,0),St[E>>2]=i,0|St[E>>2])return St[a>>2]=St[E>>2],T=0|St[a>>2],pt=o,0|T;if(E=0|fe(0|St[u>>2],0|St[s>>2]),St[_>>2]=E,0|St[_>>2])return St[a>>2]=St[_>>2],T=0|St[a>>2],pt=o,0|T;if(_=0|de(0|St[u>>2]),St[S>>2]=_,0|St[S>>2])return St[a>>2]=St[S>>2],T=0|St[a>>2],pt=o,0|T;if(0|St[St[s>>2]>>2]){if(S=0|sr[3&St[St[l>>2]>>2]](0|St[l>>2],40*(0|St[St[s>>2]>>2])|0),!(St[St[f>>2]>>2]=S))return St[a>>2]=2,T=0|St[a>>2],pt=o,0|T}else St[St[f>>2]>>2]=0;St[d>>2]=0;for(;!((0|St[d>>2])>>>0>=(0|St[St[s>>2]>>2])>>>0);)P((0|St[St[f>>2]>>2])+(40*(0|St[d>>2])|0)|0),St[d>>2]=1+(0|St[d>>2]);St[d>>2]=0;for(;N=0|St[u>>2],!((0|St[d>>2])>>>0>=(0|St[St[s>>2]>>2])>>>0);){if(S=0|function(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0,U=0,z=0;(0|(pt=(n=pt)+160|0))>=(0|bt)&&yt(160);if(i=n+136|0,a=n+128|0,u=n+124|0,s=n+120|0,f=n+116|0,l=n+112|0,c=n+108|0,d=n+104|0,E=n+100|0,_=n+96|0,S=n+155|0,m=n+92|0,h=n+88|0,p=n+84|0,b=n+140|0,k=n+80|0,F=n+76|0,w=n+72|0,y=n+68|0,v=n+8|0,M=n+64|0,O=n+60|0,A=n+56|0,R=n+52|0,g=n+48|0,T=n+44|0,N=n+40|0,P=(D=n)+36|0,C=n+32|0,I=n+28|0,L=n+24|0,x=n+20|0,B=n+16|0,St[(o=n+132|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[d>>2]=0,St[E>>2]=0,t=0|fe(0|St[o>>2],s),St[_>>2]=t,0|St[_>>2])return St[i>>2]=St[_>>2],H=0|St[i>>2],pt=n,0|H;if(32<(0|St[s>>2])>>>0)return St[i>>2]=4,H=0|St[i>>2],pt=n,0|H;if(St[16+(0|St[a>>2])>>2]=St[s>>2],0|St[s>>2]){if(_=0|sr[3&St[St[u>>2]>>2]](0|St[u>>2],24*(0|St[s>>2])|0),!(St[St[a>>2]>>2]=_))return St[i>>2]=2,H=0|St[i>>2],pt=n,0|H}else St[St[a>>2]>>2]=0;St[c>>2]=0;for(;!((0|St[c>>2])>>>0>=(0|St[s>>2])>>>0);)X((0|St[St[a>>2]>>2])+(24*(0|St[c>>2])|0)|0),St[c>>2]=1+(0|St[c>>2]);St[c>>2]=0;r:for(;;){if((0|St[c>>2])>>>0>=(0|St[s>>2])>>>0){U=55;break}if(St[m>>2]=(0|St[St[a>>2]>>2])+(24*(0|St[c>>2])|0),_=0|te(0|St[o>>2],S),St[k>>2]=_,0|St[k>>2]){U=15;break}if(St[h>>2]=15&(0|mt[S>>0]),_=0|ie(0|St[o>>2],b,0|St[h>>2]),St[F>>2]=_,0|St[F>>2]){U=17;break}if(8<(0|St[h>>2])>>>0){U=19;break}for(_=8+(0|St[m>>2])|0,St[_>>2]=0,St[_+4>>2]=0,St[p>>2]=0;!((0|St[p>>2])>>>0>=(0|St[h>>2])>>>0);)_=0|It(0|mt[b+((0|St[h>>2])-1-(0|St[p>>2]))>>0],0,St[p>>2]<<3|0),t=8+(0|St[m>>2])|0,e=St[(r=t)+4>>2]|Ft,St[(z=t)>>2]=St[r>>2]|_,St[z+4>>2]=e,St[p>>2]=1+(0|St[p>>2]);if(16&(0|mt[S>>0])|0){if(e=0|fe(0|St[o>>2],0|St[m>>2]),St[w>>2]=e,0|St[w>>2]){U=25;break}if(e=0|fe(0|St[o>>2],4+(0|St[m>>2])|0),St[y>>2]=e,0|St[y>>2]){U=27;break}if(32<(0|St[St[m>>2]>>2])>>>0){U=30;break}if(32<(0|St[4+(0|St[m>>2])>>2])>>>0){U=30;break}}else St[St[m>>2]>>2]=1,St[4+(0|St[m>>2])>>2]=1;if(32&(0|mt[S>>0])|0){if(St[(e=v)>>2]=0,St[e+4>>2]=0,e=0|le(0|St[o>>2],v),St[M>>2]=e,0|St[M>>2]){U=34;break}if(!(0|Ie(16+(0|St[m>>2])|0,0|St[v>>2],0|St[u>>2]))){U=36;break}if(e=0|ie(0|St[o>>2],0|St[16+(0|St[m>>2])>>2],0|St[v>>2]),St[O>>2]=e,0|St[O>>2]){U=38;break}}for(;128&(0|mt[S>>0]);){if(e=0|te(0|St[o>>2],S),St[A>>2]=e,0|St[A>>2]){U=41;break r}if(e=15&(0|mt[S>>0]),z=0|ce(0|St[o>>2],e,((0|e)<0)<<31>>31),St[R>>2]=z,0|St[R>>2]){U=43;break r}if(16&(0|mt[S>>0])|0){if(z=0|fe(0|St[o>>2],g),St[T>>2]=z,0|St[T>>2]){U=46;break r}if(z=0|fe(0|St[o>>2],g),St[N>>2]=z,0|St[N>>2]){U=48;break r}}if(32&(0|mt[S>>0])){if(St[(z=D)>>2]=0,St[z+4>>2]=0,z=0|le(0|St[o>>2],D),St[P>>2]=z,0|St[P>>2]){U=51;break r}if(z=D,e=0|ce(0|St[o>>2],0|St[z>>2],0|St[z+4>>2]),St[C>>2]=e,0|St[C>>2]){U=53;break r}}}St[d>>2]=(0|St[d>>2])+(0|St[St[m>>2]>>2]),St[E>>2]=(0|St[E>>2])+(0|St[4+(0|St[m>>2])>>2]),St[c>>2]=1+(0|St[c>>2])}switch(0|U){case 15:return St[i>>2]=St[k>>2],H=0|St[i>>2],pt=n,0|H;case 17:return St[i>>2]=St[F>>2],H=0|St[i>>2],pt=n,0|H;case 19:return St[i>>2]=4,H=0|St[i>>2],pt=n,0|H;case 25:return St[i>>2]=St[w>>2],H=0|St[i>>2],pt=n,0|H;case 27:return St[i>>2]=St[y>>2],H=0|St[i>>2],pt=n,0|H;case 30:return St[i>>2]=4,H=0|St[i>>2],pt=n,0|H;case 34:return St[i>>2]=St[M>>2],H=0|St[i>>2],pt=n,0|H;case 36:return St[i>>2]=2,H=0|St[i>>2],pt=n,0|H;case 38:return St[i>>2]=St[O>>2],H=0|St[i>>2],pt=n,0|H;case 41:return St[i>>2]=St[A>>2],H=0|St[i>>2],pt=n,0|H;case 43:return St[i>>2]=St[R>>2],H=0|St[i>>2],pt=n,0|H;case 46:return St[i>>2]=St[T>>2],H=0|St[i>>2],pt=n,0|H;case 48:return St[i>>2]=St[N>>2],H=0|St[i>>2],pt=n,0|H;case 51:return St[i>>2]=St[P>>2],H=0|St[i>>2],pt=n,0|H;case 53:return St[i>>2]=St[C>>2],H=0|St[i>>2],pt=n,0|H;case 55:if(!(0|St[E>>2]))return St[i>>2]=4,H=0|St[i>>2],pt=n,0|H;if(C=(0|St[E>>2])-1|0,St[f>>2]=C,St[20+(0|St[a>>2])>>2]=C,0|St[f>>2]){if(C=0|sr[3&St[St[u>>2]>>2]](0|St[u>>2],St[f>>2]<<3),!(St[4+(0|St[a>>2])>>2]=C))return St[i>>2]=2,H=0|St[i>>2],pt=n,0|H}else St[4+(0|St[a>>2])>>2]=0;for(St[c>>2]=0;;){if((0|St[c>>2])>>>0>=(0|St[f>>2])>>>0){U=68;break}if(St[I>>2]=(0|St[4+(0|St[a>>2])>>2])+(St[c>>2]<<3),C=0|fe(0|St[o>>2],0|St[I>>2]),St[L>>2]=C,0|St[L>>2]){U=64;break}if(C=0|fe(0|St[o>>2],4+(0|St[I>>2])|0),St[x>>2]=C,0|St[x>>2]){U=66;break}St[c>>2]=1+(0|St[c>>2])}if(64==(0|U))return St[i>>2]=St[L>>2],H=0|St[i>>2],pt=n,0|H;if(66==(0|U))return St[i>>2]=St[x>>2],H=0|St[i>>2],pt=n,0|H;if(68!=(0|U))break;if((0|St[d>>2])>>>0<(0|St[f>>2])>>>0)return St[i>>2]=4,H=0|St[i>>2],pt=n,0|H;if(U=(0|St[d>>2])-(0|St[f>>2])|0,St[l>>2]=U,St[24+(0|St[a>>2])>>2]=U,0|St[l>>2]){if(U=0|sr[3&St[St[u>>2]>>2]](0|St[u>>2],St[l>>2]<<2),!(St[8+(0|St[a>>2])>>2]=U))return St[i>>2]=2,H=0|St[i>>2],pt=n,0|H}else St[8+(0|St[a>>2])>>2]=0;U=1==(0|St[l>>2]),St[c>>2]=0;r:do{if(U){for(;!((0|St[c>>2])>>>0>=(0|St[d>>2])>>>0||(0|function(e,r){e|=0,r|=0;var t,n,i,o,a=0,u=0,s=0,f=pt;for((0|bt)<=(0|(pt=pt+16|0))&&yt(16),t=f+12|0,i=f+4|0,St[(n=(o=f)+8|0)>>2]=e,St[i>>2]=r,St[o>>2]=0;;){if((0|St[o>>2])>>>0>=(0|St[20+(0|St[n>>2])>>2])>>>0){a=6;break}if(u=0|St[o>>2],(0|St[(0|St[4+(0|St[n>>2])>>2])+(St[o>>2]<<3)>>2])==(0|St[i>>2])){a=4;break}St[o>>2]=u+1}return 4==(0|a)?(St[t>>2]=u,s=0|St[t>>2],pt=f,0|s):6==(0|a)?(St[t>>2]=-1,s=0|St[t>>2],pt=f,0|s):0}(0|St[a>>2],0|St[c>>2]))<0);)St[c>>2]=1+(0|St[c>>2]);if((0|St[c>>2])==(0|St[d>>2]))return St[i>>2]=4,H=0|St[i>>2],pt=n,0|H;St[St[8+(0|St[a>>2])>>2]>>2]=St[c>>2];break}for(;;){if((0|St[c>>2])>>>0>=(0|St[l>>2])>>>0)break r;if(u=0|fe(0|St[o>>2],(0|St[8+(0|St[a>>2])>>2])+(St[c>>2]<<2)|0),St[B>>2]=u,0|St[B>>2])break;St[c>>2]=1+(0|St[c>>2])}return St[i>>2]=St[B>>2],H=0|St[i>>2],pt=n,0|H}while(0);return St[i>>2]=0,H=0|St[i>>2],pt=n,0|H}return 0}(N,(0|St[St[f>>2]>>2])+(40*(0|St[d>>2])|0)|0,0|St[l>>2]),St[m>>2]=S,0|St[m>>2]){D=17;break}St[d>>2]=1+(0|St[d>>2])}if(17==(0|D))return St[a>>2]=St[m>>2],T=0|St[a>>2],pt=o,0|T;if(m=0|I(N,12,0),St[h>>2]=m,0|St[h>>2])return St[a>>2]=St[h>>2],T=0|St[a>>2],pt=o,0|T;St[d>>2]=0;r:for(;;){if((0|St[d>>2])>>>0>=(0|St[St[s>>2]>>2])>>>0){D=33;break}if(St[b>>2]=(0|St[St[f>>2]>>2])+(40*(0|St[d>>2])|0),h=0|C(0|St[b>>2]),St[k>>2]=h,0|St[k>>2]){if(h=0|sr[3&St[St[l>>2]>>2]](0|St[l>>2],St[k>>2]<<3),!(St[12+(0|St[b>>2])>>2]=h)){D=26;break}}else St[12+(0|St[b>>2])>>2]=0;for(St[p>>2]=0;!((0|St[p>>2])>>>0>=(0|St[k>>2])>>>0);){if(h=0|le(0|St[u>>2],(0|St[12+(0|St[b>>2])>>2])+(St[p>>2]<<3)|0),St[F>>2]=h,0|St[F>>2]){D=30;break r}St[p>>2]=1+(0|St[p>>2])}St[d>>2]=1+(0|St[d>>2])}{if(26==(0|D))return St[a>>2]=2,T=0|St[a>>2],pt=o,0|T;if(30==(0|D))return St[a>>2]=St[F>>2],T=0|St[a>>2],pt=o,0|T;if(33==(0|D)){for(;;){if(F=(D=0)|ue(0|St[u>>2],w),St[y>>2]=F,0|St[y>>2]){D=34;break}if(0==(0|St[(F=w)>>2])&0==(0|St[F+4>>2])){D=36;break}if(10==(0|St[(F=w)>>2])&0==(0|St[F+4>>2])){St[M>>2]=0,St[O>>2]=0,F=0|ne(0|St[u>>2],0|St[St[s>>2]>>2],M,O,0|St[c>>2]),St[v>>2]=F;r:do{if(!(0|St[v>>2]))for(St[d>>2]=0;;){if((0|St[d>>2])>>>0>=(0|St[St[s>>2]>>2])>>>0)break r;St[A>>2]=(0|St[St[f>>2]>>2])+(40*(0|St[d>>2])|0),St[28+(0|St[A>>2])>>2]=mt[(0|St[M>>2])+(0|St[d>>2])>>0],St[32+(0|St[A>>2])>>2]=St[(0|St[O>>2])+(St[d>>2]<<2)>>2],St[d>>2]=1+(0|St[d>>2])}}while(0);if(or[3&St[4+(0|St[c>>2])>>2]](0|St[c>>2],0|St[O>>2]),or[3&St[4+(0|St[c>>2])>>2]](0|St[c>>2],0|St[M>>2]),St[R>>2]=St[v>>2],0|St[R>>2]){D=43;break}D=33}else{if(F=0|me(0|St[u>>2]),St[g>>2]=F,0|St[g>>2]){D=45;break}D=33}}if(34==(0|D))return St[a>>2]=St[y>>2],T=0|St[a>>2],pt=o,0|T;if(36==(0|D))return St[a>>2]=0,T=0|St[a>>2],pt=o,0|T;if(43==(0|D))return St[a>>2]=St[R>>2],T=0|St[a>>2],pt=o,0|T;if(45==(0|D))return St[a>>2]=St[g>>2],T=0|St[a>>2],pt=o,0|T}}return 0}(0|St[l>>2],24+(0|St[d>>2])|0,12+(0|St[d>>2])|0,0|St[h>>2],0|St[p>>2]),St[w>>2]=u,0|St[w>>2]){v=11;break e}continue e;case 8:if(u=0|function(e,r,t,n,i,o,a,u){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0,a|=0,u|=0;var s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0,U=0,z=0,Y=0,V=0,K=0;(0|(pt=(s=pt)+160|0))>=(0|bt)&&yt(160);f=s+144|0,c=s+136|0,d=s+132|0,E=s+128|0,_=s+124|0,S=s+120|0,m=s+116|0,h=s+112|0,p=s+16|0,b=s+108|0,k=s+104|0,F=s+100|0,w=s+96|0,y=s+92|0,v=s+88|0,M=s+84|0,O=s+8|0,A=s+80|0,R=s+76|0,T=(g=s)+72|0,N=s+68|0,D=s+64|0,P=s+60|0,C=s+56|0,I=s+52|0,L=s+48|0,x=s+44|0,B=s+40|0,H=s+36|0,U=s+32|0,z=s+28|0,Y=s+24|0,St[(l=s+140|0)>>2]=e,St[c>>2]=r,St[d>>2]=t,St[E>>2]=n,St[_>>2]=i,St[S>>2]=o,St[m>>2]=a,St[h>>2]=u,St[(u=p)>>2]=0,St[u+4>>2]=0,St[k>>2]=0,St[F>>2]=0,St[b>>2]=0;for(;!((0|St[b>>2])>>>0>=(0|St[c>>2])>>>0);)St[(0|St[d>>2])+(40*(0|St[b>>2])|0)+36>>2]=1,St[b>>2]=1+(0|St[b>>2]);St[St[E>>2]>>2]=St[c>>2];r:for(;;){if(u=0|ue(0|St[l>>2],p),St[w>>2]=u,0|St[w>>2]){V=6;break}if(13==(0|St[(u=p)>>2])&0==(0|St[u+4>>2]))for(St[St[E>>2]>>2]=0,St[b>>2]=0;;){if((0|St[b>>2])>>>0>=(0|St[c>>2])>>>0)continue r;if(o=0|fe(0|St[l>>2],y),St[v>>2]=o,0|St[v>>2]){V=11;break r}St[(0|St[d>>2])+(40*(0|St[b>>2])|0)+36>>2]=St[y>>2],o=0|St[E>>2],St[o>>2]=(0|St[o>>2])+(0|St[y>>2]),St[b>>2]=1+(0|St[b>>2])}else{if(o=a=u=p,10==(0|St[u>>2])&0==(0|St[u+4>>2])|9==(0|St[a>>2])&0==(0|St[a+4>>2])|0==(0|St[o>>2])&0==(0|St[o+4>>2])){V=16;break}if(o=0|me(0|St[l>>2]),St[M>>2]=o,0|St[M>>2]){V=15;break}}}{if(6==(0|V))return St[f>>2]=St[w>>2],K=0|St[f>>2],pt=s,0|K;if(11==(0|V))return St[f>>2]=St[v>>2],K=0|St[f>>2],pt=s,0|K;if(15==(0|V))return St[f>>2]=St[M>>2],K=0|St[f>>2],pt=s,0|K;if(16==(0|V)){if(0|St[St[E>>2]>>2]){if(M=0|sr[3&St[St[h>>2]>>2]](0|St[h>>2],St[St[E>>2]>>2]<<3),St[St[_>>2]>>2]=M,!(0|St[St[_>>2]>>2]))return St[f>>2]=2,K=0|St[f>>2],pt=s,0|K;if(M=0|sr[3&St[St[h>>2]>>2]](0|St[h>>2],0|St[St[E>>2]>>2]),St[St[S>>2]>>2]=M,!(0|St[St[S>>2]>>2]))return St[f>>2]=2,K=0|St[f>>2],pt=s,0|K;if(M=0|sr[3&St[St[h>>2]>>2]](0|St[h>>2],St[St[E>>2]>>2]<<2),St[St[m>>2]>>2]=M,!(0|St[St[m>>2]>>2]))return St[f>>2]=2,K=0|St[f>>2],pt=s,0|K}else St[St[_>>2]>>2]=0,St[St[S>>2]>>2]=0,St[St[m>>2]>>2]=0;St[b>>2]=0;r:for(;!((0|St[b>>2])>>>0>=(0|St[c>>2])>>>0);){if(St[(M=O)>>2]=0,St[M+4>>2]=0,St[R>>2]=St[(0|St[d>>2])+(40*(0|St[b>>2])|0)+36>>2],0|St[R>>2]){M=p;t:do{if(9==(0|St[M>>2])&0==(0|St[M+4>>2]))for(St[A>>2]=1;;){if((0|St[A>>2])>>>0>=(0|St[R>>2])>>>0)break t;if(v=0|le(0|St[l>>2],g),St[T>>2]=v,0|St[T>>2]){V=31;break r}w=0|St[(v=g)>>2],y=0|St[v+4>>2],v=0|St[k>>2],St[k>>2]=v+1,o=(0|St[St[_>>2]>>2])+(v<<3)|0,St[o>>2]=w,St[o+4>>2]=y,y=g,w=0|Dt(0|St[(o=O)>>2],0|St[o+4>>2],0|St[y>>2],0|St[y+4>>2]),St[(y=O)>>2]=w,St[y+4>>2]=Ft,St[A>>2]=1+(0|St[A>>2])}}while(0);M=0|G((0|St[d>>2])+(40*(0|St[b>>2])|0)|0),w=0|Nt(0|M,0|Ft,0|St[(y=O)>>2],0|St[y+4>>2]),y=0|St[k>>2],St[k>>2]=y+1,M=(0|St[St[_>>2]>>2])+(y<<3)|0,St[M>>2]=w,St[M+4>>2]=Ft}St[b>>2]=1+(0|St[b>>2])}if(31==(0|V))return St[f>>2]=St[T>>2],K=0|St[f>>2],pt=s,0|K;if(9==(0|St[(T=p)>>2])&0==(0|St[T+4>>2])&&(T=0|ue(0|St[l>>2],p),St[N>>2]=T,0|St[N>>2]))return St[f>>2]=St[N>>2],K=0|St[f>>2],pt=s,0|K;for(St[b>>2]=0;!((0|St[b>>2])>>>0>=(0|St[St[E>>2]>>2])>>>0);)Et[(0|St[St[S>>2]>>2])+(0|St[b>>2])>>0]=0,St[(0|St[St[m>>2]>>2])+(St[b>>2]<<2)>>2]=0,St[b>>2]=1+(0|St[b>>2]);for(St[b>>2]=0;!((0|St[b>>2])>>>0>=(0|St[c>>2])>>>0);)St[D>>2]=St[(0|St[d>>2])+(40*(0|St[b>>2])|0)+36>>2],1==(0|St[D>>2])&&0!=(0|St[(0|St[d>>2])+(40*(0|St[b>>2])|0)+28>>2])||(St[F>>2]=(0|St[F>>2])+(0|St[D>>2])),St[b>>2]=1+(0|St[b>>2]);for(St[k>>2]=0;;){if(10==(0|St[(D=p)>>2])&0==(0|St[D+4>>2])){St[P>>2]=0,St[C>>2]=0,St[I>>2]=0,D=0|ne(0|St[l>>2],0|St[F>>2],C,I,0|St[h>>2]),St[L>>2]=D;r:do{if(!(0|St[L>>2]))for(St[b>>2]=0;;){if((0|St[b>>2])>>>0>=(0|St[c>>2])>>>0)break r;St[x>>2]=(0|St[d>>2])+(40*(0|St[b>>2])|0),St[B>>2]=St[36+(0|St[x>>2])>>2],1==(0|St[B>>2])&&0|St[28+(0|St[x>>2])>>2]?(Et[(0|St[St[S>>2]>>2])+(0|St[k>>2])>>0]=1,St[(0|St[St[m>>2]>>2])+(St[k>>2]<<2)>>2]=St[32+(0|St[x>>2])>>2],St[k>>2]=1+(0|St[k>>2])):V=55;t:do{if(55==(0|V))for(V=0,St[H>>2]=0;;){if((0|St[H>>2])>>>0>=(0|St[B>>2])>>>0)break t;Et[(0|St[St[S>>2]>>2])+(0|St[k>>2])>>0]=0|Et[(0|St[C>>2])+(0|St[P>>2])>>0],St[(0|St[St[m>>2]>>2])+(St[k>>2]<<2)>>2]=St[(0|St[I>>2])+(St[P>>2]<<2)>>2],St[k>>2]=1+(0|St[k>>2]),St[H>>2]=1+(0|St[H>>2]),St[P>>2]=1+(0|St[P>>2])}}while(0);St[b>>2]=1+(0|St[b>>2])}}while(0);if(or[3&St[4+(0|St[h>>2])>>2]](0|St[h>>2],0|St[C>>2]),or[3&St[4+(0|St[h>>2])>>2]](0|St[h>>2],0|St[I>>2]),St[U>>2]=St[L>>2],0|St[U>>2]){V=60;break}}else{if(0==(0|St[(D=p)>>2])&0==(0|St[D+4>>2])){V=62;break}if(D=0|me(0|St[l>>2]),St[z>>2]=D,0|St[z>>2]){V=64;break}}if(D=0|ue(0|St[l>>2],p),St[Y>>2]=D,0|St[Y>>2]){V=66;break}}if(60==(0|V))return St[f>>2]=St[U>>2],K=0|St[f>>2],pt=s,0|K;if(62==(0|V))return St[f>>2]=0,K=0|St[f>>2],pt=s,0|K;if(64==(0|V))return St[f>>2]=St[z>>2],K=0|St[f>>2],pt=s,0|K;if(66==(0|V))return St[f>>2]=St[Y>>2],K=0|St[f>>2],pt=s,0|K}}return 0}(0|St[l>>2],0|St[24+(0|St[d>>2])>>2],0|St[12+(0|St[d>>2])>>2],0|St[E>>2],0|St[_>>2],0|St[S>>2],0|St[m>>2],0|St[p>>2]),St[y>>2]=u,0|St[y>>2]){v=13;break e}continue e;default:v=14;break e}}return 3==(0|v)?(St[f>>2]=St[k>>2],M=0|St[f>>2],pt=O,0|M):5==(0|v)?(St[f>>2]=4,M=0|St[f>>2],pt=O,0|M):7==(0|v)?(M=(St[f>>2]=0)|St[f>>2],pt=O,0|M):9==(0|v)?(St[f>>2]=St[F>>2],M=0|St[f>>2],pt=O,0|M):11==(0|v)?(St[f>>2]=St[w>>2],M=0|St[f>>2],pt=O,0|M):13==(0|v)?(St[f>>2]=St[y>>2],M=0|St[f>>2],pt=O,0|M):14==(0|v)?(St[f>>2]=4,M=0|St[f>>2],pt=O,0|M):0}function fe(e,r){e|=0,r|=0;var t,n,i,o,a=0,u=0,s=pt;return(0|bt)<=(0|(pt=pt+32|0))&&yt(32),t=s+20|0,i=s+12|0,a=(o=s)+8|0,St[(n=s+16|0)>>2]=e,St[i>>2]=r,r=0|le(0|St[n>>2],o),St[a>>2]=r,pt=(u=0|St[a>>2]?(St[t>>2]=St[a>>2],0|St[t>>2]):0<(r=0|St[(a=o)+4>>2])>>>0|0==(0|r)&2147483648<=(0|St[a>>2])>>>0?(St[t>>2]=4,0|St[t>>2]):0<(r=0|St[(a=o)+4>>2])>>>0|0==(0|r)&67108864<=(0|St[a>>2])>>>0?(St[t>>2]=4,0|St[t>>2]):(St[St[i>>2]>>2]=St[o>>2],(St[t>>2]=0)|St[t>>2]),s),0|u}function le(e,r){e|=0,r|=0;var t,n,i,o,a,u,s,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=pt;if((0|bt)<=(0|(pt=pt+48|0))&&yt(48),t=m+28|0,f=m+20|0,i=m+34|0,l=m+33|0,c=m+16|0,d=m+12|0,E=m+32|0,a=(o=m)+8|0,St[(n=m+24|0)>>2]=e,St[f>>2]=r,Et[l>>0]=-128,r=0|te(0|St[n>>2],i),St[d>>2]=r,0|St[d>>2])return St[t>>2]=St[d>>2],_=0|St[t>>2],pt=m,0|_;for(d=0|St[f>>2],St[d>>2]=0,St[d+4>>2]=0,St[c>>2]=0;;){if(8<=(0|St[c>>2])){S=10;break}if(!((0|mt[i>>0])&(0|mt[l>>0]))){S=6;break}if(d=0|te(0|St[n>>2],E),St[a>>2]=d,0|St[a>>2]){S=8;break}d=0|It(0|mt[E>>0],0,St[c>>2]<<3|0),r=0|St[f>>2],u=St[(e=r)+4>>2]|Ft,St[(s=r)>>2]=St[e>>2]|d,St[s+4>>2]=u,Et[l>>0]=(0|mt[l>>0])>>1,St[c>>2]=1+(0|St[c>>2])}return 6==(0|S)?(E=(0|mt[i>>0])&(0|mt[l>>0])-1,St[(l=o)>>2]=E,St[l+4>>2]=((0|E)<0)<<31>>31,o=0|It(0|St[(E=o)>>2],0|St[E+4>>2],St[c>>2]<<3|0),c=0|St[f>>2],E=0|Dt(0|St[(f=c)>>2],0|St[f+4>>2],0|o,0|Ft),St[(o=c)>>2]=E,St[o+4>>2]=Ft,_=(St[t>>2]=0)|St[t>>2],pt=m,0|_):8==(0|S)?(St[t>>2]=St[a>>2],_=0|St[t>>2],pt=m,0|_):10==(0|S)?(_=(St[t>>2]=0)|St[t>>2],pt=m,0|_):0}function ce(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a=0,u=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),n=u+12|0,St[(i=(o=u)+8|0)>>2]=e,St[(e=o)>>2]=r,St[e+4>>2]=t,e=0|St[(t=o)+4>>2],pt=(a=0>>0|(0==(0|e)?(0|St[t>>2])>>>0>(0|St[4+(0|St[i>>2])>>2])>>>0:0)?(St[n>>2]=16,0|St[n>>2]):(t=4+(0|St[i>>2])|0,St[t>>2]=(0|St[t>>2])-(0|St[o>>2]),t=0|St[i>>2],St[t>>2]=(0|St[t>>2])+(0|St[o>>2]),(St[n>>2]=0)|St[n>>2]),u),0|a}function de(e){e|=0;var r,t,n,i,o=0,a=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),r=a+8|0,n=a+12|0,St[(t=(i=a)+4|0)>>2]=e,e=0|te(0|St[t>>2],n),St[i>>2]=e,pt=(o=(0|St[i>>2]?St[r>>2]=St[i>>2]:St[r>>2]=0==(0|mt[n>>0])?0:4,0|St[r>>2]),a),0|o}function Ee(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,o,a,u,s,f,l,c,d,E=0,_=0,S=pt;if((0|bt)<=(0|(pt=pt+32|0))&&yt(32),i=S+24|0,a=S+16|0,u=S+12|0,s=S+8|0,f=S+29|0,l=S+28|0,c=S+4|0,St[(o=(d=S)+20|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[s>>2]=n,Et[f>>0]=0,(Et[l>>0]=0)|St[a>>2]){if(n=0|sr[3&St[St[s>>2]>>2]](0|St[s>>2],0|St[a>>2]),!(St[St[u>>2]>>2]=n))return St[i>>2]=2,E=0|St[i>>2],pt=S,0|E}else St[St[u>>2]>>2]=0;for(St[c>>2]=0;;){if((0|St[c>>2])>>>0>=(0|St[a>>2])>>>0){_=12;break}if(!(0|mt[l>>0])){if(n=0|te(0|St[o>>2],f),St[d>>2]=n,0|St[d>>2]){_=9;break}Et[l>>0]=-128}Et[(0|St[St[u>>2]>>2])+(0|St[c>>2])>>0]=(0|mt[f>>0])&(0|mt[l>>0])|0?1:0,Et[l>>0]=(0|mt[l>>0])>>1,St[c>>2]=1+(0|St[c>>2])}return 9==(0|_)?(St[i>>2]=St[d>>2],E=0|St[i>>2],pt=S,0|E):12==(0|_)?(E=(St[i>>2]=0)|St[i>>2],pt=S,0|E):0}function _e(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,o,a,u,s,f,l,c=0,d=0,E=pt;if((0|bt)<=(0|(pt=pt+32|0))&&yt(32),i=E+24|0,a=E+16|0,u=E+12|0,s=E+8|0,c=E+28|0,f=E+4|0,St[(o=(l=E)+20|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[s>>2]=n,n=0|te(0|St[o>>2],c),St[l>>2]=n,0|St[l>>2])return St[i>>2]=St[l>>2],d=0|St[i>>2],pt=E,0|d;if(!(0|mt[c>>0]))return c=0|Ee(0|St[o>>2],0|St[a>>2],0|St[u>>2],0|St[s>>2]),St[i>>2]=c,d=0|St[i>>2],pt=E,0|d;if(0|St[a>>2]){if(c=0|sr[3&St[St[s>>2]>>2]](0|St[s>>2],0|St[a>>2]),!(St[St[u>>2]>>2]=c))return St[i>>2]=2,d=0|St[i>>2],pt=E,0|d}else St[St[u>>2]>>2]=0;for(St[f>>2]=0;!((0|St[f>>2])>>>0>=(0|St[a>>2])>>>0);)Et[(0|St[St[u>>2]>>2])+(0|St[f>>2])>>0]=1,St[f>>2]=1+(0|St[f>>2]);return d=(St[i>>2]=0)|St[i>>2],pt=E,0|d}function Se(e,r){e|=0,r|=0;var t,n,i,o,a,u,s=0,f=0,l=pt;for((0|bt)<=(0|(pt=pt+32|0))&&yt(32),t=l+16|0,i=l+8|0,o=l+4|0,a=l+20|0,St[(n=(u=l)+12|0)>>2]=e,St[i>>2]=r,St[St[i>>2]>>2]=0,St[o>>2]=0;;){if(4<=(0|St[o>>2])){s=6;break}if(r=0|te(0|St[n>>2],a),St[u>>2]=r,0|St[u>>2]){s=4;break}r=0|St[i>>2],St[r>>2]=St[r>>2]|(0|mt[a>>0])<<(St[o>>2]<<3),St[o>>2]=1+(0|St[o>>2])}return 4==(0|s)?(St[t>>2]=St[u>>2],f=0|St[t>>2],pt=l,0|f):6==(0|s)?(f=(St[t>>2]=0)|St[t>>2],pt=l,0|f):0}function te(e,r){e|=0,r|=0;var t,n,i,o=0,a=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),t=a+8|0,St[(n=(i=a)+4|0)>>2]=e,St[i>>2]=r,pt=(o=0|St[4+(0|St[n>>2])>>2]?(r=4+(0|St[n>>2])|0,St[r>>2]=(0|St[r>>2])-1,r=0|St[n>>2],n=0|St[r>>2],St[r>>2]=1+n,Et[St[i>>2]>>0]=0|Et[n>>0],(St[t>>2]=0)|St[t>>2]):(St[t>>2]=16,0|St[t>>2]),a),0|o}function me(e){e|=0;var r,t,n,i=0,o=0,a=pt;return(0|bt)<=(0|(pt=pt+32|0))&&yt(32),r=a+16|0,i=(n=a)+8|0,St[(t=a+12|0)>>2]=e,e=0|le(0|St[t>>2],n),St[i>>2]=e,pt=(o=(0|St[i>>2]?St[r>>2]=St[i>>2]:(i=n,n=0|ce(0|St[t>>2],0|St[i>>2],0|St[i+4>>2]),St[r>>2]=n),0|St[r>>2]),a),0|o}function ne(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0,i|=0;var o,a,u,s,f,l,c,d,E=0,_=0,S=0,m=pt;if((0|bt)<=(0|(pt=pt+48|0))&&yt(48),o=m+32|0,u=m+24|0,s=m+20|0,f=m+16|0,l=m+12|0,c=m+8|0,E=m+4|0,St[(a=(d=m)+28|0)>>2]=e,St[u>>2]=r,St[s>>2]=t,St[f>>2]=n,St[l>>2]=i,i=0|_e(0|St[a>>2],0|St[u>>2],0|St[s>>2],0|St[l>>2]),St[E>>2]=i,0|St[E>>2])return St[o>>2]=St[E>>2],_=0|St[o>>2],pt=m,0|_;if(0|St[u>>2]){if(E=0|sr[3&St[St[l>>2]>>2]](0|St[l>>2],St[u>>2]<<2),!(St[St[f>>2]>>2]=E))return St[o>>2]=2,_=0|St[o>>2],pt=m,0|_}else St[St[f>>2]>>2]=0;for(St[c>>2]=0;;){if((0|St[c>>2])>>>0>=(0|St[u>>2])>>>0){S=13;break}if(0|Et[(0|St[St[s>>2]>>2])+(0|St[c>>2])>>0]&&(E=0|Se(0|St[a>>2],(0|St[St[f>>2]>>2])+(St[c>>2]<<2)|0),St[d>>2]=E,0|St[d>>2])){S=11;break}St[c>>2]=1+(0|St[c>>2])}return 11==(0|S)?(St[o>>2]=St[d>>2],_=0|St[o>>2],pt=m,0|_):13==(0|S)?(_=(St[o>>2]=0)|St[o>>2],pt=m,0|_):0}function I(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s,f=0,l=0,c=pt;for((0|bt)<=(0|(pt=pt+32|0))&&yt(32),n=c+28|0,o=c+8|0,u=(a=c)+20|0,s=c+16|0,St[(i=c+24|0)>>2]=e,St[(e=o)>>2]=r,St[e+4>>2]=t;;){if(t=0|ue(0|St[i>>2],a),St[u>>2]=t,0|St[u>>2]){f=3;break}if(e=o,(0|St[(t=a)>>2])==(0|St[e>>2])&&(0|St[t+4>>2])==(0|St[e+4>>2])){f=5;break}if(0==(0|St[(e=a)>>2])&0==(0|St[e+4>>2])){f=7;break}if(e=0|me(0|St[i>>2]),St[s>>2]=e,0|St[s>>2]){f=9;break}}return 3==(0|f)?(St[n>>2]=St[u>>2],l=0|St[n>>2],pt=c,0|l):5==(0|f)?(l=(St[n>>2]=0)|St[n>>2],pt=c,0|l):7==(0|f)?(St[n>>2]=16,l=0|St[n>>2],pt=c,0|l):9==(0|f)?(St[n>>2]=St[s>>2],l=0|St[n>>2],pt=c,0|l):0}function ie(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s,f=0,l=0,c=pt;for((0|bt)<=(0|(pt=pt+32|0))&&yt(32),n=c+20|0,o=c+12|0,a=c+8|0,u=c+4|0,St[(i=(s=c)+16|0)>>2]=e,St[o>>2]=r,St[a>>2]=t,St[u>>2]=0;;){if((0|St[u>>2])>>>0>=(0|St[a>>2])>>>0){f=6;break}if(t=0|te(0|St[i>>2],(0|St[o>>2])+(0|St[u>>2])|0),St[s>>2]=t,0|St[s>>2]){f=4;break}St[u>>2]=1+(0|St[u>>2])}return 4==(0|f)?(St[n>>2]=St[s>>2],l=0|St[n>>2],pt=c,0|l):6==(0|f)?(l=(St[n>>2]=0)|St[n>>2],pt=c,0|l):0}function oe(e){e|=0;var r,t,n,i=0,o=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),r=o+8|0,St[(t=(n=o)+4|0)>>2]=e;do{if(0|St[St[t>>2]>>2]){if(e=0|function(e){var r=0,t=0,n=0,i=0;-1<(0|St[76+(e|=0)>>2])&&ze();(r=0!=(1&St[e>>2]|0))||(H(11076),t=0|St[e+52>>2],n=e+56|0,0|t&&(St[t+56>>2]=St[n>>2]),0|(i=0|St[n>>2])&&(St[i+52>>2]=t),(0|St[2768])==(0|e)&&(St[2768]=i),V(11076));i=0|Ve(e),t=0|ar[1&St[e+12>>2]](e)|i,0|(i=0|St[e+92>>2])&&Ge(i);r||Ge(e);return 0|t}(0|St[St[t>>2]>>2]),St[n>>2]=e,0|St[n>>2])return St[r>>2]=St[n>>2],i=0|St[r>>2],pt=o,0|i;St[St[t>>2]>>2]=0;break}}while(0);return i=(St[r>>2]=0)|St[r>>2],pt=o,0|i}function L(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s=0,f=pt;return(0|bt)<=(0|(pt=pt+32|0))&&yt(32),n=f+16|0,o=f+8|0,a=f+4|0,St[(i=(u=f)+12|0)>>2]=e,St[o>>2]=r,St[a>>2]=t,St[u>>2]=St[St[a>>2]>>2],pt=(s=0|St[u>>2]?(t=0|function(e,r,t,n){e|=0,n|=0;var i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0;i=0|wt(t|=0,r|=0),o=-1<(0|St[n+76>>2])?0|ze():0;u=0|Et[(a=n+74|0)>>0],Et[a>>0]=u+255|u,a=0|St[(u=n+4|0)>>2],s=(0|St[n+8>>2])-a|0,f=a,c=0<(0|s)?(Je(0|e,0|f,0|(a=s>>>0>>0?s:i)),St[u>>2]=f+a,l=i-a|0,e+a|0):(l=i,e);e:do{if(l){for(e=n+32|0,a=l,f=c;!(0|function(e){var r=0,t=0,n=0;t=0|Et[(r=74+(e|=0)|0)>>0],Et[r>>0]=t+255|t,r=e+44|0,(0|St[(t=e+20|0)>>2])>>>0>(0|St[r>>2])>>>0&&nr[15&St[e+36>>2]](e,0,0);St[e+16>>2]=0,St[e+28>>2]=0,St[t>>2]=0,n=20&(t=0|St[e>>2])?(4&t&&(St[e>>2]=32|t),-1):(t=0|St[r>>2],St[e+8>>2]=t,St[e+4>>2]=t,0);return 0|n}(n)||((u=0|nr[15&St[e>>2]](n,f,a))+1|0)>>>0<2);){if(!(s=a-u|0)){d=13;break e}a=s,f=f+u|0}0|o&&He(),E=((i-a|0)>>>0)/(r>>>0)|0}else d=13}while(0);13==(0|d)&&(E=(o&&He(),t));return 0|E}(0|St[o>>2],1,0|St[u>>2],0|St[St[i>>2]>>2]),St[St[a>>2]>>2]=t,(0|St[St[a>>2]>>2])==(0|St[u>>2])?(St[n>>2]=0)|St[n>>2]:(u=0|function(e){var r=0,t=0,n=0;n=-1<(0|St[76+(e|=0)>>2])?(r=0==(0|ze()),t=(0|St[e>>2])>>>5&1,r||He(),t):(0|St[e>>2])>>>5&1;return 0|n}(0|St[St[i>>2]>>2]),St[n>>2]=u,0|St[n>>2])):(St[n>>2]=0)|St[n>>2],f),0|s}function ae(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s,f=0,l=pt;switch((0|bt)<=(0|(pt=pt+32|0))&&yt(32),n=l+20|0,o=l+12|0,a=l+8|0,u=l+4|0,St[(i=(s=l)+16|0)>>2]=e,St[o>>2]=r,St[a>>2]=t,0|St[a>>2]){case 0:St[u>>2]=0;break;case 1:St[u>>2]=1;break;case 2:St[u>>2]=2;break;default:return St[n>>2]=1,f=0|St[n>>2],pt=l,0|f}return a=0|(e=0|St[St[i>>2]>>2],r=0|St[St[o>>2]>>2],t=0|St[u>>2],0|function(e,r,t){r|=0,t|=0;var n=0,i=0,o=0;o=-1<(0|St[76+(e|=0)>>2])?(n=0==(0|ze()),i=0|We(e,r,t),n||He(),i):0|We(e,r,t);return 0|o}(e|=0,r|=0,t|=0)),St[s>>2]=a,a=0|(t=0|St[St[i>>2]>>2],0|function(e){var r=0,t=0,n=0;n=-1<(0|St[76+(e|=0)>>2])?(r=0==(0|ze()),t=0|je(e),r||He(),t):0|je(e);return 0|n}(t|=0)),i=0|St[o>>2],St[i>>2]=a,St[4+i>>2]=((0|a)<0)<<31>>31,St[n>>2]=St[s>>2],f=0|St[n>>2],pt=l,0|f}function he(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a=pt;return(0|bt)<=(0|(pt=pt+32|0))&&yt(32),i=a+8|0,St[(n=(o=a)+16|0)>>2]=e,St[(e=i)>>2]=r,St[e+4>>2]=t,i=0|St[(t=i)+4>>2],St[(e=o)>>2]=St[t>>2],St[e+4>>2]=i,i=0|nr[15&St[12+(0|St[n>>2])>>2]](0|St[n>>2],o,0),pt=a,0|i}function pe(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,o,a,u,s,f,l,c=0,d=0,E=pt;for((0|bt)<=(0|(pt=pt+32|0))&&yt(32),i=E+24|0,a=E+16|0,u=E+12|0,s=E+8|0,f=E+4|0,St[(o=(l=E)+20|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[s>>2]=n;;){if(!(0|St[u>>2])){c=8;break}if(St[f>>2]=St[u>>2],n=0|nr[15&St[8+(0|St[o>>2])>>2]](0|St[o>>2],0|St[a>>2],f),St[l>>2]=n,0|St[l>>2]){c=4;break}if(!(0|St[f>>2])){c=6;break}St[a>>2]=(0|St[a>>2])+(0|St[f>>2]),St[u>>2]=(0|St[u>>2])-(0|St[f>>2])}return 4==(0|c)?(St[i>>2]=St[l>>2],d=0|St[i>>2],pt=E,0|d):6==(0|c)?(St[i>>2]=St[s>>2],d=0|St[i>>2],pt=E,0|d):8==(0|c)?(d=(St[i>>2]=0)|St[i>>2],pt=E,0|d):0}function be(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),i=a+4|0,St[(n=(o=a)+8|0)>>2]=e,St[i>>2]=r,St[o>>2]=t,St[76+(0|St[n>>2])>>2]=1,St[72+(0|St[n>>2])>>2]=0,(St[88+(0|St[n>>2])>>2]=0)|St[i>>2]&&(St[44+(0|St[n>>2])>>2]=0,St[48+(0|St[n>>2])>>2]=0,St[80+(0|St[n>>2])>>2]=1),pt=(0|St[o>>2]&&(St[80+(0|St[n>>2])>>2]=1),a)}function ke(e){e|=0;var r,t=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(r=t)>>2]=e,be((St[36+(0|St[r>>2])>>2]=0)|St[r>>2],1,1),pt=t}function Fe(e,r,t,n,i,o){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0;var a,u,s,f,l,c,d,E,_,S,m,h,p,b=0,k=0,F=0,w=0,y=0,v=pt;for((0|bt)<=(0|(pt=pt+64|0))&&yt(64),a=v+56|0,s=v+48|0,b=v+44|0,f=v+40|0,l=v+36|0,c=v+32|0,k=v+28|0,d=v+24|0,E=v+20|0,_=v+16|0,S=v+12|0,m=v+8|0,h=v+4|0,St[(u=(p=v)+52|0)>>2]=e,St[s>>2]=r,St[b>>2]=t,St[f>>2]=n,St[l>>2]=i,St[c>>2]=o,St[k>>2]=St[St[f>>2]>>2],we((St[St[f>>2]>>2]=0)|St[u>>2],0|St[s>>2]),St[St[c>>2]>>2]=0;;){if(F=0|St[u>>2],274==(0|St[72+(0|St[u>>2])>>2])){w=46;break}if(0|St[F+76>>2]){for(;!((0|St[k>>2])>>>0<=0||5<=(0|St[88+(0|St[u>>2])>>2])>>>0);)o=0|St[b>>2],St[b>>2]=o+1,i=0|Et[o>>0],o=88+(0|St[u>>2])|0,n=0|St[o>>2],St[o>>2]=n+1,Et[92+(0|St[u>>2])+n>>0]=i,i=0|St[f>>2],St[i>>2]=1+(0|St[i>>2]),St[k>>2]=(0|St[k>>2])-1;if((0|St[88+(0|St[u>>2])>>2])>>>0<5){w=8;break}if(0|mt[92+(0|St[u>>2])>>0]){w=10;break}!function(e,r){e|=0,r|=0;var t=0,n=0,i=0;(0|(pt=(t=pt)+16|0))>=(0|bt)&&yt(16),St[(n=(i=t)+4|0)>>2]=e,St[i>>2]=r,St[32+(0|St[n>>2])>>2]=(0|mt[1+(0|St[i>>2])>>0])<<24|(0|mt[2+(0|St[i>>2])>>0])<<16|(0|mt[3+(0|St[i>>2])>>0])<<8|0|mt[4+(0|St[i>>2])>>0],St[28+(0|St[n>>2])>>2]=-1,St[76+(0|St[n>>2])>>2]=0,pt=t}(0|St[u>>2],92+(0|St[u>>2])|0),St[88+(0|St[u>>2])>>2]=0}if(((St[d>>2]=0)|St[36+(0|St[u>>2])>>2])>>>0>=(0|St[s>>2])>>>0){if(0==(0|St[72+(0|St[u>>2])>>2])&&0==(0|St[32+(0|St[u>>2])>>2])){w=15;break}if(!(0|St[l>>2])){w=17;break}if(0|St[72+(0|St[u>>2])>>2]){w=19;break}St[d>>2]=1}if(0|St[80+(0|St[u>>2])>>2]&&function(e){e|=0;var r=0,t=0,n=0,i=0,o=0;for((0|(pt=(r=pt)+16|0))>=(0|bt)&&yt(16),n=r+8|0,i=r+4|0,St[(t=(o=r)+12|0)>>2]=e,St[n>>2]=1846+(768<<(0|St[St[t>>2]>>2])+(0|St[4+(0|St[t>>2])>>2])),St[o>>2]=St[16+(0|St[t>>2])>>2],St[i>>2]=0;!((0|St[i>>2])>>>0>=(0|St[n>>2])>>>0);)_t[(0|St[o>>2])+(St[i>>2]<<1)>>1]=1024,St[i>>2]=1+(0|St[i>>2]);St[56+(0|St[t>>2])+12>>2]=1,St[56+(0|St[t>>2])+8>>2]=1,St[56+(0|St[t>>2])+4>>2]=1,St[56+(0|St[t>>2])>>2]=1,St[52+(0|St[t>>2])>>2]=0,St[80+(0|St[t>>2])>>2]=0,pt=r}(0|St[u>>2]),0|St[88+(0|St[u>>2])>>2]){for(St[m>>2]=St[88+(0|St[u>>2])>>2],St[h>>2]=0;!(20<=(0|St[m>>2])>>>0||(0|St[h>>2])>>>0>=(0|St[k>>2])>>>0);)i=0|St[h>>2],St[h>>2]=i+1,n=0|Et[(0|St[b>>2])+i>>0],i=0|St[m>>2],St[m>>2]=i+1,Et[92+(0|St[u>>2])+i>>0]=n;if(St[88+(0|St[u>>2])>>2]=St[m>>2],(0|St[m>>2])>>>0<20|0!=(0|St[d>>2])){if(n=0|ye(0|St[u>>2],92+(0|St[u>>2])|0,0|St[m>>2]),St[p>>2]=n,!(0|St[p>>2])){w=40;break}if(0!=(0|St[d>>2])&2!=(0|St[p>>2])){w=42;break}}if(St[24+(0|St[u>>2])>>2]=92+(0|St[u>>2]),0|ve(0|St[u>>2],0|St[s>>2],0|St[24+(0|St[u>>2])>>2])){w=44;break}St[h>>2]=(0|St[h>>2])-((0|St[m>>2])-((0|St[24+(0|St[u>>2])>>2])-(92+(0|St[u>>2])))),n=0|St[f>>2],St[n>>2]=(0|St[n>>2])+(0|St[h>>2]),St[b>>2]=(0|St[b>>2])+(0|St[h>>2]),St[k>>2]=(0|St[k>>2])-(0|St[h>>2]),St[88+(0|St[u>>2])>>2]=0}else{if((0|St[k>>2])>>>0<20|0!=(0|St[d>>2])){if(i=0|ye(0|St[u>>2],0|St[b>>2],0|St[k>>2]),St[S>>2]=i,!(0|St[S>>2])){w=26;break}if(0!=(0|St[d>>2])&2!=(0|St[S>>2])){w=28;break}St[_>>2]=St[b>>2]}else St[_>>2]=(0|St[b>>2])+(0|St[k>>2])-20;if(St[24+(0|St[u>>2])>>2]=St[b>>2],0|ve(0|St[u>>2],0|St[s>>2],0|St[_>>2])){w=32;break}St[E>>2]=(0|St[24+(0|St[u>>2])>>2])-(0|St[b>>2]),i=0|St[f>>2],St[i>>2]=(0|St[i>>2])+(0|St[E>>2]),St[b>>2]=(0|St[b>>2])+(0|St[E>>2]),St[k>>2]=(0|St[k>>2])-(0|St[E>>2])}}switch(0|w){case 8:return St[St[c>>2]>>2]=3,y=(St[a>>2]=0)|St[a>>2],pt=v,0|y;case 10:return St[a>>2]=1,y=0|St[a>>2],pt=v,0|y;case 15:return St[St[c>>2]>>2]=4,y=(St[a>>2]=0)|St[a>>2],pt=v,0|y;case 17:return St[St[c>>2]>>2]=2,y=(St[a>>2]=0)|St[a>>2],pt=v,0|y;case 19:return St[St[c>>2]>>2]=2,St[a>>2]=1,y=0|St[a>>2],pt=v,0|y;case 26:return Je(92+(0|St[u>>2])|0,0|St[b>>2],0|St[k>>2]),St[88+(0|St[u>>2])>>2]=St[k>>2],b=0|St[f>>2],St[b>>2]=(0|St[b>>2])+(0|St[k>>2]),St[St[c>>2]>>2]=3,y=(St[a>>2]=0)|St[a>>2],pt=v,0|y;case 28:return St[St[c>>2]>>2]=2,St[a>>2]=1,y=0|St[a>>2],pt=v,0|y;case 32:return St[a>>2]=1,y=0|St[a>>2],pt=v,0|y;case 40:return k=0|St[f>>2],St[k>>2]=(0|St[k>>2])+(0|St[h>>2]),St[St[c>>2]>>2]=3,y=(St[a>>2]=0)|St[a>>2],pt=v,0|y;case 42:return St[St[c>>2]>>2]=2,St[a>>2]=1,y=0|St[a>>2],pt=v,0|y;case 44:return St[a>>2]=1,y=0|St[a>>2],pt=v,0|y;case 46:return 0|St[F+32>>2]||(St[St[c>>2]>>2]=1),St[a>>2]=0==(0|St[32+(0|St[u>>2])>>2])?0:1,y=0|St[a>>2],pt=v,0|y}return 0}function we(e,r){e|=0,r|=0;var t,n,i,o,a,u,s=0,f=0,l=pt;if((0|bt)<=(0|(pt=pt+32|0))&&yt(32),s=l+20|0,n=l+16|0,i=l+12|0,o=l+8|0,a=l+4|0,St[(t=(u=l)+24|0)>>2]=e,St[s>>2]=r,0|St[72+(0|St[t>>2])>>2])if(274<=(0|St[72+(0|St[t>>2])>>2])>>>0)pt=l;else{for(St[n>>2]=St[20+(0|St[t>>2])>>2],St[i>>2]=St[36+(0|St[t>>2])>>2],St[o>>2]=St[40+(0|St[t>>2])>>2],St[a>>2]=St[72+(0|St[t>>2])>>2],St[u>>2]=St[56+(0|St[t>>2])>>2],((0|St[s>>2])-(0|St[i>>2])|0)>>>0<(0|St[a>>2])>>>0&&(St[a>>2]=(0|St[s>>2])-(0|St[i>>2])),0==(0|St[48+(0|St[t>>2])>>2])&&((0|St[12+(0|St[t>>2])>>2])-(0|St[44+(0|St[t>>2])>>2])|0)>>>0<=(0|St[a>>2])>>>0&&(St[48+(0|St[t>>2])>>2]=St[12+(0|St[t>>2])>>2]),s=44+(0|St[t>>2])|0,St[s>>2]=(0|St[s>>2])+(0|St[a>>2]),s=72+(0|St[t>>2])|0,St[s>>2]=(0|St[s>>2])-(0|St[a>>2]);s=0|St[a>>2],St[a>>2]=s+-1,f=0|St[i>>2],s;)Et[(0|St[n>>2])+(0|St[i>>2])>>0]=0|Et[(0|St[n>>2])+(f-(0|St[u>>2])+((0|St[i>>2])>>>0<(0|St[u>>2])>>>0?0|St[o>>2]:0))>>0],St[i>>2]=1+(0|St[i>>2]);St[36+(0|St[t>>2])>>2]=f,pt=l}else pt=l}function ye(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s,f,l,c,d,E,_,S,m,h,p,b,k,F,w,y,v,M,O,A=0,R=0,g=0,T=0,N=0,D=0,P=0,C=pt;(0|bt)<=(0|(pt=pt+112|0))&&yt(112),n=C+104|0,o=C+96|0,A=C+92|0,a=C+88|0,u=C+84|0,s=C+80|0,f=C+76|0,l=C+72|0,c=C+68|0,d=C+64|0,E=C+60|0,_=C+56|0,S=C+52|0,m=C+48|0,h=C+44|0,p=C+40|0,R=C+36|0,g=C+32|0,b=C+28|0,k=C+24|0,F=C+20|0,w=C+16|0,y=C+12|0,v=C+8|0,M=C+4|0,St[(i=(O=C)+100|0)>>2]=e,St[o>>2]=r,St[A>>2]=t,St[a>>2]=St[28+(0|St[i>>2])>>2],St[u>>2]=St[32+(0|St[i>>2])>>2],St[s>>2]=(0|St[o>>2])+(0|St[A>>2]),St[f>>2]=St[16+(0|St[i>>2])>>2],St[l>>2]=St[52+(0|St[i>>2])>>2],St[S>>2]=St[44+(0|St[i>>2])>>2]&(1<>2])>>2])-1,St[d>>2]=(0|St[f>>2])+(St[l>>2]<<4<<1)+(St[S>>2]<<1),St[_>>2]=re[St[d>>2]>>1];do{if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0<(0|St[s>>2])>>>0){St[a>>2]=St[a>>2]<<8,A=St[u>>2]<<8,t=0|St[o>>2],St[o>>2]=t+1,St[u>>2]=0|A|mt[t>>0];break}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}while(0);t=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=t,t=0|St[E>>2];e:do{if((0|St[u>>2])>>>0>=(0|St[E>>2])>>>0){St[a>>2]=(0|St[a>>2])-t,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[d>>2]=384+(0|St[f>>2])+(St[l>>2]<<1),St[_>>2]=re[St[d>>2]>>1];do{if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0<(0|St[s>>2])>>>0){St[a>>2]=St[a>>2]<<8,A=St[u>>2]<<8,r=0|St[o>>2],St[o>>2]=r+1,St[u>>2]=0|A|mt[r>>0];break}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}while(0);if(r=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=r,r=0|St[E>>2],(0|St[u>>2])>>>0<(0|St[E>>2])>>>0)St[a>>2]=r,St[l>>2]=0,St[d>>2]=1636+(0|St[f>>2]),St[c>>2]=2;else{St[a>>2]=(0|St[a>>2])-r,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[c>>2]=3,St[d>>2]=408+(0|St[f>>2])+(St[l>>2]<<1),St[_>>2]=re[St[d>>2]>>1];do{if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0<(0|St[s>>2])>>>0){St[a>>2]=St[a>>2]<<8,r=St[u>>2]<<8,A=0|St[o>>2],St[o>>2]=A+1,St[u>>2]=0|r|mt[A>>0];break}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}while(0);A=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=A,A=0|St[E>>2];do{if((0|St[u>>2])>>>0>=(0|St[E>>2])>>>0){St[a>>2]=(0|St[a>>2])-A,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[d>>2]=432+(0|St[f>>2])+(St[l>>2]<<1),St[_>>2]=re[St[d>>2]>>1];do{if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0<(0|St[s>>2])>>>0){St[a>>2]=St[a>>2]<<8,r=St[u>>2]<<8,e=0|St[o>>2],St[o>>2]=e+1,St[u>>2]=0|r|mt[e>>0];break}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}while(0);if(e=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=e,e=0|St[E>>2],(0|St[u>>2])>>>0<(0|St[E>>2])>>>0){St[a>>2]=e;break}St[a>>2]=(0|St[a>>2])-e,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[d>>2]=456+(0|St[f>>2])+(St[l>>2]<<1),St[_>>2]=re[St[d>>2]>>1];do{if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0<(0|St[s>>2])>>>0){St[a>>2]=St[a>>2]<<8,e=St[u>>2]<<8,r=0|St[o>>2],St[o>>2]=r+1,St[u>>2]=0|e|mt[r>>0];break}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}while(0);if(r=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=r,r=0|St[E>>2],(0|St[u>>2])>>>0<(0|St[E>>2])>>>0){St[a>>2]=r;break}St[a>>2]=(0|St[a>>2])-r,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]);break}St[a>>2]=A,St[d>>2]=480+(0|St[f>>2])+(St[l>>2]<<4<<1)+(St[S>>2]<<1),St[_>>2]=re[St[d>>2]>>1];do{if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0<(0|St[s>>2])>>>0){St[a>>2]=St[a>>2]<<8,r=St[u>>2]<<8,e=0|St[o>>2],St[o>>2]=e+1,St[u>>2]=0|r|mt[e>>0];break}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}while(0);if(e=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=e,e=0|St[E>>2],(0|St[u>>2])>>>0>=(0|St[E>>2])>>>0){St[a>>2]=(0|St[a>>2])-e,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]);break}St[a>>2]=e;do{if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0<(0|St[s>>2])>>>0){St[a>>2]=St[a>>2]<<8,e=St[u>>2]<<8,r=0|St[o>>2],St[o>>2]=r+1,St[u>>2]=0|e|mt[r>>0];break}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}while(0);return St[n>>2]=3,T=0|St[n>>2],pt=C,0|T}while(0);St[l>>2]=12,St[d>>2]=2664+(0|St[f>>2])}St[y>>2]=St[d>>2],St[_>>2]=re[St[y>>2]>>1];do{if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0<(0|St[s>>2])>>>0){St[a>>2]=St[a>>2]<<8,A=St[u>>2]<<8,r=0|St[o>>2],St[o>>2]=r+1,St[u>>2]=0|A|mt[r>>0];break}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}while(0);r=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=r,r=0|St[E>>2];do{if((0|St[u>>2])>>>0>=(0|St[E>>2])>>>0){St[a>>2]=(0|St[a>>2])-r,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[y>>2]=2+(0|St[d>>2]),St[_>>2]=re[St[y>>2]>>1];do{if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0<(0|St[s>>2])>>>0){St[a>>2]=St[a>>2]<<8,A=St[u>>2]<<8,e=0|St[o>>2],St[o>>2]=e+1,St[u>>2]=0|A|mt[e>>0];break}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}while(0);if(e=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=e,e=0|St[E>>2],(0|St[u>>2])>>>0<(0|St[E>>2])>>>0){St[a>>2]=e,St[y>>2]=260+(0|St[d>>2])+(St[S>>2]<<3<<1),St[w>>2]=8,St[F>>2]=8;break}St[a>>2]=(0|St[a>>2])-e,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[y>>2]=516+(0|St[d>>2]),St[w>>2]=16,St[F>>2]=256;break}}while(St[a>>2]=r,St[y>>2]=4+(0|St[d>>2])+(St[S>>2]<<3<<1),St[w>>2]=0,St[F>>2]=8,0);St[k>>2]=1;do{if(St[_>>2]=re[(0|St[y>>2])+(St[k>>2]<<1)>>1],(0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0>=(0|St[s>>2])>>>0){N=86;break}St[a>>2]=St[a>>2]<<8,r=St[u>>2]<<8,e=0|St[o>>2],St[o>>2]=e+1,St[u>>2]=0|r|mt[e>>0]}}while(e=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=e,e=0|St[E>>2],(0|St[u>>2])>>>0<(0|St[E>>2])>>>0?(St[a>>2]=e,St[k>>2]=(0|St[k>>2])+(0|St[k>>2])):(St[a>>2]=(0|St[a>>2])-e,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[k>>2]=(0|St[k>>2])+(0|St[k>>2])+1),(0|St[k>>2])>>>0<(0|St[F>>2])>>>0);if(86==(0|N))return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T;if(St[k>>2]=(0|St[k>>2])-(0|St[F>>2]),St[k>>2]=(0|St[k>>2])+(0|St[w>>2]),(0|St[l>>2])>>>0<4){St[d>>2]=864+(0|St[f>>2])+(((0|St[k>>2])>>>0<4?0|St[k>>2]:3)<<6<<1),St[v>>2]=1;do{if(St[_>>2]=re[(0|St[d>>2])+(St[v>>2]<<1)>>1],(0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0>=(0|St[s>>2])>>>0){N=96;break}St[a>>2]=St[a>>2]<<8,e=St[u>>2]<<8,r=0|St[o>>2],St[o>>2]=r+1,St[u>>2]=0|e|mt[r>>0]}}while(r=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=r,r=0|St[E>>2],(0|St[u>>2])>>>0<(0|St[E>>2])>>>0?(St[a>>2]=r,St[v>>2]=(0|St[v>>2])+(0|St[v>>2])):(St[a>>2]=(0|St[a>>2])-r,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[v>>2]=(0|St[v>>2])+(0|St[v>>2])+1),(0|St[v>>2])>>>0<64);if(96==(0|N))return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T;if(St[v>>2]=(0|St[v>>2])-64,4<=(0|St[v>>2])>>>0){St[M>>2]=((0|St[v>>2])>>>1)-1;do{if(!((0|St[v>>2])>>>0<14)){for(St[M>>2]=(0|St[M>>2])-4;;){if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0>=(0|St[s>>2])>>>0)break;St[a>>2]=St[a>>2]<<8,r=St[u>>2]<<8,e=0|St[o>>2],St[o>>2]=e+1,St[u>>2]=0|r|mt[e>>0]}if(St[a>>2]=(0|St[a>>2])>>>1,St[u>>2]=(0|St[u>>2])-(St[a>>2]&(((0|St[u>>2])-(0|St[a>>2])|0)>>>31)-1),e=(0|St[M>>2])-1|0,!(St[M>>2]=e)){N=111;break}}if(111!=(0|N))return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T;St[d>>2]=1604+(0|St[f>>2]),St[M>>2]=4;break}}while(St[d>>2]=1376+(0|St[f>>2])+((2|1&St[v>>2])<>2]<<1)+(0-(0|St[v>>2])<<1)-2,0);for(St[O>>2]=1;;){if(St[_>>2]=re[(0|St[d>>2])+(St[O>>2]<<1)>>1],(0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0>=(0|St[s>>2])>>>0)break;St[a>>2]=St[a>>2]<<8,e=St[u>>2]<<8,r=0|St[o>>2],St[o>>2]=r+1,St[u>>2]=0|e|mt[r>>0]}if(r=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=r,r=0|St[E>>2],(0|St[u>>2])>>>0<(0|St[E>>2])>>>0?(St[a>>2]=r,St[O>>2]=(0|St[O>>2])+(0|St[O>>2])):(St[a>>2]=(0|St[a>>2])-r,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[O>>2]=(0|St[O>>2])+(0|St[O>>2])+1),r=(0|St[M>>2])-1|0,!(St[M>>2]=r))break e}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}}else{St[a>>2]=t,St[d>>2]=3692+(0|St[f>>2]),(0|St[48+(0|St[i>>2])>>2]||0|St[44+(0|St[i>>2])>>2])&&(r=0|St[i>>2],D=0|St[36+(0|St[i>>2])>>2]?0|St[r+36>>2]:0|St[r+40>>2],St[d>>2]=(0|St[d>>2])+(768*(((St[44+(0|St[i>>2])>>2]&(1<>2])>>2])-1)<>2]>>2])+((0|mt[(0|St[20+(0|St[i>>2])>>2])+(D-1)>>0])>>8-(0|St[St[i>>2]>>2]))|0)<<1));r:do{if((0|St[l>>2])>>>0<7){for(St[m>>2]=1;;){if(St[_>>2]=re[(0|St[d>>2])+(St[m>>2]<<1)>>1],(0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0>=(0|St[s>>2])>>>0)break;St[a>>2]=St[a>>2]<<8,r=St[u>>2]<<8,e=0|St[o>>2],St[o>>2]=e+1,St[u>>2]=0|r|mt[e>>0]}if(e=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=e,e=0|St[E>>2],(0|St[u>>2])>>>0<(0|St[E>>2])>>>0?(St[a>>2]=e,St[m>>2]=(0|St[m>>2])+(0|St[m>>2])):(St[a>>2]=(0|St[a>>2])-e,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[m>>2]=(0|St[m>>2])+(0|St[m>>2])+1),256<=(0|St[m>>2])>>>0)break r}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}for(P=(0|St[36+(0|St[i>>2])>>2])>>>0<(0|St[56+(0|St[i>>2])>>2])>>>0?0|St[40+(0|St[i>>2])>>2]:0,St[h>>2]=mt[(0|St[20+(0|St[i>>2])>>2])+((0|St[36+(0|St[i>>2])>>2])-(0|St[56+(0|St[i>>2])>>2])+P)>>0],St[p>>2]=256,St[R>>2]=1;;){if(St[h>>2]=St[h>>2]<<1,St[g>>2]=St[h>>2]&St[p>>2],St[b>>2]=(0|St[d>>2])+(St[p>>2]<<1)+(St[g>>2]<<1)+(St[R>>2]<<1),St[_>>2]=re[St[b>>2]>>1],(0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0>=(0|St[s>>2])>>>0)break;St[a>>2]=St[a>>2]<<8,e=St[u>>2]<<8,r=0|St[o>>2],St[o>>2]=r+1,St[u>>2]=0|e|mt[r>>0]}if(r=0|wt((0|St[a>>2])>>>11,0|St[_>>2]),St[E>>2]=r,r=0|St[E>>2],(0|St[u>>2])>>>0<(0|St[E>>2])>>>0?(St[a>>2]=r,St[R>>2]=(0|St[R>>2])+(0|St[R>>2]),St[p>>2]=St[p>>2]&~St[g>>2]):(St[a>>2]=(0|St[a>>2])-r,St[u>>2]=(0|St[u>>2])-(0|St[E>>2]),St[R>>2]=(0|St[R>>2])+(0|St[R>>2])+1,St[p>>2]=St[p>>2]&St[g>>2]),256<=(0|St[R>>2])>>>0)break r}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}while(0);St[c>>2]=1}}while(0);do{if((0|St[a>>2])>>>0<16777216){if((0|St[o>>2])>>>0<(0|St[s>>2])>>>0){St[a>>2]=St[a>>2]<<8,R=St[u>>2]<<8,g=0|St[o>>2],St[o>>2]=g+1,St[u>>2]=0|R|mt[g>>0];break}return T=(St[n>>2]=0)|St[n>>2],pt=C,0|T}}while(0);return St[n>>2]=St[c>>2],T=0|St[n>>2],pt=C,0|T}function ve(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s,f,l=0,c=0,d=pt;(0|bt)<=(0|(pt=pt+32|0))&&yt(32),n=d+24|0,o=d+16|0,a=d+12|0,u=d+8|0,s=d+4|0,St[(i=(f=d)+20|0)>>2]=e,St[o>>2]=r,St[a>>2]=t;do{if(St[u>>2]=St[o>>2],0==(0|St[48+(0|St[i>>2])>>2])&&(St[s>>2]=(0|St[12+(0|St[i>>2])>>2])-(0|St[44+(0|St[i>>2])>>2]),((0|St[o>>2])-(0|St[36+(0|St[i>>2])>>2])|0)>>>0>(0|St[s>>2])>>>0)&&(St[u>>2]=(0|St[36+(0|St[i>>2])>>2])+(0|St[s>>2])),t=0|function(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0,U=0,z=0,Y=0,V=0,K=0,W=0,j=0,X=0,G=0,q=0,Q=0,Z=0,J=0,$=0,ee=0;(0|(pt=(n=pt)+192|0))>=(0|bt)&&yt(192);i=n+188|0,a=n+180|0,u=n+176|0,s=n+172|0,f=n+168|0,l=n+164|0,c=n+160|0,d=n+156|0,E=n+152|0,_=n+148|0,S=n+144|0,m=n+140|0,h=n+136|0,p=n+132|0,b=n+128|0,k=n+124|0,F=n+120|0,w=n+116|0,y=n+112|0,v=n+108|0,M=n+104|0,O=n+100|0,A=n+96|0,R=n+92|0,g=n+88|0,T=n+84|0,N=n+80|0,D=n+76|0,P=n+72|0,C=n+68|0,I=n+64|0,L=n+60|0,x=n+56|0,B=n+52|0,H=n+48|0,U=n+44|0,z=n+40|0,Y=n+36|0,V=n+32|0,K=n+28|0,W=n+24|0,j=n+20|0,X=n+16|0,G=n+12|0,q=n+8|0,Q=n+4|0,St[(o=(Z=n)+184|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[s>>2]=St[16+(0|St[o>>2])>>2],St[f>>2]=St[52+(0|St[o>>2])>>2],St[l>>2]=St[56+(0|St[o>>2])>>2],St[c>>2]=St[56+(0|St[o>>2])+4>>2],St[d>>2]=St[56+(0|St[o>>2])+8>>2],St[E>>2]=St[56+(0|St[o>>2])+12>>2],St[_>>2]=(1<>2])>>2])-1,St[S>>2]=(1<>2])>>2])-1,St[m>>2]=St[St[o>>2]>>2],St[h>>2]=St[20+(0|St[o>>2])>>2],St[p>>2]=St[40+(0|St[o>>2])>>2],St[b>>2]=St[36+(0|St[o>>2])>>2],St[k>>2]=St[44+(0|St[o>>2])>>2],St[F>>2]=St[48+(0|St[o>>2])>>2],St[w>>2]=0,St[y>>2]=St[24+(0|St[o>>2])>>2],St[v>>2]=St[28+(0|St[o>>2])>>2],St[M>>2]=St[32+(0|St[o>>2])>>2];e:do{St[g>>2]=St[k>>2]&St[_>>2],St[O>>2]=(0|St[s>>2])+(St[f>>2]<<4<<1)+(St[g>>2]<<1),St[R>>2]=re[St[O>>2]>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,t=St[M>>2]<<8,r=0|St[y>>2],St[y>>2]=r+1,St[M>>2]=0|t|mt[r>>0]),r=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=r,r=0|St[A>>2];r:do{if((0|St[M>>2])>>>0<(0|St[A>>2])>>>0){if(St[v>>2]=r,_t[St[O>>2]>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[O>>2]=3692+(0|St[s>>2]),0!=(0|St[F>>2])|0!=(0|St[k>>2])&&(St[O>>2]=(0|St[O>>2])+(768*(((St[k>>2]&St[S>>2])<>2])+((0|mt[(0|St[h>>2])+((0==(0|St[b>>2])?0|St[p>>2]:0|St[b>>2])-1)>>0])>>8-(0|St[m>>2]))|0)<<1)),(0|St[f>>2])>>>0<7)for(St[f>>2]=(0|St[f>>2])-((0|St[f>>2])>>>0<4?0|St[f>>2]:3),St[T>>2]=1;St[R>>2]=re[(0|St[O>>2])+(St[T>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,t=St[M>>2]<<8,e=0|St[y>>2],St[y>>2]=e+1,St[M>>2]=0|t|mt[e>>0]),e=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=e,e=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=e,_t[(0|St[O>>2])+(St[T>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[T>>2]=(0|St[T>>2])+(0|St[T>>2])):(St[v>>2]=(0|St[v>>2])-e,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[T>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[T>>2]=(0|St[T>>2])+(0|St[T>>2])+1),(0|St[T>>2])>>>0<256;);else for(St[N>>2]=mt[(0|St[20+(0|St[o>>2])>>2])+((0|St[b>>2])-(0|St[l>>2])+((0|St[b>>2])>>>0<(0|St[l>>2])>>>0?0|St[p>>2]:0))>>0],St[D>>2]=256,St[f>>2]=(0|St[f>>2])-((0|St[f>>2])>>>0<10?3:6),St[T>>2]=1;St[N>>2]=St[N>>2]<<1,St[P>>2]=St[N>>2]&St[D>>2],St[C>>2]=(0|St[O>>2])+(St[D>>2]<<1)+(St[P>>2]<<1)+(St[T>>2]<<1),St[R>>2]=re[St[C>>2]>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,e=St[M>>2]<<8,t=0|St[y>>2],St[y>>2]=t+1,St[M>>2]=0|e|mt[t>>0]),t=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=t,t=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=t,_t[St[C>>2]>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[T>>2]=(0|St[T>>2])+(0|St[T>>2]),St[D>>2]=St[D>>2]&~St[P>>2]):(St[v>>2]=(0|St[v>>2])-t,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[St[C>>2]>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[T>>2]=(0|St[T>>2])+(0|St[T>>2])+1,St[D>>2]=St[D>>2]&St[P>>2]),(0|St[T>>2])>>>0<256;);t=255&St[T>>2],e=0|St[b>>2],St[b>>2]=e+1,Et[(0|St[h>>2])+e>>0]=t,St[k>>2]=1+(0|St[k>>2])}else{if(St[v>>2]=(0|St[v>>2])-r,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[St[O>>2]>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[O>>2]=384+(0|St[s>>2])+(St[f>>2]<<1),St[R>>2]=re[St[O>>2]>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,t=St[M>>2]<<8,e=0|St[y>>2],St[y>>2]=e+1,St[M>>2]=0|t|mt[e>>0]),e=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=e,e=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0)St[v>>2]=e,_t[St[O>>2]>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[f>>2]=12+(0|St[f>>2]),St[O>>2]=1636+(0|St[s>>2]);else{if(St[v>>2]=(0|St[v>>2])-e,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[St[O>>2]>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),0==(0|St[F>>2])&0==(0|St[k>>2])){J=28;break e}St[O>>2]=408+(0|St[s>>2])+(St[f>>2]<<1),St[R>>2]=re[St[O>>2]>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,e=St[M>>2]<<8,t=0|St[y>>2],St[y>>2]=t+1,St[M>>2]=0|e|mt[t>>0]),t=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=t,t=0|St[A>>2];do{if((0|St[M>>2])>>>0<(0|St[A>>2])>>>0){if(St[v>>2]=t,_t[St[O>>2]>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[O>>2]=480+(0|St[s>>2])+(St[f>>2]<<4<<1)+(St[g>>2]<<1),St[R>>2]=re[St[O>>2]>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,e=St[M>>2]<<8,$=0|St[y>>2],St[y>>2]=$+1,St[M>>2]=0|e|mt[$>>0]),$=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=$,$=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0){St[v>>2]=$,_t[St[O>>2]>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),Et[(0|St[h>>2])+(0|St[b>>2])>>0]=0|Et[(0|St[h>>2])+((0|St[b>>2])-(0|St[l>>2])+((0|St[b>>2])>>>0<(0|St[l>>2])>>>0?0|St[p>>2]:0))>>0],St[b>>2]=1+(0|St[b>>2]),St[k>>2]=1+(0|St[k>>2]),St[f>>2]=(0|St[f>>2])>>>0<7?9:11;break r}St[v>>2]=(0|St[v>>2])-$,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[St[O>>2]>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5);break}}while(St[v>>2]=(0|St[v>>2])-t,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[St[O>>2]>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[O>>2]=432+(0|St[s>>2])+(St[f>>2]<<1),St[R>>2]=re[St[O>>2]>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,$=St[M>>2]<<8,e=0|St[y>>2],St[y>>2]=e+1,St[M>>2]=0|$|mt[e>>0]),e=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=e,e=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=e,_t[St[O>>2]>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[I>>2]=St[c>>2]):(St[v>>2]=(0|St[v>>2])-e,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[St[O>>2]>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[O>>2]=456+(0|St[s>>2])+(St[f>>2]<<1),St[R>>2]=re[St[O>>2]>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,e=St[M>>2]<<8,$=0|St[y>>2],St[y>>2]=$+1,St[M>>2]=0|e|mt[$>>0]),$=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=$,$=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=$,_t[St[O>>2]>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[I>>2]=St[d>>2]):(St[v>>2]=(0|St[v>>2])-$,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[St[O>>2]>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[I>>2]=St[E>>2],St[E>>2]=St[d>>2]),St[d>>2]=St[c>>2]),St[c>>2]=St[l>>2],St[l>>2]=St[I>>2],0);St[f>>2]=(0|St[f>>2])>>>0<7?8:11,St[O>>2]=2664+(0|St[s>>2])}St[B>>2]=St[O>>2],St[R>>2]=re[St[B>>2]>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,t=St[M>>2]<<8,$=0|St[y>>2],St[y>>2]=$+1,St[M>>2]=0|t|mt[$>>0]),$=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=$,$=0|St[A>>2];do{if((0|St[M>>2])>>>0>=(0|St[A>>2])>>>0){if(St[v>>2]=(0|St[v>>2])-$,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[St[B>>2]>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[B>>2]=2+(0|St[O>>2]),St[R>>2]=re[St[B>>2]>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,t=St[M>>2]<<8,e=0|St[y>>2],St[y>>2]=e+1,St[M>>2]=0|t|mt[e>>0]),e=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=e,e=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0){St[v>>2]=e,_t[St[B>>2]>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[B>>2]=260+(0|St[O>>2])+(St[g>>2]<<3<<1),St[x>>2]=8,St[L>>2]=8;break}St[v>>2]=(0|St[v>>2])-e,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[St[B>>2]>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[B>>2]=516+(0|St[O>>2]),St[x>>2]=16,St[L>>2]=256;break}}while(St[v>>2]=$,_t[St[B>>2]>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[B>>2]=4+(0|St[O>>2])+(St[g>>2]<<3<<1),St[x>>2]=0,St[L>>2]=8,0);for(St[w>>2]=1;St[R>>2]=re[(0|St[B>>2])+(St[w>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,$=St[M>>2]<<8,e=0|St[y>>2],St[y>>2]=e+1,St[M>>2]=0|$|mt[e>>0]),e=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=e,e=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=e,_t[(0|St[B>>2])+(St[w>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[w>>2]=(0|St[w>>2])+(0|St[w>>2])):(St[v>>2]=(0|St[v>>2])-e,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[B>>2])+(St[w>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[w>>2]=(0|St[w>>2])+(0|St[w>>2])+1),(0|St[w>>2])>>>0<(0|St[L>>2])>>>0;);if(St[w>>2]=(0|St[w>>2])-(0|St[L>>2]),St[w>>2]=(0|St[w>>2])+(0|St[x>>2]),12<=(0|St[f>>2])>>>0){St[O>>2]=864+(0|St[s>>2])+(((0|St[w>>2])>>>0<4?0|St[w>>2]:3)<<6<<1),St[H>>2]=1,St[R>>2]=re[(0|St[O>>2])+(St[H>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,e=St[M>>2]<<8,$=0|St[y>>2],St[y>>2]=$+1,St[M>>2]=0|e|mt[$>>0]),$=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=$,$=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=$,_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])):(St[v>>2]=(0|St[v>>2])-$,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])+1),St[R>>2]=re[(0|St[O>>2])+(St[H>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,$=St[M>>2]<<8,e=0|St[y>>2],St[y>>2]=e+1,St[M>>2]=0|$|mt[e>>0]),e=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=e,e=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=e,_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])):(St[v>>2]=(0|St[v>>2])-e,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])+1),St[R>>2]=re[(0|St[O>>2])+(St[H>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,e=St[M>>2]<<8,$=0|St[y>>2],St[y>>2]=$+1,St[M>>2]=0|e|mt[$>>0]),$=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=$,$=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=$,_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])):(St[v>>2]=(0|St[v>>2])-$,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])+1),St[R>>2]=re[(0|St[O>>2])+(St[H>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,$=St[M>>2]<<8,e=0|St[y>>2],St[y>>2]=e+1,St[M>>2]=0|$|mt[e>>0]),e=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=e,e=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=e,_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])):(St[v>>2]=(0|St[v>>2])-e,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])+1),St[R>>2]=re[(0|St[O>>2])+(St[H>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,e=St[M>>2]<<8,$=0|St[y>>2],St[y>>2]=$+1,St[M>>2]=0|e|mt[$>>0]),$=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=$,$=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=$,_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])):(St[v>>2]=(0|St[v>>2])-$,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])+1),St[R>>2]=re[(0|St[O>>2])+(St[H>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,$=St[M>>2]<<8,e=0|St[y>>2],St[y>>2]=e+1,St[M>>2]=0|$|mt[e>>0]),e=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=e,e=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=e,_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])):(St[v>>2]=(0|St[v>>2])-e,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[H>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[H>>2]=(0|St[H>>2])+(0|St[H>>2])+1),St[H>>2]=(0|St[H>>2])-64;t:do{if(4<=(0|St[H>>2])>>>0){if(St[U>>2]=St[H>>2],St[z>>2]=((0|St[H>>2])>>>1)-1,St[H>>2]=2|1&St[H>>2],e=0|St[z>>2],(0|St[U>>2])>>>0<14)for(St[H>>2]=St[H>>2]<>2]=1376+(0|St[s>>2])+(St[H>>2]<<1)+(0-(0|St[U>>2])<<1)-2,St[Y>>2]=1,St[V>>2]=1;;)if(St[R>>2]=re[(0|St[O>>2])+(St[V>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,$=St[M>>2]<<8,t=0|St[y>>2],St[y>>2]=t+1,St[M>>2]=0|$|mt[t>>0]),t=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=t,t=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=t,_t[(0|St[O>>2])+(St[V>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[V>>2]=(0|St[V>>2])+(0|St[V>>2])):(St[v>>2]=(0|St[v>>2])-t,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[V>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[V>>2]=(0|St[V>>2])+(0|St[V>>2])+1,St[H>>2]=St[H>>2]|St[Y>>2]),St[Y>>2]=St[Y>>2]<<1,t=(0|St[z>>2])-1|0,!(St[z>>2]=t))break t;for(St[z>>2]=e-4;(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,t=St[M>>2]<<8,$=0|St[y>>2],St[y>>2]=$+1,St[M>>2]=0|t|mt[$>>0]),St[v>>2]=(0|St[v>>2])>>>1,St[M>>2]=(0|St[M>>2])-(0|St[v>>2]),St[K>>2]=0-((0|St[M>>2])>>>31),St[H>>2]=(St[H>>2]<<1)+(1+(0|St[K>>2])),St[M>>2]=(0|St[M>>2])+(St[v>>2]&St[K>>2]),$=(0|St[z>>2])-1|0,St[z>>2]=$,0!=(0|$););if(St[O>>2]=1604+(0|St[s>>2]),St[H>>2]=St[H>>2]<<4,St[W>>2]=1,St[R>>2]=re[(0|St[O>>2])+(St[W>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,e=St[M>>2]<<8,$=0|St[y>>2],St[y>>2]=$+1,St[M>>2]=0|e|mt[$>>0]),$=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=$,$=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=$,_t[(0|St[O>>2])+(St[W>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[W>>2]=(0|St[W>>2])+(0|St[W>>2])):(St[v>>2]=(0|St[v>>2])-$,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[W>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[W>>2]=(0|St[W>>2])+(0|St[W>>2])+1,St[H>>2]=1|St[H>>2]),St[R>>2]=re[(0|St[O>>2])+(St[W>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,$=St[M>>2]<<8,e=0|St[y>>2],St[y>>2]=e+1,St[M>>2]=0|$|mt[e>>0]),e=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=e,e=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=e,_t[(0|St[O>>2])+(St[W>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[W>>2]=(0|St[W>>2])+(0|St[W>>2])):(St[v>>2]=(0|St[v>>2])-e,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[W>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[W>>2]=(0|St[W>>2])+(0|St[W>>2])+1,St[H>>2]=2|St[H>>2]),St[R>>2]=re[(0|St[O>>2])+(St[W>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,e=St[M>>2]<<8,$=0|St[y>>2],St[y>>2]=$+1,St[M>>2]=0|e|mt[$>>0]),$=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=$,$=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=$,_t[(0|St[O>>2])+(St[W>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[W>>2]=(0|St[W>>2])+(0|St[W>>2])):(St[v>>2]=(0|St[v>>2])-$,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[W>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[W>>2]=(0|St[W>>2])+(0|St[W>>2])+1,St[H>>2]=4|St[H>>2]),St[R>>2]=re[(0|St[O>>2])+(St[W>>2]<<1)>>1],(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,$=St[M>>2]<<8,e=0|St[y>>2],St[y>>2]=e+1,St[M>>2]=0|$|mt[e>>0]),e=0|wt((0|St[v>>2])>>>11,0|St[R>>2]),St[A>>2]=e,e=0|St[A>>2],(0|St[M>>2])>>>0<(0|St[A>>2])>>>0?(St[v>>2]=e,_t[(0|St[O>>2])+(St[W>>2]<<1)>>1]=(0|St[R>>2])+((2048-(0|St[R>>2])|0)>>>5),St[W>>2]=(0|St[W>>2])+(0|St[W>>2])):(St[v>>2]=(0|St[v>>2])-e,St[M>>2]=(0|St[M>>2])-(0|St[A>>2]),_t[(0|St[O>>2])+(St[W>>2]<<1)>>1]=(0|St[R>>2])-((0|St[R>>2])>>>5),St[W>>2]=(0|St[W>>2])+(0|St[W>>2])+1,St[H>>2]=8|St[H>>2]),-1==(0|St[H>>2])){J=130;break e}}}while(0);if(St[E>>2]=St[d>>2],St[d>>2]=St[c>>2],St[c>>2]=St[l>>2],St[l>>2]=1+(0|St[H>>2]),e=0|St[H>>2],0|St[F>>2]){if(e>>>0>=(0|St[F>>2])>>>0){J=135;break e}}else if(e>>>0>=(0|St[k>>2])>>>0){J=133;break e}St[f>>2]=(0|St[f>>2])>>>0<19?7:10}if(St[w>>2]=2+(0|St[w>>2]),(0|St[a>>2])==(0|St[b>>2])){J=138;break e}if(St[j>>2]=(0|St[a>>2])-(0|St[b>>2]),St[X>>2]=(0|St[j>>2])>>>0<(0|St[w>>2])>>>0?0|St[j>>2]:0|St[w>>2],St[G>>2]=(0|St[b>>2])-(0|St[l>>2])+((0|St[b>>2])>>>0<(0|St[l>>2])>>>0?0|St[p>>2]:0),St[k>>2]=(0|St[k>>2])+(0|St[X>>2]),St[w>>2]=(0|St[w>>2])-(0|St[X>>2]),((0|St[G>>2])+(0|St[X>>2])|0)>>>0>(0|St[p>>2])>>>0)for(;;)if(e=0|Et[(0|St[h>>2])+(0|St[G>>2])>>0],$=0|St[b>>2],St[b>>2]=$+1,Et[(0|St[h>>2])+$>>0]=e,e=1+(0|St[G>>2])|0,St[G>>2]=e,St[G>>2]=(0|e)==(0|St[p>>2])?0:e,e=(0|St[X>>2])-1|0,!(St[X>>2]=e))break r;for(St[q>>2]=(0|St[h>>2])+(0|St[b>>2]),St[Q>>2]=(0|St[G>>2])-(0|St[b>>2]),St[Z>>2]=(0|St[q>>2])+(0|St[X>>2]),St[b>>2]=(0|St[b>>2])+(0|St[X>>2]);Et[St[q>>2]>>0]=0|Et[(0|St[q>>2])+(0|St[Q>>2])>>0],e=1+(0|St[q>>2])|0,St[q>>2]=e,(0|e)!=(0|St[Z>>2]););}}while(0)}while(!((0|St[b>>2])>>>0>=(0|St[a>>2])>>>0)&&(0|St[y>>2])>>>0<(0|St[u>>2])>>>0);{if(28==(0|J))return St[i>>2]=1,ee=0|St[i>>2],pt=n,0|ee;if(130==(0|J))St[w>>2]=274+(0|St[w>>2]),St[f>>2]=(0|St[f>>2])-12;else{if(133==(0|J))return St[i>>2]=1,ee=0|St[i>>2],pt=n,0|ee;if(135==(0|J))return St[i>>2]=1,ee=0|St[i>>2],pt=n,0|ee;if(138==(0|J))return St[i>>2]=1,ee=0|St[i>>2],pt=n,0|ee}}(0|St[v>>2])>>>0<16777216&&(St[v>>2]=St[v>>2]<<8,J=St[M>>2]<<8,u=0|St[y>>2],St[y>>2]=u+1,St[M>>2]=0|J|mt[u>>0]);return St[24+(0|St[o>>2])>>2]=St[y>>2],St[28+(0|St[o>>2])>>2]=St[v>>2],St[32+(0|St[o>>2])>>2]=St[M>>2],St[72+(0|St[o>>2])>>2]=St[w>>2],St[36+(0|St[o>>2])>>2]=St[b>>2],St[44+(0|St[o>>2])>>2]=St[k>>2],St[56+(0|St[o>>2])>>2]=St[l>>2],St[56+(0|St[o>>2])+4>>2]=St[c>>2],St[56+(0|St[o>>2])+8>>2]=St[d>>2],St[56+(0|St[o>>2])+12>>2]=St[E>>2],St[52+(0|St[o>>2])>>2]=St[f>>2],St[i>>2]=0,ee=0|St[i>>2],pt=n,0|ee}(0|St[i>>2],0|St[u>>2],0|St[a>>2]),St[f>>2]=t,0|St[f>>2]){l=6;break}}while(((0|St[44+(0|St[i>>2])>>2])>>>0>=(0|St[12+(0|St[i>>2])>>2])>>>0&&(St[48+(0|St[i>>2])>>2]=St[12+(0|St[i>>2])>>2]),we(0|St[i>>2],0|St[o>>2]),!((0|St[36+(0|St[i>>2])>>2])>>>0>=(0|St[o>>2])>>>0))&&(!((0|St[24+(0|St[i>>2])>>2])>>>0>=(0|St[a>>2])>>>0)&&(0|St[72+(0|St[i>>2])>>2])>>>0<274));return pt=(c=6==(0|l)?(St[n>>2]=St[f>>2],0|St[n>>2]):(274<(0|St[72+(0|St[i>>2])>>2])>>>0&&(St[72+(0|St[i>>2])>>2]=274),(St[n>>2]=0)|St[n>>2]),d),0|c}function Oe(e,r){e|=0,r|=0;var t,n,i=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(t=(n=i)+4|0)>>2]=e,St[n>>2]=r,or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[16+(0|St[t>>2])>>2]),St[16+(0|St[t>>2])>>2]=0,pt=i}function Ae(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,o,a,u,s,f,l=0,c=0,d=0,E=pt;return(0|bt)<=(0|(pt=pt+48|0))&&yt(48),i=E+40|0,a=E+32|0,u=E+28|0,s=E+24|0,f=E+8|0,l=E+4|0,St[(o=(c=E)+36|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[s>>2]=n,n=0|function(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s,f=0,l=pt;return(0|bt)<=(0|(pt=pt+32|0))&&yt(32),n=l+16|0,o=l+8|0,a=l+4|0,s=(u=l)+20|0,St[(i=l+12|0)>>2]=e,St[o>>2]=r,St[a>>2]=t,pt=(f=(0|St[a>>2])>>>0<5?(St[n>>2]=4,0|St[n>>2]):(a=0|mt[1+(0|St[o>>2])>>0]|(0|mt[2+(0|St[o>>2])>>0])<<8|(0|mt[3+(0|St[o>>2])>>0])<<16|(0|mt[4+(0|St[o>>2])>>0])<<24,St[u>>2]=a,St[u>>2]=(0|St[u>>2])>>>0<4096?4096:a,St[12+(0|St[i>>2])>>2]=St[u>>2],Et[s>>0]=0|Et[St[o>>2]>>0],225<=(0|mt[s>>0])?(St[n>>2]=4,0|St[n>>2]):(St[St[i>>2]>>2]=(0|mt[s>>0])%9|0,Et[s>>0]=(0|mt[s>>0])/9|0,St[8+(0|St[i>>2])>>2]=(0|mt[s>>0])/5|0,St[4+(0|St[i>>2])>>2]=(0|mt[s>>0])%5|0,(St[n>>2]=0)|St[n>>2])),l),0|f}(f,0|St[a>>2],0|St[u>>2]),St[l>>2]=n,pt=(d=0|St[l>>2]?(St[i>>2]=St[l>>2],0|St[i>>2]):(l=0|function(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,o=0,a=0,u=0,s=0,f=0,l=0;(0|(pt=(n=pt)+32|0))>=(0|bt)&&yt(32);i=n+16|0,a=n+8|0,u=n+4|0,St[(o=(s=n)+12|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[s>>2]=1846+(768<<(0|St[St[a>>2]>>2])+(0|St[4+(0|St[a>>2])>>2])),0!=(0|St[16+(0|St[o>>2])>>2])&&(0|St[s>>2])==(0|St[84+(0|St[o>>2])>>2])||(f=3);if(3==(0|f)&&(Oe(0|St[o>>2],0|St[u>>2]),f=0|sr[3&St[St[u>>2]>>2]](0|St[u>>2],St[s>>2]<<1),St[16+(0|St[o>>2])>>2]=f,St[84+(0|St[o>>2])>>2]=St[s>>2],0==(0|St[16+(0|St[o>>2])>>2])))return St[i>>2]=2,l=0|St[i>>2],pt=n,0|l;return St[i>>2]=0,l=0|St[i>>2],pt=n,0|l}(0|St[o>>2],f,0|St[s>>2]),St[c>>2]=l,0|St[c>>2]?(St[i>>2]=St[c>>2],0|St[i>>2]):(c=0|St[o>>2],St[c>>2]=St[f>>2],St[c+4>>2]=St[4+f>>2],St[c+8>>2]=St[8+f>>2],St[c+12>>2]=St[12+f>>2],(St[i>>2]=0)|St[i>>2])),E),0|d}function Re(e,r,t,n,i,o,a,u,s,f){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0,a|=0,u|=0,s|=0,f|=0;var l,c,d,E,_,S,m,h,p,b,k,F,w=pt;for((0|bt)<=(0|(pt=pt+64|0))&&yt(64),c=w+52|0,d=w+48|0,_=(E=w)+44|0,S=w+40|0,m=w+36|0,h=w+32|0,p=w+28|0,b=w+16|0,k=w+12|0,F=w+8|0,St[(l=w+56|0)>>2]=e,St[c>>2]=r,St[d>>2]=t,St[(t=E)>>2]=n,St[t+4>>2]=i,St[_>>2]=o,St[S>>2]=a,St[m>>2]=u,St[h>>2]=s,St[p>>2]=f,St[b>>2]=0,St[4+b>>2]=0,f=E,E=(St[8+b>>2]=0)|function(e,r,t,n,i,o,a,u,s,f,l){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0,a|=0,u|=0,s|=0,f|=0,l|=0;var c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0,U=0,z=0,Y=0,V=0,K=0,W=0,j=0,X=0,G=0,q=0;(0|(pt=(c=pt)+192|0))>=(0|bt)&&yt(192);if(d=c+180|0,_=c+172|0,S=c+168|0,m=c+40|0,h=c+164|0,p=c+160|0,b=c+156|0,k=c+152|0,F=c+148|0,w=c+144|0,y=c+140|0,v=c+128|0,M=c+124|0,O=c+120|0,A=c+116|0,R=c+112|0,g=c+108|0,T=c+32|0,N=c+24|0,D=c+104|0,P=c+100|0,C=c+88|0,I=c+16|0,L=c+84|0,x=c+80|0,B=c+76|0,H=c+72|0,U=c+68|0,z=c+8|0,V=(Y=c)+64|0,K=c+60|0,W=c+56|0,j=c+52|0,X=c+48|0,St[(E=c+176|0)>>2]=e,St[_>>2]=r,St[S>>2]=t,St[(t=m)>>2]=n,St[t+4>>2]=i,St[h>>2]=o,St[p>>2]=a,St[b>>2]=u,St[k>>2]=s,St[F>>2]=f,St[w>>2]=l,St[v>>2]=0,St[4+v>>2]=0,St[8+v>>2]=0,St[M>>2]=0,St[O>>2]=0,l=0|function(e){e|=0;var r=0,t=0,n=0,i=0,o=0,a=0,u=0;(0|(pt=(r=pt)+16|0))>=(0|bt)&&yt(16);if(t=r+8|0,St[(n=(i=r)+4|0)>>2]=e,1<=(0|St[16+(0|St[n>>2])>>2])>>>0&&(0|St[16+(0|St[n>>2])>>2])>>>0<=4){if(!(0|De(0|St[St[n>>2]>>2])))return St[t>>2]=4,o=0|St[t>>2],pt=r,0|o;if(e=0|St[n>>2],1==(0|St[16+(0|St[n>>2])>>2]))return pt=(o=(1==(0|St[e+24>>2])&&0==(0|St[St[8+(0|St[n>>2])>>2]>>2])&&0==(0|St[20+(0|St[n>>2])>>2])?St[t>>2]=0:St[t>>2]=4,0|St[t>>2]),r),0|o;if(a=0|St[n>>2],2==(0|St[e+16>>2])){if(St[i>>2]=24+(0|St[a>>2]),e=8+(0|St[i>>2])|0,!(0<(u=0|St[e+4>>2])>>>0|0==(0|u)&4294967295<(0|St[e>>2])>>>0||1!=(0|St[St[i>>2]>>2])||1!=(0|St[4+(0|St[i>>2])>>2])||1!=(0|St[24+(0|St[n>>2])>>2])||0!=(0|St[St[8+(0|St[n>>2])>>2]>>2])||1!=(0|St[20+(0|St[n>>2])>>2])||1!=(0|St[St[4+(0|St[n>>2])>>2]>>2]))&&0==(0|St[4+(0|St[4+(0|St[n>>2])>>2])>>2]))switch(0|St[8+(0|St[i>>2])>>2]){case 50529537:case 50528515:return St[t>>2]=0,o=0|St[t>>2],pt=r,0|o;default:return St[t>>2]=4,o=0|St[t>>2],pt=r,0|o}return St[t>>2]=4,o=0|St[t>>2],pt=r,0|o}if(4!=(0|St[a+16>>2]))return St[t>>2]=4,o=0|St[t>>2],pt=r,0|o;if(0|De(24+(0|St[St[n>>2]>>2])|0)&&0|De(48+(0|St[St[n>>2]>>2])|0)&&(a=72+(0|St[St[n>>2]>>2])+8|0,50528539==(0|St[a>>2])&0==(0|St[a+4>>2]))&&4==(0|St[72+(0|St[St[n>>2]>>2])>>2])&&1==(0|St[72+(0|St[St[n>>2]>>2])+4>>2])){do{if(4==(0|St[24+(0|St[n>>2])>>2])&&2==(0|St[St[8+(0|St[n>>2])>>2]>>2])&&6==(0|St[4+(0|St[8+(0|St[n>>2])>>2])>>2])&&1==(0|St[8+(0|St[8+(0|St[n>>2])>>2])>>2])&&0==(0|St[12+(0|St[8+(0|St[n>>2])>>2])>>2])&&3==(0|St[20+(0|St[n>>2])>>2])){if(5!=(0|St[St[4+(0|St[n>>2])>>2]>>2]))break;if(0|St[4+(0|St[4+(0|St[n>>2])>>2])>>2])break;if(4!=(0|St[8+(0|St[4+(0|St[n>>2])>>2])>>2]))break;if(1!=(0|St[8+(0|St[4+(0|St[n>>2])>>2])+4>>2]))break;if(3!=(0|St[16+(0|St[4+(0|St[n>>2])>>2])>>2]))break;if(2!=(0|St[16+(0|St[4+(0|St[n>>2])>>2])+4>>2]))break;return St[t>>2]=0,o=0|St[t>>2],pt=r,0|o}}while(0);return St[t>>2]=4,o=0|St[t>>2],pt=r,0|o}return St[t>>2]=4,o=0|St[t>>2],pt=r,0|o}return St[t>>2]=4,o=0|St[t>>2],pt=r,0|o}(0|St[E>>2]),St[A>>2]=l,0|St[A>>2])return St[d>>2]=St[A>>2],G=0|St[d>>2],pt=c,0|G;St[y>>2]=0;e:for(;;){if((0|St[y>>2])>>>0>=(0|St[16+(0|St[E>>2])>>2])>>>0){q=55;break}St[R>>2]=(0|St[St[E>>2]>>2])+(24*(0|St[y>>2])|0);r:do{if(0|ge(0|St[8+(0|St[R>>2])>>2])){St[g>>2]=0,St[D>>2]=St[h>>2],St[P>>2]=St[p>>2];do{if(4==(0|St[16+(0|St[E>>2])>>2])){if(St[C>>2]=St[2],St[4+C>>2]=St[3],St[8+C>>2]=St[4],A=(0|St[12+(0|St[E>>2])>>2])+(St[y>>2]<<3)|0,l=0|St[A+4>>2],St[(f=I)>>2]=St[A>>2],St[f+4>>2]=l,St[g>>2]=St[C+(St[y>>2]<<2)>>2],(0|St[y>>2])>>>0<2){if(St[P>>2]=St[I>>2],0!=(0|St[(l=I)+4>>2])||(0|St[P>>2])!=(0|St[l>>2])){q=9;break e}if(l=0|sr[3&St[St[b>>2]>>2]](0|St[b>>2],0|St[P>>2]),St[L>>2]=l,0==(0|St[L>>2])&0!=(0|St[P>>2])){q=11;break e}l=0|St[L>>2],St[(0|St[k>>2])+(1-(0|St[y>>2])<<2)>>2]=l,St[D>>2]=l,St[v+(1-(0|St[y>>2])<<2)>>2]=St[P>>2];break}if(2!=(0|St[y>>2])){q=17;break e}if(0<(f=0|St[(l=I)+4>>2])>>>0|(0==(0|f)?(0|St[l>>2])>>>0>(0|St[p>>2])>>>0:0)){q=15;break e}l=(0|St[h>>2])+((0|St[p>>2])-(0|St[I>>2]))|0,St[D>>2]=l,St[O>>2]=l,l=0|St[I>>2],St[P>>2]=l,St[M>>2]=l;break}}while(0);if(l=0|Te(0|St[_>>2],0|St[g>>2]),St[(f=T)>>2]=l,St[f+4>>2]=Ft,f=(0|St[_>>2])+(St[g>>2]<<3)|0,l=0|St[f+4>>2],St[(A=N)>>2]=St[f>>2],St[A+4>>2]=l,l=0|St[S>>2],f=T,s=0|Dt(0|St[(A=m)>>2],0|St[A+4>>2],0|St[f>>2],0|St[f+4>>2]),f=0|he(l,s,Ft),St[x>>2]=f,0|St[x>>2]){q=19;break e}if(f=8+(0|St[R>>2])|0,0==(0|St[f>>2])&0==(0|St[f+4>>2])){if(0|St[(f=N)+4>>2]||(0|St[f>>2])!=(0|St[P>>2])){q=22;break e}if(s=0|Ne(0|St[(f=N)>>2],0|St[f+4>>2],0|St[S>>2],0|St[D>>2],0|St[F>>2],0|St[w>>2]),St[B>>2]=s,0|St[B>>2]){q=24;break e}break}if(s=8+(0|St[R>>2])|0,f=0|St[R>>2],196865==(0|St[s>>2])&0==(0|St[s+4>>2])){if(l=0|function(e,r,t,n,i,o,a,u,s){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0,a|=0,u|=0,s|=0;var f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0;(0|(pt=(f=pt)+192|0))>=(0|bt)&&yt(192);if(l=f+180|0,E=(d=f)+172|0,_=f+168|0,S=f+164|0,m=f+160|0,h=f+156|0,p=f+152|0,b=f+40|0,k=f+32|0,F=f+28|0,w=f+24|0,y=f+20|0,v=f+16|0,M=f+12|0,O=f+8|0,St[(c=f+176|0)>>2]=e,St[(e=d)>>2]=r,St[e+4>>2]=t,St[E>>2]=n,St[_>>2]=i,St[S>>2]=o,St[m>>2]=a,St[h>>2]=u,St[p>>2]=s,St[k>>2]=0,St[20+b>>2]=0,St[16+b>>2]=0,s=0|Ae(b,0|St[16+(0|St[c>>2])>>2],0|St[16+(0|St[c>>2])+4>>2],0|St[m>>2]),St[F>>2]=s,0|St[F>>2])return St[l>>2]=St[F>>2],A=0|St[l>>2],pt=f,0|A;St[20+b>>2]=St[_>>2],St[40+b>>2]=St[S>>2],ke(b),St[p>>2]=(0|St[p>>2])+(0|St[S>>2]);do{if(St[w>>2]=0,St[y>>2]=262144,(F=0|St[(_=d)+4>>2])>>>0<0|(0==(0|F)?(0|St[y>>2])>>>0>(0|St[_>>2])>>>0:0)&&(St[y>>2]=St[d>>2]),_=0|nr[15&St[St[E>>2]>>2]](0|St[E>>2],w,y),St[k>>2]=_,0|St[k>>2])break;if(St[v>>2]=St[y>>2],St[M>>2]=St[36+b>>2],_=0|Fe(b,0|St[S>>2],0|St[w>>2],v,1,O),St[k>>2]=_,St[y>>2]=(0|St[y>>2])-(0|St[v>>2]),F=0|Nt(0|St[(_=d)>>2],0|St[_+4>>2],0|St[v>>2],0),St[(_=d)>>2]=F,St[_+4>>2]=Ft,Q(2,(0|St[p>>2])-(0|St[S>>2])+(0|St[M>>2])|0,0|St[h>>2]),0|St[k>>2])break;if((0|St[36+b>>2])==(0|St[40+b>>2])){R=11;break}if(0==(0|St[v>>2])&&(0|St[M>>2])==(0|St[36+b>>2])){R=11;break}}while(_=0|sr[3&St[4+(0|St[E>>2])>>2]](0|St[E>>2],0|St[v>>2]),St[k>>2]=_,!(0|St[k>>2]));do{if(11==(0|R)){if(!(0|St[y>>2]||(0|St[40+b>>2])!=(0|St[S>>2]))&&!(1!=(0|St[O>>2])&4!=(0|St[O>>2])))break;St[k>>2]=1}}while(0);return Oe(b,0|St[m>>2]),St[l>>2]=St[k>>2],A=0|St[l>>2],pt=f,0|A}(f,0|St[(s=N)>>2],0|St[s+4>>2],0|St[S>>2],0|St[D>>2],0|St[P>>2],0|St[b>>2],0|St[F>>2],0|St[w>>2]),St[H>>2]=l,0|St[H>>2]){q=27;break e}break}if(!(33==(0|St[(l=f+8|0)>>2])&0==(0|St[l+4>>2]))){q=31;break e}if(l=N,f=0|function(e,r,t,n,i,o,a,u,s){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0,a|=0,u|=0,s|=0;var f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0;(0|(pt=(f=pt)+208|0))>=(0|bt)&&yt(208);if(l=f+204|0,E=(d=f)+196|0,_=f+192|0,S=f+188|0,m=f+184|0,h=f+180|0,p=f+176|0,b=f+36|0,k=f+32|0,F=f+28|0,w=f+24|0,y=f+20|0,v=f+16|0,M=f+12|0,O=f+8|0,St[(c=f+200|0)>>2]=e,St[(e=d)>>2]=r,St[e+4>>2]=t,St[E>>2]=n,St[_>>2]=i,St[S>>2]=o,St[m>>2]=a,St[h>>2]=u,St[p>>2]=s,St[k>>2]=0,St[20+b>>2]=0,St[16+b>>2]=0,1!=(0|St[16+(0|St[c>>2])+4>>2]))return St[l>>2]=1,A=0|St[l>>2],pt=f,0|A;if(s=0|function(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,o=0,a=0,u=0,s=0,f=0,l=0;(0|(pt=(n=pt)+32|0))>=(0|bt)&&yt(32);return i=n+12|0,a=n+21|0,u=n+4|0,s=n+16|0,St[(o=(f=n)+8|0)>>2]=e,Et[a>>0]=r,St[u>>2]=t,t=0|function(e,r){e|=0,r|=0;var t=0,n=0,i=0,o=0,a=0,u=0,s=0;(0|(pt=(t=pt)+16|0))>=(0|bt)&&yt(16);if(n=t+8|0,o=t+4|0,Et[(i=(a=t)+12|0)>>0]=e,St[o>>2]=r,40<(0|mt[i>>0]))return St[n>>2]=4,u=0|St[n>>2],pt=t,0|u;s=40==(0|mt[i>>0])?-1:(2|1&(0|mt[i>>0]))<<11+((0|mt[i>>0])/2|0);return St[a>>2]=s,Et[St[o>>2]>>0]=4,Et[1+(0|St[o>>2])>>0]=St[a>>2],Et[2+(0|St[o>>2])>>0]=(0|St[a>>2])>>>8,Et[3+(0|St[o>>2])>>0]=(0|St[a>>2])>>>16,Et[4+(0|St[o>>2])>>0]=(0|St[a>>2])>>>24,St[n>>2]=0,u=0|St[n>>2],pt=t,0|u}(0|Et[a>>0],s),St[f>>2]=t,pt=(l=(0|St[f>>2]?St[i>>2]=St[f>>2]:(f=0|Ae(0|St[o>>2],s,5,0|St[u>>2]),St[i>>2]=f),0|St[i>>2]),n),0|l}(b,0|Et[St[16+(0|St[c>>2])>>2]>>0],0|St[m>>2]),St[F>>2]=s,0|St[F>>2])return St[l>>2]=St[F>>2],A=0|St[l>>2],pt=f,0|A;St[20+b>>2]=St[_>>2],St[40+b>>2]=St[S>>2],function(e){e|=0;var r=0,t=0;(0|(pt=(r=pt)+16|0))>=(0|bt)&&yt(16),St[(t=r)>>2]=e,St[120+(0|St[t>>2])>>2]=0,St[128+(0|St[t>>2])>>2]=1,St[132+(0|St[t>>2])>>2]=1,St[136+(0|St[t>>2])>>2]=1,ke(0|St[t>>2]),pt=r}(b),St[p>>2]=(0|St[p>>2])+(0|St[S>>2]);do{if(St[w>>2]=0,St[y>>2]=262144,(F=0|St[(_=d)+4>>2])>>>0<0|(0==(0|F)?(0|St[y>>2])>>>0>(0|St[_>>2])>>>0:0)&&(St[y>>2]=St[d>>2]),_=0|nr[15&St[St[E>>2]>>2]](0|St[E>>2],w,y),St[k>>2]=_,0|St[k>>2])break;if(St[v>>2]=St[y>>2],St[M>>2]=St[36+b>>2],_=0|function(e,r,t,n,i,o){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0;var a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0;(0|(pt=(a=pt)+80|0))>=(0|bt)&&yt(80);u=a+72|0,f=a+64|0,l=a+60|0,c=a+56|0,d=a+52|0,E=a+48|0,_=a+44|0,S=a+40|0,m=a+36|0,h=a+32|0,p=a+28|0,b=a+24|0,k=a+20|0,F=a+16|0,w=a+12|0,y=a+8|0,v=a+4|0,St[(s=(M=a)+68|0)>>2]=e,St[f>>2]=r,St[l>>2]=t,St[c>>2]=n,St[d>>2]=i,St[E>>2]=o,St[_>>2]=St[St[c>>2]>>2],St[St[c>>2]>>2]=0,St[St[E>>2]>>2]=0;for(;;){if(8==(0|St[120+(0|St[s>>2])>>2])){O=49;break}if(St[S>>2]=St[36+(0|St[s>>2])>>2],9==(0|St[120+(0|St[s>>2])>>2])){O=4;break}if(0==(0|St[d>>2])&&(0|St[S>>2])==(0|St[f>>2])){O=6;break}if(6==(0|St[120+(0|St[s>>2])>>2])||7==(0|St[120+(0|St[s>>2])>>2]))if(St[m>>2]=(0|St[f>>2])-(0|St[S>>2]),St[h>>2]=(0|St[_>>2])-(0|St[St[c>>2]>>2]),((St[p>>2]=0)|St[116+(0|St[s>>2])>>2])>>>0<=(0|St[m>>2])>>>0&&(St[m>>2]=St[116+(0|St[s>>2])>>2],St[p>>2]=1),128&(0|mt[124+(0|St[s>>2])>>0])){if(6==(0|St[120+(0|St[s>>2])>>2])){if(St[w>>2]=(0|mt[124+(0|St[s>>2])>>0])>>5&3,St[y>>2]=3==(0|St[w>>2])&1,St[v>>2]=0<(0|St[w>>2])&1,0==(0|St[y>>2])&&0|St[128+(0|St[s>>2])>>2]){O=33;break}if(0==(0|St[v>>2])&&0|St[132+(0|St[s>>2])>>2]){O=33;break}be(0|St[s>>2],0|St[y>>2],0|St[v>>2]),St[128+(0|St[s>>2])>>2]=0,St[132+(0|St[s>>2])>>2]=0,St[120+(0|St[s>>2])>>2]=7}if((0|St[h>>2])>>>0>(0|St[112+(0|St[s>>2])>>2])>>>0&&(St[h>>2]=St[112+(0|St[s>>2])>>2]),n=0|Fe(0|St[s>>2],(0|St[S>>2])+(0|St[m>>2])|0,0|St[l>>2],h,0|St[p>>2],0|St[E>>2]),St[F>>2]=n,St[l>>2]=(0|St[l>>2])+(0|St[h>>2]),n=0|St[c>>2],St[n>>2]=(0|St[n>>2])+(0|St[h>>2]),n=112+(0|St[s>>2])|0,St[n>>2]=(0|St[n>>2])-(0|St[h>>2]),St[k>>2]=(0|St[36+(0|St[s>>2])>>2])-(0|St[S>>2]),n=116+(0|St[s>>2])|0,St[n>>2]=(0|St[n>>2])-(0|St[k>>2]),St[M>>2]=St[F>>2],0|St[M>>2]){O=38;break}if(3==(0|St[St[E>>2]>>2])){O=40;break}if(0==(0|St[h>>2])&0==(0|St[k>>2])){if(4!=(0|St[St[E>>2]>>2])){O=45;break}if(0|St[116+(0|St[s>>2])>>2]){O=45;break}if(0|St[112+(0|St[s>>2])>>2]){O=45;break}St[120+(0|St[s>>2])>>2]=0}4==(0|St[St[E>>2]>>2])&&(St[St[E>>2]>>2]=2)}else{if((0|St[St[c>>2]>>2])==(0|St[_>>2])){O=16;break}if(6==(0|St[120+(0|St[s>>2])>>2])){if(St[b>>2]=1==(0|mt[124+(0|St[s>>2])>>0])&1,n=0|St[s>>2],0|St[b>>2])St[n+132>>2]=1,St[136+(0|St[s>>2])>>2]=1;else if(0|St[n+128>>2]){O=21;break}be((St[128+(0|St[s>>2])>>2]=0)|St[s>>2],0|St[b>>2],0)}if((0|St[h>>2])>>>0>(0|St[m>>2])>>>0&&(St[h>>2]=St[m>>2]),!(0|St[h>>2])){O=26;break}!function(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,o=0,a=0;(0|(pt=(n=pt)+16|0))>=(0|bt)&&yt(16),o=n+4|0,St[(i=(a=n)+8|0)>>2]=e,St[o>>2]=r,St[a>>2]=t,Je((0|St[20+(0|St[i>>2])>>2])+(0|St[36+(0|St[i>>2])>>2])|0,0|St[o>>2],0|St[a>>2]),o=36+(0|St[i>>2])|0,St[o>>2]=(0|St[o>>2])+(0|St[a>>2]),0==(0|St[48+(0|St[i>>2])>>2])&&((0|St[12+(0|St[i>>2])>>2])-(0|St[44+(0|St[i>>2])>>2])|0)>>>0<=(0|St[a>>2])>>>0&&(St[48+(0|St[i>>2])>>2]=St[12+(0|St[i>>2])>>2]),o=44+(0|St[i>>2])|0,St[o>>2]=(0|St[o>>2])+(0|St[a>>2]),pt=n}(0|St[s>>2],0|St[l>>2],0|St[h>>2]),St[l>>2]=(0|St[l>>2])+(0|St[h>>2]),n=0|St[c>>2],St[n>>2]=(0|St[n>>2])+(0|St[h>>2]),n=116+(0|St[s>>2])|0,St[n>>2]=(0|St[n>>2])-(0|St[h>>2]),St[120+(0|St[s>>2])>>2]=0==(0|St[116+(0|St[s>>2])>>2])?0:7}else{if((0|St[St[c>>2]>>2])==(0|St[_>>2])){O=10;break}o=0|St[c>>2],St[o>>2]=1+(0|St[o>>2]),o=0|St[s>>2],i=0|St[l>>2],St[l>>2]=i+1,n=0|function(e,r){e|=0,r|=0;var t=0,n=0,i=0,o=0,a=0,u=0,s=0,f=0;(0|(pt=(t=pt)+32|0))>=(0|bt)&&yt(32);switch(n=t+12|0,o=t+16|0,a=t+4|0,St[(i=(u=t)+8|0)>>2]=e,Et[o>>0]=r,0|St[120+(0|St[i>>2])>>2]){case 0:if(Et[124+(0|St[i>>2])>>0]=0|Et[o>>0],!(0|mt[124+(0|St[i>>2])>>0]))return St[n>>2]=8,s=0|St[n>>2],pt=t,0|s;r=0|mt[124+(0|St[i>>2])>>0];do{if(!(128&(0|mt[124+(0|St[i>>2])>>0]))){if((127&r|0)<=2){St[116+(0|St[i>>2])>>2]=0;break}return St[n>>2]=9,s=0|St[n>>2],pt=t,0|s}}while(St[116+(0|St[i>>2])>>2]=(31&r)<<16,0);return St[n>>2]=1,s=0|St[n>>2],pt=t,0|s;case 1:return r=116+(0|St[i>>2])|0,St[r>>2]=St[r>>2]|(0|mt[o>>0])<<8,St[n>>2]=2,s=0|St[n>>2],pt=t,0|s;case 2:return r=116+(0|St[i>>2])|0,St[r>>2]=0|St[r>>2]|mt[o>>0],r=116+(0|St[i>>2])|0,St[r>>2]=1+(0|St[r>>2]),St[n>>2]=0==(128&(0|mt[124+(0|St[i>>2])>>0])|0)?6:3,s=0|St[n>>2],pt=t,0|s;case 3:return St[112+(0|St[i>>2])>>2]=(0|mt[o>>0])<<8,St[n>>2]=4,s=0|St[n>>2],pt=t,0|s;case 4:return r=112+(0|St[i>>2])|0,St[r>>2]=0|St[r>>2]|mt[o>>0],r=112+(0|St[i>>2])|0,St[r>>2]=1+(0|St[r>>2]),f=2<=((0|mt[124+(0|St[i>>2])>>0])>>5&3|0)?5:0|St[136+(0|St[i>>2])>>2]?9:6,St[n>>2]=f,s=0|St[n>>2],pt=t,0|s;case 5:return pt=(s=(225<=(0|mt[o>>0])?St[n>>2]=9:(St[a>>2]=(0|mt[o>>0])%9|0,Et[o>>0]=(0|mt[o>>0])/9|0,St[8+(0|St[i>>2])>>2]=(0|mt[o>>0])/5|0,St[u>>2]=(0|mt[o>>0])%5|0,4<((0|St[a>>2])+(0|St[u>>2])|0)?St[n>>2]=9:(St[St[i>>2]>>2]=St[a>>2],St[4+(0|St[i>>2])>>2]=St[u>>2],St[136+(0|St[i>>2])>>2]=0,St[n>>2]=6)),0|St[n>>2]),t),0|s;default:return St[n>>2]=9,s=0|St[n>>2],pt=t,0|s}return 0}(o,0|Et[i>>0]),St[120+(0|St[s>>2])>>2]=n}}switch(0|O){case 4:return St[u>>2]=1,A=0|St[u>>2],pt=a,0|A;case 6:return St[St[E>>2]>>2]=2,St[u>>2]=0,A=0|St[u>>2],pt=a,0|A;case 10:case 16:return St[St[E>>2]>>2]=3,St[u>>2]=0,A=0|St[u>>2],pt=a,0|A;case 21:case 26:case 33:return St[u>>2]=1,A=0|St[u>>2],pt=a,0|A;case 38:return St[u>>2]=St[M>>2],A=0|St[u>>2],pt=a,0|A;case 40:return St[u>>2]=St[F>>2],A=0|St[u>>2],pt=a,0|A;case 45:return St[u>>2]=1,A=0|St[u>>2],pt=a,0|A;case 49:return St[St[E>>2]>>2]=1,St[u>>2]=0,A=0|St[u>>2],pt=a,0|A}return 0}(b,0|St[S>>2],0|St[w>>2],v,1,O),St[k>>2]=_,St[y>>2]=(0|St[y>>2])-(0|St[v>>2]),F=0|Nt(0|St[(_=d)>>2],0|St[_+4>>2],0|St[v>>2],0),St[(_=d)>>2]=F,St[_+4>>2]=Ft,Q(2,(0|St[p>>2])-(0|St[S>>2])+(0|St[M>>2])|0,0|St[h>>2]),0|St[k>>2])break;if((0|St[36+b>>2])==(0|St[40+b>>2])){R=13;break}if(0==(0|St[v>>2])&&(0|St[M>>2])==(0|St[36+b>>2])){R=13;break}}while(_=0|sr[3&St[4+(0|St[E>>2])>>2]](0|St[E>>2],0|St[v>>2]),St[k>>2]=_,!(0|St[k>>2]));13==(0|R)&&(0|St[y>>2]?1:(0|St[40+b>>2])!=(0|St[S>>2]))|1!=(0|St[O>>2])&&(St[k>>2]=1);return Oe(b,0|St[m>>2]),St[l>>2]=St[k>>2],A=0|St[l>>2],pt=f,0|A}(0|St[R>>2],0|St[l>>2],0|St[l+4>>2],0|St[S>>2],0|St[D>>2],0|St[P>>2],0|St[b>>2],0|St[F>>2],0|St[w>>2]),St[U>>2]=f,0|St[U>>2]){q=30;break e}}else{if(f=8+(0|St[R>>2])|0,!(50528539==(0|St[f>>2])&0==(0|St[f+4>>2]))){if(1!=(0|St[y>>2])){q=47;break e}switch(f=8+(0|St[R>>2])|0,l=0|St[f+4>>2],0|St[f>>2]){case 50528515:if(0|l){q=53;break e}(function(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0,i|=0;var o,a,u,s,f,l,c,d,E,_,S,m,h,p,b,k,F=0,w=0,y=pt;if((0|bt)<=(0|(pt=pt+64|0))&&yt(64),o=y+52|0,u=y+44|0,s=y+40|0,f=y+36|0,l=y+32|0,c=y+28|0,d=y+24|0,E=y+20|0,_=y+16|0,S=y+12|0,m=y+57|0,h=y+8|0,p=y+4|0,b=y+56|0,St[(a=(k=y)+48|0)>>2]=e,St[u>>2]=r,St[s>>2]=t,St[f>>2]=n,St[l>>2]=i,St[c>>2]=0,St[E>>2]=7&St[St[f>>2]>>2],(0|St[u>>2])>>>0<5)return St[o>>2]=0,St[o>>2],pt=y;St[s>>2]=5+(0|St[s>>2]),St[d>>2]=-1;t:for(;;){for(St[_>>2]=(0|St[a>>2])+(0|St[c>>2]),St[S>>2]=(0|St[a>>2])+(0|St[u>>2])-4;!((0|St[_>>2])>>>0>=(0|St[S>>2])>>>0)&&232!=(254&mt[St[_>>2]>>0]|0);)St[_>>2]=1+(0|St[_>>2]);if(St[c>>2]=(0|St[_>>2])-(0|St[a>>2]),i=(0|St[_>>2])>>>0>=(0|St[S>>2])>>>0,St[d>>2]=(0|St[c>>2])-(0|St[d>>2]),F=3<(0|St[d>>2])>>>0,i)break;do{if(F)St[E>>2]=0;else if(St[E>>2]=St[E>>2]<<(0|St[d>>2])-1&7,0|St[E>>2]){if(Et[m>>0]=0|Et[(0|St[_>>2])+(4-(0|mt[360+(0|St[E>>2])>>0]))>>0],0|Et[352+(0|St[E>>2])>>0]&&0|mt[m>>0]&&255!=(0|mt[m>>0]))break;St[d>>2]=St[c>>2],St[E>>2]=St[E>>2]<<1&7|1,St[c>>2]=1+(0|St[c>>2]);continue t}}while(0);if(St[d>>2]=St[c>>2],0|mt[4+(0|St[_>>2])>>0]&&255!=(0|mt[4+(0|St[_>>2])>>0]))St[E>>2]=St[E>>2]<<1&7|1,St[c>>2]=1+(0|St[c>>2]);else{for(St[h>>2]=mt[4+(0|St[_>>2])>>0]<<24|mt[3+(0|St[_>>2])>>0]<<16|mt[2+(0|St[_>>2])>>0]<<8|mt[1+(0|St[_>>2])>>0];0|St[l>>2]?St[p>>2]=(0|St[s>>2])+(0|St[c>>2])+(0|St[h>>2]):St[p>>2]=(0|St[h>>2])-((0|St[s>>2])+(0|St[c>>2])),0|St[E>>2]&&(St[k>>2]=mt[360+(0|St[E>>2])>>0]<<3,Et[b>>0]=(0|St[p>>2])>>>(24-(0|St[k>>2])|0),!(0|mt[b>>0]&&255!=(0|mt[b>>0])));)St[h>>2]=St[p>>2]^(1<<32-(0|St[k>>2]))-1;Et[4+(0|St[_>>2])>>0]=~(((0|St[p>>2])>>>24&1)-1),Et[3+(0|St[_>>2])>>0]=(0|St[p>>2])>>>16,Et[2+(0|St[_>>2])>>0]=(0|St[p>>2])>>>8,Et[1+(0|St[_>>2])>>0]=St[p>>2],St[c>>2]=5+(0|St[c>>2])}}w=F?0:St[E>>2]<<(0|St[d>>2])-1&7,St[St[f>>2]>>2]=w,St[o>>2]=St[c>>2],St[o>>2],pt=y})((St[X>>2]=0)|St[h>>2],0|St[p>>2],0,X,0);break r;case 50529537:if(0|l){q=53;break e}!function(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,o,a,u,s,f,l,c,d=0,E=pt;if((0|bt)<=(0|(pt=pt+32|0))&&yt(32),i=E+28|0,a=E+20|0,u=E+16|0,s=E+12|0,f=E+8|0,l=E+4|0,St[(o=(c=E)+24|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[s>>2]=n,(0|St[a>>2])>>>0<4)return St[i>>2]=0,St[i>>2],pt=E;for(St[a>>2]=(0|St[a>>2])-4,St[u>>2]=8+(0|St[u>>2]),St[f>>2]=0;d=0|St[f>>2],!((0|St[f>>2])>>>0>(0|St[a>>2])>>>0);)235==(0|mt[(0|St[o>>2])+(d+3)>>0])&&(St[c>>2]=(0|mt[(0|St[o>>2])+(2+(0|St[f>>2]))>>0])<<16|(0|mt[(0|St[o>>2])+(1+(0|St[f>>2]))>>0])<<8|0|mt[(0|St[o>>2])+(0|St[f>>2])>>0],St[c>>2]=St[c>>2]<<2,0|St[s>>2]?St[l>>2]=(0|St[u>>2])+(0|St[f>>2])+(0|St[c>>2]):St[l>>2]=(0|St[c>>2])-((0|St[u>>2])+(0|St[f>>2])),St[l>>2]=(0|St[l>>2])>>>2,Et[(0|St[o>>2])+(2+(0|St[f>>2]))>>0]=(0|St[l>>2])>>>16,Et[(0|St[o>>2])+(1+(0|St[f>>2]))>>0]=(0|St[l>>2])>>>8,Et[(0|St[o>>2])+(0|St[f>>2])>>0]=St[l>>2]),St[f>>2]=4+(0|St[f>>2]);St[i>>2]=d,St[i>>2],pt=E}(0|St[h>>2],0|St[p>>2],0,0);break r;default:q=53;break e}}if(l=0|Te(0|St[_>>2],1),St[(f=z)>>2]=l,St[f+4>>2]=Ft,f=8+(0|St[_>>2])|0,l=0|St[f+4>>2],St[(s=Y)>>2]=St[f>>2],St[s+4>>2]=l,3!=(0|St[y>>2])){q=34;break e}if(l=0|St[S>>2],f=z,A=0|Dt(0|St[(s=m)>>2],0|St[s+4>>2],0|St[f>>2],0|St[f+4>>2]),f=0|he(l,A,Ft),St[K>>2]=f,0|St[K>>2]){q=36;break e}if(St[8+v>>2]=St[Y>>2],0!=(0|St[(f=Y)+4>>2])||(0|St[8+v>>2])!=(0|St[f>>2])){q=38;break e}if(f=0|sr[3&St[St[b>>2]>>2]](0|St[b>>2],0|St[8+v>>2]),St[8+(0|St[k>>2])>>2]=f,0==(0|St[8+(0|St[k>>2])>>2])&&0|St[8+v>>2]){q=41;break e}if(A=0|Ne(0|St[(f=Y)>>2],0|St[f+4>>2],0|St[S>>2],0|St[8+(0|St[k>>2])>>2],0|St[F>>2],0|St[w>>2]),St[V>>2]=A,St[W>>2]=St[V>>2],0|St[W>>2]){q=43;break e}if(A=0|function(e,r,t,n,i,o,a,u,s,f){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0,a|=0,u|=0,s|=0,f|=0;var l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0;(0|(pt=(l=pt)+624|0))>=(0|bt)&&yt(624);c=l+92|0,E=l+84|0,_=l+80|0,S=l+76|0,m=l+72|0,h=l+68|0,p=l+64|0,b=l+60|0,k=l+56|0,F=l+52|0,w=l+96|0,y=l+48|0,v=l+44|0,M=l+40|0,O=l+36|0,A=l+32|0,R=l+28|0,g=l+613|0,T=l+24|0,N=l+612|0,D=l+20|0,P=l+16|0,C=l+12|0,I=l+8|0,L=l+4|0,St[(d=(x=l)+88|0)>>2]=e,St[E>>2]=r,St[_>>2]=t,St[S>>2]=n,St[m>>2]=i,St[h>>2]=o,St[p>>2]=a,St[b>>2]=u,St[k>>2]=s,St[F>>2]=f,St[y>>2]=0,St[v>>2]=0,St[R>>2]=0,Et[g>>0]=0,St[T>>2]=0;for(;!(258<=(0|St[T>>2])>>>0);)_t[w+(St[T>>2]<<1)>>1]=1024,St[T>>2]=1+(0|St[T>>2]);St[M>>2]=St[p>>2],St[O>>2]=(0|St[M>>2])+(0|St[b>>2]),St[A>>2]=-1,St[T>>2]=0;for(;!(5<=(0|St[T>>2])>>>0);){if((0|St[M>>2])==(0|St[O>>2])){B=7;break}b=St[R>>2]<<8,p=0|St[M>>2],St[M>>2]=p+1,St[R>>2]=0|b|mt[p>>0],St[T>>2]=1+(0|St[T>>2])}if(7==(0|B))return St[c>>2]=1,H=0|St[c>>2],pt=l,0|H;if(!(0|St[F>>2]))return St[c>>2]=0,H=0|St[c>>2],pt=l,0|H;for(;;){for(St[I>>2]=(0|St[E>>2])-(0|St[y>>2]),((0|St[F>>2])-(0|St[v>>2])|0)>>>0<(0|St[I>>2])>>>0&&(St[I>>2]=(0|St[F>>2])-(0|St[v>>2]));0|St[I>>2]&&(Et[N>>0]=0|Et[(0|St[d>>2])+(0|St[y>>2])>>0],T=0|Et[N>>0],p=0|St[v>>2],St[v>>2]=p+1,Et[(0|St[k>>2])+p>>0]=T,232!=(254&(0|mt[N>>0])|0))&&(15!=(0|mt[g>>0])||128!=(240&(0|mt[N>>0])|0));)St[y>>2]=1+(0|St[y>>2]),Et[g>>0]=0|Et[N>>0],St[I>>2]=(0|St[I>>2])-1;if(!(0|St[I>>2])){B=46;break}if((0|St[v>>2])==(0|St[F>>2])){B=46;break}T=0|St[y>>2],St[y>>2]=T+1,Et[N>>0]=0|Et[(0|St[d>>2])+T>>0];do{if(232!=(0|mt[N>>0])){if(233==(0|mt[N>>0])){St[D>>2]=512+w;break}St[D>>2]=514+w;break}}while(St[D>>2]=w+((0|mt[g>>0])<<1),0);if(St[C>>2]=re[St[D>>2]>>1],T=0|wt((0|St[A>>2])>>>11,0|St[C>>2]),St[P>>2]=T,T=0|St[P>>2],(0|St[R>>2])>>>0<(0|St[P>>2])>>>0){if(St[A>>2]=T,_t[St[D>>2]>>1]=(0|St[C>>2])+((2048-(0|St[C>>2])|0)>>>5),(0|St[A>>2])>>>0<16777216){if((0|St[M>>2])==(0|St[O>>2])){B=28;break}St[A>>2]=St[A>>2]<<8,p=St[R>>2]<<8,b=0|St[M>>2],St[M>>2]=b+1,St[R>>2]=0|p|mt[b>>0]}Et[g>>0]=0|Et[N>>0]}else{if(St[A>>2]=(0|St[A>>2])-T,St[R>>2]=(0|St[R>>2])-(0|St[P>>2]),_t[St[D>>2]>>1]=(0|St[C>>2])-((0|St[C>>2])>>>5),(0|St[A>>2])>>>0<16777216){if((0|St[M>>2])==(0|St[O>>2])){B=33;break}St[A>>2]=St[A>>2]<<8,T=St[R>>2]<<8,b=0|St[M>>2],St[M>>2]=b+1,St[R>>2]=0|T|mt[b>>0]}if(232==(0|mt[N>>0])){if(St[x>>2]=St[_>>2],(0|St[S>>2])>>>0<4){B=37;break}St[_>>2]=4+(0|St[_>>2]),St[S>>2]=(0|St[S>>2])-4}else{if(St[x>>2]=St[m>>2],(0|St[h>>2])>>>0<4){B=40;break}St[m>>2]=4+(0|St[m>>2]),St[h>>2]=(0|St[h>>2])-4}if(St[L>>2]=((0|mt[St[x>>2]>>0])<<24|(0|mt[1+(0|St[x>>2])>>0])<<16|(0|mt[2+(0|St[x>>2])>>0])<<8|0|mt[3+(0|St[x>>2])>>0])-(4+(0|St[v>>2])),b=255&St[L>>2],T=0|St[v>>2],St[v>>2]=T+1,Et[(0|St[k>>2])+T>>0]=b,(0|St[v>>2])==(0|St[F>>2])){B=46;break}if(b=(0|St[L>>2])>>>8&255,T=0|St[v>>2],St[v>>2]=T+1,Et[(0|St[k>>2])+T>>0]=b,(0|St[v>>2])==(0|St[F>>2])){B=46;break}if(b=(0|St[L>>2])>>>16&255,T=0|St[v>>2],St[v>>2]=T+1,Et[(0|St[k>>2])+T>>0]=b,(0|St[v>>2])==(0|St[F>>2])){B=46;break}b=(0|St[L>>2])>>>24&255,Et[g>>0]=b,T=0|St[v>>2],St[v>>2]=T+1,Et[(0|St[k>>2])+T>>0]=b}}{if(28==(0|B))return St[c>>2]=1,H=0|St[c>>2],pt=l,0|H;if(33==(0|B))return St[c>>2]=1,H=0|St[c>>2],pt=l,0|H;if(37==(0|B))return St[c>>2]=1,H=0|St[c>>2],pt=l,0|H;if(40==(0|B))return St[c>>2]=1,H=0|St[c>>2],pt=l,0|H;if(46==(0|B))return St[c>>2]=(0|St[v>>2])==(0|St[F>>2])?0:1,H=0|St[c>>2],pt=l,0|H}return 0}(0|St[O>>2],0|St[M>>2],0|St[St[k>>2]>>2],0|St[v>>2],0|St[4+(0|St[k>>2])>>2],0|St[4+v>>2],0|St[8+(0|St[k>>2])>>2],0|St[8+v>>2],0|St[h>>2],0|St[p>>2]),St[V>>2]=A,St[j>>2]=St[V>>2],0|St[j>>2]){q=45;break e}}}while(0);St[y>>2]=1+(0|St[y>>2])}switch(0|q){case 9:case 11:return St[d>>2]=2,G=0|St[d>>2],pt=c,0|G;case 15:return St[d>>2]=5,G=0|St[d>>2],pt=c,0|G;case 17:return St[d>>2]=4,G=0|St[d>>2],pt=c,0|G;case 19:return St[d>>2]=St[x>>2],G=0|St[d>>2],pt=c,0|G;case 22:return St[d>>2]=1,G=0|St[d>>2],pt=c,0|G;case 24:return St[d>>2]=St[B>>2],G=0|St[d>>2],pt=c,0|G;case 27:return St[d>>2]=St[H>>2],G=0|St[d>>2],pt=c,0|G;case 30:return St[d>>2]=St[U>>2],G=0|St[d>>2],pt=c,0|G;case 31:case 34:return St[d>>2]=4,G=0|St[d>>2],pt=c,0|G;case 36:return St[d>>2]=St[K>>2],G=0|St[d>>2],pt=c,0|G;case 38:case 41:return St[d>>2]=2,G=0|St[d>>2],pt=c,0|G;case 43:return St[d>>2]=St[W>>2],G=0|St[d>>2],pt=c,0|G;case 45:return St[d>>2]=St[j>>2],G=0|St[d>>2],pt=c,0|G;case 47:case 53:return St[d>>2]=4,G=0|St[d>>2],pt=c,0|G;case 55:return St[d>>2]=0,G=0|St[d>>2],pt=c,0|G}return 0}(0|St[l>>2],0|St[c>>2],0|St[d>>2],0|St[f>>2],0|St[f+4>>2],0|St[_>>2],0|St[S>>2],0|St[m>>2],b,0|St[h>>2],0|St[p>>2]),St[F>>2]=E,St[k>>2]=0;!(3<=(0|St[k>>2]));)or[3&St[4+(0|St[m>>2])>>2]](0|St[m>>2],0|St[b+(St[k>>2]<<2)>>2]),St[k>>2]=1+(0|St[k>>2]);return pt=w,0|St[F>>2]}function ge(e){e|=0;var r,t,n=0,i=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),r=i+4|0,St[(t=i)>>2]=e,e=0|St[t>>2];e:do{if(33<=(0|e)){if((0|e)<196865){if(33==(0|e)){n=2;break e}n=3;break e}if(196865==(0|e)){n=2;break e}n=3;break e}}while(n=0==(0|e)?2:3,0);return 2==(0|n)?St[r>>2]=1:3==(0|n)&&(St[r>>2]=0),pt=i,0|St[r>>2]}function Te(e,r){e|=0,r|=0;var t,n,i,o,a=0,u=pt;for((0|bt)<=(0|(pt=pt+32|0))&&yt(32),n=u+12|0,a=(i=u)+8|0,St[(t=u+16|0)>>2]=e,St[n>>2]=r,St[(r=i)>>2]=0,St[r+4>>2]=0,St[a>>2]=0;!((0|St[a>>2])>>>0>=(0|St[n>>2])>>>0);)r=(0|St[t>>2])+(St[a>>2]<<3)|0,o=0|Dt(0|St[(e=i)>>2],0|St[e+4>>2],0|St[r>>2],0|St[r+4>>2]),St[(r=i)>>2]=o,St[r+4>>2]=Ft,St[a>>2]=1+(0|St[a>>2]);return Ft=0|St[(a=i)+4>>2],pt=u,0|St[a>>2]}function Ne(e,r,t,n,i,o){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0;var a,u,s,f,l,c,d,E,_,S,m=0,h=0,p=pt;for((0|bt)<=(0|(pt=pt+48|0))&&yt(48),a=p+40|0,s=(u=p)+36|0,f=p+32|0,l=p+28|0,c=p+20|0,d=p+16|0,E=p+12|0,_=p+8|0,St[(S=u)>>2]=e,St[S+4>>2]=r,St[s>>2]=t,St[f>>2]=n,St[l>>2]=i,St[p+24>>2]=o;;){if(!(0<(i=0|St[(o=u)+4>>2])>>>0|0==(0|i)&0<(0|St[o>>2])>>>0)){m=11;break}if(St[d>>2]=262144,(i=0|St[(o=u)+4>>2])>>>0<0|(0==(0|i)?(0|St[d>>2])>>>0>(0|St[o>>2])>>>0:0)&&(St[d>>2]=St[u>>2]),o=0|nr[15&St[St[s>>2]>>2]](0|St[s>>2],c,d),St[E>>2]=o,0|St[E>>2]){m=6;break}if(!(0|St[d>>2])){m=8;break}if(Je(0|St[f>>2],0|St[c>>2],0|St[d>>2]),St[f>>2]=(0|St[f>>2])+(0|St[d>>2]),i=0|Nt(0|St[(o=u)>>2],0|St[o+4>>2],0|St[d>>2],0),St[(o=u)>>2]=i,St[o+4>>2]=Ft,Q(2,0|St[d>>2],0|St[l>>2]),o=0|sr[3&St[4+(0|St[s>>2])>>2]](0|St[s>>2],0|St[d>>2]),St[_>>2]=o,0|St[_>>2]){m=10;break}}return 6==(0|m)?(St[a>>2]=St[E>>2],h=0|St[a>>2],pt=p,0|h):8==(0|m)?(St[a>>2]=6,h=0|St[a>>2],pt=p,0|h):10==(0|m)?(St[a>>2]=St[_>>2],h=0|St[a>>2],pt=p,0|h):11==(0|m)?(h=(St[a>>2]=0)|St[a>>2],pt=p,0|h):0}function De(e){e|=0;var r,t,n=0,i=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(r=i)>>2]=e,1!=(0|St[St[r>>2]>>2])||1!=(0|St[4+(0|St[r>>2])>>2])?(pt=i,(n=0)|1&n):(e=8+(0|St[r>>2])|0,(t=0|St[e+4>>2])>>>0<0|0==(0|t)&(0|St[e>>2])>>>0<=4294967295?(n=0!=(0|ge(0|St[8+(0|St[r>>2])>>2])),pt=i,0|1&n):(pt=i,(n=0)|1&n))}function Pe(e,r){e|=0,r|=0;var t,n,i=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(t=(n=i)+4|0)>>2]=e,St[n>>2]=r,r=~(0|ur[1&St[2761]](-1,0|St[t>>2],0|St[n>>2],2852)),pt=i,0|r}function Ce(e){e|=0;var r,t=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(r=t)>>2]=e,St[St[r>>2]>>2]=0,St[4+(0|St[r>>2])>>2]=0,pt=t}function Ie(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u=0,s=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),n=s+12|0,o=s+4|0,St[(i=(a=s)+8|0)>>2]=e,St[o>>2]=r,St[a>>2]=t,pt=(u=(St[4+(0|St[i>>2])>>2]=0)|St[o>>2]?(t=0|sr[3&St[St[a>>2]>>2]](0|St[a>>2],0|St[o>>2]),St[St[i>>2]>>2]=t,0|St[St[i>>2]>>2]?(St[4+(0|St[i>>2])>>2]=St[o>>2],St[n>>2]=1,0|St[n>>2]):(St[n>>2]=0)|St[n>>2]):(St[St[i>>2]>>2]=0,St[n>>2]=1,0|St[n>>2]),s),0|u}function Le(e,r){e|=0,r|=0;var t,n,i=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(t=(n=i)+4|0)>>2]=e,St[n>>2]=r,or[3&St[4+(0|St[n>>2])>>2]](0|St[n>>2],0|St[St[t>>2]>>2]),St[St[t>>2]>>2]=0,St[4+(0|St[t>>2])>>2]=0,pt=i}function xe(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=pt;for((0|bt)<=(0|(pt=pt+48|0))&&yt(48),n=F+16|0,f=(i=F)+32|0,l=0|St[(o=e+28|0)>>2],St[f>>2]=l,c=(0|St[(a=e+20|0)>>2])-l|0,St[f+4>>2]=c,St[f+8>>2]=r,r=e+60|0,l=e+44|0,E=c+(St[f+12>>(d=2)]=t)|0,c=f;;){if((0|E)==(0|(_=0|St[2762]?(g(1,0|e),St[i>>2]=St[r>>2],St[i+4>>2]=c,St[i+8>>2]=d,f=0|Be(0|A(146,0|i)),v(0),f):(St[n>>2]=St[r>>2],St[4+n>>2]=c,St[8+n>>2]=d,0|Be(0|A(146,0|n)))))){S=6;break}if((0|_)<0){S=8;break}f=E-_|0,b=_>>>0<=(u=0|St[c+4>>2])>>>0?(p=(h=2==(0|d)?(St[o>>2]=(0|St[o>>2])+_,m=_,2):(m=_,d),c),u):(s=0|St[l>>2],St[o>>2]=s,St[a>>2]=s,m=_-u|0,h=d+-1|0,p=c+8|0,0|St[c+12>>2]),St[p>>2]=(0|St[p>>2])+m,St[p+4>>2]=b-m,d=h,E=f,c=p}return 6==(0|S)?(p=0|St[l>>2],St[e+16>>2]=p+(0|St[e+48>>2]),l=p,St[o>>2]=l,St[a>>2]=l,k=t):8==(0|S)&&(St[e+16>>2]=0,St[o>>2]=0,St[a>>2]=0,St[e>>2]=32|St[e>>2],k=2==(0|d)?0:t-(0|St[c+4>>2])|0),pt=F,0|k}function Be(e){var r;return 0|(4294963200<(e|=0)>>>0?(r=0|vt(),St[r>>2]=0-e,-1):e)}function vt(){return 0|(0|St[2762]?0|St[16]:11092)}function He(){0}function Ue(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0,i|=0;var o,a,u,s,f,l,c,d,E,_,S,m,h,p,b,k,F,w,y,v,M,O,A,R,g,T,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0,U=0,z=0,Y=0,V=0,K=0,W=0,j=0,X=0,G=0,q=0,Q=0,Z=0,J=0,$=0,ee=0,re=0,te=0,ne=0,ie=0,oe=0,ae=0,ue=0,se=0,fe=0,le=0,ce=0,de=0,Ee=0,_e=0,Se=0,me=0,he=0,pe=0,be=0,ke=0,Fe=0,we=0,ye=0,ve=0,Me=0,Oe=0,Ae=0,Re=0,ge=0,Te=0,Ne=0,De=0,Pe=0,Ce=0,Ie=0,Le=0,xe=0,Be=0,He=0,Ue=0,ze=0,Ye=0,Ve=0,Ke=0,We=0,je=0,Xe=0,Ge=0,qe=0,Qe=0,Ze=0,Je=0,$e=0,er=0,rr=0,tr=0,nr=0,ir=0,or=0,ar=0,ur=0,sr=0,fr=0,lr=0,cr=0,dr=0,Er=0,_r=0,Sr=0,mr=0,hr=0,pr=0,br=0,kr=0,Fr=0,wr=0,yr=0,vr=0,Mr=0,Or=0,Ar=0,Rr=0,gr=0,Tr=0,Nr=0,Dr=0,Pr=0,Cr=0,Ir=0,Lr=0,xr=0,Br=0,Hr=0,Ur=0,zr=0,Yr=0,Vr=0,Kr=0,Wr=0,jr=0,Xr=0,Gr=0,qr=0,Qr=0,Zr=0,Jr=0,$r=0,et=0,rt=0,tt=0,nt=0,it=0,ot=0,at=0,ut=0,st=0,ft=0,lt=0,ct=0,dt=pt;(0|bt)<=(0|(pt=pt+624|0))&&yt(624),a=dt+16|0,d=(f=dt)+528|0,E=0!=(0|e),S=_=40+(l=dt+536|0)|0,m=39+l|0,l=4+(c=dt+8|0)|0,p=0-(h=u=dt+588|0)|0,k=11+(s=dt+576|0)|0,F=(s=b=12+s|0)-h|0,w=-2-h|0,y=2+s|0,v=288+(o=dt+24|0)|0,O=M=9+u|0,A=8+u|0,P=D=N=0,C=r;e:for(;;){do{if(-1<(0|D)){if((2147483647-D|0)<(0|N)){r=0|vt(),St[r>>2]=75,I=-1;break}I=N+D|0;break}}while(I=D,0);if(!((r=0|Et[C>>0])<<24>>24)){L=243;break}x=C,B=r;r:for(;;){switch(B<<24>>24){case 37:U=H=x,L=9;break r;case 0:Y=z=x;break r}B=0|Et[(x=r=x+1|0)>>0]}r:do{if(9==(0|L))for(;;){if(37!=((L=0)|Et[U+1>>0])){z=H,Y=U;break r}if(r=H+1|0,37!=(0|Et[(V=U+2|0)>>0])){z=r,Y=V;break}H=r,U=V,L=9}}while(0);if(V=z-C|0,E&&0==(32&St[e>>2]|0)&&Mt(C,V,e),0|V)N=V,D=I,C=Y;else{Q=(K=((r=0|Et[(V=Y+1|0)>>0])<<24>>24)-48|0)>>>0<10?(X=(W=36==(0|Et[Y+2>>0]))?K:-1,G=W?1:P,q=0|Et[(j=W?Y+3|0:V)>>0],j):(X=-1,G=P,q=r,V),V=(q<<24>>24)-32|0;r:do{if(V>>>0<32)for(r=0,j=V,W=q,K=Q;;){if(!(1<>24)-32|r,32<=(j=((te=0|Et[(re=K+1|0)>>0])<<24>>24)-32|0)>>>0){Z=ee,J=te,$=re;break}r=ee,W=te,K=re}else Z=0,J=q,$=Q}while(0);do{if(J<<24>>24!=42)if((V=(J<<24>>24)-48|0)>>>0<10){for(K=0,W=$,r=V;K=(10*K|0)+r|0,r=((ne=0|Et[(W=W+1|0)>>0])<<24>>24)-48|0,r>>>0<10;);if((0|K)<0){ie=-1;break e}oe=K,ae=Z,ue=G,se=W,fe=ne}else oe=0,ae=Z,ue=G,se=$,fe=J;else{if((j=((V=0|Et[(r=$+1|0)>>0])<<24>>24)-48|0)>>>0<10&&36==(0|Et[$+2>>0]))St[i+(j<<2)>>2]=10,le=0|St[n+((0|Et[r>>0])-48<<3)>>2],ce=1,de=$+3|0;else{if(0|G){ie=-1;break e}if(!E){ae=Z,ue=oe=0,se=r,fe=V;break}V=3+(0|St[t>>2])&-4,j=0|St[V>>2],St[t>>2]=V+4,le=j,ce=0,de=r}oe=(r=(0|le)<0)?0-le|0:le,ae=r?8192|Z:Z,ue=ce,fe=0|Et[(se=de)>>0]}}while(0);r:do{if(fe<<24>>24==46){if((j=0|Et[(r=se+1|0)>>0])<<24>>24!=42){if(!((V=(j<<24>>24)-48|0)>>>0<10)){me=0,he=r;break}for(Ee=0,_e=r,Se=V;;){if(r=(10*Ee|0)+Se|0,10<=(Se=(0|Et[(V=_e+1|0)>>0])-48|0)>>>0){me=r,he=V;break r}Ee=r,_e=V}}if((K=(0|Et[(W=se+2|0)>>0])-48|0)>>>0<10&&36==(0|Et[se+3>>0])){St[i+(K<<2)>>2]=10,me=0|St[n+((0|Et[W>>0])-48<<3)>>2],he=se+4|0;break}if(0|ue){ie=-1;break e}he=(me=E?(K=3+(0|St[t>>2])&-4,V=0|St[K>>2],St[t>>2]=K+4,V):0,W)}else me=-1,he=se}while(0);for(W=0,V=he;;){if(57<(K=(0|Et[V>>0])-65|0)>>>0){ie=-1;break e}if(pe=V+1|0,!(((ke=255&(be=0|Et[419+(58*W|0)+K>>0]))+-1|0)>>>0<8))break;W=ke,V=pe}if(!(be<<24>>24)){ie=-1;break}K=-1<(0|X);do{if(be<<24>>24==19){if(K){ie=-1;break e}L=51}else{if(K){St[i+(X<<2)>>2]=ke,j=0|St[(r=n+(X<<3)|0)+4>>2],St[(re=f)>>2]=St[r>>2],St[re+4>>2]=j,L=51;break}if(!E){ie=0;break e}Ot(f,ke,t)}}while(0);if(51!=(0|L)||(L=0,E)){j=0!=(0|W)&3==(15&(K=0|Et[V>>0])|0)?-33&K:K,K=-65537&ae,re=0==(8192&ae|0)?ae:K;r:do{switch(0|j){case 110:switch((255&W)<<24>>24){case 0:case 1:N=0,D=St[St[f>>2]>>2]=I,P=ue,C=pe;continue e;case 2:r=0|St[f>>2],St[r>>2]=I,St[r+4>>2]=((0|I)<0)<<31>>31,N=0,D=I,P=ue,C=pe;continue e;case 3:N=0,D=_t[St[f>>2]>>1]=I,P=ue,C=pe;continue e;case 4:N=0,D=Et[St[f>>2]>>0]=I,P=ue,C=pe;continue e;case 6:N=0,D=St[St[f>>2]>>2]=I,P=ue,C=pe;continue e;case 7:r=0|St[f>>2],St[r>>2]=I,St[r+4>>2]=((0|I)<0)<<31>>31,N=0,D=I,P=ue,C=pe;continue e;default:N=0,D=I,P=ue,C=pe;continue e}break;case 112:Fe=120,we=8>>0?me:8,ye=8|re,L=63;break;case 88:case 120:Fe=j,we=me,ye=re,L=63;break;case 111:if(0==(0|(te=0|St[(r=f)>>2]))&0==(0|(ee=0|St[r+4>>2])))ve=_;else for(r=_,Me=te,te=ee;;){if(Et[(ee=r+-1|0)>>0]=7&Me|48,0==(0|(Me=0|Ct(0|Me,0|te,3)))&0==(0|(te=Ft))){ve=ee;break}r=ee}L=(Te=(ge=8&re?(Re=899,((Ae=0)|(r=S-(Oe=ve)|0))<(0|me)?me:r+1|0):(Oe=ve,Ae=0,Re=899,me),re),76);break;case 105:case 100:if(te=0|St[(r=f)>>2],(0|(Me=0|St[r+4>>2]))<0){r=0|Nt(0,0,0|te,0|Me),ee=Ft,De=1,Pe=899,Ce=St[(Ne=f)>>2]=r,Ie=St[Ne+4>>2]=ee,L=75;break r}L=(Ie=(Ce=(Pe=2048&re?(De=1,900):0==(0|(De=ee=1&re))?899:901,te),Me),75);break;case 117:Pe=899,Ce=(De=0)|St[(Me=f)>>2],Ie=0|St[Me+4>>2],L=75;break;case 99:Et[m>>0]=St[f>>2],Le=m,xe=0,Be=899,He=_,Ue=1,ze=K;break;case 109:Me=0|vt(),Ye=0|function(e){e|=0;var r=0,t=0,n=0,i=0,o=0,a=0;r=0;for(;;){if((0|mt[953+r>>0])==(0|e)){t=2;break}if(87==(0|(n=r+1|0))){i=1041,o=87,t=5;break}r=n}2==(0|t)&&(r?(i=1041,o=r,t=5):a=1041);if(5==(0|t))for(;;){for(t=0,r=i;r=(e=r)+1|0,0!=(0|Et[e>>0]););if(!(o=o+-1|0)){a=r;break}i=r,t=5}return 0|a}(0|St[Me>>2]),L=81;break;case 115:Ye=0|(Me=0|St[f>>2])?Me:909,L=81;break;case 67:St[c>>2]=St[f>>2],St[l>>2]=0,Ve=-1,Ke=St[f>>2]=c,L=85;break;case 83:Me=0|St[f>>2],L=me?(Ve=me,Ke=Me,85):(gt(e,32,oe,0,re),We=0,96);break;case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:je=+ht[f>>3],St[a>>2]=0,ht[kt>>3]=je,qe=0<=(0|St[kt+4>>2])?(Me=1&re,2048&re?(Xe=je,Ge=1,919):(Xe=je,0==(0|(Ge=Me))?917:922)):(Xe=-je,Ge=1,916),ht[kt>>3]=Xe,Me=2146435072&St[kt+4>>2];do{if(Me>>>0<2146435072|2146435072==(0|Me)&!1){if((te=0!=(je=2*(T=a,+ + +function e(r,t){r=+r;t|=0;var n=0,i=0,o=0,a=0,u=0,s=0,f=0;ht[kt>>3]=r;n=0|St[kt>>2];i=0|St[kt+4>>2];o=0|Ct(0|n,0|i,52);switch(2047&o){case 0:s=0!=r?(a=+e(0x10000000000000000*r,t),u=a,(0|St[t>>2])-64|0):(u=r,0),St[t>>2]=s,f=u;break;case 2047:f=r;break;default:St[t>>2]=(2047&o)-1022,St[kt>>2]=n,St[kt+4>>2]=-2146435073&i|1071644672,f=+ht[kt>>3]}return+f}(+Xe,T|=0))))&&(St[a>>2]=(0|St[a>>2])-1),97==(0|(ee=32|j))){Ne=0==(0|(r=32&j))?qe:qe+9|0,Qe=2|Ge,Ze=12-me|0;do{if(!(11>>0|0==(0|Ze))){for(Je=8,$e=Ze;$e=$e+-1|0,Je*=16,0!=(0|$e););if(45==(0|Et[Ne>>0])){er=-(Je+(-je-Je));break}er=je+Je-Je;break}}while(er=je,0);for(tr=(0|(rr=0|At($e=(0|(Ze=0|St[a>>2]))<0?0-Ze|0:Ze,((0|$e)<0)<<31>>31,b)))==(0|b)?(Et[k>>0]=48,k):rr,Et[tr+-1>>0]=43+(Ze>>31&2),Et[(Ze=tr+-2|0)>>0]=j+15,rr=(0|me)<1,$e=0==(8&re|0),nr=u,ir=er;;){or=~~ir,ar=nr+1|0,Et[nr>>0]=mt[883+or>>0]|r,ir=16*(ir-(0|or));do{if(1==(ar-h|0)){if($e&rr&0==ir){ur=ar;break}Et[ar>>0]=46,ur=nr+2|0}else ur=ar}while(0);if(0==ir)break;nr=ur}rr=Ze,gt(e,32,oe,r=($e=0!=(0|me)&(w+(nr=ur)|0)<(0|me)?y+me-rr|0:F-rr+nr|0)+Qe|0,re),32&St[e>>2]||Mt(Ne,Qe,e),gt(e,48,oe,r,65536^re),ar=nr-h|0,32&St[e>>2]||Mt(u,ar,e),gt(e,48,$e-(ar+(nr=s-rr|0))|0,0,0),32&St[e>>2]||Mt(Ze,nr,e),gt(e,32,oe,r,8192^re),sr=(0|r)<(0|oe)?oe:r;break}for(r=(0|me)<0?6:me,lr=te?(nr=(0|St[a>>2])-28|0,fr=268435456*je,St[a>>2]=nr):(fr=je,0|St[a>>2]),nr=(0|lr)<0?o:v,ar=nr,ir=fr;$e=~~ir>>>0,St[ar>>2]=$e,ar=ar+4|0,ir=1e9*(ir-($e>>>0)),0!=ir;);if(0<(0|lr))for(te=nr,Ze=ar,Qe=lr;;){Ne=29<(0|Qe)?29:Qe,$e=Ze+-4|0;do{if($e>>>0>>0)cr=te;else{for(rr=$e,or=0;_r=0|xt(0|(Er=0|Dt(0|(dr=0|It(0|St[rr>>2],0,0|Ne)),0|Ft,0|or,0)),0|(dr=Ft),1e9,0),St[rr>>2]=_r,or=0|Lt(0|Er,0|dr,1e9,0),rr=rr+-4|0,te>>>0<=rr>>>0;);if(!or){cr=te;break}St[(rr=te+-4|0)>>2]=or,cr=rr}}while(0);for($e=Ze;!($e>>>0<=cr>>>0||0|St[(rr=$e+-4|0)>>2]);)$e=rr;if(rr=(0|St[a>>2])-Ne|0,!(0<(0|(St[a>>2]=rr)))){Sr=cr,mr=$e,hr=rr;break}te=cr,Ze=$e,Qe=rr}else Sr=nr,mr=ar,hr=lr;if((0|hr)<0)for(Qe=1+((r+25|0)/9|0)|0,Ze=102==(0|ee),te=Sr,rr=mr,dr=hr;;){_r=9<(0|(Er=0-dr|0))?9:Er;do{if(te>>>0>>0){for(Er=(1<<_r)-1|0,R=1e9>>>_r,pr=0,br=te;g=0|St[br>>2],St[br>>2]=(g>>>_r)+pr,pr=0|wt(g&Er,R),br=br+4|0,br>>>0>>0;);if(br=0==(0|St[te>>2])?te+4|0:te,!pr){kr=br,Fr=rr;break}St[rr>>2]=pr,kr=br,Fr=rr+4|0}else kr=0==(0|St[te>>2])?te+4|0:te,Fr=rr}while(0);if(Ne=(0|Qe)<(Fr-($e=Ze?nr:kr)>>2|0)?$e+(Qe<<2)|0:Fr,dr=(0|St[a>>2])+_r|0,0<=(0|(St[a>>2]=dr))){wr=kr,yr=Ne;break}te=kr,rr=Ne}else wr=Sr,yr=mr;rr=nr;do{if(wr>>>0>>0){if(te=9*(rr-wr>>2)|0,(dr=0|St[wr>>2])>>>0<10){vr=te;break}for(Mr=te,Or=10;;){if(te=Mr+1|0,dr>>>0<(Or=10*Or|0)>>>0){vr=te;break}Mr=te}}else vr=0}while(0);if((0|(te=r-(102!=(0|ee)?vr:0)+(((_r=0!=(0|r))&(dr=103==(0|ee)))<<31>>31)|0))<((9*(yr-rr>>2)|0)-9|0)){if(te=nr+4+(((0|(Qe=te+9216|0))/9|0)-1024<<2)|0,(0|(Ze=1+((0|Qe)%9|0)|0))<9)for(Qe=Ze,Ze=10;;){if(ar=10*Ze|0,9==(0|(Qe=Qe+1|0))){Ar=ar;break}Ze=ar}else Ar=10;Qe=((Ze=0|St[te>>2])>>>0)%(Ar>>>0)|0,ee=(te+4|0)==(0|yr);do{if(ee&0==(0|Qe))Rr=te,gr=vr,Tr=wr;else{ir=0==(1&((Ze>>>0)/(Ar>>>0)|0)|0)?9007199254740992:9007199254740994,Nr=Qe>>>0<(ar=(0|Ar)/2|0)>>>0?.5:ee&(0|Qe)==(0|ar)?1:1.5;do{if(Ge){if(45!=(0|Et[qe>>0])){Dr=Nr,Pr=ir;break}Dr=-Nr,Pr=-ir}else Dr=Nr,Pr=ir}while(0);if(ar=Ze-Qe|0,St[te>>2]=ar,Pr+Dr==Pr){Rr=te,gr=vr,Tr=wr;break}if(Ne=ar+Ar|0,999999999<(St[te>>2]=Ne)>>>0)for(Ne=te,ar=wr;;){if(Cr=($e=Ne+-4|0)>>>(St[Ne>>2]=0)>>0?(St[(br=ar+-4|0)>>2]=0,br):ar,br=1+(0|St[$e>>2])|0,!(999999999<(St[$e>>2]=br)>>>0)){Ir=$e,Lr=Cr;break}Ne=$e,ar=Cr}else Ir=te,Lr=wr;if(ar=9*(rr-Lr>>2)|0,(Ne=0|St[Lr>>2])>>>0<10){Rr=Ir,gr=ar,Tr=Lr;break}for(xr=ar,Br=10;;){if(ar=xr+1|0,Ne>>>0<(Br=10*Br|0)>>>0){Rr=Ir,gr=ar,Tr=Lr;break}xr=ar}}}while(0);Hr=gr,Ur=(te=Rr+4|0)>>>0>>0?te:yr,zr=Tr}else Hr=vr,Ur=yr,zr=wr;for(te=0-Hr|0,Qe=Ur;;){if(Qe>>>0<=zr>>>0){Yr=0;break}if(0|St[(Ze=Qe+-4|0)>>2]){Yr=1;break}Qe=Ze}do{if(dr){if(Kr=(0|Hr)<(0|(Ze=(1&_r^1)+r|0))&-5<(0|Hr)?(Vr=j+-1|0,Ze+-1-Hr|0):(Vr=j+-2|0,Ze+-1|0),0|(Ze=8&re)){Wr=Vr,jr=Kr,Xr=Ze;break}do{if(Yr){if(!(Ze=0|St[Qe+-4>>2])){Gr=9;break}if((Ze>>>0)%10|0){Gr=0;break}for(qr=0,Qr=10;;){if(ee=qr+1|0,(Ze>>>0)%((Qr=10*Qr|0)>>>0)|0){Gr=ee;break}qr=ee}}else Gr=9}while(0);if(Ze=(9*(Qe-rr>>2)|0)-9|0,102==(32|Vr)){Wr=Vr,jr=(0|Kr)<(0|(ee=(0|(pr=Ze-Gr|0))<0?0:pr))?Kr:ee,Xr=0;break}Wr=Vr,jr=(0|Kr)<(0|(Ze=(0|(ee=Ze+Hr-Gr|0))<0?0:ee))?Kr:Ze,Xr=0;break}}while(Wr=j,jr=r,Xr=8&re,0);if(rr=0!=(0|(r=jr|Xr))&1,_r=102==(32|Wr))Jr=(Zr=0)<(0|Hr)?Hr:0;else{if((s-(Ze=0|At(dr=(0|Hr)<0?te:Hr,((0|dr)<0)<<31>>31,b))|0)<2)for(dr=Ze;;){if(Et[(ee=dr+-1|0)>>0]=48,!((s-ee|0)<2)){$r=ee;break}dr=ee}else $r=Ze;Et[$r+-1>>0]=43+(Hr>>31&2),Et[(dr=$r+-2|0)>>0]=Wr,Jr=s-(Zr=dr)|0}gt(e,32,oe,dr=Ge+1+jr+rr+Jr|0,re),32&St[e>>2]||Mt(qe,Ge,e),gt(e,48,oe,dr,65536^re);do{if(_r){ee=te=nr>>>0>>0?nr:zr;do{pr=0|At(0|St[ee>>2],0,M);do{if((0|ee)==(0|te)){if((0|pr)!=(0|M)){et=pr;break}Et[A>>0]=48,et=A}else{if(pr>>>0<=u>>>0){et=pr;break}for(Pt(0|u,48,pr-h|0),Ne=pr;;){if(!(u>>>0<(ar=Ne+-1|0)>>>0)){et=ar;break}Ne=ar}}}while(0)}while(32&St[e>>2]||Mt(et,O-et|0,e),(ee=ee+4|0)>>>0<=nr>>>0);do{if(0|r){if(32&St[e>>2]|0)break;Mt(951,1,e)}}while(0);if(0<(0|jr)&ee>>>0>>0)for(te=jr,pr=ee;;){if(u>>>0<(Ne=0|At(0|St[pr>>2],0,M))>>>0)for(Pt(0|u,48,Ne-h|0),ar=Ne;;){if(!(u>>>0<($e=ar+-1|0)>>>0)){rt=$e;break}ar=$e}else rt=Ne;if(32&St[e>>2]||Mt(rt,9<(0|te)?9:te,e),ar=te+-9|0,!(9<(0|te)&(pr=pr+4|0)>>>0>>0)){tt=ar;break}te=ar}else tt=jr;gt(e,48,tt+9|0,9,0)}else{if(te=Yr?Qe:zr+4|0,-1<(0|jr))for(pr=0==(0|Xr),ee=jr,ar=zr;;){nt=(0|($e=0|At(0|St[ar>>2],0,M)))==(0|M)?(Et[A>>0]=48,A):$e;do{if((0|ar)==(0|zr)){if($e=nt+1|0,32&St[e>>2]||Mt(nt,1,e),pr&(0|ee)<1){it=$e;break}if(32&St[e>>2]|0){it=$e;break}Mt(951,1,e),it=$e}else{if(nt>>>0<=u>>>0){it=nt;break}for(Pt(0|u,48,nt+p|0),$e=nt;;){if(!(u>>>0<(br=$e+-1|0)>>>0)){it=br;break}$e=br}}}while(0);if(Ne=O-it|0,32&St[e>>2]||Mt(it,(0|Ne)<(0|ee)?Ne:ee,e),!((ar=ar+4|0)>>>0>>0&-1<(0|($e=ee-Ne|0)))){ot=$e;break}ee=$e}else ot=jr;if(gt(e,48,ot+18|0,18,0),32&St[e>>2]|0)break;Mt(Zr,s-Zr|0,e)}}while(0);gt(e,32,oe,dr,8192^re),sr=(0|dr)<(0|oe)?oe:dr}else Qe=0!=(32&j|0),gt(e,32,oe,_r=(nr=(r=Xe!=Xe|!1)?0:Ge)+3|0,K),32&(32&(rr=0|St[e>>2])?rr:(Mt(qe,nr,e),0|St[e>>2]))||Mt(r?Qe?943:947:Qe?935:939,3,e),gt(e,32,oe,_r,8192^re),sr=(0|_r)<(0|oe)?oe:_r}while(0);N=sr,D=I,P=ue,C=pe;continue e;default:Le=C,xe=0,Be=899,He=_,Ue=me,ze=re}}while(0);r:do{if(63==(0|L)){if(W=(L=0)|St[(j=f)>>2],V=0|St[j+4>>2],j=32&Fe,0==(0|W)&0==(0|V))at=_,st=ut=0;else{for(Me=_,_r=W,W=V;Et[(Me=Me+-1|0)>>0]=mt[883+(15&_r)>>0]|j,_r=0|Ct(0|_r,0|W,4),W=Ft,!(0==(0|_r)&0==(0|W)););at=Me,ut=0|St[(W=f)>>2],st=0|St[W+4>>2]}Oe=at,Ae=(W=0==(8&ye|0)|0==(0|ut)&0==(0|st))?0:2,Re=W?899:899+(Fe>>4)|0,ge=we,Te=ye,L=76}else if(75==(0|L))Oe=(L=0)|At(Ce,Ie,_),Ae=De,Re=Pe,ge=me,Te=re,L=76;else if(81==(0|L))Be=899,He=(_r=(xe=L=0)==(0|(W=0|Rt(Le=Ye,0,me))))?Ye+me|0:W,Ue=_r?me:W-Ye|0,ze=K;else if(85==(0|L)){for(W=Ke,j=_r=L=0;;){if(!(V=0|St[W>>2])){ft=_r,lt=j;break}if((0|(Qe=0|Tt(d,V)))<0|(Ve-_r|0)>>>0>>0){ft=_r,lt=Qe;break}if(!((V=Qe+_r|0)>>>0>>0)){ft=V,lt=Qe;break}W=W+4|0,_r=V,j=Qe}if((0|lt)<0){ie=-1;break e}if(gt(e,32,oe,ft,re),ft)for(j=Ke,_r=0;;){if(!(W=0|St[j>>2])){We=ft,L=96;break r}if((0|ft)<(0|(_r=(Me=0|Tt(d,W))+_r|0))){We=ft,L=96;break r}if(32&St[e>>2]||Mt(d,Me,e),ft>>>0<=_r>>>0){We=ft,L=96;break}j=j+4|0}else We=0,L=96}}while(0);C=(P=(D=(N=96!=(0|L)?(76==(0|L)&&(K=-1<((L=0)|ge)?-65537&Te:Te,ze=(Ue=0!=(0|ge)|(_r=0!=(0|St[(j=f)>>2])|0!=(0|St[j+4>>2]))?(xe=Ae,Be=Re,He=_,(0|(j=S-(Le=Oe)+(1&_r^1)|0))<(0|ge)?ge:j):(xe=Ae,Be=Re,He=Le=_,0),K)),gt(e,32,Me=(0|oe)<(0|(_r=(j=(0|Ue)<(0|(K=He-Le|0))?K:Ue)+xe|0))?_r:oe,_r,ze),32&St[e>>2]||Mt(Be,xe,e),gt(e,48,Me,_r,65536^ze),gt(e,48,j,K,0),32&St[e>>2]||Mt(Le,K,e),gt(e,32,Me,_r,8192^ze),Me):(L=0,gt(e,32,oe,We,8192^re),(0|We)<(0|oe)?oe:We),I),ue),pe)}else N=0,D=I,P=ue,C=pe}}e:do{if(243==(0|L))if(e)ie=I;else if(P){for(pe=1;;){if(!(C=0|St[i+(pe<<2)>>2])){ct=pe;break}if(Ot(n+(pe<<3)|0,C,t),10<=(0|(pe=pe+1|0))){ie=1;break e}}for(;;){if(0|St[i+(ct<<2)>>2]){ie=-1;break e}if(10<=(0|(ct=ct+1|0))){ie=1;break}}}else ie=0}while(0);return pt=dt,0|ie}function ze(){return 0}function Mt(e,r,t){e|=0,r|=0;var n,i,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0;(a=0|St[(o=(t|=0)+16|0)>>2])?(u=a,s=5):0|function(e){var r=0,t=0,n=0;t=0|Et[(r=74+(e|=0)|0)>>0],Et[r>>0]=255+t|t,n=8&(t=0|St[e>>2])?(St[e>>2]=32|t,-1):(St[e+8>>2]=0,St[e+4>>2]=0,r=0|St[e+44>>2],St[e+28>>2]=r,St[e+20>>2]=r,St[e+16>>2]=r+(0|St[e+48>>2]),0);return 0|n}(t)?f=0:(u=0|St[o>>2],s=5);e:do{if(5==(0|s)){if((u-(n=o=0|St[(a=t+20|0)>>2])|0)>>>0>>0){f=0|nr[15&St[t+36>>2]](t,e,r);break}r:do{if(-1<(0|Et[t+75>>0])){for(o=r;;){if(!o){l=r,c=e,d=0,E=n;break r}if(10==(0|Et[e+(i=o+-1|0)>>0]))break;o=i}if((0|nr[15&St[t+36>>2]](t,e,o))>>>0>>0){f=o;break e}l=r-o|0,c=e+o|0,d=o,E=0|St[a>>2]}else l=r,c=e,d=0,E=n}while(0);Je(0|E,0|c,0|l),St[a>>2]=(0|St[a>>2])+l,f=d+l|0}}while(0);return 0|f}function Ot(e,r,t){e|=0,r|=0,t|=0;var n,i=0,o=0,a=0,u=0;e:do{if(r>>>0<=20){switch(0|r){case 9:i=3+(0|St[t>>2])&-4,o=0|St[i>>2],St[t>>2]=i+4,St[e>>2]=o;break e;case 10:o=3+(0|St[t>>2])&-4,i=0|St[o>>2],St[t>>2]=o+4,St[(o=e)>>2]=i,St[o+4>>2]=((0|i)<0)<<31>>31;break e;case 11:i=3+(0|St[t>>2])&-4,o=0|St[i>>2],St[t>>2]=i+4,St[(i=e)>>2]=o,St[i+4>>2]=0;break e;case 12:i=7+(0|St[t>>2])&-8,n=0|St[(o=i)>>2],a=0|St[o+4>>2],St[t>>2]=i+8,St[(i=e)>>2]=n,St[i+4>>2]=a;break e;case 13:a=3+(0|St[t>>2])&-4,i=0|St[a>>2],St[t>>2]=a+4,a=(65535&i)<<16>>16,St[(i=e)>>2]=a,St[i+4>>2]=((0|a)<0)<<31>>31;break e;case 14:a=3+(0|St[t>>2])&-4,i=0|St[a>>2],St[t>>2]=a+4,St[(a=e)>>2]=65535&i,St[a+4>>2]=0;break e;case 15:a=3+(0|St[t>>2])&-4,i=0|St[a>>2],St[t>>2]=a+4,a=(255&i)<<24>>24,St[(i=e)>>2]=a,St[i+4>>2]=((0|a)<0)<<31>>31;break e;case 16:a=3+(0|St[t>>2])&-4,i=0|St[a>>2],St[t>>2]=a+4,St[(a=e)>>2]=255&i,St[a+4>>2]=0;break e;case 17:case 18:a=7+(0|St[t>>2])&-8,u=+ht[a>>3],St[t>>2]=a+8,ht[e>>3]=u;break e;default:break e}}}while(0)}function At(e,r,t){t|=0;var n=0,i=0,o=0,a=0,u=0,s=0;if(0<(r|=0)>>>0|0==(0|r)&4294967295<(e|=0)>>>0){for(n=t,i=e,o=r;r=0|xt(0|i,0|o,10,0),Et[(n=n+-1|0)>>0]=48|r,i=0|Lt(0|(r=i),0|o,10,0),9>>0|9==(0|o)&4294967295>>0;)o=Ft;a=i,u=n}else a=e,u=t;if(a)for(t=a,a=u;;){if(Et[(u=a+-1|0)>>0]=(t>>>0)%10|48,t>>>0<10){s=u;break}t=(t>>>0)/10|0,a=u}else s=u;return 0|s}function Rt(e,r,t){e|=0;var n,i,o,a,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=255&(r|=0),u=0!=(0|(t|=0));e:do{if(u&0!=(3&e|0))for(n=255&r,s=e,f=t;;){if((0|Et[s>>0])==n<<24>>24){l=s,c=f,d=6;break e}if(!((a=0!=(0|(o=f+-1|0)))&0!=(3&(i=s+1|0)|0))){E=i,_=o,S=a,d=5;break}s=i,f=o}else E=e,_=t,S=u,d=5}while(0);5==(0|d)&&(S?(l=E,c=_,d=6):(m=E,h=0));e:do{if(6==(0|d))if(E=255&r,(0|Et[l>>0])==E<<24>>24)m=l,h=c;else{_=0|wt(w,16843009);r:do{if(3>>0){for(S=l,u=c;!((-2139062144&(t=St[S>>2]^_)^-2139062144)&t+-16843009|0);){if(t=S+4|0,!(3<(e=u+-4|0)>>>0)){p=t,b=e,d=11;break r}S=t,u=e}k=S,F=u}else p=l,b=c,d=11}while(0);if(11==(0|d)){if(!b){m=p,h=0;break}k=p,F=b}for(;;){if((0|Et[k>>0])==E<<24>>24){m=k,h=F;break e}if(_=k+1|0,!(F=F+-1|0)){m=_,h=0;break}k=_}}}while(0);return 0|(0|h?m:0)}function gt(e,r,t,n,i){e|=0,r|=0,t|=0,n|=0,i|=0;var o,a,u,s,f=0,l=0,c=0,d=0,E=0,_=pt;(0|bt)<=(0|(pt=pt+256|0))&&yt(256),o=_;do{if((0|n)<(0|t)&0==(73728&i|0)){if(Pt(0|o,0|r,0|(256<(a=t-n|0)>>>0?256:a)),u=0==(32&(f=0|St[e>>2])|0),255>>0){for(s=t-n|0,l=a,c=f,f=u;f=0==(32&(d=f?(Mt(o,256,e),0|St[e>>2]):c)|0),!((l=l+-256|0)>>>0<=255);)c=d;if(!f)break;E=255&s}else{if(!u)break;E=a}Mt(o,E,e)}}while(0);pt=_}function Tt(e,r){r|=0;return 0|((e|=0)?0|function(e,r,t){e|=0,r|=0,t|=0;var n=0;do{if(e){if(r>>>0<128){Et[e>>0]=r,n=1;break}if(r>>>0<2048){Et[e>>0]=r>>>6|192,Et[e+1>>0]=63&r|128,n=2;break}if(r>>>0<55296|57344==(-8192&r|0)){Et[e>>0]=r>>>12|224,Et[e+1>>0]=r>>>6&63|128,Et[e+2>>0]=63&r|128,n=3;break}if((r+-65536|0)>>>0<1048576){Et[e>>0]=r>>>18|240,Et[e+1>>0]=r>>>12&63|128,Et[e+2>>0]=r>>>6&63|128,Et[e+3>>0]=63&r|128,n=4;break}t=0|vt(),St[t>>2]=84,n=-1;break}}while(n=1,0);return 0|n}(e,r,0):0)}function Ye(e,r){var t=0|function(e,r){e|=0;var t=0,n=0,i=0,o=0,a=0,u=0,s=0,f=0,l=0;t=255&(r|=0);e:do{if(t){if(3&e)for(o=255&r,a=e;;){if((u=0|Et[a>>0])<<24>>24==0||u<<24>>24==o<<24>>24){n=a;break e}if(!(3&(u=a+1|0))){i=u;break}a=u}else i=e;a=0|wt(t,16843009),o=0|St[i>>2];r:do{if((-2139062144&o^-2139062144)&o+-16843009)l=i;else for(u=i,s=o;;){if((-2139062144&(f=s^a)^-2139062144)&f-16843009|0){l=u;break r}if((-2139062144&(s=0|St[(f=u+4|0)>>2])^-2139062144)&s+-16843009|0){l=f;break}u=f}}while(0);for(a=255&r,o=l;;){if((u=0|Et[o>>0])<<24>>24==0||u<<24>>24==a<<24>>24){n=o;break}o=o+1|0}}else n=e+(0|function(e){var r,t=0,n=0,i=0,o=0,a=0,u=0,s=0,f=0,t=e|=0;r:do{if(3&t)for(o=e,a=t;;){if(!(0|Et[o>>0])){u=a;break r}if(!(3&(a=r=o+1|0))){n=r,i=4;break}o=r}else n=e,i=4}while(0);if(4==(0|i)){for(i=n;!((-2139062144&(s=0|St[i>>2])^-2139062144)&s+-16843009);)i=i+4|0;if((255&s)<<24>>24)for(s=i;;){if(!(0|Et[(i=s+1|0)>>0])){f=i;break}s=i}else f=i;u=f}return u-t|0}(e))|0}while(0);return 0|n}(e|=0,r|=0);return 0|((0|Et[t>>0])==(255&r)<<24>>24?t:0)}function Ve(e){e|=0;var r=0,t=0,n=0,i=0,o=0,a=0,u=0;do{if(e){if((0|St[e+76>>2])<=-1){r=0|Ke(e);break}r=((t=!0)||He(),n=0|Ke(e))}else{if(i=0|St[34]?0|Ve(0|St[34]):0,H(11076),n=0|St[2768])for(t=n,n=i;;){if(a=(St[t+76>>2],0),u=(0|St[t+20>>2])>>>0>(0|St[t+28>>2])>>>0?0|Ke(t)|n:n,0|a&&He(),!(t=0|St[t+56>>2])){o=u;break}n=u}else o=i;V(11076),r=o}}while(0);return 0|r}function Ke(e){var r,t,n,i,o=0,a=(e|=0)+28|0;return 0|((0|St[(o=e+20|0)>>2])>>>0>(0|St[a>>2])>>>0&&(nr[15&St[e+36>>2]](e,0,0),0==(0|St[o>>2]))?-1:((t=0|St[(r=e+4|0)>>2])>>>0<(i=0|St[(n=e+8|0)>>2])>>>0&&nr[15&St[e+40>>2]](e,t-i|0,1),St[e+16>>2]=0,St[a>>2]=0,St[o>>2]=0,St[n>>2]=0,St[r>>2]=0))}function We(e,r,t){e|=0,r|=0;var n=0,n=1==(0|(t|=0))?r-(0|St[e+8>>2])+(0|St[e+4>>2])|0:r,i=e+28|0;return 0|((0|St[(r=e+20|0)>>2])>>>0>(0|St[i>>2])>>>0&&(nr[15&St[e+36>>2]](e,0,0),0==(0|St[r>>2]))?-1:(St[e+16>>2]=0,St[i>>2]=0,((St[r>>2]=0)|nr[15&St[e+40>>2]](e,n,t))<0?-1:(St[e+8>>2]=0,St[e+4>>2]=0,St[e>>2]=-17&St[e>>2],0)))}function je(e){var r=0,t=0,r=128&St[(e|=0)>>2]&&(0|St[e+20>>2])>>>0>(0|St[e+28>>2])>>>0?2:1;return 0|((0|(t=0|nr[15&St[e+40>>2]](e,0,r)))<0?t:t-(0|St[e+8>>2])+(0|St[e+4>>2])+(0|St[e+20>>2])-(0|St[e+28>>2])|0)}function Xe(e){e|=0;var r,t=0,n=0,i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0,U=0,z=0,Y=0,V=0,K=0,W=0,j=0,X=0,G=0,q=0,Q=0,Z=0,J=0,$=0,ee=0,re=0,te=0,ne=0,ie=0,oe=0,ae=0,ue=0,se=0,fe=0,le=0,ce=0,de=0,Ee=0,_e=0,Se=0,me=0,he=0,pe=0,be=0,ke=0,Fe=0,we=0,ye=0,ve=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),t=ve;do{if(e>>>0<245){if(i=(n=e>>>0<11?16:e+11&-8)>>>3,3&(a=(o=0|St[2774])>>>i)|0){l=0|St[(f=(s=11136+((u=(1&a^1)+i|0)<<1<<2)|0)+8|0)>>2],d=0|St[(c=l+8|0)>>2];do{if((0|s)!=(0|d)){if(d>>>0<(0|St[2778])>>>0&&Me(),(0|St[(E=d+12|0)>>2])==(0|l)){St[E>>2]=s,St[f>>2]=d;break}Me()}else St[2774]=o&~(1<>2]=3|d,St[(f=l+d+4|0)>>2]=1|St[f>>2],pt=ve,0|(_=c)}if((f=0|St[2776])>>>0>>0){if(0|a){S=0|St[(h=(m=11136+((p=((d=(E=(d=((s=a<>>(s=d>>>12&16))>>>5&8)|s|(E=(S=E>>>d)>>>2&4)|(S=(m=S>>>E)>>>1&2)|(m=(h=m>>>S)>>>1&1))+(h>>>m)|0)<<1<<2)|0)+8|0)>>2],s=0|St[(E=S+8|0)>>2];do{if((0|m)!=(0|s)){if(s>>>0<(0|St[2778])>>>0&&Me(),(0|St[(d=s+12|0)>>2])==(0|S)){St[d>>2]=m,St[h>>2]=s,b=o;break}Me()}else d=o&~(1<>2]=3|n,St[(h=S+n|0)+4>>2]=1|s,St[h+s>>2]=s,0|f&&(m=0|St[2779],a=11136+((i=f>>>3)<<1<<2)|0,b&(c=1<>2])>>>0<(0|St[2778])>>>0?Me():(k=l,F=i):(St[2774]=b|c,F=(k=a)+8|0),St[F>>2]=m,St[k+12>>2]=m,St[m+8>>2]=k,St[m+12>>2]=a),St[2776]=s,St[2779]=h,pt=ve,0|(_=E)}if(h=0|St[2775]){for(u=0|St[11400+(((s=(m=(s=(h&0-h)-1|0)>>>(a=s>>>12&16))>>>5&8)|a|(m=(c=m>>>s)>>>2&4)|(c=(i=c>>>m)>>>1&2)|(i=(l=i>>>c)>>>1&1))+(l>>>i)<<2)>>2],c=(-8&St[(l=i=u)+4>>2])-n|0;;){if(u=0|St[i+16>>2])w=u;else{if(!(m=0|St[i+20>>2]))break;w=m}l=(m=(u=(-8&St[(i=w)+4>>2])-n|0)>>>0>>0)?w:l,c=m?u:c}l>>>0<(i=0|St[2778])>>>0&&Me(),(E=l+n|0)>>>0<=l>>>0&&Me(),S=0|St[l+24>>2],p=0|St[l+12>>2];do{if((0|p)==(0|l)){if(m=0|St[(u=l+20|0)>>2])v=m,M=u;else{if(!(s=0|St[(a=l+16|0)>>2])){y=0;break}v=s,M=a}for(;;)if(0|(m=0|St[(u=v+20|0)>>2]))v=m,M=u;else{if(!(m=0|St[(u=v+16|0)>>2]))break;v=m,M=u}if(!(M>>>0>>0)){St[M>>2]=0,y=v;break}Me()}else{if((u=0|St[l+8>>2])>>>0>>0&&Me(),(0|St[(m=u+12|0)>>2])!=(0|l)&&Me(),(0|St[(a=p+8|0)>>2])==(0|l)){St[m>>2]=p,St[a>>2]=u,y=p;break}Me()}}while(0);do{if(0|S){if(p=0|St[l+28>>2],(0|l)==(0|St[(i=11400+(p<<2)|0)>>2])){if(!(St[i>>2]=y)){St[2775]=h&~(1<>>0<(0|St[2778])>>>0&&Me(),(0|St[(p=S+16|0)>>2])==(0|l)?St[p>>2]=y:St[S+20>>2]=y,!y)break;y>>>0<(p=0|St[2778])>>>0&&Me(),St[y+24>>2]=S,i=0|St[l+16>>2];do{if(0|i){if(!(i>>>0

>>0)){St[y+16>>2]=i,St[i+24>>2]=y;break}Me()}}while(0);if(0|(i=0|St[l+20>>2])){if(!(i>>>0<(0|St[2778])>>>0)){St[y+20>>2]=i,St[i+24>>2]=y;break}Me()}}}while(0);return c>>>0<16?(S=c+n|0,St[l+4>>2]=3|S,St[(h=l+S+4|0)>>2]=1|St[h>>2]):(St[l+4>>2]=3|n,St[E+4>>2]=1|c,St[E+c>>2]=c,0|f&&(h=0|St[2779],i=11136+((S=f>>>3)<<1<<2)|0,o&(p=1<>2])>>>0<(0|St[2778])>>>0?Me():(O=u,A=S):(St[2774]=o|p,A=(O=i)+8|0),St[A>>2]=h,St[O+12>>2]=h,St[h+8>>2]=O,St[h+12>>2]=i),St[2776]=c,St[2779]=E),pt=ve,0|(_=l+8|0)}R=n}else R=n}else if(e>>>0<=4294967231)if(h=-8&(i=e+11|0),p=0|St[2775]){S=0-h|0,g=(u=i>>>8)?16777215>>0?31:h>>>((s=14-((u=((a=u<<(i=(u+1048320|0)>>>16&8))+520192|0)>>>16&4)|i|(a=((m=a<>>16&2))+(m<>>15)|0)+7|0)&1|s<<1:0,s=0|St[11400+(g<<2)>>2];e:do{if(s)for(m=S,i=s,u=h<<(31==((a=0)|g)?0:25-(g>>>1)|0),d=0;;){if((C=(-8&St[i+4>>2])-h|0)>>>0>>0){if(!C){L=0,x=I=i,P=90;break e}B=i,H=C}else B=a,H=m;if(r=0==(0|(C=0|St[i+20>>2]))|(0|C)==(0|(i=0|St[i+16+(u>>>31<<2)>>2]))?d:C,C=0==(0|i)){T=r,N=B,D=H,P=86;break}a=B,m=H,u<<=1&C^1,d=r}else N=T=0,D=S,P=86}while(0);if(86==(0|P)){if(0==(0|T)&0==(0|N)){if(!(S=p&((s=2<>>(S=s>>>12&16))>>>5&8)|S|(n=(l=n>>>s)>>>2&4)|(l=(E=l>>>n)>>>1&2)|(E=(c=E>>>l)>>>1&1))+(c>>>E)<<2)>>2]}else U=T;U?(I=N,L=D,x=U,P=90):(z=N,Y=D)}if(90==(0|P))for(;;)if(P=0,l=(c=(E=(-8&St[x+4>>2])-h|0)>>>0>>0)?E:L,E=c?x:I,0|(c=0|St[x+16>>2]))I=E,L=l,x=c,P=90;else{if(!(x=0|St[x+20>>2])){z=E,Y=l;break}I=E,L=l,P=90}if(0!=(0|z)&&Y>>>0<((0|St[2776])-h|0)>>>0){z>>>0<(l=0|St[2778])>>>0&&Me(),(E=z+h|0)>>>0<=z>>>0&&Me(),c=0|St[z+24>>2],n=0|St[z+12>>2];do{if((0|n)==(0|z)){if(s=0|St[(S=z+20|0)>>2])K=s,W=S;else{if(!(f=0|St[(o=z+16|0)>>2])){V=0;break}K=f,W=o}for(;;)if(0|(s=0|St[(S=K+20|0)>>2]))K=s,W=S;else{if(!(s=0|St[(S=K+16|0)>>2]))break;K=s,W=S}if(!(W>>>0>>0)){St[W>>2]=0,V=K;break}Me()}else{if((S=0|St[z+8>>2])>>>0>>0&&Me(),(0|St[(s=S+12|0)>>2])!=(0|z)&&Me(),(0|St[(o=n+8|0)>>2])==(0|z)){St[s>>2]=n,St[o>>2]=S,V=n;break}Me()}}while(0);do{if(c){if(n=0|St[z+28>>2],(0|z)==(0|St[(l=11400+(n<<2)|0)>>2])){if(!(St[l>>2]=V)){l=p&~(1<>>0<(0|St[2778])>>>0&&Me(),(0|St[(l=c+16|0)>>2])==(0|z)?St[l>>2]=V:St[c+20>>2]=V,!V){j=p;break}V>>>0<(l=0|St[2778])>>>0&&Me(),St[V+24>>2]=c,n=0|St[z+16>>2];do{if(0|n){if(!(n>>>0>>0)){St[V+16>>2]=n,St[n+24>>2]=V;break}Me()}}while(0);if(n=0|St[z+20>>2]){if(!(n>>>0<(0|St[2778])>>>0)){St[V+20>>2]=n,St[n+24>>2]=V,j=p;break}Me()}else j=p}else j=p}while(0);do{if(16<=Y>>>0){if(St[z+4>>2]=3|h,St[E+4>>2]=1|Y,p=(St[E+Y>>2]=Y)>>>3,Y>>>0<256){c=11136+(p<<1<<2)|0,(n=0|St[2774])&(l=1<>2])>>>0<(0|St[2778])>>>0?Me():(X=S,G=p):(St[2774]=n|l,G=(X=c)+8|0),St[G>>2]=E,St[X+12>>2]=E,St[E+8>>2]=X,St[E+12>>2]=c;break}if(S=11400+((q=(c=Y>>>8)?16777215>>0?31:Y>>>((S=14-((c=((n=c<<(l=(c+1048320|0)>>>16&8))+520192|0)>>>16&4)|l|(n=((p=n<>>16&2))+(p<>>15)|0)+7|0)&1|S<<1:0)<<2)|0,St[E+28>>2]=q,St[(n=E+16|0)+4>>2]=0,St[n>>2]=0,!(j&(n=1<>2]=E,St[E+24>>2]=S,St[E+12>>2]=E,St[E+8>>2]=E;break}for(n=Y<<(31==(0|q)?0:25-(q>>>1)|0),p=0|St[S>>2];;){if((-8&St[p+4>>2]|0)==(0|Y)){P=148;break}if(!(S=0|St[(Q=p+16+(n>>>31<<2)|0)>>2])){P=145;break}n<<=1,p=S}if(145==(0|P)){if(!(Q>>>0<(0|St[2778])>>>0)){St[Q>>2]=E,St[E+24>>2]=p,St[E+12>>2]=E,St[E+8>>2]=E;break}Me()}else if(148==(0|P)){if(S=0|St[(n=p+8|0)>>2],(l=0|St[2778])>>>0<=S>>>0&l>>>0<=p>>>0){St[S+12>>2]=E,St[n>>2]=E,St[E+8>>2]=S,St[E+12>>2]=p,St[E+24>>2]=0;break}Me()}}else S=Y+h|0,St[z+4>>2]=3|S,St[(n=z+S+4|0)>>2]=1|St[n>>2]}while(0);return pt=ve,0|(_=z+8|0)}R=h}else R=h;else R=-1}while(0);if(R>>>0<=(z=0|St[2776])>>>0)return Y=z-R|0,Q=0|St[2779],15>>0?(q=Q+R|0,St[2779]=q,St[2776]=Y,St[q+4>>2]=1|Y,St[q+Y>>2]=Y,St[Q+4>>2]=3|R):(St[2776]=0,St[2779]=0,St[Q+4>>2]=3|z,St[(Y=Q+z+4|0)>>2]=1|St[Y>>2]),pt=ve,0|(_=Q+8|0);if(R>>>0<(Q=0|St[2777])>>>0)return Y=Q-R|0,St[2777]=Y,q=(z=0|St[2780])+R|0,St[2780]=q,St[q+4>>2]=1|Y,St[z+4>>2]=3|R,pt=ve,0|(_=z+8|0);if(Z=0|St[2892]?0|St[2894]:(St[2894]=4096,St[2893]=4096,St[2895]=-1,St[2896]=-1,St[2897]=0,St[2885]=0,z=-16&t^1431655768,St[t>>2]=z,St[2892]=z,4096),z=R+48|0,(Z=(Y=Z+(t=R+47|0)|0)&(q=0-Z|0))>>>0<=R>>>0)return pt=ve,(_=0)|_;if(0|(j=0|St[2884])&&(G=(X=0|St[2882])+Z|0)>>>0<=X>>>0|j>>>0>>0)return pt=ve,(_=0)|_;e:do{if(4&St[2885])P=187;else{j=0|St[2780];r:do{if(j){for(G=11544;!((X=0|St[G>>2])>>>0<=j>>>0&&(X+(0|St[(J=G+4|0)>>2])|0)>>>0>j>>>0);){if(!(X=0|St[G+8>>2])){P=172;break r}G=X}if((p=Y-Q&q)>>>0<2147483647)if((0|(X=0|Ze(0|p)))==((0|St[G>>2])+(0|St[J>>2])|0)){if(-1!=(0|X)){$=p,ee=X,P=190;break e}}else re=X,te=p,P=180}else P=172}while(0);do{if(172==(0|P)&&-1!=(0|(j=0|Ze(0)))&&(h=j,p=(V=(0==((X=(p=0|St[2893])+-1|0)&h|0)?0:(X+h&0-p)-h|0)+Z|0)+(h=0|St[2882])|0,R>>>0>>0&V>>>0<2147483647)){if(0|(X=0|St[2884])&&p>>>0<=h>>>0|X>>>0

>>0)break;if((0|(X=0|Ze(0|V)))==(0|j)){$=V,ee=j,P=190;break e}re=X,te=V,P=180}}while(0);r:do{if(180==(0|P)){V=0-te|0;do{if(te>>>0>>0&te>>>0<2147483647&-1!=(0|re)&&(j=t-te+(X=0|St[2894])&0-X)>>>0<2147483647){if(-1==(0|Ze(0|j))){Ze(0|V);break r}ne=j+te|0;break}}while(ne=te,0);if(-1!=(0|re)){$=ne,ee=re,P=190;break e}}}while(0);St[2885]=4|St[2885],P=187}}while(0);if(187==(0|P)&&Z>>>0<2147483647&&(re=0|Ze(0|Z))>>>0<(Z=0|Ze(0))>>>0&-1!=(0|re)&-1!=(0|Z)&&(R+40|0)>>>0<(ne=Z-re|0)>>>0&&($=ne,ee=re,P=190),190==(0|P)){re=(0|St[2882])+$|0,(St[2882]=re)>>>0>(0|St[2883])>>>0&&(St[2883]=re),re=0|St[2780];do{if(re){for(ne=11544;;){if((0|ee)==((ie=0|St[ne>>2])+(ae=0|St[(oe=ne+4|0)>>2])|0)){P=200;break}if(!(Z=0|St[ne+8>>2]))break;ne=Z}if(200==(0|P)&&0==(8&St[ne+12>>2]|0)&&re>>>0>>0&ie>>>0<=re>>>0){St[oe>>2]=ae+$,Z=re+(te=0==(7&(Z=re+8|0)|0)?0:0-Z&7)|0,t=$-te+(0|St[2777])|0,St[2780]=Z,St[2777]=t,St[Z+4>>2]=1|t,St[Z+t+4>>2]=40,St[2781]=St[2896];break}for(ue=ee>>>0<(t=0|St[2778])>>>0?St[2778]=ee:t,t=ee+$|0,Z=11544;;){if((0|St[Z>>2])==(0|t)){P=208;break}if(!(te=0|St[Z+8>>2])){se=11544;break}Z=te}if(208==(0|P)){if(!(8&St[Z+12>>2])){St[Z>>2]=ee,St[(ne=Z+4|0)>>2]=(0|St[ne>>2])+$,te=ee+(0==(7&(ne=ee+8|0)|0)?0:0-ne&7)|0,z=t+(0==(7&(ne=t+8|0)|0)?0:0-ne&7)|0,ne=te+R|0,J=z-te-R|0,St[te+4>>2]=3|R;do{if((0|z)!=(0|re)){if((0|z)==(0|St[2779])){q=(0|St[2776])+J|0,St[2776]=q,St[2779]=ne,St[ne+4>>2]=1|q,St[ne+q>>2]=q;break}if(1==(3&(q=0|St[z+4>>2])|0)){Q=-8&q,Y=q>>>3;e:do{if(256<=q>>>0){V=0|St[z+24>>2],G=0|St[z+12>>2];do{if((0|G)==(0|z)){if(p=0|St[(X=(j=z+16|0)+4|0)>>2])le=p,ce=X;else{if(!(h=0|St[j>>2])){fe=0;break}le=h,ce=j}for(;;)if(0|(p=0|St[(X=le+20|0)>>2]))le=p,ce=X;else{if(!(p=0|St[(X=le+16|0)>>2]))break;le=p,ce=X}if(!(ce>>>0>>0)){St[ce>>2]=0,fe=le;break}Me()}else{if((X=0|St[z+8>>2])>>>0>>0&&Me(),(0|St[(p=X+12|0)>>2])!=(0|z)&&Me(),(0|St[(j=G+8|0)>>2])==(0|z)){St[p>>2]=G,St[j>>2]=X,fe=G;break}Me()}}while(0);if(!V)break;X=11400+((G=0|St[z+28>>2])<<2)|0;do{if((0|z)==(0|St[X>>2])){if(0|(St[X>>2]=fe))break;St[2775]=St[2775]&~(1<>>0<(0|St[2778])>>>0&&Me(),(0|St[(j=V+16|0)>>2])==(0|z)?St[j>>2]=fe:St[V+20>>2]=fe,!fe)break e}while(0);fe>>>0<(G=0|St[2778])>>>0&&Me(),St[fe+24>>2]=V,j=0|St[(X=z+16|0)>>2];do{if(0|j){if(!(j>>>0>>0)){St[fe+16>>2]=j,St[j+24>>2]=fe;break}Me()}}while(0);if(!(j=0|St[X+4>>2]))break;if(!(j>>>0<(0|St[2778])>>>0)){St[fe+20>>2]=j,St[j+24>>2]=fe;break}Me()}else{j=0|St[z+8>>2],G=0|St[z+12>>2],V=11136+(Y<<1<<2)|0;do{if((0|j)!=(0|V)){if(j>>>0>>0&&Me(),(0|St[j+12>>2])==(0|z))break;Me()}}while(0);if((0|G)==(0|j)){St[2774]=St[2774]&~(1<>>0>>0&&Me(),(0|St[(X=G+8|0)>>2])==(0|z)){de=X;break}Me()}}while(0);St[j+12>>2]=G,St[de>>2]=j}}while(0);Ee=z+Q|0,_e=Q+J|0}else Ee=z,_e=J;if(St[(Y=Ee+4|0)>>2]=-2&St[Y>>2],St[ne+4>>2]=1|_e,Y=(St[ne+_e>>2]=_e)>>>3,_e>>>0<256){q=11136+(Y<<1<<2)|0,V=0|St[2774],X=1<>2])>>>0>=(0|St[2778])>>>0){Se=p,me=Y;break}Me()}else St[2774]=V|X,me=(Se=q)+8|0}while(0);St[me>>2]=ne,St[Se+12>>2]=ne,St[ne+8>>2]=Se,St[ne+12>>2]=q;break}X=_e>>>8;do{if(X){if(16777215<_e>>>0){he=31;break}he=_e>>>((h=14-((Y=((Q=X<<(V=(X+1048320|0)>>>16&8))+520192|0)>>>16&4)|V|(Q=((p=Q<>>16&2))+(p<>>15)|0)+7|0)&1|h<<1}else he=0}while(0);if(X=11400+(he<<2)|0,St[ne+28>>2]=he,St[(q=ne+16|0)+4>>2]=0,!((q=(St[q>>2]=0)|St[2775])&(h=1<>2]=ne,St[ne+24>>2]=X,St[ne+12>>2]=ne,St[ne+8>>2]=ne;break}for(h=_e<<(31==(0|he)?0:25-(he>>>1)|0),q=0|St[X>>2];;){if((-8&St[q+4>>2]|0)==(0|_e)){P=278;break}if(!(X=0|St[(pe=q+16+(h>>>31<<2)|0)>>2])){P=275;break}h<<=1,q=X}if(275==(0|P)){if(!(pe>>>0<(0|St[2778])>>>0)){St[pe>>2]=ne,St[ne+24>>2]=q,St[ne+12>>2]=ne,St[ne+8>>2]=ne;break}Me()}else if(278==(0|P)){if(X=0|St[(h=q+8|0)>>2],(Q=0|St[2778])>>>0<=X>>>0&Q>>>0<=q>>>0){St[X+12>>2]=ne,St[h>>2]=ne,St[ne+8>>2]=X,St[ne+12>>2]=q,St[ne+24>>2]=0;break}Me()}}else X=(0|St[2777])+J|0,St[2777]=X,St[2780]=ne,St[ne+4>>2]=1|X}while(0);return pt=ve,0|(_=te+8|0)}se=11544}for(;!((ne=0|St[se>>2])>>>0<=re>>>0&&re>>>0<(be=ne+(0|St[se+4>>2])|0)>>>0);)se=0|St[se+8>>2];for(te=be+-47|0,ne=te+8|0,J=te+(0==(7&ne|0)?0:0-ne&7)|0,ne=re+16|0,te=J>>>0>>0?re:J,J=te+8|0,z=ee+8|0,t=0==(7&z|0)?0:0-z&7,z=ee+t|0,Z=$+-40-t|0,St[2780]=z,St[2777]=Z,St[z+4>>2]=1|Z,St[z+Z+4>>2]=40,St[2781]=St[2896],Z=te+4|0,St[Z>>2]=27,St[J>>2]=St[2886],St[J+4>>2]=St[2887],St[J+8>>2]=St[2888],St[J+12>>2]=St[2889],St[2886]=ee,St[2887]=$,St[2889]=0,St[2888]=J,J=te+24|0;St[(J=J+4|0)>>2]=7,(J+4|0)>>>0>>0;);if((0|te)!=(0|re)){if(J=te-re|0,St[Z>>2]=-2&St[Z>>2],St[re+4>>2]=1|J,z=(St[te>>2]=J)>>>3,J>>>0<256){t=11136+(z<<1<<2)|0,(X=0|St[2774])&(h=1<>2])>>>0<(0|St[2778])>>>0?Me():(ke=Q,Fe=z):(St[2774]=X|h,Fe=(ke=t)+8|0),St[Fe>>2]=re,St[ke+12>>2]=re,St[re+8>>2]=ke,St[re+12>>2]=t;break}if(Q=11400+((we=(t=J>>>8)?16777215>>0?31:J>>>((Q=14-((t=((X=t<<(h=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|h|(X=((z=X<>>16&2))+(z<>>15)|0)+7|0)&1|Q<<1:0)<<2)|0,St[re+28>>2]=we,St[re+20>>2]=0,!((X=(St[ne>>2]=0)|St[2775])&(z=1<>2]=re,St[re+24>>2]=Q,St[re+12>>2]=re,St[re+8>>2]=re;break}for(z=J<<(31==(0|we)?0:25-(we>>>1)|0),X=0|St[Q>>2];;){if((-8&St[X+4>>2]|0)==(0|J)){P=304;break}if(!(Q=0|St[(ye=X+16+(z>>>31<<2)|0)>>2])){P=301;break}z<<=1,X=Q}if(301==(0|P)){if(!(ye>>>0<(0|St[2778])>>>0)){St[ye>>2]=re,St[re+24>>2]=X,St[re+12>>2]=re,St[re+8>>2]=re;break}Me()}else if(304==(0|P)){if(J=0|St[(z=X+8|0)>>2],(ne=0|St[2778])>>>0<=J>>>0&ne>>>0<=X>>>0){St[J+12>>2]=re,St[z>>2]=re,St[re+8>>2]=J,St[re+12>>2]=X,St[re+24>>2]=0;break}Me()}}}else{for(J=0|St[2778],0==(0|J)|ee>>>0>>0&&(St[2778]=ee),St[2886]=ee,St[2887]=$,St[2889]=0,St[2783]=St[2892],St[2782]=-1,J=0;St[(z=11136+(J<<1<<2)|0)+12>>2]=z,St[z+8>>2]=z,J=J+1|0,32!=(0|J););J=ee+(X=0==(7&(J=ee+8|0)|0)?0:0-J&7)|0,z=$+-40-X|0,St[2780]=J,St[2777]=z,St[J+4>>2]=1|z,St[J+z+4>>2]=40,St[2781]=St[2896]}}while(0);if(R>>>0<($=0|St[2777])>>>0)return ee=$-R|0,St[2777]=ee,re=($=0|St[2780])+R|0,St[2780]=re,St[re+4>>2]=1|ee,St[$+4>>2]=3|R,pt=ve,0|(_=$+8|0)}return $=0|vt(),St[$>>2]=12,pt=ve,(_=0)|_}function Ge(e){var r,t,n=0,i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0;if(e|=0){(n=e+-8|0)>>>0<(i=0|St[2778])>>>0&&Me(),1==(0|(e=3&(o=0|St[e+-4>>2])))&&Me(),r=n+(a=-8&o)|0;do{if(1&o)d=n,E=a;else{if(u=0|St[n>>2],!e)return;if(f=u+a|0,(s=n+(0-u)|0)>>>0>>0&&Me(),(0|s)==(0|St[2779])){if(3==(3&(c=0|St[(l=4+r|0)>>2])|0))return St[2776]=f,St[l>>2]=-2&c,St[s+4>>2]=1|f,void(St[s+f>>2]=f);d=s,E=f;break}if(c=u>>>3,u>>>0<256){if(u=0|St[s+8>>2],l=0|St[s+12>>2],(0|u)!=(0|(_=11136+(c<<1<<2)|0))&&(u>>>0>>0&&Me(),(0|St[u+12>>2])!=(0|s)&&Me()),(0|l)==(0|u)){St[2774]=St[2774]&~(1<>>0>>0&&Me(),(0|St[(_=l+8|0)>>2])==(0|s)?S=_:Me()):S=l+8|0,St[u+12>>2]=l,St[S>>2]=u,d=s,E=f;break}u=0|St[s+24>>2],l=0|St[s+12>>2];do{if((0|l)==(0|s)){if(m=0|St[(c=(_=s+16|0)+4|0)>>2])p=m,b=c;else{if(!(t=0|St[_>>2])){h=0;break}p=t,b=_}for(;;)if(0|(m=0|St[(c=p+20|0)>>2]))p=m,b=c;else{if(!(m=0|St[(c=p+16|0)>>2]))break;p=m,b=c}if(!(b>>>0>>0)){St[b>>2]=0,h=p;break}Me()}else{if((c=0|St[s+8>>2])>>>0>>0&&Me(),(0|St[(m=c+12|0)>>2])!=(0|s)&&Me(),(0|St[(_=l+8|0)>>2])==(0|s)){St[m>>2]=l,St[_>>2]=c,h=l;break}Me()}}while(0);if(u){if(l=0|St[s+28>>2],(0|s)==(0|St[(c=11400+(l<<2)|0)>>2])){if(!(St[c>>2]=h)){St[2775]=St[2775]&~(1<>>0<(0|St[2778])>>>0&&Me(),(0|St[(l=u+16|0)>>2])==(0|s)?St[l>>2]=h:St[u+20>>2]=h,!h){d=s,E=f;break}h>>>0<(l=0|St[2778])>>>0&&Me(),St[h+24>>2]=u,_=0|St[(c=s+16|0)>>2];do{if(0|_){if(!(_>>>0>>0)){St[h+16>>2]=_,St[_+24>>2]=h;break}Me()}}while(0);if(_=0|St[c+4>>2]){if(!(_>>>0<(0|St[2778])>>>0)){St[h+20>>2]=_,St[_+24>>2]=h,d=s,E=f;break}Me()}else d=s,E=f}else d=s,E=f}}while(0);if(r>>>0<=d>>>0&&Me(),1&(n=0|St[(a=4+r|0)>>2])||Me(),2&n)St[a>>2]=-2&n,St[d+4>>2]=1|E,v=St[d+E>>2]=E;else{if((0|r)==(0|St[2780]))return h=(0|St[2777])+E|0,St[2777]=h,St[2780]=d,St[d+4>>2]=1|h,(0|d)!=(0|St[2779])?void 0:(St[2779]=0,void(St[2776]=0));if((0|r)==(0|St[2779]))return h=(0|St[2776])+E|0,St[2776]=h,St[2779]=d,St[d+4>>2]=1|h,void(St[d+h>>2]=h);h=(-8&n)+E|0,i=n>>>3;do{if(256<=n>>>0){p=0|St[24+r>>2],b=0|St[12+r>>2];do{if((0|b)==(0|r)){if(o=0|St[(e=(S=16+r|0)+4|0)>>2])F=o,w=e;else{if(!(_=0|St[S>>2])){k=0;break}F=_,w=S}for(;;)if(0|(o=0|St[(e=F+20|0)>>2]))F=o,w=e;else{if(!(o=0|St[(e=F+16|0)>>2]))break;F=o,w=e}if(!(w>>>0<(0|St[2778])>>>0)){St[w>>2]=0,k=F;break}Me()}else{if((e=0|St[8+r>>2])>>>0<(0|St[2778])>>>0&&Me(),(0|St[(o=e+12|0)>>2])!=(0|r)&&Me(),(0|St[(S=b+8|0)>>2])==(0|r)){St[o>>2]=b,St[S>>2]=e,k=b;break}Me()}}while(0);if(0|p){if(b=0|St[28+r>>2],(0|r)==(0|St[(f=11400+(b<<2)|0)>>2])){if(!(St[f>>2]=k)){St[2775]=St[2775]&~(1<>>0<(0|St[2778])>>>0&&Me(),(0|St[(b=p+16|0)>>2])==(0|r)?St[b>>2]=k:St[p+20>>2]=k,!k)break;k>>>0<(b=0|St[2778])>>>0&&Me(),St[k+24>>2]=p,s=0|St[(f=16+r|0)>>2];do{if(0|s){if(!(s>>>0>>0)){St[k+16>>2]=s,St[s+24>>2]=k;break}Me()}}while(0);if(0|(s=0|St[f+4>>2])){if(!(s>>>0<(0|St[2778])>>>0)){St[k+20>>2]=s,St[s+24>>2]=k;break}Me()}}}else{if(s=0|St[8+r>>2],b=0|St[12+r>>2],(0|s)!=(0|(p=11136+(i<<1<<2)|0))&&(s>>>0<(0|St[2778])>>>0&&Me(),(0|St[s+12>>2])!=(0|r)&&Me()),(0|b)==(0|s)){St[2774]=St[2774]&~(1<>>0<(0|St[2778])>>>0&&Me(),(0|St[(p=b+8|0)>>2])==(0|r)?y=p:Me()):y=b+8|0,St[s+12>>2]=b,St[y>>2]=s}}while(0);if(St[d+4>>2]=1|h,St[d+h>>2]=h,(0|d)==(0|St[2779]))return void(St[2776]=h);v=h}if(E=v>>>3,v>>>0<256)return n=11136+(E<<1<<2)|0,(a=0|St[2774])&(h=1<>2])>>>0<(0|St[2778])>>>0?Me():(M=y,O=E):(St[2774]=a|h,O=(M=n)+8|0),St[O>>2]=d,St[M+12>>2]=d,St[d+8>>2]=M,void(St[d+12>>2]=n);a=11400+((A=(n=v>>>8)?16777215>>0?31:v>>>((a=14-((n=((O=n<<(M=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|M|(O=((h=O<>>16&2))+(h<>>15)|0)+7|0)&1|a<<1:0)<<2)|0,St[d+28>>2]=A,St[d+20>>2]=0,O=(St[d+16>>2]=0)|St[2775],h=1<>>1)|0),n=0|St[a>>2];;){if((-8&St[n+4>>2]|0)==(0|v)){R=130;break}if(!(E=0|St[(g=n+16+(M>>>31<<2)|0)>>2])){R=127;break}M<<=1,n=E}if(127==(0|R)){if(!(g>>>0<(0|St[2778])>>>0)){St[g>>2]=d,St[d+24>>2]=n,St[d+12>>2]=d,St[d+8>>2]=d;break}Me()}else if(130==(0|R)){if(f=0|St[(M=n+8|0)>>2],(E=0|St[2778])>>>0<=f>>>0&E>>>0<=n>>>0){St[f+12>>2]=d,St[M>>2]=d,St[d+8>>2]=f,St[d+12>>2]=n,St[d+24>>2]=0;break}Me()}}else St[2775]=O|h,St[a>>2]=d,St[d+24>>2]=a,St[d+12>>2]=d,St[d+8>>2]=d}while(0);if(d=(0|St[2782])-1|0,!(St[2782]=d)){for(T=11552;d=0|St[T>>2];)T=d+8|0;St[2782]=-1}}}function Nt(e,r,t,n){r|=0,n|=0;return 0|(Ft=r-n-((e|=0)>>>0<(t|=0)>>>0|0)>>>0,e-t>>>0|0)}function Dt(e,r,t,n){var i=0;return 0|(Ft=(r|=0)+(n|=0)+((i=(e|=0)+(t|=0)>>>0)>>>0>>0|0)>>>0,0|i)}function Pt(e,r,t){r|=0;var n,i,o,a=(e|=0)+(t|=0)|0;if(20<=(0|t)){if(i=(r&=255)|r<<8|r<<16|r<<24,o=-4&a,n=3&e)for(n=e+4-n|0;(0|e)<(0|n);)Et[e>>0]=r,e=e+1|0;for(;(0|e)<(0|o);)St[e>>2]=i,e=e+4|0}for(;(0|e)<(0|a);)Et[e>>0]=r,e=e+1|0;return e-t|0}function Ct(e,r,t){return e|=0,r|=0,(0|(t|=0))<32?(Ft=r>>>t,e>>>t|(r&(1<>>t-32|(Ft=0)}function It(e,r,t){return e|=0,r|=0,(0|(t|=0))<32?(Ft=r<>>32-t,e<>0]))<8?0|r:(0|(r=0|Et[E+(e>>8&255)>>0]))<8?r+8|0:(0|(r=0|Et[E+(e>>16&255)>>0]))<8?r+16|0:24+(0|Et[E+(e>>>24)>>0])|0}function Qe(e,r,t,n,i){i|=0;var o,a,u,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0,N=0,s=e|=0,c=t|=0,E=d=n|=0;if(!(l=f=r|=0))return _=0!=(0|i),E?(_&&(St[i>>2]=0|e,St[i+4>>2]=0&r),(m=S=0)|(Ft=S,m)):(_&&(St[i>>2]=(s>>>0)%(c>>>0),St[i+4>>2]=0),(S=0)|(Ft=S,m=(s>>>0)/(c>>>0)>>>0));_=0==(0|E);do{if(c){if(!_){if((h=(0|D(0|E))-(0|D(0|l))|0)>>>0<=31){w=s>>>((F=p=h+1|0)>>>0)&(k=h-31>>31)|l<<(b=31-h|0),y=l>>>(p>>>0)&k,v=0,M=s<>2]=0|e,St[i+4>>2]=f|0&r,(m=S=0)|(Ft=S,m)):(m=S=0)|(Ft=S,m)}if((b=c-1|0)&c|0){w=(h=32-(k=33+(0|D(0|c))-(0|D(0|l))|0)|0)-1>>31&l>>>((a=k-32|0)>>>0)|(l<>>((F=k)>>>0))&(u=a>>31),y=u&l>>>(k>>>0),v=s<<(p=64-k|0)&(o=h>>31),M=(l<>>(a>>>0))&o|s<>31;break}return 0|i&&(St[i>>2]=b&s,St[i+4>>2]=0),1==(0|c)?0|(Ft=S=f|0&r,m=0|e):(b=0|qe(0|c),0|(Ft=S=l>>>(b>>>0)|0,m=l<<32-b|s>>>(b>>>0)|0))}if(_)return 0|i&&(St[i>>2]=(l>>>0)%(c>>>0),St[i+4>>2]=0),(S=0)|(Ft=S,m=(l>>>0)/(c>>>0)>>>0);if(!s)return 0|i&&(St[i>>2]=0,St[i+4>>2]=(l>>>0)%(E>>>0)),(S=0)|(Ft=S,m=(l>>>0)/(E>>>0)>>>0);if(!((b=E-1|0)&E))return 0|i&&(St[i>>2]=0|e,St[i+4>>2]=b&l|0&r),m=l>>>(((S=0)|qe(0|E))>>>0),0|(Ft=S,m);if((b=(0|D(0|E))-(0|D(0|l))|0)>>>0<=30){w=l<<(h=31-b|0)|s>>>((F=k=b+1|0)>>>0),y=l>>>(k>>>0),v=0,M=s<>2]=0|e,St[i+4>>2]=f|0&r),(m=S=0)|(Ft=S,m)}while(0);if(F){for(r=0|t,t=d|0&n,n=0|Dt(0|r,0|t,-1,-1),d=Ft,f=M,M=v,v=y,y=w,w=F,F=0;f=M>>>31|(e=f)<<1,M=F|M<<1,Nt(0|n,0|d,0|(s=y<<1|e>>>31|0),0|(e=y>>>31|v<<1|0)),F=1&(E=(l=Ft)>>31|((0|l)<0?-1:0)<<1),y=0|Nt(0|s,0|e,E&r|0,(((0|l)<0?-1:0)>>31|((0|l)<0?-1:0)<<1)&t|0),v=Ft,w=w-1|0,0!=(0|w););O=f,A=M,R=v,g=y,T=0,N=F}else O=M,A=v,R=y,g=w,N=T=0;return F=A,(A=0)|i&&(St[i>>2]=g,St[i+4>>2]=R),0|(Ft=S=(0|F)>>>31|(O|A)<<1|0&(A<<1|F>>>31)|T,m=-2&(F<<1|0)|N)}function Lt(e,r,t,n){return 0|Qe(e|=0,r|=0,t|=0,n|=0,0)}function Ze(e){var r,t;return 0<(0|(e=(e|=0)+15&-16|0))&(0|(t=(r=0|St[d>>2])+e|0))<(0|r)|(0|t)<0?(h(),M(12),-1):(0|(St[d>>2]=t))>(0|m())&&0==(0|S())?(M(12),St[d>>2]=r,-1):0|r}function xt(e,r,t,n){var i,o=pt;return pt=pt+16|0,Qe(e|=0,r|=0,t|=0,n|=0,i=0|o),pt=o,0|(Ft=0|St[4+i>>2],0|St[i>>2])}function Je(e,r,t){e|=0,r|=0;var n;if(4096<=(0|(t|=0)))return 0|R(0|e,0|r,0|t);if(n=0|e,(3&e)==(3&r)){for(;3&e;){if(!t)return 0|n;Et[e>>0]=0|Et[r>>0],e=e+1|0,r=r+1|0,t=t-1|0}for(;4<=(0|t);)St[e>>2]=St[r>>2],e=e+4|0,r=r+4|0,t=t-4|0}for(;0<(0|t);)Et[e>>0]=0|Et[r>>0],e=e+1|0,r=r+1|0,t=t-1|0;return 0|n}function $e(){return 0}function er(e,r,t){return p(0),0}function rr(e){b(1)}function tr(e,r){k(2)}var nr=[er,function(e,r,t){e|=0,r|=0,t|=0;var n=0,i=pt;return(0|bt)<=(0|(pt=pt+80|0))&&yt(80),n=i,St[e+36>>2]=9,0==(64&St[e>>2]|0)&&(St[n>>2]=St[e+60>>2],St[n+4>>2]=21505,St[n+8>>2]=i+12,0|Y(54,0|n))&&(Et[e+75>>0]=-1),n=0|xe(e,r,t),pt=i,0|n},function(e,r,t){e|=0,r|=0,t|=0;var n,i,o=0,a=pt;return(0|bt)<=(0|(pt=pt+32|0))&&yt(32),i=(n=a)+20|0,St[n>>2]=St[e+60>>2],St[n+4>>2]=0,St[n+8>>2]=r,St[n+12>>2]=i,St[n+16>>2]=t,o=(0|Be(0|O(140,0|n)))<0?St[i>>2]=-1:0|St[i>>2],pt=a,0|o},function(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),i=u+8|0,o=u+4|0,St[(n=(a=u)+12|0)>>2]=e,St[i>>2]=r,St[o>>2]=t,St[a>>2]=St[n>>2],n=0==(0|L(8+(0|St[a>>2])|0,0|St[i>>2],0|St[o>>2])),pt=u,0|(n?0:8)},function(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),i=u+8|0,o=u+4|0,St[(n=(a=u)+12|0)>>2]=e,St[i>>2]=r,St[o>>2]=t,St[a>>2]=St[n>>2],n=0|ae(8+(0|St[a>>2])|0,0|St[i>>2],0|St[o>>2]),pt=u,0|n},function(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s,f=0,l=0,c=0,d=0,E=0,_=pt;return(0|bt)<=(0|(pt=pt+32|0))&&yt(32),i=_+16|0,o=_+12|0,a=_+8|0,u=_+4|0,St[(n=(s=_)+20|0)>>2]=e,St[i>>2]=r,St[o>>2]=t,St[a>>2]=0,St[u>>2]=St[n>>2],St[s>>2]=(0|St[24+(0|St[u>>2])>>2])-(0|St[20+(0|St[u>>2])>>2]),0==(0|St[s>>2])&&0<(0|St[St[o>>2]>>2])>>>0&&(16384<((St[20+(0|St[u>>2])>>2]=0)|St[St[o>>2]>>2])>>>0&&(St[St[o>>2]>>2]=16384),n=0|nr[15&St[St[16+(0|St[u>>2])>>2]>>2]](0|St[16+(0|St[u>>2])>>2],28+(0|St[u>>2])|0,0|St[o>>2]),St[a>>2]=n,n=0|St[St[o>>2]>>2],St[24+(0|St[u>>2])>>2]=n,St[s>>2]=n),pt=(E=(d=(c=(l=(f=((0|St[s>>2])>>>0>=(0|St[St[o>>2]>>2])>>>0||(St[St[o>>2]>>2]=St[s>>2]),(0|St[u>>2])+28|0),0|St[u>>2]),f+(0|St[(l+20|0)>>2])|0),0|St[i>>2]),St[d>>2]=c,0|St[a>>2]),_),0|E},function(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s,f=0,l=0,c=0,d=0,E=0,_=pt;return(0|bt)<=(0|(pt=pt+32|0))&&yt(32),i=_+16|0,o=_+12|0,a=_+8|0,u=_+4|0,St[(n=(s=_)+20|0)>>2]=e,St[i>>2]=r,St[o>>2]=t,St[a>>2]=0,St[u>>2]=St[n>>2],St[s>>2]=(0|St[24+(0|St[u>>2])>>2])-(0|St[20+(0|St[u>>2])>>2]),0==(0|St[s>>2])&&0<(0|St[St[o>>2]>>2])>>>0&&(St[20+(0|St[u>>2])>>2]=0,St[s>>2]=16384,n=0|nr[15&St[St[16+(0|St[u>>2])>>2]>>2]](0|St[16+(0|St[u>>2])>>2],28+(0|St[u>>2])|0,s),St[a>>2]=n,St[24+(0|St[u>>2])>>2]=St[s>>2]),pt=(E=(d=(c=(l=(f=((0|St[s>>2])>>>0>=(0|St[St[o>>2]>>2])>>>0||(St[St[o>>2]>>2]=St[s>>2]),(0|St[u>>2])+28|0),0|St[u>>2]),f+(0|St[(l+20|0)>>2])|0),0|St[i>>2]),St[d>>2]=c,0|St[a>>2]),_),0|E},function(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u,s=0,f=0,l=pt;return(0|bt)<=(0|(pt=pt+32|0))&&yt(32),n=l+20|0,s=l+12|0,o=l+8|0,a=l+4|0,St[(i=(u=l)+16|0)>>2]=e,St[s>>2]=r,St[o>>2]=t,St[a>>2]=St[i>>2],St[u>>2]=(0|St[24+(0|St[a>>2])>>2])-(0|St[20+(0|St[a>>2])>>2]),pt=(f=0|St[u>>2]?((0|St[u>>2])>>>0>(0|St[St[o>>2]>>2])>>>0&&(St[u>>2]=St[St[o>>2]>>2]),Je(0|St[s>>2],28+(0|St[a>>2])+(0|St[20+(0|St[a>>2])>>2])|0,0|St[u>>2]),s=20+(0|St[a>>2])|0,St[s>>2]=(0|St[s>>2])+(0|St[u>>2]),St[St[o>>2]>>2]=St[u>>2],(St[n>>2]=0)|St[n>>2]):(i=0|nr[15&St[St[16+(0|St[a>>2])>>2]>>2]](0|St[16+(0|St[a>>2])>>2],0|St[s>>2],0|St[o>>2]),St[n>>2]=i,0|St[n>>2]),l),0|f},function(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),i=u+8|0,o=u+4|0,St[(n=(a=u)+12|0)>>2]=e,St[i>>2]=r,St[o>>2]=t,St[a>>2]=St[n>>2],St[24+(0|St[a>>2])>>2]=0,n=(St[20+(0|St[a>>2])>>2]=0)|nr[15&St[4+(0|St[16+(0|St[a>>2])>>2])>>2]](0|St[16+(0|St[a>>2])>>2],0|St[i>>2],0|St[o>>2]),pt=u,0|n},xe,function(e,r,t){e|=0,r|=0,t|=0;var n,i,o,a,u=0,s=0,f=0,l=0,c=0,d=pt;return(0|bt)<=(0|(pt=pt+48|0))&&yt(48),n=d+16|0,St[(s=(u=d)+32|0)>>2]=r,f=s+4|0,o=0|St[(i=e+48|0)>>2],St[f>>2]=t-(0!=(0|o)&1),a=e+44|0,St[s+8>>2]=St[a>>2],St[s+12>>2]=o,c=1<=(0|(l=0|St[2762]?(g(2,0|e),St[u>>2]=St[e+60>>2],St[u+4>>2]=s,St[u+8>>2]=2,s=0|Be(0|T(145,0|u)),v(0),s):(St[n>>2]=St[e+60>>2],St[4+n>>2]=s,St[8+n>>2]=2,0|Be(0|T(145,0|n)))))?(s=0|St[f>>2])>>>0>>0?(f=0|St[a>>2],u=St[(a=e+4|0)>>2]=f,St[e+8>>2]=u+(l-s),0|St[i>>2]&&(St[a>>2]=u+1,Et[r+(t+-1)>>0]=0|Et[u>>0]),t):l:(St[e>>2]=St[e>>2]|48&l^16,St[e+8>>2]=0,St[e+4>>2]=0,l),pt=d,0|c},er,er,er,er,er],ir=[rr,function(e){0|St[(e|=0)+68>>2]||He()},function(e){0|St[(e|=0)+68>>2]||He()},rr],or=[tr,function(e,r){e|=0,r|=0;var t,n=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(t=n)+4>>2]=e,St[t>>2]=r,Ge(0|St[t>>2]),pt=n},function(e,r){e|=0,r|=0;var t,n=pt;(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(t=n)+4>>2]=e,St[t>>2]=r,Ge(0|St[t>>2]),pt=n},tr],ar=[function(e){return F(3),0},function(e){e|=0;var r,t=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),St[(r=t)>>2]=St[e+60>>2],e=0|Be(0|U(6,0|r)),pt=t,0|e}],ur=[function(e,r,t,n){return w(4),0},function(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i,o,a,u,s,f=0,l=pt;for((0|bt)<=(0|(pt=pt+32|0))&&yt(32),o=l+12|0,a=l+8|0,u=l+4|0,St[(i=(s=l)+16|0)>>2]=e,St[o>>2]=r,St[a>>2]=t,St[u>>2]=n,St[s>>2]=St[o>>2];!((0|St[a>>2])>>>0<=0)&&3&St[s>>2];)St[i>>2]=St[(0|St[u>>2])+((255&(St[i>>2]^(0|mt[St[s>>2]>>0])))<<2)>>2]^(0|St[i>>2])>>>8,St[a>>2]=(0|St[a>>2])-1,St[s>>2]=1+(0|St[s>>2]);for(;!((0|St[a>>2])>>>0<4);)St[i>>2]=St[i>>2]^St[St[s>>2]>>2],St[i>>2]=St[(0|St[u>>2])+(768+(255&St[i>>2])<<2)>>2]^St[(0|St[u>>2])+(512+((0|St[i>>2])>>>8&255)<<2)>>2]^St[(0|St[u>>2])+(256+((0|St[i>>2])>>>16&255)<<2)>>2]^St[(0|St[u>>2])+((0|St[i>>2])>>>24<<2)>>2],St[a>>2]=(0|St[a>>2])-4,St[s>>2]=4+(0|St[s>>2]);for(;f=0|St[i>>2],!((0|St[a>>2])>>>0<=0);)St[i>>2]=St[(0|St[u>>2])+((255&(f^(0|mt[St[s>>2]>>0])))<<2)>>2]^(0|St[i>>2])>>>8,St[a>>2]=(0|St[a>>2])-1,St[s>>2]=1+(0|St[s>>2]);return pt=l,0|f}],sr=[function(e,r){return y(5),0},function(e,r){e|=0,r|=0;var t,n,i=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),t=i+8|0,St[(n=i)+4>>2]=e,St[n>>2]=r,0|St[n>>2]?(r=0|Xe(0|St[n>>2]),St[t>>2]=r):St[t>>2]=0,pt=i,0|St[t>>2]},function(e,r){e|=0,r|=0;var t,n,i=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),t=i+8|0,St[(n=i)+4>>2]=e,St[n>>2]=r,0|St[n>>2]?(r=0|Xe(0|St[n>>2]),St[t>>2]=r):St[t>>2]=0,pt=i,0|St[t>>2]},function(e,r){e|=0,r|=0;var t,n,i,o=pt;return(0|bt)<=(0|(pt=pt+16|0))&&yt(16),n=o+4|0,St[(t=(i=o)+8|0)>>2]=e,St[n>>2]=r,St[i>>2]=St[t>>2],t=20+(0|St[i>>2])|0,St[t>>2]=(0|St[t>>2])+(0|St[n>>2]),pt=o,0}];return{_sbrk:Ze,_i64Subtract:Nt,_free:Ge,___udivmoddi4:Qe,_i64Add:Dt,_extract:function(e,r){e|=0,r|=0;var t,n,i,o,a,u,s,f,l,c,d,E,_,S,m,h,p,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0,N=0,D=0,P=0,C=0,I=0,L=0;if((0|bt)<=(0|(pt=(r=pt)+16816|0))&&yt(16816),t=r+80|0,n=r+16544|0,i=r+16532|0,o=r+120|0,a=r+112|0,u=r+104|0,f=(s=r)+100|0,l=r+96|0,c=r+92|0,d=r+16548|0,E=r+88|0,_=r+84|0,S=0|function(e,r){e|=0,r|=0;var t=0,n=0,i=0,o=0,a=0;(0|(pt=(t=pt)+32|0))>=(0|bt)&&yt(32);n=t+16|0,i=t,a=0|Rt(2845,0|Et[r>>0],4)?(o=32768|function(e){var r=0,t=0,n=0,i=0;return r=0==(0|Ye(e=e|0,43)),t=0|Et[e>>0],n=r?t<<24>>24!=114&1:2,r=0==(0|Ye(e,120)),i=r?n:128|n,n=0==(0|Ye(e,101)),e=n?i:524288|i,i=t<<24>>24==114?e:64|e,e=t<<24>>24==119?512|i:i,0|(t<<24>>24==97?1024|e:e)}(r),St[i>>2]=e,St[i+4>>2]=o,St[i+8>>2]=438,o=0|Be(0|z(5,0|i)),0<=(0|o)?(i=0|function(e,r){e|=0,r|=0;var t=0,n=0,i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0;(0|(pt=(t=pt)+112|0))>=(0|bt)&&yt(112);if(n=t+40|0,i=t+24|0,o=t+16|0,u=(a=t)+52|0,0|Rt(2845,(s=0|Et[r>>0])<<24>>24,4))if(f=0|Xe(1144)){for(c=f,d=c+112|0;St[c>>2]=0,c=c+4|0,(0|c)<(0|d););0|Ye(r,43)||(St[f>>2]=s<<24>>24==114?8:4),E=0|Ye(r,101)?(St[a>>2]=e,St[a+4>>2]=2,St[a+8>>2]=1,x(221,0|a),0|Et[r>>0]):s,_=E<<24>>24==97?(St[o>>2]=e,St[4+o>>2]=3,1024&(E=0|x(221,0|o))||(St[i>>2]=e,St[i+4>>2]=4,St[i+8>>2]=1024|E,x(221,0|i)),i=128|St[f>>2],St[f>>2]=i):0|St[f>>2],St[f+60>>2]=e,St[f+44>>2]=f+120,St[f+48>>2]=1024,Et[(i=f+75|0)>>0]=-1,0==(8&_|0)&&(St[n>>2]=e,St[4+n>>2]=21505,St[8+n>>2]=u,0==(0|Y(54,0|n)))&&(Et[i>>0]=10),St[f+32>>2]=10,St[f+36>>2]=9,St[f+40>>2]=2,St[f+12>>2]=1,0|St[2763]||(St[f+76>>2]=-1),H(11076),i=0|St[2768],0|(St[f+56>>2]=i)&&(St[i+52>>2]=f),St[2768]=f,V(11076),l=f}else l=0;else f=0|vt(),St[f>>2]=22,l=0;return pt=t,0|l}(o,r))||(St[n>>2]=o,U(6,0|n),0):0):(i=0|vt(),St[i>>2]=22,0);return pt=t,0|a}(e,140),St[f>>2]=0,St[a>>2]=1,St[(e=4+a|0)>>2]=1,St[u>>2]=2,St[4+u>>2]=2,St[(m=8+i|0)>>2]=S,function(e){e|=0;var r=0,t=0;(0|(pt=(r=pt)+16|0))>=(0|bt)&&yt(16),St[(t=r)>>2]=e,St[St[t>>2]>>2]=3,St[4+(0|St[t>>2])>>2]=4,pt=r}(i),function(e,r){e|=0,r|=0;var t=0,n=0,i=0;(0|(pt=(t=pt)+16|0))>=(0|bt)&&yt(16),St[(n=(i=t)+4|0)>>2]=e,St[i>>2]=r,St[St[n>>2]>>2]=0|St[i>>2]?6:5,St[4+(0|St[n>>2])>>2]=3,St[8+(0|St[n>>2])>>2]=7,St[12+(0|St[n>>2])>>2]=8,pt=t}(o,0),St[16+o>>2]=i,function(e){e|=0;var r=0,t=0;(0|(pt=(r=pt)+16|0))>=(0|bt)&&yt(16),St[(t=r)>>2]=e,St[24+(0|St[t>>2])>>2]=0,St[20+(0|St[t>>2])>>2]=0,pt=r}(o),function(){var e=0,r=0,t=0,n=0,i=0,o=0;for((0|(pt=(e=pt)+16|0))>=(0|bt)&&yt(16),t=e+8|0,n=e+4|0,St[(r=(i=e)+12|0)>>2]=0;!(256<=(0|St[r>>2])>>>0);){for(St[t>>2]=St[r>>2],St[n>>2]=0;o=0|St[t>>2],!(8<=(0|St[n>>2])>>>0);)St[t>>2]=o>>>1^-306674912&~((1&St[t>>2])-1),St[n>>2]=1+(0|St[n>>2]);St[2852+(St[r>>2]<<2)>>2]=o,St[r>>2]=1+(0|St[r>>2])}for(;!(2048<=(0|St[r>>2])>>>0);)St[i>>2]=St[2852+((0|St[r>>2])-256<<2)>>2],St[2852+(St[r>>2]<<2)>>2]=St[2852+((255&St[i>>2])<<2)>>2]^(0|St[i>>2])>>>8,St[r>>2]=1+(0|St[r>>2]);St[2761]=1,pt=e}(),J(s),0|function(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i=0,o=0,a=0,u=0,s=0,f=0,l=0;(0|(pt=(i=pt)+32|0))>=(0|bt)&&yt(32);return a=i+12|0,u=i+8|0,s=i+4|0,St[(o=(f=i)+16|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[s>>2]=n,n=0|function(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0;(0|(pt=(i=pt)+160|0))>=(0|bt)&&yt(160);if(o=i+112|0,u=i+104|0,s=i+100|0,f=i+96|0,l=i+120|0,c=i+32|0,d=i+24|0,E=i+16|0,_=i+92|0,S=i+88|0,m=i+80|0,h=i+72|0,p=i+68|0,b=i+64|0,k=i+8|0,F=i+60|0,w=i+56|0,y=i+48|0,M=(v=i)+40|0,St[(a=i+108|0)>>2]=e,St[u>>2]=r,St[s>>2]=t,St[f>>2]=n,St[(n=c)>>2]=0,St[n+4>>2]=0,n=0|nr[15&St[12+(0|St[u>>2])>>2]](0|St[u>>2],c,1),St[p>>2]=n,0|St[p>>2])return St[o>>2]=St[p>>2],O=0|St[o>>2],pt=i,0|O;if(p=0|pe(0|St[u>>2],l,32,17),St[b>>2]=p,0|St[b>>2])return St[o>>2]=St[b>>2],O=0|St[o>>2],pt=i,0|O;if(!(0|function(e){e|=0;var r=0,t=0,n=0,i=0,o=0,a=0;(0|(pt=(r=pt)+16|0))>=(0|bt)&&yt(16);t=r+8|0,St[(n=(i=r)+4|0)>>2]=e,St[i>>2]=0;for(;;){if(6<=(0|St[i>>2])>>>0){o=6;break}if((0|mt[(0|St[n>>2])+(0|St[i>>2])>>0])!=(0|mt[346+(0|St[i>>2])>>0])){o=4;break}St[i>>2]=1+(0|St[i>>2])}{if(4==(0|o))return St[t>>2]=0,a=0|St[t>>2],pt=r,0|a;if(6==(0|o))return St[t>>2]=1,a=0|St[t>>2],pt=r,0|a}return 0}(l)))return St[o>>2]=17,O=0|St[o>>2],pt=i,0|O;if(0|mt[l+6>>0])return St[o>>2]=4,O=0|St[o>>2],pt=i,0|O;if(b=0|mt[l+12+4>>0]|(0|mt[l+12+4+1>>0])<<8|(0|mt[l+12+4+2>>0])<<16|(0|mt[l+12+4+3>>0])<<24,St[(p=d)>>2]=0|mt[l+12>>0]|(0|mt[l+12+1>>0])<<8|(0|mt[l+12+2>>0])<<16|(0|mt[l+12+3>>0])<<24,St[p+4>>2]=b,b=0|mt[l+20+4>>0]|(0|mt[l+20+4+1>>0])<<8|(0|mt[l+20+4+2>>0])<<16|(0|mt[l+20+4+3>>0])<<24,St[(p=E)>>2]=0|mt[l+20>>0]|(0|mt[l+20+1>>0])<<8|(0|mt[l+20+2>>0])<<16|(0|mt[l+20+3>>0])<<24,St[p+4>>2]=b,St[S>>2]=0|mt[l+28>>0]|(0|mt[l+28+1>>0])<<8|(0|mt[l+28+2>>0])<<16|(0|mt[l+28+3>>0])<<24,p=0|Dt(0|St[(b=c)>>2],0|St[b+4>>2],32,0),b=32+(0|St[a>>2])|0,St[b>>2]=p,St[b+4>>2]=Ft,(0|(b=0|Pe(l+12|0,20)))!=(0|mt[l+8>>0]|(0|mt[l+8+1>>0])<<8|(0|mt[l+8+2>>0])<<16|(0|mt[l+8+3>>0])<<24|0))return St[o>>2]=3,O=0|St[o>>2],pt=i,0|O;if(St[_>>2]=St[E>>2],0!=(0|St[(l=E)+4>>2])||(0|St[_>>2])!=(0|St[l>>2]))return St[o>>2]=2,O=0|St[o>>2],pt=i,0|O;if(!(0|St[_>>2]))return St[o>>2]=0,O=0|St[o>>2],pt=i,0|O;if(b=0|St[(l=d)>>2],p=0|St[l+4>>2],n=E,t=0|Dt(0|St[(l=d)>>2],0|St[l+4>>2],0|St[n>>2],0|St[n+4>>2]),p>>>0>(n=Ft)>>>0|(0|p)==(0|n)&t>>>0>>0||(b=0|St[(t=d)>>2],n=0|St[t+4>>2],p=E,l=0|Dt(0|St[(t=d)>>2],0|St[t+4>>2],0|St[p>>2],0|St[p+4>>2]),p=0|Dt(0|l,0|Ft,32,0),n>>>0>(l=Ft)>>>0|(0|n)==(0|l)&p>>>0>>0))return St[o>>2]=17,O=0|St[o>>2],pt=i,0|O;if(St[(p=k)>>2]=0,St[p+4>>2]=0,p=0|nr[15&St[12+(0|St[u>>2])>>2]](0|St[u>>2],k,2),St[F>>2]=p,0|St[F>>2])return St[o>>2]=St[F>>2],O=0|St[o>>2],pt=i,0|O;if(p=0|St[(F=k)>>2],b=0|St[F+4>>2],l=d,n=0|Dt(0|St[(F=c)>>2],0|St[F+4>>2],0|St[l>>2],0|St[l+4>>2]),b>>>0<(l=Ft)>>>0|(0|b)==(0|l)&p>>>0>>0||(p=0|St[(n=k)>>2],l=0|St[n+4>>2],b=0|Dt(0|St[(n=c)>>2],0|St[n+4>>2],32,0),F=0|Dt(0|b,0|Ft,0|St[(n=d)>>2],0|St[n+4>>2]),l>>>0<(n=Ft)>>>0|(0|l)==(0|n)&p>>>0>>0)||(k=0|St[(F=k)>>2],p=0|St[F+4>>2],n=0|Dt(0|St[(F=c)>>2],0|St[F+4>>2],32,0),l=0|Dt(0|n,0|Ft,0|St[(F=d)>>2],0|St[F+4>>2]),E=0|Dt(0|l,0|Ft,0|St[(F=E)>>2],0|St[F+4>>2]),p>>>0<(F=Ft)>>>0|(0|p)==(0|F)&k>>>0>>0))return St[o>>2]=6,O=0|St[o>>2],pt=i,0|O;if(E=0|St[u>>2],c=0|Dt(0|St[(k=c)>>2],0|St[k+4>>2],32,0),d=0|Dt(0|c,0|Ft,0|St[(k=d)>>2],0|St[k+4>>2]),k=0|he(E,d,Ft),St[w>>2]=k,0|St[w>>2])return St[o>>2]=St[w>>2],O=0|St[o>>2],pt=i,0|O;if(!(0|Ie(m,0|St[_>>2],0|St[f>>2])))return St[o>>2]=2,O=0|St[o>>2],pt=i,0|O;w=0|function(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,o=0,a=0;(0|(pt=(n=pt)+16|0))>=(0|bt)&&yt(16);return o=n+4|0,St[(i=(a=n)+8|0)>>2]=e,St[o>>2]=r,St[a>>2]=t,t=0|pe(0|St[i>>2],0|St[o>>2],0|St[a>>2],6),pt=n,0|t}(0|St[u>>2],0|St[m>>2],0|St[_>>2]),St[h>>2]=w;do{if(0==(0|St[h>>2])&&(St[h>>2]=16,(0|(w=0|Pe(0|St[m>>2],0|St[_>>2])))==(0|St[S>>2]))){St[y>>2]=St[m>>2],St[4+y>>2]=St[4+m>>2],w=0|ue(y,v),St[h>>2]=w,w=v;do{if(0==(0|St[h>>2])&(23==(0|St[w>>2])&0==(0|St[w+4>>2]))){if(Ce(M),k=32+(0|St[a>>2])|0,d=0|function(e,r,t,n,i,o){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0;var a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0;(0|(pt=(a=pt)+80|0))>=(0|bt)&&yt(80);return s=a+64|0,f=a+60|0,c=(l=a)+56|0,d=a+24|0,E=a+20|0,_=a+16|0,S=a+12|0,m=a+8|0,St[(u=a+68|0)>>2]=e,St[s>>2]=r,St[f>>2]=t,St[(t=l)>>2]=n,St[t+4>>2]=i,St[c>>2]=o,St[E>>2]=0,St[_>>2]=0,St[S>>2]=0,q(d),o=l,l=0|function(e,r,t,n,i,o,a,u,s,f){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0,a|=0,u|=0,s|=0,f|=0;var l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0;(0|(pt=(l=pt)+96|0))>=(0|bt)&&yt(96);if(c=l+80|0,E=l+72|0,_=l+68|0,S=l+16|0,m=l+64|0,h=l+60|0,p=l+56|0,b=l+52|0,k=l+48|0,F=l+44|0,w=l+8|0,y=l+40|0,M=(v=l)+36|0,O=l+32|0,A=l+28|0,R=l+24|0,St[(d=l+76|0)>>2]=e,St[E>>2]=r,St[_>>2]=t,St[(t=S)>>2]=n,St[t+4>>2]=i,St[m>>2]=o,St[h>>2]=a,St[p>>2]=u,St[b>>2]=s,St[k>>2]=f,St[F>>2]=0,f=0|se(0|St[E>>2],w,0|St[m>>2],F,0|St[h>>2],0|St[p>>2],0|St[b>>2],0|St[k>>2],0|St[k>>2]),St[O>>2]=f,0|St[O>>2])return St[c>>2]=St[O>>2],g=0|St[c>>2],pt=l,0|g;if(O=S,f=0|Dt(0|St[(S=w)>>2],0|St[4+S>>2],0|St[O>>2],0|St[O+4>>2]),St[(O=w)>>2]=f,St[O+4>>2]=Ft,1!=(0|St[24+(0|St[m>>2])>>2]))return St[c>>2]=16,g=0|St[c>>2],pt=l,0|g;if(St[y>>2]=St[12+(0|St[m>>2])>>2],O=0|G(0|St[y>>2]),St[(f=v)>>2]=O,St[f+4>>2]=Ft,f=w,O=0|he(0|St[d>>2],0|St[f>>2],0|St[f+4>>2]),St[A>>2]=O,0|St[A>>2])return St[c>>2]=St[A>>2],g=0|St[c>>2],pt=l,0|g;if(!(0|Ie(0|St[_>>2],0|St[v>>2],0|St[k>>2])))return St[c>>2]=2,g=0|St[c>>2],pt=l,0|g;if(A=w,w=0|Re(0|St[y>>2],0|St[St[m>>2]>>2],0|St[d>>2],0|St[A>>2],0|St[A+4>>2],0|St[St[_>>2]>>2],0|St[v>>2],0|St[k>>2],0,0),St[M>>2]=w,St[R>>2]=St[M>>2],0|St[R>>2])return St[c>>2]=St[R>>2],g=0|St[c>>2],pt=l,0|g;if(0|St[28+(0|St[y>>2])>>2]&&(0|(R=0|Pe(0|St[St[_>>2]>>2],0|St[v>>2])))!=(0|St[32+(0|St[y>>2])>>2]))return St[c>>2]=3,g=0|St[c>>2],pt=l,0|g;return St[c>>2]=0,g=0|St[c>>2],pt=l,0|g}(0|St[u>>2],0|St[s>>2],0|St[f>>2],0|St[o>>2],0|St[o+4>>2],d,E,_,S,0|St[c>>2]),St[m>>2]=l,Z(d,0|St[c>>2]),or[3&St[4+(0|St[c>>2])>>2]](0|St[c>>2],0|St[E>>2]),or[3&St[4+(0|St[c>>2])>>2]](0|St[c>>2],0|St[_>>2]),or[3&St[4+(0|St[c>>2])>>2]](0|St[c>>2],0|St[S>>2]),pt=a,0|St[m>>2]}(0|St[u>>2],y,M,0|St[k>>2],0|St[k+4>>2],0|St[f>>2]),St[h>>2]=d,d=0|St[f>>2],0|St[h>>2]){Le(M,d);break}Le(m,d),St[m>>2]=St[M>>2],St[4+m>>2]=St[4+M>>2],St[y>>2]=St[m>>2],St[4+y>>2]=St[4+m>>2],d=0|ue(y,v),St[h>>2]=d;break}}while(0);if(0|St[h>>2])break;if(1==(0|St[(w=v)>>2])&0==(0|St[w+4>>2])){w=0|function(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0;(0|(pt=(i=pt)+48|0))>=(0|bt)&&yt(48);return a=i+36|0,u=i+32|0,s=i+28|0,f=i+24|0,l=i+20|0,c=i+16|0,d=i+12|0,E=i+8|0,_=i+4|0,St[(o=(S=i)+40|0)>>2]=e,St[a>>2]=r,St[u>>2]=t,St[s>>2]=n,St[f>>2]=0,St[l>>2]=0,St[c>>2]=0,St[d>>2]=0,St[E>>2]=0,St[_>>2]=0,n=0|function(e,r,t,n,i,o,a,u,s,f){e|=0,r|=0,t|=0,n|=0,i|=0,o|=0,a|=0,u|=0,s|=0,f|=0;var l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0,p=0,b=0,k=0,F=0,w=0,y=0,v=0,M=0,O=0,A=0,R=0,g=0,T=0,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0,U=0,z=0,Y=0,V=0,K=0,W=0,j=0,X=0,G=0,q=0,Q=0,Z=0,J=0,$=0,ee=0,re=0,te=0,ne=0,ie=0,oe=0,ae=0;(0|(pt=(l=pt)+208|0))>=(0|bt)&&yt(208);if(c=l+188|0,E=l+180|0,_=l+176|0,S=l+172|0,m=l+168|0,h=l+164|0,p=l+160|0,b=l+156|0,k=l+152|0,F=l+148|0,w=l+8|0,y=l+144|0,v=l+140|0,M=l+136|0,O=l+132|0,A=l+128|0,R=l+124|0,g=l+120|0,T=l+116|0,N=l+112|0,D=l+108|0,P=l+104|0,I=(C=l)+100|0,L=l+96|0,x=l+92|0,B=l+88|0,H=l+84|0,U=l+80|0,z=l+76|0,Y=l+72|0,V=l+68|0,K=l+64|0,W=l+60|0,j=l+56|0,X=l+193|0,G=l+52|0,q=l+48|0,Q=l+44|0,Z=l+40|0,J=l+192|0,$=l+36|0,ee=l+32|0,re=l+28|0,te=l+24|0,ne=l+20|0,ie=l+16|0,St[(d=l+184|0)>>2]=e,St[E>>2]=r,St[_>>2]=t,St[S>>2]=n,St[m>>2]=i,St[h>>2]=o,St[p>>2]=a,St[b>>2]=u,St[k>>2]=s,St[F>>2]=f,St[y>>2]=0,St[v>>2]=0,St[M>>2]=0,St[O>>2]=0,f=0|ue(0|St[E>>2],w),St[R>>2]=f,0|St[R>>2])return St[c>>2]=St[R>>2],oe=0|St[c>>2],pt=l,0|oe;if(2==(0|St[(R=w)>>2])&0==(0|St[R+4>>2])){if(R=0|function(e){e|=0;var r=0,t=0,n=0,i=0,o=0,a=0,u=0;(0|(pt=(r=pt)+32|0))>=(0|bt)&&yt(32);t=r+16|0,o=(i=r)+8|0,St[(n=r+12|0)>>2]=e;for(;;){if(e=0|ue(0|St[n>>2],i),St[o>>2]=e,0|St[o>>2]){a=3;break}if(0==(0|St[(e=i)>>2])&0==(0|St[e+4>>2])){a=6;break}me(0|St[n>>2])}{if(3==(0|a))return St[t>>2]=St[o>>2],u=0|St[t>>2],pt=r,0|u;if(6==(0|a))return St[t>>2]=0,u=0|St[t>>2],pt=r,0|u}return 0}(0|St[E>>2]),St[g>>2]=R,0|St[g>>2])return St[c>>2]=St[g>>2],oe=0|St[c>>2],pt=l,0|oe;if(g=0|ue(0|St[E>>2],w),St[T>>2]=g,0|St[T>>2])return St[c>>2]=St[T>>2],oe=0|St[c>>2],pt=l,0|oe}if(4==(0|St[(T=w)>>2])&0==(0|St[T+4>>2])){if(T=0|se(0|St[E>>2],40+(0|St[d>>2])|0,0|St[d>>2],y,0|St[_>>2],0|St[S>>2],0|St[m>>2],0|St[k>>2],0|St[F>>2]),St[N>>2]=T,0|St[N>>2])return St[c>>2]=St[N>>2],oe=0|St[c>>2],pt=l,0|oe;if(N=32+(0|St[d>>2])|0,T=40+(0|St[d>>2])|0,g=0|Dt(0|St[(y=T)>>2],0|St[y+4>>2],0|St[N>>2],0|St[N+4>>2]),St[(N=T)>>2]=g,St[N+4>>2]=Ft,N=0|ue(0|St[E>>2],w),St[D>>2]=N,0|St[D>>2])return St[c>>2]=St[D>>2],oe=0|St[c>>2],pt=l,0|oe}if(0==(0|St[(D=w)>>2])&0==(0|St[D+4>>2]))return St[c>>2]=0,oe=0|St[c>>2],pt=l,0|oe;if(5!=(0|St[(D=w)>>2])|0!=(0|St[D+4>>2]))return St[c>>2]=16,oe=0|St[c>>2],pt=l,0|oe;if(D=0|fe(0|St[E>>2],v),St[P>>2]=D,0|St[P>>2])return St[c>>2]=St[P>>2],oe=0|St[c>>2],pt=l,0|oe;if(St[28+(0|St[d>>2])>>2]=St[v>>2],0|St[v>>2]){if(P=0|sr[3&St[St[k>>2]>>2]](0|St[k>>2],St[v>>2]<<5),!(St[M>>2]=P))return St[c>>2]=2,oe=0|St[c>>2],pt=l,0|oe}else St[M>>2]=0;St[16+(0|St[d>>2])>>2]=St[M>>2],St[A>>2]=0;for(;!((0|St[A>>2])>>>0>=(0|St[v>>2])>>>0);)!function(e){e|=0;var r=0,t=0;(0|(pt=(r=pt)+16|0))>=(0|bt)&&yt(16),St[(t=r)>>2]=e,Et[24+(0|St[t>>2])>>0]=1,Et[25+(0|St[t>>2])>>0]=0,Et[26+(0|St[t>>2])>>0]=0,Et[27+(0|St[t>>2])>>0]=0,Et[28+(0|St[t>>2])>>0]=0,pt=r}((0|St[M>>2])+(St[A>>2]<<5)|0),St[A>>2]=1+(0|St[A>>2]);e:for(;;){if(P=0|ue(0|St[E>>2],w),St[I>>2]=P,0|St[I>>2]){ae=27;break}if(0==(0|St[(P=w)>>2])&0==(0|St[P+4>>2])){ae=86;break}if(P=0|le(0|St[E>>2],C),St[L>>2]=P,0|St[L>>2]){ae=30;break}if(0<(D=0|St[(P=C)+4>>2])>>>0|(0==(0|D)?(0|St[P>>2])>>>0>(0|St[4+(0|St[E>>2])>>2])>>>0:0)){ae=32;break}if((0|(P=0|St[w>>2]))==(0|St[(D=w)>>2])&&(((0|P)<0)<<31>>31|0)==(0|St[D+4>>2]))switch(0|St[w>>2]){case 17:if(P=0|de(0|St[E>>2]),St[H>>2]=P,0|St[H>>2]){ae=38;break e}if(St[B>>2]=(0|St[C>>2])-1,1&St[B>>2]|0){ae=40;break e}if(!(0|Ie(68+(0|St[d>>2])|0,0|St[B>>2],0|St[k>>2]))){ae=42;break e}if(1+(0|St[v>>2])|0){if(P=0|sr[3&St[St[k>>2]>>2]](0|St[k>>2],1+(0|St[v>>2])<<2),!(St[64+(0|St[d>>2])>>2]=P)){ae=46;break e}}else St[64+(0|St[d>>2])>>2]=0;if(Je(0|St[68+(0|St[d>>2])>>2],0|St[St[E>>2]>>2],0|St[B>>2]),P=0|function(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0;(0|(pt=(i=pt)+32|0))>=(0|bt)&&yt(32);o=i+24|0,u=i+16|0,s=i+12|0,f=i+8|0,l=i+4|0,St[(a=(c=i)+20|0)>>2]=e,St[u>>2]=r,St[s>>2]=t,St[f>>2]=n,St[c>>2]=0,St[l>>2]=0;r:for(;;){if(n=(0|St[l>>2])>>>0<(0|St[s>>2])>>>0,St[(0|St[f>>2])+(St[l>>2]<<2)>>2]=St[c>>2],!n){d=9;break}for(;;){if((0|St[c>>2])>>>0>=(0|St[u>>2])>>>0){d=4;break r}if(0==(0|mt[(0|St[a>>2])+(St[c>>2]<<1)>>0])&&0==(0|mt[(0|St[a>>2])+(1+(St[c>>2]<<1))>>0]))break;St[c>>2]=1+(0|St[c>>2])}St[c>>2]=1+(0|St[c>>2]),St[l>>2]=1+(0|St[l>>2])}{if(4==(0|d))return St[o>>2]=16,E=0|St[o>>2],pt=i,0|E;if(9==(0|d))return St[o>>2]=(0|St[c>>2])==(0|St[u>>2])?0:16,E=0|St[o>>2],pt=i,0|E}return 0}(0|St[St[E>>2]>>2],(0|St[B>>2])>>>1,0|St[v>>2],0|St[64+(0|St[d>>2])>>2]),St[U>>2]=P,0|St[U>>2]){ae=48;break e}if(P=0|ce(0|St[E>>2],0|St[B>>2],0),St[z>>2]=P,0|St[z>>2]){ae=50;break e}continue e;case 14:if(P=0|Ee(0|St[E>>2],0|St[v>>2],0|St[h>>2],0|St[F>>2]),St[Y>>2]=P,0|St[Y>>2]){ae=52;break e}for(St[O>>2]=0,St[A>>2]=0;;){if((0|St[A>>2])>>>0>=(0|St[v>>2])>>>0)continue e;0|Et[(0|St[St[h>>2]>>2])+(0|St[A>>2])>>0]&&(St[O>>2]=1+(0|St[O>>2])),St[A>>2]=1+(0|St[A>>2])}break;case 15:if(P=0|Ee(0|St[E>>2],0|St[O>>2],0|St[p>>2],0|St[F>>2]),St[V>>2]=P,0|St[V>>2]){ae=59;break e}continue e;case 21:if(P=0|_e(0|St[E>>2],0|St[v>>2],0|St[b>>2],0|St[F>>2]),St[K>>2]=P,0|St[K>>2]){ae=61;break e}if(P=0|de(0|St[E>>2]),St[W>>2]=P,0|St[W>>2]){ae=63;break e}for(St[A>>2]=0;!((0|St[A>>2])>>>0>=(0|St[v>>2])>>>0);){if(St[j>>2]=(0|St[M>>2])+(St[A>>2]<<5),Et[X>>0]=0|Et[(0|St[St[b>>2]>>2])+(0|St[A>>2])>>0],Et[29+(0|St[j>>2])>>0]=0|Et[X>>0],(St[20+(0|St[j>>2])>>2]=0)|Et[X>>0]&&(P=0|Se(0|St[E>>2],20+(0|St[j>>2])|0),St[G>>2]=P,0|St[G>>2])){ae=68;break e}St[A>>2]=1+(0|St[A>>2])}or[3&St[4+(0|St[F>>2])>>2]](0|St[F>>2],0|St[St[b>>2]>>2]),St[St[b>>2]>>2]=0;continue e;case 20:if(P=0|_e(0|St[E>>2],0|St[v>>2],0|St[b>>2],0|St[F>>2]),St[q>>2]=P,0|St[q>>2]){ae=72;break e}if(P=0|de(0|St[E>>2]),St[Q>>2]=P,0|St[Q>>2]){ae=74;break e}for(St[A>>2]=0;!((0|St[A>>2])>>>0>=(0|St[v>>2])>>>0);){if(St[Z>>2]=(0|St[M>>2])+(St[A>>2]<<5),Et[J>>0]=0|Et[(0|St[St[b>>2]>>2])+(0|St[A>>2])>>0],Et[28+(0|St[Z>>2])>>0]=0|Et[J>>0],St[4+(0|St[Z>>2])>>2]=0,(St[St[Z>>2]>>2]=0)|Et[J>>0]){if(P=0|Se(0|St[E>>2],0|St[Z>>2]),St[$>>2]=P,0|St[$>>2]){ae=79;break e}if(P=0|Se(0|St[E>>2],4+(0|St[Z>>2])|0),St[ee>>2]=P,0|St[ee>>2]){ae=81;break e}}St[A>>2]=1+(0|St[A>>2])}or[3&St[4+(0|St[F>>2])>>2]](0|St[F>>2],0|St[St[b>>2]>>2]),St[St[b>>2]>>2]=0;continue e;default:if(P=C,D=0|ce(0|St[E>>2],0|St[P>>2],0|St[P+4>>2]),St[re>>2]=D,0|St[re>>2]){ae=85;break e}continue e}else if(D=C,P=0|ce(0|St[E>>2],0|St[D>>2],0|St[D+4>>2]),St[x>>2]=P,0|St[x>>2]){ae=35;break}}switch(0|ae){case 27:return St[c>>2]=St[I>>2],oe=0|St[c>>2],pt=l,0|oe;case 30:return St[c>>2]=St[L>>2],oe=0|St[c>>2],pt=l,0|oe;case 32:return St[c>>2]=16,oe=0|St[c>>2],pt=l,0|oe;case 35:return St[c>>2]=St[x>>2],oe=0|St[c>>2],pt=l,0|oe;case 38:return St[c>>2]=St[H>>2],oe=0|St[c>>2],pt=l,0|oe;case 40:return St[c>>2]=16,oe=0|St[c>>2],pt=l,0|oe;case 42:case 46:return St[c>>2]=2,oe=0|St[c>>2],pt=l,0|oe;case 48:return St[c>>2]=St[U>>2],oe=0|St[c>>2],pt=l,0|oe;case 50:return St[c>>2]=St[z>>2],oe=0|St[c>>2],pt=l,0|oe;case 52:return St[c>>2]=St[Y>>2],oe=0|St[c>>2],pt=l,0|oe;case 59:return St[c>>2]=St[V>>2],oe=0|St[c>>2],pt=l,0|oe;case 61:return St[c>>2]=St[K>>2],oe=0|St[c>>2],pt=l,0|oe;case 63:return St[c>>2]=St[W>>2],oe=0|St[c>>2],pt=l,0|oe;case 68:return St[c>>2]=St[G>>2],oe=0|St[c>>2],pt=l,0|oe;case 72:return St[c>>2]=St[q>>2],oe=0|St[c>>2],pt=l,0|oe;case 74:return St[c>>2]=St[Q>>2],oe=0|St[c>>2],pt=l,0|oe;case 79:return St[c>>2]=St[$>>2],oe=0|St[c>>2],pt=l,0|oe;case 81:return St[c>>2]=St[ee>>2],oe=0|St[c>>2],pt=l,0|oe;case 85:return St[c>>2]=St[re>>2],oe=0|St[c>>2],pt=l,0|oe;case 86:for(St[te>>2]=0,St[ne>>2]=0,St[A>>2]=0;!((0|St[A>>2])>>>0>=(0|St[v>>2])>>>0);)St[ie>>2]=(0|St[M>>2])+(St[A>>2]<<5),(Et[26+(0|St[ie>>2])>>0]=0)|St[St[h>>2]>>2]?Et[24+(0|St[ie>>2])>>0]=0|mt[(0|St[St[h>>2]>>2])+(0|St[A>>2])>>0]?0:1:Et[24+(0|St[ie>>2])>>0]=1,0|Et[24+(0|St[ie>>2])>>0]?(Et[25+(0|St[ie>>2])>>0]=0,re=(0|St[St[_>>2]>>2])+(St[ne>>2]<<3)|0,ee=0|St[re+4>>2],$=8+(0|St[ie>>2])|0,St[$>>2]=St[re>>2],St[$+4>>2]=ee,St[16+(0|St[ie>>2])>>2]=St[(0|St[St[m>>2]>>2])+(St[ne>>2]<<2)>>2],Et[27+(0|St[ie>>2])>>0]=0|Et[(0|St[St[S>>2]>>2])+(0|St[ne>>2])>>0],St[ne>>2]=1+(0|St[ne>>2])):(0|St[St[p>>2]>>2]?Et[25+(0|St[ie>>2])>>0]=0|mt[(0|St[St[p>>2]>>2])+(0|St[te>>2])>>0]?0:1:Et[25+(0|St[ie>>2])>>0]=1,St[te>>2]=1+(0|St[te>>2]),ee=8+(0|St[ie>>2])|0,St[ee>>2]=0,St[ee+4>>2]=0,St[16+(0|St[ie>>2])>>2]=0,Et[27+(0|St[ie>>2])>>0]=0),St[A>>2]=1+(0|St[A>>2]);return A=0|function(e,r){e|=0,r|=0;var t=0,n=0,i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0;(0|(pt=(t=pt)+48|0))>=(0|bt)&&yt(48);if(n=t+40|0,o=t+32|0,a=t+28|0,s=(u=t)+24|0,f=t+20|0,l=t+16|0,c=t+12|0,d=t+8|0,St[(i=t+36|0)>>2]=e,St[o>>2]=r,St[a>>2]=0,St[(r=u)>>2]=0,St[r+4>>2]=0,St[f>>2]=0,St[l>>2]=0,0|St[24+(0|St[i>>2])>>2]){if(r=0|sr[3&St[St[o>>2]>>2]](0|St[o>>2],St[24+(0|St[i>>2])>>2]<<2),!(St[48+(0|St[i>>2])>>2]=r))return St[n>>2]=2,E=0|St[n>>2],pt=t,0|E}else St[48+(0|St[i>>2])>>2]=0;St[s>>2]=0;for(;!((0|St[s>>2])>>>0>=(0|St[24+(0|St[i>>2])>>2])>>>0);)St[(0|St[48+(0|St[i>>2])>>2])+(St[s>>2]<<2)>>2]=St[a>>2],St[a>>2]=(0|St[a>>2])+(0|St[(0|St[12+(0|St[i>>2])>>2])+(40*(0|St[s>>2])|0)+24>>2]),St[s>>2]=1+(0|St[s>>2]);if(0|St[20+(0|St[i>>2])>>2]){if(a=0|sr[3&St[St[o>>2]>>2]](0|St[o>>2],St[20+(0|St[i>>2])>>2]<<3),!(St[52+(0|St[i>>2])>>2]=a))return St[n>>2]=2,E=0|St[n>>2],pt=t,0|E}else St[52+(0|St[i>>2])>>2]=0;St[s>>2]=0;for(;!((0|St[s>>2])>>>0>=(0|St[20+(0|St[i>>2])>>2])>>>0);)r=0|St[(a=u)+4>>2],e=(0|St[52+(0|St[i>>2])>>2])+(St[s>>2]<<3)|0,St[e>>2]=St[a>>2],St[e+4>>2]=r,r=(0|St[St[i>>2]>>2])+(St[s>>2]<<3)|0,a=0|Dt(0|St[(e=u)>>2],0|St[e+4>>2],0|St[r>>2],0|St[r+4>>2]),St[(r=u)>>2]=a,St[r+4>>2]=Ft,St[s>>2]=1+(0|St[s>>2]);if(0|St[24+(0|St[i>>2])>>2]){if(u=0|sr[3&St[St[o>>2]>>2]](0|St[o>>2],St[24+(0|St[i>>2])>>2]<<2),!(St[56+(0|St[i>>2])>>2]=u))return St[n>>2]=2,E=0|St[n>>2],pt=t,0|E}else St[56+(0|St[i>>2])>>2]=0;if(0|St[28+(0|St[i>>2])>>2]){if(u=0|sr[3&St[St[o>>2]>>2]](0|St[o>>2],St[28+(0|St[i>>2])>>2]<<2),!(St[60+(0|St[i>>2])>>2]=u))return St[n>>2]=2,E=0|St[n>>2],pt=t,0|E}else St[60+(0|St[i>>2])>>2]=0;St[s>>2]=0;e:for(;;){if((0|St[s>>2])>>>0>=(0|St[28+(0|St[i>>2])>>2])>>>0){_=36;break}if(St[c>>2]=(0|St[16+(0|St[i>>2])>>2])+(St[s>>2]<<5),St[d>>2]=1&(0!=(0|Et[24+(0|St[c>>2])>>0])^1),0!=(0|St[d>>2])&0==(0|St[l>>2]))St[(0|St[60+(0|St[i>>2])>>2])+(St[s>>2]<<2)>>2]=-1;else{r:do{if(!(0|St[l>>2]))for(;;){if((0|St[f>>2])>>>0>=(0|St[24+(0|St[i>>2])>>2])>>>0){_=29;break e}if(St[(0|St[56+(0|St[i>>2])>>2])+(St[f>>2]<<2)>>2]=St[s>>2],0|St[(0|St[12+(0|St[i>>2])>>2])+(40*(0|St[f>>2])|0)+36>>2])break r;St[f>>2]=1+(0|St[f>>2])}}while(0);St[(0|St[60+(0|St[i>>2])>>2])+(St[s>>2]<<2)>>2]=St[f>>2],0==(0|St[d>>2])&&(St[l>>2]=1+(0|St[l>>2]),(0|St[l>>2])>>>0>=(0|St[(0|St[12+(0|St[i>>2])>>2])+(40*(0|St[f>>2])|0)+36>>2])>>>0)&&(St[f>>2]=1+(0|St[f>>2]),St[l>>2]=0)}St[s>>2]=1+(0|St[s>>2])}{if(29==(0|_))return St[n>>2]=16,E=0|St[n>>2],pt=t,0|E;if(36==(0|_))return St[n>>2]=0,E=0|St[n>>2],pt=t,0|E}return 0}(0|St[d>>2],0|St[k>>2]),St[c>>2]=A,oe=0|St[c>>2],pt=l,0|oe}return 0}(0|St[o>>2],0|St[a>>2],f,l,c,d,E,_,0|St[u>>2],0|St[s>>2]),St[S>>2]=n,or[3&St[4+(0|St[s>>2])>>2]](0|St[s>>2],0|St[f>>2]),or[3&St[4+(0|St[s>>2])>>2]](0|St[s>>2],0|St[l>>2]),or[3&St[4+(0|St[s>>2])>>2]](0|St[s>>2],0|St[c>>2]),or[3&St[4+(0|St[s>>2])>>2]](0|St[s>>2],0|St[d>>2]),or[3&St[4+(0|St[s>>2])>>2]](0|St[s>>2],0|St[E>>2]),or[3&St[4+(0|St[s>>2])>>2]](0|St[s>>2],0|St[_>>2]),pt=i,0|St[S>>2]}(0|St[a>>2],y,0|St[s>>2],0|St[f>>2]),St[h>>2]=w;break}St[h>>2]=4;break}}while(0);return Le(m,0|St[f>>2]),St[o>>2]=St[h>>2],O=0|St[o>>2],pt=i,0|O}(0|St[o>>2],0|St[a>>2],0|St[u>>2],0|St[s>>2]),St[f>>2]=n,pt=(l=(0|St[f>>2]&&$(0|St[o>>2],0|St[u>>2]),0|St[f>>2]),i),0|l}(s,o,a,u))return $(s,a),oe(m),K(1),void(pt=r);St[l>>2]=-1,S=(St[c>>2]=0)|St[(i=s+28|0)>>2];e:do{if(S){for(h=s+16|0,p=0|St[h>>2],k=0,F=0;F=0|Dt(0|St[(w=p+(k<<5)+8|0)>>2],0|St[w+4>>2],0|F,0),k=k+1|0,(0|k)!=(0|S););for(v=y=w=k=0,M=p,O=S;;){if(Pt(0|d,0,255),St[E>>2]=0,(St[_>>2]=0)|Et[M+(v<<5)+25>>0])P=y,C=k,I=w,L=O;else{if(w>>>0<(A=0|ee(s,v,0))>>>0){if(Ge(k),!(R=0|Xe(A<<1)))break;g=R,T=A}else g=k,T=w;if(ee(s,v,g),0|g){for(A=St[n>>2]=0;0|_t[g+(A<<1)>>1];)A=A+1|0;j(0,n,g,A),N=1+(0|St[n>>2])|0,0|(D=0|Xe(St[n>>2]=N))&&0|j(D,n,g,A)&&(Et[D+(0|St[n>>2])>>0]=0,function(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,o=0,a=0,u=0,s=0;(0|(pt=(n=pt)+32|0))>=(0|bt)&&yt(32),o=n+12|0,a=n+8|0,u=n+4|0,St[(i=(s=n)+16|0)>>2]=e,St[o>>2]=r,St[a>>2]=t,St[u>>2]=0,St[s>>2]=St[a>>2];r:do{if(0|St[s>>2])for(;;){if(t=(0|St[s>>2])-1|0,!(St[s>>2]=t))break r;if(t=0|St[o>>2],St[o>>2]=t+1,r=0|Et[t>>0],t=0|St[i>>2],St[i>>2]=t+1,!((Et[t>>0]=r)<<24>>24))break r;St[u>>2]=1+(0|St[u>>2])}}while(0);if(0|St[s>>2])return St[u>>2],pt=n;for(0|St[a>>2]&&(Et[St[i>>2]>>0]=0);i=0|St[o>>2],St[o>>2]=i+1,0|Et[i>>0];)St[u>>2]=1+(0|St[u>>2]);St[u>>2],pt=n}(d,D,255)),Ge(D)}D=0|St[M+(v<<5)+8>>2],0|(N=0|W(s,o,v,l,f,c,E,_,a,u,F,y))&&(St[t>>2]=N,function(e,r){e|=0,r|=0;var t=0,n=0;(0|(pt=(t=pt)+16|0))>=(0|bt)&&yt(16),St[(n=t)>>2]=r,r=0|function(e,r,t){e|=0,r|=0,t|=0;var n=0,i=0,o=0,a=0,u=0,s=0,f=0,l=0,c=0,d=0,E=0,_=0,S=0,m=0,h=0;(0|(pt=(n=pt)+224|0))>=(0|bt)&&yt(224);i=n+120|0,u=(a=n)+136|0,f=40+(s=o=n+80|0)|0;for(;St[s>>2]=0,s=s+4|0,(0|s)<(0|f););St[i>>2]=St[t>>2],l=(0|Ue(0,r,i,a,o))<0?-1:(c=-1<(0|St[e+76>>2])?0|ze():0,t=0|St[e>>2],s=32&t,(0|Et[e+74>>0])<1&&(St[e>>2]=-33&t),m=0|St[(t=e+48|0)>>2]?0|Ue(e,r,i,a,o):(d=0|St[(f=e+44|0)>>2],St[f>>2]=u,St[(E=e+28|0)>>2]=u,St[(_=e+20|0)>>2]=u,St[t>>2]=80,St[(S=e+16|0)>>2]=80+u,u=0|Ue(e,r,i,a,o),d?(nr[15&St[e+36>>2]](e,0,0),h=0==(0|St[_>>2])?-1:u,St[f>>2]=d,St[t>>2]=0,St[S>>2]=0,St[E>>2]=0,St[_>>2]=0,h):u),o=0|St[e>>2],St[e>>2]=o|s,0|c&&He(),0==(32&o|0)?m:-1);return pt=n,0|l}(0|St[5],e,n),pt=t}(169,t)),B(0,0|d,0|D,(0|St[f>>2])+(0|St[E>>2])|0),P=D+y|0,C=g,I=T,L=0|St[i>>2]}if(L>>>0<=(D=v+1|0)>>>0){b=C;break e}k=C,w=I,y=P,v=D,M=0|St[h>>2],O=L}b=R}else b=0}while(0);Ge(b),or[3&St[e>>2]](a,0|St[f>>2]),$(s,a),oe(m),K(1),pt=r},_pthread_self:$e,_memset:Pt,_llvm_cttz_i32:qe,_malloc:Xe,_memcpy:Je,_bitshift64Lshr:Ct,_fflush:Ve,___udivdi3:Lt,___uremdi3:xt,___errno_location:vt,_bitshift64Shl:It,runPostSets:function(){},_emscripten_replace_memory:function(e){return!(16777215&c(e)||c(e)<=16777215||2147483648>2],e=-16&(r+e+15|0);if((HEAP32[DYNAMICTOP_PTR>>2]=e,TOTAL_MEMORY<=e)&&!enlargeMemory())return HEAP32[DYNAMICTOP_PTR>>2]=r,0;return r},alignMemory:function(e,r){return e=Math.ceil(e/(r||16))*(r||16)},makeBigInt:function(e,r,t){return t?+(e>>>0)+4294967296*(r>>>0):+(e>>>0)+4294967296*(0|r)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0,cwrap,ccall;function assert(e,r){e||abort("Assertion failed: "+r)}function getCFunc(_0x5d9040){var _0x23b817=Module["_"+_0x5d9040];if(!_0x23b817)try{_0x23b817=eval("_"+_0x5d9040)}catch(_0x2989f0){}return assert(_0x23b817,"Cannot call unknown function "+_0x5d9040+" (perhaps LLVM optimizations or closure removed it?)"),_0x23b817}function setValue(e,r,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":HEAP8[e>>0]=r;break;case"i16":HEAP16[e>>1]=r;break;case"i32":HEAP32[e>>2]=r;break;case"i64":tempI64=[r>>>0,(tempDouble=r,1<=+Math_abs(tempDouble)?0>>0:~~+Math_ceil((tempDouble-(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=r;break;case"double":HEAPF64[e>>3]=r;break;default:abort("invalid type for setValue: "+t)}}function getValue(e,r,t){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+r)}return null}!function(){var _0x2ad24a={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var r=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,r),r},stringToC:function(e){var r,t=0;return null!=e&&0!==e&&(r=1+(e.length<<2),stringToUTF8(e,t=Runtime.stackAlloc(r),r)),t}},_0x3c7171={string:_0x2ad24a.stringToC,array:_0x2ad24a.arrayToC};ccall=function(e,r,t,n,o){var e=getCFunc(e),i=[],a=0;if(assert("array"!==r,'Return type should not be "array".'),n)for(var s=0;s>2]=0;for(u=s+i;n>0]=0;return s}if("i8"===a)return e.subarray||e.slice?HEAPU8.set(e,s):HEAPU8.set(new Uint8Array(e),s),s;for(var c,l,f,d=0;d>0],(0!=t||r)&&(o++,!r||o!=r););r=r||o;var i="";if(n<128){for(var a;0>0];if(!t)return r;r+=String.fromCharCode(t)}}function stringToAscii(e,r){return writeAsciiToMemory(e,r,!1)}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,r){for(var t=r;e[t];)++t;if(16>10,56320|1023&o))):u+=String.fromCharCode((31&a)<<6|s)):u+=String.fromCharCode(a)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,r,t,n){if(!(0>6,r[t++]=128|63&s}else if(s<=65535){if(i<=t+2)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else if(s<=2097151){if(i<=t+3)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}else if(s<=67108863){if(i<=t+4)break;r[t++]=248|s>>24,r[t++]=128|s>>18&63,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(i<=t+5)break;r[t++]=252|s>>30,r[t++]=128|s>>24&63,r[t++]=128|s>>18&63,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function stringToUTF8(e,r,t){return assert("number"==typeof t,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),stringToUTF8Array(e,HEAPU8,r,t)}function lengthBytesUTF8(e){for(var r=0,t=0;t>2)-1]=34821223,HEAPU32[(STACK_MAX>>2)-2]=2310721022}function checkStackCookie(){if(34821223==HEAPU32[(STACK_MAX>>2)-1]&&2310721022==HEAPU32[(STACK_MAX>>2)-2]||abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+HEAPU32[(STACK_MAX>>2)-2].toString(16)+" "+HEAPU32[(STACK_MAX>>2)-1].toString(16)),1668509029!==HEAP32[0])throw"Runtime error: The application has corrupted its heap memory area (address zero)!"}function abortStackOverflow(e){abort("Stack overflow! Attempted to allocate "+e+" bytes on the stack, but stack has only "+(STACK_MAX-Module.asm.stackSave()+e)+" bytes available!")}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){assert(HEAP32[DYNAMICTOP_PTR>>2]>TOTAL_MEMORY);var e=Module.usingWasm?WASM_PAGE_SIZE:ASMJS_PAGE_SIZE,r=2147483648-e;if(HEAP32[DYNAMICTOP_PTR>>2]>r)return Module.printErr("Cannot enlarge memory, asked to go up to "+HEAP32[DYNAMICTOP_PTR>>2]+" bytes, but the limit is "+r+" bytes!"),!1;var t=TOTAL_MEMORY;for(TOTAL_MEMORY=Math.max(TOTAL_MEMORY,MIN_TOTAL_MEMORY);TOTAL_MEMORY>2];)TOTAL_MEMORY=TOTAL_MEMORY<=536870912?alignUp(2*TOTAL_MEMORY,e):Math.min(alignUp((3*TOTAL_MEMORY+2147483648)/4,e),r);var n=Date.now(),o=Module.reallocBuffer(TOTAL_MEMORY);return o&&o.byteLength==TOTAL_MEMORY?(updateGlobalBuffer(o),updateGlobalBufferViews(),Module.printErr("enlarged memory arrays from "+t+" to "+TOTAL_MEMORY+", took "+(Date.now()-n)+" ms (has ArrayBuffer.transfer? "+!!ArrayBuffer.transfer+")"),Module.usingWasm||Module.printErr("Warning: Enlarging memory arrays, this is not fast! "+[t,TOTAL_MEMORY]),!0):(Module.printErr("Failed to grow the heap from "+t+" bytes to "+TOTAL_MEMORY+" bytes, not enough memory!"),o&&Module.printErr("Expected to get back a buffer of size "+TOTAL_MEMORY+" bytes, but instead got back a buffer of size "+o.byteLength),TOTAL_MEMORY=t,!1)}STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1,Module.reallocBuffer||(Module.reallocBuffer=function(e){var r,t;try{ArrayBuffer.transfer?t=ArrayBuffer.transfer(buffer,e):(r=HEAP8,t=new ArrayBuffer(e),new Int8Array(t).set(r))}catch(e){return!1}return!!_emscripten_replace_memory(t)&&t});try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(_0x5226f8){byteLength=function(e){return e.byteLength}}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216;function getTotalMemory(){return TOTAL_MEMORY}if(TOTAL_MEMORY>0]=e.charCodeAt(n);t||(HEAP8[r>>0]=0)}Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,r){var t=65535&e,n=65535&r;return t*n+((e>>>16)*n+t*(r>>>16)<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var r=0;r<32;r++)if(e&1<<31-r)return r;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null,runDependencyTracking={};function getUniqueRunDependency(e){for(var r=e;;){if(!runDependencyTracking[e])return e;e=r+Math.random()}return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(!runDependencyTracking[e]),runDependencyTracking[e]=1,null===runDependencyWatcher&&"undefined"!=typeof setInterval&&(runDependencyWatcher=setInterval(function(){if(ABORT)return clearInterval(runDependencyWatcher),void(runDependencyWatcher=null);var e,r=!1;for(e in runDependencyTracking)r||(r=!0,Module.printErr("still waiting on run dependencies:")),Module.printErr("dependency: "+e);r&&Module.printErr("(end of list)")},1e4))):Module.printErr("warning: run dependency added without ID")}function removeRunDependency(e){runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(runDependencyTracking[e]),delete runDependencyTracking[e]):Module.printErr("warning: run dependency removed without ID"),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled&&(e=dependenciesFulfilled,dependenciesFulfilled=null,e()))}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(e,r,t){for(var n=new Uint8Array(r),o=0;o>2]=e:Module.printErr("failed to set errno from JS"),e}var PATH={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,r){for(var t=0,n=e.length-1;0<=n;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:function(e){var r="/"===e.charAt(0),t="/"===e.substr(-1);return(e=PATH.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:function(e){var r=PATH.splitPath(e),e=r[0],r=r[1];return e||r?e+(r=r&&r.substr(0,r.length-1)):"."},basename:function(e){if("/"===e)return"/";var r=e.lastIndexOf("/");return-1===r?e:e.substr(r+1)},extname:function(e){return PATH.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return PATH.normalize(e.join("/"))},join2:function(e,r){return PATH.normalize(e+"/"+r)},resolve:function(){for(var e="",r=!1,t=arguments.length-1;-1<=t&&!r;t--){var n=0<=t?arguments[t]:FS.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r="/"===n.charAt(0)}return(r?"/":"")+(e=PATH.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||"."},relative:function(e,r){function t(e){for(var r=0;re.contents.length&&(e.contents=MEMFS.getFileDataAsRegularArray(e),e.usedBytes=e.contents.length),!e.contents||e.contents.subarray){var t=e.contents?e.contents.length:0;if(r<=t)return;r=Math.max(r,t*(t<1048576?2:1.125)|0),0!=t&&(r=Math.max(r,256));t=e.contents;return e.contents=new Uint8Array(r),void(0r)e.contents.length=r;else for(;e.contents.length=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(assert(0<=a),8t.timestamp)&&(a.push(e),i++)});var t=[];if(Object.keys(o.entries).forEach(function(e){o.entries[e];n.entries[e]||(t.push(e),i++)}),!i)return r(null);var s=0,e=("remote"===n.type?n:o).db.transaction([IDBFS.DB_STORE_NAME],"readwrite"),u=e.objectStore(IDBFS.DB_STORE_NAME);function c(e){return e?c.errored?void 0:(c.errored=!0,r(e)):++s>=i?r(null):void 0}e.onerror=function(e){c(this.error),e.preventDefault()},a.sort().forEach(function(t){"local"===o.type?IDBFS.loadRemoteEntry(u,t,function(e,r){return e?c(e):void IDBFS.storeLocalEntry(t,r,c)}):IDBFS.loadLocalEntry(t,function(e,r){return e?c(e):void IDBFS.storeRemoteEntry(u,t,r,c)})}),t.sort().reverse().forEach(function(e){"local"===o.type?IDBFS.removeLocalEntry(e,c):IDBFS.removeRemoteEntry(u,e,c)})}},NODEFS={isWindows:!1,staticInit:function(){NODEFS.isWindows=!!process.platform.match(/^win/)},mount:function(e){return assert(ENVIRONMENT_IS_NODE),NODEFS.createNode(null,"/",NODEFS.getMode(e.opts.root),0)},createNode:function(e,r,t,n){if(!FS.isDir(t)&&!FS.isFile(t)&&!FS.isLink(t))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);t=FS.createNode(e,r,t);return t.node_ops=NODEFS.node_ops,t.stream_ops=NODEFS.stream_ops,t},getMode:function(e){var r;try{r=fs.lstatSync(e),NODEFS.isWindows&&(r.mode=r.mode|(146&r.mode)>>1)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return r.mode},realPath:function(e){for(var r=[];e.parent!==e;)r.push(e.name),e=e.parent;return r.push(e.mount.opts.root),r.reverse(),PATH.join.apply(null,r)},flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:function(e){if(e&=-2097153,e&=-2049,e&=-32769,(e&=-524289)in NODEFS.flagsToPermissionStringMap)return NODEFS.flagsToPermissionStringMap[e];throw new FS.ErrnoError(ERRNO_CODES.EINVAL)},node_ops:{getattr:function(e){var r,t=NODEFS.realPath(e);try{r=fs.lstatSync(t)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return NODEFS.isWindows&&!r.blksize&&(r.blksize=4096),NODEFS.isWindows&&!r.blocks&&(r.blocks=(r.size+r.blksize-1)/r.blksize|0),{dev:r.dev,ino:r.ino,mode:r.mode,nlink:r.nlink,uid:r.uid,gid:r.gid,rdev:r.rdev,size:r.size,atime:r.atime,mtime:r.mtime,ctime:r.ctime,blksize:r.blksize,blocks:r.blocks}},setattr:function(e,r){var t,n=NODEFS.realPath(e);try{void 0!==r.mode&&(fs.chmodSync(n,r.mode),e.mode=r.mode),void 0!==r.timestamp&&(t=new Date(r.timestamp),fs.utimesSync(n,t,t)),void 0!==r.size&&fs.truncateSync(n,r.size)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},lookup:function(e,r){var t=PATH.join2(NODEFS.realPath(e),r),t=NODEFS.getMode(t);return NODEFS.createNode(e,r,t)},mknod:function(e,r,t,n){var o=NODEFS.createNode(e,r,t,n),i=NODEFS.realPath(o);try{FS.isDir(o.mode)?fs.mkdirSync(i,o.mode):fs.writeFileSync(i,"",{mode:o.mode})}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return o},rename:function(e,r,t){var n=NODEFS.realPath(e),o=PATH.join2(NODEFS.realPath(r),t);try{fs.renameSync(n,o)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},unlink:function(e,r){var t=PATH.join2(NODEFS.realPath(e),r);try{fs.unlinkSync(t)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},rmdir:function(e,r){var t=PATH.join2(NODEFS.realPath(e),r);try{fs.rmdirSync(t)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},readdir:function(e){var r=NODEFS.realPath(e);try{return fs.readdirSync(r)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},symlink:function(e,r,t){var n=PATH.join2(NODEFS.realPath(e),r);try{fs.symlinkSync(t,n)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},readlink:function(e){var r=NODEFS.realPath(e);try{return r=fs.readlinkSync(r),NODEJS_PATH.relative(NODEJS_PATH.resolve(e.mount.opts.root),r)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}},stream_ops:{open:function(e){var r=NODEFS.realPath(e.node);try{FS.isFile(e.node.mode)&&(e.nfd=fs.openSync(r,NODEFS.flagsToPermissionString(e.flags)))}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},close:function(e){try{FS.isFile(e.node.mode)&&e.nfd&&fs.closeSync(e.nfd)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},read:function(e,r,t,n,o){if(0===n)return 0;var i,a=new Buffer(n);try{i=fs.readSync(e.nfd,a,0,n,o)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(0=e.node.size)return 0;o=e.node.contents.slice(o,o+n),n=WORKERFS.reader.readAsArrayBuffer(o);return r.set(new Uint8Array(n),t),o.size},write:function(e,r,t,n,o){throw new FS.ErrnoError(ERRNO_CODES.EIO)},llseek:function(e,r,t){if(1===t?r+=e.position:2===t&&FS.isFile(e.node.mode)&&(r+=e.node.size),r<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return r}}};STATICTOP+=16,STATICTOP+=16,STATICTOP+=16;var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)},lookupPath:function(e,r){if(r=r||{},!(e=PATH.resolve(FS.cwd(),e)))return{path:"",node:null};var t,n={follow_mount:!0,recurse_count:0};for(t in n)void 0===r[t]&&(r[t]=n[t]);if(8>>0)%FS.nameTable.length},hashAddNode:function(e){var r=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[r],FS.nameTable[r]=e},hashRemoveNode:function(e){var r=FS.hashName(e.parent.id,e.name);if(FS.nameTable[r]===e)FS.nameTable[r]=e.name_next;else for(var t=FS.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:function(e,r){var t=FS.mayLookup(e);if(t)throw new FS.ErrnoError(t,e);for(var t=FS.hashName(e.id,r),n=FS.nameTable[t];n;n=n.name_next){var o=n.name;if(n.parent.id===e.id&&o===r)return n}return FS.lookup(e,r)},createNode:function(e,r,t,n){FS.FSNode||(FS.FSNode=function(e,r,t,n){e=e||this,this.parent=e,this.mount=e.mount,this.mounted=null,this.id=FS.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},FS.FSNode.prototype={},Object.defineProperties(FS.FSNode.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}}));n=new FS.FSNode(e,r,t,n);return FS.hashAddNode(n),n},destroyNode:function(e){FS.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var r=FS.flagModes[e];if(void 0===r)throw new Error("Unknown file open mode: "+e);return r},flagsToPermissionString:function(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:function(e,r){return FS.ignorePermissions||(-1===r.indexOf("r")||292&e.mode)&&(-1===r.indexOf("w")||146&e.mode)&&(-1===r.indexOf("x")||73&e.mode)?0:ERRNO_CODES.EACCES},mayLookup:function(e){var r=FS.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:ERRNO_CODES.EACCES)},mayCreate:function(e,r){try{FS.lookupNode(e,r);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(e,"wx")},mayDelete:function(e,r,t){var n;try{n=FS.lookupNode(e,r)}catch(e){return e.errno}var o=FS.nodePermissions(e,"wx");if(o)return o;if(t){if(!FS.isDir(n.mode))return ERRNO_CODES.ENOTDIR;if(FS.isRoot(n)||FS.getPath(n)===FS.cwd())return ERRNO_CODES.EBUSY}else if(FS.isDir(n.mode))return ERRNO_CODES.EISDIR;return 0},mayOpen:function(e,r){return e?FS.isLink(e.mode)?ERRNO_CODES.ELOOP:FS.isDir(e.mode)&&("r"!==FS.flagsToPermissionString(r)||512&r)?ERRNO_CODES.EISDIR:FS.nodePermissions(e,FS.flagsToPermissionString(r)):ERRNO_CODES.ENOENT},MAX_OPEN_FDS:4096,nextfd:function(e,r){e=e||0,r=r||FS.MAX_OPEN_FDS;for(var t=e;t<=r;t++)if(!FS.streams[t])return t;throw new FS.ErrnoError(ERRNO_CODES.EMFILE)},getStream:function(e){return FS.streams[e]},createStream:function(e,r,t){FS.FSStream||(FS.FSStream=function(){},FS.FSStream.prototype={},Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}));var n,o=new FS.FSStream;for(n in e)o[n]=e[n];e=o;t=FS.nextfd(r,t);return e.fd=t,FS.streams[t]=e},closeStream:function(e){FS.streams[e]=null},chrdev_stream_ops:{open:function(e){var r=FS.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,r){return e<<8|r},registerDevice:function(e,r){FS.devices[e]={stream_ops:r}},getDevice:function(e){return FS.devices[e]},getMounts:function(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:function(r,t){"function"==typeof r&&(t=r,r=!1),FS.syncFSRequests++,1=n.length&&i(null)}n.forEach(function(e){return e.type.syncfs?void e.type.syncfs(e,r,a):a(null)})},mount:function(e,r,t){var n="/"===t,o=!t;if(n&&FS.root)throw new FS.ErrnoError(ERRNO_CODES.EBUSY);if(!n&&!o){var i=FS.lookupPath(t,{follow_mount:!1});if(t=i.path,i=i.node,FS.isMountpoint(i))throw new FS.ErrnoError(ERRNO_CODES.EBUSY);if(!FS.isDir(i.mode))throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}t={type:e,opts:r,mountpoint:t,mounts:[]},e=e.mount(t);return(e.mount=t).root=e,n?FS.root=e:i&&(i.mounted=t,i.mount&&i.mount.mounts.push(t)),e},unmount:function(e){var r=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(r.node))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var e=r.node,r=e.mounted,n=FS.getMounts(r);Object.keys(FS.nameTable).forEach(function(e){for(var r=FS.nameTable[e];r;){var t=r.name_next;-1!==n.indexOf(r.mount)&&FS.destroyNode(r),r=t}}),e.mounted=null;r=e.mount.mounts.indexOf(r);assert(-1!==r),e.mount.mounts.splice(r,1)},lookup:function(e,r){return e.node_ops.lookup(e,r)},mknod:function(e,r,t){var n=FS.lookupPath(e,{parent:!0}).node,o=PATH.basename(e);if(!o||"."===o||".."===o)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);e=FS.mayCreate(n,o);if(e)throw new FS.ErrnoError(e);if(!n.node_ops.mknod)throw new FS.ErrnoError(ERRNO_CODES.EPERM);return n.node_ops.mknod(n,o,r,t)},create:function(e,r){return r=void 0!==r?r:438,r&=4095,r|=32768,FS.mknod(e,r,0)},mkdir:function(e,r){return r=void 0!==r?r:511,r&=1023,r|=16384,FS.mknod(e,r,0)},mkdirTree:function(e,r){for(var t=e.split("/"),n="",o=0;othis.length-1||e<0)){var r=e%this.chunkSize,e=e/this.chunkSize|0;return this.getter(e)[r]}},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",a,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw new Error("Couldn't load "+a+". Status: "+e.status);var n=Number(e.getResponseHeader("Content-length")),r=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,t=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,o=1048576;r||(o=n);var i=this;i.setDataGetter(function(e){var r=e*o,t=(e+1)*o-1,t=Math.min(t,n-1);if(void 0===i.chunks[e]&&(i.chunks[e]=function(e,r){if(r=i.length)return 0;var a=Math.min(i.length-o,n);if(assert(0<=a),i.slice)for(var s=0;s>2]=n.dev,HEAP32[t+4>>2]=0,HEAP32[t+8>>2]=n.ino,HEAP32[t+12>>2]=n.mode,HEAP32[t+16>>2]=n.nlink,HEAP32[t+20>>2]=n.uid,HEAP32[t+24>>2]=n.gid,HEAP32[t+28>>2]=n.rdev,HEAP32[t+32>>2]=0,HEAP32[t+36>>2]=n.size,HEAP32[t+40>>2]=4096,HEAP32[t+44>>2]=n.blocks,HEAP32[t+48>>2]=n.atime.getTime()/1e3|0,HEAP32[t+52>>2]=0,HEAP32[t+56>>2]=n.mtime.getTime()/1e3|0,HEAP32[t+60>>2]=0,HEAP32[t+64>>2]=n.ctime.getTime()/1e3|0,HEAP32[t+68>>2]=0,HEAP32[t+72>>2]=n.ino,0},doMsync:function(e,r,t,n){e=new Uint8Array(HEAPU8.subarray(e,e+t));FS.msync(r,e,0,t,n)},doMkdir:function(e,r){return"/"===(e=PATH.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),FS.mkdir(e,r,0),0},doMknod:function(e,r,t){switch(61440&r){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}return FS.mknod(e,r,t),0},doReadlink:function(e,r,t){if(t<=0)return-ERRNO_CODES.EINVAL;var n=FS.readlink(e),o=Math.min(t,lengthBytesUTF8(n)),e=HEAP8[r+o];return stringToUTF8(n,r,t+1),HEAP8[r+o]=e,o},doAccess:function(e,r){if(-8&r)return-ERRNO_CODES.EINVAL;var t=FS.lookupPath(e,{follow:!0}).node,e="";return 4&r&&(e+="r"),2&r&&(e+="w"),1&r&&(e+="x"),e&&FS.nodePermissions(t,e)?-ERRNO_CODES.EACCES:0},doDup:function(e,r,t){var n=FS.getStream(t);return n&&FS.close(n),FS.open(e,r,0,t,t).fd},doReadv:function(e,r,t,n){for(var o=0,i=0;i>2],s=HEAP32[r+(8*i+4)>>2],a=FS.read(e,HEAP8,a,s,n);if(a<0)return-1;if(o+=a,a>2],s=HEAP32[r+(8*i+4)>>2],s=FS.write(e,HEAP8,a,s,n);if(s<0)return-1;o+=s}return o},varargs:0,get:function(e){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},getStreamFromFD:function(){var e=FS.getStream(SYSCALLS.get());if(!e)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return e},getSocketFromFD:function(){var e=SOCKFS.getSocket(SYSCALLS.get());if(!e)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return e},getSocketAddress:function(e){var r=SYSCALLS.get(),t=SYSCALLS.get();if(e&&0===r)return null;t=__read_sockaddr(r,t);if(t.errno)throw new FS.ErrnoError(t.errno);return t.addr=DNS.lookup_addr(t.addr)||t.addr,t},get64:function(){var e=SYSCALLS.get(),r=SYSCALLS.get();return assert(0<=e?0===r:-1===r),e},getZero:function(){assert(0===SYSCALLS.get())}};function ___syscall5(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStr(),n=SYSCALLS.get(),o=SYSCALLS.get();return FS.open(t,n,o).fd}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___lock(){}function ___unlock(){}function ___syscall6(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD();return FS.close(t),0}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC),fs,NODEJS_PATH;function _emscripten_memcpy_big(e,r,t){return HEAPU8.set(HEAPU8.subarray(r,r+t),e),e}function ___syscall140(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD(),n=(SYSCALLS.get(),SYSCALLS.get()),o=SYSCALLS.get(),i=SYSCALLS.get(),n=n;return FS.llseek(t,n,i),HEAP32[o>>2]=t.position,t.getdents&&0===n&&0===i&&(t.getdents=null),0}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD(),n=SYSCALLS.get(),o=SYSCALLS.get();return SYSCALLS.doWritev(t,n,o)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD(),n=SYSCALLS.get();switch(n){case 21505:case 21506:return t.tty?0:-ERRNO_CODES.ENOTTY;case 21519:if(!t.tty)return-ERRNO_CODES.ENOTTY;var o=SYSCALLS.get();return HEAP32[o>>2]=0;case 21520:return t.tty?-ERRNO_CODES.EINVAL:-ERRNO_CODES.ENOTTY;case 21531:o=SYSCALLS.get();return FS.ioctl(t,n,o);case 21523:return t.tty?0:-ERRNO_CODES.ENOTTY;default:abort("bad ioctl syscall "+n)}}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall221(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD();switch(SYSCALLS.get()){case 0:return(n=SYSCALLS.get())<0?-ERRNO_CODES.EINVAL:FS.open(t.path,t.flags,0,n).fd;case 1:case 2:return 0;case 3:return t.flags;case 4:var n=SYSCALLS.get();return t.flags|=n,0;case 12:case 12:n=SYSCALLS.get();return HEAP16[n+0>>1]=2,0;case 13:case 14:case 13:case 14:return 0;case 16:case 8:return-ERRNO_CODES.EINVAL;case 9:return ___setErrNo(ERRNO_CODES.EINVAL),-1;default:return-ERRNO_CODES.EINVAL}}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall145(e,r){SYSCALLS.varargs=r;try{var t=SYSCALLS.getStreamFromFD(),n=SYSCALLS.get(),o=SYSCALLS.get();return SYSCALLS.doReadv(t,n,o)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function nullFunc_ii(e){Module.printErr("Invalid function pointer called with signature 'ii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),Module.printErr("Build with ASSERTIONS=2 for more info."),abort(e)}function nullFunc_iiii(e){Module.printErr("Invalid function pointer called with signature 'iiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),Module.printErr("Build with ASSERTIONS=2 for more info."),abort(e)}function invoke_ii(e,r){try{return Module.dynCall_ii(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_iiii(e,r,t,n){try{return Module.dynCall_iiii(e,r,t,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}FS.staticInit(),__ATINIT__.unshift(function(){Module.noFSInit||FS.init.initialized||FS.init()}),__ATMAIN__.push(function(){FS.ignorePermissions=!1}),__ATEXIT__.push(function(){FS.quit()}),Module.FS_createFolder=FS.createFolder,Module.FS_createPath=FS.createPath,Module.FS_createDataFile=FS.createDataFile,Module.FS_createPreloadedFile=FS.createPreloadedFile,Module.FS_createLazyFile=FS.createLazyFile,Module.FS_createLink=FS.createLink,Module.FS_createDevice=FS.createDevice,Module.FS_unlink=FS.unlink,__ATINIT__.unshift(function(){TTY.init()}),__ATEXIT__.push(function(){TTY.shutdown()}),ENVIRONMENT_IS_NODE&&(fs=require("fs"),NODEJS_PATH=require("path"),NODEFS.staticInit()),DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0,assert(DYNAMIC_BASE=(0|Je)&&Qe(48);n=t+32|0,o=t+16|0,i=t,s=0|Le(3788,0|Xe[r>>0],4)?(a=0|function(e){var r=0,t=0,n=0,o=0;return r=0==(0|G(e=e|0,43)),t=0|Xe[e>>0],n=r?t<<24>>24!=114&1:2,r=0==(0|G(e,120)),o=r?n:128|n,n=0==(0|G(e,101)),e=n?o:524288|o,o=t<<24>>24==114?e:64|e,e=t<<24>>24==119?512|o:o,0|(t<<24>>24==97?1024|e:e)}(r),Ge[i>>2]=e,Ge[i+4>>2]=32768|a,Ge[i+8>>2]=438,e=0|U(0|A(5,0|i)),0<=(0|e)?(524288&a|0&&(Ge[o>>2]=e,Ge[o+4>>2]=2,Ge[o+8>>2]=1,M(221,0|o)),(o=0|function(e,r){e|=0,r|=0;var t=0,n=0,o=0,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,E=0,S=0;(0|(Ze=(t=Ze)+64|0))>=(0|Je)&&Qe(64);if(n=t+40|0,o=t+24|0,i=t+16|0,s=(a=t)+56|0,0|Le(3788,(u=0|Xe[r>>0])<<24>>24,4))if(c=0|x(1156)){for(f=c,d=f+124|0;Ge[f>>2]=0,f=f+4|0,(0|f)<(0|d););0|G(r,43)||(Ge[c>>2]=u<<24>>24==114?8:4),E=0|G(r,101)?(Ge[a>>2]=e,Ge[a+4>>2]=2,Ge[a+8>>2]=1,M(221,0|a),0|Xe[r>>0]):u,S=E<<24>>24==97?(Ge[i>>2]=e,Ge[4+i>>2]=3,1024&(E=0|M(221,0|i))||(Ge[o>>2]=e,Ge[o+4>>2]=4,Ge[o+8>>2]=1024|E,M(221,0|o)),o=128|Ge[c>>2],Ge[c>>2]=o):0|Ge[c>>2],Ge[c+60>>2]=e,Ge[c+44>>2]=c+132,Ge[c+48>>2]=1024,Xe[(o=c+75|0)>>0]=-1,0==(8&S|0)&&(Ge[n>>2]=e,Ge[4+n>>2]=21523,Ge[8+n>>2]=s,0==(0|T(54,0|n)))&&(Xe[o>>0]=10),Ge[c+32>>2]=4,Ge[c+36>>2]=3,Ge[c+40>>2]=2,Ge[c+12>>2]=1,0|Ge[1073]||(Ge[c+76>>2]=-1),function(e){e|=0;var r=0,t=0;r=0|Q(),Ge[e+56>>2]=Ge[r>>2],0|(t=0|Ge[r>>2])&&(Ge[52+t>>2]=e),Ge[r>>2]=e,$()}(c),l=c}else l=0;else Ge[(c=652)>>2]=22,l=0;return Ze=t,0|l}(e,r))||(Ge[n>>2]=e,y(6,0|n),0)):0):(Ge[(o=652)>>2]=22,0);return Ze=t,0|s}(e|=0,964);do{if(0|s){if(o=s,a=2,function(e,r,t){r|=0,t|=0;var n=0,o=0;-1<(0|Ge[76+(e|=0)>>2])?(n=0==(0|V()),o=0|ne(e,r,t),n||K()):ne(e,r,t)}(o|=i=0,i|=0,a|=0),e=0|(i=s,0|function(e){var r=0,t=0,n=0;n=-1<(0|Ge[76+(e|=0)>>2])?(r=0==(0|V()),t=0|oe(e),r||K(),t):0|oe(e);return 0|n}(i|=0)),a=s,i=void 0,-1<((i=0)|Ge[76+(a|=0)>>2])?(i=0==(0|V()),ne(a,0,0),Ge[a>>2]=-33&Ge[a>>2],i||K()):(ne(a,0,0),Ge[a>>2]=-33&Ge[a>>2]),t=0|x(e+1|0))return(0|(n=0|function(e,r,t,n){e|=0,n|=0;var o=0,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,E=0;o=0|Ne(t|=0,r|=0),i=0==(0|r)?0:t,a=-1<(0|Ge[n+76>>2])?0|V():0;s=0|Xe[(t=n+74|0)>>0],Xe[t>>0]=s+255|s,t=0|Ge[(s=n+4|0)>>2],u=(0|Ge[n+8>>2])-t|0,c=u>>>0>>0?u:o,f=0<(0|u)?(tr(0|e,0|t,0|c),Ge[s>>2]=t+c,l=o-c|0,e+c|0):(l=o,e);e:do{if(l){for(e=n+32|0,c=l,t=f;!(0|function(e){var r=0,t=0,n=0;t=0|Xe[(r=74+(e|=0)|0)>>0],Xe[r>>0]=255+t|t,r=e+28|0,(0|Ge[(t=e+20|0)>>2])>>>0>(0|Ge[r>>2])>>>0&&de[7&Ge[e+36>>2]](e,0,0);Ge[e+16>>2]=0,Ge[r>>2]=0,Ge[t>>2]=0,n=4&(t=0|Ge[e>>2])?(Ge[e>>2]=32|t,-1):(r=(0|Ge[e+44>>2])+(0|Ge[e+48>>2])|0,Ge[e+8>>2]=r,Ge[e+4>>2]=r,t<<27>>31);return 0|n}(n)||((s=0|de[7&Ge[e>>2]](n,t,c))+1|0)>>>0<2);){if(!(u=c-s|0)){d=13;break e}c=u,t=t+s|0}0|a&&K(),E=((o-c|0)>>>0)/(r>>>0)|0}else d=13}while(0);13==(0|d)&&(E=(a&&K(),i));return 0|E}(t,1,e,s)))<(0|e)&&ae(1256),Ge[r>>2]=t,Xe[t+e>>0]=0,ee(s),0|n;ae(1230),ee(s);break}}while(0);return(Ge[r>>2]=0)|-1}function N(e,r){e|=0,r|=0;var t,n,o,i,a,s,u,c,l,f,d,E,S,_,m,h,p,F,M,b=0,y=0,O=0,w=0,R=0,A=0,k=0,T=0,g=0,v=0,N=0,D=0;if((0|Je)<=(0|(Ze=(r=Ze)+4192|0))&&Qe(4192),t=r+32|0,n=r+24|0,o=r+16|0,i=r+8|0,a=(b=r)+40|0,u=r+88|0,((Ge[(s=r+36|0)>>2]=0)|(c=0|I(e,s)))<22)return Ge[b>>2]=182,ie(967,b),B(0|Ge[s>>2]),Ze=r,0;b=c-22|0;e:do{if(22<(0|b)){for(y=(e=0|Ge[s>>2])+c|0,O=b;101010256!=((0|qe[(A=(R=(w=e+O|0)+1|0)+1|0)+1>>0])<<24|((0|qe[A>>0])<<16|((0|qe[R>>0])<<8|0|qe[w>>0]))|0)||(w+22+((0|qe[(R=w+20|0)+1>>0])<<8|0|qe[R>>0])|0)!=(0|y);)if((0|(O=O+-1|0))<=22)break e;if(A=e+((0|qe[(R=(y=(O=w+16|0)+1|0)+1|0)+1>>0])<<24|((0|qe[R>>0])<<16|((0|qe[y>>0])<<8|0|qe[O>>0])))|0,33639248==((0|qe[A+3>>0])<<24|((0|qe[A+2>>0])<<16|((0|qe[A+1>>0])<<8|0|qe[A>>0]))|0))for(O=A,y=0;;){if(R=((0|qe[O+27>>0])<<24|((0|qe[O+26>>0])<<16|((0|qe[O+25>>0])<<8|0|qe[O+24>>0])))+y|0,O=O+(46+((0|qe[O+29>>0])<<8|0|qe[O+28>>0])+((0|qe[O+31>>0])<<8|0|qe[O+30>>0])+((0|qe[O+33>>0])<<8|0|qe[O+32>>0]))|0,33639248!=((0|qe[O+3>>0])<<24|((0|qe[O+2>>0])<<16|((0|qe[O+1>>0])<<8|0|qe[O>>0]))|0)){k=R;break}y=R}else k=0;y=4+a|0,O=12+a|0,R=16+a|0;r:do{if(33639248==((0|qe[A+3>>0])<<24|((0|qe[A+2>>0])<<16|((0|qe[A+1>>0])<<8|0|qe[A>>0]))|0)){for(T=0,g=A;v=0|Xe[g+10>>0],N=0|Xe[g+11>>0],l=(0|qe[g+19>>0])<<24|((0|qe[g+18>>0])<<16|((0|qe[g+17>>0])<<8|0|qe[g+16>>0])),f=(0|qe[g+23>>0])<<24|((0|qe[g+22>>0])<<16|((0|qe[g+21>>0])<<8|0|qe[g+20>>0])),d=(0|qe[g+27>>0])<<24|((0|qe[g+26>>0])<<16|((0|qe[g+25>>0])<<8|0|qe[g+24>>0])),E=(0|qe[g+29>>0])<<8|0|qe[g+28>>0],S=(0|qe[g+33>>0])<<8|0|qe[g+32>>0],_=(0|qe[g+31>>0])<<8|0|qe[g+30>>0],er(0|u,0,4096),!(4095>>0);){switch(tr(0|u,g+46|0,0|E),p=28+(m=e+((0|qe[g+45>>0])<<24|((0|qe[g+44>>0])<<16|((0|qe[g+43>>0])<<8|0|qe[g+42>>0])))|0)|0,F=30+m+((0|qe[1+(h=26+m|0)>>0])<<8|0|qe[h>>0])+((0|qe[1+p>>0])<<8|0|qe[p>>0])|0,(65535&((255&N)<<8|255&v))<<16>>16){case 0:P(0,0|u,0|d,0|F),D=15;break;case 8:D=15}if(15==(0|D)&&(D=0)|(v=0|x(d))){for(N=a,p=N+48|0;N=N+4|(Ge[N>>2]=0),(0|N)<(0|p););do{if(!(0|function(e,r){e|=0,r|=0;var t=0,n=0,o=0,i=0,a=0,s=0;(0|(Ze=(t=Ze)+16|0))>=(0|Je)&&Qe(16);if(n=t+12|0,i=t+4|0,Ge[(o=(a=t)+8|0)>>2]=e,Ge[i>>2]=r,!(0|Ge[o>>2]))return Ge[n>>2]=-2,s=0|Ge[n>>2],Ze=t,0|s;if(15!=(0|Ge[i>>2])&&15!=(0-(0|Ge[i>>2])|0))return Ge[n>>2]=-1e4,s=0|Ge[n>>2],Ze=t,0|s;return Ge[36+(0|Ge[o>>2])>>2]=0,Ge[40+(0|Ge[o>>2])>>2]=0,Ge[24+(0|Ge[o>>2])>>2]=0,Ge[8+(0|Ge[o>>2])>>2]=0,Ge[20+(0|Ge[o>>2])>>2]=0,Ge[44+(0|Ge[o>>2])>>2]=0,r=0|x(43784),Ge[a>>2]=r,Ze=(s=(0|Ge[a>>2]?(Ge[28+(0|Ge[o>>2])>>2]=Ge[a>>2],Ge[Ge[a>>2]>>2]=0,Ge[10992+(0|Ge[a>>2])>>2]=0,Ge[10996+(0|Ge[a>>2])>>2]=0,Ge[43780+(0|Ge[a>>2])>>2]=1,Ge[11e3+(0|Ge[a>>2])>>2]=1,Ge[11004+(0|Ge[a>>2])>>2]=0,Ge[11008+(0|Ge[a>>2])>>2]=Ge[i>>2],Ge[n>>2]=0):Ge[n>>2]=-4,0|Ge[n>>2]),t),0|s}(a,-15))){if(Ge[a>>2]=F,Ge[y>>2]=f,Ge[O>>2]=v,Ge[R>>2]=d,N=1==(0|function(e,r,t,n){e|=0,r|=0,t|=0,n|=0;var o=0,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,E=0,S=0,_=0,m=0,h=0,p=0,F=0,M=0,b=0;(0|(Ze=(o=Ze)+64|0))>=(0|Je)&&Qe(64);if(i=o+48|0,s=o+40|0,u=o+36|0,c=o+32|0,l=o+28|0,f=o+24|0,d=o+20|0,E=o+16|0,S=o+12|0,_=o+8|0,m=o+4|0,Ge[(a=(h=o)+44|0)>>2]=e,Ge[s>>2]=r,Ge[u>>2]=t,Ge[c>>2]=n,Ge[E>>2]=8,0|Ge[a>>2]&&0|Ge[28+(0|Ge[a>>2])>>2]){if(1==(0|Ge[s>>2])&&(Ge[s>>2]=2),0!=(0|Ge[s>>2])&2!=(0|Ge[s>>2])&4!=(0|Ge[s>>2]))return Ge[i>>2]=-2,p=0|Ge[i>>2],Ze=o,0|p;if(Ge[l>>2]=Ge[28+(0|Ge[a>>2])>>2],0<(0|Ge[11008+(0|Ge[l>>2])>>2])&&(Ge[E>>2]=1|Ge[E>>2]),Ge[m>>2]=Ge[4+(0|Ge[a>>2])>>2],Ge[d>>2]=Ge[11e3+(0|Ge[l>>2])>>2],((Ge[11e3+(0|Ge[l>>2])>>2]=0)|Ge[43780+(0|Ge[l>>2])>>2])<0)return Ge[i>>2]=-3,p=0|Ge[i>>2],Ze=o,0|p;if(4!=(0|Ge[s>>2])&&0!=(0|Ge[11004+(0|Ge[l>>2])>>2]))return Ge[i>>2]=-2,p=0|Ge[i>>2],Ze=o,0|p;if(n=11004+(0|Ge[l>>2])|0,Ge[n>>2]=Ge[n>>2]|4==(0|Ge[s>>2]),4==(0|Ge[s>>2])&0!=(0|Ge[d>>2]))return Ge[E>>2]=4|Ge[E>>2],Ge[S>>2]=Ge[4+(0|Ge[a>>2])>>2],Ge[_>>2]=Ge[16+(0|Ge[a>>2])>>2],d=0|L(0|Ge[l>>2],0|Ge[Ge[a>>2]>>2],S,0|Ge[12+(0|Ge[a>>2])>>2],0|Ge[12+(0|Ge[a>>2])>>2],_,0|Ge[E>>2],0|Ge[u>>2],0|Ge[c>>2]),Ge[h>>2]=d,Ge[43780+(0|Ge[l>>2])>>2]=Ge[h>>2],d=0|Ge[a>>2],Ge[d>>2]=(0|Ge[d>>2])+(0|Ge[S>>2]),d=4+(0|Ge[a>>2])|0,Ge[d>>2]=(0|Ge[d>>2])-(0|Ge[S>>2]),d=8+(0|Ge[a>>2])|0,Ge[d>>2]=(0|Ge[d>>2])+(0|Ge[S>>2]),Ge[40+(0|Ge[a>>2])>>2]=Ge[28+(0|Ge[l>>2])>>2],d=12+(0|Ge[a>>2])|0,Ge[d>>2]=(0|Ge[d>>2])+(0|Ge[_>>2]),d=16+(0|Ge[a>>2])|0,Ge[d>>2]=(0|Ge[d>>2])-(0|Ge[_>>2]),d=20+(0|Ge[a>>2])|0,Ge[d>>2]=(0|Ge[d>>2])+(0|Ge[_>>2]),Ze=(p=((0|Ge[h>>2])<0?Ge[i>>2]=-3:0|Ge[h>>2]?(Ge[43780+(0|Ge[l>>2])>>2]=-1,Ge[i>>2]=-5):Ge[i>>2]=1,0|Ge[i>>2]),o),0|p;if(4!=(0|Ge[s>>2])&&(Ge[E>>2]=2|Ge[E>>2]),0|Ge[10996+(0|Ge[l>>2])>>2])return Ge[f>>2]=Ge[((0|Ge[10996+(0|Ge[l>>2])>>2])>>>0<(0|Ge[16+(0|Ge[a>>2])>>2])>>>0?10996+(0|Ge[l>>2])|0:16+(0|Ge[a>>2])|0)>>2],tr(0|Ge[12+(0|Ge[a>>2])>>2],11012+(0|Ge[l>>2])+(0|Ge[10992+(0|Ge[l>>2])>>2])|0,0|Ge[f>>2]),d=12+(0|Ge[a>>2])|0,Ge[d>>2]=(0|Ge[d>>2])+(0|Ge[f>>2]),d=16+(0|Ge[a>>2])|0,Ge[d>>2]=(0|Ge[d>>2])-(0|Ge[f>>2]),d=20+(0|Ge[a>>2])|0,Ge[d>>2]=(0|Ge[d>>2])+(0|Ge[f>>2]),d=10996+(0|Ge[l>>2])|0,Ge[d>>2]=(0|Ge[d>>2])-(0|Ge[f>>2]),Ge[10992+(0|Ge[l>>2])>>2]=(0|Ge[10992+(0|Ge[l>>2])>>2])+(0|Ge[f>>2])&32767,F=0|Ge[43780+(0|Ge[l>>2])>>2]?0:0!=(0|Ge[10996+(0|Ge[l>>2])>>2])^1,Ge[i>>2]=F?1:0,p=0|Ge[i>>2],Ze=o,0|p;for(;;){if(Ge[S>>2]=Ge[4+(0|Ge[a>>2])>>2],Ge[_>>2]=32768-(0|Ge[10992+(0|Ge[l>>2])>>2]),F=0|L(0|Ge[l>>2],0|Ge[Ge[a>>2]>>2],S,11012+(0|Ge[l>>2])|0,11012+(0|Ge[l>>2])+(0|Ge[10992+(0|Ge[l>>2])>>2])|0,_,0|Ge[E>>2],0|Ge[u>>2],0|Ge[c>>2]),Ge[h>>2]=F,Ge[43780+(0|Ge[l>>2])>>2]=Ge[h>>2],F=0|Ge[a>>2],Ge[F>>2]=(0|Ge[F>>2])+(0|Ge[S>>2]),F=4+(0|Ge[a>>2])|0,Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[S>>2]),F=8+(0|Ge[a>>2])|0,Ge[F>>2]=(0|Ge[F>>2])+(0|Ge[S>>2]),Ge[40+(0|Ge[a>>2])>>2]=Ge[28+(0|Ge[l>>2])>>2],Ge[10996+(0|Ge[l>>2])>>2]=Ge[_>>2],Ge[f>>2]=Ge[((0|Ge[10996+(0|Ge[l>>2])>>2])>>>0<(0|Ge[16+(0|Ge[a>>2])>>2])>>>0?10996+(0|Ge[l>>2])|0:16+(0|Ge[a>>2])|0)>>2],tr(0|Ge[12+(0|Ge[a>>2])>>2],11012+(0|Ge[l>>2])+(0|Ge[10992+(0|Ge[l>>2])>>2])|0,0|Ge[f>>2]),F=12+(0|Ge[a>>2])|0,Ge[F>>2]=(0|Ge[F>>2])+(0|Ge[f>>2]),F=16+(0|Ge[a>>2])|0,Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[f>>2]),F=20+(0|Ge[a>>2])|0,Ge[F>>2]=(0|Ge[F>>2])+(0|Ge[f>>2]),F=10996+(0|Ge[l>>2])|0,Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[f>>2]),Ge[10992+(0|Ge[l>>2])>>2]=(0|Ge[10992+(0|Ge[l>>2])>>2])+(0|Ge[f>>2])&32767,(0|Ge[h>>2])<0){M=27;break}if(!(1!=(0|Ge[h>>2])|0!=(0|Ge[m>>2]))){M=29;break}if(F=0==(0|Ge[h>>2]),4==(0|Ge[s>>2])){if(F){M=32;break}if(0|Ge[16+(0|Ge[a>>2])>>2])continue;M=34;break}if(F){M=39;break}if(!(0|Ge[4+(0|Ge[a>>2])>>2])){M=39;break}if(!(0|Ge[16+(0|Ge[a>>2])>>2])){M=39;break}if(0|Ge[10996+(0|Ge[l>>2])>>2]){M=39;break}}if(27==(0|M))return Ge[i>>2]=-3,p=0|Ge[i>>2],Ze=o,0|p;if(29==(0|M))return Ge[i>>2]=-5,p=0|Ge[i>>2],Ze=o,0|p;if(32==(0|M))return Ge[i>>2]=0|Ge[10996+(0|Ge[l>>2])>>2]?-5:1,p=0|Ge[i>>2],Ze=o,0|p;if(34==(0|M))return Ge[i>>2]=-5,p=0|Ge[i>>2],Ze=o,0|p;if(39==(0|M))return b=0|Ge[h>>2]?0:0!=(0|Ge[10996+(0|Ge[l>>2])>>2])^1,Ge[i>>2]=b?1:0,p=0|Ge[i>>2],Ze=o,0|p}return Ge[i>>2]=-2,p=0|Ge[i>>2],Ze=o,0|p}(a,4,k,T)),function(e){e|=0;var r=0,t=0,n=0;if((0|(Ze=(r=Ze)+16|0))>=(0|Je)&&Qe(16),t=r+4|0,Ge[(n=r)>>2]=e,!(0|Ge[n>>2]))return Ge[t>>2]=-2,Ge[t>>2],Ze=r;0|Ge[28+(0|Ge[n>>2])>>2]&&(B(0|Ge[28+(0|Ge[n>>2])>>2]),Ge[28+(0|Ge[n>>2])>>2]=0),Ge[t>>2]=0,Ge[t>>2],Ze=r}(a),!N){B(v);break}if((0|(N=0|function(e,r,t){e|=0,r|=0,t|=0;var n=0,o=0,i=0,a=0,s=0,u=0,c=0,l=0,f=0;(0|(Ze=(n=Ze)+32|0))>=(0|Je)&&Qe(32);if(o=n+20|0,a=n+12|0,s=n+8|0,u=n+4|0,l=(c=n)+24|0,Ge[(i=n+16|0)>>2]=e,Ge[a>>2]=r,Ge[s>>2]=t,Ge[u>>2]=Ge[a>>2],Ge[c>>2]=Ge[i>>2],!(0|Ge[u>>2]))return Ge[o>>2]=0,f=0|Ge[o>>2],Ze=n,0|f;Ge[c>>2]=~Ge[c>>2];for(;i=0|Ge[s>>2],Ge[s>>2]=i-1,i;)i=0|Ge[u>>2],Ge[u>>2]=1+i,Xe[l>>0]=0|Xe[i>>0],Ge[c>>2]=(0|Ge[c>>2])>>>4^Ge[8+((15&Ge[c>>2]^15&(0|qe[l>>0]))<<2)>>2],Ge[c>>2]=(0|Ge[c>>2])>>>4^Ge[8+((15&Ge[c>>2]^(0|qe[l>>0])>>4)<<2)>>2];return Ge[o>>2]=~Ge[c>>2],f=0|Ge[o>>2],Ze=n,0|f}(0,v,d)))==(0|l)){P(0,0|u,0|d,0|v),B(v);break}Ge[o>>2]=N,Ge[4+o>>2]=l,ie(1175,o),B(v);break}}while(B(v),0)}if(M=10,function(e,r){var t=0,n=0,o=0,i=0,a=0,s=0;n=t=255&(e|=0),0<=(0|Ge[76+(r|=0)>>2])&&0!=(0|V())?(a=(0|n)!=(0|Xe[r+75>>0])&&(i=0|Ge[(o=r+20|0)>>2])>>>0<(0|Ge[r+16>>2])>>>0?(Ge[o>>2]=i+1,Xe[i>>0]=t,n):0|J(r,e),K()):s=3;do{if(3==(0|s)){if((0|n)!=(0|Xe[r+75>>0])&&(i=0|Ge[(a=r+20|0)>>2])>>>0<(0|Ge[r+16>>2])>>>0){Ge[a>>2]=i+1,Xe[i>>0]=t,0;break}J(r,e)}}while(0)}(M|=0,0|Ge[208]),33639248!=((0|qe[(g=g+(46+E+_+S)|0)+3>>0])<<24|((0|qe[g+2>>0])<<16|((0|qe[g+1>>0])<<8|0|qe[g>>0]))|0))break r;T=d+T|0}return Ge[n>>2]=240,ie(967,n),B(0|Ge[s>>2]),Ze=r,0}}while(0);return C(1),Ge[t>>2]=307,ie(967,t),B(0|Ge[s>>2]),Ze=r,0}}while(0);return Ge[i>>2]=188,ie(967,i),B(0|Ge[s>>2]),Ze=r,0}function L(e,r,t,n,o,i,a,s,u){e|=0,r|=0,t|=0,n|=0,o|=0,i|=0,a|=0,s|=0,u|=0;var c,l,f,d,E,S,_,m,h,p,F,M,b,y,O,w,R,A,k,T,g,v,N,D,P,C,I,L,x,B,H,U,Y,z,V,K,W,X,j,G,q,Z,J,Q,$,ee,re,te,ne,oe,ie,ae,se,ue,ce,le,fe,de,Ee,Se,_e,me,he,pe,Fe,Me,be,ye,Oe,we,Re,Ae,ke,Te=0,ge=0,ve=0,Ne=0,De=0,Pe=0,Ce=0,Ie=0,Le=0,xe=0,Be=0,He=0,Ue=0,Ye=0,ze=0,Ve=0,Ke=0,We=Ze;if((0|Je)<=(0|(Ze=Ze+432|0))&&Qe(432),c=We+416|0,f=We+408|0,d=We+404|0,E=We+400|0,Te=We+396|0,S=We+392|0,_=We+388|0,m=We+384|0,h=We+380|0,p=We+376|0,F=We+372|0,M=We+368|0,b=We+364|0,y=We+360|0,O=We+356|0,w=We+352|0,R=We+348|0,A=We+344|0,k=We+340|0,T=We+336|0,g=We+332|0,v=We+328|0,N=We+324|0,D=We+320|0,P=We+316|0,C=We+312|0,I=We+308|0,L=We+304|0,x=We+300|0,B=We+296|0,H=We+292|0,U=We+288|0,Y=We+284|0,z=We+280|0,V=We+276|0,K=We+272|0,W=We+268|0,X=We+264|0,j=We+260|0,G=We+192|0,q=We+128|0,Z=We+120|0,J=We+116|0,Q=We+112|0,$=We+108|0,ee=We+420|0,re=We+104|0,te=We+100|0,ne=We+96|0,oe=We+92|0,ie=We+88|0,ae=We+84|0,se=We+80|0,ue=We+76|0,ce=We+72|0,le=We+68|0,fe=We+64|0,de=We+60|0,Ee=We+56|0,Se=We+52|0,_e=We+48|0,me=We+44|0,he=We+40|0,pe=We+36|0,Fe=We+32|0,Me=We+28|0,be=We+24|0,ye=We+20|0,Oe=We+16|0,we=We+12|0,Re=We+8|0,Ae=We+4|0,Ge[(l=(ke=We)+412|0)>>2]=e,Ge[f>>2]=r,Ge[d>>2]=t,Ge[E>>2]=n,Ge[Te>>2]=o,Ge[S>>2]=i,Ge[_>>2]=a,Ge[m>>2]=s,Ge[h>>2]=u,Ge[p>>2]=-1,Ge[w>>2]=Ge[f>>2],Ge[R>>2]=(0|Ge[f>>2])+(0|Ge[Ge[d>>2]>>2]),Ge[A>>2]=Ge[Te>>2],Ge[k>>2]=(0|Ge[Te>>2])+(0|Ge[Ge[S>>2]>>2]),ge=4&Ge[_>>2]|0?-1:(0|Ge[Te>>2])-(0|Ge[E>>2])+(0|Ge[Ge[S>>2]>>2])-1|0,Ge[T>>2]=ge,0==(1+(0|Ge[T>>2])&Ge[T>>2]|0)&&(0|Ge[Te>>2])>>>0>=(0|Ge[E>>2])>>>0){switch(Ge[F>>2]=Ge[4+(0|Ge[l>>2])>>2],Ge[O>>2]=Ge[56+(0|Ge[l>>2])>>2],Ge[M>>2]=Ge[32+(0|Ge[l>>2])>>2],Ge[b>>2]=Ge[36+(0|Ge[l>>2])>>2],Ge[y>>2]=Ge[40+(0|Ge[l>>2])>>2],Ge[g>>2]=Ge[60+(0|Ge[l>>2])>>2],0|Ge[Ge[l>>2]>>2]){case 0:Ge[12+(0|Ge[l>>2])>>2]=0,Ge[8+(0|Ge[l>>2])>>2]=0,Ge[y>>2]=0,Ge[b>>2]=0,Ge[M>>2]=0,Ge[F>>2]=0,Ge[O>>2]=0,Ge[28+(0|Ge[l>>2])>>2]=1,ve=(Ge[16+(0|Ge[l>>2])>>2]=1)&Ge[_>>2]|0?(0|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0?9:(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ne=0|qe[ge>>0],De=0|Ge[l>>2],15):31;break;case 1:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ne=0|qe[ge>>0],De=0|Ge[l>>2],15):9;break;case 2:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Pe=0|Ge[l>>2],Ce=0|qe[ge>>0],22):16;break;case 36:ve=30;break;case 3:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[v>>2]=qe[ge>>0],39):33;break;case 5:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[N>>2]=qe[ge>>0],49):43;break;case 6:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[D>>2]=qe[ge>>0],61):55;break;case 7:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ie=0|Xe[ge>>0],Le=0|Ge[b>>2],xe=0|Ge[l>>2],70):64;break;case 39:ve=73;break;case 51:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[P>>2]=qe[ge>>0],83):77;break;case 52:ve=85;break;case 9:ve=89;break;case 38:ve=91;break;case 40:ve=94;break;case 10:ve=100;break;case 11:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[x>>2]=qe[ge>>0],121):115;break;case 14:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[H>>2]=qe[ge>>0],133):127;break;case 35:ve=144;break;case 16:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[oe>>2]=qe[ge>>0],185):179;break;case 17:ve=194;break;case 18:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[ie>>2]=qe[ge>>0],203):197;break;case 21:ve=208;break;case 23:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[ce>>2]=qe[ge>>0],231):225;break;case 24:ve=238;break;case 25:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[Ee>>2]=qe[ge>>0],267):261;break;case 26:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[me>>2]=qe[ge>>0],286):280;break;case 27:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[pe>>2]=qe[ge>>0],301):295;break;case 37:ve=305;break;case 53:ve=308;break;case 32:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[Fe>>2]=qe[ge>>0],326):320;break;case 41:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[be>>2]=qe[ge>>0],338):332;break;case 42:ve=(0|Ge[w>>2])>>>0<(0|Ge[R>>2])>>>0?(ge=0|Ge[w>>2],Ge[w>>2]=ge+1,Ge[Me>>2]=qe[ge>>0],347):341;break;case 34:ve=348;break;default:ve=350}do{if(9==(0|ve)){if(2&Ge[_>>2]|0){Be=Ge[p>>2]=1,He=0|Ge[l>>2],ve=349;break}De=(Ne=0)|Ge[l>>2],ve=15;break}}while(0);15==(0|ve)&&(Ge[De+8>>2]=Ne,ve=(0|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0?16:(Ne=0|Ge[w>>2],Ge[w>>2]=Ne+1,Pe=0|Ge[l>>2],Ce=0|qe[Ne>>0],22));do{if(16==(0|ve)){if(2&Ge[_>>2]|0){Ge[p>>2]=1,He=0|Ge[l>>(Be=2)],ve=349;break}Pe=0|Ge[l>>2],Ce=0,ve=22;break}}while(0);22==(0|ve)&&(Ge[Pe+12>>2]=Ce,Ue=(((Ge[8+(0|Ge[l>>2])>>2]<<8)+(0|Ge[12+(0|Ge[l>>2])>>2])|0)>>>0)%31|0||32&Ge[12+(0|Ge[l>>2])>>2]|0?1:8!=(15&Ge[8+(0|Ge[l>>2])>>2]|0),Ge[b>>2]=1&Ue,4&Ge[_>>2]||(Ye=32768<1<<8+((0|Ge[8+(0|Ge[l>>2])>>2])>>>4)>>>0?1:(1+(0|Ge[T>>2])|0)>>>0<1<<8+((0|Ge[8+(0|Ge[l>>2])>>2])>>>4)>>>0,Ge[b>>2]=Ge[b>>2]|1&Ye),ve=0|Ge[b>>2]?30:31),30==(0|ve)&&(Ge[p>>2]=-1,Be=36,He=0|Ge[l>>2],ve=349);e:for(;;){switch(0|ve){case 31:$e(2,((ve=0)|Ge[h>>2])+(0|Ge[g>>2])|0,0|Ge[m>>2]),ve=(0|Ge[F>>2])>>>0<3?32:40;break;case 33:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=3,He=0|Ge[l>>2],ve=349;continue e}Ge[v>>2]=0,ve=39;continue e;case 39:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[v>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<3?32:40;break;case 43:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=5,He=0|Ge[l>>2],ve=349;continue e}Ge[N>>2]=0,ve=49;continue e;case 49:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[N>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<(7&Ge[F>>2])>>>0?42:50;break;case 55:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=6,He=0|Ge[l>>2],ve=349;continue e}Ge[D>>2]=0,ve=61;continue e;case 61:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[D>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<8?54:62;break;case 64:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=7,He=0|Ge[l>>2],ve=349;continue e}Le=(Ie=0)|Ge[b>>2],xe=0|Ge[l>>2],ve=70;continue e;case 70:Xe[xe+10528+Le>>(ve=0)]=Ie,ve=71;break;case 73:ve=0,Ge[p>>2]=-1,Be=39,He=0|Ge[l>>2],ve=349;continue e;case 77:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=51,He=0|Ge[l>>2],ve=349;continue e}Ge[P>>2]=0,ve=83;continue e;case 83:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[P>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<8?76:84;break;case 85:if(((ve=0)|Ge[A>>2])>>>0>=(0|Ge[k>>2])>>>0){Ge[p>>2]=2,Be=52,He=0|Ge[l>>2],ve=349;continue e}Ye=255&Ge[M>>2],Ue=0|Ge[A>>2],Ge[A>>2]=Ue+1,Xe[Ue>>0]=Ye,Ge[b>>2]=(0|Ge[b>>2])-1,ve=74;break;case 89:if(((ve=0)|Ge[A>>2])>>>0<(0|Ge[k>>2])>>>0){ve=91;continue e}Ge[p>>2]=2,Be=9,He=0|Ge[l>>2],ve=349;continue e;case 91:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){if(!(2&Ge[_>>2])){ve=94;continue e}Ge[p>>2]=1,Be=38,He=0|Ge[l>>2],ve=349;continue e}ze=(((Ye=((0|Ge[k>>2])-(0|Ge[A>>2])|0)>>>0<((0|Ge[R>>2])-(0|Ge[w>>2])|0)>>>0)?0|Ge[k>>2]:0|Ge[R>>2])-(Ye?0|Ge[A>>2]:0|Ge[w>>2])|0)>>>0<(0|Ge[b>>2])>>>0?((Ye=((0|Ge[k>>2])-(0|Ge[A>>2])|0)>>>0<((0|Ge[R>>2])-(0|Ge[w>>2])|0)>>>0)?0|Ge[k>>2]:0|Ge[R>>2])-(Ye?0|Ge[A>>2]:0|Ge[w>>2])|0:0|Ge[b>>2],Ge[C>>2]=ze,tr(0|Ge[A>>2],0|Ge[w>>2],0|Ge[C>>2]),Ge[w>>2]=(0|Ge[w>>2])+(0|Ge[C>>2]),Ge[A>>2]=(0|Ge[A>>2])+(0|Ge[C>>2]),Ge[b>>2]=(0|Ge[b>>2])-(0|Ge[C>>2]),ve=88;break;case 94:ve=0,Ge[p>>2]=-1,Be=40,He=0|Ge[l>>2],ve=349;continue e;case 100:ve=0,Ge[p>>2]=-1,Be=10,He=0|Ge[l>>2],ve=349;continue e;case 115:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=11,He=0|Ge[l>>2],ve=349;continue e}Ge[x>>2]=0,ve=121;continue e;case 121:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[x>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<(0|Xe[1331+(0|Ge[b>>2])>>0])>>>0?114:122;break;case 127:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=14,He=0|Ge[l>>2],ve=349;continue e}Ge[H>>2]=0,ve=133;continue e;case 133:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[H>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<3?126:134;break;case 144:ve=0,Ge[p>>2]=-1,Be=35,He=0|Ge[l>>2],ve=349;continue e;case 179:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=16,He=0|Ge[l>>2],ve=349;continue e}Ge[oe>>2]=0,ve=185;continue e;case 185:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[oe>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<15?170:187;break;case 194:ve=0,Ge[p>>2]=-1,Be=17,He=0|Ge[l>>2],ve=349;continue e;case 197:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=18,He=0|Ge[l>>2],ve=349;continue e}Ge[ie>>2]=0,ve=203;continue e;case 203:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[ie>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<(0|Ge[y>>2])>>>0?196:204;break;case 208:ve=0,Ge[p>>2]=-1,Be=21,He=0|Ge[l>>2],ve=349;continue e;case 225:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=23,He=0|Ge[l>>2],ve=349;continue e}Ge[ce>>2]=0,ve=231;continue e;case 231:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[ce>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<15?216:233;break;case 238:if(((ve=0)|Ge[A>>2])>>>0>=(0|Ge[k>>2])>>>0){Ge[p>>2]=2,Be=24,He=0|Ge[l>>2],ve=349;continue e}Ye=255&Ge[b>>2],Ue=0|Ge[A>>2],Ge[A>>2]=Ue+1,Xe[Ue>>0]=Ye,ve=212;break;case 261:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=25,He=0|Ge[l>>2],ve=349;continue e}Ge[Ee>>2]=0,ve=267;continue e;case 267:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[Ee>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<(0|Ge[y>>2])>>>0?260:268;break;case 280:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=26,He=0|Ge[l>>2],ve=349;continue e}Ge[me>>2]=0,ve=286;continue e;case 286:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[me>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<15?271:288;break;case 295:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=27,He=0|Ge[l>>2],ve=349;continue e}Ge[pe>>2]=0,ve=301;continue e;case 301:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[pe>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<(0|Ge[y>>2])>>>0?294:302;break;case 305:ve=0,Ge[p>>2]=-1,Be=37,He=0|Ge[l>>2],ve=349;continue e;case 308:if(((ve=0)|Ge[A>>2])>>>0>=(0|Ge[k>>2])>>>0){Ge[p>>2]=2,Be=53,He=0|Ge[l>>2],ve=349;continue e}Ye=0|Ge[g>>2],Ge[g>>2]=Ye+1,Ue=0|Xe[(0|Ge[E>>2])+(Ye-(0|Ge[M>>2])&Ge[T>>2])>>0],Ye=0|Ge[A>>2],Ge[A>>2]=Ye+1,Xe[Ye>>0]=Ue,ve=307;break;case 320:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=32,He=0|Ge[l>>2],ve=349;continue e}Ge[Fe>>2]=0,ve=326;continue e;case 326:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[Fe>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<(7&Ge[F>>2])>>>0?319:327;break;case 332:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=41,He=0|Ge[l>>2],ve=349;continue e}Ge[be>>2]=0,ve=338;continue e;case 338:ve=0,Ge[O>>2]=Ge[O>>2]|Ge[be>>2]<>2],Ge[F>>2]=8+(0|Ge[F>>2]),ve=(0|Ge[F>>2])>>>0<8?331:339;break;case 341:if(ve=0,2&Ge[_>>2]|0){Ge[p>>2]=1,Be=42,He=0|Ge[l>>2],ve=349;continue e}Ge[Me>>2]=0,ve=347;continue e;case 347:Ge[16+((ve=0)|Ge[l>>2])>>2]=Ge[16+(0|Ge[l>>2])>>2]<<8|Ge[Me>>2],Ge[b>>2]=1+(0|Ge[b>>2]),ve=328;break;case 348:ve=0,Be=34,He=(Ge[p>>2]=0)|Ge[l>>2],ve=349;continue e;case 349:ve=0,Ge[He>>2]=Be,ve=350;continue e;case 350:if(Ge[4+((ve=0)|Ge[l>>2])>>2]=Ge[F>>2],Ge[56+(0|Ge[l>>2])>>2]=Ge[O>>2],Ge[32+(0|Ge[l>>2])>>2]=Ge[M>>2],Ge[36+(0|Ge[l>>2])>>2]=Ge[b>>2],Ge[40+(0|Ge[l>>2])>>2]=Ge[y>>2],Ge[60+(0|Ge[l>>2])>>2]=Ge[g>>2],Ge[Ge[d>>2]>>2]=(0|Ge[w>>2])-(0|Ge[f>>2]),Ge[Ge[S>>2]>>2]=(0|Ge[A>>2])-(0|Ge[Te>>2]),0!=(9&Ge[_>>2]|0)&0<=(0|Ge[p>>2])){ve=351;break e}break e}if(32!=(0|ve)){r:do{if(40==(0|ve)){if(Ge[20+((ve=0)|Ge[l>>2])>>2]=7&Ge[O>>2],Ge[O>>2]=(0|Ge[O>>2])>>>3,Ge[F>>2]=(0|Ge[F>>2])-3,Ge[24+(0|Ge[l>>2])>>2]=(0|Ge[20+(0|Ge[l>>2])>>2])>>>1,!(0|Ge[24+(0|Ge[l>>2])>>2])){if((0|Ge[F>>2])>>>0<(7&Ge[F>>2])>>>0){ve=42;break}ve=50;break}if(3==(0|Ge[24+(0|Ge[l>>2])>>2])){ve=100;continue e}if(1!=(0|Ge[24+(0|Ge[l>>2])>>2])){Ge[b>>2]=0,ve=112;break}for(Ge[I>>2]=64+(0|Ge[l>>2]),Ge[44+(0|Ge[l>>2])>>2]=288,Ge[44+(0|Ge[l>>2])+4>>2]=32,Ue=64+(0|Ge[l>>2])+3488|0,Ge[Ue>>2]=84215045,Ge[Ue+4>>2]=84215045,Ge[Ue+8>>2]=84215045,Ge[Ue+12>>2]=84215045,Ge[Ue+16>>2]=84215045,Ge[Ue+20>>2]=84215045,Ge[Ue+24>>2]=84215045,Ge[Ue+28>>2]=84215045,Ge[L>>2]=0;!(143<(0|Ge[L>>2])>>>0);)Ue=0|Ge[I>>2],Ge[I>>2]=Ue+1,Xe[Ue>>0]=8,Ge[L>>2]=1+(0|Ge[L>>2]);for(;!(255<(0|Ge[L>>2])>>>0);)Ue=0|Ge[I>>2],Ge[I>>2]=Ue+1,Xe[Ue>>0]=9,Ge[L>>2]=1+(0|Ge[L>>2]);for(;!(279<(0|Ge[L>>2])>>>0);)Ue=0|Ge[I>>2],Ge[I>>2]=Ue+1,Xe[Ue>>0]=7,Ge[L>>2]=1+(0|Ge[L>>2]);for(;;){if(287<(0|Ge[L>>2])>>>0){ve=136;break r}Ue=0|Ge[I>>2],Ge[I>>2]=Ue+1,Xe[Ue>>0]=8,Ge[L>>2]=1+(0|Ge[L>>2])}}}while(0);if(42!=(0|ve)){50==(0|ve)&&(ve=0,Ge[O>>2]=(0|Ge[O>>2])>>>(7&Ge[F>>2]),Ge[F>>2]=(0|Ge[F>>2])-(7&Ge[F>>2]),Ge[b>>2]=0,ve=51);r:for(;;){switch(0|ve){case 51:if(4<=((ve=0)|Ge[b>>2])>>>0){if(Ue=qe[10528+(0|Ge[l>>2])>>0]|qe[10528+(0|Ge[l>>2])+1>>0]<<8,(0|(Ge[b>>2]=Ue))!=(65535^(qe[10528+(0|Ge[l>>2])+2>>0]|qe[10528+(0|Ge[l>>2])+3>>0]<<8)|0)){ve=73;continue e}ve=74;continue r}if(!(0|Ge[F>>2])){ve=63;break r}if((0|Ge[F>>2])>>>0<8){ve=54;continue r}ve=62;continue r;case 54:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=55;continue e}ve=60;break r;case 62:Xe[10528+((ve=0)|Ge[l>>2])+(0|Ge[b>>2])>>0]=Ge[O>>2],Ge[O>>2]=(0|Ge[O>>2])>>>8,Ge[F>>2]=(0|Ge[F>>2])-8,ve=71;continue r;case 71:ve=0,Ge[b>>2]=1+(0|Ge[b>>2]),ve=51;continue r;case 74:if(!((ve=0)|Ge[b>>2]&&0!=(0|Ge[F>>2]))){ve=88;continue r}if((0|Ge[F>>2])>>>0<8){ve=76;continue r}ve=84;continue r;case 76:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=77;continue e}ve=82;break r;case 84:ve=0,Ge[M>>2]=255&Ge[O>>2],Ge[O>>2]=(0|Ge[O>>2])>>>8,Ge[F>>2]=(0|Ge[F>>2])-8,ve=85;continue e;case 88:if((ve=0)|Ge[b>>2]){ve=89;continue e}ve=316;break;case 112:if(((ve=0)|Ge[b>>2])>>>0<3){if((0|Ge[F>>2])>>>0<(0|Xe[1331+(0|Ge[b>>2])>>0])>>>0){ve=114;continue r}ve=122;continue r}er(64+(0|Ge[l>>2])+6976|0,0,288),Ge[b>>2]=0,ve=124;break;case 114:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=115;continue e}ve=120;break r;case 122:Ge[44+((ve=0)|Ge[l>>2])+(Ge[b>>2]<<2)>>2]=Ge[O>>2]&(1<>2])>>0])-1,Ge[O>>2]=(0|Ge[O>>2])>>>(0|Xe[1331+(0|Ge[b>>2])>>0]),Ge[F>>2]=(0|Ge[F>>2])-(0|Xe[1331+(0|Ge[b>>2])>>0]),Ue=44+(0|Ge[l>>2])+(Ge[b>>2]<<2)|0,Ge[Ue>>2]=(0|Ge[Ue>>2])+(0|Ge[72+(Ge[b>>2]<<2)>>2]),Ge[b>>2]=1+(0|Ge[b>>2]),ve=112;continue r;case 126:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=127;continue e}ve=132;break r;case 134:ve=0,Ge[B>>2]=7&Ge[O>>2],Ge[O>>2]=(0|Ge[O>>2])>>>3,Ge[F>>2]=(0|Ge[F>>2])-3,Xe[64+(0|Ge[l>>2])+6976+(0|qe[1335+(0|Ge[b>>2])>>0])>>0]=Ge[B>>2],Ge[b>>2]=1+(0|Ge[b>>2]),ve=124;break;case 136:if((ve=0)<=(0|Ge[24+(0|Ge[l>>2])>>2])){for(Ge[z>>2]=64+(0|Ge[l>>2])+(3488*(0|Ge[24+(0|Ge[l>>2])>>2])|0),Ue=q,Ye=Ue+64|0;Ue=Ue+4|(Ge[Ue>>2]=0),(0|Ue)<(0|Ye););for(er(288+(0|Ge[z>>2])|0,0,2048),er(2336+(0|Ge[z>>2])|0,0,1152),Ge[V>>2]=0;!((0|Ge[V>>2])>>>0>=(0|Ge[44+(0|Ge[l>>2])+(Ge[24+(0|Ge[l>>2])>>2]<<2)>>2])>>>0);)Ue=q+(qe[(0|Ge[z>>2])+(0|Ge[V>>2])>>0]<<2)|0,Ge[Ue>>2]=1+(0|Ge[Ue>>2]),Ge[V>>2]=1+(0|Ge[V>>2]);for(Ge[W>>2]=0,Ge[X>>2]=0,Ge[4+G>>2]=0,Ge[G>>2]=0,Ge[V>>2]=1;!(15<(0|Ge[V>>2])>>>0);)Ge[W>>2]=(0|Ge[W>>2])+(0|Ge[q+(Ge[V>>2]<<2)>>2]),Ue=(0|Ge[X>>2])+(0|Ge[q+(Ge[V>>2]<<2)>>2])<<1,Ge[X>>2]=Ue,Ge[G+(1+(0|Ge[V>>2])<<2)>>2]=Ue,Ge[V>>2]=1+(0|Ge[V>>2]);if(65536!=(0|Ge[X>>2])&1<(0|Ge[W>>2])>>>0){ve=144;continue e}for(Ge[U>>2]=-1,Ge[j>>2]=0;!((0|Ge[j>>2])>>>0>=(0|Ge[44+(0|Ge[l>>2])+(Ge[24+(0|Ge[l>>2])>>2]<<2)>>2])>>>0);){Ge[Z>>2]=0,Ge[$>>2]=qe[(0|Ge[z>>2])+(0|Ge[j>>2])>>0];t:do{if(0|Ge[$>>2]){for(Ue=G+(Ge[$>>2]<<2)|0,Ye=0|Ge[Ue>>2],Ge[Ue>>2]=Ye+1,Ge[Q>>2]=Ye,Ge[J>>2]=Ge[$>>2];!((0|Ge[J>>2])>>>0<=0);)Ge[Z>>2]=Ge[Z>>2]<<1|1&Ge[Q>>2],Ge[J>>2]=(0|Ge[J>>2])-1,Ge[Q>>2]=(0|Ge[Q>>2])>>>1;if((0|Ge[$>>2])>>>0<=10)for(je[ee>>1]=Ge[$>>2]<<9|Ge[j>>2];;){if(1024<=(0|Ge[Z>>2])>>>0)break t;je[288+(0|Ge[z>>2])+(Ge[Z>>2]<<1)>>1]=0|je[ee>>1],Ge[Z>>2]=(0|Ge[Z>>2])+(1<>2])}for(Ye=0|je[288+(0|Ge[z>>2])+((1023&Ge[Z>>2])<<1)>>1],(Ge[Y>>2]=Ye)||(je[288+(0|Ge[z>>2])+((1023&Ge[Z>>2])<<1)>>1]=Ge[U>>2],Ge[Y>>2]=Ge[U>>2],Ge[U>>2]=(0|Ge[U>>2])-2),Ge[Z>>2]=(0|Ge[Z>>2])>>>9,Ge[K>>2]=Ge[$>>2];Ye=11<(0|Ge[K>>2])>>>0,Ue=(0|Ge[Z>>2])>>>1,Ge[Z>>2]=Ue,Ge[Y>>2]=(0|Ge[Y>>2])-(1&Ue),Ye;)0|je[2336+(0|Ge[z>>2])+(0-(0|Ge[Y>>2])-1<<1)>>1]?Ge[Y>>2]=je[2336+(0|Ge[z>>2])+(0-(0|Ge[Y>>2])-1<<1)>>1]:(je[2336+(0|Ge[z>>2])+(0-(0|Ge[Y>>2])-1<<1)>>1]=Ge[U>>2],Ge[Y>>2]=Ge[U>>2],Ge[U>>2]=(0|Ge[U>>2])-2),Ge[K>>2]=(0|Ge[K>>2])-1;je[2336+(0|Ge[z>>2])+(0-(0|Ge[Y>>2])-1<<1)>>1]=Ge[j>>2]}}while(0);Ge[j>>2]=1+(0|Ge[j>>2])}ve=2==(0|Ge[24+(0|Ge[l>>2])>>2])?(Ge[b>>2]=0,167):210}else ve=211;break;case 170:if(ve=0,Ge[te>>2]=je[64+(0|Ge[l>>2])+6976+288+((1023&Ge[O>>2])<<1)>>1],0<=(0|Ge[te>>2])){if(Ge[ne>>2]=Ge[te>>2]>>9,!(0|Ge[ne>>2])){ve=178;break r}if((0|Ge[F>>2])>>>0>=(0|Ge[ne>>2])>>>0){ve=187;continue r}ve=178;break r}if((0|Ge[F>>2])>>>0<=10){ve=178;break r}Ge[ne>>2]=10;do{if(Ye=~Ge[te>>2],Ue=0|Ge[O>>2],Ce=0|Ge[ne>>2],Ge[ne>>2]=Ce+1,Ge[te>>2]=je[64+(0|Ge[l>>2])+6976+2336+(Ye+(Ue>>>Ce&1)<<1)>>1],0<=(0|Ge[te>>2]))break}while((0|Ge[F>>2])>>>0>=(1+(0|Ge[ne>>2])|0)>>>0);if(0<=(0|Ge[te>>2])){ve=187;continue r}ve=178;break r;case 187:if(Ce=(ve=0)|je[64+(0|Ge[l>>2])+6976+288+((1023&Ge[O>>2])<<1)>>1],0<=(0|(Ge[te>>2]=Ce)))Ge[ne>>2]=Ge[te>>2]>>9,Ge[te>>2]=511&Ge[te>>2];else for(Ge[ne>>2]=10;Ce=~Ge[te>>2],Ue=0|Ge[O>>2],Ye=0|Ge[ne>>2],Ge[ne>>2]=Ye+1,Ge[te>>2]=je[64+(0|Ge[l>>2])+6976+2336+(Ce+(Ue>>>Ye&1)<<1)>>1],(0|Ge[te>>2])<0;);if(Ge[M>>2]=Ge[te>>2],Ge[O>>2]=(0|Ge[O>>2])>>>(0|Ge[ne>>2]),Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[ne>>2]),Ye=0|Ge[M>>2],(0|Ge[M>>2])>>>0<16){Ue=0|Ge[b>>2],Ge[b>>2]=Ue+1,Xe[10532+(0|Ge[l>>2])+Ue>>0]=Ye,ve=167;break}if(!(16!=(0|Ye)|0!=(0|Ge[b>>2]))){ve=194;continue e}if(Ge[y>>2]=Xe[(0|Ge[M>>2])-16+1354>>0],(0|Ge[F>>2])>>>0<(0|Ge[y>>2])>>>0){ve=196;continue r}ve=204;continue r;case 196:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=197;continue e}ve=202;break r;case 204:ve=0,Ge[re>>2]=Ge[O>>2]&(1<>2])-1,Ge[O>>2]=(0|Ge[O>>2])>>>(0|Ge[y>>2]),Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[y>>2]),Ge[re>>2]=(0|Ge[re>>2])+(0|Xe[(0|Ge[M>>2])-16+1358>>0]),Ve=16==(0|Ge[M>>2])?0|qe[10532+(0|Ge[l>>2])+((0|Ge[b>>2])-1)>>0]:0,er(10532+(0|Ge[l>>2])+(0|Ge[b>>2])|0,255&Ve|0,0|Ge[re>>2]),Ge[b>>2]=(0|Ge[b>>2])+(0|Ge[re>>2]),ve=167;break;case 212:if(4<=(((ve=0)|Ge[R>>2])-(0|Ge[w>>2])|0)&&2<=((0|Ge[k>>2])-(0|Ge[A>>2])|0)){if((0|Ge[F>>2])>>>0<15&&(Ge[O>>2]=Ge[O>>2]|(qe[Ge[w>>2]>>0]|qe[1+(0|Ge[w>>2])>>0]<<8)<>2],Ge[w>>2]=2+(0|Ge[w>>2]),Ge[F>>2]=16+(0|Ge[F>>2])),Ye=0|je[64+(0|Ge[l>>2])+288+((1023&Ge[O>>2])<<1)>>1],0<=(0|(Ge[le>>2]=Ye)))Ge[fe>>2]=Ge[le>>2]>>9;else for(Ge[fe>>2]=10;Ye=~Ge[le>>2],Ue=0|Ge[O>>2],Ce=0|Ge[fe>>2],Ge[fe>>2]=Ce+1,Ge[le>>2]=je[64+(0|Ge[l>>2])+2336+(Ye+(Ue>>>Ce&1)<<1)>>1],(0|Ge[le>>2])<0;);if(Ge[b>>2]=Ge[le>>2],Ge[O>>2]=(0|Ge[O>>2])>>>(0|Ge[fe>>2]),Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[fe>>2]),256&Ge[b>>2]|0){ve=257;break}if((0|Ge[F>>2])>>>0<15&&(Ge[O>>2]=Ge[O>>2]|(qe[Ge[w>>2]>>0]|qe[1+(0|Ge[w>>2])>>0]<<8)<>2],Ge[w>>2]=2+(0|Ge[w>>2]),Ge[F>>2]=16+(0|Ge[F>>2])),Ce=0|je[64+(0|Ge[l>>2])+288+((1023&Ge[O>>2])<<1)>>1],0<=(0|(Ge[le>>2]=Ce)))Ge[fe>>2]=Ge[le>>2]>>9;else for(Ge[fe>>2]=10;Ce=~Ge[le>>2],Ue=0|Ge[O>>2],Ye=0|Ge[fe>>2],Ge[fe>>2]=Ye+1,Ge[le>>2]=je[64+(0|Ge[l>>2])+2336+(Ce+(Ue>>>Ye&1)<<1)>>1],(0|Ge[le>>2])<0;);if(Ge[O>>2]=(0|Ge[O>>2])>>>(0|Ge[fe>>2]),Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[fe>>2]),Xe[Ge[A>>2]>>0]=Ge[b>>2],256&Ge[le>>2]|0){Ge[A>>2]=1+(0|Ge[A>>2]),Ge[b>>2]=Ge[le>>2],ve=257;break}Xe[1+(0|Ge[A>>2])>>0]=Ge[le>>2],Ge[A>>2]=2+(0|Ge[A>>2]),ve=212;continue r}if(15<=(0|Ge[F>>2])>>>0){ve=233;continue r}if(((0|Ge[R>>2])-(0|Ge[w>>2])|0)<2){ve=216;continue r}Ge[O>>2]=Ge[O>>2]|(qe[Ge[w>>2]>>0]<>2]|qe[1+(0|Ge[w>>2])>>0]<<8+(0|Ge[F>>2])),Ge[w>>2]=2+(0|Ge[w>>2]),Ge[F>>2]=16+(0|Ge[F>>2]),ve=233;continue r;case 216:if(ve=0,Ge[se>>2]=je[64+(0|Ge[l>>2])+288+((1023&Ge[O>>2])<<1)>>1],0<=(0|Ge[se>>2])){if(Ge[ue>>2]=Ge[se>>2]>>9,!(0|Ge[ue>>2])){ve=224;break r}if((0|Ge[F>>2])>>>0>=(0|Ge[ue>>2])>>>0){ve=233;continue r}ve=224;break r}if((0|Ge[F>>2])>>>0<=10){ve=224;break r}Ge[ue>>2]=10;do{if(Ye=~Ge[se>>2],Ue=0|Ge[O>>2],Ce=0|Ge[ue>>2],Ge[ue>>2]=Ce+1,Ge[se>>2]=je[64+(0|Ge[l>>2])+2336+(Ye+(Ue>>>Ce&1)<<1)>>1],0<=(0|Ge[se>>2]))break}while((0|Ge[F>>2])>>>0>=(1+(0|Ge[ue>>2])|0)>>>0);if(0<=(0|Ge[se>>2])){ve=233;continue r}ve=224;break r;case 233:if(Ce=(ve=0)|je[64+(0|Ge[l>>2])+288+((1023&Ge[O>>2])<<1)>>1],0<=(0|(Ge[se>>2]=Ce)))Ge[ue>>2]=Ge[se>>2]>>9,Ge[se>>2]=511&Ge[se>>2];else for(Ge[ue>>2]=10;Ce=~Ge[se>>2],Ue=0|Ge[O>>2],Ye=0|Ge[ue>>2],Ge[ue>>2]=Ye+1,Ge[se>>2]=je[64+(0|Ge[l>>2])+2336+(Ce+(Ue>>>Ye&1)<<1)>>1],(0|Ge[se>>2])<0;);if(Ge[b>>2]=Ge[se>>2],Ge[O>>2]=(0|Ge[O>>2])>>>(0|Ge[ue>>2]),Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[ue>>2]),!(256<=(0|Ge[b>>2])>>>0)){ve=238;continue e}ve=257;break;case 260:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=261;continue e}ve=266;break r;case 268:ve=0,Ge[de>>2]=Ge[O>>2]&(1<>2])-1,Ge[O>>2]=(0|Ge[O>>2])>>>(0|Ge[y>>2]),Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[y>>2]),Ge[b>>2]=(0|Ge[b>>2])+(0|Ge[de>>2]),ve=269;break;case 271:if(ve=0,Ge[Se>>2]=je[64+(0|Ge[l>>2])+3488+288+((1023&Ge[O>>2])<<1)>>1],0<=(0|Ge[Se>>2])){if(Ge[_e>>2]=Ge[Se>>2]>>9,!(0|Ge[_e>>2])){ve=279;break r}if((0|Ge[F>>2])>>>0>=(0|Ge[_e>>2])>>>0){ve=288;continue r}ve=279;break r}if((0|Ge[F>>2])>>>0<=10){ve=279;break r}Ge[_e>>2]=10;do{if(Ye=~Ge[Se>>2],Ue=0|Ge[O>>2],Ce=0|Ge[_e>>2],Ge[_e>>2]=Ce+1,Ge[Se>>2]=je[64+(0|Ge[l>>2])+3488+2336+(Ye+(Ue>>>Ce&1)<<1)>>1],0<=(0|Ge[Se>>2]))break}while((0|Ge[F>>2])>>>0>=(1+(0|Ge[_e>>2])|0)>>>0);if(0<=(0|Ge[Se>>2])){ve=288;continue r}ve=279;break r;case 288:if(Ce=(ve=0)|je[64+(0|Ge[l>>2])+3488+288+((1023&Ge[O>>2])<<1)>>1],0<=(0|(Ge[Se>>2]=Ce)))Ge[_e>>2]=Ge[Se>>2]>>9,Ge[Se>>2]=511&Ge[Se>>2];else for(Ge[_e>>2]=10;Ce=~Ge[Se>>2],Ue=0|Ge[O>>2],Ye=0|Ge[_e>>2],Ge[_e>>2]=Ye+1,Ge[Se>>2]=je[64+(0|Ge[l>>2])+3488+2336+(Ce+(Ue>>>Ye&1)<<1)>>1],(0|Ge[Se>>2])<0;);if(Ge[M>>2]=Ge[Se>>2],Ge[O>>2]=(0|Ge[O>>2])>>>(0|Ge[_e>>2]),Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[_e>>2]),Ge[y>>2]=Ge[332+(Ge[M>>2]<<2)>>2],Ge[M>>2]=Ge[460+(Ge[M>>2]<<2)>>2],0|Ge[y>>2]){if((0|Ge[F>>2])>>>0<(0|Ge[y>>2])>>>0){ve=294;continue r}ve=302;continue r}ve=303;break;case 294:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=295;continue e}ve=300;break r;case 302:ve=0,Ge[he>>2]=Ge[O>>2]&(1<>2])-1,Ge[O>>2]=(0|Ge[O>>2])>>>(0|Ge[y>>2]),Ge[F>>2]=(0|Ge[F>>2])-(0|Ge[y>>2]),Ge[M>>2]=(0|Ge[M>>2])+(0|Ge[he>>2]),ve=303;break;case 307:if(Ye=(ve=0)|Ge[b>>2],Ge[b>>2]=Ye+-1,0|Ye){ve=308;continue e}ve=211;break;case 319:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=320;continue e}ve=325;break r;case 327:ve=0,Ge[O>>2]=(0|Ge[O>>2])>>>(7&Ge[F>>2]),Ge[F>>2]=(0|Ge[F>>2])-(7&Ge[F>>2]),Ge[b>>2]=0,ve=328;continue r;case 328:if(4<=((ve=0)|Ge[b>>2])>>>0){ve=348;continue e}if(!(0|Ge[F>>2])){ve=340;break r}if((0|Ge[F>>2])>>>0<8){ve=331;continue r}ve=339;continue r;case 331:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=332;continue e}ve=337;break r;case 339:ve=0,Ge[Me>>2]=255&Ge[O>>2],Ge[O>>2]=(0|Ge[O>>2])>>>8,Ge[F>>2]=(0|Ge[F>>2])-8,ve=347;continue e}do{if(124==(0|ve)){if(((ve=0)|Ge[b>>2])>>>0<(0|Ge[44+(0|Ge[l>>2])+8>>2])>>>0){if((0|Ge[F>>2])>>>0<3){ve=126;continue r}ve=134;continue r}Ge[44+(0|Ge[l>>2])+8>>2]=19,ve=136;continue r}if(167==(0|ve)){if(((ve=0)|Ge[b>>2])>>>0>=((0|Ge[44+(0|Ge[l>>2])>>2])+(0|Ge[44+(0|Ge[l>>2])+4>>2])|0)>>>0){if(((0|Ge[44+(0|Ge[l>>2])>>2])+(0|Ge[44+(0|Ge[l>>2])+4>>2])|0)!=(0|Ge[b>>2])){ve=208;continue e}tr(64+(0|Ge[l>>2])|0,10532+(0|Ge[l>>2])|0,0|Ge[44+(0|Ge[l>>2])>>2]),tr(64+(0|Ge[l>>2])+3488|0,10532+(0|Ge[l>>2])+(0|Ge[44+(0|Ge[l>>2])>>2])|0,0|Ge[44+(0|Ge[l>>2])+4>>2]),ve=210;break}if(15<=(0|Ge[F>>2])>>>0){ve=187;continue r}if(((0|Ge[R>>2])-(0|Ge[w>>2])|0)<2){ve=170;continue r}Ge[O>>2]=Ge[O>>2]|(qe[Ge[w>>2]>>0]<>2]|qe[1+(0|Ge[w>>2])>>0]<<8+(0|Ge[F>>2])),Ge[w>>2]=2+(0|Ge[w>>2]),Ge[F>>2]=16+(0|Ge[F>>2]),ve=187;continue r}if(257==(0|ve))if(ve=0,Ye=511&Ge[b>>2],256!=(0|(Ge[b>>2]=Ye))){if(Ge[y>>2]=Ge[84+((0|Ge[b>>2])-257<<2)>>2],Ge[b>>2]=Ge[208+((0|Ge[b>>2])-257<<2)>>2],0|Ge[y>>2]){if((0|Ge[F>>2])>>>0<(0|Ge[y>>2])>>>0){ve=260;continue r}ve=268;continue r}ve=269}else ve=316;else if(303==(0|ve)){if(ve=0,Ge[g>>2]=(0|Ge[A>>2])-(0|Ge[E>>2]),(0|Ge[M>>2])>>>0>(0|Ge[g>>2])>>>0&&4&Ge[_>>2]|0){ve=305;continue e}if(Ge[ae>>2]=(0|Ge[E>>2])+((0|Ge[g>>2])-(0|Ge[M>>2])&Ge[T>>2]),(((0|Ge[A>>2])>>>0>(0|Ge[ae>>2])>>>0?0|Ge[A>>2]:0|Ge[ae>>2])+(0|Ge[b>>2])|0)>>>0>(0|Ge[k>>2])>>>0){ve=307;continue r}for(;Xe[Ge[A>>2]>>0]=0|Xe[Ge[ae>>2]>>0],Xe[1+(0|Ge[A>>2])>>0]=0|Xe[1+(0|Ge[ae>>2])>>0],Xe[2+(0|Ge[A>>2])>>0]=0|Xe[2+(0|Ge[ae>>2])>>0],Ge[A>>2]=3+(0|Ge[A>>2]),Ge[ae>>2]=3+(0|Ge[ae>>2]),Ye=(0|Ge[b>>2])-3|0,Ge[b>>2]=Ye,2<(0|Ye););ve=(0<(0|Ge[b>>2])&&(Xe[Ge[A>>2]>>0]=0|Xe[Ge[ae>>2]>>0],1<(0|Ge[b>>2])&&(Xe[1+(0|Ge[A>>2])>>0]=0|Xe[1+(0|Ge[ae>>2])>>0]),Ge[A>>2]=(0|Ge[A>>2])+(0|Ge[b>>2])),211)}}while(0);if(210!=(0|ve))if(211!=(0|ve)){if(269==(0|ve))ve=15<=((ve=0)|Ge[F>>2])>>>0?288:((0|Ge[R>>2])-(0|Ge[w>>2])|0)<2?271:(Ge[O>>2]=Ge[O>>2]|(qe[Ge[w>>2]>>0]<>2]|qe[1+(0|Ge[w>>2])>>0]<<8+(0|Ge[F>>2])),Ge[w>>2]=2+(0|Ge[w>>2]),Ge[F>>2]=16+(0|Ge[F>>2]),288);else if(316==(0|ve)){if((ve=0)!=(1&Ge[20+(0|Ge[l>>2])>>2]|0)^1){ve=31;continue e}if(!(1&Ge[_>>2])){ve=348;continue e}(0|Ge[F>>2])>>>0<(7&Ge[F>>2])>>>0?ve=319:ve=327}}else ve=0,ve=212;else Ye=24+((ve=0)|Ge[l>>2])|0,Ge[Ye>>2]=(0|Ge[Ye>>2])-1,ve=136}switch(0|ve){case 60:Ye=(ve=0)|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[D>>2]=qe[Ye>>0],ve=61;continue e;case 63:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=64;continue e}Ye=0|Ge[w>>2],Ge[w>>2]=Ye+1,Ie=0|Xe[Ye>>0],Le=0|Ge[b>>2],xe=0|Ge[l>>2],ve=70;continue e;case 82:Ye=(ve=0)|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[P>>2]=qe[Ye>>0],ve=83;continue e;case 120:Ye=(ve=0)|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[x>>2]=qe[Ye>>0],ve=121;continue e;case 132:Ye=(ve=0)|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[H>>2]=qe[Ye>>0],ve=133;continue e;case 178:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=179;continue e}Ye=0|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[oe>>2]=qe[Ye>>0],ve=185;continue e;case 202:Ye=(ve=0)|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[ie>>2]=qe[Ye>>0],ve=203;continue e;case 224:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=225;continue e}Ye=0|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[ce>>2]=qe[Ye>>0],ve=231;continue e;case 266:Ye=(ve=0)|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[Ee>>2]=qe[Ye>>0],ve=267;continue e;case 279:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=280;continue e}Ye=0|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[me>>2]=qe[Ye>>0],ve=286;continue e;case 300:Ye=(ve=0)|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[pe>>2]=qe[Ye>>0],ve=301;continue e;case 325:Ye=(ve=0)|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[Fe>>2]=qe[Ye>>0],ve=326;continue e;case 337:Ye=(ve=0)|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[be>>2]=qe[Ye>>0],ve=338;continue e;case 340:if(((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0){ve=341;continue e}Ye=0|Ge[w>>2],Ge[w>>2]=Ye+1,Ge[Me>>2]=qe[Ye>>0],ve=347;continue e}}else ve=((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0?43:(Ue=0|Ge[w>>2],Ge[w>>2]=Ue+1,Ge[N>>2]=qe[Ue>>0],49)}else ve=((ve=0)|Ge[w>>2])>>>0>=(0|Ge[R>>2])>>>0?33:(Ue=0|Ge[w>>2],Ge[w>>2]=Ue+1,Ge[v>>2]=qe[Ue>>0],39)}if(351==(0|ve)){for(Ge[ye>>2]=Ge[Te>>2],Ge[Oe>>2]=Ge[Ge[S>>2]>>2],Ge[Re>>2]=65535&Ge[28+(0|Ge[l>>2])>>2],Ge[Ae>>2]=(0|Ge[28+(0|Ge[l>>2])>>2])>>>16,Ge[ke>>2]=((0|Ge[Oe>>2])>>>0)%5552|0;0|Ge[Oe>>2];){for(Ge[we>>2]=0;!((7+(0|Ge[we>>2])|0)>>>0>=(0|Ge[ke>>2])>>>0);)Ge[Re>>2]=(0|Ge[Re>>2])+(0|qe[Ge[ye>>2]>>0]),Ge[Ae>>2]=(0|Ge[Ae>>2])+(0|Ge[Re>>2]),Ge[Re>>2]=(0|Ge[Re>>2])+(0|qe[1+(0|Ge[ye>>2])>>0]),Ge[Ae>>2]=(0|Ge[Ae>>2])+(0|Ge[Re>>2]),Ge[Re>>2]=(0|Ge[Re>>2])+(0|qe[2+(0|Ge[ye>>2])>>0]),Ge[Ae>>2]=(0|Ge[Ae>>2])+(0|Ge[Re>>2]),Ge[Re>>2]=(0|Ge[Re>>2])+(0|qe[3+(0|Ge[ye>>2])>>0]),Ge[Ae>>2]=(0|Ge[Ae>>2])+(0|Ge[Re>>2]),Ge[Re>>2]=(0|Ge[Re>>2])+(0|qe[4+(0|Ge[ye>>2])>>0]),Ge[Ae>>2]=(0|Ge[Ae>>2])+(0|Ge[Re>>2]),Ge[Re>>2]=(0|Ge[Re>>2])+(0|qe[5+(0|Ge[ye>>2])>>0]),Ge[Ae>>2]=(0|Ge[Ae>>2])+(0|Ge[Re>>2]),Ge[Re>>2]=(0|Ge[Re>>2])+(0|qe[6+(0|Ge[ye>>2])>>0]),Ge[Ae>>2]=(0|Ge[Ae>>2])+(0|Ge[Re>>2]),Ge[Re>>2]=(0|Ge[Re>>2])+(0|qe[7+(0|Ge[ye>>2])>>0]),Ge[Ae>>2]=(0|Ge[Ae>>2])+(0|Ge[Re>>2]),Ge[we>>2]=8+(0|Ge[we>>2]),Ge[ye>>2]=8+(0|Ge[ye>>2]);for(;!((0|Ge[we>>2])>>>0>=(0|Ge[ke>>2])>>>0);)Te=0|Ge[ye>>2],Ge[ye>>2]=Te+1,Ge[Re>>2]=(0|Ge[Re>>2])+(0|qe[Te>>0]),Ge[Ae>>2]=(0|Ge[Ae>>2])+(0|Ge[Re>>2]),Ge[we>>2]=1+(0|Ge[we>>2]);Ge[Re>>2]=((0|Ge[Re>>2])>>>0)%65521|0,Ge[Ae>>2]=((0|Ge[Ae>>2])>>>0)%65521|0,Ge[Oe>>2]=(0|Ge[Oe>>2])-(0|Ge[ke>>2]),Ge[ke>>2]=5552}Ge[28+(0|Ge[l>>2])>>2]=(Ge[Ae>>2]<<16)+(0|Ge[Re>>2]),0==(0|Ge[p>>2])&&1&Ge[_>>2]|0&&(0|Ge[28+(0|Ge[l>>2])>>2])!=(0|Ge[16+(0|Ge[l>>2])>>2])&&(Ge[p>>2]=-2)}return Ge[c>>2]=Ge[p>>2],Ke=0|Ge[c>>2],Ze=We,0|Ke}return Ge[Ge[S>>2]>>2]=0,Ge[Ge[d>>2]>>2]=0,Ge[c>>2]=-3,Ke=0|Ge[c>>2],Ze=We,0|Ke}function x(e){e|=0;var r,t=0,n=0,o=0,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,E=0,S=0,_=0,m=0,h=0,p=0,F=0,M=0,b=0,y=0,O=0,w=0,R=0,A=0,k=0,T=0,g=0,v=0,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0,U=0,Y=0,z=0,V=0,K=0,W=0,X=0,j=0,G=0,q=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,te=0,ne=0,oe=0,ie=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,de=0,Ee=0,Se=0,_e=0,me=0,he=0,pe=0,Fe=0,Me=0,be=0,ye=Ze;(0|Je)<=(0|(Ze=Ze+16|0))&&Qe(16),t=ye;do{if(e>>>0<245){if(o=(n=e>>>0<11?16:e+11&-8)>>>3,3&(a=(i=0|Ge[948])>>>o)|0)return l=0|Ge[(c=(u=3832+((s=(1&a^1)+o|0)<<1<<2)|0)+8|0)>>2],(0|u)==(0|(d=0|Ge[(f=l+8|0)>>2]))?Ge[948]=i&~(1<>2]=u,Ge[c>>2]=d),d=s<<3,Ge[l+4>>2]=3|d,Ge[(s=l+d+4|0)>>2]=1|Ge[s>>2],Ze=ye,0|(E=f);if((f=0|Ge[950])>>>0>>0){if(0|a)return a=0|Ge[(c=(l=3832+((u=((s=(o=(s=((d=a<>>(d=s>>>12&16))>>>5&8)|d|(o=(a=o>>>s)>>>2&4)|(a=(l=a>>>o)>>>1&2)|(l=(c=l>>>a)>>>1&1))+(c>>>l)|0)<<1<<2)|0)+8|0)>>2],S=(0|l)==(0|(d=0|Ge[(o=a+8|0)>>2]))?(s=i&~(1<>2]=l,Ge[c>>2]=d,i),d=(u<<3)-n|0,Ge[a+4>>2]=3|n,Ge[(u=a+n|0)+4>>2]=1|d,Ge[u+d>>2]=d,0|f&&(a=0|Ge[953],l=3832+((c=f>>>3)<<1<<2)|0,m=S&(s=1<>2],s):(Ge[948]=S|s,(_=l)+8|0),Ge[m>>2]=a,Ge[_+12>>2]=a,Ge[a+8>>2]=_,Ge[a+12>>2]=l),Ge[950]=d,Ge[953]=u,Ze=ye,0|(E=o);if(o=0|Ge[949]){if(h=0|Ge[4096+(((u=(l=(u=(o&0-o)-1|0)>>>(d=u>>>12&16))>>>5&8)|d|(l=(a=l>>>u)>>>2&4)|(a=(s=a>>>l)>>>1&2)|(s=(c=s>>>a)>>>1&1))+(c>>>s)<<2)>>2],s=(-8&Ge[h+4>>2])-n|0,c=0|Ge[h+16+((0==(0|Ge[h+16>>2])&1)<<2)>>2])for(a=h,h=s,s=c;;){if(d=(l=(c=(-8&Ge[s+4>>2])-n|0)>>>0>>0)?c:h,c=l?s:a,!(s=0|Ge[s+16+((0==(0|Ge[s+16>>2])&1)<<2)>>2])){p=c,F=d;break}a=c,h=d}else p=h,F=s;if(p>>>0<(h=p+n|0)>>>0){a=0|Ge[p+24>>2],s=0|Ge[p+12>>2];do{if((0|s)==(0|p)){if(c=0|Ge[(d=p+20|0)>>2])b=c,y=d;else{if(!(u=0|Ge[(l=p+16|0)>>2])){M=0;break}b=u,y=l}for(;;)if(0|(c=0|Ge[(d=b+20|0)>>2]))b=c,y=d;else{if(!(c=0|Ge[(d=b+16|0)>>2]))break;b=c,y=d}Ge[y>>2]=0,M=b}else d=0|Ge[p+8>>2],Ge[d+12>>2]=s,Ge[s+8>>2]=d,M=s}while(0);do{if(0|a){if(s=0|Ge[p+28>>2],(0|p)==(0|Ge[(d=4096+(s<<2)|0)>>2])){if(!(Ge[d>>2]=M)){Ge[949]=o&~(1<>2])!=(0|p)&1)<<2)>>2]=M))break;Ge[M+24>>2]=a,0|(s=0|Ge[p+16>>2])&&(Ge[M+16>>2]=s,Ge[s+24>>2]=M),0|(s=0|Ge[p+20>>2])&&(Ge[M+20>>2]=s,Ge[s+24>>2]=M)}}while(0);return F>>>0<16?(a=F+n|0,Ge[p+4>>2]=3|a,Ge[(o=p+a+4|0)>>2]=1|Ge[o>>2]):(Ge[p+4>>2]=3|n,Ge[h+4>>2]=1|F,Ge[h+F>>2]=F,0|f&&(o=0|Ge[953],s=3832+((a=f>>>3)<<1<<2)|0,w=i&(d=1<>2],d):(Ge[948]=i|d,(O=s)+8|0),Ge[w>>2]=o,Ge[O+12>>2]=o,Ge[o+8>>2]=O,Ge[o+12>>2]=s),Ge[950]=F,Ge[953]=h),Ze=ye,0|(E=p+8|0)}R=n}else R=n}else R=n}else if(e>>>0<=4294967231)if(o=-8&(s=e+11|0),d=0|Ge[949]){a=0-o|0,A=(c=s>>>8)?16777215>>0?31:o>>>((k=14-((c=((l=c<<(s=(c+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(l=((u=l<>>16&2))+(u<>>15)|0)+7|0)&1|k<<1:0,k=0|Ge[4096+(A<<2)>>2];e:do{if(k)for(u=a,s=k,c=o<<(31==((l=0)|A)?0:25-(A>>>1)|0),D=0;;){if((P=(-8&Ge[s+4>>2])-o|0)>>>0>>0){if(!P){I=0,L=C=s,N=61;break e}x=s,B=P}else x=l,B=u;if(r=0==(0|(P=0|Ge[s+20>>2]))|(0|P)==(0|(s=0|Ge[s+16+(c>>>31<<2)>>2]))?D:P,P=0==(0|s)){T=r,g=x,v=B,N=57;break}l=x,u=B,c<<=1&(1^P),D=r}else g=T=0,v=a,N=57}while(0);if(57==(0|N)){if(0==(0|T)&0==(0|g)){if(!(a=d&((k=2<>>(a=k>>>12&16))>>>5&8)|a|(n=(h=n>>>k)>>>2&4)|(h=(i=h>>>n)>>>1&2)|(i=(f=i>>>h)>>>1&1))+(f>>>i)<<2)>>2]}else H=g,U=T;U?(C=H,I=v,L=U,N=61):(Y=H,z=v)}if(61==(0|N))for(;;){if(N=0,h=(f=(i=(-8&Ge[L+4>>2])-o|0)>>>0>>0)?i:I,i=f?L:C,!(L=0|Ge[L+16+((0==(0|Ge[L+16>>2])&1)<<2)>>2])){Y=i,z=h;break}C=i,I=h,N=61}if(0!=(0|Y)&&z>>>0<((0|Ge[950])-o|0)>>>0){if((h=Y+o|0)>>>0<=Y>>>0)return Ze=ye,(E=0)|E;i=0|Ge[Y+24>>2],f=0|Ge[Y+12>>2];do{if((0|f)==(0|Y)){if(a=0|Ge[(n=Y+20|0)>>2])K=a,W=n;else{if(!(D=0|Ge[(k=Y+16|0)>>2])){V=0;break}K=D,W=k}for(;;)if(0|(a=0|Ge[(n=K+20|0)>>2]))K=a,W=n;else{if(!(a=0|Ge[(n=K+16|0)>>2]))break;K=a,W=n}Ge[W>>2]=0,V=K}else n=0|Ge[Y+8>>2],Ge[n+12>>2]=f,Ge[f+8>>2]=n,V=f}while(0);do{if(i){if(f=0|Ge[Y+28>>2],(0|Y)==(0|Ge[(n=4096+(f<<2)|0)>>2])){if(!(Ge[n>>2]=V)){n=d&~(1<>2])!=(0|Y)&1)<<2)>>2]=V)){X=d;break}Ge[V+24>>2]=i,0|(n=0|Ge[Y+16>>2])&&(Ge[V+16>>2]=n,Ge[n+24>>2]=V),X=((n=0|Ge[Y+20>>2])&&(Ge[V+20>>2]=n,Ge[n+24>>2]=V),d)}else X=d}while(0);do{if(16<=z>>>0){if(Ge[Y+4>>2]=3|o,Ge[h+4>>2]=1|z,d=(Ge[h+z>>2]=z)>>>3,z>>>0<256){i=3832+(d<<1<<2)|0,G=(n=0|Ge[948])&(f=1<>2],f):(Ge[948]=n|f,(j=i)+8|0),Ge[G>>2]=h,Ge[j+12>>2]=h,Ge[h+8>>2]=j,Ge[h+12>>2]=i;break}if(a=4096+((q=(i=z>>>8)?16777215>>0?31:z>>>((a=14-((i=((n=i<<(f=(i+1048320|0)>>>16&8))+520192|0)>>>16&4)|f|(n=((d=n<>>16&2))+(d<>>15)|0)+7|0)&1|a<<1:0)<<2)|0,Ge[h+28>>2]=q,Ge[(n=h+16|0)+4>>2]=0,Ge[n>>2]=0,!(X&(n=1<>2]=h,Ge[h+24>>2]=a,Ge[h+12>>2]=h,Ge[h+8>>2]=h;break}for(n=z<<(31==(0|q)?0:25-(q>>>1)|0),d=0|Ge[a>>2];;){if((-8&Ge[d+4>>2]|0)==(0|z)){N=97;break}if(!(a=0|Ge[(Z=d+16+(n>>>31<<2)|0)>>2])){N=96;break}n<<=1,d=a}if(96==(0|N)){Ge[Z>>2]=h,Ge[h+24>>2]=d,Ge[h+12>>2]=h,Ge[h+8>>2]=h;break}if(97==(0|N)){a=0|Ge[(n=d+8|0)>>2],Ge[a+12>>2]=h,Ge[n>>2]=h,Ge[h+8>>2]=a,Ge[h+12>>2]=d,Ge[h+24>>2]=0;break}}else a=z+o|0,Ge[Y+4>>2]=3|a,Ge[(n=Y+a+4|0)>>2]=1|Ge[n>>2]}while(0);return Ze=ye,0|(E=Y+8|0)}R=o}else R=o;else R=-1}while(0);if(R>>>0<=(Y=0|Ge[950])>>>0)return z=Y-R|0,Z=0|Ge[953],15>>0?(q=Z+R|0,Ge[953]=q,Ge[950]=z,Ge[q+4>>2]=1|z,Ge[q+z>>2]=z,Ge[Z+4>>2]=3|R):(Ge[950]=0,Ge[953]=0,Ge[Z+4>>2]=3|Y,Ge[(z=Z+Y+4|0)>>2]=1|Ge[z>>2]),Ze=ye,0|(E=Z+8|0);if(R>>>0<(Z=0|Ge[951])>>>0)return z=Z-R|0,Ge[951]=z,q=(Y=0|Ge[954])+R|0,Ge[954]=q,Ge[q+4>>2]=1|z,Ge[Y+4>>2]=3|R,Ze=ye,0|(E=Y+8|0);if(J=0|Ge[1066]?0|Ge[1068]:(Ge[1068]=4096,Ge[1067]=4096,Ge[1069]=-1,Ge[1070]=-1,Ge[1071]=0,Ge[1059]=0,Y=-16&t^1431655768,Ge[t>>2]=Y,Ge[1066]=Y,4096),Y=R+48|0,(J=(z=J+(t=R+47|0)|0)&(q=0-J|0))>>>0<=R>>>0)return Ze=ye,(E=0)|E;if(0|(X=0|Ge[1058])&&(G=(j=0|Ge[1056])+J|0)>>>0<=j>>>0|X>>>0>>0)return Ze=ye,(E=0)|E;e:do{if(4&Ge[1059])oe=0,N=133;else{X=0|Ge[954];r:do{if(X){for(G=4240;!((j=0|Ge[G>>2])>>>0<=X>>>0&&(j+(0|Ge[(Q=G+4|0)>>2])|0)>>>0>X>>>0);){if(!(j=0|Ge[G+8>>2])){N=118;break r}G=j}if((d=z-Z&q)>>>0<2147483647)if((0|(j=0|Oe(0|d)))==((0|Ge[G>>2])+(0|Ge[Q>>2])|0)){if(-1!=(0|j)){ee=d,re=j,N=135;break e}$=d}else te=j,ne=d,N=126;else $=0}else N=118}while(0);do{if(118==(0|N))if(-1!=(0|(X=0|Oe(0)))&&(o=X,d=(V=(0==((j=(d=0|Ge[1067])+-1|0)&o|0)?0:(j+o&0-d)-o|0)+J|0)+(o=0|Ge[1056])|0,R>>>0>>0&V>>>0<2147483647)){if(0|(j=0|Ge[1058])&&d>>>0<=o>>>0|j>>>0>>0){$=0;break}if((0|(j=0|Oe(0|V)))==(0|X)){ee=V,re=X,N=135;break e}te=j,ne=V,N=126}else $=0}while(0);do{if(126==(0|N)){if(V=0-ne|0,!(ne>>>0>>0&ne>>>0<2147483647&-1!=(0|te))){if(-1==(0|te)){$=0;break}ee=ne,re=te,N=135;break e}if(2147483647<=(X=t-ne+(j=0|Ge[1068])&0-j)>>>0){ee=ne,re=te,N=135;break e}if(-1==(0|Oe(0|X))){Oe(0|V),$=0;break}ee=X+ne|0,re=te,N=135;break e}}while(0);Ge[1059]=4|Ge[1059],oe=$,N=133}}while(0);if(133==(0|N)&&J>>>0<2147483647&&!(-1==(0|($=0|Oe(0|J)))|1^(ne=(R+40|0)>>>0<(te=(J=0|Oe(0))-$|0)>>>0)|$>>>0>>0&-1!=(0|$)&-1!=(0|J)^1)&&(ee=ne?te:oe,re=$,N=135),135==(0|N)){$=(0|Ge[1056])+ee|0,(Ge[1056]=$)>>>0>(0|Ge[1057])>>>0&&(Ge[1057]=$),$=0|Ge[954];do{if($){for(oe=4240;;){if((0|re)==((ie=0|Ge[oe>>2])+(se=0|Ge[(ae=oe+4|0)>>2])|0)){N=145;break}if(!(te=0|Ge[oe+8>>2]))break;oe=te}if(145==(0|N)&&0==(8&Ge[oe+12>>2]|0)&&$>>>0>>0&ie>>>0<=$>>>0){Ge[ae>>2]=se+ee,te=$+(ne=0==(7&(te=$+8|0)|0)?0:0-te&7)|0,J=(0|Ge[951])+(ee-ne)|0,Ge[954]=te,Ge[951]=J,Ge[te+4>>2]=1|J,Ge[te+J+4>>2]=40,Ge[955]=Ge[1070];break}for(re>>>0<(0|Ge[952])>>>0&&(Ge[952]=re),J=re+ee|0,te=4240;;){if((0|Ge[te>>2])==(0|J)){N=153;break}if(!(ne=0|Ge[te+8>>2]))break;te=ne}if(153==(0|N)&&0==(8&Ge[te+12>>2]|0)){Ge[te>>2]=re,Ge[(oe=te+4|0)>>2]=(0|Ge[oe>>2])+ee,ne=re+(0==(7&(oe=re+8|0)|0)?0:0-oe&7)|0,t=J+(0==(7&(oe=J+8|0)|0)?0:0-oe&7)|0,oe=ne+R|0,Y=t-ne-R|0,Ge[ne+4>>2]=3|R;do{if((0|t)!=(0|$)){if((0|t)==(0|Ge[953])){Q=(0|Ge[950])+Y|0,Ge[950]=Q,Ge[953]=oe,Ge[oe+4>>2]=1|Q,Ge[oe+Q>>2]=Q;break}if(1==(3&(Q=0|Ge[t+4>>2])|0)){q=-8&Q,Z=Q>>>3;e:do{if(Q>>>0<256){if(z=0|Ge[t+8>>2],(0|(X=0|Ge[t+12>>2]))==(0|z)){Ge[948]=Ge[948]&~(1<>2]=X,Ge[X+8>>2]=z;break}z=0|Ge[t+24>>2],X=0|Ge[t+12>>2];do{if((0|X)==(0|t)){if(d=0|Ge[(j=(V=t+16|0)+4|0)>>2])ce=d,le=j;else{if(!(o=0|Ge[V>>2])){ue=0;break}ce=o,le=V}for(;;)if(0|(d=0|Ge[(j=ce+20|0)>>2]))ce=d,le=j;else{if(!(d=0|Ge[(j=ce+16|0)>>2]))break;ce=d,le=j}Ge[le>>2]=0,ue=ce}else j=0|Ge[t+8>>2],Ge[j+12>>2]=X,Ge[X+8>>2]=j,ue=X}while(0);if(!z)break;j=4096+((X=0|Ge[t+28>>2])<<2)|0;do{if((0|t)==(0|Ge[j>>2])){if(0|(Ge[j>>2]=ue))break;Ge[949]=Ge[949]&~(1<>2])!=(0|t)&1)<<2)>>2]=ue))break e}while(0)}while((Ge[ue+24>>2]=z,0|(j=0|Ge[(X=t+16|0)>>2])&&(Ge[ue+16>>2]=j,Ge[j+24>>2]=ue),j=0|Ge[X+4>>2])&&(Ge[ue+20>>2]=j,Ge[j+24>>2]=ue,0));fe=t+q|0,de=q+Y|0}else fe=t,de=Y;if(Ge[(Z=fe+4|0)>>2]=-2&Ge[Z>>2],Ge[oe+4>>2]=1|de,Z=(Ge[oe+de>>2]=de)>>>3,de>>>0<256){Q=3832+(Z<<1<<2)|0,Se=(G=0|Ge[948])&(j=1<>2],j):(Ge[948]=G|j,(Ee=Q)+8|0),Ge[Se>>2]=oe,Ge[Ee+12>>2]=oe,Ge[oe+8>>2]=Ee,Ge[oe+12>>2]=Q;break}Q=de>>>8;do{if(Q){if(16777215>>0){_e=31;break}_e=de>>>((d=14-((Z=((G=Q<<(j=(Q+1048320|0)>>>16&8))+520192|0)>>>16&4)|j|(G=((X=G<>>16&2))+(X<>>15)|0)+7|0)&1|d<<1}else _e=0}while(0);if(Q=4096+(_e<<2)|0,Ge[oe+28>>2]=_e,Ge[(q=oe+16|0)+4>>2]=0,!((q=(Ge[q>>2]=0)|Ge[949])&(d=1<<_e))){Ge[949]=q|d,Ge[Q>>2]=oe,Ge[oe+24>>2]=Q,Ge[oe+12>>2]=oe,Ge[oe+8>>2]=oe;break}for(d=de<<(31==(0|_e)?0:25-(_e>>>1)|0),q=0|Ge[Q>>2];;){if((-8&Ge[q+4>>2]|0)==(0|de)){N=194;break}if(!(Q=0|Ge[(me=q+16+(d>>>31<<2)|0)>>2])){N=193;break}d<<=1,q=Q}if(193==(0|N)){Ge[me>>2]=oe,Ge[oe+24>>2]=q,Ge[oe+12>>2]=oe,Ge[oe+8>>2]=oe;break}if(194==(0|N)){Q=0|Ge[(d=q+8|0)>>2],Ge[Q+12>>2]=oe,Ge[d>>2]=oe,Ge[oe+8>>2]=Q,Ge[oe+12>>2]=q,Ge[oe+24>>2]=0;break}}else Q=(0|Ge[951])+Y|0,Ge[951]=Q,Ge[954]=oe,Ge[oe+4>>2]=1|Q}while(0);return Ze=ye,0|(E=ne+8|0)}for(oe=4240;!((Y=0|Ge[oe>>2])>>>0<=$>>>0&&$>>>0<(he=Y+(0|Ge[oe+4>>2])|0)>>>0);)oe=0|Ge[oe+8>>2];for(oe=he+-47|0,ne=oe+8|0,Y=oe+(0==(7&ne|0)?0:0-ne&7)|0,ne=$+16|0,oe=Y>>>0>>0?$:Y,Y=oe+8|0,t=re+8|0,J=0==(7&t|0)?0:0-t&7,t=re+J|0,te=ee+-40-J|0,Ge[954]=t,Ge[951]=te,Ge[t+4>>2]=1|te,Ge[t+te+4>>2]=40,Ge[955]=Ge[1070],te=oe+4|0,Ge[te>>2]=27,Ge[Y>>2]=Ge[1060],Ge[Y+4>>2]=Ge[1061],Ge[Y+8>>2]=Ge[1062],Ge[Y+12>>2]=Ge[1063],Ge[1060]=re,Ge[1061]=ee,Ge[1063]=0,Ge[1062]=Y,Y=oe+24|0;Ge[(Y=(t=Y)+4|0)>>2]=7,(t+8|0)>>>0>>0;);if((0|oe)!=(0|$)){if(Y=oe-$|0,Ge[te>>2]=-2&Ge[te>>2],Ge[$+4>>2]=1|Y,t=(Ge[oe>>2]=Y)>>>3,Y>>>0<256){J=3832+(t<<1<<2)|0,Fe=(Q=0|Ge[948])&(d=1<>2],d):(Ge[948]=Q|d,(pe=J)+8|0),Ge[Fe>>2]=$,Ge[pe+12>>2]=$,Ge[$+8>>2]=pe,Ge[$+12>>2]=J;break}if(G=4096+((Me=(J=Y>>>8)?16777215>>0?31:Y>>>((G=14-((J=((Q=J<<(d=(J+1048320|0)>>>16&8))+520192|0)>>>16&4)|d|(Q=((t=Q<>>16&2))+(t<>>15)|0)+7|0)&1|G<<1:0)<<2)|0,Ge[$+28>>2]=Me,Ge[$+20>>2]=0,!((Q=(Ge[ne>>2]=0)|Ge[949])&(t=1<>2]=$,Ge[$+24>>2]=G,Ge[$+12>>2]=$,Ge[$+8>>2]=$;break}for(t=Y<<(31==(0|Me)?0:25-(Me>>>1)|0),Q=0|Ge[G>>2];;){if((-8&Ge[Q+4>>2]|0)==(0|Y)){N=216;break}if(!(G=0|Ge[(be=Q+16+(t>>>31<<2)|0)>>2])){N=215;break}t<<=1,Q=G}if(215==(0|N)){Ge[be>>2]=$,Ge[$+24>>2]=Q,Ge[$+12>>2]=$,Ge[$+8>>2]=$;break}if(216==(0|N)){Y=0|Ge[(t=Q+8|0)>>2],Ge[Y+12>>2]=$,Ge[t>>2]=$,Ge[$+8>>2]=Y,Ge[$+12>>2]=Q,Ge[$+24>>2]=0;break}}}else{for(Y=0|Ge[952],0==(0|Y)|re>>>0>>0&&(Ge[952]=re),Ge[1060]=re,Ge[1061]=ee,Ge[1063]=0,Ge[957]=Ge[1066],Ge[956]=-1,Y=0;Ge[(t=3832+(Y<<1<<2)|0)+12>>2]=t,Ge[t+8>>2]=t,Y=Y+1|0,32!=(0|Y););Y=re+(Q=0==(7&(Y=re+8|0)|0)?0:0-Y&7)|0,t=ee+-40-Q|0,Ge[954]=Y,Ge[951]=t,Ge[Y+4>>2]=1|t,Ge[Y+t+4>>2]=40,Ge[955]=Ge[1070]}}while(0);if(R>>>0<(ee=0|Ge[951])>>>0)return re=ee-R|0,Ge[951]=re,$=(ee=0|Ge[954])+R|0,Ge[954]=$,Ge[$+4>>2]=1|re,Ge[ee+4>>2]=3|R,Ze=ye,0|(E=ee+8|0)}return Ge[(ee=652)>>2]=12,Ze=ye,(E=0)|E}function B(e){var r,t,n,o=0,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,E=0,S=0,_=0,m=0,h=0,p=0,F=0,M=0,b=0,y=0,O=0,w=0,R=0,A=0,k=0,T=0;if(e|=0){o=e+-8|0,i=0|Ge[952],r=o+(e=-8&(a=0|Ge[e+-4>>2]))|0;do{if(1&a)d=e,E=f=o;else{if(s=0|Ge[o>>2],!(3&a))return;if(t=s+e|0,(u=o+(0-s)|0)>>>0>>0)return;if((0|u)==(0|Ge[953])){if(3==(3&(l=0|Ge[(c=4+r|0)>>2])|0))return Ge[950]=t,Ge[c>>2]=-2&l,Ge[u+4>>2]=1|t,void(Ge[u+t>>2]=t);d=t,E=f=u;break}if(l=s>>>3,s>>>0<256){if(s=0|Ge[u+8>>2],(0|(c=0|Ge[u+12>>2]))==(0|s)){Ge[948]=Ge[948]&~(1<>2]=c,Ge[c+8>>2]=s,d=t,E=f=u;break}s=0|Ge[u+24>>2],c=0|Ge[u+12>>2];do{if((0|c)==(0|u)){if(_=0|Ge[(S=(l=u+16|0)+4|0)>>2])h=_,p=S;else{if(!(n=0|Ge[l>>2])){m=0;break}h=n,p=l}for(;;)if(0|(_=0|Ge[(S=h+20|0)>>2]))h=_,p=S;else{if(!(_=0|Ge[(S=h+16|0)>>2]))break;h=_,p=S}Ge[p>>2]=0,m=h}else S=0|Ge[u+8>>2],Ge[S+12>>2]=c,Ge[c+8>>2]=S,m=c}while(0);if(s){if(c=0|Ge[u+28>>2],(0|u)==(0|Ge[(S=4096+(c<<2)|0)>>2])){if(!(Ge[S>>2]=m)){Ge[949]=Ge[949]&~(1<>2])!=(0|u)&1)<<2)>>2]=m)){d=t,E=f=u;break}Ge[m+24>>2]=s,0|(S=0|Ge[(c=u+16|0)>>2])&&(Ge[m+16>>2]=S,Ge[S+24>>2]=m),E=f=(d=((S=0|Ge[c+4>>2])&&(Ge[m+20>>2]=S,Ge[S+24>>2]=m),t),u)}else d=t,E=f=u}}while(0);if(!(r>>>0<=E>>>0)&&1&(e=0|Ge[(o=4+r|0)>>2])){if(2&e)Ge[o>>2]=-2&e,Ge[f+4>>2]=1|d,y=Ge[E+d>>2]=d;else{if(m=0|Ge[953],(0|r)==(0|Ge[954]))return h=(0|Ge[951])+d|0,Ge[951]=h,Ge[954]=f,Ge[f+4>>2]=1|h,(0|f)!=(0|m)?void 0:(Ge[953]=0,void(Ge[950]=0));if((0|r)==(0|m))return m=(0|Ge[950])+d|0,Ge[950]=m,Ge[953]=E,Ge[f+4>>2]=1|m,void(Ge[E+m>>2]=m);m=(-8&e)+d|0,h=e>>>3;do{if(e>>>0<256){if(p=0|Ge[8+r>>2],(0|(i=0|Ge[12+r>>2]))==(0|p)){Ge[948]=Ge[948]&~(1<>2]=i,Ge[i+8>>2]=p;break}p=0|Ge[24+r>>2],i=0|Ge[12+r>>2];do{if((0|i)==(0|r)){if(c=0|Ge[(S=(a=16+r|0)+4|0)>>2])M=c,b=S;else{if(!(_=0|Ge[a>>2])){F=0;break}M=_,b=a}for(;;)if(0|(c=0|Ge[(S=M+20|0)>>2]))M=c,b=S;else{if(!(c=0|Ge[(S=M+16|0)>>2]))break;M=c,b=S}Ge[b>>2]=0,F=M}else S=0|Ge[8+r>>2],Ge[S+12>>2]=i,Ge[i+8>>2]=S,F=i}while(0);if(0|p){if(i=0|Ge[28+r>>2],(0|r)==(0|Ge[(u=4096+(i<<2)|0)>>2])){if(!(Ge[u>>2]=F)){Ge[949]=Ge[949]&~(1<>2])!=(0|r)&1)<<2)>>2]=F))break;Ge[F+24>>2]=p,0|(u=0|Ge[(i=16+r|0)>>2])&&(Ge[F+16>>2]=u,Ge[u+24>>2]=F),0|(u=0|Ge[i+4>>2])&&(Ge[F+20>>2]=u,Ge[u+24>>2]=F)}}while(0);if(Ge[f+4>>2]=1|m,Ge[E+m>>2]=m,(0|f)==(0|Ge[953]))return void(Ge[950]=m);y=m}if(d=y>>>3,y>>>0<256)return E=3832+(d<<1<<2)|0,w=(e=0|Ge[948])&(o=1<>2],o):(Ge[948]=e|o,(O=E)+8|0),Ge[w>>2]=f,Ge[O+12>>2]=f,Ge[f+8>>2]=O,void(Ge[f+12>>2]=E);e=4096+((R=(E=y>>>8)?16777215>>0?31:y>>>((e=14-((E=((w=E<<(O=(E+1048320|0)>>>16&8))+520192|0)>>>16&4)|O|(w=((o=w<>>16&2))+(o<>>15)|0)+7|0)&1|e<<1:0)<<2)|0,Ge[f+28>>2]=R,Ge[f+20>>2]=0,w=(Ge[f+16>>2]=0)|Ge[949],o=1<>>1)|0),E=0|Ge[e>>2];;){if((-8&Ge[E+4>>2]|0)==(0|y)){A=73;break}if(!(d=0|Ge[(k=E+16+(O>>>31<<2)|0)>>2])){A=72;break}O<<=1,E=d}if(72==(0|A)){Ge[k>>2]=f,Ge[f+24>>2]=E,Ge[f+12>>2]=f,Ge[f+8>>2]=f;break}if(73==(0|A)){p=0|Ge[(O=E+8|0)>>2],Ge[p+12>>2]=f,Ge[O>>2]=f,Ge[f+8>>2]=p,Ge[f+12>>2]=E,Ge[f+24>>2]=0;break}}else Ge[949]=w|o,Ge[e>>2]=f,Ge[f+24>>2]=e,Ge[f+12>>2]=f,Ge[f+8>>2]=f}while(0);if(f=(0|Ge[956])-1|0,!(Ge[956]=f)){for(T=4248;f=0|Ge[T>>2];)T=f+8|0;Ge[956]=-1}}}}function H(e,r,t){e|=0,r|=0,t|=0;var n,o,i,a,s,u,c,l,f,d,E=0,S=0,_=0,m=0,h=0,p=0,F=0,M=Ze;(0|Je)<=(0|(Ze=Ze+48|0))&&Qe(48),n=M+16|0,o=(E=M)+32|0,a=0|Ge[(i=e+28|0)>>2],Ge[o>>2]=a,u=(0|Ge[(s=e+20|0)>>2])-a|0,Ge[4+o>>2]=u,Ge[8+o>>2]=r,r=u+(Ge[12+o>>2]=t)|0,u=e+60|0,Ge[E>>2]=Ge[u>>2],Ge[E+4>>2]=o,Ge[E+8>>2]=2,a=0|U(0|R(146,0|E));e:do{if((0|r)!=(0|a)){for(E=2,S=r,_=o,m=a;!((0|m)<0);){if(S=S-m|0,f=((c=(h=0|Ge[_+4>>2])>>>0>>0)<<31>>31)+E|0,d=m-(c?h:0)|0,Ge[(l=c?_+8|0:_)>>2]=(0|Ge[l>>2])+d,Ge[(h=l+4|0)>>2]=(0|Ge[h>>2])-d,Ge[n>>2]=Ge[u>>2],Ge[4+n>>2]=l,Ge[8+n>>2]=f,(0|S)==(0|(m=0|U(0|R(146,0|n))))){p=3;break e}E=f,_=l}Ge[e+16>>2]=0,Ge[i>>2]=0,Ge[s>>2]=0,Ge[e>>2]=32|Ge[e>>2],F=2==(0|E)?0:t-(0|Ge[_+4>>2])|0}else p=3}while(0);return 3==(0|p)&&(p=0|Ge[e+44>>2],Ge[e+16>>2]=p+(0|Ge[e+48>>2]),Ge[i>>2]=p,Ge[s>>2]=p,F=t),Ze=M,0|F}function U(e){return 0|(4294963200<(e|=0)>>>0?(Ge[163]=0-e,-1):e)}function Y(){return 652}function z(e,r,t,n,o){e|=0,r|=0,t|=0,n|=0,o|=0;var i,a,s,u,c,l,f,d,E,S,_=0,m=0,h=0,p=0,F=0,M=0,b=0,y=0,O=0,w=0,R=0,A=0,k=0,T=0,g=0,v=0,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0,U=0,Y=0,z=0,V=0,K=0,W=0,X=0,j=0,G=0,q=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,te=0,ne=0,oe=0,ie=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,de=0,Ee=0,Se=0,_e=0,me=0,he=0,pe=0,Fe=0,Me=0,be=0,ye=0,Oe=0,we=0,Re=0,Ae=0,ke=Ze;(0|Je)<=(0|(Ze=Ze+64|0))&&Qe(64),c=(a=ke)+20|0,l=0!=(0|e),d=f=40+(s=ke+24|0)|0,E=39+s|0,s=4+(u=ke+8|0)|0,h=m=_=0,p=Ge[(i=ke+16|0)>>2]=r;e:for(;;){do{if(-1<(0|m)){if((2147483647-m|0)<(0|_)){Ge[(r=652)>>2]=75,F=-1;break}F=_+m|0;break}}while(F=m,0);if(!((r=0|Xe[p>>0])<<24>>24)){M=87;break}b=r,y=p;r:for(;;){switch(b<<24>>24){case 37:w=O=y,M=9;break r;case 0:A=R=y;break r}r=y+1|0,Ge[i>>2]=r,b=0|Xe[r>>0],y=r}r:do{if(9==(0|M))for(;;){if(37!=((M=0)|Xe[w+1>>0])){R=O,A=w;break r}if(r=O+1|0,k=w+2|0,Ge[i>>2]=k,37!=(0|Xe[k>>0])){R=r,A=k;break}O=r,w=k,M=9}}while(0);if(k=R-p|0,l&&De(e,p,k),0|k)_=k,m=F,p=A;else{N=(r=(0|Xe[(k=A+1|0)>>0])-48|0)>>>0<10?(g=(T=36==(0|Xe[A+2>>0]))?r:-1,v=T?1:h,T?A+3|0:k):(g=-1,v=h,k),Ge[i>>2]=N,T=((k=0|Xe[N>>0])<<24>>24)-32|0;r:do{if(T>>>0<32)for(r=0,D=k,P=T,C=N;;){if(!(75913&(I=1<>2]=I,32<=(P=((U=0|Xe[I>>0])<<24>>24)-32|0)>>>0){L=H,x=U,B=I;break}r=H,D=U,C=I}else L=0,x=k,B=N}while(0);if(x<<24>>24==42){if((T=(0|Xe[(k=B+1|0)>>0])-48|0)>>>0<10&&36==(0|Xe[B+2>>0]))Ge[o+(T<<2)>>2]=10,Y=0|Ge[n+((0|Xe[k>>0])-48<<3)>>2],z=1,V=B+3|0;else{if(0|v){K=-1;break}V=(z=l?(T=3+(0|Ge[t>>2])&-4,C=0|Ge[T>>2],Ge[t>>2]=T+4,Y=C,0):Y=0,k)}W=(k=(0|Y)<0)?0-Y|0:Y,X=k?8192|L:L,j=z,G=Ge[i>>2]=V}else{if((0|(k=0|Pe(i)))<0){K=-1;break}W=k,X=L,j=v,G=0|Ge[i>>2]}do{if(46==(0|Xe[G>>0])){if(42!=(0|Xe[G+1>>0])){Ge[i>>2]=G+1,q=k=0|Pe(i),Z=0|Ge[i>>2];break}if((C=(0|Xe[(k=G+2|0)>>0])-48|0)>>>0<10&&36==(0|Xe[G+3>>0])){Ge[o+(C<<2)>>2]=10,T=G+4|0,q=C=0|Ge[n+((0|Xe[k>>0])-48<<3)>>2],Z=Ge[i>>2]=T;break}if(0|j){K=-1;break e}q=l?(T=3+(0|Ge[t>>2])&-4,C=0|Ge[T>>2],Ge[t>>2]=T+4,C):0,Z=Ge[i>>2]=k}else q=-1,Z=G}while(0);for(k=0,C=Z;;){if(57<((0|Xe[C>>0])-65|0)>>>0){K=-1;break e}if(J=C+1|0,Ge[i>>2]=J,!((($=255&(Q=0|Xe[(0|Xe[C>>0])-65+(1362+(58*k|0))>>0]))+-1|0)>>>0<8))break;k=$,C=J}if(!(Q<<24>>24)){K=-1;break}T=-1<(0|g);do{if(Q<<24>>24==19){if(T){K=-1;break e}M=49}else{if(T){Ge[o+(g<<2)>>2]=$,r=0|Ge[(D=n+(g<<3)|0)+4>>2],Ge[(P=a)>>2]=Ge[D>>2],Ge[P+4>>2]=r,M=49;break}if(!l){K=0;break e}Ce(a,$,t)}}while(0);if(49!=(0|M)||(M=0,l)){r=0!=(0|k)&3==(15&(T=0|Xe[C>>0])|0)?-33&T:T,T=-65537&X,P=0==(8192&X|0)?X:T;r:do{switch(0|r){case 110:switch((255&k)<<24>>24){case 0:case 1:_=0,m=Ge[Ge[a>>2]>>2]=F,h=j,p=J;continue e;case 2:D=0|Ge[a>>2],Ge[D>>2]=F,Ge[D+4>>2]=((0|F)<0)<<31>>31,_=0,m=F,h=j,p=J;continue e;case 3:_=0,m=je[Ge[a>>2]>>1]=F,h=j,p=J;continue e;case 4:_=0,m=Xe[Ge[a>>2]>>0]=F,h=j,p=J;continue e;case 6:_=0,m=Ge[Ge[a>>2]>>2]=F,h=j,p=J;continue e;case 7:D=0|Ge[a>>2],Ge[D>>2]=F,Ge[D+4>>2]=((0|F)<0)<<31>>31,_=0,m=F,h=j,p=J;continue e;default:_=0,m=F,h=j,p=J;continue e}break;case 112:ee=120,re=8>>0?q:8,te=8|P,M=61;break;case 88:case 120:ee=r,re=q,te=P,M=61;break;case 111:ne=D=0|function(e,r,t){t|=0;var n=0,o=0;if(0==(0|(e|=0))&0==(0|(r|=0)))n=t;else for(o=t,t=r,r=e;;){if(Xe[(e=o+-1|0)>>0]=7&r|48,0==(0|(r=0|Ve(0|r,0|t,3)))&0==(0|(t=ve))){n=e;break}o=e}return 0|n}(I=0|Ge[(D=a)>>2],U=0|Ge[D+4>>2],f),ie=1826,ae=(oe=0)==(8&P|0)|(0|(H=d-D|0))<(0|q)?q:H+1|0,se=P,ue=I,ce=U,M=67;break;case 105:case 100:if(I=0|Ge[(U=a)>>2],(0|(H=0|Ge[U+4>>2]))<0){U=0|Ye(0,0,0|I,0|H),D=ve,le=1,fe=1826,de=Ge[(S=a)>>2]=U,Ee=Ge[S+4>>2]=D,M=66;break r}le=0!=(2049&P|0)&1,fe=0==(2048&P|0)?0==(1&P|0)?1826:1828:1827,de=I,Ee=H,M=66;break r;case 117:fe=1826,de=(le=0)|Ge[(H=a)>>2],Ee=0|Ge[H+4>>2],M=66;break;case 99:Xe[E>>0]=Ge[a>>2],Se=E,_e=0,me=1826,he=f,pe=1,Fe=T;break;case 109:Me=0|(0|function(e,r){e|=0,r|=0;var t=0,n=0,o=0,i=0,a=0,s=0;t=0;for(;;){if((0|qe[1896+t>>0])==(0|e)){n=2;break}if(87==(0|(o=t+1|0))){i=1984,a=87,n=5;break}t=o}2==(0|n)&&(t?(i=1984,a=t,n=5):s=1984);if(5==(0|n))for(;;){for(n=0,t=i;t=(e=t)+1|0,0!=(0|Xe[e>>0]););if(!(a=a+-1|0)){s=t;break}i=t,n=5}return 0|function(e,r){return 0|function(e,r){e|=0;var t=0;t=(r|=0)?0|function(e,r,t){r|=0,t|=0;var n=0,o=0,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,E=0,S=0,_=0,m=0,h=0;n=1794895138+(0|Ge[(e|=0)>>2])|0,o=0|Ue(0|Ge[e+8>>2],n),i=0|Ue(0|Ge[e+12>>2],n),a=0|Ue(0|Ge[e+16>>2],n);t:do{if(o>>>0>>2>>>0&&(s=r-(o<<2)|0,i>>>0>>0&a>>>0>>0)&&0==(3&(a|i)|0)){for(s=i>>>2,u=a>>>2,c=0,l=o;;){if(_=0|Ue(0|Ge[e+((S=(E=(d=c+(f=l>>>1)|0)<<1)+s|0)<<2)>>2],n),!((m=0|Ue(0|Ge[e+(1+S<<2)>>2],n))>>>0>>0&_>>>0<(r-m|0)>>>0)){h=0;break t}if(0|Xe[e+(m+_)>>0]){h=0;break t}if(!(_=0|function(e,r){r|=0;var t=0,n=0,o=0,i=0,t=0|Xe[(e|=0)>>0],n=0|Xe[r>>0];if(t<<24>>24==0||t<<24>>24!=n<<24>>24)o=n,i=t;else{for(t=r,r=e;t=t+1|0,e=0|Xe[(r=r+1|0)>>0],n=0|Xe[t>>0],e<<24>>24!=0&&e<<24>>24==n<<24>>24;);o=n,i=e}return(255&i)-(255&o)|0}(t,e+m|0)))break;if(m=(0|_)<0,1==(0|l)){h=0;break t}c=m?c:d,l=m?f:l-f|0}c=0|Ue(0|Ge[e+((l=E+u|0)<<2)>>2],n),s=0|Ue(0|Ge[e+(l+1<<2)>>2],n),h=s>>>0>>0&c>>>0<(r-s|0)>>>0&&0==(0|Xe[e+(s+c)>>0])?e+s|0:0}else h=0}while(0);return 0|h}(0|Ge[r>>2],0|Ge[r+4>>2],e):0;return 0|(0|t?t:e)}(e|=0,r|=0)}(s,0|Ge[r+20>>2])}(0|Ge[(H=652)>>2]|0,0|Ge[194])),M=71;break;case 115:Me=0|(H=0|Ge[a>>2])?H:1836,M=71;break;case 67:Ge[u>>2]=Ge[a>>2],Ge[s>>2]=0,be=-1,ye=Ge[a>>2]=u,M=75;break;case 83:H=0|Ge[a>>2],M=q?(be=q,ye=H,75):(xe(e,32,W,0,P),Oe=0,84);break;case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:_=0|function(e,r,t,n,o,i){e|=0,r=+r,t|=0,n|=0,o|=0,i|=0;var a=0,s=0,u=0,c=0,l=0,f=0,d=0,E=0,S=0,_=0,m=0,h=0,p=0,F=0,M=0,b=0,y=0,O=0,w=0,R=0,A=0,k=0,T=0,g=0,v=0,N=0,D=0,P=0,C=0,I=0,L=0,x=0,B=0,H=0,U=0,Y=0,z=0,V=0,K=0,W=0,X=0,j=0,G=0,q=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,te=0,ne=0,oe=0,ie=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,de=0,Ee=0,Se=0,_e=0,me=0,he=0,pe=0,Fe=0,Me=0,be=0,ye=0,Oe=0,we=0;(0|(Ze=(a=Ze)+560|0))>=(0|Je)&&Qe(560);s=a+8|0,l=c=(u=a)+524|0,f=a+512|0,Ge[u>>2]=0,d=12+f|0,He(r),_=(0|ve)<0?(E=-r,S=1,1843):(E=r,S=0!=(2049&o|0)&1,0==(2048&o|0)?0==(1&o|0)?1844:1849:1846);He(E),m=2146435072&ve;do{if(m>>>0<2146435072|2146435072==(0|m)&!1){if(r=2*+function(e,r){return+ +function e(r,t){r=+r;t|=0;var n=0,o=0,i=0,a=0,s=0,u=0,c=0;Te[ge>>3]=r;n=0|Ge[ge>>2];o=0|Ge[ge+4>>2];i=0|Ve(0|n,0|o,52);switch(2047&i){case 0:u=0!=r?(a=+e(0x10000000000000000*r,t),s=a,(0|Ge[t>>2])-64|0):(s=r,0),Ge[t>>2]=u,c=s;break;case 2047:c=r;break;default:Ge[t>>2]=(2047&i)-1022,Ge[ge>>2]=n,Ge[ge+4>>2]=-2146435073&o|1071644672,c=+Te[ge>>3]}return+c}(e=+e,r|=0)}(E,u),(h=0!=r)&&(Ge[u>>2]=(0|Ge[u>>2])-1),97==(0|(p=32|i))){M=0==(0|(F=32&i))?_:_+9|0,b=2|S,y=12-n|0;do{if(!(11>>0|0==(0|y))){for(O=8,w=y;w=w+-1|0,O*=16,0!=(0|w););if(45==(0|Xe[M>>0])){R=-(O+(-r-O));break}R=r+O-O;break}}while(R=r,0);for(y=0|Ge[u>>2],A=0|Ie(w=(0|y)<0?0-y|0:y,((0|w)<0)<<31>>31,d),k=(0|A)==(0|d)?(Xe[(w=11+f|0)>>0]=48,w):A,Xe[k+-1>>0]=43+(y>>31&2),Xe[(y=k+-2|0)>>0]=i+15,A=(0|n)<1,w=0==(8&o|0),T=c,g=R;v=~~g,N=T+1|0,Xe[T>>0]=qe[1878+v>>0]|F,g=16*(g-(0|v)),D=1!=(N-l|0)||w&A&0==g?N:(Xe[N>>0]=46,T+2|0),0!=g;)T=D;xe(e,32,t,F=(A=d-y|0)+b+(w=0!=(0|n)&((T=D-l|0)+-2|0)<(0|n)?n+2|0:T)|0,o),De(e,M,b),xe(e,48,t,F,65536^o),De(e,c,T),xe(e,48,w-T|0,0,0),De(e,y,A),xe(e,32,t,F,8192^o),P=F;break}for(F=(0|n)<0?6:n,I=h?(A=(0|Ge[u>>2])-28|0,Ge[u>>2]=A,C=268435456*r,A):(C=r,0|Ge[u>>2]),A=(0|I)<0?s:288+s|0,T=A,g=C;w=~~g>>>0,Ge[T>>2]=w,T=T+4|0,g=1e9*(g-(w>>>0)),0!=g;);if(0<(0|I))for(h=A,y=T,b=I;;){if(M=(0|b)<29?b:29,h>>>0<=(w=y+-4|0)>>>0){for(N=w,w=0;v=0|Ke(0|Ge[N>>2],0,0|M),L=0|ze(0|v,0|ve,0|w,0),x=0|rr(0|L,0|(v=ve),1e9,0),Ge[N>>2]=x,w=0|We(0|L,0|v,1e9,0),N=N+-4|0,h>>>0<=N>>>0;);B=w?(Ge[(N=h+-4|0)>>2]=w,N):h}else B=h;for(N=y;!(N>>>0<=B>>>0||0|Ge[(v=N+-4|0)>>2]);)N=v;if(w=(0|Ge[u>>2])-M|0,!(0<(0|(Ge[u>>2]=w)))){H=B,U=N,Y=w;break}h=B,y=N,b=w}else H=A,U=T,Y=I;if((0|Y)<0)for(b=1+((F+25|0)/9|0)|0,y=102==(0|p),h=H,w=U,v=Y;;){if(x=(0|(L=0-v|0))<9?L:9,h>>>0>>0){for(L=(1<>>x,V=0,K=h;W=0|Ge[K>>2],Ge[K>>2]=(W>>>x)+V,V=0|Ne(W&L,z),K=K+4|0,K>>>0>>0;);K=0==(0|Ge[h>>2])?h+4|0:h,j=V?(Ge[w>>2]=V,X=K,w+4|0):(X=K,w)}else X=0==(0|Ge[h>>2])?h+4|0:h,j=w;if(z=(0|b)<(j-(K=y?A:X)>>2|0)?K+(b<<2)|0:j,v=(0|Ge[u>>2])+x|0,0<=(0|(Ge[u>>2]=v))){G=X,q=z;break}h=X,w=z}else G=H,q=U;if(w=A,G>>>0>>0)if(h=9*(w-G>>2)|0,(v=0|Ge[G>>2])>>>0<10)Z=h;else for(b=h,h=10;;){if(y=b+1|0,v>>>0<(h=10*h|0)>>>0){Z=y;break}b=y}else Z=0;if((0|(v=F-(102!=(0|p)?Z:0)+(((h=0!=(0|F))&(b=103==(0|p)))<<31>>31)|0))<((9*(q-w>>2)|0)-9|0)){if(v=A+4+(((0|(y=v+9216|0))/9|0)-1024<<2)|0,(0|(T=1+((0|y)%9|0)|0))<9)for(y=T,T=10;;){if(z=10*T|0,9==(0|(y=y+1|0))){J=z;break}T=z}else J=10;if(T=0|Ge[v>>2],(p=(v+4|0)==(0|q))&0==(0|(y=(T>>>0)%(J>>>0)|0)))ne=v,oe=Z,ie=G;else if(O=0==(1&((T>>>0)/(J>>>0)|0)|0)?9007199254740992:9007199254740994,g=y>>>0<(z=(0|J)/2|0)>>>0?.5:p&(0|y)==(0|z)?1:1.5,$=S?(z=45==(0|Xe[_>>0]),Q=z?-g:g,z?-O:O):(Q=g,O),z=T-y|0,Ge[v>>2]=z,$+Q!=$){if(y=z+J|0,999999999<(Ge[v>>2]=y)>>>0)for(y=G,z=v;;){if(T=z+-4|0,Ge[z>>2]=0,ee=T>>>0>>0?(Ge[(p=y+-4|0)>>2]=0,p):y,p=1+(0|Ge[T>>2])|0,!(999999999<(Ge[T>>2]=p)>>>0)){re=ee,te=T;break}y=ee,z=T}else re=G,te=v;if(z=9*(w-re>>2)|0,(y=0|Ge[re>>2])>>>0<10)ne=te,oe=z,ie=re;else for(T=z,z=10;;){if(p=T+1|0,y>>>0<(z=10*z|0)>>>0){ne=te,oe=p,ie=re;break}T=p}}else ne=v,oe=Z,ie=G;ae=oe,se=(T=ne+4|0)>>>0>>0?T:q,ue=ie}else ae=Z,se=q,ue=G;for(T=se;;){if(T>>>0<=ue>>>0){ce=0;break}if(0|Ge[(z=T+-4|0)>>2]){ce=1;break}T=z}v=0-ae|0;do{if(b){if(fe=(0|ae)<(0|(z=(1&(1^h))+F|0))&-5<(0|ae)?(le=i+-1|0,z+-1-ae|0):(le=i+-2|0,z+-1|0),!(z=8&o)){if(ce&&0!=(0|(y=0|Ge[T+-4>>2])))if((y>>>0)%10|0)de=0;else for(p=0,K=10;;){if(L=p+1|0,(y>>>0)%((K=10*K|0)>>>0)|0){de=L;break}p=L}else de=9;if(p=(9*(T-w>>2)|0)-9|0,102==(32|le)){Ee=le,Se=(0|fe)<(0|(y=0<(0|(K=p-de|0))?K:0))?fe:y,_e=0;break}Ee=le,Se=(0|fe)<(0|(p=0<(0|(y=p+ae-de|0))?y:0))?fe:p,_e=0;break}Ee=le,Se=fe,_e=z}else Ee=i,Se=F,_e=8&o}while(0);if(w=0!=(0|(F=Se|_e))&1,h=102==(32|Ee))he=(me=0)<(0|ae)?ae:0;else{if(p=0|Ie(b=(0|ae)<0?v:ae,((0|b)<0)<<31>>31,d),((b=d)-p|0)<2)for(y=p;;){if(Xe[(K=y+-1|0)>>0]=48,!((b-K|0)<2)){pe=K;break}y=K}else pe=p;Xe[pe+-1>>0]=43+(ae>>31&2),Xe[(y=pe+-2|0)>>0]=Ee,he=b-(me=y)|0}if(xe(e,32,t,y=S+1+Se+w+he|0,o),De(e,_,S),xe(e,48,t,y,65536^o),h){x=K=9+c|0,V=8+c|0,L=v=A>>>0>>0?A:ue;do{if(N=0|Ie(0|Ge[L>>2],0,K),(0|L)==(0|v))Fe=(0|N)==(0|K)?(Xe[V>>0]=48,V):N;else if(c>>>0>>0)for(er(0|c,48,N-l|0),M=N;;){if(!(c>>>0<(W=M+-1|0)>>>0)){Fe=W;break}M=W}else Fe=N}while(De(e,Fe,x-Fe|0),(L=L+4|0)>>>0<=A>>>0);if(0|F&&De(e,1894,1),L>>>0>>0&0<(0|Se))for(A=Se,x=L;;){if(V=0|Ie(0|Ge[x>>2],0,K),c>>>0>>0)for(er(0|c,48,V-l|0),v=V;;){if(!(c>>>0<(h=v+-1|0)>>>0)){Me=h;break}v=h}else Me=V;if(De(e,Me,(0|A)<9?A:9),v=A+-9|0,!((x=x+4|0)>>>0>>0&9<(0|A))){be=v;break}A=v}else be=Se;xe(e,48,be+9|0,9,0)}else{if(A=ce?T:ue+4|0,-1<(0|Se))for(K=0==(0|_e),L=x=9+c|0,F=0-l|0,v=8+c|0,N=Se,h=ue;;){w=0|Ie(0|Ge[h>>2],0,x),ye=(0|w)==(0|x)?(Xe[v>>0]=48,v):w;do{if((0|h)==(0|ue)){if(w=ye+1|0,De(e,ye,1),K&(0|N)<1){Oe=w;break}De(e,1894,1),Oe=w}else{if(ye>>>0<=c>>>0){Oe=ye;break}for(er(0|c,48,ye+F|0),w=ye;;){if(!(c>>>0<(b=w+-1|0)>>>0)){Oe=b;break}w=b}}}while(0);if(De(e,Oe,(0|(V=L-Oe|0))<(0|N)?V:N),!((h=h+4|0)>>>0>>0&-1<(0|(w=N-V|0)))){we=w;break}N=w}else we=Se;xe(e,48,we+18|0,18,0),De(e,me,d-me|0)}xe(e,32,t,y,8192^o),P=y}else N=0!=(32&i|0),xe(e,32,t,A=S+3|0,-65537&o),De(e,_,S),De(e,E!=E|!1?N?1870:1874:N?1862:1866,3),xe(e,32,t,A,8192^o),P=A}while(0);return Ze=a,0|((0|P)<(0|t)?t:P)}(e,+Te[a>>3],W,q,P,r),m=F,h=j,p=J;continue e;default:Se=p,_e=0,me=1826,he=f,pe=q,Fe=P}}while(0);r:do{if(61==(0|M))ne=r=(M=0)|function(e,r,t,n){t|=0,n|=0;var o=0,i=0;if(0==(0|(e|=0))&0==(0|(r|=0)))o=t;else for(i=t,t=r,r=e;;){if(Xe[(e=i+-1|0)>>0]=0|qe[1878+(15&r)>>0]|n,0==(0|(r=0|Ve(0|r,0|t,4)))&0==(0|(t=ve))){o=e;break}i=e}return 0|o}(k=0|Ge[(r=a)>>2],C=0|Ge[r+4>>2],f,32&ee),oe=(H=0==(8&te|0)|0==(0|k)&0==(0|C))?0:2,ie=H?1826:1826+(ee>>4)|0,ae=re,se=te,ue=k,ce=C,M=67;else if(66==(0|M))ne=(M=0)|Ie(de,Ee,f),oe=le,ie=fe,ae=q,se=P,ue=de,ce=Ee,M=67;else if(71==(0|M))me=1826,he=(k=(_e=M=0)==(0|(C=0|Le(Se=Me,0,q))))?Me+q|0:C,pe=k?q:C-Me|0,Fe=T;else if(75==(0|M)){for(C=ye,H=k=M=0;;){if(!(r=0|Ge[C>>2])){we=k,Re=H;break}if((0|(I=0|Be(c,r)))<0|(be-k|0)>>>0>>0){we=k,Re=I;break}if(!((r=I+k|0)>>>0>>0)){we=r,Re=I;break}C=C+4|0,k=r,H=I}if((0|Re)<0){K=-1;break e}if(xe(e,32,W,we,P),we)for(H=ye,k=0;;){if(!(C=0|Ge[H>>2])){Oe=we,M=84;break r}if((0|we)<(0|(k=(I=0|Be(c,C))+k|0))){Oe=we,M=84;break r}if(De(e,c,I),we>>>0<=k>>>0){Oe=we,M=84;break}H=H+4|0}else Oe=0,M=84}}while(0);if(67==(0|M))k=d-ne+(1&(1^(T=(M=0)!=(0|ue)|0!=(0|ce))))|0,Se=(H=0!=(0|ae)|T)?ne:f,_e=oe,me=ie,he=f,pe=!H||(0|k)<(0|ae)?ae:k,Fe=-1<(0|ae)?-65537&se:se;else if(84==(0|M)){M=0,xe(e,32,W,Oe,8192^P),_=(0|Oe)<(0|W)?W:Oe,m=F,h=j,p=J;continue}xe(e,32,I=(0|W)<(0|(T=(H=(0|pe)<(0|(k=he-Se|0))?k:pe)+_e|0))?T:W,T,Fe),De(e,me,_e),xe(e,48,I,T,65536^Fe),xe(e,48,H,k,0),De(e,Se,k),xe(e,32,I,T,8192^Fe),_=I,m=F,h=j,p=J}else _=0,m=F,h=j,p=J}}e:do{if(87==(0|M))if(e)K=F;else if(h){for(J=1;;){if(!(p=0|Ge[o+(J<<2)>>2])){Ae=J;break}if(Ce(n+(J<<3)|0,p,t),10<=(0|(J=J+1|0))){K=1;break e}}for(;;){if(0|Ge[o+(Ae<<2)>>2]){K=-1;break e}if(10<=(0|(Ae=Ae+1|0))){K=1;break}}}else K=0}while(0);return Ze=ke,0|K}function V(){return 0}function K(){0}function De(e,r,t){r|=0,t|=0,32&Ge[(e|=0)>>2]||W(r,t,e)}function Pe(e){var r=0,t=0,n=0,o=0,i=0,r=0|Ge[(e|=0)>>2];if((t=(0|Xe[r>>0])-48|0)>>>0<10)for(n=0,o=r,r=t;;){if(t=r+(10*n|0)|0,o=o+1|0,Ge[e>>2]=o,10<=(r=(0|Xe[o>>0])-48|0)>>>0){i=t;break}n=t}else i=0;return 0|i}function Ce(e,r,t){e|=0,r|=0,t|=0;var n,o=0,i=0,a=0,s=0;e:do{if(r>>>0<=20){switch(0|r){case 9:o=3+(0|Ge[t>>2])&-4,i=0|Ge[o>>2],Ge[t>>2]=o+4,Ge[e>>2]=i;break e;case 10:i=3+(0|Ge[t>>2])&-4,o=0|Ge[i>>2],Ge[t>>2]=i+4,Ge[(i=e)>>2]=o,Ge[i+4>>2]=((0|o)<0)<<31>>31;break e;case 11:o=3+(0|Ge[t>>2])&-4,i=0|Ge[o>>2],Ge[t>>2]=o+4,Ge[(o=e)>>2]=i,Ge[o+4>>2]=0;break e;case 12:o=7+(0|Ge[t>>2])&-8,n=0|Ge[(i=o)>>2],a=0|Ge[i+4>>2],Ge[t>>2]=o+8,Ge[(o=e)>>2]=n,Ge[o+4>>2]=a;break e;case 13:a=3+(0|Ge[t>>2])&-4,o=0|Ge[a>>2],Ge[t>>2]=a+4,a=(65535&o)<<16>>16,Ge[(o=e)>>2]=a,Ge[o+4>>2]=((0|a)<0)<<31>>31;break e;case 14:a=3+(0|Ge[t>>2])&-4,o=0|Ge[a>>2],Ge[t>>2]=a+4,Ge[(a=e)>>2]=65535&o,Ge[a+4>>2]=0;break e;case 15:a=3+(0|Ge[t>>2])&-4,o=0|Ge[a>>2],Ge[t>>2]=a+4,a=(255&o)<<24>>24,Ge[(o=e)>>2]=a,Ge[o+4>>2]=((0|a)<0)<<31>>31;break e;case 16:a=3+(0|Ge[t>>2])&-4,o=0|Ge[a>>2],Ge[t>>2]=a+4,Ge[(a=e)>>2]=255&o,Ge[a+4>>2]=0;break e;case 17:case 18:a=7+(0|Ge[t>>2])&-8,s=+Te[a>>3],Ge[t>>2]=a+8,Te[e>>3]=s;break e;default:break e}}}while(0)}function Ie(e,r,t){t|=0;var n=0,o=0,i=0,a=0,s=0,u=0;if(0<(r|=0)>>>0|0==(0|r)&4294967295<(e|=0)>>>0){for(n=t,o=e,i=r;r=0|rr(0|o,0|i,10,0),Xe[(n=n+-1|0)>>0]=255&r|48,o=0|We(0|(r=o),0|i,10,0),9>>0|9==(0|i)&4294967295>>0;)i=ve;a=o,s=n}else a=e,s=t;if(a)for(t=a,a=s;;){if(Xe[(s=a+-1|0)>>0]=(t>>>0)%10|48,t>>>0<10){u=s;break}t=(t>>>0)/10|0,a=s}else u=s;return 0|u}function Le(e,r,t){e|=0;var n,o,i,a,s=0,u=0,c=0,l=0,f=0,d=0,E=0,S=0,_=0,m=0,h=0,p=0,F=0,M=0,b=0,y=255&(r|=0),s=0!=(0|(t|=0));e:do{if(s&0!=(3&e|0))for(n=255&r,u=e,c=t;;){if((0|Xe[u>>0])==n<<24>>24){l=u,f=c,d=6;break e}if(!((a=0!=(0|(i=c+-1|0)))&0!=(3&(o=u+1|0)|0))){E=o,S=i,_=a,d=5;break}u=o,c=i}else E=e,S=t,_=s,d=5}while(0);5==(0|d)&&(_?(l=E,f=S,d=6):(m=E,h=0));e:do{if(6==(0|d))if(E=255&r,(0|Xe[l>>0])==E<<24>>24)m=l,h=f;else{S=0|Ne(y,16843009);r:do{if(3>>0){for(_=l,s=f;!((-2139062144&(t=Ge[_>>2]^S)^-2139062144)&t+-16843009|0);){if(t=_+4|0,!(3<(e=s+-4|0)>>>0)){p=t,F=e,d=11;break r}_=t,s=e}M=_,b=s}else p=l,F=f,d=11}while(0);if(11==(0|d)){if(!F){m=p,h=0;break}M=p,b=F}for(;;){if((0|Xe[M>>0])==E<<24>>24){m=M,h=b;break e}if(S=M+1|0,!(b=b+-1|0)){m=S,h=0;break}M=S}}}while(0);return 0|(0|h?m:0)}function xe(e,r,t,n,o){e|=0,r|=0,t|=0,n|=0,o|=0;var i,a=0,s=Ze;if((0|Je)<=(0|(Ze=Ze+256|0))&&Qe(256),i=s,(0|n)<(0|t)&0==(73728&o|0)){if(er(0|i,0|r,0|((o=t-n|0)>>>0<256?o:256)),255>>0){for(r=t-n|0,n=o;De(e,i,256),n=n+-256|0,255>>0;);a=255&r}else a=o;De(e,i,a)}Ze=s}function Be(e,r){r|=0;return 0|((e|=0)?0|function(e,r){e|=0,r|=0,0;var t=0;do{if(e){if(r>>>0<128){Xe[e>>0]=r,t=1;break}if(!(0|Ge[Ge[776>>2]>>2])){if(57216==(-128&r|0)){Xe[e>>0]=r,t=1;break}Ge[652>>2]=84,t=-1;break}if(r>>>0<2048){Xe[e>>0]=r>>>6|192,Xe[e+1>>0]=63&r|128,t=2;break}if(r>>>0<55296|57344==(-8192&r|0)){Xe[e>>0]=r>>>12|224,Xe[e+1>>0]=r>>>6&63|128,Xe[e+2>>0]=63&r|128,t=3;break}if((r+-65536|0)>>>0<1048576){Xe[e>>0]=r>>>18|240,Xe[e+1>>0]=r>>>12&63|128,Xe[e+2>>0]=r>>>6&63|128,Xe[e+3>>0]=63&r|128,t=4;break}Ge[652>>2]=84,t=-1;break}}while(t=1,0);return 0|t}(e,r):0)}function He(e){e=+e;var r;return Te[ge>>3]=e,r=0|Ge[ge>>2],ve=0|Ge[ge+4>>2],0|r}function Ue(e,r){var t=0|ce(0|(e|=0));return 0|(0==(0|(r|=0))?e:t)}function W(e,r,t){e|=0,r|=0;var n,o=0,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,E=0;(i=0|Ge[(o=(t|=0)+16|0)>>2])?(a=i,s=5):0|X(t)?u=0:(a=0|Ge[o>>2],s=5);e:do{if(5==(0|s)){if((a-(n=o=0|Ge[(i=t+20|0)>>2])|0)>>>0>>0){u=0|de[7&Ge[t+36>>2]](t,e,r);break}r:do{if(-1<(0|Xe[t+75>>0])){for(o=r;;){if(!o){c=0,l=e,f=r,d=n;break r}if(10==(0|Xe[e+(E=o+-1|0)>>0]))break;o=E}if((E=0|de[7&Ge[t+36>>2]](t,e,o))>>>0>>0){u=E;break e}l=e+(c=o)|0,f=r-o|0,d=0|Ge[i>>2]}else c=0,l=e,f=r,d=n}while(0);tr(0|d,0|l,0|f),Ge[i>>2]=(0|Ge[i>>2])+f,u=c+f|0}}while(0);return 0|u}function X(e){var r=0,t=0|Xe[(r=(e|=0)+74|0)>>0];return Xe[r>>0]=255+t|t,0|(8&(t=0|Ge[e>>2])?(Ge[e>>2]=32|t,-1):(Ge[e+8>>2]=0,r=(Ge[e+4>>2]=0)|Ge[e+44>>2],Ge[e+28>>2]=r,Ge[e+20>>2]=r,Ge[e+16>>2]=r+(0|Ge[e+48>>2]),0))}function j(e){var r,t=0,n=0,o=0,i=0,a=0,s=0,u=0,c=0,t=e|=0;e:do{if(3&t)for(i=e,a=t;;){if(!(0|Xe[i>>0])){s=a;break e}if(!(3&(a=r=i+1|0))){n=r,o=4;break}i=r}else n=e,o=4}while(0);if(4==(0|o)){for(o=n;!((-2139062144&(u=0|Ge[o>>2])^-2139062144)&u+-16843009);)o=o+4|0;if((255&u)<<24>>24)for(u=o;;){if(!(0|Xe[(o=u+1|0)>>0])){c=o;break}u=o}else c=o;s=c}return s-t|0}function G(e,r){var t=0|function(e,r){e|=0;var t=0,n=0,o=0,i=0,a=0,s=0,u=0,c=0,l=0;t=255&(r|=0);e:do{if(t){if(3&e)for(i=255&r,a=e;;){if((s=0|Xe[a>>0])<<24>>24==0||s<<24>>24==i<<24>>24){n=a;break e}if(!(3&(s=a+1|0))){o=s;break}a=s}else o=e;a=0|Ne(t,16843009),i=0|Ge[o>>2];r:do{if((-2139062144&i^-2139062144)&i+-16843009)l=o;else for(s=o,u=i;;){if((-2139062144&(c=u^a)^-2139062144)&c-16843009|0){l=s;break r}if((-2139062144&(u=0|Ge[(c=s+4|0)>>2])^-2139062144)&u+-16843009|0){l=c;break}s=c}}while(0);for(a=255&r,i=l;;){if((s=0|Xe[i>>0])<<24>>24==0||s<<24>>24==a<<24>>24){n=i;break}i=i+1|0}}else n=e+(0|j(e))|0}while(0);return 0|n}(e|=0,r|=0);return 0|((0|Xe[t>>0])==(255&r)<<24>>24?t:0)}function q(e,r){r|=0;var t=0;return((0|function(e,r,t,n){e|=0,n|=0;var o=0,i=0,a=0,s=0,u=0;o=0|Ne(t|=0,r|=0),i=0==(0|r)?0:t,s=-1<(0|Ge[n+76>>2])?(t=!0,a=0|W(e,o,n),t||K(),a):0|W(e,o,n);u=(0|s)==(0|o)?i:(s>>>0)/(r>>>0)|0;return 0|u}(e|=0,1,t=0|j(e),r))!=(0|t))<<31>>31|0}function Z(e){var r,t;0|Ge[(e|=0)+68>>2]&&(t=e+112|0,0|(r=0|Ge[e+116>>2])&&(Ge[112+r>>2]=Ge[t>>2]),e=0|Ge[t>>2],Ge[(e?e+116|0:820)>>2]=r)}function J(e,r){e|=0,r|=0;var t,n,o=0,i=0,a=0,s=0,u=0,c=0,l=Ze;(0|Je)<=(0|(Ze=Ze+16|0))&&Qe(16),n=255&r,Xe[(t=l)>>0]=n,(i=0|Ge[(o=e+16|0)>>2])?(a=i,s=4):0|X(e)?u=-1:(a=0|Ge[o>>2],s=4);do{if(4==(0|s)){if((o=0|Ge[(i=e+20|0)>>2])>>>0>>0&&(0|(c=255&r))!=(0|Xe[e+75>>0])){Ge[i>>2]=o+1,Xe[o>>0]=n,u=c;break}u=1==(0|de[7&Ge[e+36>>2]](e,t,1))?0|qe[t>>0]:-1}}while(0);return Ze=l,0|u}function Q(){return b(4352),4360}function $(){g(4352)}function ee(e){var r,t,n,o=0,i=0,a=0,o=(Ge[(e|=0)+76>>2],0);return Z(e),(r=0!=(1&Ge[e>>2]|0))||(i=0|Q(),n=e+56|0,0|(t=0|Ge[e+52>>2])&&(Ge[56+t>>2]=Ge[n>>2]),0|(a=0|Ge[n>>2])&&(Ge[a+52>>2]=t),(0|Ge[i>>2])==(0|e)&&(Ge[i>>2]=a),$()),a=0|re(e),i=0|fe[1&Ge[e+12>>2]](e)|a,0|(a=0|Ge[e+92>>2])&&B(a),r?0|o&&K():B(e),0|i}function re(e){e|=0;var r=0,t=0,n=0,o=0,i=0,a=0,s=0;do{if(e){if((0|Ge[e+76>>2])<=-1){r=0|te(e);break}r=((t=!0)||K(),n=0|te(e))}else{if(o=0|Ge[240]?0|re(0|Ge[240]):0,n=0|Q(),t=0|Ge[n>>2])for(n=t,t=o;;){if(a=(Ge[n+76>>2],0),s=(0|Ge[n+20>>2])>>>0>(0|Ge[n+28>>2])>>>0?0|te(n)|t:t,0|a&&K(),!(n=0|Ge[n+56>>2])){i=s;break}t=s}else i=o;$(),r=i}}while(0);return 0|r}function te(e){var r,t,n,o,i=0,a=(e|=0)+28|0;return 0|((0|Ge[(i=e+20|0)>>2])>>>0>(0|Ge[a>>2])>>>0&&(de[7&Ge[e+36>>2]](e,0,0),0==(0|Ge[i>>2]))?-1:((t=0|Ge[(r=e+4|0)>>2])>>>0<(o=0|Ge[(n=e+8|0)>>2])>>>0&&de[7&Ge[e+40>>2]](e,t-o|0,1),Ge[e+16>>2]=0,Ge[a>>2]=0,Ge[i>>2]=0,Ge[n>>2]=0,Ge[r>>2]=0))}function ne(e,r,t){e|=0,r|=0;var n=0,n=1==(0|(t|=0))?r-(0|Ge[e+8>>2])+(0|Ge[e+4>>2])|0:r,o=e+28|0;return 0|((0|Ge[(r=e+20|0)>>2])>>>0>(0|Ge[o>>2])>>>0&&(de[7&Ge[e+36>>2]](e,0,0),0==(0|Ge[r>>2]))?-1:(Ge[e+16>>2]=0,Ge[o>>2]=0,((Ge[r>>2]=0)|de[7&Ge[e+40>>2]](e,n,t))<0?-1:(Ge[e+8>>2]=0,Ge[e+4>>2]=0,Ge[e>>2]=-17&Ge[e>>2],0)))}function oe(e){var r=0,t=0,r=128&Ge[(e|=0)>>2]&&(0|Ge[e+20>>2])>>>0>(0|Ge[e+28>>2])>>>0?2:1;return 0|((0|(t=0|de[7&Ge[e+40>>2]](e,0,r)))<0?t:t-(0|Ge[e+8>>2])+(0|Ge[e+4>>2])+(0|Ge[e+20>>2])-(0|Ge[e+28>>2])|0)}function ie(e,r){e|=0,r|=0;var t,n=Ze;return(0|Je)<=(0|(Ze=Ze+16|0))&&Qe(16),Ge[(t=n)>>2]=r,r=0|function(e,r,t){e|=0,r|=0,t|=0;var n,o,i,a,s,u,c,l=0,f=0,d=0,E=0,S=0,_=0,m=Ze;for(Ze=Ze+224|0,(0|Je)<=(0|Ze)&&Qe(224),n=m+120|0,l=m+80|0,c=m,o=m+136|0,f=l,d=f+40|0;f=f+4|(Ge[f>>2]=0),(0|f)<(0|d););return Ge[n>>2]=Ge[t>>2],E=(0|z(0,r,n,c,l))<0?-1:(S=-1<(0|Ge[e+76>>2])?0|V():0,f=32&(t=0|Ge[e>>2]),(0|Xe[e+74>>0])<1&&(Ge[e>>2]=-33&t),_=0|Ge[(t=e+48|0)>>2]?0|z(e,r,n,c,l):(i=0|Ge[(d=e+44|0)>>2],Ge[d>>2]=o,Ge[(a=e+28|0)>>2]=o,Ge[(s=e+20|0)>>2]=o,Ge[t>>2]=80,Ge[(u=e+16|0)>>2]=80+o,o=0|z(e,r,n,c,l),i?(de[7&Ge[e+36>>2]](e,0,0),c=0==(0|Ge[s>>2])?-1:o,Ge[d>>2]=i,Ge[t>>2]=0,Ge[u>>2]=0,Ge[a>>2]=0,Ge[s>>2]=0,c):o),l=0|Ge[e>>2],Ge[e>>2]=l|f,0|S&&K(),0==(32&l|0)?_:-1),Ze=m,0|E}(0|Ge[208],e,t),Ze=n,0|r}function ae(e){e|=0;var r=0,t=0,n=0,o=0,i=0|Ge[208],r=(Ge[76+i>>2],0);do{if((0|q(e,i))<0)t=1;else{if(10!=(0|Xe[75+i>>0])&&(o=0|Ge[(n=20+i|0)>>2])>>>0<(0|Ge[16+i>>2])>>>0){Ge[n>>2]=o+1,Xe[o>>0]=10,t=0;break}t=(0|J(i,10))<0}}while(0);return 0|r&&K(),t<<31>>31|0}function Ye(e,r,t,n){r|=0,n|=0;return 0|(ve=r-n-((e|=0)>>>0<(t|=0)>>>0|0)>>>0,e-t>>>0|0)}function ze(e,r,t,n){var o=0;return 0|(ve=(r|=0)+(n|=0)+((o=(e|=0)+(t|=0)>>>0)>>>0>>0|0)>>>0,0|o)}function er(e,r,t){r|=0;var n,o,i,a=(e|=0)+(t|=0)|0;if(r&=255,67<=(0|t)){for(;3&e;)Xe[e>>0]=r,e=e+1|0;for(o=(n=-4&a|0)-64|0,i=r|r<<8|r<<16|r<<24;(0|e)<=(0|o);)Ge[e>>2]=i,Ge[e+4>>2]=i,Ge[e+8>>2]=i,Ge[e+12>>2]=i,Ge[e+16>>2]=i,Ge[e+20>>2]=i,Ge[e+24>>2]=i,Ge[e+28>>2]=i,Ge[e+32>>2]=i,Ge[e+36>>2]=i,Ge[e+40>>2]=i,Ge[e+44>>2]=i,Ge[e+48>>2]=i,Ge[e+52>>2]=i,Ge[e+56>>2]=i,Ge[e+60>>2]=i,e=e+64|0;for(;(0|e)<(0|n);)Ge[e>>2]=i,e=e+4|0}for(;(0|e)<(0|a);)Xe[e>>0]=r,e=e+1|0;return a-t|0}function Ve(e,r,t){return e|=0,r|=0,(0|(t|=0))<32?(ve=r>>>t,e>>>t|(r&(1<>>t-32|(ve=0)}function Ke(e,r,t){return e|=0,r|=0,(0|(t|=0))<32?(ve=r<>>32-t,e<>0]))<8?0|r:(0|(r=0|Xe[E+(e>>8&255)>>0]))<8?r+8|0:(0|(r=0|Xe[E+(e>>16&255)>>0]))<8?r+16|0:24+(0|Xe[E+(e>>>24)>>0])|0}function ue(e,r,t,n,o){o|=0;var i,a,s,u=0,c=0,l=0,f=0,d=0,E=0,S=0,_=0,m=0,h=0,p=0,F=0,M=0,b=0,y=0,O=0,w=0,R=0,A=0,k=0,T=0,g=0,v=0,N=0,u=e|=0,f=t|=0,E=d=n|=0;if(!(l=c=r|=0))return S=0!=(0|o),E?(S&&(Ge[o>>2]=0|e,Ge[o+4>>2]=0&r),(m=_=0)|(ve=_,m)):(S&&(Ge[o>>2]=(u>>>0)%(f>>>0),Ge[o+4>>2]=0),(_=0)|(ve=_,m=(u>>>0)/(f>>>0)>>>0));S=0==(0|E);do{if(f){if(!S){if((h=(0|D(0|E))-(0|D(0|l))|0)>>>0<=31){y=u>>>((b=p=h+1|0)>>>0)&(M=h-31>>31)|l<<(F=31-h|0),O=l>>>(p>>>0)&M,w=0,R=u<>2]=0|e,Ge[o+4>>2]=c|0&r,(m=_=0)|(ve=_,m)):(m=_=0)|(ve=_,m)}if((F=f-1|0)&f|0){y=(h=32-(M=33+(0|D(0|f))-(0|D(0|l))|0)|0)-1>>31&l>>>((a=M-32|0)>>>0)|(l<>>((b=M)>>>0))&(s=a>>31),O=s&l>>>(M>>>0),w=u<<(p=64-M|0)&(i=h>>31),R=(l<>>(a>>>0))&i|u<>31;break}return 0|o&&(Ge[o>>2]=F&u,Ge[o+4>>2]=0),1==(0|f)?0|(ve=_=c|0&r,m=0|e):(F=0|se(0|f),0|(ve=_=l>>>(F>>>0)|0,m=l<<32-F|u>>>(F>>>0)|0))}if(S)return 0|o&&(Ge[o>>2]=(l>>>0)%(f>>>0),Ge[o+4>>2]=0),(_=0)|(ve=_,m=(l>>>0)/(f>>>0)>>>0);if(!u)return 0|o&&(Ge[o>>2]=0,Ge[o+4>>2]=(l>>>0)%(E>>>0)),(_=0)|(ve=_,m=(l>>>0)/(E>>>0)>>>0);if(!((F=E-1|0)&E))return 0|o&&(Ge[o>>2]=0|e,Ge[o+4>>2]=F&l|0&r),m=l>>>(((_=0)|se(0|E))>>>0),0|(ve=_,m);if((F=(0|D(0|E))-(0|D(0|l))|0)>>>0<=30){y=l<<(h=31-F|0)|u>>>((b=M=F+1|0)>>>0),O=l>>>(M>>>0),w=0,R=u<>2]=0|e,Ge[o+4>>2]=c|0&r),(m=_=0)|(ve=_,m)}while(0);if(b){for(r=0|t,t=d|0&n,n=0|ze(0|r,0|t,-1,-1),d=ve,c=R,R=w,w=O,O=y,y=b,b=0;c=R>>>31|(e=c)<<1,R=b|R<<1,Ye(0|n,0|d,0|(u=O<<1|e>>>31|0),0|(e=O>>>31|w<<1|0)),b=1&(E=(l=ve)>>31|((0|l)<0?-1:0)<<1),O=0|Ye(0|u,0|e,E&r|0,(((0|l)<0?-1:0)>>31|((0|l)<0?-1:0)<<1)&t|0),w=ve,y=y-1|0,0!=(0|y););A=c,k=R,T=w,g=O,v=0,N=b}else A=R,k=w,T=O,g=y,N=v=0;return b=k,(k=0)|o&&(Ge[o>>2]=g,Ge[o+4>>2]=T),0|(ve=_=(0|b)>>>31|(A|k)<<1|0&(k<<1|b>>>31)|v,m=-2&(b<<1|0)|N)}function We(e,r,t,n){return 0|ue(e|=0,r|=0,t|=0,n|=0,0)}function Oe(e){var r,t;return 0<(0|(e=(e|=0)+15&-16|0))&(0|(t=(r=0|Ge[d>>2])+e|0))<(0|r)|(0|t)<0?(h(),O(12),-1):(0|(Ge[d>>2]=t))>(0|m())&&0==(0|_())?(Ge[d>>2]=r,O(12),-1):0|r}function rr(e,r,t,n){var o,i=Ze;return Ze=Ze+16|0,ue(e|=0,r|=0,t|=0,n|=0,o=0|i),Ze=i,0|(ve=0|Ge[4+o>>2],0|Ge[o>>2])}function tr(e,r,t){e|=0,r|=0;var n,o,i=0;if(8192<=(0|(t|=0)))return 0|k(0|e,0|r,0|t);if(n=0|e,o=e+t|0,(3&e)==(3&r)){for(;3&e;){if(!t)return 0|n;Xe[e>>0]=0|Xe[r>>0],e=e+1|0,r=r+1|0,t=t-1|0}for(t=(i=-4&o|0)-64|0;(0|e)<=(0|t);)Ge[e>>2]=Ge[r>>2],Ge[e+4>>2]=Ge[r+4>>2],Ge[e+8>>2]=Ge[r+8>>2],Ge[e+12>>2]=Ge[r+12>>2],Ge[e+16>>2]=Ge[r+16>>2],Ge[e+20>>2]=Ge[r+20>>2],Ge[e+24>>2]=Ge[r+24>>2],Ge[e+28>>2]=Ge[r+28>>2],Ge[e+32>>2]=Ge[r+32>>2],Ge[e+36>>2]=Ge[r+36>>2],Ge[e+40>>2]=Ge[r+40>>2],Ge[e+44>>2]=Ge[r+44>>2],Ge[e+48>>2]=Ge[r+48>>2],Ge[e+52>>2]=Ge[r+52>>2],Ge[e+56>>2]=Ge[r+56>>2],Ge[e+60>>2]=Ge[r+60>>2],e=e+64|0,r=r+64|0;for(;(0|e)<(0|i);)Ge[e>>2]=Ge[r>>2],e=e+4|0,r=r+4|0}else for(i=o-4|0;(0|e)<(0|i);)Xe[e>>0]=0|Xe[r>>0],Xe[e+1>>0]=0|Xe[r+1>>0],Xe[e+2>>0]=0|Xe[r+2>>0],Xe[e+3>>0]=0|Xe[r+3>>0],e=e+4|0,r=r+4|0;for(;(0|e)<(0|o);)Xe[e>>0]=0|Xe[r>>0],e=e+1|0,r=r+1|0;return 0|n}function ce(e){return(255&(e|=0))<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>>24|0}function le(e,r,t){return F(1),0}var fe=[function(e){return p(0),0},function(e){e|=0;var r,t=Ze;return(0|Je)<=(0|(Ze=Ze+16|0))&&Qe(16),r=t,e=0|(e=0|Ge[e+60>>2],0|(e|=0)),Ge[r>>2]=e,e=0|U(0|y(6,0|r)),Ze=t,0|e}],de=[le,function(e,r,t){e|=0,r|=0,t|=0;var n=0,o=Ze;return(0|Je)<=(0|(Ze=Ze+32|0))&&Qe(32),n=o,Ge[e+36>>2]=3,0==(64&Ge[e>>2]|0)&&(Ge[n>>2]=Ge[e+60>>2],Ge[n+4>>2]=21523,Ge[n+8>>2]=o+16,0|T(54,0|n))&&(Xe[e+75>>0]=-1),n=0|H(e,r,t),Ze=o,0|n},function(e,r,t){e|=0,r|=0,t|=0;var n,o,i=0,a=Ze;return(0|Je)<=(0|(Ze=Ze+32|0))&&Qe(32),o=(n=a)+20|0,Ge[n>>2]=Ge[e+60>>2],Ge[n+4>>2]=0,Ge[n+8>>2]=r,Ge[n+12>>2]=o,Ge[n+16>>2]=t,i=(0|U(0|w(140,0|n)))<0?Ge[o>>2]=-1:0|Ge[o>>2],Ze=a,0|i},H,function(e,r,t){e|=0,r|=0,t|=0;var n,o,i,a,s,u=0,c=0,l=Ze;return(0|Je)<=(0|(Ze=Ze+32|0))&&Qe(32),Ge[(o=(n=l)+16|0)>>2]=r,u=4+o|0,a=0|Ge[(i=e+48|0)>>2],Ge[u>>2]=t-(0!=(0|a)&1),s=e+44|0,Ge[8+o>>2]=Ge[s>>2],Ge[12+o>>2]=a,Ge[n>>2]=Ge[e+60>>2],Ge[n+4>>2]=o,Ge[n+8>>2]=2,c=1<=(0|(o=0|U(0|v(145,0|n))))?(n=0|Ge[u>>2])>>>0>>0?(u=0|Ge[s>>2],Ge[(s=e+4|0)>>2]=u,Ge[e+8>>2]=u+(o-n),0|Ge[i>>2]&&(Ge[s>>2]=u+1,Xe[r+(t+-1)>>0]=0|Xe[u>>0]),t):o:(Ge[e>>2]=Ge[e>>2]|48&o^16,o),Ze=l,0|c},le,le,le];return{_llvm_bswap_i32:ce,_i64Subtract:Ye,___udivdi3:We,setThrew:function(e,r){e|=0,r|=0,S||(S=e,0)},_bitshift64Lshr:Ve,_bitshift64Shl:Ke,_fflush:re,___errno_location:Y,_extract:function(e){return N(e|=0,0),1},_memset:er,_sbrk:Oe,_memcpy:tr,stackAlloc:function(e){var r=Ze;return(0|Je)<=(0|(Ze=(Ze=Ze+(e|=0)|0)+15&-16))&&Qe(0|e),0|r},___uremdi3:rr,getTempRet0:function(){return 0|ve},setTempRet0:function(e){ve=e|=0},_i64Add:ze,dynCall_iiii:function(e,r,t,n){return r|=0,t|=0,n|=0,0|de[7&(e|=0)](0|r,0|t,0|n)},_emscripten_get_global_libc:function(){return 4288},dynCall_ii:function(e,r){return r|=0,0|fe[1&(e|=0)](0|r)},stackSave:function(){return 0|Ze},_free:B,runPostSets:function(){},establishStackSpace:function(e,r){Ze=e|=0,Je=r|=0},stackRestore:function(e){Ze=e|=0},_malloc:x,_emscripten_replace_memory:function(e){return!(16777215&f(e)||f(e)<=16777215||2147483648=e);)++d;if(16f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}return e}function F(a,b){return a?D(pa,a,b):""} +function qa(a,b,d,e){if(!(0=k){var l=a.charCodeAt(++h);k=65536+((k&1023)<<10)|l&1023}if(127>=k){if(d>=e)break;b[d++]=k}else{if(2047>=k){if(d+1>=e)break;b[d++]=192|k>>6}else{if(65535>=k){if(d+2>=e)break;b[d++]=224|k>>12}else{if(d+3>=e)break;b[d++]=240|k>>18;b[d++]=128|k>>12&63}b[d++]=128|k>>6&63}b[d++]=128|k&63}}b[d]=0;return d-f}function ra(a,b,d){return qa(a,pa,b,d)} +function sa(a){for(var b=0,d=0;d=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}return b}function ta(a){var b=sa(a)+1,d=ua(b);d&&qa(a,G,d,b);return d}var va,G,pa,H; +function wa(a){va=a;c.HEAP8=G=new Int8Array(a);c.HEAP16=new Int16Array(a);c.HEAP32=H=new Int32Array(a);c.HEAPU8=pa=new Uint8Array(a);c.HEAPU16=new Uint16Array(a);c.HEAPU32=new Uint32Array(a);c.HEAPF32=new Float32Array(a);c.HEAPF64=new Float64Array(a)}var xa=c.INITIAL_MEMORY||16777216;c.wasmMemory?y=c.wasmMemory:y=new WebAssembly.Memory({initial:xa/65536,maximum:32768});y&&(va=y.buffer);xa=va.byteLength;wa(va);H[16784]=5310176; +function ya(a){for(;0>2]=a}function R(){for(var a="",b=!1,d=arguments.length-1;-1<=d&&!b;d--){b=0<=d?arguments[d]:S.cwd();if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=Va(a.split("/").filter(function(e){return!!e}),!b).join("/");return(b?"/":"")+a||"."} +function $a(a,b){function d(k){for(var l=0;lq?[]:k.slice(l,q-l+1)}a=R(a).substr(1);b=R(b).substr(1);a=d(a.split("/"));b=d(b.split("/"));for(var e=Math.min(a.length,b.length),f=e,h=0;h=b||(b=Math.max(b,d*(1048576>d?2:1.125)>>>0),0!=d&&(b=Math.max(b,256)),d=a.sa,a.sa=new Uint8Array(b),0b)a.sa.length=b;else for(;a.sa.length=a.node.za)return 0;a=Math.min(a.node.za-f,e);if(8b)throw new S.ra(28);return b},Xa:function(a,b,d){T.ac(a.node,b+d);a.node.za=Math.max(a.node.za,b+d)},ab:function(a,b,d,e,f,h,k){if(!S.isFile(a.node.mode))throw new S.ra(43);a=a.node.sa;if(k&2||a.buffer!==b.buffer){if(0=a.node.size)return 0;a=a.node.sa.slice(f,f+e);e=U.Fb.readAsArrayBuffer(a);b.set(new Uint8Array(e),d);return a.size},write:function(){throw new S.ra(29); +},Ha:function(a,b,d){1===d?b+=a.position:2===d&&S.isFile(a.node.mode)&&(b+=a.node.size);if(0>b)throw new S.ra(28);return b}}},S={root:null,cb:[],Zb:{},streams:[],Rc:1,La:null,Yb:"/",xb:!1,jc:!0,Da:{},oc:{mc:{tc:1,uc:2}},ra:null,ub:{},Gc:null,nb:0,Lc:function(a){if(!(a instanceof S.ra)){a:{var b=Error();if(!b.stack){try{throw Error();}catch(d){b=d}if(!b.stack){b="(no stack trace available)";break a}}b=b.stack.toString()}c.extraStackTrace&&(b+="\n"+c.extraStackTrace());b=Ta(b);throw a+" : "+b;}return Ya(a.wa)}, +ya:function(a,b){a=R(S.cwd(),a);b=b||{};if(!a)return{path:"",node:null};var d={tb:!0,Gb:0},e;for(e in d)void 0===b[e]&&(b[e]=d[e]);if(8>>0)%S.La.length},hc:function(a){var b=S.wb(a.parent.id,a.name);a.Ra=S.La[b];S.La[b]=a},ic:function(a){var b=S.wb(a.parent.id,a.name);if(S.La[b]===a)S.La[b]=a.Ra;else for(b=S.La[b];b;){if(b.Ra===a){b.Ra=a.Ra;break}b=b.Ra}},Na:function(a,b){var d=S.Oc(a);if(d)throw new S.ra(d,a);for(d= +S.La[S.wb(a.id,b)];d;d=d.Ra){var e=d.name;if(d.parent.id===a.id&&e===b)return d}return S.lookup(a,b)},createNode:function(a,b,d,e){a=new S.rc(a,b,d,e);S.hc(a);return a},sb:function(a){S.ic(a)},kb:function(a){return a===a.parent},Pa:function(a){return!!a.bb},isFile:function(a){return 32768===(a&61440)},Ba:function(a){return 16384===(a&61440)},Sa:function(a){return 40960===(a&61440)},jb:function(a){return 8192===(a&61440)},Mc:function(a){return 24576===(a&61440)},isFIFO:function(a){return 4096===(a& +61440)},isSocket:function(a){return 49152===(a&49152)},Hc:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},Qc:function(a){var b=S.Hc[a];if("undefined"===typeof b)throw Error("Unknown file open mode: "+a);return b},bc:function(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b},Oa:function(a,b){if(S.jc)return 0;if(-1===b.indexOf("r")||a.mode&292){if(-1!==b.indexOf("w")&&!(a.mode&146)||-1!==b.indexOf("x")&&!(a.mode&73))return 2}else return 2; +return 0},Oc:function(a){var b=S.Oa(a,"x");return b?b:a.ta.lookup?0:2},Bb:function(a,b){try{return S.Na(a,b),20}catch(d){}return S.Oa(a,"wx")},lb:function(a,b,d){try{var e=S.Na(a,b)}catch(f){return f.wa}if(a=S.Oa(a,"wx"))return a;if(d){if(!S.Ba(e.mode))return 54;if(S.kb(e)||S.Ja(e)===S.cwd())return 10}else if(S.Ba(e.mode))return 31;return 0},Pc:function(a,b){return a?S.Sa(a.mode)?32:S.Ba(a.mode)&&("r"!==S.bc(b)||b&512)?31:S.Oa(a,S.bc(b)):44},sc:4096,Sc:function(a,b){b=b||S.sc;for(a=a||0;a<=b;a++)if(!S.streams[a])return a; +throw new S.ra(33);},Ya:function(a){return S.streams[a]},Fc:function(a,b,d){S.pb||(S.pb=function(){},S.pb.prototype={object:{get:function(){return this.node},set:function(h){this.node=h}}});var e=new S.pb,f;for(f in a)e[f]=a[f];a=e;b=S.Sc(b,d);a.fd=b;return S.streams[b]=a},zc:function(a){S.streams[a]=null},yc:{open:function(a){a.ua=S.Kc(a.node.rdev).ua;a.ua.open&&a.ua.open(a)},Ha:function(){throw new S.ra(70);}},Ab:function(a){return a>>8},ld:function(a){return a&255},Qa:function(a,b){return a<<8| +b},Hb:function(a,b){S.Zb[a]={ua:b}},Kc:function(a){return S.Zb[a]},dc:function(a){var b=[];for(a=[a];a.length;){var d=a.pop();b.push(d);a.push.apply(a,d.cb)}return b},nc:function(a,b){function d(k){S.nb--;return b(k)}function e(k){if(k){if(!e.Ea)return e.Ea=!0,d(k)}else++h>=f.length&&d(null)}"function"===typeof a&&(b=a,a=!1);S.nb++;1b)throw new S.ra(28);var d;"string"===typeof a?d=S.ya(a,{Fa:!0}).node:d=a;if(!d.ta.Ca)throw new S.ra(63);if(S.Ba(d.mode))throw new S.ra(31);if(!S.isFile(d.mode))throw new S.ra(28);if(a=S.Oa(d,"w"))throw new S.ra(a);d.ta.Ca(d,{size:b,timestamp:Date.now()})},Ic:function(a,b){a=S.Ya(a);if(!a)throw new S.ra(8);if(0===(a.flags&2097155))throw new S.ra(28);S.truncate(a.node,b)},ad:function(a, +b,d){a=S.ya(a,{Fa:!0}).node;a.ta.Ca(a,{timestamp:Math.max(b,d)})},open:function(a,b,d,e,f){if(""===a)throw new S.ra(44);b="string"===typeof b?S.Qc(b):b;d=b&64?("undefined"===typeof d?438:d)&4095|32768:0;if("object"===typeof a)var h=a;else{a=O(a);try{h=S.ya(a,{Fa:!(b&131072)}).node}catch(l){}}var k=!1;if(b&64)if(h){if(b&128)throw new S.ra(20);}else h=S.Ka(a,d,0),k=!0;if(!h)throw new S.ra(44);S.jb(h.mode)&&(b&=-513);if(b&65536&&!S.Ba(h.mode))throw new S.ra(54);if(!k&&(d=S.Pc(h,b)))throw new S.ra(d); +b&512&&S.truncate(h,0);b&=-131713;e=S.Fc({node:h,path:S.Ja(h),flags:b,seekable:!0,position:0,ua:h.ua,Zc:[],error:!1},e,f);e.ua.open&&e.ua.open(e);!c.logReadFiles||b&1||(S.Eb||(S.Eb={}),a in S.Eb||(S.Eb[a]=1,v("FS.trackingDelegate error on read file: "+a)));try{S.Da.onOpenFile&&(f=0,1!==(b&2097155)&&(f|=S.oc.mc.tc),0!==(b&2097155)&&(f|=S.oc.mc.uc),S.Da.onOpenFile(a,f))}catch(l){v("FS.trackingDelegate['onOpenFile']('"+a+"', flags) threw an exception: "+l.message)}return e},close:function(a){if(S.$a(a))throw new S.ra(8); +a.vb&&(a.vb=null);try{a.ua.close&&a.ua.close(a)}catch(b){throw b;}finally{S.zc(a.fd)}a.fd=null},$a:function(a){return null===a.fd},Ha:function(a,b,d){if(S.$a(a))throw new S.ra(8);if(!a.seekable||!a.ua.Ha)throw new S.ra(70);if(0!=d&&1!=d&&2!=d)throw new S.ra(28);a.position=a.ua.Ha(a,b,d);a.Zc=[];return a.position},read:function(a,b,d,e,f){if(0>e||0>f)throw new S.ra(28);if(S.$a(a))throw new S.ra(8);if(1===(a.flags&2097155))throw new S.ra(8);if(S.Ba(a.node.mode))throw new S.ra(31);if(!a.ua.read)throw new S.ra(28); +var h="undefined"!==typeof f;if(!h)f=a.position;else if(!a.seekable)throw new S.ra(70);b=a.ua.read(a,b,d,e,f);h||(a.position+=b);return b},write:function(a,b,d,e,f,h){if(0>e||0>f)throw new S.ra(28);if(S.$a(a))throw new S.ra(8);if(0===(a.flags&2097155))throw new S.ra(8);if(S.Ba(a.node.mode))throw new S.ra(31);if(!a.ua.write)throw new S.ra(28);a.seekable&&a.flags&1024&&S.Ha(a,0,2);var k="undefined"!==typeof f;if(!k)f=a.position;else if(!a.seekable)throw new S.ra(70);b=a.ua.write(a,b,d,e,f,h);k||(a.position+= +b);try{if(a.path&&S.Da.onWriteToFile)S.Da.onWriteToFile(a.path)}catch(l){v("FS.trackingDelegate['onWriteToFile']('"+a.path+"') threw an exception: "+l.message)}return b},Xa:function(a,b,d){if(S.$a(a))throw new S.ra(8);if(0>b||0>=d)throw new S.ra(28);if(0===(a.flags&2097155))throw new S.ra(8);if(!S.isFile(a.node.mode)&&!S.Ba(a.node.mode))throw new S.ra(43);if(!a.ua.Xa)throw new S.ra(138);a.ua.Xa(a,b,d)},ab:function(a,b,d,e,f,h,k){if(0!==(h&2)&&0===(k&2)&&2!==(a.flags&2097155))throw new S.ra(2);if(1=== +(a.flags&2097155))throw new S.ra(2);if(!a.ua.ab)throw new S.ra(43);return a.ua.ab(a,b,d,e,f,h,k)},eb:function(a,b,d,e,f){return a&&a.ua.eb?a.ua.eb(a,b,d,e,f):0},nd:function(){return 0},kc:function(a,b,d){if(!a.ua.kc)throw new S.ra(59);return a.ua.kc(a,b,d)},readFile:function(a,b){b=b||{};b.flags=b.flags||"r";b.encoding=b.encoding||"binary";if("utf8"!==b.encoding&&"binary"!==b.encoding)throw Error('Invalid encoding type "'+b.encoding+'"');var d,e=S.open(a,b.flags);a=S.stat(a).size;var f=new Uint8Array(a); +S.read(e,f,0,a,0);"utf8"===b.encoding?d=D(f,0):"binary"===b.encoding&&(d=f);S.close(e);return d},writeFile:function(a,b,d){d=d||{};d.flags=d.flags||"w";a=S.open(a,d.flags,d.mode);if("string"===typeof b){var e=new Uint8Array(sa(b)+1);b=qa(b,e,0,e.length);S.write(a,e,0,b,void 0,d.xc)}else if(ArrayBuffer.isView(b))S.write(a,b,0,b.byteLength,void 0,d.xc);else throw Error("Unsupported data type");S.close(a)},cwd:function(){return S.Yb},chdir:function(a){a=S.ya(a,{Fa:!0});if(null===a.node)throw new S.ra(44); +if(!S.Ba(a.node.mode))throw new S.ra(54);var b=S.Oa(a.node,"x");if(b)throw new S.ra(b);S.Yb=a.path},Bc:function(){S.mkdir("/tmp");S.mkdir("/home");S.mkdir("/home/web_user")},Ac:function(){S.mkdir("/dev");S.Hb(S.Qa(1,3),{read:function(){return 0},write:function(e,f,h,k){return k}});S.mb("/dev/null",S.Qa(1,3));bb(S.Qa(5,0),eb);bb(S.Qa(6,0),fb);S.mb("/dev/tty",S.Qa(5,0));S.mb("/dev/tty1",S.Qa(6,0));if("object"===typeof crypto&&"function"===typeof crypto.getRandomValues){var a=new Uint8Array(1);var b= +function(){crypto.getRandomValues(a);return a[0]}}else if(ea)try{var d=require("crypto");b=function(){return d.randomBytes(1)[0]}}catch(e){}b||(b=function(){u("random_device")});S.Ia("/dev","random",b);S.Ia("/dev","urandom",b);S.mkdir("/dev/shm");S.mkdir("/dev/shm/tmp")},Dc:function(){S.mkdir("/proc");S.mkdir("/proc/self");S.mkdir("/proc/self/fd");S.Aa({Aa:function(){var a=S.createNode("/proc/self","fd",16895,73);a.ta={lookup:function(b,d){var e=S.Ya(+d);if(!e)throw new S.ra(8);b={parent:null,Aa:{lc:"fake"}, +ta:{readlink:function(){return e.path}}};return b.parent=b}};return a}},{},"/proc/self/fd")},Ec:function(){c.stdin?S.Ia("/dev","stdin",c.stdin):S.symlink("/dev/tty","/dev/stdin");c.stdout?S.Ia("/dev","stdout",null,c.stdout):S.symlink("/dev/tty","/dev/stdout");c.stderr?S.Ia("/dev","stderr",null,c.stderr):S.symlink("/dev/tty1","/dev/stderr");S.open("/dev/stdin","r");S.open("/dev/stdout","w");S.open("/dev/stderr","w")},$b:function(){S.ra||(S.ra=function(a,b){this.node=b;this.Xc=function(d){this.wa=d}; +this.Xc(a);this.message="FS error"},S.ra.prototype=Error(),S.ra.prototype.constructor=S.ra,[44].forEach(function(a){S.ub[a]=new S.ra(a);S.ub[a].stack=""}))},Yc:function(){S.$b();S.La=Array(4096);S.Aa(T,{},"/");S.Bc();S.Ac();S.Dc();S.Gc={MEMFS:T,WORKERFS:U}},Za:function(a,b,d){S.Za.xb=!0;S.$b();c.stdin=a||c.stdin;c.stdout=b||c.stdout;c.stderr=d||c.stderr;S.Ec()},quit:function(){S.Za.xb=!1;var a=c._fflush;a&&a(0);for(a=0;athis.length-1||0>n)){var t=n%this.chunkSize;return this.fc(n/this.chunkSize|0)[t]}};h.prototype.fb=function(n){this.fc=n};h.prototype.Rb=function(){var n=new XMLHttpRequest;n.open("HEAD",d,!1);n.send(null);if(!(200<=n.status&&300>n.status||304===n.status))throw Error("Couldn't load "+ +d+". Status: "+n.status);var t=Number(n.getResponseHeader("Content-length")),w,C=(w=n.getResponseHeader("Accept-Ranges"))&&"bytes"===w;n=(w=n.getResponseHeader("Content-Encoding"))&&"gzip"===w;var B=1048576;C||(B=t);var A=this;A.fb(function(I){var J=I*B,aa=(I+1)*B-1;aa=Math.min(aa,t-1);if("undefined"===typeof A.Ea[I]){var bc=A.Ea;if(J>aa)throw Error("invalid range ("+J+", "+aa+") or no bytes requested!");if(aa>t-1)throw Error("only "+t+" bytes available! programmer error!");var E=new XMLHttpRequest; +E.open("GET",d,!1);t!==B&&E.setRequestHeader("Range","bytes="+J+"-"+aa);"undefined"!=typeof Uint8Array&&(E.responseType="arraybuffer");E.overrideMimeType&&E.overrideMimeType("text/plain; charset=x-user-defined");E.send(null);if(!(200<=E.status&&300>E.status||304===E.status))throw Error("Couldn't load "+d+". Status: "+E.status);J=void 0!==E.response?new Uint8Array(E.response||[]):db(E.responseText||"",!0);bc[I]=J}if("undefined"===typeof A.Ea[I])throw Error("doXHR failed!");return A.Ea[I]});if(n||!t)B= +t=1,B=t=this.fc(0).length,ka("LazyFiles on gzip forces download of the whole file when length is accessed");this.wc=t;this.vc=B;this.zb=!0};if("undefined"!==typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var k=new h;Object.defineProperties(k,{length:{get:function(){this.zb||this.Rb();return this.wc}},chunkSize:{get:function(){this.zb||this.Rb();return this.vc}}});k={yb:!1,sa:k}}else k={yb:!1,url:d}; +var l=S.Cc(a,b,k,e,f);k.sa?l.sa=k.sa:k.url&&(l.sa=null,l.url=k.url);Object.defineProperties(l,{za:{get:function(){return this.sa.length}}});var q={};Object.keys(l.ua).forEach(function(n){var t=l.ua[n];q[n]=function(){if(!S.cc(l))throw new S.ra(29);return t.apply(null,arguments)}});q.read=function(n,t,w,C,B){if(!S.cc(l))throw new S.ra(29);n=n.node.sa;if(B>=n.length)return 0;C=Math.min(n.length-B,C);if(n.slice)for(var A=0;A>2]=e.dev;H[d+4>>2]=0;H[d+8>>2]=e.ino;H[d+12>>2]=e.mode;H[d+16>>2]=e.nlink;H[d+20>>2]=e.uid;H[d+24>>2]=e.gid;H[d+28>>2]=e.rdev;H[d+32>>2]=0;N=[e.size>>>0,(M=e.size,1<=+Fa(M)?0>>0:~~+Ga((M-+(~~M>>>0))/4294967296)>>>0:0)];H[d+40>>2]=N[0];H[d+44>>2]=N[1];H[d+48>>2]=4096;H[d+52>>2]=e.blocks;H[d+56>>2]=e.atime.getTime()/1E3|0;H[d+60>>2]=0;H[d+64>>2]=e.mtime.getTime()/ +1E3|0;H[d+68>>2]=0;H[d+72>>2]=e.ctime.getTime()/1E3|0;H[d+76>>2]=0;N=[e.ino>>>0,(M=e.ino,1<=+Fa(M)?0>>0:~~+Ga((M-+(~~M>>>0))/4294967296)>>>0:0)];H[d+80>>2]=N[0];H[d+84>>2]=N[1];return 0}var jb=void 0;function kb(a){a=S.Ya(a);if(!a)throw new S.ra(8);return a}var lb={}; +function mb(){if(!nb){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ca||"./this.program"},b;for(b in lb)a[b]=lb[b];var d=[];for(b in a)d.push(b+"="+a[b]);nb=d}return nb}var nb;ra("GMT",67200,4); +function ob(){function a(h){return(h=h.toTimeString().match(/\(([A-Za-z ]+)\)$/))?h[1]:"GMT"}if(!pb){pb=!0;H[qb()>>2]=60*(new Date).getTimezoneOffset();var b=(new Date).getFullYear(),d=new Date(b,0,1);b=new Date(b,6,1);H[rb()>>2]=Number(d.getTimezoneOffset()!=b.getTimezoneOffset());var e=a(d),f=a(b);e=ta(e);f=ta(f);b.getTimezoneOffset()>2]=e,H[sb()+4>>2]=f):(H[sb()>>2]=f,H[sb()+4>>2]=e)}}var pb; +function tb(a,b,d,e){a||(a=this);this.parent=a;this.Aa=a.Aa;this.bb=null;this.id=S.Rc++;this.name=b;this.mode=d;this.ta={};this.ua={};this.rdev=e}Object.defineProperties(tb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},Nc:{get:function(){return S.Ba(this.mode)}},yb:{get:function(){return S.jb(this.mode)}}});S.rc=tb;S.Yc();var gb; +c.FS_createFolder=S.Tb;c.FS_createPath=S.Wb;c.FS_createDataFile=S.hb;c.FS_createPreloadedFile=S.Xb;c.FS_createLazyFile=S.Ub;c.FS_createLink=S.Vb;c.FS_createDevice=S.Ia;c.FS_unlink=S.unlink;function db(a,b){var d=Array(sa(a)+1);a=qa(a,d,0,d.length);b&&(d.length=a);return d} +var ub={b:function(a){return ua(a)},a:function(a){"uncaught_exception"in Ua?Ua.Ea++:Ua.Ea=1;throw a;},A:function(a,b){try{a=F(a);if(b&-8)var d=-28;else{var e;(e=S.ya(a,{Fa:!0}).node)?(a="",b&4&&(a+="r"),b&2&&(a+="w"),b&1&&(a+="x"),d=a&&S.Oa(e,a)?-2:0):d=-44}return d}catch(f){return"undefined"!==typeof S&&f instanceof S.ra||u(f),-f.wa}},F:function(a,b){try{return a=F(a),S.chmod(a,b),0}catch(d){return"undefined"!==typeof S&&d instanceof S.ra||u(d),-d.wa}},z:function(a){try{var b=kb(a);return S.open(b.path, +b.flags,0).fd}catch(d){return"undefined"!==typeof S&&d instanceof S.ra||u(d),-d.wa}},t:function(a,b,d){try{return S.Ic(a,d),0}catch(e){return"undefined"!==typeof S&&e instanceof S.ra||u(e),-e.wa}},c:function(){return 42},x:function(a,b,d){try{return a=F(a),S.chown(a,b,d),0}catch(e){return"undefined"!==typeof S&&e instanceof S.ra||u(e),-e.wa}},B:function(){return-34},E:function(a,b){try{return a=F(a),ib(S.lstat,a,b)}catch(d){return"undefined"!==typeof S&&d instanceof S.ra||u(d),-d.wa}},G:function(a, +b){try{return a=F(a),a=O(a),"/"===a[a.length-1]&&(a=a.substr(0,a.length-1)),S.mkdir(a,b,0),0}catch(d){return"undefined"!==typeof S&&d instanceof S.ra||u(d),-d.wa}},j:function(a,b,d){jb=d;try{var e=F(a);jb+=4;return S.open(e,b,H[jb-4>>2]).fd}catch(f){return"undefined"!==typeof S&&f instanceof S.ra||u(f),-f.wa}},w:function(a,b,d){try{var e=kb(a);return S.read(e,G,b,d)}catch(f){return"undefined"!==typeof S&&f instanceof S.ra||u(f),-f.wa}},r:function(a){try{return a=F(a),S.rmdir(a),0}catch(b){return"undefined"!== +typeof S&&b instanceof S.ra||u(b),-b.wa}},D:function(a,b){try{return a=F(a),ib(S.stat,a,b)}catch(d){return"undefined"!==typeof S&&d instanceof S.ra||u(d),-d.wa}},v:function(a,b){try{return a=F(a),b=F(b),S.symlink(a,b),0}catch(d){return"undefined"!==typeof S&&d instanceof S.ra||u(d),-d.wa}},H:function(a){try{var b=hb;hb=a;return b}catch(d){return"undefined"!==typeof S&&d instanceof S.ra||u(d),-d.wa}},s:function(a){try{return a=F(a),S.unlink(a),0}catch(b){return"undefined"!==typeof S&&b instanceof S.ra|| +u(b),-b.wa}},o:function(){u()},m:function(a,b,d){pa.copyWithin(a,b,b+d)},n:function(a){a>>>=0;var b=pa.length;if(2147483648=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);e=Math.max(16777216,a,e);0>>16);wa(y.buffer);var f=1;break a}catch(h){}f=void 0}if(f)return!0}return!1},p:function(a,b){var d=0;mb().forEach(function(e,f){var h=b+d;f=H[a+4*f>>2]=h;for(h=0;h>0]= +e.charCodeAt(h);G[f>>0]=0;d+=e.length+1});return 0},q:function(a,b){var d=mb();H[a>>2]=d.length;var e=0;d.forEach(function(f){e+=f.length+1});H[b>>2]=e;return 0},C:function(a){try{var b=kb(a);S.close(b);return 0}catch(d){return"undefined"!==typeof S&&d instanceof S.ra||u(d),d.wa}},u:function(a,b){try{var d=kb(a);G[b>>0]=d.tty?2:S.Ba(d.mode)?3:S.Sa(d.mode)?7:4;return 0}catch(e){return"undefined"!==typeof S&&e instanceof S.ra||u(e),e.wa}},l:function(a,b,d,e,f){try{var h=kb(a);a=4294967296*d+(b>>>0); +if(-9007199254740992>=a||9007199254740992<=a)return-61;S.Ha(h,a,e);N=[h.position>>>0,(M=h.position,1<=+Fa(M)?0>>0:~~+Ga((M-+(~~M>>>0))/4294967296)>>>0:0)];H[f>>2]=N[0];H[f+4>>2]=N[1];h.vb&&0===a&&0===e&&(h.vb=null);return 0}catch(k){return"undefined"!==typeof S&&k instanceof S.ra||u(k),k.wa}},y:function(a,b,d,e){try{a:{for(var f=kb(a),h=a=0;h>2],H[b+(8*h+4)>>2],void 0);if(0>k){var l=-1;break a}a+=k}l=a}H[e>>2]=l;return 0}catch(q){return"undefined"!== +typeof S&&q instanceof S.ra||u(q),q.wa}},I:function(){return 0},d:function(){throw"getgrnam: TODO";},e:function(){throw"getpwnam: TODO";},h:function(a){ob();a=new Date(1E3*H[a>>2]);H[16788]=a.getSeconds();H[16789]=a.getMinutes();H[16790]=a.getHours();H[16791]=a.getDate();H[16792]=a.getMonth();H[16793]=a.getFullYear()-1900;H[16794]=a.getDay();var b=new Date(a.getFullYear(),0,1);H[16795]=(a.getTime()-b.getTime())/864E5|0;H[16797]=-(60*a.getTimezoneOffset());var d=(new Date(a.getFullYear(),6,1)).getTimezoneOffset(); +b=b.getTimezoneOffset();a=(d!=b&&a.getTimezoneOffset()==Math.min(b,d))|0;H[16796]=a;a=H[sb()+(a?4:0)>>2];H[16798]=a;return 67152},memory:y,g:function(a){ob();var b=new Date(H[a+20>>2]+1900,H[a+16>>2],H[a+12>>2],H[a+8>>2],H[a+4>>2],H[a>>2],0),d=H[a+32>>2],e=b.getTimezoneOffset(),f=new Date(b.getFullYear(),0,1),h=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),k=f.getTimezoneOffset(),l=Math.min(k,h);0>d?H[a+32>>2]=Number(h!=k&&l==e):0>2]=b.getDay();H[a+28>>2]=(b.getTime()-f.getTime())/864E5|0;return b.getTime()/1E3|0},f:function(){},table:z,k:function(a){var b=Date.now()/1E3|0;a&&(H[a>>2]=b);return b},i:function(a,b){b?(b=H[b+4>>2],b*=1E3):b=Date.now();a=F(a);try{return S.ad(a,b,b),0}catch(d){return S.Lc(d),-1}}},vb=function(){function a(f){c.asm=f.exports;Ma("wasm-instantiate")}function b(f){a(f.instance)}function d(f){return Ra().then(function(h){return WebAssembly.instantiate(h,e)}).then(f,function(h){v("failed to asynchronously prepare wasm: "+ +h);u(h)})}var e={a:ub};La("wasm-instantiate");if(c.instantiateWasm)try{return c.instantiateWasm(e,a)}catch(f){return v("Module.instantiateWasm callback failed with error: "+f),!1}(function(){if(ma||"function"!==typeof WebAssembly.instantiateStreaming||Oa()||Na("file://")||"function"!==typeof fetch)return d(b);fetch(L,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(b,function(h){v("wasm streaming compile failed: "+h);v("falling back to ArrayBuffer instantiation"); +d(b)})})})();return{}}();c.asm=vb; +var Sa=c.___wasm_call_ctors=function(){return(Sa=c.___wasm_call_ctors=c.asm.J).apply(null,arguments)},wb=c._emscripten_bind_RARHeaderDataEx_RARHeaderDataEx_0=function(){return(wb=c._emscripten_bind_RARHeaderDataEx_RARHeaderDataEx_0=c.asm.K).apply(null,arguments)},xb=c._emscripten_bind_RARHeaderDataEx_set_UnpSize_1=function(){return(xb=c._emscripten_bind_RARHeaderDataEx_set_UnpSize_1=c.asm.L).apply(null,arguments)},yb=c._emscripten_bind_RARHeaderDataEx_set_PackSize_1=function(){return(yb=c._emscripten_bind_RARHeaderDataEx_set_PackSize_1= +c.asm.M).apply(null,arguments)},zb=c._emscripten_bind_RARHeaderDataEx_get_Flags_0=function(){return(zb=c._emscripten_bind_RARHeaderDataEx_get_Flags_0=c.asm.N).apply(null,arguments)},Ab=c._emscripten_bind_RARHeaderDataEx_set_Flags_1=function(){return(Ab=c._emscripten_bind_RARHeaderDataEx_set_Flags_1=c.asm.O).apply(null,arguments)},Bb=c._emscripten_bind_RARHeaderDataEx___destroy___0=function(){return(Bb=c._emscripten_bind_RARHeaderDataEx___destroy___0=c.asm.P).apply(null,arguments)},Cb=c._emscripten_bind_RAROpenArchiveDataEx_RAROpenArchiveDataEx_0= +function(){return(Cb=c._emscripten_bind_RAROpenArchiveDataEx_RAROpenArchiveDataEx_0=c.asm.Q).apply(null,arguments)},Db=c._emscripten_bind_RAROpenArchiveDataEx_get_ArcName_0=function(){return(Db=c._emscripten_bind_RAROpenArchiveDataEx_get_ArcName_0=c.asm.R).apply(null,arguments)},Eb=c._emscripten_bind_RAROpenArchiveDataEx_set_ArcName_1=function(){return(Eb=c._emscripten_bind_RAROpenArchiveDataEx_set_ArcName_1=c.asm.S).apply(null,arguments)},Fb=c._emscripten_bind_RAROpenArchiveDataEx_get_OpenMode_0= +function(){return(Fb=c._emscripten_bind_RAROpenArchiveDataEx_get_OpenMode_0=c.asm.T).apply(null,arguments)},Gb=c._emscripten_bind_RAROpenArchiveDataEx_set_OpenMode_1=function(){return(Gb=c._emscripten_bind_RAROpenArchiveDataEx_set_OpenMode_1=c.asm.U).apply(null,arguments)},Hb=c._emscripten_bind_RAROpenArchiveDataEx_get_Callback_0=function(){return(Hb=c._emscripten_bind_RAROpenArchiveDataEx_get_Callback_0=c.asm.V).apply(null,arguments)},Ib=c._emscripten_bind_RAROpenArchiveDataEx_set_Callback_1=function(){return(Ib= +c._emscripten_bind_RAROpenArchiveDataEx_set_Callback_1=c.asm.W).apply(null,arguments)},Jb=c._emscripten_bind_RAROpenArchiveDataEx_get_OpenResult_0=function(){return(Jb=c._emscripten_bind_RAROpenArchiveDataEx_get_OpenResult_0=c.asm.X).apply(null,arguments)},Kb=c._emscripten_bind_RAROpenArchiveDataEx_set_OpenResult_1=function(){return(Kb=c._emscripten_bind_RAROpenArchiveDataEx_set_OpenResult_1=c.asm.Y).apply(null,arguments)},Lb=c._emscripten_bind_RAROpenArchiveDataEx_get_Flags_0=function(){return(Lb= +c._emscripten_bind_RAROpenArchiveDataEx_get_Flags_0=c.asm.Z).apply(null,arguments)},Mb=c._emscripten_bind_RAROpenArchiveDataEx_set_Flags_1=function(){return(Mb=c._emscripten_bind_RAROpenArchiveDataEx_set_Flags_1=c.asm._).apply(null,arguments)},Nb=c._emscripten_bind_RAROpenArchiveDataEx___destroy___0=function(){return(Nb=c._emscripten_bind_RAROpenArchiveDataEx___destroy___0=c.asm.$).apply(null,arguments)},Ob=c._emscripten_bind_VoidPtr___destroy___0=function(){return(Ob=c._emscripten_bind_VoidPtr___destroy___0= +c.asm.aa).apply(null,arguments)},Pb=c._emscripten_bind_RARHeaderDataEx_get_FileNameW_0=function(){return(Pb=c._emscripten_bind_RARHeaderDataEx_get_FileNameW_0=c.asm.ba).apply(null,arguments)},Qb=c._emscripten_bind_RARHeaderDataEx_set_FileNameW_1=function(){return(Qb=c._emscripten_bind_RARHeaderDataEx_set_FileNameW_1=c.asm.ca).apply(null,arguments)},Rb=c._emscripten_bind_RARHeaderDataEx_get_UnpSize_0=function(){return(Rb=c._emscripten_bind_RARHeaderDataEx_get_UnpSize_0=c.asm.da).apply(null,arguments)}, +Sb=c._emscripten_bind_RARHeaderDataEx_get_PackSize_0=function(){return(Sb=c._emscripten_bind_RARHeaderDataEx_get_PackSize_0=c.asm.ea).apply(null,arguments)};c._free=function(){return(c._free=c.asm.fa).apply(null,arguments)};var ua=c._malloc=function(){return(ua=c._malloc=c.asm.ga).apply(null,arguments)},Za=c.___errno_location=function(){return(Za=c.___errno_location=c.asm.ha).apply(null,arguments)};c._RAROpenArchiveEx=function(){return(c._RAROpenArchiveEx=c.asm.ia).apply(null,arguments)}; +c._RARCloseArchive=function(){return(c._RARCloseArchive=c.asm.ja).apply(null,arguments)};c._RARReadHeaderEx=function(){return(c._RARReadHeaderEx=c.asm.ka).apply(null,arguments)};c._RARProcessFileW=function(){return(c._RARProcessFileW=c.asm.la).apply(null,arguments)};c._RARSetPassword=function(){return(c._RARSetPassword=c.asm.ma).apply(null,arguments)}; +var sb=c.__get_tzname=function(){return(sb=c.__get_tzname=c.asm.na).apply(null,arguments)},rb=c.__get_daylight=function(){return(rb=c.__get_daylight=c.asm.oa).apply(null,arguments)},qb=c.__get_timezone=function(){return(qb=c.__get_timezone=c.asm.pa).apply(null,arguments)};c.dynCall_vi=function(){return(c.dynCall_vi=c.asm.qa).apply(null,arguments)};c.asm=vb;c.getMemory=function(a){if(Da)a=ua(a);else{var b=H[16784];H[16784]=b+a+15&-16;a=b}return a};c.UTF8ToString=F;c.stringToUTF8=ra; +c.addRunDependency=La;c.removeRunDependency=Ma;c.FS_createFolder=S.Tb;c.FS_createPath=S.Wb;c.FS_createDataFile=S.hb;c.FS_createPreloadedFile=S.Xb;c.FS_createLazyFile=S.Ub;c.FS_createLink=S.Vb;c.FS_createDevice=S.Ia;c.FS_unlink=S.unlink; +c.addFunction=function(a,b){if(!x){x=new WeakMap;for(var d=0;d=Yb){assert(0>=1;break;case 4:e>>=2;break;case 8:e>>=3}for(var f=0;fspan { + align-items: inherit; + display: flex; + width: 100%; +} +.ejs_settings_main_bar:hover { + background: rgba(var(--ejs-primary-color),1); + color: #fff; + cursor: pointer; +} +.ejs_settings_main_bar:hover::after { + border-left-color: currentColor; +} +.ejs_settings_main_bar_selected { + align-items: center; + display: flex; + margin-left: auto; + margin-right: -5px; + overflow: hidden; + padding-left: 25px; + pointer-events: none; +} +.ejs_setting_menu { + padding: 7px; +} +.ejs_back_button { + font-weight: 500; + margin: 7px; + margin-bottom: 3px; + padding-left: 28px; + position: relative; + width: calc(100% - 14px); + align-items: center; + color: #999; + display: flex; + font-size: 13px; + padding: 4px 11px; + user-select: none; + + background: transparent; + border: 0; + border-radius: 3px; + cursor: pointer; + flex-shrink: 0; + overflow: visible; + transition: all .3s ease; +} +.ejs_back_button:hover { + background: rgba(var(--ejs-primary-color),1); + color: #fff; +} +.ejs_back_button:hover::after { + border-right-color: currentColor; +} +.ejs_back_button::before { + background: #b7c5cd; + box-shadow: 0 1px 0 #fff; + content: ''; + height: 1px; + left: 0; + margin-top: 4px; + overflow: hidden; + position: absolute; + right: 0; + top: 100%; +} +.ejs_back_button::after { + border: 4px solid transparent; + border-right-color: rgba(79,91,95,0.8); + left: 7px; + content: ''; + position: absolute; + top: 50%; + transform: translateY(-50%); +} +.ejs_menu_text_a { + align-items: center; + display: flex; + font-size: 13px; + padding: 4px 11px; + user-select: none; + width: 100%; +} +.ejs_option_row { + padding-left: 7px; +} +.ejs_option_row:hover::before { + background: rgba(0,0,0,0.1); +} +.ejs_option_row::before { + background: rgba(204,204,204,0.1); + content: ''; + display: block; + flex-shrink: 0; + height: 16px; + margin-right: 10px; + transition: all .3s ease; + width: 16px; + border-radius: 100%; +} +.ejs_option_row::after { + background: #fff; + border: 0; + height: 6px; + left: 12px; + opacity: 0; + top: 50%; + transform: translateY(-50%) scale(0); + transition: transform .3s ease,opacity .3s ease; + width: 6px; + border-radius: 100%; + content: ''; + position: absolute; +} +.ejs_option_row_selected::before { + background: rgba(var(--ejs-primary-color),1); +} +.ejs_option_row_selected::after { + opacity: 1; + transform: translateY(-50%) scale(1); +} +.ejs_option_row>span { + align-items: center; + display: flex; + width: 100%; +} +.ejs_button_style { + margin: 0px; + background: transparent; + border: 0; + border-radius: 3px; + cursor: pointer; + flex-shrink: 0; + overflow: visible; + padding: 7px; + position: relative; + transition: all .3s ease; + + align-items: center; + color: #999; + display: flex; + font-size: 13px; + user-select: none; + width: 100%; +} +.ejs_button_style:hover { + background: rgba(var(--ejs-primary-color),1); + color: #fff; +} + +.ejs_cheat_heading { + margin-top: 0 !important; + margin-bottom: 0 !important; + font-weight: 600 !important; + font-size: 1.25rem; + line-height: 1.25 !important; + color: rgba(var(--ejs-primary-color),1) !important; +} +.ejs_cheat_close { + font: inherit; + line-height: inherit; + width: auto; + background: transparent; + border: 0; + color: #bcbcbc !important; + cursor: pointer; +} +.ejs_cheat_close::before { + content: "\2715"; + color: #bcbcbc !important; + font: inherit; + line-height: inherit; + width: auto; +} +.ejs_cheat_header { + display: flex; + justify-content: space-between; + align-items: center; +} +.ejs_cheat_main { + margin-top: 2rem; + margin-bottom: 2rem; + line-height: 1.5; + color: rgba(0,0,0,0.8); + text-align: left; + color: #bcbcbc !important; + border: unset; +} +.ejs_cheat_code { + color: #000 !important; + font-size: 1rem; + padding: .4rem; + max-width: 100%; +} +@keyframes ejs_cheat_animation{ + from{ + transform:translateY(15%) + } + to{ + transform:translateY(0) + } +} +.ejs_cheat_parent { + background-color: rgba(0,0,0,0.8); + border: 1px solid rgba(238,238,238,0.2); + padding: 30px; + min-width: 200px; + max-width: 500px; + max-height: 100vh; + border-radius: 4px; + overflow-y: auto; + box-sizing: border-box; + will-change: transform; + animation: ejs_cheat_animation .3s cubic-bezier(0,0,0.2,1); + font-size: 14px; +} +.ejs_popup_container_box { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0,0,0,0.6); + display: flex; + justify-content: center; + align-items: center; +} +.ejs_popup_submit { + touch-action: manipulation; + font: inherit; + line-height: inherit; + width: auto; +} +.ejs_button_button { + color: #fff !important; + padding-left: 1rem; + padding-right: 1rem; + padding-top: .5rem; + padding-bottom: .5rem; + background-color: #929292; + border-radius: .25rem; + border-style: none; + border-width: 0; + cursor: pointer; + -webkit-appearance: button; + appearance: button; + text-transform: none; + overflow: visible; + margin: 0; + will-change: transform; + transition: transform .25s ease-out,-webkit-transform .25s ease-out; +} +.ejs_button_button:hover { + transform: scale(1.05); +} +.ejs_cheat_rows { + max-width: 320px; + margin: 0 auto; + text-align: left; + width: 100%; + float: none; + user-select: text !important; +} +.ejs_cheat_row { + padding-left: 2.25rem; + position: relative; + padding: .2em 0; + clear: both; +} +.ejs_cheat_row:hover { + background-color: rgba(0,0,0,0.8); +} +.ejs_cheat_row input[type=checkbox] { + position: absolute; + z-index: -1; + opacity: 0; + box-sizing: border-box; + width: auto; +} +.ejs_cheat_row label { + position: relative; + margin-bottom: 0; + vertical-align: top; + word-break: break-word; +} + +.ejs_cheat_row label::before { + position: absolute; + top: 0rem; + display: block; + height: 1rem; + content: ""; + background-color: #fff; + border: #adb5bd solid 1px; + left: -2.25rem; + width: 1.75rem; + pointer-events: all; + border-radius: .5rem; +} + +.ejs_cheat_row input:checked+label::before { + color: #fff; + border-color: rgba(var(--ejs-primary-color),1); + background-color: rgba(var(--ejs-primary-color),1); +} + +.ejs_cheat_row label::after { + position: absolute; + display: block; + content: ""; + background-repeat: no-repeat; + background-position: center center; + top: calc(0rem + 2px); + left: calc(-2.25rem + 2px); + width: calc(1rem - 4px); + height: calc(1rem - 4px); + background-color: #adb5bd; + border-radius: .5rem; + transition: transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out; +} +.ejs_cheat_row input:checked+label::after { + background-color: #fff; + -webkit-transform: translateX(0.75rem); + transform: translateX(0.75rem); +} + +.ejs_cheat_row_button { + position: absolute; + padding: .1rem .5rem; + background-color: rgba(var(--ejs-primary-color),1); + color: #fff !important; + border-radius: .25rem; + cursor: pointer; + right: .025rem; + border: 0; +} + +@media (max-width: 574px) { + .ejs_volume_parent input[type='range'] { + width: 100%; + } +} +@media (min-width: 575px) { + .ejs_volume_parent { + max-width: 110px; + } +} +.ejs_volume_parent { + align-items: center; + display: flex; + flex: 1; + position: relative; +} +/* +@media (max-width: 574px) { + .ejs_volume_parent { + padding-right: 0px; + } + .ejs_volume_parent input[type='range'] { + display: none; + } +} +@media (min-width: 575px) { + .ejs_volume_parent { + padding-right: 15px; + } + .ejs_volume_parent input[type='range'] { + display: block; + } +}*/ +.ejs_volume_parent { + padding-right: 15px; +} +.ejs_volume_parent input[type='range'] { + display: block; +} +.ejs_volume_parent::-webkit-media-controls{ + display: none; +} +.ejs_volume_parent input[type='range']{ + -webkit-appearance:none; + appearance: none; + border:0; + border-radius:28px; + color:rgba(var(--ejs-primary-color), 1); + margin:0; + padding:0; + transition:box-shadow 0.3s ease; + width:100% +} + +.ejs_volume_parent input[type='range']::-webkit-slider-runnable-track{ + background-color:rgba(255,255,255,0.25); + box-shadow: 0 0 0 5px rgba(var(--ejs-primary-color), 0.5); + outline:0; + background: transparent; + border:0; + border-radius:3px; + height:6px; + transition:box-shadow 0.3s ease; + user-select:none; + background-image:linear-gradient(to right, currentColor var(--value, 0%), transparent var(--value, 0%)) +} +.ejs_volume_parent input[type='range']::-webkit-slider-thumb{ + background:#fff; + border:0; + border-radius:100%; + box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2); + height:14px; + position:relative; + transition:all 0.2s ease; + width:14px; + -webkit-appearance:none; + margin-top:-4px +} +.ejs_volume_parent input[type='range']::-moz-range-track{ + background-color:rgba(255,255,255,0.25); + box-shadow:0 0 0 5px rgba(var(--ejs-primary-color), 0.5); + outline:0; + background:transparent; + border:0; + border-radius:3px; + height:6px; + transition:box-shadow 0.3s ease; + user-select:none +} +.ejs_volume_parent input[type='range']::-moz-range-thumb{ + background:#fff; + border:0; + border-radius:100%; + box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2); + height:14px; + position:relative; + transition:all 0.2s ease; + width:14px +} +.ejs_volume_parent input[type='range']::-moz-range-progress{ + background:currentColor; + border-radius:3px; + height:6px +} +.ejs_volume_parent input[type='range']::-ms-track{ + background-color:rgba(255,255,255,0.25); + box-shadow:0 0 0 5px rgba(var(--ejs-primary-color), 0.5); + outline:0; + background:transparent; + border:0; + border-radius:3px; + height:6px; + transition:box-shadow 0.3s ease; + user-select:none; + color:transparent +} +.ejs_volume_parent input[type='range']::-ms-fill-upper{ + background:transparent; + border:0; + border-radius:3px; + height:6px; + transition:box-shadow 0.3s ease; + user-select:none +} +.ejs_volume_parent input[type='range']::-ms-fill-lower{ + background:transparent; + border:0; + border-radius:3px; + height:6px; + transition:box-shadow 0.3s ease; + user-select:none; + background:currentColor +} +.ejs_volume_parent input[type='range']::-ms-thumb{ + background:#fff; + border:0; + border-radius:100%; + box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2); + height:14px; + position:relative; + transition:all 0.2s ease; + width:14px; + margin-top:0 +} +.ejs_volume_parent input[type='range']::-ms-tooltip{ + display:none +} +.ejs_volume_parent input[type='range']:focus{ + outline:0 +} +.ejs_volume_parent input[type='range']::-moz-focus-outer{ + border:0 +} + +.ejs_volume_parent input[type='range']:active::-webkit-slider-thumb { + box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5) +} +.ejs_volume_parent input[type='range']:active::-moz-range-thumb { + box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5) +} +.ejs_volume_parent input[type='range']:active::-ms-thumb { + box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5) +} + +.ejs_message { + float: none; + overflow: hidden; + position: absolute; + top: 0; + color: red; + font-size: 17px; + padding: 10px; + text-align: left; + text-shadow: rgb(0, 0, 0) 1px 1px 1px; +} + +.ejs_virtualGamepad_open { + display: inline-block; + width: 30px; + height: 30px; + color: #fff; + position: absolute; + top: 5px; + right: 5px; + opacity: .5; + z-index: 999; +} +.ejs_virtualGamepad_open svg { + fill: currentColor; +} + +.ejs_netplay_header { + margin-top: .5rem; + margin-bottom: .5rem; + line-height: 1.5; + color: rgba(0,0,0,.8); + text-align: left; +} +.ejs_netplay_header input, .ejs_netplay_header select { + font-size: 1rem; + padding: .4rem; + max-width: 100%; + color: #000!important; + background-color: #fff!important; + margin: 0; + height: 2rem; + display: block; + font-family: Arial; + border: 0px; +} +.ejs_netplay_name_heading { + margin-top: 0!important; + margin-bottom: 0!important; + font-weight: 600!important; + font-size: 1.25rem; + line-height: 1.25!important; + color: rgba(var(--ejs-primary-color),1)!important; + display: flex; + justify-content: space-between; + align-items: center; +} +.ejs_netplay_table { + font-family: Avenir,"Avenir Next","Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif; + font-size: 0.8rem; + padding: 0 10px; +} +.ejs_netplay_join_button { + float: none; + padding: .1rem .5rem; + background-color: rgba(var(--ejs-primary-color),1); + color: #fff!important; + border-radius: .25rem; + cursor: pointer; +} +.ejs_netplay_table_row:hover { + background-color: #2d2d2d; +} diff --git a/emulatorjs/data/emulator.js b/emulatorjs/data/emulator.js new file mode 100644 index 00000000..eca360f7 --- /dev/null +++ b/emulatorjs/data/emulator.js @@ -0,0 +1,4790 @@ +class EmulatorJS { + version = 11; //Increase by 1 when cores are updated + getCore(generic) { + const core = this.config.system; + /*todo: + Systems: msx + + Cores: + - FreeChaF + - FreeIntv + - NeoCD + - O2EM + - Vecx + */ + if (generic) { + const options = { + 'a5200': 'atari5200', + 'beetle_vb': 'vb', + 'desmume': 'nds', + 'desmume2015': 'nds', + 'fbalpha2012_cps1': 'arcade', + 'fbalpha2012_cps2': 'arcade', + 'fbneo': 'arcade', + 'fceumm': 'nes', + 'gambatte': 'gb', + 'gearcoleco': 'coleco', + 'genesis_plus_gx': 'sega', + 'handy': 'lynx', + 'mame2003': 'mame2003', + 'mame2003_plus': 'mame2003', + 'mednafen_ngp': 'ngp', + 'mednafen_pce': 'pce', + 'mednafen_pcfx': 'pcfx', + 'mednafen_psx_hw': 'psx', + 'mednafen_wswan': 'ws', + 'melonds': 'nds', + 'mgba': 'gba', + 'mupen64plus_next': 'n64', + 'nestopia': 'nes', + 'opera': '3do', + 'parallel_n64': 'n64', + 'pcsx_rearmed': 'psx', + 'picodrive': 'sega', + 'ppsspp': 'psp', + 'prosystem': 'atari7800', + 'snes9x': 'snes', + 'stella2014': 'atari2600', + 'virtualjaguar': 'jaguar', + 'yabause': 'segaSaturn', + 'puae': 'amiga', + 'vice_x64': 'c64' + } + return options[core] || core; + } + const options = { + 'jaguar': 'virtualjaguar', + 'lynx': 'handy', + 'segaSaturn': 'yabause', + 'segaMS': 'genesis_plus_gx', + 'segaMD': 'genesis_plus_gx', + 'segaGG': 'genesis_plus_gx', + 'segaCD': 'genesis_plus_gx', + 'sega32x': 'picodrive', + 'atari2600': 'stella2014', + 'atari7800': 'prosystem', + 'nes': 'fceumm', + 'snes': 'snes9x', + 'atari5200': 'a5200', + 'gb': 'gambatte', + 'gba': 'mgba', + 'vb': 'beetle_vb', + 'n64': 'mupen64plus_next', + 'nds': 'melonds', + 'mame2003': 'mame2003_plus', + 'arcade': 'fbneo', + 'psx': 'pcsx_rearmed', + '3do': 'opera', + 'psp': 'ppsspp', + 'pce': 'mednafen_pce', + 'pcfx': 'mednafen_pcfx', + 'ngp': 'mednafen_ngp', + 'ws': 'mednafen_wswan', + 'coleco': 'gearcoleco', + 'amiga': 'puae', + 'c64': 'vice_x64' + } + if (this.isSafari && this.isMobile && this.getCore(true) === "n64") { + return "parallel_n64"; + } + return options[core] || core; + } + extensions = { + 'a5200': ['a52', 'bin'], + 'amiga': ['adf', 'adz', 'dms', 'fdi', 'ipf', 'raw', 'hdf', 'hdz', 'lha', 'slave', 'info', 'cue', 'ccd', 'chd', 'nrg', 'mds', 'iso', 'uae', 'm3u', 'zip', '7z'], + 'desmume': ['nds', 'bin'], + 'desmume2015': ['nds', 'bin'], + 'fbalpha2012_cps1': ['zip'], + 'fbalpha2012_cps2': ['zip'], + 'fbneo': ['zip', '7z'], + 'fceumm': ['fds', 'nes', 'unif', 'unf'], + 'gambatte': ['gb', 'gbc', 'dmg'], + 'gearcoleco': ['col', 'cv', 'bin', 'rom'], + 'genesis_plus_gx': ['m3u', 'mdx', 'md', 'smd', 'gen', 'bin', 'cue', 'iso', 'chd', 'bms', 'sms', 'gg', 'sg', '68k', 'sgd'], + 'handy': ['lnx'], + 'mame2003': ['zip'], + 'mame2003_plus': ['zip'], + 'mednafen_ngp': ['ngp', 'ngc'], + 'mednafen_pce': ['pce', 'cue', 'ccd', 'iso', 'img', 'bin', 'chd'], + 'mednafen_pcfx': ['cue', 'ccd', 'toc', 'chd'], + 'mednafen_psx': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'], + 'mednafen_wswan': ['ws', 'wsc', 'pc2'], + 'mednafen_psx_hw': ['cue', 'toc', 'm3u', 'ccd', 'exe', 'pbp', 'chd'], + 'beetle_vb': ['vb', 'vboy', 'bin'], + 'melonds': ['nds'], + 'mgba': ['gb', 'gbc', 'gba'], + 'mupen64plus_next': ['n64', 'v64', 'z64', 'bin', 'u1', 'ndd', 'gb'], + 'nestopia': ['fds', 'nes', 'unif', 'unf'], + 'opera': ['iso', 'bin', 'chd', 'cue'], + 'parallel_n64': ['n64', 'v64', 'z64', 'bin', 'u1', 'ndd', 'gb'], + 'pcsx_rearmed': ['bin', 'cue', 'img', 'mdf', 'pbp', 'toc', 'cbn', 'm3u', 'ccd'], + 'picodrive': ['bin', 'gen', 'smd', 'md', '32x', 'cue', 'iso', 'sms', '68k', 'chd'], + 'ppsspp': ['elf', 'iso', 'cso', 'prx', 'pbp'], + 'prosystem': ['a78', 'bin'], + 'snes9x': ['smc', 'sfc', 'swc', 'fig', 'bs', 'st'], + 'stella2014': ['a26', 'bin', 'zip'], + 'vice_x64': ['d64', 'd6z', 'd71', 'd7z', 'd80', 'd81', 'd82', 'd8z', 'g64', 'g6z', 'g41', 'g4z', 'x64', 'x6z', 'nib', 'nbz', 'd2m', 'd4m', 't64', 'tap', 'tcrt', 'prg', 'p00', 'crt', 'bin', 'cmd', 'm3u', 'vfl', 'vsf', 'zip', '7z', 'gz', '20', '40', '60', 'a0', 'b0', 'rom'], + 'virtualjaguar': ['j64', 'jag', 'rom', 'abs', 'cof', 'bin', 'prg'], + 'yabause': ['cue', 'iso', 'ccd', 'mds', 'chd', 'zip', 'm3u'] + } + createElement(type) { + return document.createElement(type); + } + addEventListener(element, listener, callback) { + const listeners = listener.split(" "); + let rv = []; + for (let i=0; i { + if (opts.method === 'HEAD') { + cb({headers:{}}); + return; + } else { + cb({headers:{}, data:game}); + return; + } + }) + return; + } + const basePath = notWithPath ? '' : this.config.dataPath; + path = basePath + path; + if (!notWithPath && this.config.filePaths) { + if (typeof this.config.filePaths[path.split('/').pop()] === "string") { + path = this.config.filePaths[path.split('/').pop()]; + } + } + let url; + try {url=new URL(path)}catch(e){}; + if ((url && ['http:', 'https:'].includes(url.protocol)) || !url) { + const xhr = new XMLHttpRequest(); + if (progressCB instanceof Function) { + xhr.addEventListener('progress', (e) => { + const progress = e.total ? ' '+Math.floor(e.loaded / e.total * 100).toString()+'%' : ' '+(e.loaded/1048576).toFixed(2)+'MB'; + progressCB(progress); + }); + } + xhr.onload = function() { + if (xhr.readyState === xhr.DONE) { + let data = xhr.response; + if (xhr.status.toString().startsWith("4") || xhr.status.toString().startsWith("5")) { + cb(-1); + return; + } + try {data=JSON.parse(data)}catch(e){} + cb({ + data: data, + headers: { + "content-length": xhr.getResponseHeader('content-length') + } + }); + } + } + if (opts.responseType) xhr.responseType = opts.responseType; + xhr.onerror = () => cb(-1); + xhr.open(opts.method, path, true); + xhr.send(); + } else { + (async () => { + //Most commonly blob: urls. Not sure what else it could be + if (opts.method === 'HEAD') { + cb({headers:{}}); + return; + } + let res; + try { + res = await fetch(path); + if ((opts.type && opts.type.toLowerCase() === 'arraybuffer') || !opts.type) { + res = await res.arrayBuffer(); + } else { + res = await res.text(); + try {res = JSON.parse(res)} catch(e) {} + } + } catch(e) { + cb(-1); + } + if (path.startsWith('blob:')) URL.revokeObjectURL(path); + cb({ + data: res, + headers: {} + }); + })(); + } + } + toData(data, rv) { + if (!(data instanceof ArrayBuffer) && !(data instanceof Uint8Array) && !(data instanceof Blob)) return null; + if (rv) return true; + return new Promise(async (resolve) => { + if (data instanceof ArrayBuffer) { + resolve(new Uint8Array(data)); + } else if (data instanceof Uint8Array) { + resolve(data); + } else if (data instanceof Blob) { + resolve(new Uint8Array(await data.arrayBuffer())); + } + resolve(); + }) + } + checkForUpdates() { + fetch('https://raw.githack.com/EmulatorJS/EmulatorJS/main/data/version.json').then(response => { + if (response.ok) { + response.text().then(body => { + let version = JSON.parse(body); + if (this.ejs_num_version < version.current_version) { + console.log('Using emulatorjs version ' + this.ejs_num_version + ' but the newest version is ' + version.current_version + '\nopen https://github.com/EmulatorJS/EmulatorJS to update'); + } + }) + } + }) + } + constructor(element, config) { + this.ejs_version = "4.0.8"; + this.ejs_num_version = 40.8; + this.debug = (window.EJS_DEBUG_XX === true); + if (this.debug || (window.location && ['localhost', '127.0.0.1'].includes(location.hostname))) this.checkForUpdates(); + this.netplayEnabled = (window.EJS_DEBUG_XX === true) && (window.EJS_EXPERIMENTAL_NETPLAY === true); + this.settingsLanguage = window.EJS_settingsLanguage || false; + this.config = config; + this.currentPopup = null; + this.isFastForward = false; + this.isSlowMotion = false; + this.rewindEnabled = this.loadRewindEnabled(); + this.touch = false; + this.cheats = []; + this.started = false; + this.volume = (typeof this.config.volume === "number") ? this.config.volume : 0.5; + if (this.config.defaultControllers) this.defaultControllers = this.config.defaultControllers; + this.muted = false; + this.paused = true; + this.listeners = []; + this.missingLang = []; + this.setElements(element); + this.setColor(this.config.color || ""); + this.config.alignStartButton = (typeof this.config.alignStartButton === "string") ? this.config.alignStartButton : "bottom"; + this.config.backgroundColor = (typeof this.config.backgroundColor === "string") ? this.config.backgroundColor : "rgb(51, 51, 51)"; + if (this.config.adUrl) { + this.config.adSize = (Array.isArray(this.config.adSize)) ? this.config.adSize : ["300px", "250px"]; + this.setupAds(this.config.adUrl, this.config.adSize[0], this.config.adSize[1]); + } + this.canvas = this.createElement('canvas'); + this.canvas.classList.add('ejs_canvas'); + this.bindListeners(); + this.config.netplayUrl = this.config.netplayUrl || "https://netplay.emulatorjs.org"; + this.fullscreen = false; + this.isMobile = (function() { + let check = false; + (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); + return check; + })(); + this.isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); + this.storage = { + rom: new window.EJS_STORAGE("EmulatorJS-roms", "rom"), + bios: new window.EJS_STORAGE("EmulatorJS-bios", "bios"), + core: new window.EJS_STORAGE("EmulatorJS-core", "core"), + states: new window.EJS_STORAGE("EmulatorJS-states", "states") + } + + this.game.classList.add("ejs_game"); + if (typeof this.config.backgroundImg === "string") { + this.game.classList.add("ejs_game_background"); + if (this.config.backgroundBlur) this.game.classList.add("ejs_game_background_blur"); + this.game.setAttribute("style", "--ejs-background-image: url("+this.config.backgroundImg+"); --ejs-background-color: "+this.config.backgroundColor+";"); + this.on("start", () => { + this.game.classList.remove("ejs_game_background"); + if (this.config.backgroundBlur) this.game.classList.remove("ejs_game_background_blur"); + }) + } else { + this.game.setAttribute("style", "--ejs-background-color: "+this.config.backgroundColor+";"); + } + + if (Array.isArray(this.config.cheats)) { + for (let i=0; i -1 && this.config.adMode < 3) ? this.config.adMode : 2; + div.classList.add("ejs_ad_iframe"); + const frame = this.createElement("iframe"); + frame.src = ads; + frame.setAttribute("scrolling", "no"); + frame.setAttribute("frameborder", "no"); + frame.style.width = width; + frame.style.height = height; + const closeParent = this.createElement("div"); + closeParent.classList.add("ejs_ad_close"); + const closeButton = this.createElement("a"); + closeParent.appendChild(closeButton); + closeParent.setAttribute("hidden", ""); + div.appendChild(closeParent); + div.appendChild(frame); + if (this.config.adMode !== 1) { + this.elements.parent.appendChild(div); + } + this.addEventListener(closeButton, "click", () => { + div.remove(); + }) + + this.on("start-clicked", () => { + if (this.config.adMode === 0) div.remove(); + if (this.config.adMode === 1){ + this.elements.parent.appendChild(div); + } + }) + + this.on("start", () => { + closeParent.removeAttribute("hidden"); + const time = (typeof this.config.adTimer === "number" && this.config.adTimer > 0) ? this.config.adTimer : 10000; + if (this.config.adTimer === -1) div.remove(); + if (this.config.adTimer === 0) return; + setTimeout(() => { + div.remove(); + }, time); + }) + + } + adBlocked(url, del){ + if (del){ + document.querySelector('div[class="ejs_ad_iframe"]').remove(); + } else { + try { + document.querySelector('div[class="ejs_ad_iframe"]').remove(); + } catch(e) {} + this.config.adUrl = url; + this.setupAds(this.config.adUrl, this.config.adSize[0], this.config.adSize[1]); + } + } + functions = {}; + on(event, func) { + if (!Array.isArray(this.functions[event])) this.functions[event] = []; + this.functions[event].push(func); + } + callEvent(event, data) { + if (!Array.isArray(this.functions[event])) return 0; + this.functions[event].forEach(e => e(data)); + return this.functions[event].length; + } + setElements(element) { + const game = this.createElement("div"); + const elem = document.querySelector(element); + elem.innerHTML = ""; + elem.appendChild(game); + this.game = game; + + this.elements = { + main: this.game, + parent: elem + } + this.elements.parent.classList.add("ejs_parent"); + this.elements.parent.setAttribute("tabindex", -1); + } + // Start button + createStartButton() { + const button = this.createElement("div"); + button.classList.add("ejs_start_button"); + let border = 0; + if (typeof this.config.backgroundImg === "string"){ + button.classList.add("ejs_start_button_border"); + border = 1; + } + button.innerText = (typeof this.config.startBtnName === 'string') ? this.config.startBtnName : this.localization("Start Game"); + if (this.config.alignStartButton == "top"){ + button.style.bottom = "calc(100% - 20px)"; + }else if (this.config.alignStartButton == "center"){ + button.style.bottom = "calc(50% + 22.5px + "+border+"px)"; + } + this.elements.parent.appendChild(button); + this.addEventListener(button, "touchstart", () => { + this.touch = true; + }) + this.addEventListener(button, "click", this.startButtonClicked.bind(this)); + if (this.config.startOnLoad === true) { + this.startButtonClicked(button); + } + setTimeout(() => { + this.callEvent("ready"); + }, 20); + } + startButtonClicked(e) { + this.callEvent("start-clicked"); + if (e.pointerType === "touch") { + this.touch = true; + } + if (e.preventDefault) { + e.preventDefault(); + e.target.remove(); + } else { + e.remove(); + } + this.createText(); + this.downloadGameCore(); + } + // End start button + createText() { + this.textElem = this.createElement("div"); + this.textElem.classList.add("ejs_loading_text"); + if (typeof this.config.backgroundImg === "string") this.textElem.classList.add("ejs_loading_text_glow"); + this.textElem.innerText = this.localization("Loading..."); + this.elements.parent.appendChild(this.textElem); + } + localization(text, log) { + if (typeof text === "undefined") return; + text = text.toString(); + if (text.includes("EmulatorJS v")) return text; + if (this.config.langJson) { + if (typeof log === "undefined") log = true; + if (!this.config.langJson[text] && log) { + if (!this.missingLang.includes(text)) this.missingLang.push(text); + console.log("Translation not found for '"+text+"'. Language set to '"+this.config.language+"'"); + } + return this.config.langJson[text] || text; + } + return text; + } + checkCompression(data, msg, fileCbFunc) { + if (msg) { + this.textElem.innerText = msg; + } + //to be put in another file + function isCompressed(data) { //https://www.garykessler.net/library/file_sigs.html + //todo. Use hex instead of numbers + if ((data[0] === 80 && data[1] === 75) && ((data[2] === 3 && data[3] === 4) || (data[2] === 5 && data[3] === 6) || (data[2] === 7 && data[3] === 8))) { + return 'zip'; + } else if (data[0] === 55 && data[1] === 122 && data[2] === 188 && data[3] === 175 && data[4] === 39 && data[5] === 28) { + return '7z'; + } else if ((data[0] === 82 && data[1] === 97 && data[2] === 114 && data[3] === 33 && data[4] === 26 && data[5] === 7) && ((data[6] === 0) || (data[6] === 1 && data[7] == 0))) { + return 'rar'; + } + } + const createWorker = (path) => { + return new Promise((resolve, reject) => { + this.downloadFile(path, (res) => { + if (res === -1) { + this.textElem.innerText = this.localization('Network Error'); + this.textElem.style.color = "red"; + return; + } + const blob = new Blob([res.data], { + 'type': 'application/javascript' + }) + const url = window.URL.createObjectURL(blob); + resolve(new Worker(url)); + }, null, false, {responseType: "arraybuffer", method: "GET"}); + }) + } + const files = {}; + let res; + const onMessage = (data) => { + if (!data.data) return; + //data.data.t/ 4=progress, 2 is file, 1 is zip done + if (data.data.t === 4 && msg) { + const pg = data.data; + const num = Math.floor(pg.current / pg.total * 100); + if (isNaN(num)) return; + const progress = ' '+num.toString()+'%'; + this.textElem.innerText = msg + progress; + } + if (data.data.t === 2) { + if (typeof fileCbFunc === "function") { + fileCbFunc(data.data.file, data.data.data); + files[data.data.file] = true; + } else { + files[data.data.file] = data.data.data; + } + } + if (data.data.t === 1) { + res(files); + } + } + const decompress7z = (file) => { + return new Promise((resolve, reject) => { + res = resolve; + + createWorker('compression/extract7z.js').then((worker) => { + worker.onmessage = onMessage; + worker.postMessage(file); + //console.log(file); + }) + }) + } + const decompressRar = (file) => { + return new Promise((resolve, reject) => { + res = resolve; + + this.downloadFile("compression/libunrar.js", (res) => { + this.downloadFile("compression/libunrar.wasm", (res2) => { + if (res === -1 || res2 === -1) { + this.textElem.innerText = this.localization('Network Error'); + this.textElem.style.color = "red"; + return; + } + const path = URL.createObjectURL(new Blob([res2.data], {type: "application/wasm"})); + let data = '\nlet dataToPass = [];\nModule = {\n monitorRunDependencies: function(left) {\n if (left == 0) {\n setTimeout(function() {\n unrar(dataToPass, null);\n }, 100);\n }\n },\n onRuntimeInitialized: function() {\n },\n locateFile: function(file) {\n return \''+path+'\';\n }\n};\n'+res.data+'\nlet unrar = function(data, password) {\n let cb = function(fileName, fileSize, progress) {\n postMessage({"t":4,"current":progress,"total":fileSize, "name": fileName});\n };\n\n let rarContent = readRARContent(data.map(function(d) {\n return {\n name: d.name,\n content: new Uint8Array(d.content)\n }\n }), password, cb)\n let rec = function(entry) {\n if (!entry) return;\n if (entry.type === \'file\') {\n postMessage({"t":2,"file":entry.fullFileName,"size":entry.fileSize,"data":entry.fileContent});\n } else if (entry.type === \'dir\') {\n Object.keys(entry.ls).forEach(function(k) {\n rec(entry.ls[k]);\n })\n } else {\n throw "Unknown type";\n }\n }\n rec(rarContent);\n postMessage({"t":1});\n return rarContent;\n};\nonmessage = function(data) {\n dataToPass.push({name: \'test.rar\', content: data.data});\n};\n '; + const blob = new Blob([data], { + 'type': 'application/javascript' + }) + const url = window.URL.createObjectURL(blob); + const worker = new Worker(url); + worker.onmessage = onMessage; + worker.postMessage(file); + }, null, false, {responseType: "arraybuffer", method: "GET"}) + }, null, false, {responseType: "text", method: "GET"}); + + }) + } + const decompressZip = (file) => { + return new Promise((resolve, reject) => { + res = resolve; + + createWorker('compression/extractzip.js').then((worker) => { + worker.onmessage = onMessage; + worker.postMessage(file); + }) + }) + } + const compression = isCompressed(data.slice(0, 10)); + if (compression) { + //Need to do zip and rar still + if (compression === "7z") { + return decompress7z(data); + } else if (compression === "zip") { + return decompressZip(data); + } else if (compression === "rar") { + return decompressRar(data); + } + } else { + if (typeof fileCbFunc === "function") { + fileCbFunc("!!notCompressedData", data); + return new Promise(resolve => resolve({"!!notCompressedData": true})); + } else { + return new Promise(resolve => resolve({"!!notCompressedData": data})); + } + } + + } + downloadGameCore() { + this.textElem.innerText = this.localization("Download Game Core"); + if (this.config.threads && ((typeof window.SharedArrayBuffer) !== "function")) { + this.textElem.innerText = this.localization('Error for site owner')+"\n"+this.localization("Check console"); + this.textElem.style.color = "red"; + console.warn("Threads is set to true, but the SharedArrayBuffer function is not exposed. Threads requires 2 headers to be set when sending you html page. See https://stackoverflow.com/a/68630724"); + return; + } + const gotCore = (data) => { + this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Core")).then((data) => { + let js, thread, wasm; + for (let k in data) { + if (k.endsWith(".wasm")) { + wasm = data[k]; + } else if (k.endsWith(".worker.js")) { + thread = data[k]; + } else if (k.endsWith(".js")) { + js = data[k]; + } + } + this.initGameCore(js, wasm, thread); + }); + } + this.storage.core.get(this.getCore()+'-wasm.data').then((result) => { + if (result && result.version === this.version && !this.debug) { + gotCore(result.data); + return; + } + let corePath = 'cores/'+this.getCore()+(this.config.threads ? "-thread" : "")+'-wasm.data'; + this.downloadFile(corePath, (res) => { + if (res === -1) { + this.textElem.innerText = this.localization('Network Error'); + this.textElem.style.color = "red"; + return; + } + gotCore(res.data); + this.storage.core.put(this.getCore()+'-wasm.data', { + version: this.version, + data: res.data + }); + }, (progress) => { + this.textElem.innerText = this.localization("Download Game Core") + progress; + }, false, {responseType: "arraybuffer", method: "GET"}); + }) + } + initGameCore(js, wasm, thread) { + this.initModule(wasm, thread); + let script = this.createElement("script"); + script.src = URL.createObjectURL(new Blob([js], {type: "application/javascript"})); + document.body.appendChild(script); + } + getBaseFileName() { + //Only once game and core is loaded + if (!this.started) return null; + if (typeof this.config.gameName === "string") { + const invalidCharacters = /[#<$+%>!`&*'|{}/\\?"=@:^\r\n]/ig; + const name = this.config.gameName.replace(invalidCharacters, "").trim(); + if (name) return name; + } + let parts = this.fileName.split("."); + parts.splice(parts.length-1, 1); + return parts.join("."); + } + saveInBrowserSupported() { + return !!window.indexedDB && (typeof this.config.gameName === "string" || !this.config.gameUrl.startsWith("blob:")); + } + displayMessage(message) { + if (!this.msgElem) { + this.msgElem = this.createElement("div"); + this.msgElem.classList.add("ejs_message"); + this.elements.parent.appendChild(this.msgElem); + } + clearTimeout(this.msgTimeout); + this.msgTimeout = setTimeout(() => { + this.msgElem.innerText = ""; + }, 3000) + this.msgElem.innerText = message; + } + downloadStartState() { + return new Promise((resolve, reject) => { + if (typeof this.config.loadState !== "string" && !this.toData(this.config.loadState, true)) { + resolve(); + return; + } + this.textElem.innerText = this.localization("Download Game State"); + + this.downloadFile(this.config.loadState, (res) => { + if (res === -1) { + this.textElem.innerText = this.localization('Network Error'); + this.textElem.style.color = "red"; + return; + } + this.on("start", () => { + setTimeout(() => { + this.gameManager.loadState(new Uint8Array(res.data)); + }, 10); + }) + resolve(); + }, (progress) => { + this.textElem.innerText = this.localization("Download Game State") + progress; + }, true, {responseType: "arraybuffer", method: "GET"}); + }) + } + downloadGamePatch() { + return new Promise((resolve, reject) => { + if ((typeof this.config.gamePatchUrl !== "string" || !this.config.gamePatchUrl.trim()) && !this.toData(this.config.gamePatchUrl, true)) { + resolve(); + return; + } + this.textElem.innerText = this.localization("Download Game Patch"); + const gotData = (data) => { + this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Patch")).then((data) => { + for (const k in data) { + if (k === "!!notCompressedData") { + FS.writeFile(this.config.gamePatchUrl.split('/').pop().split("#")[0].split("?")[0], data[k]); + break; + } + if (k.endsWith('/')) continue; + FS.writeFile("/" + k.split('/').pop(), data[k]); + } + resolve(); + }) + } + + this.downloadFile(this.config.gamePatchUrl, (res) => { + this.storage.rom.get(this.config.gamePatchUrl.split("/").pop()).then((result) => { + if (result && result['content-length'] === res.headers['content-length'] && !this.debug) { + gotData(result.data); + return; + } + this.downloadFile(this.config.gamePatchUrl, (res) => { + if (res === -1) { + this.textElem.innerText = this.localization('Network Error'); + this.textElem.style.color = "red"; + return; + } + if (this.toData(this.config.gamePatchUrl, true)) { + this.config.gamePatchUrl = "game"; + } + gotData(res.data); + const limit = (typeof this.config.cacheLimit === "number") ? this.config.cacheLimit : 1073741824; + if (parseFloat(res.headers['content-length']) < limit && this.saveInBrowserSupported() && this.config.gamePatchUrl !== "game") { + this.storage.rom.put(this.config.gamePatchUrl.split("/").pop(), { + "content-length": res.headers['content-length'], + data: res.data + }) + } + }, (progress) => { + this.textElem.innerText = this.localization("Download Game Patch") + progress; + }, true, {responseType: "arraybuffer", method: "GET"}); + }) + }, null, true, {method: "HEAD"}) + }) + } + downloadGameParent() { + return new Promise((resolve, reject) => { + if ((typeof this.config.gameParentUrl !== "string" || !this.config.gameParentUrl.trim()) && !this.toData(this.config.gameParentUrl, true)) { + resolve(); + return; + } + this.textElem.innerText = this.localization("Download Game Parent"); + const gotData = (data) => { + this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Parent")).then((data) => { + for (const k in data) { + if (k === "!!notCompressedData") { + FS.writeFile(this.config.gameParentUrl.split('/').pop().split("#")[0].split("?")[0], data[k]); + break; + } + if (k.endsWith('/')) continue; + FS.writeFile("/" + k.split('/').pop(), data[k]); + } + resolve(); + }) + } + + this.downloadFile(this.config.gameParentUrl, (res) => { + this.storage.rom.get(this.config.gameParentUrl.split("/").pop()).then((result) => { + if (result && result['content-length'] === res.headers['content-length'] && !this.debug) { + gotData(result.data); + return; + } + this.downloadFile(this.config.gameParentUrl, (res) => { + if (res === -1) { + this.textElem.innerText = this.localization('Network Error'); + this.textElem.style.color = "red"; + return; + } + if (this.toData(this.config.gameParentUrl, true)) { + this.config.gameParentUrl = "game"; + } + gotData(res.data); + const limit = (typeof this.config.cacheLimit === "number") ? this.config.cacheLimit : 1073741824; + if (parseFloat(res.headers['content-length']) < limit && this.saveInBrowserSupported() && this.config.gameParentUrl !== "game") { + this.storage.rom.put(this.config.gameParentUrl.split("/").pop(), { + "content-length": res.headers['content-length'], + data: res.data + }) + } + }, (progress) => { + this.textElem.innerText = this.localization("Download Game Parent") + progress; + }, true, {responseType: "arraybuffer", method: "GET"}); + }) + }, null, true, {method: "HEAD"}) + }) + } + downloadBios() { + return new Promise((resolve, reject) => { + if ((typeof this.config.biosUrl !== "string" || !this.config.biosUrl.trim()) && !this.toData(this.config.biosUrl, true)) { + resolve(); + return; + } + this.textElem.innerText = this.localization("Download Game BIOS"); + const gotBios = (data) => { + this.checkCompression(new Uint8Array(data), this.localization("Decompress Game BIOS")).then((data) => { + for (const k in data) { + if (k === "!!notCompressedData") { + FS.writeFile(this.config.biosUrl.split('/').pop().split("#")[0].split("?")[0], data[k]); + break; + } + if (k.endsWith('/')) continue; + FS.writeFile("/" + k.split('/').pop(), data[k]); + } + resolve(); + }) + } + + this.downloadFile(this.config.biosUrl, (res) => { + if (res === -1) { + this.textElem.innerText = this.localization('Network Error'); + this.textElem.style.color = "red"; + return; + } + this.storage.bios.get(this.config.biosUrl.split("/").pop()).then((result) => { + if (result && result['content-length'] === res.headers['content-length'] && !this.debug) { + gotBios(result.data); + return; + } + this.downloadFile(this.config.biosUrl, (res) => { + if (res === -1) { + this.textElem.innerText = this.localization('Network Error'); + this.textElem.style.color = "red"; + return; + } + if (this.toData(this.config.biosUrl, true)) { + this.config.biosUrl = "game"; + } + gotBios(res.data); + if (this.saveInBrowserSupported() && this.config.biosUrl !== "game") { + this.storage.bios.put(this.config.biosUrl.split("/").pop(), { + "content-length": res.headers['content-length'], + data: res.data + }) + } + }, (progress) => { + this.textElem.innerText = this.localization("Download Game BIOS") + progress; + }, true, {responseType: "arraybuffer", method: "GET"}); + }) + }, null, true, {method: "HEAD"}) + }) + } + downloadRom() { + const extractFileNameFromUrl = url => { + if (!url) return null; + return url.split('/').pop().split("#")[0].split("?")[0]; + }; + const supportsExt = (ext) => { + const core = this.getCore(); + if (!this.extensions[core]) return false; + return this.extensions[core].includes(ext); + }; + + return new Promise(resolve => { + this.textElem.innerText = this.localization("Download Game Data"); + + const gotGameData = (data) => { + if (['arcade', 'mame2003'].includes(this.getCore(true))) { + this.fileName = extractFileNameFromUrl(this.config.gameUrl); + FS.writeFile(this.fileName, new Uint8Array(data)); + resolve(); + return; + } + + const altName = this.config.gameUrl.startsWith("blob:") ? (this.config.gameName || "game") : extractFileNameFromUrl(this.config.gameUrl); + + let disableCue = false; + if (['pcsx_rearmed', 'genesis_plus_gx', 'picodrive', 'mednafen_pce', 'vice_x64'].includes(this.getCore()) && this.config.disableCue === undefined) { + disableCue = true; + } else { + disableCue = this.config.disableCue; + } + + let fileNames = []; + this.checkCompression(new Uint8Array(data), this.localization("Decompress Game Data"), (fileName, fileData) => { + if (fileName.includes("/")) { + const paths = fileName.split("/"); + let cp = ""; + for (let i=0; i { + let isoFile = null; + let supportedFile = null; + let cueFile = null; + let selectedCueExt = null; + fileNames.forEach(fileName => { + const ext = fileName.split('.').pop().toLowerCase(); + if (supportedFile === null && supportsExt(ext)) { + supportedFile = fileName; + } + if (isoFile === null && ['iso', 'cso', 'chd', 'elf'].includes(ext)) { + isoFile = fileName; + } + if (['cue', 'ccd', 'toc', 'm3u'].includes(ext)) { + if (this.getCore(true) === 'psx') { + //always prefer m3u files for psx cores + if (selectedCueExt !== 'm3u') { + if (cueFile === null || ext === 'm3u') { + cueFile = fileName; + selectedCueExt = ext; + } + } + } else { + //prefer cue or ccd files over toc or m3u + if (!['cue', 'ccd'].includes(selectedCueExt)) { + if (cueFile === null || ['cue', 'ccd'].includes(ext)) { + cueFile = fileName; + selectedCueExt = ext; + } + } + } + } + }); + if (supportedFile !== null) { + this.fileName = supportedFile; + } else { + this.fileName = fileNames[0]; + } + if (isoFile !== null && (supportsExt('iso') || supportsExt('cso') || supportsExt('chd') || supportsExt('elf'))) { + this.fileName = isoFile; + } else if (supportsExt('cue') || supportsExt('ccd') || supportsExt('toc') || supportsExt('m3u')) { + if (cueFile !== null) { + this.fileName = cueFile; + } else if (!disableCue) { + this.fileName = this.gameManager.createCueFile(fileNames); + } + } + resolve(); + }); + } + + this.downloadFile(this.config.gameUrl, (res) => { + if (res === -1) { + this.textElem.innerText = this.localization('Network Error'); + this.textElem.style.color = "red"; + return; + } + const name = (typeof this.config.gameUrl === "string") ? this.config.gameUrl.split('/').pop() : "game"; + this.storage.rom.get(name).then((result) => { + if (result && result['content-length'] === res.headers['content-length'] && !this.debug && name !== "game") { + gotGameData(result.data); + return; + } + this.downloadFile(this.config.gameUrl, (res) => { + if (res === -1) { + this.textElem.innerText = this.localization('Network Error'); + this.textElem.style.color = "red"; + return; + } + if (this.toData(this.config.gameUrl, true)) { + this.config.gameUrl = "game"; + } + gotGameData(res.data); + const limit = (typeof this.config.cacheLimit === "number") ? this.config.cacheLimit : 1073741824; + if (parseFloat(res.headers['content-length']) < limit && this.saveInBrowserSupported() && this.config.gameUrl !== "game") { + this.storage.rom.put(this.config.gameUrl.split("/").pop(), { + "content-length": res.headers['content-length'], + data: res.data + }) + } + }, (progress) => { + this.textElem.innerText = this.localization("Download Game Data") + progress; + }, true, {responseType: "arraybuffer", method: "GET"}); + }) + }, null, true, {method: "HEAD"}) + }) + } + downloadFiles() { + (async () => { + this.gameManager = new window.EJS_GameManager(this.Module, this); + if (this.getCore() === "ppsspp") { + await this.gameManager.loadPpssppAssets(); + } + await this.downloadRom(); + await this.downloadBios(); + await this.downloadStartState(); + await this.downloadGameParent(); + await this.downloadGamePatch(); + this.startGame(); + })(); + } + initModule(wasmData, threadData) { + window.Module = { + 'noInitialRun': true, + 'onRuntimeInitialized': this.downloadFiles.bind(this), + 'arguments': [], + 'preRun': [], + 'postRun': [], + 'canvas': this.canvas, + 'print': (msg) => { + if (this.debug) { + console.log(msg); + } + }, + 'printErr': (msg) => { + if (this.debug) { + console.log(msg); + } + }, + 'totalDependencies': 0, + 'monitorRunDependencies': () => {}, + 'locateFile': function(fileName) { + if (this.debug) console.log(fileName); + if (fileName.endsWith(".wasm")) { + return URL.createObjectURL(new Blob([wasmData], {type: "application/wasm"})); + } else if (fileName.endsWith(".worker.js")) { + return URL.createObjectURL(new Blob([threadData], {type: "application/javascript"})); + } + } + }; + this.Module = window.Module; + } + startGame() { + try { + const args = []; + if (this.debug) args.push('-v'); + args.push('/'+this.fileName); + if (this.debug) console.log(args); + this.Module.callMain(args); + if (typeof this.config.softLoad === "number" && this.config.softLoad > 0) { + this.resetTimeout = setTimeout(() => { + this.gameManager.restart(); + }, this.config.softLoad * 1000); + } + this.Module.resumeMainLoop(); + this.checkSupportedOpts(); + this.setupSettingsMenu(); + this.loadSettings(); + this.updateCheatUI(); + this.updateGamepadLabels(); + if (!this.muted) this.setVolume(this.volume); + this.elements.parent.focus(); + this.textElem.remove(); + this.textElem = null; + this.game.classList.remove("ejs_game"); + this.game.appendChild(this.canvas); + this.handleResize(); + this.started = true; + this.paused = false; + if (this.touch) { + this.virtualGamepad.style.display = ""; + } + this.handleResize(); + if (this.config.fullscreenOnLoad) { + try { + this.toggleFullscreen(true); + } catch(e) { + if (this.debug) console.warn("Could not fullscreen on load"); + } + } + if (this.isSafari && this.isMobile) { + //Safari is --- funny + this.checkStarted(); + } + } catch(e) { + console.warn("failed to start game", e); + this.textElem.innerText = this.localization("Failed to start game"); + this.textElem.style.color = "red"; + return; + } + this.callEvent("start"); + } + checkStarted() { + (async() => { + let sleep = (ms) => new Promise(r => setTimeout(r, ms)); + let state = "suspended"; + let popup; + while (state === "suspended") { + if (!window.AL) return; + window.AL.currentCtx.sources.forEach(ctx => { + state = ctx.gain.context.state; + }); + if (state !== "suspended") break; + if (!popup) { + popup = this.createPopup("", {}); + const button = this.createElement("button"); + button.innerText = "Click to resume Emulator"; + button.classList.add("ejs_menu_button"); + button.style.width = "25%"; + button.style.height = "25%"; + popup.appendChild(button); + popup.style["text-align"] = "center"; + popup.style["font-size"] = "28px"; + } + await sleep(10); + } + if (popup) this.closePopup(); + })(); + } + bindListeners() { + this.createContextMenu(); + this.createBottomMenuBar(); + this.createControlSettingMenu(); + this.createCheatsMenu() + this.createNetplayMenu(); + this.setVirtualGamepad(); + this.addEventListener(this.elements.parent, "keydown keyup", this.keyChange.bind(this)); + this.addEventListener(this.elements.parent, "mousedown touchstart", (e) => { + if (document.activeElement !== this.elements.parent) this.elements.parent.focus(); + }) + this.addEventListener(window, "resize", this.handleResize.bind(this)); + //this.addEventListener(window, "blur", e => console.log(e), true); //TODO - add "click to make keyboard keys work" message? + + let counter = 0; + this.elements.statePopupPanel = this.createPopup("", {}, true); + this.elements.statePopupPanel.innerText = "Drop save state here to load"; + this.elements.statePopupPanel.style["text-align"] = "center"; + this.elements.statePopupPanel.style["font-size"] = "28px"; + this.addEventListener(this.elements.parent, "dragenter", (e) => { + e.preventDefault(); + if (!this.started) return; + counter++; + this.elements.statePopupPanel.parentElement.style.display = "block"; + }); + this.addEventListener(this.elements.parent, "dragover", (e) => { + e.preventDefault(); + }); + this.addEventListener(this.elements.parent, "dragleave", (e) => { + e.preventDefault(); + if (!this.started) return; + counter--; + if (counter === 0) { + this.elements.statePopupPanel.parentElement.style.display = "none"; + } + }); + this.addEventListener(this.elements.parent, "dragend", (e) => { + e.preventDefault(); + if (!this.started) return; + counter = 0; + this.elements.statePopupPanel.parentElement.style.display = "none"; + }); + this.addEventListener(this.elements.parent, "drop", (e) => { + e.preventDefault(); + if (!this.started) return; + this.elements.statePopupPanel.parentElement.style.display = "none"; + counter = 0; + const items = e.dataTransfer.items; + let file; + for (let i=0; i { + this.gameManager.loadState(new Uint8Array(data)); + }) + }); + + this.gamepad = new GamepadHandler(); //https://github.com/ethanaobrien/Gamepad + this.gamepad.on('connected', (e) => { + if (!this.gamepadLabels) return; + this.updateGamepadLabels(); + }) + this.gamepad.on('disconnected', (e) => { + setTimeout(this.updateGamepadLabels.bind(this), 10); + }) + this.gamepad.on('axischanged', this.gamepadEvent.bind(this)); + this.gamepad.on('buttondown', this.gamepadEvent.bind(this)); + this.gamepad.on('buttonup', this.gamepadEvent.bind(this)); + } + checkSupportedOpts() { + if (!this.gameManager.supportsStates()) { + this.elements.bottomBar.saveState[0].style.display = "none"; + this.elements.bottomBar.loadState[0].style.display = "none"; + this.elements.bottomBar.netplay[0].style.display = "none"; + this.elements.contextMenu.save.style.display = "none"; + this.elements.contextMenu.load.style.display = "none"; + } + if (typeof this.config.gameId !== "number" || !this.config.netplayUrl || this.netplayEnabled === false) { + this.elements.bottomBar.netplay[0].style.display = "none"; + } + } + updateGamepadLabels() { + for (let i=0; i { + if (this.started) { + this.elements.contextmenu.style.display = "block"; + this.elements.contextmenu.style.left = e.offsetX+"px"; + this.elements.contextmenu.style.top = e.offsetY+"px"; + } + e.preventDefault(); + }) + const hideMenu = () => { + this.elements.contextmenu.style.display = "none"; + } + this.addEventListener(this.elements.contextmenu, 'contextmenu', (e) => e.preventDefault()); + this.addEventListener(this.elements.parent, 'contextmenu', (e) => e.preventDefault()); + this.addEventListener(this.game, 'mousedown', hideMenu); + const parent = this.createElement("ul"); + const addButton = (title, hidden, functi0n) => { + //

  • '+title+'
  • + const li = this.createElement("li"); + if (hidden) li.hidden = true; + const a = this.createElement("a"); + if (functi0n instanceof Function) { + this.addEventListener(li, 'click', (e) => { + e.preventDefault(); + functi0n(); + }); + } + a.href = "#"; + a.onclick = "return false"; + a.innerText = this.localization(title); + li.appendChild(a); + parent.appendChild(li); + hideMenu(); + return li; + } + let screenshotUrl; + const screenshot = addButton("Take Screenshot", false, () => { + if (screenshotUrl) URL.revokeObjectURL(screenshotUrl); + const screenshot = this.gameManager.screenshot(); + const blob = new Blob([screenshot]); + screenshotUrl = URL.createObjectURL(blob); + const a = this.createElement("a"); + a.href = screenshotUrl; + const date = new Date(); + a.download = this.getBaseFileName()+"-"+date.getMonth()+"-"+date.getDate()+"-"+date.getFullYear()+".png"; + a.click(); + hideMenu(); + }); + const qSave = addButton("Quick Save", false, () => { + const slot = this.settings['save-state-slot'] ? this.settings['save-state-slot'] : "1"; + this.gameManager.quickSave(slot); + this.displayMessage(this.localization("SAVED STATE TO SLOT")+" "+slot); + hideMenu(); + }); + const qLoad = addButton("Quick Load", false, () => { + const slot = this.settings['save-state-slot'] ? this.settings['save-state-slot'] : "1"; + this.gameManager.quickLoad(slot); + this.displayMessage(this.localization("LOADED STATE FROM SLOT")+" "+slot); + hideMenu(); + }); + this.elements.contextMenu = { + screenshot: screenshot, + save: qSave, + load: qLoad + } + addButton("EmulatorJS v"+this.ejs_version, false, () => { + hideMenu(); + const body = this.createPopup("EmulatorJS", { + "Close": () => { + this.closePopup(); + } + }); + + const menu = this.createElement('div'); + menu.classList.add("ejs_list_selector"); + const parent = this.createElement("ul"); + const addButton = (title, hidden, functi0n) => { + const li = this.createElement("li"); + if (hidden) li.hidden = true; + const a = this.createElement("a"); + if (functi0n instanceof Function) { + this.addEventListener(li, 'click', (e) => { + e.preventDefault(); + functi0n(); + }); + } + a.href = "#"; + a.onclick = "return false"; + a.innerText = this.localization(title); + li.appendChild(a); + parent.appendChild(li); + hideMenu(); + return li; + } + //body.style["padding-left"] = "20%"; + const home = this.createElement("div"); + const license = this.createElement("div"); + license.style.display = "none"; + const retroarch = this.createElement("div"); + retroarch.style.display = "none"; + body.appendChild(home); + body.appendChild(license); + body.appendChild(retroarch); + + let current = home; + home.innerText = "EmulatorJS v"+this.ejs_version; + home.appendChild(this.createElement("br")); + home.appendChild(this.createElement("br")); + const gh = this.createElement("a"); + gh.href = "https://github.com/EmulatorJS/EmulatorJS"; + gh.target = "_blank"; + gh.innerText = this.localization("View on GitHub"); + home.appendChild(gh); + home.appendChild(this.createElement("br")); + const dc = this.createElement("a"); + dc.href = "https://discord.gg/6akryGkETU"; + dc.target = "_blank"; + dc.innerText = this.localization("Join the discord"); + home.appendChild(dc); + home.appendChild(this.createElement("br")); + menu.appendChild(parent); + body.appendChild(menu); + const setElem = (element) => { + if (current === element) return; + if (current) { + current.style.display = "none"; + } + current = element; + element.style.display = ""; + } + addButton("Home", false, () => { + setElem(home); + }) + addButton("EmulatorJS License", false, () => { + setElem(license); + }) + addButton("RetroArch License", false, () => { + setElem(retroarch); + }) + //Todo - Core specific licenses, contributors. + + retroarch.innerText = "This project is powered by "; + const a = this.createElement("a"); + a.href = "https://github.com/libretro/RetroArch"; + a.target = "_blank"; + a.innerText = "RetroArch"; + retroarch.appendChild(a); + const licenseLink = this.createElement("a"); + licenseLink.target = "_blank"; + licenseLink.href = "https://github.com/libretro/RetroArch/blob/master/COPYING"; + licenseLink.innerText = "View the RetroArch license here."; + a.appendChild(this.createElement("br")); + a.appendChild(licenseLink); + + license.style['text-align'] = "center"; + license.style['padding'] = "10px"; + //license.style["white-space"] = "pre-wrap"; + license.innerText = ' GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. \n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users. We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors. You can apply it to\nyour programs, too.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights. Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received. You must make sure that they, too, receive\nor can get the source code. And you must show them these terms so they\nknow their rights.\n\n Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n For the developers\' and authors\' protection, the GPL clearly explains\nthat there is no warranty for this free software. For both users\' and\nauthors\' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so. This is fundamentally incompatible with the aim of\nprotecting users\' freedom to change the software. The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts. If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary. To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n "This License" refers to version 3 of the GNU General Public License.\n\n "Copyright" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n "The Program" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as "you". "Licensees" and\n"recipients" may be individuals or organizations.\n\n To "modify" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a "modified version" of the\nearlier work or a work "based on" the earlier work.\n\n A "covered work" means either the unmodified Program or a work based\non the Program.\n\n To "propagate" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To "convey" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays "Appropriate Legal Notices"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The "source code" for a work means the preferred form of the work\nfor making modifications to it. "Object code" means any non-source\nform of a work.\n\n A "Standard Interface" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The "System Libraries" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n"Major Component", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The "Corresponding Source" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work\'s\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users\' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work\'s\nusers, your or third parties\' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program\'s source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n "keep intact all notices".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n"aggregate" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation\'s users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A "User Product" is either (1) a "consumer product", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, "normally used" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n "Installation Information" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n "Additional permissions" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered "further\nrestrictions" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An "entity transaction" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party\'s predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A "contributor" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor\'s "contributor version".\n\n A contributor\'s "essential patent claims" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, "control" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor\'s essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a "patent license" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To "grant" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. "Knowingly relying" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient\'s use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is "discriminatory" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others\' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time. Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License "or any later version" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy\'s\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How to Apply These Terms to Your New Programs\n\n If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n To do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe "copyright" line and a pointer to where the full notice is found.\n\n EmulatorJS: RetroArch on the web\n Copyright (C) 2023 Ethan O\'Brien\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see .\n\nAlso add information on how to contact you by electronic and paper mail.\n\n If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n EmulatorJS Copyright (C) 2023 Ethan O\'Brien\n This program comes with ABSOLUTELY NO WARRANTY; for details type `show w\'.\n This is free software, and you are welcome to redistribute it\n under certain conditions; type `show c\' for details.\n\nThe hypothetical commands `show w\' and `show c\' should show the appropriate\nparts of the General Public License. Of course, your program\'s commands\nmight be different; for a GUI interface, you would use an "about box".\n\n You should also get your employer (if you work as a programmer) or school,\nif any, to sign a "copyright disclaimer" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n.\n\n The GNU General Public License does not permit incorporating your program\ninto proprietary programs. If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library. If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License. But first, please read\n.\n'; + }); + + if (this.config.buttonOpts) { + if (this.config.buttonOpts.screenshot === false) screenshot.setAttribute("hidden", ""); + if (this.config.buttonOpts.quickSave === false) qSave.setAttribute("hidden", ""); + if (this.config.buttonOpts.quickLoad === false) qLoad.setAttribute("hidden", ""); + } + + this.elements.contextmenu.appendChild(parent); + + this.elements.parent.appendChild(this.elements.contextmenu); + } + closePopup() { + if (this.currentPopup !== null) { + try { + this.currentPopup.remove(); + } catch(e){} + this.currentPopup = null; + } + } + //creates a full box popup. + createPopup(popupTitle, buttons, hidden) { + if (!hidden) this.closePopup(); + const popup = this.createElement('div'); + popup.classList.add("ejs_popup_container"); + this.elements.parent.appendChild(popup); + const title = this.createElement("h4"); + title.innerText = this.localization(popupTitle); + const main = this.createElement("div"); + main.classList.add("ejs_popup_body"); + + popup.appendChild(title); + popup.appendChild(main); + + for (let k in buttons) { + const button = this.createElement("a"); + if (buttons[k] instanceof Function) { + button.addEventListener("click", (e) => { + buttons[k](); + e.preventDefault(); + }); + } + button.classList.add("ejs_button"); + button.innerText = this.localization(k); + popup.appendChild(button); + } + if (!hidden) { + this.currentPopup = popup; + } else { + popup.style.display = "none"; + } + + return main; + } + selectFile() { + return new Promise((resolve, reject) => { + const file = this.createElement("input"); + file.type = "file"; + this.addEventListener(file, "change", (e) => { + resolve(e.target.files[0]); + }) + file.click(); + }) + } + isPopupOpen() { + return this.cheatMenu.style.display !== "none" || this.netplayMenu.style.display !== "none" || this.controlMenu.style.display !== "none" || this.currentPopup !== null; + } + isChild(first, second) { + if (!first || !second) return false; + const adown = first.nodeType === 9 ? first.documentElement : first; + + if (first === second) return true; + + if (adown.contains) { + return adown.contains(second); + } + + return first.compareDocumentPosition && first.compareDocumentPosition(second) & 16; + } + createBottomMenuBar() { + this.elements.menu = this.createElement("div"); + this.elements.menu.classList.add("ejs_menu_bar"); + this.elements.menu.classList.add("ejs_menu_bar_hidden"); + + let timeout = null; + let ignoreEvents = false; + const hide = () => { + if (this.paused || this.settingsMenuOpen) return; + this.elements.menu.classList.add("ejs_menu_bar_hidden"); + } + + this.addEventListener(this.elements.parent, 'mousemove click', (e) => { + if (e.pointerType === "touch") return; + if (!this.started || ignoreEvents || document.pointerLockElement === this.canvas) return; + if (this.isPopupOpen()) return; + clearTimeout(timeout); + timeout = setTimeout(hide, 3000); + this.elements.menu.classList.remove("ejs_menu_bar_hidden"); + }) + this.addEventListener(this.elements.menu, 'touchstart touchend', (e) => { + if (!this.started) return; + if (this.isPopupOpen()) return; + clearTimeout(timeout); + timeout = setTimeout(hide, 3000); + this.elements.menu.classList.remove("ejs_menu_bar_hidden"); + }) + this.menu = { + close: () => { + if (!this.started) return; + clearTimeout(timeout); + this.elements.menu.classList.add("ejs_menu_bar_hidden"); + }, + open: () => { + if (!this.started) return; + clearTimeout(timeout); + timeout = setTimeout(hide, 3000); + this.elements.menu.classList.remove("ejs_menu_bar_hidden"); + }, + toggle: () => { + if (!this.started) return; + clearTimeout(timeout); + if (this.elements.menu.classList.contains("ejs_menu_bar_hidden")) { + timeout = setTimeout(hide, 3000); + } + this.elements.menu.classList.toggle("ejs_menu_bar_hidden"); + + } + } + this.elements.parent.appendChild(this.elements.menu); + + let tmout; + this.addEventListener(this.elements.parent, "mousedown touchstart", (e) => { + if (this.isChild(this.elements.menu, e.target) || this.isChild(this.elements.menuToggle, e.target)) return; + if (!this.started || this.elements.menu.classList.contains("ejs_menu_bar_hidden") || this.isPopupOpen()) return; + const width = this.elements.parent.getBoundingClientRect().width; + if (width > 575) return; + clearTimeout(tmout); + tmout = setTimeout(() => { + ignoreEvents = false; + }, 2000) + ignoreEvents = true; + this.menu.close(); + }) + + + //Now add buttons + const addButton = (title, image, callback, element, both) => { + const button = this.createElement("button"); + button.type = "button"; + const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + svg.setAttribute("role", "presentation"); + svg.setAttribute("focusable", "false"); + svg.innerHTML = image; + const text = this.createElement("span"); + text.innerText = this.localization(title); + if (title == "Enter Fullscreen" || title == "Exit Fullscreen") text.classList.add("ejs_menu_text_right"); + text.classList.add("ejs_menu_text"); + + button.classList.add("ejs_menu_button"); + button.appendChild(svg); + button.appendChild(text); + if (element) { + element.appendChild(button); + } else { + this.elements.menu.appendChild(button); + } + if (callback instanceof Function) { + this.addEventListener(button, 'click', callback); + } + return both ? [button, svg, text] : button; + } + + //todo. Center text on not restart button + + const restartButton = addButton("Restart", '', () => { + if (this.isNetplay && this.netplay.owner) { + this.gameManager.saveSaveFiles(); + this.gameManager.restart(); + this.netplay.reset(); + this.netplay.sendMessage({restart:true}); + this.play(); + } else if (!this.isNetplay) { + this.gameManager.saveSaveFiles(); + this.gameManager.restart(); + } + }); + const pauseButton = addButton("Pause", '', () => { + if (this.isNetplay && this.netplay.owner) { + this.pause(); + this.netplay.sendMessage({pause:true}); + } else if (!this.isNetplay) { + this.pause(); + } + }); + const playButton = addButton("Play", '', () => { + if (this.isNetplay && this.netplay.owner) { + this.play(); + this.netplay.sendMessage({play:true}); + } else if (!this.isNetplay) { + this.play(); + } + }); + playButton.style.display = "none"; + this.togglePlaying = (dontUpdate) => { + this.paused = !this.paused; + if (!dontUpdate) { + if (this.paused) { + pauseButton.style.display = "none"; + playButton.style.display = ""; + } else { + pauseButton.style.display = ""; + playButton.style.display = "none"; + } + } + this.gameManager.toggleMainLoop(this.paused ? 0 : 1); + + //I now realize its not easy to pause it while the cursor is locked, just in case I guess + if (this.getCore(true) === "nds") { + if (this.canvas.exitPointerLock) { + this.canvas.exitPointerLock(); + } else if (this.canvas.mozExitPointerLock) { + this.canvas.mozExitPointerLock(); + } + } + } + this.play = (dontUpdate) => { + if (this.paused) this.togglePlaying(dontUpdate); + } + this.pause = (dontUpdate) => { + if (!this.paused) this.togglePlaying(dontUpdate); + } + + let stateUrl; + const saveState = addButton("Save State", '', async () => { + const state = await this.gameManager.getState(); + const called = this.callEvent("save", { + screenshot: this.gameManager.screenshot(), + state: state + }); + if (called > 0) return; + if (stateUrl) URL.revokeObjectURL(stateUrl); + if (this.settings['save-state-location'] === "browser" && this.saveInBrowserSupported()) { + this.storage.states.put(this.getBaseFileName()+".state", state); + this.displayMessage(this.localization("SAVE SAVED TO BROWSER")); + } else { + const blob = new Blob([state]); + stateUrl = URL.createObjectURL(blob); + const a = this.createElement("a"); + a.href = stateUrl; + a.download = this.getBaseFileName()+".state"; + a.click(); + } + }); + const loadState = addButton("Load State", '', async () => { + const called = this.callEvent("load"); + if (called > 0) return; + if (this.settings['save-state-location'] === "browser" && this.saveInBrowserSupported()) { + this.storage.states.get(this.getBaseFileName()+".state").then(e => { + this.gameManager.loadState(e); + this.displayMessage(this.localization("SAVE LOADED FROM BROWSER")); + }) + } else { + const file = await this.selectFile(); + const state = new Uint8Array(await file.arrayBuffer()); + this.gameManager.loadState(state); + } + }); + const controlMenu = addButton("Control Settings", '', () => { + this.controlMenu.style.display = ""; + }); + const cheatMenu = addButton("Cheats", '', () => { + this.cheatMenu.style.display = ""; + }); + + const cache = addButton("Cache Manager", '', () => { + this.openCacheMenu(); + }); + + let savUrl; + + const saveSavFiles = addButton("Export Save File", '', async () => { + const file = await this.gameManager.getSaveFile(); + const blob = new Blob([file]); + savUrl = URL.createObjectURL(blob); + const a = this.createElement("a"); + a.href = savUrl; + a.download = this.gameManager.getSaveFilePath().split("/").pop(); + a.click(); + }); + const loadSavFiles = addButton("Import Save File", '', async () => { + const file = await this.selectFile(); + const sav = new Uint8Array(await file.arrayBuffer()); + const path = this.gameManager.getSaveFilePath(); + const paths = path.split("/"); + let cp = ""; + for (let i=0; i', async () => { + this.openNetplayMenu(); + }); + + const spacer = this.createElement("span"); + spacer.classList.add("ejs_menu_bar_spacer"); + this.elements.menu.appendChild(spacer); + + const volumeSettings = this.createElement("div"); + volumeSettings.classList.add("ejs_volume_parent"); + const muteButton = addButton("Mute", '', () => { + muteButton.style.display = "none"; + unmuteButton.style.display = ""; + this.muted = true; + this.setVolume(0); + }, volumeSettings); + const unmuteButton = addButton("Unmute", '', () => { + if (this.volume === 0) this.volume = 0.5; + muteButton.style.display = ""; + unmuteButton.style.display = "none"; + this.muted = false; + this.setVolume(this.volume); + }, volumeSettings); + unmuteButton.style.display = "none"; + + const volumeSlider = this.createElement("input"); + volumeSlider.setAttribute("data-range", "volume"); + volumeSlider.setAttribute("type", "range"); + volumeSlider.setAttribute("min", 0); + volumeSlider.setAttribute("max", 1); + volumeSlider.setAttribute("step", 0.01); + volumeSlider.setAttribute("autocomplete", "off"); + volumeSlider.setAttribute("role", "slider"); + volumeSlider.setAttribute("aria-label", "Volume"); + volumeSlider.setAttribute("aria-valuemin", 0); + volumeSlider.setAttribute("aria-valuemax", 100); + + this.setVolume = (volume) => { + this.saveSettings(); + this.muted = (volume === 0); + volumeSlider.value = volume; + volumeSlider.setAttribute("aria-valuenow", volume*100); + volumeSlider.setAttribute("aria-valuetext", (volume*100).toFixed(1) + "%"); + volumeSlider.setAttribute("style", "--value: "+volume*100+"%;margin-left: 5px;position: relative;z-index: 2;"); + if (window.AL && AL.currentCtx && AL.currentCtx.sources) { + AL.currentCtx.sources.forEach(e => { + e.gain.gain.value = volume; + }) + } + if (!this.config.buttonOpts || this.config.buttonOpts.mute !== false) { + unmuteButton.style.display = (volume === 0) ? "" : "none"; + muteButton.style.display = (volume === 0) ? "none" : ""; + } + } + + this.addEventListener(volumeSlider, "change mousemove touchmove mousedown touchstart mouseup", (e) => { + setTimeout(() => { + const newVal = parseFloat(volumeSlider.value); + if (newVal === 0 && this.muted) return; + this.volume = newVal; + this.setVolume(this.volume); + }, 5); + }) + + if (!this.config.buttonOpts || this.config.buttonOpts.volume !== false) { + volumeSettings.appendChild(volumeSlider); + } + + this.elements.menu.appendChild(volumeSettings); + + this.settingParent = this.createElement("div"); + this.settingsMenuOpen = false; + const settingButton = addButton("Settings", '', () => { + this.settingsMenuOpen = !this.settingsMenuOpen; + settingButton[1].classList.toggle("ejs_svg_rotate", this.settingsMenuOpen); + this.settingsMenu.style.display = this.settingsMenuOpen ? "" : "none"; + settingButton[2].classList.toggle("ejs_settings_text", this.settingsMenuOpen); + }, this.settingParent, true); + this.elements.menu.appendChild(this.settingParent); + this.closeSettingsMenu = () => { + if (!this.settingsMenu) return; + this.settingsMenuOpen = false; + settingButton[1].classList.toggle("ejs_svg_rotate", this.settingsMenuOpen); + settingButton[2].classList.toggle("ejs_settings_text", this.settingsMenuOpen); + this.settingsMenu.style.display = "none"; + } + this.addEventListener(this.elements.parent, "mousedown touchstart", (e) => { + if (this.isChild(this.settingsMenu, e.target)) return; + if (e.pointerType === "touch") return; + if (e.target === settingButton[0] || e.target === settingButton[2]) return; + this.closeSettingsMenu(); + }) + this.addEventListener(this.canvas, "click", (e) => { + if (e.pointerType === "touch") return; + if (this.getCore(true) === "nds" && !this.paused) { + if (this.canvas.requestPointerLock) { + this.canvas.requestPointerLock(); + } else if (this.canvas.mozRequestPointerLock) { + this.canvas.mozRequestPointerLock(); + } + this.menu.close(); + } + }) + + const enter = addButton("Enter Fullscreen", '', () => { + this.toggleFullscreen(true); + }); + const exit = addButton("Exit Fullscreen", '', () => { + this.toggleFullscreen(false); + }); + exit.style.display = "none"; + + this.toggleFullscreen = (fullscreen) => { + if (fullscreen) { + if (this.elements.parent.requestFullscreen) { + this.elements.parent.requestFullscreen(); + } else if (this.elements.parent.mozRequestFullScreen) { + this.elements.parent.mozRequestFullScreen(); + } else if (this.elements.parent.webkitRequestFullscreen) { + this.elements.parent.webkitRequestFullscreen(); + } else if (this.elements.parent.msRequestFullscreen) { + this.elements.parent.msRequestFullscreen(); + } + exit.style.display = ""; + enter.style.display = "none"; + if (this.isMobile) { + try { + screen.orientation.lock(this.getCore(true) === "nds" ? "portrait" : "landscape").catch(e => {});; + } catch(e) {} + } + } else { + if (document.exitFullscreen) { + document.exitFullscreen(); + } else if (document.webkitExitFullscreen) { + document.webkitExitFullscreen(); + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if (document.msExitFullscreen) { + document.msExitFullscreen(); + } + exit.style.display = "none"; + enter.style.display = ""; + if (this.isMobile) { + try { + screen.orientation.unlock(); + } catch(e) {} + } + } + } + + + this.addEventListener(document, "webkitfullscreenchange mozfullscreenchange fullscreenchange", (e) => { + if (e.target !== this.elements.parent) return; + if (document.fullscreenElement === null) { + exit.style.display = "none"; + enter.style.display = ""; + } else { + //not sure if this is possible, lets put it here anyways + exit.style.display = ""; + enter.style.display = "none"; + } + }) + + const hasFullscreen = !!(this.elements.parent.requestFullscreen || this.elements.parent.mozRequestFullScreen || this.elements.parent.webkitRequestFullscreen || this.elements.parent.msRequestFullscreen); + + if (!hasFullscreen) { + exit.style.display = "none"; + enter.style.display = "none"; + } + + this.elements.bottomBar = { + playPause: [pauseButton, playButton], + restart: [restartButton], + settings: [settingButton], + fullscreen: [enter, exit], + saveState: [saveState], + loadState: [loadState], + gamepad: [controlMenu], + cheat: [cheatMenu], + cacheManager: [cache], + saveSavFiles: [saveSavFiles], + loadSavFiles: [loadSavFiles], + netplay: [netplay] + } + + + if (this.config.buttonOpts) { + if (this.debug) console.log(this.config.buttonOpts); + if (this.config.buttonOpts.playPause === false) { + pauseButton.style.display = "none"; + playButton.style.display = "none"; + } + if (this.config.buttonOpts.restart === false) restartButton.style.display = "none" + if (this.config.buttonOpts.settings === false) settingButton[0].style.display = "none" + if (this.config.buttonOpts.fullscreen === false) { + enter.style.display = "none"; + exit.style.display = "none"; + } + if (this.config.buttonOpts.mute === false) { + muteButton.style.display = "none"; + unmuteButton.style.display = "none"; + } + if (this.config.buttonOpts.saveState === false) saveState.style.display = "none" + if (this.config.buttonOpts.loadState === false) loadState.style.display = "none" + if (this.config.buttonOpts.saveSavFiles === false) saveSavFiles.style.display = "none" + if (this.config.buttonOpts.loadSavFiles === false) loadSavFiles.style.display = "none" + if (this.config.buttonOpts.gamepad === false) controlMenu.style.display = "none" + if (this.config.buttonOpts.cheat === false) cheatMenu.style.display = "none" + if (this.config.buttonOpts.cacheManager === false) cache.style.display = "none" + if (this.config.buttonOpts.netplay === false) netplay.style.display = "none" + } + } + openCacheMenu() { + (async () => { + const list = this.createElement("table"); + const tbody = this.createElement("tbody"); + const body = this.createPopup("Cache Manager", { + "Clear All": async () => { + const roms = await this.storage.rom.getSizes(); + for (const k in roms) { + await this.storage.rom.remove(k); + } + tbody.innerHTML = ""; + }, + "Close": () => { + this.closePopup(); + } + }); + const roms = await this.storage.rom.getSizes(); + list.style.width = "100%"; + list.style["padding-left"] = "10px"; + list.style["text-align"] = "left"; + body.appendChild(list); + list.appendChild(tbody); + const getSize = function(size) { + let i = -1; + do { + size /= 1024, i++; + } while (size > 1024); + return Math.max(size, 0.1).toFixed(1) + [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'][i]; + } + for (const k in roms) { + const line = this.createElement("tr"); + const name = this.createElement("td"); + const size = this.createElement("td"); + const remove = this.createElement("td"); + remove.style.cursor = "pointer"; + name.innerText = k; + size.innerText = getSize(roms[k]); + + const a = this.createElement("a"); + a.innerText = this.localization("Remove"); + this.addEventListener(remove, "click", () => { + this.storage.rom.remove(k); + line.remove(); + }) + remove.appendChild(a); + + line.appendChild(name); + line.appendChild(size); + line.appendChild(remove); + tbody.appendChild(line); + } + + })(); + } + getControlScheme() { + if (this.config.controlScheme && typeof this.config.controlScheme === 'string') { + return this.config.controlScheme; + } else { + return this.getCore(true); + } + } + createControlSettingMenu() { + let buttonListeners = []; + this.checkGamepadInputs = () => buttonListeners.forEach(elem => elem()); + this.gamepadLabels = []; + this.controls = JSON.parse(JSON.stringify(this.defaultControllers)); + const body = this.createPopup("Control Settings", { + "Reset": () => { + this.controls = JSON.parse(JSON.stringify(this.defaultControllers)); + this.setupKeys(); + this.checkGamepadInputs(); + this.saveSettings(); + }, + "Clear": () => { + this.controls = {0:{},1:{},2:{},3:{}}; + this.setupKeys(); + this.checkGamepadInputs(); + this.saveSettings(); + }, + "Close": () => { + this.controlMenu.style.display = "none"; + } + }, true); + this.setupKeys(); + this.controlMenu = body.parentElement; + body.classList.add("ejs_control_body"); + + let buttons; + if (['nes', 'gb'].includes(this.getControlScheme())) { + buttons = [ + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('snes' === this.getControlScheme()) { + buttons = [ + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 9, label: this.localization('X')}, + {id: 1, label: this.localization('Y')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + ]; + } else if ('n64' === this.getControlScheme()) { + buttons = [ + {id: 0, label: this.localization('A')}, + {id: 1, label: this.localization('B')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('D-PAD UP')}, + {id: 5, label: this.localization('D-PAD DOWN')}, + {id: 6, label: this.localization('D-PAD LEFT')}, + {id: 7, label: this.localization('D-PAD RIGHT')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 12, label: this.localization('Z')}, + {id: 19, label: this.localization('STICK UP')}, + {id: 18, label: this.localization('STICK DOWN')}, + {id: 17, label: this.localization('STICK LEFT')}, + {id: 16, label: this.localization('STICK RIGHT')}, + {id: 23, label: this.localization('C-PAD UP')}, + {id: 22, label: this.localization('C-PAD DOWN')}, + {id: 21, label: this.localization('C-PAD LEFT')}, + {id: 20, label: this.localization('C-PAD RIGHT')}, + ]; + } else if ('gba' === this.getControlScheme()) { + buttons = [ + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('nds' === this.getControlScheme()) { + buttons = [ + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 9, label: this.localization('X')}, + {id: 1, label: this.localization('Y')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 14, label: this.localization('Microphone')}, + ]; + } else if ('vb' === this.getControlScheme()) { + buttons = [ + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('LEFT D-PAD UP')}, + {id: 5, label: this.localization('LEFT D-PAD DOWN')}, + {id: 6, label: this.localization('LEFT D-PAD LEFT')}, + {id: 7, label: this.localization('LEFT D-PAD RIGHT')}, + {id: 19, label: this.localization('RIGHT D-PAD UP')}, + {id: 18, label: this.localization('RIGHT D-PAD DOWN')}, + {id: 17, label: this.localization('RIGHT D-PAD LEFT')}, + {id: 16, label: this.localization('RIGHT D-PAD RIGHT')}, + ]; + } else if (['segaMD', 'segaCD', 'sega32x'].includes(this.getControlScheme())) { + buttons = [ + {id: 1, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 8, label: this.localization('C')}, + {id: 10, label: this.localization('X')}, + {id: 9, label: this.localization('Y')}, + {id: 11, label: this.localization('Z')}, + {id: 3, label: this.localization('START')}, + {id: 2, label: this.localization('MODE')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('segaMS' === this.getControlScheme()) { + buttons = [ + {id: 0, label: this.localization('BUTTON 1 / START')}, + {id: 8, label: this.localization('BUTTON 2')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('segaGG' === this.getControlScheme()) { + buttons = [ + {id: 0, label: this.localization('BUTTON 1')}, + {id: 8, label: this.localization('BUTTON 2')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('segaSaturn' === this.getControlScheme()) { + buttons = [ + {id: 1, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 8, label: this.localization('C')}, + {id: 9, label: this.localization('X')}, + {id: 10, label: this.localization('Y')}, + {id: 11, label: this.localization('Z')}, + {id: 12, label: this.localization('L')}, + {id: 13, label: this.localization('R')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('3do' === this.getControlScheme()) { + buttons = [ + {id: 1, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 8, label: this.localization('C')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 2, label: this.localization('X')}, + {id: 3, label: this.localization('P')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('atari2600' === this.getControlScheme()) { + buttons = [ + {id: 0, label: this.localization('FIRE')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('RESET')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + {id: 10, label: this.localization('LEFT DIFFICULTY A')}, + {id: 12, label: this.localization('LEFT DIFFICULTY B')}, + {id: 11, label: this.localization('RIGHT DIFFICULTY A')}, + {id: 13, label: this.localization('RIGHT DIFFICULTY B')}, + {id: 14, label: this.localization('COLOR')}, + {id: 15, label: this.localization('B/W')}, + ]; + } else if ('atari7800' === this.getControlScheme()) { + buttons = [ + {id: 0, label: this.localization('BUTTON 1')}, + {id: 8, label: this.localization('BUTTON 2')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('PAUSE')}, + {id: 9, label: this.localization('RESET')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + {id: 10, label: this.localization('LEFT DIFFICULTY')}, + {id: 11, label: this.localization('RIGHT DIFFICULTY')}, + ]; + } else if ('lynx' === this.getControlScheme()) { + buttons = [ + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 10, label: this.localization('OPTION 1')}, + {id: 11, label: this.localization('OPTION 2')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('jaguar' === this.getControlScheme()) { + buttons = [ + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 1, label: this.localization('C')}, + {id: 2, label: this.localization('PAUSE')}, + {id: 3, label: this.localization('OPTION')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('pce' === this.getControlScheme()) { + buttons = [ + {id: 8, label: this.localization('I')}, + {id: 0, label: this.localization('II')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('RUN')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('ngp' === this.getControlScheme()) { + buttons = [ + {id: 0, label: this.localization('A')}, + {id: 8, label: this.localization('B')}, + {id: 3, label: this.localization('OPTION')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('ws' === this.getControlScheme()) { + buttons = [ + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('X UP')}, + {id: 5, label: this.localization('X DOWN')}, + {id: 6, label: this.localization('X LEFT')}, + {id: 7, label: this.localization('X RIGHT')}, + {id: 13, label: this.localization('Y UP')}, + {id: 12, label: this.localization('Y DOWN')}, + {id: 10, label: this.localization('Y LEFT')}, + {id: 11, label: this.localization('Y RIGHT')}, + ]; + } else if ('coleco' === this.getControlScheme()) { + buttons = [ + {id: 8, label: this.localization('LEFT BUTTON')}, + {id: 0, label: this.localization('RIGHT BUTTON')}, + {id: 9, label: this.localization('1')}, + {id: 1, label: this.localization('2')}, + {id: 11, label: this.localization('3')}, + {id: 10, label: this.localization('4')}, + {id: 13, label: this.localization('5')}, + {id: 12, label: this.localization('6')}, + {id: 15, label: this.localization('7')}, + {id: 14, label: this.localization('8')}, + {id: 2, label: this.localization('*')}, + {id: 3, label: this.localization('#')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else if ('pcfx' === this.getControlScheme()) { + buttons = [ + {id: 8, label: this.localization('I')}, + {id: 0, label: this.localization('II')}, + {id: 9, label: this.localization('III')}, + {id: 1, label: this.localization('IV')}, + {id: 10, label: this.localization('V')}, + {id: 11, label: this.localization('VI')}, + {id: 3, label: this.localization('RUN')}, + {id: 2, label: this.localization('SELECT')}, + {id: 12, label: this.localization('MODE1')}, + {id: 13, label: this.localization('MODE2')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + ]; + } else { + buttons = [ + {id: 0, label: this.localization('B')}, + {id: 1, label: this.localization('Y')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + {id: 8, label: this.localization('A')}, + {id: 9, label: this.localization('X')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 12, label: this.localization('L2')}, + {id: 13, label: this.localization('R2')}, + {id: 14, label: this.localization('L3')}, + {id: 15, label: this.localization('R3')}, + {id: 19, label: this.localization('L STICK UP')}, + {id: 18, label: this.localization('L STICK DOWN')}, + {id: 17, label: this.localization('L STICK LEFT')}, + {id: 16, label: this.localization('L STICK RIGHT')}, + {id: 23, label: this.localization('R STICK UP')}, + {id: 22, label: this.localization('R STICK DOWN')}, + {id: 21, label: this.localization('R STICK LEFT')}, + {id: 20, label: this.localization('R STICK RIGHT')}, + ]; + } + if (['arcade', 'mame'].includes(this.getControlScheme())) { + for (const buttonIdx in buttons) { + if (buttons[buttonIdx].id === 2) { + buttons[buttonIdx].label = this.localization('INSERT COIN'); + } + } + } + buttons.push( + {id: 24, label: this.localization('QUICK SAVE STATE')}, + {id: 25, label: this.localization('QUICK LOAD STATE')}, + {id: 26, label: this.localization('CHANGE STATE SLOT')}, + {id: 27, label: this.localization('FAST FORWARD')}, + {id: 29, label: this.localization('SLOW MOTION')}, + {id: 28, label: this.localization('REWIND')} + ); + //if (_this.statesSupported === false) { + // delete buttons[24]; + // delete buttons[25]; + // delete buttons[26]; + //} + let selectedPlayer; + let players = []; + let playerDivs = []; + + const playerSelect = this.createElement("ul"); + playerSelect.classList.add("ejs_control_player_bar"); + for (let i=1; i<5; i++) { + const playerContainer = this.createElement("li"); + playerContainer.classList.add("tabs-title"); + playerContainer.setAttribute("role", "presentation"); + const player = this.createElement("a"); + player.innerText = this.localization("Player")+" "+i; + player.setAttribute("role", "tab"); + player.setAttribute("aria-controls", "controls-"+(i-1)); + player.setAttribute("aria-selected", "false"); + player.id = "controls-"+(i-1)+"-label"; + this.addEventListener(player, "click", (e) => { + e.preventDefault(); + players[selectedPlayer].classList.remove("ejs_control_selected"); + playerDivs[selectedPlayer].setAttribute("hidden", ""); + selectedPlayer = i-1; + players[i-1].classList.add("ejs_control_selected"); + playerDivs[i-1].removeAttribute("hidden"); + }) + playerContainer.appendChild(player); + playerSelect.appendChild(playerContainer); + players.push(playerContainer); + } + body.appendChild(playerSelect); + + const controls = this.createElement("div"); + for (let i=0; i<4; i++) { + if (!this.controls[i]) this.controls[i] = {}; + const player = this.createElement("div"); + const playerTitle = this.createElement("div"); + + const gamepadTitle = this.createElement("div"); + gamepadTitle.style = "font-size:12px;"; + gamepadTitle.innerText = this.localization("Connected Gamepad")+": "; + + const gamepadName = this.createElement("span"); + this.gamepadLabels.push(gamepadName); + gamepadName.innerText = "n/a"; + gamepadTitle.appendChild(gamepadName); + + const leftPadding = this.createElement("div"); + leftPadding.style = "width:25%;float:left;"; + leftPadding.innerHTML = " "; + + const aboutParent = this.createElement("div"); + aboutParent.style = "font-size:12px;width:50%;float:left;"; + const gamepad = this.createElement("div"); + gamepad.style = "text-align:center;width:50%;float:left;"; + gamepad.innerText = this.localization("Gamepad"); + aboutParent.appendChild(gamepad); + const keyboard = this.createElement("div"); + keyboard.style = "text-align:center;width:50%;float:left;"; + keyboard.innerText = this.localization("Keyboard"); + aboutParent.appendChild(keyboard); + + const headingPadding = this.createElement("div"); + headingPadding.style = "clear:both;"; + + playerTitle.appendChild(gamepadTitle); + playerTitle.appendChild(leftPadding); + playerTitle.appendChild(aboutParent); + + if ((this.touch || navigator.maxTouchPoints > 0) && i === 0) { + const vgp = this.createElement("div"); + vgp.style = "width:25%;float:right;clear:none;padding:0;font-size: 11px;padding-left: 2.25rem;"; + vgp.classList.add("ejs_control_row"); + vgp.classList.add("ejs_cheat_row"); + const input = this.createElement("input"); + input.type = "checkbox"; + input.checked = true; + input.value = "o"; + input.id = "ejs_vp"; + vgp.appendChild(input); + const label = this.createElement("label"); + label.for = "ejs_vp"; + label.innerText = "Virtual Gamepad"; + vgp.appendChild(label); + label.addEventListener("click", (e) => { + input.checked = !input.checked; + this.changeSettingOption('virtual-gamepad', input.checked ? 'enabled' : "disabled"); + }) + this.on("start", (e) => { + if (this.settings["virtual-gamepad"] === "disabled") { + input.checked = false; + } + }) + playerTitle.appendChild(vgp); + } + + playerTitle.appendChild(headingPadding); + + + player.appendChild(playerTitle); + + for (const buttonIdx in buttons) { + const k = buttons[buttonIdx].id; + const controlLabel = buttons[buttonIdx].label; + + const buttonText = this.createElement("div"); + buttonText.setAttribute("data-id", k); + buttonText.setAttribute("data-index", i); + buttonText.setAttribute("data-label", controlLabel); + buttonText.style = "margin-bottom:10px;"; + buttonText.classList.add("ejs_control_bar"); + + + const title = this.createElement("div"); + title.style = "width:25%;float:left;font-size:12px;"; + const label = this.createElement("label"); + label.innerText = controlLabel+":"; + title.appendChild(label); + + const textBoxes = this.createElement("div"); + textBoxes.style = "width:50%;float:left;"; + + const textBox1Parent = this.createElement("div"); + textBox1Parent.style = "width:50%;float:left;padding: 0 5px;"; + const textBox1 = this.createElement("input"); + textBox1.style = "text-align:center;height:25px;width: 100%;"; + textBox1.type = "text"; + textBox1.setAttribute("readonly", ""); + textBox1.setAttribute("placeholder", ""); + textBox1Parent.appendChild(textBox1); + + const textBox2Parent = this.createElement("div"); + textBox2Parent.style = "width:50%;float:left;padding: 0 5px;"; + const textBox2 = this.createElement("input"); + textBox2.style = "text-align:center;height:25px;width: 100%;"; + textBox2.type = "text"; + textBox2.setAttribute("readonly", ""); + textBox2.setAttribute("placeholder", ""); + textBox2Parent.appendChild(textBox2); + + buttonListeners.push(() => { + textBox2.value = ""; + textBox1.value = ""; + if (this.controls[i][k] && this.controls[i][k].value !== undefined) { + let value = this.keyMap[this.controls[i][k].value]; + value = this.localization(value); + textBox2.value = value; + } + if (this.controls[i][k] && this.controls[i][k].value2 !== undefined && this.controls[i][k].value2 !== "") { + let value2 = this.controls[i][k].value2.toString(); + if (value2.includes(":")) { + value2 = value2.split(":"); + value2 = this.localization(value2[0]) + ":" + this.localization(value2[1]) + } else if (!isNaN(value2)){ + value2 = this.localization("BUTTON")+" "+this.localization(value2); + } else { + value2 = this.localization(value2); + } + textBox1.value = value2; + } + }) + + if (this.controls[i][k] && this.controls[i][k].value) { + let value = this.keyMap[this.controls[i][k].value]; + value = this.localization(value); + textBox2.value = value; + } + if (this.controls[i][k] && this.controls[i][k].value2) { + let value2 = this.controls[i][k].value2.toString(); + if (value2.includes(":")) { + value2 = value2.split(":"); + value2 = this.localization(value2[0]) + ":" + this.localization(value2[1]) + } else if (!isNaN(value2)){ + value2 = this.localization("BUTTON")+" "+this.localization(value2); + } else { + value2 = this.localization(value2); + } + textBox1.value = value2; + } + + textBoxes.appendChild(textBox1Parent); + textBoxes.appendChild(textBox2Parent); + + const padding = this.createElement("div"); + padding.style = "clear:both;"; + textBoxes.appendChild(padding); + + const setButton = this.createElement("div"); + setButton.style = "width:25%;float:left;"; + const button = this.createElement("a"); + button.classList.add("ejs_control_set_button"); + button.innerText = this.localization("Set"); + setButton.appendChild(button); + + const padding2 = this.createElement("div"); + padding2.style = "clear:both;"; + + buttonText.appendChild(title); + buttonText.appendChild(textBoxes); + buttonText.appendChild(setButton); + buttonText.appendChild(padding2); + + player.appendChild(buttonText); + + this.addEventListener(buttonText, "mousedown", (e) => { + e.preventDefault(); + this.controlPopup.parentElement.parentElement.removeAttribute("hidden"); + this.controlPopup.innerText = "[ " + controlLabel + " ]\n"+this.localization("Press Keyboard"); + this.controlPopup.setAttribute("button-num", k); + this.controlPopup.setAttribute("player-num", i); + }) + } + controls.appendChild(player); + player.setAttribute("hidden", ""); + playerDivs.push(player); + } + body.appendChild(controls); + + + selectedPlayer = 0; + players[0].classList.add("ejs_control_selected"); + playerDivs[0].removeAttribute("hidden"); + + + const popup = this.createElement('div'); + popup.classList.add("ejs_popup_container"); + const popupMsg = this.createElement("div"); + this.addEventListener(popup, "mousedown click touchstart", (e) => { + if (this.isChild(popupMsg, e.target)) return; + this.controlPopup.parentElement.parentElement.setAttribute("hidden", ""); + }) + const btn = this.createElement("a"); + btn.classList.add("ejs_control_set_button"); + btn.innerText = this.localization("Clear"); + this.addEventListener(btn, "mousedown click touchstart", (e) => { + const num = this.controlPopup.getAttribute("button-num"); + const player = this.controlPopup.getAttribute("player-num"); + if (!this.controls[player][num]) { + this.controls[player][num] = {}; + } + this.controls[player][num].value = 0; + this.controls[player][num].value2 = ""; + this.controlPopup.parentElement.parentElement.setAttribute("hidden", ""); + this.checkGamepadInputs(); + this.saveSettings(); + }) + popupMsg.classList.add("ejs_popup_box"); + popupMsg.innerText = ""; + popup.setAttribute("hidden", ""); + const popMsg = this.createElement("div"); + this.controlPopup = popMsg; + popup.appendChild(popupMsg); + popupMsg.appendChild(popMsg); + popupMsg.appendChild(this.createElement("br")); + popupMsg.appendChild(btn); + this.controlMenu.appendChild(popup); + + } + defaultControllers = { + 0: { + 0: { + 'value': 'x', + 'value2': 'BUTTON_2' + }, + 1: { + 'value': 's', + 'value2': 'BUTTON_4' + }, + 2: { + 'value': 'v', + 'value2': 'SELECT' + }, + 3: { + 'value': 'enter', + 'value2': 'START' + }, + 4: { + 'value': 'up arrow', + 'value2': 'DPAD_UP' + }, + 5: { + 'value': 'down arrow', + 'value2': 'DPAD_DOWN' + }, + 6: { + 'value': 'left arrow', + 'value2': 'DPAD_LEFT' + }, + 7: { + 'value': 'right arrow', + 'value2': 'DPAD_RIGHT' + }, + 8: { + 'value': 'z', + 'value2': 'BUTTON_1' + }, + 9: { + 'value': 'a', + 'value2': 'BUTTON_3' + }, + 10: { + 'value': 'q', + 'value2': 'LEFT_TOP_SHOULDER' + }, + 11: { + 'value': 'e', + 'value2': 'RIGHT_TOP_SHOULDER' + }, + 12: { + 'value': 'tab', + 'value2': 'LEFT_BOTTOM_SHOULDER' + }, + 13: { + 'value': 'r', + 'value2': 'RIGHT_BOTTOM_SHOULDER' + }, + 14: { + 'value': '', + 'value2': 'LEFT_STICK', + }, + 15: { + 'value': '', + 'value2': 'RIGHT_STICK', + }, + 16: { + 'value': 'h', + 'value2': 'LEFT_STICK_X:+1' + }, + 17: { + 'value': 'f', + 'value2': 'LEFT_STICK_X:-1' + }, + 18: { + 'value': 'g', + 'value2': 'LEFT_STICK_Y:+1' + }, + 19: { + 'value': 't', + 'value2': 'LEFT_STICK_Y:-1' + }, + 20: { + 'value': 'l', + 'value2': 'RIGHT_STICK_X:+1' + }, + 21: { + 'value': 'j', + 'value2': 'RIGHT_STICK_X:-1' + }, + 22: { + 'value': 'k', + 'value2': 'RIGHT_STICK_Y:+1' + }, + 23: { + 'value': 'i', + 'value2': 'RIGHT_STICK_Y:-1' + }, + 24: { + 'value': '1' + }, + 25: { + 'value': '2' + }, + 26: { + 'value': '3' + }, + 27: {}, + 28: {}, + 29: {}, + }, + 1: {}, + 2: {}, + 3: {} + } + keyMap = { + 0: '', + 8: 'backspace', + 9: 'tab', + 13: 'enter', + 16: 'shift', + 17: 'ctrl', + 18: 'alt', + 19: 'pause/break', + 20: 'caps lock', + 27: 'escape', + 32: 'space', + 33: 'page up', + 34: 'page down', + 35: 'end', + 36: 'home', + 37: 'left arrow', + 38: 'up arrow', + 39: 'right arrow', + 40: 'down arrow', + 45: 'insert', + 46: 'delete', + 48: '0', + 49: '1', + 50: '2', + 51: '3', + 52: '4', + 53: '5', + 54: '6', + 55: '7', + 56: '8', + 57: '9', + 65: 'a', + 66: 'b', + 67: 'c', + 68: 'd', + 69: 'e', + 70: 'f', + 71: 'g', + 72: 'h', + 73: 'i', + 74: 'j', + 75: 'k', + 76: 'l', + 77: 'm', + 78: 'n', + 79: 'o', + 80: 'p', + 81: 'q', + 82: 'r', + 83: 's', + 84: 't', + 85: 'u', + 86: 'v', + 87: 'w', + 88: 'x', + 89: 'y', + 90: 'z', + 91: 'left window key', + 92: 'right window key', + 93: 'select key', + 96: 'numpad 0', + 97: 'numpad 1', + 98: 'numpad 2', + 99: 'numpad 3', + 100: 'numpad 4', + 101: 'numpad 5', + 102: 'numpad 6', + 103: 'numpad 7', + 104: 'numpad 8', + 105: 'numpad 9', + 106: 'multiply', + 107: 'add', + 109: 'subtract', + 110: 'decimal point', + 111: 'divide', + 112: 'f1', + 113: 'f2', + 114: 'f3', + 115: 'f4', + 116: 'f5', + 117: 'f6', + 118: 'f7', + 119: 'f8', + 120: 'f9', + 121: 'f10', + 122: 'f11', + 123: 'f12', + 144: 'num lock', + 145: 'scroll lock', + 186: 'semi-colon', + 187: 'equal sign', + 188: 'comma', + 189: 'dash', + 190: 'period', + 191: 'forward slash', + 192: 'grave accent', + 219: 'open bracket', + 220: 'back slash', + 221: 'close braket', + 222: 'single quote' + } + controls; + setupKeys(){ + for (let i=0; i<4; i++) { + for (let j=0; j<30; j++) { + if (this.controls[i][j] && this.keyMap) { + this.controls[i][j].value = Number(this.keyLookup(this.controls[i][j])); + if(this.controls[i][j].value === -1){ + console.warn("Invalid key for control "+j+" player "+i+" with value "+this.keyMap[this.keyLookup(this.defaultControllers[i][j])]); + } + } + } + } + } + keyLookup(controllerkey){ + for (var key in this.keyMap) { + if (this.keyMap[key] === controllerkey.value || key === controllerkey.value) { + return key; + } else if (controllerkey.value === undefined) { + return 0; + } + } + return -1; + } + keyChange(e) { + if (e.repeat) return; + if (!this.started) return; + if (this.controlPopup.parentElement.parentElement.getAttribute("hidden") === null) { + const num = this.controlPopup.getAttribute("button-num"); + const player = this.controlPopup.getAttribute("player-num"); + if (!this.controls[player][num]) { + this.controls[player][num] = {}; + } + this.controls[player][num].value = e.keyCode; + this.controlPopup.parentElement.parentElement.setAttribute("hidden", ""); + this.checkGamepadInputs(); + this.saveSettings(); + return; + } + if (this.settingsMenu.style.display !== "none" || this.isPopupOpen()) return; + e.preventDefault(); + const special = [16, 17, 18, 19, 20, 21, 22, 23]; + for (let i=0; i<4; i++) { + for (let j=0; j<30; j++) { + if (this.controls[i][j] && this.controls[i][j].value === e.keyCode) { + this.gameManager.simulateInput(i, j, (e.type === 'keyup' ? 0 : (special.includes(j) ? 0x7fff : 1))); + } + } + } + } + gamepadEvent(e) { + if (!this.started) return; + const value = function(value) { + if (value > 0.5 || value < -0.5) { + return (value > 0) ? 1 : -1; + } else { + return 0; + } + }(e.value || 0); + if (this.controlPopup.parentElement.parentElement.getAttribute("hidden") === null) { + if ('buttonup' === e.type || (e.type === "axischanged" && value === 0)) return; + const num = this.controlPopup.getAttribute("button-num"); + const player = parseInt(this.controlPopup.getAttribute("player-num")); + if (e.gamepadIndex !== player) return; + if (!this.controls[player][num]) { + this.controls[player][num] = {}; + } + this.controls[player][num].value2 = e.label; + this.controlPopup.parentElement.parentElement.setAttribute("hidden", ""); + this.checkGamepadInputs(); + this.saveSettings(); + return; + } + if (this.settingsMenu.style.display !== "none" || this.isPopupOpen()) return; + const special = [16, 17, 18, 19, 20, 21, 22, 23]; + for (let i=0; i<4; i++) { + if (e.gamepadIndex !== i) continue; + for (let j=0; j<30; j++) { + if (!this.controls[i][j] || this.controls[i][j].value2 === undefined) { + continue; + } + const controlValue = this.controls[i][j].value2; + + if (['buttonup', 'buttondown'].includes(e.type) && (controlValue === e.label || controlValue === e.index)) { + this.gameManager.simulateInput(i, j, (e.type === 'buttonup' ? 0 : (special.includes(j) ? 0x7fff : 1))); + } else if (e.type === "axischanged") { + if (typeof controlValue === 'string' && controlValue.split(":")[0] === e.axis) { + if (special.includes(j)) { + if (e.axis === 'LEFT_STICK_X') { + if (e.value > 0) { + this.gameManager.simulateInput(i, 16, 0x7fff * e.value); + this.gameManager.simulateInput(i, 17, 0); + } else { + this.gameManager.simulateInput(i, 17, -0x7fff * e.value); + this.gameManager.simulateInput(i, 16, 0); + } + } else if (e.axis === 'LEFT_STICK_Y') { + if (e.value > 0) { + this.gameManager.simulateInput(i, 18, 0x7fff * e.value); + this.gameManager.simulateInput(i, 19, 0); + } else { + this.gameManager.simulateInput(i, 19, -0x7fff * e.value); + this.gameManager.simulateInput(i, 18, 0); + } + } else if (e.axis === 'RIGHT_STICK_X') { + if (e.value > 0) { + this.gameManager.simulateInput(i, 20, 0x7fff * e.value); + this.gameManager.simulateInput(i, 21, 0); + } else { + this.gameManager.simulateInput(i, 21, -0x7fff * e.value); + this.gameManager.simulateInput(i, 20, 0); + } + } else if (e.axis === 'RIGHT_STICK_Y') { + if (e.value > 0) { + this.gameManager.simulateInput(i, 22, 0x7fff * e.value); + this.gameManager.simulateInput(i, 23, 0); + } else { + this.gameManager.simulateInput(i, 23, 0x7fff * e.value); + this.gameManager.simulateInput(i, 22, 0); + } + } + } else if (value === 0 || controlValue === e.label || controlValue === `${e.axis}:${value}`) { + this.gameManager.simulateInput(i, j, ((value === 0) ? 0 : 1)); + } + } + } + } + } + } + setVirtualGamepad() { + this.virtualGamepad = this.createElement("div"); + this.toggleVirtualGamepad = (show) => { + this.virtualGamepad.style.display = show ? "" : "none"; + } + this.virtualGamepad.classList.add("ejs_virtualGamepad_parent"); + this.elements.parent.appendChild(this.virtualGamepad); + + const speedControlButtons = [ + {"type":"button","text":"Fast","id":"speed-fast","location":"center","left":-35,"top":50,"fontSize":15,"block":true,"input_value":27}, + {"type":"button","text":"Slow","id":"speed-slow","location":"center","left":95,"top":50,"fontSize":15,"block":true,"input_value":29}, + ]; + if (this.rewindEnabled) { + speedControlButtons.push({"type":"button","text":"Rewind","id":"speed-rewind","location":"center","left":30,"top":50,"fontSize":15,"block":true,"input_value":28}); + } + + let info; + if (this.config.VirtualGamepadSettings && function(set) { + if (!Array.isArray(set)) { + console.warn("Virtual gamepad settings is not array! Using default gamepad settings"); + return false; + } + if (!set.length) { + console.warn("Virtual gamepad settings is empty! Using default gamepad settings"); + return false; + } + for (let i=0; i { + left.classList.toggle("ejs_virtualGamepad_left", !enabled); + right.classList.toggle("ejs_virtualGamepad_right", !enabled); + left.classList.toggle("ejs_virtualGamepad_right", enabled); + right.classList.toggle("ejs_virtualGamepad_left", enabled); + } + + const leftHandedMode = false; + const blockCSS = 'height:31px;text-align:center;border:1px solid #ccc;border-radius:5px;line-height:31px;'; + + for (let i=0; i { + e.preventDefault(); + if (e.type === 'touchend' || e.type === 'touchcancel') { + e.target.classList.remove("ejs_virtualGamepad_button_down"); + window.setTimeout(() => { + this.gameManager.simulateInput(0, value, 0); + }) + } else { + e.target.classList.add("ejs_virtualGamepad_button_down"); + this.gameManager.simulateInput(0, value, 1); + } + }) + } + } + + const createDPad = (opts) => { + const container = opts.container; + const callback = opts.event; + const dpadMain = this.createElement("div"); + dpadMain.classList.add("ejs_dpad_main"); + const vertical = this.createElement("div"); + vertical.classList.add("ejs_dpad_vertical"); + const horizontal = this.createElement("div"); + horizontal.classList.add("ejs_dpad_horizontal"); + const bar1 = this.createElement("div"); + bar1.classList.add("ejs_dpad_bar"); + const bar2 = this.createElement("div"); + bar2.classList.add("ejs_dpad_bar"); + + horizontal.appendChild(bar1); + vertical.appendChild(bar2); + dpadMain.appendChild(vertical); + dpadMain.appendChild(horizontal); + + const updateCb = (e) => { + e.preventDefault(); + const touch = e.targetTouches[0]; + if (!touch) return; + const rect = dpadMain.getBoundingClientRect(); + const x = touch.clientX - rect.left - dpadMain.clientWidth / 2; + const y = touch.clientY - rect.top - dpadMain.clientHeight / 2; + let up = 0, + down = 0, + left = 0, + right = 0, + angle = Math.atan(x / y) / (Math.PI / 180); + + if (y <= -10) { + up = 1; + } + if (y >= 10) { + down = 1; + } + + if (x >= 10) { + right = 1; + left = 0; + if (angle < 0 && angle >= -35 || angle > 0 && angle <= 35) { + right = 0; + } + up = (angle < 0 && angle >= -55 ? 1 : 0); + down = (angle > 0 && angle <= 55 ? 1 : 0); + } + + if (x <= -10) { + right = 0; + left = 1; + if (angle < 0 && angle >= -35 || angle > 0 && angle <= 35) { + left = 0; + } + up = (angle > 0 && angle <= 55 ? 1 : 0); + down = (angle < 0 && angle >= -55 ? 1 : 0); + } + + dpadMain.classList.toggle("ejs_dpad_up_pressed", up); + dpadMain.classList.toggle("ejs_dpad_down_pressed", down); + dpadMain.classList.toggle("ejs_dpad_right_pressed", right); + dpadMain.classList.toggle("ejs_dpad_left_pressed", left); + + callback(up, down, left, right); + } + const cancelCb = (e) => { + e.preventDefault(); + dpadMain.classList.remove("ejs_dpad_up_pressed"); + dpadMain.classList.remove("ejs_dpad_down_pressed"); + dpadMain.classList.remove("ejs_dpad_right_pressed"); + dpadMain.classList.remove("ejs_dpad_left_pressed"); + + callback(0, 0, 0, 0); + } + + this.addEventListener(dpadMain, 'touchstart touchmove', updateCb); + this.addEventListener(dpadMain, 'touchend touchcancel', cancelCb); + + + container.appendChild(dpadMain); + } + + info.forEach((dpad, index) => { + if (dpad.type !== 'dpad') return; + if (leftHandedMode && ['left', 'right'].includes(dpad.location)) { + dpad.location = (dpad.location==='left') ? 'right' : 'left'; + const amnt = JSON.parse(JSON.stringify(dpad)); + if (amnt.left) { + dpad.right = amnt.left; + } + if (amnt.right) { + dpad.left = amnt.right; + } + } + const elem = this.createElement("div"); + let style = ''; + if (dpad.left) { + style += 'left:'+dpad.left+';'; + } + if (dpad.right) { + style += 'right:'+dpad.right+';'; + } + if (dpad.top) { + style += 'top:'+dpad.top+';'; + } + elem.style = style; + elems[dpad.location].appendChild(elem); + createDPad({container: elem, event: (up, down, left, right) => { + if (dpad.joystickInput) { + if (up === 1) up=0x7fff; + if (down === 1) down=0x7fff; + if (left === 1) left=0x7fff; + if (right === 1) right=0x7fff; + } + this.gameManager.simulateInput(0, dpad.inputValues[0], up); + this.gameManager.simulateInput(0, dpad.inputValues[1], down); + this.gameManager.simulateInput(0, dpad.inputValues[2], left); + this.gameManager.simulateInput(0, dpad.inputValues[3], right); + }}); + }) + + + info.forEach((zone, index) => { + if (zone.type !== 'zone') return; + if (leftHandedMode && ['left', 'right'].includes(zone.location)) { + zone.location = (zone.location==='left') ? 'right' : 'left'; + const amnt = JSON.parse(JSON.stringify(zone)); + if (amnt.left) { + zone.right = amnt.left; + } + if (amnt.right) { + zone.left = amnt.right; + } + } + const elem = this.createElement("div"); + this.addEventListener(elem, "touchstart touchmove touchend touchcancel", (e) => { + e.preventDefault(); + }); + elems[zone.location].appendChild(elem); + const zoneObj = nipplejs.create({ + 'zone': elem, + 'mode': 'static', + 'position': { + 'left': zone.left, + 'top': zone.top + }, + 'color': zone.color || 'red' + }); + zoneObj.on('end', () => { + this.gameManager.simulateInput(0, zone.inputValues[0], 0); + this.gameManager.simulateInput(0, zone.inputValues[1], 0); + this.gameManager.simulateInput(0, zone.inputValues[2], 0); + this.gameManager.simulateInput(0, zone.inputValues[3], 0); + }); + zoneObj.on('move', (e, info) => { + const degree = info.angle.degree; + const distance = info.distance; + if (zone.joystickInput === true) { + let x = 0, y = 0; + if (degree > 0 && degree <= 45) { + x = distance / 50; + y = -0.022222222222222223 * degree * distance / 50; + } + if (degree > 45 && degree <= 90) { + x = 0.022222222222222223 * (90 - degree) * distance / 50; + y = -distance / 50; + } + if (degree > 90 && degree <= 135) { + x = 0.022222222222222223 * (90 - degree) * distance / 50; + y = -distance / 50; + } + if (degree > 135 && degree <= 180) { + x = -distance / 50; + y = -0.022222222222222223 * (180 - degree) * distance / 50; + } + if (degree > 135 && degree <= 225) { + x = -distance / 50; + y = -0.022222222222222223 * (180 - degree) * distance / 50; + } + if (degree > 225 && degree <= 270) { + x = -0.022222222222222223 * (270 - degree) * distance / 50; + y = distance / 50; + } + if (degree > 270 && degree <= 315) { + x = -0.022222222222222223 * (270 - degree) * distance / 50; + y = distance / 50; + } + if (degree > 315 && degree <= 359.9) { + x = distance / 50; + y = 0.022222222222222223 * (360 - degree) * distance / 50; + } + if (x > 0) { + this.gameManager.simulateInput(0, zone.inputValues[0], 0x7fff * x); + this.gameManager.simulateInput(0, zone.inputValues[1], 0); + } else { + this.gameManager.simulateInput(0, zone.inputValues[1], 0x7fff * -x); + this.gameManager.simulateInput(0, zone.inputValues[0], 0); + } + if (y > 0) { + this.gameManager.simulateInput(0, zone.inputValues[2], 0x7fff * y); + this.gameManager.simulateInput(0, zone.inputValues[3], 0); + } else { + this.gameManager.simulateInput(0, zone.inputValues[3], 0x7fff * -y); + this.gameManager.simulateInput(0, zone.inputValues[2], 0); + } + + } else { + if (degree >= 30 && degree < 150) { + this.gameManager.simulateInput(0, zone.inputValues[0], 1); + } else { + window.setTimeout(() => { + this.gameManager.simulateInput(0, zone.inputValues[0], 0); + }, 30); + } + if (degree >= 210 && degree < 330) { + this.gameManager.simulateInput(0, zone.inputValues[1], 1); + } else { + window.setTimeout(() => { + this.gameManager.simulateInput(0, zone.inputValues[1], 0); + }, 30); + } + if (degree >= 120 && degree < 240) { + this.gameManager.simulateInput(0, zone.inputValues[2], 1); + } else { + window.setTimeout(() => { + this.gameManager.simulateInput(0, zone.inputValues[2], 0); + }, 30); + } + if (degree >= 300 || degree >= 0 && degree < 60) { + this.gameManager.simulateInput(0, zone.inputValues[3], 1); + } else { + window.setTimeout(() => { + this.gameManager.simulateInput(0, zone.inputValues[3], 0); + }, 30); + } + } + }); + }) + + if (this.touch || navigator.maxTouchPoints > 0) { + const menuButton = this.createElement("div"); + menuButton.innerHTML = ''; + menuButton.classList.add("ejs_virtualGamepad_open"); + menuButton.style.display = "none"; + this.on("start", () => menuButton.style.display = ""); + this.elements.parent.appendChild(menuButton); + let timeout; + let ready = true; + this.addEventListener(menuButton, "touchstart touchend mousedown mouseup click", (e) => { + if (!ready) return; + clearTimeout(timeout); + timeout = setTimeout(() => { + ready = true; + }, 2000) + ready = false; + e.preventDefault(); + this.menu.toggle(); + }) + this.elements.menuToggle = menuButton; + } + + this.virtualGamepad.style.display = "none"; + } + handleResize() { + if (this.virtualGamepad) { + if (this.virtualGamepad.style.display === "none") { + this.virtualGamepad.style.opacity = 0; + this.virtualGamepad.style.display = ""; + setTimeout(() => { + this.virtualGamepad.style.display = "none"; + this.virtualGamepad.style.opacity = ""; + }, 250) + } + } + if (!this.Module) return; + const dpr = window.devicePixelRatio || 1; + const positionInfo = this.elements.parent.getBoundingClientRect(); + const width = positionInfo.width * dpr; + const height = (positionInfo.height * dpr); + this.Module.setCanvasSize(width, height); + if (!this.handleSettingsResize) return; + this.handleSettingsResize(); + } + getElementSize(element) { + let elem = element.cloneNode(true); + elem.style.position = 'absolute'; + elem.style.opacity = 0; + elem.removeAttribute('hidden'); + element.parentNode.appendChild(elem); + const res = elem.getBoundingClientRect(); + elem.remove(); + return { + 'width': res.width, + 'height': res.height + }; + } + saveSettings() { + if (!window.localStorage || !this.settingsLoaded) return; + const coreSpecific = { + controlSettings: this.controls, + settings: this.settings, + cheats: this.cheats + } + const ejs_settings = { + volume: this.volume, + muted: this.muted + } + localStorage.setItem("ejs-settings", JSON.stringify(ejs_settings)); + localStorage.setItem("ejs-"+this.getCore()+"-settings", JSON.stringify(coreSpecific)); + } + loadRewindEnabled() { + if (!window.localStorage) return; + let coreSpecific = localStorage.getItem("ejs-"+this.getCore()+"-settings"); + try { + coreSpecific = JSON.parse(coreSpecific); + if (!coreSpecific || !coreSpecific.settings) { + return false; + } + return coreSpecific.settings.rewindEnabled === 'enabled'; + } catch (e) { + console.warn("Could not load previous settings", e); + return false; + } + } + loadSettings() { + if (!window.localStorage) return; + this.settingsLoaded = true; + let ejs_settings = localStorage.getItem("ejs-settings"); + let coreSpecific = localStorage.getItem("ejs-"+this.getCore()+"-settings"); + if (coreSpecific) { + try { + coreSpecific = JSON.parse(coreSpecific); + if (!(coreSpecific.controlSettings instanceof Object) || !(coreSpecific.settings instanceof Object) || !Array.isArray(coreSpecific.cheats)) return; + this.controls = coreSpecific.controlSettings; + this.checkGamepadInputs(); + for (const k in coreSpecific.settings) { + this.changeSettingOption(k, coreSpecific.settings[k]); + } + for (let i=0; i { + if (this.isFastForward) this.gameManager.toggleFastForward(1); + }, 10) + } else if (option === "fastForward") { + if (value === "enabled") { + this.isFastForward = true; + this.gameManager.toggleFastForward(1); + } else if (value === "disabled") { + this.isFastForward = false; + this.gameManager.toggleFastForward(0); + } + } else if (option === 'sm-ratio') { + if (this.isSlowMotion) this.gameManager.toggleSlowMotion(0); + this.gameManager.setSlowMotionRatio(parseFloat(value)); + setTimeout(() => { + if (this.isSlowMotion) this.gameManager.toggleSlowMotion(1); + }, 10); + } else if (option === 'slowMotion') { + if (value === "enabled") { + this.isSlowMotion = true; + this.gameManager.toggleSlowMotion(1); + } else if (value === "disabled") { + this.isSlowMotion = false; + this.gameManager.toggleSlowMotion(0); + } + } else if (option === "rewind-granularity") { + if (this.rewindEnabled) { + this.gameManager.setRewindGranularity(parseInt(value)); + } + } + this.gameManager.setVariable(option, value); + this.saveSettings(); + } + setupSettingsMenu() { + this.settingsMenu = this.createElement("div"); + this.settingsMenu.classList.add("ejs_settings_parent"); + const nested = this.createElement("div"); + nested.classList.add("ejs_settings_transition"); + this.settings = {}; + + const home = this.createElement("div"); + home.style.overflow = "auto"; + const menus = []; + this.handleSettingsResize = () => { + let needChange = false; + if (this.settingsMenu.style.display !== "") { + this.settingsMenu.style.opacity = "0"; + this.settingsMenu.style.display = ""; + needChange = true; + } + const x = this.settingsMenu.parentElement.getBoundingClientRect().x; + let height = this.elements.parent.getBoundingClientRect().height; + let width = this.elements.parent.getBoundingClientRect().width; + if (height > 375) height = 375; + home.style['max-height'] = (height - 95) + "px"; + nested.style['max-height'] = (height - 95) + "px"; + for (let i=0; i= width/2) && (width < 575)); + if (needChange) { + this.settingsMenu.style.display = "none"; + this.settingsMenu.style.opacity = ""; + } + } + + home.classList.add("ejs_setting_menu"); + nested.appendChild(home); + let funcs = []; + this.changeSettingOption = (title, newValue) => { + this.settings[title] = newValue; + funcs.forEach(e => e(title)); + } + let allOpts = {}; + + const addToMenu = (title, id, options, defaultOption) => { + const menuOption = this.createElement("div"); + menuOption.classList.add("ejs_settings_main_bar"); + const span = this.createElement("span"); + span.innerText = title; + + const current = this.createElement("div"); + current.innerText = ""; + current.classList.add("ejs_settings_main_bar_selected"); + span.appendChild(current); + + menuOption.appendChild(span); + home.appendChild(menuOption); + + const menu = this.createElement("div"); + menus.push(menu); + menu.style.overflow = "auto"; + menu.setAttribute("hidden", ""); + const button = this.createElement("button"); + const goToHome = () => { + const homeSize = this.getElementSize(home); + nested.style.width = (homeSize.width+20) + "px"; + nested.style.height = homeSize.height + "px"; + menu.setAttribute("hidden", ""); + home.removeAttribute("hidden"); + } + this.addEventListener(menuOption, "click", (e) => { + const targetSize = this.getElementSize(menu); + nested.style.width = (targetSize.width+20) + "px"; + nested.style.height = targetSize.height + "px"; + menu.removeAttribute("hidden"); + home.setAttribute("hidden", ""); + }) + this.addEventListener(button, "click", goToHome); + + button.type = "button"; + button.classList.add("ejs_back_button"); + menu.appendChild(button); + const pageTitle = this.createElement("span"); + pageTitle.innerText = title; + pageTitle.classList.add("ejs_menu_text_a"); + button.appendChild(pageTitle); + + const optionsMenu = this.createElement("div"); + optionsMenu.classList.add("ejs_setting_menu"); + //optionsMenu.style["max-height"] = "385px"; + //optionsMenu.style.overflow = "auto"; + + let buttons = []; + let opts = options; + if (Array.isArray(options)) { + opts = {}; + for (let i=0; i { + if (id !== title) return; + for (let j=0; j { + this.settings[id] = opt; + for (let j=0; j 1) { + const diskLabels = {}; + for (let i=0; i 0) { + addToMenu(this.localization('Virtual Gamepad'), 'virtual-gamepad', { + 'enabled': this.localization("Enabled"), + 'disabled': this.localization("Disabled") + }, this.isMobile ? 'enabled' : 'disabled'); + addToMenu(this.localization('Left Handed Mode'), 'virtual-gamepad-left-handed-mode', { + 'enabled': this.localization("Enabled"), + 'disabled': this.localization("Disabled") + }, 'disabled'); + } + let coreOpts; + try { + coreOpts = this.gameManager.getCoreOptions(); + } catch(e){} + if (coreOpts) { + coreOpts.split('\n').forEach((line, index) => { + let option = line.split('; '); + let name = option[0]; + let options = option[1].split('|'), + optionName = name.split("|")[0].replace(/_/g, ' ').replace(/.+\-(.+)/, '$1'); + options.slice(1, -1); + if (options.length === 1) return; + let availableOptions = {}; + for (let i=0; i 1) ? name.split("|")[1] : options[0].replace('(Default) ', '')); + }) + } + + this.settingsMenu.appendChild(nested); + + this.settingParent.appendChild(this.settingsMenu); + this.settingParent.style.position = "relative"; + + const homeSize = this.getElementSize(home); + nested.style.width = (homeSize.width+20) + "px"; + nested.style.height = homeSize.height + "px"; + + this.settingsMenu.style.display = "none"; + + if (this.debug) { + console.log("Available core options", allOpts); + } + + if (this.config.defaultOptions) { + for (const k in this.config.defaultOptions) { + this.changeSettingOption(k, this.config.defaultOptions[k]); + } + } + } + createSubPopup(hidden) { + const popup = this.createElement('div'); + popup.classList.add("ejs_popup_container"); + popup.classList.add("ejs_popup_container_box"); + const popupMsg = this.createElement("div"); + popupMsg.innerText = ""; + if (hidden) popup.setAttribute("hidden", ""); + popup.appendChild(popupMsg); + return [popup, popupMsg]; + } + createNetplayMenu() { + const body = this.createPopup("Netplay", { + "Create a Room": () => { + if (this.isNetplay) { + this.netplay.leaveRoom(); + } else { + this.netplay.showOpenRoomDialog(); + } + }, + "Close": () => { + this.netplayMenu.style.display = "none"; + this.netplay.updateList.stop(); + } + }, true); + this.netplayMenu = body.parentElement; + const createButton = this.netplayMenu.getElementsByTagName("a")[0]; + const rooms = this.createElement("div"); + const title = this.createElement("strong"); + title.innerText = this.localization("Rooms"); + const table = this.createElement("table"); + table.classList.add("ejs_netplay_table"); + table.style.width = "100%"; + table.setAttribute("cellspacing", "0"); + const thead = this.createElement("thead"); + const row = this.createElement("tr"); + const addToHeader = (text) => { + const item = this.createElement("td"); + item.innerText = text; + item.style["text-align"] = "center"; + row.appendChild(item); + return item; + } + thead.appendChild(row); + addToHeader("Room Name").style["text-align"] = "left"; + addToHeader("Players").style.width = "80px"; + addToHeader("").style.width = "80px"; //"join" button + table.appendChild(thead); + const tbody = this.createElement("tbody"); + + table.appendChild(tbody); + rooms.appendChild(title); + rooms.appendChild(table); + + + const joined = this.createElement("div"); + const title2 = this.createElement("strong"); + title2.innerText = "{roomname}"; + const password = this.createElement("div"); + password.innerText = "Password: "; + const table2 = this.createElement("table"); + table2.classList.add("ejs_netplay_table"); + table2.style.width = "100%"; + table2.setAttribute("cellspacing", "0"); + const thead2 = this.createElement("thead"); + const row2 = this.createElement("tr"); + const addToHeader2 = (text) => { + const item = this.createElement("td"); + item.innerText = text; + row2.appendChild(item); + return item; + } + thead2.appendChild(row2); + addToHeader2("Player").style.width = "80px"; + addToHeader2("Name"); + addToHeader2("").style.width = "80px"; //"join" button + table2.appendChild(thead2); + const tbody2 = this.createElement("tbody"); + + table2.appendChild(tbody2); + joined.appendChild(title2); + joined.appendChild(password); + joined.appendChild(table2); + + joined.style.display = "none"; + body.appendChild(rooms); + body.appendChild(joined); + + this.openNetplayMenu = () => { + this.netplayMenu.style.display = ""; + if (!this.netplay || (this.netplay && !this.netplay.name)) { + this.netplay = {}; + this.netplay.table = tbody; + this.netplay.playerTable = tbody2; + this.netplay.passwordElem = password; + this.netplay.roomNameElem = title2; + this.netplay.createButton = createButton; + this.netplay.tabs = [rooms, joined]; + this.defineNetplayFunctions(); + const popups = this.createSubPopup(); + this.netplayMenu.appendChild(popups[0]); + popups[1].classList.add("ejs_cheat_parent"); //Hehe + const popup = popups[1]; + + const header = this.createElement("div"); + const title = this.createElement("h2"); + title.innerText = this.localization("Set Player Name"); + title.classList.add("ejs_netplay_name_heading"); + header.appendChild(title); + popup.appendChild(header); + + const main = this.createElement("div"); + main.classList.add("ejs_netplay_header"); + const head = this.createElement("strong"); + head.innerText = this.localization("Player Name"); + const input = this.createElement("input"); + input.type = "text"; + input.setAttribute("maxlength", 20); + + main.appendChild(head); + main.appendChild(this.createElement("br")); + main.appendChild(input); + popup.appendChild(main); + + popup.appendChild(this.createElement("br")); + const submit = this.createElement("button"); + submit.classList.add("ejs_button_button"); + submit.classList.add("ejs_popup_submit"); + submit.style["background-color"] = "rgba(var(--ejs-primary-color),1)"; + submit.innerText = this.localization("Submit"); + popup.appendChild(submit); + this.addEventListener(submit, "click", (e) => { + if (!input.value.trim()) return; + this.netplay.name = input.value.trim(); + popups[0].remove(); + }) + } + this.netplay.updateList.start(); + } + } + defineNetplayFunctions() { + function guidGenerator() { + const S4 = function() { + return (((1+Math.random())*0x10000)|0).toString(16).substring(1); + }; + return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()); + } + this.netplay.url = this.config.netplayUrl; + while (this.netplay.url.endsWith("/")) { + this.netplay.url = this.netplay.url.substring(0, this.netplay.url.length-1); + } + this.netplay.current_frame = 0; + this.netplay.getOpenRooms = async () => { + return JSON.parse(await (await fetch(this.netplay.url+"/list?domain="+window.location.host+"&game_id="+this.config.gameId)).text()); + } + this.netplay.updateTableList = async () => { + const addToTable = (id, name, current, max) => { + const row = this.createElement("tr"); + row.classList.add("ejs_netplay_table_row"); + const addToHeader = (text) => { + const item = this.createElement("td"); + item.innerText = text; + item.style.padding = "10px 0"; + item.style["text-align"] = "center"; + row.appendChild(item); + return item; + } + addToHeader(name).style["text-align"] = "left"; + addToHeader(current + "/" + max).style.width = "80px"; + + const parent = addToHeader(""); + parent.style.width = "80px"; + this.netplay.table.appendChild(row); + if (current < max) { + const join = this.createElement("button"); + join.classList.add("ejs_netplay_join_button"); + join.classList.add("ejs_button_button"); + join.style["background-color"] = "rgba(var(--ejs-primary-color),1)"; + join.innerText = this.localization("Join"); + parent.appendChild(join); + this.addEventListener(join, "click", (e) => { + this.netplay.joinRoom(id, name); + }) + return join; + } + } + const open = await this.netplay.getOpenRooms(); + //console.log(open); + this.netplay.table.innerHTML = ""; + for (const k in open) { + addToTable(k, open[k].room_name, open[k].current, open[k].max);//todo: password + } + } + this.netplay.showOpenRoomDialog = () => { + const popups = this.createSubPopup(); + this.netplayMenu.appendChild(popups[0]); + popups[1].classList.add("ejs_cheat_parent"); //Hehe + const popup = popups[1]; + + const header = this.createElement("div"); + const title = this.createElement("h2"); + title.innerText = this.localization("Create a room"); + title.classList.add("ejs_netplay_name_heading"); + header.appendChild(title); + popup.appendChild(header); + + const main = this.createElement("div"); + + main.classList.add("ejs_netplay_header"); + const rnhead = this.createElement("strong"); + rnhead.innerText = this.localization("Room Name"); + const rninput = this.createElement("input"); + rninput.type = "text"; + rninput.setAttribute("maxlength", 20); + + const maxhead = this.createElement("strong"); + maxhead.innerText = this.localization("Max Players"); + const maxinput = this.createElement("select"); + maxinput.setAttribute("disabled", "disabled"); + const val2 = this.createElement("option"); + val2.value = 2; + val2.innerText = "2"; + const val3 = this.createElement("option"); + val3.value = 3; + val3.innerText = "3"; + const val4 = this.createElement("option"); + val4.value = 4; + val4.innerText = "4"; + maxinput.appendChild(val2); + maxinput.appendChild(val3); + maxinput.appendChild(val4); + + + const pwhead = this.createElement("strong"); + pwhead.innerText = this.localization("Password (optional)"); + const pwinput = this.createElement("input"); + pwinput.type = "text"; + pwinput.setAttribute("maxlength", 20); + + main.appendChild(rnhead); + main.appendChild(this.createElement("br")); + main.appendChild(rninput); + + main.appendChild(maxhead); + main.appendChild(this.createElement("br")); + main.appendChild(maxinput); + + main.appendChild(pwhead); + main.appendChild(this.createElement("br")); + main.appendChild(pwinput); + + popup.appendChild(main); + + popup.appendChild(this.createElement("br")); + const submit = this.createElement("button"); + submit.classList.add("ejs_button_button"); + submit.classList.add("ejs_popup_submit"); + submit.style["background-color"] = "rgba(var(--ejs-primary-color),1)"; + submit.style.margin = "0 10px"; + submit.innerText = this.localization("Submit"); + popup.appendChild(submit); + this.addEventListener(submit, "click", (e) => { + if (!rninput.value.trim()) return; + this.netplay.openRoom(rninput.value.trim(), parseInt(maxinput.value), pwinput.value.trim()); + popups[0].remove(); + }) + const close = this.createElement("button"); + close.classList.add("ejs_button_button"); + close.classList.add("ejs_popup_submit"); + close.style.margin = "0 10px"; + close.innerText = this.localization("Close"); + popup.appendChild(close); + this.addEventListener(close, "click", (e) => { + popups[0].remove(); + }) + } + this.netplay.startSocketIO = (callback) => { + this.netplay.socket = io(this.netplay.url); + this.netplay.socket.on("connect", () => callback()); + this.netplay.socket.on("users-updated", (users) => { + this.netplay.reset(); + if (this.debug) console.log(users); + this.netplay.players = users; + this.netplay.updatePlayersTable(); + if (this.netplay.owner) this.netplay.sync(); + }) + this.netplay.socket.on("disconnect", () => this.netplay.roomLeft()); + this.netplay.socket.on("data-message", (data) => { + this.netplay.dataMessage(data); + }) + } + this.netplay.openRoom = (roomName, maxPlayers, password) => { + const sessionid = guidGenerator(); + this.netplay.playerID = guidGenerator(); + this.netplay.players = {}; + this.netplay.extra = { + domain: window.location.host, + game_id: this.config.gameId, + room_name: roomName, + player_name: this.netplay.name, + userid: this.netplay.playerID, + sessionid: sessionid + } + this.netplay.players[this.netplay.playerID] = this.netplay.extra; + this.netplay.users = {}; + + this.netplay.startSocketIO((error) => { + this.netplay.socket.emit("open-room", { + extra: this.netplay.extra, + maxPlayers: maxPlayers, + password: password + }, (error) => { + if (error) { + if (this.debug) console.log("error: ", error); + return; + } + this.netplay.roomJoined(true, roomName, password, sessionid); + }) + }); + } + this.netplay.leaveRoom = () => { + if (this.debug) console.log("asd"); + this.netplay.roomLeft(); + } + this.netplay.joinRoom = (sessionid, roomName) => { + this.netplay.playerID = guidGenerator(); + this.netplay.players = {}; + this.netplay.extra = { + domain: window.location.host, + game_id: this.config.gameId, + room_name: roomName, + player_name: this.netplay.name, + userid: this.netplay.playerID, + sessionid: sessionid + } + this.netplay.players[this.netplay.playerID] = this.netplay.extra; + + this.netplay.startSocketIO((error) => { + this.netplay.socket.emit("join-room", { + extra: this.netplay.extra//, + //password: password + }, (error, users) => { + if (error) { + if (this.debug) console.log("error: ", error); + return; + } + this.netplay.players = users; + //this.netplay.roomJoined(false, roomName, password, sessionid); + this.netplay.roomJoined(false, roomName, "", sessionid); + }) + }); + } + this.netplay.roomJoined = (isOwner, roomName, password, roomId) => { + //Will already assume this.netplay.players has been refreshed + this.isNetplay = true; + this.netplay.inputs = {}; + this.netplay.owner = isOwner; + if (this.debug) console.log(this.netplay.extra); + this.netplay.roomNameElem.innerText = roomName; + this.netplay.tabs[0].style.display = "none"; + this.netplay.tabs[1].style.display = ""; + if (password) { + this.netplay.passwordElem.style.display = ""; + this.netplay.passwordElem.innerText = this.localization("Password")+": "+password + } else { + this.netplay.passwordElem.style.display = "none"; + } + this.netplay.createButton.innerText = this.localization("Leave Room"); + this.netplay.updatePlayersTable(); + if (!this.netplay.owner) { + this.netplay.oldStyles = [ + this.elements.bottomBar.cheat[0].style.display, + this.elements.bottomBar.playPause[0].style.display, + this.elements.bottomBar.playPause[1].style.display, + this.elements.bottomBar.restart[0].style.display, + this.elements.bottomBar.loadState[0].style.display, + this.elements.bottomBar.saveState[0].style.display, + this.elements.bottomBar.saveSavFiles[0].style.display, + this.elements.bottomBar.loadSavFiles[0].style.display, + this.elements.contextMenu.save.style.display, + this.elements.contextMenu.load.style.display + ] + this.elements.bottomBar.cheat[0].style.display = "none"; + this.elements.bottomBar.playPause[0].style.display = "none"; + this.elements.bottomBar.playPause[1].style.display = "none"; + this.elements.bottomBar.restart[0].style.display = "none"; + this.elements.bottomBar.loadState[0].style.display = "none"; + this.elements.bottomBar.saveState[0].style.display = "none"; + this.elements.bottomBar.saveSavFiles[0].style.display = "none"; + this.elements.bottomBar.loadSavFiles[0].style.display = "none"; + this.elements.contextMenu.save.style.display = "none"; + this.elements.contextMenu.load.style.display = "none"; + this.gameManager.resetCheat(); + } else { + this.netplay.oldStyles = [ + this.elements.bottomBar.cheat[0].style.display + ] + } + this.elements.bottomBar.cheat[0].style.display = "none"; + } + this.netplay.updatePlayersTable = () => { + const table = this.netplay.playerTable; + table.innerHTML = ""; + const addToTable = (num, playerName) => { + const row = this.createElement("tr"); + const addToHeader = (text) => { + const item = this.createElement("td"); + item.innerText = text; + row.appendChild(item); + return item; + } + addToHeader(num).style.width = "80px"; + addToHeader(playerName); + addToHeader("").style.width = "80px"; //"join" button + table.appendChild(row); + } + let i=1; + for (const k in this.netplay.players) { + addToTable(i, this.netplay.players[k].player_name); + i++; + } + } + this.netplay.roomLeft = () => { + this.isNetplay = false; + this.netplay.tabs[0].style.display = ""; + this.netplay.tabs[1].style.display = "none"; + this.netplay.extra = null; + this.netplay.playerID = null; + this.netplay.createButton.innerText = this.localization("Create a Room"); + this.netplay.socket.disconnect(); + this.elements.bottomBar.cheat[0].style.display = this.netplay.oldStyles[0]; + if (!this.netplay.owner) { + this.elements.bottomBar.playPause[0].style.display = this.netplay.oldStyles[1]; + this.elements.bottomBar.playPause[1].style.display = this.netplay.oldStyles[2]; + this.elements.bottomBar.restart[0].style.display = this.netplay.oldStyles[3]; + this.elements.bottomBar.loadState[0].style.display = this.netplay.oldStyles[4]; + this.elements.bottomBar.saveState[0].style.display = this.netplay.oldStyles[5]; + this.elements.bottomBar.saveSavFiles[0].style.display = this.netplay.oldStyles[6]; + this.elements.bottomBar.loadSavFiles[0].style.display = this.netplay.oldStyles[7]; + this.elements.contextMenu.save.style.display = this.netplay.oldStyles[8]; + this.elements.contextMenu.load.style.display = this.netplay.oldStyles[9]; + } + this.updateCheatUI(); + } + this.netplay.setLoading = (loading) => { + if (this.debug) console.log("loading:", loading); + } + let syncing = false; + this.netplay.sync = async () => { + if (syncing) return; + syncing = true; + if (this.debug) console.log("sync") + this.netplay.ready = 0; + const state = await this.gameManager.getState(); + this.netplay.sendMessage({ + state: state + }); + this.netplay.setLoading(true); + this.pause(true); + this.netplay.ready++; + this.netplay.current_frame = 0; + if (this.netplay.ready === this.netplay.getUserCount()) { + this.play(true); + } + syncing = false; + } + this.netplay.getUserIndex = (user) => { + let i=0; + for (const k in this.netplay.players) { + if (k === user) return i; + i++; + } + return -1; + } + this.netplay.getUserCount = () => { + let i=0; + for (const k in this.netplay.players) i++; + return i; + } + let justReset = false; + this.netplay.dataMessage = (data) => { + //console.log(data); + if (data.sync === true && this.netplay.owner) { + this.netplay.sync(); + } + if (data.state) { + this.netplay.wait = true; + this.netplay.setLoading(true); + this.pause(true); + this.gameManager.loadState(new Uint8Array(data.state)); + this.netplay.sendMessage({ready:true}); + } + if (data.play && !this.owner) { + this.play(true); + } + if (data.pause && !this.owner) { + this.pause(true); + } + if (data.ready && this.netplay.owner) { + this.netplay.ready++; + if (this.netplay.ready === this.netplay.getUserCount()) { + this.netplay.sendMessage({readyready:true}); + this.netplay.reset(); + setTimeout(() => this.play(true), 48); + this.netplay.setLoading(false); + } + } + if (data.readyready) { + this.netplay.setLoading(false); + this.netplay.reset(); + this.play(true); + } + if (data.shortPause) console.log(data.shortPause); + if (data.shortPause && data.shortPause !== this.netplay.playerID) { + this.pause(true); + this.netplay.wait = true; + setTimeout(() => this.play(true), 48); + } + if (data["sync-control"]) { + data["sync-control"].forEach((value) => { + let inFrame = parseInt(value.frame); + let frame = this.netplay.currentFrame; + if (!value.connected_input || value.connected_input[0] < 0) return; + //if (value.connected_input[0] === this.netplay.getUserIndex(this.netplay.playerID)) return; + console.log(value, inFrame, frame); + if (inFrame === frame) { + inFrame++; + this.gameManager.functions.simulateInput(value.connected_input[0], value.connected_input[1], value.connected_input[2]); + } + this.netplay.inputsData[inFrame] || (this.netplay.inputsData[inFrame] = []); + this.netplay.inputsData[frame] || (this.netplay.inputsData[frame] = []); + if (this.netplay.owner) { + this.netplay.inputsData[frame].push(value); + this.gameManager.functions.simulateInput(value.connected_input[0], value.connected_input[1], value.connected_input[2]); + if (frame - 10 >= inFrame) { + this.netplay.wait = true; + this.pause(true); + setTimeout(() => { + this.play(true); + this.netplay.wait = false; + }, 48) + } + } else { + this.netplay.inputsData[inFrame].push(value); + if (this.netplay.inputsData[frame]) { + this.play(true); + } + if (frame + 10 <= inFrame && inFrame > this.netplay.init_frame + 100) { + this.netplay.sendMessage({shortPause:this.netplay.playerID}); + } + } + }); + } + if (data.restart) { + this.gameManager.restart(); + this.netplay.reset(); + this.play(true); + } + } + this.netplay.simulateInput = (player, index, value, resp) => { + if (!this.isNetplay) return; + if (player !== 0 && !resp) return; + player = this.netplay.getUserIndex(this.netplay.playerID); + let frame = this.netplay.currentFrame; + if (this.netplay.owner) { + if (!this.netplay.inputsData[frame]) { + this.netplay.inputsData[frame] = []; + } + this.netplay.inputsData[frame].push({ + frame: frame, + connected_input: [player, index, value] + }) + this.gameManager.functions.simulateInput(player, index, value); + } else { + this.netplay.sendMessage({ + "sync-control": [{ + frame: frame+10, + connected_input: [player, index, value] + }] + }) + } + } + this.netplay.sendMessage = (data) => { + this.netplay.socket.emit("data-message", data); + } + this.netplay.reset = () => { + this.netplay.init_frame = this.netplay.currentFrame; + this.netplay.inputsData = {}; + } + //let fps; + //let lastTime; + this.netplay.init_frame = 0; + this.netplay.currentFrame = 0; + this.netplay.inputsData = {}; + this.Module.postMainLoop = () => { + //const newTime = window.performance.now(); + //fps = 1000 / (newTime - lastTime); + //console.log(fps); + //lastTime = newTime; + + //frame syncing - working + //control syncing - broken + this.netplay.currentFrame = parseInt(this.gameManager.getFrameNum()) - this.netplay.init_frame; + if (!this.isNetplay) return; + if (this.netplay.owner) { + let to_send = []; + let i = this.netplay.currentFrame-1; + this.netplay.inputsData[i] ? this.netplay.inputsData[i].forEach((value) => { + value.frame+=10; + to_send.push(value); + }) : to_send.push({frame: i+10}); + this.netplay.sendMessage({"sync-control": to_send}); + } else { + if (this.netplay.currentFrame <= 0 || this.netplay.inputsData[this.netplay.currentFrame]) { + this.netplay.wait = false; + this.play(); + this.netplay.inputsData[this.netplay.currentFrame].forEach((value) => { + if (!value.connected_input) return; + console.log(value.connected_input); + this.gameManager.functions.simulateInput(value.connected_input[0], value.connected_input[1], value.connected_input[2]); + }) + } else if (!this.netplay.syncing) { + console.log("sync"); + this.pause(true); + this.netplay.sendMessage({sync:true}); + this.netplay.syncing = true; + } + } + if (this.netplay.currentFrame % 100 === 0) { + Object.keys(this.netplay.inputsData).forEach(value => { + if (value < this.netplay.currentFrame - 50) { + this.netplay.inputsData[value] = null; + delete this.netplay.inputsData[value]; + } + }) + } + + + } + + this.netplay.updateList = { + start: () => { + this.netplay.updateList.interval = setInterval(this.netplay.updateTableList.bind(this), 1000); + }, + stop: () => { + clearInterval(this.netplay.updateList.interval); + } + } + } + createCheatsMenu() { + const body = this.createPopup("Cheats", { + "Add Cheat": () => { + const popups = this.createSubPopup(); + this.cheatMenu.appendChild(popups[0]); + popups[1].classList.add("ejs_cheat_parent"); + popups[1].style.width = "100%"; + const popup = popups[1]; + const header = this.createElement("div"); + header.classList.add("ejs_cheat_header"); + const title = this.createElement("h2"); + title.innerText = this.localization("Add Cheat Code"); + title.classList.add("ejs_cheat_heading"); + const close = this.createElement("button"); + close.classList.add("ejs_cheat_close"); + header.appendChild(title); + header.appendChild(close); + popup.appendChild(header); + this.addEventListener(close, "click", (e) => { + popups[0].remove(); + }) + + const main = this.createElement("div"); + main.classList.add("ejs_cheat_main"); + const header3 = this.createElement("strong"); + header3.innerText = this.localization("Code"); + main.appendChild(header3); + main.appendChild(this.createElement("br")); + const mainText = this.createElement("textarea"); + mainText.classList.add("ejs_cheat_code"); + mainText.style.width = "100%"; + mainText.style.height = "80px"; + main.appendChild(mainText); + main.appendChild(this.createElement("br")); + const header2 = this.createElement("strong"); + header2.innerText = this.localization("Description"); + main.appendChild(header2); + main.appendChild(this.createElement("br")); + const mainText2 = this.createElement("input"); + mainText2.type = "text"; + mainText2.classList.add("ejs_cheat_code"); + main.appendChild(mainText2); + main.appendChild(this.createElement("br")); + popup.appendChild(main); + + const footer = this.createElement("footer"); + const submit = this.createElement("button"); + const closeButton = this.createElement("button"); + submit.innerText = this.localization("Submit"); + closeButton.innerText = this.localization("Close"); + submit.classList.add("ejs_button_button"); + closeButton.classList.add("ejs_button_button"); + submit.classList.add("ejs_popup_submit"); + closeButton.classList.add("ejs_popup_submit"); + submit.style["background-color"] = "rgba(var(--ejs-primary-color),1)"; + footer.appendChild(submit); + const span = this.createElement("span"); + span.innerText = " "; + footer.appendChild(span); + footer.appendChild(closeButton); + popup.appendChild(footer); + + this.addEventListener(submit, "click", (e) => { + if (!mainText.value.trim() || !mainText2.value.trim()) return; + popups[0].remove(); + this.cheats.push({ + code: mainText.value, + desc: mainText2.value, + checked: false + }); + this.updateCheatUI(); + this.saveSettings(); + }) + this.addEventListener(closeButton, "click", (e) => { + popups[0].remove(); + }) + + }, + "Close": () => { + this.cheatMenu.style.display = "none"; + } + }, true); + this.cheatMenu = body.parentElement; + this.cheatMenu.getElementsByTagName("h4")[0].style["padding-bottom"] = "0px"; + const msg = this.createElement("div"); + msg.style["padding-top"] = "0px"; + msg.style["padding-bottom"] = "15px"; + msg.innerText = "Note that some cheats require a restart to disable."; + body.appendChild(msg); + const rows = this.createElement("div"); + body.appendChild(rows); + rows.classList.add("ejs_cheat_rows"); + this.elements.cheatRows = rows; + } + updateCheatUI() { + this.elements.cheatRows.innerHTML = ""; + + const addToMenu = (desc, checked, code, is_permanent, i) => { + const row = this.createElement("div"); + row.classList.add("ejs_cheat_row"); + const input = this.createElement("input"); + input.type = "checkbox"; + input.checked = checked; + input.value = i; + input.id = "ejs_cheat_switch_"+i; + row.appendChild(input); + const label = this.createElement("label"); + label.for = "ejs_cheat_switch_"+i; + label.innerText = desc; + row.appendChild(label); + label.addEventListener("click", (e) => { + input.checked = !input.checked; + this.cheats[i].checked = input.checked; + this.cheatChanged(input.checked, code, i); + this.saveSettings(); + }) + if (!is_permanent) { + const close = this.createElement("a"); + close.classList.add("ejs_cheat_row_button"); + close.innerText = "×"; + row.appendChild(close); + close.addEventListener("click", (e) => { + this.cheatChanged(false, code, i); + this.cheats.splice(i, 1); + this.updateCheatUI(); + this.saveSettings(); + }) + } + this.elements.cheatRows.appendChild(row); + this.cheatChanged(checked, code, i); + } + this.gameManager.resetCheat(); + for (let i=0; ispan{align-items:inherit;display:flex;width:100%}.ejs_settings_main_bar:hover{background:rgba(var(--ejs-primary-color),1);color:#fff;cursor:pointer}.ejs_settings_main_bar:hover::after{border-left-color:currentColor}.ejs_settings_main_bar_selected{align-items:center;display:flex;margin-left:auto;margin-right:-5px;overflow:hidden;padding-left:25px;pointer-events:none}.ejs_setting_menu{padding:7px}.ejs_back_button{font-weight:500;margin:7px;margin-bottom:3px;padding-left:28px;position:relative;width:calc(100% - 14px);align-items:center;color:#999;display:flex;font-size:13px;padding:4px 11px;user-select:none;background:transparent;border:0;border-radius:3px;cursor:pointer;flex-shrink:0;overflow:visible;transition:all .3s ease}.ejs_back_button:hover{background:rgba(var(--ejs-primary-color),1);color:#fff}.ejs_back_button:hover::after{border-right-color:currentColor}.ejs_back_button::before{background:#b7c5cd;box-shadow:0 1px 0 #fff;content:'';height:1px;left:0;margin-top:4px;overflow:hidden;position:absolute;right:0;top:100%}.ejs_back_button::after{border:4px solid transparent;border-right-color:rgba(79,91,95,0.8);left:7px;content:'';position:absolute;top:50%;transform:translateY(-50%)}.ejs_menu_text_a{align-items:center;display:flex;font-size:13px;padding:4px 11px;user-select:none;width:100%}.ejs_option_row{padding-left:7px}.ejs_option_row:hover::before{background:rgba(0,0,0,0.1)}.ejs_option_row::before{background:rgba(204,204,204,0.1);content:'';display:block;flex-shrink:0;height:16px;margin-right:10px;transition:all .3s ease;width:16px;border-radius:100%}.ejs_option_row::after{background:#fff;border:0;height:6px;left:12px;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform .3s ease,opacity .3s ease;width:6px;border-radius:100%;content:'';position:absolute}.ejs_option_row_selected::before{background:rgba(var(--ejs-primary-color),1)}.ejs_option_row_selected::after{opacity:1;transform:translateY(-50%) scale(1)}.ejs_option_row>span{align-items:center;display:flex;width:100%}.ejs_button_style{margin:0;background:transparent;border:0;border-radius:3px;cursor:pointer;flex-shrink:0;overflow:visible;padding:7px;position:relative;transition:all .3s ease;align-items:center;color:#999;display:flex;font-size:13px;user-select:none;width:100%}.ejs_button_style:hover{background:rgba(var(--ejs-primary-color),1);color:#fff}.ejs_cheat_heading{margin-top:0 !important;margin-bottom:0 !important;font-weight:600 !important;font-size:1.25rem;line-height:1.25 !important;color:rgba(var(--ejs-primary-color),1) !important}.ejs_cheat_close{font:inherit;line-height:inherit;width:auto;background:transparent;border:0;color:#bcbcbc !important;cursor:pointer}.ejs_cheat_close::before{content:"\2715";color:#bcbcbc !important;font:inherit;line-height:inherit;width:auto}.ejs_cheat_header{display:flex;justify-content:space-between;align-items:center}.ejs_cheat_main{margin-top:2rem;margin-bottom:2rem;line-height:1.5;color:rgba(0,0,0,0.8);text-align:left;color:#bcbcbc !important;border:unset}.ejs_cheat_code{color:#000 !important;font-size:1rem;padding:.4rem;max-width:100%}@keyframes ejs_cheat_animation{from{transform:translateY(15%)}to{transform:translateY(0)}}.ejs_cheat_parent{background-color:rgba(0,0,0,0.8);border:1px solid rgba(238,238,238,0.2);padding:30px;min-width:200px;max-width:500px;max-height:100vh;border-radius:4px;overflow-y:auto;box-sizing:border-box;will-change:transform;animation:ejs_cheat_animation .3s cubic-bezier(0,0,0.2,1);font-size:14px}.ejs_popup_container_box{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.6);display:flex;justify-content:center;align-items:center}.ejs_popup_submit{touch-action:manipulation;font:inherit;line-height:inherit;width:auto}.ejs_button_button{color:#fff !important;padding-left:1rem;padding-right:1rem;padding-top:.5rem;padding-bottom:.5rem;background-color:#929292;border-radius:.25rem;border-style:none;border-width:0;cursor:pointer;-webkit-appearance:button;appearance:button;text-transform:none;overflow:visible;margin:0;will-change:transform;transition:transform .25s ease-out,-webkit-transform .25s ease-out}.ejs_button_button:hover{transform:scale(1.05)}.ejs_cheat_rows{max-width:320px;margin:0 auto;text-align:left;width:100%;float:none;user-select:text !important}.ejs_cheat_row{padding-left:2.25rem;position:relative;padding:.2em 0;clear:both}.ejs_cheat_row:hover{background-color:rgba(0,0,0,0.8)}.ejs_cheat_row input[type=checkbox]{position:absolute;z-index:-1;opacity:0;box-sizing:border-box;width:auto}.ejs_cheat_row label{position:relative;margin-bottom:0;vertical-align:top;word-break:break-word}.ejs_cheat_row label::before{position:absolute;top:0;display:block;height:1rem;content:"";background-color:#fff;border:#adb5bd solid 1px;left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.ejs_cheat_row input:checked+label::before{color:#fff;border-color:rgba(var(--ejs-primary-color),1);background-color:rgba(var(--ejs-primary-color),1)}.ejs_cheat_row label::after{position:absolute;display:block;content:"";background-repeat:no-repeat;background-position:center center;top:calc(0rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out}.ejs_cheat_row input:checked+label::after{background-color:#fff;-webkit-transform:translateX(0.75rem);transform:translateX(0.75rem)}.ejs_cheat_row_button{position:absolute;padding:.1rem .5rem;background-color:rgba(var(--ejs-primary-color),1);color:#fff !important;border-radius:.25rem;cursor:pointer;right:.025rem;border:0}@media(max-width:574px){.ejs_volume_parent input[type='range']{width:100%}}@media(min-width:575px){.ejs_volume_parent{max-width:110px}}.ejs_volume_parent{align-items:center;display:flex;flex:1;position:relative}.ejs_volume_parent{padding-right:15px}.ejs_volume_parent input[type='range']{display:block}.ejs_volume_parent::-webkit-media-controls{display:none}.ejs_volume_parent input[type='range']{-webkit-appearance:none;appearance:none;border:0;border-radius:28px;color:rgba(var(--ejs-primary-color),1);margin:0;padding:0;transition:box-shadow .3s ease;width:100%}.ejs_volume_parent input[type='range']::-webkit-slider-runnable-track{background-color:rgba(255,255,255,0.25);box-shadow:0 0 0 5px rgba(var(--ejs-primary-color),0.5);outline:0;background:transparent;border:0;border-radius:3px;height:6px;transition:box-shadow .3s ease;user-select:none;background-image:linear-gradient(to right,currentColor var(--value,0),transparent var(--value,0))}.ejs_volume_parent input[type='range']::-webkit-slider-thumb{background:#fff;border:0;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2);height:14px;position:relative;transition:all .2s ease;width:14px;-webkit-appearance:none;margin-top:-4px}.ejs_volume_parent input[type='range']::-moz-range-track{background-color:rgba(255,255,255,0.25);box-shadow:0 0 0 5px rgba(var(--ejs-primary-color),0.5);outline:0;background:transparent;border:0;border-radius:3px;height:6px;transition:box-shadow .3s ease;user-select:none}.ejs_volume_parent input[type='range']::-moz-range-thumb{background:#fff;border:0;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2);height:14px;position:relative;transition:all .2s ease;width:14px}.ejs_volume_parent input[type='range']::-moz-range-progress{background:currentColor;border-radius:3px;height:6px}.ejs_volume_parent input[type='range']::-ms-track{background-color:rgba(255,255,255,0.25);box-shadow:0 0 0 5px rgba(var(--ejs-primary-color),0.5);outline:0;background:transparent;border:0;border-radius:3px;height:6px;transition:box-shadow .3s ease;user-select:none;color:transparent}.ejs_volume_parent input[type='range']::-ms-fill-upper{background:transparent;border:0;border-radius:3px;height:6px;transition:box-shadow .3s ease;user-select:none}.ejs_volume_parent input[type='range']::-ms-fill-lower{background:transparent;border:0;border-radius:3px;height:6px;transition:box-shadow .3s ease;user-select:none;background:currentColor}.ejs_volume_parent input[type='range']::-ms-thumb{background:#fff;border:0;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2);height:14px;position:relative;transition:all .2s ease;width:14px;margin-top:0}.ejs_volume_parent input[type='range']::-ms-tooltip{display:none}.ejs_volume_parent input[type='range']:focus{outline:0}.ejs_volume_parent input[type='range']::-moz-focus-outer{border:0}.ejs_volume_parent input[type='range']:active::-webkit-slider-thumb{box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5)}.ejs_volume_parent input[type='range']:active::-moz-range-thumb{box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5)}.ejs_volume_parent input[type='range']:active::-ms-thumb{box-shadow:0 1px 1px rgba(0,0,0,0.15),0 0 0 1px rgba(47,52,61,0.2),0 0 0 3px rgba(255,255,255,0.5)}.ejs_message{float:none;overflow:hidden;position:absolute;top:0;color:red;font-size:17px;padding:10px;text-align:left;text-shadow:#000 1px 1px 1px}.ejs_virtualGamepad_open{display:inline-block;width:30px;height:30px;color:#fff;position:absolute;top:5px;right:5px;opacity:.5;z-index:999}.ejs_virtualGamepad_open svg{fill:currentColor}.ejs_netplay_header{margin-top:.5rem;margin-bottom:.5rem;line-height:1.5;color:rgba(0,0,0,.8);text-align:left}.ejs_netplay_header input,.ejs_netplay_header select{font-size:1rem;padding:.4rem;max-width:100%;color:#000 !important;background-color:#fff !important;margin:0;height:2rem;display:block;font-family:Arial;border:0}.ejs_netplay_name_heading{margin-top:0 !important;margin-bottom:0 !important;font-weight:600 !important;font-size:1.25rem;line-height:1.25 !important;color:rgba(var(--ejs-primary-color),1) !important;display:flex;justify-content:space-between;align-items:center}.ejs_netplay_table{font-family:Avenir,"Avenir Next","Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif;font-size:.8rem;padding:0 10px}.ejs_netplay_join_button{float:none;padding:.1rem .5rem;background-color:rgba(var(--ejs-primary-color),1);color:#fff !important;border-radius:.25rem;cursor:pointer}.ejs_netplay_table_row:hover{background-color:#2d2d2d} \ No newline at end of file diff --git a/emulatorjs/data/emulator.min.js b/emulatorjs/data/emulator.min.js new file mode 100644 index 00000000..cbd36e5e --- /dev/null +++ b/emulatorjs/data/emulator.min.js @@ -0,0 +1 @@ +!function(){var e,t;e=window,t=function(){return n=[function(e,t,n){"use strict";n.r(t);function b(e,t){var n=t.x-e.x,t=t.y-e.y;return Math.sqrt(n*n+t*t)}function _(e){return e*(Math.PI/180)}function o(e){f.has(e)&&clearTimeout(f.get(e)),f.set(e,setTimeout(e,100))}function a(e,t,n){for(var i,o=t.split(/[ ,]+/g),a=0;athis.options.threshold){var r,l={};for(r in this.direction)this.direction.hasOwnProperty(r)&&(l[r]=this.direction[r]);var c={};for(r in this.direction={x:n,y:i,angle:t},e.direction=this.direction,l)l[r]===this.direction[r]&&(c[r]=!0);if(c.x&&c.y&&c.angle)return e;c.x&&c.y||this.trigger("plain",e),c.x||this.trigger("plain:"+n,e),c.y||this.trigger("plain:"+i,e),c.angle||this.trigger("dir dir:"+t,e)}else this.resetDirection();return e};var x=w;function E(e,t){this.nipples=[],this.idles=[],this.actives=[],this.ids=[],this.pressureIntervals={},this.manager=e,this.id=E.id,E.id+=1,this.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,lockX:!1,lockY:!1,shape:"circle",dynamicPage:!1,follow:!1},this.config(t),"static"!==this.options.mode&&"semi"!==this.options.mode||(this.options.multitouch=!1),this.options.multitouch||(this.options.maxNumberOfNipples=1);e=getComputedStyle(this.options.zone.parentElement);return e&&"flex"===e.display&&(this.parentIsFlex=!0),this.updateBox(),this.prepareNipples(),this.bindings(),this.begin(),this.nipples}E.prototype=new m,(E.constructor=E).id=0,E.prototype.prepareNipples=function(){var i=this.nipples;i.on=this.on.bind(this),i.off=this.off.bind(this),i.options=this.options,i.destroy=this.destroy.bind(this),i.ids=this.ids,i.id=this.id,i.processOnMove=this.processOnMove.bind(this),i.processOnEnd=this.processOnEnd.bind(this),i.get=function(e){if(void 0===e)return i[0];for(var t=0,n=i.length;t