forked from omerjerk/RemoteDroid_web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Decoder.js
871 lines (723 loc) · 287 KB
/
Decoder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
// universal module definition
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.Decoder = factory();
}
}(this, function () {
"use strict";
var global;
function initglobal(){
global = this;
if (!global){
if (typeof window != "undefined"){
global = window;
}else if (self != "undefined"){
global = self;
};
};
};
initglobal();
function error(message) {
console.error(message);
console.trace();
};
function assert(condition, message) {
if (!condition) {
error(message);
};
};
var getModule = function(_broadwayOnHeadersDecoded, _broadwayOnPictureDecoded){
var windowBak;
if (typeof window != 'undefined'){
windowBak = window;
};
var window = {
_broadwayOnHeadersDecoded: _broadwayOnHeadersDecoded,
_broadwayOnPictureDecoded: _broadwayOnPictureDecoded
};
/*
The reason why this is all packed into one file is that this file can also function as worker.
you can integrate the file into your build system and provide the original file to be loaded into a worker.
*/
function d(a){throw a;}var g=void 0,i=!0,k=null,m=!1;function n(){return function(){}}var p;p||(p=eval("(function() { try { return Module || {} } catch(e) { return {} } })()"));var aa={},r;for(r in p)p.hasOwnProperty(r)&&(aa[r]=p[r]);var t="object"===typeof process&&"function"===typeof require,ba="object"===typeof window,ca="function"===typeof importScripts,da=!ba&&!t&&!ca;
if(t){p.print||(p.print=function(a){process.stdout.write(a+"\n")});p.printErr||(p.printErr=function(a){process.stderr.write(a+"\n")});var fa=require("fs"),ga=require("path");p.read=function(a,b){var a=ga.normalize(a),c=fa.readFileSync(a);!c&&a!=ga.resolve(a)&&(a=path.join(__dirname,"..","src",a),c=fa.readFileSync(a));c&&!b&&(c=c.toString());return c};p.readBinary=function(a){return p.read(a,i)};p.load=function(a){ha(read(a))};p.thisProgram=1<process.argv.length?process.argv[1].replace(/\\/g,"/"):
"unknown-program";p.arguments=process.argv.slice(2);"undefined"!==typeof module&&(module.exports=p);process.on("uncaughtException",function(a){a instanceof ia||d(a)})}else da?(p.print||(p.print=print),"undefined"!=typeof printErr&&(p.printErr=printErr),p.read="undefined"!=typeof read?read:function(){d("no read() available (jsc?)")},p.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");w("object"===typeof a);return a},"undefined"!=typeof scriptArgs?
p.arguments=scriptArgs:"undefined"!=typeof arguments&&(p.arguments=arguments),this.Module=p,eval("if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined")):ba||ca?(p.read=function(a){var b=new XMLHttpRequest;b.open("GET",a,m);b.send(k);return b.responseText},"undefined"!=typeof arguments&&(p.arguments=arguments),"undefined"!==typeof console?(p.print||(p.print=function(a){console.log(a)}),p.printErr||(p.printErr=function(a){console.log(a)})):p.print||(p.print=
n()),ba?window.Module=p:p.load=importScripts):d("Unknown runtime environment. Where are we?");function ha(a){eval.call(k,a)}!p.load&&p.read&&(p.load=function(a){ha(p.read(a))});p.print||(p.print=n());p.printErr||(p.printErr=p.print);p.arguments||(p.arguments=[]);p.thisProgram||(p.thisProgram="./this.program");p.print=p.print;p.fa=p.printErr;p.preRun=[];p.postRun=[];for(r in aa)aa.hasOwnProperty(r)&&(p[r]=aa[r]);
var z={Yd:function(a){ja=a},xd:function(){return ja},Tb:function(){return y},Sb:function(a){y=a},oc:function(a){switch(a){case "i1":case "i8":return 1;case "i16":return 2;case "i32":return 4;case "i64":return 8;case "float":return 4;case "double":return 8;default:return"*"===a[a.length-1]?z.ia:"i"===a[0]?(a=parseInt(a.substr(1)),w(0===a%8),a/8):0}},vd:function(a){return Math.max(z.oc(a),z.ia)},Qf:16,ng:function(a,b,c){return!c&&("i64"==a||"double"==a)?8:!a?Math.min(b,8):Math.min(b||(a?z.vd(a):0),
z.ia)},Fa:function(a,b,c){return c&&c.length?(c.splice||(c=Array.prototype.slice.call(c)),c.splice(0,0,b),p["dynCall_"+a].apply(k,c)):p["dynCall_"+a].call(k,b)},eb:[],Vc:function(a){for(var b=0;b<z.eb.length;b++)if(!z.eb[b])return z.eb[b]=a,2*(1+b);d("Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.")},Sd:function(a){z.eb[(a-2)/2]=k},og:function(a,b){z.wb||(z.wb={});var c=z.wb[a];if(c)return c;for(var c=[],e=0;e<b;e++)c.push(String.fromCharCode(36)+e);
e=ka(a);'"'===e[0]&&(e.indexOf('"',1)===e.length-1?e=e.substr(1,e.length-2):A("invalid EM_ASM input |"+e+"|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)"));try{var f=eval("(function(Module, FS) { return function("+c.join(",")+"){ "+e+" } })")(p,"undefined"!==typeof B?B:k)}catch(h){p.fa("error in executing inline EM_ASM code: "+h+" on: \n\n"+e+"\n\nwith args |"+c+"| (make sure to use the right one out of EM_ASM, EM_ASM_ARGS, etc.)"),d(h)}return z.wb[a]=
f},Aa:function(a){z.Aa.Rb||(z.Aa.Rb={});z.Aa.Rb[a]||(z.Aa.Rb[a]=1,p.fa(a))},Cb:{},rg:function(a,b){w(b);z.Cb[b]||(z.Cb[b]={});var c=z.Cb[b];c[a]||(c[a]=function(){return z.Fa(b,a,arguments)});return c[a]},Da:function(){var a=[],b=0;this.nb=function(c){c&=255;if(0==a.length){if(0==(c&128))return String.fromCharCode(c);a.push(c);b=192==(c&224)?1:224==(c&240)?2:3;return""}if(b&&(a.push(c),b--,0<b))return"";var c=a[0],e=a[1],f=a[2],h=a[3];2==a.length?c=String.fromCharCode((c&31)<<6|e&63):3==a.length?
c=String.fromCharCode((c&15)<<12|(e&63)<<6|f&63):(c=(c&7)<<18|(e&63)<<12|(f&63)<<6|h&63,c=String.fromCharCode(((c-65536)/1024|0)+55296,(c-65536)%1024+56320));a.length=0;return c};this.Ac=function(a){for(var a=unescape(encodeURIComponent(a)),b=[],f=0;f<a.length;f++)b.push(a.charCodeAt(f));return b}},pg:function(){d("You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work")},pb:function(a){var b=y;y=y+a|0;y=y+15&-16;return b},Ec:function(a){var b=
D;D=D+a|0;D=D+15&-16;return b},bb:function(a){var b=E;E=E+a|0;E=E+15&-16;E>=F&&A("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+F+", (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.");return b},ub:function(a,b){return Math.ceil(a/(b?b:16))*(b?b:16)},Fg:function(a,b,c){return c?+(a>>>0)+4294967296*+(b>>>0):+(a>>>0)+4294967296*
+(b|0)},Pc:8,ia:4,Rf:0};p.Runtime=z;z.addFunction=z.Vc;z.removeFunction=z.Sd;var H=m,la,ma,ja;function w(a,b){a||A("Assertion failed: "+b)}function na(a){var b=p["_"+a];if(!b)try{b=eval("_"+a)}catch(c){}w(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)");return b}var oa,pa;
(function(){function a(a){a=a.toString().match(e).slice(1);return{arguments:a[0],body:a[1],returnValue:a[2]}}var b={stackSave:function(){z.Tb()},stackRestore:function(){z.Sb()},arrayToC:function(a){var b=z.pb(a.length);qa(a,b);return b},stringToC:function(a){var b=0;a!==k&&(a!==g&&0!==a)&&(b=z.pb((a.length<<2)+1),ra(a,b));return b}},c={string:b.stringToC,array:b.arrayToC};pa=function(a,b,e,f){var h=na(a),s=[],a=0;if(f)for(var v=0;v<f.length;v++){var G=c[e[v]];G?(0===a&&(a=z.Tb()),s[v]=G(f[v])):s[v]=
f[v]}e=h.apply(k,s);"string"===b&&(e=ka(e));0!==a&&z.Sb(a);return e};var e=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,f={},h;for(h in b)b.hasOwnProperty(h)&&(f[h]=a(b[h]));oa=function(b,c,e){var e=e||[],h=na(b),b=e.every(function(a){return"number"===a}),x="string"!==c;if(x&&b)return h;var s=e.map(function(a,b){return"$"+b}),c="(function("+s.join(",")+") {",v=e.length;if(!b)for(var c=c+("var stack = "+f.stackSave.body+";"),G=0;G<v;G++){var ua=s[G],ea=e[G];"number"!==
ea&&(ea=f[ea+"ToC"],c+="var "+ea.arguments+" = "+ua+";",c+=ea.body+";",c+=ua+"="+ea.returnValue+";")}e=a(function(){return h}).returnValue;c+="var ret = "+e+"("+s.join(",")+");";x||(e=a(function(){return ka}).returnValue,c+="ret = "+e+"(ret);");b||(c+=f.stackRestore.body.replace("()","(stack)")+";");return eval(c+"return ret})")}})();p.cwrap=oa;p.ccall=pa;
function sa(a,b,c){c=c||"i8";"*"===c.charAt(c.length-1)&&(c="i32");switch(c){case "i1":I[a>>0]=b;break;case "i8":I[a>>0]=b;break;case "i16":J[a>>1]=b;break;case "i32":K[a>>2]=b;break;case "i64":ma=[b>>>0,(la=b,1<=+ta(la)?0<la?(va(+wa(la/4294967296),4294967295)|0)>>>0:~~+xa((la-+(~~la>>>0))/4294967296)>>>0:0)];K[a>>2]=ma[0];K[a+4>>2]=ma[1];break;case "float":ya[a>>2]=b;break;case "double":za[a>>3]=b;break;default:A("invalid type for setValue: "+c)}}p.setValue=sa;
function Aa(a,b){b=b||"i8";"*"===b.charAt(b.length-1)&&(b="i32");switch(b){case "i1":return I[a>>0];case "i8":return I[a>>0];case "i16":return J[a>>1];case "i32":return K[a>>2];case "i64":return K[a>>2];case "float":return ya[a>>2];case "double":return za[a>>3];default:A("invalid type for setValue: "+b)}return k}p.getValue=Aa;var L=2,Ba=4;p.ALLOC_NORMAL=0;p.ALLOC_STACK=1;p.ALLOC_STATIC=L;p.ALLOC_DYNAMIC=3;p.ALLOC_NONE=Ba;
function M(a,b,c,e){var f,h;"number"===typeof a?(f=i,h=a):(f=m,h=a.length);var j="string"===typeof b?b:k,c=c==Ba?e:[Ca,z.pb,z.Ec,z.bb][c===g?L:c](Math.max(h,j?1:b.length));if(f){e=c;w(0==(c&3));for(a=c+(h&-4);e<a;e+=4)K[e>>2]=0;for(a=c+h;e<a;)I[e++>>0]=0;return c}if("i8"===j)return a.subarray||a.slice?N.set(a,c):N.set(new Uint8Array(a),c),c;for(var e=0,l,u;e<h;){var q=a[e];"function"===typeof q&&(q=z.sg(q));f=j||b[e];0===f?e++:("i64"==f&&(f="i32"),sa(c+e,q,f),u!==f&&(l=z.oc(f),u=f),e+=l)}return c}
p.allocate=M;function ka(a,b){if(0===b||!a)return"";for(var c=m,e,f=0;;){e=N[a+f>>0];if(128<=e)c=i;else if(0==e&&!b)break;f++;if(b&&f==b)break}b||(b=f);var h="";if(!c){for(;0<b;)e=String.fromCharCode.apply(String,N.subarray(a,a+Math.min(b,1024))),h=h?h+e:e,a+=1024,b-=1024;return h}c=new z.Da;for(f=0;f<b;f++)e=N[a+f>>0],h+=c.nb(e);return h}p.Pointer_stringify=ka;p.UTF16ToString=function(a){for(var b=0,c="";;){var e=J[a+2*b>>1];if(0==e)return c;++b;c+=String.fromCharCode(e)}};
p.stringToUTF16=function(a,b){for(var c=0;c<a.length;++c)J[b+2*c>>1]=a.charCodeAt(c);J[b+2*a.length>>1]=0};p.UTF32ToString=function(a){for(var b=0,c="";;){var e=K[a+4*b>>2];if(0==e)return c;++b;65536<=e?(e-=65536,c+=String.fromCharCode(55296|e>>10,56320|e&1023)):c+=String.fromCharCode(e)}};p.stringToUTF32=function(a,b){for(var c=0,e=0;e<a.length;++e){var f=a.charCodeAt(e);if(55296<=f&&57343>=f)var h=a.charCodeAt(++e),f=65536+((f&1023)<<10)|h&1023;K[b+4*c>>2]=f;++c}K[b+4*c>>2]=0};
function Da(a){function b(c,e,f){var e=e||Infinity,h="",j=[],s;if("N"===a[l]){l++;"K"===a[l]&&l++;for(s=[];"E"!==a[l];)if("S"===a[l]){l++;var C=a.indexOf("_",l);s.push(q[a.substring(l,C)||0]||"?");l=C+1}else if("C"===a[l])s.push(s[s.length-1]),l+=2;else{var C=parseInt(a.substr(l)),P=C.toString().length;if(!C||!P){l--;break}var sb=a.substr(l+P,C);s.push(sb);q.push(sb);l+=P+C}l++;s=s.join("::");e--;if(0===e)return c?[s]:s}else if(("K"===a[l]||x&&"L"===a[l])&&l++,C=parseInt(a.substr(l)))P=C.toString().length,
s=a.substr(l+P,C),l+=P+C;x=m;"I"===a[l]?(l++,C=b(i),P=b(i,1,i),h+=P[0]+" "+s+"<"+C.join(", ")+">"):h=s;a:for(;l<a.length&&0<e--;)if(s=a[l++],s in u)j.push(u[s]);else switch(s){case "P":j.push(b(i,1,i)[0]+"*");break;case "R":j.push(b(i,1,i)[0]+"&");break;case "L":l++;C=a.indexOf("E",l)-l;j.push(a.substr(l,C));l+=C+2;break;case "A":C=parseInt(a.substr(l));l+=C.toString().length;"_"!==a[l]&&d("?");l++;j.push(b(i,1,i)[0]+" ["+C+"]");break;case "E":break a;default:h+="?"+s;break a}!f&&(1===j.length&&"void"===
j[0])&&(j=[]);return c?(h&&j.push(h+"?"),j):h+("("+j.join(", ")+")")}var c=!!p.___cxa_demangle;if(c)try{var e=Ca(a.length);ra(a.substr(1),e);var f=Ca(4),h=p.___cxa_demangle(e,0,0,f);if(0===Aa(f,"i32")&&h)return ka(h)}catch(j){}finally{e&&Ea(e),f&&Ea(f),h&&Ea(h)}var l=3,u={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},q=[],x=
i,e=a;try{if("Object._main"==a||"_main"==a)return"main()";"number"===typeof a&&(a=ka(a));if("_"!==a[0]||"_"!==a[1]||"Z"!==a[2])return a;switch(a[3]){case "n":return"operator new()";case "d":return"operator delete()"}e=b()}catch(s){e+="?"}0<=e.indexOf("?")&&!c&&z.Aa("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return e}
function Fa(){var a;a:{a=Error();if(!a.stack){try{d(Error(0))}catch(b){a=b}if(!a.stack){a="(no stack trace available)";break a}}a=a.stack.toString()}return a.replace(/__Z[\w\d_]+/g,function(a){var b=Da(a);return a===b?a:a+" ["+b+"]"})}p.stackTrace=function(){return Fa()};for(var I,N,J,Ga,K,Ha,ya,za,Ia=0,D=0,Ja=0,y=0,Ka=0,La=0,E=0,Ma=p.TOTAL_STACK||5242880,F=p.TOTAL_MEMORY||52428800,O=65536;O<F||O<2*Ma;)O=16777216>O?2*O:O+16777216;
O!==F&&(p.fa("increasing TOTAL_MEMORY to "+O+" to be compliant with the asm.js spec"),F=O);w("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&!!(new Int32Array(1)).subarray&&!!(new Int32Array(1)).set,"JS engine does not provide full typed array support");var Q=new ArrayBuffer(F);I=new Int8Array(Q);J=new Int16Array(Q);K=new Int32Array(Q);N=new Uint8Array(Q);Ga=new Uint16Array(Q);Ha=new Uint32Array(Q);ya=new Float32Array(Q);za=new Float64Array(Q);K[0]=255;w(255===N[0]&&0===N[3],"Typed arrays 2 must be run on a little-endian system");
p.HEAP=g;p.buffer=Q;p.HEAP8=I;p.HEAP16=J;p.HEAP32=K;p.HEAPU8=N;p.HEAPU16=Ga;p.HEAPU32=Ha;p.HEAPF32=ya;p.HEAPF64=za;function Na(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b();else{var c=b.ja;"number"===typeof c?b.Xa===g?z.Fa("v",c):z.Fa("vi",c,[b.Xa]):c(b.Xa===g?k:b.Xa)}}}var Oa=[],R=[],Pa=[],Qa=[],Ra=[],Sa=m;function Ta(a){Oa.unshift(a)}p.addOnPreRun=p.Xf=Ta;p.addOnInit=p.Uf=function(a){R.unshift(a)};p.addOnPreMain=p.Wf=function(a){Pa.unshift(a)};p.addOnExit=p.Tf=function(a){Qa.unshift(a)};
function Ua(a){Ra.unshift(a)}p.addOnPostRun=p.Vf=Ua;function Va(a,b,c){a=(new z.Da).Ac(a);c&&(a.length=c);b||a.push(0);return a}p.intArrayFromString=Va;p.intArrayToString=function(a){for(var b=[],c=0;c<a.length;c++){var e=a[c];255<e&&(e&=255);b.push(String.fromCharCode(e))}return b.join("")};function ra(a,b,c){a=Va(a,c);for(c=0;c<a.length;)I[b+c>>0]=a[c],c+=1}p.writeStringToMemory=ra;function qa(a,b){for(var c=0;c<a.length;c++)I[b+c>>0]=a[c]}p.writeArrayToMemory=qa;
p.writeAsciiToMemory=function(a,b,c){for(var e=0;e<a.length;e++)I[b+e>>0]=a.charCodeAt(e);c||(I[b+a.length>>0]=0)};if(!Math.imul||-5!==Math.imul(4294967295,5))Math.imul=function(a,b){var c=a&65535,e=b&65535;return c*e+((a>>>16)*e+c*(b>>>16)<<16)|0};Math.vg=Math.imul;var ta=Math.abs,xa=Math.ceil,wa=Math.floor,va=Math.min,S=0,Wa=k,Xa=k;function Ya(){S++;p.monitorRunDependencies&&p.monitorRunDependencies(S)}p.addRunDependency=Ya;
function Za(){S--;p.monitorRunDependencies&&p.monitorRunDependencies(S);if(0==S&&(Wa!==k&&(clearInterval(Wa),Wa=k),Xa)){var a=Xa;Xa=k;a()}}p.removeRunDependency=Za;p.preloadedImages={};p.preloadedAudios={};var T=k,Ia=8,D=Ia+7808;R.push();
M([0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,0,0,0,0,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,0,0,0,0,10,0,0,0,13,0,0,0,16,0,0,0,11,0,0,0,14,0,0,0,18,0,0,0,13,0,0,0,16,0,0,0,20,0,0,0,14,0,0,0,18,0,0,0,23,0,0,0,16,0,0,0,20,0,0,0,25,0,0,0,18,0,0,0,23,0,0,0,29,0,0,0,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,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,
0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,0,0,21,0,0,0,22,0,0,0,23,0,0,0,24,0,0,0,25,0,0,0,26,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,29,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,32,0,0,0,33,0,0,0,34,0,0,0,34,0,0,0,35,0,0,0,35,0,0,0,36,0,0,0,36,0,0,0,37,0,0,0,37,0,0,0,37,0,0,0,38,0,0,0,38,0,0,0,38,0,0,0,39,0,0,0,39,0,0,0,39,0,0,0,39,0,0,0,1,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,16,0,0,0,32,0,0,0,64,0,0,0,128,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,3,0,0,0,3,0,0,0,0,0,0,0,1,0,0,0,4,0,0,
0,5,0,0,0,2,0,0,0,3,0,0,0,6,0,0,0,7,0,0,0,8,0,0,0,9,0,0,0,12,0,0,0,13,0,0,0,10,0,0,0,11,0,0,0,14,0,0,0,15,0,0,0,47,31,15,0,23,27,29,30,7,11,13,14,39,43,45,46,16,3,5,10,12,19,21,26,28,35,37,42,44,1,2,4,8,17,18,20,24,6,9,22,25,32,33,34,36,40,38,41,0,16,1,2,4,8,32,3,5,10,12,15,47,7,11,13,14,6,9,31,35,37,42,44,33,34,36,40,39,43,45,46,17,18,20,24,19,21,26,28,23,27,29,30,22,25,38,41,17,1,0,0,0,0,0,0,34,18,1,1,0,0,0,0,50,34,18,2,0,0,0,0,67,51,34,34,18,18,2,2,83,67,51,35,18,18,2,2,19,35,67,51,99,83,2,2,0,
0,101,85,68,68,52,52,35,35,35,35,19,19,19,19,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,249,233,217,200,200,184,184,167,167,167,167,151,151,151,151,134,134,134,134,134,134,134,134,118,118,118,118,118,118,118,118,230,214,198,182,165,165,149,149,132,132,132,132,116,116,116,116,100,100,100,100,84,84,84,84,67,67,67,67,67,67,67,67,51,51,51,51,51,51,51,51,35,35,35,35,35,35,35,35,19,19,19,19,19,19,19,19,3,3,3,3,3,3,3,3,214,182,197,197,165,165,149,149,132,132,132,132,84,84,84,84,68,68,68,68,4,4,4,4,115,115,115,115,
115,115,115,115,99,99,99,99,99,99,99,99,51,51,51,51,51,51,51,51,35,35,35,35,35,35,35,35,19,19,19,19,19,19,19,19,197,181,165,5,148,148,116,116,52,52,36,36,131,131,131,131,99,99,99,99,83,83,83,83,67,67,67,67,19,19,19,19,181,149,164,164,132,132,36,36,20,20,4,4,115,115,115,115,99,99,99,99,83,83,83,83,67,67,67,67,51,51,51,51,166,6,21,21,132,132,132,132,147,147,147,147,147,147,147,147,115,115,115,115,115,115,115,115,99,99,99,99,99,99,99,99,83,83,83,83,83,83,83,83,67,67,67,67,67,67,67,67,51,51,51,51,51,
51,51,51,35,35,35,35,35,35,35,35,150,6,21,21,116,116,116,116,131,131,131,131,131,131,131,131,99,99,99,99,99,99,99,99,67,67,67,67,67,67,67,67,51,51,51,51,51,51,51,51,35,35,35,35,35,35,35,35,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,134,6,37,37,20,20,20,20,115,115,115,115,115,115,115,115,99,99,99,99,99,99,99,99,51,51,51,51,51,51,51,51,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,22,6,117,117,36,36,36,36,83,83,83,83,83,83,83,83,98,98,98,98,98,
98,98,98,98,98,98,98,98,98,98,98,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,21,5,100,100,35,35,35,35,82,82,82,82,82,82,82,82,66,66,66,66,66,66,66,66,50,50,50,50,50,50,50,50,4,20,35,35,51,51,83,83,65,65,65,65,65,65,65,65,4,20,67,67,34,34,34,34,49,49,49,49,49,49,49,49,3,19,50,50,33,33,33,33,2,18,33,33,0,0,0,0,0,0,0,0,0,0,102,32,38,16,6,8,101,24,101,24,67,16,67,16,67,16,67,16,67,16,67,16,67,16,67,16,34,8,34,8,34,8,34,8,34,8,34,8,34,8,34,8,34,8,34,
8,34,8,34,8,34,8,34,8,34,8,34,8,0,0,0,0,0,0,0,0,106,64,74,48,42,40,10,32,105,56,105,56,73,40,73,40,41,32,41,32,9,24,9,24,104,48,104,48,104,48,104,48,72,32,72,32,72,32,72,32,40,24,40,24,40,24,40,24,8,16,8,16,8,16,8,16,103,40,103,40,103,40,103,40,103,40,103,40,103,40,103,40,71,24,71,24,71,24,71,24,71,24,71,24,71,24,71,24,110,96,78,88,46,80,14,80,110,88,78,80,46,72,14,72,13,64,13,64,77,72,77,72,45,64,45,64,13,56,13,56,109,80,109,80,77,64,77,64,45,56,45,56,13,48,13,48,107,72,107,72,107,72,107,72,107,
72,107,72,107,72,107,72,75,56,75,56,75,56,75,56,75,56,75,56,75,56,75,56,43,48,43,48,43,48,43,48,43,48,43,48,43,48,43,48,11,40,11,40,11,40,11,40,11,40,11,40,11,40,11,40,0,0,0,0,47,104,47,104,16,128,80,128,48,128,16,120,112,128,80,120,48,120,16,112,112,120,80,112,48,112,16,104,111,112,111,112,79,104,79,104,47,96,47,96,15,96,15,96,111,104,111,104,79,96,79,96,47,88,47,88,15,88,15,88,0,0,0,0,0,0,0,0,102,56,70,32,38,32,6,16,102,48,70,24,38,24,6,8,101,40,101,40,37,16,37,16,100,32,100,32,100,32,100,32,100,
24,100,24,100,24,100,24,67,16,67,16,67,16,67,16,67,16,67,16,67,16,67,16,0,0,0,0,0,0,0,0,105,72,73,56,41,56,9,48,8,40,8,40,72,48,72,48,40,48,40,48,8,32,8,32,103,64,103,64,103,64,103,64,71,40,71,40,71,40,71,40,39,40,39,40,39,40,39,40,7,24,7,24,7,24,7,24,0,0,0,0,109,120,109,120,110,128,78,128,46,128,14,128,46,120,14,120,78,120,46,112,77,112,77,112,13,112,13,112,109,112,109,112,77,104,77,104,45,104,45,104,13,104,13,104,109,104,109,104,77,96,77,96,45,96,45,96,13,96,13,96,12,88,12,88,12,88,12,88,76,88,
76,88,76,88,76,88,44,88,44,88,44,88,44,88,12,80,12,80,12,80,12,80,108,96,108,96,108,96,108,96,76,80,76,80,76,80,76,80,44,80,44,80,44,80,44,80,12,72,12,72,12,72,12,72,107,88,107,88,107,88,107,88,107,88,107,88,107,88,107,88,75,72,75,72,75,72,75,72,75,72,75,72,75,72,75,72,43,72,43,72,43,72,43,72,43,72,43,72,43,72,43,72,11,64,11,64,11,64,11,64,11,64,11,64,11,64,11,64,107,80,107,80,107,80,107,80,107,80,107,80,107,80,107,80,75,64,75,64,75,64,75,64,75,64,75,64,75,64,75,64,43,64,43,64,43,64,43,64,43,64,43,
64,43,64,43,64,11,56,11,56,11,56,11,56,11,56,11,56,11,56,11,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,24,70,56,38,56,6,16,102,72,70,48,38,48,6,8,37,40,37,40,69,40,69,40,37,32,37,32,69,32,69,32,37,24,37,24,101,64,101,64,69,24,69,24,37,16,37,16,100,56,100,56,100,56,100,56,100,48,100,48,100,48,100,48,100,40,100,40,100,40,100,40,100,32,100,32,100,32,100,32,100,24,100,24,100,24,100,24,68,16,68,16,68,16,68,16,36,8,36,8,36,8,36,8,4,0,4,0,4,0,4,0,0,0,10,128,106,128,74,128,42,128,10,120,106,120,74,120,42,120,10,
112,106,112,74,112,42,112,10,104,41,104,41,104,9,96,9,96,73,104,73,104,41,96,41,96,9,88,9,88,105,104,105,104,73,96,73,96,41,88,41,88,9,80,9,80,104,96,104,96,104,96,104,96,72,88,72,88,72,88,72,88,40,80,40,80,40,80,40,80,8,72,8,72,8,72,8,72,104,88,104,88,104,88,104,88,72,80,72,80,72,80,72,80,40,72,40,72,40,72,40,72,8,64,8,64,8,64,8,64,7,56,7,56,7,56,7,56,7,56,7,56,7,56,7,56,7,48,7,48,7,48,7,48,7,48,7,48,7,48,7,48,71,72,71,72,71,72,71,72,71,72,71,72,71,72,71,72,7,40,7,40,7,40,7,40,7,40,7,40,7,40,7,40,
103,80,103,80,103,80,103,80,103,80,103,80,103,80,103,80,71,64,71,64,71,64,71,64,71,64,71,64,71,64,71,64,39,64,39,64,39,64,39,64,39,64,39,64,39,64,39,64,7,32,7,32,7,32,7,32,7,32,7,32,7,32,7,32,6,8,38,8,0,0,6,0,6,16,38,16,70,16,0,0,6,24,38,24,70,24,102,24,6,32,38,32,70,32,102,32,6,40,38,40,70,40,102,40,6,48,38,48,70,48,102,48,6,56,38,56,70,56,102,56,6,64,38,64,70,64,102,64,6,72,38,72,70,72,102,72,6,80,38,80,70,80,102,80,6,88,38,88,70,88,102,88,6,96,38,96,70,96,102,96,6,104,38,104,70,104,102,104,6,112,
38,112,70,112,102,112,6,120,38,120,70,120,102,120,6,128,38,128,70,128,102,128,0,0,67,16,2,0,2,0,33,8,33,8,33,8,33,8,103,32,103,32,72,32,40,32,71,24,71,24,39,24,39,24,6,32,6,32,6,32,6,32,6,24,6,24,6,24,6,24,6,16,6,16,6,16,6,16,102,24,102,24,102,24,102,24,38,16,38,16,38,16,38,16,6,8,6,8,6,8,6,8,3,0,0,0,15,0,0,0,1,0,0,0,10,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,1,0,0,0,14,0,0,0,4,0,0,0,1,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,7,0,0,0,4,0,0,0,2,0,0,0,0,0,0,0,13,0,0,0,4,0,0,0,8,0,0,0,4,0,0,0,3,
0,0,0,4,0,0,0,6,0,0,0,4,0,0,0,9,0,0,0,4,0,0,0,12,0,0,0,3,0,0,0,19,0,0,0,1,0,0,0,18,0,0,0,0,0,0,0,17,0,0,0,4,0,0,0,16,0,0,0,3,0,0,0,23,0,0,0,1,0,0,0,22,0,0,0,0,0,0,0,21,0,0,0,4,0,0,0,20,0,0,0,1,0,0,0,11,0,0,0,1,0,0,0,14,0,0,0,4,0,0,0,1,0,0,0,255,0,0,0,4,0,0,0,1,0,0,0,15,0,0,0,2,0,0,0,10,0,0,0,4,0,0,0,5,0,0,0,255,0,0,0,0,0,0,0,4,0,0,0,3,0,0,0,4,0,0,0,6,0,0,0,4,0,0,0,9,0,0,0,255,0,0,0,12,0,0,0,4,0,0,0,7,0,0,0,255,0,0,0,2,0,0,0,4,0,0,0,13,0,0,0,255,0,0,0,8,0,0,0,1,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,
109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,
235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,3,0,0,0,15,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,3,0,0,0,15,0,0,0,0,0,0,0,5,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,3,0,0,0,15,0,0,0,1,0,0,0,10,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,3,0,0,0,15,0,0,0,1,0,0,0,10,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,4,0,0,0,1,0,0,0,255,0,
0,0,0,0,0,0,255,0,0,0,0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,0,0,0,0,0,0,4,0,0,0,1,0,0,0,4,0,0,0,4,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,4,0,0,0,1,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,3,0,0,0,4,0,0,0,6,0,0,0,0,0,0,0,13,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,
0,0,255,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,15,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,0,0,0,8,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,0,0,0,8,0,0,0,0,0,0,0,15,0,0,0,4,0,0,0,10,0,0,0,4,0,0,0,9,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,4,0,0,0,9,0,0,0,4,0,0,0,11,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,4,0,0,0,9,0,0,0,4,0,0,0,12,0,0,0,255,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,4,0,0,0,9,0,0,0,4,0,0,0,12,0,0,0,4,0,0,0,11,0,0,0,4,0,0,0,14,0,0,
0,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,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,5,6,7,8,9,10,12,13,15,17,20,22,25,28,32,36,40,45,50,56,63,71,80,90,101,113,127,144,162,182,203,226,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,3,3,3,3,4,4,4,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0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72,we:73,ie:74,qf:76,he:77,zf:78,Ie:79,Je:80,Me:81,Le:82,Ke:83,lf:38,sb:39,Re:36,rb:40,Ta:95,tf:96,se:104,
Xe:105,fe:97,xf:91,of:88,gf:92,Cf:108,Wb:111,ce:98,re:103,Ue:101,Se:100,Jf:110,Ae:112,Yb:113,Jc:115,Hc:114,Ic:89,Pe:90,wf:93,Df:94,de:99,Te:102,Kc:106,Ra:107,Kf:109,Nf:87,xe:122,Gf:116,pf:95,cf:123,Ce:84,rf:75,ne:125,nf:131,sf:130,Hf:86},ab={"0":"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",
12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",
34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",
53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",
74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",
90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",
107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"},bb=0;function V(a){return K[bb>>2]=a}
function cb(a,b){for(var c=0,e=a.length-1;0<=e;e--){var f=a[e];"."===f?a.splice(e,1):".."===f?(a.splice(e,1),c++):c&&(a.splice(e,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function db(a){var b="/"===a.charAt(0),c="/"===a.substr(-1),a=cb(a.split("/").filter(function(a){return!!a}),!b).join("/");!a&&!b&&(a=".");a&&c&&(a+="/");return(b?"/":"")+a}
function eb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1),a=b[0],b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function W(a){if("/"===a)return"/";var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)}function fb(){var a=Array.prototype.slice.call(arguments,0);return db(a.join("/"))}function X(a,b){return db(a+"/"+b)}
function gb(){for(var a="",b=m,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:B.yb();"string"!==typeof b&&d(new TypeError("Arguments to path.resolve must be strings"));if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=cb(a.split("/").filter(function(a){return!!a}),!b).join("/");return(b?"/":"")+a||"."}
function hb(a,b){function c(a){for(var b=0;b<a.length&&""===a[b];b++);for(var c=a.length-1;0<=c&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}for(var a=gb(a).substr(1),b=gb(b).substr(1),e=c(a.split("/")),f=c(b.split("/")),h=Math.min(e.length,f.length),j=h,l=0;l<h;l++)if(e[l]!==f[l]){j=l;break}h=[];for(l=j;l<e.length;l++)h.push("..");h=h.concat(f.slice(j));return h.join("/")}var ib=[];function jb(a,b){ib[a]={input:[],K:[],sa:b};B.Ob(a,kb)}
var kb={open:function(a){var b=ib[a.g.ob];b||d(new B.e(U.Qa));a.N=b;a.seekable=m},close:function(a){a.N.sa.flush(a.N)},flush:function(a){a.N.sa.flush(a.N)},M:function(a,b,c,e){(!a.N||!a.N.sa.rc)&&d(new B.e(U.Zb));for(var f=0,h=0;h<e;h++){var j;try{j=a.N.sa.rc(a.N)}catch(l){d(new B.e(U.ha))}j===g&&0===f&&d(new B.e(U.Ca));if(j===k||j===g)break;f++;b[c+h]=j}f&&(a.g.timestamp=Date.now());return f},write:function(a,b,c,e){(!a.N||!a.N.sa.Lb)&&d(new B.e(U.Zb));for(var f=0;f<e;f++)try{a.N.sa.Lb(a.N,b[c+f])}catch(h){d(new B.e(U.ha))}e&&
(a.g.timestamp=Date.now());return f}},mb={rc:function(a){if(!a.input.length){var b=k;if(t){if(b=process.stdin.read(),!b){if(process.stdin._readableState&&process.stdin._readableState.ended)return k;return}}else"undefined"!=typeof window&&"function"==typeof window.prompt?(b=window.prompt("Input: "),b!==k&&(b+="\n")):"function"==typeof readline&&(b=readline(),b!==k&&(b+="\n"));if(!b)return k;a.input=Va(b,i)}return a.input.shift()},flush:function(a){a.K&&0<a.K.length&&(p.print(a.K.join("")),a.K=[])},
Lb:function(a,b){b===k||10===b?(p.print(a.K.join("")),a.K=[]):a.K.push(lb.nb(b))}},nb={Lb:function(a,b){b===k||10===b?(p.printErr(a.K.join("")),a.K=[]):a.K.push(lb.nb(b))},flush:function(a){a.K&&0<a.K.length&&(p.printErr(a.K.join("")),a.K=[])}},Y={U:k,F:function(){return Y.createNode(k,"/",16895,0)},createNode:function(a,b,c,e){(B.Bd(c)||B.Cd(c))&&d(new B.e(U.O));Y.U||(Y.U={dir:{g:{S:Y.n.S,I:Y.n.I,ra:Y.n.ra,ba:Y.n.ba,rename:Y.n.rename,za:Y.n.za,Oa:Y.n.Oa,Na:Y.n.Na,ca:Y.n.ca},A:{$:Y.p.$}},file:{g:{S:Y.n.S,
I:Y.n.I},A:{$:Y.p.$,M:Y.p.M,write:Y.p.write,Ea:Y.p.Ea,Ja:Y.p.Ja}},link:{g:{S:Y.n.S,I:Y.n.I,ta:Y.n.ta},A:{}},ec:{g:{S:Y.n.S,I:Y.n.I},A:B.bd}});c=B.createNode(a,b,c,e);B.J(c.mode)?(c.n=Y.U.dir.g,c.p=Y.U.dir.A,c.k={}):B.isFile(c.mode)?(c.n=Y.U.file.g,c.p=Y.U.file.A,c.q=0,c.k=k):B.Ia(c.mode)?(c.n=Y.U.link.g,c.p=Y.U.link.A):B.ib(c.mode)&&(c.n=Y.U.ec.g,c.p=Y.U.ec.A);c.timestamp=Date.now();a&&(a.k[b]=c);return c},ud:function(a){if(a.k&&a.k.subarray){for(var b=[],c=0;c<a.q;++c)b.push(a.k[c]);return b}return a.k},
qg:function(a){return!a.k?new Uint8Array:a.k.subarray?a.k.subarray(0,a.q):new Uint8Array(a.k)},lc:function(a,b){a.k&&(a.k.subarray&&b>a.k.length)&&(a.k=Y.ud(a),a.q=a.k.length);if(!a.k||a.k.subarray){var c=a.k?a.k.buffer.byteLength:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)|0),0!=c&&(b=Math.max(b,256)),c=a.k,a.k=new Uint8Array(b),0<a.q&&a.k.set(c.subarray(0,a.q),0))}else{!a.k&&0<b&&(a.k=[]);for(;a.k.length<b;)a.k.push(0)}},Ud:function(a,b){if(a.q!=b)if(0==b)a.k=k,a.q=0;else{if(!a.k||a.k.subarray){var c=
a.k;a.k=new Uint8Array(new ArrayBuffer(b));c&&a.k.set(c.subarray(0,Math.min(b,a.q)))}else if(a.k||(a.k=[]),a.k.length>b)a.k.length=b;else for(;a.k.length<b;)a.k.push(0);a.q=b}},n:{S:function(a){var b={};b.gg=B.ib(a.mode)?a.id:1;b.wg=a.id;b.mode=a.mode;b.Ig=1;b.uid=0;b.ug=0;b.ob=a.ob;b.size=B.J(a.mode)?4096:B.isFile(a.mode)?a.q:B.Ia(a.mode)?a.link.length:0;b.Zf=new Date(a.timestamp);b.Hg=new Date(a.timestamp);b.eg=new Date(a.timestamp);b.Zc=4096;b.$f=Math.ceil(b.size/b.Zc);return b},I:function(a,b){b.mode!==
g&&(a.mode=b.mode);b.timestamp!==g&&(a.timestamp=b.timestamp);b.size!==g&&Y.Ud(a,b.size)},ra:function(){d(B.Db[U.Q])},ba:function(a,b,c,e){return Y.createNode(a,b,c,e)},rename:function(a,b,c){if(B.J(a.mode)){var e;try{e=B.aa(b,c)}catch(f){}if(e)for(var h in e.k)d(new B.e(U.sb))}delete a.parent.k[a.name];a.name=c;b.k[c]=a;a.parent=b},za:function(a,b){delete a.k[b]},Oa:function(a,b){var c=B.aa(a,b),e;for(e in c.k)d(new B.e(U.sb));delete a.k[b]},Na:function(a){var b=[".",".."],c;for(c in a.k)a.k.hasOwnProperty(c)&&
b.push(c);return b},ca:function(a,b,c){a=Y.createNode(a,b,41471,0);a.link=c;return a},ta:function(a){B.Ia(a.mode)||d(new B.e(U.B));return a.link}},p:{M:function(a,b,c,e,f){var h=a.g.k;if(f>=a.g.q)return 0;a=Math.min(a.g.q-f,e);w(0<=a);if(8<a&&h.subarray)b.set(h.subarray(f,f+a),c);else for(e=0;e<a;e++)b[c+e]=h[f+e];return a},write:function(a,b,c,e,f,h){if(!e)return 0;a=a.g;a.timestamp=Date.now();if(b.subarray&&(!a.k||a.k.subarray)){if(h)return a.k=b.subarray(c,c+e),a.q=e;if(0===a.q&&0===f)return a.k=
new Uint8Array(b.subarray(c,c+e)),a.q=e;if(f+e<=a.q)return a.k.set(b.subarray(c,c+e),f),e}Y.lc(a,f+e);if(a.k.subarray&&b.subarray)a.k.set(b.subarray(c,c+e),f);else for(h=0;h<e;h++)a.k[f+h]=b[c+h];a.q=Math.max(a.q,f+e);return e},$:function(a,b,c){1===c?b+=a.position:2===c&&B.isFile(a.g.mode)&&(b+=a.g.q);0>b&&d(new B.e(U.B));return b},Ea:function(a,b,c){Y.lc(a.g,b+c);a.g.q=Math.max(a.g.q,b+c)},Ja:function(a,b,c,e,f,h,j){B.isFile(a.g.mode)||d(new B.e(U.Qa));c=a.g.k;if(!(j&2)&&(c.buffer===b||c.buffer===
b.buffer))a=m,e=c.byteOffset;else{if(0<f||f+e<a.g.q)c=c.subarray?c.subarray(f,f+e):Array.prototype.slice.call(c,f,f+e);a=i;(e=Ca(e))||d(new B.e(U.Mc));b.set(c,e)}return{Lg:e,Yf:a}}}},ob=M(1,"i32*",L),pb=M(1,"i32*",L),qb=M(1,"i32*",L),B={root:k,La:[],ic:[k],oa:[],Jd:1,T:k,hc:"/",hb:m,vc:i,H:{},Gc:{yc:{Rc:1,Sc:2}},e:k,Db:{},sc:function(a){a instanceof B.e||d(a+" : "+Fa());return V(a.cb)},u:function(a,b){a=gb(B.yb(),a);b=b||{};if(!a)return{path:"",g:k};var c={Bb:i,Nb:0},e;for(e in c)b[e]===g&&(b[e]=
c[e]);8<b.Nb&&d(new B.e(U.rb));var c=cb(a.split("/").filter(function(a){return!!a}),m),f=B.root;e="/";for(var h=0;h<c.length;h++){var j=h===c.length-1;if(j&&b.parent)break;f=B.aa(f,c[h]);e=X(e,c[h]);if(B.ka(f)&&(!j||j&&b.Bb))f=f.Ka.root;if(!j||b.R)for(j=0;B.Ia(f.mode);)f=B.ta(e),e=gb(eb(e),f),f=B.u(e,{Nb:b.Nb}).g,40<j++&&d(new B.e(U.rb))}return{path:e,g:f}},da:function(a){for(var b;;){if(B.jb(a))return a=a.F.Id,!b?a:"/"!==a[a.length-1]?a+"/"+b:a+b;b=b?a.name+"/"+b:a.name;a=a.parent}},Fb:function(a,
b){for(var c=0,e=0;e<b.length;e++)c=(c<<5)-c+b.charCodeAt(e)|0;return(a+c>>>0)%B.T.length},tc:function(a){var b=B.Fb(a.parent.id,a.name);a.ma=B.T[b];B.T[b]=a},uc:function(a){var b=B.Fb(a.parent.id,a.name);if(B.T[b]===a)B.T[b]=a.ma;else for(b=B.T[b];b;){if(b.ma===a){b.ma=a.ma;break}b=b.ma}},aa:function(a,b){var c=B.Gd(a);c&&d(new B.e(c,a));for(c=B.T[B.Fb(a.id,b)];c;c=c.ma){var e=c.name;if(c.parent.id===a.id&&e===b)return c}return B.ra(a,b)},createNode:function(a,b,c,e){B.Va||(B.Va=function(a,b,c,e){a||
(a=this);this.parent=a;this.F=a.F;this.Ka=k;this.id=B.Jd++;this.name=b;this.mode=c;this.n={};this.p={};this.ob=e},B.Va.prototype={},Object.defineProperties(B.Va.prototype,{M:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},Dd:{get:function(){return B.J(this.mode)}},Gb:{get:function(){return B.ib(this.mode)}}}));a=new B.Va(a,b,c,e);B.tc(a);return a},
zb:function(a){B.uc(a)},jb:function(a){return a===a.parent},ka:function(a){return!!a.Ka},isFile:function(a){return 32768===(a&61440)},J:function(a){return 16384===(a&61440)},Ia:function(a){return 40960===(a&61440)},ib:function(a){return 8192===(a&61440)},Bd:function(a){return 24576===(a&61440)},Cd:function(a){return 4096===(a&61440)},Ed:function(a){return 49152===(a&49152)},rd:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},
wc:function(a){var b=B.rd[a];"undefined"===typeof b&&d(Error("Unknown file open mode: "+a));return b},sd:function(a){var b=["r","w","rw"][a&2097155];a&512&&(b+="w");return b},na:function(a,b){return B.vc?0:-1!==b.indexOf("r")&&!(a.mode&292)||-1!==b.indexOf("w")&&!(a.mode&146)||-1!==b.indexOf("x")&&!(a.mode&73)?U.qb:0},Gd:function(a){var b=B.na(a,"x");return b?b:!a.n.ra?U.qb:0},Jb:function(a,b){try{return B.aa(a,b),U.Xb}catch(c){}return B.na(a,"wx")},kb:function(a,b,c){var e;try{e=B.aa(a,b)}catch(f){return f.cb}if(a=
B.na(a,"wx"))return a;if(c){if(!B.J(e.mode))return U.Sa;if(B.jb(e)||B.da(e)===B.yb())return U.ga}else if(B.J(e.mode))return U.pa;return 0},Hd:function(a,b){return!a?U.Q:B.Ia(a.mode)?U.rb:B.J(a.mode)&&(0!==(b&2097155)||b&512)?U.pa:B.na(a,B.sd(b))},Qc:4096,Kd:function(a,b){for(var b=b||B.Qc,c=a||0;c<=b;c++)if(!B.oa[c])return c;d(new B.e(U.Lc))},qa:function(a){return B.oa[a]},fc:function(a,b,c){B.Wa||(B.Wa=n(),B.Wa.prototype={},Object.defineProperties(B.Wa.prototype,{object:{get:function(){return this.g},
set:function(a){this.g=a}},yg:{get:function(){return 1!==(this.D&2097155)}},zg:{get:function(){return 0!==(this.D&2097155)}},xg:{get:function(){return this.D&1024}}}));var e=new B.Wa,f;for(f in a)e[f]=a[f];a=e;b=B.Kd(b,c);a.C=b;return B.oa[b]=a},dd:function(a){B.oa[a]=k},pc:function(a){return B.oa[a-1]},Eb:function(a){return a?a.C+1:0},bd:{open:function(a){a.p=B.td(a.g.ob).p;a.p.open&&a.p.open(a)},$:function(){d(new B.e(U.Ua))}},Ib:function(a){return a>>8},Gg:function(a){return a&255},la:function(a,
b){return a<<8|b},Ob:function(a,b){B.ic[a]={p:b}},td:function(a){return B.ic[a]},nc:function(a){for(var b=[],a=[a];a.length;){var c=a.pop();b.push(c);a.push.apply(a,c.La)}return b},Fc:function(a,b){function c(a){if(a){if(!c.pd)return c.pd=i,b(a)}else++f>=e.length&&b(k)}"function"===typeof a&&(b=a,a=m);var e=B.nc(B.root.F),f=0;e.forEach(function(b){if(!b.type.Fc)return c(k);b.type.Fc(b,a,c)})},F:function(a,b,c){var e="/"===c,f=!c,h;e&&B.root&&d(new B.e(U.ga));!e&&!f&&(h=B.u(c,{Bb:m}),c=h.path,h=h.g,
B.ka(h)&&d(new B.e(U.ga)),B.J(h.mode)||d(new B.e(U.Sa)));b={type:a,Kg:b,Id:c,La:[]};a=a.F(b);a.F=b;b.root=a;e?B.root=a:h&&(h.Ka=b,h.F&&h.F.La.push(b));return a},Qg:function(a){a=B.u(a,{Bb:m});B.ka(a.g)||d(new B.e(U.B));var a=a.g,b=a.Ka,c=B.nc(b);Object.keys(B.T).forEach(function(a){for(a=B.T[a];a;){var b=a.ma;-1!==c.indexOf(a.F)&&B.zb(a);a=b}});a.Ka=k;b=a.F.La.indexOf(b);w(-1!==b);a.F.La.splice(b,1)},ra:function(a,b){return a.n.ra(a,b)},ba:function(a,b,c){var e=B.u(a,{parent:i}).g,a=W(a);(!a||"."===
a||".."===a)&&d(new B.e(U.B));var f=B.Jb(e,a);f&&d(new B.e(f));e.n.ba||d(new B.e(U.O));return e.n.ba(e,a,b,c)},create:function(a,b){b=(b!==g?b:438)&4095;b|=32768;return B.ba(a,b,0)},ea:function(a,b){b=(b!==g?b:511)&1023;b|=16384;return B.ba(a,b,0)},lb:function(a,b,c){"undefined"===typeof c&&(c=b,b=438);return B.ba(a,b|8192,c)},ca:function(a,b){gb(a)||d(new B.e(U.Q));var c=B.u(b,{parent:i}).g;c||d(new B.e(U.Q));var e=W(b),f=B.Jb(c,e);f&&d(new B.e(f));c.n.ca||d(new B.e(U.O));return c.n.ca(c,e,a)},rename:function(a,
b){var c=eb(a),e=eb(b),f=W(a),h=W(b),j,l,u;try{j=B.u(a,{parent:i}),l=j.g,j=B.u(b,{parent:i}),u=j.g}catch(q){d(new B.e(U.ga))}(!l||!u)&&d(new B.e(U.Q));l.F!==u.F&&d(new B.e(U.Oc));j=B.aa(l,f);e=hb(a,e);"."!==e.charAt(0)&&d(new B.e(U.B));e=hb(b,c);"."!==e.charAt(0)&&d(new B.e(U.sb));var x;try{x=B.aa(u,h)}catch(s){}if(j!==x){c=B.J(j.mode);(f=B.kb(l,f,c))&&d(new B.e(f));(f=x?B.kb(u,h,c):B.Jb(u,h))&&d(new B.e(f));l.n.rename||d(new B.e(U.O));(B.ka(j)||x&&B.ka(x))&&d(new B.e(U.ga));u!==l&&(f=B.na(l,"w"))&&
d(new B.e(f));try{B.H.willMovePath&&B.H.willMovePath(a,b)}catch(v){console.log("FS.trackingDelegate['willMovePath']('"+a+"', '"+b+"') threw an exception: "+v.message)}B.uc(j);try{l.n.rename(j,u,h)}catch(G){d(G)}finally{B.tc(j)}try{if(B.H.onMovePath)B.H.onMovePath(a,b)}catch(ua){console.log("FS.trackingDelegate['onMovePath']('"+a+"', '"+b+"') threw an exception: "+ua.message)}}},Oa:function(a){var b=B.u(a,{parent:i}).g,c=W(a),e=B.aa(b,c),f=B.kb(b,c,i);f&&d(new B.e(f));b.n.Oa||d(new B.e(U.O));B.ka(e)&&
d(new B.e(U.ga));try{B.H.willDeletePath&&B.H.willDeletePath(a)}catch(h){console.log("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+h.message)}b.n.Oa(b,c);B.zb(e);try{if(B.H.onDeletePath)B.H.onDeletePath(a)}catch(j){console.log("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+j.message)}},Na:function(a){a=B.u(a,{R:i}).g;a.n.Na||d(new B.e(U.Sa));return a.n.Na(a)},za:function(a){var b=B.u(a,{parent:i}).g,c=W(a),e=B.aa(b,c),f=B.kb(b,c,m);f&&(f===U.pa&&(f=U.O),
d(new B.e(f)));b.n.za||d(new B.e(U.O));B.ka(e)&&d(new B.e(U.ga));try{B.H.willDeletePath&&B.H.willDeletePath(a)}catch(h){console.log("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+h.message)}b.n.za(b,c);B.zb(e);try{if(B.H.onDeletePath)B.H.onDeletePath(a)}catch(j){console.log("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+j.message)}},ta:function(a){(a=B.u(a).g)||d(new B.e(U.Q));a.n.ta||d(new B.e(U.B));return a.n.ta(a)},Dc:function(a,b){var c=B.u(a,{R:!b}).g;
c||d(new B.e(U.Q));c.n.S||d(new B.e(U.O));return c.n.S(c)},Eg:function(a){return B.Dc(a,i)},Ya:function(a,b,c){a="string"===typeof a?B.u(a,{R:!c}).g:a;a.n.I||d(new B.e(U.O));a.n.I(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})},Bg:function(a,b){B.Ya(a,b,i)},jg:function(a,b){var c=B.qa(a);c||d(new B.e(U.V));B.Ya(c.g,b)},dc:function(a,b,c,e){a="string"===typeof a?B.u(a,{R:!e}).g:a;a.n.I||d(new B.e(U.O));a.n.I(a,{timestamp:Date.now()})},Cg:function(a,b,c){B.dc(a,b,c,i)},kg:function(a,b,c){(a=B.qa(a))||
d(new B.e(U.V));B.dc(a.g,b,c)},truncate:function(a,b){0>b&&d(new B.e(U.B));var c;c="string"===typeof a?B.u(a,{R:i}).g:a;c.n.I||d(new B.e(U.O));B.J(c.mode)&&d(new B.e(U.pa));B.isFile(c.mode)||d(new B.e(U.B));var e=B.na(c,"w");e&&d(new B.e(e));c.n.I(c,{size:b,timestamp:Date.now()})},mg:function(a,b){var c=B.qa(a);c||d(new B.e(U.V));0===(c.D&2097155)&&d(new B.e(U.B));B.truncate(c.g,b)},Rg:function(a,b,c){a=B.u(a,{R:i}).g;a.n.I(a,{timestamp:Math.max(b,c)})},open:function(a,b,c,e,f){""===a&&d(new B.e(U.Q));
var b="string"===typeof b?B.wc(b):b,c=b&64?("undefined"===typeof c?438:c)&4095|32768:0,h;if("object"===typeof a)h=a;else{a=db(a);try{h=B.u(a,{R:!(b&131072)}).g}catch(j){}}var l=m;b&64&&(h?b&128&&d(new B.e(U.Xb)):(h=B.ba(a,c,0),l=i));h||d(new B.e(U.Q));B.ib(h.mode)&&(b&=-513);l||(c=B.Hd(h,b))&&d(new B.e(c));b&512&&B.truncate(h,0);b&=-641;e=B.fc({g:h,path:B.da(h),D:b,seekable:i,position:0,p:h.p,$d:[],error:m},e,f);e.p.open&&e.p.open(e);p.logReadFiles&&!(b&1)&&(B.Mb||(B.Mb={}),a in B.Mb||(B.Mb[a]=1,
p.printErr("read file: "+a)));try{B.H.onOpenFile&&(f=0,1!==(b&2097155)&&(f|=B.Gc.yc.Rc),0!==(b&2097155)&&(f|=B.Gc.yc.Sc),B.H.onOpenFile(a,f))}catch(u){console.log("FS.trackingDelegate['onOpenFile']('"+a+"', flags) threw an exception: "+u.message)}return e},close:function(a){try{a.p.close&&a.p.close(a)}catch(b){d(b)}finally{B.dd(a.C)}},$:function(a,b,c){(!a.seekable||!a.p.$)&&d(new B.e(U.Ua));a.position=a.p.$(a,b,c);a.$d=[];return a.position},M:function(a,b,c,e,f){(0>e||0>f)&&d(new B.e(U.B));1===(a.D&
2097155)&&d(new B.e(U.V));B.J(a.g.mode)&&d(new B.e(U.pa));a.p.M||d(new B.e(U.B));var h=i;"undefined"===typeof f?(f=a.position,h=m):a.seekable||d(new B.e(U.Ua));b=a.p.M(a,b,c,e,f);h||(a.position+=b);return b},write:function(a,b,c,e,f,h){(0>e||0>f)&&d(new B.e(U.B));0===(a.D&2097155)&&d(new B.e(U.V));B.J(a.g.mode)&&d(new B.e(U.pa));a.p.write||d(new B.e(U.B));a.D&1024&&B.$(a,0,2);var j=i;"undefined"===typeof f?(f=a.position,j=m):a.seekable||d(new B.e(U.Ua));b=a.p.write(a,b,c,e,f,h);j||(a.position+=b);
try{if(a.path&&B.H.onWriteToFile)B.H.onWriteToFile(a.path)}catch(l){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+l.message)}return b},Ea:function(a,b,c){(0>b||0>=c)&&d(new B.e(U.B));0===(a.D&2097155)&&d(new B.e(U.V));!B.isFile(a.g.mode)&&!B.J(node.mode)&&d(new B.e(U.Qa));a.p.Ea||d(new B.e(U.Ta));a.p.Ea(a,b,c)},Ja:function(a,b,c,e,f,h,j){1===(a.D&2097155)&&d(new B.e(U.qb));a.p.Ja||d(new B.e(U.Qa));return a.p.Ja(a,b,c,e,f,h,j)},Ha:function(a,b,c){a.p.Ha||d(new B.e(U.Nc));
return a.p.Ha(a,b,c)},Mg:function(a,b){b=b||{};b.D=b.D||"r";b.encoding=b.encoding||"binary";"utf8"!==b.encoding&&"binary"!==b.encoding&&d(Error('Invalid encoding type "'+b.encoding+'"'));var c,e=B.open(a,b.D),f=B.Dc(a).size,h=new Uint8Array(f);B.M(e,h,0,f,0);if("utf8"===b.encoding){c="";for(var j=new z.Da,l=0;l<f;l++)c+=j.nb(h[l])}else"binary"===b.encoding&&(c=h);B.close(e);return c},Sg:function(a,b,c){c=c||{};c.D=c.D||"w";c.encoding=c.encoding||"utf8";"utf8"!==c.encoding&&"binary"!==c.encoding&&
d(Error('Invalid encoding type "'+c.encoding+'"'));a=B.open(a,c.D,c.mode);"utf8"===c.encoding?(b=new Uint8Array((new z.Da).Ac(b)),B.write(a,b,0,b.length,0,c.ad)):"binary"===c.encoding&&B.write(a,b,0,b.length,0,c.ad);B.close(a)},yb:function(){return B.hc},bg:function(a){a=B.u(a,{R:i});B.J(a.g.mode)||d(new B.e(U.Sa));var b=B.na(a.g,"x");b&&d(new B.e(b));B.hc=a.path},fd:function(){B.ea("/tmp");B.ea("/home");B.ea("/home/web_user")},ed:function(){B.ea("/dev");B.Ob(B.la(1,3),{M:function(){return 0},write:function(){return 0}});
B.lb("/dev/null",B.la(1,3));jb(B.la(5,0),mb);jb(B.la(6,0),nb);B.lb("/dev/tty",B.la(5,0));B.lb("/dev/tty1",B.la(6,0));var a;if("undefined"!==typeof crypto){var b=new Uint8Array(1);a=function(){crypto.getRandomValues(b);return b[0]}}else a=t?function(){return require("crypto").randomBytes(1)[0]}:function(){return 256*Math.random()|0};B.X("/dev","random",a);B.X("/dev","urandom",a);B.ea("/dev/shm");B.ea("/dev/shm/tmp")},od:function(){p.stdin?B.X("/dev","stdin",p.stdin):B.ca("/dev/tty","/dev/stdin");p.stdout?
B.X("/dev","stdout",k,p.stdout):B.ca("/dev/tty","/dev/stdout");p.stderr?B.X("/dev","stderr",k,p.stderr):B.ca("/dev/tty1","/dev/stderr");var a=B.open("/dev/stdin","r");K[ob>>2]=B.Eb(a);w(0===a.C,"invalid handle for stdin ("+a.C+")");a=B.open("/dev/stdout","w");K[pb>>2]=B.Eb(a);w(1===a.C,"invalid handle for stdout ("+a.C+")");a=B.open("/dev/stderr","w");K[qb>>2]=B.Eb(a);w(2===a.C,"invalid handle for stderr ("+a.C+")")},jc:function(){B.e||(B.e=function(a,b){this.g=b;this.Xd=function(a){this.cb=a;for(var b in U)if(U[b]===
a){this.code=b;break}};this.Xd(a);this.message=ab[a]},B.e.prototype=Error(),[U.Q].forEach(function(a){B.Db[a]=new B.e(a);B.Db[a].stack="<generic error, no stack>"}))},Zd:function(){B.jc();B.T=Array(4096);B.F(Y,{},"/");B.fd();B.ed()},Ga:function(a,b,c){w(!B.Ga.hb,"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)");B.Ga.hb=i;B.jc();p.stdin=a||p.stdin;p.stdout=b||p.stdout;p.stderr=
c||p.stderr;B.od()},Qd:function(){B.Ga.hb=m;for(var a=0;a<B.oa.length;a++){var b=B.oa[a];b&&B.close(b)}},fb:function(a,b){var c=0;a&&(c|=365);b&&(c|=146);return c},Ag:function(a,b){var c=fb.apply(k,a);b&&"/"==c[0]&&(c=c.substr(1));return c},Sf:function(a,b){return gb(b,a)},Pg:function(a){return db(a)},lg:function(a,b){var c=B.vb(a,b);if(c.Ab)return c.object;V(c.error);return k},vb:function(a,b){try{var c=B.u(a,{R:!b}),a=c.path}catch(e){}var f={jb:m,Ab:m,error:0,name:k,path:k,object:k,Md:m,Od:k,Nd:k};
try{c=B.u(a,{parent:i}),f.Md=i,f.Od=c.path,f.Nd=c.g,f.name=W(a),c=B.u(a,{R:!b}),f.Ab=i,f.path=c.path,f.object=c.g,f.name=c.g.name,f.jb="/"===c.path}catch(h){f.error=h.cb}return f},hd:function(a,b,c,e){a=X("string"===typeof a?a:B.da(a),b);return B.ea(a,B.fb(c,e))},ld:function(a,b){for(var a="string"===typeof a?a:B.da(a),c=b.split("/").reverse();c.length;){var e=c.pop();if(e){var f=X(a,e);try{B.ea(f)}catch(h){}a=f}}return f},gd:function(a,b,c,e,f){a=X("string"===typeof a?a:B.da(a),b);return B.create(a,
B.fb(e,f))},xb:function(a,b,c,e,f,h){a=b?X("string"===typeof a?a:B.da(a),b):a;e=B.fb(e,f);f=B.create(a,e);if(c){if("string"===typeof c){for(var a=Array(c.length),b=0,j=c.length;b<j;++b)a[b]=c.charCodeAt(b);c=a}B.Ya(f,e|146);a=B.open(f,"w");B.write(a,c,0,c.length,0,h);B.close(a);B.Ya(f,e)}return f},X:function(a,b,c,e){a=X("string"===typeof a?a:B.da(a),b);b=B.fb(!!c,!!e);B.X.Ib||(B.X.Ib=64);var f=B.la(B.X.Ib++,0);B.Ob(f,{open:function(a){a.seekable=m},close:function(){e&&(e.buffer&&e.buffer.length)&&
e(10)},M:function(a,b,e,f){for(var q=0,x=0;x<f;x++){var s;try{s=c()}catch(v){d(new B.e(U.ha))}s===g&&0===q&&d(new B.e(U.Ca));if(s===k||s===g)break;q++;b[e+x]=s}q&&(a.g.timestamp=Date.now());return q},write:function(a,b,c,f){for(var q=0;q<f;q++)try{e(b[c+q])}catch(x){d(new B.e(U.ha))}f&&(a.g.timestamp=Date.now());return q}});return B.lb(a,b,f)},kd:function(a,b,c){a=X("string"===typeof a?a:B.da(a),b);return B.ca(c,a)},mc:function(a){if(a.Gb||a.Dd||a.link||a.k)return i;var b=i;"undefined"!==typeof XMLHttpRequest&&
d(Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread."));if(p.read)try{a.k=Va(p.read(a.url),i),a.q=a.k.length}catch(c){b=m}else d(Error("Cannot load without read() or XMLHttpRequest."));b||V(U.ha);return b},jd:function(a,b,c,e,f){function h(){this.Hb=m;this.Za=[]}h.prototype.get=function(a){if(!(a>this.length-1||0>a)){var b=a%this.cd;return this.yd(a/
this.cd|0)[b]}};h.prototype.Wd=function(a){this.yd=a};h.prototype.bc=function(){var a=new XMLHttpRequest;a.open("HEAD",c,m);a.send(k);200<=a.status&&300>a.status||304===a.status||d(Error("Couldn't load "+c+". Status: "+a.status));var b=Number(a.getResponseHeader("Content-length")),e,f=1048576;if(!((e=a.getResponseHeader("Accept-Ranges"))&&"bytes"===e))f=b;var h=this;h.Wd(function(a){var e=a*f,j=(a+1)*f-1,j=Math.min(j,b-1);if("undefined"===typeof h.Za[a]){var l=h.Za;e>j&&d(Error("invalid range ("+
e+", "+j+") or no bytes requested!"));j>b-1&&d(Error("only "+b+" bytes available! programmer error!"));var q=new XMLHttpRequest;q.open("GET",c,m);b!==f&&q.setRequestHeader("Range","bytes="+e+"-"+j);"undefined"!=typeof Uint8Array&&(q.responseType="arraybuffer");q.overrideMimeType&&q.overrideMimeType("text/plain; charset=x-user-defined");q.send(k);200<=q.status&&300>q.status||304===q.status||d(Error("Couldn't load "+c+". Status: "+q.status));e=q.response!==g?new Uint8Array(q.response||[]):Va(q.responseText||
"",i);l[a]=e}"undefined"===typeof h.Za[a]&&d(Error("doXHR failed!"));return h.Za[a]});this.Uc=b;this.Tc=f;this.Hb=i};if("undefined"!==typeof XMLHttpRequest){ca||d("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var j=new h;Object.defineProperty(j,"length",{get:function(){this.Hb||this.bc();return this.Uc}});Object.defineProperty(j,"chunkSize",{get:function(){this.Hb||this.bc();return this.Tc}});j={Gb:m,k:j}}else j={Gb:m,url:c};
var l=B.gd(a,b,j,e,f);j.k?l.k=j.k:j.url&&(l.k=k,l.url=j.url);Object.defineProperty(l,"usedBytes",{get:function(){return this.k.length}});var u={};Object.keys(l.p).forEach(function(a){var b=l.p[a];u[a]=function(){B.mc(l)||d(new B.e(U.ha));return b.apply(k,arguments)}});u.M=function(a,b,c,e,f){B.mc(l)||d(new B.e(U.ha));a=a.g.k;if(f>=a.length)return 0;e=Math.min(a.length-f,e);w(0<=e);if(a.slice)for(var h=0;h<e;h++)b[c+h]=a[f+h];else for(h=0;h<e;h++)b[c+h]=a.get(f+h);return e};l.p=u;return l},md:function(a,
b,c,e,f,h,j,l,u){function q(){rb=document.pointerLockElement===v||document.mozPointerLockElement===v||document.webkitPointerLockElement===v||document.msPointerLockElement===v}function x(c){function q(c){l||B.xb(a,b,c,e,f,u);h&&h();Za()}var s=m;p.preloadPlugins.forEach(function(a){!s&&a.canHandle(G)&&(a.handle(c,G,q,function(){j&&j();Za()}),s=i)});s||q(c)}p.preloadPlugins||(p.preloadPlugins=[]);if(!tb){tb=i;try{new Blob,ub=i}catch(s){ub=m,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}vb=
"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:!ub?console.log("warning: no BlobBuilder"):k;wb="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:g;!p.xc&&"undefined"===typeof wb&&(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),p.xc=i);p.preloadPlugins.push({canHandle:function(a){return!p.xc&&/\.(jpg|jpeg|png|bmp)$/i.test(a)},handle:function(a,b,
c,e){var f=k;if(ub)try{f=new Blob([a],{type:xb(b)}),f.size!==a.length&&(f=new Blob([(new Uint8Array(a)).buffer],{type:xb(b)}))}catch(h){z.Aa("Blob constructor present but fails: "+h+"; falling back to blob builder")}f||(f=new vb,f.append((new Uint8Array(a)).buffer),f=f.getBlob());var j=wb.createObjectURL(f),l=new Image;l.onload=function(){w(l.complete,"Image "+b+" could not be decoded");var e=document.createElement("canvas");e.width=l.width;e.height=l.height;e.getContext("2d").drawImage(l,0,0);p.preloadedImages[b]=
e;wb.revokeObjectURL(j);c&&c(a)};l.onerror=function(){console.log("Image "+j+" could not be decoded");e&&e()};l.src=j}});p.preloadPlugins.push({canHandle:function(a){return!p.Jg&&a.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(a,b,c,e){function f(e){j||(j=i,p.preloadedAudios[b]=e,c&&c(a))}function h(){j||(j=i,p.preloadedAudios[b]=new Audio,e&&e())}var j=m;if(ub){try{var l=new Blob([a],{type:xb(b)})}catch(q){return h()}var l=wb.createObjectURL(l),s=new Audio;s.addEventListener("canplaythrough",
function(){f(s)},m);s.onerror=function(){if(!j){console.log("warning: browser could not fully decode audio "+b+", trying slower base64 approach");for(var c="",e=0,h=0,l=0;l<a.length;l++){e=e<<8|a[l];for(h+=8;6<=h;)var q=e>>h-6&63,h=h-6,c=c+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[q]}2==h?(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(e&3)<<4],c+="=="):4==h&&(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(e&15)<<2],c+="=");
s.src="data:audio/x-"+b.substr(-3)+";base64,"+c;f(s)}};s.src=l;p.noExitRuntime=i;setTimeout(function(){H||f(s)},1E4)}else return h()}});var v=p.canvas;v&&(v.Pb=v.requestPointerLock||v.mozRequestPointerLock||v.webkitRequestPointerLock||v.msRequestPointerLock||n(),v.kc=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||n(),v.kc=v.kc.bind(document),document.addEventListener("pointerlockchange",q,m),document.addEventListener("mozpointerlockchange",
q,m),document.addEventListener("webkitpointerlockchange",q,m),document.addEventListener("mspointerlockchange",q,m),p.elementPointerLock&&v.addEventListener("click",function(a){!rb&&v.Pb&&(v.Pb(),a.preventDefault())},m))}var G=b?gb(X(a,b)):a;Ya();"string"==typeof c?yb(c,function(a){x(a)},j):x(c)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},Ub:function(){return"EM_FS_"+window.location.pathname},Vb:20,Ba:"FILE_DATA",Og:function(a,b,c){var b=
b||n(),c=c||n(),e=B.indexedDB();try{var f=e.open(B.Ub(),B.Vb)}catch(h){return c(h)}f.Ld=function(){console.log("creating db");f.result.createObjectStore(B.Ba)};f.onsuccess=function(){var e=f.result.transaction([B.Ba],"readwrite"),h=e.objectStore(B.Ba),u=0,q=0,x=a.length;a.forEach(function(a){a=h.put(B.vb(a).object.k,a);a.onsuccess=function(){u++;u+q==x&&(0==q?b():c())};a.onerror=function(){q++;u+q==x&&(0==q?b():c())}});e.onerror=c};f.onerror=c},Dg:function(a,b,c){var b=b||n(),c=c||n(),e=B.indexedDB();
try{var f=e.open(B.Ub(),B.Vb)}catch(h){return c(h)}f.Ld=c;f.onsuccess=function(){var e=f.result;try{var h=e.transaction([B.Ba],"readonly")}catch(u){c(u);return}var q=h.objectStore(B.Ba),x=0,s=0,v=a.length;a.forEach(function(a){var e=q.get(a);e.onsuccess=function(){B.vb(a).Ab&&B.za(a);B.xb(eb(a),W(a),e.result,i,i,i);x++;x+s==v&&(0==s?b():c())};e.onerror=function(){s++;x+s==v&&(0==s?b():c())}});h.onerror=c};f.onerror=c}};function zb(){d("TODO")}
var Z={F:function(){p.websocket=p.websocket&&"object"===typeof p.websocket?p.websocket:{};p.websocket.tb={};p.websocket.on=function(a,b){"function"===typeof b&&(this.tb[a]=b);return this};p.websocket.P=function(a,b){"function"===typeof this.tb[a]&&this.tb[a].call(this,b)};return B.createNode(k,"/",16895,0)},nd:function(a,b,c){c&&w(1==b==(6==c));a={qd:a,type:b,protocol:c,G:k,error:k,Ma:{},Kb:[],ua:[],wa:Z.L};b=Z.mb();c=B.createNode(Z.root,b,49152,0);c.va=a;b=B.fc({path:b,g:c,D:B.wc("r+"),seekable:m,
p:Z.p});a.A=b;return a},wd:function(a){a=B.qa(a);return!a||!B.Ed(a.g.mode)?k:a.g.va},p:{zc:function(a){a=a.g.va;return a.wa.zc(a)},Ha:function(a,b,c){a=a.g.va;return a.wa.Ha(a,b,c)},M:function(a,b,c,e){a=a.g.va;e=a.wa.Rd(a,e);if(!e)return 0;b.set(e.buffer,c);return e.buffer.length},write:function(a,b,c,e){a=a.g.va;return a.wa.Vd(a,b,c,e)},close:function(a){a=a.g.va;a.wa.close(a)}},mb:function(){Z.mb.gc||(Z.mb.gc=0);return"socket["+Z.mb.gc++ +"]"},L:{$a:function(a,b,c){var e;"object"===typeof b&&(e=
b,c=b=k);if(e)e._socket?(b=e._socket.remoteAddress,c=e._socket.remotePort):((c=/ws[s]?:\/\/([^:]+):(\d+)/.exec(e.url))||d(Error("WebSocket URL must be in the format ws(s)://address:port")),b=c[1],c=parseInt(c[2],10));else try{var f=p.websocket&&"object"===typeof p.websocket,h="ws:#".replace("#","//");f&&"string"===typeof p.websocket.url&&(h=p.websocket.url);if("ws://"===h||"wss://"===h)var j=b.split("/"),h=h+j[0]+":"+c+"/"+j.slice(1).join("/");j="binary";f&&"string"===typeof p.websocket.subprotocol&&
(j=p.websocket.subprotocol);var j=j.replace(/^ +| +$/g,"").split(/ *, */),l=t?{protocol:j.toString()}:j;e=new (t?require("ws"):window.WebSocket)(h,l);e.binaryType="arraybuffer"}catch(u){d(new B.e(U.Yb))}b={W:b,port:c,o:e,ab:[]};Z.L.$b(a,b);Z.L.zd(a,b);2===a.type&&"undefined"!==typeof a.ya&&b.ab.push(new Uint8Array([255,255,255,255,112,111,114,116,(a.ya&65280)>>8,a.ya&255]));return b},gb:function(a,b,c){return a.Ma[b+":"+c]},$b:function(a,b){a.Ma[b.W+":"+b.port]=b},Bc:function(a,b){delete a.Ma[b.W+
":"+b.port]},zd:function(a,b){function c(){p.websocket.P("open",a.A.C);try{for(var c=b.ab.shift();c;)b.o.send(c),c=b.ab.shift()}catch(e){b.o.close()}}function e(c){w("string"!==typeof c&&c.byteLength!==g);var c=new Uint8Array(c),e=f;f=m;e&&10===c.length&&255===c[0]&&255===c[1]&&255===c[2]&&255===c[3]&&112===c[4]&&111===c[5]&&114===c[6]&&116===c[7]?(c=c[8]<<8|c[9],Z.L.Bc(a,b),b.port=c,Z.L.$b(a,b)):(a.ua.push({W:b.W,port:b.port,data:c}),p.websocket.P("message",a.A.C))}var f=i;t?(b.o.on("open",c),b.o.on("message",
function(a,b){b.binary&&e((new Uint8Array(a)).buffer)}),b.o.on("close",function(){p.websocket.P("close",a.A.C)}),b.o.on("error",function(){a.error=U.Wb;p.websocket.P("error",[a.A.C,a.error,"ECONNREFUSED: Connection refused"])})):(b.o.onopen=c,b.o.onclose=function(){p.websocket.P("close",a.A.C)},b.o.onmessage=function(a){e(a.data)},b.o.onerror=function(){a.error=U.Wb;p.websocket.P("error",[a.A.C,a.error,"ECONNREFUSED: Connection refused"])})},zc:function(a){if(1===a.type&&a.G)return a.Kb.length?65:
0;var b=0,c=1===a.type?Z.L.gb(a,a.Y,a.Z):k;if(a.ua.length||!c||c&&c.o.readyState===c.o.Pa||c&&c.o.readyState===c.o.CLOSED)b|=65;if(!c||c&&c.o.readyState===c.o.OPEN)b|=4;if(c&&c.o.readyState===c.o.Pa||c&&c.o.readyState===c.o.CLOSED)b|=16;return b},Ha:function(a,b,c){switch(b){case 21531:return b=0,a.ua.length&&(b=a.ua[0].data.length),K[c>>2]=b,0;default:return U.B}},close:function(a){if(a.G){try{a.G.close()}catch(b){}a.G=k}for(var c=Object.keys(a.Ma),e=0;e<c.length;e++){var f=a.Ma[c[e]];try{f.o.close()}catch(h){}Z.L.Bc(a,
f)}return 0},bind:function(a,b,c){("undefined"!==typeof a.Qb||"undefined"!==typeof a.ya)&&d(new B.e(U.B));a.Qb=b;a.ya=c||zb();if(2===a.type){a.G&&(a.G.close(),a.G=k);try{a.wa.Fd(a,0)}catch(e){e instanceof B.e||d(e),e.cb!==U.Ta&&d(e)}}},cg:function(a,b,c){a.G&&d(new B.e(U.Ta));if("undefined"!==typeof a.Y&&"undefined"!==typeof a.Z){var e=Z.L.gb(a,a.Y,a.Z);e&&(e.o.readyState===e.o.CONNECTING&&d(new B.e(U.Hc)),d(new B.e(U.Kc)))}b=Z.L.$a(a,b,c);a.Y=b.W;a.Z=b.port;d(new B.e(U.Jc))},Fd:function(a){t||d(new B.e(U.Ta));
a.G&&d(new B.e(U.B));var b=require("ws").Server;a.G=new b({host:a.Qb,port:a.ya});p.websocket.P("listen",a.A.C);a.G.on("connection",function(b){if(1===a.type){var e=Z.nd(a.qd,a.type,a.protocol),b=Z.L.$a(e,b);e.Y=b.W;e.Z=b.port;a.Kb.push(e);p.websocket.P("connection",e.A.C)}else Z.L.$a(a,b),p.websocket.P("connection",a.A.C)});a.G.on("closed",function(){p.websocket.P("close",a.A.C);a.G=k});a.G.on("error",function(){a.error=U.Yb;p.websocket.P("error",[a.A.C,a.error,"EHOSTUNREACH: Host is unreachable"])})},
accept:function(a){a.G||d(new B.e(U.B));var b=a.Kb.shift();b.A.D=a.A.D;return b},tg:function(a,b){var c,e;b?((a.Y===g||a.Z===g)&&d(new B.e(U.Ra)),c=a.Y,e=a.Z):(c=a.Qb||0,e=a.ya||0);return{W:c,port:e}},Vd:function(a,b,c,e,f,h){if(2===a.type){if(f===g||h===g)f=a.Y,h=a.Z;(f===g||h===g)&&d(new B.e(U.Ic))}else f=a.Y,h=a.Z;var j=Z.L.gb(a,f,h);1===a.type&&((!j||j.o.readyState===j.o.Pa||j.o.readyState===j.o.CLOSED)&&d(new B.e(U.Ra)),j.o.readyState===j.o.CONNECTING&&d(new B.e(U.Ca)));b=b instanceof Array||
b instanceof ArrayBuffer?b.slice(c,c+e):b.buffer.slice(b.byteOffset+c,b.byteOffset+c+e);if(2===a.type&&(!j||j.o.readyState!==j.o.OPEN)){if(!j||j.o.readyState===j.o.Pa||j.o.readyState===j.o.CLOSED)j=Z.L.$a(a,f,h);j.ab.push(b);return e}try{return j.o.send(b),e}catch(l){d(new B.e(U.B))}},Rd:function(a,b){1===a.type&&a.G&&d(new B.e(U.Ra));var c=a.ua.shift();if(!c){if(1===a.type){var e=Z.L.gb(a,a.Y,a.Z);if(e){if(e.o.readyState===e.o.Pa||e.o.readyState===e.o.CLOSED)return k;d(new B.e(U.Ca))}d(new B.e(U.Ra))}d(new B.e(U.Ca))}var e=
c.data.byteLength||c.data.length,f=c.data.byteOffset||0,h=c.data.buffer||c.data,j=Math.min(b,e),l={buffer:new Uint8Array(h,f,j),W:c.W,port:c.port};1===a.type&&j<e&&(c.data=new Uint8Array(h,f+j,e-j),a.ua.unshift(c));return l}}};function Ab(a,b,c){a=B.qa(a);if(!a)return V(U.V),-1;try{return B.write(a,I,b,c)}catch(e){return B.sc(e),-1}}p._strlen=Bb;function Cb(a){a=B.pc(a);return!a?-1:a.C}function Db(a,b){return Ab(Cb(b),a,Bb(a))}
function Eb(a,b){var c;c=a&255;c=0<=c?c:Math.pow(2,g)+c;I[Eb.Cc>>0]=c;if(-1==Ab(Cb(b),Eb.Cc,1)){if(c=B.pc(b))c.error=i;return-1}return c}function Fb(a){Fb.$c||(E=E+4095&-4096,Fb.$c=i,w(z.bb),Fb.Wc=z.bb,z.bb=function(){A("cannot dynamically allocate, sbrk now has control")});var b=E;0!=a&&Fb.Wc(a);return b}p._memset=Gb;function Hb(a,b,c){window._broadwayOnPictureDecoded(a,b,c)}p._broadwayOnPictureDecoded=Hb;function Ib(){window._broadwayOnHeadersDecoded()}p._broadwayOnHeadersDecoded=Ib;
function Jb(a,b){Kb=a;Lb=b;if(!Mb)return 1;0==a?(Nb=function(){setTimeout(Ob,b)},Pb="timeout"):1==a&&(Nb=function(){Qb(Ob)},Pb="rAF");return 0}
function Rb(a,b,c,e){p.noExitRuntime=i;w(!Mb,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.");Mb=a;Sb=e;var f=Tb;Ob=function(){if(!H)if(0<Ub.length){var b=Date.now(),c=Ub.shift();c.ja(c.Xa);if(Vb){var l=Vb,u=0==l%1?l-1:Math.floor(l);Vb=c.dg?u:(8*l+(u+0.5))/9}console.log('main loop blocker "'+c.name+'" took '+(Date.now()-b)+" ms");p.setStatus&&(b=p.statusMessage||
"Please wait...",c=Vb,l=Wb.ig,c?c<l?p.setStatus(b+" ("+(l-c)+"/"+l+")"):p.setStatus(b):p.setStatus(""));setTimeout(Ob,0)}else if(!(f<Tb))if(Xb=Xb+1|0,1==Kb&&1<Lb&&0!=Xb%Lb)Nb();else{"timeout"===Pb&&p.fg&&(p.fa("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Pb="");a:if(!H&&!(p.preMainLoop&&p.preMainLoop()===m)){try{"undefined"!==
typeof e?z.Fa("vi",a,[e]):z.Fa("v",a)}catch(q){if(q instanceof ia)break a;q&&("object"===typeof q&&q.stack)&&p.fa("exception thrown: "+[q,q.stack]);d(q)}p.postMainLoop&&p.postMainLoop()}f<Tb||("object"===typeof SDL&&(SDL.ac&&SDL.ac.Pd)&&SDL.ac.Pd(),Nb())}};b&&0<b?Jb(0,1E3/b):Jb(1,1);Nb();c&&d("SimulateInfiniteLoop")}var Nb=k,Pb="",Tb=0,Mb=k,Sb=0,Kb=0,Lb=0,Xb=0,Ub=[],Wb={},Ob,Vb,Yb=m,rb=m,Zb=m,$b=g,ac=g,bc=0;
function cc(a){var b=Date.now();if(0===bc)bc=b+1E3/60;else for(;b+2>=bc;)bc+=1E3/60;b=Math.max(bc-b,0);setTimeout(a,b)}function Qb(a){"undefined"===typeof window?cc(a):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||cc),window.requestAnimationFrame(a))}
function xb(a){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[a.substr(a.lastIndexOf(".")+1)]}
function yb(a,b,c){function e(){c?c():d('Loading data file "'+a+'" failed.')}var f=new XMLHttpRequest;f.open("GET",a,i);f.responseType="arraybuffer";f.onload=function(){if(200==f.status||0==f.status&&f.response){var c=f.response;w(c,'Loading data file "'+a+'" failed (no arrayBuffer).');b(new Uint8Array(c));Za()}else e()};f.onerror=e;f.send(k);Ya()}var dc=[];function ec(){var a=p.canvas;dc.forEach(function(b){b(a.width,a.height)})}
function fc(a,b,c){b&&c?(a.ae=b,a.Ad=c):(b=a.ae,c=a.Ad);var e=b,f=c;p.forcedAspectRatio&&0<p.forcedAspectRatio&&(e/f<p.forcedAspectRatio?e=Math.round(f*p.forcedAspectRatio):f=Math.round(e/p.forcedAspectRatio));if((document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===
a.parentNode&&"undefined"!=typeof screen)var h=Math.min(screen.width/e,screen.height/f),e=Math.round(e*h),f=Math.round(f*h);ac?(a.width!=e&&(a.width=e),a.height!=f&&(a.height=f),"undefined"!=typeof a.style&&(a.style.removeProperty("width"),a.style.removeProperty("height"))):(a.width!=b&&(a.width=b),a.height!=c&&(a.height=c),"undefined"!=typeof a.style&&(e!=b||f!=c?(a.style.setProperty("width",e+"px","important"),a.style.setProperty("height",f+"px","important")):(a.style.removeProperty("width"),a.style.removeProperty("height"))))}
var tb,ub,vb,wb;p._memcpy=gc;B.Zd();R.unshift({ja:function(){!p.noFSInit&&!B.Ga.hb&&B.Ga()}});Pa.push({ja:function(){B.vc=m}});Qa.push({ja:function(){B.Qd()}});p.FS_createFolder=B.hd;p.FS_createPath=B.ld;p.FS_createDataFile=B.xb;p.FS_createPreloadedFile=B.md;p.FS_createLazyFile=B.jd;p.FS_createLink=B.kd;p.FS_createDevice=B.X;bb=z.Ec(4);K[bb>>2]=0;R.unshift({ja:n()});Qa.push({ja:n()});var lb=new z.Da;t&&(require("fs"),process.platform.match(/^win/));R.push({ja:function(){Z.root=B.F(Z,{},k)}});
Eb.Cc=M([0],"i8",L);
p.requestFullScreen=function(a,b){function c(){Yb=m;var a=e.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===a?(e.cc=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||
n(),e.cc=e.cc.bind(document),$b&&e.Pb(),Yb=i,ac&&("undefined"!=typeof SDL&&(a=Ha[SDL.screen+0*z.ia>>2],K[SDL.screen+0*z.ia>>2]=a|8388608),ec())):(a.parentNode.insertBefore(e,a),a.parentNode.removeChild(a),ac&&("undefined"!=typeof SDL&&(a=Ha[SDL.screen+0*z.ia>>2],K[SDL.screen+0*z.ia>>2]=a&-8388609),ec()));if(p.onFullScreen)p.onFullScreen(Yb);fc(e)}$b=a;ac=b;"undefined"===typeof $b&&($b=i);"undefined"===typeof ac&&(ac=m);var e=p.canvas;Zb||(Zb=i,document.addEventListener("fullscreenchange",c,m),document.addEventListener("mozfullscreenchange",
c,m),document.addEventListener("webkitfullscreenchange",c,m),document.addEventListener("MSFullscreenChange",c,m));var f=document.createElement("div");e.parentNode.insertBefore(f,e);f.appendChild(e);f.Td=f.requestFullScreen||f.mozRequestFullScreen||f.msRequestFullscreen||(f.webkitRequestFullScreen?function(){f.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:k);f.Td()};p.requestAnimationFrame=function(a){Qb(a)};p.setCanvasSize=function(a,b,c){fc(p.canvas,a,b);c||ec()};
p.pauseMainLoop=function(){Nb=k;Tb++};p.resumeMainLoop=function(){Tb++;var a=Kb,b=Lb,c=Mb;Mb=k;Rb(c,0,m,Sb);Jb(a,b)};p.getUserMedia=function(){window.qc||(window.qc=navigator.getUserMedia||navigator.mozGetUserMedia);window.qc(g)};Ja=y=z.ub(D);Ka=Ja+Ma;La=E=z.ub(Ka);w(La<F,"TOTAL_MEMORY not big enough for stack");p.Xc={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};
p.Yc={abort:A,assert:w,min:va,invoke_viiiii:function(a,b,c,e,f,h){try{p.dynCall_viiiii(a,b,c,e,f,h)}catch(j){"number"!==typeof j&&"longjmp"!==j&&d(j),$.setThrew(1,0)}},_broadwayOnPictureDecoded:Hb,_puts:function(a){var b=K[pb>>2],a=Db(a,b);return 0>a?a:0>Eb(10,b)?-1:a+1},_fflush:n(),_fputc:Eb,_send:function(a,b,c){return!Z.wd(a)?(V(U.V),-1):Ab(a,b,c)},_pwrite:function(a,b,c,e){a=B.qa(a);if(!a)return V(U.V),-1;try{return B.write(a,I,b,c,e)}catch(f){return B.sc(f),-1}},_fputs:Db,_emscripten_set_main_loop:Rb,
_abort:function(){p.abort()},___setErrNo:V,_sbrk:Fb,_mkport:zb,_emscripten_set_main_loop_timing:Jb,_emscripten_memcpy_big:function(a,b,c){N.set(N.subarray(b,b+c),a);return a},_fileno:Cb,_broadwayOnHeadersDecoded:Ib,_write:Ab,_time:function(a){var b=Date.now()/1E3|0;a&&(K[a>>2]=b);return b},_sysconf:function(a){switch(a){case 30:return 4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 79:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;
case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;
case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1E3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"===typeof navigator?navigator.hardwareConcurrency||1:1}V(U.B);return-1},
___errno_location:function(){return bb},STACKTOP:y,STACK_MAX:Ka,tempDoublePtr:$a,ABORT:H,NaN:NaN,Infinity:Infinity};// EMSCRIPTEN_START_ASM
var $=(function(global,env,buffer) {
"use asm";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=0;var n=0;var o=0;var p=0;var q=+env.NaN,r=+env.Infinity;var s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0.0;var B=0;var C=0;var D=0;var E=0;var F=0;var G=0;var H=0;var I=0;var J=0;var K=0;var L=global.Math.floor;var M=global.Math.abs;var N=global.Math.sqrt;var O=global.Math.pow;var P=global.Math.cos;var Q=global.Math.sin;var R=global.Math.tan;var S=global.Math.acos;var T=global.Math.asin;var U=global.Math.atan;var V=global.Math.atan2;var W=global.Math.exp;var X=global.Math.log;var Y=global.Math.ceil;var Z=global.Math.imul;var _=env.abort;var $=env.assert;var aa=env.min;var ba=env.invoke_viiiii;var ca=env._broadwayOnPictureDecoded;var da=env._puts;var ea=env._fflush;var fa=env._fputc;var ga=env._send;var ha=env._pwrite;var ia=env._fputs;var ja=env._emscripten_set_main_loop;var ka=env._abort;var la=env.___setErrNo;var ma=env._sbrk;var na=env._mkport;var oa=env._emscripten_set_main_loop_timing;var pa=env._emscripten_memcpy_big;var qa=env._fileno;var ra=env._broadwayOnHeadersDecoded;var sa=env._write;var ta=env._time;var ua=env._sysconf;var va=env.___errno_location;var wa=0.0;
// EMSCRIPTEN_START_FUNCS
function ya(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+15&-16;return b|0}function za(){return i|0}function Aa(a){a=a|0;i=a}function Ba(a,b){a=a|0;b=b|0;if(!m){m=a;n=b}}function Ca(b){b=b|0;a[k>>0]=a[b>>0];a[k+1>>0]=a[b+1>>0];a[k+2>>0]=a[b+2>>0];a[k+3>>0]=a[b+3>>0]}function Da(b){b=b|0;a[k>>0]=a[b>>0];a[k+1>>0]=a[b+1>>0];a[k+2>>0]=a[b+2>>0];a[k+3>>0]=a[b+3>>0];a[k+4>>0]=a[b+4>>0];a[k+5>>0]=a[b+5>>0];a[k+6>>0]=a[b+6>>0];a[k+7>>0]=a[b+7>>0]}function Ea(a){a=a|0;B=a}function Fa(){return B|0}function Ga(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;g=i;h=d[8+b>>0]|0;j=d[64+b>>0]|0;b=c[120+(j*12|0)>>2]<<h;k=c[124+(j*12|0)>>2]<<h;l=c[128+(j*12|0)>>2]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>>0]|0)*12|0)>>2]|0;if(b>>>0>5){f=e<<(d[8+b>>0]|0)+-1;g=0}else{f=e;g=1}e=c[a>>2]|0;b=a+8|0;h=c[b>>2]|0;i=h+e|0;j=e-h|0;h=a+4|0;e=c[h>>2]|0;k=a+12|0;l=c[k>>2]|0;m=e-l|0;n=l+e|0;c[a>>2]=(Z(n+i|0,f)|0)>>g;c[h>>2]=(Z(i-n|0,f)|0)>>g;c[b>>2]=(Z(m+j|0,f)|0)>>g;c[k>>2]=(Z(j-m|0,f)|0)>>g;m=a+16|0;j=c[m>>2]|0;k=a+24|0;b=c[k>>2]|0;n=b+j|0;i=j-b|0;b=a+20|0;j=c[b>>2]|0;h=a+28|0;a=c[h>>2]|0;e=j-a|0;l=a+j|0;c[m>>2]=(Z(l+n|0,f)|0)>>g;c[b>>2]=(Z(n-l|0,f)|0)>>g;c[k>>2]=(Z(e+i|0,f)|0)>>g;c[h>>2]=(Z(i-e|0,f)|0)>>g;return}function Ja(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0,g=0;c=i;d=1<<b+-1;if(!(d&a)){e=d;f=0}else{g=0;i=c;return g|0}while(1){d=f+1|0;e=e>>>1;if(!((e|0)!=0&(e&a|0)==0)){g=d;break}else f=d}i=c;return g|0}function Ka(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=8-(c[a+8>>2]|0)|0;e=jb(a,d)|0;if((e|0)==-1){f=1;i=b;return f|0}f=(e|0)!=(c[400+(d+-1<<2)>>2]|0)&1;i=b;return f|0}function La(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;d=c[a+12>>2]<<3;e=c[a+16>>2]|0;f=d-e|0;if((d|0)==(e|0)){g=0;i=b;return g|0}if(f>>>0>8){g=1;i=b;return g|0}else{g=((kb(a)|0)>>>(32-f|0)|0)!=(1<<f+-1|0)&1;i=b;return g|0}return 0}function Ma(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;f=c[a+(d<<2)>>2]|0;g=d;do{g=g+1|0;if(g>>>0>=b>>>0)break}while((c[a+(g<<2)>>2]|0)!=(f|0));i=e;return ((g|0)==(b|0)?0:g)|0}function Na(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=c[a+4>>2]|0;e=(b>>>0)%(d>>>0)|0;f=b-e|0;b=Z(c[a+8>>2]|0,d)|0;d=c[a>>2]|0;c[a+12>>2]=d+((f<<8)+(e<<4));g=(e<<3)+(b<<8)+(f<<6)|0;c[a+16>>2]=d+g;c[a+20>>2]=d+(g+(b<<6));return}function Oa(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;if((c|0)<(a|0))d=a;else d=(c|0)>(b|0)?b:c;return d|0}function Pa(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;h=i;a:do if(((e>>>0>3?(a[b>>0]|0)==0:0)?(a[b+1>>0]|0)==0:0)?(j=a[b+2>>0]|0,(j&255)<2):0){b:do if((e|0)!=3){k=-3;l=j;m=3;n=b+3|0;o=2;while(1){if(l<<24>>24)if(l<<24>>24==1&o>>>0>1){p=m;q=0;r=0;s=n;t=0;break}else u=0;else u=o+1|0;v=m+1|0;if((v|0)==(e|0))break b;k=~m;l=a[n>>0]|0;m=v;n=n+1|0;o=u}while(1){o=a[s>>0]|0;n=p+1|0;l=o<<24>>24!=0;w=(l&1^1)+t|0;q=o<<24>>24==3&(w|0)==2?1:q;if(o<<24>>24==1&w>>>0>1){x=14;break}if(l){y=w>>>0>2?1:r;z=0}else{y=r;z=w}if((n|0)==(e|0)){x=18;break}else{p=n;r=y;s=s+1|0;t=z}}if((x|0)==14){n=k+p-w|0;c[f+12>>2]=n;A=n;B=q;C=m;D=r;E=w-(w>>>0<3?w:3)|0;break a}else if((x|0)==18){n=k+e-z|0;c[f+12>>2]=n;A=n;B=q;C=m;D=y;E=z;break a}}while(0);c[g>>2]=e;F=1;i=h;return F|0}else x=19;while(0);if((x|0)==19){c[f+12>>2]=e;A=e;B=1;C=0;D=0;E=0}e=b+C|0;c[f>>2]=e;c[f+4>>2]=e;c[f+8>>2]=0;c[f+16>>2]=0;b=f+12|0;c[g>>2]=E+C+A;if(D){F=1;i=h;return F|0}if(!B){F=0;i=h;return F|0}B=c[b>>2]|0;D=e;A=e;e=0;c:while(1){C=B;G=D;E=e;while(1){g=C;C=C+-1|0;if(!g){x=31;break c}H=a[G>>0]|0;if((E|0)!=2){I=E;break}if(H<<24>>24!=3){x=29;break}if(!C){F=1;x=32;break c}g=G+1|0;if((d[g>>0]|0)>3){F=1;x=32;break c}else{G=g;E=0}}if((x|0)==29){x=0;if((H&255)<3){F=1;x=32;break}else I=2}a[A>>0]=H;B=C;D=G+1|0;A=A+1|0;e=H<<24>>24==0?I+1|0:0}if((x|0)==31){c[b>>2]=A-G+(c[b>>2]|0);F=0;i=h;return F|0}else if((x|0)==32){i=h;return F|0}return 0}function Qa(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;d=i;i=i+16|0;e=d;ld(b,0,92);f=jb(a,8)|0;a:do if((((f|0)!=-1?(c[b>>2]=f,jb(a,1)|0,jb(a,1)|0,(jb(a,1)|0)!=-1):0)?(jb(a,5)|0)!=-1:0)?(g=jb(a,8)|0,(g|0)!=-1):0){h=b+4|0;c[h>>2]=g;g=b+8|0;j=nb(a,g)|0;if(!j)if((c[g>>2]|0)>>>0<=31){g=nb(a,e)|0;if(!g){k=c[e>>2]|0;if(k>>>0<=12){c[b+12>>2]=1<<k+4;k=nb(a,e)|0;if(!k){l=c[e>>2]|0;if(l>>>0<=2){c[b+16>>2]=l;b:do if(!l){m=nb(a,e)|0;if(m){n=m;break a}m=c[e>>2]|0;if(m>>>0>12){n=1;break a}c[b+20>>2]=1<<m+4}else if((l|0)==1){m=jb(a,1)|0;if((m|0)==-1){n=1;break a}c[b+24>>2]=(m|0)==1&1;m=ob(a,b+28|0)|0;if(m){n=m;break a}m=ob(a,b+32|0)|0;if(m){n=m;break a}m=b+36|0;o=nb(a,m)|0;if(o){n=o;break a}o=c[m>>2]|0;if(o>>>0>255){n=1;break a}if(!o){c[b+40>>2]=0;break}p=id(o<<2)|0;o=b+40|0;c[o>>2]=p;if(!p){n=65535;break a}if(c[m>>2]|0){q=p;p=0;while(1){r=ob(a,q+(p<<2)|0)|0;s=p+1|0;if(r){n=r;break a}if(s>>>0>=(c[m>>2]|0)>>>0)break b;q=c[o>>2]|0;p=s}}}while(0);l=b+44|0;p=nb(a,l)|0;if(!p)if((c[l>>2]|0)>>>0<=16?(o=jb(a,1)|0,(o|0)!=-1):0){c[b+48>>2]=(o|0)==1&1;o=nb(a,e)|0;if(!o){q=b+52|0;c[q>>2]=(c[e>>2]|0)+1;m=nb(a,e)|0;if(!m){s=b+56|0;c[s>>2]=(c[e>>2]|0)+1;r=jb(a,1)|0;if((!((r|0)==0|(r|0)==-1)?(jb(a,1)|0)!=-1:0)?(r=jb(a,1)|0,(r|0)!=-1):0){t=(r|0)==1;c[b+60>>2]=t&1;if(t){t=b+64|0;r=nb(a,t)|0;if(r){n=r;break}r=b+68|0;u=nb(a,r)|0;if(u){n=u;break}u=b+72|0;v=nb(a,u)|0;if(v){n=v;break}v=b+76|0;w=nb(a,v)|0;if(w){n=w;break}w=c[q>>2]|0;if((c[t>>2]|0)>((w<<3)+~c[r>>2]|0)){n=1;break}r=c[s>>2]|0;if((c[u>>2]|0)>((r<<3)+~c[v>>2]|0)){n=1;break}else{x=w;y=r}}else{x=c[q>>2]|0;y=c[s>>2]|0}s=Z(y,x)|0;do switch(c[h>>2]|0){case 11:{z=396;A=345600;B=58;break}case 12:{z=396;A=912384;B=58;break}case 13:{z=396;A=912384;B=58;break}case 20:{z=396;A=912384;B=58;break}case 21:{z=792;A=1824768;B=58;break}case 22:{z=1620;A=3110400;B=58;break}case 30:{z=1620;A=3110400;B=58;break}case 31:{z=3600;A=6912e3;B=58;break}case 32:{z=5120;A=7864320;B=58;break}case 40:{z=8192;A=12582912;B=58;break}case 41:{z=8192;A=12582912;B=58;break}case 42:{z=8704;A=13369344;B=58;break}case 50:{z=22080;A=42393600;B=58;break}case 51:{z=36864;A=70778880;B=58;break}case 10:{z=99;A=152064;B=58;break}default:B=60}while(0);do if((B|0)==58){if(z>>>0<s>>>0){B=60;break}h=(A>>>0)/((s*384|0)>>>0)|0;q=h>>>0<16?h:16;c[e>>2]=q;h=c[l>>2]|0;if(h>>>0>q>>>0){C=h;B=61}else D=q}while(0);if((B|0)==60){c[e>>2]=2147483647;C=c[l>>2]|0;B=61}if((B|0)==61){c[e>>2]=C;D=C}s=b+88|0;c[s>>2]=D;q=jb(a,1)|0;if((q|0)==-1){n=1;break}h=(q|0)==1;c[b+80>>2]=h&1;do if(h){q=id(952)|0;r=b+84|0;c[r>>2]=q;if(!q){n=65535;break a}w=Hc(a,q)|0;if(w){n=w;break a}w=c[r>>2]|0;if(!(c[w+920>>2]|0))break;r=c[w+948>>2]|0;if((c[w+944>>2]|0)>>>0>r>>>0){n=1;break a}if(r>>>0<(c[l>>2]|0)>>>0){n=1;break a}if(r>>>0>(c[s>>2]|0)>>>0){n=1;break a}c[s>>2]=(r|0)==0?1:r}while(0);Ka(a)|0;n=0}else n=1}else n=m}else n=o}else n=1;else n=p}else n=1}else n=k}else n=1}else n=g}else n=1;else n=j}else n=1;while(0);i=d;return n|0}function Ra(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;a:do if((((((((((c[a>>2]|0)==(c[b>>2]|0)?(c[a+4>>2]|0)==(c[b+4>>2]|0):0)?(c[a+12>>2]|0)==(c[b+12>>2]|0):0)?(e=c[a+16>>2]|0,(e|0)==(c[b+16>>2]|0)):0)?(c[a+44>>2]|0)==(c[b+44>>2]|0):0)?(c[a+48>>2]|0)==(c[b+48>>2]|0):0)?(c[a+52>>2]|0)==(c[b+52>>2]|0):0)?(c[a+56>>2]|0)==(c[b+56>>2]|0):0)?(f=c[a+60>>2]|0,(f|0)==(c[b+60>>2]|0)):0)?(c[a+80>>2]|0)==(c[b+80>>2]|0):0){if(!e){if((c[a+20>>2]|0)!=(c[b+20>>2]|0)){g=1;break}}else if((e|0)==1){if((c[a+24>>2]|0)!=(c[b+24>>2]|0)){g=1;break}if((c[a+28>>2]|0)!=(c[b+28>>2]|0)){g=1;break}if((c[a+32>>2]|0)!=(c[b+32>>2]|0)){g=1;break}e=c[a+36>>2]|0;if((e|0)!=(c[b+36>>2]|0)){g=1;break}if(e){h=c[a+40>>2]|0;j=c[b+40>>2]|0;k=0;do{if((c[h+(k<<2)>>2]|0)!=(c[j+(k<<2)>>2]|0)){g=1;break a}k=k+1|0}while(k>>>0<e>>>0)}}if(f){if((c[a+64>>2]|0)!=(c[b+64>>2]|0)){g=1;break}if((c[a+68>>2]|0)!=(c[b+68>>2]|0)){g=1;break}if((c[a+72>>2]|0)!=(c[b+72>>2]|0)){g=1;break}if((c[a+76>>2]|0)!=(c[b+76>>2]|0)){g=1;break}}g=0}else g=1;while(0);i=d;return g|0}function Sa(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;d=i;i=i+16|0;e=d+4|0;f=d;ld(b,0,72);g=nb(a,b)|0;a:do if(!g)if((c[b>>2]|0)>>>0<=255){h=b+4|0;j=nb(a,h)|0;if(!j)if(((c[h>>2]|0)>>>0<=31?(jb(a,1)|0)==0:0)?(h=jb(a,1)|0,(h|0)!=-1):0){c[b+8>>2]=(h|0)==1&1;h=nb(a,e)|0;if(!h){k=(c[e>>2]|0)+1|0;l=b+12|0;c[l>>2]=k;if(k>>>0<=8){b:do if(k>>>0>1){m=b+16|0;n=nb(a,m)|0;if(n){o=n;break a}n=c[m>>2]|0;if(n>>>0>6){o=1;break a}switch(n|0){case 0:{n=id(c[l>>2]<<2)|0;m=b+20|0;c[m>>2]=n;if(!n){o=65535;break a}if(!(c[l>>2]|0))break b;else p=0;do{n=nb(a,e)|0;if(n){o=n;break a}c[(c[m>>2]|0)+(p<<2)>>2]=(c[e>>2]|0)+1;p=p+1|0}while(p>>>0<(c[l>>2]|0)>>>0);break}case 5:case 4:case 3:{m=jb(a,1)|0;if((m|0)==-1){o=1;break a}c[b+32>>2]=(m|0)==1&1;m=nb(a,e)|0;if(m){o=m;break a}c[b+36>>2]=(c[e>>2]|0)+1;break b;break}case 6:{m=nb(a,e)|0;if(m){o=m;break a}m=(c[e>>2]|0)+1|0;n=b+40|0;c[n>>2]=m;q=id(m<<2)|0;m=b+44|0;c[m>>2]=q;if(!q){o=65535;break a}q=c[432+((c[l>>2]|0)+-1<<2)>>2]|0;if(!(c[n>>2]|0))break b;else r=0;do{s=jb(a,q)|0;c[(c[m>>2]|0)+(r<<2)>>2]=s;r=r+1|0;if(s>>>0>=(c[l>>2]|0)>>>0){o=1;break a}}while(r>>>0<(c[n>>2]|0)>>>0);break}case 2:{n=b+24|0;c[n>>2]=id((c[l>>2]<<2)+-4|0)|0;m=id((c[l>>2]<<2)+-4|0)|0;q=b+28|0;c[q>>2]=m;if((c[n>>2]|0)==0|(m|0)==0){o=65535;break a}if((c[l>>2]|0)==1)break b;else t=0;do{m=nb(a,e)|0;if(m){o=m;break a}c[(c[n>>2]|0)+(t<<2)>>2]=c[e>>2];m=nb(a,e)|0;if(m){o=m;break a}c[(c[q>>2]|0)+(t<<2)>>2]=c[e>>2];t=t+1|0}while(t>>>0<((c[l>>2]|0)+-1|0)>>>0);break}default:break b}}while(0);l=nb(a,e)|0;if(!l){k=c[e>>2]|0;if(k>>>0<=31){c[b+48>>2]=k+1;k=nb(a,e)|0;if(!k)if(((c[e>>2]|0)>>>0<=31?(jb(a,1)|0)==0:0)?(jb(a,2)|0)>>>0<=2:0){q=ob(a,f)|0;if(!q){n=(c[f>>2]|0)+26|0;if(n>>>0<=51){c[b+52>>2]=n;n=ob(a,f)|0;if(!n)if(((c[f>>2]|0)+26|0)>>>0>51)o=1;else{m=ob(a,f)|0;if(m){o=m;break}m=c[f>>2]|0;if((m+12|0)>>>0>24){o=1;break}c[b+56>>2]=m;m=jb(a,1)|0;if((m|0)==-1){o=1;break}c[b+60>>2]=(m|0)==1&1;m=jb(a,1)|0;if((m|0)==-1){o=1;break}c[b+64>>2]=(m|0)==1&1;m=jb(a,1)|0;if((m|0)==-1){o=1;break}c[b+68>>2]=(m|0)==1&1;Ka(a)|0;o=0}else o=n}else o=1}else o=q}else o=1;else o=k}else o=1}else o=l}else o=1}else o=h}else o=1;else o=j}else o=1;else o=g;while(0);i=d;return o|0}function Ta(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;g=i;i=i+32|0;h=g+20|0;j=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;n=g;ld(b,0,988);o=Z(c[d+56>>2]|0,c[d+52>>2]|0)|0;p=nb(a,m)|0;if(p){q=p;i=g;return q|0}p=c[m>>2]|0;c[b>>2]=p;if(p>>>0>=o>>>0){q=1;i=g;return q|0}p=nb(a,m)|0;if(p){q=p;i=g;return q|0}p=c[m>>2]|0;r=b+4|0;c[r>>2]=p;if((p|0)==5|(p|0)==0)s=5;else if(!((p|0)==7|(p|0)==2)){q=1;i=g;return q|0}if((s|0)==5){if((c[f>>2]|0)==5){q=1;i=g;return q|0}if(!(c[d+44>>2]|0)){q=1;i=g;return q|0}}p=nb(a,m)|0;if(p){q=p;i=g;return q|0}p=c[m>>2]|0;c[b+8>>2]=p;if((p|0)!=(c[e>>2]|0)){q=1;i=g;return q|0}p=d+12|0;t=c[p>>2]|0;u=0;while(1)if(!(t>>>u))break;else u=u+1|0;t=jb(a,u+-1|0)|0;if((t|0)==-1){q=1;i=g;return q|0}u=(c[f>>2]|0)==5;if(u&(t|0)!=0){q=1;i=g;return q|0}c[b+12>>2]=t;if(u){u=nb(a,m)|0;if(u){q=u;i=g;return q|0}u=c[m>>2]|0;c[b+16>>2]=u;if(u>>>0>65535){q=1;i=g;return q|0}}u=d+16|0;t=c[u>>2]|0;if(!t){v=d+20|0;w=c[v>>2]|0;x=0;while(1)if(!(w>>>x))break;else x=x+1|0;w=jb(a,x+-1|0)|0;if((w|0)==-1){q=1;i=g;return q|0}x=b+20|0;c[x>>2]=w;do if(c[e+8>>2]|0){w=ob(a,n)|0;if(!w){c[b+24>>2]=c[n>>2];break}else{q=w;i=g;return q|0}}while(0);if((c[f>>2]|0)==5){w=c[x>>2]|0;if(w>>>0>(c[v>>2]|0)>>>1>>>0){q=1;i=g;return q|0}v=c[b+24>>2]|0;if((w|0)!=(((v|0)>0?0:0-v|0)|0)){q=1;i=g;return q|0}}y=c[u>>2]|0}else y=t;if((y|0)==1?(c[d+24>>2]|0)==0:0){y=ob(a,n)|0;if(y){q=y;i=g;return q|0}y=b+28|0;c[y>>2]=c[n>>2];do if(c[e+8>>2]|0){t=ob(a,n)|0;if(!t){c[b+32>>2]=c[n>>2];break}else{q=t;i=g;return q|0}}while(0);if((c[f>>2]|0)==5?(t=c[y>>2]|0,y=(c[d+32>>2]|0)+t+(c[b+32>>2]|0)|0,(((t|0)<(y|0)?t:y)|0)!=0):0){q=1;i=g;return q|0}}if(c[e+68>>2]|0){y=nb(a,m)|0;if(y){q=y;i=g;return q|0}y=c[m>>2]|0;c[b+36>>2]=y;if(y>>>0>127){q=1;i=g;return q|0}}y=c[r>>2]|0;if((y|0)==5|(y|0)==0){t=jb(a,1)|0;if((t|0)==-1){q=1;i=g;return q|0}c[b+40>>2]=t;do if(!t){u=c[e+48>>2]|0;if(u>>>0>16){q=1;i=g;return q|0}else{c[b+44>>2]=u;break}}else{u=nb(a,m)|0;if(u){q=u;i=g;return q|0}u=c[m>>2]|0;if(u>>>0>15){q=1;i=g;return q|0}else{c[b+44>>2]=u+1;break}}while(0);z=c[r>>2]|0}else z=y;do if((z|0)==5|(z|0)==0){y=c[b+44>>2]|0;r=c[p>>2]|0;t=jb(a,1)|0;if((t|0)==-1){q=1;i=g;return q|0}c[b+68>>2]=t;if(t){t=0;a:while(1){if(t>>>0>y>>>0){q=1;s=110;break}u=nb(a,l)|0;if(u){q=u;s=110;break}u=c[l>>2]|0;if(u>>>0>3){q=1;s=110;break}c[b+(t*12|0)+72>>2]=u;do if(u>>>0<2){v=nb(a,k)|0;if(v){q=v;s=110;break a}v=c[k>>2]|0;if(v>>>0>=r>>>0){q=1;s=110;break a}c[b+(t*12|0)+76>>2]=v+1}else{if((u|0)!=2)break;v=nb(a,k)|0;if(v){q=v;s=110;break a}c[b+(t*12|0)+80>>2]=c[k>>2]}while(0);if((c[l>>2]|0)==3){s=61;break}else t=t+1|0}if((s|0)==61){if(!t)q=1;else break;i=g;return q|0}else if((s|0)==110){i=g;return q|0}}}while(0);do if(c[f+4>>2]|0){l=c[d+44>>2]|0;k=(c[f>>2]|0)==5;p=jb(a,1)|0;z=(p|0)==-1;if(k){if(z){q=1;i=g;return q|0}c[b+276>>2]=p;k=jb(a,1)|0;if((k|0)==-1){q=1;i=g;return q|0}c[b+280>>2]=k;if((l|0)!=0|(k|0)==0)break;else q=1;i=g;return q|0}if(z){q=1;i=g;return q|0}c[b+284>>2]=p;if(p){p=(l<<1)+2|0;z=0;k=0;r=0;y=0;u=0;while(1){if(z>>>0>p>>>0){q=1;s=110;break}v=nb(a,j)|0;if(v){q=v;s=110;break}v=c[j>>2]|0;if(v>>>0>6){q=1;s=110;break}c[b+(z*20|0)+288>>2]=v;if((v&-3|0)==1){w=nb(a,h)|0;if(w){q=w;s=110;break}c[b+(z*20|0)+292>>2]=(c[h>>2]|0)+1;A=c[j>>2]|0}else A=v;if((A|0)==2){v=nb(a,h)|0;if(v){q=v;s=110;break}c[b+(z*20|0)+296>>2]=c[h>>2];B=c[j>>2]|0}else B=A;if((B|0)==3|(B|0)==6){v=nb(a,h)|0;if(v){q=v;s=110;break}c[b+(z*20|0)+300>>2]=c[h>>2];C=c[j>>2]|0}else C=B;if((C|0)==4){v=nb(a,h)|0;if(v){q=v;s=110;break}v=c[h>>2]|0;if(v>>>0>l>>>0){q=1;s=110;break}if(!v)c[b+(z*20|0)+304>>2]=65535;else c[b+(z*20|0)+304>>2]=v+-1;D=c[j>>2]|0;E=r+1|0}else{D=C;E=r}y=((D|0)==5&1)+y|0;k=((D|0)!=0&D>>>0<4&1)+k|0;u=((D|0)==6&1)+u|0;if(!D){s=90;break}else{z=z+1|0;r=E}}if((s|0)==90){if(E>>>0>1|y>>>0>1|u>>>0>1){q=1;i=g;return q|0}if((k|0)!=0&(y|0)!=0)q=1;else break;i=g;return q|0}else if((s|0)==110){i=g;return q|0}}}while(0);s=ob(a,n)|0;if(s){q=s;i=g;return q|0}s=c[n>>2]|0;c[b+48>>2]=s;E=s+(c[e+52>>2]|0)|0;c[n>>2]=E;if(E>>>0>51){q=1;i=g;return q|0}do if(c[e+60>>2]|0){E=nb(a,m)|0;if(E){q=E;i=g;return q|0}E=c[m>>2]|0;c[b+52>>2]=E;if(E>>>0>2){q=1;i=g;return q|0}if((E|0)==1)break;E=ob(a,n)|0;if(E){q=E;i=g;return q|0}E=c[n>>2]|0;if((E+6|0)>>>0>12){q=1;i=g;return q|0}c[b+56>>2]=E<<1;E=ob(a,n)|0;if(E){q=E;i=g;return q|0}E=c[n>>2]|0;if((E+6|0)>>>0>12){q=1;i=g;return q|0}else{c[b+60>>2]=E<<1;break}}while(0);do if((c[e+12>>2]|0)>>>0>1?((c[e+16>>2]|0)+-3|0)>>>0<3:0){n=e+36|0;E=c[n>>2]|0;s=(((o>>>0)%(E>>>0)|0|0)==0?1:2)+((o>>>0)/(E>>>0)|0)|0;E=0;while(1){F=E+1|0;if(!(-1<<F&s))break;else E=F}y=jb(a,((1<<E)+-1&s|0)==0?E:F)|0;c[m>>2]=y;if((y|0)==-1){q=1;i=g;return q|0}c[b+64>>2]=y;k=c[n>>2]|0;if(y>>>0>(((o+-1+k|0)>>>0)/(k>>>0)|0)>>>0)q=1;else break;i=g;return q|0}while(0);q=0;i=g;return q|0}function Ua(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+32|0;e=d+20|0;f=d;c[f+0>>2]=c[a+0>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];c[f+16>>2]=c[a+16>>2];a=nb(f,e)|0;if(a){g=a;i=d;return g|0}a=nb(f,e)|0;if(a){g=a;i=d;return g|0}a=nb(f,e)|0;if(a){g=a;i=d;return g|0}a=c[e>>2]|0;if(a>>>0>255){g=1;i=d;return g|0}c[b>>2]=a;g=0;i=d;return g|0}function Va(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+32|0;f=e+20|0;g=e;c[g+0>>2]=c[a+0>>2];c[g+4>>2]=c[a+4>>2];c[g+8>>2]=c[a+8>>2];c[g+12>>2]=c[a+12>>2];c[g+16>>2]=c[a+16>>2];a=nb(g,f)|0;if(a){h=a;i=e;return h|0}a=nb(g,f)|0;if(a){h=a;i=e;return h|0}a=nb(g,f)|0;if(!a)j=0;else{h=a;i=e;return h|0}while(1)if(!(b>>>j))break;else j=j+1|0;b=jb(g,j+-1|0)|0;if((b|0)==-1){h=1;i=e;return h|0}c[d>>2]=b;h=0;i=e;return h|0}function Wa(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+32|0;g=f+20|0;h=f;if((d|0)!=5){j=1;i=f;return j|0};c[h+0>>2]=c[a+0>>2];c[h+4>>2]=c[a+4>>2];c[h+8>>2]=c[a+8>>2];c[h+12>>2]=c[a+12>>2];c[h+16>>2]=c[a+16>>2];a=nb(h,g)|0;if(a){j=a;i=f;return j|0}a=nb(h,g)|0;if(a){j=a;i=f;return j|0}a=nb(h,g)|0;if(!a)k=0;else{j=a;i=f;return j|0}while(1)if(!(b>>>k))break;else k=k+1|0;if((jb(h,k+-1|0)|0)==-1){j=1;i=f;return j|0}j=nb(h,e)|0;i=f;return j|0}function Xa(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+32|0;g=f+20|0;h=f;c[h+0>>2]=c[a+0>>2];c[h+4>>2]=c[a+4>>2];c[h+8>>2]=c[a+8>>2];c[h+12>>2]=c[a+12>>2];c[h+16>>2]=c[a+16>>2];a=nb(h,g)|0;if(a){j=a;i=f;return j|0}a=nb(h,g)|0;if(a){j=a;i=f;return j|0}a=nb(h,g)|0;if(a){j=a;i=f;return j|0}a=c[b+12>>2]|0;k=0;while(1)if(!(a>>>k))break;else k=k+1|0;if((jb(h,k+-1|0)|0)==-1){j=1;i=f;return j|0}if((d|0)==5?(d=nb(h,g)|0,(d|0)!=0):0){j=d;i=f;return j|0}d=c[b+20>>2]|0;b=0;while(1)if(!(d>>>b))break;else b=b+1|0;d=jb(h,b+-1|0)|0;if((d|0)==-1){j=1;i=f;return j|0}c[e>>2]=d;j=0;i=f;return j|0}function Ya(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+32|0;g=f+20|0;h=f;c[h+0>>2]=c[a+0>>2];c[h+4>>2]=c[a+4>>2];c[h+8>>2]=c[a+8>>2];c[h+12>>2]=c[a+12>>2];c[h+16>>2]=c[a+16>>2];a=nb(h,g)|0;if(a){j=a;i=f;return j|0}a=nb(h,g)|0;if(a){j=a;i=f;return j|0}a=nb(h,g)|0;if(a){j=a;i=f;return j|0}a=c[b+12>>2]|0;k=0;while(1)if(!(a>>>k))break;else k=k+1|0;if((jb(h,k+-1|0)|0)==-1){j=1;i=f;return j|0}if((d|0)==5?(d=nb(h,g)|0,(d|0)!=0):0){j=d;i=f;return j|0}d=c[b+20>>2]|0;b=0;while(1)if(!(d>>>b))break;else b=b+1|0;if((jb(h,b+-1|0)|0)==-1){j=1;i=f;return j|0}j=ob(h,e)|0;i=f;return j|0}function Za(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;g=i;i=i+32|0;h=g+20|0;j=g;c[j+0>>2]=c[a+0>>2];c[j+4>>2]=c[a+4>>2];c[j+8>>2]=c[a+8>>2];c[j+12>>2]=c[a+12>>2];c[j+16>>2]=c[a+16>>2];a=nb(j,h)|0;if(a){k=a;i=g;return k|0}a=nb(j,h)|0;if(a){k=a;i=g;return k|0}a=nb(j,h)|0;if(a){k=a;i=g;return k|0}a=c[b+12>>2]|0;b=0;while(1)if(!(a>>>b))break;else b=b+1|0;if((jb(j,b+-1|0)|0)==-1){k=1;i=g;return k|0}if((d|0)==5?(d=nb(j,h)|0,(d|0)!=0):0){k=d;i=g;return k|0}d=ob(j,f)|0;if(d){k=d;i=g;return k|0}if((e|0)!=0?(e=ob(j,f+4|0)|0,(e|0)!=0):0){k=e;i=g;return k|0}k=0;i=g;return k|0}function _a(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;g=f+24|0;h=f+20|0;j=f;c[j+0>>2]=c[b+0>>2];c[j+4>>2]=c[b+4>>2];c[j+8>>2]=c[b+8>>2];c[j+12>>2]=c[b+12>>2];c[j+16>>2]=c[b+16>>2];b=nb(j,g)|0;if(b){k=b;i=f;return k|0}b=nb(j,g)|0;if(b){k=b;i=f;return k|0}b=nb(j,g)|0;if(b){k=b;i=f;return k|0}b=c[d+12>>2]|0;l=0;while(1)if(!(b>>>l))break;else l=l+1|0;if((jb(j,l+-1|0)|0)==-1){k=1;i=f;return k|0}l=nb(j,g)|0;if(l){k=l;i=f;return k|0}l=d+16|0;b=c[l>>2]|0;if(!b){m=c[d+20>>2]|0;n=0;while(1)if(!(m>>>n))break;else n=n+1|0;if((jb(j,n+-1|0)|0)==-1){k=1;i=f;return k|0}if((c[e+8>>2]|0)!=0?(n=ob(j,h)|0,(n|0)!=0):0){k=n;i=f;return k|0}o=c[l>>2]|0}else o=b;if((o|0)==1?(c[d+24>>2]|0)==0:0){d=ob(j,h)|0;if(d){k=d;i=f;return k|0}if((c[e+8>>2]|0)!=0?(d=ob(j,h)|0,(d|0)!=0):0){k=d;i=f;return k|0}}if((c[e+68>>2]|0)!=0?(e=nb(j,g)|0,(e|0)!=0):0){k=e;i=f;return k|0}e=jb(j,1)|0;c[a>>2]=e;k=(e|0)==-1&1;i=f;return k|0}function $a(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;f=i;i=i+448|0;g=f+8|0;h=f+4|0;j=f;k=g+(0-g&15)|0;g=c[b+3376>>2]|0;l=c[e>>2]|0;c[h>>2]=0;m=b+1192|0;c[m>>2]=(c[m>>2]|0)+1;n=b+1200|0;c[n>>2]=0;o=b+12|0;c[j>>2]=(c[e+48>>2]|0)+(c[(c[o>>2]|0)+52>>2]|0);p=e+36|0;q=b+1212|0;r=e+52|0;s=e+56|0;t=e+60|0;u=e+4|0;v=e+44|0;e=b+1220|0;w=b+1172|0;x=b+1176|0;y=g+12|0;z=l;l=0;A=0;while(1){B=c[q>>2]|0;if((c[p>>2]|0)==0?(c[B+(z*216|0)+196>>2]|0)!=0:0){C=1;D=22;break}E=c[(c[o>>2]|0)+56>>2]|0;F=c[r>>2]|0;G=c[s>>2]|0;H=c[t>>2]|0;c[B+(z*216|0)+4>>2]=c[m>>2];c[B+(z*216|0)+8>>2]=F;c[B+(z*216|0)+12>>2]=G;c[B+(z*216|0)+16>>2]=H;c[B+(z*216|0)+24>>2]=E;E=c[u>>2]|0;if((E|0)!=2?!((E|0)==7|(A|0)!=0):0){E=nb(a,h)|0;if(E){C=E;D=22;break}E=c[h>>2]|0;if(E>>>0>((c[x>>2]|0)-z|0)>>>0){C=1;D=22;break}if(!E)I=0;else{ld(y,0,164);c[g>>2]=0;I=1}}else I=A;E=c[h>>2]|0;if(!E){B=bb(a,g,(c[q>>2]|0)+(z*216|0)|0,c[u>>2]|0,c[v>>2]|0)|0;if(!B)J=0;else{C=B;D=22;break}}else{c[h>>2]=E+-1;J=I}E=gb((c[q>>2]|0)+(z*216|0)|0,g,d,e,j,z,c[(c[o>>2]|0)+64>>2]|0,k)|0;if(E){C=E;D=22;break}l=((c[(c[q>>2]|0)+(z*216|0)+196>>2]|0)==1&1)+l|0;if(!(La(a)|0))K=(c[h>>2]|0)!=0;else K=1;E=c[u>>2]|0;if((E|0)==7|(E|0)==2)c[n>>2]=z;z=Ma(c[w>>2]|0,c[x>>2]|0,z)|0;if(!((z|0)!=0|K^1)){C=1;D=22;break}if(!K){D=20;break}else A=J}if((D|0)==20){J=b+1196|0;b=(c[J>>2]|0)+l|0;if(b>>>0>(c[x>>2]|0)>>>0){C=1;i=f;return C|0}c[J>>2]=b;C=0;i=f;return C|0}else if((D|0)==22){i=f;return C|0}return 0}function ab(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;d=i;e=c[a+1192>>2]|0;f=c[a+1200>>2]|0;g=a+1212|0;a:do if(!f)h=b;else{j=a+16|0;k=f;l=0;while(1){m=k;do{m=m+-1|0;if(m>>>0<=b>>>0){h=m;break a}}while((c[(c[g>>2]|0)+(m*216|0)+4>>2]|0)!=(e|0));l=l+1|0;n=c[(c[j>>2]|0)+52>>2]|0;if(l>>>0>=(n>>>0>10?n:10)>>>0){h=m;break}else k=m}}while(0);b=a+1172|0;f=a+1176|0;a=h;while(1){h=c[g>>2]|0;if((c[h+(a*216|0)+4>>2]|0)!=(e|0)){o=11;break}k=h+(a*216|0)+196|0;h=c[k>>2]|0;if(!h){o=11;break}c[k>>2]=h+-1;a=Ma(c[b>>2]|0,c[f>>2]|0,a)|0;if(!a){o=11;break}}if((o|0)==11){i=d;return}}function bb(a,d,e,f,g){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0;h=i;i=i+32|0;j=h+20|0;k=h+16|0;l=h+12|0;m=h+8|0;n=h+4|0;o=h;ld(d,0,2088);p=nb(a,n)|0;q=c[n>>2]|0;do if((f|0)==2|(f|0)==7){r=q+6|0;if(r>>>0>31|(p|0)!=0){s=1;i=h;return s|0}else{c[d>>2]=r;t=r;break}}else{r=q+1|0;if(r>>>0>31|(p|0)!=0){s=1;i=h;return s|0}else{c[d>>2]=r;t=r;break}}while(0);a:do if((t|0)!=31){b:do if(t>>>0>=6){p=(t|0)!=6;q=p&1;if((q|0)==1)u=52;else if(!q){c[k>>2]=0;f=0;while(1){r=kb(a)|0;c[j>>2]=r;v=r>>>31;c[d+(f<<2)+12>>2]=v;if(!v){c[d+(f<<2)+76>>2]=r>>>28&7;w=r<<4;x=1}else{w=r<<1;x=0}r=f|1;v=w>>>31;c[d+(r<<2)+12>>2]=v;if(!v){c[d+(r<<2)+76>>2]=w>>>28&7;y=w<<4;z=x+1|0}else{y=w<<1;z=x}v=r+1|0;r=y>>>31;c[d+(v<<2)+12>>2]=r;if(!r){c[d+(v<<2)+76>>2]=y>>>28&7;A=y<<4;B=z+1|0}else{A=y<<1;B=z}v=f|3;r=A>>>31;c[d+(v<<2)+12>>2]=r;if(!r){c[d+(v<<2)+76>>2]=A>>>28&7;C=A<<4;D=B+1|0}else{C=A<<1;D=B}r=v+1|0;E=C>>>31;c[d+(r<<2)+12>>2]=E;if(!E){c[d+(r<<2)+76>>2]=C>>>28&7;F=C<<4;G=D+1|0}else{F=C<<1;G=D}r=v+2|0;E=F>>>31;c[d+(r<<2)+12>>2]=E;if(!E){c[d+(r<<2)+76>>2]=F>>>28&7;H=F<<4;I=G+1|0}else{H=F<<1;I=G}r=v+3|0;v=H>>>31;c[d+(r<<2)+12>>2]=v;if(!v){c[d+(r<<2)+76>>2]=H>>>28&7;J=H<<4;K=I+1|0}else{J=H<<1;K=I}r=f|7;v=J>>>31;c[d+(r<<2)+12>>2]=v;if(!v){c[d+(r<<2)+76>>2]=J>>>28&7;L=J<<4;M=K+1|0}else{L=J<<1;M=K}c[j>>2]=L;if((lb(a,(M*3|0)+8|0)|0)==-1){N=1;O=k;P=j;u=68;break b}r=(c[k>>2]|0)+1|0;c[k>>2]=r;if((r|0)<2)f=f+8|0;else{u=52;break}}}if((u|0)==52){f=(nb(a,j)|0)!=0;r=c[j>>2]|0;if(f|r>>>0>3){N=1;O=k;P=j;u=68;break}c[d+140>>2]=r}if(p){r=c[d>>2]|0;f=r+-7|0;v=f>>>2;c[d+4>>2]=(f>>>0>11?v+268435453|0:v)<<4|(r>>>0>18?15:0)}else{Q=q;u=70}}else{if((t|0)==0|(t|0)==1){R=k;S=j}else if(!((t|0)==3|(t|0)==2)){r=0;do{v=(nb(a,l)|0)!=0;f=c[l>>2]|0;if(v|f>>>0>3){s=1;u=95;break}c[d+(r<<2)+176>>2]=f;r=r+1|0}while(r>>>0<4);if((u|0)==95){i=h;return s|0}c:do if(g>>>0>1&(t|0)!=5){r=g>>>0>2&1;q=0;while(1){if(qb(a,l,r)|0){s=1;u=95;break}p=c[l>>2]|0;if(p>>>0>=g>>>0){s=1;u=95;break}c[d+(q<<2)+192>>2]=p;q=q+1|0;if(q>>>0>=4){T=0;break c}}if((u|0)==95){i=h;return s|0}}else T=0;while(0);d:while(1){q=c[d+(T<<2)+176>>2]|0;if(!q)U=0;else if((q|0)==2|(q|0)==1)U=1;else U=3;c[l>>2]=U;q=0;while(1){r=ob(a,m)|0;if(r){s=r;u=95;break d}b[d+(T<<4)+(q<<2)+208>>1]=c[m>>2];r=ob(a,m)|0;if(r){s=r;u=95;break d}b[d+(T<<4)+(q<<2)+210>>1]=c[m>>2];r=c[l>>2]|0;c[l>>2]=r+-1;if(!r)break;else q=q+1|0}T=T+1|0;if(T>>>0>=4){Q=2;u=70;break b}}if((u|0)==95){i=h;return s|0}}else{R=k;S=j}if(g>>>0>1){if((t|0)==0|(t|0)==1)V=0;else if((t|0)==3|(t|0)==2)V=1;else V=3;q=g>>>0>2&1;r=V;p=0;while(1){if(qb(a,j,q)|0){N=1;O=R;P=S;u=68;break b}f=c[j>>2]|0;if(f>>>0>=g>>>0){N=1;O=R;P=S;u=68;break b}c[d+(p<<2)+144>>2]=f;if(!r)break;else{r=r+-1|0;p=p+1|0}}}if((t|0)==0|(t|0)==1){W=0;X=0}else if((t|0)==3|(t|0)==2){W=1;X=0}else{W=3;X=0}while(1){p=ob(a,k)|0;if(p){N=p;O=R;P=S;u=68;break b}b[d+(X<<2)+160>>1]=c[k>>2];p=ob(a,k)|0;if(p){N=p;O=R;P=S;u=68;break b}b[d+(X<<2)+162>>1]=c[k>>2];if(!W){Q=2;u=70;break}else{W=W+-1|0;X=X+1|0}}}while(0);if((u|0)==68){s=N;i=h;return s|0}do if((u|0)==70){p=pb(a,n,(Q|0)==0&1)|0;if(!p){r=c[n>>2]|0;c[d+4>>2]=r;if(!r)break a;else break}else{s=p;i=h;return s|0}}while(0);p=(ob(a,o)|0)!=0;r=c[o>>2]|0;if(p|(r|0)<-26|(r|0)>25){s=1;i=h;return s|0}c[d+8>>2]=r;r=c[d+4>>2]|0;p=d+272|0;if((c[d>>2]|0)>>>0>=7){q=rb(a,d+1864|0,ib(e,0,p)|0,16)|0;if(!(q&15)){b[d+320>>1]=q>>>4&255;Y=0;u=77}else Z=q}else{Y=1;u=77}e:do if((u|0)==77){q=r;f=3;v=0;while(1){E=q;q=q>>>1;if(!(E&1))_=v+4|0;else{E=3;$=v;while(1){aa=ib(e,$,p)|0;if(Y){ba=rb(a,d+($<<6)+328|0,aa,16)|0;c[d+($<<2)+1992>>2]=ba>>>16;ca=ba}else{ba=rb(a,d+($<<6)+332|0,aa,15)|0;c[d+($<<2)+1992>>2]=ba>>>15;ca=ba}if(ca&15){Z=ca;break e}b[d+($<<1)+272>>1]=ca>>>4&255;ba=$+1|0;if(!E){_=ba;break}else{E=E+-1|0;$=ba}}}if(!f)break;else{f=f+-1|0;v=_}}if(q&3){v=rb(a,d+1928|0,-1,4)|0;if(v&15){Z=v;break}b[d+322>>1]=v>>>4&255;v=rb(a,d+1944|0,-1,4)|0;if(v&15){Z=v;break}b[d+324>>1]=v>>>4&255}if(!(q&2))Z=0;else{v=7;f=_;while(1){$=rb(a,d+(f<<6)+332|0,ib(e,f,p)|0,15)|0;if($&15){Z=$;break e}b[d+(f<<1)+272>>1]=$>>>4&255;c[d+(f<<2)+1992>>2]=$>>>15;if(!v){Z=0;break}else{v=v+-1|0;f=f+1|0}}}}while(0);c[a+16>>2]=((c[a+4>>2]|0)-(c[a>>2]|0)<<3)+(c[a+8>>2]|0);if(Z){s=Z;i=h;return s|0}}else{while(1){if(mb(a)|0)break;if(jb(a,1)|0){s=1;u=95;break}}if((u|0)==95){i=h;return s|0}p=0;r=d+328|0;while(1){f=jb(a,8)|0;c[n>>2]=f;if((f|0)==-1){s=1;break}c[r>>2]=f;p=p+1|0;if(p>>>0>=384)break a;else r=r+4|0}i=h;return s|0}while(0);s=0;i=h;return s|0}function cb(a){a=a|0;var b=0;if(a>>>0<6)b=2;else b=(a|0)!=6&1;return b|0}function db(a){a=a|0;var b=0,c=0;b=i;if((a|0)==3|(a|0)==2)c=2;else if((a|0)==0|(a|0)==1)c=1;else c=4;i=b;return c|0}function eb(a){a=a|0;var b=0,c=0;b=i;if((a|0)==2|(a|0)==1)c=2;else if(!a)c=1;else c=4;i=b;return c|0}function fb(a){a=a|0;return a+1&3|0}function gb(d,e,f,g,h,j,k,l){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;m=i;n=c[e>>2]|0;c[d>>2]=n;o=d+196|0;c[o>>2]=(c[o>>2]|0)+1;Na(f,j);if((n|0)==31){p=d+28|0;c[d+20>>2]=0;if((c[o>>2]|0)>>>0>1){b[p>>1]=16;b[d+30>>1]=16;b[d+32>>1]=16;b[d+34>>1]=16;b[d+36>>1]=16;b[d+38>>1]=16;b[d+40>>1]=16;b[d+42>>1]=16;b[d+44>>1]=16;b[d+46>>1]=16;b[d+48>>1]=16;b[d+50>>1]=16;b[d+52>>1]=16;b[d+54>>1]=16;b[d+56>>1]=16;b[d+58>>1]=16;b[d+60>>1]=16;b[d+62>>1]=16;b[d+64>>1]=16;b[d+66>>1]=16;b[d+68>>1]=16;b[d+70>>1]=16;b[d+72>>1]=16;b[d+74>>1]=16;q=0;i=m;return q|0}o=23;r=e+328|0;s=l;t=p;while(1){b[t>>1]=16;a[s>>0]=c[r>>2];a[s+1>>0]=c[r+4>>2];a[s+2>>0]=c[r+8>>2];a[s+3>>0]=c[r+12>>2];a[s+4>>0]=c[r+16>>2];a[s+5>>0]=c[r+20>>2];a[s+6>>0]=c[r+24>>2];a[s+7>>0]=c[r+28>>2];a[s+8>>0]=c[r+32>>2];a[s+9>>0]=c[r+36>>2];a[s+10>>0]=c[r+40>>2];a[s+11>>0]=c[r+44>>2];a[s+12>>0]=c[r+48>>2];a[s+13>>0]=c[r+52>>2];a[s+14>>0]=c[r+56>>2];a[s+15>>0]=c[r+60>>2];if(!o)break;else{o=o+-1|0;r=r+64|0;s=s+16|0;t=t+2|0}}vc(f,l);q=0;i=m;return q|0}t=d+28|0;if(n){kd(t,e+272|0,54);s=c[e+8>>2]|0;r=c[h>>2]|0;do if(s){o=r+s|0;c[h>>2]=o;if((o|0)<0){p=o+52|0;c[h>>2]=p;u=p;break}if((o|0)>51){p=o+-52|0;c[h>>2]=p;u=p}else u=o}else u=r;while(0);r=d+20|0;c[r>>2]=u;s=e+328|0;o=e+1992|0;a:do if((c[d>>2]|0)>>>0<7){p=o;v=15;w=s;x=t;while(1){if(b[x>>1]|0){if(Ga(w,c[r>>2]|0,0,c[p>>2]|0)|0){q=1;break}}else c[w>>2]=16777215;y=w+64|0;z=x+2|0;A=p+4|0;if(!v){B=A;C=y;D=z;break a}else{p=A;v=v+-1|0;w=y;x=z}}i=m;return q|0}else{if(!(b[d+76>>1]|0)){E=o;F=15;G=s;H=464;I=t}else{Ha(e+1864|0,u);E=o;F=15;G=s;H=464;I=t}while(1){x=c[e+(c[H>>2]<<2)+1864>>2]|0;H=H+4|0;c[G>>2]=x;if((x|0)==0?(b[I>>1]|0)==0:0)c[G>>2]=16777215;else J=18;if((J|0)==18?(J=0,(Ga(G,c[r>>2]|0,1,c[E>>2]|0)|0)!=0):0){q=1;break}x=G+64|0;w=I+2|0;v=E+4|0;if(!F){B=v;C=x;D=w;break a}else{E=v;F=F+-1|0;G=x;I=w}}i=m;return q|0}while(0);I=c[192+((Oa(0,51,(c[d+24>>2]|0)+(c[r>>2]|0)|0)|0)<<2)>>2]|0;if((b[d+78>>1]|0)==0?(b[d+80>>1]|0)==0:0){K=B;L=7;M=C;N=e+1928|0;O=D}else{r=e+1928|0;Ia(r,I);K=B;L=7;M=C;N=r;O=D}while(1){D=c[N>>2]|0;N=N+4|0;c[M>>2]=D;if((D|0)==0?(b[O>>1]|0)==0:0)c[M>>2]=16777215;else J=31;if((J|0)==31?(J=0,(Ga(M,I,1,c[K>>2]|0)|0)!=0):0){q=1;J=39;break}if(!L)break;else{K=K+4|0;L=L+-1|0;M=M+64|0;O=O+2|0}}if((J|0)==39){i=m;return q|0}if(n>>>0>=6){n=Nb(d,e,f,j,k,l)|0;if(n){q=n;i=m;return q|0}}else J=37}else{ld(t,0,54);c[d+20>>2]=c[h>>2];J=37}if((J|0)==37?(J=Tb(d,e,g,j,f,l)|0,(J|0)!=0):0){q=J;i=m;return q|0}q=0;i=m;return q|0}function hb(a){a=a|0;return a|0}function ib(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;h=vb(e)|0;j=wb(e)|0;e=a[h+4>>0]|0;k=a[j+4>>0]|0;l=(c[j>>2]|0)==4;if((c[h>>2]|0)==4){h=b[f+((e&255)<<1)>>1]|0;if(l){m=h+1+(b[f+((k&255)<<1)>>1]|0)>>1;i=g;return m|0}j=d+204|0;if(!(zb(d,c[j>>2]|0)|0)){m=h;i=g;return m|0}m=h+1+(b[(c[j>>2]|0)+((k&255)<<1)+28>>1]|0)>>1;i=g;return m|0}if(l){l=b[f+((k&255)<<1)>>1]|0;f=d+200|0;if(!(zb(d,c[f>>2]|0)|0)){m=l;i=g;return m|0}m=l+1+(b[(c[f>>2]|0)+((e&255)<<1)+28>>1]|0)>>1;i=g;return m|0}f=d+200|0;if(!(zb(d,c[f>>2]|0)|0)){n=0;o=0}else{n=b[(c[f>>2]|0)+((e&255)<<1)+28>>1]|0;o=1}e=d+204|0;if(!(zb(d,c[e>>2]|0)|0)){m=n;i=g;return m|0}d=b[(c[e>>2]|0)+((k&255)<<1)+28>>1]|0;if(!o){m=d;i=g;return m|0}m=n+1+d>>1;i=g;return m|0}function jb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;e=kb(a)|0;f=a+16|0;g=(c[f>>2]|0)+b|0;c[f>>2]=g;c[a+8>>2]=g&7;if(g>>>0>c[a+12>>2]<<3>>>0){h=-1;i=d;return h|0}c[a+4>>2]=(c[a>>2]|0)+(g>>>3);h=e>>>(32-b|0);i=d;return h|0}function kb(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;b=i;e=c[a+4>>2]|0;f=(c[a+12>>2]<<3)-(c[a+16>>2]|0)|0;if((f|0)>31){g=c[a+8>>2]|0;h=(d[e+1>>0]|0)<<16|(d[e>>0]|0)<<24|(d[e+2>>0]|0)<<8|(d[e+3>>0]|0);if(!g){j=h;i=b;return j|0}j=(d[e+4>>0]|0)>>>(8-g|0)|h<<g;i=b;return j|0}if((f|0)<=0){j=0;i=b;return j|0}g=c[a+8>>2]|0;a=g+24|0;h=(d[e>>0]|0)<<a;k=f+-8+g|0;if((k|0)>0){l=e;m=k;n=h;o=a}else{j=h;i=b;return j|0}while(1){l=l+1|0;o=o+-8|0;h=(d[l>>0]|0)<<o|n;m=m+-8|0;if((m|0)<=0){j=h;break}else n=h}i=b;return j|0}function lb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;e=a+16|0;f=(c[e>>2]|0)+b|0;c[e>>2]=f;c[a+8>>2]=f&7;if(f>>>0>c[a+12>>2]<<3>>>0){g=-1;i=d;return g|0}c[a+4>>2]=(c[a>>2]|0)+(f>>>3);g=0;i=d;return g|0}function mb(a){a=a|0;return (c[a+8>>2]|0)==0|0}function nb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;e=kb(a)|0;do if((e|0)>=0){if(e>>>0>1073741823){if((lb(a,3)|0)==-1){f=1;break}c[b>>2]=(e>>>29&1)+1;f=0;break}if(e>>>0>536870911){if((lb(a,5)|0)==-1){f=1;break}c[b>>2]=(e>>>27&3)+3;f=0;break}if(e>>>0>268435455){if((lb(a,7)|0)==-1){f=1;break}c[b>>2]=(e>>>25&7)+7;f=0;break}g=Ja(e,28)|0;h=g+4|0;if((h|0)!=32){lb(a,g+5|0)|0;g=jb(a,h)|0;if((g|0)==-1){f=1;break}c[b>>2]=(1<<h)+-1+g;f=0;break}c[b>>2]=0;lb(a,32)|0;if((jb(a,1)|0)==1?(g=kb(a)|0,(lb(a,32)|0)!=-1):0)if(!g){c[b>>2]=-1;f=0;break}else if((g|0)==1){c[b>>2]=-1;f=1;break}else{f=1;break}else f=1}else{lb(a,1)|0;c[b>>2]=0;f=0}while(0);i=d;return f|0}function ob(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d;c[e>>2]=0;f=nb(a,e)|0;a=c[e>>2]|0;e=(f|0)==0;if((a|0)==-1)if(e)g=1;else{c[b>>2]=-2147483648;g=0}else if(e){e=(a+1|0)>>>1;c[b>>2]=(a&1|0)!=0?e:0-e|0;g=0}else g=1;i=d;return g|0}function pb(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+16|0;g=f;if(nb(a,g)|0){h=1;i=f;return h|0}a=c[g>>2]|0;if(a>>>0>47){h=1;i=f;return h|0}c[b>>2]=d[((e|0)==0?576:528)+a>>0];h=0;i=f;return h|0}function qb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if(!d){d=jb(a,1)|0;c[b>>2]=d;if((d|0)==-1)f=1;else{c[b>>2]=d^1;f=0}}else f=nb(a,b)|0;i=e;return f|0}function rb(a,b,f,g){a=a|0;b=b|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0;h=i;i=i+128|0;j=h+64|0;k=h;l=kb(a)|0;m=l>>>16;do if(f>>>0<2)if((l|0)>=0){if(l>>>0>201326591){n=e[1264+(l>>>26<<1)>>1]|0;o=25;break}if(l>>>0>16777215){n=e[1328+(l>>>22<<1)>>1]|0;o=25;break}if(l>>>0>2097151){n=e[1424+((l>>>18)+-8<<1)>>1]|0;o=25;break}else{n=e[1536+(m<<1)>>1]|0;o=25;break}}else p=1;else if(f>>>0<4){if((l|0)<0){p=(m&16384|0)!=0?2:2082;break}if(l>>>0>268435455){n=e[1600+(l>>>26<<1)>>1]|0;o=25;break}if(l>>>0>33554431){n=e[1664+(l>>>23<<1)>>1]|0;o=25;break}else{n=e[1728+(l>>>18<<1)>>1]|0;o=25;break}}else{if(f>>>0<8){q=l>>>26;if((q+-8|0)>>>0<56){n=e[1984+(q<<1)>>1]|0;o=25;break}n=e[2112+(l>>>22<<1)>>1]|0;o=25;break}if(f>>>0<17){n=e[2368+(l>>>26<<1)>>1]|0;o=25;break}q=l>>>29;if(q){n=e[2496+(q<<1)>>1]|0;o=25;break}n=e[2512+(l>>>24<<1)>>1]|0;o=25;break}while(0);if((o|0)==25)if(!n){r=1;i=h;return r|0}else p=n;n=p&31;f=l<<n;l=32-n|0;m=p>>>11&31;if(m>>>0>g>>>0){r=1;i=h;return r|0}q=p>>>5&63;do if(m){if(!q){s=l;t=f;u=0}else{do if(l>>>0<q>>>0)if((lb(a,n)|0)==-1){r=1;i=h;return r|0}else{v=32;w=kb(a)|0;break}else{v=l;w=f}while(0);p=w>>>(32-q|0);x=w<<q;y=0;z=1<<q+-1;do{c[j+(y<<2)>>2]=(z&p|0)!=0?-1:1;z=z>>>1;y=y+1|0}while((z|0)!=0);s=v-q|0;t=x;u=y}z=q>>>0<3;a:do if(u>>>0<m>>>0){p=s;A=t;B=u;C=m>>>0>10&z&1;b:while(1){if(p>>>0<16){if((lb(a,32-p|0)|0)==-1){r=1;o=127;break}D=32;E=kb(a)|0}else{D=p;E=A}do if((E|0)>=0)if(E>>>0<=1073741823)if(E>>>0<=536870911)if(E>>>0<=268435455)if(E>>>0<=134217727)if(E>>>0<=67108863)if(E>>>0<=33554431)if(E>>>0<=16777215)if(E>>>0<=8388607)if(E>>>0>4194303){F=9;o=59}else{if(E>>>0>2097151){F=10;o=59;break}if(E>>>0>1048575){F=11;o=59;break}if(E>>>0>524287){F=12;o=59;break}if(E>>>0>262143){F=13;o=59;break}if(E>>>0>131071){G=D+-15|0;H=E<<15;I=14;J=C;K=(C|0)!=0?C:4}else{if(E>>>0<65536){r=1;o=127;break b}G=D+-16|0;H=E<<16;I=15;J=(C|0)!=0?C:1;K=12}L=I<<J;M=G;N=(J|0)==0;O=H;P=J;Q=K;o=60}else{F=8;o=59}else{F=7;o=59}else{F=6;o=59}else{F=5;o=59}else{F=4;o=59}else{F=3;o=59}else{F=2;o=59}else{F=1;o=59}else{F=0;o=59}while(0);if((o|0)==59){o=0;R=F+1|0;S=E<<R;T=D-R|0;R=F<<C;if(!C){U=1;V=T;W=S;X=R;Y=0}else{L=R;M=T;N=0;O=S;P=C;Q=C;o=60}}if((o|0)==60){o=0;if(M>>>0<Q>>>0){if((lb(a,32-M|0)|0)==-1){r=1;o=127;break}Z=32;_=kb(a)|0}else{Z=M;_=O}U=N;V=Z-Q|0;W=_<<Q;X=(_>>>(32-Q|0))+L|0;Y=P}S=(B|0)==(q|0)&z?X+2|0:X;T=(S+2|0)>>>1;R=U?1:Y;c[j+(B<<2)>>2]=(S&1|0)==0?T:0-T|0;B=B+1|0;if(B>>>0>=m>>>0){$=V;aa=W;break a}else{p=V;A=W;C=((T|0)>(3<<R+-1|0)&R>>>0<6&1)+R|0}}if((o|0)==127){i=h;return r|0}}else{$=s;aa=t}while(0);if(m>>>0<g>>>0){do if($>>>0<9)if((lb(a,32-$|0)|0)==-1){r=1;i=h;return r|0}else{ba=32;ca=kb(a)|0;break}else{ba=$;ca=aa}while(0);z=ca>>>23;c:do if((g|0)==4)if((ca|0)>=0)if((m|0)!=3)if(ca>>>0<=1073741823)if((m|0)==2)da=34;else da=ca>>>0>536870911?35:51;else da=18;else da=17;else da=1;else{do switch(m|0){case 10:{ea=d[1184+(ca>>>27)>>0]|0;break}case 11:{ea=d[1216+(ca>>>28)>>0]|0;break}case 8:{ea=d[1056+(ca>>>26)>>0]|0;break}case 9:{ea=d[1120+(ca>>>26)>>0]|0;break}case 6:{ea=d[928+(ca>>>26)>>0]|0;break}case 7:{ea=d[992+(ca>>>26)>>0]|0;break}case 14:{ea=d[1256+(ca>>>30)>>0]|0;break}case 4:{ea=d[864+(ca>>>27)>>0]|0;break}case 5:{ea=d[896+(ca>>>27)>>0]|0;break}case 12:{ea=d[1232+(ca>>>28)>>0]|0;break}case 13:{ea=d[1248+(ca>>>29)>>0]|0;break}case 1:{if(ca>>>0>268435455)ea=d[672+(ca>>>27)>>0]|0;else ea=d[704+z>>0]|0;break}case 2:{ea=d[736+(ca>>>26)>>0]|0;break}case 3:{ea=d[800+(ca>>>26)>>0]|0;break}default:{da=ca>>31&16|1;break c}}while(0);if(!ea){r=1;i=h;return r|0}else da=ea}while(0);z=da&15;fa=ba-z|0;ga=ca<<z;ha=da>>>4&15}else{fa=$;ga=aa;ha=0}z=m+-1|0;y=(z|0)==0;if(y){c[b+(ha<<2)>>2]=c[j+(z<<2)>>2];ia=fa;ja=1<<ha;break}else{ka=fa;la=ga;ma=0;na=ha}d:while(1){if(!na){c[k+(ma<<2)>>2]=1;oa=ka;pa=la;qa=0}else{if(ka>>>0<11){if((lb(a,32-ka|0)|0)==-1){r=1;o=127;break}ra=32;sa=kb(a)|0}else{ra=ka;sa=la}switch(na|0){case 4:{ta=d[648+(sa>>>29)>>0]|0;break}case 5:{ta=d[656+(sa>>>29)>>0]|0;break}case 6:{ta=d[664+(sa>>>29)>>0]|0;break}case 1:{ta=d[624+(sa>>>31)>>0]|0;break}case 2:{ta=d[632+(sa>>>30)>>0]|0;break}case 3:{ta=d[640+(sa>>>30)>>0]|0;break}default:{do if(sa>>>0<=536870911)if(sa>>>0<=268435455)if(sa>>>0<=134217727)if(sa>>>0<=67108863)if(sa>>>0<=33554431)if(sa>>>0>16777215)ua=184;else{if(sa>>>0>8388607){ua=201;break}if(sa>>>0>4194303){ua=218;break}ua=sa>>>0<2097152?0:235}else ua=167;else ua=150;else ua=133;else ua=116;else ua=sa>>>29<<4^115;while(0);if((ua>>>4&15)>>>0>na>>>0){r=1;o=127;break d}else ta=ua}}if(!ta){r=1;o=127;break}x=ta&15;C=ta>>>4&15;c[k+(ma<<2)>>2]=C+1;oa=ra-x|0;pa=sa<<x;qa=na-C|0}ma=ma+1|0;if(ma>>>0>=z>>>0){o=122;break}else{ka=oa;la=pa;na=qa}}if((o|0)==122){c[b+(qa<<2)>>2]=c[j+(z<<2)>>2];C=1<<qa;if(y){ia=oa;ja=C;break}x=m+-2|0;A=C;C=qa;while(1){C=(c[k+(x<<2)>>2]|0)+C|0;p=1<<C|A;c[b+(C<<2)>>2]=c[j+(x<<2)>>2];if(!x){ia=oa;ja=p;break}else{x=x+-1|0;A=p}}}else if((o|0)==127){i=h;return r|0}}else{ia=l;ja=0}while(0);if(lb(a,32-ia|0)|0){r=1;i=h;return r|0}r=ja<<16|m<<4;i=h;return r|0}function sb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;a:do if((jb(a,1)|0)!=-1?(e=b+4|0,c[e>>2]=jb(a,2)|0,f=jb(a,5)|0,c[b>>2]=f,(f+-2|0)>>>0>=3):0){switch(f|0){case 5:case 7:case 8:{if(!(c[e>>2]|0)){g=1;break a}switch(f|0){case 6:case 9:case 10:case 11:case 12:{g=1;break a;break}default:{}}break}case 6:case 9:case 10:case 11:case 12:{if(c[e>>2]|0){g=1;break a}break}default:{}}g=0}else g=1;while(0);i=d;return g|0}function tb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;e=i;if(!d){i=e;return}f=b+-1|0;g=1-b|0;h=~b;j=0;k=0;l=0;while(1){m=(j|0)!=0;if(m)c[a+(k*216|0)+200>>2]=a+((k+-1|0)*216|0);else c[a+(k*216|0)+200>>2]=0;n=(l|0)!=0;if(n){c[a+(k*216|0)+204>>2]=a+((k-b|0)*216|0);if(j>>>0<f>>>0)c[a+(k*216|0)+208>>2]=a+((g+k|0)*216|0);else o=10}else{c[a+(k*216|0)+204>>2]=0;o=10}if((o|0)==10){o=0;c[a+(k*216|0)+208>>2]=0}if(n&m)c[a+(k*216|0)+212>>2]=a+((k+h|0)*216|0);else c[a+(k*216|0)+212>>2]=0;m=j+1|0;n=(m|0)==(b|0);k=k+1|0;if((k|0)==(d|0))break;else{j=n?0:m;l=(n&1)+l|0}}i=e;return}function ub(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;switch(b|0){case 4:{e=a;break}case 2:{e=c[a+208>>2]|0;break}case 1:{e=c[a+204>>2]|0;break}case 3:{e=c[a+212>>2]|0;break}case 0:{e=c[a+200>>2]|0;break}default:e=0}i=d;return e|0}function vb(a){a=a|0;return 3152+(a<<3)|0}function wb(a){a=a|0;return 2960+(a<<3)|0}function xb(a){a=a|0;return 2768+(a<<3)|0}function yb(a){a=a|0;return 2576+(a<<3)|0}function zb(a,b){a=a|0;b=b|0;var d=0;d=i;if(!b){i=d;return 0}else{i=d;return (c[a+4>>2]|0)==(c[b+4>>2]|0)|0}return 0}function Ab(a){a=a|0;var b=0;b=i;ld(a,0,3388);c[a+8>>2]=32;c[a+4>>2]=256;c[a+1332>>2]=1;i=b;return}function Bb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;e=c[b+8>>2]|0;f=a+(e<<2)+20|0;g=c[f>>2]|0;do if(!g){h=id(92)|0;c[f>>2]=h;if(!h){j=65535;i=d;return j|0}}else{h=a+8|0;if((e|0)!=(c[h>>2]|0)){jd(c[g+40>>2]|0);c[(c[f>>2]|0)+40>>2]=0;jd(c[(c[f>>2]|0)+84>>2]|0);c[(c[f>>2]|0)+84>>2]=0;break}k=a+16|0;if(Ra(b,c[k>>2]|0)|0){jd(c[(c[f>>2]|0)+40>>2]|0);c[(c[f>>2]|0)+40>>2]=0;jd(c[(c[f>>2]|0)+84>>2]|0);c[(c[f>>2]|0)+84>>2]=0;c[h>>2]=33;c[a+4>>2]=257;c[k>>2]=0;c[a+12>>2]=0;break}k=b+40|0;jd(c[k>>2]|0);c[k>>2]=0;k=b+84|0;jd(c[k>>2]|0);c[k>>2]=0;j=0;i=d;return j|0}while(0);a=(c[f>>2]|0)+0|0;f=b+0|0;b=a+92|0;do{c[a>>2]=c[f>>2];a=a+4|0;f=f+4|0}while((a|0)<(b|0));j=0;i=d;return j|0}function Cb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;e=c[b>>2]|0;f=a+(e<<2)+148|0;g=c[f>>2]|0;do if(!g){h=id(72)|0;c[f>>2]=h;if(!h){j=65535;i=d;return j|0}}else{h=a+4|0;if((e|0)!=(c[h>>2]|0)){jd(c[g+20>>2]|0);c[(c[f>>2]|0)+20>>2]=0;jd(c[(c[f>>2]|0)+24>>2]|0);c[(c[f>>2]|0)+24>>2]=0;jd(c[(c[f>>2]|0)+28>>2]|0);c[(c[f>>2]|0)+28>>2]=0;jd(c[(c[f>>2]|0)+44>>2]|0);c[(c[f>>2]|0)+44>>2]=0;break}if((c[b+4>>2]|0)==(c[a+8>>2]|0))k=g;else{c[h>>2]=257;k=c[f>>2]|0}jd(c[k+20>>2]|0);c[(c[f>>2]|0)+20>>2]=0;jd(c[(c[f>>2]|0)+24>>2]|0);c[(c[f>>2]|0)+24>>2]=0;jd(c[(c[f>>2]|0)+28>>2]|0);c[(c[f>>2]|0)+28>>2]=0;jd(c[(c[f>>2]|0)+44>>2]|0);c[(c[f>>2]|0)+44>>2]=0}while(0);k=(c[f>>2]|0)+0|0;f=b+0|0;b=k+72|0;do{c[k>>2]=c[f>>2];k=k+4|0;f=f+4|0}while((k|0)<(b|0));j=0;i=d;return j|0}function Db(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=i;f=a+(b<<2)+148|0;g=c[f>>2]|0;if(!g){h=1;i=e;return h|0}j=c[g+4>>2]|0;k=c[a+(j<<2)+20>>2]|0;if(!k){h=1;i=e;return h|0}l=Kb(g,k)|0;if(l){h=l;i=e;return h|0}l=a+4|0;k=c[l>>2]|0;do if((k|0)!=256){g=a+3380|0;if(!(c[g>>2]|0)){if((k|0)==(b|0))break;m=a+8|0;if((j|0)==(c[m>>2]|0)){c[l>>2]=b;c[a+12>>2]=c[f>>2];break}if(!d){h=1;i=e;return h|0}else{c[l>>2]=b;n=c[f>>2]|0;c[a+12>>2]=n;o=c[n+4>>2]|0;c[m>>2]=o;m=c[a+(o<<2)+20>>2]|0;c[a+16>>2]=m;o=c[m+52>>2]|0;n=c[m+56>>2]|0;c[a+1176>>2]=Z(n,o)|0;c[a+1340>>2]=o;c[a+1344>>2]=n;c[g>>2]=1;break}}c[g>>2]=0;g=a+1212|0;jd(c[g>>2]|0);c[g>>2]=0;n=a+1172|0;jd(c[n>>2]|0);c[n>>2]=0;o=a+1176|0;c[g>>2]=id((c[o>>2]|0)*216|0)|0;m=id(c[o>>2]<<2)|0;c[n>>2]=m;n=c[g>>2]|0;if((n|0)==0|(m|0)==0){h=65535;i=e;return h|0}ld(n,0,(c[o>>2]|0)*216|0);n=a+16|0;tb(c[g>>2]|0,c[(c[n>>2]|0)+52>>2]|0,c[o>>2]|0);o=c[n>>2]|0;do if((c[a+1216>>2]|0)==0?(c[o+16>>2]|0)!=2:0){if(((c[o+80>>2]|0)!=0?(n=c[o+84>>2]|0,(c[n+920>>2]|0)!=0):0)?(c[n+944>>2]|0)==0:0){p=1;break}p=0}else p=1;while(0);n=Z(c[o+56>>2]|0,c[o+52>>2]|0)|0;g=nc(a+1220|0,n,c[o+88>>2]|0,c[o+44>>2]|0,c[o+12>>2]|0,p)|0;if(g){h=g;i=e;return h|0}}else{c[l>>2]=b;g=c[f>>2]|0;c[a+12>>2]=g;n=c[g+4>>2]|0;c[a+8>>2]=n;g=c[a+(n<<2)+20>>2]|0;c[a+16>>2]=g;n=c[g+52>>2]|0;m=c[g+56>>2]|0;c[a+1176>>2]=Z(m,n)|0;c[a+1340>>2]=n;c[a+1344>>2]=m;c[a+3380>>2]=1}while(0);h=0;i=e;return h|0}function Eb(a){a=a|0;var b=0,d=0,e=0;b=i;c[a+1196>>2]=0;c[a+1192>>2]=0;d=c[a+1176>>2]|0;if(!d){i=b;return}e=c[a+1212>>2]|0;a=0;do{c[e+(a*216|0)+4>>2]=0;c[e+(a*216|0)+196>>2]=0;a=a+1|0}while(a>>>0<d>>>0);i=b;return}function Fb(a){a=a|0;return (c[a+1188>>2]|0)==0|0}function Gb(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;if(!(c[a+1404>>2]|0)){if((c[a+1196>>2]|0)==(c[a+1176>>2]|0)){d=1;i=b;return d|0}}else{e=c[a+1176>>2]|0;if(!e){d=1;i=b;return d|0}f=c[a+1212>>2]|0;a=0;g=0;do{g=((c[f+(a*216|0)+196>>2]|0)!=0&1)+g|0;a=a+1|0}while(a>>>0<e>>>0);if((g|0)==(e|0)){d=1;i=b;return d|0}}d=0;i=b;return d|0}function Hb(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;e=c[a+16>>2]|0;Lb(c[a+1172>>2]|0,c[a+12>>2]|0,b,c[e+52>>2]|0,c[e+56>>2]|0);i=d;return}function Ib(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;f=i;i=i+32|0;g=f+24|0;h=f+20|0;j=f+16|0;k=f+12|0;l=f+8|0;m=f;c[e>>2]=0;switch(c[b>>2]|0){case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:{c[e>>2]=1;n=0;i=f;return n|0}case 5:case 1:{o=d+1300|0;p=d+1332|0;if(c[p>>2]|0){c[e>>2]=1;c[p>>2]=0}p=Ua(a,g)|0;if(p){n=p;i=f;return n|0}p=c[d+(c[g>>2]<<2)+148>>2]|0;if(!p){n=65520;i=f;return n|0}g=c[p+4>>2]|0;q=c[d+(g<<2)+20>>2]|0;if(!q){n=65520;i=f;return n|0}r=c[d+8>>2]|0;if(!((r|0)==32|(g|0)==(r|0))?(c[b>>2]|0)!=5:0){n=65520;i=f;return n|0}r=c[d+1304>>2]|0;g=c[b+4>>2]|0;if((r|0)!=(g|0)?(r|0)==0|(g|0)==0:0)c[e>>2]=1;g=(c[b>>2]|0)==5;if((c[o>>2]|0)==5){if(!g)s=16}else if(g)s=16;if((s|0)==16)c[e>>2]=1;s=q+12|0;if(Va(a,c[s>>2]|0,h)|0){n=1;i=f;return n|0}g=d+1308|0;r=c[h>>2]|0;if((c[g>>2]|0)!=(r|0)){c[g>>2]=r;c[e>>2]=1}if((c[b>>2]|0)==5){if(Wa(a,c[s>>2]|0,5,j)|0){n=1;i=f;return n|0}if((c[o>>2]|0)==5){s=d+1312|0;r=c[s>>2]|0;g=c[j>>2]|0;if((r|0)==(g|0)){t=s;u=r}else{c[e>>2]=1;t=s;u=g}}else{t=d+1312|0;u=c[j>>2]|0}c[t>>2]=u}u=c[q+16>>2]|0;if(!u){if(Xa(a,q,c[b>>2]|0,k)|0){n=1;i=f;return n|0}t=d+1316|0;j=c[k>>2]|0;if((c[t>>2]|0)!=(j|0)){c[t>>2]=j;c[e>>2]=1}if(c[p+8>>2]|0){j=Ya(a,q,c[b>>2]|0,l)|0;if(j){n=j;i=f;return n|0}j=d+1320|0;t=c[l>>2]|0;if((c[j>>2]|0)!=(t|0)){c[j>>2]=t;c[e>>2]=1}}}else if((u|0)==1?(c[q+24>>2]|0)==0:0){u=p+8|0;p=Za(a,q,c[b>>2]|0,c[u>>2]|0,m)|0;if(p){n=p;i=f;return n|0}p=d+1324|0;q=c[m>>2]|0;if((c[p>>2]|0)!=(q|0)){c[p>>2]=q;c[e>>2]=1}if((c[u>>2]|0)!=0?(u=d+1328|0,d=c[m+4>>2]|0,(c[u>>2]|0)!=(d|0)):0){c[u>>2]=d;c[e>>2]=1}}e=b;b=c[e+4>>2]|0;d=o;c[d>>2]=c[e>>2];c[d+4>>2]=b;n=0;i=f;return n|0}default:{n=0;i=f;return n|0}}return 0}function Jb(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;d=0;while(1){e=c[a+(d<<2)+148>>2]|0;if(((e|0)!=0?(f=c[a+(c[e+4>>2]<<2)+20>>2]|0,(f|0)!=0):0)?(Kb(e,f)|0)==0:0){g=0;h=6;break}d=d+1|0;if(d>>>0>=256){g=1;h=6;break}}if((h|0)==6){i=b;return g|0}return 0}function Kb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;d=i;e=c[b+52>>2]|0;f=Z(c[b+56>>2]|0,e)|0;b=c[a+12>>2]|0;a:do if(b>>>0>1){g=c[a+16>>2]|0;if(!g){h=c[a+20>>2]|0;j=0;while(1){if((c[h+(j<<2)>>2]|0)>>>0>f>>>0){k=1;break}j=j+1|0;if(j>>>0>=b>>>0)break a}i=d;return k|0}else if((g|0)==2){j=c[a+24>>2]|0;h=c[a+28>>2]|0;l=0;while(1){m=c[j+(l<<2)>>2]|0;n=c[h+(l<<2)>>2]|0;if(!(m>>>0<=n>>>0&n>>>0<f>>>0)){k=1;o=15;break}l=l+1|0;if(((m>>>0)%(e>>>0)|0)>>>0>((n>>>0)%(e>>>0)|0)>>>0){k=1;o=15;break}if(l>>>0>=(b+-1|0)>>>0)break a}if((o|0)==15){i=d;return k|0}}else{if((g+-3|0)>>>0<3){if((c[a+36>>2]|0)>>>0>f>>>0)k=1;else break;i=d;return k|0}if((g|0)!=6)break;if((c[a+40>>2]|0)>>>0<f>>>0)k=1;else break;i=d;return k|0}}while(0);k=0;i=d;return k|0}function Lb(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;g=i;h=Z(f,e)|0;j=c[b+12>>2]|0;if((j|0)==1){ld(a,0,h<<2);i=g;return}k=c[b+16>>2]|0;if((k+-3|0)>>>0<3){l=Z(c[b+36>>2]|0,d)|0;d=l>>>0<h>>>0?l:h;if((k&-2|0)==4){m=(c[b+32>>2]|0)==0?d:h-d|0;n=d}else{m=0;n=d}}else{m=0;n=0}switch(k|0){case 3:{k=c[b+32>>2]|0;if(h){d=0;do{c[a+(d<<2)>>2]=1;d=d+1|0}while((d|0)!=(h|0))}d=(e-k|0)>>>1;l=(f-k|0)>>>1;if(!n){i=g;return}o=k<<1;p=o+-1|0;q=e+-1|0;r=1-o|0;o=f+-1|0;s=l;t=0;u=d;v=d;w=l;x=d;d=k+-1|0;y=l;l=k;while(1){k=a+((Z(y,e)|0)+x<<2)|0;z=(c[k>>2]|0)==1;A=z&1;if(z)c[k>>2]=0;do if(!((d|0)==-1&(x|0)==(u|0))){if((d|0)==1&(x|0)==(v|0)){k=v+1|0;z=(k|0)<(q|0)?k:q;B=s;C=u;D=z;E=w;F=z;G=0;H=y;I=r;break}if((l|0)==-1&(y|0)==(w|0)){z=w+-1|0;k=(z|0)>0?z:0;B=s;C=u;D=v;E=k;F=x;G=r;H=k;I=0;break}if((l|0)==1&(y|0)==(s|0)){k=s+1|0;z=(k|0)<(o|0)?k:o;B=z;C=u;D=v;E=w;F=x;G=p;H=z;I=0;break}else{B=s;C=u;D=v;E=w;F=x+d|0;G=d;H=y+l|0;I=l;break}}else{z=u+-1|0;k=(z|0)>0?z:0;B=s;C=k;D=v;E=w;F=k;G=0;H=y;I=p}while(0);t=A+t|0;if(t>>>0>=n>>>0)break;else{s=B;u=C;v=D;w=E;x=F;d=G;y=H;l=I}}i=g;return}case 5:{I=c[b+32>>2]|0;if(!e){i=g;return}l=(f|0)==0;H=1-I|0;y=0;G=0;while(1){if(l)J=G;else{d=0;F=G;while(1){x=a+((Z(d,e)|0)+y<<2)|0;c[x>>2]=F>>>0<m>>>0?I:H;d=d+1|0;if((d|0)==(f|0))break;else F=F+1|0}J=G+f|0}y=y+1|0;if((y|0)==(e|0))break;else G=J}i=g;return}case 0:{J=c[b+20>>2]|0;G=0;y=0;a:while(1){f=y>>>0<h>>>0;H=G;while(1){if(H>>>0<j>>>0&f)break;if(f)H=0;else break a}f=J+(H<<2)|0;I=c[f>>2]|0;b:do if(!I)K=0;else{l=I;F=0;while(1){d=F+y|0;if(d>>>0>=h>>>0){K=l;break b}c[a+(d<<2)>>2]=H;F=F+1|0;d=c[f>>2]|0;if(F>>>0>=d>>>0){K=d;break}else l=d}}while(0);G=H+1|0;y=K+y|0}i=g;return}case 4:{y=c[b+32>>2]|0;if(!h){i=g;return}K=1-y|0;G=0;do{c[a+(G<<2)>>2]=G>>>0<m>>>0?y:K;G=G+1|0}while((G|0)!=(h|0));i=g;return}case 1:{if(!h){i=g;return}else L=0;do{c[a+(L<<2)>>2]=((((Z((L>>>0)/(e>>>0)|0,j)|0)>>>1)+((L>>>0)%(e>>>0)|0)|0)>>>0)%(j>>>0)|0;L=L+1|0}while((L|0)!=(h|0));i=g;return}case 2:{L=c[b+24>>2]|0;G=c[b+28>>2]|0;K=j+-1|0;if(h){y=0;do{c[a+(y<<2)>>2]=K;y=y+1|0}while((y|0)!=(h|0))}if(!K){i=g;return}K=j+-2|0;while(1){j=c[L+(K<<2)>>2]|0;y=(j>>>0)/(e>>>0)|0;m=(j>>>0)%(e>>>0)|0;j=c[G+(K<<2)>>2]|0;J=(j>>>0)/(e>>>0)|0;f=(j>>>0)%(e>>>0)|0;if(y>>>0<=J>>>0){j=m>>>0>f>>>0;I=y;do{if(!j){y=Z(I,e)|0;l=m;do{c[a+(l+y<<2)>>2]=K;l=l+1|0}while(l>>>0<=f>>>0)}I=I+1|0}while(I>>>0<=J>>>0)}if(!K)break;else K=K+-1|0}i=g;return}default:{if(!h){i=g;return}K=c[b+44>>2]|0;b=0;do{c[a+(b<<2)>>2]=c[K+(b<<2)>>2];b=b+1|0}while((b|0)!=(h|0));i=g;return}}}function Mb(){return 3472}function Nb(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0;h=i;i=i+80|0;j=h+32|0;k=h;Ob(d,j,k,e);if((cb(c[a>>2]|0)|0)==1){e=Pb(a,g,b+328|0,j,k,f)|0;if(e){l=e;i=h;return l|0}}else{e=Qb(a,g,b,j,k,f)|0;if(e){l=e;i=h;return l|0}}e=Rb(a,g+256|0,b+1352|0,j+21|0,k+16|0,c[b+140>>2]|0,f)|0;if(e){l=e;i=h;return l|0}if((c[a+196>>2]|0)>>>0>1){l=0;i=h;return l|0}vc(d,g);l=0;i=h;return l|0}function Ob(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;g=i;if(!f){i=g;return}h=c[b+4>>2]|0;j=Z(c[b+8>>2]|0,h)|0;k=(f>>>0)/(h>>>0)|0;l=Z(k,h)|0;m=f-l|0;n=h<<4;o=c[b>>2]|0;p=(m<<4)+(Z(h<<8,k)|0)|0;q=(k|0)!=0;if(q){r=p-(n|1)|0;a[d>>0]=a[o+r>>0]|0;a[d+1>>0]=a[o+(r+1)>>0]|0;a[d+2>>0]=a[o+(r+2)>>0]|0;a[d+3>>0]=a[o+(r+3)>>0]|0;a[d+4>>0]=a[o+(r+4)>>0]|0;a[d+5>>0]=a[o+(r+5)>>0]|0;a[d+6>>0]=a[o+(r+6)>>0]|0;a[d+7>>0]=a[o+(r+7)>>0]|0;a[d+8>>0]=a[o+(r+8)>>0]|0;a[d+9>>0]=a[o+(r+9)>>0]|0;a[d+10>>0]=a[o+(r+10)>>0]|0;a[d+11>>0]=a[o+(r+11)>>0]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a[E+14>>0]=a[D>>0]|0;a[E+15>>0]=a[D>>0]|0;F=F+1|0;if((F|0)==16)break;else E=E+16|0}}else if((l|0)==2){l=g+1|0;E=(o|0)!=0;F=(p|0)!=0;do if(!(E&F)){if(E){G=((d[h>>0]|0)+8+(d[h+1>>0]|0)+(d[h+2>>0]|0)+(d[h+3>>0]|0)+(d[h+4>>0]|0)+(d[h+5>>0]|0)+(d[h+6>>0]|0)+(d[h+7>>0]|0)+(d[h+8>>0]|0)+(d[h+9>>0]|0)+(d[h+10>>0]|0)+(d[h+11>>0]|0)+(d[h+12>>0]|0)+(d[h+13>>0]|0)+(d[h+14>>0]|0)+(d[h+15>>0]|0)|0)>>>4;break}if(F)G=((d[l>>0]|0)+8+(d[g+2>>0]|0)+(d[g+3>>0]|0)+(d[g+4>>0]|0)+(d[g+5>>0]|0)+(d[g+6>>0]|0)+(d[g+7>>0]|0)+(d[g+8>>0]|0)+(d[g+9>>0]|0)+(d[g+10>>0]|0)+(d[g+11>>0]|0)+(d[g+12>>0]|0)+(d[g+13>>0]|0)+(d[g+14>>0]|0)+(d[g+15>>0]|0)+(d[g+16>>0]|0)|0)>>>4;else G=128}else{D=0;C=0;do{B=D;D=D+1|0;C=(d[g+D>>0]|0)+C+(d[h+B>>0]|0)|0}while((D|0)!=16);G=(C+16|0)>>>5}while(0);qd(e|0,G&255|0,256)|0}else{if(!((o|0)!=0&(p|0)!=0&(q|0)!=0)){r=1;i=k;return r|0}q=d[g+16>>0]|0;p=d[h+15>>0]|0;o=d[g>>0]|0;G=(((d[g+9>>0]|0)-(d[g+7>>0]|0)+((d[g+10>>0]|0)-(d[g+6>>0]|0)<<1)+(((d[g+11>>0]|0)-(d[g+5>>0]|0)|0)*3|0)+((d[g+12>>0]|0)-(d[g+4>>0]|0)<<2)+(((d[g+13>>0]|0)-(d[g+3>>0]|0)|0)*5|0)+(((d[g+14>>0]|0)-(d[g+2>>0]|0)|0)*6|0)+(((d[g+15>>0]|0)-(d[g+1>>0]|0)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(n){S=h+I|0;T=K;U=L;V=M;W=N;X=R;Y=Q;_=P;$=O;break}else{S=e+(J+-1)|0;T=K;U=L;V=M;W=N;X=R;Y=Q;_=P;$=O;break}}else{S=g+p|0;T=a[g+(p+1)>>0]|0;U=a[g+(p+2)>>0]|0;V=a[g+(p+3)>>0]|0;W=a[g+(p+4)>>0]|0;X=a[g+(p+8)>>0]|0;Y=a[g+(p+7)>>0]|0;_=a[g+(p+6)>>0]|0;$=a[g+(p+5)>>0]|0}while(0);n=a[S>>0]|0;switch(y|0){case 2:{do if(!u){if(m){aa=((o&255)+2+(F&255)+(G&255)+(H&255)|0)>>>2;break}if(s)aa=((W&255)+2+(V&255)+(U&255)+(T&255)|0)>>>2;else aa=128}else aa=((o&255)+4+(F&255)+(G&255)+(H&255)+(W&255)+(V&255)+(U&255)+(T&255)|0)>>>3;while(0);s=Z(aa&255,16843009)|0;O=s&255;P=s>>>8&255;Q=s>>>16&255;R=s>>>24&255;ba=R;ca=Q;da=P;ea=O;fa=R;ga=Q;ha=P;ia=O;ja=R;ka=Q;la=P;ma=O;na=s;break}case 7:{if(!t){oa=1;pa=51;break a}s=(z|0)==0;O=T&255;P=U&255;Q=V&255;R=(Q+1+P|0)>>>1&255;N=W&255;M=N+1|0;L=(M+Q|0)>>>1&255;K=(s?W:$)&255;J=(M+K|0)>>>1&255;M=Q+2|0;I=N+2|0;qa=(I+P+(Q<<1)|0)>>>2;Q=(M+(N<<1)+K|0)>>>2;N=(s?W:_)&255;ra=(I+N+(K<<1)|0)>>>2;ba=J;ca=L;da=R;ea=(P+1+O|0)>>>1&255;fa=ra&255;ga=Q&255;ha=qa&255;ia=(M+O+(P<<1)|0)>>>2&255;ja=(K+1+N|0)>>>1&255;ka=J;la=L;ma=R;na=ra<<16&16711680|qa&255|(K+2+((s?W:Y)&255)+(N<<1)|0)>>>2<<24|Q<<8&65280;break}case 0:{if(!t){oa=1;pa=51;break a}ba=W;ca=V;da=U;ea=T;fa=W;ga=V;ha=U;ia=T;ja=W;ka=V;la=U;ma=T;na=(V&255)<<16|(W&255)<<24|(U&255)<<8|T&255;break}case 1:{if(!m){oa=1;pa=51;break a}Q=Z(o&255,16843009)|0;N=Z(F&255,16843009)|0;s=Z(G&255,16843009)|0;ba=Q>>>24&255;ca=Q>>>16&255;da=Q>>>8&255;ea=Q&255;fa=N>>>24&255;ga=N>>>16&255;ha=N>>>8&255;ia=N&255;ja=s>>>24&255;ka=s>>>16&255;la=s>>>8&255;ma=s&255;na=Z(H&255,16843009)|0;break}case 3:{if(!t){oa=1;pa=51;break a}s=(z|0)==0;N=U&255;Q=V&255;K=Q+2|0;qa=W&255;ra=qa+2|0;R=(ra+N+(Q<<1)|0)>>>2&255;Q=(s?W:$)&255;L=(K+(qa<<1)+Q|0)>>>2&255;qa=(s?W:_)&255;J=(ra+qa+(Q<<1)|0)>>>2;ra=J&255;P=(s?W:Y)&255;O=(Q+2+P+(qa<<1)|0)>>>2;Q=O&255;M=(s?W:X)&255;s=(qa+2+M+(P<<1)|0)>>>2;ba=ra;ca=L;da=R;ea=(K+(T&255)+(N<<1)|0)>>>2&255;fa=Q;ga=ra;ha=L;ia=R;ja=s&255;ka=Q;la=ra;ma=L;na=(P+2+(M*3|0)|0)>>>2<<24|J&255|O<<8&65280|s<<16&16711680;break}case 6:{if(!(u&(A|0)!=0)){oa=1;pa=51;break a}s=n&255;O=o&255;J=O+1|0;M=(J+s|0)>>>1&255;P=F&255;L=((O<<1)+2+P+s|0)>>>2&255;ra=(J+P|0)>>>1&255;J=G&255;Q=O+2|0;O=(Q+(P<<1)+J|0)>>>2;R=(P+1+J|0)>>>1;N=H&255;K=T&255;qa=(Q+K+(s<<1)|0)>>>2&255;Q=U&255;ba=((V&255)+2+(Q<<1)+K|0)>>>2&255;ca=(Q+2+(K<<1)+s|0)>>>2&255;da=qa;ea=M;fa=qa;ga=M;ha=L;ia=ra;ja=L;ka=ra;la=O&255;ma=R&255;na=O<<24|R<<16&16711680|(J+1+N|0)>>>1&255|P+2+(J<<1)+N<<6&65280;break}case 4:{if(!(u&(A|0)!=0)){oa=1;pa=51;break a}N=T&255;J=n&255;P=o&255;R=N+2|0;O=(R+P+(J<<1)|0)>>>2;ra=O&255;L=U&255;M=J+2|0;J=((N<<1)+L+M|0)>>>2&255;N=V&255;qa=((L<<1)+N+R|0)>>>2&255;R=F&255;s=(R+(P<<1)+M|0)>>>2;M=s&255;K=G&255;Q=(P+2+(R<<1)+K|0)>>>2;ba=((W&255)+2+L+(N<<1)|0)>>>2&255;ca=qa;da=J;ea=ra;fa=qa;ga=J;ha=ra;ia=M;ja=J;ka=ra;la=M;ma=Q&255;na=(R+2+(K<<1)+(H&255)|0)>>>2&255|Q<<8&65280|O<<24|s<<16&16711680;break}case 5:{if(!(u&(A|0)!=0)){oa=1;pa=51;break a}s=n&255;O=T&255;Q=(O+1+s|0)>>>1&255;K=U&255;R=(K+2+(O<<1)+s|0)>>>2;M=o&255;ra=O+2|0;J=(ra+M+(s<<1)|0)>>>2;qa=(K+1+O|0)>>>1&255;O=V&255;N=((K<<1)+O+ra|0)>>>2;ra=(O+1+K|0)>>>1&255;L=W&255;P=F&255;ba=(L+1+O|0)>>>1&255;ca=ra;da=qa;ea=Q;fa=(L+2+K+(O<<1)|0)>>>2&255;ga=N&255;ha=R&255;ia=J&255;ja=ra;ka=qa;la=Q;ma=(P+2+(M<<1)+s|0)>>>2&255;na=N<<24|(M+2+(G&255)+(P<<1)|0)>>>2&255|R<<16&16711680|J<<8&65280;break}default:{if(!m){oa=1;pa=51;break a}J=o&255;R=F&255;P=G&255;M=(R+1+P|0)>>>1&255;N=H&255;s=(R+2+(P<<1)+N|0)>>>2&255;Q=(P+1+N|0)>>>1&255;qa=(P+2+(N*3|0)|0)>>>2&255;ba=s;ca=M;da=(J+2+(R<<1)+P|0)>>>2&255;ea=(J+1+R|0)>>>1&255;fa=qa;ga=Q;ha=s;ia=M;ja=H;ka=H;la=qa;ma=Q;na=N<<8|N|N<<16|N<<24}}N=(r<<4)+p|0;c[e+N>>2]=(ca&255)<<16|(ba&255)<<24|(da&255)<<8|ea&255;c[e+(N+16)>>2]=(ga&255)<<16|(fa&255)<<24|(ha&255)<<8|ia&255;c[e+(N+32)>>2]=(ka&255)<<16|(ja&255)<<24|(la&255)<<8|ma&255;c[e+(N+48)>>2]=na;Sb(e,f+(j<<6)+328|0,j);j=j+1|0;if(j>>>0>=16){oa=0;pa=51;break}}if((pa|0)==51){i=k;return oa|0}return 0}function Rb(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;l=i;m=b+200|0;n=zb(b,c[m>>2]|0)|0;o=(k|0)!=0;if((n|0)!=0&o){k=(cb(c[c[m>>2]>>2]|0)|0)==2;p=k?0:n}else p=n;n=b+204|0;k=zb(b,c[n>>2]|0)|0;if((k|0)!=0&o){m=(cb(c[c[n>>2]>>2]|0)|0)==2;q=m?0:k}else q=k;k=b+212|0;m=zb(b,c[k>>2]|0)|0;if((m|0)!=0&o){o=(cb(c[c[k>>2]>>2]|0)|0)==2;r=o?0:m}else r=m;m=(p|0)!=0;o=(q|0)!=0;k=m&o;b=k&(r|0)!=0;r=(p|0)==0;p=(q|0)==0;q=e;e=h;h=g;g=f;f=16;n=0;while(1){if((j|0)==2){if(p){s=1;t=29;break}else{u=q;v=h;w=8}while(1){v=v+1|0;w=w+-1|0;a[u>>0]=a[v>>0]|0;a[u+8>>0]=a[v>>0]|0;a[u+16>>0]=a[v>>0]|0;a[u+24>>0]=a[v>>0]|0;a[u+32>>0]=a[v>>0]|0;a[u+40>>0]=a[v>>0]|0;a[u+48>>0]=a[v>>0]|0;a[u+56>>0]=a[v>>0]|0;if(!w)break;else u=u+1|0}}else if(!j){x=h+1|0;do if(!k){if(o){y=((d[x>>0]|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e=e+8|0;h=h+9|0;g=g+256|0;f=f+4|0}}if((t|0)==29){i=l;return s|0}return 0}function Sb(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;h=c[e>>2]|0;if((h|0)==16777215){i=g;return}j=f>>>0<16;k=j?16:8;l=j?f:f&3;f=(Z(c[3408+(l<<2)>>2]|0,k)|0)+(c[3344+(l<<2)>>2]|0)|0;l=b+f|0;j=c[e+4>>2]|0;m=b+(f+1)|0;n=d[m>>0]|0;a[l>>0]=a[3472+(h+512+(d[l>>0]|0))>>0]|0;l=c[e+8>>2]|0;h=b+(f+2)|0;o=d[h>>0]|0;a[m>>0]=a[3472+(j+512+n)>>0]|0;n=b+(f+3)|0;j=a[3472+((c[e+12>>2]|0)+512+(d[n>>0]|0))>>0]|0;a[h>>0]=a[3472+(l+512+o)>>0]|0;a[n>>0]=j;j=f+k|0;f=b+j|0;n=c[e+20>>2]|0;o=b+(j+1)|0;l=d[o>>0]|0;a[f>>0]=a[3472+((c[e+16>>2]|0)+512+(d[f>>0]|0))>>0]|0;f=c[e+24>>2]|0;h=b+(j+2)|0;m=d[h>>0]|0;a[o>>0]=a[3472+(n+512+l)>>0]|0;l=b+(j+3)|0;n=a[3472+((c[e+28>>2]|0)+512+(d[l>>0]|0))>>0]|0;a[h>>0]=a[3472+(f+512+m)>>0]|0;a[l>>0]=n;n=j+k|0;j=b+n|0;l=c[e+36>>2]|0;m=b+(n+1)|0;f=d[m>>0]|0;a[j>>0]=a[3472+((c[e+32>>2]|0)+512+(d[j>>0]|0))>>0]|0;j=c[e+40>>2]|0;h=b+(n+2)|0;o=d[h>>0]|0;a[m>>0]=a[3472+(l+512+f)>>0]|0;f=b+(n+3)|0;l=a[3472+((c[e+44>>2]|0)+512+(d[f>>0]|0))>>0]|0;a[h>>0]=a[3472+(j+512+o)>>0]|0;a[f>>0]=l;l=n+k|0;k=b+l|0;n=c[e+52>>2]|0;f=b+(l+1)|0;o=d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>2]=-1;x=q+20|0;b[q+22>>1]=0;b[x>>1]=0;if((A|0)!=0?(c[A+4>>2]|0)==(w|0):0){E=c[A>>2]|0;c[B>>2]=1;if(E>>>0<6){E=A+172|0;B=e[E>>1]|e[E+2>>1]<<16;E=c[A+108>>2]|0;c[y>>2]=E;c[x>>2]=B;F=1;G=E}else{F=1;G=-1}}else{F=0;G=-1}do if(!s)if(!((C|0)==0|(F|0)==0)){if((D|0)==0?(c[z>>2]|0)==0:0){H=0;I=0;break}if((G|0)==0?(c[x>>2]|0)==0:0){H=0;I=0}else J=16}else{H=0;I=0}else J=16;while(0);if((J|0)==16){x=b[f+160>>1]|0;z=b[f+162>>1]|0;E=c[a+208>>2]|0;B=q+24|0;c[B>>2]=0;y=q+28|0;c[y>>2]=-1;A=q+32|0;K=q+34|0;b[K>>1]=0;b[A>>1]=0;if((E|0)!=0?(c[E+4>>2]|0)==(w|0):0){L=c[E>>2]|0;c[B>>2]=1;if(L>>>0<6){L=E+172|0;M=e[L>>1]|e[L+2>>1]<<16;c[y>>2]=c[E+108>>2];c[A>>2]=M}}else J=20;if((((J|0)==20?(M=c[a+212>>2]|0,c[B>>2]=0,c[y>>2]=-1,b[K>>1]=0,b[A>>1]=0,(M|0)!=0):0)?(c[M+4>>2]|0)==(w|0):0)?(K=c[M>>2]|0,c[B>>2]=1,K>>>0<6):0){K=M+192|0;B=e[K>>1]|e[K+2>>1]<<16;c[y>>2]=c[M+112>>2];c[A>>2]=B}Ub(p,q,t);B=(e[p>>1]|0)+(x&65535)|0;x=(e[p+2>>1]|0)+(z&65535)|0;if(((B<<16>>16)+8192|0)>>>0>16383){N=1;i=l;return N|0}if(((x<<16>>16)+2048|0)>>>0>4095){N=1;i=l;return N|0}else{H=B&65535;I=x&65535}}x=kc(g,t)|0;if(!x){N=1;i=l;return N|0}else{B=a+132|0;z=a+136|0;A=a+140|0;M=a+144|0;y=a+148|0;K=a+152|0;E=a+156|0;L=a+160|0;O=a+164|0;P=a+168|0;Q=a+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0;P=(E|0)==0;if((!P?(c[E+4>>2]|0)==(A|0):0)?(Q=c[E>>2]|0,c[L>>2]=1,Q>>>0<6):0){Q=E+172|0;L=e[Q>>1]|e[Q+2>>1]<<16;c[M>>2]=c[E+108>>2];c[O>>2]=L}L=q+24|0;c[L>>2]=0;O=q+28|0;c[O>>2]=-1;M=q+32|0;Q=q+34|0;b[Q>>1]=0;b[M>>1]=0;if(!P?(c[E+4>>2]|0)==(A|0):0){P=c[E>>2]|0;c[L>>2]=1;if(P>>>0<6){P=E+188|0;R=e[P>>1]|e[P+2>>1]<<16;c[O>>2]=c[E+112>>2];c[M>>2]=R}}else J=79;if((((J|0)==79?(R=c[a+212>>2]|0,c[L>>2]=0,c[O>>2]=-1,b[Q>>1]=0,b[M>>1]=0,(R|0)!=0):0)?(c[R+4>>2]|0)==(A|0):0)?(A=c[R>>2]|0,c[L>>2]=1,A>>>0<6):0){A=R+192|0;L=e[A>>1]|e[A+2>>1]<<16;c[O>>2]=c[R+112>>2];c[M>>2]=L}Ub(n,q,B);Y=c[n>>2]|0}L=(Y&65535)+(x&65535)|0;x=(Y>>>16)+(W&65535)|0;if(((L<<16>>16)+8192|0)>>>0>16383){N=1;i=l;return N|0}if(((x<<16>>16)+2048|0)>>>0>4095){N=1;i=l;return N|0}W=kc(g,B)|0;if(!W){N=1;i=l;return N|0}M=a+132|0;R=a+136|0;O=a+140|0;A=a+144|0;Q=a+164|0;E=a+168|0;P=a+172|0;S=a+176|0;b[a+176>>1]=L;b[a+178>>1]=x;x=e[S>>1]|e[S+2>>1]<<16;b[P>>1]=x;b[P+2>>1]=x>>>16;b[E>>1]=x;b[E+2>>1]=x>>>16;b[Q>>1]=x;b[Q+2>>1]=x>>>16;b[A>>1]=x;b[A+2>>1]=x>>>16;b[O>>1]=x;b[O+2>>1]=x>>>16;b[R>>1]=x;b[R+2>>1]=x>>>16;b[M>>1]=x;b[M+2>>1]=x>>>16;c[a+100>>2]=B;c[a+108>>2]=B;M=a+116|0;c[M>>2]=W;c[a+124>>2]=W;W=b[f+164>>1]|0;R=b[f+166>>1]|0;O=c[f+148>>2]|0;A=c[z>>2]|0;z=c[a+208>>2]|0;Q=q+24|0;c[Q>>2]=0;E=q+28|0;c[E>>2]=-1;P=q+32|0;S=q+34|0;b[S>>1]=0;b[P>>1]=0;if((z|0)!=0?(c[z+4>>2]|0)==(A|0):0){L=c[z>>2]|0;c[Q>>2]=1;if(L>>>0<6){L=z+172|0;T=e[L>>1]|e[L+2>>1]<<16;L=c[z+108>>2]|0;c[E>>2]=L;c[P>>2]=T;_=L}else _=-1}else{L=c[a+204>>2]|0;c[Q>>2]=0;c[E>>2]=-1;b[S>>1]=0;b[P>>1]=0;if(((L|0)!=0?(c[L+4>>2]|0)==(A|0):0)?(S=c[L>>2]|0,c[Q>>2]=1,S>>>0<6):0){S=L+176|0;Q=e[S>>1]|e[S+2>>1]<<16;S=c[L+108>>2]|0;c[E>>2]=S;c[P>>2]=Q;_=S}else _=-1}if((_|0)==(O|0)){S=c[P>>2]|0;c[n>>2]=S;$=S}else{c[q>>2]=1;c[y>>2]=B;c[K>>2]=x;x=c[a+204>>2]|0;K=q+12|0;c[K>>2]=0;B=q+16|0;c[B>>2]=-1;y=q+20|0;b[q+22>>1]=0;b[y>>1]=0;if(((x|0)!=0?(c[x+4>>2]|0)==(A|0):0)?(A=c[x>>2]|0,c[K>>2]=1,A>>>0<6):0){A=x+188|0;K=e[A>>1]|e[A+2>>1]<<16;c[B>>2]=c[x+112>>2];c[y>>2]=K}Ub(n,q,O);$=c[n>>2]|0}K=($&65535)+(W&65535)|0;W=($>>>16)+(R&65535)|0;if(((K<<16>>16)+8192|0)>>>0>16383){N=1;i=l;return N|0}if(((W<<16>>16)+2048|0)>>>0>4095){N=1;i=l;return N|0}R=kc(g,O)|0;if(!R){N=1;i=l;return N|0}else{y=a+148|0;x=a+152|0;B=a+156|0;A=a+160|0;S=a+180|0;P=a+184|0;Q=a+188|0;E=a+192|0;b[a+192>>1]=K;b[a+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>>2]=1;if(L>>>0<6){L=K+172|0;T=e[L>>1]|e[L+2>>1]<<16;c[P>>2]=c[K+108>>2];c[Q>>2]=T}}else J=42;if((((J|0)==42?(T=c[a+212>>2]|0,c[x>>2]=0,c[P>>2]=-1,b[E>>1]=0,b[Q>>1]=0,(T|0)!=0):0)?(c[T+4>>2]|0)==(W|0):0)?(W=c[T>>2]|0,c[x>>2]=1,W>>>0<6):0){W=T+192|0;x=e[W>>1]|e[W+2>>1]<<16;c[P>>2]=c[T+112>>2];c[Q>>2]=x}Ub(o,q,M);ba=c[o>>2]|0}x=(ba&65535)+(y&65535)|0;y=(ba>>>16)+(O&65535)|0;if(((x<<16>>16)+8192|0)>>>0>16383){N=1;i=l;return N|0}if(((y<<16>>16)+2048|0)>>>0>4095){N=1;i=l;return N|0}O=kc(g,M)|0;if(!O){N=1;i=l;return N|0}Q=a+132|0;T=a+136|0;P=a+140|0;W=a+144|0;E=a+148|0;K=a+152|0;L=a+156|0;z=a+160|0;b[a+160>>1]=x;b[a+162>>1]=y;y=e[z>>1]|e[z+2>>1]<<16;b[L>>1]=y;b[L+2>>1]=y>>>16;b[K>>1]=y;b[K+2>>1]=y>>>16;b[E>>1]=y;b[E+2>>1]=y>>>16;b[W>>1]=y;b[W+2>>1]=y>>>16;b[P>>1]=y;b[P+2>>1]=y>>>16;b[T>>1]=y;b[T+2>>1]=y>>>16;b[Q>>1]=y;b[Q+2>>1]=y>>>16;c[a+100>>2]=M;c[a+104>>2]=M;Q=a+116|0;c[Q>>2]=O;c[a+120>>2]=O;O=b[f+164>>1]|0;T=b[f+166>>1]|0;P=c[f+148>>2]|0;W=c[R>>2]|0;R=c[a+200>>2]|0;c[q>>2]=0;E=q+4|0;c[E>>2]=-1;K=q+8|0;b[q+10>>1]=0;b[K>>1]=0;L=(R|0)==0;if((!L?(c[R+4>>2]|0)==(W|0):0)?(z=c[R>>2]|0,c[q>>2]=1,z>>>0<6):0){z=R+184|0;x=e[z>>1]|e[z+2>>1]<<16;z=c[R+112>>2]|0;c[E>>2]=z;c[K>>2]=x;ca=z}else ca=-1;if((ca|0)==(P|0)){z=c[K>>2]|0;c[o>>2]=z;da=z}else{c[B>>2]=1;c[A>>2]=M;c[S>>2]=y;y=q+24|0;c[y>>2]=0;S=q+28|0;c[S>>2]=-1;M=q+32|0;b[q+34>>1]=0;b[M>>1]=0;if((!L?(c[R+4>>2]|0)==(W|0):0)?(W=c[R>>2]|0,c[y>>2]=1,W>>>0<6):0){W=R+160|0;y=e[W>>1]|e[W+2>>1]<<16;c[S>>2]=c[R+104>>2];c[M>>2]=y}Ub(o,q,P);da=c[o>>2]|0}y=(da&65535)+(O&65535)|0;O=(da>>>16)+(T&65535)|0;if(((y<<16>>16)+8192|0)>>>0>16383){N=1;i=l;return N|0}if(((O<<16>>16)+2048|0)>>>0>4095){N=1;i=l;return N|0}T=kc(g,P)|0;if(!T){N=1;i=l;return N|0}else{M=a+164|0;R=a+168|0;S=a+172|0;W=a+176|0;L=a+180|0;A=a+184|0;B=a+188|0;z=a+192|0;b[a+192>>1]=y;b[a+194>>1]=O;O=e[z>>1]|e[z+2>>1]<<16;b[B>>1]=O;b[B+2>>1]=O>>>16;b[A>>1]=O;b[A+2>>1]=O>>>16;b[L>>1]=O;b[L+2>>1]=O>>>16;b[W>>1]=O;b[W+2>>1]=O>>>16;b[S>>1]=O;b[S+2>>1]=O>>>16;b[R>>1]=O;b[R+2>>1]=O>>>16;b[M>>1]=O;b[M+2>>1]=O>>>16;c[a+108>>2]=P;c[a+112>>2]=P;P=a+124|0;c[P>>2]=T;c[a+128>>2]=T;c[r>>2]=c[Q>>2];fc(k,a+132|0,r,v,u,0,0,16,8);c[r>>2]=c[P>>2];fc(k,M,r,v,u,0,8,16,8);break}}else{M=a+4|0;P=q+4|0;Q=q+8|0;T=q+10|0;O=q+12|0;R=q+16|0;S=q+20|0;W=q+22|0;L=q+24|0;A=q+28|0;B=q+32|0;z=q+34|0;y=m+2|0;K=0;a:while(1){x=f+(K<<2)+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]|0;ua=d[5264+(K<<7)+(pa<<5)+(ga<<3)+4>>0]|0;c[L>>2]=0;c[A>>2]=-1;b[z>>1]=0;b[B>>1]=0;if((sa|0)!=0?(c[sa+4>>2]|0)==(ra|0):0){ra=c[sa>>2]|0;c[L>>2]=1;if(ra>>>0<6){ra=sa+(ua<<2)+132|0;ta=e[ra>>1]|e[ra+2>>1]<<16;c[A>>2]=c[sa+(ua>>>2<<2)+100>>2];c[B>>2]=ta}}else J=122;if((((J|0)==122?(J=0,ta=ub(a,c[4752+(K<<7)+(pa<<5)+(ga<<3)>>2]|0)|0,ua=c[M>>2]|0,sa=d[4752+(K<<7)+(pa<<5)+(ga<<3)+4>>0]|0,c[L>>2]=0,c[A>>2]=-1,b[z>>1]=0,b[B>>1]=0,(ta|0)!=0):0)?(c[ta+4>>2]|0)==(ua|0):0)?(ua=c[ta>>2]|0,c[L>>2]=1,ua>>>0<6):0){ua=ta+(sa<<2)+132|0;ra=e[ua>>1]|e[ua+2>>1]<<16;c[A>>2]=c[ta+(sa>>>2<<2)+100>>2];c[B>>2]=ra}Ub(m,q,qa);qa=(e[m>>1]|0)+(na&65535)|0;na=qa&65535;ra=(e[y>>1]|0)+(oa&65535)|0;oa=ra&65535;if(((qa<<16>>16)+8192|0)>>>0>16383){N=1;J=146;break a}if(((ra<<16>>16)+2048|0)>>>0>4095){N=1;J=146;break a}if(!pa){b[ea>>1]=na;b[fa>>1]=oa;b[ha>>1]=na;b[ia>>1]=oa;b[ja>>1]=na;b[ka>>1]=oa;b[la>>1]=na;b[ma>>1]=oa}else if((pa|0)==1){ra=(ga<<1)+V|0;b[a+(ra<<2)+132>>1]=na;b[a+(ra<<2)+134>>1]=oa;qa=ra|1;b[a+(qa<<2)+132>>1]=na;b[a+(qa<<2)+134>>1]=oa}else if((pa|0)==2){qa=ga+V|0;b[a+(qa<<2)+132>>1]=na;b[a+(qa<<2)+134>>1]=oa;ra=qa+2|0;b[a+(ra<<2)+132>>1]=na;b[a+(ra<<2)+134>>1]=oa}else if((pa|0)==3){pa=ga+V|0;b[a+(pa<<2)+132>>1]=na;b[a+(pa<<2)+134>>1]=oa}ga=ga+1|0}while(ga>>>0<E>>>0)}K=K+1|0;if(K>>>0>=4){J=135;break}}if((J|0)==135){K=0;do{c[r>>2]=c[a+(K<<2)+116>>2];y=hb(c[f+(K<<2)+176>>2]|0)|0;B=K<<3&8;A=K>>>0<2?0:8;if(!y)fc(k,a+(K<<2<<2)+132|0,r,v,u,B,A,8,8);else if((y|0)==1){L=K<<2;fc(k,a+(L<<2)+132|0,r,v,u,B,A,8,4);fc(k,a+((L|2)<<2)+132|0,r,v,u,B,A|4,8,4)}else if((y|0)==2){y=K<<2;fc(k,a+(y<<2)+132|0,r,v,u,B,A,4,8);fc(k,a+((y|1)<<2)+132|0,r,v,u,B|4,A,4,8)}else{y=K<<2;fc(k,a+(y<<2)+132|0,r,v,u,B,A,4,4);L=B|4;fc(k,a+((y|1)<<2)+132|0,r,v,u,L,A,4,4);z=A|4;fc(k,a+((y|2)<<2)+132|0,r,v,u,B,z,4,4);fc(k,a+((y|3)<<2)+132|0,r,v,u,L,z,4,4)}K=K+1|0}while((K|0)!=4)}else if((J|0)==146){i=l;return N|0}}while(0);if((c[a+196>>2]|0)>>>0>1){N=0;i=l;return N|0}if(!(c[a>>2]|0)){vc(j,k);N=0;i=l;return N|0}else{wc(j,h,k,f+328|0);N=0;i=l;return N|0}return 0}function Ub(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;g=i;if(((c[d+12>>2]|0)==0?(c[d+24>>2]|0)==0:0)?(c[d>>2]|0)!=0:0){h=d+8|0;j=e[h>>1]|e[h+2>>1]<<16;b[a>>1]=j;b[a+2>>1]=j>>>16;i=g;return}j=(c[d+4>>2]|0)==(f|0);h=(c[d+16>>2]|0)==(f|0);if(((h&1)+(j&1)+((c[d+28>>2]|0)==(f|0)&1)|0)==1){if(j){j=d+8|0;f=e[j>>1]|e[j+2>>1]<<16;b[a>>1]=f;b[a+2>>1]=f>>>16;i=g;return}if(h){h=d+20|0;f=e[h>>1]|e[h+2>>1]<<16;b[a>>1]=f;b[a+2>>1]=f>>>16;i=g;return}else{f=d+32|0;h=e[f>>1]|e[f+2>>1]<<16;b[a>>1]=h;b[a+2>>1]=h>>>16;i=g;return}}h=b[d+8>>1]|0;f=h<<16>>16;j=b[d+20>>1]|0;k=j<<16>>16;l=b[d+32>>1]|0;if(j<<16>>16>h<<16>>16){m=k;n=f}else{m=f;n=(k|0)<(f|0)?k:f}if((m|0)<(l|0))o=m;else o=(n|0)>(l|0)?n:l;b[a>>1]=o;o=b[d+10>>1]|0;l=o<<16>>16;n=b[d+22>>1]|0;m=n<<16>>16;f=b[d+34>>1]|0;if(n<<16>>16>o<<16>>16){p=m;q=l}else{p=l;q=(m|0)<(l|0)?m:l}if((p|0)<(f|0))r=p;else r=(q|0)>(f|0)?q:f;b[a+2>>1]=r;i=g;return}function Vb(b,c,e,f,g,h,j,k,l){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;m=i;i=i+144|0;n=m;if((e|0)>=0?!((e+1+k|0)>>>0>g>>>0|(f|0)<0|(l+f|0)>>>0>h>>>0):0){o=b;p=e;q=f;r=g;s=h}else{t=k+1|0;Wb(b,n,e,f,g,h,t,l,t);Wb(b+(Z(h,g)|0)|0,n+(Z(t,l)|0)|0,e,f,g,h,t,l,t);o=n;p=0;q=0;r=t;s=l}t=8-j|0;n=l>>>1;l=(n|0)==0;h=k>>>1;g=(h|0)==0;f=16-k|0;e=(r<<1)-k|0;k=r+1|0;b=r+2|0;u=h<<1;if(l){i=m;return}v=c;w=o+((Z(q,r)|0)+p)|0;x=n;while(1){if(g){y=v;z=w}else{A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0?0-g|0:c;c=(o|0)>(f|0)?f:o;o=(d|0)>(e|0)?e:d;d=o+g|0;l=c+h|0;if((o|0)>0)p=a+o|0;else p=a;if((c|0)>0)q=p+(Z(c,e)|0)|0;else q=p;p=(o|0)<0?0-o|0:0;o=(d|0)>(e|0)?d-e|0:0;d=g-p-o|0;g=0-c|0;a=(c|0)<0?g:0;c=l-f|0;r=(l|0)>(f|0)?c:0;l=h-a|0;s=l-r|0;if(!a)t=b;else{a=h+-1-((m|0)>0?m:0)|0;u=~f;v=(a|0)>(u|0)?a:u;u=~v;a=Z(v+((u|0)>0?u:0)+1|0,j)|0;u=b;v=g;while(1){xa[n&3](q,u,p,d,o);v=v+-1|0;if(!v)break;else u=u+j|0}t=b+a|0}if((l|0)==(r|0)){w=t;x=q}else{l=h+-1|0;a=l-((m|0)>0?m:0)|0;m=~f;b=(a|0)>(m|0)?a:m;m=l-b|0;l=~b;a=h+f+-1-((m|0)<(f|0)?f:m)-b-((l|0)>0?l:0)|0;l=Z(a,j)|0;b=Z(a,e)|0;a=t;m=q;f=s;while(1){xa[n&3](m,a,p,d,o);f=f+-1|0;if(!f)break;else{a=a+j|0;m=m+e|0}}w=t+l|0;x=q+b|0}b=x+(0-e)|0;if(!r){i=k;return}else{y=w;z=c}while(1){xa[n&3](b,y,p,d,o);z=z+-1|0;if(!z)break;else y=y+j|0}i=k;return}function Xb(b,c,e,f,g,h,j,k,l){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;m=i;i=i+144|0;n=m;if(((e|0)>=0?!((k+e|0)>>>0>g>>>0|(f|0)<0):0)?(f+1+l|0)>>>0<=h>>>0:0){o=b;p=e;q=f;r=g;s=h}else{t=l+1|0;Wb(b,n,e,f,g,h,k,t,k);Wb(b+(Z(h,g)|0)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]=((Z(O,v)|0)+32+(Z(L,j)|0)|0)>>>6;a[I+1>>0]=P;E=E+-1|0;if(!E)break;else I=I+2|0}F=H;G=C+z|0}D=D+-1|0;if(!D)break;else{B=F+e|0;C=G+b|0}}}A=A+1|0}while((A|0)!=2);i=n;return}function Zb(b,c,e,f,g,h,j,k){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;l=i;i=i+448|0;m=l;if(((e|0)>=0?!((j+e|0)>>>0>g>>>0|(f|0)<0):0)?(f+5+k|0)>>>0<=h>>>0:0){n=b;o=e;p=f;q=g}else{Wb(b,m,e,f,g,h,j,k+5|0,j);n=m;o=0;p=0;q=j}m=o+q+(Z(p,q)|0)|0;p=k>>>2;if(!p){i=l;return}k=(j|0)==0;o=(q<<2)-j|0;h=64-j|0;g=0-q|0;f=g<<1;e=q<<1;b=c;c=p;p=n+m|0;r=n+(m+(q*5|0))|0;while(1){if(k){s=b;t=p;u=r}else{m=b+j|0;n=b;v=j;w=p;x=r;while(1){y=d[x+f>>0]|0;z=d[x+g>>0]|0;A=d[x+q>>0]|0;B=d[x>>0]|0;C=A+y|0;D=d[w+e>>0]|0;a[n+48>>0]=a[((d[x+e>>0]|0)+16-C-(C<<2)+D+((B+z|0)*20|0)>>5)+3984>>0]|0;C=D+B|0;E=d[w+q>>0]|0;a[n+32>>0]=a[(A+16-C-(C<<2)+E+((z+y|0)*20|0)>>5)+3984>>0]|0;C=E+z|0;A=d[w>>0]|0;a[n+16>>0]=a[(B+16-C-(C<<2)+A+((D+y|0)*20|0)>>5)+3984>>0]|0;C=A+y|0;a[n>>0]=a[(z+16-C-(C<<2)+(d[w+g>>0]|0)+((E+D|0)*20|0)>>5)+3984>>0]|0;v=v+-1|0;if(!v)break;else{n=n+1|0;w=w+1|0;x=x+1|0}}s=m;t=p+j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+(d[A+g>>0]|0)|0)>>>1;y=y+-1|0;if(!y)break;else{x=x+1|0;z=z+1|0;A=A+1|0;B=B+1|0}}t=o;u=q+j|0;v=n;w=l+j|0}c=c+-1|0;if(!c)break;else{b=t+h|0;q=u+p|0;s=v+p|0;l=w+p|0}}i=m;return}function $b(b,c,e,f,g,h,j,k){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;l=i;i=i+448|0;m=l;if((e|0)>=0?!((e+5+j|0)>>>0>g>>>0|(f|0)<0|(k+f|0)>>>0>h>>>0):0){n=b;o=e;p=f;q=g}else{r=j+5|0;Wb(b,m,e,f,g,h,r,k,r);n=m;o=0;p=0;q=r}if(!k){i=l;return}r=j>>>2;m=(r|0)==0;h=q-j|0;g=16-j|0;j=r<<2;f=c;c=n+(o+5+(Z(p,q)|0))|0;q=k;while(1){if(m){s=f;t=c}else{k=f+j|0;p=f;o=c;n=d[c+-1>>0]|0;e=d[c+-2>>0]|0;b=d[c+-3>>0]|0;u=d[c+-4>>0]|0;v=d[c+-5>>0]|0;w=r;while(1){x=u+n|0;y=u;u=d[o>>0]|0;a[p>>0]=a[(v+16-x-(x<<2)+u+((b+e|0)*20|0)>>5)+3984>>0]|0;x=u+b|0;z=b;b=d[o+1>>0]|0;a[p+1>>0]=a[(y+16-x-(x<<2)+b+((e+n|0)*20|0)>>5)+3984>>0]|0;x=b+e|0;y=e;e=d[o+2>>0]|0;a[p+2>>0]=a[(z+16-x-(x<<2)+e+((u+n|0)*20|0)>>5)+3984>>0]|0;x=e+n|0;z=d[o+3>>0]|0;a[p+3>>0]=a[(y+16-x-(x<<2)+z+((b+u|0)*20|0)>>5)+3984>>0]|0;w=w+-1|0;if(!w)break;else{x=n;p=p+4|0;o=o+4|0;n=z;v=x}}s=k;t=c+j|0}q=q+-1|0;if(!q)break;else{f=s+g|0;c=t+h|0}}i=l;return}function ac(b,c,e,f,g,h,j,k,l){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;m=i;i=i+448|0;n=m;if((e|0)>=0?!((e+5+j|0)>>>0>g>>>0|(f|0)<0|(k+f|0)>>>0>h>>>0):0){o=b;p=e;q=f;r=g}else{s=j+5|0;Wb(b,n,e,f,g,h,s,k,s);o=n;p=0;q=0;r=s}if(!k){i=m;return}s=j>>>2;n=(s|0)==0;h=r-j|0;g=16-j|0;j=(l|0)!=0;l=s<<2;f=c;c=o+(p+5+(Z(q,r)|0))|0;r=k;while(1){if(n){t=f;u=c}else{k=f+l|0;q=f;p=c;o=d[c+-1>>0]|0;e=d[c+-2>>0]|0;b=d[c+-3>>0]|0;v=d[c+-4>>0]|0;w=d[c+-5>>0]|0;x=s;while(1){y=v+o|0;z=v;v=d[p>>0]|0;a[q>>0]=((j?e:b)+1+(d[(w+16-y-(y<<2)+v+((b+e|0)*20|0)>>5)+3984>>0]|0)|0)>>>1;y=v+b|0;A=b;b=d[p+1>>0]|0;a[q+1>>0]=((j?o:e)+1+(d[(z+16-y-(y<<2)+b+((e+o|0)*20|0)>>5)+3984>>0]|0)|0)>>>1;y=b+e|0;z=e;e=d[p+2>>0]|0;a[q+2>>0]=((j?v:o)+1+(d[(A+16-y-(y<<2)+e+((v+o|0)*20|0)>>5)+3984>>0]|0)|0)>>>1;y=e+o|0;A=d[p+3>>0]|0;a[q+3>>0]=((j?b:v)+1+(d[(z+16-y-(y<<2)+A+((b+v|0)*20|0)>>5)+3984>>0]|0)|0)>>>1;x=x+-1|0;if(!x)break;else{y=o;q=q+4|0;p=p+4|0;o=A;w=y}}t=k;u=c+l|0}r=r+-1|0;if(!r)break;else{f=t+g|0;c=u+h|0}}i=m;return}function bc(b,c,e,f,g,h,j,k,l){b=b|0;c=c|0;e=e|0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return}l=(k|0)==0;y=64-k|0;g=k*3|0;x=0-k|0;h=x<<1;t=k<<1;j=e;e=p+(k<<2)|0;w=p+((Z(m+2|0,k)|0)+k<<2)|0;m=p+(k*6<<2)|0;p=o;while(1){if(l){F=j;G=e;H=w;I=m}else{o=w+(k<<2)|0;v=j+k|0;A=j;q=e;r=w;s=m;B=k;while(1){z=c[s+(h<<2)>>2]|0;b=c[s+(x<<2)>>2]|0;f=c[s+(k<<2)>>2]|0;C=c[s>>2]|0;E=f+z|0;D=c[q+(t<<2)>>2]|0;a[A+48>>0]=((d[((c[s+(t<<2)>>2]|0)+512-E-(E<<2)+D+((C+b|0)*20|0)>>10)+3984>>0]|0)+1+(d[((c[r+(t<<2)>>2]|0)+16>>5)+3984>>0]|0)|0)>>>1;E=D+C|0;J=c[q+(k<<2)>>2]|0;a[A+32>>0]=((d[(f+512-E-(E<<2)+J+((b+z|0)*20|0)>>10)+3984>>0]|0)+1+(d[((c[r+(k<<2)>>2]|0)+16>>5)+3984>>0]|0)|0)>>>1;E=c[q>>2]|0;f=J+b|0;a[A+16>>0]=((d[(C+512-f-(f<<2)+E+((D+z|0)*20|0)>>10)+3984>>0]|0)+1+(d[((c[r>>2]|0)+16>>5)+3984>>0]|0)|0)>>>1;f=E+z|0;a[A>>0]=((d[(b+512-f-(f<<2)+(c[q+(x<<2)>>2]|0)+((J+D|0)*20|0)>>10)+3984>>0]|0)+1+(d[((c[r+(x<<2)>>2]|0)+16>>5)+3984>>0]|0)|0)>>>1;B=B+-1|0;if(!B)break;else{A=A+1|0;q=q+4|0;r=r+4|0;s=s+4|0}}F=v;G=e+(k<<2)|0;H=o;I=m+(k<<2)|0}p=p+-1|0;if(!p)break;else{j=F+y|0;e=G+(g<<2)|0;w=H+(g<<2)|0;m=I+(g<<2)|0}}i=n;return}function ec(b,e,f,g,h,j,k,l,m){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=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0;q=c[m+-12>>2]|0;g=c[m+-16>>2]|0;w=c[m+-20>>2]|0;u=j;while(1){b=g+x|0;v=g;g=c[A>>2]|0;a[y>>0]=((d[(w+512-b-(b<<2)+g+((q+o|0)*20|0)>>10)+3984>>0]|0)+1+(d[((c[h>>2]|0)+16>>5)+3984>>0]|0)|0)>>>1;b=g+q|0;f=q;q=c[A+4>>2]|0;a[y+1>>0]=((d[(v+512-b-(b<<2)+q+((o+x|0)*20|0)>>10)+3984>>0]|0)+1+(d[((c[h+4>>2]|0)+16>>5)+3984>>0]|0)|0)>>>1;b=q+o|0;v=o;o=c[A+8>>2]|0;a[y+2>>0]=((d[(f+512-b-(b<<2)+o+((g+x|0)*20|0)>>10)+3984>>0]|0)+1+(d[((c[h+8>>2]|0)+16>>5)+3984>>0]|0)|0)>>>1;b=o+x|0;f=c[A+12>>2]|0;a[y+3>>0]=((d[(v+512-b-(b<<2)+f+((q+g|0)*20|0)>>10)+3984>>0]|0)+1+(d[((c[h+12>>2]|0)+16>>5)+3984>>0]|0)|0)>>>1;u=u+-1|0;if(!u)break;else{b=x;y=y+4|0;h=h+16|0;A=A+16|0;x=f;w=b}}N=B+k|0;O=l;P=m+(k<<2)|0}p=p+-1|0;if(!p)break;else{B=N+z|0;e=O+20|0;m=P+20|0}}i=n;return}function fc(a,d,e,f,g,h,j,k,l){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;m=i;n=a+((j<<4)+h)|0;o=b[d>>1]|0;p=d+2|0;q=b[p>>1]|0;r=e+4|0;s=c[r>>2]<<4;t=e+8|0;u=c[t>>2]<<4;v=h+f|0;f=v+(o>>2)|0;w=j+g|0;g=w+(q>>2)|0;do switch(c[6800+((o&3)<<4)+((q&3)<<2)>>2]|0){case 2:{Zb(c[e>>2]|0,n,f,g+-2|0,s,u,k,l);break}case 0:{Wb(c[e>>2]|0,n,f,g,s,u,k,l,16);break}case 1:{_b(c[e>>2]|0,n,f,g+-2|0,s,u,k,l,0);break}case 4:{ac(c[e>>2]|0,n,f+-2|0,g,s,u,k,l,0);break}case 10:{cc(c[e>>2]|0,n,f+-2|0,g+-2|0,s,u,k,l);break}case 6:{ec(c[e>>2]|0,n,f+-2|0,g+-2|0,s,u,k,l,0);break}case 7:{bc(c[e>>2]|0,n,f+-2|0,g+-2|0,s,u,k,l,2);break}case 8:{$b(c[e>>2]|0,n,f+-2|0,g,s,u,k,l);break}case 12:{ac(c[e>>2]|0,n,f+-2|0,g,s,u,k,l,1);break}case 5:{bc(c[e>>2]|0,n,f+-2|0,g+-2|0,s,u,k,l,0);break}case 9:{dc(c[e>>2]|0,n,f+-2|0,g+-2|0,s,u,k,l,0);break}case 13:{bc(c[e>>2]|0,n,f+-2|0,g+-2|0,s,u,k,l,1);break}case 11:{dc(c[e>>2]|0,n,f+-2|0,g+-2|0,s,u,k,l,1);break}case 3:{_b(c[e>>2]|0,n,f,g+-2|0,s,u,k,l,1);break}case 14:{ec(c[e>>2]|0,n,f+-2|0,g+-2|0,s,u,k,l,1);break}default:bc(c[e>>2]|0,n,f+-2|0,g+-2|0,s,u,k,l,3)}while(0);u=(h>>>1)+256+(j>>>1<<3)|0;j=a+u|0;h=c[r>>2]|0;r=h<<3;s=c[t>>2]|0;t=s<<3;g=b[d>>1]|0;d=(g>>3)+(v>>>1)|0;v=b[p>>1]|0;p=(v>>3)+(w>>>1)|0;w=g&7;g=v&7;v=k>>>1;k=l>>>1;l=c[e>>2]|0;e=Z(h<<8,s)|0;s=l+e|0;h=(w|0)!=0;f=(g|0)!=0;if(h&f){Yb(s,j,d,p,r,t,w,g,v,k);i=m;return}if(h){Vb(s,j,d,p,r,t,w,v,k);i=m;return}if(f){Xb(s,j,d,p,r,t,g,v,k);i=m;return}else{Wb(s,j,d,p,r,t,v,k,8);Wb(l+((Z(t,r)|0)+e)|0,a+(u+64)|0,d,p,r,t,v,k,8);i=m;return}}function gc(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;if(!d)h=c;else{qd(c|0,a[b>>0]|0,d|0)|0;h=c+d|0}if(!e){j=b;k=h}else{d=h+e|0;c=e;l=b;m=h;while(1){a[m>>0]=a[l>>0]|0;c=c+-1|0;if(!c)break;else{l=l+1|0;m=m+1|0}}j=b+e|0;k=d}if(!f){i=g;return}qd(k|0,a[j+-1>>0]|0,f|0)|0;i=g;return}function hc(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;e=i;kd(b,a,d);i=e;return}function ic(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;f=i;g=c[a+40>>2]|0;if(g){h=c[a>>2]|0;j=a+32|0;k=0;do{if(((c[h+(k*40|0)+20>>2]|0)+-1|0)>>>0<2){l=c[h+(k*40|0)+12>>2]|0;if(l>>>0>d>>>0)m=l-(c[j>>2]|0)|0;else m=l;c[h+(k*40|0)+8>>2]=m}k=k+1|0}while((k|0)!=(g|0))}if(!(c[b>>2]|0)){n=0;i=f;return n|0}g=c[b+4>>2]|0;if(g>>>0>=3){n=0;i=f;return n|0}k=a+32|0;m=a+24|0;h=a+4|0;j=g;g=d;l=0;while(1){a:do if(j>>>0<2){o=c[b+(l*12|0)+8>>2]|0;if(!j){p=g-o|0;if((p|0)<0)q=(c[k>>2]|0)+p|0;else q=p}else{p=o+g|0;o=c[k>>2]|0;q=p-((p|0)<(o|0)?0:o)|0}if(q>>>0>d>>>0)r=q-(c[k>>2]|0)|0;else r=q;o=c[m>>2]|0;p=0;while(1){s=p>>>0<o>>>0;t=0;while(1){if(!(s&(t|0)==0)){u=t;v=p;w=q;break a}x=c[a>>2]|0;if(((c[x+(p*40|0)+20>>2]|0)+-1|0)>>>0>=2)break;if((c[x+(p*40|0)+8>>2]|0)==(r|0))t=1;else break}p=p+1|0}}else{p=c[b+(l*12|0)+12>>2]|0;o=c[m>>2]|0;t=0;while(1){s=t>>>0<o>>>0;x=0;while(1){if(!(s&(x|0)==0)){u=x;v=t;w=g;break a}y=c[a>>2]|0;if((c[y+(t*40|0)+20>>2]|0)!=3)break;if((c[y+(t*40|0)+8>>2]|0)==(p|0))x=1;else break}t=t+1|0}}while(0);t=(u|0)==0?-1:v;if((t|0)<0){n=1;z=40;break}p=c[a>>2]|0;if((c[p+(t*40|0)+20>>2]|0)>>>0<=1){n=1;z=40;break}if(l>>>0<e>>>0){o=e;do{x=o;o=o+-1|0;s=c[h>>2]|0;c[s+(x<<2)>>2]=c[s+(o<<2)>>2]}while(o>>>0>l>>>0);A=c[a>>2]|0}else A=p;c[(c[h>>2]|0)+(l<<2)>>2]=A+(t*40|0);l=l+1|0;if(l>>>0<=e>>>0){o=l;s=l;while(1){x=c[h>>2]|0;y=c[x+(o<<2)>>2]|0;if((y|0)==((c[a>>2]|0)+(t*40|0)|0))B=s;else{c[x+(s<<2)>>2]=y;B=s+1|0}o=o+1|0;if(o>>>0>e>>>0)break;else s=B}}j=c[b+(l*12|0)+4>>2]|0;if(j>>>0>=3){n=0;z=40;break}else g=w}if((z|0)==40){i=f;return n|0}return 0}function jc(a,b,d,e,f,g,h,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0;k=i;l=a+8|0;m=c[l>>2]|0;if((c[d>>2]|0)!=(c[m>>2]|0)){n=1;i=k;return n|0}d=a+52|0;c[d>>2]=0;o=a+56|0;p=(c[o>>2]|0)==0;q=p&1;do if(!b){c[m+20>>2]=0;c[m+12>>2]=e;c[m+8>>2]=e;c[m+16>>2]=f;c[m+24>>2]=q;if(p){r=a+44|0;c[r>>2]=(c[r>>2]|0)+1;s=0}else s=0}else{if(g){r=a+20|0;c[r>>2]=0;t=a+16|0;c[t>>2]=0;u=c[a>>2]|0;v=a+44|0;w=0;do{x=u+(w*40|0)+20|0;if((c[x>>2]|0)!=0?(c[x>>2]=0,(c[u+(w*40|0)+24>>2]|0)==0):0)c[v>>2]=(c[v>>2]|0)+-1;w=w+1|0}while((w|0)!=16);do{}while((tc(a)|0)==0);w=a+40|0;c[w>>2]=0;u=a+36|0;c[u>>2]=65535;c[a+48>>2]=0;if(!((c[b>>2]|0)==0?(c[o>>2]|0)==0:0)){c[t>>2]=0;c[r>>2]=0}x=(c[b+4>>2]|0)==0;y=c[l>>2]|0;c[y+20>>2]=x?2:3;c[u>>2]=x?65535:0;c[y+12>>2]=0;c[y+8>>2]=0;c[y+16>>2]=0;c[y+24>>2]=q;c[v>>2]=1;c[w>>2]=1;s=0;break}if(!(c[b+8>>2]|0)){w=a+40|0;y=c[w>>2]|0;x=c[a+24>>2]|0;if(y>>>0>=x>>>0)if(y){u=c[a>>2]|0;z=0;A=-1;B=0;while(1){if(((c[u+(z*40|0)+20>>2]|0)+-1|0)>>>0<2){C=c[u+(z*40|0)+8>>2]|0;D=(C|0)<(B|0)|(A|0)==-1;E=D?z:A;F=D?C:B}else{E=A;F=B}z=z+1|0;if((z|0)==(y|0))break;else{A=E;B=F}}if((E|0)>-1){B=y+-1|0;c[u+(E*40|0)+20>>2]=0;c[w>>2]=B;if(!(c[u+(E*40|0)+24>>2]|0)){A=a+44|0;c[A>>2]=(c[A>>2]|0)+-1;G=e;H=B;I=x;J=0}else{G=e;H=B;I=x;J=0}}else{G=e;H=y;I=x;J=1}}else{G=e;H=0;I=x;J=1}else{G=e;H=y;I=x;J=0}}else{B=a+24|0;A=a+40|0;z=a+44|0;v=a+36|0;r=a+48|0;t=e;C=0;D=0;a:while(1){switch(c[b+(C*20|0)+12>>2]|0){case 6:{K=c[b+(C*20|0)+24>>2]|0;L=c[v>>2]|0;if((L|0)==65535|L>>>0<K>>>0){M=1;N=90;break a}L=c[B>>2]|0;b:do if(L){O=c[a>>2]|0;P=0;while(1){Q=O+(P*40|0)+20|0;if((c[Q>>2]|0)==3?(c[O+(P*40|0)+8>>2]|0)==(K|0):0)break;R=P+1|0;if(R>>>0<L>>>0)P=R;else{S=L;N=77;break b}}c[Q>>2]=0;R=(c[A>>2]|0)+-1|0;c[A>>2]=R;if(!(c[O+(P*40|0)+24>>2]|0)){c[z>>2]=(c[z>>2]|0)+-1;T=R;U=L}else{T=R;U=L}}else{S=0;N=77}while(0);if((N|0)==77){N=0;T=c[A>>2]|0;U=S}if(T>>>0>=U>>>0){M=1;N=90;break a}L=c[l>>2]|0;c[L+12>>2]=t;c[L+8>>2]=K;c[L+16>>2]=f;c[L+20>>2]=3;c[L+24>>2]=(c[o>>2]|0)==0&1;c[A>>2]=T+1;c[z>>2]=(c[z>>2]|0)+1;V=t;W=1;break}case 4:{L=c[b+(C*20|0)+28>>2]|0;c[v>>2]=L;R=c[B>>2]|0;if(!R){V=t;W=D}else{X=c[a>>2]|0;Y=L;Z=0;while(1){_=X+(Z*40|0)+20|0;do if((c[_>>2]|0)==3){if((c[X+(Z*40|0)+8>>2]|0)>>>0<=L>>>0)if((Y|0)==65535)$=65535;else{aa=Y;break}else $=Y;c[_>>2]=0;c[A>>2]=(c[A>>2]|0)+-1;if(!(c[X+(Z*40|0)+24>>2]|0)){c[z>>2]=(c[z>>2]|0)+-1;aa=$}else aa=$}else aa=Y;while(0);Z=Z+1|0;if((Z|0)==(R|0)){V=t;W=D;break}else Y=aa}}break}case 0:{M=0;N=90;break a;break}case 2:{Y=c[b+(C*20|0)+20>>2]|0;R=c[B>>2]|0;Z=0;c:while(1){X=Z>>>0<R>>>0;ba=1;while(1){if(!(X&ba))break c;L=c[a>>2]|0;if((c[L+(Z*40|0)+20>>2]|0)!=3)break;if((c[L+(Z*40|0)+8>>2]|0)==(Y|0))ba=0;else break}Z=Z+1|0}Y=ba?-1:Z;if((Y|0)<0){ca=1;break a}R=c[a>>2]|0;c[R+(Y*40|0)+20>>2]=0;c[A>>2]=(c[A>>2]|0)+-1;if(!(c[R+(Y*40|0)+24>>2]|0)){c[z>>2]=(c[z>>2]|0)+-1;V=t;W=D}else{V=t;W=D}break}case 3:{Y=c[b+(C*20|0)+16>>2]|0;R=c[b+(C*20|0)+24>>2]|0;X=c[v>>2]|0;if((X|0)==65535|X>>>0<R>>>0){ca=1;break a}X=c[B>>2]|0;d:do if(X){L=c[a>>2]|0;K=0;while(1){da=L+(K*40|0)+20|0;if((c[da>>2]|0)==3?(c[L+(K*40|0)+8>>2]|0)==(R|0):0)break;_=K+1|0;if(_>>>0<X>>>0)K=_;else{ea=X;break d}}c[da>>2]=0;c[A>>2]=(c[A>>2]|0)+-1;if(!(c[L+(K*40|0)+24>>2]|0)){c[z>>2]=(c[z>>2]|0)+-1;ea=X}else ea=X}else ea=0;while(0);X=t-Y|0;Z=0;e:while(1){_=Z>>>0<ea>>>0;fa=1;while(1){if(!(_&fa))break e;P=c[a>>2]|0;if(((c[P+(Z*40|0)+20>>2]|0)+-1|0)>>>0>=2)break;if((c[P+(Z*40|0)+8>>2]|0)==(X|0))fa=0;else break}Z=Z+1|0}X=fa?-1:Z;if((X|0)<0){ca=1;break a}Y=c[a>>2]|0;_=Y+(X*40|0)+20|0;if((c[_>>2]|0)>>>0<=1){ca=1;break a}c[_>>2]=3;c[Y+(X*40|0)+8>>2]=R;V=t;W=D;break}case 1:{X=t-(c[b+(C*20|0)+16>>2]|0)|0;Y=c[B>>2]|0;_=0;f:while(1){K=_>>>0<Y>>>0;ga=1;while(1){if(!(K&ga))break f;L=c[a>>2]|0;if(((c[L+(_*40|0)+20>>2]|0)+-1|0)>>>0>=2)break;if((c[L+(_*40|0)+8>>2]|0)==(X|0))ga=0;else break}_=_+1|0}X=ga?-1:_;if((X|0)<0){ca=1;break a}Y=c[a>>2]|0;c[Y+(X*40|0)+20>>2]=0;c[A>>2]=(c[A>>2]|0)+-1;if(!(c[Y+(X*40|0)+24>>2]|0)){c[z>>2]=(c[z>>2]|0)+-1;V=t;W=D}else{V=t;W=D}break}case 5:{X=c[a>>2]|0;Y=0;do{R=X+(Y*40|0)+20|0;if((c[R>>2]|0)!=0?(c[R>>2]=0,(c[X+(Y*40|0)+24>>2]|0)==0):0)c[z>>2]=(c[z>>2]|0)+-1;Y=Y+1|0}while((Y|0)!=16);do{}while((tc(a)|0)==0);c[A>>2]=0;c[v>>2]=65535;c[r>>2]=0;c[d>>2]=1;V=0;W=D;break}default:{ca=1;break a}}t=V;C=C+1|0;D=W}if((N|0)==90)ca=M;if(D){s=ca;break}G=t;H=c[A>>2]|0;I=c[B>>2]|0;J=ca}if(H>>>0<I>>>0){C=c[l>>2]|0;c[C+12>>2]=G;c[C+8>>2]=G;c[C+16>>2]=f;c[C+20>>2]=2;c[C+24>>2]=q;C=a+44|0;c[C>>2]=(c[C>>2]|0)+1;c[a+40>>2]=H+1;s=J}else s=1}while(0);J=c[l>>2]|0;c[J+36>>2]=g;c[J+28>>2]=h;c[J+32>>2]=j;if(!(c[o>>2]|0)){o=a+44|0;l=a+28|0;H=c[l>>2]|0;if((c[o>>2]|0)>>>0>H>>>0){do{tc(a)|0;q=c[l>>2]|0}while((c[o>>2]|0)>>>0>q>>>0);ha=q}else ha=H}else{H=a+16|0;o=c[H>>2]|0;l=c[a+12>>2]|0;c[l+(o<<4)>>2]=c[J>>2];c[l+(o<<4)+12>>2]=g;c[l+(o<<4)+4>>2]=h;c[l+(o<<4)+8>>2]=j;c[H>>2]=o+1;ha=c[a+28>>2]|0}uc(c[a>>2]|0,ha+1|0);n=s;i=k;return n|0}function kc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;if((b>>>0<=16?(e=c[(c[a+4>>2]|0)+(b<<2)>>2]|0,(e|0)!=0):0)?(c[e+20>>2]|0)>>>0>1:0)f=c[e>>2]|0;else f=0;i=d;return f|0}function lc(a){a=a|0;var b=0;b=(c[a>>2]|0)+((c[a+28>>2]|0)*40|0)|0;c[a+8>>2]=b;return c[b>>2]|0}
function mc(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0;h=i;c[a+36>>2]=65535;j=e>>>0>1?e:1;c[a+24>>2]=j;e=a+28|0;c[e>>2]=(g|0)==0?d:j;c[a+32>>2]=f;c[a+56>>2]=g;c[a+44>>2]=0;c[a+40>>2]=0;c[a+48>>2]=0;g=id(680)|0;c[a>>2]=g;if(!g){k=65535;i=h;return k|0}ld(g,0,680);a:do if((c[e>>2]|0)!=-1){g=b*384|47;f=0;while(1){j=id(g)|0;d=c[a>>2]|0;c[d+(f*40|0)+4>>2]=j;if(!j){k=65535;break}c[d+(f*40|0)>>2]=j+(0-j&15);f=f+1|0;if(f>>>0>=((c[e>>2]|0)+1|0)>>>0)break a}i=h;return k|0}while(0);b=a+4|0;c[b>>2]=id(68)|0;f=id((c[e>>2]<<4)+16|0)|0;c[a+12>>2]=f;e=c[b>>2]|0;if((e|0)==0|(f|0)==0){k=65535;i=h;return k|0}ld(e,0,68);c[a+20>>2]=0;c[a+16>>2]=0;k=0;i=h;return k|0}function nc(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;oc(a);h=mc(a,b,c,d,e,f)|0;i=g;return h|0}function oc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;d=c[a>>2]|0;if(d){e=a+28|0;if((c[e>>2]|0)==-1)f=d;else{g=d;d=0;while(1){jd(c[g+(d*40|0)+4>>2]|0);h=c[a>>2]|0;c[h+(d*40|0)+4>>2]=0;d=d+1|0;if(d>>>0>=((c[e>>2]|0)+1|0)>>>0){f=h;break}else g=h}}}else f=0;jd(f);c[a>>2]=0;f=a+4|0;jd(c[f>>2]|0);c[f>>2]=0;f=a+12|0;jd(c[f>>2]|0);c[f>>2]=0;i=b;return}function pc(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=c[a+40>>2]|0;if(!d){i=b;return}e=a+4|0;f=0;do{c[(c[e>>2]|0)+(f<<2)>>2]=(c[a>>2]|0)+(f*40|0);f=f+1|0}while(f>>>0<d>>>0);i=b;return}function qc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;f=i;g=a+16|0;c[g>>2]=0;c[a+20>>2]=0;if(!e){h=0;i=f;return h|0}e=a+48|0;j=c[e>>2]|0;k=(j|0)==(b|0);a:do if(!k?(l=a+32|0,m=c[l>>2]|0,n=((j+1|0)>>>0)%(m>>>0)|0,(n|0)!=(b|0)):0){o=a+28|0;p=c[(c[a>>2]|0)+((c[o>>2]|0)*40|0)>>2]|0;q=a+40|0;r=a+24|0;s=a+44|0;t=m;m=n;while(1){n=c[q>>2]|0;if(!n)u=0;else{v=c[a>>2]|0;w=0;do{if(((c[v+(w*40|0)+20>>2]|0)+-1|0)>>>0<2){x=c[v+(w*40|0)+12>>2]|0;c[v+(w*40|0)+8>>2]=x-(x>>>0>m>>>0?t:0)}w=w+1|0}while((w|0)!=(n|0));u=n}if(u>>>0>=(c[r>>2]|0)>>>0){if(!u){h=1;y=38;break}n=c[a>>2]|0;w=0;v=-1;x=0;while(1){if(((c[n+(w*40|0)+20>>2]|0)+-1|0)>>>0<2){z=c[n+(w*40|0)+8>>2]|0;A=(z|0)<(x|0)|(v|0)==-1;B=A?w:v;C=A?z:x}else{B=v;C=x}w=w+1|0;if((w|0)==(u|0))break;else{v=B;x=C}}if((B|0)<=-1){h=1;y=38;break}x=u+-1|0;c[n+(B*40|0)+20>>2]=0;c[q>>2]=x;if(!(c[n+(B*40|0)+24>>2]|0)){c[s>>2]=(c[s>>2]|0)+-1;D=x}else D=x}else D=u;x=c[s>>2]|0;v=c[o>>2]|0;if(x>>>0<v>>>0){E=v;F=x;G=D}else{do{tc(a)|0;H=c[s>>2]|0;I=c[o>>2]|0}while(H>>>0>=I>>>0);E=I;F=H;G=c[q>>2]|0}n=c[a>>2]|0;c[n+(E*40|0)+20>>2]=1;c[n+(E*40|0)+12>>2]=m;c[n+(E*40|0)+8>>2]=m;c[n+(E*40|0)+16>>2]=0;c[n+(E*40|0)+24>>2]=0;c[s>>2]=F+1;c[q>>2]=G+1;uc(n,E+1|0);t=c[l>>2]|0;m=((m+1|0)>>>0)%(t>>>0)|0;if((m|0)==(b|0)){y=23;break}}if((y|0)==23){m=c[g>>2]|0;if(!m){y=33;break}t=c[a+12>>2]|0;l=c[o>>2]|0;q=c[a>>2]|0;s=q+(l*40|0)|0;r=c[s>>2]|0;n=0;while(1){if((c[t+(n<<4)>>2]|0)==(r|0))break;n=n+1|0;if(n>>>0>=m>>>0){y=33;break a}}if(!l){y=33;break}else J=0;while(1){K=q+(J*40|0)|0;J=J+1|0;if((c[K>>2]|0)==(p|0))break;if(J>>>0>=l>>>0){y=33;break a}}c[K>>2]=r;c[s>>2]=p;y=33;break}else if((y|0)==38){i=f;return h|0}}else y=31;while(0);if((y|0)==31)if(d)if(k){h=1;i=f;return h|0}else y=33;else L=j;do if((y|0)==33){if(!d){L=c[e>>2]|0;break}c[e>>2]=b;h=0;i=f;return h|0}while(0);if((L|0)==(b|0)){h=0;i=f;return h|0}L=c[a+32>>2]|0;c[e>>2]=((b+-1+L|0)>>>0)%(L>>>0)|0;h=0;i=f;return h|0}function rc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;d=a+20|0;e=c[d>>2]|0;if(e>>>0>=(c[a+16>>2]|0)>>>0){f=0;i=b;return f|0}g=c[a+12>>2]|0;c[d>>2]=e+1;f=g+(e<<4)|0;i=b;return f|0}function sc(a){a=a|0;var b=0;b=i;if(!(c[a>>2]|0)){i=b;return}c[a+60>>2]=1;do{}while((tc(a)|0)==0);i=b;return}function tc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;b=i;if(c[a+56>>2]|0){d=1;i=b;return d|0}e=c[a>>2]|0;f=c[a+28>>2]|0;g=0;h=2147483647;j=0;while(1){if(!(c[e+(g*40|0)+24>>2]|0)){k=h;l=j}else{m=c[e+(g*40|0)+16>>2]|0;n=(m|0)<(h|0);k=n?m:h;l=n?e+(g*40|0)|0:j}g=g+1|0;if(g>>>0>f>>>0)break;else{h=k;j=l}}if(!l){d=1;i=b;return d|0}j=a+16|0;k=c[j>>2]|0;h=c[a+12>>2]|0;c[h+(k<<4)>>2]=c[l>>2];c[h+(k<<4)+12>>2]=c[l+36>>2];c[h+(k<<4)+4>>2]=c[l+28>>2];c[h+(k<<4)+8>>2]=c[l+32>>2];c[j>>2]=k+1;c[l+24>>2]=0;if(c[l+20>>2]|0){d=0;i=b;return d|0}l=a+44|0;c[l>>2]=(c[l>>2]|0)+-1;d=0;i=b;return d|0}function uc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;d=i;i=i+32|0;e=d+16|0;f=d;g=7;do{if(g>>>0<b>>>0){h=g;do{j=a+(h*40|0)|0;k=c[j>>2]|0;l=c[j+4>>2]|0;j=c[a+(h*40|0)+8>>2]|0;m=a+(h*40|0)+12|0;n=c[m+4>>2]|0;o=e;c[o>>2]=c[m>>2];c[o+4>>2]=n;n=c[a+(h*40|0)+20>>2]|0;o=c[a+(h*40|0)+24>>2]|0;m=a+(h*40|0)+28|0;c[f+0>>2]=c[m+0>>2];c[f+4>>2]=c[m+4>>2];c[f+8>>2]=c[m+8>>2];a:do if(h>>>0<g>>>0){p=h;q=5}else{m=(n|0)==0;r=(o|0)==0;s=n+-1|0;t=s>>>0<2;u=h;b:while(1){v=u-g|0;w=c[a+(v*40|0)+20>>2]|0;do if(!w)if(m?(c[a+(v*40|0)+24>>2]|0)!=0|r:0)break b;else q=16;else{if(m)break b;x=w+-1|0;if((x|s)>>>0<2){y=c[a+(v*40|0)+8>>2]|0;if((y|0)>(j|0))break b;z=a+(u*40|0)|0;if((y|0)<(j|0)){A=z;break}else{B=z;break a}}if(x>>>0<2)break b;if(!t?(c[a+(v*40|0)+8>>2]|0)<=(j|0):0)break b;else q=16}while(0);if((q|0)==16){q=0;A=a+(u*40|0)|0}w=A+0|0;x=a+(v*40|0)+0|0;z=w+40|0;do{c[w>>2]=c[x>>2];w=w+4|0;x=x+4|0}while((w|0)<(z|0));if(v>>>0<g>>>0){p=v;q=5;break a}else u=v}B=a+(u*40|0)|0}while(0);if((q|0)==5){q=0;B=a+(p*40|0)|0}t=B;c[t>>2]=k;c[t+4>>2]=l;c[B+8>>2]=j;t=e;s=c[t+4>>2]|0;m=B+12|0;c[m>>2]=c[t>>2];c[m+4>>2]=s;c[B+20>>2]=n;c[B+24>>2]=o;s=B+28|0;c[s+0>>2]=c[f+0>>2];c[s+4>>2]=c[f+4>>2];c[s+8>>2]=c[f+8>>2];h=h+1|0}while((h|0)!=(b|0))}g=g>>>1}while((g|0)!=0);i=d;return}function vc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;d=i;e=c[a+4>>2]|0;f=c[a+16>>2]|0;g=c[a+20>>2]|0;h=e<<2;j=b+256|0;k=16;l=c[a+12>>2]|0;a=b;while(1){m=c[a+4>>2]|0;c[l>>2]=c[a>>2];c[l+4>>2]=m;m=c[a+12>>2]|0;c[l+8>>2]=c[a+8>>2];c[l+12>>2]=m;k=k+-1|0;if(!k)break;else{l=l+(h<<2)|0;a=a+16|0}}a=e<<1&2147483646;h=c[b+260>>2]|0;c[f>>2]=c[j>>2];c[f+4>>2]=h;h=c[b+268>>2]|0;c[f+(a<<2)>>2]=c[b+264>>2];c[f+((a|1)<<2)>>2]=h;h=e<<2;j=c[b+276>>2]|0;c[f+(h<<2)>>2]=c[b+272>>2];c[f+((h|1)<<2)>>2]=j;j=h+a|0;h=c[b+284>>2]|0;c[f+(j<<2)>>2]=c[b+280>>2];c[f+((j|1)<<2)>>2]=h;h=j+a|0;j=c[b+292>>2]|0;c[f+(h<<2)>>2]=c[b+288>>2];c[f+((h|1)<<2)>>2]=j;j=h+a|0;h=c[b+300>>2]|0;c[f+(j<<2)>>2]=c[b+296>>2];c[f+((j|1)<<2)>>2]=h;h=j+a|0;j=c[b+308>>2]|0;c[f+(h<<2)>>2]=c[b+304>>2];c[f+((h|1)<<2)>>2]=j;j=h+a|0;h=c[b+316>>2]|0;c[f+(j<<2)>>2]=c[b+312>>2];c[f+((j|1)<<2)>>2]=h;h=c[b+324>>2]|0;c[g>>2]=c[b+320>>2];c[g+4>>2]=h;h=c[b+332>>2]|0;c[g+(a<<2)>>2]=c[b+328>>2];c[g+((a|1)<<2)>>2]=h;h=e<<2;e=c[b+340>>2]|0;c[g+(h<<2)>>2]=c[b+336>>2];c[g+((h|1)<<2)>>2]=e;e=h+a|0;h=c[b+348>>2]|0;c[g+(e<<2)>>2]=c[b+344>>2];c[g+((e|1)<<2)>>2]=h;h=e+a|0;e=c[b+356>>2]|0;c[g+(h<<2)>>2]=c[b+352>>2];c[g+((h|1)<<2)>>2]=e;e=h+a|0;h=c[b+364>>2]|0;c[g+(e<<2)>>2]=c[b+360>>2];c[g+((e|1)<<2)>>2]=h;h=e+a|0;e=c[b+372>>2]|0;c[g+(h<<2)>>2]=c[b+368>>2];c[g+((h|1)<<2)>>2]=e;e=h+a|0;a=c[b+380>>2]|0;c[g+(e<<2)>>2]=c[b+376>>2];c[g+((e|1)<<2)>>2]=a;i=d;return}function wc(b,e,f,g){b=b|0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g;k=c[e+4>>2]|0;l=e+8|0;m=c[l>>2]|0;n=Z(m,k)|0;if(!m){i=g;return}m=h+24|0;o=h+16|0;p=h+8|0;q=h+100|0;r=h+68|0;s=h+36|0;t=h+4|0;u=h+120|0;v=h+112|0;w=h+104|0;x=h+96|0;y=h+88|0;z=h+80|0;A=h+72|0;B=h+64|0;C=h+56|0;D=h+48|0;E=h+40|0;F=h+32|0;G=h+124|0;H=h+116|0;I=h+108|0;J=h+92|0;K=h+84|0;L=h+76|0;M=h+60|0;N=h+52|0;O=h+44|0;P=h+28|0;Q=h+20|0;R=h+12|0;S=j+28|0;T=j+32|0;U=j+24|0;V=k<<4;W=0-V|0;X=W<<1;Y=Z(k,-48)|0;_=k<<5;$=W<<2;aa=k*48|0;ba=k<<6;ca=j+24|0;da=j+12|0;ea=n<<8;fa=n<<6;n=k<<3;ga=V|4;ha=j+16|0;ia=j+20|0;ja=j+12|0;ka=j+4|0;la=j+8|0;ma=0;na=0;oa=f;while(1){f=c[oa+8>>2]|0;do if((f|0)!=1){pa=oa+200|0;qa=c[pa>>2]|0;do if(!qa)ra=1;else{if((f|0)==2?(c[oa+4>>2]|0)!=(c[qa+4>>2]|0):0){ra=1;break}ra=5}while(0);sa=oa+204|0;ta=c[sa>>2]|0;do if(!ta)ua=ra;else{if((f|0)==2?(c[oa+4>>2]|0)!=(c[ta+4>>2]|0):0){ua=ra;break}ua=ra|2}while(0);va=(ua&2|0)==0;do if(va){c[m>>2]=0;c[o>>2]=0;c[p>>2]=0;c[h>>2]=0;wa=0}else{if((c[oa>>2]|0)>>>0<=5?(c[ta>>2]|0)>>>0<=5:0){if((b[oa+28>>1]|0)==0?(b[ta+48>>1]|0)==0:0)if((c[oa+116>>2]|0)==(c[ta+124>>2]|0)?(xa=(b[oa+132>>1]|0)-(b[ta+172>>1]|0)|0,(((xa|0)>-1?xa:0-xa|0)|0)<=3):0){xa=(b[oa+134>>1]|0)-(b[ta+174>>1]|0)|0;ya=(((xa|0)>-1?xa:0-xa|0)|0)>3&1}else ya=1;else ya=2;c[h>>2]=ya;if((b[oa+30>>1]|0)==0?(b[ta+50>>1]|0)==0:0)if((c[oa+116>>2]|0)==(c[ta+124>>2]|0)?(xa=(b[oa+136>>1]|0)-(b[ta+176>>1]|0)|0,(((xa|0)>-1?xa:0-xa|0)|0)<=3):0){xa=(b[oa+138>>1]|0)-(b[ta+178>>1]|0)|0;za=(((xa|0)>-1?xa:0-xa|0)|0)>3&1}else za=1;else za=2;c[p>>2]=za;if((b[oa+36>>1]|0)==0?(b[ta+56>>1]|0)==0:0)if((c[oa+120>>2]|0)==(c[ta+128>>2]|0)?(xa=(b[oa+148>>1]|0)-(b[ta+188>>1]|0)|0,(((xa|0)>-1?xa:0-xa|0)|0)<=3):0){xa=(b[oa+150>>1]|0)-(b[ta+190>>1]|0)|0;Aa=(((xa|0)>-1?xa:0-xa|0)|0)>3&1}else Aa=1;else Aa=2;c[o>>2]=Aa;if((b[oa+38>>1]|0)==0?(b[ta+58>>1]|0)==0:0)if((c[oa+120>>2]|0)==(c[ta+128>>2]|0)?(xa=(b[oa+152>>1]|0)-(b[ta+192>>1]|0)|0,(((xa|0)>-1?xa:0-xa|0)|0)<=3):0){xa=(b[oa+154>>1]|0)-(b[ta+194>>1]|0)|0;Ba=(((xa|0)>-1?xa:0-xa|0)|0)>3&1}else Ba=1;else Ba=2;c[m>>2]=Ba;wa=(za|ya|Aa|Ba|0)!=0&1;break}c[m>>2]=4;c[o>>2]=4;c[p>>2]=4;c[h>>2]=4;wa=1}while(0);ta=(ua&4|0)==0;do if(ta){c[q>>2]=0;c[r>>2]=0;c[s>>2]=0;c[t>>2]=0;Ca=c[oa>>2]|0;Da=wa}else{xa=c[oa>>2]|0;if(xa>>>0<=5?(c[qa>>2]|0)>>>0<=5:0){if((b[oa+28>>1]|0)==0?(b[qa+38>>1]|0)==0:0)if((c[oa+116>>2]|0)==(c[qa+120>>2]|0)?(Ea=(b[oa+132>>1]|0)-(b[qa+152>>1]|0)|0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+32>>1]|0;if(!(Ea<<16>>16))Ja=(b[xa>>1]|0)!=0?2:0;else Ja=2;c[F>>2]=Ja;Ka=b[oa+34>>1]|0;La=Ka<<16>>16==0;if(La)Ma=(b[oa+30>>1]|0)!=0?2:0;else Ma=2;c[E>>2]=Ma;Na=b[oa+40>>1]|0;Pa=Na<<16>>16==0;if(Pa)Qa=(b[oa+36>>1]|0)!=0?2:0;else Qa=2;c[D>>2]=Qa;Ra=b[oa+42>>1]|0;Sa=Ra<<16>>16==0;if(Sa)Ta=(b[oa+38>>1]|0)!=0?2:0;else Ta=2;c[C>>2]=Ta;Ua=b[oa+48>>1]|0;if(!(Ua<<16>>16))Va=(b[oa+44>>1]|0)!=0?2:0;else Va=2;c[x>>2]=Va;Wa=b[oa+50>>1]|0;Xa=Wa<<16>>16==0;if(Xa)Ya=(b[oa+46>>1]|0)!=0?2:0;else Ya=2;c[w>>2]=Ya;Za=b[oa+56>>1]|0;_a=Za<<16>>16==0;if(_a)$a=(b[oa+52>>1]|0)!=0?2:0;else $a=2;c[v>>2]=$a;ab=(b[oa+58>>1]|0)==0;if(ab)bb=(b[oa+54>>1]|0)!=0?2:0;else bb=2;c[u>>2]=bb;cb=b[oa+44>>1]|0;eb=b[oa+166>>1]|0;fb=b[oa+142>>1]|0;do if(!((cb|Ea)<<16>>16)){gb=(b[oa+164>>1]|0)-(b[oa+140>>1]|0)|0;if((((gb|0)>-1?gb:0-gb|0)|0)>3){hb=1;break}gb=eb-fb|0;if((((gb|0)>-1?gb:0-gb|0)|0)>3){hb=1;break}hb=(c[oa+124>>2]|0)!=(c[oa+116>>2]|0)&1}else hb=2;while(0);c[B>>2]=hb;fb=b[oa+46>>1]|0;eb=b[oa+170>>1]|0;gb=b[oa+146>>1]|0;do if(!((fb|Ka)<<16>>16)){ib=(b[oa+168>>1]|0)-(b[oa+144>>1]|0)|0;if((((ib|0)>-1?ib:0-ib|0)|0)>3){jb=1;break}ib=eb-gb|0;if((((ib|0)>-1?ib:0-ib|0)|0)>3){jb=1;break}jb=(c[oa+124>>2]|0)!=(c[oa+116>>2]|0)&1}else jb=2;while(0);c[A>>2]=jb;gb=b[oa+52>>1]|0;eb=b[oa+182>>1]|0;ib=b[oa+158>>1]|0;do if(!((gb|Na)<<16>>16)){kb=(b[oa+180>>1]|0)-(b[oa+156>>1]|0)|0;if((((kb|0)>-1?kb:0-kb|0)|0)>3){lb=1;break}kb=eb-ib|0;if((((kb|0)>-1?kb:0-kb|0)|0)>3){lb=1;break}lb=(c[oa+128>>2]|0)!=(c[oa+120>>2]|0)&1}else lb=2;while(0);c[z>>2]=lb;ib=b[oa+54>>1]|0;eb=b[oa+186>>1]|0;kb=b[oa+162>>1]|0;do if(!((ib|Ra)<<16>>16)){mb=(b[oa+184>>1]|0)-(b[oa+160>>1]|0)|0;if((((mb|0)>-1?mb:0-mb|0)|0)>3){nb=1;break}mb=eb-kb|0;if((((mb|0)>-1?mb:0-mb|0)|0)>3){nb=1;break}nb=(c[oa+128>>2]|0)!=(c[oa+120>>2]|0)&1}else nb=2;while(0);c[y>>2]=nb;kb=b[oa+30>>1]|0;if(!(kb<<16>>16))ob=(b[xa>>1]|0)!=0?2:0;else ob=2;c[R>>2]=ob;eb=b[oa+36>>1]|0;if(!(eb<<16>>16))pb=kb<<16>>16!=0?2:0;else pb=2;c[Q>>2]=pb;if(!(b[oa+38>>1]|0))qb=eb<<16>>16!=0?2:0;else qb=2;c[P>>2]=qb;if(La)rb=Ea<<16>>16!=0?2:0;else rb=2;c[O>>2]=rb;if(Pa)sb=Ka<<16>>16!=0?2:0;else sb=2;c[N>>2]=sb;if(Sa)tb=Na<<16>>16!=0?2:0;else tb=2;c[M>>2]=tb;if(!(fb<<16>>16))ub=cb<<16>>16!=0?2:0;else ub=2;c[L>>2]=ub;if(!(gb<<16>>16))vb=fb<<16>>16!=0?2:0;else vb=2;c[K>>2]=vb;if(!(ib<<16>>16))wb=gb<<16>>16!=0?2:0;else wb=2;c[J>>2]=wb;if(Xa)xb=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c[u>>2]=Yb;Ob=b[oa+30>>1]|0;if(!(Ob<<16>>16))Zb=(b[eb>>1]|0)!=0?2:0;else Zb=2;c[R>>2]=Zb;if(!(b[oa+38>>1]|0))_b=(b[oa+36>>1]|0)!=0?2:0;else _b=2;c[P>>2]=_b;if(mb)$b=kb<<16>>16!=0?2:0;else $b=2;c[O>>2]=$b;if(Fb)ac=Cb<<16>>16!=0?2:0;else ac=2;c[M>>2]=ac;if(Kb)bc=Hb<<16>>16!=0?2:0;else bc=2;c[L>>2]=bc;if(Pb)cc=Mb<<16>>16!=0?2:0;else cc=2;c[J>>2]=cc;if(Tb)dc=Eb<<16>>16!=0?2:0;else dc=2;c[I>>2]=dc;if(Xb)ec=Vb<<16>>16!=0?2:0;else ec=2;c[G>>2]=ec;Xb=b[oa+150>>1]|0;Eb=b[oa+138>>1]|0;do if(!((b[oa+36>>1]|Ob)<<16>>16)){Tb=(b[oa+148>>1]|0)-(b[oa+136>>1]|0)|0;if((((Tb|0)>-1?Tb:0-Tb|0)|0)>3){fc=1;break}Tb=Xb-Eb|0;if((((Tb|0)>-1?Tb:0-Tb|0)|0)>3){fc=1;break}fc=(c[oa+120>>2]|0)!=(c[oa+116>>2]|0)&1}else fc=2;while(0);c[Q>>2]=fc;Eb=b[oa+158>>1]|0;Xb=b[oa+146>>1]|0;do if(!((Cb|Ra)<<16>>16)){Ob=(b[oa+156>>1]|0)-(b[oa+144>>1]|0)|0;if((((Ob|0)>-1?Ob:0-Ob|0)|0)>3){gc=1;break}Ob=Eb-Xb|0;if((((Ob|0)>-1?Ob:0-Ob|0)|0)>3){gc=1;break}gc=(c[oa+120>>2]|0)!=(c[oa+116>>2]|0)&1}else gc=2;while(0);c[N>>2]=gc;Xb=b[oa+182>>1]|0;Eb=b[oa+170>>1]|0;do if(!((Mb|Jb)<<16>>16)){Ra=(b[oa+180>>1]|0)-(b[oa+168>>1]|0)|0;if((((Ra|0)>-1?Ra:0-Ra|0)|0)>3){hc=1;break}Ra=Xb-E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a=b[oa+42>>1]|0;_a=b[oa+38>>1]|0;Ua=b[oa+162>>1]|0;Xa=b[oa+154>>1]|0;if(!((_a|Wa)<<16>>16)){gb=(b[oa+160>>1]|0)-(b[oa+152>>1]|0)|0;if((((gb|0)>-1?gb:0-gb|0)|0)>3)mc=1;else{gb=Ua-Xa|0;mc=(((gb|0)>-1?gb:0-gb|0)|0)>3&1}}else mc=2;c[C>>2]=mc;gb=b[oa+44>>1]|0;ib=b[oa+166>>1]|0;do if(!((gb|Xb)<<16>>16)){fb=(b[oa+164>>1]|0)-(b[oa+140>>1]|0)|0;if((((fb|0)>-1?fb:0-fb|0)|0)>3)nc=1;else{fb=ib-Sb|0;if((((fb|0)>-1?fb:0-fb|0)|0)>3){nc=1;break}nc=(c[oa+124>>2]|0)!=(c[oa+116>>2]|0)&1}}else nc=2;while(0);c[B>>2]=nc;fb=b[oa+46>>1]|0;cb=b[oa+170>>1]|0;do if(!((fb|Jb)<<16>>16)){Na=(b[oa+168>>1]|0)-(b[oa+144>>1]|0)|0;if((((Na|0)>-1?Na:0-Na|0)|0)>3){oc=1;break}Na=cb-Ra|0;if((((Na|0)>-1?Na:0-Na|0)|0)>3){oc=1;break}oc=(c[oa+124>>2]|0)!=(c[oa+116>>2]|0)&1}else oc=2;while(0);c[A>>2]=oc;Na=b[oa+52>>1]|0;Sa=b[oa+182>>1]|0;do if(!((Na|Ob)<<16>>16)){Ka=(b[oa+180>>1]|0)-(b[oa+156>>1]|0)|0;if((((Ka|0)>-1?Ka:0-Ka|0)|0)>3){pc=1;break}Ka=Sa-Za|0;if((((Ka|0)>-1?Ka:0-Ka|0)|0)>3){pc=1;break}pc=(c[oa+128>>2]|0)!=(c[oa+120>>2]|0)&1}else pc=2;while(0);c[z>>2]=pc;Ka=b[oa+54>>1]|0;Pa=b[oa+186>>1]|0;do if(!((Ka|Wa)<<16>>16)){Ea=(b[oa+184>>1]|0)-(b[oa+160>>1]|0)|0;if((((Ea|0)>-1?Ea:0-Ea|0)|0)>3){qc=1;break}Ea=Pa-Ua|0;if((((Ea|0)>-1?Ea:0-Ea|0)|0)>3){qc=1;break}qc=(c[oa+128>>2]|0)!=(c[oa+120>>2]|0)&1}else qc=2;while(0);c[y>>2]=qc;Ea=b[oa+48>>1]|0;La=b[oa+174>>1]|0;do if(!((Ea|gb)<<16>>16)){xa=(b[oa+172>>1]|0)-(b[oa+164>>1]|0)|0;if((((xa|0)>-1?xa:0-xa|0)|0)>3){rc=1;break}xa=La-ib|0;rc=(((xa|0)>-1?xa:0-xa|0)|0)>3&1}else rc=2;while(0);c[x>>2]=rc;xa=b[oa+50>>1]|0;Tb=b[oa+178>>1]|0;do if(!((xa|fb)<<16>>16)){Pb=(b[oa+176>>1]|0)-(b[oa+168>>1]|0)|0;if((((Pb|0)>-1?Pb:0-Pb|0)|0)>3){sc=1;break}Pb=Tb-cb|0;sc=(((Pb|0)>-1?Pb:0-Pb|0)|0)>3&1}else sc=2;while(0);c[w>>2]=sc;Pb=b[oa+56>>1]|0;Hb=b[oa+190>>1]|0;do if(!((Pb|Na)<<16>>16)){Kb=(b[oa+188>>1]|0)-(b[oa+180>>1]|0)|0;if((((Kb|0)>-1?Kb:0-Kb|0)|0)>3){tc=1;break}Kb=Hb-Sa|0;tc=(((Kb|0)>-1?Kb:0-Kb|0)|0)>3&1}else tc=2;while(0);c[v>>2]=tc;Kb=b[oa+58>>1]|0;Fb=b[oa+194>>1]|0;do if(!((Kb|Ka)<<16>>16)){kb=(b[oa+192>>1]|0)-(b[oa+184>>1]|0)|0;if((((kb|0)>-1?kb:0-kb|0)|0)>3){uc=1;break}kb=Fb-Pa|0;uc=(((kb|0)>-1?kb:0-kb|0)|0)>3&1}else uc=2;while(0);c[u>>2]=uc;do if(!((Mb|Eb)<<16>>16)){kb=(b[oa+136>>1]|0)-(b[oa+132>>1]|0)|0;if((((kb|0)>-1?kb:0-kb|0)|0)>3){vc=1;break}kb=Cb-Vb|0;vc=(((kb|0)>-1?kb:0-kb|0)|0)>3&1}else vc=2;while(0);c[R>>2]=vc;do if(!((qa|Mb)<<16>>16)){Vb=(b[oa+148>>1]|0)-(b[oa+136>>1]|0)|0;if((((Vb|0)>-1?Vb:0-Vb|0)|0)>3){wc=1;break}Vb=ab-Cb|0;if((((Vb|0)>-1?Vb:0-Vb|0)|0)>3){wc=1;break}wc=(c[oa+120>>2]|0)!=(c[oa+116>>2]|0)&1}else wc=2;while(0);c[Q>>2]=wc;do if(!((_a|qa)<<16>>16)){Cb=(b[oa+152>>1]|0)-(b[oa+148>>1]|0)|0;if((((Cb|0)>-1?Cb:0-Cb|0)|0)>3){xc=1;break}Cb=Xa-ab|0;xc=(((Cb|0)>-1?Cb:0-Cb|0)|0)>3&1}else xc=2;while(0);c[P>>2]=xc;do if(!((Jb|Xb)<<16>>16)){ab=(b[oa+144>>1]|0)-(b[oa+140>>1]|0)|0;if((((ab|0)>-1?ab:0-ab|0)|0)>3){Ec=1;break}ab=Ra-Sb|0;Ec=(((ab|0)>-1?ab:0-ab|0)|0)>3&1}else Ec=2;while(0);c[O>>2]=Ec;do if(!((Ob|Jb)<<16>>16)){Sb=(b[oa+156>>1]|0)-(b[oa+144>>1]|0)|0;if((((Sb|0)>-1?Sb:0-Sb|0)|0)>3){Fc=1;break}Sb=Za-Ra|0;if((((Sb|0)>-1?Sb:0-Sb|0)|0)>3){Fc=1;break}Fc=(c[oa+120>>2]|0)!=(c[oa+116>>2]|0)&1}else Fc=2;while(0);c[N>>2]=Fc;do if(!((Wa|Ob)<<16>>16)){Ra=(b[oa+160>>1]|0)-(b[oa+156>>1]|0)|0;if((((Ra|0)>-1?Ra:0-Ra|0)|0)>3){Gc=1;break}Ra=Ua-Za|0;Gc=(((Ra|0)>-1?Ra:0-Ra|0)|0)>3&1}else Gc=2;while(0);c[M>>2]=Gc;do if(!((fb|gb)<<16>>16)){Za=(b[oa+168>>1]|0)-(b[oa+164>>1]|0)|0;if((((Za|0)>-1?Za:0-Za|0)|0)>3){Hc=1;break}Za=cb-ib|0;Hc=(((Za|0)>-1?Za:0-Za|0)|0)>3&1}else Hc=2;while(0);c[L>>2]=Hc;do if(!((Na|fb)<<16>>16)){ib=(b[oa+180>>1]|0)-(b[oa+168>>1]|0)|0;if((((ib|0)>-1?ib:0-ib|0)|0)>3){Ic=1;break}ib=Sa-cb|0;if((((ib|0)>-1?ib:0-ib|0)|0)>3){Ic=1;break}Ic=(c[oa+128>>2]|0)!=(c[oa+124>>2]|0)&1}else Ic=2;while(0);c[K>>2]=Ic;do if(!((Ka|Na)<<16>>16)){cb=(b[oa+184>>1]|0)-(b[oa+180>>1]|0)|0;if((((cb|0)>-1?cb:0-cb|0)|0)>3){Jc=1;break}cb=Pa-Sa|0;Jc=(((cb|0)>-1?cb:0-cb|0)|0)>3&1}else Jc=2;while(0);c[J>>2]=Jc;do if(!((xa|Ea)<<16>>16)){Sa=(b[oa+176>>1]|0)-(b[oa+172>>1]|0)|0;if((((Sa|0)>-1?Sa:0-Sa|0)|0)>3){Kc=1;break}Sa=Tb-La|0;Kc=(((Sa|0)>-1?Sa:0-Sa|0)|0)>3&1}else Kc=2;while(0);c[I>>2]=Kc;do if(!((Pb|xa)<<16>>16)){La=(b[oa+188>>1]|0)-(b[oa+176>>1]|0)|0;if((((La|0)>-1?La:0-La|0)|0)>3){Lc=1;break}La=Hb-Tb|0;if((((La|0)>-1?La:0-La|0)|0)>3){Lc=1;break}Lc=(c[oa+128>>2]|0)!=(c[oa+124>>2]|0)&1}else Lc=2;while(0);c[H>>2]=Lc;do if(!((Kb|Pb)<<16>>16)){Tb=(b[oa+192>>1]|0)-(b[oa+188>>1]|0)|0;if((((Tb|0)>-1?Tb:0-Tb|0)|0)>3){Mc=1;break}Tb=Fb-Hb|0;Mc=(((Tb|0)>-1?Tb:0-Tb|0)|0)>3&1}else Mc=2;while(0);c[G>>2]=Mc;break}}else yc(oa,h);while(0);if(!(Da|c[F>>2]|c[E>>2]|c[D>>2]|c[C>>2]|c[B>>2]|c[A>>2]|c[z>>2]|c[y>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dc(Ea+4|0,Pa,sa,n);Dc(Kb+4|0,c[pa>>2]|0,sa,n)}sa=Tb+24|0;Pa=c[sa>>2]|0;if(!Pa)break;va=j+(Pb*12|0)|0;Dc(Ea+6|0,Pa,va,n);Dc(Kb+6|0,c[sa>>2]|0,va,n)}while(0);Hb=Hb+1|0;if((Hb|0)==2)break;else{Kb=Kb+_|0;Ea=Ea+_|0;Pb=2;Tb=Tb+64|0}}}while(0);f=ma+1|0;Tb=(f|0)==(k|0);na=(Tb&1)+na|0;if(na>>>0>=(c[l>>2]|0)>>>0)break;else{ma=Tb?0:f;oa=oa+216|0}}i=g;return}function yc(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0;e=i;f=a+28|0;g=b[a+32>>1]|0;if(!(g<<16>>16))h=(b[f>>1]|0)!=0?2:0;else h=2;c[d+32>>2]=h;h=b[a+34>>1]|0;j=h<<16>>16==0;if(j)k=(b[a+30>>1]|0)!=0?2:0;else k=2;c[d+40>>2]=k;k=b[a+40>>1]|0;l=k<<16>>16==0;if(l)m=(b[a+36>>1]|0)!=0?2:0;else m=2;c[d+48>>2]=m;m=b[a+42>>1]|0;n=m<<16>>16==0;if(n)o=(b[a+38>>1]|0)!=0?2:0;else o=2;c[d+56>>2]=o;o=b[a+44>>1]|0;if(!(o<<16>>16))p=g<<16>>16!=0?2:0;else p=2;c[d+64>>2]=p;p=b[a+46>>1]|0;q=p<<16>>16==0;if(q)r=h<<16>>16!=0?2:0;else r=2;c[d+72>>2]=r;r=b[a+52>>1]|0;s=r<<16>>16==0;if(s)t=k<<16>>16!=0?2:0;else t=2;c[d+80>>2]=t;t=b[a+54>>1]|0;u=t<<16>>16==0;if(u)v=m<<16>>16!=0?2:0;else v=2;c[d+88>>2]=v;v=b[a+48>>1]|0;if(!(v<<16>>16))w=o<<16>>16!=0?2:0;else w=2;c[d+96>>2]=w;w=b[a+50>>1]|0;m=w<<16>>16==0;if(m)x=p<<16>>16!=0?2:0;else x=2;c[d+104>>2]=x;x=b[a+56>>1]|0;y=x<<16>>16==0;if(y)z=r<<16>>16!=0?2:0;else z=2;c[d+112>>2]=z;z=(b[a+58>>1]|0)==0;if(z)A=t<<16>>16!=0?2:0;else A=2;c[d+120>>2]=A;A=b[a+30>>1]|0;if(!(A<<16>>16))B=(b[f>>1]|0)!=0?2:0;else B=2;c[d+12>>2]=B;B=b[a+36>>1]|0;if(!(B<<16>>16))C=A<<16>>16!=0?2:0;else C=2;c[d+20>>2]=C;if(!(b[a+38>>1]|0))D=B<<16>>16!=0?2:0;else D=2;c[d+28>>2]=D;if(j)E=g<<16>>16!=0?2:0;else E=2;c[d+44>>2]=E;if(l)F=h<<16>>16!=0?2:0;else F=2;c[d+52>>2]=F;if(n)G=k<<16>>16!=0?2:0;else G=2;c[d+60>>2]=G;if(q)H=o<<16>>16!=0?2:0;else H=2;c[d+76>>2]=H;if(s)I=p<<16>>16!=0?2:0;else I=2;c[d+84>>2]=I;if(u)J=r<<16>>16!=0?2:0;else J=2;c[d+92>>2]=J;if(m)K=v<<16>>16!=0?2:0;else K=2;c[d+108>>2]=K;if(y)L=w<<16>>16!=0?2:0;else L=2;c[d+116>>2]=L;if(!z){M=2;N=d+124|0;c[N>>2]=M;i=e;return}M=x<<16>>16!=0?2:0;N=d+124|0;c[N>>2]=M;i=e;return}function zc(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;h=i;j=c[f+4>>2]|0;k=c[f+8>>2]|0;if(e>>>0<4){l=d[(c[f>>2]|0)+(e+-1)>>0]|0;e=0-l|0;f=l+1|0;m=b;n=4;while(1){o=m+-2|0;p=d[o>>0]|0;q=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|0)>-1?q:0-q|0)>>>0<r>>>0?(q=d[b+m>>0]|0,s=q-o|0,t=c[n>>2]|0,((s|0)>-1?s:0-s|0)>>>0<t>>>0):0)?(s=k&255,k=s-p|0,((k|0)>-1?k:0-k|0)>>>0<t>>>0):0){t=Oa(f,e,4-s+(p-o<<2)+q>>3)|0;q=a[3472+((p|512)-t)>>0]|0;a[j>>0]=a[3472+((o|512)+t)>>0]|0;a[b>>0]=q;u=c[l>>2]|0}else u=r;r=b+1|0;l=b+(1-g)|0;q=d[l>>0]|0;t=d[r>>0]|0;o=q-t|0;if(((o|0)>-1?o:0-o|0)>>>0>=u>>>0){i=h;return}u=d[b+(m|1)>>0]|0;m=u-q|0;o=c[n>>2]|0;if(((m|0)>-1?m:0-m|0)>>>0>=o>>>0){i=h;return}m=d[b+(g+1)>>0]|0;g=m-t|0;if(((g|0)>-1?g:0-g|0)>>>0>=o>>>0){i=h;return}o=Oa(f,e,4-m+(t-q<<2)+u>>3)|0;u=a[3472+((t|512)-o)>>0]|0;a[l>>0]=a[3472+((q|512)+o)>>0]|0;a[r>>0]=u;i=h;return}function Ec(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;e=i;f=c[b+4>>2]|0;g=c[b+8>>2]|0;if(!((d|0)==0|(d|0)==5)?(c[a+3384>>2]|0)==0:0)h=0;else{j=a+1220|0;k=0;do{l=kc(j,k)|0;k=k+1|0}while(k>>>0<16&(l|0)==0);h=l}k=a+1176|0;j=c[k>>2]|0;if(j){l=c[a+1212>>2]|0;m=0;n=0;o=0;while(1){if(c[l+(n*216|0)+196>>2]|0){p=m;q=n;r=o;break}s=n+1|0;t=m+1|0;u=(t|0)==(f|0);v=(u&1)+o|0;w=u?0:t;if(s>>>0<j>>>0){m=w;n=s;o=v}else{p=w;q=s;r=v;break}}if((q|0)!=(j|0)){j=a+1212|0;q=c[j>>2]|0;o=Z(r,f)|0;if(p){n=a+1204|0;m=p;do{m=m+-1|0;l=m+o|0;Fc(q+(l*216|0)|0,b,r,m,d,h);c[q+(l*216|0)+196>>2]=1;c[n>>2]=(c[n>>2]|0)+1}while((m|0)!=0)}m=p+1|0;if(m>>>0<f>>>0){p=a+1204|0;n=m;do{m=n+o|0;l=q+(m*216|0)+196|0;if(!(c[l>>2]|0)){Fc(q+(m*216|0)|0,b,r,n,d,h);c[l>>2]=1;c[p>>2]=(c[p>>2]|0)+1}n=n+1|0}while((n|0)!=(f|0))}if(r)if(!f)x=r;else{n=r+-1|0;p=Z(n,f)|0;q=a+1204|0;o=0-f|0;l=0;do{m=n;v=(c[j>>2]|0)+((l+p|0)*216|0)|0;while(1){Fc(v,b,m,l,d,h);c[v+196>>2]=1;c[q>>2]=(c[q>>2]|0)+1;if(!m)break;else{m=m+-1|0;v=v+(o*216|0)|0}}l=l+1|0}while((l|0)!=(f|0));x=r}else x=0;r=x+1|0;if(r>>>0>=g>>>0){i=e;return 0}x=(f|0)==0;l=a+1204|0;o=r;do{r=c[j>>2]|0;q=Z(o,f)|0;if(!x){p=0;do{n=p+q|0;v=r+(n*216|0)+196|0;if(!(c[v>>2]|0)){Fc(r+(n*216|0)|0,b,o,p,d,h);c[v>>2]=1;c[l>>2]=(c[l>>2]|0)+1}p=p+1|0}while((p|0)!=(f|0))}o=o+1|0}while((o|0)!=(g|0));i=e;return 0}}if((d|0)==2|(d|0)==7)if((c[a+3384>>2]|0)==0|(h|0)==0)y=13;else y=14;else if(!h)y=13;else y=14;if((y|0)==13)ld(c[b>>2]|0,128,Z(f*384|0,g)|0);else if((y|0)==14)kd(c[b>>2]|0,h,Z(f*384|0,g)|0);g=c[k>>2]|0;c[a+1204>>2]=g;if(!g){i=e;return 0}k=c[a+1212>>2]|0;a=0;do{c[k+(a*216|0)+8>>2]=1;a=a+1|0}while(a>>>0<g>>>0);i=e;return 0}function Fc(b,e,f,g,h,j){b=b|0;e=e|0;f=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)==50){T=0;Ca=(La|0)==0;if(Ca&fa&ga){c[o>>2]=oa+pa+na+ma-ua-ta-sa-ra>>4;Ma=Ka;break}if(Ca)Ma=Ka;else{Fa=c[o>>2]|0;Ga=Ka;Ha=La;T=54}}while(0);if((T|0)==54){T=0;c[o>>2]=Fa>>Ha+2;Ma=Ga}if((Ma|0)==1)c[m>>2]=c[m>>2]>>3;else if((Ma|0)==2)c[m>>2]=c[m>>2]>>4;else if((Ma|0)==3)c[m>>2]=(c[m>>2]|0)*21>>9;else c[m>>2]=c[m>>2]>>5;Gc(m);Ca=0;la=l+((E<<6)+256)|0;Ea=m;while(1){Y=c[Ea+((Ca>>>1&3)<<2)>>2]|0;if((Y|0)<0)Oa=0;else Oa=(Y|0)>255?-1:Y&255;a[la>>0]=Oa;Y=Ca+1|0;if((Y|0)==64)break;else{Ca=Y;la=la+1|0;Ea=(Y&15|0)==0?Ea+16|0:Ea}}E=E+1|0;if((E|0)==2)break;else{G=ma;v=na;w=oa;x=pa;y=ra;B=sa;C=ta;D=ua;ka=xa;K=ya;L=za;M=Aa;N=N+q|0}}vc(e,l);i=k;return}function Gc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;b=i;d=a+4|0;e=c[d>>2]|0;f=a+16|0;g=c[f>>2]|0;h=c[a>>2]|0;if(!(e|g)){c[a+60>>2]=h;c[a+56>>2]=h;c[a+52>>2]=h;c[a+48>>2]=h;c[a+44>>2]=h;c[a+40>>2]=h;c[a+36>>2]=h;c[a+32>>2]=h;c[a+28>>2]=h;c[a+24>>2]=h;c[a+20>>2]=h;c[f>>2]=h;c[a+12>>2]=h;c[a+8>>2]=h;c[d>>2]=h;i=b;return}else{f=e+h|0;j=e>>1;k=j+h|0;l=h-j|0;j=h-e|0;c[a>>2]=g+f;e=g>>1;c[a+16>>2]=e+f;c[a+32>>2]=f-e;c[a+48>>2]=f-g;c[d>>2]=g+k;c[a+20>>2]=e+k;c[a+36>>2]=k-e;c[a+52>>2]=k-g;c[a+8>>2]=g+l;c[a+24>>2]=e+l;c[a+40>>2]=l-e;c[a+56>>2]=l-g;c[a+12>>2]=g+j;c[a+28>>2]=e+j;c[a+44>>2]=j-e;c[a+60>>2]=j-g;i=b;return}}function Hc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;ld(b,0,952);e=jb(a,1)|0;if((e|0)==-1){f=1;i=d;return f|0}g=(e|0)==1;c[b>>2]=g&1;do if(g){e=jb(a,8)|0;if((e|0)==-1){f=1;i=d;return f|0}c[b+4>>2]=e;if((e|0)==255){e=jb(a,16)|0;if((e|0)==-1){f=1;i=d;return f|0}c[b+8>>2]=e;e=jb(a,16)|0;if((e|0)==-1){f=1;i=d;return f|0}else{c[b+12>>2]=e;break}}}while(0);g=jb(a,1)|0;if((g|0)==-1){f=1;i=d;return f|0}e=(g|0)==1;c[b+16>>2]=e&1;do if(e){g=jb(a,1)|0;if((g|0)==-1){f=1;i=d;return f|0}else{c[b+20>>2]=(g|0)==1&1;break}}while(0);e=jb(a,1)|0;if((e|0)==-1){f=1;i=d;return f|0}g=(e|0)==1;c[b+24>>2]=g&1;do if(g){e=jb(a,3)|0;if((e|0)==-1){f=1;i=d;return f|0}c[b+28>>2]=e;e=jb(a,1)|0;if((e|0)==-1){f=1;i=d;return f|0}c[b+32>>2]=(e|0)==1&1;e=jb(a,1)|0;if((e|0)==-1){f=1;i=d;return f|0}h=(e|0)==1;c[b+36>>2]=h&1;if(!h){c[b+40>>2]=2;c[b+44>>2]=2;c[b+48>>2]=2;break}h=jb(a,8)|0;if((h|0)==-1){f=1;i=d;return f|0}c[b+40>>2]=h;h=jb(a,8)|0;if((h|0)==-1){f=1;i=d;return f|0}c[b+44>>2]=h;h=jb(a,8)|0;if((h|0)==-1){f=1;i=d;return f|0}else{c[b+48>>2]=h;break}}else{c[b+28>>2]=5;c[b+40>>2]=2;c[b+44>>2]=2;c[b+48>>2]=2}while(0);g=jb(a,1)|0;if((g|0)==-1){f=1;i=d;return f|0}h=(g|0)==1;c[b+52>>2]=h&1;if(h){h=b+56|0;g=nb(a,h)|0;if(g){f=g;i=d;return f|0}if((c[h>>2]|0)>>>0>5){f=1;i=d;return f|0}h=b+60|0;g=nb(a,h)|0;if(g){f=g;i=d;return f|0}if((c[h>>2]|0)>>>0>5){f=1;i=d;return f|0}}h=jb(a,1)|0;if((h|0)==-1){f=1;i=d;return f|0}g=(h|0)==1;c[b+64>>2]=g&1;do if(g){h=kb(a)|0;if((lb(a,32)|0)==-1|(h|0)==0){f=1;i=d;return f|0}c[b+68>>2]=h;h=kb(a)|0;if((lb(a,32)|0)==-1|(h|0)==0){f=1;i=d;return f|0}c[b+72>>2]=h;h=jb(a,1)|0;if((h|0)==-1){f=1;i=d;return f|0}else{c[b+76>>2]=(h|0)==1&1;break}}while(0);g=jb(a,1)|0;if((g|0)==-1){f=1;i=d;return f|0}h=(g|0)==1;g=b+80|0;c[g>>2]=h&1;if(h){h=Ic(a,b+84|0)|0;if(h){f=h;i=d;return f|0}}else{c[b+84>>2]=1;c[b+96>>2]=288000001;c[b+224>>2]=288000001;c[b+480>>2]=24;c[b+484>>2]=24;c[b+488>>2]=24;c[b+492>>2]=24}h=jb(a,1)|0;if((h|0)==-1){f=1;i=d;return f|0}e=(h|0)==1;h=b+496|0;c[h>>2]=e&1;if(e){e=Ic(a,b+500|0)|0;if(e){f=e;i=d;return f|0}}else{c[b+500>>2]=1;c[b+512>>2]=240000001;c[b+640>>2]=240000001;c[b+896>>2]=24;c[b+900>>2]=24;c[b+904>>2]=24;c[b+908>>2]=24}if(!((c[g>>2]|0)==0?(c[h>>2]|0)==0:0))j=46;do if((j|0)==46){h=jb(a,1)|0;if((h|0)==-1){f=1;i=d;return f|0}else{c[b+912>>2]=(h|0)==1&1;break}}while(0);j=jb(a,1)|0;if((j|0)==-1){f=1;i=d;return f|0}c[b+916>>2]=(j|0)==1&1;j=jb(a,1)|0;if((j|0)==-1){f=1;i=d;return f|0}h=(j|0)==1;c[b+920>>2]=h&1;do if(h){j=jb(a,1)|0;if((j|0)==-1){f=1;i=d;return f|0}c[b+924>>2]=(j|0)==1&1;j=b+928|0;g=nb(a,j)|0;if(g){f=g;i=d;return f|0}if((c[j>>2]|0)>>>0>16){f=1;i=d;return f|0}j=b+932|0;g=nb(a,j)|0;if(g){f=g;i=d;return f|0}if((c[j>>2]|0)>>>0>16){f=1;i=d;return f|0}j=b+936|0;g=nb(a,j)|0;if(g){f=g;i=d;return f|0}if((c[j>>2]|0)>>>0>16){f=1;i=d;return f|0}j=b+940|0;g=nb(a,j)|0;if(g){f=g;i=d;return f|0}if((c[j>>2]|0)>>>0>16){f=1;i=d;return f|0}j=nb(a,b+944|0)|0;if(j){f=j;i=d;return f|0}j=nb(a,b+948|0)|0;if(!j)break;else f=j;i=d;return f|0}else{c[b+924>>2]=1;c[b+928>>2]=2;c[b+932>>2]=1;c[b+936>>2]=16;c[b+940>>2]=16;c[b+944>>2]=16;c[b+948>>2]=16}while(0);f=0;i=d;return f|0}function Ic(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;d=i;e=nb(a,b)|0;a:do if(!e){f=(c[b>>2]|0)+1|0;c[b>>2]=f;if((f>>>0<=32?(f=jb(a,4)|0,(f|0)!=-1):0)?(g=b+4|0,c[g>>2]=f,f=jb(a,4)|0,(f|0)!=-1):0){h=b+8|0;c[h>>2]=f;if(c[b>>2]|0){f=0;do{j=b+(f<<2)+12|0;k=nb(a,j)|0;if(k){l=k;break a}k=c[j>>2]|0;if((k|0)==-1){l=1;break a}m=k+1|0;c[j>>2]=m;c[j>>2]=m<<(c[g>>2]|0)+6;m=b+(f<<2)+140|0;j=nb(a,m)|0;if(j){l=j;break a}j=c[m>>2]|0;if((j|0)==-1){l=1;break a}k=j+1|0;c[m>>2]=k;c[m>>2]=k<<(c[h>>2]|0)+4;k=jb(a,1)|0;if((k|0)==-1){l=1;break a}c[b+(f<<2)+268>>2]=(k|0)==1&1;f=f+1|0}while(f>>>0<(c[b>>2]|0)>>>0)}f=jb(a,5)|0;if((((f|0)!=-1?(c[b+396>>2]=f+1,f=jb(a,5)|0,(f|0)!=-1):0)?(c[b+400>>2]=f+1,f=jb(a,5)|0,(f|0)!=-1):0)?(c[b+404>>2]=f+1,f=jb(a,5)|0,(f|0)!=-1):0){c[b+408>>2]=f;l=0}else l=1}else l=1}else l=e;while(0);i=d;return l|0}function Jc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;f=i;a:do if(!(c[d+284>>2]|0))g=0;else{h=0;while(1){j=c[d+(h*20|0)+288>>2]|0;if((j|0)==5){g=1;break a}else if(!j)break;h=h+1|0}g=0}while(0);h=c[b+16>>2]|0;if(!h){if((c[e>>2]|0)!=5){j=c[a>>2]|0;k=c[d+20>>2]|0;if(j>>>0>k>>>0?(l=c[b+20>>2]|0,(j-k|0)>>>0>=l>>>1>>>0):0){m=k;n=a;o=(c[a+4>>2]|0)+l|0}else{p=a;q=k;r=j;s=11}}else{c[a+4>>2]=0;c[a>>2]=0;p=a;q=c[d+20>>2]|0;r=0;s=11}do if((s|0)==11){if(q>>>0>r>>>0?(j=c[b+20>>2]|0,(q-r|0)>>>0>j>>>1>>>0):0){m=q;n=p;o=(c[a+4>>2]|0)-j|0;break}m=q;n=p;o=c[a+4>>2]|0}while(0);if(!(c[e+4>>2]|0)){p=c[d+24>>2]|0;t=m+o+((p|0)<0?p:0)|0;i=f;return t|0}c[a+4>>2]=o;p=c[d+24>>2]|0;q=(p|0)<0;if(!g){c[n>>2]=m;t=m+o+(q?p:0)|0;i=f;return t|0}else{c[a+4>>2]=0;c[n>>2]=q?0-p|0:0;t=0;i=f;return t|0}}else if((h|0)==1){if((c[e>>2]|0)!=5){h=c[a+12>>2]|0;if((c[a+8>>2]|0)>>>0>(c[d+12>>2]|0)>>>0)u=(c[b+12>>2]|0)+h|0;else u=h}else u=0;h=c[b+36>>2]|0;p=(h|0)==0;if(p)v=0;else v=(c[d+12>>2]|0)+u|0;q=(c[e+4>>2]|0)==0;n=((q&(v|0)!=0)<<31>>31)+v|0;v=(n|0)!=0;if(v){o=n+-1|0;w=(o>>>0)%(h>>>0)|0;x=(o>>>0)/(h>>>0)|0}else{w=0;x=0}if(p)y=0;else{p=c[b+40>>2]|0;o=0;n=0;while(1){m=(c[p+(n<<2)>>2]|0)+o|0;n=n+1|0;if(n>>>0>=h>>>0){y=m;break}else o=m}}if(v){v=Z(y,x)|0;x=c[b+40>>2]|0;y=0;o=v;while(1){v=(c[x+(y<<2)>>2]|0)+o|0;y=y+1|0;if(y>>>0>w>>>0){z=v;break}else o=v}}else z=0;if(q)A=(c[b+28>>2]|0)+z|0;else A=z;z=(c[d+32>>2]|0)+(c[b+32>>2]|0)|0;q=a+12|0;if(!g){o=((z|0)<0?z:0)+A+(c[d+28>>2]|0)|0;c[q>>2]=u;c[a+8>>2]=c[d+12>>2];t=o;i=f;return t|0}else{c[q>>2]=0;c[a+8>>2]=0;t=0;i=f;return t|0}}else{if((c[e>>2]|0)==5){B=a+12|0;C=0;D=0}else{q=c[d+12>>2]|0;o=a+12|0;u=c[o>>2]|0;if((c[a+8>>2]|0)>>>0>q>>>0)E=(c[b+12>>2]|0)+u|0;else E=u;B=o;C=E;D=(q+E<<1)+(((c[e+4>>2]|0)==0)<<31>>31)|0}if(!g){c[B>>2]=C;c[a+8>>2]=c[d+12>>2];t=D;i=f;return t|0}else{c[B>>2]=0;c[a+8>>2]=0;t=0;i=f;return t|0}}return 0}function Kc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;Ab(a);e=id(2112)|0;c[a+3376>>2]=e;if(e)if(!b)f=0;else{c[a+1216>>2]=1;f=0}else f=1;i=d;return f|0}function Lc(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;g=i;i=i+208|0;h=g+204|0;j=g;k=g+112|0;l=g+40|0;m=g+16|0;n=g+12|0;o=g+8|0;c[n>>2]=0;p=a+3344|0;if((c[p>>2]|0)!=0?(c[a+3348>>2]|0)==(b|0):0){q=a+3356|0;c[m+0>>2]=c[q+0>>2];c[m+4>>2]=c[q+4>>2];c[m+8>>2]=c[q+8>>2];c[m+12>>2]=c[q+12>>2];c[m+4>>2]=c[m>>2];c[m+8>>2]=0;c[m+16>>2]=0;c[f>>2]=c[a+3352>>2]}else r=4;do if((r|0)==4)if(!(Pa(b,d,m,f)|0)){q=a+3356|0;c[q+0>>2]=c[m+0>>2];c[q+4>>2]=c[m+4>>2];c[q+8>>2]=c[m+8>>2];c[q+12>>2]=c[m+12>>2];c[q+16>>2]=c[m+16>>2];c[a+3352>>2]=c[f>>2];c[a+3348>>2]=b;break}else{s=3;i=g;return s|0}while(0);c[p>>2]=0;if(sb(m,j)|0){s=3;i=g;return s|0}if(((c[j>>2]|0)+-1|0)>>>0>11){s=0;i=g;return s|0}b=Ib(m,j,a,n)|0;if((b|0)==65520){s=4;i=g;return s|0}else if(!b){do if(!(c[n>>2]|0))r=19;else{if((c[a+1184>>2]|0)!=0?(c[a+16>>2]|0)!=0:0){if(c[a+3380>>2]|0){s=3;i=g;return s|0}if(!(c[a+1188>>2]|0)){b=a+1220|0;d=a+1336|0;c[d>>2]=lc(b)|0;pc(b);Ec(a,d,0)|0}else Ec(a,a+1336|0,c[a+1372>>2]|0)|0;c[f>>2]=0;c[p>>2]=1;c[a+1180>>2]=0;t=a+1360|0;u=a+1336|0;break}c[a+1188>>2]=0;c[a+1180>>2]=0;r=19}while(0);do if((r|0)==19){n=c[j>>2]|0;if((n|0)==1|(n|0)==5){d=a+1180|0;if(c[a+1180>>2]|0){s=0;i=g;return s|0}c[a+1184>>2]=1;if(Fb(a)|0){c[a+1204>>2]=0;c[a+1208>>2]=e;Ua(m,h)|0;b=a+8|0;q=c[b>>2]|0;v=Db(a,c[h>>2]|0,(c[j>>2]|0)==5&1)|0;if(v){c[a+4>>2]=256;c[a+12>>2]=0;c[b>>2]=32;c[a+16>>2]=0;c[a+3380>>2]=0;s=(v|0)==65535?5:4;i=g;return s|0}if((q|0)!=(c[b>>2]|0)){q=c[a+16>>2]|0;c[o>>2]=1;v=c[a>>2]|0;if(v>>>0<32)w=c[a+(v<<2)+20>>2]|0;else w=0;c[f>>2]=0;c[p>>2]=1;if((((((c[j>>2]|0)==5?(v=_a(o,m,q,c[a+12>>2]|0,5)|0,(c[o>>2]|v|0)==0):0)?(v=a+1220|0,!((c[a+1276>>2]|0)!=0|(w|0)==0)):0)?(c[w+52>>2]|0)==(c[q+52>>2]|0):0)?(c[w+56>>2]|0)==(c[q+56>>2]|0):0)?(c[w+88>>2]|0)==(c[q+88>>2]|0):0)sc(v);else c[a+1280>>2]=0;c[a>>2]=c[b>>2];s=2;i=g;return s|0}}if(c[a+3380>>2]|0){s=3;i=g;return s|0}b=a+1368|0;v=a+2356|0;q=a+16|0;if(Ta(m,v,c[q>>2]|0,c[a+12>>2]|0,j)|0){s=3;i=g;return s|0}if(!(Fb(a)|0))x=a+1220|0;else{y=a+1220|0;if((c[j>>2]|0)!=5?(qc(y,c[a+2368>>2]|0,(c[j+4>>2]|0)!=0&1,c[(c[q>>2]|0)+48>>2]|0)|0)!=0:0){s=3;i=g;return s|0}c[a+1336>>2]=lc(y)|0;x=y}rd(b|0,v|0,988)|0;c[a+1188>>2]=1;v=a+1360|0;y=j;q=c[y+4>>2]|0;z=v;c[z>>2]=c[y>>2];c[z+4>>2]=q;Hb(a,c[a+1432>>2]|0);pc(x);if(ic(x,a+1436|0,c[a+1380>>2]|0,c[a+1412>>2]|0)|0){s=3;i=g;return s|0}q=a+1336|0;if($a(m,a,q,b)|0){ab(a,c[b>>2]|0);s=3;i=g;return s|0}if(!(Gb(a)|0)){s=0;i=g;return s|0}else{c[d>>2]=1;t=v;u=q;break}}else if((n|0)==7)if(!(Qa(m,k)|0)){Bb(a,k)|0;s=0;i=g;return s|0}else{q=k+40|0;jd(c[q>>2]|0);c[q>>2]=0;q=k+84|0;jd(c[q>>2]|0);c[q>>2]=0;s=3;i=g;return s|0}else if((n|0)==8)if(!(Sa(m,l)|0)){Cb(a,l)|0;s=0;i=g;return s|0}else{n=l+20|0;jd(c[n>>2]|0);c[n>>2]=0;n=l+24|0;jd(c[n>>2]|0);c[n>>2]=0;n=l+28|0;jd(c[n>>2]|0);c[n>>2]=0;n=l+44|0;jd(c[n>>2]|0);c[n>>2]=0;s=3;i=g;return s|0}else{s=0;i=g;return s|0}}while(0);xc(u,c[a+1212>>2]|0);Eb(a);l=Jc(a+1284|0,c[a+16>>2]|0,a+1368|0,t)|0;m=a+1188|0;do if(c[m>>2]|0){k=a+1220|0;if(!(c[a+1364>>2]|0)){jc(k,0,u,c[a+1380>>2]|0,l,(c[t>>2]|0)==5&1,c[a+1208>>2]|0,c[a+1204>>2]|0)|0;break}else{jc(k,a+1644|0,u,c[a+1380>>2]|0,l,(c[t>>2]|0)==5&1,c[a+1208>>2]|0,c[a+1204>>2]|0)|0;break}}while(0);c[a+1184>>2]=0;c[m>>2]=0;s=1;i=g;return s|0}else{s=3;i=g;return s|0}return 0}function Mc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;d=0;do{e=a+(d<<2)+20|0;f=c[e>>2]|0;if(f){jd(c[f+40>>2]|0);c[(c[e>>2]|0)+40>>2]=0;jd(c[(c[e>>2]|0)+84>>2]|0);c[(c[e>>2]|0)+84>>2]=0;jd(c[e>>2]|0);c[e>>2]=0}d=d+1|0}while((d|0)!=32);g=0;do{d=a+(g<<2)+148|0;e=c[d>>2]|0;if(e){jd(c[e+20>>2]|0);c[(c[d>>2]|0)+20>>2]=0;jd(c[(c[d>>2]|0)+24>>2]|0);c[(c[d>>2]|0)+24>>2]=0;jd(c[(c[d>>2]|0)+28>>2]|0);c[(c[d>>2]|0)+28>>2]=0;jd(c[(c[d>>2]|0)+44>>2]|0);c[(c[d>>2]|0)+44>>2]=0;jd(c[d>>2]|0);c[d>>2]=0}g=g+1|0}while((g|0)!=256);g=a+3376|0;jd(c[g>>2]|0);c[g>>2]=0;g=a+1212|0;jd(c[g>>2]|0);c[g>>2]=0;g=a+1172|0;jd(c[g>>2]|0);c[g>>2]=0;oc(a+1220|0);i=b;return}function Nc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=i;g=rc(a+1220|0)|0;if(!g){h=0;i=f;return h|0}c[b>>2]=c[g+4>>2];c[d>>2]=c[g+12>>2];c[e>>2]=c[g+8>>2];h=c[g>>2]|0;i=f;return h|0}function Oc(a){a=a|0;var b=0,d=0;b=c[a+16>>2]|0;if(!b)d=0;else d=c[b+52>>2]|0;return d|0}function Pc(a){a=a|0;var b=0,d=0;b=c[a+16>>2]|0;if(!b)d=0;else d=c[b+56>>2]|0;return d|0}function Qc(a){a=a|0;var b=0;b=i;sc(a+1220|0);i=b;return}function Rc(a){a=a|0;var b=0,c=0;b=i;c=(Jb(a)|0)==0&1;i=b;return c|0}function Sc(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[a+16>>2]|0;if(((((d|0)!=0?(c[d+80>>2]|0)!=0:0)?(a=c[d+84>>2]|0,(a|0)!=0):0)?(c[a+24>>2]|0)!=0:0)?(c[a+32>>2]|0)!=0:0){e=1;i=b;return e|0}e=0;i=b;return e|0}function Tc(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[a+16>>2]|0;if(((((d|0)!=0?(c[d+80>>2]|0)!=0:0)?(a=c[d+84>>2]|0,(a|0)!=0):0)?(c[a+24>>2]|0)!=0:0)?(c[a+36>>2]|0)!=0:0)e=c[a+48>>2]|0;else e=2;i=b;return e|0}function Uc(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0;h=i;j=c[a+16>>2]|0;if((j|0)!=0?(c[j+60>>2]|0)!=0:0){c[b>>2]=1;a=j+64|0;c[d>>2]=c[a>>2]<<1;c[e>>2]=(c[j+52>>2]<<4)-((c[j+68>>2]|0)+(c[a>>2]|0)<<1);a=j+72|0;c[f>>2]=c[a>>2]<<1;k=(c[j+56>>2]<<4)-((c[j+76>>2]|0)+(c[a>>2]|0)<<1)|0;c[g>>2]=k;i=h;return}c[b>>2]=0;c[d>>2]=0;c[e>>2]=0;c[f>>2]=0;k=0;c[g>>2]=k;i=h;return}function Vc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;f=c[a+16>>2]|0;a:do if((((f|0)!=0?(c[f+80>>2]|0)!=0:0)?(a=c[f+84>>2]|0,(a|0)!=0):0)?(c[a>>2]|0)!=0:0){g=c[a+4>>2]|0;do switch(g|0){case 11:{h=11;j=15;break a;break}case 255:{k=c[a+8>>2]|0;l=c[a+12>>2]|0;m=(k|0)==0|(l|0)==0;h=m?0:l;j=m?0:k;break a;break}case 1:case 0:{h=g;j=g;break a;break}case 6:{h=11;j=24;break a;break}case 13:{h=99;j=160;break a;break}case 5:{h=33;j=40;break a;break}case 4:{h=11;j=16;break a;break}case 10:{h=11;j=18;break a;break}case 8:{h=11;j=32;break a;break}case 2:{h=11;j=12;break a;break}case 7:{h=11;j=20;break a;break}case 12:{h=33;j=64;break a;break}case 9:{h=33;j=80;break a;break}case 3:{h=11;j=10;break a;break}default:{h=0;j=0;break a}}while(0)}else{h=1;j=1}while(0);c[b>>2]=j;c[d>>2]=h;i=e;return}function Wc(a){a=a|0;var b=0,d=0;b=c[a+16>>2]|0;if(!b)d=0;else d=c[b>>2]|0;return d|0}function Xc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;do if(a){e=id(3396)|0;if(e){f=e+8|0;if(!(Kc(f,b)|0)){c[e>>2]=1;c[e+4>>2]=0;c[a>>2]=e;g=0;break}else{Mc(f);jd(e);g=-4;break}}else g=-4}else g=-1;while(0);i=d;return g|0}function Yc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;if((a|0)==0|(b|0)==0){e=-1;i=d;return e|0}f=a+8|0;if(!(c[a+24>>2]|0)){e=-6;i=d;return e|0}if(!(c[a+20>>2]|0)){e=-6;i=d;return e|0}c[b+4>>2]=(Oc(f)|0)<<4;c[b+8>>2]=(Pc(f)|0)<<4;c[b+12>>2]=Sc(f)|0;c[b+16>>2]=Tc(f)|0;Uc(f,b+28|0,b+32|0,b+36|0,b+40|0,b+44|0);Vc(f,b+20|0,b+24|0);c[b>>2]=Wc(f)|0;e=0;i=d;return e|0}function Zc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;e=i;i=i+16|0;f=e;a:do if((!((b|0)==0|(d|0)==0)?(g=c[b>>2]|0,(g|0)!=0):0)?(h=c[b+4>>2]|0,(h|0)!=0):0)if((a|0)!=0?(j=c[a>>2]|0,(j|0)!=0):0){c[d>>2]=0;c[f>>2]=0;k=a+8|0;c[a+3392>>2]=c[b+12>>2];l=b+8|0;m=j;j=1;n=h;h=g;while(1){if((m|0)==2){o=8;break}g=Lc(k,h,n,c[l>>2]|0,f)|0;p=c[f>>2]|0;q=h+p|0;r=n-p|0;s=(r|0)<0?0:r;c[d>>2]=q;if((g|0)==2)break;else if((g|0)==5){t=-4;break a}else if((g|0)==4){r=(Rc(k)|0|s|0)==0;u=r?-2:j}else if((g|0)==1){o=13;break}else u=j;if(!s){t=u;break a}m=c[a>>2]|0;j=u;n=s;h=q}if((o|0)==8){c[a>>2]=1;c[d>>2]=h+(c[f>>2]|0)}else if((o|0)==13){n=a+4|0;c[n>>2]=(c[n>>2]|0)+1;t=(s|0)==0?2:3;break}n=a+1288|0;if((c[n>>2]|0)!=0?(c[a+1244>>2]|0)!=(c[a+1248>>2]|0):0){c[n>>2]=0;c[a>>2]=2;t=3}else t=4}else t=-3;else t=-1;while(0);i=e;return t|0}function _c(a){a=a|0;c[a>>2]=2;c[a+4>>2]=3;return}function $c(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+16|0;f=e+8|0;g=e+4|0;h=e;if((a|0)==0|(b|0)==0){j=-1;i=e;return j|0}k=a+8|0;if(d)Qc(k);d=Nc(k,h,g,f)|0;if(!d){j=0;i=e;return j|0}c[b>>2]=d;c[b+4>>2]=c[h>>2];c[b+8>>2]=c[g>>2];c[b+12>>2]=c[f>>2];j=2;i=e;return j|0}function ad(a){a=a|0;var b=0,d=0;b=i;d=md(a)|0;c[1792]=d;c[1791]=d;c[1790]=a;c[1793]=d+a;i=b;return d|0}function bd(a){a=a|0;c[1790]=a;return}function cd(){var a=0;a=i;c[1786]=c[1791];c[1787]=c[1790];do ed()|0;while((c[1787]|0)!=0);i=a;return}function dd(){var a=0,b=0;a=i;if(Xc(7176,0)|0){da(7280)|0;b=c[1784]|0;if(b)nd(b)}else{c[1796]=1;c[1798]=1}i=a;return -1}function ed(){var a=0,b=0,d=0,e=0;a=i;c[1788]=c[1798];b=Zc(c[1794]|0,7144,7200)|0;switch(b|0){case 1:case -2:{c[1787]=0;d=b;i=a;return d|0}case 2:{c[1787]=0;break}case 4:{if(Yc(c[1794]|0,7208)|0){d=-1;i=a;return d|0}c[1814]=(Z((c[1803]|0)*3|0,c[1804]|0)|0)>>>1;ra();e=c[1800]|0;c[1787]=(c[1786]|0)-e+(c[1787]|0);c[1786]=e;d=0;i=a;return d|0}case 3:{e=c[1800]|0;c[1787]=(c[1786]|0)-e+(c[1787]|0);c[1786]=e;break}default:{d=b;i=a;return d|0}}c[1798]=(c[1798]|0)+1;if(($c(c[1794]|0,7264,0)|0)!=2){d=b;i=a;return d|0}do{c[1796]=(c[1796]|0)+1;ca(c[1816]|0,c[1803]|0,c[1804]|0)}while(($c(c[1794]|0,7264,0)|0)==2);d=b;i=a;return d|0}function fd(){var a=0,b=0;a=i;b=c[1784]|0;if(b)nd(b);i=a;return}function gd(){var a=0,b=0;a=i;i=i+16|0;b=a;_c(b);i=a;return c[b>>2]|0}function hd(){var a=0,b=0;a=i;i=i+16|0;b=a;_c(b);i=a;return c[b+4>>2]|0}function id(a){a=a|0;var b=0,c=0;b=i;c=md(a)|0;i=b;return c|0}function jd(a){a=a|0;var b=0;b=i;nd(a);i=b;return}function kd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=i;rd(a|0,b|0,c|0)|0;i=d;return}function ld(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=i;qd(a|0,b&255|0,c|0)|0;i=d;return}function md(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,la=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0;b=i;do if(a>>>0<245){if(a>>>0<11)d=16;else d=a+11&-8;e=d>>>3;f=c[1828]|0;g=f>>>e;if(g&3){h=(g&1^1)+e|0;j=h<<1;k=7352+(j<<2)|0;l=7352+(j+2<<2)|0;j=c[l>>2]|0;m=j+8|0;n=c[m>>2]|0;do if((k|0)!=(n|0)){if(n>>>0<(c[1832]|0)>>>0)ka();o=n+12|0;if((c[o>>2]|0)==(j|0)){c[o>>2]=k;c[l>>2]=n;break}else ka()}else c[1828]=f&~(1<<h);while(0);n=h<<3;c[j+4>>2]=n|3;l=j+(n|4)|0;c[l>>2]=c[l>>2]|1;p=m;i=b;return p|0}l=c[1830]|0;if(d>>>0>l>>>0){if(g){n=2<<e;k=g<<e&(n|0-n);n=(k&0-k)+-1|0;k=n>>>12&16;o=n>>>k;n=o>>>5&8;q=o>>>n;o=q>>>2&4;r=q>>>o;q=r>>>1&2;s=r>>>q;r=s>>>1&1;t=(n|k|o|q|r)+(s>>>r)|0;r=t<<1;s=7352+(r<<2)|0;q=7352+(r+2<<2)|0;r=c[q>>2]|0;o=r+8|0;k=c[o>>2]|0;do if((s|0)!=(k|0)){if(k>>>0<(c[1832]|0)>>>0)ka();n=k+12|0;if((c[n>>2]|0)==(r|0)){c[n>>2]=s;c[q>>2]=k;u=c[1830]|0;break}else ka()}else{c[1828]=f&~(1<<t);u=l}while(0);l=t<<3;f=l-d|0;c[r+4>>2]=d|3;k=r+d|0;c[r+(d|4)>>2]=f|1;c[r+l>>2]=f;if(u){l=c[1833]|0;q=u>>>3;s=q<<1;e=7352+(s<<2)|0;g=c[1828]|0;m=1<<q;if(g&m){q=7352+(s+2<<2)|0;j=c[q>>2]|0;if(j>>>0<(c[1832]|0)>>>0)ka();else{v=q;w=j}}else{c[1828]=g|m;v=7352+(s+2<<2)|0;w=e}c[v>>2]=l;c[w+12>>2]=l;c[l+8>>2]=w;c[l+12>>2]=e}c[1830]=f;c[1833]=k;p=o;i=b;return p|0}k=c[1829]|0;if(k){f=(k&0-k)+-1|0;k=f>>>12&16;e=f>>>k;f=e>>>5&8;l=e>>>f;e=l>>>2&4;s=l>>>e;l=s>>>1&2;m=s>>>l;s=m>>>1&1;g=c[7616+((f|k|e|l|s)+(m>>>s)<<2)>>2]|0;s=(c[g+4>>2]&-8)-d|0;m=g;l=g;while(1){g=c[m+16>>2]|0;if(!g){e=c[m+20>>2]|0;if(!e)break;else x=e}else x=g;g=(c[x+4>>2]&-8)-d|0;e=g>>>0<s>>>0;s=e?g:s;m=x;l=e?x:l}m=c[1832]|0;if(l>>>0<m>>>0)ka();o=l+d|0;if(l>>>0>=o>>>0)ka();r=c[l+24>>2]|0;t=c[l+12>>2]|0;do if((t|0)==(l|0)){e=l+20|0;g=c[e>>2]|0;if(!g){k=l+16|0;f=c[k>>2]|0;if(!f){y=0;break}else{z=f;A=k}}else{z=g;A=e}while(1){e=z+20|0;g=c[e>>2]|0;if(g){z=g;A=e;continue}e=z+16|0;g=c[e>>2]|0;if(!g)break;else{z=g;A=e}}if(A>>>0<m>>>0)ka();else{c[A>>2]=0;y=z;break}}else{e=c[l+8>>2]|0;if(e>>>0<m>>>0)ka();g=e+12|0;if((c[g>>2]|0)!=(l|0))ka();k=t+8|0;if((c[k>>2]|0)==(l|0)){c[g>>2]=t;c[k>>2]=e;y=t;break}else ka()}while(0);do if(r){t=c[l+28>>2]|0;m=7616+(t<<2)|0;if((l|0)==(c[m>>2]|0)){c[m>>2]=y;if(!y){c[1829]=c[1829]&~(1<<t);break}}else{if(r>>>0<(c[1832]|0)>>>0)ka();t=r+16|0;if((c[t>>2]|0)==(l|0))c[t>>2]=y;else c[r+20>>2]=y;if(!y)break}t=c[1832]|0;if(y>>>0<t>>>0)ka();c[y+24>>2]=r;m=c[l+16>>2]|0;do if(m)if(m>>>0<t>>>0)ka();else{c[y+16>>2]=m;c[m+24>>2]=y;break}while(0);m=c[l+20>>2]|0;if(m)if(m>>>0<(c[1832]|0)>>>0)ka();else{c[y+20>>2]=m;c[m+24>>2]=y;break}}while(0);if(s>>>0<16){r=s+d|0;c[l+4>>2]=r|3;m=l+(r+4)|0;c[m>>2]=c[m>>2]|1}else{c[l+4>>2]=d|3;c[l+(d|4)>>2]=s|1;c[l+(s+d)>>2]=s;m=c[1830]|0;if(m){r=c[1833]|0;t=m>>>3;m=t<<1;e=7352+(m<<2)|0;k=c[1828]|0;g=1<<t;if(k&g){t=7352+(m+2<<2)|0;f=c[t>>2]|0;if(f>>>0<(c[1832]|0)>>>0)ka();else{B=t;C=f}}else{c[1828]=k|g;B=7352+(m+2<<2)|0;C=e}c[B>>2]=r;c[C+12>>2]=r;c[r+8>>2]=C;c[r+12>>2]=e}c[1830]=s;c[1833]=o}p=l+8|0;i=b;return p|0}else D=d}else D=d}else if(a>>>0<=4294967231){e=a+11|0;r=e&-8;m=c[1829]|0;if(m){g=0-r|0;k=e>>>8;if(k)if(r>>>0>16777215)E=31;else{e=(k+1048320|0)>>>16&8;f=k<<e;k=(f+520192|0)>>>16&4;t=f<<k;f=(t+245760|0)>>>16&2;j=14-(k|e|f)+(t<<f>>>15)|0;E=r>>>(j+7|0)&1|j<<1}else E=0;j=c[7616+(E<<2)>>2]|0;a:do if(!j){F=g;G=0;H=0}else{if((E|0)==31)I=0;else I=25-(E>>>1)|0;f=g;t=0;e=r<<I;k=j;q=0;while(1){h=c[k+4>>2]&-8;n=h-r|0;if(n>>>0<f>>>0)if((h|0)==(r|0)){F=n;G=k;H=k;break a}else{J=n;K=k}else{J=f;K=q}n=c[k+20>>2]|0;k=c[k+(e>>>31<<2)+16>>2]|0;h=(n|0)==0|(n|0)==(k|0)?t:n;if(!k){F=J;G=h;H=K;break}else{f=J;t=h;e=e<<1;q=K}}}while(0);if((G|0)==0&(H|0)==0){j=2<<E;g=m&(j|0-j);if(!g){D=r;break}j=(g&0-g)+-1|0;g=j>>>12&16;l=j>>>g;j=l>>>5&8;o=l>>>j;l=o>>>2&4;s=o>>>l;o=s>>>1&2;q=s>>>o;s=q>>>1&1;L=c[7616+((j|g|l|o|s)+(q>>>s)<<2)>>2]|0}else L=G;if(!L){M=F;N=H}else{s=F;q=L;o=H;while(1){l=(c[q+4>>2]&-8)-r|0;g=l>>>0<s>>>0;j=g?l:s;l=g?q:o;g=c[q+16>>2]|0;if(g){s=j;q=g;o=l;continue}q=c[q+20>>2]|0;if(!q){M=j;N=l;break}else{s=j;o=l}}}if((N|0)!=0?M>>>0<((c[1830]|0)-r|0)>>>0:0){o=c[1832]|0;if(N>>>0<o>>>0)ka();s=N+r|0;if(N>>>0>=s>>>0)ka();q=c[N+24>>2]|0;m=c[N+12>>2]|0;do if((m|0)==(N|0)){l=N+20|0;j=c[l>>2]|0;if(!j){g=N+16|0;e=c[g>>2]|0;if(!e){O=0;break}else{P=e;Q=g}}else{P=j;Q=l}while(1){l=P+20|0;j=c[l>>2]|0;if(j){P=j;Q=l;continue}l=P+16|0;j=c[l>>2]|0;if(!j)break;else{P=j;Q=l}}if(Q>>>0<o>>>0)ka();else{c[Q>>2]=0;O=P;break}}else{l=c[N+8>>2]|0;if(l>>>0<o>>>0)ka();j=l+12|0;if((c[j>>2]|0)!=(N|0))ka();g=m+8|0;if((c[g>>2]|0)==(N|0)){c[j>>2]=m;c[g>>2]=l;O=m;break}else ka()}while(0);do if(q){m=c[N+28>>2]|0;o=7616+(m<<2)|0;if((N|0)==(c[o>>2]|0)){c[o>>2]=O;if(!O){c[1829]=c[1829]&~(1<<m);break}}else{if(q>>>0<(c[1832]|0)>>>0)ka();m=q+16|0;if((c[m>>2]|0)==(N|0))c[m>>2]=O;else c[q+20>>2]=O;if(!O)break}m=c[1832]|0;if(O>>>0<m>>>0)ka();c[O+24>>2]=q;o=c[N+16>>2]|0;do if(o)if(o>>>0<m>>>0)ka();else{c[O+16>>2]=o;c[o+24>>2]=O;break}while(0);o=c[N+20>>2]|0;if(o)if(o>>>0<(c[1832]|0)>>>0)ka();else{c[O+20>>2]=o;c[o+24>>2]=O;break}}while(0);b:do if(M>>>0>=16){c[N+4>>2]=r|3;c[N+(r|4)>>2]=M|1;c[N+(M+r)>>2]=M;q=M>>>3;if(M>>>0<256){o=q<<1;m=7352+(o<<2)|0;l=c[1828]|0;g=1<<q;do if(!(l&g)){c[1828]=l|g;R=7352+(o+2<<2)|0;S=m}else{q=7352+(o+2<<2)|0;j=c[q>>2]|0;if(j>>>0>=(c[1832]|0)>>>0){R=q;S=j;break}ka()}while(0);c[R>>2]=s;c[S+12>>2]=s;c[N+(r+8)>>2]=S;c[N+(r+12)>>2]=m;break}o=M>>>8;if(o)if(M>>>0>16777215)T=31;else{g=(o+1048320|0)>>>16&8;l=o<<g;o=(l+520192|0)>>>16&4;j=l<<o;l=(j+245760|0)>>>16&2;q=14-(o|g|l)+(j<<l>>>15)|0;T=M>>>(q+7|0)&1|q<<1}else T=0;q=7616+(T<<2)|0;c[N+(r+28)>>2]=T;c[N+(r+20)>>2]=0;c[N+(r+16)>>2]=0;l=c[1829]|0;j=1<<T;if(!(l&j)){c[1829]=l|j;c[q>>2]=s;c[N+(r+24)>>2]=q;c[N+(r+12)>>2]=s;c[N+(r+8)>>2]=s;break}j=c[q>>2]|0;if((T|0)==31)U=0;else U=25-(T>>>1)|0;c:do if((c[j+4>>2]&-8|0)!=(M|0)){q=M<<U;l=j;while(1){V=l+(q>>>31<<2)+16|0;g=c[V>>2]|0;if(!g)break;if((c[g+4>>2]&-8|0)==(M|0)){W=g;break c}else{q=q<<1;l=g}}if(V>>>0<(c[1832]|0)>>>0)ka();else{c[V>>2]=s;c[N+(r+24)>>2]=l;c[N+(r+12)>>2]=s;c[N+(r+8)>>2]=s;break b}}else W=j;while(0);j=W+8|0;m=c[j>>2]|0;q=c[1832]|0;if(W>>>0>=q>>>0&m>>>0>=q>>>0){c[m+12>>2]=s;c[j>>2]=s;c[N+(r+8)>>2]=m;c[N+(r+12)>>2]=W;c[N+(r+24)>>2]=0;break}else ka()}else{m=M+r|0;c[N+4>>2]=m|3;j=N+(m+4)|0;c[j>>2]=c[j>>2]|1}while(0);p=N+8|0;i=b;return p|0}else D=r}else D=r}else D=-1;while(0);N=c[1830]|0;if(N>>>0>=D>>>0){M=N-D|0;W=c[1833]|0;if(M>>>0>15){c[1833]=W+D;c[1830]=M;c[W+(D+4)>>2]=M|1;c[W+N>>2]=M;c[W+4>>2]=D|3}else{c[1830]=0;c[1833]=0;c[W+4>>2]=N|3;M=W+(N+4)|0;c[M>>2]=c[M>>2]|1}p=W+8|0;i=b;return p|0}W=c[1831]|0;if(W>>>0>D>>>0){M=W-D|0;c[1831]=M;W=c[1834]|0;c[1834]=W+D;c[W+(D+4)>>2]=M|1;c[W+4>>2]=D|3;p=W+8|0;i=b;return p|0}do if(!(c[1946]|0)){W=ua(30)|0;if(!(W+-1&W)){c[1948]=W;c[1947]=W;c[1949]=-1;c[1950]=-1;c[1951]=0;c[1939]=0;c[1946]=(ta(0)|0)&-16^1431655768;break}else ka()}while(0);W=D+48|0;M=c[1948]|0;N=D+47|0;V=M+N|0;U=0-M|0;M=V&U;if(M>>>0<=D>>>0){p=0;i=b;return p|0}T=c[1938]|0;if((T|0)!=0?(S=c[1936]|0,R=S+M|0,R>>>0<=S>>>0|R>>>0>T>>>0):0){p=0;i=b;return p|0}d:do if(!(c[1939]&4)){T=c[1834]|0;e:do if(T){R=7760|0;while(1){S=c[R>>2]|0;if(S>>>0<=T>>>0?(X=R+4|0,(S+(c[X>>2]|0)|0)>>>0>T>>>0):0)break;S=c[R+8>>2]|0;if(!S){Y=181;break e}else R=S}if(R){S=V-(c[1831]|0)&U;if(S>>>0<2147483647){O=ma(S|0)|0;if((O|0)==((c[R>>2]|0)+(c[X>>2]|0)|0)){Z=O;_=S;Y=190}else{$=O;aa=S;Y=191}}else ba=0}else Y=181}else Y=181;while(0);do if((Y|0)==181){T=ma(0)|0;if((T|0)!=(-1|0)){r=T;S=c[1947]|0;O=S+-1|0;if(!(O&r))ca=M;else ca=M-r+(O+r&0-S)|0;S=c[1936]|0;r=S+ca|0;if(ca>>>0>D>>>0&ca>>>0<2147483647){O=c[1938]|0;if((O|0)!=0?r>>>0<=S>>>0|r>>>0>O>>>0:0){ba=0;break}O=ma(ca|0)|0;if((O|0)==(T|0)){Z=T;_=ca;Y=190}else{$=O;aa=ca;Y=191}}else ba=0}else ba=0}while(0);f:do if((Y|0)==190)if((Z|0)==(-1|0))ba=_;else{da=Z;ea=_;Y=201;break d}else if((Y|0)==191){O=0-aa|0;do if(($|0)!=(-1|0)&aa>>>0<2147483647&W>>>0>aa>>>0?(T=c[1948]|0,r=N-aa+T&0-T,r>>>0<2147483647):0)if((ma(r|0)|0)==(-1|0)){ma(O|0)|0;ba=0;break f}else{fa=r+aa|0;break}else fa=aa;while(0);if(($|0)==(-1|0))ba=0;else{da=$;ea=fa;Y=201;break d}}while(0);c[1939]=c[1939]|4;ga=ba;Y=198}else{ga=0;Y=198}while(0);if((((Y|0)==198?M>>>0<2147483647:0)?(ba=ma(M|0)|0,M=ma(0)|0,(ba|0)!=(-1|0)&(M|0)!=(-1|0)&ba>>>0<M>>>0):0)?(fa=M-ba|0,M=fa>>>0>(D+40|0)>>>0,M):0){da=ba;ea=M?fa:ga;Y=201}if((Y|0)==201){ga=(c[1936]|0)+ea|0;c[1936]=ga;if(ga>>>0>(c[1937]|0)>>>0)c[1937]=ga;ga=c[1834]|0;g:do if(ga){fa=7760|0;while(1){ha=c[fa>>2]|0;ia=fa+4|0;ja=c[ia>>2]|0;if((da|0)==(ha+ja|0)){Y=213;break}M=c[fa+8>>2]|0;if(!M)break;else fa=M}if(((Y|0)==213?(c[fa+12>>2]&8|0)==0:0)?ga>>>0>=ha>>>0&ga>>>0<da>>>0:0){c[ia>>2]=ja+ea;M=(c[1831]|0)+ea|0;ba=ga+8|0;if(!(ba&7))la=0;else la=0-ba&7;ba=M-la|0;c[1834]=ga+la;c[1831]=ba;c[ga+(la+4)>>2]=ba|1;c[ga+(M+4)>>2]=40;c[1835]=c[1950];break}M=c[1832]|0;if(da>>>0<M>>>0){c[1832]=da;na=da}else na=M;M=da+ea|0;ba=7760|0;while(1){if((c[ba>>2]|0)==(M|0)){Y=223;break}$=c[ba+8>>2]|0;if(!$)break;else ba=$}if((Y|0)==223?(c[ba+12>>2]&8|0)==0:0){c[ba>>2]=da;M=ba+4|0;c[M>>2]=(c[M>>2]|0)+ea;M=da+8|0;if(!(M&7))oa=0;else oa=0-M&7;M=da+(ea+8)|0;if(!(M&7))pa=0;else pa=0-M&7;M=da+(pa+ea)|0;fa=oa+D|0;$=da+fa|0;aa=M-(da+oa)-D|0;c[da+(oa+4)>>2]=D|3;h:do if((M|0)!=(ga|0)){if((M|0)==(c[1833]|0)){N=(c[1830]|0)+aa|0;c[1830]=N;c[1833]=$;c[da+(fa+4)>>2]=N|1;c[da+(N+fa)>>2]=N;break}N=ea+4|0;W=c[da+(N+pa)>>2]|0;if((W&3|0)==1){_=W&-8;Z=W>>>3;i:do if(W>>>0>=256){ca=c[da+((pa|24)+ea)>>2]|0;X=c[da+(ea+12+pa)>>2]|0;do if((X|0)==(M|0)){U=pa|16;V=da+(N+U)|0;O=c[V>>2]|0;if(!O){R=da+(U+ea)|0;U=c[R>>2]|0;if(!U){qa=0;break}else{ra=U;sa=R}}else{ra=O;sa=V}while(1){V=ra+20|0;O=c[V>>2]|0;if(O){ra=O;sa=V;continue}V=ra+16|0;O=c[V>>2]|0;if(!O)break;else{ra=O;sa=V}}if(sa>>>0<na>>>0)ka();else{c[sa>>2]=0;qa=ra;break}}else{V=c[da+((pa|8)+ea)>>2]|0;if(V>>>0<na>>>0)ka();O=V+12|0;if((c[O>>2]|0)!=(M|0))ka();R=X+8|0;if((c[R>>2]|0)==(M|0)){c[O>>2]=X;c[R>>2]=V;qa=X;break}else ka()}while(0);if(!ca)break;X=c[da+(ea+28+pa)>>2]|0;l=7616+(X<<2)|0;do if((M|0)!=(c[l>>2]|0)){if(ca>>>0<(c[1832]|0)>>>0)ka();V=ca+16|0;if((c[V>>2]|0)==(M|0))c[V>>2]=qa;else c[ca+20>>2]=qa;if(!qa)break i}else{c[l>>2]=qa;if(qa)break;c[1829]=c[1829]&~(1<<X);break i}while(0);X=c[1832]|0;if(qa>>>0<X>>>0)ka();c[qa+24>>2]=ca;l=pa|16;V=c[da+(l+ea)>>2]|0;do if(V)if(V>>>0<X>>>0)ka();else{c[qa+16>>2]=V;c[V+24>>2]=qa;break}while(0);V=c[da+(N+l)>>2]|0;if(!V)break;if(V>>>0<(c[1832]|0)>>>0)ka();else{c[qa+20>>2]=V;c[V+24>>2]=qa;break}}else{V=c[da+((pa|8)+ea)>>2]|0;X=c[da+(ea+12+pa)>>2]|0;ca=7352+(Z<<1<<2)|0;do if((V|0)!=(ca|0)){if(V>>>0<na>>>0)ka();if((c[V+12>>2]|0)==(M|0))break;ka()}while(0);if((X|0)==(V|0)){c[1828]=c[1828]&~(1<<Z);break}do if((X|0)==(ca|0))wa=X+8|0;else{if(X>>>0<na>>>0)ka();l=X+8|0;if((c[l>>2]|0)==(M|0)){wa=l;break}ka()}while(0);c[V+12>>2]=X;c[wa>>2]=V}while(0);xa=da+((_|pa)+ea)|0;ya=_+aa|0}else{xa=M;ya=aa}Z=xa+4|0;c[Z>>2]=c[Z>>2]&-2;c[da+(fa+4)>>2]=ya|1;c[da+(ya+fa)>>2]=ya;Z=ya>>>3;if(ya>>>0<256){N=Z<<1;W=7352+(N<<2)|0;ca=c[1828]|0;l=1<<Z;do if(!(ca&l)){c[1828]=ca|l;za=7352+(N+2<<2)|0;Aa=W}else{Z=7352+(N+2<<2)|0;R=c[Z>>2]|0;if(R>>>0>=(c[1832]|0)>>>0){za=Z;Aa=R;break}ka()}while(0);c[za>>2]=$;c[Aa+12>>2]=$;c[da+(fa+8)>>2]=Aa;c[da+(fa+12)>>2]=W;break}N=ya>>>8;do if(!N)Ba=0;else{if(ya>>>0>16777215){Ba=31;break}l=(N+1048320|0)>>>16&8;ca=N<<l;_=(ca+520192|0)>>>16&4;R=ca<<_;ca=(R+245760|0)>>>16&2;Z=14-(_|l|ca)+(R<<ca>>>15)|0;Ba=ya>>>(Z+7|0)&1|Z<<1}while(0);N=7616+(Ba<<2)|0;c[da+(fa+28)>>2]=Ba;c[da+(fa+20)>>2]=0;c[da+(fa+16)>>2]=0;W=c[1829]|0;Z=1<<Ba;if(!(W&Z)){c[1829]=W|Z;c[N>>2]=$;c[da+(fa+24)>>2]=N;c[da+(fa+12)>>2]=$;c[da+(fa+8)>>2]=$;break}Z=c[N>>2]|0;if((Ba|0)==31)Ca=0;else Ca=25-(Ba>>>1)|0;j:do if((c[Z+4>>2]&-8|0)!=(ya|0)){N=ya<<Ca;W=Z;while(1){Da=W+(N>>>31<<2)+16|0;ca=c[Da>>2]|0;if(!ca)break;if((c[ca+4>>2]&-8|0)==(ya|0)){Ea=ca;break j}else{N=N<<1;W=ca}}if(Da>>>0<(c[1832]|0)>>>0)ka();else{c[Da>>2]=$;c[da+(fa+24)>>2]=W;c[da+(fa+12)>>2]=$;c[da+(fa+8)>>2]=$;break h}}else Ea=Z;while(0);Z=Ea+8|0;N=c[Z>>2]|0;V=c[1832]|0;if(Ea>>>0>=V>>>0&N>>>0>=V>>>0){c[N+12>>2]=$;c[Z>>2]=$;c[da+(fa+8)>>2]=N;c[da+(fa+12)>>2]=Ea;c[da+(fa+24)>>2]=0;break}else ka()}else{N=(c[1831]|0)+aa|0;c[1831]=N;c[1834]=$;c[da+(fa+4)>>2]=N|1}while(0);p=da+(oa|8)|0;i=b;return p|0}fa=7760|0;while(1){Fa=c[fa>>2]|0;if(Fa>>>0<=ga>>>0?(Ga=c[fa+4>>2]|0,Ha=Fa+Ga|0,Ha>>>0>ga>>>0):0)break;fa=c[fa+8>>2]|0}fa=Fa+(Ga+-39)|0;if(!(fa&7))Ia=0;else Ia=0-fa&7;fa=Fa+(Ga+-47+Ia)|0;$=fa>>>0<(ga+16|0)>>>0?ga:fa;fa=$+8|0;aa=da+8|0;if(!(aa&7))Ja=0;else Ja=0-aa&7;aa=ea+-40-Ja|0;c[1834]=da+Ja;c[1831]=aa;c[da+(Ja+4)>>2]=aa|1;c[da+(ea+-36)>>2]=40;c[1835]=c[1950];c[$+4>>2]=27;c[fa+0>>2]=c[1940];c[fa+4>>2]=c[1941];c[fa+8>>2]=c[1942];c[fa+12>>2]=c[1943];c[1940]=da;c[1941]=ea;c[1943]=0;c[1942]=fa;fa=$+28|0;c[fa>>2]=7;if(($+32|0)>>>0<Ha>>>0){aa=fa;do{fa=aa;aa=aa+4|0;c[aa>>2]=7}while((fa+8|0)>>>0<Ha>>>0)}if(($|0)!=(ga|0)){aa=$-ga|0;fa=ga+(aa+4)|0;c[fa>>2]=c[fa>>2]&-2;c[ga+4>>2]=aa|1;c[ga+aa>>2]=aa;fa=aa>>>3;if(aa>>>0<256){M=fa<<1;ba=7352+(M<<2)|0;N=c[1828]|0;Z=1<<fa;do if(!(N&Z)){c[1828]=N|Z;Ka=7352+(M+2<<2)|0;La=ba}else{fa=7352+(M+2<<2)|0;V=c[fa>>2]|0;if(V>>>0>=(c[1832]|0)>>>0){Ka=fa;La=V;break}ka()}while(0);c[Ka>>2]=ga;c[La+12>>2]=ga;c[ga+8>>2]=La;c[ga+12>>2]=ba;break}M=aa>>>8;if(M)if(aa>>>0>16777215)Ma=31;else{Z=(M+1048320|0)>>>16&8;N=M<<Z;M=(N+520192|0)>>>16&4;$=N<<M;N=($+245760|0)>>>16&2;V=14-(M|Z|N)+($<<N>>>15)|0;Ma=aa>>>(V+7|0)&1|V<<1}else Ma=0;V=7616+(Ma<<2)|0;c[ga+28>>2]=Ma;c[ga+20>>2]=0;c[ga+16>>2]=0;N=c[1829]|0;$=1<<Ma;if(!(N&$)){c[1829]=N|$;c[V>>2]=ga;c[ga+24>>2]=V;c[ga+12>>2]=ga;c[ga+8>>2]=ga;break}$=c[V>>2]|0;if((Ma|0)==31)Na=0;else Na=25-(Ma>>>1)|0;k:do if((c[$+4>>2]&-8|0)!=(aa|0)){V=aa<<Na;N=$;while(1){Oa=N+(V>>>31<<2)+16|0;Z=c[Oa>>2]|0;if(!Z)break;if((c[Z+4>>2]&-8|0)==(aa|0)){Pa=Z;break k}else{V=V<<1;N=Z}}if(Oa>>>0<(c[1832]|0)>>>0)ka();else{c[Oa>>2]=ga;c[ga+24>>2]=N;c[ga+12>>2]=ga;c[ga+8>>2]=ga;break g}}else Pa=$;while(0);$=Pa+8|0;aa=c[$>>2]|0;ba=c[1832]|0;if(Pa>>>0>=ba>>>0&aa>>>0>=ba>>>0){c[aa+12>>2]=ga;c[$>>2]=ga;c[ga+8>>2]=aa;c[ga+12>>2]=Pa;c[ga+24>>2]=0;break}else ka()}}else{aa=c[1832]|0;if((aa|0)==0|da>>>0<aa>>>0)c[1832]=da;c[1940]=da;c[1941]=ea;c[1943]=0;c[1837]=c[1946];c[1836]=-1;aa=0;do{$=aa<<1;ba=7352+($<<2)|0;c[7352+($+3<<2)>>2]=ba;c[7352+($+2<<2)>>2]=ba;aa=aa+1|0}while((aa|0)!=32);aa=da+8|0;if(!(aa&7))Qa=0;else Qa=0-aa&7;aa=ea+-40-Qa|0;c[1834]=da+Qa;c[1831]=aa;c[da+(Qa+4)>>2]=aa|1;c[da+(ea+-36)>>2]=40;c[1835]=c[1950]}while(0);ea=c[1831]|0;if(ea>>>0>D>>>0){da=ea-D|0;c[1831]=da;ea=c[1834]|0;c[1834]=ea+D;c[ea+(D+4)>>2]=da|1;c[ea+4>>2]=D|3;p=ea+8|0;i=b;return p|0}}c[(va()|0)>>2]=12;p=0;i=b;return p|0}function nd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;b=i;if(!a){i=b;return}d=a+-8|0;e=c[1832]|0;if(d>>>0<e>>>0)ka();f=c[a+-4>>2]|0;g=f&3;if((g|0)==1)ka();h=f&-8;j=a+(h+-8)|0;do if(!(f&1)){k=c[d>>2]|0;if(!g){i=b;return}l=-8-k|0;m=a+l|0;n=k+h|0;if(m>>>0<e>>>0)ka();if((m|0)==(c[1833]|0)){o=a+(h+-4)|0;p=c[o>>2]|0;if((p&3|0)!=3){q=m;r=n;break}c[1830]=n;c[o>>2]=p&-2;c[a+(l+4)>>2]=n|1;c[j>>2]=n;i=b;return}p=k>>>3;if(k>>>0<256){k=c[a+(l+8)>>2]|0;o=c[a+(l+12)>>2]|0;s=7352+(p<<1<<2)|0;if((k|0)!=(s|0)){if(k>>>0<e>>>0)ka();if((c[k+12>>2]|0)!=(m|0))ka()}if((o|0)==(k|0)){c[1828]=c[1828]&~(1<<p);q=m;r=n;break}if((o|0)!=(s|0)){if(o>>>0<e>>>0)ka();s=o+8|0;if((c[s>>2]|0)==(m|0))t=s;else ka()}else t=o+8|0;c[k+12>>2]=o;c[t>>2]=k;q=m;r=n;break}k=c[a+(l+24)>>2]|0;o=c[a+(l+12)>>2]|0;do if((o|0)==(m|0)){s=a+(l+20)|0;p=c[s>>2]|0;if(!p){u=a+(l+16)|0;v=c[u>>2]|0;if(!v){w=0;break}else{x=v;y=u}}else{x=p;y=s}while(1){s=x+20|0;p=c[s>>2]|0;if(p){x=p;y=s;continue}s=x+16|0;p=c[s>>2]|0;if(!p)break;else{x=p;y=s}}if(y>>>0<e>>>0)ka();else{c[y>>2]=0;w=x;break}}else{s=c[a+(l+8)>>2]|0;if(s>>>0<e>>>0)ka();p=s+12|0;if((c[p>>2]|0)!=(m|0))ka();u=o+8|0;if((c[u>>2]|0)==(m|0)){c[p>>2]=o;c[u>>2]=s;w=o;break}else ka()}while(0);if(k){o=c[a+(l+28)>>2]|0;s=7616+(o<<2)|0;if((m|0)==(c[s>>2]|0)){c[s>>2]=w;if(!w){c[1829]=c[1829]&~(1<<o);q=m;r=n;break}}else{if(k>>>0<(c[1832]|0)>>>0)ka();o=k+16|0;if((c[o>>2]|0)==(m|0))c[o>>2]=w;else c[k+20>>2]=w;if(!w){q=m;r=n;break}}o=c[1832]|0;if(w>>>0<o>>>0)ka();c[w+24>>2]=k;s=c[a+(l+16)>>2]|0;do if(s)if(s>>>0<o>>>0)ka();else{c[w+16>>2]=s;c[s+24>>2]=w;break}while(0);s=c[a+(l+20)>>2]|0;if(s)if(s>>>0<(c[1832]|0)>>>0)ka();else{c[w+20>>2]=s;c[s+24>>2]=w;q=m;r=n;break}else{q=m;r=n}}else{q=m;r=n}}else{q=d;r=h}while(0);if(q>>>0>=j>>>0)ka();d=a+(h+-4)|0;w=c[d>>2]|0;if(!(w&1))ka();if(!(w&2)){if((j|0)==(c[1834]|0)){e=(c[1831]|0)+r|0;c[1831]=e;c[1834]=q;c[q+4>>2]=e|1;if((q|0)!=(c[1833]|0)){i=b;return}c[1833]=0;c[1830]=0;i=b;return}if((j|0)==(c[1833]|0)){e=(c[1830]|0)+r|0;c[1830]=e;c[1833]=q;c[q+4>>2]=e|1;c[q+e>>2]=e;i=b;return}e=(w&-8)+r|0;x=w>>>3;do if(w>>>0>=256){y=c[a+(h+16)>>2]|0;t=c[a+(h|4)>>2]|0;do if((t|0)==(j|0)){g=a+(h+12)|0;f=c[g>>2]|0;if(!f){s=a+(h+8)|0;o=c[s>>2]|0;if(!o){z=0;break}else{A=o;B=s}}else{A=f;B=g}while(1){g=A+20|0;f=c[g>>2]|0;if(f){A=f;B=g;continue}g=A+16|0;f=c[g>>2]|0;if(!f)break;else{A=f;B=g}}if(B>>>0<(c[1832]|0)>>>0)ka();else{c[B>>2]=0;z=A;break}}else{g=c[a+h>>2]|0;if(g>>>0<(c[1832]|0)>>>0)ka();f=g+12|0;if((c[f>>2]|0)!=(j|0))ka();s=t+8|0;if((c[s>>2]|0)==(j|0)){c[f>>2]=t;c[s>>2]=g;z=t;break}else ka()}while(0);if(y){t=c[a+(h+20)>>2]|0;n=7616+(t<<2)|0;if((j|0)==(c[n>>2]|0)){c[n>>2]=z;if(!z){c[1829]=c[1829]&~(1<<t);break}}else{if(y>>>0<(c[1832]|0)>>>0)ka();t=y+16|0;if((c[t>>2]|0)==(j|0))c[t>>2]=z;else c[y+20>>2]=z;if(!z)break}t=c[1832]|0;if(z>>>0<t>>>0)ka();c[z+24>>2]=y;n=c[a+(h+8)>>2]|0;do if(n)if(n>>>0<t>>>0)ka();else{c[z+16>>2]=n;c[n+24>>2]=z;break}while(0);n=c[a+(h+12)>>2]|0;if(n)if(n>>>0<(c[1832]|0)>>>0)ka();else{c[z+20>>2]=n;c[n+24>>2]=z;break}}}else{n=c[a+h>>2]|0;t=c[a+(h|4)>>2]|0;y=7352+(x<<1<<2)|0;if((n|0)!=(y|0)){if(n>>>0<(c[1832]|0)>>>0)ka();if((c[n+12>>2]|0)!=(j|0))ka()}if((t|0)==(n|0)){c[1828]=c[1828]&~(1<<x);break}if((t|0)!=(y|0)){if(t>>>0<(c[1832]|0)>>>0)ka();y=t+8|0;if((c[y>>2]|0)==(j|0))C=y;else ka()}else C=t+8|0;c[n+12>>2]=t;c[C>>2]=n}while(0);c[q+4>>2]=e|1;c[q+e>>2]=e;if((q|0)==(c[1833]|0)){c[1830]=e;i=b;return}else D=e}else{c[d>>2]=w&-2;c[q+4>>2]=r|1;c[q+r>>2]=r;D=r}r=D>>>3;if(D>>>0<256){w=r<<1;d=7352+(w<<2)|0;e=c[1828]|0;C=1<<r;if(e&C){r=7352+(w+2<<2)|0;j=c[r>>2]|0;if(j>>>0<(c[1832]|0)>>>0)ka();else{E=r;F=j}}else{c[1828]=e|C;E=7352+(w+2<<2)|0;F=d}c[E>>2]=q;c[F+12>>2]=q;c[q+8>>2]=F;c[q+12>>2]=d;i=b;return}d=D>>>8;if(d)if(D>>>0>16777215)G=31;else{F=(d+1048320|0)>>>16&8;E=d<<F;d=(E+520192|0)>>>16&4;w=E<<d;E=(w+245760|0)>>>16&2;C=14-(d|F|E)+(w<<E>>>15)|0;G=D>>>(C+7|0)&1|C<<1}else G=0;C=7616+(G<<2)|0;c[q+28>>2]=G;c[q+20>>2]=0;c[q+16>>2]=0;E=c[1829]|0;w=1<<G;a:do if(E&w){F=c[C>>2]|0;if((G|0)==31)H=0;else H=25-(G>>>1)|0;b:do if((c[F+4>>2]&-8|0)!=(D|0)){d=D<<H;e=F;while(1){I=e+(d>>>31<<2)+16|0;j=c[I>>2]|0;if(!j)break;if((c[j+4>>2]&-8|0)==(D|0)){J=j;break b}else{d=d<<1;e=j}}if(I>>>0<(c[1832]|0)>>>0)ka();else{c[I>>2]=q;c[q+24>>2]=e;c[q+12>>2]=q;c[q+8>>2]=q;break a}}else J=F;while(0);F=J+8|0;d=c[F>>2]|0;j=c[1832]|0;if(J>>>0>=j>>>0&d>>>0>=j>>>0){c[d+12>>2]=q;c[F>>2]=q;c[q+8>>2]=d;c[q+12>>2]=J;c[q+24>>2]=0;break}else ka()}else{c[1829]=E|w;c[C>>2]=q;c[q+24>>2]=C;c[q+12>>2]=q;c[q+8>>2]=q}while(0);q=(c[1836]|0)+-1|0;c[1836]=q;if(!q)K=7768|0;else{i=b;return}while(1){q=c[K>>2]|0;if(!q)break;else K=q+8|0}c[1836]=-1;i=b;return}function od(){}function pd(b){b=b|0;var c=0;c=b;while(a[c>>0]|0)c=c+1|0;return c-b|0}function qd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b>>0]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b>>0]=d;b=b+1|0}return b-e|0}function rd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return pa(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if(!e)return f|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}function sd(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;xa[a&3](b|0,c|0,d|0,e|0,f|0)}function td(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;_(0)}
// EMSCRIPTEN_END_FUNCS
var xa=[td,hc,gc,td];return{_strlen:pd,_free:nd,_broadwayGetMajorVersion:gd,_get_h264bsdClip:Mb,_broadwayExit:fd,_memset:qd,_broadwayCreateStream:ad,_malloc:md,_memcpy:rd,_broadwayGetMinorVersion:hd,_broadwayPlayStream:cd,_broadwaySetStreamLength:bd,_broadwayInit:dd,runPostSets:od,stackAlloc:ya,stackSave:za,stackRestore:Aa,setThrew:Ba,setTempRet0:Ea,getTempRet0:Fa,dynCall_viiiii:sd}})
// EMSCRIPTEN_END_ASM
(p.Xc,p.Yc,Q),Bb=p._strlen=$._strlen,Ea=p._free=$._free;p._broadwayGetMajorVersion=$._broadwayGetMajorVersion;p._get_h264bsdClip=$._get_h264bsdClip;p._broadwayExit=$._broadwayExit;var Gb=p._memset=$._memset;p._broadwayCreateStream=$._broadwayCreateStream;var Ca=p._malloc=$._malloc,gc=p._memcpy=$._memcpy;
p._broadwayGetMinorVersion=$._broadwayGetMinorVersion;p._broadwayPlayStream=$._broadwayPlayStream;p._broadwaySetStreamLength=$._broadwaySetStreamLength;p._broadwayInit=$._broadwayInit;p.runPostSets=$.runPostSets;p.dynCall_viiiii=$.dynCall_viiiii;z.pb=$.stackAlloc;z.Tb=$.stackSave;z.Sb=$.stackRestore;z.Yd=$.setTempRet0;z.xd=$.getTempRet0;
if(T)if("function"===typeof p.locateFile?T=p.locateFile(T):p.memoryInitializerPrefixURL&&(T=p.memoryInitializerPrefixURL+T),t||da){var hc=p.readBinary(T);N.set(hc,Ia)}else Ya(),yb(T,function(a){N.set(a,Ia);Za()},function(){d("could not load memory initializer "+T)});function ia(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}ia.prototype=Error();var ic,jc=k,Xa=function kc(){!p.calledRun&&lc&&mc();p.calledRun||(Xa=kc)};
p.callMain=p.ag=function(a){function b(){for(var a=0;3>a;a++)e.push(0)}w(0==S,"cannot call main when async dependencies remain! (listen on __ATMAIN__)");w(0==Oa.length,"cannot call main when preRun functions remain to be called");a=a||[];Sa||(Sa=i,Na(R));var c=a.length+1,e=[M(Va(p.thisProgram),"i8",0)];b();for(var f=0;f<c-1;f+=1)e.push(M(Va(a[f]),"i8",0)),b();e.push(0);e=M(e,"i32",0);ic=y;try{var h=p._main(c,e,0);nc(h)}catch(j){j instanceof ia||("SimulateInfiniteLoop"==j?p.noExitRuntime=i:(j&&("object"===
typeof j&&j.stack)&&p.fa("exception thrown: "+[j,j.stack]),d(j)))}finally{}};
function mc(a){function b(){if(!p.calledRun&&(p.calledRun=i,!H)){Sa||(Sa=i,Na(R));Na(Pa);ba&&jc!==k&&p.fa("pre-main prep time: "+(Date.now()-jc)+" ms");if(p.onRuntimeInitialized)p.onRuntimeInitialized();p._main&&lc&&p.callMain(a);if(p.postRun)for("function"==typeof p.postRun&&(p.postRun=[p.postRun]);p.postRun.length;)Ua(p.postRun.shift());Na(Ra)}}a=a||p.arguments;jc===k&&(jc=Date.now());if(!(0<S)){if(p.preRun)for("function"==typeof p.preRun&&(p.preRun=[p.preRun]);p.preRun.length;)Ta(p.preRun.shift());
Na(Oa);!(0<S)&&!p.calledRun&&(p.setStatus?(p.setStatus("Running..."),setTimeout(function(){setTimeout(function(){p.setStatus("")},1);b()},1)):b())}}p.run=p.Ng=mc;function nc(a){p.noExitRuntime||(H=i,y=ic,Na(Qa),t?(process.stdout.once("drain",function(){process.exit(a)}),console.log(" "),setTimeout(function(){process.exit(a)},500)):da&&"function"===typeof quit&&quit(a),d(new ia(a)))}p.exit=p.hg=nc;
function A(a){a&&(p.print(a),p.fa(a));H=i;d("abort() at "+Fa()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.")}p.abort=p.abort=A;if(p.preInit)for("function"==typeof p.preInit&&(p.preInit=[p.preInit]);0<p.preInit.length;)p.preInit.pop()();var lc=m;p.noInitialRun&&(lc=m);mc();
var resultModule = window.Module || this.Module;
return resultModule;
};
var Broadway = function(parOptions){
this.options = parOptions || {};
var asmInstance;
var Module = getModule(function () {
}, function ($buffer, width, height) {
var buffer = this.pictureBuffers[$buffer];
if (!buffer) {
buffer = this.pictureBuffers[$buffer] = toU8Array($buffer, (width * height * 3) / 2);
};
if (this.options.rgb){
if (!asmInstance){
asmInstance = getAsm(width, height);
};
asmInstance.inp.set(buffer);
asmInstance.doit();
var copyU8 = new Uint8Array(asmInstance.outSize);
copyU8.set( asmInstance.out );
this.onPictureDecoded(copyU8, width, height);
return;
};
this.onPictureDecoded(buffer, width, height);
}.bind(this));
var HEAP8 = Module.HEAP8;
var HEAPU8 = Module.HEAPU8;
var HEAP16 = Module.HEAP16;
var HEAP32 = Module.HEAP32;
var _h264bsdClip = Module._get_h264bsdClip();
var MAX_STREAM_BUFFER_LENGTH = 1024 * 1024;
// from old constructor
Module._broadwayInit();
/**
* Creates a typed array from a HEAP8 pointer.
*/
function toU8Array(ptr, length) {
return HEAPU8.subarray(ptr, ptr + length);
};
this.streamBuffer = toU8Array(Module._broadwayCreateStream(MAX_STREAM_BUFFER_LENGTH), MAX_STREAM_BUFFER_LENGTH);
this.pictureBuffers = {};
this.onPictureDecoded = function (buffer, width, height) {
};
/**
* Decodes a stream buffer. This may be one single (unframed) NAL unit without the
* start code, or a sequence of NAL units with framing start code prefixes. This
* function overwrites stream buffer allocated by the codec with the supplied buffer.
*/
this.decode = function decode(buffer) {
// console.info("Decoding: " + buffer.length);
this.streamBuffer.set(buffer);
Module._broadwaySetStreamLength(buffer.length);
Module._broadwayPlayStream();
};
function patchOptimizations(config, patches) {
var scope = getGlobalScope();
for (var name in patches) {
var patch = patches[name];
if (patch) {
var option = config[name];
if (!option) option = "original";
console.info(name + ": " + option);
assert (option in patch.options);
var fn = patch.options[option].fn;
if (fn) {
scope[patch.original] = Module.patch(null, patch.name, fn);
console.info("Patching: " + patch.name + ", with: " + option);
}
}
}
};
var patches = {
"filter": {
name: "_h264bsdFilterPicture",
display: "Filter Picture",
original: "Original_h264bsdFilterPicture",
options: {
none: {display: "None", fn: function () {}},
original: {display: "Original", fn: null},
}
},
"filterHorLuma": {
name: "_FilterHorLuma",
display: "Filter Hor Luma",
original: "OriginalFilterHorLuma",
options: {
none: {display: "None", fn: function () {}},
original: {display: "Original", fn: null},
optimized: {display: "Optimized", fn: OptimizedFilterHorLuma}
}
},
"filterVerLumaEdge": {
name: "_FilterVerLumaEdge",
display: "Filter Ver Luma Edge",
original: "OriginalFilterVerLumaEdge",
options: {
none: {display: "None", fn: function () {}},
original: {display: "Original", fn: null},
optimized: {display: "Optimized", fn: OptimizedFilterVerLumaEdge}
}
},
"getBoundaryStrengthsA": {
name: "_GetBoundaryStrengthsA",
display: "Get Boundary Strengths",
original: "OriginalGetBoundaryStrengthsA",
options: {
none: {display: "None", fn: function () {}},
original: {display: "Original", fn: null},
optimized: {display: "Optimized", fn: OptimizedGetBoundaryStrengthsA}
}
}
};
function getGlobalScope() {
return function () { return this; }.call(null);
};
/* Optimizations */
function clip(x, y, z) {
return z < x ? x : (z > y ? y : z);
}
function OptimizedGetBoundaryStrengthsA($mb, $bS) {
var $totalCoeff = $mb + 28;
var tc0 = HEAP16[$totalCoeff + 0 >> 1];
var tc1 = HEAP16[$totalCoeff + 2 >> 1];
var tc2 = HEAP16[$totalCoeff + 4 >> 1];
var tc3 = HEAP16[$totalCoeff + 6 >> 1];
var tc4 = HEAP16[$totalCoeff + 8 >> 1];
var tc5 = HEAP16[$totalCoeff + 10 >> 1];
var tc6 = HEAP16[$totalCoeff + 12 >> 1];
var tc7 = HEAP16[$totalCoeff + 14 >> 1];
var tc8 = HEAP16[$totalCoeff + 16 >> 1];
var tc9 = HEAP16[$totalCoeff + 18 >> 1];
var tc10 = HEAP16[$totalCoeff + 20 >> 1];
var tc11 = HEAP16[$totalCoeff + 22 >> 1];
var tc12 = HEAP16[$totalCoeff + 24 >> 1];
var tc13 = HEAP16[$totalCoeff + 26 >> 1];
var tc14 = HEAP16[$totalCoeff + 28 >> 1];
var tc15 = HEAP16[$totalCoeff + 30 >> 1];
HEAP32[$bS + 32 >> 2] = tc2 || tc0 ? 2 : 0;
HEAP32[$bS + 40 >> 2] = tc3 || tc1 ? 2 : 0;
HEAP32[$bS + 48 >> 2] = tc6 || tc4 ? 2 : 0;
HEAP32[$bS + 56 >> 2] = tc7 || tc5 ? 2 : 0;
HEAP32[$bS + 64 >> 2] = tc8 || tc2 ? 2 : 0;
HEAP32[$bS + 72 >> 2] = tc9 || tc3 ? 2 : 0;
HEAP32[$bS + 80 >> 2] = tc12 || tc6 ? 2 : 0;
HEAP32[$bS + 88 >> 2] = tc13 || tc7 ? 2 : 0;
HEAP32[$bS + 96 >> 2] = tc10 || tc8 ? 2 : 0;
HEAP32[$bS + 104 >> 2] = tc11 || tc9 ? 2 : 0;
HEAP32[$bS + 112 >> 2] = tc14 || tc12 ? 2 : 0;
HEAP32[$bS + 120 >> 2] = tc15 || tc13 ? 2 : 0;
HEAP32[$bS + 12 >> 2] = tc1 || tc0 ? 2 : 0;
HEAP32[$bS + 20 >> 2] = tc4 || tc1 ? 2 : 0;
HEAP32[$bS + 28 >> 2] = tc5 || tc4 ? 2 : 0;
HEAP32[$bS + 44 >> 2] = tc3 || tc2 ? 2 : 0;
HEAP32[$bS + 52 >> 2] = tc6 || tc3 ? 2 : 0;
HEAP32[$bS + 60 >> 2] = tc7 || tc6 ? 2 : 0;
HEAP32[$bS + 76 >> 2] = tc9 || tc8 ? 2 : 0;
HEAP32[$bS + 84 >> 2] = tc12 || tc9 ? 2 : 0;
HEAP32[$bS + 92 >> 2] = tc13 || tc12 ? 2 : 0;
HEAP32[$bS + 108 >> 2] = tc11 || tc10 ? 2 : 0;
HEAP32[$bS + 116 >> 2] = tc14 || tc11 ? 2 : 0;
HEAP32[$bS + 124 >> 2] = tc15 || tc14 ? 2 : 0;
}
function OptimizedFilterVerLumaEdge ($data, bS, $thresholds, imageWidth) {
var delta, tc, tmp;
var p0, q0, p1, q1, p2, q2;
var tmpFlag;
var $clp = _h264bsdClip + 512;
var alpha = HEAP32[$thresholds + 4 >> 2];
var beta = HEAP32[$thresholds + 8 >> 2];
var val;
if (bS < 4) {
tmp = tc = HEAPU8[HEAP32[$thresholds >> 2] + (bS - 1)] & 255;
for (var i = 4; i > 0; i--) {
p1 = HEAPU8[$data + -2] & 255;
p0 = HEAPU8[$data + -1] & 255;
q0 = HEAPU8[$data] & 255;
q1 = HEAPU8[$data + 1] & 255;
if ((Math.abs(p0 - q0) < alpha) && (Math.abs(p1 - p0) < beta) && (Math.abs(q1 - q0) < beta)) {
p2 = HEAPU8[$data - 3] & 255;
if (Math.abs(p2 - p0) < beta) {
val = (p2 + ((p0 + q0 + 1) >> 1) - (p1 << 1)) >> 1;
HEAP8[$data - 2] = p1 + clip(-tc, tc, val);
tmp++;
}
q2 = HEAPU8[$data + 2] & 255;
if (Math.abs(q2 - q0) < beta) {
val = (q2 + ((p0 + q0 + 1) >> 1) - (q1 << 1)) >> 1;
HEAP8[$data + 1] = (q1 + clip(-tc, tc, val));
tmp++;
}
val = ((((q0 - p0) << 2) + (p1 - q1) + 4) >> 3);
delta = clip(-tmp, tmp, val);
p0 = HEAPU8[$clp + (p0 + delta)] & 255;
q0 = HEAPU8[$clp + (q0 - delta)] & 255;
tmp = tc;
HEAP8[$data - 1] = p0;
HEAP8[$data] = q0;
$data += imageWidth;
}
}
} else {
OriginalFilterVerLumaEdge($data, bS, $thresholds, imageWidth);
}
}
/**
* Filter all four successive horizontal 4-pixel luma edges. This can be done when bS is equal to all four edges.
*/
function OptimizedFilterHorLuma ($data, bS, $thresholds, imageWidth) {
var delta, tc, tmp;
var p0, q0, p1, q1, p2, q2;
var tmpFlag;
var $clp = _h264bsdClip + 512;
var alpha = HEAP32[$thresholds + 4 >> 2];
var beta = HEAP32[$thresholds + 8 >> 2];
var val;
if (bS < 4) {
tmp = tc = HEAPU8[HEAP32[$thresholds >> 2] + (bS - 1)] & 255;
for (var i = 16; i > 0; i--) {
p1 = HEAPU8[$data + (-imageWidth << 1)] & 255;
p0 = HEAPU8[$data + -imageWidth] & 255;
q0 = HEAPU8[$data] & 255;
q1 = HEAPU8[$data + imageWidth] & 255;
if ((Math.abs(p0 - q0) < alpha) && (Math.abs(p1 - p0) < beta) && (Math.abs(q1 - q0) < beta)) {
p2 = HEAPU8[$data + (-imageWidth * 3)] & 255;
if (Math.abs(p2 - p0) < beta) {
val = (p2 + ((p0 + q0 + 1) >> 1) - (p1 << 1)) >> 1;
HEAP8[$data + (-imageWidth << 1)] = p1 + clip(-tc, tc, val);
tmp++;
}
q2 = HEAPU8[$data + (imageWidth << 2)] & 255;
if (Math.abs(q2 - q0) < beta) {
val = (q2 + ((p0 + q0 + 1) >> 1) - (q1 << 1)) >> 1;
HEAP8[$data + imageWidth] = (q1 + clip(-tc, tc, val));
tmp++;
}
val = ((((q0 - p0) << 2) + (p1 - q1) + 4) >> 3);
delta = clip(-tmp, tmp, val);
p0 = HEAPU8[$clp + (p0 + delta)] & 255;
q0 = HEAPU8[$clp + (q0 - delta)] & 255;
tmp = tc;
HEAP8[$data - imageWidth] = p0;
HEAP8[$data] = q0;
$data ++;
}
}
} else {
OriginalFilterHorLuma($data, bS, $thresholds, imageWidth);
}
}
};
Broadway.prototype = {
configure: function (config) {
// patchOptimizations(config, patches);
console.info("Broadway Configured: " + JSON.stringify(config));
}
};
/*
asm.js implementation of a yuv to rgb convertor
provided by @soliton4
based on
http://www.wordsaretoys.com/2013/10/18/making-yuv-conversion-a-little-faster/
*/
// factory to create asm.js yuv -> rgb convertor for a given resolution
var asmInstances = {};
var getAsm = function(parWidth, parHeight){
var idStr = "" + parWidth + "x" + parHeight;
if (asmInstances[idStr]){
return asmInstances[idStr];
};
var lumaSize = parWidth * parHeight;
var chromaSize = (lumaSize|0) >> 2;
var inpSize = lumaSize + chromaSize + chromaSize;
var outSize = parWidth * parHeight * 4;
var cacheSize = Math.pow(2, 24) * 4;
var size = inpSize + outSize + cacheSize;
var chunkSize = Math.pow(2, 24);
var heapSize = chunkSize;
while (heapSize < size){
heapSize += chunkSize;
};
var heap = new ArrayBuffer(heapSize);
var res = asmFactory(global, {}, heap);
res.init(parWidth, parHeight);
asmInstances[idStr] = res;
res.heap = heap;
res.out = new Uint8Array(heap, 0, outSize);
res.inp = new Uint8Array(heap, outSize, inpSize);
res.outSize = outSize;
return res;
};
function asmFactory(stdlib, foreign, heap) {
"use asm";
var imul = stdlib.Math.imul;
var min = stdlib.Math.min;
var max = stdlib.Math.max;
var pow = stdlib.Math.pow;
var out = new stdlib.Uint8Array(heap);
var out32 = new stdlib.Uint32Array(heap);
var inp = new stdlib.Uint8Array(heap);
var mem = new stdlib.Uint8Array(heap);
var mem32 = new stdlib.Uint32Array(heap);
// for double algo
/*var vt = 1.370705;
var gt = 0.698001;
var gt2 = 0.337633;
var bt = 1.732446;*/
var width = 0;
var height = 0;
var lumaSize = 0;
var chromaSize = 0;
var inpSize = 0;
var outSize = 0;
var inpStart = 0;
var outStart = 0;
var widthFour = 0;
var cacheStart = 0;
function init(parWidth, parHeight){
parWidth = parWidth|0;
parHeight = parHeight|0;
var i = 0;
var s = 0;
width = parWidth;
widthFour = imul(parWidth, 4)|0;
height = parHeight;
lumaSize = imul(width|0, height|0)|0;
chromaSize = (lumaSize|0) >> 2;
outSize = imul(imul(width, height)|0, 4)|0;
inpSize = ((lumaSize + chromaSize)|0 + chromaSize)|0;
outStart = 0;
inpStart = (outStart + outSize)|0;
cacheStart = (inpStart + inpSize)|0;
// initializing memory (to be on the safe side)
s = ~~(+pow(+2, +24));
s = imul(s, 4)|0;
for (i = 0|0; ((i|0) < (s|0))|0; i = (i + 4)|0){
mem32[((cacheStart + i)|0) >> 2] = 0;
};
};
function doit(){
var ystart = 0;
var ustart = 0;
var vstart = 0;
var y = 0;
var yn = 0;
var u = 0;
var v = 0;
var o = 0;
var line = 0;
var col = 0;
var usave = 0;
var vsave = 0;
var ostart = 0;
var cacheAdr = 0;
ostart = outStart|0;
ystart = inpStart|0;
ustart = (ystart + lumaSize|0)|0;
vstart = (ustart + chromaSize)|0;
for (line = 0; (line|0) < (height|0); line = (line + 2)|0){
usave = ustart;
vsave = vstart;
for (col = 0; (col|0) < (width|0); col = (col + 2)|0){
y = inp[ystart >> 0]|0;
yn = inp[((ystart + width)|0) >> 0]|0;
u = inp[ustart >> 0]|0;
v = inp[vstart >> 0]|0;
cacheAdr = (((((y << 16)|0) + ((u << 8)|0))|0) + v)|0;
o = mem32[((cacheStart + cacheAdr)|0) >> 2]|0;
if (o){}else{
o = yuv2rgbcalc(y,u,v)|0;
mem32[((cacheStart + cacheAdr)|0) >> 2] = o|0;
};
mem32[ostart >> 2] = o;
cacheAdr = (((((yn << 16)|0) + ((u << 8)|0))|0) + v)|0;
o = mem32[((cacheStart + cacheAdr)|0) >> 2]|0;
if (o){}else{
o = yuv2rgbcalc(yn,u,v)|0;
mem32[((cacheStart + cacheAdr)|0) >> 2] = o|0;
};
mem32[((ostart + widthFour)|0) >> 2] = o;
//yuv2rgb5(y, u, v, ostart);
//yuv2rgb5(yn, u, v, (ostart + widthFour)|0);
ostart = (ostart + 4)|0;
// next step only for y. u and v stay the same
ystart = (ystart + 1)|0;
y = inp[ystart >> 0]|0;
yn = inp[((ystart + width)|0) >> 0]|0;
//yuv2rgb5(y, u, v, ostart);
cacheAdr = (((((y << 16)|0) + ((u << 8)|0))|0) + v)|0;
o = mem32[((cacheStart + cacheAdr)|0) >> 2]|0;
if (o){}else{
o = yuv2rgbcalc(y,u,v)|0;
mem32[((cacheStart + cacheAdr)|0) >> 2] = o|0;
};
mem32[ostart >> 2] = o;
//yuv2rgb5(yn, u, v, (ostart + widthFour)|0);
cacheAdr = (((((yn << 16)|0) + ((u << 8)|0))|0) + v)|0;
o = mem32[((cacheStart + cacheAdr)|0) >> 2]|0;
if (o){}else{
o = yuv2rgbcalc(yn,u,v)|0;
mem32[((cacheStart + cacheAdr)|0) >> 2] = o|0;
};
mem32[((ostart + widthFour)|0) >> 2] = o;
ostart = (ostart + 4)|0;
//all positions inc 1
ystart = (ystart + 1)|0;
ustart = (ustart + 1)|0;
vstart = (vstart + 1)|0;
};
ostart = (ostart + widthFour)|0;
ystart = (ystart + width)|0;
};
};
function yuv2rgbcalc(y, u, v){
y = y|0;
u = u|0;
v = v|0;
var r = 0;
var g = 0;
var b = 0;
var o = 0;
var a0 = 0;
var a1 = 0;
var a2 = 0;
var a3 = 0;
var a4 = 0;
a0 = imul(1192, (y - 16)|0)|0;
a1 = imul(1634, (v - 128)|0)|0;
a2 = imul(832, (v - 128)|0)|0;
a3 = imul(400, (u - 128)|0)|0;
a4 = imul(2066, (u - 128)|0)|0;
r = (((a0 + a1)|0) >> 10)|0;
g = (((((a0 - a2)|0) - a3)|0) >> 10)|0;
b = (((a0 + a4)|0) >> 10)|0;
if ((((r & 255)|0) != (r|0))|0){
r = min(255, max(0, r|0)|0)|0;
};
if ((((g & 255)|0) != (g|0))|0){
g = min(255, max(0, g|0)|0)|0;
};
if ((((b & 255)|0) != (b|0))|0){
b = min(255, max(0, b|0)|0)|0;
};
o = 255;
o = (o << 8)|0;
o = (o + b)|0;
o = (o << 8)|0;
o = (o + g)|0;
o = (o << 8)|0;
o = (o + r)|0;
return o|0;
};
return {
init: init,
doit: doit
};
};
/*
potential worker initialization
*/
if (typeof self != "undefined"){
var isWorker = false;
var decoder;
self.addEventListener('message', function(e) {
if (isWorker){
decoder.decode(new Uint8Array(e.data));
}else{
if (e.data && e.data.type === "Broadway.js - Worker init"){
isWorker = true;
decoder = new Broadway(e.data.options);
decoder.onPictureDecoded = function (buffer, width, height) {
if (buffer) {
buffer = new Uint8Array(buffer);
};
// post dimensions seperately
postMessage({width: width, height: height});
// buffer needs to be copied because we give up ownership
var copyU8 = new Uint8Array(buffer.length);
copyU8.set( buffer, 0, buffer.length );
// only post the buffer (slightly faster)
// add 2nd parameter to indicate transfer of owner ship (this it was makes this worker implementation faster)
postMessage(copyU8.buffer, [copyU8.buffer]);
};
postMessage({consoleLog: "initialized" });
};
};
}, false);
};
return Broadway;
}));