Skip to content
Browse files

use zpipe

  • Loading branch information...
1 parent b0a0a7d commit f5370d7dcf2ec0b6c9bd3b8bd96731e674b7fafc @ukyo committed Dec 7, 2012
View
2 .gitignore
@@ -1,2 +0,0 @@
-.pydevproject
-.project
View
3 .gitmodules
@@ -0,0 +1,3 @@
+[submodule "src/zpipe"]
+ path = src/zpipe
+ url = git://github.com/ukyo/zpipe.git
View
211 build/jsziptools.min.js
0 additions, 211 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
0 example/example.html → examples/example.html
File renamed without changes.
View
0 example/zip_filenames.html → examples/zip_filenames.html
File renamed without changes.
View
10 src/algorithms/deflate.js
@@ -3,22 +3,14 @@ jsziptools.js
utils.js
*/
-function deflate(input, level) {
- var Module = {
- 'input': input
- };
- arguments = ['' + (typeof level === 'undefined' ? 6 : level)];
-function a(b){throw b}var da=void 0,k=!0,fa=null,m=!1;Module.preRun=(function(){ta("/","input",Module.input,k,k);ta("/","output",fa,k,k);Module.ret=(function(){return ua("/output").a})});try{this.Module=Module}catch(Ia){this.Module=Module={}}var eb="object"===typeof process,ob="object"===typeof window,Ib="function"===typeof importScripts,Jb=!ob&&!eb&&!Ib;if(eb){Module.print=(function(b){process.stdout.write(b+"\n")});Module.printErr=(function(b){process.stderr.write(b+"\n")});var Mb=require("fs"),Qb=require("path");Module.read=(function(b){var b=Qb.normalize(b),f=Mb.readFileSync(b).toString();!f&&b!=Qb.resolve(b)&&(b=path.join(__dirname,"..","src",b),f=Mb.readFileSync(b).toString());return f});Module.load=(function(b){Rb(read(b))});Module.arguments||(Module.arguments=process.argv.slice(2))}else{Jb?(Module.print=print,Module.printErr=printErr,Module.read="undefined"!=typeof read?read:(function(b){snarf(b)}),Module.arguments||("undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:"undefined"!=typeof arguments&&(Module.arguments=arguments))):ob?(Module.print||(Module.print=(function(b){console.log(b)})),Module.printErr||(Module.printErr=(function(b){console.log(b)})),Module.read=(function(b){var f=new XMLHttpRequest;f.open("GET",b,m);f.send(fa);return f.responseText}),Module.arguments||"undefined"!=typeof arguments&&(Module.arguments=arguments)):Ib?Module.load=importScripts:a("Unknown runtime environment. Where are we?")}function Rb(b){eval.call(fa,b)}"undefined"==!Module.load&&Module.read&&(Module.load=(function(b){Rb(Module.read(b))}));Module.printErr||(Module.printErr=(function(){}));Module.print||(Module.print=Module.printErr);Module.arguments||(Module.arguments=[]);function Sb(b){var f=Tb;Tb+=b;Tb=Tb+3>>2<<2;return f}function Ub(b){var f=Vb;Vb+=b;Vb=Vb+3>>2<<2;if(Vb>=Wb){for(;Wb<=Vb;){Wb=2*Wb+4095>>12<<12}var b=n,e=new ArrayBuffer(Wb);n=new Int8Array(e);o=new Int16Array(e);D=new Int32Array(e);H=new Uint8Array(e);K=new Uint16Array(e);N=new Uint32Array(e);Xb=new Float32Array(e);Yb=new Float64Array(e);n.set(b)}return f}var Zb=4,$b={};function ac(b){Module.print(b+":\n"+Error().stack);a("Assertion: "+b)}function bc(b,f){b||ac("Assertion failed: "+f)}var cc=this;function dc(b,f,e,d){var c=0;try{var g=eval("_"+b)}catch(h){try{g=cc.Module["_"+b]}catch(i){}}bc(g,"Cannot call unknown function "+b+" (perhaps LLVM optimizations or closure removed it?)");var j=0,b=d?d.map((function(b){if("string"==e[j++]){c||(c=Tb);var d=Sb(b.length+1);jc(b,d);b=d}return b})):[],f=(function(b,c){return"string"==c?kc(b):b})(g.apply(fa,b),f);c&&(Tb=c);return f}Module.ccall=dc;Module.cwrap=(function(b,f,e){return(function(){return dc(b,f,e,Array.prototype.slice.call(arguments))})});function lc(b,f,e){e=e||"i8";"*"===e[e.length-1]&&(e="i32");switch(e){case"i1":n[b]=f;break;case"i8":n[b]=f;break;case"i16":o[b>>1]=f;break;case"i32":D[b>>2]=f;break;case"i64":D[b>>2]=f;break;case"float":Xb[b>>2]=f;break;case"double":mc[0]=f;D[b>>2]=nc[0];D[b+4>>2]=nc[1];break;default:ac("invalid type for setValue: "+e)}}Module.setValue=lc;Module.getValue=(function(b,f){f=f||"i8";"*"===f[f.length-1]&&(f="i32");switch(f){case"i1":return n[b];case"i8":return n[b];case"i16":return o[b>>1];case"i32":return D[b>>2];case"i64":return D[b>>2];case"float":return Xb[b>>2];case"double":return nc[0]=D[b>>2],nc[1]=D[b+4>>2],mc[0];default:ac("invalid type for setValue: "+f)}return fa});var oc=1,O=2;Module.ALLOC_NORMAL=0;Module.ALLOC_STACK=oc;Module.ALLOC_STATIC=O;function P(b,f,e){var d,c;"number"===typeof b?(d=k,c=b):(d=m,c=b.length);var g="string"===typeof f?f:fa,e=[uc,Sb,Ub][e===da?O:e](Math.max(c,g?1:f.length));if(d){return vc(e,c),e}for(var h=0;h<c;){var i=b[h];"function"===typeof i&&(i=$b.Q(i));d=g||f[h];0===d?h++:("i64"==d&&(d="i32"),lc(e+h,i,d),1==Zb?d=1:(i={"%i1":1,"%i8":1,"%i16":2,"%i32":4,"%i64":8,"%float":4,"%double":8}["%"+d],i||("*"==d[d.length-1]?i=Zb:"i"==d[0]&&(d=parseInt(d.substr(1)),bc(0==d%8),i=d/8)),d=i),h+=d)}return e}Module.allocate=P;function kc(b,f){for(var e="undefined"==typeof f,d="",c=0,g,h=String.fromCharCode(0);;){g=String.fromCharCode(H[b+c]);if(e&&g==h){break}d+=g;c+=1;if(!e&&c==f){break}}return d}Module.Pointer_stringify=kc;Module.Array_stringify=(function(b){for(var f="",e=0;e<b.length;e++){f+=String.fromCharCode(b[e])}return f});var wc,xc=4096,n,H,o,K,D,N,Xb,Yb,Tb,yc,Vb,zc=Module.TOTAL_STACK||5242880,Wb=Module.TOTAL_MEMORY||10485760;bc(!!Int32Array&&!!Float64Array&&!!(new Int32Array(1)).subarray&&!!(new Int32Array(1)).set,"Cannot fallback to non-typed array case: Code is too specialized");var Ac=new ArrayBuffer(Wb);n=new Int8Array(Ac);o=new Int16Array(Ac);D=new Int32Array(Ac);H=new Uint8Array(Ac);K=new Uint16Array(Ac);N=new Uint32Array(Ac);Xb=new Float32Array(Ac);Yb=new Float64Array(Ac);D[0]=255;bc(255===H[0]&&0===H[3],"Typed arrays 2 must be run on a little-endian system");var Cc=Bc("(null)");Vb=Cc.length;for(var Dc=0;Dc<Cc.length;Dc++){n[Dc]=Cc[Dc]}Module.HEAP=da;Module.HEAP8=n;Module.HEAP16=o;Module.HEAP32=D;Module.HEAPU8=H;Module.HEAPU16=K;Module.HEAPU32=N;Module.HEAPF32=Xb;Module.HEAPF64=Yb;yc=(Tb=4*Math.ceil(Vb/4))+zc;var Ec=8*Math.ceil(yc/8);n.subarray(Ec);var nc=D.subarray(Ec>>2);Xb.subarray(Ec>>2);var mc=Yb.subarray(Ec>>3);yc=Ec+8;Vb=yc+4095>>12<<12;function Fc(b){for(;0<b.length;){var f=b.shift(),e=f.q;"number"===typeof e&&(e=wc[e]);e(f.K===da?fa:f.K)}}var Gc=[],Hc=[],Ic=[];function Jc(b,f){return Array.prototype.slice.call(n.subarray(b,b+f))}Module.Array_copy=Jc;Module.TypedArray_copy=(function(b,f,e){e===da&&(e=0);for(var d=new Uint8Array(f-e),c=e;c<f;++c){d[c-e]=n[b+c]}return d.buffer});function Kc(b){for(var f=0;n[b+f];){f++}return f}Module.String_len=Kc;Module.String_copy=(function(b,f){var e=Kc(b);f&&e++;var d=Jc(b,e);f&&(d[e-1]=0);return d});function Bc(b,f,e){var d=[],c=0;e===da&&(e=b.length);for(;c<e;){var g=b.charCodeAt(c);255<g&&(g&=255);d.push(g);c+=1}f||d.push(0);return d}Module.intArrayFromString=Bc;Module.intArrayToString=(function(b){for(var f=[],e=0;e<b.length;e++){var d=b[e];255<d&&(d&=255);f.push(String.fromCharCode(d))}return f.join("")});function jc(b,f,e){for(var d=0;d<b.length;){var c=b.charCodeAt(d);255<c&&(c&=255);n[f+d]=c;d+=1}e||(n[f+d]=0)}Module.writeStringToMemory=jc;var Q=[],Sc=0;function Tc(b,f){var e,d,c=0==(b|0);a:do{if(c){var g=-2}else{g=b+24|0;D[g>>2]=0;d=(b+32|0)>>2;var h=D[d];if(0==(h|0)){D[d]=2;D[b+40>>2]=0;var i=2}else{i=h}h=b+36|0;0==(D[h>>2]|0)&&(D[h>>2]=4);h=-1==(f|0)?6:f;if(9<h>>>0){g=-2}else{e=(b+40|0)>>2;i=wc[i](D[e],1,5828);if(0!=(i|0)){D[b+28>>2]=i;D[i>>2]=b;D[(i+24|0)>>2]=0;D[(i+28|0)>>2]=0;D[(i+48|0)>>2]=15;var j=i+44|0;D[j>>2]=32768;D[(i+52|0)>>2]=32767;D[(i+80|0)>>2]=15;var l=i+76|0;D[l>>2]=32768;D[(i+84|0)>>2]=32767;D[(i+88|0)>>2]=5;var q=wc[D[d]](D[e],32768,2),t=i+56|0;D[t>>2]=q;q=wc[D[d]](D[e],D[j>>2],2);j=i+64|0;D[j>>2]=q;q=wc[D[d]](D[e],D[l>>2],2);l=i+68|0;D[l>>2]=q;D[(i+5824|0)>>2]=0;q=i+5788|0;D[q>>2]=16384;e=d=wc[D[d]](D[e],16384,4);D[(i+8|0)>>2]=d;q=N[q>>2];D[(i+12|0)>>2]=q<<2;t=0==(D[t>>2]|0);do{if(!t&&0!=(D[j>>2]|0)&&!(0==(D[l>>2]|0)|0==(d|0))){D[(i+5796|0)>>2]=(q>>>1<<1)+e|0;D[(i+5784|0)>>2]=d+3*q|0;D[(i+132|0)>>2]=h;D[(i+136|0)>>2]=0;n[i+36|0]=8;c=b;g=Uc(c);0==(g|0)&&Vc(D[c+28>>2]);break a}}while(0);D[(i+4|0)>>2]=666;D[g>>2]=Q.G|0;Wc(b)}g=-4}}}while(0);return g}Tc.X=1;function Wc(b){var f,e,d=b>>2;if(0!=(b|0)&&(e=(b+28|0)>>2,f=D[e],0!=(f|0))){var c=D[f+4>>2];if(666==(c|0)||113==(c|0)||103==(c|0)||91==(c|0)||73==(c|0)||69==(c|0)||42==(c|0)){c=D[f+8>>2];0!=(c|0)&&(wc[D[d+9]](D[d+10],c),f=D[e]);c=D[f+68>>2];0==(c|0)?c=f:(wc[D[d+9]](D[d+10],c),c=D[e]);var g=D[c+64>>2];f=(b+36|0)>>2;0!=(g|0)&&(wc[D[f]](D[d+10],g),c=D[e]);d=D[c+56>>2];0==(d|0)?(d=c,b=b+40|0):(b=b+40|0,wc[D[f]](D[b>>2],d),d=D[e]);wc[D[f]](D[b>>2],d);D[e]=0}}}Wc.X=1;function Uc(b){var f=b>>2;if(0==(b|0)){f=-2}else{if(b=D[f+7],0==(b|0)){f=-2}else{if(0==(D[f+8]|0)){f=-2}else{if(0==(D[f+9]|0)){f=-2}else{D[f+5]=0;D[f+2]=0;D[f+6]=0;D[f+11]=2;D[(b+20|0)>>2]=0;D[(b+16|0)>>2]=D[b+8>>2];var e=b+24|0,d=D[e>>2];0>(d|0)&&(d=-d|0,D[e>>2]=d);e=d;D[(b+4|0)>>2]=0!=(e|0)?42:113;e=2==(e|0)?Xc(0,0,0):0;D[f+12]=e;D[(b+40|0)>>2]=0;D[b+2840>>2]=b+148|0;D[b+2848>>2]=Yc;D[b+2852>>2]=b+2440|0;D[b+2860>>2]=Zc;D[b+2864>>2]=b+2684|0;D[b+2872>>2]=$c;o[b+5816>>1]=0;D[b+5820>>2]=0;ad(b);f=0}}}}return f}Uc.X=1;function Vc(b){var f=b>>2;D[f+15]=D[f+11]<<1;var e=b+76|0,b=b+68|0;o[D[b>>2]+(D[e>>2]-1<<1)>>1]=0;vc(D[b>>2],(D[e>>2]<<1)-2|0);e=N[f+33];D[f+32]=K[(bd+2>>1)+(6*e|0)]&65535;D[f+35]=K[(bd>>1)+(6*e|0)]&65535;D[f+36]=K[(bd+4>>1)+(6*e|0)]&65535;D[f+31]=K[(bd+6>>1)+(6*e|0)]&65535;D[f+27]=0;D[f+23]=0;D[f+29]=0;D[f+1453]=0;D[f+30]=2;D[f+24]=2;D[f+26]=0;D[f+18]=0}Vc.X=1;function cd(b,f){var e,d,c,g,h,i,j,l,q,t,v,p,w,r,x,u,B,z,A,E,C,s,y,G,F,L,X,$,Y,R,S,M=b>>2,I,la=0==(b|0);a:do{if(la){var aa=-2}else{var J=N[M+7];S=J>>2;if(!(0==(J|0)|5<f>>>0)){var pb=0==(D[M+3]|0);do{if(!pb&&!(0==(D[M]|0)&&0!=(D[M+1]|0))){R=(J+4|0)>>2;var ba=N[R],oa=4==(f|0);if(666!=(ba|0)|oa){Y=(b+16|0)>>2;if(0==(D[Y]|0)){D[M+6]=Q.n|0;aa=-5;break a}D[S]=b;$=(J+40|0)>>2;var Ja=D[$];D[$]=f;if(42==(ba|0)){if(2!=(D[S+6]|0)){var qb=(D[S+12]<<12)-30720|0;if(1<(D[S+34]|0)){var rb=0}else{var Wa=D[S+33],rb=2>(Wa|0)?0:6>(Wa|0)?64:6==(Wa|0)?128:192}var sb=rb|qb,Xa=J+108|0,tb=0==(D[Xa>>2]|0)?sb:sb|32,ca=tb|31-(tb>>>0)%31;D[R]=113;dd(J,ca);X=(b+48|0)>>2;0!=(D[Xa>>2]|0)&&(dd(J,N[X]>>>16),dd(J,D[X]&65535));D[X]=0;var ea=D[R];I=32}else{var va=Xc(0,0,0);L=(b+48|0)>>2;D[L]=va;F=(J+20|0)>>2;var ha=D[F];D[F]=ha+1|0;G=(J+8|0)>>2;n[D[G]+ha|0]=31;var Ka=D[F];D[F]=Ka+1|0;n[D[G]+Ka|0]=-117;var wa=D[F];D[F]=wa+1|0;n[D[G]+wa|0]=8;var ub=J+28|0;y=ub>>2;var pa=N[y];s=pa>>2;if(0==(pa|0)){var zb=D[F];D[F]=zb+1|0;n[D[G]+zb|0]=0;var Ya=D[F];D[F]=Ya+1|0;n[D[G]+Ya|0]=0;var fb=D[F];D[F]=fb+1|0;n[D[G]+fb|0]=0;var La=D[F];D[F]=La+1|0;n[D[G]+La|0]=0;var vb=D[F];D[F]=vb+1|0;n[D[G]+vb|0]=0;var xa=D[S+33],ma=9==(xa|0)?2:1<(D[S+34]|0)?4:2>(xa|0)?4:0,Ma=D[F];D[F]=Ma+1|0;n[D[G]+Ma|0]=ma;var gb=D[F];D[F]=gb+1|0;n[D[G]+gb|0]=3;D[R]=113;I=93}else{var ya=(0!=(D[s+11]|0)?2:0)|0!=(D[s]|0)&1|(0==(D[s+4]|0)?0:4)|(0==(D[s+7]|0)?0:8)|(0==(D[s+9]|0)?0:16),ia=D[F];D[F]=ia+1|0;n[D[G]+ia|0]=ya;var Za=D[D[y]+4>>2]&255,hb=D[F];D[F]=hb+1|0;n[D[G]+hb|0]=Za;var Na=N[D[y]+4>>2]>>>8&255,Oa=N[F];D[F]=Oa+1|0;n[D[G]+Oa|0]=Na;var wb=N[D[y]+4>>2]>>>16&255,xb=N[F];D[F]=xb+1|0;n[D[G]+xb|0]=wb;var W=N[D[y]+4>>2]>>>24&255,na=N[F];D[F]=na+1|0;n[D[G]+na|0]=W;var ja=D[S+33],Ab=9==(ja|0)?2:1<(D[S+34]|0)?4:2>(ja|0)?4:0,yb=D[F];D[F]=yb+1|0;n[D[G]+yb|0]=Ab;var Bb=D[D[y]+12>>2]&255,ib=D[F];D[F]=ib+1|0;n[D[G]+ib|0]=Bb;var za=N[y];if(0==(D[za+16>>2]|0)){var Aa=za}else{var Ba=D[za+20>>2]&255,jb=D[F];D[F]=jb+1|0;n[D[G]+jb|0]=Ba;var Kb=N[D[y]+20>>2]>>>8&255,Pa=N[F];D[F]=Pa+1|0;n[D[G]+Pa|0]=Kb;Aa=D[y]}if(0!=(D[Aa+44>>2]|0)){var Ca=Xc(D[L],D[G],D[F]);D[L]=Ca}D[S+8]=0;D[R]=69;var ga=ub;C=ga>>2;I=34}}}else{ea=ba,I=32}if(32==I){if(69!=(ea|0)){var kb=ea;I=51}else{ga=J+28|0,C=ga>>2,I=34}}do{if(34==I){var $a=N[C];if(0==(D[$a+16>>2]|0)){D[R]=73;var lb=$a;I=53}else{E=(J+20|0)>>2;A=(J+32|0)>>2;var Da=J+12|0;z=(b+48|0)>>2;B=(J+8|0)>>2;for(var qa=D[E],Qa=D[A],Ea=$a;;){if(Qa>>>0>=(D[Ea+20>>2]&65535)>>>0){var ab=qa,ra=Ea;break}var Fa=N[E];if((Fa|0)==(D[Da>>2]|0)){if(0!=(D[Ea+44>>2]|0)&Fa>>>0>qa>>>0){var Ga=Xc(D[z],D[B]+qa|0,Fa-qa|0);D[z]=Ga}ed(b);var ka=N[E];if((ka|0)==(D[Da>>2]|0)){ab=ka;ra=D[C];break}var bb=ka,sa=ka,mb=D[A],nb=D[C]}else{bb=qa,sa=Fa,mb=Qa,nb=Ea}var Cb=n[D[nb+16>>2]+mb|0];D[E]=sa+1|0;n[D[B]+sa|0]=Cb;var Ra=D[A]+1|0;D[A]=Ra;qa=bb;Qa=Ra;Ea=D[C]}if(0==(D[ra+44>>2]|0)){var Sa=ra}else{var cb=N[E];if(cb>>>0>ab>>>0){var Nb=Xc(D[z],D[B]+ab|0,cb-ab|0);D[z]=Nb;Sa=D[C]}else{Sa=ra}}(D[A]|0)==(D[Sa+20>>2]|0)?(D[A]=0,D[R]=73,lb=Sa,I=53):(kb=D[R],I=51)}}}while(0);if(51==I){if(73!=(kb|0)){var Db=kb;I=68}else{lb=D[S+7],I=53}}do{if(53==I){var Ha=J+28|0;u=Ha>>2;if(0==(D[lb+28>>2]|0)){D[R]=91;var Ta=Ha;x=Ta>>2;I=70}else{r=(J+20|0)>>2;var Eb=D[r],Ua=J+12|0;w=(b+48|0)>>2;p=(J+8|0)>>2;v=(J+32|0)>>2;for(var Fb=Eb,Va=Eb;;){if((Va|0)==(D[Ua>>2]|0)){if(0!=(D[D[u]+44>>2]|0)&Va>>>0>Fb>>>0){var Lb=Xc(D[w],D[p]+Fb|0,Va-Fb|0);D[w]=Lb}ed(b);var Gb=N[r];if((Gb|0)==(D[Ua>>2]|0)){var db=1,Hb=Gb;break}var Ob=Gb,Pb=Gb}else{Ob=Fb,Pb=Va}var ec=D[v];D[v]=ec+1|0;var fc=H[D[D[u]+28>>2]+ec|0],pc=fc&255;D[r]=Pb+1|0;n[D[p]+Pb|0]=fc;if(0==fc<<24>>24){db=pc;Hb=Ob;break}Fb=Ob;Va=D[r]}if(0!=(D[D[u]+44>>2]|0)){var gc=N[r];if(gc>>>0>Hb>>>0){var Lc=Xc(D[w],D[p]+Hb|0,gc-Hb|0);D[w]=Lc}}0==(db|0)?(D[v]=0,D[R]=91,Ta=Ha,x=Ta>>2,I=70):(Db=D[R],I=68)}}}while(0);if(68==I){if(91!=(Db|0)){var Id=Db;I=85}else{Ta=J+28|0,x=Ta>>2,I=70}}do{if(70==I){if(0==(D[D[x]+36>>2]|0)){D[R]=103;var Mc=Ta;I=87}else{t=(J+20|0)>>2;var Jd=D[t],Kd=J+12|0;q=(b+48|0)>>2;l=(J+8|0)>>2;for(var Ld=J+32|0,hc=Jd,ic=Jd;;){if((ic|0)==(D[Kd>>2]|0)){if(0!=(D[D[x]+44>>2]|0)&ic>>>0>hc>>>0){var Xe=Xc(D[q],D[l]+hc|0,ic-hc|0);D[q]=Xe}ed(b);var qc=N[t];if((qc|0)==(D[Kd>>2]|0)){var Md=1,rc=qc;break}var Nc=qc,Oc=qc}else{Nc=hc,Oc=ic}var Nd=D[Ld>>2];D[Ld>>2]=Nd+1|0;var Pc=H[D[D[x]+36>>2]+Nd|0],Ye=Pc&255;D[t]=Oc+1|0;n[D[l]+Oc|0]=Pc;if(0==Pc<<24>>24){Md=Ye;rc=Nc;break}hc=Nc;ic=D[t]}if(0!=(D[D[x]+44>>2]|0)){var Od=N[t];if(Od>>>0>rc>>>0){var Ze=Xc(D[q],D[l]+rc|0,Od-rc|0);D[q]=Ze}}0==(Md|0)?(D[R]=103,Mc=Ta,I=87):(Id=D[R],I=85)}}}while(0);85==I&&(103!=(Id|0)?I=93:(Mc=J+28|0,I=87));if(87==I){if(0==(D[D[Mc>>2]+44>>2]|0)){D[R]=113}else{j=(J+20|0)>>2;var Pd=N[j],Qd=J+12|0,Rd=N[Qd>>2];if((Pd+2|0)>>>0>Rd>>>0){ed(b);var sc=D[j],Sd=D[Qd>>2]}else{sc=Pd,Sd=Rd}if((sc+2|0)>>>0<=Sd>>>0){i=(b+48|0)>>2;var $e=D[i]&255;D[j]=sc+1|0;var Td=J+8|0;n[D[Td>>2]+sc|0]=$e;var af=N[i]>>>8&255,Ud=N[j];D[j]=Ud+1|0;n[D[Td>>2]+Ud|0]=af;var bf=Xc(0,0,0);D[i]=bf;D[R]=113}}}h=(J+20|0)>>2;var cf=0==(D[h]|0);do{if(cf){var Qc=D[M+1];if(0!=(Qc|0)){var Rc=Qc;break}if(((f<<1)-(4<(f|0)?9:0)|0)>((Ja<<1)-(4<(Ja|0)?9:0)|0)|oa){Rc=Qc;break}D[M+6]=Q.n|0;aa=-5;break a}ed(b);if(0==(D[Y]|0)){D[$]=-1;aa=0;break a}Rc=D[M+1]}while(0);var Vd=666==(D[R]|0),Wd=0==(Rc|0);do{if(Vd){if(Wd){I=104;break}D[M+6]=Q.n|0;aa=-5;break a}I=Wd?104:107}while(0);do{if(104==I){if(0!=(D[S+29]|0)){I=107}else{if(0==(f|0)){aa=0;break a}I=Vd?123:107}}}while(0);do{if(107==I){var Xd=D[S+34],tc=2==(Xd|0)?fd(J,f):3==(Xd|0)?gd(J,f):wc[D[(bd+8>>2)+(3*D[S+33]|0)]](J,f);2>(tc-2|0)>>>0?D[R]=666:I=113;if(2==(tc|0)||0==(tc|0)){if(0!=(D[Y]|0)){aa=0;break a}D[$]=-1;aa=0;break a}else{if(1==(tc|0)){if(1==(f|0)){hd(J)}else{if(5!=(f|0)&&(id(J,0,0,0),3==(f|0))){var be=J+76|0,ce=J+68|0;o[D[ce>>2]+(D[be>>2]-1<<1)>>1]=0;vc(D[ce>>2],(D[be>>2]<<1)-2|0);0==(D[S+29]|0)&&(D[S+27]=0,D[S+23]=0,D[S+1453]=0)}}ed(b);if(0==(D[Y]|0)){D[$]=-1;aa=0;break a}}}}}while(0);if(!oa){aa=0;break a}g=(J+24|0)>>2;var de=D[g];if(1>(de|0)){aa=1;break a}c=(b+48|0)>>2;var ee=N[c];if(2==(de|0)){var df=ee&255,fe=D[h];D[h]=fe+1|0;d=(J+8|0)>>2;n[D[d]+fe|0]=df;var ef=N[c]>>>8&255,ge=N[h];D[h]=ge+1|0;n[D[d]+ge|0]=ef;var ff=N[c]>>>16&255,he=N[h];D[h]=he+1|0;n[D[d]+he|0]=ff;var gf=N[c]>>>24&255,ie=N[h];D[h]=ie+1|0;n[D[d]+ie|0]=gf;e=(b+8|0)>>2;var hf=D[e]&255,je=D[h];D[h]=je+1|0;n[D[d]+je|0]=hf;var jf=N[e]>>>8&255,ke=N[h];D[h]=ke+1|0;n[D[d]+ke|0]=jf;var kf=N[e]>>>16&255,le=N[h];D[h]=le+1|0;n[D[d]+le|0]=kf;var lf=N[e]>>>24&255,me=N[h];D[h]=me+1|0;n[D[d]+me|0]=lf}else{dd(J,ee>>>16),dd(J,D[c]&65535)}ed(b);var ne=D[g];0<(ne|0)&&(D[g]=-ne|0);aa=0==(D[h]|0)&1;break a}}}while(0);D[M+6]=Q.C|0}aa=-2}}while(0);return aa}cd.X=1;function dd(b,f){var e;e=(b+20|0)>>2;var d=N[e];D[e]=d+1|0;var c=b+8|0;n[D[c>>2]+d|0]=f>>>8&255;d=D[e];D[e]=d+1|0;n[D[c>>2]+d|0]=f&255}function ed(b){var f,e,d,c,g=N[b+28>>2];jd(g);c=(g+20|0)>>2;f=N[c];d=(b+16|0)>>2;var h=N[d],h=f>>>0>h>>>0?h:f;if(0!=(h|0)){e=(b+12|0)>>2;var i=D[e];f=(g+16|0)>>2;kd(i,D[f],h);D[e]=D[e]+h|0;D[f]=D[f]+h|0;b=b+20|0;D[b>>2]=D[b>>2]+h|0;D[d]=D[d]-h|0;d=D[c];D[c]=d-h|0;(d|0)==(h|0)&&(D[f]=D[g+8>>2])}}function fd(b,f){var e,d,c,g,h,i;i=(b+116|0)>>2;var j=b+96|0;h=(b+108|0)>>2;g=(b+56|0)>>2;c=(b+5792|0)>>2;var l=b+5796|0,q=b+5784|0,t=b+5788|0;d=(b+92|0)>>2;e=(b|0)>>2;a:for(;;){var v=0==(D[i]|0);do{if(v&&(ld(b),0==(D[i]|0))){if(0==(f|0)){var p=0;break a}D[b+5812>>2]=0;if(4==(f|0)){c=D[d];md(b,-1<(c|0)?D[g]+c|0:0,D[h]-c|0,1);D[d]=D[h];ed(D[e]);p=0==(D[D[e]+16>>2]|0)?2:3;break a}if(0!=(D[c]|0)&&(c=D[d],md(b,-1<(c|0)?D[g]+c|0:0,D[h]-c|0,0),D[d]=D[h],ed(D[e]),0==(D[D[e]+16>>2]|0))){p=0;break a}p=1;break a}}while(0);D[j>>2]=0;v=H[D[g]+D[h]|0];o[D[l>>2]+(D[c]<<1)>>1]=0;var w=D[c];D[c]=w+1|0;n[D[q>>2]+w|0]=v;v=((v&255)<<2)+b+148|0;o[v>>1]=o[v>>1]+1&65535;w=(D[c]|0)==(D[t>>2]-1|0);D[i]=D[i]-1|0;v=D[h]+1|0;D[h]=v;if(w&&(w=D[d],md(b,-1<(w|0)?D[g]+w|0:0,v-w|0,0),D[d]=D[h],ed(D[e]),0==(D[D[e]+16>>2]|0))){p=0;break}}return p}fd.X=1;function gd(b,f){var e,d,c,g,h,i,j,l;j=(b+116|0)>>2;var q=0==(f|0);i=(b+96|0)>>2;h=(b+108|0)>>2;g=(b+5792|0)>>2;var t=b+5796|0,v=b+5784|0,p=b+2440|0,w=b+5788|0;c=(b+56|0)>>2;d=(b+92|0)>>2;e=(b|0)>>2;a:for(;;){var r=N[j],x=259>r>>>0;do{if(x){ld(b);l=N[j];if(259>l>>>0&q){var u=0;break a}if(0!=(l|0)){if(D[i]=0,2<l>>>0){z=l,l=8}else{var B=D[h];l=23}}else{D[b+5812>>2]=0;if(4==(f|0)){g=D[d];md(b,-1<(g|0)?D[c]+g|0:0,D[h]-g|0,1);D[d]=D[h];ed(D[e]);u=0==(D[D[e]+16>>2]|0)?2:3;break a}if(0!=(D[g]|0)&&(g=D[d],md(b,-1<(g|0)?D[c]+g|0:0,D[h]-g|0,0),D[d]=D[h],ed(D[e]),0==(D[D[e]+16>>2]|0))){u=0;break a}u=1;break a}}else{D[i]=0;var z=r;l=8}}while(0);do{if(8==l){if(r=N[h],0==(r|0)){B=0,l=23}else{if(l=N[c],x=H[l+(r-1)|0],x<<24>>24!=n[l+r|0]<<24>>24){B=r,l=23}else{if(x<<24>>24!=n[r+(l+1)|0]<<24>>24){B=r,l=23}else{var A=r+(l+2)|0;if(x<<24>>24!=n[A]<<24>>24){B=r,l=23}else{for(l=r+(l+258)|0;;){var E=A+1|0;if(x<<24>>24!=n[E]<<24>>24){var C=E;break}E=A+2|0;if(x<<24>>24!=n[E]<<24>>24){C=E;break}E=A+3|0;if(x<<24>>24!=n[E]<<24>>24){C=E;break}E=A+4|0;if(x<<24>>24!=n[E]<<24>>24){C=E;break}E=A+5|0;if(x<<24>>24!=n[E]<<24>>24){C=E;break}E=A+6|0;if(x<<24>>24!=n[E]<<24>>24){C=E;break}E=A+7|0;if(x<<24>>24!=n[E]<<24>>24){C=E;break}A=A+8|0;if(!(x<<24>>24==n[A]<<24>>24&A>>>0<l>>>0)){C=A;break}}x=C-l+258|0;x=x>>>0>z>>>0?z:x;D[i]=x;if(2<x>>>0){var s=x+253|0,y=s&255;o[D[t>>2]+(D[g]<<1)>>1]=1;r=D[g];D[g]=r+1|0;n[D[v>>2]+r|0]=y;s=((H[Q.i+(s&255)|0]&255|256)+1<<2)+b+148|0;o[s>>1]=o[s>>1]+1&65535;o[p>>1]=o[p>>1]+1&65535;s=(D[g]|0)==(D[w>>2]-1|0)&1;y=D[i];D[j]=D[j]-y|0;y=D[h]+y|0;D[h]=y;D[i]=0;l=24}else{B=r,l=23}}}}}}}while(0);23==l&&(s=H[D[c]+B|0],o[D[t>>2]+(D[g]<<1)>>1]=0,y=D[g],D[g]=y+1|0,n[D[v>>2]+y|0]=s,s=((s&255)<<2)+b+148|0,o[s>>1]=o[s>>1]+1&65535,s=(D[g]|0)==(D[w>>2]-1|0)&1,D[j]=D[j]-1|0,y=D[h]+1|0,D[h]=y);if(0!=(s|0)&&(r=D[d],md(b,-1<(r|0)?D[c]+r|0:0,y-r|0,0),D[d]=D[h],ed(D[e]),0==(D[D[e]+16>>2]|0))){u=0;break}}return u}gd.X=1;function ld(b){var f,e,d,c,g,h,i=b+44|0,j=N[i>>2],l=b+60|0;h=(b+116|0)>>2;g=(b+108|0)>>2;var q=j-262|0,t=b|0;c=(b+56|0)>>2;d=(b+5812|0)>>2;e=(b+72|0)>>2;var v=b+88|0,p=b+84|0;f=(b+68|0)>>2;for(var w=b+52|0,r=b+64|0,x=b+112|0,u=b+92|0,B=b+76|0,z=D[h],A=j;;){var E=N[g],z=D[l>>2]-z-E|0;if(E>>>0<(q+A|0)>>>0){A=z}else{A=N[c];kd(A,A+j|0,j);D[x>>2]=D[x>>2]-j|0;D[g]=D[g]-j|0;D[u>>2]=D[u>>2]-j|0;A=E=D[B>>2];for(E=(E<<1)+D[f]|0;;){var E=E-2|0,C=K[E>>1]&65535;o[E>>1]=C>>>0<j>>>0?0:C-j&65535;A=A-1|0;if(0==(A|0)){break}}A=j;for(E=(j<<1)+D[r>>2]|0;!(E=E-2|0,C=K[E>>1]&65535,o[E>>1]=C>>>0<j>>>0?0:C-j&65535,A=A-1|0,0==(A|0));){}A=z+j|0}z=D[t>>2];if(0==(D[z+4>>2]|0)){break}var E=D[c]+D[h]+D[g]|0,C=da,C=z+4|0,s=N[C>>2],A=s>>>0>A>>>0?A:s;0==(A|0)?z=0:(D[C>>2]=s-A|0,C=(z|0)>>2,kd(E,D[C],A),s=D[D[z+28>>2]+24>>2],1==(s|0)?(E=z+48|0,D[E>>2]=D[E>>2]):2==(s|0)&&(s=z+48|0,E=Xc(D[s>>2],E,A),D[s>>2]=E),D[C]=D[C]+A|0,z=z+8|0,D[z>>2]=D[z>>2]+A|0,z=A);z=D[h]+z|0;D[h]=z;A=N[d];E=2<(z+A|0)>>>0;a:do{if(E){var C=D[g]-A|0,s=N[c],y=H[s+C|0]&255;D[e]=y;D[e]=(H[C+(s+1)|0]&255^y<<D[v>>2])&D[p>>2];s=A;for(y=z;;){if(0==(s|0)){var G=y;break a}s=(H[D[c]+C+2|0]&255^D[e]<<D[v>>2])&D[p>>2];D[e]=s;o[D[r>>2]+((D[w>>2]&C)<<1)>>1]=o[D[f]+(s<<1)>>1];o[D[f]+(D[e]<<1)>>1]=C&65535;s=D[d]-1|0;D[d]=s;y=N[h];if(3>(y+s|0)>>>0){G=y;break a}C=C+1|0}}else{G=z}}while(0);if(262<=G>>>0){break}if(0==(D[D[t>>2]+4>>2]|0)){break}z=G;A=D[i>>2]}b=(b+5824|0)>>2;f=N[b];l=N[l>>2];f>>>0<l>>>0&&(g=D[h]+D[g]|0,f>>>0<g>>>0?(h=l-g|0,h=258<h>>>0?258:h,vc(D[c]+g|0,h),D[b]=h+g|0):(g=g+258|0,f>>>0<g>>>0&&(g=g-f|0,h=l-f|0,g=g>>>0>h>>>0?h:g,vc(D[c]+f|0,g),D[b]=D[b]+g|0)))}ld.X=1;function nd(b,f){var e,d,c,g,h;e=D[b+12>>2]-5|0;var i=65535>e>>>0?e:65535;h=(b+116|0)>>2;g=(b+108|0)>>2;c=(b+92|0)>>2;var j=b+44|0;d=(b+56|0)>>2;e=(b|0)>>2;a:for(;;){var l=N[h],q=2>l>>>0;do{if(q){ld(b);var t=N[h];if(0==(t|f|0)){var v=0;break a}if(0==(t|0)){D[b+5812>>2]=0;if(4==(f|0)){v=D[c];md(b,-1<(v|0)?D[d]+v|0:0,D[g]-v|0,1);D[c]=D[g];ed(D[e]);v=0==(D[D[e]+16>>2]|0)?2:3;break a}v=D[g];h=D[c];if((v|0)>(h|0)&&(md(b,-1<(h|0)?D[d]+h|0:0,v-h|0,0),D[c]=D[g],ed(D[e]),0==(D[D[e]+16>>2]|0))){v=0;break a}v=1;break a}}else{t=l}}while(0);q=D[g]+t|0;D[g]=q;D[h]=0;l=N[c];t=l+i|0;if(!(0!=(q|0)&q>>>0<t>>>0)){D[h]=q-t|0;D[g]=t;md(b,-1<(l|0)?D[d]+l|0:0,i,0);D[c]=D[g];ed(D[e]);if(0==(D[D[e]+16>>2]|0)){v=0;break}q=D[g];l=D[c]}q=q-l|0;if(q>>>0>=(D[j>>2]-262|0)>>>0&&(md(b,-1<(l|0)?D[d]+l|0:0,q,0),D[c]=D[g],ed(D[e]),0==(D[D[e]+16>>2]|0))){v=0;break}}return v}nd.X=1;function od(b,f){var e,d,c,g,h,i,j,l,q,t,v,p;v=(b+116|0)>>2;var w=0==(f|0);t=(b+72|0)>>2;q=(b+88|0)>>2;l=(b+108|0)>>2;j=(b+56|0)>>2;i=(b+84|0)>>2;h=(b+68|0)>>2;var r=b+52|0,x=b+64|0,u=b+44|0;g=(b+96|0)>>2;var B=b+112|0;c=(b+5792|0)>>2;var z=b+5796|0,A=b+5784|0,E=b+5788|0,C=b+128|0;d=(b+92|0)>>2;e=(b|0)>>2;a:for(;;){var s=262>N[v]>>>0;do{if(s){ld(b);p=N[v];if(262>p>>>0&w){var y=0;break a}if(0==(p|0)){g=N[l];D[b+5812>>2]=2>g>>>0?g:2;if(4==(f|0)){c=N[d];md(b,-1<(c|0)?D[j]+c|0:0,g-c|0,1);D[d]=D[l];ed(D[e]);y=0==(D[D[e]+16>>2]|0)?2:3;break a}if(0!=(D[c]|0)&&(c=D[d],md(b,-1<(c|0)?D[j]+c|0:0,g-c|0,0),D[d]=D[l],ed(D[e]),0==(D[D[e]+16>>2]|0))){y=0;break a}y=1;break a}else{p=2<p>>>0?6:9}}else{p=6}}while(0);if(6==p){if(s=N[l],p=(H[D[j]+s+2|0]&255^D[t]<<D[q])&D[i],D[t]=p,p=K[D[h]+(p<<1)>>1],o[D[x>>2]+((D[r>>2]&s)<<1)>>1]=p,s=p&65535,o[D[h]+(D[t]<<1)>>1]=D[l]&65535,0==p<<16>>16){p=9}else{if((D[l]-s|0)>>>0>(D[u>>2]-262|0)>>>0){p=9}else{var G=pd(b,s);D[g]=G;p=10}}}9==p&&(G=D[g]);if(2<G>>>0){s=G+253|0;p=D[l]-D[B>>2]&65535;o[D[z>>2]+(D[c]<<1)>>1]=p;var F=D[c];D[c]=F+1|0;n[D[A>>2]+F|0]=s&255;p=p-1&65535;s=((H[Q.i+(s&255)|0]&255|256)+1<<2)+b+148|0;o[s>>1]=o[s>>1]+1&65535;s=p&65535;s=((H[Q.m+(256>(p&65535)?s:(s>>>7)+256|0)|0]&255)<<2)+b+2440|0;o[s>>1]=o[s>>1]+1&65535;s=(D[c]|0)==(D[E>>2]-1|0)&1;p=N[g];F=D[v]-p|0;D[v]=F;if(p>>>0<=N[C>>2]>>>0&2<F>>>0){for(D[g]=p-1|0;!(F=N[l],p=F+1|0,D[l]=p,F=(H[D[j]+F+3|0]&255^D[t]<<D[q])&D[i],D[t]=F,o[D[x>>2]+((D[r>>2]&p)<<1)>>1]=o[D[h]+(F<<1)>>1],o[D[h]+(D[t]<<1)>>1]=D[l]&65535,p=D[g]-1|0,D[g]=p,0==(p|0));){}p=D[l]+1|0;D[l]=p}else{p=D[l]+p|0;D[l]=p;D[g]=0;var F=N[j],L=H[F+p|0]&255;D[t]=L;D[t]=(H[p+(F+1)|0]&255^L<<D[q])&D[i]}}else{s=H[D[j]+D[l]|0],o[D[z>>2]+(D[c]<<1)>>1]=0,p=D[c],D[c]=p+1|0,n[D[A>>2]+p|0]=s,s=((s&255)<<2)+b+148|0,o[s>>1]=o[s>>1]+1&65535,s=(D[c]|0)==(D[E>>2]-1|0)&1,D[v]=D[v]-1|0,p=D[l]+1|0,D[l]=p}if(0!=(s|0)&&(s=D[d],md(b,-1<(s|0)?D[j]+s|0:0,p-s|0,0),D[d]=D[l],ed(D[e]),0==(D[D[e]+16>>2]|0))){y=0;break}}return y}od.X=1;function qd(b,f){var e,d,c,g,h,i,j,l,q,t,v,p,w,r,x,u;x=(b+116|0)>>2;var B=0==(f|0);r=(b+72|0)>>2;var z=b+88|0;w=(b+108|0)>>2;p=(b+56|0)>>2;var A=b+84|0;v=(b+68|0)>>2;var E=b+52|0,C=b+64|0;t=(b+96|0)>>2;q=(b+120|0)>>2;l=(b+112|0)>>2;j=(b+100|0)>>2;i=(b+5792|0)>>2;h=(b+5796|0)>>2;g=(b+5784|0)>>2;var s=b+5788|0;c=(b+104|0)>>2;d=(b+92|0)>>2;e=(b|0)>>2;var y=b+128|0,G=b+44|0,F=b+136|0;a:for(;;){for(var L=D[x];;){L=262>L>>>0;do{if(L){ld(b);u=N[x];if(262>u>>>0&B){var X=0;break a}if(0!=(u|0)){if(2<u>>>0){u=8}else{D[q]=D[t];D[j]=D[l];var $=D[t]=2;u=16}}else{0!=(D[c]|0)&&(j=H[D[p]+(D[w]-1)|0],o[D[h]+(D[i]<<1)>>1]=0,h=D[i],D[i]=h+1|0,n[D[g]+h|0]=j,g=((j&255)<<2)+b+148|0,o[g>>1]=o[g>>1]+1&65535,D[c]=0);c=N[w];D[b+5812>>2]=2>c>>>0?c:2;if(4==(f|0)){i=N[d];md(b,-1<(i|0)?D[p]+i|0:0,c-i|0,1);D[d]=D[w];ed(D[e]);X=0==(D[D[e]+16>>2]|0)?2:3;break a}if(0!=(D[i]|0)&&(i=D[d],md(b,-1<(i|0)?D[p]+i|0:0,c-i|0,0),D[d]=D[w],ed(D[e]),0==(D[D[e]+16>>2]|0))){X=0;break a}X=1;break a}}else{u=8}}while(0);do{if(8==u){u=N[w];L=(H[D[p]+u+2|0]&255^D[r]<<D[z>>2])&D[A>>2];D[r]=L;L=K[D[v]+(L<<1)>>1];o[D[C>>2]+((D[E>>2]&u)<<1)>>1]=L;u=L&65535;o[D[v]+(D[r]<<1)>>1]=D[w]&65535;var Y=N[t];D[q]=Y;D[j]=D[l];D[t]=2;if(0==L<<16>>16){$=2,u=16}else{if(Y>>>0<N[y>>2]>>>0){if((D[w]-u|0)>>>0>(D[G>>2]-262|0)>>>0){$=2}else{if($=pd(b,u),D[t]=$,6>$>>>0){if(1!=(D[F>>2]|0)){if(3!=($|0)){u=16;break}if(4096>=(D[w]-D[l]|0)>>>0){$=3;u=16;break}}$=D[t]=2}}u=16}else{var R=Y,S=2;u=17}}}}while(0);16==u&&(R=D[q],S=$);if(!(3>R>>>0|S>>>0>R>>>0)){break}if(0==(D[c]|0)){D[c]=1,D[w]=D[w]+1|0,L=D[x]-1|0,D[x]=L}else{if(L=H[D[p]+(D[w]-1)|0],o[D[h]+(D[i]<<1)>>1]=0,u=D[i],D[i]=u+1|0,n[D[g]+u|0]=L,L=((L&255)<<2)+b+148|0,o[L>>1]=o[L>>1]+1&65535,(D[i]|0)==(D[s>>2]-1|0)&&(L=D[d],md(b,-1<(L|0)?D[p]+L|0:0,D[w]-L|0,0),D[d]=D[w],ed(D[e])),D[w]=D[w]+1|0,L=D[x]-1|0,D[x]=L,0==(D[D[e]+16>>2]|0)){X=0;break a}}}Y=N[w];L=Y-3+D[x]|0;u=R+253|0;Y=Y+65535-D[j]&65535;o[D[h]+(D[i]<<1)>>1]=Y;var M=D[i];D[i]=M+1|0;n[D[g]+M|0]=u&255;Y=Y-1&65535;u=((H[Q.i+(u&255)|0]&255|256)+1<<2)+b+148|0;o[u>>1]=o[u>>1]+1&65535;u=Y&65535;u=((H[Q.m+(256>(Y&65535)?u:(u>>>7)+256|0)|0]&255)<<2)+b+2440|0;o[u>>1]=o[u>>1]+1&65535;u=D[i];Y=D[s>>2]-1|0;M=D[q];D[x]=1-M+D[x]|0;for(var M=M-2|0,I=D[q]=M;;){var la=N[w],M=la+1|0;D[w]=M;M>>>0>L>>>0?M=I:(I=(H[D[p]+la+3|0]&255^D[r]<<D[z>>2])&D[A>>2],D[r]=I,o[D[C>>2]+((D[E>>2]&M)<<1)>>1]=o[D[v]+(I<<1)>>1],o[D[v]+(D[r]<<1)>>1]=D[w]&65535,M=D[q]);M=M-1|0;D[q]=M;if(0==(M|0)){break}I=M}u=(u|0)==(Y|0);D[c]=0;D[t]=2;L=D[w]+1|0;D[w]=L;if(u&&(u=D[d],md(b,-1<(u|0)?D[p]+u|0:0,L-u|0,0),D[d]=D[w],ed(D[e]),0==(D[D[e]+16>>2]|0))){X=0;break}}return X}qd.X=1;function pd(b,f){var e=b>>2,d=N[e+31],c=N[e+14],g=N[e+27],h=c+g|0,i=N[e+30],j=N[e+36],l=D[e+11]-262|0,l=g>>>0>l>>>0?g-l|0:0,q=D[e+16],t=D[e+13],v=g+(c+258)|0,p=N[e+29],j=j>>>0>p>>>0?p:j,w=b+112|0,r=g+(c+1)|0,x=g+(c+2)|0,u=g+257|0,B=n[c+i+g|0],z=f,e=i>>>0<N[e+35]>>>0?d:d>>>2,d=n[c+(g-1)+i|0];a:for(;;){var A=c+z|0,E=n[c+z+i|0]<<24>>24==B<<24>>24;do{if(E){if(n[c+(i-1)+z|0]<<24>>24!=d<<24>>24){var C=B,s=d,y=i}else{if(n[A]<<24>>24!=n[h]<<24>>24){C=B,s=d,y=i}else{if(n[z+(c+1)|0]<<24>>24!=n[r]<<24>>24){C=B,s=d,y=i}else{C=x;for(s=z+(c+2)|0;;){y=C+1|0;if(n[y]<<24>>24!=n[s+1|0]<<24>>24){var G=y;break}y=C+2|0;if(n[y]<<24>>24!=n[s+2|0]<<24>>24){G=y;break}y=C+3|0;if(n[y]<<24>>24!=n[s+3|0]<<24>>24){G=y;break}y=C+4|0;if(n[y]<<24>>24!=n[s+4|0]<<24>>24){G=y;break}y=C+5|0;if(n[y]<<24>>24!=n[s+5|0]<<24>>24){G=y;break}y=C+6|0;if(n[y]<<24>>24!=n[s+6|0]<<24>>24){G=y;break}y=C+7|0;if(n[y]<<24>>24!=n[s+7|0]<<24>>24){G=y;break}C=C+8|0;s=s+8|0;if(!(n[C]<<24>>24==n[s]<<24>>24&C>>>0<v>>>0)){G=C;break}}s=G-v|0;y=s+258|0;if((y|0)>(i|0)){D[w>>2]=z;if((y|0)>=(j|0)){var F=y;break a}C=n[c+y+g|0];s=n[c+u+s|0]}else{C=B,s=d,y=i}}}}}else{C=B,s=d,y=i}}while(0);z=K[q+((z&t)<<1)>>1]&65535;if(z>>>0<=l>>>0){F=y;break}e=e-1|0;if(0==(e|0)){F=y;break}B=C;d=s;i=y}return F>>>0>p>>>0?p:F}pd.X=1;function ad(b){for(var f=0;!(o[b+(f<<2)+148>>1]=0,f=f+1|0,286==(f|0));){}o[b+2440>>1]=0;o[b+2444>>1]=0;o[b+2448>>1]=0;o[b+2452>>1]=0;o[b+2456>>1]=0;o[b+2460>>1]=0;o[b+2464>>1]=0;o[b+2468>>1]=0;o[b+2472>>1]=0;o[b+2476>>1]=0;o[b+2480>>1]=0;o[b+2484>>1]=0;o[b+2488>>1]=0;o[b+2492>>1]=0;o[b+2496>>1]=0;o[b+2500>>1]=0;o[b+2504>>1]=0;o[b+2508>>1]=0;o[b+2512>>1]=0;o[b+2516>>1]=0;o[b+2520>>1]=0;o[b+2524>>1]=0;o[b+2528>>1]=0;o[b+2532>>1]=0;o[b+2536>>1]=0;o[b+2540>>1]=0;o[b+2544>>1]=0;o[b+2548>>1]=0;o[b+2552>>1]=0;o[b+2556>>1]=0;o[b+2684>>1]=0;o[b+2688>>1]=0;o[b+2692>>1]=0;o[b+2696>>1]=0;o[b+2700>>1]=0;o[b+2704>>1]=0;o[b+2708>>1]=0;o[b+2712>>1]=0;o[b+2716>>1]=0;o[b+2720>>1]=0;o[b+2724>>1]=0;o[b+2728>>1]=0;o[b+2732>>1]=0;o[b+2736>>1]=0;o[b+2740>>1]=0;o[b+2744>>1]=0;o[b+2748>>1]=0;o[b+2752>>1]=0;o[b+2756>>1]=0;o[b+1172>>1]=1;D[b+5804>>2]=0;D[b+5800>>2]=0;D[b+5808>>2]=0;D[b+5792>>2]=0}ad.X=1;function jd(b){var f,e,d;d=(b+5820|0)>>2;f=N[d];if(16==(f|0)){e=(b+5816|0)>>1;var c=o[e]&255;f=(b+20|0)>>2;var g=D[f];D[f]=g+1|0;b=b+8|0;n[D[b>>2]+g|0]=c;c=(K[e]&65535)>>>8&255;g=N[f];D[f]=g+1|0;n[D[b>>2]+g|0]=c;o[e]=0;D[d]=0}else{7<(f|0)&&(f=(b+5816|0)>>1,e=o[f]&255,c=b+20|0,g=D[c>>2],D[c>>2]=g+1|0,n[D[b+8>>2]+g|0]=e,o[f]=(K[f]&65535)>>>8,D[d]=D[d]-8|0)}}function id(b,f,e,d){var c,g;g=(b+5820|0)>>2;c=N[g];var h=d&65535,d=(b+5816|0)>>1,i=K[d]&65535|h<<c;o[d]=i&65535;if(13<(c|0)){c=(b+20|0)>>2;var j=D[c];D[c]=j+1|0;var l=b+8|0;n[D[l>>2]+j|0]=i&255;i=(K[d]&65535)>>>8&255;j=N[c];D[c]=j+1|0;n[D[l>>2]+j|0]=i;c=N[g];o[d]=h>>>((16-c|0)>>>0)&65535;d=c-13|0}else{d=c+3|0}D[g]=d;rd(b,f,e)}function rd(b,f,e){var d;sd(b);d=(b+20|0)>>2;var c=D[d];D[d]=c+1|0;b=(b+8|0)>>2;n[D[b]+c|0]=e&255;c=N[d];D[d]=c+1|0;n[D[b]+c|0]=e>>>8&255;var c=e&65535^65535,g=D[d];D[d]=g+1|0;n[D[b]+g|0]=c&255;g=N[d];D[d]=g+1|0;n[D[b]+g|0]=c>>>8&255;c=0==(e|0);a:do{if(!c){for(var g=f,h=e;;){var h=h-1|0,i=n[g],j=D[d];D[d]=j+1|0;n[D[b]+j|0]=i;if(0==(h|0)){break a}g=g+1|0}}}while(0)}rd.X=1;function hd(b){var f,e,d;d=(b+5820|0)>>2;var c=N[d];e=(b+5816|0)>>1;var g=K[e]&65535|2<<c;f=g&65535;o[e]=f;if(13<(c|0)){f=(b+20|0)>>2;var h=D[f];D[f]=h+1|0;c=b+8|0;n[D[c>>2]+h|0]=g&255;g=(K[e]&65535)>>>8&255;h=N[f];D[f]=h+1|0;n[D[c>>2]+h|0]=g;g=N[d];f=2>>>((16-g|0)>>>0)&65535;o[e]=f;g=g-13|0}else{g=c+3|0}c=f;D[d]=g;9<(g|0)?(f=(b+20|0)>>2,h=D[f],D[f]=h+1|0,g=b+8|0,n[D[g>>2]+h|0]=c&255,c=(K[e]&65535)>>>8&255,h=N[f],D[f]=h+1|0,n[D[g>>2]+h|0]=c,o[e]=0,e=D[d]-9|0):e=g+7|0;D[d]=e;jd(b)}hd.X=1;function md(b,f,e,d){var c,g;g=b>>2;if(0<(D[g+33]|0)){var h=D[g]+44|0;if(2==(D[h>>2]|0)){for(var i=b>>1,j=0,l=-201342849;;){if(32<=(j|0)){c=6;break}if(0!=(l&1|0)&&0!=o[((j<<2)+148>>1)+i]<<16>>16){var q=0;c=12;break}j=j+1|0;l>>>=1}a:do{if(6==c){if(0!=o[i+92]<<16>>16){q=1}else{if(0!=o[i+94]<<16>>16){q=1}else{if(0!=o[i+100]<<16>>16){q=1}else{for(j=32;;){if(256<=(j|0)){q=0;break a}if(0!=o[((j<<2)+148>>1)+i]<<16>>16){q=1;break a}j=j+1|0}}}}}}while(0);D[h>>2]=q}td(b,b+2840|0);td(b,b+2852|0);ud(b,b+148|0,D[b+2844>>2]);ud(b,b+2440|0,D[b+2856>>2]);td(b,b+2864|0);for(h=18;2<(h|0)&&0==o[b+((H[Q.u+h|0]&255)<<2)+2686>>1]<<16>>16;){h=h-1|0}i=b+5800|0;D[i>>2]=3*h+D[i>>2]+17|0;c=(D[g+1450]+10|0)>>>3;q=(D[g+1451]+10|0)>>>3;q>>>0>c>>>0?(i=q,j=c):j=i=q}else{c=e+5|0,h=0,j=i=c}(e+4|0)>>>0>j>>>0|0==(f|0)?(f=(b+5820|0)>>2,c=N[f],q=13<(c|0),4==(D[g+34]|0)|(i|0)==(j|0)?(h=d+2&65535,g=(b+5816|0)>>1,i=K[g]&65535|h<<c,o[g]=i&65535,q?(e=(b+20|0)>>2,q=D[e],D[e]=q+1|0,c=b+8|0,n[D[c>>2]+q|0]=i&255,i=(K[g]&65535)>>>8&255,q=N[e],D[e]=q+1|0,n[D[c>>2]+q|0]=i,e=N[f],o[g]=h>>>((16-e|0)>>>0)&65535,g=e-13|0):g=c+3|0,D[f]=g,vd(b,wd|0,xd|0)):(i=d+4&65535,e=(b+5816|0)>>1,j=K[e]&65535|i<<c,o[e]=j&65535,q?(c=(b+20|0)>>2,l=D[c],D[c]=l+1|0,q=b+8|0,n[D[q>>2]+l|0]=j&255,j=(K[e]&65535)>>>8&255,l=N[c],D[c]=l+1|0,n[D[q>>2]+l|0]=j,c=N[f],o[e]=i>>>((16-c|0)>>>0)&65535,e=c-13|0):e=c+3|0,D[f]=e,yd(b,D[g+711]+1|0,D[g+714]+1|0,h+1|0),vd(b,b+148|0,b+2440|0))):id(b,f,e,d);ad(b);0!=(d|0)&&sd(b)}md.X=1;function vd(b,f,e){var d,c,g,h,i,j,l=f>>1,q=b+5792|0,t=0==(D[q>>2]|0);a:do{if(t){var v=D[b+5820>>2],p=o[b+5816>>1]}else{var w=b+5796|0,r=b+5784|0;j=(b+5820|0)>>2;i=(b+5816|0)>>1;h=(b+20|0)>>2;g=(b+8|0)>>2;for(var x=0;;){var u=K[D[w>>2]+(x<<1)>>1],B=u&65535,z=x+1|0,A=H[D[r>>2]+x|0]&255;if(0==u<<16>>16){var E=K[((A<<2)+2>>1)+l]&65535,C=N[j],s=(C|0)>(16-E|0),y=K[(A<<2>>1)+l]&65535,G=K[i]&65535|y<<C,F=G&65535;o[i]=F;if(s){var L=G&255,X=D[h];D[h]=X+1|0;n[D[g]+X|0]=L;var $=(K[i]&65535)>>>8&255,Y=N[h];D[h]=Y+1|0;n[D[g]+Y|0]=$;var R=N[j],S=y>>>((16-R|0)>>>0)&65535;o[i]=S;var M=E-16+R|0,I=D[j]=M,la=S}else{var aa=C+E|0,I=D[j]=aa,la=F}}else{var J=H[Q.i+A|0]&255,pb=(J|256)+1|0,ba=K[((pb<<2)+2>>1)+l]&65535,oa=N[j],Ja=(oa|0)>(16-ba|0),qb=K[(pb<<2>>1)+l]&65535,rb=K[i]&65535|qb<<oa,Wa=rb&65535;o[i]=Wa;if(Ja){var sb=rb&255,Xa=D[h];D[h]=Xa+1|0;n[D[g]+Xa|0]=sb;var tb=(K[i]&65535)>>>8&255,ca=N[h];D[h]=ca+1|0;n[D[g]+ca|0]=tb;var ea=N[j],va=qb>>>((16-ea|0)>>>0)&65535;o[i]=va;var ha=ba-16+ea|0,Ka=va}else{ha=oa+ba|0,Ka=Wa}D[j]=ha;var wa=N[zd+(J<<2)>>2];if(20>(J-8|0)>>>0){var ub=(ha|0)>(16-wa|0),pa=A-D[Ad+(J<<2)>>2]&65535,zb=pa<<ha|Ka&65535,Ya=zb&65535;o[i]=Ya;if(ub){var fb=zb&255,La=D[h];D[h]=La+1|0;n[D[g]+La|0]=fb;var vb=(K[i]&65535)>>>8&255,xa=N[h];D[h]=xa+1|0;n[D[g]+xa|0]=vb;var ma=N[j],Ma=pa>>>((16-ma|0)>>>0)&65535;o[i]=Ma;var gb=wa-16+ma|0,ya=D[j]=gb,ia=Ma}else{var Za=ha+wa|0,ya=D[j]=Za,ia=Ya}}else{ya=ha,ia=Ka}var hb=B-1|0,Na=H[Q.m+(256>hb>>>0?hb:(hb>>>7)+256|0)|0]&255,Oa=K[e+(Na<<2)+2>>1]&65535,wb=(ya|0)>(16-Oa|0),xb=K[e+(Na<<2)>>1]&65535,W=ia&65535|xb<<ya,na=W&65535;o[i]=na;if(wb){var ja=W&255,Ab=D[h];D[h]=Ab+1|0;n[D[g]+Ab|0]=ja;var yb=(K[i]&65535)>>>8&255,Bb=N[h];D[h]=Bb+1|0;n[D[g]+Bb|0]=yb;var ib=N[j],za=xb>>>((16-ib|0)>>>0)&65535;o[i]=za;var Aa=Oa-16+ib|0,Ba=za}else{Aa=ya+Oa|0,Ba=na}D[j]=Aa;var jb=N[Bd+(Na<<2)>>2];if(26>(Na-4|0)>>>0){var Kb=(Aa|0)>(16-jb|0),Pa=hb-D[Cd+(Na<<2)>>2]&65535,Ca=Pa<<Aa|Ba&65535,ga=Ca&65535;o[i]=ga;if(Kb){var kb=Ca&255,$a=D[h];D[h]=$a+1|0;n[D[g]+$a|0]=kb;var lb=(K[i]&65535)>>>8&255,Da=N[h];D[h]=Da+1|0;n[D[g]+Da|0]=lb;var qa=N[j],Qa=Pa>>>((16-qa|0)>>>0)&65535;o[i]=Qa;var Ea=jb-16+qa|0,I=D[j]=Ea,la=Qa}else{var ab=Aa+jb|0,I=D[j]=ab,la=ga}}else{I=Aa,la=Ba}}if(z>>>0>=N[q>>2]>>>0){v=I;p=la;break a}x=z}}}while(0);var ra=K[l+513]&65535,Fa=b+5820|0,Ga=(v|0)>(16-ra|0),ka=K[l+512]&65535;c=(b+5816|0)>>1;var bb=p&65535|ka<<v;o[c]=bb&65535;if(Ga){var sa=bb&255;d=(b+20|0)>>2;var mb=D[d];D[d]=mb+1|0;var nb=b+8|0;n[D[nb>>2]+mb|0]=sa;var Cb=(K[c]&65535)>>>8&255,Ra=N[d];D[d]=Ra+1|0;n[D[nb>>2]+Ra|0]=Cb;var Sa=N[Fa>>2];o[c]=ka>>>((16-Sa|0)>>>0)&65535;var cb=ra-16+Sa|0}else{cb=v+ra|0}D[Fa>>2]=cb}vd.X=1;function sd(b){var f,e=b+5820|0,d=N[e>>2];if(8<(d|0)){var d=b+5816|0,c=o[d>>1]&255;f=(b+20|0)>>2;var g=D[f];D[f]=g+1|0;b=b+8|0;n[D[b>>2]+g|0]=c;c=(K[d>>1]&65535)>>>8&255;g=N[f];D[f]=g+1|0;n[D[b>>2]+g|0]=c;b=d}else{f=b+5816|0,0<(d|0)&&(d=o[f>>1]&255,c=b+20|0,g=D[c>>2],D[c>>2]=g+1|0,n[D[b+8>>2]+g|0]=d),b=f}o[b>>1]=0;D[e>>2]=0}function td(b,f){var e,d,c,g,h,i,j=f|0,l=N[j>>2];h=l>>1;var q=f+8|0;c=D[q>>2];var t=D[c>>2],v=N[c+12>>2];g=(b+5200|0)>>2;D[g]=0;c=(b+5204|0)>>2;D[c]=573;d=0<(v|0);do{if(d){i=0;for(var p=-1;;){if(0==o[(i<<2>>1)+h]<<16>>16){o[((i<<2)+2>>1)+h]=0;var w=p}else{w=D[g]+1|0,D[g]=w,D[((w<<2)+b+2908|0)>>2]=i,n[b+(i+5208)|0]=0,w=i}i=i+1|0;if((i|0)==(v|0)){break}p=w}i=D[g];if(2>(i|0)){e=i;var r=w;i=3}else{var x=w;i=10}}else{e=0,r=-1,i=3}}while(0);a:do{if(3==i){if(d=(b+5800|0)>>2,w=b+5804|0,0==(t|0)){w=r;for(p=e;;){var u=2>(w|0),B=w+1|0,w=u?B:w,u=u?B:0,p=p+1|0;D[g]=p;D[b+(p<<2)+2908>>2]=u;o[(u<<2>>1)+h]=1;n[b+(u+5208)|0]=0;D[d]=D[d]-1|0;p=D[g];if(2<=(p|0)){x=w;break a}}}else{p=r;for(u=e;;){var B=2>(p|0),z=p+1|0,p=B?z:p,B=B?z:0,u=u+1|0;D[g]=u;D[b+(u<<2)+2908>>2]=B;o[(B<<2>>1)+h]=1;n[b+(B+5208)|0]=0;D[d]=D[d]-1|0;D[w>>2]=D[w>>2]-(K[t+(B<<2)+2>>1]&65535)|0;u=N[g];if(2<=(u|0)){x=p;break a}}}}}while(0);t=f+4|0;D[t>>2]=x;e=D[g];if(1<(e|0)){for(e=(e|0)/2&-1;!(Dd(b,l,e),e=e-1|0,0>=(e|0));){}r=D[g]}else{r=e}e=(b+2912|0)>>2;for(i=r;;){r=N[e];D[g]=i-1|0;D[e]=D[b+(i<<2)+2908>>2];Dd(b,l,1);i=N[e];d=D[c]-1|0;D[c]=d;D[((d<<2)+b+2908|0)>>2]=r;d=D[c]-1|0;D[c]=d;D[((d<<2)+b+2908|0)>>2]=i;o[(v<<2>>1)+h]=o[(i<<2>>1)+h]+o[(r<<2>>1)+h]&65535;d=H[b+(r+5208)|0];w=H[b+(i+5208)|0];n[b+(v+5208)|0]=((d&255)<(w&255)?w:d)+1&255;d=v&65535;o[((i<<2)+2>>1)+h]=d;o[((r<<2)+2>>1)+h]=d;r=v+1|0;D[e]=v;Dd(b,l,1);i=N[g];if(1>=(i|0)){break}v=r}h=D[e];g=D[c]-1|0;D[c]=g;D[((g<<2)+b+2908|0)>>2]=h;Ed(b,D[j>>2],D[t>>2],D[q>>2]);Fd(l,x,b+2876|0)}td.X=1;function yd(b,f,e,d){var c,g,h;h=(b+5820|0)>>2;c=N[h];var i=f+65279&65535;g=(b+5816|0)>>1;var j=K[g]&65535|i<<c,l=j&65535;o[g]=l;if(11<(c|0)){c=(b+20|0)>>2;var q=D[c];D[c]=q+1|0;l=b+8|0;n[D[l>>2]+q|0]=j&255;j=(K[g]&65535)>>>8&255;q=N[c];D[c]=q+1|0;n[D[l>>2]+q|0]=j;c=N[h];i=i>>>((16-c|0)>>>0)&65535;o[g]=i;c=c-11|0;j=i}else{c=c+5|0,j=l}D[h]=c;e=e-1|0;i=e&65535;j=j&65535|i<<c;l=j&65535;o[g]=l;11<(c|0)?(c=(b+20|0)>>2,q=D[c],D[c]=q+1|0,l=b+8|0,n[D[l>>2]+q|0]=j&255,j=(K[g]&65535)>>>8&255,q=N[c],D[c]=q+1|0,n[D[l>>2]+q|0]=j,c=N[h],i=i>>>((16-c|0)>>>0)&65535,o[g]=i,c=c-11|0,j=i):(c=c+5|0,j=l);D[h]=c;i=d+65532&65535;j=j&65535|i<<c;l=j&65535;o[g]=l;12<(c|0)?(c=(b+20|0)>>2,q=D[c],D[c]=q+1|0,l=b+8|0,n[D[l>>2]+q|0]=j&255,j=(K[g]&65535)>>>8&255,q=N[c],D[c]=q+1|0,n[D[l>>2]+q|0]=j,c=N[h],j=i>>>((16-c|0)>>>0)&65535,o[g]=j,i=c-12|0):(i=c+4|0,j=l);D[h]=i;l=0<(d|0);a:do{if(l){c=(b+20|0)>>2;for(var q=b+8|0,t=0,v=i,p=j;;){var w=K[b+((H[Q.u+t|0]&255)<<2)+2686>>1]&65535,r=p&65535|w<<v,p=r&65535;o[g]=p;13<(v|0)?(v=r&255,p=D[c],D[c]=p+1|0,n[D[q>>2]+p|0]=v,v=(K[g]&65535)>>>8&255,p=N[c],D[c]=p+1|0,n[D[q>>2]+p|0]=v,v=N[h],p=w>>>((16-v|0)>>>0)&65535,o[g]=p,w=v-13|0):w=v+3|0;D[h]=w;t=t+1|0;if((t|0)==(d|0)){break a}v=w}}}while(0);Gd(b,b+148|0,f-1|0);Gd(b,b+2440|0,e)}yd.X=1;function Gd(b,f,e){var d,c,g,h,i=K[f+2>>1],j=0==i<<16>>16,l=j?138:7,q=j?3:4,t=b+2754|0;h=(b+5820|0)>>2;var v=b+2752|0;g=(b+5816|0)>>1;c=(b+20|0)>>2;d=(b+8|0)>>2;var p=b+2758|0,w=b+2756|0,r=b+2750|0,x=b+2748|0,u=q,B=l,z=0,A=-1,E=i&65535;a:for(;;){for(var C=0,s=z,y=E;;){if((s|0)>(e|0)){break a}var G=s+1|0,F=K[f+(G<<2)+2>>1],L=F&65535,X=C+1|0,$=(y|0)==(L|0);if(!((X|0)<(B|0)&$)){break}C=X;s=G;y=L}var Y=(X|0)<(u|0);b:do{if(Y){for(var R=(y<<2)+b+2686|0,S=(y<<2)+b+2684|0,M=X,I=D[h],la=o[g];;){var aa=K[R>>1]&65535,J=(I|0)>(16-aa|0),pb=K[S>>1]&65535,ba=la&65535|pb<<I,oa=ba&65535;o[g]=oa;if(J){var Ja=ba&255,qb=D[c];D[c]=qb+1|0;n[D[d]+qb|0]=Ja;var rb=(K[g]&65535)>>>8&255,Wa=N[c];D[c]=Wa+1|0;n[D[d]+Wa|0]=rb;var sb=N[h],Xa=pb>>>((16-sb|0)>>>0)&65535;o[g]=Xa;var tb=aa-16+sb|0,ca=Xa}else{tb=I+aa|0,ca=oa}D[h]=tb;var ea=M-1|0;if(0==(ea|0)){break b}M=ea;I=tb;la=ca}}else{if(0==(y|0)){if(11>(X|0)){var va=K[t>>1]&65535,ha=N[h],Ka=(ha|0)>(16-va|0),wa=K[v>>1]&65535,ub=K[g]&65535|wa<<ha,pa=ub&65535;o[g]=pa;if(Ka){var zb=ub&255,Ya=D[c];D[c]=Ya+1|0;n[D[d]+Ya|0]=zb;var fb=(K[g]&65535)>>>8&255,La=N[c];D[c]=La+1|0;n[D[d]+La|0]=fb;var vb=N[h],xa=wa>>>((16-vb|0)>>>0)&65535;o[g]=xa;var ma=va-16+vb|0,Ma=xa}else{ma=ha+va|0,Ma=pa}D[h]=ma;var gb=C+65534&65535,ya=Ma&65535|gb<<ma;o[g]=ya&65535;if(13<(ma|0)){var ia=D[c];D[c]=ia+1|0;n[D[d]+ia|0]=ya&255;var Za=(K[g]&65535)>>>8&255,hb=N[c];D[c]=hb+1|0;n[D[d]+hb|0]=Za;var Na=N[h];o[g]=gb>>>((16-Na|0)>>>0)&65535;D[h]=Na-13|0}else{D[h]=ma+3|0}}else{var Oa=K[p>>1]&65535,wb=N[h],xb=(wb|0)>(16-Oa|0),W=K[w>>1]&65535,na=K[g]&65535|W<<wb,ja=na&65535;o[g]=ja;if(xb){var Ab=na&255,yb=D[c];D[c]=yb+1|0;n[D[d]+yb|0]=Ab;var Bb=(K[g]&65535)>>>8&255,ib=N[c];D[c]=ib+1|0;n[D[d]+ib|0]=Bb;var za=N[h],Aa=W>>>((16-za|0)>>>0)&65535;o[g]=Aa;var Ba=Oa-16+za|0,jb=Aa}else{Ba=wb+Oa|0,jb=ja}D[h]=Ba;var Kb=C+65526&65535,Pa=jb&65535|Kb<<Ba;o[g]=Pa&65535;if(9<(Ba|0)){var Ca=D[c];D[c]=Ca+1|0;n[D[d]+Ca|0]=Pa&255;var ga=(K[g]&65535)>>>8&255,kb=N[c];D[c]=kb+1|0;n[D[d]+kb|0]=ga;var $a=N[h];o[g]=Kb>>>((16-$a|0)>>>0)&65535;D[h]=$a-9|0}else{D[h]=Ba+7|0}}}else{if((y|0)==(A|0)){var lb=X,Da=D[h],qa=o[g]}else{var Qa=K[b+(y<<2)+2686>>1]&65535,Ea=N[h],ab=(Ea|0)>(16-Qa|0),ra=K[b+(y<<2)+2684>>1]&65535,Fa=K[g]&65535|ra<<Ea,Ga=Fa&65535;o[g]=Ga;if(ab){var ka=Fa&255,bb=D[c];D[c]=bb+1|0;n[D[d]+bb|0]=ka;var sa=(K[g]&65535)>>>8&255,mb=N[c];D[c]=mb+1|0;n[D[d]+mb|0]=sa;var nb=N[h],Cb=ra>>>((16-nb|0)>>>0)&65535;o[g]=Cb;var Ra=Qa-16+nb|0,Sa=Cb}else{Ra=Ea+Qa|0,Sa=Ga}D[h]=Ra;lb=C;Da=Ra;qa=Sa}var cb=K[r>>1]&65535,Nb=(Da|0)>(16-cb|0),Db=K[x>>1]&65535,Ha=qa&65535|Db<<Da,Ta=Ha&65535;o[g]=Ta;if(Nb){var Eb=Ha&255,Ua=D[c];D[c]=Ua+1|0;n[D[d]+Ua|0]=Eb;var Fb=(K[g]&65535)>>>8&255,Va=N[c];D[c]=Va+1|0;n[D[d]+Va|0]=Fb;var Lb=N[h],Gb=Db>>>((16-Lb|0)>>>0)&65535;o[g]=Gb;var db=cb-16+Lb|0,Hb=Gb}else{db=Da+cb|0,Hb=Ta}D[h]=db;var Ob=lb+65533&65535,Pb=Hb&65535|Ob<<db;o[g]=Pb&65535;if(14<(db|0)){var ec=D[c];D[c]=ec+1|0;n[D[d]+ec|0]=Pb&255;var fc=(K[g]&65535)>>>8&255,pc=N[c];D[c]=pc+1|0;n[D[d]+pc|0]=fc;var gc=N[h];o[g]=Ob>>>((16-gc|0)>>>0)&65535;D[h]=gc-14|0}else{D[h]=db+2|0}}}}while(0);if(0==F<<16>>16){u=3,B=138}else{var Lc=$?6:7,u=$?3:4,B=Lc}z=G;A=y;E=L}}Gd.X=1;function ud(b,f,e){var d=K[f+2>>1],c=0==d<<16>>16;o[f+(e+1<<2)+2>>1]=-1;var g=b+2752|0,h=b+2756|0,i=b+2748|0,j=c?3:4,c=c?138:7,l=0,q=-1,d=d&65535;a:for(;;){for(var t=0;;){if((l|0)>(e|0)){break a}var v=l+1|0,p=K[f+(v<<2)+2>>1],w=p&65535,r=t+1|0,x=(d|0)==(w|0);if(!((r|0)<(c|0)&x)){break}t=r;l=v;d=w}(r|0)<(j|0)?(j=(d<<2)+b+2684|0,o[j>>1]=(K[j>>1]&65535)+r&65535):0==(d|0)?11>(r|0)?o[g>>1]=o[g>>1]+1&65535:o[h>>1]=o[h>>1]+1&65535:((d|0)!=(q|0)&&(j=(d<<2)+b+2684|0,o[j>>1]=o[j>>1]+1&65535),o[i>>1]=o[i>>1]+1&65535);0==p<<16>>16?(j=3,c=138):(c=x?6:7,j=x?3:4);l=v;q=d;d=w}}ud.X=1;function Dd(b,f,e){for(var d=b>>2,c=N[((e<<2)+2908>>2)+d],g=b+(c+5208)|0,h=b+5200|0,i=(c<<2)+f|0;;){var j=e<<1,l=D[h>>2];if((j|0)>(l|0)){break}l=(j|0)<(l|0);do{if(l){var q=j|1,t=N[((q<<2)+2908>>2)+d],v=K[f+(t<<2)>>1],p=N[((j<<2)+2908>>2)+d],w=K[f+(p<<2)>>1];if((v&65535)>=(w&65535)){if(v<<16>>16!=w<<16>>16){q=j;break}if((H[b+(t+5208)|0]&255)>(H[b+(p+5208)|0]&255)){q=j;break}}}else{q=j}}while(0);j=K[i>>1];l=N[((q<<2)+2908>>2)+d];t=K[f+(l<<2)>>1];if((j&65535)<(t&65535)){break}if(j<<16>>16==t<<16>>16&&(H[g]&255)<=(H[b+(l+5208)|0]&255)){break}D[((e<<2)+2908>>2)+d]=l;e=q}D[((e<<2)+2908>>2)+d]=c}Dd.X=1;function Ed(b,f,e,d){var c,g=f>>1,h=N[d>>2],i=N[d+4>>2],j=N[d+8>>2],d=N[d+16>>2];vc(b+2876|0,32);c=b+5204|0;o[((D[b+(D[c>>2]<<2)+2908>>2]<<2)+2>>1)+g]=0;var l=D[c>>2]+1|0,q=573>(l|0);a:do{if(q){c=(b+5800|0)>>2;var t=0==(h|0),v=b+5804|0;b:do{if(t){for(var p=0,w=l;;){var r=N[b+(w<<2)+2908>>2],x=(r<<2)+f+2|0,u=(K[(((K[x>>1]&65535)<<2)+2>>1)+g]&65535)+1|0,B=(u|0)>(d|0),p=(B&1)+p|0,u=B?d:u;o[x>>1]=u&65535;(r|0)>(e|0)||(x=(u<<1)+b+2876|0,o[x>>1]=o[x>>1]+1&65535,D[c]=(K[(r<<2>>1)+g]&65535)*(((r|0)<(j|0)?0:D[i+(r-j<<2)>>2])+u)+D[c]|0);w=w+1|0;if(573==(w|0)){var z=p;break b}}}else{p=0;for(w=l;;){if(r=N[b+(w<<2)+2908>>2],x=(r<<2)+f+2|0,u=(K[(((K[x>>1]&65535)<<2)+2>>1)+g]&65535)+1|0,B=(u|0)>(d|0),p=(B&1)+p|0,u=B?d:u,o[x>>1]=u&65535,(r|0)>(e|0)||(x=(u<<1)+b+2876|0,o[x>>1]=o[x>>1]+1&65535,x=(r|0)<(j|0)?0:D[i+(r-j<<2)>>2],B=K[(r<<2>>1)+g]&65535,D[c]=B*(x+u)+D[c]|0,D[v>>2]=((K[h+(r<<2)+2>>1]&65535)+x)*B+D[v>>2]|0),w=w+1|0,573==(w|0)){z=p;break b}}}}while(0);if(0!=(z|0)){t=(d<<1)+b+2876|0;for(v=z;;){for(var A=d;;){var w=A-1|0,E=(w<<1)+b+2876|0,C=o[E>>1];if(0!=C<<16>>16){break}A=w}o[E>>1]=C-1&65535;A=(A<<1)+b+2876|0;o[A>>1]=o[A>>1]+2&65535;A=o[t>>1]-1&65535;o[t>>1]=A;v=v-2|0;if(0>=(v|0)){break}}if(0!=(d|0)){r=573;t=d;for(w=A;;){v=t&65535;for(w&=65535;0!=(w|0);){for(;;){var s=r-1|0,y=N[b+(s<<2)+2908>>2];if((y|0)<=(e|0)){break}r=s}r=(y<<2)+f+2|0;p=K[r>>1]&65535;(p|0)!=(t|0)&&(D[c]=(K[(y<<2>>1)+g]&65535)*(t-p)+D[c]|0,o[r>>1]=v);w=w-1|0;r=s}t=t-1|0;if(0==(t|0)){break a}w=v=o[b+(t<<1)+2876>>1]}}}}}while(0)}Ed.X=1;function Fd(b,f,e){var d,c=e>>1,e=Tb;Tb+=32;d=e>>1;var g=o[c]<<1;o[d+1]=g;g=(o[c+1]+g&65535)<<1;o[d+2]=g;g=(o[c+2]+g&65535)<<1;o[d+3]=g;g=(o[c+3]+g&65535)<<1;o[d+4]=g;g=(o[c+4]+g&65535)<<1;o[d+5]=g;g=(o[c+5]+g&65535)<<1;o[d+6]=g;g=(o[c+6]+g&65535)<<1;o[d+7]=g;g=(o[c+7]+g&65535)<<1;o[d+8]=g;g=(o[c+8]+g&65535)<<1;o[d+9]=g;g=(o[c+9]+g&65535)<<1;o[d+10]=g;g=(o[c+10]+g&65535)<<1;o[d+11]=g;g=(o[c+11]+g&65535)<<1;o[d+12]=g;g=(o[c+12]+g&65535)<<1;o[d+13]=g;g=(o[c+13]+g&65535)<<1;o[d+14]=g;o[d+15]=(o[c+14]+g&65535)<<1;d=0>(f|0);a:do{if(!d){c=f+1|0;for(g=0;;){var h=K[b+(g<<2)+2>>1],i=h&65535;if(0!=h<<16>>16){var h=(i<<1)+e|0,j=K[h>>1];o[h>>1]=j+1&65535;h=j&65535;for(j=0;;){var l=h&1|j,j=l<<1,i=i-1|0;if(0>=(i|0)){break}h>>>=1}o[b+(g<<2)>>1]=l&65535}g=g+1|0;if((g|0)==(c|0)){break a}}}}while(0);Tb=e}Fd.X=1;function Hd(b,f,e){var d,c=Tb;Tb+=32824;d=c>>2;var g=c+56,h=c+16440;D[d+8]=0;D[d+9]=0;D[d+10]=0;d=Tc(c,e);var i=0==(d|0);a:do{if(i){var j=g|0,l=c+4|0,q=c|0,e=(c+16|0)>>2,t=h|0,v=c+12|0;b:for(;;){var p;var w=b;p=Yd(w,j);w=T[w];-1==p?(w&&(w.error=k),p=-1):(16384>p&&(w.e=k),p=Math.floor(p/1));D[l>>2]=p;if(0!=(Number(b in T&&T[b].error)|0)){Wc(c);var r=-1;break a}w=(p=0!=(Number(b in T&&T[b].e)|0))?4:0;D[q>>2]=j;c:for(;;){D[e]=16384;D[v>>2]=t;var x=cd(c,w);-2==(x|0)&&Zd(68,Q.A|0);var u=16384-D[e]|0,B;B=f;var z=1*u;0==z?B=0:(z=$d(B,t,z),-1==z?(T[B]&&(T[B].error=k),B=-1):B=Math.floor(z/1));u=(B|0)==(u|0);do{if(u&&0==(Number(f in T&&T[f].error)|0)){if(0==(D[e]|0)){continue c}0!=(D[l>>2]|0)&&Zd(75,Q.B|0);if(!p){continue b}1!=(x|0)&&Zd(79,Q.D|0);Wc(c);r=0;break a}}while(0);Wc(c);r=-1;break a}}}else{r=d}}while(0);Tb=c;return r}Hd.X=1;function ae(b,f){var e=n[D[f+4>>2]]-48&255,e=0>e<<24>>24?0:e,d=9<e<<24>>24,c=oe(Q.F|0,Q.H|0),g=oe(Q.I|0,Q.J|0);return Hd(c,g,d?9:e<<24>>24)}Module._main=ae;function uc(b){if(245>b>>>0){var f=11>b>>>0?16:b+11&-8,e=f>>>3,b=N[U>>2],d=b>>>(e>>>0);if(0!=(d&3|0)){var c=(d&1^1)+e|0,f=c<<1,e=(f<<2)+U+40|0,g=(f+2<<2)+U+40|0,d=N[g>>2],f=d+8|0,h=N[f>>2];(e|0)==(h|0)?D[U>>2]=b&(1<<c^-1):(h>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[g>>2]=h,D[h+12>>2]=e);b=c<<3;D[d+4>>2]=b|3;b=d+(b|4)|0;D[b>>2]|=1;c=f;b=38}else{if(f>>>0>N[U+8>>2]>>>0){if(0!=(d|0)){var c=2<<e,c=d<<e&(c|-c),e=(c&-c)-1|0,c=e>>>12&16,d=e>>>(c>>>0),e=d>>>5&8,g=d>>>(e>>>0),d=g>>>2&4,h=g>>>(d>>>0),g=h>>>1&2,h=h>>>(g>>>0),i=h>>>1&1,e=(e|c|d|g|i)+(h>>>(i>>>0))|0,c=e<<1,g=(c<<2)+U+40|0,h=(c+2<<2)+U+40|0,d=N[h>>2],c=d+8|0,i=N[c>>2];(g|0)==(i|0)?D[U>>2]=b&(1<<e^-1):(i>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[h>>2]=i,D[i+12>>2]=g);g=e<<3;b=g-f|0;D[d+4>>2]=f|3;e=d+f|0;D[d+(f|4)>>2]=b|1;D[d+g>>2]=b;i=N[U+8>>2];0!=(i|0)&&(f=D[U+20>>2],g=i>>>2&1073741822,d=(g<<2)+U+40|0,h=N[U>>2],i=1<<(i>>>3),0==(h&i|0)?(D[U>>2]=h|i,h=d,g=(g+2<<2)+U+40|0):(g=(g+2<<2)+U+40|0,h=N[g>>2],h>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"))),D[g>>2]=f,D[h+12>>2]=f,D[(f+8|0)>>2]=h,D[(f+12|0)>>2]=d);D[U+8>>2]=b;D[U+20>>2]=e;b=38}else{0==(D[U+4>>2]|0)?(j=f,b=30):(b=pe(f),0==(b|0)?(j=f,b=30):(c=b,b=38))}}else{var j=f,b=30}}}else{4294967231<b>>>0?(j=-1,b=30):(b=b+11&-8,0==(D[U+4>>2]|0)?(j=b,b=30):(f=qe(b),0==(f|0)?(j=b,b=30):(c=f,b=38)))}30==b&&(f=N[U+8>>2],j>>>0>f>>>0?(b=N[U+12>>2],j>>>0<b>>>0?(b=b-j|0,D[U+12>>2]=b,f=N[U+24>>2],D[U+24>>2]=f+j|0,D[j+(f+4)>>2]=b|1,D[f+4>>2]=j|3,c=f+8|0):c=re(j)):(c=f-j|0,b=N[U+20>>2],15<c>>>0?(D[U+20>>2]=b+j|0,D[U+8>>2]=c,D[j+(b+4)>>2]=c|1,D[b+f>>2]=c,D[b+4>>2]=j|3):(D[U+8>>2]=0,D[U+20>>2]=0,D[b+4>>2]=f|3,j=f+(b+4)|0,D[j>>2]|=1),c=b+8|0));return c}Module._malloc=uc;uc.X=1;function pe(b){var f,e,d=D[U+4>>2],c=(d&-d)-1|0,d=c>>>12&16,g=c>>>(d>>>0),c=g>>>5&8;e=g>>>(c>>>0);var g=e>>>2&4,h=e>>>(g>>>0);e=h>>>1&2;var h=h>>>(e>>>0),i=h>>>1&1,d=c=N[U+((c|d|g|e|i)+(h>>>(i>>>0))<<2)+304>>2];e=d>>2;c=(D[c+4>>2]&-8)-b|0;a:for(;;){for(g=d;;){h=D[g+16>>2];if(0==(h|0)){if(g=D[g+20>>2],0==(g|0)){break a}}else{g=h}h=(D[g+4>>2]&-8)-b|0;if(h>>>0<c>>>0){d=g;e=d>>2;c=h;continue a}}}var h=d,j=N[U+16>>2],i=h>>>0<j>>>0;do{if(!i){var l=h+b|0,g=l;if(h>>>0<l>>>0){var i=N[e+6],l=N[e+3],q=(l|0)==(d|0);do{if(q){f=d+20|0;var t=D[f>>2];if(0==(t|0)&&(f=d+16|0,t=D[f>>2],0==(t|0))){t=0;f=t>>2;break}for(;;){var v=t+20|0,p=D[v>>2];if(0==(p|0)&&(v=t+16|0,p=N[v>>2],0==(p|0))){break}f=v;t=p}f>>>0<j>>>0&&(V(),a("Reached an unreachable!"));D[f>>2]=0}else{f=N[e+2],f>>>0<j>>>0&&(V(),a("Reached an unreachable!")),D[f+12>>2]=l,D[l+8>>2]=f,t=l}f=t>>2}while(0);j=0==(i|0);a:do{if(!j){l=d+28|0;q=(D[l>>2]<<2)+U+304|0;v=(d|0)==(D[q>>2]|0);do{if(v){D[q>>2]=t;if(0!=(t|0)){break}D[U+4>>2]&=1<<D[l>>2]^-1;break a}i>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));p=i+16|0;(D[p>>2]|0)==(d|0)?D[p>>2]=t:D[i+20>>2]=t;if(0==(t|0)){break a}}while(0);t>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));D[f+6]=i;l=N[e+4];0!=(l|0)&&(l>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[f+4]=l,D[l+24>>2]=t);l=N[e+5];0!=(l|0)&&(l>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[f+5]=l,D[l+24>>2]=t)}}while(0);16>c>>>0?(b=c+b|0,D[e+1]=b|3,b=b+(h+4)|0,D[b>>2]|=1):(D[e+1]=b|3,D[b+(h+4)>>2]=c|1,D[h+c+b>>2]=c,j=N[U+8>>2],0!=(j|0)&&(b=N[U+20>>2],h=j>>>2&1073741822,e=(h<<2)+U+40|0,i=N[U>>2],j=1<<(j>>>3),0==(i&j|0)?(D[U>>2]=i|j,i=e,h=(h+2<<2)+U+40|0):(h=(h+2<<2)+U+40|0,i=N[h>>2],i>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"))),D[h>>2]=b,D[i+12>>2]=b,D[b+8>>2]=i,D[b+12>>2]=e),D[U+8>>2]=c,D[U+20>>2]=g);return d+8|0}}}while(0);V();a("Reached an unreachable!")}pe.X=1;function re(b){var f,e;0==(D[se>>2]|0)&&te();var d=0==(D[U+440>>2]&4|0);do{if(d){e=D[U+24>>2];if(0==(e|0)){e=6}else{if(e=ue(e),0==(e|0)){e=6}else{var c=D[se+8>>2],c=b+47-D[U+12>>2]+c&-c;if(2147483647>c>>>0){var g=ve(c);if((g|0)==(D[e>>2]+D[e+4>>2]|0)){var h=g,i=c;f=g;e=13}else{var j=g,l=c;e=15}}else{e=14}}}if(6==e){if(e=ve(0),-1==(e|0)){e=14}else{var c=D[se+8>>2],c=c+(b+47)&-c,g=e,q=D[se+4>>2],t=q-1|0,c=0==(t&g|0)?c:c-g+(t+g&-q)|0;2147483647>c>>>0?(g=ve(c),(g|0)==(e|0)?(h=e,i=c,f=g,e=13):(j=g,l=c,e=15)):e=14}}if(13==e){if(-1!=(h|0)){var v=i,p=h;e=26;break}j=f;l=i}else{if(14==e){D[U+440>>2]|=4;e=23;break}}e=-l|0;if(-1!=(j|0)&2147483647>l>>>0){if(l>>>0<(b+48|0)>>>0){c=D[se+8>>2],c=b+47-l+c&-c,2147483647>c>>>0?-1==(ve(c)|0)?(ve(e),e=22):(w=c+l|0,e=21):(w=l,e=21)}else{var w=l;e=21}}else{w=l,e=21}if(21==e&&-1!=(j|0)){v=w;p=j;e=26;break}D[U+440>>2]|=4}e=23}while(0);23==e&&(d=D[se+8>>2],d=d+(b+47)&-d,2147483647>d>>>0?(d=ve(d),h=ve(0),-1!=(h|0)&-1!=(d|0)&d>>>0<h>>>0?(h=h-d|0,h>>>0<=(b+40|0)>>>0|-1==(d|0)?e=49:(v=h,p=d,e=26)):e=49):e=49);a:do{if(26==e){d=D[U+432>>2]+v|0;D[U+432>>2]=d;d>>>0>N[U+436>>2]>>>0&&(D[U+436>>2]=d);d=N[U+24>>2];h=0==(d|0);b:do{if(h){i=N[U+16>>2];0==(i|0)|p>>>0<i>>>0&&(D[U+16>>2]=p);D[U+444>>2]=p;D[U+448>>2]=v;D[U+456>>2]=0;D[U+36>>2]=D[se>>2];D[U+32>>2]=-1;for(i=0;!(f=i<<1,j=(f<<2)+U+40|0,D[U+(f+3<<2)+40>>2]=j,D[U+(f+2<<2)+40>>2]=j,i=i+1|0,32==(i|0));){}we(p,v-40|0)}else{j=U+444|0;for(f=j>>2;0!=(j|0);){i=N[f];j=j+4|0;l=N[j>>2];w=i+l|0;if((p|0)==(w|0)){if(0!=(D[f+3]&8|0)){break}f=d;if(!(f>>>0>=i>>>0&f>>>0<w>>>0)){break}D[j>>2]=l+v|0;we(D[U+24>>2],D[U+12>>2]+v|0);break b}j=D[f+2];f=j>>2}p>>>0<N[U+16>>2]>>>0&&(D[U+16>>2]=p);f=p+v|0;for(j=U+444|0;0!=(j|0);){l=j|0;i=N[l>>2];if((i|0)==(f|0)){if(0!=(D[j+12>>2]&8|0)){break}D[l>>2]=p;var r=j+4|0;D[r>>2]=D[r>>2]+v|0;r=xe(p,i,b);e=50;break a}j=D[j+8>>2]}ye(p,v)}}while(0);d=N[U+12>>2];d>>>0>b>>>0?(r=d-b|0,D[U+12>>2]=r,h=d=N[U+24>>2],D[U+24>>2]=h+b|0,D[b+(h+4)>>2]=r|1,D[d+4>>2]=b|3,r=d+8|0,e=50):e=49}}while(0);49==e&&(D[ze>>2]=12,r=0);return r}re.X=1;function qe(b){var f,e,d,c,g,h=b>>2,i=-b|0,j=b>>>8;if(0==(j|0)){var l=0}else{if(16777215<b>>>0){l=31}else{var q=(j+1048320|0)>>>16&8,t=j<<q,v=(t+520192|0)>>>16&4,p=t<<v,w=(p+245760|0)>>>16&2,r=14-(v|q|w)+(p<<w>>>15)|0,l=b>>>((r+7|0)>>>0)&1|r<<1}}var x=N[U+(l<<2)+304>>2],u=0==(x|0);a:do{if(u){var B=0,z=i,A=0}else{var E=31==(l|0)?0:25-(l>>>1)|0,C=0,s=i,y=x;g=y>>2;for(var G=b<<E,F=0;;){var L=D[g+1]&-8,X=L-b|0;if(X>>>0<s>>>0){if((L|0)==(b|0)){B=y;z=X;A=y;break a}var $=y,Y=X}else{$=C,Y=s}var R=N[g+5],S=N[((G>>>31<<2)+16>>2)+g],M=0==(R|0)|(R|0)==(S|0)?F:R;if(0==(S|0)){B=$;z=Y;A=M;break a}C=$;s=Y;y=S;g=y>>2;G<<=1;F=M}}}while(0);if(0==(A|0)&0==(B|0)){var I=2<<l,la=D[U+4>>2]&(I|-I);if(0==(la|0)){var aa=A}else{var J=(la&-la)-1|0,pb=J>>>12&16,ba=J>>>(pb>>>0),oa=ba>>>5&8,Ja=ba>>>(oa>>>0),qb=Ja>>>2&4,rb=Ja>>>(qb>>>0),Wa=rb>>>1&2,sb=rb>>>(Wa>>>0),Xa=sb>>>1&1,aa=D[U+((oa|pb|qb|Wa|Xa)+(sb>>>(Xa>>>0))<<2)+304>>2]}}else{aa=A}var tb=0==(aa|0);a:do{if(tb){var ca=z,ea=B;c=ea>>2}else{var va=aa;d=va>>2;for(var ha=z,Ka=B;;){var wa=(D[d+1]&-8)-b|0,ub=wa>>>0<ha>>>0,pa=ub?wa:ha,zb=ub?va:Ka,Ya=N[d+4];if(0!=(Ya|0)){va=Ya}else{var fb=N[d+5];if(0==(fb|0)){ca=pa;ea=zb;c=ea>>2;break a}va=fb}d=va>>2;ha=pa;Ka=zb}}}while(0);var La=0==(ea|0);a:do{if(La){var vb=0}else{if(ca>>>0<(D[U+8>>2]-b|0)>>>0){var xa=ea;e=xa>>2;var ma=N[U+16>>2],Ma=xa>>>0<ma>>>0;do{if(!Ma){var gb=xa+b|0,ya=gb;if(xa>>>0<gb>>>0){var ia=N[c+6],Za=N[c+3],hb=(Za|0)==(ea|0);do{if(hb){var Na=ea+20|0,Oa=D[Na>>2];if(0==(Oa|0)){var wb=ea+16|0,xb=D[wb>>2];if(0==(xb|0)){var W=0;f=W>>2;break}var na=wb,ja=xb}else{na=Na,ja=Oa}for(;;){var Ab=ja+20|0,yb=D[Ab>>2];if(0!=(yb|0)){na=Ab,ja=yb}else{var Bb=ja+16|0,ib=N[Bb>>2];if(0==(ib|0)){break}na=Bb;ja=ib}}na>>>0<ma>>>0&&(V(),a("Reached an unreachable!"));D[na>>2]=0;W=ja}else{var za=N[c+2];za>>>0<ma>>>0&&(V(),a("Reached an unreachable!"));D[za+12>>2]=Za;D[Za+8>>2]=za;W=Za}f=W>>2}while(0);var Aa=0==(ia|0);b:do{if(!Aa){var Ba=ea+28|0,jb=(D[Ba>>2]<<2)+U+304|0,Kb=(ea|0)==(D[jb>>2]|0);do{if(Kb){D[jb>>2]=W;if(0!=(W|0)){break}D[U+4>>2]&=1<<D[Ba>>2]^-1;break b}ia>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));var Pa=ia+16|0;(D[Pa>>2]|0)==(ea|0)?D[Pa>>2]=W:D[ia+20>>2]=W;if(0==(W|0)){break b}}while(0);W>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));D[f+6]=ia;var Ca=N[c+4];0!=(Ca|0)&&(Ca>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[f+4]=Ca,D[Ca+24>>2]=W);var ga=N[c+5];0!=(ga|0)&&(ga>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[f+5]=ga,D[ga+24>>2]=W)}}while(0);var kb=16>ca>>>0;b:do{if(kb){var $a=ca+b|0;D[c+1]=$a|3;var lb=$a+(xa+4)|0;D[lb>>2]|=1}else{if(D[c+1]=b|3,D[h+(e+1)]=ca|1,D[(ca>>2)+e+h]=ca,256>ca>>>0){var Da=ca>>>2&1073741822,qa=(Da<<2)+U+40|0,Qa=N[U>>2],Ea=1<<(ca>>>3);if(0==(Qa&Ea|0)){D[U>>2]=Qa|Ea;var ab=qa,ra=(Da+2<<2)+U+40|0}else{var Fa=(Da+2<<2)+U+40|0,Ga=N[Fa>>2];Ga>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));ab=Ga;ra=Fa}D[ra>>2]=ya;D[ab+12>>2]=ya;D[h+(e+2)]=ab;D[h+(e+3)]=qa}else{var ka=gb,bb=ca>>>8;if(0==(bb|0)){var sa=0}else{if(16777215<ca>>>0){sa=31}else{var mb=(bb+1048320|0)>>>16&8,nb=bb<<mb,Cb=(nb+520192|0)>>>16&4,Ra=nb<<Cb,Sa=(Ra+245760|0)>>>16&2,cb=14-(Cb|mb|Sa)+(Ra<<Sa>>>15)|0,sa=ca>>>((cb+7|0)>>>0)&1|cb<<1}}var Nb=(sa<<2)+U+304|0;D[h+(e+7)]=sa;var Db=b+(xa+16)|0;D[h+(e+5)]=0;D[Db>>2]=0;var Ha=D[U+4>>2],Ta=1<<sa;if(0==(Ha&Ta|0)){D[U+4>>2]=Ha|Ta,D[Nb>>2]=ka,D[h+(e+6)]=Nb,D[h+(e+3)]=ka,D[h+(e+2)]=ka}else{for(var Eb=ca<<(31==(sa|0)?0:25-(sa>>>1)|0),Ua=D[Nb>>2];;){if((D[Ua+4>>2]&-8|0)==(ca|0)){var Fb=Ua+8|0,Va=N[Fb>>2],Lb=N[U+16>>2],Gb=Ua>>>0<Lb>>>0;do{if(!Gb&&Va>>>0>=Lb>>>0){D[Va+12>>2]=ka;D[Fb>>2]=ka;D[h+(e+2)]=Va;D[h+(e+3)]=Ua;D[h+(e+6)]=0;break b}}while(0);V();a("Reached an unreachable!")}var db=(Eb>>>31<<2)+Ua+16|0,Hb=N[db>>2];if(0==(Hb|0)){if(db>>>0>=N[U+16>>2]>>>0){D[db>>2]=ka;D[h+(e+6)]=Ua;D[h+(e+3)]=ka;D[h+(e+2)]=ka;break b}V();a("Reached an unreachable!")}Eb<<=1;Ua=Hb}}}}}while(0);vb=ea+8|0;break a}}}while(0);V();a("Reached an unreachable!")}vb=0}}while(0);return vb}qe.X=1;function Ae(){var b;0==(D[se>>2]|0)&&te();var f=N[U+24>>2],e=0==(f|0);a:do{if(!e){var d=N[U+12>>2],c=40<d>>>0;do{if(c){var g=N[se+8>>2],h=(Math.floor(((d-41+g|0)>>>0)/(g>>>0))-1)*g|0,i=ue(f);if(0==(D[i+12>>2]&8|0)){var j=ve(0);b=(i+4|0)>>2;if((j|0)==(D[i>>2]+D[b]|0)&&(h=ve(-(2147483646<h>>>0?-2147483648-g|0:h)|0),g=ve(0),-1!=(h|0)&g>>>0<j>>>0&&(h=j-g|0,(j|0)!=(g|0)))){D[b]=D[b]-h|0;D[U+432>>2]=D[U+432>>2]-h|0;we(D[U+24>>2],D[U+12>>2]-h|0);break a}}}}while(0);N[U+12>>2]>>>0>N[U+28>>2]>>>0&&(D[U+28>>2]=-1)}}while(0)}Ae.X=1;function Be(b){var f,e,d,c,g,h,i=b>>2,j,l=0==(b|0);a:do{if(!l){var q=b-8|0,t=q,v=N[U+16>>2],p=q>>>0<v>>>0;b:do{if(!p){var w=N[b-4>>2],r=w&3;if(1!=(r|0)){var x=w&-8;h=x>>2;var u=b+(x-8)|0,B=u,z=0==(w&1|0);c:do{if(z){var A=N[q>>2];if(0==(r|0)){break a}var E=-8-A|0;g=E>>2;var C=b+E|0,s=C,y=A+x|0;if(C>>>0<v>>>0){break b}if((s|0)==(D[U+20>>2]|0)){c=(b+(x-4)|0)>>2;if(3!=(D[c]&3|0)){var G=s;d=G>>2;var F=y;break}D[U+8>>2]=y;D[c]&=-2;D[g+(i+1)]=y|1;D[u>>2]=y;break a}if(256>A>>>0){var L=N[g+(i+2)],X=N[g+(i+3)];if((L|0)==(X|0)){D[U>>2]&=1<<(A>>>3)^-1,G=s,d=G>>2,F=y}else{var $=((A>>>2&1073741822)<<2)+U+40|0,Y=(L|0)!=($|0)&L>>>0<v>>>0;do{if(!Y&&(X|0)==($|0)|X>>>0>=v>>>0){D[L+12>>2]=X;D[X+8>>2]=L;G=s;d=G>>2;F=y;break c}}while(0);V();a("Reached an unreachable!")}}else{var R=C,S=N[g+(i+6)],M=N[g+(i+3)],I=(M|0)==(R|0);do{if(I){var la=E+(b+20)|0,aa=D[la>>2];if(0==(aa|0)){var J=E+(b+16)|0,pb=D[J>>2];if(0==(pb|0)){var ba=0;e=ba>>2;break}var oa=J,Ja=pb}else{oa=la,Ja=aa,j=21}for(;;){var qb=Ja+20|0,rb=D[qb>>2];if(0!=(rb|0)){oa=qb,Ja=rb}else{var Wa=Ja+16|0,sb=N[Wa>>2];if(0==(sb|0)){break}oa=Wa;Ja=sb}}oa>>>0<v>>>0&&(V(),a("Reached an unreachable!"));D[oa>>2]=0;ba=Ja}else{var Xa=N[g+(i+2)];Xa>>>0<v>>>0&&(V(),a("Reached an unreachable!"));D[Xa+12>>2]=M;D[M+8>>2]=Xa;ba=M}e=ba>>2}while(0);if(0!=(S|0)){var tb=E+(b+28)|0,ca=(D[tb>>2]<<2)+U+304|0,ea=(R|0)==(D[ca>>2]|0);do{if(ea){D[ca>>2]=ba;if(0!=(ba|0)){break}D[U+4>>2]&=1<<D[tb>>2]^-1;G=s;d=G>>2;F=y;break c}S>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));var va=S+16|0;(D[va>>2]|0)==(R|0)?D[va>>2]=ba:D[S+20>>2]=ba;if(0==(ba|0)){G=s;d=G>>2;F=y;break c}}while(0);ba>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));D[e+6]=S;var ha=N[g+(i+4)];0!=(ha|0)&&(ha>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[e+4]=ha,D[ha+24>>2]=ba);var Ka=N[g+(i+5)];0!=(Ka|0)&&(Ka>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[e+5]=Ka,D[Ka+24>>2]=ba)}G=s;d=G>>2;F=y}}else{G=t,d=G>>2,F=x}}while(0);var wa=G;if(wa>>>0<u>>>0){var ub=b+(x-4)|0,pa=N[ub>>2];if(0!=(pa&1|0)){var zb=0==(pa&2|0);do{if(zb){if((B|0)==(D[U+24>>2]|0)){var Ya=D[U+12>>2]+F|0;D[U+12>>2]=Ya;D[U+24>>2]=G;D[d+1]=Ya|1;(G|0)==(D[U+20>>2]|0)&&(D[U+20>>2]=0,D[U+8>>2]=0);if(Ya>>>0<=N[U+28>>2]>>>0){break a}Ae();break a}if((B|0)==(D[U+20>>2]|0)){var fb=D[U+8>>2]+F|0;D[U+8>>2]=fb;D[U+20>>2]=G;D[d+1]=fb|1;D[(wa+fb|0)>>2]=fb;break a}var La=(pa&-8)+F|0,vb=pa>>>3,xa=256>pa>>>0;c:do{if(xa){var ma=N[i+h],Ma=N[((x|4)>>2)+i];if((ma|0)==(Ma|0)){D[U>>2]&=1<<vb^-1}else{var gb=((pa>>>2&1073741822)<<2)+U+40|0;j=(ma|0)==(gb|0)?63:ma>>>0<N[U+16>>2]>>>0?66:63;do{if(63==j&&!((Ma|0)!=(gb|0)&&Ma>>>0<N[U+16>>2]>>>0)){D[ma+12>>2]=Ma;D[Ma+8>>2]=ma;break c}}while(0);V();a("Reached an unreachable!")}}else{var ya=u,ia=N[h+(i+4)],Za=N[((x|4)>>2)+i],hb=(Za|0)==(ya|0);do{if(hb){var Na=x+(b+12)|0,Oa=D[Na>>2];if(0==(Oa|0)){var wb=x+(b+8)|0,xb=D[wb>>2];if(0==(xb|0)){var W=0;f=W>>2;break}var na=wb,ja=xb}else{na=Na,ja=Oa,j=73}for(;;){var Ab=ja+20|0,yb=D[Ab>>2];if(0!=(yb|0)){na=Ab,ja=yb}else{var Bb=ja+16|0,ib=N[Bb>>2];if(0==(ib|0)){break}na=Bb;ja=ib}}na>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));D[na>>2]=0;W=ja}else{var za=N[i+h];za>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));D[za+12>>2]=Za;D[Za+8>>2]=za;W=Za}f=W>>2}while(0);if(0!=(ia|0)){var Aa=x+(b+20)|0,Ba=(D[Aa>>2]<<2)+U+304|0,jb=(ya|0)==(D[Ba>>2]|0);do{if(jb){D[Ba>>2]=W;if(0!=(W|0)){break}D[U+4>>2]&=1<<D[Aa>>2]^-1;break c}ia>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));var Kb=ia+16|0;(D[Kb>>2]|0)==(ya|0)?D[Kb>>2]=W:D[ia+20>>2]=W;if(0==(W|0)){break c}}while(0);W>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));D[f+6]=ia;var Pa=N[h+(i+2)];0!=(Pa|0)&&(Pa>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[f+4]=Pa,D[Pa+24>>2]=W);var Ca=N[h+(i+3)];0!=(Ca|0)&&(Ca>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[f+5]=Ca,D[Ca+24>>2]=W)}}}while(0);D[d+1]=La|1;D[wa+La>>2]=La;if((G|0)!=(D[U+20>>2]|0)){var ga=La}else{D[U+8>>2]=La;break a}}else{D[ub>>2]=pa&-2,D[d+1]=F|1,ga=D[wa+F>>2]=F}}while(0);if(256>ga>>>0){var kb=ga>>>2&1073741822,$a=(kb<<2)+U+40|0,lb=N[U>>2],Da=1<<(ga>>>3);if(0==(lb&Da|0)){D[U>>2]=lb|Da;var qa=$a,Qa=(kb+2<<2)+U+40|0}else{var Ea=(kb+2<<2)+U+40|0,ab=N[Ea>>2];ab>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));qa=ab;Qa=Ea}D[Qa>>2]=G;D[qa+12>>2]=G;D[d+2]=qa;D[d+3]=$a;break a}var ra=G,Fa=ga>>>8;if(0==(Fa|0)){var Ga=0}else{if(16777215<ga>>>0){Ga=31}else{var ka=(Fa+1048320|0)>>>16&8,bb=Fa<<ka,sa=(bb+520192|0)>>>16&4,mb=bb<<sa,nb=(mb+245760|0)>>>16&2,Cb=14-(sa|ka|nb)+(mb<<nb>>>15)|0,Ga=ga>>>((Cb+7|0)>>>0)&1|Cb<<1}}var Ra=(Ga<<2)+U+304|0;D[d+7]=Ga;D[d+5]=0;D[d+4]=0;var Sa=D[U+4>>2],cb=1<<Ga,Nb=0==(Sa&cb|0);c:do{if(Nb){D[U+4>>2]=Sa|cb,D[Ra>>2]=ra,D[d+6]=Ra,D[d+3]=G,D[d+2]=G}else{for(var Db=ga<<(31==(Ga|0)?0:25-(Ga>>>1)|0),Ha=D[Ra>>2];;){if((D[Ha+4>>2]&-8|0)==(ga|0)){var Ta=Ha+8|0,Eb=N[Ta>>2],Ua=N[U+16>>2],Fb=Ha>>>0<Ua>>>0;do{if(!Fb&&Eb>>>0>=Ua>>>0){D[Eb+12>>2]=ra;D[Ta>>2]=ra;D[d+2]=Eb;D[d+3]=Ha;D[d+6]=0;break c}}while(0);V();a("Reached an unreachable!")}var Va=(Db>>>31<<2)+Ha+16|0,Lb=N[Va>>2];if(0==(Lb|0)){if(Va>>>0>=N[U+16>>2]>>>0){D[Va>>2]=ra;D[d+6]=Ha;D[d+3]=G;D[d+2]=G;break c}V();a("Reached an unreachable!")}Db<<=1;Ha=Lb}}}while(0);var Gb=D[U+32>>2]-1|0;D[U+32>>2]=Gb;if(0!=(Gb|0)){break a}var db=D[U+452>>2],Hb=0==(db|0);c:do{if(!Hb){for(var Ob=db;;){var Pb=D[Ob+8>>2];if(0==(Pb|0)){break c}Ob=Pb}}}while(0);D[U+32>>2]=-1;break a}}}}}while(0);V();a("Reached an unreachable!")}}while(0)}Module._free=Be;Be.X=1;function ue(b){var f,e=U+444|0;for(f=e>>2;;){var d=N[f];if(d>>>0<=b>>>0&&(d+D[f+1]|0)>>>0>b>>>0){var c=e;break}f=N[f+2];if(0==(f|0)){c=0;break}e=f;f=e>>2}return c}function we(b,f){var e=b+8|0,e=0==(e&7|0)?0:-e&7,d=f-e|0;D[U+24>>2]=b+e|0;D[U+12>>2]=d;D[e+(b+4)>>2]=d|1;D[f+(b+4)>>2]=40;D[U+28>>2]=D[se+16>>2]}function te(){if(0==(D[se>>2]|0)){var b=Ce();0==(b-1&b|0)?(D[se+8>>2]=b,D[se+4>>2]=b,D[se+12>>2]=-1,D[se+16>>2]=2097152,D[se+20>>2]=0,D[U+440>>2]=0,D[se>>2]=Math.floor(Date.now()/1e3)&-16^1431655768):(V(),a("Reached an unreachable!"))}}function xe(b,f,e){var d,c,g,h=f>>2,i=b>>2,j,l=b+8|0,l=0==(l&7|0)?0:-l&7;c=f+8|0;var q=0==(c&7|0)?0:-c&7;g=q>>2;var t=f+q|0,v=l+e|0;c=v>>2;var p=b+v|0,w=t-(b+l)-e|0;D[(l+4>>2)+i]=e|3;e=(t|0)==(D[U+24>>2]|0);a:do{if(e){var r=D[U+12>>2]+w|0;D[U+12>>2]=r;D[U+24>>2]=p;D[c+(i+1)]=r|1}else{if((t|0)==(D[U+20>>2]|0)){r=D[U+8>>2]+w|0,D[U+8>>2]=r,D[U+20>>2]=p,D[c+(i+1)]=r|1,D[(b+r+v|0)>>2]=r}else{var x=N[g+(h+1)];if(1==(x&3|0)){var r=x&-8,u=x>>>3,B=256>x>>>0;b:do{if(B){var z=N[((q|8)>>2)+h],A=N[g+(h+3)];if((z|0)==(A|0)){D[U>>2]&=1<<u^-1}else{var E=((x>>>2&1073741822)<<2)+U+40|0;j=(z|0)==(E|0)?15:z>>>0<N[U+16>>2]>>>0?18:15;do{if(15==j&&!((A|0)!=(E|0)&&A>>>0<N[U+16>>2]>>>0)){D[z+12>>2]=A;D[A+8>>2]=z;break b}}while(0);V();a("Reached an unreachable!")}}else{j=t;z=N[((q|24)>>2)+h];A=N[g+(h+3)];E=(A|0)==(j|0);do{if(E){d=q|16;var C=d+(f+4)|0,s=D[C>>2];if(0==(s|0)){if(d=f+d|0,s=D[d>>2],0==(s|0)){s=0;d=s>>2;break}}else{d=C}for(;;){var C=s+20|0,y=D[C>>2];if(0==(y|0)&&(C=s+16|0,y=N[C>>2],0==(y|0))){break}d=C;s=y}d>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));D[d>>2]=0}else{d=N[((q|8)>>2)+h],d>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[d+12>>2]=A,D[A+8>>2]=d,s=A}d=s>>2}while(0);if(0!=(z|0)){A=q+(f+28)|0;E=(D[A>>2]<<2)+U+304|0;C=(j|0)==(D[E>>2]|0);do{if(C){D[E>>2]=s;if(0!=(s|0)){break}D[U+4>>2]&=1<<D[A>>2]^-1;break b}z>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));y=z+16|0;(D[y>>2]|0)==(j|0)?D[y>>2]=s:D[z+20>>2]=s;if(0==(s|0)){break b}}while(0);s>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"));D[d+6]=z;j=q|16;z=N[(j>>2)+h];0!=(z|0)&&(z>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[d+4]=z,D[z+24>>2]=s);j=N[(j+4>>2)+h];0!=(j|0)&&(j>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!")),D[d+5]=j,D[j+24>>2]=s)}}}while(0);x=f+(r|q)|0;r=r+w|0}else{x=t,r=w}x=x+4|0;D[x>>2]&=-2;D[c+(i+1)]=r|1;D[(r>>2)+i+c]=r;if(256>r>>>0){u=r>>>2&1073741822,x=(u<<2)+U+40|0,B=N[U>>2],r=1<<(r>>>3),0==(B&r|0)?(D[U>>2]=B|r,r=x,u=(u+2<<2)+U+40|0):(u=(u+2<<2)+U+40|0,r=N[u>>2],r>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"))),D[u>>2]=p,D[r+12>>2]=p,D[c+(i+2)]=r,D[c+(i+3)]=x}else{if(x=p,B=r>>>8,0==(B|0)?u=0:16777215<r>>>0?u=31:(u=(B+1048320|0)>>>16&8,j=B<<u,B=(j+520192|0)>>>16&4,j<<=B,z=(j+245760|0)>>>16&2,u=14-(B|u|z)+(j<<z>>>15)|0,u=r>>>((u+7|0)>>>0)&1|u<<1),B=(u<<2)+U+304|0,D[c+(i+7)]=u,j=v+(b+16)|0,D[c+(i+5)]=0,D[j>>2]=0,j=D[U+4>>2],z=1<<u,0==(j&z|0)){D[U+4>>2]=j|z,D[B>>2]=x,D[c+(i+6)]=B,D[c+(i+3)]=x,D[c+(i+2)]=x}else{u=r<<(31==(u|0)?0:25-(u>>>1)|0);for(B=D[B>>2];;){if((D[B+4>>2]&-8|0)==(r|0)){j=B+8|0;z=N[j>>2];A=N[U+16>>2];E=B>>>0<A>>>0;do{if(!E&&z>>>0>=A>>>0){D[z+12>>2]=x;D[j>>2]=x;D[c+(i+2)]=z;D[c+(i+3)]=B;D[c+(i+6)]=0;break a}}while(0);V();a("Reached an unreachable!")}j=(u>>>31<<2)+B+16|0;z=N[j>>2];if(0==(z|0)){if(j>>>0>=N[U+16>>2]>>>0){D[j>>2]=x;D[c+(i+6)]=B;D[c+(i+3)]=x;D[c+(i+2)]=x;break a}V();a("Reached an unreachable!")}u<<=1;B=z}}}}}}while(0);return b+(l|8)|0}xe.X=1;function ye(b,f){var e,d,c=N[U+24>>2];d=c>>2;var g=ue(c),h=D[g>>2];e=D[g+4>>2];var g=h+e|0,i=h+(e-39)|0,h=h+(e-47)+(0==(i&7|0)?0:-i&7)|0,h=h>>>0<(c+16|0)>>>0?c:h,i=h+8|0;e=i>>2;we(b,f-40|0);D[(h+4|0)>>2]=27;D[e]=D[U+444>>2];D[e+1]=D[U+448>>2];D[e+2]=D[U+452>>2];D[e+3]=D[U+456>>2];D[U+444>>2]=b;D[U+448>>2]=f;D[U+456>>2]=0;D[U+452>>2]=i;e=h+28|0;D[e>>2]=7;i=(h+32|0)>>>0<g>>>0;a:do{if(i){for(var j=e;;){var l=j+4|0;D[l>>2]=7;if((j+8|0)>>>0>=g>>>0){break a}j=l}}}while(0);g=(h|0)==(c|0);a:do{if(!g){if(e=h-c|0,i=c+e|0,j=e+(c+4)|0,D[j>>2]&=-2,D[d+1]=e|1,D[i>>2]=e,256>e>>>0){j=e>>>2&1073741822,i=(j<<2)+U+40|0,l=N[U>>2],e=1<<(e>>>3),0==(l&e|0)?(D[U>>2]=l|e,e=i,j=(j+2<<2)+U+40|0):(j=(j+2<<2)+U+40|0,e=N[j>>2],e>>>0<N[U+16>>2]>>>0&&(V(),a("Reached an unreachable!"))),D[j>>2]=c,D[e+12>>2]=c,D[d+2]=e,D[d+3]=i}else{i=c;l=e>>>8;if(0==(l|0)){j=0}else{if(16777215<e>>>0){j=31}else{var j=(l+1048320|0)>>>16&8,q=l<<j,l=(q+520192|0)>>>16&4,q=q<<l,t=(q+245760|0)>>>16&2,j=14-(l|j|t)+(q<<t>>>15)|0,j=e>>>((j+7|0)>>>0)&1|j<<1}}l=(j<<2)+U+304|0;D[d+7]=j;D[d+5]=0;D[d+4]=0;q=D[U+4>>2];t=1<<j;if(0==(q&t|0)){D[U+4>>2]=q|t,D[l>>2]=i,D[d+6]=l,D[d+3]=c,D[d+2]=c}else{j=e<<(31==(j|0)?0:25-(j>>>1)|0);for(l=D[l>>2];;){if((D[l+4>>2]&-8|0)==(e|0)){var q=l+8|0,t=N[q>>2],v=N[U+16>>2],p=l>>>0<v>>>0;do{if(!p&&t>>>0>=v>>>0){D[t+12>>2]=i;D[q>>2]=i;D[d+2]=t;D[d+3]=l;D[d+6]=0;break a}}while(0);V();a("Reached an unreachable!")}q=(j>>>31<<2)+l+16|0;t=N[q>>2];if(0==(t|0)){if(q>>>0>=N[U+16>>2]>>>0){D[q>>2]=i;D[d+6]=l;D[d+3]=c;D[d+2]=c;break a}V();a("Reached an unreachable!")}j<<=1;l=t}}}}}while(0)}ye.X=1;var Xc;function vc(b,f){var e=0;if(20<=f){for(var d=b+f;b%4;){n[b++]=e}0>e&&(e+=256);for(var c=b>>2,g=d>>2,h=e|e<<8|e<<16|e<<24;c<g;){D[c++]=h}for(b=c<<2;b<d;){n[b++]=e}}else{for(;f--;){n[b++]=e}}}function kd(b,f,e){if(20<=e&&f%2==b%2){if(f%4==b%4){for(e=f+e;f%4;){n[b++]=n[f++]}for(var f=f>>2,b=b>>2,d=e>>2;f<d;){D[b++]=D[f++]}f<<=2;for(b<<=2;f<e;){n[b++]=n[f++]}}else{e=f+e;f%2&&(n[b++]=n[f++]);f>>=1;b>>=1;for(d=e>>1;f<d;){o[b++]=o[f++]}f<<=1;b<<=1;f<e&&(n[b++]=n[f++])}}else{for(;e--;){n[b++]=n[f++]}}}var De=13,Ee=9,Fe=17,Ge=22,He=5,Ie=21,Je=2,Ke=6;function Z(b){ze||(ze=P([0],"i32",O));D[ze>>2]=b}var ze,Le=0,Me=0,Ne=0,Oe=2,T=[fa],Pe=k;function Qe(b,f){if("string"!==typeof b){return fa}f===da&&(f="/");b&&"/"==b[0]&&(f="");for(var e=(f+"/"+b).split("/").reverse(),d=[""];e.length;){var c=e.pop();""==c||"."==c||(".."==c?1<d.length&&d.pop():d.push(c))}return 1==d.length?"/":d.join("/")}function Re(b,f,e){var d={N:m,p:m,error:0,name:fa,path:fa,object:fa,r:m,s:fa,k:fa},b=Qe(b);if("/"==b){d.N=k,d.p=d.r=k,d.name="/",d.path=d.s="/",d.object=d.k=Se}else{if(b!==fa){for(var e=e||0,b=b.slice(1).split("/"),c=Se,g=[""];b.length;){1==b.length&&c.b&&(d.r=k,d.s=1==g.length?"/":g.join("/"),d.k=c,d.name=b[0]);var h=b.shift();if(c.b){if(c.t){if(!c.a.hasOwnProperty(h)){d.error=Je;break}}else{d.error=De;break}}else{d.error=20;break}c=c.a[h];if(c.link&&!(f&&0==b.length)){if(40<e){d.error=40;break}d=Qe(c.link,g.join("/"));d=Re([d].concat(b).join("/"),f,e+1);break}g.push(h);0==b.length&&(d.p=k,d.path=g.join("/"),d.object=c)}}}return d}function ua(b){Te();b=Re(b,da);if(b.p){return b.object}Z(b.error);return fa}function Ue(b,f,e,d,c){b||(b="/");"string"===typeof b&&(b=ua(b));b||(Z(De),a(Error("Parent path must exist.")));b.b||(Z(20),a(Error("Parent must be a folder.")));!b.write&&!Pe&&(Z(De),a(Error("Parent folder must be writeable.")));if(!f||"."==f||".."==f){Z(Je),a(Error("Name must not be empty."))}b.a.hasOwnProperty(f)&&(Z(Fe),a(Error("Can't overwrite object.")));b.a[f]={t:d===da?k:d,write:c===da?m:c,timestamp:Date.now(),M:Oe++};for(var g in e){e.hasOwnProperty(g)&&(b.a[f][g]=e[g])}return b.a[f]}function Ve(b,f){return Ue(b,f,{b:k,d:m,a:{}},k,k)}function We(){var b="dev/shm/tmp",f=ua("/");f===fa&&a(Error("Invalid parent."));for(b=b.split("/").reverse();b.length;){var e=b.pop();e&&(f.a.hasOwnProperty(e)||Ve(f,e),f=f.a[e])}}function ta(b,f,e,d,c){if("string"===typeof e){for(var g=Array(e.length),h=0,i=e.length;h<i;++h){g[h]=e.charCodeAt(h)}e=g}return Ue(b,f,{d:m,a:e,b:m},d,c)}function mf(b,f,e,d){!e&&!d&&a(Error("A device must have at least one callback defined."));var c={d:k,input:e,h:d};c.b=m;return Ue(b,f,c,Boolean(e),Boolean(d))}function Te(){Se||(Se={t:k,write:k,b:k,d:m,timestamp:Date.now(),M:1,a:{}})}function nf(){var b,f,e;function d(b){b===fa||10===b?(f.l(f.buffer.join("")),f.buffer=[]):f.buffer.push(String.fromCharCode(b))}bc(!of,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");of=k;Te();b=b||Module.stdin;f=f||Module.stdout;e=e||Module.stderr;var c=k,g=k,h=k;b||(c=m,b=(function(){if(!b.o||!b.o.length){var c;"undefined"!=typeof window&&"function"==typeof window.prompt?c=window.prompt("Input: "):"function"==typeof readline&&(c=readline());c||(c="");b.o=Bc(c+"\n",k)}return b.o.shift()}));f||(g=m,f=d);f.l||(f.l=Module.print);f.buffer||(f.buffer=[]);e||(h=m,e=d);e.l||(e.l=Module.print);e.buffer||(e.buffer=[]);Ve("/","tmp");var i=Ve("/","dev"),j=mf(i,"stdin",b),l=mf(i,"stdout",fa,f);e=mf(i,"stderr",fa,e);mf(i,"tty",b,f);T[1]={path:"/dev/stdin",object:j,position:0,f:k,g:m,j:m,v:!c,error:m,e:m,c:[]};T[2]={path:"/dev/stdout",object:l,position:0,f:m,g:k,j:m,v:!g,error:m,e:m,c:[]};T[3]={path:"/dev/stderr",object:e,position:0,f:m,g:k,j:m,v:!h,error:m,e:m,c:[]};Le=P([1],"void*",O);Me=P([2],"void*",O);Ne=P([3],"void*",O);We();T[Le]=T[1];T[Me]=T[2];T[Ne]=T[3];P([P([0,0,0,0,Le,0,0,0,Me,0,0,0,Ne,0,0,0],"void*",O)],"void*",O)}var of,Se;function pf(b,f,e,d){var c=T[b];if(!c||c.object.d){return Z(Ee),-1}if(c.f){if(c.object.b){return Z(Ie),-1}if(0>e||0>d){return Z(Ge),-1}for(b=0;c.c.length&&0<e;){n[f++]=c.c.pop(),e--,b++}for(var c=c.object.a,e=Math.min(c.length-d,e),g=0;g<e;g++){n[f+g]=c[d+g],b++}return b}Z(De);return-1}function Yd(b,f){var e=16384,d=T[b];if(d){if(d.f){if(0>e){return Z(Ge),-1}var c;if(d.object.d){if(d.object.input){for(c=0;d.c.length&&0<e;){n[f++]=d.c.pop(),e--,c++}for(var g=0;g<e;g++){try{var h=d.object.input()}catch(i){return Z(He),-1}if(h===fa||h===da){break}c++;n[f+g]=h}return c}Z(Ke);return-1}g=d.c.length;c=pf(b,f,e,d.position);-1!=c&&(d.position+=d.c.length-g+c);return c}Z(De);return-1}Z(Ee);return-1}function Zd(b,f){a("Assertion failed: "+kc(f)+", at: "+[kc(Q.z|0),b,kc(Q.w|0)])}function $d(b,f,e){var d=T[b];if(d){if(d.g){if(0>e){return Z(Ge),-1}if(d.object.d){if(d.object.h){for(var c=0;c<e;c++){try{d.object.h(n[f+c])}catch(g){return Z(He),-1}}d.object.timestamp=Date.now();return c}Z(Ke);return-1}c=d.position;b=T[b];if(!b||b.object.d){Z(Ee),f=-1}else{if(b.g){if(b.object.b){Z(Ie),f=-1}else{if(0>e||0>c){Z(Ge),f=-1}else{for(var h=b.object.a;h.length<c;){h.push(0)}for(var i=0;i<e;i++){h[c+i]=H[f+i]}b.object.timestamp=Date.now();f=i}}}else{Z(De),f=-1}}-1!=f&&(d.position+=f);return f}Z(De);return-1}Z(Ee);return-1}var qf=fa;function rf(b,f){var e=P([511,0,0,0],"i32",oc),d=D[e>>2],e=f&3,c=0!=e,g=1!=e,h=Boolean(f&512),i=Boolean(f&2048),j=Boolean(f&1024),l=Boolean(f&8),b=Re(kc(b));if(!b.r){return Z(b.error),-1}if(e=b.object||fa){if(h&&i){return Z(Fe),-1}if((c||h||j)&&e.b){return Z(Ie),-1}if(g&&!e.t||c&&!e.write){return Z(De),-1}if(j&&!e.d){e.a=[]}else{d=e;if(d.d||d.b||d.link||d.a){d=k}else{h=k;if("undefined"!==typeof XMLHttpRequest){bc("Cannot do synchronous binary XHRs in modern browsers. Use --embed-file or --preload-file in emcc")}else{if(Module.read){try{d.a=Bc(Module.read(d.url),k)}catch(q){h=m}}else{a(Error("Cannot load without read() or XMLHttpRequest."))}}h||Z(He);d=h}if(!d){return Z(He),-1}}d=b.path}else{if(!h){return Z(Je),-1}if(!b.k.write){return Z(De),-1}e=ta(b.k,b.name,[],d&256,d&128);d=b.s+"/"+b.name}h=T.length;if(e.b){c=0;qf&&(c=uc(qf.O));var g=[],t;for(t in e.a){g.push(t)}T[h]={path:d,object:e,position:-2,f:k,g:m,j:m,error:m,e:m,c:[],a:g,P:c}}else{T[h]={path:d,object:e,position:0,f:g,g:c,j:l,error:m,e:m,c:[]}}return h}function oe(b,f){var e,f=kc(f);if("r"==f[0]){e=-1!=f.indexOf("+")?2:0}else{if("w"==f[0]){e=-1!=f.indexOf("+")?2:1,e|=1536}else{if("a"==f[0]){e=-1!=f.indexOf("+")?2:1,e|=520}else{return Z(Ge),0}}}e=rf(b,e);return-1==e?0:e}function V(){a("abort() at "+Error().stack)}function Ce(){switch(8){case 8:return xc;case 54:case 56:case 21:case 61:case 63:case 22:case 67:case 23:case 24:case 25:case 26:case 27:case 69:case 28:case 101:case 70:case 71:case 29:case 30:case 199:case 75:case 76:case 32:case 43:case 44:case 80:case 46:case 47:case 45:case 48:case 49:case 42:case 82:case 33:case 7:case 108:case 109:case 107:case 112:case 119:case 121:return 200809;case 13:case 104:case 94:case 95:case 34:case 35:case 77:case 81:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 91:case 94:case 95:case 110:case 111:case 113:case 114:case 115:case 116:case 117:case 118:case 120:case 40:case 16:case 79:case 19:return-1;case 92:case 93:case 5:case 72:case 6:case 74:case 92:case 93:case 96:case 97:case 98:case 99:case 102:case 103:case 105:return 1;case 38:case 66:case 50:case 51:case 4:return 1024;case 15:case 64:case 41:return 32;case 55:case 37:case 17:return 2147483647;case 18:case 1:return 47839;case 59:case 57:return 99;case 68:case 58:return 2048;case 0:return 2097152;case 3:return 65536;case 14:return 32768;case 73:return 32767;case 39:return 16384;case 60:return 1e3;case 106:return 700;case 52:return 256;case 62:return 255;case 2:return 100;case 65:return 64;case 36:return 20;case 100:return 16;case 20:return 6;case 53:return 4}Z(Ge);return-1}function ve(b){sf||(Vb=Vb+4095>>12<<12,sf=k);var f=Vb;0!=b&&Ub(b);return f}var sf;Gc.unshift({q:(function(){!Module.noFSInit&&!of&&nf()})});Hc.push({q:(function(){Pe=m})});Ic.push({q:(function(){of&&(T[2]&&0<T[2].object.h.buffer.length&&T[2].object.h(10),T[3]&&0<T[3].object.h.buffer.length&&T[3].object.h(10))})});Z(0);Module.L=(function(b){function f(){for(var b=0;3>b;b++){d.push(0)}}var e=b.length+1,d=[P(Bc("/bin/this.program"),"i8",O)];f();for(var c=0;c<e-1;c+=1){d.push(P(Bc(b[c]),"i8",O)),f()}d.push(0);d=P(d,"i32",O);return ae(0,d)});var bd,Yc,Zc,$c,wd,xd,zd,Ad,Bd,Cd,tf,U,se;bd=P([0,0,0,0,0,0,0,0,6,0,0,0,4,0,4,0,8,0,4,0,8,0,0,0,4,0,5,0,16,0,8,0,8,0,0,0,4,0,6,0,32,0,32,0,8,0,0,0,4,0,4,0,16,0,16,0,10,0,0,0,8,0,16,0,32,0,32,0,10,0,0,0,8,0,16,0,128,0,128,0,10,0,0,0,8,0,32,0,128,0,256,0,10,0,0,0,32,0,128,0,258,0,1024,0,10,0,0,0,32,0,258,0,258,0,4096,0,10,0,0,0],["i16",0,"i16",0,"i16",0,"i16",0,"*",0,0,0,"i16",0,"i16",0,"i16",0,"i16",0,"*",0,0,0,"i16",0,"i16",0,"i16",0,"i16",0,"*",0,0,0,"i16",0,"i16",0,"i16",0,"i16",0,"*",0,0,0,"i16",0,"i16",0,"i16",0,"i16",0,"*",0,0,0,"i16",0,"i16",0,"i16",0,"i16",0,"*",0,0,0,"i16",0,"i16",0,"i16",0,"i16",0,"*",0,0,0,"i16",0,"i16",0,"i16",0,"i16",0,"*",0,0,0,"i16",0,"i16",0,"i16",0,"i16",0,"*",0,0,0,"i16",0,"i16",0,"i16",0,"i16",0,"*",0,0,0],O);Q.m=P([0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29],"i8",O);Q.i=P([0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],"i8",O);Yc=P([0,0,0,0,0,0,0,0,257,0,0,0,286,0,0,0,15,0,0,0],["*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],O);Zc=P([0,0,0,0,0,0,0,0,0,0,0,0,30,0,0,0,15,0,0,0],["*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],O);$c=P([0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,7,0,0,0],["*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],O);wd=P([12,0,8,0,140,0,8,0,76,0,8,0,204,0,8,0,44,0,8,0,172,0,8,0,108,0,8,0,236,0,8,0,28,0,8,0,156,0,8,0,92,0,8,0,220,0,8,0,60,0,8,0,188,0,8,0,124,0,8,0,252,0,8,0,2,0,8,0,130,0,8,0,66,0,8,0,194,0,8,0,34,0,8,0,162,0,8,0,98,0,8,0,226,0,8,0,18,0,8,0,146,0,8,0,82,0,8,0,210,0,8,0,50,0,8,0,178,0,8,0,114,0,8,0,242,0,8,0,10,0,8,0,138,0,8,0,74,0,8,0,202,0,8,0,42,0,8,0,170,0,8,0,106,0,8,0,234,0,8,0,26,0,8,0,154,0,8,0,90,0,8,0,218,0,8,0,58,0,8,0,186,0,8,0,122,0,8,0,250,0,8,0,6,0,8,0,134,0,8,0,70,0,8,0,198,0,8,0,38,0,8,0,166,0,8,0,102,0,8,0,230,0,8,0,22,0,8,0,150,0,8,0,86,0,8,0,214,0,8,0,54,0,8,0,182,0,8,0,118,0,8,0,246,0,8,0,14,0,8,0,142,0,8,0,78,0,8,0,206,0,8,0,46,0,8,0,174,0,8,0,110,0,8,0,238,0,8,0,30,0,8,0,158,0,8,0,94,0,8,0,222,0,8,0,62,0,8,0,190,0,8,0,126,0,8,0,254,0,8,0,1,0,8,0,129,0,8,0,65,0,8,0,193,0,8,0,33,0,8,0,161,0,8,0,97,0,8,0,225,0,8,0,17,0,8,0,145,0,8,0,81,0,8,0,209,0,8,0,49,0,8,0,177,0,8,0,113,0,8,0,241,0,8,0,9,0,8,0,137,0,8,0,73,0,8,0,201,0,8,0,41,0,8,0,169,0,8,0,105,0,8,0,233,0,8,0,25,0,8,0,153,0,8,0,89,0,8,0,217,0,8,0,57,0,8,0,185,0,8,0,121,0,8,0,249,0,8,0,5,0,8,0,133,0,8,0,69,0,8,0,197,0,8,0,37,0,8,0,165,0,8,0,101,0,8,0,229,0,8,0,21,0,8,0,149,0,8,0,85,0,8,0,213,0,8,0,53,0,8,0,181,0,8,0,117,0,8,0,245,0,8,0,13,0,8,0,141,0,8,0,77,0,8,0,205,0,8,0,45,0,8,0,173,0,8,0,109,0,8,0,237,0,8,0,29,0,8,0,157,0,8,0,93,0,8,0,221,0,8,0,61,0,8,0,189,0,8,0,125,0,8,0,253,0,8,0,19,0,9,0,275,0,9,0,147,0,9,0,403,0,9,0,83,0,9,0,339,0,9,0,211,0,9,0,467,0,9,0,51,0,9,0,307,0,9,0,179,0,9,0,435,0,9,0,115,0,9,0,371,0,9,0,243,0,9,0,499,0,9,0,11,0,9,0,267,0,9,0,139,0,9,0,395,0,9,0,75,0,9,0,331,0,9,0,203,0,9,0,459,0,9,0,43,0,9,0,299,0,9,0,171,0,9,0,427,0,9,0,107,0,9,0,363,0,9,0,235,0,9,0,491,0,9,0,27,0,9,0,283,0,9,0,155,0,9,0,411,0,9,0,91,0,9,0,347,0,9,0,219,0,9,0,475,0,9,0,59,0,9,0,315,0,9,0,187,0,9,0,443,0,9,0,123,0,9,0,379,0,9,0,251,0,9,0,507,0,9,0,7,0,9,0,263,0,9,0,135,0,9,0,391,0,9,0,71,0,9,0,327,0,9,0,199,0,9,0,455,0,9,0,39,0,9,0,295,0,9,0,167,0,9,0,423,0,9,0,103,0,9,0,359,0,9,0,231,0,9,0,487,0,9,0,23,0,9,0,279,0,9,0,151,0,9,0,407,0,9,0,87,0,9,0,343,0,9,0,215,0,9,0,471,0,9,0,55,0,9,0,311,0,9,0,183,0,9,0,439,0,9,0,119,0,9,0,375,0,9,0,247,0,9,0,503,0,9,0,15,0,9,0,271,0,9,0,143,0,9,0,399,0,9,0,79,0,9,0,335,0,9,0,207,0,9,0,463,0,9,0,47,0,9,0,303,0,9,0,175,0,9,0,431,0,9,0,111,0,9,0,367,0,9,0,239,0,9,0,495,0,9,0,31,0,9,0,287,0,9,0,159,0,9,0,415,0,9,0,95,0,9,0,351,0,9,0,223,0,9,0,479,0,9,0,63,0,9,0,319,0,9,0,191,0,9,0,447,0,9,0,127,0,9,0,383,0,9,0,255,0,9,0,511,0,9,0,0,0,7,0,64,0,7,0,32,0,7,0,96,0,7,0,16,0,7,0,80,0,7,0,48,0,7,0,112,0,7,0,8,0,7,0,72,0,7,0,40,0,7,0,104,0,7,0,24,0,7,0,88,0,7,0,56,0,7,0,120,0,7,0,4,0,7,0,68,0,7,0,36,0,7,0,100,0,7,0,20,0,7,0,84,0,7,0,52,0,7,0,116,0,7,0,3,0,8,0,131,0,8,0,67,0,8,0,195,0,8,0,35,0,8,0,163,0,8,0,99,0,8,0,227,0,8,0],["i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0],O);xd=P([0,0,5,0,16,0,5,0,8,0,5,0,24,0,5,0,4,0,5,0,20,0,5,0,12,0,5,0,28,0,5,0,2,0,5,0,18,0,5,0,10,0,5,0,26,0,5,0,6,0,5,0,22,0,5,0,14,0,5,0,30,0,5,0,1,0,5,0,17,0,5,0,9,0,5,0,25,0,5,0,5,0,5,0,21,0,5,0,13,0,5,0,29,0,5,0,3,0,5,0,19,0,5,0,11,0,5,0,27,0,5,0,7,0,5,0,23,0,5,0],["i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0],O);zd=P([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],O);Ad=P([0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,10,0,0,0,12,0,0,0,14,0,0,0,16,0,0,0,20,0,0,0,24,0,0,0,28,0,0,0,32,0,0,0,40,0,0,0,48,0,0,0,56,0,0,0,64,0,0,0,80,0,0,0,96,0,0,0,112,0,0,0,128,0,0,0,160,0,0,0,192,0,0,0,224,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],O);Bd=P([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,9,0,0,0,9,0,0,0,10,0,0,0,10,0,0,0,11,0,0,0,11,0,0,0,12,0,0,0,12,0,0,0,13,0,0,0,13,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],O);Cd=P([0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,6,0,0,0,8,0,0,0,12,0,0,0,16,0,0,0,24,0,0,0,32,0,0,0,48,0,0,0,64,0,0,0,96,0,0,0,128,0,0,0,192,0,0,0,256,0,0,0,384,0,0,0,512,0,0,0,768,0,0,0,1024,0,0,0,1536,0,0,0,2048,0,0,0,3072,0,0,0,4096,0,0,0,6144,0,0,0,8192,0,0,0,12288,0,0,0,16384,0,0,0,24576,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],O);Q.u=P([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],"i8",O);tf=P([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,7,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],O);Q.C=P([115,116,114,101,97,109,32,101,114,114,111,114,0],"i8",O);Q.G=P([105,110,115,117,102,102,105,99,105,101,110,116,32,109,101,109,111,114,121,0],"i8",O);Q.n=P([98,117,102,102,101,114,32,101,114,114,111,114,0],"i8",O);Q.z=P([100,101,102,46,99,0],"i8",O);Q.w=P([100,101,102,0],"i8",O);Q.A=P([114,101,116,32,33,61,32,90,95,83,84,82,69,65,77,95,69,82,82,79,82,0],"i8",O);Q.B=P([115,116,114,109,46,97,118,97,105,108,95,105,110,32,61,61,32,48,0],"i8",O);Q.D=P([114,101,116,32,61,61,32,90,95,83,84,82,69,65,77,95,69,78,68,0],"i8",O);Q.F=P([105,110,112,117,116,0],"i8",O);Q.H=P([114,98,0],"i8",O);Q.I=P([111,117,116,112,117,116,0],"i8",O);Q.J=P([119,98,0],"i8",O);U=P(468,["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0],O);se=P(24,"i32",O);D[Yc>>2]=wd|0;D[Yc+4>>2]=zd|0;D[Zc>>2]=xd|0;D[Zc+4>>2]=Bd|0;D[$c+4>>2]=tf|0;wc=[0,0,(function(b,f,e){return uc(e*f|0)}),0,(function(b,f){Be(f)}),0,nd,0,od,0,qd,0];Module.FUNCTION_TABLE=wc;function uf(b){b=b||Module.arguments;Module.setStatus&&Module.setStatus("");Module.preRun&&Module.preRun();var f=fa;Module._main&&(Fc(Hc),f=Module.L(b),Module.noExitRuntime||Fc(Ic));Module.postRun&&Module.postRun();return f}Module.run=uf;Fc(Gc);Module.noInitialRun&&(Sc++,Module.monitorRunDependencies&&Module.monitorRunDependencies(Sc));0==Sc&&uf()
-return new Uint8Array(Module.ret()).buffer;
-}
/**
* @param {ArrayBuffer|Uint8Array|Array|string} bytes
* @param {number} level
* @return {ArrayBuffer}
*/
algorithms.deflate = function(bytes, level){
- return deflate(utils.toBytes(bytes), level);
+ return zpipe.deflate(utils.toBytes(bytes), level, false, true).buffer;
};
expose('jz.algorithms.deflate', algorithms.deflate);
View
958 src/algorithms/inflate.js
@@ -5,967 +5,11 @@ utils.js
/**
- * Extracted from https://github.com/imaya/zlib.js
- *
- * The MIT License
- *
- * Copyright (c) 2012 imaya
- *
- * 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.
- */
-
-var Zlib = {};
-var USE_TYPEDARRAY = true;
-
-
-var buildHuffmanTable = function(lengths) {
- /** @type {number} length list size. */
- var listSize = lengths.length;
- /** @type {number} max code length for table size. */
- var maxCodeLength = 0;
- /** @type {number} min code length for table size. */
- var minCodeLength = Number.POSITIVE_INFINITY;
- /** @type {number} table size. */
- var size;
- /** @type {!(Array|Uint8Array)} huffman code table. */
- var table;
- /** @type {number} bit length. */
- var bitLength;
- /** @type {number} huffman code. */
- var code;
- /**
- * サイズが 2^maxlength 個のテーブルを埋めるためのスキップ長.
- * @type {number} skip length for table filling.
- */
- var skip;
- /** @type {number} reversed code. */
- var reversed;
- /** @type {number} reverse temp. */
- var rtemp;
- /** @type {number} loop counter. */
- var i;
- /** @type {number} loop limit. */
- var il;
- /** @type {number} loop counter. */
- var j;
- /** @type {number} loop limit. */
- var jl;
-
- // Math.max は遅いので最長の値は for-loop で取得する
- for (i = 0, il = listSize; i < il; ++i) {
- if (lengths[i] > maxCodeLength) {
- maxCodeLength = lengths[i];
- }
- if (lengths[i] < minCodeLength) {
- minCodeLength = lengths[i];
- }
- }
-
- size = 1 << maxCodeLength;
- table = new (USE_TYPEDARRAY ? Uint32Array : Array)(size);
-
- // ビット長の短い順からハフマン符号を割り当てる
- for (bitLength = 1, code = 0, skip = 2; bitLength <= maxCodeLength;) {
- for (i = 0; i < listSize; ++i) {
- if (lengths[i] === bitLength) {
- // ビットオーダーが逆になるためビット長分並びを反転する
- for (reversed = 0, rtemp = code, j = 0; j < bitLength; ++j) {
- reversed = (reversed << 1) | (rtemp & 1);
- rtemp >>= 1;
- }
-
- // 最大ビット長をもとにテーブルを作るため、
- // 最大ビット長以外では 0 / 1 どちらでも良い箇所ができる
- // そのどちらでも良い場所は同じ値で埋めることで
- // 本来のビット長以上のビット数取得しても問題が起こらないようにする
- for (j = reversed; j < size; j += skip) {
- table[j] = (bitLength << 16) | i;
- }
-
- ++code;
- }
- }
-
- // 次のビット長へ
- ++bitLength;
- code <<= 1;
- skip <<= 1;
- }
-
- return [table, maxCodeLength, minCodeLength];
-};
-
-/** @define {boolean} export symbols. */
-var ZLIB_RAW_INFLATE_EXPORT = false;
-
-/** @define {number} buffer block size. */
-var ZLIB_RAW_INFLATE_BUFFER_SIZE = 0x8000; // [ 0x8000 >= ZLIB_BUFFER_BLOCK_SIZE ]
-
-/**
- * @constructor
- * @param {!(Uint8Array|Array.<number>)} input input buffer.
- * @param {Object} opt_params option parameter.
- *
- * opt_params は以下のプロパティを指定する事ができます。
- * - index: input buffer の deflate コンテナの開始位置.
- * - blockSize: バッファのブロックサイズ.
- * - bufferType: Zlib.RawInflate.BufferType の値によってバッファの管理方法を指定する.
- * - resize: 確保したバッファが実際の大きさより大きかった場合に切り詰める.
- */
-Zlib.RawInflate = function(input, opt_params) {
- /** @type {!(Array.<number>|Uint8Array)} inflated buffer */
- this.buffer;
- /** @type {!Array.<(Array.<number>|Uint8Array)>} */
- this.blocks = [];
- /** @type {number} block size. */
- this.bufferSize = ZLIB_RAW_INFLATE_BUFFER_SIZE;
- /** @type {!number} total output buffer pointer. */
- this.totalpos = 0;
- /** @type {!number} input buffer pointer. */
- this.ip = 0;
- /** @type {!number} bit stream reader buffer. */
- this.bitsbuf = 0;
- /** @type {!number} bit stream reader buffer size. */
- this.bitsbuflen = 0;
- /** @type {!(Array.<number>|Uint8Array)} input buffer. */
- this.input = USE_TYPEDARRAY ? new Uint8Array(input) : input;
- /** @type {!(Uint8Array|Array.<number>)} output buffer. */
- this.output;
- /** @type {!number} output buffer pointer. */
- this.op;
- /** @type {boolean} is final block flag. */
- this.bfinal = false;
- /** @type {Zlib.RawInflate.BufferType} buffer management. */
- this.bufferType = Zlib.RawInflate.BufferType.ADAPTIVE;
- /** @type {boolean} resize flag for memory size optimization. */
- this.resize = false;
-
- // option parameters
- if (opt_params || !(opt_params = {})) {
- if (opt_params['index']) {
- this.ip = opt_params['index'];
- }
- if (opt_params['bufferSize']) {
- this.bufferSize = opt_params['bufferSize'];
- }
- if (opt_params['bufferType']) {
- this.bufferType = opt_params['bufferType'];
- }
- if (opt_params['resize']) {
- this.resize = opt_params['resize'];
- }
- }
-
- // initialize
- switch (this.bufferType) {
- case Zlib.RawInflate.BufferType.BLOCK:
- this.op = Zlib.RawInflate.MaxBackwardLength;
- this.output =
- new (USE_TYPEDARRAY ? Uint8Array : Array)(
- Zlib.RawInflate.MaxBackwardLength +
- this.bufferSize +
- Zlib.RawInflate.MaxCopyLength
- );
- break;
- case Zlib.RawInflate.BufferType.ADAPTIVE:
- this.op = 0;
- this.output = new (USE_TYPEDARRAY ? Uint8Array : Array)(this.bufferSize);
- this.expandBuffer = this.expandBufferAdaptive;
- this.concatBuffer = this.concatBufferDynamic;
- this.decodeHuffman = this.decodeHuffmanAdaptive;
- break;
- default:
- throw new Error('invalid inflate mode');
- }
-};
-
-/**
- * @enum {number}
- */
-Zlib.RawInflate.BufferType = {
- BLOCK: 0,
- ADAPTIVE: 1
-};
-
-/**
- * decompress.
- * @return {!(Uint8Array|Array.<number>)} inflated buffer.
- */
-Zlib.RawInflate.prototype.decompress = function() {
- while (!this.bfinal) {
- this.parseBlock();
- }
-
- return this.concatBuffer();
-};
-
-/**
- * @const
- * @type {number} max backward length for LZ77.
- */
-Zlib.RawInflate.MaxBackwardLength = 32768;
-
-/**
- * @const
- * @type {number} max copy length for LZ77.
- */
-Zlib.RawInflate.MaxCopyLength = 258;
-
-/**
- * huffman order
- * @const
- * @type {!(Array.<number>|Uint8Array)}
- */
-Zlib.RawInflate.Order = (function(table) {
- return USE_TYPEDARRAY ? new Uint16Array(table) : table;
-})([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
-
-/**
- * huffman length code table.
- * @const
- * @type {!(Array.<number>|Uint16Array)}
- */
-Zlib.RawInflate.LengthCodeTable = (function(table) {
- return USE_TYPEDARRAY ? new Uint16Array(table) : table;
-})([
- 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b,
- 0x000d, 0x000f, 0x0011, 0x0013, 0x0017, 0x001b, 0x001f, 0x0023, 0x002b,
- 0x0033, 0x003b, 0x0043, 0x0053, 0x0063, 0x0073, 0x0083, 0x00a3, 0x00c3,
- 0x00e3, 0x0102, 0x0102, 0x0102
-]);
-
-/**
- * huffman length extra-bits table.
- * @const
- * @type {!(Array.<number>|Uint8Array)}
- */
-Zlib.RawInflate.LengthExtraTable = (function(table) {
- return USE_TYPEDARRAY ? new Uint8Array(table) : table;
-})([
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5,
- 5, 5, 0, 0, 0
-]);
-
-/**
- * huffman dist code table.
- * @const
- * @type {!(Array.<number>|Uint16Array)}
- */
-Zlib.RawInflate.DistCodeTable = (function(table) {
- return USE_TYPEDARRAY ? new Uint16Array(table) : table;
-})([
- 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0007, 0x0009, 0x000d, 0x0011,
- 0x0019, 0x0021, 0x0031, 0x0041, 0x0061, 0x0081, 0x00c1, 0x0101, 0x0181,
- 0x0201, 0x0301, 0x0401, 0x0601, 0x0801, 0x0c01, 0x1001, 0x1801, 0x2001,
- 0x3001, 0x4001, 0x6001
-]);
-
-/**
- * huffman dist extra-bits table.
- * @const
- * @type {!(Array.<number>|Uint8Array)}
- */
-Zlib.RawInflate.DistExtraTable = (function(table) {
- return USE_TYPEDARRAY ? new Uint8Array(table) : table;
-})([
- 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11,
- 11, 12, 12, 13, 13
-]);
-
-/**
- * fixed huffman length code table
- * @const
- * @type {!Array}
- */
-Zlib.RawInflate.FixedLiteralLengthTable = (function(table) {
- return table;
-})((function() {
- var lengths = new (USE_TYPEDARRAY ? Uint8Array : Array)(288);
- var i, il;
-
- for (i = 0, il = lengths.length; i < il; ++i) {
- lengths[i] =
- (i <= 143) ? 8 :
- (i <= 255) ? 9 :
- (i <= 279) ? 7 :
- 8;
- }
-
- return buildHuffmanTable(lengths);
-})());
-
-/**
- * fixed huffman distance code table
- * @const
- * @type {!Array}
- */
-Zlib.RawInflate.FixedDistanceTable = (function(table) {
- return table;
-})((function() {
- var lengths = new (USE_TYPEDARRAY ? Uint8Array : Array)(30);
- var i, il;
-
- for (i = 0, il = lengths.length; i < il; ++i) {
- lengths[i] = 5;
- }
-
- return buildHuffmanTable(lengths);
-})());
-
-/**
- * parse deflated block.
- */
-Zlib.RawInflate.prototype.parseBlock = function() {
- /** @type {number} header */
- var hdr = this.readBits(3);
-
- // BFINAL
- if (hdr & 0x1) {
- this.bfinal = true;
- }
-
- // BTYPE
- hdr >>>= 1;
- switch (hdr) {
- // uncompressed
- case 0:
- this.parseUncompressedBlock();
- break;
- // fixed huffman
- case 1:
- this.parseFixedHuffmanBlock();
- break;
- // dynamic huffman
- case 2:
- this.parseDynamicHuffmanBlock();
- break;
- // reserved or other
- default:
- throw new Error('unknown BTYPE: ' + hdr);
- }
-};
-
-/**
- * read inflate bits
- * @param {number} length bits length.
- * @return {number} read bits.
- */
-Zlib.RawInflate.prototype.readBits = function(length) {
- var bitsbuf = this.bitsbuf;
- var bitsbuflen = this.bitsbuflen;
- var input = this.input;
- var ip = this.ip;
-
- /** @type {number} input and output byte. */
- var octet;
-
- // not enough buffer
- while (bitsbuflen < length) {
- // input byte
- octet = input[ip++];
- if (octet === void 0) {
- throw new Error('input buffer is broken');
- }
-
- // concat octet
- bitsbuf |= octet << bitsbuflen;
- bitsbuflen += 8;
- }
-
- // output byte
- octet = bitsbuf & /* MASK */ ((1 << length) - 1);
- bitsbuf >>>= length;
- bitsbuflen -= length;
-
- this.bitsbuf = bitsbuf;
- this.bitsbuflen = bitsbuflen;
- this.ip = ip;
-
- return octet;
-};
-
-/**
- * read huffman code using table
- * @param {Array} table huffman code table.
- * @return {number} huffman code.
- */
-Zlib.RawInflate.prototype.readCodeByTable = function(table) {
- var bitsbuf = this.bitsbuf;
- var bitsbuflen = this.bitsbuflen;
- var input = this.input;
- var ip = this.ip;
-
- /** @type {!(Array.<number>|Uint8Array)} huffman code table */
- var codeTable = table[0];
- /** @type {number} */
- var maxCodeLength = table[1];
- /** @type {number} input byte */
- var octet;
- /** @type {number} code length & code (16bit, 16bit) */
- var codeWithLength;
- /** @type {number} code bits length */
- var codeLength;
-
- // not enough buffer
- while (bitsbuflen < maxCodeLength) {
- octet = input[ip++];
- if (octet === void 0) {
- throw new Error('input buffer is broken');
- }
- bitsbuf |= octet << bitsbuflen;
- bitsbuflen += 8;
- }
-
- // read max length
- codeWithLength = codeTable[bitsbuf & ((1 << maxCodeLength) - 1)];
- codeLength = codeWithLength >>> 16;
-
- this.bitsbuf = bitsbuf >> codeLength;
- this.bitsbuflen = bitsbuflen - codeLength;
- this.ip = ip;
-
- return codeWithLength & 0xffff;
-};
-
-/**
- * parse uncompressed block.
- */
-Zlib.RawInflate.prototype.parseUncompressedBlock = function() {
- var input = this.input;
- var ip = this.ip;
- var output = this.output;
- var op = this.op;
-
- /** @type {number} input byte. */
- var octet;
- /** @type {number} block length */
- var len;
- /** @type {number} number for check block length */
- var nlen;
- /** @type {number} output buffer length */
- var olength = output.length;
- /** @type {number} copy counter */
- var preCopy;
-
- // skip buffered header bits
- this.bitsbuf = 0;
- this.bitsbuflen = 0;
-
- // len (1st)
- octet = input[ip++];
- if (octet === void 0) {
- throw new Error('invalid uncompressed block header: LEN (first byte)');
- }
- len = octet;
-
- // len (2nd)
- octet = input[ip++];
- if (octet === void 0) {
- throw new Error('invalid uncompressed block header: LEN (second byte)');
- }
- len |= octet << 8;
-
- // nlen (1st)
- octet = input[ip++];
- if (octet === void 0) {
- throw new Error('invalid uncompressed block header: NLEN (first byte)');
- }
- nlen = octet;
-
- // nlen (2nd)
- octet = input[ip++];
- if (octet === void 0) {
- throw new Error('invalid uncompressed block header: NLEN (second byte)');
- }
- nlen |= octet << 8;
-
- // check len & nlen
- if (len === ~nlen) {
- throw new Error('invalid uncompressed block header: length verify');
- }
-
- // check size
- if (ip + len > input.length) { throw new Error('input buffer is broken'); }
-
- // expand buffer
- switch (this.bufferType) {
- case Zlib.RawInflate.BufferType.BLOCK:
- // pre copy
- while (op + len > output.length) {
- preCopy = olength - op;
- len -= preCopy;
- if (USE_TYPEDARRAY) {
- output.set(input.subarray(ip, ip + preCopy), op);
- op += preCopy;
- ip += preCopy;
- } else {
- while (preCopy--) {
- output[op++] = input[ip++];
- }
- }
- this.op = op;
- output = this.expandBuffer();
- op = this.op;
- }
- break;
- case Zlib.RawInflate.BufferType.ADAPTIVE:
- while (op + len > output.length) {
- output = this.expandBuffer({fixRatio: 2});
- }
- break;
- default:
- throw new Error('invalid inflate mode');
- }
-
- // copy
- if (USE_TYPEDARRAY) {
- output.set(input.subarray(ip, ip + len), op);
- op += len;
- ip += len;
- } else {
- while (len--) {
- output[op++] = input[ip++];
- }
- }
-
- this.ip = ip;
- this.op = op;
- this.output = output;
-};
-
-/**
- * parse fixed huffman block.
- */
-Zlib.RawInflate.prototype.parseFixedHuffmanBlock = function() {
- this.decodeHuffman(
- Zlib.RawInflate.FixedLiteralLengthTable,
- Zlib.RawInflate.FixedDistanceTable
- );
-};
-
-/**
- * parse dynamic huffman block.
- */
-Zlib.RawInflate.prototype.parseDynamicHuffmanBlock = function() {
- /** @type {number} number of literal and length codes. */
- var hlit = this.readBits(5) + 257;
- /** @type {number} number of distance codes. */
- var hdist = this.readBits(5) + 1;
- /** @type {number} number of code lengths. */
- var hclen = this.readBits(4) + 4;
- /** @type {!(Uint8Array|Array.<number>)} code lengths. */
- var codeLengths =
- new (USE_TYPEDARRAY ? Uint8Array : Array)(Zlib.RawInflate.Order.length);
- /** @type {!Array} code lengths table. */
- var codeLengthsTable;
- /** @type {!(Uint8Array|Array.<number>)} literal and length code lengths. */
- var litlenLengths;
- /** @type {!(Uint8Array|Array.<number>)} distance code lengths. */
- var distLengths;
- /** @type {number} loop counter. */
- var i;
-
- // decode code lengths
- for (i = 0; i < hclen; ++i) {
- codeLengths[Zlib.RawInflate.Order[i]] = this.readBits(3);
- }
- codeLengthsTable = buildHuffmanTable(codeLengths);
-
- /**
- * decode function
- * @param {number} num number of lengths.
- * @param {!Array} table code lengths table.
- * @param {!(Uint8Array|Array.<number>)} lengths code lengths buffer.
- * @return {!(Uint8Array|Array.<number>)} code lengths buffer.
- */
- function decode(num, table, lengths) {
- /** @type {number} */
- var code;
- /** @type {number} */
- var prev;
- /** @type {number} */
- var repeat;
- /** @type {number} */
- var i;
-
- for (i = 0; i < num;) {
- code = this.readCodeByTable(table);
- switch (code) {
- case 16:
- repeat = 3 + this.readBits(2);
- while (repeat--) { lengths[i++] = prev; }
- break;
- case 17:
- repeat = 3 + this.readBits(3);
- while (repeat--) { lengths[i++] = 0; }
- prev = 0;
- break;
- case 18:
- repeat = 11 + this.readBits(7);
- while (repeat--) { lengths[i++] = 0; }
- prev = 0;
- break;
- default:
- lengths[i++] = code;
- prev = code;
- break;
- }
- }
-
- return lengths;
- }
-
- // literal and length code
- litlenLengths = new (USE_TYPEDARRAY ? Uint8Array : Array)(hlit);
-
- // distance code
- distLengths = new (USE_TYPEDARRAY ? Uint8Array : Array)(hdist);
-
- //return;
- this.decodeHuffman(
- buildHuffmanTable(decode.call(this, hlit, codeLengthsTable, litlenLengths)),
- buildHuffmanTable(decode.call(this, hdist, codeLengthsTable, distLengths))
- );
-};
-
-/**
- * decode huffman code
- * @param {!Array} litlen literal and length code table.
- * @param {!Array} dist distination code table.
- */
-Zlib.RawInflate.prototype.decodeHuffman = function(litlen, dist) {
- var output = this.output;
- var op = this.op;
-
- this.currentLitlenTable = litlen;
-
- /** @type {number} output position limit. */
- var olength = output.length - Zlib.RawInflate.MaxCopyLength;
- /** @type {number} huffman code. */
- var code;
- /** @type {number} table index. */
- var ti;
- /** @type {number} huffman code distination. */
- var codeDist;
- /** @type {number} huffman code length. */
- var codeLength;
-
- while ((code = this.readCodeByTable(litlen)) !== 256) {
- // literal
- if (code < 256) {
- if (op >= olength) {
- this.op = op;
- output = this.expandBuffer();
- op = this.op;
- }
- output[op++] = code;
-
- continue;
- }
-
- // length code
- ti = code - 257;
- codeLength = Zlib.RawInflate.LengthCodeTable[ti];
- if (Zlib.RawInflate.LengthExtraTable[ti] > 0) {
- codeLength += this.readBits(Zlib.RawInflate.LengthExtraTable[ti]);
- }
-
- // dist code
- code = this.readCodeByTable(dist);
- codeDist = Zlib.RawInflate.DistCodeTable[code];
- if (Zlib.RawInflate.DistExtraTable[code] > 0) {
- codeDist += this.readBits(Zlib.RawInflate.DistExtraTable[code]);
- }
-
- // lz77 decode
- if (op >= olength) {
- this.op = op;
- output = this.expandBuffer();
- op = this.op;
- }
- while (codeLength--) {
- output[op] = output[(op++) - codeDist];
- }
- }
-
- while (this.bitsbuflen >= 8) {
- this.bitsbuflen -= 8;
- this.ip--;
- }
- this.op = op;
-};
-
-/**
- * decode huffman code (adaptive)
- * @param {!Array} litlen literal and length code table.
- * @param {!Array} dist distination code table.
- */
-Zlib.RawInflate.prototype.decodeHuffmanAdaptive = function(litlen, dist) {
- var output = this.output;
- var op = this.op;
-
- this.currentLitlenTable = litlen;
-
- /** @type {number} output position limit. */
- var olength = output.length;
- /** @type {number} huffman code. */
- var code;
- /** @type {number} table index. */
- var ti;
- /** @type {number} huffman code distination. */
- var codeDist;
- /** @type {number} huffman code length. */
- var codeLength;
-
- while ((code = this.readCodeByTable(litlen)) !== 256) {
- // literal
- if (code < 256) {
- if (op >= olength) {
- output = this.expandBuffer();
- olength = output.length;
- }
- output[op++] = code;
-
- continue;
- }
-
- // length code
- ti = code - 257;
- codeLength = Zlib.RawInflate.LengthCodeTable[ti];
- if (Zlib.RawInflate.LengthExtraTable[ti] > 0) {
- codeLength += this.readBits(Zlib.RawInflate.LengthExtraTable[ti]);
- }
-
- // dist code
- code = this.readCodeByTable(dist);
- codeDist = Zlib.RawInflate.DistCodeTable[code];
- if (Zlib.RawInflate.DistExtraTable[code] > 0) {
- codeDist += this.readBits(Zlib.RawInflate.DistExtraTable[code]);
- }
-
- // lz77 decode
- if (op + codeLength > olength) {
- output = this.expandBuffer();
- olength = output.length;
- }
- while (codeLength--) {
- output[op] = output[(op++) - codeDist];
- }
- }
-
- while (this.bitsbuflen >= 8) {
- this.bitsbuflen -= 8;
- this.ip--;
- }
- this.op = op;
-};
-
-/**
- * expand output buffer.
- * @param {Object=} opt_param option parameters.
- * @return {!(Array.<number>|Uint8Array)} output buffer.
- */
-Zlib.RawInflate.prototype.expandBuffer = function(opt_param) {
- /** @type {!(Array.<number>|Uint8Array)} store buffer. */
- var buffer =
- new (USE_TYPEDARRAY ? Uint8Array : Array)(
- this.op - Zlib.RawInflate.MaxBackwardLength
- );
- /** @type {number} backward base point */
- var backward = this.op - Zlib.RawInflate.MaxBackwardLength;
- /** @type {number} copy index. */
- var i;
- /** @type {number} copy limit */
- var il;
-
- var output = this.output;
-
- // copy to output buffer
- if (USE_TYPEDARRAY) {
- buffer.set(output.subarray(Zlib.RawInflate.MaxBackwardLength, buffer.length));
- } else {
- for (i = 0, il = buffer.length; i < il; ++i) {
- buffer[i] = output[i + Zlib.RawInflate.MaxBackwardLength];
- }
- }
-
- this.blocks.push(buffer);
- this.totalpos += buffer.length;
-
- // copy to backward buffer
- if (USE_TYPEDARRAY) {
- output.set(
- output.subarray(backward, backward + Zlib.RawInflate.MaxBackwardLength)
- );
- } else {
- for (i = 0; i < Zlib.RawInflate.MaxBackwardLength; ++i) {
- output[i] = output[backward + i];
- }
- }
-
- this.op = Zlib.RawInflate.MaxBackwardLength;
-
- return output;
-};
-
-/**
- * expand output buffer. (adaptive)
- * @param {Object=} opt_param option parameters.
- * @return {!(Array.<number>|Uint8Array)} output buffer pointer.
- */
-Zlib.RawInflate.prototype.expandBufferAdaptive = function(opt_param) {
- /** @type {!(Array.<number>|Uint8Array)} store buffer. */
- var buffer;
- /** @type {number} expantion ratio. */
- var ratio = (this.input.length / this.ip + 1) | 0;
- /** @type {number} maximum number of huffman code. */
- var maxHuffCode;
- /** @type {number} new output buffer size. */
- var newSize;
- /** @type {number} max inflate size. */
- var maxInflateSize;
-
- var input = this.input;
- var output = this.output;
-
- if (opt_param) {
- if (typeof opt_param.fixRatio === 'number') {
- ratio = opt_param.fixRatio;
- }
- if (typeof opt_param.addRatio === 'number') {
- ratio += opt_param.addRatio;
- }
- }
-
- // calculate new buffer size
- if (ratio < 2) {
- maxHuffCode =
- (input.length - this.ip) / this.currentLitlenTable[2];
- maxInflateSize = (maxHuffCode / 2 * 258) | 0;
- newSize = maxInflateSize < output.length ?
- output.length + maxInflateSize :
- output.length << 1;
- } else {
- newSize = output.length * ratio;
- }
-
- // buffer expantion
- if (USE_TYPEDARRAY) {
- buffer = new Uint8Array(newSize);
- buffer.set(output);
- } else {
- buffer = output;
- }
-
- this.output = buffer;
-
- return this.output;
-};
-
-/**
- * concat output buffer.
- * @return {!(Array.<number>|Uint8Array)} output buffer.
- */
-Zlib.RawInflate.prototype.concatBuffer = function() {
- /** @type {number} buffer pointer. */
- var pos = 0;
- /** @type {number} buffer pointer. */
- var limit = this.totalpos + (this.op - Zlib.RawInflate.MaxBackwardLength);
- /** @type {!(Array.<number>|Uint8Array)} output block array. */
- var output = this.output;
- /** @type {!Array} blocks array. */
- var blocks = this.blocks;
- /** @type {!(Array.<number>|Uint8Array)} output block array. */
- var block;
- /** @type {!(Array.<number>|Uint8Array)} output buffer. */
- var buffer = new (USE_TYPEDARRAY ? Uint8Array : Array)(limit);
- /** @type {number} loop counter. */
- var i;
- /** @type {number} loop limiter. */
- var il;
- /** @type {number} loop counter. */
- var j;
- /** @type {number} loop limiter. */
- var jl;
-
- // single buffer
- if (blocks.length === 0) {
- return USE_TYPEDARRAY ?
- this.output.subarray(Zlib.RawInflate.MaxBackwardLength, this.op) :
- this.output.slice(Zlib.RawInflate.MaxBackwardLength, this.op);
- }
-
- // copy to buffer
- for (i = 0, il = blocks.length; i < il; ++i) {
- block = blocks[i];
- for (j = 0, jl = block.length; j < jl; ++j) {
- buffer[pos++] = block[j];
- }
- }
-
- // current buffer
- for (i = Zlib.RawInflate.MaxBackwardLength, il = this.op; i < il; ++i) {
- buffer[pos++] = output[i];
- }
-
- this.blocks = [];
- this.buffer = buffer;
-
- return this.buffer;
-};
-
-/**
- * concat output buffer. (dynamic)
- * @return {!(Array.<number>|Uint8Array)} output buffer.
- */
-Zlib.RawInflate.prototype.concatBufferDynamic = function() {
- /** @type {Array.<number>|Uint8Array} output buffer. */
- var buffer;
- var op = this.op;
-
- if (USE_TYPEDARRAY) {
- if (this.resize) {
- buffer = new Uint8Array(op);
- buffer.set(this.output.subarray(0, op));
- } else {
- buffer = this.output.subarray(0, op);
- }
- } else {
- if (this.output.length > op) {
- this.output.length = op;
- }
- buffer = this.output;
- }
-
- this.buffer = buffer;
-
- return this.buffer;
-};
-
-
-/**
* @param {ArrayBuffer|Uint8Array|Array|string} bytes
* @return {ArrayBuffer}
*/
algorithms.inflate = function(bytes){
- bytes = utils.toBytes(bytes);
- return new Uint8Array(new Zlib.RawInflate(bytes).decompress()).buffer;
+ return zpipe.inflate(utils.toBytes(bytes), false, true).buffer;
};
expose('jz.algorithms.inflate', algorithms.inflate);
View
2 src/gz.decompress.js
@@ -54,7 +54,7 @@ gz.decompress = function(bytes, check){
if(check) {
checksum = view.getUint32(bytes.length - 8, true);
if(checksum !== algorithms.crc32(ret)) {
- throw 'Error: deffer from checksum.';
+ throw new Error('file is broken.');
}
}
View
6 src/jsziptools.js
@@ -29,13 +29,19 @@ var utils = {},
gz = {},
zip = {},
env = {},
+ zpipe = {},
exports = exports || (function(){return this})();
zip.LOCAL_FILE_SIGNATURE = 0x04034B50;
zip.CENTRAL_DIR_SIGNATURE = 0x02014B50;
zip.END_SIGNATURE = 0x06054B50;
env.isWorker = typeof importScripts === 'function';
+zpipe.deflate = zDeflate;
+zpipe.inflate = zInflate;
+zpipe.gc = zGC;
+expose('jz.gc', zpipe.gc);
+
function expose(namespace, o) {
var paths = namespace.split('.');
var last = paths.pop();
View
4 src/utils.js
@@ -242,7 +242,9 @@ expose('jz.utils.wait.PROCESSING', utils.wait.PROCESSING);
expose('jz.utils.wait.RESOLVE', utils.wait.RESOLVE);
expose('jz.utils.wait.REJECT', utils.wait.REJECT);
-
+/**
+ * @constructor
+ */
utils.Callbacks = function() {
this.doneCallback = utils.noop;
this.failCallback = utils.noop;
View
32 src/zip.unpack.js
@@ -43,7 +43,7 @@ var mimetypes = (function(){
/**
* @constructor
*/
-zip.ZipArchiveReader = function(bytes){
+function ZipArchiveReader(bytes){
bytes = utils.toBytes(bytes);
var signature, header, endCentDirHeader, i, n,
@@ -56,6 +56,11 @@ zip.ZipArchiveReader = function(bytes){
this.buffer = bytes.buffer;
+ //check signature
+ if (view.getUint32(0, true) !== zip.LOCAL_FILE_SIGNATURE) {
+ throw new Error('invalid zip file');
+ }
+
//read the end central dir header.
while(true){
if(view.getUint32(offset, true) === zip.END_SIGNATURE) {
@@ -95,7 +100,7 @@ zip.ZipArchiveReader = function(bytes){
this.centralDirHeaders = centralDirHeaders;
};
-var p = zip.ZipArchiveReader.prototype;
+var p = ZipArchiveReader.prototype;
p._getLocalFileHeader = function(offset){
var view = new DataView(this.buffer, offset),
@@ -229,15 +234,15 @@ if(env.isWorker){
};
}
-exposeProperty('getFileNames', zip.ZipArchiveReader, p.getFileNames);
-exposeProperty('getFileAsArrayBuffer', zip.ZipArchiveReader, p.getFileAsArrayBuffer);
-exposeProperty('getFileAsText', zip.ZipArchiveReader, p.getFileAsText);
-exposeProperty('getFileAsBinaryString', zip.ZipArchiveReader, p.getFileAsBinaryString);
-exposeProperty('getFileAsDataURL', zip.ZipArchiveReader, p.getFileAsDataURL);
-exposeProperty('getFileAsBlob', zip.ZipArchiveReader, p.getFileAsBlob);
-exposeProperty('getFileAsTextSync', zip.ZipArchiveReader, p.getFileAsTextSync);
-exposeProperty('getFileAsBinaryStringSync', zip.ZipArchiveReader, p.getFileAsBinaryStringSync);
-exposeProperty('getFileAsDataURLSync', zip.ZipArchiveReader, p.getFileAsDataURLSync);
+exposeProperty('getFileNames', ZipArchiveReader, p.getFileNames);
+exposeProperty('getFileAsArrayBuffer', ZipArchiveReader, p.getFileAsArrayBuffer);
+exposeProperty('getFileAsText', ZipArchiveReader, p.getFileAsText);
+exposeProperty('getFileAsBinaryString', ZipArchiveReader, p.getFileAsBinaryString);
+exposeProperty('getFileAsDataURL', ZipArchiveReader, p.getFileAsDataURL);
+exposeProperty('getFileAsBlob', ZipArchiveReader, p.getFileAsBlob);
+exposeProperty('getFileAsTextSync', ZipArchiveReader, p.getFileAsTextSync);
+exposeProperty('getFileAsBinaryStringSync', ZipArchiveReader, p.getFileAsBinaryStringSync);
+exposeProperty('getFileAsDataURLSync', ZipArchiveReader, p.getFileAsDataURLSync);
/**
@@ -248,7 +253,7 @@ exposeProperty('getFileAsDataURLSync', zip.ZipArchiveReader, p.getFileAsDataURLS
* jz.zip.unpack({
* buffer: buffer, // zip buffer
* encoding: 'UTF-8', // encoding of filenames
- * complete: function(reader) { // jz.zip.ZipArchiveReader
+ * complete: function(reader) { // jz.ZipArchiveReader
* // ...
* },
* error: function(err) {}
@@ -291,7 +296,7 @@ zip.unpack = function(params){
setTimeout(function() {
try {
//init zip reader.
- reader = new zip.ZipArchiveReader(params.buffer);
+ reader = new ZipArchiveReader(params.buffer);
//detect encoding. cp932 or utf-8.
if(params.encoding == null) {
@@ -325,4 +330,3 @@ zip.unpack = function(params){
};
expose('jz.zip.unpack', zip.unpack);
-expose('jz.zip.decompress', zip.unpack);
View
21 src/zlib.compress.js
@@ -14,26 +14,7 @@ utils.js
* @return {ArrayBuffer} zlib format buffer.
*/
zlib.compress = function(bytes, level){
- var ret, buffer, i, end, checksum, data, view;
-
- //compress to deflate stream
- data = utils.toBytes(algorithms.deflate(bytes, level));
-
- ret = new Uint8Array(data.length + 6);
- view = new DataView(ret.buffer);
-
- //write zlib header
- ret[0] = 0x78;
- ret[1] = 0x01;
-
- //write zlib deflate stream
- ret.set(data, 2);
-
- //write adler32 checksum
- checksum = algorithms.adler32(bytes);
- view.setUint32(ret.length - 4, checksum);
-
- return ret.buffer;
+ return zpipe.deflate(utils.toBytes(bytes), level, true, true).buffer;
};
expose('jz.zlib.compress', zlib.compress);
View
37 src/zlib.decompress.js
@@ -7,46 +7,13 @@ utils.js
/**
- * Decompress from a zlib format buffer.
+ * Decompress a zlib format buffer.
*
* @param {ArrayBuffer|Uint8Array|Array|string} bytes zlib format buffer.
- * @param {boolean} check if check adler32 checksum, set true.
* @return {ArrayBuffer} buffer.
*/
zlib.decompress = function(bytes, check){
- var b, cm, cinfo, fcheck, fdict, view,
- flevel, dictid, checksum, ret,
- offset = 0;
- bytes = utils.toBytes(bytes);
- view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
-
- //read zlib header
- b = bytes[offset++];
- cm = b & 0xF;
- cinfo = b >> 4;
-
- b = bytes[offset++];
- fcheck = b & 0x1F;
- fdict = b & 0x20;
- flevel = b >> 6;
-
- if(fdict){
- dictid = view.getUint32(offset);
- offset += 4;
- }
-
- //decompress from deflate stream
- ret = algorithms.inflate(bytes.subarray(offset, bytes.length - 4));
-
- //check adler32
- if(check){
- //read adler32 checksum
- checksum = view.getUint32(bytes.length - 4, false);
- checksum2 = algorithms.adler32(ret);
- if(checksum !== checksum2) throw 'Error: differ from checksum';
- }
-
- return ret;
+ return zpipe.inflate(utils.toBytes(bytes), true, true).buffer;
};
expose('jz.zlib.decompress', zlib.decompress);
1 src/zpipe
@@ -0,0 +1 @@
+Subproject commit 49f719f64fd22e403bc1697021118f916d57c3e8
View
30 test/index.html
@@ -4,20 +4,22 @@
<meta charset="UTF-8" />
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
- <script type="text/javascript" src="qunit/qunit.js"></script>
- <script type="text/javascript" src="../src/jsziptools.js"></script>
- <script type="text/javascript" src="../src/utils.js"></script>
- <script type="text/javascript" src="../src/algorithms/adler32.js"></script>
- <script type="text/javascript" src="../src/algorithms/crc32.js"></script>
- <script type="text/javascript" src="../src/algorithms/deflate.js"></script>
- <script type="text/javascript" src="../src/algorithms/inflate.js"></script>
- <script type="text/javascript" src="../src/zlib.compress.js"></script>
- <script type="text/javascript" src="../src/zlib.decompress.js"></script>
- <script type="text/javascript" src="../src/gz.compress.js"></script>
- <script type="text/javascript" src="../src/gz.decompress.js"></script>
- <script type="text/javascript" src="../src/zip.pack.js"></script>
- <script type="text/javascript" src="../src/zip.unpack.js"></script>
- <script type="text/javascript" src="test.js"></script>
+ <script src="qunit/qunit.js"></script>
+ <script src="../src/zpipe/dist/zpipe.raw.js"></script>
+ <script src="../src/zpipe/src/zpipe.funcs.js"></script>
+ <script src="../src/jsziptools.js"></script>
+ <script src="../src/utils.js"></script>
+ <script src="../src/algorithms/adler32.js"></script>
+ <script src="../src/algorithms/crc32.js"></script>
+ <script src="../src/algorithms/deflate.js"></script>
+ <script src="../src/algorithms/inflate.js"></script>
+ <script src="../src/zlib.compress.js"></script>
+ <script src="../src/zlib.decompress.js"></script>
+ <script src="../src/gz.compress.js"></script>
+ <script src="../src/gz.decompress.js"></script>
+ <script src="../src/zip.pack.js"></script>
+ <script src="../src/zip.unpack.js"></script>
+ <script src="test.js"></script>
</head>
<body>
<h1 id="qunit-header">QUnit Test Suite</h1>
View
2 test/minified.html
@@ -5,7 +5,7 @@
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
<script type="text/javascript" src="qunit/qunit.js"></script>
- <script type="text/javascript" src="../build/jsziptools.min.js"></script>
+ <script type="text/javascript" src="../dist/jsziptools.min.js"></script>
<script type="text/javascript" src="test.js"></script>
</head>
<body>

0 comments on commit f5370d7

Please sign in to comment.
Something went wrong with that request. Please try again.