diff --git a/examples/Hilo3d/index.html b/examples/Hilo3d/index.html index 1d47e77d7..093045d04 100644 --- a/examples/Hilo3d/index.html +++ b/examples/Hilo3d/index.html @@ -13,10 +13,10 @@ - - - - + + + + diff --git a/examples/Hilo3d/index.js b/examples/Hilo3d/index.js index d1ac9bab3..90a20a773 100644 --- a/examples/Hilo3d/index.js +++ b/examples/Hilo3d/index.js @@ -67,10 +67,6 @@ var directionLight = new Hilo3d.DirectionalLight({ direction:new Hilo3d.Vector3(1, -1, 0) }).addTo(stage); -var ambientLight = new Hilo3d.AmbientLight({ - color:new Hilo3d.Color(1, 1, 1), - amount: .2 -}).addTo(stage); var ticker = new Hilo3d.Ticker(60); ticker.addTick(stage); @@ -174,12 +170,16 @@ guiSkybox.onChange(function (value) { material.brdfLUT = brfdTexture; material.diffuseEnvMap = diffuseEnvMap; material.specularEnvMap = specularEnvMap; + directionLight.enabled = true; + material.isDirty = true; }); } else { model.materials.forEach(function (material) { material.brdfLUT = null; material.diffuseEnvMap = null; material.specularEnvMap = null; + directionLight.enabled = false; + material.isDirty = true; }); } }); diff --git a/libs/Hilo3d/1.11.17/DracoLoader.js b/libs/Hilo3d/1.11.17/DracoLoader.js new file mode 100644 index 000000000..f93e5bc41 --- /dev/null +++ b/libs/Hilo3d/1.11.17/DracoLoader.js @@ -0,0 +1,184 @@ +(function() { + var Class = Hilo3d.Class; + var BasicLoader = Hilo3d.BasicLoader; + var Geometry = Hilo3d.Geometry; + var GeometryData = Hilo3d.GeometryData; + + var dracoDecoder = window.dracoDecoder = new DracoDecoderModule(); + dracoDecoder.onModuleLoaded = function(module) { + dracoDecoder = module; + } + + function getAttributeData(decoder, dracoGeometry, attribute) { + if (attribute.ptr === 0) { + return null; + } + + var numComponents = attribute.num_components(); + var attributeData = new dracoDecoder.DracoFloat32Array(); + + decoder.GetAttributeFloatForAllPoints(dracoGeometry, attribute, attributeData); + var numPoints = dracoGeometry.num_points(); + var numValues = numPoints * numComponents; + var result = new Float32Array(numValues); + for (var i = 0; i < numValues; i++) { + result[i] = attributeData.GetValue(i); + } + return result; + } + + function decode(byteArray, info, primitive) { + var attributesMap = info.attributes; + var buffer = new dracoDecoder.DecoderBuffer(); + buffer.Init(byteArray, byteArray.byteLength); + var decoder = new dracoDecoder.Decoder(); + + var geometryType = decoder.GetEncodedGeometryType(buffer); + var dracoGeometry, decodingStatus; + if (geometryType == dracoDecoder.TRIANGULAR_MESH) { + dracoGeometry = new dracoDecoder.Mesh(); + decodingStatus = decoder.DecodeBufferToMesh(buffer, dracoGeometry); + } else { + dracoGeometry = new dracoDecoder.PointCloud(); + decodingStatus = decoder.DecodeBufferToPointCloud(buffer, dracoGeometry); + } + + if (!decodingStatus.ok() || dracoGeometry.ptr == 0) { + console.error('decodingStatus error'); + return; + } + dracoDecoder.destroy(buffer); + + var geometry = primitive._geometry || new Geometry(); + + var numFaces = dracoGeometry.num_faces(); + var numPoints = dracoGeometry.num_points(); + // Verify if there is position attribute. + var posAttId = decoder.GetAttributeId(dracoGeometry, + dracoDecoder.POSITION); + if (posAttId == -1) { + var errorMsg = 'THREE.DRACOLoader: No position attribute found.'; + console.error(errorMsg); + dracoDecoder.destroy(decoder); + dracoDecoder.destroy(dracoGeometry); + throw new Error(errorMsg); + } + var posAttribute = decoder.GetAttribute(dracoGeometry, posAttId); + var posTransform = new dracoDecoder.AttributeQuantizationTransform(); + if (posTransform.InitFromAttribute(posAttribute)) { + + } + + var dracoAttributesMap = { + POSITION: ['vertices', 3], + NORMAL: ['normals', 3], + TANGENT: ['tangents', 4], + TEX_COORD: ['uvs', 2], + TEXCOORD_0: ['uvs', 2], + TEXCOORD_1: ['uvs1', 2], + COLOR: ['color', 2], + COLOR_0: ['color', 2], + JOINTS_0: ['skinIndices', 4], + WEIGHTS_0: ['skinWeights', 4], + }; + + var attributeUsedMap = {}; + for (var attributeName in dracoAttributesMap) { + var info = dracoAttributesMap[attributeName]; + var attId = decoder.GetAttributeId(dracoGeometry, dracoDecoder[attributeName]); + if (dracoDecoder[attributeName] !== undefined && attId !== -1) { + var attribute = decoder.GetAttribute(dracoGeometry, attId); + var data = getAttributeData(decoder, dracoGeometry, attribute); + if (data) { + geometry[info[0]] = new GeometryData(data, info[1]); + } + attributeUsedMap[info[0]] = true; + } + } + + for (var attributeName in attributesMap) { + var info = dracoAttributesMap[attributeName]; + if (!info) { + console.warn(attributeName + ' not exist'); + continue; + } + if (attributeUsedMap[info[0]]) { + continue; + } + var attributeId = attributesMap[attributeName]; + var attribute = decoder.GetAttributeByUniqueId(dracoGeometry, + attributeId); + var data = getAttributeData(decoder, dracoGeometry, attribute); + if (data) { + geometry[info[0]] = new GeometryData(data, info[1]); + } + } + + if (geometry._tangents) { + if (geometry._tangents.length > geometry.vertices.length) { + geometry._tangents.stride = 16; + geometry._tangents.size = 3; + } + } + + if (geometry.skinIndices) { + var x = geometry.skinIndices.data; + for (var i = x.length - 1; i >= 0; i--) { + x[i] = Math.round(x[i]); + } + } + + var indicesArray; + if (numPoints > 65535) { + indicesArray = new Uint32Array(numFaces * 3); + } else { + indicesArray = new Uint16Array(numFaces * 3); + } + var ia = new dracoDecoder.DracoInt32Array(); + for (var i = 0; i < numFaces; i++) { + decoder.GetFaceFromMesh(dracoGeometry, i, ia); + var idx = i * 3; + indicesArray[idx] = ia.GetValue(0); + indicesArray[idx + 1] = ia.GetValue(1); + indicesArray[idx + 2] = ia.GetValue(2); + } + geometry.indices = new GeometryData(indicesArray, 1); + + dracoDecoder.destroy(ia); + dracoDecoder.destroy(dracoGeometry); + dracoDecoder.destroy(decoder); + return geometry; + } + + + var DracoLoader = Class.create({ + Extends: BasicLoader, + Statics: { + decode: decode + }, + constructor: function() { + DracoLoader.superclass.constructor.call(this); + }, + load: function(params) { + return this.loadRes(params.src, 'buffer') + .then(function(data) { + return decode(data); + }).catch(function(err) { + console.warn('load draco failed', err); + throw err; + }); + } + }); + + Hilo3d.DracoLoader = DracoLoader; + Hilo3d.Loader.addLoader('drc', DracoLoader); + + Hilo3d.GLTFParser.extensionHandlers.KHR_draco_mesh_compression = { + parse: function(info, parser, result, primitive) { + var bufferView = parser.bufferViews[info.bufferView]; + var uintArray = new Uint8Array(bufferView.buffer, bufferView.byteOffset, bufferView.byteLength); + var geometry = decode(uintArray, info, primitive); + return geometry; + } + }; +})(); \ No newline at end of file diff --git a/libs/Hilo3d/1.11.17/Hilo3d.js b/libs/Hilo3d/1.11.17/Hilo3d.js new file mode 100644 index 000000000..0095f8d32 --- /dev/null +++ b/libs/Hilo3d/1.11.17/Hilo3d.js @@ -0,0 +1,39 @@ +/** + * Hilo3d 1.11.17 + * Copyright (c) 2017-present Alibaba Group Holding Ltd. + * @license MIT + */ +window.Hilo3d=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=123)}([function(t,e,n){ +/*! +@fileoverview gl-matrix - High performance matrix and vector operations +@author Brandon Jones +@author Colin MacKenzie IV +@version 2.7.0 + +Copyright (c) 2015-2018, Brandon Jones, Colin MacKenzie IV. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ +"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setMatrixArrayType=function(t){e.ARRAY_TYPE=t},e.toRadian=function(t){return t*r},e.equals=function(t,e){return Math.abs(t-e)<=i*Math.max(1,Math.abs(t),Math.abs(e))};var i=e.EPSILON=1e-6;e.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,e.RANDOM=Math.random;var r=Math.PI/180},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=r,e.clone=function(t){var e=new i.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.fromValues=function(t,e,n,r){var s=new i.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=n,s[3]=r,s},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.set=function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=s,e.multiply=a,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t},e.distance=u,e.squaredDistance=c,e.length=h,e.squaredLength=f,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},e.normalize=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*n+i*i+r*r+s*s;return a>0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=i*a,t[2]=r*a,t[3]=s*a),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,i){var r=e[0],s=e[1],a=e[2],o=e[3];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=a+i*(n[2]-a),t[3]=o+i*(n[3]-o),t},e.random=function(t,e){var n,r,s,a,o,u;e=e||1;do{n=2*i.RANDOM()-1,r=2*i.RANDOM()-1,o=n*n+r*r}while(o>=1);do{s=2*i.RANDOM()-1,a=2*i.RANDOM()-1,u=s*s+a*a}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*r,t[2]=e*s*c,t[3]=e*a*c,t},e.transformMat4=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*s+n[12]*a,t[1]=n[1]*i+n[5]*r+n[9]*s+n[13]*a,t[2]=n[2]*i+n[6]*r+n[10]*s+n[14]*a,t[3]=n[3]*i+n[7]*r+n[11]*s+n[15]*a,t},e.transformQuat=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=n[0],o=n[1],u=n[2],c=n[3],h=c*i+o*s-u*r,f=c*r+u*i-a*s,l=c*s+a*r-o*i,d=-a*i-o*r-u*s;return t[0]=h*c+d*-a+f*-u-l*-o,t[1]=f*c+d*-o+l*-a-h*-u,t[2]=l*c+d*-u+h*-o-f*-a,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(n*n+i*i+r*r+s*s)}function c(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return n*n+i*i+r*r+s*s}function h(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.sqrt(e*e+n*n+i*i+r*r)}function f(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.len=h,e.sqrLen=f,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o=void 0,u=void 0;for(n||(n=4),i||(i=0),u=r?Math.min(r*n+i,e.length):e.length,o=i;o1?0:r<-1?Math.PI:Math.acos(r)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=e[0],o=e[1],u=e[2];return Math.abs(n-a)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-u)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(3);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)}function a(t,e,n){var r=new i.ARRAY_TYPE(3);return r[0]=t,r[1]=e,r[2]=n,r}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function h(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(n*n+i*i+r*r)}function f(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}function l(t){var e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i}function d(t,e){var n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function m(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=h,e.sqrDist=f,e.len=s,e.sqrLen=l,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o=void 0,u=void 0;for(n||(n=3),i||(i=0),u=r?Math.min(r*n+i,e.length):e.length,o=i;oi.EPSILON?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=h,e.rotateX=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+a*o,t[1]=r*u+s*o,t[2]=s*u-r*o,t[3]=a*u-i*o,t},e.rotateY=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u-s*o,t[1]=r*u+a*o,t[2]=s*u+i*o,t[3]=a*u-r*o,t},e.rotateZ=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+r*o,t[1]=r*u-i*o,t[2]=s*u+a*o,t[3]=a*u-s*o,t},e.calculateW=function(t,e){var n=e[0],i=e[1],r=e[2];return t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),t},e.slerp=f,e.random=function(t){var e=i.RANDOM(),n=i.RANDOM(),r=i.RANDOM(),s=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*n),t[1]=s*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*n+i*i+r*r+s*s,o=a?1/a:0;return t[0]=-n*o,t[1]=-i*o,t[2]=-r*o,t[3]=s*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=l,e.fromEuler=function(t,e,n,i){var r=.5*Math.PI/180;e*=r,n*=r,i*=r;var s=Math.sin(e),a=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(i),h=Math.cos(i);return t[0]=s*u*h-a*o*c,t[1]=a*o*h+s*u*c,t[2]=a*u*c-s*o*h,t[3]=a*u*h+s*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var i=o(n(0)),r=o(n(5)),s=o(n(2)),a=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function h(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=i*h+a*o+r*c-s*u,t[1]=r*h+a*u+s*o-i*c,t[2]=s*h+a*c+i*u-r*o,t[3]=a*h-i*o-r*u-s*c,t}function f(t,e,n,r){var s=e[0],a=e[1],o=e[2],u=e[3],c=n[0],h=n[1],f=n[2],l=n[3],d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return(m=s*c+a*h+o*f+u*l)<0&&(m=-m,c=-c,h=-h,f=-f,l=-l),1-m>i.EPSILON?(d=Math.acos(m),_=Math.sin(d),p=Math.sin((1-r)*d)/_,g=Math.sin(r*d)/_):(p=1-r,g=r),t[0]=p*s+g*c,t[1]=p*a+g*h,t[2]=p*o+g*f,t[3]=p*u+g*l,t}function l(t,e){var n=e[0]+e[4]+e[8],i=void 0;if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,a=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*a+a]+1),t[r]=.5*i,i=.5/i,t[3]=(e[3*s+a]-e[3*a+s])*i,t[s]=(e[3*s+r]+e[3*r+s])*i,t[a]=(e[3*a+r]+e[3*r+a])*i}return t}e.clone=a.clone,e.fromValues=a.fromValues,e.copy=a.copy,e.set=a.set,e.add=a.add,e.mul=h,e.scale=a.scale,e.dot=a.dot,e.lerp=a.lerp;var d=e.length=a.length,m=(e.len=d,e.squaredLength=a.squaredLength),_=(e.sqrLen=m,e.normalize=a.normalize);e.exactEquals=a.exactEquals,e.equals=a.equals,e.rotationTo=function(){var t=s.create(),e=s.fromValues(1,0,0),n=s.fromValues(0,1,0);return function(i,r,a){var o=s.dot(r,a);return o<-.999999?(s.cross(t,e,r),s.len(t)<1e-6&&s.cross(t,n,r),s.normalize(t,t),c(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(s.cross(t,r,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,_(i,i))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,i,r,s,a,o){return f(t,i,a,o),f(e,r,s,o),f(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=r.create();return function(e,n,i,r){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=r[0],t[4]=r[1],t[7]=r[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],_(e,l(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(16);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,r,s,a,o,u,c,h,f,l,d,m,_,p){var g=new i.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=s,g[5]=a,g[6]=o,g[7]=u,g[8]=c,g[9]=h,g[10]=f,g[11]=l,g[12]=d,g[13]=m,g[14]=_,g[15]=p,g},e.set=function(t,e,n,i,r,s,a,o,u,c,h,f,l,d,m,_,p){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t[9]=h,t[10]=f,t[11]=l,t[12]=d,t[13]=m,t[14]=_,t[15]=p,t},e.identity=r,e.transpose=function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],s=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=s,t[11]=e[14],t[12]=r,t[13]=a,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],v=n*o-i*a,T=n*u-r*a,E=n*c-s*a,M=i*u-r*o,A=i*c-s*o,L=r*c-s*u,I=h*_-f*m,O=h*p-l*m,S=h*g-d*m,R=f*p-l*_,y=f*g-d*_,x=l*g-d*p,N=v*x-T*y+E*R+M*S-A*O+L*I;return N?(N=1/N,t[0]=(o*x-u*y+c*R)*N,t[1]=(r*y-i*x-s*R)*N,t[2]=(_*L-p*A+g*M)*N,t[3]=(l*A-f*L-d*M)*N,t[4]=(u*S-a*x-c*O)*N,t[5]=(n*x-r*S+s*O)*N,t[6]=(p*E-m*L-g*T)*N,t[7]=(h*L-l*E+d*T)*N,t[8]=(a*y-o*S+c*I)*N,t[9]=(i*S-n*y-s*I)*N,t[10]=(m*A-_*E+g*v)*N,t[11]=(f*E-h*A-d*v)*N,t[12]=(o*O-a*R-u*I)*N,t[13]=(n*R-i*O+r*I)*N,t[14]=(_*T-m*M-p*v)*N,t[15]=(h*M-f*T+l*v)*N,t):null},e.adjoint=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15];return t[0]=o*(l*g-d*p)-f*(u*g-c*p)+_*(u*d-c*l),t[1]=-(i*(l*g-d*p)-f*(r*g-s*p)+_*(r*d-s*l)),t[2]=i*(u*g-c*p)-o*(r*g-s*p)+_*(r*c-s*u),t[3]=-(i*(u*d-c*l)-o*(r*d-s*l)+f*(r*c-s*u)),t[4]=-(a*(l*g-d*p)-h*(u*g-c*p)+m*(u*d-c*l)),t[5]=n*(l*g-d*p)-h*(r*g-s*p)+m*(r*d-s*l),t[6]=-(n*(u*g-c*p)-a*(r*g-s*p)+m*(r*c-s*u)),t[7]=n*(u*d-c*l)-a*(r*d-s*l)+h*(r*c-s*u),t[8]=a*(f*g-d*_)-h*(o*g-c*_)+m*(o*d-c*f),t[9]=-(n*(f*g-d*_)-h*(i*g-s*_)+m*(i*d-s*f)),t[10]=n*(o*g-c*_)-a*(i*g-s*_)+m*(i*c-s*o),t[11]=-(n*(o*d-c*f)-a*(i*d-s*f)+h*(i*c-s*o)),t[12]=-(a*(f*p-l*_)-h*(o*p-u*_)+m*(o*l-u*f)),t[13]=n*(f*p-l*_)-h*(i*p-r*_)+m*(i*l-r*f),t[14]=-(n*(o*p-u*_)-a*(i*p-r*_)+m*(i*u-r*o)),t[15]=n*(o*l-u*f)-a*(i*l-r*f)+h*(i*u-r*o),t},e.determinant=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8],h=t[9],f=t[10],l=t[11],d=t[12],m=t[13],_=t[14],p=t[15];return(e*a-n*s)*(f*p-l*_)-(e*o-i*s)*(h*p-l*m)+(e*u-r*s)*(h*_-f*m)+(n*o-i*a)*(c*p-l*d)-(n*u-r*a)*(c*_-f*d)+(i*u-r*o)*(c*m-h*d)},e.multiply=s,e.translate=function(t,e,n){var i=n[0],r=n[1],s=n[2],a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],u=e[2],c=e[3],h=e[4],f=e[5],l=e[6],d=e[7],m=e[8],_=e[9],p=e[10],g=e[11],t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=h,t[5]=f,t[6]=l,t[7]=d,t[8]=m,t[9]=_,t[10]=p,t[11]=g,t[12]=a*i+h*r+m*s+e[12],t[13]=o*i+f*r+_*s+e[13],t[14]=u*i+l*r+p*s+e[14],t[15]=c*i+d*r+g*s+e[15]),t},e.scale=function(t,e,n){var i=n[0],r=n[1],s=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,r){var s=r[0],a=r[1],o=r[2],u=Math.sqrt(s*s+a*a+o*o),c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=void 0,g=void 0,v=void 0,T=void 0,E=void 0,M=void 0,A=void 0,L=void 0,I=void 0,O=void 0,S=void 0,R=void 0,y=void 0,x=void 0,N=void 0,b=void 0,w=void 0;return u0?(n[0]=2*(c*u+l*r+h*o-f*s)/d,n[1]=2*(h*u+l*s+f*r-c*o)/d,n[2]=2*(f*u+l*o+c*s-h*r)/d):(n[0]=2*(c*u+l*r+h*o-f*s),n[1]=2*(h*u+l*s+f*r-c*o),n[2]=2*(f*u+l*o+c*s-h*r)),a(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[4],a=e[5],o=e[6],u=e[8],c=e[9],h=e[10];return t[0]=Math.sqrt(n*n+i*i+r*r),t[1]=Math.sqrt(s*s+a*a+o*o),t[2]=Math.sqrt(u*u+c*c+h*h),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],i=0;return n>0?(i=2*Math.sqrt(n+1),t[3]=.25*i,t[0]=(e[6]-e[9])/i,t[1]=(e[8]-e[2])/i,t[2]=(e[1]-e[4])/i):e[0]>e[5]&&e[0]>e[10]?(i=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/i,t[0]=.25*i,t[1]=(e[1]+e[4])/i,t[2]=(e[8]+e[2])/i):e[5]>e[10]?(i=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/i,t[0]=(e[1]+e[4])/i,t[1]=.25*i,t[2]=(e[6]+e[9])/i):(i=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/i,t[0]=(e[8]+e[2])/i,t[1]=(e[6]+e[9])/i,t[2]=.25*i),t},e.fromRotationTranslationScale=function(t,e,n,i){var r=e[0],s=e[1],a=e[2],o=e[3],u=r+r,c=s+s,h=a+a,f=r*u,l=r*c,d=r*h,m=s*c,_=s*h,p=a*h,g=o*u,v=o*c,T=o*h,E=i[0],M=i[1],A=i[2];return t[0]=(1-(m+p))*E,t[1]=(l+T)*E,t[2]=(d-v)*E,t[3]=0,t[4]=(l-T)*M,t[5]=(1-(f+p))*M,t[6]=(_+g)*M,t[7]=0,t[8]=(d+v)*A,t[9]=(_-g)*A,t[10]=(1-(f+m))*A,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,i,r){var s=e[0],a=e[1],o=e[2],u=e[3],c=s+s,h=a+a,f=o+o,l=s*c,d=s*h,m=s*f,_=a*h,p=a*f,g=o*f,v=u*c,T=u*h,E=u*f,M=i[0],A=i[1],L=i[2],I=r[0],O=r[1],S=r[2],R=(1-(_+g))*M,y=(d+E)*M,x=(m-T)*M,N=(d-E)*A,b=(1-(l+g))*A,w=(p+v)*A,C=(m+T)*L,P=(p-v)*L,H=(1-(l+_))*L;return t[0]=R,t[1]=y,t[2]=x,t[3]=0,t[4]=N,t[5]=b,t[6]=w,t[7]=0,t[8]=C,t[9]=P,t[10]=H,t[11]=0,t[12]=n[0]+I-(R*I+N*O+C*S),t[13]=n[1]+O-(y*I+b*O+P*S),t[14]=n[2]+S-(x*I+w*O+H*S),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n+n,o=i+i,u=r+r,c=n*a,h=i*a,f=i*o,l=r*a,d=r*o,m=r*u,_=s*a,p=s*o,g=s*u;return t[0]=1-f-m,t[1]=h+g,t[2]=l-p,t[3]=0,t[4]=h-g,t[5]=1-c-m,t[6]=d+_,t[7]=0,t[8]=l+p,t[9]=d-_,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,i,r,s,a){var o=1/(n-e),u=1/(r-i),c=1/(s-a);return t[0]=2*s*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(r+i)*u,t[10]=(a+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*s*2*c,t[15]=0,t},e.perspective=function(t,e,n,i,r){var s=1/Math.tan(e/2),a=void 0;return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(a=1/(i-r),t[10]=(r+i)*a,t[14]=2*r*i*a):(t[10]=-1,t[14]=-2*i),t},e.perspectiveFromFieldOfView=function(t,e,n,i){var r=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+o),c=2/(r+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-o)*u*.5,t[9]=(r-s)*c*.5,t[10]=i/(n-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*n/(n-i),t[15]=0,t},e.ortho=function(t,e,n,i,r,s,a){var o=1/(e-n),u=1/(i-r),c=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(r+i)*u,t[14]=(a+s)*c,t[15]=1,t},e.lookAt=function(t,e,n,s){var a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=e[0],g=e[1],v=e[2],T=s[0],E=s[1],M=s[2],A=n[0],L=n[1],I=n[2];return Math.abs(p-A)0&&(d=1/Math.sqrt(d),h*=d,f*=d,l*=d);var m=u*l-c*f,_=c*h-o*l,p=o*f-u*h;return(d=m*m+_*_+p*p)>0&&(d=1/Math.sqrt(d),m*=d,_*=d,p*=d),t[0]=m,t[1]=_,t[2]=p,t[3]=0,t[4]=f*p-l*_,t[5]=l*m-h*p,t[6]=h*_-f*m,t[7]=0,t[8]=h,t[9]=f,t[10]=l,t[11]=0,t[12]=r,t[13]=s,t[14]=a,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t[9]=e[9]+n[9]*i,t[10]=e[10]+n[10]*i,t[11]=e[11]+n[11]*i,t[12]=e[12]+n[12]*i,t[13]=e[13]+n[13]*i,t[14]=e[14]+n[14]*i,t[15]=e[15]+n[15]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=t[9],d=t[10],m=t[11],_=t[12],p=t[13],g=t[14],v=t[15],T=e[0],E=e[1],M=e[2],A=e[3],L=e[4],I=e[5],O=e[6],S=e[7],R=e[8],y=e[9],x=e[10],N=e[11],b=e[12],w=e[13],C=e[14],P=e[15];return Math.abs(n-T)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(T))&&Math.abs(r-E)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(s-M)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(a-A)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(o-L)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(L))&&Math.abs(u-I)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(c-O)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(h-S)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-R)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(R))&&Math.abs(l-y)<=i.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(d-x)<=i.EPSILON*Math.max(1,Math.abs(d),Math.abs(x))&&Math.abs(m-N)<=i.EPSILON*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(_-b)<=i.EPSILON*Math.max(1,Math.abs(_),Math.abs(b))&&Math.abs(p-w)<=i.EPSILON*Math.max(1,Math.abs(p),Math.abs(w))&&Math.abs(g-C)<=i.EPSILON*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(v-P)<=i.EPSILON*Math.max(1,Math.abs(v),Math.abs(P))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function s(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=e[9],d=e[10],m=e[11],_=e[12],p=e[13],g=e[14],v=e[15],T=n[0],E=n[1],M=n[2],A=n[3];return t[0]=T*i+E*o+M*f+A*_,t[1]=T*r+E*u+M*l+A*p,t[2]=T*s+E*c+M*d+A*g,t[3]=T*a+E*h+M*m+A*v,T=n[4],E=n[5],M=n[6],A=n[7],t[4]=T*i+E*o+M*f+A*_,t[5]=T*r+E*u+M*l+A*p,t[6]=T*s+E*c+M*d+A*g,t[7]=T*a+E*h+M*m+A*v,T=n[8],E=n[9],M=n[10],A=n[11],t[8]=T*i+E*o+M*f+A*_,t[9]=T*r+E*u+M*l+A*p,t[10]=T*s+E*c+M*d+A*g,t[11]=T*a+E*h+M*m+A*v,T=n[12],E=n[13],M=n[14],A=n[15],t[12]=T*i+E*o+M*f+A*_,t[13]=T*r+E*u+M*l+A*p,t[14]=T*s+E*c+M*d+A*g,t[15]=T*a+E*h+M*m+A*v,t}function a(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=i+i,u=r+r,c=s+s,h=i*o,f=i*u,l=i*c,d=r*u,m=r*c,_=s*c,p=a*o,g=a*u,v=a*c;return t[0]=1-(d+_),t[1]=f+v,t[2]=l-g,t[3]=0,t[4]=f-v,t[5]=1-(h+_),t[6]=m+p,t[7]=0,t[8]=l+g,t[9]=m-p,t[10]=1-(h+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=s,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(9);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new i.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,r,s,a,o,u,c){var h=new i.ARRAY_TYPE(9);return h[0]=t,h[1]=e,h[2]=n,h[3]=r,h[4]=s,h[5]=a,h[6]=o,h[7]=u,h[8]=c,h},e.set=function(t,e,n,i,r,s,a,o,u,c){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],i=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=i,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=h*a-o*c,l=-h*s+o*u,d=c*s-a*u,m=n*f+i*l+r*d;return m?(m=1/m,t[0]=f*m,t[1]=(-h*i+r*c)*m,t[2]=(o*i-r*a)*m,t[3]=l*m,t[4]=(h*n-r*u)*m,t[5]=(-o*n+r*s)*m,t[6]=d*m,t[7]=(-c*n+i*u)*m,t[8]=(a*n-i*s)*m,t):null},e.adjoint=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-o*c,t[1]=r*c-i*h,t[2]=i*o-r*a,t[3]=o*u-s*h,t[4]=n*h-r*u,t[5]=r*s-n*o,t[6]=s*c-a*u,t[7]=i*u-n*c,t[8]=n*a-i*s,t},e.determinant=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8];return e*(c*s-a*u)+n*(-c*r+a*o)+i*(u*r-s*o)},e.multiply=r,e.translate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=l*i+d*a+c,t[7]=l*r+d*o+h,t[8]=l*s+d*u+f,t},e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=Math.sin(n),d=Math.cos(n);return t[0]=d*i+l*a,t[1]=d*r+l*o,t[2]=d*s+l*u,t[3]=d*a-l*i,t[4]=d*o-l*r,t[5]=d*u-l*s,t[6]=c,t[7]=h,t[8]=f,t},e.scale=function(t,e,n){var i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n+n,o=i+i,u=r+r,c=n*a,h=i*a,f=i*o,l=r*a,d=r*o,m=r*u,_=s*a,p=s*o,g=s*u;return t[0]=1-f-m,t[3]=h-g,t[6]=l+p,t[1]=h+g,t[4]=1-c-m,t[7]=d-_,t[2]=l-p,t[5]=d+_,t[8]=1-c-f,t},e.normalFromMat4=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],v=n*o-i*a,T=n*u-r*a,E=n*c-s*a,M=i*u-r*o,A=i*c-s*o,L=r*c-s*u,I=h*_-f*m,O=h*p-l*m,S=h*g-d*m,R=f*p-l*_,y=f*g-d*_,x=l*g-d*p,N=v*x-T*y+E*R+M*S-A*O+L*I;return N?(N=1/N,t[0]=(o*x-u*y+c*R)*N,t[1]=(u*S-a*x-c*O)*N,t[2]=(a*y-o*S+c*I)*N,t[3]=(r*y-i*x-s*R)*N,t[4]=(n*x-r*S+s*O)*N,t[5]=(i*S-n*y-s*I)*N,t[6]=(_*L-p*A+g*M)*N,t[7]=(p*E-m*L-g*T)*N,t[8]=(m*A-_*E+g*v)*N,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=e[0],d=e[1],m=e[2],_=e[3],p=e[4],g=e[5],v=e[6],T=e[7],E=e[8];return Math.abs(n-l)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-d)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(s-m)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-_)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-p)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(u-g)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-v)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(h-T)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(f-E)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(E))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1],m=n[2],_=n[3],p=n[4],g=n[5],v=n[6],T=n[7],E=n[8];return t[0]=l*i+d*a+m*c,t[1]=l*r+d*o+m*h,t[2]=l*s+d*u+m*f,t[3]=_*i+p*a+g*c,t[4]=_*r+p*o+g*h,t[5]=_*s+p*u+g*f,t[6]=v*i+T*a+E*c,t[7]=v*r+T*o+E*h,t[8]=v*s+T*u+E*f,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=r,e.clone=function(t){var e=new i.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new i.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=s,e.multiply=a,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},e.distance=u,e.squaredDistance=c,e.length=h,e.squaredLength=f,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],i=e[1],r=n*n+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t},e.lerp=function(t,e,n,i){var r=e[0],s=e[1];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t},e.random=function(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t},e.transformMat2d=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t},e.transformMat3=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t},e.transformMat4=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t},e.rotate=function(t,e,n,i){var r=e[0]-n[0],s=e[1]-n[1],a=Math.sin(i),o=Math.cos(i);return t[0]=r*o-s*a+n[0],t[1]=r*a+s*o+n[1],t},e.angle=function(t,e){var n=t[0],i=t[1],r=e[0],s=e[1],a=n*n+i*i;a>0&&(a=1/Math.sqrt(a));var o=r*r+s*s;o>0&&(o=1/Math.sqrt(o));var u=(n*r+i*s)*a*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],r=t[1],s=e[0],a=e[1];return Math.abs(n-s)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-a)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(2);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)}function c(t,e){var n=e[0]-t[0],i=e[1]-t[1];return n*n+i*i}function h(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function f(t){var e=t[0],n=t[1];return e*e+n*n}e.len=h,e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=f,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o=void 0,u=void 0;for(n||(n=2),i||(i=0),u=r?Math.min(r*n+i,e.length):e.length,o=i;o0){n=Math.sqrt(n);var i=e[0]/n,r=e[1]/n,s=e[2]/n,a=e[3]/n,o=e[4],u=e[5],c=e[6],h=e[7],f=i*o+r*u+s*c+a*h;t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=(o-i*f)/n,t[5]=(u-r*f)/n,t[6]=(c-s*f)/n,t[7]=(h-a*f)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=e[0],l=e[1],d=e[2],m=e[3],_=e[4],p=e[5],g=e[6],v=e[7];return Math.abs(n-f)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-l)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(s-d)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-m)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(o-_)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(u-p)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))&&Math.abs(c-g)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(h-v)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))};var i=a(n(0)),r=a(n(3)),s=a(n(4));function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var i=.5*n[0],r=.5*n[1],s=.5*n[2],a=e[0],o=e[1],u=e[2],c=e[3];return t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=i*c+r*u-s*o,t[5]=r*c+s*a-i*u,t[6]=s*c+i*o-r*a,t[7]=-i*a-r*o-s*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[4],u=n[5],c=n[6],h=n[7],f=e[4],l=e[5],d=e[6],m=e[7],_=n[0],p=n[1],g=n[2],v=n[3];return t[0]=i*v+a*_+r*g-s*p,t[1]=r*v+a*p+s*_-i*g,t[2]=s*v+a*g+i*p-r*_,t[3]=a*v-i*_-r*p-s*g,t[4]=i*h+a*o+r*c-s*u+f*v+m*_+l*g-d*p,t[5]=r*h+a*u+s*o-i*c+l*v+m*p+d*_-f*g,t[6]=s*h+a*c+i*u-r*o+d*v+m*g+f*p-l*_,t[7]=a*h-i*o-r*u-s*c+m*v-f*_-l*p-d*g,t}e.getReal=r.copy,e.setReal=r.copy,e.mul=c;var h=e.dot=r.dot,f=e.length=r.length,l=(e.len=f,e.squaredLength=r.squaredLength);e.sqrLen=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(6);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,r,s,a){var o=new i.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o[4]=s,o[5]=a,o},e.set=function(t,e,n,i,r,s,a){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=n*s-i*r;return u?(u=1/u,t[0]=s*u,t[1]=-i*u,t[2]=-r*u,t[3]=n*u,t[4]=(r*o-s*a)*u,t[5]=(i*a-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=r,e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=Math.sin(n),h=Math.cos(n);return t[0]=i*h+s*c,t[1]=r*h+a*c,t[2]=i*-c+s*h,t[3]=r*-c+a*h,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=i*c,t[1]=r*c,t[2]=s*h,t[3]=a*h,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=i*c+s*h+o,t[5]=r*c+a*h+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=e[0],h=e[1],f=e[2],l=e[3],d=e[4],m=e[5];return Math.abs(n-c)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(r-h)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(s-f)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-l)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-d)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-m)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1],f=n[2],l=n[3],d=n[4],m=n[5];return t[0]=i*c+s*h,t[1]=r*c+a*h,t[2]=i*f+s*l,t[3]=r*f+a*l,t[4]=i*d+s*m+o,t[5]=r*d+a*m+u,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,r){var s=new i.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=n,s[3]=r,s},e.set=function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*s-r*i;return a?(a=1/a,t[0]=s*a,t[1]=-i*a,t[2]=-r*a,t[3]=n*a,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=r,e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+s*o,t[1]=r*u+a*o,t[2]=i*-o+s*u,t[3]=r*-o+a*u,t},e.scale=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1];return t[0]=i*o,t[1]=r*o,t[2]=s*u,t[3]=a*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,i){return t[2]=i[2]/i[0],n[0]=i[0],n[1]=i[1],n[3]=i[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=s,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=i*o+s*u,t[1]=r*o+a*u,t[2]=i*c+s*h,t[3]=r*c+a*h,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var i=d(n(0)),r=d(n(9)),s=d(n(8)),a=d(n(5)),o=d(n(4)),u=d(n(3)),c=d(n(7)),h=d(n(6)),f=d(n(2)),l=d(n(1));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=i,e.mat2=r,e.mat2d=s,e.mat3=a,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=h,e.vec3=f,e.vec4=l}])},function(t,e,n){"use strict";var i=n(19),r=n.n(i);e.a=r.a},function(t,e,n){"use strict";var i={};n.r(i),n.d(i,"POSITION",function(){return u}),n.d(i,"NORMAL",function(){return c}),n.d(i,"DEPTH",function(){return h}),n.d(i,"DISTANCE",function(){return f});var r=n(36),s=n.n(r).a,a=n(37),o=n.n(a).a,u="POSITION",c="NORMAL",h="DEPTH",f="DISTANCE",l={webgl:s,webglExtensions:o,Hilo:i};Object.assign(l,s,o,i);e.a=l},function(t,e,n){"use strict";var i={},r={_cache:i,level:3,LEVEL_LOG:3,LEVEL_WARN:2,LEVEL_ERROR:1,LEVEL_NONE:0,log:function(){return this.level>=3&&console.log.apply(console,arguments),this},warn:function(){return this.level>=2&&console.warn.apply(console,arguments),this},error:function(){return this.level>=1&&console.error.apply(console,arguments),this},logOnce:function(t){return i["log_"+t]||(i["log_"+t]=!0,this.log.apply(this,Array.prototype.slice.call(arguments,1))),this},warnOnce:function(t){return i["warn_"+t]||(i["warn_"+t]=!0,this.warn.apply(this,Array.prototype.slice.call(arguments,1))),this},errorOnce:function(t){return i["error_"+t]||(i["error_"+t]=!0,this.error.apply(this,Array.prototype.slice.call(arguments,1))),this}};e.a=r},function(t,e,n){"use strict";n.r(e),n.d(e,"each",function(){return p}),n.d(e,"getRelativePath",function(){return d}),n.d(e,"convertUint8ArrayToString",function(){return m}),n.d(e,"getExtension",function(){return _}),n.d(e,"getIndexFromSortedArray",function(){return g}),n.d(e,"insertToSortedArray",function(){return v}),n.d(e,"padLeft",function(){return T}),n.d(e,"getTypedArrayClass",function(){return L}),n.d(e,"copyArrayData",function(){return I}),n.d(e,"isStrOrNumber",function(){return O}),n.d(e,"getTypedArrayGLType",function(){return E}),n.d(e,"getBlobUrl",function(){return S}),n.d(e,"isArrayLike",function(){return R}),n.d(e,"getElementRect",function(){return y}),n.d(e,"serialRun",function(){return x});var i=n(3),r=n(2);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a,o=r.a.BYTE,u=r.a.UNSIGNED_BYTE,c=r.a.SHORT,h=r.a.UNSIGNED_SHORT,f=r.a.UNSIGNED_INT,l=r.a.FLOAT;function d(t,e){if(/^(?:http|blob|data:|\/)/.test(e))return e;var n;for(t=t.replace(/\/[^\/]*?$/,"").split("/"),e=e.split("/"),n=0;n>1,a=n(t[s],e);if(0===a)return[s,s];a<0?i=s+1:r=s-1}return i>r?[r,i]:[i,r]}function v(t,e,n){var i=g(t,e,n);t.splice(i[1],0,e)}function T(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function E(t){return t instanceof Float32Array?l:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?h:t instanceof Uint32Array?f:l}var M,A,L=(s(M={},o,Int8Array),s(M,u,Uint8Array),s(M,c,Int16Array),s(M,h,Uint16Array),s(M,f,Uint32Array),s(M,l,Float32Array),A=M,function(t){return A[t]||Float32Array});function I(t,e,n,i,r){if(t&&e){e.isGeometryData&&(e=e.data);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce(function(t,n,i){return t.then(function(){return e(n,i)})},Promise.resolve())}},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=i.vec3.fromValues(t,e,n)},copy:function(t){return i.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return i.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),i.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec3.ceil(this.elements,this.elements),this},floor:function(){return i.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec3.round(this.elements,this.elements),this},scale:function(t){return i.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec3.squaredDistance(t.elements,e.elements)},length:function(){return i.vec3.length(this.elements)},squaredLength:function(){return i.vec3.squaredLength(this.elements)},negate:function(){return i.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec3.inverse(this.elements,t.elements),this},normalize:function(){return i.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return i.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,r,s){return i.vec3.hermite(this.elements,t.elements,e.elements,n.elements,r.elements,s),this},bezier:function(t,e,n,r,s){return i.vec3.bezier(this.elements,t.elements,e.elements,n.elements,r.elements,s),this},random:function(t){return i.vec3.random(this.elements,t),this},transformMat3:function(t){return i.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return i.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,i=e[0],r=e[1],s=e[2];return e[0]=i*n[0]+r*n[4]+s*n[8],e[1]=i*n[1]+r*n[5]+s*n[9],e[2]=i*n[2]+r*n[6]+s*n[10],this},transformQuat:function(t){return i.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return i.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return i.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return i.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){"use strict";var i,r={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(i=0,function(t){var e=++i;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=r},function(t,e,n){"use strict";var i,r=n(0),s=n(1),a=n(5),o=n(10),u=new a.a,c=new a.a,h=s.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=r.mat4.create()},copy:function(t){return r.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)t[e+i]=n[i];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)n[i]=t[e+i];return this},set:function(t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p){return r.mat4.set(this.elements,t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p),this},identity:function(){return r.mat4.identity(this.elements),this},transpose:function(){return r.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return r.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return r.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return r.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return r.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return r.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return r.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return r.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return r.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return r.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return r.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return r.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return r.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return r.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return r.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return r.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,i){return r.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,i.elements),this},fromQuat:function(t){return r.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,i,s,a){return r.mat4.frustum(this.elements,t,e,n,i,s,a),this},perspective:function(t,e,n,i){return r.mat4.perspective(this.elements,t,e,n,i),this},perspectiveFromFieldOfView:function(t,e,n){return r.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,i,s,a){return r.mat4.ortho(this.elements,t,e,n,i,s,a),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),r.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var i=this.elements,r=t[0],s=t[1],a=t[2],o=n[0],h=n[1],f=n[2],l=r-e[0],d=s-e[1],m=a-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=h*m-f*d,g=f*l-o*m,v=o*d-h*l;return(_=p*p+g*g+v*v)>0?(p*=_=1/Math.sqrt(_),g*=_,v*=_):(_=(p=h*m-f*d)*p+(g=f*l-(o+=1e-7)*m)*g+(v=o*d-h*l)*v,p*=_=1/Math.sqrt(_),g*=_,v*=_),i[0]=p,i[1]=g,i[2]=v,i[3]=0,i[4]=d*v-m*g,i[5]=m*p-l*v,i[6]=l*g-d*p,i[7]=0,i[8]=l,i[9]=d,i[10]=m,i[11]=0,i[12]=r,i[13]=s,i[14]=a,i[15]=1,this},frob:function(){return r.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,i){return i?this.fromRotationTranslationScaleOrigin(t,e,n,i):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,r){return this.getScaling(n),this.getTranslation(e),i||(i=new h),this.determinant()<0&&(n.x*=-1),i.copy(this),u.inverse(n),i.scale(u),t.fromMat4(i),r&&r.set(0,0,0),this}});h.prototype.sub=h.prototype.subtract,h.prototype.mul=h.prototype.multiply,e.a=h},function(t,e,n){"use strict";var i=n(1),r=n(12),s=n(4),a=i.a.create({Extends:r.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;a.superclass.constructor.call(this,t,e,n,i)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(s.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(s.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=a},function(t,e,n){"use strict";var i=n(38),r=n.n(i);e.a=r.a},function(t,e,n){"use strict";var i=n(0),r=n(11),s=n(1),a=n(9),o=new r.a,u=s.a.create({Mixes:a.a,className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=i.quat.fromValues(t,e,n,r)},copy:function(t,e){return i.quat.copy(this.elements,t.elements),e||this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=this.elements;return i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],n||this.fire("update"),this},set:function(t,e,n,r,s){return i.quat.set(this.elements,t,e,n,r),s||this.fire("update"),this},identity:function(t){return i.quat.identity(this.elements),t||this.fire("update"),this},rotationTo:function(t,e,n){return i.quat.rotationTo(this.elements,t.elements,e.elements),n||this.fire("update"),this},setAxes:function(t,e,n,r){return i.quat.setAxes(this.elements,t.elements,e.elements,n.elements),r||this.fire("update"),this},setAxisAngle:function(t,e,n){return i.quat.setAxisAngle(this.elements,t.elements,e),n||this.fire("update"),this},getAxisAngle:function(t){return i.quat.getAxisAngle(t.elements,this.elements)},add:function(t,e){return i.quat.add(this.elements,this.elements,t.elements),e||this.fire("update"),this},multiply:function(t,e){return i.quat.multiply(this.elements,this.elements,t.elements),e||this.fire("update"),this},premultiply:function(t,e){return i.quat.multiply(this.elements,t.elements,this.elements),e||this.fire("update"),this},scale:function(t,e){return i.quat.scale(this.elements,this.elements,t),e||this.fire("update"),this},rotateX:function(t,e){return i.quat.rotateX(this.elements,this.elements,t),e||this.fire("update"),this},rotateY:function(t,e){return i.quat.rotateY(this.elements,this.elements,t),e||this.fire("update"),this},rotateZ:function(t,e){return i.quat.rotateZ(this.elements,this.elements,t),e||this.fire("update"),this},calculateW:function(t){return i.quat.calculateW(this.elements,this.elements),t||this.fire("update"),this},dot:function(t){return i.quat.dot(this.elements,t.elements)},lerp:function(t,e,n){return i.quat.lerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},slerp:function(t,e,n){return i.quat.slerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},sqlerp:function(t,e,n,r,s,a){return i.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,r.elements,s),a||this.fire("update"),this},invert:function(t){return i.quat.invert(this.elements,this.elements),t||this.fire("update"),this},conjugate:function(t){return i.quat.conjugate(this.elements,this.elements),t||this.fire("update"),this},length:function(){return i.quat.length(this.elements)},squaredLength:function(){return i.quat.squaredLength(this.elements)},normalize:function(t){return i.quat.normalize(this.elements,this.elements),t||this.fire("update"),this},fromMat3:function(t,e){return i.quat.fromMat3(this.elements,t.elements),e||this.fire("update"),this},fromMat4:function(t,e){return o.fromMat4(t),this.fromMat3(o,e),this},exactEquals:function(t){return i.quat.exactEquals(this.elements,t.elements)},equals:function(t){return i.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,i=.5*t.y,r=.5*t.z,s=t.order||"ZYX",a=Math.sin(n),o=Math.cos(n),u=Math.sin(i),c=Math.cos(i),h=Math.sin(r),f=Math.cos(r),l=this.elements;return"XYZ"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f-a*u*h):"YXZ"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f+a*u*h):"ZXY"===s?(l[0]=a*c*f-o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f-a*u*h):"ZYX"===s?(l[0]=a*c*f-o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f+a*u*h):"YZX"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f-a*u*h):"XZY"===s&&(l[0]=a*c*f-o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f+a*u*h),e||this.fire("update"),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.fire("update")}}});u.prototype.mul=u.prototype.multiply,u.prototype.len=u.prototype.length,u.prototype.sqrLen=u.prototype.squaredLength,e.a=u},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=i.mat3.create()},copy:function(t){return i.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<9;i++)t[e+i]=n[i];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<9;i++)n[i]=t[e+i];return this},set:function(t,e,n,r,s,a,o,u,c){return i.mat3.set(this.elements,t,e,n,r,s,a,o,u,c),this},identity:function(){return i.mat3.identity(this.elements),this},transpose:function(){return i.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return i.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return i.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return i.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return i.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return i.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return i.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return i.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return i.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return i.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,i,r){var s=Math.cos(t),a=Math.sin(t);return this.set(i*s,-r*a,0,i*a,r*s,0,e,n,1),this}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,e.a=r},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=i.vec4.fromValues(t,e,n,r)},copy:function(t){return i.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,r){return i.vec4.set(this.elements,t,e,n,r),this},add:function(t,e){return e||(e=t,t=this),i.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec4.ceil(this.elements,this.elements),this},floor:function(){return i.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec4.round(this.elements,this.elements),this},scale:function(t){return i.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec4.squaredDistance(t.elements,e.elements)},length:function(){return i.vec4.length(this.elements)},squaredLength:function(){return i.vec4.squaredLength(this.elements)},negate:function(){return i.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec4.inverse(this.elements,t.elements),this},normalize:function(){return i.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return i.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return i.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return i.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){"use strict";var i=n(1),r=n(6),s=n(7),a=n(3),o=new s.a,u=r.a.DEG2RAD,c=r.a.RAD2DEG,h=i.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,i=n[0],s=n[1],o=n[2],u=n[4],c=n[5],h=n[6],f=n[8],l=n[9],d=n[10];e=e||this.order,this.order=e;var m=r.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-u,i)):(this.elements[0]=Math.atan2(h,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(f,d),this.elements[2]=Math.atan2(s,c)):(this.elements[1]=Math.atan2(-o,i),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(m(h,-1,1)),Math.abs(h)<.99999?(this.elements[1]=Math.atan2(-o,d),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(s,i))):"ZYX"===e?(this.elements[1]=Math.asin(-m(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(h,d),this.elements[2]=Math.atan2(s,i)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(m(s,-1,1)),Math.abs(s)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-o,i)):(this.elements[0]=0,this.elements[1]=Math.atan2(f,d))):"XZY"===e?(this.elements[2]=Math.asin(-m(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(h,c),this.elements[1]=Math.atan2(f,i)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):a.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=h},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=i.vec2.fromValues(t,e)},copy:function(t){return i.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return i.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),i.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec2.ceil(this.elements,this.elements),this},floor:function(){return i.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec2.round(this.elements,this.elements),this},scale:function(t){return i.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec2.squaredDistance(t.elements,e.elements)},length:function(){return i.vec2.length(this.elements)},squaredLength:function(){return i.vec2.squaredLength(this.elements)},negate:function(){return i.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec2.inverse(this.elements,t.elements),this},normalize:function(){return i.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return i.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return i.vec2.random(this.elements,t),this},transformMat3:function(t){return i.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return i.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){var i=n(31),r=n(115),s=n(117),a=n(118),o=n(119),u=[r],c=[s];function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t instanceof Uint8Array&&(e=t.byteOffset,t=t.buffer),function(t){return new u[t.type](t).decompress()}(function(t,e){var n=new Uint8Array(t,e,4);if(65!==n[0]||77!==n[1]||67!==n[2])throw new Error("The file is not AMC format!");var i=c[n[3]].read(t,e+4);return i.geometry.type=n[3],i.geometry}(t,e))}var f,l=null,d=null;function m(t){return!l&&o()?(l=new a({wasmURL:t}),d=l.init()):d||Promise.resolve()}function _(t,e){if(l||m(),!l||!l.isReady)return h(t);try{return l.decompress(t)}catch(e){return console.warn("wasm decompress error",e),h(t)}}var p=null;function g(t){return t=t||"https://g.alicdn.com/hilo/amc/0.1.21/worker.js",p||(!1===f||"undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob?Promise.reject("dont support web worker"):p=new Promise(function(e,n){var i=new XMLHttpRequest;i.addEventListener("load",function(){var t=URL.createObjectURL(new Blob([this.responseText]));(f=new Worker(t)).onerror=function(t){console.log("web worker error",t),f=!1,n(t)},e(f)}),i.addEventListener("error",function(t){return n(t)}),i.open("get",t,!0),i.send()}))}var v=0;function T(t,e,n,r){return e=e&&o(),t=new Uint8Array(t),g(r).then(function(r){return new Promise(function(s,a){var o=v++,u=function(e){if(e.data.id===o)if(r.removeEventListener("message",u),u=null,e.data.data){var n=e.data.data;n.constructor=i,n.__proto__=i.prototype,s(n)}else s(h(t))};r.addEventListener("message",u),r.postMessage({id:o,data:t,useWASM:e,wasmURL:n},[t.buffer])})}).catch(function(n){return e?_(t):h(t)})}t.exports={initWASM:m,initWorker:g,decompress:function(t,e,n){var i=o();return!i||t.byteLength>1048576?T(t,i,e,n):i?Promise.resolve(_(t)):Promise.resolve(h(t))},decompressWithJS:h,decompressWithWASM:_,decompressWithWorker:T}},function(t,e,n){"use strict";var i=n(39),r=n.n(i),s=n(1),a=n(5),o=s.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new r.a,this.origin=t.origin||new a.a(0,0,0),this.direction=t.direction||new a.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,i,r){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,i,r)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,i,r)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort(function(t,i){return n.squaredDistance(t[e])-n.squaredDistance(i[e])}):t.sort(function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)})},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new a.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var i=n(0),r=n(1),s=n(9),a=n(5),o=r.a.create({Mixes:s.a,Extends:a.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=i.vec3.fromValues(t,e,n)},copy:function(t){return i.vec3.copy(this.elements,t.elements),this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.fire("update"),this},set:function(t,e,n){return i.vec3.set(this.elements,t,e,n),this.fire("update"),this},add:function(t,e){return e||(e=t,t=this),i.vec3.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),i.vec3.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},multiply:function(t,e){return e||(e=t,t=this),i.vec3.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},divide:function(t,e){return e||(e=t,t=this),i.vec3.divide(this.elements,t.elements,e.elements),this.fire("update"),this},ceil:function(){return i.vec3.ceil(this.elements,this.elements),this.fire("update"),this},floor:function(){return i.vec3.floor(this.elements,this.elements),this.fire("update"),this},min:function(t,e){return e||(e=t,t=this),i.vec3.min(this.elements,t.elements,e.elements),this.fire("update"),this},max:function(t,e){return e||(e=t,t=this),i.vec3.max(this.elements,t.elements,e.elements),this.fire("update"),this},round:function(){return i.vec3.round(this.elements,this.elements),this.fire("update"),this},scale:function(t){return i.vec3.scale(this.elements,this.elements,t),this.fire("update"),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.fire("update"),this},distance:function(t,e){return e||(e=t,t=this),i.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec3.squaredDistance(t.elements,e.elements)},length:function(){return i.vec3.length(this.elements)},squaredLength:function(){return i.vec3.squaredLength(this.elements)},negate:function(){return i.vec3.negate(this.elements,this.elements),this.fire("update"),this},inverse:function(t){return t||(t=this),i.vec3.inverse(this.elements,t.elements),this.fire("update"),this},normalize:function(){return i.vec3.normalize(this.elements,this.elements),this.fire("update"),this},dot:function(t,e){return e||(e=t,t=this),i.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec3.cross(this.elements,t.elements,e.elements),this.fire("update"),this},lerp:function(t,e){return i.vec3.lerp(this.elements,this.elements,t.elements,e),this.fire("update"),this},hermite:function(t,e,n,r,s){return i.vec3.hermite(this.elements,t.elements,e.elements,n.elements,r.elements,s),this.fire("update"),this},bezier:function(t,e,n,r,s){return i.vec3.bezier(this.elements,t.elements,e.elements,n.elements,r.elements,s),this.fire("update"),this},random:function(t){return i.vec3.random(this.elements,t),this.fire("update"),this},transformMat3:function(t){return i.vec3.transformMat3(this.elements,this.elements,t.elements),this.fire("update"),this},transformMat4:function(t){return i.vec3.transformMat4(this.elements,this.elements,t.elements),this.fire("update"),this},transformDirection:function(t){var e=this.elements,n=t.elements,i=e[0],r=e[1],s=e[2];return e[0]=i*n[0]+r*n[4]+s*n[8],e[1]=i*n[1]+r*n[5]+s*n[9],e[2]=i*n[2]+r*n[6]+s*n[10],this.fire("update"),this},transformQuat:function(t){return i.vec3.transformQuat(this.elements,this.elements,t.elements),this.fire("update"),this},rotateX:function(t,e){return i.vec3.rotateX(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateY:function(t,e){return i.vec3.rotateY(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateZ:function(t,e){return i.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}}});e.a=o},function(t,e){t.exports="#define GLSLIFY 1\n#define HILO_FRONT_SIDE 1028\n#define HILO_BACK_SIDE 1029\n#define HILO_FRONT_AND_BACK_SIDE 1032\n#define HILO_PI 3.141592653589793\n#define HILO_INVERSE_PI 0.3183098861837907"},function(t,e){var n=function(){var t,e,n=function(t){var e,n,r={};for(e in t)n=t[e],i.hasOwnProperty(e)?i[e].call(this,n):r[e]=n;s(this.prototype,r)},i={Extends:function(t){var e=this.prototype,n=r(t.prototype);s(this,t),s(n,e),n.constructor=this,this.prototype=n,this.superclass=t.prototype},Mixes:function(t){t instanceof Array||(t=[t]);for(var e,n=this.prototype;e=t.shift();)s(n,e.prototype||e)},Statics:function(t){s(this,t)}},r=function(){if(Object.__proto__)return function(t){return{__proto__:t}};var t=function(){};return function(e){return t.prototype=e,new t}}(),s=function(t){for(var n=1,i=arguments.length;n0&&void 0!==arguments[0]?arguments[0]:new r.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,i){return this.normal.set(t,e,n),this.distance=i,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new r.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=s},function(t,e,n){"use strict";var i=n(1),r=n(5),s=new r.a,a=i.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new r.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)n[i]=t[e+i];return this.fire("update"),this},set:function(t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p){return r.mat4.set(this.elements,t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p),this.fire("update"),this},identity:function(){return r.mat4.identity(this.elements),this.fire("update"),this},transpose:function(){return r.mat4.transpose(this.elements,this.elements),this.fire("update"),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.invert(this.elements,t.elements),this.fire("update"),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.adjoint(this.elements,t.elements),this.fire("update"),this},determinant:function(){return r.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat4.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},premultiply:function(t){return this.multiply(t,this),this.fire("update"),this},translate:function(t){return r.mat4.translate(this.elements,this.elements,t.elements),this.fire("update"),this},scale:function(t){return r.mat4.scale(this.elements,this.elements,t.elements),this.fire("update"),this},rotate:function(t,e){return r.mat4.rotate(this.elements,this.elements,t,e.elements),this.fire("update"),this},rotateX:function(t){return r.mat4.rotateX(this.elements,this.elements,t),this.fire("update"),this},rotateY:function(t){return r.mat4.rotateY(this.elements,this.elements,t),this.fire("update"),this},rotateZ:function(t){return r.mat4.rotateZ(this.elements,this.elements,t),this.fire("update"),this},fromTranslation:function(t){return r.mat4.fromTranslation(this.elements,t.elements),this.fire("update"),this},fromScaling:function(t){return r.mat4.fromScaling(this.elements,t.elements),this.fire("update"),this},fromRotation:function(t,e){return r.mat4.fromRotation(this.elements,t,e.elements),this.fire("update"),this},fromXRotation:function(t){return r.mat4.fromXRotation(this.elements,t),this.fire("update"),this},fromYRotation:function(t){return r.mat4.fromYRotation(this.elements,t),this.fire("update"),this},fromZRotation:function(t){return r.mat4.fromZRotation(this.elements,t),this.fire("update"),this},fromRotationTranslation:function(t,e){return r.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.fire("update"),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.a;return r.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return r.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},fromRotationTranslationScaleOrigin:function(t,e,n,i,s){return r.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,i.elements),s||this.fire("update"),this},fromQuat:function(t){return r.mat4.fromQuat(this.elements,t.elements),this.fire("update"),this},frustum:function(t,e,n,i,s,a){return r.mat4.frustum(this.elements,t,e,n,i,s,a),this.fire("update"),this},perspective:function(t,e,n,i){return r.mat4.perspective(this.elements,t,e,n,i),this.fire("update"),this},perspectiveFromFieldOfView:function(t,e,n){return r.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.fire("update"),this},ortho:function(t,e,n,i,s,a){return r.mat4.ortho(this.elements,t,e,n,i,s,a),this.fire("update"),this},lookAt:function(t,e,n){return t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),r.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},targetTo:function(t,e,n){t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var i=this.elements,r=t[0],s=t[1],a=t[2],o=n[0],u=n[1],c=n[2],l=r-e[0],d=s-e[1],m=a-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=u*m-c*d,g=c*l-o*m,v=o*d-u*l;return(_=p*p+g*g+v*v)>0?(p*=_=1/Math.sqrt(_),g*=_,v*=_):(_=(p=u*m-c*d)*p+(g=c*l-(o+=1e-7)*m)*g+(v=o*d-u*l)*v,p*=_=1/Math.sqrt(_),g*=_,v*=_),i[0]=p,i[1]=g,i[2]=v,i[3]=0,i[4]=d*v-m*g,i[5]=m*p-l*v,i[6]=l*g-d*p,i[7]=0,i[8]=l,i[9]=d,i[10]=m,i[11]=0,i[12]=r,i[13]=s,i[14]=a,i[15]=1,this.fire("update"),this},frob:function(){return r.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat4.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),r.mat4.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,i){return i?this.fromRotationTranslationScaleOrigin(t,e,n,i):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,r){return this.getScaling(n),this.getTranslation(e),i||(i=new u.a),this.determinant()<0&&(n.x*=-1),i.copy(this),h.inverse(n),i.scale(h),t.fromMat4(i),r&&r.set(0,0,0),this}});e.a=l},function(t,e,n){"use strict";var i=n(1),r=n(9),s=n(6),a=n(13),o=s.a.DEG2RAD,u=s.a.RAD2DEG,c=i.a.create({Mixes:r.a,Extends:a.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a.a.call(this,t,e,n)},updateDegrees:function(){return c.superclass.updateDegrees.call(this),this.fire("update"),this},updateRadians:function(){return c.superclass.updateRadians.call(this),this.fire("update"),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*o,this.fire("update")}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*o,this.fire("update")}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*o,this.fire("update")}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*u,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*u,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*u,this.fire("update")}}});e.a=c},function(t,e,n){"use strict";var i=n(1),r=n(20),s=i.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new r.a)},copy:function(t){var e=t.planes;return this.planes.forEach(function(t,n){t.copy(e[n])}),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],u=n[5],c=n[6],h=n[7],f=n[8],l=n[9],d=n[10],m=n[11],_=n[12],p=n[13],g=n[14],v=n[15];return e[0].set(a-i,h-o,m-f,v-_).normalize(),e[1].set(a+i,h+o,m+f,v+_).normalize(),e[2].set(a+r,h+u,m+l,v+p).normalize(),e[3].set(a-r,h-u,m-l,v-p).normalize(),e[4].set(a-s,h-c,m-d,v-g).normalize(),e[5].set(a+s,h+c,m+d,v+g).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)1&&void 0!==arguments[1]?arguments[1]:4;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.indices=e,this.mode=n,this.attrs=[],this.attrIndexMap={}}return r(t,null,[{key:"cp",value:function(t){return t}},{key:"minus",value:function(t,e){return t-e}},{key:"plus",value:function(t,e){return t+e}},{key:"pp",value:function(t,e,n,i){return i-e-n+t}},{key:"depp",value:function(t,e,n,i){return e+n-t+i}},{key:"ATTR",get:function(){return a}},{key:"ATTR_NAME_ID",get:function(){return u}}]),r(t,[{key:"getAttrLength",value:function(){return this.attrs[0].data.length/this.attrs[0].itemCount}},{key:"attrIdToName",value:function(t){return o[t]||"OTHER"}},{key:"addAttr",value:function(t,e,n){a[t]?(this.attrIndexMap[t]=this.attrs.length,n||(n=f[t])):n||(n=1),this.attrs.push({name:t,itemCount:n,data:e})}},{key:"getAttr",value:function(t){if(this.attrIndexMap[t])return this.attrs[this.attrIndexMap[t]];for(var e=this.attrs.length-1;e>=0;e--){var n=this.attrs[e];if(n.name===t)return n}}},{key:"cal",value:function(t,e,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),s=3;s=0;c--)o[u+c]=n.apply(null,r.map(function(t){return a[t*i.itemCount+c]}))})}},{key:"quantize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attrs.forEach(function(e){if("JOINT"!==e.name&&0!=t[e.name]){var n=s.encode(e.data,t[e.name]||12);e.quantizationBit=n.quantizationBit,e.min=n.min,e.max=n.max,e.data=n.data}})}},{key:"dequantize",value:function(){this.attrs.forEach(function(t){t.quantizationBit&&(t.data=s.decode(t.data,t.quantizationBit,t.min,t.max))})}},{key:"convertTypedArray",value:function(){!this.indices||this.indices instanceof Array||(this.indices=Array.from(this.indices)),this.attrs.forEach(function(t){t.data instanceof Array||t.data instanceof Float32Array||(t.data=Array.from(t.data))})}},{key:"clearEBAttrs",value:function(){delete this.clers,delete this.holes,delete this.handles}},{key:"convertToTypedArray",value:function(){this.indices instanceof Array&&(this.getAttrLength()>65535?this.indices=new Uint32Array(this.indices):this.indices=new Uint16Array(this.indices)),this.attrs.forEach(function(t){t.data instanceof Array&&(t.data=new Float32Array(t.data))})}},{key:"prepareToWorkerSend",value:function(){return this.clearEBAttrs(),this.convertToTypedArray(),this.getAllBuffers()}},{key:"clone",value:function(){var e=new t(Array.from(this.indices),this.mode);return Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map(function(t){var e=Object.assign({},t);return e.data=Array.from(e.data),e}),e}},{key:"cloneStruct",value:function(){var e=new t;return e.mode=this.mode,this.indices&&(e.indices=[]),Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map(function(t){var e=Object.assign({},t);return e.data=[],e}),e}},{key:"toHilo3dGeometry",value:function(t,e){var n=e||new t.Geometry;return this.indices&&(this.indices.BYTES_PER_ELEMENT?n.indices=new t.GeometryData(this.indices,1):this.getAttrLength()>65535?n.indices=new t.GeometryData(new Uint32Array(this.indices),1):n.indices=new t.GeometryData(new Uint16Array(this.indices),1)),this.attrs.forEach(function(e){var i=c[e.name];i&&(e.data.BYTES_PER_ELEMENT?n[i]=new t.GeometryData(e.data,e.itemCount):n[i]=new t.GeometryData(new Float32Array(e.data),e.itemCount))}),n}},{key:"getAllBuffers",value:function(){var t=[];return this.indices.BYTES_PER_ELEMENT&&t.push(this.indices.buffer),this.attrs.forEach(function(e){e.data&&e.data.BYTES_PER_ELEMENT&&t.push(e.data.buffer)}),t}}],[{key:"fromGLTFPrimitive",value:function(e){var n=new t(e.indices,e.mode),i=e.attributes,r=0;for(var s in i.POSITION&&(r=i.POSITION.length/3),i)if(a[s]){var o=f[a[s]];r&&(o=i[s].length/r),n.addAttr(a[s],i[s],o)}else console.warn("Dont support attribute",s);return n}},{key:"fromHilo3dGeometry",value:function(e){var n=new t(e.indices.data,e.mode);for(var i in h)e[i]&&n.addAttr(h[i],e[i].data,e[i].size);return n}}]),t}();t.exports=l},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}},function(t,e){t.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},function(t,e){t.exports={ACTIVE_ATTRIBUTES:35721,ACTIVE_ATTRIBUTE_MAX_LENGTH:35722,ACTIVE_TEXTURE:34016,ACTIVE_UNIFORMS:35718,ACTIVE_UNIFORM_MAX_LENGTH:35719,ALIASED_LINE_WIDTH_RANGE:33902,ALIASED_POINT_SIZE_RANGE:33901,ALPHA:6406,ALPHA_BITS:3413,ALWAYS:519,ARRAY_BUFFER:34962,ARRAY_BUFFER_BINDING:34964,ATTACHED_SHADERS:35717,BACK:1029,BLEND:3042,BLEND_COLOR:32773,BLEND_DST_ALPHA:32970,BLEND_DST_RGB:32968,BLEND_EQUATION:32777,BLEND_EQUATION_ALPHA:34877,BLEND_EQUATION_RGB:32777,BLEND_SRC_ALPHA:32971,BLEND_SRC_RGB:32969,BLUE_BITS:3412,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,BROWSER_DEFAULT_WEBGL:37444,BUFFER_SIZE:34660,BUFFER_USAGE:34661,BYTE:5120,CCW:2305,CLAMP_TO_EDGE:33071,COLOR_ATTACHMENT0:36064,COLOR_BUFFER_BIT:16384,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,COMPILE_STATUS:35713,COMPRESSED_TEXTURE_FORMATS:34467,CONSTANT_ALPHA:32771,CONSTANT_COLOR:32769,CONTEXT_LOST_WEBGL:37442,CULL_FACE:2884,CULL_FACE_MODE:2885,CURRENT_PROGRAM:35725,CURRENT_VERTEX_ATTRIB:34342,CW:2304,DECR:7683,DECR_WRAP:34056,DELETE_STATUS:35712,DEPTH_ATTACHMENT:36096,DEPTH_BITS:3414,DEPTH_BUFFER_BIT:256,DEPTH_CLEAR_VALUE:2931,DEPTH_COMPONENT:6402,DEPTH_COMPONENT16:33189,DEPTH_FUNC:2932,DEPTH_RANGE:2928,DEPTH_STENCIL:34041,DEPTH_STENCIL_ATTACHMENT:33306,DEPTH_TEST:2929,DEPTH_WRITEMASK:2930,DITHER:3024,DONT_CARE:4352,DST_ALPHA:772,DST_COLOR:774,DYNAMIC_DRAW:35048,ELEMENT_ARRAY_BUFFER:34963,ELEMENT_ARRAY_BUFFER_BINDING:34965,EQUAL:514,FASTEST:4353,FLOAT:5126,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,FRAGMENT_SHADER:35632,FRAMEBUFFER:36160,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_BINDING:36006,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_UNSUPPORTED:36061,FRONT:1028,FRONT_AND_BACK:1032,FRONT_FACE:2886,FUNC_ADD:32774,FUNC_REVERSE_SUBTRACT:32779,FUNC_SUBTRACT:32778,GENERATE_MIPMAP_HINT:33170,GEQUAL:518,GREATER:516,GREEN_BITS:3411,HIGH_FLOAT:36338,HIGH_INT:36341,INCR:7682,INCR_WRAP:34055,INFO_LOG_LENGTH:35716,INT:5124,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,INVALID_ENUM:1280,INVALID_FRAMEBUFFER_OPERATION:1286,INVALID_OPERATION:1282,INVALID_VALUE:1281,INVERT:5386,KEEP:7680,LEQUAL:515,LESS:513,LINEAR:9729,LINEAR_MIPMAP_LINEAR:9987,LINEAR_MIPMAP_NEAREST:9985,LINES:1,LINE_LOOP:2,LINE_STRIP:3,LINE_WIDTH:2849,LINK_STATUS:35714,LOW_FLOAT:36336,LOW_INT:36339,LUMINANCE:6409,LUMINANCE_ALPHA:6410,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_CUBE_MAP_TEXTURE_SIZE:34076,MAX_FRAGMENT_UNIFORM_VECTORS:36349,MAX_RENDERBUFFER_SIZE:34024,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_TEXTURE_SIZE:3379,MAX_VARYING_VECTORS:36348,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VIEWPORT_DIMS:3386,MEDIUM_FLOAT:36337,MEDIUM_INT:36340,MIRRORED_REPEAT:33648,NEAREST:9728,NEAREST_MIPMAP_LINEAR:9986,NEAREST_MIPMAP_NEAREST:9984,NEVER:512,NICEST:4354,NONE:0,NOTEQUAL:517,NO_ERROR:0,NUM_COMPRESSED_TEXTURE_FORMATS:34466,ONE:1,ONE_MINUS_CONSTANT_ALPHA:32772,ONE_MINUS_CONSTANT_COLOR:32770,ONE_MINUS_DST_ALPHA:773,ONE_MINUS_DST_COLOR:775,ONE_MINUS_SRC_ALPHA:771,ONE_MINUS_SRC_COLOR:769,OUT_OF_MEMORY:1285,PACK_ALIGNMENT:3333,POINTS:0,POLYGON_OFFSET_FACTOR:32824,POLYGON_OFFSET_FILL:32823,POLYGON_OFFSET_UNITS:10752,RED_BITS:3410,RENDERBUFFER:36161,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_BINDING:36007,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_STENCIL_SIZE:36181,RENDERBUFFER_WIDTH:36162,RENDERER:7937,REPEAT:10497,REPLACE:7681,RGB:6407,RGB5_A1:32855,RGB565:36194,RGBA:6408,RGBA4:32854,SAMPLER_2D:35678,SAMPLER_CUBE:35680,SAMPLES:32937,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_BUFFERS:32936,SAMPLE_COVERAGE:32928,SAMPLE_COVERAGE_INVERT:32939,SAMPLE_COVERAGE_VALUE:32938,SCISSOR_BOX:3088,SCISSOR_TEST:3089,SHADER_COMPILER:36346,SHADER_SOURCE_LENGTH:35720,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,SHORT:5122,SRC_ALPHA:770,SRC_ALPHA_SATURATE:776,SRC_COLOR:768,STATIC_DRAW:35044,STENCIL_ATTACHMENT:36128,STENCIL_BACK_FAIL:34817,STENCIL_BACK_FUNC:34816,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,STENCIL_BITS:3415,STENCIL_BUFFER_BIT:1024,STENCIL_CLEAR_VALUE:2961,STENCIL_FAIL:2964,STENCIL_FUNC:2962,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_TEST:2960,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STREAM_DRAW:35040,SUBPIXEL_BITS:3408,TEXTURE:5890,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,TEXTURE_2D:3553,TEXTURE_BINDING_2D:32873,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP:34067,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TRIANGLES:4,TRIANGLE_FAN:6,TRIANGLE_STRIP:5,UNPACK_ALIGNMENT:3317,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,UNSIGNED_BYTE:5121,UNSIGNED_INT:5125,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,VALIDATE_STATUS:35715,VENDOR:7936,VERSION:7938,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_SHADER:35633,VIEWPORT:2978,ZERO:0}},function(t,e,n){t.exports={VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,UNMASKED_VENDOR_WEBGL:37445,UNMASKED_RENDERER_WEBGL:37446,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,TEXTURE_MAX_ANISOTROPY_EXT:34046,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35986,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,UNSIGNED_INT_24_8_WEBGL:34042,HALF_FLOAT_OES:36193,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863,MIN_EXT:32775,MAX_EXT:32776,SRGB_EXT:35904,SRGB_ALPHA_EXT:35906,SRGB8_ALPHA8_EXT:35907,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,VERTEX_ARRAY_BINDING_OES:34229,QUERY_COUNTER_BITS_EXT:34916,CURRENT_QUERY_EXT:34917,QUERY_RESULT_EXT:34918,QUERY_RESULT_AVAILABLE_EXT:34919,TIME_ELAPSED_EXT:35007,TIMESTAMP_EXT:36392,GPU_DISJOINT_EXT:36795}},function(t,e,n){var i={_listeners:null,on:function(t,e,n){for(var i=this._listeners=this._listeners||{},r=i[t]=i[t]||[],s=0,a=r.length;s-1&&a.splice(h,1)}}return 0==a.length&&delete s[i],!0}return!1}},r=n(19).create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),s=window.Event;if(s){var a=s.prototype,o=a.stopImmediatePropagation;a.stopImmediatePropagation=function(){o&&o.call(this),this._stopped=!0}}t.exports=i},function(t,e,n){var i=n(95),r=n(97),s=n(98),a=n(101),o=n(35),u=[[0,0,0],[0,0,0],[0,0,0]],c=[0,0,0];function h(t,e){this.origin=t||[0,0,0],this.direction=e||[0,0,-1]}t.exports=h,h.prototype.set=function(t,e){this.origin=t,this.direction=e},h.prototype.copy=function(t){o(this.origin,t.origin),o(this.direction,t.direction)},h.prototype.clone=function(){var t=new h;return t.copy(this),t},h.prototype.intersectsSphere=function(t,e){return s(c,this.origin,this.direction,t,e)},h.prototype.intersectsPlane=function(t,e){return r(c,this.origin,this.direction,t,e)},h.prototype.intersectsTriangle=function(t){return i(c,this.origin,this.direction,t)},h.prototype.intersectsBox=function(t){return a(c,this.origin,this.direction,t)},h.prototype.intersectsTriangleCell=function(t,e){var n=t[0],i=t[1],r=t[2];return u[0]=e[n],u[1]=e[i],u[2]=e[r],this.intersectsTriangle(u)}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_COLOR\n varying vec4 v_color;\n#endif\n\n#ifdef HILO_USE_HDR\n uniform float u_exposure;\n#endif\n\n#ifdef HILO_GAMMA_CORRECTION\n uniform float u_gammaFactor;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_TEXCOORD0\n varying vec2 v_texcoord0;\n#endif\n\n#ifdef HILO_HAS_TEXCOORD1\n varying vec2 v_texcoord1;\n#endif\n\n#if defined(HILO_HAS_TEXCOORD0) || defined(HILO_HAS_TEXCOORD1)\n #if defined(HILO_HAS_TEXCOORD0) && defined(HILO_HAS_TEXCOORD1)\n #define HILO_SAMPLER_2D hiloSampler2D\n #define HILO_TEXTURE_2D(HILO_SAMPLER_2D) hiloTexture2D(HILO_SAMPLER_2D.texture, HILO_SAMPLER_2D.uv)\n struct hiloSampler2D{\n sampler2D texture;\n int uv; \n };\n \n vec4 hiloTexture2D(sampler2D texture, int uv){\n if(uv == 0){\n return texture2D(texture, v_texcoord0);\n }\n else{\n return texture2D(texture, v_texcoord1);\n }\n }\n #else\n #ifdef HILO_HAS_TEXCOORD1\n #define HILO_V_TEXCOORD v_texcoord1\n #else\n #define HILO_V_TEXCOORD v_texcoord0\n #endif\n #define HILO_SAMPLER_2D sampler2D\n #define HILO_TEXTURE_2D(HILO_SAMPLER_2D) texture2D(HILO_SAMPLER_2D, HILO_V_TEXCOORD)\n #endif\n#endif\n\n\n#ifdef HILO_DIFFUSE_CUBE_MAP\n varying vec3 v_position;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_NORMAL\n varying vec3 v_normal;\n #ifdef HILO_NORMAL_MAP\n uniform HILO_SAMPLER_2D u_normalMap;\n varying mat3 v_TBN;\n \n #ifdef HILO_NORMAL_MAP_SCALE\n uniform float u_normalMapScale;\n #endif\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#if defined(HILO_HAS_LIGHT) || defined(HILO_HAS_FRAG_POS)\n varying vec3 v_fragPos;\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n#ifdef HILO_DIRECTIONAL_LIGHTS\n uniform vec3 u_directionalLightsColor[HILO_DIRECTIONAL_LIGHTS];\n uniform vec3 u_directionalLightsInfo[HILO_DIRECTIONAL_LIGHTS];\n #ifdef HILO_DIRECTIONAL_LIGHTS_SMC\n uniform sampler2D u_directionalLightsShadowMap[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform vec2 u_directionalLightsShadowMapSize[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform mat4 u_directionalLightSpaceMatrix[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform vec2 u_directionalLightsShadowBias[HILO_DIRECTIONAL_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_SPOT_LIGHTS\n uniform vec3 u_spotLightsPos[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsDir[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsColor[HILO_SPOT_LIGHTS];\n uniform vec2 u_spotLightsCutoffs[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsInfo[HILO_SPOT_LIGHTS];\n uniform float u_spotLightsRange[HILO_SPOT_LIGHTS];\n #ifdef HILO_SPOT_LIGHTS_SMC\n uniform sampler2D u_spotLightsShadowMap[HILO_SPOT_LIGHTS_SMC];\n uniform vec2 u_spotLightsShadowMapSize[HILO_SPOT_LIGHTS_SMC];\n uniform mat4 u_spotLightSpaceMatrix[HILO_SPOT_LIGHTS_SMC];\n uniform vec2 u_spotLightsShadowBias[HILO_SPOT_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_POINT_LIGHTS\n uniform vec3 u_pointLightsPos[HILO_POINT_LIGHTS];\n uniform vec3 u_pointLightsColor[HILO_POINT_LIGHTS];\n uniform vec3 u_pointLightsInfo[HILO_POINT_LIGHTS];\n uniform float u_pointLightsRange[HILO_POINT_LIGHTS];\n #ifdef HILO_POINT_LIGHTS_SMC\n uniform samplerCube u_pointLightsShadowMap[HILO_POINT_LIGHTS_SMC];\n uniform mat4 u_pointLightSpaceMatrix[HILO_POINT_LIGHTS_SMC];\n uniform vec2 u_pointLightsShadowBias[HILO_POINT_LIGHTS_SMC];\n uniform vec2 u_pointLightCamera[HILO_POINT_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_AREA_LIGHTS\n uniform vec3 u_areaLightsPos[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsColor[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsWidth[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsHeight[HILO_AREA_LIGHTS];\n uniform sampler2D u_areaLightsLtcTexture1;\n uniform sampler2D u_areaLightsLtcTexture2;\n\n "+n(114)+"\n#endif\n\n#ifdef HILO_AMBIENT_LIGHTS\n uniform vec3 u_ambientLightsColor;\n#endif\n\n"+n(66)+"\n"+n(67)+"\n"+n(68)+"\n"+n(69)+"\n"+n(70)},function(t,e){t.exports="#define GLSLIFY 1\nvec4 textureEnvMap(sampler2D texture, vec3 position){\n return texture2D(texture, vec2(atan(position.x, position.z) * HILO_INVERSE_PI * 0.5+0.5, acos(position.y) * HILO_INVERSE_PI));\n}\n\nvec4 textureEnvMap(samplerCube texture, vec3 position){\n return textureCube(texture, position);\n}\n\n#ifdef HILO_USE_SHADER_TEXTURE_LOD\n vec4 textureEnvMapLod(sampler2D texture, vec3 position, float lod){\n return texture2DLodEXT(texture, vec2(atan(position.x, position.z) * HILO_INVERSE_PI * 0.5+0.5, acos(position.y) * HILO_INVERSE_PI), lod);\n }\n\n vec4 textureEnvMapLod(samplerCube texture, vec3 position, float lod){\n return textureCubeLodEXT(texture, position, lod);\n }\n#endif\n\n"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_TRANSPARENCY_MAP\n uniform HILO_SAMPLER_2D u_transparency;\n#else\n uniform float u_transparency;\n#endif\n\n#ifdef HILO_ALPHA_CUTOFF\n uniform float u_alphaCutoff;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_FOG\n varying float v_dist;\n uniform vec4 u_fogColor;\n \n #ifdef HILO_FOG_LINEAR\n uniform vec2 u_fogInfo;\n #else\n uniform float u_fogInfo;\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_NORMAL_MAP\n vec3 normal = HILO_TEXTURE_2D(u_normalMap).rgb * 2.0 - 1.0;\n #ifdef HILO_NORMAL_MAP_SCALE\n normal.xy *= u_normalMapScale;\n #endif\n normal = normalize(v_TBN * normal);\n#elif defined(HILO_HAS_NORMAL)\n vec3 normal = normalize(v_normal);\n#else\n vec3 normal = vec3(0, 0, 1);\n#endif\n\n#if HILO_SIDE == HILO_BACK_SIDE\n normal = -normal;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_LIGHT\n #if HILO_SIDE == HILO_FRONT_AND_BACK_SIDE\n if(dot(-v_fragPos, normal) < 0.0){\n normal = -normal;\n }\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\nfloat transparency = 1.0;\n#ifdef HILO_TRANSPARENCY_MAP\n transparency = HILO_TEXTURE_2D(u_transparency).r;\n#else\n transparency = u_transparency;\n#endif\ncolor.a *= transparency;\n#ifdef HILO_ALPHA_CUTOFF\n if (color.a < u_alphaCutoff) {\n discard;\n } else {\n color.a = 1.0;\n }\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_FOG\n float fogFactor = 1.0;\n\n #ifdef HILO_FOG_LINEAR\n fogFactor = (u_fogInfo.y - v_dist)/(u_fogInfo.y - u_fogInfo.x);\n #elif defined(HILO_FOG_EXP)\n fogFactor = exp(-abs(u_fogInfo * v_dist));\n #elif defined(HILO_FOG_EXP2)\n fogFactor = exp(-(u_fogInfo * v_dist) * (u_fogInfo * v_dist)); \n #endif\n \n fogFactor = clamp(fogFactor, 0.0, 1.0);\n color = mix(u_fogColor, color, fogFactor);\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_IGNORE_TRANSPARENT\ncolor.a = 1.0;\n#endif\n\ncolor.rgb *= color.a;\n\n#ifdef HILO_GAMMA_CORRECTION\n color.rgb = pow(color.rgb, vec3(1.0 / u_gammaFactor));\n#endif\n\n#ifdef HILO_USE_HDR\n color.rgb = vec3(1.0) - exp(-color.rgb * u_exposure);\n#endif\n\ngl_FragColor = color;"},function(t,e){t.exports="#define GLSLIFY 1\n"},function(t,e){t.exports="#ifdef GL_ES\nprecision HILO_MAX_VERTEX_PRECISION float;\n#define GLSLIFY 1\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n"+n(41)+"\n"+n(42)+"\n"+n(43)+"\n"+n(44)+"\n"+n(64)+"\n"+n(45)+"\n"+n(71)+"\n"+n(47)+"\n"+n(48)+"\n"+n(29)+"\n\nvoid main(void) {\n vec4 diffuse = vec4(0., 0., 0., 1.);\n vec4 color = vec4(0., 0., 0., 1.);\n\n "+n(49)+"\n "+n(50)+"\n "+n(72)+"\n "+n(73)+"\n "+n(51)+"\n "+n(52)+"\n "+n(53)+"\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(54)+"\n"+n(18)+"\n"+n(55)+"\n\nattribute vec3 a_position;\nuniform mat4 u_modelViewProjectionMatrix;\n\n"+n(74)+"\n"+n(75)+"\n"+n(76)+"\n"+n(77)+"\n"+n(78)+"\n"+n(79)+"\n"+n(80)+"\n"+n(81)+"\nvoid main(void) {\n vec4 pos = vec4(a_position, 1.0);\n #ifdef HILO_HAS_TEXCOORD0\n vec2 uv = a_texcoord0;\n #endif\n #ifdef HILO_HAS_TEXCOORD1\n vec2 uv1 = a_texcoord1;\n #endif\n #ifdef HILO_HAS_NORMAL\n vec3 normal = a_normal;\n #endif\n\n #ifdef HILO_NORMAL_MAP\n vec4 tangent = a_tangent;\n #endif\n\n "+n(82)+"\n "+n(83)+"\n "+n(84)+"\n "+n(85)+"\n "+n(86)+"\n "+n(87)+"\n "+n(88)+"\n\n gl_Position = u_modelViewProjectionMatrix * pos;\n\n "+n(89)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n#if defined(HILO_VERTEX_TYPE_POSITION)\n varying vec3 v_fragPos;\n#elif defined(HILO_VERTEX_TYPE_NORMAL)\n varying vec3 v_normal;\n#elif defined(HILO_VERTEX_TYPE_DEPTH)\n uniform float u_cameraFar;\n uniform float u_cameraNear;\n uniform float u_cameraType;\n#elif defined(HILO_VERTEX_TYPE_DISTANCE)\n "+n(90)+"\n\n uniform float u_cameraFar;\n uniform float u_cameraNear;\n varying vec3 v_fragPos;\n#endif\n\nvec4 transformDataToColor(vec3 data){\n #ifdef HILO_WRITE_ORIGIN_DATA\n return vec4(data, 1.0);\n #else\n return vec4(data * 0.5 + 0.5, 1.0);\n #endif\n}\n\n"+n(29)+"\n\nvoid main(void) {\n #if defined(HILO_VERTEX_TYPE_POSITION)\n gl_FragColor = transformDataToColor(v_fragPos);\n #elif defined(HILO_VERTEX_TYPE_NORMAL)\n gl_FragColor = transformDataToColor(v_normal);\n #elif defined(HILO_VERTEX_TYPE_DEPTH)\n float z;\n #ifdef HILO_WRITE_ORIGIN_DATA\n z = gl_FragCoord.z;\n #else\n // OrthographicCamera\n if(u_cameraType < 1.0){\n z = gl_FragCoord.z;\n }\n // PerspectiveCamera\n else{\n z = gl_FragCoord.z * 2.0 - 1.0;\n z = (2.0 * u_cameraNear * u_cameraFar) / (u_cameraFar + u_cameraNear - z * (u_cameraFar - u_cameraNear));\n }\n #endif\n gl_FragColor = vec4(z, z, z, 1.0);\n #elif defined(HILO_VERTEX_TYPE_DISTANCE)\n float distance = length(v_fragPos);\n #ifdef HILO_WRITE_ORIGIN_DATA\n gl_FragColor = vec4(distance, distance, distance, 1.0);\n #else\n gl_FragColor = packFloat((distance - u_cameraNear)/(u_cameraFar - u_cameraNear));\n #endif\n #endif\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n"+n(41)+"\n"+n(42)+"\n"+n(43)+"\n"+n(44)+"\n"+n(91)+"\n"+n(45)+"\n"+n(47)+"\n"+n(48)+"\n"+n(29)+"\n\nvoid main(void) {\n vec4 color = vec4(0., 0., 0., 1.);\n\n "+n(49)+"\n "+n(50)+"\n "+n(93)+"\n "+n(52)+"\n "+n(53)+"\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\nvarying vec2 v_texcoord0;\nuniform sampler2D u_diffuse;\n\nvoid main(void) { \n gl_FragColor = texture2D(u_diffuse, v_texcoord0);\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(54)+"\n"+n(18)+"\n"+n(55)+"\n\nattribute vec2 a_position;\nattribute vec2 a_texcoord0;\nvarying vec2 v_texcoord0;\n\n\nvoid main(void) {\n vec4 pos = vec4(a_position, 0.0, 1.0);\n gl_Position = pos;\n v_texcoord0 = a_texcoord0;\n}"},function(t,e){var n=function(){var t=navigator.userAgent,e=document,n=window,i=e.documentElement,r={iphone:/iphone/i.test(t),ipad:/ipad/i.test(t),ipod:/ipod/i.test(t),ios:/iphone|ipad|ipod/i.test(t),android:/android/i.test(t),webkit:/webkit/i.test(t),chrome:/chrome/i.test(t),safari:/safari/i.test(t),firefox:/firefox/i.test(t),ie:/msie/i.test(t),opera:/opera/i.test(t),supportTouch:"ontouchstart"in n,supportCanvas:null!=e.createElement("canvas").getContext,supportStorage:!1,supportOrientation:"orientation"in n||"orientation"in n.screen,supportDeviceMotion:"ondevicemotion"in n};try{localStorage.setItem("hilo","hilo"),localStorage.removeItem("hilo"),r.supportStorage=!0}catch(t){}var s=r.jsVendor=r.webkit?"webkit":r.firefox?"webkit":r.opera?"o":r.ie?"ms":"",a=r.cssVendor="-"+s+"-",o=e.createElement("div"),u=o.style,c=null!=u[s+"Transform"],h=null!=u[s+"Perspective"];h&&(o.id="test3d",(u=e.createElement("style")).textContent="@media ("+a+"transform-3d){#test3d{height:3px}}",e.head.appendChild(u),i.appendChild(o),h=3==o.offsetHeight,e.head.removeChild(u),i.removeChild(o)),r.supportTransform=c,r.supportTransform3D=h;var f=r.supportTouch,l=f?"touchstart":"mousedown",d=f?"touchmove":"mousemove",m=f?"touchend":"mouseup";return r.POINTER_START=l,r.POINTER_MOVE=d,r.POINTER_END=m,r}();t.exports=n},function(t,e,n){var i=n(19),r=function(){function t(){return+new Date}return i.create({constructor:function(t,e,n,i){var r=this;for(var s in r.target=t,r._startTime=0,r._seekTime=0,r._pausedTime=0,r._pausedStartTime=0,r._reverseFlag=1,r._repeatCount=0,3==arguments.length&&(i=n,n=e,e=null),i)r[s]=i[s];r._fromProps=e,r._toProps=n,!i.duration&&i.time&&(r.duration=i.time||0,r.time=0)},target:null,duration:1e3,delay:0,paused:!1,loop:!1,reverse:!1,repeat:0,repeatDelay:0,ease:null,time:0,isStart:!1,onStart:null,onUpdate:null,onComplete:null,setProps:function(t,e){var n=this.target,i=t||e,r=this._fromProps={},s=this._toProps={};for(var a in t=t||n,e=e||n,i)s[a]=e[a]||0,n[a]=r[a]=t[a]||0;return this},start:function(){var e=this;return e._startTime=t()+e.delay,e._seekTime=0,e._pausedTime=0,e.paused=!1,r.add(e),e},stop:function(){return r.remove(this),this},pause:function(){return this.paused=!0,this._pausedStartTime=t(),this},resume:function(){var e=this;return e.paused=!1,e._pausedStartTime&&(e._pausedTime+=t()-e._pausedStartTime),e._pausedStartTime=0,e},seek:function(e,n){var i=this,s=t();return i._startTime=s,i._seekTime=e,i._pausedTime=0,void 0!==n&&(i.paused=n),i._update(s,!0),r.add(i),i},link:function(t){var e,n,i=t.delay,s=this._startTime;return"string"==typeof i&&(e=0==i.indexOf("+"),n=0==i.indexOf("-"),i=e||n?Number(i.substr(1))*(e?1:-1):Number(i)),t.delay=i,t._startTime=e||n?s+this.duration+i:s+i,this._next=t,r.remove(t),t},_render:function(t){var e,n=this.target,i=this._fromProps;for(e in i)n[e]=i[e]+(this._toProps[e]-i[e])*t},_update:function(e,n){var i=this;if(!i.paused||n){var s=e-i._startTime-i._pausedTime+i._seekTime;if(!(s<0)){var a,o=s/i.duration,u=!1;o=o<=0?0:o>=1?1:o;var c=i.ease?i.ease(o):o;i.reverse&&(i._reverseFlag<0&&(o=1-o,c=1-c),o<1e-7&&(i.repeat>0&&i._repeatCount++>=i.repeat||0==i.repeat&&!i.loop?u=!0:(i._startTime=t(),i._pausedTime=0,i._reverseFlag*=-1))),i.isStart||(i.setProps(i._fromProps,i._toProps),i.isStart=!0,i.onStart&&i.onStart.call(i,i)),i.time=s,i._render(c),(a=i.onUpdate)&&a.call(i,o,i),o>=1&&(i.reverse?(i._startTime=t(),i._pausedTime=0,i._reverseFlag*=-1):i.loop||i.repeat>0&&i._repeatCount++0&&f<=e?(h._render(o),h.time=s,r.add(h)):u&&(f<0||f>e)&&h.start()}return u?((a=i.onComplete)&&a.call(i,i),!0):void 0}}},Statics:{_tweens:[],tick:function(){var e,n,i=r._tweens,s=i.length;for(n=0;n-1&&i.splice(e,1);else for(e=0;e1&&void 0!==arguments[1]?arguments[1]:8,n=t.length,r=i(e),s=1/0,a=-1/0,o=0;o1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,a=t.length,o=i(s),u=r-n||1,c=0;c1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=t.length,a=i(e),o=r-n,u=new Float32Array(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,i=t.length,r=0;rd)return null;i(f,c,o);var _=r(n,f);if(_<0||m+_>d)return null;var p=r(u,f)/d;return t[0]=e[0]+p*n[0],t[1]=e[1]+p*n[1],t[2]=e[2]+p*n[2],t}},function(t,e){t.exports=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=n[0],o=n[1],u=n[2];return t[0]=r*u-s*o,t[1]=s*a-i*u,t[2]=i*o-r*a,t}},function(t,e,n){var i=n(27),r=n(33),s=n(34),a=n(35);t.exports=function(t,e,n,u,c){var h=i(n,u);if(0!==h){var f=-(i(e,u)+c)/h;return f<0?null:(s(o,n,f),r(t,e,o))}return i(u,e)+c===0?a(t,e):null};var o=[0,0,0]},function(t,e,n){var i=n(99),r=n(27),s=n(32),a=n(100),o=n(34),u=n(33),c=[0,0,0];t.exports=function(t,e,n,h,f){s(c,h,e);var l=r(n,c);if(l<0)return null;a(c,e,n,l);var d=i(h,c),m=f*f;if(d>m)return null;return o(t,n,l-Math.sqrt(m-d)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}},function(t,e){t.exports=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t}},function(t,e){function n(t,e,n){for(var i=t.length,r=-1/0,s=1/0,a=0;au){var c=o;o=u,u=c}if(us)return 1/0;o>r&&(r=o),us?1/0:r}t.exports=function(t,e,i,r){var s=n(e,i,r);if(s===1/0)t=null;else{t=t||[];for(var a=0;a0;){if(d(c)128){if(0==(u=(255&f[0])-128)||u>o-a)throw new Error("Bad scanline data");for(;u-- >0;)h[a++]=f[1]}else{if(0==(u=255&f[0])||u>o-a)throw new Error("Bad scanline data");if(h[a++]=f[1],--u>0){if(m(h,a,u)=this._targetFPS?(this._measuredFPS=1e3/(this._tickTime/this._tickCount)+.5>>0,this._tickCount=0,this._tickTime=0):this._tickTime+=t-this._lastTime,this._lastTime=t;for(var i=n.slice(0),r=0,s=i.length;r=0&&e.splice(n,1)},nextTick:function(t){var e=this,n={tick:function(i){e.removeTick(n),t()}};return e.addTick(n),n},timeout:function(t,e){var n=this,i=(new Date).getTime()+e,r={tick:function(){(new Date).getTime()-i>=0&&(n.removeTick(r),t())}};return n.addTick(r),r},interval:function(t,e){var n=(new Date).getTime()+e,i={tick:function(){var i=(new Date).getTime(),r=i-n;r>=0&&(r=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(112),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(40))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,s,a,o,u=1,c={},h=!1,f=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){m(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((s=new MessageChannel).port1.onmessage=function(t){m(t.data)},i=function(t){s.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(r=f.documentElement,i=function(t){var e=f.createElement("script");e.onreadystatechange=function(){m(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):i=function(t){setTimeout(m,0,t)}:(a="setImmediate$"+Math.random()+"$",o=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&m(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",o,!1):t.attachEvent("onmessage",o),i=function(e){t.postMessage(a+e,"*")}),l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n 0.0 ? v : (0.5 * inversesqrt(max(1.0 - (x * x), 1e-7))) - v;\n return cross(v1, v2) * theta_sintheta;\n}\n\nvec3 LTC_Evaluate(const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[4]) {\n vec3 v1 = rectCoords[1] - rectCoords[0];\n vec3 v2 = rectCoords[3] - rectCoords[0];\n vec3 lightNormal = cross(v1, v2);\n if (dot(lightNormal, P - rectCoords[0]) < 0.0)\n return vec3(0.0);\n vec3 T1, T2;\n T1 = normalize(V - (N * dot(V, N)));\n T2 = -cross(N, T1);\n mat3 mat = mInv * transpose(mat3(T1, T2, N));\n vec3 coords[4];\n coords[0] = mat * (rectCoords[0] - P);\n coords[1] = mat * (rectCoords[1] - P);\n coords[2] = mat * (rectCoords[2] - P);\n coords[3] = mat * (rectCoords[3] - P);\n coords[0] = normalize(coords[0]);\n coords[1] = normalize(coords[1]);\n coords[2] = normalize(coords[2]);\n coords[3] = normalize(coords[3]);\n vec3 vectorFormFactor = vec3(0.0);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[0], coords[1]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[1], coords[2]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[2], coords[3]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[3], coords[0]);\n float result = LTC_ClippedSphereFormFactor(vectorFormFactor);\n return vec3(result);\n}\n\nvec3 getAreaLight(const in vec3 diffuseColor, const in vec3 specularColor, const in float roughness, const in vec3 normal, const in vec3 viewDir, const in vec3 position, const in vec3 lightPos, const in vec3 lightColor, const in vec3 halfWidth, const in vec3 halfHeight, const in sampler2D areaLightsLtcTexture1, const in sampler2D areaLightsLtcTexture2){\n vec3 rectCoords[4];\n rectCoords[0] = (lightPos - halfWidth) - halfHeight;\n rectCoords[1] = (lightPos + halfWidth) - halfHeight;\n rectCoords[2] = (lightPos + halfWidth) + halfHeight;\n rectCoords[3] = (lightPos - halfWidth) + halfHeight;\n \n vec2 uv = LTC_Uv(normal, viewDir, roughness);\n vec4 t1 = texture2D(areaLightsLtcTexture1, uv);\n vec4 t2 = texture2D(areaLightsLtcTexture2, uv);\n\n mat3 mInv = mat3(vec3(t1.x, 0, t1.y), vec3(0, 1, 0), vec3(t1.z, 0, t1.w));\n vec3 fresnel = (specularColor * t2.x) + ((vec3(1.0) - specularColor) * t2.y);\n \n vec3 color = vec3(0.0, 0.0, 0.0);\n color += ((lightColor * fresnel) * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords));\n color += ((lightColor * diffuseColor) * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords));\n return color;\n}\n\n"},function(t,e,n){function i(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;n-=2)e[t[n]]=t[n-1]}},{key:"mapBoundary",value:function(t){for(var e=this.indices,n=t.length,i=this.currentVertex,r=this.currentVertex-n+1,s=n-1;s>=0;s--)e[this.nextCorner(t[s])]=i,i=r,e[this.prevCorner(t[s])]=r++;this.currentVertex-=n}},{key:"mapHoleBoundary",value:function(t){for(var e=this.indices,n=t.length,i=this.currentVertex-n+1,r=i,s=n-1;s>=0;s--)e[this.nextCorner(t[s])]=i++,e[this.prevCorner(t[s])]=s?i:r;this.currentVertex-=n}},{key:"fixNegativeIndex",value:function(t){for(var e=t,n=this.indices;n[t]<0;){if(e===-n[-n[t]]||n[t]===n[-n[t]]){console.warn("dead loop bug!!"),n[s]=0;break}n[t]=n[-n[t]]}}},{key:"fixIndicesAndReadVertice",value:function(){for(var t,e=this.indices,n=this.handlesMap,i=this.clers,r=i.length,s=-1,a=[],u=0,c=0;u1&&void 0!==arguments[1]?arguments[1]:-1;if(!this.readedVertexMap[t]&&(this.readedVertexMap[t]=1,!this.noParallelogramPrediction)){var n=this.indices,i=this.geometry;-1===e?void 0!==this.lastReadVertexIndex&&i.cal(i,t,a.plus,this.lastReadVertexIndex,t):i.cal(i,t,a.depp,n[e],n[this.prevCorner(e)],n[this.nextCorner(e)],t),this.lastReadVertexIndex=t}}},{key:"markCorner",value:function(t,e){var n=this.indices;void 0===n[this.nextCorner(t)]&&(n[this.nextCorner(t)]=-this.prevCorner(e[0])),void 0===n[this.prevCorner(t)]&&(n[this.prevCorner(t)]=-this.nextCorner(e[e.length-1]))}},{key:"onFaceC",value:function(t){var e=this.indices,n=3*this.currentFace,i=this.currentVertex--;e[n]=i;var r=t.pop();return e[this.nextCorner(r)]=i,e[this.prevCorner(r)]=-this.nextCorner(t[t.length-1]),r=t.shift(),e[this.prevCorner(r)]=i,e[this.nextCorner(r)]=-this.prevCorner(t[0]),t.push(n),t}},{key:"onFaceL",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.unshift(e+2),t.push(e),t}},{key:"onFaceF",value:function(t,e){return t&&this.mapBoundary(t),this.onFaceE(null,e)}},{key:"onFaceE",value:function(t,e){var n=3*this.currentFace;return t&&e.push(t),[n+2,n+1,n]}},{key:"onFaceR",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.push(e+1,e),t}},{key:"onHandleEnd",value:function(t,e,n){var i=this.indices,r=3*this.currentFace,s=this.handlesMap[this.currentFace],a=e.splice(0,t);return e.shift(),n.push(a),i[this.nextCorner(s)]=-(r+1),i[this.prevCorner(s)]=-this.nextCorner(a[a.length-1]),i[r]=-this.prevCorner(a[0]),e.push(r),e}},{key:"onHandleStart",value:function(t,e){for(var n,r=this.indices,s=3*this.currentFace,a=this.handlesMap[this.currentFace],o=e.length-1;o>=0;o--){var u=e[o].indexOf(a);if(u>=0){var c,h=(n=e.splice(o,1)[0]).splice(0,u);n.shift(),(c=n).push.apply(c,i(h));break}}return r[this.nextCorner(a)]=-(s+1),r[this.prevCorner(a)]=-this.nextCorner(n[n.length-1]),r[s]=-this.prevCorner(t[0]),(t=n.concat(t)).push(s),t}},{key:"onFaceS",value:function(t,e,n){var i=this.handlesMap,r=this.indices,s=3*this.currentFace;if(i[this.currentFace]){this.markCorner(t.pop(),t);var a=t.indexOf(i[this.currentFace]);t=a>=0?this.onHandleEnd(a,t,n):this.onHandleStart(t,n)}else{var o=t.pop();this.markCorner(o,t),r[s]=-this.nextCorner(o);var u=e.pop();this.markCorner(u.pop(),u),(t=u.concat(t)).push(s)}return t}},{key:"onFaceM",value:function(t,e,n){var i=this.indices,r=3*this.currentFace,s=t.splice(0,this.holes[this.currentHole--]);this.mapHoleBoundary(s);var a=i[this.prevCorner(s[0])];i[r]=a;var o=t.pop();return i[this.prevCorner(o)]=-this.nextCorner(t[t.length-1]),i[this.nextCorner(o)]=a,o=t.shift(),i[this.prevCorner(o)]=a,i[this.nextCorner(o)]=-this.prevCorner(t[0]),t.push(r),t}},{key:"decompress",value:function(){this.readedVertexMap=new Uint8Array(this.vertexCount);var t=this.faceCount,e=this.indices=new Array(3*t);this.currentFace=t-1,this.currentVertex=this.vertexCount-1,this.currentHole=this.holes.length-1;for(var n,i=this.clers,r=[],s=[];this.currentFace>=0;){var a="onFace"+u[i[this.currentFace]];this[a]?n=this[a](n,r,s):console.warn("has no ".concat(a)),this.currentFace--}return this.mapBoundary(n),this.fixIndicesAndReadVertice(this.indices),this.geometry.indices=e,this.geometry.dequantize(),this.geometry}},{key:"_onDecompressFace",value:function(t,e){this.onDecompressFace&&this.onDecompressFace(t,e)}}])&&r(e.prototype,n),c&&r(e,c),t}();t.exports=c},function(t,e){var n={C:0,R:1,L:2,S:3,E:4,M:5,F:6},i=[];for(var r in n)i[n[r]]=r;n.map=i,t.exports=n},function(t,e,n){var i=n(31);function r(t,e,n,i){return new t(e.slice(n,n+i*t.BYTES_PER_ELEMENT))}t.exports={read:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new DataView(t),s=new i,a=function(t,e){var n={};return n.version=t.getUint8(e++),n.faceCount=t.getUint32(e,!0),e+=4,n.vertexCount=t.getUint32(e,!0),e+=4,n.attrCount=t.getUint8(e++),n.noParallelogramPrediction=t.getUint8(e++),n.holesCount=t.getUint16(e,!0),e+=2,n.handlesCount=t.getUint16(e,!0),e+=2,n.headerBytes=15,n}(n,e);return e+=a.headerBytes,s.mode="CLERS",e=function(t,e,n,i){return i.holesCount?(t.holes=r(Uint16Array,e.buffer,n,i.holesCount),n+2*i.holesCount):(t.holes=[],n)}(s,n,e,a),e=function(t,e,n,i){return i.handlesCount?(t.handles=r(Uint32Array,e.buffer,n,2*i.handlesCount),n+8*i.handlesCount):(t.handles=[],n)}(s,n,e,a),e=function(t,e,n,i){return t.clers=new Uint8Array(e.buffer,n,i.faceCount),n+i.faceCount}(s,n,e,a),e=function(t,e,n,i){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wasmURL=e.wasmURL||"https://ossgw.alicdn.com/tmall-c3/tmx/70b8d82ccf33e97a124e54c2d6a3e0c7.wasm",this.isReady=!1}var e,n,o;return e=t,(n=[{key:"initASMJS",value:function(){this.isReady=!0,this.dv=new DataView(HEAP8.buffer),this.heap8=HEAP8,this.ins={exports:{__Z7AMCinitj:Module.__Z7AMCinitj,__Z12AMDecompressv:Module.__Z12AMDecompressv}}}},{key:"init",value:function(){var t=this,e=this.memory=new WebAssembly.Memory({initial:256});this.dv=new DataView(e.buffer);var n=this.heap8=new Uint8Array(e.buffer),i={global:{NaN:5,Infinity:6},env:{memoryBase:0,memory:e,_malloc:function(){return 2097152},_memset:function(t,e,i){return n.fill(e,t,t+i),t},_printf:function(t,e){for(var i=t;n[i];)i++;var s=String.fromCharCode.apply(String,r(n.slice(t,i))),a=0;s=s.replace(/%([duf])/g,function(t,n){return"d"===n||"u"===n?dv.getInt32(e+4*a++,!0):"f"===n?dv.getFloat32(e+4*a++,!0):void 0}),console.log(s)}}};return fetch(this.wasmURL).then(function(t){return t.arrayBuffer()}).then(function(t){return WebAssembly.instantiate(t,i)}).then(function(e){t.module=e,t.ins=e.instance,t.isReady=!0}).catch(function(t){return console.log("wasm load error, use js ver")})}},{key:"getDataAddr",value:function(t){return this.ins.exports.__Z7AMCinitj(t)}},{key:"decompress",value:function(t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var e=this.dv,n=this.heap8,r=this.getDataAddr(t.length);n.set(t,r);var s=this.ins.exports.__Z12AMDecompressv();if(s<=0)throw console.error("decompression error code: "+s),new Error("decompression error code: "+s);for(var o=e.getUint32(s,!0),u=e.getUint32(s+4,!0),c=e.getUint32(s+8,!0),h=e.getUint32(s+12,!0),f=[],l=0;l65536?new Uint32Array(m):new Uint16Array(m);var _=new a(m);return f.forEach(function(t){var n=i(t,3),r=n[0],s=n[1],a=n[2],o=new Float32Array(e.buffer.slice(a,a+c*s*4));_.addAttr(_.attrIdToName(r),o,s)}),_}}])&&s(e.prototype,n),o&&s(e,o),t}();t.exports=o},function(t,e){function n(){if("undefined"==typeof WebAssembly||"undefined"==typeof fetch||function(){if(!/iPad|iPhone|iPod/i.test(navigator.userAgent))return!1;if(/OS (\d+)_(\d+)_?(\d+)?/i.test(navigator.userAgent)){var t=Number(RegExp.$1),e=Number(RegExp.$2);if(11===t&&e>=3||t>11)return!1}return!0}())return!1;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)}catch(t){return console.log("err while check WebAssembly",t),!1}}var i;t.exports=function(){return void 0===i&&(i=n()),i}},function(t,e,n){"use strict";n.r(e);var i={};n.r(i),n.d(i,"ALI_amc_mesh_compression",function(){return wn}),n.d(i,"WEB3D_quantized_attributes",function(){return Pn}),n.d(i,"HILO_animation_clips",function(){return Hn}),n.d(i,"ALI_animation_clips",function(){return Dn}),n.d(i,"ALI_bounding_box",function(){return Fn}),n.d(i,"KHR_materials_pbrSpecularGlossiness",function(){return Un}),n.d(i,"KHR_lights_punctual",function(){return Gn}),n.d(i,"KHR_techniques_webgl",function(){return Bn});var r=n(4),s=n(1),a=n(9),o=n(7),u=n(22),c=n(5),h=n(17),f=n(23),l=n(10),d=n(6),m=n(3),_=new c.a(0,1,0),p=new o.a,g=s.a.create({Statics:{TRAVERSE_STOP_NONE:!1,TRAVERSE_STOP_CHILDREN:1,TRAVERSE_STOP_ALL:!0},Mixes:a.a,isNode:!0,className:"Node",name:"",animationId:"",autoUpdateWorldMatrix:!0,parent:null,_quatDirty:!1,_matrixDirty:!1,needCallChildUpdate:!0,visible:!0,pointerEnabled:!0,pointerChildren:!0,useHandCursor:!1,constructor:function(t){var e=this;this.id=d.a.generateUUID(this.className),this.up=_.clone(),this.children=[],this.worldMatrix=new o.a,this._matrix=new u.a,this._position=new h.a(0,0,0),this._scale=new h.a(1,1,1),this._pivot=new h.a(0,0,0),this._rotation=new f.a,this._quaternion=new l.a,this._matrix.on("update",function(){e._onMatrixUpdate()}),this._position.on("update",function(){e._onPositionUpdate()}),this._scale.on("update",function(){e._onScaleUpdate()}),this._pivot.on("update",function(){e._onPivotUpdate()}),this._rotation.on("update",function(){e._onRotationUpdate()}),this._quaternion.on("update",function(){e._onQuaternionUpdate()}),Object.assign(this,t)},clone:function(t){var e=new this.constructor;return e.name=this.name,e.jointName=this.jointName,e.animationId=this.animationId,e.setPosition(this.x,this.y,this.z),e.setScale(this.scaleX,this.scaleY,this.scaleZ),e.setRotation(this.rotationX,this.rotationY,this.rotationZ),this.children.forEach(function(t){e.addChild(t.clone(!0))}),t||(this.anim&&(e.anim=this.anim.clone(e)),e.resetSkinedMeshRootNode()),e},setAnim:function(t){return this.anim=t,t.rootNode=this,this},resetSkinedMeshRootNode:function(){var t=this;this.traverse(function(e){e.isSkinedMesh&&e.jointNames&&(e.rootNode=t)},!0)},getChildrenNameMap:function(){var t={};return this.traverse(function(e){t[e.name]=e;var n=e._originName;void 0===n||t[n]||(t[n]=e)},!0),t},addChild:function(t){return t.parent&&t.removeFromParent(),t.parent=this,this.children.push(t),this},removeChild:function(t){var e=this.children.indexOf(t);return e>-1&&(this.children.splice(e,1),t.parent=null),this},addTo:function(t){return t.addChild(this),this},removeFromParent:function(){return this.parent&&this.parent.removeChild(this),this},updateMatrix:function(){return this._matrixDirty&&(this._matrixDirty=!1,this.matrixVersion++,this._matrix.fromRotationTranslationScaleOrigin(this.quaternion,this._position,this._scale,this._pivot,!0)),this},updateQuaternion:function(){return this._quatDirty&&(this._quatDirty=!1,this._quaternion.fromEuler(this._rotation,!0)),this},updateTransform:function(){return this._matrix.decompose(this._quaternion,this._position,this._scale,this._pivot),this._onQuaternionUpdate(),this._matrixDirty=!1,this},updateMatrixWorld:function(t){return this.traverse(function(e){(e.autoUpdateWorldMatrix||t)&&(e.parent?e.worldMatrix.multiply(e.parent.worldMatrix,e.matrix):e.worldMatrix.copy(e.matrix))}),this},getConcatenatedMatrix:function(t){for(var e=new o.a,n=this;n&&n!==t;n=n.parent)e.multiply(n.matrix,e);return e},_traverse:function(t,e){if(!e){var n=t(this);if(n)return n}for(var i=this.children,r=0,s=i.length;r1&&void 0!==arguments[1]&&arguments[1];return this._traverse(t,e),this},traverseBFS:function(t){var e,n;for(n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?this.children:[this];n.length;){e=n,n=[];for(var i=0,r=e.length;i1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return this._scale.set(t,e,n),this},setPosition:function(t,e,n){return this._position.set(t,e,n),this},setRotation:function(t,e,n){return this._rotation.setDegree(t,e,n),this},setPivot:function(t,e,n){return this._pivot.set(t,e,n),this},lookAt:function(t){return this.isCamera?p.targetTo(this,t,this.up):p.targetTo(t,this,this.up),this._quaternion.fromMat4(p),this},raycast:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.visible)return null;var r=[];return this.traverse(function(n){if(i&&!n.pointerEnabled)return 1;if(n.isMesh){var s=n.raycast(t,!1);s&&(r=r.concat(s.map(function(t){return{mesh:n,point:t}})))}return!(!i||e.pointerChildren)&&1}),r.length?(n&&t.sortPoints(r,"point"),r):null},matrix:{get:function(){return this.updateMatrix(),this._matrix},set:function(t){m.a.warnOnce("Node.matrix.set","node.matrix is readOnly.Use node.matrix.copy instead."),this._matrix.copy(t)}},position:{get:function(){return this._position},set:function(t){m.a.warnOnce("Node.position.set","node.position is readOnly.Use node.position.copy instead."),this._position.copy(t)}},x:{get:function(){return this._position.elements[0]},set:function(t){this._position.elements[0]=t,this._matrixDirty=!0}},y:{get:function(){return this._position.elements[1]},set:function(t){this._position.elements[1]=t,this._matrixDirty=!0}},z:{get:function(){return this._position.elements[2]},set:function(t){this._position.elements[2]=t,this._matrixDirty=!0}},scale:{get:function(){return this._scale},set:function(t){m.a.warnOnce("Node.scale.set","node.scale is readOnly.Use node.scale.copy instead."),this._scale.copy(t)}},scaleX:{get:function(){return this._scale.elements[0]},set:function(t){this._scale.elements[0]=t,this._matrixDirty=!0}},scaleY:{get:function(){return this._scale.elements[1]},set:function(t){this._scale.elements[1]=t,this._matrixDirty=!0}},scaleZ:{get:function(){return this._scale.elements[2]},set:function(t){this._scale.elements[2]=t,this._matrixDirty=!0}},pivot:{get:function(){return this._pivot},set:function(t){m.a.warnOnce("Node.pivot.set","node.pivot is readOnly.Use node.pivot.copy instead."),this._pivot.copy(t)}},pivotX:{get:function(){return this._pivot.elements[0]},set:function(t){this._pivot.elements[0]=t,this._matrixDirty=!0}},pivotY:{get:function(){return this._pivot.elements[1]},set:function(t){this._pivot.elements[1]=t,this._matrixDirty=!0}},pivotZ:{get:function(){return this._pivot.elements[2]},set:function(t){this._pivot.elements[2]=t,this._matrixDirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){m.a.warnOnce("Node.rotation.set","node.rotation is readOnly.Use node.rotation.copy instead."),this._rotation.copy(t)}},rotationX:{get:function(){return this._rotation.degX},set:function(t){this._rotation.degX=t}},rotationY:{get:function(){return this._rotation.degY},set:function(t){this._rotation.degY=t}},rotationZ:{get:function(){return this._rotation.degZ},set:function(t){this._rotation.degZ=t}},quaternion:{get:function(){return this.updateQuaternion(),this._quaternion},set:function(t){m.a.warnOnce("Node.quaternion.set","node.quaternion is readOnly.Use node.quaternion.copy instead."),this._quaternion.copy(t)}},matrixVersion:0,getBounds:function(t,e,n){return e?e.multiply(this.matrix):e=this.getConcatenatedMatrix(t),this.children.forEach(function(t){n=t.getBounds(null,e.clone(),n)}),this.isMesh&&(n=this.geometry.getBounds(e,n)),n},_fireMouseEvent:function(t){if(t.eventCurrentTarget=this,this.fire(t),"mousemove"===t.type){if(!this.__mouseOver){this.__mouseOver=!0;var e=Object.assign({},t);e.type="mouseover",this.fire(e)}}else"mouseout"===t.type&&(this.__mouseOver=!1);var n=this.parent;t._stopped||t._stopPropagationed||!n||n._fireMouseEvent(t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getChildrenByBaseClassName("Node");return this.off(),n.forEach(function(n){n.isMesh?n.destroy(t,e):(n.off(),n.removeFromParent())}),this.removeFromParent(),this},_onMatrixUpdate:function(){this.matrixVersion++,this.updateTransform()},_onPositionUpdate:function(){this._matrixDirty=!0},_onScaleUpdate:function(){this._matrixDirty=!0},_onPivotUpdate:function(){this._matrixDirty=!0},_onRotationUpdate:function(){this._quatDirty=!0,this._matrixDirty=!0},_onQuaternionUpdate:function(){this._rotation.fromQuat(this._quaternion),this._quatDirty=!1}}),v=n(8),T=new v.a,E=s.a.create({Extends:g,isLight:!0,className:"Light",amount:1,enabled:!0,constantAttenuation:1,linearAttenuation:0,quadraticAttenuation:0,_range:0,range:{get:function(){return this._range},set:function(t){this.constantAttenuation=1,t<=0?(this.linearAttenuation=0,this.quadraticAttenuation=0):(this.linearAttenuation=4.5/t,this.quadraticAttenuation=75/(t*t)),this._range=t}},constructor:function(t){this.color=new v.a(1,1,1),E.superclass.constructor.call(this,t)},toInfoArray:function(t,e){return t[e+0]=this.constantAttenuation,t[e+1]=this.linearAttenuation,t[e+2]=this.quadraticAttenuation,this},getRealColor:function(){return T.copy(this.color).scale(this.amount)},createShadowMap:function(t,e){}}),M=E,A=n(24),L=new o.a,I=s.a.create({Extends:g,isCamera:!0,className:"Camera",_needUpdateProjectionMatrix:!0,_isGeometryDirty:!1,constructor:function(t){this.viewMatrix=new o.a,this.projectionMatrix=new o.a,this.viewProjectionMatrix=new o.a,this._frustum=new A.a,I.superclass.constructor.call(this,t)},updateViewMatrix:function(){return this.updateMatrixWorld(!0),this.viewMatrix.invert(this.worldMatrix),this},updateProjectionMatrix:function(){},getGeometry:function(t){},updateViewProjectionMatrix:function(){return this._needUpdateProjectionMatrix&&(this.updateProjectionMatrix(),this._needUpdateProjectionMatrix=!1),this.updateViewMatrix(),this.viewProjectionMatrix.multiply(this.projectionMatrix,this.viewMatrix),this.updateFrustum(this.viewProjectionMatrix),this},getModelViewMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewMatrix,t.worldMatrix),e},getModelProjectionMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewProjectionMatrix,t.worldMatrix),e},projectVector:function(t,e,n){var i=t.clone();return i.transformMat4(this.viewProjectionMatrix),e&&n&&(i.x=(i.x+1)/2*e,i.y=n-(i.y+1)/2*n),i},unprojectVector:function(t,e,n){var i=t.clone();return e&&n&&(i.x=i.x/e*2-1,i.y=1-i.y/n*2),L.invert(this.viewProjectionMatrix),i.transformMat4(L),i},isPointVisible:function(t){return!!this._frustum.intersectsSphere({center:t,radius:0})},isMeshVisible:function(t){var e=t.geometry;if(e){var n=e.getSphereBounds(t.worldMatrix);if(this._frustum.intersectsSphere(n))return!0}return!1},updateFrustum:function(t){return this._frustum.fromMatrix(t),this}}),O=I,S=n(14),R=n(12),y=n(11),x=n(21),N={2:new S.a,3:new c.a,4:new R.a,16:new o.a},b=s.a.create({className:"GeometryData",isGeometryData:!0,size:void 0,normalized:!1,type:void 0,isDirty:!0,bufferViewId:void 0,glBuffer:null,constructor:function(t,e,n){this.id=d.a.generateUUID(this.className),this.data=t,this.size=e,Object.assign(this,n),this.bufferViewId||(this.bufferViewId=this.id),this.size||m.a.warn("GeometryData.constructor: geometryData must set size!",this)},_stride:0,stride:{get:function(){return this._stride},set:function(t){this._stride=t,this.strideSize=0===t?0:t/this.data.BYTES_PER_ELEMENT}},strideSize:0,_offset:0,offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.offsetSize=t/this.data.BYTES_PER_ELEMENT}},offsetSize:0,data:{set:function(t){t&&(this._data=t,this.type=Object(r.getTypedArrayGLType)(t),this.stride=this._stride,this.offset=this._offset,this.isDirty=!0)},get:function(){return this._data}},length:{get:function(){return this._data.length}},realLength:{get:function(){return 0===this.strideSize?this._data.length:this._data.length/this.strideSize*this.size}},count:{get:function(){return 0===this.strideSize?this._data.length/this.size:this._data.length/this.strideSize}},clone:function(){var t=new b(null,1);return t.copy(this),t},copy:function(t){var e=t.data;this.data=new e.constructor(e),this.size=t.size,this.stride=t.stride,this.normalized=t.normalized,this.type=t.type,this.offset=t.offset},getOffset:function(t){var e=this.strideSize;return 0===e?t*this.size:t*e+this.offsetSize},get:function(t){var e=this.getOffset(t);return this.getByOffset(e)},set:function(t,e){var n=this.getOffset(t);return this.setByOffset(n,e),n},getByOffset:function(t){var e=this.size;return e>1?N[e].fromArray(this._data,t):this._data[t]},setByOffset:function(t,e){var n=this.size,i=this._data;n>1?e.toArray(i,t):i[t]=e,this.isDirty=!0},traverse:function(t){for(var e=this.count,n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(Y.fromTranslation(G.set(t,e,n))),this},scale:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.transformMat4(Y.fromScaling(G.set(t,e,n))),this},rotate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(Y.fromQuat(W.fromEuler({x:t*d.a.DEG2RAD,y:e*d.a.DEG2RAD,z:n*d.a.DEG2RAD}))),this},transformMat4:function(t){var e=this.vertices;if(e&&e.traverse(function(n,i,r){e.setByOffset(r,n.transformMat4(t))}),q.normalFromMat4(t),this._normals){var n=this.normals;n.traverse(function(t,e,i){n.setByOffset(i,t.transformMat3(q).normalize())})}if(this._tangents){var i=this.tangents;i.traverse(function(t,e,n){i.setByOffset(n,t.transformMat3(q).normalize())})}return this.isDirty=!0,this},merge:function(t,e){var n=t.vertices,i=this.vertices.count;return e&&(n=t.vertices.clone()).traverse(function(t,i,r){n.setByOffset(r,t.transformMat4(e))}),this.vertices.merge(n),this.uvs&&t.uvs?this.uvs.merge(t.uvs):this.uvs=null,this.uvs1&&t.uvs1?this.uvs1.merge(t.uvs1):this.uvs1=null,this.colors&&t.colors?this.colors.merge(t.colors):this.colors=null,this.indices&&t.indices?this.indices.merge(t.indices,function(t){return t+i}):this.indices=null,this._normals&&(this._normals=null),this._tangents&&(this._tangents=null),this._tangents1&&(this._tangents1=null),this.isDirty=!0,this},ensureData:function(t,e,n,i){var r=this[t];if(!r||n>r.length){var s=new i(n);r?(s.set(r.data),r.data=s):this[t]=new w(s,e)}},addPoints:function(){var t=this,e=[].slice.call(arguments),n=3*(this.currentVerticesCount+e.length);this.ensureData("vertices",3,n,Float32Array);var i=this.vertices.data;return e.forEach(function(e){var n=3*t.currentVerticesCount++;i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2]}),this.currentVerticesCount-e.length},addIndices:function(){var t=this,e=[].slice.call(arguments),n=this.currentIndicesCount+e.length;this.ensureData("indices",1,n,Uint16Array);var i=this.indices.data;e.forEach(function(e){i[t.currentIndicesCount++]=e}),this._needUpdateNormals=!0},addLine:function(t,e){var n=this.addPoints(t,e);this.addIndices(n,n+1)},addFace:function(t,e,n){var i=this.addPoints(t,e,n);this.addIndices(i,i+1,i+2)},addRect:function(t,e,n,i){var r=this.addPoints(t,e,n,i);this.addIndices(r,r+1,r+2,r,r+2,r+3)},setVertexUV:function(t,e){this.ensureData("uvs",2,this.vertices.length/3*2,Float32Array);for(var n=this.uvs.data,i=0;i0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0;e||(e={xMin:1/0,xMax:-1/0,yMin:1/0,yMax:-1/0,zMin:1/0,zMax:-1/0});for(var n=this.vertices.data,i=0;i0&&void 0!==arguments[0]&&arguments[0];return this._localBounds&&!t||(this._localBounds=this.getBounds()),this._localBounds},getSphereBounds:function(t){this._sphereBounds||(this._sphereBounds=new x.a);var e=this._sphereBounds;return e.copy(this.getLocalSphereBounds()),t&&e.transformMat4(t),e},getLocalSphereBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._localSphereBounds||t){var e=this.getLocalBounds(t),n=new x.a({center:new c.a(e.x,e.y,e.z)});n.fromPoints(this.vertices.data),this._localSphereBounds=n}return this._localSphereBounds},convertToNoIndices:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(this.mode===P)if(this.indices){for(var e=this.indices.data,n=e.length,i=new Float32Array(n*t),s=this.uvs?new Float32Array(2*n):null,a=new Float32Array(3*n),o=this.colors?new Float32Array(this.colors.size*n):null,u=this.skinIndices?new Float32Array(4*n):null,c=this.skinWeights?new Float32Array(4*n):null,h=0;h2&&void 0!==arguments[2])||arguments[2];return(n=this.useAABBRaycast?this._aabbRaycast(t):this._raycast(t,e))&&i&&t.sortPoints(n),n},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.positionDecodeMat&&(t.QUANTIZED=1,t.POSITION_QUANTIZED=1),this.normalDecodeMat&&(t.QUANTIZED=1,t.NORMAL_QUANTIZED=1),this.uvDecodeMat&&(t.QUANTIZED=1,t.UV_QUANTIZED=1),this.uv1DecodeMat&&(t.QUANTIZED=1,t.UV1_QUANTIZED=1),this.colors&&(t.HAS_COLOR=1,t.COLOR_SIZE=this.colors.size),t},getShaderKey:function(){return void 0===this._shaderKey&&(this._shaderKey="geometry",this.isMorphGeometry?this._shaderKey+="_id_".concat(this.id):(this.colors&&(this._shaderKey+="_colors"),this.positionDecodeMat&&(this._shaderKey+="positionDecodeMat"))),this._shaderKey},destroy:function(){m.a.warn("Geometry.destroy has been deprecated, use mesh.destroy(renderer) instead.")}}),K=s.a.create({Extends:O,isPerspectiveCamera:!0,className:"PerspectiveCamera",_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:null,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},_fov:50,fov:{get:function(){return this._fov},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._fov=t}},_aspect:1,aspect:{get:function(){return this._aspect},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._aspect=t}},constructor:function(t){K.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.projectionMatrix.elements,e=this.near,n=this.far,i=this.aspect,r=this.fov,s=1/Math.tan(.5*d.a.degToRad(r));if(t[0]=s/i,t[5]=s,t[11]=-1,t[15]=0,n){var a=1/(e-n);t[10]=(e+n)*a,t[14]=2*n*e*a}else t[10]=-1,t[14]=-2*e},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Z,n=Math.tan(this.fov/2*Math.PI/180),i=this.near,r=this.far,s=i*n,a=r*n,o=this.aspect*s,u=this.aspect*a,c=[-o,-s,-i],h=[o,-s,-i],f=[o,s,-i],l=[-o,s,-i],d=[-u,-a,-r],m=[u,-a,-r],_=[u,a,-r],p=[-u,a,-r];e.addRect(d,m,_,p),e.addRect(m,h,f,_),e.addRect(h,c,l,f),e.addRect(c,d,p,l),e.addRect(p,_,f,l),e.addRect(c,h,m,d),this._geometry=e}return this._geometry}}),Q=K,J=s.a.create({constructor:function(){this._cache={}},get:function(t){return this._cache[t]},getObject:function(t){return this._cache[t.__cacheId]},add:function(t,e){"object"==typeof e&&(e.__cacheId=t),this._cache[t]=e},remove:function(t){delete this._cache[t]},removeObject:function(t){delete this._cache[t.__cacheId]},removeAll:function(){this._cache={}},each:function(t){var e=this._cache;for(var n in e)t(e[n],n)}}),$={instanced:void 0,vao:void 0,texFloat:void 0,loseContext:void 0,_usedExtensions:{},_disabledExtensions:{},init:function(t){this.reset(t)},reset:function(t){this.gl=t;var e=this._usedExtensions;for(var n in e){var i=e[n];this[i]=void 0,this.get(n,i)}},use:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;this.gl?this.get(t,e):this._usedExtensions[t]=e},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this._disabledExtensions[t])return null;var n=this[e];return void 0===n&&(n=this._getExtension(t),this[e]=n),n},disable:function(t){this._disabledExtensions[t]=!0},enable:function(t){this._disabledExtensions[t]=!1},_getExtension:function(t){var e=this.gl;return e&&e.getExtension&&(e.getExtension(t)||e.getExtension("WEBKIT_"+t)||e.getExtension("MOZ_"+t))||null}};$.use("ANGLE_instanced_arrays","instanced"),$.use("OES_vertex_array_object","vao"),$.use("OES_texture_float","texFloat"),$.use("WEBGL_lose_context","loseContext"),$.use("OES_element_index_uint","uintIndices"),$.use("EXT_shader_texture_lod","shaderTextureLod");var tt=$,et={MAX_TEXTURE_INDEX:null,MAX_PRECISION:null,MAX_VERTEX_PRECISION:null,MAX_FRAGMENT_PRECISION:null,VERTEX_TEXTURE_FLOAT:null,FRAGMENT_TEXTURE_FLOAT:null,init:function(t){var e=this;this.gl=t;["MAX_RENDERBUFFER_SIZE","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_SIZE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS","MAX_COMBINED_TEXTURE_IMAGE_UNITS"].forEach(function(t){e.get(t)}),this.MAX_TEXTURE_INDEX=this.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,this.MAX_VERTEX_PRECISION=this._getMaxSupportPrecision(t.VERTEX_SHADER),this.MAX_FRAGMENT_PRECISION=this._getMaxSupportPrecision(t.FRAGMENT_SHADER),this.MAX_PRECISION=this.getMaxPrecision(this.MAX_FRAGMENT_PRECISION,this.MAX_VERTEX_PRECISION),this.VERTEX_TEXTURE_FLOAT=!!tt.texFloat&&this.MAX_VERTEX_TEXTURE_IMAGE_UNITS>0,this.FRAGMENT_TEXTURE_FLOAT=!!tt.texFloat,this.EXT_FRAG_DEPTH=tt.get("EXT_frag_depth"),this.SHADER_TEXTURE_LOD=!!tt.shaderTextureLod},get:function(t){var e=this.gl,n=this[t];return void 0===n&&(n=this[t]=e.getParameter(e[t])),n},_getMaxSupportPrecision:function(t){var e=this.gl,n="lowp";if(e.getShaderPrecisionFormat)for(var i=[{name:"highp",type:e.HIGH_FLOAT},{name:"mediump",type:e.MEDIUM_FLOAT}],r=0;r0){n=s.name;break}}else n="mediump";return n},getMaxPrecision:function(t,e){return"highp"===t||"mediump"===t&&"lowp"===e?e:t}},nt=n(56),it=n.n(nt),rt=n(57),st=n.n(rt),at=n(58),ot=n.n(at),ut=n(59),ct=n.n(ut),ht=new J,ft=s.a.create({isShader:!0,className:"Shader",vs:"",fs:"",Statics:{shaders:{"chunk/baseDefine.glsl":n(18),"chunk/color.frag":n(41),"chunk/color.vert":n(80),"chunk/color_main.vert":n(82),"chunk/diffuse.frag":n(64),"chunk/diffuse_main.frag":n(72),"chunk/extensions.frag":n(25),"chunk/extensions.vert":n(54),"chunk/fog.frag":n(48),"chunk/fog_main.frag":n(52),"chunk/frag_color.frag":n(53),"chunk/joint.vert":n(75),"chunk/joint_main.vert":n(85),"chunk/light.frag":n(45),"chunk/lightFog.frag":n(44),"chunk/lightFog.vert":n(78),"chunk/lightFog_main.frag":n(50),"chunk/lightFog_main.vert":n(88),"chunk/logDepth.frag":n(29),"chunk/logDepth_main.frag":n(30),"chunk/logDepth.vert":n(81),"chunk/logDepth_main.vert":n(89),"chunk/morph.vert":n(79),"chunk/morph_main.vert":n(84),"chunk/normal.frag":n(43),"chunk/normal.vert":n(77),"chunk/normal_main.frag":n(49),"chunk/normal_main.vert":n(87),"chunk/pbr.frag":n(91),"chunk/pbr_main.frag":n(93),"chunk/phong.frag":n(71),"chunk/phong_main.frag":n(73),"chunk/precision.frag":n(26),"chunk/precision.vert":n(55),"chunk/transparency.frag":n(47),"chunk/transparency_main.frag":n(51),"chunk/unQuantize.vert":n(74),"chunk/unQuantize_main.vert":n(83),"chunk/uv.frag":n(42),"chunk/uv.vert":n(76),"chunk/uv_main.vert":n(86),"method/encoding.glsl":n(92),"method/getDiffuse.glsl":n(66),"method/getLightAttenuation.glsl":n(68),"method/getShadow.glsl":n(70),"method/getSpecular.glsl":n(67),"method/packFloat.glsl":n(90),"method/textureEnvMap.glsl":n(46),"method/transpose.glsl":n(65),"method/unpackFloat.glsl":n(69),"basic.frag":n(56),"basic.vert":n(57),"geometry.frag":n(58),"pbr.frag":n(59),"screen.frag":n(60),"screen.vert":n(61)},init:function(t){this.renderer=t,this.commonHeader=this._getCommonHeader(this.renderer)},cache:{get:function(){return ht}},reset:function(t){ht.removeAll()},getHeaderKey:function(t,e,n,i,r){var s="header_"+e.id+"_"+n.lightInfo.uid;return t.isSkinedMesh&&(s+="_joint"+t.jointNames.length),i&&(s+="_fog_"+i.mode),s+="_"+t.geometry.getShaderKey(),r&&(s+="_fogDepth"),s},getHeader:function(t,e,n,i,r){var s=this.getHeaderKey(t,e,n,i),a=ht.get(s);if(!a||e.isDirty){var o={},u=e.lightType;u&&"NONE"!==u&&n.getRenderOption(o),e.getRenderOption(o),t.getRenderOption(o),i&&(o.HAS_FOG=1,i.getRenderOption(o)),r&&(o.USE_LOG_DEPTH=1,et.EXT_FRAG_DEPTH&&(o.USE_EXT_FRAG_DEPTH=1)),o.HAS_NORMAL&&o.NORMAL_MAP&&(o.HAS_TANGENT=1),o.RECEIVE_SHADOWS||(delete o.DIRECTIONAL_LIGHTS_SMC,delete o.SPOT_LIGHTS_SMC,delete o.POINT_LIGHTS_SMC),a="#define SHADER_NAME ".concat(e.className,"\n"),a+=Object.keys(o).map(function(t){return"#define HILO_".concat(t," ").concat(o[t])}).join("\n")+"\n",ht.add(s,a)}return a},_getCommonHeader:function(t){var e=et.getMaxPrecision(et.MAX_VERTEX_PRECISION,t.vertexPrecision),n=et.getMaxPrecision(et.MAX_FRAGMENT_PRECISION,t.fragmentPrecision),i=et.getMaxPrecision(e,n);return"\n#define HILO_MAX_PRECISION ".concat(i,"\n#define HILO_MAX_VERTEX_PRECISION ").concat(e,"\n#define HILO_MAX_FRAGMENT_PRECISION ").concat(n,"\n")},getShader:function(t,e,n,i,r,s){var a=this.getHeader(t,e,i,r,s);return e.isBasicMaterial||e.isPBRMaterial?this.getBasicShader(e,n,a):e.isShaderMaterial?this.getCustomShader(e.vs,e.fs,a,e.id):null},getBasicShader:function(t,e,n){var i=[];e&&(i=t.getInstancedUniforms().map(function(t){return t.name})),i=i.join("|");var r=t.className+":"+i+":"+n,s=ht.get(r);if(!s){var a="",o=st.a;if(t.isBasicMaterial?t.isGeometryMaterial?a+=ot.a:a+=it.a:t.isPBRMaterial&&(a+=ct.a),i){var u=new RegExp("^\\s*uniform\\s+(\\w+)\\s+(".concat(i,");"),"gm");o=o.replace(u,"attribute $1 $2;")}s=this.getCustomShader(o,a,n,r)}return s},getCustomShader:function(t,e,n,i){var r,s=this.commonHeader;return void 0!==i&&(r=ht.get(i)),r||(r=new ft({vs:s+n+t,fs:s+n+e}),i&&(r.id=i,ht.add(i,r))),r}},constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){return this._isDestroyed?this:(ht.removeObject(this),this._isDestroyed=!0,this)}}),lt=ft,dt=n(61),mt=n.n(dt),_t=n(60),pt=n.n(_t),gt=[{name:"FLOAT",byteSize:4,uniformFuncName:"uniform1f",type:"Scalar",size:1},{name:"FLOAT_VEC2",byteSize:8,uniformFuncName:"uniform2f",type:"Vector",size:2},{name:"FLOAT_VEC3",byteSize:12,uniformFuncName:"uniform3f",type:"Vector",size:3},{name:"FLOAT_VEC4",byteSize:16,uniformFuncName:"uniform4f",type:"Vector",size:4},{name:"FLOAT_MAT2",byteSize:16,uniformFuncName:"uniformMatrix2fv",type:"Matrix",size:4},{name:"FLOAT_MAT3",byteSize:36,uniformFuncName:"uniformMatrix3fv",type:"Matrix",size:9},{name:"FLOAT_MAT4",byteSize:64,uniformFuncName:"uniformMatrix4fv",type:"Matrix",size:16},{name:"INT",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"INT_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"INT_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"INT_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"BOOL",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"BOOL_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"BOOL_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"BOOL_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"SAMPLER_2D",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"SAMPLER_CUBE",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1}],vt={},Tt={dict:vt,init:function(t){gt.forEach(function(e){var n,i,r=e.name,s=e.uniformFuncName,a=s+"v";"Matrix"===e.type?n=i=function(e,n){void 0!==n&&t[s](e,!1,n)}:(n=function(e,n){void 0!==n&&t[s](e,n)},i=function(e,n){t[a](e,n)}),vt[t[r]]=Object.assign(e,{glValue:t[r],uniform:n,uniformArray:i})})},get:function(t){return vt[t]}},Et=new J,Mt=s.a.create({Statics:{cache:{get:function(){return Et}},reset:function(t){Et.each(function(t){t.destroy()})},getProgram:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t.id,r=Et.get(i);return r||(r=new Mt({state:e,vertexShader:t.vs,fragShader:t.fs,ignoreError:n}),Et.add(i,r)),r},getBlankProgram:function(t){var e=lt.getCustomShader("void main(){}","void main(){}","","__hiloBlankShader");return this.getProgram(e,t,!0)}},className:"Program",isProgram:!0,fragShader:"",vertexShader:"",attributes:null,uniforms:null,program:null,gl:null,state:null,constructor:function(t){return this.id=d.a.generateUUID(this.className),Object.assign(this,t),this._dict={},this.attributes={},this.uniforms={},this.gl=this.state.gl,this.program=this.createProgram(),this.program?(this.initAttributes(),this.initUniforms(),this):this.ignoreError?this:Mt.getBlankProgram(t.state)},createProgram:function(){var t=this.gl,e=t.createProgram(),n=this.createShader(t.VERTEX_SHADER,this.vertexShader),i=this.createShader(t.FRAGMENT_SHADER,this.fragShader);if(n&&i){if(t.attachShader(e,n),t.attachShader(e,i),t.linkProgram(e),t.deleteShader(n),t.deleteShader(i),!t.getProgramParameter(e,t.LINK_STATUS)){var r=t.getProgramInfoLog(e);return m.a.error("compileProgramError: "+r,this),t.deleteProgram(e),null}return e}return null},useProgram:function(){this.state.useProgram(this.program)},createShader:function(t,e){var n=this.gl,i=n.createShader(t);if(n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){var r=n.getShaderInfoLog(i);return m.a.error("compileShaderError: "+r,e.split("\n").map(function(t,e){return"".concat(e+1," ").concat(t)}).join("\n")),null}return i},initAttributes:function(){for(var t=this,e=this.gl,n=this.program,i=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),r=tt.instanced,s=function(i){var s=e.getActiveAttrib(n,i),a=s.name,o=s.type,u=s.size,c=e.getAttribLocation(n,a),h=Tt.get(o),f=function(t){var n=t.type,i=void 0===n?e.FLOAT:n,r=t.normalized,s=void 0!==r&&r,a=t.stride,o=void 0===a?0:a,u=t.offset,f=void 0===u?0:u;e.vertexAttribPointer(c,h.size,i,s,o,f)},l=function(){e.enableVertexAttribArray(c)},d=function(){},m=function(t,e){t[c]=e};if(r&&(d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;r.vertexAttribDivisorANGLE(c,t)}),"Matrix"===h.type){var _=h.byteSize,p=h.size,g=Math.sqrt(p),v=4*g,T=function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:1;T(function(e){r.vertexAttribDivisorANGLE(e,t)})})}t.attributes[a]={name:a,location:c,type:o,size:u,glTypeInfo:h,pointer:f,enable:l,divisor:d,addTo:m}},a=0;a1||o>1?function(t){f(c,t)}:function(e){t._dict[a]!==e&&(t._dict[a]=e,l(c,e))}})},a=0;a2&&void 0!==arguments[2]?arguments[2]:Ot;return this.createBuffer(t,Lt,e,n)},createBuffer:function(t,e,n,i){var r=n.bufferViewId,s=St.get(r);return s||(s=new Rt(t,e,n.data,i),St.add(r,s),s)},createIndexBuffer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ot;return this.createBuffer(t,It,e,n)}},className:"Buffer",isBuffer:!0,constructor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ot;this.id=d.a.generateUUID(this.className),this.gl=t,this.target=e,this.usage=i,this.buffer=t.createBuffer(),n&&this.upload(n)},bind:function(){return this.gl.bindBuffer(this.target,this.buffer),this},upload:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.gl,i=this.target,r=this.usage;return this.bind(),!this.data||this.data.byteLength2&&void 0!==arguments[2]?arguments[2]:0,i=0,r=e.length;i0&&void 0!==arguments[0]?arguments[0]:1;this.bind();var e=this.gl,n=this.mode;this.useInstanced&&(this.indexBuffer?this.instancedExtension.drawElementsInstancedANGLE(n,this.vertexCount,e.UNSIGNED_SHORT,0,t):this.instancedExtension.drawArraysInstancedANGLE(n,0,this.getVertexCount(),t))},addIndexBuffer:function(t,e){this.bind();var n=this.gl,i=this.indexBuffer;return this.indexType=t.type,i?t.isDirty&&(t.isDirty=!1,i.upload(t.data),this.vertexCount=t.length):((i=yt.createIndexBuffer(n,t,e)).bind(),this.indexBuffer=i,this.vertexCount=t.length,t.isDirty=!1),i},addAttribute:function(t,e,n,i){this.bind();var r=this.gl,s=e.name,a=this[s];if(a)t.isDirty&&(t.isDirty=!1,a.buffer.upload(t.data));else{t.isDirty=!1;var o=yt.createVertexBuffer(r,t,n);o.bind(),e.enable(),e.pointer(t),a={attribute:e,buffer:o,geometryData:t},this.attributes.push(a),this[s]=a,e.addTo(this.activeStates,a),i&&i(a)}return a},addInstancedAttribute:function(t,e,n){this.bind();var i=this.gl,r=t.name,s=t.glTypeInfo,a=Nt.getTypedArray(Float32Array,e.length*s.size);e.forEach(function(t,e){void 0!==n(t)?Nt.fillArrayData(a,n(t),e*s.size):m.a.warn("no attributeData:"+r+"-"+t.name)});var o,u=this[r];return u?(o=u.geometryData).data=a:o=new w(a,1),this.addAttribute(o,t,i.DYNAMIC_DRAW,function(e){t.divisor(1),e.useInstanced=!0})},useResource:function(t,e){return this.attributes.forEach(function(n){t.useResource(n.buffer,e)}),this.indexBuffer&&t.useResource(this.indexBuffer,e),this},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){var t=this;return this._isDestroyed?this:(this.useVao&&this.vaoExtension.deleteVertexArrayOES(this.vao),this.gl=null,this.indexBuffer=null,this.attributes.forEach(function(e){t[e.name]=null}),this.attributes=null,this.activeStates=null,Pt.removeObject(this),this._isDestroyed=!0,this)}}),Dt=Ht,Ft=C.a.TEXTURE_2D,Ut=C.a.RGBA,Gt=C.a.UNSIGNED_BYTE,Bt=C.a.COLOR_ATTACHMENT0,Vt=C.a.DEPTH_STENCIL,Xt=C.a.DEPTH_TEST,jt=C.a.CULL_FACE,kt=C.a.TRIANGLE_STRIP,zt=C.a.NEAREST,qt=new J,Yt=s.a.create({Statics:{cache:{get:function(){return qt}},reset:function(t){qt.each(function(t){t.reset()})},destroy:function(t){qt.each(function(t){t.destroy()})}},className:"Framebuffer",isFramebuffer:!0,bufferInternalFormat:Vt,target:Ft,internalFormat:Ut,data:null,format:Ut,type:Gt,attachment:Bt,needRenderbuffer:!0,useVao:!0,renderer:null,texture:null,renderbuffer:null,framebuffer:null,_isInit:!1,minFilter:zt,magFilter:zt,constructor:function(t,e){this.id=d.a.generateUUID(this.className),this.renderer=t,Object.assign(this,e),this.width||(this.width=t.width),this.height||(this.height=t.height),qt.add(this.id,this)},init:function(){if(!this._isInit&&this.renderer.isInit){this._isInit=!0;var t=this.renderer;this.gl=t.gl,this.state=t.state,this.reset()}},reset:function(){this.destroyResource();var t=this.gl;this.framebuffer=t.createFramebuffer(),this.bind(),this.needRenderbuffer&&(this.renderbuffer=this.createRenderbuffer()),this.texture=this.createTexture(),this.isComplete()||m.a.warn("Framebuffer is not complete => "+t.checkFramebufferStatus(t.FRAMEBUFFER)),this.unbind()},isComplete:function(){var t=this.gl;return!(!t||t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)},bind:function(){this.init(),this._isInit&&this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this.framebuffer)},unbind:function(){if(this.init(),this._isInit){var t=this.state;t.bindFramebuffer(this.gl.FRAMEBUFFER,t.preFramebuffer)}},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new v.a(0,0,0,0);if(this._isInit){var e=this.gl;e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}},render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4?arguments[4]:void 0;if(this._isInit){var s=this.gl,a=this.state;a.disable(Xt),a.disable(jt),r&&this.clear(r);var o=lt.getCustomShader(mt.a,pt.a,"","FramebufferTextureShader"),u=At.getProgram(o,a);u.useProgram();var c="".concat(t,"_").concat(e,"_").concat(n,"_").concat(i,"_").concat(u.id),h=Dt.getVao(s,c,{useVao:this.useVao,useInstanced:!1,mode:kt});if(h.isDirty){h.isDirty=!1;var f=[t=2*t-1,e=1-2*e,t+(n*=2),e,t,e-(i*=2),t+n,e-i];h.addAttribute(new w(new Float32Array(f),2),u.attributes.a_position),h.addAttribute(new w(new Float32Array([0,1,1,1,0,0,1,0]),2),u.attributes.a_texcoord0)}a.activeTexture(s.TEXTURE0),a.bindTexture(s.TEXTURE_2D,this.texture),h.draw()}},createRenderbuffer:function(){var t=this.gl,e=this.width,n=this.height,i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e,n),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,i),i},createTexture:function(){var t=this.state,e=t.gl,n=e.createTexture();return t.activeTexture(e.TEXTURE0+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,n),e.texImage2D(this.target,0,this.internalFormat,this.width,this.height,0,this.format,this.type,this.data),e.texParameteri(this.target,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(this.target,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(this.target,e.TEXTURE_MIN_FILTER,this.minFilter),e.texParameteri(this.target,e.TEXTURE_MAG_FILTER,this.magFilter),e.framebufferTexture2D(e.FRAMEBUFFER,this.attachment,this.target,n,0),n},resize:function(t,e,n){(n||this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this._isInit&&this.reset())},readPixels:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=new(Object(r.getTypedArrayClass)(this.type))(n*i*4);if(this._isInit){var a=this.gl;e=this.height-e-i,this.bind(),a.readPixels(t,e,n,i,this.format,this.type,s),this.unbind()}return s},destroy:function(){this.destroyResource(),this.gl=null,qt.removeObject(this)},destroyResource:function(){var t=this.gl;t&&(this.framebuffer&&(t.deleteFramebuffer(this.framebuffer),this.framebuffer=null),this.renderbuffer&&(t.deleteRenderbuffer(this.renderbuffer),this.renderbuffer=null),this.texture&&(t.deleteTexture(this.texture),this.texture=null))}}),Wt=C.a.TEXTURE_2D,Zt=C.a.RGBA,Kt=C.a.LINEAR,Qt=C.a.NEAREST,Jt=C.a.REPEAT,$t=C.a.CLAMP_TO_EDGE,te=C.a.UNSIGNED_BYTE,ee=new J,ne=s.a.create({Statics:{cache:{get:function(){return ee}},reset:function(t){ee.each(function(e,n){t.deleteTexture(e),ee.remove(n)})}},isTexture:!0,className:"Texture",image:null,mipmaps:null,target:Wt,internalFormat:Zt,format:Zt,type:te,width:0,height:0,border:0,magFilter:Kt,minFilter:Kt,wrapS:Jt,wrapT:Jt,name:"",premultiplyAlpha:!1,flipY:!1,compressed:!1,needUpdate:!0,needDestory:!1,autoUpdate:!1,uv:0,useMipmap:{get:function(){return this.minFilter!==Kt&&this.minFilter!==Qt},set:function(){m.a.warn("texture.useMipmap is readOnly!")}},useRepeat:{get:function(){return this.wrapS!==$t||this.wrapT!==$t},set:function(){m.a.warn("texture.useRepeat is readOnly!")}},mipmapCount:{get:function(){return Math.floor(Math.log2(Math.max(this.width,this.height))+1)},set:function(){m.a.warn("texture.mipmapCount is readOnly!")}},constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},isImgPowerOfTwo:function(t){return d.a.isPowerOfTwo(t.width)&&d.a.isPowerOfTwo(t.height)},getSupportSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.width,i=t.height;e&&!this.isImgPowerOfTwo(t)&&(n=d.a.nextPowerOfTwo(n),i=d.a.nextPowerOfTwo(i));var r=et.MAX_TEXTURE_SIZE;return r&&(n>r&&(n=r),i>r&&(i=r)),{width:n,height:i}},resizeImgToPowerOfTwo:function(t){var e=this.getSupportSize(t,!0);return this.resizeImg(t,e.width,e.height)},resizeImg:function(t,e,n){if(t.width===e&&t.height===n)return t;var i=this._canvasImage;return i||(i=document.createElement("canvas"),this._canvasImage=i,this._canvasCtx=i.getContext("2d")),i.width=e,i.height=n,this._canvasCtx.drawImage(t,0,0,t.width,t.height,0,0,e,n),m.a.warnOnce("Texture.resizeImg(".concat(this.id,")"),"image size(".concat(t.width,"x").concat(t.height,") is not support. Resized to ").concat(i.width,"x").concat(i.height),t.src),this._originImage=t,i},_glUploadTexture:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.width,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.height,a=t.gl;return this.compressed?a.compressedTexImage2D(e,i,this.internalFormat,r,s,this.border,n):n.width?a.texImage2D(e,i,this.internalFormat,this.format,this.type,n):a.texImage2D(e,i,this.internalFormat,r,s,this.border,this.format,this.type,n),this},_uploadTexture:function(t){var e=this;return this.useMipmap&&this.mipmaps?this.mipmaps.forEach(function(n,i){e._glUploadTexture(t,e.target,n.data,i,n.width,n.height)}):this._glUploadTexture(t,this.target,this.image,0),this},updateTexture:function(t,e){var n=t.gl;if(this.needUpdate||this.autoUpdate){this._originImage&&this.image===this._canvasImage&&(this.image=this._originImage);var i=this.useMipmap,r=this.useRepeat||i,s=this.getSupportSize(this.image,r);this.image=this.resizeImg(this.image,s.width,s.height),t.activeTexture(n.TEXTURE0+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),t.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!!this.flipY),this._uploadTexture(t),i&&(this.compressed?this.mipmaps||(m.a.warn("Compressed texture has no mipmips, changed the minFilter from ".concat(this.minFilter," to Linear!"),this),this.minFilter=Kt):n.generateMipmap(this.target)),this.needUpdate=!1}return this},getGLTexture:function(t){var e=this.gl=t.gl,n=this.id;this.needDestory&&(this.destroy(),this.needDestory=!1);var i=ee.get(n);return i?this.updateTexture(t,i):(i=e.createTexture(),ee.add(n,i),this.needUpdate=!0,this.updateTexture(t,i),e.texParameterf(this.target,e.TEXTURE_MAG_FILTER,this.magFilter),e.texParameterf(this.target,e.TEXTURE_MIN_FILTER,this.minFilter),e.texParameterf(this.target,e.TEXTURE_WRAP_S,this.wrapS),e.texParameterf(this.target,e.TEXTURE_WRAP_T,this.wrapT)),i},setGLTexture:function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&this.destroy(),ee.add(this.id,t),this},destroy:function(){var t=this.id,e=ee.get(t);return e&&this.gl&&(this.gl.deleteTexture(e),ee.remove(t)),this},clone:function(){var t=Object.assign({},this);return delete t.id,new this.constructor(t)}}),ie=C.a.TEXTURE_2D,re=C.a.RGBA,se=C.a.NEAREST,ae=C.a.CLAMP_TO_EDGE,oe=C.a.FLOAT,ue=s.a.create({Extends:ne,isDataTexture:!0,className:"DataTexture",target:ie,internalFormat:re,format:re,type:oe,magFilter:se,minFilter:se,wrapS:ae,wrapT:ae,dataLength:0,resetSize:function(t){if(t!==this.dataLength){this.dataLength=t;var e=d.a.nextPowerOfTwo(t/4),n=Math.max(Math.log2(e),4),i=Math.floor(n/2),s=n-i;this.width=Math.pow(2,i),this.height=Math.pow(2,s),this.DataClass=Object(r.getTypedArrayClass)(this.type)}},data:{get:function(){return this.image},set:function(t){if(this.image!==t){this.resetSize(t.length);var e=this.width*this.height*4;e===t.length&&t instanceof this.DataClass?this.image=t:(this.image&&this.image.length===e||(this.image=new this.DataClass(e)),this.image.set(t,0)),this.needUpdate=!0}}},constructor:function(t){ue.superclass.constructor.call(this,t)}}),ce=ue;function he(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var fe,le,de,me,_e,pe=C.a.TEXTURE_2D,ge=C.a.TEXTURE_CUBE_MAP,ve=(new c.a,new y.a),Te=new o.a,Ee=new Float32Array([.5,.5,.5,1]),Me={state:null,camera:null,lightManager:null,fog:null,gl:null,blankInfo:{get:function(){}},init:function(t,e,n,i){me=this.state=t,fe=this.camera=e,de=this.lightManager=n,_e=this.fog=i,le=this.gl=me.gl},setCamera:function(t){fe=this.camera=t},handlerColorOrTexture:function(t,e){return t&&t.isTexture?this.handlerTexture(t,e):(t&&t.isColor?t.toArray(Ee):Ee[0]=Ee[1]=Ee[2]=.5,Ee)},handlerTexture:function(t,e){if(t&&t.isTexture)return this.handlerGLTexture(t.target,t.getGLTexture(me),e)},handlerGLTexture:function(t,e,n){if(e)return me.activeTexture(le.TEXTURE0+n),me.bindTexture(t,e),n},handlerUV:function(t){return t&&t.isTexture&&t.uv||0},POSITION:{get:function(t,e,n){return t.geometry.vertices}},NORMAL:{get:function(t,e,n){return t.geometry.normals}},TANGENT:{get:function(t,e,n){var i=e.normalMap;if(i&&i.isTexture)return 1===Number(i.uv)?t.geometry.tangents1:t.geometry.tangents}},TEXCOORD_0:{get:function(t,e,n){if(t.geometry.uvs)return t.geometry.uvs}},TEXCOORD_1:{get:function(t,e,n){if(t.geometry.uvs1)return t.geometry.uvs1}},UVMATRIX_0:{get:function(t,e,n){if(e.uvMatrix)return e.uvMatrix.elements}},UVMATRIX_1:{get:function(t,e,n){if(e.uvMatrix1)return e.uvMatrix1.elements}},CAMERAFAR:{get:function(t,e,n){if(fe.isPerspectiveCamera)return fe.far}},CAMERANEAR:{get:function(t,e,n){if(fe.isPerspectiveCamera)return fe.near}},CAMERATYPE:{get:function(t,e,n){return fe.isPerspectiveCamera?1:0}},COLOR_0:{get:function(t,e,n){if(t.geometry.colors)return t.geometry.colors}},SKININDICES:{get:function(t,e,n){return t.geometry.skinIndices}},SKINWEIGHTS:{get:function(t,e,n){return t.geometry.skinWeights}},LOCAL:{get:function(t,e,n){return t.matrix.elements},isDependMesh:!0},MODEL:{get:function(t,e,n){return t.worldMatrix.elements},isDependMesh:!0},VIEW:{get:function(t,e,n){return fe.viewMatrix.elements}},PROJECTION:{get:function(t,e,n){return fe.projectionMatrix.elements}},VIEWPROJECTION:{get:function(t,e,n){return fe.viewProjectionMatrix.elements}},MODELVIEW:{get:function(t,e,n){return fe.getModelViewMatrix(t,Te).elements},isDependMesh:!0},MODELVIEWPROJECTION:{get:function(t,e,n){return fe.getModelProjectionMatrix(t,Te).elements},isDependMesh:!0},MODELINVERSE:{get:function(t,e,n){return Te.invert(t.worldMatrix).elements},isDependMesh:!0},VIEWINVERSE:{get:function(t,e,n){return fe.worldMatrix.elements}},PROJECTIONINVERSE:{get:function(t,e,n){return Te.invert(fe.projectionMatrix).elements}},MODELVIEWINVERSE:{get:function(t,e,n){return Te.invert(fe.getModelViewMatrix(t,Te)).elements},isDependMesh:!0},MODELVIEWPROJECTIONINVERSE:{get:function(t,e,n){return Te.invert(fe.getModelProjectionMatrix(t,Te)).elements},isDependMesh:!0},MODELINVERSETRANSPOSE:{get:function(t,e,n){return ve.normalFromMat4(t.worldMatrix).elements},isDependMesh:!0},MODELVIEWINVERSETRANSPOSE:{get:function(t,e,n){return ve.normalFromMat4(fe.getModelViewMatrix(t,Te)).elements},isDependMesh:!0},VIEWPORT:void 0,JOINTMATRIX:{get:function(t,e,n){if(t.isSkinedMesh)return t.getJointMat();m.a.warnOnce("semantic.JOINTMATRIX(".concat(t.id,")"),"Current mesh is not SkinedMesh!",t.id)},isDependMesh:!0,notSupportInstanced:!0},JOINTMATRIXTEXTURE:{get:function(t,e,n){if(t.isSkinedMesh)return t.updateJointMatTexture(),Me.handlerTexture(t.jointMatTexture,n.textureIndex);m.a.warnOnce("semantic.JOINTMATRIXTEXTURE(".concat(t.id,")"),"Current mesh is not SkinedMesh!",t.id)},isDependMesh:!0,notSupportInstanced:!0},JOINTMATRIXTEXTURESIZE:{get:function(t,e,n){if(t.isSkinedMesh)return t.initJointMatTexture(),[t.jointMatTexture.width,t.jointMatTexture.height];m.a.warnOnce("semantic.JOINTMATRIXTEXTURESIZE(".concat(t.id,")"),"Current mesh is not SkinedMesh!",t.id)},isDependMesh:!0,notSupportInstanced:!0},NORMALMAPSCALE:{get:function(t,e,n){return e.normalMapScale}},OCCLUSIONSTRENGTH:{get:function(t,e,n){return e.occlusionStrength}},SHININESS:{get:function(t,e,n){return e.shininess}},SPECULARENVMATRIX:{get:function(t,e,n){return e.specularEnvMatrix&&e.specularEnvMap?e.specularEnvMatrix.elements:(Te.identity(),Te.elements)}},REFLECTIVITY:{get:function(t,e,n){return e.reflectivity}},REFRACTRATIO:{get:function(t,e,n){return e.refractRatio}},REFRACTIVITY:{get:function(t,e,n){return e.refractivity}},LOGDEPTH:{get:function(t,e,n){return 2/(Math.log(fe.far+1)/Math.LN2)}},AMBIENTLIGHTSCOLOR:{get:function(t,e,n){return de.ambientInfo}},DIRECTIONALLIGHTSCOLOR:{get:function(t,e,n){return de.directionalInfo.colors}},DIRECTIONALLIGHTSINFO:{get:function(t,e,n){return de.directionalInfo.infos}},DIRECTIONALLIGHTSSHADOWMAP:{get:function(t,e,n){return de.directionalInfo.shadowMap.map(function(t,e){return Me.handlerGLTexture(pe,t,n.textureIndex+e)})}},DIRECTIONALLIGHTSSHADOWMAPSIZE:{get:function(t,e,n){return de.directionalInfo.shadowMapSize}},DIRECTIONALLIGHTSSHADOWBIAS:{get:function(t,e,n){return de.directionalInfo.shadowBias}},DIRECTIONALLIGHTSPACEMATRIX:{get:function(t,e,n){return de.directionalInfo.lightSpaceMatrix}},POINTLIGHTSPOS:{get:function(t,e,n){return de.pointInfo.poses}},POINTLIGHTSCOLOR:{get:function(t,e,n){return de.pointInfo.colors}},POINTLIGHTSINFO:{get:function(t,e,n){return de.pointInfo.infos}},POINTLIGHTSRANGE:{get:function(t,e,n){return de.pointInfo.ranges}},POINTLIGHTSSHADOWMAP:{get:function(t,e,n){return de.pointInfo.shadowMap.map(function(t,e){return Me.handlerGLTexture(ge,t,n.textureIndex+e)})}},POINTLIGHTSSHADOWBIAS:{get:function(t,e,n){return de.pointInfo.shadowBias}},POINTLIGHTSPACEMATRIX:{get:function(t,e,n){return de.pointInfo.lightSpaceMatrix}},POINTLIGHTCAMERA:{get:function(t,e,n){return de.pointInfo.cameras}},SPOTLIGHTSPOS:{get:function(t,e,n){return de.spotInfo.poses}},SPOTLIGHTSDIR:{get:function(t,e,n){return de.spotInfo.dirs}},SPOTLIGHTSCOLOR:{get:function(t,e,n){return de.spotInfo.colors}},SPOTLIGHTSCUTOFFS:{get:function(t,e,n){return de.spotInfo.cutoffs}},SPOTLIGHTSINFO:{get:function(t,e,n){return de.spotInfo.infos}},SPOTLIGHTSRANGE:{get:function(t,e,n){return de.spotInfo.ranges}},SPOTLIGHTSSHADOWMAP:{get:function(t,e,n){return de.spotInfo.shadowMap.map(function(t,e){return Me.handlerGLTexture(pe,t,n.textureIndex+e)})}},SPOTLIGHTSSHADOWMAPSIZE:{get:function(t,e,n){return de.spotInfo.shadowMapSize}},SPOTLIGHTSSHADOWBIAS:{get:function(t,e,n){return de.spotInfo.shadowBias}},SPOTLIGHTSPACEMATRIX:{get:function(t,e,n){return de.spotInfo.lightSpaceMatrix}},AREALIGHTSCOLOR:{get:function(t,e,n){return de.areaInfo.colors}},AREALIGHTSPOS:{get:function(t,e,n){return de.areaInfo.poses}},AREALIGHTSWIDTH:{get:function(t,e,n){return de.areaInfo.width}},AREALIGHTSHEIGHT:{get:function(t,e,n){return de.areaInfo.height}},AREALIGHTSLTCTEXTURE1:{get:function(t,e,n){return Me.handlerTexture(de.areaInfo.ltcTexture1,n.textureIndex)}},AREALIGHTSLTCTEXTURE2:{get:function(t,e,n){return Me.handlerTexture(de.areaInfo.ltcTexture2,n.textureIndex)}},FOGCOLOR:{get:function(t,e,n){if(_e)return _e.color.elements}},FOGINFO:{get:function(t,e,n){if(_e)return _e.getInfo()}},POSITIONDECODEMAT:{get:function(t,e,n){return t.geometry.positionDecodeMat},isDependMesh:!0},NORMALDECODEMAT:{get:function(t,e,n){return t.geometry.normalDecodeMat},isDependMesh:!0},UVDECODEMAT:{get:function(t,e,n){return t.geometry.uvDecodeMat},isDependMesh:!0},UV1DECODEMAT:{get:function(t,e,n){return t.geometry.uv1DecodeMat},isDependMesh:!0},BASECOLOR:{get:function(t,e,n){return e.baseColor.elements}},METALLIC:{get:function(t,e,n){return e.metallic}},ROUGHNESS:{get:function(t,e,n){return e.roughness}},DIFFUSEENVMAP:{get:function(t,e,n){return Me.handlerTexture(e.diffuseEnvMap,n.textureIndex)}},BRDFLUT:{get:function(t,e,n){return Me.handlerTexture(e.brdfLUT,n.textureIndex)}},SPECULARENVMAP:{get:function(t,e,n){return Me.handlerTexture(e.specularEnvMap,n.textureIndex)}},GLOSSINESS:{get:function(t,e,n){return e.glossiness}},ALPHACUTOFF:{get:function(t,e,n){return e.alphaCutoff}},EXPOSURE:{get:function(t,e,n){return e.exposure}},GAMMAFACTOR:{get:function(t,e,n){return e.gammaFactor}},MORPHWEIGHTS:{isDependMesh:!0,notSupportInstanced:!0,get:function(t,e,n){var i=t.geometry;if(i.isMorphGeometry&&i.weights)return i.weights}}};[["POSITION","vertices"],["NORMAL","normals"],["TANGENT","tangents"]].forEach(function(t){for(var e=0;e<8;e++)Me["MORPH"+t[0]+e]={get:function(t,e){return function(n,i,r){var s=n.geometry;if(s.isMorphGeometry&&s.targets&&s.targets[t]){var a=s._originalMorphIndices?s._originalMorphIndices[e]:e,o=s.targets[t][a],u="_target_".concat(t,"_").concat(e);return s[u]!==a&&o&&(o.isDirty=!0,s[u]=a),o}}}(t[1],e)}}),[["DIFFUSE","diffuse"],["SPECULAR","specular"],["EMISSION","emission"],["AMBIENT","ambient"]].forEach(function(t){var e=he(t,2),n=e[0],i=e[1];Me[n]={get:function(t,e,n){return Me.handlerColorOrTexture(e[i],n.textureIndex)}},Me["".concat(n,"UV")]={get:function(t,e,n){return Me.handlerUV(e[i])}}}),[["NORMALMAP","normalMap"],["PARALLAXMAP","parallaxMap"],["BASECOLORMAP","baseColorMap"],["METALLICMAP","metallicMap"],["ROUGHNESSMAP","roughnessMap"],["METALLICROUGHNESSMAP","metallicRoughnessMap"],["OCCLUSIONMAP","occlusionMap"],["SPECULARGLOSSINESSMAP","specularGlossinessMap"],["LIGHTMAP","lightMap"]].forEach(function(t){var e=he(t,2),n=e[0],i=e[1];Me[n]={get:function(t,e,n){return Me.handlerTexture(e[i],n.textureIndex)}},Me["".concat(n,"UV")]={get:function(t,e,n){return Me.handlerUV(e[i])}}}),[["TRANSPARENCY","transparency"]].forEach(function(t){var e=he(t,2),n=e[0],i=e[1];Me[n]={get:function(t,e,n){var r=e[i];return r&&r.isTexture?Me.handlerTexture(r,n.textureIndex):null!=r?r:1}},Me["".concat(n,"UV")]={get:function(t,e,n){return Me.handlerUV(e[i])}}});var Ae=Me,Le=C.a.LEQUAL,Ie=C.a.BACK,Oe=C.a.FRONT,Se=C.a.FRONT_AND_BACK,Re=C.a.ZERO,ye=C.a.ONE,xe=C.a.FUNC_ADD,Ne=C.a.ONE_MINUS_SRC_ALPHA,be={isBlankInfo:!0,get:function(){}},we=s.a.create({isMaterial:!0,className:"Material",lightType:"NONE",wireframe:!1,depthTest:!0,sampleAlphaToCoverage:!1,depthMask:!0,depthRange:[0,1],depthFunc:Le,_cullFace:!0,normalMap:null,parallaxMap:null,normalMapScale:1,ignoreTranparent:!1,gammaCorrection:!1,usePhysicsLight:!1,gammaOutput:{get:function(){return m.a.warnOnce("Matrial.gammaOutput","material.gammaOutput has deprecated. Use material.gammaCorrection instead."),this.gammaCorrection},set:function(t){m.a.warnOnce("Matrial.gammaOutput","material.gammaOutput has deprecated. Use material.gammaCorrection instead."),this.gammaCorrection=t}},gammaFactor:2.2,castShadows:!0,receiveShadows:!0,uvMatrix:null,uvMatrix1:null,cullFace:{get:function(){return this._cullFace},set:function(t){this._cullFace=t,t?this.cullFaceType=this._cullFaceType:this._side=Se}},_cullFaceType:Ie,cullFaceType:{get:function(){return this._cullFaceType},set:function(t){this._cullFaceType=t,this._cullFace&&(t===Ie?this._side=Oe:t===Oe&&(this._side=Ie))}},_side:Oe,side:{get:function(){return this._side},set:function(t){this._side!==t&&(this._side=t,t===Se?this._cullFace=!1:(this._cullFace=!0,t===Oe?this._cullFaceType=Ie:t===Ie&&(this._cullFaceType=Oe)))}},blend:!1,blendEquation:xe,blendEquationAlpha:xe,blendSrc:ye,blendDst:Re,blendSrcAlpha:ye,blendDstAlpha:Re,isDirty:!1,transparency:1,_transparent:!1,transparent:{get:function(){return this._transparent},set:function(t){this._transparent!==t&&(this._transparent=t,t?(this.blend=!0,this.blendSrc=ye,this.blendDst=Ne,this.blendSrcAlpha=ye,this.blendDstAlpha=Ne,this.depthMask=!1):(this.blend=!1,this.depthMask=!0))}},alphaCutoff:0,useHDR:!1,exposure:1,needBasicUnifroms:!0,needBasicAttributes:!0,constructor:function(t){this.id=d.a.generateUUID(this.className),this.uniforms={},this.attributes={},Object.assign(this,t),this.needBasicAttributes&&this.addBasicAttributes(),this.needBasicUnifroms&&this.addBasicUniforms()},addBasicAttributes:function(){var t=this;Object.assign(this.attributes,{a_position:"POSITION",a_normal:"NORMAL",a_tangent:"TANGENT",a_texcoord0:"TEXCOORD_0",a_texcoord1:"TEXCOORD_1",a_color:"COLOR_0",a_skinIndices:"SKININDICES",a_skinWeights:"SKINWEIGHTS"}),["POSITION","NORMAL","TANGENT"].forEach(function(e){for(var n=e.slice(0,1)+e.slice(1).toLowerCase(),i=0;i<8;i++)t.attributes["a_morph"+n+i]="MORPH"+e+i})},addBasicUniforms:function(){Object.assign(this.uniforms,{u_normalMatrix:"MODELVIEWINVERSETRANSPOSE",u_modelViewMatrix:"MODELVIEW",u_modelViewProjectionMatrix:"MODELVIEWPROJECTION",u_logDepth:"LOGDEPTH",u_ambientLightsColor:"AMBIENTLIGHTSCOLOR",u_directionalLightsColor:"DIRECTIONALLIGHTSCOLOR",u_directionalLightsInfo:"DIRECTIONALLIGHTSINFO",u_directionalLightsShadowMap:"DIRECTIONALLIGHTSSHADOWMAP",u_directionalLightsShadowMapSize:"DIRECTIONALLIGHTSSHADOWMAPSIZE",u_directionalLightsShadowBias:"DIRECTIONALLIGHTSSHADOWBIAS",u_directionalLightSpaceMatrix:"DIRECTIONALLIGHTSPACEMATRIX",u_pointLightsPos:"POINTLIGHTSPOS",u_pointLightsColor:"POINTLIGHTSCOLOR",u_pointLightsInfo:"POINTLIGHTSINFO",u_pointLightsRange:"POINTLIGHTSRANGE",u_pointLightsShadowBias:"POINTLIGHTSSHADOWBIAS",u_pointLightsShadowMap:"POINTLIGHTSSHADOWMAP",u_pointLightSpaceMatrix:"POINTLIGHTSPACEMATRIX",u_pointLightCamera:"POINTLIGHTCAMERA",u_spotLightsPos:"SPOTLIGHTSPOS",u_spotLightsDir:"SPOTLIGHTSDIR",u_spotLightsColor:"SPOTLIGHTSCOLOR",u_spotLightsCutoffs:"SPOTLIGHTSCUTOFFS",u_spotLightsInfo:"SPOTLIGHTSINFO",u_spotLightsRange:"SPOTLIGHTSRANGE",u_spotLightsShadowMap:"SPOTLIGHTSSHADOWMAP",u_spotLightsShadowMapSize:"SPOTLIGHTSSHADOWMAPSIZE",u_spotLightsShadowBias:"SPOTLIGHTSSHADOWBIAS",u_spotLightSpaceMatrix:"SPOTLIGHTSPACEMATRIX",u_areaLightsPos:"AREALIGHTSPOS",u_areaLightsColor:"AREALIGHTSCOLOR",u_areaLightsWidth:"AREALIGHTSWIDTH",u_areaLightsHeight:"AREALIGHTSHEIGHT",u_areaLightsLtcTexture1:"AREALIGHTSLTCTEXTURE1",u_areaLightsLtcTexture2:"AREALIGHTSLTCTEXTURE2",u_jointMat:"JOINTMATRIX",u_jointMatTexture:"JOINTMATRIXTEXTURE",u_jointMatTextureSize:"JOINTMATRIXTEXTURESIZE",u_positionDecodeMat:"POSITIONDECODEMAT",u_normalDecodeMat:"NORMALDECODEMAT",u_uvDecodeMat:"UVDECODEMAT",u_uv1DecodeMat:"UV1DECODEMAT",u_morphWeights:"MORPHWEIGHTS",u_normalMapScale:"NORMALMAPSCALE",u_emission:"EMISSION",u_transparency:"TRANSPARENCY",u_uvMatrix:"UVMATRIX_0",u_uvMatrix1:"UVMATRIX_1",u_fogColor:"FOGCOLOR",u_fogInfo:"FOGINFO",u_alphaCutoff:"ALPHACUTOFF",u_exposure:"EXPOSURE",u_gammaFactor:"GAMMAFACTOR"}),this.addTextureUniforms({u_normalMap:"NORMALMAP",u_parallaxMap:"PARALLAXMAP",u_emission:"EMISSION",u_transparency:"TRANSPARENCY"})},addTextureUniforms:function(t){var e={};for(var n in t){var i=t[n];e[n]=i,e["".concat(n,".texture")]=i,e["".concat(n,".uv")]="".concat(i,"UV")}Object.assign(this.uniforms,e)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.lightType;e["LIGHT_TYPE_".concat(n)]=1,e.SIDE=this.side;var i=this._textureOption.reset(e);return e.HAS_LIGHT&&(e.HAS_NORMAL=1,i.add(this.normalMap,"NORMAL_MAP",function(){1!==t.normalMapScale&&(e.NORMAL_MAP_SCALE=1)})),i.add(this.parallaxMap,"PARALLAX_MAP"),i.add(this.emission,"EMISSION_MAP"),i.add(this.transparency,"TRANSPARENCY_MAP"),this.ignoreTranparent&&(e.IGNORE_TRANSPARENT=1),this.alphaCutoff>0&&(e.ALPHA_CUTOFF=1),this.useHDR&&(e.USE_HDR=1),this.gammaCorrection&&(e.GAMMA_CORRECTION=1),this.receiveShadows&&(e.RECEIVE_SHADOWS=1),this.castShadows&&(e.CAST_SHADOWS=1),this.uvMatrix&&(e.UV_MATRIX=1),this.uvMatrix1&&(e.UV_MATRIX1=1),this.usePhysicsLight&&(e.USE_PHYSICS_LIGHT=1),i.update(),e},_textureOption:{uvTypes:null,option:null,reset:function(t){return this.option=t,this.uvTypes={},this},add:function(t,e,n){if(t&&t.isTexture){var i=this.uvTypes,r=this.option,s=t.uv||0;i[s]=1,r[e]=s,t.isCubeTexture&&(r["".concat(e,"_CUBE")]=1),n&&n(t)}return this},update:function(){var t=[0,1],e=this.uvTypes,n=this.option;for(var i in e)-1!==t.indexOf(Number(i))?n["HAS_TEXCOORD".concat(i)]=1:(m.a.warnOnce("Material._textureOption.update(".concat(i,")"),"uv_".concat(i," not support!")),n.HAS_TEXCOORD0=1);return this}},getInstancedUniforms:function(){var t=this._instancedUniforms;if(!this._instancedUniforms){var e=this.uniforms;for(var n in t=this._instancedUniforms=[],e){var i=this.getUniformInfo(n);i.isDependMesh&&!i.notSupportInstanced&&t.push({name:n,info:i})}}return t},getUniformData:function(t,e,n){return this.getUniformInfo(t).get(e,this,n)},getAttributeData:function(t,e,n){return this.getAttributeInfo(t).get(e,this,n)},getUniformInfo:function(t){return this.getInfo("uniforms",t)},getAttributeInfo:function(t){return this.getInfo("attributes",t)},getInfo:function(t,e){var n=this[t][e];return"string"==typeof n&&(n=Ae[n]),n&&n.get||(m.a.warnOnce("material.getInfo-"+e,"Material.getInfo: no this semantic:"+e),n=be),n},clone:function(){var t=new this.constructor;for(var e in this)"id"!==e&&(t[e]=this[e]);return t},destroyTextures:function(t){for(var e in this){var n=this[e];n&&n.isTexture&&n.destroy(t)}}}),Ce=s.a.create({Extends:we,isBasicMaterial:!0,className:"BasicMaterial",lightType:"BLINN-PHONG",diffuse:null,ambient:null,specular:null,emission:null,specularEnvMap:null,specularEnvMatrix:null,reflectivity:0,refractRatio:0,refractivity:0,shininess:32,usedUniformVectors:11,constructor:function(t){this.diffuse=new v.a(.5,.5,.5),this.specular=new v.a(1,1,1),this.emission=new v.a(0,0,0),Ce.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT",u_shininess:"SHININESS",u_reflectivity:"REFLECTIVITY",u_refractRatio:"REFRACTRATIO",u_refractivity:"REFRACTIVITY",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvMatrix:"SPECULARENVMATRIX"}),this.addTextureUniforms({u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ce.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t),n=this.lightType;"PHONG"!==n&&"BLINN-PHONG"!==n||(t.HAS_SPECULAR=1);var i=this.diffuse;return i&&i.isTexture&&(i.isCubeTexture?t.DIFFUSE_CUBE_MAP=1:e.add(this.diffuse,"DIFFUSE_MAP")),t.HAS_LIGHT&&(e.add(this.specular,"SPECULAR_MAP"),e.add(this.ambient,"AMBIENT_MAP"),e.add(this.specularEnvMap,"SPECULAR_ENV_MAP")),e.update(),t}}),Pe=Ce,He=C.a.POSITION,De=C.a.NORMAL,Fe=C.a.DEPTH,Ue=C.a.DISTANCE,Ge=C.a.NONE,Be=s.a.create({Extends:Pe,isGeometryMaterial:!0,className:"GeometryMaterial",vertexType:He,lightType:Ge,writeOriginData:!1,constructor:function(t){Be.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_cameraFar:"CAMERAFAR",u_cameraNear:"CAMERANEAR",u_cameraType:"CAMERATYPE"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(Be.superclass.getRenderOption.call(this,t),t["VERTEX_TYPE_".concat(this.vertexType)]=1,this.vertexType){case He:t.HAS_FRAG_POS=1;break;case De:t.HAS_NORMAL=1;break;case Fe:break;case Ue:t.HAS_FRAG_POS=1}return this.writeOriginData&&(t.WRITE_ORIGIN_DATA=1),t}}),Ve=Be,Xe=s.a.create({Extends:O,isOrthographicCamera:!0,className:"OrthographicCamera",_left:-1,left:{get:function(){return this._left},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._left=t}},_right:1,right:{get:function(){return this._right},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._right=t}},_bottom:-1,bottom:{get:function(){return this._bottom},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._bottom=t}},_top:1,top:{get:function(){return this._top},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._top=t}},_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:1,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},constructor:function(t){Xe.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Z,n=[this.left,this.bottom,-this.near],i=[this.right,this.bottom,-this.near],r=[this.right,this.top,-this.near],s=[this.left,this.top,-this.near],a=[this.left,this.bottom,-this.far],o=[this.right,this.bottom,-this.far],u=[this.right,this.top,-this.far],c=[this.left,this.top,-this.far];e.addRect(a,o,u,c),e.addRect(o,i,r,u),e.addRect(i,n,s,r),e.addRect(n,a,c,s),e.addRect(c,u,r,s),e.addRect(n,i,o,a),this._geometry=e}return this._geometry}}),je=Xe,ke=C.a.DEPTH,ze=C.a.BACK,qe=null,Ye=new v.a(1,1,1),We=new o.a,Ze=s.a.create({isLightShadow:!0,className:"LightShadow",light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,cameraInfo:null,debug:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},createFramebuffer:function(){this.framebuffer||(this.framebuffer=new Yt(this.renderer,{width:this.width,height:this.height}),this.debug&&this.showShadowMap())},updateLightCamera:function(t){this.light.isDirectionalLight?this.updateDirectionalLightCamera(t):this.light.isSpotLight&&this.updateSpotLightCamera(t)},updateDirectionalLightCamera:function(t){var e=this.light;if(this.camera.lookAt(e.direction),this.cameraInfo)this.updateCustumCamera(this.cameraInfo);else{var n=t.getGeometry();if(n){this.camera.updateViewMatrix(),We.multiply(this.camera.viewMatrix,t.worldMatrix);var i=n.getBounds(We);this.camera.near=-i.zMax,this.camera.far=-i.zMin,this.camera.left=i.xMin,this.camera.right=i.xMax,this.camera.bottom=i.yMin,this.camera.top=i.yMax}}this.camera.updateViewMatrix()},updateCustumCamera:function(t){for(var e in t)this.camera[e]=t[e]},updateSpotLightCamera:function(t){var e=this.light;this.camera.lookAt(e.direction),this.cameraInfo?this.updateCustumCamera(this.cameraInfo):(this.camera.fov=2*e.outerCutoff,this.camera.near=.01,this.camera.far=t.far,this.camera.aspect=1),this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.light.isDirectionalLight?this.camera=new je:this.light.isSpotLight&&(this.camera=new Q),this.camera.addTo(this.light)),this._cameraMatrixVersion!==t.matrixVersion&&(this.updateLightCamera(t),this._cameraMatrixVersion=t.matrixVersion)},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,i=this.camera;qe||(qe=new Ve({vertexType:ke,side:ze,writeOriginData:!0})),n.bind(),e.state.viewport(0,0,this.width,this.height),e.clear(Ye),i.updateViewProjectionMatrix(),Ae.setCamera(i),e.forceMaterial=qe,this.renderShadowScene(e),delete e.forceMaterial,n.unbind(),Ae.setCamera(t),e.viewport()},renderShadowScene:function(t){t.renderList.traverse(function(e){t.renderMeshes(e.filter(function(t){return t.material.castShadows}))})},showShadowMap:function(){var t=this;this.renderer.on("afterRender",function(){t.framebuffer.render(0,.7,.3,.3)})}}),Ke=C.a.DISTANCE,Qe=C.a.BACK,Je=C.a.TEXTURE_CUBE_MAP,$e=C.a.TEXTURE0,tn=C.a.TEXTURE_CUBE_MAP_POSITIVE_X,en=C.a.TEXTURE_WRAP_S,nn=C.a.TEXTURE_WRAP_T,rn=C.a.CLAMP_TO_EDGE,sn=C.a.TEXTURE_MIN_FILTER,an=C.a.TEXTURE_MAG_FILTER,on=C.a.NEAREST,un=C.a.FRAMEBUFFER,cn=C.a.FRAMEBUFFER_COMPLETE,hn=null,fn=new v.a(0,0,0,0),ln=new c.a,dn=[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,-1,0,0,-1,0,0,0,1,0,0,-1,0,-1,0,0,-1,0]],mn=s.a.create({isLightShadow:!0,className:"CubeLightShadow",Extends:Ze,light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,debug:!1,constructor:function(t){mn.superclass.constructor.call(this,t)},createFramebuffer:function(){if(!this.framebuffer){this.framebuffer=new Yt(this.renderer,{target:Je,width:1024,height:1024,createTexture:function(){var t=this.state,e=t.gl,n=e.createTexture();t.activeTexture($e+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,n);for(var i=0;i<6;i++)e.texImage2D(tn+i,0,this.internalFormat,this.width,this.height,0,this.format,this.type,null);return e.texParameteri(this.target,en,rn),e.texParameteri(this.target,nn,rn),e.texParameteri(this.target,sn,on),e.texParameteri(this.target,an,on),e.checkFramebufferStatus(un)!==cn&&m.a.warn("Framebuffer is not complete",e.checkFramebufferStatus(un)),n},bindTexture:function(t){t=t||0;var e=this.state,n=e.gl;e.activeTexture($e+et.MAX_TEXTURE_INDEX),e.bindTexture(this.target,this.texture),n.framebufferTexture2D(un,this.attachment,tn+t,this.texture,0)}})}},updateLightCamera:function(t){this.camera.fov=90,this.camera.near=t.near,this.camera.far=t.far,this.camera.aspect=1,this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.camera=new Q,this.updateLightCamera(t))},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,i=this.camera;hn||(hn=new Ve({vertexType:Ke,side:Qe,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,n.width,n.height),this.light.worldMatrix.getTranslation(i.position);for(var r=0;r<6;r++)n.bindTexture(r),ln.fromArray(dn[0],3*r).add(i.position),i.up.fromArray(dn[1],3*r),i.lookAt(ln),i.updateViewProjectionMatrix(),e.clear(fn),Ae.setCamera(i),e.forceMaterial=hn,this.renderShadowScene(e);i.matrix.identity(),i.updateViewProjectionMatrix(),delete e.forceMaterial,n.unbind(),Ae.setCamera(t),e.viewport()},renderShadowScene:function(t){var e=this;t.renderList.traverse(function(n){t.renderMeshes(n.filter(function(t){if(t.material.castShadows){if(!t.frustumTest)return!0;if(e.camera.isMeshVisible(t))return!0}return!1}))})}}),_n=mn,pn=s.a.create({Extends:M,isPointLight:!0,className:"PointLight",constructor:function(t){pn.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new _n({light:this,renderer:t}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))}}),gn=pn,vn=new o.a,Tn=new c.a,En=s.a.create({Extends:M,isDirectionalLight:!0,className:"DirectionalLight",shadow:null,constructor:function(t){this.direction=new c.a(0,0,1),En.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new Ze({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return Tn.copy(this.direction).transformDirection(this.worldMatrix).normalize(),Tn},getViewDirection:function(t){var e=t.getModelViewMatrix(this,vn);return Tn.copy(this.direction).transformDirection(e).normalize(),Tn}}),Mn=En,An=new o.a,Ln=new c.a,In=s.a.create({Extends:M,isSpotLight:!0,className:"SpotLight",shadow:null,_cutoffCos:.9763,_cutoff:12.5,cutoff:{get:function(){return this._cutoff},set:function(t){this._cutoff=t,this._cutoffCos=Math.cos(d.a.degToRad(t))}},_outerCutoffCos:.9537,_outerCutoff:17.5,outerCutoff:{get:function(){return this._outerCutoff},set:function(t){this._outerCutoff=t,this._outerCutoffCos=Math.cos(d.a.degToRad(t))}},constructor:function(t){this.direction=new c.a(0,0,1),In.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new Ze({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return Ln.copy(this.direction).transformDirection(this.worldMatrix).normalize(),Ln},getViewDirection:function(t){var e=t.getModelViewMatrix(this,An);return Ln.copy(this.direction).transformDirection(e).normalize(),Ln}}),On=In,Sn=s.a.create({Extends:we,isShaderMaterial:!0,className:"ShaderMaterial",vs:"",fs:"",constructor:function(t){Sn.superclass.constructor.call(this,t)},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Sn.superclass.getRenderOption.call(this,t),this.getCustomRenderOption&&(t=this.getCustomRenderOption(t)),t},getCustomRenderOption:null}),Rn=Sn,yn=n(15),xn=n.n(yn),Nn={Geometry:Z,GeometryData:w},bn={_decodeTotalTime:0,wasmURL:"",workerURL:"",useWASM:!0,useWebWorker:!0,useAuto:!0,init:function(){return bn.useAuto?xn.a.initWASM(bn.wasmURL):bn.useWebWorker?xn.a.initWorker(bn.workerURL):bn.useWASM?xn.a.initWASM(bn.wasmURL):Promise.resolve()},parse:function(t,e,n,i){var r=Date.now(),s=e.bufferViews[t.bufferView],a=bn.wasmURL,o=bn.workerURL,u=bn.useAuto,c=bn.useWASM,h=bn.useWebWorker,f=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);function l(t){return bn._decodeTotalTime+=Date.now()-r,t.toHilo3dGeometry(Nn,i._geometry)}return u?xn.a.decompress(f,a,o).then(l):h?xn.a.decompressWithWorker(f,c,a,o).then(l):l(c?xn.a.decompressWithWASM(f,a):xn.a.decompressWithJS(f))}},wn=bn,Cn=C.a.SAMPLER_2D,Pn={unQuantizeData:function(t,e){if(!e)return t;var n=Math.sqrt(e.length),i=n-1,r=new Float32Array(t.length),s=[];return t.traverse(function(t,a){t.toArray?t.toArray(s):s[0]=t;for(var o=a*i,u=0;u0&&void 0!==arguments[0]?arguments[0]:{};return t["FOG_".concat(this.mode)]=1,t}}),jn=n(16),kn=new jn.a,zn=new o.a,qn=s.a.create({Extends:g,isMesh:!0,className:"Mesh",geometry:null,material:null,useInstanced:!0,frustumTest:!0,constructor:function(t){qn.superclass.constructor.call(this,t),this._usedResourceDict={}},clone:function(t){var e=g.prototype.clone.call(this,t);return Object.assign(e,{geometry:this.geometry,material:this.material}),e},raycast:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.visible)return null;var n=this.geometry,i=this.material,r=this.worldMatrix;if(n&&i){zn.invert(r),kn.copy(t),kn.transformMat4(zn);var s=n.raycast(kn,i.side,e);if(s)return s.forEach(function(t){t.transformMat4(r)}),s}return null},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.geometry.getRenderOption(t),t},useResource:function(t){t&&(this._usedResourceDict[t.className+":"+t.id]=t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._isDestroyed)return this;this.removeFromParent();var n=t.resourceManager,i=this._usedResourceDict;for(var r in i)n.destroyIfNoRef(i[r]);return this.material&&e&&this.material.destroyTextures(),this.off(),this._usedResourceDict=null,this.geometry=null,this.material=null,this._isDestroyed=!0,this}}),Yn=qn,Wn=new o.a,Zn=new o.a,Kn=s.a.create({Extends:Yn,isSkinedMesh:!0,className:"SkinedMesh",_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this.initJointNodeList()}},jointNodeList:null,useInstanced:!1,jointMatTexture:null,frustumTest:!1,constructor:function(t){this.jointNames=[],this.inverseBindMatrices=[],Kn.superclass.constructor.call(this,t)},initJointNodeList:function(){var t=this;if(this._rootNode){var e={};this._rootNode.traverse(function(t){"jointName"in t&&(e[t.jointName]=t)}),this.jointNodeList=[],this.jointNames.forEach(function(n){t.jointNodeList.push(e[n])})}},getJointMat:function(){var t=this;if(this.jointNodeList)return this.jointMat||(this.jointMat=new Float32Array(16*this.jointNodeList.length)),this._rootNode||!this.clonedFrom?Zn.invert(this.worldMatrix):Zn.invert(this.clonedFrom.worldMatrix),this.jointNodeList.forEach(function(e,n){Wn.copy(Zn),Wn.multiply(e.worldMatrix),Wn.multiply(t.inverseBindMatrices[n]),Wn.toArray(t.jointMat,16*n)}),this.jointMat},initJointMatTexture:function(){if(!this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture=new ce({data:t})}return this.jointMatTexture},updateJointMatTexture:function(){if(this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture.data.set(t,0),this.jointMatTexture.needUpdate=!0}else this.initJointMatTexture()},clone:function(t){var e=Yn.prototype.clone.call(this,t);return Object.assign(e,{useInstanced:this.useInstanced,jointNames:this.jointNames.slice(),inverseBindMatrices:this.inverseBindMatrices.map(function(t){return t.clone()}),jointNodeList:this.jointNodeList}),e.clonedFrom=this,e},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Kn.superclass.getRenderOption.call(this,t);var e=this.jointNames.length;e&&(t.JOINT_COUNT=e,et.VERTEX_TEXTURE_FLOAT&&e>(et.MAX_VERTEX_UNIFORM_VECTORS-22)/4&&(t.JOINT_MAT_MAP=1));return t}}),Qn=Kn,Jn=s.a.create({className:"RenderInfo",isRenderInfo:!0,constructor:function(){this.reset()},addFaceCount:function(t){this._currentFaceCount+=t},addDrawCount:function(t){this._currentDrawCount+=t},reset:function(){this.faceCount=Math.floor(this._currentFaceCount),this.drawCount=Math.floor(this._currentDrawCount),this._currentFaceCount=0,this._currentDrawCount=0}}),$n=new c.a,ti=s.a.create({className:"RenderList",isRenderList:!0,constructor:function(){this.dict={},this.transparentList=[]},reset:function(){this.dict={},this.transparentList.length=0},traverse:function(t){var e=this.dict;for(var n in e)t(e[n]);this.transparentList.forEach(function(e){t([e])})},addMesh:function(t,e){var n=t.material,i=t.geometry;if(n&&i){if(t.frustumTest&&!e.isMeshVisible(t))return;var s=n.id+"_"+i.id;if(t.instanceId=s,n.transparent)t.worldMatrix.getTranslation($n),$n.transformMat4(e.viewProjectionMatrix),t._sortRenderZ=$n.z,Object(r.insertToSortedArray)(this.transparentList,t,function(t,e){return e._sortRenderZ-t._sortRenderZ});else(this.dict[s]=this.dict[s]||[]).push(t)}else m.a.warnOnce("RenderList.addMesh(".concat(t.id,")"),"Mesh must have material and geometry",t)}}),ei=s.a.create({className:"WebGLState",isWebGLState:!0,systemFramebuffer:null,constructor:function(t){this.gl=t,this.reset()},reset:function(){this._dict={},this.activeTextureIndex=null,this.textureUnitDict={},this.currentFramebuffer=null,this.preFramebuffer=null,this._pixelStorei={}},enable:function(t){!0!==this._dict[t]&&(this._dict[t]=!0,this.gl.enable(t))},disable:function(t){!1!==this._dict[t]&&(this._dict[t]=!1,this.gl.disable(t))},bindFramebuffer:function(t,e){this.currentFramebuffer!==e&&(this.preFramebuffer=this.currentFramebuffer,this.currentFramebuffer=e,this.gl.bindFramebuffer(t,e))},bindSystemFramebuffer:function(){this.bindFramebuffer(this.gl.FRAMEBUFFER,this.systemFramebuffer)},useProgram:function(t){this.set1("useProgram",t)},depthFunc:function(t){this.set1("depthFunc",t)},depthMask:function(t){this.set1("depthMask",t)},clear:function(t){this.gl.clear(t)},depthRange:function(t,e){this.set2("depthRange",t,e)},stencilFunc:function(t,e,n){this.set3("stencilFunc",t,e,n)},stencilMask:function(t){this.set1("stencilMask",t)},stencilOp:function(t,e,n){this.set3("stencilOp",t,e,n)},colorMask:function(t,e,n,i){this.set4("colorMask",t,e,n,i)},cullFace:function(t){this.set1("cullFace",t)},frontFace:function(t){this.set1("frontFace",t)},blendFuncSeparate:function(t,e,n,i){this.set4("blendFuncSeparate",t,e,n,i)},blendEquationSeparate:function(t,e){this.set2("blendEquationSeparate",t,e)},pixelStorei:function(t,e){this._pixelStorei[t]!==e&&(this._pixelStorei[t]=e,this.gl.pixelStorei(t,e))},viewport:function(t,e,n,i){this.set4("viewport",t,e,n,i)},activeTexture:function(t){this.activeTextureIndex!==t&&(this.activeTextureIndex=t,this.gl.activeTexture(t))},bindTexture:function(t,e){var n=this.getActiveTextureUnit();n[t]!==e&&(n[t]=e,this.gl.bindTexture(t,e))},getActiveTextureUnit:function(){var t=this.textureUnitDict[this.activeTextureIndex];return t||(t=this.textureUnitDict[this.activeTextureIndex]={}),t},set1:function(t,e){this._dict[t]!==e&&(this._dict[t]=e,this.gl[t](e))},set2:function(t,e,n){var i=this._dict[t];i||(i=this._dict[t]=[]),i[0]===e&&i[1]===n||(i[0]=e,i[1]=n,this.gl[t](e,n))},set3:function(t,e,n,i){var r=this._dict[t];r||(r=this._dict[t]=[]),r[0]===e&&r[1]===n&&r[2]===i||(r[0]=e,r[1]=n,r[2]=i,this.gl[t](e,n,i))},set4:function(t,e,n,i,r){var s=this._dict[t];s||(s=this._dict[t]=[]),s[0]===e&&s[1]===n&&s[2]===i&&s[3]===r||(s[0]=e,s[1]=n,s[2]=i,s[3]=r,this.gl[t](e,n,i,r))},get:function(t){return this._dict[t]}}),ni=s.a.create({className:"WebGLResourceManager",isWebGLResourceManager:!0,hasNeedDestroyResource:!1,constructor:function(t){Object.assign(this,t)},useResource:function(t,e){if(t){var n=t.className+":"+t.id;this._usedResourceDict[n]||(this._usedResourceDict[n]=t,t.useResource&&t.useResource(this,e))}return e&&e.useResource(t),this},destroyIfNoRef:function(t){return this._needDestroyDict||(this._needDestroyDict={}),t&&(this.hasNeedDestroyResource=!0,this._needDestroyDict[t.className+":"+t.id]=t),this},destroyUnsuedResource:function(){if(!this.hasNeedDestroyResource)return this;var t=this._needDestroyDict,e=this._usedResourceDict;for(var n in t)if(!e[n]){var i=t[n];i&&i.destroy&&i.destroy()}return this._needDestroyDict={},this.hasNeedDestroyResource=!1,this},reset:function(){return this._usedResourceDict={},this}}),ii=new o.a,ri=new c.a,si=new Float32Array([0,0,0]),ai=s.a.create({isLightManager:!0,className:"LightManager",constructor:function(t){this.ambientLights=[],this.directionalLights=[],this.pointLights=[],this.spotLights=[],this.areaLights=[],this.lightInfo={AMBIENT_LIGHTS:0,POINT_LIGHTS:0,DIRECTIONAL_LIGHTS:0,SPOT_LIGHTS:0,AREA_LIGHTS:0,uid:0},Object.assign(this,t)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1;return Object(r.each)(this.lightInfo,function(i,r){if("uid"!==r&&i){e[r]=i,n=!0;var s=t.getShadowMapCount(r);s&&(e[r+"_SMC"]=s)}}),n&&(e.HAS_LIGHT=1),e},addLight:function(t){var e=null;return t.enabled?(t.isAmbientLight?e=this.ambientLights:t.isDirectionalLight?e=this.directionalLights:t.isPointLight?e=this.pointLights:t.isSpotLight?e=this.spotLights:t.isAreaLight?e=this.areaLights:m.a.warnOnce("LightManager.addLight(".concat(t.id,")"),"Not support this light:",t),e&&(t.shadow?e.unshift(t):e.push(t)),this):this},getDirectionalInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[];this.directionalLights.forEach(function(o,u){var c=3*u;o.getRealColor().toRGBArray(e,c),o.getViewDirection(t).toArray(n,c),o.shadow&&o.lightShadow&&(i.push(o.lightShadow.framebuffer.texture),r.push(o.lightShadow.width),r.push(o.lightShadow.height),a.push(o.lightShadow.minBias,o.lightShadow.maxBias),ii.copy(t.worldMatrix),ii.premultiply(o.lightShadow.camera.viewProjectionMatrix),ii.toArray(s,16*u))});var o={colors:new Float32Array(e),infos:new Float32Array(n)};return i.length&&(o.shadowMap=i,o.shadowMapSize=new Float32Array(r),o.shadowBias=new Float32Array(a),o.lightSpaceMatrix=new Float32Array(s)),o},getSpotInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[],o=[],u=[],c=[],h=[];this.spotLights.forEach(function(f,l){var d=3*l;f.getRealColor().toRGBArray(e,d),f.toInfoArray(n,d),f.getViewDirection(t).toArray(r,d),h.push(f.range),s.push(f._cutoffCos,f._outerCutoffCos),t.getModelViewMatrix(f,ii),ii.getTranslation(ri),ri.toArray(i,d),f.shadow&&f.lightShadow&&(a.push(f.lightShadow.framebuffer.texture),o.push(f.lightShadow.width),o.push(f.lightShadow.height),c.push(f.lightShadow.minBias,f.lightShadow.maxBias),ii.multiply(f.lightShadow.camera.viewProjectionMatrix,t.worldMatrix),ii.toArray(u,16*l))});var f={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(i),dirs:new Float32Array(r),cutoffs:new Float32Array(s),ranges:new Float32Array(h)};return a.length&&(f.shadowMap=a,f.shadowMapSize=new Float32Array(o),f.shadowBias=new Float32Array(c),f.lightSpaceMatrix=new Float32Array(u)),f},getPointInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[],o=[],u=[];this.pointLights.forEach(function(c,h){var f=3*h;c.getRealColor().toRGBArray(e,f),c.toInfoArray(n,f),u.push(c.range),t.getModelViewMatrix(c,ii),ii.getTranslation(ri),ri.toArray(i,f),c.shadow&&c.lightShadow&&(r.push(c.lightShadow.framebuffer.texture),a.push(c.lightShadow.minBias,c.lightShadow.maxBias),t.worldMatrix.toArray(s,16*h),o[2*h]=c.lightShadow.camera.near,o[2*h+1]=c.lightShadow.camera.far)});var c={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(i),ranges:new Float32Array(u)};return r.length&&(c.shadowMap=r,c.shadowBias=new Float32Array(a),c.lightSpaceMatrix=new Float32Array(s),c.cameras=new Float32Array(o)),c},getAreaInfo:function(t){var e,n,i=[],r=[],s=[],a=[];return this.areaLights.forEach(function(o,u){var c=3*u;o.getRealColor().toRGBArray(i,c),t.getModelViewMatrix(o,ii),ii.getTranslation(ri),ri.toArray(r,c);var h=ii.getRotation();ii.fromQuat(h),ri.set(.5*o.width,0,0),ri.transformMat4(ii),ri.toArray(s,c),ri.set(0,.5*o.height,0),ri.transformMat4(ii),ri.toArray(a,c),e=o.ltcTexture1,n=o.ltcTexture2}),{colors:new Float32Array(i),poses:new Float32Array(r),width:new Float32Array(s),height:new Float32Array(a),ltcTexture1:e,ltcTexture2:n}},getAmbientInfo:function(){return si[0]=si[1]=si[2]=0,this.ambientLights.forEach(function(t){var e=t.getRealColor();si[0]+=e.r,si[1]+=e.g,si[2]+=e.b}),si[0]=Math.min(1,si[0]),si[1]=Math.min(1,si[1]),si[2]=Math.min(1,si[2]),si},updateInfo:function(t){var e=this.lightInfo,n=this.ambientLights,i=this.directionalLights,r=this.pointLights,s=this.spotLights,a=this.areaLights;e.AMBIENT_LIGHTS=n.length,e.POINT_LIGHTS=r.length,e.DIRECTIONAL_LIGHTS=i.length,e.SPOT_LIGHTS=s.length,e.AREA_LIGHTS=a.length,e.uid=[e.AMBIENT_LIGHTS,e.POINT_LIGHTS,e.DIRECTIONAL_LIGHTS,e.SPOT_LIGHTS,e.AREA_LIGHTS].join("_"),this.directionalInfo=this.getDirectionalInfo(t),this.pointInfo=this.getPointInfo(t),this.spotInfo=this.getSpotInfo(t),this.areaInfo=this.getAreaInfo(t),this.ambientInfo=this.getAmbientInfo()},getInfo:function(){return this.lightInfo},reset:function(){this.ambientLights.length=0,this.directionalLights.length=0,this.pointLights.length=0,this.spotLights.length=0,this.areaLights.length=0},getShadowMapCount:function(t){var e=[];"POINT_LIGHTS"===t?e=this.pointLights:"DIRECTIONAL_LIGHTS"===t?e=this.directionalLights:"SPOT_LIGHTS"===t?e=this.spotLights:"AREA_LIGHTS"===t&&(e=this.spotLights);var n=0;return e.forEach(function(t){n+=t.shadow?1:0}),n},createShadowMap:function(t,e){this.directionalLights.forEach(function(n){n.createShadowMap(t,e)}),this.spotLights.forEach(function(n){n.createShadowMap(t,e)}),this.pointLights.forEach(function(n){n.createShadowMap(t,e)}),this.areaLights.forEach(function(n){n.createShadowMap(t,e)})}}),oi=C.a.DEPTH_TEST,ui=C.a.SAMPLE_ALPHA_TO_COVERAGE,ci=C.a.CULL_FACE,hi=C.a.FRONT_AND_BACK,fi=C.a.BLEND,li=C.a.LINES,di=C.a.STATIC_DRAW,mi=C.a.DYNAMIC_DRAW,_i=s.a.create({Mixes:a.a,className:"WebGLRenderer",isWebGLRenderer:!0,gl:null,width:0,height:0,pixelRatio:1,domElement:null,useInstanced:!1,useVao:!0,alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!1,useFramebuffer:!1,framebufferOption:{},useLogDepth:!1,vertexPrecision:"highp",fragmentPrecision:"highp",fog:null,offsetX:0,offsetY:0,_isInit:!1,_isContextLost:!1,constructor:function(t){this.clearColor=new v.a(1,1,1),this.renderInfo=new Jn,this.renderList=new ti,this.lightManager=new ai,this.resourceManager=new ni,Object.assign(this,t)},resize:function(t,e,n){if(n||this.width!==t||this.height!==e){var i=this.domElement;this.width=t,this.height=e,i.width=t,i.height=e,this.framebuffer&&this.framebuffer.resize(this.width,this.height,n),this.viewport()}},setOffset:function(t,e){this.offsetX===t&&this.offsetY===e||(this.offsetX=t,this.offsetY=e,this.viewport())},viewport:function(t,e,n,i){var r=this.state,s=this.gl;r&&(void 0===t?t=this.offsetX:this.offsetX=t,void 0===e?e=this.offsetY:this.offsetY=e,void 0===n&&(n=s.drawingBufferWidth),void 0===i&&(i=s.drawingBufferHeight),r.viewport(t,e,n,i))},isInit:{get:function(){return this._isInit}},onInit:function(t){var e=this;this._isInit?t(this):this.on("init",function(){t(e)},!0)},initContext:function(){var t=this;if(!this._isInit){this._isInit=!0;var e=this.gl=this.domElement.getContext("webgl",{alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat});e.viewport(0,0,this.width,this.height),Tt.init(e),tt.init(e),et.init(e),lt.init(this),this.state=new ei(e),tt.instanced||(this.useInstanced=!1),tt.vao||(this.useVao=!1),this.useFramebuffer&&(this.framebuffer=new Yt(this,Object.assign({useVao:this.useVao,width:this.width,height:this.height},this.framebufferOption))),this.domElement.addEventListener("webglcontextlost",function(e){t._onContextLost(e)},!1),this.domElement.addEventListener("webglcontextrestored",function(e){t._onContextRestore(e)},!1),this.fire("init")}},_onContextLost:function(t){var e=this.gl;this._isContextLost=!0,t.preventDefault(),At.reset(e),lt.reset(e),ne.reset(e),yt.reset(e),Dt.reset(e),this.state.reset(e),this._lastMaterial=null,this._lastProgram=null},_onContextRestore:function(t){var e=this.gl;this._isContextLost=!1,tt.reset(e),Yt.reset(e)},setupDepthTest:function(t){var e=this.state;t.depthTest?(e.enable(oi),e.depthFunc(t.depthFunc),e.depthMask(t.depthMask),e.depthRange(t.depthRange[0],t.depthRange[1])):e.disable(oi)},setupSampleAlphaToCoverage:function(t){var e=this.state;t.sampleAlphaToCoverage?e.enable(ui):e.disable(ui)},setupCullFace:function(t){var e=this.state;t.cullFace&&t.cullFaceType!==hi?(e.enable(ci),e.cullFace(t.cullFaceType)):e.disable(ci)},setupBlend:function(t){var e=this.state;t.blend?(e.enable(fi),e.blendFuncSeparate(t.blendSrc,t.blendDst,t.blendSrcAlpha,t.blendDstAlpha),e.blendEquationSeparate(t.blendEquation,t.blendEquationAlpha)):e.disable(fi)},setupUniforms:function(t,e,n,i){var r=this.forceMaterial||e.material;for(var s in t.uniforms){var a=r.getUniformInfo(s),o=t.uniforms[s];if(!a.isBlankInfo&&(i||a.isDependMesh&&!n)){var u=a.get(e,r,o);null!=u&&(t[s]=u)}}},setupVao:function(t,e,n){var i=n.geometry,r=i.isStatic;if(t.isDirty||!r||i.isDirty){t.isDirty=!1;var s=this.forceMaterial||n.material,a=s.attributes,o=r?di:mi;for(var u in a){var c=e.attributes[u];if(c){var h=s.getAttributeData(u,n,c);null!=h&&t.addAttribute(h,c,o)}}i.indices&&t.addIndexBuffer(i.indices,o),i.isDirty=!1}i.vertexCount&&(t.vertexCount=i.vertexCount)},setupMaterial:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this.forceMaterial||e.material;(r.isDirty||this._lastMaterial!==r)&&(this.setupDepthTest(r),this.setupSampleAlphaToCoverage(r),this.setupCullFace(r),this.setupBlend(r),i=!0),this.setupUniforms(t,e,n,i),r.isDirty=!1,this._lastMaterial=r},setupMesh:function(t,e){var n=this.gl,i=this.state,r=this.lightManager,s=this.resourceManager,a=t.geometry,o=this.forceMaterial||t.material,u=lt.getShader(t,o,e,r,this.fog,this.useLogDepth),c=At.getProgram(u,i);c.useProgram(),this.setupMaterial(c,t,e,this._lastProgram!==c),this._lastProgram=c,t.material.wireframe&&a.mode!==li&&a.convertToLinesMode();var h=a.id+c.id,f=Dt.getVao(n,h,{useInstanced:e,useVao:this.useVao,mode:a.mode});return this.setupVao(f,c,t),s.useResource(f,t).useResource(u,t).useResource(c,t),{vao:f,program:c,geometry:a}},addRenderInfo:function(t,e){var n=this.renderInfo;n.addFaceCount(t),n.addDrawCount(e)},renderMeshes:function(t){if(t.length){var e=t[0],n=this.forceMaterial||e.material;this.useInstanced&&e.useInstanced&&t.length>1?this.renderInstancedMeshes(e,t,n):this.renderMultipleMeshes(t)}},render:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.initContext(),!this._isContextLost){var i=this.renderList,r=this.renderInfo,s=this.lightManager,a=this.resourceManager,o=this.state;this.fog=t.fog,s.reset(),r.reset(),i.reset(),a.reset(),Ae.init(o,e,s,this.fog),t.updateMatrixWorld(),e.updateViewProjectionMatrix(),t.traverse(function(t){return t.visible?(t.isMesh?i.addMesh(t,e):t.isLight&&s.addLight(t),g.TRAVERSE_STOP_NONE):g.TRAVERSE_STOP_CHILDREN}),s.createShadowMap(this,e),s.updateInfo(e),n&&this.fire("beforeRender"),this.useFramebuffer&&this.framebuffer.bind(),this.clear(),n&&this.fire("beforeRenderScene"),this.renderScene(),this.useFramebuffer&&this.renderToScreen(this.framebuffer),n&&this.fire("afterRender"),a.destroyUnsuedResource()}},renderScene:function(){var t=this;this.renderList.traverse(function(e){t.renderMeshes(e)})},clear:function(t){var e=this.gl,n=this.state;t=t||this.clearColor,n.depthMask(!0),this._lastMaterial=null,this._lastProgram=null,e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)},clearDepth:function(){var t=this.gl;this.state.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},renderToScreen:function(t){this.state.bindSystemFramebuffer(),t.render(0,0,1,1,this.clearColor)},renderMesh:function(t){var e=this.setupMesh(t,!1).vao;e.draw(),this.addRenderInfo(e.vertexCount/3,1)},renderInstancedMeshes:function(t,e,n){var i=this.setupMesh(t,!0),r=i.vao,s=i.program;n.getInstancedUniforms().forEach(function(t){var n=t.name,i=t.info,a=s.attributes[n];a&&r.addInstancedAttribute(a,e,function(t){return i.get(t)})}),r.drawInstance(e.length),this.addRenderInfo(r.vertexCount/3*e.length,1)},renderMultipleMeshes:function(t){var e=this;t.forEach(function(t){e.renderMesh(t)})},releaseGLResource:function(){var t=this.gl;t&&(At.reset(t),lt.reset(t),yt.reset(t),Dt.reset(t),this.state.reset(t),ne.reset(t),Yt.destroy(t))}}),pi=n(62),gi=n.n(pi).a,vi=s.a.create({Extends:g,isStage:!0,className:"Stage",renderer:null,camera:null,pixelRatio:null,offsetX:0,offsetY:0,constructor:function(t){if(t.width||(t.width=window.innerWidth),t.height||(t.height=window.innerHeight),!t.pixelRatio){var e=window.devicePixelRatio||1;e=Math.min(e,1024/Math.max(t.width,t.height),2),e=Math.max(e,1),t.pixelRatio=e}vi.superclass.constructor.call(this,t),this.initRenderer(t),m.a.log("Hilo3d version: ".concat("1.11.17"))},initRenderer:function(t){var e=this.canvas=this.createCanvas(t);this.renderer=new _i(Object.assign(t,{domElement:e})),this.resize(this.width,this.height,this.pixelRatio,!0)},createCanvas:function(t){var e;return e=t.canvas?t.canvas:document.createElement("canvas"),t.container&&t.container.appendChild(e),e},resize:function(t,e,n,i){if(void 0===n&&(n=this.pixelRatio),i||this.width!==t||this.height!==e||this.pixelRatio!==n){this.width=t,this.height=e,this.pixelRatio=n,this.rendererWidth=t*n,this.rendererHeight=e*n;var r=this.canvas;this.renderer.resize(this.rendererWidth,this.rendererHeight,i),r.style.width=this.width+"px",r.style.height=this.height+"px",this.updateDomViewport()}return this},setOffset:function(t,e){if(this.offsetX!==t||this.offsetY!==e){this.offsetX=t,this.offsetY=e;var n=this.pixelRatio;this.renderer.setOffset(t*n,e*n)}return this},viewport:function(t,e,n,i){return this.resize(n,i,this.pixelRatio,!0),this.setOffset(t,e),this},tick:function(t){return this.traverseUpdate(t),this.camera&&this.renderer.render(this,this.camera,!0),this},enableDOMEvent:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.canvas,r=this._domListener||(this._domListener=function(t){e._onDOMEvent(t)});return(t="string"==typeof t?[t]:t).forEach(function(t){n?i.addEventListener(t,r,!1):i.removeEventListener(t,r)}),this},_onDOMEvent:function(t){var e=this.canvas,n=this._eventTarget,i=t.type,r=0===i.indexOf("touch"),s=t;if(r){var a=t.touches,o=t.changedTouches;a&&a.length?s=a[0]:o&&o.length&&(s=o[0])}var u=this.domViewport||this.updateDomViewport(),c=(s.pageX||s.clientX)-u.left,h=(s.pageY||s.clientY)-u.top;t.stageX=c,t.stageY=h,t.stopPropagation=function(){this._stopPropagationed=!0};var f=this.getMeshResultAtPoint(c,h,!0),l=f.mesh;t.hitPoint=f.point;var d="mouseout"===i;if(n&&(n!==l&&(!n.contains||!n.contains(l))||d)){var m=!1;if("touchmove"===i?m="touchout":"mousemove"!==i&&!d&&l||(m="mouseout"),m){var _=Object.assign({},t);_.type=m,_.eventTarget=n,n._fireMouseEvent(_)}t.lastEventTarget=n,this._eventTarget=null}if(l&&l.pointerEnabled&&"mouseout"!==i&&(t.eventTarget=this._eventTarget=l,l._fireMouseEvent(t)),!r){var p=l&&l.pointerEnabled&&l.useHandCursor?"pointer":"";e.style.cursor=p}gi.android&&"touchmove"===i&&t.preventDefault()},updateDomViewport:function(){var t=this.canvas,e=null;return t.parentNode&&(e=this.domViewport=Object(r.getElementRect)(t)),e},getMeshResultAtPoint:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.camera,r=this._ray;r||(r=this._ray=new jn.a),r.fromCamera(i,t,e,this.width,this.height);var s=this.raycast(r,!0,n);if(s)return s[0];this._stageResultAtPoint||(this._stageResultAtPoint={mesh:this,point:new c.a});var a=this._stageResultAtPoint.point;return a.copy(i.unprojectVector(a.set(t,e,0),this.width,this.height)),this._stageResultAtPoint},releaseGLResource:function(){return this.renderer.releaseGLResource(),this},destroy:function(){return this.releaseGLResource(),this.traverse(function(t){t.off(),t.parent=null}),this.children.length=0,this.renderer.off(),this}}),Ti=vi,Ei=n(63),Mi=n.n(Ei),Ai=n(106),Li=n.n(Ai);Mi.a.Ease=Li.a;var Ii=Mi.a,Oi=s.a.create({Extends:Z,isBoxGeometry:!0,className:"BoxGeometry",width:1,height:1,depth:1,widthSegments:1,heightSegments:1,depthSegments:1,constructor:function(t){Oi.superclass.constructor.call(this,t),this.isSegments()?this.buildWithSegments():this.build()},buildWithSegments:function(){var t=this.width,e=this.height,n=this.depth,i=this.widthSegments,r=this.heightSegments,s=this.depthSegments,a=r*s*6,o=i*s*6,u=i*r*6,c=2*((r+1)*(s+1)+(i+1)*(s+1)+(i+1)*(r+1)),h=new Float32Array(3*c),f=new Float32Array(3*c),l=new Float32Array(2*c),d=new Uint16Array(2*(a+o+u));this.vertices=new w(h,3),this.normals=new w(f,3),this.uvs=new w(l,2),this.indices=new w(d,1);var m=[0,0];this.buildPlane(m,2,1,0,-1,1,n,e,t/2,s,r),this.buildPlane(m,2,1,0,1,1,n,e,-t/2,s,r),this.buildPlane(m,0,2,1,1,-1,t,n,e/2,i,s),this.buildPlane(m,0,2,1,1,1,t,n,-e/2,i,s),this.buildPlane(m,0,1,2,1,1,t,e,n/2,i,r),this.buildPlane(m,0,1,2,-1,1,t,e,-n/2,i,r)},buildPlane:function(t,e,n,i,r,s,a,o,u,c,h){for(var f=a/c,l=o/h,d=a/2,m=o/2,_=t[0],p=t[1],g=this.vertices.data,v=this.normals.data,T=this.uvs.data,E=this.indices.data,M=0;M<=h;M++)for(var A=(M*l-m)*s,L=0;L<=c;L++){if(g[3*_+e]=(L*f-d)*r,g[3*_+n]=A,g[3*_+i]=u,v[3*_+e]=0,v[3*_+n]=0,v[3*_+i]=u<0?-1:1,T[2*_]=L/c,T[2*_+1]=1-M/h,L1||this.heightSegments>1||this.depthSegments>1},setFrontUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setFrontUV!"):this.setVertexUV(32,t)},setRightUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setRightUV!"):this.setVertexUV(0,t)},setBackUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBackUV!"):this.setVertexUV(40,t)},setLeftUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setLeftUV!"):this.setVertexUV(8,t)},setTopUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setTopUV!"):this.setVertexUV(16,t)},setBottomUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBottomUV!"):this.setVertexUV(24,t)},setAllRectUV:function(t){if(this.isSegments())return m.a.warn("segmented BoxGeometry dont support setAllRectUV!"),null;for(var e=0;e<6;e++)this.setVertexUV(8*e,t);return this},_raycast:function(t,e){return Oi.superclass._raycast.call(this,t,e)}}),Si=Oi,Ri=s.a.create({Extends:Z,isMorphGeometry:!0,className:"MorphGeometry",isStatic:!1,weights:[],targets:null,constructor:function(t){Ri.superclass.constructor.call(this,t),this.weights=this.weights||[]},update:function(t,e){this.weights=t,this._originalMorphIndices=e},clone:function(){return Z.prototype.clone.call(this,{targets:this.targets,weights:this.weights})},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ri.superclass.getRenderOption.call(this,e),this.targets&&(this._maxMorphTargetCount||(this._maxMorphTargetCount=Math.floor(8/Object.keys(this.targets).length)),Object(r.each)(this.targets,function(n,i){e.MORPH_TARGET_COUNT=Math.min(n.length,t._maxMorphTargetCount),"vertices"===i?e.MORPH_HAS_POSITION=1:"normals"===i?e.MORPH_HAS_NORMAL=1:"tangents"===i&&(e.MORPH_HAS_TANGENT=1)})),e}}),yi=Ri,xi=C.a.FRONT,Ni=C.a.BACK,bi=[0,0,1],wi=s.a.create({Extends:Z,isPlaneGeometry:!0,className:"PlaneGeometry",width:1,height:1,widthSegments:1,heightSegments:1,constructor:function(t){wi.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.widthSegments,e=this.heightSegments,n=(t+1)*(e+1),i=this.width/t,r=this.height/e,s=new Float32Array(3*n),a=new Float32Array(3*n),o=new Float32Array(2*n),u=new Uint16Array(t*e*6),c=0,h=0;h<=e;h++)for(var f=0;f<=t;f++){var l=h*(t+1)+f;if(s[3*l]=f*i-this.width/2,s[3*l+1]=this.height/2-h*r,a[3*l]=0,a[3*l+1]=0,a[3*l+2]=1,o[2*l]=f/t,o[2*l+1]=1-h/e,h0||n<0))return null;if(e===Ni&&(i<0||n>0))return null;var r=t.intersectsPlane(bi,0);if(r){var s=r.x,a=r.y,o=.5*this.width,u=.5*this.height;if(s>=-o&&s<=o&&a>=-u&&a<=u)return[r]}return null}}),Ci=wi,Pi=s.a.create({Extends:Z,isSphereGeometry:!0,className:"SphereGeometry",radius:1,heightSegments:16,widthSegments:32,constructor:function(t){Pi.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.radius,e=this.heightSegments,n=this.widthSegments,i=(n+1)*(e+1),r=n*e,s=new Float32Array(3*i),a=new Float32Array(4*i),o=new Float32Array(2*i),u=new Uint16Array(6*r),c=0,h=0,f=0,l=0,d=0,m=2*Math.PI,_=Math.PI,p=0;p<=e;p++)for(var g=p/e,v=_*g,T=Math.cos(v)*t,E=Math.sin(v)*t,M=0;M<=n;M++){var A=M/n,L=m*A,I=Math.cos(L),O=Math.sin(L),S=I*E,R=O*E,y=O,x=-I;if(a[f++]=y,a[f++]=0,a[f++]=x,a[f++]=1,s[h++]=S,s[h++]=T,s[h++]=R,o[l++]=A,o[l++]=g,p>0&&M>0){var N=d,b=N-1,C=b-n-1,P=N-n-1;u[c++]=C,u[c++]=P,u[c++]=N,u[c++]=C,u[c++]=N,u[c++]=b}d++}this.vertices=new w(s,3),this.indices=new w(u,1),this.uvs=new w(o,2),this.tangents=new w(a,4),this.normals=new w(new Float32Array(s),3)},_raycast:function(t,e){return Pi.superclass._raycast.call(this,t,e)}}),Hi=Pi,Di=s.a.create({Mixes:a.a,isLoadCache:!0,className:"LoadCache",Statics:{PENDING:1,LOADED:2,FAILED:3},enabled:!0,constructor:function(){this._files={}},update:function(t,e,n){if(this.enabled){var i={key:t,state:e,data:n};this._files[t]=i,this.fire("update",i),this.fire("update:".concat(i.key),i)}},get:function(t){return this.enabled?this._files[t]:null},remove:function(t){delete this._files[t]},clear:function(){this._files={}},wait:function(t){var e=this;return t?t.state===Di.LOADED?Promise.resolve(t.data):t.state===Di.FAILED?Promise.reject():new Promise(function(n,i){e.on("update:".concat(t.key),function(t){var e=t.detail;e.state===Di.LOADED?n(e.data):e.state===Di.FAILED&&i(e.data)},!0)}):Promise.reject()}}),Fi=Di,Ui=new Fi,Gi=s.a.create({Mixes:a.a,isBasicLoader:!0,className:"BasicLoader",Statics:{_cache:Ui,enalbeCache:function(){Ui.enabled=!0},disableCache:function(){Ui.enabled=!1},deleteCache:function(t){Ui.remove(t)},clearCache:function(){Ui.clear()},cache:{get:function(){return Ui},set:function(){m.a.warn("BasicLoader.cache is readonly!")}}},load:function(t){var e=t.src,n=t.type;if(!n){var i=Object(r.getExtension)(e);/^(?:png|jpe?g|gif|webp|bmp)$/i.test(i)&&(n="img"),n||(n=t.defaultType)}return"img"===n?this.loadImg(e,t.crossOrigin):this.loadRes(e,n)},isCrossOrigin:function(t){var e=window.location,n=document.createElement("a");return n.href=t,n.hostname!==e.hostname||n.port!==e.port||n.protocol!==e.protocol},loadImg:function(t,e){var n=this,i=Ui.get(t);return i?Ui.wait(i):new Promise(function(i,r){var s=new Image;Ui.update(t,Fi.PENDING),s.onload=function(){s.onerror=null,s.onabort=null,s.onload=null,Ui.update(t,Fi.LOADED,s),i(s)},s.onerror=function(){s.onerror=null,s.onabort=null,s.onload=null;var e=new Error("Image load failed for ".concat(t.slice(0,100)));Ui.update(t,Fi.FAILED,e),r(e)},s.onabort=s.onerror,(e||n.isCrossOrigin(t))&&(s.crossOrigin="anonymous"),s.src=t})},loadRes:function(t,e){var n=this;if(/^data:(.+?);base64,/.test(t)){var i=RegExp.$1,r=t.slice(13+i.length),s=atob(r);return"json"===e?s=JSON.parse(s):"buffer"===e&&(s=Uint8Array.from(s,function(t){return t.charCodeAt(0)}).buffer),Promise.resolve(s)}var a=Ui.get(t);return a?Ui.wait(a):(Ui.update(t,Fi.PENDING),this.fire("beforeload"),this.request({url:t,type:e}).then(function(e){return n.fire("loaded"),Ui.update(t,Fi.LOADED,e),e},function(e){throw n.fire("failed",e),Ui.update(t,Fi.FAILED),new Error("Resource load failed for ".concat(t,", ").concat(e))}))},request:function(t){var e=this;return new Promise(function(n,i){var s=new XMLHttpRequest;s.onload=function(){if(s.status<200||s.status>=300)i(new TypeError("Network request failed for ".concat(s.status)));else{var e="response"in s?s.response:s.responseText;if("json"===t.type)try{e=JSON.parse(e)}catch(t){return void i(new TypeError("JSON.parse error"+t))}n(e)}},s.onprogress=function(n){e.fire("progress",{url:t.url,loaded:n.loaded,total:n.total})},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request timed out"))},s.open(t.method||"GET",t.url,!0),"include"===t.credentials&&(s.withCredentials=!0),"buffer"===t.type&&(s.responseType="arraybuffer"),Object(r.each)(t.headers,function(t,e){s.setRequestHeader(e,t)}),s.send(t.body||null)})}}),Bi=C.a.TEXTURE_CUBE_MAP,Vi=C.a.RGB,Xi=C.a.LINEAR,ji=C.a.CLAMP_TO_EDGE,ki=C.a.TEXTURE_CUBE_MAP_POSITIVE_X,zi=s.a.create({Extends:ne,isCubeTexture:!0,className:"CubeTexture",target:Bi,internalFormat:Vi,format:Vi,magFilter:Xi,minFilter:Xi,wrapS:ji,wrapT:ji,constructor:function(t){zi.superclass.constructor.call(this,t),this.image=this.image||[]},_uploadTexture:function(t){var e=this;Array.isArray(this.image)&&6===this.image.length?this.image.forEach(function(n,i){e._glUploadTexture(t,ki+i,n,0)}):m.a.error("CubeTexture image must be an Array of length 6",this.image)},right:{get:function(){return this.image[0]},set:function(t){this.image[0]=t}},left:{get:function(){return this.image[1]},set:function(t){this.image[1]=t}},top:{get:function(){return this.image[2]},set:function(t){this.image[2]=t}},bottom:{get:function(){return this.image[3]},set:function(t){this.image[3]=t}},front:{get:function(){return this.image[4]},set:function(t){this.image[4]=t}},back:{get:function(){return this.image[5]},set:function(t){this.image[5]=t}}}),qi=zi,Yi=s.a.create({isLoader:!0,className:"Loader",maxConnections:2,Statics:{_loaderClassMap:{},_loaders:{},addLoader:function(t,e){Yi._loaderClassMap[t]=e},getLoader:function(t){if(!Yi._loaders[t]){var e=Yi._loaderClassMap[t]?Yi._loaderClassMap[t]:Gi;Yi._loaders[t]=new e}return Yi._loaders[t]}},load:function(t){var e=this;if(t instanceof Array)return Promise.all(t.map(function(t){return e.load(t)}));var n=t.type||Object(r.getExtension)(t.src);return Yi.getLoader(n).load(t)}}),Wi=Yi,Zi=s.a.create({Extends:Gi,isCubeTextureLoader:!0,className:"CubeTextureLoader",constructor:function(){Zi.superclass.constructor.call(this)},load:function(t){var e,n=this;return e=t.images&&Array.isArray(t.images)?t.images:[t.right,t.left,t.top,t.bottom,t.front,t.back],Promise.all(e.map(function(e){return n.loadImg(e,t.crossOrigin)})).then(function(e){var n=Object.assign({},t);return delete n.images,delete n.type,delete n.right,delete n.left,delete n.top,delete n.bottom,delete n.front,delete n.back,n.image=e,new qi(n)}).catch(function(t){throw m.a.error("load CubeTexture failed",t.message,t.stack),t})}});Wi.addLoader("CubeTexture",Zi);var Ki=Zi,Qi=s.a.create({Extends:we,isPBRMaterial:!0,className:"PBRMaterial",lightType:"PBR",gammaCorrection:!0,usePhysicsLight:!0,baseColor:null,baseColorMap:null,metallic:1,metallicMap:null,roughness:1,roughnessMap:null,metallicRoughnessMap:null,occlusionMap:null,occlusionStrength:1,isOcclusionInMetallicRoughnessMap:!1,diffuseEnvMap:null,brdfLUT:null,specularEnvMap:null,emission:null,isSpecularGlossiness:!1,specular:null,glossiness:1,specularGlossinessMap:null,usedUniformVectors:11,constructor:function(t){this.baseColor=new v.a(1,1,1),this.specular=new v.a(1,1,1),Qi.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_baseColor:"BASECOLOR",u_metallic:"METALLIC",u_roughness:"ROUGHNESS",u_specular:"SPECULAR",u_glossiness:"GLOSSINESS",u_brdfLUT:"BRDFLUT",u_specularEnvMap:"SPECULARENVMAP",u_diffuseEnvMap:"DIFFUSEENVMAP",u_occlusionStrength:"OCCLUSIONSTRENGTH"}),this.addTextureUniforms({u_baseColorMap:"BASECOLORMAP",u_metallicMap:"METALLICMAP",u_roughnessMap:"ROUGHNESSMAP",u_metallicRoughnessMap:"METALLICROUGHNESSMAP",u_occlusionMap:"OCCLUSIONMAP",u_specularGlossinessMap:"SPECULARGLOSSINESSMAP",u_lightMap:"LIGHTMAP"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Qi.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t);return e.add(this.baseColorMap,"BASE_COLOR_MAP"),e.add(this.metallicMap,"METALLIC_MAP"),e.add(this.roughnessMap,"ROUGHNESS_MAP"),e.add(this.metallicRoughnessMap,"METALLIC_ROUGHNESS_MAP"),e.add(this.diffuseEnvMap,"DIFFUSE_ENV_MAP"),e.add(this.occlusionMap,"OCCLUSION_MAP"),e.add(this.lightMap,"LIGHT_MAP"),this.brdfLUT&&(e.add(this.specularEnvMap,"SPECULAR_ENV_MAP"),et.SHADER_TEXTURE_LOD&&this.specularEnvMap&&(t.USE_SHADER_TEXTURE_LOD=1)),this.isSpecularGlossiness&&(t.PBR_SPECULAR_GLOSSINESS=1,e.add(this.specularGlossinessMap,"SPECULAR_GLOSSINESS_MAP")),this.isOcclusionInMetallicRoughnessMap&&(t.IS_OCCLUSION_MAP_IN_METALLIC_ROUGHNESS_MAP=1),1!==this.occlusionStrength&&(t.OCCLUSION_STRENGTH=1),e.update(),t}}),Ji=Qi,$i=new Image;$i.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";var tr=s.a.create({Extends:ne,Mixes:a.a,isLazyTexture:!0,className:"LazyTexture",_src:"",crossOrigin:!1,autoLoad:!0,src:{get:function(){return this._src},set:function(t){this._src!==t&&(this._src=t,this.autoLoad&&this.load())}},constructor:function(t){t&&("crossOrigin"in t&&(this.crossOrigin=t.crossOrigin),"autoLoad"in t&&(this.autoLoad=t.autoLoad)),tr.superclass.constructor.call(this,t),this.image=this.placeHolder||$i},load:function(t){var e=this;return tr.loader=tr.loader||new Wi,tr.loader.load({src:this.src,crossOrigin:this.crossOrigin,defaultType:"img"}).then(function(t){t.isTexture?(Object.assign(e,t),e.needUpdate=!0,e.needDestory=!0,e.fire("load")):(e.image=t,e.needUpdate=!0,e.fire("load"))},function(n){if(e.fire("error"),t)throw new Error("LazyTexture Failed ".concat(n));m.a.warn("LazyTexture Failed ".concat(n))})}}),er=tr,nr=n(13);function ir(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var rr=new l.a,sr=new l.a,ar=new l.a,or=new l.a,ur=new l.a,cr=new l.a,hr=new nr.a,fr=[];function lr(t,e){return t-e}var dr=s.a.create({Statics:{interpolation:{LINEAR:function(t,e,n){if(void 0===e)return t;if(t.slerp)return t.slerp(e,n);if(t.lerp)return t.lerp(e,n);if(Object(r.isArrayLike)(t)){fr.length=0;for(var i=t.length-1;i>=0;i--)fr[i]=t[i]+n*(e[i]-t[i]);return fr}return t+n*(e-t)},STEP:function(t,e,n){return t},CUBICSPLINE:function(t,e,n,i){var s=t.length/3;if(void 0===e)return 1===s?t[1]:t.slice(s,-s);var a=t[1],o=t[2],u=e[1],c=e[0];if(s>1&&(a=t.slice(s,-s),o=t.slice(-s),u=e.slice(s,-s),c=e.slice(0,s)),a.hermite)a.hermite(a,o.scale(i),u,c.scale(i),n);else if(a.sqlerp)a.sqlerp(a,o.scale(i),u,c.scale(i),n);else{Object(r.isArrayLike)(a)||(a=[a],o=[o],u=[u],c=[c]);var h=n*n,f=h*n,l=2*f-3*h+1,d=f-2*h+n,m=-2*f+3*h,_=f-h;fr.length=0;for(var p=a.length-1;p>=0;p--)fr[p]=a[p]*l+d*o[p]*i+u[p]*m+_*c[p]*i;a=fr}return a}},StateType:{TRANSLATE:"Translation",POSITION:"Translation",TRANSLATION:"Translation",SCALE:"Scale",ROTATE:"Rotation",ROTATION:"Rotation",QUATERNION:"Quaternion",WEIGHTS:"Weights"},getType:function(t){return t=String(t).toUpperCase(),dr.StateType[t]}},isAnimationStates:!0,className:"AnimationStates",nodeName:"",type:"",interpolationType:"LINEAR",constructor:function(t){this.id=d.a.generateUUID(this.className),this.keyTime=[],this.states=[],Object.assign(this,t)},findIndexByTime:function(t){return Object(r.getIndexFromSortedArray)(this.keyTime,t,lr)},getStateByIndex:function(t){var e=this.states.length/this.keyTime.length;return 1===e?this.states[t]:this.states.slice(t*e,t*e+e)},getState:function(t){var e=ir(this.findIndexByTime(t),2),n=e[0],i=e[1];if(n<0||i>=this.keyTime.length)return null;var s=this.keyTime[n],a=this.keyTime[i],o=this.getStateByIndex(n);if(n===i){var u=this.interpolation(o);return this.type===dr.StateType.ROTATION&&(u=rr.fromEuler(hr.fromArray(u))),u.elements||u}var c=this.getStateByIndex(i),h=a-s,f=(t-s)/h;this.type===dr.StateType.ROTATION?Object(r.isArrayLike)(o[0])?(o[0]=rr.fromEuler(hr.fromArray(o[0])),o[1]=sr.fromEuler(hr.fromArray(o[1])),o[2]=ar.fromEuler(hr.fromArray(o[2])),c[0]=or.fromEuler(hr.fromArray(c[0])),c[1]=ur.fromEuler(hr.fromArray(c[1])),c[2]=cr.fromEuler(hr.fromArray(c[2]))):(o=rr.fromEuler(hr.fromArray(o)),c=sr.fromEuler(hr.fromArray(c))):this.type===dr.StateType.QUATERNION&&(Object(r.isArrayLike)(o[0])?(o[0]=rr.fromArray(o[0]),o[1]=sr.fromArray(o[1]),o[2]=ar.fromArray(o[2]),c[0]=or.fromArray(c[0]),c[1]=ur.fromArray(c[1]),c[2]=cr.fromArray(c[2])):(o=rr.fromArray(o),c=sr.fromArray(c)));var l=this.interpolation(o,c,f,h);return l.elements||l},interpolation:function(t,e,n,i){return dr.interpolation[this.interpolationType](t,e,n,i)},updateNodeTranslation:function(t,e){t.x=e[0],t.y=e[1],t.z=e[2]},updateNodeScale:function(t,e){t.scaleX=e[0],t.scaleY=e[1],t.scaleZ=e[2]},updateNodeQuaternion:function(t,e){t.quaternion.fromArray(e)},updateNodeWeights:function(t,e){var n=this._originalWeightIndices=this._originalWeightIndices||[],i=e.length;e=e.slice();for(var r=0;re[s]){var o=e[s];e[s]=e[a],e[a]=o,o=n[s],n[s]=n[a],n[a]=o}t.traverse(function(t){t.isMesh&&t.geometry&&t.geometry.isMorphGeometry&&t.geometry.update(e,n)})},updateNodeState:function(t,e){if(e){var n=this.type;n===dr.StateType.ROTATION&&(n=dr.StateType.QUATERNION);var i=this.getState(t);i&&this["updateNode".concat(n)](e,i)}},clone:function(){return new this.constructor({keyTime:this.keyTime,states:this.states,type:this.type,nodeName:this.nodeName})}}),mr=dr,_r=s.a.create({Statics:{_anims:[],tick:function(t){this._anims.forEach(function(e){return e.tick(t)})}},Mixes:a.a,isAnimation:!0,className:"Animation",paused:!1,currentLoopCount:0,loop:1/0,currentTime:0,timeScale:1,startTime:0,endTime:0,clipStartTime:0,clipEndTime:0,nodeNameMap:null,_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this.initNodeNameMap()}},validAnimationIds:null,constructor:function(t){this.id=d.a.generateUUID(this.className),this.animStatesList=[],this.clips={},Object.assign(this,t),this.initClipTime()},addClip:function(t,e,n,i){this.clips[t]={start:e,end:n,animStatesList:i}},removeClip:function(t){this.clips[t]=null},getAnimStatesListTimeInfo:function(t){var e=0,n=1/0;return t.forEach(function(t){e=Math.max(t.keyTime[t.keyTime.length-1],e),n=Math.min(t.keyTime[0],n)}),{startTime:n,endTime:e}},initClipTime:function(){var t=this.getAnimStatesListTimeInfo(this.animStatesList);this.clipStartTime=t.startTime,this.clipEndTime=t.endTime},initNodeNameMap:function(){if(this._rootNode){var t=this.nodeNameMap={};this._rootNode.traverse(function(e){t[e.animationId]=e;var n=e.name;void 0===n||t[n]||(t[n]=e)},!1)}},tick:function(t){this.paused||(this.currentTime+=t/1e3*this.timeScale,this.currentTime>=this.endTime?(this.currentLoopCount++,this.currentTime=this.endTime,this.updateAnimStates(),this.fire("loopEnd"),!this.loop||this.currentLoopCount>=this.loop?(this.stop(),this.fire("end")):this.currentTime=this.startTime):this.updateAnimStates())},updateAnimStates:function(){var t=this;return this.animStatesList.forEach(function(e){e.updateNodeState(t.currentTime,t.nodeNameMap[e.nodeName])}),this},play:function(t,e){var n;if("string"==typeof t){var i=this.clips[t];i?(n=i.start,e=i.end,i.animStatesList&&(this.animStatesList=i.animStatesList,this.initClipTime())):m.a.warn("no this animation clip name:"+t)}else n=t;void 0===n&&(n=this.clipStartTime),void 0===e&&(e=this.clipEndTime),this.endTime=Math.min(e,this.clipEndTime),this.startTime=Math.min(n,this.endTime),this.currentTime=this.startTime,this.currentLoopCount=0,this.stop(),this.paused=!1,_r._anims.push(this)},stop:function(){this.paused=!0;var t=_r._anims,e=t.indexOf(this);-1!==e&&t.splice(e,1)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},clone:function(t){var e=new this.constructor({rootNode:t,animStatesList:this.animStatesList,timeScale:this.timeScale,loop:this.loop,paused:this.paused,currentTime:this.currentTime,startTime:this.startTime,endTime:this.endTime,clips:this.clips});return this.paused||e.play(),e}}),pr=_r;function gr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var vr=C.a.BLEND,Tr=C.a.DEPTH_TEST,Er=C.a.CULL_FACE,Mr=C.a.FRONT,Ar=C.a.BACK,Lr=C.a.FRONT_AND_BACK,Ir={5120:[1,Int8Array],5121:[1,Uint8Array],5122:[2,Int16Array],5123:[2,Uint16Array],5125:[4,Uint32Array],5126:[4,Float32Array]},Or={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Sr={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},Rr=s.a.create({isGLTFParser:!0,className:"GLTFParser",Statics:{MAGIC:"glTF",extensionHandlers:i,registerExtensionHandler:function(t,e){this.extensionHandlers[t]=e},unregisterExtensionHandler:function(t){this.extensionHandlers[t]&&delete this.extensionHandlers[t]}},isMultiAnim:!0,isProgressive:!1,isUnQuantizeInShader:!0,isLoadAllTextures:!1,preHandlerImageURI:null,preHandlerBufferURI:null,customMaterialCreator:null,ignoreTextureError:!1,src:"",constructor:function(t,e){Object.assign(this,e),this.content=t},parse:function(t){var e=this;if(this.content instanceof ArrayBuffer){var n=this.content;if(r.convertUint8ArrayToString(new Uint8Array(n,0,4))===Rr.MAGIC)this.parseBinary(n);else{var i=r.convertUint8ArrayToString(new Uint8Array(n),!0);this.json=JSON.parse(i)}}else this.json=JSON.parse(this.content);return this.glTFVersion=parseFloat(this.json.asset.version),this.glTFVersion>=2&&(this.isGLTF2=!0),this.parseExtensionUsed(),this.loadResources(t).then(function(){return e.parseGeometries()}).then(function(){return e.parseScene()})},parseExtensionUsed:function(){var t=this;this.extensionsUsed={},r.each(this.json.extensionsUsed,function(e){t.extensionsUsed[e]=!0}),this.extensionsUsed.WEB3D_quantized_attributes||(this.isUnQuantizeInShader=!1)},getExtensionHandler:function(t){return this.extensionHandlers&&this.extensionHandlers[t]||Rr.extensionHandlers[t]},parseExtension:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=t[e],s=this.getExtensionHandler(e);return s&&s.parse?s.parse(r,this,n,i):null},parseExtensions:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.each(t,function(t,r){var s=n.getExtensionHandler(r);s&&s.parse&&(e=s.parse(t,n,e,i))}),e},isUseExtension:function(t,e){return!!(t&&t.extensions&&t.extensions[e])},parseBinary:function(t){this.isBinary=!0;var e,n=new DataView(t),i=n.getUint32(4,!0),s=n.getUint32(8,!0),a=12;if(i<2){var o=n.getUint32(a,!0);e=new Uint8Array(t,20,o),e=r.convertUint8ArrayToString(e,!0),this.json=JSON.parse(e),this.binaryBody=t.slice(20+o)}else{if(2!==i)throw new Error("Dont support glTF version ".concat(i));for(;as*r.BYTES_PER_ELEMENT)a.array||(a.array=new r(a.buffer,a.byteOffset,a.byteLength/r.BYTES_PER_ELEMENT)),i=new w(a.array,s,{offset:n.byteOffset||0,stride:a.byteStride,bufferViewId:a.id});else{var u,c=(n.byteOffset||0)+a.byteOffset;if(c%r.BYTES_PER_ELEMENT)u=new r(a.buffer.slice(c,c+o*r.BYTES_PER_ELEMENT));else u=new r(a.buffer,c,o);i=new w(u,s)}return n.sparse&&(i||(i=new w(new r(o),s)),i=this.sparseAccessorHandler(i,n.sparse)),i=this.parseExtensions(n.extensions,i,{isDecode:e}),n.data=i,n.normalized&&(i.normalized=!0),i},getArrayByAccessor:function(t,e){var n=this.json.accessors[t];if(n.array)return n.array;var i=this.getAccessorData(t,e);if(!i.stride&&!i.offset&&1===i.size)return i.data;var r=[];return i.traverse(function(t){r.push(t.toArray?t.toArray():t)}),n.array=r,r},parseTechnique:function(t,e){var n=null;this.json.techniques&&(n=this.json.techniques[t.technique]),n&&n.states&&(n.states.enable.forEach(function(t){switch(t){case vr:e.blend=!0;break;case Tr:e.depthTest=!0;break;case Er:e.cullFace=!0}}),r.each(n.states.functions,function(t,n){switch(n){case"blendEquationSeparate":e.blendEquation=t[0],e.blendEquationAlpha=t[1];break;case"blendFuncSeparate":e.blendSrc=t[0],e.blendDst=t[1],e.blendSrcAlpha=t[2],e.blendDstAlpha=t[3];break;case"depthMask":e.depthMask=t[0];break;case"cullFace":e.cullFaceType=t[0];break;default:e[n]=t}}),e.cullFace?e.side=e.cullFaceType===Mr?Ar:Mr:e.side=Lr)},createMorphGeometry:function(t,e){var n=this,i=new yi,s=i.targets={};return r.each(t.targets,function(t){r.each(t,function(t,e){var i=Sr[e].name;s[i]||(s[i]=[]);var r=n.getAccessorData(t,!0);s[i].push(r)})}),i.weights=e||new Float32Array(t.targets.length),i},handlerGeometry:function(t,e){var n=void 0===e.mode?4:e.mode;if(e.extensions){var i=this.parseExtensions(e.extensions,null,e);if(i)return i.mode=n,i}t||(t=new Z({mode:n})),"indices"in e&&(t.indices=this.getAccessorData(e.indices));var r=e.attributes;for(var s in r){var a=Sr[s];if(a){var o=!(this.isUnQuantizeInShader&&a.decodeMatName);t[a.name]=this.getAccessorData(r[s],o),o||(t[a.decodeMatName]=t[a.name].decodeMat,delete t[a.name].decodeMat)}else m.a.warn("Unknow attribute named ".concat(s,"!"))}return t},handlerSkinedMesh:function(t,e){if(e){var n,i=(e.jointNames||e.joints).length;e.bindShapeMatrix&&(n=(new o.a).fromArray(e.bindShapeMatrix));for(var r=this.getArrayByAccessor(e.inverseBindMatrices,!0),s=0;s0&&(i=Object.values(n)[0].animStatesList),i.length?new pr({rootNode:this.node,animStatesList:i,validAnimationIds:s,clips:n}):null},parseScene:function(){var t=this;this.parseMaterials(),this.jointMap={},this.meshes=[],this.lights=[],this.node=new g({needCallChildUpdate:!1}),this.parseCameras();var e=this.json.scenes[this.getDefaultSceneName()];if(!e)return m.a.warn("GLTFParser:no scene!"),{node:this.node,meshes:[],cameras:[],lights:[],textures:[],materials:[]};e.nodes.forEach(function(e){return t.parseNode(e,t.node)}),this.node.resetSkinedMeshRootNode();var n={node:this.node,scene:this.node,meshes:this.meshes,json:this.json,cameras:Object.values(this.cameras),lights:this.lights,textures:Object.values(this.textures),materials:Object.values(this.materials)},i=this.parseAnimations();return i&&(this.node.setAnim(i),i.play(),n.anim=i),this.parseExtensions(this.json.extensions,n,{isGlobalExtension:!0}),n},getDefaultSceneName:function(){return void 0!==this.defaultScene?this.defaultScene:this.json.scenes?Object.keys(this.json.scenes)[0]:null}}),yr=Rr,xr=s.a.create({Extends:Gi,isGLTFLoader:!0,className:"GLTFLoader",constructor:function(){xr.superclass.constructor.call(this)},load:function(t){var e=this;return this.loadRes(t.src,"buffer").then(function(n){return new yr(n,t).parse(e)}).catch(function(t){throw m.a.error("load gltf failed",t.message,t.stack),t})}});Wi.addLoader("gltf",xr),Wi.addLoader("glb",xr);var Nr=xr,br=n(107),wr=n.n(br),Cr=C.a.RGBA,Pr=C.a.NEAREST,Hr=C.a.CLAMP_TO_EDGE,Dr=C.a.FLOAT,Fr=s.a.create({Extends:Gi,isHDRLoader:!0,className:"HDRLoader",constructor:function(){Fr.superclass.constructor.call(this)},load:function(t){return this.loadRes(t.src,"buffer").then(function(e){try{var n=wr()(e),i=n.shape,r=n.data,s=new ne({width:i[0],height:i[1],flipY:t.flipY||!1,image:r,type:Dr,magFilter:Pr,minFilter:Pr,wrapS:Hr,wrapT:Hr,internalFormat:Cr,format:Cr});return Object.assign(s,t),s}catch(t){m.a.error("HDRLoader:parse error => ",t)}return null})}});Wi.addLoader("hdr",Fr);var Ur=Fr,Gr=s.a.create({Statics:{HEADER_LEN:64,COMPRESSED_2D:0,COMPRESSED_3D:1,TEX_2D:2,TEX_3D:3},isKhronosTextureContainer:!0,className:"KhronosTextureContainer",constructor:function(t,e){this.arrayBuffer=t;var n=new Uint8Array(this.arrayBuffer,0,12);if(171===n[0]&&75===n[1]&&84===n[2]&&88===n[3]&&32===n[4]&&49===n[5]&&49===n[6]&&187===n[7]&&13===n[8]&&10===n[9]&&26===n[10]&&10===n[11]){var i=Uint32Array.BYTES_PER_ELEMENT,r=new DataView(this.arrayBuffer,12,13*i),s=67305985===r.getUint32(0,!0);this.glType=r.getUint32(1*i,s),this.glTypeSize=r.getUint32(2*i,s),this.glFormat=r.getUint32(3*i,s),this.glInternalFormat=r.getUint32(4*i,s),this.glBaseInternalFormat=r.getUint32(5*i,s),this.pixelWidth=r.getUint32(6*i,s),this.pixelHeight=r.getUint32(7*i,s),this.pixelDepth=r.getUint32(8*i,s),this.numberOfArrayElements=r.getUint32(9*i,s),this.numberOfFaces=r.getUint32(10*i,s),this.numberOfMipmapLevels=r.getUint32(11*i,s),this.bytesOfKeyValueData=r.getUint32(12*i,s),0===this.glType?(this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===e?this.loadType=Gr.COMPRESSED_2D:m.a.warn("number of faces expected"+e+", but found "+this.numberOfFaces):m.a.warn("texture arrays not currently supported"):m.a.warn("only 2D textures currently supported")):m.a.warn("only compressed formats currently supported")}else m.a.error("texture missing KTX identifier")},mipmaps:function(t){for(var e=[],n=Gr.HEADER_LEN+this.bytesOfKeyValueData,i=this.pixelWidth,r=this.pixelHeight,s=t?this.numberOfMipmapLevels:1,a=0;a=Math.floor(Math.log2(Math.max(n.width,n.height))+1)?(n.mipmaps=e.mipmaps(!0),n.image=n.mipmaps[0].data):(n.mipmaps=null,n.image=e.mipmaps(!1)[0].data),new ne({compressed:!0,internalFormat:n.format,image:n.image,width:n.width,height:n.height,mipmaps:n.mipmaps})})}});Wi.addLoader("ktx",Br);var Vr=Br,Xr=s.a.create({Mixes:a.a,isLoadQueue:!0,className:"LoadQueue",Statics:{addLoader:function(t,e){m.a.warn("LoadQueue.addLoader is duplicated, please use Loader.addLoader"),Wi.addLoader(t,e)}},constructor:function(t){this._source=[],this.add(t)},maxConnections:2,_source:null,_loaded:0,_connections:0,_currentIndex:-1,add:function(t){return t&&(t=Array.isArray(t)?t:[t],this._source=this._source.concat(t)),this},get:function(t){if(!t)return null;for(var e=this._source,n=0;n=n)this.fire("complete");else if(this._currentIndex2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=this.renderer.pixelRatio,s=[],a=this.framebuffer.readPixels(t*r,e*r,n*r,i*r),o=0;o this.rotationXLimit) { + tempEuler.x = this.rotationXLimit; + } else if (tempEuler.x < -this.rotationXLimit) { + tempEuler.x = -this.rotationXLimit; + } + } + this.model.quaternion.fromEuler(tempEuler); + } else { + tempEuler.set(x, y, 0); + tempQuat.fromEuler(tempEuler); + this.model.quaternion.premultiply(tempQuat); + } + }; + + OrbitControls.prototype.scale = function(s) { + if (this.isLockScale) { + return; + } + this.model.scaleX *= s; + this.model.scaleY *= s; + this.model.scaleZ *= s; + + this.onScale && this.onScale(s); + }; + + OrbitControls.prototype.move = function(x, y) { + if(this.isLockMove){ + return; + } + this.model.x += x; + this.model.y += y; + }; + + OrbitControls.prototype.onMouseDown = function (evt) { + this.mouseInfo.isDown = true; + if (evt.type === 'touchstart') { + + this.mouseInfo.startX = evt.touches[0].pageX; + this.mouseInfo.startY = evt.touches[0].pageY; + + switch (evt.touches.length) { + case 1: + this.mouseInfo.state = STATE.MOVE; + break; + case 2: + var x = evt.touches[1].pageX - evt.touches[0].pageX; + var y = evt.touches[1].pageY - evt.touches[0].pageY; + this.mouseInfo.startPointerDistance = Math.sqrt(x * x + y * y); + this.mouseInfo.state = STATE.ZOOM; + break; + case 3: + this.mouseInfo.state = STATE.PAN; + break; + } + } else { + switch (evt.button) { + case MOUSE.LEFT: + this.mouseInfo.startX = evt.pageX; + this.mouseInfo.startY = evt.pageY; + this.mouseInfo.state = STATE.MOVE; + break; + case MOUSE.RIGHT: + this.mouseInfo.startX = evt.pageX; + this.mouseInfo.startY = evt.pageY; + this.mouseInfo.state = STATE.PAN; + break; + } + } + } + + OrbitControls.prototype.onMouseMove = function (evt) { + if (!this.mouseInfo.isDown) { + return; + } + evt.preventDefault(); + evt.stopPropagation(); + var scope = this; + if (evt.type === 'touchmove') { + switch (this.mouseInfo.state) { + case STATE.MOVE: + scope.handlerToucheMove(evt); + break; + case STATE.ZOOM: + scope.handlerToucheZoom(evt); + break; + case STATE.PAN: + scope.handlerTouchePan(evt); + break; + } + } else { + switch (this.mouseInfo.state) { + case STATE.MOVE: + scope.handlerMouseMove(evt); + break; + case STATE.PAN: + scope.handlerMousePan(evt); + break; + } + } + + } + + OrbitControls.prototype.handlerMousePan = function (evt) { + var distanceX = evt.pageX - this.mouseInfo.startX; + var distanceY = evt.pageY - this.mouseInfo.startY; + this.mouseInfo.startX = evt.pageX; + this.mouseInfo.startY = evt.pageY; + this.model.worldMatrix.getScaling(tempVector); + this.move(distanceX * 2 * tempVector.x, distanceY * 2 * tempVector.y); + } + + OrbitControls.prototype.handlerMouseMove = function (evt) { + var distanceX = evt.pageX - this.mouseInfo.startX; + var distanceY = evt.pageY - this.mouseInfo.startY; + this.mouseInfo.startX = evt.pageX; + this.mouseInfo.startY = evt.pageY; + + this.rotate(distanceX, distanceY); + } + + OrbitControls.prototype.handlerToucheZoom = function (evt) { + var x = evt.touches[1].pageX - evt.touches[0].pageX; + var y = evt.touches[1].pageY - evt.touches[0].pageY; + var pointerDistance = Math.sqrt(x * x + y * y); + var scale = 1 + scale = pointerDistance / this.mouseInfo.startPointerDistance; + this.mouseInfo.startPointerDistance = pointerDistance; + if (scale != 1) { + this.scale(scale); + } + } + + OrbitControls.prototype.handlerTouchePan = function (evt) { + evt = evt.touches[0]; + var distanceX = evt.pageX - this.mouseInfo.startX; + var distanceY = evt.pageY - this.mouseInfo.startY; + this.mouseInfo.startX = evt.pageX; + this.mouseInfo.startY = evt.pageY; + this.move(distanceX * .01, -distanceY * .01); + } + + OrbitControls.prototype.handlerToucheMove = function (evt) { + var model = this.model; + evt = evt.touches[0]; + this.handlerMouseMove(evt); + } + + OrbitControls.prototype.onMouseUp = function (evt) { + this.mouseInfo.isDown = false; + this.mouseInfo.state = STATE.NONE; + } + + OrbitControls.prototype.onWheel = function (evt) { + evt.preventDefault(); + var _deltaY = evt.deltaY; + if (_deltaY < -100) { + _deltaY = -90 + } else if (_deltaY > 100) { + _deltaY = 90 + } + var s = 1 + _deltaY * 0.001; + this.scale(1 / s); + } + + OrbitControls.prototype.bindEvent = function () { + + } + + if(typeof module !== 'undefined'){ + module.exports = OrbitControls; + } + + if(typeof window !== 'undefined'){ + window.OrbitControls = OrbitControls; + } +})(); \ No newline at end of file diff --git a/libs/Hilo3d/1.11.17/draco_decoder.js b/libs/Hilo3d/1.11.17/draco_decoder.js new file mode 100644 index 000000000..5a8961a2a --- /dev/null +++ b/libs/Hilo3d/1.11.17/draco_decoder.js @@ -0,0 +1,30 @@ +var DracoDecoderModule = function(DracoDecoderModule) { + DracoDecoderModule = DracoDecoderModule || {}; + var Module = DracoDecoderModule; // included code may refer to Module (e.g. from file packager), so alias it + +var isRuntimeInitialized=false;var isModuleParsed=false;Module["onRuntimeInitialized"]=(function(){isRuntimeInitialized=true;if(isModuleParsed){if(typeof Module["onModuleLoaded"]==="function"){Module["onModuleLoaded"](Module)}}});Module["onModuleParsed"]=(function(){isModuleParsed=true;if(isRuntimeInitialized){if(typeof Module["onModuleLoaded"]==="function"){Module["onModuleLoaded"](Module)}}});function isVersionSupported(versionString){if(typeof versionString!=="string")return false;const version=versionString.split(".");if(version.length<2||version.length>3)return false;if(version[0]==1&&version[1]>=0&&version[1]<=3)return true;if(version[0]!=0||version[1]>10)return false;return true}Module["isVersionSupported"]=isVersionSupported;var Module;if(!Module)Module=(typeof DracoDecoderModule!=="undefined"?DracoDecoderModule:null)||{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER}if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=console.log;if(!Module["printErr"])Module["printErr"]=console.warn;var nodeFS;var nodePath;Module["read"]=function shell_read(filename,binary){var ret;ret=tryParseAsDataURI(filename);if(!ret){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename)}return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(!Module["thisProgram"]){if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}else{Module["thisProgram"]="unknown-program"}}Module["arguments"]=process["argv"].slice(2);process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(!Module["print"])Module["print"]=print;if(typeof printErr!="undefined")Module["printErr"]=printErr;if(typeof read!="undefined"){Module["read"]=function shell_read(f){var data=tryParseAsDataURI(f);if(data){return intArrayToString(data)}return read(f)}}else{Module["read"]=function shell_read(){throw"no read() available"}}Module["readBinary"]=function readBinary(f){var data;data=tryParseAsDataURI(f);if(data){return data}if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof quit==="function"){Module["quit"]=(function(status,toThrow){quit(status)})}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function shell_read(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText}catch(err){var data=tryParseAsDataURI(url);if(data){return intArrayToString(data)}throw err}};if(ENVIRONMENT_IS_WORKER){Module["readBinary"]=function readBinary(url){try{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}catch(err){var data=tryParseAsDataURI(url);if(data){return data}throw err}}}Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}var data=tryParseAsDataURI(url);if(data){onload(data.buffer);return}onerror()};xhr.onerror=onerror;xhr.send(null)};if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof console!=="undefined"){if(!Module["print"])Module["print"]=function shell_print(x){console.log(x)};if(!Module["printErr"])Module["printErr"]=function shell_printErr(x){console.warn(x)}}else{var TRY_USE_DUMP=false;if(!Module["print"])Module["print"]=TRY_USE_DUMP&&typeof dump!=="undefined"?(function(x){dump(x)}):(function(x){})}if(typeof Module["setWindowTitle"]==="undefined"){Module["setWindowTitle"]=(function(title){document.title=title})}}else{throw new Error("Unknown runtime environment. Where are we?")}if(!Module["print"]){Module["print"]=(function(){})}if(!Module["printErr"]){Module["printErr"]=Module["print"]}if(!Module["arguments"]){Module["arguments"]=[]}if(!Module["thisProgram"]){Module["thisProgram"]="./this.program"}if(!Module["quit"]){Module["quit"]=(function(status,toThrow){throw toThrow})}Module.print=Module["print"];Module.printErr=Module["printErr"];Module["preRun"]=[];Module["postRun"]=[];for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var Runtime={setTempRet0:(function(value){tempRet0=value;return value}),getTempRet0:(function(){return tempRet0}),stackSave:(function(){return STACKTOP}),stackRestore:(function(stackTop){STACKTOP=stackTop}),getNativeTypeSize:(function(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return Runtime.QUANTUM_SIZE}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}),getNativeFieldSize:(function(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE)}),STACK_ALIGN:16,prepVararg:(function(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}),getAlignSize:(function(type,size,vararg){if(!vararg&&(type=="i64"||type=="double"))return 8;if(!type)return Math.min(size,8);return Math.min(size||(type?Runtime.getNativeFieldSize(type):0),Runtime.QUANTUM_SIZE)}),dynCall:(function(sig,ptr,args){if(args&&args.length){return Module["dynCall_"+sig].apply(null,[ptr].concat(args))}else{return Module["dynCall_"+sig].call(null,ptr)}}),functionPointers:[],addFunction:(function(func){for(var i=0;i>2];var end=(ret+size+15|0)&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}),alignMemory:(function(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:16))*(quantum?quantum:16);return ret}),makeBigInt:(function(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*+4294967296:+(low>>>0)+ +(high|0)*+4294967296;return ret}),GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};var ABORT=0;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}var JSfuncs={"stackSave":(function(){Runtime.stackSave()}),"stackRestore":(function(){Runtime.stackRestore()}),"arrayToC":(function(arr){var ret=Runtime.stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=Runtime.stackAlloc(len);stringToUTF8(str,ret,len)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};function ccall(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}var ALLOC_STATIC=2;var ALLOC_NONE=4;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[typeof _malloc==="function"?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var stop;ptr=ret;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return Module["UTF8ToString"](ptr)}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function demangle(func){return func}function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(regex,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var WASM_PAGE_SIZE=65536;var ASMJS_PAGE_SIZE=16777216;var MIN_TOTAL_MEMORY=16777216;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBuffer(buf){Module["buffer"]=buffer=buf}function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed;var STACK_BASE,STACKTOP,STACK_MAX;var DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0;staticSealed=false;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 ")}if(!Module["reallocBuffer"])Module["reallocBuffer"]=(function(size){var ret;try{if(ArrayBuffer.transfer){ret=ArrayBuffer.transfer(buffer,size)}else{var oldHEAP8=HEAP8;ret=new ArrayBuffer(size);var temp=new Int8Array(ret);temp.set(oldHEAP8)}}catch(e){return false}var success=_emscripten_replace_memory(ret);if(!success)return false;return ret});function enlargeMemory(){var PAGE_MULTIPLE=Module["usingWasm"]?WASM_PAGE_SIZE:ASMJS_PAGE_SIZE;var LIMIT=2147483648-PAGE_MULTIPLE;if(HEAP32[DYNAMICTOP_PTR>>2]>LIMIT){return false}var OLD_TOTAL_MEMORY=TOTAL_MEMORY;TOTAL_MEMORY=Math.max(TOTAL_MEMORY,MIN_TOTAL_MEMORY);while(TOTAL_MEMORY>2]){if(TOTAL_MEMORY<=536870912){TOTAL_MEMORY=alignUp(2*TOTAL_MEMORY,PAGE_MULTIPLE)}else{TOTAL_MEMORY=Math.min(alignUp((3*TOTAL_MEMORY+2147483648)/4,PAGE_MULTIPLE),LIMIT)}}var replacement=Module["reallocBuffer"](TOTAL_MEMORY);if(!replacement||replacement.byteLength!=TOTAL_MEMORY){TOTAL_MEMORY=OLD_TOTAL_MEMORY;return false}updateGlobalBuffer(replacement);updateGlobalBufferViews();return true}var byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get);byteLength(new ArrayBuffer(4))}catch(e){byteLength=(function(buffer){return buffer.byteLength})}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||16777216;if(TOTAL_MEMORY0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPreMain(cb){__ATMAIN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}assert(Math["imul"]&&Math["fround"]&&Math["clz32"]&&Math["trunc"],"this is a legacy browser, build with LEGACY_VM_SUPPORT");var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_round=Math.round;var Math_min=Math.min;var Math_clz32=Math.clz32;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var memoryInitializer=null;var ASM_CONSTS=[];STATIC_BASE=Runtime.GLOBAL_BASE;STATICTOP=STATIC_BASE+13472;__ATINIT__.push();memoryInitializer="data:application/octet-stream;base64,QA4AAIgOAAAYAAAAAAAAABgOAACvDgAAQA4AAMwOAAAYAAAAAAAAAEAOAAD1DgAAQAAAAAAAAAAYDgAAEQ8AABgOAAA2DwAAQA4AAFsPAAAwAAAAAAAAAEAOAAB8GQAASAAAAAAAAABADgAAiw8AAIAAAAAAAAAAQA4AAOQPAACQAAAAAAAAAEAOAAA4EAAAoAAAAAAAAABADgAAbBAAALAAAAAAAAAAGA4AAJcQAABADgAAuxAAAMgAAAAAAAAAGA4AAFkRAABADgAA9xEAAOAAAAAAAAAAQA4AAI8SAACAAAAAAAAAAEAOAAAYEwAA4AAAAAAAAABADgAAshMAAOAAAAAAAAAAQA4AAFgUAADgAAAAAAAAAEAOAADuFAAAMAEAAAAAAAAYDgAAmRUAAEAOAABEFgAASAEAAAAAAABADgAA6RYAAIAAAAAAAAAAQA4AAH8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Z2h0AFN0OWV4Y2VwdGlvbgBOMTBfX2N4eGFiaXYxMTZfX3NoaW1fdHlwZV9pbmZvRQBTdDl0eXBlX2luZm8ATjEwX19jeHhhYml2MTIwX19zaV9jbGFzc190eXBlX2luZm9FAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQBwdGhyZWFkX29uY2UgZmFpbHVyZSBpbiBfX2N4YV9nZXRfZ2xvYmFsc19mYXN0KCkAY2Fubm90IGNyZWF0ZSBwdGhyZWFkIGtleSBmb3IgX19jeGFfZ2V0X2dsb2JhbHMoKQBjYW5ub3QgemVybyBvdXQgdGhyZWFkIHZhbHVlIGZvciBfX2N4YV9nZXRfZ2xvYmFscygpAHRlcm1pbmF0ZV9oYW5kbGVyIHVuZXhwZWN0ZWRseSByZXR1cm5lZABTdDExbG9naWNfZXJyb3IAU3QxMmxlbmd0aF9lcnJvcgBOMTBfX2N4eGFiaXYxMTlfX3BvaW50ZXJfdHlwZV9pbmZvRQBOMTBfX2N4eGFiaXYxMTdfX3BiYXNlX3R5cGVfaW5mb0U=";var tempDoublePtr=STATICTOP;STATICTOP+=16;function ___cxa_allocate_exception(size){return _malloc(size)}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:(function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var ptr in EXCEPTIONS.infos){var info=EXCEPTIONS.infos[ptr];if(info.adjusted===adjusted){return ptr}}return adjusted}),addRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount++}),decRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];assert(info.refcount>0);info.refcount--;if(info.refcount===0&&!info.rethrown){if(info.destructor){Module["dynCall_vi"](info.destructor,ptr)}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}}),clearRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0})};function ___cxa_begin_catch(ptr){var info=EXCEPTIONS.infos[ptr];if(info&&!info.caught){info.caught=true;__ZSt18uncaught_exceptionv.uncaught_exception--}if(info)info.rethrown=false;EXCEPTIONS.caught.push(ptr);EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(ptr));return ptr}function ___cxa_pure_virtual(){ABORT=true;throw"Pure virtual function called!"}function ___resumeException(ptr){if(!EXCEPTIONS.last){EXCEPTIONS.last=ptr}throw ptr+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function ___cxa_find_matching_catch(){var thrown=EXCEPTIONS.last;if(!thrown){return(Runtime.setTempRet0(0),0)|0}var info=EXCEPTIONS.infos[thrown];var throwntype=info.type;if(!throwntype){return(Runtime.setTempRet0(0),thrown)|0}var typeArray=Array.prototype.slice.call(arguments);var pointer=Module["___cxa_is_pointer_type"](throwntype);if(!___cxa_find_matching_catch.buffer)___cxa_find_matching_catch.buffer=_malloc(4);HEAP32[___cxa_find_matching_catch.buffer>>2]=thrown;thrown=___cxa_find_matching_catch.buffer;for(var i=0;i>2];info.adjusted=thrown;return(Runtime.setTempRet0(typeArray[i]),thrown)|0}}thrown=HEAP32[thrown>>2];return(Runtime.setTempRet0(throwntype),thrown)|0}function ___cxa_throw(ptr,type,destructor){EXCEPTIONS.infos[ptr]={ptr:ptr,adjusted:ptr,type:type,destructor:destructor,refcount:0,caught:false,rethrown:false};EXCEPTIONS.last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exception=1}else{__ZSt18uncaught_exceptionv.uncaught_exception++}throw ptr+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}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);function ___gxx_personality_v0(){}var SYSCALLS={varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.get(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();var ret=0;if(!___syscall146.buffer){___syscall146.buffers=[null,[],[]];___syscall146.printChar=(function(stream,curr){var buffer=___syscall146.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?Module["print"]:Module["printErr"])(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}})}for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=PTHREAD_SPECIFIC_NEXT_KEY;PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0;PTHREAD_SPECIFIC_NEXT_KEY++;return 0}function _pthread_once(ptr,func){if(!_pthread_once.seen)_pthread_once.seen={};if(ptr in _pthread_once.seen)return;Module["dynCall_v"](func);_pthread_once.seen[ptr]=1}function _pthread_setspecific(key,value){if(!(key in PTHREAD_SPECIFIC)){return ERRNO_CODES.EINVAL}PTHREAD_SPECIFIC[key]=value;return 0}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}__ATEXIT__.push((function(){var fflush=Module["_fflush"];if(fflush)fflush(0);var printChar=___syscall146.printChar;if(!printChar)return;var buffers=___syscall146.buffers;if(buffers[1].length)printChar(1,10);if(buffers[2].length)printChar(2,10)}));DYNAMICTOP_PTR=Runtime.staticAlloc(4);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=true;var ASSERTIONS=false;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}function intArrayToString(array){var ret=[];for(var i=0;i255){if(ASSERTIONS){assert(false,"Character code "+chr+" ("+String.fromCharCode(chr)+") at offset "+i+" not in 0x00-0xFF.")}chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var decodeBase64=typeof atob==="function"?atob:(function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!==64){output=output+String.fromCharCode(chr2)}if(enc4!==64){output=output+String.fromCharCode(chr3)}}while(i2147483648)return false;b=new a(newBuffer);d=new c(newBuffer);f=new e(newBuffer);h=new g(newBuffer);j=new i(newBuffer);l=new k(newBuffer);n=new m(newBuffer);p=new o(newBuffer);buffer=newBuffer;return true} +// EMSCRIPTEN_START_FUNCS +function Jb(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;c=u;u=u+16|0;b=c+8|0;d=c+4|0;e=c;g=a+64|0;h=f[g>>2]|0;if((f[h+28>>2]|0)==(f[h+24>>2]|0)){u=c;return}i=a+52|0;j=a+56|0;k=a+60|0;l=a+12|0;m=a+28|0;n=a+40|0;o=a+44|0;p=a+48|0;q=h;h=0;r=0;while(1){s=f[(f[q+24>>2]|0)+(r<<2)>>2]|0;if((s|0)==-1){t=q;v=h}else{w=h+1|0;f[b>>2]=h;x=f[j>>2]|0;if((x|0)==(f[k>>2]|0))yf(i,b);else{f[x>>2]=h;f[j>>2]=x+4}f[d>>2]=s;f[e>>2]=0;a:do if(!(f[(f[l>>2]|0)+(r>>>5<<2)>>2]&1<<(r&31)))y=s;else{x=s+1|0;z=((x>>>0)%3|0|0)==0?s+-2|0:x;if(((z|0)!=-1?(f[(f[a>>2]|0)+(z>>>5<<2)>>2]&1<<(z&31)|0)==0:0)?(x=f[(f[(f[g>>2]|0)+12>>2]|0)+(z<<2)>>2]|0,z=x+1|0,(x|0)!=-1):0){A=((z>>>0)%3|0|0)==0?x+-2|0:z;f[e>>2]=A;if((A|0)==-1){y=s;break}else B=A;while(1){f[d>>2]=B;A=B+1|0;z=((A>>>0)%3|0|0)==0?B+-2|0:A;if((z|0)==-1)break;if(f[(f[a>>2]|0)+(z>>>5<<2)>>2]&1<<(z&31)|0)break;A=f[(f[(f[g>>2]|0)+12>>2]|0)+(z<<2)>>2]|0;z=A+1|0;if((A|0)==-1)break;x=((z>>>0)%3|0|0)==0?A+-2|0:z;f[e>>2]=x;if((x|0)==-1){y=B;break a}else B=x}f[e>>2]=-1;y=B;break}f[e>>2]=-1;y=s}while(0);f[(f[m>>2]|0)+(y<<2)>>2]=f[b>>2];s=f[o>>2]|0;if((s|0)==(f[p>>2]|0))yf(n,d);else{f[s>>2]=f[d>>2];f[o>>2]=s+4}s=f[g>>2]|0;x=f[d>>2]|0;b:do if(((x|0)!=-1?(z=(((x>>>0)%3|0|0)==0?2:-1)+x|0,(z|0)!=-1):0)?(A=f[(f[s+12>>2]|0)+(z<<2)>>2]|0,(A|0)!=-1):0){z=A+(((A>>>0)%3|0|0)==0?2:-1)|0;f[e>>2]=z;if((z|0)!=-1&(z|0)!=(x|0)){A=w;C=z;while(1){z=C+1|0;D=((z>>>0)%3|0|0)==0?C+-2|0:z;do if(f[(f[a>>2]|0)+(D>>>5<<2)>>2]&1<<(D&31)){z=A+1|0;f[b>>2]=A;E=f[j>>2]|0;if((E|0)==(f[k>>2]|0))yf(i,b);else{f[E>>2]=A;f[j>>2]=E+4}E=f[o>>2]|0;if((E|0)==(f[p>>2]|0)){yf(n,e);F=z;break}else{f[E>>2]=f[e>>2];f[o>>2]=E+4;F=z;break}}else F=A;while(0);f[(f[m>>2]|0)+(f[e>>2]<<2)>>2]=f[b>>2];G=f[g>>2]|0;D=f[e>>2]|0;if((D|0)==-1)break;z=(((D>>>0)%3|0|0)==0?2:-1)+D|0;if((z|0)==-1)break;D=f[(f[G+12>>2]|0)+(z<<2)>>2]|0;if((D|0)==-1)break;C=D+(((D>>>0)%3|0|0)==0?2:-1)|0;f[e>>2]=C;if(!((C|0)!=-1?(C|0)!=(f[d>>2]|0):0)){H=G;I=F;break b}else A=F}f[e>>2]=-1;H=G;I=F}else{H=s;I=w}}else J=26;while(0);if((J|0)==26){J=0;f[e>>2]=-1;H=s;I=w}t=H;v=I}r=r+1|0;if(r>>>0>=(f[t+28>>2]|0)-(f[t+24>>2]|0)>>2>>>0)break;else{q=t;h=v}}u=c;return}function Kb(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0;e=u;u=u+48|0;d=e+32|0;h=e+24|0;i=e+16|0;j=e;k=e+12|0;l=a+8|0;m=f[l>>2]|0;if((m+-2|0)>>>0<=28){f[a+72>>2]=m;n=1<>2]=n+-1;m=n+-2|0;f[a+80>>2]=m;f[a+84>>2]=(m|0)/2|0}m=a+40|0;f[a+48>>2]=g;g=a+36|0;n=f[g>>2]|0;o=(f[n+4>>2]|0)-(f[n>>2]|0)|0;p=o>>2;f[j>>2]=0;f[j+4>>2]=0;f[j+8>>2]=0;if((o|0)<=0){u=e;return 1}o=j+4|0;q=j+8|0;r=a+84|0;s=a+88|0;t=a+80|0;a=h+4|0;v=i+4|0;w=d+4|0;x=f[n>>2]|0;if((f[n+4>>2]|0)==(x|0)){y=n;ym(y)}else{z=x;A=0}while(1){f[k>>2]=f[z+(A<<2)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E=f[r>>2]|0;Q=(E|0)<(O|0)?(E<<1)-O|0:O;R=0}else{Q=O;R=P}}else{Q=B;R=B}while(0);B=A<<1;x=b+(B<<2)|0;C=c+(B<<2)|0;B=f[x>>2]|0;E=f[x+4>>2]|0;f[h>>2]=Q;f[a>>2]=R;f[i>>2]=B;f[v>>2]=E;bc(d,l,h,i);f[C>>2]=f[d>>2];f[C+4>>2]=f[w>>2];A=A+1|0;if((A|0)>=(p|0)){S=5;break}C=f[g>>2]|0;z=f[C>>2]|0;if((f[C+4>>2]|0)-z>>2>>>0<=A>>>0){y=C;S=6;break}}if((S|0)==5){u=e;return 1}else if((S|0)==6)ym(y);return 0}function Lb(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;d=u;u=u+80|0;e=d+76|0;g=d;h=d+72|0;i=d+64|0;j=d+68|0;if(!(eg(e,c)|0)){k=0;u=d;return k|0}l=f[e>>2]|0;if(!l){k=0;u=d;return k|0}m=a+4|0;n=a+8|0;o=f[n>>2]|0;p=f[m>>2]|0;q=o-p>>2;r=p;p=o;if(l>>>0>q>>>0){jf(m,l-q|0);if(!(f[e>>2]|0)){k=1;u=d;return k|0}}else if(l>>>0>>0?(q=r+(l<<2)|0,(p|0)!=(q|0)):0)f[n>>2]=p+(~((p+-4-q|0)>>>2)<<2);q=f[a+32>>2]|0;p=c+8|0;n=c+16|0;l=g+60|0;r=q+8|0;o=a+16|0;s=a+20|0;a=0;while(1){t=p;v=f[t>>2]|0;w=f[t+4>>2]|0;t=n;x=f[t>>2]|0;y=f[t+4>>2]|0;if(!((w|0)>(y|0)|(w|0)==(y|0)&v>>>0>x>>>0)){k=0;z=40;break}t=f[c>>2]|0;A=b[t+x>>0]|0;B=Tj(x|0,y|0,1,0)|0;C=I;D=n;f[D>>2]=B;f[D+4>>2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<2)|0,(B|0)!=(v|0)):0){f[s>>2]=B+(~((B+-4-v|0)>>>2)<<2);H=y}else H=y;else{Ae(o,A-D|0,j);H=f[o>>2]|0}G=H}f[G+(C<<2)>>2]=a;a=a+1|0;if(a>>>0>=(f[e>>2]|0)>>>0){k=1;z=40;break}}if((z|0)==40){u=d;return k|0}return 0}function Mb(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0;e=La[f[(f[a>>2]|0)+44>>2]&127](a)|0;if((e|0)<1){g=0;return g|0}h=(f[c+4>>2]|0)-(f[c>>2]|0)>>2;i=X(h,e)|0;Zd(a,h,e);h=a+16|0;j=f[h>>2]|0;if(!(f[j+80>>2]|0)){g=0;return g|0}k=(f[f[j>>2]>>2]|0)+(f[j+48>>2]|0)|0;if(!k){g=0;return g|0}j=d+8|0;l=j;m=f[l>>2]|0;n=f[l+4>>2]|0;l=d+16|0;o=l;p=f[o>>2]|0;q=f[o+4>>2]|0;if(!((n|0)>(q|0)|(n|0)==(q|0)&m>>>0>p>>>0)){g=0;return g|0}o=f[d>>2]|0;r=b[o+p>>0]|0;s=Tj(p|0,q|0,1,0)|0;t=I;u=l;f[u>>2]=s;f[u+4>>2]=t;a:do if(!(r<<24>>24)){if(!((n|0)>(t|0)|(n|0)==(t|0)&m>>>0>s>>>0)){g=0;return g|0}u=b[o+s>>0]|0;v=Tj(p|0,q|0,2,0)|0;w=l;f[w>>2]=v;f[w+4>>2]=I;w=u&255;v=(w|0)==(di(5)|0);x=f[(f[h>>2]|0)+64>>2]|0;y=(f[x+4>>2]|0)-(f[x>>2]|0)|0;if(v){v=i<<2;if(y>>>0>>0){g=0;return g|0}x=j;z=f[x>>2]|0;A=f[x+4>>2]|0;x=l;B=f[x>>2]|0;C=Tj(B|0,f[x+4>>2]|0,v|0,0)|0;x=I;if((A|0)<(x|0)|(A|0)==(x|0)&z>>>0>>0){g=0;return g|0}else{ee(k|0,(f[d>>2]|0)+B|0,v|0)|0;B=l;C=Tj(f[B>>2]|0,f[B+4>>2]|0,v|0,0)|0;v=l;f[v>>2]=C;f[v+4>>2]=I;D=20;break}}v=X(w,i)|0;if(y>>>0>>0){g=0;return g|0}y=j;C=f[y>>2]|0;B=f[y+4>>2]|0;y=l;z=f[y>>2]|0;x=f[y+4>>2]|0;y=Vj(C|0,B|0,z|0,x|0)|0;A=I;if((A|0)<0|(A|0)==0&y>>>0>>0){g=0;return g|0}if(!i)D=21;else{v=u&255;u=z;z=x;x=B;B=C;C=0;while(1){y=Tj(u|0,z|0,v|0,0)|0;A=I;if((x|0)<(A|0)|(x|0)==(A|0)&B>>>0>>0){E=u;F=z}else{ee(k+(C<<2)|0,(f[d>>2]|0)+u|0,w|0)|0;y=l;A=Tj(f[y>>2]|0,f[y+4>>2]|0,v|0,0)|0;y=I;G=l;f[G>>2]=A;f[G+4>>2]=y;E=A;F=y}y=C+1|0;if((y|0)==(i|0)){D=20;break a}A=j;u=E;z=F;x=f[A+4>>2]|0;B=f[A>>2]|0;C=y}}}else if(Rf(i,e,d,k)|0)D=20;else{g=0;return g|0}while(0);do if((D|0)==20)if(!i)D=21;else{F=a+20|0;E=f[F>>2]|0;if(E|0?La[f[(f[E>>2]|0)+32>>2]&127](E)|0:0){H=F;J=1;break}yi(k,i,k);H=F;J=1}while(0);if((D|0)==21){H=a+20|0;J=0}a=f[H>>2]|0;if(a|0){if(!(Ma[f[(f[a>>2]|0)+40>>2]&127](a,d)|0)){g=0;return g|0}if(J?(J=f[H>>2]|0,!(Oa[f[(f[J>>2]|0)+44>>2]&15](J,k,k,i,e,f[c>>2]|0)|0)):0){g=0;return g|0}}g=1;return g|0}function Nb(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=a+4|0;if(!c){e=f[a>>2]|0;f[a>>2]=0;if(e|0)fn(e);f[d>>2]=0;return}if(c>>>0>1073741823){e=ra(8)|0;$k(e,9793);f[e>>2]=3708;va(e|0,856,80)}e=dj(c<<2)|0;g=f[a>>2]|0;f[a>>2]=e;if(g|0)fn(g);f[d>>2]=c;d=0;do{f[(f[a>>2]|0)+(d<<2)>>2]=0;d=d+1|0}while((d|0)!=(c|0));d=a+8|0;g=f[d>>2]|0;if(!g)return;e=f[g+4>>2]|0;h=c+-1|0;i=(h&c|0)==0;if(!i)if(e>>>0>>0)j=e;else j=(e>>>0)%(c>>>0)|0;else j=e&h;f[(f[a>>2]|0)+(j<<2)>>2]=d;d=f[g>>2]|0;if(!d)return;else{k=g;l=d;m=j;n=g}a:while(1){g=k;j=l;d=n;b:while(1){o=j;while(1){e=f[o+4>>2]|0;if(!i)if(e>>>0>>0)p=e;else p=(e>>>0)%(c>>>0)|0;else p=e&h;if((p|0)==(m|0))break;q=(f[a>>2]|0)+(p<<2)|0;if(!(f[q>>2]|0))break b;e=f[o>>2]|0;c:do if(!e)r=o;else{s=o+8|0;t=b[s+11>>0]|0;u=t<<24>>24<0;v=t&255;t=u?f[o+12>>2]|0:v;w=(t|0)==0;if(u){u=e;x=o;while(1){y=u+8|0;z=b[y+11>>0]|0;A=z<<24>>24<0;if((t|0)!=((A?f[u+12>>2]|0:z&255)|0)){r=x;break c}if(!w?mh(f[s>>2]|0,A?f[y>>2]|0:y,t)|0:0){r=x;break c}y=f[u>>2]|0;if(!y){r=u;break c}else{A=u;u=y;x=A}}}if(w){x=e;u=o;while(1){A=b[x+8+11>>0]|0;if((A<<24>>24<0?f[x+12>>2]|0:A&255)|0){r=u;break c}A=f[x>>2]|0;if(!A){r=x;break c}else{y=x;x=A;u=y}}}u=e;x=o;while(1){w=u+8|0;y=b[w+11>>0]|0;A=y<<24>>24<0;if((t|0)!=((A?f[u+12>>2]|0:y&255)|0)){r=x;break c}y=A?f[w>>2]|0:w;if((f[s>>2]&255)<<24>>24==(b[y>>0]|0)){B=v;C=s;D=y}else{r=x;break c}while(1){B=B+-1|0;C=C+1|0;if(!B)break;D=D+1|0;if((b[C>>0]|0)!=(b[D>>0]|0)){r=x;break c}}y=f[u>>2]|0;if(!y){r=u;break}else{w=u;u=y;x=w}}}while(0);f[d>>2]=f[r>>2];f[r>>2]=f[f[(f[a>>2]|0)+(p<<2)>>2]>>2];f[f[(f[a>>2]|0)+(p<<2)>>2]>>2]=o;e=f[g>>2]|0;if(!e){E=43;break a}else o=e}j=f[o>>2]|0;if(!j){E=43;break a}else{g=o;d=o}}f[q>>2]=d;l=f[o>>2]|0;if(!l){E=43;break}else{k=o;m=p;n=o}}if((E|0)==43)return}function Ob(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;d=u;u=u+16|0;e=d+12|0;g=d+4|0;h=d+8|0;i=d;j=a+8+(b*12|0)|0;k=f[j>>2]|0;l=a+8+(b*12|0)+4|0;m=f[l>>2]|0;if((m|0)!=(k|0))f[l>>2]=m+(~((m+-4-k|0)>>>2)<<2);k=f[c>>2]|0;m=a+4|0;f[g>>2]=(k|0)==-1?-1:(k>>>0)/3|0;n=a+56|0;o=a+8+(b*12|0)+8|0;p=k;q=0;r=k;while(1){k=(q|0)==1;if(k){s=(r|0)==-1;do if(!s)if(!((r>>>0)%3|0)){t=r+2|0;break}else{t=r+-1|0;break}else t=-1;while(0);f[h>>2]=t;f[e>>2]=f[h>>2];if((Nd(a,e)|0)==-1){v=r;break}w=r+1|0;if(s){x=12;break}y=((w>>>0)%3|0|0)==0?r+-2|0:w;f[c>>2]=y;w=y+1|0;if((y|0)==-1){z=r;x=16;break}A=((w>>>0)%3|0|0)==0?y+-2|0:w;if((A|0)==-1){z=r;x=16;break}w=f[(f[(f[m>>2]|0)+12>>2]|0)+(A<<2)>>2]|0;A=w+1|0;if((w|0)==-1){z=r;x=16;break}y=((A>>>0)%3|0|0)==0?w+-2|0:A;f[c>>2]=y;if((y|0)==-1){v=r;break}else{B=0;C=r;D=y;x=18}}else{E=f[g>>2]|0;F=p;G=0;H=r}while(1){if((x|0)==18){x=0;y=(D>>>0)/3|0;f[g>>2]=y;E=y;F=D;G=B;H=C}y=(f[n>>2]|0)+(E>>>5<<2)|0;A=1<<(E&31);w=f[y>>2]|0;if(A&w|0){I=F;J=G;K=H;break}f[y>>2]=w|A;A=f[l>>2]|0;if((A|0)==(f[o>>2]|0))yf(j,g);else{f[A>>2]=f[g>>2];f[l>>2]=A+4}A=G+1|0;if((G|0)>0){do if(!(A&1)){w=k?F:H;if((F|0)!=-1)if(!((F>>>0)%3|0)){L=F+2|0;M=w;break}else{L=F+-1|0;M=w;break}else{L=-1;M=w}}else{w=F+1|0;if((F|0)==-1){L=-1;M=H}else{L=((w>>>0)%3|0|0)==0?F+-2|0:w;M=H}}while(0);f[c>>2]=L;N=L;O=M}else{N=F;O=H}f[i>>2]=N;f[e>>2]=f[i>>2];D=Nd(a,e)|0;f[c>>2]=D;if((D|0)==-1){I=-1;J=A;K=O;break}else{B=A;C=O;x=18}}if(!((J&1|0)==0|k^1)){s=f[l>>2]|0;w=f[s+-4>>2]|0;y=(f[n>>2]|0)+(w>>>5<<2)|0;f[y>>2]=f[y>>2]&~(1<<(w&31));f[l>>2]=s+-4}q=q+1|0;if((q|0)>=2){v=K;break}else{p=I;r=K}}if((x|0)==12){f[c>>2]=-1;z=-1;x=16}if((x|0)==16){f[c>>2]=-1;v=z}f[a+44+(b<<2)>>2]=v;v=f[l>>2]|0;l=f[j>>2]|0;j=l;if((v|0)==(l|0)){u=d;return}b=f[n>>2]|0;n=v-l>>2;l=0;do{v=f[j+(l<<2)>>2]|0;a=b+(v>>>5<<2)|0;f[a>>2]=f[a>>2]&~(1<<(v&31));l=l+1|0}while(l>>>0>>0);u=d;return}function Pb(a,c,e,g,h){a=a|0;c=c|0;e=e|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;i=u;u=u+32|0;j=i+12|0;k=i;f[c+40>>2]=e;e=c+32|0;f[e>>2]=g;f[c+4>>2]=h;Db(a,g,j);if(f[a>>2]|0){u=i;return}g=a+4|0;h=g+11|0;if((b[h>>0]|0)<0)fn(f[g>>2]|0);l=b[j+7>>0]|0;if((l&255|0)!=(La[f[(f[c>>2]|0)+8>>2]&127](c)|0)){m=dj(64)|0;f[k>>2]=m;f[k+8>>2]=-2147483584;f[k+4>>2]=50;n=m;o=9581;p=n+50|0;do{b[n>>0]=b[o>>0]|0;n=n+1|0;o=o+1|0}while((n|0)<(p|0));b[m+50>>0]=0;f[a>>2]=-1;Sf(g,k);if((b[k+11>>0]|0)<0)fn(f[k>>2]|0);u=i;return}m=b[j+5>>0]|0;b[c+36>>0]=m;q=b[j+6>>0]|0;b[c+37>>0]=q;if((m+-1&255)>1){r=dj(32)|0;f[k>>2]=r;f[k+8>>2]=-2147483616;f[k+4>>2]=22;n=r;o=9632;p=n+22|0;do{b[n>>0]=b[o>>0]|0;n=n+1|0;o=o+1|0}while((n|0)<(p|0));b[r+22>>0]=0;f[a>>2]=-5;Sf(g,k);if((b[k+11>>0]|0)<0)fn(f[k>>2]|0);u=i;return}r=q&255;if(m<<24>>24==2&r>>>0>(l<<24>>24==0?3:2)>>>0){l=dj(32)|0;f[k>>2]=l;f[k+8>>2]=-2147483616;f[k+4>>2]=22;n=l;o=9655;p=n+22|0;do{b[n>>0]=b[o>>0]|0;n=n+1|0;o=o+1|0}while((n|0)<(p|0));b[l+22>>0]=0;f[a>>2]=-5;Sf(g,k);if((b[k+11>>0]|0)<0)fn(f[k>>2]|0);u=i;return}l=(r|(m&255)<<8)&65535;d[(f[e>>2]|0)+38>>1]=l;if((l&65535)>258?(d[j+10>>1]|0)<0:0){Tc(a,c);if(f[a>>2]|0){u=i;return}if((b[h>>0]|0)<0)fn(f[g>>2]|0)}if(!(La[f[(f[c>>2]|0)+12>>2]&127](c)|0)){h=dj(48)|0;f[k>>2]=h;f[k+8>>2]=-2147483600;f[k+4>>2]=33;n=h;o=9678;p=n+33|0;do{b[n>>0]=b[o>>0]|0;n=n+1|0;o=o+1|0}while((n|0)<(p|0));b[h+33>>0]=0;f[a>>2]=-1;Sf(g,k);if((b[k+11>>0]|0)<0)fn(f[k>>2]|0);u=i;return}if(!(La[f[(f[c>>2]|0)+20>>2]&127](c)|0)){h=dj(32)|0;f[k>>2]=h;f[k+8>>2]=-2147483616;f[k+4>>2]=31;n=h;o=9712;p=n+31|0;do{b[n>>0]=b[o>>0]|0;n=n+1|0;o=o+1|0}while((n|0)<(p|0));b[h+31>>0]=0;f[a>>2]=-1;Sf(g,k);if((b[k+11>>0]|0)<0)fn(f[k>>2]|0);u=i;return}if(La[f[(f[c>>2]|0)+24>>2]&127](c)|0){f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;f[a+12>>2]=0;u=i;return}c=dj(48)|0;f[k>>2]=c;f[k+8>>2]=-2147483600;f[k+4>>2]=34;n=c;o=9744;p=n+34|0;do{b[n>>0]=b[o>>0]|0;n=n+1|0;o=o+1|0}while((n|0)<(p|0));b[c+34>>0]=0;f[a>>2]=-1;Sf(g,k);if((b[k+11>>0]|0)<0)fn(f[k>>2]|0);u=i;return}function Qb(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;c=u;u=u+48|0;d=c+32|0;e=c+28|0;g=c+16|0;h=c;i=a+16|0;j=f[i>>2]|0;if(j|0){k=f[b>>2]|0;l=i;m=j;a:while(1){j=m;while(1){if((f[j+16>>2]|0)>=(k|0))break;n=f[j+4>>2]|0;if(!n){o=l;break a}else j=n}m=f[j>>2]|0;if(!m){o=j;break}else l=j}if((o|0)!=(i|0)?(k|0)>=(f[o+16>>2]|0):0){p=o;q=p+20|0;u=c;return q|0}}Kl(g);f[h>>2]=f[b>>2];b=h+4|0;f[h+8>>2]=0;o=h+12|0;f[o>>2]=0;k=h+8|0;f[b>>2]=k;l=f[g>>2]|0;m=g+4|0;if((l|0)!=(m|0)){n=k;r=l;while(1){l=r+16|0;f[e>>2]=n;f[d>>2]=f[e>>2];ie(b,d,l,l)|0;l=f[r+4>>2]|0;if(!l){s=r+8|0;t=f[s>>2]|0;if((f[t>>2]|0)==(r|0))v=t;else{t=s;do{s=f[t>>2]|0;t=s+8|0;w=f[t>>2]|0}while((f[w>>2]|0)!=(s|0));v=w}}else{t=l;while(1){j=f[t>>2]|0;if(!j)break;else t=j}v=t}if((v|0)==(m|0))break;else r=v}}v=a+12|0;r=f[i>>2]|0;do if(r){d=f[h>>2]|0;e=r;n=a+16|0;while(1){l=f[e+16>>2]|0;if((d|0)<(l|0)){j=f[e>>2]|0;if(!j){x=23;break}else{y=j;z=e}}else{if((l|0)>=(d|0)){x=27;break}A=e+4|0;l=f[A>>2]|0;if(!l){x=26;break}else{y=l;z=A}}e=y;n=z}if((x|0)==23){B=e;C=e;break}else if((x|0)==26){B=e;C=A;break}else if((x|0)==27){B=e;C=n;break}}else{B=i;C=i}while(0);i=f[C>>2]|0;if(!i){x=dj(32)|0;f[x+16>>2]=f[h>>2];A=x+20|0;f[A>>2]=f[b>>2];z=x+24|0;y=f[h+8>>2]|0;f[z>>2]=y;r=f[o>>2]|0;f[x+28>>2]=r;if(!r)f[A>>2]=z;else{f[y+8>>2]=z;f[b>>2]=k;f[k>>2]=0;f[o>>2]=0}f[x>>2]=0;f[x+4>>2]=0;f[x+8>>2]=B;f[C>>2]=x;B=f[f[v>>2]>>2]|0;if(!B)D=x;else{f[v>>2]=B;D=f[C>>2]|0}Gc(f[a+16>>2]|0,D);D=a+20|0;f[D>>2]=(f[D>>2]|0)+1;E=x}else E=i;fg(h+4|0,f[k>>2]|0);fg(g,f[m>>2]|0);p=E;q=p+20|0;u=c;return q|0}function Rb(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;d=b[c+11>>0]|0;e=d<<24>>24<0;g=e?f[c>>2]|0:c;i=e?f[c+4>>2]|0:d&255;if(i>>>0>3){d=g;c=i;e=i;while(1){j=X(h[d>>0]|h[d+1>>0]<<8|h[d+2>>0]<<16|h[d+3>>0]<<24,1540483477)|0;c=(X(j>>>24^j,1540483477)|0)^(X(c,1540483477)|0);e=e+-4|0;if(e>>>0<=3)break;else d=d+4|0}d=i+-4|0;e=d&-4;k=g+(e+4)|0;l=c;m=d-e|0}else{k=g;l=i;m=i}switch(m|0){case 3:{n=h[k+2>>0]<<16^l;o=6;break}case 2:{n=l;o=6;break}case 1:{p=l;o=7;break}default:q=l}if((o|0)==6){p=h[k+1>>0]<<8^n;o=7}if((o|0)==7)q=X(h[k>>0]^p,1540483477)|0;p=X(q>>>13^q,1540483477)|0;q=p>>>15^p;p=f[a+4>>2]|0;if(!p){r=0;return r|0}k=p+-1|0;n=(k&p|0)==0;if(!n)if(q>>>0

>>0)s=q;else s=(q>>>0)%(p>>>0)|0;else s=q&k;l=f[(f[a>>2]|0)+(s<<2)>>2]|0;if(!l){r=0;return r|0}a=f[l>>2]|0;if(!a){r=0;return r|0}l=(i|0)==0;if(n){n=a;a:while(1){m=f[n+4>>2]|0;e=(q|0)==(m|0);if(!(e|(m&k|0)==(s|0))){r=0;o=41;break}do if(e?(m=n+8|0,d=b[m+11>>0]|0,c=d<<24>>24<0,j=d&255,((c?f[n+12>>2]|0:j)|0)==(i|0)):0){d=f[m>>2]|0;t=c?d:m;if(c){if(l){r=n;o=41;break a}if(!(mh(t,g,i)|0)){r=n;o=41;break a}else break}if(l){r=n;o=41;break a}if((d&255)<<24>>24==(b[g>>0]|0)){d=j;j=m;m=g;do{d=d+-1|0;j=j+1|0;if(!d){r=n;o=41;break a}m=m+1|0}while((b[j>>0]|0)==(b[m>>0]|0))}}while(0);n=f[n>>2]|0;if(!n){r=0;o=41;break}}if((o|0)==41)return r|0}else u=a;b:while(1){a=f[u+4>>2]|0;n=(q|0)==(a|0);if(!n){if(a>>>0

>>0)v=a;else v=(a>>>0)%(p>>>0)|0;if((v|0)!=(s|0)){r=0;o=41;break}if(n)o=33}else o=33;do if((o|0)==33?(o=0,n=u+8|0,a=b[n+11>>0]|0,k=a<<24>>24<0,e=a&255,((k?f[u+12>>2]|0:e)|0)==(i|0)):0){a=f[n>>2]|0;m=k?a:n;if(k){if(l){r=u;o=41;break b}if(!(mh(m,g,i)|0)){r=u;o=41;break b}else break}if(l){r=u;o=41;break b}if((a&255)<<24>>24==(b[g>>0]|0)){a=e;e=n;n=g;do{a=a+-1|0;e=e+1|0;if(!a){r=u;o=41;break b}n=n+1|0}while((b[e>>0]|0)==(b[n>>0]|0))}}while(0);u=f[u>>2]|0;if(!u){r=0;o=41;break}}if((o|0)==41)return r|0;return 0}function Sb(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;e=u;u=u+64|0;g=e;i=e+8|0;j=i;k=j+52|0;do{f[j>>2]=0;j=j+4|0}while((j|0)<(k|0));a:do if(Lc(i,c)|0){j=(a|0)==0;if(!j?(f[i+12>>2]|0)==0:0){l=0;break}if(Gf(g,c)|0?(k=g,m=f[k>>2]|0,n=f[k+4>>2]|0,k=c+8|0,o=c+16|0,p=o,q=f[p>>2]|0,r=f[p+4>>2]|0,p=Vj(f[k>>2]|0,f[k+4>>2]|0,q|0,r|0)|0,k=I,!(n>>>0>k>>>0|(n|0)==(k|0)&m>>>0>p>>>0)):0){p=(f[c>>2]|0)+q|0;k=Tj(q|0,r|0,m|0,n|0)|0;n=o;f[n>>2]=k;f[n+4>>2]=I;b:do if((m|0)>=1){f[i+40>>2]=p;n=m+-1|0;k=p+n|0;switch((h[k>>0]|0)>>>6&3){case 0:{f[i+44>>2]=n;s=n;t=b[k>>0]&63;break}case 1:{if((m|0)<2)break b;k=m+-2|0;f[i+44>>2]=k;n=p+m+-2|0;s=k;t=(h[n+1>>0]|0)<<8&16128|(h[n>>0]|0);break}case 2:{if((m|0)<3)break b;n=m+-3|0;f[i+44>>2]=n;k=p+m+-3|0;s=n;t=(h[k+1>>0]|0)<<8|(h[k>>0]|0)|(h[k+2>>0]|0)<<16&4128768;break}case 3:{k=m+-4|0;f[i+44>>2]=k;n=p+m+-4|0;s=k;t=(h[n+2>>0]|0)<<16|(h[n+3>>0]|0)<<24&1056964608|(h[n+1>>0]|0)<<8|(h[n>>0]|0);break}default:{}}n=i+48|0;k=t+4194304|0;f[n>>2]=k;o=k>>>0>1073741823;if(o|j){l=o^1;break a}o=i+44|0;r=i+16|0;q=i+28|0;v=s;w=k;k=0;while(1){c:do if(w>>>0<4194304){x=v;y=w;while(1){if((x|0)<=0){z=y;A=x;break c}B=x+-1|0;f[o>>2]=B;C=h[p+B>>0]|0|y<<8;f[n>>2]=C;if(C>>>0<4194304){x=B;y=C}else{z=C;A=B;break}}}else{z=w;A=v}while(0);y=z&1048575;x=f[(f[r>>2]|0)+(y<<2)>>2]|0;B=f[q>>2]|0;w=(X(f[B+(x<<3)>>2]|0,z>>>20)|0)+y-(f[B+(x<<3)+4>>2]|0)|0;f[n>>2]=w;f[d+(k<<2)>>2]=x;k=k+1|0;if((k|0)==(a|0)){l=1;break a}else v=A}}while(0);l=0;break}l=0}else l=0;while(0);A=f[i+28>>2]|0;if(A|0){a=i+32|0;d=f[a>>2]|0;if((d|0)!=(A|0))f[a>>2]=d+(~((d+-8-A|0)>>>3)<<3);fn(A)}A=f[i+16>>2]|0;if(A|0){d=i+20|0;a=f[d>>2]|0;if((a|0)!=(A|0))f[d>>2]=a+(~((a+-4-A|0)>>>2)<<2);fn(A)}A=f[i>>2]|0;if(!A){u=e;return l|0}a=i+4|0;i=f[a>>2]|0;if((i|0)!=(A|0))f[a>>2]=i+(~((i+-4-A|0)>>>2)<<2);fn(A);u=e;return l|0}function Tb(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;d=b[c+11>>0]|0;e=d<<24>>24<0;g=e?f[c>>2]|0:c;i=e?f[c+4>>2]|0:d&255;if(i>>>0>3){d=g;c=i;e=i;while(1){j=X(h[d>>0]|h[d+1>>0]<<8|h[d+2>>0]<<16|h[d+3>>0]<<24,1540483477)|0;c=(X(j>>>24^j,1540483477)|0)^(X(c,1540483477)|0);e=e+-4|0;if(e>>>0<=3)break;else d=d+4|0}d=i+-4|0;e=d&-4;k=g+(e+4)|0;l=c;m=d-e|0}else{k=g;l=i;m=i}switch(m|0){case 3:{n=h[k+2>>0]<<16^l;o=6;break}case 2:{n=l;o=6;break}case 1:{p=l;o=7;break}default:q=l}if((o|0)==6){p=h[k+1>>0]<<8^n;o=7}if((o|0)==7)q=X(h[k>>0]^p,1540483477)|0;p=X(q>>>13^q,1540483477)|0;q=p>>>15^p;p=f[a+4>>2]|0;if(!p){r=0;return r|0}k=p+-1|0;n=(k&p|0)==0;if(!n)if(q>>>0

>>0)s=q;else s=(q>>>0)%(p>>>0)|0;else s=q&k;l=f[(f[a>>2]|0)+(s<<2)>>2]|0;if(!l){r=0;return r|0}a=f[l>>2]|0;if(!a){r=0;return r|0}l=(i|0)==0;if(n){n=a;a:while(1){m=f[n+4>>2]|0;e=(m|0)==(q|0);if(!(e|(m&k|0)==(s|0))){r=0;o=41;break}do if(e?(m=n+8|0,d=b[m+11>>0]|0,c=d<<24>>24<0,j=d&255,((c?f[n+12>>2]|0:j)|0)==(i|0)):0){d=f[m>>2]|0;t=c?d:m;if(c){if(l){r=n;o=41;break a}if(!(mh(t,g,i)|0)){r=n;o=41;break a}else break}if(l){r=n;o=41;break a}if((d&255)<<24>>24==(b[g>>0]|0)){d=j;j=m;m=g;do{d=d+-1|0;j=j+1|0;if(!d){r=n;o=41;break a}m=m+1|0}while((b[j>>0]|0)==(b[m>>0]|0))}}while(0);n=f[n>>2]|0;if(!n){r=0;o=41;break}}if((o|0)==41)return r|0}else u=a;b:while(1){a=f[u+4>>2]|0;n=(a|0)==(q|0);if(!n){if(a>>>0

>>0)v=a;else v=(a>>>0)%(p>>>0)|0;if((v|0)!=(s|0)){r=0;o=41;break}if(n)o=33}else o=33;do if((o|0)==33?(o=0,n=u+8|0,a=b[n+11>>0]|0,k=a<<24>>24<0,e=a&255,((k?f[u+12>>2]|0:e)|0)==(i|0)):0){a=f[n>>2]|0;m=k?a:n;if(k){if(l){r=u;o=41;break b}if(!(mh(m,g,i)|0)){r=u;o=41;break b}else break}if(l){r=u;o=41;break b}if((a&255)<<24>>24==(b[g>>0]|0)){a=e;e=n;n=g;do{a=a+-1|0;e=e+1|0;if(!a){r=u;o=41;break b}n=n+1|0}while((b[e>>0]|0)==(b[n>>0]|0))}}while(0);u=f[u>>2]|0;if(!u){r=0;o=41;break}}if((o|0)==41)return r|0;return 0}function Ub(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;e=u;u=u+64|0;g=e;i=e+8|0;j=i;k=j+52|0;do{f[j>>2]=0;j=j+4|0}while((j|0)<(k|0));a:do if(Mc(i,c)|0){j=(a|0)==0;if(!j?(f[i+12>>2]|0)==0:0){l=0;break}if(Gf(g,c)|0?(k=g,m=f[k>>2]|0,n=f[k+4>>2]|0,k=c+8|0,o=c+16|0,p=o,q=f[p>>2]|0,r=f[p+4>>2]|0,p=Vj(f[k>>2]|0,f[k+4>>2]|0,q|0,r|0)|0,k=I,!(n>>>0>k>>>0|(n|0)==(k|0)&m>>>0>p>>>0)):0){p=(f[c>>2]|0)+q|0;k=Tj(q|0,r|0,m|0,n|0)|0;n=o;f[n>>2]=k;f[n+4>>2]=I;b:do if((m|0)>=1){f[i+40>>2]=p;n=m+-1|0;k=p+n|0;switch((h[k>>0]|0)>>>6&3){case 0:{f[i+44>>2]=n;s=n;t=b[k>>0]&63;break}case 1:{if((m|0)<2)break b;k=m+-2|0;f[i+44>>2]=k;n=p+m+-2|0;s=k;t=(h[n+1>>0]|0)<<8&16128|(h[n>>0]|0);break}case 2:{if((m|0)<3)break b;n=m+-3|0;f[i+44>>2]=n;k=p+m+-3|0;s=n;t=(h[k+1>>0]|0)<<8|(h[k>>0]|0)|(h[k+2>>0]|0)<<16&4128768;break}case 3:{k=m+-4|0;f[i+44>>2]=k;n=p+m+-4|0;s=k;t=(h[n+2>>0]|0)<<16|(h[n+3>>0]|0)<<24&1056964608|(h[n+1>>0]|0)<<8|(h[n>>0]|0);break}default:{}}n=i+48|0;k=t+2097152|0;f[n>>2]=k;o=k>>>0>536870911;if(o|j){l=o^1;break a}o=i+44|0;r=i+16|0;q=i+28|0;v=s;w=k;k=0;while(1){c:do if(w>>>0<2097152){x=v;y=w;while(1){if((x|0)<=0){z=y;A=x;break c}B=x+-1|0;f[o>>2]=B;C=h[p+B>>0]|0|y<<8;f[n>>2]=C;if(C>>>0<2097152){x=B;y=C}else{z=C;A=B;break}}}else{z=w;A=v}while(0);y=z&524287;x=f[(f[r>>2]|0)+(y<<2)>>2]|0;B=f[q>>2]|0;w=(X(f[B+(x<<3)>>2]|0,z>>>19)|0)+y-(f[B+(x<<3)+4>>2]|0)|0;f[n>>2]=w;f[d+(k<<2)>>2]=x;k=k+1|0;if((k|0)==(a|0)){l=1;break a}else v=A}}while(0);l=0;break}l=0}else l=0;while(0);A=f[i+28>>2]|0;if(A|0){a=i+32|0;d=f[a>>2]|0;if((d|0)!=(A|0))f[a>>2]=d+(~((d+-8-A|0)>>>3)<<3);fn(A)}A=f[i+16>>2]|0;if(A|0){d=i+20|0;a=f[d>>2]|0;if((a|0)!=(A|0))f[d>>2]=a+(~((a+-4-A|0)>>>2)<<2);fn(A)}A=f[i>>2]|0;if(!A){u=e;return l|0}a=i+4|0;i=f[a>>2]|0;if((i|0)!=(A|0))f[a>>2]=i+(~((i+-4-A|0)>>>2)<<2);fn(A);u=e;return l|0}function Vb(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;e=u;u=u+64|0;g=e;i=e+8|0;j=i;k=j+52|0;do{f[j>>2]=0;j=j+4|0}while((j|0)<(k|0));a:do if(Nc(i,c)|0){j=(a|0)==0;if(!j?(f[i+12>>2]|0)==0:0){l=0;break}if(Gf(g,c)|0?(k=g,m=f[k>>2]|0,n=f[k+4>>2]|0,k=c+8|0,o=c+16|0,p=o,q=f[p>>2]|0,r=f[p+4>>2]|0,p=Vj(f[k>>2]|0,f[k+4>>2]|0,q|0,r|0)|0,k=I,!(n>>>0>k>>>0|(n|0)==(k|0)&m>>>0>p>>>0)):0){p=(f[c>>2]|0)+q|0;k=Tj(q|0,r|0,m|0,n|0)|0;n=o;f[n>>2]=k;f[n+4>>2]=I;b:do if((m|0)>=1){f[i+40>>2]=p;n=m+-1|0;k=p+n|0;switch((h[k>>0]|0)>>>6&3){case 0:{f[i+44>>2]=n;s=n;t=b[k>>0]&63;break}case 1:{if((m|0)<2)break b;k=m+-2|0;f[i+44>>2]=k;n=p+m+-2|0;s=k;t=(h[n+1>>0]|0)<<8&16128|(h[n>>0]|0);break}case 2:{if((m|0)<3)break b;n=m+-3|0;f[i+44>>2]=n;k=p+m+-3|0;s=n;t=(h[k+1>>0]|0)<<8|(h[k>>0]|0)|(h[k+2>>0]|0)<<16&4128768;break}case 3:{k=m+-4|0;f[i+44>>2]=k;n=p+m+-4|0;s=k;t=(h[n+2>>0]|0)<<16|(h[n+3>>0]|0)<<24&1056964608|(h[n+1>>0]|0)<<8|(h[n>>0]|0);break}default:{}}n=i+48|0;k=t+1048576|0;f[n>>2]=k;o=k>>>0>268435455;if(o|j){l=o^1;break a}o=i+44|0;r=i+16|0;q=i+28|0;v=s;w=k;k=0;while(1){c:do if(w>>>0<1048576){x=v;y=w;while(1){if((x|0)<=0){z=y;A=x;break c}B=x+-1|0;f[o>>2]=B;C=h[p+B>>0]|0|y<<8;f[n>>2]=C;if(C>>>0<1048576){x=B;y=C}else{z=C;A=B;break}}}else{z=w;A=v}while(0);y=z&262143;x=f[(f[r>>2]|0)+(y<<2)>>2]|0;B=f[q>>2]|0;w=(X(f[B+(x<<3)>>2]|0,z>>>18)|0)+y-(f[B+(x<<3)+4>>2]|0)|0;f[n>>2]=w;f[d+(k<<2)>>2]=x;k=k+1|0;if((k|0)==(a|0)){l=1;break a}else v=A}}while(0);l=0;break}l=0}else l=0;while(0);A=f[i+28>>2]|0;if(A|0){a=i+32|0;d=f[a>>2]|0;if((d|0)!=(A|0))f[a>>2]=d+(~((d+-8-A|0)>>>3)<<3);fn(A)}A=f[i+16>>2]|0;if(A|0){d=i+20|0;a=f[d>>2]|0;if((a|0)!=(A|0))f[d>>2]=a+(~((a+-4-A|0)>>>2)<<2);fn(A)}A=f[i>>2]|0;if(!A){u=e;return l|0}a=i+4|0;i=f[a>>2]|0;if((i|0)!=(A|0))f[a>>2]=i+(~((i+-4-A|0)>>>2)<<2);fn(A);u=e;return l|0}function Wb(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;e=u;u=u+64|0;g=e;i=e+8|0;j=i;k=j+52|0;do{f[j>>2]=0;j=j+4|0}while((j|0)<(k|0));a:do if(Oc(i,c)|0){j=(a|0)==0;if(!j?(f[i+12>>2]|0)==0:0){l=0;break}if(Gf(g,c)|0?(k=g,m=f[k>>2]|0,n=f[k+4>>2]|0,k=c+8|0,o=c+16|0,p=o,q=f[p>>2]|0,r=f[p+4>>2]|0,p=Vj(f[k>>2]|0,f[k+4>>2]|0,q|0,r|0)|0,k=I,!(n>>>0>k>>>0|(n|0)==(k|0)&m>>>0>p>>>0)):0){p=(f[c>>2]|0)+q|0;k=Tj(q|0,r|0,m|0,n|0)|0;n=o;f[n>>2]=k;f[n+4>>2]=I;b:do if((m|0)>=1){f[i+40>>2]=p;n=m+-1|0;k=p+n|0;switch((h[k>>0]|0)>>>6&3){case 0:{f[i+44>>2]=n;s=n;t=b[k>>0]&63;break}case 1:{if((m|0)<2)break b;k=m+-2|0;f[i+44>>2]=k;n=p+m+-2|0;s=k;t=(h[n+1>>0]|0)<<8&16128|(h[n>>0]|0);break}case 2:{if((m|0)<3)break b;n=m+-3|0;f[i+44>>2]=n;k=p+m+-3|0;s=n;t=(h[k+1>>0]|0)<<8|(h[k>>0]|0)|(h[k+2>>0]|0)<<16&4128768;break}case 3:{k=m+-4|0;f[i+44>>2]=k;n=p+m+-4|0;s=k;t=(h[n+2>>0]|0)<<16|(h[n+3>>0]|0)<<24&1056964608|(h[n+1>>0]|0)<<8|(h[n>>0]|0);break}default:{}}n=i+48|0;k=t+262144|0;f[n>>2]=k;o=k>>>0>67108863;if(o|j){l=o^1;break a}o=i+44|0;r=i+16|0;q=i+28|0;v=s;w=k;k=0;while(1){c:do if(w>>>0<262144){x=v;y=w;while(1){if((x|0)<=0){z=y;A=x;break c}B=x+-1|0;f[o>>2]=B;C=h[p+B>>0]|0|y<<8;f[n>>2]=C;if(C>>>0<262144){x=B;y=C}else{z=C;A=B;break}}}else{z=w;A=v}while(0);y=z&65535;x=f[(f[r>>2]|0)+(y<<2)>>2]|0;B=f[q>>2]|0;w=(X(f[B+(x<<3)>>2]|0,z>>>16)|0)+y-(f[B+(x<<3)+4>>2]|0)|0;f[n>>2]=w;f[d+(k<<2)>>2]=x;k=k+1|0;if((k|0)==(a|0)){l=1;break a}else v=A}}while(0);l=0;break}l=0}else l=0;while(0);A=f[i+28>>2]|0;if(A|0){a=i+32|0;d=f[a>>2]|0;if((d|0)!=(A|0))f[a>>2]=d+(~((d+-8-A|0)>>>3)<<3);fn(A)}A=f[i+16>>2]|0;if(A|0){d=i+20|0;a=f[d>>2]|0;if((a|0)!=(A|0))f[d>>2]=a+(~((a+-4-A|0)>>>2)<<2);fn(A)}A=f[i>>2]|0;if(!A){u=e;return l|0}a=i+4|0;i=f[a>>2]|0;if((i|0)!=(A|0))f[a>>2]=i+(~((i+-4-A|0)>>>2)<<2);fn(A);u=e;return l|0}function Xb(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;e=u;u=u+64|0;g=e;i=e+8|0;j=i;k=j+52|0;do{f[j>>2]=0;j=j+4|0}while((j|0)<(k|0));a:do if(Pc(i,c)|0){j=(a|0)==0;if(!j?(f[i+12>>2]|0)==0:0){l=0;break}if(Gf(g,c)|0?(k=g,m=f[k>>2]|0,n=f[k+4>>2]|0,k=c+8|0,o=c+16|0,p=o,q=f[p>>2]|0,r=f[p+4>>2]|0,p=Vj(f[k>>2]|0,f[k+4>>2]|0,q|0,r|0)|0,k=I,!(n>>>0>k>>>0|(n|0)==(k|0)&m>>>0>p>>>0)):0){p=(f[c>>2]|0)+q|0;k=Tj(q|0,r|0,m|0,n|0)|0;n=o;f[n>>2]=k;f[n+4>>2]=I;b:do if((m|0)>=1){f[i+40>>2]=p;n=m+-1|0;k=p+n|0;switch((h[k>>0]|0)>>>6&3){case 0:{f[i+44>>2]=n;s=n;t=b[k>>0]&63;break}case 1:{if((m|0)<2)break b;k=m+-2|0;f[i+44>>2]=k;n=p+m+-2|0;s=k;t=(h[n+1>>0]|0)<<8&16128|(h[n>>0]|0);break}case 2:{if((m|0)<3)break b;n=m+-3|0;f[i+44>>2]=n;k=p+m+-3|0;s=n;t=(h[k+1>>0]|0)<<8|(h[k>>0]|0)|(h[k+2>>0]|0)<<16&4128768;break}case 3:{k=m+-4|0;f[i+44>>2]=k;n=p+m+-4|0;s=k;t=(h[n+2>>0]|0)<<16|(h[n+3>>0]|0)<<24&1056964608|(h[n+1>>0]|0)<<8|(h[n>>0]|0);break}default:{}}n=i+48|0;k=t+131072|0;f[n>>2]=k;o=k>>>0>33554431;if(o|j){l=o^1;break a}o=i+44|0;r=i+16|0;q=i+28|0;v=s;w=k;k=0;while(1){c:do if(w>>>0<131072){x=v;y=w;while(1){if((x|0)<=0){z=y;A=x;break c}B=x+-1|0;f[o>>2]=B;C=h[p+B>>0]|0|y<<8;f[n>>2]=C;if(C>>>0<131072){x=B;y=C}else{z=C;A=B;break}}}else{z=w;A=v}while(0);y=z&32767;x=f[(f[r>>2]|0)+(y<<2)>>2]|0;B=f[q>>2]|0;w=(X(f[B+(x<<3)>>2]|0,z>>>15)|0)+y-(f[B+(x<<3)+4>>2]|0)|0;f[n>>2]=w;f[d+(k<<2)>>2]=x;k=k+1|0;if((k|0)==(a|0)){l=1;break a}else v=A}}while(0);l=0;break}l=0}else l=0;while(0);A=f[i+28>>2]|0;if(A|0){a=i+32|0;d=f[a>>2]|0;if((d|0)!=(A|0))f[a>>2]=d+(~((d+-8-A|0)>>>3)<<3);fn(A)}A=f[i+16>>2]|0;if(A|0){d=i+20|0;a=f[d>>2]|0;if((a|0)!=(A|0))f[d>>2]=a+(~((a+-4-A|0)>>>2)<<2);fn(A)}A=f[i>>2]|0;if(!A){u=e;return l|0}a=i+4|0;i=f[a>>2]|0;if((i|0)!=(A|0))f[a>>2]=i+(~((i+-4-A|0)>>>2)<<2);fn(A);u=e;return l|0}function Yb(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;e=u;u=u+64|0;g=e;i=e+8|0;j=i;k=j+52|0;do{f[j>>2]=0;j=j+4|0}while((j|0)<(k|0));a:do if(Qc(i,c)|0){j=(a|0)==0;if(!j?(f[i+12>>2]|0)==0:0){l=0;break}if(Gf(g,c)|0?(k=g,m=f[k>>2]|0,n=f[k+4>>2]|0,k=c+8|0,o=c+16|0,p=o,q=f[p>>2]|0,r=f[p+4>>2]|0,p=Vj(f[k>>2]|0,f[k+4>>2]|0,q|0,r|0)|0,k=I,!(n>>>0>k>>>0|(n|0)==(k|0)&m>>>0>p>>>0)):0){p=(f[c>>2]|0)+q|0;k=Tj(q|0,r|0,m|0,n|0)|0;n=o;f[n>>2]=k;f[n+4>>2]=I;b:do if((m|0)>=1){f[i+40>>2]=p;n=m+-1|0;k=p+n|0;switch((h[k>>0]|0)>>>6&3){case 0:{f[i+44>>2]=n;s=n;t=b[k>>0]&63;break}case 1:{if((m|0)<2)break b;k=m+-2|0;f[i+44>>2]=k;n=p+m+-2|0;s=k;t=(h[n+1>>0]|0)<<8&16128|(h[n>>0]|0);break}case 2:{if((m|0)<3)break b;n=m+-3|0;f[i+44>>2]=n;k=p+m+-3|0;s=n;t=(h[k+1>>0]|0)<<8|(h[k>>0]|0)|(h[k+2>>0]|0)<<16&4128768;break}case 3:{k=m+-4|0;f[i+44>>2]=k;n=p+m+-4|0;s=k;t=(h[n+2>>0]|0)<<16|(h[n+3>>0]|0)<<24&1056964608|(h[n+1>>0]|0)<<8|(h[n>>0]|0);break}default:{}}n=i+48|0;k=t+32768|0;f[n>>2]=k;o=k>>>0>8388607;if(o|j){l=o^1;break a}o=i+44|0;r=i+16|0;q=i+28|0;v=s;w=k;k=0;while(1){c:do if(w>>>0<32768){x=v;y=w;while(1){if((x|0)<=0){z=y;A=x;break c}B=x+-1|0;f[o>>2]=B;C=h[p+B>>0]|0|y<<8;f[n>>2]=C;if(C>>>0<32768){x=B;y=C}else{z=C;A=B;break}}}else{z=w;A=v}while(0);y=z&8191;x=f[(f[r>>2]|0)+(y<<2)>>2]|0;B=f[q>>2]|0;w=(X(f[B+(x<<3)>>2]|0,z>>>13)|0)+y-(f[B+(x<<3)+4>>2]|0)|0;f[n>>2]=w;f[d+(k<<2)>>2]=x;k=k+1|0;if((k|0)==(a|0)){l=1;break a}else v=A}}while(0);l=0;break}l=0}else l=0;while(0);A=f[i+28>>2]|0;if(A|0){a=i+32|0;d=f[a>>2]|0;if((d|0)!=(A|0))f[a>>2]=d+(~((d+-8-A|0)>>>3)<<3);fn(A)}A=f[i+16>>2]|0;if(A|0){d=i+20|0;a=f[d>>2]|0;if((a|0)!=(A|0))f[d>>2]=a+(~((a+-4-A|0)>>>2)<<2);fn(A)}A=f[i>>2]|0;if(!A){u=e;return l|0}a=i+4|0;i=f[a>>2]|0;if((i|0)!=(A|0))f[a>>2]=i+(~((i+-4-A|0)>>>2)<<2);fn(A);u=e;return l|0}function Zb(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;e=u;u=u+64|0;g=e;i=e+8|0;j=i;k=j+52|0;do{f[j>>2]=0;j=j+4|0}while((j|0)<(k|0));a:do if(Rc(i,c)|0){j=(a|0)==0;if(!j?(f[i+12>>2]|0)==0:0){l=0;break}if(Gf(g,c)|0?(k=g,m=f[k>>2]|0,n=f[k+4>>2]|0,k=c+8|0,o=c+16|0,p=o,q=f[p>>2]|0,r=f[p+4>>2]|0,p=Vj(f[k>>2]|0,f[k+4>>2]|0,q|0,r|0)|0,k=I,!(n>>>0>k>>>0|(n|0)==(k|0)&m>>>0>p>>>0)):0){p=(f[c>>2]|0)+q|0;k=Tj(q|0,r|0,m|0,n|0)|0;n=o;f[n>>2]=k;f[n+4>>2]=I;b:do if((m|0)>=1){f[i+40>>2]=p;n=m+-1|0;k=p+n|0;switch((h[k>>0]|0)>>>6&3){case 0:{f[i+44>>2]=n;s=n;t=b[k>>0]&63;break}case 1:{if((m|0)<2)break b;k=m+-2|0;f[i+44>>2]=k;n=p+m+-2|0;s=k;t=(h[n+1>>0]|0)<<8&16128|(h[n>>0]|0);break}case 2:{if((m|0)<3)break b;n=m+-3|0;f[i+44>>2]=n;k=p+m+-3|0;s=n;t=(h[k+1>>0]|0)<<8|(h[k>>0]|0)|(h[k+2>>0]|0)<<16&4128768;break}case 3:{k=m+-4|0;f[i+44>>2]=k;n=p+m+-4|0;s=k;t=(h[n+2>>0]|0)<<16|(h[n+3>>0]|0)<<24&1056964608|(h[n+1>>0]|0)<<8|(h[n>>0]|0);break}default:{}}n=i+48|0;k=t+16384|0;f[n>>2]=k;o=k>>>0>4194303;if(o|j){l=o^1;break a}o=i+44|0;r=i+16|0;q=i+28|0;v=s;w=k;k=0;while(1){c:do if(w>>>0<16384){x=v;y=w;while(1){if((x|0)<=0){z=y;A=x;break c}B=x+-1|0;f[o>>2]=B;C=h[p+B>>0]|0|y<<8;f[n>>2]=C;if(C>>>0<16384){x=B;y=C}else{z=C;A=B;break}}}else{z=w;A=v}while(0);y=z&4095;x=f[(f[r>>2]|0)+(y<<2)>>2]|0;B=f[q>>2]|0;w=(X(f[B+(x<<3)>>2]|0,z>>>12)|0)+y-(f[B+(x<<3)+4>>2]|0)|0;f[n>>2]=w;f[d+(k<<2)>>2]=x;k=k+1|0;if((k|0)==(a|0)){l=1;break a}else v=A}}while(0);l=0;break}l=0}else l=0;while(0);A=f[i+28>>2]|0;if(A|0){a=i+32|0;d=f[a>>2]|0;if((d|0)!=(A|0))f[a>>2]=d+(~((d+-8-A|0)>>>3)<<3);fn(A)}A=f[i+16>>2]|0;if(A|0){d=i+20|0;a=f[d>>2]|0;if((a|0)!=(A|0))f[d>>2]=a+(~((a+-4-A|0)>>>2)<<2);fn(A)}A=f[i>>2]|0;if(!A){u=e;return l|0}a=i+4|0;i=f[a>>2]|0;if((i|0)!=(A|0))f[a>>2]=i+(~((i+-4-A|0)>>>2)<<2);fn(A);u=e;return l|0}function _b(a,c,d,e,g){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;h=a+4|0;i=f[c>>2]|0;c=i;do if((i|0)!=(h|0)){j=i+16|0;k=b[j+11>>0]|0;l=k<<24>>24<0;m=l?f[i+20>>2]|0:k&255;k=b[g+11>>0]|0;n=k<<24>>24<0;o=n?f[g+4>>2]|0:k&255;k=m>>>0>>0;p=k?m:o;if((p|0)!=0?(q=mh(n?f[g>>2]|0:g,l?f[j>>2]|0:j,p)|0,(q|0)!=0):0){if((q|0)<0)break}else r=4;if((r|0)==4?o>>>0>>0:0)break;q=o>>>0>>0?o:m;if((q|0)!=0?(m=mh(l?f[j>>2]|0:j,n?f[g>>2]|0:g,q)|0,(m|0)!=0):0){if((m|0)>=0)r=36}else r=20;if((r|0)==20?!k:0)r=36;if((r|0)==36){f[d>>2]=c;f[e>>2]=c;s=e;return s|0}k=i+4|0;m=f[k>>2]|0;if(!m){q=i+8|0;j=f[q>>2]|0;if((f[j>>2]|0)==(i|0))t=j;else{j=q;do{q=f[j>>2]|0;j=q+8|0;l=f[j>>2]|0}while((f[l>>2]|0)!=(q|0));t=l}}else{j=m;while(1){l=f[j>>2]|0;if(!l)break;else j=l}t=j}do if((t|0)!=(h|0)){m=t+16|0;l=b[m+11>>0]|0;q=l<<24>>24<0;p=q?f[t+20>>2]|0:l&255;l=p>>>0>>0?p:o;if((l|0)!=0?(u=mh(n?f[g>>2]|0:g,q?f[m>>2]|0:m,l)|0,(u|0)!=0):0){if((u|0)<0)break}else r=30;if((r|0)==30?o>>>0

>>0:0)break;s=Fd(a,d,g)|0;return s|0}while(0);if(!(f[i+4>>2]|0)){f[d>>2]=c;s=k;return s|0}else{f[d>>2]=t;s=t;return s|0}}while(0);t=f[i>>2]|0;do if((i|0)==(f[a>>2]|0))v=c;else{if(!t){h=i;while(1){e=f[h+8>>2]|0;if((f[e>>2]|0)==(h|0))h=e;else{w=e;break}}}else{h=t;while(1){k=f[h+4>>2]|0;if(!k){w=h;break}else h=k}}h=w;k=w+16|0;e=b[g+11>>0]|0;o=e<<24>>24<0;n=o?f[g+4>>2]|0:e&255;e=b[k+11>>0]|0;j=e<<24>>24<0;p=j?f[w+20>>2]|0:e&255;e=n>>>0

>>0?n:p;if((e|0)!=0?(u=mh(j?f[k>>2]|0:k,o?f[g>>2]|0:g,e)|0,(u|0)!=0):0){if((u|0)<0){v=h;break}}else r=12;if((r|0)==12?p>>>0>>0:0){v=h;break}s=Fd(a,d,g)|0;return s|0}while(0);if(!t){f[d>>2]=i;s=i;return s|0}else{i=v;f[d>>2]=i;s=i+4|0;return s|0}return 0}function $b(a,c,d,e){a=a|0;c=c|0;d=d|0;e=e|0;var g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;g=u;u=u+64|0;i=g;j=i;k=j+52|0;do{f[j>>2]=0;j=j+4|0}while((j|0)<(k|0));a:do if(Rc(i,d)|0?zd(i,d)|0:0){j=(a|0)==0;if(!j){if(!(f[i+12>>2]|0)){l=0;break}bh(d,0,0)|0;if(!j){j=i+44|0;k=i+48|0;m=i+40|0;n=i+16|0;o=i+28|0;p=(c|0)>0;q=d+36|0;r=d+32|0;s=d+24|0;t=d+28|0;v=f[k>>2]|0;w=0;x=0;while(1){b:do if(v>>>0<16384){y=f[j>>2]|0;z=v;while(1){if((y|0)<=0){A=z;break b}B=f[m>>2]|0;y=y+-1|0;f[j>>2]=y;C=h[B+y>>0]|z<<8;f[k>>2]=C;if(C>>>0>=16384){A=C;break}else z=C}}else A=v;while(0);z=A&4095;y=f[(f[n>>2]|0)+(z<<2)>>2]|0;C=f[o>>2]|0;v=(X(f[C+(y<<3)>>2]|0,A>>>12)|0)+z-(f[C+(y<<3)+4>>2]|0)|0;f[k>>2]=v;c:do if(p){if((y|0)>0){D=0;E=x}else{C=(b[q>>0]|0)==0;z=0;B=x;while(1){if(C){l=0;break a}F=B+1|0;f[e+(B<<2)>>2]=0;z=z+1|0;if((z|0)>=(c|0)){G=F;break c}else B=F}}while(1){if(!(b[q>>0]|0)){l=0;break a}B=f[s>>2]|0;z=f[t>>2]|0;C=f[r>>2]|0;F=0;H=0;while(1){I=B+(C>>>3)|0;if(I>>>0>>0){J=(h[I>>0]|0)>>>(C&7)&1;I=C+1|0;f[r>>2]=I;K=I;L=J}else{K=C;L=0}H=L<>2]=H;D=D+1|0;if((D|0)>=(c|0)){G=C;break}else E=C}}else G=x;while(0);w=w+c|0;if(w>>>0>=a>>>0)break;else x=G}}}else bh(d,0,0)|0;ei(d);l=1}else l=0;while(0);d=f[i+28>>2]|0;if(d|0){G=i+32|0;a=f[G>>2]|0;if((a|0)!=(d|0))f[G>>2]=a+(~((a+-8-d|0)>>>3)<<3);fn(d)}d=f[i+16>>2]|0;if(d|0){a=i+20|0;G=f[a>>2]|0;if((G|0)!=(d|0))f[a>>2]=G+(~((G+-4-d|0)>>>2)<<2);fn(d)}d=f[i>>2]|0;if(!d){u=g;return l|0}G=i+4|0;i=f[G>>2]|0;if((i|0)!=(d|0))f[G>>2]=i+(~((i+-4-d|0)>>>2)<<2);fn(d);u=g;return l|0}function ac(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;g=a;h=b;i=h;j=c;k=d;l=k;if(!i){m=(e|0)!=0;if(!l){if(m){f[e>>2]=(g>>>0)%(j>>>0);f[e+4>>2]=0}n=0;o=(g>>>0)/(j>>>0)>>>0;return (I=n,o)|0}else{if(!m){n=0;o=0;return (I=n,o)|0}f[e>>2]=a|0;f[e+4>>2]=b&0;n=0;o=0;return (I=n,o)|0}}m=(l|0)==0;do if(j){if(!m){p=(_(l|0)|0)-(_(i|0)|0)|0;if(p>>>0<=31){q=p+1|0;r=31-p|0;s=p-31>>31;t=q;u=g>>>(q>>>0)&s|i<>>(q>>>0)&s;w=0;x=g<>2]=a|0;f[e+4>>2]=h|b&0;n=0;o=0;return (I=n,o)|0}r=j-1|0;if(r&j|0){s=(_(j|0)|0)+33-(_(i|0)|0)|0;q=64-s|0;p=32-s|0;y=p>>31;z=s-32|0;A=z>>31;t=s;u=p-1>>31&i>>>(z>>>0)|(i<>>(s>>>0))&A;v=A&i>>>(s>>>0);w=g<>>(z>>>0))&y|g<>31;break}if(e|0){f[e>>2]=r&g;f[e+4>>2]=0}if((j|0)==1){n=h|b&0;o=a|0|0;return (I=n,o)|0}else{r=Ai(j|0)|0;n=i>>>(r>>>0)|0;o=i<<32-r|g>>>(r>>>0)|0;return (I=n,o)|0}}else{if(m){if(e|0){f[e>>2]=(i>>>0)%(j>>>0);f[e+4>>2]=0}n=0;o=(i>>>0)/(j>>>0)>>>0;return (I=n,o)|0}if(!g){if(e|0){f[e>>2]=0;f[e+4>>2]=(i>>>0)%(l>>>0)}n=0;o=(i>>>0)/(l>>>0)>>>0;return (I=n,o)|0}r=l-1|0;if(!(r&l)){if(e|0){f[e>>2]=a|0;f[e+4>>2]=r&i|b&0}n=0;o=i>>>((Ai(l|0)|0)>>>0);return (I=n,o)|0}r=(_(l|0)|0)-(_(i|0)|0)|0;if(r>>>0<=30){s=r+1|0;p=31-r|0;t=s;u=i<>>(s>>>0);v=i>>>(s>>>0);w=0;x=g<>2]=a|0;f[e+4>>2]=h|b&0;n=0;o=0;return (I=n,o)|0}while(0);if(!t){B=x;C=w;D=v;E=u;F=0;G=0}else{b=c|0|0;c=k|d&0;d=Tj(b|0,c|0,-1,-1)|0;k=I;h=x;x=w;w=v;v=u;u=t;t=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;else v=(m|0)>0?(n>>31)+2|0:(n|0)<1?0:3;if(u){w=m;x=n;y=1}else{switch(v|0){case 1:{z=n;A=0-m|0;break}case 2:{z=0-m|0;A=0-n|0;break}case 3:{z=0-n|0;A=m;break}default:{z=m;A=n}}n=c;f[n>>2]=z;f[n+4>>2]=A;w=z;x=A;y=0}A=(f[d>>2]|0)+w|0;f[a>>2]=A;w=(f[d+4>>2]|0)+x|0;x=a+4|0;f[x>>2]=w;d=f[e>>2]|0;if((d|0)>=(A|0))if((A|0)<(0-d|0))B=(f[b+4>>2]|0)+A|0;else B=A;else B=A-(f[b+4>>2]|0)|0;f[a>>2]=B;if((d|0)>=(w|0))if((w|0)<(0-d|0))C=(f[b+4>>2]|0)+w|0;else C=w;else C=w-(f[b+4>>2]|0)|0;f[x>>2]=C;if(y){D=B;E=C}else{switch((4-v|0)%4|0|0){case 1:{F=C;G=0-B|0;break}case 2:{F=0-B|0;G=0-C|0;break}case 3:{F=0-C|0;G=B;break}default:{F=B;G=C}}C=a;f[C>>2]=F;f[C+4>>2]=G;D=F;E=G}if(l){H=D;I=E;J=H+g|0;K=I+g|0;L=a;M=L;f[M>>2]=J;N=L+4|0;O=N;f[O>>2]=K;return}if((E|D|0)>-1){P=1;Q=1}else{l=(D|0)<1&(E|0)<1;P=l?-1:(D|0)>0?1:-1;Q=l?-1:(E|0)>0?1:-1}l=X(d,P)|0;G=X(d,Q)|0;d=(D<<1)-l|0;f[a>>2]=d;D=(E<<1)-G|0;f[x>>2]=D;if((X(P,Q)|0)>-1){Q=0-D|0;f[a>>2]=Q;R=0-d|0;S=Q}else{f[a>>2]=D;R=d;S=D}D=(S+l|0)/2|0;f[a>>2]=D;l=(R+G|0)/2|0;f[x>>2]=l;H=D;I=l;J=H+g|0;K=I+g|0;L=a;M=L;f[M>>2]=J;N=L+4|0;O=N;f[O>>2]=K;return}function cc(a,b,c,d,e,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;h=h|0;var i=0;switch(c|0){case 1:{c=dj(60)|0;f[c>>2]=1208;f[c+4>>2]=d;h=c+8|0;f[h>>2]=f[e>>2];f[h+4>>2]=f[e+4>>2];f[h+8>>2]=f[e+8>>2];f[h+12>>2]=f[e+12>>2];f[h+16>>2]=f[e+16>>2];f[h+20>>2]=f[e+20>>2];Dg(c+32|0,e+24|0);h=c+44|0;f[h>>2]=f[g>>2];f[h+4>>2]=f[g+4>>2];f[h+8>>2]=f[g+8>>2];f[h+12>>2]=f[g+12>>2];f[c>>2]=1572;i=c;f[a>>2]=i;return}case 4:{c=dj(112)|0;f[c>>2]=1208;f[c+4>>2]=d;h=c+8|0;f[h>>2]=f[e>>2];f[h+4>>2]=f[e+4>>2];f[h+8>>2]=f[e+8>>2];f[h+12>>2]=f[e+12>>2];f[h+16>>2]=f[e+16>>2];f[h+20>>2]=f[e+20>>2];Dg(c+32|0,e+24|0);h=c+44|0;f[h>>2]=f[g>>2];f[h+4>>2]=f[g+4>>2];f[h+8>>2]=f[g+8>>2];f[h+12>>2]=f[g+12>>2];f[c>>2]=1628;h=c+60|0;b=h+52|0;do{f[h>>2]=0;h=h+4|0}while((h|0)<(b|0));i=c;f[a>>2]=i;return}case 5:{c=dj(104)|0;f[c>>2]=1208;f[c+4>>2]=d;h=c+8|0;f[h>>2]=f[e>>2];f[h+4>>2]=f[e+4>>2];f[h+8>>2]=f[e+8>>2];f[h+12>>2]=f[e+12>>2];f[h+16>>2]=f[e+16>>2];f[h+20>>2]=f[e+20>>2];Dg(c+32|0,e+24|0);h=c+44|0;f[h>>2]=f[g>>2];f[h+4>>2]=f[g+4>>2];f[h+8>>2]=f[g+8>>2];f[h+12>>2]=f[g+12>>2];f[c>>2]=1684;f[c+60>>2]=0;f[c+64>>2]=0;f[c+76>>2]=0;f[c+80>>2]=0;f[c+84>>2]=0;h=c+88|0;f[h>>2]=f[g>>2];f[h+4>>2]=f[g+4>>2];f[h+8>>2]=f[g+8>>2];f[h+12>>2]=f[g+12>>2];i=c;f[a>>2]=i;return}case 6:{c=dj(124)|0;f[c>>2]=1208;f[c+4>>2]=d;d=c+8|0;f[d>>2]=f[e>>2];f[d+4>>2]=f[e+4>>2];f[d+8>>2]=f[e+8>>2];f[d+12>>2]=f[e+12>>2];f[d+16>>2]=f[e+16>>2];f[d+20>>2]=f[e+20>>2];Dg(c+32|0,e+24|0);e=c+44|0;f[e>>2]=f[g>>2];f[e+4>>2]=f[g+4>>2];f[e+8>>2]=f[g+8>>2];f[e+12>>2]=f[g+12>>2];f[c>>2]=1740;f[c+64>>2]=0;f[c+68>>2]=0;e=c+72|0;f[e>>2]=f[g>>2];f[e+4>>2]=f[g+4>>2];f[e+8>>2]=f[g+8>>2];f[e+12>>2]=f[g+12>>2];f[c+60>>2]=1796;f[c+88>>2]=1;g=c+92|0;f[g>>2]=-1;f[g+4>>2]=-1;f[g+8>>2]=-1;f[g+12>>2]=-1;Vk(c+108|0);i=c;f[a>>2]=i;return}default:{i=0;f[a>>2]=i;return}}}function dc(a,b,c,d,e,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;h=h|0;var i=0;switch(c|0){case 1:{c=dj(60)|0;f[c>>2]=1208;f[c+4>>2]=d;h=c+8|0;f[h>>2]=f[e>>2];f[h+4>>2]=f[e+4>>2];f[h+8>>2]=f[e+8>>2];f[h+12>>2]=f[e+12>>2];f[h+16>>2]=f[e+16>>2];f[h+20>>2]=f[e+20>>2];Dg(c+32|0,e+24|0);h=c+44|0;f[h>>2]=f[g>>2];f[h+4>>2]=f[g+4>>2];f[h+8>>2]=f[g+8>>2];f[h+12>>2]=f[g+12>>2];f[c>>2]=1320;i=c;f[a>>2]=i;return}case 4:{c=dj(112)|0;f[c>>2]=1208;f[c+4>>2]=d;h=c+8|0;f[h>>2]=f[e>>2];f[h+4>>2]=f[e+4>>2];f[h+8>>2]=f[e+8>>2];f[h+12>>2]=f[e+12>>2];f[h+16>>2]=f[e+16>>2];f[h+20>>2]=f[e+20>>2];Dg(c+32|0,e+24|0);h=c+44|0;f[h>>2]=f[g>>2];f[h+4>>2]=f[g+4>>2];f[h+8>>2]=f[g+8>>2];f[h+12>>2]=f[g+12>>2];f[c>>2]=1376;h=c+60|0;b=h+52|0;do{f[h>>2]=0;h=h+4|0}while((h|0)<(b|0));i=c;f[a>>2]=i;return}case 5:{c=dj(104)|0;f[c>>2]=1208;f[c+4>>2]=d;h=c+8|0;f[h>>2]=f[e>>2];f[h+4>>2]=f[e+4>>2];f[h+8>>2]=f[e+8>>2];f[h+12>>2]=f[e+12>>2];f[h+16>>2]=f[e+16>>2];f[h+20>>2]=f[e+20>>2];Dg(c+32|0,e+24|0);h=c+44|0;f[h>>2]=f[g>>2];f[h+4>>2]=f[g+4>>2];f[h+8>>2]=f[g+8>>2];f[h+12>>2]=f[g+12>>2];f[c>>2]=1432;f[c+60>>2]=0;f[c+64>>2]=0;f[c+76>>2]=0;f[c+80>>2]=0;f[c+84>>2]=0;h=c+88|0;f[h>>2]=f[g>>2];f[h+4>>2]=f[g+4>>2];f[h+8>>2]=f[g+8>>2];f[h+12>>2]=f[g+12>>2];i=c;f[a>>2]=i;return}case 6:{c=dj(124)|0;f[c>>2]=1208;f[c+4>>2]=d;d=c+8|0;f[d>>2]=f[e>>2];f[d+4>>2]=f[e+4>>2];f[d+8>>2]=f[e+8>>2];f[d+12>>2]=f[e+12>>2];f[d+16>>2]=f[e+16>>2];f[d+20>>2]=f[e+20>>2];Dg(c+32|0,e+24|0);e=c+44|0;f[e>>2]=f[g>>2];f[e+4>>2]=f[g+4>>2];f[e+8>>2]=f[g+8>>2];f[e+12>>2]=f[g+12>>2];f[c>>2]=1488;f[c+64>>2]=0;f[c+68>>2]=0;e=c+72|0;f[e>>2]=f[g>>2];f[e+4>>2]=f[g+4>>2];f[e+8>>2]=f[g+8>>2];f[e+12>>2]=f[g+12>>2];f[c+60>>2]=1544;f[c+88>>2]=1;g=c+92|0;f[g>>2]=-1;f[g+4>>2]=-1;f[g+8>>2]=-1;f[g+12>>2]=-1;Vk(c+108|0);i=c;f[a>>2]=i;return}default:{i=0;f[a>>2]=i;return}}}function ec(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0;c=u;u=u+16|0;d=c;if(!(sd(a+80|0,a)|0)){e=0;u=c;return e|0}if(!(sf(a)|0)){e=0;u=c;return e|0}g=b;h=a;i=g+40|0;do{f[g>>2]=f[h>>2];g=g+4|0;h=h+4|0}while((g|0)<(i|0));h=a+176|0;f[h>>2]=2;g=a+180|0;f[g>>2]=7;i=f[a+152>>2]|0;if((i|0)<0){e=0;u=c;return e|0}j=a+156|0;f[d>>2]=0;k=a+160|0;l=f[k>>2]|0;m=f[j>>2]|0;n=l-m>>2;o=m;m=l;if(i>>>0<=n>>>0)if(i>>>0>>0?(l=o+(i<<2)|0,(m|0)!=(l|0)):0){f[k>>2]=m+(~((m+-4-l|0)>>>2)<<2);p=2;q=7}else{p=2;q=7}else{Ae(j,i-n|0,d);p=f[h>>2]|0;q=f[g>>2]|0}g=q-p+1|0;p=a+184|0;q=a+188|0;h=f[q>>2]|0;n=f[p>>2]|0;i=(h-n|0)/12|0;j=n;n=h;if(g>>>0<=i>>>0)if(g>>>0>>0?(l=j+(g*12|0)|0,(n|0)!=(l|0)):0){j=n;while(1){n=j+-12|0;f[q>>2]=n;m=f[n>>2]|0;if(!m)r=n;else{n=j+-8|0;k=f[n>>2]|0;if((k|0)!=(m|0))f[n>>2]=k+(~((k+-4-m|0)>>>2)<<2);fn(m);r=f[q>>2]|0}if((r|0)==(l|0))break;else j=r}s=r}else s=h;else{ld(p,g-i|0);s=f[q>>2]|0}i=a+196|0;g=f[p>>2]|0;h=(s-g|0)/12|0;r=a+200|0;a=f[r>>2]|0;j=f[i>>2]|0;l=a-j>>2;m=j;j=a;if(h>>>0<=l>>>0)if(h>>>0>>0?(a=m+(h<<2)|0,(j|0)!=(a|0)):0){f[r>>2]=j+(~((j+-4-a|0)>>>2)<<2);t=s;v=g}else{t=s;v=g}else{jf(i,h-l|0);t=f[q>>2]|0;v=f[p>>2]|0}if((t|0)==(v|0)){e=1;u=c;return e|0}v=0;do{eg(d,b)|0;t=f[d>>2]|0;if(t|0){l=f[p>>2]|0;h=l+(v*12|0)|0;g=l+(v*12|0)+4|0;s=f[g>>2]|0;a=f[h>>2]|0;j=s-a>>2;r=a;a=s;if(t>>>0<=j>>>0)if(t>>>0>>0?(s=r+(t<<2)|0,(a|0)!=(s|0)):0){f[g>>2]=a+(~((a+-4-s|0)>>>2)<<2);w=l;x=t}else{w=l;x=t}else{jf(h,t-j|0);w=f[p>>2]|0;x=f[d>>2]|0}Rf(x,1,b,f[w+(v*12|0)>>2]|0)|0;f[(f[i>>2]|0)+(v<<2)>>2]=f[d>>2]}v=v+1|0}while(v>>>0<(((f[q>>2]|0)-(f[p>>2]|0)|0)/12|0)>>>0);e=1;u=c;return e|0}function fc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;c=a+4|0;if(!b){d=f[a>>2]|0;f[a>>2]=0;if(d|0)fn(d);f[c>>2]=0;return}if(b>>>0>1073741823){d=ra(8)|0;$k(d,9793);f[d>>2]=3708;va(d|0,856,80)}d=dj(b<<2)|0;e=f[a>>2]|0;f[a>>2]=d;if(e|0)fn(e);f[c>>2]=b;c=0;do{f[(f[a>>2]|0)+(c<<2)>>2]=0;c=c+1|0}while((c|0)!=(b|0));c=a+8|0;e=f[c>>2]|0;if(!e)return;d=f[e+4>>2]|0;g=b+-1|0;h=(g&b|0)==0;if(!h)if(d>>>0>>0)i=d;else i=(d>>>0)%(b>>>0)|0;else i=d&g;f[(f[a>>2]|0)+(i<<2)>>2]=c;c=f[e>>2]|0;if(!c)return;else{j=e;k=c;l=i;m=e}a:while(1){b:do if(h){e=j;i=k;c=m;while(1){d=i;while(1){n=f[d+4>>2]&g;if((n|0)==(l|0))break;o=(f[a>>2]|0)+(n<<2)|0;if(!(f[o>>2]|0)){p=d;q=c;r=o;s=n;break b}o=d+8|0;t=d;while(1){u=f[t>>2]|0;if(!u)break;if((f[o>>2]|0)==(f[u+8>>2]|0))t=u;else break}f[c>>2]=u;f[t>>2]=f[f[(f[a>>2]|0)+(n<<2)>>2]>>2];f[f[(f[a>>2]|0)+(n<<2)>>2]>>2]=d;o=f[e>>2]|0;if(!o){v=37;break a}else d=o}i=f[d>>2]|0;if(!i){v=37;break a}else{e=d;c=d}}}else{c=j;e=k;i=m;while(1){o=e;while(1){w=f[o+4>>2]|0;if(w>>>0>>0)x=w;else x=(w>>>0)%(b>>>0)|0;if((x|0)==(l|0))break;w=(f[a>>2]|0)+(x<<2)|0;if(!(f[w>>2]|0)){p=o;q=i;r=w;s=x;break b}w=o+8|0;y=o;while(1){z=f[y>>2]|0;if(!z)break;if((f[w>>2]|0)==(f[z+8>>2]|0))y=z;else break}f[i>>2]=z;f[y>>2]=f[f[(f[a>>2]|0)+(x<<2)>>2]>>2];f[f[(f[a>>2]|0)+(x<<2)>>2]>>2]=o;w=f[c>>2]|0;if(!w){v=37;break a}else o=w}e=f[o>>2]|0;if(!e){v=37;break a}else{c=o;i=o}}}while(0);f[r>>2]=q;k=f[p>>2]|0;if(!k){v=37;break}else{j=p;l=s;m=p}}if((v|0)==37)return}function gc(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;d=u;u=u+32|0;e=d+24|0;g=d+20|0;h=d+8|0;i=d+4|0;j=d;f[e>>2]=0;eg(e,f[a>>2]|0)|0;a:do if(f[e>>2]|0){k=0;while(1){k=k+1|0;if(!(mc(a,c)|0)){l=0;break}if(k>>>0>=(f[e>>2]|0)>>>0)break a}u=d;return l|0}while(0);f[g>>2]=0;eg(g,f[a>>2]|0)|0;b:do if(!(f[g>>2]|0))m=1;else{e=h+11|0;k=0;while(1){f[h>>2]=0;f[h+4>>2]=0;f[h+8>>2]=0;o=f[a>>2]|0;p=o+8|0;q=f[p+4>>2]|0;r=o+16|0;s=r;t=f[s>>2]|0;v=f[s+4>>2]|0;do if((q|0)>(v|0)|((q|0)==(v|0)?(f[p>>2]|0)>>>0>t>>>0:0)){s=b[(f[o>>2]|0)+t>>0]|0;w=Tj(t|0,v|0,1,0)|0;x=r;f[x>>2]=w;f[x+4>>2]=I;x=s&255;ig(h,x,0);if(s<<24>>24){w=f[a>>2]|0;y=Lh(h,0)|0;z=w+8|0;A=f[z>>2]|0;B=f[z+4>>2]|0;z=w+16|0;C=z;D=f[C>>2]|0;E=s&255;s=Tj(D|0,f[C+4>>2]|0,E|0,0)|0;C=I;if((B|0)<(C|0)|(B|0)==(C|0)&A>>>0>>0){F=1;break}ee(y|0,(f[w>>2]|0)+D|0,x|0)|0;x=z;D=Tj(f[x>>2]|0,f[x+4>>2]|0,E|0,0)|0;E=z;f[E>>2]=D;f[E+4>>2]=I}E=dj(40)|0;f[E>>2]=0;f[E+4>>2]=0;f[E+8>>2]=0;f[E+12>>2]=0;n[E+16>>2]=$(1.0);D=E+20|0;f[D>>2]=0;f[D+4>>2]=0;f[D+8>>2]=0;f[D+12>>2]=0;n[E+36>>2]=$(1.0);f[i>>2]=E;if(gc(a,E)|0){E=f[i>>2]|0;f[i>>2]=0;f[j>>2]=E;Od(c,h,j)|0;uf(j);G=0}else G=1;uf(i);F=G}else F=1;while(0);if((b[e>>0]|0)<0)fn(f[h>>2]|0);k=k+1|0;if(F|0){m=0;break b}if(k>>>0>=(f[g>>2]|0)>>>0){m=1;break}}}while(0);l=m;u=d;return l|0}function hc(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=u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q);q=f[s>>2]|0;if(q|0){s=f[t>>2]|0;if((s|0)!=(q|0))f[t>>2]=s+(~((s+-4-q|0)>>>2)<<2);fn(q)}f[r>>2]=2420;r=f[h+24>>2]|0;if(r|0)fn(r);r=f[h+12>>2]|0;if(!r){u=e;return}fn(r);u=e;return}function ic(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;g=a+8|0;f[g>>2]=e;h=a+32|0;i=a+36|0;j=f[i>>2]|0;k=f[h>>2]|0;l=j-k>>2;m=k;k=j;if(l>>>0>=e>>>0)if(l>>>0>e>>>0?(j=m+(e<<2)|0,(k|0)!=(j|0)):0){f[i>>2]=k+(~((k+-4-j|0)>>>2)<<2);n=e}else n=e;else{jf(h,e-l|0);n=f[g>>2]|0}l=e>>>0>1073741823?-1:e<<2;h=cn(l)|0;Vf(h|0,0,l|0)|0;if((n|0)>0){l=a+16|0;j=a+32|0;k=a+12|0;i=0;do{m=f[h+(i<<2)>>2]|0;o=f[l>>2]|0;if((m|0)>(o|0)){p=f[j>>2]|0;f[p+(i<<2)>>2]=o;q=p}else{p=f[k>>2]|0;o=f[j>>2]|0;f[o+(i<<2)>>2]=(m|0)<(p|0)?p:m;q=o}i=i+1|0;r=f[g>>2]|0}while((i|0)<(r|0));if((r|0)>0){i=a+20|0;j=0;do{o=(f[b+(j<<2)>>2]|0)+(f[q+(j<<2)>>2]|0)|0;m=c+(j<<2)|0;f[m>>2]=o;if((o|0)<=(f[l>>2]|0)){if((o|0)<(f[k>>2]|0)){s=(f[i>>2]|0)+o|0;t=18}}else{s=o-(f[i>>2]|0)|0;t=18}if((t|0)==18){t=0;f[m>>2]=s}j=j+1|0;m=f[g>>2]|0}while((j|0)<(m|0));u=m}else u=r}else u=n;if((e|0)>=(d|0)){dn(h);return 1}n=0-e|0;r=a+16|0;j=a+32|0;s=a+12|0;i=a+20|0;a=u;u=e;while(1){k=c+(u<<2)|0;l=k+(n<<2)|0;q=b+(u<<2)|0;if((a|0)>0){m=0;do{o=f[l+(m<<2)>>2]|0;p=f[r>>2]|0;if((o|0)>(p|0)){v=f[j>>2]|0;f[v+(m<<2)>>2]=p;w=v}else{v=f[s>>2]|0;p=f[j>>2]|0;f[p+(m<<2)>>2]=(o|0)<(v|0)?v:o;w=p}m=m+1|0;x=f[g>>2]|0}while((m|0)<(x|0));if((x|0)>0){m=0;do{l=(f[q+(m<<2)>>2]|0)+(f[w+(m<<2)>>2]|0)|0;p=k+(m<<2)|0;f[p>>2]=l;if((l|0)<=(f[r>>2]|0)){if((l|0)<(f[s>>2]|0)){y=(f[i>>2]|0)+l|0;t=33}}else{y=l-(f[i>>2]|0)|0;t=33}if((t|0)==33){t=0;f[p>>2]=y}m=m+1|0;p=f[g>>2]|0}while((m|0)<(p|0));z=p}else z=x}else z=a;u=u+e|0;if((u|0)>=(d|0))break;else a=z}dn(h);return 1}function jc(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0;d=u;u=u+16|0;e=d;g=a+68|0;f[g>>2]=(f[g>>2]|0)+1;g=(f[a+8+(b*12|0)+4>>2]|0)-(f[a+8+(b*12|0)>>2]|0)|0;h=g>>2;if((g|0)<=0){u=d;return}g=a+4|0;i=a+56|0;j=a+72|0;k=f[c>>2]|0;c=k+4|0;l=k+8|0;m=a+76|0;n=f[a+44+(b<<2)>>2]|0;b=0;while(1){o=(n|0)==-1;p=o?-1:(n>>>0)/3|0;q=(f[i>>2]|0)+(p>>>5<<2)|0;f[q>>2]=f[q>>2]|1<<(p&31);f[j>>2]=(f[j>>2]|0)+1;do if(b){if(o)r=-1;else r=f[(f[(f[a>>2]|0)+96>>2]|0)+(((n|0)/3|0)*12|0)+(((n|0)%3|0)<<2)>>2]|0;f[m>>2]=r;f[e>>2]=r;p=f[c>>2]|0;if(p>>>0<(f[l>>2]|0)>>>0){f[p>>2]=r;f[c>>2]=p+4}else yf(k,e);if(!(b&1)){p=n+1|0;if(o){s=-1;break}t=((p>>>0)%3|0|0)==0?n+-2|0:p;v=35;break}if(!o)if(!((n>>>0)%3|0)){t=n+2|0;v=35;break}else{t=n+-1|0;v=35;break}else s=-1}else{if(o)w=-1;else w=f[(f[(f[a>>2]|0)+96>>2]|0)+(((n|0)/3|0)*12|0)+(((n|0)%3|0)<<2)>>2]|0;f[e>>2]=w;p=f[c>>2]|0;if(p>>>0<(f[l>>2]|0)>>>0){f[p>>2]=w;f[c>>2]=p+4}else yf(k,e);p=n+1|0;if(!o?(q=((p>>>0)%3|0|0)==0?n+-2|0:p,(q|0)!=-1):0)x=f[(f[(f[a>>2]|0)+96>>2]|0)+(((q|0)/3|0)*12|0)+(((q|0)%3|0)<<2)>>2]|0;else x=-1;f[e>>2]=x;q=f[c>>2]|0;if(q>>>0<(f[l>>2]|0)>>>0){f[q>>2]=x;f[c>>2]=q+4}else yf(k,e);if(!o?(q=(((n>>>0)%3|0|0)==0?2:-1)+n|0,(q|0)!=-1):0)y=f[(f[(f[a>>2]|0)+96>>2]|0)+(((q|0)/3|0)*12|0)+(((q|0)%3|0)<<2)>>2]|0;else y=-1;f[m>>2]=y;f[e>>2]=y;q=f[c>>2]|0;if(q>>>0<(f[l>>2]|0)>>>0){f[q>>2]=y;f[c>>2]=q+4}else yf(k,e);t=n;v=35}while(0);if((v|0)==35){v=0;if((t|0)==-1)s=-1;else s=f[(f[(f[g>>2]|0)+12>>2]|0)+(t<<2)>>2]|0}b=b+1|0;if((b|0)>=(h|0))break;else n=s}u=d;return}function kc(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=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>2]|0;H=f[k>>2]|0}else{G=A;H=l}b=b+1|0;if(b>>>0>=((H-G|0)/12|0)>>>0){i=1;break}else{A=G;l=H}}u=d;return i|0}function lc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;c=a+148|0;d=f[b>>2]|0;b=(d|0)==-1;e=d+1|0;do if(!b){g=((e>>>0)%3|0|0)==0?d+-2|0:e;if(!((d>>>0)%3|0)){h=g;i=d+2|0;break}else{h=g;i=d+-1|0;break}}else{h=-1;i=-1}while(0);switch(f[a+168>>2]|0){case 1:case 0:{if((h|0)==-1)j=-1;else j=f[(f[f[c>>2]>>2]|0)+(h<<2)>>2]|0;e=f[a+156>>2]|0;g=e+(j<<2)|0;f[g>>2]=(f[g>>2]|0)+1;if((i|0)==-1){k=1;l=e;m=-1;n=28}else{k=1;l=e;m=f[(f[f[c>>2]>>2]|0)+(i<<2)>>2]|0;n=28}break}case 5:{if(b)o=-1;else o=f[(f[f[c>>2]>>2]|0)+(d<<2)>>2]|0;e=f[a+156>>2]|0;g=e+(o<<2)|0;f[g>>2]=(f[g>>2]|0)+1;if((h|0)==-1)p=-1;else p=f[(f[f[c>>2]>>2]|0)+(h<<2)>>2]|0;g=e+(p<<2)|0;f[g>>2]=(f[g>>2]|0)+1;if((i|0)==-1){k=2;l=e;m=-1;n=28}else{k=2;l=e;m=f[(f[f[c>>2]>>2]|0)+(i<<2)>>2]|0;n=28}break}case 3:{if(b)q=-1;else q=f[(f[f[c>>2]>>2]|0)+(d<<2)>>2]|0;e=f[a+156>>2]|0;g=e+(q<<2)|0;f[g>>2]=(f[g>>2]|0)+1;if((h|0)==-1)r=-1;else r=f[(f[f[c>>2]>>2]|0)+(h<<2)>>2]|0;g=e+(r<<2)|0;f[g>>2]=(f[g>>2]|0)+2;if((i|0)==-1){k=1;l=e;m=-1;n=28}else{k=1;l=e;m=f[(f[f[c>>2]>>2]|0)+(i<<2)>>2]|0;n=28}break}case 7:{if(b)s=-1;else s=f[(f[f[c>>2]>>2]|0)+(d<<2)>>2]|0;d=f[a+156>>2]|0;b=d+(s<<2)|0;f[b>>2]=(f[b>>2]|0)+2;if((h|0)==-1)t=-1;else t=f[(f[f[c>>2]>>2]|0)+(h<<2)>>2]|0;b=d+(t<<2)|0;f[b>>2]=(f[b>>2]|0)+2;if((i|0)==-1){k=2;l=d;m=-1;n=28}else{k=2;l=d;m=f[(f[f[c>>2]>>2]|0)+(i<<2)>>2]|0;n=28}break}default:{}}if((n|0)==28){n=l+(m<<2)|0;f[n>>2]=(f[n>>2]|0)+k}if((h|0)==-1)u=-1;else u=f[(f[f[c>>2]>>2]|0)+(h<<2)>>2]|0;h=f[(f[a+156>>2]|0)+(u<<2)>>2]|0;u=f[a+176>>2]|0;if((h|0)<(u|0)){v=u;w=v-u|0;x=a+172|0;f[x>>2]=w;return}c=f[a+180>>2]|0;v=(h|0)>(c|0)?c:h;w=v-u|0;x=a+172|0;f[x>>2]=w;return}function mc(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;d=u;u=u+32|0;e=d+16|0;g=d+12|0;h=d;f[e>>2]=0;f[e+4>>2]=0;f[e+8>>2]=0;i=f[a>>2]|0;j=i+8|0;k=f[j+4>>2]|0;l=i+16|0;m=l;n=f[m>>2]|0;o=f[m+4>>2]|0;do if((k|0)>(o|0)|((k|0)==(o|0)?(f[j>>2]|0)>>>0>n>>>0:0)){m=b[(f[i>>2]|0)+n>>0]|0;p=Tj(n|0,o|0,1,0)|0;q=l;f[q>>2]=p;f[q+4>>2]=I;q=m&255;ig(e,q,0);if(m<<24>>24){p=f[a>>2]|0;r=Lh(e,0)|0;s=p+8|0;t=f[s>>2]|0;v=f[s+4>>2]|0;s=p+16|0;w=s;x=f[w>>2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>0)|0;else i=g&c;j=f[(f[a>>2]|0)+(i<<2)>>2]|0;if(!j)k=i;else{if(h){h=j;while(1){l=f[h>>2]|0;if(!l){k=i;break a}m=f[l+4>>2]|0;if(!((m|0)==(c|0)|(m&g|0)==(i|0))){k=i;break a}if((f[l+8>>2]|0)==(c|0)){o=l;break}else h=l}p=o+12|0;return p|0}else q=j;while(1){h=f[q>>2]|0;if(!h){k=i;break a}g=f[h+4>>2]|0;if((g|0)!=(c|0)){if(g>>>0>>0)r=g;else r=(g>>>0)%(d>>>0)|0;if((r|0)!=(i|0)){k=i;break a}}if((f[h+8>>2]|0)==(c|0)){o=h;break}else q=h}p=o+12|0;return p|0}}else k=0;while(0);q=dj(16)|0;f[q+8>>2]=c;f[q+12>>2]=0;f[q+4>>2]=c;f[q>>2]=0;i=a+12|0;s=$(((f[i>>2]|0)+1|0)>>>0);t=$(d>>>0);u=$(n[a+16>>2]);do if(e|s>$(t*u)){r=(d>>>0<3|(d+-1&d|0)!=0)&1|d<<1;j=~~$(W($(s/u)))>>>0;Ue(a,r>>>0>>0?j:r);r=f[b>>2]|0;j=r+-1|0;if(!(j&r)){v=r;w=j&c;break}if(c>>>0>>0){v=r;w=c}else{v=r;w=(c>>>0)%(r>>>0)|0}}else{v=d;w=k}while(0);k=(f[a>>2]|0)+(w<<2)|0;w=f[k>>2]|0;if(!w){d=a+8|0;f[q>>2]=f[d>>2];f[d>>2]=q;f[k>>2]=d;d=f[q>>2]|0;if(d|0){k=f[d+4>>2]|0;d=v+-1|0;if(d&v)if(k>>>0>>0)x=k;else x=(k>>>0)%(v>>>0)|0;else x=k&d;y=(f[a>>2]|0)+(x<<2)|0;z=30}}else{f[q>>2]=f[w>>2];y=w;z=30}if((z|0)==30)f[y>>2]=q;f[i>>2]=(f[i>>2]|0)+1;o=q;p=o+12|0;return p|0}function oc(a,c){a=a|0;c=c|0;var d=0,e=0,g=0;f[a>>2]=f[c>>2];d=c+4|0;f[a+4>>2]=f[d>>2];e=c+8|0;f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2]=0;g=a+108|0;f[g>>2]=0;f[a+112>>2]=0;f[e>>2]=f[d>>2];e=c+108|0;f[g>>2]=f[e>>2];g=c+112|0;f[a+112>>2]=f[g>>2];f[g>>2]=0;f[e>>2]=0;f[d>>2]=0;d=a+116|0;e=c+116|0;f[d>>2]=0;g=a+120|0;f[g>>2]=0;f[a+124>>2]=0;f[d>>2]=f[e>>2];d=c+120|0;f[g>>2]=f[d>>2];g=c+124|0;f[a+124>>2]=f[g>>2];f[g>>2]=0;f[d>>2]=0;f[e>>2]=0;f[a+128>>2]=f[c+128>>2];e=a+132|0;d=c+132|0;f[e>>2]=0;g=a+136|0;f[g>>2]=0;f[a+140>>2]=0;f[e>>2]=f[d>>2];e=c+136|0;f[g>>2]=f[e>>2];g=c+140|0;f[a+140>>2]=f[g>>2];f[g>>2]=0;f[e>>2]=0;f[d>>2]=0;return}function pc(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=u;u=u+16|0;h=d+4|0;i=d;j=a+60|0;f[a+64>>2]=g;g=a+8|0;f[g>>2]=e;k=a+32|0;l=a+36|0;m=f[l>>2]|0;n=f[k>>2]|0;o=m-n>>2;p=n;n=m;if(o>>>0>=e>>>0){if(o>>>0>e>>>0?(m=p+(e<<2)|0,(n|0)!=(m|0)):0)f[l>>2]=n+(~((n+-4-m|0)>>>2)<<2)}else jf(k,e-o|0);o=a+56|0;k=f[o>>2]|0;m=f[k+4>>2]|0;n=f[k>>2]|0;l=m-n|0;p=l>>2;if((l|0)<=0){q=1;u=d;return q|0}l=a+16|0;r=a+32|0;s=a+12|0;t=a+20|0;if((m|0)==(n|0)){v=k;ym(v)}else{w=n;x=0}while(1){f[i>>2]=f[w+(x<<2)>>2];f[h>>2]=f[i>>2];if(!(tb(j,h,c,x)|0)){q=0;y=24;break}n=X(x,e)|0;k=b+(n<<2)|0;m=c+(n<<2)|0;if((f[g>>2]|0)>0){n=0;do{z=f[a+68+(n<<2)>>2]|0;A=f[l>>2]|0;if((z|0)>(A|0)){B=f[r>>2]|0;f[B+(n<<2)>>2]=A;C=B}else{B=f[s>>2]|0;A=f[r>>2]|0;f[A+(n<<2)>>2]=(z|0)<(B|0)?B:z;C=A}n=n+1|0;D=f[g>>2]|0}while((n|0)<(D|0));if((D|0)>0){n=0;do{A=(f[k+(n<<2)>>2]|0)+(f[C+(n<<2)>>2]|0)|0;z=m+(n<<2)|0;f[z>>2]=A;if((A|0)<=(f[l>>2]|0)){if((A|0)<(f[s>>2]|0)){E=(f[t>>2]|0)+A|0;y=20}}else{E=A-(f[t>>2]|0)|0;y=20}if((y|0)==20){y=0;f[z>>2]=E}n=n+1|0}while((n|0)<(f[g>>2]|0))}}x=x+1|0;if((x|0)>=(p|0)){q=1;y=24;break}n=f[o>>2]|0;w=f[n>>2]|0;if((f[n+4>>2]|0)-w>>2>>>0<=x>>>0){v=n;y=8;break}}if((y|0)==8)ym(v);else if((y|0)==24){u=d;return q|0}return 0}function qc(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=u;u=u+16|0;h=d+4|0;i=d;j=a+60|0;f[a+64>>2]=g;g=a+8|0;f[g>>2]=e;k=a+32|0;l=a+36|0;m=f[l>>2]|0;n=f[k>>2]|0;o=m-n>>2;p=n;n=m;if(o>>>0>=e>>>0){if(o>>>0>e>>>0?(m=p+(e<<2)|0,(n|0)!=(m|0)):0)f[l>>2]=n+(~((n+-4-m|0)>>>2)<<2)}else jf(k,e-o|0);o=a+56|0;k=f[o>>2]|0;m=f[k+4>>2]|0;n=f[k>>2]|0;l=m-n|0;p=l>>2;if((l|0)<=0){q=1;u=d;return q|0}l=a+16|0;r=a+32|0;s=a+12|0;t=a+20|0;if((m|0)==(n|0)){v=k;ym(v)}else{w=n;x=0}while(1){f[i>>2]=f[w+(x<<2)>>2];f[h>>2]=f[i>>2];if(!(sb(j,h,c,x)|0)){q=0;y=24;break}n=X(x,e)|0;k=b+(n<<2)|0;m=c+(n<<2)|0;if((f[g>>2]|0)>0){n=0;do{z=f[a+68+(n<<2)>>2]|0;A=f[l>>2]|0;if((z|0)>(A|0)){B=f[r>>2]|0;f[B+(n<<2)>>2]=A;C=B}else{B=f[s>>2]|0;A=f[r>>2]|0;f[A+(n<<2)>>2]=(z|0)<(B|0)?B:z;C=A}n=n+1|0;D=f[g>>2]|0}while((n|0)<(D|0));if((D|0)>0){n=0;do{A=(f[k+(n<<2)>>2]|0)+(f[C+(n<<2)>>2]|0)|0;z=m+(n<<2)|0;f[z>>2]=A;if((A|0)<=(f[l>>2]|0)){if((A|0)<(f[s>>2]|0)){E=(f[t>>2]|0)+A|0;y=20}}else{E=A-(f[t>>2]|0)|0;y=20}if((y|0)==20){y=0;f[z>>2]=E}n=n+1|0}while((n|0)<(f[g>>2]|0))}}x=x+1|0;if((x|0)>=(p|0)){q=1;y=24;break}n=f[o>>2]|0;w=f[n>>2]|0;if((f[n+4>>2]|0)-w>>2>>>0<=x>>>0){v=n;y=8;break}}if((y|0)==8)ym(v);else if((y|0)==24){u=d;return q|0}return 0}function rc(a,c,e,g,h){a=a|0;c=c|0;e=e|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0;i=u;u=u+32|0;j=i+16|0;k=i+12|0;l=i;m=c+24|0;n=b[m>>0]|0;o=n<<24>>24;p=f[a+80>>2]|0;a=X(p,o)|0;q=f[c+28>>2]|0;if((q|0)==(e|0)|(q|0)==(g|0)?b[c+84>>0]|0:0){g=(f[f[c>>2]>>2]|0)+(f[c+48>>2]|0)|0;qd(h,g,g+(a<<1)|0);r=1;u=i;return r|0}f[l>>2]=0;g=l+4|0;f[g>>2]=0;f[l+8>>2]=0;do if(n<<24>>24)if(n<<24>>24<0)ym(l);else{q=o<<1;e=dj(q)|0;f[l>>2]=e;s=e+(o<<1)|0;f[l+8>>2]=s;Vf(e|0,0,q|0)|0;f[g>>2]=s;break}while(0);qd(h,0,0+(a<<1)|0);a:do if(!p)t=1;else{a=c+84|0;s=c+68|0;if(n<<24>>24>0){v=0;w=0}else{q=0;while(1){if(!(b[a>>0]|0))x=f[(f[s>>2]|0)+(q<<2)>>2]|0;else x=q;e=f[l>>2]|0;f[k>>2]=x;y=b[m>>0]|0;f[j>>2]=f[k>>2];if(!(kb(c,j,y,e)|0)){t=0;break a}q=q+1|0;if(q>>>0>=p>>>0){t=1;break a}}}while(1){if(!(b[a>>0]|0))z=f[(f[s>>2]|0)+(w<<2)>>2]|0;else z=w;q=f[l>>2]|0;f[k>>2]=z;e=b[m>>0]|0;f[j>>2]=f[k>>2];if(!(kb(c,j,e,q)|0)){t=0;break a}q=f[l>>2]|0;e=f[h>>2]|0;y=v;A=0;while(1){d[e+(y<<1)>>1]=d[q+(A<<1)>>1]|0;A=A+1|0;if((A|0)==(o|0))break;else y=y+1|0}w=w+1|0;if(w>>>0>=p>>>0){t=1;break}else v=o+v|0}}while(0);v=f[l>>2]|0;if(v|0){l=f[g>>2]|0;if((l|0)!=(v|0))f[g>>2]=l+(~((l+-2-v|0)>>>1)<<1);fn(v)}r=t;u=i;return r|0}function sc(a,c,e,g,h){a=a|0;c=c|0;e=e|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0;i=u;u=u+32|0;j=i+16|0;k=i+12|0;l=i;m=c+24|0;n=b[m>>0]|0;o=n<<24>>24;p=f[a+80>>2]|0;a=X(p,o)|0;q=f[c+28>>2]|0;if((q|0)==(e|0)|(q|0)==(g|0)?b[c+84>>0]|0:0){g=(f[f[c>>2]>>2]|0)+(f[c+48>>2]|0)|0;qd(h,g,g+(a<<1)|0);r=1;u=i;return r|0}f[l>>2]=0;g=l+4|0;f[g>>2]=0;f[l+8>>2]=0;do if(n<<24>>24)if(n<<24>>24<0)ym(l);else{q=o<<1;e=dj(q)|0;f[l>>2]=e;s=e+(o<<1)|0;f[l+8>>2]=s;Vf(e|0,0,q|0)|0;f[g>>2]=s;break}while(0);qd(h,0,0+(a<<1)|0);a:do if(!p)t=1;else{a=c+84|0;s=c+68|0;if(n<<24>>24>0){v=0;w=0}else{q=0;while(1){if(!(b[a>>0]|0))x=f[(f[s>>2]|0)+(q<<2)>>2]|0;else x=q;e=f[l>>2]|0;f[k>>2]=x;y=b[m>>0]|0;f[j>>2]=f[k>>2];if(!(lb(c,j,y,e)|0)){t=0;break a}q=q+1|0;if(q>>>0>=p>>>0){t=1;break a}}}while(1){if(!(b[a>>0]|0))z=f[(f[s>>2]|0)+(w<<2)>>2]|0;else z=w;q=f[l>>2]|0;f[k>>2]=z;e=b[m>>0]|0;f[j>>2]=f[k>>2];if(!(lb(c,j,e,q)|0)){t=0;break a}q=f[l>>2]|0;e=f[h>>2]|0;y=v;A=0;while(1){d[e+(y<<1)>>1]=d[q+(A<<1)>>1]|0;A=A+1|0;if((A|0)==(o|0))break;else y=y+1|0}w=w+1|0;if(w>>>0>=p>>>0){t=1;break}else v=o+v|0}}while(0);v=f[l>>2]|0;if(v|0){l=f[g>>2]|0;if((l|0)!=(v|0))f[g>>2]=l+(~((l+-2-v|0)>>>1)<<1);fn(v)}r=t;u=i;return r|0}function tc(a,c,d,e,g){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0;h=u;u=u+32|0;i=h+16|0;j=h+12|0;k=h;l=c+24|0;m=b[l>>0]|0;n=m<<24>>24;o=f[a+80>>2]|0;a=X(o,n)|0;p=f[c+28>>2]|0;if((p|0)==(d|0)|(p|0)==(e|0)?b[c+84>>0]|0:0){e=(f[f[c>>2]>>2]|0)+(f[c+48>>2]|0)|0;rd(g,e,e+(a<<2)|0);q=1;u=h;return q|0}f[k>>2]=0;e=k+4|0;f[e>>2]=0;f[k+8>>2]=0;do if(m<<24>>24)if(m<<24>>24<0)ym(k);else{p=n<<2;d=dj(p)|0;f[k>>2]=d;r=d+(n<<2)|0;f[k+8>>2]=r;Vf(d|0,0,p|0)|0;f[e>>2]=r;break}while(0);rd(g,0,0+(a<<2)|0);a:do if(!o)s=1;else{a=c+84|0;r=c+68|0;if(m<<24>>24>0){t=0;v=0}else{p=0;while(1){if(!(b[a>>0]|0))w=f[(f[r>>2]|0)+(p<<2)>>2]|0;else w=p;d=f[k>>2]|0;f[j>>2]=w;x=b[l>>0]|0;f[i>>2]=f[j>>2];if(!(mb(c,i,x,d)|0)){s=0;break a}p=p+1|0;if(p>>>0>=o>>>0){s=1;break a}}}while(1){if(!(b[a>>0]|0))y=f[(f[r>>2]|0)+(v<<2)>>2]|0;else y=v;p=f[k>>2]|0;f[j>>2]=y;d=b[l>>0]|0;f[i>>2]=f[j>>2];if(!(mb(c,i,d,p)|0)){s=0;break a}p=f[k>>2]|0;d=f[g>>2]|0;x=t;z=0;while(1){f[d+(x<<2)>>2]=f[p+(z<<2)>>2];z=z+1|0;if((z|0)==(n|0))break;else x=x+1|0}v=v+1|0;if(v>>>0>=o>>>0){s=1;break}else t=n+t|0}}while(0);t=f[k>>2]|0;if(t|0){k=f[e>>2]|0;if((k|0)!=(t|0))f[e>>2]=k+(~((k+-4-t|0)>>>2)<<2);fn(t)}q=s;u=h;return q|0}function uc(a,c,d,e,g){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0;h=u;u=u+32|0;i=h+16|0;j=h+12|0;k=h;l=c+24|0;m=b[l>>0]|0;n=m<<24>>24;o=f[a+80>>2]|0;a=X(o,n)|0;p=f[c+28>>2]|0;if((p|0)==(d|0)|(p|0)==(e|0)?b[c+84>>0]|0:0){e=(f[f[c>>2]>>2]|0)+(f[c+48>>2]|0)|0;rd(g,e,e+(a<<2)|0);q=1;u=h;return q|0}f[k>>2]=0;e=k+4|0;f[e>>2]=0;f[k+8>>2]=0;do if(m<<24>>24)if(m<<24>>24<0)ym(k);else{p=n<<2;d=dj(p)|0;f[k>>2]=d;r=d+(n<<2)|0;f[k+8>>2]=r;Vf(d|0,0,p|0)|0;f[e>>2]=r;break}while(0);rd(g,0,0+(a<<2)|0);a:do if(!o)s=1;else{a=c+84|0;r=c+68|0;if(m<<24>>24>0){t=0;v=0}else{p=0;while(1){if(!(b[a>>0]|0))w=f[(f[r>>2]|0)+(p<<2)>>2]|0;else w=p;d=f[k>>2]|0;f[j>>2]=w;x=b[l>>0]|0;f[i>>2]=f[j>>2];if(!(nb(c,i,x,d)|0)){s=0;break a}p=p+1|0;if(p>>>0>=o>>>0){s=1;break a}}}while(1){if(!(b[a>>0]|0))y=f[(f[r>>2]|0)+(v<<2)>>2]|0;else y=v;p=f[k>>2]|0;f[j>>2]=y;d=b[l>>0]|0;f[i>>2]=f[j>>2];if(!(nb(c,i,d,p)|0)){s=0;break a}p=f[k>>2]|0;d=f[g>>2]|0;x=t;z=0;while(1){f[d+(x<<2)>>2]=f[p+(z<<2)>>2];z=z+1|0;if((z|0)==(n|0))break;else x=x+1|0}v=v+1|0;if(v>>>0>=o>>>0){s=1;break}else t=n+t|0}}while(0);t=f[k>>2]|0;if(t|0){k=f[e>>2]|0;if((k|0)!=(t|0))f[e>>2]=k+(~((k+-4-t|0)>>>2)<<2);fn(t)}q=s;u=h;return q|0}function vc(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0;e=c+8|0;g=f[e+4>>2]|0;h=c+16|0;i=h;j=f[i>>2]|0;k=f[i+4>>2]|0;if(!((g|0)>(k|0)|((g|0)==(k|0)?(f[e>>2]|0)>>>0>j>>>0:0))){l=0;return l|0}e=b[(f[c>>2]|0)+j>>0]|0;g=Tj(j|0,k|0,1,0)|0;k=h;f[k>>2]=g;f[k+4>>2]=I;do switch(e<<24>>24){case 1:{l=Zb(a,c,d)|0;return l|0}case 2:{l=Zb(a,c,d)|0;return l|0}case 3:{l=Zb(a,c,d)|0;return l|0}case 4:{l=Zb(a,c,d)|0;return l|0}case 5:{l=cd(a,c,d)|0;return l|0}case 6:{l=Zb(a,c,d)|0;return l|0}case 7:{l=Zb(a,c,d)|0;return l|0}case 8:{l=Zb(a,c,d)|0;return l|0}case 9:{l=Yb(a,c,d)|0;return l|0}case 10:{l=Xb(a,c,d)|0;return l|0}case 11:{l=Wb(a,c,d)|0;return l|0}case 12:{l=Vb(a,c,d)|0;return l|0}case 13:{l=Ub(a,c,d)|0;return l|0}case 14:{l=Sb(a,c,d)|0;return l|0}case 15:{l=Sb(a,c,d)|0;return l|0}case 16:{l=Sb(a,c,d)|0;return l|0}case 17:{l=Sb(a,c,d)|0;return l|0}case 18:{l=Sb(a,c,d)|0;return l|0}default:{l=0;return l|0}}while(0);return 0}function wc(a,c,d,e,g){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0;h=u;u=u+32|0;i=h+16|0;j=h+12|0;k=h;l=c+24|0;m=b[l>>0]|0;n=m<<24>>24;o=f[a+80>>2]|0;a=X(o,n)|0;p=f[c+28>>2]|0;if((p|0)==(d|0)|(p|0)==(e|0)?b[c+84>>0]|0:0){e=(f[f[c>>2]>>2]|0)+(f[c+48>>2]|0)|0;Id(g,e,e+a|0);q=1;u=h;return q|0}f[k>>2]=0;e=k+4|0;f[e>>2]=0;f[k+8>>2]=0;if(m<<24>>24){if(m<<24>>24<0)ym(k);p=dj(n)|0;f[e>>2]=p;f[k>>2]=p;f[k+8>>2]=p+n;d=p;p=n;do{b[d>>0]=0;d=(f[e>>2]|0)+1|0;f[e>>2]=d;p=p+-1|0}while((p|0)!=0)}Id(g,0,0+a|0);a:do if(!o)r=1;else{a=c+84|0;p=c+68|0;if(m<<24>>24>0){s=0;t=0}else{d=0;while(1){if(!(b[a>>0]|0))v=f[(f[p>>2]|0)+(d<<2)>>2]|0;else v=d;w=f[k>>2]|0;f[j>>2]=v;x=b[l>>0]|0;f[i>>2]=f[j>>2];if(!(pb(c,i,x,w)|0)){r=0;break a}d=d+1|0;if(d>>>0>=o>>>0){r=1;break a}}}while(1){if(!(b[a>>0]|0))y=f[(f[p>>2]|0)+(t<<2)>>2]|0;else y=t;d=f[k>>2]|0;f[j>>2]=y;w=b[l>>0]|0;f[i>>2]=f[j>>2];if(pb(c,i,w,d)|0){z=s;A=0}else{r=0;break a}while(1){b[(f[g>>2]|0)+z>>0]=b[(f[k>>2]|0)+A>>0]|0;A=A+1|0;if((A|0)==(n|0))break;else z=z+1|0}t=t+1|0;if(t>>>0>=o>>>0){r=1;break}else s=n+s|0}}while(0);s=f[k>>2]|0;if(s|0){if((f[e>>2]|0)!=(s|0))f[e>>2]=s;fn(s)}q=r;u=h;return q|0}function xc(a,c,d,e,g){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0;h=u;u=u+32|0;i=h+16|0;j=h+12|0;k=h;l=c+24|0;m=b[l>>0]|0;n=m<<24>>24;o=f[a+80>>2]|0;a=X(o,n)|0;p=f[c+28>>2]|0;if((p|0)==(d|0)|(p|0)==(e|0)?b[c+84>>0]|0:0){e=(f[f[c>>2]>>2]|0)+(f[c+48>>2]|0)|0;Id(g,e,e+a|0);q=1;u=h;return q|0}f[k>>2]=0;e=k+4|0;f[e>>2]=0;f[k+8>>2]=0;if(m<<24>>24){if(m<<24>>24<0)ym(k);p=dj(n)|0;f[e>>2]=p;f[k>>2]=p;f[k+8>>2]=p+n;d=p;p=n;do{b[d>>0]=0;d=(f[e>>2]|0)+1|0;f[e>>2]=d;p=p+-1|0}while((p|0)!=0)}Id(g,0,0+a|0);a:do if(!o)r=1;else{a=c+84|0;p=c+68|0;if(m<<24>>24>0){s=0;t=0}else{d=0;while(1){if(!(b[a>>0]|0))v=f[(f[p>>2]|0)+(d<<2)>>2]|0;else v=d;w=f[k>>2]|0;f[j>>2]=v;x=b[l>>0]|0;f[i>>2]=f[j>>2];if(!(qb(c,i,x,w)|0)){r=0;break a}d=d+1|0;if(d>>>0>=o>>>0){r=1;break a}}}while(1){if(!(b[a>>0]|0))y=f[(f[p>>2]|0)+(t<<2)>>2]|0;else y=t;d=f[k>>2]|0;f[j>>2]=y;w=b[l>>0]|0;f[i>>2]=f[j>>2];if(qb(c,i,w,d)|0){z=s;A=0}else{r=0;break a}while(1){b[(f[g>>2]|0)+z>>0]=b[(f[k>>2]|0)+A>>0]|0;A=A+1|0;if((A|0)==(n|0))break;else z=z+1|0}t=t+1|0;if(t>>>0>=o>>>0){r=1;break}else s=n+s|0}}while(0);s=f[k>>2]|0;if(s|0){if((f[e>>2]|0)!=(s|0))f[e>>2]=s;fn(s)}q=r;u=h;return q|0}function yc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;e=f[b>>2]|0;g=f[b+4>>2]|0;h=((f[c>>2]|0)-e<<3)+(f[c+4>>2]|0)-g|0;c=e;if((h|0)<=0){i=d+4|0;j=f[d>>2]|0;f[a>>2]=j;k=a+4|0;l=f[i>>2]|0;f[k>>2]=l;return}if(!g){e=d+4|0;m=f[e>>2]|0;n=c;o=e;p=h}else{e=32-g|0;q=(h|0)<(e|0)?h:e;r=-1>>>(e-q|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0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0;d=u;u=u+32|0;e=d+16|0;g=d+4|0;i=d;if(!(eg(e,c)|0)){j=-1;u=d;return j|0}k=f[e>>2]|0;if(k|0){l=f[a+8>>2]|0;if(k>>>0>(((f[l+4>>2]|0)-(f[l>>2]|0)>>2>>>0)/3|0)>>>0){j=-1;u=d;return j|0}l=g+4|0;k=a+40|0;m=a+44|0;n=a+36|0;o=0;p=0;do{eg(i,c)|0;f[l>>2]=(f[i>>2]|0)+p;eg(i,c)|0;q=f[i>>2]|0;p=f[l>>2]|0;if(p>>>0>>0){r=22;break}f[g>>2]=p-q;q=f[k>>2]|0;if((q|0)==(f[m>>2]|0))df(n,g);else{f[q>>2]=f[g>>2];f[q+4>>2]=f[g+4>>2];f[q+8>>2]=f[g+8>>2];f[k>>2]=(f[k>>2]|0)+12}o=o+1|0}while(o>>>0<(f[e>>2]|0)>>>0);if((r|0)==22){j=-1;u=d;return j|0}bh(c,0,0)|0;r=f[e>>2]|0;if(r|0){e=a+4|0;o=c+36|0;k=c+32|0;g=c+24|0;n=c+28|0;m=a+36|0;a=0;p=0;while(1){l=f[e>>2]|0;i=(b[o>>0]|0)==0;if(((h[l+36>>0]<<8|h[l+37>>0])&65535)<514)if(!i){l=f[k>>2]|0;q=f[g>>2]|0;s=f[n>>2]|0;t=q+(l>>>3)|0;if(t>>>0>>0){v=(h[t>>0]|0)>>>(l&7)&1;t=l+1|0;f[k>>2]=t;w=t;x=v}else{w=l;x=0}if((q+(w>>>3)|0)>>>0>>0){f[k>>2]=w+1;y=x}else y=x}else y=a;else if(!i){i=f[k>>2]|0;s=(f[g>>2]|0)+(i>>>3)|0;if(s>>>0<(f[n>>2]|0)>>>0){q=(h[s>>0]|0)>>>(i&7)&1;f[k>>2]=i+1;y=q}else y=0}else y=a;q=(f[m>>2]|0)+(p*12|0)+8|0;b[q>>0]=b[q>>0]&-2|y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[d>>2]|0;e=f[v>>2]&n;f[v>>2]=e;f[v>>2]=w<>2]|e;e=v+4|0;f[d>>2]=e;f[e>>2]=f[e>>2]&i|w>>>r;u=u+-32|0;c=(f[b>>2]|0)+4|0;f[b>>2]=c}while((u|0)>31);x=c;y=q&31}else{x=o;y=q}if((y|0)<=0){j=p;k=f[d>>2]|0;f[a>>2]=k;l=a+4|0;m=f[j>>2]|0;f[l>>2]=m;return}q=f[x>>2]&-1>>>(32-y|0);x=(r|0)<(y|0)?r:y;o=f[d>>2]|0;c=f[o>>2]&~(-1<>2]&-1>>>(r-x|0));f[o>>2]=c;f[o>>2]=c|q<>2];c=(f[p>>2]|0)+x|0;r=o+(c>>>5<<2)|0;f[d>>2]=r;f[p>>2]=c&31;c=y-x|0;if((c|0)<=0){j=p;k=f[d>>2]|0;f[a>>2]=k;l=a+4|0;m=f[j>>2]|0;f[l>>2]=m;return}f[r>>2]=f[r>>2]&~(-1>>>(32-c|0))|q>>>x;f[p>>2]=c;j=p;k=f[d>>2]|0;f[a>>2]=k;l=a+4|0;m=f[j>>2]|0;f[l>>2]=m;return}function Cc(a){a=a|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;c=a+32|0;d=f[c>>2]|0;e=d+8|0;g=f[e+4>>2]|0;h=d+16|0;i=h;j=f[i>>2]|0;k=f[i+4>>2]|0;if(!((g|0)>(k|0)|((g|0)==(k|0)?(f[e>>2]|0)>>>0>j>>>0:0))){l=0;return l|0}e=b[(f[d>>2]|0)+j>>0]|0;d=Tj(j|0,k|0,1,0)|0;k=h;f[k>>2]=d;f[k+4>>2]=I;k=e&255;d=e<<24>>24==0;a:do if(!d){e=0;while(1){if(!(Ma[f[(f[a>>2]|0)+16>>2]&127](a,e)|0)){l=0;break}e=e+1|0;if((e|0)>=(k|0))break a}return l|0}while(0);e=a+8|0;h=f[e>>2]|0;j=f[a+12>>2]|0;b:do if((h|0)!=(j|0)){g=a+4|0;i=h;while(1){m=f[i>>2]|0;i=i+4|0;if(!(Na[f[(f[m>>2]|0)+8>>2]&31](m,a,f[g>>2]|0)|0)){l=0;break}if((i|0)==(j|0))break b}return l|0}while(0);if(!d){j=0;do{h=f[(f[e>>2]|0)+(j<<2)>>2]|0;j=j+1|0;if(!(Ma[f[(f[h>>2]|0)+12>>2]&127](h,f[c>>2]|0)|0)){l=0;n=26;break}}while((j|0)<(k|0));if((n|0)==26)return l|0;if(!d){d=a+20|0;n=a+24|0;j=0;do{c=f[(f[e>>2]|0)+(j<<2)>>2]|0;h=La[f[(f[c>>2]|0)+24>>2]&127](c)|0;if((h|0)>0){c=0;do{i=f[(f[e>>2]|0)+(j<<2)>>2]|0;g=Ma[f[(f[i>>2]|0)+20>>2]&127](i,c)|0;i=f[n>>2]|0;m=f[d>>2]|0;o=i-m>>2;p=m;do if(g>>>0>=o>>>0){m=g+1|0;q=i;if(m>>>0>o>>>0){jf(d,m-o|0);r=f[d>>2]|0;break}if(m>>>0>>0?(s=p+(m<<2)|0,(q|0)!=(s|0)):0){f[n>>2]=q+(~((q+-4-s|0)>>>2)<<2);r=p}else r=p}else r=p;while(0);f[r+(g<<2)>>2]=j;c=c+1|0}while((c|0)!=(h|0))}j=j+1|0}while((j|0)!=(k|0))}}if(!(La[f[(f[a>>2]|0)+28>>2]&127](a)|0)){l=0;return l|0}l=La[f[(f[a>>2]|0)+32>>2]&127](a)|0;return l|0}function Dc(a){a=a|0;var b=0,c=0,d=0,e=0;f[a>>2]=2296;b=a+368|0;c=f[b>>2]|0;f[b>>2]=0;if(c|0){b=c+-4|0;d=f[b>>2]|0;if(d|0){e=c+(d<<4)|0;do{e=e+-16|0;ln(e)}while((e|0)!=(c|0))}dn(b)}ln(a+352|0);ln(a+312|0);ln(a+296|0);ln(a+256|0);gf(a+216|0);b=f[a+196>>2]|0;if(b|0){c=a+200|0;e=f[c>>2]|0;if((e|0)!=(b|0))f[c>>2]=e+(~((e+-4-b|0)>>>2)<<2);fn(b)}b=f[a+184>>2]|0;if(b|0){e=a+188|0;c=f[e>>2]|0;if((c|0)!=(b|0))f[e>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+172>>2]|0;if(b|0){c=a+176|0;e=f[c>>2]|0;if((e|0)!=(b|0))f[c>>2]=e+(~((e+-4-b|0)>>>2)<<2);fn(b)}b=f[a+160>>2]|0;if(b|0){e=a+164|0;c=f[e>>2]|0;if((c|0)!=(b|0))f[e>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+144>>2]|0;if(b|0){c=b;do{b=c;c=f[c>>2]|0;fn(b)}while((c|0)!=0)}c=a+136|0;b=f[c>>2]|0;f[c>>2]=0;if(b|0)fn(b);b=f[a+120>>2]|0;if(b|0)fn(b);b=f[a+108>>2]|0;if(b|0)fn(b);b=f[a+96>>2]|0;if(b|0)fn(b);b=f[a+72>>2]|0;if(b|0){c=a+76|0;e=f[c>>2]|0;if((e|0)!=(b|0))f[c>>2]=e+(~((e+-4-b|0)>>>2)<<2);fn(b)}b=f[a+60>>2]|0;if(b|0)fn(b);b=f[a+48>>2]|0;if(b|0){e=a+52|0;c=f[e>>2]|0;if((c|0)!=(b|0))f[e>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+36>>2]|0;if(b|0){c=a+40|0;e=f[c>>2]|0;if((e|0)!=(b|0))f[c>>2]=e+(~(((e+-12-b|0)>>>0)/12|0)*12|0);fn(b)}b=f[a+24>>2]|0;if(b|0){e=a+28|0;c=f[e>>2]|0;if((c|0)!=(b|0))f[e>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+12>>2]|0;if(b|0){c=a+16|0;e=f[c>>2]|0;if((e|0)!=(b|0))f[c>>2]=e+(~((e+-4-b|0)>>>2)<<2);fn(b)}b=a+8|0;a=f[b>>2]|0;f[b>>2]=0;if(!a)return;of(a);fn(a);return}function Ec(a){a=a|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0;c=u;u=u+16|0;d=c;e=La[f[(f[a>>2]|0)+24>>2]&127](a)|0;if((e|0)<=0){g=1;u=c;return g|0}h=a+36|0;i=a+48|0;j=d+8|0;k=d+4|0;l=d+11|0;m=0;while(1){n=(La[f[(f[a>>2]|0)+28>>2]&127](a)|0)+40|0;if((f[n>>2]|0)!=0?(n=f[(f[h>>2]|0)+(m<<2)>>2]|0,o=f[n+8>>2]|0,p=Je(n)|0,(p|0)!=0):0){n=(La[f[(f[a>>2]|0)+28>>2]&127](a)|0)+40|0;q=f[n>>2]|0;n=f[o+56>>2]|0;o=dj(32)|0;f[d>>2]=o;f[j>>2]=-2147483616;f[k>>2]=24;r=o;s=8412;t=r+24|0;do{b[r>>0]=b[s>>0]|0;r=r+1|0;s=s+1|0}while((r|0)<(t|0));b[o+24>>0]=0;s=q+16|0;r=f[s>>2]|0;if(r){t=s;v=r;a:while(1){r=v;while(1){if((f[r+16>>2]|0)>=(n|0))break;w=f[r+4>>2]|0;if(!w){x=t;break a}else r=w}v=f[r>>2]|0;if(!v){x=r;break}else t=r}if(((x|0)!=(s|0)?(n|0)>=(f[x+16>>2]|0):0)?(t=x+20|0,(Ge(t,d)|0)!=0):0)y=wg(t,d,0)|0;else z=14}else z=14;if((z|0)==14){z=0;y=wg(q,d,0)|0}if((b[l>>0]|0)<0)fn(f[d>>2]|0);if(y)Zc(f[(f[(f[h>>2]|0)+(m<<2)>>2]|0)+8>>2]|0,p);else z=19}else z=19;if((z|0)==19?(z=0,t=f[(f[h>>2]|0)+(m<<2)>>2]|0,!(Ma[f[(f[t>>2]|0)+24>>2]&127](t,i)|0)):0){g=0;z=21;break}m=m+1|0;if((m|0)>=(e|0)){g=1;z=21;break}}if((z|0)==21){u=c;return g|0}return 0}function Fc(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;d=u;u=u+32|0;e=d;g=a+8|0;h=f[g>>2]|0;i=a+4|0;j=f[i>>2]|0;if(((h-j|0)/144|0)>>>0>=c>>>0){k=j;l=c;do{f[k>>2]=-1;$g(k+4|0);b[k+100>>0]=1;m=k+104|0;n=m+40|0;do{f[m>>2]=0;m=m+4|0}while((m|0)<(n|0));k=(f[i>>2]|0)+144|0;f[i>>2]=k;l=l+-1|0}while((l|0)!=0);u=d;return}l=f[a>>2]|0;k=(j-l|0)/144|0;j=k+c|0;if(j>>>0>29826161)ym(a);o=(h-l|0)/144|0;l=o<<1;h=o>>>0<14913080?(l>>>0>>0?j:l):29826161;f[e+12>>2]=0;f[e+16>>2]=a+8;do if(h)if(h>>>0>29826161){l=ra(8)|0;$k(l,9793);f[l>>2]=3708;va(l|0,856,80)}else{p=dj(h*144|0)|0;break}else p=0;while(0);f[e>>2]=p;l=p+(k*144|0)|0;k=e+8|0;f[k>>2]=l;j=e+4|0;f[j>>2]=l;o=e+12|0;f[o>>2]=p+(h*144|0);h=l;l=c;do{f[h>>2]=-1;$g(h+4|0);b[h+100>>0]=1;m=h+104|0;n=m+40|0;do{f[m>>2]=0;m=m+4|0}while((m|0)<(n|0));h=(f[k>>2]|0)+144|0;f[k>>2]=h;l=l+-1|0}while((l|0)!=0);l=f[a>>2]|0;h=f[i>>2]|0;if((h|0)==(l|0)){q=j;r=f[j>>2]|0;s=l;t=h}else{m=f[j>>2]|0;n=h;do{m=m+-144|0;n=n+-144|0;oc(m,n)}while((n|0)!=(l|0));f[j>>2]=m;q=j;r=m;s=f[a>>2]|0;t=f[i>>2]|0}f[a>>2]=r;f[q>>2]=s;f[i>>2]=f[k>>2];f[k>>2]=t;t=f[g>>2]|0;f[g>>2]=f[o>>2];f[o>>2]=t;f[e>>2]=f[q>>2];nf(e);u=d;return}function Gc(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;d=(c|0)==(a|0);b[c+12>>0]=d&1;if(d)return;else e=c;while(1){g=f[e+8>>2]|0;c=g+12|0;if(b[c>>0]|0){h=23;break}i=g+8|0;j=f[i>>2]|0;d=f[j>>2]|0;if((d|0)==(g|0)){k=f[j+4>>2]|0;if(!k){h=7;break}l=k+12|0;if(!(b[l>>0]|0))m=l;else{h=7;break}}else{if(!d){h=16;break}l=d+12|0;if(!(b[l>>0]|0))m=l;else{h=16;break}}b[c>>0]=1;c=(j|0)==(a|0);b[j+12>>0]=c&1;b[m>>0]=1;if(c){h=23;break}else e=j}if((h|0)==7){if((f[g>>2]|0)==(e|0)){n=g;o=j}else{m=g+4|0;a=f[m>>2]|0;c=f[a>>2]|0;f[m>>2]=c;if(!c)p=j;else{f[c+8>>2]=g;p=f[i>>2]|0}f[a+8>>2]=p;p=f[i>>2]|0;f[((f[p>>2]|0)==(g|0)?p:p+4|0)>>2]=a;f[a>>2]=g;f[i>>2]=a;n=a;o=f[a+8>>2]|0}b[n+12>>0]=1;b[o+12>>0]=0;n=f[o>>2]|0;a=n+4|0;p=f[a>>2]|0;f[o>>2]=p;if(p|0)f[p+8>>2]=o;p=o+8|0;f[n+8>>2]=f[p>>2];c=f[p>>2]|0;f[((f[c>>2]|0)==(o|0)?c:c+4|0)>>2]=n;f[a>>2]=o;f[p>>2]=n;return}else if((h|0)==16){if((f[g>>2]|0)==(e|0)){e=f[g>>2]|0;n=e+4|0;p=f[n>>2]|0;f[g>>2]=p;if(!p)q=j;else{f[p+8>>2]=g;q=f[i>>2]|0}f[e+8>>2]=q;q=f[i>>2]|0;f[((f[q>>2]|0)==(g|0)?q:q+4|0)>>2]=e;f[n>>2]=g;f[i>>2]=e;r=e;s=f[e+8>>2]|0}else{r=g;s=j}b[r+12>>0]=1;b[s+12>>0]=0;r=s+4|0;j=f[r>>2]|0;g=f[j>>2]|0;f[r>>2]=g;if(g|0)f[g+8>>2]=s;g=s+8|0;f[j+8>>2]=f[g>>2];r=f[g>>2]|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0)<0)<<31>>31|0)|0,j=I,j>>>0<0|(j|0)==0&k>>>0<2147483647):0){j=k+1|0;f[a+20>>2]=j;k=(j|0)/2|0;l=a+24|0;f[l>>2]=k;f[a+28>>2]=0-k;if(!(j&1)){f[l>>2]=k+-1;q=1}else q=1}else q=0}else q=0;ln(d);n=q;u=c;return n|0}function Ic(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;g=f[(f[(f[b+4>>2]|0)+8>>2]|0)+(d<<2)>>2]|0;if(!((c+-1|0)>>>0<6&(La[f[(f[b>>2]|0)+8>>2]&127](b)|0)==1)){h=0;f[a>>2]=h;return}i=La[f[(f[b>>2]|0)+36>>2]&127](b)|0;j=Ma[f[(f[b>>2]|0)+44>>2]&127](b,d)|0;if((i|0)==0|(j|0)==0){h=0;f[a>>2]=h;return}k=Ma[f[(f[b>>2]|0)+40>>2]&127](b,d)|0;d=f[b+44>>2]|0;b=j+12|0;l=(c|0)==6;if(!k){if(l){c=dj(104)|0;f[c+4>>2]=g;m=c+8|0;f[m>>2]=f[e>>2];f[m+4>>2]=f[e+4>>2];f[m+8>>2]=f[e+8>>2];f[m+12>>2]=f[e+12>>2];f[c+24>>2]=d;f[c+28>>2]=i;f[c+32>>2]=b;f[c+36>>2]=j;f[c>>2]=2024;f[c+44>>2]=0;f[c+48>>2]=0;f[c+52>>2]=d;f[c+56>>2]=i;f[c+60>>2]=b;f[c+64>>2]=j;f[c+40>>2]=2080;f[c+68>>2]=1;i=c+72|0;f[i>>2]=-1;f[i+4>>2]=-1;f[i+8>>2]=-1;f[i+12>>2]=-1;Vk(c+88|0);h=c;f[a>>2]=h;return}}else if(l){l=dj(104)|0;f[l+4>>2]=g;g=l+8|0;f[g>>2]=f[e>>2];f[g+4>>2]=f[e+4>>2];f[g+8>>2]=f[e+8>>2];f[g+12>>2]=f[e+12>>2];f[l+24>>2]=d;f[l+28>>2]=k;f[l+32>>2]=b;f[l+36>>2]=j;f[l>>2]=1940;f[l+44>>2]=0;f[l+48>>2]=0;f[l+52>>2]=d;f[l+56>>2]=k;f[l+60>>2]=b;f[l+64>>2]=j;f[l+40>>2]=1996;f[l+68>>2]=1;j=l+72|0;f[j>>2]=-1;f[j+4>>2]=-1;f[j+8>>2]=-1;f[j+12>>2]=-1;Vk(l+88|0);h=l;f[a>>2]=h;return}f[a>>2]=0;f[a>>2]=0;h=0;f[a>>2]=h;return}function Jc(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=2464;Ud(a+232|0);gf(a+216|0);b=f[a+196>>2]|0;if(b|0){c=a+200|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+184>>2]|0;if(b|0){d=a+188|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+172>>2]|0;if(b|0){c=a+176|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+160>>2]|0;if(b|0){d=a+164|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+144>>2]|0;if(b|0){c=b;do{b=c;c=f[c>>2]|0;fn(b)}while((c|0)!=0)}c=a+136|0;b=f[c>>2]|0;f[c>>2]=0;if(b|0)fn(b);b=f[a+120>>2]|0;if(b|0)fn(b);b=f[a+108>>2]|0;if(b|0)fn(b);b=f[a+96>>2]|0;if(b|0)fn(b);b=f[a+72>>2]|0;if(b|0){c=a+76|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+60>>2]|0;if(b|0)fn(b);b=f[a+48>>2]|0;if(b|0){d=a+52|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+36>>2]|0;if(b|0){c=a+40|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~(((d+-12-b|0)>>>0)/12|0)*12|0);fn(b)}b=f[a+24>>2]|0;if(b|0){d=a+28|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+12>>2]|0;if(b|0){c=a+16|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=a+8|0;a=f[b>>2]|0;f[b>>2]=0;if(!a)return;of(a);fn(a);return}function Kc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;c=u;u=u+32|0;d=c+16|0;e=c;g=0;do{eg(d,b)|0;i=f[d>>2]|0;if(i|0){j=a+60+(g*12|0)|0;Ac(j,i,0);Vk(e);if(!(sd(e,b)|0)){k=9;break}if(f[d>>2]|0){i=0;do{l=Xg(e)|0;m=(f[j>>2]|0)+(i>>>5<<2)|0;n=1<<(i&31);o=f[m>>2]|0;f[m>>2]=l?o|n:o&~n;i=i+1|0}while(i>>>0<(f[d>>2]|0)>>>0)}ln(e)}g=g+1|0}while((g|0)<4);if((k|0)==9){ln(e);p=0;u=c;return p|0}e=b+8|0;k=f[e>>2]|0;g=f[e+4>>2]|0;e=b+16|0;d=e;i=f[d>>2]|0;j=f[d+4>>2]|0;d=Tj(i|0,j|0,4,0)|0;n=I;if((g|0)<(n|0)|(g|0)==(n|0)&k>>>0>>0){p=0;u=c;return p|0}o=f[b>>2]|0;b=o+i|0;l=h[b>>0]|h[b+1>>0]<<8|h[b+2>>0]<<16|h[b+3>>0]<<24;b=e;f[b>>2]=d;f[b+4>>2]=n;n=Tj(i|0,j|0,8,0)|0;j=I;if((g|0)<(j|0)|(g|0)==(j|0)&k>>>0>>0){p=0;u=c;return p|0}k=o+d|0;d=h[k>>0]|h[k+1>>0]<<8|h[k+2>>0]<<16|h[k+3>>0]<<24;k=e;f[k>>2]=n;f[k+4>>2]=j;if((l|0)>(d|0)){p=0;u=c;return p|0}f[a+12>>2]=l;f[a+16>>2]=d;j=Vj(d|0,((d|0)<0)<<31>>31|0,l|0,((l|0)<0)<<31>>31|0)|0;l=I;if(!(l>>>0<0|(l|0)==0&j>>>0<2147483647)){p=0;u=c;return p|0}l=j+1|0;f[a+20>>2]=l;j=(l|0)/2|0;d=a+24|0;f[d>>2]=j;f[a+28>>2]=0-j;if(l&1|0){p=1;u=c;return p|0}f[d>>2]=j+-1;p=1;u=c;return p|0}function Lc(a,c){a=a|0;c=c|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;if(!(d[c+38>>1]|0)){e=0;return e|0}g=a+12|0;if(!(eg(g,c)|0)){e=0;return e|0}h=f[g>>2]|0;i=a+4|0;j=f[i>>2]|0;k=f[a>>2]|0;l=j-k>>2;m=k;k=j;if(h>>>0<=l>>>0)if(h>>>0>>0?(j=m+(h<<2)|0,(k|0)!=(j|0)):0){f[i>>2]=k+(~((k+-4-j|0)>>>2)<<2);n=h}else n=h;else{jf(a,h-l|0);n=f[g>>2]|0}if(!n){e=1;return e|0}l=c+8|0;h=c+16|0;j=n;n=0;a:while(1){k=l;i=f[k>>2]|0;m=f[k+4>>2]|0;k=h;o=f[k>>2]|0;p=f[k+4>>2]|0;if(!((m|0)>(p|0)|(m|0)==(p|0)&i>>>0>o>>>0)){e=0;q=19;break}k=f[c>>2]|0;r=b[k+o>>0]|0;s=Tj(o|0,p|0,1,0)|0;p=I;o=h;f[o>>2]=s;f[o+4>>2]=p;o=r&255;t=o&3;u=o>>>2;switch(r&3){case 3:{r=u+n|0;if(r>>>0>=j>>>0){e=0;q=19;break a}Vf((f[a>>2]|0)+(n<<2)|0,0,(u<<2)+4|0)|0;v=r;break}case 0:{w=u;q=16;break}default:{r=p;p=s;s=0;o=u;while(1){if(!((m|0)>(r|0)|(m|0)==(r|0)&i>>>0>p>>>0)){e=0;q=19;break a}u=b[k+p>>0]|0;p=Tj(p|0,r|0,1,0)|0;r=I;x=h;f[x>>2]=p;f[x+4>>2]=r;x=(u&255)<<(s<<3|6)|o;s=s+1|0;if((s|0)>=(t|0)){w=x;q=16;break}else o=x}}}if((q|0)==16){q=0;f[(f[a>>2]|0)+(n<<2)>>2]=w;v=n}n=v+1|0;j=f[g>>2]|0;if(n>>>0>=j>>>0){q=18;break}}if((q|0)==18){e=pe(a+16|0,f[a>>2]|0,j)|0;return e|0}else if((q|0)==19)return e|0;return 0}function Mc(a,c){a=a|0;c=c|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;if(!(d[c+38>>1]|0)){e=0;return e|0}g=a+12|0;if(!(eg(g,c)|0)){e=0;return e|0}h=f[g>>2]|0;i=a+4|0;j=f[i>>2]|0;k=f[a>>2]|0;l=j-k>>2;m=k;k=j;if(h>>>0<=l>>>0)if(h>>>0>>0?(j=m+(h<<2)|0,(k|0)!=(j|0)):0){f[i>>2]=k+(~((k+-4-j|0)>>>2)<<2);n=h}else n=h;else{jf(a,h-l|0);n=f[g>>2]|0}if(!n){e=1;return e|0}l=c+8|0;h=c+16|0;j=n;n=0;a:while(1){k=l;i=f[k>>2]|0;m=f[k+4>>2]|0;k=h;o=f[k>>2]|0;p=f[k+4>>2]|0;if(!((m|0)>(p|0)|(m|0)==(p|0)&i>>>0>o>>>0)){e=0;q=19;break}k=f[c>>2]|0;r=b[k+o>>0]|0;s=Tj(o|0,p|0,1,0)|0;p=I;o=h;f[o>>2]=s;f[o+4>>2]=p;o=r&255;t=o&3;u=o>>>2;switch(r&3){case 3:{r=u+n|0;if(r>>>0>=j>>>0){e=0;q=19;break a}Vf((f[a>>2]|0)+(n<<2)|0,0,(u<<2)+4|0)|0;v=r;break}case 0:{w=u;q=16;break}default:{r=p;p=s;s=0;o=u;while(1){if(!((m|0)>(r|0)|(m|0)==(r|0)&i>>>0>p>>>0)){e=0;q=19;break a}u=b[k+p>>0]|0;p=Tj(p|0,r|0,1,0)|0;r=I;x=h;f[x>>2]=p;f[x+4>>2]=r;x=(u&255)<<(s<<3|6)|o;s=s+1|0;if((s|0)>=(t|0)){w=x;q=16;break}else o=x}}}if((q|0)==16){q=0;f[(f[a>>2]|0)+(n<<2)>>2]=w;v=n}n=v+1|0;j=f[g>>2]|0;if(n>>>0>=j>>>0){q=18;break}}if((q|0)==18){e=qe(a+16|0,f[a>>2]|0,j)|0;return e|0}else if((q|0)==19)return e|0;return 0}function Nc(a,c){a=a|0;c=c|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;if(!(d[c+38>>1]|0)){e=0;return e|0}g=a+12|0;if(!(eg(g,c)|0)){e=0;return e|0}h=f[g>>2]|0;i=a+4|0;j=f[i>>2]|0;k=f[a>>2]|0;l=j-k>>2;m=k;k=j;if(h>>>0<=l>>>0)if(h>>>0>>0?(j=m+(h<<2)|0,(k|0)!=(j|0)):0){f[i>>2]=k+(~((k+-4-j|0)>>>2)<<2);n=h}else n=h;else{jf(a,h-l|0);n=f[g>>2]|0}if(!n){e=1;return e|0}l=c+8|0;h=c+16|0;j=n;n=0;a:while(1){k=l;i=f[k>>2]|0;m=f[k+4>>2]|0;k=h;o=f[k>>2]|0;p=f[k+4>>2]|0;if(!((m|0)>(p|0)|(m|0)==(p|0)&i>>>0>o>>>0)){e=0;q=19;break}k=f[c>>2]|0;r=b[k+o>>0]|0;s=Tj(o|0,p|0,1,0)|0;p=I;o=h;f[o>>2]=s;f[o+4>>2]=p;o=r&255;t=o&3;u=o>>>2;switch(r&3){case 3:{r=u+n|0;if(r>>>0>=j>>>0){e=0;q=19;break a}Vf((f[a>>2]|0)+(n<<2)|0,0,(u<<2)+4|0)|0;v=r;break}case 0:{w=u;q=16;break}default:{r=p;p=s;s=0;o=u;while(1){if(!((m|0)>(r|0)|(m|0)==(r|0)&i>>>0>p>>>0)){e=0;q=19;break a}u=b[k+p>>0]|0;p=Tj(p|0,r|0,1,0)|0;r=I;x=h;f[x>>2]=p;f[x+4>>2]=r;x=(u&255)<<(s<<3|6)|o;s=s+1|0;if((s|0)>=(t|0)){w=x;q=16;break}else o=x}}}if((q|0)==16){q=0;f[(f[a>>2]|0)+(n<<2)>>2]=w;v=n}n=v+1|0;j=f[g>>2]|0;if(n>>>0>=j>>>0){q=18;break}}if((q|0)==18){e=re(a+16|0,f[a>>2]|0,j)|0;return e|0}else if((q|0)==19)return e|0;return 0}function Oc(a,c){a=a|0;c=c|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;if(!(d[c+38>>1]|0)){e=0;return e|0}g=a+12|0;if(!(eg(g,c)|0)){e=0;return e|0}h=f[g>>2]|0;i=a+4|0;j=f[i>>2]|0;k=f[a>>2]|0;l=j-k>>2;m=k;k=j;if(h>>>0<=l>>>0)if(h>>>0>>0?(j=m+(h<<2)|0,(k|0)!=(j|0)):0){f[i>>2]=k+(~((k+-4-j|0)>>>2)<<2);n=h}else n=h;else{jf(a,h-l|0);n=f[g>>2]|0}if(!n){e=1;return e|0}l=c+8|0;h=c+16|0;j=n;n=0;a:while(1){k=l;i=f[k>>2]|0;m=f[k+4>>2]|0;k=h;o=f[k>>2]|0;p=f[k+4>>2]|0;if(!((m|0)>(p|0)|(m|0)==(p|0)&i>>>0>o>>>0)){e=0;q=19;break}k=f[c>>2]|0;r=b[k+o>>0]|0;s=Tj(o|0,p|0,1,0)|0;p=I;o=h;f[o>>2]=s;f[o+4>>2]=p;o=r&255;t=o&3;u=o>>>2;switch(r&3){case 3:{r=u+n|0;if(r>>>0>=j>>>0){e=0;q=19;break a}Vf((f[a>>2]|0)+(n<<2)|0,0,(u<<2)+4|0)|0;v=r;break}case 0:{w=u;q=16;break}default:{r=p;p=s;s=0;o=u;while(1){if(!((m|0)>(r|0)|(m|0)==(r|0)&i>>>0>p>>>0)){e=0;q=19;break a}u=b[k+p>>0]|0;p=Tj(p|0,r|0,1,0)|0;r=I;x=h;f[x>>2]=p;f[x+4>>2]=r;x=(u&255)<<(s<<3|6)|o;s=s+1|0;if((s|0)>=(t|0)){w=x;q=16;break}else o=x}}}if((q|0)==16){q=0;f[(f[a>>2]|0)+(n<<2)>>2]=w;v=n}n=v+1|0;j=f[g>>2]|0;if(n>>>0>=j>>>0){q=18;break}}if((q|0)==18){e=te(a+16|0,f[a>>2]|0,j)|0;return e|0}else if((q|0)==19)return e|0;return 0}function Pc(a,c){a=a|0;c=c|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;if(!(d[c+38>>1]|0)){e=0;return e|0}g=a+12|0;if(!(eg(g,c)|0)){e=0;return e|0}h=f[g>>2]|0;i=a+4|0;j=f[i>>2]|0;k=f[a>>2]|0;l=j-k>>2;m=k;k=j;if(h>>>0<=l>>>0)if(h>>>0>>0?(j=m+(h<<2)|0,(k|0)!=(j|0)):0){f[i>>2]=k+(~((k+-4-j|0)>>>2)<<2);n=h}else n=h;else{jf(a,h-l|0);n=f[g>>2]|0}if(!n){e=1;return e|0}l=c+8|0;h=c+16|0;j=n;n=0;a:while(1){k=l;i=f[k>>2]|0;m=f[k+4>>2]|0;k=h;o=f[k>>2]|0;p=f[k+4>>2]|0;if(!((m|0)>(p|0)|(m|0)==(p|0)&i>>>0>o>>>0)){e=0;q=19;break}k=f[c>>2]|0;r=b[k+o>>0]|0;s=Tj(o|0,p|0,1,0)|0;p=I;o=h;f[o>>2]=s;f[o+4>>2]=p;o=r&255;t=o&3;u=o>>>2;switch(r&3){case 3:{r=u+n|0;if(r>>>0>=j>>>0){e=0;q=19;break a}Vf((f[a>>2]|0)+(n<<2)|0,0,(u<<2)+4|0)|0;v=r;break}case 0:{w=u;q=16;break}default:{r=p;p=s;s=0;o=u;while(1){if(!((m|0)>(r|0)|(m|0)==(r|0)&i>>>0>p>>>0)){e=0;q=19;break a}u=b[k+p>>0]|0;p=Tj(p|0,r|0,1,0)|0;r=I;x=h;f[x>>2]=p;f[x+4>>2]=r;x=(u&255)<<(s<<3|6)|o;s=s+1|0;if((s|0)>=(t|0)){w=x;q=16;break}else o=x}}}if((q|0)==16){q=0;f[(f[a>>2]|0)+(n<<2)>>2]=w;v=n}n=v+1|0;j=f[g>>2]|0;if(n>>>0>=j>>>0){q=18;break}}if((q|0)==18){e=ue(a+16|0,f[a>>2]|0,j)|0;return e|0}else if((q|0)==19)return e|0;return 0}function Qc(a,c){a=a|0;c=c|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;if(!(d[c+38>>1]|0)){e=0;return e|0}g=a+12|0;if(!(eg(g,c)|0)){e=0;return e|0}h=f[g>>2]|0;i=a+4|0;j=f[i>>2]|0;k=f[a>>2]|0;l=j-k>>2;m=k;k=j;if(h>>>0<=l>>>0)if(h>>>0>>0?(j=m+(h<<2)|0,(k|0)!=(j|0)):0){f[i>>2]=k+(~((k+-4-j|0)>>>2)<<2);n=h}else n=h;else{jf(a,h-l|0);n=f[g>>2]|0}if(!n){e=1;return e|0}l=c+8|0;h=c+16|0;j=n;n=0;a:while(1){k=l;i=f[k>>2]|0;m=f[k+4>>2]|0;k=h;o=f[k>>2]|0;p=f[k+4>>2]|0;if(!((m|0)>(p|0)|(m|0)==(p|0)&i>>>0>o>>>0)){e=0;q=19;break}k=f[c>>2]|0;r=b[k+o>>0]|0;s=Tj(o|0,p|0,1,0)|0;p=I;o=h;f[o>>2]=s;f[o+4>>2]=p;o=r&255;t=o&3;u=o>>>2;switch(r&3){case 3:{r=u+n|0;if(r>>>0>=j>>>0){e=0;q=19;break a}Vf((f[a>>2]|0)+(n<<2)|0,0,(u<<2)+4|0)|0;v=r;break}case 0:{w=u;q=16;break}default:{r=p;p=s;s=0;o=u;while(1){if(!((m|0)>(r|0)|(m|0)==(r|0)&i>>>0>p>>>0)){e=0;q=19;break a}u=b[k+p>>0]|0;p=Tj(p|0,r|0,1,0)|0;r=I;x=h;f[x>>2]=p;f[x+4>>2]=r;x=(u&255)<<(s<<3|6)|o;s=s+1|0;if((s|0)>=(t|0)){w=x;q=16;break}else o=x}}}if((q|0)==16){q=0;f[(f[a>>2]|0)+(n<<2)>>2]=w;v=n}n=v+1|0;j=f[g>>2]|0;if(n>>>0>=j>>>0){q=18;break}}if((q|0)==18){e=ve(a+16|0,f[a>>2]|0,j)|0;return e|0}else if((q|0)==19)return e|0;return 0}function Rc(a,c){a=a|0;c=c|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;if(!(d[c+38>>1]|0)){e=0;return e|0}g=a+12|0;if(!(eg(g,c)|0)){e=0;return e|0}h=f[g>>2]|0;i=a+4|0;j=f[i>>2]|0;k=f[a>>2]|0;l=j-k>>2;m=k;k=j;if(h>>>0<=l>>>0)if(h>>>0>>0?(j=m+(h<<2)|0,(k|0)!=(j|0)):0){f[i>>2]=k+(~((k+-4-j|0)>>>2)<<2);n=h}else n=h;else{jf(a,h-l|0);n=f[g>>2]|0}if(!n){e=1;return e|0}l=c+8|0;h=c+16|0;j=n;n=0;a:while(1){k=l;i=f[k>>2]|0;m=f[k+4>>2]|0;k=h;o=f[k>>2]|0;p=f[k+4>>2]|0;if(!((m|0)>(p|0)|(m|0)==(p|0)&i>>>0>o>>>0)){e=0;q=19;break}k=f[c>>2]|0;r=b[k+o>>0]|0;s=Tj(o|0,p|0,1,0)|0;p=I;o=h;f[o>>2]=s;f[o+4>>2]=p;o=r&255;t=o&3;u=o>>>2;switch(r&3){case 3:{r=u+n|0;if(r>>>0>=j>>>0){e=0;q=19;break a}Vf((f[a>>2]|0)+(n<<2)|0,0,(u<<2)+4|0)|0;v=r;break}case 0:{w=u;q=16;break}default:{r=p;p=s;s=0;o=u;while(1){if(!((m|0)>(r|0)|(m|0)==(r|0)&i>>>0>p>>>0)){e=0;q=19;break a}u=b[k+p>>0]|0;p=Tj(p|0,r|0,1,0)|0;r=I;x=h;f[x>>2]=p;f[x+4>>2]=r;x=(u&255)<<(s<<3|6)|o;s=s+1|0;if((s|0)>=(t|0)){w=x;q=16;break}else o=x}}}if((q|0)==16){q=0;f[(f[a>>2]|0)+(n<<2)>>2]=w;v=n}n=v+1|0;j=f[g>>2]|0;if(n>>>0>=j>>>0){q=18;break}}if((q|0)==18){e=we(a+16|0,f[a>>2]|0,j)|0;return e|0}else if((q|0)==19)return e|0;return 0}function Sc(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=u;u=u+16|0;e=d;if(!(Lb(a,c)|0)){g=0;u=d;return g|0}h=La[f[(f[a>>2]|0)+24>>2]&127](a)|0;i=a+36|0;j=a+40|0;k=f[j>>2]|0;l=f[i>>2]|0;m=k-l>>2;n=l;l=k;if(h>>>0<=m>>>0){if(h>>>0>>0?(k=n+(h<<2)|0,(l|0)!=(k|0)):0){n=l;do{l=n+-4|0;f[j>>2]=l;o=f[l>>2]|0;f[l>>2]=0;if(o|0)Qa[f[(f[o>>2]|0)+4>>2]&127](o);n=f[j>>2]|0}while((n|0)!=(k|0))}}else Jd(i,h-m|0);m=c+8|0;if((h|0)<=0){g=1;u=d;return g|0}k=c+16|0;n=0;while(1){j=m;o=f[j+4>>2]|0;l=k;p=f[l>>2]|0;q=f[l+4>>2]|0;if(!((o|0)>(q|0)|((o|0)==(q|0)?(f[j>>2]|0)>>>0>p>>>0:0))){g=0;r=19;break}j=b[(f[c>>2]|0)+p>>0]|0;o=Tj(p|0,q|0,1,0)|0;q=k;f[q>>2]=o;f[q+4>>2]=I;Sa[f[(f[a>>2]|0)+48>>2]&7](e,a,j);j=(f[i>>2]|0)+(n<<2)|0;q=f[e>>2]|0;f[e>>2]=0;o=f[j>>2]|0;f[j>>2]=q;if(o|0)Qa[f[(f[o>>2]|0)+4>>2]&127](o);o=f[e>>2]|0;f[e>>2]=0;if(o|0)Qa[f[(f[o>>2]|0)+4>>2]&127](o);o=f[(f[i>>2]|0)+(n<<2)>>2]|0;if(!o){g=0;r=19;break}q=f[(f[o>>2]|0)+8>>2]|0;j=La[f[(f[a>>2]|0)+28>>2]&127](a)|0;p=Ma[f[(f[a>>2]|0)+20>>2]&127](a,n)|0;n=n+1|0;if(!(Na[q&31](o,j,p)|0)){g=0;r=19;break}if((n|0)>=(h|0)){g=1;r=19;break}}if((r|0)==19){u=d;return g|0}return 0}function Tc(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,o=0,p=0;d=u;u=u+16|0;e=d+12|0;g=d;h=dj(52)|0;f[h>>2]=0;f[h+4>>2]=0;f[h+8>>2]=0;f[h+12>>2]=0;n[h+16>>2]=$(1.0);i=h+20|0;f[i>>2]=0;f[i+4>>2]=0;f[i+8>>2]=0;f[i+12>>2]=0;n[h+36>>2]=$(1.0);f[h+40>>2]=0;f[h+44>>2]=0;f[h+48>>2]=0;Hm(e);if(ce(e,f[c+32>>2]|0,h)|0){e=(f[c+4>>2]|0)+4|0;c=f[e>>2]|0;f[e>>2]=h;if(c|0){e=c+40|0;i=f[e>>2]|0;if(i|0){j=c+44|0;k=f[j>>2]|0;if((k|0)==(i|0))l=i;else{m=k;do{k=m+-4|0;f[j>>2]=k;o=f[k>>2]|0;f[k>>2]=0;if(o|0){Df(o);fn(o)}m=f[j>>2]|0}while((m|0)!=(i|0));l=f[e>>2]|0}fn(l)}Df(c);fn(c)}f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;f[a+12>>2]=0;u=d;return}else{f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;c=dj(32)|0;f[g>>2]=c;f[g+8>>2]=-2147483616;f[g+4>>2]=26;l=c;e=9554;i=l+26|0;do{b[l>>0]=b[e>>0]|0;l=l+1|0;e=e+1|0}while((l|0)<(i|0));b[c+26>>0]=0;f[a>>2]=-1;Sf(a+4|0,g);if((b[g+11>>0]|0)<0)fn(f[g>>2]|0);g=h+40|0;a=f[g>>2]|0;if(a|0){c=h+44|0;e=f[c>>2]|0;if((e|0)==(a|0))p=a;else{l=e;do{e=l+-4|0;f[c>>2]=e;i=f[e>>2]|0;f[e>>2]=0;if(i|0){Df(i);fn(i)}l=f[c>>2]|0}while((l|0)!=(a|0));p=f[g>>2]|0}fn(p)}Df(h);fn(h);u=d;return}}function Uc(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;c=u;u=u+16|0;d=c+4|0;e=c;g=f[b>>2]|0;f[d>>2]=g;b=a+8|0;h=(g|0)==-1;i=g+1|0;do if(!h){f[d+4>>2]=((i>>>0)%3|0|0)==0?g+-2|0:i;if(!((g>>>0)%3|0)){j=g+2|0;break}else{j=g+-1|0;break}}else{f[d+4>>2]=-1;j=-1}while(0);f[d+8>>2]=j;j=h?-1:(g>>>0)/3|0;h=a+216|0;i=a+220|0;k=a+368|0;a=g;g=0;while(1){if((a|0)!=-1?(l=f[(f[(f[b>>2]|0)+12>>2]|0)+(a<<2)>>2]|0,(l|0)!=-1):0){if(((l>>>0)/3|0)>>>0>=j>>>0?(f[i>>2]|0)!=(f[h>>2]|0):0){l=0;do{if(Xg((f[k>>2]|0)+(l<<4)|0)|0){m=f[h>>2]|0;f[e>>2]=a;n=m+(l*144|0)+136|0;o=f[n>>2]|0;if(o>>>0<(f[m+(l*144|0)+140>>2]|0)>>>0){f[o>>2]=a;f[n>>2]=o+4}else yf(m+(l*144|0)+132|0,e)}l=l+1|0}while(l>>>0<(((f[i>>2]|0)-(f[h>>2]|0)|0)/144|0)>>>0)}}else p=10;if((p|0)==10?(p=0,l=f[i>>2]|0,m=f[h>>2]|0,(l|0)!=(m|0)):0){o=l;l=m;m=0;while(1){n=l;f[e>>2]=a;q=n+(m*144|0)+136|0;r=f[q>>2]|0;if(r>>>0<(f[n+(m*144|0)+140>>2]|0)>>>0){f[r>>2]=a;f[q>>2]=r+4;s=l;t=o}else{yf(n+(m*144|0)+132|0,e);s=f[h>>2]|0;t=f[i>>2]|0}m=m+1|0;if(m>>>0>=((t-s|0)/144|0)>>>0)break;else{o=t;l=s}}}l=g+1|0;if((l|0)==3)break;a=f[d+(l<<2)>>2]|0;g=l}u=c;return 1}function Vc(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0.0;a:do if(b>>>0<=20)do switch(b|0){case 9:{d=(f[c>>2]|0)+(4-1)&~(4-1);e=f[d>>2]|0;f[c>>2]=d+4;f[a>>2]=e;break a;break}case 10:{e=(f[c>>2]|0)+(4-1)&~(4-1);d=f[e>>2]|0;f[c>>2]=e+4;e=a;f[e>>2]=d;f[e+4>>2]=((d|0)<0)<<31>>31;break a;break}case 11:{d=(f[c>>2]|0)+(4-1)&~(4-1);e=f[d>>2]|0;f[c>>2]=d+4;d=a;f[d>>2]=e;f[d+4>>2]=0;break a;break}case 12:{d=(f[c>>2]|0)+(8-1)&~(8-1);e=d;g=f[e>>2]|0;h=f[e+4>>2]|0;f[c>>2]=d+8;d=a;f[d>>2]=g;f[d+4>>2]=h;break a;break}case 13:{h=(f[c>>2]|0)+(4-1)&~(4-1);d=f[h>>2]|0;f[c>>2]=h+4;h=(d&65535)<<16>>16;d=a;f[d>>2]=h;f[d+4>>2]=((h|0)<0)<<31>>31;break a;break}case 14:{h=(f[c>>2]|0)+(4-1)&~(4-1);d=f[h>>2]|0;f[c>>2]=h+4;h=a;f[h>>2]=d&65535;f[h+4>>2]=0;break a;break}case 15:{h=(f[c>>2]|0)+(4-1)&~(4-1);d=f[h>>2]|0;f[c>>2]=h+4;h=(d&255)<<24>>24;d=a;f[d>>2]=h;f[d+4>>2]=((h|0)<0)<<31>>31;break a;break}case 16:{h=(f[c>>2]|0)+(4-1)&~(4-1);d=f[h>>2]|0;f[c>>2]=h+4;h=a;f[h>>2]=d&255;f[h+4>>2]=0;break a;break}case 17:{h=(f[c>>2]|0)+(8-1)&~(8-1);i=+p[h>>3];f[c>>2]=h+8;p[a>>3]=i;break a;break}case 18:{h=(f[c>>2]|0)+(8-1)&~(8-1);i=+p[h>>3];f[c>>2]=h+8;p[a>>3]=i;break a;break}default:break a}while(0);while(0);return}function Wc(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;e=u;u=u+144|0;g=e+136|0;h=e+32|0;i=e;j=f[(f[c+4>>2]|0)+44>>2]|0;k=dj(124)|0;f[k+4>>2]=0;f[k>>2]=2396;f[k+12>>2]=2420;f[k+100>>2]=0;f[k+104>>2]=0;f[k+108>>2]=0;l=k+16|0;m=l+80|0;do{f[l>>2]=0;l=l+4|0}while((l|0)<(m|0));f[k+112>>2]=j;f[k+116>>2]=d;f[k+120>>2]=0;n=k;f[h+4>>2]=2420;f[h+92>>2]=0;f[h+96>>2]=0;f[h+100>>2]=0;l=h+8|0;m=l+80|0;do{f[l>>2]=0;l=l+4|0}while((l|0)<(m|0));l=f[c+8>>2]|0;f[i>>2]=2420;c=i+4|0;m=c+4|0;f[m>>2]=0;f[m+4>>2]=0;f[m+8>>2]=0;f[m+12>>2]=0;f[m+16>>2]=0;f[m+20>>2]=0;m=l;f[c>>2]=m;o=((f[m+4>>2]|0)-(f[l>>2]|0)>>2>>>0)/3|0;b[g>>0]=0;ge(i+8|0,o,g);Qa[f[(f[i>>2]|0)+8>>2]&127](i);f[h>>2]=f[c>>2];vd(h+4|0,i)|0;f[h+36>>2]=l;f[h+40>>2]=d;f[h+44>>2]=j;f[h+48>>2]=k;Vd(k,h);f[a>>2]=n;f[i>>2]=2420;n=f[i+20>>2]|0;if(n|0)fn(n);n=f[i+8>>2]|0;if(!n){wf(h);u=e;return}fn(n);wf(h);u=e;return}function Xc(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;e=u;u=u+16|0;g=e;h=f[a+40>>2]|0;i=f[a+44>>2]|0;if((h|0)==(i|0)){j=2;k=0;l=(j|0)==2;m=l?0:k;u=e;return m|0}a=g+11|0;n=g+4|0;o=d+11|0;p=d+4|0;q=h;h=0;a:while(1){f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;r=Tf(f[q>>2]|0,c,g)|0;s=b[a>>0]|0;b:do if(r){t=s<<24>>24<0;v=s&255;w=t?f[n>>2]|0:v;x=b[o>>0]|0;y=x<<24>>24<0;if((w|0)==((y?f[p>>2]|0:x&255)|0)){x=f[g>>2]|0;z=t?x:g;A=y?f[d>>2]|0:d;y=(w|0)==0;c:do if(t){if(!y?mh(z,A,w)|0:0){B=0;C=h;break b}}else if(!y){if((x&255)<<24>>24==(b[A>>0]|0)){D=v;E=g;F=A}else{B=0;C=h;break b}while(1){D=D+-1|0;E=E+1|0;if(!D)break c;F=F+1|0;if((b[E>>0]|0)!=(b[F>>0]|0)){B=0;C=h;break b}}}while(0);B=1;C=f[q>>2]|0}else{B=0;C=h}}else{B=3;C=h}while(0);if(s<<24>>24<0)fn(f[g>>2]|0);switch(B&3){case 3:case 0:break;default:{j=B;k=C;G=17;break a}}q=q+4|0;if((q|0)==(i|0)){j=2;k=C;G=17;break}else h=C}if((G|0)==17){l=(j|0)==2;m=l?0:k;u=e;return m|0}return 0}function Yc(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;d=u;u=u+32|0;e=d+12|0;g=d;h=Ch(c,0)|0;if(!h){f[a>>2]=0;u=d;return}i=f[c+100>>2]|0;j=f[c+96>>2]|0;c=i-j|0;k=(c|0)/12|0;f[e>>2]=0;l=e+4|0;f[l>>2]=0;f[e+8>>2]=0;m=j;do if(c)if(k>>>0>357913941)ym(e);else{n=dj(c)|0;f[e>>2]=n;f[e+8>>2]=n+(k*12|0);Vf(n|0,0,c|0)|0;f[l>>2]=n+c;o=n;break}else o=0;while(0);f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;a:do if((i|0)!=(j|0)){c=g+4|0;n=g+8|0;if(b[h+84>>0]|0){p=0;while(1){q=m+(p*12|0)|0;f[g>>2]=f[q>>2];f[g+4>>2]=f[q+4>>2];f[g+8>>2]=f[q+8>>2];f[o+(p*12|0)>>2]=f[g>>2];f[o+(p*12|0)+4>>2]=f[c>>2];f[o+(p*12|0)+8>>2]=f[n>>2];p=p+1|0;if(p>>>0>=k>>>0)break a}}p=f[h+68>>2]|0;q=0;do{r=f[p+(f[m+(q*12|0)>>2]<<2)>>2]|0;f[g>>2]=r;f[c>>2]=f[p+(f[m+(q*12|0)+4>>2]<<2)>>2];s=f[p+(f[m+(q*12|0)+8>>2]<<2)>>2]|0;f[n>>2]=s;f[o+(q*12|0)>>2]=r;f[o+(q*12|0)+4>>2]=f[c>>2];f[o+(q*12|0)+8>>2]=s;q=q+1|0}while(q>>>0>>0)}while(0);lg(a,e);a=f[e>>2]|0;if(a|0){e=f[l>>2]|0;if((e|0)!=(a|0))f[l>>2]=e+(~(((e+-12-a|0)>>>0)/12|0)*12|0);fn(a)}u=d;return}function Zc(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;if(!(f[a+64>>2]|0)){d=dj(32)|0;tj(d);e=a+64|0;g=f[e>>2]|0;f[e>>2]=d;if(!g)h=d;else{d=f[g>>2]|0;if(d|0){i=g+4|0;if((f[i>>2]|0)!=(d|0))f[i>>2]=d;fn(d)}fn(g);h=f[e>>2]|0}Wg(a,h,0,0,0,0);j=a}else j=a;if(!(Of(j,c)|0))return;b[a+84>>0]=b[c+84>>0]|0;f[a+80>>2]=f[c+80>>2];if((a|0)!=(c|0))yd(a+68|0,f[c+68>>2]|0,f[c+72>>2]|0);j=f[c+88>>2]|0;if(!j){c=a+88|0;h=f[c>>2]|0;f[c>>2]=0;if(!h)return;c=f[h+8>>2]|0;if(c|0){e=h+12|0;if((f[e>>2]|0)!=(c|0))f[e>>2]=c;fn(c)}fn(h);return}h=dj(40)|0;f[h>>2]=f[j>>2];c=h+8|0;e=j+8|0;f[c>>2]=0;g=h+12|0;f[g>>2]=0;d=h+16|0;f[d>>2]=0;i=j+12|0;k=(f[i>>2]|0)-(f[e>>2]|0)|0;if(k|0){if((k|0)<0)ym(c);l=dj(k)|0;f[g>>2]=l;f[c>>2]=l;f[d>>2]=l+k;k=f[e>>2]|0;e=(f[i>>2]|0)-k|0;if((e|0)>0){ee(l|0,k|0,e|0)|0;f[g>>2]=l+e}}e=h+24|0;l=j+24|0;f[e>>2]=f[l>>2];f[e+4>>2]=f[l+4>>2];f[e+8>>2]=f[l+8>>2];f[e+12>>2]=f[l+12>>2];l=a+88|0;a=f[l>>2]|0;f[l>>2]=h;if(!a)return;h=f[a+8>>2]|0;if(h|0){l=a+12|0;if((f[l>>2]|0)!=(h|0))f[l>>2]=h;fn(h)}fn(a);return}function _c(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;b=u;u=u+16|0;c=b+4|0;d=b;e=a+8|0;g=f[e>>2]|0;ug(f[a+4>>2]|0,(f[g+28>>2]|0)-(f[g+24>>2]|0)>>2);g=a+100|0;h=f[e>>2]|0;i=(f[h+28>>2]|0)-(f[h+24>>2]|0)>>2;f[c>>2]=0;h=a+104|0;j=f[h>>2]|0;k=f[g>>2]|0;l=j-k>>2;m=k;k=j;if(i>>>0<=l>>>0){if(i>>>0>>0?(j=m+(i<<2)|0,(k|0)!=(j|0)):0)f[h>>2]=k+(~((k+-4-j|0)>>>2)<<2)}else Ae(g,i-l|0,c);l=a+120|0;a=f[l>>2]|0;if(!a){i=f[e>>2]|0;g=(f[i+4>>2]|0)-(f[i>>2]|0)>>2;i=(g>>>0)/3|0;if(g>>>0<=2){n=1;u=b;return n|0}g=0;while(1){f[d>>2]=g*3;f[c>>2]=f[d>>2];g=g+1|0;if(!(jb(e,c)|0)){n=0;o=15;break}if((g|0)>=(i|0)){n=1;o=15;break}}if((o|0)==15){u=b;return n|0}}else{i=f[a>>2]|0;if((f[a+4>>2]|0)==(i|0)){n=1;u=b;return n|0}a=i;i=0;while(1){f[d>>2]=f[a+(i<<2)>>2];f[c>>2]=f[d>>2];i=i+1|0;if(!(jb(e,c)|0)){n=0;o=15;break}g=f[l>>2]|0;a=f[g>>2]|0;if(i>>>0>=(f[g+4>>2]|0)-a>>2>>>0){n=1;o=15;break}}if((o|0)==15){u=b;return n|0}}return 0}function $c(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0;e=u;u=u+32|0;g=e+20|0;h=e+16|0;i=e;j=c+24|0;k=b[j>>0]|0;l=k<<24>>24;m=f[a+80>>2]|0;a=X(m,l)|0;f[i>>2]=f[226];f[i+4>>2]=f[227];f[i+8>>2]=f[228];f[i+12>>2]=f[229];n=d+4|0;o=f[n>>2]|0;p=f[d>>2]|0;q=o-p>>2;r=p;p=o;if(a>>>0<=q>>>0){if(a>>>0>>0?(o=r+(a<<2)|0,(p|0)!=(o|0)):0)f[n>>2]=p+(~((p+-4-o|0)>>>2)<<2)}else jf(d,a-q|0);if(!m){s=1;u=e;return s|0}q=c+84|0;a=c+68|0;if(k<<24>>24<=0){k=0;while(1){if(!(b[q>>0]|0))t=f[(f[a>>2]|0)+(k<<2)>>2]|0;else t=k;f[h>>2]=t;o=b[j>>0]|0;f[g>>2]=f[h>>2];if(!(_a(c,g,o,i)|0)){s=0;v=18;break}k=k+1|0;if(k>>>0>=m>>>0){s=1;v=18;break}}if((v|0)==18){u=e;return s|0}}else{w=0;x=0}while(1){if(!(b[q>>0]|0))y=f[(f[a>>2]|0)+(x<<2)>>2]|0;else y=x;f[h>>2]=y;k=b[j>>0]|0;f[g>>2]=f[h>>2];if(!(_a(c,g,k,i)|0)){s=0;v=18;break}k=f[d>>2]|0;t=w;o=0;while(1){f[k+(t<<2)>>2]=f[i+(o<<2)>>2];o=o+1|0;if((o|0)==(l|0))break;else t=t+1|0}x=x+1|0;if(x>>>0>=m>>>0){s=1;v=18;break}else w=l+w|0}if((v|0)==18){u=e;return s|0}return 0}function ad(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=f[a+8>>2]|0;e=a+76|0;g=f[e>>2]|0;h=f[g+80>>2]|0;b[c+84>>0]=0;i=c+68|0;j=c+72|0;k=f[j>>2]|0;l=f[i>>2]|0;m=k-l>>2;n=l;l=k;if(h>>>0<=m>>>0)if(h>>>0>>0?(k=n+(h<<2)|0,(l|0)!=(k|0)):0){f[j>>2]=l+(~((l+-4-k|0)>>>2)<<2);o=g;p=h}else{o=g;p=h}else{Ae(i,h-m|0,2384);m=f[e>>2]|0;o=m;p=f[m+80>>2]|0}m=(f[o+100>>2]|0)-(f[o+96>>2]|0)|0;e=(m|0)/12|0;if(!m){q=1;return q|0}m=a+80|0;a=c+68|0;c=f[o+96>>2]|0;o=0;while(1){h=o*3|0;if((h|0)==-1){q=0;r=12;break}i=f[d>>2]|0;g=f[i+(h<<2)>>2]|0;if((g|0)==-1){q=0;r=12;break}k=f[(f[m>>2]|0)+12>>2]|0;l=f[k+(g<<2)>>2]|0;if(l>>>0>=p>>>0){q=0;r=12;break}g=f[a>>2]|0;f[g+(f[c+(o*12|0)>>2]<<2)>>2]=l;l=h+1|0;if((l|0)==-1){q=0;r=12;break}j=f[i+(l<<2)>>2]|0;if((j|0)==-1){q=0;r=12;break}l=f[k+(j<<2)>>2]|0;if(l>>>0>=p>>>0){q=0;r=12;break}f[g+(f[c+(o*12|0)+4>>2]<<2)>>2]=l;l=h+2|0;if((l|0)==-1){q=0;r=12;break}h=f[i+(l<<2)>>2]|0;if((h|0)==-1){q=0;r=12;break}l=f[k+(h<<2)>>2]|0;if(l>>>0>=p>>>0){q=0;r=12;break}f[g+(f[c+(o*12|0)+8>>2]<<2)>>2]=l;o=o+1|0;if(o>>>0>=e>>>0){q=1;r=12;break}}if((r|0)==12)return q|0;return 0}function bd(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=f[a+8>>2]|0;e=a+112|0;g=f[e>>2]|0;h=f[g+80>>2]|0;b[c+84>>0]=0;i=c+68|0;j=c+72|0;k=f[j>>2]|0;l=f[i>>2]|0;m=k-l>>2;n=l;l=k;if(h>>>0<=m>>>0)if(h>>>0>>0?(k=n+(h<<2)|0,(l|0)!=(k|0)):0){f[j>>2]=l+(~((l+-4-k|0)>>>2)<<2);o=g;p=h}else{o=g;p=h}else{Ae(i,h-m|0,2384);m=f[e>>2]|0;o=m;p=f[m+80>>2]|0}m=(f[o+100>>2]|0)-(f[o+96>>2]|0)|0;e=(m|0)/12|0;if(!m){q=1;return q|0}m=a+116|0;a=c+68|0;c=f[o+96>>2]|0;o=0;while(1){h=o*3|0;if((h|0)==-1){q=0;r=12;break}i=f[d>>2]|0;g=f[i+(h<<2)>>2]|0;if((g|0)==-1){q=0;r=12;break}k=f[(f[m>>2]|0)+12>>2]|0;l=f[k+(g<<2)>>2]|0;if(l>>>0>=p>>>0){q=0;r=12;break}g=f[a>>2]|0;f[g+(f[c+(o*12|0)>>2]<<2)>>2]=l;l=h+1|0;if((l|0)==-1){q=0;r=12;break}j=f[i+(l<<2)>>2]|0;if((j|0)==-1){q=0;r=12;break}l=f[k+(j<<2)>>2]|0;if(l>>>0>=p>>>0){q=0;r=12;break}f[g+(f[c+(o*12|0)+4>>2]<<2)>>2]=l;l=h+2|0;if((l|0)==-1){q=0;r=12;break}h=f[i+(l<<2)>>2]|0;if((h|0)==-1){q=0;r=12;break}l=f[k+(h<<2)>>2]|0;if(l>>>0>=p>>>0){q=0;r=12;break}f[g+(f[c+(o*12|0)+8>>2]<<2)>>2]=l;o=o+1|0;if(o>>>0>=e>>>0){q=1;r=12;break}}if((r|0)==12)return q|0;return 0}function cd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;d=u;u=u+64|0;e=d;g=e;i=g+52|0;do{f[g>>2]=0;g=g+4|0}while((g|0)<(i|0));do if(Rc(e,b)|0){g=(a|0)==0;if(!g?(f[e+12>>2]|0)==0:0){j=0;break}i=zd(e,b)|0;if(g|i^1)j=i;else{i=e+44|0;g=e+48|0;k=e+40|0;l=e+16|0;m=e+28|0;n=f[g>>2]|0;o=0;while(1){a:do if(n>>>0<16384){p=f[i>>2]|0;q=n;while(1){if((p|0)<=0){r=q;break a}s=f[k>>2]|0;p=p+-1|0;f[i>>2]=p;t=h[s+p>>0]|0|q<<8;f[g>>2]=t;if(t>>>0>=16384){r=t;break}else q=t}}else r=n;while(0);q=r&4095;p=f[(f[l>>2]|0)+(q<<2)>>2]|0;t=f[m>>2]|0;n=(X(f[t+(p<<3)>>2]|0,r>>>12)|0)+q-(f[t+(p<<3)+4>>2]|0)|0;f[g>>2]=n;f[c+(o<<2)>>2]=p;o=o+1|0;if((o|0)==(a|0)){j=1;break}}}}else j=0;while(0);a=f[e+28>>2]|0;if(a|0){c=e+32|0;r=f[c>>2]|0;if((r|0)!=(a|0))f[c>>2]=r+(~((r+-8-a|0)>>>3)<<3);fn(a)}a=f[e+16>>2]|0;if(a|0){r=e+20|0;c=f[r>>2]|0;if((c|0)!=(a|0))f[r>>2]=c+(~((c+-4-a|0)>>>2)<<2);fn(a)}a=f[e>>2]|0;if(!a){u=d;return j|0}c=e+4|0;e=f[c>>2]|0;if((e|0)!=(a|0))f[c>>2]=e+(~((e+-4-a|0)>>>2)<<2);fn(a);u=d;return j|0}function dd(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;d=f[c>>2]|0;c=f[d>>2]|0;e=f[a+4>>2]|0;g=f[d+4>>2]|0;h=e+-1|0;i=(h&e|0)==0;if(!i)if(g>>>0>>0)j=g;else j=(g>>>0)%(e>>>0)|0;else j=h&g;g=(f[a>>2]|0)+(j<<2)|0;k=f[g>>2]|0;while(1){l=f[k>>2]|0;if((l|0)==(d|0))break;else k=l}if((k|0)!=(a+8|0)){l=f[k+4>>2]|0;if(!i)if(l>>>0>>0)m=l;else m=(l>>>0)%(e>>>0)|0;else m=l&h;if((m|0)==(j|0)){n=c;o=21}else o=13}else o=13;do if((o|0)==13){if(c|0){m=f[c+4>>2]|0;if(!i)if(m>>>0>>0)p=m;else p=(m>>>0)%(e>>>0)|0;else p=m&h;if((p|0)==(j|0)){q=c;r=c;o=22;break}}f[g>>2]=0;n=f[d>>2]|0;o=21}while(0);if((o|0)==21){g=n;if(!n)s=g;else{q=n;r=g;o=22}}if((o|0)==22){o=f[q+4>>2]|0;if(!i)if(o>>>0>>0)t=o;else t=(o>>>0)%(e>>>0)|0;else t=o&h;if((t|0)==(j|0))s=r;else{f[(f[a>>2]|0)+(t<<2)>>2]=k;s=f[d>>2]|0}}f[k>>2]=s;f[d>>2]=0;s=a+12|0;f[s>>2]=(f[s>>2]|0)+-1;if(!d)return c|0;s=d+8|0;a=f[d+20>>2]|0;if(a|0){k=d+24|0;if((f[k>>2]|0)!=(a|0))f[k>>2]=a;fn(a)}if((b[s+11>>0]|0)<0)fn(f[s>>2]|0);fn(d);return c|0}function ed(a,c,d,e){a=a|0;c=c|0;d=d|0;e=e|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g=u;u=u+80|0;h=g;i=g+60|0;j=g+40|0;k=h;l=d;m=k+40|0;do{f[k>>2]=f[l>>2];k=k+4|0;l=l+4|0}while((k|0)<(m|0));Db(a,h,i);if(f[a>>2]|0){n=h+24|0;ln(n);u=g;return}o=a+4|0;p=o+11|0;if((b[p>>0]|0)<0)fn(f[o>>2]|0);if((b[i+7>>0]|0)!=1){f[j>>2]=0;f[j+4>>2]=0;f[j+8>>2]=0;q=dj(32)|0;f[j>>2]=q;f[j+8>>2]=-2147483616;f[j+4>>2]=20;k=q;l=8391;m=k+20|0;do{b[k>>0]=b[l>>0]|0;k=k+1|0;l=l+1|0}while((k|0)<(m|0));b[q+20>>0]=0;f[a>>2]=-1;Sf(o,j);if((b[j+11>>0]|0)<0)fn(f[j>>2]|0);n=h+24|0;ln(n);u=g;return}Me(j,b[i+8>>0]|0);i=f[j>>2]|0;if(!i){q=j+16|0;l=f[q>>2]|0;f[q>>2]=0;qi(a,l,c,d,e);if(!(f[a>>2]|0)){if((b[p>>0]|0)<0)fn(f[o>>2]|0);f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;f[a+12>>2]=0}if(l|0)Qa[f[(f[l>>2]|0)+4>>2]&127](l)}else{f[a>>2]=i;Sf(o,j+4|0)}o=j+16|0;i=f[o>>2]|0;f[o>>2]=0;if(i|0)Qa[f[(f[i>>2]|0)+4>>2]&127](i);i=j+4|0;if((b[i+11>>0]|0)<0)fn(f[i>>2]|0);n=h+24|0;ln(n);u=g;return}function fd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;c=u;u=u+32|0;d=c+12|0;e=c;g=b*3|0;f[d>>2]=0;h=d+4|0;f[h>>2]=0;f[d+8>>2]=0;do if(g)if(g>>>0>1073741823)ym(d);else{i=b*12|0;j=dj(i)|0;f[d>>2]=j;k=j+(g<<2)|0;f[d+8>>2]=k;Vf(j|0,0,i|0)|0;f[h>>2]=k;l=j;break}else l=0;while(0);if(Rf(g,1,f[a+32>>2]|0,l)|0)if(!b)m=1;else{l=a+44|0;a=e+4|0;g=e+8|0;j=0;k=0;i=0;while(1){f[e>>2]=0;f[e+4>>2]=0;f[e+8>>2]=0;n=f[d>>2]|0;o=f[n+(i<<2)>>2]|0;p=o>>>1;q=((o&1|0)==0?p:0-p|0)+k|0;f[e>>2]=q;p=f[n+(i+1<<2)>>2]|0;o=p>>>1;r=((p&1|0)==0?o:0-o|0)+q|0;f[a>>2]=r;q=f[n+(i+2<<2)>>2]|0;n=q>>>1;k=((q&1|0)==0?n:0-n|0)+r|0;f[g>>2]=k;r=f[l>>2]|0;n=r+100|0;q=f[n>>2]|0;if((q|0)==(f[r+104>>2]|0))df(r+96|0,e);else{f[q>>2]=f[e>>2];f[q+4>>2]=f[e+4>>2];f[q+8>>2]=f[e+8>>2];f[n>>2]=(f[n>>2]|0)+12}j=j+1|0;if(j>>>0>=b>>>0){m=1;break}else i=i+3|0}}else m=0;i=f[d>>2]|0;if(!i){u=c;return m|0}d=f[h>>2]|0;if((d|0)!=(i|0))f[h>>2]=d+(~((d+-4-i|0)>>>2)<<2);fn(i);u=c;return m|0}function gd(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=f[a+8>>2]|0;e=a+76|0;g=f[e>>2]|0;h=f[g+80>>2]|0;b[c+84>>0]=0;i=c+68|0;j=c+72|0;k=f[j>>2]|0;l=f[i>>2]|0;m=k-l>>2;n=l;l=k;if(h>>>0<=m>>>0)if(h>>>0>>0?(k=n+(h<<2)|0,(l|0)!=(k|0)):0){f[j>>2]=l+(~((l+-4-k|0)>>>2)<<2);o=g;p=h}else{o=g;p=h}else{Ae(i,h-m|0,2384);m=f[e>>2]|0;o=m;p=f[m+80>>2]|0}m=(f[o+100>>2]|0)-(f[o+96>>2]|0)|0;e=(m|0)/12|0;if(!m){q=1;return q|0}m=a+80|0;a=c+68|0;c=f[o+96>>2]|0;o=f[d+28>>2]|0;d=0;while(1){h=d*3|0;i=f[o+(h<<2)>>2]|0;if((i|0)==-1){q=0;r=11;break}g=f[(f[m>>2]|0)+12>>2]|0;k=f[g+(i<<2)>>2]|0;if(k>>>0>=p>>>0){q=0;r=11;break}i=f[a>>2]|0;f[i+(f[c+(d*12|0)>>2]<<2)>>2]=k;k=f[o+(h+1<<2)>>2]|0;if((k|0)==-1){q=0;r=11;break}l=f[g+(k<<2)>>2]|0;if(l>>>0>=p>>>0){q=0;r=11;break}f[i+(f[c+(d*12|0)+4>>2]<<2)>>2]=l;l=f[o+(h+2<<2)>>2]|0;if((l|0)==-1){q=0;r=11;break}h=f[g+(l<<2)>>2]|0;if(h>>>0>=p>>>0){q=0;r=11;break}f[i+(f[c+(d*12|0)+8>>2]<<2)>>2]=h;d=d+1|0;if(d>>>0>=e>>>0){q=1;r=11;break}}if((r|0)==11)return q|0;return 0}function hd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;c=u;u=u+32|0;d=c+24|0;e=c+16|0;g=c+8|0;h=c;f[a>>2]=2372;f[a+4>>2]=f[b+4>>2];i=a+8|0;j=b+8|0;f[i>>2]=0;k=a+12|0;f[k>>2]=0;l=a+16|0;f[l>>2]=0;m=b+12|0;n=f[m>>2]|0;do if(n|0)if((n|0)<0)ym(i);else{o=((n+-1|0)>>>5)+1|0;p=dj(o<<2)|0;f[i>>2]=p;f[k>>2]=0;f[l>>2]=o;o=f[j>>2]|0;f[g>>2]=o;f[g+4>>2]=0;p=f[m>>2]|0;f[h>>2]=o+(p>>>5<<2);f[h+4>>2]=p&31;f[e>>2]=f[g>>2];f[e+4>>2]=f[g+4>>2];f[d>>2]=f[h>>2];f[d+4>>2]=f[h+4>>2];md(i,e,d);break}while(0);i=a+20|0;f[i>>2]=0;m=a+24|0;f[m>>2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];f[e+4>>2]=f[g+4>>2];f[d>>2]=f[h>>2];f[d+4>>2]=f[h+4>>2];md(i,e,d);u=c;return}function jd(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,o=0,p=0,q=0,r=0,s=0,t=Ja,v=Ja,w=0,x=0,y=Ja,z=0,A=Ja;d=u;u=u+16|0;e=d;g=f[a+24>>2]|0;h=a+8|0;i=b[(f[h>>2]|0)+24>>0]|0;j=i<<24>>24;k=j<<2;l=cn(j>>>0>1073741823?-1:j<<2)|0;Cl(e);if(!(Zi(e,$(n[a+32>>2]),(1<>2]|0;if(!(f[g+80>>2]|0))o=0;else o=(f[f[g>>2]>>2]|0)+(f[g+48>>2]|0)|0;if(!c){m=1;dn(l);u=d;return m|0}g=e+4|0;p=a+28|0;if(i<<24>>24>0){q=0;r=0;s=0}else{i=0;a=0;while(1){ee((f[f[(f[h>>2]|0)+64>>2]>>2]|0)+a|0,l|0,k|0)|0;i=i+1|0;if((i|0)==(c|0)){m=1;break}else a=a+k|0}dn(l);u=d;return m|0}while(1){a=f[p>>2]|0;t=$(n[g>>2]);v=$(n[e>>2]);i=0;w=s;while(1){x=f[o+(w<<2)>>2]|0;if((x|0)>-1)y=$($($(x|0)*t)*v);else{z=Vj(0,0,x|0,((x|0)<0)<<31>>31|0)|0;y=$(-$(v*$(t*$(+(z>>>0)+4294967296.0*+(I|0)))))}A=$(y+$(n[a+(i<<2)>>2]));n[l+(i<<2)>>2]=A;i=i+1|0;if((i|0)==(j|0))break;else w=w+1|0}ee((f[f[(f[h>>2]|0)+64>>2]>>2]|0)+r|0,l|0,k|0)|0;q=q+1|0;if((q|0)==(c|0)){m=1;break}else{r=r+k|0;s=j+s|0}}dn(l);u=d;return m|0}function kd(a){a=a|0;var c=0,d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;c=b[(f[a+8>>2]|0)+24>>0]|0;d=cn(c>>>0>1073741823?-1:c<<2)|0;e=a+28|0;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e>>2]|0;h=g;if(((d-g|0)/12|0)>>>0>=b>>>0){Vf(g|0,0,b*12|0)|0;f[e>>2]=h+(b*12|0);return}i=f[a>>2]|0;j=(g-i|0)/12|0;g=j+b|0;k=i;if(g>>>0>357913941)ym(a);l=(d-i|0)/12|0;d=l<<1;m=l>>>0<178956970?(d>>>0>>0?g:d):357913941;do if(m)if(m>>>0>357913941){d=ra(8)|0;$k(d,9793);f[d>>2]=3708;va(d|0,856,80)}else{n=dj(m*12|0)|0;break}else n=0;while(0);d=n+(j*12|0)|0;j=d;g=n+(m*12|0)|0;Vf(d|0,0,b*12|0)|0;m=d+(b*12|0)|0;if((h|0)==(k|0)){o=j;p=i;q=h}else{i=d;d=h;h=j;do{j=i+-12|0;b=d;d=d+-12|0;f[j>>2]=0;n=i+-8|0;f[n>>2]=0;f[i+-4>>2]=0;f[j>>2]=f[d>>2];j=b+-8|0;f[n>>2]=f[j>>2];n=b+-4|0;f[i+-4>>2]=f[n>>2];f[n>>2]=0;f[j>>2]=0;f[d>>2]=0;i=h+-12|0;h=i}while((d|0)!=(k|0));o=h;p=f[a>>2]|0;q=f[e>>2]|0}f[a>>2]=o;f[e>>2]=m;f[c>>2]=g;g=p;if((q|0)!=(g|0)){c=q;do{q=c;c=c+-12|0;m=f[c>>2]|0;if(m|0){e=q+-8|0;q=f[e>>2]|0;if((q|0)!=(m|0))f[e>>2]=q+(~((q+-4-m|0)>>>2)<<2);fn(m)}}while((c|0)!=(g|0))}if(!p)return;fn(p);return}function md(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0;d=u;u=u+48|0;e=d+40|0;g=d+32|0;h=d+8|0;i=d;j=d+24|0;k=d+16|0;l=a+4|0;m=f[l>>2]|0;n=b;b=f[n>>2]|0;o=f[n+4>>2]|0;n=c;c=f[n>>2]|0;p=f[n+4>>2]|0;n=c-b<<3;f[l>>2]=m-o+p+n;l=(f[a>>2]|0)+(m>>>5<<2)|0;a=m&31;m=l;if((o|0)!=(a|0)){q=h;f[q>>2]=b;f[q+4>>2]=o;q=i;f[q>>2]=c;f[q+4>>2]=p;f[j>>2]=m;f[j+4>>2]=a;f[g>>2]=f[h>>2];f[g+4>>2]=f[h+4>>2];f[e>>2]=f[i>>2];f[e+4>>2]=f[i+4>>2];yc(k,g,e,j);u=d;return}j=p-o+n|0;n=b;if((j|0)>0){if(!o){r=l;s=b;t=n;v=j;w=0}else{b=32-o|0;p=(j|0)<(b|0)?j:b;e=-1>>>(b-p|0)&-1<>2]=f[l>>2]&~e|f[n>>2]&e;e=p+o|0;b=n+4|0;r=l+(e>>>5<<2)|0;s=b;t=b;v=j-p|0;w=e&31}e=(v|0)/32|0;ui(r|0,s|0,e<<2|0)|0;s=v-(e<<5)|0;v=r+(e<<2)|0;r=v;if((s|0)>0){p=-1>>>(32-s|0);f[v>>2]=f[v>>2]&~p|f[t+(e<<2)>>2]&p;x=r;y=s}else{x=r;y=w}}else{x=m;y=o}f[k>>2]=x;f[k+4>>2]=y;u=d;return}function nd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;c=u;u=u+32|0;d=c;e=a+8|0;g=f[e>>2]|0;h=a+4|0;i=f[h>>2]|0;if(g-i>>2>>>0>=b>>>0){Vf(i|0,0,b<<2|0)|0;f[h>>2]=i+(b<<2);u=c;return}j=f[a>>2]|0;k=i-j>>2;i=k+b|0;if(i>>>0>1073741823)ym(a);l=g-j|0;j=l>>1;g=l>>2>>>0<536870911?(j>>>0>>0?i:j):1073741823;f[d+12>>2]=0;f[d+16>>2]=a+8;do if(g)if(g>>>0>1073741823){j=ra(8)|0;$k(j,9793);f[j>>2]=3708;va(j|0,856,80)}else{m=dj(g<<2)|0;break}else m=0;while(0);f[d>>2]=m;j=m+(k<<2)|0;k=d+8|0;i=d+4|0;f[i>>2]=j;l=d+12|0;f[l>>2]=m+(g<<2);Vf(j|0,0,b<<2|0)|0;f[k>>2]=j+(b<<2);b=f[a>>2]|0;j=f[h>>2]|0;if((j|0)==(b|0)){n=i;o=f[i>>2]|0;p=b;q=j}else{g=f[i>>2]|0;m=j;do{m=m+-4|0;j=f[m>>2]|0;f[m>>2]=0;f[g+-4>>2]=j;g=(f[i>>2]|0)+-4|0;f[i>>2]=g}while((m|0)!=(b|0));n=i;o=g;p=f[a>>2]|0;q=f[h>>2]|0}f[a>>2]=o;f[n>>2]=p;f[h>>2]=f[k>>2];f[k>>2]=q;q=f[e>>2]|0;f[e>>2]=f[l>>2];f[l>>2]=q;f[d>>2]=f[n>>2];Se(d);u=c;return}function od(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=b;e=c-d>>2;g=a+8|0;h=f[g>>2]|0;i=f[a>>2]|0;j=i;if(e>>>0<=h-i>>2>>>0){k=a+4|0;l=(f[k>>2]|0)-i>>2;m=e>>>0>l>>>0;n=b+(l<<2)|0;l=m?n:c;o=l;p=o-d|0;q=p>>2;if(q|0)ui(i|0,b|0,p|0)|0;p=j+(q<<2)|0;if(!m){m=f[k>>2]|0;if((m|0)==(p|0))return;f[k>>2]=m+(~((m+-4-p|0)>>>2)<<2);return}if((l|0)==(c|0))return;l=f[k>>2]|0;p=((c+-4-o|0)>>>2)+1|0;o=l;m=n;while(1){f[o>>2]=f[m>>2];m=m+4|0;if((m|0)==(c|0))break;else o=o+4|0}f[k>>2]=l+(p<<2);return}p=i;if(!i)r=h;else{h=a+4|0;l=f[h>>2]|0;if((l|0)!=(j|0))f[h>>2]=l+(~((l+-4-i|0)>>>2)<<2);fn(p);f[g>>2]=0;f[h>>2]=0;f[a>>2]=0;r=0}if(e>>>0>1073741823)ym(a);h=r>>1;p=r>>2>>>0<536870911?(h>>>0>>0?e:h):1073741823;if(p>>>0>1073741823)ym(a);h=dj(p<<2)|0;e=a+4|0;f[e>>2]=h;f[a>>2]=h;f[g>>2]=h+(p<<2);if((b|0)==(c|0))return;p=((c+-4-d|0)>>>2)+1|0;d=h;g=b;while(1){f[d>>2]=f[g>>2];g=g+4|0;if((g|0)==(c|0))break;else d=d+4|0}f[e>>2]=h+(p<<2);return}function pd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=a+8|0;e=f[d>>2]|0;g=f[a>>2]|0;h=g;do if(e-g>>2>>>0>=b>>>0){i=a+4|0;j=f[i>>2]|0;k=j-g>>2;l=k>>>0>>0;m=l?k:b;n=j;if(m|0){j=h;o=m;while(1){f[j>>2]=f[c>>2];o=o+-1|0;if(!o)break;else j=j+4|0}}if(!l){j=h+(b<<2)|0;if((n|0)==(j|0))return;else{p=i;q=n+(~((n+-4-j|0)>>>2)<<2)|0;break}}else{j=b-k|0;o=n;m=j;while(1){f[o>>2]=f[c>>2];m=m+-1|0;if(!m)break;else o=o+4|0}p=i;q=n+(j<<2)|0;break}}else{o=g;if(!g)r=e;else{m=a+4|0;k=f[m>>2]|0;if((k|0)!=(h|0))f[m>>2]=k+(~((k+-4-g|0)>>>2)<<2);fn(o);f[d>>2]=0;f[m>>2]=0;f[a>>2]=0;r=0}if(b>>>0>1073741823)ym(a);m=r>>1;o=r>>2>>>0<536870911?(m>>>0>>0?b:m):1073741823;if(o>>>0>1073741823)ym(a);m=dj(o<<2)|0;k=a+4|0;f[k>>2]=m;f[a>>2]=m;f[d>>2]=m+(o<<2);o=m;l=b;while(1){f[o>>2]=f[c>>2];l=l+-1|0;if(!l)break;else o=o+4|0}p=k;q=m+(b<<2)|0}while(0);f[p>>2]=q;return}function qd(a,b,c){a=a|0;b=b|0;c=c|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=b;g=c-e|0;h=g>>1;i=a+8|0;j=f[i>>2]|0;k=f[a>>2]|0;l=k;if(h>>>0<=j-k>>1>>>0){m=a+4|0;n=(f[m>>2]|0)-k>>1;o=h>>>0>n>>>0;p=b+(n<<1)|0;n=o?p:c;q=n;r=q-e|0;s=r>>1;if(s|0)ui(k|0,b|0,r|0)|0;r=l+(s<<1)|0;if(!o){o=f[m>>2]|0;if((o|0)==(r|0))return;f[m>>2]=o+(~((o+-2-r|0)>>>1)<<1);return}if((n|0)==(c|0))return;n=f[m>>2]|0;r=c+-2-q|0;q=n;o=p;while(1){d[q>>1]=d[o>>1]|0;o=o+2|0;if((o|0)==(c|0))break;else q=q+2|0}f[m>>2]=n+((r>>>1)+1<<1);return}r=k;if(!k)t=j;else{j=a+4|0;n=f[j>>2]|0;if((n|0)!=(l|0))f[j>>2]=n+(~((n+-2-k|0)>>>1)<<1);fn(r);f[i>>2]=0;f[j>>2]=0;f[a>>2]=0;t=0}if((g|0)<0)ym(a);g=t>>1>>>0<1073741823?(t>>>0>>0?h:t):2147483647;if((g|0)<0)ym(a);t=dj(g<<1)|0;h=a+4|0;f[h>>2]=t;f[a>>2]=t;f[i>>2]=t+(g<<1);if((b|0)==(c|0))return;g=c+-2-e|0;e=t;i=b;while(1){d[e>>1]=d[i>>1]|0;i=i+2|0;if((i|0)==(c|0))break;else e=e+2|0}f[h>>2]=t+((g>>>1)+1<<1);return}function rd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=b;e=c-d>>2;g=a+8|0;h=f[g>>2]|0;i=f[a>>2]|0;j=i;if(e>>>0<=h-i>>2>>>0){k=a+4|0;l=(f[k>>2]|0)-i>>2;m=e>>>0>l>>>0;n=b+(l<<2)|0;l=m?n:c;o=l;p=o-d|0;q=p>>2;if(q|0)ui(i|0,b|0,p|0)|0;p=j+(q<<2)|0;if(!m){m=f[k>>2]|0;if((m|0)==(p|0))return;f[k>>2]=m+(~((m+-4-p|0)>>>2)<<2);return}if((l|0)==(c|0))return;l=f[k>>2]|0;p=c+-4-o|0;o=l;m=n;while(1){f[o>>2]=f[m>>2];m=m+4|0;if((m|0)==(c|0))break;else o=o+4|0}f[k>>2]=l+((p>>>2)+1<<2);return}p=i;if(!i)r=h;else{h=a+4|0;l=f[h>>2]|0;if((l|0)!=(j|0))f[h>>2]=l+(~((l+-4-i|0)>>>2)<<2);fn(p);f[g>>2]=0;f[h>>2]=0;f[a>>2]=0;r=0}if(e>>>0>1073741823)ym(a);h=r>>1;p=r>>2>>>0<536870911?(h>>>0>>0?e:h):1073741823;if(p>>>0>1073741823)ym(a);h=dj(p<<2)|0;e=a+4|0;f[e>>2]=h;f[a>>2]=h;f[g>>2]=h+(p<<2);if((b|0)==(c|0))return;p=c+-4-d|0;d=h;g=b;while(1){f[d>>2]=f[g>>2];g=g+4|0;if((g|0)==(c|0))break;else d=d+4|0}f[e>>2]=h+((p>>>2)+1<<2);return}function sd(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=u;u=u+16|0;e=d;g=c+8|0;i=g;j=f[i+4>>2]|0;k=c+16|0;l=k;m=f[l>>2]|0;n=f[l+4>>2]|0;if(!((j|0)>(n|0)|((j|0)==(n|0)?(f[i>>2]|0)>>>0>m>>>0:0))){o=0;u=d;return o|0}b[a+12>>0]=b[(f[c>>2]|0)+m>>0]|0;m=k;i=Tj(f[m>>2]|0,f[m+4>>2]|0,1,0)|0;m=k;f[m>>2]=i;f[m+4>>2]=I;a:do if((eg(e,c)|0?(m=f[e>>2]|0,i=g,n=k,j=f[n>>2]|0,l=f[n+4>>2]|0,n=Vj(f[i>>2]|0,f[i+4>>2]|0,j|0,l|0)|0,i=I,!(0>(i|0)|0==(i|0)&m>>>0>n>>>0)):0)?(n=(f[c>>2]|0)+j|0,(m|0)>=1):0){f[a>>2]=n;i=m+-1|0;p=n+i|0;switch((h[p>>0]|0)>>>6&3){case 0:{f[a+4>>2]=i;q=b[p>>0]&63;break}case 1:{if((m|0)<2){r=0;break a}f[a+4>>2]=m+-2;p=n+m+-2|0;q=(h[p+1>>0]|0)<<8&16128|(h[p>>0]|0);break}case 2:{if((m|0)<3){r=0;break a}f[a+4>>2]=m+-3;p=n+m+-3|0;q=(h[p+1>>0]|0)<<8|(h[p>>0]|0)|(h[p+2>>0]|0)<<16&4128768;break}default:{r=0;break a}}p=q+4096|0;f[a+8>>2]=p;if(p>>>0<=1048575){p=Tj(j|0,l|0,m|0,0)|0;m=k;f[m>>2]=p;f[m+4>>2]=I;r=1}else r=0}else r=0;while(0);o=r;u=d;return o|0}function td(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;h=u;u=u+32|0;i=h+16|0;j=h;k=f[(f[(f[b+4>>2]|0)+8>>2]|0)+(d<<2)>>2]|0;do if((c+-1|0)>>>0<6&(La[f[(f[b>>2]|0)+8>>2]&127](b)|0)==1){l=La[f[(f[b>>2]|0)+36>>2]&127](b)|0;m=Ma[f[(f[b>>2]|0)+44>>2]&127](b,d)|0;if((l|0)==0|(m|0)==0){f[a>>2]=0;u=h;return}n=Ma[f[(f[b>>2]|0)+40>>2]&127](b,d)|0;if(!n){f[j>>2]=f[b+44>>2];f[j+4>>2]=l;f[j+12>>2]=m;f[j+8>>2]=m+12;dc(a,i,c,k,e,j,g);if(!(f[a>>2]|0)){f[a>>2]=0;break}u=h;return}else{f[j>>2]=f[b+44>>2];f[j+4>>2]=n;f[j+12>>2]=m;f[j+8>>2]=m+12;cc(a,i,c,k,e,j,g);if(!(f[a>>2]|0)){f[a>>2]=0;break}u=h;return}}while(0);f[a>>2]=0;u=h;return}function ud(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;c=u;u=u+16|0;d=c;e=a+76|0;g=f[e>>2]|0;h=a+80|0;i=f[h>>2]|0;if((i|0)!=(g|0))f[h>>2]=i+(~((i+-4-g|0)>>>2)<<2);f[e>>2]=0;f[h>>2]=0;f[a+84>>2]=0;if(g|0)fn(g);g=a+64|0;h=f[g>>2]|0;e=a+68|0;if((f[e>>2]|0)!=(h|0))f[e>>2]=h;f[g>>2]=0;f[e>>2]=0;f[a+72>>2]=0;if(h|0)fn(h);h=b+4|0;e=f[h>>2]|0;g=f[b>>2]|0;i=((e-g|0)/12|0)*3|0;j=a+4|0;k=f[j>>2]|0;l=f[a>>2]|0;m=k-l>>2;n=l;l=k;k=g;if(i>>>0<=m>>>0)if(i>>>0>>0?(o=n+(i<<2)|0,(l|0)!=(o|0)):0){f[j>>2]=l+(~((l+-4-o|0)>>>2)<<2);p=e;q=g;r=k}else{p=e;q=g;r=k}else{jf(a,i-m|0);m=f[b>>2]|0;p=f[h>>2]|0;q=m;r=m}if((p|0)!=(q|0)){q=f[a>>2]|0;m=(p-r|0)/12|0;p=0;do{h=p*3|0;f[q+(h<<2)>>2]=f[r+(p*12|0)>>2];f[q+(h+1<<2)>>2]=f[r+(p*12|0)+4>>2];f[q+(h+2<<2)>>2]=f[r+(p*12|0)+8>>2];p=p+1|0}while(p>>>0>>0)}f[d>>2]=-1;if(!(xb(a,d)|0)){s=0;u=c;return s|0}fb(a,f[d>>2]|0)|0;s=1;u=c;return s|0}function vd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;f[a+4>>2]=f[b+4>>2];c=a+8|0;d=b+8|0;if((a|0)==(b|0))return a|0;e=b+12|0;g=f[e>>2]|0;if(!g)h=0;else{i=a+16|0;do if(g>>>0>f[i>>2]<<5>>>0){j=f[c>>2]|0;if(!j)k=g;else{fn(j);f[c>>2]=0;f[i>>2]=0;f[a+12>>2]=0;k=f[e>>2]|0}if((k|0)<0)ym(c);else{j=((k+-1|0)>>>5)+1|0;l=dj(j<<2)|0;f[c>>2]=l;f[a+12>>2]=0;f[i>>2]=j;m=f[e>>2]|0;n=l;break}}else{m=g;n=f[c>>2]|0}while(0);ui(n|0,f[d>>2]|0,((m+-1|0)>>>5<<2)+4|0)|0;h=f[e>>2]|0}f[a+12>>2]=h;h=a+20|0;e=b+20|0;m=b+24|0;b=f[m>>2]|0;if(!b)o=0;else{d=a+28|0;do if(b>>>0>f[d>>2]<<5>>>0){n=f[h>>2]|0;if(!n)p=b;else{fn(n);f[h>>2]=0;f[d>>2]=0;f[a+24>>2]=0;p=f[m>>2]|0}if((p|0)<0)ym(h);else{n=((p+-1|0)>>>5)+1|0;c=dj(n<<2)|0;f[h>>2]=c;f[a+24>>2]=0;f[d>>2]=n;q=f[m>>2]|0;r=c;break}}else{q=b;r=f[h>>2]|0}while(0);ui(r|0,f[e>>2]|0,((q+-1|0)>>>5<<2)+4|0)|0;o=f[m>>2]|0}f[a+24>>2]=o;return a|0}function wd(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;f[c>>2]=1;d=a+4|0;e=c+8|0;g=c+12|0;c=f[e>>2]|0;i=(f[g>>2]|0)-c|0;if(i>>>0<4294967292){Yg(e,i+4|0,0);j=f[e>>2]|0}else j=c;c=j+i|0;i=h[d>>0]|h[d+1>>0]<<8|h[d+2>>0]<<16|h[d+3>>0]<<24;b[c>>0]=i;b[c+1>>0]=i>>8;b[c+2>>0]=i>>16;b[c+3>>0]=i>>24;i=a+8|0;c=a+12|0;d=f[i>>2]|0;if((f[c>>2]|0)!=(d|0)){j=d;d=0;do{k=j+(d<<2)|0;l=f[e>>2]|0;m=(f[g>>2]|0)-l|0;if(m>>>0<4294967292){Yg(e,m+4|0,0);n=f[e>>2]|0}else n=l;l=n+m|0;m=h[k>>0]|h[k+1>>0]<<8|h[k+2>>0]<<16|h[k+3>>0]<<24;b[l>>0]=m;b[l+1>>0]=m>>8;b[l+2>>0]=m>>16;b[l+3>>0]=m>>24;d=d+1|0;j=f[i>>2]|0}while(d>>>0<(f[c>>2]|0)-j>>2>>>0)}j=a+20|0;a=f[e>>2]|0;c=(f[g>>2]|0)-a|0;if(c>>>0<4294967292){Yg(e,c+4|0,0);o=f[e>>2]|0;p=o+c|0;q=h[j>>0]|h[j+1>>0]<<8|h[j+2>>0]<<16|h[j+3>>0]<<24;b[p>>0]=q;b[p+1>>0]=q>>8;b[p+2>>0]=q>>16;b[p+3>>0]=q>>24;return}else{o=a;p=o+c|0;q=h[j>>0]|h[j+1>>0]<<8|h[j+2>>0]<<16|h[j+3>>0]<<24;b[p>>0]=q;b[p+1>>0]=q>>8;b[p+2>>0]=q>>16;b[p+3>>0]=q>>24;return}}function xd(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0;b=u;u=u+16|0;c=b+4|0;d=b;e=a+8|0;g=f[e>>2]|0;ug(f[a+4>>2]|0,(f[g+56>>2]|0)-(f[g+52>>2]|0)>>2);g=a+84|0;a=f[g>>2]|0;if(!a){h=f[(f[e>>2]|0)+64>>2]|0;i=(f[h+4>>2]|0)-(f[h>>2]|0)>>2;h=(i>>>0)/3|0;if(i>>>0<=2){j=1;u=b;return j|0}i=0;while(1){f[d>>2]=i*3;f[c>>2]=f[d>>2];i=i+1|0;if(!(ob(e,c)|0)){j=0;k=10;break}if((i|0)>=(h|0)){j=1;k=10;break}}if((k|0)==10){u=b;return j|0}}else{h=f[a>>2]|0;if((f[a+4>>2]|0)==(h|0)){j=1;u=b;return j|0}a=h;h=0;while(1){f[d>>2]=f[a+(h<<2)>>2];f[c>>2]=f[d>>2];h=h+1|0;if(!(ob(e,c)|0)){j=0;k=10;break}i=f[g>>2]|0;a=f[i>>2]|0;if(h>>>0>=(f[i+4>>2]|0)-a>>2>>>0){j=1;k=10;break}}if((k|0)==10){u=b;return j|0}}return 0}function yd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;d=c;e=b;g=d-e|0;h=g>>2;i=a+8|0;j=f[i>>2]|0;k=f[a>>2]|0;l=k;if(h>>>0>j-k>>2>>>0){m=k;if(!k)n=j;else{j=a+4|0;o=f[j>>2]|0;if((o|0)!=(l|0))f[j>>2]=o+(~((o+-4-k|0)>>>2)<<2);fn(m);f[i>>2]=0;f[j>>2]=0;f[a>>2]=0;n=0}if(h>>>0>1073741823)ym(a);j=n>>1;m=n>>2>>>0<536870911?(j>>>0>>0?h:j):1073741823;if(m>>>0>1073741823)ym(a);j=dj(m<<2)|0;n=a+4|0;f[n>>2]=j;f[a>>2]=j;f[i>>2]=j+(m<<2);if((g|0)<=0)return;ee(j|0,b|0,g|0)|0;f[n>>2]=j+(g>>>2<<2);return}g=a+4|0;a=f[g>>2]|0;j=a-k>>2;k=h>>>0>j>>>0;h=k?b+(j<<2)|0:c;c=a;j=a;if((h|0)==(b|0))p=l;else{a=h+-4-e|0;e=b;b=l;while(1){f[b>>2]=f[e>>2];e=e+4|0;if((e|0)==(h|0))break;else b=b+4|0}p=l+((a>>>2)+1<<2)|0}if(k){k=d-h|0;if((k|0)<=0)return;ee(j|0,h|0,k|0)|0;f[g>>2]=(f[g>>2]|0)+(k>>>2<<2);return}else{if((c|0)==(p|0))return;f[g>>2]=c+(~((c+-4-p|0)>>>2)<<2);return}}function zd(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;d=u;u=u+16|0;e=d;if(!(Gf(e,c)|0)){g=0;u=d;return g|0}i=e;e=f[i>>2]|0;j=f[i+4>>2]|0;i=c+8|0;k=c+16|0;l=k;m=f[l>>2]|0;n=f[l+4>>2]|0;l=Vj(f[i>>2]|0,f[i+4>>2]|0,m|0,n|0)|0;i=I;if(j>>>0>i>>>0|(j|0)==(i|0)&e>>>0>l>>>0){g=0;u=d;return g|0}l=(f[c>>2]|0)+m|0;c=Tj(m|0,n|0,e|0,j|0)|0;j=k;f[j>>2]=c;f[j+4>>2]=I;if((e|0)<1){g=0;u=d;return g|0}f[a+40>>2]=l;j=e+-1|0;c=l+j|0;a:do switch((h[c>>0]|0)>>>6&3){case 0:{f[a+44>>2]=j;o=b[c>>0]&63;break}case 1:{if((e|0)<2){g=0;u=d;return g|0}else{f[a+44>>2]=e+-2;k=l+e+-2|0;o=(h[k+1>>0]|0)<<8&16128|(h[k>>0]|0);break a}break}case 2:{if((e|0)<3){g=0;u=d;return g|0}else{f[a+44>>2]=e+-3;k=l+e+-3|0;o=(h[k+1>>0]|0)<<8|(h[k>>0]|0)|(h[k+2>>0]|0)<<16&4128768;break a}break}case 3:{f[a+44>>2]=e+-4;k=l+e+-4|0;o=(h[k+2>>0]|0)<<16|(h[k+3>>0]|0)<<24&1056964608|(h[k+1>>0]|0)<<8|(h[k>>0]|0);break}default:{}}while(0);e=o+16384|0;f[a+48>>2]=e;g=e>>>0<4194304;u=d;return g|0}function Ad(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0;b=u;u=u+16|0;c=b+4|0;d=b;e=a+8|0;g=f[e>>2]|0;ug(f[a+4>>2]|0,(f[g+28>>2]|0)-(f[g+24>>2]|0)>>2);g=a+84|0;a=f[g>>2]|0;if(!a){h=f[e>>2]|0;i=(f[h+4>>2]|0)-(f[h>>2]|0)>>2;h=(i>>>0)/3|0;if(i>>>0<=2){j=1;u=b;return j|0}i=0;while(1){f[d>>2]=i*3;f[c>>2]=f[d>>2];i=i+1|0;if(!(rb(e,c)|0)){j=0;k=10;break}if((i|0)>=(h|0)){j=1;k=10;break}}if((k|0)==10){u=b;return j|0}}else{h=f[a>>2]|0;if((f[a+4>>2]|0)==(h|0)){j=1;u=b;return j|0}a=h;h=0;while(1){f[d>>2]=f[a+(h<<2)>>2];f[c>>2]=f[d>>2];h=h+1|0;if(!(rb(e,c)|0)){j=0;k=10;break}i=f[g>>2]|0;a=f[i>>2]|0;if(h>>>0>=(f[i+4>>2]|0)-a>>2>>>0){j=1;k=10;break}}if((k|0)==10){u=b;return j|0}}return 0}function Bd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;c=u;u=u+112|0;d=c+96|0;e=c+16|0;g=c+4|0;h=c;i=e+76|0;j=e;k=j+76|0;do{f[j>>2]=0;j=j+4|0}while((j|0)<(k|0));f[i>>2]=-1;f[g>>2]=0;i=g+4|0;f[i>>2]=0;f[g+8>>2]=0;f[h>>2]=g;f[d>>2]=f[h>>2];if(kc(e,a,d)|0){d=f[g>>2]|0;rd(b,d,d+((f[i>>2]|0)-d>>2<<2)|0);l=f[e+68>>2]|0}else l=0;d=f[g>>2]|0;if(d|0){g=f[i>>2]|0;if((g|0)!=(d|0))f[i>>2]=g+(~((g+-4-d|0)>>>2)<<2);fn(d)}d=f[e+56>>2]|0;if(d|0)fn(d);d=f[e+32>>2]|0;if(d|0){g=e+36|0;i=f[g>>2]|0;if((i|0)!=(d|0))f[g>>2]=i+(~((i+-4-d|0)>>>2)<<2);fn(d)}d=f[e+20>>2]|0;if(d|0){i=e+24|0;g=f[i>>2]|0;if((g|0)!=(d|0))f[i>>2]=g+(~((g+-4-d|0)>>>2)<<2);fn(d)}d=f[e+8>>2]|0;if(d|0){g=e+12|0;i=f[g>>2]|0;if((i|0)!=(d|0))f[g>>2]=i+(~((i+-4-d|0)>>>2)<<2);fn(d)}d=e+4|0;e=f[d>>2]|0;f[d>>2]=0;if(!e){u=c;return l|0}of(e);fn(e);u=c;return l|0}function Cd(a,b,c,d){a=a|0;b=$(b);c=$(c);d=d|0;var e=Ja,f=Ja,g=Ja,h=Ja,i=Ja,j=Ja,k=Ja,l=Ja,m=0.0,o=0.0,p=0.0,q=0.0,r=0.0,s=0.0,t=Ja,u=Ja,v=0,w=0;e=$(b+c);f=$(b-c);if(!(f<=$(.5))|(!(f>=$(-.5))|(!(e>=$(.5))|!(e<=$(1.5))))){do if(!(e<=$(.5))){if(e>=$(1.5)){g=$($(1.5)-c);h=$($(1.5)-b);break}if(!(f<=$(-.5))){g=$(c+$(.5));h=$(b+$(-.5));break}else{g=$(c+$(-.5));h=$(b+$(.5));break}}else{g=$($(.5)-c);h=$($(.5)-b)}while(0);i=g;j=$(g-h);k=$(h+g);l=h;m=-1.0}else{i=b;j=f;k=e;l=c;m=1.0}c=$(+i*2.0+-1.0);i=$(+l*2.0+-1.0);o=+k*2.0;p=o+-1.0;q=3.0-o;o=+j*2.0;r=o+1.0;s=1.0-o;o=s>2]=$(0.0);t=$(0.0);u=$(0.0);v=d+4|0;n[v>>2]=t;w=d+8|0;n[w>>2]=u;return}else{l=$($(1.0)/$(L($(k))));k=$(j*l);n[d>>2]=k;t=$(c*l);u=$(i*l);v=d+4|0;n[v>>2]=t;w=d+8|0;n[w>>2]=u;return}}function Dd(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;e=c&255;g=(d|0)!=0;a:do if(g&(a&3|0)!=0){h=c&255;i=d;j=a;while(1){if((b[j>>0]|0)==h<<24>>24){k=i;l=j;m=6;break a}n=j+1|0;o=i+-1|0;p=(o|0)!=0;if(p&(n&3|0)!=0){i=o;j=n}else{q=o;r=n;s=p;m=5;break}}}else{q=d;r=a;s=g;m=5}while(0);if((m|0)==5)if(s){k=q;l=r;m=6}else{t=0;u=r}b:do if((m|0)==6){r=c&255;if((b[l>>0]|0)==r<<24>>24){t=k;u=l}else{q=X(e,16843009)|0;c:do if(k>>>0>3){s=k;g=l;while(1){a=f[g>>2]^q;if((a&-2139062144^-2139062144)&a+-16843009|0)break;a=g+4|0;d=s+-4|0;if(d>>>0>3){s=d;g=a}else{v=d;w=a;m=11;break c}}x=s;y=g}else{v=k;w=l;m=11}while(0);if((m|0)==11)if(!v){t=0;u=w;break}else{x=v;y=w}while(1){if((b[y>>0]|0)==r<<24>>24){t=x;u=y;break b}q=y+1|0;x=x+-1|0;if(!x){t=0;u=q;break}else y=q}}}while(0);return (t|0?u:0)|0}function Ed(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0;e=u;u=u+16|0;g=e;h=d+8|0;i=f[h>>2]|0;j=f[h+4>>2]|0;h=d+16|0;k=h;l=f[k>>2]|0;m=f[k+4>>2]|0;if((j|0)>(m|0)|(j|0)==(m|0)&i>>>0>l>>>0){k=b[(f[d>>2]|0)+l>>0]|0;n=Tj(l|0,m|0,1,0)|0;o=I;p=h;f[p>>2]=n;f[p+4>>2]=o;if(k<<24>>24!=-2){q=o;r=n;s=k;t=3}}else{q=m;r=l;s=0;t=3}if((t|0)==3){if((j|0)>(q|0)|(j|0)==(q|0)&i>>>0>r>>>0){i=b[(f[d>>2]|0)+r>>0]|0;j=Tj(r|0,q|0,1,0)|0;q=h;f[q>>2]=j;f[q+4>>2]=I;v=i}else v=0;Ta[f[(f[a>>2]|0)+40>>2]&7](g,a,s<<24>>24,v<<24>>24);v=a+20|0;s=f[g>>2]|0;f[g>>2]=0;i=f[v>>2]|0;f[v>>2]=s;if(i){Qa[f[(f[i>>2]|0)+4>>2]&127](i);i=f[g>>2]|0;f[g>>2]=0;if(i|0)Qa[f[(f[i>>2]|0)+4>>2]&127](i)}else f[g>>2]=0}g=f[a+20>>2]|0;if(g|0?!(Ma[f[(f[a>>2]|0)+28>>2]&127](a,g)|0):0){w=0;u=e;return w|0}w=Na[f[(f[a>>2]|0)+36>>2]&31](a,c,d)|0;u=e;return w|0}function Fd(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=a+4|0;g=f[e>>2]|0;if(!g){f[c>>2]=e;h=e;return h|0}e=b[d+11>>0]|0;i=e<<24>>24<0;j=i?f[d+4>>2]|0:e&255;e=i?f[d>>2]|0:d;d=g;g=a+4|0;while(1){a=d+16|0;i=b[a+11>>0]|0;k=i<<24>>24<0;l=k?f[d+20>>2]|0:i&255;i=l>>>0>>0;m=i?l:j;if((m|0)!=0?(n=mh(e,k?f[a>>2]|0:a,m)|0,(n|0)!=0):0)if((n|0)<0)o=8;else o=10;else if(j>>>0>>0)o=8;else o=10;if((o|0)==8){o=0;n=f[d>>2]|0;if(!n){o=9;break}else{p=n;q=d}}else if((o|0)==10){o=0;n=j>>>0>>0?j:l;if((n|0)!=0?(l=mh(k?f[a>>2]|0:a,e,n)|0,(l|0)!=0):0){if((l|0)>=0){o=16;break}}else o=12;if((o|0)==12?(o=0,!i):0){o=16;break}r=d+4|0;i=f[r>>2]|0;if(!i){o=15;break}else{p=i;q=r}}d=p;g=q}if((o|0)==9){f[c>>2]=d;h=d;return h|0}else if((o|0)==15){f[c>>2]=d;h=r;return h|0}else if((o|0)==16){f[c>>2]=d;h=g;return h|0}return 0}function Gd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0;d=u;u=u+32|0;e=d+24|0;g=d+16|0;h=d+8|0;i=d;j=a+4|0;k=f[j>>2]|0;l=f[b>>2]|0;m=f[b+4>>2]|0;b=f[c>>2]|0;n=f[c+4>>2]|0;c=b-l<<3;f[j>>2]=k-m+n+c;j=(f[a>>2]|0)+(k>>>5<<2)|0;a=k&31;k=j;if((m|0)!=(a|0)){f[e>>2]=l;f[e+4>>2]=m;f[g>>2]=b;f[g+4>>2]=n;f[h>>2]=k;f[h+4>>2]=a;Bc(i,e,g,h);u=d;return}h=n-m+c|0;c=l;if((h|0)>0){if(!m){o=l;p=c;q=h;r=j;s=0}else{l=32-m|0;n=(h|0)<(l|0)?h:l;g=-1>>>(l-n|0)&-1<>2]=f[j>>2]&~g|f[c>>2]&g;g=n+m|0;l=c+4|0;o=l;p=l;q=h-n|0;r=j+(g>>>5<<2)|0;s=g&31}g=(q|0)/32|0;ui(r|0,o|0,g<<2|0)|0;o=q-(g<<5)|0;q=r+(g<<2)|0;r=q;if((o|0)>0){j=-1>>>(32-o|0);f[q>>2]=f[q>>2]&~j|f[p+(g<<2)>>2]&j;t=r;v=o}else{t=r;v=s}}else{t=k;v=m}f[i>>2]=t;f[i+4>>2]=v;u=d;return}function Hd(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=u;u=u+32|0;g=e+12|0;h=e;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;i=gg(c)|0;if(i>>>0>4294967279)ym(g);if(i>>>0<11){b[g+11>>0]=i;if(!i)j=g;else{k=g;l=6}}else{m=i+16&-16;n=dj(m)|0;f[g>>2]=n;f[g+8>>2]=m|-2147483648;f[g+4>>2]=i;k=n;l=6}if((l|0)==6){ee(k|0,c|0,i|0)|0;j=k}b[j+i>>0]=0;f[h>>2]=0;f[h+4>>2]=0;f[h+8>>2]=0;i=gg(d)|0;if(i>>>0>4294967279)ym(h);if(i>>>0<11){b[h+11>>0]=i;if(!i)o=h;else{p=h;l=12}}else{j=i+16&-16;k=dj(j)|0;f[h>>2]=k;f[h+8>>2]=j|-2147483648;f[h+4>>2]=i;p=k;l=12}if((l|0)==12){ee(p|0,d|0,i|0)|0;o=p}b[o+i>>0]=0;i=f[a+4>>2]|0;if((i|0)!=0?(o=Xc(i,g,h)|0,(o|0)!=0):0)q=lh(a,f[o+40>>2]|0)|0;else q=-1;if((b[h+11>>0]|0)<0)fn(f[h>>2]|0);if((b[g+11>>0]|0)>=0){u=e;return q|0}fn(f[g>>2]|0);u=e;return q|0}function Id(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;e=c;g=d-e|0;h=a+8|0;i=f[h>>2]|0;j=f[a>>2]|0;k=j;if(g>>>0>(i-j|0)>>>0){if(!j)l=i;else{i=a+4|0;if((f[i>>2]|0)!=(k|0))f[i>>2]=k;fn(k);f[h>>2]=0;f[i>>2]=0;f[a>>2]=0;l=0}if((g|0)<0)ym(a);i=l<<1;m=l>>>0<1073741823?(i>>>0>>0?g:i):2147483647;if((m|0)<0)ym(a);i=dj(m)|0;l=a+4|0;f[l>>2]=i;f[a>>2]=i;f[h>>2]=i+m;if((c|0)==(d|0))return;else{n=i;o=c}do{b[n>>0]=b[o>>0]|0;o=o+1|0;n=(f[l>>2]|0)+1|0;f[l>>2]=n}while((o|0)!=(d|0));return}else{o=a+4|0;a=(f[o>>2]|0)-j|0;j=g>>>0>a>>>0;g=c+a|0;a=j?g:d;n=a-e|0;if(n|0)ui(k|0,c|0,n|0)|0;c=k+n|0;if(!j){if((f[o>>2]|0)==(c|0))return;f[o>>2]=c;return}if((a|0)==(d|0))return;a=f[o>>2]|0;c=g;do{b[a>>0]=b[c>>0]|0;c=c+1|0;a=(f[o>>2]|0)+1|0;f[o>>2]=a}while((c|0)!=(d|0));return}}function Jd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;c=a+8|0;d=f[c>>2]|0;e=a+4|0;g=f[e>>2]|0;h=g;if(d-g>>2>>>0>=b>>>0){Vf(g|0,0,b<<2|0)|0;f[e>>2]=g+(b<<2);return}i=f[a>>2]|0;j=g-i>>2;g=j+b|0;k=i;if(g>>>0>1073741823)ym(a);l=d-i|0;d=l>>1;m=l>>2>>>0<536870911?(d>>>0>>0?g:d):1073741823;do if(m)if(m>>>0>1073741823){d=ra(8)|0;$k(d,9793);f[d>>2]=3708;va(d|0,856,80)}else{n=dj(m<<2)|0;break}else n=0;while(0);d=n+(j<<2)|0;Vf(d|0,0,b<<2|0)|0;b=d;j=n+(m<<2)|0;m=n+(g<<2)|0;if((h|0)==(k|0)){o=b;p=i;q=h}else{i=d;d=h;h=b;do{d=d+-4|0;b=f[d>>2]|0;f[d>>2]=0;f[i+-4>>2]=b;i=h+-4|0;h=i}while((d|0)!=(k|0));o=h;p=f[a>>2]|0;q=f[e>>2]|0}f[a>>2]=o;f[e>>2]=m;f[c>>2]=j;j=p;if((q|0)!=(j|0)){c=q;do{c=c+-4|0;q=f[c>>2]|0;f[c>>2]=0;if(q|0)Qa[f[(f[q>>2]|0)+4>>2]&127](q)}while((c|0)!=(j|0))}if(!p)return;fn(p);return}function Kd(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;d=a+4|0;e=f[a>>2]|0;g=((f[d>>2]|0)-e|0)/12|0;h=g+1|0;if(h>>>0>357913941)ym(a);i=a+8|0;j=((f[i>>2]|0)-e|0)/12|0;e=j<<1;k=j>>>0<178956970?(e>>>0>>0?h:e):357913941;do if(k)if(k>>>0>357913941){e=ra(8)|0;$k(e,9793);f[e>>2]=3708;va(e|0,856,80)}else{l=dj(k*12|0)|0;break}else l=0;while(0);e=l+(g*12|0)|0;g=e;h=l+(k*12|0)|0;Sf(e,c);c=e+12|0;k=f[a>>2]|0;l=f[d>>2]|0;if((l|0)==(k|0)){m=g;n=k;o=k}else{j=e;e=l;l=g;do{g=j+-12|0;e=e+-12|0;f[g>>2]=f[e>>2];f[g+4>>2]=f[e+4>>2];f[g+8>>2]=f[e+8>>2];f[e>>2]=0;f[e+4>>2]=0;f[e+8>>2]=0;j=l+-12|0;l=j}while((e|0)!=(k|0));m=l;n=f[a>>2]|0;o=f[d>>2]|0}f[a>>2]=m;f[d>>2]=c;f[i>>2]=h;h=n;if((o|0)!=(h|0)){i=o;do{i=i+-12|0;if((b[i+11>>0]|0)<0)fn(f[i>>2]|0)}while((i|0)!=(h|0))}if(!n)return;fn(n);return}function Ld(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=c;e=b;g=d-e|0;h=g>>2;i=a+8|0;j=f[i>>2]|0;k=f[a>>2]|0;l=k;if(h>>>0<=j-k>>2>>>0){m=a+4|0;n=(f[m>>2]|0)-k>>2;o=h>>>0>n>>>0;p=o?b+(n<<2)|0:c;c=p;n=c-e|0;e=n>>2;if(e|0)ui(k|0,b|0,n|0)|0;n=l+(e<<2)|0;if(o){o=d-c|0;if((o|0)<=0)return;ee(f[m>>2]|0,p|0,o|0)|0;f[m>>2]=(f[m>>2]|0)+(o>>>2<<2);return}else{o=f[m>>2]|0;if((o|0)==(n|0))return;f[m>>2]=o+(~((o+-4-n|0)>>>2)<<2);return}}n=k;if(!k)q=j;else{j=a+4|0;o=f[j>>2]|0;if((o|0)!=(l|0))f[j>>2]=o+(~((o+-4-k|0)>>>2)<<2);fn(n);f[i>>2]=0;f[j>>2]=0;f[a>>2]=0;q=0}if(h>>>0>1073741823)ym(a);j=q>>1;n=q>>2>>>0<536870911?(j>>>0>>0?h:j):1073741823;if(n>>>0>1073741823)ym(a);j=dj(n<<2)|0;h=a+4|0;f[h>>2]=j;f[a>>2]=j;f[i>>2]=j+(n<<2);if((g|0)<=0)return;ee(j|0,b|0,g|0)|0;f[h>>2]=j+(g>>>2<<2);return}function Md(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;c=u;u=u+16|0;d=c;e=dj(64)|0;g=dj(12)|0;h=f[(f[a+4>>2]|0)+80>>2]|0;f[g+4>>2]=0;f[g>>2]=2592;f[g+8>>2]=h;f[d>>2]=g;Eh(e,d);g=e;if((b|0)>=0){h=a+8|0;i=a+12|0;a=f[i>>2]|0;j=f[h>>2]|0;k=a-j>>2;do if((k|0)<=(b|0)){l=b+1|0;m=a;if(l>>>0>k>>>0){Jd(h,l-k|0);break}if(l>>>0>>0?(n=j+(l<<2)|0,(m|0)!=(n|0)):0){l=m;do{m=l+-4|0;f[i>>2]=m;o=f[m>>2]|0;f[m>>2]=0;if(o|0)Qa[f[(f[o>>2]|0)+4>>2]&127](o);l=f[i>>2]|0}while((l|0)!=(n|0))}}while(0);i=(f[h>>2]|0)+(b<<2)|0;b=f[i>>2]|0;f[i>>2]=g;if(!b)p=1;else{Qa[f[(f[b>>2]|0)+4>>2]&127](b);p=1}}else{Qa[f[(f[e>>2]|0)+4>>2]&127](e);p=0}e=f[d>>2]|0;f[d>>2]=0;if(!e){u=c;return p|0}Qa[f[(f[e>>2]|0)+4>>2]&127](e);u=c;return p|0}function Nd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;c=f[b>>2]|0;do if((c|0)!=-1){b=f[(f[(f[a+4>>2]|0)+12>>2]|0)+(c<<2)>>2]|0;d=c+1|0;e=((d>>>0)%3|0|0)==0?c+-2|0:d;if((e|0)==-1)g=-1;else g=f[(f[(f[a>>2]|0)+96>>2]|0)+(((e|0)/3|0)*12|0)+(((e|0)%3|0)<<2)>>2]|0;if((b|0)!=-1){e=(((b>>>0)%3|0|0)==0?2:-1)+b|0;if((e|0)==-1){h=0;i=-1;j=b}else{h=0;i=f[(f[(f[a>>2]|0)+96>>2]|0)+(((e|0)/3|0)*12|0)+(((e|0)%3|0)<<2)>>2]|0;j=b}}else{h=1;i=-1;j=-1}if((g|0)!=(i|0)){k=-1;return k|0}b=(((c>>>0)%3|0|0)==0?2:-1)+c|0;if((b|0)==-1)if(h){l=-1;m=-1;n=j;break}else o=-1;else{e=f[(f[(f[a>>2]|0)+96>>2]|0)+(((b|0)/3|0)*12|0)+(((b|0)%3|0)<<2)>>2]|0;if(h){l=-1;m=e;n=j;break}else o=e}e=j+1|0;b=((e>>>0)%3|0|0)==0?j+-2|0:e;if((b|0)==-1){l=-1;m=o;n=j}else{l=f[(f[(f[a>>2]|0)+96>>2]|0)+(((b|0)/3|0)*12|0)+(((b|0)%3|0)<<2)>>2]|0;m=o;n=j}}else{l=-1;m=-1;n=-1}while(0);k=(m|0)!=(l|0)?-1:n;return k|0}function Od(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0;e=a+20|0;if(Tb(e,c)|0){g=0;return g|0}a=Ab(e,c)|0;c=f[d>>2]|0;f[d>>2]=0;d=f[a>>2]|0;f[a>>2]=c;if(!d){g=1;return g|0}c=f[d+28>>2]|0;if(c|0){a=c;do{c=a;a=f[a>>2]|0;Ye(c+8|0);fn(c)}while((a|0)!=0)}a=d+20|0;c=f[a>>2]|0;f[a>>2]=0;if(c|0)fn(c);c=f[d+8>>2]|0;if(c|0){a=c;do{c=a;a=f[a>>2]|0;e=c+8|0;h=f[c+20>>2]|0;if(h|0){i=c+24|0;if((f[i>>2]|0)!=(h|0))f[i>>2]=h;fn(h)}if((b[e+11>>0]|0)<0)fn(f[e>>2]|0);fn(c)}while((a|0)!=0)}a=f[d>>2]|0;f[d>>2]=0;if(a|0)fn(a);fn(d);g=1;return g|0}function Pd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0;d=u;u=u+16|0;e=d;f[e>>2]=b;g=a+8|0;if(((f[a+12>>2]|0)-(f[g>>2]|0)>>2|0)<=(b|0))ye(g,b+1|0);h=f[(f[c>>2]|0)+56>>2]|0;do if((h|0)<5){i=a+20+(h*12|0)+4|0;j=f[i>>2]|0;if((j|0)==(f[a+20+(h*12|0)+8>>2]|0)){yf(a+20+(h*12|0)|0,e);break}else{f[j>>2]=b;f[i>>2]=j+4;break}}while(0);b=f[c>>2]|0;h=f[e>>2]|0;f[b+60>>2]=h;e=(f[g>>2]|0)+(h<<2)|0;f[c>>2]=0;c=f[e>>2]|0;f[e>>2]=b;if(!c){u=d;return}b=c+88|0;e=f[b>>2]|0;f[b>>2]=0;if(e|0){b=f[e+8>>2]|0;if(b|0){h=e+12|0;if((f[h>>2]|0)!=(b|0))f[h>>2]=b;fn(b)}fn(e)}e=f[c+68>>2]|0;if(e|0){b=c+72|0;h=f[b>>2]|0;if((h|0)!=(e|0))f[b>>2]=h+(~((h+-4-e|0)>>>2)<<2);fn(e)}e=c+64|0;h=f[e>>2]|0;f[e>>2]=0;if(h|0){e=f[h>>2]|0;if(e|0){b=h+4|0;if((f[b>>2]|0)!=(e|0))f[b>>2]=e;fn(e)}fn(h)}fn(c);u=d;return}function Qd(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0;f[a>>2]=2696;b=f[a+68>>2]|0;if(b|0){c=a+72|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+56>>2]|0;if(b|0){d=a+60|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+44>>2]|0;if(b|0){c=a+48|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+32>>2]|0;if(b|0){d=a+36|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+20>>2]|0;if(b|0){c=a+24|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}Re(a+8|0);b=a+4|0;a=f[b>>2]|0;f[b>>2]=0;if(!a)return;b=a+40|0;d=f[b>>2]|0;if(d|0){c=a+44|0;e=f[c>>2]|0;if((e|0)==(d|0))g=d;else{h=e;do{e=h+-4|0;f[c>>2]=e;i=f[e>>2]|0;f[e>>2]=0;if(i|0){Df(i);fn(i)}h=f[c>>2]|0}while((h|0)!=(d|0));g=f[b>>2]|0}fn(g)}Df(a);fn(a);return}function Rd(a){a=a|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;c=a+12|0;d=f[a>>2]|0;e=a+8|0;g=f[e>>2]|0;h=(g|0)==-1;if(!(b[c>>0]|0)){do if(((!h?(i=(((g>>>0)%3|0|0)==0?2:-1)+g|0,(i|0)!=-1):0)?(f[(f[d>>2]|0)+(i>>>5<<2)>>2]&1<<(i&31)|0)==0:0)?(j=f[(f[(f[d+64>>2]|0)+12>>2]|0)+(i<<2)>>2]|0,(j|0)!=-1):0)if(!((j>>>0)%3|0)){k=j+2|0;break}else{k=j+-1|0;break}else k=-1;while(0);f[e>>2]=k;return}k=g+1|0;if(((!h?(h=((k>>>0)%3|0|0)==0?g+-2|0:k,(h|0)!=-1):0)?(f[(f[d>>2]|0)+(h>>>5<<2)>>2]&1<<(h&31)|0)==0:0)?(k=f[(f[(f[d+64>>2]|0)+12>>2]|0)+(h<<2)>>2]|0,h=k+1|0,(k|0)!=-1):0){g=((h>>>0)%3|0|0)==0?k+-2|0:h;f[e>>2]=g;if((g|0)!=-1){if((g|0)!=(f[a+4>>2]|0))return;f[e>>2]=-1;return}}else f[e>>2]=-1;g=f[a+4>>2]|0;do if((((g|0)!=-1?(a=(((g>>>0)%3|0|0)==0?2:-1)+g|0,(a|0)!=-1):0)?(f[(f[d>>2]|0)+(a>>>5<<2)>>2]&1<<(a&31)|0)==0:0)?(h=f[(f[(f[d+64>>2]|0)+12>>2]|0)+(a<<2)>>2]|0,(h|0)!=-1):0)if(!((h>>>0)%3|0)){l=h+2|0;break}else{l=h+-1|0;break}else l=-1;while(0);f[e>>2]=l;b[c>>0]=0;return}function Sd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0;d=u;u=u+48|0;e=d+16|0;g=d;h=d+32|0;i=a+28|0;j=f[i>>2]|0;f[h>>2]=j;k=a+20|0;l=(f[k>>2]|0)-j|0;f[h+4>>2]=l;f[h+8>>2]=b;f[h+12>>2]=c;b=l+c|0;l=a+60|0;f[g>>2]=f[l>>2];f[g+4>>2]=h;f[g+8>>2]=2;j=kk(Aa(146,g|0)|0)|0;a:do if((b|0)!=(j|0)){g=j;m=h;n=2;o=b;while(1){if((g|0)<0)break;o=o-g|0;p=f[m+4>>2]|0;q=g>>>0>p>>>0;r=q?m+8|0:m;s=(q<<31>>31)+n|0;t=g-(q?p:0)|0;f[r>>2]=(f[r>>2]|0)+t;p=r+4|0;f[p>>2]=(f[p>>2]|0)-t;f[e>>2]=f[l>>2];f[e+4>>2]=r;f[e+8>>2]=s;g=kk(Aa(146,e|0)|0)|0;if((o|0)==(g|0)){v=3;break a}else{m=r;n=s}}f[a+16>>2]=0;f[i>>2]=0;f[k>>2]=0;f[a>>2]=f[a>>2]|32;if((n|0)==2)w=0;else w=c-(f[m+4>>2]|0)|0}else v=3;while(0);if((v|0)==3){v=f[a+44>>2]|0;f[a+16>>2]=v+(f[a+48>>2]|0);f[i>>2]=v;f[k>>2]=v;w=c}u=d;return w|0}function Td(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=a+4|0;a=f[d>>2]|0;do if(a|0){e=b[c+11>>0]|0;g=e<<24>>24<0;h=g?f[c+4>>2]|0:e&255;e=g?f[c>>2]|0:c;g=d;i=a;a:while(1){j=i;while(1){k=j+16|0;l=b[k+11>>0]|0;m=l<<24>>24<0;n=m?f[j+20>>2]|0:l&255;l=h>>>0>>0?h:n;if((l|0)!=0?(o=mh(m?f[k>>2]|0:k,e,l)|0,(o|0)!=0):0){if((o|0)>=0)break}else p=6;if((p|0)==6?(p=0,n>>>0>=h>>>0):0)break;n=f[j+4>>2]|0;if(!n){q=g;break a}else j=n}i=f[j>>2]|0;if(!i){q=j;break}else g=j}if((q|0)!=(d|0)){g=q+16|0;i=b[g+11>>0]|0;n=i<<24>>24<0;o=n?f[q+20>>2]|0:i&255;i=o>>>0>>0?o:h;if(i|0?(l=mh(e,n?f[g>>2]|0:g,i)|0,l|0):0){if((l|0)<0)break;else r=q;return r|0}if(h>>>0>=o>>>0){r=q;return r|0}}}while(0);r=d;return r|0}function Ud(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;b=f[a+196>>2]|0;if(b|0){c=a+200|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=a+184|0;d=f[b>>2]|0;if(d|0){c=a+188|0;e=f[c>>2]|0;if((e|0)==(d|0))g=d;else{h=e;while(1){e=h+-12|0;f[c>>2]=e;i=f[e>>2]|0;if(!i)j=e;else{e=h+-8|0;k=f[e>>2]|0;if((k|0)!=(i|0))f[e>>2]=k+(~((k+-4-i|0)>>>2)<<2);fn(i);j=f[c>>2]|0}if((j|0)==(d|0))break;else h=j}g=f[b>>2]|0}fn(g)}g=f[a+156>>2]|0;if(g|0){b=a+160|0;j=f[b>>2]|0;if((j|0)!=(g|0))f[b>>2]=j+(~((j+-4-g|0)>>>2)<<2);fn(g)}g=a+136|0;j=f[g>>2]|0;f[g>>2]=0;if(!j){l=a+120|0;ln(l);m=a+80|0;ln(m);n=a+64|0;ln(n);o=a+24|0;ln(o);return}g=j+-4|0;b=f[g>>2]|0;if(b|0){h=j+(b<<4)|0;do{h=h+-16|0;ln(h)}while((h|0)!=(j|0))}dn(g);l=a+120|0;ln(l);m=a+80|0;ln(m);n=a+64|0;ln(n);o=a+24|0;ln(o);return}function Vd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=a+8|0;f[c>>2]=f[b>>2];vd(a+12|0,b+4|0)|0;d=a+44|0;e=b+36|0;f[d>>2]=f[e>>2];f[d+4>>2]=f[e+4>>2];f[d+8>>2]=f[e+8>>2];f[d+12>>2]=f[e+12>>2];if((c|0)==(b|0)){f[a+96>>2]=f[b+88>>2];return}else{yd(a+60|0,f[b+52>>2]|0,f[b+56>>2]|0);yd(a+72|0,f[b+64>>2]|0,f[b+68>>2]|0);yd(a+84|0,f[b+76>>2]|0,f[b+80>>2]|0);f[a+96>>2]=f[b+88>>2];Ld(a+100|0,f[b+92>>2]|0,f[b+96>>2]|0);return}}function Wd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;d=a+8|0;e=f[d>>2]|0;g=a+4|0;h=f[g>>2]|0;if(((e-h|0)/12|0)>>>0>=b>>>0){i=h;j=b;do{f[i>>2]=f[c>>2];f[i+4>>2]=f[c+4>>2];f[i+8>>2]=f[c+8>>2];i=(f[g>>2]|0)+12|0;f[g>>2]=i;j=j+-1|0}while((j|0)!=0);return}j=f[a>>2]|0;i=(h-j|0)/12|0;h=i+b|0;if(h>>>0>357913941)ym(a);k=(e-j|0)/12|0;j=k<<1;e=k>>>0<178956970?(j>>>0>>0?h:j):357913941;do if(e)if(e>>>0>357913941){j=ra(8)|0;$k(j,9793);f[j>>2]=3708;va(j|0,856,80)}else{l=dj(e*12|0)|0;break}else l=0;while(0);j=l+(i*12|0)|0;i=l+(e*12|0)|0;e=j;l=b;b=j;do{f[e>>2]=f[c>>2];f[e+4>>2]=f[c+4>>2];f[e+8>>2]=f[c+8>>2];e=b+12|0;b=e;l=l+-1|0}while((l|0)!=0);l=f[a>>2]|0;e=(f[g>>2]|0)-l|0;c=j+(((e|0)/-12|0)*12|0)|0;if((e|0)>0)ee(c|0,l|0,e|0)|0;f[a>>2]=c;f[g>>2]=b;f[d>>2]=i;if(!l)return;fn(l);return}function Xd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=u;u=u+32|0;g=e+8|0;i=e;if((d|0)!=3){f[a>>2]=0;u=e;return}d=f[b+12>>2]|0;j=f[b+4>>2]|0;f[g>>2]=-1;f[g+4>>2]=-1;f[g+8>>2]=-1;f[g+12>>2]=-1;a:do if((c|0)==-2){k=0;l=8}else{b=f[(f[(f[j+4>>2]|0)+8>>2]|0)+(d<<2)>>2]|0;do if((La[f[(f[j>>2]|0)+8>>2]&127](j)|0)==1){Ic(i,j,c,d,g,((h[j+36>>0]|0)<<8|(h[j+37>>0]|0))&65535);m=f[i>>2]|0;if(!m){f[i>>2]=0;break}else{n=m;o=i;break a}}while(0);m=dj(24)|0;f[m+4>>2]=b;p=m+8|0;f[p>>2]=f[g>>2];f[p+4>>2]=f[g+4>>2];f[p+8>>2]=f[g+8>>2];f[p+12>>2]=f[g+12>>2];f[m>>2]=1884;k=m;l=8}while(0);if((l|0)==8){f[i>>2]=k;n=k;o=i}f[a>>2]=n;f[o>>2]=0;u=e;return}function Yd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c=a+4|0;d=f[a>>2]|0;e=(f[c>>2]|0)-d>>2;g=e+1|0;if(g>>>0>1073741823)ym(a);h=a+8|0;i=(f[h>>2]|0)-d|0;d=i>>1;j=i>>2>>>0<536870911?(d>>>0>>0?g:d):1073741823;do if(j)if(j>>>0>1073741823){d=ra(8)|0;$k(d,9793);f[d>>2]=3708;va(d|0,856,80)}else{k=dj(j<<2)|0;break}else k=0;while(0);d=k+(e<<2)|0;e=d;g=k+(j<<2)|0;j=f[b>>2]|0;f[b>>2]=0;f[d>>2]=j;j=d+4|0;b=f[a>>2]|0;k=f[c>>2]|0;if((k|0)==(b|0)){l=e;m=b;n=b}else{i=d;d=k;k=e;do{d=d+-4|0;e=f[d>>2]|0;f[d>>2]=0;f[i+-4>>2]=e;i=k+-4|0;k=i}while((d|0)!=(b|0));l=k;m=f[a>>2]|0;n=f[c>>2]|0}f[a>>2]=l;f[c>>2]=j;f[h>>2]=g;g=m;if((n|0)!=(g|0)){h=n;do{h=h+-4|0;n=f[h>>2]|0;f[h>>2]=0;if(n|0){Df(n);fn(n)}}while((h|0)!=(g|0))}if(!m)return;fn(m);return}function Zd(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0;e=u;u=u+80|0;g=e;h=e+64|0;Uh(g);i=f[(f[a+8>>2]|0)+56>>2]|0;j=X(di(5)|0,d)|0;kg(g,i,0,d&255,5,0,j,((j|0)<0)<<31>>31,0,0);j=dj(96)|0;Gh(j,g);b[j+84>>0]=1;g=f[j+68>>2]|0;d=j+72|0;i=f[d>>2]|0;if((i|0)!=(g|0))f[d>>2]=i+(~((i+-4-g|0)>>>2)<<2);ag(j,c)|0;f[h>>2]=j;Kf(a,h);a=f[h>>2]|0;f[h>>2]=0;if(!a){u=e;return}h=a+88|0;j=f[h>>2]|0;f[h>>2]=0;if(j|0){h=f[j+8>>2]|0;if(h|0){c=j+12|0;if((f[c>>2]|0)!=(h|0))f[c>>2]=h;fn(h)}fn(j)}j=f[a+68>>2]|0;if(j|0){h=a+72|0;c=f[h>>2]|0;if((c|0)!=(j|0))f[h>>2]=c+(~((c+-4-j|0)>>>2)<<2);fn(j)}j=a+64|0;c=f[j>>2]|0;f[j>>2]=0;if(c|0){j=f[c>>2]|0;if(j|0){h=c+4|0;if((f[h>>2]|0)!=(j|0))f[h>>2]=j;fn(j)}fn(c)}fn(a);u=e;return}function _d(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=f[c>>2]|0;c=f[a>>2]|0;e=c+(d>>>5<<2)|0;f[e>>2]=f[e>>2]|1<<(d&31);e=f[a+64>>2]|0;g=(d|0)==-1;h=d+1|0;if(!g?(i=((h>>>0)%3|0|0)==0?d+-2|0:h,(i|0)!=-1):0)j=f[(f[e>>2]|0)+(i<<2)>>2]|0;else j=-1;i=a+12|0;h=(f[i>>2]|0)+(j>>>5<<2)|0;f[h>>2]=f[h>>2]|1<<(j&31);if(g){j=(f[i>>2]|0)+536870908|0;f[j>>2]=f[j>>2]|-2147483648;return}j=(((d>>>0)%3|0|0)==0?2:-1)+d|0;if((j|0)==-1)k=-1;else k=f[(f[e>>2]|0)+(j<<2)>>2]|0;j=(f[i>>2]|0)+(k>>>5<<2)|0;f[j>>2]=f[j>>2]|1<<(k&31);if(g)return;g=f[(f[e+12>>2]|0)+(d<<2)>>2]|0;if((g|0)==-1)return;b[a+24>>0]=0;a=c+(g>>>5<<2)|0;f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0;c=f[e>>2]|0;f[e>>2]=0;if(c|0){e=f[c+8>>2]|0;if(e|0){h=c+12|0;if((f[h>>2]|0)!=(e|0))f[h>>2]=e;fn(e)}fn(c)}c=f[g+68>>2]|0;if(c|0){e=g+72|0;h=f[e>>2]|0;if((h|0)!=(c|0))f[e>>2]=h+(~((h+-4-c|0)>>>2)<<2);fn(c)}c=g+64|0;h=f[c>>2]|0;f[c>>2]=0;if(h|0){c=f[h>>2]|0;if(c|0){e=h+4|0;if((f[e>>2]|0)!=(c|0))f[e>>2]=c;fn(c)}fn(h)}fn(g)}g=a+84|0;h=a+88|0;a=f[h>>2]|0;c=f[g>>2]|0;e=a-c>>2;if((e|0)>(b|0)){u=d;return}i=b+1|0;b=a;if(i>>>0>e>>>0){Fe(g,i-e|0);u=d;return}if(i>>>0>=e>>>0){u=d;return}e=c+(i<<2)|0;if((b|0)==(e|0)){u=d;return}f[h>>2]=b+(~((b+-4-e|0)>>>2)<<2);u=d;return}function be(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;c=b+8|0;d=f[c>>2]|0;e=f[c+4>>2]|0;c=b+16|0;g=c;i=f[g>>2]|0;j=f[g+4>>2]|0;g=Tj(i|0,j|0,4,0)|0;k=I;if((e|0)<(k|0)|(e|0)==(k|0)&d>>>0>>0){l=0;return l|0}m=f[b>>2]|0;n=m+i|0;o=h[n>>0]|h[n+1>>0]<<8|h[n+2>>0]<<16|h[n+3>>0]<<24;n=c;f[n>>2]=g;f[n+4>>2]=k;k=Tj(i|0,j|0,8,0)|0;j=I;if((e|0)<(j|0)|(e|0)==(j|0)&d>>>0>>0){l=0;return l|0}d=m+g|0;g=h[d>>0]|h[d+1>>0]<<8|h[d+2>>0]<<16|h[d+3>>0]<<24;d=c;f[d>>2]=k;f[d+4>>2]=j;if((o|0)>(g|0)){l=0;return l|0}f[a+12>>2]=o;f[a+16>>2]=g;j=Vj(g|0,((g|0)<0)<<31>>31|0,o|0,((o|0)<0)<<31>>31|0)|0;o=I;if(!(o>>>0<0|(o|0)==0&j>>>0<2147483647)){l=0;return l|0}o=j+1|0;f[a+20>>2]=o;j=(o|0)/2|0;g=a+24|0;f[g>>2]=j;f[a+28>>2]=0-j;if(!(o&1))f[g>>2]=j+-1;l=sd(a+108|0,b)|0;return l|0}function ce(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=u;u=u+16|0;e=d+8|0;g=d+4|0;h=d;if(!c){i=0;u=d;return i|0}f[a>>2]=b;f[e>>2]=0;eg(e,b)|0;a:do if(!(f[e>>2]|0))j=8;else{b=0;while(1){eg(g,f[a>>2]|0)|0;k=dj(44)|0;f[k>>2]=0;f[k+4>>2]=0;f[k+8>>2]=0;f[k+12>>2]=0;n[k+16>>2]=$(1.0);l=k+20|0;f[l>>2]=0;f[l+4>>2]=0;f[l+8>>2]=0;f[l+12>>2]=0;n[k+36>>2]=$(1.0);f[k+40>>2]=f[g>>2];if(!(gc(a,k)|0))break;f[h>>2]=k;Ig(c,h)|0;l=f[h>>2]|0;f[h>>2]=0;if(l|0){Df(l);fn(l)}b=b+1|0;if(b>>>0>=(f[e>>2]|0)>>>0){j=8;break a}}Df(k);fn(k);m=0}while(0);if((j|0)==8)m=gc(a,c)|0;i=m;u=d;return i|0}function de(a,c,d,e,g){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;do if(!(Dl(a,f[c+8>>2]|0,g)|0)){h=a+8|0;if(!(Dl(a,f[c>>2]|0,g)|0)){i=f[h>>2]|0;Ua[f[(f[i>>2]|0)+24>>2]&3](i,c,d,e,g);break}i=c+32|0;if((f[c+16>>2]|0)!=(d|0)?(j=c+20|0,(f[j>>2]|0)!=(d|0)):0){f[i>>2]=e;k=c+44|0;if((f[k>>2]|0)==4)break;l=c+52|0;b[l>>0]=0;m=c+53|0;b[m>>0]=0;n=f[h>>2]|0;Va[f[(f[n>>2]|0)+20>>2]&3](n,c,d,d,1,g);if(b[m>>0]|0)if(!(b[l>>0]|0)){o=3;p=11}else q=3;else{o=4;p=11}if((p|0)==11){f[j>>2]=d;j=c+40|0;f[j>>2]=(f[j>>2]|0)+1;if((f[c+36>>2]|0)==1?(f[c+24>>2]|0)==2:0){b[c+54>>0]=1;q=o}else q=o}f[k>>2]=q;break}if((e|0)==1)f[i>>2]=1}else Wi(0,c,d,e);while(0);return}function ee(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0;if((d|0)>=8192)return Da(a|0,c|0,d|0)|0;e=a|0;g=a+d|0;if((a&3)==(c&3)){while(a&3){if(!d)return e|0;b[a>>0]=b[c>>0]|0;a=a+1|0;c=c+1|0;d=d-1|0}h=g&-4|0;d=h-64|0;while((a|0)<=(d|0)){f[a>>2]=f[c>>2];f[a+4>>2]=f[c+4>>2];f[a+8>>2]=f[c+8>>2];f[a+12>>2]=f[c+12>>2];f[a+16>>2]=f[c+16>>2];f[a+20>>2]=f[c+20>>2];f[a+24>>2]=f[c+24>>2];f[a+28>>2]=f[c+28>>2];f[a+32>>2]=f[c+32>>2];f[a+36>>2]=f[c+36>>2];f[a+40>>2]=f[c+40>>2];f[a+44>>2]=f[c+44>>2];f[a+48>>2]=f[c+48>>2];f[a+52>>2]=f[c+52>>2];f[a+56>>2]=f[c+56>>2];f[a+60>>2]=f[c+60>>2];a=a+64|0;c=c+64|0}while((a|0)<(h|0)){f[a>>2]=f[c>>2];a=a+4|0;c=c+4|0}}else{h=g-4|0;while((a|0)<(h|0)){b[a>>0]=b[c>>0]|0;b[a+1>>0]=b[c+1>>0]|0;b[a+2>>0]=b[c+2>>0]|0;b[a+3>>0]=b[c+3>>0]|0;a=a+4|0;c=c+4|0}}while((a|0)<(g|0)){b[a>>0]=b[c>>0]|0;a=a+1|0;c=c+1|0}return e|0}function fe(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;d=f[c+88>>2]|0;if(!d){e=0;return e|0}if((f[d>>2]|0)!=1){e=0;return e|0}g=d+8|0;d=f[g>>2]|0;f[a+4>>2]=h[d>>0]|h[d+1>>0]<<8|h[d+2>>0]<<16|h[d+3>>0]<<24;i=a+8|0;j=c+24|0;c=b[j>>0]|0;k=c<<24>>24;l=a+12|0;m=f[l>>2]|0;n=f[i>>2]|0;o=m-n>>2;p=n;n=m;if(k>>>0<=o>>>0)if(k>>>0>>0?(m=p+(k<<2)|0,(n|0)!=(m|0)):0){f[l>>2]=n+(~((n+-4-m|0)>>>2)<<2);q=c;r=d}else{q=c;r=d}else{jf(i,k-o|0);q=b[j>>0]|0;r=f[g>>2]|0}g=r+4|0;j=h[g>>0]|h[g+1>>0]<<8|h[g+2>>0]<<16|h[g+3>>0]<<24;if(q<<24>>24>0){g=f[i>>2]|0;i=q<<24>>24;q=4;o=0;k=j;while(1){f[g+(o<<2)>>2]=k;q=q+4|0;o=o+1|0;d=r+q|0;c=h[d>>0]|h[d+1>>0]<<8|h[d+2>>0]<<16|h[d+3>>0]<<24;if((o|0)>=(i|0)){s=c;break}else k=c}}else s=j;f[a+20>>2]=s;e=1;return e|0}function ge(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;e=u;u=u+16|0;g=e;h=a+4|0;f[h>>2]=0;if(!c){u=e;return}i=a+8|0;j=f[i>>2]|0;k=j<<5;if(k>>>0>>0){f[g>>2]=0;l=g+4|0;f[l>>2]=0;m=g+8|0;f[m>>2]=0;if((c|0)<0)ym(a);n=j<<6;j=c+31&-32;bf(g,k>>>0<1073741823?(n>>>0>>0?j:n):2147483647);n=f[a>>2]|0;f[a>>2]=f[g>>2];f[g>>2]=n;g=f[h>>2]|0;f[h>>2]=c;f[l>>2]=g;g=f[i>>2]|0;f[i>>2]=f[m>>2];f[m>>2]=g;if(n|0)fn(n);o=a}else{f[h>>2]=c;o=a}a=f[o>>2]|0;o=a;h=a;a=c>>>5;n=a<<2;if(!(b[d>>0]|0)){Vf(h|0,0,n|0)|0;d=c-(a<<5)|0;g=o+(a<<2)|0;if(!d){u=e;return}f[g>>2]=f[g>>2]&~(-1>>>(32-d|0));u=e;return}else{Vf(h|0,-1,n|0)|0;n=c-(a<<5)|0;c=o+(a<<2)|0;if(!n){u=e;return}f[c>>2]=f[c>>2]|-1>>>(32-n|0);u=e;return}}function he(a){a=a|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;c=f[a+32>>2]|0;d=c+8|0;e=f[d+4>>2]|0;g=c+16|0;h=g;i=f[h>>2]|0;j=f[h+4>>2]|0;if(!((e|0)>(j|0)|((e|0)==(j|0)?(f[d>>2]|0)>>>0>i>>>0:0))){k=0;return k|0}d=b[(f[c>>2]|0)+i>>0]|0;c=Tj(i|0,j|0,1,0)|0;j=g;f[j>>2]=c;f[j+4>>2]=I;j=a+48|0;c=f[j>>2]|0;f[j>>2]=0;if(c|0)Qa[f[(f[c>>2]|0)+4>>2]&127](c);switch(d<<24>>24){case 0:{d=dj(384)|0;qg(d);c=f[j>>2]|0;f[j>>2]=d;if(!c)l=d;else{Qa[f[(f[c>>2]|0)+4>>2]&127](c);m=9}break}case 2:{c=dj(440)|0;lf(c);d=f[j>>2]|0;f[j>>2]=c;if(!d)l=c;else{Qa[f[(f[d>>2]|0)+4>>2]&127](d);m=9}break}default:m=9}if((m|0)==9){m=f[j>>2]|0;if(!m){k=0;return k|0}else l=m}k=Ma[f[(f[l>>2]|0)+8>>2]&127](l,a)|0;return k|0}function ie(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0;e=u;u=u+16|0;g=e+12|0;h=e+8|0;i=e;f[i>>2]=f[b>>2];f[g>>2]=f[i>>2];i=_b(a,g,h,e+4|0,c)|0;c=f[i>>2]|0;if(c|0){j=c;u=e;return j|0}c=dj(40)|0;Sf(c+16|0,d);Sf(c+28|0,d+12|0);d=f[h>>2]|0;f[c>>2]=0;f[c+4>>2]=0;f[c+8>>2]=d;f[i>>2]=c;d=f[f[a>>2]>>2]|0;if(!d)k=c;else{f[a>>2]=d;k=f[i>>2]|0}Gc(f[a+4>>2]|0,k);k=a+8|0;f[k>>2]=(f[k>>2]|0)+1;j=c;u=e;return j|0}function je(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;c=b+8|0;d=f[c>>2]|0;e=f[c+4>>2]|0;c=b+16|0;g=c;i=f[g>>2]|0;j=f[g+4>>2]|0;g=Tj(i|0,j|0,4,0)|0;k=I;if((e|0)<(k|0)|(e|0)==(k|0)&d>>>0>>0){l=0;return l|0}m=f[b>>2]|0;b=m+i|0;n=h[b>>0]|h[b+1>>0]<<8|h[b+2>>0]<<16|h[b+3>>0]<<24;b=c;f[b>>2]=g;f[b+4>>2]=k;k=Tj(i|0,j|0,8,0)|0;j=I;if((e|0)<(j|0)|(e|0)==(j|0)&d>>>0>>0){l=0;return l|0}d=m+g|0;g=h[d>>0]|h[d+1>>0]<<8|h[d+2>>0]<<16|h[d+3>>0]<<24;d=c;f[d>>2]=k;f[d+4>>2]=j;if((n|0)>(g|0)){l=0;return l|0}f[a+12>>2]=n;f[a+16>>2]=g;j=Vj(g|0,((g|0)<0)<<31>>31|0,n|0,((n|0)<0)<<31>>31|0)|0;n=I;if(!(n>>>0<0|(n|0)==0&j>>>0<2147483647)){l=0;return l|0}n=j+1|0;f[a+20>>2]=n;j=(n|0)/2|0;g=a+24|0;f[g>>2]=j;f[a+28>>2]=0-j;if(n&1|0){l=1;return l|0}f[g>>2]=j+-1;l=1;return l|0}function ke(a,c,d,e){a=a|0;c=c|0;d=d|0;e=e|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;g=dj(32)|0;f[a>>2]=g;f[a+4>>2]=c+8;c=a+8|0;b[c>>0]=0;h=g+8|0;f[h>>2]=f[e>>2];f[h+4>>2]=f[e+4>>2];f[h+8>>2]=f[e+8>>2];f[e>>2]=0;f[e+4>>2]=0;f[e+8>>2]=0;h=g+20|0;i=e+12|0;f[h>>2]=0;f[g+24>>2]=0;f[g+28>>2]=0;g=e+16|0;e=f[g>>2]|0;j=f[i>>2]|0;k=e-j|0;if(!k){l=j;m=e;n=0;o=l;p=m-o|0;ee(n|0,l|0,p|0)|0;b[c>>0]=1;q=f[a>>2]|0;r=q+4|0;f[r>>2]=d;f[q>>2]=0;return}kf(h,k);l=f[i>>2]|0;m=f[g>>2]|0;n=f[h>>2]|0;o=l;p=m-o|0;ee(n|0,l|0,p|0)|0;b[c>>0]=1;q=f[a>>2]|0;r=q+4|0;f[r>>2]=d;f[q>>2]=0;return}function le(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;if(c>>>0>4294967279)ym(a);d=a+11|0;e=b[d>>0]|0;g=e<<24>>24<0;if(g){h=f[a+4>>2]|0;i=(f[a+8>>2]&2147483647)+-1|0}else{h=e&255;i=10}j=h>>>0>c>>>0?h:c;c=j>>>0<11;k=c?10:(j+16&-16)+-1|0;do if((k|0)!=(i|0)){do if(c){j=f[a>>2]|0;if(g){l=a;m=0;n=j;o=13}else{Qk(a,j,(e&255)+1|0)|0;fn(j);o=15}}else{j=dj(k+1|0)|0;if(g){l=j;m=1;n=f[a>>2]|0;o=13;break}else{Qk(j,a,(e&255)+1|0)|0;p=j;o=14;break}}while(0);if((o|0)==13){Qk(l,n,(f[a+4>>2]|0)+1|0)|0;fn(n);if(m){p=l;o=14}else o=15}if((o|0)==14){f[a+8>>2]=k+1|-2147483648;f[a+4>>2]=h;f[a>>2]=p;break}else if((o|0)==15){b[d>>0]=h;break}}while(0);return}function me(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;e=a+12|0;a:do if((f[e>>2]|0)!=(c|0)){g=f[a>>2]|0;h=a+4|0;i=f[h>>2]|0;if((i|0)!=(g|0)){j=i;while(1){i=j+-12|0;f[h>>2]=i;if((b[i+11>>0]|0)<0){fn(f[i>>2]|0);k=f[h>>2]|0}else k=i;if((k|0)==(g|0))break;else j=k}}f[e>>2]=c;j=f[c+8>>2]|0;if(j|0){i=a+8|0;l=g;m=j;while(1){j=m+8|0;if((l|0)==(f[i>>2]|0))Kd(a,j);else{Sf(l,j);f[h>>2]=(f[h>>2]|0)+12}j=f[m>>2]|0;if(!j)break a;l=f[h>>2]|0;m=j}}}while(0);if((d|0)<0){n=0;return n|0}c=f[a>>2]|0;if((((f[a+4>>2]|0)-c|0)/12|0)>>>0<=d>>>0){n=0;return n|0}a=c+(d*12|0)|0;if((b[a+11>>0]|0)<0){n=f[a>>2]|0;return n|0}else{n=a;return n|0}return 0}function ne(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;c=u;u=u+16|0;d=c;e=f[(f[a>>2]|0)+8>>2]|0;g=a+8|0;h=a+12|0;i=(f[h>>2]|0)-(f[g>>2]|0)>>2;j=f[b>>2]|0;f[b>>2]=0;f[d>>2]=j;Sa[e&7](a,i,d);i=f[d>>2]|0;f[d>>2]=0;if(!i){k=f[h>>2]|0;l=f[g>>2]|0;m=k-l|0;n=m>>2;o=n+-1|0;u=c;return o|0}d=i+88|0;a=f[d>>2]|0;f[d>>2]=0;if(a|0){d=f[a+8>>2]|0;if(d|0){e=a+12|0;if((f[e>>2]|0)!=(d|0))f[e>>2]=d;fn(d)}fn(a)}a=f[i+68>>2]|0;if(a|0){d=i+72|0;e=f[d>>2]|0;if((e|0)!=(a|0))f[d>>2]=e+(~((e+-4-a|0)>>>2)<<2);fn(a)}a=i+64|0;e=f[a>>2]|0;f[a>>2]=0;if(e|0){a=f[e>>2]|0;if(a|0){d=e+4|0;if((f[d>>2]|0)!=(a|0))f[d>>2]=a;fn(a)}fn(e)}fn(i);k=f[h>>2]|0;l=f[g>>2]|0;m=k-l|0;n=m>>2;o=n+-1|0;u=c;return o|0}function oe(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0;c=a+8|0;d=f[c>>2]|0;e=a+4|0;g=f[e>>2]|0;if(d-g>>3>>>0>=b>>>0){h=g;i=b;do{j=h;f[j>>2]=0;f[j+4>>2]=0;h=(f[e>>2]|0)+8|0;f[e>>2]=h;i=i+-1|0}while((i|0)!=0);return}i=f[a>>2]|0;h=g-i>>3;g=h+b|0;if(g>>>0>536870911)ym(a);j=d-i|0;i=j>>2;d=j>>3>>>0<268435455?(i>>>0>>0?g:i):536870911;do if(d)if(d>>>0>536870911){i=ra(8)|0;$k(i,9793);f[i>>2]=3708;va(i|0,856,80)}else{k=dj(d<<3)|0;break}else k=0;while(0);i=k+(h<<3)|0;h=k+(d<<3)|0;d=i;k=b;b=i;do{g=d;f[g>>2]=0;f[g+4>>2]=0;d=b+8|0;b=d;k=k+-1|0}while((k|0)!=0);k=f[a>>2]|0;d=(f[e>>2]|0)-k|0;g=i+(0-(d>>3)<<3)|0;if((d|0)>0)ee(g|0,k|0,d|0)|0;f[a>>2]=g;f[e>>2]=b;f[c>>2]=h;if(!k)return;fn(k);return}function pe(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;d=a+4|0;e=f[d>>2]|0;g=f[a>>2]|0;h=e-g>>2;i=g;g=e;if(h>>>0>=1048576){if((h|0)!=1048576?(e=i+4194304|0,(g|0)!=(e|0)):0)f[d>>2]=g+(~((g+-4-e|0)>>>2)<<2)}else jf(a,1048576-h|0);h=a+12|0;e=a+16|0;g=f[e>>2]|0;d=f[h>>2]|0;i=g-d>>3;j=d;d=g;if(i>>>0>=c>>>0){if(i>>>0>c>>>0?(g=j+(c<<3)|0,(d|0)!=(g|0)):0)f[e>>2]=d+(~((d+-8-g|0)>>>3)<<3);if(!c){k=0;return k|0}}else oe(h,c-i|0);i=f[h>>2]|0;h=0;g=0;do{d=b+(g<<2)|0;f[i+(g<<3)>>2]=f[d>>2];f[i+(g<<3)+4>>2]=h;e=h;h=(f[d>>2]|0)+h|0;if(h>>>0>1048576){k=0;l=19;break}if(e>>>0>>0){d=f[a>>2]|0;j=e;do{f[d+(j<<2)>>2]=g;j=j+1|0}while((j|0)!=(h|0))}g=g+1|0}while(g>>>0>>0);if((l|0)==19)return k|0;k=(h|0)==1048576;return k|0}function qe(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;d=a+4|0;e=f[d>>2]|0;g=f[a>>2]|0;h=e-g>>2;i=g;g=e;if(h>>>0>=524288){if((h|0)!=524288?(e=i+2097152|0,(g|0)!=(e|0)):0)f[d>>2]=g+(~((g+-4-e|0)>>>2)<<2)}else jf(a,524288-h|0);h=a+12|0;e=a+16|0;g=f[e>>2]|0;d=f[h>>2]|0;i=g-d>>3;j=d;d=g;if(i>>>0>=c>>>0){if(i>>>0>c>>>0?(g=j+(c<<3)|0,(d|0)!=(g|0)):0)f[e>>2]=d+(~((d+-8-g|0)>>>3)<<3);if(!c){k=0;return k|0}}else oe(h,c-i|0);i=f[h>>2]|0;h=0;g=0;do{d=b+(g<<2)|0;f[i+(g<<3)>>2]=f[d>>2];f[i+(g<<3)+4>>2]=h;e=h;h=(f[d>>2]|0)+h|0;if(h>>>0>524288){k=0;l=19;break}if(e>>>0>>0){d=f[a>>2]|0;j=e;do{f[d+(j<<2)>>2]=g;j=j+1|0}while((j|0)!=(h|0))}g=g+1|0}while(g>>>0>>0);if((l|0)==19)return k|0;k=(h|0)==524288;return k|0}function re(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;d=a+4|0;e=f[d>>2]|0;g=f[a>>2]|0;h=e-g>>2;i=g;g=e;if(h>>>0>=262144){if((h|0)!=262144?(e=i+1048576|0,(g|0)!=(e|0)):0)f[d>>2]=g+(~((g+-4-e|0)>>>2)<<2)}else jf(a,262144-h|0);h=a+12|0;e=a+16|0;g=f[e>>2]|0;d=f[h>>2]|0;i=g-d>>3;j=d;d=g;if(i>>>0>=c>>>0){if(i>>>0>c>>>0?(g=j+(c<<3)|0,(d|0)!=(g|0)):0)f[e>>2]=d+(~((d+-8-g|0)>>>3)<<3);if(!c){k=0;return k|0}}else oe(h,c-i|0);i=f[h>>2]|0;h=0;g=0;do{d=b+(g<<2)|0;f[i+(g<<3)>>2]=f[d>>2];f[i+(g<<3)+4>>2]=h;e=h;h=(f[d>>2]|0)+h|0;if(h>>>0>262144){k=0;l=19;break}if(e>>>0>>0){d=f[a>>2]|0;j=e;do{f[d+(j<<2)>>2]=g;j=j+1|0}while((j|0)!=(h|0))}g=g+1|0}while(g>>>0>>0);if((l|0)==19)return k|0;k=(h|0)==262144;return k|0}function se(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0;d=u;u=u+16|0;e=d;if(!c){g=0;u=d;return g|0}h=a+84|0;i=f[h>>2]|0;j=a+88|0;k=f[j>>2]|0;if((k|0)!=(i|0))f[j>>2]=k+(~((k+-4-i|0)>>>2)<<2);f[h>>2]=0;f[j>>2]=0;f[a+92>>2]=0;if(i|0)fn(i);i=a+72|0;j=f[i>>2]|0;h=a+76|0;if((f[h>>2]|0)!=(j|0))f[h>>2]=j;f[i>>2]=0;f[h>>2]=0;f[a+80>>2]=0;if(j|0)fn(j);j=c+4|0;h=(f[j>>2]|0)-(f[c>>2]|0)>>2;b[e>>0]=0;ge(a,h,e);h=c+24|0;i=c+28|0;k=(f[i>>2]|0)-(f[h>>2]|0)>>2;b[e>>0]=0;ge(a+12|0,k,e);pd(a+28|0,(f[j>>2]|0)-(f[c>>2]|0)>>2,2684);ug(a+52|0,(f[i>>2]|0)-(f[h>>2]|0)>>2);ug(a+40|0,(f[i>>2]|0)-(f[h>>2]|0)>>2);f[a+64>>2]=c;b[a+24>>0]=1;g=1;u=d;return g|0}function te(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;d=a+4|0;e=f[d>>2]|0;g=f[a>>2]|0;h=e-g>>2;i=g;g=e;if(h>>>0>=65536){if((h|0)!=65536?(e=i+262144|0,(g|0)!=(e|0)):0)f[d>>2]=g+(~((g+-4-e|0)>>>2)<<2)}else jf(a,65536-h|0);h=a+12|0;e=a+16|0;g=f[e>>2]|0;d=f[h>>2]|0;i=g-d>>3;j=d;d=g;if(i>>>0>=c>>>0){if(i>>>0>c>>>0?(g=j+(c<<3)|0,(d|0)!=(g|0)):0)f[e>>2]=d+(~((d+-8-g|0)>>>3)<<3);if(!c){k=0;return k|0}}else oe(h,c-i|0);i=f[h>>2]|0;h=0;g=0;do{d=b+(g<<2)|0;f[i+(g<<3)>>2]=f[d>>2];f[i+(g<<3)+4>>2]=h;e=h;h=(f[d>>2]|0)+h|0;if(h>>>0>65536){k=0;l=19;break}if(e>>>0>>0){d=f[a>>2]|0;j=e;do{f[d+(j<<2)>>2]=g;j=j+1|0}while((j|0)!=(h|0))}g=g+1|0}while(g>>>0>>0);if((l|0)==19)return k|0;k=(h|0)==65536;return k|0}function ue(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;d=a+4|0;e=f[d>>2]|0;g=f[a>>2]|0;h=e-g>>2;i=g;g=e;if(h>>>0>=32768){if((h|0)!=32768?(e=i+131072|0,(g|0)!=(e|0)):0)f[d>>2]=g+(~((g+-4-e|0)>>>2)<<2)}else jf(a,32768-h|0);h=a+12|0;e=a+16|0;g=f[e>>2]|0;d=f[h>>2]|0;i=g-d>>3;j=d;d=g;if(i>>>0>=c>>>0){if(i>>>0>c>>>0?(g=j+(c<<3)|0,(d|0)!=(g|0)):0)f[e>>2]=d+(~((d+-8-g|0)>>>3)<<3);if(!c){k=0;return k|0}}else oe(h,c-i|0);i=f[h>>2]|0;h=0;g=0;do{d=b+(g<<2)|0;f[i+(g<<3)>>2]=f[d>>2];f[i+(g<<3)+4>>2]=h;e=h;h=(f[d>>2]|0)+h|0;if(h>>>0>32768){k=0;l=19;break}if(e>>>0>>0){d=f[a>>2]|0;j=e;do{f[d+(j<<2)>>2]=g;j=j+1|0}while((j|0)!=(h|0))}g=g+1|0}while(g>>>0>>0);if((l|0)==19)return k|0;k=(h|0)==32768;return k|0}function ve(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;d=a+4|0;e=f[d>>2]|0;g=f[a>>2]|0;h=e-g>>2;i=g;g=e;if(h>>>0>=8192){if((h|0)!=8192?(e=i+32768|0,(g|0)!=(e|0)):0)f[d>>2]=g+(~((g+-4-e|0)>>>2)<<2)}else jf(a,8192-h|0);h=a+12|0;e=a+16|0;g=f[e>>2]|0;d=f[h>>2]|0;i=g-d>>3;j=d;d=g;if(i>>>0>=c>>>0){if(i>>>0>c>>>0?(g=j+(c<<3)|0,(d|0)!=(g|0)):0)f[e>>2]=d+(~((d+-8-g|0)>>>3)<<3);if(!c){k=0;return k|0}}else oe(h,c-i|0);i=f[h>>2]|0;h=0;g=0;do{d=b+(g<<2)|0;f[i+(g<<3)>>2]=f[d>>2];f[i+(g<<3)+4>>2]=h;e=h;h=(f[d>>2]|0)+h|0;if(h>>>0>8192){k=0;l=19;break}if(e>>>0>>0){d=f[a>>2]|0;j=e;do{f[d+(j<<2)>>2]=g;j=j+1|0}while((j|0)!=(h|0))}g=g+1|0}while(g>>>0>>0);if((l|0)==19)return k|0;k=(h|0)==8192;return k|0}function we(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;d=a+4|0;e=f[d>>2]|0;g=f[a>>2]|0;h=e-g>>2;i=g;g=e;if(h>>>0>=4096){if((h|0)!=4096?(e=i+16384|0,(g|0)!=(e|0)):0)f[d>>2]=g+(~((g+-4-e|0)>>>2)<<2)}else jf(a,4096-h|0);h=a+12|0;e=a+16|0;g=f[e>>2]|0;d=f[h>>2]|0;i=g-d>>3;j=d;d=g;if(i>>>0>=c>>>0){if(i>>>0>c>>>0?(g=j+(c<<3)|0,(d|0)!=(g|0)):0)f[e>>2]=d+(~((d+-8-g|0)>>>3)<<3);if(!c){k=0;return k|0}}else oe(h,c-i|0);i=f[h>>2]|0;h=0;g=0;do{d=b+(g<<2)|0;f[i+(g<<3)>>2]=f[d>>2];f[i+(g<<3)+4>>2]=h;e=h;h=(f[d>>2]|0)+h|0;if(h>>>0>4096){k=0;l=19;break}if(e>>>0>>0){d=f[a>>2]|0;j=e;do{f[d+(j<<2)>>2]=g;j=j+1|0}while((j|0)!=(h|0))}g=g+1|0}while(g>>>0>>0);if((l|0)==19)return k|0;k=(h|0)==4096;return k|0}function xe(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=u;u=u+224|0;g=e+120|0;h=e+80|0;i=e;j=e+136|0;k=h;l=k+40|0;do{f[k>>2]=0;k=k+4|0}while((k|0)<(l|0));f[g>>2]=f[d>>2];if((eb(0,c,g,i,h)|0)<0)m=-1;else{if((f[a+76>>2]|0)>-1)n=mn(a)|0;else n=0;d=f[a>>2]|0;k=d&32;if((b[a+74>>0]|0)<1)f[a>>2]=d&-33;d=a+48|0;if(!(f[d>>2]|0)){l=a+44|0;o=f[l>>2]|0;f[l>>2]=j;p=a+28|0;f[p>>2]=j;q=a+20|0;f[q>>2]=j;f[d>>2]=80;r=a+16|0;f[r>>2]=j+80;j=eb(a,c,g,i,h)|0;if(!o)s=j;else{Na[f[a+36>>2]&31](a,0,0)|0;t=(f[q>>2]|0)==0?-1:j;f[l>>2]=o;f[d>>2]=0;f[r>>2]=0;f[p>>2]=0;f[q>>2]=0;s=t}}else s=eb(a,c,g,i,h)|0;h=f[a>>2]|0;f[a>>2]=h|k;if(n|0)ln(a);m=(h&32|0)==0?s:-1}u=e;return m|0}function ye(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0;c=a+4|0;d=f[c>>2]|0;e=f[a>>2]|0;g=d-e>>2;h=d;if(g>>>0>>0){nd(a,b-g|0);return}if(g>>>0<=b>>>0)return;g=e+(b<<2)|0;if((h|0)==(g|0))return;else i=h;do{h=i+-4|0;f[c>>2]=h;b=f[h>>2]|0;f[h>>2]=0;if(b|0){h=b+88|0;e=f[h>>2]|0;f[h>>2]=0;if(e|0){h=f[e+8>>2]|0;if(h|0){a=e+12|0;if((f[a>>2]|0)!=(h|0))f[a>>2]=h;fn(h)}fn(e)}e=f[b+68>>2]|0;if(e|0){h=b+72|0;a=f[h>>2]|0;if((a|0)!=(e|0))f[h>>2]=a+(~((a+-4-e|0)>>>2)<<2);fn(e)}e=b+64|0;a=f[e>>2]|0;f[e>>2]=0;if(a|0){e=f[a>>2]|0;if(e|0){h=a+4|0;if((f[h>>2]|0)!=(e|0))f[h>>2]=e;fn(e)}fn(a)}fn(b)}i=f[c>>2]|0}while((i|0)!=(g|0));return}function ze(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;e=(f[a>>2]|0)+1794895138|0;g=El(f[a+8>>2]|0,e)|0;h=El(f[a+12>>2]|0,e)|0;i=El(f[a+16>>2]|0,e)|0;a:do if((g>>>0>>2>>>0?(j=c-(g<<2)|0,h>>>0>>0&i>>>0>>0):0)?((i|h)&3|0)==0:0){j=h>>>2;k=i>>>2;l=0;m=g;while(1){n=m>>>1;o=l+n|0;p=o<<1;q=p+j|0;r=El(f[a+(q<<2)>>2]|0,e)|0;s=El(f[a+(q+1<<2)>>2]|0,e)|0;if(!(s>>>0>>0&r>>>0<(c-s|0)>>>0)){t=0;break a}if(b[a+(s+r)>>0]|0){t=0;break a}r=xh(d,a+s|0)|0;if(!r)break;s=(r|0)<0;if((m|0)==1){t=0;break a}else{l=s?l:o;m=s?n:m-n|0}}m=p+k|0;l=El(f[a+(m<<2)>>2]|0,e)|0;j=El(f[a+(m+1<<2)>>2]|0,e)|0;if(j>>>0>>0&l>>>0<(c-j|0)>>>0)t=(b[a+(j+l)>>0]|0)==0?a+j|0:0;else t=0}else t=0;while(0);return t|0}function Ae(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;d=a+8|0;e=f[d>>2]|0;g=a+4|0;h=f[g>>2]|0;i=h;if(e-h>>2>>>0>=b>>>0){j=i;k=b;while(1){f[j>>2]=f[c>>2];k=k+-1|0;if(!k)break;else j=j+4|0}f[g>>2]=i+(b<<2);return}i=f[a>>2]|0;j=h-i|0;h=j>>2;k=h+b|0;if(k>>>0>1073741823)ym(a);l=e-i|0;e=l>>1;m=l>>2>>>0<536870911?(e>>>0>>0?k:e):1073741823;do if(m)if(m>>>0>1073741823){e=ra(8)|0;$k(e,9793);f[e>>2]=3708;va(e|0,856,80)}else{n=dj(m<<2)|0;break}else n=0;while(0);e=n+(h<<2)|0;k=n+(m<<2)|0;m=e;n=b;while(1){f[m>>2]=f[c>>2];n=n+-1|0;if(!n)break;else m=m+4|0}m=e+(0-h<<2)|0;if((j|0)>0)ee(m|0,i|0,j|0)|0;f[a>>2]=m;f[g>>2]=e+(b<<2);f[d>>2]=k;if(!i)return;fn(i);return}function Be(a,c,e,g){a=a|0;c=c|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h=u;u=u+64|0;i=h;j=f[a>>2]|0;k=a+(f[j+-8>>2]|0)|0;l=f[j+-4>>2]|0;f[i>>2]=e;f[i+4>>2]=a;f[i+8>>2]=c;f[i+12>>2]=g;g=i+16|0;c=i+20|0;a=i+24|0;j=i+28|0;m=i+32|0;n=i+40|0;o=g;p=o+36|0;do{f[o>>2]=0;o=o+4|0}while((o|0)<(p|0));d[g+36>>1]=0;b[g+38>>0]=0;a:do if(Dl(l,e,0)|0){f[i+48>>2]=1;Va[f[(f[l>>2]|0)+20>>2]&3](l,i,k,k,1,0);q=(f[a>>2]|0)==1?k:0}else{Ua[f[(f[l>>2]|0)+24>>2]&3](l,i,k,1,0);switch(f[i+36>>2]|0){case 0:{q=(f[n>>2]|0)==1&(f[j>>2]|0)==1&(f[m>>2]|0)==1?f[c>>2]|0:0;break a;break}case 1:break;default:{q=0;break a}}if((f[a>>2]|0)!=1?!((f[n>>2]|0)==0&(f[j>>2]|0)==1&(f[m>>2]|0)==1):0){q=0;break}q=f[g>>2]|0}while(0);u=h;return q|0}function Ce(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=Ja,q=0;d=u;u=u+32|0;e=d+16|0;g=d;h=a+8|0;i=b[(f[h>>2]|0)+24>>0]<<2;j=f[a+16>>2]|0;if(!(f[j+80>>2]|0))k=0;else k=(f[f[j>>2]>>2]|0)+(f[j+48>>2]|0)|0;f[g>>2]=-1;f[g+4>>2]=-1;f[g+8>>2]=-1;f[g+12>>2]=-1;j=f[a+24>>2]|0;if((j+-2|0)>>>0>28){l=0;u=d;return l|0}f[g>>2]=j;a=1<>2]=a+-1;j=a+-2|0;a=g+8|0;f[a>>2]=j;f[g+12>>2]=(j|0)/2|0;if(!c){l=1;u=d;return l|0}m=j;j=0;n=0;o=0;while(1){p=$($(1.0)/$(m|0));Cd(g,$($(f[k+(o<<2)>>2]|0)*p),$($(f[k+((o|1)<<2)>>2]|0)*p),e);ee((f[f[(f[h>>2]|0)+64>>2]>>2]|0)+n|0,e|0,i|0)|0;q=j+1|0;if((q|0)==(c|0)){l=1;break}m=f[a>>2]|0;j=q;n=n+i|0;o=o+2|0}u=d;return l|0}function De(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0;e=Rb(a,c)|0;if(!e){g=0;return g|0}c=f[e+20>>2]|0;if(((f[e+24>>2]|0)-c|0)!=8){g=0;return g|0}e=c;b[s>>0]=b[e>>0];b[s+1>>0]=b[e+1>>0];b[s+2>>0]=b[e+2>>0];b[s+3>>0]=b[e+3>>0];b[s+4>>0]=b[e+4>>0];b[s+5>>0]=b[e+5>>0];b[s+6>>0]=b[e+6>>0];b[s+7>>0]=b[e+7>>0];p[s>>3]=+p[s>>3];b[d>>0]=b[s>>0];b[d+1>>0]=b[s+1>>0];b[d+2>>0]=b[s+2>>0];b[d+3>>0]=b[s+3>>0];b[d+4>>0]=b[s+4>>0];b[d+5>>0]=b[s+5>>0];b[d+6>>0]=b[s+6>>0];b[d+7>>0]=b[s+7>>0];g=1;return g|0}function Ee(a){a=a|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;c=a+12|0;d=f[a>>2]|0;e=a+8|0;g=f[e>>2]|0;h=(g|0)==-1;if(!(b[c>>0]|0)){do if((!h?(i=(((g>>>0)%3|0|0)==0?2:-1)+g|0,(i|0)!=-1):0)?(j=f[(f[d+12>>2]|0)+(i<<2)>>2]|0,(j|0)!=-1):0)if(!((j>>>0)%3|0)){k=j+2|0;break}else{k=j+-1|0;break}else k=-1;while(0);f[e>>2]=k;return}k=g+1|0;if((!h?(h=((k>>>0)%3|0|0)==0?g+-2|0:k,(h|0)!=-1):0)?(k=f[(f[d+12>>2]|0)+(h<<2)>>2]|0,h=k+1|0,(k|0)!=-1):0){g=((h>>>0)%3|0|0)==0?k+-2|0:h;f[e>>2]=g;if((g|0)!=-1){if((g|0)!=(f[a+4>>2]|0))return;f[e>>2]=-1;return}}else f[e>>2]=-1;g=f[a+4>>2]|0;do if(((g|0)!=-1?(a=(((g>>>0)%3|0|0)==0?2:-1)+g|0,(a|0)!=-1):0)?(h=f[(f[d+12>>2]|0)+(a<<2)>>2]|0,(h|0)!=-1):0)if(!((h>>>0)%3|0)){l=h+2|0;break}else{l=h+-1|0;break}else l=-1;while(0);f[e>>2]=l;b[c>>0]=0;return}function Fe(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;c=a+8|0;d=f[c>>2]|0;e=a+4|0;g=f[e>>2]|0;h=g;if(d-g>>2>>>0>=b>>>0){i=h;j=b;while(1){f[i>>2]=1;j=j+-1|0;if(!j)break;else i=i+4|0}f[e>>2]=h+(b<<2);return}h=f[a>>2]|0;i=g-h|0;g=i>>2;j=g+b|0;if(j>>>0>1073741823)ym(a);k=d-h|0;d=k>>1;l=k>>2>>>0<536870911?(d>>>0>>0?j:d):1073741823;do if(l)if(l>>>0>1073741823){d=ra(8)|0;$k(d,9793);f[d>>2]=3708;va(d|0,856,80)}else{m=dj(l<<2)|0;break}else m=0;while(0);d=m+(g<<2)|0;j=m+(l<<2)|0;l=d;m=b;while(1){f[l>>2]=1;m=m+-1|0;if(!m)break;else l=l+4|0}l=d+(0-g<<2)|0;if((i|0)>0)ee(l|0,h|0,i|0)|0;f[a>>2]=l;f[e>>2]=d+(b<<2);f[c>>2]=j;if(!h)return;fn(h);return}function Ge(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;d=f[a+4>>2]|0;if(!d){e=0;return e|0}a=b[c+11>>0]|0;g=a<<24>>24<0;h=g?f[c+4>>2]|0:a&255;a=g?f[c>>2]|0:c;c=d;while(1){d=c+16|0;g=b[d+11>>0]|0;i=g<<24>>24<0;j=i?f[c+20>>2]|0:g&255;g=j>>>0>>0;k=g?j:h;if((k|0)!=0?(l=mh(a,i?f[d>>2]|0:d,k)|0,(l|0)!=0):0)if((l|0)<0)m=7;else m=8;else if(h>>>0>>0)m=7;else m=8;if((m|0)==7){m=0;n=c}else if((m|0)==8){m=0;l=h>>>0>>0?h:j;if((l|0)!=0?(j=mh(i?f[d>>2]|0:d,a,l)|0,(j|0)!=0):0){if((j|0)>=0){e=1;m=14;break}}else m=10;if((m|0)==10?(m=0,!g):0){e=1;m=14;break}n=c+4|0}c=f[n>>2]|0;if(!c){e=0;m=14;break}}if((m|0)==14)return e|0;return 0}function He(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;d=u;u=u+32|0;e=d+12|0;g=d;f[e>>2]=0;f[e+4>>2]=0;f[e+8>>2]=0;h=gg(c)|0;if(h>>>0>4294967279)ym(e);if(h>>>0<11){b[e+11>>0]=h;if(!h)i=e;else{j=e;k=6}}else{l=h+16&-16;m=dj(l)|0;f[e>>2]=m;f[e+8>>2]=l|-2147483648;f[e+4>>2]=h;j=m;k=6}if((k|0)==6){ee(j|0,c|0,h|0)|0;i=j}b[i+h>>0]=0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;h=g+11|0;b[h>>0]=4;f[g>>2]=1701667182;b[g+4>>0]=0;i=f[a+4>>2]|0;if((i|0)!=0?(j=Xc(i,g,e)|0,(j|0)!=0):0)n=lh(a,f[j+40>>2]|0)|0;else n=-1;if((b[h>>0]|0)<0)fn(f[g>>2]|0);if((b[e+11>>0]|0)>=0){u=d;return n|0}fn(f[e>>2]|0);u=d;return n|0}function Ie(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var g=0,i=0;if((b|0)==-2)g=0;else{i=f[(f[(f[d+4>>2]|0)+8>>2]|0)+(c<<2)>>2]|0;do if((La[f[(f[d>>2]|0)+8>>2]&127](d)|0)==1){td(a,d,b,c,e,((h[d+36>>0]|0)<<8|(h[d+37>>0]|0))&65535);if(!(f[a>>2]|0)){f[a>>2]=0;break}else return}while(0);d=dj(44)|0;f[d>>2]=1208;f[d+4>>2]=i;i=d+8|0;f[i>>2]=f[e>>2];f[i+4>>2]=f[e+4>>2];f[i+8>>2]=f[e+8>>2];f[i+12>>2]=f[e+12>>2];f[i+16>>2]=f[e+16>>2];f[i+20>>2]=f[e+20>>2];Dg(d+32|0,e+24|0);f[d>>2]=1264;g=d}f[a>>2]=g;return}function Je(a){a=a|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c=a+8|0;d=f[c>>2]|0;e=a+16|0;if(b[d+84>>0]|0){g=f[e>>2]|0;return g|0}a=f[e>>2]|0;if(!a){g=f[e>>2]|0;return g|0}h=a+84|0;if(!(b[h>>0]|0)){g=f[e>>2]|0;return g|0}i=(f[d+72>>2]|0)-(f[d+68>>2]|0)>>2;b[h>>0]=0;h=a+68|0;j=a+72|0;a=f[j>>2]|0;k=f[h>>2]|0;l=a-k>>2;m=k;k=a;if(i>>>0<=l>>>0)if(i>>>0>>0?(a=m+(i<<2)|0,(k|0)!=(a|0)):0){f[j>>2]=k+(~((k+-4-a|0)>>>2)<<2);n=d}else n=d;else{Ae(h,i-l|0,1076);n=f[c>>2]|0}if(b[n+84>>0]|0){g=f[e>>2]|0;return g|0}c=f[n+68>>2]|0;l=c;i=(f[n+72>>2]|0)-c>>2;if(!i){g=f[e>>2]|0;return g|0}c=f[(f[e>>2]|0)+68>>2]|0;n=0;do{f[c+(n<<2)>>2]=f[l+(n<<2)>>2];n=n+1|0}while(n>>>0>>0);g=f[e>>2]|0;return g|0}function Ke(a,c){a=a|0;c=c|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=a+8|0;g=f[e>>2]|0;h=b[g+24>>0]|0;i=h<<24>>24;j=i<<1;k=cn(i>>>0>2147483647?-1:i<<1)|0;l=f[a+16>>2]|0;if(!(f[l+80>>2]|0))m=0;else m=(f[f[l>>2]>>2]|0)+(f[l+48>>2]|0)|0;if(!c){dn(k);return}if(h<<24>>24>0){h=0;l=0;a=0;while(1){n=0;o=a;while(1){d[k+(n<<1)>>1]=f[m+(o<<2)>>2];n=n+1|0;if((n|0)==(i|0))break;else o=o+1|0}ee((f[f[(f[e>>2]|0)+64>>2]>>2]|0)+l|0,k|0,j|0)|0;h=h+1|0;if((h|0)==(c|0))break;else{l=l+j|0;a=i+a|0}}dn(k);return}else{ee(f[f[g+64>>2]>>2]|0,k|0,j|0)|0;if((c|0)==1){dn(k);return}else{p=1;q=0}do{q=q+j|0;ee((f[f[(f[e>>2]|0)+64>>2]>>2]|0)+q|0,k|0,j|0)|0;p=p+1|0}while((p|0)!=(c|0));dn(k);return}}function Le(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;d=a+8|0;e=f[d>>2]|0;g=b[e+24>>0]|0;h=g<<24>>24;i=h<<2;j=cn(h>>>0>1073741823?-1:h<<2)|0;k=f[a+16>>2]|0;if(!(f[k+80>>2]|0))l=0;else l=(f[f[k>>2]>>2]|0)+(f[k+48>>2]|0)|0;if(!c){dn(j);return}if(g<<24>>24>0){g=0;k=0;a=0;while(1){m=0;n=a;while(1){f[j+(m<<2)>>2]=f[l+(n<<2)>>2];m=m+1|0;if((m|0)==(h|0))break;else n=n+1|0}ee((f[f[(f[d>>2]|0)+64>>2]>>2]|0)+k|0,j|0,i|0)|0;g=g+1|0;if((g|0)==(c|0))break;else{k=k+i|0;a=h+a|0}}dn(j);return}else{ee(f[f[e+64>>2]>>2]|0,j|0,i|0)|0;if((c|0)==1){dn(j);return}else{o=1;p=0}do{p=p+i|0;ee((f[f[(f[d>>2]|0)+64>>2]>>2]|0)+p|0,j|0,i|0)|0;o=o+1|0}while((o|0)!=(c|0));dn(j);return}}function Me(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0;d=u;u=u+32|0;e=d+16|0;g=d;switch(c<<24>>24){case 0:{c=dj(48)|0;Ul(c);f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;f[a+12>>2]=0;f[a+16>>2]=c;u=d;return}case 1:{c=dj(52)|0;Yk(c);f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;f[a+12>>2]=0;f[a+16>>2]=c;u=d;return}default:{c=dj(32)|0;f[g>>2]=c;f[g+8>>2]=-2147483616;f[g+4>>2]=28;h=c;i=8335;j=h+28|0;do{b[h>>0]=b[i>>0]|0;h=h+1|0;i=i+1|0}while((h|0)<(j|0));b[c+28>>0]=0;f[e>>2]=-1;c=e+4|0;Sf(c,g);f[a>>2]=f[e>>2];Sf(a+4|0,c);f[a+16>>2]=0;if((b[c+11>>0]|0)<0)fn(f[c>>2]|0);if((b[g+11>>0]|0)<0)fn(f[g>>2]|0);u=d;return}}}function Ne(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;c=b+8|0;d=f[c>>2]|0;e=f[c+4>>2]|0;c=b+16|0;g=c;i=f[g>>2]|0;j=f[g+4>>2]|0;g=Tj(i|0,j|0,4,0)|0;k=I;if((e|0)<(k|0)|(e|0)==(k|0)&d>>>0>>0){l=0;return l|0}m=(f[b>>2]|0)+i|0;n=h[m>>0]|h[m+1>>0]<<8|h[m+2>>0]<<16|h[m+3>>0]<<24;m=c;f[m>>2]=g;f[m+4>>2]=k;k=Tj(i|0,j|0,8,0)|0;j=I;if((e|0)<(j|0)|(e|0)==(j|0)&d>>>0>>0){l=0;return l|0}d=c;f[d>>2]=k;f[d+4>>2]=j;if(!(n&1)){l=0;return l|0}j=(_(n|0)|0)^31;if((j+-1|0)>>>0>28){l=0;return l|0}f[a+8>>2]=j+1;n=2<>2]=n+-1;j=n+-2|0;f[a+16>>2]=j;f[a+20>>2]=(j|0)/2|0;l=sd(a+88|0,b)|0;return l|0}function Oe(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0;c=a+4|0;d=f[c>>2]|0;e=f[a>>2]|0;g=(d-e|0)/144|0;h=d;if(g>>>0>>0){Fc(a,b-g|0);return}if(g>>>0<=b>>>0)return;g=e+(b*144|0)|0;if((h|0)==(g|0))return;else i=h;do{f[c>>2]=i+-144;h=f[i+-12>>2]|0;if(h|0){b=i+-8|0;e=f[b>>2]|0;if((e|0)!=(h|0))f[b>>2]=e+(~((e+-4-h|0)>>>2)<<2);fn(h)}h=f[i+-28>>2]|0;if(h|0){e=i+-24|0;b=f[e>>2]|0;if((b|0)!=(h|0))f[e>>2]=b+(~((b+-4-h|0)>>>2)<<2);fn(h)}h=f[i+-40>>2]|0;if(h|0){b=i+-36|0;e=f[b>>2]|0;if((e|0)!=(h|0))f[b>>2]=e+(~((e+-4-h|0)>>>2)<<2);fn(h)}vf(i+-140|0);i=f[c>>2]|0}while((i|0)!=(g|0));return}function Pe(a,b){a=a|0;b=b|0;var c=0,d=Ja,e=0,g=0;if((b|0)!=1)if(!(b+-1&b))c=b;else c=Za(b)|0;else c=2;b=f[a+4>>2]|0;if(c>>>0>b>>>0){Nb(a,c);return}if(c>>>0>=b>>>0)return;d=$((f[a+12>>2]|0)>>>0);e=~~$(W($(d/$(n[a+16>>2]))))>>>0;if(b>>>0>2&(b+-1&b|0)==0)g=1<<32-(_(e+-1|0)|0);else g=Za(e)|0;e=c>>>0>>0?g:c;if(e>>>0>=b>>>0)return;Nb(a,e);return}function Qe(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0;f[a>>2]=1088;b=a+60|0;c=f[b>>2]|0;f[b>>2]=0;if(c|0)Qa[f[(f[c>>2]|0)+4>>2]&127](c);c=f[a+48>>2]|0;if(c|0){b=a+52|0;d=f[b>>2]|0;if((d|0)!=(c|0))f[b>>2]=d+(~((d+-4-c|0)>>>2)<<2);fn(c)}c=a+36|0;d=f[c>>2]|0;if(d|0){b=a+40|0;e=f[b>>2]|0;if((e|0)==(d|0))g=d;else{h=e;do{e=h+-4|0;f[b>>2]=e;i=f[e>>2]|0;f[e>>2]=0;if(i|0)Qa[f[(f[i>>2]|0)+4>>2]&127](i);h=f[b>>2]|0}while((h|0)!=(d|0));g=f[c>>2]|0}fn(g)}f[a>>2]=984;g=f[a+16>>2]|0;if(g|0){c=a+20|0;d=f[c>>2]|0;if((d|0)!=(g|0))f[c>>2]=d+(~((d+-4-g|0)>>>2)<<2);fn(g)}g=f[a+4>>2]|0;if(!g)return;d=a+8|0;a=f[d>>2]|0;if((a|0)!=(g|0))f[d>>2]=a+(~((a+-4-g|0)>>>2)<<2);fn(g);return}function Re(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0;b=f[a>>2]|0;if(!b)return;c=a+4|0;d=f[c>>2]|0;if((d|0)==(b|0))e=b;else{g=d;do{d=g+-4|0;f[c>>2]=d;h=f[d>>2]|0;f[d>>2]=0;if(h|0){d=h+88|0;i=f[d>>2]|0;f[d>>2]=0;if(i|0){d=f[i+8>>2]|0;if(d|0){j=i+12|0;if((f[j>>2]|0)!=(d|0))f[j>>2]=d;fn(d)}fn(i)}i=f[h+68>>2]|0;if(i|0){d=h+72|0;j=f[d>>2]|0;if((j|0)!=(i|0))f[d>>2]=j+(~((j+-4-i|0)>>>2)<<2);fn(i)}i=h+64|0;j=f[i>>2]|0;f[i>>2]=0;if(j|0){i=f[j>>2]|0;if(i|0){d=j+4|0;if((f[d>>2]|0)!=(i|0))f[d>>2]=i;fn(i)}fn(j)}fn(h)}g=f[c>>2]|0}while((g|0)!=(b|0));e=f[a>>2]|0}fn(e);return}function Se(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0;b=f[a+4>>2]|0;c=a+8|0;d=f[c>>2]|0;if((d|0)!=(b|0)){e=d;do{d=e+-4|0;f[c>>2]=d;g=f[d>>2]|0;f[d>>2]=0;if(g|0){d=g+88|0;h=f[d>>2]|0;f[d>>2]=0;if(h|0){d=f[h+8>>2]|0;if(d|0){i=h+12|0;if((f[i>>2]|0)!=(d|0))f[i>>2]=d;fn(d)}fn(h)}h=f[g+68>>2]|0;if(h|0){d=g+72|0;i=f[d>>2]|0;if((i|0)!=(h|0))f[d>>2]=i+(~((i+-4-h|0)>>>2)<<2);fn(h)}h=g+64|0;i=f[h>>2]|0;f[h>>2]=0;if(i|0){h=f[i>>2]|0;if(h|0){d=i+4|0;if((f[d>>2]|0)!=(h|0))f[d>>2]=h;fn(h)}fn(i)}fn(g)}e=f[c>>2]|0}while((e|0)!=(b|0))}b=f[a>>2]|0;if(!b)return;fn(b);return}function Te(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;d=a+8|0;e=f[d>>2]|0;g=b[e+24>>0]|0;h=g<<24>>24;i=cn((h|0)>-1?h:-1)|0;j=f[a+16>>2]|0;if(!(f[j+80>>2]|0))k=0;else k=(f[f[j>>2]>>2]|0)+(f[j+48>>2]|0)|0;if(!c){dn(i);return}if(g<<24>>24>0){g=0;j=0;while(1){a=0;l=j;while(1){b[i+a>>0]=f[k+(l<<2)>>2];a=a+1|0;if((a|0)==(h|0))break;else l=l+1|0}ee((f[f[(f[d>>2]|0)+64>>2]>>2]|0)+j|0,i|0,h|0)|0;g=g+1|0;if((g|0)==(c|0))break;else j=j+h|0}dn(i);return}else{ee(f[f[e+64>>2]>>2]|0,i|0,h|0)|0;if((c|0)==1){dn(i);return}else{m=1;n=0}do{n=n+h|0;ee((f[f[(f[d>>2]|0)+64>>2]>>2]|0)+n|0,i|0,h|0)|0;m=m+1|0}while((m|0)!=(c|0));dn(i);return}}function Ue(a,b){a=a|0;b=b|0;var c=0,d=Ja,e=0,g=0;if((b|0)!=1)if(!(b+-1&b))c=b;else c=Za(b)|0;else c=2;b=f[a+4>>2]|0;if(c>>>0>b>>>0){fc(a,c);return}if(c>>>0>=b>>>0)return;d=$((f[a+12>>2]|0)>>>0);e=~~$(W($(d/$(n[a+16>>2]))))>>>0;if(b>>>0>2&(b+-1&b|0)==0)g=1<<32-(_(e+-1|0)|0);else g=Za(e)|0;e=c>>>0>>0?g:c;if(e>>>0>=b>>>0)return;fc(a,e);return}function Ve(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0;c=a+60|0;d=f[c>>2]|0;if(!d){e=0;return e|0}f[d+4>>2]=a+48;if(!(La[f[(f[d>>2]|0)+12>>2]&127](d)|0)){e=0;return e|0}d=La[f[(f[a>>2]|0)+24>>2]&127](a)|0;a:do if((d|0)>0){g=0;while(1){h=(La[f[(f[a>>2]|0)+28>>2]&127](a)|0)+4|0;i=f[h>>2]|0;h=Ma[f[(f[a>>2]|0)+20>>2]&127](a,g)|0;j=f[c>>2]|0;g=g+1|0;if(!(Ma[f[(f[j>>2]|0)+8>>2]&127](j,f[(f[i+8>>2]|0)+(h<<2)>>2]|0)|0)){e=0;break}if((g|0)>=(d|0))break a}return e|0}while(0);if(!(Ma[f[(f[a>>2]|0)+36>>2]&127](a,b)|0)){e=0;return e|0}if(!(Ma[f[(f[a>>2]|0)+40>>2]&127](a,b)|0)){e=0;return e|0}e=La[f[(f[a>>2]|0)+44>>2]&127](a)|0;return e|0}function We(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;a=u;u=u+32|0;e=a+12|0;g=a;f[e>>2]=0;f[e+4>>2]=0;f[e+8>>2]=0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;h=gg(d)|0;if(h>>>0>4294967279)ym(g);if(h>>>0<11){b[g+11>>0]=h;if(!h)i=g;else{j=g;k=6}}else{l=h+16&-16;m=dj(l)|0;f[g>>2]=m;f[g+8>>2]=l|-2147483648;f[g+4>>2]=h;j=m;k=6}if((k|0)==6){ee(j|0,d|0,h|0)|0;i=j}b[i+h>>0]=0;Tf(c,g,e)|0;c=e+11|0;h=b[c>>0]|0;i=h<<24>>24<0?f[e>>2]|0:e;if((b[g+11>>0]|0)<0){fn(f[g>>2]|0);n=b[c>>0]|0}else n=h;if(n<<24>>24>=0){u=a;return i|0}fn(f[e>>2]|0);u=a;return i|0}function Xe(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=d+16|0;g=f[e>>2]|0;if(!g)if(!(Ih(d)|0)){h=f[e>>2]|0;i=5}else j=0;else{h=g;i=5}a:do if((i|0)==5){g=d+20|0;e=f[g>>2]|0;k=e;if((h-e|0)>>>0>>0){j=Na[f[d+36>>2]&31](d,a,c)|0;break}b:do if((b[d+75>>0]|0)>-1){e=c;while(1){if(!e){l=k;m=0;n=c;o=a;break b}p=e+-1|0;if((b[a+p>>0]|0)==10)break;else e=p}p=Na[f[d+36>>2]&31](d,a,e)|0;if(p>>>0>>0){j=p;break a}l=f[g>>2]|0;m=e;n=c-e|0;o=a+e|0}else{l=k;m=0;n=c;o=a}while(0);ee(l|0,o|0,n|0)|0;f[g>>2]=(f[g>>2]|0)+n;j=m+n|0}while(0);return j|0}function Ye(a){a=a|0;var c=0,d=0,e=0,g=0,h=0,i=0;c=a+12|0;d=f[c>>2]|0;f[c>>2]=0;if(d|0){c=f[d+28>>2]|0;if(c|0){e=c;do{c=e;e=f[e>>2]|0;Ye(c+8|0);fn(c)}while((e|0)!=0)}e=d+20|0;c=f[e>>2]|0;f[e>>2]=0;if(c|0)fn(c);c=f[d+8>>2]|0;if(c|0){e=c;do{c=e;e=f[e>>2]|0;g=c+8|0;h=f[c+20>>2]|0;if(h|0){i=c+24|0;if((f[i>>2]|0)!=(h|0))f[i>>2]=h;fn(h)}if((b[g+11>>0]|0)<0)fn(f[g>>2]|0);fn(c)}while((e|0)!=0)}e=f[d>>2]|0;f[d>>2]=0;if(e|0)fn(e);fn(d)}if((b[a+11>>0]|0)>=0)return;fn(f[a>>2]|0);return}function Ze(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=(f[b+4>>2]|0)-(f[b>>2]|0)|0;b=d>>2;e=a+8|0;a=f[(f[e>>2]|0)+40>>2]|0;g=cn((a|0)>-1?a:-1)|0;h=c+8|0;if((d|0)<=0){i=1;dn(g);return i|0}d=c+16|0;j=0;k=0;while(1){l=h;m=f[l>>2]|0;n=f[l+4>>2]|0;l=d;o=f[l>>2]|0;p=Tj(o|0,f[l+4>>2]|0,a|0,0)|0;l=I;if((n|0)<(l|0)|(n|0)==(l|0)&m>>>0

>>0){i=0;q=5;break}ee(g|0,(f[c>>2]|0)+o|0,a|0)|0;o=d;f[o>>2]=p;f[o+4>>2]=l;ee((f[f[(f[e>>2]|0)+64>>2]>>2]|0)+k|0,g|0,a|0)|0;j=j+1|0;if((j|0)>=(b|0)){i=1;q=5;break}else k=k+a|0}if((q|0)==5){dn(g);return i|0}return 0}function _e(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=a+216|0;e=a+220|0;g=f[d>>2]|0;if((f[e>>2]|0)==(g|0)){h=0;return h|0}i=a+4|0;a=g;g=0;a:while(1){j=f[a+(g*144|0)>>2]|0;if(((j|0)>=0?(k=f[i>>2]|0,l=f[k+8>>2]|0,(j|0)<((f[k+12>>2]|0)-l>>2|0)):0)?(k=f[l+(j<<2)>>2]|0,(La[f[(f[k>>2]|0)+24>>2]&127](k)|0)>0):0){j=0;do{if((Ma[f[(f[k>>2]|0)+20>>2]&127](k,j)|0)==(c|0))break a;j=j+1|0}while((j|0)<(La[f[(f[k>>2]|0)+24>>2]&127](k)|0))}k=g+1|0;a=f[d>>2]|0;if(k>>>0>=(((f[e>>2]|0)-a|0)/144|0)>>>0){h=0;m=11;break}else g=k}if((m|0)==11)return h|0;m=f[d>>2]|0;h=(b[m+(g*144|0)+100>>0]|0)==0?0:m+(g*144|0)+4|0;return h|0}function $e(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0;c=b+8|0;d=f[c>>2]|0;e=f[c+4>>2]|0;c=b+16|0;g=c;i=f[g>>2]|0;j=f[g+4>>2]|0;g=Tj(i|0,j|0,4,0)|0;k=I;if((e|0)<(k|0)|(e|0)==(k|0)&d>>>0>>0){l=0;return l|0}m=(f[b>>2]|0)+i|0;b=h[m>>0]|h[m+1>>0]<<8|h[m+2>>0]<<16|h[m+3>>0]<<24;m=c;f[m>>2]=g;f[m+4>>2]=k;k=Tj(i|0,j|0,8,0)|0;j=I;if((e|0)<(j|0)|(e|0)==(j|0)&d>>>0>>0){l=0;return l|0}d=c;f[d>>2]=k;f[d+4>>2]=j;if(!(b&1)){l=0;return l|0}j=(_(b|0)|0)^31;if((j+-1|0)>>>0>28){l=0;return l|0}f[a+8>>2]=j+1;b=2<>2]=b+-1;j=b+-2|0;f[a+16>>2]=j;f[a+20>>2]=(j|0)/2|0;l=1;return l|0}function af(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;c=a+216|0;d=a+220|0;e=f[c>>2]|0;a:do if((f[d>>2]|0)!=(e|0)){g=a+4|0;h=e;i=0;b:while(1){j=f[h+(i*144|0)>>2]|0;if(((j|0)>=0?(k=f[g>>2]|0,l=f[k+8>>2]|0,(j|0)<((f[k+12>>2]|0)-l>>2|0)):0)?(k=f[l+(j<<2)>>2]|0,(La[f[(f[k>>2]|0)+24>>2]&127](k)|0)>0):0){j=0;do{if((Ma[f[(f[k>>2]|0)+20>>2]&127](k,j)|0)==(b|0))break b;j=j+1|0}while((j|0)<(La[f[(f[k>>2]|0)+24>>2]&127](k)|0))}k=i+1|0;h=f[c>>2]|0;if(k>>>0>=(((f[d>>2]|0)-h|0)/144|0)>>>0)break a;else i=k}m=(f[c>>2]|0)+(i*144|0)+104|0;return m|0}while(0);m=a+184|0;return m|0}function bf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;c=u;u=u+32|0;d=c+16|0;e=c+8|0;g=c;h=a+8|0;if(f[h>>2]<<5>>>0>=b>>>0){u=c;return}f[d>>2]=0;i=d+4|0;f[i>>2]=0;j=d+8|0;f[j>>2]=0;if((b|0)<0)ym(d);k=((b+-1|0)>>>5)+1|0;b=dj(k<<2)|0;f[d>>2]=b;f[i>>2]=0;f[j>>2]=k;k=f[a>>2]|0;f[e>>2]=k;f[e+4>>2]=0;b=a+4|0;l=f[b>>2]|0;f[g>>2]=k+(l>>>5<<2);f[g+4>>2]=l&31;Gd(d,e,g);g=f[a>>2]|0;f[a>>2]=f[d>>2];f[d>>2]=g;d=f[b>>2]|0;f[b>>2]=f[i>>2];f[i>>2]=d;d=f[h>>2]|0;f[h>>2]=f[j>>2];f[j>>2]=d;if(g|0)fn(g);u=c;return}function cf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;c=u;u=u+16|0;e=c;do if(((h[(f[a+4>>2]|0)+36>>0]|0)<<8&65535)>511){g=d+8|0;i=f[g+4>>2]|0;j=d+16|0;k=j;l=f[k>>2]|0;m=f[k+4>>2]|0;if((i|0)>(m|0)|((i|0)==(m|0)?(f[g>>2]|0)>>>0>l>>>0:0)){g=b[(f[d>>2]|0)+l>>0]|0;i=Tj(l|0,m|0,1,0)|0;m=j;f[m>>2]=i;f[m+4>>2]=I;m=g&255;f[a+24>>2]=m;n=m;break}else{o=0;u=c;return o|0}}else n=f[a+24>>2]|0;while(0);f[e>>2]=928;f[e+4>>2]=-1;Il(e,n);o=ih(e,f[a+16>>2]|0)|0;u=c;return o|0}function df(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;c=a+4|0;d=f[a>>2]|0;e=(f[c>>2]|0)-d|0;g=(e|0)/12|0;h=g+1|0;if(h>>>0>357913941)ym(a);i=a+8|0;j=((f[i>>2]|0)-d|0)/12|0;k=j<<1;l=j>>>0<178956970?(k>>>0>>0?h:k):357913941;do if(l)if(l>>>0>357913941){k=ra(8)|0;$k(k,9793);f[k>>2]=3708;va(k|0,856,80)}else{m=dj(l*12|0)|0;break}else m=0;while(0);k=m+(g*12|0)|0;f[k>>2]=f[b>>2];f[k+4>>2]=f[b+4>>2];f[k+8>>2]=f[b+8>>2];b=k+(((e|0)/-12|0)*12|0)|0;if((e|0)>0)ee(b|0,d|0,e|0)|0;f[a>>2]=b;f[c>>2]=k+12;f[i>>2]=m+(l*12|0);if(!d)return;fn(d);return}function ef(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0;c=u;u=u+16|0;d=c;e=Fd(a,d,b)|0;g=f[e>>2]|0;if(g|0){h=g;i=h+28|0;u=c;return i|0}g=dj(40)|0;Sf(g+16|0,b);b=g+28|0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;b=f[d>>2]|0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=b;f[e>>2]=g;b=f[f[a>>2]>>2]|0;if(!b)j=g;else{f[a>>2]=b;j=f[e>>2]|0}Gc(f[a+4>>2]|0,j);j=a+8|0;f[j>>2]=(f[j>>2]|0)+1;h=g;i=h+28|0;u=c;return i|0}function ff(a,c,d,e,g,h,i,j){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0;k=u;u=u+16|0;l=k;if((-18-c|0)>>>0>>0)ym(a);if((b[a+11>>0]|0)<0)m=f[a>>2]|0;else m=a;if(c>>>0<2147483623){n=d+c|0;d=c<<1;o=n>>>0>>0?d:n;p=o>>>0<11?11:o+16&-16}else p=-17;o=dj(p)|0;if(g|0)Qk(o,m,g)|0;if(i|0)Qk(o+g|0,j,i)|0;j=e-h|0;e=j-g|0;if(e|0)Qk(o+g+i|0,m+g+h|0,e)|0;if((c|0)!=10)fn(m);f[a>>2]=o;f[a+8>>2]=p|-2147483648;p=j+i|0;f[a+4>>2]=p;b[l>>0]=0;Vl(o+p|0,l);u=k;return}function gf(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0;b=f[a>>2]|0;if(!b)return;c=a+4|0;d=f[c>>2]|0;if((d|0)==(b|0))e=b;else{g=d;do{f[c>>2]=g+-144;d=f[g+-12>>2]|0;if(d|0){h=g+-8|0;i=f[h>>2]|0;if((i|0)!=(d|0))f[h>>2]=i+(~((i+-4-d|0)>>>2)<<2);fn(d)}d=f[g+-28>>2]|0;if(d|0){i=g+-24|0;h=f[i>>2]|0;if((h|0)!=(d|0))f[i>>2]=h+(~((h+-4-d|0)>>>2)<<2);fn(d)}d=f[g+-40>>2]|0;if(d|0){h=g+-36|0;i=f[h>>2]|0;if((i|0)!=(d|0))f[h>>2]=i+(~((i+-4-d|0)>>>2)<<2);fn(d)}vf(g+-140|0);g=f[c>>2]|0}while((g|0)!=(b|0));e=f[a>>2]|0}fn(e);return}function hf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0;a=u;u=u+16|0;e=a;f[e>>2]=0;f[e+4>>2]=0;f[e+8>>2]=0;g=gg(d)|0;if(g>>>0>4294967279)ym(e);if(g>>>0<11){b[e+11>>0]=g;if(!g)h=e;else{i=e;j=6}}else{k=g+16&-16;l=dj(k)|0;f[e>>2]=l;f[e+8>>2]=k|-2147483648;f[e+4>>2]=g;i=l;j=6}if((j|0)==6){ee(i|0,d|0,g|0)|0;h=i}b[h+g>>0]=0;g=(Rb(c,e)|0)!=0;if((b[e+11>>0]|0)>=0){u=a;return g|0}fn(f[e>>2]|0);u=a;return g|0}function jf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;c=a+8|0;d=f[c>>2]|0;e=a+4|0;g=f[e>>2]|0;if(d-g>>2>>>0>=b>>>0){Vf(g|0,0,b<<2|0)|0;f[e>>2]=g+(b<<2);return}h=f[a>>2]|0;i=g-h|0;g=i>>2;j=g+b|0;if(j>>>0>1073741823)ym(a);k=d-h|0;d=k>>1;l=k>>2>>>0<536870911?(d>>>0>>0?j:d):1073741823;do if(l)if(l>>>0>1073741823){d=ra(8)|0;$k(d,9793);f[d>>2]=3708;va(d|0,856,80)}else{m=dj(l<<2)|0;break}else m=0;while(0);d=m+(g<<2)|0;Vf(d|0,0,b<<2|0)|0;j=d+(0-g<<2)|0;if((i|0)>0)ee(j|0,h|0,i|0)|0;f[a>>2]=j;f[e>>2]=d+(b<<2);f[c>>2]=m+(l<<2);if(!h)return;fn(h);return}function kf(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;d=a+8|0;e=f[d>>2]|0;g=a+4|0;h=f[g>>2]|0;if((e-h|0)>>>0>=c>>>0){i=h;j=c;do{b[i>>0]=0;i=(f[g>>2]|0)+1|0;f[g>>2]=i;j=j+-1|0}while((j|0)!=0);return}j=f[a>>2]|0;i=h-j|0;h=i+c|0;if((h|0)<0)ym(a);k=e-j|0;j=k<<1;e=k>>>0<1073741823?(j>>>0>>0?h:j):2147483647;if(!e)l=0;else l=dj(e)|0;j=l+i|0;i=l+e|0;e=j;l=c;c=j;do{b[e>>0]=0;e=c+1|0;c=e;l=l+-1|0}while((l|0)!=0);l=f[a>>2]|0;e=(f[g>>2]|0)-l|0;h=j+(0-e)|0;if((e|0)>0)ee(h|0,l|0,e|0)|0;f[a>>2]=h;f[g>>2]=c;f[d>>2]=i;if(!l)return;fn(l);return}function lf(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=2464;b=a+84|0;c=a+4|0;d=c+80|0;do{f[c>>2]=0;c=c+4|0}while((c|0)<(d|0));f[b>>2]=-1;f[a+88>>2]=-1;f[a+92>>2]=-1;b=a+152|0;c=a+96|0;d=c+56|0;do{f[c>>2]=0;c=c+4|0}while((c|0)<(d|0));n[b>>2]=$(1.0);b=a+212|0;c=a+156|0;d=c+56|0;do{f[c>>2]=0;c=c+4|0}while((c|0)<(d|0));f[b>>2]=-1;f[a+216>>2]=0;f[a+220>>2]=0;f[a+224>>2]=0;Ji(a+232|0);b=a+380|0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;f[b+12>>2]=0;f[b+16>>2]=0;f[a+400>>2]=-1;f[a+404>>2]=-1;f[a+408>>2]=2;f[a+412>>2]=7;b=a+416|0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;f[b+12>>2]=0;f[b+16>>2]=0;f[b+20>>2]=0;return}function mf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,i=0;d=u;u=u+32|0;c=d;if((h[(f[a+4>>2]|0)+36>>0]<<8&65535)>511?!(La[f[(f[a>>2]|0)+52>>2]&127](a)|0):0){e=0;u=d;return e|0}f[c>>2]=956;f[c+4>>2]=-1;g=c+8|0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;f[g+12>>2]=0;Oh(c,f[a+24>>2]|0,f[a+28>>2]|0,b[(f[a+8>>2]|0)+24>>0]|0,$(n[a+32>>2]));i=ih(c,f[a+16>>2]|0)|0;f[c>>2]=956;a=f[g>>2]|0;if(a|0){g=c+12|0;c=f[g>>2]|0;if((c|0)!=(a|0))f[g>>2]=c+(~((c+-4-a|0)>>>2)<<2);fn(a)}e=i;u=d;return e|0}function nf(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0;b=f[a+4>>2]|0;c=a+8|0;d=f[c>>2]|0;if((d|0)!=(b|0)){e=d;do{f[c>>2]=e+-144;d=f[e+-12>>2]|0;if(d|0){g=e+-8|0;h=f[g>>2]|0;if((h|0)!=(d|0))f[g>>2]=h+(~((h+-4-d|0)>>>2)<<2);fn(d)}d=f[e+-28>>2]|0;if(d|0){h=e+-24|0;g=f[h>>2]|0;if((g|0)!=(d|0))f[h>>2]=g+(~((g+-4-d|0)>>>2)<<2);fn(d)}d=f[e+-40>>2]|0;if(d|0){g=e+-36|0;h=f[g>>2]|0;if((h|0)!=(d|0))f[g>>2]=h+(~((h+-4-d|0)>>>2)<<2);fn(d)}vf(e+-140|0);e=f[c>>2]|0}while((e|0)!=(b|0))}b=f[a>>2]|0;if(!b)return;fn(b);return}function of(a){a=a|0;var b=0,c=0,d=0;b=f[a+76>>2]|0;if(b|0){c=a+80|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+64>>2]|0;if(b|0){d=a+68|0;if((f[d>>2]|0)!=(b|0))f[d>>2]=b;fn(b)}b=f[a+48>>2]|0;if(b|0){d=a+52|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+24>>2]|0;if(b|0){c=a+28|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+12>>2]|0;if(b|0){d=a+16|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a>>2]|0;if(!b)return;c=a+4|0;a=f[c>>2]|0;if((a|0)!=(b|0))f[c>>2]=a+(~((a+-4-b|0)>>>2)<<2);fn(b);return}function pf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;a=u;u=u+32|0;e=a+12|0;g=a;f[e>>2]=0;f[e+4>>2]=0;f[e+8>>2]=0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;h=gg(d)|0;if(h>>>0>4294967279)ym(g);if(h>>>0<11){b[g+11>>0]=h;if(!h)i=g;else{j=g;k=6}}else{l=h+16&-16;m=dj(l)|0;f[g>>2]=m;f[g+8>>2]=l|-2147483648;f[g+4>>2]=h;j=m;k=6}if((k|0)==6){ee(j|0,d|0,h|0)|0;i=j}b[i+h>>0]=0;h=Tf(c,g,e)|0;if((b[g+11>>0]|0)<0)fn(f[g>>2]|0);if((b[e+11>>0]|0)>=0){u=a;return h|0}fn(f[e>>2]|0);u=a;return h|0}function qf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;e=u;u=u+16|0;g=e;h=c+11|0;i=b[h>>0]|0;if(i<<24>>24<0)j=f[c+4>>2]|0;else j=i&255;k=i;i=j;while(1){if(k<<24>>24<0)l=f[c>>2]|0;else l=c;f[g>>2]=d;m=yj(l,i+1|0,12308,g)|0;if((m|0)>-1)if(m>>>0>i>>>0)n=m;else break;else n=i<<1|1;ig(c,n,0);k=b[h>>0]|0;i=n}ig(c,m,0);f[a>>2]=f[c>>2];f[a+4>>2]=f[c+4>>2];f[a+8>>2]=f[c+8>>2];a=0;while(1){if((a|0)==3)break;f[c+(a<<2)>>2]=0;a=a+1|0}u=e;return}function rf(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;b=a+8|0;c=f[b>>2]|0;if((c|0)<0){d=0;return d|0}e=a+4|0;a=f[e>>2]|0;g=a+4|0;h=f[g>>2]|0;i=f[a>>2]|0;j=h-i>>2;k=i;i=h;if(c>>>0<=j>>>0)if(c>>>0>>0?(h=k+(c<<2)|0,(i|0)!=(h|0)):0){f[g>>2]=i+(~((i+-4-h|0)>>>2)<<2);l=c}else l=c;else{jf(a,c-j|0);l=f[b>>2]|0}if((l|0)<=0){d=1;return d|0}b=f[e>>2]|0;e=f[b>>2]|0;j=(f[b+4>>2]|0)-e>>2;c=e;e=0;while(1){if(j>>>0<=e>>>0){m=10;break}f[c+(e<<2)>>2]=e;e=e+1|0;if((e|0)>=(l|0)){d=1;m=12;break}}if((m|0)==10)ym(b);else if((m|0)==12)return d|0;return 0}function sf(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0;b=a+140|0;c=f[b>>2]|0;if((c|0)<=0){d=1;return d|0}e=c<<4;g=cn(c>>>0>268435455|e>>>0>4294967291?-1:e+4|0)|0;f[g>>2]=c;e=g+4|0;g=e+(c<<4)|0;c=e;do{Vk(c);c=c+16|0}while((c|0)!=(g|0));g=a+136|0;c=f[g>>2]|0;f[g>>2]=e;if(c|0){e=c+-4|0;h=f[e>>2]|0;if(h|0){i=c+(h<<4)|0;do{i=i+-16|0;ln(i)}while((i|0)!=(c|0))}dn(e)}if((f[b>>2]|0)<=0){d=1;return d|0}e=0;while(1){if(!(sd((f[g>>2]|0)+(e<<4)|0,a)|0)){d=0;j=13;break}e=e+1|0;if((e|0)>=(f[b>>2]|0)){d=1;j=13;break}}if((j|0)==13)return d|0;return 0}function tf(){var a=0,b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0;a=u;u=u+48|0;b=a+32|0;c=a+24|0;d=a+16|0;e=a;g=a+36|0;a=jj()|0;if(a|0?(h=f[a>>2]|0,h|0):0){a=h+48|0;i=f[a>>2]|0;j=f[a+4>>2]|0;if(!((i&-256|0)==1126902528&(j|0)==1129074247)){f[c>>2]=f[899];Cj(12397,c)}if((i|0)==1126902529&(j|0)==1129074247)k=f[h+44>>2]|0;else k=h+80|0;f[g>>2]=k;k=f[h>>2]|0;h=f[k+4>>2]|0;j=Na[f[(f[194]|0)+16>>2]&31](776,k,g)|0;k=f[899]|0;if(j){j=f[g>>2]|0;g=La[f[(f[j>>2]|0)+8>>2]&127](j)|0;f[e>>2]=k;f[e+4>>2]=h;f[e+8>>2]=g;Cj(12311,e)}else{f[d>>2]=k;f[d+4>>2]=h;Cj(12356,d)}}Cj(12435,b)}function uf(a){a=a|0;var c=0,d=0,e=0,g=0,h=0;c=f[a>>2]|0;f[a>>2]=0;if(!c)return;a=f[c+28>>2]|0;if(a|0){d=a;do{a=d;d=f[d>>2]|0;e=a+8|0;uf(a+20|0);if((b[e+11>>0]|0)<0)fn(f[e>>2]|0);fn(a)}while((d|0)!=0)}d=c+20|0;a=f[d>>2]|0;f[d>>2]=0;if(a|0)fn(a);a=f[c+8>>2]|0;if(a|0){d=a;do{a=d;d=f[d>>2]|0;e=a+8|0;g=f[a+20>>2]|0;if(g|0){h=a+24|0;if((f[h>>2]|0)!=(g|0))f[h>>2]=g;fn(g)}if((b[e+11>>0]|0)<0)fn(f[e>>2]|0);fn(a)}while((d|0)!=0)}d=f[c>>2]|0;f[c>>2]=0;if(d|0)fn(d);fn(c);return}function vf(a){a=a|0;var b=0,c=0,d=0;b=f[a+84>>2]|0;if(b|0){c=a+88|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+72>>2]|0;if(b|0){d=a+76|0;if((f[d>>2]|0)!=(b|0))f[d>>2]=b;fn(b)}b=f[a+52>>2]|0;if(b|0){d=a+56|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+40>>2]|0;if(b|0){c=a+44|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+28>>2]|0;if(b|0){d=a+32|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+12>>2]|0;if(b|0)fn(b);b=f[a>>2]|0;if(!b)return;fn(b);return}function wf(a){a=a|0;var b=0,c=0,d=0;b=f[a+92>>2]|0;if(b|0){c=a+96|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+76>>2]|0;if(b|0){d=a+80|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}b=f[a+64>>2]|0;if(b|0){c=a+68|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+52>>2]|0;if(b|0){d=a+56|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b)}f[a+4>>2]=2420;b=f[a+24>>2]|0;if(b|0)fn(b);b=f[a+12>>2]|0;if(!b)return;fn(b);return}function xf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0;do if(a){if(c>>>0<128){b[a>>0]=c;e=1;break}d=(bn()|0)+188|0;if(!(f[f[d>>2]>>2]|0))if((c&-128|0)==57216){b[a>>0]=c;e=1;break}else{d=Um()|0;f[d>>2]=84;e=-1;break}if(c>>>0<2048){b[a>>0]=c>>>6|192;b[a+1>>0]=c&63|128;e=2;break}if(c>>>0<55296|(c&-8192|0)==57344){b[a>>0]=c>>>12|224;b[a+1>>0]=c>>>6&63|128;b[a+2>>0]=c&63|128;e=3;break}if((c+-65536|0)>>>0<1048576){b[a>>0]=c>>>18|240;b[a+1>>0]=c>>>12&63|128;b[a+2>>0]=c>>>6&63|128;b[a+3>>0]=c&63|128;e=4;break}else{d=Um()|0;f[d>>2]=84;e=-1;break}}else e=1;while(0);return e|0}function yf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;c=a+4|0;d=f[a>>2]|0;e=(f[c>>2]|0)-d|0;g=e>>2;h=g+1|0;if(h>>>0>1073741823)ym(a);i=a+8|0;j=(f[i>>2]|0)-d|0;k=j>>1;l=j>>2>>>0<536870911?(k>>>0>>0?h:k):1073741823;do if(l)if(l>>>0>1073741823){k=ra(8)|0;$k(k,9793);f[k>>2]=3708;va(k|0,856,80)}else{m=dj(l<<2)|0;break}else m=0;while(0);k=m+(g<<2)|0;f[k>>2]=f[b>>2];b=k+(0-g<<2)|0;if((e|0)>0)ee(b|0,d|0,e|0)|0;f[a>>2]=b;f[c>>2]=k+4;f[i>>2]=m+(l<<2);if(!d)return;fn(d);return} +function Wa(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0;b=u;u=u+16|0;c=b;do if(a>>>0<245){d=a>>>0<11?16:a+11&-8;e=d>>>3;g=f[3222]|0;h=g>>>e;if(h&3|0){i=(h&1^1)+e|0;j=12928+(i<<1<<2)|0;k=j+8|0;l=f[k>>2]|0;m=l+8|0;n=f[m>>2]|0;if((j|0)==(n|0))f[3222]=g&~(1<>2]=j;f[k>>2]=n}n=i<<3;f[l+4>>2]=n|3;i=l+n+4|0;f[i>>2]=f[i>>2]|1;o=m;u=b;return o|0}m=f[3224]|0;if(d>>>0>m>>>0){if(h|0){i=2<>>12&16;e=i>>>n;i=e>>>5&8;h=e>>>i;e=h>>>2&4;l=h>>>e;h=l>>>1&2;k=l>>>h;l=k>>>1&1;j=(i|n|e|h|l)+(k>>>l)|0;l=12928+(j<<1<<2)|0;k=l+8|0;h=f[k>>2]|0;e=h+8|0;n=f[e>>2]|0;if((l|0)==(n|0)){i=g&~(1<>2]=l;f[k>>2]=n;p=g}n=(j<<3)-d|0;f[h+4>>2]=d|3;j=h+d|0;f[j+4>>2]=n|1;f[j+n>>2]=n;if(m|0){h=f[3227]|0;k=m>>>3;l=12928+(k<<1<<2)|0;i=1<>2]|0}f[q>>2]=h;f[r+12>>2]=h;f[h+8>>2]=r;f[h+12>>2]=l}f[3224]=n;f[3227]=j;o=e;u=b;return o|0}e=f[3223]|0;if(e){j=(e&0-e)+-1|0;n=j>>>12&16;l=j>>>n;j=l>>>5&8;h=l>>>j;l=h>>>2&4;i=h>>>l;h=i>>>1&2;k=i>>>h;i=k>>>1&1;s=f[13192+((j|n|l|h|i)+(k>>>i)<<2)>>2]|0;i=(f[s+4>>2]&-8)-d|0;k=f[s+16+(((f[s+16>>2]|0)==0&1)<<2)>>2]|0;if(!k){t=i;v=s}else{h=k;k=i;i=s;while(1){s=(f[h+4>>2]&-8)-d|0;l=s>>>0>>0;n=l?s:k;s=l?h:i;h=f[h+16+(((f[h+16>>2]|0)==0&1)<<2)>>2]|0;if(!h){t=n;v=s;break}else{k=n;i=s}}}i=v+d|0;if(v>>>0>>0){k=f[v+24>>2]|0;h=f[v+12>>2]|0;do if((h|0)==(v|0)){s=v+20|0;n=f[s>>2]|0;if(!n){l=v+16|0;j=f[l>>2]|0;if(!j){w=0;break}else{x=j;y=l}}else{x=n;y=s}while(1){s=x+20|0;n=f[s>>2]|0;if(n|0){x=n;y=s;continue}s=x+16|0;n=f[s>>2]|0;if(!n)break;else{x=n;y=s}}f[y>>2]=0;w=x}else{s=f[v+8>>2]|0;f[s+12>>2]=h;f[h+8>>2]=s;w=h}while(0);do if(k|0){h=f[v+28>>2]|0;s=13192+(h<<2)|0;if((v|0)==(f[s>>2]|0)){f[s>>2]=w;if(!w){f[3223]=e&~(1<>2]|0)!=(v|0)&1)<<2)>>2]=w;if(!w)break}f[w+24>>2]=k;h=f[v+16>>2]|0;if(h|0){f[w+16>>2]=h;f[h+24>>2]=w}h=f[v+20>>2]|0;if(h|0){f[w+20>>2]=h;f[h+24>>2]=w}}while(0);if(t>>>0<16){k=t+d|0;f[v+4>>2]=k|3;e=v+k+4|0;f[e>>2]=f[e>>2]|1}else{f[v+4>>2]=d|3;f[i+4>>2]=t|1;f[i+t>>2]=t;if(m|0){e=f[3227]|0;k=m>>>3;h=12928+(k<<1<<2)|0;s=1<>2]|0}f[z>>2]=e;f[A+12>>2]=e;f[e+8>>2]=A;f[e+12>>2]=h}f[3224]=t;f[3227]=i}o=v+8|0;u=b;return o|0}else B=d}else B=d}else B=d}else if(a>>>0<=4294967231){h=a+11|0;e=h&-8;s=f[3223]|0;if(s){k=0-e|0;n=h>>>8;if(n)if(e>>>0>16777215)C=31;else{h=(n+1048320|0)>>>16&8;l=n<>>16&4;j=l<>>16&2;D=14-(n|h|l)+(j<>>15)|0;C=e>>>(D+7|0)&1|D<<1}else C=0;D=f[13192+(C<<2)>>2]|0;a:do if(!D){E=k;F=0;G=0;H=57}else{l=k;j=0;h=e<<((C|0)==31?0:25-(C>>>1)|0);n=D;I=0;while(1){J=(f[n+4>>2]&-8)-e|0;if(J>>>0>>0)if(!J){K=0;L=n;M=n;H=61;break a}else{N=J;O=n}else{N=l;O=I}J=f[n+20>>2]|0;n=f[n+16+(h>>>31<<2)>>2]|0;P=(J|0)==0|(J|0)==(n|0)?j:J;J=(n|0)==0;if(J){E=N;F=P;G=O;H=57;break}else{l=N;j=P;h=h<<((J^1)&1);I=O}}}while(0);if((H|0)==57){if((F|0)==0&(G|0)==0){D=2<>>12&16;d=D>>>k;D=d>>>5&8;i=d>>>D;d=i>>>2&4;g=i>>>d;i=g>>>1&2;m=g>>>i;g=m>>>1&1;Q=f[13192+((D|k|d|i|g)+(m>>>g)<<2)>>2]|0;R=0}else{Q=F;R=G}if(!Q){S=E;T=R}else{K=E;L=Q;M=R;H=61}}if((H|0)==61)while(1){H=0;g=(f[L+4>>2]&-8)-e|0;m=g>>>0>>0;i=m?g:K;g=m?L:M;L=f[L+16+(((f[L+16>>2]|0)==0&1)<<2)>>2]|0;if(!L){S=i;T=g;break}else{K=i;M=g;H=61}}if((T|0)!=0?S>>>0<((f[3224]|0)-e|0)>>>0:0){g=T+e|0;if(T>>>0>=g>>>0){o=0;u=b;return o|0}i=f[T+24>>2]|0;m=f[T+12>>2]|0;do if((m|0)==(T|0)){d=T+20|0;k=f[d>>2]|0;if(!k){D=T+16|0;I=f[D>>2]|0;if(!I){U=0;break}else{V=I;W=D}}else{V=k;W=d}while(1){d=V+20|0;k=f[d>>2]|0;if(k|0){V=k;W=d;continue}d=V+16|0;k=f[d>>2]|0;if(!k)break;else{V=k;W=d}}f[W>>2]=0;U=V}else{d=f[T+8>>2]|0;f[d+12>>2]=m;f[m+8>>2]=d;U=m}while(0);do if(i){m=f[T+28>>2]|0;d=13192+(m<<2)|0;if((T|0)==(f[d>>2]|0)){f[d>>2]=U;if(!U){d=s&~(1<>2]|0)!=(T|0)&1)<<2)>>2]=U;if(!U){X=s;break}}f[U+24>>2]=i;d=f[T+16>>2]|0;if(d|0){f[U+16>>2]=d;f[d+24>>2]=U}d=f[T+20>>2]|0;if(d){f[U+20>>2]=d;f[d+24>>2]=U;X=s}else X=s}else X=s;while(0);do if(S>>>0>=16){f[T+4>>2]=e|3;f[g+4>>2]=S|1;f[g+S>>2]=S;s=S>>>3;if(S>>>0<256){i=12928+(s<<1<<2)|0;d=f[3222]|0;m=1<>2]|0}f[Y>>2]=g;f[Z+12>>2]=g;f[g+8>>2]=Z;f[g+12>>2]=i;break}i=S>>>8;if(i)if(S>>>0>16777215)_=31;else{m=(i+1048320|0)>>>16&8;d=i<>>16&4;s=d<>>16&2;k=14-(i|m|d)+(s<>>15)|0;_=S>>>(k+7|0)&1|k<<1}else _=0;k=13192+(_<<2)|0;f[g+28>>2]=_;d=g+16|0;f[d+4>>2]=0;f[d>>2]=0;d=1<<_;if(!(X&d)){f[3223]=X|d;f[k>>2]=g;f[g+24>>2]=k;f[g+12>>2]=g;f[g+8>>2]=g;break}d=S<<((_|0)==31?0:25-(_>>>1)|0);s=f[k>>2]|0;while(1){if((f[s+4>>2]&-8|0)==(S|0)){H=97;break}$=s+16+(d>>>31<<2)|0;k=f[$>>2]|0;if(!k){H=96;break}else{d=d<<1;s=k}}if((H|0)==96){f[$>>2]=g;f[g+24>>2]=s;f[g+12>>2]=g;f[g+8>>2]=g;break}else if((H|0)==97){d=s+8|0;k=f[d>>2]|0;f[k+12>>2]=g;f[d>>2]=g;f[g+8>>2]=k;f[g+12>>2]=s;f[g+24>>2]=0;break}}else{k=S+e|0;f[T+4>>2]=k|3;d=T+k+4|0;f[d>>2]=f[d>>2]|1}while(0);o=T+8|0;u=b;return o|0}else B=e}else B=e}else B=-1;while(0);T=f[3224]|0;if(T>>>0>=B>>>0){S=T-B|0;$=f[3227]|0;if(S>>>0>15){_=$+B|0;f[3227]=_;f[3224]=S;f[_+4>>2]=S|1;f[_+S>>2]=S;f[$+4>>2]=B|3}else{f[3224]=0;f[3227]=0;f[$+4>>2]=T|3;S=$+T+4|0;f[S>>2]=f[S>>2]|1}o=$+8|0;u=b;return o|0}$=f[3225]|0;if($>>>0>B>>>0){S=$-B|0;f[3225]=S;T=f[3228]|0;_=T+B|0;f[3228]=_;f[_+4>>2]=S|1;f[T+4>>2]=B|3;o=T+8|0;u=b;return o|0}if(!(f[3340]|0)){f[3342]=4096;f[3341]=4096;f[3343]=-1;f[3344]=-1;f[3345]=0;f[3333]=0;T=c&-16^1431655768;f[c>>2]=T;f[3340]=T;aa=4096}else aa=f[3342]|0;T=B+48|0;c=B+47|0;S=aa+c|0;_=0-aa|0;aa=S&_;if(aa>>>0<=B>>>0){o=0;u=b;return o|0}X=f[3332]|0;if(X|0?(Z=f[3330]|0,Y=Z+aa|0,Y>>>0<=Z>>>0|Y>>>0>X>>>0):0){o=0;u=b;return o|0}b:do if(!(f[3333]&4)){X=f[3228]|0;c:do if(X){Y=13336;while(1){Z=f[Y>>2]|0;if(Z>>>0<=X>>>0?(ba=Y+4|0,(Z+(f[ba>>2]|0)|0)>>>0>X>>>0):0)break;Z=f[Y+8>>2]|0;if(!Z){H=118;break c}else Y=Z}s=S-$&_;if(s>>>0<2147483647){Z=Qh(s|0)|0;if((Z|0)==((f[Y>>2]|0)+(f[ba>>2]|0)|0))if((Z|0)==(-1|0))ca=s;else{da=Z;ea=s;H=135;break b}else{fa=Z;ga=s;H=126}}else ca=0}else H=118;while(0);do if((H|0)==118){X=Qh(0)|0;if((X|0)!=(-1|0)?(e=X,s=f[3341]|0,Z=s+-1|0,U=((Z&e|0)==0?0:(Z+e&0-s)-e|0)+aa|0,e=f[3330]|0,s=U+e|0,U>>>0>B>>>0&U>>>0<2147483647):0){Z=f[3332]|0;if(Z|0?s>>>0<=e>>>0|s>>>0>Z>>>0:0){ca=0;break}Z=Qh(U|0)|0;if((Z|0)==(X|0)){da=X;ea=U;H=135;break b}else{fa=Z;ga=U;H=126}}else ca=0}while(0);do if((H|0)==126){U=0-ga|0;if(!(T>>>0>ga>>>0&(ga>>>0<2147483647&(fa|0)!=(-1|0))))if((fa|0)==(-1|0)){ca=0;break}else{da=fa;ea=ga;H=135;break b}Z=f[3342]|0;X=c-ga+Z&0-Z;if(X>>>0>=2147483647){da=fa;ea=ga;H=135;break b}if((Qh(X|0)|0)==(-1|0)){Qh(U|0)|0;ca=0;break}else{da=fa;ea=X+ga|0;H=135;break b}}while(0);f[3333]=f[3333]|4;ha=ca;H=133}else{ha=0;H=133}while(0);if(((H|0)==133?aa>>>0<2147483647:0)?(ca=Qh(aa|0)|0,aa=Qh(0)|0,ga=aa-ca|0,fa=ga>>>0>(B+40|0)>>>0,!((ca|0)==(-1|0)|fa^1|ca>>>0>>0&((ca|0)!=(-1|0)&(aa|0)!=(-1|0))^1)):0){da=ca;ea=fa?ga:ha;H=135}if((H|0)==135){ha=(f[3330]|0)+ea|0;f[3330]=ha;if(ha>>>0>(f[3331]|0)>>>0)f[3331]=ha;ha=f[3228]|0;do if(ha){ga=13336;while(1){ia=f[ga>>2]|0;ja=ga+4|0;ka=f[ja>>2]|0;if((da|0)==(ia+ka|0)){H=145;break}fa=f[ga+8>>2]|0;if(!fa)break;else ga=fa}if(((H|0)==145?(f[ga+12>>2]&8|0)==0:0)?ha>>>0>>0&ha>>>0>=ia>>>0:0){f[ja>>2]=ka+ea;fa=ha+8|0;ca=(fa&7|0)==0?0:0-fa&7;fa=ha+ca|0;aa=(f[3225]|0)+(ea-ca)|0;f[3228]=fa;f[3225]=aa;f[fa+4>>2]=aa|1;f[fa+aa+4>>2]=40;f[3229]=f[3344];break}if(da>>>0<(f[3226]|0)>>>0)f[3226]=da;aa=da+ea|0;fa=13336;while(1){if((f[fa>>2]|0)==(aa|0)){H=153;break}ca=f[fa+8>>2]|0;if(!ca)break;else fa=ca}if((H|0)==153?(f[fa+12>>2]&8|0)==0:0){f[fa>>2]=da;ga=fa+4|0;f[ga>>2]=(f[ga>>2]|0)+ea;ga=da+8|0;ca=da+((ga&7|0)==0?0:0-ga&7)|0;ga=aa+8|0;c=aa+((ga&7|0)==0?0:0-ga&7)|0;ga=ca+B|0;T=c-ca-B|0;f[ca+4>>2]=B|3;do if((c|0)!=(ha|0)){if((c|0)==(f[3227]|0)){ba=(f[3224]|0)+T|0;f[3224]=ba;f[3227]=ga;f[ga+4>>2]=ba|1;f[ga+ba>>2]=ba;break}ba=f[c+4>>2]|0;if((ba&3|0)==1){_=ba&-8;$=ba>>>3;d:do if(ba>>>0<256){S=f[c+8>>2]|0;X=f[c+12>>2]|0;if((X|0)==(S|0)){f[3222]=f[3222]&~(1<<$);break}else{f[S+12>>2]=X;f[X+8>>2]=S;break}}else{S=f[c+24>>2]|0;X=f[c+12>>2]|0;do if((X|0)==(c|0)){U=c+16|0;Z=U+4|0;s=f[Z>>2]|0;if(!s){e=f[U>>2]|0;if(!e){la=0;break}else{ma=e;na=U}}else{ma=s;na=Z}while(1){Z=ma+20|0;s=f[Z>>2]|0;if(s|0){ma=s;na=Z;continue}Z=ma+16|0;s=f[Z>>2]|0;if(!s)break;else{ma=s;na=Z}}f[na>>2]=0;la=ma}else{Z=f[c+8>>2]|0;f[Z+12>>2]=X;f[X+8>>2]=Z;la=X}while(0);if(!S)break;X=f[c+28>>2]|0;Z=13192+(X<<2)|0;do if((c|0)!=(f[Z>>2]|0)){f[S+16+(((f[S+16>>2]|0)!=(c|0)&1)<<2)>>2]=la;if(!la)break d}else{f[Z>>2]=la;if(la|0)break;f[3223]=f[3223]&~(1<>2]=S;X=c+16|0;Z=f[X>>2]|0;if(Z|0){f[la+16>>2]=Z;f[Z+24>>2]=la}Z=f[X+4>>2]|0;if(!Z)break;f[la+20>>2]=Z;f[Z+24>>2]=la}while(0);oa=c+_|0;pa=_+T|0}else{oa=c;pa=T}$=oa+4|0;f[$>>2]=f[$>>2]&-2;f[ga+4>>2]=pa|1;f[ga+pa>>2]=pa;$=pa>>>3;if(pa>>>0<256){ba=12928+($<<1<<2)|0;Y=f[3222]|0;Z=1<<$;if(!(Y&Z)){f[3222]=Y|Z;qa=ba+8|0;ra=ba}else{Z=ba+8|0;qa=Z;ra=f[Z>>2]|0}f[qa>>2]=ga;f[ra+12>>2]=ga;f[ga+8>>2]=ra;f[ga+12>>2]=ba;break}ba=pa>>>8;do if(!ba)sa=0;else{if(pa>>>0>16777215){sa=31;break}Z=(ba+1048320|0)>>>16&8;Y=ba<>>16&4;X=Y<<$;Y=(X+245760|0)>>>16&2;s=14-($|Z|Y)+(X<>>15)|0;sa=pa>>>(s+7|0)&1|s<<1}while(0);ba=13192+(sa<<2)|0;f[ga+28>>2]=sa;_=ga+16|0;f[_+4>>2]=0;f[_>>2]=0;_=f[3223]|0;s=1<>2]=ga;f[ga+24>>2]=ba;f[ga+12>>2]=ga;f[ga+8>>2]=ga;break}s=pa<<((sa|0)==31?0:25-(sa>>>1)|0);_=f[ba>>2]|0;while(1){if((f[_+4>>2]&-8|0)==(pa|0)){H=194;break}ta=_+16+(s>>>31<<2)|0;ba=f[ta>>2]|0;if(!ba){H=193;break}else{s=s<<1;_=ba}}if((H|0)==193){f[ta>>2]=ga;f[ga+24>>2]=_;f[ga+12>>2]=ga;f[ga+8>>2]=ga;break}else if((H|0)==194){s=_+8|0;ba=f[s>>2]|0;f[ba+12>>2]=ga;f[s>>2]=ga;f[ga+8>>2]=ba;f[ga+12>>2]=_;f[ga+24>>2]=0;break}}else{ba=(f[3225]|0)+T|0;f[3225]=ba;f[3228]=ga;f[ga+4>>2]=ba|1}while(0);o=ca+8|0;u=b;return o|0}ga=13336;while(1){T=f[ga>>2]|0;if(T>>>0<=ha>>>0?(ua=T+(f[ga+4>>2]|0)|0,ua>>>0>ha>>>0):0)break;ga=f[ga+8>>2]|0}ga=ua+-47|0;ca=ga+8|0;T=ga+((ca&7|0)==0?0:0-ca&7)|0;ca=ha+16|0;ga=T>>>0>>0?ha:T;T=ga+8|0;c=da+8|0;aa=(c&7|0)==0?0:0-c&7;c=da+aa|0;fa=ea+-40-aa|0;f[3228]=c;f[3225]=fa;f[c+4>>2]=fa|1;f[c+fa+4>>2]=40;f[3229]=f[3344];fa=ga+4|0;f[fa>>2]=27;f[T>>2]=f[3334];f[T+4>>2]=f[3335];f[T+8>>2]=f[3336];f[T+12>>2]=f[3337];f[3334]=da;f[3335]=ea;f[3337]=0;f[3336]=T;T=ga+24|0;do{c=T;T=T+4|0;f[T>>2]=7}while((c+8|0)>>>0>>0);if((ga|0)!=(ha|0)){T=ga-ha|0;f[fa>>2]=f[fa>>2]&-2;f[ha+4>>2]=T|1;f[ga>>2]=T;c=T>>>3;if(T>>>0<256){aa=12928+(c<<1<<2)|0;ba=f[3222]|0;s=1<>2]|0}f[va>>2]=ha;f[wa+12>>2]=ha;f[ha+8>>2]=wa;f[ha+12>>2]=aa;break}aa=T>>>8;if(aa)if(T>>>0>16777215)xa=31;else{s=(aa+1048320|0)>>>16&8;ba=aa<>>16&4;c=ba<>>16&2;Y=14-(aa|s|ba)+(c<>>15)|0;xa=T>>>(Y+7|0)&1|Y<<1}else xa=0;Y=13192+(xa<<2)|0;f[ha+28>>2]=xa;f[ha+20>>2]=0;f[ca>>2]=0;ba=f[3223]|0;c=1<>2]=ha;f[ha+24>>2]=Y;f[ha+12>>2]=ha;f[ha+8>>2]=ha;break}c=T<<((xa|0)==31?0:25-(xa>>>1)|0);ba=f[Y>>2]|0;while(1){if((f[ba+4>>2]&-8|0)==(T|0)){H=216;break}ya=ba+16+(c>>>31<<2)|0;Y=f[ya>>2]|0;if(!Y){H=215;break}else{c=c<<1;ba=Y}}if((H|0)==215){f[ya>>2]=ha;f[ha+24>>2]=ba;f[ha+12>>2]=ha;f[ha+8>>2]=ha;break}else if((H|0)==216){c=ba+8|0;T=f[c>>2]|0;f[T+12>>2]=ha;f[c>>2]=ha;f[ha+8>>2]=T;f[ha+12>>2]=ba;f[ha+24>>2]=0;break}}}else{T=f[3226]|0;if((T|0)==0|da>>>0>>0)f[3226]=da;f[3334]=da;f[3335]=ea;f[3337]=0;f[3231]=f[3340];f[3230]=-1;T=0;do{c=12928+(T<<1<<2)|0;f[c+12>>2]=c;f[c+8>>2]=c;T=T+1|0}while((T|0)!=32);T=da+8|0;ba=(T&7|0)==0?0:0-T&7;T=da+ba|0;c=ea+-40-ba|0;f[3228]=T;f[3225]=c;f[T+4>>2]=c|1;f[T+c+4>>2]=40;f[3229]=f[3344]}while(0);ea=f[3225]|0;if(ea>>>0>B>>>0){da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1)+L|0;J=f[v>>2]|0;W=f[J+12>>2]|0;f[W+(X<<2)>>2]=K;f[W+(K<<2)>>2]=X;W=J+24|0;O=J+28|0;S=f[O>>2]|0;if((S|0)==(f[J+32>>2]|0)){yf(W,2336);_=f[O>>2]|0}else{f[S>>2]=-1;J=S+4|0;f[O>>2]=J;_=J}J=_-(f[W>>2]|0)>>2;W=J+-1|0;O=f[v>>2]|0;S=f[O+24>>2]|0;Q=S;if(((f[O+28>>2]|0)-S>>2|0)>(q|0)){M=-1;I=175;break a}S=f[O>>2]|0;f[S+(X<<2)>>2]=W;if(J|0)f[Q+(W<<2)>>2]=X;if((K|0)!=-1){X=(((K>>>0)%3|0|0)==0?2:-1)+K|0;if((X|0)!=-1){W=f[S+(X<<2)>>2]|0;f[S+(U<<2)>>2]=W;if((W|0)!=-1)f[Q+(W<<2)>>2]=U}else f[S+(U<<2)>>2]=-1;W=K+1|0;Q=((W>>>0)%3|0|0)==0?K+-2|0:W;if((Q|0)==-1)aa=-1;else aa=f[S+(Q<<2)>>2]|0}else{f[S+(U<<2)>>2]=-1;aa=-1}f[S+(N<<2)>>2]=aa;N=f[l>>2]|0;f[N+-4>>2]=L;ba=N;I=113;break b;break}case 1:break;default:{M=-1;I=175;break a}}N=f[g>>2]|0;L=f[l>>2]|0;if((N|0)==(L|0)){M=-1;I=175;break a}S=L+-4|0;U=f[S>>2]|0;f[l>>2]=S;Q=f[C>>2]|0;c:do if(Q){W=Q+-1|0;K=(W&Q|0)==0;if(!K)if(F>>>0>>0)ca=F;else ca=(F>>>0)%(Q>>>0)|0;else ca=W&F;X=f[(f[h>>2]|0)+(ca<<2)>>2]|0;if((X|0)!=0?(J=f[X>>2]|0,(J|0)!=0):0){d:do if(K){X=J;while(1){O=f[X+4>>2]|0;R=(O|0)==(F|0);if(!(R|(O&W|0)==(ca|0))){da=N;ea=S;break c}if(R?(f[X+8>>2]|0)==(F|0):0){fa=X;break d}X=f[X>>2]|0;if(!X){da=N;ea=S;break c}}}else{X=J;while(1){R=f[X+4>>2]|0;if((R|0)==(F|0)){if((f[X+8>>2]|0)==(F|0)){fa=X;break d}}else{if(R>>>0>>0)ga=R;else ga=(R>>>0)%(Q>>>0)|0;if((ga|0)!=(ca|0)){da=N;ea=S;break c}}X=f[X>>2]|0;if(!X){da=N;ea=S;break c}}}while(0);J=fa+12|0;if((S|0)==(f[w>>2]|0)){yf(g,J);da=f[g>>2]|0;ea=f[l>>2]|0;break}else{f[S>>2]=f[J>>2];f[l>>2]=L;da=N;ea=L;break}}else{da=N;ea=S}}else{da=N;ea=S}while(0);if((da|0)==(ea|0)){M=-1;I=175;break a}S=f[ea+-4>>2]|0;N=(S|0)==-1;if(!N?(f[(f[(f[v>>2]|0)+12>>2]|0)+(S<<2)>>2]|0)!=-1:0){M=-1;I=175;break a}L=(U|0)==-1;Q=f[v>>2]|0;J=f[Q+12>>2]|0;if(!L?(f[J+(U<<2)>>2]|0)!=-1:0){M=-1;I=175;break a}W=F*3|0;K=W+2|0;f[J+(S<<2)>>2]=K;f[J+(K<<2)>>2]=S;X=W+1|0;f[J+(U<<2)>>2]=X;f[J+(X<<2)>>2]=U;if(!N){N=(((S>>>0)%3|0|0)==0?2:-1)+S|0;if((N|0)==-1)ha=-1;else ha=f[(f[Q>>2]|0)+(N<<2)>>2]|0;N=f[Q>>2]|0;f[N+(W<<2)>>2]=ha;R=S+1|0;O=((R>>>0)%3|0|0)==0?S+-2|0:R;if((O|0)==-1){ia=N;ja=Q;ka=-1;la=ha}else{ia=N;ja=Q;ka=f[N+(O<<2)>>2]|0;la=ha}}else{O=f[Q>>2]|0;f[O+(W<<2)>>2]=-1;ia=O;ja=Q;ka=-1;la=-1}f[ia+(X<<2)>>2]=ka;if(!L){L=(((U>>>0)%3|0|0)==0?2:-1)+U|0;if((L|0)!=-1){X=f[ia+(L<<2)>>2]|0;f[ia+(K<<2)>>2]=X;if((X|0)!=-1)f[(f[Q+24>>2]|0)+(X<<2)>>2]=K}else f[ia+(K<<2)>>2]=-1;X=U+1|0;L=((X>>>0)%3|0|0)==0?U+-2|0:X;if((L|0)==-1){ma=-1;na=-1}else{ma=L;na=f[ia+(L<<2)>>2]|0}}else{f[ia+(K<<2)>>2]=-1;ma=-1;na=-1}f[e>>2]=na;K=f[D>>2]|0;L=K+(la<<2)|0;f[L>>2]=(f[L>>2]|0)+(f[K+(na<<2)>>2]|0);K=f[Q+24>>2]|0;if((la|0)!=-1)f[K+(la<<2)>>2]=f[K+(f[e>>2]<<2)>>2];e:do if((ma|0)!=-1){Q=f[ja>>2]|0;L=ma;do{f[Q+(L<<2)>>2]=la;X=L+1|0;O=((X>>>0)%3|0|0)==0?L+-2|0:X;if((O|0)==-1)break e;X=f[J+(O<<2)>>2]|0;O=X+1|0;if((X|0)==-1)break e;L=((O>>>0)%3|0|0)==0?X+-2|0:O}while((L|0)!=-1)}while(0);f[K+(f[e>>2]<<2)>>2]=-1;do if(o){J=f[m>>2]|0;if((J|0)==(f[E>>2]|0)){yf(i,e);oa=f[l>>2]|0;break}else{f[J>>2]=f[e>>2];f[m>>2]=J+4;oa=ea;break}}else oa=ea;while(0);f[oa+-4>>2]=W;f[j>>2]=f[oa+-4>>2];f[e>>2]=f[j>>2];lc(r,e)}while(0);if((I|0)==93){I=0;f[e>>2]=F*3;H=f[v>>2]|0;K=H+24|0;J=H+28|0;U=f[J>>2]|0;if((U|0)==(f[H+32>>2]|0)){yf(K,2336);pa=f[J>>2]|0}else{f[U>>2]=-1;H=U+4|0;f[J>>2]=H;pa=H}H=pa-(f[K>>2]|0)>>2;K=H+-1|0;J=f[v>>2]|0;U=f[e>>2]|0;L=f[J>>2]|0;f[L+(U<<2)>>2]=K;Q=J+24|0;O=J+28|0;X=f[O>>2]|0;if((X|0)==(f[J+32>>2]|0)){yf(Q,2336);qa=f[O>>2]|0;ra=f[J>>2]|0}else{f[X>>2]=-1;J=X+4|0;f[O>>2]=J;qa=J;ra=L}f[ra+(U+1<<2)>>2]=(qa-(f[Q>>2]|0)>>2)+-1;Q=f[v>>2]|0;U=(f[e>>2]|0)+2|0;L=Q+24|0;J=Q+28|0;O=f[J>>2]|0;if((O|0)==(f[Q+32>>2]|0)){yf(L,2336);sa=f[J>>2]|0}else{f[O>>2]=-1;X=O+4|0;f[J>>2]=X;sa=X}f[(f[Q>>2]|0)+(U<<2)>>2]=(sa-(f[L>>2]|0)>>2)+-1;L=f[v>>2]|0;U=f[L+24>>2]|0;Q=U;if(((f[L+28>>2]|0)-U>>2|0)>(q|0))break;U=f[e>>2]|0;if(H){f[Q+(K<<2)>>2]=U;if((H|0)!=-1){f[Q+(H<<2)>>2]=(f[e>>2]|0)+1;K=H+1|0;if((K|0)!=-1){ta=K;I=107}}else{ta=0;I=107}}else{f[Q+(H<<2)>>2]=U+1;ta=1;I=107}if((I|0)==107){I=0;f[Q+(ta<<2)>>2]=(f[e>>2]|0)+2}Q=f[l>>2]|0;if((Q|0)==(f[w>>2]|0)){yf(g,e);ua=f[l>>2]|0}else{f[Q>>2]=f[e>>2];U=Q+4|0;f[l>>2]=U;ua=U}ba=ua;I=113}f:do if((I|0)==113?(I=0,f[j>>2]=f[ba+-4>>2],f[e>>2]=f[j>>2],lc(r,e),U=c-F+-1|0,Q=f[y>>2]|0,(Q|0)!=(f[x>>2]|0)):0){H=Q;do{Q=H;K=f[Q+-8>>2]|0;if(K>>>0>U>>>0){M=-1;I=175;break a}if((K|0)!=(U|0))break f;K=b[Q+-4>>0]|0;L=f[Q+-12>>2]|0;f[y>>2]=Q+-12;if((L|0)<0){M=-1;I=175;break a}Q=f[(f[l>>2]|0)+-4>>2]|0;X=(Q|0)==-1;do if(!(K&1))if(!X)if(!((Q>>>0)%3|0)){va=Q+2|0;break}else{va=Q+-1|0;break}else va=-1;else{J=Q+1|0;if(X)va=-1;else va=((J>>>0)%3|0|0)==0?Q+-2|0:J}while(0);f[e>>2]=z-L;Q=nc(h,e)|0;f[Q>>2]=va;H=f[y>>2]|0}while((H|0)!=(f[x>>2]|0))}while(0);if((G|0)<(c|0))F=G;else{wa=v;xa=G;I=126;break a}}M=-1;I=175}else{wa=a+8|0;xa=0;I=126}while(0);g:do if((I|0)==126){c=f[wa>>2]|0;if(((f[c+28>>2]|0)-(f[c+24>>2]|0)>>2|0)<=(q|0)){va=f[l>>2]|0;do if((va|0)!=(f[g>>2]|0)){j=a+312|0;ba=a+60|0;ua=a+64|0;ta=a+68|0;sa=a+76|0;qa=a+80|0;ra=a+72|0;pa=va;oa=xa;h:while(1){ea=pa;f[e>>2]=f[ea+-4>>2];f[l>>2]=ea+-4;do if(!(Xg(j)|0)){ea=f[ua>>2]|0;o=f[ta>>2]|0;if((ea|0)==(o<<5|0)){if((ea+1|0)<0){I=154;break h}la=o<<6;o=ea+32&-32;bf(ba,ea>>>0<1073741823?(la>>>0>>0?o:la):2147483647);ya=f[ua>>2]|0}else ya=ea;f[ua>>2]=ya+1;ea=(f[ba>>2]|0)+(ya>>>5<<2)|0;f[ea>>2]=f[ea>>2]&~(1<<(ya&31));ea=f[sa>>2]|0;if((ea|0)==(f[qa>>2]|0)){yf(ra,e);za=oa;break}else{f[ea>>2]=f[e>>2];f[sa>>2]=ea+4;za=oa;break}}else{ea=f[wa>>2]|0;la=f[ea>>2]|0;o=la;if((oa|0)>=(((f[ea+4>>2]|0)-la>>2>>>0)/3|0|0)){I=160;break h}la=f[e>>2]|0;ma=la+1|0;if((la|0)!=-1?(ja=((ma>>>0)%3|0|0)==0?la+-2|0:ma,(ja|0)!=-1):0)Aa=f[o+(ja<<2)>>2]|0;else Aa=-1;ja=f[ea+24>>2]|0;ma=f[ja+(Aa<<2)>>2]|0;na=ma+1|0;if((ma|0)!=-1?(ia=((na>>>0)%3|0|0)==0?ma+-2|0:na,na=ia+1|0,(ia|0)!=-1):0){ma=((na>>>0)%3|0|0)==0?ia+-2|0:na;if((ma|0)==-1){Ba=ia;Ca=-1}else{Ba=ia;Ca=f[o+(ma<<2)>>2]|0}}else{Ba=-1;Ca=-1}ma=f[ja+(Ca<<2)>>2]|0;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==(f[qa>>2]|0))yf(ra,k);else{f[ia>>2]=f[k>>2];f[sa>>2]=ia+4}za=ma}while(0);pa=f[l>>2]|0;if((pa|0)==(f[g>>2]|0)){I=161;break}else oa=za}if((I|0)==144)ym(ba);else if((I|0)==154)ym(ba);else if((I|0)==160){M=-1;I=175;break g}else if((I|0)==161){Ja=f[wa>>2]|0;Ka=za;break}}else{Ja=c;Ka=xa}while(0);if((Ka|0)==(((f[Ja+4>>2]|0)-(f[Ja>>2]|0)>>2>>>0)/3|0|0)){c=(f[Ja+28>>2]|0)-(f[Ja+24>>2]|0)>>2;va=f[i>>2]|0;oa=f[m>>2]|0;if((va|0)==(oa|0)){La=va;Ma=c}else{pa=e+4|0;sa=e+8|0;ra=e+12|0;qa=Ja;ua=va;va=c;while(1){c=f[ua>>2]|0;ta=va+-1|0;j=f[qa+24>>2]|0;if((f[j+(ta<<2)>>2]|0)==-1){G=va;while(1){ma=G+-1|0;ia=G+-2|0;if((f[j+(ia<<2)>>2]|0)==-1)G=ma;else{Na=ma;Oa=ia;break}}}else{Na=va;Oa=ta}if(Oa>>>0>>0){Pa=qa;Qa=Na}else{f[e>>2]=qa;G=f[j+(Oa<<2)>>2]|0;f[pa>>2]=G;f[sa>>2]=G;b[ra>>0]=1;if((G|0)==-1)Ra=qa;else{ba=qa;ia=G;while(1){f[(f[ba>>2]|0)+(ia<<2)>>2]=c;Ee(e);ia=f[sa>>2]|0;G=f[wa>>2]|0;if((ia|0)==-1){Ra=G;break}else ba=G}}ba=f[Ra+24>>2]|0;if((c|0)==-1)Sa=ba+(Oa<<2)|0;else{ia=ba+(Oa<<2)|0;f[ba+(c<<2)>>2]=f[ia>>2];Sa=ia}f[Sa>>2]=-1;ia=f[p>>2]|0;ba=ia+(Oa>>>5<<2)|0;j=1<<(Oa&31);ta=ia+(c>>>5<<2)|0;ia=1<<(c&31);G=f[ta>>2]|0;f[ta>>2]=f[ba>>2]&j|0?G|ia:G&~ia;f[ba>>2]=f[ba>>2]&~j;P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)==(f[a+220>>2]|0);p=a+120|0;q=f[a+124>>2]|0;a:do if((c|0)>0){r=a+308|0;s=g+4|0;t=a+8|0;v=i+8|0;w=e+8|0;x=a+304|0;y=a+296|0;z=a+300|0;A=a+36|0;B=a+40|0;C=c+-1|0;D=0;b:while(1){E=D+1|0;c:do if(!(b[r>>0]|0))F=43;else{G=f[x>>2]|0;H=f[y>>2]|0;I=f[z>>2]|0;J=H+(G>>>3)|0;if(J>>>0>>0?(K=h[J>>0]|0,J=G+1|0,f[x>>2]=J,K&1<<(G&7)|0):0){K=H+(J>>>3)|0;if(K>>>0>>0){L=(h[K>>0]|0)>>>(J&7)&1;K=G+2|0;f[x>>2]=K;M=K;N=L}else{M=J;N=0}J=H+(M>>>3)|0;if(J>>>0>>0){I=(h[J>>0]|0)>>>(M&7);f[x>>2]=M+1;O=I<<1&2}else O=0;I=(O|N)<<1|1;J=(I|0)==5;switch(I&7){case 1:{F=43;break c;break}case 3:case 5:{I=f[l>>2]|0;if((f[e>>2]|0)==(I|0)){P=-1;F=179;break a}H=f[I+-4>>2]|0;I=D*3|0;L=J?I:I+2|0;K=(J&1)+I|0;G=(J?2:1)+I|0;J=f[t>>2]|0;Q=f[J+12>>2]|0;f[Q+(G<<2)>>2]=H;f[Q+(H<<2)>>2]=G;Q=J+24|0;R=J+28|0;S=f[R>>2]|0;if((S|0)==(f[J+32>>2]|0)){yf(Q,2336);T=f[R>>2]|0}else{f[S>>2]=-1;J=S+4|0;f[R>>2]=J;T=J}J=T-(f[Q>>2]|0)>>2;Q=J+-1|0;R=f[t>>2]|0;S=f[R+24>>2]|0;U=S;if(((f[R+28>>2]|0)-S>>2|0)>(q|0)){P=-1;F=179;break a}S=f[R>>2]|0;f[S+(G<<2)>>2]=Q;if(J|0)f[U+(Q<<2)>>2]=G;if((H|0)!=-1){G=(((H>>>0)%3|0|0)==0?2:-1)+H|0;if((G|0)!=-1){Q=f[S+(G<<2)>>2]|0;f[S+(L<<2)>>2]=Q;if((Q|0)!=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==(f[w>>2]|0))yf(e,j);else{f[Q>>2]=f[j>>2];f[l>>2]=Q+4}break}default:{F=178;break b}}Q=c-D+-1|0;L=f[B>>2]|0;if((L|0)==(f[A>>2]|0))break;else aa=L;while(1){L=aa;I=f[L+-8>>2]|0;if(I>>>0>Q>>>0){P=-1;F=179;break a}if((I|0)!=(Q|0))break c;I=b[L+-4>>0]|0;K=f[L+-12>>2]|0;f[B>>2]=L+-12;if((K|0)<0){P=-1;F=179;break a}L=f[(f[l>>2]|0)+-4>>2]|0;U=(L|0)==-1;do if(!(I&1))if(!U)if(!((L>>>0)%3|0)){ba=L+2|0;break}else{ba=L+-1|0;break}else ba=-1;else{G=L+1|0;if(U)ba=-1;else ba=((G>>>0)%3|0|0)==0?L+-2|0:G}while(0);f[j>>2]=C-K;L=nc(g,j)|0;f[L>>2]=ba;aa=f[B>>2]|0;if((aa|0)==(f[A>>2]|0))break c}}Q=f[l>>2]|0;if((f[e>>2]|0)==(Q|0)){P=-1;F=179;break a}L=Q+-4|0;Q=f[L>>2]|0;U=f[t>>2]|0;I=(Q|0)==-1;G=Q+1|0;if(!I?(S=((G>>>0)%3|0|0)==0?Q+-2|0:G,(S|0)!=-1):0)ca=f[(f[U>>2]|0)+(S<<2)>>2]|0;else ca=-1;S=f[U+24>>2]|0;G=f[S+(ca<<2)>>2]|0;H=G+1|0;if((G|0)==-1)da=-1;else da=((H>>>0)%3|0|0)==0?G+-2|0:H;H=D*3|0;G=H+1|0;J=f[U+12>>2]|0;f[J+(Q<<2)>>2]=G;f[J+(G<<2)>>2]=Q;R=H+2|0;f[J+(da<<2)>>2]=R;f[J+(R<<2)>>2]=da;J=f[U>>2]|0;f[J+(H<<2)>>2]=ca;U=da+1|0;if((da|0)!=-1?(ea=((U>>>0)%3|0|0)==0?da+-2|0:U,(ea|0)!=-1):0)fa=f[J+(ea<<2)>>2]|0;else fa=-1;f[J+(G<<2)>>2]=fa;if(!I?(I=(((Q>>>0)%3|0|0)==0?2:-1)+Q|0,(I|0)!=-1):0){Q=f[J+(I<<2)>>2]|0;f[J+(R<<2)>>2]=Q;if((Q|0)!=-1)f[S+(Q<<2)>>2]=R}else f[J+(R<<2)>>2]=-1;R=(f[p>>2]|0)+(ca>>>5<<2)|0;f[R>>2]=f[R>>2]&~(1<<(ca&31));f[L>>2]=H}while(0);if((F|0)==43){F=0;H=f[e>>2]|0;L=f[l>>2]|0;if((H|0)==(L|0)){P=-1;F=179;break a}R=L+-4|0;J=f[R>>2]|0;f[l>>2]=R;Q=f[s>>2]|0;d:do if(Q){S=Q+-1|0;I=(S&Q|0)==0;if(!I)if(D>>>0>>0)ga=D;else ga=(D>>>0)%(Q>>>0)|0;else ga=S&D;G=f[(f[g>>2]|0)+(ga<<2)>>2]|0;if((G|0)!=0?(ea=f[G>>2]|0,(ea|0)!=0):0){e:do if(I){G=ea;while(1){U=f[G+4>>2]|0;ha=(U|0)==(D|0);if(!(ha|(U&S|0)==(ga|0))){ia=H;ja=R;break d}if(ha?(f[G+8>>2]|0)==(D|0):0){ka=G;break e}G=f[G>>2]|0;if(!G){ia=H;ja=R;break d}}}else{G=ea;while(1){K=f[G+4>>2]|0;if((K|0)==(D|0)){if((f[G+8>>2]|0)==(D|0)){ka=G;break e}}else{if(K>>>0>>0)la=K;else la=(K>>>0)%(Q>>>0)|0;if((la|0)!=(ga|0)){ia=H;ja=R;break d}}G=f[G>>2]|0;if(!G){ia=H;ja=R;break d}}}while(0);ea=ka+12|0;if((R|0)==(f[w>>2]|0)){yf(e,ea);ia=f[e>>2]|0;ja=f[l>>2]|0;break}else{f[R>>2]=f[ea>>2];f[l>>2]=L;ia=H;ja=L;break}}else{ia=H;ja=R}}else{ia=H;ja=R}while(0);if((ia|0)==(ja|0)){P=-1;F=179;break a}R=f[ja+-4>>2]|0;H=(R|0)==-1;if(!H?(f[(f[(f[t>>2]|0)+12>>2]|0)+(R<<2)>>2]|0)!=-1:0){P=-1;F=179;break a}L=(J|0)==-1;Q=f[t>>2]|0;ea=f[Q+12>>2]|0;if(!L?(f[ea+(J<<2)>>2]|0)!=-1:0){P=-1;F=179;break a}S=D*3|0;I=S+2|0;f[ea+(R<<2)>>2]=I;f[ea+(I<<2)>>2]=R;G=S+1|0;f[ea+(J<<2)>>2]=G;f[ea+(G<<2)>>2]=J;if(!H){H=(((R>>>0)%3|0|0)==0?2:-1)+R|0;if((H|0)==-1)ma=-1;else ma=f[(f[Q>>2]|0)+(H<<2)>>2]|0;H=f[Q>>2]|0;f[H+(S<<2)>>2]=ma;K=R+1|0;ha=((K>>>0)%3|0|0)==0?R+-2|0:K;if((ha|0)==-1){na=H;oa=Q;pa=-1;qa=ma}else{na=H;oa=Q;pa=f[H+(ha<<2)>>2]|0;qa=ma}}else{ha=f[Q>>2]|0;f[ha+(S<<2)>>2]=-1;na=ha;oa=Q;pa=-1;qa=-1}f[na+(G<<2)>>2]=pa;if(!L){L=(((J>>>0)%3|0|0)==0?2:-1)+J|0;if((L|0)!=-1){G=f[na+(L<<2)>>2]|0;f[na+(I<<2)>>2]=G;if((G|0)!=-1)f[(f[Q+24>>2]|0)+(G<<2)>>2]=I}else f[na+(I<<2)>>2]=-1;G=J+1|0;L=((G>>>0)%3|0|0)==0?J+-2|0:G;if((L|0)==-1){ra=-1;sa=-1}else{ra=L;sa=f[na+(L<<2)>>2]|0}}else{f[na+(I<<2)>>2]=-1;ra=-1;sa=-1}f[j>>2]=sa;I=f[Q+24>>2]|0;if((qa|0)!=-1)f[I+(qa<<2)>>2]=f[I+(sa<<2)>>2];f:do if((ra|0)!=-1){Q=f[oa>>2]|0;L=ra;do{f[Q+(L<<2)>>2]=qa;G=L+1|0;ha=((G>>>0)%3|0|0)==0?L+-2|0:G;if((ha|0)==-1)break f;G=f[ea+(ha<<2)>>2]|0;ha=G+1|0;if((G|0)==-1)break f;L=((ha>>>0)%3|0|0)==0?G+-2|0:ha}while((L|0)!=-1)}while(0);f[I+(f[j>>2]<<2)>>2]=-1;do if(o){ea=f[m>>2]|0;if((ea|0)==(f[v>>2]|0)){yf(i,j);ta=f[l>>2]|0;break}else{f[ea>>2]=f[j>>2];f[m>>2]=ea+4;ta=ja;break}}else ta=ja;while(0);f[ta+-4>>2]=S}if((E|0)<(c|0))D=E;else{ua=t;va=E;F=129;break a}}if((F|0)==114){P=-1;F=179;break}}else{ua=a+8|0;va=0;F=129}while(0);g:do if((F|0)==129){c=f[ua>>2]|0;if(((f[c+28>>2]|0)-(f[c+24>>2]|0)>>2|0)<=(q|0)){ta=f[l>>2]|0;do if((ta|0)!=(f[e>>2]|0)){ja=a+312|0;o=a+60|0;qa=a+64|0;ra=a+68|0;oa=a+76|0;sa=a+80|0;na=a+72|0;pa=ta;ma=va;h:while(1){ia=pa;f[j>>2]=f[ia+-4>>2];f[l>>2]=ia+-4;do if(!(Xg(ja)|0)){ia=f[qa>>2]|0;ka=f[ra>>2]|0;if((ia|0)==(ka<<5|0)){if((ia+1|0)<0){F=157;break h}ga=ka<<6;ka=ia+32&-32;bf(o,ia>>>0<1073741823?(ga>>>0>>0?ka:ga):2147483647);wa=f[qa>>2]|0}else wa=ia;f[qa>>2]=wa+1;ia=(f[o>>2]|0)+(wa>>>5<<2)|0;f[ia>>2]=f[ia>>2]&~(1<<(wa&31));ia=f[oa>>2]|0;if((ia|0)==(f[sa>>2]|0)){yf(na,j);xa=ma;break}else{f[ia>>2]=f[j>>2];f[oa>>2]=ia+4;xa=ma;break}}else{ia=f[ua>>2]|0;ga=f[ia>>2]|0;ka=ga;if((ma|0)>=(((f[ia+4>>2]|0)-ga>>2>>>0)/3|0|0)){F=163;break h}ga=f[j>>2]|0;la=ga+1|0;if((ga|0)!=-1?(ca=((la>>>0)%3|0|0)==0?ga+-2|0:la,(ca|0)!=-1):0)ya=f[ka+(ca<<2)>>2]|0;else ya=-1;ca=f[ia+24>>2]|0;la=f[ca+(ya<<2)>>2]|0;fa=la+1|0;if((la|0)!=-1?(da=((fa>>>0)%3|0|0)==0?la+-2|0:fa,fa=da+1|0,(da|0)!=-1):0){la=((fa>>>0)%3|0|0)==0?da+-2|0:fa;if((la|0)==-1){za=da;Aa=-1}else{za=da;Aa=f[ka+(la<<2)>>2]|0}}else{za=-1;Aa=-1}la=f[ca+(Aa<<2)>>2]|0;ca=la+1|0;if((la|0)!=-1?(da=((ca>>>0)%3|0|0)==0?la+-2|0:ca,ca=da+1|0,(da|0)!=-1):0){la=((ca>>>0)%3|0|0)==0?da+-2|0:ca;if((la|0)==-1){Ba=da;Ca=-1}else{Ba=da;Ca=f[ka+(la<<2)>>2]|0}}else{Ba=-1;Ca=-1}la=ma*3|0;f[k>>2]=la;da=f[ia+12>>2]|0;f[da+(la<<2)>>2]=ga;f[da+(ga<<2)>>2]=la;la=(f[k>>2]|0)+1|0;f[da+(la<<2)>>2]=za;f[da+(za<<2)>>2]=la;la=(f[k>>2]|0)+2|0;f[da+(la<<2)>>2]=Ba;f[da+(Ba<<2)>>2]=la;la=f[k>>2]|0;da=ka+(la<<2)|0;f[da>>2]=Aa;f[ka+(la+1<<2)>>2]=Ca;f[ka+(la+2<<2)>>2]=ya;if((la|0)==-1)Da=-1;else Da=f[da>>2]|0;da=f[p>>2]|0;la=da+(Da>>>5<<2)|0;f[la>>2]=f[la>>2]&~(1<<(Da&31));la=(f[k>>2]|0)+1|0;if((la|0)==-1)Ea=-1;else Ea=f[ka+(la<<2)>>2]|0;la=da+(Ea>>>5<<2)|0;f[la>>2]=f[la>>2]&~(1<<(Ea&31));la=(f[k>>2]|0)+2|0;if((la|0)==-1)Fa=-1;else Fa=f[ka+(la<<2)>>2]|0;la=da+(Fa>>>5<<2)|0;f[la>>2]=f[la>>2]&~(1<<(Fa&31));la=ma+1|0;da=f[qa>>2]|0;ka=f[ra>>2]|0;if((da|0)==(ka<<5|0)){if((da+1|0)<0){F=147;break h}ga=ka<<6;ka=da+32&-32;bf(o,da>>>0<1073741823?(ga>>>0>>0?ka:ga):2147483647);Ga=f[qa>>2]|0}else Ga=da;f[qa>>2]=Ga+1;da=(f[o>>2]|0)+(Ga>>>5<<2)|0;f[da>>2]=f[da>>2]|1<<(Ga&31);da=f[oa>>2]|0;if((da|0)==(f[sa>>2]|0))yf(na,k);else{f[da>>2]=f[k>>2];f[oa>>2]=da+4}xa=la}while(0);pa=f[l>>2]|0;if((pa|0)==(f[e>>2]|0)){F=164;break}else ma=xa}if((F|0)==147)ym(o);else if((F|0)==157)ym(o);else if((F|0)==163){P=-1;F=179;break g}else if((F|0)==164){Ha=f[ua>>2]|0;Ia=xa;break}}else{Ha=c;Ia=va}while(0);if((Ia|0)==(((f[Ha+4>>2]|0)-(f[Ha>>2]|0)>>2>>>0)/3|0|0)){c=(f[Ha+28>>2]|0)-(f[Ha+24>>2]|0)>>2;ta=f[i>>2]|0;ma=f[m>>2]|0;if((ta|0)==(ma|0)){Ja=ta;Ka=c}else{pa=j+4|0;oa=j+8|0;na=j+12|0;sa=Ha;qa=ta;ta=c;while(1){c=f[qa>>2]|0;ra=ta+-1|0;ja=f[sa+24>>2]|0;if((f[ja+(ra<<2)>>2]|0)==-1){E=ta;while(1){S=E+-1|0;la=E+-2|0;if((f[ja+(la<<2)>>2]|0)==-1)E=S;else{La=S;Ma=la;break}}}else{La=ta;Ma=ra}if(Ma>>>0>>0){Na=sa;Oa=La}else{f[j>>2]=sa;E=f[ja+(Ma<<2)>>2]|0;f[pa>>2]=E;f[oa>>2]=E;b[na>>0]=1;if((E|0)==-1)Pa=sa;else{o=sa;la=E;while(1){f[(f[o>>2]|0)+(la<<2)>>2]=c;Ee(j);la=f[oa>>2]|0;E=f[ua>>2]|0;if((la|0)==-1){Pa=E;break}else o=E}}o=f[Pa+24>>2]|0;if((c|0)==-1)Qa=o+(Ma<<2)|0;else{la=o+(Ma<<2)|0;f[o+(c<<2)>>2]=f[la>>2];Qa=la}f[Qa>>2]=-1;la=f[p>>2]|0;o=la+(Ma>>>5<<2)|0;ja=1<<(Ma&31);ra=la+(c>>>5<<2)|0;la=1<<(c&31);E=f[ra>>2]|0;f[ra>>2]=f[o>>2]&ja|0?E|la:E&~la;f[o>>2]=f[o>>2]&~ja;Na=Pa;Oa=La+-1|0}qa=qa+4|0;if((qa|0)==(ma|0)){P=Oa;F=179;break}else{sa=Na;ta=Oa}}}}else{P=-1;F=179}}else{P=-1;F=179}}while(0);if((F|0)==179){Ja=f[i>>2]|0;Ka=P}if(Ja|0){P=f[m>>2]|0;if((P|0)!=(Ja|0))f[m>>2]=P+(~((P+-4-Ja|0)>>>2)<<2);fn(Ja)}Ja=f[g+8>>2]|0;if(Ja|0){P=Ja;do{Ja=P;P=f[P>>2]|0;fn(Ja)}while((P|0)!=0)}P=f[g>>2]|0;f[g>>2]=0;if(P|0)fn(P);P=f[e>>2]|0;if(!P){u=d;return Ka|0}e=f[l>>2]|0;if((e|0)!=(P|0))f[l>>2]=e+(~((e+-4-P|0)>>>2)<<2);fn(P);u=d;return Ka|0}function Za(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;b=u;u=u+16|0;c=b;d=b+8|0;e=b+4|0;f[d>>2]=a;do if(a>>>0>=212){g=(a>>>0)/210|0;h=g*210|0;f[e>>2]=a-h;i=(Rh(3400,3592,e,c)|0)-3400>>2;j=g;g=h;h=0;a:while(1){k=(f[3400+(i<<2)>>2]|0)+g|0;l=5;while(1){if(l>>>0>=47){m=211;n=h;o=8;break}p=f[3208+(l<<2)>>2]|0;q=(k>>>0)/(p>>>0)|0;if(q>>>0

>>0){o=106;break a}if((k|0)==(X(q,p)|0)){r=h;break}else l=l+1|0}b:do if((o|0)==8){c:while(1){o=0;l=(k>>>0)/(m>>>0)|0;do if(l>>>0>=m>>>0)if((k|0)!=(X(l,m)|0)){p=m+10|0;q=(k>>>0)/(p>>>0)|0;if(q>>>0>=p>>>0)if((k|0)!=(X(q,p)|0)){q=m+12|0;s=(k>>>0)/(q>>>0)|0;if(s>>>0>=q>>>0)if((k|0)!=(X(s,q)|0)){s=m+16|0;t=(k>>>0)/(s>>>0)|0;if(t>>>0>=s>>>0)if((k|0)!=(X(t,s)|0)){t=m+18|0;v=(k>>>0)/(t>>>0)|0;if(v>>>0>=t>>>0)if((k|0)!=(X(v,t)|0)){v=m+22|0;w=(k>>>0)/(v>>>0)|0;if(w>>>0>=v>>>0)if((k|0)!=(X(w,v)|0)){w=m+28|0;x=(k>>>0)/(w>>>0)|0;if(x>>>0>=w>>>0)if((k|0)==(X(x,w)|0)){y=9;z=w;A=n}else{x=m+30|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+36|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+40|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+42|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+46|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+52|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+58|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+60|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+66|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+70|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+72|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+78|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+82|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+88|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+96|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+100|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+102|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+106|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+108|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+112|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+120|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+126|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+130|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+136|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+138|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+142|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+148|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+150|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+156|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+162|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+166|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+168|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+172|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+178|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+180|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+186|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+190|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+192|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+196|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+198|0;B=(k>>>0)/(x>>>0)|0;if(B>>>0>>0){y=1;z=x;A=k;break}if((k|0)==(X(B,x)|0)){y=9;z=x;A=n;break}x=m+208|0;B=(k>>>0)/(x>>>0)|0;C=B>>>0>>0;D=(k|0)==(X(B,x)|0);y=C?1:D?9:0;z=C|D?x:m+210|0;A=C?k:n}else{y=1;z=w;A=k}}else{y=9;z=v;A=n}else{y=1;z=v;A=k}}else{y=9;z=t;A=n}else{y=1;z=t;A=k}}else{y=9;z=s;A=n}else{y=1;z=s;A=k}}else{y=9;z=q;A=n}else{y=1;z=q;A=k}}else{y=9;z=p;A=n}else{y=1;z=p;A=k}}else{y=9;z=m;A=n}else{y=1;z=m;A=k}while(0);switch(y&15){case 9:{r=A;break b;break}case 0:{m=z;n=A;o=8;break}default:break c}}if(!y)r=A;else{o=107;break a}}while(0);l=i+1|0;p=(l|0)==48;q=(p&1)+j|0;i=p?0:l;j=q;g=q*210|0;h=r}if((o|0)==106){f[d>>2]=k;E=k;break}else if((o|0)==107){f[d>>2]=k;E=A;break}}else{h=Rh(3208,3400,d,c)|0;E=f[h>>2]|0}while(0);u=b;return E|0}function _a(a,c,e,g){a=a|0;c=c|0;e=e|0;g=g|0;var i=0,k=0,l=0,m=0,o=0,q=0,r=0,s=Ja,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;if(!g){i=0;return i|0}do switch(f[a+28>>2]|0){case 1:{k=a+24|0;l=b[k>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){m=f[f[a>>2]>>2]|0;o=a+40|0;q=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;r=Tj(q|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=m+r|0;if(!(b[a+32>>0]|0)){r=0;m=o;while(1){s=$(b[m>>0]|0);n[g+(r<<2)>>2]=s;r=r+1|0;q=b[k>>0]|0;if((r|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){t=q;break}else m=m+1|0}}else{m=0;r=o;while(1){s=$($(b[r>>0]|0)/$(127.0));n[g+(m<<2)>>2]=s;m=m+1|0;q=b[k>>0]|0;if((m|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){t=q;break}else r=r+1|0}}}else t=l;r=t<<24>>24;if(t<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(r<<2)|0,0,(e<<24>>24)-r<<2|0)|0;i=1;return i|0}case 2:{r=a+24|0;m=b[r>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0){k=f[f[a>>2]>>2]|0;o=a+40|0;q=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;u=Tj(q|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=k+u|0;if(!(b[a+32>>0]|0)){u=0;k=o;while(1){s=$(h[k>>0]|0);n[g+(u<<2)>>2]=s;u=u+1|0;q=b[r>>0]|0;if((u|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){v=q;break}else k=k+1|0}}else{k=0;u=o;while(1){s=$($(h[u>>0]|0)/$(255.0));n[g+(k<<2)>>2]=s;k=k+1|0;l=b[r>>0]|0;if((k|0)>=((l<<24>>24>e<<24>>24?e:l)<<24>>24|0)){v=l;break}else u=u+1|0}}}else v=m;u=v<<24>>24;if(v<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(u<<2)|0,0,(e<<24>>24)-u<<2|0)|0;i=1;return i|0}case 3:{u=a+48|0;k=f[u>>2]|0;r=f[u+4>>2]|0;u=a+40|0;o=(Tj(lj(f[u>>2]|0,f[u+4>>2]|0,f[c>>2]|0,0)|0,I|0,k|0,r|0)|0)+(f[f[a>>2]>>2]|0)|0;r=a+24|0;k=b[r>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0)if(!(b[a+32>>0]|0)){u=0;l=o;while(1){s=$(d[l>>1]|0);n[g+(u<<2)>>2]=s;u=u+1|0;q=b[r>>0]|0;if((u|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){w=q;break}else l=l+2|0}}else{l=0;u=o;while(1){s=$($(d[u>>1]|0)/$(32767.0));n[g+(l<<2)>>2]=s;l=l+1|0;m=b[r>>0]|0;if((l|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){w=m;break}else u=u+2|0}}else w=k;u=w<<24>>24;if(w<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(u<<2)|0,0,(e<<24>>24)-u<<2|0)|0;i=1;return i|0}case 4:{u=a+48|0;l=f[u>>2]|0;r=f[u+4>>2]|0;u=a+40|0;o=(Tj(lj(f[u>>2]|0,f[u+4>>2]|0,f[c>>2]|0,0)|0,I|0,l|0,r|0)|0)+(f[f[a>>2]>>2]|0)|0;r=a+24|0;l=b[r>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0)if(!(b[a+32>>0]|0)){u=0;m=o;while(1){s=$(j[m>>1]|0);n[g+(u<<2)>>2]=s;u=u+1|0;q=b[r>>0]|0;if((u|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){x=q;break}else m=m+2|0}}else{m=0;u=o;while(1){s=$($(j[u>>1]|0)/$(65535.0));n[g+(m<<2)>>2]=s;m=m+1|0;k=b[r>>0]|0;if((m|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){x=k;break}else u=u+2|0}}else x=l;u=x<<24>>24;if(x<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(u<<2)|0,0,(e<<24>>24)-u<<2|0)|0;i=1;return i|0}case 5:{u=a+48|0;m=f[u>>2]|0;r=f[u+4>>2]|0;u=a+40|0;o=(Tj(lj(f[u>>2]|0,f[u+4>>2]|0,f[c>>2]|0,0)|0,I|0,m|0,r|0)|0)+(f[f[a>>2]>>2]|0)|0;r=a+24|0;m=b[r>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0)if(!(b[a+32>>0]|0)){u=0;k=o;while(1){s=$(f[k>>2]|0);n[g+(u<<2)>>2]=s;u=u+1|0;q=b[r>>0]|0;if((u|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){y=q;break}else k=k+4|0}}else{k=0;u=o;while(1){s=$($(f[u>>2]|0)*$(4.65661287e-10));n[g+(k<<2)>>2]=s;k=k+1|0;l=b[r>>0]|0;if((k|0)>=((l<<24>>24>e<<24>>24?e:l)<<24>>24|0)){y=l;break}else u=u+4|0}}else y=m;u=y<<24>>24;if(y<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(u<<2)|0,0,(e<<24>>24)-u<<2|0)|0;i=1;return i|0}case 6:{u=a+48|0;k=f[u>>2]|0;r=f[u+4>>2]|0;u=a+40|0;o=(Tj(lj(f[u>>2]|0,f[u+4>>2]|0,f[c>>2]|0,0)|0,I|0,k|0,r|0)|0)+(f[f[a>>2]>>2]|0)|0;r=a+24|0;k=b[r>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0)if(!(b[a+32>>0]|0)){u=0;l=o;while(1){s=$((f[l>>2]|0)>>>0);n[g+(u<<2)>>2]=s;u=u+1|0;q=b[r>>0]|0;if((u|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){z=q;break}else l=l+4|0}}else{l=0;u=o;while(1){s=$($((f[u>>2]|0)>>>0)*$(2.32830644e-10));n[g+(l<<2)>>2]=s;l=l+1|0;m=b[r>>0]|0;if((l|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){z=m;break}else u=u+4|0}}else z=k;u=z<<24>>24;if(z<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(u<<2)|0,0,(e<<24>>24)-u<<2|0)|0;i=1;return i|0}case 7:{u=a+48|0;l=f[u>>2]|0;r=f[u+4>>2]|0;u=a+40|0;o=(Tj(lj(f[u>>2]|0,f[u+4>>2]|0,f[c>>2]|0,0)|0,I|0,l|0,r|0)|0)+(f[f[a>>2]>>2]|0)|0;r=a+24|0;l=b[r>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0)if(!(b[a+32>>0]|0)){u=0;m=o;while(1){q=m;s=$(+((f[q>>2]|0)>>>0)+4294967296.0*+(f[q+4>>2]|0));n[g+(u<<2)>>2]=s;u=u+1|0;q=b[r>>0]|0;if((u|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){A=q;break}else m=m+8|0}}else{m=0;u=o;while(1){k=u;s=$($(+((f[k>>2]|0)>>>0)+4294967296.0*+(f[k+4>>2]|0))*$(1.08420217e-19));n[g+(m<<2)>>2]=s;m=m+1|0;k=b[r>>0]|0;if((m|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){A=k;break}else u=u+8|0}}else A=l;u=A<<24>>24;if(A<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(u<<2)|0,0,(e<<24>>24)-u<<2|0)|0;i=1;return i|0}case 8:{u=a+48|0;m=f[u>>2]|0;r=f[u+4>>2]|0;u=a+40|0;o=(Tj(lj(f[u>>2]|0,f[u+4>>2]|0,f[c>>2]|0,0)|0,I|0,m|0,r|0)|0)+(f[f[a>>2]>>2]|0)|0;r=a+24|0;m=b[r>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0)if(!(b[a+32>>0]|0)){u=0;k=o;while(1){q=k;s=$(+((f[q>>2]|0)>>>0)+4294967296.0*+((f[q+4>>2]|0)>>>0));n[g+(u<<2)>>2]=s;u=u+1|0;q=b[r>>0]|0;if((u|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){B=q;break}else k=k+8|0}}else{k=0;u=o;while(1){l=u;s=$($(+((f[l>>2]|0)>>>0)+4294967296.0*+((f[l+4>>2]|0)>>>0))*$(5.42101086e-20));n[g+(k<<2)>>2]=s;k=k+1|0;l=b[r>>0]|0;if((k|0)>=((l<<24>>24>e<<24>>24?e:l)<<24>>24|0)){B=l;break}else u=u+8|0}}else B=m;u=B<<24>>24;if(B<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(u<<2)|0,0,(e<<24>>24)-u<<2|0)|0;i=1;return i|0}case 9:{u=a+24|0;k=b[u>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0){r=f[f[a>>2]>>2]|0;o=a+40|0;l=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;q=Tj(l|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;l=r+q|0;while(1){f[g+(o<<2)>>2]=f[l>>2];o=o+1|0;q=b[u>>0]|0;if((o|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){C=q;break}else l=l+4|0}}else C=k;l=C<<24>>24;if(C<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(l<<2)|0,0,(e<<24>>24)-l<<2|0)|0;i=1;return i|0}case 10:{l=a+24|0;o=b[l>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){u=f[f[a>>2]>>2]|0;m=a+40|0;q=lj(f[m>>2]|0,f[m+4>>2]|0,f[c>>2]|0,0)|0;m=a+48|0;r=Tj(q|0,I|0,f[m>>2]|0,f[m+4>>2]|0)|0;m=0;q=u+r|0;while(1){s=$(+p[q>>3]);n[g+(m<<2)>>2]=s;m=m+1|0;r=b[l>>0]|0;if((m|0)>=((r<<24>>24>e<<24>>24?e:r)<<24>>24|0)){D=r;break}else q=q+8|0}}else D=o;q=D<<24>>24;if(D<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(q<<2)|0,0,(e<<24>>24)-q<<2|0)|0;i=1;return i|0}case 11:{q=a+24|0;m=b[q>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0){l=f[f[a>>2]>>2]|0;k=a+40|0;r=lj(f[k>>2]|0,f[k+4>>2]|0,f[c>>2]|0,0)|0;k=a+48|0;u=Tj(r|0,I|0,f[k>>2]|0,f[k+4>>2]|0)|0;k=0;r=l+u|0;while(1){s=$((b[r>>0]|0)!=0&1);n[g+(k<<2)>>2]=s;k=k+1|0;u=b[q>>0]|0;if((k|0)>=((u<<24>>24>e<<24>>24?e:u)<<24>>24|0)){E=u;break}else r=r+1|0}}else E=m;r=E<<24>>24;if(E<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(r<<2)|0,0,(e<<24>>24)-r<<2|0)|0;i=1;return i|0}default:{i=0;return i|0}}while(0);return 0}function $a(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0;g=u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0)>0){s=a+20|0;j=0;do{p=(f[b+(j<<2)>>2]|0)+(f[r+(j<<2)>>2]|0)|0;q=c+(j<<2)|0;f[q>>2]=p;if((p|0)<=(f[l>>2]|0)){if((p|0)<(f[n>>2]|0)){t=(f[s>>2]|0)+p|0;v=18}}else{t=p-(f[s>>2]|0)|0;v=18}if((v|0)==18){v=0;f[q>>2]=t}j=j+1|0}while((j|0)<(f[i>>2]|0))}}j=f[a+48>>2]|0;t=f[a+52>>2]|0;s=dj(16)|0;f[s>>2]=0;f[s+4>>2]=0;f[s+8>>2]=0;f[s+12>>2]=0;f[h>>2]=0;n=h+4|0;f[n>>2]=0;f[h+8>>2]=0;do if(e)if(e>>>0>1073741823)ym(h);else{l=e<<2;r=dj(l)|0;f[h>>2]=r;q=r+(e<<2)|0;f[h+8>>2]=q;Vf(r|0,0,l|0)|0;f[n>>2]=q;w=r;break}else w=0;while(0);r=a+56|0;q=f[r>>2]|0;l=f[q+4>>2]|0;p=f[q>>2]|0;k=l-p|0;m=k>>2;a:do if((k|0)>4){o=j+64|0;x=j+28|0;y=(e|0)>0;z=a+16|0;A=a+32|0;B=a+12|0;C=a+20|0;D=e<<2;if(l-p>>2>>>0>1){E=p;F=1}else{G=q;ym(G)}while(1){H=f[E+(F<<2)>>2]|0;I=(((H>>>0)%3|0|0)==0?2:-1)+H|0;J=I>>>5;K=1<<(I&31);L=(H|0)==-1|(I|0)==-1;M=H;N=1;O=0;b:while(1){P=N^1;Q=M;R=O;while(1){if((Q|0)==-1){S=R;v=58;break b}T=f[d+(R*12|0)>>2]|0;if(((f[(f[j>>2]|0)+(Q>>>5<<2)>>2]&1<<(Q&31)|0)==0?(U=f[(f[(f[o>>2]|0)+12>>2]|0)+(Q<<2)>>2]|0,(U|0)!=-1):0)?(V=f[x>>2]|0,W=f[t>>2]|0,Y=f[W+(f[V+(U<<2)>>2]<<2)>>2]|0,Z=U+1|0,_=f[W+(f[V+((((Z>>>0)%3|0|0)==0?U+-2|0:Z)<<2)>>2]<<2)>>2]|0,Z=f[W+(f[V+((((U>>>0)%3|0|0)==0?2:-1)+U<<2)>>2]<<2)>>2]|0,(Y|0)<(F|0)&(_|0)<(F|0)&(Z|0)<(F|0)):0){U=X(Y,e)|0;Y=X(_,e)|0;_=X(Z,e)|0;if(y){Z=0;do{f[T+(Z<<2)>>2]=(f[c+(Z+_<<2)>>2]|0)+(f[c+(Z+Y<<2)>>2]|0)-(f[c+(Z+U<<2)>>2]|0);Z=Z+1|0}while((Z|0)!=(e|0))}Z=R+1|0;if((Z|0)==4){$=4;v=38;break b}else aa=Z}else aa=R;do if(N){Z=Q+1|0;U=((Z>>>0)%3|0|0)==0?Q+-2|0:Z;if(((U|0)!=-1?(f[(f[j>>2]|0)+(U>>>5<<2)>>2]&1<<(U&31)|0)==0:0)?(Z=f[(f[(f[o>>2]|0)+12>>2]|0)+(U<<2)>>2]|0,U=Z+1|0,(Z|0)!=-1):0)ba=((U>>>0)%3|0|0)==0?Z+-2|0:U;else ba=-1}else{U=(((Q>>>0)%3|0|0)==0?2:-1)+Q|0;if(((U|0)!=-1?(f[(f[j>>2]|0)+(U>>>5<<2)>>2]&1<<(U&31)|0)==0:0)?(Z=f[(f[(f[o>>2]|0)+12>>2]|0)+(U<<2)>>2]|0,(Z|0)!=-1):0)if(!((Z>>>0)%3|0)){ba=Z+2|0;break}else{ba=Z+-1|0;break}else ba=-1}while(0);if((ba|0)==(H|0)){S=aa;v=58;break b}if((ba|0)!=-1|P){Q=ba;R=aa}else break}if(L){M=-1;N=0;O=aa;continue}if(f[(f[j>>2]|0)+(J<<2)>>2]&K|0){M=-1;N=0;O=aa;continue}R=f[(f[(f[o>>2]|0)+12>>2]|0)+(I<<2)>>2]|0;if((R|0)==-1){M=-1;N=0;O=aa;continue}if(!((R>>>0)%3|0)){M=R+2|0;N=0;O=aa;continue}else{M=R+-1|0;N=0;O=aa;continue}}if((v|0)==58){v=0;if((S|0)>0){$=S;v=38}else{ca=X(F,e)|0;v=72}}if((v|0)==38){v=0;if(y){Vf(f[h>>2]|0,0,D|0)|0;O=$+-1|0;N=s+(O<<2)|0;M=a+60+(O*12|0)+4|0;I=a+60+(O*12|0)|0;O=f[h>>2]|0;K=0;J=0;while(1){L=f[N>>2]|0;f[N>>2]=L+1;if((f[M>>2]|0)>>>0<=L>>>0){da=O;ea=0;break a}if(!(f[(f[I>>2]|0)+(L>>>5<<2)>>2]&1<<(L&31))){L=f[d+(K*12|0)>>2]|0;H=0;do{R=O+(H<<2)|0;f[R>>2]=(f[R>>2]|0)+(f[L+(H<<2)>>2]|0);H=H+1|0}while((H|0)!=(e|0));fa=J+1|0}else fa=J;K=K+1|0;if((K|0)>=($|0)){ga=fa;break}else J=fa}}else{J=$+-1|0;K=s+(J<<2)|0;O=a+60+(J*12|0)|0;I=f[h>>2]|0;M=f[a+60+(J*12|0)+4>>2]|0;J=f[K>>2]|0;N=0;H=0;while(1){L=J;J=J+1|0;f[K>>2]=J;if(M>>>0<=L>>>0){da=I;ea=0;break a}R=H+((f[(f[O>>2]|0)+(L>>>5<<2)>>2]&1<<(L&31)|0)==0&1)|0;N=N+1|0;if((N|0)>=($|0)){ga=R;break}else H=R}}H=X(F,e)|0;if(ga){N=f[h>>2]|0;if(y){O=0;do{I=N+(O<<2)|0;f[I>>2]=(f[I>>2]|0)/(ga|0)|0;O=O+1|0}while((O|0)!=(e|0))}O=b+(H<<2)|0;I=c+(H<<2)|0;if((f[i>>2]|0)>0){M=0;do{J=f[N+(M<<2)>>2]|0;K=f[z>>2]|0;if((J|0)>(K|0)){R=f[A>>2]|0;f[R+(M<<2)>>2]=K;ha=R}else{R=f[B>>2]|0;K=f[A>>2]|0;f[K+(M<<2)>>2]=(J|0)<(R|0)?R:J;ha=K}M=M+1|0;ia=f[i>>2]|0}while((M|0)<(ia|0));if((ia|0)>0){M=0;do{N=(f[O+(M<<2)>>2]|0)+(f[ha+(M<<2)>>2]|0)|0;K=I+(M<<2)|0;f[K>>2]=N;do if((N|0)>(f[z>>2]|0)){ja=N-(f[C>>2]|0)|0;v=94}else{if((N|0)>=(f[B>>2]|0))break;ja=(f[C>>2]|0)+N|0;v=94}while(0);if((v|0)==94){v=0;f[K>>2]=ja}M=M+1|0}while((M|0)<(f[i>>2]|0))}}}else{ca=H;v=72}}if((v|0)==72?(v=0,M=c+((X(F+-1|0,e)|0)<<2)|0,I=b+(ca<<2)|0,O=c+(ca<<2)|0,(f[i>>2]|0)>0):0){N=0;do{J=f[M+(N<<2)>>2]|0;R=f[z>>2]|0;if((J|0)>(R|0)){L=f[A>>2]|0;f[L+(N<<2)>>2]=R;ka=L}else{L=f[B>>2]|0;R=f[A>>2]|0;f[R+(N<<2)>>2]=(J|0)<(L|0)?L:J;ka=R}N=N+1|0;la=f[i>>2]|0}while((N|0)<(la|0));if((la|0)>0){N=0;do{M=(f[I+(N<<2)>>2]|0)+(f[ka+(N<<2)>>2]|0)|0;H=O+(N<<2)|0;f[H>>2]=M;if((M|0)<=(f[z>>2]|0)){if((M|0)<(f[B>>2]|0)){ma=(f[C>>2]|0)+M|0;v=82}}else{ma=M-(f[C>>2]|0)|0;v=82}if((v|0)==82){v=0;f[H>>2]=ma}N=N+1|0}while((N|0)<(f[i>>2]|0))}}F=F+1|0;if((F|0)>=(m|0)){v=99;break}N=f[r>>2]|0;E=f[N>>2]|0;if((f[N+4>>2]|0)-E>>2>>>0<=F>>>0){G=N;v=28;break}}if((v|0)==28)ym(G);else if((v|0)==99){da=f[h>>2]|0;ea=1;break}}else{da=w;ea=1}while(0);if(da|0){w=f[n>>2]|0;if((w|0)!=(da|0))f[n>>2]=w+(~((w+-4-da|0)>>>2)<<2);fn(da)}fn(s);s=f[d+36>>2]|0;if(s|0){da=d+40|0;w=f[da>>2]|0;if((w|0)!=(s|0))f[da>>2]=w+(~((w+-4-s|0)>>>2)<<2);fn(s)}s=f[d+24>>2]|0;if(s|0){w=d+28|0;da=f[w>>2]|0;if((da|0)!=(s|0))f[w>>2]=da+(~((da+-4-s|0)>>>2)<<2);fn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>2;a:do if((k|0)>4){o=j+12|0;x=(e|0)>0;y=a+16|0;z=a+32|0;A=a+12|0;B=a+20|0;C=e<<2;if(l-p>>2>>>0>1){D=p;E=1}else{F=q;ym(F)}while(1){G=f[D+(E<<2)>>2]|0;H=(((G>>>0)%3|0|0)==0?2:-1)+G|0;I=(G|0)==-1|(H|0)==-1;J=G;K=1;L=0;b:while(1){M=K^1;N=J;O=L;while(1){if((N|0)==-1){P=O;v=58;break b}Q=f[d+(O*12|0)>>2]|0;R=f[o>>2]|0;S=f[R+(N<<2)>>2]|0;if((S|0)!=-1){T=f[j>>2]|0;U=f[t>>2]|0;V=f[U+(f[T+(S<<2)>>2]<<2)>>2]|0;W=S+1|0;Y=((W>>>0)%3|0|0)==0?S+-2|0:W;if((Y|0)==-1)Z=-1;else Z=f[T+(Y<<2)>>2]|0;Y=f[U+(Z<<2)>>2]|0;W=(((S>>>0)%3|0|0)==0?2:-1)+S|0;if((W|0)==-1)_=-1;else _=f[T+(W<<2)>>2]|0;W=f[U+(_<<2)>>2]|0;if((V|0)<(E|0)&(Y|0)<(E|0)&(W|0)<(E|0)){U=X(V,e)|0;V=X(Y,e)|0;Y=X(W,e)|0;if(x){W=0;do{f[Q+(W<<2)>>2]=(f[c+(W+Y<<2)>>2]|0)+(f[c+(W+V<<2)>>2]|0)-(f[c+(W+U<<2)>>2]|0);W=W+1|0}while((W|0)!=(e|0))}W=O+1|0;if((W|0)==4){$=4;v=41;break b}else aa=W}else aa=O}else aa=O;do if(K){W=N+1|0;U=((W>>>0)%3|0|0)==0?N+-2|0:W;if((U|0)!=-1?(W=f[R+(U<<2)>>2]|0,U=W+1|0,(W|0)!=-1):0)ba=((U>>>0)%3|0|0)==0?W+-2|0:U;else ba=-1}else{U=(((N>>>0)%3|0|0)==0?2:-1)+N|0;if((U|0)!=-1?(W=f[R+(U<<2)>>2]|0,(W|0)!=-1):0)if(!((W>>>0)%3|0)){ba=W+2|0;break}else{ba=W+-1|0;break}else ba=-1}while(0);if((ba|0)==(G|0)){P=aa;v=58;break b}if((ba|0)!=-1|M){N=ba;O=aa}else break}if(I){J=-1;K=0;L=aa;continue}O=f[R+(H<<2)>>2]|0;if((O|0)==-1){J=-1;K=0;L=aa;continue}if(!((O>>>0)%3|0)){J=O+2|0;K=0;L=aa;continue}else{J=O+-1|0;K=0;L=aa;continue}}if((v|0)==58){v=0;if((P|0)>0){$=P;v=41}else{ca=X(E,e)|0;v=72}}if((v|0)==41){v=0;if(x){Vf(f[h>>2]|0,0,C|0)|0;L=$+-1|0;K=s+(L<<2)|0;J=a+60+(L*12|0)+4|0;H=a+60+(L*12|0)|0;L=f[h>>2]|0;I=0;G=0;while(1){O=f[K>>2]|0;f[K>>2]=O+1;if((f[J>>2]|0)>>>0<=O>>>0){da=L;ea=0;break a}if(!(f[(f[H>>2]|0)+(O>>>5<<2)>>2]&1<<(O&31))){O=f[d+(I*12|0)>>2]|0;N=0;do{M=L+(N<<2)|0;f[M>>2]=(f[M>>2]|0)+(f[O+(N<<2)>>2]|0);N=N+1|0}while((N|0)!=(e|0));fa=G+1|0}else fa=G;I=I+1|0;if((I|0)>=($|0)){ga=fa;break}else G=fa}}else{G=$+-1|0;I=s+(G<<2)|0;L=a+60+(G*12|0)|0;H=f[h>>2]|0;J=f[a+60+(G*12|0)+4>>2]|0;G=f[I>>2]|0;K=0;N=0;while(1){O=G;G=G+1|0;f[I>>2]=G;if(J>>>0<=O>>>0){da=H;ea=0;break a}M=N+((f[(f[L>>2]|0)+(O>>>5<<2)>>2]&1<<(O&31)|0)==0&1)|0;K=K+1|0;if((K|0)>=($|0)){ga=M;break}else N=M}}N=X(E,e)|0;if(ga){K=f[h>>2]|0;if(x){L=0;do{H=K+(L<<2)|0;f[H>>2]=(f[H>>2]|0)/(ga|0)|0;L=L+1|0}while((L|0)!=(e|0))}L=b+(N<<2)|0;H=c+(N<<2)|0;if((f[i>>2]|0)>0){J=0;do{G=f[K+(J<<2)>>2]|0;I=f[y>>2]|0;if((G|0)>(I|0)){M=f[z>>2]|0;f[M+(J<<2)>>2]=I;ha=M}else{M=f[A>>2]|0;I=f[z>>2]|0;f[I+(J<<2)>>2]=(G|0)<(M|0)?M:G;ha=I}J=J+1|0;ia=f[i>>2]|0}while((J|0)<(ia|0));if((ia|0)>0){J=0;do{K=(f[L+(J<<2)>>2]|0)+(f[ha+(J<<2)>>2]|0)|0;I=H+(J<<2)|0;f[I>>2]=K;do if((K|0)>(f[y>>2]|0)){ja=K-(f[B>>2]|0)|0;v=94}else{if((K|0)>=(f[A>>2]|0))break;ja=(f[B>>2]|0)+K|0;v=94}while(0);if((v|0)==94){v=0;f[I>>2]=ja}J=J+1|0}while((J|0)<(f[i>>2]|0))}}}else{ca=N;v=72}}if((v|0)==72?(v=0,J=c+((X(E+-1|0,e)|0)<<2)|0,H=b+(ca<<2)|0,L=c+(ca<<2)|0,(f[i>>2]|0)>0):0){K=0;do{G=f[J+(K<<2)>>2]|0;M=f[y>>2]|0;if((G|0)>(M|0)){O=f[z>>2]|0;f[O+(K<<2)>>2]=M;ka=O}else{O=f[A>>2]|0;M=f[z>>2]|0;f[M+(K<<2)>>2]=(G|0)<(O|0)?O:G;ka=M}K=K+1|0;la=f[i>>2]|0}while((K|0)<(la|0));if((la|0)>0){K=0;do{J=(f[H+(K<<2)>>2]|0)+(f[ka+(K<<2)>>2]|0)|0;N=L+(K<<2)|0;f[N>>2]=J;if((J|0)<=(f[y>>2]|0)){if((J|0)<(f[A>>2]|0)){ma=(f[B>>2]|0)+J|0;v=82}}else{ma=J-(f[B>>2]|0)|0;v=82}if((v|0)==82){v=0;f[N>>2]=ma}K=K+1|0}while((K|0)<(f[i>>2]|0))}}E=E+1|0;if((E|0)>=(m|0)){v=99;break}K=f[r>>2]|0;D=f[K>>2]|0;if((f[K+4>>2]|0)-D>>2>>>0<=E>>>0){F=K;v=28;break}}if((v|0)==28)ym(F);else if((v|0)==99){da=f[h>>2]|0;ea=1;break}}else{da=w;ea=1}while(0);if(da|0){w=f[n>>2]|0;if((w|0)!=(da|0))f[n>>2]=w+(~((w+-4-da|0)>>>2)<<2);fn(da)}fn(s);s=f[d+36>>2]|0;if(s|0){da=d+40|0;w=f[da>>2]|0;if((w|0)!=(s|0))f[da>>2]=w+(~((w+-4-s|0)>>>2)<<2);fn(s)}s=f[d+24>>2]|0;if(s|0){w=d+28|0;da=f[w>>2]|0;if((da|0)!=(s|0))f[w>>2]=da+(~((da+-4-s|0)>>>2)<<2);fn(s)}s=f[d+12>>2]|0;if(s|0){da=d+16|0;w=f[da>>2]|0;if((w|0)!=(s|0))f[da>>2]=w+(~((w+-4-s|0)>>>2)<<2);fn(s)}s=f[d>>2]|0;if(!s){u=g;return ea|0}w=d+4|0;d=f[w>>2]|0;if((d|0)!=(s|0))f[w>>2]=d+(~((d+-4-s|0)>>>2)<<2);fn(s);u=g;return ea|0}function bb(a,c,d,e,g,i){a=a|0;c=+c;d=d|0;e=e|0;g=g|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0.0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0.0,D=0.0,E=0,F=0,G=0,H=0.0,J=0,K=0,L=0,M=0,N=0,O=0.0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0.0,fa=0.0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0;j=u;u=u+560|0;k=j+8|0;l=j;m=j+524|0;n=m;o=j+512|0;f[l>>2]=0;p=o+12|0;Bk(c)|0;if((I|0)<0){q=1;r=10363;s=-c}else{q=(g&2049|0)!=0&1;r=(g&2048|0)==0?((g&1|0)==0?10364:10369):10366;s=c}Bk(s)|0;t=I&2146435072;do if(t>>>0<2146435072|(t|0)==2146435072&0<0){c=+Mm(s,l)*2.0;v=c!=0.0;if(v)f[l>>2]=(f[l>>2]|0)+-1;w=i|32;if((w|0)==97){x=i&32;y=(x|0)==0?r:r+9|0;z=q|2;A=12-e|0;do if(!(e>>>0>11|(A|0)==0)){B=A;C=8.0;do{B=B+-1|0;C=C*16.0}while((B|0)!=0);if((b[y>>0]|0)==45){D=-(C+(-c-C));break}else{D=c+C-C;break}}else D=c;while(0);A=f[l>>2]|0;B=(A|0)<0?0-A|0:A;E=sg(B,((B|0)<0)<<31>>31,p)|0;if((E|0)==(p|0)){B=o+11|0;b[B>>0]=48;F=B}else F=E;b[F+-1>>0]=(A>>31&2)+43;A=F+-2|0;b[A>>0]=i+15;E=(e|0)<1;B=(g&8|0)==0;G=m;H=D;while(1){J=~~H;K=G+1|0;b[G>>0]=h[10398+J>>0]|x;H=(H-+(J|0))*16.0;if((K-n|0)==1?!(B&(E&H==0.0)):0){b[K>>0]=46;L=G+2|0}else L=K;if(!(H!=0.0))break;else G=L}G=L-n|0;E=p-A|0;B=(e|0)!=0&(G+-2|0)<(e|0)?e+2|0:G;x=E+z+B|0;fh(a,32,d,x,g);ml(a,y,z);fh(a,48,d,x,g^65536);ml(a,m,G);fh(a,48,B-G|0,0,0);ml(a,A,E);fh(a,32,d,x,g^8192);M=x;break}x=(e|0)<0?6:e;if(v){E=(f[l>>2]|0)+-28|0;f[l>>2]=E;N=E;O=c*268435456.0}else{N=f[l>>2]|0;O=c}E=(N|0)<0?k:k+288|0;H=O;G=E;do{B=~~H>>>0;f[G>>2]=B;G=G+4|0;H=(H-+(B>>>0))*1.0e9}while(H!=0.0);if((N|0)>0){v=N;A=E;z=G;while(1){y=(v|0)<29?v:29;B=z+-4|0;if(B>>>0>=A>>>0){K=0;J=B;do{B=Qj(f[J>>2]|0,0,y|0)|0;P=Tj(B|0,I|0,K|0,0)|0;B=I;Q=bj(P|0,B|0,1e9,0)|0;f[J>>2]=Q;K=Jl(P|0,B|0,1e9,0)|0;J=J+-4|0}while(J>>>0>=A>>>0);if(K){J=A+-4|0;f[J>>2]=K;R=J}else R=A}else R=A;J=z;while(1){if(J>>>0<=R>>>0)break;B=J+-4|0;if(!(f[B>>2]|0))J=B;else break}K=(f[l>>2]|0)-y|0;f[l>>2]=K;if((K|0)>0){v=K;A=R;z=J}else{S=K;T=R;U=J;break}}}else{S=N;T=E;U=G}if((S|0)<0){z=((x+25|0)/9|0)+1|0;A=(w|0)==102;v=S;K=T;B=U;while(1){P=0-v|0;Q=(P|0)<9?P:9;if(K>>>0>>0){P=(1<>>Q;W=0;Y=K;do{Z=f[Y>>2]|0;f[Y>>2]=(Z>>>Q)+W;W=X(Z&P,V)|0;Y=Y+4|0}while(Y>>>0>>0);Y=(f[K>>2]|0)==0?K+4|0:K;if(!W){_=Y;$=B}else{f[B>>2]=W;_=Y;$=B+4|0}}else{_=(f[K>>2]|0)==0?K+4|0:K;$=B}Y=A?E:_;V=($-Y>>2|0)>(z|0)?Y+(z<<2)|0:$;v=(f[l>>2]|0)+Q|0;f[l>>2]=v;if((v|0)>=0){aa=_;ba=V;break}else{K=_;B=V}}}else{aa=T;ba=U}B=E;if(aa>>>0>>0){K=(B-aa>>2)*9|0;v=f[aa>>2]|0;if(v>>>0<10)ca=K;else{z=K;K=10;while(1){K=K*10|0;A=z+1|0;if(v>>>0>>0){ca=A;break}else z=A}}}else ca=0;z=(w|0)==103;K=(x|0)!=0;v=x-((w|0)!=102?ca:0)+((K&z)<<31>>31)|0;if((v|0)<(((ba-B>>2)*9|0)+-9|0)){A=v+9216|0;v=E+4+(((A|0)/9|0)+-1024<<2)|0;G=((A|0)%9|0)+1|0;if((G|0)<9){A=10;V=G;while(1){G=A*10|0;V=V+1|0;if((V|0)==9){da=G;break}else A=G}}else da=10;A=f[v>>2]|0;V=(A>>>0)%(da>>>0)|0;w=(v+4|0)==(ba|0);if(!(w&(V|0)==0)){C=(((A>>>0)/(da>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;G=(da|0)/2|0;H=V>>>0>>0?.5:w&(V|0)==(G|0)?1.0:1.5;if(!q){ea=C;fa=H}else{G=(b[r>>0]|0)==45;ea=G?-C:C;fa=G?-H:H}G=A-V|0;f[v>>2]=G;if(ea+fa!=ea){V=G+da|0;f[v>>2]=V;if(V>>>0>999999999){V=aa;G=v;while(1){A=G+-4|0;f[G>>2]=0;if(A>>>0>>0){w=V+-4|0;f[w>>2]=0;ga=w}else ga=V;w=(f[A>>2]|0)+1|0;f[A>>2]=w;if(w>>>0>999999999){V=ga;G=A}else{ha=ga;ia=A;break}}}else{ha=aa;ia=v}G=(B-ha>>2)*9|0;V=f[ha>>2]|0;if(V>>>0<10){ja=ha;ka=ia;la=G}else{A=G;G=10;while(1){G=G*10|0;w=A+1|0;if(V>>>0>>0){ja=ha;ka=ia;la=w;break}else A=w}}}else{ja=aa;ka=v;la=ca}}else{ja=aa;ka=v;la=ca}A=ka+4|0;ma=ja;na=la;oa=ba>>>0>A>>>0?A:ba}else{ma=aa;na=ca;oa=ba}A=oa;while(1){if(A>>>0<=ma>>>0){pa=0;break}G=A+-4|0;if(!(f[G>>2]|0))A=G;else{pa=1;break}}v=0-na|0;do if(z){G=((K^1)&1)+x|0;if((G|0)>(na|0)&(na|0)>-5){qa=G+-1-na|0;ra=i+-1|0}else{qa=G+-1|0;ra=i+-2|0}G=g&8;if(!G){if(pa?(V=f[A+-4>>2]|0,(V|0)!=0):0)if(!((V>>>0)%10|0)){w=10;Y=0;while(1){w=w*10|0;P=Y+1|0;if((V>>>0)%(w>>>0)|0|0){sa=P;break}else Y=P}}else sa=0;else sa=9;Y=((A-B>>2)*9|0)+-9|0;if((ra|32|0)==102){w=Y-sa|0;V=(w|0)>0?w:0;ta=0;ua=(qa|0)<(V|0)?qa:V;va=ra;break}else{V=Y+na-sa|0;Y=(V|0)>0?V:0;ta=0;ua=(qa|0)<(Y|0)?qa:Y;va=ra;break}}else{ta=G;ua=qa;va=ra}}else{ta=g&8;ua=x;va=i}while(0);x=ua|ta;B=(x|0)!=0&1;K=(va|32|0)==102;if(K){wa=0;xa=(na|0)>0?na:0}else{z=(na|0)<0?v:na;Y=sg(z,((z|0)<0)<<31>>31,p)|0;z=p;if((z-Y|0)<2){V=Y;while(1){w=V+-1|0;b[w>>0]=48;if((z-w|0)<2)V=w;else{ya=w;break}}}else ya=Y;b[ya+-1>>0]=(na>>31&2)+43;V=ya+-2|0;b[V>>0]=va;wa=V;xa=z-V|0}V=q+1+ua+B+xa|0;fh(a,32,d,V,g);ml(a,r,q);fh(a,48,d,V,g^65536);if(K){v=ma>>>0>E>>>0?E:ma;w=m+9|0;Q=w;W=m+8|0;P=v;do{J=sg(f[P>>2]|0,0,w)|0;if((P|0)==(v|0))if((J|0)==(w|0)){b[W>>0]=48;za=W}else za=J;else if(J>>>0>m>>>0){Vf(m|0,48,J-n|0)|0;y=J;while(1){Z=y+-1|0;if(Z>>>0>m>>>0)y=Z;else{za=Z;break}}}else za=J;ml(a,za,Q-za|0);P=P+4|0}while(P>>>0<=E>>>0);if(x|0)ml(a,10414,1);if(P>>>0>>0&(ua|0)>0){E=P;Q=ua;while(1){W=sg(f[E>>2]|0,0,w)|0;if(W>>>0>m>>>0){Vf(m|0,48,W-n|0)|0;v=W;while(1){K=v+-1|0;if(K>>>0>m>>>0)v=K;else{Aa=K;break}}}else Aa=W;ml(a,Aa,(Q|0)<9?Q:9);E=E+4|0;v=Q+-9|0;if(!(E>>>0>>0&(Q|0)>9)){Ba=v;break}else Q=v}}else Ba=ua;fh(a,48,Ba+9|0,9,0)}else{Q=pa?A:ma+4|0;if((ua|0)>-1){E=m+9|0;w=(ta|0)==0;P=E;x=0-n|0;v=m+8|0;J=ma;K=ua;while(1){B=sg(f[J>>2]|0,0,E)|0;if((B|0)==(E|0)){b[v>>0]=48;Ca=v}else Ca=B;do if((J|0)==(ma|0)){B=Ca+1|0;ml(a,Ca,1);if(w&(K|0)<1){Da=B;break}ml(a,10414,1);Da=B}else{if(Ca>>>0<=m>>>0){Da=Ca;break}Vf(m|0,48,Ca+x|0)|0;B=Ca;while(1){z=B+-1|0;if(z>>>0>m>>>0)B=z;else{Da=z;break}}}while(0);W=P-Da|0;ml(a,Da,(K|0)>(W|0)?W:K);B=K-W|0;J=J+4|0;if(!(J>>>0>>0&(B|0)>-1)){Ea=B;break}else K=B}}else Ea=ua;fh(a,48,Ea+18|0,18,0);ml(a,wa,p-wa|0)}fh(a,32,d,V,g^8192);M=V}else{K=(i&32|0)!=0;Q=q+3|0;fh(a,32,d,Q,g&-65537);ml(a,r,q);ml(a,s!=s|0.0!=0.0?(K?10390:10394):K?10382:10386,3);fh(a,32,d,Q,g^8192);M=Q}while(0);u=j;return ((M|0)<(d|0)?d:M)|0}function cb(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0;c=u;u=u+48|0;d=c+36|0;e=c+24|0;g=c+12|0;h=c;i=a+4|0;j=f[(f[i>>2]|0)+44>>2]|0;k=a+8|0;l=f[k>>2]|0;m=((f[l+4>>2]|0)-(f[l>>2]|0)>>2>>>0)/3|0;l=j+96|0;n=j+100|0;f[d>>2]=0;f[d+4>>2]=0;f[d+8>>2]=0;j=f[n>>2]|0;o=f[l>>2]|0;p=(j-o|0)/12|0;q=o;o=j;if(m>>>0<=p>>>0){if(m>>>0

>>0?(j=q+(m*12|0)|0,(o|0)!=(j|0)):0)f[n>>2]=o+(~(((o+-12-j|0)>>>0)/12|0)*12|0)}else Wd(l,m-p|0,d);p=a+216|0;m=a+220|0;if((f[p>>2]|0)==(f[m>>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=0;f[e+8>>2]=0;r=f[k>>2]|0;N=(f[r+4>>2]|0)-(f[r>>2]|0)|0;l=N>>2;f[g>>2]=0;K=g+4|0;f[K>>2]=0;f[g+8>>2]=0;do if(l|0)if(l>>>0>1073741823)ym(g);else{v=dj(N)|0;f[g>>2]=v;I=v+(l<<2)|0;f[g+8>>2]=I;Vf(v|0,0,N|0)|0;f[K>>2]=I;break}while(0);a:do if(((f[r+28>>2]|0)-(f[r+24>>2]|0)|0)>0){N=a+120|0;l=e+8|0;I=r;v=0;while(1){n=f[(f[I+24>>2]|0)+(v<<2)>>2]|0;b:do if((n|0)!=-1){c:do if((f[(f[N>>2]|0)+(v>>>5<<2)>>2]&1<<(v&31)|0)==0?(M=f[m>>2]|0,j=f[p>>2]|0,J=j,(M|0)!=(j|0)):0){t=(((n>>>0)%3|0|0)==0?2:-1)+n|0;o=(M-j|0)/144|0;if((t|0)==-1){j=0;while(1){M=f[(f[f[J+(j*144|0)+68>>2]>>2]|0)+(n<<2)>>2]|0;if(1<<(M&31)&f[(f[J+(j*144|0)+16>>2]|0)+(M>>>5<<2)>>2]|0){X=0;break a}j=j+1|0;if(j>>>0>=o>>>0){Y=n;break c}}}j=I+12|0;M=0;while(1){s=f[(f[f[J+(M*144|0)+68>>2]>>2]|0)+(n<<2)>>2]|0;if(1<<(s&31)&f[(f[J+(M*144|0)+16>>2]|0)+(s>>>5<<2)>>2]|0){s=f[J+(M*144|0)+32>>2]|0;L=f[s+(n<<2)>>2]|0;q=f[j>>2]|0;E=f[q+(t<<2)>>2]|0;do if((E|0)!=-1)if(!((E>>>0)%3|0)){Z=E+2|0;break}else{Z=E+-1|0;break}else Z=-1;while(0);if((Z|0)!=(n|0)){E=Z;while(1){if((E|0)==-1){X=0;break a}if((f[s+(E<<2)>>2]|0)!=(L|0)){Y=E;break c}U=(((E>>>0)%3|0|0)==0?2:-1)+E|0;do if((U|0)!=-1){V=f[q+(U<<2)>>2]|0;if((V|0)==-1){_=-1;break}if(!((V>>>0)%3|0)){_=V+2|0;break}else{_=V+-1|0;break}}else _=-1;while(0);if((_|0)==(n|0))break;else E=_}}}M=M+1|0;if(M>>>0>=o>>>0){Y=n;break}}}else Y=n;while(0);o=f[b>>2]|0;f[(f[g>>2]|0)+(Y<<2)>>2]=o-(f[e>>2]|0)>>2;f[d>>2]=Y;M=o;if(M>>>0<(f[l>>2]|0)>>>0){f[M>>2]=Y;f[b>>2]=M+4;$=I}else{yf(e,d);$=f[k>>2]|0}if((((Y|0)!=-1?(M=(((Y>>>0)%3|0|0)==0?2:-1)+Y|0,(M|0)!=-1):0)?(o=f[(f[$+12>>2]|0)+(M<<2)>>2]|0,(o|0)!=-1):0)?(M=o+(((o>>>0)%3|0|0)==0?2:-1)|0,(M|0)!=-1&(M|0)!=(Y|0)):0){o=$;t=M;M=Y;while(1){j=f[m>>2]|0;J=f[p>>2]|0;E=J;d:do if((j|0)==(J|0))B=66;else{q=(j-J|0)/144|0;L=0;while(1){s=f[E+(L*144|0)+32>>2]|0;L=L+1|0;if((f[s+(t<<2)>>2]|0)!=(f[s+(M<<2)>>2]|0))break;if(L>>>0>=q>>>0){B=66;break d}}q=f[b>>2]|0;f[(f[g>>2]|0)+(t<<2)>>2]=q-(f[e>>2]|0)>>2;f[d>>2]=t;L=q;if(L>>>0<(f[l>>2]|0)>>>0){f[L>>2]=t;f[b>>2]=L+4;aa=o}else{yf(e,d);aa=f[k>>2]|0}ba=aa}while(0);if((B|0)==66){B=0;E=f[g>>2]|0;f[E+(t<<2)>>2]=f[E+(M<<2)>>2];ba=o}if((t|0)==-1){ca=ba;break b}E=(((t>>>0)%3|0|0)==0?2:-1)+t|0;if((E|0)==-1){ca=ba;break b}J=f[(f[ba+12>>2]|0)+(E<<2)>>2]|0;if((J|0)==-1){ca=ba;break b}E=J+(((J>>>0)%3|0|0)==0?2:-1)|0;if((E|0)!=-1&(E|0)!=(Y|0)){J=t;o=ba;t=E;M=J}else{ca=ba;break}}}else ca=$}else ca=I;while(0);v=v+1|0;if((v|0)>=((f[ca+28>>2]|0)-(f[ca+24>>2]|0)>>2|0)){B=27;break}else I=ca}}else B=27;while(0);if((B|0)==27){B=f[i>>2]|0;ca=f[B+44>>2]|0;$=f[ca+100>>2]|0;ba=f[ca+96>>2]|0;if(($|0)==(ba|0))da=B;else{Y=h+4|0;aa=h+8|0;k=B;p=B;B=ca;ca=ba;ba=$;$=0;while(1){f[h>>2]=0;f[h+4>>2]=0;f[h+8>>2]=0;m=(f[g>>2]|0)+($*3<<2)|0;f[h>>2]=f[m>>2];f[h+4>>2]=f[m+4>>2];f[h+8>>2]=f[m+8>>2];m=B+96|0;_=B+100|0;Z=(ba-ca|0)/12|0;r=ca;a=$;$=$+1|0;if(a>>>0>>0){ea=r;fa=ca;ga=ba;ha=k;ia=B;ja=p}else{I=ba;f[d>>2]=0;f[d+4>>2]=0;f[d+8>>2]=0;if($>>>0<=Z>>>0)if($>>>0>>0?(v=r+($*12|0)|0,(I|0)!=(v|0)):0){l=I+(~(((I+-12-v|0)>>>0)/12|0)*12|0)|0;f[_>>2]=l;ka=r;la=p;ma=B;na=l;oa=ca}else{ka=r;la=p;ma=B;na=ba;oa=ca}else{Wd(m,$-Z|0,d);Z=f[i>>2]|0;r=f[Z+44>>2]|0;ka=f[m>>2]|0;la=Z;ma=r;na=f[r+100>>2]|0;oa=f[r+96>>2]|0}ea=ka;fa=oa;ga=na;ha=la;ia=ma;ja=la}f[ea+(a*12|0)>>2]=f[h>>2];f[ea+(a*12|0)+4>>2]=f[Y>>2];f[ea+(a*12|0)+8>>2]=f[aa>>2];if($>>>0>=((ga-fa|0)/12|0)>>>0){da=ha;break}else{k=ha;p=ja;B=ia;ca=fa;ba=ga}}}f[(f[da+4>>2]|0)+80>>2]=(f[b>>2]|0)-(f[e>>2]|0)>>2;X=1}da=f[g>>2]|0;if(da|0){g=f[K>>2]|0;if((g|0)!=(da|0))f[K>>2]=g+(~((g+-4-da|0)>>>2)<<2);fn(da)}da=f[e>>2]|0;if(da|0){e=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(f[i>>2]|0)>>>0:0){w=f[a+24>>2]|0;g=a+28|0;q=f[g>>2]|0;if((q|0)!=(w|0))f[g>>2]=q+(~((q+-4-w|0)>>>2)<<2);w=dj(88)|0;gi(w);q=a+8|0;g=f[q>>2]|0;f[q>>2]=w;if(g|0?(of(g),fn(g),(f[q>>2]|0)==0):0){x=0;break}g=a+160|0;w=f[g>>2]|0;s=a+164|0;v=f[s>>2]|0;if((v|0)!=(w|0))f[s>>2]=v+(~((v+-4-w|0)>>>2)<<2);ug(g,f[h>>2]|0);g=a+172|0;w=f[g>>2]|0;v=a+176|0;s=f[v>>2]|0;if((s|0)!=(w|0))f[v>>2]=s+(~((s+-4-w|0)>>>2)<<2);ug(g,f[h>>2]|0);g=f[a+36>>2]|0;w=a+40|0;s=f[w>>2]|0;if((s|0)!=(g|0))f[w>>2]=s+(~(((s+-12-g|0)>>>0)/12|0)*12|0);g=f[a+48>>2]|0;s=a+52|0;w=f[s>>2]|0;if((w|0)!=(g|0))f[s>>2]=w+(~((w+-4-g|0)>>>2)<<2);f[a+64>>2]=0;g=f[a+72>>2]|0;w=a+76|0;s=f[w>>2]|0;if((s|0)!=(g|0))f[w>>2]=s+(~((s+-4-g|0)>>>2)<<2);f[a+84>>2]=-1;f[a+92>>2]=-1;f[a+88>>2]=-1;g=a+216|0;s=f[g>>2]|0;w=a+220|0;v=f[w>>2]|0;if((v|0)!=(s|0)){t=v;do{f[w>>2]=t+-144;v=f[t+-12>>2]|0;if(v|0){y=t+-8|0;z=f[y>>2]|0;if((z|0)!=(v|0))f[y>>2]=z+(~((z+-4-v|0)>>>2)<<2);fn(v)}v=f[t+-28>>2]|0;if(v|0){z=t+-24|0;y=f[z>>2]|0;if((y|0)!=(v|0))f[z>>2]=y+(~((y+-4-v|0)>>>2)<<2);fn(v)}v=f[t+-40>>2]|0;if(v|0){y=t+-36|0;z=f[y>>2]|0;if((z|0)!=(v|0))f[y>>2]=z+(~((z+-4-v|0)>>>2)<<2);fn(v)}vf(t+-140|0);t=f[w>>2]|0}while((t|0)!=(s|0))}s=p&255;Oe(g,s);if(!(Hf(f[q>>2]|0,f[h>>2]|0,(f[j>>2]|0)+(f[o>>2]|0)|0)|0)){x=0;break}t=(f[j>>2]|0)+(f[o>>2]|0)|0;b[e>>0]=1;ge(a+120|0,t,e);if((zc(a,f[(f[n>>2]|0)+32>>2]|0)|0)==-1){x=0;break}t=a+232|0;f[a+376>>2]=a;v=(La[f[(f[a>>2]|0)+32>>2]&127](a)|0)+32|0;z=f[v>>2]|0;v=(f[z>>2]|0)+(f[z+16>>2]|0)|0;z=(La[f[(f[a>>2]|0)+32>>2]&127](a)|0)+32|0;y=f[z>>2]|0;z=y+8|0;A=y+16|0;y=Vj(f[z>>2]|0,f[z+4>>2]|0,f[A>>2]|0,f[A+4>>2]|0)|0;A=(La[f[(f[a>>2]|0)+32>>2]&127](a)|0)+32|0;Yi(t,v,y,d[(f[A>>2]|0)+38>>1]|0);f[a+372>>2]=s;Fi(k);s=a+272|0;A=s;y=t;v=A+40|0;do{f[A>>2]=f[y>>2];A=A+4|0;y=y+4|0}while((A|0)<(v|0));a:do if(bh(s,1,e)|0){A=t;y=s;v=A+40|0;do{f[A>>2]=f[y>>2];A=A+4|0;y=y+4|0}while((A|0)<(v|0));z=e;B=f[z>>2]|0;C=f[z+4>>2]|0;z=a+240|0;D=a+248|0;E=D;F=f[E>>2]|0;G=f[E+4>>2]|0;E=Vj(f[z>>2]|0,f[z+4>>2]|0,F|0,G|0)|0;z=I;if(C>>>0>z>>>0|(C|0)==(z|0)&B>>>0>E>>>0){H=50;break}E=Tj(F|0,G|0,B|0,C|0)|0;C=D;f[C>>2]=E;f[C+4>>2]=I;if(!(sd(a+312|0,t)|0)){J=0;break}if(!(sf(t)|0)){J=0;break}A=k;y=t;v=A+40|0;do{f[A>>2]=f[y>>2];A=A+4|0;y=y+4|0}while((A|0)<(v|0));C=Ya(a,f[i>>2]|0)|0;if((C|0)==-1){J=0;break}E=f[(f[n>>2]|0)+32>>2]|0;D=k+16|0;B=f[D>>2]|0;G=(f[k>>2]|0)+B|0;F=k+8|0;z=Vj(f[F>>2]|0,f[F+4>>2]|0,B|0,f[D+4>>2]|0)|0;Yi(E,G,z,d[E+38>>1]|0);do if((f[w>>2]|0)!=(f[g>>2]|0)){E=f[q>>2]|0;if((f[E+4>>2]|0)==(f[E>>2]|0))break;E=0;do{f[l>>2]=E;f[e>>2]=f[l>>2];E=E+3|0;if(!(Uc(a,e)|0)){J=0;break a}z=f[q>>2]|0}while(E>>>0<(f[z+4>>2]|0)-(f[z>>2]|0)>>2>>>0)}while(0);if(b[a+308>>0]|0)ei(s);E=f[g>>2]|0;if((f[w>>2]|0)!=(E|0)){z=E;E=0;do{se(z+(E*144|0)+4|0,f[q>>2]|0)|0;G=f[g>>2]|0;D=f[G+(E*144|0)+132>>2]|0;B=f[G+(E*144|0)+136>>2]|0;if((D|0)==(B|0))K=G;else{F=G;G=D;while(1){f[m>>2]=f[G>>2];f[e>>2]=f[m>>2];_d(F+(E*144|0)+4|0,e);G=G+4|0;D=f[g>>2]|0;if((G|0)==(B|0)){K=D;break}else F=D}}Nh(K+(E*144|0)+4|0,0,0);E=E+1|0;z=f[g>>2]|0}while(E>>>0<(((f[w>>2]|0)-z|0)/144|0)>>>0)}z=f[q>>2]|0;E=(f[z+28>>2]|0)-(f[z+24>>2]|0)>>2;z=a+196|0;F=a+200|0;B=f[F>>2]|0;G=f[z>>2]|0;D=B-G>>2;L=G;G=B;do if(E>>>0>D>>>0)jf(z,E-D|0);else{if(E>>>0>=D>>>0)break;B=L+(E<<2)|0;if((G|0)==(B|0))break;f[F>>2]=G+(~((G+-4-B|0)>>>2)<<2)}while(0);ug(a+184|0,E);G=f[g>>2]|0;if((f[w>>2]|0)!=(G|0)){F=G;G=0;do{L=F;D=(f[L+(G*144|0)+60>>2]|0)-(f[L+(G*144|0)+56>>2]|0)>>2;z=f[q>>2]|0;B=(f[z+28>>2]|0)-(f[z+24>>2]|0)>>2;z=(D|0)<(B|0)?B:D;D=L+(G*144|0)+116|0;B=L+(G*144|0)+120|0;M=f[B>>2]|0;N=f[D>>2]|0;O=M-N>>2;P=N;N=M;do if(z>>>0>O>>>0)jf(D,z-O|0);else{if(z>>>0>=O>>>0)break;M=P+(z<<2)|0;if((N|0)==(M|0))break;f[B>>2]=N+(~((N+-4-M|0)>>>2)<<2)}while(0);ug(L+(G*144|0)+104|0,z);G=G+1|0;F=f[g>>2]|0}while(G>>>0<(((f[w>>2]|0)-F|0)/144|0)>>>0)}J=cb(a,C)|0}else H=50;while(0);if((H|0)==50)J=0;ln(k+24|0);x=J}else x=0;while(0);Q=x}else Q=0;R=Q}else R=0;r=R;u=c;return r|0}function eb(a,c,e,g,h){a=a|0;c=c|0;e=e|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0;i=u;u=u+64|0;j=i+16|0;k=i;l=i+24|0;m=i+8|0;n=i+20|0;f[j>>2]=c;o=(a|0)!=0;q=l+40|0;r=q;s=l+39|0;l=m+4|0;t=c;c=0;v=0;w=0;a:while(1){do if((c|0)>-1)if((v|0)>(2147483647-c|0)){x=Um()|0;f[x>>2]=75;y=-1;break}else{y=v+c|0;break}else y=c;while(0);x=b[t>>0]|0;if(!(x<<24>>24)){z=87;break}else{A=x;B=t}b:while(1){switch(A<<24>>24){case 37:{C=B;D=B;z=9;break b;break}case 0:{E=B;F=B;break b;break}default:{}}x=B+1|0;f[j>>2]=x;A=b[x>>0]|0;B=x}c:do if((z|0)==9)while(1){z=0;if((b[C+1>>0]|0)!=37){E=C;F=D;break c}x=D+1|0;G=C+2|0;f[j>>2]=G;if((b[G>>0]|0)==37){C=G;D=x;z=9}else{E=G;F=x;break}}while(0);x=F-t|0;if(o)ml(a,t,x);if(x|0){t=E;c=y;v=x;continue}x=E+1|0;G=(b[x>>0]|0)+-48|0;if(G>>>0<10){H=(b[E+2>>0]|0)==36;J=H?G:-1;K=H?1:w;L=H?E+3|0:x}else{J=-1;K=w;L=x}f[j>>2]=L;x=b[L>>0]|0;H=(x<<24>>24)+-32|0;d:do if(H>>>0<32){G=x;M=0;N=L;O=H;while(1){P=1<>2]=P;U=b[P>>0]|0;O=(U<<24>>24)+-32|0;if(O>>>0>=32){Q=U;R=P;S=T;break}else{G=U;M=T;N=P}}}else{Q=x;R=L;S=0}while(0);if(Q<<24>>24==42){x=R+1|0;H=(b[x>>0]|0)+-48|0;if(H>>>0<10?(b[R+2>>0]|0)==36:0){f[h+(H<<2)>>2]=10;V=1;W=R+3|0;X=f[g+((b[x>>0]|0)+-48<<3)>>2]|0}else{if(K|0){Y=-1;break}if(o){H=(f[e>>2]|0)+(4-1)&~(4-1);N=f[H>>2]|0;f[e>>2]=H+4;V=0;W=x;X=N}else{V=0;W=x;X=0}}f[j>>2]=W;x=(X|0)<0;Z=W;_=x?S|8192:S;$=V;aa=x?0-X|0:X}else{x=Th(j)|0;if((x|0)<0){Y=-1;break}Z=f[j>>2]|0;_=S;$=K;aa=x}do if((b[Z>>0]|0)==46){if((b[Z+1>>0]|0)!=42){f[j>>2]=Z+1;x=Th(j)|0;ba=f[j>>2]|0;ca=x;break}x=Z+2|0;N=(b[x>>0]|0)+-48|0;if(N>>>0<10?(b[Z+3>>0]|0)==36:0){f[h+(N<<2)>>2]=10;N=f[g+((b[x>>0]|0)+-48<<3)>>2]|0;H=Z+4|0;f[j>>2]=H;ba=H;ca=N;break}if($|0){Y=-1;break a}if(o){N=(f[e>>2]|0)+(4-1)&~(4-1);H=f[N>>2]|0;f[e>>2]=N+4;da=H}else da=0;f[j>>2]=x;ba=x;ca=da}else{ba=Z;ca=-1}while(0);x=ba;H=0;while(1){if(((b[x>>0]|0)+-65|0)>>>0>57){Y=-1;break a}ea=x+1|0;f[j>>2]=ea;fa=b[(b[x>>0]|0)+-65+(9882+(H*58|0))>>0]|0;ga=fa&255;if((ga+-1|0)>>>0<8){x=ea;H=ga}else break}if(!(fa<<24>>24)){Y=-1;break}N=(J|0)>-1;do if(fa<<24>>24==19)if(N){Y=-1;break a}else z=49;else{if(N){f[h+(J<<2)>>2]=ga;M=g+(J<<3)|0;G=f[M+4>>2]|0;O=k;f[O>>2]=f[M>>2];f[O+4>>2]=G;z=49;break}if(!o){Y=0;break a}Vc(k,ga,e)}while(0);if((z|0)==49?(z=0,!o):0){t=ea;c=y;v=0;w=$;continue}N=b[x>>0]|0;G=(H|0)!=0&(N&15|0)==3?N&-33:N;N=_&-65537;O=(_&8192|0)==0?_:N;e:do switch(G|0){case 110:{switch((H&255)<<24>>24){case 0:{f[f[k>>2]>>2]=y;t=ea;c=y;v=0;w=$;continue a;break}case 1:{f[f[k>>2]>>2]=y;t=ea;c=y;v=0;w=$;continue a;break}case 2:{M=f[k>>2]|0;f[M>>2]=y;f[M+4>>2]=((y|0)<0)<<31>>31;t=ea;c=y;v=0;w=$;continue a;break}case 3:{d[f[k>>2]>>1]=y;t=ea;c=y;v=0;w=$;continue a;break}case 4:{b[f[k>>2]>>0]=y;t=ea;c=y;v=0;w=$;continue a;break}case 6:{f[f[k>>2]>>2]=y;t=ea;c=y;v=0;w=$;continue a;break}case 7:{M=f[k>>2]|0;f[M>>2]=y;f[M+4>>2]=((y|0)<0)<<31>>31;t=ea;c=y;v=0;w=$;continue a;break}default:{t=ea;c=y;v=0;w=$;continue a}}break}case 112:{ha=O|8;ia=ca>>>0>8?ca:8;ja=120;z=61;break}case 88:case 120:{ha=O;ia=ca;ja=G;z=61;break}case 111:{M=k;P=f[M>>2]|0;T=f[M+4>>2]|0;M=Yh(P,T,q)|0;U=r-M|0;ka=P;la=T;ma=M;na=O;oa=(O&8|0)==0|(ca|0)>(U|0)?ca:U+1|0;pa=0;qa=10346;z=67;break}case 105:case 100:{U=k;M=f[U>>2]|0;T=f[U+4>>2]|0;if((T|0)<0){U=Vj(0,0,M|0,T|0)|0;P=I;ra=k;f[ra>>2]=U;f[ra+4>>2]=P;sa=U;ta=P;ua=1;va=10346;z=66;break e}else{sa=M;ta=T;ua=(O&2049|0)!=0&1;va=(O&2048|0)==0?((O&1|0)==0?10346:10348):10347;z=66;break e}break}case 117:{T=k;sa=f[T>>2]|0;ta=f[T+4>>2]|0;ua=0;va=10346;z=66;break}case 99:{b[s>>0]=f[k>>2];wa=s;xa=N;ya=1;za=0;Aa=10346;Ba=q;break}case 109:{T=Um()|0;Ca=sl(f[T>>2]|0)|0;z=71;break}case 115:{T=f[k>>2]|0;Ca=T|0?T:10356;z=71;break}case 67:{f[m>>2]=f[k>>2];f[l>>2]=0;f[k>>2]=m;Da=m;Ea=-1;z=75;break}case 83:{T=f[k>>2]|0;if(!ca){fh(a,32,aa,0,O);Fa=0;z=84}else{Da=T;Ea=ca;z=75}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{t=ea;c=y;v=bb(a,+p[k>>3],aa,ca,O,G)|0;w=$;continue a;break}default:{wa=t;xa=O;ya=ca;za=0;Aa=10346;Ba=q}}while(0);f:do if((z|0)==61){z=0;G=k;H=f[G>>2]|0;x=f[G+4>>2]|0;G=Hh(H,x,q,ja&32)|0;T=(ha&8|0)==0|(H|0)==0&(x|0)==0;ka=H;la=x;ma=G;na=ha;oa=ia;pa=T?0:2;qa=T?10346:10346+(ja>>4)|0;z=67}else if((z|0)==66){z=0;ka=sa;la=ta;ma=sg(sa,ta,q)|0;na=O;oa=ca;pa=ua;qa=va;z=67}else if((z|0)==71){z=0;T=Dd(Ca,0,ca)|0;G=(T|0)==0;wa=Ca;xa=N;ya=G?ca:T-Ca|0;za=0;Aa=10346;Ba=G?Ca+ca|0:T}else if((z|0)==75){z=0;T=0;G=0;x=Da;while(1){H=f[x>>2]|0;if(!H){Ga=T;Ha=G;break}M=bl(n,H)|0;if((M|0)<0|M>>>0>(Ea-T|0)>>>0){Ga=T;Ha=M;break}H=M+T|0;if(Ea>>>0>H>>>0){T=H;G=M;x=x+4|0}else{Ga=H;Ha=M;break}}if((Ha|0)<0){Y=-1;break a}fh(a,32,aa,Ga,O);if(!Ga){Fa=0;z=84}else{x=0;G=Da;while(1){T=f[G>>2]|0;if(!T){Fa=Ga;z=84;break f}M=bl(n,T)|0;x=M+x|0;if((x|0)>(Ga|0)){Fa=Ga;z=84;break f}ml(a,n,M);if(x>>>0>=Ga>>>0){Fa=Ga;z=84;break}else G=G+4|0}}}while(0);if((z|0)==67){z=0;N=(ka|0)!=0|(la|0)!=0;G=(oa|0)!=0|N;x=((N^1)&1)+(r-ma)|0;wa=G?ma:q;xa=(oa|0)>-1?na&-65537:na;ya=G?((oa|0)>(x|0)?oa:x):oa;za=pa;Aa=qa;Ba=q}else if((z|0)==84){z=0;fh(a,32,aa,Fa,O^8192);t=ea;c=y;v=(aa|0)>(Fa|0)?aa:Fa;w=$;continue}x=Ba-wa|0;G=(ya|0)<(x|0)?x:ya;N=G+za|0;M=(aa|0)<(N|0)?N:aa;fh(a,32,M,N,xa);ml(a,Aa,za);fh(a,48,M,N,xa^65536);fh(a,48,G,x,0);ml(a,wa,x);fh(a,32,M,N,xa^8192);t=ea;c=y;v=M;w=$}g:do if((z|0)==87)if(!a)if(!w)Y=0;else{$=1;while(1){v=f[h+($<<2)>>2]|0;if(!v){Ia=$;break}Vc(g+($<<3)|0,v,e);$=$+1|0;if(($|0)>=10){Y=1;break g}}while(1){if(f[h+(Ia<<2)>>2]|0){Y=-1;break g}Ia=Ia+1|0;if((Ia|0)>=10){Y=1;break}}}else Y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y>>2]&~(-1>>>(32-x|0));if(o>>>0>2){x=a+12|0;y=a+32|0;v=a+52|0;w=a+56|0;z=a+48|0;A=k;B=q;C=r;D=0;E=b;a:while(1){F=A;G=D*3|0;if((G|0)!=-1){H=f[F+(G<<2)>>2]|0;I=G+1|0;J=((I>>>0)%3|0|0)==0?G+-2|0:I;if((J|0)==-1)K=-1;else K=f[F+(J<<2)>>2]|0;J=(((G>>>0)%3|0|0)==0?2:-1)+G|0;if((J|0)==-1)L=-1;else L=f[F+(J<<2)>>2]|0;if((H|0)!=(K|0)?!((H|0)==(L|0)|(K|0)==(L|0)):0){H=C;J=B;F=0;I=E;while(1){M=F+G|0;if(!(f[(f[e>>2]|0)+(M>>>5<<2)>>2]&1<<(M&31))){N=f[(f[a>>2]|0)+(M<<2)>>2]|0;f[g>>2]=N;if(!(f[H+(N>>>5<<2)>>2]&1<<(N&31))){O=N;P=0;Q=I}else{N=f[i>>2]|0;if((N|0)==(f[y>>2]|0))yf(h,2652);else{f[N>>2]=-1;f[i>>2]=N+4}N=f[v>>2]|0;if((N|0)==(f[w>>2]|0))yf(z,g);else{f[N>>2]=f[g>>2];f[v>>2]=N+4}N=f[l>>2]|0;R=f[j>>2]|0;if((N|0)==(R<<5|0)){if((N+1|0)<0){S=52;break a}T=R<<6;R=N+32&-32;bf(d,N>>>0<1073741823?(T>>>0>>0?R:T):2147483647);U=f[l>>2]|0}else U=N;f[l>>2]=U+1;N=(f[d>>2]|0)+(U>>>5<<2)|0;f[N>>2]=f[N>>2]&~(1<<(U&31));f[g>>2]=I;O=I;P=1;Q=I+1|0}N=f[d>>2]|0;T=N+(O>>>5<<2)|0;f[T>>2]=f[T>>2]|1<<(O&31);T=N;b:do if(P){R=M;while(1){if((R|0)==-1){S=66;break b}V=(f[e>>2]|0)+(R>>>5<<2)|0;f[V>>2]=f[V>>2]|1<<(R&31);V=f[g>>2]|0;f[(f[h>>2]|0)+(V<<2)>>2]=R;f[(f[a>>2]|0)+(R<<2)>>2]=V;V=R+1|0;W=((V>>>0)%3|0|0)==0?R+-2|0:V;do if((W|0)==-1)X=-1;else{V=f[(f[x>>2]|0)+(W<<2)>>2]|0;Y=V+1|0;if((V|0)==-1){X=-1;break}X=((Y>>>0)%3|0|0)==0?V+-2|0:Y}while(0);if((X|0)==(M|0))break;else R=X}}else{R=M;while(1){if((R|0)==-1){S=66;break b}W=(f[e>>2]|0)+(R>>>5<<2)|0;f[W>>2]=f[W>>2]|1<<(R&31);f[(f[h>>2]|0)+(f[g>>2]<<2)>>2]=R;W=R+1|0;Y=((W>>>0)%3|0|0)==0?R+-2|0:W;do if((Y|0)==-1)Z=-1;else{W=f[(f[x>>2]|0)+(Y<<2)>>2]|0;V=W+1|0;if((W|0)==-1){Z=-1;break}Z=((V>>>0)%3|0|0)==0?W+-2|0:V}while(0);if((Z|0)==(M|0))break;else R=Z}}while(0);c:do if((S|0)==66){S=0;if((M|0)==-1)break;R=(((M>>>0)%3|0|0)==0?2:-1)+M|0;if((R|0)==-1)break;Y=f[(f[x>>2]|0)+(R<<2)>>2]|0;if((Y|0)==-1)break;R=Y+(((Y>>>0)%3|0|0)==0?2:-1)|0;if((R|0)==-1)break;if(!P){Y=R;while(1){V=(f[e>>2]|0)+(Y>>>5<<2)|0;f[V>>2]=f[V>>2]|1<<(Y&31);V=(((Y>>>0)%3|0|0)==0?2:-1)+Y|0;if((V|0)==-1)break c;W=f[(f[x>>2]|0)+(V<<2)>>2]|0;if((W|0)==-1)break c;Y=W+(((W>>>0)%3|0|0)==0?2:-1)|0;if((Y|0)==-1)break c}}Y=f[a>>2]|0;W=R;do{V=(f[e>>2]|0)+(W>>>5<<2)|0;f[V>>2]=f[V>>2]|1<<(W&31);f[Y+(W<<2)>>2]=f[g>>2];V=(((W>>>0)%3|0|0)==0?2:-1)+W|0;if((V|0)==-1)break c;_=f[(f[x>>2]|0)+(V<<2)>>2]|0;if((_|0)==-1)break c;W=_+(((_>>>0)%3|0|0)==0?2:-1)|0}while((W|0)!=-1)}while(0);$=T;aa=N;ba=Q}else{$=J;aa=H;ba=I}F=F+1|0;if((F|0)>=3){ca=$;da=aa;ea=ba;break}else{H=aa;J=$;I=ba}}}else{ca=B;da=C;ea=E}}else{ca=B;da=C;ea=E}D=D+1|0;A=f[a>>2]|0;if(D>>>0>=(((f[m>>2]|0)-A>>2>>>0)/3|0)>>>0){S=18;break}else{B=ca;C=da;E=ea}}if((S|0)==18){fa=ca;ga=f[l>>2]|0;break}else if((S|0)==52)ym(d)}else{fa=q;ga=p}}else{fa=q;ga=p}while(0);p=a+44|0;f[p>>2]=0;a=fa;fa=ga>>>5;q=a+(fa<<2)|0;S=ga&31;ga=(fa|0)!=0;d:do if(fa|S|0){if(!S){l=a;ca=0;ea=ga;while(1){e:do if(ea){da=ca;m=0;while(1){if(!(f[l>>2]&1<>2]=ba;ha=ba}else ha=da;if((m|0)==31){ia=ha;break}else{da=ha;m=m+1|0}}}else{m=ca;da=0;while(1){if(!(f[l>>2]&1<>2]=N;ja=N}else ja=m;if((da|0)==31){ia=ja;break e}da=da+1|0;if(!da)break d;else m=ja}}while(0);l=l+4|0;if((l|0)==(q|0))break d;else{ca=ia;ea=1}}}if(ga){ea=a;ca=0;l=0;while(1){m=l;da=ca;N=0;while(1){if(!(f[ea>>2]&1<>2]=T;ka=T;la=T}else{ka=da;la=m}if((N|0)==31)break;else{m=la;da=ka;N=N+1|0}}N=ea+4|0;if((N|0)==(q|0)){ma=N;na=ka;break}else{ea=N;ca=ka;l=la}}}else{ma=a;na=0}l=na;ca=0;while(1){if(!(f[ma>>2]&1<>2]=ea;oa=ea}else oa=l;ca=ca+1|0;if((ca|0)==(S|0))break;else l=oa}}while(0);oa=f[e>>2]|0;if(oa|0)fn(oa);oa=f[d>>2]|0;if(!oa){u=c;return 1}fn(oa);u=c;return 1}function gb(a){a=a|0;var c=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A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g>>2]|0;s=a+164|0;v=f[s>>2]|0;if((v|0)!=(w|0))f[s>>2]=v+(~((v+-4-w|0)>>>2)<<2);ug(g,f[h>>2]|0);g=a+172|0;w=f[g>>2]|0;v=a+176|0;s=f[v>>2]|0;if((s|0)!=(w|0))f[v>>2]=s+(~((s+-4-w|0)>>>2)<<2);ug(g,f[h>>2]|0);g=f[a+36>>2]|0;w=a+40|0;s=f[w>>2]|0;if((s|0)!=(g|0))f[w>>2]=s+(~(((s+-12-g|0)>>>0)/12|0)*12|0);g=f[a+48>>2]|0;s=a+52|0;w=f[s>>2]|0;if((w|0)!=(g|0))f[s>>2]=w+(~((w+-4-g|0)>>>2)<<2);f[a+64>>2]=0;g=f[a+72>>2]|0;w=a+76|0;s=f[w>>2]|0;if((s|0)!=(g|0))f[w>>2]=s+(~((s+-4-g|0)>>>2)<<2);f[a+84>>2]=-1;f[a+92>>2]=-1;f[a+88>>2]=-1;g=a+216|0;s=f[g>>2]|0;w=a+220|0;v=f[w>>2]|0;if((v|0)!=(s|0)){t=v;do{f[w>>2]=t+-144;v=f[t+-12>>2]|0;if(v|0){y=t+-8|0;z=f[y>>2]|0;if((z|0)!=(v|0))f[y>>2]=z+(~((z+-4-v|0)>>>2)<<2);fn(v)}v=f[t+-28>>2]|0;if(v|0){z=t+-24|0;y=f[z>>2]|0;if((y|0)!=(v|0))f[z>>2]=y+(~((y+-4-v|0)>>>2)<<2);fn(v)}v=f[t+-40>>2]|0;if(v|0){y=t+-36|0;z=f[y>>2]|0;if((z|0)!=(v|0))f[y>>2]=z+(~((z+-4-v|0)>>>2)<<2);fn(v)}vf(t+-140|0);t=f[w>>2]|0}while((t|0)!=(s|0))}s=p&255;Oe(g,s);if(!(Hf(f[q>>2]|0,f[h>>2]|0,(f[j>>2]|0)+(f[o>>2]|0)|0)|0)){x=0;break}t=(f[j>>2]|0)+(f[o>>2]|0)|0;b[e>>0]=1;ge(a+120|0,t,e);if((zc(a,f[(f[n>>2]|0)+32>>2]|0)|0)==-1){x=0;break}t=a+232|0;f[a+376>>2]=a;v=(La[f[(f[a>>2]|0)+32>>2]&127](a)|0)+32|0;z=f[v>>2]|0;v=(f[z>>2]|0)+(f[z+16>>2]|0)|0;z=(La[f[(f[a>>2]|0)+32>>2]&127](a)|0)+32|0;y=f[z>>2]|0;z=y+8|0;A=y+16|0;y=Vj(f[z>>2]|0,f[z+4>>2]|0,f[A>>2]|0,f[A+4>>2]|0)|0;A=(La[f[(f[a>>2]|0)+32>>2]&127](a)|0)+32|0;Yi(t,v,y,d[(f[A>>2]|0)+38>>1]|0);A=La[f[(f[a>>2]|0)+36>>2]&127](a)|0;f[a+380>>2]=A;f[a+384>>2]=(f[j>>2]|0)+(f[o>>2]|0);f[a+372>>2]=s;Fi(k);a:do if(ec(t,k)|0){s=Xa(a,f[i>>2]|0)|0;if((s|0)==-1){B=0;break}A=f[(f[n>>2]|0)+32>>2]|0;y=k+16|0;v=f[y>>2]|0;z=(f[k>>2]|0)+v|0;C=k+8|0;D=Vj(f[C>>2]|0,f[C+4>>2]|0,v|0,f[y+4>>2]|0)|0;Yi(A,z,D,d[A+38>>1]|0);do if((f[w>>2]|0)!=(f[g>>2]|0)){A=f[q>>2]|0;if((f[A+4>>2]|0)==(f[A>>2]|0))break;A=0;do{f[l>>2]=A;f[e>>2]=f[l>>2];A=A+3|0;if(!(Uc(a,e)|0)){B=0;break a}D=f[q>>2]|0}while(A>>>0<(f[D+4>>2]|0)-(f[D>>2]|0)>>2>>>0)}while(0);if(b[a+308>>0]|0)ei(a+272|0);A=f[g>>2]|0;if((f[w>>2]|0)!=(A|0)){D=A;A=0;do{se(D+(A*144|0)+4|0,f[q>>2]|0)|0;z=f[g>>2]|0;y=f[z+(A*144|0)+132>>2]|0;v=f[z+(A*144|0)+136>>2]|0;if((y|0)==(v|0))E=z;else{C=z;z=y;while(1){f[m>>2]=f[z>>2];f[e>>2]=f[m>>2];_d(C+(A*144|0)+4|0,e);z=z+4|0;y=f[g>>2]|0;if((z|0)==(v|0)){E=y;break}else C=y}}Nh(E+(A*144|0)+4|0,0,0);A=A+1|0;D=f[g>>2]|0}while(A>>>0<(((f[w>>2]|0)-D|0)/144|0)>>>0)}D=f[q>>2]|0;A=(f[D+28>>2]|0)-(f[D+24>>2]|0)>>2;D=a+196|0;C=a+200|0;v=f[C>>2]|0;z=f[D>>2]|0;y=v-z>>2;F=z;z=v;do if(A>>>0>y>>>0)jf(D,A-y|0);else{if(A>>>0>=y>>>0)break;v=F+(A<<2)|0;if((z|0)==(v|0))break;f[C>>2]=z+(~((z+-4-v|0)>>>2)<<2)}while(0);ug(a+184|0,A);z=f[g>>2]|0;if((f[w>>2]|0)!=(z|0)){C=z;z=0;do{F=C;y=(f[F+(z*144|0)+60>>2]|0)-(f[F+(z*144|0)+56>>2]|0)>>2;D=f[q>>2]|0;v=(f[D+28>>2]|0)-(f[D+24>>2]|0)>>2;D=(y|0)<(v|0)?v:y;y=F+(z*144|0)+116|0;v=F+(z*144|0)+120|0;G=f[v>>2]|0;H=f[y>>2]|0;J=G-H>>2;K=H;H=G;do if(D>>>0>J>>>0)jf(y,D-J|0);else{if(D>>>0>=J>>>0)break;G=K+(D<<2)|0;if((H|0)==(G|0))break;f[v>>2]=H+(~((H+-4-G|0)>>>2)<<2)}while(0);ug(F+(z*144|0)+104|0,D);z=z+1|0;C=f[g>>2]|0}while(z>>>0<(((f[w>>2]|0)-C|0)/144|0)>>>0)}B=cb(a,s)|0}else B=0;while(0);ln(k+24|0);x=B}else x=0;while(0);L=x}else L=0;M=L}else M=0;r=M;u=c;return r|0}function hb(a,c,e,g){a=a|0;c=c|0;e=e|0;g=g|0;var i=0,k=0,l=0,m=0,o=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=Ja,D=0,E=0.0,F=0,G=0;if(!g){i=0;return i|0}do switch(f[a+28>>2]|0){case 1:{k=a+24|0;l=b[k>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){m=f[f[a>>2]>>2]|0;o=a+40|0;q=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;r=Tj(q|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;q=m+r|0;while(1){r=b[q>>0]|0;m=g+(o<<3)|0;f[m>>2]=r;f[m+4>>2]=((r|0)<0)<<31>>31;o=o+1|0;r=b[k>>0]|0;if((o|0)>=((r<<24>>24>e<<24>>24?e:r)<<24>>24|0)){s=r;break}else q=q+1|0}}else s=l;q=s<<24>>24;if(s<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(q<<3)|0,0,(e<<24>>24)-q<<3|0)|0;i=1;return i|0}case 2:{q=a+24|0;o=b[q>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){k=f[f[a>>2]>>2]|0;r=a+40|0;m=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;t=Tj(m|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;m=k+t|0;while(1){t=g+(r<<3)|0;f[t>>2]=h[m>>0];f[t+4>>2]=0;r=r+1|0;t=b[q>>0]|0;if((r|0)>=((t<<24>>24>e<<24>>24?e:t)<<24>>24|0)){u=t;break}else m=m+1|0}}else u=o;m=u<<24>>24;if(u<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(m<<3)|0,0,(e<<24>>24)-m<<3|0)|0;i=1;return i|0}case 3:{m=a+24|0;r=b[m>>0]|0;if((r<<24>>24>e<<24>>24?e:r)<<24>>24>0){q=f[f[a>>2]>>2]|0;l=a+40|0;t=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;k=Tj(t|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;t=q+k|0;while(1){k=d[t>>1]|0;q=g+(l<<3)|0;f[q>>2]=k;f[q+4>>2]=((k|0)<0)<<31>>31;l=l+1|0;k=b[m>>0]|0;if((l|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){v=k;break}else t=t+2|0}}else v=r;t=v<<24>>24;if(v<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(t<<3)|0,0,(e<<24>>24)-t<<3|0)|0;i=1;return i|0}case 4:{t=a+24|0;l=b[t>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){m=f[f[a>>2]>>2]|0;o=a+40|0;k=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;q=Tj(k|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;k=m+q|0;while(1){q=g+(o<<3)|0;f[q>>2]=j[k>>1];f[q+4>>2]=0;o=o+1|0;q=b[t>>0]|0;if((o|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){w=q;break}else k=k+2|0}}else w=l;k=w<<24>>24;if(w<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(k<<3)|0,0,(e<<24>>24)-k<<3|0)|0;i=1;return i|0}case 5:{k=a+24|0;o=b[k>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){t=f[f[a>>2]>>2]|0;r=a+40|0;q=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;m=Tj(q|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;q=t+m|0;while(1){m=f[q>>2]|0;t=g+(r<<3)|0;f[t>>2]=m;f[t+4>>2]=((m|0)<0)<<31>>31;r=r+1|0;m=b[k>>0]|0;if((r|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){x=m;break}else q=q+4|0}}else x=o;q=x<<24>>24;if(x<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(q<<3)|0,0,(e<<24>>24)-q<<3|0)|0;i=1;return i|0}case 6:{q=a+24|0;r=b[q>>0]|0;if((r<<24>>24>e<<24>>24?e:r)<<24>>24>0){k=f[f[a>>2]>>2]|0;l=a+40|0;m=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;t=Tj(m|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;m=k+t|0;while(1){t=g+(l<<3)|0;f[t>>2]=f[m>>2];f[t+4>>2]=0;l=l+1|0;t=b[q>>0]|0;if((l|0)>=((t<<24>>24>e<<24>>24?e:t)<<24>>24|0)){y=t;break}else m=m+4|0}}else y=r;m=y<<24>>24;if(y<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(m<<3)|0,0,(e<<24>>24)-m<<3|0)|0;i=1;return i|0}case 7:{m=a+24|0;l=b[m>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){q=f[f[a>>2]>>2]|0;o=a+40|0;t=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;k=Tj(t|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;t=q+k|0;while(1){k=t;q=f[k+4>>2]|0;z=g+(o<<3)|0;f[z>>2]=f[k>>2];f[z+4>>2]=q;o=o+1|0;q=b[m>>0]|0;if((o|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){A=q;break}else t=t+8|0}}else A=l;t=A<<24>>24;if(A<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(t<<3)|0,0,(e<<24>>24)-t<<3|0)|0;i=1;return i|0}case 8:{t=a+24|0;o=b[t>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){m=f[f[a>>2]>>2]|0;r=a+40|0;q=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;z=Tj(q|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;q=m+z|0;while(1){z=q;m=f[z+4>>2]|0;k=g+(r<<3)|0;f[k>>2]=f[z>>2];f[k+4>>2]=m;r=r+1|0;m=b[t>>0]|0;if((r|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){B=m;break}else q=q+8|0}}else B=o;q=B<<24>>24;if(B<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(q<<3)|0,0,(e<<24>>24)-q<<3|0)|0;i=1;return i|0}case 9:{q=a+24|0;r=b[q>>0]|0;if((r<<24>>24>e<<24>>24?e:r)<<24>>24>0){t=f[f[a>>2]>>2]|0;l=a+40|0;m=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;k=Tj(m|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;m=t+k|0;while(1){C=$(n[m>>2]);k=+K(+C)>=1.0?(+C>0.0?~~+Y(+J(+C/4294967296.0),4294967295.0)>>>0:~~+W((+C-+(~~+C>>>0))/4294967296.0)>>>0):0;t=g+(l<<3)|0;f[t>>2]=~~+C>>>0;f[t+4>>2]=k;l=l+1|0;k=b[q>>0]|0;if((l|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){D=k;break}else m=m+4|0}}else D=r;m=D<<24>>24;if(D<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(m<<3)|0,0,(e<<24>>24)-m<<3|0)|0;i=1;return i|0}case 10:{m=a+24|0;l=b[m>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){q=f[f[a>>2]>>2]|0;o=a+40|0;k=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;t=Tj(k|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;k=q+t|0;while(1){E=+p[k>>3];t=+K(E)>=1.0?(E>0.0?~~+Y(+J(E/4294967296.0),4294967295.0)>>>0:~~+W((E-+(~~E>>>0))/4294967296.0)>>>0):0;q=g+(o<<3)|0;f[q>>2]=~~E>>>0;f[q+4>>2]=t;o=o+1|0;t=b[m>>0]|0;if((o|0)>=((t<<24>>24>e<<24>>24?e:t)<<24>>24|0)){F=t;break}else k=k+8|0}}else F=l;k=F<<24>>24;if(F<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(k<<3)|0,0,(e<<24>>24)-k<<3|0)|0;i=1;return i|0}case 11:{k=a+24|0;o=b[k>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){m=f[f[a>>2]>>2]|0;r=a+40|0;t=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;q=Tj(t|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;t=m+q|0;while(1){q=g+(r<<3)|0;f[q>>2]=h[t>>0];f[q+4>>2]=0;r=r+1|0;q=b[k>>0]|0;if((r|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){G=q;break}else t=t+1|0}}else G=o;t=G<<24>>24;if(G<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(t<<3)|0,0,(e<<24>>24)-t<<3|0)|0;i=1;return i|0}default:{i=0;return i|0}}while(0);return 0}function ib(a){a=a|0;var c=0,d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;c=u;u=u+32|0;d=c+20|0;e=c+16|0;g=c+4|0;i=c;j=a+32|0;if(!(eg(d,f[j>>2]|0)|0)){k=0;u=c;return k|0}if(!(eg(e,f[j>>2]|0)|0)){k=0;u=c;return k|0}l=f[d>>2]|0;if(l>>>0>1431655765){k=0;u=c;return k|0}m=f[e>>2]|0;n=lj(l|0,0,3,0)|0;o=I;if(0>o>>>0|0==(o|0)&m>>>0>n>>>0){k=0;u=c;return k|0}n=f[j>>2]|0;o=n+8|0;p=f[o+4>>2]|0;q=n+16|0;r=q;s=f[r>>2]|0;t=f[r+4>>2]|0;if(!((p|0)>(t|0)|((p|0)==(t|0)?(f[o>>2]|0)>>>0>s>>>0:0))){k=0;u=c;return k|0}o=b[(f[n>>2]|0)+s>>0]|0;p=Tj(s|0,t|0,1,0)|0;r=I;v=q;f[v>>2]=p;f[v+4>>2]=r;a:do if(!(o<<24>>24)){if(!(fd(a,l)|0)){k=0;u=c;return k|0}}else{if(m>>>0<256){if(!l)break;v=a+44|0;q=g+4|0;w=g+8|0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;x=n+8|0;y=f[x>>2]|0;z=f[x+4>>2]|0;b:do if((z|0)>(r|0)|(z|0)==(r|0)&y>>>0>p>>>0){x=n;A=l;B=p;C=r;D=z;E=y;F=0;while(1){G=x+16|0;H=f[x>>2]|0;J=b[H+B>>0]|0;K=Tj(B|0,C|0,1,0)|0;L=I;M=G;f[M>>2]=K;f[M+4>>2]=L;f[g>>2]=J&255;if(!((D|0)>(L|0)|(D|0)==(L|0)&E>>>0>K>>>0))break b;L=b[H+K>>0]|0;K=Tj(B|0,C|0,2,0)|0;J=I;M=G;f[M>>2]=K;f[M+4>>2]=J;f[q>>2]=L&255;if(!((D|0)>(J|0)|(D|0)==(J|0)&E>>>0>K>>>0))break b;J=b[H+K>>0]|0;K=Tj(B|0,C|0,3,0)|0;H=G;f[H>>2]=K;f[H+4>>2]=I;f[w>>2]=J&255;J=f[v>>2]|0;H=J+100|0;K=f[H>>2]|0;if((K|0)==(f[J+104>>2]|0)){df(J+96|0,g);N=f[d>>2]|0}else{f[K>>2]=f[g>>2];f[K+4>>2]=f[g+4>>2];f[K+8>>2]=f[g+8>>2];f[H>>2]=(f[H>>2]|0)+12;N=A}F=F+1|0;if(F>>>0>=N>>>0)break a;x=f[j>>2]|0;H=x+16|0;B=f[H>>2]|0;C=f[H+4>>2]|0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;H=x+8|0;E=f[H>>2]|0;D=f[H+4>>2]|0;if(!((D|0)>(C|0)|(D|0)==(C|0)&E>>>0>B>>>0))break;else A=N}}while(0);k=0;u=c;return k|0}if(m>>>0<65536){if(!l)break;v=a+44|0;w=g+4|0;q=g+8|0;f[g>>2]=0;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>2]|0;P=R+100|0;L=f[P>>2]|0;if((L|0)==(f[R+104>>2]|0)){df(R+96|0,g);T=f[d>>2]|0}else{f[L>>2]=f[g>>2];f[L+4>>2]=f[g+4>>2];f[L+8>>2]=f[g+8>>2];f[P>>2]=(f[P>>2]|0)+12;T=E}G=G+1|0;if(G>>>0>=T>>>0)break a;J=f[j>>2]|0;P=J+16|0;D=f[P>>2]|0;H=f[P+4>>2]|0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;P=J+8|0;C=f[P>>2]|0;F=f[P+4>>2]|0;K=Tj(D|0,H|0,4,0)|0;x=I;if((F|0)<(x|0)|(F|0)==(x|0)&C>>>0>>0)break;else E=T}}while(0);k=0;u=c;return k|0}}while(0);f[(f[a+4>>2]|0)+80>>2]=f[e>>2];k=1;u=c;return k|0}function jb(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;c=u;u=u+16|0;d=c+8|0;e=c;if((f[a+96>>2]|0)==(f[a+92>>2]|0)){u=c;return 1}g=a+56|0;h=f[g>>2]|0;if((h|0)==(f[a+60>>2]|0)){yf(a+52|0,b);i=b}else{f[h>>2]=f[b>>2];f[g>>2]=h+4;i=b}b=a+88|0;f[b>>2]=0;h=f[a>>2]|0;g=f[i>>2]|0;j=g+1|0;if((g|0)!=-1){k=((j>>>0)%3|0|0)==0?g+-2|0:j;if((k|0)==-1)l=-1;else l=f[(f[h>>2]|0)+(k<<2)>>2]|0;k=(((g>>>0)%3|0|0)==0?2:-1)+g|0;if((k|0)==-1){m=-1;n=l}else{m=f[(f[h>>2]|0)+(k<<2)>>2]|0;n=l}}else{m=-1;n=-1}l=a+24|0;k=f[l>>2]|0;h=k+(n>>>5<<2)|0;g=1<<(n&31);j=f[h>>2]|0;if(!(j&g)){f[h>>2]=j|g;g=f[i>>2]|0;j=g+1|0;if((g|0)==-1)o=-1;else o=((j>>>0)%3|0|0)==0?g+-2|0:j;f[e>>2]=o;j=f[(f[(f[a+44>>2]|0)+96>>2]|0)+(((o>>>0)/3|0)*12|0)+(((o>>>0)%3|0)<<2)>>2]|0;o=f[a+48>>2]|0;f[d>>2]=j;g=f[o+4>>2]|0;o=g+4|0;h=f[o>>2]|0;if((h|0)==(f[g+8>>2]|0))yf(g,d);else{f[h>>2]=j;f[o>>2]=h+4}h=a+40|0;o=f[h>>2]|0;j=o+4|0;g=f[j>>2]|0;if((g|0)==(f[o+8>>2]|0)){yf(o,e);p=f[h>>2]|0}else{f[g>>2]=f[e>>2];f[j>>2]=g+4;p=o}o=p+24|0;f[(f[p+12>>2]|0)+(n<<2)>>2]=f[o>>2];f[o>>2]=(f[o>>2]|0)+1;q=f[l>>2]|0}else q=k;k=q+(m>>>5<<2)|0;q=1<<(m&31);o=f[k>>2]|0;if(!(o&q)){f[k>>2]=o|q;q=f[i>>2]|0;do if((q|0)!=-1)if(!((q>>>0)%3|0)){r=q+2|0;break}else{r=q+-1|0;break}else r=-1;while(0);f[e>>2]=r;q=f[(f[(f[a+44>>2]|0)+96>>2]|0)+(((r>>>0)/3|0)*12|0)+(((r>>>0)%3|0)<<2)>>2]|0;r=f[a+48>>2]|0;f[d>>2]=q;o=f[r+4>>2]|0;r=o+4|0;k=f[r>>2]|0;if((k|0)==(f[o+8>>2]|0))yf(o,d);else{f[k>>2]=q;f[r>>2]=k+4}k=a+40|0;r=f[k>>2]|0;q=r+4|0;o=f[q>>2]|0;if((o|0)==(f[r+8>>2]|0)){yf(r,e);s=f[k>>2]|0}else{f[o>>2]=f[e>>2];f[q>>2]=o+4;s=r}r=s+24|0;f[(f[s+12>>2]|0)+(m<<2)>>2]=f[r>>2];f[r>>2]=(f[r>>2]|0)+1}r=f[i>>2]|0;if((r|0)==-1)t=-1;else t=f[(f[f[a>>2]>>2]|0)+(r<<2)>>2]|0;r=(f[l>>2]|0)+(t>>>5<<2)|0;m=1<<(t&31);s=f[r>>2]|0;if(!(m&s)){f[r>>2]=s|m;m=f[i>>2]|0;f[e>>2]=m;s=f[(f[(f[a+44>>2]|0)+96>>2]|0)+(((m>>>0)/3|0)*12|0)+(((m>>>0)%3|0)<<2)>>2]|0;m=f[a+48>>2]|0;f[d>>2]=s;r=f[m+4>>2]|0;m=r+4|0;o=f[m>>2]|0;if((o|0)==(f[r+8>>2]|0))yf(r,d);else{f[o>>2]=s;f[m>>2]=o+4}o=a+40|0;m=f[o>>2]|0;s=m+4|0;r=f[s>>2]|0;if((r|0)==(f[m+8>>2]|0)){yf(m,e);v=f[o>>2]|0}else{f[r>>2]=f[e>>2];f[s>>2]=r+4;v=m}m=v+24|0;f[(f[v+12>>2]|0)+(t<<2)>>2]=f[m>>2];f[m>>2]=(f[m>>2]|0)+1}m=f[b>>2]|0;a:do if((m|0)<3){t=a+12|0;v=a+44|0;r=a+48|0;s=a+40|0;o=a+92|0;q=m;while(1){k=q;while(1){w=a+52+(k*12|0)+4|0;x=f[w>>2]|0;if((f[a+52+(k*12|0)>>2]|0)!=(x|0))break;n=k+1|0;if((n|0)<3)k=n;else break a}n=x+-4|0;p=f[n>>2]|0;f[w>>2]=n;f[b>>2]=k;f[i>>2]=p;if((p|0)==-1)break;n=(p>>>0)/3|0;g=f[t>>2]|0;do if(!(f[g+(n>>>5<<2)>>2]&1<<(n&31))){j=p;h=g;b:while(1){y=(j>>>0)/3|0;z=h+(y>>>5<<2)|0;f[z>>2]=1<<(y&31)|f[z>>2];z=f[i>>2]|0;if((z|0)==-1)A=-1;else A=f[(f[f[a>>2]>>2]|0)+(z<<2)>>2]|0;y=(f[l>>2]|0)+(A>>>5<<2)|0;B=1<<(A&31);C=f[y>>2]|0;if(!(B&C)){f[y>>2]=C|B;B=f[i>>2]|0;f[e>>2]=B;C=f[(f[(f[v>>2]|0)+96>>2]|0)+(((B>>>0)/3|0)*12|0)+(((B>>>0)%3|0)<<2)>>2]|0;B=f[r>>2]|0;f[d>>2]=C;y=f[B+4>>2]|0;B=y+4|0;D=f[B>>2]|0;if((D|0)==(f[y+8>>2]|0))yf(y,d);else{f[D>>2]=C;f[B>>2]=D+4}D=f[s>>2]|0;B=D+4|0;C=f[B>>2]|0;if((C|0)==(f[D+8>>2]|0)){yf(D,e);E=f[s>>2]|0}else{f[C>>2]=f[e>>2];f[B>>2]=C+4;E=D}D=E+24|0;f[(f[E+12>>2]|0)+(A<<2)>>2]=f[D>>2];f[D>>2]=(f[D>>2]|0)+1;F=f[i>>2]|0}else F=z;z=f[a>>2]|0;if((F|0)==-1){G=93;break}D=F+1|0;C=((D>>>0)%3|0|0)==0?F+-2|0:D;if((C|0)==-1)H=-1;else H=f[(f[z+12>>2]|0)+(C<<2)>>2]|0;C=(((F>>>0)%3|0|0)==0?2:-1)+F|0;if((C|0)==-1)I=-1;else I=f[(f[z+12>>2]|0)+(C<<2)>>2]|0;C=(H|0)==-1;D=C?-1:(H>>>0)/3|0;B=(I|0)==-1;y=B?-1:(I>>>0)/3|0;if(C)J=1;else J=(f[(f[t>>2]|0)+(D>>>5<<2)>>2]&1<<(D&31)|0)!=0;do if(B)if(J){G=93;break b}else G=82;else{if(f[(f[t>>2]|0)+(y>>>5<<2)>>2]&1<<(y&31)|0)if(J){G=93;break b}else{G=82;break}D=f[(f[z>>2]|0)+(I<<2)>>2]|0;if(!(1<<(D&31)&f[(f[l>>2]|0)+(D>>>5<<2)>>2])){K=(f[o>>2]|0)+(D<<2)|0;D=f[K>>2]|0;f[K>>2]=D+1;L=(D|0)>0?1:2}else L=0;if(J?(L|0)<=(f[b>>2]|0):0){M=I;break}f[d>>2]=I;D=a+52+(L*12|0)+4|0;K=f[D>>2]|0;if((K|0)==(f[a+52+(L*12|0)+8>>2]|0))yf(a+52+(L*12|0)|0,d);else{f[K>>2]=I;f[D>>2]=K+4}if((f[b>>2]|0)>(L|0))f[b>>2]=L;if(J){G=93;break b}else G=82}while(0);if((G|0)==82){G=0;if(C)N=-1;else N=f[(f[f[a>>2]>>2]|0)+(H<<2)>>2]|0;if(!(1<<(N&31)&f[(f[l>>2]|0)+(N>>>5<<2)>>2])){z=(f[o>>2]|0)+(N<<2)|0;y=f[z>>2]|0;f[z>>2]=y+1;O=(y|0)>0?1:2}else O=0;if((O|0)>(f[b>>2]|0))break;else M=H}f[i>>2]=M;j=M;h=f[t>>2]|0}if((G|0)==93){G=0;P=f[b>>2]|0;break}f[d>>2]=H;h=a+52+(O*12|0)+4|0;j=f[h>>2]|0;if((j|0)==(f[a+52+(O*12|0)+8>>2]|0))yf(a+52+(O*12|0)|0,d);else{f[j>>2]=H;f[h>>2]=j+4}j=f[b>>2]|0;if((j|0)>(O|0)){f[b>>2]=O;Q=O}else Q=j;P=Q}else P=k;while(0);if((P|0)<3)q=P;else break a}u=c;return 1}while(0);f[i>>2]=-1;u=c;return 1}function kb(a,c,e,g){a=a|0;c=c|0;e=e|0;g=g|0;var i=0,j=0,k=0,l=0,m=0,o=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;if(!g){i=0;return i|0}do switch(f[a+28>>2]|0){case 1:{j=a+24|0;k=b[j>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0){l=f[f[a>>2]>>2]|0;m=a+40|0;o=lj(f[m>>2]|0,f[m+4>>2]|0,f[c>>2]|0,0)|0;m=a+48|0;q=Tj(o|0,I|0,f[m>>2]|0,f[m+4>>2]|0)|0;m=0;o=l+q|0;while(1){d[g+(m<<1)>>1]=b[o>>0]|0;m=m+1|0;q=b[j>>0]|0;if((m|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){r=q;break}else o=o+1|0}}else r=k;o=r<<24>>24;if(r<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(o<<1)|0,0,(e<<24>>24)-o<<1|0)|0;i=1;return i|0}case 2:{o=a+24|0;m=b[o>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0){j=f[f[a>>2]>>2]|0;q=a+40|0;l=lj(f[q>>2]|0,f[q+4>>2]|0,f[c>>2]|0,0)|0;q=a+48|0;s=Tj(l|0,I|0,f[q>>2]|0,f[q+4>>2]|0)|0;q=0;l=j+s|0;while(1){d[g+(q<<1)>>1]=h[l>>0]|0;q=q+1|0;s=b[o>>0]|0;if((q|0)>=((s<<24>>24>e<<24>>24?e:s)<<24>>24|0)){t=s;break}else l=l+1|0}}else t=m;l=t<<24>>24;if(t<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(l<<1)|0,0,(e<<24>>24)-l<<1|0)|0;i=1;return i|0}case 3:{l=a+24|0;q=b[l>>0]|0;if((q<<24>>24>e<<24>>24?e:q)<<24>>24>0){o=f[f[a>>2]>>2]|0;k=a+40|0;s=lj(f[k>>2]|0,f[k+4>>2]|0,f[c>>2]|0,0)|0;k=a+48|0;j=Tj(s|0,I|0,f[k>>2]|0,f[k+4>>2]|0)|0;k=0;s=o+j|0;while(1){d[g+(k<<1)>>1]=d[s>>1]|0;k=k+1|0;j=b[l>>0]|0;if((k|0)>=((j<<24>>24>e<<24>>24?e:j)<<24>>24|0)){u=j;break}else s=s+2|0}}else u=q;s=u<<24>>24;if(u<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(s<<1)|0,0,(e<<24>>24)-s<<1|0)|0;i=1;return i|0}case 4:{s=a+24|0;k=b[s>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0){l=f[f[a>>2]>>2]|0;m=a+40|0;j=lj(f[m>>2]|0,f[m+4>>2]|0,f[c>>2]|0,0)|0;m=a+48|0;o=Tj(j|0,I|0,f[m>>2]|0,f[m+4>>2]|0)|0;m=0;j=l+o|0;while(1){d[g+(m<<1)>>1]=d[j>>1]|0;m=m+1|0;o=b[s>>0]|0;if((m|0)>=((o<<24>>24>e<<24>>24?e:o)<<24>>24|0)){v=o;break}else j=j+2|0}}else v=k;j=v<<24>>24;if(v<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(j<<1)|0,0,(e<<24>>24)-j<<1|0)|0;i=1;return i|0}case 5:{j=a+24|0;m=b[j>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0){s=f[f[a>>2]>>2]|0;q=a+40|0;o=lj(f[q>>2]|0,f[q+4>>2]|0,f[c>>2]|0,0)|0;q=a+48|0;l=Tj(o|0,I|0,f[q>>2]|0,f[q+4>>2]|0)|0;q=0;o=s+l|0;while(1){d[g+(q<<1)>>1]=f[o>>2];q=q+1|0;l=b[j>>0]|0;if((q|0)>=((l<<24>>24>e<<24>>24?e:l)<<24>>24|0)){w=l;break}else o=o+4|0}}else w=m;o=w<<24>>24;if(w<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(o<<1)|0,0,(e<<24>>24)-o<<1|0)|0;i=1;return i|0}case 6:{o=a+24|0;q=b[o>>0]|0;if((q<<24>>24>e<<24>>24?e:q)<<24>>24>0){j=f[f[a>>2]>>2]|0;k=a+40|0;l=lj(f[k>>2]|0,f[k+4>>2]|0,f[c>>2]|0,0)|0;k=a+48|0;s=Tj(l|0,I|0,f[k>>2]|0,f[k+4>>2]|0)|0;k=0;l=j+s|0;while(1){d[g+(k<<1)>>1]=f[l>>2];k=k+1|0;s=b[o>>0]|0;if((k|0)>=((s<<24>>24>e<<24>>24?e:s)<<24>>24|0)){x=s;break}else l=l+4|0}}else x=q;l=x<<24>>24;if(x<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(l<<1)|0,0,(e<<24>>24)-l<<1|0)|0;i=1;return i|0}case 7:{l=a+24|0;k=b[l>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0){o=f[f[a>>2]>>2]|0;m=a+40|0;s=lj(f[m>>2]|0,f[m+4>>2]|0,f[c>>2]|0,0)|0;m=a+48|0;j=Tj(s|0,I|0,f[m>>2]|0,f[m+4>>2]|0)|0;m=0;s=o+j|0;while(1){d[g+(m<<1)>>1]=f[s>>2];m=m+1|0;j=b[l>>0]|0;if((m|0)>=((j<<24>>24>e<<24>>24?e:j)<<24>>24|0)){y=j;break}else s=s+8|0}}else y=k;s=y<<24>>24;if(y<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(s<<1)|0,0,(e<<24>>24)-s<<1|0)|0;i=1;return i|0}case 8:{s=a+24|0;m=b[s>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0){l=f[f[a>>2]>>2]|0;q=a+40|0;j=lj(f[q>>2]|0,f[q+4>>2]|0,f[c>>2]|0,0)|0;q=a+48|0;o=Tj(j|0,I|0,f[q>>2]|0,f[q+4>>2]|0)|0;q=0;j=l+o|0;while(1){d[g+(q<<1)>>1]=f[j>>2];q=q+1|0;o=b[s>>0]|0;if((q|0)>=((o<<24>>24>e<<24>>24?e:o)<<24>>24|0)){z=o;break}else j=j+8|0}}else z=m;j=z<<24>>24;if(z<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(j<<1)|0,0,(e<<24>>24)-j<<1|0)|0;i=1;return i|0}case 9:{j=a+24|0;q=b[j>>0]|0;if((q<<24>>24>e<<24>>24?e:q)<<24>>24>0){s=f[f[a>>2]>>2]|0;k=a+40|0;o=lj(f[k>>2]|0,f[k+4>>2]|0,f[c>>2]|0,0)|0;k=a+48|0;l=Tj(o|0,I|0,f[k>>2]|0,f[k+4>>2]|0)|0;k=0;o=s+l|0;while(1){l=~~$(n[o>>2])&65535;d[g+(k<<1)>>1]=l;k=k+1|0;l=b[j>>0]|0;if((k|0)>=((l<<24>>24>e<<24>>24?e:l)<<24>>24|0)){A=l;break}else o=o+4|0}}else A=q;o=A<<24>>24;if(A<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(o<<1)|0,0,(e<<24>>24)-o<<1|0)|0;i=1;return i|0}case 10:{o=a+24|0;k=b[o>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0){j=f[f[a>>2]>>2]|0;m=a+40|0;l=lj(f[m>>2]|0,f[m+4>>2]|0,f[c>>2]|0,0)|0;m=a+48|0;s=Tj(l|0,I|0,f[m>>2]|0,f[m+4>>2]|0)|0;m=0;l=j+s|0;while(1){d[g+(m<<1)>>1]=~~+p[l>>3];m=m+1|0;s=b[o>>0]|0;if((m|0)>=((s<<24>>24>e<<24>>24?e:s)<<24>>24|0)){B=s;break}else l=l+8|0}}else B=k;l=B<<24>>24;if(B<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(l<<1)|0,0,(e<<24>>24)-l<<1|0)|0;i=1;return i|0}case 11:{l=a+24|0;m=b[l>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0){o=f[f[a>>2]>>2]|0;q=a+40|0;s=lj(f[q>>2]|0,f[q+4>>2]|0,f[c>>2]|0,0)|0;q=a+48|0;j=Tj(s|0,I|0,f[q>>2]|0,f[q+4>>2]|0)|0;q=0;s=o+j|0;while(1){d[g+(q<<1)>>1]=h[s>>0]|0;q=q+1|0;j=b[l>>0]|0;if((q|0)>=((j<<24>>24>e<<24>>24?e:j)<<24>>24|0)){C=j;break}else s=s+1|0}}else C=m;s=C<<24>>24;if(C<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(s<<1)|0,0,(e<<24>>24)-s<<1|0)|0;i=1;return i|0}default:{i=0;return i|0}}while(0);return 0}function lb(a,c,e,g){a=a|0;c=c|0;e=e|0;g=g|0;var i=0,j=0,k=0,l=0,m=0,o=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;if(!g){i=0;return i|0}do switch(f[a+28>>2]|0){case 1:{j=a+24|0;k=b[j>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0){l=f[f[a>>2]>>2]|0;m=a+40|0;o=lj(f[m>>2]|0,f[m+4>>2]|0,f[c>>2]|0,0)|0;m=a+48|0;q=Tj(o|0,I|0,f[m>>2]|0,f[m+4>>2]|0)|0;m=0;o=l+q|0;while(1){d[g+(m<<1)>>1]=b[o>>0]|0;m=m+1|0;q=b[j>>0]|0;if((m|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){r=q;break}else o=o+1|0}}else r=k;o=r<<24>>24;if(r<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(o<<1)|0,0,(e<<24>>24)-o<<1|0)|0;i=1;return i|0}case 2:{o=a+24|0;m=b[o>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0){j=f[f[a>>2]>>2]|0;q=a+40|0;l=lj(f[q>>2]|0,f[q+4>>2]|0,f[c>>2]|0,0)|0;q=a+48|0;s=Tj(l|0,I|0,f[q>>2]|0,f[q+4>>2]|0)|0;q=0;l=j+s|0;while(1){d[g+(q<<1)>>1]=h[l>>0]|0;q=q+1|0;s=b[o>>0]|0;if((q|0)>=((s<<24>>24>e<<24>>24?e:s)<<24>>24|0)){t=s;break}else l=l+1|0}}else t=m;l=t<<24>>24;if(t<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(l<<1)|0,0,(e<<24>>24)-l<<1|0)|0;i=1;return i|0}case 3:{l=a+24|0;q=b[l>>0]|0;if((q<<24>>24>e<<24>>24?e:q)<<24>>24>0){o=f[f[a>>2]>>2]|0;k=a+40|0;s=lj(f[k>>2]|0,f[k+4>>2]|0,f[c>>2]|0,0)|0;k=a+48|0;j=Tj(s|0,I|0,f[k>>2]|0,f[k+4>>2]|0)|0;k=0;s=o+j|0;while(1){d[g+(k<<1)>>1]=d[s>>1]|0;k=k+1|0;j=b[l>>0]|0;if((k|0)>=((j<<24>>24>e<<24>>24?e:j)<<24>>24|0)){u=j;break}else s=s+2|0}}else u=q;s=u<<24>>24;if(u<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(s<<1)|0,0,(e<<24>>24)-s<<1|0)|0;i=1;return i|0}case 4:{s=a+24|0;k=b[s>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0){l=f[f[a>>2]>>2]|0;m=a+40|0;j=lj(f[m>>2]|0,f[m+4>>2]|0,f[c>>2]|0,0)|0;m=a+48|0;o=Tj(j|0,I|0,f[m>>2]|0,f[m+4>>2]|0)|0;m=0;j=l+o|0;while(1){d[g+(m<<1)>>1]=d[j>>1]|0;m=m+1|0;o=b[s>>0]|0;if((m|0)>=((o<<24>>24>e<<24>>24?e:o)<<24>>24|0)){v=o;break}else j=j+2|0}}else v=k;j=v<<24>>24;if(v<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(j<<1)|0,0,(e<<24>>24)-j<<1|0)|0;i=1;return i|0}case 5:{j=a+24|0;m=b[j>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0){s=f[f[a>>2]>>2]|0;q=a+40|0;o=lj(f[q>>2]|0,f[q+4>>2]|0,f[c>>2]|0,0)|0;q=a+48|0;l=Tj(o|0,I|0,f[q>>2]|0,f[q+4>>2]|0)|0;q=0;o=s+l|0;while(1){d[g+(q<<1)>>1]=f[o>>2];q=q+1|0;l=b[j>>0]|0;if((q|0)>=((l<<24>>24>e<<24>>24?e:l)<<24>>24|0)){w=l;break}else o=o+4|0}}else w=m;o=w<<24>>24;if(w<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(o<<1)|0,0,(e<<24>>24)-o<<1|0)|0;i=1;return i|0}case 6:{o=a+24|0;q=b[o>>0]|0;if((q<<24>>24>e<<24>>24?e:q)<<24>>24>0){j=f[f[a>>2]>>2]|0;k=a+40|0;l=lj(f[k>>2]|0,f[k+4>>2]|0,f[c>>2]|0,0)|0;k=a+48|0;s=Tj(l|0,I|0,f[k>>2]|0,f[k+4>>2]|0)|0;k=0;l=j+s|0;while(1){d[g+(k<<1)>>1]=f[l>>2];k=k+1|0;s=b[o>>0]|0;if((k|0)>=((s<<24>>24>e<<24>>24?e:s)<<24>>24|0)){x=s;break}else l=l+4|0}}else x=q;l=x<<24>>24;if(x<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(l<<1)|0,0,(e<<24>>24)-l<<1|0)|0;i=1;return i|0}case 7:{l=a+24|0;k=b[l>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0){o=f[f[a>>2]>>2]|0;m=a+40|0;s=lj(f[m>>2]|0,f[m+4>>2]|0,f[c>>2]|0,0)|0;m=a+48|0;j=Tj(s|0,I|0,f[m>>2]|0,f[m+4>>2]|0)|0;m=0;s=o+j|0;while(1){d[g+(m<<1)>>1]=f[s>>2];m=m+1|0;j=b[l>>0]|0;if((m|0)>=((j<<24>>24>e<<24>>24?e:j)<<24>>24|0)){y=j;break}else s=s+8|0}}else y=k;s=y<<24>>24;if(y<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(s<<1)|0,0,(e<<24>>24)-s<<1|0)|0;i=1;return i|0}case 8:{s=a+24|0;m=b[s>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0){l=f[f[a>>2]>>2]|0;q=a+40|0;j=lj(f[q>>2]|0,f[q+4>>2]|0,f[c>>2]|0,0)|0;q=a+48|0;o=Tj(j|0,I|0,f[q>>2]|0,f[q+4>>2]|0)|0;q=0;j=l+o|0;while(1){d[g+(q<<1)>>1]=f[j>>2];q=q+1|0;o=b[s>>0]|0;if((q|0)>=((o<<24>>24>e<<24>>24?e:o)<<24>>24|0)){z=o;break}else j=j+8|0}}else z=m;j=z<<24>>24;if(z<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(j<<1)|0,0,(e<<24>>24)-j<<1|0)|0;i=1;return i|0}case 9:{j=a+24|0;q=b[j>>0]|0;if((q<<24>>24>e<<24>>24?e:q)<<24>>24>0){s=f[f[a>>2]>>2]|0;k=a+40|0;o=lj(f[k>>2]|0,f[k+4>>2]|0,f[c>>2]|0,0)|0;k=a+48|0;l=Tj(o|0,I|0,f[k>>2]|0,f[k+4>>2]|0)|0;k=0;o=s+l|0;while(1){l=~~$(n[o>>2]);d[g+(k<<1)>>1]=l;k=k+1|0;l=b[j>>0]|0;if((k|0)>=((l<<24>>24>e<<24>>24?e:l)<<24>>24|0)){A=l;break}else o=o+4|0}}else A=q;o=A<<24>>24;if(A<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(o<<1)|0,0,(e<<24>>24)-o<<1|0)|0;i=1;return i|0}case 10:{o=a+24|0;k=b[o>>0]|0;if((k<<24>>24>e<<24>>24?e:k)<<24>>24>0){j=f[f[a>>2]>>2]|0;m=a+40|0;l=lj(f[m>>2]|0,f[m+4>>2]|0,f[c>>2]|0,0)|0;m=a+48|0;s=Tj(l|0,I|0,f[m>>2]|0,f[m+4>>2]|0)|0;m=0;l=j+s|0;while(1){d[g+(m<<1)>>1]=~~+p[l>>3];m=m+1|0;s=b[o>>0]|0;if((m|0)>=((s<<24>>24>e<<24>>24?e:s)<<24>>24|0)){B=s;break}else l=l+8|0}}else B=k;l=B<<24>>24;if(B<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(l<<1)|0,0,(e<<24>>24)-l<<1|0)|0;i=1;return i|0}case 11:{l=a+24|0;m=b[l>>0]|0;if((m<<24>>24>e<<24>>24?e:m)<<24>>24>0){o=f[f[a>>2]>>2]|0;q=a+40|0;s=lj(f[q>>2]|0,f[q+4>>2]|0,f[c>>2]|0,0)|0;q=a+48|0;j=Tj(s|0,I|0,f[q>>2]|0,f[q+4>>2]|0)|0;q=0;s=o+j|0;while(1){d[g+(q<<1)>>1]=h[s>>0]|0;q=q+1|0;j=b[l>>0]|0;if((q|0)>=((j<<24>>24>e<<24>>24?e:j)<<24>>24|0)){C=j;break}else s=s+1|0}}else C=m;s=C<<24>>24;if(C<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(s<<1)|0,0,(e<<24>>24)-s<<1|0)|0;i=1;return i|0}default:{i=0;return i|0}}while(0);return 0}function mb(a,c,e,g){a=a|0;c=c|0;e=e|0;g=g|0;var i=0,k=0,l=0,m=0,o=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;if(!g){i=0;return i|0}do switch(f[a+28>>2]|0){case 1:{k=a+24|0;l=b[k>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){m=f[f[a>>2]>>2]|0;o=a+40|0;q=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;r=Tj(q|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;q=m+r|0;while(1){f[g+(o<<2)>>2]=b[q>>0];o=o+1|0;r=b[k>>0]|0;if((o|0)>=((r<<24>>24>e<<24>>24?e:r)<<24>>24|0)){s=r;break}else q=q+1|0}}else s=l;q=s<<24>>24;if(s<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(q<<2)|0,0,(e<<24>>24)-q<<2|0)|0;i=1;return i|0}case 2:{q=a+24|0;o=b[q>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){k=f[f[a>>2]>>2]|0;r=a+40|0;m=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;t=Tj(m|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;m=k+t|0;while(1){f[g+(r<<2)>>2]=h[m>>0];r=r+1|0;t=b[q>>0]|0;if((r|0)>=((t<<24>>24>e<<24>>24?e:t)<<24>>24|0)){u=t;break}else m=m+1|0}}else u=o;m=u<<24>>24;if(u<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(m<<2)|0,0,(e<<24>>24)-m<<2|0)|0;i=1;return i|0}case 3:{m=a+24|0;r=b[m>>0]|0;if((r<<24>>24>e<<24>>24?e:r)<<24>>24>0){q=f[f[a>>2]>>2]|0;l=a+40|0;t=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;k=Tj(t|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;t=q+k|0;while(1){f[g+(l<<2)>>2]=d[t>>1];l=l+1|0;k=b[m>>0]|0;if((l|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){v=k;break}else t=t+2|0}}else v=r;t=v<<24>>24;if(v<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(t<<2)|0,0,(e<<24>>24)-t<<2|0)|0;i=1;return i|0}case 4:{t=a+24|0;l=b[t>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){m=f[f[a>>2]>>2]|0;o=a+40|0;k=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;q=Tj(k|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;k=m+q|0;while(1){f[g+(o<<2)>>2]=j[k>>1];o=o+1|0;q=b[t>>0]|0;if((o|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){w=q;break}else k=k+2|0}}else w=l;k=w<<24>>24;if(w<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(k<<2)|0,0,(e<<24>>24)-k<<2|0)|0;i=1;return i|0}case 5:{k=a+24|0;o=b[k>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){t=f[f[a>>2]>>2]|0;r=a+40|0;q=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;m=Tj(q|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;q=t+m|0;while(1){f[g+(r<<2)>>2]=f[q>>2];r=r+1|0;m=b[k>>0]|0;if((r|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){x=m;break}else q=q+4|0}}else x=o;q=x<<24>>24;if(x<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(q<<2)|0,0,(e<<24>>24)-q<<2|0)|0;i=1;return i|0}case 6:{q=a+24|0;r=b[q>>0]|0;if((r<<24>>24>e<<24>>24?e:r)<<24>>24>0){k=f[f[a>>2]>>2]|0;l=a+40|0;m=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;t=Tj(m|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;m=k+t|0;while(1){f[g+(l<<2)>>2]=f[m>>2];l=l+1|0;t=b[q>>0]|0;if((l|0)>=((t<<24>>24>e<<24>>24?e:t)<<24>>24|0)){y=t;break}else m=m+4|0}}else y=r;m=y<<24>>24;if(y<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(m<<2)|0,0,(e<<24>>24)-m<<2|0)|0;i=1;return i|0}case 7:{m=a+24|0;l=b[m>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){q=f[f[a>>2]>>2]|0;o=a+40|0;t=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;k=Tj(t|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;t=q+k|0;while(1){f[g+(o<<2)>>2]=f[t>>2];o=o+1|0;k=b[m>>0]|0;if((o|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){z=k;break}else t=t+8|0}}else z=l;t=z<<24>>24;if(z<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(t<<2)|0,0,(e<<24>>24)-t<<2|0)|0;i=1;return i|0}case 8:{t=a+24|0;o=b[t>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){m=f[f[a>>2]>>2]|0;r=a+40|0;k=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;q=Tj(k|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;k=m+q|0;while(1){f[g+(r<<2)>>2]=f[k>>2];r=r+1|0;q=b[t>>0]|0;if((r|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){A=q;break}else k=k+8|0}}else A=o;k=A<<24>>24;if(A<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(k<<2)|0,0,(e<<24>>24)-k<<2|0)|0;i=1;return i|0}case 9:{k=a+24|0;r=b[k>>0]|0;if((r<<24>>24>e<<24>>24?e:r)<<24>>24>0){t=f[f[a>>2]>>2]|0;l=a+40|0;q=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;m=Tj(q|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;q=t+m|0;while(1){m=~~$(n[q>>2])>>>0;f[g+(l<<2)>>2]=m;l=l+1|0;m=b[k>>0]|0;if((l|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){B=m;break}else q=q+4|0}}else B=r;q=B<<24>>24;if(B<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(q<<2)|0,0,(e<<24>>24)-q<<2|0)|0;i=1;return i|0}case 10:{q=a+24|0;l=b[q>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){k=f[f[a>>2]>>2]|0;o=a+40|0;m=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;t=Tj(m|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;m=k+t|0;while(1){f[g+(o<<2)>>2]=~~+p[m>>3]>>>0;o=o+1|0;t=b[q>>0]|0;if((o|0)>=((t<<24>>24>e<<24>>24?e:t)<<24>>24|0)){C=t;break}else m=m+8|0}}else C=l;m=C<<24>>24;if(C<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(m<<2)|0,0,(e<<24>>24)-m<<2|0)|0;i=1;return i|0}case 11:{m=a+24|0;o=b[m>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){q=f[f[a>>2]>>2]|0;r=a+40|0;t=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;k=Tj(t|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;t=q+k|0;while(1){f[g+(r<<2)>>2]=h[t>>0];r=r+1|0;k=b[m>>0]|0;if((r|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){D=k;break}else t=t+1|0}}else D=o;t=D<<24>>24;if(D<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(t<<2)|0,0,(e<<24>>24)-t<<2|0)|0;i=1;return i|0}default:{i=0;return i|0}}while(0);return 0}function nb(a,c,e,g){a=a|0;c=c|0;e=e|0;g=g|0;var i=0,k=0,l=0,m=0,o=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;if(!g){i=0;return i|0}do switch(f[a+28>>2]|0){case 1:{k=a+24|0;l=b[k>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){m=f[f[a>>2]>>2]|0;o=a+40|0;q=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;r=Tj(q|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;q=m+r|0;while(1){f[g+(o<<2)>>2]=b[q>>0];o=o+1|0;r=b[k>>0]|0;if((o|0)>=((r<<24>>24>e<<24>>24?e:r)<<24>>24|0)){s=r;break}else q=q+1|0}}else s=l;q=s<<24>>24;if(s<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(q<<2)|0,0,(e<<24>>24)-q<<2|0)|0;i=1;return i|0}case 2:{q=a+24|0;o=b[q>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){k=f[f[a>>2]>>2]|0;r=a+40|0;m=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;t=Tj(m|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;m=k+t|0;while(1){f[g+(r<<2)>>2]=h[m>>0];r=r+1|0;t=b[q>>0]|0;if((r|0)>=((t<<24>>24>e<<24>>24?e:t)<<24>>24|0)){u=t;break}else m=m+1|0}}else u=o;m=u<<24>>24;if(u<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(m<<2)|0,0,(e<<24>>24)-m<<2|0)|0;i=1;return i|0}case 3:{m=a+24|0;r=b[m>>0]|0;if((r<<24>>24>e<<24>>24?e:r)<<24>>24>0){q=f[f[a>>2]>>2]|0;l=a+40|0;t=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;k=Tj(t|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;t=q+k|0;while(1){f[g+(l<<2)>>2]=d[t>>1];l=l+1|0;k=b[m>>0]|0;if((l|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){v=k;break}else t=t+2|0}}else v=r;t=v<<24>>24;if(v<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(t<<2)|0,0,(e<<24>>24)-t<<2|0)|0;i=1;return i|0}case 4:{t=a+24|0;l=b[t>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){m=f[f[a>>2]>>2]|0;o=a+40|0;k=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;q=Tj(k|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;k=m+q|0;while(1){f[g+(o<<2)>>2]=j[k>>1];o=o+1|0;q=b[t>>0]|0;if((o|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){w=q;break}else k=k+2|0}}else w=l;k=w<<24>>24;if(w<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(k<<2)|0,0,(e<<24>>24)-k<<2|0)|0;i=1;return i|0}case 5:{k=a+24|0;o=b[k>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){t=f[f[a>>2]>>2]|0;r=a+40|0;q=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;m=Tj(q|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;q=t+m|0;while(1){f[g+(r<<2)>>2]=f[q>>2];r=r+1|0;m=b[k>>0]|0;if((r|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){x=m;break}else q=q+4|0}}else x=o;q=x<<24>>24;if(x<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(q<<2)|0,0,(e<<24>>24)-q<<2|0)|0;i=1;return i|0}case 6:{q=a+24|0;r=b[q>>0]|0;if((r<<24>>24>e<<24>>24?e:r)<<24>>24>0){k=f[f[a>>2]>>2]|0;l=a+40|0;m=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;t=Tj(m|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;m=k+t|0;while(1){f[g+(l<<2)>>2]=f[m>>2];l=l+1|0;t=b[q>>0]|0;if((l|0)>=((t<<24>>24>e<<24>>24?e:t)<<24>>24|0)){y=t;break}else m=m+4|0}}else y=r;m=y<<24>>24;if(y<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(m<<2)|0,0,(e<<24>>24)-m<<2|0)|0;i=1;return i|0}case 7:{m=a+24|0;l=b[m>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){q=f[f[a>>2]>>2]|0;o=a+40|0;t=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;k=Tj(t|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;t=q+k|0;while(1){f[g+(o<<2)>>2]=f[t>>2];o=o+1|0;k=b[m>>0]|0;if((o|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){z=k;break}else t=t+8|0}}else z=l;t=z<<24>>24;if(z<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(t<<2)|0,0,(e<<24>>24)-t<<2|0)|0;i=1;return i|0}case 8:{t=a+24|0;o=b[t>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){m=f[f[a>>2]>>2]|0;r=a+40|0;k=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;q=Tj(k|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;k=m+q|0;while(1){f[g+(r<<2)>>2]=f[k>>2];r=r+1|0;q=b[t>>0]|0;if((r|0)>=((q<<24>>24>e<<24>>24?e:q)<<24>>24|0)){A=q;break}else k=k+8|0}}else A=o;k=A<<24>>24;if(A<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(k<<2)|0,0,(e<<24>>24)-k<<2|0)|0;i=1;return i|0}case 9:{k=a+24|0;r=b[k>>0]|0;if((r<<24>>24>e<<24>>24?e:r)<<24>>24>0){t=f[f[a>>2]>>2]|0;l=a+40|0;q=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;m=Tj(q|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;q=t+m|0;while(1){m=~~$(n[q>>2]);f[g+(l<<2)>>2]=m;l=l+1|0;m=b[k>>0]|0;if((l|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){B=m;break}else q=q+4|0}}else B=r;q=B<<24>>24;if(B<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(q<<2)|0,0,(e<<24>>24)-q<<2|0)|0;i=1;return i|0}case 10:{q=a+24|0;l=b[q>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){k=f[f[a>>2]>>2]|0;o=a+40|0;m=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;t=Tj(m|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;m=k+t|0;while(1){f[g+(o<<2)>>2]=~~+p[m>>3];o=o+1|0;t=b[q>>0]|0;if((o|0)>=((t<<24>>24>e<<24>>24?e:t)<<24>>24|0)){C=t;break}else m=m+8|0}}else C=l;m=C<<24>>24;if(C<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(m<<2)|0,0,(e<<24>>24)-m<<2|0)|0;i=1;return i|0}case 11:{m=a+24|0;o=b[m>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){q=f[f[a>>2]>>2]|0;r=a+40|0;t=lj(f[r>>2]|0,f[r+4>>2]|0,f[c>>2]|0,0)|0;r=a+48|0;k=Tj(t|0,I|0,f[r>>2]|0,f[r+4>>2]|0)|0;r=0;t=q+k|0;while(1){f[g+(r<<2)>>2]=h[t>>0];r=r+1|0;k=b[m>>0]|0;if((r|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){D=k;break}else t=t+1|0}}else D=o;t=D<<24>>24;if(D<<24>>24>=e<<24>>24){i=1;return i|0}Vf(g+(t<<2)|0,0,(e<<24>>24)-t<<2|0)|0;i=1;return i|0}default:{i=0;return i|0}}while(0);return 0}function ob(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0;c=u;u=u+16|0;d=c+8|0;e=c;g=f[b>>2]|0;if((g|0)==-1){h=1;u=c;return h|0}i=(g>>>0)/3|0;j=a+12|0;if(f[(f[j>>2]|0)+(i>>>5<<2)>>2]&1<<(i&31)|0){h=1;u=c;return h|0}i=a+56|0;k=f[i>>2]|0;l=a+60|0;m=f[l>>2]|0;if((m|0)==(k|0))n=k;else{o=m+(~((m+-4-k|0)>>>2)<<2)|0;f[l>>2]=o;n=o}o=a+64|0;if((n|0)==(f[o>>2]|0))yf(i,b);else{f[n>>2]=g;f[l>>2]=n+4}n=f[a>>2]|0;g=f[b>>2]|0;k=g+1|0;do if((g|0)!=-1){m=f[n+28>>2]|0;p=f[m+((((k>>>0)%3|0|0)==0?g+-2|0:k)<<2)>>2]|0;if(!((g>>>0)%3|0)){q=m;r=p;s=g+2|0;break}else{q=m;r=p;s=g+-1|0;break}}else{p=f[n+28>>2]|0;q=p;r=f[p+-4>>2]|0;s=-1}while(0);n=f[q+(s<<2)>>2]|0;if((r|0)==-1|(n|0)==-1){h=0;u=c;return h|0}s=a+24|0;q=f[s>>2]|0;g=q+(r>>>5<<2)|0;k=1<<(r&31);p=f[g>>2]|0;if(!(p&k)){f[g>>2]=p|k;k=f[b>>2]|0;p=k+1|0;if((k|0)==-1)t=-1;else t=((p>>>0)%3|0|0)==0?k+-2|0:p;f[e>>2]=t;p=f[(f[(f[a+44>>2]|0)+96>>2]|0)+(((t>>>0)/3|0)*12|0)+(((t>>>0)%3|0)<<2)>>2]|0;t=f[a+48>>2]|0;f[d>>2]=p;k=f[t+4>>2]|0;t=k+4|0;g=f[t>>2]|0;if((g|0)==(f[k+8>>2]|0))yf(k,d);else{f[g>>2]=p;f[t>>2]=g+4}g=a+40|0;t=f[g>>2]|0;p=t+4|0;k=f[p>>2]|0;if((k|0)==(f[t+8>>2]|0)){yf(t,e);v=f[g>>2]|0}else{f[k>>2]=f[e>>2];f[p>>2]=k+4;v=t}t=v+24|0;f[(f[v+12>>2]|0)+(r<<2)>>2]=f[t>>2];f[t>>2]=(f[t>>2]|0)+1;w=f[s>>2]|0}else w=q;q=w+(n>>>5<<2)|0;w=1<<(n&31);t=f[q>>2]|0;if(!(t&w)){f[q>>2]=t|w;w=f[b>>2]|0;do if((w|0)!=-1)if(!((w>>>0)%3|0)){x=w+2|0;break}else{x=w+-1|0;break}else x=-1;while(0);f[e>>2]=x;w=f[(f[(f[a+44>>2]|0)+96>>2]|0)+(((x>>>0)/3|0)*12|0)+(((x>>>0)%3|0)<<2)>>2]|0;x=f[a+48>>2]|0;f[d>>2]=w;t=f[x+4>>2]|0;x=t+4|0;q=f[x>>2]|0;if((q|0)==(f[t+8>>2]|0))yf(t,d);else{f[q>>2]=w;f[x>>2]=q+4}q=a+40|0;x=f[q>>2]|0;w=x+4|0;t=f[w>>2]|0;if((t|0)==(f[x+8>>2]|0)){yf(x,e);y=f[q>>2]|0}else{f[t>>2]=f[e>>2];f[w>>2]=t+4;y=x}x=y+24|0;f[(f[y+12>>2]|0)+(n<<2)>>2]=f[x>>2];f[x>>2]=(f[x>>2]|0)+1}x=f[i>>2]|0;n=f[l>>2]|0;if((x|0)==(n|0)){h=1;u=c;return h|0}y=a+44|0;t=a+48|0;w=a+40|0;q=x;x=n;a:while(1){n=f[x+-4>>2]|0;f[b>>2]=n;r=(n>>>0)/3|0;if((n|0)!=-1?(n=(f[j>>2]|0)+(r>>>5<<2)|0,v=1<<(r&31),r=f[n>>2]|0,(r&v|0)==0):0){f[n>>2]=r|v;v=f[a>>2]|0;r=f[b>>2]|0;n=f[(f[v+28>>2]|0)+(r<<2)>>2]|0;if((n|0)==-1){h=0;z=79;break}else{A=r;B=v;C=n}b:while(1){n=(f[s>>2]|0)+(C>>>5<<2)|0;v=1<<(C&31);r=f[n>>2]|0;do if(!(r&v)){k=f[(f[B+40>>2]|0)+(C<<2)>>2]|0;if((k|0)==-1)D=1;else{p=f[(f[f[B+64>>2]>>2]|0)+(k<<2)>>2]|0;D=(1<<(p&31)&f[(f[B+12>>2]|0)+(p>>>5<<2)>>2]|0)!=0}f[n>>2]=r|v;p=f[b>>2]|0;f[e>>2]=p;k=f[(f[(f[y>>2]|0)+96>>2]|0)+(((p>>>0)/3|0)*12|0)+(((p>>>0)%3|0)<<2)>>2]|0;p=f[t>>2]|0;f[d>>2]=k;g=f[p+4>>2]|0;p=g+4|0;m=f[p>>2]|0;if((m|0)==(f[g+8>>2]|0))yf(g,d);else{f[m>>2]=k;f[p>>2]=m+4}m=f[w>>2]|0;p=m+4|0;k=f[p>>2]|0;if((k|0)==(f[m+8>>2]|0)){yf(m,e);E=f[w>>2]|0}else{f[k>>2]=f[e>>2];f[p>>2]=k+4;E=m}m=E+24|0;f[(f[E+12>>2]|0)+(C<<2)>>2]=f[m>>2];f[m>>2]=(f[m>>2]|0)+1;m=f[a>>2]|0;k=f[b>>2]|0;if(D){F=k;G=m;z=59;break}p=k+1|0;do if((k|0)==-1)H=-1;else{g=((p>>>0)%3|0|0)==0?k+-2|0:p;if((g|0)==-1){H=-1;break}if(f[(f[m>>2]|0)+(g>>>5<<2)>>2]&1<<(g&31)|0){H=-1;break}H=f[(f[(f[m+64>>2]|0)+12>>2]|0)+(g<<2)>>2]|0}while(0);f[b>>2]=H;I=m;J=(H>>>0)/3|0}else{F=A;G=B;z=59}while(0);if((z|0)==59){z=0;v=F+1|0;if((F|0)==-1){z=63;break}r=((v>>>0)%3|0|0)==0?F+-2|0:v;do if((r|0)==-1)K=-1;else{if(f[(f[G>>2]|0)+(r>>>5<<2)>>2]&1<<(r&31)|0){K=-1;break}K=f[(f[(f[G+64>>2]|0)+12>>2]|0)+(r<<2)>>2]|0}while(0);f[d>>2]=K;r=(((F>>>0)%3|0|0)==0?2:-1)+F|0;do if((r|0)==-1)L=-1;else{if(f[(f[G>>2]|0)+(r>>>5<<2)>>2]&1<<(r&31)|0){L=-1;break}L=f[(f[(f[G+64>>2]|0)+12>>2]|0)+(r<<2)>>2]|0}while(0);r=(K|0)==-1;v=(K>>>0)/3|0;n=r?-1:v;p=(L|0)==-1;k=(L>>>0)/3|0;g=p?-1:k;do if(!r){M=f[j>>2]|0;if(f[M+(n>>>5<<2)>>2]&1<<(n&31)|0){z=69;break}if(p){N=K;O=v;break}if(!(f[M+(g>>>5<<2)>>2]&1<<(g&31))){z=74;break b}else{N=K;O=v}}else z=69;while(0);if((z|0)==69){z=0;if(p){z=71;break}if(!(f[(f[j>>2]|0)+(g>>>5<<2)>>2]&1<<(g&31))){N=L;O=k}else{z=71;break}}f[b>>2]=N;I=G;J=O}v=(f[j>>2]|0)+(J>>>5<<2)|0;f[v>>2]=f[v>>2]|1<<(J&31);A=f[b>>2]|0;C=f[(f[I+28>>2]|0)+(A<<2)>>2]|0;if((C|0)==-1){h=0;z=79;break a}else B=I}do if((z|0)==63){z=0;f[d>>2]=-1;z=71}else if((z|0)==74){z=0;v=f[l>>2]|0;f[v+-4>>2]=L;if((v|0)==(f[o>>2]|0)){yf(i,d);P=f[l>>2]|0;break}else{f[v>>2]=f[d>>2];n=v+4|0;f[l>>2]=n;P=n;break}}while(0);if((z|0)==71){z=0;n=(f[l>>2]|0)+-4|0;f[l>>2]=n;P=n}Q=f[i>>2]|0;R=P}else{n=x+-4|0;f[l>>2]=n;Q=q;R=n}if((Q|0)==(R|0)){h=1;z=79;break}else{q=Q;x=R}}if((z|0)==79){u=c;return h|0}return 0}function pb(a,c,e,g){a=a|0;c=c|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,o=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;if(!g){h=0;return h|0}do switch(f[a+28>>2]|0){case 1:{i=a+24|0;j=b[i>>0]|0;if((j<<24>>24>e<<24>>24?e:j)<<24>>24>0){k=f[f[a>>2]>>2]|0;l=a+40|0;m=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;o=Tj(m|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;m=k+o|0;while(1){b[g+l>>0]=b[m>>0]|0;l=l+1|0;o=b[i>>0]|0;if((l|0)>=((o<<24>>24>e<<24>>24?e:o)<<24>>24|0)){q=o;break}else m=m+1|0}}else q=j;m=q<<24>>24;if(q<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+m|0,0,(e<<24>>24)-m|0)|0;h=1;return h|0}case 2:{m=a+24|0;l=b[m>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){i=f[f[a>>2]>>2]|0;o=a+40|0;k=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;r=Tj(k|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;k=i+r|0;while(1){b[g+o>>0]=b[k>>0]|0;o=o+1|0;r=b[m>>0]|0;if((o|0)>=((r<<24>>24>e<<24>>24?e:r)<<24>>24|0)){s=r;break}else k=k+1|0}}else s=l;k=s<<24>>24;if(s<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+k|0,0,(e<<24>>24)-k|0)|0;h=1;return h|0}case 3:{k=a+24|0;o=b[k>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){m=f[f[a>>2]>>2]|0;j=a+40|0;r=lj(f[j>>2]|0,f[j+4>>2]|0,f[c>>2]|0,0)|0;j=a+48|0;i=Tj(r|0,I|0,f[j>>2]|0,f[j+4>>2]|0)|0;j=0;r=m+i|0;while(1){b[g+j>>0]=d[r>>1];j=j+1|0;i=b[k>>0]|0;if((j|0)>=((i<<24>>24>e<<24>>24?e:i)<<24>>24|0)){t=i;break}else r=r+2|0}}else t=o;r=t<<24>>24;if(t<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+r|0,0,(e<<24>>24)-r|0)|0;h=1;return h|0}case 4:{r=a+24|0;j=b[r>>0]|0;if((j<<24>>24>e<<24>>24?e:j)<<24>>24>0){k=f[f[a>>2]>>2]|0;l=a+40|0;i=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;m=Tj(i|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;i=k+m|0;while(1){b[g+l>>0]=d[i>>1];l=l+1|0;m=b[r>>0]|0;if((l|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){u=m;break}else i=i+2|0}}else u=j;i=u<<24>>24;if(u<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+i|0,0,(e<<24>>24)-i|0)|0;h=1;return h|0}case 5:{i=a+24|0;l=b[i>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){r=f[f[a>>2]>>2]|0;o=a+40|0;m=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;k=Tj(m|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;m=r+k|0;while(1){b[g+o>>0]=f[m>>2];o=o+1|0;k=b[i>>0]|0;if((o|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){v=k;break}else m=m+4|0}}else v=l;m=v<<24>>24;if(v<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+m|0,0,(e<<24>>24)-m|0)|0;h=1;return h|0}case 6:{m=a+24|0;o=b[m>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){i=f[f[a>>2]>>2]|0;j=a+40|0;k=lj(f[j>>2]|0,f[j+4>>2]|0,f[c>>2]|0,0)|0;j=a+48|0;r=Tj(k|0,I|0,f[j>>2]|0,f[j+4>>2]|0)|0;j=0;k=i+r|0;while(1){b[g+j>>0]=f[k>>2];j=j+1|0;r=b[m>>0]|0;if((j|0)>=((r<<24>>24>e<<24>>24?e:r)<<24>>24|0)){w=r;break}else k=k+4|0}}else w=o;k=w<<24>>24;if(w<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+k|0,0,(e<<24>>24)-k|0)|0;h=1;return h|0}case 7:{k=a+24|0;j=b[k>>0]|0;if((j<<24>>24>e<<24>>24?e:j)<<24>>24>0){m=f[f[a>>2]>>2]|0;l=a+40|0;r=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;i=Tj(r|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;r=m+i|0;while(1){b[g+l>>0]=f[r>>2];l=l+1|0;i=b[k>>0]|0;if((l|0)>=((i<<24>>24>e<<24>>24?e:i)<<24>>24|0)){x=i;break}else r=r+8|0}}else x=j;r=x<<24>>24;if(x<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+r|0,0,(e<<24>>24)-r|0)|0;h=1;return h|0}case 8:{r=a+24|0;l=b[r>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){k=f[f[a>>2]>>2]|0;o=a+40|0;i=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;m=Tj(i|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;i=k+m|0;while(1){b[g+o>>0]=f[i>>2];o=o+1|0;m=b[r>>0]|0;if((o|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){y=m;break}else i=i+8|0}}else y=l;i=y<<24>>24;if(y<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+i|0,0,(e<<24>>24)-i|0)|0;h=1;return h|0}case 9:{i=a+24|0;o=b[i>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){r=f[f[a>>2]>>2]|0;j=a+40|0;m=lj(f[j>>2]|0,f[j+4>>2]|0,f[c>>2]|0,0)|0;j=a+48|0;k=Tj(m|0,I|0,f[j>>2]|0,f[j+4>>2]|0)|0;j=0;m=r+k|0;while(1){k=~~$(n[m>>2])&255;b[g+j>>0]=k;j=j+1|0;k=b[i>>0]|0;if((j|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){z=k;break}else m=m+4|0}}else z=o;m=z<<24>>24;if(z<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+m|0,0,(e<<24>>24)-m|0)|0;h=1;return h|0}case 10:{m=a+24|0;j=b[m>>0]|0;if((j<<24>>24>e<<24>>24?e:j)<<24>>24>0){i=f[f[a>>2]>>2]|0;l=a+40|0;k=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;r=Tj(k|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;k=i+r|0;while(1){b[g+l>>0]=~~+p[k>>3];l=l+1|0;r=b[m>>0]|0;if((l|0)>=((r<<24>>24>e<<24>>24?e:r)<<24>>24|0)){A=r;break}else k=k+8|0}}else A=j;k=A<<24>>24;if(A<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+k|0,0,(e<<24>>24)-k|0)|0;h=1;return h|0}case 11:{k=a+24|0;l=b[k>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){m=f[f[a>>2]>>2]|0;o=a+40|0;r=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;i=Tj(r|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;r=m+i|0;while(1){b[g+o>>0]=b[r>>0]|0;o=o+1|0;i=b[k>>0]|0;if((o|0)>=((i<<24>>24>e<<24>>24?e:i)<<24>>24|0)){B=i;break}else r=r+1|0}}else B=l;r=B<<24>>24;if(B<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+r|0,0,(e<<24>>24)-r|0)|0;h=1;return h|0}default:{h=0;return h|0}}while(0);return 0}function qb(a,c,e,g){a=a|0;c=c|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,o=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;if(!g){h=0;return h|0}do switch(f[a+28>>2]|0){case 1:{i=a+24|0;j=b[i>>0]|0;if((j<<24>>24>e<<24>>24?e:j)<<24>>24>0){k=f[f[a>>2]>>2]|0;l=a+40|0;m=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;o=Tj(m|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;m=k+o|0;while(1){b[g+l>>0]=b[m>>0]|0;l=l+1|0;o=b[i>>0]|0;if((l|0)>=((o<<24>>24>e<<24>>24?e:o)<<24>>24|0)){q=o;break}else m=m+1|0}}else q=j;m=q<<24>>24;if(q<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+m|0,0,(e<<24>>24)-m|0)|0;h=1;return h|0}case 2:{m=a+24|0;l=b[m>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){i=f[f[a>>2]>>2]|0;o=a+40|0;k=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;r=Tj(k|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;k=i+r|0;while(1){b[g+o>>0]=b[k>>0]|0;o=o+1|0;r=b[m>>0]|0;if((o|0)>=((r<<24>>24>e<<24>>24?e:r)<<24>>24|0)){s=r;break}else k=k+1|0}}else s=l;k=s<<24>>24;if(s<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+k|0,0,(e<<24>>24)-k|0)|0;h=1;return h|0}case 3:{k=a+24|0;o=b[k>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){m=f[f[a>>2]>>2]|0;j=a+40|0;r=lj(f[j>>2]|0,f[j+4>>2]|0,f[c>>2]|0,0)|0;j=a+48|0;i=Tj(r|0,I|0,f[j>>2]|0,f[j+4>>2]|0)|0;j=0;r=m+i|0;while(1){b[g+j>>0]=d[r>>1];j=j+1|0;i=b[k>>0]|0;if((j|0)>=((i<<24>>24>e<<24>>24?e:i)<<24>>24|0)){t=i;break}else r=r+2|0}}else t=o;r=t<<24>>24;if(t<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+r|0,0,(e<<24>>24)-r|0)|0;h=1;return h|0}case 4:{r=a+24|0;j=b[r>>0]|0;if((j<<24>>24>e<<24>>24?e:j)<<24>>24>0){k=f[f[a>>2]>>2]|0;l=a+40|0;i=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;m=Tj(i|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;i=k+m|0;while(1){b[g+l>>0]=d[i>>1];l=l+1|0;m=b[r>>0]|0;if((l|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){u=m;break}else i=i+2|0}}else u=j;i=u<<24>>24;if(u<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+i|0,0,(e<<24>>24)-i|0)|0;h=1;return h|0}case 5:{i=a+24|0;l=b[i>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){r=f[f[a>>2]>>2]|0;o=a+40|0;m=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;k=Tj(m|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;m=r+k|0;while(1){b[g+o>>0]=f[m>>2];o=o+1|0;k=b[i>>0]|0;if((o|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){v=k;break}else m=m+4|0}}else v=l;m=v<<24>>24;if(v<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+m|0,0,(e<<24>>24)-m|0)|0;h=1;return h|0}case 6:{m=a+24|0;o=b[m>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){i=f[f[a>>2]>>2]|0;j=a+40|0;k=lj(f[j>>2]|0,f[j+4>>2]|0,f[c>>2]|0,0)|0;j=a+48|0;r=Tj(k|0,I|0,f[j>>2]|0,f[j+4>>2]|0)|0;j=0;k=i+r|0;while(1){b[g+j>>0]=f[k>>2];j=j+1|0;r=b[m>>0]|0;if((j|0)>=((r<<24>>24>e<<24>>24?e:r)<<24>>24|0)){w=r;break}else k=k+4|0}}else w=o;k=w<<24>>24;if(w<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+k|0,0,(e<<24>>24)-k|0)|0;h=1;return h|0}case 7:{k=a+24|0;j=b[k>>0]|0;if((j<<24>>24>e<<24>>24?e:j)<<24>>24>0){m=f[f[a>>2]>>2]|0;l=a+40|0;r=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;i=Tj(r|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;r=m+i|0;while(1){b[g+l>>0]=f[r>>2];l=l+1|0;i=b[k>>0]|0;if((l|0)>=((i<<24>>24>e<<24>>24?e:i)<<24>>24|0)){x=i;break}else r=r+8|0}}else x=j;r=x<<24>>24;if(x<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+r|0,0,(e<<24>>24)-r|0)|0;h=1;return h|0}case 8:{r=a+24|0;l=b[r>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){k=f[f[a>>2]>>2]|0;o=a+40|0;i=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;m=Tj(i|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;i=k+m|0;while(1){b[g+o>>0]=f[i>>2];o=o+1|0;m=b[r>>0]|0;if((o|0)>=((m<<24>>24>e<<24>>24?e:m)<<24>>24|0)){y=m;break}else i=i+8|0}}else y=l;i=y<<24>>24;if(y<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+i|0,0,(e<<24>>24)-i|0)|0;h=1;return h|0}case 9:{i=a+24|0;o=b[i>>0]|0;if((o<<24>>24>e<<24>>24?e:o)<<24>>24>0){r=f[f[a>>2]>>2]|0;j=a+40|0;m=lj(f[j>>2]|0,f[j+4>>2]|0,f[c>>2]|0,0)|0;j=a+48|0;k=Tj(m|0,I|0,f[j>>2]|0,f[j+4>>2]|0)|0;j=0;m=r+k|0;while(1){k=~~$(n[m>>2]);b[g+j>>0]=k;j=j+1|0;k=b[i>>0]|0;if((j|0)>=((k<<24>>24>e<<24>>24?e:k)<<24>>24|0)){z=k;break}else m=m+4|0}}else z=o;m=z<<24>>24;if(z<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+m|0,0,(e<<24>>24)-m|0)|0;h=1;return h|0}case 10:{m=a+24|0;j=b[m>>0]|0;if((j<<24>>24>e<<24>>24?e:j)<<24>>24>0){i=f[f[a>>2]>>2]|0;l=a+40|0;k=lj(f[l>>2]|0,f[l+4>>2]|0,f[c>>2]|0,0)|0;l=a+48|0;r=Tj(k|0,I|0,f[l>>2]|0,f[l+4>>2]|0)|0;l=0;k=i+r|0;while(1){b[g+l>>0]=~~+p[k>>3];l=l+1|0;r=b[m>>0]|0;if((l|0)>=((r<<24>>24>e<<24>>24?e:r)<<24>>24|0)){A=r;break}else k=k+8|0}}else A=j;k=A<<24>>24;if(A<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+k|0,0,(e<<24>>24)-k|0)|0;h=1;return h|0}case 11:{k=a+24|0;l=b[k>>0]|0;if((l<<24>>24>e<<24>>24?e:l)<<24>>24>0){m=f[f[a>>2]>>2]|0;o=a+40|0;r=lj(f[o>>2]|0,f[o+4>>2]|0,f[c>>2]|0,0)|0;o=a+48|0;i=Tj(r|0,I|0,f[o>>2]|0,f[o+4>>2]|0)|0;o=0;r=m+i|0;while(1){b[g+o>>0]=b[r>>0]|0;o=o+1|0;i=b[k>>0]|0;if((o|0)>=((i<<24>>24>e<<24>>24?e:i)<<24>>24|0)){B=i;break}else r=r+1|0}}else B=l;r=B<<24>>24;if(B<<24>>24>=e<<24>>24){h=1;return h|0}Vf(g+r|0,0,(e<<24>>24)-r|0)|0;h=1;return h|0}default:{h=0;return h|0}}while(0);return 0}function rb(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;c=u;u=u+16|0;d=c+8|0;e=c;g=f[b>>2]|0;if((g|0)==-1){h=1;u=c;return h|0}i=(g>>>0)/3|0;j=a+12|0;if(f[(f[j>>2]|0)+(i>>>5<<2)>>2]&1<<(i&31)|0){h=1;u=c;return h|0}i=a+56|0;k=f[i>>2]|0;l=a+60|0;m=f[l>>2]|0;if((m|0)==(k|0))n=k;else{o=m+(~((m+-4-k|0)>>>2)<<2)|0;f[l>>2]=o;n=o}o=a+64|0;if((n|0)==(f[o>>2]|0))yf(i,b);else{f[n>>2]=g;f[l>>2]=n+4}n=f[a>>2]|0;g=f[b>>2]|0;k=g+1|0;if((g|0)==-1){h=0;u=c;return h|0}m=((k>>>0)%3|0|0)==0?g+-2|0:k;if((m|0)==-1)p=-1;else p=f[(f[n>>2]|0)+(m<<2)>>2]|0;m=(((g>>>0)%3|0|0)==0?2:-1)+g|0;if((m|0)==-1){h=0;u=c;return h|0}g=f[(f[n>>2]|0)+(m<<2)>>2]|0;if((p|0)==-1|(g|0)==-1){h=0;u=c;return h|0}m=a+24|0;n=f[m>>2]|0;k=n+(p>>>5<<2)|0;q=1<<(p&31);r=f[k>>2]|0;if(!(r&q)){f[k>>2]=r|q;q=f[b>>2]|0;r=q+1|0;if((q|0)==-1)s=-1;else s=((r>>>0)%3|0|0)==0?q+-2|0:r;f[e>>2]=s;r=f[(f[(f[a+44>>2]|0)+96>>2]|0)+(((s>>>0)/3|0)*12|0)+(((s>>>0)%3|0)<<2)>>2]|0;s=f[a+48>>2]|0;f[d>>2]=r;q=f[s+4>>2]|0;s=q+4|0;k=f[s>>2]|0;if((k|0)==(f[q+8>>2]|0))yf(q,d);else{f[k>>2]=r;f[s>>2]=k+4}k=a+40|0;s=f[k>>2]|0;r=s+4|0;q=f[r>>2]|0;if((q|0)==(f[s+8>>2]|0)){yf(s,e);t=f[k>>2]|0}else{f[q>>2]=f[e>>2];f[r>>2]=q+4;t=s}s=t+24|0;f[(f[t+12>>2]|0)+(p<<2)>>2]=f[s>>2];f[s>>2]=(f[s>>2]|0)+1;v=f[m>>2]|0}else v=n;n=v+(g>>>5<<2)|0;v=1<<(g&31);s=f[n>>2]|0;if(!(s&v)){f[n>>2]=s|v;v=f[b>>2]|0;do if((v|0)!=-1)if(!((v>>>0)%3|0)){w=v+2|0;break}else{w=v+-1|0;break}else w=-1;while(0);f[e>>2]=w;v=f[(f[(f[a+44>>2]|0)+96>>2]|0)+(((w>>>0)/3|0)*12|0)+(((w>>>0)%3|0)<<2)>>2]|0;w=f[a+48>>2]|0;f[d>>2]=v;s=f[w+4>>2]|0;w=s+4|0;n=f[w>>2]|0;if((n|0)==(f[s+8>>2]|0))yf(s,d);else{f[n>>2]=v;f[w>>2]=n+4}n=a+40|0;w=f[n>>2]|0;v=w+4|0;s=f[v>>2]|0;if((s|0)==(f[w+8>>2]|0)){yf(w,e);x=f[n>>2]|0}else{f[s>>2]=f[e>>2];f[v>>2]=s+4;x=w}w=x+24|0;f[(f[x+12>>2]|0)+(g<<2)>>2]=f[w>>2];f[w>>2]=(f[w>>2]|0)+1}w=f[i>>2]|0;g=f[l>>2]|0;if((w|0)==(g|0)){h=1;u=c;return h|0}x=a+44|0;s=a+48|0;v=a+40|0;n=g;g=w;a:while(1){w=f[n+-4>>2]|0;f[b>>2]=w;p=(w>>>0)/3|0;if((w|0)!=-1?(w=(f[j>>2]|0)+(p>>>5<<2)|0,t=1<<(p&31),p=f[w>>2]|0,(p&t|0)==0):0){f[w>>2]=p|t;t=f[b>>2]|0;if((t|0)==-1){h=0;y=80;break}p=f[a>>2]|0;w=t;b:while(1){t=f[(f[p>>2]|0)+(w<<2)>>2]|0;if((t|0)==-1){h=0;y=80;break a}q=(f[m>>2]|0)+(t>>>5<<2)|0;r=1<<(t&31);k=f[q>>2]|0;do if(!(k&r)){z=f[(f[p+24>>2]|0)+(t<<2)>>2]|0;A=z+1|0;do if((z|0)==-1)B=1;else{C=((A>>>0)%3|0|0)==0?z+-2|0:A;if((C|0)==-1){B=1;break}D=f[(f[p+12>>2]|0)+(C<<2)>>2]|0;C=D+1|0;if((D|0)==-1){B=1;break}B=((((C>>>0)%3|0|0)==0?D+-2|0:C)|0)==-1}while(0);f[q>>2]=k|r;A=f[b>>2]|0;f[e>>2]=A;z=f[(f[(f[x>>2]|0)+96>>2]|0)+(((A>>>0)/3|0)*12|0)+(((A>>>0)%3|0)<<2)>>2]|0;A=f[s>>2]|0;f[d>>2]=z;C=f[A+4>>2]|0;A=C+4|0;D=f[A>>2]|0;if((D|0)==(f[C+8>>2]|0))yf(C,d);else{f[D>>2]=z;f[A>>2]=D+4}D=f[v>>2]|0;A=D+4|0;z=f[A>>2]|0;if((z|0)==(f[D+8>>2]|0)){yf(D,e);E=f[v>>2]|0}else{f[z>>2]=f[e>>2];f[A>>2]=z+4;E=D}D=E+24|0;f[(f[E+12>>2]|0)+(t<<2)>>2]=f[D>>2];f[D>>2]=(f[D>>2]|0)+1;D=f[a>>2]|0;z=f[b>>2]|0;if(B)if((z|0)==-1){y=63;break b}else{F=z;G=D;y=64;break}do if((z|0)==-1)H=-1;else{A=z+1|0;C=((A>>>0)%3|0|0)==0?z+-2|0:A;if((C|0)==-1){H=-1;break}H=f[(f[D+12>>2]|0)+(C<<2)>>2]|0}while(0);f[b>>2]=H;I=D;J=(H>>>0)/3|0}else{F=w;G=p;y=64}while(0);if((y|0)==64){y=0;t=F+1|0;r=((t>>>0)%3|0|0)==0?F+-2|0:t;if((r|0)==-1)K=-1;else K=f[(f[G+12>>2]|0)+(r<<2)>>2]|0;f[d>>2]=K;r=(((F>>>0)%3|0|0)==0?2:-1)+F|0;if((r|0)==-1)L=-1;else L=f[(f[G+12>>2]|0)+(r<<2)>>2]|0;r=(K|0)==-1;t=(K>>>0)/3|0;k=r?-1:t;q=(L|0)==-1;z=(L>>>0)/3|0;C=q?-1:z;do if(!r){A=f[j>>2]|0;if(f[A+(k>>>5<<2)>>2]&1<<(k&31)|0){y=70;break}if(q){M=K;N=t;break}if(!(f[A+(C>>>5<<2)>>2]&1<<(C&31))){y=75;break b}else{M=K;N=t}}else y=70;while(0);if((y|0)==70){y=0;if(q){y=72;break}if(!(f[(f[j>>2]|0)+(C>>>5<<2)>>2]&1<<(C&31))){M=L;N=z}else{y=72;break}}f[b>>2]=M;I=G;J=N}t=(f[j>>2]|0)+(J>>>5<<2)|0;f[t>>2]=f[t>>2]|1<<(J&31);w=f[b>>2]|0;if((w|0)==-1){h=0;y=80;break a}else p=I}do if((y|0)==63){y=0;f[d>>2]=-1;y=72}else if((y|0)==75){y=0;p=f[l>>2]|0;f[p+-4>>2]=L;if((p|0)==(f[o>>2]|0)){yf(i,d);O=f[l>>2]|0;break}else{f[p>>2]=f[d>>2];w=p+4|0;f[l>>2]=w;O=w;break}}while(0);if((y|0)==72){y=0;w=(f[l>>2]|0)+-4|0;f[l>>2]=w;O=w}P=f[i>>2]|0;Q=O}else{w=n+-4|0;f[l>>2]=w;P=g;Q=w}if((P|0)==(Q|0)){h=1;y=80;break}else{n=Q;g=P}}if((y|0)==80){u=c;return h|0}return 0}function sb(a,c,d,e){a=a|0;c=c|0;d=d|0;e=e|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C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]|0)+(o<<2)>>2]|0;n=a+20|0;r=f[n>>2]|0;s=f[r>>2]|0;if((f[r+4>>2]|0)-s>>2>>>0<=q>>>0)ym(r);r=a+8|0;t=f[(f[r>>2]|0)+(f[s+(q<<2)>>2]<<2)>>2]|0;q=a+4|0;s=f[q>>2]|0;if(!(b[s+84>>0]|0))v=f[(f[s+68>>2]|0)+(t<<2)>>2]|0;else v=t;f[j>>2]=0;f[j+4>>2]=0;f[j+8>>2]=0;f[j+12>>2]=0;f[j+16>>2]=0;f[j+20>>2]=0;f[h>>2]=v;v=b[s+24>>0]|0;f[g>>2]=f[h>>2];hb(s,g,v,j)|0;v=a+28|0;a=(f[v>>2]|0)==0;a:do if(!p){s=k+8|0;t=j+8|0;w=k+16|0;x=j+16|0;y=l+8|0;z=l+16|0;A=o;B=0;C=0;D=0;E=0;F=0;G=0;H=o;J=a;K=o;while(1){do if(J){L=H+1|0;if((H|0)==-1){M=A;N=-1;O=-1;P=-1;break}Q=((L>>>0)%3|0|0)==0?H+-2|0:L;if((A|0)!=-1)if(!((A>>>0)%3|0)){R=A;S=A;T=Q;U=A+2|0;V=19;break}else{R=A;S=A;T=Q;U=A+-1|0;V=19;break}else{R=-1;S=-1;T=Q;U=-1;V=19}}else{Q=K+1|0;L=((Q>>>0)%3|0|0)==0?K+-2|0:Q;if(!((K>>>0)%3|0)){R=A;S=H;T=L;U=K+2|0;V=19;break}else{R=A;S=H;T=L;U=K+-1|0;V=19;break}}while(0);if((V|0)==19){V=0;if((T|0)==-1){M=R;N=S;O=U;P=-1}else{M=R;N=S;O=U;P=f[(f[f[m>>2]>>2]|0)+(T<<2)>>2]|0}}W=f[n>>2]|0;L=f[W>>2]|0;if((f[W+4>>2]|0)-L>>2>>>0<=P>>>0){V=22;break}Q=f[(f[r>>2]|0)+(f[L+(P<<2)>>2]<<2)>>2]|0;L=f[q>>2]|0;if(!(b[L+84>>0]|0))X=f[(f[L+68>>2]|0)+(Q<<2)>>2]|0;else X=Q;f[k>>2]=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;o=q&-4;t=c+(o+4)|0;v=r;w=q-o|0}else{t=c;v=d;w=d}switch(w|0){case 3:{x=h[t+2>>0]<<16^v;y=12;break}case 2:{x=v;y=12;break}case 1:{z=v;y=13;break}default:A=v}if((y|0)==12){z=h[t+1>>0]<<8^x;y=13}if((y|0)==13)A=X(h[t>>0]^z,1540483477)|0;z=X(A>>>13^A,1540483477)|0;A=z>>>15^z;z=a+4|0;t=f[z>>2]|0;x=(t|0)==0;a:do if(!x){v=t+-1|0;w=(v&t|0)==0;if(!w)if(A>>>0>>0)B=A;else B=(A>>>0)%(t>>>0)|0;else B=A&v;o=f[(f[a>>2]|0)+(B<<2)>>2]|0;if((o|0)!=0?(q=f[o>>2]|0,(q|0)!=0):0){o=(d|0)==0;if(w){if(o){w=q;while(1){r=f[w+4>>2]|0;if(!((r|0)==(A|0)|(r&v|0)==(B|0))){C=B;y=54;break a}r=b[w+8+11>>0]|0;if(!((r<<24>>24<0?f[w+12>>2]|0:r&255)|0))break a;w=f[w>>2]|0;if(!w){C=B;y=54;break a}}}else D=q;while(1){w=f[D+4>>2]|0;if(!((w|0)==(A|0)|(w&v|0)==(B|0))){C=B;y=54;break a}w=D+8|0;r=b[w+11>>0]|0;p=r<<24>>24<0;l=r&255;do if(((p?f[D+12>>2]|0:l)|0)==(d|0)){r=f[w>>2]|0;if(p)if(!(mh(r,c,d)|0))break a;else break;if((r&255)<<24>>24==(b[c>>0]|0)){r=l;E=w;F=c;do{r=r+-1|0;E=E+1|0;if(!r)break a;F=F+1|0}while((b[E>>0]|0)==(b[F>>0]|0))}}while(0);D=f[D>>2]|0;if(!D){C=B;y=54;break a}}}if(o){v=q;while(1){w=f[v+4>>2]|0;if((w|0)!=(A|0)){if(w>>>0>>0)G=w;else G=(w>>>0)%(t>>>0)|0;if((G|0)!=(B|0)){C=B;y=54;break a}}w=b[v+8+11>>0]|0;if(!((w<<24>>24<0?f[v+12>>2]|0:w&255)|0))break a;v=f[v>>2]|0;if(!v){C=B;y=54;break a}}}else H=q;while(1){v=f[H+4>>2]|0;if((v|0)!=(A|0)){if(v>>>0>>0)I=v;else I=(v>>>0)%(t>>>0)|0;if((I|0)!=(B|0)){C=B;y=54;break a}}v=H+8|0;o=b[v+11>>0]|0;w=o<<24>>24<0;l=o&255;do if(((w?f[H+12>>2]|0:l)|0)==(d|0)){o=f[v>>2]|0;if(w)if(!(mh(o,c,d)|0))break a;else break;if((o&255)<<24>>24==(b[c>>0]|0)){o=l;p=v;F=c;do{o=o+-1|0;p=p+1|0;if(!o)break a;F=F+1|0}while((b[p>>0]|0)==(b[F>>0]|0))}}while(0);H=f[H>>2]|0;if(!H){C=B;y=54;break}}}else{C=B;y=54}}else{C=0;y=54}while(0);if((y|0)==54){ke(g,a,A,i);y=a+12|0;J=$(((f[y>>2]|0)+1|0)>>>0);K=$(t>>>0);L=$(n[a+16>>2]);do if(x|J>$(K*L)){B=(t>>>0<3|(t+-1&t|0)!=0)&1|t<<1;H=~~$(W($(J/L)))>>>0;Pe(a,B>>>0>>0?H:B);B=f[z>>2]|0;H=B+-1|0;if(!(H&B)){M=B;N=H&A;break}if(A>>>0>>0){M=B;N=A}else{M=B;N=(A>>>0)%(B>>>0)|0}}else{M=t;N=C}while(0);C=f[(f[a>>2]|0)+(N<<2)>>2]|0;if(!C){t=a+8|0;f[f[g>>2]>>2]=f[t>>2];f[t>>2]=f[g>>2];f[(f[a>>2]|0)+(N<<2)>>2]=t;t=f[g>>2]|0;N=f[t>>2]|0;if(!N)O=g;else{A=f[N+4>>2]|0;N=M+-1|0;if(N&M)if(A>>>0>>0)P=A;else P=(A>>>0)%(M>>>0)|0;else P=A&N;f[(f[a>>2]|0)+(P<<2)>>2]=t;O=g}}else{f[f[g>>2]>>2]=f[C>>2];f[C>>2]=f[g>>2];O=g}f[y>>2]=(f[y>>2]|0)+1;f[O>>2]=0}O=f[i+12>>2]|0;if(O|0){if((f[m>>2]|0)!=(O|0))f[m>>2]=O;fn(O)}if((b[s>>0]|0)<0)fn(f[i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dj(m)|0;f[g>>2]=z;o=z+(A<<2)|0;f[g+8>>2]=o;Vf(z|0,0,m|0)|0;f[y>>2]=o;J=z;K=o;L=z;break}else{J=0;K=0;L=0}while(0);if((s|0)!=(v|0)){v=0;s=0;do{f[J+(v<<2)>>2]=s;s=(f[t+(v<<2)>>2]|0)+s|0;v=v+1|0}while(v>>>0>>0)}v=f[j>>2]|0;j=f[a>>2]|0;s=j;if((v|0)!=(j|0)){m=a+40|0;a=v-j>>2;j=J;v=0;g=H;z=H;o=H;x=H;l=H;k=H;while(1){F=f[s+(v<<2)>>2]|0;G=v+1|0;E=((G>>>0)%3|0|0)==0?v+-2|0:G;if((E|0)==-1)M=-1;else M=f[s+(E<<2)>>2]|0;E=((v>>>0)%3|0|0)==0;G=(E?2:-1)+v|0;if((G|0)==-1)N=-1;else N=f[s+(G<<2)>>2]|0;if(E?(M|0)==(N|0)|((F|0)==(M|0)|(F|0)==(N|0)):0){f[m>>2]=(f[m>>2]|0)+1;O=j;P=v+2|0;Q=g;R=z;S=o;T=x;U=l;V=k}else W=51;a:do if((W|0)==51){W=0;E=f[t+(N<<2)>>2]|0;b:do if((E|0)>0){G=0;B=f[j+(N<<2)>>2]|0;while(1){p=f[l+(B<<3)>>2]|0;if((p|0)==-1){X=g;Y=z;Z=x;_=l;break b}if((p|0)==(M|0)){p=f[l+(B<<3)+4>>2]|0;if((p|0)==-1)$=-1;else $=f[s+(p<<2)>>2]|0;if((F|0)!=($|0))break}p=G+1|0;if((p|0)<(E|0)){G=p;B=B+1|0}else{X=g;Y=z;Z=x;_=l;break b}}p=f[x+(B<<3)+4>>2]|0;r=G;n=B;D=z;while(1){r=r+1|0;if((r|0)>=(E|0))break;C=n+1|0;f[D+(n<<3)>>2]=f[D+(C<<3)>>2];f[D+(n<<3)+4>>2]=f[D+(C<<3)+4>>2];if((f[g+(n<<3)>>2]|0)==-1)break;else{n=C;D=g}}f[o+(n<<3)>>2]=-1;if((p|0)==-1){X=o;Y=o;Z=o;_=o}else{D=f[i>>2]|0;f[D+(v<<2)>>2]=p;f[D+(p<<2)>>2]=v;O=j;P=v;Q=o;R=o;S=o;T=o;U=o;V=k;break a}}else{X=g;Y=z;Z=x;_=l}while(0);E=f[t+(M<<2)>>2]|0;if((E|0)>0){D=0;r=f[J+(M<<2)>>2]|0;while(1){aa=k+(r<<3)|0;if((f[aa>>2]|0)==-1)break;D=D+1|0;if((D|0)>=(E|0)){O=J;P=v;Q=k;R=k;S=k;T=k;U=k;V=k;break a}else r=r+1|0}f[aa>>2]=N;f[H+(r<<3)+4>>2]=v;O=J;P=v;Q=H;R=H;S=H;T=H;U=H;V=H}else{O=j;P=v;Q=X;R=Y;S=o;T=Z;U=_;V=k}}while(0);v=P+1|0;if(v>>>0>=a>>>0)break;else{j=O;g=Q;z=R;o=S;x=T;l=U;k=V}}}f[b>>2]=A;if(!J){ba=H;ca=I}else{if((K|0)!=(J|0))f[y>>2]=K+(~((K+-4-J|0)>>>2)<<2);fn(L);L=f[e>>2]|0;ba=L;ca=L}if(ba|0){L=f[w>>2]|0;if((L|0)!=(ba|0))f[w>>2]=L+(~((L+-8-ba|0)>>>3)<<3);fn(ca)}ca=f[d>>2]|0;if(ca|0){d=f[q>>2]|0;if((d|0)!=(ca|0))f[q>>2]=d+(~((d+-4-ca|0)>>>2)<<2);fn(ca)}h=1;u=c;return h|0}function yb(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;d=u;u=u+176|0;e=d+136|0;g=d+32|0;i=d;j=d+104|0;k=d+100|0;l=a+4|0;m=f[l>>2]|0;n=f[m+32>>2]|0;o=n+8|0;p=f[o>>2]|0;q=f[o+4>>2]|0;o=n+16|0;r=o;s=f[r>>2]|0;t=f[r+4>>2]|0;if(!((q|0)>(t|0)|(q|0)==(t|0)&p>>>0>s>>>0)){v=0;u=d;return v|0}r=f[n>>2]|0;n=b[r+s>>0]|0;w=Tj(s|0,t|0,1,0)|0;x=I;y=o;f[y>>2]=w;f[y+4>>2]=x;if(!((q|0)>(x|0)|(q|0)==(x|0)&p>>>0>w>>>0)){v=0;u=d;return v|0}x=b[r+w>>0]|0;w=Tj(s|0,t|0,2,0)|0;y=I;z=o;f[z>>2]=w;f[z+4>>2]=y;if(n<<24>>24>-1){z=n<<24>>24;A=f[a+216>>2]|0;if(z>>>0>=(((f[a+220>>2]|0)-A|0)/144|0)>>>0){v=0;u=d;return v|0}B=A+(z*144|0)|0;if((f[B>>2]|0)>-1){v=0;u=d;return v|0}else C=B}else{B=a+212|0;if((f[B>>2]|0)>-1){v=0;u=d;return v|0}else C=B}f[C>>2]=c;do if((((h[m+36>>0]|0)<<8|(h[m+37>>0]|0))&65535)>257)if((q|0)>(y|0)|(q|0)==(y|0)&p>>>0>w>>>0){C=b[r+w>>0]|0;B=Tj(s|0,t|0,3,0)|0;z=o;f[z>>2]=B;f[z+4>>2]=I;D=C&255;break}else{v=0;u=d;return v|0}else D=0;while(0);o=f[m+44>>2]|0;if(!(x<<24>>24)){if(n<<24>>24<0)E=a+184|0;else{x=n<<24>>24;m=f[a+216>>2]|0;b[m+(x*144|0)+100>>0]=0;E=m+(x*144|0)+104|0}switch((D&255)<<24>>24){case 0:{hc(e,a,E);F=f[e>>2]|0;break}case 1:{Wc(e,a,E);F=f[e>>2]|0;break}default:{v=0;u=d;return v|0}}if(!F){v=0;u=d;return v|0}else G=F}else{if(D|0){v=0;u=d;return v|0}D=n<<24>>24;if(n<<24>>24<0){v=0;u=d;return v|0}n=dj(88)|0;F=f[a+216>>2]|0;a=F+(D*144|0)+104|0;f[n+4>>2]=0;f[n>>2]=2348;E=n+12|0;f[E>>2]=2372;x=n+64|0;f[x>>2]=0;f[n+68>>2]=0;f[n+72>>2]=0;m=n+16|0;t=m+44|0;do{f[m>>2]=0;m=m+4|0}while((m|0)<(t|0));f[n+76>>2]=o;f[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Qa[f[(f[s>>2]|0)+4>>2]&127](s);s=f[l>>2]|0;if((c|0)<0){Qa[f[(f[x>>2]|0)+4>>2]&127](x);v=0;u=d;return v|0}x=s+8|0;l=s+12|0;s=f[l>>2]|0;k=f[x>>2]|0;g=s-k>>2;do if((g|0)<=(c|0)){n=c+1|0;w=s;if(n>>>0>g>>>0){Jd(x,n-g|0);break}if(n>>>0>>0?(r=k+(n<<2)|0,(w|0)!=(r|0)):0){n=w;do{w=n+-4|0;f[l>>2]=w;i=f[w>>2]|0;f[w>>2]=0;if(i|0)Qa[f[(f[i>>2]|0)+4>>2]&127](i);n=f[l>>2]|0}while((n|0)!=(r|0))}}while(0);l=(f[x>>2]|0)+(c<<2)|0;c=f[l>>2]|0;f[l>>2]=G;if(!c){v=1;u=d;return v|0}Qa[f[(f[c>>2]|0)+4>>2]&127](c);v=1;u=d;return v|0}function zb(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;if(!a)return;b=a+-8|0;c=f[3226]|0;d=f[a+-4>>2]|0;a=d&-8;e=b+a|0;do if(!(d&1)){g=f[b>>2]|0;if(!(d&3))return;h=b+(0-g)|0;i=g+a|0;if(h>>>0>>0)return;if((h|0)==(f[3227]|0)){j=e+4|0;k=f[j>>2]|0;if((k&3|0)!=3){l=h;m=h;n=i;break}f[3224]=i;f[j>>2]=k&-2;f[h+4>>2]=i|1;f[h+i>>2]=i;return}k=g>>>3;if(g>>>0<256){g=f[h+8>>2]|0;j=f[h+12>>2]|0;if((j|0)==(g|0)){f[3222]=f[3222]&~(1<>2]=j;f[j+8>>2]=g;l=h;m=h;n=i;break}}g=f[h+24>>2]|0;j=f[h+12>>2]|0;do if((j|0)==(h|0)){k=h+16|0;o=k+4|0;p=f[o>>2]|0;if(!p){q=f[k>>2]|0;if(!q){r=0;break}else{s=q;t=k}}else{s=p;t=o}while(1){o=s+20|0;p=f[o>>2]|0;if(p|0){s=p;t=o;continue}o=s+16|0;p=f[o>>2]|0;if(!p)break;else{s=p;t=o}}f[t>>2]=0;r=s}else{o=f[h+8>>2]|0;f[o+12>>2]=j;f[j+8>>2]=o;r=j}while(0);if(g){j=f[h+28>>2]|0;o=13192+(j<<2)|0;if((h|0)==(f[o>>2]|0)){f[o>>2]=r;if(!r){f[3223]=f[3223]&~(1<>2]|0)!=(h|0)&1)<<2)>>2]=r;if(!r){l=h;m=h;n=i;break}}f[r+24>>2]=g;j=h+16|0;o=f[j>>2]|0;if(o|0){f[r+16>>2]=o;f[o+24>>2]=r}o=f[j+4>>2]|0;if(o){f[r+20>>2]=o;f[o+24>>2]=r;l=h;m=h;n=i}else{l=h;m=h;n=i}}else{l=h;m=h;n=i}}else{l=b;m=b;n=a}while(0);if(l>>>0>=e>>>0)return;a=e+4|0;b=f[a>>2]|0;if(!(b&1))return;if(!(b&2)){r=f[3227]|0;if((e|0)==(f[3228]|0)){s=(f[3225]|0)+n|0;f[3225]=s;f[3228]=m;f[m+4>>2]=s|1;if((m|0)!=(r|0))return;f[3227]=0;f[3224]=0;return}if((e|0)==(r|0)){r=(f[3224]|0)+n|0;f[3224]=r;f[3227]=l;f[m+4>>2]=r|1;f[l+r>>2]=r;return}r=(b&-8)+n|0;s=b>>>3;do if(b>>>0<256){t=f[e+8>>2]|0;c=f[e+12>>2]|0;if((c|0)==(t|0)){f[3222]=f[3222]&~(1<>2]=c;f[c+8>>2]=t;break}}else{t=f[e+24>>2]|0;c=f[e+12>>2]|0;do if((c|0)==(e|0)){d=e+16|0;o=d+4|0;j=f[o>>2]|0;if(!j){p=f[d>>2]|0;if(!p){u=0;break}else{v=p;w=d}}else{v=j;w=o}while(1){o=v+20|0;j=f[o>>2]|0;if(j|0){v=j;w=o;continue}o=v+16|0;j=f[o>>2]|0;if(!j)break;else{v=j;w=o}}f[w>>2]=0;u=v}else{o=f[e+8>>2]|0;f[o+12>>2]=c;f[c+8>>2]=o;u=c}while(0);if(t|0){c=f[e+28>>2]|0;i=13192+(c<<2)|0;if((e|0)==(f[i>>2]|0)){f[i>>2]=u;if(!u){f[3223]=f[3223]&~(1<>2]|0)!=(e|0)&1)<<2)>>2]=u;if(!u)break}f[u+24>>2]=t;c=e+16|0;i=f[c>>2]|0;if(i|0){f[u+16>>2]=i;f[i+24>>2]=u}i=f[c+4>>2]|0;if(i|0){f[u+20>>2]=i;f[i+24>>2]=u}}}while(0);f[m+4>>2]=r|1;f[l+r>>2]=r;if((m|0)==(f[3227]|0)){f[3224]=r;return}else x=r}else{f[a>>2]=b&-2;f[m+4>>2]=n|1;f[l+n>>2]=n;x=n}n=x>>>3;if(x>>>0<256){l=12928+(n<<1<<2)|0;b=f[3222]|0;a=1<>2]|0}f[y>>2]=m;f[z+12>>2]=m;f[m+8>>2]=z;f[m+12>>2]=l;return}l=x>>>8;if(l)if(x>>>0>16777215)A=31;else{z=(l+1048320|0)>>>16&8;y=l<>>16&4;a=y<>>16&2;b=14-(l|z|y)+(a<>>15)|0;A=x>>>(b+7|0)&1|b<<1}else A=0;b=13192+(A<<2)|0;f[m+28>>2]=A;f[m+20>>2]=0;f[m+16>>2]=0;y=f[3223]|0;a=1<>>1)|0);l=f[b>>2]|0;while(1){if((f[l+4>>2]&-8|0)==(x|0)){B=73;break}C=l+16+(z>>>31<<2)|0;n=f[C>>2]|0;if(!n){B=72;break}else{z=z<<1;l=n}}if((B|0)==72){f[C>>2]=m;f[m+24>>2]=l;f[m+12>>2]=m;f[m+8>>2]=m;break}else if((B|0)==73){z=l+8|0;t=f[z>>2]|0;f[t+12>>2]=m;f[z>>2]=m;f[m+8>>2]=t;f[m+12>>2]=l;f[m+24>>2]=0;break}}else{f[3223]=y|a;f[b>>2]=m;f[m+24>>2]=b;f[m+12>>2]=m;f[m+8>>2]=m}while(0);m=(f[3230]|0)+-1|0;f[3230]=m;if(!m)D=13344;else return;while(1){m=f[D>>2]|0;if(!m)break;else D=m+8|0}f[3230]=-1;return}function Ab(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=Ja,F=Ja,G=Ja,H=0,I=0,J=0,K=0;d=b[c+11>>0]|0;e=d<<24>>24<0;g=e?f[c>>2]|0:c;i=e?f[c+4>>2]|0:d&255;if(i>>>0>3){d=g;e=i;j=i;while(1){k=X(h[d>>0]|h[d+1>>0]<<8|h[d+2>>0]<<16|h[d+3>>0]<<24,1540483477)|0;e=(X(k>>>24^k,1540483477)|0)^(X(e,1540483477)|0);j=j+-4|0;if(j>>>0<=3)break;else d=d+4|0}d=i+-4|0;j=d&-4;l=g+(j+4)|0;m=e;o=d-j|0}else{l=g;m=i;o=i}switch(o|0){case 3:{p=h[l+2>>0]<<16^m;q=6;break}case 2:{p=m;q=6;break}case 1:{r=m;q=7;break}default:s=m}if((q|0)==6){r=h[l+1>>0]<<8^p;q=7}if((q|0)==7)s=X(h[l>>0]^r,1540483477)|0;r=X(s>>>13^s,1540483477)|0;s=r>>>15^r;r=a+4|0;l=f[r>>2]|0;p=(l|0)==0;a:do if(!p){m=l+-1|0;o=(m&l|0)==0;if(!o)if(s>>>0>>0)t=s;else t=(s>>>0)%(l>>>0)|0;else t=s&m;j=f[(f[a>>2]|0)+(t<<2)>>2]|0;if((j|0)!=0?(d=f[j>>2]|0,(d|0)!=0):0){j=(i|0)==0;if(o){if(j){o=d;while(1){e=f[o+4>>2]|0;if(!((e|0)==(s|0)|(e&m|0)==(t|0))){u=t;break a}e=b[o+8+11>>0]|0;if(!((e<<24>>24<0?f[o+12>>2]|0:e&255)|0)){v=o;break}o=f[o>>2]|0;if(!o){u=t;break a}}w=v+20|0;return w|0}else x=d;b:while(1){o=f[x+4>>2]|0;if(!((o|0)==(s|0)|(o&m|0)==(t|0))){u=t;break a}o=x+8|0;e=b[o+11>>0]|0;k=e<<24>>24<0;y=e&255;do if(((k?f[x+12>>2]|0:y)|0)==(i|0)){e=f[o>>2]|0;if(k)if(!(mh(e,g,i)|0)){v=x;q=63;break b}else break;if((e&255)<<24>>24==(b[g>>0]|0)){e=y;z=o;A=g;do{e=e+-1|0;z=z+1|0;if(!e){v=x;q=63;break b}A=A+1|0}while((b[z>>0]|0)==(b[A>>0]|0))}}while(0);x=f[x>>2]|0;if(!x){u=t;break a}}if((q|0)==63){w=v+20|0;return w|0}}if(j){m=d;while(1){o=f[m+4>>2]|0;if((o|0)!=(s|0)){if(o>>>0>>0)B=o;else B=(o>>>0)%(l>>>0)|0;if((B|0)!=(t|0)){u=t;break a}}o=b[m+8+11>>0]|0;if(!((o<<24>>24<0?f[m+12>>2]|0:o&255)|0)){v=m;break}m=f[m>>2]|0;if(!m){u=t;break a}}w=v+20|0;return w|0}else C=d;c:while(1){m=f[C+4>>2]|0;if((m|0)!=(s|0)){if(m>>>0>>0)D=m;else D=(m>>>0)%(l>>>0)|0;if((D|0)!=(t|0)){u=t;break a}}m=C+8|0;j=b[m+11>>0]|0;o=j<<24>>24<0;y=j&255;do if(((o?f[C+12>>2]|0:y)|0)==(i|0)){j=f[m>>2]|0;if(o)if(!(mh(j,g,i)|0)){v=C;q=63;break c}else break;if((j&255)<<24>>24==(b[g>>0]|0)){j=y;k=m;A=g;do{j=j+-1|0;k=k+1|0;if(!j){v=C;q=63;break c}A=A+1|0}while((b[k>>0]|0)==(b[A>>0]|0))}}while(0);C=f[C>>2]|0;if(!C){u=t;break a}}if((q|0)==63){w=v+20|0;return w|0}}else u=t}else u=0;while(0);t=dj(24)|0;Sf(t+8|0,c);f[t+20>>2]=0;f[t+4>>2]=s;f[t>>2]=0;c=a+12|0;E=$(((f[c>>2]|0)+1|0)>>>0);F=$(l>>>0);G=$(n[a+16>>2]);do if(p|E>$(F*G)){C=(l>>>0<3|(l+-1&l|0)!=0)&1|l<<1;g=~~$(W($(E/G)))>>>0;Pe(a,C>>>0>>0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s=f[g>>2]|0}while((n|0)<(s|0));if((s|0)>0){n=a+20|0;h=0;do{p=(f[b+(h<<2)>>2]|0)+(f[r+(h<<2)>>2]|0)|0;o=c+(h<<2)|0;f[o>>2]=p;if((p|0)<=(f[i>>2]|0)){if((p|0)<(f[l>>2]|0)){t=(f[n>>2]|0)+p|0;u=18}}else{t=p-(f[n>>2]|0)|0;u=18}if((u|0)==18){u=0;f[o>>2]=t}h=h+1|0;o=f[g>>2]|0}while((h|0)<(o|0));v=o}else v=s}else v=m;m=f[a+56>>2]|0;s=f[m>>2]|0;h=(f[m+4>>2]|0)-s|0;t=h>>2;if((h|0)<=4){dn(j);return 1}h=a+16|0;n=a+32|0;l=a+12|0;i=a+20|0;a=k+12|0;r=(e|0)>0;o=s;s=v;v=1;while(1){if(t>>>0<=v>>>0){u=24;break}p=f[o+(v<<2)>>2]|0;q=X(v,e)|0;if((p|0)!=-1?(w=f[(f[a>>2]|0)+(p<<2)>>2]|0,(w|0)!=-1):0){p=f[k>>2]|0;x=f[d>>2]|0;y=f[x+(f[p+(w<<2)>>2]<<2)>>2]|0;z=w+1|0;A=((z>>>0)%3|0|0)==0?w+-2|0:z;if((A|0)==-1)B=-1;else B=f[p+(A<<2)>>2]|0;A=f[x+(B<<2)>>2]|0;z=(((w>>>0)%3|0|0)==0?2:-1)+w|0;if((z|0)==-1)C=-1;else C=f[p+(z<<2)>>2]|0;z=f[x+(C<<2)>>2]|0;if((y|0)<(v|0)&(A|0)<(v|0)&(z|0)<(v|0)){x=X(y,e)|0;y=X(A,e)|0;A=X(z,e)|0;if(r){z=0;do{f[j+(z<<2)>>2]=(f[c+(z+A<<2)>>2]|0)+(f[c+(z+y<<2)>>2]|0)-(f[c+(z+x<<2)>>2]|0);z=z+1|0}while((z|0)!=(e|0))}z=b+(q<<2)|0;x=c+(q<<2)|0;if((s|0)>0){y=0;do{A=f[j+(y<<2)>>2]|0;p=f[h>>2]|0;if((A|0)>(p|0)){w=f[n>>2]|0;f[w+(y<<2)>>2]=p;D=w}else{w=f[l>>2]|0;p=f[n>>2]|0;f[p+(y<<2)>>2]=(A|0)<(w|0)?w:A;D=p}y=y+1|0;E=f[g>>2]|0}while((y|0)<(E|0));if((E|0)>0){y=0;do{p=(f[z+(y<<2)>>2]|0)+(f[D+(y<<2)>>2]|0)|0;A=x+(y<<2)|0;f[A>>2]=p;if((p|0)<=(f[h>>2]|0)){if((p|0)<(f[l>>2]|0)){F=(f[i>>2]|0)+p|0;u=56}}else{F=p-(f[i>>2]|0)|0;u=56}if((u|0)==56){u=0;f[A>>2]=F}y=y+1|0;A=f[g>>2]|0}while((y|0)<(A|0));G=A}else G=E}else G=s}else u=34}else u=34;if((u|0)==34){u=0;y=c+((X(v+-1|0,e)|0)<<2)|0;x=b+(q<<2)|0;z=c+(q<<2)|0;if((s|0)>0){A=0;do{p=f[y+(A<<2)>>2]|0;w=f[h>>2]|0;if((p|0)>(w|0)){H=f[n>>2]|0;f[H+(A<<2)>>2]=w;I=H}else{H=f[l>>2]|0;w=f[n>>2]|0;f[w+(A<<2)>>2]=(p|0)<(H|0)?H:p;I=w}A=A+1|0;J=f[g>>2]|0}while((A|0)<(J|0));if((J|0)>0){A=0;do{y=(f[x+(A<<2)>>2]|0)+(f[I+(A<<2)>>2]|0)|0;q=z+(A<<2)|0;f[q>>2]=y;if((y|0)<=(f[h>>2]|0)){if((y|0)<(f[l>>2]|0)){K=(f[i>>2]|0)+y|0;u=44}}else{K=y-(f[i>>2]|0)|0;u=44}if((u|0)==44){u=0;f[q>>2]=K}A=A+1|0;q=f[g>>2]|0}while((A|0)<(q|0));G=q}else G=J}else G=s}v=v+1|0;if((v|0)>=(t|0)){u=22;break}else s=G}if((u|0)==22){dn(j);return 1}else if((u|0)==24)ym(m);return 0}function Cb(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;g=a+8|0;f[g>>2]=e;d=a+32|0;h=a+36|0;i=f[h>>2]|0;j=f[d>>2]|0;k=i-j>>2;l=j;j=i;if(k>>>0>=e>>>0)if(k>>>0>e>>>0?(i=l+(e<<2)|0,(j|0)!=(i|0)):0){f[h>>2]=j+(~((j+-4-i|0)>>>2)<<2);m=e}else m=e;else{jf(d,e-k|0);m=f[g>>2]|0}k=f[a+48>>2]|0;d=f[a+52>>2]|0;i=e>>>0>1073741823?-1:e<<2;j=cn(i)|0;Vf(j|0,0,i|0)|0;if((m|0)>0){i=a+16|0;h=a+32|0;l=a+12|0;n=0;do{o=f[j+(n<<2)>>2]|0;p=f[i>>2]|0;if((o|0)>(p|0)){q=f[h>>2]|0;f[q+(n<<2)>>2]=p;r=q}else{q=f[l>>2]|0;p=f[h>>2]|0;f[p+(n<<2)>>2]=(o|0)<(q|0)?q:o;r=p}n=n+1|0;s=f[g>>2]|0}while((n|0)<(s|0));if((s|0)>0){n=a+20|0;h=0;do{p=(f[b+(h<<2)>>2]|0)+(f[r+(h<<2)>>2]|0)|0;o=c+(h<<2)|0;f[o>>2]=p;if((p|0)<=(f[i>>2]|0)){if((p|0)<(f[l>>2]|0)){t=(f[n>>2]|0)+p|0;u=18}}else{t=p-(f[n>>2]|0)|0;u=18}if((u|0)==18){u=0;f[o>>2]=t}h=h+1|0;o=f[g>>2]|0}while((h|0)<(o|0));v=o}else v=s}else v=m;m=f[a+56>>2]|0;s=f[m>>2]|0;h=(f[m+4>>2]|0)-s|0;t=h>>2;if((h|0)<=4){dn(j);return 1}h=a+16|0;n=a+32|0;l=a+12|0;i=a+20|0;a=k+64|0;r=k+28|0;o=(e|0)>0;p=s;s=v;v=1;while(1){if(t>>>0<=v>>>0){u=24;break}q=f[p+(v<<2)>>2]|0;w=X(v,e)|0;if((((q|0)!=-1?(f[(f[k>>2]|0)+(q>>>5<<2)>>2]&1<<(q&31)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|0;y=f[n>>2]|0;f[y+(B<<2)>>2]=(q|0)<(G|0)?G:q;H=y}B=B+1|0;I=f[g>>2]|0}while((B|0)<(I|0));if((I|0)>0){B=0;do{z=(f[x+(B<<2)>>2]|0)+(f[H+(B<<2)>>2]|0)|0;w=A+(B<<2)|0;f[w>>2]=z;if((z|0)<=(f[h>>2]|0)){if((z|0)<(f[l>>2]|0)){J=(f[i>>2]|0)+z|0;u=41}}else{J=z-(f[i>>2]|0)|0;u=41}if((u|0)==41){u=0;f[w>>2]=J}B=B+1|0;w=f[g>>2]|0}while((B|0)<(w|0));F=w}else F=I}else F=s}v=v+1|0;if((v|0)>=(t|0)){u=22;break}else s=F}if((u|0)==22){dn(j);return 1}else if((u|0)==24)ym(m);return 0}function Db(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=u;u=u+16|0;g=e;i=c+8|0;j=i;k=f[j>>2]|0;l=f[j+4>>2]|0;j=c+16|0;m=j;n=f[m>>2]|0;o=Tj(n|0,f[m+4>>2]|0,5,0)|0;m=I;if((l|0)<(m|0)|(l|0)==(m|0)&k>>>0>>0){o=dj(32)|0;f[g>>2]=o;f[g+8>>2]=-2147483616;f[g+4>>2]=29;p=o;q=9500;r=p+29|0;do{b[p>>0]=b[q>>0]|0;p=p+1|0;q=q+1|0}while((p|0)<(r|0));b[o+29>>0]=0;f[a>>2]=-2;Sf(a+4|0,g);if((b[g+11>>0]|0)<0)fn(f[g>>2]|0);u=e;return}o=(f[c>>2]|0)+n|0;b[d>>0]=b[o>>0]|0;b[d+1>>0]=b[o+1>>0]|0;b[d+2>>0]=b[o+2>>0]|0;b[d+3>>0]=b[o+3>>0]|0;b[d+4>>0]=b[o+4>>0]|0;o=j;n=Tj(f[o>>2]|0,f[o+4>>2]|0,5,0)|0;o=I;k=j;f[k>>2]=n;f[k+4>>2]=o;if(mh(d,9530,5)|0){k=dj(32)|0;f[g>>2]=k;f[g+8>>2]=-2147483616;f[g+4>>2]=17;p=k;q=9536;r=p+17|0;do{b[p>>0]=b[q>>0]|0;p=p+1|0;q=q+1|0}while((p|0)<(r|0));b[k+17>>0]=0;f[a>>2]=-1;Sf(a+4|0,g);if((b[g+11>>0]|0)<0)fn(f[g>>2]|0);u=e;return}k=i;m=f[k+4>>2]|0;if(!((m|0)>(o|0)|((m|0)==(o|0)?(f[k>>2]|0)>>>0>n>>>0:0))){k=dj(32)|0;f[g>>2]=k;f[g+8>>2]=-2147483616;f[g+4>>2]=29;p=k;q=9500;r=p+29|0;do{b[p>>0]=b[q>>0]|0;p=p+1|0;q=q+1|0}while((p|0)<(r|0));b[k+29>>0]=0;f[a>>2]=-2;Sf(a+4|0,g);if((b[g+11>>0]|0)<0)fn(f[g>>2]|0);u=e;return}b[d+5>>0]=b[(f[c>>2]|0)+n>>0]|0;n=j;k=Tj(f[n>>2]|0,f[n+4>>2]|0,1,0)|0;n=I;o=j;f[o>>2]=k;f[o+4>>2]=n;o=i;m=f[o+4>>2]|0;if(!((m|0)>(n|0)|((m|0)==(n|0)?(f[o>>2]|0)>>>0>k>>>0:0))){o=dj(32)|0;f[g>>2]=o;f[g+8>>2]=-2147483616;f[g+4>>2]=29;p=o;q=9500;r=p+29|0;do{b[p>>0]=b[q>>0]|0;p=p+1|0;q=q+1|0}while((p|0)<(r|0));b[o+29>>0]=0;f[a>>2]=-2;Sf(a+4|0,g);if((b[g+11>>0]|0)<0)fn(f[g>>2]|0);u=e;return}b[d+6>>0]=b[(f[c>>2]|0)+k>>0]|0;k=j;o=Tj(f[k>>2]|0,f[k+4>>2]|0,1,0)|0;k=I;n=j;f[n>>2]=o;f[n+4>>2]=k;n=i;m=f[n+4>>2]|0;if(!((m|0)>(k|0)|((m|0)==(k|0)?(f[n>>2]|0)>>>0>o>>>0:0))){n=dj(32)|0;f[g>>2]=n;f[g+8>>2]=-2147483616;f[g+4>>2]=29;p=n;q=9500;r=p+29|0;do{b[p>>0]=b[q>>0]|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0);u=e;return}function Eb(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;if((b|0)<0)return;c=a+12|0;d=f[c>>2]|0;e=f[a+8>>2]|0;g=e;h=d;if(d-e>>2>>>0<=b>>>0)return;e=g+(b<<2)|0;d=f[(f[e>>2]|0)+56>>2]|0;i=f[(f[g+(b<<2)>>2]|0)+60>>2]|0;g=e+4|0;if((g|0)!=(h|0)){j=g;g=e;do{k=f[j>>2]|0;f[j>>2]=0;l=f[g>>2]|0;f[g>>2]=k;if(l|0){k=l+88|0;m=f[k>>2]|0;f[k>>2]=0;if(m|0){k=f[m+8>>2]|0;if(k|0){n=m+12|0;if((f[n>>2]|0)!=(k|0))f[n>>2]=k;fn(k)}fn(m)}m=f[l+68>>2]|0;if(m|0){k=l+72|0;n=f[k>>2]|0;if((n|0)!=(m|0))f[k>>2]=n+(~((n+-4-m|0)>>>2)<<2);fn(m)}m=l+64|0;n=f[m>>2]|0;f[m>>2]=0;if(n|0){m=f[n>>2]|0;if(m|0){k=n+4|0;if((f[k>>2]|0)!=(m|0))f[k>>2]=m;fn(m)}fn(n)}fn(l)}j=j+4|0;g=g+4|0}while((j|0)!=(h|0));j=f[c>>2]|0;if((j|0)!=(g|0)){o=j;p=g;q=24}}else{o=h;p=e;q=24}if((q|0)==24){q=o;do{o=q+-4|0;f[c>>2]=o;e=f[o>>2]|0;f[o>>2]=0;if(e|0){o=e+88|0;h=f[o>>2]|0;f[o>>2]=0;if(h|0){o=f[h+8>>2]|0;if(o|0){g=h+12|0;if((f[g>>2]|0)!=(o|0))f[g>>2]=o;fn(o)}fn(h)}h=f[e+68>>2]|0;if(h|0){o=e+72|0;g=f[o>>2]|0;if((g|0)!=(h|0))f[o>>2]=g+(~((g+-4-h|0)>>>2)<<2);fn(h)}h=e+64|0;g=f[h>>2]|0;f[h>>2]=0;if(g|0){h=f[g>>2]|0;if(h|0){o=g+4|0;if((f[o>>2]|0)!=(h|0))f[o>>2]=h;fn(h)}fn(g)}fn(e)}q=f[c>>2]|0}while((q|0)!=(p|0))}p=f[a+4>>2]|0;a:do if(p|0){q=p+44|0;c=f[q>>2]|0;e=f[p+40>>2]|0;while(1){if((e|0)==(c|0))break a;r=e+4|0;if((f[(f[e>>2]|0)+40>>2]|0)==(i|0))break;else e=r}if((r|0)!=(c|0)){g=r;h=e;do{o=f[g>>2]|0;f[g>>2]=0;j=f[h>>2]|0;f[h>>2]=o;if(j|0){Df(j);fn(j)}g=g+4|0;h=h+4|0}while((g|0)!=(c|0));g=f[q>>2]|0;if((g|0)==(h|0))break;else{s=g;t=h}}else{s=c;t=e}g=s;do{j=g+-4|0;f[q>>2]=j;o=f[j>>2]|0;f[j>>2]=0;if(o|0){Df(o);fn(o)}g=f[q>>2]|0}while((g|0)!=(t|0))}while(0);b:do if((d|0)<5){t=f[a+20+(d*12|0)>>2]|0;s=a+20+(d*12|0)+4|0;r=f[s>>2]|0;i=r;c:do if((t|0)==(r|0))u=t;else{p=t;while(1){if((f[p>>2]|0)==(b|0)){u=p;break c}p=p+4|0;if((p|0)==(r|0))break b}}while(0);if((u|0)!=(r|0)){t=u+4|0;p=i-t|0;g=p>>2;if(!g)v=r;else{ui(u|0,t|0,p|0)|0;v=f[s>>2]|0}p=u+(g<<2)|0;if((v|0)!=(p|0))f[s>>2]=v+(~((v+-4-p|0)>>>2)<<2)}}while(0);v=f[a+24>>2]|0;u=f[a+20>>2]|0;d=u;if((v|0)!=(u|0)){p=v-u>>2;u=0;do{v=d+(u<<2)|0;g=f[v>>2]|0;if((g|0)>(b|0))f[v>>2]=g+-1;u=u+1|0}while(u>>>0

>>0)}p=f[a+36>>2]|0;u=f[a+32>>2]|0;d=u;if((p|0)!=(u|0)){g=p-u>>2;u=0;do{p=d+(u<<2)|0;v=f[p>>2]|0;if((v|0)>(b|0))f[p>>2]=v+-1;u=u+1|0}while(u>>>0>>0)}g=f[a+48>>2]|0;u=f[a+44>>2]|0;d=u;if((g|0)!=(u|0)){v=g-u>>2;u=0;do{g=d+(u<<2)|0;p=f[g>>2]|0;if((p|0)>(b|0))f[g>>2]=p+-1;u=u+1|0}while(u>>>0>>0)}v=f[a+60>>2]|0;u=f[a+56>>2]|0;d=u;if((v|0)!=(u|0)){p=v-u>>2;u=0;do{v=d+(u<<2)|0;g=f[v>>2]|0;if((g|0)>(b|0))f[v>>2]=g+-1;u=u+1|0}while(u>>>0

>>0)}p=f[a+72>>2]|0;u=f[a+68>>2]|0;a=u;if((p|0)==(u|0))return;d=p-u>>2;u=0;do{p=a+(u<<2)|0;g=f[p>>2]|0;if((g|0)>(b|0))f[p>>2]=g+-1;u=u+1|0}while(u>>>0>>0);return}function Fb(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0;e=u;u=u+16|0;g=e+8|0;h=e+4|0;i=e;j=a+64|0;k=f[j>>2]|0;if((f[k+28>>2]|0)==(f[k+24>>2]|0)){u=e;return}l=c+96|0;c=a+52|0;m=d+84|0;n=d+68|0;d=a+56|0;o=a+60|0;p=a+12|0;q=a+28|0;r=a+40|0;s=a+44|0;t=a+48|0;v=k;k=0;w=0;while(1){x=f[(f[v+24>>2]|0)+(w<<2)>>2]|0;if((x|0)==-1){y=v;z=k}else{A=k+1|0;B=f[(f[l>>2]|0)+(((x|0)/3|0)*12|0)+(((x|0)%3|0)<<2)>>2]|0;if(!(b[m>>0]|0))C=f[(f[n>>2]|0)+(B<<2)>>2]|0;else C=B;f[g>>2]=C;B=f[d>>2]|0;if(B>>>0<(f[o>>2]|0)>>>0){f[B>>2]=C;f[d>>2]=B+4}else yf(c,g);f[g>>2]=x;f[h>>2]=0;a:do if(!(f[(f[p>>2]|0)+(w>>>5<<2)>>2]&1<<(w&31)))D=x;else{B=x+1|0;E=((B>>>0)%3|0|0)==0?x+-2|0:B;if(((E|0)!=-1?(f[(f[a>>2]|0)+(E>>>5<<2)>>2]&1<<(E&31)|0)==0:0)?(B=f[(f[(f[j>>2]|0)+12>>2]|0)+(E<<2)>>2]|0,E=B+1|0,(B|0)!=-1):0){F=((E>>>0)%3|0|0)==0?B+-2|0:E;f[h>>2]=F;if((F|0)==-1){D=x;break}else G=F;while(1){f[g>>2]=G;F=G+1|0;E=((F>>>0)%3|0|0)==0?G+-2|0:F;if((E|0)==-1)break;if(f[(f[a>>2]|0)+(E>>>5<<2)>>2]&1<<(E&31)|0)break;F=f[(f[(f[j>>2]|0)+12>>2]|0)+(E<<2)>>2]|0;E=F+1|0;if((F|0)==-1)break;B=((E>>>0)%3|0|0)==0?F+-2|0:E;f[h>>2]=B;if((B|0)==-1){D=G;break a}else G=B}f[h>>2]=-1;D=G;break}f[h>>2]=-1;D=x}while(0);f[(f[q>>2]|0)+(D<<2)>>2]=k;x=f[s>>2]|0;if((x|0)==(f[t>>2]|0))yf(r,g);else{f[x>>2]=f[g>>2];f[s>>2]=x+4}x=f[j>>2]|0;B=f[g>>2]|0;b:do if(((B|0)!=-1?(E=(((B>>>0)%3|0|0)==0?2:-1)+B|0,(E|0)!=-1):0)?(F=f[(f[x+12>>2]|0)+(E<<2)>>2]|0,(F|0)!=-1):0){E=F+(((F>>>0)%3|0|0)==0?2:-1)|0;f[h>>2]=E;if((E|0)!=-1&(E|0)!=(B|0)){F=E;E=k;H=A;while(1){I=F+1|0;J=((I>>>0)%3|0|0)==0?F+-2|0:I;do if(f[(f[a>>2]|0)+(J>>>5<<2)>>2]&1<<(J&31)){I=H+1|0;K=f[(f[l>>2]|0)+(((F|0)/3|0)*12|0)+(((F|0)%3|0)<<2)>>2]|0;if(!(b[m>>0]|0))L=f[(f[n>>2]|0)+(K<<2)>>2]|0;else L=K;f[i>>2]=L;K=f[d>>2]|0;if(K>>>0<(f[o>>2]|0)>>>0){f[K>>2]=L;f[d>>2]=K+4}else yf(c,i);K=f[s>>2]|0;if((K|0)==(f[t>>2]|0)){yf(r,h);M=H;N=I;break}else{f[K>>2]=f[h>>2];f[s>>2]=K+4;M=H;N=I;break}}else{M=E;N=H}while(0);f[(f[q>>2]|0)+(f[h>>2]<<2)>>2]=M;O=f[j>>2]|0;J=f[h>>2]|0;if((J|0)==-1)break;I=(((J>>>0)%3|0|0)==0?2:-1)+J|0;if((I|0)==-1)break;J=f[(f[O+12>>2]|0)+(I<<2)>>2]|0;if((J|0)==-1)break;F=J+(((J>>>0)%3|0|0)==0?2:-1)|0;f[h>>2]=F;if(!((F|0)!=-1?(F|0)!=(f[g>>2]|0):0)){P=O;Q=N;break b}else{E=M;H=N}}f[h>>2]=-1;P=O;Q=N}else{P=x;Q=A}}else R=28;while(0);if((R|0)==28){R=0;f[h>>2]=-1;P=x;Q=A}y=P;z=Q}w=w+1|0;if(w>>>0>=(f[y+28>>2]|0)-(f[y+24>>2]|0)>>2>>>0)break;else{v=y;k=z}}u=e;return}function Gb(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=u;u=u+32|0;d=e+28|0;h=e+16|0;i=e+8|0;j=e;k=a+60|0;f[a+68>>2]=g;g=a+56|0;l=f[g>>2]|0;m=(f[l+4>>2]|0)-(f[l>>2]|0)|0;n=m>>2;f[h>>2]=0;f[h+4>>2]=0;f[h+8>>2]=0;if((m|0)<=0){u=e;return 1}m=h+4|0;o=h+8|0;p=a+104|0;q=a+108|0;r=i+4|0;s=a+100|0;t=a+8|0;v=a+16|0;w=a+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(E=f[p>>2]|0,(E|0)>(Q|0)):0){R=P;S=(E<<1)-Q|0;break}if(F?(F=f[p>>2]|0,(F|0)>(P|0)):0){R=(F<<1)-P|0;S=Q;break}if(a){F=f[p>>2]|0;R=(F|0)<(P|0)?(F<<1)-P|0:P;S=0}else{R=P;S=Q}}else{R=C;S=C}while(0);f[i>>2]=R;f[r>>2]=S;C=B<<1;a=b+(C<<2)|0;D=c+(C<<2)|0;if((f[t>>2]|0)>0){C=R;F=0;while(1){E=f[v>>2]|0;if((C|0)>(E|0)){l=f[w>>2]|0;f[l+(F<<2)>>2]=E;T=l}else{l=f[x>>2]|0;E=f[w>>2]|0;f[E+(F<<2)>>2]=(C|0)<(l|0)?l:C;T=E}E=F+1|0;U=f[t>>2]|0;if((E|0)>=(U|0))break;C=f[i+(E<<2)>>2]|0;F=E}if((U|0)>0){F=0;do{C=(f[a+(F<<2)>>2]|0)+(f[T+(F<<2)>>2]|0)|0;E=D+(F<<2)|0;f[E>>2]=C;if((C|0)<=(f[v>>2]|0)){if((C|0)<(f[x>>2]|0)){V=(f[y>>2]|0)+C|0;W=40}}else{V=C-(f[y>>2]|0)|0;W=40}if((W|0)==40){W=0;f[E>>2]=V}F=F+1|0}while((F|0)<(f[t>>2]|0))}}B=B+1|0;if((B|0)>=(n|0)){W=3;break}F=f[g>>2]|0;A=f[F>>2]|0;if((f[F+4>>2]|0)-A>>2>>>0<=B>>>0){z=F;W=4;break}}if((W|0)==3){u=e;return 1}else if((W|0)==4)ym(z);return 0}function Hb(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;e=u;u=u+32|0;d=e+28|0;h=e+16|0;i=e+8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=D}else{P=O;Q=(f[s>>2]|0)-D|0}}else{D=f[p>>2]|0;P=D+M|0;Q=D+N|0}D=(P|0)==0;a=(Q|0)==0;C=f[s>>2]|0;do if((Q|P|0)!=0?(F=(C|0)==(Q|0),E=(C|0)==(P|0),!(D&F|a&E)):0){if(D?(l=f[p>>2]|0,(l|0)<(Q|0)):0){R=0;S=(l<<1)-Q|0;break}if(E?(E=f[p>>2]|0,(E|0)>(Q|0)):0){R=P;S=(E<<1)-Q|0;break}if(F?(F=f[p>>2]|0,(F|0)>(P|0)):0){R=(F<<1)-P|0;S=Q;break}if(a){F=f[p>>2]|0;R=(F|0)<(P|0)?(F<<1)-P|0:P;S=0}else{R=P;S=Q}}else{R=C;S=C}while(0);f[i>>2]=R;f[r>>2]=S;C=B<<1;a=b+(C<<2)|0;D=c+(C<<2)|0;if((f[t>>2]|0)>0){C=R;F=0;while(1){E=f[v>>2]|0;if((C|0)>(E|0)){l=f[w>>2]|0;f[l+(F<<2)>>2]=E;T=l}else{l=f[x>>2]|0;E=f[w>>2]|0;f[E+(F<<2)>>2]=(C|0)<(l|0)?l:C;T=E}E=F+1|0;U=f[t>>2]|0;if((E|0)>=(U|0))break;C=f[i+(E<<2)>>2]|0;F=E}if((U|0)>0){F=0;do{C=(f[a+(F<<2)>>2]|0)+(f[T+(F<<2)>>2]|0)|0;E=D+(F<<2)|0;f[E>>2]=C;if((C|0)<=(f[v>>2]|0)){if((C|0)<(f[x>>2]|0)){V=(f[y>>2]|0)+C|0;W=40}}else{V=C-(f[y>>2]|0)|0;W=40}if((W|0)==40){W=0;f[E>>2]=V}F=F+1|0}while((F|0)<(f[t>>2]|0))}}B=B+1|0;if((B|0)>=(n|0)){W=3;break}F=f[g>>2]|0;A=f[F>>2]|0;if((f[F+4>>2]|0)-A>>2>>>0<=B>>>0){z=F;W=4;break}}if((W|0)==3){u=e;return 1}else if((W|0)==4)ym(z);return 0}function Ib(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e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:0-B|0)|0;F=q;G=C?E:0-E|0}f[F>>2]=G;E=Xg(s)|0;C=f[j>>2]|0;if(E){E=0-C|0;B=0-(f[o>>2]|0)|0;x=0-(f[q>>2]|0)|0;f[j>>2]=E;f[o>>2]=B;f[q>>2]=x;K=E;L=B;M=x}else{K=C;L=f[o>>2]|0;M=f[q>>2]|0}if((K|0)<=-1){C=(M|0)>-1?M:0-M|0;if((L|0)<0)N=C;else N=(f[t>>2]|0)-C|0;C=(L|0)>-1?L:0-L|0;if((M|0)<0){O=N;P=C}else{O=N;P=(f[t>>2]|0)-C|0}}else{C=f[r>>2]|0;O=C+L|0;P=C+M|0}C=(O|0)==0;x=(P|0)==0;B=f[t>>2]|0;do if((P|O|0)!=0?(E=(B|0)==(P|0),D=(B|0)==(O|0),!(C&E|x&D)):0){if(C?(n=f[r>>2]|0,(n|0)<(P|0)):0){Q=0;R=(n<<1)-P|0;break}if(D?(D=f[r>>2]|0,(D|0)>(P|0)):0){Q=O;R=(D<<1)-P|0;break}if(E?(E=f[r>>2]|0,(E|0)>(O|0)):0){Q=(E<<1)-O|0;R=P;break}if(x){E=f[r>>2]|0;Q=(E|0)<(O|0)?(E<<1)-O|0:O;R=0}else{Q=O;R=P}}else{Q=B;R=B}while(0);B=A<<1;x=b+(B<<2)|0;C=c+(B<<2)|0;B=f[x>>2]|0;E=f[x+4>>2]|0;f[h>>2]=Q;f[a>>2]=R;f[i>>2]=B;f[v>>2]=E;bc(d,l,h,i);f[C>>2]=f[d>>2];f[C+4>>2]=f[w>>2];A=A+1|0;if((A|0)>=(p|0)){S=5;break}C=f[g>>2]|0;z=f[C>>2]|0;if((f[C+4>>2]|0)-z>>2>>>0<=A>>>0){y=C;S=6;break}}if((S|0)==5){u=e;return 1}else if((S|0)==6)ym(y);return 0} +function zf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0.0;a=u;u=u+32|0;e=a;g=a+8|0;p[e>>3]=0.0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;h=gg(d)|0;if(h>>>0>4294967279)ym(g);if(h>>>0<11){b[g+11>>0]=h;if(!h)i=g;else{j=g;k=6}}else{l=h+16&-16;m=dj(l)|0;f[g>>2]=m;f[g+8>>2]=l|-2147483648;f[g+4>>2]=h;j=m;k=6}if((k|0)==6){ee(j|0,d|0,h|0)|0;i=j}b[i+h>>0]=0;De(c,g,e)|0;n=+p[e>>3];if((b[g+11>>0]|0)>=0){u=a;return +n}fn(f[g>>2]|0);u=a;return +n}function Af(a,c,d,e){a=a|0;c=c|0;d=d|0;e=e|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=u;u=u+128|0;h=g+124|0;i=g;j=i;k=3084;l=j+124|0;do{f[j>>2]=f[k>>2];j=j+4|0;k=k+4|0}while((j|0)<(l|0));if((c+-1|0)>>>0>2147483646)if(!c){m=1;n=h;o=4}else{h=Um()|0;f[h>>2]=75;p=-1}else{m=c;n=a;o=4}if((o|0)==4){o=-2-n|0;a=m>>>0>o>>>0?o:m;f[i+48>>2]=a;m=i+20|0;f[m>>2]=n;f[i+44>>2]=n;o=n+a|0;n=i+16|0;f[n>>2]=o;f[i+28>>2]=o;o=xe(i,d,e)|0;if(!a)p=o;else{a=f[m>>2]|0;b[a+(((a|0)==(f[n>>2]|0))<<31>>31)>>0]=0;p=o}}u=g;return p|0}function Bf(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0;d=u;u=u+80|0;e=d;g=d+56|0;i=d+40|0;j=e;k=c;c=j+40|0;do{f[j>>2]=f[k>>2];j=j+4|0;k=k+4|0}while((j|0)<(c|0));Db(i,e,g);k=f[i>>2]|0;if(!k){j=i+4|0;if((b[j+11>>0]|0)<0)fn(f[j>>2]|0);j=h[g+7>>0]|0;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;f[a+12>>2]=0;f[a+16>>2]=j;l=e+24|0;ln(l);u=d;return}else{f[a>>2]=k;k=i+4|0;Sf(a+4|0,k);if((b[k+11>>0]|0)<0)fn(f[k>>2]|0);l=e+24|0;ln(l);u=d;return}}function Cf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;a=u;u=u+16|0;e=a+12|0;g=a;f[e>>2]=0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;h=gg(d)|0;if(h>>>0>4294967279)ym(g);if(h>>>0<11){b[g+11>>0]=h;if(!h)i=g;else{j=g;k=6}}else{l=h+16&-16;m=dj(l)|0;f[g>>2]=m;f[g+8>>2]=l|-2147483648;f[g+4>>2]=h;j=m;k=6}if((k|0)==6){ee(j|0,d|0,h|0)|0;i=j}b[i+h>>0]=0;dg(c,g,e)|0;c=f[e>>2]|0;if((b[g+11>>0]|0)>=0){u=a;return c|0}fn(f[g>>2]|0);u=a;return c|0}function Df(a){a=a|0;var c=0,d=0,e=0,g=0,h=0;c=f[a+28>>2]|0;if(c|0){d=c;do{c=d;d=f[d>>2]|0;e=c+8|0;g=c+20|0;h=f[g>>2]|0;f[g>>2]=0;if(h|0){Df(h);fn(h)}if((b[e+11>>0]|0)<0)fn(f[e>>2]|0);fn(c)}while((d|0)!=0)}d=a+20|0;c=f[d>>2]|0;f[d>>2]=0;if(c|0)fn(c);c=f[a+8>>2]|0;if(c|0){d=c;do{c=d;d=f[d>>2]|0;e=c+8|0;h=f[c+20>>2]|0;if(h|0){g=c+24|0;if((f[g>>2]|0)!=(h|0))f[g>>2]=h;fn(h)}if((b[e+11>>0]|0)<0)fn(f[e>>2]|0);fn(c)}while((d|0)!=0)}d=f[a>>2]|0;f[a>>2]=0;if(!d)return;fn(d);return}function Ef(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;a=u;u=u+32|0;e=a;g=a+8|0;p[e>>3]=0.0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;h=gg(d)|0;if(h>>>0>4294967279)ym(g);if(h>>>0<11){b[g+11>>0]=h;if(!h)i=g;else{j=g;k=6}}else{l=h+16&-16;m=dj(l)|0;f[g>>2]=m;f[g+8>>2]=l|-2147483648;f[g+4>>2]=h;j=m;k=6}if((k|0)==6){ee(j|0,d|0,h|0)|0;i=j}b[i+h>>0]=0;h=De(c,g,e)|0;if((b[g+11>>0]|0)>=0){u=a;return h|0}fn(f[g>>2]|0);u=a;return h|0}function Ff(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;a=u;u=u+16|0;e=a+12|0;g=a;f[e>>2]=0;f[g>>2]=0;f[g+4>>2]=0;f[g+8>>2]=0;h=gg(d)|0;if(h>>>0>4294967279)ym(g);if(h>>>0<11){b[g+11>>0]=h;if(!h)i=g;else{j=g;k=6}}else{l=h+16&-16;m=dj(l)|0;f[g>>2]=m;f[g+8>>2]=l|-2147483648;f[g+4>>2]=h;j=m;k=6}if((k|0)==6){ee(j|0,d|0,h|0)|0;i=j}b[i+h>>0]=0;h=dg(c,g,e)|0;if((b[g+11>>0]|0)>=0){u=a;return h|0}fn(f[g>>2]|0);u=a;return h|0}function Gf(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=c+8|0;e=f[d+4>>2]|0;g=c+16|0;h=g;i=f[h>>2]|0;j=f[h+4>>2]|0;if(!((e|0)>(j|0)|((e|0)==(j|0)?(f[d>>2]|0)>>>0>i>>>0:0))){k=0;return k|0}d=b[(f[c>>2]|0)+i>>0]|0;e=Tj(i|0,j|0,1,0)|0;j=g;f[j>>2]=e;f[j+4>>2]=I;do if(d<<24>>24<0)if(Gf(a,c)|0){j=a;e=Qj(f[j>>2]|0,f[j+4>>2]|0,7)|0;j=I;g=a;f[g>>2]=e;f[g+4>>2]=j;l=e|d&127;m=j;break}else{k=0;return k|0}else{l=d&255;m=0}while(0);d=a;f[d>>2]=l;f[d+4>>2]=m;k=1;return k|0}function Hf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0;if(b>>>0>1431655765|(c|b|0)<0){d=0;return d|0}e=b*3|0;pd(a,e,2656);pd(a+12|0,e,2652);ug(a+24|0,c);c=a+76|0;e=f[c>>2]|0;b=a+80|0;g=f[b>>2]|0;if((g|0)!=(e|0))f[b>>2]=g+(~((g+-4-e|0)>>>2)<<2);f[c>>2]=0;f[b>>2]=0;f[a+84>>2]=0;if(e|0)fn(e);e=a+64|0;b=f[e>>2]|0;c=a+68|0;if((f[c>>2]|0)!=(b|0))f[c>>2]=b;f[e>>2]=0;f[c>>2]=0;f[a+72>>2]=0;if(!b){d=1;return d|0}fn(b);d=1;return d|0}function If(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0;e=u;u=u+48|0;g=e+4|0;h=e;if((d|0)!=1){f[a>>2]=0;u=e;return}d=f[b+12>>2]|0;i=f[b+4>>2]|0;b=g;j=b+36|0;do{f[b>>2]=0;b=b+4|0}while((b|0)<(j|0));Ie(h,c,d,i,g);i=f[g+24>>2]|0;if(i|0){d=g+28|0;g=f[d>>2]|0;if((g|0)!=(i|0))f[d>>2]=g+(~((g+-4-i|0)>>>2)<<2);fn(i)}f[a>>2]=f[h>>2];u=e;return}function Jf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;e=u;u=u+16|0;g=e;if(c|0){h=a+11|0;i=b[h>>0]|0;if(i<<24>>24<0){j=f[a+4>>2]|0;k=(f[a+8>>2]&2147483647)+-1|0}else{j=i&255;k=10}l=j+c|0;if((k-j|0)>>>0>>0){_f(a,k,l-k|0,j,j,0,0);m=b[h>>0]|0}else m=i;if(m<<24>>24<0)n=f[a>>2]|0;else n=a;Oj(n+j|0,c,d)|0;if((b[h>>0]|0)<0)f[a+4>>2]=l;else b[h>>0]=l;b[g>>0]=0;Vl(n+l|0,g)}u=e;return a|0}function Kf(a,b){a=a|0;b=b|0;var c=0,d=0;c=a+16|0;a=f[b>>2]|0;f[b>>2]=0;b=f[c>>2]|0;f[c>>2]=a;if(!b)return;a=b+88|0;c=f[a>>2]|0;f[a>>2]=0;if(c|0){a=f[c+8>>2]|0;if(a|0){d=c+12|0;if((f[d>>2]|0)!=(a|0))f[d>>2]=a;fn(a)}fn(c)}c=f[b+68>>2]|0;if(c|0){a=b+72|0;d=f[a>>2]|0;if((d|0)!=(c|0))f[a>>2]=d+(~((d+-4-c|0)>>>2)<<2);fn(c)}c=b+64|0;d=f[c>>2]|0;f[c>>2]=0;if(d|0){c=f[d>>2]|0;if(c|0){a=d+4|0;if((f[a>>2]|0)!=(c|0))f[a>>2]=c;fn(c)}fn(d)}fn(b);return}function Lf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0;c=a+4|0;if((La[f[(f[b>>2]|0)+20>>2]&127](b)|0)<=0){d=1;return d|0}a=0;while(1){e=f[(f[c>>2]|0)+4>>2]|0;g=oi(e,Ma[f[(f[b>>2]|0)+24>>2]&127](b,a)|0)|0;if((g|0)==-1){d=0;h=7;break}e=wh(f[c>>2]|0,g)|0;if(!e){d=0;h=7;break}a=a+1|0;if(!(Ma[f[(f[b>>2]|0)+28>>2]&127](b,e)|0)){d=0;h=7;break}if((a|0)>=(La[f[(f[b>>2]|0)+20>>2]&127](b)|0)){d=1;h=7;break}}if((h|0)==7)return d|0;return 0}function Mf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;e=u;u=u+16|0;g=e;h=a+11|0;i=b[h>>0]|0;j=i<<24>>24<0;if(j)k=(f[a+8>>2]&2147483647)+-1|0;else k=10;do if(k>>>0>=d>>>0){if(j)l=f[a>>2]|0;else l=a;Ok(l,c,d)|0;b[g>>0]=0;Vl(l+d|0,g);if((b[h>>0]|0)<0){f[a+4>>2]=d;break}else{b[h>>0]=d;break}}else{if(j)m=f[a+4>>2]|0;else m=i&255;ff(a,k,d-k|0,m,0,m,d,c)}while(0);u=e;return a|0}function Nf(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0;f[a>>2]=2236;b=a+48|0;c=f[b>>2]|0;f[b>>2]=0;if(c|0)Qa[f[(f[c>>2]|0)+4>>2]&127](c);f[a>>2]=2616;c=f[a+20>>2]|0;if(c|0){b=a+24|0;d=f[b>>2]|0;if((d|0)!=(c|0))f[b>>2]=d+(~((d+-4-c|0)>>>2)<<2);fn(c)}c=a+8|0;d=f[c>>2]|0;if(!d){fn(a);return}b=a+12|0;e=f[b>>2]|0;if((e|0)==(d|0))g=d;else{h=e;do{e=h+-4|0;f[b>>2]=e;i=f[e>>2]|0;f[e>>2]=0;if(i|0)Qa[f[(f[i>>2]|0)+4>>2]&127](i);h=f[b>>2]|0}while((h|0)!=(d|0));g=f[c>>2]|0}fn(g);fn(a);return}function Of(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0;d=f[a>>2]|0;if(!d){e=0;return e|0}g=f[c>>2]|0;if(!g){e=0;return e|0}h=f[g>>2]|0;Yf(d,h,(f[g+4>>2]|0)-h|0,0)|0;b[a+24>>0]=b[c+24>>0]|0;f[a+28>>2]=f[c+28>>2];b[a+32>>0]=b[c+32>>0]|0;h=c+40|0;g=f[h+4>>2]|0;d=a+40|0;f[d>>2]=f[h>>2];f[d+4>>2]=g;g=c+48|0;d=f[g+4>>2]|0;h=a+48|0;f[h>>2]=f[g>>2];f[h+4>>2]=d;f[a+56>>2]=f[c+56>>2];d=c+8|0;c=a+8|0;f[c>>2]=f[d>>2];f[c+4>>2]=f[d+4>>2];f[c+8>>2]=f[d+8>>2];f[c+12>>2]=f[d+12>>2];e=1;return e|0}function Pf(a,c,d,e,g){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;b[c+53>>0]=1;do if((f[c+4>>2]|0)==(e|0)){b[c+52>>0]=1;a=c+16|0;h=f[a>>2]|0;i=c+54|0;j=c+48|0;k=c+24|0;l=c+36|0;if(!h){f[a>>2]=d;f[k>>2]=g;f[l>>2]=1;if(!((f[j>>2]|0)==1&(g|0)==1))break;b[i>>0]=1;break}if((h|0)!=(d|0)){f[l>>2]=(f[l>>2]|0)+1;b[i>>0]=1;break}l=f[k>>2]|0;if((l|0)==2){f[k>>2]=g;m=g}else m=l;if((f[j>>2]|0)==1&(m|0)==1)b[i>>0]=1}while(0);return}function Qf(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0;f[a>>2]=2236;b=a+48|0;c=f[b>>2]|0;f[b>>2]=0;if(c|0)Qa[f[(f[c>>2]|0)+4>>2]&127](c);f[a>>2]=2616;c=f[a+20>>2]|0;if(c|0){b=a+24|0;d=f[b>>2]|0;if((d|0)!=(c|0))f[b>>2]=d+(~((d+-4-c|0)>>>2)<<2);fn(c)}c=a+8|0;d=f[c>>2]|0;if(!d)return;b=a+12|0;a=f[b>>2]|0;if((a|0)==(d|0))e=d;else{g=a;do{a=g+-4|0;f[b>>2]=a;h=f[a>>2]|0;f[a>>2]=0;if(h|0)Qa[f[(f[h>>2]|0)+4>>2]&127](h);g=f[b>>2]|0}while((g|0)!=(d|0));e=f[c>>2]|0}fn(e);return}function Rf(a,c,d,e){a=a|0;c=c|0;d=d|0;e=e|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0;if(!a){g=1;return g|0}h=d+8|0;i=f[h+4>>2]|0;j=d+16|0;k=j;l=f[k>>2]|0;m=f[k+4>>2]|0;if(!((i|0)>(m|0)|((i|0)==(m|0)?(f[h>>2]|0)>>>0>l>>>0:0))){g=0;return g|0}h=b[(f[d>>2]|0)+l>>0]|0;i=Tj(l|0,m|0,1,0)|0;m=j;f[m>>2]=i;f[m+4>>2]=I;switch(h<<24>>24){case 0:{g=$b(a,c,d,e)|0;return g|0}case 1:{g=vc(a,d,e)|0;return g|0}default:{g=0;return g|0}}return 0}function Sf(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0;d=u;u=u+16|0;e=d;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;if((b[c+11>>0]|0)<0){g=f[c>>2]|0;h=f[c+4>>2]|0;if(h>>>0>4294967279)ym(a);if(h>>>0<11){b[a+11>>0]=h;i=a}else{j=h+16&-16;k=dj(j)|0;f[a>>2]=k;f[a+8>>2]=j|-2147483648;f[a+4>>2]=h;i=k}Qk(i,g,h)|0;b[e>>0]=0;Vl(i+h|0,e)}else{f[a>>2]=f[c>>2];f[a+4>>2]=f[c+4>>2];f[a+8>>2]=f[c+8>>2]}u=d;return}function Tf(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0;d=Rb(a,b)|0;if(!d){e=0;return e|0}b=d+20|0;a=f[b>>2]|0;g=d+24|0;d=f[g>>2]|0;if((a|0)==(d|0)){e=0;return e|0}ig(c,d-a|0,0);a=Lh(c,0)|0;c=f[b>>2]|0;ee(a|0,c|0,(f[g>>2]|0)-c|0)|0;e=1;return e|0}function Uf(a,c,d,e,g){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0;do if(!(Dl(a,f[c+8>>2]|0,g)|0)){if(Dl(a,f[c>>2]|0,g)|0){h=c+32|0;if((f[c+16>>2]|0)!=(d|0)?(i=c+20|0,(f[i>>2]|0)!=(d|0)):0){f[h>>2]=e;f[i>>2]=d;i=c+40|0;f[i>>2]=(f[i>>2]|0)+1;if((f[c+36>>2]|0)==1?(f[c+24>>2]|0)==2:0)b[c+54>>0]=1;f[c+44>>2]=4;break}if((e|0)==1)f[h>>2]=1}}else Wi(0,c,d,e);while(0);return}function Vf(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0;e=a+d|0;c=c&255;if((d|0)>=67){while(a&3){b[a>>0]=c;a=a+1|0}g=e&-4|0;h=g-64|0;i=c|c<<8|c<<16|c<<24;while((a|0)<=(h|0)){f[a>>2]=i;f[a+4>>2]=i;f[a+8>>2]=i;f[a+12>>2]=i;f[a+16>>2]=i;f[a+20>>2]=i;f[a+24>>2]=i;f[a+28>>2]=i;f[a+32>>2]=i;f[a+36>>2]=i;f[a+40>>2]=i;f[a+44>>2]=i;f[a+48>>2]=i;f[a+52>>2]=i;f[a+56>>2]=i;f[a+60>>2]=i;a=a+64|0}while((a|0)<(g|0)){f[a>>2]=i;a=a+4|0}}while((a|0)<(e|0)){b[a>>0]=c;a=a+1|0}return e-d|0}function Wf(a,b){a=a|0;b=b|0;var c=0;switch(f[(f[a+8>>2]|0)+28>>2]|0){case 2:{Te(a,b);c=1;return c|0}case 1:{Te(a,b);c=1;return c|0}case 4:{Ke(a,b);c=1;return c|0}case 3:{Ke(a,b);c=1;return c|0}case 6:{Le(a,b);c=1;return c|0}case 5:{Le(a,b);c=1;return c|0}default:{c=0;return c|0}}return 0}function Xf(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0;d=u;u=u+16|0;e=d;f[a>>2]=c;f[a+68>>2]=0;f[a+72>>2]=0;Yc(e,c);g=a+4|0;h=f[e>>2]|0;f[e>>2]=0;i=f[g>>2]|0;f[g>>2]=h;if(i){of(i);fn(i);i=f[e>>2]|0;f[e>>2]=0;if(i|0){of(i);fn(i)}}else f[e>>2]=0;if(!(f[g>>2]|0)){j=0;u=d;return j|0}g=((f[c+100>>2]|0)-(f[c+96>>2]|0)|0)/12|0;b[e>>0]=0;ge(a+56|0,g,e);j=1;u=d;return j|0}function Yf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0;if((d|0)<0){e=0;return e|0}do if(!b){d=a+4|0;g=f[d>>2]|0;h=f[a>>2]|0;i=g-h|0;if(c>>>0>i>>>0){kf(a,c-i|0);break}if(c>>>0>>0?(i=h+c|0,(g|0)!=(i|0)):0)f[d>>2]=i}else Id(a,b,b+c|0);while(0);c=a+24|0;a=c;b=Tj(f[a>>2]|0,f[a+4>>2]|0,1,0)|0;a=c;f[a>>2]=b;f[a+4>>2]=I;e=1;return e|0}function Zf(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=1040;b=a+16|0;a=f[b>>2]|0;f[b>>2]=0;if(!a)return;b=a+88|0;c=f[b>>2]|0;f[b>>2]=0;if(c|0){b=f[c+8>>2]|0;if(b|0){d=c+12|0;if((f[d>>2]|0)!=(b|0))f[d>>2]=b;fn(b)}fn(c)}c=f[a+68>>2]|0;if(c|0){b=a+72|0;d=f[b>>2]|0;if((d|0)!=(c|0))f[b>>2]=d+(~((d+-4-c|0)>>>2)<<2);fn(c)}c=a+64|0;d=f[c>>2]|0;f[c>>2]=0;if(d|0){c=f[d>>2]|0;if(c|0){b=d+4|0;if((f[b>>2]|0)!=(c|0))f[b>>2]=c;fn(c)}fn(d)}fn(a);return}function _f(a,c,d,e,g,h,i){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0;if((-17-c|0)>>>0>>0)ym(a);if((b[a+11>>0]|0)<0)j=f[a>>2]|0;else j=a;if(c>>>0<2147483623){k=d+c|0;d=c<<1;l=k>>>0>>0?d:k;m=l>>>0<11?11:l+16&-16}else m=-17;l=dj(m)|0;if(g|0)Qk(l,j,g)|0;k=e-h-g|0;if(k|0)Qk(l+g+i|0,j+g+h|0,k)|0;if((c|0)!=10)fn(j);f[a>>2]=l;f[a+8>>2]=m|-2147483648;return}function $f(a,b){a=a|0;b=b|0;if(!b)return;else{$f(a,f[b>>2]|0);$f(a,f[b+4>>2]|0);fg(b+20|0,f[b+24>>2]|0);fn(b);return}}function ag(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0;d=a+64|0;if((f[d>>2]|0)==0?(e=dj(32)|0,tj(e),g=f[d>>2]|0,f[d>>2]=e,g|0):0){e=f[g>>2]|0;if(e|0){h=g+4|0;if((f[h>>2]|0)!=(e|0))f[h>>2]=e;fn(e)}fn(g)}g=di(f[a+28>>2]|0)|0;e=X(b[a+24>>0]|0,g)|0;g=((e|0)<0)<<31>>31;h=f[d>>2]|0;i=lj(e|0,g|0,c|0,0)|0;if(!(Yf(h,0,i,I)|0)){j=0;return j|0}Wg(a,f[d>>2]|0,e,g,0,0);f[a+80>>2]=c;j=1;return j|0}function bg(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0;e=u;u=u+32|0;g=e+20|0;h=e+16|0;i=e;j=b[a+24>>0]|0;f[i>>2]=f[226];f[i+4>>2]=f[227];f[i+8>>2]=f[228];f[i+12>>2]=f[229];f[h>>2]=c;f[g>>2]=f[h>>2];if(!(_a(a,g,j,i)|0)){k=0;u=e;return k|0}od(d,i,i+(j<<24>>24<<2)|0);k=1;u=e;return k|0}function cg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0;d=u;u=u+64|0;e=d;if(!(Dl(a,b,0)|0))if((b|0)!=0?(g=Be(b,800,784,0)|0,(g|0)!=0):0){b=e+4|0;h=b+52|0;do{f[b>>2]=0;b=b+4|0}while((b|0)<(h|0));f[e>>2]=g;f[e+8>>2]=a;f[e+12>>2]=-1;f[e+48>>2]=1;Ta[f[(f[g>>2]|0)+28>>2]&7](g,e,f[c>>2]|0,1);if((f[e+24>>2]|0)==1){f[c>>2]=f[e+16>>2];i=1}else i=0;j=i}else j=0;else j=1;u=d;return j|0}function dg(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0;e=Rb(a,c)|0;if(!e){g=0;return g|0}c=f[e+20>>2]|0;if(((f[e+24>>2]|0)-c|0)!=4){g=0;return g|0}e=c;c=h[e>>0]|h[e+1>>0]<<8|h[e+2>>0]<<16|h[e+3>>0]<<24;b[d>>0]=c;b[d+1>>0]=c>>8;b[d+2>>0]=c>>16;b[d+3>>0]=c>>24;g=1;return g|0}function eg(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;d=c+8|0;e=f[d+4>>2]|0;g=c+16|0;h=g;i=f[h>>2]|0;j=f[h+4>>2]|0;if(!((e|0)>(j|0)|((e|0)==(j|0)?(f[d>>2]|0)>>>0>i>>>0:0))){k=0;return k|0}d=b[(f[c>>2]|0)+i>>0]|0;e=Tj(i|0,j|0,1,0)|0;j=g;f[j>>2]=e;f[j+4>>2]=I;j=d&255;do if(j&128)if(eg(a,c)|0){e=f[a>>2]<<7;f[a>>2]=e;l=e|d&127;break}else{k=0;return k|0}else l=j;while(0);f[a>>2]=l;k=1;return k|0}function fg(a,c){a=a|0;c=c|0;var d=0;if(!c)return;fg(a,f[c>>2]|0);fg(a,f[c+4>>2]|0);a=c+16|0;d=c+28|0;if((b[d+11>>0]|0)<0)fn(f[d>>2]|0);if((b[a+11>>0]|0)<0)fn(f[a>>2]|0);fn(c);return}function gg(a){a=a|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0,l=0;c=a;a:do if(!(c&3)){d=a;e=4}else{g=c;h=a;while(1){if(!(b[h>>0]|0)){i=g;break a}j=h+1|0;g=j;if(!(g&3)){d=j;e=4;break}else h=j}}while(0);if((e|0)==4){e=d;while(1){k=f[e>>2]|0;if(!((k&-2139062144^-2139062144)&k+-16843009))e=e+4|0;else break}if(!((k&255)<<24>>24))l=e;else{k=e;while(1){e=k+1|0;if(!(b[e>>0]|0)){l=e;break}else k=e}}i=l}return i-c|0}function hg(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0,i=0;f[a>>2]=2616;b=f[a+20>>2]|0;if(b|0){c=a+24|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=a+8|0;d=f[b>>2]|0;if(!d){fn(a);return}c=a+12|0;e=f[c>>2]|0;if((e|0)==(d|0))g=d;else{h=e;do{e=h+-4|0;f[c>>2]=e;i=f[e>>2]|0;f[e>>2]=0;if(i|0)Qa[f[(f[i>>2]|0)+4>>2]&127](i);h=f[c>>2]|0}while((h|0)!=(d|0));g=f[b>>2]|0}fn(g);fn(a);return}function ig(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0;e=u;u=u+16|0;g=e;h=a+11|0;i=b[h>>0]|0;j=i<<24>>24<0;if(j)k=f[a+4>>2]|0;else k=i&255;do if(k>>>0>=c>>>0)if(j){i=(f[a>>2]|0)+c|0;b[g>>0]=0;Vl(i,g);f[a+4>>2]=c;break}else{b[g>>0]=0;Vl(a+c|0,g);b[h>>0]=c;break}else Jf(a,c-k|0,d)|0;while(0);u=e;return}function jg(a){a=a|0;var b=0,c=0,d=0;if(!a)return;b=a+88|0;c=f[b>>2]|0;f[b>>2]=0;if(c|0){b=f[c+8>>2]|0;if(b|0){d=c+12|0;if((f[d>>2]|0)!=(b|0))f[d>>2]=b;fn(b)}fn(c)}c=f[a+68>>2]|0;if(c|0){b=a+72|0;d=f[b>>2]|0;if((d|0)!=(c|0))f[b>>2]=d+(~((d+-4-c|0)>>>2)<<2);fn(c)}c=a+64|0;d=f[c>>2]|0;f[c>>2]=0;if(d|0){c=f[d>>2]|0;if(c|0){b=d+4|0;if((f[b>>2]|0)!=(c|0))f[b>>2]=c;fn(c)}fn(d)}fn(a);return}function kg(a,c,d,e,g,h,i,j,k,l){a=a|0;c=c|0;d=d|0;e=e|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0;f[a>>2]=d;if(d|0){m=d+16|0;n=f[m+4>>2]|0;o=a+8|0;f[o>>2]=f[m>>2];f[o+4>>2]=n;n=d+24|0;d=f[n+4>>2]|0;o=a+16|0;f[o>>2]=f[n>>2];f[o+4>>2]=d}b[a+24>>0]=e;f[a+28>>2]=g;b[a+32>>0]=h&1;h=a+40|0;f[h>>2]=i;f[h+4>>2]=j;j=a+48|0;f[j>>2]=k;f[j+4>>2]=l;f[a+56>>2]=c;return}function lg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0;c=dj(88)|0;d=c+60|0;e=c;g=e+60|0;do{f[e>>2]=0;e=e+4|0}while((e|0)<(g|0));f[d>>2]=c;d=c+64|0;f[d>>2]=0;f[d+4>>2]=0;f[d+8>>2]=0;f[d+12>>2]=0;f[d+16>>2]=0;f[d+20>>2]=0;d=ud(c,b)|0;f[a>>2]=d?c:0;a=d?0:c;if(d)return;of(a);fn(a);return}function mg(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0;d=u;u=u+16|0;e=d;g=c&255;b[e>>0]=g;i=a+16|0;j=f[i>>2]|0;if(!j)if(!(Ih(a)|0)){k=f[i>>2]|0;l=4}else m=-1;else{k=j;l=4}do if((l|0)==4){j=a+20|0;i=f[j>>2]|0;if(i>>>0>>0?(n=c&255,(n|0)!=(b[a+75>>0]|0)):0){f[j>>2]=i+1;b[i>>0]=g;m=n;break}if((Na[f[a+36>>2]&31](a,e,1)|0)==1)m=h[e>>0]|0;else m=-1}while(0);u=d;return m|0}function ng(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0;d=u;u=u+16|0;e=d;g=d+4|0;f[e>>2]=c;c=dj(32)|0;f[g>>2]=c;f[g+8>>2]=-2147483616;f[g+4>>2]=24;h=c;i=8412;j=h+24|0;do{b[h>>0]=b[i>>0]|0;h=h+1|0;i=i+1|0}while((h|0)<(j|0));b[c+24>>0]=0;tg(Qb(a,e)|0,g,1);if((b[g+11>>0]|0)>=0){u=d;return}fn(f[g>>2]|0);u=d;return}function og(a){a=a|0;var c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;c=a;while(1){d=b[c>>0]|0;e=d<<24>>24;f=c+1|0;if(!(Am(e)|0))break;else c=f}switch(e|0){case 45:{g=1;h=5;break}case 43:{g=0;h=5;break}default:{i=d;j=0;k=c}}if((h|0)==5){i=b[f>>0]|0;j=g;k=f}f=(i<<24>>24)+-48|0;if(f>>>0<10){i=f;f=0;g=k;while(1){g=g+1|0;k=(f*10|0)-i|0;i=(b[g>>0]|0)+-48|0;if(i>>>0>=10){l=k;break}else f=k}}else l=0;return (j|0?l:0-l|0)|0}function pg(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,h=0;f[a>>2]=2616;b=f[a+20>>2]|0;if(b|0){c=a+24|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=a+8|0;d=f[b>>2]|0;if(!d)return;c=a+12|0;a=f[c>>2]|0;if((a|0)==(d|0))e=d;else{g=a;do{a=g+-4|0;f[c>>2]=a;h=f[a>>2]|0;f[a>>2]=0;if(h|0)Qa[f[(f[h>>2]|0)+4>>2]&127](h);g=f[c>>2]|0}while((g|0)!=(d|0));e=f[b>>2]|0}fn(e);return}function qg(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=2296;b=a+84|0;c=a+4|0;d=c+80|0;do{f[c>>2]=0;c=c+4|0}while((c|0)<(d|0));f[b>>2]=-1;f[a+88>>2]=-1;f[a+92>>2]=-1;b=a+152|0;c=a+96|0;d=c+56|0;do{f[c>>2]=0;c=c+4|0}while((c|0)<(d|0));n[b>>2]=$(1.0);b=a+212|0;c=a+156|0;d=c+56|0;do{f[c>>2]=0;c=c+4|0}while((c|0)<(d|0));f[b>>2]=-1;f[a+216>>2]=0;f[a+220>>2]=0;f[a+224>>2]=0;Ji(a+232|0);return}function rg(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0,i=0,j=0,k=0;d=a&255;e=a&255;if((f[c+76>>2]|0)>=0?(mn(c)|0)!=0:0){if((e|0)!=(b[c+75>>0]|0)?(g=c+20|0,h=f[g>>2]|0,h>>>0<(f[c+16>>2]|0)>>>0):0){f[g>>2]=h+1;b[h>>0]=d;i=e}else i=mg(c,a)|0;ln(c);j=i}else k=3;do if((k|0)==3){if((e|0)!=(b[c+75>>0]|0)?(i=c+20|0,h=f[i>>2]|0,h>>>0<(f[c+16>>2]|0)>>>0):0){f[i>>2]=h+1;b[h>>0]=d;j=e;break}j=mg(c,a)|0}while(0);return j|0}function sg(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;if(c>>>0>0|(c|0)==0&a>>>0>4294967295){e=a;f=c;c=d;while(1){g=bj(e|0,f|0,10,0)|0;c=c+-1|0;b[c>>0]=g&255|48;g=e;e=Jl(e|0,f|0,10,0)|0;if(!(f>>>0>9|(f|0)==9&g>>>0>4294967295))break;else f=I}h=c;i=e}else{h=d;i=a}if(!i)j=h;else{a=h;h=i;while(1){i=a+-1|0;b[i>>0]=(h>>>0)%10|0|48;if(h>>>0<10){j=i;break}else{a=i;h=(h>>>0)/10|0}}}return j|0}function tg(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0;e=u;u=u+16|0;g=e;zh(g,d&1);d=ef(a,c)|0;c=d+11|0;if((b[c>>0]|0)<0){b[f[d>>2]>>0]=0;f[d+4>>2]=0}else{b[d>>0]=0;b[c>>0]=0}le(d,0);f[d>>2]=f[g>>2];f[d+4>>2]=f[g+4>>2];f[d+8>>2]=f[g+8>>2];u=e;return}function ug(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0,j=0,k=0;c=a+8|0;d=f[a>>2]|0;if((f[c>>2]|0)-d>>2>>>0>=b>>>0)return;e=a+4|0;if(b>>>0>1073741823){g=ra(8)|0;$k(g,9793);f[g>>2]=3708;va(g|0,856,80)}g=(f[e>>2]|0)-d|0;h=g>>2;i=dj(b<<2)|0;j=i+(h<<2)|0;k=j+(0-h<<2)|0;if((g|0)>0)ee(k|0,d|0,g|0)|0;f[a>>2]=k;f[e>>2]=j;f[c>>2]=i+(b<<2);if(!d)return;fn(d);return}function vg(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=1628;b=f[a+96>>2]|0;if(b|0)fn(b);b=f[a+84>>2]|0;if(b|0)fn(b);b=f[a+72>>2]|0;if(b|0)fn(b);b=f[a+60>>2]|0;if(b|0)fn(b);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b){fn(a);return}c=a+36|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b);fn(a);return}function wg(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0,j=0,k=0;e=Td(a,c)|0;if((e|0)==(a+4|0)){g=-1;h=(g|0)==-1;i=(g|0)!=0;j=h?d:i;return j|0}a=e+28|0;if((b[a+11>>0]|0)<0)k=f[a>>2]|0;else k=a;g=og(k)|0;h=(g|0)==-1;i=(g|0)!=0;j=h?d:i;return j|0}function xg(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=1376;b=f[a+96>>2]|0;if(b|0)fn(b);b=f[a+84>>2]|0;if(b|0)fn(b);b=f[a+72>>2]|0;if(b|0)fn(b);b=f[a+60>>2]|0;if(b|0)fn(b);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b){fn(a);return}c=a+36|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b);fn(a);return}function yg(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0,j=0,k=0;d=0;while(1){if((h[10416+d>>0]|0)==(a|0)){e=2;break}g=d+1|0;if((g|0)==87){i=87;j=10504;e=5;break}else d=g}if((e|0)==2)if(!d)k=10504;else{i=d;j=10504;e=5}if((e|0)==5)while(1){e=0;d=j;do{a=d;d=d+1|0}while((b[a>>0]|0)!=0);i=i+-1|0;if(!i){k=d;break}else{j=d;e=5}}return Fm(k,f[c+20>>2]|0)|0}function zg(a,b){a=+a;b=b|0;var c=0,d=0,e=0,g=0.0,h=0,i=0.0,j=0.0;p[s>>3]=a;c=f[s>>2]|0;d=f[s+4>>2]|0;e=Wj(c|0,d|0,52)|0;switch(e&2047){case 0:{if(a!=0.0){g=+zg(a*18446744073709551616.0,b);h=(f[b>>2]|0)+-64|0;i=g}else{h=0;i=a}f[b>>2]=h;j=i;break}case 2047:{j=a;break}default:{f[b>>2]=(e&2047)+-1022;f[s>>2]=c;f[s+4>>2]=d&-2146435073|1071644672;j=+p[s>>3]}}return +j}function Ag(a,c,d,e){a=a|0;c=c|0;d=d|0;e=e|0;var g=0,h=0,i=0;e=u;u=u+16|0;d=e;c=dj(32)|0;f[d>>2]=c;f[d+8>>2]=-2147483616;f[d+4>>2]=26;g=c;h=8364;i=g+26|0;do{b[g>>0]=b[h>>0]|0;g=g+1|0;h=h+1|0}while((g|0)<(i|0));b[c+26>>0]=0;f[a>>2]=-1;Sf(a+4|0,d);if((b[d+11>>0]|0)>=0){u=e;return}fn(f[d>>2]|0);u=e;return}function Bg(a){a=a|0;var b=0,c=0;f[a>>2]=1628;b=f[a+96>>2]|0;if(b|0)fn(b);b=f[a+84>>2]|0;if(b|0)fn(b);b=f[a+72>>2]|0;if(b|0)fn(b);b=f[a+60>>2]|0;if(b|0)fn(b);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b)return;c=a+36|0;a=f[c>>2]|0;if((a|0)!=(b|0))f[c>>2]=a+(~((a+-4-b|0)>>>2)<<2);fn(b);return}function Cg(a){a=a|0;var b=0,c=0;f[a>>2]=1376;b=f[a+96>>2]|0;if(b|0)fn(b);b=f[a+84>>2]|0;if(b|0)fn(b);b=f[a+72>>2]|0;if(b|0)fn(b);b=f[a+60>>2]|0;if(b|0)fn(b);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b)return;c=a+36|0;a=f[c>>2]|0;if((a|0)!=(b|0))f[c>>2]=a+(~((a+-4-b|0)>>>2)<<2);fn(b);return}function Dg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0;f[a>>2]=0;c=a+4|0;f[c>>2]=0;f[a+8>>2]=0;d=b+4|0;e=(f[d>>2]|0)-(f[b>>2]|0)|0;g=e>>2;if(!g)return;if(g>>>0>1073741823)ym(a);h=dj(e)|0;f[c>>2]=h;f[a>>2]=h;f[a+8>>2]=h+(g<<2);g=f[b>>2]|0;b=(f[d>>2]|0)-g|0;if((b|0)<=0)return;ee(h|0,g|0,b|0)|0;f[c>>2]=h+(b>>>2<<2);return}function Eg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0;a=f[b+4>>2]|0;if(!a){d=0;return d|0}e=f[(f[(f[b+8>>2]|0)+(c<<2)>>2]|0)+60>>2]|0;c=f[a+40>>2]|0;b=f[a+44>>2]|0;if((c|0)==(b|0)){d=0;return d|0}else g=c;while(1){c=f[g>>2]|0;g=g+4|0;if((f[c+40>>2]|0)==(e|0)){d=c;h=5;break}if((g|0)==(b|0)){d=0;h=5;break}}if((h|0)==5)return d|0;return 0}function Fg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0;c=La[f[(f[a>>2]|0)+24>>2]&127](a)|0;if((c|0)<=0){d=1;return d|0}e=a+36|0;g=a+48|0;a=0;while(1){h=f[(f[e>>2]|0)+(a<<2)>>2]|0;a=a+1|0;if(!(Na[f[(f[h>>2]|0)+20>>2]&31](h,g,b)|0)){d=0;i=5;break}if((a|0)>=(c|0)){d=1;i=5;break}}if((i|0)==5)return d|0;return 0}function Gg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;switch(c<<24>>24){case 0:{c=dj(20)|0;fk(c);d=c;break}case 1:{c=dj(24)|0;Fk(c);d=c;break}case 2:{c=dj(36)|0;uj(c);d=c;break}case 3:{c=dj(28)|0;xk(c);d=c;break}default:d=0}f[a>>2]=d;return}function Hg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0,i=0;c=La[f[(f[a>>2]|0)+24>>2]&127](a)|0;if((c|0)<=0){d=1;return d|0}e=a+36|0;g=a+48|0;a=0;while(1){h=f[(f[e>>2]|0)+(a<<2)>>2]|0;a=a+1|0;if(!(Na[f[(f[h>>2]|0)+16>>2]&31](h,g,b)|0)){d=0;i=5;break}if((a|0)>=(c|0)){d=1;i=5;break}}if((i|0)==5)return d|0;return 0}function Ig(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0;c=f[b>>2]|0;if(!c){d=0;return d|0}e=a+44|0;g=f[e>>2]|0;if(g>>>0<(f[a+48>>2]|0)>>>0){f[b>>2]=0;f[g>>2]=c;f[e>>2]=(f[e>>2]|0)+4;d=1;return d|0}else{Yd(a+40|0,b);d=1;return d|0}return 0}function Jg(a){a=a|0;var b=0;if(!(f[a+44>>2]|0)){b=0;return b|0}if(!(f[a+48>>2]|0)){b=0;return b|0}if(!(f[a+24>>2]|0)){b=0;return b|0}if(!(f[a+28>>2]|0)){b=0;return b|0}if(!(f[a+32>>2]|0)){b=0;return b|0}if(!(f[a+36>>2]|0)){b=0;return b|0}b=(f[a+72>>2]|0)!=-1;return b|0}function Kg(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=2348;b=f[a+64>>2]|0;if(b|0){c=a+68|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}f[a+12>>2]=2372;b=f[a+32>>2]|0;if(b|0)fn(b);b=f[a+20>>2]|0;if(!b){fn(a);return}fn(b);fn(a);return}function Lg(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,i=0;f[c>>2]=2;d=a+4|0;a=c+8|0;e=f[a>>2]|0;g=(f[c+12>>2]|0)-e|0;if(g>>>0<4294967292){Yg(a,g+4|0,0);i=f[a>>2]|0}else i=e;e=i+g|0;g=h[d>>0]|h[d+1>>0]<<8|h[d+2>>0]<<16|h[d+3>>0]<<24;b[e>>0]=g;b[e+1>>0]=g>>8;b[e+2>>0]=g>>16;b[e+3>>0]=g>>24;return}function Mg(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=2440;b=f[a+64>>2]|0;if(b|0){c=a+68|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}f[a+12>>2]=2420;b=f[a+32>>2]|0;if(b|0)fn(b);b=f[a+20>>2]|0;if(!b){fn(a);return}fn(b);fn(a);return}function Ng(a){a=a|0;var b=0;if(!(f[a+64>>2]|0)){b=0;return b|0}if(!(f[a+68>>2]|0)){b=0;return b|0}if(!(f[a+44>>2]|0)){b=0;return b|0}if(!(f[a+48>>2]|0)){b=0;return b|0}if(!(f[a+52>>2]|0)){b=0;return b|0}if(!(f[a+56>>2]|0)){b=0;return b|0}b=(f[a+92>>2]|0)!=-1;return b|0}function Og(a){a=a|0;var c=0;if(!a)return;c=a+28|0;if((b[c+11>>0]|0)<0)fn(f[c>>2]|0);$f(a+12|0,f[a+16>>2]|0);fg(a,f[a+4>>2]|0);fn(a);return}function Pg(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=2348;b=f[a+64>>2]|0;if(b|0){c=a+68|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}f[a+12>>2]=2372;b=f[a+32>>2]|0;if(b|0)fn(b);b=f[a+20>>2]|0;if(!b)return;fn(b);return}function Qg(a){a=a|0;var c=0,d=0,e=0,g=0,h=0,i=0;if(!a)return;c=f[a>>2]|0;if(c|0){d=a+4|0;e=f[d>>2]|0;if((e|0)==(c|0))g=c;else{h=e;while(1){e=h+-12|0;f[d>>2]=e;if((b[e+11>>0]|0)<0){fn(f[e>>2]|0);i=f[d>>2]|0}else i=e;if((i|0)==(c|0))break;else h=i}g=f[a>>2]|0}fn(g)}fn(a);return}function Rg(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0;Eb(a,b);if((b|0)<=-1)return;c=a+88|0;d=f[c>>2]|0;e=f[a+84>>2]|0;if((d-e>>2|0)<=(b|0))return;a=e+(b<<2)|0;b=a+4|0;e=d-b|0;g=e>>2;if(!g)h=d;else{ui(a|0,b|0,e|0)|0;h=f[c>>2]|0}e=a+(g<<2)|0;if((h|0)==(e|0))return;f[c>>2]=h+(~((h+-4-e|0)>>>2)<<2);return}function Sg(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=2440;b=f[a+64>>2]|0;if(b|0){c=a+68|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}f[a+12>>2]=2420;b=f[a+32>>2]|0;if(b|0)fn(b);b=f[a+20>>2]|0;if(!b)return;fn(b);return}function Tg(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=2668;b=f[a+96>>2]|0;if(b|0){c=a+100|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~(((d+-12-b|0)>>>0)/12|0)*12|0);fn(b)}b=f[a+84>>2]|0;if(!b){Qd(a);fn(a);return}d=a+88|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b);Qd(a);fn(a);return}function Ug(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=b>>31|((b|0)<0?-1:0)<<1;f=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;g=d>>31|((d|0)<0?-1:0)<<1;h=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;i=Vj(e^a|0,f^b|0,e|0,f|0)|0;b=I;a=g^e;e=h^f;return Vj((ac(i,b,Vj(g^c|0,h^d|0,g|0,h|0)|0,I,0)|0)^a|0,I^e|0,a|0,e|0)|0}function Vg(a,c,d,e){a=a|0;c=c|0;d=d|0;e=e|0;var g=0,h=0,i=0;a=c+16|0;g=f[a>>2]|0;h=c+36|0;i=c+24|0;do if(g){if((g|0)!=(d|0)){f[h>>2]=(f[h>>2]|0)+1;f[i>>2]=2;b[c+54>>0]=1;break}if((f[i>>2]|0)==2)f[i>>2]=e}else{f[a>>2]=d;f[i>>2]=e;f[h>>2]=1}while(0);return}function Wg(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0,i=0,j=0;f[a>>2]=b;h=b+16|0;i=f[h+4>>2]|0;j=a+8|0;f[j>>2]=f[h>>2];f[j+4>>2]=i;i=b+24|0;b=f[i+4>>2]|0;j=a+16|0;f[j>>2]=f[i>>2];f[j+4>>2]=b;b=a+40|0;f[b>>2]=c;f[b+4>>2]=d;d=a+48|0;f[d>>2]=e;f[d+4>>2]=g;return}function Xg(a){a=a|0;var b=0,c=0,d=0,e=0,g=0,i=0,j=0;b=h[a+12>>0]|0;c=a+8|0;d=f[c>>2]|0;if(d>>>0<4096?(e=a+4|0,g=f[e>>2]|0,(g|0)>0):0){i=f[a>>2]|0;a=g+-1|0;f[e>>2]=a;e=h[i+a>>0]|0|d<<8;f[c>>2]=e;j=e}else j=d;d=j&255;e=0-b&255;b=X(j>>>8,e)|0;a=d>>>0>>0;f[c>>2]=a?b+d|0:j-e-b|0;return a|0}function Yg(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0;c=a+4|0;d=f[c>>2]|0;e=f[a>>2]|0;g=d-e|0;h=e;e=d;if(b>>>0<=g>>>0){if(b>>>0>>0?(d=h+b|0,(e|0)!=(d|0)):0)f[c>>2]=d}else kf(a,b-g|0);g=a+24|0;a=g;b=Tj(f[a>>2]|0,f[a+4>>2]|0,1,0)|0;a=g;f[a>>2]=b;f[a+4>>2]=I;return}function Zg(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0;e=u;u=u+16|0;g=e;Ag(g,a,c,d);d=a+24|0;f[d>>2]=f[g>>2];c=g+4|0;ki(a+28|0,c)|0;if((b[c+11>>0]|0)>=0){u=e;return d|0}fn(f[c>>2]|0);u=e;return d|0}function _g(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=2668;b=f[a+96>>2]|0;if(b|0){c=a+100|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~(((d+-12-b|0)>>>0)/12|0)*12|0);fn(b)}b=f[a+84>>2]|0;if(!b){Qd(a);return}d=a+88|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b);Qd(a);return}function $g(a){a=a|0;var c=0,d=0,e=0;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;f[a+12>>2]=0;f[a+16>>2]=0;f[a+20>>2]=0;b[a+24>>0]=1;c=a+68|0;d=a+28|0;e=d+40|0;do{f[d>>2]=0;d=d+4|0}while((d|0)<(e|0));f[c>>2]=a;c=a+72|0;f[c>>2]=0;f[c+4>>2]=0;f[c+8>>2]=0;f[c+12>>2]=0;f[c+16>>2]=0;f[c+20>>2]=0;return}function ah(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0;e=u;u=u+16|0;g=e;ed(g,a,c,d);d=a+24|0;f[d>>2]=f[g>>2];c=g+4|0;ki(a+28|0,c)|0;if((b[c+11>>0]|0)>=0){u=e;return d|0}fn(f[c>>2]|0);u=e;return d|0}function bh(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0,h=0,i=0;if(c?!(Gf(d,a)|0):0){e=0;return e|0}b[a+36>>0]=1;d=a+16|0;c=f[d>>2]|0;g=(f[a>>2]|0)+c|0;h=a+8|0;i=Vj(f[h>>2]|0,f[h+4>>2]|0,c|0,f[d+4>>2]|0)|0;f[a+32>>2]=0;f[a+24>>2]=g;f[a+28>>2]=g+i;e=1;return e|0}function ch(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=1684;b=f[a+76>>2]|0;if(b|0)fn(b);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b){fn(a);return}c=a+36|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b);fn(a);return}function dh(a){a=a|0;var b=0,c=0,d=0,e=0,g=0;b=f[a+8>>2]|0;c=f[a+12>>2]|0;if((b|0)==(c|0)){d=1;return d|0}e=a+32|0;a=b;while(1){b=f[a>>2]|0;a=a+4|0;if(!(Ma[f[(f[b>>2]|0)+16>>2]&127](b,f[e>>2]|0)|0)){d=0;g=5;break}if((a|0)==(c|0)){d=1;g=5;break}}if((g|0)==5)return d|0;return 0}function eh(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,g=0;e=f[a+8>>2]|0;if((b[e+24>>0]|0)<1){g=0;return g|0}if(!(ag(e,(f[c+4>>2]|0)-(f[c>>2]|0)>>2)|0)){g=0;return g|0}g=Na[f[(f[a>>2]|0)+32>>2]&31](a,c,d)|0;return g|0}function fh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=u;u=u+256|0;g=f;if((c|0)>(d|0)&(e&73728|0)==0){e=c-d|0;Vf(g|0,b|0,(e>>>0<256?e:256)|0)|0;if(e>>>0>255){b=c-d|0;d=e;do{ml(a,g,256);d=d+-256|0}while(d>>>0>255);h=b&255}else h=e;ml(a,g,h)}u=f;return}function gh(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=1432;b=f[a+76>>2]|0;if(b|0)fn(b);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b){fn(a);return}c=a+36|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b);fn(a);return}function hh(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;var h=0;if(Dl(a,f[b+8>>2]|0,g)|0)Pf(0,b,c,d,e);else{h=f[a+8>>2]|0;Va[f[(f[h>>2]|0)+20>>2]&3](h,b,c,d,e,g)}return}function ih(a,b){a=a|0;b=b|0;var c=0;c=dj(40)|0;f[c>>2]=-1;tj(c+8|0);Ra[f[(f[a>>2]|0)+16>>2]&7](a,c);a=b+88|0;b=f[a>>2]|0;f[a>>2]=c;if(!b)return 1;c=f[b+8>>2]|0;if(c|0){a=b+12|0;if((f[a>>2]|0)!=(c|0))f[a>>2]=c;fn(c)}fn(b);return 1}function jh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0;c=f[a+12>>2]|0;d=f[a+8>>2]|0;a=d;if((c|0)==(d|0)){e=0;return e|0}g=c-d>>2;d=0;while(1){c=f[a+(d<<2)>>2]|0;if((f[c+60>>2]|0)==(b|0)){e=c;h=5;break}d=d+1|0;if(d>>>0>=g>>>0){e=0;h=5;break}}if((h|0)==5)return e|0;return 0}function kh(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=984;b=f[a+16>>2]|0;if(b|0){c=a+20|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+4>>2]|0;if(!b){fn(a);return}d=a+8|0;c=f[d>>2]|0;if((c|0)!=(b|0))f[d>>2]=c+(~((c+-4-b|0)>>>2)<<2);fn(b);fn(a);return}function lh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,g=0,h=0;c=f[a+12>>2]|0;d=f[a+8>>2]|0;a=d;if((c|0)==(d|0)){e=-1;return e|0}g=c-d>>2;d=0;while(1){if((f[(f[a+(d<<2)>>2]|0)+60>>2]|0)==(b|0)){e=d;h=5;break}d=d+1|0;if(d>>>0>=g>>>0){e=-1;h=5;break}}if((h|0)==5)return e|0;return 0}function mh(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;a:do if(!d)e=0;else{f=a;g=d;h=c;while(1){i=b[f>>0]|0;j=b[h>>0]|0;if(i<<24>>24!=j<<24>>24)break;g=g+-1|0;if(!g){e=0;break a}else{f=f+1|0;h=h+1|0}}e=(i&255)-(j&255)|0}while(0);return e|0}function nh(a){a=a|0;var b=0,c=0;f[a>>2]=1684;b=f[a+76>>2]|0;if(b|0)fn(b);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b)return;c=a+36|0;a=f[c>>2]|0;if((a|0)!=(b|0))f[c>>2]=a+(~((a+-4-b|0)>>>2)<<2);fn(b);return}function oh(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=1740;ln(a+108|0);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b){fn(a);return}c=a+36|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b);fn(a);return}function ph(a){a=a|0;var b=0,c=0;f[a>>2]=2108;b=a+28|0;c=f[b>>2]|0;f[b>>2]=0;if(c|0)dn(c);f[a>>2]=1148;c=a+20|0;b=f[c>>2]|0;f[c>>2]=0;if(!b){Zf(a);fn(a);return}Qa[f[(f[b>>2]|0)+4>>2]&127](b);Zf(a);fn(a);return}function qh(a){a=a|0;var c=0,d=0;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;c=0;while(1){if((c|0)==3)break;f[a+(c<<2)>>2]=0;c=c+1|0}if((b[a+11>>0]|0)<0)d=(f[a+8>>2]&2147483647)+-1|0;else d=10;ig(a,d,0);return}function rh(a){a=a|0;var b=0,c=0;f[a>>2]=1432;b=f[a+76>>2]|0;if(b|0)fn(b);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b)return;c=a+36|0;a=f[c>>2]|0;if((a|0)!=(b|0))f[c>>2]=a+(~((a+-4-b|0)>>>2)<<2);fn(b);return}function sh(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=1488;ln(a+108|0);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b){fn(a);return}c=a+36|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b);fn(a);return}function th(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=984;b=f[a+16>>2]|0;if(b|0){c=a+20|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}b=f[a+4>>2]|0;if(!b)return;d=a+8|0;a=f[d>>2]|0;if((a|0)!=(b|0))f[d>>2]=a+(~((a+-4-b|0)>>>2)<<2);fn(b);return}function uh(a){a=a|0;var b=0,c=0;f[a>>2]=2108;b=a+28|0;c=f[b>>2]|0;f[b>>2]=0;if(c|0)dn(c);f[a>>2]=1148;c=a+20|0;b=f[c>>2]|0;f[c>>2]=0;if(!b){Zf(a);return}Qa[f[(f[b>>2]|0)+4>>2]&127](b);Zf(a);return}function vh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;if(Dl(a,f[b+8>>2]|0,0)|0)Vg(0,b,c,d);else{e=f[a+8>>2]|0;Ta[f[(f[e>>2]|0)+28>>2]&7](e,b,c,d)}return}function wh(a,b){a=a|0;b=b|0;var c=0,d=0;if((b|0)<0){c=0;return c|0}d=f[a+4>>2]|0;if(((f[d+12>>2]|0)-(f[d+8>>2]|0)>>2|0)<=(b|0)){c=0;return c|0}d=f[(f[a+8>>2]|0)+(f[(f[a+20>>2]|0)+(b<<2)>>2]<<2)>>2]|0;c=Ma[f[(f[d>>2]|0)+32>>2]&127](d,b)|0;return c|0}function xh(a,c){a=a|0;c=c|0;var d=0,e=0,f=0,g=0;d=b[a>>0]|0;e=b[c>>0]|0;if(d<<24>>24==0?1:d<<24>>24!=e<<24>>24){f=e;g=d}else{d=a;a=c;do{d=d+1|0;a=a+1|0;c=b[d>>0]|0;e=b[a>>0]|0}while(!(c<<24>>24==0?1:c<<24>>24!=e<<24>>24));f=e;g=c}return (g&255)-(f&255)|0}function yh(a){a=a|0;var b=0,c=0;f[a>>2]=1740;ln(a+108|0);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b)return;c=a+36|0;a=f[c>>2]|0;if((a|0)!=(b|0))f[c>>2]=a+(~((a+-4-b|0)>>>2)<<2);fn(b);return}function zh(a,b){a=a|0;b=b|0;var c=0,d=0;c=u;u=u+16|0;d=c;qh(d);qf(a,d,b);Kk(d);u=c;return}function Ah(a){a=a|0;var b=0,c=0;f[a>>2]=1488;ln(a+108|0);f[a>>2]=1208;b=f[a+32>>2]|0;if(!b)return;c=a+36|0;a=f[c>>2]|0;if((a|0)!=(b|0))f[c>>2]=a+(~((a+-4-b|0)>>>2)<<2);fn(b);return}function Bh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0,h=0;d=u;u=u+32|0;e=d;g=d+20|0;f[e>>2]=f[a+60>>2];f[e+4>>2]=0;f[e+8>>2]=b;f[e+12>>2]=g;f[e+16>>2]=c;if((kk(za(140,e|0)|0)|0)<0){f[g>>2]=-1;h=-1}else h=f[g>>2]|0;u=d;return h|0}function Ch(a,b){a=a|0;b=b|0;var c=0,d=0;if((b|0)==-1|(b|0)>4){c=0;return c|0}d=f[a+20+(b*12|0)>>2]|0;if(((f[a+20+(b*12|0)+4>>2]|0)-d|0)<=0){c=0;return c|0}b=f[d>>2]|0;if((b|0)==-1){c=0;return c|0}c=f[(f[a+8>>2]|0)+(b<<2)>>2]|0;return c|0}function Dh(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=f[a+16>>2]|0;if(((f[a+20>>2]|0)-c>>2|0)<=(b|0)){d=0;return d|0}e=f[c+(b<<2)>>2]|0;if((e|0)<0){d=0;return d|0}d=Je(f[(f[a+36>>2]|0)+(e<<2)>>2]|0)|0;return d|0}function Eh(a,b){a=a|0;b=b|0;var c=0;Mi(a);f[a>>2]=1088;c=a+36|0;f[c>>2]=0;f[c+4>>2]=0;f[c+8>>2]=0;f[c+12>>2]=0;f[c+16>>2]=0;f[c+20>>2]=0;c=f[b>>2]|0;f[b>>2]=0;f[a+60>>2]=c;return}function Fh(a){a=a|0;if(!(f[a+60>>2]|0))return 0;if(!(f[a+44>>2]|0))return 0;if(!(f[a+48>>2]|0))return 0;if(!(f[a+52>>2]|0))return 0;else return (f[a+56>>2]|0)!=0|0;return 0}function Gh(a,c){a=a|0;c=c|0;var d=0,e=0;d=a;e=c;c=d+64|0;do{f[d>>2]=f[e>>2];d=d+4|0;e=e+4|0}while((d|0)<(c|0));e=a+64|0;f[a+88>>2]=0;f[e>>2]=0;f[e+4>>2]=0;f[e+8>>2]=0;f[e+12>>2]=0;f[e+16>>2]=0;b[e+20>>0]=0;return}function Hh(a,c,d,e){a=a|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;if((a|0)==0&(c|0)==0)f=d;else{g=a;a=c;c=d;while(1){d=c+-1|0;b[d>>0]=h[10398+(g&15)>>0]|0|e;g=Wj(g|0,a|0,4)|0;a=I;if((g|0)==0&(a|0)==0){f=d;break}else c=d}}return f|0}function Ih(a){a=a|0;var c=0,d=0,e=0;c=a+74|0;d=b[c>>0]|0;b[c>>0]=d+255|d;d=f[a>>2]|0;if(!(d&8)){f[a+8>>2]=0;f[a+4>>2]=0;c=f[a+44>>2]|0;f[a+28>>2]=c;f[a+20>>2]=c;f[a+16>>2]=c+(f[a+48>>2]|0);e=0}else{f[a>>2]=d|32;e=-1}return e|0}function Jh(a,b){a=a|0;b=b|0;var c=0,d=0;c=f[b+88>>2]|0;if(!c){d=0;return d|0}if((f[c>>2]|0)!=2){d=0;return d|0}b=f[c+8>>2]|0;f[a+4>>2]=h[b>>0]|h[b+1>>0]<<8|h[b+2>>0]<<16|h[b+3>>0]<<24;d=1;return d|0}function Kh(a){a=a|0;var b=0;if(!(f[a+44>>2]|0)){b=0;return b|0}if(!(f[a+48>>2]|0)){b=0;return b|0}if(!(f[a+52>>2]|0)){b=0;return b|0}b=(f[a+56>>2]|0)!=0;return b|0}function Lh(a,c){a=a|0;c=c|0;var d=0,e=0,g=0,h=0;d=b[a+11>>0]|0;e=d<<24>>24<0;if(e)g=f[a+4>>2]|0;else g=d&255;if(g>>>0<=c>>>0)ym(a);if(e)h=f[a>>2]|0;else h=a;return h+c|0}function Mh(a,c){a=a|0;c=c|0;var d=0;if(f[c+56>>2]|0){d=0;return d|0}if((b[c+24>>0]|0)!=3){d=0;return d|0}f[a+44>>2]=c;d=1;return d|0}function Nh(a,b,c){a=a|0;b=b|0;c=c|0;if((b|0)!=0&(c|0)!=0){Fb(a,b,c);return}else{Jb(a,0,0);return}}function Oh(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=$(e);f[a+4>>2]=b;od(a+8|0,c,c+(d<<2)|0);n[a+20>>2]=e;return}function Ph(a,b){a=a|0;b=b|0;var c=0;if(!(Ma[f[(f[a>>2]|0)+36>>2]&127](a,b)|0)){c=0;return c|0}if(!(Ma[f[(f[a>>2]|0)+40>>2]&127](a,b)|0)){c=0;return c|0}c=La[f[(f[a>>2]|0)+44>>2]&127](a)|0;return c|0}function Qh(a){a=a|0;var b=0,c=0;a=a+15&-16|0;b=f[r>>2]|0;c=b+a|0;if((a|0)>0&(c|0)<(b|0)|(c|0)<0){ea()|0;ya(12);return -1}f[r>>2]=c;if((c|0)>(da()|0)?(ca()|0)==0:0){f[r>>2]=b;ya(12);return -1}return b|0}function Rh(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0;d=f[c>>2]|0;c=a;e=b-a>>2;while(1){if(!e)break;a=(e|0)/2|0;b=c+(a<<2)|0;g=(f[b>>2]|0)>>>0>>0;c=g?b+4|0:c;e=g?e+-1-a|0:a}return c|0}function Sh(a,c,d){a=a|0;c=c|0;d=d|0;var e=0;if(!(Aj(a,c,d)|0)){e=0;return e|0}d=f[a+8>>2]|0;if((b[d+24>>0]|0)!=3){e=0;return e|0}e=(f[d+28>>2]|0)==9;return e|0}function Th(a){a=a|0;var c=0,d=0,e=0,g=0,h=0;c=f[a>>2]|0;d=(b[c>>0]|0)+-48|0;if(d>>>0<10){e=c;c=0;g=d;while(1){d=g+(c*10|0)|0;e=e+1|0;f[a>>2]=e;g=(b[e>>0]|0)+-48|0;if(g>>>0>=10){h=d;break}else c=d}}else h=0;return h|0}function Uh(a){a=a|0;var c=0;f[a>>2]=0;c=a+8|0;f[c>>2]=0;f[c+4>>2]=0;f[c+8>>2]=0;f[c+12>>2]=0;b[a+24>>0]=1;f[a+28>>2]=9;c=a+40|0;f[c>>2]=0;f[c+4>>2]=0;f[c+8>>2]=0;f[c+12>>2]=0;f[a+56>>2]=-1;f[a+60>>2]=0;return}function Vh(a,c){a=a|0;c=c|0;var d=0,e=0;a=u;u=u+32|0;d=a;Bf(d,c);c=f[d+16>>2]|0;e=d+4|0;if((b[e+11>>0]|0)>=0){u=a;return c|0}fn(f[e>>2]|0);u=a;return c|0}function Wh(a,c){a=a|0;c=c|0;var d=0;if(f[c+56>>2]|0){d=0;return d|0}if((b[c+24>>0]|0)!=3){d=0;return d|0}f[a+64>>2]=c;d=1;return d|0}function Xh(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;if(!(Aj(a,b,c)|0)){d=0;return d|0}d=(f[(f[(f[(f[b+4>>2]|0)+8>>2]|0)+(c<<2)>>2]|0)+28>>2]|0)==9;return d|0}function Yh(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,f=0;if((a|0)==0&(c|0)==0)e=d;else{f=a;a=c;c=d;while(1){d=c+-1|0;b[d>>0]=f&7|48;f=Wj(f|0,a|0,3)|0;a=I;if((f|0)==0&(a|0)==0){e=d;break}else c=d}}return e|0}function Zh(a,c){a=a|0;c=c|0;var d=0;if(((c|0)!=0?(f[c+56>>2]|0)==0:0)?(b[c+24>>0]|0)==3:0){f[a+60>>2]=c;d=1}else d=0;return d|0}function _h(a,b,c,d,e,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;g=g|0;if(Dl(a,f[b+8>>2]|0,g)|0)Pf(0,b,c,d,e);return}function $h(a){a=a|0;var b=0,c=0;f[a>>2]=1148;b=a+20|0;c=f[b>>2]|0;f[b>>2]=0;if(!c){Zf(a);fn(a);return}Qa[f[(f[c>>2]|0)+4>>2]&127](c);Zf(a);fn(a);return}function ai(a){a=a|0;var c=0,d=0,e=0,g=0;c=u;u=u+16|0;d=c;e=f[a+4>>2]|0;g=(f[e+56>>2]|0)-(f[e+52>>2]|0)>>2;b[d>>0]=0;ge(a+20|0,g,d);u=c;return}function bi(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=1208;b=f[a+32>>2]|0;if(!b){fn(a);return}c=a+36|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b);fn(a);return}function ci(a,b,c){a=a|0;b=b|0;c=c|0;return Mb(a,b,c)|0}function di(a){a=a|0;var b=0;switch(a|0){case 11:case 2:case 1:{b=1;break}case 4:case 3:{b=2;break}case 6:case 5:{b=4;break}case 8:case 7:{b=8;break}case 9:{b=4;break}case 10:{b=8;break}default:b=-1}return b|0}function ei(a){a=a|0;var c=0,d=0,e=0;b[a+36>>0]=0;c=Tj(f[a+32>>2]|0,0,7,0)|0;d=Wj(c|0,I|0,3)|0;c=a+16|0;a=c;e=Tj(d|0,I|0,f[a>>2]|0,f[a+4>>2]|0)|0;a=c;f[a>>2]=e;f[a+4>>2]=I;return}function fi(a){a=a|0;var c=0,d=0,e=0,g=0;c=u;u=u+16|0;d=c;e=f[a+4>>2]|0;g=(f[e+28>>2]|0)-(f[e+24>>2]|0)>>2;b[d>>0]=0;ge(a+20|0,g,d);u=c;return}function gi(a){a=a|0;var b=0,c=0,d=0;b=a+60|0;c=a;d=c+60|0;do{f[c>>2]=0;c=c+4|0}while((c|0)<(d|0));f[b>>2]=a;b=a+64|0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;f[b+12>>2]=0;f[b+16>>2]=0;f[b+20>>2]=0;return}function hi(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=(f[a+96>>2]|0)+(b*12|0)|0;rd(c,d,d+12|0);return 1}function ii(){var a=0,b=0;a=dj(40)|0;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;f[a+12>>2]=0;n[a+16>>2]=$(1.0);b=a+20|0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;f[b+12>>2]=0;n[a+36>>2]=$(1.0);return a|0}function ji(a){a=a|0;f[a>>2]=2396;wf(a+8|0);fn(a);return}function ki(a,c){a=a|0;c=c|0;var d=0,e=0;if((a|0)!=(c|0)){d=b[c+11>>0]|0;e=d<<24>>24<0;Mf(a,e?f[c>>2]|0:c,e?f[c+4>>2]|0:d&255)|0}return a|0}function li(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=a&65535;d=b&65535;e=X(d,c)|0;f=a>>>16;a=(e>>>16)+(X(d,f)|0)|0;d=b>>>16;b=X(d,c)|0;return (I=(a>>>16)+(X(d,f)|0)+(((a&65535)+b|0)>>>16)|0,a+b<<16|e&65535|0)|0}function mi(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=gg(b)|0;d=dj(c+13|0)|0;f[d>>2]=c;f[d+4>>2]=c;f[d+8>>2]=0;e=bm(d)|0;ee(e|0,b|0,c+1|0)|0;f[a>>2]=e;return}function ni(a){a=a|0;var b=0,c=0;f[a>>2]=1148;b=a+20|0;c=f[b>>2]|0;f[b>>2]=0;if(!c){Zf(a);return}Qa[f[(f[c>>2]|0)+4>>2]&127](c);Zf(a);return}function oi(a,b){a=a|0;b=b|0;var c=0,d=0;if((b|0)==-1|(b|0)>4){c=-1;return c|0}d=f[a+20+(b*12|0)>>2]|0;if(((f[a+20+(b*12|0)+4>>2]|0)-d|0)<=0){c=-1;return c|0}c=f[d>>2]|0;return c|0}function pi(a){a=a|0;f[a>>2]=2396;wf(a+8|0);return}function qi(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f[b+44>>2]=e;Pb(a,b,c,d,e);return}function ri(a){a=a|0;var b=0,c=0;f[a>>2]=1208;b=f[a+32>>2]|0;if(!b)return;c=a+36|0;a=f[c>>2]|0;if((a|0)!=(b|0))f[c>>2]=a+(~((a+-4-b|0)>>>2)<<2);fn(b);return}function si(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if(Dl(a,f[b+8>>2]|0,0)|0)Vg(0,b,c,d);return}function ti(a){a=a|0;var b=0;f[a>>2]=2616;b=a+4|0;f[a+40>>2]=0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;f[b+12>>2]=0;f[b+16>>2]=0;f[b+20>>2]=0;f[b+24>>2]=0;f[b+28>>2]=0;d[b+32>>1]=0;return}function ui(a,c,d){a=a|0;c=c|0;d=d|0;var e=0;if((c|0)<(a|0)&(a|0)<(c+d|0)){e=a;c=c+d|0;a=a+d|0;while((d|0)>0){a=a-1|0;c=c-1|0;d=d-1|0;b[a>>0]=b[c>>0]|0}a=e}else ee(a,c,d)|0;return a|0}function vi(a){a=a|0;var b=0,c=0,d=0;f[a>>2]=956;b=f[a+8>>2]|0;if(!b){fn(a);return}c=a+12|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b);fn(a);return}function wi(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0;d=u;u=u+16|0;e=d;f[e>>2]=f[c>>2];g=Na[f[(f[a>>2]|0)+16>>2]&31](a,b,e)|0;if(g)f[c>>2]=f[e>>2];u=d;return g&1|0}function xi(a,b){a=a|0;b=b|0;var c=0;if(b>>>0>=2){c=0;return c|0}f[a+28>>2]=b;c=1;return c|0}function yi(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0;if((b|0)>0)d=0;else return;do{e=f[a+(d<<2)>>2]|0;f[c+(d<<2)>>2]=e<<31>>31^e>>>1;d=d+1|0}while((d|0)!=(b|0));return}function zi(){var a=0,b=0;a=jj()|0;if((a|0?(b=f[a>>2]|0,b|0):0)?(a=b+48|0,(f[a>>2]&-256|0)==1126902528?(f[a+4>>2]|0)==1129074247:0):0)Tk(f[b+12>>2]|0);Tk(pm()|0)}function Ai(a){a=a|0;var c=0;c=b[w+(a&255)>>0]|0;if((c|0)<8)return c|0;c=b[w+(a>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=b[w+(a>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return (b[w+(a>>>24)>>0]|0)+24|0}function Bi(a){a=a|0;var b=0,c=0,d=0;if(!a)return;b=f[a>>2]|0;if(b|0){c=a+4|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-4-b|0)>>>2)<<2);fn(b)}fn(a);return}function Ci(a){a=a|0;var b=0,c=0,d=0;if(!a)return;b=f[a>>2]|0;if(b|0){c=a+4|0;d=f[c>>2]|0;if((d|0)!=(b|0))f[c>>2]=d+(~((d+-2-b|0)>>>1)<<1);fn(b)}fn(a);return}function Di(a,c){a=a|0;c=c|0;var d=0;b[c+84>>0]=1;a=f[c+68>>2]|0;d=c+72|0;c=f[d>>2]|0;if((c|0)==(a|0))return 1;f[d>>2]=c+(~((c+-4-a|0)>>>2)<<2);return 1}function Ei(a){a=a|0;var b=0,c=0;if(Lm(a)|0?(b=hm(f[a>>2]|0)|0,a=b+8|0,c=f[a>>2]|0,f[a>>2]=c+-1,(c+-1|0)<0):0)fn(b);return}function Fi(a){a=a|0;var c=0;f[a>>2]=0;c=a+8|0;d[a+38>>1]=0;f[c>>2]=0;f[c+4>>2]=0;f[c+8>>2]=0;f[c+12>>2]=0;f[c+16>>2]=0;f[c+20>>2]=0;f[c+24>>2]=0;b[c+28>>0]=0;return}function Gi(a,b){a=a|0;b=b|0;return Ma[f[(f[a>>2]|0)+48>>2]&127](a,(f[b+4>>2]|0)-(f[b>>2]|0)>>2)|0}function Hi(a){a=a|0;var b=0,c=0;f[a>>2]=956;b=f[a+8>>2]|0;if(!b)return;c=a+12|0;a=f[c>>2]|0;if((a|0)!=(b|0))f[c>>2]=a+(~((a+-4-b|0)>>>2)<<2);fn(b);return}function Ii(a,b,c){a=a|0;b=b|0;c=c|0;vb(a,b,c);return}function Ji(a){a=a|0;Fi(a);Fi(a+40|0);Vk(a+80|0);Fi(a+96|0);f[a+136>>2]=0;f[a+140>>2]=0;f[a+144>>2]=0;return}function Ki(a,b,c){a=a|0;b=b|0;c=c|0;return tc(a,b,5,6,c)|0}function Li(a,b,c){a=a|0;b=b|0;c=c|0;return rc(a,b,3,4,c)|0}function Mi(a){a=a|0;var b=0;f[a>>2]=984;b=a+4|0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;f[b+12>>2]=0;f[b+16>>2]=0;f[b+20>>2]=0;f[b+24>>2]=0;f[b+28>>2]=0;return}function Ni(a,b,c){a=a|0;b=b|0;c=c|0;return wc(a,b,1,2,c)|0}function Oi(a,b,c){a=a|0;b=b|0;c=c|0;return sc(a,b,3,4,c)|0}function Pi(a,b,c){a=a|0;b=b|0;c=c|0;return uc(a,b,5,6,c)|0}function Qi(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,g=0;d=a+20|0;e=f[d>>2]|0;g=(f[a+16>>2]|0)-e|0;a=g>>>0>c>>>0?c:g;ee(e|0,b|0,a|0)|0;f[d>>2]=(f[d>>2]|0)+a;return c|0}function Ri(a,b,c){a=a|0;b=b|0;c=c|0;return xc(a,b,1,2,c)|0}function Si(a){a=a|0;var b=0;f[a>>2]=2372;b=f[a+20>>2]|0;if(b|0)fn(b);b=f[a+8>>2]|0;if(!b){fn(a);return}fn(b);fn(a);return}function Ti(){var a=0,b=0;a=dj(24)|0;f[a>>2]=956;f[a+4>>2]=-1;b=a+8|0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;f[b+12>>2]=0;return a|0}function Ui(a){a=a|0;var c=0;Uh(a);c=a+64|0;f[a+88>>2]=0;f[c>>2]=0;f[c+4>>2]=0;f[c+8>>2]=0;f[c+12>>2]=0;f[c+16>>2]=0;b[c+20>>0]=0;return}function Vi(a){a=a|0;var b=0,c=0;if(!a)return;b=f[a+8>>2]|0;if(b|0){c=a+12|0;if((f[c>>2]|0)!=(b|0))f[c>>2]=b;fn(b)}fn(a);return}function Wi(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;if((f[b+4>>2]|0)==(c|0)?(c=b+28|0,(f[c>>2]|0)!=1):0)f[c>>2]=d;return}function Xi(a){a=a|0;var b=0;f[a>>2]=2420;b=f[a+20>>2]|0;if(b|0)fn(b);b=f[a+8>>2]|0;if(!b){fn(a);return}fn(b);fn(a);return}function Yi(a,b,c,e){a=a|0;b=b|0;c=c|0;e=e|0;f[a>>2]=b;b=a+8|0;f[b>>2]=c;f[b+4>>2]=0;d[a+38>>1]=e;e=a+16|0;f[e>>2]=0;f[e+4>>2]=0;return}function Zi(a,b,c){a=a|0;b=$(b);c=c|0;var d=0,e=Ja;if((c|0)<1){d=0;return d|0}e=$($(1.0)/$(c|0));n[a+4>>2]=e;n[a>>2]=b;d=1;return d|0}function _i(a,b,c){a=a|0;b=b|0;c=c|0;f[a+4>>2]=b;f[a+8>>2]=f[(f[(f[b+4>>2]|0)+8>>2]|0)+(c<<2)>>2];f[a+12>>2]=c;return 1}function $i(a){a=a|0;var b=0,c=0;if(!a)return;b=f[a>>2]|0;if(b|0){c=a+4|0;if((f[c>>2]|0)!=(b|0))f[c>>2]=b;fn(b)}fn(a);return}function aj(a){a=a|0;var b=0;Kl(a);f[a+16>>2]=0;f[a+20>>2]=0;f[a+12>>2]=a+16;b=a+24|0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;f[b+12>>2]=0;return}function bj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0;e=u;u=u+16|0;g=e|0;ac(a,b,c,d,g)|0;u=e;return (I=f[g+4>>2]|0,f[g>>2]|0)|0}function cj(a){a=a|0;var b=0;_j(a);f[a>>2]=2668;b=a+84|0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;f[b+12>>2]=0;f[b+16>>2]=0;f[b+20>>2]=0;return}function dj(a){a=a|0;var b=0,c=0;b=(a|0)==0?1:a;while(1){a=Wa(b)|0;if(a|0){c=a;break}a=jm()|0;if(!a){c=0;break}Pa[a&3]()}return c|0}function ej(a){a=a|0;f[a>>2]=1940;ln(a+88|0);fn(a);return}function fj(a){a=a|0;var b=0;f[a>>2]=2372;b=f[a+20>>2]|0;if(b|0)fn(b);b=f[a+8>>2]|0;if(!b)return;fn(b);return}function gj(a){a=a|0;f[a>>2]=2024;ln(a+88|0);fn(a);return}function hj(a){a=a|0;var b=0,c=0,d=0;b=u;u=u+16|0;c=b;d=jn(f[a+60>>2]|0)|0;f[c>>2]=d;d=kk(Ba(6,c|0)|0)|0;u=b;return d|0}function ij(a){a=a|0;f[a>>2]=1940;ln(a+88|0);return}function jj(){var a=0,b=0;a=u;u=u+16|0;if(!(Ga(13448,3)|0)){b=Ea(f[3363]|0)|0;u=a;return b|0}else Cj(12586,a);return 0}function kj(a){a=a|0;var b=0;f[a>>2]=2420;b=f[a+20>>2]|0;if(b|0)fn(b);b=f[a+8>>2]|0;if(!b)return;fn(b);return}function lj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;a=c;c=li(e,a)|0;f=I;return (I=(X(b,a)|0)+(X(d,e)|0)+f|f&0,c|0|0)|0}function mj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ki(b,c,d)|0}function nj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Li(b,c,d)|0}function oj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return $c(b,c,d)|0}function pj(a){a=a|0;var b=0;b=u;u=u+16|0;zb(a);if(!(Ha(f[3363]|0,0)|0)){u=b;return}else Cj(12685,b)}function qj(a){a=a|0;f[a>>2]=2024;ln(a+88|0);return}function rj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ni(b,c,d)|0}function sj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Oi(b,c,d)|0}function tj(a){a=a|0;var b=0;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;b=a+16|0;f[b>>2]=0;f[b+4>>2]=0;f[b+8>>2]=0;f[b+12>>2]=0;return}function uj(a){a=a|0;Fk(a);f[a>>2]=2108;f[a+24>>2]=-1;f[a+28>>2]=0;n[a+32>>2]=$(0.0);return}function vj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ri(b,c,d)|0}function wj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Pi(b,c,d)|0}function xj(a,b,c){a=a|0;b=b|0;c=c|0;f[a>>2]=b;b=a+8|0;f[b>>2]=c;f[b+4>>2]=0;b=a+16|0;f[b>>2]=0;f[b+4>>2]=0;return}function yj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,g=0;e=u;u=u+16|0;g=e;f[g>>2]=d;d=Af(a,b,c,g)|0;u=e;return d|0}function zj(a,b,c){a=a|0;b=b|0;c=c|0;return 1}function Aj(a,b,c){a=a|0;b=b|0;c=c|0;return _i(a,b,c)|0}function Bj(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return Oa[a&15](b|0,c|0,d|0,e|0,f|0,g|0)|0}function Cj(a,b){a=a|0;b=b|0;var c=0,d=0;c=u;u=u+16|0;d=c;f[d>>2]=b;b=f[678]|0;xe(b,a,d)|0;rg(10,b)|0;Ca()}function Dj(a,b){a=a|0;b=b|0;var c=0;c=f[a+48>>2]|0;return Ma[f[(f[c>>2]|0)+16>>2]&127](c,b)|0}function Ej(a,b,c){a=a|0;b=b|0;c=c|0;return oi(b,c)|0}function Fj(a,b){a=a|0;b=b|0;var c=0;c=f[a+48>>2]|0;return Ma[f[(f[c>>2]|0)+12>>2]&127](c,b)|0}function Gj(a,b){a=a|0;b=b|0;var c=0;c=f[a+48>>2]|0;return Ma[f[(f[c>>2]|0)+20>>2]&127](c,b)|0}function Hj(a){a=a|0;var c=0,d=0;c=a+4|0;if((b[c+11>>0]|0)<0){d=f[c>>2]|0;return d|0}else{d=c;return d|0}return 0}function Ij(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Hd(b,c,d)|0}function Jj(){var a=0;a=u;u=u+16|0;if(!(Fa(13452,83)|0)){u=a;return}else Cj(12635,a)}function Kj(a){a=a|0;Jc(a);fn(a);return}function Lj(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;Va[a&3](b|0,c|0,d|0,e|0,f|0,g|0)}function Mj(a){a=a|0;if(!(f[a+44>>2]|0))return 0;else return La[f[(f[a>>2]|0)+48>>2]&127](a)|0;return 0}function Nj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return bg(b,c,d)|0}function Oj(a,b,c){a=a|0;b=b|0;c=c|0;if(b|0)Vf(a|0,(Gm(c)|0)&255|0,b|0)|0;return a|0}function Pj(a){a=a|0;return 4}function Qj(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){I=b<>>32-c;return a<>0]|0)<0)fn(f[c>>2]|0);fn(a);return}function Sj(){}function Tj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=a+c>>>0;return (I=b+d+(e>>>0>>0|0)>>>0,e|0)|0}function Uj(a,b){a=a|0;b=b|0;var c=0;if(!b)c=0;else c=ze(f[b>>2]|0,f[b+4>>2]|0,a)|0;return (c|0?c:a)|0}function Vj(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=b-d>>>0;e=b-d-(c>>>0>a>>>0|0)>>>0;return (I=e,a-c>>>0|0)|0}function Wj(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){I=b>>>c;return a>>>c|(b&(1<>>c-32|0}function Xj(a,b,c){a=a|0;b=b|0;c=c|0;return Zg(a,b,c)|0}function Yj(a){a=a|0;Dc(a);fn(a);return}function Zj(a){a=a|0;return 5}function _j(a){a=a|0;var b=0;f[a>>2]=2696;b=a+4|0;a=b+80|0;do{f[b>>2]=0;b=b+4|0}while((b|0)<(a|0));return}function $j(a){a=a|0;return 6}function ak(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return hi(b,c,d)|0}function bk(a,b,c){a=a|0;b=b|0;c=c|0;f[a+28>>2]=b;f[a+32>>2]=c;return 1}function ck(a,b,c){a=a|0;b=b|0;c=c|0;return Ej(a,b,c)|0}function dk(a){a=a|0;var b=0;b=f[a+48>>2]|0;return La[f[(f[b>>2]|0)+28>>2]&127](b)|0}function ek(a,b,c){a=a|0;b=b|0;c=c|0;return Bd(b,c)|0}function fk(a){a=a|0;f[a>>2]=1040;f[a+4>>2]=0;f[a+8>>2]=0;f[a+12>>2]=-1;f[a+16>>2]=0;return}function gk(a){a=a|0;var b=0;b=f[a+48>>2]|0;return La[f[(f[b>>2]|0)+24>>2]&127](b)|0}function hk(a,b){a=a|0;b=b|0;ng(a,b);return}function ik(a){a=a|0;var b=0;b=f[a+48>>2]|0;return La[f[(f[b>>2]|0)+36>>2]&127](b)|0}function jk(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;Ua[a&3](b|0,c|0,d|0,e|0,f|0)}function kk(a){a=a|0;var b=0,c=0;if(a>>>0>4294963200){b=Um()|0;f[b>>2]=0-a;c=-1}else c=a;return c|0}function lk(a,b,c){a=a|0;b=b|0;c=c|0;return ah(a,b,c)|0}function mk(a,b,c){a=a|0;b=b|0;c=c|0;return pf(a,b,c)|0}function nk(a,b,c){a=a|0;b=b|0;c=c|0;return Ef(a,b,c)|0}function ok(a,b,c){a=a|0;b=b|0;c=c|0;return We(a,b,c)|0}function pk(a,b,c){a=a|0;b=b|0;c=c|0;return +(+zf(a,b,c))}function qk(a,b){a=a|0;b=b|0;return Ma[f[(f[a>>2]|0)+12>>2]&127](a,b)|0}function rk(a,b){a=a|0;b=b|0;return Ma[f[(f[a>>2]|0)+56>>2]&127](a,b)|0}function sk(a,b,c){a=a|0;b=b|0;c=c|0;return Eg(a,b,c)|0}function tk(a,b){a=a|0;b=b|0;f[a+4>>2]=b;return 1}function uk(a,b,c){a=a|0;b=b|0;c=c|0;return Mk(b,c)|0}function vk(a,b,c){a=a|0;b=b|0;c=c|0;return Ff(a,b,c)|0}function wk(a,b,c){a=a|0;b=b|0;c=c|0;return Cf(a,b,c)|0}function xk(a){a=a|0;Fk(a);f[a>>2]=1824;f[a+24>>2]=-1;return}function yk(a,b){a=a|0;b=b|0;f[a+8>>2]=b;f[a+12>>2]=-1;return 1}function zk(a,b,c){a=a|0;b=b|0;c=c|0;return me(a,b,c)|0}function Ak(a,b,c){a=a|0;b=b|0;c=c|0;return He(b,c)|0}function Bk(a){a=+a;var b=0;p[s>>3]=a;b=f[s>>2]|0;I=f[s+4>>2]|0;return b|0}function Ck(){var a=0;a=dj(40)|0;f[a>>2]=-1;tj(a+8|0);return a|0}function Dk(){var a=0;a=dj(8)|0;f[a>>2]=928;f[a+4>>2]=-1;return a|0}function Ek(a,b,c){a=a|0;b=b|0;c=c|0;return hf(a,b,c)|0}function Fk(a){a=a|0;fk(a);f[a>>2]=1148;f[a+20>>2]=0;return}function Gk(a,b){a=a|0;b=b|0;hk(a,b);return}function Hk(a){a=a|0;var b=0;if(!a)b=0;else b=(Be(a,800,888,0)|0)!=0;return b&1|0}function Ik(a,b){a=a|0;b=b|0;return $(n[(f[a+8>>2]|0)+(b<<2)>>2])}function Jk(a,b){a=a|0;b=b|0;return Vh(a,b)|0}function Kk(a){a=a|0;if((b[a+11>>0]|0)<0)fn(f[a>>2]|0);return}function Lk(a){a=a|0;if(!a)return;Qa[f[(f[a>>2]|0)+4>>2]&127](a);return}function Mk(a,b){a=a|0;b=b|0;return jh(a,b)|0}function Nk(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Ta[a&7](b|0,c|0,d|0,e|0)}function Ok(a,b,c){a=a|0;b=b|0;c=c|0;if(c|0)ui(a|0,b|0,c|0)|0;return a|0}function Pk(a,b,c){a=a|0;b=b|0;c=c|0;return al(b,c)|0}function Qk(a,b,c){a=a|0;b=b|0;c=c|0;if(c|0)ee(a|0,b|0,c|0)|0;return a|0}function Rk(a,b){a=a|0;b=b|0;return -1}function Sk(a){a=a|0;return 3}function Tk(a){a=a|0;var b=0;b=u;u=u+16|0;Pa[a&3]();Cj(12738,b)}function Uk(a,b){a=a|0;b=b|0;return Ql(a,b)|0}function Vk(a){a=a|0;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;b[a+12>>0]=0;return}function Wk(a){a=a|0;Qe(a);fn(a);return}function Xk(a){a=a|0;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;f[a+12>>2]=0;return}function Yk(a){a=a|0;hl(a);f[a>>2]=2236;f[a+48>>2]=0;return}function Zk(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Na[a&31](b|0,c|0,d|0)|0}function _k(a,b,c){a=a|0;b=b|0;c=c|0;xj(a,b,c);return}function $k(a,b){a=a|0;b=b|0;f[a>>2]=3688;mi(a+4|0,b);return}function al(a,b){a=a|0;b=b|0;return f[(f[a+8>>2]|0)+(b<<2)>>2]|0}function bl(a,b){a=a|0;b=b|0;var c=0;if(!a)c=0;else c=xf(a,b,0)|0;return c|0}function cl(a){a=a|0;if(!a)return;ln(a+24|0);fn(a);return}function dl(a,b){a=a|0;b=b|0;return f[(f[a+4>>2]|0)+(b<<2)>>2]|0}function el(){var a=0;a=dj(64)|0;Uh(a);return a|0}function fl(a,b){a=a|0;b=b|0;return $(ll(a,b))}function gl(a){a=a|0;return f[a+8>>2]|0}function hl(a){a=a|0;ti(a);f[a>>2]=2176;f[a+44>>2]=0;return}function il(a){a=a|0;if(!a)return;Df(a);fn(a);return}function jl(a,b){a=a|0;b=b|0;return Yl(a,b)|0}function kl(a){a=a|0;return b[(f[a+8>>2]|0)+24>>0]|0}function ll(a,b){a=a|0;b=b|0;return $(n[(f[a>>2]|0)+(b<<2)>>2])}function ml(a,b,c){a=a|0;b=b|0;c=c|0;if(!(f[a>>2]&32))Xe(b,c,a)|0;return}function nl(a){a=a|0;return (f[a+8>>2]|0)-(f[a+4>>2]|0)>>2|0}function ol(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Sa[a&7](b|0,c|0,d|0)}function pl(){var a=0;a=dj(96)|0;Ui(a);return a|0}function ql(a){a=a|0;var b=0;b=u;u=u+a|0;u=u+15&-16;return b|0}function rl(a){a=a|0;return ((f[a+100>>2]|0)-(f[a+96>>2]|0)|0)/12|0|0}function sl(a){a=a|0;var b=0;b=(bn()|0)+188|0;return yg(a,f[b>>2]|0)|0}function tl(){var a=0;a=dj(16)|0;Xk(a);return a|0}function ul(){var a=0;a=dj(40)|0;Fi(a);return a|0}function vl(a,b){a=a|0;b=b|0;return 1}function wl(a,b){a=a|0;b=b|0;return Gl(a,b)|0}function xl(a,b){a=a|0;b=b|0;return Hl(a,b)|0}function yl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(3);return 0}function zl(a,b){a=a|0;b=b|0;return Wl(a,b)|0}function Al(){var a=0;a=dj(12)|0;Ol(a);return a|0}function Bl(a){a=a|0;Zf(a);fn(a);return}function Cl(a){a=a|0;n[a>>2]=$(1.0);n[a+4>>2]=$(1.0);return}function Dl(a,b,c){a=a|0;b=b|0;c=c|0;return (a|0)==(b|0)|0}function El(a,b){a=a|0;b=b|0;var c=0;c=Tl(a|0)|0;return ((b|0)==0?a:c)|0}function Fl(a){a=a|0;return (f[a+12>>2]|0)-(f[a+8>>2]|0)>>2|0}function Gl(a,b){a=a|0;b=b|0;return f[(f[a>>2]|0)+(b<<2)>>2]|0}function Hl(a,b){a=a|0;b=b|0;return d[(f[a>>2]|0)+(b<<1)>>1]|0}function Il(a,b){a=a|0;b=b|0;f[a+4>>2]=b;return}function Jl(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return ac(a,b,c,d,0)|0}function Kl(a){a=a|0;f[a+4>>2]=0;f[a+8>>2]=0;f[a>>2]=a+4;return}function Ll(){var a=0;a=dj(84)|0;_j(a);return a|0}function Ml(a){a=a|0;return (f[a+4>>2]|0)-(f[a>>2]|0)>>2|0}function Nl(a){a=a|0;return (f[a+4>>2]|0)-(f[a>>2]|0)>>1|0}function Ol(a){a=a|0;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;return}function Pl(a){a=a|0;f[a>>2]=3688;Ei(a+4|0);return}function Ql(a,b){a=a|0;b=b|0;return f[b+12>>2]|0}function Rl(a,b,c){a=a|0;b=b|0;c=c|0;return Ma[a&127](b|0,c|0)|0}function Sl(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(10)}function Tl(a){a=a|0;return (a&255)<<24|(a>>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function Ul(a){a=a|0;hl(a);f[a>>2]=2532;return}function Vl(a,c){a=a|0;c=c|0;b[a>>0]=b[c>>0]|0;return}function Wl(a,c){a=a|0;c=c|0;return b[(f[a>>2]|0)+c>>0]|0}function Xl(a){a=a|0;return (f[a+4>>2]|0)-(f[a>>2]|0)|0}function Yl(a,b){a=a|0;b=b|0;return f[b+4>>2]|0}function Zl(a){a=a|0;return $(n[a+20>>2])}function _l(a){a=a|0;return f[a+4>>2]|0}function $l(a){a=a|0;if(!a)return;fn(a);return}function am(a,b){a=a|0;b=b|0;if(!x){x=a;y=b}}function bm(a){a=a|0;return a+12|0}function cm(a){a=a|0;return f[a+88>>2]|0}function dm(a,b,c){a=a|0;b=b|0;c=c|0;Ra[a&7](b|0,c|0)}function em(){var a=0;a=dj(40)|0;aj(a);return a|0}function fm(){var a=0;a=dj(108)|0;cj(a);return a|0}function gm(a){a=a|0;return (b[a+32>>0]|0)!=0|0}function hm(a){a=a|0;return a+-12|0}function im(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;aa(9)}function jm(){var a=0;a=f[3364]|0;f[3364]=a+0;return a|0}function km(a){a=a|0;return Jm(a+4|0)|0}function lm(a){a=a|0;return f[a+56>>2]|0}function mm(a){a=a|0;Qd(a);fn(a);return}function nm(a){a=a|0;ln(a);fn(a);return}function om(a){a=a|0;return b[a+24>>0]|0}function pm(){var a=0;a=f[898]|0;f[898]=a+0;return a|0}function qm(a,b){a=a|0;b=b|0;return 0}function rm(a){a=a|0;return f[a+40>>2]|0}function sm(a){a=a|0;return f[a+48>>2]|0}function tm(a,b){a=a|0;b=b|0;return La[a&127](b|0)|0}function um(a){a=a|0;return f[a+60>>2]|0}function vm(a){a=a|0;return f[a+28>>2]|0}function wm(a){a=a|0;sa(a|0)|0;zi()}function xm(a){a=a|0;Pl(a);fn(a);return}function ym(a){a=a|0;Ca()}function zm(a,b){a=a|0;b=b|0;u=a;v=b}function Am(a){a=a|0;return ((a|0)==32|(a+-9|0)>>>0<5)&1|0}function Bm(a){a=a|0;return (f[a>>2]|0)==0|0}function Cm(a){a=a|0;return f[a+80>>2]|0}function Dm(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aa(8)}function Em(a,b){a=a|0;b=b|0;Qa[a&127](b|0)}function Fm(a,b){a=a|0;b=b|0;return Uj(a,b)|0}function Gm(a){a=a|0;return a&255|0}function Hm(a){a=a|0;f[a>>2]=0;return}function Im(a,b,c){a=a|0;b=b|0;c=c|0;aa(2);return 0}function Jm(a){a=a|0;return f[a>>2]|0}function Km(a){a=a|0;return 2}function Lm(a){a=a|0;return 1}function Mm(a,b){a=+a;b=b|0;return +(+zg(a,b))}function Nm(){return 3}function Om(a,b,c){a=a|0;b=b|0;c=c|0;aa(7)}function Pm(){return -4}function Qm(){return 4}function Rm(){return -3}function Sm(){return 1}function Tm(){return 2}function Um(){return (bn()|0)+64|0}function Vm(){return -5}function Wm(a,b){a=a|0;b=b|0;aa(1);return 0}function Xm(a){a=a|0;Pa[a&3]()}function Ym(){return -2}function Zm(){ua()}function _m(){return -1}function $m(a,b){a=a|0;b=b|0;aa(6)}function an(){return 0}function bn(){return qn()|0}function cn(a){a=a|0;return dj(a)|0}function dn(a){a=a|0;fn(a);return}function en(a){a=a|0;u=a}function fn(a){a=a|0;zb(a);return}function gn(a){a=a|0;I=a}function hn(){return 13384}function jn(a){a=a|0;return a|0}function kn(a){a=a|0;aa(0);return 0}function ln(a){a=a|0;return}function mn(a){a=a|0;return 0}function nn(){return I|0}function on(){return u|0}function pn(a){a=a|0;aa(5)}function qn(){return 2840}function rn(){aa(4)} + +// EMSCRIPTEN_END_FUNCS +var La=[kn,Km,Lm,nl,vm,Lm,Ec,kl,_l,mn,mn,Lm,mn,Lm,Lm,Kh,Pj,Kh,Zj,Fh,Lm,$j,Ng,Lm,vm,Lm,Kh,Pj,Kh,Zj,Fh,Lm,$j,Ng,Lm,vm,Km,mn,_l,Lm,mn,Lm,Sk,$j,Jg,Lm,vm,$j,Jg,Lm,vm,kd,Lm,Lm,Mj,Cc,dh,Lm,mn,he,dk,ik,gk,db,Lm,_l,gl,xd,_c,Ad,gb,Lm,_l,gl,ib,rf,mn,Lm,hj,km,k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Jc,Kj,hg,ln,dn,hg,_g,Tg,Qd,mm,ln,nm,ln,ln,nm,Pl,xm,xm,pj,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn,pn];var Ra=[$m,Lg,wd,Rg,Eb,$m,$m,$m];var Sa=[Om,Gg,ub,wb,wb,ub,ae,Pd];var Ta=[Dm,If,Xd,si,vh,Dm,Dm,Dm];var Ua=[im,Uf,de,im];var Va=[Sl,_h,hh,Sl];return{___cxa_can_catch:wi,___cxa_is_pointer_type:Hk,___divdi3:Ug,___muldi3:lj,___udivdi3:Jl,___uremdi3:bj,_bitshift64Lshr:Wj,_bitshift64Shl:Qj,_emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0:Dk,_emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1:qk,_emscripten_bind_AttributeOctahedronTransform___destroy___0:Lk,_emscripten_bind_AttributeOctahedronTransform_quantization_bits_0:_l,_emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0:Ti,_emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1:qk,_emscripten_bind_AttributeQuantizationTransform___destroy___0:Lk,_emscripten_bind_AttributeQuantizationTransform_min_value_1:Ik,_emscripten_bind_AttributeQuantizationTransform_quantization_bits_0:_l,_emscripten_bind_AttributeQuantizationTransform_range_0:Zl,_emscripten_bind_AttributeTransformData_AttributeTransformData_0:Ck,_emscripten_bind_AttributeTransformData___destroy___0:Vi,_emscripten_bind_AttributeTransformData_transform_type_0:Jm,_emscripten_bind_DecoderBuffer_DecoderBuffer_0:ul,_emscripten_bind_DecoderBuffer_Init_2:_k,_emscripten_bind_DecoderBuffer___destroy___0:cl,_emscripten_bind_Decoder_DecodeBufferToMesh_2:lk,_emscripten_bind_Decoder_DecodeBufferToPointCloud_2:Xj,_emscripten_bind_Decoder_Decoder_0:em,_emscripten_bind_Decoder_GetAttributeByUniqueId_2:uk,_emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3:oj,_emscripten_bind_Decoder_GetAttributeFloat_3:Nj,_emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3:Ij,_emscripten_bind_Decoder_GetAttributeIdByName_2:Ak,_emscripten_bind_Decoder_GetAttributeId_2:ck,_emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3:sj,_emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3:wj,_emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3:vj,_emscripten_bind_Decoder_GetAttributeIntForAllPoints_3:wj,_emscripten_bind_Decoder_GetAttributeMetadata_2:sk,_emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3:nj,_emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3:mj,_emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3:rj,_emscripten_bind_Decoder_GetAttribute_2:Pk,_emscripten_bind_Decoder_GetEncodedGeometryType_1:Jk,_emscripten_bind_Decoder_GetFaceFromMesh_3:ak,_emscripten_bind_Decoder_GetMetadata_1:jl,_emscripten_bind_Decoder_GetTriangleStripsFromMesh_2:ek,_emscripten_bind_Decoder_SkipAttributeTransform_1:Gk,_emscripten_bind_Decoder___destroy___0:Og,_emscripten_bind_DracoFloat32Array_DracoFloat32Array_0:Al,_emscripten_bind_DracoFloat32Array_GetValue_1:fl,_emscripten_bind_DracoFloat32Array___destroy___0:Bi,_emscripten_bind_DracoFloat32Array_size_0:Ml,_emscripten_bind_DracoInt16Array_DracoInt16Array_0:Al,_emscripten_bind_DracoInt16Array_GetValue_1:xl,_emscripten_bind_DracoInt16Array___destroy___0:Ci,_emscripten_bind_DracoInt16Array_size_0:Nl,_emscripten_bind_DracoInt32Array_DracoInt32Array_0:Al,_emscripten_bind_DracoInt32Array_GetValue_1:wl,_emscripten_bind_DracoInt32Array___destroy___0:Bi,_emscripten_bind_DracoInt32Array_size_0:Ml,_emscripten_bind_DracoInt8Array_DracoInt8Array_0:Al,_emscripten_bind_DracoInt8Array_GetValue_1:zl,_emscripten_bind_DracoInt8Array___destroy___0:$i,_emscripten_bind_DracoInt8Array_size_0:Xl,_emscripten_bind_DracoUInt16Array_DracoUInt16Array_0:Al,_emscripten_bind_DracoUInt16Array_GetValue_1:xl,_emscripten_bind_DracoUInt16Array___destroy___0:Ci,_emscripten_bind_DracoUInt16Array_size_0:Nl,_emscripten_bind_DracoUInt32Array_DracoUInt32Array_0:Al,_emscripten_bind_DracoUInt32Array_GetValue_1:wl,_emscripten_bind_DracoUInt32Array___destroy___0:Bi,_emscripten_bind_DracoUInt32Array_size_0:Ml,_emscripten_bind_DracoUInt8Array_DracoUInt8Array_0:Al,_emscripten_bind_DracoUInt8Array_GetValue_1:zl,_emscripten_bind_DracoUInt8Array___destroy___0:$i,_emscripten_bind_DracoUInt8Array_size_0:Xl,_emscripten_bind_GeometryAttribute_GeometryAttribute_0:el,_emscripten_bind_GeometryAttribute___destroy___0:$l,_emscripten_bind_Mesh_Mesh_0:fm,_emscripten_bind_Mesh___destroy___0:Lk,_emscripten_bind_Mesh_num_attributes_0:Fl,_emscripten_bind_Mesh_num_faces_0:rl,_emscripten_bind_Mesh_num_points_0:Cm,_emscripten_bind_MetadataQuerier_GetDoubleEntry_2:pk,_emscripten_bind_MetadataQuerier_GetEntryName_2:zk,_emscripten_bind_MetadataQuerier_GetIntEntry_2:wk,_emscripten_bind_MetadataQuerier_GetStringEntry_2:ok,_emscripten_bind_MetadataQuerier_HasDoubleEntry_2:nk,_emscripten_bind_MetadataQuerier_HasEntry_2:Ek,_emscripten_bind_MetadataQuerier_HasIntEntry_2:vk,_emscripten_bind_MetadataQuerier_HasStringEntry_2:mk,_emscripten_bind_MetadataQuerier_MetadataQuerier_0:tl,_emscripten_bind_MetadataQuerier_NumEntries_1:Uk,_emscripten_bind_MetadataQuerier___destroy___0:Qg,_emscripten_bind_Metadata_Metadata_0:ii,_emscripten_bind_Metadata___destroy___0:il,_emscripten_bind_PointAttribute_GetAttributeTransformData_0:cm,_emscripten_bind_PointAttribute_PointAttribute_0:pl,_emscripten_bind_PointAttribute___destroy___0:jg,_emscripten_bind_PointAttribute_attribute_type_0:lm,_emscripten_bind_PointAttribute_byte_offset_0:sm,_emscripten_bind_PointAttribute_byte_stride_0:rm,_emscripten_bind_PointAttribute_data_type_0:vm,_emscripten_bind_PointAttribute_normalized_0:gm,_emscripten_bind_PointAttribute_num_components_0:om,_emscripten_bind_PointAttribute_size_0:Cm,_emscripten_bind_PointAttribute_unique_id_0:um,_emscripten_bind_PointCloud_PointCloud_0:Ll,_emscripten_bind_PointCloud___destroy___0:Lk,_emscripten_bind_PointCloud_num_attributes_0:Fl,_emscripten_bind_PointCloud_num_points_0:Cm,_emscripten_bind_Status___destroy___0:Rj,_emscripten_bind_Status_code_0:Jm,_emscripten_bind_Status_error_msg_0:Hj,_emscripten_bind_Status_ok_0:Bm,_emscripten_bind_VoidPtr___destroy___0:$l,_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM:_m,_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM:an,_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM:Tm,_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM:Sm,_emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE:_m,_emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD:an,_emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH:Sm,_emscripten_enum_draco_GeometryAttribute_Type_COLOR:Tm,_emscripten_enum_draco_GeometryAttribute_Type_GENERIC:Qm,_emscripten_enum_draco_GeometryAttribute_Type_INVALID:_m,_emscripten_enum_draco_GeometryAttribute_Type_NORMAL:Sm,_emscripten_enum_draco_GeometryAttribute_Type_POSITION:an,_emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD:Nm,_emscripten_enum_draco_StatusCode_ERROR:_m,_emscripten_enum_draco_StatusCode_INVALID_PARAMETER:Rm,_emscripten_enum_draco_StatusCode_IO_ERROR:Ym,_emscripten_enum_draco_StatusCode_OK:an,_emscripten_enum_draco_StatusCode_UNKNOWN_VERSION:Vm,_emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION:Pm,_emscripten_get_global_libc:hn,_emscripten_replace_memory:Ka,_free:zb,_i64Add:Tj,_i64Subtract:Vj,_llvm_bswap_i32:Tl,_malloc:Wa,_memcpy:ee,_memmove:ui,_memset:Vf,_sbrk:Qh,dynCall_ii:tm,dynCall_iii:Rl,dynCall_iiii:Zk,dynCall_iiiiiii:Bj,dynCall_v:Xm,dynCall_vi:Em,dynCall_vii:dm,dynCall_viii:ol,dynCall_viiii:Nk,dynCall_viiiii:jk,dynCall_viiiiii:Lj,establishStackSpace:zm,getTempRet0:nn,runPostSets:Sj,setTempRet0:gn,setThrew:am,stackAlloc:ql,stackRestore:en,stackSave:on}}) + + +// EMSCRIPTEN_END_ASM +(Module.asmGlobalArg,Module.asmLibraryArg,buffer);var ___cxa_can_catch=Module["___cxa_can_catch"]=asm["___cxa_can_catch"];var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=asm["___cxa_is_pointer_type"];var ___divdi3=Module["___divdi3"]=asm["___divdi3"];var ___muldi3=Module["___muldi3"]=asm["___muldi3"];var ___udivdi3=Module["___udivdi3"]=asm["___udivdi3"];var ___uremdi3=Module["___uremdi3"]=asm["___uremdi3"];var _bitshift64Lshr=Module["_bitshift64Lshr"]=asm["_bitshift64Lshr"];var _bitshift64Shl=Module["_bitshift64Shl"]=asm["_bitshift64Shl"];var _emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=Module["_emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0"]=asm["_emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0"];var _emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=Module["_emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1"]=asm["_emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1"];var _emscripten_bind_AttributeOctahedronTransform___destroy___0=Module["_emscripten_bind_AttributeOctahedronTransform___destroy___0"]=asm["_emscripten_bind_AttributeOctahedronTransform___destroy___0"];var _emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=Module["_emscripten_bind_AttributeOctahedronTransform_quantization_bits_0"]=asm["_emscripten_bind_AttributeOctahedronTransform_quantization_bits_0"];var _emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=Module["_emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0"]=asm["_emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0"];var _emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=Module["_emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1"]=asm["_emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1"];var _emscripten_bind_AttributeQuantizationTransform___destroy___0=Module["_emscripten_bind_AttributeQuantizationTransform___destroy___0"]=asm["_emscripten_bind_AttributeQuantizationTransform___destroy___0"];var _emscripten_bind_AttributeQuantizationTransform_min_value_1=Module["_emscripten_bind_AttributeQuantizationTransform_min_value_1"]=asm["_emscripten_bind_AttributeQuantizationTransform_min_value_1"];var _emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=Module["_emscripten_bind_AttributeQuantizationTransform_quantization_bits_0"]=asm["_emscripten_bind_AttributeQuantizationTransform_quantization_bits_0"];var _emscripten_bind_AttributeQuantizationTransform_range_0=Module["_emscripten_bind_AttributeQuantizationTransform_range_0"]=asm["_emscripten_bind_AttributeQuantizationTransform_range_0"];var _emscripten_bind_AttributeTransformData_AttributeTransformData_0=Module["_emscripten_bind_AttributeTransformData_AttributeTransformData_0"]=asm["_emscripten_bind_AttributeTransformData_AttributeTransformData_0"];var _emscripten_bind_AttributeTransformData___destroy___0=Module["_emscripten_bind_AttributeTransformData___destroy___0"]=asm["_emscripten_bind_AttributeTransformData___destroy___0"];var _emscripten_bind_AttributeTransformData_transform_type_0=Module["_emscripten_bind_AttributeTransformData_transform_type_0"]=asm["_emscripten_bind_AttributeTransformData_transform_type_0"];var _emscripten_bind_DecoderBuffer_DecoderBuffer_0=Module["_emscripten_bind_DecoderBuffer_DecoderBuffer_0"]=asm["_emscripten_bind_DecoderBuffer_DecoderBuffer_0"];var _emscripten_bind_DecoderBuffer_Init_2=Module["_emscripten_bind_DecoderBuffer_Init_2"]=asm["_emscripten_bind_DecoderBuffer_Init_2"];var _emscripten_bind_DecoderBuffer___destroy___0=Module["_emscripten_bind_DecoderBuffer___destroy___0"]=asm["_emscripten_bind_DecoderBuffer___destroy___0"];var _emscripten_bind_Decoder_DecodeBufferToMesh_2=Module["_emscripten_bind_Decoder_DecodeBufferToMesh_2"]=asm["_emscripten_bind_Decoder_DecodeBufferToMesh_2"];var _emscripten_bind_Decoder_DecodeBufferToPointCloud_2=Module["_emscripten_bind_Decoder_DecodeBufferToPointCloud_2"]=asm["_emscripten_bind_Decoder_DecodeBufferToPointCloud_2"];var _emscripten_bind_Decoder_Decoder_0=Module["_emscripten_bind_Decoder_Decoder_0"]=asm["_emscripten_bind_Decoder_Decoder_0"];var _emscripten_bind_Decoder_GetAttributeByUniqueId_2=Module["_emscripten_bind_Decoder_GetAttributeByUniqueId_2"]=asm["_emscripten_bind_Decoder_GetAttributeByUniqueId_2"];var _emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=Module["_emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3"]=asm["_emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3"];var _emscripten_bind_Decoder_GetAttributeFloat_3=Module["_emscripten_bind_Decoder_GetAttributeFloat_3"]=asm["_emscripten_bind_Decoder_GetAttributeFloat_3"];var _emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=Module["_emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3"]=asm["_emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3"];var _emscripten_bind_Decoder_GetAttributeIdByName_2=Module["_emscripten_bind_Decoder_GetAttributeIdByName_2"]=asm["_emscripten_bind_Decoder_GetAttributeIdByName_2"];var _emscripten_bind_Decoder_GetAttributeId_2=Module["_emscripten_bind_Decoder_GetAttributeId_2"]=asm["_emscripten_bind_Decoder_GetAttributeId_2"];var _emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=Module["_emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3"]=asm["_emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3"];var _emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=Module["_emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3"]=asm["_emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3"];var _emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=Module["_emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3"]=asm["_emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3"];var _emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=Module["_emscripten_bind_Decoder_GetAttributeIntForAllPoints_3"]=asm["_emscripten_bind_Decoder_GetAttributeIntForAllPoints_3"];var _emscripten_bind_Decoder_GetAttributeMetadata_2=Module["_emscripten_bind_Decoder_GetAttributeMetadata_2"]=asm["_emscripten_bind_Decoder_GetAttributeMetadata_2"];var _emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=Module["_emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3"]=asm["_emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3"];var _emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=Module["_emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3"]=asm["_emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3"];var _emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=Module["_emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3"]=asm["_emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3"];var _emscripten_bind_Decoder_GetAttribute_2=Module["_emscripten_bind_Decoder_GetAttribute_2"]=asm["_emscripten_bind_Decoder_GetAttribute_2"];var _emscripten_bind_Decoder_GetEncodedGeometryType_1=Module["_emscripten_bind_Decoder_GetEncodedGeometryType_1"]=asm["_emscripten_bind_Decoder_GetEncodedGeometryType_1"];var _emscripten_bind_Decoder_GetFaceFromMesh_3=Module["_emscripten_bind_Decoder_GetFaceFromMesh_3"]=asm["_emscripten_bind_Decoder_GetFaceFromMesh_3"];var _emscripten_bind_Decoder_GetMetadata_1=Module["_emscripten_bind_Decoder_GetMetadata_1"]=asm["_emscripten_bind_Decoder_GetMetadata_1"];var _emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=Module["_emscripten_bind_Decoder_GetTriangleStripsFromMesh_2"]=asm["_emscripten_bind_Decoder_GetTriangleStripsFromMesh_2"];var _emscripten_bind_Decoder_SkipAttributeTransform_1=Module["_emscripten_bind_Decoder_SkipAttributeTransform_1"]=asm["_emscripten_bind_Decoder_SkipAttributeTransform_1"];var _emscripten_bind_Decoder___destroy___0=Module["_emscripten_bind_Decoder___destroy___0"]=asm["_emscripten_bind_Decoder___destroy___0"];var _emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=Module["_emscripten_bind_DracoFloat32Array_DracoFloat32Array_0"]=asm["_emscripten_bind_DracoFloat32Array_DracoFloat32Array_0"];var _emscripten_bind_DracoFloat32Array_GetValue_1=Module["_emscripten_bind_DracoFloat32Array_GetValue_1"]=asm["_emscripten_bind_DracoFloat32Array_GetValue_1"];var _emscripten_bind_DracoFloat32Array___destroy___0=Module["_emscripten_bind_DracoFloat32Array___destroy___0"]=asm["_emscripten_bind_DracoFloat32Array___destroy___0"];var _emscripten_bind_DracoFloat32Array_size_0=Module["_emscripten_bind_DracoFloat32Array_size_0"]=asm["_emscripten_bind_DracoFloat32Array_size_0"];var _emscripten_bind_DracoInt16Array_DracoInt16Array_0=Module["_emscripten_bind_DracoInt16Array_DracoInt16Array_0"]=asm["_emscripten_bind_DracoInt16Array_DracoInt16Array_0"];var _emscripten_bind_DracoInt16Array_GetValue_1=Module["_emscripten_bind_DracoInt16Array_GetValue_1"]=asm["_emscripten_bind_DracoInt16Array_GetValue_1"];var _emscripten_bind_DracoInt16Array___destroy___0=Module["_emscripten_bind_DracoInt16Array___destroy___0"]=asm["_emscripten_bind_DracoInt16Array___destroy___0"];var _emscripten_bind_DracoInt16Array_size_0=Module["_emscripten_bind_DracoInt16Array_size_0"]=asm["_emscripten_bind_DracoInt16Array_size_0"];var _emscripten_bind_DracoInt32Array_DracoInt32Array_0=Module["_emscripten_bind_DracoInt32Array_DracoInt32Array_0"]=asm["_emscripten_bind_DracoInt32Array_DracoInt32Array_0"];var _emscripten_bind_DracoInt32Array_GetValue_1=Module["_emscripten_bind_DracoInt32Array_GetValue_1"]=asm["_emscripten_bind_DracoInt32Array_GetValue_1"];var _emscripten_bind_DracoInt32Array___destroy___0=Module["_emscripten_bind_DracoInt32Array___destroy___0"]=asm["_emscripten_bind_DracoInt32Array___destroy___0"];var _emscripten_bind_DracoInt32Array_size_0=Module["_emscripten_bind_DracoInt32Array_size_0"]=asm["_emscripten_bind_DracoInt32Array_size_0"];var _emscripten_bind_DracoInt8Array_DracoInt8Array_0=Module["_emscripten_bind_DracoInt8Array_DracoInt8Array_0"]=asm["_emscripten_bind_DracoInt8Array_DracoInt8Array_0"];var _emscripten_bind_DracoInt8Array_GetValue_1=Module["_emscripten_bind_DracoInt8Array_GetValue_1"]=asm["_emscripten_bind_DracoInt8Array_GetValue_1"];var _emscripten_bind_DracoInt8Array___destroy___0=Module["_emscripten_bind_DracoInt8Array___destroy___0"]=asm["_emscripten_bind_DracoInt8Array___destroy___0"];var _emscripten_bind_DracoInt8Array_size_0=Module["_emscripten_bind_DracoInt8Array_size_0"]=asm["_emscripten_bind_DracoInt8Array_size_0"];var _emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=Module["_emscripten_bind_DracoUInt16Array_DracoUInt16Array_0"]=asm["_emscripten_bind_DracoUInt16Array_DracoUInt16Array_0"];var _emscripten_bind_DracoUInt16Array_GetValue_1=Module["_emscripten_bind_DracoUInt16Array_GetValue_1"]=asm["_emscripten_bind_DracoUInt16Array_GetValue_1"];var _emscripten_bind_DracoUInt16Array___destroy___0=Module["_emscripten_bind_DracoUInt16Array___destroy___0"]=asm["_emscripten_bind_DracoUInt16Array___destroy___0"];var _emscripten_bind_DracoUInt16Array_size_0=Module["_emscripten_bind_DracoUInt16Array_size_0"]=asm["_emscripten_bind_DracoUInt16Array_size_0"];var _emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=Module["_emscripten_bind_DracoUInt32Array_DracoUInt32Array_0"]=asm["_emscripten_bind_DracoUInt32Array_DracoUInt32Array_0"];var _emscripten_bind_DracoUInt32Array_GetValue_1=Module["_emscripten_bind_DracoUInt32Array_GetValue_1"]=asm["_emscripten_bind_DracoUInt32Array_GetValue_1"];var _emscripten_bind_DracoUInt32Array___destroy___0=Module["_emscripten_bind_DracoUInt32Array___destroy___0"]=asm["_emscripten_bind_DracoUInt32Array___destroy___0"];var _emscripten_bind_DracoUInt32Array_size_0=Module["_emscripten_bind_DracoUInt32Array_size_0"]=asm["_emscripten_bind_DracoUInt32Array_size_0"];var _emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=Module["_emscripten_bind_DracoUInt8Array_DracoUInt8Array_0"]=asm["_emscripten_bind_DracoUInt8Array_DracoUInt8Array_0"];var _emscripten_bind_DracoUInt8Array_GetValue_1=Module["_emscripten_bind_DracoUInt8Array_GetValue_1"]=asm["_emscripten_bind_DracoUInt8Array_GetValue_1"];var _emscripten_bind_DracoUInt8Array___destroy___0=Module["_emscripten_bind_DracoUInt8Array___destroy___0"]=asm["_emscripten_bind_DracoUInt8Array___destroy___0"];var _emscripten_bind_DracoUInt8Array_size_0=Module["_emscripten_bind_DracoUInt8Array_size_0"]=asm["_emscripten_bind_DracoUInt8Array_size_0"];var _emscripten_bind_GeometryAttribute_GeometryAttribute_0=Module["_emscripten_bind_GeometryAttribute_GeometryAttribute_0"]=asm["_emscripten_bind_GeometryAttribute_GeometryAttribute_0"];var _emscripten_bind_GeometryAttribute___destroy___0=Module["_emscripten_bind_GeometryAttribute___destroy___0"]=asm["_emscripten_bind_GeometryAttribute___destroy___0"];var _emscripten_bind_Mesh_Mesh_0=Module["_emscripten_bind_Mesh_Mesh_0"]=asm["_emscripten_bind_Mesh_Mesh_0"];var _emscripten_bind_Mesh___destroy___0=Module["_emscripten_bind_Mesh___destroy___0"]=asm["_emscripten_bind_Mesh___destroy___0"];var _emscripten_bind_Mesh_num_attributes_0=Module["_emscripten_bind_Mesh_num_attributes_0"]=asm["_emscripten_bind_Mesh_num_attributes_0"];var _emscripten_bind_Mesh_num_faces_0=Module["_emscripten_bind_Mesh_num_faces_0"]=asm["_emscripten_bind_Mesh_num_faces_0"];var _emscripten_bind_Mesh_num_points_0=Module["_emscripten_bind_Mesh_num_points_0"]=asm["_emscripten_bind_Mesh_num_points_0"];var _emscripten_bind_MetadataQuerier_GetDoubleEntry_2=Module["_emscripten_bind_MetadataQuerier_GetDoubleEntry_2"]=asm["_emscripten_bind_MetadataQuerier_GetDoubleEntry_2"];var _emscripten_bind_MetadataQuerier_GetEntryName_2=Module["_emscripten_bind_MetadataQuerier_GetEntryName_2"]=asm["_emscripten_bind_MetadataQuerier_GetEntryName_2"];var _emscripten_bind_MetadataQuerier_GetIntEntry_2=Module["_emscripten_bind_MetadataQuerier_GetIntEntry_2"]=asm["_emscripten_bind_MetadataQuerier_GetIntEntry_2"];var _emscripten_bind_MetadataQuerier_GetStringEntry_2=Module["_emscripten_bind_MetadataQuerier_GetStringEntry_2"]=asm["_emscripten_bind_MetadataQuerier_GetStringEntry_2"];var _emscripten_bind_MetadataQuerier_HasDoubleEntry_2=Module["_emscripten_bind_MetadataQuerier_HasDoubleEntry_2"]=asm["_emscripten_bind_MetadataQuerier_HasDoubleEntry_2"];var _emscripten_bind_MetadataQuerier_HasEntry_2=Module["_emscripten_bind_MetadataQuerier_HasEntry_2"]=asm["_emscripten_bind_MetadataQuerier_HasEntry_2"];var _emscripten_bind_MetadataQuerier_HasIntEntry_2=Module["_emscripten_bind_MetadataQuerier_HasIntEntry_2"]=asm["_emscripten_bind_MetadataQuerier_HasIntEntry_2"];var _emscripten_bind_MetadataQuerier_HasStringEntry_2=Module["_emscripten_bind_MetadataQuerier_HasStringEntry_2"]=asm["_emscripten_bind_MetadataQuerier_HasStringEntry_2"];var _emscripten_bind_MetadataQuerier_MetadataQuerier_0=Module["_emscripten_bind_MetadataQuerier_MetadataQuerier_0"]=asm["_emscripten_bind_MetadataQuerier_MetadataQuerier_0"];var _emscripten_bind_MetadataQuerier_NumEntries_1=Module["_emscripten_bind_MetadataQuerier_NumEntries_1"]=asm["_emscripten_bind_MetadataQuerier_NumEntries_1"];var _emscripten_bind_MetadataQuerier___destroy___0=Module["_emscripten_bind_MetadataQuerier___destroy___0"]=asm["_emscripten_bind_MetadataQuerier___destroy___0"];var _emscripten_bind_Metadata_Metadata_0=Module["_emscripten_bind_Metadata_Metadata_0"]=asm["_emscripten_bind_Metadata_Metadata_0"];var _emscripten_bind_Metadata___destroy___0=Module["_emscripten_bind_Metadata___destroy___0"]=asm["_emscripten_bind_Metadata___destroy___0"];var _emscripten_bind_PointAttribute_GetAttributeTransformData_0=Module["_emscripten_bind_PointAttribute_GetAttributeTransformData_0"]=asm["_emscripten_bind_PointAttribute_GetAttributeTransformData_0"];var _emscripten_bind_PointAttribute_PointAttribute_0=Module["_emscripten_bind_PointAttribute_PointAttribute_0"]=asm["_emscripten_bind_PointAttribute_PointAttribute_0"];var _emscripten_bind_PointAttribute___destroy___0=Module["_emscripten_bind_PointAttribute___destroy___0"]=asm["_emscripten_bind_PointAttribute___destroy___0"];var _emscripten_bind_PointAttribute_attribute_type_0=Module["_emscripten_bind_PointAttribute_attribute_type_0"]=asm["_emscripten_bind_PointAttribute_attribute_type_0"];var _emscripten_bind_PointAttribute_byte_offset_0=Module["_emscripten_bind_PointAttribute_byte_offset_0"]=asm["_emscripten_bind_PointAttribute_byte_offset_0"];var _emscripten_bind_PointAttribute_byte_stride_0=Module["_emscripten_bind_PointAttribute_byte_stride_0"]=asm["_emscripten_bind_PointAttribute_byte_stride_0"];var _emscripten_bind_PointAttribute_data_type_0=Module["_emscripten_bind_PointAttribute_data_type_0"]=asm["_emscripten_bind_PointAttribute_data_type_0"];var _emscripten_bind_PointAttribute_normalized_0=Module["_emscripten_bind_PointAttribute_normalized_0"]=asm["_emscripten_bind_PointAttribute_normalized_0"];var _emscripten_bind_PointAttribute_num_components_0=Module["_emscripten_bind_PointAttribute_num_components_0"]=asm["_emscripten_bind_PointAttribute_num_components_0"];var _emscripten_bind_PointAttribute_size_0=Module["_emscripten_bind_PointAttribute_size_0"]=asm["_emscripten_bind_PointAttribute_size_0"];var _emscripten_bind_PointAttribute_unique_id_0=Module["_emscripten_bind_PointAttribute_unique_id_0"]=asm["_emscripten_bind_PointAttribute_unique_id_0"];var _emscripten_bind_PointCloud_PointCloud_0=Module["_emscripten_bind_PointCloud_PointCloud_0"]=asm["_emscripten_bind_PointCloud_PointCloud_0"];var _emscripten_bind_PointCloud___destroy___0=Module["_emscripten_bind_PointCloud___destroy___0"]=asm["_emscripten_bind_PointCloud___destroy___0"];var _emscripten_bind_PointCloud_num_attributes_0=Module["_emscripten_bind_PointCloud_num_attributes_0"]=asm["_emscripten_bind_PointCloud_num_attributes_0"];var _emscripten_bind_PointCloud_num_points_0=Module["_emscripten_bind_PointCloud_num_points_0"]=asm["_emscripten_bind_PointCloud_num_points_0"];var _emscripten_bind_Status___destroy___0=Module["_emscripten_bind_Status___destroy___0"]=asm["_emscripten_bind_Status___destroy___0"];var _emscripten_bind_Status_code_0=Module["_emscripten_bind_Status_code_0"]=asm["_emscripten_bind_Status_code_0"];var _emscripten_bind_Status_error_msg_0=Module["_emscripten_bind_Status_error_msg_0"]=asm["_emscripten_bind_Status_error_msg_0"];var _emscripten_bind_Status_ok_0=Module["_emscripten_bind_Status_ok_0"]=asm["_emscripten_bind_Status_ok_0"];var _emscripten_bind_VoidPtr___destroy___0=Module["_emscripten_bind_VoidPtr___destroy___0"]=asm["_emscripten_bind_VoidPtr___destroy___0"];var _emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=Module["_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM"]=asm["_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM"];var _emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=Module["_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM"]=asm["_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM"];var _emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=Module["_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM"]=asm["_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM"];var _emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=Module["_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM"]=asm["_emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM"];var _emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=Module["_emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE"]=asm["_emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE"];var _emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=Module["_emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD"]=asm["_emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD"];var _emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=Module["_emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH"]=asm["_emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH"];var _emscripten_enum_draco_GeometryAttribute_Type_COLOR=Module["_emscripten_enum_draco_GeometryAttribute_Type_COLOR"]=asm["_emscripten_enum_draco_GeometryAttribute_Type_COLOR"];var _emscripten_enum_draco_GeometryAttribute_Type_GENERIC=Module["_emscripten_enum_draco_GeometryAttribute_Type_GENERIC"]=asm["_emscripten_enum_draco_GeometryAttribute_Type_GENERIC"];var _emscripten_enum_draco_GeometryAttribute_Type_INVALID=Module["_emscripten_enum_draco_GeometryAttribute_Type_INVALID"]=asm["_emscripten_enum_draco_GeometryAttribute_Type_INVALID"];var _emscripten_enum_draco_GeometryAttribute_Type_NORMAL=Module["_emscripten_enum_draco_GeometryAttribute_Type_NORMAL"]=asm["_emscripten_enum_draco_GeometryAttribute_Type_NORMAL"];var _emscripten_enum_draco_GeometryAttribute_Type_POSITION=Module["_emscripten_enum_draco_GeometryAttribute_Type_POSITION"]=asm["_emscripten_enum_draco_GeometryAttribute_Type_POSITION"];var _emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=Module["_emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD"]=asm["_emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD"];var _emscripten_enum_draco_StatusCode_ERROR=Module["_emscripten_enum_draco_StatusCode_ERROR"]=asm["_emscripten_enum_draco_StatusCode_ERROR"];var _emscripten_enum_draco_StatusCode_INVALID_PARAMETER=Module["_emscripten_enum_draco_StatusCode_INVALID_PARAMETER"]=asm["_emscripten_enum_draco_StatusCode_INVALID_PARAMETER"];var _emscripten_enum_draco_StatusCode_IO_ERROR=Module["_emscripten_enum_draco_StatusCode_IO_ERROR"]=asm["_emscripten_enum_draco_StatusCode_IO_ERROR"];var _emscripten_enum_draco_StatusCode_OK=Module["_emscripten_enum_draco_StatusCode_OK"]=asm["_emscripten_enum_draco_StatusCode_OK"];var _emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=Module["_emscripten_enum_draco_StatusCode_UNKNOWN_VERSION"]=asm["_emscripten_enum_draco_StatusCode_UNKNOWN_VERSION"];var _emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=Module["_emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION"]=asm["_emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION"];var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=asm["_emscripten_get_global_libc"];var _emscripten_replace_memory=Module["_emscripten_replace_memory"]=asm["_emscripten_replace_memory"];var _free=Module["_free"]=asm["_free"];var _i64Add=Module["_i64Add"]=asm["_i64Add"];var _i64Subtract=Module["_i64Subtract"]=asm["_i64Subtract"];var _llvm_bswap_i32=Module["_llvm_bswap_i32"]=asm["_llvm_bswap_i32"];var _malloc=Module["_malloc"]=asm["_malloc"];var _memcpy=Module["_memcpy"]=asm["_memcpy"];var _memmove=Module["_memmove"]=asm["_memmove"];var _memset=Module["_memset"]=asm["_memset"];var _sbrk=Module["_sbrk"]=asm["_sbrk"];var establishStackSpace=Module["establishStackSpace"]=asm["establishStackSpace"];var getTempRet0=Module["getTempRet0"]=asm["getTempRet0"];var runPostSets=Module["runPostSets"]=asm["runPostSets"];var setTempRet0=Module["setTempRet0"]=asm["setTempRet0"];var setThrew=Module["setThrew"]=asm["setThrew"];var stackAlloc=Module["stackAlloc"]=asm["stackAlloc"];var stackRestore=Module["stackRestore"]=asm["stackRestore"];var stackSave=Module["stackSave"]=asm["stackSave"];var dynCall_ii=Module["dynCall_ii"]=asm["dynCall_ii"];var dynCall_iii=Module["dynCall_iii"]=asm["dynCall_iii"];var dynCall_iiii=Module["dynCall_iiii"]=asm["dynCall_iiii"];var dynCall_iiiiiii=Module["dynCall_iiiiiii"]=asm["dynCall_iiiiiii"];var dynCall_v=Module["dynCall_v"]=asm["dynCall_v"];var dynCall_vi=Module["dynCall_vi"]=asm["dynCall_vi"];var dynCall_vii=Module["dynCall_vii"]=asm["dynCall_vii"];var dynCall_viii=Module["dynCall_viii"]=asm["dynCall_viii"];var dynCall_viiii=Module["dynCall_viiii"]=asm["dynCall_viiii"];var dynCall_viiiii=Module["dynCall_viiiii"]=asm["dynCall_viiiii"];var dynCall_viiiiii=Module["dynCall_viiiiii"]=asm["dynCall_viiiiii"];Runtime.stackAlloc=Module["stackAlloc"];Runtime.stackSave=Module["stackSave"];Runtime.stackRestore=Module["stackRestore"];Runtime.establishStackSpace=Module["establishStackSpace"];Runtime.setTempRet0=Module["setTempRet0"];Runtime.getTempRet0=Module["getTempRet0"];Module["asm"]=asm;if(memoryInitializer){if(typeof Module["locateFile"]==="function"){memoryInitializer=Module["locateFile"](memoryInitializer)}else if(Module["memoryInitializerPrefixURL"]){memoryInitializer=Module["memoryInitializerPrefixURL"]+memoryInitializer}if(ENVIRONMENT_IS_NODE||ENVIRONMENT_IS_SHELL){var data=Module["readBinary"](memoryInitializer);HEAPU8.set(data,Runtime.GLOBAL_BASE)}else{addRunDependency("memory initializer");var applyMemoryInitializer=(function(data){if(data.byteLength)data=new Uint8Array(data);HEAPU8.set(data,Runtime.GLOBAL_BASE);if(Module["memoryInitializerRequest"])delete Module["memoryInitializerRequest"].response;removeRunDependency("memory initializer")});function doBrowserLoad(){Module["readAsync"](memoryInitializer,applyMemoryInitializer,(function(){throw"could not load memory initializer "+memoryInitializer}))}var memoryInitializerBytes=tryParseAsDataURI(memoryInitializer);if(memoryInitializerBytes){applyMemoryInitializer(memoryInitializerBytes.buffer)}else if(Module["memoryInitializerRequest"]){function useRequest(){var request=Module["memoryInitializerRequest"];var response=request.response;if(request.status!==200&&request.status!==0){var data=tryParseAsDataURI(Module["memoryInitializerRequestURL"]);if(data){response=data.buffer}else{console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+request.status+", retrying "+memoryInitializer);doBrowserLoad();return}}applyMemoryInitializer(response)}if(Module["memoryInitializerRequest"].response){setTimeout(useRequest,0)}else{Module["memoryInitializerRequest"].addEventListener("load",useRequest)}}else{doBrowserLoad()}}}Module["then"]=(function(func){if(Module["calledRun"]){func(Module)}else{var old=Module["onRuntimeInitialized"];Module["onRuntimeInitialized"]=(function(){if(old)old();func(Module)})}return Module});function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;var preloadStartTime=null;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};function run(args){args=args||Module["arguments"];if(preloadStartTime===null)preloadStartTime=Date.now();if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]){return}if(Module["noExitRuntime"]){}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status)}if(ENVIRONMENT_IS_NODE){process["exit"](status)}Module["quit"](status,new ExitStatus(status))}Module["exit"]=exit;var abortDecorators=[];function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;var extra="\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";var output="abort("+what+") at "+stackTrace()+extra;if(abortDecorators){abortDecorators.forEach((function(decorator){output=decorator(output,what)}))}throw output}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();function WrapperObject(){}WrapperObject.prototype=Object.create(WrapperObject.prototype);WrapperObject.prototype.constructor=WrapperObject;WrapperObject.prototype.__class__=WrapperObject;WrapperObject.__cache__={};Module["WrapperObject"]=WrapperObject;function getCache(__class__){return(__class__||WrapperObject).__cache__}Module["getCache"]=getCache;function wrapPointer(ptr,__class__){var cache=getCache(__class__);var ret=cache[ptr];if(ret)return ret;ret=Object.create((__class__||WrapperObject).prototype);ret.ptr=ptr;return cache[ptr]=ret}Module["wrapPointer"]=wrapPointer;function castObject(obj,__class__){return wrapPointer(obj.ptr,__class__)}Module["castObject"]=castObject;Module["NULL"]=wrapPointer(0);function destroy(obj){if(!obj["__destroy__"])throw"Error: Cannot destroy object. (Did you create it yourself?)";obj["__destroy__"]();delete getCache(obj.__class__)[obj.ptr]}Module["destroy"]=destroy;function compare(obj1,obj2){return obj1.ptr===obj2.ptr}Module["compare"]=compare;function getPointer(obj){return obj.ptr}Module["getPointer"]=getPointer;function getClass(obj){return obj.__class__}Module["getClass"]=getClass;var ensureCache={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:(function(){if(ensureCache.needed){for(var i=0;i=ensureCache.size){assert(len>0);ensureCache.needed+=len;ret=Module["_malloc"](len);ensureCache.temps.push(ret)}else{ret=ensureCache.buffer+ensureCache.pos;ensureCache.pos+=len}return ret}),copy:(function(array,view,offset){var offsetShifted=offset;var bytes=view.BYTES_PER_ELEMENT;switch(bytes){case 2:offsetShifted>>=1;break;case 4:offsetShifted>>=2;break;case 8:offsetShifted>>=3;break}for(var i=0;i