diff --git a/ChangeLog b/ChangeLog index 1a8ae53..98bbb08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +version 0.9.4: + +- Modified alpha plane encoding to allow progressive display and + streaming encoding. This change is incompatible, so images + containing alpha from the previous versions of the format cannot be + decoded. + +- Added 4:2:2 and 4:2:0 chroma formats with MPEG2 chroma sample position. + version 0.9.3: - Fixed small palette PNG. diff --git a/README b/README index 1519794..3a3ee54 100644 --- a/README +++ b/README @@ -91,6 +91,10 @@ as input. with the '-keepmetadata' option. For JPEG input, EXIF, ICCP and XMP are copied. For PNG input, ICCP is copied. +- Objective comparisons: the JCTVC encoder is tuned for PSNR only, not + for SSIM, so you should use PSNR when making objective comparison + with other formats. x265 is tuned by default for SSIM. + 3) BPG decoder -------------- @@ -130,7 +134,11 @@ into it. Stylesheets are supported (the 'id' and 'class' attributes are preserved). The 'width' and 'height' attributes are supported only with pixel units. -asm.js gives an interesting speed boost, so we hope that more browser +The image data is downloaded with the XMLHttpRequest object. So the +BPG images and the BPG Javascript decoder must be in the same domain +unless Cross-Origin Resource Sharing is used. + +asm.js gives an interesting speed boost, so we hope that more browsers will support this Javascript subset. 6) FFmpeg modifications diff --git a/VERSION b/VERSION index 965065d..a602fc9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.3 +0.9.4 diff --git a/bpgdec.c b/bpgdec.c index 3818b9c..62c728c 100644 --- a/bpgdec.c +++ b/bpgdec.c @@ -174,11 +174,13 @@ static void bpg_show_info(const char *filename, int show_extensions) FILE *f; BPGImageInfo p_s, *p = &p_s; BPGExtensionData *first_md, *md; - static const char *format_str[4] = { + static const char *format_str[6] = { "Gray", "4:2:0", "4:2:2", "4:4:4", + "4:2:0_video", + "4:2:2_video", }; static const char *color_space_str[BPG_CS_COUNT] = { "YCbCr", diff --git a/bpgenc.c b/bpgenc.c index 3699700..8dea57a 100644 --- a/bpgenc.c +++ b/bpgenc.c @@ -433,35 +433,102 @@ static void gray_neg_c(ColorConvertState *s, PIXEL *y_ptr, int n) /* decimation */ -#define DTAPS2 5 -#define DTAPS (2 * DTAPS2) -#define DC0 57 -#define DC1 17 -#define DC2 (-8) -#define DC3 (-4) -#define DC4 2 +/* phase = 0 */ +#define DP0TAPS2 7 +#define DP0TAPS (2 * DP0TAPS + 1) +#define DP0C0 64 +#define DP0C1 40 +#define DP0C3 (-11) +#define DP0C5 4 +#define DP0C7 (-1) -static void decimate2_simple(PIXEL *dst, PIXEL *src, int n, int bit_depth) +/* phase = 0.5 */ +#define DP1TAPS2 5 +#define DP1TAPS (2 * DP1TAPS2) +#define DP1C0 57 +#define DP1C1 17 +#define DP1C2 (-8) +#define DP1C3 (-4) +#define DP1C4 2 + +#define DTAPS_MAX 7 + +/* chroma aligned with luma samples */ +static void decimate2p0_simple(PIXEL *dst, PIXEL *src, int n, int bit_depth) { int n2, i, pixel_max; pixel_max = (1 << bit_depth) - 1; n2 = (n + 1) / 2; for(i = 0; i < n2; i++) { - dst[i] = clamp_pix(((src[-4] + src[5]) * DC4 + - (src[-3] + src[4]) * DC3 + - (src[-2] + src[3]) * DC2 + - (src[-1] + src[2]) * DC1 + - (src[0] + src[1]) * DC0 + 64) >> 7, pixel_max); + dst[i] = clamp_pix(((src[-7] + src[7]) * DP0C7 + + (src[-5] + src[5]) * DP0C5 + + (src[-3] + src[3]) * DP0C3 + + (src[-1] + src[1]) * DP0C1 + + src[0] * DP0C0 + 64) >> 7, pixel_max); src += 2; } } -static void decimate2_h(PIXEL *dst, PIXEL *src, int n, int bit_depth) +/* same with more precision and no saturation */ +static void decimate2p0_simple16(int16_t *dst, PIXEL *src, int n, int bit_depth) +{ + int n2, i, shift, rnd; + shift = bit_depth - 7; + rnd = 1 << (shift - 1); + n2 = (n + 1) / 2; + for(i = 0; i < n2; i++) { + dst[i] = ((src[-7] + src[7]) * DP0C7 + + (src[-5] + src[5]) * DP0C5 + + (src[-3] + src[3]) * DP0C3 + + (src[-1] + src[1]) * DP0C1 + + src[0] * DP0C0 + rnd) >> shift; + src += 2; + } +} + + +/* chroma half way between luma samples */ +static void decimate2p1_simple(PIXEL *dst, PIXEL *src, int n, int bit_depth) +{ + int n2, i, pixel_max; + pixel_max = (1 << bit_depth) - 1; + n2 = (n + 1) / 2; + for(i = 0; i < n2; i++) { + dst[i] = clamp_pix(((src[-4] + src[5]) * DP1C4 + + (src[-3] + src[4]) * DP1C3 + + (src[-2] + src[3]) * DP1C2 + + (src[-1] + src[2]) * DP1C1 + + (src[0] + src[1]) * DP1C0 + 64) >> 7, pixel_max); + src += 2; + } +} + +/* same with more precision and no saturation */ +static void decimate2p1_simple16(int16_t *dst, PIXEL *src, int n, int bit_depth) +{ + int n2, i, shift, rnd; + shift = bit_depth - 7; + rnd = 1 << (shift - 1); + n2 = (n + 1) / 2; + for(i = 0; i < n2; i++) { + dst[i] = ((src[-4] + src[5]) * DP1C4 + + (src[-3] + src[4]) * DP1C3 + + (src[-2] + src[3]) * DP1C2 + + (src[-1] + src[2]) * DP1C1 + + (src[0] + src[1]) * DP1C0 + rnd) >> shift; + src += 2; + } +} + +static void decimate2_h(PIXEL *dst, PIXEL *src, int n, int bit_depth, int phase) { PIXEL *src1, v; int d, i; - d = DTAPS2; + if (phase == 0) + d = DP0TAPS2; + else + d = DP1TAPS2; /* add edge pixels */ src1 = malloc(sizeof(PIXEL) * (n + 2 * d)); v = src[0]; @@ -471,35 +538,24 @@ static void decimate2_h(PIXEL *dst, PIXEL *src, int n, int bit_depth) v = src[n - 1]; for(i = 0; i < d; i++) src1[d + n + i] = v; - decimate2_simple(dst, src1 + d, n, bit_depth); + if (phase == 0) + decimate2p0_simple(dst, src1 + d, n, bit_depth); + else + decimate2p1_simple(dst, src1 + d, n, bit_depth); free(src1); } -/* same as decimate2_simple but with more precision and no saturation */ -static void decimate2_simple16(int16_t *dst, PIXEL *src, int n, int bit_depth) -{ - int n2, i, shift, rnd; - shift = bit_depth - 7; - rnd = 1 << (shift - 1); - n2 = (n + 1) / 2; - for(i = 0; i < n2; i++) { - dst[i] = ((src[-4] + src[5]) * DC4 + - (src[-3] + src[4]) * DC3 + - (src[-2] + src[3]) * DC2 + - (src[-1] + src[2]) * DC1 + - (src[0] + src[1]) * DC0 + rnd) >> shift; - src += 2; - } -} - /* src1 is a temporary buffer of length n + 2 * DTAPS */ static void decimate2_h16(int16_t *dst, PIXEL *src, int n, PIXEL *src1, - int bit_depth) + int bit_depth, int phase) { PIXEL v; int d, i; - d = DTAPS2; + if (phase == 0) + d = DP0TAPS2; + else + d = DP1TAPS2; /* add edge pixels */ v = src[0]; for(i = 0; i < d; i++) @@ -508,7 +564,11 @@ static void decimate2_h16(int16_t *dst, PIXEL *src, int n, PIXEL *src1, v = src[n - 1]; for(i = 0; i < d; i++) src1[d + n + i] = v; - decimate2_simple16(dst, src1 + d, n, bit_depth); + if (phase == 0) + decimate2p0_simple16(dst, src1 + d, n, bit_depth); + else + decimate2p1_simple16(dst, src1 + d, n, bit_depth); + } static void decimate2_v(PIXEL *dst, int16_t **src, int pos, int n, @@ -517,57 +577,57 @@ static void decimate2_v(PIXEL *dst, int16_t **src, int pos, int n, int16_t *src0, *src1, *src2, *src3, *src4, *src5, *srcm1, *srcm2, *srcm3, *srcm4; int i, shift, offset, pixel_max; - pos = sub_mod_int(pos, 4, DTAPS); + pos = sub_mod_int(pos, 4, DP1TAPS); srcm4 = src[pos]; - pos = add_mod_int(pos, 1, DTAPS); + pos = add_mod_int(pos, 1, DP1TAPS); srcm3 = src[pos]; - pos = add_mod_int(pos, 1, DTAPS); + pos = add_mod_int(pos, 1, DP1TAPS); srcm2 = src[pos]; - pos = add_mod_int(pos, 1, DTAPS); + pos = add_mod_int(pos, 1, DP1TAPS); srcm1 = src[pos]; - pos = add_mod_int(pos, 1, DTAPS); + pos = add_mod_int(pos, 1, DP1TAPS); src0 = src[pos]; - pos = add_mod_int(pos, 1, DTAPS); + pos = add_mod_int(pos, 1, DP1TAPS); src1 = src[pos]; - pos = add_mod_int(pos, 1, DTAPS); + pos = add_mod_int(pos, 1, DP1TAPS); src2 = src[pos]; - pos = add_mod_int(pos, 1, DTAPS); + pos = add_mod_int(pos, 1, DP1TAPS); src3 = src[pos]; - pos = add_mod_int(pos, 1, DTAPS); + pos = add_mod_int(pos, 1, DP1TAPS); src4 = src[pos]; - pos = add_mod_int(pos, 1, DTAPS); + pos = add_mod_int(pos, 1, DP1TAPS); src5 = src[pos]; shift = 21 - bit_depth; offset = 1 << (shift - 1); pixel_max = (1 << bit_depth) - 1; for(i = 0; i < n; i++) { - dst[i] = clamp_pix(((srcm4[i] + src5[i]) * DC4 + - (srcm3[i] + src4[i]) * DC3 + - (srcm2[i] + src3[i]) * DC2 + - (srcm1[i] + src2[i]) * DC1 + - (src0[i] + src1[i]) * DC0 + offset) >> shift, pixel_max); + dst[i] = clamp_pix(((srcm4[i] + src5[i]) * DP1C4 + + (srcm3[i] + src4[i]) * DP1C3 + + (srcm2[i] + src3[i]) * DP1C2 + + (srcm1[i] + src2[i]) * DP1C1 + + (src0[i] + src1[i]) * DP1C0 + offset) >> shift, pixel_max); } } /* Note: we do the horizontal decimation first to use less CPU cache */ static void decimate2_hv(uint8_t *dst, int dst_linesize, uint8_t *src, int src_linesize, - int w, int h, int bit_depth) + int w, int h, int bit_depth, int h_phase) { PIXEL *buf1; - int16_t *buf2[DTAPS]; + int16_t *buf2[DP1TAPS]; int w2, pos, i, y, y1, y2; w2 = (w + 1) / 2; - buf1 = malloc(sizeof(PIXEL) * (w + 2 * DTAPS)); + buf1 = malloc(sizeof(PIXEL) * (w + 2 * DTAPS_MAX)); /* init line buffer */ - for(i = 0; i < DTAPS; i++) { + for(i = 0; i < DP1TAPS; i++) { buf2[i] = malloc(sizeof(int16_t) * w2); y = i; - if (y > DTAPS2) - y -= DTAPS; + if (y > DP1TAPS2) + y -= DP1TAPS; if (y < 0) { /* copy from first line */ memcpy(buf2[i], buf2[0], sizeof(int16_t) * w2); @@ -576,12 +636,12 @@ static void decimate2_hv(uint8_t *dst, int dst_linesize, memcpy(buf2[i], buf2[h - 1], sizeof(int16_t) * w2); } else { decimate2_h16(buf2[i], (PIXEL *)(src + src_linesize * y), w, - buf1, bit_depth); + buf1, bit_depth, h_phase); } } for(y = 0; y < h; y++) { - pos = y % DTAPS; + pos = y % DP1TAPS; if ((y & 1) == 0) { /* filter one line */ y2 = y >> 1; @@ -589,20 +649,20 @@ static void decimate2_hv(uint8_t *dst, int dst_linesize, pos, w2, bit_depth); } /* add a new line in the buffer */ - y1 = y + DTAPS2 + 1; - pos = add_mod_int(pos, DTAPS2 + 1, DTAPS); + y1 = y + DP1TAPS2 + 1; + pos = add_mod_int(pos, DP1TAPS2 + 1, DP1TAPS); if (y1 >= h) { /* copy last line */ - memcpy(buf2[pos], buf2[sub_mod_int(pos, 1, DTAPS)], + memcpy(buf2[pos], buf2[sub_mod_int(pos, 1, DP1TAPS)], sizeof(int16_t) * w2); } else { /* horizontally decimate new line */ decimate2_h16(buf2[pos], (PIXEL *)(src + src_linesize * y1), w, - buf1, bit_depth); + buf1, bit_depth, h_phase); } } - for(i = 0; i < DTAPS; i++) + for(i = 0; i < DP1TAPS; i++) free(buf2[i]); free(buf1); } @@ -673,7 +733,7 @@ void image_free(Image *img) free(img); } -int image_ycc444_to_ycc422(Image *img) +int image_ycc444_to_ycc422(Image *img, int h_phase) { uint8_t *data1; int w1, h1, bpp, linesize1, i, y; @@ -690,7 +750,7 @@ int image_ycc444_to_ycc422(Image *img) for(y = 0; y < img->h; y++) { decimate2_h((PIXEL *)(data1 + y * linesize1), (PIXEL *)(img->data[i] + y * img->linesize[i]), - img->w, img->bit_depth); + img->w, img->bit_depth, h_phase); } free(img->data[i]); img->data[i] = data1; @@ -700,7 +760,7 @@ int image_ycc444_to_ycc422(Image *img) return 0; } -int image_ycc444_to_ycc420(Image *img) +int image_ycc444_to_ycc420(Image *img, int h_phase) { uint8_t *data1; int w1, h1, bpp, linesize1, i; @@ -717,7 +777,7 @@ int image_ycc444_to_ycc420(Image *img) data1 = malloc(linesize1 * h1); decimate2_hv(data1, linesize1, img->data[i], img->linesize[i], - img->w, img->h, img->bit_depth); + img->w, img->h, img->bit_depth, h_phase); free(img->data[i]); img->data[i] = data1; img->linesize[i] = linesize1; @@ -1330,22 +1390,29 @@ void save_yuv(Image *img, const char *filename) /* return the position of the end of the NAL or -1 if error */ -static int extract_nal(uint8_t **pnal_buf, int *pnal_len, - const uint8_t *buf, int buf_len) +static int find_nal_end(const uint8_t *buf, int buf_len) { - int idx, start, end, len; - uint8_t *nal_buf; - int nal_len; + int idx; idx = 0; - if (buf_len < 6 || buf[0] != 0 || buf[1] != 0 || buf[2] != 0 || buf[3] != 1) + if (buf_len >= 4 && + buf[0] == 0 && buf[1] == 0 && buf[2] == 0 && buf[3] == 1) { + idx = 4; + } else if (buf_len >= 3 && + buf[0] == 0 && buf[1] == 0 && buf[2] == 1) { + idx = 3; + } else { + return -1; + } + /* NAL header */ + if (idx + 2 > buf_len) return -1; - idx += 4; - start = idx; /* find the last byte */ for(;;) { - if (idx + 2 >= buf_len) + if (idx + 2 >= buf_len) { + idx = buf_len; break; + } if (buf[idx] == 0 && buf[idx + 1] == 0 && buf[idx + 2] == 1) break; if (idx + 3 < buf_len && @@ -1353,7 +1420,24 @@ static int extract_nal(uint8_t **pnal_buf, int *pnal_len, break; idx++; } - end = idx; + return idx; +} + +/* return the position of the end of the NAL or -1 if error */ +static int extract_nal(uint8_t **pnal_buf, int *pnal_len, + const uint8_t *buf, int buf_len) +{ + int idx, start, end, len; + uint8_t *nal_buf; + int nal_len; + + end = find_nal_end(buf, buf_len); + if (end < 0) + return -1; + if (buf[2] == 1) + start = 3; + else + start = 4; len = end - start; nal_buf = malloc(len); @@ -1509,10 +1593,41 @@ static void put_ue_golomb(PutBitState *s, uint32_t v) put_bits(s, n, v); } +typedef struct { + uint8_t *buf; + int size; + int len; +} DynBuf; + +static void dyn_buf_init(DynBuf *s) +{ + s->buf = NULL; + s->size = 0; + s->len = 0; +} + +static int dyn_buf_resize(DynBuf *s, int size) +{ + int new_size; + uint8_t *new_buf; + + if (size <= s->size) + return 0; + new_size = (s->size * 3) / 2; + if (new_size < size) + new_size = size; + new_buf = realloc(s->buf, new_size); + if (!new_buf) + return -1; + s->buf = new_buf; + s->size = new_size; + return 0; +} + /* suppress the VPS NAL and keep only the useful part of the SPS header. The decoder can rebuild a valid HEVC stream if needed. */ -static int build_modified_hevc(uint8_t **pout_buf, - const uint8_t *buf, int buf_len) +static int build_modified_sps(uint8_t **pout_buf, int *pout_buf_len, + const uint8_t *buf, int buf_len) { int nal_unit_type, nal_len, idx, i, ret, msps_buf_len; int out_buf_len, out_buf_len_max; @@ -1546,14 +1661,6 @@ static int build_modified_hevc(uint8_t **pout_buf, fprintf(stderr, "expecting SPS nal (%d)\n", nal_unit_type); return -1; /* expect SPS nal */ } - /* skip the next start code */ - if (idx + 3 < buf_len && - buf[idx] == 0 && buf[idx + 1] == 0 && buf[idx + 2] == 0 && buf[idx + 3] == 1) { - idx += 4; - } else if (idx + 2 < buf_len && - buf[idx] == 0 && buf[idx + 1] == 0 && buf[idx + 2] == 1) { - idx += 3; - } /* skip the initial part of the SPS up to and including log2_min_cb_size */ @@ -1785,7 +1892,7 @@ static int build_modified_hevc(uint8_t **pout_buf, } msps_buf_len = (pb->idx + 7) >> 3; - out_buf_len_max = 5 + msps_buf_len + (buf_len - idx); + out_buf_len_max = 5 + msps_buf_len; out_buf = malloc(out_buf_len_max); // printf("msps_n_bits=%d\n", pb->idx); @@ -1795,15 +1902,105 @@ static int build_modified_hevc(uint8_t **pout_buf, memcpy(p, msps_buf, msps_buf_len); p += msps_buf_len; - memcpy(p, buf + idx, buf_len - idx); - p += buf_len - idx; - out_buf_len = p - out_buf; free(msps_buf); free(nal_buf); } *pout_buf = out_buf; - return out_buf_len; + *pout_buf_len = out_buf_len; + return idx; +} + +static int build_modified_hevc(uint8_t **pout_buf, + const uint8_t *cbuf, int cbuf_len, + const uint8_t *abuf, int abuf_len) +{ + DynBuf out_buf_s, *out_buf = &out_buf_s; + uint8_t *msps; + const uint8_t *nal_buf; + int msps_len, cidx, aidx, is_alpha, nal_len, first_nal, start, l; + + dyn_buf_init(out_buf); + + /* add alpha MSPS */ + aidx = 0; /* avoids warning */ + if (abuf) { + aidx = build_modified_sps(&msps, &msps_len, abuf, abuf_len); + if (aidx < 0) + goto fail; + if (dyn_buf_resize(out_buf, out_buf->len + msps_len) < 0) + goto fail; + memcpy(out_buf->buf + out_buf->len, msps, msps_len); + out_buf->len += msps_len; + free(msps); + } + + /* add color MSPS */ + cidx = build_modified_sps(&msps, &msps_len, cbuf, cbuf_len); + if (cidx < 0) + goto fail; + if (dyn_buf_resize(out_buf, out_buf->len + msps_len) < 0) + goto fail; + memcpy(out_buf->buf + out_buf->len, msps, msps_len); + out_buf->len += msps_len; + free(msps); + + /* add the remaining NALs, alternating between alpha (if present) + and color. */ + is_alpha = (abuf != NULL); + first_nal = 1; + for(;;) { + if (!is_alpha) { + if (cidx >= cbuf_len) { + if (abuf) { + fprintf(stderr, "Incorrect number of alpha NALs\n"); + goto fail; + } + break; + } + nal_buf = cbuf + cidx; + nal_len = find_nal_end(nal_buf, cbuf_len - cidx); + // printf("cidx=%d/%d nal_len=%d\n", cidx, cbuf_len, nal_len); + if (nal_len < 0) + goto fail; + cidx += nal_len; + } else { + if (aidx >= abuf_len) + break; + nal_buf = abuf + aidx; + nal_len = find_nal_end(nal_buf, abuf_len - aidx); + // printf("aidx=%d/%d nal_len=%d\n", aidx, abuf_len, nal_len); + if (nal_len < 0) + goto fail; + aidx += nal_len; + } + start = 3 + (nal_buf[2] == 0); + if (first_nal) { + /* skip first start code */ + l = start; + } else { + l = 0; + } + if (dyn_buf_resize(out_buf, out_buf->len + nal_len - l) < 0) + goto fail; + // printf("add nal len=%d\n", nal_len - l); + memcpy(out_buf->buf + out_buf->len, nal_buf + l, nal_len - l); + if (is_alpha) { + /* set nul_layer_id of alpha to '1' */ + out_buf->buf[out_buf->len + (start - l) + 1] |= 1 << 3; + } + out_buf->len += nal_len - l; + + if (abuf) { + is_alpha ^= 1; + } + first_nal = 0; + } + *pout_buf = out_buf->buf; + return out_buf->len; + fail: + free(out_buf->buf); + return -1; } typedef enum { @@ -1830,18 +2027,17 @@ static int hevc_encode_picture2(uint8_t **pbuf, Image *img, HEVCEncodeParams *params, HEVCEncoderEnum encoder_type) { - uint8_t *buf, *out_buf; - int buf_len, out_buf_len; + int buf_len; switch(encoder_type) { #if defined(USE_JCTVC) case HEVC_ENCODER_JCTVC: - buf_len = jctvc_encode_picture(&buf, img, params); + buf_len = jctvc_encode_picture(pbuf, img, params); break; #endif #if defined(USE_X265) case HEVC_ENCODER_X265: - buf_len = x265_encode_picture(&buf, img, params); + buf_len = x265_encode_picture(pbuf, img, params); break; #endif default: @@ -1852,14 +2048,7 @@ static int hevc_encode_picture2(uint8_t **pbuf, Image *img, *pbuf = NULL; return -1; } - out_buf_len = build_modified_hevc(&out_buf, buf, buf_len); - free(buf); - if (out_buf_len < 0) { - *pbuf = NULL; - return -1; - } - *pbuf = out_buf; - return out_buf_len; + return buf_len; } @@ -1937,10 +2126,13 @@ int main(int argc, char **argv) HEVCEncodeParams p_s, *p = &p_s; uint8_t *out_buf, *alpha_buf, *extension_buf; int out_buf_len, alpha_buf_len, verbose; + uint8_t *hevc_buf; + int hevc_buf_len; FILE *f; int qp, c, option_index, sei_decoded_picture_hash, is_png, extension_buf_len; int keep_metadata, cb_size, width, height, compress_level, alpha_qp; int bit_depth, lossless_mode, i, limited_range, premultiplied_alpha; + int c_h_phase; BPGImageFormatEnum format; BPGColorSpaceEnum color_space; BPGMetaData *md; @@ -1951,6 +2143,7 @@ int main(int argc, char **argv) alpha_qp = -1; sei_decoded_picture_hash = 0; format = BPG_FORMAT_420; + c_h_phase = 1; color_space = BPG_CS_YCbCr; keep_metadata = 0; verbose = 0; @@ -2015,10 +2208,18 @@ int main(int argc, char **argv) case 'f': if (!strcmp(optarg, "420")) { format = BPG_FORMAT_420; + c_h_phase = 1; } else if (!strcmp(optarg, "422")) { format = BPG_FORMAT_422; + c_h_phase = 1; } else if (!strcmp(optarg, "444")) { format = BPG_FORMAT_444; + } else if (!strcmp(optarg, "422_video")) { + format = BPG_FORMAT_422; + c_h_phase = 0; + } else if (!strcmp(optarg, "420_video")) { + format = BPG_FORMAT_420; + c_h_phase = 0; } else { fprintf(stderr, "Invalid chroma format\n"); exit(1); @@ -2143,10 +2344,10 @@ int main(int argc, char **argv) if (img->format == BPG_FORMAT_444) { if (format == BPG_FORMAT_420) { - if (image_ycc444_to_ycc420(img) != 0) + if (image_ycc444_to_ycc420(img, c_h_phase) != 0) goto error_convert; } else if (format == BPG_FORMAT_422) { - if (image_ycc444_to_ycc422(img) != 0) { + if (image_ycc444_to_ycc422(img, c_h_phase) != 0) { error_convert: fprintf(stderr, "Cannot convert image\n"); exit(1); @@ -2201,6 +2402,16 @@ int main(int argc, char **argv) exit(1); } } + + hevc_buf = NULL; + hevc_buf_len = build_modified_hevc(&hevc_buf, out_buf, out_buf_len, + alpha_buf, alpha_buf_len); + if (hevc_buf_len < 0) { + fprintf(stderr, "Error while creating HEVC data\n"); + exit(1); + } + free(out_buf); + free(alpha_buf); /* prepare the extension data */ extension_buf = NULL; @@ -2235,7 +2446,7 @@ int main(int argc, char **argv) { uint8_t img_header[128], *q; - int v, has_alpha, has_extension, alpha2_flag, alpha1_flag; + int v, has_alpha, has_extension, alpha2_flag, alpha1_flag, format; has_alpha = (img_alpha != NULL); has_extension = (extension_buf_len > 0); @@ -2259,7 +2470,14 @@ int main(int argc, char **argv) *q++ = (IMAGE_HEADER_MAGIC >> 16) & 0xff; *q++ = (IMAGE_HEADER_MAGIC >> 8) & 0xff; *q++ = (IMAGE_HEADER_MAGIC >> 0) & 0xff; - v = (img->format << 5) | (alpha1_flag << 4) | (img->bit_depth - 8); + + if (c_h_phase == 0 && img->format == BPG_FORMAT_420) + format = BPG_FORMAT_420_VIDEO; + else if (c_h_phase == 0 && img->format == BPG_FORMAT_422) + format = BPG_FORMAT_422_VIDEO; + else + format = img->format; + v = (format << 5) | (alpha1_flag << 4) | (img->bit_depth - 8); *q++ = v; v = (img->color_space << 4) | (has_extension << 3) | (alpha2_flag << 2) | (img->limited_range << 1); @@ -2267,13 +2485,10 @@ int main(int argc, char **argv) put_ue(&q, width); put_ue(&q, height); - put_ue(&q, out_buf_len); + put_ue(&q, 0); /* zero length means up to the end of the file */ if (has_extension) { put_ue(&q, extension_buf_len); /* extension data length */ } - if (has_alpha) { - put_ue(&q, alpha_buf_len); - } fwrite(img_header, 1, q - img_header, f); @@ -2285,21 +2500,11 @@ int main(int argc, char **argv) free(extension_buf); } - /* HEVC YUV/RGB data */ - if (fwrite(out_buf, 1, out_buf_len, f) != out_buf_len) { + if (fwrite(hevc_buf, 1, hevc_buf_len, f) != hevc_buf_len) { fprintf(stderr, "Error while writing HEVC image planes\n"); exit(1); } - free(out_buf); - - if (has_alpha) { - /* alpha data */ - if (fwrite(alpha_buf, 1, alpha_buf_len, f) != alpha_buf_len) { - fprintf(stderr, "Error while writing HEVC alpha plane\n"); - exit(1); - } - free(alpha_buf); - } + free(hevc_buf); } fclose(f); diff --git a/doc/bpg_spec.txt b/doc/bpg_spec.txt index 6e0d646..74c7d98 100644 --- a/doc/bpg_spec.txt +++ b/doc/bpg_spec.txt @@ -1,6 +1,6 @@ BPG Specification -version 0.9.3 +version 0.9.4 Copyright (c) 2014 Fabrice Bellard @@ -17,8 +17,12 @@ space is either BT 601 (JPEG case), BT 709 or BT 2020. The chroma can be subsampled by a factor of two in horizontal or both in horizontal and vertical directions (4:4:4, 4:2:2 or 4:2:0 chroma -formats are supported). The chroma is sampled at the same position -relative to the luma as in the JPEG format [2]. +formats are supported). In order to be able to transcode JPEG images +or video frames without modification to the chroma, both JPEG and +MPEG2 chroma sample positions are supported. + +Progressive decoding and display is supported by interleaving the +alpha and color data. Arbitrary metadata (such as EXIF, ICC profile, XMP) are supported. @@ -73,24 +77,17 @@ heic_file() { picture_data_length ue7(32) if (extension_present_flag) extension_data_length ue7(32) - if (alpha1_flag || alpha2_flag) - alpha_data_length ue7(32) if (extension_present_flag) { extension_data() } hevc_header_and_data() - - if (alpha1_flag || alpha2_flag) { - hevc_header_and_data() - } - } extension_data() { - for(i = 0; i < v; i++) { + while (more_bytes()) { extension_tag ue7(32) extension_tag_length ue7(32) for(j = 0; j < extension_tag_length; j++) { @@ -100,6 +97,15 @@ extension_data() } hevc_header_and_data() +{ + if (alpha1_flag || alpha2_flag) { + hevc_header() + } + hevc_header() + hevc_data() +} + +hevc_header() { hevc_header_length ue7(32) log2_min_luma_coding_block_size_minus3 ue(v) @@ -134,8 +140,6 @@ hevc_header_and_data() cabac_bypass_alignment_enabled_flag u(1) } trailing_bits u(v) - - hevc_data() } hevc_data() @@ -154,9 +158,11 @@ hevc_data() 'pixel_format' indicates the chroma subsampling: 0 : Grayscale - 1 : 4:2:0 - 2 : 4:2:2 + 1 : 4:2:0. Chroma at position (0.5, 0.5) (JPEG chroma position) + 2 : 4:2:2. Chroma at position (0.5, 0) (JPEG chroma position) 3 : 4:4:4 + 4 : 4:2:0. Chroma at position (0, 0.5) (MPEG2 chroma position) + 5 : 4:2:2. Chroma at position (0, 0) (MPEG2 chroma position) The other values are reserved. @@ -217,9 +223,8 @@ hevc_data() For RGB, G is stored as the Y plane. B in the Cb plane and R in the Cr plane. - YCgCo is defined as HEVC matrix_coeffs = 8, full range. Y is - stored in the Y plane. Cg in the Cb plane and Co in the Cr - plane. + YCgCo is defined as HEVC matrix_coeffs = 8. Y is stored in the + Y plane. Cg in the Cb plane and Co in the Cr plane. If no color profile is present, the RGB output data are assumed to be in the sRGB color space [6]. @@ -246,12 +251,12 @@ hevc_data() 'picture_height' is the picture height in pixels. The value 0 is not allowed. - 'picture_data_length' is the picture data length in bytes. + 'picture_data_length' is the picture data length in bytes. The + special value of zero indicates that the picture data goes up to + the end of the file. 'extension_data_length' is the extension data length in bytes. - 'alpha_data_length' is the alpha data length in bytes. - 'extension_data()' is the extension data. 'extension_tag' is the extension tag. The following values are defined: @@ -320,7 +325,19 @@ hevc_data() - bit_depth_luma_minus8 = bit_depth_minus_8 - bit_depth_chroma_minus8 = bit_depth_minus_8 - scaling_list_enabled_flag = 0 - + + Alpha data encoding: + + - If alpha data is present, all the corresponding NALs have + nuh_layer_id = 1. NALs for color data shall have nuh_layer_id = + 0. + - Alpha data shall use the same tile sizes as color data and + shall have the same entropy_coding_sync_enabled_flag value as + color data. + - Alpha slices shall use the same number of coding units as color + slices and should be interleaved with color slices. alpha NALs + shall come before the corresponding color NALs. + 3.3) HEVC Profile ----------------- @@ -361,7 +378,7 @@ information. - Pixel formats: we wanted to be able to convert JPEG images to BPG with as little loss as possible. So supporting the same color space - (CCIR 601 YCbCr) with the same range (full range) and most of the + (BT 601 YCbCr) with the same range (full range) and most of the allowed JPEG chroma formats (4:4:4, 4:2:2, 4:2:0 or grayscale) was mandatory to avoid going back to RGB or doing a subsampling or interpolation. @@ -371,7 +388,14 @@ information. format to simplify the decoder. The color is either non-premultiplied or premultiplied. Premultiplied alpha usually gives a better compression. Non-premultiplied alpha is supported in - case no loss is needed on the color components. + case no loss is needed on the color components. In order to allow + progressive display, the alpha and color data are interleaved (the + nuh_layed_id NAL field is 0 for color data and 1 for alpha + data). The alpha and color slices should contain the same number of + coding units and each alpha slice should come before the + corresponding color slice. Since alpha slices are usually smaller + than color slices, it allows a progressive display even if there is + a single slice. - Color spaces: In addition to YCbCr, RGB is supported for the high quality or lossless cases. YCgCo is supported because it may give @@ -423,4 +447,4 @@ information. [5] Extensible Metadata Platform (XMP) http://www.adobe.com/devnet/xmp.html -[6] sRGB color space, IEC 61966-2-1. +[6] sRGB color space, IEC 61966-2-1 diff --git a/html/bpgdec.js b/html/bpgdec.js index b247759..12580aa 100644 --- a/html/bpgdec.js +++ b/html/bpgdec.js @@ -50,40 +50,40 @@ P([0,0,1,0,1,2,0,1,2,3,1,2,3,2,3,3,0,1,0,2,1,0,3,2,1,0,3,2,1,3,2,3,0,0,1,0,1,2,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"i8",ta,z.r);var Oa=z.g(P(12,"i8",ra),8);x(0==Oa%8);l._llvm_bswap_i32=Pa;l._bitshift64Ashr=Qa;l._i64Subtract=Ra;function Y(a){Y.G||(C=C+4095&-4096,Y.G=i,x(z.b),Y.u=z.b,z.b=function(){A("cannot dynamically allocate, sbrk now has control")});var d=C;0!=a&&Y.u(a);return d}l._i64Add=Sa;l._strlen=Ta;l._memset=Ua;l._bitshift64Shl=Va;function Wa(a){l.exit(a)} -function Xa(a){return 0.5!==Math.abs(a%1)?Math.round(a):a+a%2+(0>a?1:-1)}l._memcpy=Ya;ya=y=z.g(B);za=ya+Ba;Aa=C=z.g(za);x(Aaa?1:-1)}l._memcpy=Xa;ya=y=z.g(B);za=ya+Ba;Aa=C=z.g(za);x(Aa>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 Sa(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 Ta(a){a=a|0;D=a}function Ua(){return D|0}function Va(b,d){b=b|0;d=d|0;var e=0,f=0;e=i;if(!(a[(c[b+204>>2]|0)+43>>0]|0)){i=e;return}f=c[(c[b+200>>2]|0)+13128>>2]|0;d=(d|0)%(f|0)|0;if((d|0)!=2?!((f|0)==2&(d|0)==0):0){i=e;return}ce(c[b+152>>2]|0,c[b+136>>2]|0,199)|0;i=e;return}function Wa(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;g=b+204|0;f=c[g>>2]|0;if((c[(c[f+1668>>2]|0)+(c[b+2500>>2]<<2)>>2]|0)==(d|0)){Xa(b);f=b+1449|0;if(a[f>>0]|0){j=c[g>>2]|0;if((a[j+42>>0]|0)!=0?(j=c[j+1676>>2]|0,(c[j+(d<<2)>>2]|0)!=(c[j+(d+ -1<<2)>>2]|0)):0)h=5}else h=5;if((h|0)==5)Ya(b);if(a[b+1448>>0]|0){i=e;return}if(!(a[(c[g>>2]|0)+43>>0]|0)){i=e;return}g=c[(c[b+200>>2]|0)+13128>>2]|0;if((d|0)%(g|0)|0){i=e;return}if((g|0)==1){Ya(b);i=e;return}if((a[f>>0]|0)!=1){i=e;return}ce(c[b+136>>2]|0,c[b+152>>2]|0,199)|0;i=e;return}if((a[f+42>>0]|0)!=0?(j=c[f+1676>>2]|0,(c[j+(d<<2)>>2]|0)!=(c[j+(d+ -1<<2)>>2]|0)):0){if((a[b+141>>0]|0)==1)Za(c[b+136>>2]|0);else Xa(b);Ya(b);f=c[g>>2]|0}if(!(a[f+43>>0]|0)){i=e;return}f=b+200|0;if((d|0)%(c[(c[f>>2]|0)+13128>>2]|0)|0){i=e;return}d=b+136|0;_a((c[d>>2]|0)+224|0)|0;if((a[b+141>>0]|0)==1)Za(c[d>>2]|0);else Xa(b);if((c[(c[f>>2]|0)+13128>>2]|0)==1){Ya(b);i=e;return}else{ce(c[d>>2]|0,c[b+152>>2]|0,199)|0;i=e;return}}function Xa(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;e=a+136|0;a=c[e>>2]|0;d=a+204|0;cd(d,1);g=a+212|0;f=c[g>>2]|0;h=0-f&7;if(h){cd(d,h);f=c[g>>2]|0}_c((c[e>>2]|0)+224|0,(c[d>>2]|0)+((f|0)/8|0)|0,(7-f+(c[a+216>>2]|0)|0)/8|0);i=b;return}function Ya(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;g=i;f=c[b+1440>>2]|0;e=2-f|0;e=(a[b+2060>>0]|0)==0|(f|0)==2?e:e^3;f=b+2112|0;b=b+136|0;h=0;do{j=d[680+(e*199|0)+h>>0]|0;l=a[f>>0]|0;k=l<<24>>24;if(l<<24>>24<0)k=0;else k=(k|0)>51?51:k;j=((j<<3&120)+ -16+(($(k,((j>>>4)*5|0)+ -45|0)|0)>>4)<<1)+ -127|0;j=j>>31^j;if((j|0)>124)j=j&1|124;a[(c[b>>2]|0)+h>>0]=j;h=h+1|0}while((h|0)!=199);a[(c[b>>2]|0)+199>>0]=0;a[(c[b>>2]|0)+200>>0]=0;a[(c[b>>2]|0)+201>>0]=0;a[(c[b>>2]|0)+202>>0]=0;i=g;return}function Za(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+224|0;e=c[a+240>>2]|0;f=c[d>>2]|0;e=(f&1|0)==0?e:e+ -1|0;e=(f&511|0)==0?e:e+ -1|0;a=(c[a+244>>2]|0)-e|0;if((a|0)<0){i=b;return}_c(d,e,a);i=b;return}function _a(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;f=a+4|0;d=c[f>>2]|0;e=d+ -2|0;c[f>>2]=e;g=c[a>>2]|0;if((g|0)>=(e<<17|0)){g=(c[a+16>>2]|0)-(c[a+12>>2]|0)|0;i=b;return g|0}d=(d+ -258|0)>>>31;c[f>>2]=e<>2]=g;if(g&65535){g=0;i=b;return g|0}Ab(a);g=0;i=b;return g|0}function $a(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=ab(a+224|0,a)|0;i=b;return a|0}function ab(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;h=d[e>>0]|0;j=b+4|0;k=c[j>>2]|0;l=d[2880+((k<<1&384)+(h|512))>>0]|0;k=k-l|0;m=k<<17;n=c[b>>2]|0;g=m-n>>31;c[b>>2]=n-(g&m);c[j>>2]=(g&l-k)+k;h=g^h;a[e>>0]=a[h+4032>>0]|0;e=h&1;h=c[j>>2]|0;g=d[2880+h>>0]|0;c[j>>2]=h<>2]<>2]=g;if(g&65535){i=f;return e|0}j=b+16|0;h=c[j>>2]|0;c[b>>2]=(((d[h+1>>0]|0)<<1|(d[h>>0]|0)<<9)+ -65535<<7-(d[2880+((g+ -1^g)>>15)>>0]|0))+g;if(h>>>0>=(c[b+20>>2]|0)>>>0){i=f;return e|0}c[j>>2]=h+2;i=f;return e|0}function bb(a){a=a|0;var b=0,d=0;b=i;a=a+136|0;d=c[a>>2]|0;if(!(ab(d+224|0,d+1|0)|0)){d=0;i=b;return d|0}d=(cb((c[a>>2]|0)+224|0)|0)==0;d=d?1:2;i=b;return d|0}function cb(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[a>>2]<<1;c[a>>2]=d;if(!(d&65534)){Ab(a);d=c[a>>2]|0}e=c[a+4>>2]<<17;if((d|0)<(e|0)){e=0;i=b;return e|0}c[a>>2]=d-e;e=1;i=b;return e|0}function db(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(cb((c[d>>2]|0)+224|0)|0)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=cb((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function eb(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=c[(c[a+200>>2]|0)+52>>2]|0;d=(d|0)>10?31:(1<0)a=0;else{f=0;i=b;return f|0}while(1){f=a+1|0;if(!(cb((c[e>>2]|0)+224|0)|0)){d=4;break}if((f|0)<(d|0))a=f;else{a=f;d=4;break}}if((d|0)==4){i=b;return a|0}return 0}function fb(a){a=a|0;var b=0;b=i;a=cb((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function gb(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(cb((c[d>>2]|0)+224|0)|0)<<1;a=cb((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function hb(a){a=a|0;var b=0;b=i;a=_a((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function ib(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+5|0)|0;i=b;return a|0}function jb(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;a=a+136|0;g=9;e=0;while(1){h=c[a>>2]|0;f=e;e=e+1|0;if(!(ab(h+224|0,h+g|0)|0)){e=f;g=0;break}if((e|0)>=5){f=0;g=0;d=4;break}else g=10}do if((d|0)==4){while(1){d=0;if(!(cb((c[a>>2]|0)+224|0)|0)){d=5;break}g=(1<>2]|0)+224|0)|0)<>2]|0)+224|0)|0;i=b;return a|0}function lb(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+176|0)|0;i=b;return a|0}function mb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;e=a[(c[b+204>>2]|0)+1633>>0]|0;e=(e&255)<5?5:e&255;f=b+136|0;if(!e){g=0;i=d;return g|0}else b=0;while(1){h=c[f>>2]|0;g=b+1|0;if(!(ab(h+224|0,h+177|0)|0)){e=4;break}if((g|0)<(e|0))b=g;else{b=g;e=4;break}}if((e|0)==4){i=d;return b|0}return 0}function nb(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;j=i;k=c[b+200>>2]|0;n=(1<>2])+ -1|0;l=n&g;m=c[k+13064>>2]|0;h=f>>m;m=g>>m;g=c[b+136>>2]|0;if((a[g+308>>0]|0)==0?(n&f|0)==0:0)f=0;else{f=h+ -1+($(c[k+13140>>2]|0,m)|0)|0;f=d[(c[b+4336>>2]|0)+f>>0]|0}if((a[g+309>>0]|0)==0&(l|0)==0){n=0;m=(f|0)>(e|0);m=m&1;n=(n|0)>(e|0);n=n&1;f=g+224|0;m=m|2;n=m+n|0;n=g+n|0;n=ab(f,n)|0;i=j;return n|0}n=($(c[k+13140>>2]|0,m+ -1|0)|0)+h|0;n=d[(c[b+4336>>2]|0)+n>>0]|0;m=(f|0)>(e|0);m=m&1;n=(n|0)>(e|0);n=n&1;f=g+224|0;m=m|2;n=m+n|0;n=g+n|0;n=ab(f,n)|0;i=j;return n|0}function ob(a,b){a=a|0;b=b|0;var d=0;d=i;b=c[a+136>>2]|0;b=(ab(b+224|0,b+13|0)|0)==0;i=d;return(b?3:0)|0}function pb(a){a=a|0;var b=0;b=i;a=_a((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function qb(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+17|0)|0;i=b;return a|0}function rb(a){a=a|0;var b=0,d=0,e=0;b=i;e=a+136|0;d=0;while(1){a=d+1|0;if(!(cb((c[e>>2]|0)+224|0)|0)){a=d;d=4;break}if((a|0)<2)d=a;else{d=4;break}}if((d|0)==4){i=b;return a|0}return 0}function sb(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(cb((c[d>>2]|0)+224|0)|0)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=cb((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function tb(a){a=a|0;var b=0,d=0;b=i;a=a+136|0;d=c[a>>2]|0;if(!(ab(d+224|0,d+18|0)|0)){d=4;i=b;return d|0}d=(cb((c[a>>2]|0)+224|0)|0)<<1;d=cb((c[a>>2]|0)+224|0)|0|d;i=b;return d|0}function ub(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+(42-b)|0)|0;i=d;return a|0}function vb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+(b+42)|0)|0;i=d;return a|0}function wb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+((b|0)==0|40)|0)|0;i=d;return a|0}function xb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;a=a+136|0;f=(b<<2)+166|0;e=0;while(1){g=c[a>>2]|0;b=e+1|0;if(!(ab(g+224|0,g+(f+e)|0)|0)){b=e;a=4;break}if((b|0)<4)e=b;else{a=4;break}}if((a|0)==4){i=d;return b|0}return 0}function yb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+(b+174)|0)|0;i=d;return a|0}function zb(f,g,h,j,k,l){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,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,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Fa=0,Ga=0,Ia=0,Ja=0,Ka=0,La=0,Na=0;o=i;i=i+96|0;v=o+24|0;u=o+8|0;s=o;t=f+136|0;p=c[t>>2]|0;q=c[f+160>>2]|0;m=c[q+(l<<2)+32>>2]|0;n=f+200|0;T=c[n>>2]|0;h=$(h>>c[T+(l<<2)+13180>>2],m)|0;g=(c[q+(l<<2)>>2]|0)+(h+(g>>c[T+(l<<2)+13168>>2]<>2]))|0;T=(l|0)!=0;h=p+320|0;q=T?p+11680|0:h;w=v+0|0;r=w+64|0;do{a[w>>0]=0;w=w+1|0}while((w|0)<(r|0));S=1<>2]|0;r=S<>0]|0)){A=a[p+272>>0]|0;C=f+204|0;La=c[C>>2]|0;if((a[La+21>>0]|0)!=0?(d[La+1629>>0]|0)>=(j|0):0){F=c[t>>2]|0;F=ab(F+224|0,F+(T&1|46)|0)|0}else F=0;if(y){B=c[n>>2]|0;G=B;B=(c[B+13192>>2]|0)+A|0}else{B=c[C>>2]|0;if((l|0)==1)B=(c[f+2072>>2]|0)+(c[B+28>>2]|0)+(a[p+302>>0]|0)|0;else B=(c[f+2076>>2]|0)+(c[B+32>>2]|0)+(a[p+303>>0]|0)|0;E=B+A|0;G=c[n>>2]|0;A=c[G+13192>>2]|0;B=0-A|0;if((E|0)>=(B|0))B=(E|0)>57?57:E;do if((c[G+4>>2]|0)==1){if((B|0)>=30)if((B|0)>43){B=B+ -6|0;break}else{B=c[176+(B+ -30<<2)>>2]|0;break}}else B=(B|0)>51?51:B;while(0);B=A+B|0}A=(c[G+52>>2]|0)+j|0;E=A+ -5|0;A=1<>0]|0)>>0]<>0];if((a[G+634>>0]|0)!=0?!((F|0)!=0&(j|0)>2):0){H=c[C>>2]|0;H=(a[H+68>>0]|0)==0?G+635|0:H+69|0;G=((c[p+31244>>2]|0)!=1?3:0)+l|0;C=H+((j+ -2|0)*384|0)+(G<<6)|0;if((j|0)>3)ia=a[H+((j+ -4|0)*6|0)+G+1536>>0]|0;else ia=16}else{ia=16;C=0}}else{A=0;ia=0;B=0;C=0;E=0;F=0}J=(j<<1)+ -1|0;if(y){G=(j*3|0)+ -6+(j+ -1>>2)|0;I=j+1>>2}else{G=15;I=j+ -2|0}if((J|0)>0){K=G+52|0;H=0;while(1){La=c[t>>2]|0;L=H+1|0;if(!(ab(La+224|0,La+(K+(H>>I))|0)|0))break;if((L|0)<(J|0))H=L;else{H=L;break}}L=G+70|0;G=0;while(1){La=c[t>>2]|0;K=G+1|0;if(!(ab(La+224|0,La+(L+(G>>I))|0)|0))break;if((K|0)<(J|0))G=K;else{G=K;break}}if((H|0)>3){I=(H>>1)+ -1|0;K=cb((c[t>>2]|0)+224|0)|0;if((I|0)>1){J=1;do{K=cb((c[t>>2]|0)+224|0)|0|K<<1;J=J+1|0}while((J|0)!=(I|0))}H=K+((H&1|2)<3){J=(G>>1)+ -1|0;K=cb((c[t>>2]|0)+224|0)|0;if((J|0)>1){I=1;do{K=cb((c[t>>2]|0)+224|0)|0|K<<1;I=I+1|0}while((I|0)!=(J|0))}I=H;L=K+((G&1|2)<>2;N=L>>2;if((k|0)==1){G=I;H=L;P=d[536+(L<<3)+I>>0]|0;I=488;L=504;J=496;K=520;break}else if(k){J=I;K=L;x=49;break}P=d[(I&3)+(392+((L&3)<<2))>>0]|0;if((S|0)==8){G=I;H=L;P=(d[416+(N<<1)+M>>0]<<4)+P|0;I=496;L=8;J=488;K=24;break}else if((S|0)==16){G=I;H=L;P=(d[392+(N<<2)+M>>0]<<4)+P|0;I=8;L=8;J=24;K=24;break}else if((S|0)==4){G=I;H=L;I=408;L=8;J=408;K=24;break}else{G=I;H=L;P=(d[424+(N<<3)+M>>0]<<4)+P|0;I=40;L=8;J=104;K=24;break}}else{J=L;K=I;M=L>>2;N=I>>2;x=49}while(0);if((x|0)==49){G=J;H=K;P=d[536+(J<<3)+K>>0]|0;I=496;L=520;J=488;K=504}O=P+1|0;Q=P>>4;if((Q|0)>-1){P=(1<0;R=l?90:88;S=S+ -1>>2;W=T?27:0;U=(j|0)==2;T=W+3|0;V=(j|0)==3;Z=(k|0)==0?9:15;_=y?0:27;da=(F|0)==0;aa=y?42:43;fa=y?40:41;ba=y?2:0;ea=p+31244|0;ca=w&-17;ga=f+204|0;Y=((B|0)<0)<<31>>31;X=((A|0)<0)<<31>>31;ha=(F|0)!=0&(j|0)>2;k=(j|0)<4;ia=ia&255;ma=(y&1)<<1;ja=ma|1;ra=1;ka=Q;oa=0;xa=16;while(1){na=ka<<4;wa=a[I+ka>>0]|0;ta=wa&255;va=a[J+ka>>0]|0;ua=va&255;la=(ka|0)>0;if((ka|0)<(Q|0)&la){if((ta|0)<(P|0))pa=d[v+(ta+1<<3)+ua>>0]|0;else pa=0;if((ua|0)<(P|0))pa=(d[ua+1+(v+(ta<<3))>>0]|0)+pa|0;ya=c[t>>2]|0;ya=(ab(ya+224|0,ya+(((pa|0)>1?1:pa)+R)|0)|0)&255;a[v+(ta<<3)+ua>>0]=ya;qa=1}else{if(!((ta|0)==(M|0)&(ua|0)==(N|0)))if(!(wa<<24>>24))ya=va<<24>>24==0&1;else ya=0;else ya=1;a[v+(ta<<3)+ua>>0]=ya;qa=0}na=O-na|0;pa=(ka|0)==(Q|0);if(pa){a[u>>0]=na+255;sa=na+ -2|0;na=1}else{sa=15;na=0}if((ta|0)<(S|0))za=(a[v+(ta+1<<3)+ua>>0]|0)!=0&1;else za=0;if((ua|0)<(S|0))za=((a[ua+1+(v+(ta<<3))>>0]|0)!=0&1)<<1|za;do if(ya<<24>>24!=0&(sa|0)>-1){if(!(c[(c[n>>2]|0)+13100>>2]|0))if(U){wa=600;va=W}else x=73;else if(da){ya=(a[z>>0]|0)!=0;if(ya|U){wa=ya?664:600;va=ya?fa:W}else x=73}else{wa=664;va=fa}do if((x|0)==73){x=0;ya=(za<<4)+616|0;if(!y){wa=ya;va=W+(V?9:12)|0;break}va=(va|wa)<<24>>24==0?W:T;if(V){wa=ya;va=va+Z|0;break}else{wa=ya;va=va+21|0;break}}while(0);if((sa|0)>0){ya=va+92|0;do{La=c[t>>2]|0;if(ab(La+224|0,La+(ya+(d[wa+((d[K+sa>>0]<<2)+(d[L+sa>>0]|0))>>0]|0))|0)|0){a[u+(na&255)>>0]=sa;qa=0;na=na+1<<24>>24}sa=sa+ -1|0}while((sa|0)>0)}if(qa){a[u+(na&255)>>0]=0;qa=na+1<<24>>24;break}if(c[(c[n>>2]|0)+13100>>2]|0)if(da?(a[z>>0]|0)==0:0)x=87;else qa=aa;else x=87;if((x|0)==87){x=0;qa=(ka|0)==0?_:va+2|0}La=c[t>>2]|0;if((ab(La+224|0,La+(qa+92)|0)|0)==1){a[u+(na&255)>>0]=0;qa=na+1<<24>>24}else qa=na}else qa=na;while(0);na=qa&255;a:do if(qa<<24>>24){qa=la?ba:0;if(!(c[(c[n>>2]|0)+13116>>2]|0))Da=0;else{if(da?(a[z>>0]|0)==0:0)oa=ma;else oa=ja;Da=(d[p+oa+199>>0]|0)>>>2}sa=qa|(ra|0)==0&(pa^1)&1;Ba=a[u>>0]|0;va=Ba&255;qa=na>>>0>8?8:na;if(!qa){pa=-1;ra=1}else{ya=sa<<2;pa=-1;ra=1;wa=0;do{La=ra+ya|0;Ka=c[t>>2]|0;La=(ab(Ka+224|0,Ka+((l?La+16|0:La)+136)|0)|0)&255;a[s+wa>>0]=La;if(!(La<<24>>24))ra=((ra+ -1|0)>>>0<2&1)+ra|0;else{pa=(pa|0)==-1?wa:pa;ra=0}wa=wa+1|0}while((wa|0)<(qa|0))}wa=na+ -1|0;qa=a[u+wa>>0]|0;ya=qa&255;do if(!(a[z>>0]|0)){if((c[ea>>2]|0)==1?!((c[(c[n>>2]|0)+13104>>2]|0)==0|da|(ca|0)!=10):0){va=0;break}va=(va-ya|0)>3&1}else va=0;while(0);if((pa|0)!=-1){Ka=c[t>>2]|0;Ka=ab(Ka+224|0,Ka+((l?sa|4:sa)|160)|0)|0;La=s+pa|0;a[La>>0]=(d[La>>0]|0)+Ka}sa=(va|0)==0;if((a[(c[ga>>2]|0)+4>>0]|0)==0|sa){wa=0;va=0;do{va=cb((c[t>>2]|0)+224|0)|0|va<<1;wa=wa+1|0}while((wa|0)<(na|0));za=va<<16-na}else{va=wa&255;if(!((wa&255)<<24>>24))ya=0;else{wa=0;ya=0;do{ya=cb((c[t>>2]|0)+224|0)|0|ya<<1;wa=wa+1|0}while((wa|0)<(va|0))}za=ya<<17-na}ta=ta<<2;va=ua<<2;ua=p+oa+199|0;wa=0;Fa=0;Aa=xa;Ca=0;while(1){xa=Ba&255;ya=(d[L+xa>>0]|0)+ta|0;xa=(d[K+xa>>0]|0)+va|0;b:do if((wa|0)<8){Ga=(d[s+wa>>0]|0)+1|0;La=(wa|0)==(pa|0);if((Ga|0)==((La?3:2)|0)&0==((La?0:0)|0))Ia=0;else{Ia=0;break}while(1){Ja=Ia+1|0;if(!(cb((c[t>>2]|0)+224|0)|0)){x=120;break}if((Ja|0)<31)Ia=Ja;else{x=124;break}}do if((x|0)==120){x=0;if((Ia|0)>=3){Ja=Ia;x=124;break}if((Da|0)>0){Ja=0;Ka=0;do{Ka=cb((c[t>>2]|0)+224|0)|0|Ka<<1;Ja=Ja+1|0}while((Ja|0)!=(Da|0))}else Ka=0;Ja=Ka+(Ia<0){Ka=Da+ -3+Ja|0;Ja=0;La=0;do{La=cb((c[t>>2]|0)+224|0)|0|La<<1;Ja=Ja+1|0}while((Ja|0)!=(Ka|0))}else La=0;Ja=La+((1<>31|0,Ga|0,0)|0;Ia=D;Ka=3<>31;La=c[(c[n>>2]|0)+13116>>2]|0;do if((Ia|0)>(Na|0)|(Ia|0)==(Na|0)&Ga>>>0>Ka>>>0){Ka=Da+1|0;if(La){Da=Ka;break}Da=(Da|0)>3?4:Ka;break b}while(0);if(!((La|0)!=0&(Fa|0)==0))break;Fa=a[ua>>0]|0;Ka=(Fa&255)>>>2;if((Ja|0)>=(3<>0]=Fa+1<<24>>24;Fa=1;break}if((Ja<<1|0)>=(1<>24==0){Fa=1;break}a[ua>>0]=Fa+ -1<<24>>24;Fa=1}else{Ga=0;while(1){Ia=Ga+1|0;if(!(cb((c[t>>2]|0)+224|0)|0)){x=138;break}if((Ia|0)<31)Ga=Ia;else{x=142;break}}do if((x|0)==138){x=0;if((Ga|0)>=3){Ia=Ga;x=142;break}if((Da|0)>0){Ia=0;Ja=0;do{Ja=cb((c[t>>2]|0)+224|0)|0|Ja<<1;Ia=Ia+1|0}while((Ia|0)!=(Da|0))}else Ja=0;Ja=Ja+(Ga<0){Ja=Da+ -3+Ia|0;Ia=0;Ka=0;do{Ka=cb((c[t>>2]|0)+224|0)|0|Ka<<1;Ia=Ia+1|0}while((Ia|0)!=(Ja|0))}else Ka=0;Ja=Ka+((1<>31;La=c[(c[n>>2]|0)+13116>>2]|0;do if((Ja|0)>=(3<3?4:Ka;break b}while(0);if(!((La|0)!=0&(Fa|0)==0))break;Ka=a[ua>>0]|0;Fa=(Ka&255)>>>2;if((Ja|0)>=(3<>0]=Ka+1<<24>>24;Fa=1;break}if((Ja<<1|0)>=(1<>24==0){Fa=1;break}a[ua>>0]=Ka+ -1<<24>>24;Fa=1}while(0);do if(!((a[(c[ga>>2]|0)+4>>0]|0)==0|sa)){Ca=_d(Ga|0,Ia|0,Ca|0,0)|0;if(Ba<<24>>24!=qa<<24>>24)break;Na=(Ca&1|0)==0;La=Zd(0,0,Ga|0,Ia|0)|0;Ga=Na?Ga:La;Ia=Na?Ia:D}while(0);Na=(za&32768|0)==0;Ba=Zd(0,0,Ga|0,Ia|0)|0;Ba=Na?Ga:Ba;Ga=Na?Ia:D;za=za<<1&131070;Ia=Ba&65535;do if(!(a[z>>0]|0)){do if(!((a[(c[n>>2]|0)+634>>0]|0)==0|ha)){if(!((xa|ya|0)!=0|k)){Aa=ia;break}if((j|0)==3)Aa=(xa<<3)+ya|0;else if((j|0)==4)Aa=(xa>>>1<<3)+(ya>>>1)|0;else if((j|0)==5)Aa=(xa>>>2<<3)+(ya>>>2)|0;else Aa=(xa<<2)+ya|0;Aa=d[C+Aa>>0]|0}while(0);Ba=he(Ba|0,Ga|0,B|0,Y|0)|0;Ba=he(Ba|0,D|0,Aa|0,((Aa|0)<0)<<31>>31|0)|0;Ba=_d(Ba|0,D|0,A|0,X|0)|0;Ba=Yd(Ba|0,D|0,E|0)|0;Ga=D;if((Ga|0)<0){Ia=(Ba&-32768|0)==-32768&(Ga&268435455|0)==268435455?Ba&65535:-32768;break}else{Ia=Ga>>>0>0|(Ga|0)==0&Ba>>>0>32767?32767:Ba&65535;break}}while(0);b[q+((xa<>1]=Ia;wa=wa+1|0;if((wa|0)>=(na|0)){xa=Aa;break a}Ba=a[u+wa>>0]|0}}while(0);if(la)ka=ka+ -1|0;else break}}do if(a[z>>0]|0){if((c[(c[n>>2]|0)+13104>>2]|0)!=0?(w&-17|0)==10:0)Ha[c[f+2632>>2]&7](q,j&65535,(w|0)==26&1)}else{if(F){s=c[n>>2]|0;if((c[s+13096>>2]|0)!=0&(j|0)==2?(c[p+31244>>2]|0)==1:0){t=0;do{Ka=q+(15-t<<1)|0;La=b[Ka>>1]|0;Na=q+(t<<1)|0;b[Ka>>1]=b[Na>>1]|0;b[Na>>1]=La;t=t+1|0}while((t|0)!=8)}t=j&65535;Ha[c[f+2628>>2]&7](q,t,c[s+52>>2]|0);if(!(c[(c[n>>2]|0)+13104>>2]|0))break;if((c[p+31244>>2]|0)!=1)break;if((w&-17|0)!=10)break;Ha[c[f+2632>>2]&7](q,t,(w|0)==26&1);break}if(y&(c[p+31244>>2]|0)==1&(j|0)==2){Ea[c[f+2636>>2]&7](q,c[(c[n>>2]|0)+52>>2]|0);break}s=(G|0)>(H|0)?G:H;if(!s){Ea[c[f+(j+ -2<<2)+2656>>2]&7](q,c[(c[n>>2]|0)+52>>2]|0);break}t=H+4+G|0;do if((s|0)>=4){if((s|0)<8){t=(t|0)<8?t:8;break}if((s|0)<12)t=(t|0)<24?t:24}else t=(t|0)<4?t:4;while(0);Ha[c[f+(j+ -2<<2)+2640>>2]&7](q,t,c[(c[n>>2]|0)+52>>2]|0)}while(0);if(!(a[p+304>>0]|0)){La=j+ -2|0;La=f+(La<<2)+2612|0;La=c[La>>2]|0;Na=c[n>>2]|0;Na=Na+52|0;Na=c[Na>>2]|0;Ma[La&7](g,q,m,Na);i=o;return}if((r|0)<=0){La=j+ -2|0;La=f+(La<<2)+2612|0;La=c[La>>2]|0;Na=c[n>>2]|0;Na=Na+52|0;Na=c[Na>>2]|0;Ma[La&7](g,q,m,Na);i=o;return}p=c[p+284>>2]|0;s=0;do{Na=q+(s<<1)|0;b[Na>>1]=(($(b[h+(s<<1)>>1]|0,p)|0)>>>3)+(e[Na>>1]|0);s=s+1|0}while((s|0)!=(r|0));La=j+ -2|0;La=f+(La<<2)+2612|0;La=c[La>>2]|0;Na=c[n>>2]|0;Na=Na+52|0;Na=c[Na>>2]|0;Ma[La&7](g,q,m,Na);i=o;return}function Ab(a){a=a|0;var b=0,e=0,f=0;b=i;f=a+16|0;e=c[f>>2]|0;c[a>>2]=(c[a>>2]|0)+ -65535+((d[e+1>>0]|0)<<1|(d[e>>0]|0)<<9);if(e>>>0>=(c[a+20>>2]|0)>>>0){i=b;return}c[f>>2]=e+2;i=b;return}function Bb(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;f=i;h=b+136|0;n=c[h>>2]|0;g=b+200|0;j=c[g>>2]|0;m=c[j+13080>>2]|0;q=(1<>2]|0)+24>>2]|0);o=m&d;p=m&e;k=c[j+13140>>2]|0;j=c[j+13064>>2]|0;l=o>>j;j=p>>j;if(!(q&d))o=0;else o=(o&q|0)!=0;if(!(q&e))p=0;else p=(p&q|0)!=0;q=n+203|0;if((a[q>>0]|0)==0?(m&(e|d)|0)!=0:0)d=c[n+276>>2]|0;else{a[q>>0]=(a[n+300>>0]|0)==0&1;d=a[b+2112>>0]|0}if(o){e=l+ -1+($(j,k)|0)|0;e=a[(c[b+4316>>2]|0)+e>>0]|0}else e=d;if(p){d=($(j+ -1|0,k)|0)+l|0;d=a[(c[b+4316>>2]|0)+d>>0]|0}b=e+1+d>>1;h=c[h>>2]|0;j=c[h+280>>2]|0;if(!j){a[h+272>>0]=b;i=f;return}g=c[(c[g>>2]|0)+13192>>2]|0;b=j+52+b+(g<<1)|0;if((b|0)>0)j=b;else j=-52-g+1+b|0;a[h+272>>0]=b-g-j+((j|0)%(g+52|0)|0);i=f;return}function Cb(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;g=i;j=c[b+136>>2]|0;k=b+200|0;do if((e|0)>0&(e&7|0)==0){if(((a[b+2062>>0]|0)==0?(c[j+31312>>2]&4|0)!=0:0)?((e|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0)break;if(((a[(c[b+204>>2]|0)+53>>0]|0)==0?(c[j+31312>>2]&8|0)!=0:0)?((e|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0)break;h=1<0){l=b+2596|0;m=b+4320|0;n=0;do{o=n+d+($(c[l>>2]|0,e)|0)>>2;a[(c[m>>2]|0)+o>>0]=2;n=n+4|0}while((n|0)<(h|0))}}while(0);if(!((d|0)>0&(d&7|0)==0)){i=g;return}if(((a[b+2062>>0]|0)==0?(c[j+31312>>2]&1|0)!=0:0)?((d|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0){i=g;return}if(((a[(c[b+204>>2]|0)+53>>0]|0)==0?(c[j+31312>>2]&2|0)!=0:0)?((d|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0){i=g;return}h=1<>2]|0,k+e|0)|0)+d>>2;a[(c[b>>2]|0)+o>>0]=2;k=k+4|0}while((k|0)<(h|0));i=g;return}function Db(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var 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,aa=0,ba=0,ca=0,da=0,ea=0;j=i;i=i+32|0;o=j+8|0;x=j;n=j+18|0;s=j+16|0;l=e+200|0;K=c[l>>2]|0;v=c[K+13120>>2]|0;k=(v-h|0)<=(f|0);b[n>>1]=0;b[s>>1]=0;w=c[K+13080>>2]|0;u=1<>w,c[K+13128>>2]|0)|0)+(f>>w)|0;t=c[e+2508>>2]|0;m=c[t+(w<<3)+4>>2]|0;y=c[t+(w<<3)>>2]|0;if((c[K+68>>2]|0)!=0?(a[K+13056>>0]|0)!=0:0)p=1;else p=(a[(c[e+204>>2]|0)+40>>0]|0)!=0;r=c[K+52>>2]|0;q=(f|0)!=0;if(q){w=w+ -1|0;z=c[t+(w<<3)>>2]|0;w=c[t+(w<<3)+4>>2]|0}else{z=0;w=0}t=u+f|0;t=(t|0)>(v|0)?v:t;u=u+g|0;A=c[K+13124>>2]|0;u=(u|0)>(A|0)?A:u;A=(t|0)==(v|0)?t:t+ -8|0;v=(u|0)>(g|0);if(v){K=q?f:8;N=(K|0)<(t|0);Q=q?f+ -8|0:0;F=e+2596|0;P=e+4320|0;I=e+4316|0;C=x+4|0;D=e+160|0;E=n+1|0;R=s+1|0;L=e+4300|0;M=e+4284|0;J=e+4324|0;G=e+4304|0;H=e+4288|0;B=(Q|0)>=(A|0);U=y;T=m;O=g;do{if(N){W=O+4|0;X=T+ -2&-2;V=K;do{_=c[F>>2]|0;da=($(_,O)|0)+V>>2;aa=c[J>>2]|0;da=a[aa+da>>0]|0;ca=da&255;_=a[aa+(($(_,W)|0)+V>>2)>>0]|0;aa=_&255;da=da<<24>>24!=0;_=_<<24>>24==0;do if(!(_&(da^1))){S=V+ -1|0;Y=c[l>>2]|0;ba=c[Y+13064>>2]|0;Z=$(O>>ba,c[Y+13140>>2]|0)|0;ea=c[I>>2]|0;ba=(a[ea+(Z+(S>>ba))>>0]|0)+1+(a[ea+(Z+(V>>ba))>>0]|0)>>1;Z=ba+U|0;if((Z|0)<0)Z=0;else Z=(Z|0)>51?51:Z;Z=d[1280+Z>>0]|0;if(da){ca=(ca<<1)+X+ba|0;if((ca|0)<0)ca=0;else ca=(ca|0)>53?53:ca;ca=d[1336+ca>>0]|0}else ca=0;c[x>>2]=ca;if(_)_=0;else{_=(aa<<1)+X+ba|0;if((_|0)<0)_=0;else _=(_|0)>53?53:_;_=d[1336+_>>0]|0}c[C>>2]=_;da=c[D>>2]|0;_=c[da+32>>2]|0;ea=$(_,O)|0;Y=(c[da>>2]|0)+((V<>2])+ea)|0;if(p){a[n>>0]=Ib(e,S,O)|0;a[E>>0]=Ib(e,S,W)|0;a[s>>0]=Ib(e,V,O)|0;a[R>>0]=Ib(e,V,W)|0;Ba[c[G>>2]&7](Y,_,Z,x,n,s,r);break}else{Ba[c[H>>2]&7](Y,_,Z,x,n,s,r);break}}while(0);V=V+8|0}while((V|0)<(t|0))}if(!((O|0)==0|B)){S=O+ -1|0;W=T;T=Q;do{Z=$(c[F>>2]|0,O)|0;_=c[P>>2]|0;ba=a[_+(Z+T>>2)>>0]|0;ca=ba&255;V=T+4|0;Z=a[_+(Z+V>>2)>>0]|0;_=Z&255;ba=ba<<24>>24!=0;Z=Z<<24>>24==0;do if(!(Z&(ba^1))){X=c[l>>2]|0;W=c[X+13064>>2]|0;aa=T>>W;U=c[X+13140>>2]|0;ea=($(S>>W,U)|0)+aa|0;Y=c[I>>2]|0;aa=(a[Y+ea>>0]|0)+1+(a[Y+(($(O>>W,U)|0)+aa)>>0]|0)>>1;U=(T|0)>=(f|0);W=U?m:w;U=U?y:z;Y=aa+U|0;if((Y|0)<0)Y=0;else Y=(Y|0)>51?51:Y;Y=d[1280+Y>>0]|0;if(ba){ba=(ca<<1)+(W+ -2&-2)+aa|0;if((ba|0)<0)ba=0;else ba=(ba|0)>53?53:ba;ba=d[1336+ba>>0]|0}else ba=0;c[x>>2]=ba;if(Z)Z=0;else{Z=(_<<1)+(W+ -2&-2)+aa|0;if((Z|0)<0)Z=0;else Z=(Z|0)>53?53:Z;Z=d[1336+Z>>0]|0}c[C>>2]=Z;da=c[D>>2]|0;Z=c[da+32>>2]|0;ea=$(Z,O)|0;X=(c[da>>2]|0)+((T<>2])+ea)|0;if(p){a[n>>0]=Ib(e,T,S)|0;a[E>>0]=Ib(e,V,S)|0;a[s>>0]=Ib(e,T,O)|0;a[R>>0]=Ib(e,V,O)|0;Ba[c[L>>2]&7](X,Z,Y,x,n,s,r);break}else{Ba[c[M>>2]&7](X,Z,Y,x,n,s,r);break}}while(0);T=T+8|0}while((T|0)<(A|0));T=W}O=O+8|0}while((O|0)<(u|0));K=c[l>>2]|0}else T=m;if(c[K+4>>2]|0){D=q?w:m;G=e+2596|0;F=e+4320|0;w=e+4316|0;y=o+4|0;x=e+160|0;C=n+1|0;B=s+1|0;E=e+4308|0;H=e+4292|0;I=e+4324|0;A=e+4312|0;z=e+4296|0;J=1;do{P=1<>2];Q=1<>2];if(v){O=P<<3;M=q?f:O;L=(M|0)<(t|0);K=Q<<3;N=q?f-O|0:0;P=P<<2;Q=Q<<2;R=g;do{if(L){S=R+Q|0;U=M;do{X=c[G>>2]|0;Z=($(X,R)|0)+U>>2;ea=c[I>>2]|0;Z=(a[ea+Z>>0]|0)==2;X=(a[ea+(($(X,S)|0)+U>>2)>>0]|0)==2;do if(Z|X){V=U+ -1|0;W=c[l>>2]|0;ea=c[W+13064>>2]|0;_=V>>ea;Y=c[W+13140>>2]|0;ba=$(R>>ea,Y)|0;aa=c[w>>2]|0;ca=U>>ea;Y=$(S>>ea,Y)|0;Y=(a[aa+(Y+_)>>0]|0)+1+(a[aa+(Y+ca)>>0]|0)>>1;if(Z)Z=Jb(e,(a[aa+(ba+ca)>>0]|0)+1+(a[aa+(ba+_)>>0]|0)>>1,J,T)|0;else Z=0;c[o>>2]=Z;if(X)X=Jb(e,Y,J,T)|0;else X=0;c[y>>2]=X;da=c[x>>2]|0;X=c[da+(J<<2)+32>>2]|0;ea=$(X,R>>c[W+(J<<2)+13180>>2])|0;W=(c[da+(J<<2)>>2]|0)+((U>>c[W+(J<<2)+13168>>2]<>2])+ea)|0;if(p){a[n>>0]=Ib(e,V,R)|0;a[C>>0]=Ib(e,V,S)|0;a[s>>0]=Ib(e,U,R)|0;a[B>>0]=Ib(e,U,S)|0;Ja[c[A>>2]&3](W,X,o,n,s,r);break}else{Ja[c[z>>2]&3](W,X,o,n,s,r);break}}while(0);U=U+O|0}while((U|0)<(t|0))}if(R){V=t-((t|0)==(c[(c[l>>2]|0)+13120>>2]|0)?0:O)|0;if((N|0)<(V|0)){U=R+ -1|0;T=N;do{X=$(c[G>>2]|0,R)|0;ea=c[F>>2]|0;S=T+P|0;Y=(a[ea+(X+T>>2)>>0]|0)==2;X=(a[ea+(X+S>>2)>>0]|0)==2;do if(Y|X){if(Y){ea=c[l>>2]|0;da=c[ea+13064>>2]|0;Z=T>>da;ea=c[ea+13140>>2]|0;ba=($(U>>da,ea)|0)+Z|0;ca=c[w>>2]|0;Z=(a[ca+ba>>0]|0)+1+(a[ca+(($(R>>da,ea)|0)+Z)>>0]|0)>>1}else Z=0;if(X){ea=c[l>>2]|0;da=c[ea+13064>>2]|0;W=S>>da;ea=c[ea+13140>>2]|0;ba=($(U>>da,ea)|0)+W|0;ca=c[w>>2]|0;W=(a[ca+ba>>0]|0)+1+(a[ca+(($(R>>da,ea)|0)+W)>>0]|0)>>1}else W=0;if(Y)Y=Jb(e,Z,J,D)|0;else Y=0;c[o>>2]=Y;if(X)W=Jb(e,W,J,m)|0;else W=0;c[y>>2]=W;ea=c[l>>2]|0;da=c[x>>2]|0;X=c[da+(J<<2)+32>>2]|0;W=$(X,R>>c[ea+13184>>2])|0;W=(c[da+(J<<2)>>2]|0)+((T>>c[ea+13172>>2]<>2])+W)|0;if(p){a[n>>0]=Ib(e,T,U)|0;a[C>>0]=Ib(e,S,U)|0;a[s>>0]=Ib(e,T,R)|0;a[B>>0]=Ib(e,S,R)|0;Ja[c[E>>2]&3](W,X,o,n,s,r);break}else{Ja[c[H>>2]&3](W,X,o,n,s,r);break}}while(0);T=T+O|0}while((T|0)<(V|0));T=D}else T=D}R=R+K|0}while((R|0)<(u|0))}J=J+1|0;K=c[l>>2]|0}while((J|0)!=3)}if(!(a[K+12941>>0]|0)){if((a[e+140>>0]&1)==0|k^1){i=j;return}i=j;return}n=(c[K+13124>>2]|0)-h|0;l=(g|0)==0;m=(f|0)==0;if(!(l|m))Eb(e,f-h|0,g-h|0);n=(n|0)>(g|0);if(!(m|n))Eb(e,f-h|0,g);k=k^1;!(l|k)?(Eb(e,f,g-h|0),(a[e+140>>0]&1)!=0):0;if(n|k){i=j;return}Eb(e,f,g);if(!(a[e+140>>0]&1)){i=j;return}i=j;return}function Eb(e,f,g){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,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;h=i;i=i+48|0;l=h+24|0;r=h+42|0;s=h+40|0;p=h+16|0;k=h+8|0;t=h;o=e+200|0;S=c[o>>2]|0;y=c[S+13080>>2]|0;j=f>>y;y=g>>y;G=S+13128|0;n=($(y,c[G>>2]|0)|0)+j|0;M=c[e+204>>2]|0;L=M+1668|0;N=c[(c[L>>2]|0)+(n<<2)>>2]|0;A=e+2504|0;m=c[A>>2]|0;q=m+(n*148|0)|0;b[r>>1]=0;b[s>>1]=0;c[p>>2]=0;F=($(c[G>>2]|0,y)|0)+j|0;F=a[(c[e+4352>>2]|0)+F>>0]|0;if((a[M+42>>0]|0)!=0?(a[M+53>>0]|0)==0:0){R=1;O=1}else{R=F<<24>>24==0&1;O=0}D=(j|0)==0;c[l>>2]=D&1;I=(y|0)==0;u=l+4|0;c[u>>2]=I&1;H=(j|0)==((c[G>>2]|0)+ -1|0);z=l+8|0;c[z>>2]=H&1;E=(y|0)==((c[S+13132>>2]|0)+ -1|0);x=l+12|0;c[x>>2]=E&1;if(R<<24>>24){if(D)J=0;else{if(O){J=c[M+1676>>2]|0;J=(c[J+(N<<2)>>2]|0)!=(c[J+(c[(c[L>>2]|0)+(n+ -1<<2)>>2]<<2)>>2]|0)&1}else J=0;if(F<<24>>24==0?(pa=$(c[G>>2]|0,y)|0,oa=c[e+4328>>2]|0,(c[oa+(pa+j<<2)>>2]|0)!=(c[oa+(j+ -1+pa<<2)>>2]|0)):0)K=1;else K=J;a[r>>0]=K}if(H)K=0;else{if(O){K=c[M+1676>>2]|0;K=(c[K+(N<<2)>>2]|0)!=(c[K+(c[(c[L>>2]|0)+(n+1<<2)>>2]<<2)>>2]|0)&1}else K=0;if(F<<24>>24==0?(pa=$(c[G>>2]|0,y)|0,oa=c[e+4328>>2]|0,(c[oa+(pa+j<<2)>>2]|0)!=(c[oa+(j+1+pa<<2)>>2]|0)):0)P=1;else P=K;a[r+1>>0]=P}if(I)P=0;else{if(O){P=c[M+1676>>2]|0;P=(c[P+(N<<2)>>2]|0)!=(c[P+(c[(c[L>>2]|0)+(n-(c[G>>2]|0)<<2)>>2]<<2)>>2]|0)&1}else P=0;if(F<<24>>24==0?(pa=c[G>>2]|0,na=($(pa,y)|0)+j|0,oa=c[e+4328>>2]|0,(c[oa+(na<<2)>>2]|0)!=(c[oa+(($(pa,y+ -1|0)|0)+j<<2)>>2]|0)):0)Q=1;else Q=P;a[s>>0]=Q}if(E)L=0;else{if(O){pa=c[M+1676>>2]|0;L=(c[pa+(N<<2)>>2]|0)!=(c[pa+(c[(c[L>>2]|0)+((c[G>>2]|0)+n<<2)>>2]<<2)>>2]|0)&1}else L=0;if(F<<24>>24==0?(pa=c[G>>2]|0,na=($(pa,y)|0)+j|0,oa=c[e+4328>>2]|0,(c[oa+(na<<2)>>2]|0)!=(c[oa+(($(pa,y+1|0)|0)+j<<2)>>2]|0)):0)M=1;else M=L;a[s+1>>0]=M}if(!D)if(I)B=47;else{if(!(F<<24>>24)){pa=c[G>>2]|0;na=($(pa,y)|0)+j|0;oa=c[e+4328>>2]|0;if(J<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(j+ -1+($(pa,y+ -1|0)|0)<<2)>>2]|0):0)B=38;else M=1}else if(!(J<<24>>24))B=38;else M=1;if((B|0)==38)M=P<<24>>24!=0&1;a[p>>0]=M;B=40}else B=40;if((B|0)==40)if(!I){if(!H){if(!(F<<24>>24)){pa=c[G>>2]|0;na=($(pa,y)|0)+j|0;oa=c[e+4328>>2]|0;if(K<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(j+1+($(pa,y+ -1|0)|0)<<2)>>2]|0):0)B=45;else I=1}else if(!(K<<24>>24))B=45;else I=1;if((B|0)==45)I=P<<24>>24!=0&1;a[p+1>>0]=I;B=47}}else B=47;if((B|0)==47?!(H|E):0){if(!(F<<24>>24)){pa=c[G>>2]|0;na=($(pa,y)|0)+j|0;oa=c[e+4328>>2]|0;if(K<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(j+1+($(pa,y+1|0)|0)<<2)>>2]|0):0)B=51;else H=1}else if(!(K<<24>>24))B=51;else H=1;if((B|0)==51)H=L<<24>>24!=0&1;a[p+2>>0]=H}if(!(D|E)){if(!(F<<24>>24)){pa=c[G>>2]|0;na=($(pa,y)|0)+j|0;oa=c[e+4328>>2]|0;if(J<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(j+ -1+($(pa,y+1|0)|0)<<2)>>2]|0):0)B=57;else D=1}else if(!(J<<24>>24))B=57;else D=1;if((B|0)==57)D=L<<24>>24!=0&1;a[p+3>>0]=D}}N=(c[S+4>>2]|0)!=0?3:1;E=e+160|0;D=e+168|0;F=e+2672|0;P=y<<1;H=P+ -1|0;G=k+4|0;O=y+ -1|0;J=j+1|0;L=j+ -1|0;P=P+2|0;Q=t+4|0;M=y+1|0;I=j<<1;K=I+ -1|0;I=I+2|0;R=e+((R&255)<<2)+2676|0;na=S;_=0;while(1){ka=c[na+(_<<2)+13168>>2]|0;V=f>>ka;ha=c[na+(_<<2)+13180>>2]|0;aa=g>>ha;ba=c[E>>2]|0;W=c[ba+(_<<2)+32>>2]|0;S=1<>2];Z=S>>ka;Y=S>>ha;ka=c[na+13120>>2]>>ka;ca=ka-V|0;Z=(Z|0)>(ca|0)?ca:Z;ha=c[na+13124>>2]>>ha;ca=ha-aa|0;Y=(Y|0)>(ca|0)?ca:Y;ca=$(W,aa)|0;fa=c[na+56>>2]|0;ca=(V<>2]|0;X=ba+ca|0;S=S+2<>2]|0;ga=1<>0]|0;if((ia|0)==2){ja=c[l>>2]|0;ia=c[z>>2]|0;la=c[x>>2]|0;do if(!(c[u>>2]|0)){pa=1-ja|0;oa=pa<>2]=ba+(ca-W-oa);c[G>>2]=(c[e+(_<<2)+172>>2]|0)+(($(ka,H)|0)+V-pa<>2]|0,O)|0)|0;pa=c[k+(((a[(c[A>>2]|0)+(pa*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0;if(!fa){a[oa>>0]=a[pa>>0]|0;na=c[o>>2]|0;oa=ga;break}else{b[oa>>1]=b[pa>>1]|0;oa=ga;break}}else oa=0;while(0);pa=($(c[na+13128>>2]|0,O)|0)+j|0;na=Z<>2]|0)+(pa*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0)+oa|0,na|0)|0;if((ia|0)!=1){pa=oa+na|0;oa=J+($(c[(c[o>>2]|0)+13128>>2]|0,O)|0)|0;na=ea+(pa+ma)|0;ma=(c[k+(((a[(c[A>>2]|0)+(oa*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0)+pa|0;if(!fa){a[na>>0]=a[ma>>0]|0;break}else{b[na>>1]=b[ma>>1]|0;break}}}while(0);do if(!la){pa=1-ja|0;oa=pa<>2]=ba+(($(Y,W)|0)+ca-oa);c[Q>>2]=(c[e+(_<<2)+172>>2]|0)+(($(ka,P)|0)+V-pa<>2]|0)+13128>>2]|0,M)|0)|0;ma=c[t+(((a[(c[A>>2]|0)+(ma*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0;if(!fa){a[ka>>0]=a[ma>>0]|0;ma=ga;break}else{b[ka>>1]=b[ma>>1]|0;ma=ga;break}}else ma=0;while(0);pa=($(c[(c[o>>2]|0)+13128>>2]|0,M)|0)+j|0;ka=Z<>2]|0)+(pa*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0)+ma|0,ka|0)|0;if((ia|0)!=1){pa=ma+ka|0;oa=J+($(c[(c[o>>2]|0)+13128>>2]|0,M)|0)|0;ka=ea+(pa+la)|0;la=(c[t+(((a[(c[A>>2]|0)+(oa*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0)+pa|0;if(!fa){a[ka>>0]=a[la>>0]|0;break}else{b[ka>>1]=b[la>>1]|0;break}}}while(0);do if(!ja){pa=L+($(c[(c[o>>2]|0)+13128>>2]|0,y)|0)|0;if((a[(c[A>>2]|0)+(pa*148|0)+_+142>>0]|0)==3){la=ea+S|0;ja=(c[e+(_<<2)+184>>2]|0)+(($(ha,K)|0)+aa<0;if(!fa){if(ka)ka=0;else{ja=0;break}while(1){a[la>>0]=a[ja>>0]|0;ka=ka+1|0;if((ka|0)==(Y|0)){ja=0;break}else{la=la+S|0;ja=ja+ga|0}}}else{if(ka)ka=0;else{ja=0;break}while(1){b[la>>1]=b[ja>>1]|0;ka=ka+1|0;if((ka|0)==(Y|0)){ja=0;break}else{la=la+S|0;ja=ja+ga|0}}}}else ja=1}else ja=0;while(0);do if(!ia){pa=J+($(c[(c[o>>2]|0)+13128>>2]|0,y)|0)|0;if((a[(c[A>>2]|0)+(pa*148|0)+_+142>>0]|0)==3){ia=ea+((Z<>2]|0)+(($(ha,I)|0)+aa<0;if(!fa){if(ka)B=0;else break;while(1){a[ia>>0]=a[ha>>0]|0;B=B+1|0;if((B|0)==(Y|0)){C=0;B=96;break}else{ia=ia+S|0;ha=ha+ga|0}}}else{if(ka)B=0;else break;while(1){b[ia>>1]=b[ha>>1]|0;B=B+1|0;if((B|0)==(Y|0)){C=0;B=96;break}else{ia=ia+S|0;ha=ha+ga|0}}}}else{C=1;B=96}}else{C=0;B=96}while(0);if((B|0)==96?(B=0,v=ja<0):0){da=ea+(da-v)|0;ea=0;ba=ba+(ca-v)|0;while(1){ce(da|0,ba|0,w|0)|0;ea=ea+1|0;if((ea|0)==(Y|0))break;else{da=da+S|0;ba=ba+W|0}}}Gb(e,X,W,V,aa,Z,Y,_,j,y);Ca[c[R>>2]&3](X,U,W,S,q,l,Z,Y,_,r,s,p,c[(c[o>>2]|0)+52>>2]|0);Hb(e,X,U,W,S,f,g,Z,Y,_);a[T>>0]=3}else if((ia|0)==1){ca=Z<0){ba=U;da=0;ea=X;while(1){ce(ba|0,ea|0,ca|0)|0;da=da+1|0;if((da|0)==(Y|0))break;else{ba=ba+S|0;ea=ea+W|0}}}Gb(e,X,W,V,aa,Z,Y,_,j,y);Aa[c[F>>2]&1](X,U,W,S,q,l,Z,Y,_,c[(c[o>>2]|0)+52>>2]|0);Hb(e,X,U,W,S,f,g,Z,Y,_);a[T>>0]=3}_=_+1|0;if((_|0)>=(N|0))break;na=c[o>>2]|0}i=h;return}function Fb(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;h=c[a+200>>2]|0;k=((c[h+13120>>2]|0)-e|0)>(b|0);h=((c[h+13124>>2]|0)-e|0)>(d|0);j=(d|0)==0;g=(b|0)==0;if(!(j|g))Db(a,b-e|0,d-e|0,e);if(!(j|k))Db(a,b,d-e|0,e);if(g|h){i=f;return}Db(a,b-e|0,d,e);i=f;return}function Gb(d,e,f,g,h,j,k,l,m,n){d=d|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;n=n|0;var o=0,p=0,q=0,r=0,s=0,t=0,u=0;o=i;q=c[d+200>>2]|0;p=c[q+56>>2]|0;s=c[q+13120>>2]>>c[q+(l<<2)+13168>>2];q=c[q+13124>>2]>>c[q+(l<<2)+13180>>2];u=d+(l<<2)+172|0;t=n<<1;r=j<>2]|0)+(($(s,t)|0)+g<>2]|0)+(($(s,t|1)|0)+g<>2]|0;l=m<<1;t=r+(($(q,l)|0)+h<0;if(n){if(g){r=t;t=0;s=e;while(1){a[r>>0]=a[s>>0]|0;t=t+1|0;if((t|0)==(k|0))break;else{r=r+m|0;s=s+f|0}}r=c[d>>2]|0}}else if(g){d=0;s=e;while(1){b[t>>1]=b[s>>1]|0;d=d+1|0;if((d|0)==(k|0))break;else{t=t+m|0;s=s+f|0}}}h=r+(($(q,l|1)|0)+h<>0]=a[j>>0]|0;p=p+1|0;if((p|0)==(k|0))break;else{h=h+m|0;j=j+f|0}}i=o;return}else{if(g)p=0;else{i=o;return}while(1){b[h>>1]=b[j>>1]|0;p=p+1|0;if((p|0)==(k|0))break;else{h=h+m|0;j=j+f|0}}i=o;return}}function Hb(b,d,e,f,g,h,j,k,l,m){b=b|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;m=m|0;var 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;n=i;t=c[b+200>>2]|0;if(!(a[(c[b+204>>2]|0)+40>>0]|0)){if(!(a[t+13056>>0]|0)){i=n;return}if(!(c[t+68>>2]|0)){i=n;return}}p=b+200|0;C=c[t+13084>>2]|0;v=1<>2]|0;s=c[t+(m<<2)+13180>>2]|0;m=h>>C;z=j>>C;k=k+h>>C;l=l+j>>C;t=v>>o<>2];if((z|0)>=(l|0)){i=n;return}u=(m|0)<(k|0);b=b+4348|0;v=v>>s;w=(v|0)>0;do{if(u){x=z-j|0;y=m;do{A=c[p>>2]|0;C=($(c[A+13156>>2]|0,z)|0)+y|0;if((a[(c[b>>2]|0)+C>>0]|0)!=0?(r=c[A+13084>>2]|0,q=x<>s,r=y-h<>o<>2],w):0){C=e+(($(q,g)|0)+r)|0;A=0;B=d+(($(q,f)|0)+r)|0;while(1){ce(B|0,C|0,t|0)|0;A=A+1|0;if((A|0)==(v|0))break;else{C=C+g|0;B=B+f|0}}}y=y+1|0}while((y|0)!=(k|0))}z=z+1|0}while((z|0)!=(l|0));i=n;return}function Ib(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;f=i;g=c[a+200>>2]|0;h=c[g+13084>>2]|0;if((e|b|0)<0){e=2;i=f;return e|0}b=b>>h;e=e>>h;h=c[g+13156>>2]|0;if((b|0)>=(h|0)){e=2;i=f;return e|0}if((e|0)>=(c[g+13160>>2]|0)){e=2;i=f;return e|0}e=($(h,e)|0)+b|0;e=d[(c[a+4348>>2]|0)+e>>0]|0;i=f;return e|0}function Jb(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0;h=i;j=c[b+204>>2]|0;e=(c[((f|0)==1?j+28|0:j+32|0)>>2]|0)+e|0;if((e|0)<0)e=0;else e=(e|0)>57?57:e;do if((c[(c[b+200>>2]|0)+4>>2]|0)==1){if((e|0)>=30)if((e|0)>43){e=e+ -6|0;break}else{e=d[1392+(e+ -30)>>0]|0;break}}else if((e|0)<0)e=0;else e=(e|0)>51?51:e;while(0);g=g+2+e|0;if((g|0)<0){j=0;j=1336+j|0;j=a[j>>0]|0;j=j&255;i=h;return j|0}j=(g|0)>53?53:g;j=1336+j|0;j=a[j>>0]|0;j=j&255;i=h;return j|0}function Kb(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;g=i;k=b+4376|0;c[k>>2]=0;a:do if((e|0)>1){m=0;while(1){if(!(a[d+m>>0]|0)){if((m|0)>0){l=m+ -1|0;l=(a[d+l>>0]|0)==0?l:m}else l=m;m=l+2|0;if(((m|0)<(e|0)?(a[d+(l+1)>>0]|0)==0:0)?(j=a[d+m>>0]|0,(j&255)<4):0)break}else l=m;m=l+2|0;if((l+3|0)>=(e|0))break a}m=l;e=j<<24>>24==3?e:l}else m=0;while(0);if((m|0)>=(e+ -1|0)){c[f+12>>2]=d;c[f+8>>2]=e;q=e;i=g;return q|0}od(f,f+4|0,e+32|0);j=c[f>>2]|0;if(!j){q=-12;i=g;return q|0}ce(j|0,d|0,m|0)|0;o=m+2|0;b:do if((o|0)<(e|0)){l=b+4384|0;b=b+4380|0;n=m;c:while(1){p=d+o|0;q=a[p>>0]|0;do if((q&255)<=3){p=a[d+m>>0]|0;if(!(p<<24>>24))if(!(a[d+(m+1)>>0]|0)){if(q<<24>>24!=3){e=m;break b}o=n+1|0;a[j+n>>0]=0;n=n+2|0;a[j+o>>0]=0;m=m+3|0;q=(c[k>>2]|0)+1|0;c[k>>2]=q;p=c[l>>2]|0;if((p|0)<(q|0)){p=p<<1;c[l>>2]=p;md(b,p,4)|0;p=c[b>>2]|0;if(!p){f=-12;break c}}else{p=c[b>>2]|0;if(!p)break}c[p+((c[k>>2]|0)+ -1<<2)>>2]=o}else{p=0;h=26}else h=26}else{a[j+n>>0]=a[d+m>>0]|0;a[j+(n+1)>>0]=a[d+(m+1)>>0]|0;p=a[p>>0]|0;n=n+2|0;m=o;h=26}while(0);if((h|0)==26){h=0;a[j+n>>0]=p;n=n+1|0;m=m+1|0}o=m+2|0;if((o|0)>=(e|0)){h=15;break b}}i=g;return f|0}else{n=m;h=15}while(0);if((h|0)==15)if((m|0)<(e|0)){h=e+n|0;k=m;while(1){a[j+n>>0]=a[d+k>>0]|0;k=k+1|0;if((k|0)==(e|0))break;else n=n+1|0}n=h-m|0}else e=m;h=j+n+0|0;d=h+32|0;do{a[h>>0]=0;h=h+1|0}while((h|0)<(d|0));c[f+12>>2]=j;c[f+8>>2]=n;q=e;i=g;return q|0}function Lb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;f=b+60|0;d=c[f>>2]|0;$c();cc();f=c[f>>2]|0;c[f+4>>2]=b;g=nd(31328)|0;c[f+136>>2]=g;if((((g|0)!=0?(c[f+72>>2]=g,c[f+8>>2]=f,g=hd(199)|0,c[f+152>>2]=g,(g|0)!=0):0)?(g=xd()|0,c[f+164>>2]=g,(g|0)!=0):0)?(h=xd()|0,c[f+2524>>2]=h,(h|0)!=0):0){c[f+2528>>2]=h;c[f+2592>>2]=2147483647;a[f+4469>>0]=1;c[f+2584>>2]=0;c[d+4368>>2]=0;c[d+4520>>2]=0;f=b+808|0;if(!(c[f>>2]&2))a[d+141>>0]=1;else a[d+141>>0]=c[b+800>>2];if((c[f>>2]&1|0)!=0?(c[b+800>>2]|0)>1:0){a[d+140>>0]=1;h=0;i=e;return h|0}a[d+140>>0]=2;h=0;i=e;return h|0}Nb(b)|0;h=-12;i=e;return h|0}function Mb(f,g,h,j){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,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,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,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0;k=i;i=i+16|0;m=k+8|0;n=k;l=c[f+60>>2]|0;f=j+28|0;J=c[f>>2]|0;if(!J){g=bc(l,g,1)|0;if((g|0)<0){Za=g;i=k;return Za|0}c[h>>2]=g;Za=0;i=k;return Za|0}q=l+2520|0;c[q>>2]=0;I=c[j+24>>2]|0;c[q>>2]=0;F=l+2584|0;z=l+2588|0;c[z>>2]=c[F>>2];c[F>>2]=0;v=l+4408|0;c[v>>2]=0;a:do if((J|0)>3){G=l+4470|0;E=l+4412|0;y=l+4404|0;u=l+4388|0;B=l+4396|0;w=l+4392|0;C=l+4384|0;x=l+4380|0;j=l+4376|0;t=l+136|0;s=l+2512|0;H=l+4480|0;while(1){A=(a[G>>0]|0)==0;if(A){while(1){K=I+1|0;if(((a[I>>0]|0)==0?(a[K>>0]|0)==0:0)?(a[I+2>>0]|0)==1:0)break;if((J|0)<5){p=-1094995529;o=180;break a}I=K;J=J+ -1|0}I=I+3|0;L=0;J=J+ -3|0}else{K=c[H>>2]|0;if((K|0)>0){M=0;L=0;do{M=d[I+L>>0]|M<<8;L=L+1|0}while((L|0)!=(K|0));L=M}else L=0;J=J-K|0;if((L|0)>(J|0)){p=-1094995529;o=180;break a}I=I+K|0}A=A?J:L;K=c[E>>2]|0;M=c[v>>2]|0;if((K|0)<(M+1|0)){K=K+1|0;L=ld(c[y>>2]|0,K,16)|0;if(!L){p=-12;o=180;break a}c[y>>2]=L;M=c[E>>2]|0;ae(L+(M<<4)|0,0,K-M<<4|0)|0;md(u,K,4)|0;md(B,K,4)|0;md(w,K,4)|0;M=c[B>>2]|0;c[M+(c[E>>2]<<2)>>2]=1024;M=pd(c[M+(c[E>>2]<<2)>>2]|0,4)|0;c[(c[w>>2]|0)+(c[E>>2]<<2)>>2]=M;c[E>>2]=K;M=c[v>>2]|0}c[C>>2]=c[(c[B>>2]|0)+(M<<2)>>2];c[x>>2]=c[(c[w>>2]|0)+(M<<2)>>2];L=c[y>>2]|0;K=Kb(l,I,A,L+(M<<4)|0)|0;c[(c[u>>2]|0)+(c[v>>2]<<2)>>2]=c[j>>2];c[(c[B>>2]|0)+(c[v>>2]<<2)>>2]=c[C>>2];Ya=c[x>>2]|0;Za=c[v>>2]|0;c[v>>2]=Za+1;c[(c[w>>2]|0)+(Za<<2)>>2]=Ya;if((K|0)<0){p=K;o=180;break a}Ya=c[t>>2]|0;Wa=c[L+(M<<4)+12>>2]|0;Xa=c[L+(M<<4)+8>>2]|0;Xa=Xa>>>0>268435455?-8:Xa<<3;Za=Xa>>>0>2147483639|(Wa|0)==0;Xa=Za?0:Xa;Wa=Za?0:Wa;A=Za?-1094995529:0;c[Ya+204>>2]=Wa;c[Ya+216>>2]=Xa;c[Ya+220>>2]=Xa+8;c[Ya+208>>2]=Wa+(Xa>>3);c[Ya+212>>2]=0;if(Za){p=A;o=180;break a}Qb(l)|0;if(((c[s>>2]|0)+ -36|0)>>>0<2)c[F>>2]=1;J=J-K|0;if((J|0)<=3)break;else I=I+K|0}if((c[v>>2]|0)>0){ka=l+4|0;Ea=l+1448|0;B=l+2046|0;Z=l+1428|0;Da=l+204|0;va=l+200|0;Ja=l+1449|0;Ka=l+1432|0;Oa=l+1436|0;Pa=l+2580|0;Ha=l+156|0;qa=l+1440|0;H=l+1450|0;K=l+1620|0;ua=l+2572|0;J=l+2516|0;L=l+2576|0;V=l+2056|0;W=l+2057|0;M=l+2058|0;O=l+2052|0;N=l+2048|0;Ma=l+2068|0;R=l+2072|0;P=l+2076|0;S=l+2080|0;X=l+2061|0;U=l+2084|0;T=l+2088|0;Y=l+2062|0;I=l+1451|0;Na=l+2108|0;Ia=l+2112|0;La=l+2500|0;ma=l+2592|0;na=l+2604|0;oa=l+4416|0;Ga=m+4|0;wa=l+4320|0;ya=l+2596|0;xa=l+2600|0;za=l+4324|0;Aa=l+4344|0;Ba=l+4348|0;Ca=l+4328|0;ra=l+160|0;pa=l+140|0;ta=l+164|0;_=l+2096|0;Q=l+2100|0;E=l+2104|0;F=l+141|0;G=l+4368|0;ba=l+2504|0;aa=l+2508|0;da=l+4332|0;ca=l+4336|0;ea=l+4340|0;ga=l+4352|0;fa=l+4316|0;ha=l+2608|0;ja=l+196|0;la=l+4364|0;ia=l+168|0;C=0;b:while(1){c[j>>2]=c[(c[u>>2]|0)+(C<<2)>>2];c[x>>2]=c[(c[w>>2]|0)+(C<<2)>>2];Ya=c[y>>2]|0;Xa=c[Ya+(C<<4)+12>>2]|0;Ya=c[Ya+(C<<4)+8>>2]|0;Za=c[t>>2]|0;Ya=Ya>>>0>268435455?-8:Ya<<3;Qa=Ya>>>0>2147483639|(Xa|0)==0;Ya=Qa?0:Ya;Xa=Qa?0:Xa;c[Za+204>>2]=Xa;c[Za+216>>2]=Ya;c[Za+220>>2]=Ya+8;c[Za+208>>2]=Xa+(Ya>>3);c[Za+212>>2]=0;c:do if(Qa){r=Qa?-1094995529:0;o=178}else{Qa=Qb(l)|0;d:do if((Qa|0)>=0){if(!Qa)break c;switch(c[s>>2]|0){case 37:case 36:{b[la>>1]=(e[la>>1]|0)+1&255;c[ma>>2]=2147483647;break c};case 48:{Qa=Fc(l)|0;if((Qa|0)<0)break d;else break c};case 40:case 39:{Qa=Ic(l)|0;if((Qa|0)<0)break d;else break c};case 9:case 8:case 7:case 6:case 21:case 20:case 19:case 18:case 17:case 16:case 5:case 4:case 3:case 2:case 0:case 1:{Qa=c[t>>2]|0;Ra=Qa+204|0;Za=(dd(Ra)|0)&255;a[Ea>>0]=Za;Sa=c[s>>2]|0;if(!((Sa+ -16|0)>>>0>4|Za<<24>>24==0)?(b[la>>1]=(e[la>>1]|0)+1&255,c[ma>>2]=2147483647,(Sa+ -19|0)>>>0<2):0){_b(l);Sa=c[s>>2]|0}a[B>>0]=0;if((Sa+ -16|0)>>>0<8)a[B>>0]=dd(Ra)|0;Sa=fd(Ra)|0;c[Z>>2]=Sa;if(Sa>>>0>255){p=A;o=180;break a}Sa=c[l+(Sa<<2)+400>>2]|0;if(!Sa){p=A;o=180;break a}if(!(a[Ea>>0]|0)){Va=c[Sa+4>>2]|0;if((c[Da>>2]|0)!=(Va|0)){p=A;o=180;break a}}else Va=c[Sa+4>>2]|0;c[Da>>2]=Va;Ta=c[s>>2]|0;Ua=(Ta|0)==21;if(Ua?(c[z>>2]|0)==1:0)a[B>>0]=1;Sa=c[va>>2]|0;Va=c[(c[l+(c[Va>>2]<<2)+272>>2]|0)+4>>2]|0;if((Sa|0)!=(Va|0)){c[va>>2]=Va;e:do if(Sa){if((Ta+ -16|0)>>>0>7|Ua)break;do if((c[Va+13120>>2]|0)==(c[Sa+13120>>2]|0)){if((c[Va+13124>>2]|0)!=(c[Sa+13124>>2]|0))break;if((c[Va+76+(((c[Va+72>>2]|0)+ -1|0)*12|0)>>2]|0)==(c[Sa+(((c[Sa+72>>2]|0)+ -1|0)*12|0)+76>>2]|0))break e}while(0);a[B>>0]=0}while(0);_b(l);Sa=c[va>>2]|0;Pb(l);Ua=c[Sa+13064>>2]|0;Va=Sa+13120|0;$a=c[Va>>2]|0;Wa=Sa+13124|0;_a=c[Wa>>2]|0;Ua=$((_a>>Ua)+1|0,($a>>Ua)+1|0)|0;Ta=$(c[Sa+13132>>2]|0,c[Sa+13128>>2]|0)|0;Za=Sa+13156|0;Ya=Sa+13160|0;Xa=$(c[Ya>>2]|0,c[Za>>2]|0)|0;c[ya>>2]=($a>>2)+1;c[xa>>2]=(_a>>2)+1;c[ba>>2]=qd(Ta,148)|0;_a=qd(Ta,8)|0;c[aa>>2]=_a;if((c[ba>>2]|0)==0|(_a|0)==0){o=71;break b}_a=Sa+13144|0;$a=Sa+13140|0;c[da>>2]=hd($(c[$a>>2]|0,c[_a>>2]|0)|0)|0;$a=pd(c[_a>>2]|0,c[$a>>2]|0)|0;c[ca>>2]=$a;if((c[da>>2]|0)==0|($a|0)==0){o=71;break b}c[Aa>>2]=pd(c[Sa+13148>>2]|0,c[Sa+13152>>2]|0)|0;c[ea>>2]=nd(Xa)|0;Xa=hd($((c[Ya>>2]|0)+1|0,(c[Za>>2]|0)+1|0)|0)|0;c[Ba>>2]=Xa;if(!(c[ea>>2]|0)){o=71;break b}if((c[Aa>>2]|0)==0|(Xa|0)==0){o=71;break b}c[ga>>2]=hd(Ta)|0;c[Ca>>2]=pd(Ua,4)|0;$a=pd(Ua,1)|0;c[fa>>2]=$a;if(!$a){o=71;break b}if(!(c[ga>>2]|0)){o=71;break b}if(!(c[Ca>>2]|0)){o=71;break b}c[wa>>2]=qd(c[ya>>2]|0,c[xa>>2]|0)|0;$a=qd(c[ya>>2]|0,c[xa>>2]|0)|0;c[za>>2]=$a;if((c[wa>>2]|0)==0|($a|0)==0){o=71;break b}$a=c[ka>>2]|0;c[$a+124>>2]=c[Va>>2];c[$a+128>>2]=c[Wa>>2];c[$a+116>>2]=c[Sa+12>>2];c[$a+120>>2]=c[Sa+16>>2];c[$a+136>>2]=c[Sa+60>>2];c[$a+172>>2]=c[Sa+(((c[Sa+72>>2]|0)+ -1|0)*12|0)+80>>2];$a=Sa+160|0;c[m+0>>2]=c[$a+0>>2];c[m+4>>2]=c[$a+4>>2];if(!(c[Sa+176>>2]|0)){Ta=c[ka>>2]|0;c[Ta+392>>2]=1}else{Ta=c[ka>>2]|0;c[Ta+392>>2]=(c[Sa+184>>2]|0)!=0?2:1}if(!(c[Sa+188>>2]|0)){c[Ta+380>>2]=2;c[Ta+384>>2]=2;c[Ta+388>>2]=2}else{c[Ta+380>>2]=d[Sa+192>>0];c[Ta+384>>2]=d[Sa+193>>0];c[Ta+388>>2]=d[Sa+194>>0]}dc(ha,c[Sa+52>>2]|0);if(a[Sa+12941>>0]|0){Ta=c[va>>2]|0;Ua=(c[Ta+4>>2]|0)!=0?3:1;$a=(1<>2])+2|0;$a=$($a,$a)|0;c[ia>>2]=hd($a<>2])|0;Ta=0;do{$a=c[va>>2]|0;_a=c[$a+13124>>2]>>c[$a+(Ta<<2)+13180>>2];Za=$(c[$a+13120>>2]>>c[$a+(Ta<<2)+13168>>2]<<1,c[$a+13132>>2]|0)|0;c[l+(Ta<<2)+172>>2]=hd(Za<>2])|0;$a=c[va>>2]|0;_a=$(_a<<1,c[$a+13128>>2]|0)|0;c[l+(Ta<<2)+184>>2]=hd(_a<>2])|0;Ta=Ta+1|0}while((Ta|0)<(Ua|0))}c[va>>2]=Sa;c[ja>>2]=c[(c[l+(c[Sa>>2]<<2)+208>>2]|0)+4>>2];b[la>>1]=(e[la>>1]|0)+1&255;c[ma>>2]=2147483647}$a=c[ka>>2]|0;c[$a+832>>2]=d[Sa+302>>0];c[$a+836>>2]=d[Sa+335>>0];a[Ja>>0]=0;do if(!(a[Ea>>0]|0)){if(a[(c[Da>>2]|0)+41>>0]|0){a[Ja>>0]=dd(Ra)|0;Sa=c[va>>2]|0}Sa=($(c[Sa+13128>>2]<<1,c[Sa+13132>>2]|0)|0)+ -2|0;Ta=Sa>>>0>65535;Sa=Ta?Sa>>>16:Sa;Ta=Ta?16:0;if(Sa&65280){Ta=Ta|8;Sa=Sa>>>8}Sa=ad(Ra,(d[4680+Sa>>0]|0)+Ta|0)|0;c[Ka>>2]=Sa;$a=c[va>>2]|0;if(Sa>>>0>=($(c[$a+13132>>2]|0,c[$a+13128>>2]|0)|0)>>>0){p=A;o=180;break a}if(a[Ja>>0]|0)if(!(a[Ha>>0]|0)){p=A;o=180;break a}else break;else{c[Oa>>2]=Sa;c[Pa>>2]=(c[Pa>>2]|0)+1;o=82;break}}else{c[Oa>>2]=0;c[Ka>>2]=0;c[Pa>>2]=0;a[Ha>>0]=0;o=82}while(0);f:do if((o|0)==82){o=0;a[Ha>>0]=0;if((c[(c[Da>>2]|0)+1624>>2]|0)>0){Sa=0;do{cd(Ra,1);Sa=Sa+1|0}while((Sa|0)<(c[(c[Da>>2]|0)+1624>>2]|0))}Sa=fd(Ra)|0;c[qa>>2]=Sa;if(Sa>>>0>=3){p=A;o=180;break a}if(!((Sa|0)==2?1:((c[s>>2]|0)+ -16|0)>>>0>7)){p=A;o=180;break a}a[H>>0]=1;if(a[(c[Da>>2]|0)+39>>0]|0)a[H>>0]=dd(Ra)|0;if(a[(c[va>>2]|0)+8>>0]|0)a[I>>0]=ad(Ra,2)|0;if(((c[s>>2]|0)+ -19|0)>>>0>=2){o=91;break b}c[K>>2]=0;c[ua>>2]=0;if(!(c[J>>2]|0))c[L>>2]=0;do if(a[(c[va>>2]|0)+12941>>0]|0){a[V>>0]=dd(Ra)|0;if(!(c[(c[va>>2]|0)+4>>2]|0)){a[W>>0]=0;a[M>>0]=0;break}else{$a=(dd(Ra)|0)&255;a[M>>0]=$a;a[W>>0]=$a;break}}else{a[V>>0]=0;a[W>>0]=0;a[M>>0]=0}while(0);c[O>>2]=0;c[N>>2]=0;c[Ma>>2]=gd(Ra)|0;Sa=c[Da>>2]|0;if(!(a[Sa+36>>0]|0)){c[R>>2]=0;c[P>>2]=0}else{c[R>>2]=gd(Ra)|0;c[P>>2]=gd(Ra)|0;Sa=c[Da>>2]|0}if(!(a[Sa+1631>>0]|0))a[S>>0]=0;else{a[S>>0]=dd(Ra)|0;Sa=c[Da>>2]|0}g:do if(!(a[Sa+55>>0]|0)){a[X>>0]=0;c[U>>2]=0;c[T>>2]=0}else{do if(a[Sa+56>>0]|0){if(!(dd(Ra)|0)){Sa=c[Da>>2]|0;break}$a=(dd(Ra)|0)&255;a[X>>0]=$a;if($a<<24>>24)break g;c[U>>2]=(gd(Ra)|0)<<1;c[T>>2]=(gd(Ra)|0)<<1;break g}while(0);a[X>>0]=a[Sa+57>>0]|0;c[U>>2]=c[Sa+60>>2];c[T>>2]=c[Sa+64>>2]}while(0);Sa=a[(c[Da>>2]|0)+54>>0]|0;h:do if(Sa<<24>>24){do if(!(a[V>>0]|0)){if(a[W>>0]|0)break;if(a[X>>0]|0)break h}while(0);a[Y>>0]=dd(Ra)|0;break f}while(0);a[Y>>0]=Sa}while(0);c[Na>>2]=0;$a=c[Da>>2]|0;if(!((a[$a+42>>0]|0)==0?(a[$a+43>>0]|0)==0:0))o=122;i:do if((o|0)==122){o=0;$a=fd(Ra)|0;c[Na>>2]=$a;if(($a|0)<=0){c[G>>2]=0;break}Sa=(fd(Ra)|0)+1|0;Ta=Sa>>4;Sa=Sa&15;kd(_);kd(Q);kd(E);c[_>>2]=pd(c[Na>>2]|0,4)|0;c[Q>>2]=pd(c[Na>>2]|0,4)|0;Ua=pd(c[Na>>2]|0,4)|0;c[E>>2]=Ua;if(!(c[_>>2]|0)){o=127;break b}if((c[Q>>2]|0)==0|(Ua|0)==0){o=127;break b}if((c[Na>>2]|0)>0){Wa=(Ta|0)>0;Va=(Sa|0)==0;Ua=0;do{if(Wa){Xa=0;Ya=0;do{Ya=(ad(Ra,16)|0)+(Ya<<16)|0;Xa=Xa+1|0}while((Xa|0)!=(Ta|0))}else Ya=0;if(!Va)Ya=(ad(Ra,Sa)|0)+(Ya<>2]|0)+(Ua<<2)>>2]=Ya+1;Ua=Ua+1|0}while((Ua|0)<(c[Na>>2]|0))}do if((d[F>>0]|0)>1){$a=c[Da>>2]|0;if((c[$a+48>>2]|0)<=1?(c[$a+44>>2]|0)<=1:0)break;c[G>>2]=0;a[F>>0]=1;break i}while(0);c[G>>2]=0}while(0);Sa=c[Da>>2]|0;if(a[Sa+1628>>0]|0){Sa=fd(Ra)|0;_a=be(Sa|0,0,3)|0;Ya=D;$a=(c[Qa+216>>2]|0)-(c[Qa+212>>2]|0)|0;Za=(($a|0)<0)<<31>>31;if((Ya|0)>(Za|0)|(Ya|0)==(Za|0)&_a>>>0>$a>>>0){p=A;o=180;break a}if(Sa){Ta=0;do{cd(Ra,8);Ta=Ta+1|0}while((Ta|0)!=(Sa|0))}Sa=c[Da>>2]|0}Ra=(c[Sa+16>>2]|0)+26+(c[Ma>>2]|0)|0;a[Ia>>0]=Ra;Ra=Ra<<24;if((Ra|0)>855638016){p=A;o=180;break a}if((Ra>>24|0)<(0-(c[(c[va>>2]|0)+13192>>2]|0)|0)){p=A;o=180;break a}$a=c[Ka>>2]|0;c[La>>2]=$a;if(($a|0)==0?(a[Ja>>0]|0)!=0:0){p=A;o=180;break a}if(((c[Qa+216>>2]|0)-(c[Qa+212>>2]|0)|0)<0){p=A;o=180;break a}a[(c[t>>2]|0)+203>>0]=(a[Ja>>0]|0)==0&1;if(!(a[(c[Da>>2]|0)+22>>0]|0))a[(c[t>>2]|0)+272>>0]=a[Ia>>0]|0;a[Ha>>0]=1;a[(c[t>>2]|0)+302>>0]=0;a[(c[t>>2]|0)+303>>0]=0;Ra=c[ma>>2]|0;Qa=c[s>>2]|0;j:do if((Ra|0)==2147483647)switch(Qa|0){case 18:case 16:case 17:case 21:{Ra=c[ua>>2]|0;c[ma>>2]=Ra;break j};case 20:case 19:{c[ma>>2]=-2147483648;Ra=-2147483648;break j};default:{Ra=2147483647;break j}}while(0);do if((Qa+ -8|0)>>>0<2){if((c[ua>>2]|0)<=(Ra|0)){c[na>>2]=0;break c}if((Qa|0)!=9)break;c[ma>>2]=-2147483648}while(0);k:do if(!(a[Ea>>0]|0)){if(!(c[q>>2]|0)){Qa=0;break d}}else{Ra=c[t>>2]|0;_a=c[va>>2]|0;Qa=c[_a+13064>>2]|0;$a=c[_a+13120>>2]>>Qa;Qa=(c[_a+13124>>2]>>Qa)+1|0;ae(c[wa>>2]|0,0,$(c[xa>>2]|0,c[ya>>2]|0)|0)|0;ae(c[za>>2]|0,0,$(c[xa>>2]|0,c[ya>>2]|0)|0)|0;_a=c[va>>2]|0;ae(c[Aa>>2]|0,0,$(c[_a+13152>>2]|0,c[_a+13148>>2]|0)|0)|0;_a=c[va>>2]|0;ae(c[Ba>>2]|0,0,$((c[_a+13160>>2]|0)+1|0,(c[_a+13156>>2]|0)+1|0)|0)|0;ae(c[Ca>>2]|0,-1,$(($a<<2)+4|0,Qa)|0)|0;c[na>>2]=0;c[oa>>2]=c[s>>2];Qa=c[Da>>2]|0;if(a[Qa+42>>0]|0)c[Ra+312>>2]=c[c[Qa+1648>>2]>>2]<>2]|0)+13080>>2];Qa=ac(l,ra,c[ua>>2]|0)|0;do if((Qa|0)>=0){c[(c[c[q>>2]>>2]|0)+80>>2]=((c[s>>2]|0)+ -16|0)>>>0<8&1;c[(c[ra>>2]|0)+84>>2]=3-(c[qa>>2]|0);zd(c[ta>>2]|0);Qa=bc(l,c[ta>>2]|0,0)|0;if((Qa|0)<0)break;break k}while(0);if(!(c[q>>2]|0)){o=167;break b}c[q>>2]=0;if((Qa|0)<0){p=A;break a}}while(0);if((c[s>>2]|0)!=(c[oa>>2]|0)){p=A;o=180;break a}c[m>>2]=0;c[Ga>>2]=1;Qa=c[ka>>2]|0;Fa[c[Qa+816>>2]&1](Qa,1,m,n,1,4)|0;Qa=c[n>>2]|0;$a=c[va>>2]|0;if((Qa|0)>=($(c[$a+13132>>2]|0,c[$a+13128>>2]|0)|0))c[na>>2]=1;if((Qa|0)<0)break d;else break c};case 34:{Qa=Gc(l)|0;if((Qa|0)<0)break d;else break c};default:break c}}while(0);r=(c[(c[ka>>2]|0)+688>>2]&8|0)==0?0:Qa;o=178}while(0);if((o|0)==178?(o=0,(r|0)<0):0){p=A;o=180;break a}C=C+1|0;if((C|0)>=(c[v>>2]|0)){p=A;o=180;break a}}if((o|0)==71){Pb(l);Pb(l);c[va>>2]=0;p=A;o=180;break}else if((o|0)==91)sa();else if((o|0)==127){c[Na>>2]=0;p=A;o=180;break}else if((o|0)==167){c[q>>2]=0;p=A;break}}else{p=A;o=180}}else{p=0;o=180}while(0);if((p|0)<0){$a=p;i=k;return $a|0}m=l+2604|0;if(c[m>>2]|0)c[m>>2]=0;l=c[l+164>>2]|0;if(c[l+304>>2]|0){Ad(g,l);c[h>>2]=1}$a=c[f>>2]|0;i=k;return $a|0}function Nb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;e=c[b+60>>2]|0;Pb(e);b=e+4412|0;f=e+4392|0;if((c[b>>2]|0)>0){g=0;do{kd((c[f>>2]|0)+(g<<2)|0);g=g+1|0}while((g|0)<(c[b>>2]|0))}kd(e+4396|0);kd(e+4388|0);kd(f);kd(e+152|0);kd(e+168|0);kd(e+172|0);kd(e+184|0);kd(e+176|0);kd(e+188|0);kd(e+180|0);kd(e+192|0);yd(e+164|0);g=e+2524|0;Zb(e,g,-1);yd(g);g=e+208|0;f=0;do{wd(g+(f<<2)|0);f=f+1|0}while((f|0)!=16);g=e+272|0;f=0;do{wd(g+(f<<2)|0);f=f+1|0}while((f|0)!=32);f=e+400|0;g=0;do{wd(f+(g<<2)|0);g=g+1|0}while((g|0)!=256);c[e+200>>2]=0;c[e+204>>2]=0;c[e+196>>2]=0;wd(e+1424|0);kd(e+2096|0);kd(e+2100|0);kd(e+2104|0);h=e+141|0;l=a[h>>0]|0;f=e+72|0;if((l&255)>1){g=e+8|0;j=1;do{k=f+(j<<2)|0;if(c[k>>2]|0){kd(k);kd(g+(j<<2)|0);l=a[h>>0]|0}j=j+1|0}while((j|0)<(l&255|0))}g=e+136|0;if((c[g>>2]|0)==(c[f>>2]|0))c[g>>2]=0;kd(f);f=e+4404|0;if((c[b>>2]|0)<=0){kd(f);c[b>>2]=0;i=d;return 0}e=0;do{kd((c[f>>2]|0)+(e<<4)|0);e=e+1|0}while((e|0)<(c[b>>2]|0));kd(f);c[b>>2]=0;i=d;return 0}function Ob(a){a=a|0;var b=0;b=i;a=c[a+60>>2]|0;$b(a);c[a+2592>>2]=2147483647;i=b;return}function Pb(a){a=a|0;var b=0;b=i;kd(a+2504|0);kd(a+2508|0);kd(a+4332|0);kd(a+4336|0);kd(a+4340|0);kd(a+4344|0);kd(a+4348|0);kd(a+4316|0);kd(a+4328|0);kd(a+4352|0);kd(a+4320|0);kd(a+4324|0);kd(a+2096|0);kd(a+2104|0);kd(a+2100|0);i=b;return}function Qb(a){a=a|0;var b=0,d=0,e=0;b=i;d=(c[a+136>>2]|0)+204|0;if(dd(d)|0){e=-1094995529;i=b;return e|0}c[a+2512>>2]=ad(d,6)|0;e=ad(d,6)|0;d=(ad(d,3)|0)+ -1|0;c[a+2516>>2]=d;if((d|0)<0){e=-1094995529;i=b;return e|0}e=(e|0)==0&1;i=b;return e|0}function Rb(e,f){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,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;f=i;h=c[e+60>>2]|0;k=h+200|0;E=c[k>>2]|0;e=1<>2];l=h+204|0;n=c[l>>2]|0;A=c[(c[n+1668>>2]|0)+(c[h+2500>>2]<<2)>>2]|0;m=(a[h+1449>>0]|0)==0;if(!A)if(m)g=4;else{W=-1094995529;i=f;return W|0}else if(!m){m=h+4328|0;r=h+1436|0;if((c[(c[m>>2]|0)+(c[(c[n+1672>>2]|0)+(A+ -1<<2)>>2]<<2)>>2]|0)!=(c[r>>2]|0)){W=-1094995529;i=f;return W|0}}else g=4;if((g|0)==4){m=h+4328|0;r=h+1436|0}q=e+ -1|0;s=h+136|0;p=h+2504|0;y=h+2056|0;o=h+2057|0;w=h+2084|0;x=h+2508|0;v=h+2088|0;u=h+2062|0;t=h+4352|0;z=0;n=0;do{if((A|0)>=(c[E+13136>>2]|0))break;G=c[l>>2]|0;B=c[(c[G+1672>>2]|0)+(A<<2)>>2]|0;J=E+13120|0;I=E+13080|0;H=c[I>>2]|0;n=q+(c[J>>2]|0)>>H;z=((B|0)%(n|0)|0)<>2]|0;H=1<>2]|0;D=B-F|0;c[(c[m>>2]|0)+(B<<2)>>2]=F;do if(!(a[G+43>>0]|0)){if(!(a[G+42>>0]|0)){c[C+312>>2]=c[J>>2];G=E;break}if((A|0)!=0?(W=c[G+1676>>2]|0,(c[W+(A<<2)>>2]|0)!=(c[W+(A+ -1<<2)>>2]|0)):0){W=c[I>>2]|0;c[C+312>>2]=(c[(c[G+1648>>2]|0)+(c[(c[G+1664>>2]|0)+(z>>W<<2)>>2]<<2)>>2]<>0]=1;G=c[k>>2]|0}else G=E}else{if((z|0)==0?(H+ -1&n|0)==0:0){a[C+203>>0]=1;E=c[k>>2]|0}c[C+312>>2]=c[E+13120>>2];G=E}while(0);E=H+n|0;H=c[G+13124>>2]|0;c[C+316>>2]=(E|0)>(H|0)?H:E;E=C+31312|0;c[E>>2]=0;H=c[l>>2]|0;if(!(a[H+42>>0]|0)){if((B|0)==(F|0)){c[E>>2]=1;F=1}else F=0;if((D|0)<(c[G+13128>>2]|0)){F=F|4;c[E>>2]=F}}else{if((z|0)>0){W=c[H+1676>>2]|0;I=B+ -1|0;if((c[W+(A<<2)>>2]|0)==(c[W+(c[(c[H+1668>>2]|0)+(I<<2)>>2]<<2)>>2]|0))F=0;else{c[E>>2]=2;F=2}W=c[m>>2]|0;if((c[W+(B<<2)>>2]|0)!=(c[W+(I<<2)>>2]|0)){F=F|1;c[E>>2]=F}}else F=0;if((n|0)>0){W=c[H+1676>>2]|0;I=G+13128|0;G=c[I>>2]|0;if((c[W+(A<<2)>>2]|0)!=(c[W+(c[(c[H+1668>>2]|0)+(B-G<<2)>>2]<<2)>>2]|0)){F=F|8;c[E>>2]=F;G=c[I>>2]|0}W=c[m>>2]|0;if((c[W+(B<<2)>>2]|0)!=(c[W+(B-G<<2)>>2]|0)){F=F|4;c[E>>2]=F}}}E=(z|0)>0;if(E&(D|0)>0)G=(F>>>1&1^1)&255;else G=0;a[C+308>>0]=G;if((n|0)>0){if((D|0)<(c[(c[k>>2]|0)+13128>>2]|0))F=0;else F=(F>>>3&1^1)&255;a[C+309>>0]=F;F=c[(c[k>>2]|0)+13128>>2]|0;if((D+1|0)<(F|0))F=0;else{W=c[l>>2]|0;V=c[W+1676>>2]|0;F=(c[V+(A<<2)>>2]|0)==(c[V+(c[(c[W+1668>>2]|0)+(B+1-F<<2)>>2]<<2)>>2]|0)&1}a[C+310>>0]=F;if(E?(j=c[(c[k>>2]|0)+13128>>2]|0,(D|0)>(j|0)):0){D=c[l>>2]|0;W=c[D+1676>>2]|0;D=(c[W+(A<<2)>>2]|0)==(c[W+(c[(c[D+1668>>2]|0)+(B+ -1-j<<2)>>2]<<2)>>2]|0)&1}else D=0}else{a[C+309>>0]=0;a[C+310>>0]=0;D=0}a[C+311>>0]=D;Wa(h,A);D=c[k>>2]|0;E=c[D+13080>>2]|0;F=z>>E;E=n>>E;G=c[s>>2]|0;D=($(c[D+13128>>2]|0,E)|0)+F|0;C=c[p>>2]|0;if((a[y>>0]|0)==0?(a[o>>0]|0)==0:0){M=0;H=0}else{if((F|0)>0?(a[G+308>>0]|0)!=0:0)M=$a(h)|0;else M=0;if((E|0)>0&(M|0)==0)if(!(a[G+309>>0]|0)){M=0;H=0}else{M=0;H=($a(h)|0)!=0}else H=0}I=(c[(c[k>>2]|0)+4>>2]|0)!=0?3:1;L=C+(D*148|0)+143|0;G=C+(D*148|0)+144|0;K=C+(D*148|0)+104|0;J=C+(D*148|0)+108|0;R=(M|0)==0;S=R&(H^1);M=E+ -1|0;O=F+ -1|0;P=0;do{Q=c[l>>2]|0;Q=d[((P|0)==0?Q+1644|0:Q+1645|0)>>0]|0;a:do if(a[h+P+2056>>0]|0){T=(P|0)==2;do if(!T){if(S){U=(bb(h)|0)&255;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}if(!R){U=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;U=a[(c[p>>2]|0)+(U*148|0)+P+142>>0]|0;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}if(H){U=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;U=a[(c[p>>2]|0)+(U*148|0)+P+142>>0]|0;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}else{a[C+(D*148|0)+P+142>>0]=0;break a}}else{U=a[L>>0]|0;a[G>>0]=U;c[J>>2]=c[K>>2];N=G}while(0);if(U<<24>>24){U=0;do{do if(!S){if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(U<<2)>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(U<<2)>>2];break}else{c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=0;break}}else c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=eb(h)|0;while(0);U=U+1|0}while((U|0)!=4);do if((a[N>>0]|0)==1){T=0;do{do if(c[C+(D*148|0)+(P<<4)+(T<<2)>>2]|0){if(S){c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=fb(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(T<<2)+48>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(T<<2)+48>>2];break}else{c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=0;break}}else c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=0;while(0);T=T+1|0}while((T|0)!=4);if(S){a[C+(D*148|0)+P+96>>0]=db(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;a[C+(D*148|0)+P+96>>0]=a[(c[p>>2]|0)+(W*148|0)+P+96>>0]|0;break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;a[C+(D*148|0)+P+96>>0]=a[(c[p>>2]|0)+(W*148|0)+P+96>>0]|0;break}else{a[C+(D*148|0)+P+96>>0]=0;break}}else if(!T){if(S){c[C+(D*148|0)+(P<<2)+100>>2]=gb(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<2)+100>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<2)+100>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<2)+100>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<2)+100>>2];break}else{c[C+(D*148|0)+(P<<2)+100>>2]=0;break}}while(0);b[C+(D*148|0)+(P*10|0)+112>>1]=0;T=0;do{W=c[C+(D*148|0)+(P<<4)+(T<<2)>>2]|0;V=T;T=T+1|0;U=C+(D*148|0)+(P*10|0)+(T<<1)+112|0;b[U>>1]=W;if((a[N>>0]|0)==2){if((V|0)>1){W=0-W|0;b[U>>1]=W}}else if(c[C+(D*148|0)+(P<<4)+(V<<2)+48>>2]|0){W=0-W|0;b[U>>1]=W}b[U>>1]=W<<16>>16<>0]=0;while(0);P=P+1|0}while((P|0)<(I|0));C=c[x>>2]|0;c[C+(B<<3)>>2]=c[w>>2];c[C+(B<<3)+4>>2]=c[v>>2];a[(c[t>>2]|0)+B>>0]=a[u>>0]|0;C=Sb(h,z,n,c[(c[k>>2]|0)+13080>>2]|0,0)|0;if((C|0)<0){g=108;break}A=A+1|0;Va(h,A);Fb(h,z,n,e);E=c[k>>2]|0}while((C|0)!=0);if((g|0)==108){c[(c[m>>2]|0)+(B<<2)>>2]=-1;W=C;i=f;return W|0}if((z+e|0)<(c[E+13120>>2]|0)){W=A;i=f;return W|0}if((n+e|0)<(c[E+13124>>2]|0)){W=A;i=f;return W|0}Db(h,z,n,e);W=A;i=f;return W|0}function Sb(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;j=i;i=i+32|0;z=j;B=j+20|0;A=b+136|0;r=c[A>>2]|0;l=1<>2]|0;q=b+204|0;s=c[q>>2]|0;p=(1<<(c[t+13080>>2]|0)-(c[s+24>>2]|0))+ -1|0;c[r+31232>>2]=h;k=l+e|0;if(((k|0)<=(c[t+13120>>2]|0)?(l+f|0)<=(c[t+13124>>2]|0):0)?(c[t+13064>>2]|0)>>>0>>0:0){t=nb(b,h,e,f)|0;s=c[q>>2]|0}else t=(c[t+13064>>2]|0)>>>0>>0&1;if((a[s+22>>0]|0)!=0?((c[(c[m>>2]|0)+13080>>2]|0)-(c[s+24>>2]|0)|0)>>>0<=g>>>0:0){a[r+300>>0]=0;c[r+280>>2]=0}if((a[b+2080>>0]|0)!=0?((c[(c[m>>2]|0)+13080>>2]|0)-(d[(c[q>>2]|0)+1632>>0]|0)|0)>>>0<=g>>>0:0)a[r+301>>0]=0;if(t){n=l>>1;o=n+e|0;q=n+f|0;g=g+ -1|0;h=h+1|0;s=Sb(b,e,f,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}if(s){if((o|0)<(c[(c[m>>2]|0)+13120>>2]|0)){s=Sb(b,o,f,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}if(s){if((q|0)<(c[(c[m>>2]|0)+13124>>2]|0)){s=Sb(b,e,q,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}if(s){X=c[m>>2]|0;if((o|0)<(c[X+13120>>2]|0)?(q|0)<(c[X+13124>>2]|0):0){s=Sb(b,o,q,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}}else s=0}else s=0}else s=0;if((p&k|0)==0?(p&l+f|0)==0:0)c[r+276>>2]=a[r+272>>0];if(!s){X=0;i=j;return X|0}k=c[m>>2]|0;if((o+n|0)<(c[k+13120>>2]|0))k=1;else k=(q+n|0)<(c[k+13124>>2]|0);X=k&1;i=j;return X|0}p=c[A>>2]|0;s=c[m>>2]|0;r=c[s+13064>>2]|0;h=c[s+13140>>2]|0;s=1<<(c[s+13080>>2]|0)-(c[(c[q>>2]|0)+24>>2]|0);c[p+31236>>2]=e;c[p+31240>>2]=f;y=p+31252|0;a[y>>0]=1;v=p+31244|0;c[v>>2]=1;E=p+31248|0;c[E>>2]=0;w=p+31254|0;a[w>>0]=0;x=p+31253|0;a[x>>0]=0;t=($(f>>r,h)|0)+(e>>r)|0;H=b+4332|0;a[(c[H>>2]|0)+t>>0]=0;X=p+31268|0;a[X>>0]=1;a[X+1>>0]=1;a[X+2>>0]=1;a[X+3>>0]=1;r=l>>r;s=s+ -1|0;if(a[(c[q>>2]|0)+40>>0]|0){X=(ib(b)|0)&255;a[p+31256>>0]=X;if(X<<24>>24)Tb(b,e,f,g)}else a[p+31256>>0]=0;u=(r|0)>0;if(u){G=t;F=0;while(1){ae((c[H>>2]|0)+G|0,0,r|0)|0;F=F+1|0;if((F|0)==(r|0))break;else G=G+h|0}}if((c[v>>2]|0)==1?(c[(c[m>>2]|0)+13064>>2]|0)!=(g|0):0)C=c[E>>2]|0;else{F=ob(b,g)|0;c[E>>2]=F;E=c[v>>2]|0;if((F|0)==3)G=(E|0)==1&1;else G=0;a[w>>0]=G;if((E|0)==1)C=F;else sa()}if((((C|0)==0?(D=c[m>>2]|0,(c[D+68>>2]|0)!=0):0)?(c[D+13048>>2]|0)>>>0<=g>>>0:0)?(c[D+13052>>2]|0)>>>0>=g>>>0:0){C=(pb(b)|0)&255;a[x>>0]=C}else C=a[x>>0]|0;do if(!(C<<24>>24)){C=c[A>>2]|0;F=(c[C+31248>>2]|0)==3;D=F?2:1;H=0;do{G=H<<1;E=0;do{a[B+(E+G)>>0]=qb(b)|0;E=E+1|0}while((E|0)<(D|0));H=H+1|0}while((H|0)<(D|0));Q=l>>(F&1);P=C+31264|0;R=z+4|0;E=z+8|0;F=b+4340|0;O=C+31260|0;N=0;do{J=N<<1;H=($(N,Q)|0)+f|0;I=0;do{L=I+J|0;U=(a[B+L>>0]|0)==0;if(U)c[P>>2]=sb(b)|0;else c[O>>2]=rb(b)|0;V=($(I,Q)|0)+e|0;T=c[A>>2]|0;X=c[m>>2]|0;S=c[X+13084>>2]|0;M=V>>S;K=H>>S;G=c[X+13156>>2]|0;S=Q>>S;X=c[X+13080>>2]|0;W=(1<>0]|0)==0?(W&H|0)==0:0)W=1;else{W=($(K+ -1|0,G)|0)+M|0;W=d[(c[F>>2]|0)+W>>0]|0}if((a[T+308>>0]|0)==0&(V|0)==0)V=1;else{V=M+ -1+($(K,G)|0)|0;V=d[(c[F>>2]|0)+V>>0]|0}X=(H>>X<>>0<2){c[z>>2]=0;c[R>>2]=1;c[E>>2]=26;V=0;X=1;W=26;break}else{c[z>>2]=V;X=(V+29&31)+2|0;c[R>>2]=X;W=(V+31&31)+2|0;c[E>>2]=W;break}else{c[z>>2]=V;c[R>>2]=X;if(!((V|0)==0|(X|0)==0)){c[E>>2]=0;W=0;break}if((V|0)==1|(X|0)==1){c[E>>2]=26;W=26;break}else{c[E>>2]=1;W=1;break}}while(0);if(U){if((V|0)>(X|0)){c[R>>2]=V;U=X&255;c[z>>2]=U}else{U=V;V=X}if((U|0)>(W|0)){c[E>>2]=U;X=W&255;c[z>>2]=X;W=U;U=X}if((V|0)>(W|0)){c[E>>2]=V;X=W&255;c[R>>2]=X}else{X=V;V=W}T=c[T+31264>>2]|0;T=((T|0)>=(U|0)&1)+T|0;T=((T|0)>=(X|0)&1)+T|0;T=((T|0)>=(V|0)&1)+T|0}else T=c[z+(c[T+31260>>2]<<2)>>2]|0;S=(S|0)==0?1:S;T=T&255;if((S|0)>0){U=0;do{X=($(U+K|0,G)|0)+M|0;ae((c[F>>2]|0)+X|0,T|0,S|0)|0;U=U+1|0}while((U|0)<(S|0))}a[C+L+31268>>0]=T;I=I+1|0}while((I|0)<(D|0));N=N+1|0}while((N|0)<(D|0));z=c[(c[m>>2]|0)+4>>2]|0;if(!z)break;else if((z|0)==2){A=tb(b)|0;a[C+31281>>0]=A;z=a[C+31268>>0]|0;if((A|0)==4)z=z&255;else{X=a[1528+A>>0]|0;z=z<<24>>24==X<<24>>24?34:X&255}a[C+31277>>0]=a[1536+z>>0]|0;break}else if((z|0)!=3){A=tb(b)|0;z=a[C+31268>>0]|0;if((A|0)==4){a[C+31277>>0]=z;break}A=a[1528+A>>0]|0;B=C+31277|0;if(z<<24>>24==A<<24>>24){a[B>>0]=34;break}else{a[B>>0]=A;break}}else{A=0;do{B=A<<1;E=0;do{G=tb(b)|0;F=E+B|0;a[C+F+31281>>0]=G;z=a[C+F+31268>>0]|0;do if((G|0)!=4){G=a[1528+G>>0]|0;F=C+F+31277|0;if(z<<24>>24==G<<24>>24){a[F>>0]=34;break}else{a[F>>0]=G;break}}else a[C+F+31277>>0]=z;while(0);E=E+1|0}while((E|0)<(D|0));A=A+1|0}while((A|0)<(D|0))}}else{G=c[m>>2]|0;E=c[G+13084>>2]|0;B=l>>E;D=c[G+13156>>2]|0;C=e>>E;E=f>>E;B=(B|0)==0?1:B;if((B|0)>0){F=b+4340|0;G=0;do{X=($(G+E|0,D)|0)+C|0;ae((c[F>>2]|0)+X|0,1,B|0)|0;G=G+1|0}while((G|0)<(B|0));G=c[m>>2]|0}I=c[A>>2]|0;V=c[b+160>>2]|0;C=c[V+32>>2]|0;F=$(C,f)|0;H=c[G+56>>2]|0;F=(c[V>>2]|0)+((e<>2]|0;K=c[G+13184>>2]|0;B=$(f>>K,D)|0;J=c[G+13172>>2]|0;B=(c[V+4>>2]|0)+((e>>J<>2]|0;X=c[G+13188>>2]|0;E=$(f>>X,A)|0;W=c[G+13176>>2]|0;E=(c[V+8>>2]|0)+((e>>W<>0]|0,l<>W,l>>X)|0)+($(l>>J,l>>K)|0)|0;G=($(d[G+13045>>0]|0,K)|0)+H|0;H=I+224|0;K=G+7>>3;J=c[I+240>>2]|0;X=c[H>>2]|0;J=(X&1|0)==0?J:J+ -1|0;J=(X&511|0)==0?J:J+ -1|0;I=(c[I+244>>2]|0)-J|0;if((I|0)<(K|0))J=0;else _c(H,J+K|0,I-K|0);if(!(a[b+2061>>0]|0))Cb(b,e,f,g);X=G>>>0>2147483639|(J|0)==0;W=X?0:G;V=X?0:J;c[z>>2]=V;c[z+12>>2]=W;c[z+16>>2]=W+8;c[z+4>>2]=V+(W+7>>3);c[z+8>>2]=0;if(X)z=-1094995529;else{W=b+2608|0;X=c[m>>2]|0;Ba[c[W>>2]&7](F,C,l,l,z,d[X+13044>>0]|0,c[X+52>>2]|0);X=c[m>>2]|0;Ba[c[W>>2]&7](B,D,l>>c[X+13172>>2],l>>c[X+13184>>2],z,d[X+13045>>0]|0,c[X+52>>2]|0);X=c[m>>2]|0;Ba[c[W>>2]&7](E,A,l>>c[X+13176>>2],l>>c[X+13188>>2],z,d[X+13045>>0]|0,c[X+52>>2]|0);z=0}if(a[(c[m>>2]|0)+13056>>0]|0)Tb(b,e,f,g);if((z|0)<0){X=z;i=j;return X|0}}while(0);do if(!(a[x>>0]|0)){if(!(a[y>>0]|0)){if(a[b+2061>>0]|0)break;Cb(b,e,f,g);break}x=c[m>>2]|0;if((c[v>>2]|0)==1)v=(d[w>>0]|0)+(c[x+13092>>2]|0)|0;else v=c[x+13088>>2]|0;a[p+31255>>0]=v;v=Ub(b,e,f,e,f,e,f,g,g,0,0,1520,1520)|0;if((v|0)<0){X=v;i=j;return X|0}}while(0);if((a[(c[q>>2]|0)+22>>0]|0)!=0?(a[p+300>>0]|0)==0:0)Bb(b,e,f,g);if(u){q=b+4316|0;g=p+272|0;u=0;while(1){ae((c[q>>2]|0)+t|0,a[g>>0]|0,r|0)|0;u=u+1|0;if((u|0)==(r|0))break;else t=t+h|0}}if((s&k|0)==0?(s&l+f|0)==0:0)c[p+276>>2]=a[p+272>>0];q=c[m>>2]|0;X=c[q+13064>>2]|0;g=l>>X;r=e>>X;e=f>>X;if((g|0)>0?(n=b+4336|0,o=c[p+31232>>2]&255,X=($(c[q+13140>>2]|0,e)|0)+r|0,ae((c[n>>2]|0)+X|0,o|0,g|0)|0,(g|0)!=1):0){p=1;do{X=($(c[(c[m>>2]|0)+13140>>2]|0,p+e|0)|0)+r|0;ae((c[n>>2]|0)+X|0,o|0,g|0)|0;p=p+1|0}while((p|0)!=(g|0))}e=c[m>>2]|0;m=1<>2];if(((k|0)%(m|0)|0|0)!=0?(k|0)<(c[e+13120>>2]|0):0){X=1;i=j;return X|0}X=l+f|0;if(((X|0)%(m|0)|0|0)!=0?(X|0)<(c[e+13124>>2]|0):0){X=1;i=j;return X|0}X=(hb(b)|0)==0&1;i=j;return X|0}function Tb(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;g=i;m=1<>2]|0;l=c[n+13084>>2]|0;f=c[n+13156>>2]|0;k=m+d|0;j=c[n+13120>>2]|0;m=m+e|0;n=c[n+13124>>2]|0;h=e>>l;e=((m|0)>(n|0)?n:m)>>l;if((h|0)>=(e|0)){i=g;return}d=d>>l;j=((k|0)>(j|0)?j:k)>>l;k=(d|0)<(j|0);b=b+4348|0;do{if(k){m=$(h,f)|0;l=d;do{a[(c[b>>2]|0)+(l+m)>>0]=2;l=l+1|0}while((l|0)!=(j|0))}h=h+1|0}while((h|0)!=(e|0));i=g;return}function Ub(e,f,g,h,j,k,l,m,n,o,p,q,r){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;var 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;s=i;i=i+16|0;w=s+8|0;t=s;z=e+136|0;v=c[z>>2]|0;K=c[q>>2]|0;c[w>>2]=K;A=c[q+4>>2]|0;G=w+4|0;c[G>>2]=A;L=c[r>>2]|0;c[t>>2]=L;q=c[r+4>>2]|0;x=t+4|0;c[x>>2]=q;y=a[v+31254>>0]|0;do if(y<<24>>24){if((o|0)==1){c[v+288>>2]=d[v+p+31268>>0];if((c[(c[e+200>>2]|0)+4>>2]|0)==3){c[v+292>>2]=d[v+p+31277>>0];c[v+296>>2]=d[v+p+31281>>0];break}else{c[v+292>>2]=d[v+31277>>0];c[v+296>>2]=d[v+31281>>0];break}}}else{c[v+288>>2]=d[v+31268>>0];c[v+292>>2]=d[v+31277>>0];c[v+296>>2]=d[v+31281>>0]}while(0);r=e+200|0;I=c[r>>2]|0;B=(c[I+13076>>2]|0)>>>0>>0;if(((!B?(c[I+13072>>2]|0)>>>0>>0:0)?(d[v+31255>>0]|0)>(o|0):0)?!(y<<24>>24!=0&(o|0)==0):0)y=(ub(e,n)|0)&255;else{if((c[I+13088>>2]|0)==0?(c[v+31244>>2]|0)==0:0)I=(o|0)==0&(c[v+31248>>2]|0)!=0;else I=0;if(B)y=1;else y=(y<<24>>24!=0&(o|0)==0|I)&1}B=(n|0)>2;I=c[(c[r>>2]|0)+4>>2]|0;if(B)if(!I){J=q;M=A}else E=20;else if((I|0)==3)E=20;else{J=q;M=A}do if((E|0)==20){I=(o|0)==0;if(!((K|0)==0&(I^1))){K=vb(e,o)|0;c[w>>2]=K;if((c[(c[r>>2]|0)+4>>2]|0)==2?y<<24>>24==0|(n|0)==3:0){A=vb(e,o)|0;c[G>>2]=A}if(!I)E=25}else{K=0;E=25}if((E|0)==25)if(!L){L=0;J=q;M=A;break}L=vb(e,o)|0;c[t>>2]=L;if((c[(c[r>>2]|0)+4>>2]|0)==2?y<<24>>24==0|(n|0)==3:0){J=vb(e,o)|0;c[x>>2]=J;M=A}else{J=q;M=A}}while(0);if(!(y<<24>>24)){A=c[r>>2]|0;q=c[A+13072>>2]|0;y=1<>2]|0;if(((o|0)==0?(c[v+31244>>2]|0)!=1:0)&(K|0)==0&(L|0)==0)if((c[A+4>>2]|0)==2?(M|J|0)!=0:0)E=37;else o=1;else E=37;if((E|0)==37){o=wb(e,o)|0;A=c[r>>2]|0}G=c[z>>2]|0;A=n-(c[A+13172>>2]|0)|0;z=G+31244|0;if((c[z>>2]|0)==1){I=1<>2]|0;L=c[K+4>>2]|0;if((L|0)==2){if(M){E=46;break}if(J){M=0;E=46;break}}if(!((c[z>>2]|0)!=1|(L|0)==0)){if(B|(L|0)==3){t=1<<(c[K+13172>>2]|0)+A;w=1<<(c[K+13184>>2]|0)+A;Ec(e,f,g,t,w);Wb(e,f,g,A,1);Wb(e,f,g,A,2);if((c[(c[r>>2]|0)+4>>2]|0)!=2)break;M=(1<>2]|0)+n,Ec(e,h,j,H,F),Wb(e,h,j,n,1),Wb(e,h,j,n,2),(c[(c[r>>2]|0)+4>>2]|0)==2):0){M=(1<>2]|0)+4>>2]|0)==2){F=(M|J|0)==0;E=48}else{F=1;E=48}a:do if((E|0)==48){E=e+204|0;do if((a[(c[E>>2]|0)+22>>0]|0)!=0?(D=G+300|0,(a[D>>0]|0)==0):0){M=jb(e)|0;H=G+280|0;c[H>>2]=M;if(M){M=(kb(e)|0)==1;J=c[H>>2]|0;if(M){J=0-J|0;c[H>>2]=J}}else J=0;a[D>>0]=1;M=(c[(c[r>>2]|0)+13192>>2]|0)/2|0;if((J|0)<(-26-M|0)|(J|0)>(M+25|0)){M=-1094995529;i=s;return M|0}else{Bb(e,k,l,m);break}}while(0);if((!((a[e+2080>>0]|0)==0|F)?(a[G+31256>>0]|0)==0:0)?(C=G+301|0,(a[C>>0]|0)==0):0){if(!(lb(e)|0)){a[G+302>>0]=0;a[G+303>>0]=0}else{k=c[E>>2]|0;if(!(a[k+1633>>0]|0))l=0;else{l=mb(e)|0;k=c[E>>2]|0}a[G+302>>0]=a[k+l+1634>>0]|0;a[G+303>>0]=a[(c[E>>2]|0)+l+1639>>0]|0}a[C>>0]=1}if((c[z>>2]|0)==1&(n|0)<4){k=c[G+288>>2]|0;if((k+ -6|0)>>>0<9)m=2;else m=(k+ -22|0)>>>0<9&1;k=c[G+292>>2]|0;if((k+ -6|0)>>>0<9)k=2;else k=(k+ -22|0)>>>0<9&1}else{m=0;k=0}l=G+304|0;a[l>>0]=0;if(I)zb(e,f,g,n,m,0);m=c[r>>2]|0;C=c[m+4>>2]|0;if(C){if(!(B|(C|0)==3)){if((p|0)!=3)break;p=1<>2]|0)+n;l=0;do{if((c[z>>2]|0)==1){M=(l<>2]|0)zb(e,h,(l<>2]|0)+4>>2]|0)==2?2:1)|0));w=0;while(1){if((c[z>>2]|0)==1){M=(w<>2]|0)zb(e,h,(w<=(((c[(c[r>>2]|0)+4>>2]|0)==2?2:1)|0))break a}}j=1<<(c[m+13172>>2]|0)+A;h=1<<(c[m+13184>>2]|0)+A;do if((a[(c[E>>2]|0)+1630>>0]|0)==0|I^1)a[l>>0]=0;else{if(c[z>>2]|0){M=(c[G+296>>2]|0)==4;a[l>>0]=M&1;if(!M)break}else a[l>>0]=1;Vb(e,0)}while(0);m=e+160|0;C=G+320|0;D=G+11680|0;E=1<0;p=e+(A+ -2<<2)+2612|0;F=G+284|0;J=0;do{if((c[z>>2]|0)==1){M=(J<>2]|0)){if(!(a[l>>0]|0))break;M=c[m>>2]|0;G=c[M+36>>2]|0;H=c[r>>2]|0;I=$(g>>c[H+13184>>2],G)|0;I=(c[M+4>>2]|0)+(I+(f>>c[H+13172>>2]<>2]))|0;if(B){J=0;do{b[D+(J<<1)>>1]=($(b[C+(J<<1)>>1]|0,c[F>>2]|0)|0)>>>3;J=J+1|0}while((J|0)!=(E|0));J=E}else J=0;Ma[c[p>>2]&7](I,D,G,c[H+52>>2]|0)}else zb(e,f,(J<>2]|0)+4>>2]|0)==2?2:1)|0));if(!(a[l>>0]|0))I=0;else{Vb(e,1);I=0}do{if((c[z>>2]|0)==1){M=(I<>2]|0)){if(!(a[l>>0]|0))break;M=c[m>>2]|0;G=c[M+40>>2]|0;w=c[r>>2]|0;H=$(g>>c[w+13188>>2],G)|0;H=(c[M+8>>2]|0)+(H+(f>>c[w+13176>>2]<>2]))|0;if(B){I=0;do{b[D+(I<<1)>>1]=($(b[C+(I<<1)>>1]|0,c[F>>2]|0)|0)>>>3;I=I+1|0}while((I|0)!=(E|0));I=E}else I=0;Ma[c[p>>2]&7](H,D,G,c[w+52>>2]|0)}else zb(e,f,(I<>2]|0)+4>>2]|0)==2?2:1)|0))}}while(0);if((o|0)!=0?(u=1<0):0){t=e+4344|0;r=0;do{w=$(r+g>>q,x)|0;o=0;do{a[(c[t>>2]|0)+((o+f>>q)+w)>>0]=1;o=o+y|0}while((o|0)<(u|0));r=r+y|0}while((r|0)<(u|0))}if(((a[e+2061>>0]|0)==0?(Cb(e,f,g,n),(a[(c[e+204>>2]|0)+40>>0]|0)!=0):0)?(a[v+31256>>0]|0)!=0:0)Tb(e,f,g,n)}else{u=n+ -1|0;n=1<>2]|0;f=xb(a,b)|0;if(!f){c[e+284>>2]=0;i=d;return}else{c[e+284>>2]=1-((yb(a,b)|0)<<1)<>2]|0;s=c[d+200>>2]|0;q=c[s+52>>2]|0;V=c[s+(j<<2)+13168>>2]|0;U=c[s+(j<<2)+13180>>2]|0;k=1<>2]|0;oa=k<>2]|0;W=f>>X&_;ia=g>>X&_;Y=_+2|0;aa=($(ia,Y)|0)+W|0;ba=c[d+204>>2]|0;ca=c[ba+1684>>2]|0;aa=c[ca+(aa<<2)>>2]|0;n=c[d+160>>2]|0;d=(c[n+(j<<2)+32>>2]|0)>>>1;n=c[n+(j<<2)>>2]|0;m=($(d,g>>U)|0)+(f>>V)|0;o=n+(m<<1)|0;p=(j|0)==0;r=c[(p?t+288|0:t+292|0)>>2]|0;w=v+2|0;B=y+2|0;z=A+2|0;u=x+2|0;if(!(c[t+31288>>2]|0))na=0;else na=(aa|0)>(c[ca+(W+ -1+($(_&ia+(oa>>X),Y)|0)<<2)>>2]|0);la=na&1;da=c[t+31292>>2]|0;M=c[t+31300>>2]|0;Z=c[t+31296>>2]|0;if(!(c[t+31304>>2]|0))ja=0;else ja=(aa|0)>(c[ca+(($(Y,ia+ -1|0)|0)+(_&W+(ma>>X))<<2)>>2]|0);W=ja&1;ca=(oa<<1)+g|0;_=s+13124|0;ia=c[_>>2]|0;X=oa+g|0;ca=((ca|0)>(ia|0)?ia:ca)-X>>U;ia=(ma<<1)+f|0;aa=s+13120|0;ra=c[aa>>2]|0;Y=ma+f|0;ia=((ia|0)>(ra|0)?ra:ia)-Y>>V;ba=ba+20|0;if((a[ba>>0]|0)==1){ka=c[s+13084>>2]|0;pa=oa>>ka;ma=ma>>ka;qa=(1<>2]|0)-(X>>ka)|0;na=(pa|0)>(na|0)?na:pa;if((na|0)>0){la=0;ra=0;do{la=la|1;ra=ra+2|0}while((ra|0)<(na|0))}else la=0}if(!((da|0)!=1|qa)){ra=(c[s+13160>>2]|0)-(g>>ka)|0;pa=(pa|0)>(ra|0)?ra:pa;if((pa|0)>0){da=0;na=0;do{da=da|1;na=na+2|0}while((na|0)<(pa|0))}else da=0}na=(oa|0)!=0;if(!((Z|0)!=1|na)){oa=(c[s+13156>>2]|0)-(f>>ka)|0;oa=(ma|0)>(oa|0)?oa:ma;if((oa|0)>0){Z=0;pa=0;do{Z=Z|1;pa=pa+2|0}while((pa|0)<(oa|0))}else Z=0}if(!(na|ja^1)){ka=(c[s+13156>>2]|0)-(Y>>ka)|0;ka=(ma|0)>(ka|0)?ka:ma;if((ka|0)>0){W=0;ja=0;do{W=W|1;ja=ja+2|0}while((ja|0)<(ka|0))}else W=0}ka=w+0|0;ja=ka+128|0;do{b[ka>>1]=32896;ka=ka+2|0}while((ka|0)<(ja|0));ka=B+0|0;ja=ka+128|0;do{b[ka>>1]=32896;ka=ka+2|0}while((ka|0)<(ja|0));b[y>>1]=128;ma=W}else ma=W;ka=(M|0)!=0;if(ka){ra=b[n+(m+~d<<1)>>1]|0;b[v>>1]=ra;b[y>>1]=ra}ja=(Z|0)!=0;if(ja)ce(B|0,n+(m-d<<1)|0,k<<1|0)|0;W=(ma|0)!=0;if(W?(ha=k+1|0,ce(y+(ha<<1)|0,n+(k-d+m<<1)|0,k<<1|0)|0,fa=he(e[n+(k+ -1-d+m+ia<<1)>>1]|0,0,65537,65537)|0,ga=D,ea=k-ia|0,(ea|0)>0):0){ia=ia+ha|0;ha=0;do{ra=y+(ia+ha<<1)|0;qa=ra;b[qa>>1]=fa;b[qa+2>>1]=fa>>>16;ra=ra+4|0;b[ra>>1]=ga;b[ra+2>>1]=ga>>>16;ha=ha+4|0}while((ha|0)<(ea|0))}ea=(da|0)!=0;if(ea&(k|0)>0){fa=m+ -1|0;ga=0;do{ra=ga;ga=ga+1|0;b[v+(ga<<1)>>1]=b[n+(fa+($(ra,d)|0)<<1)>>1]|0}while((ga|0)!=(k|0))}fa=(la|0)!=0;if(fa){ia=ca+k|0;ha=m+ -1|0;if((ca|0)>0){ga=k;do{ra=ga;ga=ga+1|0;b[v+(ga<<1)>>1]=b[n+(ha+($(ra,d)|0)<<1)>>1]|0}while((ga|0)<(ia|0))}ia=he(e[n+(ha+($(ia+ -1|0,d)|0)<<1)>>1]|0,0,65537,65537)|0;ha=D;ga=k-ca|0;if((ga|0)>0){ca=k+1+ca|0;na=0;do{ra=v+(ca+na<<1)|0;qa=ra;b[qa>>1]=ia;b[qa+2>>1]=ia>>>16;ra=ra+4|0;b[ra>>1]=ha;b[ra+2>>1]=ha>>>16;na=na+4|0}while((na|0)<(ga|0))}}do if((a[ba>>0]|0)==1?(ra=la|da,S=(ra|0)==0,ra=ra|M,T=(ra|0)==0,(Z|ma|ra|0)!=0):0){ba=k<<1;ca=c[aa>>2]|0;if(((ba<>V;_=c[_>>2]|0;if(((ba<=(_|0))ba=_-g>>U;if(!W)if((Y|0)<(ca|0))V=k;else V=ca-f>>V;else V=aa;if(!fa)if((X|0)<(_|0))U=k;else U=_-g>>U;else U=ba;X=b[y>>1]|0;if(T)b[v>>1]=X;b[v>>1]=X;if(!S){S=0;while(1)if((S|0)<(U|0))S=S+4|0;else break}if(!ea?(R=he(X&65535|0,0,65537,65537)|0,Q=D,(k|0)>0):0){S=0;do{ra=v+((S|1)<<1)|0;qa=ra;b[qa>>1]=R;b[qa+2>>1]=R>>>16;ra=ra+4|0;b[ra>>1]=Q;b[ra+2>>1]=Q>>>16;S=S+4|0}while((S|0)<(k|0))}do if(!fa){Q=he(e[v+(k<<1)>>1]|0,0,65537,65537)|0;S=D;if((k|0)<=0)break;T=k+1|0;R=0;do{ra=v+(T+R<<1)|0;qa=ra;b[qa>>1]=Q;b[qa+2>>1]=Q>>>16;ra=ra+4|0;b[ra>>1]=S;b[ra+2>>1]=S>>>16;R=R+4|0}while((R|0)<(k|0))}while(0);g=(g|0)==0;if((f|0)==0&(U|0)>0){f=0;do{ra=v+((f|1)<<1)|0;qa=ra;b[qa>>1]=0;b[qa+2>>1]=0>>>16;ra=ra+4|0;b[ra>>1]=0;b[ra+2>>1]=0>>>16;f=f+4|0}while((f|0)<(U|0))}b[y>>1]=b[v>>1]|0;if(g)break;else f=0;while(1)if((f|0)<(V|0))f=f+4|0;else break}while(0);a:do if(!fa){if(ea){P=he(e[v+(k<<1)>>1]|0,0,65537,65537)|0;f=D;if((k|0)<=0){P=84;break}g=k+1|0;Q=0;while(1){ra=v+(g+Q<<1)|0;qa=ra;b[qa>>1]=P;b[qa+2>>1]=P>>>16;ra=ra+4|0;b[ra>>1]=f;b[ra+2>>1]=f>>>16;Q=Q+4|0;if((Q|0)>=(k|0)){P=84;break a}}}if(ka){f=he(e[v>>1]|0,0,65537,65537)|0;P=D;O=k<<1;if((k|0)>0)N=0;else{P=87;break}while(1){ra=v+((N|1)<<1)|0;qa=ra;b[qa>>1]=f;b[qa+2>>1]=f>>>16;ra=ra+4|0;b[ra>>1]=P;b[ra+2>>1]=P>>>16;N=N+4|0;if((N|0)>=(O|0)){P=87;break a}}}if(ja){N=b[B>>1]|0;b[v>>1]=N;N=he(N&65535|0,0,65537,65537)|0;O=D;M=k<<1;if((k|0)>0)P=0;else{P=89;break}while(1){ra=v+((P|1)<<1)|0;qa=ra;b[qa>>1]=N;b[qa+2>>1]=N>>>16;ra=ra+4|0;b[ra>>1]=O;b[ra+2>>1]=O>>>16;P=P+4|0;if((P|0)>=(M|0)){P=89;break a}}}if(!W){g=1<>1]=g;R=he(g&65535|0,0,65537,65537)|0;Q=D;P=k<<1;f=(k|0)>0;if(f)S=0;else{P=84;break}do{ra=y+((S|1)<<1)|0;qa=ra;b[qa>>1]=R;b[qa+2>>1]=R>>>16;ra=ra+4|0;b[ra>>1]=Q;b[ra+2>>1]=Q>>>16;S=S+4|0}while((S|0)<(P|0));g=he(g&65535|0,0,65537,65537)|0;Q=D;if(f)f=0;else{P=84;break}while(1){ra=v+((f|1)<<1)|0;qa=ra;b[qa>>1]=g;b[qa+2>>1]=g>>>16;ra=ra+4|0;b[ra>>1]=Q;b[ra+2>>1]=Q>>>16;f=f+4|0;if((f|0)>=(P|0)){P=84;break a}}}M=y+(k+1<<1)|0;O=b[M>>1]|0;N=he(O&65535|0,0,65537,65537)|0;L=D;K=(k|0)>0;if(K)O=0;else{b[v>>1]=O;break}do{ra=y+((O|1)<<1)|0;qa=ra;b[qa>>1]=N;b[qa+2>>1]=N>>>16;ra=ra+4|0;b[ra>>1]=L;b[ra+2>>1]=L>>>16;O=O+4|0}while((O|0)<(k|0));M=b[M>>1]|0;b[v>>1]=M;M=he(M&65535|0,0,65537,65537)|0;L=D;N=k<<1;if(K){K=0;do{ra=v+((K|1)<<1)|0;qa=ra;b[qa>>1]=M;b[qa+2>>1]=M>>>16;ra=ra+4|0;b[ra>>1]=L;b[ra+2>>1]=L>>>16;K=K+4|0}while((K|0)<(N|0));P=92}else P=92}else P=84;while(0);if((P|0)==84)if((da|0)==0?(N=he(e[v+(k+1<<1)>>1]|0,0,65537,65537)|0,O=D,(k|0)>0):0){P=0;do{ra=v+((P|1)<<1)|0;qa=ra;b[qa>>1]=N;b[qa+2>>1]=N>>>16;ra=ra+4|0;b[ra>>1]=O;b[ra+2>>1]=O>>>16;P=P+4|0}while((P|0)<(k|0));P=87}else P=87;if((P|0)==87)if(!M){b[v>>1]=b[w>>1]|0;P=89}else P=89;if((P|0)==89)if((Z|0)==0?(K=he(e[v>>1]|0,0,65537,65537)|0,L=D,(k|0)>0):0){M=0;do{ra=y+((M|1)<<1)|0;qa=ra;b[qa>>1]=K;b[qa+2>>1]=K>>>16;ra=ra+4|0;b[ra>>1]=L;b[ra+2>>1]=L>>>16;M=M+4|0}while((M|0)<(k|0));P=92}else P=92;if(((P|0)==92?!W:0)?(J=he(e[y+(k<<1)>>1]|0,0,65537,65537)|0,I=D,(k|0)>0):0){K=k+1|0;L=0;do{ra=y+(K+L<<1)|0;qa=ra;b[qa>>1]=J;b[qa+2>>1]=J>>>16;ra=ra+4|0;b[ra>>1]=I;b[ra+2>>1]=I>>>16;L=L+4|0}while((L|0)<(k|0))}I=b[v>>1]|0;b[y>>1]=I;b:do if(!(c[s+13112>>2]|0)){if(p){if((r|0)==1|(k|0)==4){u=B;break}}else if(((r|0)==1?1:(c[s+4>>2]|0)!=3)|(k|0)==4){u=B;break}ra=r+ -26|0;ra=(ra|0)>-1?ra:26-r|0;qa=r+ -10|0;qa=(qa|0)>-1?qa:10-r|0;if((((ra|0)>(qa|0)?qa:ra)|0)>(c[1576+(h+ -3<<2)>>2]|0)){J=1<>0]|0)!=0&(h|0)==5?(G=I&65535,H=b[y+128>>1]|0,F=H&65535,ra=F+G-(e[y+64>>1]<<1)|0,(((ra|0)>-1?ra:0-ra|0)|0)<(J|0)):0)?(C=v+128|0,E=b[C>>1]|0,ra=(E&65535)+G-(e[v+64>>1]<<1)|0,(((ra|0)>-1?ra:0-ra|0)|0)<(J|0)):0){b[x>>1]=I;b[x+128>>1]=H;y=0;do{ra=y;y=y+1|0;b[x+(y<<1)>>1]=(($(G,63-ra|0)|0)+32+($(F,y)|0)|0)>>>6}while((y|0)!=63);y=0;while(1){x=y+1|0;b[v+(x<<1)>>1]=(($(I&65535,63-y|0)|0)+32+($(E&65535,x)|0)|0)>>>6;if((x|0)==63)break b;I=b[v>>1]|0;E=b[C>>1]|0;y=x}}C=k<<1;H=b[v+(C<<1)>>1]|0;b[A+(C<<1)>>1]=H;F=b[y+(C<<1)>>1]|0;b[x+(C<<1)>>1]=F;C=C+ -2|0;E=(C|0)>-1;if(E){G=C;while(1){ra=G+1|0;qa=H;H=b[v+(ra<<1)>>1]|0;b[A+(ra<<1)>>1]=((qa&65535)+2+((H&65535)<<1)+(e[v+(G<<1)>>1]|0)|0)>>>2;if((G|0)<=0)break;else G=G+ -1|0}}ra=((e[w>>1]|0)+2+((I&65535)<<1)+(e[B>>1]|0)|0)>>>2&65535;b[A>>1]=ra;b[x>>1]=ra;if(E)while(1){ra=C+1|0;qa=F;F=b[y+(ra<<1)>>1]|0;b[x+(ra<<1)>>1]=((qa&65535)+2+((F&65535)<<1)+(e[y+(C<<1)>>1]|0)|0)>>>2;if((C|0)<=0){w=z;break}else C=C+ -1|0}else w=z}else u=B}else u=B;while(0);if(!r){Xb(o,u,w,d,h);i=l;return}else if((r|0)==1){if((k|0)>0){j=k;q=0;do{j=(e[w+(q<<1)>>1]|0)+j+(e[u+(q<<1)>>1]|0)|0;q=q+1|0}while((q|0)!=(k|0));r=j>>h+1;s=he(r|0,((r|0)<0)<<31>>31|0,65537,65537)|0;t=D;q=0;do{j=($(q,d)|0)+m|0;h=0;do{ra=n+(j+h<<1)|0;qa=ra;a[qa>>0]=s;a[qa+1>>0]=s>>8;a[qa+2>>0]=s>>16;a[qa+3>>0]=s>>24;ra=ra+4|0;a[ra>>0]=t;a[ra+1>>0]=t>>8;a[ra+2>>0]=t>>16;a[ra+3>>0]=t>>24;h=h+4|0}while((h|0)<(k|0));q=q+1|0}while((q|0)!=(k|0))}else r=k>>h+1;if(!(p&(k|0)<32)){i=l;return}b[o>>1]=((r<<1)+2+(e[w>>1]|0)+(e[u>>1]|0)|0)>>>2;if((k|0)<=1){i=l;return}o=(r*3|0)+2|0;p=1;do{b[n+(p+m<<1)>>1]=((e[u+(p<<1)>>1]|0)+o|0)>>>2;p=p+1|0}while((p|0)!=(k|0));p=1;do{b[n+(($(p,d)|0)+m<<1)>>1]=((e[w+(p<<1)>>1]|0)+o|0)>>>2;p=p+1|0}while((p|0)!=(k|0));i=l;return}else{if(!(c[s+13104>>2]|0))m=0;else m=(a[t+31256>>0]|0)!=0;Yb(o,u,w,d,j,r,k,m&1,q);i=l;return}}function Xb(a,c,d,f,g){a=a|0;c=c|0;d=d|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;m=i;j=1<>1]|0,l-r|0)|0;s=r;r=r+1|0;u=$(e[h>>1]|0,r)|0;t=$(e[c+(s<<1)>>1]|0,p)|0;b[a+(s+q<<1)>>1]=v+j+u+t+($(e[k>>1]|0,n)|0)>>g}while((r|0)!=(j|0))}while((n|0)!=(j|0));i=m;return}function Yb(c,f,g,h,j,k,l,m,n){c=c|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var 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;o=i;i=i+208|0;r=o;p=a[1592+(k+ -2)>>0]|0;q=r+(l<<1)|0;s=($(p,l)|0)>>5;if((k|0)>17){u=f+ -2|0;t=k+ -11|0;if(t>>>0<15&(s|0)<-1){if((l|0)>=0){u=0;do{w=f+(u+ -1<<1)|0;y=w;y=d[y>>0]|d[y+1>>0]<<8|d[y+2>>0]<<16|d[y+3>>0]<<24;w=w+4|0;w=d[w>>0]|d[w+1>>0]<<8|d[w+2>>0]<<16|d[w+3>>0]<<24;x=r+(u+l<<1)|0;v=x;b[v>>1]=y;b[v+2>>1]=y>>>16;x=x+4|0;b[x>>1]=w;b[x+2>>1]=w>>>16;u=u+4|0}while((u|0)<=(l|0))}if((s|0)<0){t=b[1632+(t<<1)>>1]|0;do{b[r+(s+l<<1)>>1]=b[g+((($(t,s)|0)+128>>8)+ -1<<1)>>1]|0;s=s+1|0}while((s|0)!=0)}}else q=u;r=(l|0)>0;if(r){s=0;do{w=s;s=s+1|0;v=$(s,p)|0;t=v>>5;v=v&31;if(!v){t=t+1|0;v=$(w,h)|0;u=0;do{x=q+(t+u<<1)|0;z=x;z=d[z>>0]|d[z+1>>0]<<8|d[z+2>>0]<<16|d[z+3>>0]<<24;x=x+4|0;x=d[x>>0]|d[x+1>>0]<<8|d[x+2>>0]<<16|d[x+3>>0]<<24;y=c+(u+v<<1)|0;w=y;a[w>>0]=z;a[w+1>>0]=z>>8;a[w+2>>0]=z>>16;a[w+3>>0]=z>>24;y=y+4|0;a[y>>0]=x;a[y+1>>0]=x>>8;a[y+2>>0]=x>>16;a[y+3>>0]=x>>24;u=u+4|0}while((u|0)<(l|0))}else{u=32-v|0;w=$(w,h)|0;x=0;do{z=x+t|0;y=$(e[q+(z+1<<1)>>1]|0,u)|0;b[c+(x+w<<1)>>1]=(y+16+($(e[q+(z+2<<1)>>1]|0,v)|0)|0)>>>5;z=x|1;y=z+t|0;A=$(e[q+(y+1<<1)>>1]|0,u)|0;b[c+(z+w<<1)>>1]=(A+16+($(e[q+(y+2<<1)>>1]|0,v)|0)|0)>>>5;z=x|2;y=z+t|0;A=$(e[q+(y+1<<1)>>1]|0,u)|0;b[c+(z+w<<1)>>1]=(A+16+($(e[q+(y+2<<1)>>1]|0,v)|0)|0)>>>5;z=x|3;y=z+t|0;A=$(e[q+(y+1<<1)>>1]|0,u)|0;b[c+(z+w<<1)>>1]=(A+16+($(e[q+(y+2<<1)>>1]|0,v)|0)|0)>>>5;x=x+4|0}while((x|0)<(l|0))}}while((s|0)!=(l|0))}if(!((k|0)==26&(j|0)==0&(l|0)<32&(m|0)==0&r)){i=o;return}j=g+ -2|0;k=1<>1]|0)-(e[j>>1]|0)>>1)+(e[f>>1]|0)|0;if(p&m)p=0-p>>31&k;b[c+(($(n,h)|0)<<1)>>1]=p;n=n+1|0}while((n|0)!=(l|0));i=o;return}u=g+ -2|0;t=k+ -11|0;if(t>>>0<15&(s|0)<-1){if((l|0)>=0){u=0;do{z=g+(u+ -1<<1)|0;x=z;x=d[x>>0]|d[x+1>>0]<<8|d[x+2>>0]<<16|d[x+3>>0]<<24;z=z+4|0;z=d[z>>0]|d[z+1>>0]<<8|d[z+2>>0]<<16|d[z+3>>0]<<24;A=r+(u+l<<1)|0;y=A;b[y>>1]=x;b[y+2>>1]=x>>>16;A=A+4|0;b[A>>1]=z;b[A+2>>1]=z>>>16;u=u+4|0}while((u|0)<=(l|0))}if((s|0)<0){t=b[1632+(t<<1)>>1]|0;do{b[r+(s+l<<1)>>1]=b[f+((($(t,s)|0)+128>>8)+ -1<<1)>>1]|0;s=s+1|0}while((s|0)!=0)}}else q=u;r=(l|0)>0;if(r){t=0;do{s=t;t=t+1|0;w=$(t,p)|0;x=w>>5;w=w&31;if(!w){v=x+1|0;u=0;do{b[c+(($(u,h)|0)+s<<1)>>1]=b[q+(v+u<<1)>>1]|0;u=u+1|0}while((u|0)!=(l|0))}else{v=32-w|0;u=0;do{A=u+x|0;z=$(e[q+(A+1<<1)>>1]|0,v)|0;b[c+(($(u,h)|0)+s<<1)>>1]=(z+16+($(e[q+(A+2<<1)>>1]|0,w)|0)|0)>>>5;u=u+1|0}while((u|0)!=(l|0))}}while((t|0)!=(l|0))}if(!((k|0)==10&(j|0)==0&(l|0)<32&(m|0)==0&r)){i=o;return}h=f+ -2|0;j=1<>1]|0)-(e[h>>1]|0)>>1)+(e[g>>1]|0)|0;if(m&n)m=0-m>>31&j;b[c+(k<<1)>>1]=m;m=k|1;p=((e[f+(m<<1)>>1]|0)-(e[h>>1]|0)>>1)+(e[g>>1]|0)|0;if(p&n)p=0-p>>31&j;b[c+(m<<1)>>1]=p;m=k|2;p=((e[f+(m<<1)>>1]|0)-(e[h>>1]|0)>>1)+(e[g>>1]|0)|0;if(p&n)p=0-p>>31&j;b[c+(m<<1)>>1]=p;m=k|3;p=((e[f+(m<<1)>>1]|0)-(e[h>>1]|0)>>1)+(e[g>>1]|0)|0;if(p&n)p=0-p>>31&j;b[c+(m<<1)>>1]=p;k=k+4|0}while((k|0)<(l|0));i=o;return}function Zb(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0;g=i;h=c[e>>2]|0;if(!h){i=g;return}if(!(c[h+304>>2]|0)){i=g;return}h=e+46|0;f=(d[h>>0]|0)&(f^255)&255;a[h>>0]=f;if(f<<24>>24){i=g;return}Wc(c[b+4>>2]|0,e+4|0);c[e+24>>2]=0;i=g;return}function _b(a){a=a|0;var b=0;b=i;Zb(a,a+2524|0,6);i=b;return}function $b(a){a=a|0;var b=0;b=i;Zb(a,a+2524|0,-1);i=b;return}function ac(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;g=i;h=d+4364|0;if(((c[(c[d+2524>>2]|0)+304>>2]|0)!=0?(b[d+2568>>1]|0)==(b[h>>1]|0):0)?(c[d+2544>>2]|0)==(f|0):0){j=-1094995529;i=g;return j|0}j=d+2524|0;if(c[(c[j>>2]|0)+304>>2]|0){j=-12;i=g;return j|0}if((Vc(c[d+4>>2]|0,d+2528|0,1)|0)<0){j=-12;i=g;return j|0}k=d+200|0;m=c[k>>2]|0;c[d+2540>>2]=$(c[m+13132>>2]|0,c[m+13128>>2]|0)|0;m=d+4520|0;l=c[j>>2]|0;c[l+244>>2]=(c[m>>2]|0)==1&1;c[l+240>>2]=((c[m>>2]|0)+ -1|0)>>>0<2&1;c[e>>2]=l;c[d+2520>>2]=j;a[d+2570>>0]=(a[d+1450>>0]|0)==0?2:3;c[d+2544>>2]=f;b[d+2568>>1]=b[h>>1]|0;j=d+2552|0;f=(c[k>>2]|0)+20|0;c[j+0>>2]=c[f+0>>2];c[j+4>>2]=c[f+4>>2];c[j+8>>2]=c[f+8>>2];c[j+12>>2]=c[f+12>>2];j=0;i=g;return j|0}function bc(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,p=0;g=i;l=d+2046|0;k=d+2572|0;h=d+4366|0;n=(f|0)==0;m=d+4364|0;f=d+200|0;while(1){if((a[l>>0]|0)==1){p=d+2524|0;o=d+2570|0;if(((a[o>>0]&8)==0?(c[d+2544>>2]|0)!=(c[k>>2]|0):0)?(b[d+2568>>1]|0)==(b[h>>1]|0):0)Zb(d,p,1)}else o=d+2570|0;if(!(a[o>>0]&1))o=0;else o=(b[d+2568>>1]|0)==(b[h>>1]|0)&1;if(((n?(b[h>>1]|0)==(b[m>>1]|0):0)?(j=c[f>>2]|0,(j|0)!=0):0)?(o|0)<=(c[j+(((c[j+72>>2]|0)+ -1|0)*12|0)+80>>2]|0):0){d=0;h=21;break}if(o){h=15;break}o=b[h>>1]|0;if(o<<16>>16==(b[m>>1]|0)){d=0;h=21;break}b[h>>1]=(o&65535)+1&255}if((h|0)==15){h=d+2524|0;e=Bd(e,c[h>>2]|0)|0;if(!(a[d+2570>>0]&8))Zb(d,h,1);else Zb(d,h,9);p=(e|0)<0?e:1;i=g;return p|0}else if((h|0)==21){i=g;return d|0}return 0}function cc(){var b=0,c=0,d=0,e=0,f=0;b=i;if(!(a[1664]|0))c=0;else{i=b;return}do{d=0;do{f=($(d<<1|1,c)|0)&127;e=f>>>0>63;f=e?f+ -64|0:f;e=e?-1:1;if((f|0)>31){f=64-f|0;e=0-e|0}a[1664+(c<<5)+d>>0]=$(a[2688+f>>0]|0,e)|0;d=d+1|0}while((d|0)!=32);c=c+1|0}while((c|0)!=32);i=b;return}function dc(a,b){a=a|0;b=b|0;c[a>>2]=4;c[a+4>>2]=1;c[a+8>>2]=2;c[a+12>>2]=3;c[a+16>>2]=4;c[a+20>>2]=1;c[a+24>>2]=2;c[a+28>>2]=1;c[a+32>>2]=3;c[a+36>>2]=4;c[a+40>>2]=5;c[a+44>>2]=6;c[a+48>>2]=2;c[a+52>>2]=3;c[a+56>>2]=4;c[a+60>>2]=5;c[a+64>>2]=1;c[a+68>>2]=1;c[a+72>>2]=2;c[a+1676>>2]=5;c[a+1680>>2]=6;c[a+1684>>2]=1;c[a+1688>>2]=2;c[a+1692>>2]=5;c[a+1696>>2]=6;c[a+1700>>2]=1;c[a+1704>>2]=2;return}function ec(a,c,d,e,f,g,h){a=a|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;j=i;c=c>>>1;if((e|0)<=0){i=j;return}k=(d|0)>0;h=h-g|0;l=0;while(1){if(k){m=0;do{b[a+(m<<1)>>1]=(ad(f,g)|0)<>>1;f=1<>1]|0)+(e[k>>1]|0)|0;if(n&h)n=0-n>>31&f;b[k>>1]=n;m=m+1|0;if((m|0)==4)break;else l=l+2|0}j=j+1|0;if((j|0)==4)break;else{c=c+8|0;a=a+(d<<1)|0}}i=g;return}function gc(a,c,d,f){a=a|0;c=c|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;d=d>>>1;f=1<>1]|0)+(e[k>>1]|0)|0;if(n&h)n=0-n>>31&f;b[k>>1]=n;m=m+1|0;if((m|0)==8)break;else l=l+2|0}j=j+1|0;if((j|0)==8)break;else{c=c+16|0;a=a+(d<<1)|0}}i=g;return} +function La(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+15&-16;return b|0}function Ma(){return i|0}function Na(a){a=a|0;i=a}function Oa(a,b){a=a|0;b=b|0;if(!o){o=a;p=b}}function Pa(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 Qa(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 Ra(a){a=a|0;D=a}function Sa(){return D|0}function Ta(b,d){b=b|0;d=d|0;var e=0,f=0;e=i;if(!(a[(c[b+204>>2]|0)+43>>0]|0)){i=e;return}f=c[(c[b+200>>2]|0)+13128>>2]|0;d=(d|0)%(f|0)|0;if((d|0)!=2?!((f|0)==2&(d|0)==0):0){i=e;return}ee(c[b+152>>2]|0,c[b+136>>2]|0,199)|0;i=e;return}function Ua(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;g=b+204|0;f=c[g>>2]|0;if((c[(c[f+1668>>2]|0)+(c[b+2500>>2]<<2)>>2]|0)==(d|0)){Va(b);f=b+1449|0;if(a[f>>0]|0){j=c[g>>2]|0;if((a[j+42>>0]|0)!=0?(j=c[j+1676>>2]|0,(c[j+(d<<2)>>2]|0)!=(c[j+(d+ -1<<2)>>2]|0)):0)h=5}else h=5;if((h|0)==5)Wa(b);if(a[b+1448>>0]|0){i=e;return}if(!(a[(c[g>>2]|0)+43>>0]|0)){i=e;return}g=c[(c[b+200>>2]|0)+13128>>2]|0;if((d|0)%(g|0)|0){i=e;return}if((g|0)==1){Wa(b);i=e;return}if((a[f>>0]|0)!=1){i=e;return}ee(c[b+136>>2]|0,c[b+152>>2]|0,199)|0;i=e;return}if((a[f+42>>0]|0)!=0?(j=c[f+1676>>2]|0,(c[j+(d<<2)>>2]|0)!=(c[j+(d+ -1<<2)>>2]|0)):0){if((a[b+141>>0]|0)==1)Xa(c[b+136>>2]|0);else Va(b);Wa(b);f=c[g>>2]|0}if(!(a[f+43>>0]|0)){i=e;return}f=b+200|0;if((d|0)%(c[(c[f>>2]|0)+13128>>2]|0)|0){i=e;return}d=b+136|0;Ya((c[d>>2]|0)+224|0)|0;if((a[b+141>>0]|0)==1)Xa(c[d>>2]|0);else Va(b);if((c[(c[f>>2]|0)+13128>>2]|0)==1){Wa(b);i=e;return}else{ee(c[d>>2]|0,c[b+152>>2]|0,199)|0;i=e;return}}function Va(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;e=a+136|0;a=c[e>>2]|0;d=a+204|0;ad(d,1);g=a+212|0;f=c[g>>2]|0;h=0-f&7;if(h){ad(d,h);f=c[g>>2]|0}Yc((c[e>>2]|0)+224|0,(c[d>>2]|0)+((f|0)/8|0)|0,(7-f+(c[a+216>>2]|0)|0)/8|0);i=b;return}function Wa(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;g=i;f=c[b+1440>>2]|0;e=2-f|0;e=(a[b+2060>>0]|0)==0|(f|0)==2?e:e^3;f=b+2112|0;b=b+136|0;h=0;do{j=d[680+(e*199|0)+h>>0]|0;l=a[f>>0]|0;k=l<<24>>24;if(l<<24>>24<0)k=0;else k=(k|0)>51?51:k;j=((j<<3&120)+ -16+(($(k,((j>>>4)*5|0)+ -45|0)|0)>>4)<<1)+ -127|0;j=j>>31^j;if((j|0)>124)j=j&1|124;a[(c[b>>2]|0)+h>>0]=j;h=h+1|0}while((h|0)!=199);a[(c[b>>2]|0)+199>>0]=0;a[(c[b>>2]|0)+200>>0]=0;a[(c[b>>2]|0)+201>>0]=0;a[(c[b>>2]|0)+202>>0]=0;i=g;return}function Xa(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+224|0;e=c[a+240>>2]|0;f=c[d>>2]|0;e=(f&1|0)==0?e:e+ -1|0;e=(f&511|0)==0?e:e+ -1|0;a=(c[a+244>>2]|0)-e|0;if((a|0)<0){i=b;return}Yc(d,e,a);i=b;return}function Ya(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;f=a+4|0;d=c[f>>2]|0;e=d+ -2|0;c[f>>2]=e;g=c[a>>2]|0;if((g|0)>=(e<<17|0)){g=(c[a+16>>2]|0)-(c[a+12>>2]|0)|0;i=b;return g|0}d=(d+ -258|0)>>>31;c[f>>2]=e<>2]=g;if(g&65535){g=0;i=b;return g|0}yb(a);g=0;i=b;return g|0}function Za(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=_a(a+224|0,a)|0;i=b;return a|0}function _a(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;h=d[e>>0]|0;j=b+4|0;k=c[j>>2]|0;l=d[2880+((k<<1&384)+(h|512))>>0]|0;k=k-l|0;m=k<<17;n=c[b>>2]|0;g=m-n>>31;c[b>>2]=n-(g&m);c[j>>2]=(g&l-k)+k;h=g^h;a[e>>0]=a[h+4032>>0]|0;e=h&1;h=c[j>>2]|0;g=d[2880+h>>0]|0;c[j>>2]=h<>2]<>2]=g;if(g&65535){i=f;return e|0}j=b+16|0;h=c[j>>2]|0;c[b>>2]=(((d[h+1>>0]|0)<<1|(d[h>>0]|0)<<9)+ -65535<<7-(d[2880+((g+ -1^g)>>15)>>0]|0))+g;if(h>>>0>=(c[b+20>>2]|0)>>>0){i=f;return e|0}c[j>>2]=h+2;i=f;return e|0}function $a(a){a=a|0;var b=0,d=0;b=i;a=a+136|0;d=c[a>>2]|0;if(!(_a(d+224|0,d+1|0)|0)){d=0;i=b;return d|0}d=(ab((c[a>>2]|0)+224|0)|0)==0;d=d?1:2;i=b;return d|0}function ab(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[a>>2]<<1;c[a>>2]=d;if(!(d&65534)){yb(a);d=c[a>>2]|0}e=c[a+4>>2]<<17;if((d|0)<(e|0)){e=0;i=b;return e|0}c[a>>2]=d-e;e=1;i=b;return e|0}function bb(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(ab((c[d>>2]|0)+224|0)|0)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=ab((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function cb(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=c[(c[a+200>>2]|0)+52>>2]|0;d=(d|0)>10?31:(1<0)a=0;else{f=0;i=b;return f|0}while(1){f=a+1|0;if(!(ab((c[e>>2]|0)+224|0)|0)){d=4;break}if((f|0)<(d|0))a=f;else{a=f;d=4;break}}if((d|0)==4){i=b;return a|0}return 0}function db(a){a=a|0;var b=0;b=i;a=ab((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function eb(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(ab((c[d>>2]|0)+224|0)|0)<<1;a=ab((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function fb(a){a=a|0;var b=0;b=i;a=Ya((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function gb(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+5|0)|0;i=b;return a|0}function hb(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;a=a+136|0;g=9;e=0;while(1){h=c[a>>2]|0;f=e;e=e+1|0;if(!(_a(h+224|0,h+g|0)|0)){e=f;g=0;break}if((e|0)>=5){f=0;g=0;d=4;break}else g=10}do if((d|0)==4){while(1){d=0;if(!(ab((c[a>>2]|0)+224|0)|0)){d=5;break}g=(1<>2]|0)+224|0)|0)<>2]|0)+224|0)|0;i=b;return a|0}function jb(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+176|0)|0;i=b;return a|0}function kb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;e=a[(c[b+204>>2]|0)+1633>>0]|0;e=(e&255)<5?5:e&255;f=b+136|0;if(!e){g=0;i=d;return g|0}else b=0;while(1){h=c[f>>2]|0;g=b+1|0;if(!(_a(h+224|0,h+177|0)|0)){e=4;break}if((g|0)<(e|0))b=g;else{b=g;e=4;break}}if((e|0)==4){i=d;return b|0}return 0}function lb(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;j=i;k=c[b+200>>2]|0;n=(1<>2])+ -1|0;l=n&g;m=c[k+13064>>2]|0;h=f>>m;m=g>>m;g=c[b+136>>2]|0;if((a[g+308>>0]|0)==0?(n&f|0)==0:0)f=0;else{f=h+ -1+($(c[k+13140>>2]|0,m)|0)|0;f=d[(c[b+4336>>2]|0)+f>>0]|0}if((a[g+309>>0]|0)==0&(l|0)==0){n=0;m=(f|0)>(e|0);m=m&1;n=(n|0)>(e|0);n=n&1;f=g+224|0;m=m|2;n=m+n|0;n=g+n|0;n=_a(f,n)|0;i=j;return n|0}n=($(c[k+13140>>2]|0,m+ -1|0)|0)+h|0;n=d[(c[b+4336>>2]|0)+n>>0]|0;m=(f|0)>(e|0);m=m&1;n=(n|0)>(e|0);n=n&1;f=g+224|0;m=m|2;n=m+n|0;n=g+n|0;n=_a(f,n)|0;i=j;return n|0}function mb(a,b){a=a|0;b=b|0;var d=0;d=i;b=c[a+136>>2]|0;b=(_a(b+224|0,b+13|0)|0)==0;i=d;return(b?3:0)|0}function nb(a){a=a|0;var b=0;b=i;a=Ya((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function ob(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+17|0)|0;i=b;return a|0}function pb(a){a=a|0;var b=0,d=0,e=0;b=i;e=a+136|0;d=0;while(1){a=d+1|0;if(!(ab((c[e>>2]|0)+224|0)|0)){a=d;d=4;break}if((a|0)<2)d=a;else{d=4;break}}if((d|0)==4){i=b;return a|0}return 0}function qb(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(ab((c[d>>2]|0)+224|0)|0)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=ab((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function rb(a){a=a|0;var b=0,d=0;b=i;a=a+136|0;d=c[a>>2]|0;if(!(_a(d+224|0,d+18|0)|0)){d=4;i=b;return d|0}d=(ab((c[a>>2]|0)+224|0)|0)<<1;d=ab((c[a>>2]|0)+224|0)|0|d;i=b;return d|0}function sb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+(42-b)|0)|0;i=d;return a|0}function tb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+(b+42)|0)|0;i=d;return a|0}function ub(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+((b|0)==0|40)|0)|0;i=d;return a|0}function vb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;a=a+136|0;f=(b<<2)+166|0;e=0;while(1){g=c[a>>2]|0;b=e+1|0;if(!(_a(g+224|0,g+(f+e)|0)|0)){b=e;a=4;break}if((b|0)<4)e=b;else{a=4;break}}if((a|0)==4){i=d;return b|0}return 0}function wb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+(b+174)|0)|0;i=d;return a|0}function xb(f,g,h,j,k,l){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,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,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Da=0,Ea=0,Ga=0,Ha=0,Ia=0,Ja=0,La=0,Ma=0,Na=0;o=i;i=i+96|0;v=o+24|0;u=o+8|0;s=o;t=f+136|0;p=c[t>>2]|0;q=c[f+160>>2]|0;m=c[q+(l<<2)+32>>2]|0;n=f+200|0;T=c[n>>2]|0;h=$(h>>c[T+(l<<2)+13180>>2],m)|0;g=(c[q+(l<<2)>>2]|0)+(h+(g>>c[T+(l<<2)+13168>>2]<>2]))|0;T=(l|0)!=0;h=p+320|0;q=T?p+11680|0:h;w=v+0|0;r=w+64|0;do{a[w>>0]=0;w=w+1|0}while((w|0)<(r|0));S=1<>2]|0;r=S<>0]|0)){A=a[p+272>>0]|0;C=f+204|0;Ma=c[C>>2]|0;if((a[Ma+21>>0]|0)!=0?(d[Ma+1629>>0]|0)>=(j|0):0){F=c[t>>2]|0;F=_a(F+224|0,F+(T&1|46)|0)|0}else F=0;if(y){B=c[n>>2]|0;G=B;B=(c[B+13192>>2]|0)+A|0}else{B=c[C>>2]|0;if((l|0)==1)B=(c[f+2072>>2]|0)+(c[B+28>>2]|0)+(a[p+302>>0]|0)|0;else B=(c[f+2076>>2]|0)+(c[B+32>>2]|0)+(a[p+303>>0]|0)|0;E=B+A|0;G=c[n>>2]|0;A=c[G+13192>>2]|0;B=0-A|0;if((E|0)>=(B|0))B=(E|0)>57?57:E;do if((c[G+4>>2]|0)==1){if((B|0)>=30)if((B|0)>43){B=B+ -6|0;break}else{B=c[176+(B+ -30<<2)>>2]|0;break}}else B=(B|0)>51?51:B;while(0);B=A+B|0}A=(c[G+52>>2]|0)+j|0;E=A+ -5|0;A=1<>0]|0)>>0]<>0];if((a[G+634>>0]|0)!=0?!((F|0)!=0&(j|0)>2):0){H=c[C>>2]|0;H=(a[H+68>>0]|0)==0?G+635|0:H+69|0;G=((c[p+31244>>2]|0)!=1?3:0)+l|0;C=H+((j+ -2|0)*384|0)+(G<<6)|0;if((j|0)>3)ia=a[H+((j+ -4|0)*6|0)+G+1536>>0]|0;else ia=16}else{ia=16;C=0}}else{A=0;ia=0;B=0;C=0;E=0;F=0}J=(j<<1)+ -1|0;if(y){G=(j*3|0)+ -6+(j+ -1>>2)|0;I=j+1>>2}else{G=15;I=j+ -2|0}if((J|0)>0){K=G+52|0;H=0;while(1){Ma=c[t>>2]|0;L=H+1|0;if(!(_a(Ma+224|0,Ma+(K+(H>>I))|0)|0))break;if((L|0)<(J|0))H=L;else{H=L;break}}L=G+70|0;G=0;while(1){Ma=c[t>>2]|0;K=G+1|0;if(!(_a(Ma+224|0,Ma+(L+(G>>I))|0)|0))break;if((K|0)<(J|0))G=K;else{G=K;break}}if((H|0)>3){I=(H>>1)+ -1|0;K=ab((c[t>>2]|0)+224|0)|0;if((I|0)>1){J=1;do{K=ab((c[t>>2]|0)+224|0)|0|K<<1;J=J+1|0}while((J|0)!=(I|0))}H=K+((H&1|2)<3){J=(G>>1)+ -1|0;K=ab((c[t>>2]|0)+224|0)|0;if((J|0)>1){I=1;do{K=ab((c[t>>2]|0)+224|0)|0|K<<1;I=I+1|0}while((I|0)!=(J|0))}I=H;L=K+((G&1|2)<>2;N=L>>2;if((k|0)==1){G=I;H=L;P=d[536+(L<<3)+I>>0]|0;I=488;L=504;J=496;K=520;break}else if(k){J=I;K=L;x=49;break}P=d[(I&3)+(392+((L&3)<<2))>>0]|0;if((S|0)==8){G=I;H=L;P=(d[416+(N<<1)+M>>0]<<4)+P|0;I=496;L=8;J=488;K=24;break}else if((S|0)==16){G=I;H=L;P=(d[392+(N<<2)+M>>0]<<4)+P|0;I=8;L=8;J=24;K=24;break}else if((S|0)==4){G=I;H=L;I=408;L=8;J=408;K=24;break}else{G=I;H=L;P=(d[424+(N<<3)+M>>0]<<4)+P|0;I=40;L=8;J=104;K=24;break}}else{J=L;K=I;M=L>>2;N=I>>2;x=49}while(0);if((x|0)==49){G=J;H=K;P=d[536+(J<<3)+K>>0]|0;I=496;L=520;J=488;K=504}O=P+1|0;Q=P>>4;if((Q|0)>-1){P=(1<0;R=l?90:88;S=S+ -1>>2;W=T?27:0;U=(j|0)==2;T=W+3|0;V=(j|0)==3;Z=(k|0)==0?9:15;_=y?0:27;da=(F|0)==0;aa=y?42:43;fa=y?40:41;ba=y?2:0;ea=p+31244|0;ca=w&-17;ga=f+204|0;Y=((B|0)<0)<<31>>31;X=((A|0)<0)<<31>>31;ha=(F|0)!=0&(j|0)>2;k=(j|0)<4;ia=ia&255;ma=(y&1)<<1;ja=ma|1;ra=1;ka=Q;oa=0;xa=16;while(1){na=ka<<4;wa=a[I+ka>>0]|0;ta=wa&255;va=a[J+ka>>0]|0;ua=va&255;la=(ka|0)>0;if((ka|0)<(Q|0)&la){if((ta|0)<(P|0))pa=d[v+(ta+1<<3)+ua>>0]|0;else pa=0;if((ua|0)<(P|0))pa=(d[ua+1+(v+(ta<<3))>>0]|0)+pa|0;ya=c[t>>2]|0;ya=(_a(ya+224|0,ya+(((pa|0)>1?1:pa)+R)|0)|0)&255;a[v+(ta<<3)+ua>>0]=ya;qa=1}else{if(!((ta|0)==(M|0)&(ua|0)==(N|0)))if(!(wa<<24>>24))ya=va<<24>>24==0&1;else ya=0;else ya=1;a[v+(ta<<3)+ua>>0]=ya;qa=0}na=O-na|0;pa=(ka|0)==(Q|0);if(pa){a[u>>0]=na+255;sa=na+ -2|0;na=1}else{sa=15;na=0}if((ta|0)<(S|0))za=(a[v+(ta+1<<3)+ua>>0]|0)!=0&1;else za=0;if((ua|0)<(S|0))za=((a[ua+1+(v+(ta<<3))>>0]|0)!=0&1)<<1|za;do if(ya<<24>>24!=0&(sa|0)>-1){if(!(c[(c[n>>2]|0)+13100>>2]|0))if(U){wa=600;va=W}else x=73;else if(da){ya=(a[z>>0]|0)!=0;if(ya|U){wa=ya?664:600;va=ya?fa:W}else x=73}else{wa=664;va=fa}do if((x|0)==73){x=0;ya=(za<<4)+616|0;if(!y){wa=ya;va=W+(V?9:12)|0;break}va=(va|wa)<<24>>24==0?W:T;if(V){wa=ya;va=va+Z|0;break}else{wa=ya;va=va+21|0;break}}while(0);if((sa|0)>0){ya=va+92|0;do{Ma=c[t>>2]|0;if(_a(Ma+224|0,Ma+(ya+(d[wa+((d[K+sa>>0]<<2)+(d[L+sa>>0]|0))>>0]|0))|0)|0){a[u+(na&255)>>0]=sa;qa=0;na=na+1<<24>>24}sa=sa+ -1|0}while((sa|0)>0)}if(qa){a[u+(na&255)>>0]=0;qa=na+1<<24>>24;break}if(c[(c[n>>2]|0)+13100>>2]|0)if(da?(a[z>>0]|0)==0:0)x=87;else qa=aa;else x=87;if((x|0)==87){x=0;qa=(ka|0)==0?_:va+2|0}Ma=c[t>>2]|0;if((_a(Ma+224|0,Ma+(qa+92)|0)|0)==1){a[u+(na&255)>>0]=0;qa=na+1<<24>>24}else qa=na}else qa=na;while(0);na=qa&255;a:do if(qa<<24>>24){qa=la?ba:0;if(!(c[(c[n>>2]|0)+13116>>2]|0))Ea=0;else{if(da?(a[z>>0]|0)==0:0)oa=ma;else oa=ja;Ea=(d[p+oa+199>>0]|0)>>>2}sa=qa|(ra|0)==0&(pa^1)&1;Ba=a[u>>0]|0;va=Ba&255;qa=na>>>0>8?8:na;if(!qa){pa=-1;ra=1}else{ya=sa<<2;pa=-1;ra=1;wa=0;do{Ma=ra+ya|0;La=c[t>>2]|0;Ma=(_a(La+224|0,La+((l?Ma+16|0:Ma)+136)|0)|0)&255;a[s+wa>>0]=Ma;if(!(Ma<<24>>24))ra=((ra+ -1|0)>>>0<2&1)+ra|0;else{pa=(pa|0)==-1?wa:pa;ra=0}wa=wa+1|0}while((wa|0)<(qa|0))}wa=na+ -1|0;qa=a[u+wa>>0]|0;ya=qa&255;do if(!(a[z>>0]|0)){if((c[ea>>2]|0)==1?!((c[(c[n>>2]|0)+13104>>2]|0)==0|da|(ca|0)!=10):0){va=0;break}va=(va-ya|0)>3&1}else va=0;while(0);if((pa|0)!=-1){La=c[t>>2]|0;La=_a(La+224|0,La+((l?sa|4:sa)|160)|0)|0;Ma=s+pa|0;a[Ma>>0]=(d[Ma>>0]|0)+La}sa=(va|0)==0;if((a[(c[ga>>2]|0)+4>>0]|0)==0|sa){wa=0;va=0;do{va=ab((c[t>>2]|0)+224|0)|0|va<<1;wa=wa+1|0}while((wa|0)<(na|0));za=va<<16-na}else{va=wa&255;if(!((wa&255)<<24>>24))ya=0;else{wa=0;ya=0;do{ya=ab((c[t>>2]|0)+224|0)|0|ya<<1;wa=wa+1|0}while((wa|0)<(va|0))}za=ya<<17-na}ta=ta<<2;va=ua<<2;ua=p+oa+199|0;wa=0;Ga=0;Aa=xa;Da=0;while(1){xa=Ba&255;ya=(d[L+xa>>0]|0)+ta|0;xa=(d[K+xa>>0]|0)+va|0;b:do if((wa|0)<8){Ha=(d[s+wa>>0]|0)+1|0;Ma=(wa|0)==(pa|0);if((Ha|0)==((Ma?3:2)|0)&0==((Ma?0:0)|0))Ia=0;else{Ia=0;break}while(1){Ja=Ia+1|0;if(!(ab((c[t>>2]|0)+224|0)|0)){x=120;break}if((Ja|0)<31)Ia=Ja;else{x=124;break}}do if((x|0)==120){x=0;if((Ia|0)>=3){Ja=Ia;x=124;break}if((Ea|0)>0){Ja=0;La=0;do{La=ab((c[t>>2]|0)+224|0)|0|La<<1;Ja=Ja+1|0}while((Ja|0)!=(Ea|0))}else La=0;Ja=La+(Ia<0){La=Ea+ -3+Ja|0;Ja=0;Ma=0;do{Ma=ab((c[t>>2]|0)+224|0)|0|Ma<<1;Ja=Ja+1|0}while((Ja|0)!=(La|0))}else Ma=0;Ja=Ma+((1<>31|0,Ha|0,0)|0;Ia=D;La=3<>31;Ma=c[(c[n>>2]|0)+13116>>2]|0;do if((Ia|0)>(Na|0)|(Ia|0)==(Na|0)&Ha>>>0>La>>>0){La=Ea+1|0;if(Ma){Ea=La;break}Ea=(Ea|0)>3?4:La;break b}while(0);if(!((Ma|0)!=0&(Ga|0)==0))break;Ga=a[ua>>0]|0;La=(Ga&255)>>>2;if((Ja|0)>=(3<>0]=Ga+1<<24>>24;Ga=1;break}if((Ja<<1|0)>=(1<>24==0){Ga=1;break}a[ua>>0]=Ga+ -1<<24>>24;Ga=1}else{Ha=0;while(1){Ia=Ha+1|0;if(!(ab((c[t>>2]|0)+224|0)|0)){x=138;break}if((Ia|0)<31)Ha=Ia;else{x=142;break}}do if((x|0)==138){x=0;if((Ha|0)>=3){Ia=Ha;x=142;break}if((Ea|0)>0){Ia=0;Ja=0;do{Ja=ab((c[t>>2]|0)+224|0)|0|Ja<<1;Ia=Ia+1|0}while((Ia|0)!=(Ea|0))}else Ja=0;Ja=Ja+(Ha<0){Ja=Ea+ -3+Ia|0;Ia=0;La=0;do{La=ab((c[t>>2]|0)+224|0)|0|La<<1;Ia=Ia+1|0}while((Ia|0)!=(Ja|0))}else La=0;Ja=La+((1<>31;Ma=c[(c[n>>2]|0)+13116>>2]|0;do if((Ja|0)>=(3<3?4:La;break b}while(0);if(!((Ma|0)!=0&(Ga|0)==0))break;La=a[ua>>0]|0;Ga=(La&255)>>>2;if((Ja|0)>=(3<>0]=La+1<<24>>24;Ga=1;break}if((Ja<<1|0)>=(1<>24==0){Ga=1;break}a[ua>>0]=La+ -1<<24>>24;Ga=1}while(0);do if(!((a[(c[ga>>2]|0)+4>>0]|0)==0|sa)){Da=$d(Ha|0,Ia|0,Da|0,0)|0;if(Ba<<24>>24!=qa<<24>>24)break;Na=(Da&1|0)==0;Ma=_d(0,0,Ha|0,Ia|0)|0;Ha=Na?Ha:Ma;Ia=Na?Ia:D}while(0);Na=(za&32768|0)==0;Ba=_d(0,0,Ha|0,Ia|0)|0;Ba=Na?Ha:Ba;Ha=Na?Ia:D;za=za<<1&131070;Ia=Ba&65535;do if(!(a[z>>0]|0)){do if(!((a[(c[n>>2]|0)+634>>0]|0)==0|ha)){if(!((xa|ya|0)!=0|k)){Aa=ia;break}if((j|0)==3)Aa=(xa<<3)+ya|0;else if((j|0)==4)Aa=(xa>>>1<<3)+(ya>>>1)|0;else if((j|0)==5)Aa=(xa>>>2<<3)+(ya>>>2)|0;else Aa=(xa<<2)+ya|0;Aa=d[C+Aa>>0]|0}while(0);Ba=je(Ba|0,Ha|0,B|0,Y|0)|0;Ba=je(Ba|0,D|0,Aa|0,((Aa|0)<0)<<31>>31|0)|0;Ba=$d(Ba|0,D|0,A|0,X|0)|0;Ba=Zd(Ba|0,D|0,E|0)|0;Ha=D;if((Ha|0)<0){Ia=(Ba&-32768|0)==-32768&(Ha&268435455|0)==268435455?Ba&65535:-32768;break}else{Ia=Ha>>>0>0|(Ha|0)==0&Ba>>>0>32767?32767:Ba&65535;break}}while(0);b[q+((xa<>1]=Ia;wa=wa+1|0;if((wa|0)>=(na|0)){xa=Aa;break a}Ba=a[u+wa>>0]|0}}while(0);if(la)ka=ka+ -1|0;else break}}do if(a[z>>0]|0){if((c[(c[n>>2]|0)+13104>>2]|0)!=0?(w&-17|0)==10:0)Fa[c[f+2632>>2]&7](q,j&65535,(w|0)==26&1)}else{if(F){s=c[n>>2]|0;if((c[s+13096>>2]|0)!=0&(j|0)==2?(c[p+31244>>2]|0)==1:0){t=0;do{La=q+(15-t<<1)|0;Ma=b[La>>1]|0;Na=q+(t<<1)|0;b[La>>1]=b[Na>>1]|0;b[Na>>1]=Ma;t=t+1|0}while((t|0)!=8)}t=j&65535;Fa[c[f+2628>>2]&7](q,t,c[s+52>>2]|0);if(!(c[(c[n>>2]|0)+13104>>2]|0))break;if((c[p+31244>>2]|0)!=1)break;if((w&-17|0)!=10)break;Fa[c[f+2632>>2]&7](q,t,(w|0)==26&1);break}if(y&(c[p+31244>>2]|0)==1&(j|0)==2){Ca[c[f+2636>>2]&7](q,c[(c[n>>2]|0)+52>>2]|0);break}s=(G|0)>(H|0)?G:H;if(!s){Ca[c[f+(j+ -2<<2)+2656>>2]&7](q,c[(c[n>>2]|0)+52>>2]|0);break}t=H+4+G|0;do if((s|0)>=4){if((s|0)<8){t=(t|0)<8?t:8;break}if((s|0)<12)t=(t|0)<24?t:24}else t=(t|0)<4?t:4;while(0);Fa[c[f+(j+ -2<<2)+2640>>2]&7](q,t,c[(c[n>>2]|0)+52>>2]|0)}while(0);if(!(a[p+304>>0]|0)){Ma=j+ -2|0;Ma=f+(Ma<<2)+2612|0;Ma=c[Ma>>2]|0;Na=c[n>>2]|0;Na=Na+52|0;Na=c[Na>>2]|0;Ka[Ma&7](g,q,m,Na);i=o;return}if((r|0)<=0){Ma=j+ -2|0;Ma=f+(Ma<<2)+2612|0;Ma=c[Ma>>2]|0;Na=c[n>>2]|0;Na=Na+52|0;Na=c[Na>>2]|0;Ka[Ma&7](g,q,m,Na);i=o;return}p=c[p+284>>2]|0;s=0;do{Na=q+(s<<1)|0;b[Na>>1]=(($(b[h+(s<<1)>>1]|0,p)|0)>>>3)+(e[Na>>1]|0);s=s+1|0}while((s|0)!=(r|0));Ma=j+ -2|0;Ma=f+(Ma<<2)+2612|0;Ma=c[Ma>>2]|0;Na=c[n>>2]|0;Na=Na+52|0;Na=c[Na>>2]|0;Ka[Ma&7](g,q,m,Na);i=o;return}function yb(a){a=a|0;var b=0,e=0,f=0;b=i;f=a+16|0;e=c[f>>2]|0;c[a>>2]=(c[a>>2]|0)+ -65535+((d[e+1>>0]|0)<<1|(d[e>>0]|0)<<9);if(e>>>0>=(c[a+20>>2]|0)>>>0){i=b;return}c[f>>2]=e+2;i=b;return}function zb(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;f=i;h=b+136|0;n=c[h>>2]|0;g=b+200|0;j=c[g>>2]|0;m=c[j+13080>>2]|0;q=(1<>2]|0)+24>>2]|0);o=m&d;p=m&e;k=c[j+13140>>2]|0;j=c[j+13064>>2]|0;l=o>>j;j=p>>j;if(!(q&d))o=0;else o=(o&q|0)!=0;if(!(q&e))p=0;else p=(p&q|0)!=0;q=n+203|0;if((a[q>>0]|0)==0?(m&(e|d)|0)!=0:0)d=c[n+276>>2]|0;else{a[q>>0]=(a[n+300>>0]|0)==0&1;d=a[b+2112>>0]|0}if(o){e=l+ -1+($(j,k)|0)|0;e=a[(c[b+4316>>2]|0)+e>>0]|0}else e=d;if(p){d=($(j+ -1|0,k)|0)+l|0;d=a[(c[b+4316>>2]|0)+d>>0]|0}b=e+1+d>>1;h=c[h>>2]|0;j=c[h+280>>2]|0;if(!j){a[h+272>>0]=b;i=f;return}g=c[(c[g>>2]|0)+13192>>2]|0;b=j+52+b+(g<<1)|0;if((b|0)>0)j=b;else j=-52-g+1+b|0;a[h+272>>0]=b-g-j+((j|0)%(g+52|0)|0);i=f;return}function Ab(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;g=i;j=c[b+136>>2]|0;k=b+200|0;do if((e|0)>0&(e&7|0)==0){if(((a[b+2062>>0]|0)==0?(c[j+31312>>2]&4|0)!=0:0)?((e|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0)break;if(((a[(c[b+204>>2]|0)+53>>0]|0)==0?(c[j+31312>>2]&8|0)!=0:0)?((e|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0)break;h=1<0){l=b+2596|0;m=b+4320|0;n=0;do{o=n+d+($(c[l>>2]|0,e)|0)>>2;a[(c[m>>2]|0)+o>>0]=2;n=n+4|0}while((n|0)<(h|0))}}while(0);if(!((d|0)>0&(d&7|0)==0)){i=g;return}if(((a[b+2062>>0]|0)==0?(c[j+31312>>2]&1|0)!=0:0)?((d|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0){i=g;return}if(((a[(c[b+204>>2]|0)+53>>0]|0)==0?(c[j+31312>>2]&2|0)!=0:0)?((d|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0){i=g;return}h=1<>2]|0,k+e|0)|0)+d>>2;a[(c[b>>2]|0)+o>>0]=2;k=k+4|0}while((k|0)<(h|0));i=g;return}function Bb(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var 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,aa=0,ba=0,ca=0,da=0,ea=0;j=i;i=i+32|0;o=j+8|0;x=j;n=j+18|0;s=j+16|0;l=e+200|0;K=c[l>>2]|0;v=c[K+13120>>2]|0;k=(v-h|0)<=(f|0);b[n>>1]=0;b[s>>1]=0;w=c[K+13080>>2]|0;u=1<>w,c[K+13128>>2]|0)|0)+(f>>w)|0;t=c[e+2508>>2]|0;m=c[t+(w<<3)+4>>2]|0;y=c[t+(w<<3)>>2]|0;if((c[K+68>>2]|0)!=0?(a[K+13056>>0]|0)!=0:0)p=1;else p=(a[(c[e+204>>2]|0)+40>>0]|0)!=0;r=c[K+52>>2]|0;q=(f|0)!=0;if(q){w=w+ -1|0;z=c[t+(w<<3)>>2]|0;w=c[t+(w<<3)+4>>2]|0}else{z=0;w=0}t=u+f|0;t=(t|0)>(v|0)?v:t;u=u+g|0;A=c[K+13124>>2]|0;u=(u|0)>(A|0)?A:u;A=(t|0)==(v|0)?t:t+ -8|0;v=(u|0)>(g|0);if(v){K=q?f:8;N=(K|0)<(t|0);Q=q?f+ -8|0:0;F=e+2596|0;P=e+4320|0;I=e+4316|0;C=x+4|0;D=e+160|0;E=n+1|0;R=s+1|0;L=e+4300|0;M=e+4284|0;J=e+4324|0;G=e+4304|0;H=e+4288|0;B=(Q|0)>=(A|0);U=y;T=m;O=g;do{if(N){W=O+4|0;X=T+ -2&-2;V=K;do{_=c[F>>2]|0;da=($(_,O)|0)+V>>2;aa=c[J>>2]|0;da=a[aa+da>>0]|0;ca=da&255;_=a[aa+(($(_,W)|0)+V>>2)>>0]|0;aa=_&255;da=da<<24>>24!=0;_=_<<24>>24==0;do if(!(_&(da^1))){S=V+ -1|0;Y=c[l>>2]|0;ba=c[Y+13064>>2]|0;Z=$(O>>ba,c[Y+13140>>2]|0)|0;ea=c[I>>2]|0;ba=(a[ea+(Z+(S>>ba))>>0]|0)+1+(a[ea+(Z+(V>>ba))>>0]|0)>>1;Z=ba+U|0;if((Z|0)<0)Z=0;else Z=(Z|0)>51?51:Z;Z=d[1280+Z>>0]|0;if(da){ca=(ca<<1)+X+ba|0;if((ca|0)<0)ca=0;else ca=(ca|0)>53?53:ca;ca=d[1336+ca>>0]|0}else ca=0;c[x>>2]=ca;if(_)_=0;else{_=(aa<<1)+X+ba|0;if((_|0)<0)_=0;else _=(_|0)>53?53:_;_=d[1336+_>>0]|0}c[C>>2]=_;da=c[D>>2]|0;_=c[da+32>>2]|0;ea=$(_,O)|0;Y=(c[da>>2]|0)+((V<>2])+ea)|0;if(p){a[n>>0]=Gb(e,S,O)|0;a[E>>0]=Gb(e,S,W)|0;a[s>>0]=Gb(e,V,O)|0;a[R>>0]=Gb(e,V,W)|0;za[c[G>>2]&7](Y,_,Z,x,n,s,r);break}else{za[c[H>>2]&7](Y,_,Z,x,n,s,r);break}}while(0);V=V+8|0}while((V|0)<(t|0))}if(!((O|0)==0|B)){S=O+ -1|0;W=T;T=Q;do{Z=$(c[F>>2]|0,O)|0;_=c[P>>2]|0;ba=a[_+(Z+T>>2)>>0]|0;ca=ba&255;V=T+4|0;Z=a[_+(Z+V>>2)>>0]|0;_=Z&255;ba=ba<<24>>24!=0;Z=Z<<24>>24==0;do if(!(Z&(ba^1))){X=c[l>>2]|0;W=c[X+13064>>2]|0;aa=T>>W;U=c[X+13140>>2]|0;ea=($(S>>W,U)|0)+aa|0;Y=c[I>>2]|0;aa=(a[Y+ea>>0]|0)+1+(a[Y+(($(O>>W,U)|0)+aa)>>0]|0)>>1;U=(T|0)>=(f|0);W=U?m:w;U=U?y:z;Y=aa+U|0;if((Y|0)<0)Y=0;else Y=(Y|0)>51?51:Y;Y=d[1280+Y>>0]|0;if(ba){ba=(ca<<1)+(W+ -2&-2)+aa|0;if((ba|0)<0)ba=0;else ba=(ba|0)>53?53:ba;ba=d[1336+ba>>0]|0}else ba=0;c[x>>2]=ba;if(Z)Z=0;else{Z=(_<<1)+(W+ -2&-2)+aa|0;if((Z|0)<0)Z=0;else Z=(Z|0)>53?53:Z;Z=d[1336+Z>>0]|0}c[C>>2]=Z;da=c[D>>2]|0;Z=c[da+32>>2]|0;ea=$(Z,O)|0;X=(c[da>>2]|0)+((T<>2])+ea)|0;if(p){a[n>>0]=Gb(e,T,S)|0;a[E>>0]=Gb(e,V,S)|0;a[s>>0]=Gb(e,T,O)|0;a[R>>0]=Gb(e,V,O)|0;za[c[L>>2]&7](X,Z,Y,x,n,s,r);break}else{za[c[M>>2]&7](X,Z,Y,x,n,s,r);break}}while(0);T=T+8|0}while((T|0)<(A|0));T=W}O=O+8|0}while((O|0)<(u|0));K=c[l>>2]|0}else T=m;if(c[K+4>>2]|0){D=q?w:m;G=e+2596|0;F=e+4320|0;w=e+4316|0;y=o+4|0;x=e+160|0;C=n+1|0;B=s+1|0;E=e+4308|0;H=e+4292|0;I=e+4324|0;A=e+4312|0;z=e+4296|0;J=1;do{P=1<>2];Q=1<>2];if(v){O=P<<3;M=q?f:O;L=(M|0)<(t|0);K=Q<<3;N=q?f-O|0:0;P=P<<2;Q=Q<<2;R=g;do{if(L){S=R+Q|0;U=M;do{X=c[G>>2]|0;Z=($(X,R)|0)+U>>2;ea=c[I>>2]|0;Z=(a[ea+Z>>0]|0)==2;X=(a[ea+(($(X,S)|0)+U>>2)>>0]|0)==2;do if(Z|X){V=U+ -1|0;W=c[l>>2]|0;ea=c[W+13064>>2]|0;_=V>>ea;Y=c[W+13140>>2]|0;ba=$(R>>ea,Y)|0;aa=c[w>>2]|0;ca=U>>ea;Y=$(S>>ea,Y)|0;Y=(a[aa+(Y+_)>>0]|0)+1+(a[aa+(Y+ca)>>0]|0)>>1;if(Z)Z=Hb(e,(a[aa+(ba+ca)>>0]|0)+1+(a[aa+(ba+_)>>0]|0)>>1,J,T)|0;else Z=0;c[o>>2]=Z;if(X)X=Hb(e,Y,J,T)|0;else X=0;c[y>>2]=X;da=c[x>>2]|0;X=c[da+(J<<2)+32>>2]|0;ea=$(X,R>>c[W+(J<<2)+13180>>2])|0;W=(c[da+(J<<2)>>2]|0)+((U>>c[W+(J<<2)+13168>>2]<>2])+ea)|0;if(p){a[n>>0]=Gb(e,V,R)|0;a[C>>0]=Gb(e,V,S)|0;a[s>>0]=Gb(e,U,R)|0;a[B>>0]=Gb(e,U,S)|0;Ha[c[A>>2]&3](W,X,o,n,s,r);break}else{Ha[c[z>>2]&3](W,X,o,n,s,r);break}}while(0);U=U+O|0}while((U|0)<(t|0))}if(R){V=t-((t|0)==(c[(c[l>>2]|0)+13120>>2]|0)?0:O)|0;if((N|0)<(V|0)){U=R+ -1|0;T=N;do{X=$(c[G>>2]|0,R)|0;ea=c[F>>2]|0;S=T+P|0;Y=(a[ea+(X+T>>2)>>0]|0)==2;X=(a[ea+(X+S>>2)>>0]|0)==2;do if(Y|X){if(Y){ea=c[l>>2]|0;da=c[ea+13064>>2]|0;Z=T>>da;ea=c[ea+13140>>2]|0;ba=($(U>>da,ea)|0)+Z|0;ca=c[w>>2]|0;Z=(a[ca+ba>>0]|0)+1+(a[ca+(($(R>>da,ea)|0)+Z)>>0]|0)>>1}else Z=0;if(X){ea=c[l>>2]|0;da=c[ea+13064>>2]|0;W=S>>da;ea=c[ea+13140>>2]|0;ba=($(U>>da,ea)|0)+W|0;ca=c[w>>2]|0;W=(a[ca+ba>>0]|0)+1+(a[ca+(($(R>>da,ea)|0)+W)>>0]|0)>>1}else W=0;if(Y)Y=Hb(e,Z,J,D)|0;else Y=0;c[o>>2]=Y;if(X)W=Hb(e,W,J,m)|0;else W=0;c[y>>2]=W;ea=c[l>>2]|0;da=c[x>>2]|0;X=c[da+(J<<2)+32>>2]|0;W=$(X,R>>c[ea+13184>>2])|0;W=(c[da+(J<<2)>>2]|0)+((T>>c[ea+13172>>2]<>2])+W)|0;if(p){a[n>>0]=Gb(e,T,U)|0;a[C>>0]=Gb(e,S,U)|0;a[s>>0]=Gb(e,T,R)|0;a[B>>0]=Gb(e,S,R)|0;Ha[c[E>>2]&3](W,X,o,n,s,r);break}else{Ha[c[H>>2]&3](W,X,o,n,s,r);break}}while(0);T=T+O|0}while((T|0)<(V|0));T=D}else T=D}R=R+K|0}while((R|0)<(u|0))}J=J+1|0;K=c[l>>2]|0}while((J|0)!=3)}if(!(a[K+12941>>0]|0)){if((a[e+140>>0]&1)==0|k^1){i=j;return}i=j;return}n=(c[K+13124>>2]|0)-h|0;l=(g|0)==0;m=(f|0)==0;if(!(l|m))Cb(e,f-h|0,g-h|0);n=(n|0)>(g|0);if(!(m|n))Cb(e,f-h|0,g);k=k^1;!(l|k)?(Cb(e,f,g-h|0),(a[e+140>>0]&1)!=0):0;if(n|k){i=j;return}Cb(e,f,g);if(!(a[e+140>>0]&1)){i=j;return}i=j;return}function Cb(e,f,g){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,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;v=i;i=i+48|0;j=v+24|0;h=v+42|0;u=v+40|0;r=v+16|0;n=v+8|0;m=v;k=e+200|0;S=c[k>>2]|0;s=c[S+13080>>2]|0;q=f>>s;s=g>>s;D=S+13128|0;p=($(s,c[D>>2]|0)|0)+q|0;L=c[e+204>>2]|0;N=L+1668|0;M=c[(c[N>>2]|0)+(p<<2)>>2]|0;l=e+2504|0;o=c[l>>2]|0;t=o+(p*148|0)|0;b[h>>1]=0;b[u>>1]=0;c[r>>2]=0;E=($(c[D>>2]|0,s)|0)+q|0;E=a[(c[e+4352>>2]|0)+E>>0]|0;if((a[L+42>>0]|0)!=0?(a[L+53>>0]|0)==0:0){R=1;O=1}else{R=E<<24>>24==0&1;O=0}G=(q|0)==0;c[j>>2]=G&1;I=(s|0)==0;A=j+4|0;c[A>>2]=I&1;H=(q|0)==((c[D>>2]|0)+ -1|0);z=j+8|0;c[z>>2]=H&1;F=(s|0)==((c[S+13132>>2]|0)+ -1|0);w=j+12|0;c[w>>2]=F&1;if(R<<24>>24){if(G)J=0;else{if(O){J=c[L+1676>>2]|0;J=(c[J+(M<<2)>>2]|0)!=(c[J+(c[(c[N>>2]|0)+(p+ -1<<2)>>2]<<2)>>2]|0)&1}else J=0;if(E<<24>>24==0?(pa=$(c[D>>2]|0,s)|0,oa=c[e+4328>>2]|0,(c[oa+(pa+q<<2)>>2]|0)!=(c[oa+(q+ -1+pa<<2)>>2]|0)):0)K=1;else K=J;a[h>>0]=K}if(H)K=0;else{if(O){K=c[L+1676>>2]|0;K=(c[K+(M<<2)>>2]|0)!=(c[K+(c[(c[N>>2]|0)+(p+1<<2)>>2]<<2)>>2]|0)&1}else K=0;if(E<<24>>24==0?(pa=$(c[D>>2]|0,s)|0,oa=c[e+4328>>2]|0,(c[oa+(pa+q<<2)>>2]|0)!=(c[oa+(q+1+pa<<2)>>2]|0)):0)P=1;else P=K;a[h+1>>0]=P}if(I)P=0;else{if(O){P=c[L+1676>>2]|0;P=(c[P+(M<<2)>>2]|0)!=(c[P+(c[(c[N>>2]|0)+(p-(c[D>>2]|0)<<2)>>2]<<2)>>2]|0)&1}else P=0;if(E<<24>>24==0?(pa=c[D>>2]|0,na=($(pa,s)|0)+q|0,oa=c[e+4328>>2]|0,(c[oa+(na<<2)>>2]|0)!=(c[oa+(($(pa,s+ -1|0)|0)+q<<2)>>2]|0)):0)Q=1;else Q=P;a[u>>0]=Q}if(F)L=0;else{if(O){L=c[L+1676>>2]|0;L=(c[L+(M<<2)>>2]|0)!=(c[L+(c[(c[N>>2]|0)+((c[D>>2]|0)+p<<2)>>2]<<2)>>2]|0)&1}else L=0;if(E<<24>>24==0?(pa=c[D>>2]|0,na=($(pa,s)|0)+q|0,oa=c[e+4328>>2]|0,(c[oa+(na<<2)>>2]|0)!=(c[oa+(($(pa,s+1|0)|0)+q<<2)>>2]|0)):0)M=1;else M=L;a[u+1>>0]=M}if(!G)if(I)B=47;else{if(!(E<<24>>24)){pa=c[D>>2]|0;na=($(pa,s)|0)+q|0;oa=c[e+4328>>2]|0;if(J<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(q+ -1+($(pa,s+ -1|0)|0)<<2)>>2]|0):0)B=38;else M=1}else if(!(J<<24>>24))B=38;else M=1;if((B|0)==38)M=P<<24>>24!=0&1;a[r>>0]=M;B=40}else B=40;if((B|0)==40)if(!I){if(!H){if(!(E<<24>>24)){pa=c[D>>2]|0;na=($(pa,s)|0)+q|0;oa=c[e+4328>>2]|0;if(K<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(q+1+($(pa,s+ -1|0)|0)<<2)>>2]|0):0)B=45;else I=1}else if(!(K<<24>>24))B=45;else I=1;if((B|0)==45)I=P<<24>>24!=0&1;a[r+1>>0]=I;B=47}}else B=47;if((B|0)==47?!(H|F):0){if(!(E<<24>>24)){pa=c[D>>2]|0;na=($(pa,s)|0)+q|0;oa=c[e+4328>>2]|0;if(K<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(q+1+($(pa,s+1|0)|0)<<2)>>2]|0):0)B=51;else H=1}else if(!(K<<24>>24))B=51;else H=1;if((B|0)==51)H=L<<24>>24!=0&1;a[r+2>>0]=H}if(!(G|F)){if(!(E<<24>>24)){pa=c[D>>2]|0;na=($(pa,s)|0)+q|0;oa=c[e+4328>>2]|0;if(J<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(q+ -1+($(pa,s+1|0)|0)<<2)>>2]|0):0)B=57;else D=1}else if(!(J<<24>>24))B=57;else D=1;if((B|0)==57)D=L<<24>>24!=0&1;a[r+3>>0]=D}}O=(c[S+4>>2]|0)!=0?3:1;I=e+160|0;H=e+168|0;P=e+2672|0;J=s<<1;G=J+ -1|0;D=n+4|0;E=s+ -1|0;Q=q+1|0;L=q+ -1|0;J=J+2|0;F=m+4|0;K=s+1|0;N=q<<1;M=N+ -1|0;N=N+2|0;R=e+((R&255)<<2)+2676|0;na=S;Y=0;while(1){ka=c[na+(Y<<2)+13168>>2]|0;_=f>>ka;ha=c[na+(Y<<2)+13180>>2]|0;Z=g>>ha;ba=c[I>>2]|0;S=c[ba+(Y<<2)+32>>2]|0;U=1<>2];X=U>>ka;W=U>>ha;ka=c[na+13120>>2]>>ka;ca=ka-_|0;X=(X|0)>(ca|0)?ca:X;ha=c[na+13124>>2]>>ha;ca=ha-Z|0;W=(W|0)>(ca|0)?ca:W;ca=$(S,Z)|0;ga=c[na+56>>2]|0;ca=(_<>2]|0;aa=ba+ca|0;U=U+2<>2]|0;fa=1<>0]|0;if((ia|0)==1){ea=X<0){da=V;ba=0;ca=aa;while(1){ee(da|0,ca|0,ea|0)|0;ba=ba+1|0;if((ba|0)==(W|0))break;else{da=da+U|0;ca=ca+S|0}}}Eb(e,aa,S,_,Z,X,W,Y,q,s);ya[c[P>>2]&1](aa,V,S,U,t,j,X,W,Y,c[(c[k>>2]|0)+52>>2]|0);Fb(e,aa,V,S,U,f,g,X,W,Y);a[T>>0]=3}else if((ia|0)==2){ja=c[j>>2]|0;ia=c[z>>2]|0;la=c[w>>2]|0;do if(!(c[A>>2]|0)){pa=1-ja|0;oa=pa<>2]=ba+(ca-S-oa);c[D>>2]=(c[e+(Y<<2)+172>>2]|0)+(($(ka,G)|0)+_-pa<>2]|0,E)|0)|0;pa=c[n+(((a[(c[l>>2]|0)+(pa*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0;if(!ga){a[oa>>0]=a[pa>>0]|0;na=c[k>>2]|0;oa=fa;break}else{b[oa>>1]=b[pa>>1]|0;oa=fa;break}}else oa=0;while(0);pa=($(c[na+13128>>2]|0,E)|0)+q|0;na=X<>2]|0)+(pa*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0)+oa|0,na|0)|0;if((ia|0)!=1){na=oa+na|0;pa=Q+($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)|0;ma=da+(na+ma)|0;na=(c[n+(((a[(c[l>>2]|0)+(pa*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0)+na|0;if(!ga){a[ma>>0]=a[na>>0]|0;break}else{b[ma>>1]=b[na>>1]|0;break}}}while(0);do if(!la){pa=1-ja|0;oa=pa<>2]=ba+(($(W,S)|0)+ca-oa);c[F>>2]=(c[e+(Y<<2)+172>>2]|0)+(($(ka,J)|0)+_-pa<>2]|0)+13128>>2]|0,K)|0)|0;ma=c[m+(((a[(c[l>>2]|0)+(ma*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0;if(!ga){a[ka>>0]=a[ma>>0]|0;ka=fa;break}else{b[ka>>1]=b[ma>>1]|0;ka=fa;break}}else ka=0;while(0);pa=($(c[(c[k>>2]|0)+13128>>2]|0,K)|0)+q|0;ma=X<>2]|0)+(pa*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0)+ka|0,ma|0)|0;if((ia|0)!=1){ka=ka+ma|0;pa=Q+($(c[(c[k>>2]|0)+13128>>2]|0,K)|0)|0;la=da+(ka+la)|0;ka=(c[m+(((a[(c[l>>2]|0)+(pa*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0)+ka|0;if(!ga){a[la>>0]=a[ka>>0]|0;break}else{b[la>>1]=b[ka>>1]|0;break}}}while(0);do if(!ja){pa=L+($(c[(c[k>>2]|0)+13128>>2]|0,s)|0)|0;if((a[(c[l>>2]|0)+(pa*148|0)+Y+142>>0]|0)==3){la=da+U|0;ja=(c[e+(Y<<2)+184>>2]|0)+(($(ha,M)|0)+Z<0;if(!ga){if(ka)ka=0;else{ja=0;break}while(1){a[la>>0]=a[ja>>0]|0;ka=ka+1|0;if((ka|0)==(W|0)){ja=0;break}else{la=la+U|0;ja=ja+fa|0}}}else{if(ka)ka=0;else{ja=0;break}while(1){b[la>>1]=b[ja>>1]|0;ka=ka+1|0;if((ka|0)==(W|0)){ja=0;break}else{la=la+U|0;ja=ja+fa|0}}}}else ja=1}else ja=0;while(0);do if(!ia){pa=Q+($(c[(c[k>>2]|0)+13128>>2]|0,s)|0)|0;if((a[(c[l>>2]|0)+(pa*148|0)+Y+142>>0]|0)==3){ia=da+((X<>2]|0)+(($(ha,N)|0)+Z<0;if(!ga){if(ka)B=0;else break;while(1){a[ia>>0]=a[ha>>0]|0;B=B+1|0;if((B|0)==(W|0)){C=0;B=96;break}else{ia=ia+U|0;ha=ha+fa|0}}}else{if(ka)B=0;else break;while(1){b[ia>>1]=b[ha>>1]|0;B=B+1|0;if((B|0)==(W|0)){C=0;B=96;break}else{ia=ia+U|0;ha=ha+fa|0}}}}else{C=1;B=96}}else{C=0;B=96}while(0);if((B|0)==96?(B=0,x=ja<0):0){ea=da+(ea-x)|0;da=0;ba=ba+(ca-x)|0;while(1){ee(ea|0,ba|0,y|0)|0;da=da+1|0;if((da|0)==(W|0))break;else{ea=ea+U|0;ba=ba+S|0}}}Eb(e,aa,S,_,Z,X,W,Y,q,s);Aa[c[R>>2]&3](aa,V,S,U,t,j,X,W,Y,h,u,r,c[(c[k>>2]|0)+52>>2]|0);Fb(e,aa,V,S,U,f,g,X,W,Y);a[T>>0]=3}Y=Y+1|0;if((Y|0)>=(O|0))break;na=c[k>>2]|0}i=v;return}function Db(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;h=c[a+200>>2]|0;k=((c[h+13120>>2]|0)-e|0)>(b|0);h=((c[h+13124>>2]|0)-e|0)>(d|0);j=(d|0)==0;g=(b|0)==0;if(!(j|g))Bb(a,b-e|0,d-e|0,e);if(!(j|k))Bb(a,b,d-e|0,e);if(g|h){i=f;return}Bb(a,b-e|0,d,e);i=f;return}function Eb(d,e,f,g,h,j,k,l,m,n){d=d|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;n=n|0;var o=0,p=0,q=0,r=0,s=0,t=0,u=0;o=i;q=c[d+200>>2]|0;p=c[q+56>>2]|0;s=c[q+13120>>2]>>c[q+(l<<2)+13168>>2];q=c[q+13124>>2]>>c[q+(l<<2)+13180>>2];u=d+(l<<2)+172|0;t=n<<1;r=j<>2]|0)+(($(s,t)|0)+g<>2]|0)+(($(s,t|1)|0)+g<>2]|0;l=m<<1;t=r+(($(q,l)|0)+h<0;if(n){if(g){r=t;t=0;s=e;while(1){a[r>>0]=a[s>>0]|0;t=t+1|0;if((t|0)==(k|0))break;else{r=r+m|0;s=s+f|0}}r=c[d>>2]|0}}else if(g){d=0;s=e;while(1){b[t>>1]=b[s>>1]|0;d=d+1|0;if((d|0)==(k|0))break;else{t=t+m|0;s=s+f|0}}}h=r+(($(q,l|1)|0)+h<>0]=a[j>>0]|0;p=p+1|0;if((p|0)==(k|0))break;else{h=h+m|0;j=j+f|0}}i=o;return}else{if(g)p=0;else{i=o;return}while(1){b[h>>1]=b[j>>1]|0;p=p+1|0;if((p|0)==(k|0))break;else{h=h+m|0;j=j+f|0}}i=o;return}}function Fb(b,d,e,f,g,h,j,k,l,m){b=b|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;m=m|0;var 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;n=i;t=c[b+200>>2]|0;if(!(a[(c[b+204>>2]|0)+40>>0]|0)){if(!(a[t+13056>>0]|0)){i=n;return}if(!(c[t+68>>2]|0)){i=n;return}}p=b+200|0;C=c[t+13084>>2]|0;v=1<>2]|0;s=c[t+(m<<2)+13180>>2]|0;m=h>>C;z=j>>C;k=k+h>>C;l=l+j>>C;t=v>>o<>2];if((z|0)>=(l|0)){i=n;return}u=(m|0)<(k|0);b=b+4348|0;v=v>>s;w=(v|0)>0;do{if(u){x=z-j|0;y=m;do{A=c[p>>2]|0;C=($(c[A+13156>>2]|0,z)|0)+y|0;if((a[(c[b>>2]|0)+C>>0]|0)!=0?(r=c[A+13084>>2]|0,q=x<>s,r=y-h<>o<>2],w):0){C=e+(($(q,g)|0)+r)|0;A=0;B=d+(($(q,f)|0)+r)|0;while(1){ee(B|0,C|0,t|0)|0;A=A+1|0;if((A|0)==(v|0))break;else{C=C+g|0;B=B+f|0}}}y=y+1|0}while((y|0)!=(k|0))}z=z+1|0}while((z|0)!=(l|0));i=n;return}function Gb(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;f=i;g=c[a+200>>2]|0;h=c[g+13084>>2]|0;if((e|b|0)<0){e=2;i=f;return e|0}b=b>>h;e=e>>h;h=c[g+13156>>2]|0;if((b|0)>=(h|0)){e=2;i=f;return e|0}if((e|0)>=(c[g+13160>>2]|0)){e=2;i=f;return e|0}e=($(h,e)|0)+b|0;e=d[(c[a+4348>>2]|0)+e>>0]|0;i=f;return e|0}function Hb(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0;h=i;j=c[b+204>>2]|0;e=(c[((f|0)==1?j+28|0:j+32|0)>>2]|0)+e|0;if((e|0)<0)e=0;else e=(e|0)>57?57:e;do if((c[(c[b+200>>2]|0)+4>>2]|0)==1){if((e|0)>=30)if((e|0)>43){e=e+ -6|0;break}else{e=d[1392+(e+ -30)>>0]|0;break}}else if((e|0)<0)e=0;else e=(e|0)>51?51:e;while(0);g=g+2+e|0;if((g|0)<0){j=0;j=1336+j|0;j=a[j>>0]|0;j=j&255;i=h;return j|0}j=(g|0)>53?53:g;j=1336+j|0;j=a[j>>0]|0;j=j&255;i=h;return j|0}function Ib(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;g=i;k=b+4376|0;c[k>>2]=0;a:do if((e|0)>1){m=0;while(1){if(!(a[d+m>>0]|0)){if((m|0)>0){l=m+ -1|0;l=(a[d+l>>0]|0)==0?l:m}else l=m;m=l+2|0;if(((m|0)<(e|0)?(a[d+(l+1)>>0]|0)==0:0)?(j=a[d+m>>0]|0,(j&255)<4):0)break}else l=m;m=l+2|0;if((l+3|0)>=(e|0))break a}m=l;e=j<<24>>24==3?e:l}else m=0;while(0);if((m|0)>=(e+ -1|0)){c[f+12>>2]=d;c[f+8>>2]=e;q=e;i=g;return q|0}nd(f,f+4|0,e+32|0);j=c[f>>2]|0;if(!j){q=-12;i=g;return q|0}ee(j|0,d|0,m|0)|0;o=m+2|0;b:do if((o|0)<(e|0)){l=b+4384|0;b=b+4380|0;n=m;c:while(1){p=d+o|0;q=a[p>>0]|0;do if((q&255)<=3){p=a[d+m>>0]|0;if(!(p<<24>>24))if(!(a[d+(m+1)>>0]|0)){if(q<<24>>24!=3){e=m;break b}o=n+1|0;a[j+n>>0]=0;n=n+2|0;a[j+o>>0]=0;m=m+3|0;q=(c[k>>2]|0)+1|0;c[k>>2]=q;p=c[l>>2]|0;if((p|0)<(q|0)){p=p<<1;c[l>>2]=p;ld(b,p,4)|0;p=c[b>>2]|0;if(!p){f=-12;break c}}else{p=c[b>>2]|0;if(!p)break}c[p+((c[k>>2]|0)+ -1<<2)>>2]=o}else{p=0;h=26}else h=26}else{a[j+n>>0]=a[d+m>>0]|0;a[j+(n+1)>>0]=a[d+(m+1)>>0]|0;p=a[p>>0]|0;n=n+2|0;m=o;h=26}while(0);if((h|0)==26){h=0;a[j+n>>0]=p;n=n+1|0;m=m+1|0}o=m+2|0;if((o|0)>=(e|0)){h=15;break b}}i=g;return f|0}else{n=m;h=15}while(0);if((h|0)==15)if((m|0)<(e|0)){h=e+n|0;k=m;while(1){a[j+n>>0]=a[d+k>>0]|0;k=k+1|0;if((k|0)==(e|0))break;else n=n+1|0}n=h-m|0}else e=m;h=j+n+0|0;d=h+32|0;do{a[h>>0]=0;h=h+1|0}while((h|0)<(d|0));c[f+12>>2]=j;c[f+8>>2]=n;q=e;i=g;return q|0}function Jb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;f=b+60|0;d=c[f>>2]|0;Zc();ac();f=c[f>>2]|0;c[f+4>>2]=b;g=md(31328)|0;c[f+136>>2]=g;if((((g|0)!=0?(c[f+72>>2]=g,c[f+8>>2]=f,g=fd(199)|0,c[f+152>>2]=g,(g|0)!=0):0)?(g=wd()|0,c[f+164>>2]=g,(g|0)!=0):0)?(h=wd()|0,c[f+2524>>2]=h,(h|0)!=0):0){c[f+2528>>2]=h;c[f+2592>>2]=2147483647;a[f+4469>>0]=1;c[f+2584>>2]=0;c[d+4368>>2]=0;c[d+4520>>2]=0;f=b+808|0;if(!(c[f>>2]&2))a[d+141>>0]=1;else a[d+141>>0]=c[b+800>>2];if((c[f>>2]&1|0)!=0?(c[b+800>>2]|0)>1:0){a[d+140>>0]=1;h=0;i=e;return h|0}a[d+140>>0]=2;h=0;i=e;return h|0}Lb(b)|0;h=-12;i=e;return h|0}function Kb(f,g,h,j){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,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,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,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0;k=i;i=i+16|0;m=k+8|0;n=k;l=c[f+60>>2]|0;f=j+28|0;J=c[f>>2]|0;if(!J){g=$b(l,g,1)|0;if((g|0)<0){Za=g;i=k;return Za|0}c[h>>2]=g;Za=0;i=k;return Za|0}q=l+2520|0;c[q>>2]=0;I=c[j+24>>2]|0;c[q>>2]=0;F=l+2584|0;z=l+2588|0;c[z>>2]=c[F>>2];c[F>>2]=0;v=l+4408|0;c[v>>2]=0;a:do if((J|0)>3){G=l+4470|0;E=l+4412|0;y=l+4404|0;u=l+4388|0;B=l+4396|0;w=l+4392|0;C=l+4384|0;x=l+4380|0;j=l+4376|0;t=l+136|0;s=l+2512|0;H=l+4480|0;while(1){A=(a[G>>0]|0)==0;if(A){while(1){K=I+1|0;if(((a[I>>0]|0)==0?(a[K>>0]|0)==0:0)?(a[I+2>>0]|0)==1:0)break;if((J|0)<5){p=-1094995529;o=180;break a}I=K;J=J+ -1|0}I=I+3|0;L=0;J=J+ -3|0}else{K=c[H>>2]|0;if((K|0)>0){M=0;L=0;do{M=d[I+L>>0]|M<<8;L=L+1|0}while((L|0)!=(K|0));L=M}else L=0;J=J-K|0;if((L|0)>(J|0)){p=-1094995529;o=180;break a}I=I+K|0}A=A?J:L;K=c[E>>2]|0;M=c[v>>2]|0;if((K|0)<(M+1|0)){K=K+1|0;L=kd(c[y>>2]|0,K,16)|0;if(!L){p=-12;o=180;break a}c[y>>2]=L;M=c[E>>2]|0;be(L+(M<<4)|0,0,K-M<<4|0)|0;ld(u,K,4)|0;ld(B,K,4)|0;ld(w,K,4)|0;M=c[B>>2]|0;c[M+(c[E>>2]<<2)>>2]=1024;M=od(c[M+(c[E>>2]<<2)>>2]|0,4)|0;c[(c[w>>2]|0)+(c[E>>2]<<2)>>2]=M;c[E>>2]=K;M=c[v>>2]|0}c[C>>2]=c[(c[B>>2]|0)+(M<<2)>>2];c[x>>2]=c[(c[w>>2]|0)+(M<<2)>>2];L=c[y>>2]|0;K=Ib(l,I,A,L+(M<<4)|0)|0;c[(c[u>>2]|0)+(c[v>>2]<<2)>>2]=c[j>>2];c[(c[B>>2]|0)+(c[v>>2]<<2)>>2]=c[C>>2];Ya=c[x>>2]|0;Za=c[v>>2]|0;c[v>>2]=Za+1;c[(c[w>>2]|0)+(Za<<2)>>2]=Ya;if((K|0)<0){p=K;o=180;break a}Ya=c[t>>2]|0;Wa=c[L+(M<<4)+12>>2]|0;Xa=c[L+(M<<4)+8>>2]|0;Xa=Xa>>>0>268435455?-8:Xa<<3;Za=Xa>>>0>2147483639|(Wa|0)==0;Xa=Za?0:Xa;Wa=Za?0:Wa;A=Za?-1094995529:0;c[Ya+204>>2]=Wa;c[Ya+216>>2]=Xa;c[Ya+220>>2]=Xa+8;c[Ya+208>>2]=Wa+(Xa>>3);c[Ya+212>>2]=0;if(Za){p=A;o=180;break a}Ob(l)|0;if(((c[s>>2]|0)+ -36|0)>>>0<2)c[F>>2]=1;J=J-K|0;if((J|0)<=3)break;else I=I+K|0}if((c[v>>2]|0)>0){ka=l+4|0;Fa=l+1448|0;B=l+2046|0;Z=l+1428|0;Ea=l+204|0;va=l+200|0;Ja=l+1449|0;Ka=l+1432|0;Oa=l+1436|0;Pa=l+2580|0;Ha=l+156|0;qa=l+1440|0;H=l+1450|0;K=l+1620|0;ua=l+2572|0;J=l+2516|0;L=l+2576|0;V=l+2056|0;W=l+2057|0;M=l+2058|0;O=l+2052|0;N=l+2048|0;Ma=l+2068|0;R=l+2072|0;P=l+2076|0;S=l+2080|0;X=l+2061|0;U=l+2084|0;T=l+2088|0;Y=l+2062|0;I=l+1451|0;Na=l+2108|0;Ia=l+2112|0;La=l+2500|0;ma=l+2592|0;na=l+2604|0;oa=l+4416|0;Ga=m+4|0;wa=l+4320|0;ya=l+2596|0;xa=l+2600|0;za=l+4324|0;Aa=l+4344|0;Ba=l+4348|0;Ca=l+4328|0;ra=l+160|0;pa=l+140|0;sa=l+164|0;_=l+2096|0;Q=l+2100|0;E=l+2104|0;F=l+141|0;G=l+4368|0;ba=l+2504|0;aa=l+2508|0;da=l+4332|0;ca=l+4336|0;ea=l+4340|0;ga=l+4352|0;fa=l+4316|0;ha=l+2608|0;ja=l+196|0;la=l+4364|0;ia=l+168|0;C=0;b:while(1){c[j>>2]=c[(c[u>>2]|0)+(C<<2)>>2];c[x>>2]=c[(c[w>>2]|0)+(C<<2)>>2];Ya=c[y>>2]|0;Xa=c[Ya+(C<<4)+12>>2]|0;Ya=c[Ya+(C<<4)+8>>2]|0;Za=c[t>>2]|0;Ya=Ya>>>0>268435455?-8:Ya<<3;Qa=Ya>>>0>2147483639|(Xa|0)==0;Ya=Qa?0:Ya;Xa=Qa?0:Xa;c[Za+204>>2]=Xa;c[Za+216>>2]=Ya;c[Za+220>>2]=Ya+8;c[Za+208>>2]=Xa+(Ya>>3);c[Za+212>>2]=0;c:do if(Qa){r=Qa?-1094995529:0;o=178}else{Qa=Ob(l)|0;d:do if((Qa|0)>=0){if(!Qa)break c;switch(c[s>>2]|0){case 37:case 36:{b[la>>1]=(e[la>>1]|0)+1&255;c[ma>>2]=2147483647;break c};case 48:{Qa=Dc(l)|0;if((Qa|0)<0)break d;else break c};case 34:{Qa=Ec(l)|0;if((Qa|0)<0)break d;else break c};case 40:case 39:{Qa=Gc(l)|0;if((Qa|0)<0)break d;else break c};case 9:case 8:case 7:case 6:case 21:case 20:case 19:case 18:case 17:case 16:case 5:case 4:case 3:case 2:case 0:case 1:{Qa=c[t>>2]|0;Ra=Qa+204|0;Za=(bd(Ra)|0)&255;a[Fa>>0]=Za;Sa=c[s>>2]|0;if(!((Sa+ -16|0)>>>0>4|Za<<24>>24==0)?(b[la>>1]=(e[la>>1]|0)+1&255,c[ma>>2]=2147483647,(Sa+ -19|0)>>>0<2):0){Yb(l);Sa=c[s>>2]|0}a[B>>0]=0;if((Sa+ -16|0)>>>0<8)a[B>>0]=bd(Ra)|0;Sa=dd(Ra)|0;c[Z>>2]=Sa;if(Sa>>>0>255){p=A;o=180;break a}Sa=c[l+(Sa<<2)+400>>2]|0;if(!Sa){p=A;o=180;break a}if(!(a[Fa>>0]|0)){Va=c[Sa+4>>2]|0;if((c[Ea>>2]|0)!=(Va|0)){p=A;o=180;break a}}else Va=c[Sa+4>>2]|0;c[Ea>>2]=Va;Ta=c[s>>2]|0;Ua=(Ta|0)==21;if(Ua?(c[z>>2]|0)==1:0)a[B>>0]=1;Sa=c[va>>2]|0;Va=c[(c[l+(c[Va>>2]<<2)+272>>2]|0)+4>>2]|0;if((Sa|0)!=(Va|0)){c[va>>2]=Va;e:do if(Sa){if((Ta+ -16|0)>>>0>7|Ua)break;do if((c[Va+13120>>2]|0)==(c[Sa+13120>>2]|0)){if((c[Va+13124>>2]|0)!=(c[Sa+13124>>2]|0))break;if((c[Va+76+(((c[Va+72>>2]|0)+ -1|0)*12|0)>>2]|0)==(c[Sa+(((c[Sa+72>>2]|0)+ -1|0)*12|0)+76>>2]|0))break e}while(0);a[B>>0]=0}while(0);Yb(l);Sa=c[va>>2]|0;Nb(l);Ua=c[Sa+13064>>2]|0;Va=Sa+13120|0;$a=c[Va>>2]|0;Wa=Sa+13124|0;_a=c[Wa>>2]|0;Ua=$((_a>>Ua)+1|0,($a>>Ua)+1|0)|0;Ta=$(c[Sa+13132>>2]|0,c[Sa+13128>>2]|0)|0;Za=Sa+13156|0;Ya=Sa+13160|0;Xa=$(c[Ya>>2]|0,c[Za>>2]|0)|0;c[ya>>2]=($a>>2)+1;c[xa>>2]=(_a>>2)+1;c[ba>>2]=pd(Ta,148)|0;_a=pd(Ta,8)|0;c[aa>>2]=_a;if((c[ba>>2]|0)==0|(_a|0)==0){o=71;break b}_a=Sa+13144|0;$a=Sa+13140|0;c[da>>2]=fd($(c[$a>>2]|0,c[_a>>2]|0)|0)|0;$a=od(c[_a>>2]|0,c[$a>>2]|0)|0;c[ca>>2]=$a;if((c[da>>2]|0)==0|($a|0)==0){o=71;break b}c[Aa>>2]=od(c[Sa+13148>>2]|0,c[Sa+13152>>2]|0)|0;c[ea>>2]=md(Xa)|0;Xa=fd($((c[Ya>>2]|0)+1|0,(c[Za>>2]|0)+1|0)|0)|0;c[Ba>>2]=Xa;if(!(c[ea>>2]|0)){o=71;break b}if((c[Aa>>2]|0)==0|(Xa|0)==0){o=71;break b}c[ga>>2]=fd(Ta)|0;c[Ca>>2]=od(Ua,4)|0;$a=od(Ua,1)|0;c[fa>>2]=$a;if(!$a){o=71;break b}if(!(c[ga>>2]|0)){o=71;break b}if(!(c[Ca>>2]|0)){o=71;break b}c[wa>>2]=pd(c[ya>>2]|0,c[xa>>2]|0)|0;$a=pd(c[ya>>2]|0,c[xa>>2]|0)|0;c[za>>2]=$a;if((c[wa>>2]|0)==0|($a|0)==0){o=71;break b}$a=c[ka>>2]|0;c[$a+124>>2]=c[Va>>2];c[$a+128>>2]=c[Wa>>2];c[$a+116>>2]=c[Sa+12>>2];c[$a+120>>2]=c[Sa+16>>2];c[$a+136>>2]=c[Sa+60>>2];c[$a+172>>2]=c[Sa+(((c[Sa+72>>2]|0)+ -1|0)*12|0)+80>>2];$a=Sa+160|0;c[m+0>>2]=c[$a+0>>2];c[m+4>>2]=c[$a+4>>2];if(!(c[Sa+176>>2]|0)){Ta=c[ka>>2]|0;c[Ta+392>>2]=1}else{Ta=c[ka>>2]|0;c[Ta+392>>2]=(c[Sa+184>>2]|0)!=0?2:1}if(!(c[Sa+188>>2]|0)){c[Ta+380>>2]=2;c[Ta+384>>2]=2;c[Ta+388>>2]=2}else{c[Ta+380>>2]=d[Sa+192>>0];c[Ta+384>>2]=d[Sa+193>>0];c[Ta+388>>2]=d[Sa+194>>0]}bc(ha,c[Sa+52>>2]|0);if(a[Sa+12941>>0]|0){Ta=c[va>>2]|0;Ua=(c[Ta+4>>2]|0)!=0?3:1;$a=(1<>2])+2|0;$a=$($a,$a)|0;c[ia>>2]=fd($a<>2])|0;Ta=0;do{$a=c[va>>2]|0;_a=c[$a+13124>>2]>>c[$a+(Ta<<2)+13180>>2];Za=$(c[$a+13120>>2]>>c[$a+(Ta<<2)+13168>>2]<<1,c[$a+13132>>2]|0)|0;c[l+(Ta<<2)+172>>2]=fd(Za<>2])|0;$a=c[va>>2]|0;_a=$(_a<<1,c[$a+13128>>2]|0)|0;c[l+(Ta<<2)+184>>2]=fd(_a<>2])|0;Ta=Ta+1|0}while((Ta|0)<(Ua|0))}c[va>>2]=Sa;c[ja>>2]=c[(c[l+(c[Sa>>2]<<2)+208>>2]|0)+4>>2];b[la>>1]=(e[la>>1]|0)+1&255;c[ma>>2]=2147483647}$a=c[ka>>2]|0;c[$a+832>>2]=d[Sa+302>>0];c[$a+836>>2]=d[Sa+335>>0];a[Ja>>0]=0;do if(!(a[Fa>>0]|0)){if(a[(c[Ea>>2]|0)+41>>0]|0){a[Ja>>0]=bd(Ra)|0;Sa=c[va>>2]|0}Sa=($(c[Sa+13128>>2]<<1,c[Sa+13132>>2]|0)|0)+ -2|0;Ta=Sa>>>0>65535;Sa=Ta?Sa>>>16:Sa;Ta=Ta?16:0;if(Sa&65280){Ta=Ta|8;Sa=Sa>>>8}Sa=_c(Ra,(d[4680+Sa>>0]|0)+Ta|0)|0;c[Ka>>2]=Sa;$a=c[va>>2]|0;if(Sa>>>0>=($(c[$a+13132>>2]|0,c[$a+13128>>2]|0)|0)>>>0){p=A;o=180;break a}if(a[Ja>>0]|0)if(!(a[Ha>>0]|0)){p=A;o=180;break a}else break;else{c[Oa>>2]=Sa;c[Pa>>2]=(c[Pa>>2]|0)+1;o=82;break}}else{c[Oa>>2]=0;c[Ka>>2]=0;c[Pa>>2]=0;a[Ha>>0]=0;o=82}while(0);f:do if((o|0)==82){o=0;a[Ha>>0]=0;if((c[(c[Ea>>2]|0)+1624>>2]|0)>0){Sa=0;do{ad(Ra,1);Sa=Sa+1|0}while((Sa|0)<(c[(c[Ea>>2]|0)+1624>>2]|0))}Sa=dd(Ra)|0;c[qa>>2]=Sa;if(Sa>>>0>=3){p=A;o=180;break a}if(!((Sa|0)==2?1:((c[s>>2]|0)+ -16|0)>>>0>7)){p=A;o=180;break a}a[H>>0]=1;if(a[(c[Ea>>2]|0)+39>>0]|0)a[H>>0]=bd(Ra)|0;if(a[(c[va>>2]|0)+8>>0]|0)a[I>>0]=_c(Ra,2)|0;if(((c[s>>2]|0)+ -19|0)>>>0>=2){o=91;break b}c[K>>2]=0;c[ua>>2]=0;if(!(c[J>>2]|0))c[L>>2]=0;do if(a[(c[va>>2]|0)+12941>>0]|0){a[V>>0]=bd(Ra)|0;if(!(c[(c[va>>2]|0)+4>>2]|0)){a[W>>0]=0;a[M>>0]=0;break}else{$a=(bd(Ra)|0)&255;a[M>>0]=$a;a[W>>0]=$a;break}}else{a[V>>0]=0;a[W>>0]=0;a[M>>0]=0}while(0);c[O>>2]=0;c[N>>2]=0;c[Ma>>2]=ed(Ra)|0;Sa=c[Ea>>2]|0;if(!(a[Sa+36>>0]|0)){c[R>>2]=0;c[P>>2]=0}else{c[R>>2]=ed(Ra)|0;c[P>>2]=ed(Ra)|0;Sa=c[Ea>>2]|0}if(!(a[Sa+1631>>0]|0))a[S>>0]=0;else{a[S>>0]=bd(Ra)|0;Sa=c[Ea>>2]|0}g:do if(!(a[Sa+55>>0]|0)){a[X>>0]=0;c[U>>2]=0;c[T>>2]=0}else{do if(a[Sa+56>>0]|0){if(!(bd(Ra)|0)){Sa=c[Ea>>2]|0;break}$a=(bd(Ra)|0)&255;a[X>>0]=$a;if($a<<24>>24)break g;c[U>>2]=(ed(Ra)|0)<<1;c[T>>2]=(ed(Ra)|0)<<1;break g}while(0);a[X>>0]=a[Sa+57>>0]|0;c[U>>2]=c[Sa+60>>2];c[T>>2]=c[Sa+64>>2]}while(0);Sa=a[(c[Ea>>2]|0)+54>>0]|0;h:do if(Sa<<24>>24){do if(!(a[V>>0]|0)){if(a[W>>0]|0)break;if(a[X>>0]|0)break h}while(0);a[Y>>0]=bd(Ra)|0;break f}while(0);a[Y>>0]=Sa}while(0);c[Na>>2]=0;$a=c[Ea>>2]|0;if(!((a[$a+42>>0]|0)==0?(a[$a+43>>0]|0)==0:0))o=122;i:do if((o|0)==122){o=0;$a=dd(Ra)|0;c[Na>>2]=$a;if(($a|0)<=0){c[G>>2]=0;break}Sa=(dd(Ra)|0)+1|0;Ta=Sa>>4;Sa=Sa&15;jd(_);jd(Q);jd(E);c[_>>2]=od(c[Na>>2]|0,4)|0;c[Q>>2]=od(c[Na>>2]|0,4)|0;Ua=od(c[Na>>2]|0,4)|0;c[E>>2]=Ua;if(!(c[_>>2]|0)){o=127;break b}if((c[Q>>2]|0)==0|(Ua|0)==0){o=127;break b}if((c[Na>>2]|0)>0){Wa=(Ta|0)>0;Va=(Sa|0)==0;Ua=0;do{if(Wa){Xa=0;Ya=0;do{Ya=(_c(Ra,16)|0)+(Ya<<16)|0;Xa=Xa+1|0}while((Xa|0)!=(Ta|0))}else Ya=0;if(!Va)Ya=(_c(Ra,Sa)|0)+(Ya<>2]|0)+(Ua<<2)>>2]=Ya+1;Ua=Ua+1|0}while((Ua|0)<(c[Na>>2]|0))}do if((d[F>>0]|0)>1){$a=c[Ea>>2]|0;if((c[$a+48>>2]|0)<=1?(c[$a+44>>2]|0)<=1:0)break;c[G>>2]=0;a[F>>0]=1;break i}while(0);c[G>>2]=0}while(0);Sa=c[Ea>>2]|0;if(a[Sa+1628>>0]|0){Sa=dd(Ra)|0;_a=ce(Sa|0,0,3)|0;Ya=D;$a=(c[Qa+216>>2]|0)-(c[Qa+212>>2]|0)|0;Za=(($a|0)<0)<<31>>31;if((Ya|0)>(Za|0)|(Ya|0)==(Za|0)&_a>>>0>$a>>>0){p=A;o=180;break a}if(Sa){Ta=0;do{ad(Ra,8);Ta=Ta+1|0}while((Ta|0)!=(Sa|0))}Sa=c[Ea>>2]|0}Ra=(c[Sa+16>>2]|0)+26+(c[Ma>>2]|0)|0;a[Ia>>0]=Ra;Ra=Ra<<24;if((Ra|0)>855638016){p=A;o=180;break a}if((Ra>>24|0)<(0-(c[(c[va>>2]|0)+13192>>2]|0)|0)){p=A;o=180;break a}$a=c[Ka>>2]|0;c[La>>2]=$a;if(($a|0)==0?(a[Ja>>0]|0)!=0:0){p=A;o=180;break a}if(((c[Qa+216>>2]|0)-(c[Qa+212>>2]|0)|0)<0){p=A;o=180;break a}a[(c[t>>2]|0)+203>>0]=(a[Ja>>0]|0)==0&1;if(!(a[(c[Ea>>2]|0)+22>>0]|0))a[(c[t>>2]|0)+272>>0]=a[Ia>>0]|0;a[Ha>>0]=1;a[(c[t>>2]|0)+302>>0]=0;a[(c[t>>2]|0)+303>>0]=0;Ra=c[ma>>2]|0;Qa=c[s>>2]|0;j:do if((Ra|0)==2147483647)switch(Qa|0){case 18:case 16:case 17:case 21:{Ra=c[ua>>2]|0;c[ma>>2]=Ra;break j};case 20:case 19:{c[ma>>2]=-2147483648;Ra=-2147483648;break j};default:{Ra=2147483647;break j}}while(0);do if((Qa+ -8|0)>>>0<2){if((c[ua>>2]|0)<=(Ra|0)){c[na>>2]=0;break c}if((Qa|0)!=9)break;c[ma>>2]=-2147483648}while(0);k:do if(!(a[Fa>>0]|0)){if(!(c[q>>2]|0)){Qa=0;break d}}else{Ra=c[t>>2]|0;_a=c[va>>2]|0;Qa=c[_a+13064>>2]|0;$a=c[_a+13120>>2]>>Qa;Qa=(c[_a+13124>>2]>>Qa)+1|0;be(c[wa>>2]|0,0,$(c[xa>>2]|0,c[ya>>2]|0)|0)|0;be(c[za>>2]|0,0,$(c[xa>>2]|0,c[ya>>2]|0)|0)|0;_a=c[va>>2]|0;be(c[Aa>>2]|0,0,$(c[_a+13152>>2]|0,c[_a+13148>>2]|0)|0)|0;_a=c[va>>2]|0;be(c[Ba>>2]|0,0,$((c[_a+13160>>2]|0)+1|0,(c[_a+13156>>2]|0)+1|0)|0)|0;be(c[Ca>>2]|0,-1,$(($a<<2)+4|0,Qa)|0)|0;c[na>>2]=0;c[oa>>2]=c[s>>2];Qa=c[Ea>>2]|0;if(a[Qa+42>>0]|0)c[Ra+312>>2]=c[c[Qa+1648>>2]>>2]<>2]|0)+13080>>2];Qa=_b(l,ra,c[ua>>2]|0)|0;do if((Qa|0)>=0){c[(c[c[q>>2]>>2]|0)+80>>2]=((c[s>>2]|0)+ -16|0)>>>0<8&1;c[(c[ra>>2]|0)+84>>2]=3-(c[qa>>2]|0);yd(c[sa>>2]|0);Qa=$b(l,c[sa>>2]|0,0)|0;if((Qa|0)<0)break;break k}while(0);if(!(c[q>>2]|0)){o=167;break b}c[q>>2]=0;if((Qa|0)<0){p=A;break a}}while(0);if((c[s>>2]|0)!=(c[oa>>2]|0)){p=A;o=180;break a}c[m>>2]=0;c[Ga>>2]=1;Qa=c[ka>>2]|0;Da[c[Qa+816>>2]&1](Qa,1,m,n,1,4)|0;Qa=c[n>>2]|0;$a=c[va>>2]|0;if((Qa|0)>=($(c[$a+13132>>2]|0,c[$a+13128>>2]|0)|0))c[na>>2]=1;if((Qa|0)<0)break d;else break c};default:break c}}while(0);r=(c[(c[ka>>2]|0)+688>>2]&8|0)==0?0:Qa;o=178}while(0);if((o|0)==178?(o=0,(r|0)<0):0){p=A;o=180;break a}C=C+1|0;if((C|0)>=(c[v>>2]|0)){p=A;o=180;break a}}if((o|0)==71){Nb(l);Nb(l);c[va>>2]=0;p=A;o=180;break}else if((o|0)==91)ta();else if((o|0)==127){c[Na>>2]=0;p=A;o=180;break}else if((o|0)==167){c[q>>2]=0;p=A;break}}else{p=A;o=180}}else{p=0;o=180}while(0);if((p|0)<0){$a=p;i=k;return $a|0}m=l+2604|0;if(c[m>>2]|0)c[m>>2]=0;l=c[l+164>>2]|0;if(c[l+304>>2]|0){zd(g,l);c[h>>2]=1}$a=c[f>>2]|0;i=k;return $a|0}function Lb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;e=c[b+60>>2]|0;Nb(e);b=e+4412|0;f=e+4392|0;if((c[b>>2]|0)>0){g=0;do{jd((c[f>>2]|0)+(g<<2)|0);g=g+1|0}while((g|0)<(c[b>>2]|0))}jd(e+4396|0);jd(e+4388|0);jd(f);jd(e+152|0);jd(e+168|0);jd(e+172|0);jd(e+184|0);jd(e+176|0);jd(e+188|0);jd(e+180|0);jd(e+192|0);xd(e+164|0);g=e+2524|0;Xb(e,g,-1);xd(g);g=e+208|0;f=0;do{vd(g+(f<<2)|0);f=f+1|0}while((f|0)!=16);g=e+272|0;f=0;do{vd(g+(f<<2)|0);f=f+1|0}while((f|0)!=32);f=e+400|0;g=0;do{vd(f+(g<<2)|0);g=g+1|0}while((g|0)!=256);c[e+200>>2]=0;c[e+204>>2]=0;c[e+196>>2]=0;vd(e+1424|0);jd(e+2096|0);jd(e+2100|0);jd(e+2104|0);h=e+141|0;l=a[h>>0]|0;f=e+72|0;if((l&255)>1){g=e+8|0;j=1;do{k=f+(j<<2)|0;if(c[k>>2]|0){jd(k);jd(g+(j<<2)|0);l=a[h>>0]|0}j=j+1|0}while((j|0)<(l&255|0))}g=e+136|0;if((c[g>>2]|0)==(c[f>>2]|0))c[g>>2]=0;jd(f);f=e+4404|0;if((c[b>>2]|0)<=0){jd(f);c[b>>2]=0;i=d;return 0}e=0;do{jd((c[f>>2]|0)+(e<<4)|0);e=e+1|0}while((e|0)<(c[b>>2]|0));jd(f);c[b>>2]=0;i=d;return 0}function Mb(a){a=a|0;var b=0;b=i;a=c[a+60>>2]|0;Zb(a);c[a+2592>>2]=2147483647;i=b;return}function Nb(a){a=a|0;var b=0;b=i;jd(a+2504|0);jd(a+2508|0);jd(a+4332|0);jd(a+4336|0);jd(a+4340|0);jd(a+4344|0);jd(a+4348|0);jd(a+4316|0);jd(a+4328|0);jd(a+4352|0);jd(a+4320|0);jd(a+4324|0);jd(a+2096|0);jd(a+2104|0);jd(a+2100|0);i=b;return}function Ob(a){a=a|0;var b=0,d=0,e=0;b=i;d=(c[a+136>>2]|0)+204|0;if(bd(d)|0){e=-1094995529;i=b;return e|0}c[a+2512>>2]=_c(d,6)|0;e=_c(d,6)|0;d=(_c(d,3)|0)+ -1|0;c[a+2516>>2]=d;if((d|0)<0){e=-1094995529;i=b;return e|0}e=(e|0)==0&1;i=b;return e|0}function Pb(e,f){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,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;f=i;h=c[e+60>>2]|0;k=h+200|0;E=c[k>>2]|0;e=1<>2];l=h+204|0;n=c[l>>2]|0;A=c[(c[n+1668>>2]|0)+(c[h+2500>>2]<<2)>>2]|0;m=(a[h+1449>>0]|0)==0;if(!A)if(m)g=4;else{W=-1094995529;i=f;return W|0}else if(!m){m=h+4328|0;r=h+1436|0;if((c[(c[m>>2]|0)+(c[(c[n+1672>>2]|0)+(A+ -1<<2)>>2]<<2)>>2]|0)!=(c[r>>2]|0)){W=-1094995529;i=f;return W|0}}else g=4;if((g|0)==4){m=h+4328|0;r=h+1436|0}q=e+ -1|0;s=h+136|0;p=h+2504|0;y=h+2056|0;o=h+2057|0;w=h+2084|0;x=h+2508|0;v=h+2088|0;u=h+2062|0;t=h+4352|0;z=0;n=0;do{if((A|0)>=(c[E+13136>>2]|0))break;G=c[l>>2]|0;B=c[(c[G+1672>>2]|0)+(A<<2)>>2]|0;J=E+13120|0;I=E+13080|0;H=c[I>>2]|0;n=q+(c[J>>2]|0)>>H;z=((B|0)%(n|0)|0)<>2]|0;H=1<>2]|0;D=B-F|0;c[(c[m>>2]|0)+(B<<2)>>2]=F;do if(!(a[G+43>>0]|0)){if(!(a[G+42>>0]|0)){c[C+312>>2]=c[J>>2];G=E;break}if((A|0)!=0?(W=c[G+1676>>2]|0,(c[W+(A<<2)>>2]|0)!=(c[W+(A+ -1<<2)>>2]|0)):0){W=c[I>>2]|0;c[C+312>>2]=(c[(c[G+1648>>2]|0)+(c[(c[G+1664>>2]|0)+(z>>W<<2)>>2]<<2)>>2]<>0]=1;G=c[k>>2]|0}else G=E}else{if((z|0)==0?(H+ -1&n|0)==0:0){a[C+203>>0]=1;E=c[k>>2]|0}c[C+312>>2]=c[E+13120>>2];G=E}while(0);E=H+n|0;H=c[G+13124>>2]|0;c[C+316>>2]=(E|0)>(H|0)?H:E;E=C+31312|0;c[E>>2]=0;H=c[l>>2]|0;if(!(a[H+42>>0]|0)){if((B|0)==(F|0)){c[E>>2]=1;F=1}else F=0;if((D|0)<(c[G+13128>>2]|0)){F=F|4;c[E>>2]=F}}else{if((z|0)>0){W=c[H+1676>>2]|0;I=B+ -1|0;if((c[W+(A<<2)>>2]|0)==(c[W+(c[(c[H+1668>>2]|0)+(I<<2)>>2]<<2)>>2]|0))F=0;else{c[E>>2]=2;F=2}W=c[m>>2]|0;if((c[W+(B<<2)>>2]|0)!=(c[W+(I<<2)>>2]|0)){F=F|1;c[E>>2]=F}}else F=0;if((n|0)>0){W=c[H+1676>>2]|0;I=G+13128|0;G=c[I>>2]|0;if((c[W+(A<<2)>>2]|0)!=(c[W+(c[(c[H+1668>>2]|0)+(B-G<<2)>>2]<<2)>>2]|0)){F=F|8;c[E>>2]=F;G=c[I>>2]|0}W=c[m>>2]|0;if((c[W+(B<<2)>>2]|0)!=(c[W+(B-G<<2)>>2]|0)){F=F|4;c[E>>2]=F}}}E=(z|0)>0;if(E&(D|0)>0)G=(F>>>1&1^1)&255;else G=0;a[C+308>>0]=G;if((n|0)>0){if((D|0)<(c[(c[k>>2]|0)+13128>>2]|0))F=0;else F=(F>>>3&1^1)&255;a[C+309>>0]=F;F=c[(c[k>>2]|0)+13128>>2]|0;if((D+1|0)<(F|0))F=0;else{W=c[l>>2]|0;V=c[W+1676>>2]|0;F=(c[V+(A<<2)>>2]|0)==(c[V+(c[(c[W+1668>>2]|0)+(B+1-F<<2)>>2]<<2)>>2]|0)&1}a[C+310>>0]=F;if(E?(j=c[(c[k>>2]|0)+13128>>2]|0,(D|0)>(j|0)):0){D=c[l>>2]|0;W=c[D+1676>>2]|0;D=(c[W+(A<<2)>>2]|0)==(c[W+(c[(c[D+1668>>2]|0)+(B+ -1-j<<2)>>2]<<2)>>2]|0)&1}else D=0}else{a[C+309>>0]=0;a[C+310>>0]=0;D=0}a[C+311>>0]=D;Ua(h,A);D=c[k>>2]|0;E=c[D+13080>>2]|0;F=z>>E;E=n>>E;G=c[s>>2]|0;D=($(c[D+13128>>2]|0,E)|0)+F|0;C=c[p>>2]|0;if((a[y>>0]|0)==0?(a[o>>0]|0)==0:0){M=0;H=0}else{if((F|0)>0?(a[G+308>>0]|0)!=0:0)M=Za(h)|0;else M=0;if((E|0)>0&(M|0)==0)if(!(a[G+309>>0]|0)){M=0;H=0}else{M=0;H=(Za(h)|0)!=0}else H=0}I=(c[(c[k>>2]|0)+4>>2]|0)!=0?3:1;L=C+(D*148|0)+143|0;G=C+(D*148|0)+144|0;K=C+(D*148|0)+104|0;J=C+(D*148|0)+108|0;R=(M|0)==0;S=R&(H^1);M=E+ -1|0;O=F+ -1|0;P=0;do{Q=c[l>>2]|0;Q=d[((P|0)==0?Q+1644|0:Q+1645|0)>>0]|0;a:do if(a[h+P+2056>>0]|0){T=(P|0)==2;do if(!T){if(S){U=($a(h)|0)&255;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}if(!R){U=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;U=a[(c[p>>2]|0)+(U*148|0)+P+142>>0]|0;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}if(H){U=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;U=a[(c[p>>2]|0)+(U*148|0)+P+142>>0]|0;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}else{a[C+(D*148|0)+P+142>>0]=0;break a}}else{U=a[L>>0]|0;a[G>>0]=U;c[J>>2]=c[K>>2];N=G}while(0);if(U<<24>>24){U=0;do{do if(!S){if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(U<<2)>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(U<<2)>>2];break}else{c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=0;break}}else c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=cb(h)|0;while(0);U=U+1|0}while((U|0)!=4);do if((a[N>>0]|0)==1){T=0;do{do if(c[C+(D*148|0)+(P<<4)+(T<<2)>>2]|0){if(S){c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=db(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(T<<2)+48>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(T<<2)+48>>2];break}else{c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=0;break}}else c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=0;while(0);T=T+1|0}while((T|0)!=4);if(S){a[C+(D*148|0)+P+96>>0]=bb(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;a[C+(D*148|0)+P+96>>0]=a[(c[p>>2]|0)+(W*148|0)+P+96>>0]|0;break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;a[C+(D*148|0)+P+96>>0]=a[(c[p>>2]|0)+(W*148|0)+P+96>>0]|0;break}else{a[C+(D*148|0)+P+96>>0]=0;break}}else if(!T){if(S){c[C+(D*148|0)+(P<<2)+100>>2]=eb(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<2)+100>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<2)+100>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<2)+100>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<2)+100>>2];break}else{c[C+(D*148|0)+(P<<2)+100>>2]=0;break}}while(0);b[C+(D*148|0)+(P*10|0)+112>>1]=0;T=0;do{W=c[C+(D*148|0)+(P<<4)+(T<<2)>>2]|0;V=T;T=T+1|0;U=C+(D*148|0)+(P*10|0)+(T<<1)+112|0;b[U>>1]=W;if((a[N>>0]|0)==2){if((V|0)>1){W=0-W|0;b[U>>1]=W}}else if(c[C+(D*148|0)+(P<<4)+(V<<2)+48>>2]|0){W=0-W|0;b[U>>1]=W}b[U>>1]=W<<16>>16<>0]=0;while(0);P=P+1|0}while((P|0)<(I|0));C=c[x>>2]|0;c[C+(B<<3)>>2]=c[w>>2];c[C+(B<<3)+4>>2]=c[v>>2];a[(c[t>>2]|0)+B>>0]=a[u>>0]|0;C=Qb(h,z,n,c[(c[k>>2]|0)+13080>>2]|0,0)|0;if((C|0)<0){g=108;break}A=A+1|0;Ta(h,A);Db(h,z,n,e);E=c[k>>2]|0}while((C|0)!=0);if((g|0)==108){c[(c[m>>2]|0)+(B<<2)>>2]=-1;W=C;i=f;return W|0}if((z+e|0)<(c[E+13120>>2]|0)){W=A;i=f;return W|0}if((n+e|0)<(c[E+13124>>2]|0)){W=A;i=f;return W|0}Bb(h,z,n,e);W=A;i=f;return W|0}function Qb(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;j=i;i=i+32|0;z=j;B=j+20|0;A=b+136|0;r=c[A>>2]|0;l=1<>2]|0;q=b+204|0;t=c[q>>2]|0;p=(1<<(c[s+13080>>2]|0)-(c[t+24>>2]|0))+ -1|0;c[r+31232>>2]=h;k=l+e|0;if(((k|0)<=(c[s+13120>>2]|0)?(l+f|0)<=(c[s+13124>>2]|0):0)?(c[s+13064>>2]|0)>>>0>>0:0){s=lb(b,h,e,f)|0;t=c[q>>2]|0}else s=(c[s+13064>>2]|0)>>>0>>0&1;if((a[t+22>>0]|0)!=0?((c[(c[m>>2]|0)+13080>>2]|0)-(c[t+24>>2]|0)|0)>>>0<=g>>>0:0){a[r+300>>0]=0;c[r+280>>2]=0}if((a[b+2080>>0]|0)!=0?((c[(c[m>>2]|0)+13080>>2]|0)-(d[(c[q>>2]|0)+1632>>0]|0)|0)>>>0<=g>>>0:0)a[r+301>>0]=0;if(s){o=l>>1;n=o+e|0;q=o+f|0;g=g+ -1|0;h=h+1|0;s=Qb(b,e,f,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}if(s){if((n|0)<(c[(c[m>>2]|0)+13120>>2]|0)){s=Qb(b,n,f,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}if(s){if((q|0)<(c[(c[m>>2]|0)+13124>>2]|0)){s=Qb(b,e,q,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}if(s){X=c[m>>2]|0;if((n|0)<(c[X+13120>>2]|0)?(q|0)<(c[X+13124>>2]|0):0){s=Qb(b,n,q,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}}else s=0}else s=0}else s=0;if((p&k|0)==0?(p&l+f|0)==0:0)c[r+276>>2]=a[r+272>>0];if(!s){X=0;i=j;return X|0}k=c[m>>2]|0;if((n+o|0)<(c[k+13120>>2]|0))k=1;else k=(q+o|0)<(c[k+13124>>2]|0);X=k&1;i=j;return X|0}p=c[A>>2]|0;s=c[m>>2]|0;r=c[s+13064>>2]|0;h=c[s+13140>>2]|0;s=1<<(c[s+13080>>2]|0)-(c[(c[q>>2]|0)+24>>2]|0);c[p+31236>>2]=e;c[p+31240>>2]=f;y=p+31252|0;a[y>>0]=1;v=p+31244|0;c[v>>2]=1;E=p+31248|0;c[E>>2]=0;w=p+31254|0;a[w>>0]=0;x=p+31253|0;a[x>>0]=0;t=($(f>>r,h)|0)+(e>>r)|0;H=b+4332|0;a[(c[H>>2]|0)+t>>0]=0;X=p+31268|0;a[X>>0]=1;a[X+1>>0]=1;a[X+2>>0]=1;a[X+3>>0]=1;r=l>>r;s=s+ -1|0;if(a[(c[q>>2]|0)+40>>0]|0){X=(gb(b)|0)&255;a[p+31256>>0]=X;if(X<<24>>24)Rb(b,e,f,g)}else a[p+31256>>0]=0;u=(r|0)>0;if(u){G=t;F=0;while(1){be((c[H>>2]|0)+G|0,0,r|0)|0;F=F+1|0;if((F|0)==(r|0))break;else G=G+h|0}}if((c[v>>2]|0)==1?(c[(c[m>>2]|0)+13064>>2]|0)!=(g|0):0)D=c[E>>2]|0;else{F=mb(b,g)|0;c[E>>2]=F;E=c[v>>2]|0;if((F|0)==3)G=(E|0)==1&1;else G=0;a[w>>0]=G;if((E|0)==1)D=F;else ta()}if((((D|0)==0?(C=c[m>>2]|0,(c[C+68>>2]|0)!=0):0)?(c[C+13048>>2]|0)>>>0<=g>>>0:0)?(c[C+13052>>2]|0)>>>0>=g>>>0:0){C=(nb(b)|0)&255;a[x>>0]=C}else C=a[x>>0]|0;do if(!(C<<24>>24)){C=c[A>>2]|0;E=(c[C+31248>>2]|0)==3;D=E?2:1;H=0;do{F=H<<1;G=0;do{a[B+(G+F)>>0]=ob(b)|0;G=G+1|0}while((G|0)<(D|0));H=H+1|0}while((H|0)<(D|0));Q=l>>(E&1);P=C+31264|0;R=z+4|0;E=z+8|0;F=b+4340|0;O=C+31260|0;N=0;do{J=N<<1;H=($(N,Q)|0)+f|0;I=0;do{L=I+J|0;U=(a[B+L>>0]|0)==0;if(U)c[P>>2]=qb(b)|0;else c[O>>2]=pb(b)|0;V=($(I,Q)|0)+e|0;T=c[A>>2]|0;X=c[m>>2]|0;S=c[X+13084>>2]|0;M=V>>S;K=H>>S;G=c[X+13156>>2]|0;S=Q>>S;X=c[X+13080>>2]|0;W=(1<>0]|0)==0?(W&H|0)==0:0)W=1;else{W=($(K+ -1|0,G)|0)+M|0;W=d[(c[F>>2]|0)+W>>0]|0}if((a[T+308>>0]|0)==0&(V|0)==0)V=1;else{V=M+ -1+($(K,G)|0)|0;V=d[(c[F>>2]|0)+V>>0]|0}X=(H>>X<>>0<2){c[z>>2]=0;c[R>>2]=1;c[E>>2]=26;V=0;X=1;W=26;break}else{c[z>>2]=V;X=(V+29&31)+2|0;c[R>>2]=X;W=(V+31&31)+2|0;c[E>>2]=W;break}else{c[z>>2]=V;c[R>>2]=X;if(!((V|0)==0|(X|0)==0)){c[E>>2]=0;W=0;break}if((V|0)==1|(X|0)==1){c[E>>2]=26;W=26;break}else{c[E>>2]=1;W=1;break}}while(0);if(U){if((V|0)>(X|0)){c[R>>2]=V;U=X&255;c[z>>2]=U}else{U=V;V=X}if((U|0)>(W|0)){c[E>>2]=U;X=W&255;c[z>>2]=X;W=U;U=X}if((V|0)>(W|0)){c[E>>2]=V;X=W&255;c[R>>2]=X}else{X=V;V=W}T=c[T+31264>>2]|0;T=((T|0)>=(U|0)&1)+T|0;T=((T|0)>=(X|0)&1)+T|0;T=((T|0)>=(V|0)&1)+T|0}else T=c[z+(c[T+31260>>2]<<2)>>2]|0;S=(S|0)==0?1:S;T=T&255;if((S|0)>0){U=0;do{X=($(U+K|0,G)|0)+M|0;be((c[F>>2]|0)+X|0,T|0,S|0)|0;U=U+1|0}while((U|0)<(S|0))}a[C+L+31268>>0]=T;I=I+1|0}while((I|0)<(D|0));N=N+1|0}while((N|0)<(D|0));z=c[(c[m>>2]|0)+4>>2]|0;if(!z)break;else if((z|0)==3){B=0;do{z=B<<1;E=0;do{G=rb(b)|0;F=E+z|0;a[C+F+31281>>0]=G;A=a[C+F+31268>>0]|0;do if((G|0)!=4){G=a[1528+G>>0]|0;F=C+F+31277|0;if(A<<24>>24==G<<24>>24){a[F>>0]=34;break}else{a[F>>0]=G;break}}else a[C+F+31277>>0]=A;while(0);E=E+1|0}while((E|0)<(D|0));B=B+1|0}while((B|0)<(D|0))}else if((z|0)!=2){A=rb(b)|0;z=a[C+31268>>0]|0;if((A|0)==4){a[C+31277>>0]=z;break}A=a[1528+A>>0]|0;B=C+31277|0;if(z<<24>>24==A<<24>>24){a[B>>0]=34;break}else{a[B>>0]=A;break}}else{z=rb(b)|0;a[C+31281>>0]=z;A=a[C+31268>>0]|0;if((z|0)==4)z=A&255;else{z=a[1528+z>>0]|0;z=A<<24>>24==z<<24>>24?34:z&255}a[C+31277>>0]=a[1536+z>>0]|0;break}}else{G=c[m>>2]|0;B=c[G+13084>>2]|0;E=l>>B;C=c[G+13156>>2]|0;D=e>>B;B=f>>B;E=(E|0)==0?1:E;if((E|0)>0){F=b+4340|0;G=0;do{X=($(G+B|0,C)|0)+D|0;be((c[F>>2]|0)+X|0,1,E|0)|0;G=G+1|0}while((G|0)<(E|0));G=c[m>>2]|0}K=c[A>>2]|0;V=c[b+160>>2]|0;A=c[V+32>>2]|0;D=$(A,f)|0;H=c[G+56>>2]|0;D=(c[V>>2]|0)+((e<>2]|0;J=c[G+13184>>2]|0;B=$(f>>J,E)|0;I=c[G+13172>>2]|0;B=(c[V+4>>2]|0)+((e>>I<>2]|0;X=c[G+13188>>2]|0;F=$(f>>X,C)|0;W=c[G+13176>>2]|0;F=(c[V+8>>2]|0)+((e>>W<>0]|0,l<>W,l>>X)|0)+($(l>>I,l>>J)|0)|0;G=($(d[G+13045>>0]|0,J)|0)+H|0;H=K+224|0;J=G+7>>3;I=c[K+240>>2]|0;X=c[H>>2]|0;I=(X&1|0)==0?I:I+ -1|0;I=(X&511|0)==0?I:I+ -1|0;K=(c[K+244>>2]|0)-I|0;if((K|0)<(J|0))I=0;else Yc(H,I+J|0,K-J|0);if(!(a[b+2061>>0]|0))Ab(b,e,f,g);X=G>>>0>2147483639|(I|0)==0;W=X?0:G;V=X?0:I;c[z>>2]=V;c[z+12>>2]=W;c[z+16>>2]=W+8;c[z+4>>2]=V+(W+7>>3);c[z+8>>2]=0;if(X)z=-1094995529;else{W=b+2608|0;X=c[m>>2]|0;za[c[W>>2]&7](D,A,l,l,z,d[X+13044>>0]|0,c[X+52>>2]|0);X=c[m>>2]|0;za[c[W>>2]&7](B,E,l>>c[X+13172>>2],l>>c[X+13184>>2],z,d[X+13045>>0]|0,c[X+52>>2]|0);X=c[m>>2]|0;za[c[W>>2]&7](F,C,l>>c[X+13176>>2],l>>c[X+13188>>2],z,d[X+13045>>0]|0,c[X+52>>2]|0);z=0}if(a[(c[m>>2]|0)+13056>>0]|0)Rb(b,e,f,g);if((z|0)<0){X=z;i=j;return X|0}}while(0);do if(!(a[x>>0]|0)){if(!(a[y>>0]|0)){if(a[b+2061>>0]|0)break;Ab(b,e,f,g);break}x=c[m>>2]|0;if((c[v>>2]|0)==1)v=(d[w>>0]|0)+(c[x+13092>>2]|0)|0;else v=c[x+13088>>2]|0;a[p+31255>>0]=v;v=Sb(b,e,f,e,f,e,f,g,g,0,0,1520,1520)|0;if((v|0)<0){X=v;i=j;return X|0}}while(0);if((a[(c[q>>2]|0)+22>>0]|0)!=0?(a[p+300>>0]|0)==0:0)zb(b,e,f,g);if(u){q=b+4316|0;g=p+272|0;u=0;while(1){be((c[q>>2]|0)+t|0,a[g>>0]|0,r|0)|0;u=u+1|0;if((u|0)==(r|0))break;else t=t+h|0}}if((s&k|0)==0?(s&l+f|0)==0:0)c[p+276>>2]=a[p+272>>0];q=c[m>>2]|0;X=c[q+13064>>2]|0;g=l>>X;r=e>>X;e=f>>X;if((g|0)>0?(n=b+4336|0,o=c[p+31232>>2]&255,X=($(c[q+13140>>2]|0,e)|0)+r|0,be((c[n>>2]|0)+X|0,o|0,g|0)|0,(g|0)!=1):0){p=1;do{X=($(c[(c[m>>2]|0)+13140>>2]|0,p+e|0)|0)+r|0;be((c[n>>2]|0)+X|0,o|0,g|0)|0;p=p+1|0}while((p|0)!=(g|0))}e=c[m>>2]|0;m=1<>2];if(((k|0)%(m|0)|0|0)!=0?(k|0)<(c[e+13120>>2]|0):0){X=1;i=j;return X|0}X=l+f|0;if(((X|0)%(m|0)|0|0)!=0?(X|0)<(c[e+13124>>2]|0):0){X=1;i=j;return X|0}X=(fb(b)|0)==0&1;i=j;return X|0}function Rb(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;g=i;m=1<>2]|0;l=c[n+13084>>2]|0;f=c[n+13156>>2]|0;k=m+d|0;j=c[n+13120>>2]|0;m=m+e|0;n=c[n+13124>>2]|0;h=e>>l;e=((m|0)>(n|0)?n:m)>>l;if((h|0)>=(e|0)){i=g;return}d=d>>l;j=((k|0)>(j|0)?j:k)>>l;k=(d|0)<(j|0);b=b+4348|0;do{if(k){m=$(h,f)|0;l=d;do{a[(c[b>>2]|0)+(l+m)>>0]=2;l=l+1|0}while((l|0)!=(j|0))}h=h+1|0}while((h|0)!=(e|0));i=g;return}function Sb(e,f,g,h,j,k,l,m,n,o,p,q,r){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;var 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;s=i;i=i+16|0;w=s+8|0;t=s;z=e+136|0;v=c[z>>2]|0;K=c[q>>2]|0;c[w>>2]=K;A=c[q+4>>2]|0;G=w+4|0;c[G>>2]=A;L=c[r>>2]|0;c[t>>2]=L;q=c[r+4>>2]|0;x=t+4|0;c[x>>2]=q;y=a[v+31254>>0]|0;do if(y<<24>>24){if((o|0)==1){c[v+288>>2]=d[v+p+31268>>0];if((c[(c[e+200>>2]|0)+4>>2]|0)==3){c[v+292>>2]=d[v+p+31277>>0];c[v+296>>2]=d[v+p+31281>>0];break}else{c[v+292>>2]=d[v+31277>>0];c[v+296>>2]=d[v+31281>>0];break}}}else{c[v+288>>2]=d[v+31268>>0];c[v+292>>2]=d[v+31277>>0];c[v+296>>2]=d[v+31281>>0]}while(0);r=e+200|0;I=c[r>>2]|0;B=(c[I+13076>>2]|0)>>>0>>0;if(((!B?(c[I+13072>>2]|0)>>>0>>0:0)?(d[v+31255>>0]|0)>(o|0):0)?!(y<<24>>24!=0&(o|0)==0):0)y=(sb(e,n)|0)&255;else{if((c[I+13088>>2]|0)==0?(c[v+31244>>2]|0)==0:0)I=(o|0)==0&(c[v+31248>>2]|0)!=0;else I=0;if(B)y=1;else y=(y<<24>>24!=0&(o|0)==0|I)&1}B=(n|0)>2;I=c[(c[r>>2]|0)+4>>2]|0;if(B)if(!I){J=q;M=A}else E=20;else if((I|0)==3)E=20;else{J=q;M=A}do if((E|0)==20){I=(o|0)==0;if(!((K|0)==0&(I^1))){K=tb(e,o)|0;c[w>>2]=K;if((c[(c[r>>2]|0)+4>>2]|0)==2?y<<24>>24==0|(n|0)==3:0){A=tb(e,o)|0;c[G>>2]=A}if(!I)E=25}else{K=0;E=25}if((E|0)==25)if(!L){L=0;J=q;M=A;break}L=tb(e,o)|0;c[t>>2]=L;if((c[(c[r>>2]|0)+4>>2]|0)==2?y<<24>>24==0|(n|0)==3:0){J=tb(e,o)|0;c[x>>2]=J;M=A}else{J=q;M=A}}while(0);if(!(y<<24>>24)){A=c[r>>2]|0;q=c[A+13072>>2]|0;y=1<>2]|0;if(((o|0)==0?(c[v+31244>>2]|0)!=1:0)&(K|0)==0&(L|0)==0)if((c[A+4>>2]|0)==2?(M|J|0)!=0:0)E=37;else o=1;else E=37;if((E|0)==37){o=ub(e,o)|0;A=c[r>>2]|0}G=c[z>>2]|0;A=n-(c[A+13172>>2]|0)|0;z=G+31244|0;if((c[z>>2]|0)==1){I=1<>2]|0;L=c[K+4>>2]|0;if((L|0)==2){if(M){E=46;break}if(J){M=0;E=46;break}}if(!((c[z>>2]|0)!=1|(L|0)==0)){if(B|(L|0)==3){t=1<<(c[K+13172>>2]|0)+A;w=1<<(c[K+13184>>2]|0)+A;Cc(e,f,g,t,w);Ub(e,f,g,A,1);Ub(e,f,g,A,2);if((c[(c[r>>2]|0)+4>>2]|0)!=2)break;M=(1<>2]|0)+n,Cc(e,h,j,H,F),Ub(e,h,j,n,1),Ub(e,h,j,n,2),(c[(c[r>>2]|0)+4>>2]|0)==2):0){M=(1<>2]|0)+4>>2]|0)==2){F=(M|J|0)==0;E=48}else{F=1;E=48}a:do if((E|0)==48){E=e+204|0;do if((a[(c[E>>2]|0)+22>>0]|0)!=0?(D=G+300|0,(a[D>>0]|0)==0):0){M=hb(e)|0;H=G+280|0;c[H>>2]=M;if(M){M=(ib(e)|0)==1;J=c[H>>2]|0;if(M){J=0-J|0;c[H>>2]=J}}else J=0;a[D>>0]=1;M=(c[(c[r>>2]|0)+13192>>2]|0)/2|0;if((J|0)<(-26-M|0)|(J|0)>(M+25|0)){M=-1094995529;i=s;return M|0}else{zb(e,k,l,m);break}}while(0);if((!((a[e+2080>>0]|0)==0|F)?(a[G+31256>>0]|0)==0:0)?(C=G+301|0,(a[C>>0]|0)==0):0){if(!(jb(e)|0)){a[G+302>>0]=0;a[G+303>>0]=0}else{k=c[E>>2]|0;if(!(a[k+1633>>0]|0))l=0;else{l=kb(e)|0;k=c[E>>2]|0}a[G+302>>0]=a[k+l+1634>>0]|0;a[G+303>>0]=a[(c[E>>2]|0)+l+1639>>0]|0}a[C>>0]=1}if((c[z>>2]|0)==1&(n|0)<4){k=c[G+288>>2]|0;if((k+ -6|0)>>>0<9)m=2;else m=(k+ -22|0)>>>0<9&1;k=c[G+292>>2]|0;if((k+ -6|0)>>>0<9)k=2;else k=(k+ -22|0)>>>0<9&1}else{m=0;k=0}l=G+304|0;a[l>>0]=0;if(I)xb(e,f,g,n,m,0);m=c[r>>2]|0;C=c[m+4>>2]|0;if(C){if(!(B|(C|0)==3)){if((p|0)!=3)break;p=1<>2]|0)+n;l=0;do{if((c[z>>2]|0)==1){M=(l<>2]|0)xb(e,h,(l<>2]|0)+4>>2]|0)==2?2:1)|0));w=0;while(1){if((c[z>>2]|0)==1){M=(w<>2]|0)xb(e,h,(w<=(((c[(c[r>>2]|0)+4>>2]|0)==2?2:1)|0))break a}}j=1<<(c[m+13172>>2]|0)+A;h=1<<(c[m+13184>>2]|0)+A;do if((a[(c[E>>2]|0)+1630>>0]|0)==0|I^1)a[l>>0]=0;else{if(c[z>>2]|0){M=(c[G+296>>2]|0)==4;a[l>>0]=M&1;if(!M)break}else a[l>>0]=1;Tb(e,0)}while(0);m=e+160|0;C=G+320|0;D=G+11680|0;E=1<0;p=e+(A+ -2<<2)+2612|0;F=G+284|0;J=0;do{if((c[z>>2]|0)==1){M=(J<>2]|0)){if(!(a[l>>0]|0))break;M=c[m>>2]|0;G=c[M+36>>2]|0;H=c[r>>2]|0;I=$(g>>c[H+13184>>2],G)|0;I=(c[M+4>>2]|0)+(I+(f>>c[H+13172>>2]<>2]))|0;if(B){J=0;do{b[D+(J<<1)>>1]=($(b[C+(J<<1)>>1]|0,c[F>>2]|0)|0)>>>3;J=J+1|0}while((J|0)!=(E|0));J=E}else J=0;Ka[c[p>>2]&7](I,D,G,c[H+52>>2]|0)}else xb(e,f,(J<>2]|0)+4>>2]|0)==2?2:1)|0));if(!(a[l>>0]|0))I=0;else{Tb(e,1);I=0}do{if((c[z>>2]|0)==1){M=(I<>2]|0)){if(!(a[l>>0]|0))break;M=c[m>>2]|0;G=c[M+40>>2]|0;w=c[r>>2]|0;H=$(g>>c[w+13188>>2],G)|0;H=(c[M+8>>2]|0)+(H+(f>>c[w+13176>>2]<>2]))|0;if(B){I=0;do{b[D+(I<<1)>>1]=($(b[C+(I<<1)>>1]|0,c[F>>2]|0)|0)>>>3;I=I+1|0}while((I|0)!=(E|0));I=E}else I=0;Ka[c[p>>2]&7](H,D,G,c[w+52>>2]|0)}else xb(e,f,(I<>2]|0)+4>>2]|0)==2?2:1)|0))}}while(0);if((o|0)!=0?(u=1<0):0){t=e+4344|0;r=0;do{w=$(r+g>>q,x)|0;o=0;do{a[(c[t>>2]|0)+((o+f>>q)+w)>>0]=1;o=o+y|0}while((o|0)<(u|0));r=r+y|0}while((r|0)<(u|0))}if(((a[e+2061>>0]|0)==0?(Ab(e,f,g,n),(a[(c[e+204>>2]|0)+40>>0]|0)!=0):0)?(a[v+31256>>0]|0)!=0:0)Rb(e,f,g,n)}else{u=n+ -1|0;n=1<>2]|0;f=vb(a,b)|0;if(!f){c[e+284>>2]=0;i=d;return}else{c[e+284>>2]=1-((wb(a,b)|0)<<1)<>2]|0;s=c[d+200>>2]|0;q=c[s+52>>2]|0;V=c[s+(j<<2)+13168>>2]|0;U=c[s+(j<<2)+13180>>2]|0;k=1<>2]|0;oa=k<>2]|0;W=f>>X&_;ia=g>>X&_;Y=_+2|0;aa=($(ia,Y)|0)+W|0;ba=c[d+204>>2]|0;ca=c[ba+1684>>2]|0;aa=c[ca+(aa<<2)>>2]|0;n=c[d+160>>2]|0;d=(c[n+(j<<2)+32>>2]|0)>>>1;n=c[n+(j<<2)>>2]|0;m=($(d,g>>U)|0)+(f>>V)|0;o=n+(m<<1)|0;p=(j|0)==0;r=c[(p?t+288|0:t+292|0)>>2]|0;w=v+2|0;B=y+2|0;z=A+2|0;u=x+2|0;if(!(c[t+31288>>2]|0))na=0;else na=(aa|0)>(c[ca+(W+ -1+($(_&ia+(oa>>X),Y)|0)<<2)>>2]|0);la=na&1;da=c[t+31292>>2]|0;M=c[t+31300>>2]|0;Z=c[t+31296>>2]|0;if(!(c[t+31304>>2]|0))ja=0;else ja=(aa|0)>(c[ca+(($(Y,ia+ -1|0)|0)+(_&W+(ma>>X))<<2)>>2]|0);W=ja&1;ca=(oa<<1)+g|0;_=s+13124|0;ia=c[_>>2]|0;X=oa+g|0;ca=((ca|0)>(ia|0)?ia:ca)-X>>U;ia=(ma<<1)+f|0;aa=s+13120|0;ra=c[aa>>2]|0;Y=ma+f|0;ia=((ia|0)>(ra|0)?ra:ia)-Y>>V;ba=ba+20|0;if((a[ba>>0]|0)==1){ka=c[s+13084>>2]|0;pa=oa>>ka;ma=ma>>ka;qa=(1<>2]|0)-(X>>ka)|0;na=(pa|0)>(na|0)?na:pa;if((na|0)>0){la=0;ra=0;do{la=la|1;ra=ra+2|0}while((ra|0)<(na|0))}else la=0}if(!((da|0)!=1|qa)){ra=(c[s+13160>>2]|0)-(g>>ka)|0;pa=(pa|0)>(ra|0)?ra:pa;if((pa|0)>0){da=0;na=0;do{da=da|1;na=na+2|0}while((na|0)<(pa|0))}else da=0}na=(oa|0)!=0;if(!((Z|0)!=1|na)){oa=(c[s+13156>>2]|0)-(f>>ka)|0;oa=(ma|0)>(oa|0)?oa:ma;if((oa|0)>0){Z=0;pa=0;do{Z=Z|1;pa=pa+2|0}while((pa|0)<(oa|0))}else Z=0}if(!(na|ja^1)){ka=(c[s+13156>>2]|0)-(Y>>ka)|0;ka=(ma|0)>(ka|0)?ka:ma;if((ka|0)>0){W=0;ja=0;do{W=W|1;ja=ja+2|0}while((ja|0)<(ka|0))}else W=0}ka=w+0|0;ja=ka+128|0;do{b[ka>>1]=32896;ka=ka+2|0}while((ka|0)<(ja|0));ka=B+0|0;ja=ka+128|0;do{b[ka>>1]=32896;ka=ka+2|0}while((ka|0)<(ja|0));b[y>>1]=128;ma=W}else ma=W;ka=(M|0)!=0;if(ka){ra=b[n+(m+~d<<1)>>1]|0;b[v>>1]=ra;b[y>>1]=ra}ja=(Z|0)!=0;if(ja)ee(B|0,n+(m-d<<1)|0,k<<1|0)|0;W=(ma|0)!=0;if(W?(ha=k+1|0,ee(y+(ha<<1)|0,n+(k-d+m<<1)|0,k<<1|0)|0,fa=je(e[n+(k+ -1-d+m+ia<<1)>>1]|0,0,65537,65537)|0,ga=D,ea=k-ia|0,(ea|0)>0):0){ia=ia+ha|0;ha=0;do{ra=y+(ia+ha<<1)|0;qa=ra;b[qa>>1]=fa;b[qa+2>>1]=fa>>>16;ra=ra+4|0;b[ra>>1]=ga;b[ra+2>>1]=ga>>>16;ha=ha+4|0}while((ha|0)<(ea|0))}ea=(da|0)!=0;if(ea&(k|0)>0){fa=m+ -1|0;ga=0;do{ra=ga;ga=ga+1|0;b[v+(ga<<1)>>1]=b[n+(fa+($(ra,d)|0)<<1)>>1]|0}while((ga|0)!=(k|0))}fa=(la|0)!=0;if(fa){ia=ca+k|0;ha=m+ -1|0;if((ca|0)>0){ga=k;do{ra=ga;ga=ga+1|0;b[v+(ga<<1)>>1]=b[n+(ha+($(ra,d)|0)<<1)>>1]|0}while((ga|0)<(ia|0))}ia=je(e[n+(ha+($(ia+ -1|0,d)|0)<<1)>>1]|0,0,65537,65537)|0;ha=D;ga=k-ca|0;if((ga|0)>0){ca=k+1+ca|0;na=0;do{ra=v+(ca+na<<1)|0;qa=ra;b[qa>>1]=ia;b[qa+2>>1]=ia>>>16;ra=ra+4|0;b[ra>>1]=ha;b[ra+2>>1]=ha>>>16;na=na+4|0}while((na|0)<(ga|0))}}do if((a[ba>>0]|0)==1?(ra=la|da,S=(ra|0)==0,ra=ra|M,T=(ra|0)==0,(Z|ma|ra|0)!=0):0){ba=k<<1;ca=c[aa>>2]|0;if(((ba<>V;_=c[_>>2]|0;if(((ba<=(_|0))ba=_-g>>U;if(!W)if((Y|0)<(ca|0))V=k;else V=ca-f>>V;else V=aa;if(!fa)if((X|0)<(_|0))U=k;else U=_-g>>U;else U=ba;X=b[y>>1]|0;if(T)b[v>>1]=X;b[v>>1]=X;if(!S){S=0;while(1)if((S|0)<(U|0))S=S+4|0;else break}if(!ea?(R=je(X&65535|0,0,65537,65537)|0,Q=D,(k|0)>0):0){S=0;do{ra=v+((S|1)<<1)|0;qa=ra;b[qa>>1]=R;b[qa+2>>1]=R>>>16;ra=ra+4|0;b[ra>>1]=Q;b[ra+2>>1]=Q>>>16;S=S+4|0}while((S|0)<(k|0))}do if(!fa){Q=je(e[v+(k<<1)>>1]|0,0,65537,65537)|0;S=D;if((k|0)<=0)break;T=k+1|0;R=0;do{ra=v+(T+R<<1)|0;qa=ra;b[qa>>1]=Q;b[qa+2>>1]=Q>>>16;ra=ra+4|0;b[ra>>1]=S;b[ra+2>>1]=S>>>16;R=R+4|0}while((R|0)<(k|0))}while(0);g=(g|0)==0;if((f|0)==0&(U|0)>0){f=0;do{ra=v+((f|1)<<1)|0;qa=ra;b[qa>>1]=0;b[qa+2>>1]=0>>>16;ra=ra+4|0;b[ra>>1]=0;b[ra+2>>1]=0>>>16;f=f+4|0}while((f|0)<(U|0))}b[y>>1]=b[v>>1]|0;if(g)break;else f=0;while(1)if((f|0)<(V|0))f=f+4|0;else break}while(0);a:do if(!fa){if(ea){P=je(e[v+(k<<1)>>1]|0,0,65537,65537)|0;f=D;if((k|0)<=0){P=84;break}g=k+1|0;Q=0;while(1){ra=v+(g+Q<<1)|0;qa=ra;b[qa>>1]=P;b[qa+2>>1]=P>>>16;ra=ra+4|0;b[ra>>1]=f;b[ra+2>>1]=f>>>16;Q=Q+4|0;if((Q|0)>=(k|0)){P=84;break a}}}if(ka){f=je(e[v>>1]|0,0,65537,65537)|0;P=D;O=k<<1;if((k|0)>0)N=0;else{P=87;break}while(1){ra=v+((N|1)<<1)|0;qa=ra;b[qa>>1]=f;b[qa+2>>1]=f>>>16;ra=ra+4|0;b[ra>>1]=P;b[ra+2>>1]=P>>>16;N=N+4|0;if((N|0)>=(O|0)){P=87;break a}}}if(ja){N=b[B>>1]|0;b[v>>1]=N;N=je(N&65535|0,0,65537,65537)|0;O=D;M=k<<1;if((k|0)>0)P=0;else{P=89;break}while(1){ra=v+((P|1)<<1)|0;qa=ra;b[qa>>1]=N;b[qa+2>>1]=N>>>16;ra=ra+4|0;b[ra>>1]=O;b[ra+2>>1]=O>>>16;P=P+4|0;if((P|0)>=(M|0)){P=89;break a}}}if(!W){g=1<>1]=g;R=je(g&65535|0,0,65537,65537)|0;Q=D;P=k<<1;f=(k|0)>0;if(f)S=0;else{P=84;break}do{ra=y+((S|1)<<1)|0;qa=ra;b[qa>>1]=R;b[qa+2>>1]=R>>>16;ra=ra+4|0;b[ra>>1]=Q;b[ra+2>>1]=Q>>>16;S=S+4|0}while((S|0)<(P|0));g=je(g&65535|0,0,65537,65537)|0;Q=D;if(f)f=0;else{P=84;break}while(1){ra=v+((f|1)<<1)|0;qa=ra;b[qa>>1]=g;b[qa+2>>1]=g>>>16;ra=ra+4|0;b[ra>>1]=Q;b[ra+2>>1]=Q>>>16;f=f+4|0;if((f|0)>=(P|0)){P=84;break a}}}M=y+(k+1<<1)|0;O=b[M>>1]|0;N=je(O&65535|0,0,65537,65537)|0;L=D;K=(k|0)>0;if(K)O=0;else{b[v>>1]=O;break}do{ra=y+((O|1)<<1)|0;qa=ra;b[qa>>1]=N;b[qa+2>>1]=N>>>16;ra=ra+4|0;b[ra>>1]=L;b[ra+2>>1]=L>>>16;O=O+4|0}while((O|0)<(k|0));M=b[M>>1]|0;b[v>>1]=M;M=je(M&65535|0,0,65537,65537)|0;L=D;N=k<<1;if(K){K=0;do{ra=v+((K|1)<<1)|0;qa=ra;b[qa>>1]=M;b[qa+2>>1]=M>>>16;ra=ra+4|0;b[ra>>1]=L;b[ra+2>>1]=L>>>16;K=K+4|0}while((K|0)<(N|0));P=92}else P=92}else P=84;while(0);if((P|0)==84)if((da|0)==0?(N=je(e[v+(k+1<<1)>>1]|0,0,65537,65537)|0,O=D,(k|0)>0):0){P=0;do{ra=v+((P|1)<<1)|0;qa=ra;b[qa>>1]=N;b[qa+2>>1]=N>>>16;ra=ra+4|0;b[ra>>1]=O;b[ra+2>>1]=O>>>16;P=P+4|0}while((P|0)<(k|0));P=87}else P=87;if((P|0)==87)if(!M){b[v>>1]=b[w>>1]|0;P=89}else P=89;if((P|0)==89)if((Z|0)==0?(K=je(e[v>>1]|0,0,65537,65537)|0,L=D,(k|0)>0):0){M=0;do{ra=y+((M|1)<<1)|0;qa=ra;b[qa>>1]=K;b[qa+2>>1]=K>>>16;ra=ra+4|0;b[ra>>1]=L;b[ra+2>>1]=L>>>16;M=M+4|0}while((M|0)<(k|0));P=92}else P=92;if(((P|0)==92?!W:0)?(J=je(e[y+(k<<1)>>1]|0,0,65537,65537)|0,I=D,(k|0)>0):0){K=k+1|0;L=0;do{ra=y+(K+L<<1)|0;qa=ra;b[qa>>1]=J;b[qa+2>>1]=J>>>16;ra=ra+4|0;b[ra>>1]=I;b[ra+2>>1]=I>>>16;L=L+4|0}while((L|0)<(k|0))}I=b[v>>1]|0;b[y>>1]=I;b:do if(!(c[s+13112>>2]|0)){if(p){if((r|0)==1|(k|0)==4){u=B;break}}else if(((r|0)==1?1:(c[s+4>>2]|0)!=3)|(k|0)==4){u=B;break}ra=r+ -26|0;ra=(ra|0)>-1?ra:26-r|0;qa=r+ -10|0;qa=(qa|0)>-1?qa:10-r|0;if((((ra|0)>(qa|0)?qa:ra)|0)>(c[1576+(h+ -3<<2)>>2]|0)){J=1<>0]|0)!=0&(h|0)==5?(G=I&65535,H=b[y+128>>1]|0,F=H&65535,ra=F+G-(e[y+64>>1]<<1)|0,(((ra|0)>-1?ra:0-ra|0)|0)<(J|0)):0)?(C=v+128|0,E=b[C>>1]|0,ra=(E&65535)+G-(e[v+64>>1]<<1)|0,(((ra|0)>-1?ra:0-ra|0)|0)<(J|0)):0){b[x>>1]=I;b[x+128>>1]=H;y=0;do{ra=y;y=y+1|0;b[x+(y<<1)>>1]=(($(G,63-ra|0)|0)+32+($(F,y)|0)|0)>>>6}while((y|0)!=63);y=0;while(1){x=y+1|0;b[v+(x<<1)>>1]=(($(I&65535,63-y|0)|0)+32+($(E&65535,x)|0)|0)>>>6;if((x|0)==63)break b;I=b[v>>1]|0;E=b[C>>1]|0;y=x}}C=k<<1;H=b[v+(C<<1)>>1]|0;b[A+(C<<1)>>1]=H;F=b[y+(C<<1)>>1]|0;b[x+(C<<1)>>1]=F;C=C+ -2|0;E=(C|0)>-1;if(E){G=C;while(1){ra=G+1|0;qa=H;H=b[v+(ra<<1)>>1]|0;b[A+(ra<<1)>>1]=((qa&65535)+2+((H&65535)<<1)+(e[v+(G<<1)>>1]|0)|0)>>>2;if((G|0)<=0)break;else G=G+ -1|0}}ra=((e[w>>1]|0)+2+((I&65535)<<1)+(e[B>>1]|0)|0)>>>2&65535;b[A>>1]=ra;b[x>>1]=ra;if(E)while(1){ra=C+1|0;qa=F;F=b[y+(ra<<1)>>1]|0;b[x+(ra<<1)>>1]=((qa&65535)+2+((F&65535)<<1)+(e[y+(C<<1)>>1]|0)|0)>>>2;if((C|0)<=0){w=z;break}else C=C+ -1|0}else w=z}else u=B}else u=B;while(0);if(!r){Vb(o,u,w,d,h);i=l;return}else if((r|0)==1){if((k|0)>0){j=k;q=0;do{j=(e[w+(q<<1)>>1]|0)+j+(e[u+(q<<1)>>1]|0)|0;q=q+1|0}while((q|0)!=(k|0));r=j>>h+1;s=je(r|0,((r|0)<0)<<31>>31|0,65537,65537)|0;t=D;q=0;do{j=($(q,d)|0)+m|0;h=0;do{ra=n+(j+h<<1)|0;qa=ra;a[qa>>0]=s;a[qa+1>>0]=s>>8;a[qa+2>>0]=s>>16;a[qa+3>>0]=s>>24;ra=ra+4|0;a[ra>>0]=t;a[ra+1>>0]=t>>8;a[ra+2>>0]=t>>16;a[ra+3>>0]=t>>24;h=h+4|0}while((h|0)<(k|0));q=q+1|0}while((q|0)!=(k|0))}else r=k>>h+1;if(!(p&(k|0)<32)){i=l;return}b[o>>1]=((r<<1)+2+(e[w>>1]|0)+(e[u>>1]|0)|0)>>>2;if((k|0)<=1){i=l;return}o=(r*3|0)+2|0;p=1;do{b[n+(p+m<<1)>>1]=((e[u+(p<<1)>>1]|0)+o|0)>>>2;p=p+1|0}while((p|0)!=(k|0));p=1;do{b[n+(($(p,d)|0)+m<<1)>>1]=((e[w+(p<<1)>>1]|0)+o|0)>>>2;p=p+1|0}while((p|0)!=(k|0));i=l;return}else{if(!(c[s+13104>>2]|0))m=0;else m=(a[t+31256>>0]|0)!=0;Wb(o,u,w,d,j,r,k,m&1,q);i=l;return}}function Vb(a,c,d,f,g){a=a|0;c=c|0;d=d|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;m=i;j=1<>1]|0,l-r|0)|0;s=r;r=r+1|0;u=$(e[h>>1]|0,r)|0;t=$(e[c+(s<<1)>>1]|0,p)|0;b[a+(s+q<<1)>>1]=v+j+u+t+($(e[k>>1]|0,n)|0)>>g}while((r|0)!=(j|0))}while((n|0)!=(j|0));i=m;return}function Wb(c,f,g,h,j,k,l,m,n){c=c|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var 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;o=i;i=i+208|0;r=o;p=a[1592+(k+ -2)>>0]|0;q=r+(l<<1)|0;s=($(p,l)|0)>>5;if((k|0)>17){u=f+ -2|0;t=k+ -11|0;if(t>>>0<15&(s|0)<-1){if((l|0)>=0){u=0;do{w=f+(u+ -1<<1)|0;y=w;y=d[y>>0]|d[y+1>>0]<<8|d[y+2>>0]<<16|d[y+3>>0]<<24;w=w+4|0;w=d[w>>0]|d[w+1>>0]<<8|d[w+2>>0]<<16|d[w+3>>0]<<24;x=r+(u+l<<1)|0;v=x;b[v>>1]=y;b[v+2>>1]=y>>>16;x=x+4|0;b[x>>1]=w;b[x+2>>1]=w>>>16;u=u+4|0}while((u|0)<=(l|0))}if((s|0)<0){t=b[1632+(t<<1)>>1]|0;do{b[r+(s+l<<1)>>1]=b[g+((($(t,s)|0)+128>>8)+ -1<<1)>>1]|0;s=s+1|0}while((s|0)!=0)}}else q=u;r=(l|0)>0;if(r){s=0;do{w=s;s=s+1|0;v=$(s,p)|0;t=v>>5;v=v&31;if(!v){t=t+1|0;v=$(w,h)|0;u=0;do{x=q+(t+u<<1)|0;z=x;z=d[z>>0]|d[z+1>>0]<<8|d[z+2>>0]<<16|d[z+3>>0]<<24;x=x+4|0;x=d[x>>0]|d[x+1>>0]<<8|d[x+2>>0]<<16|d[x+3>>0]<<24;y=c+(u+v<<1)|0;w=y;a[w>>0]=z;a[w+1>>0]=z>>8;a[w+2>>0]=z>>16;a[w+3>>0]=z>>24;y=y+4|0;a[y>>0]=x;a[y+1>>0]=x>>8;a[y+2>>0]=x>>16;a[y+3>>0]=x>>24;u=u+4|0}while((u|0)<(l|0))}else{u=32-v|0;w=$(w,h)|0;x=0;do{z=x+t|0;y=$(e[q+(z+1<<1)>>1]|0,u)|0;b[c+(x+w<<1)>>1]=(y+16+($(e[q+(z+2<<1)>>1]|0,v)|0)|0)>>>5;z=x|1;y=z+t|0;A=$(e[q+(y+1<<1)>>1]|0,u)|0;b[c+(z+w<<1)>>1]=(A+16+($(e[q+(y+2<<1)>>1]|0,v)|0)|0)>>>5;z=x|2;y=z+t|0;A=$(e[q+(y+1<<1)>>1]|0,u)|0;b[c+(z+w<<1)>>1]=(A+16+($(e[q+(y+2<<1)>>1]|0,v)|0)|0)>>>5;z=x|3;y=z+t|0;A=$(e[q+(y+1<<1)>>1]|0,u)|0;b[c+(z+w<<1)>>1]=(A+16+($(e[q+(y+2<<1)>>1]|0,v)|0)|0)>>>5;x=x+4|0}while((x|0)<(l|0))}}while((s|0)!=(l|0))}if(!((k|0)==26&(j|0)==0&(l|0)<32&(m|0)==0&r)){i=o;return}j=g+ -2|0;k=1<>1]|0)-(e[j>>1]|0)>>1)+(e[f>>1]|0)|0;if(p&m)p=0-p>>31&k;b[c+(($(n,h)|0)<<1)>>1]=p;n=n+1|0}while((n|0)!=(l|0));i=o;return}u=g+ -2|0;t=k+ -11|0;if(t>>>0<15&(s|0)<-1){if((l|0)>=0){u=0;do{z=g+(u+ -1<<1)|0;x=z;x=d[x>>0]|d[x+1>>0]<<8|d[x+2>>0]<<16|d[x+3>>0]<<24;z=z+4|0;z=d[z>>0]|d[z+1>>0]<<8|d[z+2>>0]<<16|d[z+3>>0]<<24;A=r+(u+l<<1)|0;y=A;b[y>>1]=x;b[y+2>>1]=x>>>16;A=A+4|0;b[A>>1]=z;b[A+2>>1]=z>>>16;u=u+4|0}while((u|0)<=(l|0))}if((s|0)<0){t=b[1632+(t<<1)>>1]|0;do{b[r+(s+l<<1)>>1]=b[f+((($(t,s)|0)+128>>8)+ -1<<1)>>1]|0;s=s+1|0}while((s|0)!=0)}}else q=u;r=(l|0)>0;if(r){t=0;do{s=t;t=t+1|0;w=$(t,p)|0;x=w>>5;w=w&31;if(!w){v=x+1|0;u=0;do{b[c+(($(u,h)|0)+s<<1)>>1]=b[q+(v+u<<1)>>1]|0;u=u+1|0}while((u|0)!=(l|0))}else{v=32-w|0;u=0;do{A=u+x|0;z=$(e[q+(A+1<<1)>>1]|0,v)|0;b[c+(($(u,h)|0)+s<<1)>>1]=(z+16+($(e[q+(A+2<<1)>>1]|0,w)|0)|0)>>>5;u=u+1|0}while((u|0)!=(l|0))}}while((t|0)!=(l|0))}if(!((k|0)==10&(j|0)==0&(l|0)<32&(m|0)==0&r)){i=o;return}h=f+ -2|0;j=1<>1]|0)-(e[h>>1]|0)>>1)+(e[g>>1]|0)|0;if(m&n)m=0-m>>31&j;b[c+(k<<1)>>1]=m;m=k|1;p=((e[f+(m<<1)>>1]|0)-(e[h>>1]|0)>>1)+(e[g>>1]|0)|0;if(p&n)p=0-p>>31&j;b[c+(m<<1)>>1]=p;m=k|2;p=((e[f+(m<<1)>>1]|0)-(e[h>>1]|0)>>1)+(e[g>>1]|0)|0;if(p&n)p=0-p>>31&j;b[c+(m<<1)>>1]=p;m=k|3;p=((e[f+(m<<1)>>1]|0)-(e[h>>1]|0)>>1)+(e[g>>1]|0)|0;if(p&n)p=0-p>>31&j;b[c+(m<<1)>>1]=p;k=k+4|0}while((k|0)<(l|0));i=o;return}function Xb(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0;g=i;h=c[e>>2]|0;if(!h){i=g;return}if(!(c[h+304>>2]|0)){i=g;return}h=e+46|0;f=(d[h>>0]|0)&(f^255)&255;a[h>>0]=f;if(f<<24>>24){i=g;return}Uc(c[b+4>>2]|0,e+4|0);c[e+24>>2]=0;i=g;return}function Yb(a){a=a|0;var b=0;b=i;Xb(a,a+2524|0,6);i=b;return}function Zb(a){a=a|0;var b=0;b=i;Xb(a,a+2524|0,-1);i=b;return}function _b(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;g=i;h=d+4364|0;if(((c[(c[d+2524>>2]|0)+304>>2]|0)!=0?(b[d+2568>>1]|0)==(b[h>>1]|0):0)?(c[d+2544>>2]|0)==(f|0):0){j=-1094995529;i=g;return j|0}j=d+2524|0;if(c[(c[j>>2]|0)+304>>2]|0){j=-12;i=g;return j|0}if((Tc(c[d+4>>2]|0,d+2528|0,1)|0)<0){j=-12;i=g;return j|0}k=d+200|0;m=c[k>>2]|0;c[d+2540>>2]=$(c[m+13132>>2]|0,c[m+13128>>2]|0)|0;m=d+4520|0;l=c[j>>2]|0;c[l+244>>2]=(c[m>>2]|0)==1&1;c[l+240>>2]=((c[m>>2]|0)+ -1|0)>>>0<2&1;c[e>>2]=l;c[d+2520>>2]=j;a[d+2570>>0]=(a[d+1450>>0]|0)==0?2:3;c[d+2544>>2]=f;b[d+2568>>1]=b[h>>1]|0;j=d+2552|0;f=(c[k>>2]|0)+20|0;c[j+0>>2]=c[f+0>>2];c[j+4>>2]=c[f+4>>2];c[j+8>>2]=c[f+8>>2];c[j+12>>2]=c[f+12>>2];j=0;i=g;return j|0}function $b(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,p=0;g=i;l=d+2046|0;k=d+2572|0;h=d+4366|0;n=(f|0)==0;m=d+4364|0;f=d+200|0;while(1){if((a[l>>0]|0)==1){p=d+2524|0;o=d+2570|0;if(((a[o>>0]&8)==0?(c[d+2544>>2]|0)!=(c[k>>2]|0):0)?(b[d+2568>>1]|0)==(b[h>>1]|0):0)Xb(d,p,1)}else o=d+2570|0;if(!(a[o>>0]&1))o=0;else o=(b[d+2568>>1]|0)==(b[h>>1]|0)&1;if(((n?(b[h>>1]|0)==(b[m>>1]|0):0)?(j=c[f>>2]|0,(j|0)!=0):0)?(o|0)<=(c[j+(((c[j+72>>2]|0)+ -1|0)*12|0)+80>>2]|0):0){d=0;h=21;break}if(o){h=15;break}o=b[h>>1]|0;if(o<<16>>16==(b[m>>1]|0)){d=0;h=21;break}b[h>>1]=(o&65535)+1&255}if((h|0)==15){h=d+2524|0;e=Ad(e,c[h>>2]|0)|0;if(!(a[d+2570>>0]&8))Xb(d,h,1);else Xb(d,h,9);p=(e|0)<0?e:1;i=g;return p|0}else if((h|0)==21){i=g;return d|0}return 0}function ac(){var b=0,c=0,d=0,e=0,f=0;b=i;if(!(a[1664]|0))c=0;else{i=b;return}do{d=0;do{f=($(d<<1|1,c)|0)&127;e=f>>>0>63;f=e?f+ -64|0:f;e=e?-1:1;if((f|0)>31){f=64-f|0;e=0-e|0}a[1664+(c<<5)+d>>0]=$(a[2688+f>>0]|0,e)|0;d=d+1|0}while((d|0)!=32);c=c+1|0}while((c|0)!=32);i=b;return}function bc(a,b){a=a|0;b=b|0;c[a>>2]=4;c[a+4>>2]=1;c[a+8>>2]=2;c[a+12>>2]=3;c[a+16>>2]=4;c[a+20>>2]=1;c[a+24>>2]=2;c[a+28>>2]=1;c[a+32>>2]=3;c[a+36>>2]=4;c[a+40>>2]=5;c[a+44>>2]=6;c[a+48>>2]=2;c[a+52>>2]=3;c[a+56>>2]=4;c[a+60>>2]=5;c[a+64>>2]=1;c[a+68>>2]=1;c[a+72>>2]=2;c[a+1676>>2]=5;c[a+1680>>2]=6;c[a+1684>>2]=1;c[a+1688>>2]=2;c[a+1692>>2]=5;c[a+1696>>2]=6;c[a+1700>>2]=1;c[a+1704>>2]=2;return}function cc(a,c,d,e,f,g,h){a=a|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;j=i;c=c>>>1;if((e|0)<=0){i=j;return}k=(d|0)>0;h=h-g|0;l=0;while(1){if(k){m=0;do{b[a+(m<<1)>>1]=(_c(f,g)|0)<>>1;f=1<>1]|0)+(e[k>>1]|0)|0;if(n&h)n=0-n>>31&f;b[k>>1]=n;m=m+1|0;if((m|0)==4)break;else l=l+2|0}j=j+1|0;if((j|0)==4)break;else{c=c+8|0;a=a+(d<<1)|0}}i=g;return}function ec(a,c,d,f){a=a|0;c=c|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;d=d>>>1;f=1<>1]|0)+(e[k>>1]|0)|0;if(n&h)n=0-n>>31&f;b[k>>1]=n;m=m+1|0;if((m|0)==8)break;else l=l+2|0}j=j+1|0;if((j|0)==8)break;else{c=c+16|0;a=a+(d<<1)|0}}i=g;return} -function hc(a,c,d,f){a=a|0;c=c|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;d=d>>>1;f=1<>1]|0)+(e[k>>1]|0)|0;if(n&h)n=0-n>>31&f;b[k>>1]=n;m=m+1|0;if((m|0)==16)break;else l=l+2|0}j=j+1|0;if((j|0)==16)break;else{c=c+32|0;a=a+(d<<1)|0}}i=g;return}function ic(a,c,d,f){a=a|0;c=c|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;d=d>>>1;f=1<>1]|0)+(e[k>>1]|0)|0;if(n&h)n=0-n>>31&f;b[k>>1]=n;m=m+1|0;if((m|0)==32)break;else l=l+2|0}j=j+1|0;if((j|0)==32)break;else{c=c+64|0;a=a+(d<<1)|0}}i=g;return}function jc(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;c=c<<16>>16;d=15-d-c|0;c=1<0){f=1<0){h=a;a=0}else{i=e;return}while(1){j=h;g=0;while(1){b[j>>1]=(b[j>>1]|0)+f>>d;g=g+1|0;if((g|0)==(c|0))break;else j=j+2|0}a=a+1|0;if((a|0)==(c|0))break;else h=h+(c<<1)|0}i=e;return}if((c|0)<=0){i=e;return}d=0-d|0;f=0;while(1){g=a;h=0;while(1){b[g>>1]=b[g>>1]<>16);if(d){d=c+ -1|0;if((d|0)<=0){i=f;return}g=(c|0)>0;h=0;do{if(g){j=0;do{k=a+(j+c<<1)|0;b[k>>1]=(e[k>>1]|0)+(e[a+(j<<1)>>1]|0);j=j+1|0}while((j|0)!=(c|0))}a=a+(c<<1)|0;h=h+1|0}while((h|0)!=(d|0));i=f;return}if((c|0)<=0){i=f;return}d=(c|0)>1;h=0;while(1){if(d){j=b[a>>1]|0;g=1;do{k=a+(g<<1)|0;j=(e[k>>1]|0)+(j&65535)&65535;b[k>>1]=j;g=g+1|0}while((g|0)!=(c|0))}h=h+1|0;if((h|0)==(c|0))break;else a=a+(c<<1)|0}i=f;return}function lc(a,c){a=a|0;c=c|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;d=i;e=0;g=a;while(1){q=b[g>>1]|0;n=g+16|0;o=b[n>>1]|0;h=o+q|0;f=g+24|0;p=b[f>>1]|0;m=p+o|0;j=q-p|0;l=g+8|0;k=(b[l>>1]|0)*74|0;p=((q-o+p|0)*74|0)+64|0;o=p>>7;if((o+32768|0)>>>0>65535)o=p>>31^32767;b[n>>1]=o;o=(h*29|0)+64+(m*55|0)+k|0;n=o>>7;if((n+32768|0)>>>0>65535)n=o>>31^32767;b[g>>1]=n;m=($(m,-29)|0)+64+(j*55|0)+k|0;n=m>>7;if((n+32768|0)>>>0>65535)n=m>>31^32767;b[l>>1]=n;j=(h*55|0)+64+(j*29|0)-k|0;h=j>>7;if((h+32768|0)>>>0>65535)h=j>>31^32767;b[f>>1]=h;e=e+1|0;if((e|0)==4)break;else g=g+2|0}e=20-c|0;c=1<>1]|0;n=a+4|0;q=b[n>>1]|0;l=q+p|0;f=a+6|0;o=b[f>>1]|0;m=o+q|0;h=p-o|0;k=a+2|0;j=(b[k>>1]|0)*74|0;o=((p-q+o|0)*74|0)+c>>e;if((o+32768|0)>>>0>65535)o=o>>31^32767;b[n>>1]=o;n=(l*29|0)+c+(m*55|0)+j>>e;if((n+32768|0)>>>0>65535)n=n>>31^32767;b[a>>1]=n;m=($(m,-29)|0)+c+(h*55|0)+j>>e;if((m+32768|0)>>>0>65535)m=m>>31^32767;b[k>>1]=m;h=(l*55|0)+c+(h*29|0)-j>>e;if((h+32768|0)>>>0>65535)h=h>>31^32767;b[f>>1]=h;g=g+1|0;if((g|0)==4)break;else a=a+8|0}i=d;return}function mc(a,c,d){a=a|0;c=c|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;c=i;e=0;g=a;while(1){n=b[g>>1]<<6;k=g+16|0;m=b[k>>1]<<6;j=m+n|0;m=n-m|0;n=g+8|0;l=b[n>>1]|0;f=g+24|0;o=b[f>>1]|0;h=(o*36|0)+(l*83|0)|0;l=($(o,-83)|0)+(l*36|0)|0;o=j+64+h|0;p=o>>7;if((p+32768|0)>>>0>65535)p=o>>31^32767;b[g>>1]=p;p=m+64+l|0;o=p>>7;if((o+32768|0)>>>0>65535)o=p>>31^32767;b[n>>1]=o;l=m-l+64|0;m=l>>7;if((m+32768|0)>>>0>65535)m=l>>31^32767;b[k>>1]=m;j=j-h+64|0;h=j>>7;if((h+32768|0)>>>0>65535)h=j>>31^32767;b[f>>1]=h;e=e+1|0;if((e|0)==4)break;else g=g+2|0}e=20-d|0;d=1<>1]<<6;k=a+4|0;o=b[k>>1]<<6;m=a+2|0;l=b[m>>1]|0;f=a+6|0;j=b[f>>1]|0;h=(j*36|0)+(l*83|0)|0;l=($(j,-83)|0)+(l*36|0)|0;j=o+n+d|0;p=j+h>>e;if((p+32768|0)>>>0>65535)p=p>>31^32767;b[a>>1]=p;n=n-o+d|0;o=n+l>>e;if((o+32768|0)>>>0>65535)o=o>>31^32767;b[m>>1]=o;l=n-l>>e;if((l+32768|0)>>>0>65535)l=l>>31^32767;b[k>>1]=l;h=j-h>>e;if((h+32768|0)>>>0>65535)h=h>>31^32767;b[f>>1]=h;g=g+1|0;if((g|0)==4)break;else a=a+8|0}i=c;return}function nc(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,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;j=i;i=i+64|0;r=j+48|0;p=j+32|0;g=j+16|0;h=j;q=(e|0)>8;s=e+4|0;k=r+4|0;l=r+8|0;m=r+12|0;o=0;s=(s|0)>8?8:s;n=d;while(1){c[p+0>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;w=(s|0)>1;t=0;do{if(w){v=p+(t<<2)|0;u=c[v>>2]|0;x=1;do{u=($(b[n+(x<<3<<1)>>1]|0,a[1664+(x<<2<<5)+t>>0]|0)|0)+u|0;x=x+2|0}while((x|0)<(s|0));c[v>>2]=u}t=t+1|0}while((t|0)!=4);w=b[n>>1]<<6;v=b[n+64>>1]<<6;x=v+w|0;v=w-v|0;w=b[n+32>>1]|0;u=b[n+96>>1]|0;t=(u*36|0)+(w*83|0)|0;w=($(u,-83)|0)+(w*36|0)|0;u=t+x|0;c[r>>2]=u;c[k>>2]=w+v;c[l>>2]=v-w;c[m>>2]=x-t;t=0;while(1){v=c[p+(t<<2)>>2]|0;w=u+64+v|0;x=w>>7;if((x+32768|0)>>>0>65535)x=w>>31^32767;b[n+(t<<3<<1)>>1]=x;v=u-v+64|0;u=v>>7;if((u+32768|0)>>>0>65535)u=v>>31^32767;b[n+(7-t<<3<<1)>>1]=u;t=t+1|0;if((t|0)==4)break;u=c[r+(t<<2)>>2]|0}if((s|0)<8)s=(o&3|0)==0&(o|0)!=0?s+ -4|0:s;o=o+1|0;if((o|0)==8)break;else n=n+2|0}k=q?8:e;l=20-f|0;m=1<1;n=g+4|0;o=g+8|0;e=g+12|0;p=0;while(1){c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;t=0;do{if(f){q=h+(t<<2)|0;s=c[q>>2]|0;r=1;do{s=($(b[d+(r<<1)>>1]|0,a[1664+(r<<2<<5)+t>>0]|0)|0)+s|0;r=r+2|0}while((r|0)<(k|0));c[q>>2]=s}t=t+1|0}while((t|0)!=4);w=b[d>>1]<<6;v=b[d+8>>1]<<6;x=v+w|0;v=w-v|0;w=b[d+4>>1]|0;s=b[d+12>>1]|0;q=(s*36|0)+(w*83|0)|0;w=($(s,-83)|0)+(w*36|0)|0;s=q+x|0;c[g>>2]=s;c[n>>2]=w+v;c[o>>2]=v-w;c[e>>2]=x-q;q=0;while(1){r=c[h+(q<<2)>>2]|0;s=s+m|0;t=s+r>>l;if((t+32768|0)>>>0>65535)t=t>>31^32767;b[d+(q<<1)>>1]=t;r=s-r>>l;if((r+32768|0)>>>0>65535)r=r>>31^32767;b[d+(7-q<<1)>>1]=r;q=q+1|0;if((q|0)==4)break;s=c[g+(q<<2)>>2]|0}p=p+1|0;if((p|0)==8)break;else d=d+16|0}i=j;return}function oc(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,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;g=i;i=i+192|0;t=g+160|0;u=g+128|0;v=g+112|0;s=g+96|0;j=g+64|0;l=g+32|0;h=g+16|0;k=g;m=(e|0)>16;w=e+4|0;n=v+4|0;o=v+8|0;p=v+12|0;r=0;w=(w|0)>16?16:w;q=d;while(1){c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;c[u+12>>2]=0;c[u+16>>2]=0;c[u+20>>2]=0;c[u+24>>2]=0;c[u+28>>2]=0;A=(w|0)>1;B=0;do{if(A){z=u+(B<<2)|0;x=c[z>>2]|0;y=1;do{x=($(b[q+(y<<4<<1)>>1]|0,a[1664+(y<<1<<5)+B>>0]|0)|0)+x|0;y=y+2|0}while((y|0)<(w|0));c[z>>2]=x}B=B+1|0}while((B|0)!=8);c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;c[s+12>>2]=0;y=0;do{x=s+(y<<2)|0;A=c[x>>2]|0;z=1;do{A=($(b[q+(z<<5<<1)>>1]|0,a[1664+(z<<2<<5)+y>>0]|0)|0)+A|0;z=z+2|0}while((z|0)<8);c[x>>2]=A;y=y+1|0}while((y|0)!=4);A=b[q>>1]<<6;z=b[q+256>>1]<<6;B=z+A|0;z=A-z|0;A=b[q+128>>1]|0;x=b[q+384>>1]|0;y=(x*36|0)+(A*83|0)|0;A=($(x,-83)|0)+(A*36|0)|0;x=y+B|0;c[v>>2]=x;c[n>>2]=A+z;c[o>>2]=z-A;c[p>>2]=B-y;y=0;while(1){B=c[s+(y<<2)>>2]|0;c[t+(y<<2)>>2]=B+x;c[t+(7-y<<2)>>2]=x-B;y=y+1|0;if((y|0)==4){x=0;break}x=c[v+(y<<2)>>2]|0}do{z=c[t+(x<<2)>>2]|0;y=c[u+(x<<2)>>2]|0;B=z+64+y|0;A=B>>7;if((A+32768|0)>>>0>65535)A=B>>31^32767;b[q+(x<<4<<1)>>1]=A;y=z-y+64|0;z=y>>7;if((z+32768|0)>>>0>65535)z=y>>31^32767;b[q+(15-x<<4<<1)>>1]=z;x=x+1|0}while((x|0)!=8);if((w|0)<16)w=(r&3|0)==0&(r|0)!=0?w+ -4|0:w;r=r+1|0;if((r|0)==16)break;else q=q+2|0}m=m?16:e;f=20-f|0;n=1<1;o=h+4|0;r=h+8|0;p=h+12|0;s=0;while(1){c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;c[l+16>>2]=0;c[l+20>>2]=0;c[l+24>>2]=0;c[l+28>>2]=0;v=0;do{if(q){e=l+(v<<2)|0;u=c[e>>2]|0;t=1;do{u=($(b[d+(t<<1)>>1]|0,a[1664+(t<<1<<5)+v>>0]|0)|0)+u|0;t=t+2|0}while((t|0)<(m|0));c[e>>2]=u}v=v+1|0}while((v|0)!=8);c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;e=0;do{t=k+(e<<2)|0;v=c[t>>2]|0;u=1;do{v=($(b[d+(u<<1<<1)>>1]|0,a[1664+(u<<2<<5)+e>>0]|0)|0)+v|0;u=u+2|0}while((u|0)<8);c[t>>2]=v;e=e+1|0}while((e|0)!=4);A=b[d>>1]<<6;z=b[d+16>>1]<<6;B=z+A|0;z=A-z|0;A=b[d+8>>1]|0;t=b[d+24>>1]|0;u=(t*36|0)+(A*83|0)|0;A=($(t,-83)|0)+(A*36|0)|0;t=u+B|0;c[h>>2]=t;c[o>>2]=A+z;c[r>>2]=z-A;c[p>>2]=B-u;u=0;while(1){B=c[k+(u<<2)>>2]|0;c[j+(u<<2)>>2]=B+t;c[j+(7-u<<2)>>2]=t-B;u=u+1|0;if((u|0)==4){t=0;break}t=c[h+(u<<2)>>2]|0}do{u=c[l+(t<<2)>>2]|0;v=(c[j+(t<<2)>>2]|0)+n|0;e=v+u>>f;if((e+32768|0)>>>0>65535)e=e>>31^32767;b[d+(t<<1)>>1]=e;u=v-u>>f;if((u+32768|0)>>>0>65535)u=u>>31^32767;b[d+(15-t<<1)>>1]=u;t=t+1|0}while((t|0)!=8);s=s+1|0;if((s|0)==16)break;else d=d+32|0}i=g;return}function pc(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,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;i=i+320|0;h=g+256|0;n=g+192|0;o=g+160|0;s=g+128|0;u=g+112|0;t=g+96|0;m=g+64|0;k=g+32|0;j=g+16|0;l=g;q=(e|0)>32;y=e+4|0;v=u+4|0;w=u+8|0;x=u+12|0;p=0;y=(y|0)>32?32:y;r=d;while(1){z=n+0|0;A=z+64|0;do{c[z>>2]=0;z=z+4|0}while((z|0)<(A|0));z=(y|0)>1;C=0;do{if(z){B=n+(C<<2)|0;A=c[B>>2]|0;D=1;do{A=($(b[r+(D<<5<<1)>>1]|0,a[1664+(D<<5)+C>>0]|0)|0)+A|0;D=D+2|0}while((D|0)<(y|0));c[B>>2]=A}C=C+1|0}while((C|0)!=16);c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;c[s+12>>2]=0;c[s+16>>2]=0;c[s+20>>2]=0;c[s+24>>2]=0;c[s+28>>2]=0;z=(y|0)/2|0;A=(y|0)>3;B=0;do{if(A){C=s+(B<<2)|0;D=c[C>>2]|0;E=1;do{D=($(b[r+(E<<6<<1)>>1]|0,a[1664+(E<<1<<5)+B>>0]|0)|0)+D|0;E=E+2|0}while((E|0)<(z|0));c[C>>2]=D}B=B+1|0}while((B|0)!=8);c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;C=0;do{z=t+(C<<2)|0;B=c[z>>2]|0;A=1;do{B=($(b[r+(A<<7<<1)>>1]|0,a[1664+(A<<2<<5)+C>>0]|0)|0)+B|0;A=A+2|0}while((A|0)<8);c[z>>2]=B;C=C+1|0}while((C|0)!=4);D=b[r>>1]<<6;C=b[r+1024>>1]<<6;E=C+D|0;C=D-C|0;D=b[r+512>>1]|0;z=b[r+1536>>1]|0;A=(z*36|0)+(D*83|0)|0;D=($(z,-83)|0)+(D*36|0)|0;z=A+E|0;c[u>>2]=z;c[v>>2]=D+C;c[w>>2]=C-D;c[x>>2]=E-A;A=0;while(1){E=c[t+(A<<2)>>2]|0;c[o+(A<<2)>>2]=E+z;c[o+(7-A<<2)>>2]=z-E;A=A+1|0;if((A|0)==4){z=0;break}z=c[u+(A<<2)>>2]|0}do{D=c[o+(z<<2)>>2]|0;E=c[s+(z<<2)>>2]|0;c[h+(z<<2)>>2]=E+D;c[h+(15-z<<2)>>2]=D-E;z=z+1|0}while((z|0)!=8);z=0;do{A=c[h+(z<<2)>>2]|0;B=c[n+(z<<2)>>2]|0;D=A+64+B|0;C=D>>7;if((C+32768|0)>>>0>65535)C=D>>31^32767;b[r+(z<<5<<1)>>1]=C;A=A-B+64|0;B=A>>7;if((B+32768|0)>>>0>65535)B=A>>31^32767;b[r+(31-z<<5<<1)>>1]=B;z=z+1|0}while((z|0)!=16);if((y|0)<32)y=(p&3|0)==0&(p|0)!=0?y+ -4|0:y;p=p+1|0;if((p|0)==32)break;else r=r+2|0}o=q?32:e;e=20-f|0;s=1<1;r=(o|0)/2|0;q=(o|0)>3;p=j+4|0;t=j+8|0;u=j+12|0;v=0;while(1){z=n+0|0;A=z+64|0;do{c[z>>2]=0;z=z+4|0}while((z|0)<(A|0));z=0;do{if(f){w=n+(z<<2)|0;y=c[w>>2]|0;x=1;do{y=($(b[d+(x<<1)>>1]|0,a[1664+(x<<5)+z>>0]|0)|0)+y|0;x=x+2|0}while((x|0)<(o|0));c[w>>2]=y}z=z+1|0}while((z|0)!=16);c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[k+24>>2]=0;c[k+28>>2]=0;z=0;do{if(q){w=k+(z<<2)|0;y=c[w>>2]|0;x=1;do{E=x<<1;y=($(b[d+(E<<1)>>1]|0,a[1664+(E<<5)+z>>0]|0)|0)+y|0;x=x+2|0}while((x|0)<(r|0));c[w>>2]=y}z=z+1|0}while((z|0)!=8);c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;w=0;do{x=l+(w<<2)|0;z=c[x>>2]|0;y=1;do{E=y<<2;z=($(b[d+(E<<1)>>1]|0,a[1664+(E<<5)+w>>0]|0)|0)+z|0;y=y+2|0}while((y|0)<8);c[x>>2]=z;w=w+1|0}while((w|0)!=4);D=b[d>>1]<<6;C=b[d+32>>1]<<6;E=C+D|0;C=D-C|0;D=b[d+16>>1]|0;w=b[d+48>>1]|0;x=(w*36|0)+(D*83|0)|0;D=($(w,-83)|0)+(D*36|0)|0;w=x+E|0;c[j>>2]=w;c[p>>2]=D+C;c[t>>2]=C-D;c[u>>2]=E-x;x=0;while(1){E=c[l+(x<<2)>>2]|0;c[m+(x<<2)>>2]=E+w;c[m+(7-x<<2)>>2]=w-E;x=x+1|0;if((x|0)==4){w=0;break}w=c[j+(x<<2)>>2]|0}do{D=c[m+(w<<2)>>2]|0;E=c[k+(w<<2)>>2]|0;c[h+(w<<2)>>2]=E+D;c[h+(15-w<<2)>>2]=D-E;w=w+1|0}while((w|0)!=8);w=0;do{x=c[n+(w<<2)>>2]|0;y=(c[h+(w<<2)>>2]|0)+s|0;z=y+x>>e;if((z+32768|0)>>>0>65535)z=z>>31^32767;b[d+(w<<1)>>1]=z;x=y-x>>e;if((x+32768|0)>>>0>65535)x=x>>31^32767;b[d+(31-w<<1)>>1]=x;w=w+1|0}while((w|0)!=16);v=v+1|0;if((v|0)==32)break;else d=d+64|0}i=g;return}function qc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0;d=i;c=14-c|0;c=((b[a>>1]|0)+1>>1)+(1<>c&65535;e=0;do{f=e<<2;b[a+(f<<1)>>1]=c;b[a+((f|1)<<1)>>1]=c;b[a+((f|2)<<1)>>1]=c;b[a+((f|3)<<1)>>1]=c;e=e+1|0}while((e|0)!=4);i=d;return}function rc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0;d=i;c=14-c|0;c=((b[a>>1]|0)+1>>1)+(1<>c&65535;e=0;do{f=e<<3;b[a+(f<<1)>>1]=c;b[a+((f|1)<<1)>>1]=c;b[a+((f|2)<<1)>>1]=c;b[a+((f|3)<<1)>>1]=c;b[a+((f|4)<<1)>>1]=c;b[a+((f|5)<<1)>>1]=c;b[a+((f|6)<<1)>>1]=c;b[a+((f|7)<<1)>>1]=c;e=e+1|0}while((e|0)!=8);i=d;return}function sc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0,g=0;d=i;e=14-c|0;e=((b[a>>1]|0)+1>>1)+(1<>e&65535;c=0;do{f=c<<4;g=0;do{b[a+(g+f<<1)>>1]=e;g=g+1|0}while((g|0)!=16);c=c+1|0}while((c|0)!=16);i=d;return}function tc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0,g=0;d=i;e=14-c|0;e=((b[a>>1]|0)+1>>1)+(1<>e&65535;c=0;do{f=c<<5;g=0;do{b[a+(g+f<<1)>>1]=e;g=g+1|0}while((g|0)!=32);c=c+1|0}while((c|0)!=32);i=d;return}function uc(a,f,g,h,j,k,l,m,n,o){a=a|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0;p=i;i=i+128|0;k=p;r=k+0|0;q=r+128|0;do{c[r>>2]=0;r=r+4|0}while((r|0)<(q|0));t=d[j+n+96>>0]|0;g=g>>>1;c[k+((t&31)<<2)>>2]=b[j+(n*10|0)+114>>1];c[k+((t+1&31)<<2)>>2]=b[j+(n*10|0)+116>>1];c[k+((t+2&31)<<2)>>2]=b[j+(n*10|0)+118>>1];c[k+((t+3&31)<<2)>>2]=b[j+(n*10|0)+120>>1];j=o+ -5|0;h=h>>>1;if((m|0)<=0){i=p;return}n=(l|0)>0;o=1<>1]|0;t=t+(c[k+(t>>>j<<2)>>2]|0)|0;if(t&q)t=0-t>>31&o;b[a+(s<<1)>>1]=t;s=s+1|0}while((s|0)!=(l|0))}r=r+1|0;if((r|0)==(m|0))break;else{a=a+(g<<1)|0;f=f+(h<<1)|0}}i=p;return}function vc(a,d,f,g,h,j,k,l,m,n,o,p,q){a=a|0;d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;var r=0,s=0,t=0,u=0,v=0,w=0;n=i;o=h+(m*10|0)+112|0;r=c[h+(m<<2)+100>>2]|0;f=f>>>1;g=g>>>1;if((r|0)!=1){if(c[j>>2]|0){u=b[o>>1]|0;if((l|0)>0){p=1<>1]|0)+u|0;if(v&t)v=0-v>>31&p;b[a+(($(s,f)|0)<<1)>>1]=v;s=s+1|0}while((s|0)!=(l|0));p=1}else p=1}else p=0;if(c[j+8>>2]|0){s=b[o>>1]|0;k=k+ -1|0;if((l|0)>0){v=1<>1]|0)+s|0;if(w&u)w=0-w>>31&v;b[a+(($(t,f)|0)+k<<1)>>1]=w;t=t+1|0}while((t|0)!=(l|0))}}if(!r){u=l;v=p;w=0;t=k;Dc(a,d,f,g,h,t,u,m,v,w,q);i=n;return}}else p=0;if(c[j+4>>2]|0){r=b[o>>1]|0;if((p|0)<(k|0)){s=1<>1]|0)+r|0;if(v&t)v=0-v>>31&s;b[a+(u<<1)>>1]=v;u=u+1|0}while((u|0)!=(k|0));r=1}else r=1}else r=0;if(!(c[j+12>>2]|0)){u=l;v=p;w=r;t=k;Dc(a,d,f,g,h,t,u,m,v,w,q);i=n;return}j=b[o>>1]|0;t=l+ -1|0;o=$(t,f)|0;u=$(t,g)|0;if((p|0)>=(k|0)){u=t;v=p;w=r;t=k;Dc(a,d,f,g,h,t,u,m,v,w,q);i=n;return}s=1<>1]|0)+j|0;if(w&l)w=0-w>>31&s;b[a+(v+o<<1)>>1]=w;v=v+1|0}while((v|0)!=(k|0));Dc(a,d,f,g,h,k,t,m,p,r,q);i=n;return}function wc(d,f,g,h,j,k,l,m,n,o,p,q,r){d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;var 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;t=i;D=j+(n*10|0)+112|0;C=c[j+(n<<2)+100>>2]|0;g=g>>>1;h=h>>>1;B=(C|0)!=1;if(B){if(c[k>>2]|0){I=b[D>>1]|0;if((m|0)>0){H=1<>1]|0)+I|0;if(J&G)J=0-J>>31&H;b[d+(($(F,g)|0)<<1)>>1]=J;F=F+1|0}while((F|0)!=(m|0));F=1}else F=1}else F=0;if(c[k+8>>2]|0){G=b[D>>1]|0;l=l+ -1|0;if((m|0)>0){J=1<>1]|0)+G|0;if(K&I)K=0-K>>31&J;b[d+(($(H,g)|0)+l<<1)>>1]=K;H=H+1|0}while((H|0)!=(m|0))}}if(!C){D=1;G=0}else E=15}else{F=0;E=15}if((E|0)==15){if(c[k+4>>2]|0){H=b[D>>1]|0;if((F|0)<(l|0)){I=1<>1]|0)+H|0;if(J&G)J=0-J>>31&I;b[d+(E<<1)>>1]=J;E=E+1|0}while((E|0)!=(l|0));G=1}else G=1}else G=0;if(c[k+12>>2]|0){D=b[D>>1]|0;m=m+ -1|0;I=$(m,g)|0;H=$(m,h)|0;if((F|0)<(l|0)){K=1<>1]|0)+D|0;if(L&J)L=0-L>>31&K;b[d+(E+I<<1)>>1]=L;E=E+1|0}while((E|0)!=(l|0));D=0}else D=0}else D=0}Dc(d,f,g,h,j,l,m,n,F,G,r);r=(C|0)==2;if((a[q>>0]|0)==0&r?(c[k>>2]|0)==0:0)j=(c[k+4>>2]|0)==0;else j=0;H=j&1;j=q+1|0;C=(C|0)==3;if((a[j>>0]|0)==0&C?(c[k+4>>2]|0)==0:0)n=(c[k+8>>2]|0)==0;else n=0;I=n&1;n=q+2|0;if((a[n>>0]|0)==0&r?(c[k+8>>2]|0)==0:0)E=(c[k+12>>2]|0)==0;else E=0;J=E&1;E=q+3|0;if((a[E>>0]|0)==0&C?(c[k>>2]|0)==0:0)k=(c[k+12>>2]|0)==0;else k=0;k=k&1;B=B^1;if(!((a[o>>0]|0)==0|B)?(A=H+G|0,z=m-k|0,(A|0)<(z|0)):0)do{b[d+(($(A,g)|0)<<1)>>1]=b[f+(($(A,h)|0)<<1)>>1]|0;A=A+1|0}while((A|0)!=(z|0));if(!((a[o+1>>0]|0)==0|B)?(y=I+G|0,x=m-J|0,(y|0)<(x|0)):0){z=l+ -1|0;do{b[d+(z+($(y,g)|0)<<1)>>1]=b[f+(z+($(y,h)|0)<<1)>>1]|0;y=y+1|0}while((y|0)!=(x|0))}if(!((a[p>>0]|0)==0|D)?(w=H+F|0,v=l-I|0,(w|0)<(v|0)):0)do{b[d+(w<<1)>>1]=b[f+(w<<1)>>1]|0;w=w+1|0}while((w|0)!=(v|0));if(!((a[p+1>>0]|0)==0|D)?(u=k+F|0,s=l-J|0,(u|0)<(s|0)):0){v=m+ -1|0;p=$(v,h)|0;v=$(v,g)|0;do{b[d+(u+v<<1)>>1]=b[f+(u+p<<1)>>1]|0;u=u+1|0}while((u|0)!=(s|0))}if((a[q>>0]|0)!=0&r)b[d>>1]=b[f>>1]|0;if((a[j>>0]|0)!=0&C){L=l+ -1|0;b[d+(L<<1)>>1]=b[f+(L<<1)>>1]|0}if((a[n>>0]|0)!=0&r){L=m+ -1|0;K=l+ -1|0;b[d+(K+($(L,g)|0)<<1)>>1]=b[f+(K+($(L,h)|0)<<1)>>1]|0}if(!((a[E>>0]|0)!=0&C)){i=t;return}L=m+ -1|0;b[d+(($(L,g)|0)<<1)>>1]=b[f+(($(L,h)|0)<<1)>>1]|0;i=t;return}function xc(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=i;Cc(a,b,2,c,d,e,f,g);i=h;return}function yc(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=i;Cc(a,2,b,c,d,e,f,g);i=h;return}function zc(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;g=i;Bc(a,b,2,c,d,e,f);i=g;return}function Ac(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;g=i;Bc(a,2,b,c,d,e,f);i=g;return}function Bc(d,f,g,h,j,k,l){d=d|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;m=i;f=f>>>1;p=g>>>1;o=l+ -8|0;g=$(f,-2)|0;n=0-f|0;r=1<>2]<=1){v=0-s|0;u=(a[j+l>>0]|0)==0;t=(a[k+l>>0]|0)==0;x=0;w=d;while(1){y=w+(n<<1)|0;B=e[y>>1]|0;z=e[w>>1]|0;A=(e[w+(g<<1)>>1]|0)+4-(e[w+(f<<1)>>1]|0)+(z-B<<2)>>3;if((A|0)<(v|0))A=v;else A=(A|0)>(s|0)?s:A;if(u){B=A+B|0;if(B&q)B=0-B>>31&r;b[y>>1]=B}if(t){y=z-A|0;if(y&q)y=0-y>>31&r;b[w>>1]=y}x=x+1|0;if((x|0)==4)break;else w=w+(p<<1)|0}}l=l+1|0;if((l|0)==2)break;else d=d+(p<<2<<1)|0}i=m;return}function Cc(d,f,g,h,j,k,l,m){d=d|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=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,aa=0,ba=0,ca=0,da=0,ea=0,fa=0;n=i;f=f>>>1;g=g>>>1;o=m+ -8|0;y=h<>3;u=y>>2;q=$(f,-4)|0;p=f*3|0;v=C+q|0;F=(g+f|0)*3|0;t=(y>>1)+y>>3;H=1<>1]|0;X=b[d+(s<<1)>>1]|0;W=b[d+(w<<1)>>1]|0;da=W&65535;R=(Y&65535)-((X&65535)<<1)+da|0;R=(R|0)>-1?R:0-R|0;T=b[d+(h<<1)>>1]|0;U=b[d+(f<<1)>>1]|0;V=b[d>>1]|0;M=V&65535;S=(T&65535)-((U&65535)<<1)+M|0;S=(S|0)>-1?S:0-S|0;ba=e[d+(z<<1)>>1]|0;Q=(e[d+(A<<1)>>1]|0)-((e[d+(B<<1)>>1]|0)<<1)+ba|0;Q=(Q|0)>-1?Q:0-Q|0;ca=e[d+(C<<1)>>1]|0;Z=(e[d+(D<<1)>>1]|0)-((e[d+(E<<1)>>1]|0)<<1)+ca|0;Z=(Z|0)>-1?Z:0-Z|0;L=S+R|0;aa=Z+Q|0;K=c[j+(I<<2)>>2]<>0]|0;P=a[l+I>>0]|0;do if((aa+L|0)<(y|0)){N=(K*5|0)+1>>1;ea=(e[d+(q<<1)>>1]|0)-da|0;O=b[d+(p<<1)>>1]|0;fa=(O&65535)-M|0;if((((((((fa|0)>-1?fa:0-fa|0)+((ea|0)>-1?ea:0-ea|0)|0)<(x|0)?(fa=da-M|0,(((fa|0)>-1?fa:0-fa|0)|0)<(N|0)):0)?(fa=(e[d+(v<<1)>>1]|0)-ba|0,ea=(e[d+(F<<1)>>1]|0)-ca|0,(((ea|0)>-1?ea:0-ea|0)+((fa|0)>-1?fa:0-fa|0)|0)<(x|0)):0)?(fa=ba-ca|0,(((fa|0)>-1?fa:0-fa|0)|0)<(N|0)):0)?(L<<1|0)<(u|0):0)?(aa<<1|0)<(u|0):0){K=K<<1;L=_<<24>>24==0;M=0-K|0;N=P<<24>>24==0;ba=O;P=1;O=d;while(1){Z=O+(r<<1)|0;Y=Y&65535;_=O+(s<<1)|0;X=X&65535;aa=O+(w<<1)|0;R=W&65535;V=V&65535;W=O+(f<<1)|0;U=U&65535;Q=O+(h<<1)|0;S=T&65535;T=ba&65535;if(L){ba=e[O+(q<<1)>>1]|0;ca=(Y+4+U+(R+X+V<<1)>>3)-R|0;if((ca|0)<(M|0))ca=M;else ca=(ca|0)>(K|0)?K:ca;b[aa>>1]=ca+R;aa=((Y+2+X+R+V|0)>>>2)-X|0;if((aa|0)<(M|0))aa=M;else aa=(aa|0)>(K|0)?K:aa;b[_>>1]=aa+X;_=((Y*3|0)+4+X+R+V+(ba<<1)>>3)-Y|0;if((_|0)<(M|0))_=M;else _=(_|0)>(K|0)?K:_;b[Z>>1]=_+Y}if(N){X=(X+4+S+(V+R+U<<1)>>3)-V|0;if((X|0)<(M|0))X=M;else X=(X|0)>(K|0)?K:X;b[O>>1]=X+V;X=((R+2+V+U+S|0)>>>2)-U|0;if((X|0)<(M|0))X=M;else X=(X|0)>(K|0)?K:X;b[W>>1]=X+U;R=(R+4+V+U+(S*3|0)+(T<<1)>>3)-S|0;if((R|0)<(M|0))R=M;else R=(R|0)>(K|0)?K:R;b[Q>>1]=R+S}Q=O+(g<<1)|0;if((P|0)==4)break;Y=b[O+(g+r<<1)>>1]|0;X=b[O+(g+s<<1)>>1]|0;W=b[O+(g-f<<1)>>1]|0;V=b[Q>>1]|0;U=b[O+(g+f<<1)>>1]|0;T=b[O+(g+h<<1)>>1]|0;ba=b[O+(g+p<<1)>>1]|0;P=P+1|0;O=Q}d=d+(J<<1)|0;break}L=K>>1;N=K*10|0;M=0-K|0;O=_<<24>>24!=0;P=P<<24>>24!=0;Q=(Q+R|0)<(t|0)&(O^1);R=0-L|0;S=(Z+S|0)<(t|0)&(P^1);_=V;ba=U;U=1;V=d;while(1){aa=Y&65535;Y=V+(s<<1)|0;Z=X&65535;da=V+(w<<1)|0;ca=W&65535;_=_&65535;W=V+(f<<1)|0;X=ba&65535;T=T&65535;ba=((_-ca|0)*9|0)+8+($(X-Z|0,-3)|0)>>4;if((((ba|0)>-1?ba:0-ba|0)|0)<(N|0)){if((ba|0)<(M|0))ba=M;else ba=(ba|0)>(K|0)?K:ba;if(!O){ea=ba+ca|0;if(ea&G)ea=0-ea>>31&H;b[da>>1]=ea}if(!P){da=_-ba|0;if(da&G)da=0-da>>31&H;b[V>>1]=da}if(Q){aa=((aa+1+ca|0)>>>1)-Z+ba>>1;if((aa|0)<(R|0))aa=R;else aa=(aa|0)>(L|0)?L:aa;Z=aa+Z|0;if(Z&G)Z=0-Z>>31&H;b[Y>>1]=Z}if(S){T=((_+1+T|0)>>>1)-X-ba>>1;if((T|0)<(R|0))T=R;else T=(T|0)>(L|0)?L:T;T=T+X|0;if(T&G)T=0-T>>31&H;b[W>>1]=T}}Z=V+(g<<1)|0;if((U|0)==4)break;Y=b[V+(g+r<<1)>>1]|0;X=b[V+(g+s<<1)>>1]|0;W=b[V+(g-f<<1)>>1]|0;_=b[Z>>1]|0;ba=b[V+(g+f<<1)>>1]|0;T=b[V+(g+h<<1)>>1]|0;U=U+1|0;V=Z}d=d+(J<<1)|0}else d=d+(m<<1)|0;while(0);I=I+1|0}while((I|0)!=2);i=n;return}function Dc(e,f,g,h,j,k,l,m,n,o,p){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;var 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;t=i;x=c[j+(m<<2)+100>>2]|0;r=a[2728+(x<<2)>>0]|0;q=a[2730+(x<<2)>>0]|0;if((o|0)>=(l|0)){i=t;return}s=(n|0)<(k|0);v=1<>0]|0)+o|0,h)|0;y=$((a[2731+(x<<2)>>0]|0)+o|0,h)|0;x=$(o,g)|0;z=$(o,h)|0;while(1){if(s){o=p+r|0;A=y+q|0;B=n;do{C=b[f+(B+z<<1)>>1]|0;D=b[f+(o+B<<1)>>1]|0;if((C&65535)>(D&65535))D=3;else D=((C<<16>>16!=D<<16>>16)<<31>>31)+2|0;E=b[f+(A+B<<1)>>1]|0;if((C&65535)>(E&65535))E=1;else E=(C<<16>>16!=E<<16>>16)<<31>>31;C=(b[j+(m*10|0)+(d[2720+(E+D)>>0]<<1)+112>>1]|0)+(C&65535)|0;if(C&u)C=0-C>>31&v;b[e+(B+x<<1)>>1]=C;B=B+1|0}while((B|0)!=(k|0))}w=w+1|0;if((w|0)==(l|0))break;else{p=p+h|0;y=y+h|0;x=x+g|0;z=z+h|0}}i=t;return}function Ec(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;j=i;k=c[b+136>>2]|0;l=(c[b+200>>2]|0)+13080|0;r=(1<>2])+ -1|0;o=r&e;n=r&f;q=(n|0)!=0|(a[k+309>>0]|0)!=0;m=q&1;c[k+31296>>2]=m;p=(o|0)!=0|(a[k+308>>0]|0)!=0;b=p&1;c[k+31292>>2]=b;if(!(r&(f|e)))p=d[k+311>>0]|0;else p=p&q&1;c[k+31300>>2]=p;if((o+g|0)==(1<>2]|0))m=(a[k+310>>0]|0)!=0&(n|0)==0&1;c[k+31308>>2]=m;if(!m){q=0;q=q&1;r=k+31304|0;c[r>>2]=q;r=h+f|0;q=k+316|0;q=c[q>>2]|0;q=(r|0)<(q|0);q=q?b:0;r=k+31288|0;c[r>>2]=q;i=j;return}q=(g+e|0)<(c[k+312>>2]|0);q=q&1;r=k+31304|0;c[r>>2]=q;r=h+f|0;q=k+316|0;q=c[q>>2]|0;q=(r|0)<(q|0);q=q?b:0;r=k+31288|0;c[r>>2]=q;i=j;return}function Fc(b){b=b|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;f=i;i=i+16|0;e=f;h=c[b+136>>2]|0;j=h+204|0;k=ud(13196)|0;c[e>>2]=k;if(!k){u=-12;i=f;return u|0}k=c[k+4>>2]|0;m=ud(468)|0;if(!m){u=-12;i=f;return u|0}l=c[m+4>>2]|0;c[l+4>>2]=1;o=l+8|0;c[o>>2]=1;a[l>>0]=0;c[l+348>>2]=1;q=l+352|0;n=l+380|0;r=l+408|0;p=0;do{c[q+(p<<2)>>2]=1;c[n+(p<<2)>>2]=0;c[r+(p<<2)>>2]=-1;p=p+1|0}while((p|0)<(c[o>>2]|0));c[l+436>>2]=0;c[l+440>>2]=1;a[l+444>>0]=0;p=b+208|0;wd(p);c[p>>2]=m;c[k>>2]=0;p=k+72|0;c[p>>2]=1;u=ad(j,8)|0;q=k+4|0;c[q>>2]=u;do if((u|0)<=3){a[k+8>>0]=0;o=k+13120|0;c[o>>2]=ed(j,32)|0;m=ed(j,32)|0;n=k+13124|0;c[n>>2]=m;m=Sc(c[o>>2]|0,m,0,c[b+4>>2]|0)|0;if((m|0)>=0){l=k+52|0;c[l>>2]=(ad(j,8)|0)+8;q=c[q>>2]|0;if(!q){c[k+60>>2]=32;q=32}else if((q|0)==2){c[k+60>>2]=56;q=56}else if((q|0)==1){c[k+60>>2]=54;q=54}else{c[k+60>>2]=58;q=58}c[k+56>>2]=1;q=Cd(q)|0;if(q){c[k+13180>>2]=0;c[k+13168>>2]=0;u=d[q+5>>0]|0;c[k+13172>>2]=u;c[k+13176>>2]=u;u=d[q+6>>0]|0;c[k+13184>>2]=u;c[k+13188>>2]=u;c[k+64>>2]=8;if((c[p>>2]|0)>0){q=k+76|0;r=0;do{c[q+(r*12|0)>>2]=1;c[q+(r*12|0)+4>>2]=0;c[q+(r*12|0)+8>>2]=-1;r=r+1|0}while((r|0)<(c[p>>2]|0))}t=(fd(j)|0)+3|0;u=k+13064|0;c[u>>2]=t;t=1<>2]=s+(c[o>>2]|0)&t;c[n>>2]=s+(c[n>>2]|0)&t;t=k+13068|0;c[t>>2]=fd(j)|0;s=k+13072|0;c[s>>2]=(fd(j)|0)+2;p=fd(j)|0;q=c[s>>2]|0;r=k+13076|0;c[r>>2]=q+p;if(q>>>0<(c[u>>2]|0)>>>0){q=k+13088|0;c[q>>2]=0;p=k+13092|0;c[p>>2]=fd(j)|0;a[k+12941>>0]=dd(j)|0;v=dd(j)|0;c[k+68>>2]=v;if(v){v=k+13044|0;a[v>>0]=(ad(j,4)|0)+1;a[k+13045>>0]=(ad(j,4)|0)+1;w=(fd(j)|0)+3|0;c[k+13048>>2]=w;c[k+13052>>2]=w+(fd(j)|0);if((d[v>>0]|0|0)>(c[l>>2]|0)){m=-1094995529;break}a[k+13056>>0]=dd(j)|0}c[k+2184>>2]=0;a[k+12942>>0]=0;a[k+13060>>0]=0;a[k+13061>>0]=dd(j)|0;c[k+160>>2]=0;c[k+164>>2]=1;if((dd(j)|0)!=0?(w=dd(j)|0,cd(j,7),(w|0)!=0):0){c[k+13096>>2]=dd(j)|0;c[k+13100>>2]=dd(j)|0;c[k+13104>>2]=dd(j)|0;c[k+13108>>2]=dd(j)|0;dd(j)|0;c[k+13112>>2]=dd(j)|0;dd(j)|0;c[k+13116>>2]=dd(j)|0;dd(j)|0}j=c[o>>2]|0;c[k+12>>2]=j;o=c[n>>2]|0;c[k+16>>2]=o;u=c[u>>2]|0;w=(c[t>>2]|0)+u|0;c[k+13080>>2]=w;t=u+ -1|0;c[k+13084>>2]=t;n=1<>w;c[k+13128>>2]=v;n=o+ -1+n>>w;c[k+13132>>2]=n;c[k+13136>>2]=$(n,v)|0;c[k+13140>>2]=j>>u;c[k+13144>>2]=o>>u;v=c[s>>2]|0;c[k+13148>>2]=j>>v;c[k+13152>>2]=o>>v;c[k+13156>>2]=j>>t;c[k+13160>>2]=o>>t;v=w-v|0;c[k+13164>>2]=(1<>2]=((c[l>>2]|0)*6|0)+ -48;u=(1<>>0>6):0)?(c[q>>2]|0)>>>0<=v>>>0:0)?(c[p>>2]|0)>>>0<=v>>>0:0)?(c[r>>2]|0)>>>0<=(w>>>0>5?5:w)>>>0:0)?((c[h+216>>2]|0)-(c[h+212>>2]|0)|0)>=0:0){h=b+272|0;j=c[h>>2]|0;if((j|0)!=0?(w=c[e>>2]|0,(Vd(c[j+4>>2]|0,c[w+4>>2]|0,c[w+8>>2]|0)|0)==0):0){wd(e);w=0;i=f;return w|0}else j=0;do{k=b+(j<<2)+400|0;l=c[k>>2]|0;do if(l){if(c[c[l+4>>2]>>2]|0)break;wd(k)}while(0);j=j+1|0}while((j|0)!=256);j=c[h>>2]|0;do if((j|0)!=0?(g=b+200|0,(c[g>>2]|0)==(c[j+4>>2]|0)):0){v=b+1424|0;wd(v);w=vd(c[h>>2]|0)|0;c[v>>2]=w;if(w)break;c[g>>2]=0}while(0);wd(h);c[h>>2]=c[e>>2];w=0;i=f;return w|0}}else m=-1094995529}else m=-22}}else m=-1094995529;while(0);wd(e);w=m;i=f;return w|0}function Gc(b){b=b|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,E=0,F=0,G=0,H=0,I=0;f=i;i=i+16|0;e=f+4|0;j=f;l=b+136|0;g=c[l>>2]|0;n=g+204|0;h=nd(1692)|0;c[j>>2]=h;if(!h){I=-12;i=f;return I|0}I=rd(h,1692,6,0,0)|0;c[e>>2]=I;if(!I){kd(j);I=-12;i=f;return I|0}a[(c[j>>2]|0)+53>>0]=1;h=c[j>>2]|0;c[h+44>>2]=1;c[h+48>>2]=1;a[h+52>>0]=1;a[(c[j>>2]|0)+57>>0]=0;h=c[j>>2]|0;c[h+60>>2]=0;c[h+64>>2]=0;a[h+1629>>0]=2;h=fd(n)|0;a:do if((h>>>0<=255?(k=fd(n)|0,c[c[j>>2]>>2]=k,k>>>0<=31):0)?(m=c[b+(k<<2)+272>>2]|0,(m|0)!=0):0){k=c[m+4>>2]|0;I=(dd(n)|0)&255;a[(c[j>>2]|0)+41>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+39>>0]=I;I=ad(n,3)|0;c[(c[j>>2]|0)+1624>>2]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+4>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+5>>0]=I;I=(fd(n)|0)+1|0;c[(c[j>>2]|0)+8>>2]=I;I=(fd(n)|0)+1|0;c[(c[j>>2]|0)+12>>2]=I;I=gd(n)|0;c[(c[j>>2]|0)+16>>2]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+20>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+21>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+22>>0]=I;I=c[j>>2]|0;c[I+24>>2]=0;if(a[I+22>>0]|0){I=fd(n)|0;c[(c[j>>2]|0)+24>>2]=I}I=gd(n)|0;c[(c[j>>2]|0)+28>>2]=I;if((I+12|0)>>>0<=24?(I=gd(n)|0,c[(c[j>>2]|0)+32>>2]=I,(I+12|0)>>>0<=24):0){I=(dd(n)|0)&255;a[(c[j>>2]|0)+36>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+37>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+38>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+40>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+42>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+43>>0]=I;if(a[(c[j>>2]|0)+42>>0]|0){m=(fd(n)|0)+1|0;c[(c[j>>2]|0)+44>>2]=m;m=(fd(n)|0)+1|0;o=c[j>>2]|0;c[o+48>>2]=m;o=c[o+44>>2]|0;if(!o){b=-1094995529;break}if((m|0)==0?1:(o|0)>=(c[k+13120>>2]|0)){b=-1094995529;break}if((m|0)>=(c[k+13124>>2]|0)){b=-1094995529;break}m=pd(o,4)|0;c[(c[j>>2]|0)+1648>>2]=m;m=pd(c[(c[j>>2]|0)+48>>2]|0,4)|0;c[(c[j>>2]|0)+1652>>2]=m;m=c[j>>2]|0;if(!(c[m+1648>>2]|0)){b=-12;break}if(!(c[m+1652>>2]|0)){b=-12;break}p=(dd(n)|0)&255;a[(c[j>>2]|0)+52>>0]=p;p=c[j>>2]|0;if(!(a[p+52>>0]|0)){q=(c[p+44>>2]|0)+ -1|0;if((q|0)>0){o=0;m=0;r=0;do{q=(fd(n)|0)+1|0;p=c[j>>2]|0;c[(c[p+1648>>2]|0)+(r<<2)>>2]=q;o=_d(q|0,0,o|0,m|0)|0;m=D;r=r+1|0;q=(c[p+44>>2]|0)+ -1|0}while((r|0)<(q|0))}else{m=0;o=0}r=c[k+13128>>2]|0;s=((r|0)<0)<<31>>31;if(!(m>>>0>>0|(m|0)==(s|0)&o>>>0>>0)){b=-1094995529;break}I=Zd(r|0,s|0,o|0,m|0)|0;c[(c[p+1648>>2]|0)+(q<<2)>>2]=I;q=(c[p+48>>2]|0)+ -1|0;if((q|0)>0){p=0;o=0;r=0;do{q=(fd(n)|0)+1|0;m=c[j>>2]|0;c[(c[m+1652>>2]|0)+(r<<2)>>2]=q;p=_d(q|0,0,p|0,o|0)|0;o=D;r=r+1|0;q=(c[m+48>>2]|0)+ -1|0}while((r|0)<(q|0))}else{m=p;o=0;p=0}r=c[k+13132>>2]|0;s=((r|0)<0)<<31>>31;if(!(o>>>0>>0|(o|0)==(s|0)&p>>>0>>0)){b=-1094995529;break}I=Zd(r|0,s|0,p|0,o|0)|0;c[(c[m+1652>>2]|0)+(q<<2)>>2]=I}I=(dd(n)|0)&255;a[(c[j>>2]|0)+53>>0]=I}I=(dd(n)|0)&255;a[(c[j>>2]|0)+54>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+55>>0]=I;if((a[(c[j>>2]|0)+55>>0]|0)!=0?(I=(dd(n)|0)&255,a[(c[j>>2]|0)+56>>0]=I,I=(dd(n)|0)&255,a[(c[j>>2]|0)+57>>0]=I,(a[(c[j>>2]|0)+57>>0]|0)==0):0){m=(gd(n)|0)<<1;c[(c[j>>2]|0)+60>>2]=m;m=(gd(n)|0)<<1;I=c[j>>2]|0;c[I+64>>2]=m;if(((c[I+60>>2]|0)+13|0)>>>0>26){b=-1094995529;break}if((m+13|0)>>>0>26){b=-1094995529;break}}p=(dd(n)|0)&255;a[(c[j>>2]|0)+68>>0]=p;p=c[j>>2]|0;if(a[p+68>>0]|0){q=0;do{o=p+(q<<6)+69|0;m=o+16|0;do{a[o>>0]=16;o=o+1|0}while((o|0)<(m|0));a[p+q+1605>>0]=16;a[p+q+1611>>0]=16;q=q+1|0}while((q|0)!=6);o=p+453|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+517|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+581|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+645|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+709|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+773|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+837|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+901|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+965|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1029|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1093|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1157|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1221|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1285|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1349|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1413|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1477|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1541|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));m=c[j>>2]|0;v=(c[l>>2]|0)+204|0;w=0;do{p=(w|0)>0?64:16;q=(w|0)>1;o=w+ -2|0;x=(w|0)==3?3:1;r=1<<(w<<1)+4;t=(r|0)>0;s=(w|0)==0;r=(r|0)<64?r:64;u=0;do{if(!(((dd(v)|0)&255)<<24>>24)){y=fd(v)|0;if(y){if(u>>>0>>0){b=-1094995529;break a}y=u-y|0;ce(m+(w*384|0)+(u<<6)+69|0,m+(w*384|0)+(y<<6)+69|0,p|0)|0;if(q)a[m+(o*6|0)+u+1605>>0]=a[m+(o*6|0)+y+1605>>0]|0}}else{if(q){z=(gd(v)|0)+8|0;a[m+(o*6|0)+u+1605>>0]=z}else z=8;if(t){y=0;do{if(s)A=(d[24+y>>0]<<2)+(d[8+y>>0]|0)|0;else A=(d[104+y>>0]<<3)+(d[40+y>>0]|0)|0;z=(z+256+(gd(v)|0)|0)%256|0;a[m+(w*384|0)+(u<<6)+A+69>>0]=z;y=y+1|0}while((y|0)!=(r|0))}}u=u+x|0}while((u|0)<6);w=w+1|0}while((w|0)<4);if((c[k+4>>2]|0)==3){o=0;do{a[m+o+1285>>0]=a[m+o+901>>0]|0;a[m+o+1349>>0]=a[m+o+965>>0]|0;a[m+o+1477>>0]=a[m+o+1093>>0]|0;a[m+o+1541>>0]=a[m+o+1157>>0]|0;o=o+1|0}while((o|0)!=64);a[m+1612>>0]=a[m+1606>>0]|0;a[m+1613>>0]=a[m+1607>>0]|0;a[m+1615>>0]=a[m+1609>>0]|0;a[m+1616>>0]=a[m+1610>>0]|0}}I=(dd(n)|0)&255;a[(c[j>>2]|0)+1617>>0]=I;I=(fd(n)|0)+2|0;c[(c[j>>2]|0)+1620>>2]=I;m=k+13080|0;if(I>>>0<=(c[m>>2]|0)>>>0){I=(dd(n)|0)&255;a[(c[j>>2]|0)+1628>>0]=I;do if((dd(n)|0)!=0?(I=dd(n)|0,ad(n,7)|0,(I|0)!=0):0){n=c[j>>2]|0;p=(c[l>>2]|0)+204|0;if(a[n+21>>0]|0)a[n+1629>>0]=(fd(p)|0)+2;a[n+1630>>0]=dd(p)|0;I=(dd(p)|0)&255;a[n+1631>>0]=I;if(I<<24>>24){a[n+1632>>0]=fd(p)|0;I=fd(p)|0;o=n+1633|0;a[o>>0]=I;if((I&255)>>>0<5)l=0;else break;while(1){a[n+l+1634>>0]=gd(p)|0;a[n+l+1639>>0]=gd(p)|0;if((l|0)<(d[o>>0]|0))l=l+1|0;else break}}a[n+1644>>0]=fd(p)|0;a[n+1645>>0]=fd(p)|0}while(0);l=pd((c[(c[j>>2]|0)+44>>2]|0)+1|0,4)|0;c[(c[j>>2]|0)+1656>>2]=l;l=pd((c[(c[j>>2]|0)+48>>2]|0)+1|0,4)|0;c[(c[j>>2]|0)+1660>>2]=l;l=k+13128|0;o=pd(c[l>>2]|0,4)|0;c[(c[j>>2]|0)+1664>>2]=o;o=c[j>>2]|0;n=c[o+1656>>2]|0;if(((n|0)!=0?(c[o+1660>>2]|0)!=0:0)?(c[o+1664>>2]|0)!=0:0){if(a[o+52>>0]|0){p=c[o+1648>>2]|0;if(!p){o=pd(c[o+44>>2]|0,4)|0;c[(c[j>>2]|0)+1648>>2]=o;o=pd(c[(c[j>>2]|0)+48>>2]|0,4)|0;c[(c[j>>2]|0)+1652>>2]=o;o=c[j>>2]|0;p=c[o+1648>>2]|0;if(!p){b=-12;break}}n=c[o+1652>>2]|0;if(!n){b=-12;break}q=o+44|0;s=c[q>>2]|0;if((s|0)>0){r=0;do{I=r;r=r+1|0;H=c[l>>2]|0;c[p+(I<<2)>>2]=(($(H,r)|0)/(s|0)|0)-(($(H,I)|0)/(s|0)|0);s=c[q>>2]|0}while((r|0)<(s|0))}q=o+48|0;s=c[q>>2]|0;if((s|0)>0){p=k+13132|0;r=0;do{I=r;r=r+1|0;H=c[p>>2]|0;c[n+(I<<2)>>2]=(($(H,r)|0)/(s|0)|0)-(($(H,I)|0)/(s|0)|0);s=c[q>>2]|0}while((r|0)<(s|0))}n=c[o+1656>>2]|0}c[n>>2]=0;q=o+44|0;if((c[q>>2]|0)>0){p=c[o+1648>>2]|0;r=0;s=0;do{r=(c[p+(s<<2)>>2]|0)+r|0;s=s+1|0;c[n+(s<<2)>>2]=r}while((s|0)<(c[q>>2]|0))}s=c[o+1660>>2]|0;c[s>>2]=0;r=o+48|0;if((c[r>>2]|0)>0){q=c[o+1652>>2]|0;t=0;p=0;do{t=(c[q+(p<<2)>>2]|0)+t|0;p=p+1|0;c[s+(p<<2)>>2]=t}while((p|0)<(c[r>>2]|0))}r=c[l>>2]|0;if((r|0)>0){o=c[o+1664>>2]|0;p=0;q=0;do{q=(p>>>0>(c[n+(q<<2)>>2]|0)>>>0&1)+q|0;c[o+(p<<2)>>2]=q;p=p+1|0;r=c[l>>2]|0}while((p|0)<(r|0))}x=$(c[k+13132>>2]|0,r)|0;n=pd(x,4)|0;c[(c[j>>2]|0)+1668>>2]=n;n=pd(x,4)|0;c[(c[j>>2]|0)+1672>>2]=n;n=pd(x,4)|0;c[(c[j>>2]|0)+1676>>2]=n;n=k+13164|0;q=(c[n>>2]|0)+2|0;q=pd($(q,q)|0,4)|0;c[(c[j>>2]|0)+1688>>2]=q;q=c[j>>2]|0;p=c[q+1668>>2]|0;if(!p){b=-12;break}w=c[q+1672>>2]|0;if(!w){b=-12;break}o=c[q+1676>>2]|0;if(!o){b=-12;break}if(!(c[q+1688>>2]|0)){b=-12;break}if((x|0)>0){B=q+44|0;r=q+48|0;s=c[q+1660>>2]|0;v=c[q+1648>>2]|0;u=c[q+1656>>2]|0;t=q+1652|0;A=0;do{C=c[l>>2]|0;y=(A|0)%(C|0)|0;z=(A|0)/(C|0)|0;G=c[B>>2]|0;E=0;while(1){if((E|0)>=(G|0)){E=0;break}F=E+1|0;if(y>>>0<(c[u+(F<<2)>>2]|0)>>>0)break;else E=F}H=c[r>>2]|0;F=0;while(1){if((F|0)>=(H|0)){F=0;break}G=F+1|0;if(z>>>0<(c[s+(G<<2)>>2]|0)>>>0)break;else F=G}if((E|0)>0){G=c[(c[t>>2]|0)+(F<<2)>>2]|0;H=0;I=0;do{I=($(c[v+(H<<2)>>2]|0,G)|0)+I|0;H=H+1|0}while((H|0)!=(E|0))}else I=0;if((F|0)>0){G=c[t>>2]|0;H=0;do{I=($(c[G+(H<<2)>>2]|0,C)|0)+I|0;H=H+1|0}while((H|0)!=(F|0))}H=$(c[v+(E<<2)>>2]|0,z-(c[s+(F<<2)>>2]|0)|0)|0;I=I+y+H-(c[u+(E<<2)>>2]|0)|0;c[p+(A<<2)>>2]=I;c[w+(I<<2)>>2]=A;A=A+1|0}while((A|0)!=(x|0))}else r=q+48|0;x=c[r>>2]|0;if((x|0)>0){s=q+44|0;t=q+1660|0;q=q+1656|0;z=c[s>>2]|0;u=0;w=0;while(1){v=u;u=u+1|0;if((z|0)>0){x=c[t>>2]|0;y=x+(u<<2)|0;G=c[y>>2]|0;B=z;z=0;do{E=c[x+(v<<2)>>2]|0;A=z;z=z+1|0;if(E>>>0>>0){B=c[q>>2]|0;C=B+(z<<2)|0;F=c[C>>2]|0;do{H=c[B+(A<<2)>>2]|0;if(H>>>0>>0){do{c[o+(c[p+(($(c[l>>2]|0,E)|0)+H<<2)>>2]<<2)>>2]=w;H=H+1|0;F=c[C>>2]|0}while(H>>>0>>0);G=c[y>>2]|0}E=E+1|0}while(E>>>0>>0);B=c[s>>2]|0}w=w+1|0}while((z|0)<(B|0));v=c[r>>2]|0;z=B}else v=x;if((u|0)>=(v|0))break;else x=v}}else w=0;o=pd(w,4)|0;c[(c[j>>2]|0)+1680>>2]=o;o=c[j>>2]|0;p=c[o+1680>>2]|0;if(!p){b=-12;break}r=o+48|0;u=c[r>>2]|0;if((u|0)>0){q=o+44|0;t=c[q>>2]|0;s=0;do{if((t|0)>0){u=c[o+1660>>2]|0;v=c[o+1656>>2]|0;w=0;do{I=$(c[l>>2]|0,c[u+(s<<2)>>2]|0)|0;c[p+(($(t,s)|0)+w<<2)>>2]=(c[v+(w<<2)>>2]|0)+I;w=w+1|0;t=c[q>>2]|0}while((w|0)<(t|0));u=c[r>>2]|0}s=s+1|0}while((s|0)<(u|0))}k=(c[m>>2]|0)-(c[k+13072>>2]|0)|0;v=c[n>>2]|0;c[o+1684>>2]=(c[o+1688>>2]|0)+(v+3<<2);p=v+2|0;if((p|0)>0){m=c[(c[j>>2]|0)+1688>>2]|0;o=0;do{c[m+(($(p,o)|0)<<2)>>2]=-1;c[m+(o<<2)>>2]=-1;o=o+1|0;v=c[n>>2]|0;p=v+2|0}while((o|0)<(p|0))}if((v|0)>-1){m=c[j>>2]|0;j=m+1668|0;p=k<<1;o=(k|0)>0;m=m+1684|0;q=0;while(1){if((v|0)>-1){r=q>>k;t=c[j>>2]|0;s=c[m>>2]|0;u=0;while(1){z=c[t+(($(c[l>>2]|0,r)|0)+(u>>k)<<2)>>2]<>2]=z;v=c[n>>2]|0;if((u|0)<(v|0))u=u+1|0;else break}}if((q|0)<(v|0))q=q+1|0;else break}}if(((c[g+216>>2]|0)-(c[g+212>>2]|0)|0)<0){b=0;break}I=b+(h<<2)+400|0;wd(I);c[I>>2]=c[e>>2];I=0;i=f;return I|0}else b=-12}else b=-1094995529}else b=-1094995529}else b=-1094995529;while(0);wd(e);I=b;i=f;return I|0}function Hc(a,b){a=a|0;b=b|0;var d=0;a=i;i=i+16|0;d=a;c[d>>2]=b;kd(b+1648|0);kd(b+1652|0);kd(b+1656|0);kd(b+1660|0);kd(b+1664|0);kd(b+1668|0);kd(b+1672|0);kd(b+1680|0);kd(b+1676|0);kd(b+1688|0);kd(d);i=a;return}function Ic(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0;b=i;d=a+136|0;e=a+2512|0;while(1){f=(c[d>>2]|0)+204|0;g=0;do{h=ad(f,8)|0;g=h+g|0}while((h|0)==255);h=0;do{j=ad(f,8)|0;h=j+h|0}while((j|0)==255);do if((c[e>>2]|0)==39)if((g|0)==256){Jc(a);break}else{cd(f,h<<3);break}else if((g|0)==132){Jc(a);break}else{cd(f,h<<3);break}while(0);f=c[d>>2]|0;if(((c[f+216>>2]|0)-(c[f+212>>2]|0)|0)<=0){a=14;break}if((bd(f+204|0,8)|0)==128){a=14;break}}if((a|0)==14){i=b;return 1}return 0}function Jc(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;e=(c[b+136>>2]|0)+204|0;g=(ad(e,8)|0)&255;f=b+4468|0;h=0;do{if((g|0)==2)cd(e,32);else if((g|0)==1)cd(e,16);else if(!g){a[f>>0]=1;j=0;do{a[b+(h<<4)+j+4420>>0]=ad(e,8)|0;j=j+1|0}while((j|0)!=16)}h=h+1|0}while((h|0)!=3);i=d;return}function Kc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;d=i;f=c[b+52>>2]|0;e=a+60|0;if((f|0)>0){if((c[e>>2]|0)==0?(f=nd(f)|0,c[e>>2]=f,(f|0)==0):0){f=-12;i=d;return f|0}}else c[e>>2]=0;f=a+12|0;c[f>>2]=b;c[a+424>>2]=0;c[a+800>>2]=1;h=a+912|0;g=a+936|0;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[g>>2]=0;c[g+4>>2]=-2147483648;g=a+928|0;c[g>>2]=0;c[g+4>>2]=-2147483648;a=Ga[c[b+76>>2]&3](a)|0;if((a|0)>=0){h=0;i=d;return h|0}kd(e);c[f>>2]=0;h=a;i=d;return h|0}function Lc(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;if(!a){i=b;return 0}e=a+12|0;f=c[e>>2]|0;if((f|0)!=0?(d=c[f+92>>2]|0,(d|0)!=0):0)Ga[d&3](a)|0;c[a+796>>2]=0;kd(a+60|0);c[e>>2]=0;c[a+808>>2]=0;i=b;return 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,l=0;h=i;if((f|0)<=0){i=h;return 0}j=(e|0)==0;k=0;do{l=d+($(k,g)|0)|0;l=Ka[b&1](a,l)|0;if(!j)c[e+(k<<2)>>2]=l;k=k+1|0}while((k|0)!=(f|0));i=h;return 0}function Nc(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;if((f|0)<=0){i=g;return 0}h=(e|0)==0;j=0;do{k=Ia[b&1](a,d,j,0)|0;if(!h)c[e+(j<<2)>>2]=k;j=j+1|0}while((j|0)!=(f|0));i=g;return 0}function Oc(b,f,g){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;g=i;h=Cd(c[f+76>>2]|0)|0;b=h+4|0;if(!(a[b>>0]|0)){p=0;i=g;return p|0}k=f+64|0;l=h+5|0;m=f+68|0;n=h+6|0;j=0;while(1){p=($((((e[h+(j<<1)+8>>1]|0)>>>11&15)+8|0)>>>3,c[k>>2]|0)|0)+31&-32;if((j+ -1|0)>>>0<2){p=0-(0-p>>d[l>>0])|0;c[f+(j<<2)+32>>2]=p;o=0-(0-((c[m>>2]|0)+31&-32)>>d[n>>0])|0}else{c[f+(j<<2)+32>>2]=p;o=(c[m>>2]|0)+31&-32}o=td(($(p,o)|0)+32|0)|0;c[f+(j<<2)+304>>2]=o;if(!o){b=-1;f=8;break}c[f+(j<<2)>>2]=c[o+4>>2];j=j+1|0;if((j|0)>=(d[b>>0]|0)){b=0;f=8;break}}if((f|0)==8){i=g;return b|0}return 0}function Pc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;ae(a|0,0,976)|0;e=(b|0)!=0;if(e){c[a+8>>2]=c[b+8>>2];c[a+48>>2]=c[b+12>>2]}else c[a+8>>2]=-1;c[a+100>>2]=0;c[a+104>>2]=1;c[a+888>>2]=0;c[a+892>>2]=1;c[a+896>>2]=0;c[a+900>>2]=1;c[a+476>>2]=1;c[a+816>>2]=1;c[a+820>>2]=1;c[a+220>>2]=0;c[a+224>>2]=1;c[a+136>>2]=-1;c[a+416>>2]=-1;g=a+696|0;c[g>>2]=0;c[g+4>>2]=-2147483648;if((e?(f=c[b+52>>2]|0,(f|0)!=0):0)?(g=nd(f)|0,c[a+60>>2]=g,(g|0)==0):0){g=-12;i=d;return g|0}g=0;i=d;return g|0}function Qc(a){a=a|0;var b=0,c=0;b=i;c=hd(976)|0;if(c){if((Pc(c,a)|0)<0){jd(c);c=0}}else c=0;i=b;return c|0}function Rc(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+80|0;g=f;k=g+0|0;j=e+0|0;h=k+80|0;do{c[k>>2]=c[j>>2];k=k+4|0;j=j+4|0}while((k|0)<(h|0));h=a+12|0;j=c[h>>2]|0;if(!j){k=-22;i=f;return k|0}if(c[j+8>>2]|0){k=-22;i=f;return k|0}c[d>>2]=0;j=c[a+124>>2]|0;k=c[a+128>>2]|0;if(!j){if(k){k=-22;i=f;return k|0}}else{if(!((j|0)>0&(k|0)>0)){k=-22;i=f;return k|0}if((j+128|0)>>>0>=(268435455/((k+128|0)>>>0)|0)>>>0){k=-22;i=f;return k|0}}zd(b);h=c[h>>2]|0;if(((c[h+16>>2]&32|0)==0?(c[e+28>>2]|0)==0:0)?(c[a+808>>2]&1|0)==0:0){k=0;i=f;return k|0}g=Ia[c[h+88>>2]&1](a,b,d,g)|0;if(!(c[d>>2]|0)){zd(b);k=g;i=f;return k|0}else{k=a+424|0;c[k>>2]=(c[k>>2]|0)+1;k=g;i=f;return k|0}return 0}function Sc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=i;if((a|0)>0&(b|0)>0?(a+128|0)>>>0<(268435455/((b+128|0)>>>0)|0)>>>0:0){d=0;i=c;return d|0}d=-22;i=c;return d|0}function Tc(a,b){a=a|0;b=b|0;return 0}function Uc(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;f=i;e=a+8|0;if(!(c[e>>2]|0)){g=c[a+116>>2]|0;h=a+120|0;j=c[h>>2]|0;if(!((g|0)>0&(j|0)>0)){l=-22;i=f;return l|0}if((g+128|0)>>>0>=(268435455/((j+128|0)>>>0)|0)>>>0){l=-22;i=f;return l|0}j=c[a+136>>2]|0;if((j|0)<0){l=-22;i=f;return l|0}k=b+64|0;l=b+68|0;if((c[k>>2]|0)>=1?(c[l>>2]|0)>=1:0)g=1;else{m=a+792|0;n=0-(0-(c[a+124>>2]|0)>>c[m>>2])|0;c[k>>2]=(g|0)>(n|0)?g:n;k=c[h>>2]|0;g=0-(0-(c[a+128>>2]|0)>>c[m>>2])|0;c[l>>2]=(k|0)>(g|0)?k:g;g=0}c[b+76>>2]=j}else g=1;d=za[c[a+476>>2]&1](a,b,d)|0;if(c[e>>2]|g){n=d;i=f;return n|0}c[b+64>>2]=c[a+116>>2];c[b+68>>2]=c[a+120>>2];n=d;i=f;return n|0}function Vc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=i;c[b+4>>2]=a;a=Uc(a,c[b>>2]|0,d)|0;i=e;return a|0}function Wc(a,b){a=a|0;b=b|0;a=i;b=c[b>>2]|0;if(b)zd(b);i=a;return}function Xc(a){a=a|0;return}function Yc(a,b,c){a=a|0;b=b|0;c=c|0;return}function Zc(a){a=a|0;var b=0,d=0;b=i;d=a+8|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+16|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+64|0;c[d>>2]=-1;c[d+4>>2]=-1;d=a+72|0;c[d>>2]=0;c[d+4>>2]=0;d=a+32|0;c[a>>2]=0;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;i=b;return}function _c(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;g=a+16|0;c[a+12>>2]=b;c[a+20>>2]=b+e;h=b+1|0;c[g>>2]=h;e=(d[b>>0]|0)<<18;c[a>>2]=e;f=b+2|0;c[g>>2]=f;e=(d[h>>0]|0)<<10|e;c[a>>2]=e;c[g>>2]=b+3;c[a>>2]=(d[f>>0]|0)<<2|e|2;c[a+4>>2]=510;return}function $c(){var b=0,e=0,f=0,g=0,h=0,j=0;b=i;if(!(c[718]|0))e=0;else{i=b;return}while(1)if(e){g=(e&65280|0)==0;a[2880+e>>0]=(g?8:0)-(d[4680+(g?e:e>>>8)>>0]|0);e=e+1|0;if((e|0)==512){e=0;break}else continue}else{a[2880]=9;e=1;continue}while(1){f=e<<1;g=0;do{j=a[4224+(e<<2)+g>>0]|0;h=(g<<7)+f|0;a[(h|1)+3392>>0]=j;a[h+3392>>0]=j;g=g+1|0}while((g|0)!=4);j=(d[4480+e>>0]|0)<<1;a[f+4032>>0]=j;a[f+4033>>0]=j|1;if(e){h=(d[4544+e>>0]|0)<<1;j=128-f|0;a[j+3903>>0]=h;a[j+3902>>0]=h|1;e=e+1|0;if((e|0)==64)break;else continue}else{e=128-f|0;a[e+3903>>0]=1;a[e+3902>>0]=0;e=1;continue}}g=4160|0;f=4608|0;e=g+63|0;do{a[g>>0]=a[f>>0]|0;g=g+1|0;f=f+1|0}while((g|0)<(e|0));c[718]=1;i=b;return}function ad(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0;e=i;f=a+8|0;h=c[f>>2]|0;g=c[a+16>>2]|0;a=(c[a>>2]|0)+(h>>>3)|0;a=(Xd(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(h&7)>>>(32-b|0);b=h+b|0;c[f>>2]=g>>>0>b>>>0?b:g;i=e;return a|0}function bd(a,b){a=a|0;b=b|0;var e=0,f=0;e=i;f=c[a+8>>2]|0;a=(c[a>>2]|0)+(f>>>3)|0;a=(Xd(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(f&7)>>>(32-b|0);i=e;return a|0}function cd(a,b){a=a|0;b=b|0;var d=0;d=a+8|0;a=c[a+16>>2]|0;b=(c[d>>2]|0)+b|0;c[d>>2]=a>>>0>b>>>0?b:a;return}function dd(a){a=a|0;var b=0,e=0,f=0;e=a+8|0;f=c[e>>2]|0;b=(d[(c[a>>2]|0)+(f>>>3)>>0]|0)<<(f&7)>>>7&1;c[e>>2]=((f|0)<(c[a+16>>2]|0)&1)+f;return b|0}function ed(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;if(!b){j=0;i=e;return j|0}f=a+8|0;h=c[f>>2]|0;g=c[a+16>>2]|0;j=c[a>>2]|0;a=j+(h>>>3)|0;a=(Xd(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(h&7);if((b|0)<26){j=h+b|0;c[f>>2]=g>>>0>j>>>0?j:g;j=a>>>(32-b|0);i=e;return j|0}else{k=h+16|0;k=g>>>0>k>>>0?k:g;c[f>>2]=k;h=b+ -16|0;j=j+(k>>>3)|0;j=(Xd(d[j>>0]|d[j+1>>0]<<8|d[j+2>>0]<<16|d[j+3>>0]<<24|0)|0)<<(k&7)>>>(48-b|0);b=k+h|0;c[f>>2]=g>>>0>b>>>0?b:g;j=j|a>>>16<>2]=c[a+0>>2];c[e+4>>2]=c[a+4>>2];c[e+8>>2]=c[a+8>>2];c[e+12>>2]=c[a+12>>2];c[e+16>>2]=c[a+16>>2];e=ed(e,32)|0;f=e>>>0>65535;e=f?e>>>16:e;f=f?16:0;if(e&65280){f=f|8;e=e>>>8}j=31-f-(d[4680+e>>0]|0)|0;g=a+8|0;f=c[g>>2]|0;e=0-f|0;h=(c[a+16>>2]|0)-f|0;if((j|0)<(e|0)){h=e;h=h+f|0;c[g>>2]=h;j=j+1|0;j=ed(a,j)|0;j=j+ -1|0;i=b;return j|0}h=(h|0)<(j|0)?h:j;h=h+f|0;c[g>>2]=h;j=j+1|0;j=ed(a,j)|0;j=j+ -1|0;i=b;return j|0}function gd(a){a=a|0;var b=0;b=i;a=fd(a)|0;if(!(a&1)){a=0-(a>>>1)|0;i=b;return a|0}else{a=(a+1|0)>>>1;i=b;return a|0}return 0}function hd(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[1168]|0;if((d+ -32|0)>>>0>=a>>>0){e=Sd(a)|0;if((e|0)==0&(a|0)==0)if((d|0)==32)e=0;else e=Sd(1)|0}else e=0;i=b;return e|0}function id(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;f=$(d,b)|0;if((d|b)>>>0>65535&(d|0)!=0?((f>>>0)/(d>>>0)|0|0)!=(b|0):0){Td(a);d=0;i=e;return d|0}if(((c[1168]|0)+ -32|0)>>>0>>0)b=0;else b=Ud(a,((f|0)==0&1)+f|0)|0;if((b|0)!=0|(f|0)==0){d=b;i=e;return d|0}Td(a);d=0;i=e;return d|0}function jd(a){a=a|0;var b=0;b=i;Td(a);i=b;return}function kd(a){a=a|0;var b=0;b=i;Td(c[a>>2]|0);c[a>>2]=0;i=b;return}function ld(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if(((d|0)!=0?(2147483647/(d>>>0)|0)>>>0>b>>>0:0)?(f=$(d,b)|0,((c[1168]|0)+ -32|0)>>>0>=f>>>0):0)a=Ud(a,((f|0)==0&1)+f|0)|0;else a=0;i=e;return a|0}function md(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=i;e=id(c[a>>2]|0,b,d)|0;c[a>>2]=e;i=f;return((e|0)!=0|(b|0)==0|(d|0)==0?0:-12)|0}function nd(a){a=a|0;var b=0,c=0;c=i;b=hd(a)|0;if(b)ae(b|0,0,a|0)|0;i=c;return b|0}function od(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if((c[b>>2]|0)>>>0>d>>>0){i=e;return}f=((d*17|0)>>>4)+32|0;d=f>>>0>d>>>0?f:d;Td(c[a>>2]|0);f=hd(d)|0;c[a>>2]=f;c[b>>2]=(f|0)==0?0:d;i=e;return}function pd(a,b){a=a|0;b=b|0;var c=0;c=i;if((b|0)!=0?(2147483647/(b>>>0)|0)>>>0>a>>>0:0)b=hd($(b,a)|0)|0;else b=0;i=c;return b|0}function qd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=i;if(((b|0)!=0?(2147483647/(b>>>0)|0)>>>0>a>>>0:0)?(e=$(b,a)|0,d=hd(e)|0,(d|0)!=0):0)ae(d|0,0,e|0)|0;else d=0;i=c;return d|0}function rd(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;g=i;i=i+16|0;h=g;j=nd(24)|0;c[h>>2]=j;if(!j){f=0;i=g;return f|0}c[j>>2]=a;c[j+4>>2]=b;c[j+12>>2]=(d|0)!=0?d:7;c[j+16>>2]=e;c[j+8>>2]=1;if(f&1){f=(c[h>>2]|0)+20|0;c[f>>2]=c[f>>2]|1}j=nd(12)|0;if(!j){kd(h);f=0;i=g;return f|0}else{c[j>>2]=c[h>>2];c[j+4>>2]=a;c[j+8>>2]=b;f=j;i=g;return f|0}return 0}function sd(a,b){a=a|0;b=b|0;a=i;jd(b);i=a;return}function td(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b;e=hd(a)|0;c[d>>2]=e;if(e){a=rd(e,a,7,0,0)|0;if(!a){kd(d);a=0}}else a=0;i=b;return a|0}function ud(a){a=a|0;var b=0,d=0;b=i;d=td(a)|0;if(!d){d=0;i=b;return d|0}ae(c[d+4>>2]|0,0,a|0)|0;i=b;return d|0}function vd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b;d=nd(12)|0;if(!d){e=0;i=b;return e|0}c[d+0>>2]=c[a+0>>2];c[d+4>>2]=c[a+4>>2];c[d+8>>2]=c[a+8>>2];f=(c[a>>2]|0)+8|0;a=c[f>>2]|0;c[f>>2]=a+1;c[e>>2]=a+1;e=d;i=b;return e|0}function wd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+4|0;d=b;if(!a){i=b;return}f=c[a>>2]|0;if(!f){i=b;return}f=c[f>>2]|0;c[d>>2]=f;kd(a);a=f+8|0;f=c[a>>2]|0;c[a>>2]=f+ -1;c[e>>2]=f+ -1;if(c[e>>2]|0){i=b;return}f=c[d>>2]|0;Ea[c[f+12>>2]&7](c[f+16>>2]|0,c[f>>2]|0);kd(d);i=b;return}function xd(){var a=0,b=0,d=0;a=i;b=nd(400)|0;if(!b){b=0;i=a;return b|0}ae(b|0,0,400)|0;d=b+136|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+144|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+128|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+360|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+376|0;c[d>>2]=0;c[d+4>>2]=0;d=b+368|0;c[d>>2]=-1;c[d+4>>2]=-1;c[b+392>>2]=-1;c[b+80>>2]=1;c[b+120>>2]=0;c[b+124>>2]=1;c[b+76>>2]=-1;c[b+344>>2]=2;c[b+348>>2]=2;c[b+352>>2]=2;c[b+340>>2]=0;c[b+356>>2]=0;i=a;return b|0}function yd(a){a=a|0;var b=0,d=0;b=i;if((a|0)!=0?(d=c[a>>2]|0,(d|0)!=0):0){zd(d);kd(a)}i=b;return}function zd(a){a=a|0;var b=0,d=0;b=i;wd(a+304|0);wd(a+308|0);wd(a+312|0);wd(a+316|0);wd(a+320|0);wd(a+324|0);wd(a+328|0);wd(a+332|0);ae(a|0,0,400)|0;d=a+136|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+144|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+128|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+360|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+376|0;c[d>>2]=0;c[d+4>>2]=0;d=a+368|0;c[d>>2]=-1;c[d+4>>2]=-1;c[a+392>>2]=-1;c[a+80>>2]=1;c[a+120>>2]=0;c[a+124>>2]=1;c[a+76>>2]=-1;c[a+344>>2]=2;c[a+348>>2]=2;c[a+352>>2]=2;c[a+340>>2]=0;c[a+356>>2]=0;i=b;return}function Ad(a,b){a=a|0;b=b|0;var d=0;d=i;ce(a|0,b|0,400)|0;ae(b|0,0,400)|0;a=b+136|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+144|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+128|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+360|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+376|0;c[a>>2]=0;c[a+4>>2]=0;a=b+368|0;c[a>>2]=-1;c[a+4>>2]=-1;c[b+392>>2]=-1;c[b+80>>2]=1;c[b+120>>2]=0;c[b+124>>2]=1;c[b+76>>2]=-1;c[b+344>>2]=2;c[b+348>>2]=2;c[b+352>>2]=2;c[b+340>>2]=0;c[b+356>>2]=0;i=d;return}function Bd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;c[a+76>>2]=c[b+76>>2];c[a+64>>2]=c[b+64>>2];c[a+68>>2]=c[b+68>>2];c[a+388>>2]=c[b+388>>2];j=b+296|0;h=c[j+4>>2]|0;f=a+296|0;c[f>>2]=c[j>>2];c[f+4>>2]=h;c[a+72>>2]=c[b+72>>2];f=c[b+304>>2]|0;if(!f)sa();else{e=f;g=0}while(1){if((e|0)!=0?(j=vd(e)|0,c[a+(g<<2)+304>>2]=j,(j|0)==0):0){e=5;break}g=g+1|0;if(g>>>0>=8){e=8;break}e=c[b+(g<<2)+304>>2]|0}if((e|0)==5){zd(a);j=-12;i=d;return j|0}else if((e|0)==8){c[a+0>>2]=c[b+0>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];c[a+28>>2]=c[b+28>>2];j=a+32|0;h=b+32|0;c[j+0>>2]=c[h+0>>2];c[j+4>>2]=c[h+4>>2];c[j+8>>2]=c[h+8>>2];c[j+12>>2]=c[h+12>>2];c[j+16>>2]=c[h+16>>2];c[j+20>>2]=c[h+20>>2];c[j+24>>2]=c[h+24>>2];c[j+28>>2]=c[h+28>>2];j=0;i=d;return j|0}return 0}function Cd(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;e=0;while(1){f=e+1|0;if((c[4936+(e*24|0)>>2]|0)==(a|0))break;if(f>>>0<4)e=f;else{e=0;b=5;break}}if((b|0)==5){i=d;return e|0}f=4940+(e*24|0)|0;i=d;return f|0}function Dd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;g=(c[b+16>>2]|0)==0?1:3;if((g|0)>(e|0)){b=c[b>>2]|0;c[d>>2]=c[b+(e<<2)+32>>2];b=c[b+(e<<2)>>2]|0;i=f;return b|0}if((a[b+20>>0]|0)!=0&(g|0)==(e|0)){b=c[b+4>>2]|0;c[d>>2]=c[b+32>>2];b=c[b>>2]|0;i=f;return b|0}else{c[d>>2]=0;b=0;i=f;return b|0}return 0}function Ed(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=i;if(!(c[b>>2]|0)){h=-1;i=f;return h|0}c[e>>2]=c[b+8>>2];c[e+4>>2]=c[b+12>>2];c[e+8>>2]=c[b+16>>2];g=b+22|0;if(!(a[b+20>>0]|0))h=0;else h=(a[g>>0]|0)==0;c[e+12>>2]=h&1;c[e+24>>2]=d[b+24>>0];c[e+28>>2]=d[g>>0];c[e+32>>2]=d[b+23>>0];c[e+16>>2]=c[b+28>>2];c[e+20>>2]=d[b+21>>0];h=0;i=f;return h|0}function Fd(f,g){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;k=i;j=c[f+8>>2]|0;h=f+44|0;o=c[h>>2]|0;if(o>>>0>=(c[f+12>>2]|0)>>>0){x=-1;i=k;return x|0}n=(c[f+56>>2]|0)+($(c[f+72>>2]|0,o)|0)|0;l=f+40|0;m=(d[l>>0]|0)+3|0;p=c[f+16>>2]|0;if((p|0)==1){v=o>>1;q=(v|0)%8|0;w=f+88|0;u=c[w>>2]|0;t=f+96|0;p=f+160|0;s=c[p>>2]|0;x=f+21|0;r=d[x>>0]|0;if(!(o&1)){Gd(u,t,j,q,s,r,0);Gd(c[f+92>>2]|0,f+128|0,j,q,c[p>>2]|0,d[x>>0]|0,0)}else{Gd(u,t,j,q,s,r,1);Gd(c[f+92>>2]|0,f+128|0,j,q,c[p>>2]|0,d[x>>0]|0,1);u=(q+5|0)%8|0;t=v+5|0;v=c[f+52>>2]|0;v=(t|0)<(v|0)?t:v+ -1|0;t=(c[f+60>>2]|0)+($(v,c[f+76>>2]|0)|0)|0;v=(c[f+64>>2]|0)+($(c[f+80>>2]|0,v)|0)|0;x=f+48|0;ce(c[f+(u<<2)+96>>2]|0,t|0,c[x>>2]<<1|0)|0;ce(c[f+(u<<2)+128>>2]|0,v|0,c[x>>2]<<1|0)|0}Ba[c[f+212>>2]&7](f+164|0,g,n,c[w>>2]|0,c[f+92>>2]|0,j,m)}else if(!p)Ba[c[f+212>>2]&7](f+164|0,g,n,0,0,j,m);else if((p|0)==3){w=(c[f+60>>2]|0)+($(c[f+76>>2]|0,o)|0)|0;x=(c[f+64>>2]|0)+($(c[f+80>>2]|0,o)|0)|0;Ba[c[f+212>>2]&7](f+164|0,g,n,w,x,j,m)}else if((p|0)==2){x=(c[f+60>>2]|0)+($(c[f+76>>2]|0,o)|0)|0;u=(c[f+64>>2]|0)+($(c[f+80>>2]|0,o)|0)|0;w=f+88|0;v=f+21|0;Hd(c[w>>2]|0,x,j,d[v>>0]|0);x=f+92|0;Hd(c[x>>2]|0,u,j,d[v>>0]|0);Ba[c[f+212>>2]&7](f+164|0,g,n,c[w>>2]|0,c[x>>2]|0,j,m)}else{x=-1;i=k;return x|0}a:do if(!(a[f+22>>0]|0)){if(a[l>>0]|0){if(!(a[f+20>>0]|0)){if((j|0)<=0)break;f=g+3|0;g=0;while(1){a[f>>0]=-1;g=g+1|0;if((g|0)==(j|0))break a;else f=f+4|0}}l=(c[f+68>>2]|0)+($(c[f+84>>2]|0,o)|0)|0;q=g+3|0;if((c[f+204>>2]|0)==8){if((j|0)>0){m=0;while(1){a[q>>0]=b[l+(m<<1)>>1];m=m+1|0;if((m|0)==(j|0))break;else q=q+4|0}}}else{m=c[f+172>>2]|0;n=c[f+168>>2]|0;o=c[f+164>>2]|0;if((j|0)>0){p=0;while(1){a[q>>0]=($(e[l+(p<<1)>>1]|0,m)|0)+n>>o;p=p+1|0;if((p|0)==(j|0))break;else q=q+4|0}}}if(a[f+24>>0]|0){if(!(c[1264]|0)){c[1264]=1;f=1;do{c[5064+(f<<2)>>2]=(((f|0)/2|0)+16711808|0)/(f|0)|0;f=f+1|0}while((f|0)!=256)}if((j|0)>0){f=0;while(1){m=a[g+3>>0]|0;if(!(m<<24>>24)){a[g>>0]=-1;a[g+1>>0]=-1;a[g+2>>0]=-1}else{l=c[5064+((m&255)<<2)>>2]|0;n=a[g>>0]|0;if((n&255)<(m&255))n=(($(n&255,l)|0)+32768|0)>>>16&255;else n=-1;a[g>>0]=n;n=g+1|0;o=a[n>>0]|0;if((o&255)<(m&255))o=(($(o&255,l)|0)+32768|0)>>>16&255;else o=-1;a[n>>0]=o;n=g+2|0;o=a[n>>0]|0;if((o&255)<(m&255))l=(($(o&255,l)|0)+32768|0)>>>16&255;else l=-1;a[n>>0]=l}f=f+1|0;if((f|0)==(j|0))break;else g=g+4|0}}}}}else{n=(c[f+68>>2]|0)+($(c[f+84>>2]|0,o)|0)|0;p=c[f+204>>2]|0;o=1<0;if(r){f=g;q=0;while(1){w=e[n+(q<<1)>>1]|0;a[f>>0]=($(d[f>>0]|0,w)|0)+o>>p;x=f+1|0;a[x>>0]=($(d[x>>0]|0,w)|0)+o>>p;x=f+2|0;a[x>>0]=($(d[x>>0]|0,w)|0)+o>>p;q=q+1|0;if((q|0)==(j|0))break;else f=f+m|0}}if(!((a[l>>0]|0)==0|r^1)){f=g+3|0;g=0;while(1){a[f>>0]=-1;g=g+1|0;if((g|0)==(j|0))break;else f=f+4|0}}}while(0);c[h>>2]=(c[h>>2]|0)+1;x=0;i=k;return x|0}function Gd(a,d,f,g,h,j,k){a=a|0;d=d|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;l=i;m=c[d+((g+5&7)<<2)>>2]|0;n=c[d+((g+6&7)<<2)>>2]|0;r=c[d+((g+7&7)<<2)>>2]|0;q=c[d+((g&7)<<2)>>2]|0;p=c[d+((g+1&7)<<2)>>2]|0;o=c[d+((g+2&7)<<2)>>2]|0;g=c[d+((g+3&7)<<2)>>2]|0;s=j+ -8|0;d=(f+1|0)/2|0;t=(f|0)>0;if(!k){if(t){k=0;do{y=($(e[n+(k<<1)>>1]|0,-6)|0)+(e[m+(k<<1)>>1]<<1)|0;y=y+((e[r+(k<<1)>>1]|0)*18|0)+((e[q+(k<<1)>>1]|0)*57|0)+($(e[p+(k<<1)>>1]|0,-10)|0)|0;b[h+(k+3<<1)>>1]=y+(e[o+(k<<1)>>1]<<2)-(e[g+(k<<1)>>1]|0)>>s;k=k+1|0}while((k|0)<(d|0))}}else if(t){k=0;do{y=(e[n+(k<<1)>>1]<<2)-(e[m+(k<<1)>>1]|0)+($(e[r+(k<<1)>>1]|0,-10)|0)|0;y=y+((e[q+(k<<1)>>1]|0)*57|0)+((e[p+(k<<1)>>1]|0)*18|0)+($(e[o+(k<<1)>>1]|0,-6)|0)|0;b[h+(k+3<<1)>>1]=y+(e[g+(k<<1)>>1]<<1)>>s;k=k+1|0}while((k|0)<(d|0))}r=h+6|0;m=b[r>>1]|0;b[h>>1]=m;u=h+2|0;b[u>>1]=m;t=h+4|0;b[t>>1]=m;m=b[h+(d+2<<1)>>1]|0;b[h+(d+3<<1)>>1]=m;b[h+(d+4<<1)>>1]=m;b[h+(d+5<<1)>>1]=m;b[h+(d+6<<1)>>1]=m;m=(1<>1]|0;u=b[u>>1]|0;t=b[t>>1]|0;d=b[r>>1]|0;k=b[h+8>>1]|0;g=b[h+10>>1]|0;if((f|0)>1){p=f+ -2|0;o=p>>>1;q=o<<1;w=a;while(1){v=b[r+6>>1]|0;x=d*57|0;y=(g<<2)+n+($(k,-10)|0)+x+(t*18|0)+($(u,-6)|0)+(s<<1)-v>>j;if((y|0)<0)y=0;else y=((y|0)>(m|0)?m:y)&65535;b[w>>1]=y;s=($(g,-6)|0)+n+(k*18|0)+x+($(t,-10)|0)-s+(u<<2)+(v<<1)>>j;if((s|0)<0)s=0;else s=((s|0)>(m|0)?m:s)&65535;b[w+2>>1]=s;f=f+ -2|0;if((f|0)<=1)break;else{A=g;z=k;x=d;y=t;s=u;g=v;w=w+4|0;r=r+2|0;k=A;d=z;t=x;u=y}}s=u;u=t;t=d;d=k;k=g;g=v;a=a+(q+2<<1)|0;f=p-q|0;r=h+(o+4<<1)|0}if(!f){i=l;return}h=(g<<2)+n+($(k,-10)|0)+(d*57|0)+(t*18|0)+($(u,-6)|0)+(s<<1)-(b[r+6>>1]|0)>>j;if((h|0)<0)h=0;else h=((h|0)>(m|0)?m:h)&65535;b[a>>1]=h;i=l;return}function Hd(a,c,d,f){a=a|0;c=c|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,s=0,t=0,u=0,v=0,w=0,x=0,y=0;g=i;s=(d+1|0)/2|0;o=s<<1;h=hd(o+14|0)|0;j=h+6|0;ce(j|0,c|0,o|0)|0;o=b[c>>1]|0;b[h>>1]=o;b[h+2>>1]=o;b[h+4>>1]=o;c=b[c+(s+ -1<<1)>>1]|0;b[h+(s+3<<1)>>1]=c;b[h+(s+4<<1)>>1]=c;b[h+(s+5<<1)>>1]=c;b[h+(s+6<<1)>>1]=c;c=(1<>1]|0;o=e[h+2>>1]|0;q=e[h+4>>1]|0;p=e[j>>1]|0;n=e[h+8>>1]|0;m=e[h+10>>1]|0;if((d|0)>1){k=d+ -2|0;l=k>>>1;f=l+1|0;r=p;p=n;n=m;t=a;u=j;while(1){m=e[u+6>>1]|0;v=r*57|0;w=(n<<2)+32+($(p,-10)|0)+v+(q*18|0)+($(o,-6)|0)+(s<<1)-m>>6;if((w|0)<0)w=0;else w=((w|0)>(c|0)?c:w)&65535;b[t>>1]=w;s=($(n,-6)|0)+32+(p*18|0)+v+($(q,-10)|0)-s+(o<<2)+(m<<1)>>6;if((s|0)<0)s=0;else s=((s|0)>(c|0)?c:s)&65535;b[t+2>>1]=s;d=d+ -2|0;if((d|0)<=1)break;else{y=n;x=p;v=r;w=q;s=o;n=m;t=t+4|0;u=u+2|0;p=y;r=x;q=v;o=w}}d=l<<1;l=o;o=q;q=r;a=a+(d+2<<1)|0;d=k-d|0;j=j+(f<<1)|0}else l=s;if(!d){jd(h);i=g;return}j=(m<<2)+32+($(n,-10)|0)+(p*57|0)+(q*18|0)+($(o,-6)|0)+(l<<1)-(e[j+6>>1]|0)>>6;if((j|0)<0)j=0;else j=((j|0)>(c|0)?c:j)&65535;b[a>>1]=j;jd(h);i=g;return}function Id(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0,B=0.0;f=i;if(!(c[b>>2]|0)){w=-1;i=f;return w|0}g=b+44|0;if((c[g>>2]|0)>-1|e>>>0>1){w=-1;i=f;return w|0}a[b+40>>0]=(e|0)==1&1;k=b+41|0;a[k>>0]=0;c[b+56>>2]=Dd(b,b+72|0,0)|0;e=b+16|0;if(!(c[e>>2]|0))m=1;else{c[b+60>>2]=Dd(b,b+76|0,1)|0;c[b+64>>2]=Dd(b,b+80|0,2)|0;m=3}if(!(a[b+20>>0]|0))c[b+68>>2]=0;else c[b+68>>2]=Dd(b,b+84|0,m)|0;if(((c[e>>2]|0)+ -1|0)>>>0<2?(w=b+8|0,v=c[w>>2]|0,l=b+48|0,c[l>>2]=(v+1|0)/2|0,j=b+52|0,c[j>>2]=((c[b+12>>2]|0)+1|0)/2|0,c[b+88>>2]=hd(v<<1)|0,c[b+92>>2]=hd(c[w>>2]<<1)|0,(c[e>>2]|0)==1):0){m=0;o=c[l>>2]<<1;do{c[b+(m<<2)+96>>2]=hd(o)|0;c[b+(m<<2)+128>>2]=hd(c[l>>2]<<1)|0;m=m+1|0;o=c[l>>2]<<1}while((m|0)!=8);c[b+160>>2]=hd(o+14|0)|0;m=b+60|0;o=b+76|0;s=b+64|0;u=b+80|0;v=0;do{w=(v|0)>4?v+ -8|0:v;if((w|0)<0)w=0;else{x=c[j>>2]|0;w=(w|0)<(x|0)?w:x+ -1|0}y=(c[m>>2]|0)+($(c[o>>2]|0,w)|0)|0;x=(c[s>>2]|0)+($(c[u>>2]|0,w)|0)|0;ce(c[b+(v<<2)+96>>2]|0,y|0,c[l>>2]<<1|0)|0;ce(c[b+(v<<2)+128>>2]|0,x|0,c[l>>2]<<1|0)|0;v=v+1|0}while((v|0)!=8)}j=d[b+21>>0]|0;y=(a[k>>0]|0)!=0?16:8;m=b+28|0;s=c[m>>2]|0;l=a[b+23>>0]|0;k=l&255;o=30-y|0;n=+((1<>24!=0;if(l){y=j+ -8|0;q=n/+(224<>2]=ra(+(q*B*2.0))|0;z=1.0-t;A=z-r;c[b+188>>2]=ra(+(q*(t*2.0*z/A)))|0;c[b+192>>2]=ra(+(q*(r*2.0*B/A)))|0;c[b+196>>2]=ra(+(q*z*2.0))|0}h=ra(+p)|0;c[b+172>>2]=h;c[b+164>>2]=o;s=1<>2]=s;c[b+200>>2]=1<>2]=y;y=$(y,-16<>2]=y+(c[o>>2]|0)}else{c[b+176>>2]=h;c[b+180>>2]=s}c[b+204>>2]=j;c[b+208>>2]=k;if(!(c[e>>2]|0))c[b+212>>2]=7;else c[b+212>>2]=c[5032+(c[m>>2]<<2)>>2];c[g>>2]=0;y=0;i=f;return y|0}function Jd(){var a=0,b=0;a=i;b=nd(216)|0;if(!b)b=0;i=a;return b|0}function Kd(b,d,e){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+48|0;m=f+36|0;l=f;if((e|0)<6){u=-1;i=f;return u|0}if((a[d>>0]|0)!=66){u=-1;i=f;return u|0}if((a[d+1>>0]|0)!=80){u=-1;i=f;return u|0}if((a[d+2>>0]|0)!=71){u=-1;i=f;return u|0}if((a[d+3>>0]|0)!=-5){u=-1;i=f;return u|0}t=a[d+4>>0]|0;u=t&255;n=u>>>5;k=l+8|0;c[k>>2]=n;if(t<<24>>24<0){u=-1;i=f;return u|0}t=(u&15)+8|0;a[l+13>>0]=t;if((t&255)>>>0>14){u=-1;i=f;return u|0}q=a[d+5>>0]|0;j=q&255;p=j>>>4;h=l+20|0;c[h>>2]=p;o=j&8;r=j>>>2&1;g=l+16|0;a[g>>0]=j>>>1&1;j=l+12|0;a[j>>0]=0;s=l+14|0;a[s>>0]=0;t=l+15|0;a[t>>0]=0;if(!(u&16))if(!r)r=0;else{a[j>>0]=1;a[s>>0]=1;r=1}else{a[j>>0]=1;a[t>>0]=r;r=0}if((q&255)>79){u=-1;i=f;return u|0}if(!((n|0)!=0|(p|0)==0)){u=-1;i=f;return u|0}if(r<<24>>24!=0&(n|0)==0){u=-1;i=f;return u|0}n=Nd(l,d+6|0,e+ -6|0)|0;if((n|0)<0){u=-1;i=f;return u|0}n=n+6|0;p=l+4|0;q=Nd(p,d+n|0,e-n|0)|0;if((q|0)<0){u=-1;i=f;return u|0}q=q+n|0;if(!(c[l>>2]|0)){u=-1;i=f;return u|0}if(!(c[p>>2]|0)){u=-1;i=f;return u|0}n=l+24|0;r=Nd(n,d+q|0,e-q|0)|0;if((r|0)<0){u=-1;i=f;return u|0}s=r+q|0;c[m>>2]=0;q=(o|0)!=0;do if(q){o=Nd(m,d+s|0,e-s|0)|0;if((o|0)<0){u=-1;i=f;return u|0}else{s=o+s|0;break}}while(0);o=l+28|0;c[o>>2]=0;do if(a[j>>0]|0){r=Nd(o,d+s|0,e-s|0)|0;if((r|0)<0){u=-1;i=f;return u|0}else{s=r+s|0;break}}while(0);c[l+32>>2]=0;do if(q){m=(c[m>>2]|0)+s|0;if((m|0)>(e|0))b=-1;else break;i=f;return b|0}else m=s;while(0);if((m|0)<0){u=m;i=f;return u|0}l=c[l>>2]|0;p=c[p>>2]|0;k=c[k>>2]|0;t=c[j>>2]|0;j=t&255;u=c[h>>2]|0;s=(t&65535)>>>8;h=s&65535;r=b+8|0;c[r>>2]=l;q=b+12|0;c[q>>2]=p;c[b+16>>2]=k;a[b+20>>0]=j;a[b+24>>0]=t>>>24;a[b+22>>0]=t>>>16;a[b+23>>0]=a[g>>0]|0;c[b+28>>2]=u;a[b+21>>0]=s;g=b+36|0;c[g>>2]=0;s=c[n>>2]|0;n=s+m|0;a:do if(n>>>0>e>>>0)d=b;else{m=Ld(d+m|0,s,l,p,k,h)|0;c[b>>2]=m;if(!m){d=b;break}if((c[m+64>>2]|0)<(c[r>>2]|0)){d=b;break}if((c[m+68>>2]|0)<(c[q>>2]|0)){d=b;break}switch(c[m+76>>2]|0){case 5:case 58:{if((k|0)!=3){d=b;break a}break};case 8:case 32:{if(k){d=b;break a}break};case 0:case 54:{if((k|0)!=1){d=b;break a}break};case 4:case 56:{if((k|0)!=2){d=b;break a}break};default:{d=b;break a}}if(j<<24>>24){j=c[o>>2]|0;if((j+n|0)>>>0>e>>>0){d=b;break}u=Ld(d+n|0,j,l,p,0,h)|0;c[b+4>>2]=u;if(!u){d=b;break}}c[b+44>>2]=-1;u=0;i=f;return u|0}while(0);if(c[d>>2]|0)yd(d);b=b+4|0;if(c[b>>2]|0)yd(b);c[g>>2]=0;u=-1;i=f;return u|0}function Ld(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;i=i+96|0;n=k+88|0;o=k;l=k+84|0;q=k+80|0;p=Nd(q,b,d)|0;if((p|0)<0){b=0;i=k;return b|0}r=d-p|0;s=c[q>>2]|0;if(s>>>0>r>>>0){b=0;i=k;return b|0}d=s+10|0;q=hd(d)|0;a[q>>0]=g;a[q+1>>0]=e>>>24;a[q+2>>0]=e>>>16;a[q+3>>0]=e>>>8;a[q+4>>0]=e;a[q+5>>0]=f>>>24;a[q+6>>0]=f>>>16;a[q+7>>0]=f>>>8;a[q+8>>0]=f;a[q+9>>0]=h+248;ce(q+10|0,b+p|0,s|0)|0;g=b+(s+p)|0;r=r-s|0;p=hd((d<<1)+10-s+r|0)|0;a[p>>0]=0;a[p+1>>0]=0;a[p+2>>0]=0;a[p+3>>0]=1;a[p+4>>0]=96;a[p+5>>0]=1;if((d|0)>0){f=0;s=6;while(1){e=f+1|0;h=a[q+f>>0]|0;if((e|0)<(d|0)&h<<24>>24==0)if(!(a[q+e>>0]|0)){a[p+s>>0]=0;a[p+(s+1)>>0]=0;a[p+(s+2)>>0]=3;e=f+2|0;s=s+3|0}else{h=0;j=7}else j=7;if((j|0)==7){j=0;a[p+s>>0]=h;s=s+1|0}if((e|0)<(d|0))f=e;else break}if(!s){s=0;j=11}else j=10}else{s=6;j=10}if((j|0)==10)if(!(a[p+(s+ -1)>>0]|0))j=11;if((j|0)==11){a[p+s>>0]=-128;s=s+1|0}jd(q);a[p+s>>0]=0;a[p+(s+1)>>0]=0;a[p+(s+2)>>0]=0;b=s+4|0;a[p+(s+3)>>0]=1;ce(p+b|0,g|0,r|0)|0;r=b+r|0;Zc(o);g=Qc(1416)|0;if(!g)wa(1);if(c[358]&8){b=g+84|0;c[b>>2]=c[b>>2]|65536}b=g+688|0;c[b>>2]=c[b>>2]|1;if((Kc(g,1416,0)|0)<0)wa(1);s=xd()|0;c[l>>2]=s;if(!s){b=0;i=k;return b|0}q=o+28|0;c[q>>2]=r;d=o+24|0;c[d>>2]=p;if((r|0)>0){r=s;s=0;while(1){r=Rc(g,r,n,o)|0;if((r|0)<0){j=26;break}m=((c[n>>2]|0)!=0&1)+s|0;s=c[d>>2]|0;e=c[q>>2]|0;if(s){e=e-r|0;c[q>>2]=e;c[d>>2]=s+r}if((e|0)<=0)break;r=c[l>>2]|0;s=m}if((j|0)==26)wa(1);Lc(g)|0;jd(g);jd(p);if(m){b=c[l>>2]|0;i=k;return b|0}}else{Lc(g)|0;jd(g);jd(p)}yd(l);b=0;i=k;return b|0}function Md(a){a=a|0;var b=0,d=0;b=i;jd(c[a+88>>2]|0);jd(c[a+92>>2]|0);d=0;do{jd(c[a+(d<<2)+96>>2]|0);jd(c[a+(d<<2)+128>>2]|0);d=d+1|0}while((d|0)!=8);jd(c[a+160>>2]|0);if(c[a>>2]|0)yd(a);d=a+4|0;if(!(c[d>>2]|0)){jd(a);i=b;return}yd(d);jd(a);i=b;return}function Nd(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;if((f|0)<1){l=-1;i=g;return l|0}k=e+1|0;l=a[e>>0]|0;j=l&255;if(l<<24>>24<=-1){if(l<<24>>24==-128){l=-1;i=g;return l|0}j=j&127;while(1){if((f|0)<2){b=-1;h=10;break}l=k;k=k+1|0;l=d[l>>0]|0;j=l&127|j<<7;if(!(l&128))break;else f=f+ -1|0}if((h|0)==10){i=g;return b|0}c[b>>2]=j;h=k-e|0;if((h|0)<0){l=h;i=g;return l|0}}else{c[b>>2]=j;h=1}l=j>>>0>1073741823?-1:h;i=g;return l|0}function Od(d,f,g,h,j,k,l){d=d|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;j=i;if((c[d+40>>2]|0)==8?(c[d+44>>2]|0)==0:0){if((k|0)>0)h=0;else{i=j;return}while(1){o=b[g+(h<<1)>>1]&255;a[f>>0]=o;a[f+1>>0]=o;a[f+2>>0]=o;h=h+1|0;if((h|0)==(k|0))break;else f=f+l|0}i=j;return}m=c[d+12>>2]|0;h=c[d+16>>2]|0;d=c[d>>2]|0;if((k|0)>0)n=0;else{i=j;return}while(1){o=($(e[g+(n<<1)>>1]|0,m)|0)+h>>d;if((o|0)<0)o=0;else o=(o|0)>255?-1:o&255;a[f>>0]=o;a[f+1>>0]=o;a[f+2>>0]=o;n=n+1|0;if((n|0)==(k|0))break;else f=f+l|0}i=j;return}function Pd(b,d,f,g,h,j,k){b=b|0;d=d|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;q=i;s=c[b+20>>2]|0;n=c[b+24>>2]|0;o=c[b+28>>2]|0;l=c[b+32>>2]|0;p=c[b+12>>2]|0;r=c[b+16>>2]|0;m=c[b>>2]|0;b=c[b+36>>2]|0;if((j|0)>0)t=0;else{i=q;return}while(1){v=$(e[f+(t<<1)>>1]|0,p)|0;u=(e[g+(t<<1)>>1]|0)-b|0;w=(e[h+(t<<1)>>1]|0)-b|0;v=v+r|0;x=v+($(w,s)|0)>>m;if((x|0)<0)x=0;else x=(x|0)>255?-1:x&255;a[d>>0]=x;w=v-($(u,n)|0)-($(w,o)|0)>>m;if((w|0)<0)w=0;else w=(w|0)>255?-1:w&255;a[d+1>>0]=w;u=v+($(u,l)|0)>>m;if((u|0)<0)u=0;else u=(u|0)>255?-1:u&255;a[d+2>>0]=u;t=t+1|0;if((t|0)==(j|0))break;else d=d+k|0}i=q;return}function Qd(d,f,g,h,j,k,l){d=d|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;m=i;if((c[d+40>>2]|0)==8?(c[d+44>>2]|0)==0:0){if((k|0)>0)n=0;else{i=m;return}while(1){a[f>>0]=b[j+(n<<1)>>1];a[f+1>>0]=b[g+(n<<1)>>1];a[f+2>>0]=b[h+(n<<1)>>1];n=n+1|0;if((n|0)==(k|0))break;else f=f+l|0}i=m;return}o=c[d+12>>2]|0;n=c[d+16>>2]|0;d=c[d>>2]|0;if((k|0)>0)p=0;else{i=m;return}while(1){q=($(e[j+(p<<1)>>1]|0,o)|0)+n>>d;if((q|0)<0)q=0;else q=(q|0)>255?-1:q&255;a[f>>0]=q;q=($(e[g+(p<<1)>>1]|0,o)|0)+n>>d;if((q|0)<0)q=0;else q=(q|0)>255?-1:q&255;a[f+1>>0]=q;q=($(e[h+(p<<1)>>1]|0,o)|0)+n>>d;if((q|0)<0)q=0;else q=(q|0)>255?-1:q&255;a[f+2>>0]=q;p=p+1|0;if((p|0)==(k|0))break;else f=f+l|0}i=m;return}function Rd(b,d,f,g,h,j,k){b=b|0;d=d|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;o=i;l=c[b+12>>2]|0;m=c[b+16>>2]|0;n=c[b>>2]|0;b=c[b+36>>2]|0;if((j|0)>0)p=0;else{i=o;return}while(1){t=e[f+(p<<1)>>1]|0;s=(e[g+(p<<1)>>1]|0)-b|0;r=(e[h+(p<<1)>>1]|0)-b|0;q=t-s|0;u=($(q+r|0,l)|0)+m>>n;if((u|0)<0)u=0;else u=(u|0)>255?-1:u&255;a[d>>0]=u;s=($(s+t|0,l)|0)+m>>n;if((s|0)<0)s=0;else s=(s|0)>255?-1:s&255;a[d+1>>0]=s;q=($(q-r|0,l)|0)+m>>n;if((q|0)<0)q=0;else q=(q|0)>255?-1:q&255;a[d+2>>0]=q;p=p+1|0;if((p|0)==(j|0))break;else d=d+k|0}i=o;return}function Sd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;if((b|0)==0|b>>>0>2147483583){k=0;i=d;return k|0}do if(!(c[1523]|0)){e=ta(64)|0;if((e|0)==(-1|0)){k=0;i=d;return k|0}else{c[1524]=ta(0)|0;c[1523]=6088;c[1522]=6088;c[1527]=6104;c[1526]=6104;k=e+16|0;a[e+15>>0]=-86;j=c[1527]|0;c[1527]=k;c[k>>2]=6104;c[e+20>>2]=j;c[j>>2]=k;j=e+24|0;k=c[1523]|0;c[1523]=j;c[j>>2]=6088;c[e+28>>2]=k;c[k>>2]=j;break}}while(0);e=b+40&-32;h=c[1524]|0;g=c[1522]|0;k=6092|0;while(1){f=c[k>>2]|0;b=f+ -8|0;k=c[f+ -4>>2]|0;if((k|0)==6104)j=h;else j=k;j=j-b|0;if(e>>>0>>0){h=12;break}if((f|0)==(g|0)){h=10;break}k=f+4|0;if((e|0)==(j|0)){h=15;break}}do if((h|0)==10)if((ta(e+32-j|0)|0)==(-1|0)){k=0;i=d;return k|0}else{c[1524]=ta(0)|0;k=c[g+ -4>>2]|0;f=g;h=12;break}else if((h|0)==15){j=c[f>>2]|0;k=c[k>>2]|0;c[j+4>>2]=k;c[k>>2]=j}while(0);if((h|0)==12){h=b+e|0;c[f+ -4>>2]=h;c[h>>2]=b;c[b+(e|4)>>2]=k;c[k>>2]=h;h=b+(e|8)|0;k=f+4|0;j=c[k>>2]|0;c[k>>2]=h;c[h>>2]=f;c[b+(e|12)>>2]=j;c[j>>2]=h;a[b+(e+ -1)>>0]=-86;j=c[f>>2]|0;k=c[k>>2]|0;c[j+4>>2]=k;c[k>>2]=j}a[b+ -1>>0]=85;k=f;i=d;return k|0}function Td(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;if(!b){i=d;return}g=b+ -8|0;e=c[1523]|0;c[1523]=b;c[b>>2]=6088;f=b+4|0;c[f>>2]=e;c[e>>2]=b;a[b+ -9>>0]=-86;e=c[g>>2]|0;if((e|0)!=6104?(a[e+ -1>>0]|0)==-86:0){g=c[b+ -4>>2]|0;c[e+4>>2]=g;c[g>>2]=e;b=c[b>>2]|0;g=c[f>>2]|0;c[b+4>>2]=g;c[g>>2]=b}else e=g;b=c[e+4>>2]|0;if((b|0)==6104){i=d;return}if((a[b+ -1>>0]|0)!=-86){i=d;return}g=c[b>>2]|0;h=c[b+4>>2]|0;c[g+4>>2]=h;c[h>>2]=g;h=e+8|0;g=c[h>>2]|0;j=e+12|0;f=c[j>>2]|0;c[g+4>>2]=f;c[f>>2]=g;f=b+8|0;g=b+12|0;e=c[g>>2]|0;c[g>>2]=h;c[h>>2]=f;c[j>>2]=e;c[e>>2]=h;f=c[f>>2]|0;g=c[g>>2]|0;c[f+4>>2]=g;c[g>>2]=f;i=d;return}function Ud(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;do if(a){if(!b){Td(a);e=0;break}e=Sd(b)|0;if(!e)e=0;else{f=(c[a+ -4>>2]|0)-a+ -1|0;ce(e|0,a|0,(f>>>0>b>>>0?b:f)|0)|0;Td(a)}}else e=Sd(b)|0;while(0);i=d;return e|0}function Vd(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;f=i;if(!d){h=0;i=f;return h|0}while(1){g=a[b>>0]|0;h=a[c>>0]|0;if(g<<24>>24!=h<<24>>24)break;d=d+ -1|0;if(!d){b=0;e=5;break}else{b=b+1|0;c=c+1|0}}if((e|0)==5){i=f;return b|0}h=(g&255)-(h&255)|0;i=f;return h|0}function Wd(){}function Xd(a){a=a|0;return(a&255)<<24|(a>>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function Yd(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>c;return a>>>c|(b&(1<>c-32|0}function Zd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;b=b-d-(c>>>0>a>>>0|0)>>>0;return(D=b,a-c>>>0|0)|0}function _d(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return(D=b+d+(c>>>0>>0|0)>>>0,c|0)|0}function $d(b){b=b|0;var c=0;c=b;while(a[c>>0]|0)c=c+1|0;return c-b|0}function ae(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;i=b&3;h=d|d<<8|d<<16|d<<24;g=f&~3;if(i){i=b+4-i|0;while((b|0)<(i|0)){a[b>>0]=d;b=b+1|0}}while((b|0)<(g|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 be(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b<>>32-c;return a<=4096)return ua(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 de(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>>c;return a>>>c|(b&(1<>>c-32|0}function ee(b){b=b|0;var c=0;c=a[n+(b>>>24)>>0]|0;if((c|0)<8)return c|0;c=a[n+(b>>16&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>8&255)>>0]|0;if((c|0)<8)return c+16|0;return(a[n+(b&255)>>0]|0)+24|0}function fe(b){b=b|0;var c=0;c=a[m+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return(a[m+(b>>>24)>>0]|0)+24|0}function ge(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;d=b&65535;c=$(d,f)|0;e=a>>>16;d=(c>>>16)+($(d,e)|0)|0;b=b>>>16;a=$(b,f)|0;return(D=(d>>>16)+($(b,e)|0)+(((d&65535)+a|0)>>>16)|0,d+a<<16|c&65535|0)|0}function he(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;f=c;a=ge(e,f)|0;c=D;return(D=($(b,f)|0)+($(d,e)|0)+c|c&0,a|0|0)|0}function ie(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return za[a&1](b|0,c|0,d|0)|0}function je(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;Aa[a&1](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0)}function ke(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;Ba[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0)}function le(a,b,c,d,e,f,g,h,i,j,k,l,m,n){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;Ca[a&3](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)}function me(a,b){a=a|0;b=b|0;Da[a&1](b|0)}function ne(a,b,c){a=a|0;b=b|0;c=c|0;Ea[a&7](b|0,c|0)}function oe(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return Fa[a&1](b|0,c|0,d|0,e|0,f|0,g|0)|0}function pe(a,b){a=a|0;b=b|0;return Ga[a&3](b|0)|0}function qe(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Ha[a&7](b|0,c|0,d|0)}function re(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Ia[a&1](b|0,c|0,d|0,e|0)|0}function se(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;Ja[a&3](b|0,c|0,d|0,e|0,f|0,g|0)}function te(a,b,c){a=a|0;b=b|0;c=c|0;return Ka[a&1](b|0,c|0)|0}function ue(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return La[a&1](b|0,c|0,d|0,e|0,f|0)|0}function ve(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Ma[a&7](b|0,c|0,d|0,e|0)}function we(a,b,c){a=a|0;b=b|0;c=c|0;aa(0);return 0}function xe(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;aa(1)}function ye(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;aa(2)}function ze(a,b,c,d,e,f,g,h,i,j,k,l,m){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;aa(3)}function Ae(a){a=a|0;aa(4)}function Be(a,b){a=a|0;b=b|0;aa(5)}function Ce(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(6);return 0}function De(a){a=a|0;aa(7);return 0}function Ee(a,b,c){a=a|0;b=b|0;c=c|0;aa(8)}function Fe(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aa(9);return 0}function Ge(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(10)}function He(a,b){a=a|0;b=b|0;aa(11);return 0}function Ie(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;aa(12);return 0}function Je(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aa(13)} +function fc(a,c,d,f){a=a|0;c=c|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;d=d>>>1;f=1<>1]|0)+(e[k>>1]|0)|0;if(n&h)n=0-n>>31&f;b[k>>1]=n;m=m+1|0;if((m|0)==16)break;else l=l+2|0}j=j+1|0;if((j|0)==16)break;else{c=c+32|0;a=a+(d<<1)|0}}i=g;return}function gc(a,c,d,f){a=a|0;c=c|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;d=d>>>1;f=1<>1]|0)+(e[k>>1]|0)|0;if(n&h)n=0-n>>31&f;b[k>>1]=n;m=m+1|0;if((m|0)==32)break;else l=l+2|0}j=j+1|0;if((j|0)==32)break;else{c=c+64|0;a=a+(d<<1)|0}}i=g;return}function hc(a,c,d){a=a|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;c=c<<16>>16;d=15-d-c|0;c=1<0){f=1<0){h=a;a=0}else{i=e;return}while(1){j=h;g=0;while(1){b[j>>1]=(b[j>>1]|0)+f>>d;g=g+1|0;if((g|0)==(c|0))break;else j=j+2|0}a=a+1|0;if((a|0)==(c|0))break;else h=h+(c<<1)|0}i=e;return}if((c|0)<=0){i=e;return}d=0-d|0;f=0;while(1){g=a;h=0;while(1){b[g>>1]=b[g>>1]<>16);if(d){d=c+ -1|0;if((d|0)<=0){i=f;return}g=(c|0)>0;h=0;do{if(g){j=0;do{k=a+(j+c<<1)|0;b[k>>1]=(e[k>>1]|0)+(e[a+(j<<1)>>1]|0);j=j+1|0}while((j|0)!=(c|0))}a=a+(c<<1)|0;h=h+1|0}while((h|0)!=(d|0));i=f;return}if((c|0)<=0){i=f;return}d=(c|0)>1;h=0;while(1){if(d){j=b[a>>1]|0;g=1;do{k=a+(g<<1)|0;j=(e[k>>1]|0)+(j&65535)&65535;b[k>>1]=j;g=g+1|0}while((g|0)!=(c|0))}h=h+1|0;if((h|0)==(c|0))break;else a=a+(c<<1)|0}i=f;return}function jc(a,c){a=a|0;c=c|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;d=i;e=0;g=a;while(1){q=b[g>>1]|0;n=g+16|0;o=b[n>>1]|0;h=o+q|0;f=g+24|0;p=b[f>>1]|0;m=p+o|0;j=q-p|0;l=g+8|0;k=(b[l>>1]|0)*74|0;p=((q-o+p|0)*74|0)+64|0;o=p>>7;if((o+32768|0)>>>0>65535)o=p>>31^32767;b[n>>1]=o;o=(h*29|0)+64+(m*55|0)+k|0;n=o>>7;if((n+32768|0)>>>0>65535)n=o>>31^32767;b[g>>1]=n;m=($(m,-29)|0)+64+(j*55|0)+k|0;n=m>>7;if((n+32768|0)>>>0>65535)n=m>>31^32767;b[l>>1]=n;j=(h*55|0)+64+(j*29|0)-k|0;h=j>>7;if((h+32768|0)>>>0>65535)h=j>>31^32767;b[f>>1]=h;e=e+1|0;if((e|0)==4)break;else g=g+2|0}e=20-c|0;c=1<>1]|0;n=a+4|0;q=b[n>>1]|0;l=q+p|0;f=a+6|0;o=b[f>>1]|0;m=o+q|0;h=p-o|0;k=a+2|0;j=(b[k>>1]|0)*74|0;o=((p-q+o|0)*74|0)+c>>e;if((o+32768|0)>>>0>65535)o=o>>31^32767;b[n>>1]=o;n=(l*29|0)+c+(m*55|0)+j>>e;if((n+32768|0)>>>0>65535)n=n>>31^32767;b[a>>1]=n;m=($(m,-29)|0)+c+(h*55|0)+j>>e;if((m+32768|0)>>>0>65535)m=m>>31^32767;b[k>>1]=m;h=(l*55|0)+c+(h*29|0)-j>>e;if((h+32768|0)>>>0>65535)h=h>>31^32767;b[f>>1]=h;g=g+1|0;if((g|0)==4)break;else a=a+8|0}i=d;return}function kc(a,c,d){a=a|0;c=c|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;c=i;e=0;g=a;while(1){n=b[g>>1]<<6;k=g+16|0;m=b[k>>1]<<6;j=m+n|0;m=n-m|0;n=g+8|0;l=b[n>>1]|0;f=g+24|0;o=b[f>>1]|0;h=(o*36|0)+(l*83|0)|0;l=($(o,-83)|0)+(l*36|0)|0;o=j+64+h|0;p=o>>7;if((p+32768|0)>>>0>65535)p=o>>31^32767;b[g>>1]=p;p=m+64+l|0;o=p>>7;if((o+32768|0)>>>0>65535)o=p>>31^32767;b[n>>1]=o;l=m-l+64|0;m=l>>7;if((m+32768|0)>>>0>65535)m=l>>31^32767;b[k>>1]=m;j=j-h+64|0;h=j>>7;if((h+32768|0)>>>0>65535)h=j>>31^32767;b[f>>1]=h;e=e+1|0;if((e|0)==4)break;else g=g+2|0}e=20-d|0;d=1<>1]<<6;k=a+4|0;o=b[k>>1]<<6;m=a+2|0;l=b[m>>1]|0;f=a+6|0;j=b[f>>1]|0;h=(j*36|0)+(l*83|0)|0;l=($(j,-83)|0)+(l*36|0)|0;j=o+n+d|0;p=j+h>>e;if((p+32768|0)>>>0>65535)p=p>>31^32767;b[a>>1]=p;n=n-o+d|0;o=n+l>>e;if((o+32768|0)>>>0>65535)o=o>>31^32767;b[m>>1]=o;l=n-l>>e;if((l+32768|0)>>>0>65535)l=l>>31^32767;b[k>>1]=l;h=j-h>>e;if((h+32768|0)>>>0>65535)h=h>>31^32767;b[f>>1]=h;g=g+1|0;if((g|0)==4)break;else a=a+8|0}i=c;return}function lc(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,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;j=i;i=i+64|0;r=j+48|0;p=j+32|0;g=j+16|0;h=j;q=(e|0)>8;s=e+4|0;k=r+4|0;l=r+8|0;m=r+12|0;o=0;s=(s|0)>8?8:s;n=d;while(1){c[p+0>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;w=(s|0)>1;t=0;do{if(w){v=p+(t<<2)|0;u=c[v>>2]|0;x=1;do{u=($(b[n+(x<<3<<1)>>1]|0,a[1664+(x<<2<<5)+t>>0]|0)|0)+u|0;x=x+2|0}while((x|0)<(s|0));c[v>>2]=u}t=t+1|0}while((t|0)!=4);w=b[n>>1]<<6;v=b[n+64>>1]<<6;x=v+w|0;v=w-v|0;w=b[n+32>>1]|0;u=b[n+96>>1]|0;t=(u*36|0)+(w*83|0)|0;w=($(u,-83)|0)+(w*36|0)|0;u=t+x|0;c[r>>2]=u;c[k>>2]=w+v;c[l>>2]=v-w;c[m>>2]=x-t;t=0;while(1){v=c[p+(t<<2)>>2]|0;w=u+64+v|0;x=w>>7;if((x+32768|0)>>>0>65535)x=w>>31^32767;b[n+(t<<3<<1)>>1]=x;v=u-v+64|0;u=v>>7;if((u+32768|0)>>>0>65535)u=v>>31^32767;b[n+(7-t<<3<<1)>>1]=u;t=t+1|0;if((t|0)==4)break;u=c[r+(t<<2)>>2]|0}if((s|0)<8)s=(o&3|0)==0&(o|0)!=0?s+ -4|0:s;o=o+1|0;if((o|0)==8)break;else n=n+2|0}k=q?8:e;l=20-f|0;m=1<1;n=g+4|0;o=g+8|0;e=g+12|0;p=0;while(1){c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;t=0;do{if(f){q=h+(t<<2)|0;s=c[q>>2]|0;r=1;do{s=($(b[d+(r<<1)>>1]|0,a[1664+(r<<2<<5)+t>>0]|0)|0)+s|0;r=r+2|0}while((r|0)<(k|0));c[q>>2]=s}t=t+1|0}while((t|0)!=4);w=b[d>>1]<<6;v=b[d+8>>1]<<6;x=v+w|0;v=w-v|0;w=b[d+4>>1]|0;s=b[d+12>>1]|0;q=(s*36|0)+(w*83|0)|0;w=($(s,-83)|0)+(w*36|0)|0;s=q+x|0;c[g>>2]=s;c[n>>2]=w+v;c[o>>2]=v-w;c[e>>2]=x-q;q=0;while(1){r=c[h+(q<<2)>>2]|0;s=s+m|0;t=s+r>>l;if((t+32768|0)>>>0>65535)t=t>>31^32767;b[d+(q<<1)>>1]=t;r=s-r>>l;if((r+32768|0)>>>0>65535)r=r>>31^32767;b[d+(7-q<<1)>>1]=r;q=q+1|0;if((q|0)==4)break;s=c[g+(q<<2)>>2]|0}p=p+1|0;if((p|0)==8)break;else d=d+16|0}i=j;return}function mc(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,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;g=i;i=i+192|0;t=g+160|0;u=g+128|0;v=g+112|0;s=g+96|0;j=g+64|0;l=g+32|0;h=g+16|0;k=g;m=(e|0)>16;w=e+4|0;n=v+4|0;o=v+8|0;p=v+12|0;r=0;w=(w|0)>16?16:w;q=d;while(1){c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;c[u+12>>2]=0;c[u+16>>2]=0;c[u+20>>2]=0;c[u+24>>2]=0;c[u+28>>2]=0;A=(w|0)>1;B=0;do{if(A){z=u+(B<<2)|0;x=c[z>>2]|0;y=1;do{x=($(b[q+(y<<4<<1)>>1]|0,a[1664+(y<<1<<5)+B>>0]|0)|0)+x|0;y=y+2|0}while((y|0)<(w|0));c[z>>2]=x}B=B+1|0}while((B|0)!=8);c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;c[s+12>>2]=0;y=0;do{x=s+(y<<2)|0;A=c[x>>2]|0;z=1;do{A=($(b[q+(z<<5<<1)>>1]|0,a[1664+(z<<2<<5)+y>>0]|0)|0)+A|0;z=z+2|0}while((z|0)<8);c[x>>2]=A;y=y+1|0}while((y|0)!=4);A=b[q>>1]<<6;z=b[q+256>>1]<<6;B=z+A|0;z=A-z|0;A=b[q+128>>1]|0;x=b[q+384>>1]|0;y=(x*36|0)+(A*83|0)|0;A=($(x,-83)|0)+(A*36|0)|0;x=y+B|0;c[v>>2]=x;c[n>>2]=A+z;c[o>>2]=z-A;c[p>>2]=B-y;y=0;while(1){B=c[s+(y<<2)>>2]|0;c[t+(y<<2)>>2]=B+x;c[t+(7-y<<2)>>2]=x-B;y=y+1|0;if((y|0)==4){x=0;break}x=c[v+(y<<2)>>2]|0}do{z=c[t+(x<<2)>>2]|0;y=c[u+(x<<2)>>2]|0;B=z+64+y|0;A=B>>7;if((A+32768|0)>>>0>65535)A=B>>31^32767;b[q+(x<<4<<1)>>1]=A;y=z-y+64|0;z=y>>7;if((z+32768|0)>>>0>65535)z=y>>31^32767;b[q+(15-x<<4<<1)>>1]=z;x=x+1|0}while((x|0)!=8);if((w|0)<16)w=(r&3|0)==0&(r|0)!=0?w+ -4|0:w;r=r+1|0;if((r|0)==16)break;else q=q+2|0}m=m?16:e;f=20-f|0;n=1<1;o=h+4|0;r=h+8|0;p=h+12|0;s=0;while(1){c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;c[l+16>>2]=0;c[l+20>>2]=0;c[l+24>>2]=0;c[l+28>>2]=0;v=0;do{if(q){e=l+(v<<2)|0;u=c[e>>2]|0;t=1;do{u=($(b[d+(t<<1)>>1]|0,a[1664+(t<<1<<5)+v>>0]|0)|0)+u|0;t=t+2|0}while((t|0)<(m|0));c[e>>2]=u}v=v+1|0}while((v|0)!=8);c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;e=0;do{t=k+(e<<2)|0;v=c[t>>2]|0;u=1;do{v=($(b[d+(u<<1<<1)>>1]|0,a[1664+(u<<2<<5)+e>>0]|0)|0)+v|0;u=u+2|0}while((u|0)<8);c[t>>2]=v;e=e+1|0}while((e|0)!=4);A=b[d>>1]<<6;z=b[d+16>>1]<<6;B=z+A|0;z=A-z|0;A=b[d+8>>1]|0;t=b[d+24>>1]|0;u=(t*36|0)+(A*83|0)|0;A=($(t,-83)|0)+(A*36|0)|0;t=u+B|0;c[h>>2]=t;c[o>>2]=A+z;c[r>>2]=z-A;c[p>>2]=B-u;u=0;while(1){B=c[k+(u<<2)>>2]|0;c[j+(u<<2)>>2]=B+t;c[j+(7-u<<2)>>2]=t-B;u=u+1|0;if((u|0)==4){t=0;break}t=c[h+(u<<2)>>2]|0}do{u=c[l+(t<<2)>>2]|0;v=(c[j+(t<<2)>>2]|0)+n|0;e=v+u>>f;if((e+32768|0)>>>0>65535)e=e>>31^32767;b[d+(t<<1)>>1]=e;u=v-u>>f;if((u+32768|0)>>>0>65535)u=u>>31^32767;b[d+(15-t<<1)>>1]=u;t=t+1|0}while((t|0)!=8);s=s+1|0;if((s|0)==16)break;else d=d+32|0}i=g;return}function nc(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,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;i=i+320|0;h=g+256|0;n=g+192|0;o=g+160|0;s=g+128|0;u=g+112|0;t=g+96|0;m=g+64|0;k=g+32|0;j=g+16|0;l=g;q=(e|0)>32;y=e+4|0;v=u+4|0;w=u+8|0;x=u+12|0;p=0;y=(y|0)>32?32:y;r=d;while(1){z=n+0|0;A=z+64|0;do{c[z>>2]=0;z=z+4|0}while((z|0)<(A|0));z=(y|0)>1;C=0;do{if(z){B=n+(C<<2)|0;A=c[B>>2]|0;D=1;do{A=($(b[r+(D<<5<<1)>>1]|0,a[1664+(D<<5)+C>>0]|0)|0)+A|0;D=D+2|0}while((D|0)<(y|0));c[B>>2]=A}C=C+1|0}while((C|0)!=16);c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;c[s+12>>2]=0;c[s+16>>2]=0;c[s+20>>2]=0;c[s+24>>2]=0;c[s+28>>2]=0;z=(y|0)/2|0;A=(y|0)>3;B=0;do{if(A){C=s+(B<<2)|0;D=c[C>>2]|0;E=1;do{D=($(b[r+(E<<6<<1)>>1]|0,a[1664+(E<<1<<5)+B>>0]|0)|0)+D|0;E=E+2|0}while((E|0)<(z|0));c[C>>2]=D}B=B+1|0}while((B|0)!=8);c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;C=0;do{z=t+(C<<2)|0;B=c[z>>2]|0;A=1;do{B=($(b[r+(A<<7<<1)>>1]|0,a[1664+(A<<2<<5)+C>>0]|0)|0)+B|0;A=A+2|0}while((A|0)<8);c[z>>2]=B;C=C+1|0}while((C|0)!=4);D=b[r>>1]<<6;C=b[r+1024>>1]<<6;E=C+D|0;C=D-C|0;D=b[r+512>>1]|0;z=b[r+1536>>1]|0;A=(z*36|0)+(D*83|0)|0;D=($(z,-83)|0)+(D*36|0)|0;z=A+E|0;c[u>>2]=z;c[v>>2]=D+C;c[w>>2]=C-D;c[x>>2]=E-A;A=0;while(1){E=c[t+(A<<2)>>2]|0;c[o+(A<<2)>>2]=E+z;c[o+(7-A<<2)>>2]=z-E;A=A+1|0;if((A|0)==4){z=0;break}z=c[u+(A<<2)>>2]|0}do{D=c[o+(z<<2)>>2]|0;E=c[s+(z<<2)>>2]|0;c[h+(z<<2)>>2]=E+D;c[h+(15-z<<2)>>2]=D-E;z=z+1|0}while((z|0)!=8);z=0;do{A=c[h+(z<<2)>>2]|0;B=c[n+(z<<2)>>2]|0;D=A+64+B|0;C=D>>7;if((C+32768|0)>>>0>65535)C=D>>31^32767;b[r+(z<<5<<1)>>1]=C;A=A-B+64|0;B=A>>7;if((B+32768|0)>>>0>65535)B=A>>31^32767;b[r+(31-z<<5<<1)>>1]=B;z=z+1|0}while((z|0)!=16);if((y|0)<32)y=(p&3|0)==0&(p|0)!=0?y+ -4|0:y;p=p+1|0;if((p|0)==32)break;else r=r+2|0}o=q?32:e;e=20-f|0;s=1<1;r=(o|0)/2|0;q=(o|0)>3;p=j+4|0;t=j+8|0;u=j+12|0;v=0;while(1){z=n+0|0;A=z+64|0;do{c[z>>2]=0;z=z+4|0}while((z|0)<(A|0));z=0;do{if(f){w=n+(z<<2)|0;y=c[w>>2]|0;x=1;do{y=($(b[d+(x<<1)>>1]|0,a[1664+(x<<5)+z>>0]|0)|0)+y|0;x=x+2|0}while((x|0)<(o|0));c[w>>2]=y}z=z+1|0}while((z|0)!=16);c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;c[k+16>>2]=0;c[k+20>>2]=0;c[k+24>>2]=0;c[k+28>>2]=0;z=0;do{if(q){w=k+(z<<2)|0;y=c[w>>2]|0;x=1;do{E=x<<1;y=($(b[d+(E<<1)>>1]|0,a[1664+(E<<5)+z>>0]|0)|0)+y|0;x=x+2|0}while((x|0)<(r|0));c[w>>2]=y}z=z+1|0}while((z|0)!=8);c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;w=0;do{x=l+(w<<2)|0;z=c[x>>2]|0;y=1;do{E=y<<2;z=($(b[d+(E<<1)>>1]|0,a[1664+(E<<5)+w>>0]|0)|0)+z|0;y=y+2|0}while((y|0)<8);c[x>>2]=z;w=w+1|0}while((w|0)!=4);D=b[d>>1]<<6;C=b[d+32>>1]<<6;E=C+D|0;C=D-C|0;D=b[d+16>>1]|0;w=b[d+48>>1]|0;x=(w*36|0)+(D*83|0)|0;D=($(w,-83)|0)+(D*36|0)|0;w=x+E|0;c[j>>2]=w;c[p>>2]=D+C;c[t>>2]=C-D;c[u>>2]=E-x;x=0;while(1){E=c[l+(x<<2)>>2]|0;c[m+(x<<2)>>2]=E+w;c[m+(7-x<<2)>>2]=w-E;x=x+1|0;if((x|0)==4){w=0;break}w=c[j+(x<<2)>>2]|0}do{D=c[m+(w<<2)>>2]|0;E=c[k+(w<<2)>>2]|0;c[h+(w<<2)>>2]=E+D;c[h+(15-w<<2)>>2]=D-E;w=w+1|0}while((w|0)!=8);w=0;do{x=c[n+(w<<2)>>2]|0;y=(c[h+(w<<2)>>2]|0)+s|0;z=y+x>>e;if((z+32768|0)>>>0>65535)z=z>>31^32767;b[d+(w<<1)>>1]=z;x=y-x>>e;if((x+32768|0)>>>0>65535)x=x>>31^32767;b[d+(31-w<<1)>>1]=x;w=w+1|0}while((w|0)!=16);v=v+1|0;if((v|0)==32)break;else d=d+64|0}i=g;return}function oc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0;d=i;c=14-c|0;c=((b[a>>1]|0)+1>>1)+(1<>c&65535;e=0;do{f=e<<2;b[a+(f<<1)>>1]=c;b[a+((f|1)<<1)>>1]=c;b[a+((f|2)<<1)>>1]=c;b[a+((f|3)<<1)>>1]=c;e=e+1|0}while((e|0)!=4);i=d;return}function pc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0;d=i;c=14-c|0;c=((b[a>>1]|0)+1>>1)+(1<>c&65535;e=0;do{f=e<<3;b[a+(f<<1)>>1]=c;b[a+((f|1)<<1)>>1]=c;b[a+((f|2)<<1)>>1]=c;b[a+((f|3)<<1)>>1]=c;b[a+((f|4)<<1)>>1]=c;b[a+((f|5)<<1)>>1]=c;b[a+((f|6)<<1)>>1]=c;b[a+((f|7)<<1)>>1]=c;e=e+1|0}while((e|0)!=8);i=d;return}function qc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0,g=0;d=i;e=14-c|0;e=((b[a>>1]|0)+1>>1)+(1<>e&65535;c=0;do{f=c<<4;g=0;do{b[a+(g+f<<1)>>1]=e;g=g+1|0}while((g|0)!=16);c=c+1|0}while((c|0)!=16);i=d;return}function rc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0,g=0;d=i;e=14-c|0;e=((b[a>>1]|0)+1>>1)+(1<>e&65535;c=0;do{f=c<<5;g=0;do{b[a+(g+f<<1)>>1]=e;g=g+1|0}while((g|0)!=32);c=c+1|0}while((c|0)!=32);i=d;return}function sc(a,f,g,h,j,k,l,m,n,o){a=a|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0;p=i;i=i+128|0;k=p;r=k+0|0;q=r+128|0;do{c[r>>2]=0;r=r+4|0}while((r|0)<(q|0));t=d[j+n+96>>0]|0;g=g>>>1;c[k+((t&31)<<2)>>2]=b[j+(n*10|0)+114>>1];c[k+((t+1&31)<<2)>>2]=b[j+(n*10|0)+116>>1];c[k+((t+2&31)<<2)>>2]=b[j+(n*10|0)+118>>1];c[k+((t+3&31)<<2)>>2]=b[j+(n*10|0)+120>>1];j=o+ -5|0;h=h>>>1;if((m|0)<=0){i=p;return}n=(l|0)>0;o=1<>1]|0;t=t+(c[k+(t>>>j<<2)>>2]|0)|0;if(t&q)t=0-t>>31&o;b[a+(s<<1)>>1]=t;s=s+1|0}while((s|0)!=(l|0))}r=r+1|0;if((r|0)==(m|0))break;else{a=a+(g<<1)|0;f=f+(h<<1)|0}}i=p;return}function tc(a,d,f,g,h,j,k,l,m,n,o,p,q){a=a|0;d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;var r=0,s=0,t=0,u=0,v=0,w=0;n=i;o=h+(m*10|0)+112|0;r=c[h+(m<<2)+100>>2]|0;f=f>>>1;g=g>>>1;if((r|0)!=1){if(c[j>>2]|0){u=b[o>>1]|0;if((l|0)>0){p=1<>1]|0)+u|0;if(v&t)v=0-v>>31&p;b[a+(($(s,f)|0)<<1)>>1]=v;s=s+1|0}while((s|0)!=(l|0));p=1}else p=1}else p=0;if(c[j+8>>2]|0){s=b[o>>1]|0;k=k+ -1|0;if((l|0)>0){v=1<>1]|0)+s|0;if(w&u)w=0-w>>31&v;b[a+(($(t,f)|0)+k<<1)>>1]=w;t=t+1|0}while((t|0)!=(l|0))}}if(!r){u=l;v=p;w=0;t=k;Bc(a,d,f,g,h,t,u,m,v,w,q);i=n;return}}else p=0;if(c[j+4>>2]|0){r=b[o>>1]|0;if((p|0)<(k|0)){s=1<>1]|0)+r|0;if(v&t)v=0-v>>31&s;b[a+(u<<1)>>1]=v;u=u+1|0}while((u|0)!=(k|0));r=1}else r=1}else r=0;if(!(c[j+12>>2]|0)){u=l;v=p;w=r;t=k;Bc(a,d,f,g,h,t,u,m,v,w,q);i=n;return}j=b[o>>1]|0;t=l+ -1|0;o=$(t,f)|0;u=$(t,g)|0;if((p|0)>=(k|0)){u=t;v=p;w=r;t=k;Bc(a,d,f,g,h,t,u,m,v,w,q);i=n;return}s=1<>1]|0)+j|0;if(w&l)w=0-w>>31&s;b[a+(v+o<<1)>>1]=w;v=v+1|0}while((v|0)!=(k|0));Bc(a,d,f,g,h,k,t,m,p,r,q);i=n;return}function uc(d,f,g,h,j,k,l,m,n,o,p,q,r){d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;var 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;t=i;D=j+(n*10|0)+112|0;C=c[j+(n<<2)+100>>2]|0;g=g>>>1;h=h>>>1;B=(C|0)!=1;if(B){if(c[k>>2]|0){I=b[D>>1]|0;if((m|0)>0){H=1<>1]|0)+I|0;if(J&G)J=0-J>>31&H;b[d+(($(F,g)|0)<<1)>>1]=J;F=F+1|0}while((F|0)!=(m|0));F=1}else F=1}else F=0;if(c[k+8>>2]|0){G=b[D>>1]|0;l=l+ -1|0;if((m|0)>0){J=1<>1]|0)+G|0;if(K&I)K=0-K>>31&J;b[d+(($(H,g)|0)+l<<1)>>1]=K;H=H+1|0}while((H|0)!=(m|0))}}if(!C){D=1;G=0}else E=15}else{F=0;E=15}if((E|0)==15){if(c[k+4>>2]|0){H=b[D>>1]|0;if((F|0)<(l|0)){I=1<>1]|0)+H|0;if(J&G)J=0-J>>31&I;b[d+(E<<1)>>1]=J;E=E+1|0}while((E|0)!=(l|0));G=1}else G=1}else G=0;if(c[k+12>>2]|0){D=b[D>>1]|0;m=m+ -1|0;I=$(m,g)|0;H=$(m,h)|0;if((F|0)<(l|0)){K=1<>1]|0)+D|0;if(L&J)L=0-L>>31&K;b[d+(E+I<<1)>>1]=L;E=E+1|0}while((E|0)!=(l|0));D=0}else D=0}else D=0}Bc(d,f,g,h,j,l,m,n,F,G,r);r=(C|0)==2;if((a[q>>0]|0)==0&r?(c[k>>2]|0)==0:0)j=(c[k+4>>2]|0)==0;else j=0;H=j&1;j=q+1|0;C=(C|0)==3;if((a[j>>0]|0)==0&C?(c[k+4>>2]|0)==0:0)n=(c[k+8>>2]|0)==0;else n=0;I=n&1;n=q+2|0;if((a[n>>0]|0)==0&r?(c[k+8>>2]|0)==0:0)E=(c[k+12>>2]|0)==0;else E=0;J=E&1;E=q+3|0;if((a[E>>0]|0)==0&C?(c[k>>2]|0)==0:0)k=(c[k+12>>2]|0)==0;else k=0;k=k&1;B=B^1;if(!((a[o>>0]|0)==0|B)?(A=H+G|0,z=m-k|0,(A|0)<(z|0)):0)do{b[d+(($(A,g)|0)<<1)>>1]=b[f+(($(A,h)|0)<<1)>>1]|0;A=A+1|0}while((A|0)!=(z|0));if(!((a[o+1>>0]|0)==0|B)?(y=I+G|0,x=m-J|0,(y|0)<(x|0)):0){z=l+ -1|0;do{b[d+(z+($(y,g)|0)<<1)>>1]=b[f+(z+($(y,h)|0)<<1)>>1]|0;y=y+1|0}while((y|0)!=(x|0))}if(!((a[p>>0]|0)==0|D)?(w=H+F|0,v=l-I|0,(w|0)<(v|0)):0)do{b[d+(w<<1)>>1]=b[f+(w<<1)>>1]|0;w=w+1|0}while((w|0)!=(v|0));if(!((a[p+1>>0]|0)==0|D)?(u=k+F|0,s=l-J|0,(u|0)<(s|0)):0){v=m+ -1|0;p=$(v,h)|0;v=$(v,g)|0;do{b[d+(u+v<<1)>>1]=b[f+(u+p<<1)>>1]|0;u=u+1|0}while((u|0)!=(s|0))}if((a[q>>0]|0)!=0&r)b[d>>1]=b[f>>1]|0;if((a[j>>0]|0)!=0&C){L=l+ -1|0;b[d+(L<<1)>>1]=b[f+(L<<1)>>1]|0}if((a[n>>0]|0)!=0&r){L=m+ -1|0;K=l+ -1|0;b[d+(K+($(L,g)|0)<<1)>>1]=b[f+(K+($(L,h)|0)<<1)>>1]|0}if(!((a[E>>0]|0)!=0&C)){i=t;return}L=m+ -1|0;b[d+(($(L,g)|0)<<1)>>1]=b[f+(($(L,h)|0)<<1)>>1]|0;i=t;return}function vc(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=i;Ac(a,b,2,c,d,e,f,g);i=h;return}function wc(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=i;Ac(a,2,b,c,d,e,f,g);i=h;return}function xc(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;g=i;zc(a,b,2,c,d,e,f);i=g;return}function yc(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;g=i;zc(a,2,b,c,d,e,f);i=g;return}function zc(d,f,g,h,j,k,l){d=d|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;m=i;f=f>>>1;p=g>>>1;o=l+ -8|0;g=$(f,-2)|0;n=0-f|0;r=1<>2]<=1){v=0-s|0;u=(a[j+l>>0]|0)==0;t=(a[k+l>>0]|0)==0;x=0;w=d;while(1){y=w+(n<<1)|0;B=e[y>>1]|0;z=e[w>>1]|0;A=(e[w+(g<<1)>>1]|0)+4-(e[w+(f<<1)>>1]|0)+(z-B<<2)>>3;if((A|0)<(v|0))A=v;else A=(A|0)>(s|0)?s:A;if(u){B=A+B|0;if(B&q)B=0-B>>31&r;b[y>>1]=B}if(t){y=z-A|0;if(y&q)y=0-y>>31&r;b[w>>1]=y}x=x+1|0;if((x|0)==4)break;else w=w+(p<<1)|0}}l=l+1|0;if((l|0)==2)break;else d=d+(p<<2<<1)|0}i=m;return}function Ac(d,f,g,h,j,k,l,m){d=d|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=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,aa=0,ba=0,ca=0,da=0,ea=0,fa=0;n=i;f=f>>>1;g=g>>>1;o=m+ -8|0;y=h<>3;u=y>>2;q=$(f,-4)|0;p=f*3|0;v=C+q|0;F=(g+f|0)*3|0;t=(y>>1)+y>>3;H=1<>1]|0;X=b[d+(s<<1)>>1]|0;W=b[d+(w<<1)>>1]|0;da=W&65535;R=(Y&65535)-((X&65535)<<1)+da|0;R=(R|0)>-1?R:0-R|0;T=b[d+(h<<1)>>1]|0;U=b[d+(f<<1)>>1]|0;V=b[d>>1]|0;M=V&65535;S=(T&65535)-((U&65535)<<1)+M|0;S=(S|0)>-1?S:0-S|0;ba=e[d+(z<<1)>>1]|0;Q=(e[d+(A<<1)>>1]|0)-((e[d+(B<<1)>>1]|0)<<1)+ba|0;Q=(Q|0)>-1?Q:0-Q|0;ca=e[d+(C<<1)>>1]|0;Z=(e[d+(D<<1)>>1]|0)-((e[d+(E<<1)>>1]|0)<<1)+ca|0;Z=(Z|0)>-1?Z:0-Z|0;L=S+R|0;aa=Z+Q|0;K=c[j+(I<<2)>>2]<>0]|0;P=a[l+I>>0]|0;do if((aa+L|0)<(y|0)){N=(K*5|0)+1>>1;ea=(e[d+(q<<1)>>1]|0)-da|0;O=b[d+(p<<1)>>1]|0;fa=(O&65535)-M|0;if((((((((fa|0)>-1?fa:0-fa|0)+((ea|0)>-1?ea:0-ea|0)|0)<(x|0)?(fa=da-M|0,(((fa|0)>-1?fa:0-fa|0)|0)<(N|0)):0)?(fa=(e[d+(v<<1)>>1]|0)-ba|0,ea=(e[d+(F<<1)>>1]|0)-ca|0,(((ea|0)>-1?ea:0-ea|0)+((fa|0)>-1?fa:0-fa|0)|0)<(x|0)):0)?(fa=ba-ca|0,(((fa|0)>-1?fa:0-fa|0)|0)<(N|0)):0)?(L<<1|0)<(u|0):0)?(aa<<1|0)<(u|0):0){K=K<<1;L=_<<24>>24==0;M=0-K|0;N=P<<24>>24==0;ba=O;P=1;O=d;while(1){Z=O+(r<<1)|0;Y=Y&65535;_=O+(s<<1)|0;X=X&65535;aa=O+(w<<1)|0;R=W&65535;V=V&65535;W=O+(f<<1)|0;U=U&65535;Q=O+(h<<1)|0;S=T&65535;T=ba&65535;if(L){ba=e[O+(q<<1)>>1]|0;ca=(Y+4+U+(R+X+V<<1)>>3)-R|0;if((ca|0)<(M|0))ca=M;else ca=(ca|0)>(K|0)?K:ca;b[aa>>1]=ca+R;aa=((Y+2+X+R+V|0)>>>2)-X|0;if((aa|0)<(M|0))aa=M;else aa=(aa|0)>(K|0)?K:aa;b[_>>1]=aa+X;_=((Y*3|0)+4+X+R+V+(ba<<1)>>3)-Y|0;if((_|0)<(M|0))_=M;else _=(_|0)>(K|0)?K:_;b[Z>>1]=_+Y}if(N){X=(X+4+S+(V+R+U<<1)>>3)-V|0;if((X|0)<(M|0))X=M;else X=(X|0)>(K|0)?K:X;b[O>>1]=X+V;X=((R+2+V+U+S|0)>>>2)-U|0;if((X|0)<(M|0))X=M;else X=(X|0)>(K|0)?K:X;b[W>>1]=X+U;R=(R+4+V+U+(S*3|0)+(T<<1)>>3)-S|0;if((R|0)<(M|0))R=M;else R=(R|0)>(K|0)?K:R;b[Q>>1]=R+S}Q=O+(g<<1)|0;if((P|0)==4)break;Y=b[O+(g+r<<1)>>1]|0;X=b[O+(g+s<<1)>>1]|0;W=b[O+(g-f<<1)>>1]|0;V=b[Q>>1]|0;U=b[O+(g+f<<1)>>1]|0;T=b[O+(g+h<<1)>>1]|0;ba=b[O+(g+p<<1)>>1]|0;P=P+1|0;O=Q}d=d+(J<<1)|0;break}L=K>>1;N=K*10|0;M=0-K|0;O=_<<24>>24!=0;P=P<<24>>24!=0;Q=(Q+R|0)<(t|0)&(O^1);R=0-L|0;S=(Z+S|0)<(t|0)&(P^1);_=V;ba=U;U=1;V=d;while(1){aa=Y&65535;Y=V+(s<<1)|0;Z=X&65535;da=V+(w<<1)|0;ca=W&65535;_=_&65535;W=V+(f<<1)|0;X=ba&65535;T=T&65535;ba=((_-ca|0)*9|0)+8+($(X-Z|0,-3)|0)>>4;if((((ba|0)>-1?ba:0-ba|0)|0)<(N|0)){if((ba|0)<(M|0))ba=M;else ba=(ba|0)>(K|0)?K:ba;if(!O){ea=ba+ca|0;if(ea&G)ea=0-ea>>31&H;b[da>>1]=ea}if(!P){da=_-ba|0;if(da&G)da=0-da>>31&H;b[V>>1]=da}if(Q){aa=((aa+1+ca|0)>>>1)-Z+ba>>1;if((aa|0)<(R|0))aa=R;else aa=(aa|0)>(L|0)?L:aa;Z=aa+Z|0;if(Z&G)Z=0-Z>>31&H;b[Y>>1]=Z}if(S){T=((_+1+T|0)>>>1)-X-ba>>1;if((T|0)<(R|0))T=R;else T=(T|0)>(L|0)?L:T;T=T+X|0;if(T&G)T=0-T>>31&H;b[W>>1]=T}}Z=V+(g<<1)|0;if((U|0)==4)break;Y=b[V+(g+r<<1)>>1]|0;X=b[V+(g+s<<1)>>1]|0;W=b[V+(g-f<<1)>>1]|0;_=b[Z>>1]|0;ba=b[V+(g+f<<1)>>1]|0;T=b[V+(g+h<<1)>>1]|0;U=U+1|0;V=Z}d=d+(J<<1)|0}else d=d+(m<<1)|0;while(0);I=I+1|0}while((I|0)!=2);i=n;return}function Bc(e,f,g,h,j,k,l,m,n,o,p){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;var 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;t=i;x=c[j+(m<<2)+100>>2]|0;r=a[2728+(x<<2)>>0]|0;q=a[2730+(x<<2)>>0]|0;if((o|0)>=(l|0)){i=t;return}s=(n|0)<(k|0);v=1<>0]|0)+o|0,h)|0;y=$((a[2731+(x<<2)>>0]|0)+o|0,h)|0;x=$(o,g)|0;z=$(o,h)|0;while(1){if(s){o=p+r|0;A=y+q|0;B=n;do{C=b[f+(B+z<<1)>>1]|0;D=b[f+(o+B<<1)>>1]|0;if((C&65535)>(D&65535))D=3;else D=((C<<16>>16!=D<<16>>16)<<31>>31)+2|0;E=b[f+(A+B<<1)>>1]|0;if((C&65535)>(E&65535))E=1;else E=(C<<16>>16!=E<<16>>16)<<31>>31;C=(b[j+(m*10|0)+(d[2720+(E+D)>>0]<<1)+112>>1]|0)+(C&65535)|0;if(C&u)C=0-C>>31&v;b[e+(B+x<<1)>>1]=C;B=B+1|0}while((B|0)!=(k|0))}w=w+1|0;if((w|0)==(l|0))break;else{p=p+h|0;y=y+h|0;x=x+g|0;z=z+h|0}}i=t;return}function Cc(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;j=i;k=c[b+136>>2]|0;l=(c[b+200>>2]|0)+13080|0;r=(1<>2])+ -1|0;o=r&e;n=r&f;q=(n|0)!=0|(a[k+309>>0]|0)!=0;m=q&1;c[k+31296>>2]=m;p=(o|0)!=0|(a[k+308>>0]|0)!=0;b=p&1;c[k+31292>>2]=b;if(!(r&(f|e)))p=d[k+311>>0]|0;else p=p&q&1;c[k+31300>>2]=p;if((o+g|0)==(1<>2]|0))m=(a[k+310>>0]|0)!=0&(n|0)==0&1;c[k+31308>>2]=m;if(!m){q=0;q=q&1;r=k+31304|0;c[r>>2]=q;r=h+f|0;q=k+316|0;q=c[q>>2]|0;q=(r|0)<(q|0);q=q?b:0;r=k+31288|0;c[r>>2]=q;i=j;return}q=(g+e|0)<(c[k+312>>2]|0);q=q&1;r=k+31304|0;c[r>>2]=q;r=h+f|0;q=k+316|0;q=c[q>>2]|0;q=(r|0)<(q|0);q=q?b:0;r=k+31288|0;c[r>>2]=q;i=j;return}function Dc(b){b=b|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;f=i;i=i+16|0;e=f;h=c[b+136>>2]|0;j=h+204|0;k=td(13196)|0;c[e>>2]=k;if(!k){u=-12;i=f;return u|0}k=c[k+4>>2]|0;m=td(468)|0;if(!m){u=-12;i=f;return u|0}l=c[m+4>>2]|0;c[l+4>>2]=1;o=l+8|0;c[o>>2]=1;a[l>>0]=0;c[l+348>>2]=1;q=l+352|0;n=l+380|0;r=l+408|0;p=0;do{c[q+(p<<2)>>2]=1;c[n+(p<<2)>>2]=0;c[r+(p<<2)>>2]=-1;p=p+1|0}while((p|0)<(c[o>>2]|0));c[l+436>>2]=0;c[l+440>>2]=1;a[l+444>>0]=0;p=b+208|0;vd(p);c[p>>2]=m;c[k>>2]=0;p=k+72|0;c[p>>2]=1;u=_c(j,8)|0;q=k+4|0;c[q>>2]=u;do if((u|0)<=3){a[k+8>>0]=0;o=k+13120|0;c[o>>2]=cd(j,32)|0;m=cd(j,32)|0;n=k+13124|0;c[n>>2]=m;m=Qc(c[o>>2]|0,m,0,c[b+4>>2]|0)|0;if((m|0)>=0){l=k+52|0;c[l>>2]=(_c(j,8)|0)+8;q=c[q>>2]|0;if((q|0)==1){c[k+60>>2]=54;q=54}else if((q|0)==2){c[k+60>>2]=56;q=56}else if(!q){c[k+60>>2]=32;q=32}else{c[k+60>>2]=58;q=58}c[k+56>>2]=1;q=Bd(q)|0;if(q){c[k+13180>>2]=0;c[k+13168>>2]=0;u=d[q+5>>0]|0;c[k+13172>>2]=u;c[k+13176>>2]=u;u=d[q+6>>0]|0;c[k+13184>>2]=u;c[k+13188>>2]=u;c[k+64>>2]=8;if((c[p>>2]|0)>0){q=k+76|0;r=0;do{c[q+(r*12|0)>>2]=1;c[q+(r*12|0)+4>>2]=0;c[q+(r*12|0)+8>>2]=-1;r=r+1|0}while((r|0)<(c[p>>2]|0))}t=(dd(j)|0)+3|0;u=k+13064|0;c[u>>2]=t;t=1<>2]=s+(c[o>>2]|0)&t;c[n>>2]=s+(c[n>>2]|0)&t;t=k+13068|0;c[t>>2]=dd(j)|0;s=k+13072|0;c[s>>2]=(dd(j)|0)+2;p=dd(j)|0;q=c[s>>2]|0;r=k+13076|0;c[r>>2]=q+p;if(q>>>0<(c[u>>2]|0)>>>0){q=k+13088|0;c[q>>2]=0;p=k+13092|0;c[p>>2]=dd(j)|0;a[k+12941>>0]=bd(j)|0;v=bd(j)|0;c[k+68>>2]=v;if(v){v=k+13044|0;a[v>>0]=(_c(j,4)|0)+1;a[k+13045>>0]=(_c(j,4)|0)+1;w=(dd(j)|0)+3|0;c[k+13048>>2]=w;c[k+13052>>2]=w+(dd(j)|0);if((d[v>>0]|0|0)>(c[l>>2]|0)){m=-1094995529;break}a[k+13056>>0]=bd(j)|0}c[k+2184>>2]=0;a[k+12942>>0]=0;a[k+13060>>0]=0;a[k+13061>>0]=bd(j)|0;c[k+160>>2]=0;c[k+164>>2]=1;if((bd(j)|0)!=0?(w=bd(j)|0,ad(j,7),(w|0)!=0):0){c[k+13096>>2]=bd(j)|0;c[k+13100>>2]=bd(j)|0;c[k+13104>>2]=bd(j)|0;c[k+13108>>2]=bd(j)|0;bd(j)|0;c[k+13112>>2]=bd(j)|0;bd(j)|0;c[k+13116>>2]=bd(j)|0;bd(j)|0}j=c[o>>2]|0;c[k+12>>2]=j;o=c[n>>2]|0;c[k+16>>2]=o;u=c[u>>2]|0;w=(c[t>>2]|0)+u|0;c[k+13080>>2]=w;t=u+ -1|0;c[k+13084>>2]=t;n=1<>w;c[k+13128>>2]=v;n=o+ -1+n>>w;c[k+13132>>2]=n;c[k+13136>>2]=$(n,v)|0;c[k+13140>>2]=j>>u;c[k+13144>>2]=o>>u;v=c[s>>2]|0;c[k+13148>>2]=j>>v;c[k+13152>>2]=o>>v;c[k+13156>>2]=j>>t;c[k+13160>>2]=o>>t;v=w-v|0;c[k+13164>>2]=(1<>2]=((c[l>>2]|0)*6|0)+ -48;u=(1<>>0>6):0)?(c[q>>2]|0)>>>0<=v>>>0:0)?(c[p>>2]|0)>>>0<=v>>>0:0)?(c[r>>2]|0)>>>0<=(w>>>0>5?5:w)>>>0:0)?((c[h+216>>2]|0)-(c[h+212>>2]|0)|0)>=0:0){h=b+272|0;j=c[h>>2]|0;if((j|0)!=0?(w=c[e>>2]|0,(Xd(c[j+4>>2]|0,c[w+4>>2]|0,c[w+8>>2]|0)|0)==0):0){vd(e);w=0;i=f;return w|0}else j=0;do{k=b+(j<<2)+400|0;l=c[k>>2]|0;do if(l){if(c[c[l+4>>2]>>2]|0)break;vd(k)}while(0);j=j+1|0}while((j|0)!=256);j=c[h>>2]|0;do if((j|0)!=0?(g=b+200|0,(c[g>>2]|0)==(c[j+4>>2]|0)):0){v=b+1424|0;vd(v);w=ud(c[h>>2]|0)|0;c[v>>2]=w;if(w)break;c[g>>2]=0}while(0);vd(h);c[h>>2]=c[e>>2];w=0;i=f;return w|0}}else m=-1094995529}else m=-22}}else m=-1094995529;while(0);vd(e);w=m;i=f;return w|0}function Ec(b){b=b|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,E=0,F=0,G=0,H=0,I=0;f=i;i=i+16|0;e=f+4|0;j=f;l=b+136|0;g=c[l>>2]|0;n=g+204|0;h=md(1692)|0;c[j>>2]=h;if(!h){I=-12;i=f;return I|0}I=qd(h,1692,6,0,0)|0;c[e>>2]=I;if(!I){jd(j);I=-12;i=f;return I|0}a[(c[j>>2]|0)+53>>0]=1;h=c[j>>2]|0;c[h+44>>2]=1;c[h+48>>2]=1;a[h+52>>0]=1;a[(c[j>>2]|0)+57>>0]=0;h=c[j>>2]|0;c[h+60>>2]=0;c[h+64>>2]=0;a[h+1629>>0]=2;h=dd(n)|0;a:do if((h>>>0<=255?(k=dd(n)|0,c[c[j>>2]>>2]=k,k>>>0<=31):0)?(m=c[b+(k<<2)+272>>2]|0,(m|0)!=0):0){k=c[m+4>>2]|0;I=(bd(n)|0)&255;a[(c[j>>2]|0)+41>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+39>>0]=I;I=_c(n,3)|0;c[(c[j>>2]|0)+1624>>2]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+4>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+5>>0]=I;I=(dd(n)|0)+1|0;c[(c[j>>2]|0)+8>>2]=I;I=(dd(n)|0)+1|0;c[(c[j>>2]|0)+12>>2]=I;I=ed(n)|0;c[(c[j>>2]|0)+16>>2]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+20>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+21>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+22>>0]=I;I=c[j>>2]|0;c[I+24>>2]=0;if(a[I+22>>0]|0){I=dd(n)|0;c[(c[j>>2]|0)+24>>2]=I}I=ed(n)|0;c[(c[j>>2]|0)+28>>2]=I;if((I+12|0)>>>0<=24?(I=ed(n)|0,c[(c[j>>2]|0)+32>>2]=I,(I+12|0)>>>0<=24):0){I=(bd(n)|0)&255;a[(c[j>>2]|0)+36>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+37>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+38>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+40>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+42>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+43>>0]=I;if(a[(c[j>>2]|0)+42>>0]|0){m=(dd(n)|0)+1|0;c[(c[j>>2]|0)+44>>2]=m;m=(dd(n)|0)+1|0;o=c[j>>2]|0;c[o+48>>2]=m;o=c[o+44>>2]|0;if(!o){b=-1094995529;break}if((m|0)==0?1:(o|0)>=(c[k+13120>>2]|0)){b=-1094995529;break}if((m|0)>=(c[k+13124>>2]|0)){b=-1094995529;break}m=od(o,4)|0;c[(c[j>>2]|0)+1648>>2]=m;m=od(c[(c[j>>2]|0)+48>>2]|0,4)|0;c[(c[j>>2]|0)+1652>>2]=m;m=c[j>>2]|0;if(!(c[m+1648>>2]|0)){b=-12;break}if(!(c[m+1652>>2]|0)){b=-12;break}p=(bd(n)|0)&255;a[(c[j>>2]|0)+52>>0]=p;p=c[j>>2]|0;if(!(a[p+52>>0]|0)){q=(c[p+44>>2]|0)+ -1|0;if((q|0)>0){o=0;m=0;r=0;do{q=(dd(n)|0)+1|0;p=c[j>>2]|0;c[(c[p+1648>>2]|0)+(r<<2)>>2]=q;o=$d(q|0,0,o|0,m|0)|0;m=D;r=r+1|0;q=(c[p+44>>2]|0)+ -1|0}while((r|0)<(q|0))}else{m=0;o=0}r=c[k+13128>>2]|0;s=((r|0)<0)<<31>>31;if(!(m>>>0>>0|(m|0)==(s|0)&o>>>0>>0)){b=-1094995529;break}I=_d(r|0,s|0,o|0,m|0)|0;c[(c[p+1648>>2]|0)+(q<<2)>>2]=I;q=(c[p+48>>2]|0)+ -1|0;if((q|0)>0){p=0;o=0;r=0;do{q=(dd(n)|0)+1|0;m=c[j>>2]|0;c[(c[m+1652>>2]|0)+(r<<2)>>2]=q;p=$d(q|0,0,p|0,o|0)|0;o=D;r=r+1|0;q=(c[m+48>>2]|0)+ -1|0}while((r|0)<(q|0))}else{m=p;o=0;p=0}r=c[k+13132>>2]|0;s=((r|0)<0)<<31>>31;if(!(o>>>0>>0|(o|0)==(s|0)&p>>>0>>0)){b=-1094995529;break}I=_d(r|0,s|0,p|0,o|0)|0;c[(c[m+1652>>2]|0)+(q<<2)>>2]=I}I=(bd(n)|0)&255;a[(c[j>>2]|0)+53>>0]=I}I=(bd(n)|0)&255;a[(c[j>>2]|0)+54>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+55>>0]=I;if((a[(c[j>>2]|0)+55>>0]|0)!=0?(I=(bd(n)|0)&255,a[(c[j>>2]|0)+56>>0]=I,I=(bd(n)|0)&255,a[(c[j>>2]|0)+57>>0]=I,(a[(c[j>>2]|0)+57>>0]|0)==0):0){m=(ed(n)|0)<<1;c[(c[j>>2]|0)+60>>2]=m;m=(ed(n)|0)<<1;I=c[j>>2]|0;c[I+64>>2]=m;if(((c[I+60>>2]|0)+13|0)>>>0>26){b=-1094995529;break}if((m+13|0)>>>0>26){b=-1094995529;break}}p=(bd(n)|0)&255;a[(c[j>>2]|0)+68>>0]=p;p=c[j>>2]|0;if(a[p+68>>0]|0){q=0;do{o=p+(q<<6)+69|0;m=o+16|0;do{a[o>>0]=16;o=o+1|0}while((o|0)<(m|0));a[p+q+1605>>0]=16;a[p+q+1611>>0]=16;q=q+1|0}while((q|0)!=6);o=p+453|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+517|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+581|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+645|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+709|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+773|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+837|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+901|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+965|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1029|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1093|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1157|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1221|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1285|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1349|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1413|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1477|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1541|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));m=c[j>>2]|0;v=(c[l>>2]|0)+204|0;w=0;do{p=(w|0)>0?64:16;q=(w|0)>1;o=w+ -2|0;x=(w|0)==3?3:1;r=1<<(w<<1)+4;t=(r|0)>0;s=(w|0)==0;r=(r|0)<64?r:64;u=0;do{if(!(((bd(v)|0)&255)<<24>>24)){y=dd(v)|0;if(y){if(u>>>0>>0){b=-1094995529;break a}y=u-y|0;ee(m+(w*384|0)+(u<<6)+69|0,m+(w*384|0)+(y<<6)+69|0,p|0)|0;if(q)a[m+(o*6|0)+u+1605>>0]=a[m+(o*6|0)+y+1605>>0]|0}}else{if(q){z=(ed(v)|0)+8|0;a[m+(o*6|0)+u+1605>>0]=z}else z=8;if(t){y=0;do{if(s)A=(d[24+y>>0]<<2)+(d[8+y>>0]|0)|0;else A=(d[104+y>>0]<<3)+(d[40+y>>0]|0)|0;z=(z+256+(ed(v)|0)|0)%256|0;a[m+(w*384|0)+(u<<6)+A+69>>0]=z;y=y+1|0}while((y|0)!=(r|0))}}u=u+x|0}while((u|0)<6);w=w+1|0}while((w|0)<4);if((c[k+4>>2]|0)==3){o=0;do{a[m+o+1285>>0]=a[m+o+901>>0]|0;a[m+o+1349>>0]=a[m+o+965>>0]|0;a[m+o+1477>>0]=a[m+o+1093>>0]|0;a[m+o+1541>>0]=a[m+o+1157>>0]|0;o=o+1|0}while((o|0)!=64);a[m+1612>>0]=a[m+1606>>0]|0;a[m+1613>>0]=a[m+1607>>0]|0;a[m+1615>>0]=a[m+1609>>0]|0;a[m+1616>>0]=a[m+1610>>0]|0}}I=(bd(n)|0)&255;a[(c[j>>2]|0)+1617>>0]=I;I=(dd(n)|0)+2|0;c[(c[j>>2]|0)+1620>>2]=I;m=k+13080|0;if(I>>>0<=(c[m>>2]|0)>>>0){I=(bd(n)|0)&255;a[(c[j>>2]|0)+1628>>0]=I;do if((bd(n)|0)!=0?(I=bd(n)|0,_c(n,7)|0,(I|0)!=0):0){n=c[j>>2]|0;p=(c[l>>2]|0)+204|0;if(a[n+21>>0]|0)a[n+1629>>0]=(dd(p)|0)+2;a[n+1630>>0]=bd(p)|0;I=(bd(p)|0)&255;a[n+1631>>0]=I;if(I<<24>>24){a[n+1632>>0]=dd(p)|0;I=dd(p)|0;o=n+1633|0;a[o>>0]=I;if((I&255)>>>0<5)l=0;else break;while(1){a[n+l+1634>>0]=ed(p)|0;a[n+l+1639>>0]=ed(p)|0;if((l|0)<(d[o>>0]|0))l=l+1|0;else break}}a[n+1644>>0]=dd(p)|0;a[n+1645>>0]=dd(p)|0}while(0);l=od((c[(c[j>>2]|0)+44>>2]|0)+1|0,4)|0;c[(c[j>>2]|0)+1656>>2]=l;l=od((c[(c[j>>2]|0)+48>>2]|0)+1|0,4)|0;c[(c[j>>2]|0)+1660>>2]=l;l=k+13128|0;o=od(c[l>>2]|0,4)|0;c[(c[j>>2]|0)+1664>>2]=o;o=c[j>>2]|0;n=c[o+1656>>2]|0;if(((n|0)!=0?(c[o+1660>>2]|0)!=0:0)?(c[o+1664>>2]|0)!=0:0){if(a[o+52>>0]|0){p=c[o+1648>>2]|0;if(!p){o=od(c[o+44>>2]|0,4)|0;c[(c[j>>2]|0)+1648>>2]=o;o=od(c[(c[j>>2]|0)+48>>2]|0,4)|0;c[(c[j>>2]|0)+1652>>2]=o;o=c[j>>2]|0;p=c[o+1648>>2]|0;if(!p){b=-12;break}}n=c[o+1652>>2]|0;if(!n){b=-12;break}q=o+44|0;s=c[q>>2]|0;if((s|0)>0){r=0;do{I=r;r=r+1|0;H=c[l>>2]|0;c[p+(I<<2)>>2]=(($(H,r)|0)/(s|0)|0)-(($(H,I)|0)/(s|0)|0);s=c[q>>2]|0}while((r|0)<(s|0))}q=o+48|0;s=c[q>>2]|0;if((s|0)>0){p=k+13132|0;r=0;do{I=r;r=r+1|0;H=c[p>>2]|0;c[n+(I<<2)>>2]=(($(H,r)|0)/(s|0)|0)-(($(H,I)|0)/(s|0)|0);s=c[q>>2]|0}while((r|0)<(s|0))}n=c[o+1656>>2]|0}c[n>>2]=0;q=o+44|0;if((c[q>>2]|0)>0){p=c[o+1648>>2]|0;r=0;s=0;do{r=(c[p+(s<<2)>>2]|0)+r|0;s=s+1|0;c[n+(s<<2)>>2]=r}while((s|0)<(c[q>>2]|0))}s=c[o+1660>>2]|0;c[s>>2]=0;r=o+48|0;if((c[r>>2]|0)>0){q=c[o+1652>>2]|0;t=0;p=0;do{t=(c[q+(p<<2)>>2]|0)+t|0;p=p+1|0;c[s+(p<<2)>>2]=t}while((p|0)<(c[r>>2]|0))}r=c[l>>2]|0;if((r|0)>0){o=c[o+1664>>2]|0;p=0;q=0;do{q=(p>>>0>(c[n+(q<<2)>>2]|0)>>>0&1)+q|0;c[o+(p<<2)>>2]=q;p=p+1|0;r=c[l>>2]|0}while((p|0)<(r|0))}x=$(c[k+13132>>2]|0,r)|0;n=od(x,4)|0;c[(c[j>>2]|0)+1668>>2]=n;n=od(x,4)|0;c[(c[j>>2]|0)+1672>>2]=n;n=od(x,4)|0;c[(c[j>>2]|0)+1676>>2]=n;n=k+13164|0;q=(c[n>>2]|0)+2|0;q=od($(q,q)|0,4)|0;c[(c[j>>2]|0)+1688>>2]=q;q=c[j>>2]|0;p=c[q+1668>>2]|0;if(!p){b=-12;break}w=c[q+1672>>2]|0;if(!w){b=-12;break}o=c[q+1676>>2]|0;if(!o){b=-12;break}if(!(c[q+1688>>2]|0)){b=-12;break}if((x|0)>0){B=q+44|0;r=q+48|0;s=c[q+1660>>2]|0;v=c[q+1648>>2]|0;u=c[q+1656>>2]|0;t=q+1652|0;A=0;do{C=c[l>>2]|0;y=(A|0)%(C|0)|0;z=(A|0)/(C|0)|0;G=c[B>>2]|0;E=0;while(1){if((E|0)>=(G|0)){E=0;break}F=E+1|0;if(y>>>0<(c[u+(F<<2)>>2]|0)>>>0)break;else E=F}H=c[r>>2]|0;F=0;while(1){if((F|0)>=(H|0)){F=0;break}G=F+1|0;if(z>>>0<(c[s+(G<<2)>>2]|0)>>>0)break;else F=G}if((E|0)>0){G=c[(c[t>>2]|0)+(F<<2)>>2]|0;H=0;I=0;do{I=($(c[v+(H<<2)>>2]|0,G)|0)+I|0;H=H+1|0}while((H|0)!=(E|0))}else I=0;if((F|0)>0){G=c[t>>2]|0;H=0;do{I=($(c[G+(H<<2)>>2]|0,C)|0)+I|0;H=H+1|0}while((H|0)!=(F|0))}H=$(c[v+(E<<2)>>2]|0,z-(c[s+(F<<2)>>2]|0)|0)|0;I=I+y+H-(c[u+(E<<2)>>2]|0)|0;c[p+(A<<2)>>2]=I;c[w+(I<<2)>>2]=A;A=A+1|0}while((A|0)!=(x|0))}else r=q+48|0;x=c[r>>2]|0;if((x|0)>0){s=q+44|0;t=q+1660|0;q=q+1656|0;z=c[s>>2]|0;u=0;w=0;while(1){v=u;u=u+1|0;if((z|0)>0){x=c[t>>2]|0;y=x+(u<<2)|0;G=c[y>>2]|0;B=z;z=0;do{E=c[x+(v<<2)>>2]|0;A=z;z=z+1|0;if(E>>>0>>0){B=c[q>>2]|0;C=B+(z<<2)|0;F=c[C>>2]|0;do{H=c[B+(A<<2)>>2]|0;if(H>>>0>>0){do{c[o+(c[p+(($(c[l>>2]|0,E)|0)+H<<2)>>2]<<2)>>2]=w;H=H+1|0;F=c[C>>2]|0}while(H>>>0>>0);G=c[y>>2]|0}E=E+1|0}while(E>>>0>>0);B=c[s>>2]|0}w=w+1|0}while((z|0)<(B|0));v=c[r>>2]|0;z=B}else v=x;if((u|0)>=(v|0))break;else x=v}}else w=0;o=od(w,4)|0;c[(c[j>>2]|0)+1680>>2]=o;o=c[j>>2]|0;p=c[o+1680>>2]|0;if(!p){b=-12;break}r=o+48|0;u=c[r>>2]|0;if((u|0)>0){q=o+44|0;t=c[q>>2]|0;s=0;do{if((t|0)>0){u=c[o+1660>>2]|0;v=c[o+1656>>2]|0;w=0;do{I=$(c[l>>2]|0,c[u+(s<<2)>>2]|0)|0;c[p+(($(t,s)|0)+w<<2)>>2]=(c[v+(w<<2)>>2]|0)+I;w=w+1|0;t=c[q>>2]|0}while((w|0)<(t|0));u=c[r>>2]|0}s=s+1|0}while((s|0)<(u|0))}k=(c[m>>2]|0)-(c[k+13072>>2]|0)|0;v=c[n>>2]|0;c[o+1684>>2]=(c[o+1688>>2]|0)+(v+3<<2);p=v+2|0;if((p|0)>0){m=c[(c[j>>2]|0)+1688>>2]|0;o=0;do{c[m+(($(p,o)|0)<<2)>>2]=-1;c[m+(o<<2)>>2]=-1;o=o+1|0;v=c[n>>2]|0;p=v+2|0}while((o|0)<(p|0))}if((v|0)>-1){m=c[j>>2]|0;j=m+1668|0;p=k<<1;o=(k|0)>0;m=m+1684|0;q=0;while(1){if((v|0)>-1){r=q>>k;t=c[j>>2]|0;s=c[m>>2]|0;u=0;while(1){z=c[t+(($(c[l>>2]|0,r)|0)+(u>>k)<<2)>>2]<>2]=z;v=c[n>>2]|0;if((u|0)<(v|0))u=u+1|0;else break}}if((q|0)<(v|0))q=q+1|0;else break}}if(((c[g+216>>2]|0)-(c[g+212>>2]|0)|0)<0){b=0;break}I=b+(h<<2)+400|0;vd(I);c[I>>2]=c[e>>2];I=0;i=f;return I|0}else b=-12}else b=-1094995529}else b=-1094995529}else b=-1094995529;while(0);vd(e);I=b;i=f;return I|0}function Fc(a,b){a=a|0;b=b|0;var d=0;a=i;i=i+16|0;d=a;c[d>>2]=b;jd(b+1648|0);jd(b+1652|0);jd(b+1656|0);jd(b+1660|0);jd(b+1664|0);jd(b+1668|0);jd(b+1672|0);jd(b+1680|0);jd(b+1676|0);jd(b+1688|0);jd(d);i=a;return}function Gc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0;b=i;d=a+136|0;e=a+2512|0;while(1){f=(c[d>>2]|0)+204|0;g=0;do{h=_c(f,8)|0;g=h+g|0}while((h|0)==255);h=0;do{j=_c(f,8)|0;h=j+h|0}while((j|0)==255);do if((c[e>>2]|0)==39)if((g|0)==256){Hc(a);break}else{ad(f,h<<3);break}else if((g|0)==132){Hc(a);break}else{ad(f,h<<3);break}while(0);f=c[d>>2]|0;if(((c[f+216>>2]|0)-(c[f+212>>2]|0)|0)<=0){a=14;break}if(($c(f+204|0,8)|0)==128){a=14;break}}if((a|0)==14){i=b;return 1}return 0}function Hc(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;e=(c[b+136>>2]|0)+204|0;g=(_c(e,8)|0)&255;f=b+4468|0;h=0;do{if((g|0)==1)ad(e,16);else if(!g){a[f>>0]=1;j=0;do{a[b+(h<<4)+j+4420>>0]=_c(e,8)|0;j=j+1|0}while((j|0)!=16)}else if((g|0)==2)ad(e,32);h=h+1|0}while((h|0)!=3);i=d;return}function Ic(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;d=i;f=c[b+52>>2]|0;e=a+60|0;if((f|0)>0){if((c[e>>2]|0)==0?(f=md(f)|0,c[e>>2]=f,(f|0)==0):0){f=-12;i=d;return f|0}}else c[e>>2]=0;f=a+12|0;c[f>>2]=b;c[a+424>>2]=0;c[a+800>>2]=1;h=a+912|0;g=a+936|0;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[g>>2]=0;c[g+4>>2]=-2147483648;g=a+928|0;c[g>>2]=0;c[g+4>>2]=-2147483648;a=Ea[c[b+76>>2]&3](a)|0;if((a|0)>=0){h=0;i=d;return h|0}jd(e);c[f>>2]=0;h=a;i=d;return h|0}function Jc(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;if(!a){i=b;return 0}e=a+12|0;f=c[e>>2]|0;if((f|0)!=0?(d=c[f+92>>2]|0,(d|0)!=0):0)Ea[d&3](a)|0;c[a+796>>2]=0;jd(a+60|0);c[e>>2]=0;c[a+808>>2]=0;i=b;return 0}function Kc(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;if((f|0)<=0){i=h;return 0}j=(e|0)==0;k=0;do{l=d+($(k,g)|0)|0;l=Ia[b&1](a,l)|0;if(!j)c[e+(k<<2)>>2]=l;k=k+1|0}while((k|0)!=(f|0));i=h;return 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;g=i;if((f|0)<=0){i=g;return 0}h=(e|0)==0;j=0;do{k=Ga[b&1](a,d,j,0)|0;if(!h)c[e+(j<<2)>>2]=k;j=j+1|0}while((j|0)!=(f|0));i=g;return 0}function Mc(b,f,g){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;g=i;h=Bd(c[f+76>>2]|0)|0;b=h+4|0;if(!(a[b>>0]|0)){p=0;i=g;return p|0}k=f+64|0;l=h+5|0;m=f+68|0;n=h+6|0;j=0;while(1){p=($((((e[h+(j<<1)+8>>1]|0)>>>11&15)+8|0)>>>3,c[k>>2]|0)|0)+31&-32;if((j+ -1|0)>>>0<2){p=0-(0-p>>d[l>>0])|0;c[f+(j<<2)+32>>2]=p;o=0-(0-((c[m>>2]|0)+31&-32)>>d[n>>0])|0}else{c[f+(j<<2)+32>>2]=p;o=(c[m>>2]|0)+31&-32}o=sd(($(p,o)|0)+32|0)|0;c[f+(j<<2)+304>>2]=o;if(!o){b=-1;f=8;break}c[f+(j<<2)>>2]=c[o+4>>2];j=j+1|0;if((j|0)>=(d[b>>0]|0)){b=0;f=8;break}}if((f|0)==8){i=g;return b|0}return 0}function Nc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;be(a|0,0,976)|0;e=(b|0)!=0;if(e){c[a+8>>2]=c[b+8>>2];c[a+48>>2]=c[b+12>>2]}else c[a+8>>2]=-1;c[a+100>>2]=0;c[a+104>>2]=1;c[a+888>>2]=0;c[a+892>>2]=1;c[a+896>>2]=0;c[a+900>>2]=1;c[a+476>>2]=1;c[a+816>>2]=1;c[a+820>>2]=1;c[a+220>>2]=0;c[a+224>>2]=1;c[a+136>>2]=-1;c[a+416>>2]=-1;g=a+696|0;c[g>>2]=0;c[g+4>>2]=-2147483648;if((e?(f=c[b+52>>2]|0,(f|0)!=0):0)?(g=md(f)|0,c[a+60>>2]=g,(g|0)==0):0){g=-12;i=d;return g|0}g=0;i=d;return g|0}function Oc(a){a=a|0;var b=0,c=0;b=i;c=fd(976)|0;if(c){if((Nc(c,a)|0)<0){id(c);c=0}}else c=0;i=b;return c|0}function Pc(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+80|0;g=f;k=g+0|0;j=e+0|0;h=k+80|0;do{c[k>>2]=c[j>>2];k=k+4|0;j=j+4|0}while((k|0)<(h|0));h=a+12|0;j=c[h>>2]|0;if(!j){k=-22;i=f;return k|0}if(c[j+8>>2]|0){k=-22;i=f;return k|0}c[d>>2]=0;j=c[a+124>>2]|0;k=c[a+128>>2]|0;if(!j){if(k){k=-22;i=f;return k|0}}else{if(!((j|0)>0&(k|0)>0)){k=-22;i=f;return k|0}if((j+128|0)>>>0>=(268435455/((k+128|0)>>>0)|0)>>>0){k=-22;i=f;return k|0}}yd(b);h=c[h>>2]|0;if(((c[h+16>>2]&32|0)==0?(c[e+28>>2]|0)==0:0)?(c[a+808>>2]&1|0)==0:0){k=0;i=f;return k|0}g=Ga[c[h+88>>2]&1](a,b,d,g)|0;if(!(c[d>>2]|0)){yd(b);k=g;i=f;return k|0}else{k=a+424|0;c[k>>2]=(c[k>>2]|0)+1;k=g;i=f;return k|0}return 0}function Qc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=i;if((a|0)>0&(b|0)>0?(a+128|0)>>>0<(268435455/((b+128|0)>>>0)|0)>>>0:0){d=0;i=c;return d|0}d=-22;i=c;return d|0}function Rc(a,b){a=a|0;b=b|0;return 0}function Sc(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;f=i;e=a+8|0;if(!(c[e>>2]|0)){g=c[a+116>>2]|0;h=a+120|0;j=c[h>>2]|0;if(!((g|0)>0&(j|0)>0)){l=-22;i=f;return l|0}if((g+128|0)>>>0>=(268435455/((j+128|0)>>>0)|0)>>>0){l=-22;i=f;return l|0}j=c[a+136>>2]|0;if((j|0)<0){l=-22;i=f;return l|0}k=b+64|0;l=b+68|0;if((c[k>>2]|0)>=1?(c[l>>2]|0)>=1:0)g=1;else{m=a+792|0;n=0-(0-(c[a+124>>2]|0)>>c[m>>2])|0;c[k>>2]=(g|0)>(n|0)?g:n;k=c[h>>2]|0;g=0-(0-(c[a+128>>2]|0)>>c[m>>2])|0;c[l>>2]=(k|0)>(g|0)?k:g;g=0}c[b+76>>2]=j}else g=1;d=xa[c[a+476>>2]&1](a,b,d)|0;if(c[e>>2]|g){n=d;i=f;return n|0}c[b+64>>2]=c[a+116>>2];c[b+68>>2]=c[a+120>>2];n=d;i=f;return n|0}function Tc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=i;c[b+4>>2]=a;a=Sc(a,c[b>>2]|0,d)|0;i=e;return a|0}function Uc(a,b){a=a|0;b=b|0;a=i;b=c[b>>2]|0;if(b)yd(b);i=a;return}function Vc(a){a=a|0;return}function Wc(a,b,c){a=a|0;b=b|0;c=c|0;return}function Xc(a){a=a|0;var b=0,d=0;b=i;d=a+8|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+16|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+64|0;c[d>>2]=-1;c[d+4>>2]=-1;d=a+72|0;c[d>>2]=0;c[d+4>>2]=0;d=a+32|0;c[a>>2]=0;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;i=b;return}function Yc(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;g=a+16|0;c[a+12>>2]=b;c[a+20>>2]=b+e;h=b+1|0;c[g>>2]=h;e=(d[b>>0]|0)<<18;c[a>>2]=e;f=b+2|0;c[g>>2]=f;e=(d[h>>0]|0)<<10|e;c[a>>2]=e;c[g>>2]=b+3;c[a>>2]=(d[f>>0]|0)<<2|e|2;c[a+4>>2]=510;return}function Zc(){var b=0,e=0,f=0,g=0,h=0,j=0;b=i;if(!(c[718]|0))e=0;else{i=b;return}while(1)if(e){g=(e&65280|0)==0;a[2880+e>>0]=(g?8:0)-(d[4680+(g?e:e>>>8)>>0]|0);e=e+1|0;if((e|0)==512){e=0;break}else continue}else{a[2880]=9;e=1;continue}while(1){f=e<<1;g=0;do{j=a[4224+(e<<2)+g>>0]|0;h=(g<<7)+f|0;a[(h|1)+3392>>0]=j;a[h+3392>>0]=j;g=g+1|0}while((g|0)!=4);j=(d[4480+e>>0]|0)<<1;a[f+4032>>0]=j;a[f+4033>>0]=j|1;if(e){h=(d[4544+e>>0]|0)<<1;j=128-f|0;a[j+3903>>0]=h;a[j+3902>>0]=h|1;e=e+1|0;if((e|0)==64)break;else continue}else{e=128-f|0;a[e+3903>>0]=1;a[e+3902>>0]=0;e=1;continue}}g=4160|0;f=4608|0;e=g+63|0;do{a[g>>0]=a[f>>0]|0;g=g+1|0;f=f+1|0}while((g|0)<(e|0));c[718]=1;i=b;return}function _c(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0;e=i;f=a+8|0;h=c[f>>2]|0;g=c[a+16>>2]|0;a=(c[a>>2]|0)+(h>>>3)|0;a=(de(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(h&7)>>>(32-b|0);b=h+b|0;c[f>>2]=g>>>0>b>>>0?b:g;i=e;return a|0}function $c(a,b){a=a|0;b=b|0;var e=0,f=0;e=i;f=c[a+8>>2]|0;a=(c[a>>2]|0)+(f>>>3)|0;a=(de(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(f&7)>>>(32-b|0);i=e;return a|0}function ad(a,b){a=a|0;b=b|0;var d=0;d=a+8|0;a=c[a+16>>2]|0;b=(c[d>>2]|0)+b|0;c[d>>2]=a>>>0>b>>>0?b:a;return}function bd(a){a=a|0;var b=0,e=0,f=0;e=a+8|0;f=c[e>>2]|0;b=(d[(c[a>>2]|0)+(f>>>3)>>0]|0)<<(f&7)>>>7&1;c[e>>2]=((f|0)<(c[a+16>>2]|0)&1)+f;return b|0}function cd(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;if(!b){j=0;i=e;return j|0}f=a+8|0;h=c[f>>2]|0;g=c[a+16>>2]|0;j=c[a>>2]|0;a=j+(h>>>3)|0;a=(de(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(h&7);if((b|0)<26){j=h+b|0;c[f>>2]=g>>>0>j>>>0?j:g;j=a>>>(32-b|0);i=e;return j|0}else{k=h+16|0;k=g>>>0>k>>>0?k:g;c[f>>2]=k;h=b+ -16|0;j=j+(k>>>3)|0;j=(de(d[j>>0]|d[j+1>>0]<<8|d[j+2>>0]<<16|d[j+3>>0]<<24|0)|0)<<(k&7)>>>(48-b|0);b=k+h|0;c[f>>2]=g>>>0>b>>>0?b:g;j=j|a>>>16<>2]=c[a+0>>2];c[e+4>>2]=c[a+4>>2];c[e+8>>2]=c[a+8>>2];c[e+12>>2]=c[a+12>>2];c[e+16>>2]=c[a+16>>2];e=cd(e,32)|0;f=e>>>0>65535;e=f?e>>>16:e;f=f?16:0;if(e&65280){f=f|8;e=e>>>8}j=31-f-(d[4680+e>>0]|0)|0;g=a+8|0;f=c[g>>2]|0;e=0-f|0;h=(c[a+16>>2]|0)-f|0;if((j|0)<(e|0)){h=e;h=h+f|0;c[g>>2]=h;j=j+1|0;j=cd(a,j)|0;j=j+ -1|0;i=b;return j|0}h=(h|0)<(j|0)?h:j;h=h+f|0;c[g>>2]=h;j=j+1|0;j=cd(a,j)|0;j=j+ -1|0;i=b;return j|0}function ed(a){a=a|0;var b=0;b=i;a=dd(a)|0;if(!(a&1)){a=0-(a>>>1)|0;i=b;return a|0}else{a=(a+1|0)>>>1;i=b;return a|0}return 0}function fd(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[1168]|0;if((d+ -32|0)>>>0>=a>>>0){e=Ud(a)|0;if((e|0)==0&(a|0)==0)if((d|0)==32)e=0;else e=Ud(1)|0}else e=0;i=b;return e|0}function gd(a,b){a=a|0;b=b|0;var d=0;d=i;if(((c[1168]|0)+ -32|0)>>>0>>0){b=0;i=d;return b|0}b=Wd(a,((b|0)==0&1)+b|0)|0;i=d;return b|0}function hd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;f=$(d,b)|0;if((d|b)>>>0>65535&(d|0)!=0?((f>>>0)/(d>>>0)|0|0)!=(b|0):0){Vd(a);d=0;i=e;return d|0}if(((c[1168]|0)+ -32|0)>>>0>>0)b=0;else b=Wd(a,((f|0)==0&1)+f|0)|0;if((b|0)!=0|(f|0)==0){d=b;i=e;return d|0}Vd(a);d=0;i=e;return d|0}function id(a){a=a|0;var b=0;b=i;Vd(a);i=b;return}function jd(a){a=a|0;var b=0;b=i;Vd(c[a>>2]|0);c[a>>2]=0;i=b;return}function kd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if(((d|0)!=0?(2147483647/(d>>>0)|0)>>>0>b>>>0:0)?(f=$(d,b)|0,((c[1168]|0)+ -32|0)>>>0>=f>>>0):0)a=Wd(a,((f|0)==0&1)+f|0)|0;else a=0;i=e;return a|0}function ld(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=i;e=hd(c[a>>2]|0,b,d)|0;c[a>>2]=e;i=f;return((e|0)!=0|(b|0)==0|(d|0)==0?0:-12)|0}function md(a){a=a|0;var b=0,c=0;c=i;b=fd(a)|0;if(b)be(b|0,0,a|0)|0;i=c;return b|0}function nd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if((c[b>>2]|0)>>>0>d>>>0){i=e;return}f=((d*17|0)>>>4)+32|0;d=f>>>0>d>>>0?f:d;Vd(c[a>>2]|0);f=fd(d)|0;c[a>>2]=f;c[b>>2]=(f|0)==0?0:d;i=e;return}function od(a,b){a=a|0;b=b|0;var c=0;c=i;if((b|0)!=0?(2147483647/(b>>>0)|0)>>>0>a>>>0:0)b=fd($(b,a)|0)|0;else b=0;i=c;return b|0}function pd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=i;if(((b|0)!=0?(2147483647/(b>>>0)|0)>>>0>a>>>0:0)?(e=$(b,a)|0,d=fd(e)|0,(d|0)!=0):0)be(d|0,0,e|0)|0;else d=0;i=c;return d|0}function qd(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;g=i;i=i+16|0;h=g;j=md(24)|0;c[h>>2]=j;if(!j){f=0;i=g;return f|0}c[j>>2]=a;c[j+4>>2]=b;c[j+12>>2]=(d|0)!=0?d:7;c[j+16>>2]=e;c[j+8>>2]=1;if(f&1){f=(c[h>>2]|0)+20|0;c[f>>2]=c[f>>2]|1}j=md(12)|0;if(!j){jd(h);f=0;i=g;return f|0}else{c[j>>2]=c[h>>2];c[j+4>>2]=a;c[j+8>>2]=b;f=j;i=g;return f|0}return 0}function rd(a,b){a=a|0;b=b|0;a=i;id(b);i=a;return}function sd(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b;e=fd(a)|0;c[d>>2]=e;if(e){a=qd(e,a,7,0,0)|0;if(!a){jd(d);a=0}}else a=0;i=b;return a|0}function td(a){a=a|0;var b=0,d=0;b=i;d=sd(a)|0;if(!d){d=0;i=b;return d|0}be(c[d+4>>2]|0,0,a|0)|0;i=b;return d|0}function ud(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b;d=md(12)|0;if(!d){e=0;i=b;return e|0}c[d+0>>2]=c[a+0>>2];c[d+4>>2]=c[a+4>>2];c[d+8>>2]=c[a+8>>2];f=(c[a>>2]|0)+8|0;a=c[f>>2]|0;c[f>>2]=a+1;c[e>>2]=a+1;e=d;i=b;return e|0}function vd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+4|0;d=b;if(!a){i=b;return}f=c[a>>2]|0;if(!f){i=b;return}f=c[f>>2]|0;c[d>>2]=f;jd(a);a=f+8|0;f=c[a>>2]|0;c[a>>2]=f+ -1;c[e>>2]=f+ -1;if(c[e>>2]|0){i=b;return}f=c[d>>2]|0;Ca[c[f+12>>2]&7](c[f+16>>2]|0,c[f>>2]|0);jd(d);i=b;return}function wd(){var a=0,b=0,d=0;a=i;b=md(400)|0;if(!b){b=0;i=a;return b|0}be(b|0,0,400)|0;d=b+136|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+144|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+128|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+360|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+376|0;c[d>>2]=0;c[d+4>>2]=0;d=b+368|0;c[d>>2]=-1;c[d+4>>2]=-1;c[b+392>>2]=-1;c[b+80>>2]=1;c[b+120>>2]=0;c[b+124>>2]=1;c[b+76>>2]=-1;c[b+344>>2]=2;c[b+348>>2]=2;c[b+352>>2]=2;c[b+340>>2]=0;c[b+356>>2]=0;i=a;return b|0}function xd(a){a=a|0;var b=0,d=0;b=i;if((a|0)!=0?(d=c[a>>2]|0,(d|0)!=0):0){yd(d);jd(a)}i=b;return}function yd(a){a=a|0;var b=0,d=0;b=i;vd(a+304|0);vd(a+308|0);vd(a+312|0);vd(a+316|0);vd(a+320|0);vd(a+324|0);vd(a+328|0);vd(a+332|0);be(a|0,0,400)|0;d=a+136|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+144|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+128|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+360|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+376|0;c[d>>2]=0;c[d+4>>2]=0;d=a+368|0;c[d>>2]=-1;c[d+4>>2]=-1;c[a+392>>2]=-1;c[a+80>>2]=1;c[a+120>>2]=0;c[a+124>>2]=1;c[a+76>>2]=-1;c[a+344>>2]=2;c[a+348>>2]=2;c[a+352>>2]=2;c[a+340>>2]=0;c[a+356>>2]=0;i=b;return}function zd(a,b){a=a|0;b=b|0;var d=0;d=i;ee(a|0,b|0,400)|0;be(b|0,0,400)|0;a=b+136|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+144|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+128|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+360|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+376|0;c[a>>2]=0;c[a+4>>2]=0;a=b+368|0;c[a>>2]=-1;c[a+4>>2]=-1;c[b+392>>2]=-1;c[b+80>>2]=1;c[b+120>>2]=0;c[b+124>>2]=1;c[b+76>>2]=-1;c[b+344>>2]=2;c[b+348>>2]=2;c[b+352>>2]=2;c[b+340>>2]=0;c[b+356>>2]=0;i=d;return}function Ad(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;c[a+76>>2]=c[b+76>>2];c[a+64>>2]=c[b+64>>2];c[a+68>>2]=c[b+68>>2];c[a+388>>2]=c[b+388>>2];j=b+296|0;h=c[j+4>>2]|0;f=a+296|0;c[f>>2]=c[j>>2];c[f+4>>2]=h;c[a+72>>2]=c[b+72>>2];f=c[b+304>>2]|0;if(!f)ta();else{e=f;g=0}while(1){if((e|0)!=0?(j=ud(e)|0,c[a+(g<<2)+304>>2]=j,(j|0)==0):0){e=5;break}g=g+1|0;if(g>>>0>=8){e=8;break}e=c[b+(g<<2)+304>>2]|0}if((e|0)==5){yd(a);j=-12;i=d;return j|0}else if((e|0)==8){c[a+0>>2]=c[b+0>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];c[a+28>>2]=c[b+28>>2];j=a+32|0;h=b+32|0;c[j+0>>2]=c[h+0>>2];c[j+4>>2]=c[h+4>>2];c[j+8>>2]=c[h+8>>2];c[j+12>>2]=c[h+12>>2];c[j+16>>2]=c[h+16>>2];c[j+20>>2]=c[h+20>>2];c[j+24>>2]=c[h+24>>2];c[j+28>>2]=c[h+28>>2];j=0;i=d;return j|0}return 0}function Bd(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;e=0;while(1){f=e+1|0;if((c[4936+(e*24|0)>>2]|0)==(a|0))break;if(f>>>0<4)e=f;else{e=0;b=5;break}}if((b|0)==5){i=d;return e|0}f=4940+(e*24|0)|0;i=d;return f|0}function Cd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;g=(c[b+16>>2]|0)==0?1:3;if((g|0)>(e|0)){b=c[b>>2]|0;c[d>>2]=c[b+(e<<2)+32>>2];b=c[b+(e<<2)>>2]|0;i=f;return b|0}if((a[b+21>>0]|0)!=0&(g|0)==(e|0)){b=c[b+4>>2]|0;c[d>>2]=c[b+32>>2];b=c[b>>2]|0;i=f;return b|0}else{c[d>>2]=0;b=0;i=f;return b|0}return 0}function Dd(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=i;if(!(c[b>>2]|0)){h=-1;i=f;return h|0}c[e>>2]=c[b+8>>2];c[e+4>>2]=c[b+12>>2];c[e+8>>2]=c[b+16>>2];g=b+23|0;if(!(a[b+21>>0]|0))h=0;else h=(a[g>>0]|0)==0;c[e+12>>2]=h&1;c[e+24>>2]=d[b+25>>0];c[e+28>>2]=d[g>>0];c[e+32>>2]=d[b+24>>0];c[e+16>>2]=c[b+28>>2];c[e+20>>2]=d[b+22>>0];h=0;i=f;return h|0}function Ed(f,g){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;k=i;h=c[f+8>>2]|0;j=f+44|0;n=c[j>>2]|0;if(n>>>0>=(c[f+12>>2]|0)>>>0){s=-1;i=k;return s|0}o=(c[f+56>>2]|0)+($(c[f+72>>2]|0,n)|0)|0;l=f+40|0;m=(d[l>>0]|0)+3|0;p=c[f+16>>2]|0;if((p|0)==1){p=n>>1;q=(p|0)%8|0;t=n&1;s=f+88|0;w=f+160|0;v=f+22|0;u=f+20|0;Fd(c[s>>2]|0,f+96|0,h,q,c[w>>2]|0,d[v>>0]|0,t,d[u>>0]|0);r=f+92|0;Fd(c[r>>2]|0,f+128|0,h,q,c[w>>2]|0,d[v>>0]|0,t,d[u>>0]|0);if(t){u=(q+5|0)%8|0;t=p+5|0;v=c[f+52>>2]|0;v=(t|0)<(v|0)?t:v+ -1|0;t=(c[f+60>>2]|0)+($(v,c[f+76>>2]|0)|0)|0;v=(c[f+64>>2]|0)+($(c[f+80>>2]|0,v)|0)|0;w=f+48|0;ee(c[f+(u<<2)+96>>2]|0,t|0,c[w>>2]<<1|0)|0;ee(c[f+(u<<2)+128>>2]|0,v|0,c[w>>2]<<1|0)|0}za[c[f+212>>2]&7](f+164|0,g,o,c[s>>2]|0,c[r>>2]|0,h,m)}else if(!p)za[c[f+212>>2]&7](f+164|0,g,o,0,0,h,m);else if((p|0)==3){v=(c[f+60>>2]|0)+($(c[f+76>>2]|0,n)|0)|0;w=(c[f+64>>2]|0)+($(c[f+80>>2]|0,n)|0)|0;za[c[f+212>>2]&7](f+164|0,g,o,v,w,h,m)}else if((p|0)==2){w=(c[f+60>>2]|0)+($(c[f+76>>2]|0,n)|0)|0;r=(c[f+64>>2]|0)+($(c[f+80>>2]|0,n)|0)|0;v=f+88|0;s=f+22|0;t=f+20|0;u=f+160|0;Gd(c[v>>2]|0,w,h,d[s>>0]|0,d[t>>0]|0,c[u>>2]|0);w=f+92|0;Gd(c[w>>2]|0,r,h,d[s>>0]|0,d[t>>0]|0,c[u>>2]|0);za[c[f+212>>2]&7](f+164|0,g,o,c[v>>2]|0,c[w>>2]|0,h,m)}else{w=-1;i=k;return w|0}a:do if(!(a[f+23>>0]|0)){if(a[l>>0]|0){if(!(a[f+21>>0]|0)){if((h|0)<=0)break;g=g+3|0;f=0;while(1){a[g>>0]=-1;f=f+1|0;if((f|0)==(h|0))break a;else g=g+4|0}}l=(c[f+68>>2]|0)+($(c[f+84>>2]|0,n)|0)|0;p=g+3|0;if((c[f+204>>2]|0)==8){if((h|0)>0){m=0;while(1){a[p>>0]=b[l+(m<<1)>>1];m=m+1|0;if((m|0)==(h|0))break;else p=p+4|0}}}else{n=c[f+172>>2]|0;m=c[f+168>>2]|0;o=c[f+164>>2]|0;if((h|0)>0){q=0;while(1){a[p>>0]=($(e[l+(q<<1)>>1]|0,n)|0)+m>>o;q=q+1|0;if((q|0)==(h|0))break;else p=p+4|0}}}if(a[f+25>>0]|0){if(!(c[1264]|0)){c[1264]=1;f=1;do{c[5064+(f<<2)>>2]=(((f|0)/2|0)+16711808|0)/(f|0)|0;f=f+1|0}while((f|0)!=256)}if((h|0)>0){f=0;while(1){m=a[g+3>>0]|0;if(!(m<<24>>24)){a[g>>0]=-1;a[g+1>>0]=-1;a[g+2>>0]=-1}else{l=c[5064+((m&255)<<2)>>2]|0;n=a[g>>0]|0;if((n&255)<(m&255))n=(($(n&255,l)|0)+32768|0)>>>16&255;else n=-1;a[g>>0]=n;n=g+1|0;o=a[n>>0]|0;if((o&255)<(m&255))o=(($(o&255,l)|0)+32768|0)>>>16&255;else o=-1;a[n>>0]=o;n=g+2|0;o=a[n>>0]|0;if((o&255)<(m&255))l=(($(o&255,l)|0)+32768|0)>>>16&255;else l=-1;a[n>>0]=l}f=f+1|0;if((f|0)==(h|0))break;else g=g+4|0}}}}}else{n=(c[f+68>>2]|0)+($(c[f+84>>2]|0,n)|0)|0;q=c[f+204>>2]|0;p=1<0;if(o){f=g;r=0;while(1){v=e[n+(r<<1)>>1]|0;a[f>>0]=($(d[f>>0]|0,v)|0)+p>>q;w=f+1|0;a[w>>0]=($(d[w>>0]|0,v)|0)+p>>q;w=f+2|0;a[w>>0]=($(d[w>>0]|0,v)|0)+p>>q;r=r+1|0;if((r|0)==(h|0))break;else f=f+m|0}}if(!((a[l>>0]|0)==0|o^1)){g=g+3|0;f=0;while(1){a[g>>0]=-1;f=f+1|0;if((f|0)==(h|0))break;else g=g+4|0}}}while(0);c[j>>2]=(c[j>>2]|0)+1;w=0;i=k;return w|0}function Fd(a,d,f,g,h,j,k,l){a=a|0;d=d|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;o=c[d+((g+5&7)<<2)>>2]|0;s=c[d+((g+6&7)<<2)>>2]|0;p=c[d+((g+7&7)<<2)>>2]|0;r=c[d+((g&7)<<2)>>2]|0;q=c[d+((g+1&7)<<2)>>2]|0;n=c[d+((g+2&7)<<2)>>2]|0;d=c[d+((g+3&7)<<2)>>2]|0;t=j+ -8|0;u=1<>1;g=(f+1|0)/2|0;v=(f|0)>0;if(!k){if(v){k=0;do{x=$(e[s+(k<<1)>>1]|0,-6)|0;y=$(e[q+(k<<1)>>1]|0,-10)|0;b[h+(k+3<<1)>>1]=(e[o+(k<<1)>>1]<<1)+u+x+((e[p+(k<<1)>>1]|0)*18|0)+((e[r+(k<<1)>>1]|0)*57|0)+y+(e[n+(k<<1)>>1]<<2)-(e[d+(k<<1)>>1]|0)>>t;k=k+1|0}while((k|0)<(g|0))}}else if(v){k=0;do{x=$(e[p+(k<<1)>>1]|0,-10)|0;y=$(e[n+(k<<1)>>1]|0,-6)|0;b[h+(k+3<<1)>>1]=u-(e[o+(k<<1)>>1]|0)+(e[s+(k<<1)>>1]<<2)+x+((e[r+(k<<1)>>1]|0)*57|0)+((e[q+(k<<1)>>1]|0)*18|0)+y+(e[d+(k<<1)>>1]<<1)>>t;k=k+1|0}while((k|0)<(g|0))}n=h+6|0;y=b[n>>1]|0;b[h>>1]=y;p=h+2|0;b[p>>1]=y;o=h+4|0;b[o>>1]=y;y=b[h+(g+2<<1)>>1]|0;b[h+(g+3<<1)>>1]=y;b[h+(g+4<<1)>>1]=y;b[h+(g+5<<1)>>1]=y;b[h+(g+6<<1)>>1]=y;g=(1<>1;s=20-j|0;r=1<1){q=f+ -2|0;j=q>>>1;p=j<<1;d=a;while(1){t=(b[n>>1]|0)+l>>o;if((t|0)<0)t=0;else t=((t|0)>(g|0)?g:t)&65535;b[d>>1]=t;y=$((b[n+4>>1]|0)+(b[n+ -2>>1]|0)|0,-11)|0;t=n;n=n+2|0;t=r-(b[t+ -6>>1]|0)-(b[t+8>>1]|0)+((b[t+6>>1]|0)+(b[t+ -4>>1]|0)<<2)+y+(((b[n>>1]|0)+(b[t>>1]|0)|0)*40|0)>>s;if((t|0)<0)t=0;else t=((t|0)>(g|0)?g:t)&65535;b[d+2>>1]=t;f=f+ -2|0;if((f|0)<=1)break;else d=d+4|0}a=a+(p+2<<1)|0;f=q-p|0;n=h+(j+4<<1)|0}if(!f){i=m;return}h=(b[n>>1]|0)+l>>o;if((h|0)<0)h=0;else h=((h|0)>(g|0)?g:h)&65535;b[a>>1]=h;i=m;return}else{j=20-j|0;l=1<>1]|0;u=b[p>>1]|0;t=b[o>>1]|0;d=b[n>>1]|0;r=b[h+8>>1]|0;s=b[h+10>>1]|0;if((f|0)>1){q=f+ -2|0;o=q>>>1;p=o<<1;w=a;while(1){v=b[n+6>>1]|0;x=d*57|0;y=(s<<2)+l+($(r,-10)|0)+x+(t*18|0)+($(u,-6)|0)+(k<<1)-v>>j;if((y|0)<0)y=0;else y=((y|0)>(g|0)?g:y)&65535;b[w>>1]=y;k=($(s,-6)|0)+l+(r*18|0)+x+($(t,-10)|0)-k+(u<<2)+(v<<1)>>j;if((k|0)<0)k=0;else k=((k|0)>(g|0)?g:k)&65535;b[w+2>>1]=k;f=f+ -2|0;if((f|0)<=1)break;else{A=s;z=r;x=d;y=t;k=u;s=v;w=w+4|0;n=n+2|0;r=A;d=z;t=x;u=y}}k=u;u=t;t=d;d=r;r=s;s=v;a=a+(p+2<<1)|0;f=q-p|0;n=h+(o+4<<1)|0}if(!f){i=m;return}h=(s<<2)+l+($(r,-10)|0)+(d*57|0)+(t*18|0)+($(u,-6)|0)+(k<<1)-(b[n+6>>1]|0)>>j;if((h|0)<0)h=0;else h=((h|0)>(g|0)?g:h)&65535;b[a>>1]=h;i=m;return}}function Gd(a,c,d,f,g,h){a=a|0;c=c|0;d=d|0;f=f|0;g=g|0;h=h|0;var 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;j=i;v=(d+1|0)/2|0;k=h+6|0;ee(k|0,c|0,v<<1|0)|0;u=b[c>>1]|0;b[h>>1]=u;m=h+2|0;b[m>>1]=u;l=h+4|0;b[l>>1]=u;c=b[c+(v+ -1<<1)>>1]|0;b[h+(v+3<<1)>>1]=c;b[h+(v+4<<1)>>1]=c;b[h+(v+5<<1)>>1]=c;b[h+(v+6<<1)>>1]=c;c=(1<1){g=d+ -2|0;l=g>>>1;m=l<<1;f=a;while(1){b[f>>1]=b[k>>1]|0;v=$((e[k+4>>1]|0)+(e[k+ -2>>1]|0)|0,-11)|0;n=k;k=k+2|0;n=32-(e[n+ -6>>1]|0)-(e[n+8>>1]|0)+((e[n+6>>1]|0)+(e[n+ -4>>1]|0)<<2)+v+(((e[k>>1]|0)+(e[n>>1]|0)|0)*40|0)>>6;if((n|0)<0)n=0;else n=((n|0)>(c|0)?c:n)&65535;b[f+2>>1]=n;d=d+ -2|0;if((d|0)<=1)break;else f=f+4|0}a=a+(m+2<<1)|0;d=g-m|0;k=h+(l+4<<1)|0}if(!d){i=j;return}b[a>>1]=b[k>>1]|0;i=j;return}r=e[h>>1]|0;f=e[m>>1]|0;q=e[l>>1]|0;p=e[k>>1]|0;o=e[h+8>>1]|0;n=e[h+10>>1]|0;if((d|0)>1){m=d+ -2|0;l=m>>>1;g=l<<1;t=a;while(1){s=e[k+6>>1]|0;u=p*57|0;v=(n<<2)+32+($(o,-10)|0)+u+(q*18|0)+($(f,-6)|0)+(r<<1)-s>>6;if((v|0)<0)v=0;else v=((v|0)>(c|0)?c:v)&65535;b[t>>1]=v;r=($(n,-6)|0)+32+(o*18|0)+u+($(q,-10)|0)-r+(f<<2)+(s<<1)>>6;if((r|0)<0)r=0;else r=((r|0)>(c|0)?c:r)&65535;b[t+2>>1]=r;d=d+ -2|0;if((d|0)<=1)break;else{x=n;w=o;u=p;v=q;r=f;n=s;t=t+4|0;k=k+2|0;o=x;p=w;q=u;f=v}}r=f;f=q;q=p;p=o;o=n;n=s;a=a+(g+2<<1)|0;d=m-g|0;k=h+(l+4<<1)|0}if(!d){i=j;return}h=(n<<2)+32+($(o,-10)|0)+(p*57|0)+(q*18|0)+($(f,-6)|0)+(r<<1)-(e[k+6>>1]|0)>>6;if((h|0)<0)h=0;else h=((h|0)>(c|0)?c:h)&65535;b[a>>1]=h;i=j;return}function Hd(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0.0,o=0,p=0.0,q=0.0,r=0,s=0.0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0,B=0.0;f=i;if(!(c[b>>2]|0)){w=-1;i=f;return w|0}g=b+44|0;if((c[g>>2]|0)>-1|e>>>0>1){w=-1;i=f;return w|0}a[b+40>>0]=(e|0)==1&1;l=b+41|0;a[l>>0]=0;c[b+56>>2]=Cd(b,b+72|0,0)|0;e=b+16|0;if(!(c[e>>2]|0))m=1;else{c[b+60>>2]=Cd(b,b+76|0,1)|0;c[b+64>>2]=Cd(b,b+80|0,2)|0;m=3}if(!(a[b+21>>0]|0))c[b+68>>2]=0;else c[b+68>>2]=Cd(b,b+84|0,m)|0;if(((c[e>>2]|0)+ -1|0)>>>0<2?(w=b+8|0,v=c[w>>2]|0,k=b+48|0,c[k>>2]=(v+1|0)/2|0,j=b+52|0,c[j>>2]=((c[b+12>>2]|0)+1|0)/2|0,c[b+88>>2]=fd(v<<1)|0,c[b+92>>2]=fd(c[w>>2]<<1)|0,c[b+160>>2]=fd((c[k>>2]<<1)+14|0)|0,(c[e>>2]|0)==1):0){m=0;do{c[b+(m<<2)+96>>2]=fd(c[k>>2]<<1)|0;c[b+(m<<2)+128>>2]=fd(c[k>>2]<<1)|0;m=m+1|0}while((m|0)!=8);v=b+60|0;o=b+76|0;m=b+64|0;r=b+80|0;u=0;do{w=(u|0)>4?u+ -8|0:u;if((w|0)<0)w=0;else{x=c[j>>2]|0;w=(w|0)<(x|0)?w:x+ -1|0}y=(c[v>>2]|0)+($(c[o>>2]|0,w)|0)|0;x=(c[m>>2]|0)+($(c[r>>2]|0,w)|0)|0;ee(c[b+(u<<2)+96>>2]|0,y|0,c[k>>2]<<1|0)|0;ee(c[b+(u<<2)+128>>2]|0,x|0,c[k>>2]<<1|0)|0;u=u+1|0}while((u|0)!=8)}j=d[b+22>>0]|0;y=(a[l>>0]|0)!=0?16:8;m=b+28|0;r=c[m>>2]|0;l=a[b+24>>0]|0;k=l&255;o=30-y|0;n=+((1<>24!=0;if(l){y=j+ -8|0;p=n/+(224<>2]=sa(+(p*B*2.0))|0;z=1.0-s;A=z-t;c[b+188>>2]=sa(+(p*(s*2.0*z/A)))|0;c[b+192>>2]=sa(+(p*(t*2.0*B/A)))|0;c[b+196>>2]=sa(+(p*z*2.0))|0}h=sa(+q)|0;c[b+172>>2]=h;c[b+164>>2]=o;r=1<>2]=r;c[b+200>>2]=1<>2]=y;y=$(y,-16<>2]=y+(c[o>>2]|0)}else{c[b+176>>2]=h;c[b+180>>2]=r}c[b+204>>2]=j;c[b+208>>2]=k;if(!(c[e>>2]|0))c[b+212>>2]=7;else c[b+212>>2]=c[5032+(c[m>>2]<<2)>>2];c[g>>2]=0;y=0;i=f;return y|0}function Id(){var a=0,b=0;a=i;b=md(216)|0;if(!b)b=0;i=a;return b|0}function Jd(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,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;i=i+80|0;m=g+68|0;j=g+64|0;h=g+60|0;n=g+56|0;k=g+44|0;l=g+32|0;s=g;if((f|0)<6){D=-1;i=g;return D|0}if((a[e>>0]|0)!=66){D=-1;i=g;return D|0}if((a[e+1>>0]|0)!=80){D=-1;i=g;return D|0}if((a[e+2>>0]|0)!=71){D=-1;i=g;return D|0}if((a[e+3>>0]|0)!=-5){D=-1;i=g;return D|0}D=a[e+4>>0]|0;y=D&255;w=y>>>5;r=s+8|0;c[r>>2]=w;if((D&255)>191){D=-1;i=g;return D|0}D=(y&15)+8|0;a[s+13>>0]=D;if((D&255)>>>0>14){D=-1;i=g;return D|0}u=a[e+5>>0]|0;p=u&255;v=p>>>4;o=s+20|0;c[o>>2]=v;t=p&8;A=p>>>2&1;q=s+16|0;a[q>>0]=p>>>1&1;p=s+12|0;a[p>>0]=0;x=s+14|0;a[x>>0]=0;z=s+15|0;a[z>>0]=0;if(!(y&16))if(!A)x=0;else{a[p>>0]=1;a[x>>0]=1;x=1}else{a[p>>0]=1;a[z>>0]=A;x=0}if((u&255)>79){D=-1;i=g;return D|0}if(!((w|0)!=0|(v|0)==0)){D=-1;i=g;return D|0}if(x<<24>>24!=0&(w|0)==0){D=-1;i=g;return D|0}u=Pd(s,e+6|0,f+ -6|0)|0;if((u|0)<0){D=-1;i=g;return D|0}v=u+6|0;x=s+4|0;u=Pd(x,e+v|0,f-v|0)|0;if((u|0)<0){D=-1;i=g;return D|0}u=u+v|0;if(!(c[s>>2]|0)){D=-1;i=g;return D|0}if(!(c[x>>2]|0)){D=-1;i=g;return D|0}v=s+24|0;w=Pd(v,e+u|0,f-u|0)|0;if((w|0)<0){D=-1;i=g;return D|0}u=w+u|0;c[m>>2]=0;if(t){t=Pd(m,e+u|0,f-u|0)|0;if((t|0)<0){D=-1;i=g;return D|0}c[s+28>>2]=0;u=t+u+(c[m>>2]|0)|0;if((u|0)>(f|0)){D=-1;i=g;return D|0}}else c[s+28>>2]=0;w=c[v>>2]|0;if(!w){w=f-u|0;c[v>>2]=w}if((u|0)<0){D=u;i=g;return D|0}v=c[s>>2]|0;x=c[x>>2]|0;D=c[p>>2]|0;t=D&255;A=c[o>>2]|0;y=(D&65535)>>>8;s=y&255;y=y&65535;o=b+8|0;c[o>>2]=v;p=b+12|0;c[p>>2]=x;z=c[r>>2]|0;C=b+16|0;c[C>>2]=z;B=D>>>24&255;r=D>>>16&255;if((z|0)==5){c[C>>2]=2;a[b+20>>0]=0;z=2}else if((z|0)==4){c[C>>2]=1;a[b+20>>0]=0;z=1}else{c[C>>2]=z;a[b+20>>0]=1}a[b+21>>0]=t;a[b+25>>0]=B;a[b+23>>0]=r;a[b+24>>0]=a[q>>0]|0;c[b+28>>2]=A;a[b+22>>0]=s;q=b+36|0;c[q>>2]=0;do if((w+u|0)>>>0>f>>>0){j=c[b>>2]|0;e=77}else{f=b+4|0;A=e+u|0;c[j>>2]=0;c[h>>2]=0;c[k>>2]=0;c[k+4>>2]=0;s=k+8|0;c[s>>2]=0;c[l>>2]=0;c[l+4>>2]=0;r=l+8|0;c[r>>2]=0;t=t<<24>>24!=0;do if(t){A=Ld(n,m,A,w,v,x,0,y)|0;if((A|0)<0){e=72;break}B=c[n>>2]|0;if((Md(k,B,c[m>>2]|0)|0)<0){e=72;break}Vd(B);u=e+(A+u)|0;w=w-A|0;e=37}else{u=A;e=37}while(0);a:do if((e|0)==37){y=Ld(n,m,u,w,v,x,z,y)|0;if((y|0)<0){e=72;break}x=c[n>>2]|0;if((Md(l,x,c[m>>2]|0)|0)<0){e=72;break}v=w-y|0;Vd(x);b:do if((v|0)>0){u=u+y|0;x=1;c:while(1){d:do if((x|0)!=1){do if((v|0)>3){if(a[u>>0]|0)break;if(a[u+1>>0]|0)break;if(a[u+2>>0]|0)break;if((a[u+3>>0]|0)==1){w=4;break d}}while(0);if((v|0)<=2)break c;if(a[u>>0]|0)break c;if(a[u+1>>0]|0)break c;if((a[u+2>>0]|0)==1)w=3;else break c}else w=0;while(0);y=w+2|0;if((y|0)>(v|0))break;e:do if((y|0)<(v|0))while(1){B=(a[u+w>>0]|0)==0;do if(B){if(a[u+(w+1)>>0]|0)break;if((a[u+y>>0]|0)==1)break e}while(0);A=y;y=w+3|0;if((y|0)>=(v|0)){w=v;break e}z=w+1|0;if(!B){w=z;continue}if(a[u+z>>0]|0){w=z;continue}if(a[u+A>>0]|0){w=z;continue}A=(a[u+y>>0]|0)==1;if(A){w=A?w:v;break}else w=z}else w=v;while(0);c[m>>2]=w;if((w|0)<0){e=72;break a}if(!x)A=(a[u+2>>0]|0)==0?4:3;else A=0;y=u+A|0;z=w-A|0;x=z+3|0;A=t&(d[y>>0]<<5&32|(d[u+(A+1)>>0]|0)>>>3|0)==1;C=A?k:l;B=C+8|0;if((Nd(C,(c[B>>2]|0)+x|0)|0)<0){e=72;break a}C=c[C>>2]|0;D=c[B>>2]|0;E=C+D|0;c[n>>2]=E;a[E>>0]=0;a[C+(D+1)>>0]=0;a[C+(D+2)>>0]=1;ee(C+(D+3)|0,y|0,z|0)|0;if(A){E=C+(D+4)|0;a[E>>0]=d[E>>0]&7}c[B>>2]=D+x;v=v-w|0;if((v|0)<=0)break b;else{u=u+w|0;x=0}}c[m>>2]=-1;e=72;break a}while(0);if(t?(E=Od(c[k>>2]|0,c[s>>2]|0)|0,c[h>>2]=E,(E|0)==0):0){e=72;break}m=c[l>>2]|0;E=Od(m,c[r>>2]|0)|0;c[j>>2]=E;if(!E)e=72;else l=0}while(0);if((e|0)==72){xd(j);xd(h);m=c[l>>2]|0;l=1}id(c[k>>2]|0);id(m);j=c[j>>2]|0;c[b>>2]=j;c[f>>2]=c[h>>2];if(l){e=77;break}if((c[j+64>>2]|0)<(c[o>>2]|0)){e=77;break}if((c[j+68>>2]|0)<(c[p>>2]|0)){e=78;break}c[b+44>>2]=-1;E=0;i=g;return E|0}while(0);if((e|0)==77?(j|0)!=0:0)e=78;if((e|0)==78)xd(b);b=b+4|0;if(c[b>>2]|0)xd(b);c[q>>2]=0;E=-1;i=g;return E|0}function Kd(a){a=a|0;var b=0,d=0;b=i;id(c[a+88>>2]|0);id(c[a+92>>2]|0);d=0;do{id(c[a+(d<<2)+96>>2]|0);id(c[a+(d<<2)+128>>2]|0);d=d+1|0}while((d|0)!=8);id(c[a+160>>2]|0);if(c[a>>2]|0)xd(a);d=a+4|0;if(!(c[d>>2]|0)){id(a);i=b;return}xd(d);id(a);i=b;return}function Ld(b,d,e,f,g,h,j,k){b=b|0;d=d|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;m=i;i=i+16|0;n=m;c[b>>2]=0;r=Pd(n,e,f)|0;if((r|0)<0){r=-1;i=m;return r|0}q=f-r|0;p=c[n>>2]|0;if(p>>>0>q>>>0){r=-1;i=m;return r|0}o=p+10|0;n=fd(o)|0;a[n>>0]=j;a[n+1>>0]=g>>>24;a[n+2>>0]=g>>>16;a[n+3>>0]=g>>>8;a[n+4>>0]=g;a[n+5>>0]=h>>>24;a[n+6>>0]=h>>>16;a[n+7>>0]=h>>>8;a[n+8>>0]=h;a[n+9>>0]=k+248;ee(n+10|0,e+r|0,p|0)|0;h=q-p|0;k=fd((o<<1)+10-p+h|0)|0;a[k>>0]=0;a[k+1>>0]=0;a[k+2>>0]=0;a[k+3>>0]=1;a[k+4>>0]=96;a[k+5>>0]=1;if((o|0)>0){q=0;e=6;while(1){p=q+1|0;g=a[n+q>>0]|0;if((p|0)<(o|0)&g<<24>>24==0)if(!(a[n+p>>0]|0)){a[k+e>>0]=0;a[k+(e+1)>>0]=0;a[k+(e+2)>>0]=3;p=q+2|0;e=e+3|0}else{g=0;l=7}else l=7;if((l|0)==7){l=0;a[k+e>>0]=g;e=e+1|0}if((p|0)<(o|0))q=p;else break}if(!e){e=0;l=11}else l=10}else{e=6;l=10}if((l|0)==10)if(!(a[k+(e+ -1)>>0]|0))l=11;if((l|0)==11){a[k+e>>0]=-128;e=e+1|0}id(n);c[d>>2]=e;c[b>>2]=k;r=f-h|0;i=m;return r|0}function Md(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;f=a+8|0;if((Nd(a,(c[f>>2]|0)+d|0)|0)<0){d=-1;i=e;return d|0}ee((c[a>>2]|0)+(c[f>>2]|0)|0,b|0,d|0)|0;c[f>>2]=(c[f>>2]|0)+d;d=0;i=e;return d|0}function Nd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;e=a+4|0;f=c[e>>2]|0;if((f|0)<(b|0)){f=(f*3|0)/2|0;f=(f|0)<(b|0)?b:f;b=gd(c[a>>2]|0,f)|0;if(!b)a=-1;else{c[a>>2]=b;c[e>>2]=f;a=0}}else a=0;i=d;return a|0}function Od(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;f=i;i=i+96|0;h=f;g=f+84|0;d=f+80|0;e=Oc(1416)|0;if(((e|0)!=0?(j=wd()|0,c[d>>2]=j,(j|0)!=0):0)?(j=e+688|0,c[j>>2]=c[j>>2]|1,(Ic(e,1416,0)|0)>=0):0){j=c[d>>2]|0;Xc(h);c[h+24>>2]=a;c[h+28>>2]=b;a=Pc(e,j,g,h)|0;if((a|0)<0)g=0;else{g=(c[g>>2]|0)!=0;a=0}Jc(e)|0;if((a|0)>-1&g){id(e);j=c[d>>2]|0;i=f;return j|0}}id(e);xd(d);j=0;i=f;return j|0}function Pd(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;if((f|0)<1){l=-1;i=g;return l|0}k=e+1|0;l=a[e>>0]|0;j=l&255;if(l<<24>>24<=-1){if(l<<24>>24==-128){l=-1;i=g;return l|0}j=j&127;while(1){if((f|0)<2){b=-1;h=10;break}l=k;k=k+1|0;l=d[l>>0]|0;j=l&127|j<<7;if(!(l&128))break;else f=f+ -1|0}if((h|0)==10){i=g;return b|0}c[b>>2]=j;h=k-e|0;if((h|0)<0){l=h;i=g;return l|0}}else{c[b>>2]=j;h=1}l=j>>>0>1073741823?-1:h;i=g;return l|0}function Qd(d,f,g,h,j,k,l){d=d|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;j=i;if((c[d+40>>2]|0)==8?(c[d+44>>2]|0)==0:0){if((k|0)>0)h=0;else{i=j;return}while(1){o=b[g+(h<<1)>>1]&255;a[f>>0]=o;a[f+1>>0]=o;a[f+2>>0]=o;h=h+1|0;if((h|0)==(k|0))break;else f=f+l|0}i=j;return}m=c[d+12>>2]|0;h=c[d+16>>2]|0;d=c[d>>2]|0;if((k|0)>0)n=0;else{i=j;return}while(1){o=($(e[g+(n<<1)>>1]|0,m)|0)+h>>d;if((o|0)<0)o=0;else o=(o|0)>255?-1:o&255;a[f>>0]=o;a[f+1>>0]=o;a[f+2>>0]=o;n=n+1|0;if((n|0)==(k|0))break;else f=f+l|0}i=j;return}function Rd(b,d,f,g,h,j,k){b=b|0;d=d|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;q=i;s=c[b+20>>2]|0;n=c[b+24>>2]|0;o=c[b+28>>2]|0;l=c[b+32>>2]|0;p=c[b+12>>2]|0;r=c[b+16>>2]|0;m=c[b>>2]|0;b=c[b+36>>2]|0;if((j|0)>0)t=0;else{i=q;return}while(1){v=$(e[f+(t<<1)>>1]|0,p)|0;u=(e[g+(t<<1)>>1]|0)-b|0;w=(e[h+(t<<1)>>1]|0)-b|0;v=v+r|0;x=v+($(w,s)|0)>>m;if((x|0)<0)x=0;else x=(x|0)>255?-1:x&255;a[d>>0]=x;w=v-($(u,n)|0)-($(w,o)|0)>>m;if((w|0)<0)w=0;else w=(w|0)>255?-1:w&255;a[d+1>>0]=w;u=v+($(u,l)|0)>>m;if((u|0)<0)u=0;else u=(u|0)>255?-1:u&255;a[d+2>>0]=u;t=t+1|0;if((t|0)==(j|0))break;else d=d+k|0}i=q;return}function Sd(d,f,g,h,j,k,l){d=d|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;m=i;if((c[d+40>>2]|0)==8?(c[d+44>>2]|0)==0:0){if((k|0)>0)n=0;else{i=m;return}while(1){a[f>>0]=b[j+(n<<1)>>1];a[f+1>>0]=b[g+(n<<1)>>1];a[f+2>>0]=b[h+(n<<1)>>1];n=n+1|0;if((n|0)==(k|0))break;else f=f+l|0}i=m;return}o=c[d+12>>2]|0;n=c[d+16>>2]|0;d=c[d>>2]|0;if((k|0)>0)p=0;else{i=m;return}while(1){q=($(e[j+(p<<1)>>1]|0,o)|0)+n>>d;if((q|0)<0)q=0;else q=(q|0)>255?-1:q&255;a[f>>0]=q;q=($(e[g+(p<<1)>>1]|0,o)|0)+n>>d;if((q|0)<0)q=0;else q=(q|0)>255?-1:q&255;a[f+1>>0]=q;q=($(e[h+(p<<1)>>1]|0,o)|0)+n>>d;if((q|0)<0)q=0;else q=(q|0)>255?-1:q&255;a[f+2>>0]=q;p=p+1|0;if((p|0)==(k|0))break;else f=f+l|0}i=m;return}function Td(b,d,f,g,h,j,k){b=b|0;d=d|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;o=i;l=c[b+12>>2]|0;m=c[b+16>>2]|0;n=c[b>>2]|0;b=c[b+36>>2]|0;if((j|0)>0)p=0;else{i=o;return}while(1){t=e[f+(p<<1)>>1]|0;s=(e[g+(p<<1)>>1]|0)-b|0;r=(e[h+(p<<1)>>1]|0)-b|0;q=t-s|0;u=($(q+r|0,l)|0)+m>>n;if((u|0)<0)u=0;else u=(u|0)>255?-1:u&255;a[d>>0]=u;s=($(s+t|0,l)|0)+m>>n;if((s|0)<0)s=0;else s=(s|0)>255?-1:s&255;a[d+1>>0]=s;q=($(q-r|0,l)|0)+m>>n;if((q|0)<0)q=0;else q=(q|0)>255?-1:q&255;a[d+2>>0]=q;p=p+1|0;if((p|0)==(j|0))break;else d=d+k|0}i=o;return}function Ud(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;if((b|0)==0|b>>>0>2147483583){k=0;i=d;return k|0}do if(!(c[1523]|0)){e=ra(64)|0;if((e|0)==(-1|0)){k=0;i=d;return k|0}else{c[1524]=ra(0)|0;c[1523]=6088;c[1522]=6088;c[1527]=6104;c[1526]=6104;k=e+16|0;a[e+15>>0]=-86;j=c[1527]|0;c[1527]=k;c[k>>2]=6104;c[e+20>>2]=j;c[j>>2]=k;j=e+24|0;k=c[1523]|0;c[1523]=j;c[j>>2]=6088;c[e+28>>2]=k;c[k>>2]=j;break}}while(0);e=b+40&-32;h=c[1524]|0;g=c[1522]|0;k=6092|0;while(1){f=c[k>>2]|0;b=f+ -8|0;k=c[f+ -4>>2]|0;if((k|0)==6104)j=h;else j=k;j=j-b|0;if(e>>>0>>0){h=12;break}if((f|0)==(g|0)){h=10;break}k=f+4|0;if((e|0)==(j|0)){h=15;break}}do if((h|0)==10)if((ra(e+32-j|0)|0)==(-1|0)){k=0;i=d;return k|0}else{c[1524]=ra(0)|0;k=c[g+ -4>>2]|0;f=g;h=12;break}else if((h|0)==15){j=c[f>>2]|0;k=c[k>>2]|0;c[j+4>>2]=k;c[k>>2]=j}while(0);if((h|0)==12){h=b+e|0;c[f+ -4>>2]=h;c[h>>2]=b;c[b+(e|4)>>2]=k;c[k>>2]=h;h=b+(e|8)|0;k=f+4|0;j=c[k>>2]|0;c[k>>2]=h;c[h>>2]=f;c[b+(e|12)>>2]=j;c[j>>2]=h;a[b+(e+ -1)>>0]=-86;j=c[f>>2]|0;k=c[k>>2]|0;c[j+4>>2]=k;c[k>>2]=j}a[b+ -1>>0]=85;k=f;i=d;return k|0}function Vd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;if(!b){i=d;return}g=b+ -8|0;e=c[1523]|0;c[1523]=b;c[b>>2]=6088;f=b+4|0;c[f>>2]=e;c[e>>2]=b;a[b+ -9>>0]=-86;e=c[g>>2]|0;if((e|0)!=6104?(a[e+ -1>>0]|0)==-86:0){g=c[b+ -4>>2]|0;c[e+4>>2]=g;c[g>>2]=e;b=c[b>>2]|0;g=c[f>>2]|0;c[b+4>>2]=g;c[g>>2]=b}else e=g;b=c[e+4>>2]|0;if((b|0)==6104){i=d;return}if((a[b+ -1>>0]|0)!=-86){i=d;return}g=c[b>>2]|0;h=c[b+4>>2]|0;c[g+4>>2]=h;c[h>>2]=g;h=e+8|0;g=c[h>>2]|0;j=e+12|0;f=c[j>>2]|0;c[g+4>>2]=f;c[f>>2]=g;f=b+8|0;g=b+12|0;e=c[g>>2]|0;c[g>>2]=h;c[h>>2]=f;c[j>>2]=e;c[e>>2]=h;f=c[f>>2]|0;g=c[g>>2]|0;c[f+4>>2]=g;c[g>>2]=f;i=d;return}function Wd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;do if(a){if(!b){Vd(a);e=0;break}e=Ud(b)|0;if(!e)e=0;else{f=(c[a+ -4>>2]|0)-a+ -1|0;ee(e|0,a|0,(f>>>0>b>>>0?b:f)|0)|0;Vd(a)}}else e=Ud(b)|0;while(0);i=d;return e|0}function Xd(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;f=i;if(!d){h=0;i=f;return h|0}while(1){g=a[b>>0]|0;h=a[c>>0]|0;if(g<<24>>24!=h<<24>>24)break;d=d+ -1|0;if(!d){b=0;e=5;break}else{b=b+1|0;c=c+1|0}}if((e|0)==5){i=f;return b|0}h=(g&255)-(h&255)|0;i=f;return h|0}function Yd(){}function Zd(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>c;return a>>>c|(b&(1<>c-32|0}function _d(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;b=b-d-(c>>>0>a>>>0|0)>>>0;return(D=b,a-c>>>0|0)|0}function $d(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return(D=b+d+(c>>>0>>0|0)>>>0,c|0)|0}function ae(b){b=b|0;var c=0;c=b;while(a[c>>0]|0)c=c+1|0;return c-b|0}function be(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;i=b&3;h=d|d<<8|d<<16|d<<24;g=f&~3;if(i){i=b+4-i|0;while((b|0)<(i|0)){a[b>>0]=d;b=b+1|0}}while((b|0)<(g|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 ce(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b<>>32-c;return a<>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function ee(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return ua(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 fe(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>>c;return a>>>c|(b&(1<>>c-32|0}function ge(b){b=b|0;var c=0;c=a[n+(b>>>24)>>0]|0;if((c|0)<8)return c|0;c=a[n+(b>>16&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>8&255)>>0]|0;if((c|0)<8)return c+16|0;return(a[n+(b&255)>>0]|0)+24|0}function he(b){b=b|0;var c=0;c=a[m+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return(a[m+(b>>>24)>>0]|0)+24|0}function ie(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;d=b&65535;c=$(d,f)|0;e=a>>>16;d=(c>>>16)+($(d,e)|0)|0;b=b>>>16;a=$(b,f)|0;return(D=(d>>>16)+($(b,e)|0)+(((d&65535)+a|0)>>>16)|0,d+a<<16|c&65535|0)|0}function je(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;f=c;a=ie(e,f)|0;c=D;return(D=($(b,f)|0)+($(d,e)|0)+c|c&0,a|0|0)|0}function ke(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return xa[a&1](b|0,c|0,d|0)|0}function le(a,b,c,d,e,f,g,h,i,j,k){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;ya[a&1](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0)}function me(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;za[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0)}function ne(a,b,c,d,e,f,g,h,i,j,k,l,m,n){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;Aa[a&3](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)}function oe(a,b){a=a|0;b=b|0;Ba[a&1](b|0)}function pe(a,b,c){a=a|0;b=b|0;c=c|0;Ca[a&7](b|0,c|0)}function qe(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return Da[a&1](b|0,c|0,d|0,e|0,f|0,g|0)|0}function re(a,b){a=a|0;b=b|0;return Ea[a&3](b|0)|0}function se(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Fa[a&7](b|0,c|0,d|0)}function te(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Ga[a&1](b|0,c|0,d|0,e|0)|0}function ue(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;Ha[a&3](b|0,c|0,d|0,e|0,f|0,g|0)}function ve(a,b,c){a=a|0;b=b|0;c=c|0;return Ia[a&1](b|0,c|0)|0}function we(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return Ja[a&1](b|0,c|0,d|0,e|0,f|0)|0}function xe(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Ka[a&7](b|0,c|0,d|0,e|0)}function ye(a,b,c){a=a|0;b=b|0;c=c|0;aa(0);return 0}function ze(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;aa(1)}function Ae(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;aa(2)}function Be(a,b,c,d,e,f,g,h,i,j,k,l,m){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;aa(3)}function Ce(a){a=a|0;aa(4)}function De(a,b){a=a|0;b=b|0;aa(5)}function Ee(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(6);return 0}function Fe(a){a=a|0;aa(7);return 0}function Ge(a,b,c){a=a|0;b=b|0;c=c|0;aa(8)}function He(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aa(9);return 0}function Ie(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(10)}function Je(a,b){a=a|0;b=b|0;aa(11);return 0}function Ke(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;aa(12);return 0}function Le(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aa(13)} // EMSCRIPTEN_END_FUNCS -var za=[we,Oc];var Aa=[xe,uc];var Ba=[ye,Pd,Qd,Rd,ec,xc,yc,Od];var Ca=[ze,vc,wc,ze];var Da=[Ae,Ob];var Ea=[Be,lc,qc,rc,sc,tc,Hc,sd];var Fa=[Ce,Mc];var Ga=[De,Lb,Nb,De];var Ha=[Ee,jc,kc,mc,nc,oc,pc,Ee];var Ia=[Fe,Mb];var Ja=[Ge,zc,Ac,Ge];var Ka=[He,Rb];var La=[Ie,Nc];var Ma=[Je,fc,gc,hc,ic,Je,Je,Je];return{_i64Subtract:Zd,_free:Td,_bpg_decoder_decode:Kd,_bpg_decoder_start:Id,_realloc:Ud,_i64Add:_d,_bpg_decoder_open:Jd,_bitshift64Ashr:Yd,_strlen:$d,_bpg_decoder_close:Md,_memset:ae,_malloc:Sd,_memcpy:ce,_bpg_decoder_get_line:Fd,_bpg_decoder_get_info:Ed,_llvm_bswap_i32:Xd,_bitshift64Shl:be,runPostSets:Wd,stackAlloc:Na,stackSave:Oa,stackRestore:Pa,setThrew:Qa,setTempRet0:Ta,getTempRet0:Ua,dynCall_iiii:ie,dynCall_viiiiiiiiii:je,dynCall_viiiiiii:ke,dynCall_viiiiiiiiiiiii:le,dynCall_vi:me,dynCall_vii:ne,dynCall_iiiiiii:oe,dynCall_ii:pe,dynCall_viii:qe,dynCall_iiiii:re,dynCall_viiiiii:se,dynCall_iii:te,dynCall_iiiiii:ue,dynCall_viiii:ve}}) +var xa=[ye,Mc];var ya=[ze,sc];var za=[Ae,Rd,Sd,Td,cc,vc,wc,Qd];var Aa=[Be,tc,uc,Be];var Ba=[Ce,Mb];var Ca=[De,jc,oc,pc,qc,rc,Fc,rd];var Da=[Ee,Kc];var Ea=[Fe,Jb,Lb,Fe];var Fa=[Ge,hc,ic,kc,lc,mc,nc,Ge];var Ga=[He,Kb];var Ha=[Ie,xc,yc,Ie];var Ia=[Je,Pb];var Ja=[Ke,Lc];var Ka=[Le,dc,ec,fc,gc,Le,Le,Le];return{_i64Subtract:_d,_free:Vd,_bpg_decoder_decode:Jd,_bpg_decoder_start:Hd,_realloc:Wd,_i64Add:$d,_bpg_decoder_open:Id,_bitshift64Ashr:Zd,_strlen:ae,_bpg_decoder_close:Kd,_memset:be,_malloc:Ud,_memcpy:ee,_bpg_decoder_get_line:Ed,_bpg_decoder_get_info:Dd,_llvm_bswap_i32:de,_bitshift64Shl:ce,runPostSets:Yd,stackAlloc:La,stackSave:Ma,stackRestore:Na,setThrew:Oa,setTempRet0:Ra,getTempRet0:Sa,dynCall_iiii:ke,dynCall_viiiiiiiiii:le,dynCall_viiiiiii:me,dynCall_viiiiiiiiiiiii:ne,dynCall_vi:oe,dynCall_vii:pe,dynCall_iiiiiii:qe,dynCall_ii:re,dynCall_viii:se,dynCall_iiiii:te,dynCall_viiiiii:ue,dynCall_iii:ve,dynCall_iiiiii:we,dynCall_viiii:xe}}) // EMSCRIPTEN_END_ASM -(l.v,l.w,T),Ra=l._i64Subtract=Z._i64Subtract;l._free=Z._free;l._bpg_decoder_decode=Z._bpg_decoder_decode;l._bpg_decoder_start=Z._bpg_decoder_start;l._realloc=Z._realloc;var Sa=l._i64Add=Z._i64Add;l._bpg_decoder_open=Z._bpg_decoder_open; -var Qa=l._bitshift64Ashr=Z._bitshift64Ashr,Ta=l._strlen=Z._strlen;l._bpg_decoder_close=Z._bpg_decoder_close;var Ua=l._memset=Z._memset,ua=l._malloc=Z._malloc,Ya=l._memcpy=Z._memcpy;l._bpg_decoder_get_line=Z._bpg_decoder_get_line;l._bpg_decoder_get_info=Z._bpg_decoder_get_info;var Pa=l._llvm_bswap_i32=Z._llvm_bswap_i32,Va=l._bitshift64Shl=Z._bitshift64Shl;l.runPostSets=Z.runPostSets;l.dynCall_iiii=Z.dynCall_iiii;l.dynCall_viiiiiiiiii=Z.dynCall_viiiiiiiiii;l.dynCall_viiiiiii=Z.dynCall_viiiiiii; +(l.v,l.w,T),Qa=l._i64Subtract=Z._i64Subtract;l._free=Z._free;l._bpg_decoder_decode=Z._bpg_decoder_decode;l._bpg_decoder_start=Z._bpg_decoder_start;l._realloc=Z._realloc;var Ra=l._i64Add=Z._i64Add;l._bpg_decoder_open=Z._bpg_decoder_open; +var Pa=l._bitshift64Ashr=Z._bitshift64Ashr,Sa=l._strlen=Z._strlen;l._bpg_decoder_close=Z._bpg_decoder_close;var Ta=l._memset=Z._memset,ua=l._malloc=Z._malloc,Xa=l._memcpy=Z._memcpy;l._bpg_decoder_get_line=Z._bpg_decoder_get_line;l._bpg_decoder_get_info=Z._bpg_decoder_get_info;var Va=l._llvm_bswap_i32=Z._llvm_bswap_i32,Ua=l._bitshift64Shl=Z._bitshift64Shl;l.runPostSets=Z.runPostSets;l.dynCall_iiii=Z.dynCall_iiii;l.dynCall_viiiiiiiiii=Z.dynCall_viiiiiiiiii;l.dynCall_viiiiiii=Z.dynCall_viiiiiii; l.dynCall_viiiiiiiiiiiii=Z.dynCall_viiiiiiiiiiiii;l.dynCall_vi=Z.dynCall_vi;l.dynCall_vii=Z.dynCall_vii;l.dynCall_iiiiiii=Z.dynCall_iiiiiii;l.dynCall_ii=Z.dynCall_ii;l.dynCall_viii=Z.dynCall_viii;l.dynCall_iiiii=Z.dynCall_iiiii;l.dynCall_viiiiii=Z.dynCall_viiiiii;l.dynCall_iii=Z.dynCall_iii;l.dynCall_iiiiii=Z.dynCall_iiiiii;l.dynCall_viiii=Z.dynCall_viiii;z.d=Z.stackAlloc;z.m=Z.stackSave;z.q=Z.stackRestore;z.M=Z.setTempRet0;z.J=Z.getTempRet0; -if(X)if("function"===typeof l.locateFile?X=l.locateFile(X):l.memoryInitializerPrefixURL&&(X=l.memoryInitializerPrefixURL+X),u||w){var ab=l.readBinary(X);Q.set(ab,R)}else Ma(),Browser.V(X,function(a){Q.set(a,R);Na()},function(){b("could not load memory initializer "+X)});function ea(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}ea.prototype=Error();var $=k,W=function bb(){!l.calledRun&&cb&&db();l.calledRun||(W=bb)}; -function db(){function a(){if(!l.calledRun&&(l.calledRun=i,!F)){Ha||(Ha=i,U(Da));U(Ea);v&&$!==k&&l.a("pre-main prep time: "+(Date.now()-$)+" ms");if(l.postRun)for("function"==typeof l.postRun&&(l.postRun=[l.postRun]);l.postRun.length;)Ja(l.postRun.shift());U(Ga)}}$===k&&($=Date.now());if(!(0c.A(f,a,a.length))console.log("could not decode image");else{j=c.p(36);c.B(f,j);a=l.HEAPU32;g=a[j>>2];a=a[j+4>>2];c.n(j);c.F(f,1);p=c.p(4*g);j=c.H.createImageData(g,a);K=j.data;m=0;s=l.HEAPU8;g*=4;for(n=0;na?1:-1)}l._memcpy=Ya;ya=y=z.g(B);za=ya+Ba;Aa=C=z.g(za);x(Aaa?1:-1)}l._memcpy=Xa;ya=y=z.g(B);za=ya+Ba;Aa=C=z.g(za);x(Aa>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 Sa(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 Ta(a){a=a|0;D=a}function Ua(){return D|0}function Va(b,d){b=b|0;d=d|0;var e=0,f=0;e=i;if(!(a[(c[b+204>>2]|0)+43>>0]|0)){i=e;return}f=c[(c[b+200>>2]|0)+13128>>2]|0;d=(d|0)%(f|0)|0;if((d|0)!=2?!((f|0)==2&(d|0)==0):0){i=e;return}ce(c[b+152>>2]|0,c[b+136>>2]|0,199)|0;i=e;return}function Wa(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;g=b+204|0;f=c[g>>2]|0;if((c[(c[f+1668>>2]|0)+(c[b+2500>>2]<<2)>>2]|0)==(d|0)){Xa(b);f=b+1449|0;if(a[f>>0]|0){j=c[g>>2]|0;if((a[j+42>>0]|0)!=0?(j=c[j+1676>>2]|0,(c[j+(d<<2)>>2]|0)!=(c[j+(d+ -1<<2)>>2]|0)):0)h=5}else h=5;if((h|0)==5)Ya(b);if(a[b+1448>>0]|0){i=e;return}if(!(a[(c[g>>2]|0)+43>>0]|0)){i=e;return}g=c[(c[b+200>>2]|0)+13128>>2]|0;if((d|0)%(g|0)|0){i=e;return}if((g|0)==1){Ya(b);i=e;return}if((a[f>>0]|0)!=1){i=e;return}ce(c[b+136>>2]|0,c[b+152>>2]|0,199)|0;i=e;return}if((a[f+42>>0]|0)!=0?(j=c[f+1676>>2]|0,(c[j+(d<<2)>>2]|0)!=(c[j+(d+ -1<<2)>>2]|0)):0){if((a[b+141>>0]|0)==1)Za(c[b+136>>2]|0);else Xa(b);Ya(b);f=c[g>>2]|0}if(!(a[f+43>>0]|0)){i=e;return}f=b+200|0;if((d|0)%(c[(c[f>>2]|0)+13128>>2]|0)|0){i=e;return}d=b+136|0;_a((c[d>>2]|0)+224|0)|0;if((a[b+141>>0]|0)==1)Za(c[d>>2]|0);else Xa(b);if((c[(c[f>>2]|0)+13128>>2]|0)==1){Ya(b);i=e;return}else{ce(c[d>>2]|0,c[b+152>>2]|0,199)|0;i=e;return}}function Xa(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;e=a+136|0;a=c[e>>2]|0;d=a+204|0;cd(d,1);g=a+212|0;f=c[g>>2]|0;h=0-f&7;if(h){cd(d,h);f=c[g>>2]|0}_c((c[e>>2]|0)+224|0,(c[d>>2]|0)+((f|0)/8|0)|0,(7-f+(c[a+216>>2]|0)|0)/8|0);i=b;return}function Ya(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;g=i;f=c[b+1440>>2]|0;e=2-f|0;e=(a[b+2060>>0]|0)==0|(f|0)==2?e:e^3;f=b+2112|0;b=b+136|0;h=0;do{j=d[680+(e*199|0)+h>>0]|0;l=a[f>>0]|0;k=l<<24>>24;if(l<<24>>24<0)k=0;else k=(k|0)>51?51:k;j=((j<<3&120)+ -16+(($(k,((j>>>4)*5|0)+ -45|0)|0)>>4)<<1)+ -127|0;j=j>>31^j;if((j|0)>124)j=j&1|124;a[(c[b>>2]|0)+h>>0]=j;h=h+1|0}while((h|0)!=199);a[(c[b>>2]|0)+199>>0]=0;a[(c[b>>2]|0)+200>>0]=0;a[(c[b>>2]|0)+201>>0]=0;a[(c[b>>2]|0)+202>>0]=0;i=g;return}function Za(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+224|0;e=c[a+240>>2]|0;f=c[d>>2]|0;e=(f&1|0)==0?e:e+ -1|0;e=(f&511|0)==0?e:e+ -1|0;a=(c[a+244>>2]|0)-e|0;if((a|0)<0){i=b;return}_c(d,e,a);i=b;return}function _a(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;f=a+4|0;d=c[f>>2]|0;e=d+ -2|0;c[f>>2]=e;g=c[a>>2]|0;if((g|0)>=(e<<17|0)){g=(c[a+16>>2]|0)-(c[a+12>>2]|0)|0;i=b;return g|0}d=(d+ -258|0)>>>31;c[f>>2]=e<>2]=g;if(g&65535){g=0;i=b;return g|0}Ab(a);g=0;i=b;return g|0}function $a(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=ab(a+224|0,a)|0;i=b;return a|0}function ab(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;h=d[e>>0]|0;j=b+4|0;k=c[j>>2]|0;l=d[2880+((k<<1&384)+(h|512))>>0]|0;k=k-l|0;m=k<<17;n=c[b>>2]|0;g=m-n>>31;c[b>>2]=n-(g&m);c[j>>2]=(g&l-k)+k;h=g^h;a[e>>0]=a[h+4032>>0]|0;e=h&1;h=c[j>>2]|0;g=d[2880+h>>0]|0;c[j>>2]=h<>2]<>2]=g;if(g&65535){i=f;return e|0}j=b+16|0;h=c[j>>2]|0;c[b>>2]=(((d[h+1>>0]|0)<<1|(d[h>>0]|0)<<9)+ -65535<<7-(d[2880+((g+ -1^g)>>15)>>0]|0))+g;if(h>>>0>=(c[b+20>>2]|0)>>>0){i=f;return e|0}c[j>>2]=h+2;i=f;return e|0}function bb(a){a=a|0;var b=0,d=0;b=i;a=a+136|0;d=c[a>>2]|0;if(!(ab(d+224|0,d+1|0)|0)){d=0;i=b;return d|0}d=(cb((c[a>>2]|0)+224|0)|0)==0;d=d?1:2;i=b;return d|0}function cb(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[a>>2]<<1;c[a>>2]=d;if(!(d&65534)){Ab(a);d=c[a>>2]|0}e=c[a+4>>2]<<17;if((d|0)<(e|0)){e=0;i=b;return e|0}c[a>>2]=d-e;e=1;i=b;return e|0}function db(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(cb((c[d>>2]|0)+224|0)|0)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=cb((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function eb(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=c[(c[a+200>>2]|0)+52>>2]|0;d=(d|0)>10?31:(1<0)a=0;else{f=0;i=b;return f|0}while(1){f=a+1|0;if(!(cb((c[e>>2]|0)+224|0)|0)){d=4;break}if((f|0)<(d|0))a=f;else{a=f;d=4;break}}if((d|0)==4){i=b;return a|0}return 0}function fb(a){a=a|0;var b=0;b=i;a=cb((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function gb(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(cb((c[d>>2]|0)+224|0)|0)<<1;a=cb((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function hb(a){a=a|0;var b=0;b=i;a=_a((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function ib(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+5|0)|0;i=b;return a|0}function jb(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;a=a+136|0;g=9;e=0;while(1){h=c[a>>2]|0;f=e;e=e+1|0;if(!(ab(h+224|0,h+g|0)|0)){e=f;g=0;break}if((e|0)>=5){f=0;g=0;d=4;break}else g=10}do if((d|0)==4){while(1){d=0;if(!(cb((c[a>>2]|0)+224|0)|0)){d=5;break}g=(1<>2]|0)+224|0)|0)<>2]|0)+224|0)|0;i=b;return a|0}function lb(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+176|0)|0;i=b;return a|0}function mb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;e=a[(c[b+204>>2]|0)+1633>>0]|0;e=(e&255)<5?5:e&255;f=b+136|0;if(!e){g=0;i=d;return g|0}else b=0;while(1){h=c[f>>2]|0;g=b+1|0;if(!(ab(h+224|0,h+177|0)|0)){e=4;break}if((g|0)<(e|0))b=g;else{b=g;e=4;break}}if((e|0)==4){i=d;return b|0}return 0}function nb(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;j=i;k=c[b+200>>2]|0;n=(1<>2])+ -1|0;l=n&g;m=c[k+13064>>2]|0;h=f>>m;m=g>>m;g=c[b+136>>2]|0;if((a[g+308>>0]|0)==0?(n&f|0)==0:0)f=0;else{f=h+ -1+($(c[k+13140>>2]|0,m)|0)|0;f=d[(c[b+4336>>2]|0)+f>>0]|0}if((a[g+309>>0]|0)==0&(l|0)==0){n=0;m=(f|0)>(e|0);m=m&1;n=(n|0)>(e|0);n=n&1;f=g+224|0;m=m|2;n=m+n|0;n=g+n|0;n=ab(f,n)|0;i=j;return n|0}n=($(c[k+13140>>2]|0,m+ -1|0)|0)+h|0;n=d[(c[b+4336>>2]|0)+n>>0]|0;m=(f|0)>(e|0);m=m&1;n=(n|0)>(e|0);n=n&1;f=g+224|0;m=m|2;n=m+n|0;n=g+n|0;n=ab(f,n)|0;i=j;return n|0}function ob(a,b){a=a|0;b=b|0;var d=0;d=i;b=c[a+136>>2]|0;b=(ab(b+224|0,b+13|0)|0)==0;i=d;return(b?3:0)|0}function pb(a){a=a|0;var b=0;b=i;a=_a((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function qb(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+17|0)|0;i=b;return a|0}function rb(a){a=a|0;var b=0,d=0,e=0;b=i;e=a+136|0;d=0;while(1){a=d+1|0;if(!(cb((c[e>>2]|0)+224|0)|0)){a=d;d=4;break}if((a|0)<2)d=a;else{d=4;break}}if((d|0)==4){i=b;return a|0}return 0}function sb(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(cb((c[d>>2]|0)+224|0)|0)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=(cb((c[d>>2]|0)+224|0)|0|a)<<1;a=cb((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function tb(a){a=a|0;var b=0,d=0;b=i;a=a+136|0;d=c[a>>2]|0;if(!(ab(d+224|0,d+18|0)|0)){d=4;i=b;return d|0}d=(cb((c[a>>2]|0)+224|0)|0)<<1;d=cb((c[a>>2]|0)+224|0)|0|d;i=b;return d|0}function ub(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+(42-b)|0)|0;i=d;return a|0}function vb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+(b+42)|0)|0;i=d;return a|0}function wb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+((b|0)==0|40)|0)|0;i=d;return a|0}function xb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;a=a+136|0;f=(b<<2)+166|0;e=0;while(1){g=c[a>>2]|0;b=e+1|0;if(!(ab(g+224|0,g+(f+e)|0)|0)){b=e;a=4;break}if((b|0)<4)e=b;else{a=4;break}}if((a|0)==4){i=d;return b|0}return 0}function yb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=ab(a+224|0,a+(b+174)|0)|0;i=d;return a|0}function zb(f,g,h,j,k,l){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,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,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Da=0,Ea=0,Fa=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0;n=i;i=i+96|0;v=n+24|0;s=n+8|0;t=n;u=f+136|0;o=c[u>>2]|0;p=c[f+160>>2]|0;m=c[p+(l<<2)+32>>2]|0;r=f+200|0;T=c[r>>2]|0;h=$(h>>c[T+(l<<2)+13180>>2],m)|0;h=(c[p+(l<<2)>>2]|0)+(h+(g>>c[T+(l<<2)+13168>>2]<>2]))|0;T=(l|0)!=0;g=o+320|0;p=T?o+11680|0:g;x=v+0|0;q=x+64|0;do{a[x>>0]=0;x=x+1|0}while((x|0)<(q|0));S=1<>2]|0;q=S<>0]|0)){A=a[o+272>>0]|0;C=f+204|0;Ma=c[C>>2]|0;if((a[Ma+21>>0]|0)!=0?(d[Ma+1629>>0]|0)>=(j|0):0){F=c[u>>2]|0;F=ab(F+224|0,F+(T&1|46)|0)|0}else F=0;if(y){B=c[r>>2]|0;G=B;B=(c[B+13192>>2]|0)+A|0}else{B=c[C>>2]|0;if((l|0)==1)B=(c[f+2072>>2]|0)+(c[B+28>>2]|0)+(a[o+302>>0]|0)|0;else B=(c[f+2076>>2]|0)+(c[B+32>>2]|0)+(a[o+303>>0]|0)|0;B=B+A|0;G=c[r>>2]|0;A=c[G+13192>>2]|0;E=0-A|0;if((B|0)>=(E|0))E=(B|0)>57?57:B;do if((c[G+4>>2]|0)==1){if((E|0)>=30)if((E|0)>43){E=E+ -6|0;break}else{E=c[176+(E+ -30<<2)>>2]|0;break}}else E=(E|0)>51?51:E;while(0);B=A+E|0}A=(c[G+52>>2]|0)+j|0;E=A+ -5|0;A=1<>0]|0)>>0]<>0];if((a[G+634>>0]|0)!=0?!((F|0)!=0&(j|0)>2):0){H=c[C>>2]|0;G=(a[H+68>>0]|0)==0?G+635|0:H+69|0;H=((c[o+31244>>2]|0)!=1?3:0)+l|0;C=G+((j+ -2|0)*384|0)+(H<<6)|0;if((j|0)>3)ia=a[G+((j+ -4|0)*6|0)+H+1536>>0]|0;else ia=16}else{ia=16;C=0}}else{A=0;ia=0;B=0;C=0;E=0;F=0}I=(j<<1)+ -1|0;if(y){G=(j*3|0)+ -6+(j+ -1>>2)|0;J=j+1>>2}else{G=15;J=j+ -2|0}if((I|0)>0){L=G+52|0;H=0;while(1){Ma=c[u>>2]|0;K=H+1|0;if(!(ab(Ma+224|0,Ma+(L+(H>>J))|0)|0))break;if((K|0)<(I|0))H=K;else{H=K;break}}K=G+70|0;G=0;while(1){Ma=c[u>>2]|0;L=G+1|0;if(!(ab(Ma+224|0,Ma+(K+(G>>J))|0)|0))break;if((L|0)<(I|0))G=L;else{G=L;break}}if((H|0)>3){I=(H>>1)+ -1|0;K=cb((c[u>>2]|0)+224|0)|0;if((I|0)>1){J=1;do{K=cb((c[u>>2]|0)+224|0)|0|K<<1;J=J+1|0}while((J|0)!=(I|0))}H=K+((H&1|2)<3){J=(G>>1)+ -1|0;K=cb((c[u>>2]|0)+224|0)|0;if((J|0)>1){I=1;do{K=cb((c[u>>2]|0)+224|0)|0|K<<1;I=I+1|0}while((I|0)!=(J|0))}I=H;L=K+((G&1|2)<>2;N=L>>2;if((k|0)==1){G=I;H=L;P=d[536+(L<<3)+I>>0]|0;J=488;K=504;L=496;I=520;break}else if(k){J=I;K=L;w=49;break}P=d[(I&3)+(392+((L&3)<<2))>>0]|0;if((S|0)==8){G=I;H=L;P=(d[416+(N<<1)+M>>0]<<4)+P|0;J=496;K=8;L=488;I=24;break}else if((S|0)==16){G=I;H=L;P=(d[392+(N<<2)+M>>0]<<4)+P|0;J=8;K=8;L=24;I=24;break}else if((S|0)==4){G=I;H=L;J=408;K=8;L=408;I=24;break}else{G=I;H=L;P=(d[424+(N<<3)+M>>0]<<4)+P|0;J=40;K=8;L=104;I=24;break}}else{J=L;K=I;M=L>>2;N=I>>2;w=49}while(0);if((w|0)==49){G=J;H=K;P=d[536+(J<<3)+K>>0]|0;J=496;K=520;L=488;I=504}O=P+1|0;P=P>>4;if((P|0)>-1){Q=(1<0;l=R?90:88;S=S+ -1>>2;W=T?27:0;U=(j|0)==2;T=W+3|0;V=(j|0)==3;Z=(k|0)==0?9:15;_=y?0:27;da=(F|0)==0;aa=y?42:43;fa=y?40:41;ba=y?2:0;ea=o+31244|0;ca=x&-17;ga=f+204|0;Y=((B|0)<0)<<31>>31;X=((A|0)<0)<<31>>31;ha=(F|0)!=0&(j|0)>2;k=(j|0)<4;ia=ia&255;ma=(y&1)<<1;ja=ma|1;ra=1;ka=P;oa=0;xa=16;while(1){na=ka<<4;wa=a[J+ka>>0]|0;ta=wa&255;va=a[L+ka>>0]|0;ua=va&255;la=(ka|0)>0;if((ka|0)<(P|0)&la){if((ta|0)<(Q|0))pa=d[v+(ta+1<<3)+ua>>0]|0;else pa=0;if((ua|0)<(Q|0))pa=(d[ua+1+(v+(ta<<3))>>0]|0)+pa|0;ya=c[u>>2]|0;ya=(ab(ya+224|0,ya+(((pa|0)>1?1:pa)+l)|0)|0)&255;a[v+(ta<<3)+ua>>0]=ya;qa=1}else{if(!((ta|0)==(M|0)&(ua|0)==(N|0)))if(!(wa<<24>>24))ya=va<<24>>24==0&1;else ya=0;else ya=1;a[v+(ta<<3)+ua>>0]=ya;qa=0}na=O-na|0;pa=(ka|0)==(P|0);if(pa){a[s>>0]=na+255;sa=na+ -2|0;na=1}else{sa=15;na=0}if((ta|0)<(S|0))za=(a[v+(ta+1<<3)+ua>>0]|0)!=0&1;else za=0;if((ua|0)<(S|0))za=((a[ua+1+(v+(ta<<3))>>0]|0)!=0&1)<<1|za;do if(ya<<24>>24!=0&(sa|0)>-1){if(!(c[(c[r>>2]|0)+13100>>2]|0))if(U){wa=600;va=W}else w=73;else if(da){ya=(a[z>>0]|0)!=0;if(ya|U){wa=ya?664:600;va=ya?fa:W}else w=73}else{wa=664;va=fa}do if((w|0)==73){w=0;ya=(za<<4)+616|0;if(!y){wa=ya;va=W+(V?9:12)|0;break}va=(va|wa)<<24>>24==0?W:T;if(V){wa=ya;va=va+Z|0;break}else{wa=ya;va=va+21|0;break}}while(0);if((sa|0)>0){ya=va+92|0;do{Ma=c[u>>2]|0;if(ab(Ma+224|0,Ma+(ya+(d[wa+((d[I+sa>>0]<<2)+(d[K+sa>>0]|0))>>0]|0))|0)|0){a[s+(na&255)>>0]=sa;qa=0;na=na+1<<24>>24}sa=sa+ -1|0}while((sa|0)>0)}if(qa){a[s+(na&255)>>0]=0;qa=na+1<<24>>24;break}if(c[(c[r>>2]|0)+13100>>2]|0)if(da?(a[z>>0]|0)==0:0)w=87;else qa=aa;else w=87;if((w|0)==87){w=0;qa=(ka|0)==0?_:va+2|0}Ma=c[u>>2]|0;if((ab(Ma+224|0,Ma+(qa+92)|0)|0)==1){a[s+(na&255)>>0]=0;qa=na+1<<24>>24}else qa=na}else qa=na;while(0);na=qa&255;a:do if(qa<<24>>24){qa=la?ba:0;if(!(c[(c[r>>2]|0)+13116>>2]|0))Fa=0;else{if(da?(a[z>>0]|0)==0:0)oa=ma;else oa=ja;Fa=(d[o+oa+199>>0]|0)>>>2}sa=qa|(ra|0)==0&(pa^1)&1;Da=a[s>>0]|0;va=Da&255;qa=na>>>0>8?8:na;if(!qa){pa=-1;ra=1}else{ya=sa<<2;pa=-1;ra=1;wa=0;do{Ma=ra+ya|0;La=c[u>>2]|0;Ma=(ab(La+224|0,La+((R?Ma+16|0:Ma)+136)|0)|0)&255;a[t+wa>>0]=Ma;if(!(Ma<<24>>24))ra=((ra+ -1|0)>>>0<2&1)+ra|0;else{pa=(pa|0)==-1?wa:pa;ra=0}wa=wa+1|0}while((wa|0)<(qa|0))}wa=na+ -1|0;qa=a[s+wa>>0]|0;ya=qa&255;do if(!(a[z>>0]|0)){if((c[ea>>2]|0)==1?!((c[(c[r>>2]|0)+13104>>2]|0)==0|da|(ca|0)!=10):0){va=0;break}va=(va-ya|0)>3&1}else va=0;while(0);if((pa|0)!=-1){La=c[u>>2]|0;La=ab(La+224|0,La+((R?sa|4:sa)|160)|0)|0;Ma=t+pa|0;a[Ma>>0]=(d[Ma>>0]|0)+La}sa=(va|0)==0;if((a[(c[ga>>2]|0)+4>>0]|0)==0|sa){wa=0;va=0;do{va=cb((c[u>>2]|0)+224|0)|0|va<<1;wa=wa+1|0}while((wa|0)<(na|0));za=va<<16-na}else{va=wa&255;if(!((wa&255)<<24>>24))ya=0;else{wa=0;ya=0;do{ya=cb((c[u>>2]|0)+224|0)|0|ya<<1;wa=wa+1|0}while((wa|0)<(va|0))}za=ya<<17-na}ta=ta<<2;va=ua<<2;ua=o+oa+199|0;wa=0;Ha=0;Aa=xa;Ea=0;while(1){xa=Da&255;ya=(d[K+xa>>0]|0)+ta|0;xa=(d[I+xa>>0]|0)+va|0;b:do if((wa|0)<8){Ia=(d[t+wa>>0]|0)+1|0;Ma=(wa|0)==(pa|0);if((Ia|0)==((Ma?3:2)|0)&0==((Ma?0:0)|0))Ja=0;else{Ja=0;break}while(1){Ka=Ja+1|0;if(!(cb((c[u>>2]|0)+224|0)|0)){w=120;break}if((Ka|0)<31)Ja=Ka;else{w=124;break}}do if((w|0)==120){w=0;if((Ja|0)>=3){Ka=Ja;w=124;break}if((Fa|0)>0){Ka=0;La=0;do{La=cb((c[u>>2]|0)+224|0)|0|La<<1;Ka=Ka+1|0}while((Ka|0)!=(Fa|0))}else La=0;Ka=La+(Ja<0){La=Fa+ -3+Ka|0;Ka=0;Ma=0;do{Ma=cb((c[u>>2]|0)+224|0)|0|Ma<<1;Ka=Ka+1|0}while((Ka|0)!=(La|0))}else Ma=0;Ka=Ma+((1<>31|0,Ia|0,0)|0;Ja=D;La=3<>31;Ma=c[(c[r>>2]|0)+13116>>2]|0;do if((Ja|0)>(Na|0)|(Ja|0)==(Na|0)&Ia>>>0>La>>>0){La=Fa+1|0;if(Ma){Fa=La;break}Fa=(Fa|0)>3?4:La;break b}while(0);if(!((Ma|0)!=0&(Ha|0)==0))break;Ha=a[ua>>0]|0;La=(Ha&255)>>>2;if((Ka|0)>=(3<>0]=Ha+1<<24>>24;Ha=1;break}if((Ka<<1|0)>=(1<>24==0){Ha=1;break}a[ua>>0]=Ha+ -1<<24>>24;Ha=1}else{Ia=0;while(1){Ja=Ia+1|0;if(!(cb((c[u>>2]|0)+224|0)|0)){w=138;break}if((Ja|0)<31)Ia=Ja;else{w=142;break}}do if((w|0)==138){w=0;if((Ia|0)>=3){Ja=Ia;w=142;break}if((Fa|0)>0){Ja=0;Ka=0;do{Ka=cb((c[u>>2]|0)+224|0)|0|Ka<<1;Ja=Ja+1|0}while((Ja|0)!=(Fa|0))}else Ka=0;Ka=Ka+(Ia<0){Ka=Fa+ -3+Ja|0;Ja=0;La=0;do{La=cb((c[u>>2]|0)+224|0)|0|La<<1;Ja=Ja+1|0}while((Ja|0)!=(Ka|0))}else La=0;Ka=La+((1<>31;Ma=c[(c[r>>2]|0)+13116>>2]|0;do if((Ka|0)>=(3<3?4:La;break b}while(0);if(!((Ma|0)!=0&(Ha|0)==0))break;La=a[ua>>0]|0;Ha=(La&255)>>>2;if((Ka|0)>=(3<>0]=La+1<<24>>24;Ha=1;break}if((Ka<<1|0)>=(1<>24==0){Ha=1;break}a[ua>>0]=La+ -1<<24>>24;Ha=1}while(0);do if(!((a[(c[ga>>2]|0)+4>>0]|0)==0|sa)){Ea=_d(Ia|0,Ja|0,Ea|0,0)|0;if(Da<<24>>24!=qa<<24>>24)break;Na=(Ea&1|0)==0;Ma=Zd(0,0,Ia|0,Ja|0)|0;Ia=Na?Ia:Ma;Ja=Na?Ja:D}while(0);Na=(za&32768|0)==0;Da=Zd(0,0,Ia|0,Ja|0)|0;Da=Na?Ia:Da;Ia=Na?Ja:D;za=za<<1&131070;Ja=Da&65535;do if(!(a[z>>0]|0)){do if(!((a[(c[r>>2]|0)+634>>0]|0)==0|ha)){if(!((xa|ya|0)!=0|k)){Aa=ia;break}if((j|0)==3)Aa=(xa<<3)+ya|0;else if((j|0)==4)Aa=(xa>>>1<<3)+(ya>>>1)|0;else if((j|0)==5)Aa=(xa>>>2<<3)+(ya>>>2)|0;else Aa=(xa<<2)+ya|0;Aa=d[C+Aa>>0]|0}while(0);Da=he(Da|0,Ia|0,B|0,Y|0)|0;Da=he(Da|0,D|0,Aa|0,((Aa|0)<0)<<31>>31|0)|0;Da=_d(Da|0,D|0,A|0,X|0)|0;Da=Yd(Da|0,D|0,E|0)|0;Ia=D;if((Ia|0)<0){Ja=(Da&-32768|0)==-32768&(Ia&268435455|0)==268435455?Da&65535:-32768;break}else{Ja=Ia>>>0>0|(Ia|0)==0&Da>>>0>32767?32767:Da&65535;break}}while(0);b[p+((xa<>1]=Ja;wa=wa+1|0;if((wa|0)>=(na|0)){xa=Aa;break a}Da=a[s+wa>>0]|0}}while(0);if(la)ka=ka+ -1|0;else break}}do if(a[z>>0]|0){if((c[(c[r>>2]|0)+13104>>2]|0)!=0?(x&-17|0)==10:0)Ga[c[f+2632>>2]&7](p,j&65535,(x|0)==26&1)}else{if(F){if(((j|0)==2?(c[(c[r>>2]|0)+13096>>2]|0)!=0:0)?(c[o+31244>>2]|0)==1:0){s=0;do{La=p+(15-s<<1)|0;Ma=b[La>>1]|0;Na=p+(s<<1)|0;b[La>>1]=b[Na>>1]|0;b[Na>>1]=Ma;s=s+1|0}while((s|0)!=8)}s=j&65535;Ca[c[f+2628>>2]&7](p,s);if(!(c[(c[r>>2]|0)+13104>>2]|0))break;if((c[o+31244>>2]|0)!=1)break;if((x&-17|0)!=10)break;Ga[c[f+2632>>2]&7](p,s,(x|0)==26&1);break}if(y&(c[o+31244>>2]|0)==1&(j|0)==2){Ba[c[f+2636>>2]&7](p);break}r=(G|0)>(H|0)?G:H;if(!r){Ba[c[f+(j+ -2<<2)+2656>>2]&7](p);break}s=H+4+G|0;do if((r|0)>=4){if((r|0)<8){s=(s|0)<8?s:8;break}if((r|0)<12)s=(s|0)<24?s:24}else s=(s|0)<4?s:4;while(0);Ca[c[f+(j+ -2<<2)+2640>>2]&7](p,s)}while(0);if(!(a[o+304>>0]|0)){Na=j+ -2|0;Na=f+(Na<<2)+2612|0;Na=c[Na>>2]|0;Ga[Na&7](h,p,m);i=n;return}if((q|0)<=0){Na=j+ -2|0;Na=f+(Na<<2)+2612|0;Na=c[Na>>2]|0;Ga[Na&7](h,p,m);i=n;return}o=c[o+284>>2]|0;r=0;do{Na=p+(r<<1)|0;b[Na>>1]=(($(b[g+(r<<1)>>1]|0,o)|0)>>>3)+(e[Na>>1]|0);r=r+1|0}while((r|0)!=(q|0));Na=j+ -2|0;Na=f+(Na<<2)+2612|0;Na=c[Na>>2]|0;Ga[Na&7](h,p,m);i=n;return}function Ab(a){a=a|0;var b=0,e=0,f=0;b=i;f=a+16|0;e=c[f>>2]|0;c[a>>2]=(c[a>>2]|0)+ -65535+((d[e+1>>0]|0)<<1|(d[e>>0]|0)<<9);if(e>>>0>=(c[a+20>>2]|0)>>>0){i=b;return}c[f>>2]=e+2;i=b;return}function Bb(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;f=i;h=b+136|0;n=c[h>>2]|0;g=b+200|0;j=c[g>>2]|0;m=c[j+13080>>2]|0;q=(1<>2]|0)+24>>2]|0);o=m&d;p=m&e;k=c[j+13140>>2]|0;j=c[j+13064>>2]|0;l=o>>j;j=p>>j;if(!(q&d))o=0;else o=(o&q|0)!=0;if(!(q&e))p=0;else p=(p&q|0)!=0;q=n+203|0;if((a[q>>0]|0)==0?(m&(e|d)|0)!=0:0)d=c[n+276>>2]|0;else{a[q>>0]=(a[n+300>>0]|0)==0&1;d=a[b+2112>>0]|0}if(o){e=l+ -1+($(j,k)|0)|0;e=a[(c[b+4316>>2]|0)+e>>0]|0}else e=d;if(p){d=($(j+ -1|0,k)|0)+l|0;d=a[(c[b+4316>>2]|0)+d>>0]|0}b=e+1+d>>1;h=c[h>>2]|0;j=c[h+280>>2]|0;if(!j){a[h+272>>0]=b;i=f;return}g=c[(c[g>>2]|0)+13192>>2]|0;b=j+52+b+(g<<1)|0;if((b|0)>0)j=b;else j=-52-g+1+b|0;a[h+272>>0]=b-g-j+((j|0)%(g+52|0)|0);i=f;return}function Cb(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;g=i;j=c[b+136>>2]|0;k=b+200|0;do if((e|0)>0&(e&7|0)==0){if(((a[b+2062>>0]|0)==0?(c[j+31312>>2]&4|0)!=0:0)?((e|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0)break;if(((a[(c[b+204>>2]|0)+53>>0]|0)==0?(c[j+31312>>2]&8|0)!=0:0)?((e|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0)break;h=1<0){l=b+2596|0;m=b+4320|0;n=0;do{o=n+d+($(c[l>>2]|0,e)|0)>>2;a[(c[m>>2]|0)+o>>0]=2;n=n+4|0}while((n|0)<(h|0))}}while(0);if(!((d|0)>0&(d&7|0)==0)){i=g;return}if(((a[b+2062>>0]|0)==0?(c[j+31312>>2]&1|0)!=0:0)?((d|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0){i=g;return}if(((a[(c[b+204>>2]|0)+53>>0]|0)==0?(c[j+31312>>2]&2|0)!=0:0)?((d|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0){i=g;return}h=1<>2]|0,k+e|0)|0)+d>>2;a[(c[b>>2]|0)+o>>0]=2;k=k+4|0}while((k|0)<(h|0));i=g;return}function Db(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var 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,aa=0,ba=0,ca=0,da=0;j=i;i=i+32|0;o=j+8|0;w=j;n=j+18|0;r=j+16|0;l=e+200|0;J=c[l>>2]|0;u=c[J+13120>>2]|0;k=(u-h|0)<=(f|0);b[n>>1]=0;b[r>>1]=0;v=c[J+13080>>2]|0;t=1<>v,c[J+13128>>2]|0)|0)+(f>>v)|0;s=c[e+2508>>2]|0;m=c[s+(v<<3)+4>>2]|0;x=c[s+(v<<3)>>2]|0;if((c[J+68>>2]|0)!=0?(a[J+13056>>0]|0)!=0:0)p=1;else p=(a[(c[e+204>>2]|0)+40>>0]|0)!=0;q=(f|0)!=0;if(q){v=v+ -1|0;y=c[s+(v<<3)>>2]|0;v=c[s+(v<<3)+4>>2]|0}else{y=0;v=0}s=t+f|0;s=(s|0)>(u|0)?u:s;t=t+g|0;z=c[J+13124>>2]|0;t=(t|0)>(z|0)?z:t;z=(s|0)==(u|0)?s:s+ -8|0;u=(t|0)>(g|0);if(u){J=q?f:8;M=(J|0)<(s|0);P=q?f+ -8|0:0;E=e+2596|0;O=e+4320|0;H=e+4316|0;B=w+4|0;C=e+160|0;D=n+1|0;Q=r+1|0;K=e+4300|0;L=e+4284|0;I=e+4324|0;F=e+4304|0;G=e+4288|0;A=(P|0)>=(z|0);T=x;S=m;N=g;do{if(M){R=N+4|0;W=S+ -2&-2;U=J;do{Z=c[E>>2]|0;ba=($(Z,N)|0)+U>>2;_=c[I>>2]|0;ba=a[_+ba>>0]|0;ca=ba&255;Z=a[_+(($(Z,R)|0)+U>>2)>>0]|0;_=Z&255;ba=ba<<24>>24!=0;Z=Z<<24>>24==0;do if(!(Z&(ba^1))){V=U+ -1|0;X=c[l>>2]|0;aa=c[X+13064>>2]|0;Y=$(N>>aa,c[X+13140>>2]|0)|0;da=c[H>>2]|0;aa=(a[da+(Y+(V>>aa))>>0]|0)+1+(a[da+(Y+(U>>aa))>>0]|0)>>1;Y=aa+T|0;if((Y|0)<0)Y=0;else Y=(Y|0)>51?51:Y;Y=d[1280+Y>>0]|0;if(ba){ba=(ca<<1)+W+aa|0;if((ba|0)<0)ba=0;else ba=(ba|0)>53?53:ba;ba=d[1336+ba>>0]|0}else ba=0;c[w>>2]=ba;if(Z)Z=0;else{Z=(_<<1)+W+aa|0;if((Z|0)<0)Z=0;else Z=(Z|0)>53?53:Z;Z=d[1336+Z>>0]|0}c[B>>2]=Z;ca=c[C>>2]|0;Z=c[ca+32>>2]|0;da=$(Z,N)|0;X=(c[ca>>2]|0)+((U<>2])+da)|0;if(p){a[n>>0]=Ib(e,V,N)|0;a[D>>0]=Ib(e,V,R)|0;a[r>>0]=Ib(e,U,N)|0;a[Q>>0]=Ib(e,U,R)|0;Ja[c[F>>2]&3](X,Z,Y,w,n,r);break}else{Ja[c[G>>2]&3](X,Z,Y,w,n,r);break}}while(0);U=U+8|0}while((U|0)<(s|0))}if(!((N|0)==0|A)){R=N+ -1|0;V=S;S=P;do{Y=$(c[E>>2]|0,N)|0;Z=c[O>>2]|0;aa=a[Z+(Y+S>>2)>>0]|0;ba=aa&255;U=S+4|0;Y=a[Z+(Y+U>>2)>>0]|0;Z=Y&255;aa=aa<<24>>24!=0;Y=Y<<24>>24==0;do if(!(Y&(aa^1))){W=c[l>>2]|0;V=c[W+13064>>2]|0;_=S>>V;T=c[W+13140>>2]|0;da=($(R>>V,T)|0)+_|0;X=c[H>>2]|0;_=(a[X+da>>0]|0)+1+(a[X+(($(N>>V,T)|0)+_)>>0]|0)>>1;T=(S|0)>=(f|0);V=T?m:v;T=T?x:y;X=_+T|0;if((X|0)<0)X=0;else X=(X|0)>51?51:X;X=d[1280+X>>0]|0;if(aa){aa=(ba<<1)+(V+ -2&-2)+_|0;if((aa|0)<0)aa=0;else aa=(aa|0)>53?53:aa;aa=d[1336+aa>>0]|0}else aa=0;c[w>>2]=aa;if(Y)Y=0;else{Y=(Z<<1)+(V+ -2&-2)+_|0;if((Y|0)<0)Y=0;else Y=(Y|0)>53?53:Y;Y=d[1336+Y>>0]|0}c[B>>2]=Y;ca=c[C>>2]|0;Y=c[ca+32>>2]|0;da=$(Y,N)|0;W=(c[ca>>2]|0)+((S<>2])+da)|0;if(p){a[n>>0]=Ib(e,S,R)|0;a[D>>0]=Ib(e,U,R)|0;a[r>>0]=Ib(e,S,N)|0;a[Q>>0]=Ib(e,U,N)|0;Ja[c[K>>2]&3](W,Y,X,w,n,r);break}else{Ja[c[L>>2]&3](W,Y,X,w,n,r);break}}while(0);S=S+8|0}while((S|0)<(z|0));S=V}N=N+8|0}while((N|0)<(t|0));J=c[l>>2]|0}else S=m;if(c[J+4>>2]|0){C=q?v:m;F=e+2596|0;D=e+4320|0;v=e+4316|0;x=o+4|0;w=e+160|0;B=n+1|0;A=r+1|0;G=e+4308|0;E=e+4292|0;H=e+4324|0;z=e+4312|0;y=e+4296|0;I=1;do{O=1<>2];P=1<>2];if(u){N=O<<3;L=q?f:N;K=(L|0)<(s|0);J=P<<3;M=q?f-N|0:0;O=O<<2;P=P<<2;Q=g;do{if(K){R=Q+P|0;T=L;do{W=c[F>>2]|0;Y=($(W,Q)|0)+T>>2;da=c[H>>2]|0;Y=(a[da+Y>>0]|0)==2;W=(a[da+(($(W,R)|0)+T>>2)>>0]|0)==2;do if(Y|W){U=T+ -1|0;V=c[l>>2]|0;da=c[V+13064>>2]|0;_=U>>da;X=c[V+13140>>2]|0;Z=$(Q>>da,X)|0;aa=c[v>>2]|0;ba=T>>da;X=$(R>>da,X)|0;X=(a[aa+(X+_)>>0]|0)+1+(a[aa+(X+ba)>>0]|0)>>1;if(Y)Y=Jb(e,(a[aa+(Z+ba)>>0]|0)+1+(a[aa+(Z+_)>>0]|0)>>1,I,S)|0;else Y=0;c[o>>2]=Y;if(W)W=Jb(e,X,I,S)|0;else W=0;c[x>>2]=W;ca=c[w>>2]|0;W=c[ca+(I<<2)+32>>2]|0;da=$(W,Q>>c[V+(I<<2)+13180>>2])|0;V=(c[ca+(I<<2)>>2]|0)+((T>>c[V+(I<<2)+13168>>2]<>2])+da)|0;if(p){a[n>>0]=Ib(e,U,Q)|0;a[B>>0]=Ib(e,U,R)|0;a[r>>0]=Ib(e,T,Q)|0;a[A>>0]=Ib(e,T,R)|0;Aa[c[z>>2]&3](V,W,o,n,r);break}else{Aa[c[y>>2]&3](V,W,o,n,r);break}}while(0);T=T+N|0}while((T|0)<(s|0))}if(Q){U=s-((s|0)==(c[(c[l>>2]|0)+13120>>2]|0)?0:N)|0;if((M|0)<(U|0)){T=Q+ -1|0;S=M;do{W=$(c[F>>2]|0,Q)|0;da=c[D>>2]|0;R=S+O|0;X=(a[da+(W+S>>2)>>0]|0)==2;W=(a[da+(W+R>>2)>>0]|0)==2;do if(X|W){if(X){da=c[l>>2]|0;ca=c[da+13064>>2]|0;Y=S>>ca;da=c[da+13140>>2]|0;aa=($(T>>ca,da)|0)+Y|0;ba=c[v>>2]|0;Y=(a[ba+aa>>0]|0)+1+(a[ba+(($(Q>>ca,da)|0)+Y)>>0]|0)>>1}else Y=0;if(W){da=c[l>>2]|0;ca=c[da+13064>>2]|0;V=R>>ca;da=c[da+13140>>2]|0;aa=($(T>>ca,da)|0)+V|0;ba=c[v>>2]|0;V=(a[ba+aa>>0]|0)+1+(a[ba+(($(Q>>ca,da)|0)+V)>>0]|0)>>1}else V=0;if(X)X=Jb(e,Y,I,C)|0;else X=0;c[o>>2]=X;if(W)V=Jb(e,V,I,m)|0;else V=0;c[x>>2]=V;da=c[l>>2]|0;ca=c[w>>2]|0;V=c[ca+(I<<2)+32>>2]|0;W=$(V,Q>>c[da+13184>>2])|0;W=(c[ca+(I<<2)>>2]|0)+((S>>c[da+13172>>2]<>2])+W)|0;if(p){a[n>>0]=Ib(e,S,T)|0;a[B>>0]=Ib(e,R,T)|0;a[r>>0]=Ib(e,S,Q)|0;a[A>>0]=Ib(e,R,Q)|0;Aa[c[G>>2]&3](W,V,o,n,r);break}else{Aa[c[E>>2]&3](W,V,o,n,r);break}}while(0);S=S+N|0}while((S|0)<(U|0));S=C}else S=C}Q=Q+J|0}while((Q|0)<(t|0))}I=I+1|0;J=c[l>>2]|0}while((I|0)!=3)}if(!(a[J+12941>>0]|0)){if((a[e+140>>0]&1)==0|k^1){i=j;return}i=j;return}n=(c[J+13124>>2]|0)-h|0;l=(g|0)==0;m=(f|0)==0;if(!(l|m))Eb(e,f-h|0,g-h|0);n=(n|0)>(g|0);if(!(m|n))Eb(e,f-h|0,g);k=k^1;!(l|k)?(Eb(e,f,g-h|0),(a[e+140>>0]&1)!=0):0;if(n|k){i=j;return}Eb(e,f,g);if(!(a[e+140>>0]&1)){i=j;return}i=j;return}function Eb(e,f,g){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,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;v=i;i=i+48|0;j=v+24|0;h=v+42|0;u=v+40|0;r=v+16|0;n=v+8|0;m=v;k=e+200|0;S=c[k>>2]|0;s=c[S+13080>>2]|0;q=f>>s;s=g>>s;D=S+13128|0;p=($(s,c[D>>2]|0)|0)+q|0;L=c[e+204>>2]|0;N=L+1668|0;M=c[(c[N>>2]|0)+(p<<2)>>2]|0;l=e+2504|0;o=c[l>>2]|0;t=o+(p*148|0)|0;b[h>>1]=0;b[u>>1]=0;c[r>>2]=0;E=($(c[D>>2]|0,s)|0)+q|0;E=a[(c[e+4352>>2]|0)+E>>0]|0;if((a[L+42>>0]|0)!=0?(a[L+53>>0]|0)==0:0){R=1;O=1}else{R=E<<24>>24==0&1;O=0}G=(q|0)==0;c[j>>2]=G&1;I=(s|0)==0;A=j+4|0;c[A>>2]=I&1;H=(q|0)==((c[D>>2]|0)+ -1|0);z=j+8|0;c[z>>2]=H&1;F=(s|0)==((c[S+13132>>2]|0)+ -1|0);w=j+12|0;c[w>>2]=F&1;if(R<<24>>24){if(G)J=0;else{if(O){J=c[L+1676>>2]|0;J=(c[J+(M<<2)>>2]|0)!=(c[J+(c[(c[N>>2]|0)+(p+ -1<<2)>>2]<<2)>>2]|0)&1}else J=0;if(E<<24>>24==0?(pa=$(c[D>>2]|0,s)|0,oa=c[e+4328>>2]|0,(c[oa+(pa+q<<2)>>2]|0)!=(c[oa+(q+ -1+pa<<2)>>2]|0)):0)K=1;else K=J;a[h>>0]=K}if(H)K=0;else{if(O){K=c[L+1676>>2]|0;K=(c[K+(M<<2)>>2]|0)!=(c[K+(c[(c[N>>2]|0)+(p+1<<2)>>2]<<2)>>2]|0)&1}else K=0;if(E<<24>>24==0?(pa=$(c[D>>2]|0,s)|0,oa=c[e+4328>>2]|0,(c[oa+(pa+q<<2)>>2]|0)!=(c[oa+(q+1+pa<<2)>>2]|0)):0)P=1;else P=K;a[h+1>>0]=P}if(I)P=0;else{if(O){P=c[L+1676>>2]|0;P=(c[P+(M<<2)>>2]|0)!=(c[P+(c[(c[N>>2]|0)+(p-(c[D>>2]|0)<<2)>>2]<<2)>>2]|0)&1}else P=0;if(E<<24>>24==0?(pa=c[D>>2]|0,na=($(pa,s)|0)+q|0,oa=c[e+4328>>2]|0,(c[oa+(na<<2)>>2]|0)!=(c[oa+(($(pa,s+ -1|0)|0)+q<<2)>>2]|0)):0)Q=1;else Q=P;a[u>>0]=Q}if(F)L=0;else{if(O){L=c[L+1676>>2]|0;L=(c[L+(M<<2)>>2]|0)!=(c[L+(c[(c[N>>2]|0)+((c[D>>2]|0)+p<<2)>>2]<<2)>>2]|0)&1}else L=0;if(E<<24>>24==0?(pa=c[D>>2]|0,na=($(pa,s)|0)+q|0,oa=c[e+4328>>2]|0,(c[oa+(na<<2)>>2]|0)!=(c[oa+(($(pa,s+1|0)|0)+q<<2)>>2]|0)):0)M=1;else M=L;a[u+1>>0]=M}if(!G)if(I)B=47;else{if(!(E<<24>>24)){pa=c[D>>2]|0;na=($(pa,s)|0)+q|0;oa=c[e+4328>>2]|0;if(J<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(q+ -1+($(pa,s+ -1|0)|0)<<2)>>2]|0):0)B=38;else M=1}else if(!(J<<24>>24))B=38;else M=1;if((B|0)==38)M=P<<24>>24!=0&1;a[r>>0]=M;B=40}else B=40;if((B|0)==40)if(!I){if(!H){if(!(E<<24>>24)){pa=c[D>>2]|0;na=($(pa,s)|0)+q|0;oa=c[e+4328>>2]|0;if(K<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(q+1+($(pa,s+ -1|0)|0)<<2)>>2]|0):0)B=45;else I=1}else if(!(K<<24>>24))B=45;else I=1;if((B|0)==45)I=P<<24>>24!=0&1;a[r+1>>0]=I;B=47}}else B=47;if((B|0)==47?!(H|F):0){if(!(E<<24>>24)){pa=c[D>>2]|0;na=($(pa,s)|0)+q|0;oa=c[e+4328>>2]|0;if(K<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(q+1+($(pa,s+1|0)|0)<<2)>>2]|0):0)B=51;else H=1}else if(!(K<<24>>24))B=51;else H=1;if((B|0)==51)H=L<<24>>24!=0&1;a[r+2>>0]=H}if(!(G|F)){if(!(E<<24>>24)){pa=c[D>>2]|0;na=($(pa,s)|0)+q|0;oa=c[e+4328>>2]|0;if(J<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(q+ -1+($(pa,s+1|0)|0)<<2)>>2]|0):0)B=57;else D=1}else if(!(J<<24>>24))B=57;else D=1;if((B|0)==57)D=L<<24>>24!=0&1;a[r+3>>0]=D}}O=(c[S+4>>2]|0)!=0?3:1;I=e+160|0;H=e+168|0;P=e+2672|0;J=s<<1;G=J+ -1|0;D=n+4|0;E=s+ -1|0;Q=q+1|0;L=q+ -1|0;J=J+2|0;F=m+4|0;K=s+1|0;N=q<<1;M=N+ -1|0;N=N+2|0;R=e+((R&255)<<2)+2676|0;na=S;Y=0;while(1){ka=c[na+(Y<<2)+13168>>2]|0;_=f>>ka;ha=c[na+(Y<<2)+13180>>2]|0;Z=g>>ha;ba=c[I>>2]|0;S=c[ba+(Y<<2)+32>>2]|0;U=1<>2];X=U>>ka;W=U>>ha;ka=c[na+13120>>2]>>ka;ca=ka-_|0;X=(X|0)>(ca|0)?ca:X;ha=c[na+13124>>2]>>ha;ca=ha-Z|0;W=(W|0)>(ca|0)?ca:W;ca=$(S,Z)|0;ga=c[na+56>>2]|0;ca=(_<>2]|0;aa=ba+ca|0;U=U+2<>2]|0;fa=1<>0]|0;if((ia|0)==1){ea=X<0){da=V;ba=0;ca=aa;while(1){ce(da|0,ca|0,ea|0)|0;ba=ba+1|0;if((ba|0)==(W|0))break;else{da=da+U|0;ca=ca+S|0}}}Gb(e,aa,S,_,Z,X,W,Y,q,s);Ha[c[P>>2]&1](aa,V,S,U,t,j,X,W,Y);Hb(e,aa,V,S,U,f,g,X,W,Y);a[T>>0]=3}else if((ia|0)==2){ja=c[j>>2]|0;ia=c[z>>2]|0;la=c[w>>2]|0;do if(!(c[A>>2]|0)){pa=1-ja|0;oa=pa<>2]=ba+(ca-S-oa);c[D>>2]=(c[e+(Y<<2)+172>>2]|0)+(($(ka,G)|0)+_-pa<>2]|0,E)|0)|0;pa=c[n+(((a[(c[l>>2]|0)+(pa*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0;if(!ga){a[oa>>0]=a[pa>>0]|0;na=c[k>>2]|0;oa=fa;break}else{b[oa>>1]=b[pa>>1]|0;oa=fa;break}}else oa=0;while(0);pa=($(c[na+13128>>2]|0,E)|0)+q|0;na=X<>2]|0)+(pa*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0)+oa|0,na|0)|0;if((ia|0)!=1){na=oa+na|0;pa=Q+($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)|0;ma=da+(na+ma)|0;na=(c[n+(((a[(c[l>>2]|0)+(pa*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0)+na|0;if(!ga){a[ma>>0]=a[na>>0]|0;break}else{b[ma>>1]=b[na>>1]|0;break}}}while(0);do if(!la){pa=1-ja|0;oa=pa<>2]=ba+(($(W,S)|0)+ca-oa);c[F>>2]=(c[e+(Y<<2)+172>>2]|0)+(($(ka,J)|0)+_-pa<>2]|0)+13128>>2]|0,K)|0)|0;ma=c[m+(((a[(c[l>>2]|0)+(ma*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0;if(!ga){a[ka>>0]=a[ma>>0]|0;ka=fa;break}else{b[ka>>1]=b[ma>>1]|0;ka=fa;break}}else ka=0;while(0);pa=($(c[(c[k>>2]|0)+13128>>2]|0,K)|0)+q|0;ma=X<>2]|0)+(pa*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0)+ka|0,ma|0)|0;if((ia|0)!=1){ka=ka+ma|0;pa=Q+($(c[(c[k>>2]|0)+13128>>2]|0,K)|0)|0;la=da+(ka+la)|0;ka=(c[m+(((a[(c[l>>2]|0)+(pa*148|0)+Y+142>>0]|0)==3&1)<<2)>>2]|0)+ka|0;if(!ga){a[la>>0]=a[ka>>0]|0;break}else{b[la>>1]=b[ka>>1]|0;break}}}while(0);do if(!ja){pa=L+($(c[(c[k>>2]|0)+13128>>2]|0,s)|0)|0;if((a[(c[l>>2]|0)+(pa*148|0)+Y+142>>0]|0)==3){la=da+U|0;ja=(c[e+(Y<<2)+184>>2]|0)+(($(ha,M)|0)+Z<0;if(!ga){if(ka)ka=0;else{ja=0;break}while(1){a[la>>0]=a[ja>>0]|0;ka=ka+1|0;if((ka|0)==(W|0)){ja=0;break}else{la=la+U|0;ja=ja+fa|0}}}else{if(ka)ka=0;else{ja=0;break}while(1){b[la>>1]=b[ja>>1]|0;ka=ka+1|0;if((ka|0)==(W|0)){ja=0;break}else{la=la+U|0;ja=ja+fa|0}}}}else ja=1}else ja=0;while(0);do if(!ia){pa=Q+($(c[(c[k>>2]|0)+13128>>2]|0,s)|0)|0;if((a[(c[l>>2]|0)+(pa*148|0)+Y+142>>0]|0)==3){ia=da+((X<>2]|0)+(($(ha,N)|0)+Z<0;if(!ga){if(ka)B=0;else break;while(1){a[ia>>0]=a[ha>>0]|0;B=B+1|0;if((B|0)==(W|0)){C=0;B=96;break}else{ia=ia+U|0;ha=ha+fa|0}}}else{if(ka)B=0;else break;while(1){b[ia>>1]=b[ha>>1]|0;B=B+1|0;if((B|0)==(W|0)){C=0;B=96;break}else{ia=ia+U|0;ha=ha+fa|0}}}}else{C=1;B=96}}else{C=0;B=96}while(0);if((B|0)==96?(B=0,x=ja<0):0){ea=da+(ea-x)|0;da=0;ba=ba+(ca-x)|0;while(1){ce(ea|0,ba|0,y|0)|0;da=da+1|0;if((da|0)==(W|0))break;else{ea=ea+U|0;ba=ba+S|0}}}Gb(e,aa,S,_,Z,X,W,Y,q,s);Ea[c[R>>2]&3](aa,V,S,U,t,j,X,W,Y,h,u,r);Hb(e,aa,V,S,U,f,g,X,W,Y);a[T>>0]=3}Y=Y+1|0;if((Y|0)>=(O|0))break;na=c[k>>2]|0}i=v;return}function Fb(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;h=c[a+200>>2]|0;k=((c[h+13120>>2]|0)-e|0)>(b|0);h=((c[h+13124>>2]|0)-e|0)>(d|0);j=(d|0)==0;g=(b|0)==0;if(!(j|g))Db(a,b-e|0,d-e|0,e);if(!(j|k))Db(a,b,d-e|0,e);if(g|h){i=f;return}Db(a,b-e|0,d,e);i=f;return}function Gb(d,e,f,g,h,j,k,l,m,n){d=d|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;n=n|0;var o=0,p=0,q=0,r=0,s=0,t=0,u=0;o=i;q=c[d+200>>2]|0;p=c[q+56>>2]|0;s=c[q+13120>>2]>>c[q+(l<<2)+13168>>2];q=c[q+13124>>2]>>c[q+(l<<2)+13180>>2];u=d+(l<<2)+172|0;t=n<<1;r=j<>2]|0)+(($(s,t)|0)+g<>2]|0)+(($(s,t|1)|0)+g<>2]|0;l=m<<1;t=r+(($(q,l)|0)+h<0;if(n){if(g){r=t;t=0;s=e;while(1){a[r>>0]=a[s>>0]|0;t=t+1|0;if((t|0)==(k|0))break;else{r=r+m|0;s=s+f|0}}r=c[d>>2]|0}}else if(g){d=0;s=e;while(1){b[t>>1]=b[s>>1]|0;d=d+1|0;if((d|0)==(k|0))break;else{t=t+m|0;s=s+f|0}}}h=r+(($(q,l|1)|0)+h<>0]=a[j>>0]|0;p=p+1|0;if((p|0)==(k|0))break;else{h=h+m|0;j=j+f|0}}i=o;return}else{if(g)p=0;else{i=o;return}while(1){b[h>>1]=b[j>>1]|0;p=p+1|0;if((p|0)==(k|0))break;else{h=h+m|0;j=j+f|0}}i=o;return}}function Hb(b,d,e,f,g,h,j,k,l,m){b=b|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;m=m|0;var 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;n=i;t=c[b+200>>2]|0;if(!(a[(c[b+204>>2]|0)+40>>0]|0)){if(!(a[t+13056>>0]|0)){i=n;return}if(!(c[t+68>>2]|0)){i=n;return}}p=b+200|0;C=c[t+13084>>2]|0;v=1<>2]|0;s=c[t+(m<<2)+13180>>2]|0;m=h>>C;z=j>>C;k=k+h>>C;l=l+j>>C;t=v>>o<>2];if((z|0)>=(l|0)){i=n;return}u=(m|0)<(k|0);b=b+4348|0;v=v>>s;w=(v|0)>0;do{if(u){x=z-j|0;y=m;do{A=c[p>>2]|0;C=($(c[A+13156>>2]|0,z)|0)+y|0;if((a[(c[b>>2]|0)+C>>0]|0)!=0?(r=c[A+13084>>2]|0,q=x<>s,r=y-h<>o<>2],w):0){C=e+(($(q,g)|0)+r)|0;A=0;B=d+(($(q,f)|0)+r)|0;while(1){ce(B|0,C|0,t|0)|0;A=A+1|0;if((A|0)==(v|0))break;else{C=C+g|0;B=B+f|0}}}y=y+1|0}while((y|0)!=(k|0))}z=z+1|0}while((z|0)!=(l|0));i=n;return}function Ib(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;f=i;g=c[a+200>>2]|0;h=c[g+13084>>2]|0;if((e|b|0)<0){e=2;i=f;return e|0}b=b>>h;e=e>>h;h=c[g+13156>>2]|0;if((b|0)>=(h|0)){e=2;i=f;return e|0}if((e|0)>=(c[g+13160>>2]|0)){e=2;i=f;return e|0}e=($(h,e)|0)+b|0;e=d[(c[a+4348>>2]|0)+e>>0]|0;i=f;return e|0}function Jb(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0;h=i;j=c[b+204>>2]|0;e=(c[((f|0)==1?j+28|0:j+32|0)>>2]|0)+e|0;if((e|0)<0)e=0;else e=(e|0)>57?57:e;do if((c[(c[b+200>>2]|0)+4>>2]|0)==1){if((e|0)>=30)if((e|0)>43){e=e+ -6|0;break}else{e=d[1392+(e+ -30)>>0]|0;break}}else if((e|0)<0)e=0;else e=(e|0)>51?51:e;while(0);g=g+2+e|0;if((g|0)<0){j=0;j=1336+j|0;j=a[j>>0]|0;j=j&255;i=h;return j|0}j=(g|0)>53?53:g;j=1336+j|0;j=a[j>>0]|0;j=j&255;i=h;return j|0}function Kb(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;g=i;k=b+4376|0;c[k>>2]=0;a:do if((e|0)>1){m=0;while(1){if(!(a[d+m>>0]|0)){if((m|0)>0){l=m+ -1|0;l=(a[d+l>>0]|0)==0?l:m}else l=m;m=l+2|0;if(((m|0)<(e|0)?(a[d+(l+1)>>0]|0)==0:0)?(j=a[d+m>>0]|0,(j&255)<4):0)break}else l=m;m=l+2|0;if((l+3|0)>=(e|0))break a}m=l;e=j<<24>>24==3?e:l}else m=0;while(0);if((m|0)>=(e+ -1|0)){c[f+12>>2]=d;c[f+8>>2]=e;q=e;i=g;return q|0}od(f,f+4|0,e+32|0);j=c[f>>2]|0;if(!j){q=-12;i=g;return q|0}ce(j|0,d|0,m|0)|0;o=m+2|0;b:do if((o|0)<(e|0)){l=b+4384|0;b=b+4380|0;n=m;c:while(1){p=d+o|0;q=a[p>>0]|0;do if((q&255)<=3){p=a[d+m>>0]|0;if(!(p<<24>>24))if(!(a[d+(m+1)>>0]|0)){if(q<<24>>24!=3){e=m;break b}o=n+1|0;a[j+n>>0]=0;n=n+2|0;a[j+o>>0]=0;m=m+3|0;q=(c[k>>2]|0)+1|0;c[k>>2]=q;p=c[l>>2]|0;if((p|0)<(q|0)){p=p<<1;c[l>>2]=p;md(b,p,4)|0;p=c[b>>2]|0;if(!p){f=-12;break c}}else{p=c[b>>2]|0;if(!p)break}c[p+((c[k>>2]|0)+ -1<<2)>>2]=o}else{p=0;h=26}else h=26}else{a[j+n>>0]=a[d+m>>0]|0;a[j+(n+1)>>0]=a[d+(m+1)>>0]|0;p=a[p>>0]|0;n=n+2|0;m=o;h=26}while(0);if((h|0)==26){h=0;a[j+n>>0]=p;n=n+1|0;m=m+1|0}o=m+2|0;if((o|0)>=(e|0)){h=15;break b}}i=g;return f|0}else{n=m;h=15}while(0);if((h|0)==15)if((m|0)<(e|0)){h=e+n|0;k=m;while(1){a[j+n>>0]=a[d+k>>0]|0;k=k+1|0;if((k|0)==(e|0))break;else n=n+1|0}n=h-m|0}else e=m;h=j+n+0|0;d=h+32|0;do{a[h>>0]=0;h=h+1|0}while((h|0)<(d|0));c[f+12>>2]=j;c[f+8>>2]=n;q=e;i=g;return q|0}function Lb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;f=b+60|0;d=c[f>>2]|0;$c();cc();f=c[f>>2]|0;c[f+4>>2]=b;g=nd(31328)|0;c[f+136>>2]=g;if((((g|0)!=0?(c[f+72>>2]=g,c[f+8>>2]=f,g=hd(199)|0,c[f+152>>2]=g,(g|0)!=0):0)?(g=xd()|0,c[f+164>>2]=g,(g|0)!=0):0)?(h=xd()|0,c[f+2524>>2]=h,(h|0)!=0):0){c[f+2528>>2]=h;c[f+2592>>2]=2147483647;a[f+4469>>0]=1;c[f+2584>>2]=0;c[d+4368>>2]=0;c[d+4520>>2]=0;f=b+808|0;if(!(c[f>>2]&2))a[d+141>>0]=1;else a[d+141>>0]=c[b+800>>2];if((c[f>>2]&1|0)!=0?(c[b+800>>2]|0)>1:0){a[d+140>>0]=1;h=0;i=e;return h|0}a[d+140>>0]=2;h=0;i=e;return h|0}Nb(b)|0;h=-12;i=e;return h|0}function Mb(f,g,h,j){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,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,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,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0;k=i;i=i+16|0;m=k+8|0;n=k;l=c[f+60>>2]|0;f=j+28|0;J=c[f>>2]|0;if(!J){g=bc(l,g,1)|0;if((g|0)<0){Za=g;i=k;return Za|0}c[h>>2]=g;Za=0;i=k;return Za|0}q=l+2520|0;c[q>>2]=0;I=c[j+24>>2]|0;c[q>>2]=0;F=l+2584|0;z=l+2588|0;c[z>>2]=c[F>>2];c[F>>2]=0;v=l+4408|0;c[v>>2]=0;a:do if((J|0)>3){G=l+4470|0;E=l+4412|0;y=l+4404|0;u=l+4388|0;B=l+4396|0;w=l+4392|0;C=l+4384|0;x=l+4380|0;j=l+4376|0;t=l+136|0;s=l+2512|0;H=l+4480|0;while(1){A=(a[G>>0]|0)==0;if(A){while(1){K=I+1|0;if(((a[I>>0]|0)==0?(a[K>>0]|0)==0:0)?(a[I+2>>0]|0)==1:0)break;if((J|0)<5){p=-1094995529;o=180;break a}I=K;J=J+ -1|0}I=I+3|0;L=0;J=J+ -3|0}else{K=c[H>>2]|0;if((K|0)>0){M=0;L=0;do{M=d[I+L>>0]|M<<8;L=L+1|0}while((L|0)!=(K|0));L=M}else L=0;J=J-K|0;if((L|0)>(J|0)){p=-1094995529;o=180;break a}I=I+K|0}A=A?J:L;K=c[E>>2]|0;M=c[v>>2]|0;if((K|0)<(M+1|0)){K=K+1|0;L=ld(c[y>>2]|0,K,16)|0;if(!L){p=-12;o=180;break a}c[y>>2]=L;M=c[E>>2]|0;ae(L+(M<<4)|0,0,K-M<<4|0)|0;md(u,K,4)|0;md(B,K,4)|0;md(w,K,4)|0;M=c[B>>2]|0;c[M+(c[E>>2]<<2)>>2]=1024;M=pd(c[M+(c[E>>2]<<2)>>2]|0,4)|0;c[(c[w>>2]|0)+(c[E>>2]<<2)>>2]=M;c[E>>2]=K;M=c[v>>2]|0}c[C>>2]=c[(c[B>>2]|0)+(M<<2)>>2];c[x>>2]=c[(c[w>>2]|0)+(M<<2)>>2];L=c[y>>2]|0;K=Kb(l,I,A,L+(M<<4)|0)|0;c[(c[u>>2]|0)+(c[v>>2]<<2)>>2]=c[j>>2];c[(c[B>>2]|0)+(c[v>>2]<<2)>>2]=c[C>>2];Ya=c[x>>2]|0;Za=c[v>>2]|0;c[v>>2]=Za+1;c[(c[w>>2]|0)+(Za<<2)>>2]=Ya;if((K|0)<0){p=K;o=180;break a}Ya=c[t>>2]|0;Wa=c[L+(M<<4)+12>>2]|0;Xa=c[L+(M<<4)+8>>2]|0;Xa=Xa>>>0>268435455?-8:Xa<<3;Za=Xa>>>0>2147483639|(Wa|0)==0;Xa=Za?0:Xa;Wa=Za?0:Wa;A=Za?-1094995529:0;c[Ya+204>>2]=Wa;c[Ya+216>>2]=Xa;c[Ya+220>>2]=Xa+8;c[Ya+208>>2]=Wa+(Xa>>3);c[Ya+212>>2]=0;if(Za){p=A;o=180;break a}Qb(l)|0;if(((c[s>>2]|0)+ -36|0)>>>0<2)c[F>>2]=1;J=J-K|0;if((J|0)<=3)break;else I=I+K|0}if((c[v>>2]|0)>0){ka=l+4|0;za=l+1448|0;aa=l+2046|0;Z=l+1428|0;ya=l+204|0;pa=l+200|0;Ha=l+1449|0;Ia=l+1432|0;Ma=l+1436|0;Na=l+2580|0;Fa=l+156|0;Ba=l+1440|0;H=l+1450|0;K=l+1620|0;oa=l+2572|0;J=l+2516|0;L=l+2576|0;V=l+2056|0;W=l+2057|0;M=l+2058|0;O=l+2052|0;N=l+2048|0;Ka=l+2068|0;R=l+2072|0;P=l+2076|0;S=l+2080|0;X=l+2061|0;U=l+2084|0;T=l+2088|0;Y=l+2062|0;I=l+1451|0;La=l+2108|0;Ga=l+2112|0;Ja=l+2500|0;Aa=l+2592|0;la=l+2604|0;ma=l+4416|0;B=m+4|0;qa=l+4320|0;ta=l+2596|0;ra=l+2600|0;ua=l+4324|0;va=l+4344|0;wa=l+4348|0;xa=l+4328|0;na=l+160|0;Ea=l+140|0;Ca=l+164|0;_=l+2096|0;Q=l+2100|0;E=l+2104|0;F=l+141|0;G=l+4368|0;ca=l+2504|0;ba=l+2508|0;ea=l+4332|0;da=l+4336|0;fa=l+4340|0;ha=l+4352|0;ga=l+4316|0;ia=l+2608|0;Oa=l+196|0;Pa=l+4364|0;ja=l+168|0;C=0;b:while(1){c[j>>2]=c[(c[u>>2]|0)+(C<<2)>>2];c[x>>2]=c[(c[w>>2]|0)+(C<<2)>>2];Ya=c[y>>2]|0;Xa=c[Ya+(C<<4)+12>>2]|0;Ya=c[Ya+(C<<4)+8>>2]|0;Za=c[t>>2]|0;Ya=Ya>>>0>268435455?-8:Ya<<3;Qa=Ya>>>0>2147483639|(Xa|0)==0;Ya=Qa?0:Ya;Xa=Qa?0:Xa;c[Za+204>>2]=Xa;c[Za+216>>2]=Ya;c[Za+220>>2]=Ya+8;c[Za+208>>2]=Xa+(Ya>>3);c[Za+212>>2]=0;c:do if(Qa){r=Qa?-1094995529:0;o=178}else{Qa=Qb(l)|0;d:do if((Qa|0)>=0){if(!Qa)break c;switch(c[s>>2]|0){case 9:case 8:case 7:case 6:case 21:case 20:case 19:case 18:case 17:case 16:case 5:case 4:case 3:case 2:case 0:case 1:{Qa=c[t>>2]|0;Ra=Qa+204|0;Za=(dd(Ra)|0)&255;a[za>>0]=Za;Sa=c[s>>2]|0;if(!((Sa+ -16|0)>>>0>4|Za<<24>>24==0)?(b[Pa>>1]=(e[Pa>>1]|0)+1&255,c[Aa>>2]=2147483647,(Sa+ -19|0)>>>0<2):0){_b(l);Sa=c[s>>2]|0}a[aa>>0]=0;if((Sa+ -16|0)>>>0<8)a[aa>>0]=dd(Ra)|0;Sa=fd(Ra)|0;c[Z>>2]=Sa;if(Sa>>>0>255){p=A;o=180;break a}Sa=c[l+(Sa<<2)+400>>2]|0;if(!Sa){p=A;o=180;break a}if(!(a[za>>0]|0)){Va=c[Sa+4>>2]|0;if((c[ya>>2]|0)!=(Va|0)){p=A;o=180;break a}}else Va=c[Sa+4>>2]|0;c[ya>>2]=Va;Ta=c[s>>2]|0;Ua=(Ta|0)==21;if(Ua?(c[z>>2]|0)==1:0)a[aa>>0]=1;Sa=c[pa>>2]|0;Va=c[(c[l+(c[Va>>2]<<2)+272>>2]|0)+4>>2]|0;if((Sa|0)!=(Va|0)){c[pa>>2]=Va;e:do if(Sa){if((Ta+ -16|0)>>>0>7|Ua)break;do if((c[Va+13120>>2]|0)==(c[Sa+13120>>2]|0)){if((c[Va+13124>>2]|0)!=(c[Sa+13124>>2]|0))break;if((c[Va+76+(((c[Va+72>>2]|0)+ -1|0)*12|0)>>2]|0)==(c[Sa+(((c[Sa+72>>2]|0)+ -1|0)*12|0)+76>>2]|0))break e}while(0);a[aa>>0]=0}while(0);_b(l);Sa=c[pa>>2]|0;Pb(l);Ua=c[Sa+13064>>2]|0;Va=Sa+13120|0;$a=c[Va>>2]|0;Wa=Sa+13124|0;_a=c[Wa>>2]|0;Ua=$((_a>>Ua)+1|0,($a>>Ua)+1|0)|0;Ta=$(c[Sa+13132>>2]|0,c[Sa+13128>>2]|0)|0;Za=Sa+13156|0;Ya=Sa+13160|0;Xa=$(c[Ya>>2]|0,c[Za>>2]|0)|0;c[ta>>2]=($a>>2)+1;c[ra>>2]=(_a>>2)+1;c[ca>>2]=qd(Ta,148)|0;_a=qd(Ta,8)|0;c[ba>>2]=_a;if((c[ca>>2]|0)==0|(_a|0)==0){o=71;break b}_a=Sa+13144|0;$a=Sa+13140|0;c[ea>>2]=hd($(c[$a>>2]|0,c[_a>>2]|0)|0)|0;$a=pd(c[_a>>2]|0,c[$a>>2]|0)|0;c[da>>2]=$a;if((c[ea>>2]|0)==0|($a|0)==0){o=71;break b}c[va>>2]=pd(c[Sa+13148>>2]|0,c[Sa+13152>>2]|0)|0;c[fa>>2]=nd(Xa)|0;Xa=hd($((c[Ya>>2]|0)+1|0,(c[Za>>2]|0)+1|0)|0)|0;c[wa>>2]=Xa;if(!(c[fa>>2]|0)){o=71;break b}if((c[va>>2]|0)==0|(Xa|0)==0){o=71;break b}c[ha>>2]=hd(Ta)|0;c[xa>>2]=pd(Ua,4)|0;$a=pd(Ua,1)|0;c[ga>>2]=$a;if(!$a){o=71;break b}if(!(c[ha>>2]|0)){o=71;break b}if(!(c[xa>>2]|0)){o=71;break b}c[qa>>2]=qd(c[ta>>2]|0,c[ra>>2]|0)|0;$a=qd(c[ta>>2]|0,c[ra>>2]|0)|0;c[ua>>2]=$a;if((c[qa>>2]|0)==0|($a|0)==0){o=71;break b}$a=c[ka>>2]|0;c[$a+124>>2]=c[Va>>2];c[$a+128>>2]=c[Wa>>2];c[$a+116>>2]=c[Sa+12>>2];c[$a+120>>2]=c[Sa+16>>2];c[$a+136>>2]=c[Sa+60>>2];c[$a+172>>2]=c[Sa+(((c[Sa+72>>2]|0)+ -1|0)*12|0)+80>>2];$a=Sa+160|0;c[m+0>>2]=c[$a+0>>2];c[m+4>>2]=c[$a+4>>2];if(!(c[Sa+176>>2]|0)){Ta=c[ka>>2]|0;c[Ta+392>>2]=1}else{Ta=c[ka>>2]|0;c[Ta+392>>2]=(c[Sa+184>>2]|0)!=0?2:1}if(!(c[Sa+188>>2]|0)){c[Ta+380>>2]=2;c[Ta+384>>2]=2;c[Ta+388>>2]=2}else{c[Ta+380>>2]=d[Sa+192>>0];c[Ta+384>>2]=d[Sa+193>>0];c[Ta+388>>2]=d[Sa+194>>0]}dc(ia,c[Sa+52>>2]|0);if(a[Sa+12941>>0]|0){Ta=c[pa>>2]|0;Ua=(c[Ta+4>>2]|0)!=0?3:1;$a=(1<>2])+2|0;$a=$($a,$a)|0;c[ja>>2]=hd($a<>2])|0;Ta=0;do{$a=c[pa>>2]|0;_a=c[$a+13124>>2]>>c[$a+(Ta<<2)+13180>>2];Za=$(c[$a+13120>>2]>>c[$a+(Ta<<2)+13168>>2]<<1,c[$a+13132>>2]|0)|0;c[l+(Ta<<2)+172>>2]=hd(Za<>2])|0;$a=c[pa>>2]|0;_a=$(_a<<1,c[$a+13128>>2]|0)|0;c[l+(Ta<<2)+184>>2]=hd(_a<>2])|0;Ta=Ta+1|0}while((Ta|0)<(Ua|0))}c[pa>>2]=Sa;c[Oa>>2]=c[(c[l+(c[Sa>>2]<<2)+208>>2]|0)+4>>2];b[Pa>>1]=(e[Pa>>1]|0)+1&255;c[Aa>>2]=2147483647}$a=c[ka>>2]|0;c[$a+832>>2]=d[Sa+302>>0];c[$a+836>>2]=d[Sa+335>>0];a[Ha>>0]=0;do if(!(a[za>>0]|0)){if(a[(c[ya>>2]|0)+41>>0]|0){a[Ha>>0]=dd(Ra)|0;Sa=c[pa>>2]|0}Sa=($(c[Sa+13128>>2]<<1,c[Sa+13132>>2]|0)|0)+ -2|0;Ta=Sa>>>0>65535;Sa=Ta?Sa>>>16:Sa;Ta=Ta?16:0;if(Sa&65280){Ta=Ta|8;Sa=Sa>>>8}Sa=ad(Ra,(d[4680+Sa>>0]|0)+Ta|0)|0;c[Ia>>2]=Sa;$a=c[pa>>2]|0;if(Sa>>>0>=($(c[$a+13132>>2]|0,c[$a+13128>>2]|0)|0)>>>0){p=A;o=180;break a}if(a[Ha>>0]|0)if(!(a[Fa>>0]|0)){p=A;o=180;break a}else break;else{c[Ma>>2]=Sa;c[Na>>2]=(c[Na>>2]|0)+1;o=82;break}}else{c[Ma>>2]=0;c[Ia>>2]=0;c[Na>>2]=0;a[Fa>>0]=0;o=82}while(0);f:do if((o|0)==82){o=0;a[Fa>>0]=0;if((c[(c[ya>>2]|0)+1624>>2]|0)>0){Sa=0;do{cd(Ra,1);Sa=Sa+1|0}while((Sa|0)<(c[(c[ya>>2]|0)+1624>>2]|0))}Sa=fd(Ra)|0;c[Ba>>2]=Sa;if(Sa>>>0>=3){p=A;o=180;break a}if(!((Sa|0)==2?1:((c[s>>2]|0)+ -16|0)>>>0>7)){p=A;o=180;break a}a[H>>0]=1;if(a[(c[ya>>2]|0)+39>>0]|0)a[H>>0]=dd(Ra)|0;if(a[(c[pa>>2]|0)+8>>0]|0)a[I>>0]=ad(Ra,2)|0;if(((c[s>>2]|0)+ -19|0)>>>0>=2){o=91;break b}c[K>>2]=0;c[oa>>2]=0;if(!(c[J>>2]|0))c[L>>2]=0;do if(a[(c[pa>>2]|0)+12941>>0]|0){a[V>>0]=dd(Ra)|0;if(!(c[(c[pa>>2]|0)+4>>2]|0)){a[W>>0]=0;a[M>>0]=0;break}else{$a=(dd(Ra)|0)&255;a[M>>0]=$a;a[W>>0]=$a;break}}else{a[V>>0]=0;a[W>>0]=0;a[M>>0]=0}while(0);c[O>>2]=0;c[N>>2]=0;c[Ka>>2]=gd(Ra)|0;Sa=c[ya>>2]|0;if(!(a[Sa+36>>0]|0)){c[R>>2]=0;c[P>>2]=0}else{c[R>>2]=gd(Ra)|0;c[P>>2]=gd(Ra)|0;Sa=c[ya>>2]|0}if(!(a[Sa+1631>>0]|0))a[S>>0]=0;else{a[S>>0]=dd(Ra)|0;Sa=c[ya>>2]|0}g:do if(!(a[Sa+55>>0]|0)){a[X>>0]=0;c[U>>2]=0;c[T>>2]=0}else{do if(a[Sa+56>>0]|0){if(!(dd(Ra)|0)){Sa=c[ya>>2]|0;break}$a=(dd(Ra)|0)&255;a[X>>0]=$a;if($a<<24>>24)break g;c[U>>2]=(gd(Ra)|0)<<1;c[T>>2]=(gd(Ra)|0)<<1;break g}while(0);a[X>>0]=a[Sa+57>>0]|0;c[U>>2]=c[Sa+60>>2];c[T>>2]=c[Sa+64>>2]}while(0);Sa=a[(c[ya>>2]|0)+54>>0]|0;h:do if(Sa<<24>>24){do if(!(a[V>>0]|0)){if(a[W>>0]|0)break;if(a[X>>0]|0)break h}while(0);a[Y>>0]=dd(Ra)|0;break f}while(0);a[Y>>0]=Sa}while(0);c[La>>2]=0;$a=c[ya>>2]|0;if(!((a[$a+42>>0]|0)==0?(a[$a+43>>0]|0)==0:0))o=122;i:do if((o|0)==122){o=0;$a=fd(Ra)|0;c[La>>2]=$a;if(($a|0)<=0){c[G>>2]=0;break}Sa=(fd(Ra)|0)+1|0;Ta=Sa>>4;Sa=Sa&15;kd(_);kd(Q);kd(E);c[_>>2]=pd(c[La>>2]|0,4)|0;c[Q>>2]=pd(c[La>>2]|0,4)|0;Ua=pd(c[La>>2]|0,4)|0;c[E>>2]=Ua;if(!(c[_>>2]|0)){o=127;break b}if((c[Q>>2]|0)==0|(Ua|0)==0){o=127;break b}if((c[La>>2]|0)>0){Va=(Ta|0)>0;Wa=(Sa|0)==0;Ua=0;do{if(Va){Xa=0;Ya=0;do{Ya=(ad(Ra,16)|0)+(Ya<<16)|0;Xa=Xa+1|0}while((Xa|0)!=(Ta|0))}else Ya=0;if(!Wa)Ya=(ad(Ra,Sa)|0)+(Ya<>2]|0)+(Ua<<2)>>2]=Ya+1;Ua=Ua+1|0}while((Ua|0)<(c[La>>2]|0))}do if((d[F>>0]|0)>1){$a=c[ya>>2]|0;if((c[$a+48>>2]|0)<=1?(c[$a+44>>2]|0)<=1:0)break;c[G>>2]=0;a[F>>0]=1;break i}while(0);c[G>>2]=0}while(0);Sa=c[ya>>2]|0;if(a[Sa+1628>>0]|0){Sa=fd(Ra)|0;_a=be(Sa|0,0,3)|0;Ya=D;$a=(c[Qa+216>>2]|0)-(c[Qa+212>>2]|0)|0;Za=(($a|0)<0)<<31>>31;if((Ya|0)>(Za|0)|(Ya|0)==(Za|0)&_a>>>0>$a>>>0){p=A;o=180;break a}if(Sa){Ta=0;do{cd(Ra,8);Ta=Ta+1|0}while((Ta|0)!=(Sa|0))}Sa=c[ya>>2]|0}Ra=(c[Sa+16>>2]|0)+26+(c[Ka>>2]|0)|0;a[Ga>>0]=Ra;Ra=Ra<<24;if((Ra|0)>855638016){p=A;o=180;break a}if((Ra>>24|0)<(0-(c[(c[pa>>2]|0)+13192>>2]|0)|0)){p=A;o=180;break a}$a=c[Ia>>2]|0;c[Ja>>2]=$a;if(($a|0)==0?(a[Ha>>0]|0)!=0:0){p=A;o=180;break a}if(((c[Qa+216>>2]|0)-(c[Qa+212>>2]|0)|0)<0){p=A;o=180;break a}a[(c[t>>2]|0)+203>>0]=(a[Ha>>0]|0)==0&1;if(!(a[(c[ya>>2]|0)+22>>0]|0))a[(c[t>>2]|0)+272>>0]=a[Ga>>0]|0;a[Fa>>0]=1;a[(c[t>>2]|0)+302>>0]=0;a[(c[t>>2]|0)+303>>0]=0;Ra=c[Aa>>2]|0;Qa=c[s>>2]|0;j:do if((Ra|0)==2147483647)switch(Qa|0){case 18:case 16:case 17:case 21:{Ra=c[oa>>2]|0;c[Aa>>2]=Ra;break j};case 20:case 19:{c[Aa>>2]=-2147483648;Ra=-2147483648;break j};default:{Ra=2147483647;break j}}while(0);do if((Qa+ -8|0)>>>0<2){if((c[oa>>2]|0)<=(Ra|0)){c[la>>2]=0;break c}if((Qa|0)!=9)break;c[Aa>>2]=-2147483648}while(0);k:do if(!(a[za>>0]|0)){if(!(c[q>>2]|0)){Qa=0;break d}}else{Ra=c[t>>2]|0;_a=c[pa>>2]|0;Qa=c[_a+13064>>2]|0;$a=c[_a+13120>>2]>>Qa;Qa=(c[_a+13124>>2]>>Qa)+1|0;ae(c[qa>>2]|0,0,$(c[ra>>2]|0,c[ta>>2]|0)|0)|0;ae(c[ua>>2]|0,0,$(c[ra>>2]|0,c[ta>>2]|0)|0)|0;_a=c[pa>>2]|0;ae(c[va>>2]|0,0,$(c[_a+13152>>2]|0,c[_a+13148>>2]|0)|0)|0;_a=c[pa>>2]|0;ae(c[wa>>2]|0,0,$((c[_a+13160>>2]|0)+1|0,(c[_a+13156>>2]|0)+1|0)|0)|0;ae(c[xa>>2]|0,-1,$(($a<<2)+4|0,Qa)|0)|0;c[la>>2]=0;c[ma>>2]=c[s>>2];Qa=c[ya>>2]|0;if(a[Qa+42>>0]|0)c[Ra+312>>2]=c[c[Qa+1648>>2]>>2]<>2]|0)+13080>>2];Qa=ac(l,na,c[oa>>2]|0)|0;do if((Qa|0)>=0){c[(c[c[q>>2]>>2]|0)+80>>2]=((c[s>>2]|0)+ -16|0)>>>0<8&1;c[(c[na>>2]|0)+84>>2]=3-(c[Ba>>2]|0);zd(c[Ca>>2]|0);Qa=bc(l,c[Ca>>2]|0,0)|0;if((Qa|0)<0)break;break k}while(0);if(!(c[q>>2]|0)){o=167;break b}c[q>>2]=0;if((Qa|0)<0){p=A;break a}}while(0);if((c[s>>2]|0)!=(c[ma>>2]|0)){p=A;o=180;break a}c[m>>2]=0;c[B>>2]=1;Qa=c[ka>>2]|0;Da[c[Qa+816>>2]&1](Qa,1,m,n,1,4)|0;Qa=c[n>>2]|0;$a=c[pa>>2]|0;if((Qa|0)>=($(c[$a+13132>>2]|0,c[$a+13128>>2]|0)|0))c[la>>2]=1;if((Qa|0)<0)break d;else break c};case 37:case 36:{b[Pa>>1]=(e[Pa>>1]|0)+1&255;c[Aa>>2]=2147483647;break c};case 48:{Qa=Fc(l)|0;if((Qa|0)<0)break d;else break c};case 34:{Qa=Gc(l)|0;if((Qa|0)<0)break d;else break c};case 40:case 39:{Qa=Ic(l)|0;if((Qa|0)<0)break d;else break c};default:break c}}while(0);r=(c[(c[ka>>2]|0)+688>>2]&8|0)==0?0:Qa;o=178}while(0);if((o|0)==178?(o=0,(r|0)<0):0){p=A;o=180;break a}C=C+1|0;if((C|0)>=(c[v>>2]|0)){p=A;o=180;break a}}if((o|0)==71){Pb(l);Pb(l);c[pa>>2]=0;p=A;o=180;break}else if((o|0)==91)sa();else if((o|0)==127){c[La>>2]=0;p=A;o=180;break}else if((o|0)==167){c[q>>2]=0;p=A;break}}else{p=A;o=180}}else{p=0;o=180}while(0);if((p|0)<0){$a=p;i=k;return $a|0}m=l+2604|0;if(c[m>>2]|0)c[m>>2]=0;l=c[l+164>>2]|0;if(c[l+304>>2]|0){Ad(g,l);c[h>>2]=1}$a=c[f>>2]|0;i=k;return $a|0}function Nb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;e=c[b+60>>2]|0;Pb(e);b=e+4412|0;f=e+4392|0;if((c[b>>2]|0)>0){g=0;do{kd((c[f>>2]|0)+(g<<2)|0);g=g+1|0}while((g|0)<(c[b>>2]|0))}kd(e+4396|0);kd(e+4388|0);kd(f);kd(e+152|0);kd(e+168|0);kd(e+172|0);kd(e+184|0);kd(e+176|0);kd(e+188|0);kd(e+180|0);kd(e+192|0);yd(e+164|0);g=e+2524|0;Zb(e,g,-1);yd(g);g=e+208|0;f=0;do{wd(g+(f<<2)|0);f=f+1|0}while((f|0)!=16);g=e+272|0;f=0;do{wd(g+(f<<2)|0);f=f+1|0}while((f|0)!=32);f=e+400|0;g=0;do{wd(f+(g<<2)|0);g=g+1|0}while((g|0)!=256);c[e+200>>2]=0;c[e+204>>2]=0;c[e+196>>2]=0;wd(e+1424|0);kd(e+2096|0);kd(e+2100|0);kd(e+2104|0);h=e+141|0;l=a[h>>0]|0;f=e+72|0;if((l&255)>1){g=e+8|0;j=1;do{k=f+(j<<2)|0;if(c[k>>2]|0){kd(k);kd(g+(j<<2)|0);l=a[h>>0]|0}j=j+1|0}while((j|0)<(l&255|0))}g=e+136|0;if((c[g>>2]|0)==(c[f>>2]|0))c[g>>2]=0;kd(f);f=e+4404|0;if((c[b>>2]|0)<=0){kd(f);c[b>>2]=0;i=d;return 0}e=0;do{kd((c[f>>2]|0)+(e<<4)|0);e=e+1|0}while((e|0)<(c[b>>2]|0));kd(f);c[b>>2]=0;i=d;return 0}function Ob(a){a=a|0;var b=0;b=i;a=c[a+60>>2]|0;$b(a);c[a+2592>>2]=2147483647;i=b;return}function Pb(a){a=a|0;var b=0;b=i;kd(a+2504|0);kd(a+2508|0);kd(a+4332|0);kd(a+4336|0);kd(a+4340|0);kd(a+4344|0);kd(a+4348|0);kd(a+4316|0);kd(a+4328|0);kd(a+4352|0);kd(a+4320|0);kd(a+4324|0);kd(a+2096|0);kd(a+2104|0);kd(a+2100|0);i=b;return}function Qb(a){a=a|0;var b=0,d=0,e=0;b=i;d=(c[a+136>>2]|0)+204|0;if(dd(d)|0){e=-1094995529;i=b;return e|0}c[a+2512>>2]=ad(d,6)|0;e=ad(d,6)|0;d=(ad(d,3)|0)+ -1|0;c[a+2516>>2]=d;if((d|0)<0){e=-1094995529;i=b;return e|0}e=(e|0)==0&1;i=b;return e|0}function Rb(e,f){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,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;f=i;h=c[e+60>>2]|0;k=h+200|0;E=c[k>>2]|0;e=1<>2];l=h+204|0;n=c[l>>2]|0;A=c[(c[n+1668>>2]|0)+(c[h+2500>>2]<<2)>>2]|0;m=(a[h+1449>>0]|0)==0;if(!A)if(m)g=4;else{W=-1094995529;i=f;return W|0}else if(!m){m=h+4328|0;r=h+1436|0;if((c[(c[m>>2]|0)+(c[(c[n+1672>>2]|0)+(A+ -1<<2)>>2]<<2)>>2]|0)!=(c[r>>2]|0)){W=-1094995529;i=f;return W|0}}else g=4;if((g|0)==4){m=h+4328|0;r=h+1436|0}q=e+ -1|0;s=h+136|0;p=h+2504|0;y=h+2056|0;o=h+2057|0;w=h+2084|0;x=h+2508|0;v=h+2088|0;u=h+2062|0;t=h+4352|0;z=0;n=0;do{if((A|0)>=(c[E+13136>>2]|0))break;G=c[l>>2]|0;B=c[(c[G+1672>>2]|0)+(A<<2)>>2]|0;J=E+13120|0;I=E+13080|0;H=c[I>>2]|0;n=q+(c[J>>2]|0)>>H;z=((B|0)%(n|0)|0)<>2]|0;H=1<>2]|0;D=B-F|0;c[(c[m>>2]|0)+(B<<2)>>2]=F;do if(!(a[G+43>>0]|0)){if(!(a[G+42>>0]|0)){c[C+312>>2]=c[J>>2];G=E;break}if((A|0)!=0?(W=c[G+1676>>2]|0,(c[W+(A<<2)>>2]|0)!=(c[W+(A+ -1<<2)>>2]|0)):0){W=c[I>>2]|0;c[C+312>>2]=(c[(c[G+1648>>2]|0)+(c[(c[G+1664>>2]|0)+(z>>W<<2)>>2]<<2)>>2]<>0]=1;G=c[k>>2]|0}else G=E}else{if((z|0)==0?(H+ -1&n|0)==0:0){a[C+203>>0]=1;E=c[k>>2]|0}c[C+312>>2]=c[E+13120>>2];G=E}while(0);E=H+n|0;H=c[G+13124>>2]|0;c[C+316>>2]=(E|0)>(H|0)?H:E;E=C+31312|0;c[E>>2]=0;H=c[l>>2]|0;if(!(a[H+42>>0]|0)){if((B|0)==(F|0)){c[E>>2]=1;F=1}else F=0;if((D|0)<(c[G+13128>>2]|0)){F=F|4;c[E>>2]=F}}else{if((z|0)>0){W=c[H+1676>>2]|0;I=B+ -1|0;if((c[W+(A<<2)>>2]|0)==(c[W+(c[(c[H+1668>>2]|0)+(I<<2)>>2]<<2)>>2]|0))F=0;else{c[E>>2]=2;F=2}W=c[m>>2]|0;if((c[W+(B<<2)>>2]|0)!=(c[W+(I<<2)>>2]|0)){F=F|1;c[E>>2]=F}}else F=0;if((n|0)>0){W=c[H+1676>>2]|0;I=G+13128|0;G=c[I>>2]|0;if((c[W+(A<<2)>>2]|0)!=(c[W+(c[(c[H+1668>>2]|0)+(B-G<<2)>>2]<<2)>>2]|0)){F=F|8;c[E>>2]=F;G=c[I>>2]|0}W=c[m>>2]|0;if((c[W+(B<<2)>>2]|0)!=(c[W+(B-G<<2)>>2]|0)){F=F|4;c[E>>2]=F}}}E=(z|0)>0;if(E&(D|0)>0)G=(F>>>1&1^1)&255;else G=0;a[C+308>>0]=G;if((n|0)>0){if((D|0)<(c[(c[k>>2]|0)+13128>>2]|0))F=0;else F=(F>>>3&1^1)&255;a[C+309>>0]=F;F=c[(c[k>>2]|0)+13128>>2]|0;if((D+1|0)<(F|0))F=0;else{W=c[l>>2]|0;V=c[W+1676>>2]|0;F=(c[V+(A<<2)>>2]|0)==(c[V+(c[(c[W+1668>>2]|0)+(B+1-F<<2)>>2]<<2)>>2]|0)&1}a[C+310>>0]=F;if(E?(j=c[(c[k>>2]|0)+13128>>2]|0,(D|0)>(j|0)):0){D=c[l>>2]|0;W=c[D+1676>>2]|0;D=(c[W+(A<<2)>>2]|0)==(c[W+(c[(c[D+1668>>2]|0)+(B+ -1-j<<2)>>2]<<2)>>2]|0)&1}else D=0}else{a[C+309>>0]=0;a[C+310>>0]=0;D=0}a[C+311>>0]=D;Wa(h,A);D=c[k>>2]|0;E=c[D+13080>>2]|0;F=z>>E;E=n>>E;G=c[s>>2]|0;D=($(c[D+13128>>2]|0,E)|0)+F|0;C=c[p>>2]|0;if((a[y>>0]|0)==0?(a[o>>0]|0)==0:0){M=0;H=0}else{if((F|0)>0?(a[G+308>>0]|0)!=0:0)M=$a(h)|0;else M=0;if((E|0)>0&(M|0)==0)if(!(a[G+309>>0]|0)){M=0;H=0}else{M=0;H=($a(h)|0)!=0}else H=0}I=(c[(c[k>>2]|0)+4>>2]|0)!=0?3:1;L=C+(D*148|0)+143|0;G=C+(D*148|0)+144|0;K=C+(D*148|0)+104|0;J=C+(D*148|0)+108|0;R=(M|0)==0;S=R&(H^1);M=E+ -1|0;O=F+ -1|0;P=0;do{Q=c[l>>2]|0;Q=d[((P|0)==0?Q+1644|0:Q+1645|0)>>0]|0;a:do if(a[h+P+2056>>0]|0){T=(P|0)==2;do if(!T){if(S){U=(bb(h)|0)&255;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}if(!R){U=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;U=a[(c[p>>2]|0)+(U*148|0)+P+142>>0]|0;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}if(H){U=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;U=a[(c[p>>2]|0)+(U*148|0)+P+142>>0]|0;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}else{a[C+(D*148|0)+P+142>>0]=0;break a}}else{U=a[L>>0]|0;a[G>>0]=U;c[J>>2]=c[K>>2];N=G}while(0);if(U<<24>>24){U=0;do{do if(!S){if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(U<<2)>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(U<<2)>>2];break}else{c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=0;break}}else c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=eb(h)|0;while(0);U=U+1|0}while((U|0)!=4);do if((a[N>>0]|0)==1){T=0;do{do if(c[C+(D*148|0)+(P<<4)+(T<<2)>>2]|0){if(S){c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=fb(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(T<<2)+48>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(T<<2)+48>>2];break}else{c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=0;break}}else c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=0;while(0);T=T+1|0}while((T|0)!=4);if(S){a[C+(D*148|0)+P+96>>0]=db(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;a[C+(D*148|0)+P+96>>0]=a[(c[p>>2]|0)+(W*148|0)+P+96>>0]|0;break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;a[C+(D*148|0)+P+96>>0]=a[(c[p>>2]|0)+(W*148|0)+P+96>>0]|0;break}else{a[C+(D*148|0)+P+96>>0]=0;break}}else if(!T){if(S){c[C+(D*148|0)+(P<<2)+100>>2]=gb(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<2)+100>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<2)+100>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<2)+100>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<2)+100>>2];break}else{c[C+(D*148|0)+(P<<2)+100>>2]=0;break}}while(0);b[C+(D*148|0)+(P*10|0)+112>>1]=0;T=0;do{W=c[C+(D*148|0)+(P<<4)+(T<<2)>>2]|0;V=T;T=T+1|0;U=C+(D*148|0)+(P*10|0)+(T<<1)+112|0;b[U>>1]=W;if((a[N>>0]|0)==2){if((V|0)>1){W=0-W|0;b[U>>1]=W}}else if(c[C+(D*148|0)+(P<<4)+(V<<2)+48>>2]|0){W=0-W|0;b[U>>1]=W}b[U>>1]=W<<16>>16<>0]=0;while(0);P=P+1|0}while((P|0)<(I|0));C=c[x>>2]|0;c[C+(B<<3)>>2]=c[w>>2];c[C+(B<<3)+4>>2]=c[v>>2];a[(c[t>>2]|0)+B>>0]=a[u>>0]|0;C=Sb(h,z,n,c[(c[k>>2]|0)+13080>>2]|0,0)|0;if((C|0)<0){g=108;break}A=A+1|0;Va(h,A);Fb(h,z,n,e);E=c[k>>2]|0}while((C|0)!=0);if((g|0)==108){c[(c[m>>2]|0)+(B<<2)>>2]=-1;W=C;i=f;return W|0}if((z+e|0)<(c[E+13120>>2]|0)){W=A;i=f;return W|0}if((n+e|0)<(c[E+13124>>2]|0)){W=A;i=f;return W|0}Db(h,z,n,e);W=A;i=f;return W|0}function Sb(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;j=i;i=i+32|0;z=j;B=j+20|0;A=b+136|0;r=c[A>>2]|0;l=1<>2]|0;q=b+204|0;t=c[q>>2]|0;p=(1<<(c[s+13080>>2]|0)-(c[t+24>>2]|0))+ -1|0;c[r+31232>>2]=h;k=l+e|0;if(((k|0)<=(c[s+13120>>2]|0)?(l+f|0)<=(c[s+13124>>2]|0):0)?(c[s+13064>>2]|0)>>>0>>0:0){s=nb(b,h,e,f)|0;t=c[q>>2]|0}else s=(c[s+13064>>2]|0)>>>0>>0&1;if((a[t+22>>0]|0)!=0?((c[(c[m>>2]|0)+13080>>2]|0)-(c[t+24>>2]|0)|0)>>>0<=g>>>0:0){a[r+300>>0]=0;c[r+280>>2]=0}if((a[b+2080>>0]|0)!=0?((c[(c[m>>2]|0)+13080>>2]|0)-(d[(c[q>>2]|0)+1632>>0]|0)|0)>>>0<=g>>>0:0)a[r+301>>0]=0;if(s){o=l>>1;n=o+e|0;q=o+f|0;g=g+ -1|0;h=h+1|0;s=Sb(b,e,f,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}if(s){if((n|0)<(c[(c[m>>2]|0)+13120>>2]|0)){s=Sb(b,n,f,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}if(s){if((q|0)<(c[(c[m>>2]|0)+13124>>2]|0)){s=Sb(b,e,q,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}if(s){X=c[m>>2]|0;if((n|0)<(c[X+13120>>2]|0)?(q|0)<(c[X+13124>>2]|0):0){s=Sb(b,n,q,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}}else s=0}else s=0}else s=0;if((p&k|0)==0?(p&l+f|0)==0:0)c[r+276>>2]=a[r+272>>0];if(!s){X=0;i=j;return X|0}k=c[m>>2]|0;if((n+o|0)<(c[k+13120>>2]|0))k=1;else k=(q+o|0)<(c[k+13124>>2]|0);X=k&1;i=j;return X|0}p=c[A>>2]|0;s=c[m>>2]|0;r=c[s+13064>>2]|0;h=c[s+13140>>2]|0;s=1<<(c[s+13080>>2]|0)-(c[(c[q>>2]|0)+24>>2]|0);c[p+31236>>2]=e;c[p+31240>>2]=f;x=p+31252|0;a[x>>0]=1;v=p+31244|0;c[v>>2]=1;E=p+31248|0;c[E>>2]=0;w=p+31254|0;a[w>>0]=0;y=p+31253|0;a[y>>0]=0;t=($(f>>r,h)|0)+(e>>r)|0;H=b+4332|0;a[(c[H>>2]|0)+t>>0]=0;X=p+31268|0;a[X>>0]=1;a[X+1>>0]=1;a[X+2>>0]=1;a[X+3>>0]=1;r=l>>r;s=s+ -1|0;if(a[(c[q>>2]|0)+40>>0]|0){X=(ib(b)|0)&255;a[p+31256>>0]=X;if(X<<24>>24)Tb(b,e,f,g)}else a[p+31256>>0]=0;u=(r|0)>0;if(u){G=t;F=0;while(1){ae((c[H>>2]|0)+G|0,0,r|0)|0;F=F+1|0;if((F|0)==(r|0))break;else G=G+h|0}}if((c[v>>2]|0)==1?(c[(c[m>>2]|0)+13064>>2]|0)!=(g|0):0)D=c[E>>2]|0;else{F=ob(b,g)|0;c[E>>2]=F;E=c[v>>2]|0;if((F|0)==3)G=(E|0)==1&1;else G=0;a[w>>0]=G;if((E|0)==1)D=F;else sa()}if((((D|0)==0?(C=c[m>>2]|0,(c[C+68>>2]|0)!=0):0)?(c[C+13048>>2]|0)>>>0<=g>>>0:0)?(c[C+13052>>2]|0)>>>0>=g>>>0:0){C=(pb(b)|0)&255;a[y>>0]=C}else C=a[y>>0]|0;do if(!(C<<24>>24)){C=c[A>>2]|0;E=(c[C+31248>>2]|0)==3;D=E?2:1;H=0;do{F=H<<1;G=0;do{a[B+(G+F)>>0]=qb(b)|0;G=G+1|0}while((G|0)<(D|0));H=H+1|0}while((H|0)<(D|0));Q=l>>(E&1);P=C+31264|0;R=z+4|0;E=z+8|0;F=b+4340|0;O=C+31260|0;N=0;do{J=N<<1;H=($(N,Q)|0)+f|0;I=0;do{L=I+J|0;U=(a[B+L>>0]|0)==0;if(U)c[P>>2]=sb(b)|0;else c[O>>2]=rb(b)|0;V=($(I,Q)|0)+e|0;T=c[A>>2]|0;X=c[m>>2]|0;S=c[X+13084>>2]|0;M=V>>S;K=H>>S;G=c[X+13156>>2]|0;S=Q>>S;X=c[X+13080>>2]|0;W=(1<>0]|0)==0?(W&H|0)==0:0)W=1;else{W=($(K+ -1|0,G)|0)+M|0;W=d[(c[F>>2]|0)+W>>0]|0}if((a[T+308>>0]|0)==0&(V|0)==0)V=1;else{V=M+ -1+($(K,G)|0)|0;V=d[(c[F>>2]|0)+V>>0]|0}X=(H>>X<>>0<2){c[z>>2]=0;c[R>>2]=1;c[E>>2]=26;V=0;X=1;W=26;break}else{c[z>>2]=V;X=(V+29&31)+2|0;c[R>>2]=X;W=(V+31&31)+2|0;c[E>>2]=W;break}else{c[z>>2]=V;c[R>>2]=X;if(!((V|0)==0|(X|0)==0)){c[E>>2]=0;W=0;break}if((V|0)==1|(X|0)==1){c[E>>2]=26;W=26;break}else{c[E>>2]=1;W=1;break}}while(0);if(U){if((V|0)>(X|0)){c[R>>2]=V;U=X&255;c[z>>2]=U}else{U=V;V=X}if((U|0)>(W|0)){c[E>>2]=U;X=W&255;c[z>>2]=X;W=U;U=X}if((V|0)>(W|0)){c[E>>2]=V;X=W&255;c[R>>2]=X}else{X=V;V=W}T=c[T+31264>>2]|0;T=((T|0)>=(U|0)&1)+T|0;T=((T|0)>=(X|0)&1)+T|0;T=((T|0)>=(V|0)&1)+T|0}else T=c[z+(c[T+31260>>2]<<2)>>2]|0;S=(S|0)==0?1:S;T=T&255;if((S|0)>0){U=0;do{X=($(U+K|0,G)|0)+M|0;ae((c[F>>2]|0)+X|0,T|0,S|0)|0;U=U+1|0}while((U|0)<(S|0))}a[C+L+31268>>0]=T;I=I+1|0}while((I|0)<(D|0));N=N+1|0}while((N|0)<(D|0));z=c[(c[m>>2]|0)+4>>2]|0;if((z|0)==3){B=0;do{z=B<<1;E=0;do{G=tb(b)|0;F=E+z|0;a[C+F+31281>>0]=G;A=a[C+F+31268>>0]|0;do if((G|0)!=4){G=a[1528+G>>0]|0;F=C+F+31277|0;if(A<<24>>24==G<<24>>24){a[F>>0]=34;break}else{a[F>>0]=G;break}}else a[C+F+31277>>0]=A;while(0);E=E+1|0}while((E|0)<(D|0));B=B+1|0}while((B|0)<(D|0))}else if(!z)break;else if((z|0)!=2){A=tb(b)|0;z=a[C+31268>>0]|0;if((A|0)==4){a[C+31277>>0]=z;break}A=a[1528+A>>0]|0;B=C+31277|0;if(z<<24>>24==A<<24>>24){a[B>>0]=34;break}else{a[B>>0]=A;break}}else{z=tb(b)|0;a[C+31281>>0]=z;A=a[C+31268>>0]|0;if((z|0)==4)z=A&255;else{z=a[1528+z>>0]|0;z=A<<24>>24==z<<24>>24?34:z&255}a[C+31277>>0]=a[1536+z>>0]|0;break}}else{G=c[m>>2]|0;B=c[G+13084>>2]|0;E=l>>B;C=c[G+13156>>2]|0;D=e>>B;B=f>>B;E=(E|0)==0?1:E;if((E|0)>0){F=b+4340|0;G=0;do{X=($(G+B|0,C)|0)+D|0;ae((c[F>>2]|0)+X|0,1,E|0)|0;G=G+1|0}while((G|0)<(E|0));G=c[m>>2]|0}K=c[A>>2]|0;V=c[b+160>>2]|0;A=c[V+32>>2]|0;D=$(A,f)|0;H=c[G+56>>2]|0;D=(c[V>>2]|0)+((e<>2]|0;J=c[G+13184>>2]|0;B=$(f>>J,E)|0;I=c[G+13172>>2]|0;B=(c[V+4>>2]|0)+((e>>I<>2]|0;X=c[G+13188>>2]|0;F=$(f>>X,C)|0;W=c[G+13176>>2]|0;F=(c[V+8>>2]|0)+((e>>W<>0]|0,l<>W,l>>X)|0)+($(l>>I,l>>J)|0)|0;G=($(d[G+13045>>0]|0,J)|0)+H|0;H=K+224|0;J=G+7>>3;I=c[K+240>>2]|0;X=c[H>>2]|0;I=(X&1|0)==0?I:I+ -1|0;I=(X&511|0)==0?I:I+ -1|0;K=(c[K+244>>2]|0)-I|0;if((K|0)<(J|0))I=0;else _c(H,I+J|0,K-J|0);if(!(a[b+2061>>0]|0))Cb(b,e,f,g);X=G>>>0>2147483639|(I|0)==0;W=X?0:G;V=X?0:I;c[z>>2]=V;c[z+12>>2]=W;c[z+16>>2]=W+8;c[z+4>>2]=V+(W+7>>3);c[z+8>>2]=0;if(X)z=-1094995529;else{W=b+2608|0;Ja[c[W>>2]&3](D,A,l,l,z,d[(c[m>>2]|0)+13044>>0]|0);X=c[m>>2]|0;Ja[c[W>>2]&3](B,E,l>>c[X+13172>>2],l>>c[X+13184>>2],z,d[X+13045>>0]|0);X=c[m>>2]|0;Ja[c[W>>2]&3](F,C,l>>c[X+13176>>2],l>>c[X+13188>>2],z,d[X+13045>>0]|0);z=0}if(a[(c[m>>2]|0)+13056>>0]|0)Tb(b,e,f,g);if((z|0)<0){X=z;i=j;return X|0}}while(0);do if(!(a[y>>0]|0)){if(!(a[x>>0]|0)){if(a[b+2061>>0]|0)break;Cb(b,e,f,g);break}x=c[m>>2]|0;if((c[v>>2]|0)==1)v=(d[w>>0]|0)+(c[x+13092>>2]|0)|0;else v=c[x+13088>>2]|0;a[p+31255>>0]=v;v=Ub(b,e,f,e,f,e,f,g,g,0,0,1520,1520)|0;if((v|0)<0){X=v;i=j;return X|0}}while(0);if((a[(c[q>>2]|0)+22>>0]|0)!=0?(a[p+300>>0]|0)==0:0)Bb(b,e,f,g);if(u){q=b+4316|0;g=p+272|0;u=0;while(1){ae((c[q>>2]|0)+t|0,a[g>>0]|0,r|0)|0;u=u+1|0;if((u|0)==(r|0))break;else t=t+h|0}}if((s&k|0)==0?(s&l+f|0)==0:0)c[p+276>>2]=a[p+272>>0];q=c[m>>2]|0;X=c[q+13064>>2]|0;g=l>>X;r=e>>X;e=f>>X;if((g|0)>0?(n=b+4336|0,o=c[p+31232>>2]&255,X=($(c[q+13140>>2]|0,e)|0)+r|0,ae((c[n>>2]|0)+X|0,o|0,g|0)|0,(g|0)!=1):0){p=1;do{X=($(c[(c[m>>2]|0)+13140>>2]|0,p+e|0)|0)+r|0;ae((c[n>>2]|0)+X|0,o|0,g|0)|0;p=p+1|0}while((p|0)!=(g|0))}e=c[m>>2]|0;m=1<>2];if(((k|0)%(m|0)|0|0)!=0?(k|0)<(c[e+13120>>2]|0):0){X=1;i=j;return X|0}X=l+f|0;if(((X|0)%(m|0)|0|0)!=0?(X|0)<(c[e+13124>>2]|0):0){X=1;i=j;return X|0}X=(hb(b)|0)==0&1;i=j;return X|0}function Tb(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;g=i;m=1<>2]|0;l=c[n+13084>>2]|0;f=c[n+13156>>2]|0;k=m+d|0;j=c[n+13120>>2]|0;m=m+e|0;n=c[n+13124>>2]|0;h=e>>l;e=((m|0)>(n|0)?n:m)>>l;if((h|0)>=(e|0)){i=g;return}d=d>>l;j=((k|0)>(j|0)?j:k)>>l;k=(d|0)<(j|0);b=b+4348|0;do{if(k){m=$(h,f)|0;l=d;do{a[(c[b>>2]|0)+(l+m)>>0]=2;l=l+1|0}while((l|0)!=(j|0))}h=h+1|0}while((h|0)!=(e|0));i=g;return}function Ub(e,f,g,h,j,k,l,m,n,o,p,q,r){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;var 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;s=i;i=i+16|0;w=s+8|0;t=s;z=e+136|0;v=c[z>>2]|0;K=c[q>>2]|0;c[w>>2]=K;M=c[q+4>>2]|0;A=w+4|0;c[A>>2]=M;y=c[r>>2]|0;c[t>>2]=y;J=c[r+4>>2]|0;x=t+4|0;c[x>>2]=J;q=a[v+31254>>0]|0;do if(q<<24>>24){if((o|0)==1){c[v+288>>2]=d[v+p+31268>>0];if((c[(c[e+200>>2]|0)+4>>2]|0)==3){c[v+292>>2]=d[v+p+31277>>0];c[v+296>>2]=d[v+p+31281>>0];break}else{c[v+292>>2]=d[v+31277>>0];c[v+296>>2]=d[v+31281>>0];break}}}else{c[v+288>>2]=d[v+31268>>0];c[v+292>>2]=d[v+31277>>0];c[v+296>>2]=d[v+31281>>0]}while(0);r=e+200|0;G=c[r>>2]|0;B=(c[G+13076>>2]|0)>>>0>>0;if(((!B?(c[G+13072>>2]|0)>>>0>>0:0)?(d[v+31255>>0]|0)>(o|0):0)?!(q<<24>>24!=0&(o|0)==0):0)q=(ub(e,n)|0)&255;else{if((c[G+13088>>2]|0)==0?(c[v+31244>>2]|0)==0:0)G=(o|0)==0&(c[v+31248>>2]|0)!=0;else G=0;if(B)q=1;else q=(q<<24>>24!=0&(o|0)==0|G)&1}B=(n|0)>2;G=c[(c[r>>2]|0)+4>>2]|0;if(B)if(!G)L=y;else E=20;else if((G|0)==3)E=20;else L=y;do if((E|0)==20){G=(o|0)==0;if(!((K|0)==0&(G^1))){K=vb(e,o)|0;c[w>>2]=K;if((c[(c[r>>2]|0)+4>>2]|0)==2?q<<24>>24==0|(n|0)==3:0){M=vb(e,o)|0;c[A>>2]=M}if(!G)E=25}else{K=0;E=25}if((E|0)==25)if(!y){L=0;break}L=vb(e,o)|0;c[t>>2]=L;if((c[(c[r>>2]|0)+4>>2]|0)==2?q<<24>>24==0|(n|0)==3:0){J=vb(e,o)|0;c[x>>2]=J}}while(0);if(!(q<<24>>24)){A=c[r>>2]|0;y=c[A+13072>>2]|0;x=1<>2]|0;if(((o|0)==0?(c[v+31244>>2]|0)!=1:0)&(K|0)==0&(L|0)==0)if((c[A+4>>2]|0)==2?(M|J|0)!=0:0)E=37;else o=1;else E=37;if((E|0)==37){o=wb(e,o)|0;A=c[r>>2]|0}G=c[z>>2]|0;A=n-(c[A+13172>>2]|0)|0;z=G+31244|0;if((c[z>>2]|0)==1){I=1<>2]|0;L=c[K+4>>2]|0;if((L|0)==2){if(M){E=46;break}if(J){M=0;E=46;break}}if(!((c[z>>2]|0)!=1|(L|0)==0)){if(B|(L|0)==3){t=1<<(c[K+13172>>2]|0)+A;w=1<<(c[K+13184>>2]|0)+A;Ec(e,f,g,t,w);Wb(e,f,g,A,1);Wb(e,f,g,A,2);if((c[(c[r>>2]|0)+4>>2]|0)!=2)break;M=(1<>2]|0)+n,Ec(e,h,j,F,H),Wb(e,h,j,n,1),Wb(e,h,j,n,2),(c[(c[r>>2]|0)+4>>2]|0)==2):0){M=(1<>2]|0)+4>>2]|0)==2){F=(M|J|0)==0;E=48}else{F=1;E=48}a:do if((E|0)==48){E=e+204|0;do if((a[(c[E>>2]|0)+22>>0]|0)!=0?(D=G+300|0,(a[D>>0]|0)==0):0){M=jb(e)|0;J=G+280|0;c[J>>2]=M;if(M){M=(kb(e)|0)==1;H=c[J>>2]|0;if(M){H=0-H|0;c[J>>2]=H}}else H=0;a[D>>0]=1;M=(c[(c[r>>2]|0)+13192>>2]|0)/2|0;if((H|0)<(-26-M|0)|(H|0)>(M+25|0)){M=-1094995529;i=s;return M|0}else{Bb(e,k,l,m);break}}while(0);if((!((a[e+2080>>0]|0)==0|F)?(a[G+31256>>0]|0)==0:0)?(C=G+301|0,(a[C>>0]|0)==0):0){if(!(lb(e)|0)){a[G+302>>0]=0;a[G+303>>0]=0}else{l=c[E>>2]|0;if(!(a[l+1633>>0]|0))m=0;else{m=mb(e)|0;l=c[E>>2]|0}a[G+302>>0]=a[l+m+1634>>0]|0;a[G+303>>0]=a[(c[E>>2]|0)+m+1639>>0]|0}a[C>>0]=1}if((c[z>>2]|0)==1&(n|0)<4){m=c[G+288>>2]|0;if((m+ -6|0)>>>0<9)k=2;else k=(m+ -22|0)>>>0<9&1;m=c[G+292>>2]|0;if((m+ -6|0)>>>0<9)m=2;else m=(m+ -22|0)>>>0<9&1}else{k=0;m=0}l=G+304|0;a[l>>0]=0;if(I)zb(e,f,g,n,k,0);k=c[r>>2]|0;C=c[k+4>>2]|0;if(C){if(!(B|(C|0)==3)){if((p|0)!=3)break;p=1<>2]|0)+n;l=0;do{if((c[z>>2]|0)==1){M=(l<>2]|0)zb(e,h,(l<>2]|0)+4>>2]|0)==2?2:1)|0));w=0;while(1){if((c[z>>2]|0)==1){M=(w<>2]|0)zb(e,h,(w<=(((c[(c[r>>2]|0)+4>>2]|0)==2?2:1)|0))break a}}h=1<<(c[k+13172>>2]|0)+A;j=1<<(c[k+13184>>2]|0)+A;do if((a[(c[E>>2]|0)+1630>>0]|0)==0|I^1)a[l>>0]=0;else{if(c[z>>2]|0){M=(c[G+296>>2]|0)==4;a[l>>0]=M&1;if(!M)break}else a[l>>0]=1;Vb(e,0)}while(0);p=e+160|0;E=G+320|0;D=G+11680|0;C=1<0;B=e+(A+ -2<<2)+2612|0;F=G+284|0;I=0;do{if((c[z>>2]|0)==1){M=(I<>2]|0)){if(!(a[l>>0]|0))break;L=c[p>>2]|0;G=c[L+36>>2]|0;H=c[r>>2]|0;M=$(g>>c[H+13184>>2],G)|0;H=(c[L+4>>2]|0)+(M+(f>>c[H+13172>>2]<>2]))|0;if(k){I=0;do{b[D+(I<<1)>>1]=($(b[E+(I<<1)>>1]|0,c[F>>2]|0)|0)>>>3;I=I+1|0}while((I|0)!=(C|0));I=C}else I=0;Ga[c[B>>2]&7](H,D,G)}else zb(e,f,(I<>2]|0)+4>>2]|0)==2?2:1)|0));if(!(a[l>>0]|0))H=0;else{Vb(e,1);H=0}do{if((c[z>>2]|0)==1){M=(H<>2]|0)){if(!(a[l>>0]|0))break;L=c[p>>2]|0;w=c[L+40>>2]|0;G=c[r>>2]|0;M=$(g>>c[G+13188>>2],w)|0;G=(c[L+8>>2]|0)+(M+(f>>c[G+13176>>2]<>2]))|0;if(k){H=0;do{b[D+(H<<1)>>1]=($(b[E+(H<<1)>>1]|0,c[F>>2]|0)|0)>>>3;H=H+1|0}while((H|0)!=(C|0));H=C}else H=0;Ga[c[B>>2]&7](G,D,w)}else zb(e,f,(H<>2]|0)+4>>2]|0)==2?2:1)|0))}}while(0);if((o|0)!=0?(u=1<0):0){t=e+4344|0;r=0;do{w=$(r+g>>y,q)|0;h=0;do{a[(c[t>>2]|0)+((h+f>>y)+w)>>0]=1;h=h+x|0}while((h|0)<(u|0));r=r+x|0}while((r|0)<(u|0))}if(((a[e+2061>>0]|0)==0?(Cb(e,f,g,n),(a[(c[e+204>>2]|0)+40>>0]|0)!=0):0)?(a[v+31256>>0]|0)!=0:0)Tb(e,f,g,n)}else{v=n+ -1|0;u=1<>2]|0;f=xb(a,b)|0;if(!f){c[e+284>>2]=0;i=d;return}else{c[e+284>>2]=1-((yb(a,b)|0)<<1)<>2]|0;q=c[b+200>>2]|0;O=c[q+(h<<2)+13168>>2]|0;N=c[q+(h<<2)+13180>>2]|0;k=1<>2]|0;ga=k<>2]|0;P=e>>V&T;R=f>>V&T;S=T+2|0;Q=($(R,S)|0)+P|0;U=c[b+204>>2]|0;aa=c[U+1684>>2]|0;Q=c[aa+(Q<<2)>>2]|0;l=c[b+160>>2]|0;b=c[l+(h<<2)+32>>2]|0;l=c[l+(h<<2)>>2]|0;m=($(b,f>>N)|0)+(e>>O)|0;n=l+m|0;o=(h|0)==0;p=c[(o?r+288|0:r+292|0)>>2]|0;u=t+1|0;y=w+1|0;x=z+1|0;s=v+1|0;if(!(c[r+31288>>2]|0))fa=0;else fa=(Q|0)>(c[aa+(P+ -1+($(T&R+(ga>>V),S)|0)<<2)>>2]|0);da=fa&1;_=c[r+31292>>2]|0;H=c[r+31300>>2]|0;Z=c[r+31296>>2]|0;if(!(c[r+31304>>2]|0))ba=0;else ba=(Q|0)>(c[aa+(($(S,R+ -1|0)|0)+(T&P+(ea>>V))<<2)>>2]|0);S=ba&1;V=(ga<<1)+f|0;R=q+13124|0;aa=c[R>>2]|0;P=ga+f|0;V=((V|0)>(aa|0)?aa:V)-P>>N;aa=(ea<<1)+e|0;T=q+13120|0;ja=c[T>>2]|0;Q=ea+e|0;aa=((aa|0)>(ja|0)?ja:aa)-Q>>O;U=U+20|0;if((a[U>>0]|0)==1){ca=c[q+13084>>2]|0;ha=ga>>ca;ea=ea>>ca;ia=(1<>2]|0)-(P>>ca)|0;fa=(ha|0)>(fa|0)?fa:ha;if((fa|0)>0){da=0;ja=0;do{da=da|1;ja=ja+2|0}while((ja|0)<(fa|0))}else da=0}if(!((_|0)!=1|ia)){fa=(c[q+13160>>2]|0)-(f>>ca)|0;fa=(ha|0)>(fa|0)?fa:ha;if((fa|0)>0){_=0;ha=0;do{_=_|1;ha=ha+2|0}while((ha|0)<(fa|0))}else _=0}fa=(ga|0)!=0;if(!((Z|0)!=1|fa)){ga=(c[q+13156>>2]|0)-(e>>ca)|0;ga=(ea|0)>(ga|0)?ga:ea;if((ga|0)>0){Z=0;ha=0;do{Z=Z|1;ha=ha+2|0}while((ha|0)<(ga|0))}else Z=0}if(!(fa|ba^1)){ca=(c[q+13156>>2]|0)-(Q>>ca)|0;ca=(ea|0)>(ca|0)?ca:ea;if((ca|0)>0){S=0;ba=0;do{S=S|1;ba=ba+2|0}while((ba|0)<(ca|0))}else S=0}ba=u+0|0;ca=ba+64|0;do{a[ba>>0]=128;ba=ba+1|0}while((ba|0)<(ca|0));ba=w+0|0;ca=ba+65|0;do{a[ba>>0]=128;ba=ba+1|0}while((ba|0)<(ca|0));ea=S}else ea=S;ba=(H|0)!=0;if(ba){ja=a[l+(m+~b)>>0]|0;a[t>>0]=ja;a[w>>0]=ja}ca=(Z|0)!=0;if(ca)ce(y|0,l+(m-b)|0,k|0)|0;S=(ea|0)!=0;if(S?(Y=k+1|0,ce(w+Y|0,l+(k-b+m)|0,k|0)|0,X=$(d[l+(k+ -1-b+m+aa)>>0]|0,16843009)|0,W=k-aa|0,(W|0)>0):0){Y=aa+Y|0;aa=0;do{ja=w+(Y+aa)|0;a[ja>>0]=X;a[ja+1>>0]=X>>8;a[ja+2>>0]=X>>16;a[ja+3>>0]=X>>24;aa=aa+4|0}while((aa|0)<(W|0))}W=(_|0)!=0;if(W&(k|0)>0){Y=m+ -1|0;X=0;do{ja=X;X=X+1|0;a[t+X>>0]=a[l+(Y+($(ja,b)|0))>>0]|0}while((X|0)!=(k|0))}X=(da|0)!=0;if(X){aa=V+k|0;fa=m+ -1|0;if((V|0)>0){Y=k;do{ja=Y;Y=Y+1|0;a[t+Y>>0]=a[l+(fa+($(ja,b)|0))>>0]|0}while((Y|0)<(aa|0))}Y=$(d[l+(fa+($(aa+ -1|0,b)|0))>>0]|0,16843009)|0;aa=k-V|0;if((aa|0)>0){V=k+1+V|0;fa=0;do{ja=t+(V+fa)|0;a[ja>>0]=Y;a[ja+1>>0]=Y>>8;a[ja+2>>0]=Y>>16;a[ja+3>>0]=Y>>24;fa=fa+4|0}while((fa|0)<(aa|0))}}do if((a[U>>0]|0)==1?(ja=da|_,L=(ja|0)==0,ja=ja|H,M=(ja|0)==0,(Z|ea|ja|0)!=0):0){U=k<<1;V=c[T>>2]|0;if(((U<>O;R=c[R>>2]|0;if(((U<=(R|0))U=R-f>>N;if(!S)if((Q|0)<(V|0))O=k;else O=V-e>>O;else O=T;if(!X)if((P|0)<(R|0))U=k;else U=R-f>>N;N=a[w>>0]|0;if(M)a[t>>0]=N;a[t>>0]=N;if(!L){L=0;while(1)if((L|0)<(U|0))L=L+4|0;else break}if(!W?(K=$(N&255,16843009)|0,(k|0)>0):0){L=0;do{ja=t+(L|1)|0;a[ja>>0]=K;a[ja+1>>0]=K>>8;a[ja+2>>0]=K>>16;a[ja+3>>0]=K>>24;L=L+4|0}while((L|0)<(k|0))}do if(!X){L=$(d[t+k>>0]|0,16843009)|0;if((k|0)<=0)break;K=k+1|0;M=0;do{ja=t+(K+M)|0;a[ja>>0]=L;a[ja+1>>0]=L>>8;a[ja+2>>0]=L>>16;a[ja+3>>0]=L>>24;M=M+4|0}while((M|0)<(k|0))}while(0);f=(f|0)==0;if((e|0)==0&(U|0)>0){e=0;do{ja=t+(e|1)|0;a[ja>>0]=0;a[ja+1>>0]=0;a[ja+2>>0]=0;a[ja+3>>0]=0;e=e+4|0}while((e|0)<(U|0))}a[w>>0]=a[t>>0]|0;if(f)break;else e=0;while(1)if((e|0)<(O|0))e=e+4|0;else break}while(0);a:do if(!X){if(W){f=$(d[t+k>>0]|0,16843009)|0;if((k|0)<=0){J=84;break}J=k+1|0;e=0;while(1){ja=t+(J+e)|0;a[ja>>0]=f;a[ja+1>>0]=f>>8;a[ja+2>>0]=f>>16;a[ja+3>>0]=f>>24;e=e+4|0;if((e|0)>=(k|0)){J=84;break a}}}if(ba){e=$(d[t>>0]|0,16843009)|0;J=k<<1;if((k|0)>0)I=0;else{J=87;break}while(1){ja=t+(I|1)|0;a[ja>>0]=e;a[ja+1>>0]=e>>8;a[ja+2>>0]=e>>16;a[ja+3>>0]=e>>24;I=I+4|0;if((I|0)>=(J|0)){J=87;break a}}}if(ca){I=a[y>>0]|0;a[t>>0]=I;I=$(I&255,16843009)|0;H=k<<1;if((k|0)>0)J=0;else{J=89;break}while(1){ja=t+(J|1)|0;a[ja>>0]=I;a[ja+1>>0]=I>>8;a[ja+2>>0]=I>>16;a[ja+3>>0]=I>>24;J=J+4|0;if((J|0)>=(H|0)){J=89;break a}}}if(!S){a[t>>0]=-128;J=k<<1;f=(k|0)>0;if(f)e=0;else{J=84;break}do{ja=w+(e|1)|0;a[ja>>0]=-2139062144;a[ja+1>>0]=-2139062144>>8;a[ja+2>>0]=-2139062144>>16;a[ja+3>>0]=-2139062144>>24;e=e+4|0}while((e|0)<(J|0));if(f)e=0;else{J=84;break}while(1){ja=t+(e|1)|0;a[ja>>0]=-2139062144;a[ja+1>>0]=-2139062144>>8;a[ja+2>>0]=-2139062144>>16;a[ja+3>>0]=-2139062144>>24;e=e+4|0;if((e|0)>=(J|0)){J=84;break a}}}H=w+(k+1)|0;e=a[H>>0]|0;I=$(e&255,16843009)|0;G=(k|0)>0;if(G)J=0;else{a[t>>0]=e;break}do{ja=w+(J|1)|0;a[ja>>0]=I;a[ja+1>>0]=I>>8;a[ja+2>>0]=I>>16;a[ja+3>>0]=I>>24;J=J+4|0}while((J|0)<(k|0));I=a[H>>0]|0;a[t>>0]=I;I=$(I&255,16843009)|0;H=k<<1;if(G){G=0;do{ja=t+(G|1)|0;a[ja>>0]=I;a[ja+1>>0]=I>>8;a[ja+2>>0]=I>>16;a[ja+3>>0]=I>>24;G=G+4|0}while((G|0)<(H|0));J=92}else J=92}else J=84;while(0);if((J|0)==84)if((_|0)==0?(I=$(d[t+(k+1)>>0]|0,16843009)|0,(k|0)>0):0){J=0;do{ja=t+(J|1)|0;a[ja>>0]=I;a[ja+1>>0]=I>>8;a[ja+2>>0]=I>>16;a[ja+3>>0]=I>>24;J=J+4|0}while((J|0)<(k|0));J=87}else J=87;if((J|0)==87)if(!H){a[t>>0]=a[u>>0]|0;J=89}else J=89;if((J|0)==89)if((Z|0)==0?(G=$(d[t>>0]|0,16843009)|0,(k|0)>0):0){H=0;do{ja=w+(H|1)|0;a[ja>>0]=G;a[ja+1>>0]=G>>8;a[ja+2>>0]=G>>16;a[ja+3>>0]=G>>24;H=H+4|0}while((H|0)<(k|0));J=92}else J=92;if(((J|0)==92?!S:0)?(F=$(d[w+k>>0]|0,16843009)|0,(k|0)>0):0){H=k+1|0;G=0;do{ja=w+(H+G)|0;a[ja>>0]=F;a[ja+1>>0]=F>>8;a[ja+2>>0]=F>>16;a[ja+3>>0]=F>>24;G=G+4|0}while((G|0)<(k|0))}F=a[t>>0]|0;a[w>>0]=F;b:do if(!(c[q+13112>>2]|0)){if(o){if((p|0)==1|(k|0)==4){s=y;break}}else if(((p|0)==1?1:(c[q+4>>2]|0)!=3)|(k|0)==4){s=y;break}ja=p+ -26|0;ja=(ja|0)>-1?ja:26-p|0;ia=p+ -10|0;ia=(ia|0)>-1?ia:10-p|0;if((((ja|0)>(ia|0)?ia:ja)|0)>(c[1576+(g+ -3<<2)>>2]|0)){if((o&(a[q+13061>>0]|0)!=0&(g|0)==5?(D=F&255,E=a[w+64>>0]|0,C=E&255,ja=C+D-(d[w+32>>0]<<1)|0,(((ja|0)>-1?ja:0-ja|0)|0)<8):0)?(A=t+64|0,B=a[A>>0]|0,ja=(B&255)+D-(d[t+32>>0]<<1)|0,(((ja|0)>-1?ja:0-ja|0)|0)<8):0){a[v>>0]=F;a[v+64>>0]=E;w=0;do{ja=w;w=w+1|0;a[v+w>>0]=(($(D,63-ja|0)|0)+32+($(C,w)|0)|0)>>>6}while((w|0)!=63);w=0;while(1){v=w+1|0;a[t+v>>0]=(($(F&255,63-w|0)|0)+32+($(B&255,v)|0)|0)>>>6;if((v|0)==63)break b;F=a[t>>0]|0;B=a[A>>0]|0;w=v}}A=k<<1;D=a[t+A>>0]|0;a[z+A>>0]=D;B=a[w+A>>0]|0;a[v+A>>0]=B;A=A+ -2|0;C=(A|0)>-1;if(C){E=A;while(1){ja=E+1|0;ia=D;D=a[t+ja>>0]|0;a[z+ja>>0]=((ia&255)+2+((D&255)<<1)+(d[t+E>>0]|0)|0)>>>2;if((E|0)<=0)break;else E=E+ -1|0}}ja=((d[u>>0]|0)+2+((F&255)<<1)+(d[y>>0]|0)|0)>>>2&255;a[z>>0]=ja;a[v>>0]=ja;if(C)while(1){ja=A+1|0;ia=B;B=a[w+ja>>0]|0;a[v+ja>>0]=((ia&255)+2+((B&255)<<1)+(d[w+A>>0]|0)|0)>>>2;if((A|0)<=0){u=x;break}else A=A+ -1|0}else u=x}else s=y}else s=y;while(0);if(!p){Xb(n,s,u,b,g);i=j;return}else if((p|0)==1){if((k|0)>0){p=k;h=0;do{p=(d[u+h>>0]|0)+p+(d[s+h>>0]|0)|0;h=h+1|0}while((h|0)!=(k|0));q=p>>g+1;r=$(q,16843009)|0;g=0;do{p=($(g,b)|0)+m|0;h=0;do{ja=l+(p+h)|0;a[ja>>0]=r;a[ja+1>>0]=r>>8;a[ja+2>>0]=r>>16;a[ja+3>>0]=r>>24;h=h+4|0}while((h|0)<(k|0));g=g+1|0}while((g|0)!=(k|0))}else q=k>>g+1;if(!(o&(k|0)<32)){i=j;return}a[n>>0]=((q<<1)+2+(d[u>>0]|0)+(d[s>>0]|0)|0)>>>2;if((k|0)<=1){i=j;return}n=(q*3|0)+2|0;o=1;do{a[l+(o+m)>>0]=((d[s+o>>0]|0)+n|0)>>>2;o=o+1|0}while((o|0)!=(k|0));o=1;do{a[l+(($(o,b)|0)+m)>>0]=((d[u+o>>0]|0)+n|0)>>>2;o=o+1|0}while((o|0)!=(k|0));i=j;return}else{if(!(c[q+13104>>2]|0))l=0;else l=(a[r+31256>>0]|0)!=0;Yb(n,s,u,b,h,p,k,l&1);i=j;return}}function Xb(b,c,e,f,g){b=b|0;c=c|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;m=i;j=1<>0]|0,l-r|0)|0;s=r;r=r+1|0;u=$(d[h>>0]|0,r)|0;t=$(d[c+s>>0]|0,p)|0;a[b+(s+q)>>0]=v+j+u+t+($(d[k>>0]|0,n)|0)>>g}while((r|0)!=(j|0))}while((n|0)!=(j|0));i=m;return}function Yb(c,e,f,g,h,j,k,l){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;m=i;i=i+112|0;o=m;n=a[1592+(j+ -2)>>0]|0;p=o+k|0;q=($(n,k)|0)>>5;if((j|0)>17){s=e+ -1|0;r=j+ -11|0;if(r>>>0<15&(q|0)<-1){if((k|0)>=0){s=0;do{u=e+(s+ -1)|0;u=d[u>>0]|d[u+1>>0]<<8|d[u+2>>0]<<16|d[u+3>>0]<<24;v=o+(s+k)|0;a[v>>0]=u;a[v+1>>0]=u>>8;a[v+2>>0]=u>>16;a[v+3>>0]=u>>24;s=s+4|0}while((s|0)<=(k|0))}if((q|0)<0){r=b[1632+(r<<1)>>1]|0;do{a[o+(q+k)>>0]=a[f+((($(r,q)|0)+128>>8)+ -1)>>0]|0;q=q+1|0}while((q|0)!=0)}}else p=s;o=(k|0)>0;if(o){q=0;do{u=q;q=q+1|0;s=$(q,n)|0;r=s>>5;s=s&31;if(!s){r=r+1|0;s=$(u,g)|0;t=0;do{u=p+(r+t)|0;u=d[u>>0]|d[u+1>>0]<<8|d[u+2>>0]<<16|d[u+3>>0]<<24;v=c+(t+s)|0;a[v>>0]=u;a[v+1>>0]=u>>8;a[v+2>>0]=u>>16;a[v+3>>0]=u>>24;t=t+4|0}while((t|0)<(k|0))}else{t=32-s|0;v=$(u,g)|0;u=0;do{w=u+r|0;x=$(d[p+(w+1)>>0]|0,t)|0;a[c+(u+v)>>0]=(x+16+($(d[p+(w+2)>>0]|0,s)|0)|0)>>>5;w=u|1;x=w+r|0;y=$(d[p+(x+1)>>0]|0,t)|0;a[c+(w+v)>>0]=(y+16+($(d[p+(x+2)>>0]|0,s)|0)|0)>>>5;w=u|2;x=w+r|0;y=$(d[p+(x+1)>>0]|0,t)|0;a[c+(w+v)>>0]=(y+16+($(d[p+(x+2)>>0]|0,s)|0)|0)>>>5;w=u|3;x=w+r|0;y=$(d[p+(x+1)>>0]|0,t)|0;a[c+(w+v)>>0]=(y+16+($(d[p+(x+2)>>0]|0,s)|0)|0)>>>5;u=u+4|0}while((u|0)<(k|0))}}while((q|0)!=(k|0))}if(!((j|0)==26&(h|0)==0&(k|0)<32&(l|0)==0&o)){i=m;return}j=f+ -1|0;n=0;do{h=((d[f+n>>0]|0)-(d[j>>0]|0)>>1)+(d[e>>0]|0)|0;if(h>>>0>255)h=0-h>>31;a[c+($(n,g)|0)>>0]=h;n=n+1|0}while((n|0)!=(k|0));i=m;return}s=f+ -1|0;r=j+ -11|0;if(r>>>0<15&(q|0)<-1){if((k|0)>=0){s=0;do{x=f+(s+ -1)|0;x=d[x>>0]|d[x+1>>0]<<8|d[x+2>>0]<<16|d[x+3>>0]<<24;y=o+(s+k)|0;a[y>>0]=x;a[y+1>>0]=x>>8;a[y+2>>0]=x>>16;a[y+3>>0]=x>>24;s=s+4|0}while((s|0)<=(k|0))}if((q|0)<0){r=b[1632+(r<<1)>>1]|0;do{a[o+(q+k)>>0]=a[e+((($(r,q)|0)+128>>8)+ -1)>>0]|0;q=q+1|0}while((q|0)!=0)}}else p=s;q=(k|0)>0;if(q){o=0;do{r=o;o=o+1|0;t=$(o,n)|0;u=t>>5;t=t&31;if(!t){s=u+1|0;t=0;do{a[c+(($(t,g)|0)+r)>>0]=a[p+(s+t)>>0]|0;t=t+1|0}while((t|0)!=(k|0))}else{s=32-t|0;v=0;do{y=v+u|0;x=$(d[p+(y+1)>>0]|0,s)|0;a[c+(($(v,g)|0)+r)>>0]=(x+16+($(d[p+(y+2)>>0]|0,t)|0)|0)>>>5;v=v+1|0}while((v|0)!=(k|0))}}while((o|0)!=(k|0))}if(!((j|0)==10&(h|0)==0&(k|0)<32&(l|0)==0&q)){i=m;return}g=e+ -1|0;n=0;do{j=((d[e+n>>0]|0)-(d[g>>0]|0)>>1)+(d[f>>0]|0)|0;if(j>>>0>255)j=0-j>>31;a[c+n>>0]=j;j=n|1;h=((d[e+j>>0]|0)-(d[g>>0]|0)>>1)+(d[f>>0]|0)|0;if(h>>>0>255)h=0-h>>31;a[c+j>>0]=h;j=n|2;h=((d[e+j>>0]|0)-(d[g>>0]|0)>>1)+(d[f>>0]|0)|0;if(h>>>0>255)h=0-h>>31;a[c+j>>0]=h;j=n|3;h=((d[e+j>>0]|0)-(d[g>>0]|0)>>1)+(d[f>>0]|0)|0;if(h>>>0>255)h=0-h>>31;a[c+j>>0]=h;n=n+4|0}while((n|0)<(k|0));i=m;return}function Zb(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0;g=i;h=c[e>>2]|0;if(!h){i=g;return}if(!(c[h+304>>2]|0)){i=g;return}h=e+46|0;f=(d[h>>0]|0)&(f^255)&255;a[h>>0]=f;if(f<<24>>24){i=g;return}Wc(c[b+4>>2]|0,e+4|0);c[e+24>>2]=0;i=g;return}function _b(a){a=a|0;var b=0;b=i;Zb(a,a+2524|0,6);i=b;return}function $b(a){a=a|0;var b=0;b=i;Zb(a,a+2524|0,-1);i=b;return}function ac(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;g=i;h=d+4364|0;if(((c[(c[d+2524>>2]|0)+304>>2]|0)!=0?(b[d+2568>>1]|0)==(b[h>>1]|0):0)?(c[d+2544>>2]|0)==(f|0):0){j=-1094995529;i=g;return j|0}j=d+2524|0;if(c[(c[j>>2]|0)+304>>2]|0){j=-12;i=g;return j|0}if((Vc(c[d+4>>2]|0,d+2528|0,1)|0)<0){j=-12;i=g;return j|0}k=d+200|0;m=c[k>>2]|0;c[d+2540>>2]=$(c[m+13132>>2]|0,c[m+13128>>2]|0)|0;m=d+4520|0;l=c[j>>2]|0;c[l+244>>2]=(c[m>>2]|0)==1&1;c[l+240>>2]=((c[m>>2]|0)+ -1|0)>>>0<2&1;c[e>>2]=l;c[d+2520>>2]=j;a[d+2570>>0]=(a[d+1450>>0]|0)==0?2:3;c[d+2544>>2]=f;b[d+2568>>1]=b[h>>1]|0;j=d+2552|0;f=(c[k>>2]|0)+20|0;c[j+0>>2]=c[f+0>>2];c[j+4>>2]=c[f+4>>2];c[j+8>>2]=c[f+8>>2];c[j+12>>2]=c[f+12>>2];j=0;i=g;return j|0}function bc(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,p=0;g=i;l=d+2046|0;k=d+2572|0;h=d+4366|0;n=(f|0)==0;m=d+4364|0;f=d+200|0;while(1){if((a[l>>0]|0)==1){p=d+2524|0;o=d+2570|0;if(((a[o>>0]&8)==0?(c[d+2544>>2]|0)!=(c[k>>2]|0):0)?(b[d+2568>>1]|0)==(b[h>>1]|0):0)Zb(d,p,1)}else o=d+2570|0;if(!(a[o>>0]&1))o=0;else o=(b[d+2568>>1]|0)==(b[h>>1]|0)&1;if(((n?(b[h>>1]|0)==(b[m>>1]|0):0)?(j=c[f>>2]|0,(j|0)!=0):0)?(o|0)<=(c[j+(((c[j+72>>2]|0)+ -1|0)*12|0)+80>>2]|0):0){d=0;h=21;break}if(o){h=15;break}o=b[h>>1]|0;if(o<<16>>16==(b[m>>1]|0)){d=0;h=21;break}b[h>>1]=(o&65535)+1&255}if((h|0)==15){h=d+2524|0;e=Bd(e,c[h>>2]|0)|0;if(!(a[d+2570>>0]&8))Zb(d,h,1);else Zb(d,h,9);p=(e|0)<0?e:1;i=g;return p|0}else if((h|0)==21){i=g;return d|0}return 0}function cc(){var b=0,c=0,d=0,e=0,f=0;b=i;if(!(a[1664]|0))c=0;else{i=b;return}do{d=0;do{f=($(d<<1|1,c)|0)&127;e=f>>>0>63;f=e?f+ -64|0:f;e=e?-1:1;if((f|0)>31){f=64-f|0;e=0-e|0}a[1664+(c<<5)+d>>0]=$(a[2688+f>>0]|0,e)|0;d=d+1|0}while((d|0)!=32);c=c+1|0}while((c|0)!=32);i=b;return}function dc(a,b){a=a|0;b=b|0;c[a>>2]=1;c[a+4>>2]=1;c[a+8>>2]=2;c[a+12>>2]=3;c[a+16>>2]=4;c[a+20>>2]=1;c[a+24>>2]=5;c[a+28>>2]=2;c[a+32>>2]=2;c[a+36>>2]=3;c[a+40>>2]=4;c[a+44>>2]=5;c[a+48>>2]=3;c[a+52>>2]=4;c[a+56>>2]=5;c[a+60>>2]=6;c[a+64>>2]=1;c[a+68>>2]=1;c[a+72>>2]=2;c[a+1676>>2]=2;c[a+1680>>2]=3;c[a+1684>>2]=1;c[a+1688>>2]=2;c[a+1692>>2]=2;c[a+1696>>2]=3;c[a+1700>>2]=1;c[a+1704>>2]=2;return}function ec(b,c,d,e,f,g){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0;h=i;if((e|0)<=0){i=h;return}k=(d|0)>0;j=8-g|0;m=0;while(1){if(k){l=0;do{a[b+l>>0]=(ad(f,g)|0)<>1]|0)+(d[l>>0]|0)|0;if(m>>>0>255)m=0-m>>31;a[l>>0]=m;k=k+1|0;if((k|0)==4)break;else j=j+2|0}h=h+1|0;if((h|0)==4)break;else{e=e+8|0;c=c+f|0}}i=g;return}function gc(c,e,f){c=c|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;h=0;while(1){j=e;k=0;while(1){l=c+k|0;m=(b[j>>1]|0)+(d[l>>0]|0)|0;if(m>>>0>255)m=0-m>>31;a[l>>0]=m;k=k+1|0;if((k|0)==8)break;else j=j+2|0}h=h+1|0;if((h|0)==8)break;else{e=e+16|0;c=c+f|0}}i=g;return}function hc(c,e,f){c=c|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;h=0;while(1){j=e;k=0;while(1){l=c+k|0;m=(b[j>>1]|0)+(d[l>>0]|0)|0;if(m>>>0>255)m=0-m>>31;a[l>>0]=m;k=k+1|0;if((k|0)==16)break;else j=j+2|0}h=h+1|0;if((h|0)==16)break;else{e=e+32|0;c=c+f|0}}i=g;return}function ic(c,e,f){c=c|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;h=0;while(1){j=e;k=0;while(1){l=c+k|0;m=(b[j>>1]|0)+(d[l>>0]|0)|0;if(m>>>0>255)m=0-m>>31;a[l>>0]=m;k=k+1|0;if((k|0)==32)break;else j=j+2|0}h=h+1|0;if((h|0)==32)break;else{e=e+64|0;c=c+f|0}}i=g;return}function jc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;c=c<<16>>16;e=7-c|0;c=1<0){f=1<0)g=0;else{i=d;return}while(1){h=a;j=0;while(1){b[h>>1]=(b[h>>1]|0)+f>>e;j=j+1|0;if((j|0)==(c|0))break;else h=h+2|0}g=g+1|0;if((g|0)==(c|0))break;else a=a+(c<<1)|0}i=d;return}if((c|0)<=0){i=d;return}e=0-e|0;f=0;while(1){g=a;h=0;while(1){b[g>>1]=b[g>>1]<>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 Qa(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 Ra(a){a=a|0;D=a}function Sa(){return D|0}function Ta(b,d){b=b|0;d=d|0;var e=0,f=0;e=i;if(!(a[(c[b+204>>2]|0)+43>>0]|0)){i=e;return}f=c[(c[b+200>>2]|0)+13128>>2]|0;d=(d|0)%(f|0)|0;if((d|0)!=2?!((f|0)==2&(d|0)==0):0){i=e;return}ee(c[b+152>>2]|0,c[b+136>>2]|0,199)|0;i=e;return}function Ua(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;g=b+204|0;f=c[g>>2]|0;if((c[(c[f+1668>>2]|0)+(c[b+2500>>2]<<2)>>2]|0)==(d|0)){Va(b);f=b+1449|0;if(a[f>>0]|0){j=c[g>>2]|0;if((a[j+42>>0]|0)!=0?(j=c[j+1676>>2]|0,(c[j+(d<<2)>>2]|0)!=(c[j+(d+ -1<<2)>>2]|0)):0)h=5}else h=5;if((h|0)==5)Wa(b);if(a[b+1448>>0]|0){i=e;return}if(!(a[(c[g>>2]|0)+43>>0]|0)){i=e;return}g=c[(c[b+200>>2]|0)+13128>>2]|0;if((d|0)%(g|0)|0){i=e;return}if((g|0)==1){Wa(b);i=e;return}if((a[f>>0]|0)!=1){i=e;return}ee(c[b+136>>2]|0,c[b+152>>2]|0,199)|0;i=e;return}if((a[f+42>>0]|0)!=0?(j=c[f+1676>>2]|0,(c[j+(d<<2)>>2]|0)!=(c[j+(d+ -1<<2)>>2]|0)):0){if((a[b+141>>0]|0)==1)Xa(c[b+136>>2]|0);else Va(b);Wa(b);f=c[g>>2]|0}if(!(a[f+43>>0]|0)){i=e;return}f=b+200|0;if((d|0)%(c[(c[f>>2]|0)+13128>>2]|0)|0){i=e;return}d=b+136|0;Ya((c[d>>2]|0)+224|0)|0;if((a[b+141>>0]|0)==1)Xa(c[d>>2]|0);else Va(b);if((c[(c[f>>2]|0)+13128>>2]|0)==1){Wa(b);i=e;return}else{ee(c[d>>2]|0,c[b+152>>2]|0,199)|0;i=e;return}}function Va(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;e=a+136|0;a=c[e>>2]|0;d=a+204|0;ad(d,1);g=a+212|0;f=c[g>>2]|0;h=0-f&7;if(h){ad(d,h);f=c[g>>2]|0}Yc((c[e>>2]|0)+224|0,(c[d>>2]|0)+((f|0)/8|0)|0,(7-f+(c[a+216>>2]|0)|0)/8|0);i=b;return}function Wa(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;g=i;f=c[b+1440>>2]|0;e=2-f|0;e=(a[b+2060>>0]|0)==0|(f|0)==2?e:e^3;f=b+2112|0;b=b+136|0;h=0;do{j=d[680+(e*199|0)+h>>0]|0;l=a[f>>0]|0;k=l<<24>>24;if(l<<24>>24<0)k=0;else k=(k|0)>51?51:k;j=((j<<3&120)+ -16+(($(k,((j>>>4)*5|0)+ -45|0)|0)>>4)<<1)+ -127|0;j=j>>31^j;if((j|0)>124)j=j&1|124;a[(c[b>>2]|0)+h>>0]=j;h=h+1|0}while((h|0)!=199);a[(c[b>>2]|0)+199>>0]=0;a[(c[b>>2]|0)+200>>0]=0;a[(c[b>>2]|0)+201>>0]=0;a[(c[b>>2]|0)+202>>0]=0;i=g;return}function Xa(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=a+224|0;e=c[a+240>>2]|0;f=c[d>>2]|0;e=(f&1|0)==0?e:e+ -1|0;e=(f&511|0)==0?e:e+ -1|0;a=(c[a+244>>2]|0)-e|0;if((a|0)<0){i=b;return}Yc(d,e,a);i=b;return}function Ya(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;f=a+4|0;d=c[f>>2]|0;e=d+ -2|0;c[f>>2]=e;g=c[a>>2]|0;if((g|0)>=(e<<17|0)){g=(c[a+16>>2]|0)-(c[a+12>>2]|0)|0;i=b;return g|0}d=(d+ -258|0)>>>31;c[f>>2]=e<>2]=g;if(g&65535){g=0;i=b;return g|0}yb(a);g=0;i=b;return g|0}function Za(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=_a(a+224|0,a)|0;i=b;return a|0}function _a(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;h=d[e>>0]|0;j=b+4|0;k=c[j>>2]|0;l=d[2880+((k<<1&384)+(h|512))>>0]|0;k=k-l|0;m=k<<17;n=c[b>>2]|0;g=m-n>>31;c[b>>2]=n-(g&m);c[j>>2]=(g&l-k)+k;h=g^h;a[e>>0]=a[h+4032>>0]|0;e=h&1;h=c[j>>2]|0;g=d[2880+h>>0]|0;c[j>>2]=h<>2]<>2]=g;if(g&65535){i=f;return e|0}j=b+16|0;h=c[j>>2]|0;c[b>>2]=(((d[h+1>>0]|0)<<1|(d[h>>0]|0)<<9)+ -65535<<7-(d[2880+((g+ -1^g)>>15)>>0]|0))+g;if(h>>>0>=(c[b+20>>2]|0)>>>0){i=f;return e|0}c[j>>2]=h+2;i=f;return e|0}function $a(a){a=a|0;var b=0,d=0;b=i;a=a+136|0;d=c[a>>2]|0;if(!(_a(d+224|0,d+1|0)|0)){d=0;i=b;return d|0}d=(ab((c[a>>2]|0)+224|0)|0)==0;d=d?1:2;i=b;return d|0}function ab(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[a>>2]<<1;c[a>>2]=d;if(!(d&65534)){yb(a);d=c[a>>2]|0}e=c[a+4>>2]<<17;if((d|0)<(e|0)){e=0;i=b;return e|0}c[a>>2]=d-e;e=1;i=b;return e|0}function bb(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(ab((c[d>>2]|0)+224|0)|0)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=ab((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function cb(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;d=c[(c[a+200>>2]|0)+52>>2]|0;d=(d|0)>10?31:(1<0)a=0;else{f=0;i=b;return f|0}while(1){f=a+1|0;if(!(ab((c[e>>2]|0)+224|0)|0)){d=4;break}if((f|0)<(d|0))a=f;else{a=f;d=4;break}}if((d|0)==4){i=b;return a|0}return 0}function db(a){a=a|0;var b=0;b=i;a=ab((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function eb(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(ab((c[d>>2]|0)+224|0)|0)<<1;a=ab((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function fb(a){a=a|0;var b=0;b=i;a=Ya((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function gb(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+5|0)|0;i=b;return a|0}function hb(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;a=a+136|0;g=9;e=0;while(1){h=c[a>>2]|0;f=e;e=e+1|0;if(!(_a(h+224|0,h+g|0)|0)){e=f;g=0;break}if((e|0)>=5){f=0;g=0;d=4;break}else g=10}do if((d|0)==4){while(1){d=0;if(!(ab((c[a>>2]|0)+224|0)|0)){d=5;break}g=(1<>2]|0)+224|0)|0)<>2]|0)+224|0)|0;i=b;return a|0}function jb(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+176|0)|0;i=b;return a|0}function kb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;e=a[(c[b+204>>2]|0)+1633>>0]|0;e=(e&255)<5?5:e&255;f=b+136|0;if(!e){g=0;i=d;return g|0}else b=0;while(1){h=c[f>>2]|0;g=b+1|0;if(!(_a(h+224|0,h+177|0)|0)){e=4;break}if((g|0)<(e|0))b=g;else{b=g;e=4;break}}if((e|0)==4){i=d;return b|0}return 0}function lb(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;j=i;k=c[b+200>>2]|0;n=(1<>2])+ -1|0;l=n&g;m=c[k+13064>>2]|0;h=f>>m;m=g>>m;g=c[b+136>>2]|0;if((a[g+308>>0]|0)==0?(n&f|0)==0:0)f=0;else{f=h+ -1+($(c[k+13140>>2]|0,m)|0)|0;f=d[(c[b+4336>>2]|0)+f>>0]|0}if((a[g+309>>0]|0)==0&(l|0)==0){n=0;m=(f|0)>(e|0);m=m&1;n=(n|0)>(e|0);n=n&1;f=g+224|0;m=m|2;n=m+n|0;n=g+n|0;n=_a(f,n)|0;i=j;return n|0}n=($(c[k+13140>>2]|0,m+ -1|0)|0)+h|0;n=d[(c[b+4336>>2]|0)+n>>0]|0;m=(f|0)>(e|0);m=m&1;n=(n|0)>(e|0);n=n&1;f=g+224|0;m=m|2;n=m+n|0;n=g+n|0;n=_a(f,n)|0;i=j;return n|0}function mb(a,b){a=a|0;b=b|0;var d=0;d=i;b=c[a+136>>2]|0;b=(_a(b+224|0,b+13|0)|0)==0;i=d;return(b?3:0)|0}function nb(a){a=a|0;var b=0;b=i;a=Ya((c[a+136>>2]|0)+224|0)|0;i=b;return a|0}function ob(a){a=a|0;var b=0;b=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+17|0)|0;i=b;return a|0}function pb(a){a=a|0;var b=0,d=0,e=0;b=i;e=a+136|0;d=0;while(1){a=d+1|0;if(!(ab((c[e>>2]|0)+224|0)|0)){a=d;d=4;break}if((a|0)<2)d=a;else{d=4;break}}if((d|0)==4){i=b;return a|0}return 0}function qb(a){a=a|0;var b=0,d=0;b=i;d=a+136|0;a=(ab((c[d>>2]|0)+224|0)|0)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=(ab((c[d>>2]|0)+224|0)|0|a)<<1;a=ab((c[d>>2]|0)+224|0)|0|a;i=b;return a|0}function rb(a){a=a|0;var b=0,d=0;b=i;a=a+136|0;d=c[a>>2]|0;if(!(_a(d+224|0,d+18|0)|0)){d=4;i=b;return d|0}d=(ab((c[a>>2]|0)+224|0)|0)<<1;d=ab((c[a>>2]|0)+224|0)|0|d;i=b;return d|0}function sb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+(42-b)|0)|0;i=d;return a|0}function tb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+(b+42)|0)|0;i=d;return a|0}function ub(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+((b|0)==0|40)|0)|0;i=d;return a|0}function vb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;a=a+136|0;f=(b<<2)+166|0;e=0;while(1){g=c[a>>2]|0;b=e+1|0;if(!(_a(g+224|0,g+(f+e)|0)|0)){b=e;a=4;break}if((b|0)<4)e=b;else{a=4;break}}if((a|0)==4){i=d;return b|0}return 0}function wb(a,b){a=a|0;b=b|0;var d=0;d=i;a=c[a+136>>2]|0;a=_a(a+224|0,a+(b+174)|0)|0;i=d;return a|0}function xb(f,g,h,j,k,l){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,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,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,Ba=0,Ca=0,Da=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0;n=i;i=i+96|0;v=n+24|0;s=n+8|0;t=n;u=f+136|0;o=c[u>>2]|0;p=c[f+160>>2]|0;m=c[p+(l<<2)+32>>2]|0;r=f+200|0;T=c[r>>2]|0;h=$(h>>c[T+(l<<2)+13180>>2],m)|0;h=(c[p+(l<<2)>>2]|0)+(h+(g>>c[T+(l<<2)+13168>>2]<>2]))|0;T=(l|0)!=0;g=o+320|0;p=T?o+11680|0:g;x=v+0|0;q=x+64|0;do{a[x>>0]=0;x=x+1|0}while((x|0)<(q|0));S=1<>2]|0;q=S<>0]|0)){A=a[o+272>>0]|0;C=f+204|0;Ma=c[C>>2]|0;if((a[Ma+21>>0]|0)!=0?(d[Ma+1629>>0]|0)>=(j|0):0){F=c[u>>2]|0;F=_a(F+224|0,F+(T&1|46)|0)|0}else F=0;if(y){B=c[r>>2]|0;G=B;B=(c[B+13192>>2]|0)+A|0}else{B=c[C>>2]|0;if((l|0)==1)B=(c[f+2072>>2]|0)+(c[B+28>>2]|0)+(a[o+302>>0]|0)|0;else B=(c[f+2076>>2]|0)+(c[B+32>>2]|0)+(a[o+303>>0]|0)|0;B=B+A|0;G=c[r>>2]|0;A=c[G+13192>>2]|0;E=0-A|0;if((B|0)>=(E|0))E=(B|0)>57?57:B;do if((c[G+4>>2]|0)==1){if((E|0)>=30)if((E|0)>43){E=E+ -6|0;break}else{E=c[176+(E+ -30<<2)>>2]|0;break}}else E=(E|0)>51?51:E;while(0);B=A+E|0}A=(c[G+52>>2]|0)+j|0;E=A+ -5|0;A=1<>0]|0)>>0]<>0];if((a[G+634>>0]|0)!=0?!((F|0)!=0&(j|0)>2):0){H=c[C>>2]|0;G=(a[H+68>>0]|0)==0?G+635|0:H+69|0;H=((c[o+31244>>2]|0)!=1?3:0)+l|0;C=G+((j+ -2|0)*384|0)+(H<<6)|0;if((j|0)>3)ia=a[G+((j+ -4|0)*6|0)+H+1536>>0]|0;else ia=16}else{ia=16;C=0}}else{A=0;ia=0;B=0;C=0;E=0;F=0}I=(j<<1)+ -1|0;if(y){G=(j*3|0)+ -6+(j+ -1>>2)|0;J=j+1>>2}else{G=15;J=j+ -2|0}if((I|0)>0){L=G+52|0;H=0;while(1){Ma=c[u>>2]|0;K=H+1|0;if(!(_a(Ma+224|0,Ma+(L+(H>>J))|0)|0))break;if((K|0)<(I|0))H=K;else{H=K;break}}K=G+70|0;G=0;while(1){Ma=c[u>>2]|0;L=G+1|0;if(!(_a(Ma+224|0,Ma+(K+(G>>J))|0)|0))break;if((L|0)<(I|0))G=L;else{G=L;break}}if((H|0)>3){I=(H>>1)+ -1|0;K=ab((c[u>>2]|0)+224|0)|0;if((I|0)>1){J=1;do{K=ab((c[u>>2]|0)+224|0)|0|K<<1;J=J+1|0}while((J|0)!=(I|0))}H=K+((H&1|2)<3){J=(G>>1)+ -1|0;K=ab((c[u>>2]|0)+224|0)|0;if((J|0)>1){I=1;do{K=ab((c[u>>2]|0)+224|0)|0|K<<1;I=I+1|0}while((I|0)!=(J|0))}I=H;L=K+((G&1|2)<>2;N=L>>2;if((k|0)==1){G=I;H=L;P=d[536+(L<<3)+I>>0]|0;J=488;K=504;L=496;I=520;break}else if(k){J=I;K=L;w=49;break}P=d[(I&3)+(392+((L&3)<<2))>>0]|0;if((S|0)==8){G=I;H=L;P=(d[416+(N<<1)+M>>0]<<4)+P|0;J=496;K=8;L=488;I=24;break}else if((S|0)==16){G=I;H=L;P=(d[392+(N<<2)+M>>0]<<4)+P|0;J=8;K=8;L=24;I=24;break}else if((S|0)==4){G=I;H=L;J=408;K=8;L=408;I=24;break}else{G=I;H=L;P=(d[424+(N<<3)+M>>0]<<4)+P|0;J=40;K=8;L=104;I=24;break}}else{J=L;K=I;M=L>>2;N=I>>2;w=49}while(0);if((w|0)==49){G=J;H=K;P=d[536+(J<<3)+K>>0]|0;J=496;K=520;L=488;I=504}O=P+1|0;P=P>>4;if((P|0)>-1){Q=(1<0;l=R?90:88;S=S+ -1>>2;W=T?27:0;U=(j|0)==2;T=W+3|0;V=(j|0)==3;Z=(k|0)==0?9:15;_=y?0:27;da=(F|0)==0;aa=y?42:43;fa=y?40:41;ba=y?2:0;ea=o+31244|0;ca=x&-17;ga=f+204|0;Y=((B|0)<0)<<31>>31;X=((A|0)<0)<<31>>31;ha=(F|0)!=0&(j|0)>2;k=(j|0)<4;ia=ia&255;ma=(y&1)<<1;ja=ma|1;ra=1;ka=P;oa=0;xa=16;while(1){na=ka<<4;wa=a[J+ka>>0]|0;ta=wa&255;va=a[L+ka>>0]|0;ua=va&255;la=(ka|0)>0;if((ka|0)<(P|0)&la){if((ta|0)<(Q|0))pa=d[v+(ta+1<<3)+ua>>0]|0;else pa=0;if((ua|0)<(Q|0))pa=(d[ua+1+(v+(ta<<3))>>0]|0)+pa|0;ya=c[u>>2]|0;ya=(_a(ya+224|0,ya+(((pa|0)>1?1:pa)+l)|0)|0)&255;a[v+(ta<<3)+ua>>0]=ya;qa=1}else{if(!((ta|0)==(M|0)&(ua|0)==(N|0)))if(!(wa<<24>>24))ya=va<<24>>24==0&1;else ya=0;else ya=1;a[v+(ta<<3)+ua>>0]=ya;qa=0}na=O-na|0;pa=(ka|0)==(P|0);if(pa){a[s>>0]=na+255;sa=na+ -2|0;na=1}else{sa=15;na=0}if((ta|0)<(S|0))Ba=(a[v+(ta+1<<3)+ua>>0]|0)!=0&1;else Ba=0;if((ua|0)<(S|0))Ba=((a[ua+1+(v+(ta<<3))>>0]|0)!=0&1)<<1|Ba;do if(ya<<24>>24!=0&(sa|0)>-1){if(!(c[(c[r>>2]|0)+13100>>2]|0))if(U){wa=600;va=W}else w=73;else if(da){ya=(a[z>>0]|0)!=0;if(ya|U){wa=ya?664:600;va=ya?fa:W}else w=73}else{wa=664;va=fa}do if((w|0)==73){w=0;ya=(Ba<<4)+616|0;if(!y){wa=ya;va=W+(V?9:12)|0;break}va=(va|wa)<<24>>24==0?W:T;if(V){wa=ya;va=va+Z|0;break}else{wa=ya;va=va+21|0;break}}while(0);if((sa|0)>0){ya=va+92|0;do{Ma=c[u>>2]|0;if(_a(Ma+224|0,Ma+(ya+(d[wa+((d[I+sa>>0]<<2)+(d[K+sa>>0]|0))>>0]|0))|0)|0){a[s+(na&255)>>0]=sa;qa=0;na=na+1<<24>>24}sa=sa+ -1|0}while((sa|0)>0)}if(qa){a[s+(na&255)>>0]=0;qa=na+1<<24>>24;break}if(c[(c[r>>2]|0)+13100>>2]|0)if(da?(a[z>>0]|0)==0:0)w=87;else qa=aa;else w=87;if((w|0)==87){w=0;qa=(ka|0)==0?_:va+2|0}Ma=c[u>>2]|0;if((_a(Ma+224|0,Ma+(qa+92)|0)|0)==1){a[s+(na&255)>>0]=0;qa=na+1<<24>>24}else qa=na}else qa=na;while(0);na=qa&255;a:do if(qa<<24>>24){qa=la?ba:0;if(!(c[(c[r>>2]|0)+13116>>2]|0))Ga=0;else{if(da?(a[z>>0]|0)==0:0)oa=ma;else oa=ja;Ga=(d[o+oa+199>>0]|0)>>>2}sa=qa|(ra|0)==0&(pa^1)&1;Da=a[s>>0]|0;va=Da&255;qa=na>>>0>8?8:na;if(!qa){pa=-1;ra=1}else{ya=sa<<2;pa=-1;ra=1;wa=0;do{Ma=ra+ya|0;La=c[u>>2]|0;Ma=(_a(La+224|0,La+((R?Ma+16|0:Ma)+136)|0)|0)&255;a[t+wa>>0]=Ma;if(!(Ma<<24>>24))ra=((ra+ -1|0)>>>0<2&1)+ra|0;else{pa=(pa|0)==-1?wa:pa;ra=0}wa=wa+1|0}while((wa|0)<(qa|0))}wa=na+ -1|0;qa=a[s+wa>>0]|0;ya=qa&255;do if(!(a[z>>0]|0)){if((c[ea>>2]|0)==1?!((c[(c[r>>2]|0)+13104>>2]|0)==0|da|(ca|0)!=10):0){va=0;break}va=(va-ya|0)>3&1}else va=0;while(0);if((pa|0)!=-1){La=c[u>>2]|0;La=_a(La+224|0,La+((R?sa|4:sa)|160)|0)|0;Ma=t+pa|0;a[Ma>>0]=(d[Ma>>0]|0)+La}sa=(va|0)==0;if((a[(c[ga>>2]|0)+4>>0]|0)==0|sa){wa=0;va=0;do{va=ab((c[u>>2]|0)+224|0)|0|va<<1;wa=wa+1|0}while((wa|0)<(na|0));Ba=va<<16-na}else{va=wa&255;if(!((wa&255)<<24>>24))ya=0;else{wa=0;ya=0;do{ya=ab((c[u>>2]|0)+224|0)|0|ya<<1;wa=wa+1|0}while((wa|0)<(va|0))}Ba=ya<<17-na}ta=ta<<2;va=ua<<2;ua=o+oa+199|0;wa=0;Ha=0;Ca=xa;Fa=0;while(1){xa=Da&255;ya=(d[K+xa>>0]|0)+ta|0;xa=(d[I+xa>>0]|0)+va|0;b:do if((wa|0)<8){Ia=(d[t+wa>>0]|0)+1|0;Ma=(wa|0)==(pa|0);if((Ia|0)==((Ma?3:2)|0)&0==((Ma?0:0)|0))Ja=0;else{Ja=0;break}while(1){Ka=Ja+1|0;if(!(ab((c[u>>2]|0)+224|0)|0)){w=120;break}if((Ka|0)<31)Ja=Ka;else{w=124;break}}do if((w|0)==120){w=0;if((Ja|0)>=3){Ka=Ja;w=124;break}if((Ga|0)>0){Ka=0;La=0;do{La=ab((c[u>>2]|0)+224|0)|0|La<<1;Ka=Ka+1|0}while((Ka|0)!=(Ga|0))}else La=0;Ka=La+(Ja<0){La=Ga+ -3+Ka|0;Ka=0;Ma=0;do{Ma=ab((c[u>>2]|0)+224|0)|0|Ma<<1;Ka=Ka+1|0}while((Ka|0)!=(La|0))}else Ma=0;Ka=Ma+((1<>31|0,Ia|0,0)|0;Ja=D;La=3<>31;Ma=c[(c[r>>2]|0)+13116>>2]|0;do if((Ja|0)>(Na|0)|(Ja|0)==(Na|0)&Ia>>>0>La>>>0){La=Ga+1|0;if(Ma){Ga=La;break}Ga=(Ga|0)>3?4:La;break b}while(0);if(!((Ma|0)!=0&(Ha|0)==0))break;Ha=a[ua>>0]|0;La=(Ha&255)>>>2;if((Ka|0)>=(3<>0]=Ha+1<<24>>24;Ha=1;break}if((Ka<<1|0)>=(1<>24==0){Ha=1;break}a[ua>>0]=Ha+ -1<<24>>24;Ha=1}else{Ia=0;while(1){Ja=Ia+1|0;if(!(ab((c[u>>2]|0)+224|0)|0)){w=138;break}if((Ja|0)<31)Ia=Ja;else{w=142;break}}do if((w|0)==138){w=0;if((Ia|0)>=3){Ja=Ia;w=142;break}if((Ga|0)>0){Ja=0;Ka=0;do{Ka=ab((c[u>>2]|0)+224|0)|0|Ka<<1;Ja=Ja+1|0}while((Ja|0)!=(Ga|0))}else Ka=0;Ka=Ka+(Ia<0){Ka=Ga+ -3+Ja|0;Ja=0;La=0;do{La=ab((c[u>>2]|0)+224|0)|0|La<<1;Ja=Ja+1|0}while((Ja|0)!=(Ka|0))}else La=0;Ka=La+((1<>31;Ma=c[(c[r>>2]|0)+13116>>2]|0;do if((Ka|0)>=(3<3?4:La;break b}while(0);if(!((Ma|0)!=0&(Ha|0)==0))break;La=a[ua>>0]|0;Ha=(La&255)>>>2;if((Ka|0)>=(3<>0]=La+1<<24>>24;Ha=1;break}if((Ka<<1|0)>=(1<>24==0){Ha=1;break}a[ua>>0]=La+ -1<<24>>24;Ha=1}while(0);do if(!((a[(c[ga>>2]|0)+4>>0]|0)==0|sa)){Fa=$d(Ia|0,Ja|0,Fa|0,0)|0;if(Da<<24>>24!=qa<<24>>24)break;Na=(Fa&1|0)==0;Ma=_d(0,0,Ia|0,Ja|0)|0;Ia=Na?Ia:Ma;Ja=Na?Ja:D}while(0);Na=(Ba&32768|0)==0;Da=_d(0,0,Ia|0,Ja|0)|0;Da=Na?Ia:Da;Ia=Na?Ja:D;Ba=Ba<<1&131070;Ja=Da&65535;do if(!(a[z>>0]|0)){do if(!((a[(c[r>>2]|0)+634>>0]|0)==0|ha)){if(!((xa|ya|0)!=0|k)){Ca=ia;break}if((j|0)==3)Ca=(xa<<3)+ya|0;else if((j|0)==4)Ca=(xa>>>1<<3)+(ya>>>1)|0;else if((j|0)==5)Ca=(xa>>>2<<3)+(ya>>>2)|0;else Ca=(xa<<2)+ya|0;Ca=d[C+Ca>>0]|0}while(0);Da=je(Da|0,Ia|0,B|0,Y|0)|0;Da=je(Da|0,D|0,Ca|0,((Ca|0)<0)<<31>>31|0)|0;Da=$d(Da|0,D|0,A|0,X|0)|0;Da=Zd(Da|0,D|0,E|0)|0;Ia=D;if((Ia|0)<0){Ja=(Da&-32768|0)==-32768&(Ia&268435455|0)==268435455?Da&65535:-32768;break}else{Ja=Ia>>>0>0|(Ia|0)==0&Da>>>0>32767?32767:Da&65535;break}}while(0);b[p+((xa<>1]=Ja;wa=wa+1|0;if((wa|0)>=(na|0)){xa=Ca;break a}Da=a[s+wa>>0]|0}}while(0);if(la)ka=ka+ -1|0;else break}}do if(a[z>>0]|0){if((c[(c[r>>2]|0)+13104>>2]|0)!=0?(x&-17|0)==10:0)Ea[c[f+2632>>2]&7](p,j&65535,(x|0)==26&1)}else{if(F){if(((j|0)==2?(c[(c[r>>2]|0)+13096>>2]|0)!=0:0)?(c[o+31244>>2]|0)==1:0){s=0;do{La=p+(15-s<<1)|0;Ma=b[La>>1]|0;Na=p+(s<<1)|0;b[La>>1]=b[Na>>1]|0;b[Na>>1]=Ma;s=s+1|0}while((s|0)!=8)}s=j&65535;Aa[c[f+2628>>2]&7](p,s);if(!(c[(c[r>>2]|0)+13104>>2]|0))break;if((c[o+31244>>2]|0)!=1)break;if((x&-17|0)!=10)break;Ea[c[f+2632>>2]&7](p,s,(x|0)==26&1);break}if(y&(c[o+31244>>2]|0)==1&(j|0)==2){za[c[f+2636>>2]&7](p);break}r=(G|0)>(H|0)?G:H;if(!r){za[c[f+(j+ -2<<2)+2656>>2]&7](p);break}s=H+4+G|0;do if((r|0)>=4){if((r|0)<8){s=(s|0)<8?s:8;break}if((r|0)<12)s=(s|0)<24?s:24}else s=(s|0)<4?s:4;while(0);Aa[c[f+(j+ -2<<2)+2640>>2]&7](p,s)}while(0);if(!(a[o+304>>0]|0)){Na=j+ -2|0;Na=f+(Na<<2)+2612|0;Na=c[Na>>2]|0;Ea[Na&7](h,p,m);i=n;return}if((q|0)<=0){Na=j+ -2|0;Na=f+(Na<<2)+2612|0;Na=c[Na>>2]|0;Ea[Na&7](h,p,m);i=n;return}o=c[o+284>>2]|0;r=0;do{Na=p+(r<<1)|0;b[Na>>1]=(($(b[g+(r<<1)>>1]|0,o)|0)>>>3)+(e[Na>>1]|0);r=r+1|0}while((r|0)!=(q|0));Na=j+ -2|0;Na=f+(Na<<2)+2612|0;Na=c[Na>>2]|0;Ea[Na&7](h,p,m);i=n;return}function yb(a){a=a|0;var b=0,e=0,f=0;b=i;f=a+16|0;e=c[f>>2]|0;c[a>>2]=(c[a>>2]|0)+ -65535+((d[e+1>>0]|0)<<1|(d[e>>0]|0)<<9);if(e>>>0>=(c[a+20>>2]|0)>>>0){i=b;return}c[f>>2]=e+2;i=b;return}function zb(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;f=i;h=b+136|0;n=c[h>>2]|0;g=b+200|0;j=c[g>>2]|0;m=c[j+13080>>2]|0;q=(1<>2]|0)+24>>2]|0);o=m&d;p=m&e;k=c[j+13140>>2]|0;j=c[j+13064>>2]|0;l=o>>j;j=p>>j;if(!(q&d))o=0;else o=(o&q|0)!=0;if(!(q&e))p=0;else p=(p&q|0)!=0;q=n+203|0;if((a[q>>0]|0)==0?(m&(e|d)|0)!=0:0)d=c[n+276>>2]|0;else{a[q>>0]=(a[n+300>>0]|0)==0&1;d=a[b+2112>>0]|0}if(o){e=l+ -1+($(j,k)|0)|0;e=a[(c[b+4316>>2]|0)+e>>0]|0}else e=d;if(p){d=($(j+ -1|0,k)|0)+l|0;d=a[(c[b+4316>>2]|0)+d>>0]|0}b=e+1+d>>1;h=c[h>>2]|0;j=c[h+280>>2]|0;if(!j){a[h+272>>0]=b;i=f;return}g=c[(c[g>>2]|0)+13192>>2]|0;b=j+52+b+(g<<1)|0;if((b|0)>0)j=b;else j=-52-g+1+b|0;a[h+272>>0]=b-g-j+((j|0)%(g+52|0)|0);i=f;return}function Ab(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;g=i;j=c[b+136>>2]|0;k=b+200|0;do if((e|0)>0&(e&7|0)==0){if(((a[b+2062>>0]|0)==0?(c[j+31312>>2]&4|0)!=0:0)?((e|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0)break;if(((a[(c[b+204>>2]|0)+53>>0]|0)==0?(c[j+31312>>2]&8|0)!=0:0)?((e|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0)break;h=1<0){l=b+2596|0;m=b+4320|0;n=0;do{o=n+d+($(c[l>>2]|0,e)|0)>>2;a[(c[m>>2]|0)+o>>0]=2;n=n+4|0}while((n|0)<(h|0))}}while(0);if(!((d|0)>0&(d&7|0)==0)){i=g;return}if(((a[b+2062>>0]|0)==0?(c[j+31312>>2]&1|0)!=0:0)?((d|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0){i=g;return}if(((a[(c[b+204>>2]|0)+53>>0]|0)==0?(c[j+31312>>2]&2|0)!=0:0)?((d|0)%(1<>2]|0)+13080>>2]|0)|0|0)==0:0){i=g;return}h=1<>2]|0,k+e|0)|0)+d>>2;a[(c[b>>2]|0)+o>>0]=2;k=k+4|0}while((k|0)<(h|0));i=g;return}function Bb(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var 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,aa=0,ba=0,ca=0,da=0;j=i;i=i+32|0;o=j+8|0;w=j;n=j+18|0;r=j+16|0;l=e+200|0;J=c[l>>2]|0;u=c[J+13120>>2]|0;k=(u-h|0)<=(f|0);b[n>>1]=0;b[r>>1]=0;v=c[J+13080>>2]|0;t=1<>v,c[J+13128>>2]|0)|0)+(f>>v)|0;s=c[e+2508>>2]|0;m=c[s+(v<<3)+4>>2]|0;x=c[s+(v<<3)>>2]|0;if((c[J+68>>2]|0)!=0?(a[J+13056>>0]|0)!=0:0)p=1;else p=(a[(c[e+204>>2]|0)+40>>0]|0)!=0;q=(f|0)!=0;if(q){v=v+ -1|0;y=c[s+(v<<3)>>2]|0;v=c[s+(v<<3)+4>>2]|0}else{y=0;v=0}s=t+f|0;s=(s|0)>(u|0)?u:s;t=t+g|0;z=c[J+13124>>2]|0;t=(t|0)>(z|0)?z:t;z=(s|0)==(u|0)?s:s+ -8|0;u=(t|0)>(g|0);if(u){J=q?f:8;M=(J|0)<(s|0);P=q?f+ -8|0:0;E=e+2596|0;O=e+4320|0;H=e+4316|0;B=w+4|0;C=e+160|0;D=n+1|0;Q=r+1|0;K=e+4300|0;L=e+4284|0;I=e+4324|0;F=e+4304|0;G=e+4288|0;A=(P|0)>=(z|0);T=x;S=m;N=g;do{if(M){R=N+4|0;W=S+ -2&-2;U=J;do{Z=c[E>>2]|0;ba=($(Z,N)|0)+U>>2;_=c[I>>2]|0;ba=a[_+ba>>0]|0;ca=ba&255;Z=a[_+(($(Z,R)|0)+U>>2)>>0]|0;_=Z&255;ba=ba<<24>>24!=0;Z=Z<<24>>24==0;do if(!(Z&(ba^1))){V=U+ -1|0;X=c[l>>2]|0;aa=c[X+13064>>2]|0;Y=$(N>>aa,c[X+13140>>2]|0)|0;da=c[H>>2]|0;aa=(a[da+(Y+(V>>aa))>>0]|0)+1+(a[da+(Y+(U>>aa))>>0]|0)>>1;Y=aa+T|0;if((Y|0)<0)Y=0;else Y=(Y|0)>51?51:Y;Y=d[1280+Y>>0]|0;if(ba){ba=(ca<<1)+W+aa|0;if((ba|0)<0)ba=0;else ba=(ba|0)>53?53:ba;ba=d[1336+ba>>0]|0}else ba=0;c[w>>2]=ba;if(Z)Z=0;else{Z=(_<<1)+W+aa|0;if((Z|0)<0)Z=0;else Z=(Z|0)>53?53:Z;Z=d[1336+Z>>0]|0}c[B>>2]=Z;ca=c[C>>2]|0;Z=c[ca+32>>2]|0;da=$(Z,N)|0;X=(c[ca>>2]|0)+((U<>2])+da)|0;if(p){a[n>>0]=Gb(e,V,N)|0;a[D>>0]=Gb(e,V,R)|0;a[r>>0]=Gb(e,U,N)|0;a[Q>>0]=Gb(e,U,R)|0;Ha[c[F>>2]&3](X,Z,Y,w,n,r);break}else{Ha[c[G>>2]&3](X,Z,Y,w,n,r);break}}while(0);U=U+8|0}while((U|0)<(s|0))}if(!((N|0)==0|A)){R=N+ -1|0;V=S;S=P;do{Y=$(c[E>>2]|0,N)|0;Z=c[O>>2]|0;aa=a[Z+(Y+S>>2)>>0]|0;ba=aa&255;U=S+4|0;Y=a[Z+(Y+U>>2)>>0]|0;Z=Y&255;aa=aa<<24>>24!=0;Y=Y<<24>>24==0;do if(!(Y&(aa^1))){W=c[l>>2]|0;V=c[W+13064>>2]|0;_=S>>V;T=c[W+13140>>2]|0;da=($(R>>V,T)|0)+_|0;X=c[H>>2]|0;_=(a[X+da>>0]|0)+1+(a[X+(($(N>>V,T)|0)+_)>>0]|0)>>1;T=(S|0)>=(f|0);V=T?m:v;T=T?x:y;X=_+T|0;if((X|0)<0)X=0;else X=(X|0)>51?51:X;X=d[1280+X>>0]|0;if(aa){aa=(ba<<1)+(V+ -2&-2)+_|0;if((aa|0)<0)aa=0;else aa=(aa|0)>53?53:aa;aa=d[1336+aa>>0]|0}else aa=0;c[w>>2]=aa;if(Y)Y=0;else{Y=(Z<<1)+(V+ -2&-2)+_|0;if((Y|0)<0)Y=0;else Y=(Y|0)>53?53:Y;Y=d[1336+Y>>0]|0}c[B>>2]=Y;ca=c[C>>2]|0;Y=c[ca+32>>2]|0;da=$(Y,N)|0;W=(c[ca>>2]|0)+((S<>2])+da)|0;if(p){a[n>>0]=Gb(e,S,R)|0;a[D>>0]=Gb(e,U,R)|0;a[r>>0]=Gb(e,S,N)|0;a[Q>>0]=Gb(e,U,N)|0;Ha[c[K>>2]&3](W,Y,X,w,n,r);break}else{Ha[c[L>>2]&3](W,Y,X,w,n,r);break}}while(0);S=S+8|0}while((S|0)<(z|0));S=V}N=N+8|0}while((N|0)<(t|0));J=c[l>>2]|0}else S=m;if(c[J+4>>2]|0){C=q?v:m;F=e+2596|0;D=e+4320|0;v=e+4316|0;x=o+4|0;w=e+160|0;B=n+1|0;A=r+1|0;G=e+4308|0;E=e+4292|0;H=e+4324|0;z=e+4312|0;y=e+4296|0;I=1;do{O=1<>2];P=1<>2];if(u){N=O<<3;L=q?f:N;K=(L|0)<(s|0);J=P<<3;M=q?f-N|0:0;O=O<<2;P=P<<2;Q=g;do{if(K){R=Q+P|0;T=L;do{W=c[F>>2]|0;Y=($(W,Q)|0)+T>>2;da=c[H>>2]|0;Y=(a[da+Y>>0]|0)==2;W=(a[da+(($(W,R)|0)+T>>2)>>0]|0)==2;do if(Y|W){U=T+ -1|0;V=c[l>>2]|0;da=c[V+13064>>2]|0;_=U>>da;X=c[V+13140>>2]|0;Z=$(Q>>da,X)|0;aa=c[v>>2]|0;ba=T>>da;X=$(R>>da,X)|0;X=(a[aa+(X+_)>>0]|0)+1+(a[aa+(X+ba)>>0]|0)>>1;if(Y)Y=Hb(e,(a[aa+(Z+ba)>>0]|0)+1+(a[aa+(Z+_)>>0]|0)>>1,I,S)|0;else Y=0;c[o>>2]=Y;if(W)W=Hb(e,X,I,S)|0;else W=0;c[x>>2]=W;ca=c[w>>2]|0;W=c[ca+(I<<2)+32>>2]|0;da=$(W,Q>>c[V+(I<<2)+13180>>2])|0;V=(c[ca+(I<<2)>>2]|0)+((T>>c[V+(I<<2)+13168>>2]<>2])+da)|0;if(p){a[n>>0]=Gb(e,U,Q)|0;a[B>>0]=Gb(e,U,R)|0;a[r>>0]=Gb(e,T,Q)|0;a[A>>0]=Gb(e,T,R)|0;ya[c[z>>2]&3](V,W,o,n,r);break}else{ya[c[y>>2]&3](V,W,o,n,r);break}}while(0);T=T+N|0}while((T|0)<(s|0))}if(Q){U=s-((s|0)==(c[(c[l>>2]|0)+13120>>2]|0)?0:N)|0;if((M|0)<(U|0)){T=Q+ -1|0;S=M;do{W=$(c[F>>2]|0,Q)|0;da=c[D>>2]|0;R=S+O|0;X=(a[da+(W+S>>2)>>0]|0)==2;W=(a[da+(W+R>>2)>>0]|0)==2;do if(X|W){if(X){da=c[l>>2]|0;ca=c[da+13064>>2]|0;Y=S>>ca;da=c[da+13140>>2]|0;aa=($(T>>ca,da)|0)+Y|0;ba=c[v>>2]|0;Y=(a[ba+aa>>0]|0)+1+(a[ba+(($(Q>>ca,da)|0)+Y)>>0]|0)>>1}else Y=0;if(W){da=c[l>>2]|0;ca=c[da+13064>>2]|0;V=R>>ca;da=c[da+13140>>2]|0;aa=($(T>>ca,da)|0)+V|0;ba=c[v>>2]|0;V=(a[ba+aa>>0]|0)+1+(a[ba+(($(Q>>ca,da)|0)+V)>>0]|0)>>1}else V=0;if(X)X=Hb(e,Y,I,C)|0;else X=0;c[o>>2]=X;if(W)V=Hb(e,V,I,m)|0;else V=0;c[x>>2]=V;da=c[l>>2]|0;ca=c[w>>2]|0;V=c[ca+(I<<2)+32>>2]|0;W=$(V,Q>>c[da+13184>>2])|0;W=(c[ca+(I<<2)>>2]|0)+((S>>c[da+13172>>2]<>2])+W)|0;if(p){a[n>>0]=Gb(e,S,T)|0;a[B>>0]=Gb(e,R,T)|0;a[r>>0]=Gb(e,S,Q)|0;a[A>>0]=Gb(e,R,Q)|0;ya[c[G>>2]&3](W,V,o,n,r);break}else{ya[c[E>>2]&3](W,V,o,n,r);break}}while(0);S=S+N|0}while((S|0)<(U|0));S=C}else S=C}Q=Q+J|0}while((Q|0)<(t|0))}I=I+1|0;J=c[l>>2]|0}while((I|0)!=3)}if(!(a[J+12941>>0]|0)){if((a[e+140>>0]&1)==0|k^1){i=j;return}i=j;return}n=(c[J+13124>>2]|0)-h|0;l=(g|0)==0;m=(f|0)==0;if(!(l|m))Cb(e,f-h|0,g-h|0);n=(n|0)>(g|0);if(!(m|n))Cb(e,f-h|0,g);k=k^1;!(l|k)?(Cb(e,f,g-h|0),(a[e+140>>0]&1)!=0):0;if(n|k){i=j;return}Cb(e,f,g);if(!(a[e+140>>0]&1)){i=j;return}i=j;return}function Cb(e,f,g){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,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;h=i;i=i+48|0;l=h+24|0;r=h+42|0;s=h+40|0;p=h+16|0;k=h+8|0;t=h;o=e+200|0;S=c[o>>2]|0;y=c[S+13080>>2]|0;j=f>>y;y=g>>y;G=S+13128|0;n=($(y,c[G>>2]|0)|0)+j|0;M=c[e+204>>2]|0;L=M+1668|0;N=c[(c[L>>2]|0)+(n<<2)>>2]|0;A=e+2504|0;m=c[A>>2]|0;q=m+(n*148|0)|0;b[r>>1]=0;b[s>>1]=0;c[p>>2]=0;F=($(c[G>>2]|0,y)|0)+j|0;F=a[(c[e+4352>>2]|0)+F>>0]|0;if((a[M+42>>0]|0)!=0?(a[M+53>>0]|0)==0:0){R=1;O=1}else{R=F<<24>>24==0&1;O=0}D=(j|0)==0;c[l>>2]=D&1;I=(y|0)==0;u=l+4|0;c[u>>2]=I&1;H=(j|0)==((c[G>>2]|0)+ -1|0);z=l+8|0;c[z>>2]=H&1;E=(y|0)==((c[S+13132>>2]|0)+ -1|0);x=l+12|0;c[x>>2]=E&1;if(R<<24>>24){if(D)J=0;else{if(O){J=c[M+1676>>2]|0;J=(c[J+(N<<2)>>2]|0)!=(c[J+(c[(c[L>>2]|0)+(n+ -1<<2)>>2]<<2)>>2]|0)&1}else J=0;if(F<<24>>24==0?(pa=$(c[G>>2]|0,y)|0,oa=c[e+4328>>2]|0,(c[oa+(pa+j<<2)>>2]|0)!=(c[oa+(j+ -1+pa<<2)>>2]|0)):0)K=1;else K=J;a[r>>0]=K}if(H)K=0;else{if(O){K=c[M+1676>>2]|0;K=(c[K+(N<<2)>>2]|0)!=(c[K+(c[(c[L>>2]|0)+(n+1<<2)>>2]<<2)>>2]|0)&1}else K=0;if(F<<24>>24==0?(pa=$(c[G>>2]|0,y)|0,oa=c[e+4328>>2]|0,(c[oa+(pa+j<<2)>>2]|0)!=(c[oa+(j+1+pa<<2)>>2]|0)):0)P=1;else P=K;a[r+1>>0]=P}if(I)P=0;else{if(O){P=c[M+1676>>2]|0;P=(c[P+(N<<2)>>2]|0)!=(c[P+(c[(c[L>>2]|0)+(n-(c[G>>2]|0)<<2)>>2]<<2)>>2]|0)&1}else P=0;if(F<<24>>24==0?(pa=c[G>>2]|0,na=($(pa,y)|0)+j|0,oa=c[e+4328>>2]|0,(c[oa+(na<<2)>>2]|0)!=(c[oa+(($(pa,y+ -1|0)|0)+j<<2)>>2]|0)):0)Q=1;else Q=P;a[s>>0]=Q}if(E)L=0;else{if(O){pa=c[M+1676>>2]|0;L=(c[pa+(N<<2)>>2]|0)!=(c[pa+(c[(c[L>>2]|0)+((c[G>>2]|0)+n<<2)>>2]<<2)>>2]|0)&1}else L=0;if(F<<24>>24==0?(pa=c[G>>2]|0,na=($(pa,y)|0)+j|0,oa=c[e+4328>>2]|0,(c[oa+(na<<2)>>2]|0)!=(c[oa+(($(pa,y+1|0)|0)+j<<2)>>2]|0)):0)M=1;else M=L;a[s+1>>0]=M}if(!D)if(I)B=47;else{if(!(F<<24>>24)){pa=c[G>>2]|0;na=($(pa,y)|0)+j|0;oa=c[e+4328>>2]|0;if(J<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(j+ -1+($(pa,y+ -1|0)|0)<<2)>>2]|0):0)B=38;else M=1}else if(!(J<<24>>24))B=38;else M=1;if((B|0)==38)M=P<<24>>24!=0&1;a[p>>0]=M;B=40}else B=40;if((B|0)==40)if(!I){if(!H){if(!(F<<24>>24)){pa=c[G>>2]|0;na=($(pa,y)|0)+j|0;oa=c[e+4328>>2]|0;if(K<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(j+1+($(pa,y+ -1|0)|0)<<2)>>2]|0):0)B=45;else I=1}else if(!(K<<24>>24))B=45;else I=1;if((B|0)==45)I=P<<24>>24!=0&1;a[p+1>>0]=I;B=47}}else B=47;if((B|0)==47?!(H|E):0){if(!(F<<24>>24)){pa=c[G>>2]|0;na=($(pa,y)|0)+j|0;oa=c[e+4328>>2]|0;if(K<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(j+1+($(pa,y+1|0)|0)<<2)>>2]|0):0)B=51;else H=1}else if(!(K<<24>>24))B=51;else H=1;if((B|0)==51)H=L<<24>>24!=0&1;a[p+2>>0]=H}if(!(D|E)){if(!(F<<24>>24)){pa=c[G>>2]|0;na=($(pa,y)|0)+j|0;oa=c[e+4328>>2]|0;if(J<<24>>24==0?(c[oa+(na<<2)>>2]|0)==(c[oa+(j+ -1+($(pa,y+1|0)|0)<<2)>>2]|0):0)B=57;else D=1}else if(!(J<<24>>24))B=57;else D=1;if((B|0)==57)D=L<<24>>24!=0&1;a[p+3>>0]=D}}N=(c[S+4>>2]|0)!=0?3:1;E=e+160|0;D=e+168|0;F=e+2672|0;P=y<<1;H=P+ -1|0;G=k+4|0;O=y+ -1|0;J=j+1|0;L=j+ -1|0;P=P+2|0;Q=t+4|0;M=y+1|0;I=j<<1;K=I+ -1|0;I=I+2|0;R=e+((R&255)<<2)+2676|0;na=S;_=0;while(1){ka=c[na+(_<<2)+13168>>2]|0;V=f>>ka;ha=c[na+(_<<2)+13180>>2]|0;aa=g>>ha;ba=c[E>>2]|0;W=c[ba+(_<<2)+32>>2]|0;S=1<>2];Z=S>>ka;Y=S>>ha;ka=c[na+13120>>2]>>ka;ca=ka-V|0;Z=(Z|0)>(ca|0)?ca:Z;ha=c[na+13124>>2]>>ha;ca=ha-aa|0;Y=(Y|0)>(ca|0)?ca:Y;ca=$(W,aa)|0;fa=c[na+56>>2]|0;ca=(V<>2]|0;X=ba+ca|0;S=S+2<>2]|0;ga=1<>0]|0;if((ia|0)==2){ja=c[l>>2]|0;ia=c[z>>2]|0;la=c[x>>2]|0;do if(!(c[u>>2]|0)){pa=1-ja|0;oa=pa<>2]=ba+(ca-W-oa);c[G>>2]=(c[e+(_<<2)+172>>2]|0)+(($(ka,H)|0)+V-pa<>2]|0,O)|0)|0;pa=c[k+(((a[(c[A>>2]|0)+(pa*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0;if(!fa){a[oa>>0]=a[pa>>0]|0;na=c[o>>2]|0;oa=ga;break}else{b[oa>>1]=b[pa>>1]|0;oa=ga;break}}else oa=0;while(0);pa=($(c[na+13128>>2]|0,O)|0)+j|0;na=Z<>2]|0)+(pa*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0)+oa|0,na|0)|0;if((ia|0)!=1){pa=oa+na|0;oa=J+($(c[(c[o>>2]|0)+13128>>2]|0,O)|0)|0;na=ea+(pa+ma)|0;ma=(c[k+(((a[(c[A>>2]|0)+(oa*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0)+pa|0;if(!fa){a[na>>0]=a[ma>>0]|0;break}else{b[na>>1]=b[ma>>1]|0;break}}}while(0);do if(!la){pa=1-ja|0;oa=pa<>2]=ba+(($(Y,W)|0)+ca-oa);c[Q>>2]=(c[e+(_<<2)+172>>2]|0)+(($(ka,P)|0)+V-pa<>2]|0)+13128>>2]|0,M)|0)|0;ma=c[t+(((a[(c[A>>2]|0)+(ma*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0;if(!fa){a[ka>>0]=a[ma>>0]|0;ma=ga;break}else{b[ka>>1]=b[ma>>1]|0;ma=ga;break}}else ma=0;while(0);pa=($(c[(c[o>>2]|0)+13128>>2]|0,M)|0)+j|0;ka=Z<>2]|0)+(pa*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0)+ma|0,ka|0)|0;if((ia|0)!=1){pa=ma+ka|0;oa=J+($(c[(c[o>>2]|0)+13128>>2]|0,M)|0)|0;ka=ea+(pa+la)|0;la=(c[t+(((a[(c[A>>2]|0)+(oa*148|0)+_+142>>0]|0)==3&1)<<2)>>2]|0)+pa|0;if(!fa){a[ka>>0]=a[la>>0]|0;break}else{b[ka>>1]=b[la>>1]|0;break}}}while(0);do if(!ja){pa=L+($(c[(c[o>>2]|0)+13128>>2]|0,y)|0)|0;if((a[(c[A>>2]|0)+(pa*148|0)+_+142>>0]|0)==3){la=ea+S|0;ja=(c[e+(_<<2)+184>>2]|0)+(($(ha,K)|0)+aa<0;if(!fa){if(ka)ka=0;else{ja=0;break}while(1){a[la>>0]=a[ja>>0]|0;ka=ka+1|0;if((ka|0)==(Y|0)){ja=0;break}else{la=la+S|0;ja=ja+ga|0}}}else{if(ka)ka=0;else{ja=0;break}while(1){b[la>>1]=b[ja>>1]|0;ka=ka+1|0;if((ka|0)==(Y|0)){ja=0;break}else{la=la+S|0;ja=ja+ga|0}}}}else ja=1}else ja=0;while(0);do if(!ia){pa=J+($(c[(c[o>>2]|0)+13128>>2]|0,y)|0)|0;if((a[(c[A>>2]|0)+(pa*148|0)+_+142>>0]|0)==3){ia=ea+((Z<>2]|0)+(($(ha,I)|0)+aa<0;if(!fa){if(ka)B=0;else break;while(1){a[ia>>0]=a[ha>>0]|0;B=B+1|0;if((B|0)==(Y|0)){C=0;B=96;break}else{ia=ia+S|0;ha=ha+ga|0}}}else{if(ka)B=0;else break;while(1){b[ia>>1]=b[ha>>1]|0;B=B+1|0;if((B|0)==(Y|0)){C=0;B=96;break}else{ia=ia+S|0;ha=ha+ga|0}}}}else{C=1;B=96}}else{C=0;B=96}while(0);if((B|0)==96?(B=0,v=ja<0):0){da=ea+(da-v)|0;ea=0;ba=ba+(ca-v)|0;while(1){ee(da|0,ba|0,w|0)|0;ea=ea+1|0;if((ea|0)==(Y|0))break;else{da=da+S|0;ba=ba+W|0}}}Eb(e,X,W,V,aa,Z,Y,_,j,y);Ca[c[R>>2]&3](X,U,W,S,q,l,Z,Y,_,r,s,p);Fb(e,X,U,W,S,f,g,Z,Y,_);a[T>>0]=3}else if((ia|0)==1){ca=Z<0){ba=U;da=0;ea=X;while(1){ee(ba|0,ea|0,ca|0)|0;da=da+1|0;if((da|0)==(Y|0))break;else{ba=ba+S|0;ea=ea+W|0}}}Eb(e,X,W,V,aa,Z,Y,_,j,y);Fa[c[F>>2]&1](X,U,W,S,q,l,Z,Y,_);Fb(e,X,U,W,S,f,g,Z,Y,_);a[T>>0]=3}_=_+1|0;if((_|0)>=(N|0))break;na=c[o>>2]|0}i=h;return}function Db(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;h=c[a+200>>2]|0;k=((c[h+13120>>2]|0)-e|0)>(b|0);h=((c[h+13124>>2]|0)-e|0)>(d|0);j=(d|0)==0;g=(b|0)==0;if(!(j|g))Bb(a,b-e|0,d-e|0,e);if(!(j|k))Bb(a,b,d-e|0,e);if(g|h){i=f;return}Bb(a,b-e|0,d,e);i=f;return}function Eb(d,e,f,g,h,j,k,l,m,n){d=d|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;n=n|0;var o=0,p=0,q=0,r=0,s=0,t=0,u=0;o=i;q=c[d+200>>2]|0;p=c[q+56>>2]|0;s=c[q+13120>>2]>>c[q+(l<<2)+13168>>2];q=c[q+13124>>2]>>c[q+(l<<2)+13180>>2];u=d+(l<<2)+172|0;t=n<<1;r=j<>2]|0)+(($(s,t)|0)+g<>2]|0)+(($(s,t|1)|0)+g<>2]|0;l=m<<1;t=r+(($(q,l)|0)+h<0;if(n){if(g){r=t;t=0;s=e;while(1){a[r>>0]=a[s>>0]|0;t=t+1|0;if((t|0)==(k|0))break;else{r=r+m|0;s=s+f|0}}r=c[d>>2]|0}}else if(g){d=0;s=e;while(1){b[t>>1]=b[s>>1]|0;d=d+1|0;if((d|0)==(k|0))break;else{t=t+m|0;s=s+f|0}}}h=r+(($(q,l|1)|0)+h<>0]=a[j>>0]|0;p=p+1|0;if((p|0)==(k|0))break;else{h=h+m|0;j=j+f|0}}i=o;return}else{if(g)p=0;else{i=o;return}while(1){b[h>>1]=b[j>>1]|0;p=p+1|0;if((p|0)==(k|0))break;else{h=h+m|0;j=j+f|0}}i=o;return}}function Fb(b,d,e,f,g,h,j,k,l,m){b=b|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;m=m|0;var 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;n=i;t=c[b+200>>2]|0;if(!(a[(c[b+204>>2]|0)+40>>0]|0)){if(!(a[t+13056>>0]|0)){i=n;return}if(!(c[t+68>>2]|0)){i=n;return}}p=b+200|0;C=c[t+13084>>2]|0;v=1<>2]|0;s=c[t+(m<<2)+13180>>2]|0;m=h>>C;z=j>>C;k=k+h>>C;l=l+j>>C;t=v>>o<>2];if((z|0)>=(l|0)){i=n;return}u=(m|0)<(k|0);b=b+4348|0;v=v>>s;w=(v|0)>0;do{if(u){x=z-j|0;y=m;do{A=c[p>>2]|0;C=($(c[A+13156>>2]|0,z)|0)+y|0;if((a[(c[b>>2]|0)+C>>0]|0)!=0?(r=c[A+13084>>2]|0,q=x<>s,r=y-h<>o<>2],w):0){C=e+(($(q,g)|0)+r)|0;A=0;B=d+(($(q,f)|0)+r)|0;while(1){ee(B|0,C|0,t|0)|0;A=A+1|0;if((A|0)==(v|0))break;else{C=C+g|0;B=B+f|0}}}y=y+1|0}while((y|0)!=(k|0))}z=z+1|0}while((z|0)!=(l|0));i=n;return}function Gb(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;f=i;g=c[a+200>>2]|0;h=c[g+13084>>2]|0;if((e|b|0)<0){e=2;i=f;return e|0}b=b>>h;e=e>>h;h=c[g+13156>>2]|0;if((b|0)>=(h|0)){e=2;i=f;return e|0}if((e|0)>=(c[g+13160>>2]|0)){e=2;i=f;return e|0}e=($(h,e)|0)+b|0;e=d[(c[a+4348>>2]|0)+e>>0]|0;i=f;return e|0}function Hb(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0;h=i;j=c[b+204>>2]|0;e=(c[((f|0)==1?j+28|0:j+32|0)>>2]|0)+e|0;if((e|0)<0)e=0;else e=(e|0)>57?57:e;do if((c[(c[b+200>>2]|0)+4>>2]|0)==1){if((e|0)>=30)if((e|0)>43){e=e+ -6|0;break}else{e=d[1392+(e+ -30)>>0]|0;break}}else if((e|0)<0)e=0;else e=(e|0)>51?51:e;while(0);g=g+2+e|0;if((g|0)<0){j=0;j=1336+j|0;j=a[j>>0]|0;j=j&255;i=h;return j|0}j=(g|0)>53?53:g;j=1336+j|0;j=a[j>>0]|0;j=j&255;i=h;return j|0}function Ib(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;g=i;k=b+4376|0;c[k>>2]=0;a:do if((e|0)>1){m=0;while(1){if(!(a[d+m>>0]|0)){if((m|0)>0){l=m+ -1|0;l=(a[d+l>>0]|0)==0?l:m}else l=m;m=l+2|0;if(((m|0)<(e|0)?(a[d+(l+1)>>0]|0)==0:0)?(j=a[d+m>>0]|0,(j&255)<4):0)break}else l=m;m=l+2|0;if((l+3|0)>=(e|0))break a}m=l;e=j<<24>>24==3?e:l}else m=0;while(0);if((m|0)>=(e+ -1|0)){c[f+12>>2]=d;c[f+8>>2]=e;q=e;i=g;return q|0}nd(f,f+4|0,e+32|0);j=c[f>>2]|0;if(!j){q=-12;i=g;return q|0}ee(j|0,d|0,m|0)|0;o=m+2|0;b:do if((o|0)<(e|0)){l=b+4384|0;b=b+4380|0;n=m;c:while(1){p=d+o|0;q=a[p>>0]|0;do if((q&255)<=3){p=a[d+m>>0]|0;if(!(p<<24>>24))if(!(a[d+(m+1)>>0]|0)){if(q<<24>>24!=3){e=m;break b}o=n+1|0;a[j+n>>0]=0;n=n+2|0;a[j+o>>0]=0;m=m+3|0;q=(c[k>>2]|0)+1|0;c[k>>2]=q;p=c[l>>2]|0;if((p|0)<(q|0)){p=p<<1;c[l>>2]=p;ld(b,p,4)|0;p=c[b>>2]|0;if(!p){f=-12;break c}}else{p=c[b>>2]|0;if(!p)break}c[p+((c[k>>2]|0)+ -1<<2)>>2]=o}else{p=0;h=26}else h=26}else{a[j+n>>0]=a[d+m>>0]|0;a[j+(n+1)>>0]=a[d+(m+1)>>0]|0;p=a[p>>0]|0;n=n+2|0;m=o;h=26}while(0);if((h|0)==26){h=0;a[j+n>>0]=p;n=n+1|0;m=m+1|0}o=m+2|0;if((o|0)>=(e|0)){h=15;break b}}i=g;return f|0}else{n=m;h=15}while(0);if((h|0)==15)if((m|0)<(e|0)){h=e+n|0;k=m;while(1){a[j+n>>0]=a[d+k>>0]|0;k=k+1|0;if((k|0)==(e|0))break;else n=n+1|0}n=h-m|0}else e=m;h=j+n+0|0;d=h+32|0;do{a[h>>0]=0;h=h+1|0}while((h|0)<(d|0));c[f+12>>2]=j;c[f+8>>2]=n;q=e;i=g;return q|0}function Jb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;f=b+60|0;d=c[f>>2]|0;Zc();ac();f=c[f>>2]|0;c[f+4>>2]=b;g=md(31328)|0;c[f+136>>2]=g;if((((g|0)!=0?(c[f+72>>2]=g,c[f+8>>2]=f,g=fd(199)|0,c[f+152>>2]=g,(g|0)!=0):0)?(g=wd()|0,c[f+164>>2]=g,(g|0)!=0):0)?(h=wd()|0,c[f+2524>>2]=h,(h|0)!=0):0){c[f+2528>>2]=h;c[f+2592>>2]=2147483647;a[f+4469>>0]=1;c[f+2584>>2]=0;c[d+4368>>2]=0;c[d+4520>>2]=0;f=b+808|0;if(!(c[f>>2]&2))a[d+141>>0]=1;else a[d+141>>0]=c[b+800>>2];if((c[f>>2]&1|0)!=0?(c[b+800>>2]|0)>1:0){a[d+140>>0]=1;h=0;i=e;return h|0}a[d+140>>0]=2;h=0;i=e;return h|0}Lb(b)|0;h=-12;i=e;return h|0}function Kb(f,g,h,j){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,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,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,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0;k=i;i=i+16|0;m=k+8|0;n=k;l=c[f+60>>2]|0;f=j+28|0;J=c[f>>2]|0;if(!J){g=$b(l,g,1)|0;if((g|0)<0){Za=g;i=k;return Za|0}c[h>>2]=g;Za=0;i=k;return Za|0}q=l+2520|0;c[q>>2]=0;I=c[j+24>>2]|0;c[q>>2]=0;F=l+2584|0;z=l+2588|0;c[z>>2]=c[F>>2];c[F>>2]=0;v=l+4408|0;c[v>>2]=0;a:do if((J|0)>3){G=l+4470|0;E=l+4412|0;y=l+4404|0;u=l+4388|0;B=l+4396|0;w=l+4392|0;C=l+4384|0;x=l+4380|0;j=l+4376|0;t=l+136|0;s=l+2512|0;H=l+4480|0;while(1){A=(a[G>>0]|0)==0;if(A){while(1){K=I+1|0;if(((a[I>>0]|0)==0?(a[K>>0]|0)==0:0)?(a[I+2>>0]|0)==1:0)break;if((J|0)<5){p=-1094995529;o=180;break a}I=K;J=J+ -1|0}I=I+3|0;L=0;J=J+ -3|0}else{K=c[H>>2]|0;if((K|0)>0){M=0;L=0;do{M=d[I+L>>0]|M<<8;L=L+1|0}while((L|0)!=(K|0));L=M}else L=0;J=J-K|0;if((L|0)>(J|0)){p=-1094995529;o=180;break a}I=I+K|0}A=A?J:L;K=c[E>>2]|0;M=c[v>>2]|0;if((K|0)<(M+1|0)){K=K+1|0;L=kd(c[y>>2]|0,K,16)|0;if(!L){p=-12;o=180;break a}c[y>>2]=L;M=c[E>>2]|0;be(L+(M<<4)|0,0,K-M<<4|0)|0;ld(u,K,4)|0;ld(B,K,4)|0;ld(w,K,4)|0;M=c[B>>2]|0;c[M+(c[E>>2]<<2)>>2]=1024;M=od(c[M+(c[E>>2]<<2)>>2]|0,4)|0;c[(c[w>>2]|0)+(c[E>>2]<<2)>>2]=M;c[E>>2]=K;M=c[v>>2]|0}c[C>>2]=c[(c[B>>2]|0)+(M<<2)>>2];c[x>>2]=c[(c[w>>2]|0)+(M<<2)>>2];L=c[y>>2]|0;K=Ib(l,I,A,L+(M<<4)|0)|0;c[(c[u>>2]|0)+(c[v>>2]<<2)>>2]=c[j>>2];c[(c[B>>2]|0)+(c[v>>2]<<2)>>2]=c[C>>2];Ya=c[x>>2]|0;Za=c[v>>2]|0;c[v>>2]=Za+1;c[(c[w>>2]|0)+(Za<<2)>>2]=Ya;if((K|0)<0){p=K;o=180;break a}Ya=c[t>>2]|0;Wa=c[L+(M<<4)+12>>2]|0;Xa=c[L+(M<<4)+8>>2]|0;Xa=Xa>>>0>268435455?-8:Xa<<3;Za=Xa>>>0>2147483639|(Wa|0)==0;Xa=Za?0:Xa;Wa=Za?0:Wa;A=Za?-1094995529:0;c[Ya+204>>2]=Wa;c[Ya+216>>2]=Xa;c[Ya+220>>2]=Xa+8;c[Ya+208>>2]=Wa+(Xa>>3);c[Ya+212>>2]=0;if(Za){p=A;o=180;break a}Ob(l)|0;if(((c[s>>2]|0)+ -36|0)>>>0<2)c[F>>2]=1;J=J-K|0;if((J|0)<=3)break;else I=I+K|0}if((c[v>>2]|0)>0){ka=l+4|0;Fa=l+1448|0;B=l+2046|0;Z=l+1428|0;Ea=l+204|0;va=l+200|0;Ja=l+1449|0;Ka=l+1432|0;Oa=l+1436|0;Pa=l+2580|0;Ha=l+156|0;qa=l+1440|0;H=l+1450|0;K=l+1620|0;ua=l+2572|0;J=l+2516|0;L=l+2576|0;V=l+2056|0;W=l+2057|0;M=l+2058|0;O=l+2052|0;N=l+2048|0;Ma=l+2068|0;R=l+2072|0;P=l+2076|0;S=l+2080|0;X=l+2061|0;U=l+2084|0;T=l+2088|0;Y=l+2062|0;I=l+1451|0;Na=l+2108|0;Ia=l+2112|0;La=l+2500|0;ma=l+2592|0;na=l+2604|0;oa=l+4416|0;Ga=m+4|0;wa=l+4320|0;ya=l+2596|0;xa=l+2600|0;za=l+4324|0;Aa=l+4344|0;Ca=l+4348|0;Da=l+4328|0;ra=l+160|0;pa=l+140|0;sa=l+164|0;_=l+2096|0;Q=l+2100|0;E=l+2104|0;F=l+141|0;G=l+4368|0;ba=l+2504|0;aa=l+2508|0;da=l+4332|0;ca=l+4336|0;ea=l+4340|0;ga=l+4352|0;fa=l+4316|0;ha=l+2608|0;ja=l+196|0;la=l+4364|0;ia=l+168|0;C=0;b:while(1){c[j>>2]=c[(c[u>>2]|0)+(C<<2)>>2];c[x>>2]=c[(c[w>>2]|0)+(C<<2)>>2];Ya=c[y>>2]|0;Xa=c[Ya+(C<<4)+12>>2]|0;Ya=c[Ya+(C<<4)+8>>2]|0;Za=c[t>>2]|0;Ya=Ya>>>0>268435455?-8:Ya<<3;Qa=Ya>>>0>2147483639|(Xa|0)==0;Ya=Qa?0:Ya;Xa=Qa?0:Xa;c[Za+204>>2]=Xa;c[Za+216>>2]=Ya;c[Za+220>>2]=Ya+8;c[Za+208>>2]=Xa+(Ya>>3);c[Za+212>>2]=0;c:do if(Qa){r=Qa?-1094995529:0;o=178}else{Qa=Ob(l)|0;d:do if((Qa|0)>=0){if(!Qa)break c;switch(c[s>>2]|0){case 37:case 36:{b[la>>1]=(e[la>>1]|0)+1&255;c[ma>>2]=2147483647;break c};case 48:{Qa=Dc(l)|0;if((Qa|0)<0)break d;else break c};case 34:{Qa=Ec(l)|0;if((Qa|0)<0)break d;else break c};case 40:case 39:{Qa=Gc(l)|0;if((Qa|0)<0)break d;else break c};case 9:case 8:case 7:case 6:case 21:case 20:case 19:case 18:case 17:case 16:case 5:case 4:case 3:case 2:case 0:case 1:{Qa=c[t>>2]|0;Ra=Qa+204|0;Za=(bd(Ra)|0)&255;a[Fa>>0]=Za;Sa=c[s>>2]|0;if(!((Sa+ -16|0)>>>0>4|Za<<24>>24==0)?(b[la>>1]=(e[la>>1]|0)+1&255,c[ma>>2]=2147483647,(Sa+ -19|0)>>>0<2):0){Yb(l);Sa=c[s>>2]|0}a[B>>0]=0;if((Sa+ -16|0)>>>0<8)a[B>>0]=bd(Ra)|0;Sa=dd(Ra)|0;c[Z>>2]=Sa;if(Sa>>>0>255){p=A;o=180;break a}Sa=c[l+(Sa<<2)+400>>2]|0;if(!Sa){p=A;o=180;break a}if(!(a[Fa>>0]|0)){Va=c[Sa+4>>2]|0;if((c[Ea>>2]|0)!=(Va|0)){p=A;o=180;break a}}else Va=c[Sa+4>>2]|0;c[Ea>>2]=Va;Ta=c[s>>2]|0;Ua=(Ta|0)==21;if(Ua?(c[z>>2]|0)==1:0)a[B>>0]=1;Sa=c[va>>2]|0;Va=c[(c[l+(c[Va>>2]<<2)+272>>2]|0)+4>>2]|0;if((Sa|0)!=(Va|0)){c[va>>2]=Va;e:do if(Sa){if((Ta+ -16|0)>>>0>7|Ua)break;do if((c[Va+13120>>2]|0)==(c[Sa+13120>>2]|0)){if((c[Va+13124>>2]|0)!=(c[Sa+13124>>2]|0))break;if((c[Va+76+(((c[Va+72>>2]|0)+ -1|0)*12|0)>>2]|0)==(c[Sa+(((c[Sa+72>>2]|0)+ -1|0)*12|0)+76>>2]|0))break e}while(0);a[B>>0]=0}while(0);Yb(l);Sa=c[va>>2]|0;Nb(l);Ua=c[Sa+13064>>2]|0;Va=Sa+13120|0;$a=c[Va>>2]|0;Wa=Sa+13124|0;_a=c[Wa>>2]|0;Ua=$((_a>>Ua)+1|0,($a>>Ua)+1|0)|0;Ta=$(c[Sa+13132>>2]|0,c[Sa+13128>>2]|0)|0;Za=Sa+13156|0;Ya=Sa+13160|0;Xa=$(c[Ya>>2]|0,c[Za>>2]|0)|0;c[ya>>2]=($a>>2)+1;c[xa>>2]=(_a>>2)+1;c[ba>>2]=pd(Ta,148)|0;_a=pd(Ta,8)|0;c[aa>>2]=_a;if((c[ba>>2]|0)==0|(_a|0)==0){o=71;break b}_a=Sa+13144|0;$a=Sa+13140|0;c[da>>2]=fd($(c[$a>>2]|0,c[_a>>2]|0)|0)|0;$a=od(c[_a>>2]|0,c[$a>>2]|0)|0;c[ca>>2]=$a;if((c[da>>2]|0)==0|($a|0)==0){o=71;break b}c[Aa>>2]=od(c[Sa+13148>>2]|0,c[Sa+13152>>2]|0)|0;c[ea>>2]=md(Xa)|0;Xa=fd($((c[Ya>>2]|0)+1|0,(c[Za>>2]|0)+1|0)|0)|0;c[Ca>>2]=Xa;if(!(c[ea>>2]|0)){o=71;break b}if((c[Aa>>2]|0)==0|(Xa|0)==0){o=71;break b}c[ga>>2]=fd(Ta)|0;c[Da>>2]=od(Ua,4)|0;$a=od(Ua,1)|0;c[fa>>2]=$a;if(!$a){o=71;break b}if(!(c[ga>>2]|0)){o=71;break b}if(!(c[Da>>2]|0)){o=71;break b}c[wa>>2]=pd(c[ya>>2]|0,c[xa>>2]|0)|0;$a=pd(c[ya>>2]|0,c[xa>>2]|0)|0;c[za>>2]=$a;if((c[wa>>2]|0)==0|($a|0)==0){o=71;break b}$a=c[ka>>2]|0;c[$a+124>>2]=c[Va>>2];c[$a+128>>2]=c[Wa>>2];c[$a+116>>2]=c[Sa+12>>2];c[$a+120>>2]=c[Sa+16>>2];c[$a+136>>2]=c[Sa+60>>2];c[$a+172>>2]=c[Sa+(((c[Sa+72>>2]|0)+ -1|0)*12|0)+80>>2];$a=Sa+160|0;c[m+0>>2]=c[$a+0>>2];c[m+4>>2]=c[$a+4>>2];if(!(c[Sa+176>>2]|0)){Ta=c[ka>>2]|0;c[Ta+392>>2]=1}else{Ta=c[ka>>2]|0;c[Ta+392>>2]=(c[Sa+184>>2]|0)!=0?2:1}if(!(c[Sa+188>>2]|0)){c[Ta+380>>2]=2;c[Ta+384>>2]=2;c[Ta+388>>2]=2}else{c[Ta+380>>2]=d[Sa+192>>0];c[Ta+384>>2]=d[Sa+193>>0];c[Ta+388>>2]=d[Sa+194>>0]}bc(ha,c[Sa+52>>2]|0);if(a[Sa+12941>>0]|0){Ta=c[va>>2]|0;Ua=(c[Ta+4>>2]|0)!=0?3:1;$a=(1<>2])+2|0;$a=$($a,$a)|0;c[ia>>2]=fd($a<>2])|0;Ta=0;do{$a=c[va>>2]|0;_a=c[$a+13124>>2]>>c[$a+(Ta<<2)+13180>>2];Za=$(c[$a+13120>>2]>>c[$a+(Ta<<2)+13168>>2]<<1,c[$a+13132>>2]|0)|0;c[l+(Ta<<2)+172>>2]=fd(Za<>2])|0;$a=c[va>>2]|0;_a=$(_a<<1,c[$a+13128>>2]|0)|0;c[l+(Ta<<2)+184>>2]=fd(_a<>2])|0;Ta=Ta+1|0}while((Ta|0)<(Ua|0))}c[va>>2]=Sa;c[ja>>2]=c[(c[l+(c[Sa>>2]<<2)+208>>2]|0)+4>>2];b[la>>1]=(e[la>>1]|0)+1&255;c[ma>>2]=2147483647}$a=c[ka>>2]|0;c[$a+832>>2]=d[Sa+302>>0];c[$a+836>>2]=d[Sa+335>>0];a[Ja>>0]=0;do if(!(a[Fa>>0]|0)){if(a[(c[Ea>>2]|0)+41>>0]|0){a[Ja>>0]=bd(Ra)|0;Sa=c[va>>2]|0}Sa=($(c[Sa+13128>>2]<<1,c[Sa+13132>>2]|0)|0)+ -2|0;Ta=Sa>>>0>65535;Sa=Ta?Sa>>>16:Sa;Ta=Ta?16:0;if(Sa&65280){Ta=Ta|8;Sa=Sa>>>8}Sa=_c(Ra,(d[4680+Sa>>0]|0)+Ta|0)|0;c[Ka>>2]=Sa;$a=c[va>>2]|0;if(Sa>>>0>=($(c[$a+13132>>2]|0,c[$a+13128>>2]|0)|0)>>>0){p=A;o=180;break a}if(a[Ja>>0]|0)if(!(a[Ha>>0]|0)){p=A;o=180;break a}else break;else{c[Oa>>2]=Sa;c[Pa>>2]=(c[Pa>>2]|0)+1;o=82;break}}else{c[Oa>>2]=0;c[Ka>>2]=0;c[Pa>>2]=0;a[Ha>>0]=0;o=82}while(0);f:do if((o|0)==82){o=0;a[Ha>>0]=0;if((c[(c[Ea>>2]|0)+1624>>2]|0)>0){Sa=0;do{ad(Ra,1);Sa=Sa+1|0}while((Sa|0)<(c[(c[Ea>>2]|0)+1624>>2]|0))}Sa=dd(Ra)|0;c[qa>>2]=Sa;if(Sa>>>0>=3){p=A;o=180;break a}if(!((Sa|0)==2?1:((c[s>>2]|0)+ -16|0)>>>0>7)){p=A;o=180;break a}a[H>>0]=1;if(a[(c[Ea>>2]|0)+39>>0]|0)a[H>>0]=bd(Ra)|0;if(a[(c[va>>2]|0)+8>>0]|0)a[I>>0]=_c(Ra,2)|0;if(((c[s>>2]|0)+ -19|0)>>>0>=2){o=91;break b}c[K>>2]=0;c[ua>>2]=0;if(!(c[J>>2]|0))c[L>>2]=0;do if(a[(c[va>>2]|0)+12941>>0]|0){a[V>>0]=bd(Ra)|0;if(!(c[(c[va>>2]|0)+4>>2]|0)){a[W>>0]=0;a[M>>0]=0;break}else{$a=(bd(Ra)|0)&255;a[M>>0]=$a;a[W>>0]=$a;break}}else{a[V>>0]=0;a[W>>0]=0;a[M>>0]=0}while(0);c[O>>2]=0;c[N>>2]=0;c[Ma>>2]=ed(Ra)|0;Sa=c[Ea>>2]|0;if(!(a[Sa+36>>0]|0)){c[R>>2]=0;c[P>>2]=0}else{c[R>>2]=ed(Ra)|0;c[P>>2]=ed(Ra)|0;Sa=c[Ea>>2]|0}if(!(a[Sa+1631>>0]|0))a[S>>0]=0;else{a[S>>0]=bd(Ra)|0;Sa=c[Ea>>2]|0}g:do if(!(a[Sa+55>>0]|0)){a[X>>0]=0;c[U>>2]=0;c[T>>2]=0}else{do if(a[Sa+56>>0]|0){if(!(bd(Ra)|0)){Sa=c[Ea>>2]|0;break}$a=(bd(Ra)|0)&255;a[X>>0]=$a;if($a<<24>>24)break g;c[U>>2]=(ed(Ra)|0)<<1;c[T>>2]=(ed(Ra)|0)<<1;break g}while(0);a[X>>0]=a[Sa+57>>0]|0;c[U>>2]=c[Sa+60>>2];c[T>>2]=c[Sa+64>>2]}while(0);Sa=a[(c[Ea>>2]|0)+54>>0]|0;h:do if(Sa<<24>>24){do if(!(a[V>>0]|0)){if(a[W>>0]|0)break;if(a[X>>0]|0)break h}while(0);a[Y>>0]=bd(Ra)|0;break f}while(0);a[Y>>0]=Sa}while(0);c[Na>>2]=0;$a=c[Ea>>2]|0;if(!((a[$a+42>>0]|0)==0?(a[$a+43>>0]|0)==0:0))o=122;i:do if((o|0)==122){o=0;$a=dd(Ra)|0;c[Na>>2]=$a;if(($a|0)<=0){c[G>>2]=0;break}Sa=(dd(Ra)|0)+1|0;Ta=Sa>>4;Sa=Sa&15;jd(_);jd(Q);jd(E);c[_>>2]=od(c[Na>>2]|0,4)|0;c[Q>>2]=od(c[Na>>2]|0,4)|0;Ua=od(c[Na>>2]|0,4)|0;c[E>>2]=Ua;if(!(c[_>>2]|0)){o=127;break b}if((c[Q>>2]|0)==0|(Ua|0)==0){o=127;break b}if((c[Na>>2]|0)>0){Wa=(Ta|0)>0;Va=(Sa|0)==0;Ua=0;do{if(Wa){Xa=0;Ya=0;do{Ya=(_c(Ra,16)|0)+(Ya<<16)|0;Xa=Xa+1|0}while((Xa|0)!=(Ta|0))}else Ya=0;if(!Va)Ya=(_c(Ra,Sa)|0)+(Ya<>2]|0)+(Ua<<2)>>2]=Ya+1;Ua=Ua+1|0}while((Ua|0)<(c[Na>>2]|0))}do if((d[F>>0]|0)>1){$a=c[Ea>>2]|0;if((c[$a+48>>2]|0)<=1?(c[$a+44>>2]|0)<=1:0)break;c[G>>2]=0;a[F>>0]=1;break i}while(0);c[G>>2]=0}while(0);Sa=c[Ea>>2]|0;if(a[Sa+1628>>0]|0){Sa=dd(Ra)|0;_a=ce(Sa|0,0,3)|0;Ya=D;$a=(c[Qa+216>>2]|0)-(c[Qa+212>>2]|0)|0;Za=(($a|0)<0)<<31>>31;if((Ya|0)>(Za|0)|(Ya|0)==(Za|0)&_a>>>0>$a>>>0){p=A;o=180;break a}if(Sa){Ta=0;do{ad(Ra,8);Ta=Ta+1|0}while((Ta|0)!=(Sa|0))}Sa=c[Ea>>2]|0}Ra=(c[Sa+16>>2]|0)+26+(c[Ma>>2]|0)|0;a[Ia>>0]=Ra;Ra=Ra<<24;if((Ra|0)>855638016){p=A;o=180;break a}if((Ra>>24|0)<(0-(c[(c[va>>2]|0)+13192>>2]|0)|0)){p=A;o=180;break a}$a=c[Ka>>2]|0;c[La>>2]=$a;if(($a|0)==0?(a[Ja>>0]|0)!=0:0){p=A;o=180;break a}if(((c[Qa+216>>2]|0)-(c[Qa+212>>2]|0)|0)<0){p=A;o=180;break a}a[(c[t>>2]|0)+203>>0]=(a[Ja>>0]|0)==0&1;if(!(a[(c[Ea>>2]|0)+22>>0]|0))a[(c[t>>2]|0)+272>>0]=a[Ia>>0]|0;a[Ha>>0]=1;a[(c[t>>2]|0)+302>>0]=0;a[(c[t>>2]|0)+303>>0]=0;Ra=c[ma>>2]|0;Qa=c[s>>2]|0;j:do if((Ra|0)==2147483647)switch(Qa|0){case 18:case 16:case 17:case 21:{Ra=c[ua>>2]|0;c[ma>>2]=Ra;break j};case 20:case 19:{c[ma>>2]=-2147483648;Ra=-2147483648;break j};default:{Ra=2147483647;break j}}while(0);do if((Qa+ -8|0)>>>0<2){if((c[ua>>2]|0)<=(Ra|0)){c[na>>2]=0;break c}if((Qa|0)!=9)break;c[ma>>2]=-2147483648}while(0);k:do if(!(a[Fa>>0]|0)){if(!(c[q>>2]|0)){Qa=0;break d}}else{Ra=c[t>>2]|0;_a=c[va>>2]|0;Qa=c[_a+13064>>2]|0;$a=c[_a+13120>>2]>>Qa;Qa=(c[_a+13124>>2]>>Qa)+1|0;be(c[wa>>2]|0,0,$(c[xa>>2]|0,c[ya>>2]|0)|0)|0;be(c[za>>2]|0,0,$(c[xa>>2]|0,c[ya>>2]|0)|0)|0;_a=c[va>>2]|0;be(c[Aa>>2]|0,0,$(c[_a+13152>>2]|0,c[_a+13148>>2]|0)|0)|0;_a=c[va>>2]|0;be(c[Ca>>2]|0,0,$((c[_a+13160>>2]|0)+1|0,(c[_a+13156>>2]|0)+1|0)|0)|0;be(c[Da>>2]|0,-1,$(($a<<2)+4|0,Qa)|0)|0;c[na>>2]=0;c[oa>>2]=c[s>>2];Qa=c[Ea>>2]|0;if(a[Qa+42>>0]|0)c[Ra+312>>2]=c[c[Qa+1648>>2]>>2]<>2]|0)+13080>>2];Qa=_b(l,ra,c[ua>>2]|0)|0;do if((Qa|0)>=0){c[(c[c[q>>2]>>2]|0)+80>>2]=((c[s>>2]|0)+ -16|0)>>>0<8&1;c[(c[ra>>2]|0)+84>>2]=3-(c[qa>>2]|0);yd(c[sa>>2]|0);Qa=$b(l,c[sa>>2]|0,0)|0;if((Qa|0)<0)break;break k}while(0);if(!(c[q>>2]|0)){o=167;break b}c[q>>2]=0;if((Qa|0)<0){p=A;break a}}while(0);if((c[s>>2]|0)!=(c[oa>>2]|0)){p=A;o=180;break a}c[m>>2]=0;c[Ga>>2]=1;Qa=c[ka>>2]|0;Ba[c[Qa+816>>2]&1](Qa,1,m,n,1,4)|0;Qa=c[n>>2]|0;$a=c[va>>2]|0;if((Qa|0)>=($(c[$a+13132>>2]|0,c[$a+13128>>2]|0)|0))c[na>>2]=1;if((Qa|0)<0)break d;else break c};default:break c}}while(0);r=(c[(c[ka>>2]|0)+688>>2]&8|0)==0?0:Qa;o=178}while(0);if((o|0)==178?(o=0,(r|0)<0):0){p=A;o=180;break a}C=C+1|0;if((C|0)>=(c[v>>2]|0)){p=A;o=180;break a}}if((o|0)==71){Nb(l);Nb(l);c[va>>2]=0;p=A;o=180;break}else if((o|0)==91)ta();else if((o|0)==127){c[Na>>2]=0;p=A;o=180;break}else if((o|0)==167){c[q>>2]=0;p=A;break}}else{p=A;o=180}}else{p=0;o=180}while(0);if((p|0)<0){$a=p;i=k;return $a|0}m=l+2604|0;if(c[m>>2]|0)c[m>>2]=0;l=c[l+164>>2]|0;if(c[l+304>>2]|0){zd(g,l);c[h>>2]=1}$a=c[f>>2]|0;i=k;return $a|0}function Lb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;e=c[b+60>>2]|0;Nb(e);b=e+4412|0;f=e+4392|0;if((c[b>>2]|0)>0){g=0;do{jd((c[f>>2]|0)+(g<<2)|0);g=g+1|0}while((g|0)<(c[b>>2]|0))}jd(e+4396|0);jd(e+4388|0);jd(f);jd(e+152|0);jd(e+168|0);jd(e+172|0);jd(e+184|0);jd(e+176|0);jd(e+188|0);jd(e+180|0);jd(e+192|0);xd(e+164|0);g=e+2524|0;Xb(e,g,-1);xd(g);g=e+208|0;f=0;do{vd(g+(f<<2)|0);f=f+1|0}while((f|0)!=16);g=e+272|0;f=0;do{vd(g+(f<<2)|0);f=f+1|0}while((f|0)!=32);f=e+400|0;g=0;do{vd(f+(g<<2)|0);g=g+1|0}while((g|0)!=256);c[e+200>>2]=0;c[e+204>>2]=0;c[e+196>>2]=0;vd(e+1424|0);jd(e+2096|0);jd(e+2100|0);jd(e+2104|0);h=e+141|0;l=a[h>>0]|0;f=e+72|0;if((l&255)>1){g=e+8|0;j=1;do{k=f+(j<<2)|0;if(c[k>>2]|0){jd(k);jd(g+(j<<2)|0);l=a[h>>0]|0}j=j+1|0}while((j|0)<(l&255|0))}g=e+136|0;if((c[g>>2]|0)==(c[f>>2]|0))c[g>>2]=0;jd(f);f=e+4404|0;if((c[b>>2]|0)<=0){jd(f);c[b>>2]=0;i=d;return 0}e=0;do{jd((c[f>>2]|0)+(e<<4)|0);e=e+1|0}while((e|0)<(c[b>>2]|0));jd(f);c[b>>2]=0;i=d;return 0}function Mb(a){a=a|0;var b=0;b=i;a=c[a+60>>2]|0;Zb(a);c[a+2592>>2]=2147483647;i=b;return}function Nb(a){a=a|0;var b=0;b=i;jd(a+2504|0);jd(a+2508|0);jd(a+4332|0);jd(a+4336|0);jd(a+4340|0);jd(a+4344|0);jd(a+4348|0);jd(a+4316|0);jd(a+4328|0);jd(a+4352|0);jd(a+4320|0);jd(a+4324|0);jd(a+2096|0);jd(a+2104|0);jd(a+2100|0);i=b;return}function Ob(a){a=a|0;var b=0,d=0,e=0;b=i;d=(c[a+136>>2]|0)+204|0;if(bd(d)|0){e=-1094995529;i=b;return e|0}c[a+2512>>2]=_c(d,6)|0;e=_c(d,6)|0;d=(_c(d,3)|0)+ -1|0;c[a+2516>>2]=d;if((d|0)<0){e=-1094995529;i=b;return e|0}e=(e|0)==0&1;i=b;return e|0}function Pb(e,f){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,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;f=i;h=c[e+60>>2]|0;k=h+200|0;E=c[k>>2]|0;e=1<>2];l=h+204|0;n=c[l>>2]|0;A=c[(c[n+1668>>2]|0)+(c[h+2500>>2]<<2)>>2]|0;m=(a[h+1449>>0]|0)==0;if(!A)if(m)g=4;else{W=-1094995529;i=f;return W|0}else if(!m){m=h+4328|0;r=h+1436|0;if((c[(c[m>>2]|0)+(c[(c[n+1672>>2]|0)+(A+ -1<<2)>>2]<<2)>>2]|0)!=(c[r>>2]|0)){W=-1094995529;i=f;return W|0}}else g=4;if((g|0)==4){m=h+4328|0;r=h+1436|0}q=e+ -1|0;s=h+136|0;p=h+2504|0;y=h+2056|0;o=h+2057|0;w=h+2084|0;x=h+2508|0;v=h+2088|0;u=h+2062|0;t=h+4352|0;z=0;n=0;do{if((A|0)>=(c[E+13136>>2]|0))break;G=c[l>>2]|0;B=c[(c[G+1672>>2]|0)+(A<<2)>>2]|0;J=E+13120|0;I=E+13080|0;H=c[I>>2]|0;n=q+(c[J>>2]|0)>>H;z=((B|0)%(n|0)|0)<>2]|0;H=1<>2]|0;D=B-F|0;c[(c[m>>2]|0)+(B<<2)>>2]=F;do if(!(a[G+43>>0]|0)){if(!(a[G+42>>0]|0)){c[C+312>>2]=c[J>>2];G=E;break}if((A|0)!=0?(W=c[G+1676>>2]|0,(c[W+(A<<2)>>2]|0)!=(c[W+(A+ -1<<2)>>2]|0)):0){W=c[I>>2]|0;c[C+312>>2]=(c[(c[G+1648>>2]|0)+(c[(c[G+1664>>2]|0)+(z>>W<<2)>>2]<<2)>>2]<>0]=1;G=c[k>>2]|0}else G=E}else{if((z|0)==0?(H+ -1&n|0)==0:0){a[C+203>>0]=1;E=c[k>>2]|0}c[C+312>>2]=c[E+13120>>2];G=E}while(0);E=H+n|0;H=c[G+13124>>2]|0;c[C+316>>2]=(E|0)>(H|0)?H:E;E=C+31312|0;c[E>>2]=0;H=c[l>>2]|0;if(!(a[H+42>>0]|0)){if((B|0)==(F|0)){c[E>>2]=1;F=1}else F=0;if((D|0)<(c[G+13128>>2]|0)){F=F|4;c[E>>2]=F}}else{if((z|0)>0){W=c[H+1676>>2]|0;I=B+ -1|0;if((c[W+(A<<2)>>2]|0)==(c[W+(c[(c[H+1668>>2]|0)+(I<<2)>>2]<<2)>>2]|0))F=0;else{c[E>>2]=2;F=2}W=c[m>>2]|0;if((c[W+(B<<2)>>2]|0)!=(c[W+(I<<2)>>2]|0)){F=F|1;c[E>>2]=F}}else F=0;if((n|0)>0){W=c[H+1676>>2]|0;I=G+13128|0;G=c[I>>2]|0;if((c[W+(A<<2)>>2]|0)!=(c[W+(c[(c[H+1668>>2]|0)+(B-G<<2)>>2]<<2)>>2]|0)){F=F|8;c[E>>2]=F;G=c[I>>2]|0}W=c[m>>2]|0;if((c[W+(B<<2)>>2]|0)!=(c[W+(B-G<<2)>>2]|0)){F=F|4;c[E>>2]=F}}}E=(z|0)>0;if(E&(D|0)>0)G=(F>>>1&1^1)&255;else G=0;a[C+308>>0]=G;if((n|0)>0){if((D|0)<(c[(c[k>>2]|0)+13128>>2]|0))F=0;else F=(F>>>3&1^1)&255;a[C+309>>0]=F;F=c[(c[k>>2]|0)+13128>>2]|0;if((D+1|0)<(F|0))F=0;else{W=c[l>>2]|0;V=c[W+1676>>2]|0;F=(c[V+(A<<2)>>2]|0)==(c[V+(c[(c[W+1668>>2]|0)+(B+1-F<<2)>>2]<<2)>>2]|0)&1}a[C+310>>0]=F;if(E?(j=c[(c[k>>2]|0)+13128>>2]|0,(D|0)>(j|0)):0){D=c[l>>2]|0;W=c[D+1676>>2]|0;D=(c[W+(A<<2)>>2]|0)==(c[W+(c[(c[D+1668>>2]|0)+(B+ -1-j<<2)>>2]<<2)>>2]|0)&1}else D=0}else{a[C+309>>0]=0;a[C+310>>0]=0;D=0}a[C+311>>0]=D;Ua(h,A);D=c[k>>2]|0;E=c[D+13080>>2]|0;F=z>>E;E=n>>E;G=c[s>>2]|0;D=($(c[D+13128>>2]|0,E)|0)+F|0;C=c[p>>2]|0;if((a[y>>0]|0)==0?(a[o>>0]|0)==0:0){M=0;H=0}else{if((F|0)>0?(a[G+308>>0]|0)!=0:0)M=Za(h)|0;else M=0;if((E|0)>0&(M|0)==0)if(!(a[G+309>>0]|0)){M=0;H=0}else{M=0;H=(Za(h)|0)!=0}else H=0}I=(c[(c[k>>2]|0)+4>>2]|0)!=0?3:1;L=C+(D*148|0)+143|0;G=C+(D*148|0)+144|0;K=C+(D*148|0)+104|0;J=C+(D*148|0)+108|0;R=(M|0)==0;S=R&(H^1);M=E+ -1|0;O=F+ -1|0;P=0;do{Q=c[l>>2]|0;Q=d[((P|0)==0?Q+1644|0:Q+1645|0)>>0]|0;a:do if(a[h+P+2056>>0]|0){T=(P|0)==2;do if(!T){if(S){U=($a(h)|0)&255;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}if(!R){U=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;U=a[(c[p>>2]|0)+(U*148|0)+P+142>>0]|0;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}if(H){U=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;U=a[(c[p>>2]|0)+(U*148|0)+P+142>>0]|0;N=C+(D*148|0)+P+142|0;a[N>>0]=U;break}else{a[C+(D*148|0)+P+142>>0]=0;break a}}else{U=a[L>>0]|0;a[G>>0]=U;c[J>>2]=c[K>>2];N=G}while(0);if(U<<24>>24){U=0;do{do if(!S){if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(U<<2)>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(U<<2)>>2];break}else{c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=0;break}}else c[C+(D*148|0)+(P<<4)+(U<<2)>>2]=cb(h)|0;while(0);U=U+1|0}while((U|0)!=4);do if((a[N>>0]|0)==1){T=0;do{do if(c[C+(D*148|0)+(P<<4)+(T<<2)>>2]|0){if(S){c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=db(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(T<<2)+48>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<4)+(T<<2)+48>>2];break}else{c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=0;break}}else c[C+(D*148|0)+(P<<4)+(T<<2)+48>>2]=0;while(0);T=T+1|0}while((T|0)!=4);if(S){a[C+(D*148|0)+P+96>>0]=bb(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;a[C+(D*148|0)+P+96>>0]=a[(c[p>>2]|0)+(W*148|0)+P+96>>0]|0;break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;a[C+(D*148|0)+P+96>>0]=a[(c[p>>2]|0)+(W*148|0)+P+96>>0]|0;break}else{a[C+(D*148|0)+P+96>>0]=0;break}}else if(!T){if(S){c[C+(D*148|0)+(P<<2)+100>>2]=eb(h)|0;break}if(!R){W=($(c[(c[k>>2]|0)+13128>>2]|0,E)|0)+O|0;c[C+(D*148|0)+(P<<2)+100>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<2)+100>>2];break}if(H){W=($(c[(c[k>>2]|0)+13128>>2]|0,M)|0)+F|0;c[C+(D*148|0)+(P<<2)+100>>2]=c[(c[p>>2]|0)+(W*148|0)+(P<<2)+100>>2];break}else{c[C+(D*148|0)+(P<<2)+100>>2]=0;break}}while(0);b[C+(D*148|0)+(P*10|0)+112>>1]=0;T=0;do{W=c[C+(D*148|0)+(P<<4)+(T<<2)>>2]|0;V=T;T=T+1|0;U=C+(D*148|0)+(P*10|0)+(T<<1)+112|0;b[U>>1]=W;if((a[N>>0]|0)==2){if((V|0)>1){W=0-W|0;b[U>>1]=W}}else if(c[C+(D*148|0)+(P<<4)+(V<<2)+48>>2]|0){W=0-W|0;b[U>>1]=W}b[U>>1]=W<<16>>16<>0]=0;while(0);P=P+1|0}while((P|0)<(I|0));C=c[x>>2]|0;c[C+(B<<3)>>2]=c[w>>2];c[C+(B<<3)+4>>2]=c[v>>2];a[(c[t>>2]|0)+B>>0]=a[u>>0]|0;C=Qb(h,z,n,c[(c[k>>2]|0)+13080>>2]|0,0)|0;if((C|0)<0){g=108;break}A=A+1|0;Ta(h,A);Db(h,z,n,e);E=c[k>>2]|0}while((C|0)!=0);if((g|0)==108){c[(c[m>>2]|0)+(B<<2)>>2]=-1;W=C;i=f;return W|0}if((z+e|0)<(c[E+13120>>2]|0)){W=A;i=f;return W|0}if((n+e|0)<(c[E+13124>>2]|0)){W=A;i=f;return W|0}Bb(h,z,n,e);W=A;i=f;return W|0}function Qb(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;j=i;i=i+32|0;z=j;B=j+20|0;A=b+136|0;r=c[A>>2]|0;l=1<>2]|0;q=b+204|0;t=c[q>>2]|0;p=(1<<(c[s+13080>>2]|0)-(c[t+24>>2]|0))+ -1|0;c[r+31232>>2]=h;k=l+e|0;if(((k|0)<=(c[s+13120>>2]|0)?(l+f|0)<=(c[s+13124>>2]|0):0)?(c[s+13064>>2]|0)>>>0>>0:0){s=lb(b,h,e,f)|0;t=c[q>>2]|0}else s=(c[s+13064>>2]|0)>>>0>>0&1;if((a[t+22>>0]|0)!=0?((c[(c[m>>2]|0)+13080>>2]|0)-(c[t+24>>2]|0)|0)>>>0<=g>>>0:0){a[r+300>>0]=0;c[r+280>>2]=0}if((a[b+2080>>0]|0)!=0?((c[(c[m>>2]|0)+13080>>2]|0)-(d[(c[q>>2]|0)+1632>>0]|0)|0)>>>0<=g>>>0:0)a[r+301>>0]=0;if(s){o=l>>1;n=o+e|0;q=o+f|0;g=g+ -1|0;h=h+1|0;s=Qb(b,e,f,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}if(s){if((n|0)<(c[(c[m>>2]|0)+13120>>2]|0)){s=Qb(b,n,f,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}if(s){if((q|0)<(c[(c[m>>2]|0)+13124>>2]|0)){s=Qb(b,e,q,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}if(s){X=c[m>>2]|0;if((n|0)<(c[X+13120>>2]|0)?(q|0)<(c[X+13124>>2]|0):0){s=Qb(b,n,q,g,h)|0;if((s|0)<0){X=s;i=j;return X|0}}}else s=0}else s=0}else s=0;if((p&k|0)==0?(p&l+f|0)==0:0)c[r+276>>2]=a[r+272>>0];if(!s){X=0;i=j;return X|0}k=c[m>>2]|0;if((n+o|0)<(c[k+13120>>2]|0))k=1;else k=(q+o|0)<(c[k+13124>>2]|0);X=k&1;i=j;return X|0}p=c[A>>2]|0;s=c[m>>2]|0;r=c[s+13064>>2]|0;h=c[s+13140>>2]|0;s=1<<(c[s+13080>>2]|0)-(c[(c[q>>2]|0)+24>>2]|0);c[p+31236>>2]=e;c[p+31240>>2]=f;x=p+31252|0;a[x>>0]=1;v=p+31244|0;c[v>>2]=1;E=p+31248|0;c[E>>2]=0;w=p+31254|0;a[w>>0]=0;y=p+31253|0;a[y>>0]=0;t=($(f>>r,h)|0)+(e>>r)|0;H=b+4332|0;a[(c[H>>2]|0)+t>>0]=0;X=p+31268|0;a[X>>0]=1;a[X+1>>0]=1;a[X+2>>0]=1;a[X+3>>0]=1;r=l>>r;s=s+ -1|0;if(a[(c[q>>2]|0)+40>>0]|0){X=(gb(b)|0)&255;a[p+31256>>0]=X;if(X<<24>>24)Rb(b,e,f,g)}else a[p+31256>>0]=0;u=(r|0)>0;if(u){G=t;F=0;while(1){be((c[H>>2]|0)+G|0,0,r|0)|0;F=F+1|0;if((F|0)==(r|0))break;else G=G+h|0}}if((c[v>>2]|0)==1?(c[(c[m>>2]|0)+13064>>2]|0)!=(g|0):0)D=c[E>>2]|0;else{F=mb(b,g)|0;c[E>>2]=F;E=c[v>>2]|0;if((F|0)==3)G=(E|0)==1&1;else G=0;a[w>>0]=G;if((E|0)==1)D=F;else ta()}if((((D|0)==0?(C=c[m>>2]|0,(c[C+68>>2]|0)!=0):0)?(c[C+13048>>2]|0)>>>0<=g>>>0:0)?(c[C+13052>>2]|0)>>>0>=g>>>0:0){C=(nb(b)|0)&255;a[y>>0]=C}else C=a[y>>0]|0;do if(!(C<<24>>24)){C=c[A>>2]|0;E=(c[C+31248>>2]|0)==3;D=E?2:1;H=0;do{F=H<<1;G=0;do{a[B+(G+F)>>0]=ob(b)|0;G=G+1|0}while((G|0)<(D|0));H=H+1|0}while((H|0)<(D|0));Q=l>>(E&1);P=C+31264|0;R=z+4|0;E=z+8|0;F=b+4340|0;O=C+31260|0;N=0;do{J=N<<1;H=($(N,Q)|0)+f|0;I=0;do{L=I+J|0;U=(a[B+L>>0]|0)==0;if(U)c[P>>2]=qb(b)|0;else c[O>>2]=pb(b)|0;V=($(I,Q)|0)+e|0;T=c[A>>2]|0;X=c[m>>2]|0;S=c[X+13084>>2]|0;M=V>>S;K=H>>S;G=c[X+13156>>2]|0;S=Q>>S;X=c[X+13080>>2]|0;W=(1<>0]|0)==0?(W&H|0)==0:0)W=1;else{W=($(K+ -1|0,G)|0)+M|0;W=d[(c[F>>2]|0)+W>>0]|0}if((a[T+308>>0]|0)==0&(V|0)==0)V=1;else{V=M+ -1+($(K,G)|0)|0;V=d[(c[F>>2]|0)+V>>0]|0}X=(H>>X<>>0<2){c[z>>2]=0;c[R>>2]=1;c[E>>2]=26;V=0;X=1;W=26;break}else{c[z>>2]=V;X=(V+29&31)+2|0;c[R>>2]=X;W=(V+31&31)+2|0;c[E>>2]=W;break}else{c[z>>2]=V;c[R>>2]=X;if(!((V|0)==0|(X|0)==0)){c[E>>2]=0;W=0;break}if((V|0)==1|(X|0)==1){c[E>>2]=26;W=26;break}else{c[E>>2]=1;W=1;break}}while(0);if(U){if((V|0)>(X|0)){c[R>>2]=V;U=X&255;c[z>>2]=U}else{U=V;V=X}if((U|0)>(W|0)){c[E>>2]=U;X=W&255;c[z>>2]=X;W=U;U=X}if((V|0)>(W|0)){c[E>>2]=V;X=W&255;c[R>>2]=X}else{X=V;V=W}T=c[T+31264>>2]|0;T=((T|0)>=(U|0)&1)+T|0;T=((T|0)>=(X|0)&1)+T|0;T=((T|0)>=(V|0)&1)+T|0}else T=c[z+(c[T+31260>>2]<<2)>>2]|0;S=(S|0)==0?1:S;T=T&255;if((S|0)>0){U=0;do{X=($(U+K|0,G)|0)+M|0;be((c[F>>2]|0)+X|0,T|0,S|0)|0;U=U+1|0}while((U|0)<(S|0))}a[C+L+31268>>0]=T;I=I+1|0}while((I|0)<(D|0));N=N+1|0}while((N|0)<(D|0));z=c[(c[m>>2]|0)+4>>2]|0;if((z|0)==3){B=0;do{z=B<<1;E=0;do{G=rb(b)|0;F=E+z|0;a[C+F+31281>>0]=G;A=a[C+F+31268>>0]|0;do if((G|0)!=4){G=a[1528+G>>0]|0;F=C+F+31277|0;if(A<<24>>24==G<<24>>24){a[F>>0]=34;break}else{a[F>>0]=G;break}}else a[C+F+31277>>0]=A;while(0);E=E+1|0}while((E|0)<(D|0));B=B+1|0}while((B|0)<(D|0))}else if(!z)break;else if((z|0)!=2){A=rb(b)|0;z=a[C+31268>>0]|0;if((A|0)==4){a[C+31277>>0]=z;break}A=a[1528+A>>0]|0;B=C+31277|0;if(z<<24>>24==A<<24>>24){a[B>>0]=34;break}else{a[B>>0]=A;break}}else{z=rb(b)|0;a[C+31281>>0]=z;A=a[C+31268>>0]|0;if((z|0)==4)z=A&255;else{z=a[1528+z>>0]|0;z=A<<24>>24==z<<24>>24?34:z&255}a[C+31277>>0]=a[1536+z>>0]|0;break}}else{G=c[m>>2]|0;B=c[G+13084>>2]|0;E=l>>B;C=c[G+13156>>2]|0;D=e>>B;B=f>>B;E=(E|0)==0?1:E;if((E|0)>0){F=b+4340|0;G=0;do{X=($(G+B|0,C)|0)+D|0;be((c[F>>2]|0)+X|0,1,E|0)|0;G=G+1|0}while((G|0)<(E|0));G=c[m>>2]|0}K=c[A>>2]|0;V=c[b+160>>2]|0;A=c[V+32>>2]|0;D=$(A,f)|0;H=c[G+56>>2]|0;D=(c[V>>2]|0)+((e<>2]|0;J=c[G+13184>>2]|0;B=$(f>>J,E)|0;I=c[G+13172>>2]|0;B=(c[V+4>>2]|0)+((e>>I<>2]|0;X=c[G+13188>>2]|0;F=$(f>>X,C)|0;W=c[G+13176>>2]|0;F=(c[V+8>>2]|0)+((e>>W<>0]|0,l<>W,l>>X)|0)+($(l>>I,l>>J)|0)|0;G=($(d[G+13045>>0]|0,J)|0)+H|0;H=K+224|0;J=G+7>>3;I=c[K+240>>2]|0;X=c[H>>2]|0;I=(X&1|0)==0?I:I+ -1|0;I=(X&511|0)==0?I:I+ -1|0;K=(c[K+244>>2]|0)-I|0;if((K|0)<(J|0))I=0;else Yc(H,I+J|0,K-J|0);if(!(a[b+2061>>0]|0))Ab(b,e,f,g);X=G>>>0>2147483639|(I|0)==0;W=X?0:G;V=X?0:I;c[z>>2]=V;c[z+12>>2]=W;c[z+16>>2]=W+8;c[z+4>>2]=V+(W+7>>3);c[z+8>>2]=0;if(X)z=-1094995529;else{W=b+2608|0;Ha[c[W>>2]&3](D,A,l,l,z,d[(c[m>>2]|0)+13044>>0]|0);X=c[m>>2]|0;Ha[c[W>>2]&3](B,E,l>>c[X+13172>>2],l>>c[X+13184>>2],z,d[X+13045>>0]|0);X=c[m>>2]|0;Ha[c[W>>2]&3](F,C,l>>c[X+13176>>2],l>>c[X+13188>>2],z,d[X+13045>>0]|0);z=0}if(a[(c[m>>2]|0)+13056>>0]|0)Rb(b,e,f,g);if((z|0)<0){X=z;i=j;return X|0}}while(0);do if(!(a[y>>0]|0)){if(!(a[x>>0]|0)){if(a[b+2061>>0]|0)break;Ab(b,e,f,g);break}x=c[m>>2]|0;if((c[v>>2]|0)==1)v=(d[w>>0]|0)+(c[x+13092>>2]|0)|0;else v=c[x+13088>>2]|0;a[p+31255>>0]=v;v=Sb(b,e,f,e,f,e,f,g,g,0,0,1520,1520)|0;if((v|0)<0){X=v;i=j;return X|0}}while(0);if((a[(c[q>>2]|0)+22>>0]|0)!=0?(a[p+300>>0]|0)==0:0)zb(b,e,f,g);if(u){q=b+4316|0;g=p+272|0;u=0;while(1){be((c[q>>2]|0)+t|0,a[g>>0]|0,r|0)|0;u=u+1|0;if((u|0)==(r|0))break;else t=t+h|0}}if((s&k|0)==0?(s&l+f|0)==0:0)c[p+276>>2]=a[p+272>>0];q=c[m>>2]|0;X=c[q+13064>>2]|0;g=l>>X;r=e>>X;e=f>>X;if((g|0)>0?(n=b+4336|0,o=c[p+31232>>2]&255,X=($(c[q+13140>>2]|0,e)|0)+r|0,be((c[n>>2]|0)+X|0,o|0,g|0)|0,(g|0)!=1):0){p=1;do{X=($(c[(c[m>>2]|0)+13140>>2]|0,p+e|0)|0)+r|0;be((c[n>>2]|0)+X|0,o|0,g|0)|0;p=p+1|0}while((p|0)!=(g|0))}e=c[m>>2]|0;m=1<>2];if(((k|0)%(m|0)|0|0)!=0?(k|0)<(c[e+13120>>2]|0):0){X=1;i=j;return X|0}X=l+f|0;if(((X|0)%(m|0)|0|0)!=0?(X|0)<(c[e+13124>>2]|0):0){X=1;i=j;return X|0}X=(fb(b)|0)==0&1;i=j;return X|0}function Rb(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;g=i;m=1<>2]|0;l=c[n+13084>>2]|0;f=c[n+13156>>2]|0;k=m+d|0;j=c[n+13120>>2]|0;m=m+e|0;n=c[n+13124>>2]|0;h=e>>l;e=((m|0)>(n|0)?n:m)>>l;if((h|0)>=(e|0)){i=g;return}d=d>>l;j=((k|0)>(j|0)?j:k)>>l;k=(d|0)<(j|0);b=b+4348|0;do{if(k){m=$(h,f)|0;l=d;do{a[(c[b>>2]|0)+(l+m)>>0]=2;l=l+1|0}while((l|0)!=(j|0))}h=h+1|0}while((h|0)!=(e|0));i=g;return}function Sb(e,f,g,h,j,k,l,m,n,o,p,q,r){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;var 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;s=i;i=i+16|0;w=s+8|0;t=s;z=e+136|0;v=c[z>>2]|0;K=c[q>>2]|0;c[w>>2]=K;M=c[q+4>>2]|0;A=w+4|0;c[A>>2]=M;y=c[r>>2]|0;c[t>>2]=y;J=c[r+4>>2]|0;x=t+4|0;c[x>>2]=J;q=a[v+31254>>0]|0;do if(q<<24>>24){if((o|0)==1){c[v+288>>2]=d[v+p+31268>>0];if((c[(c[e+200>>2]|0)+4>>2]|0)==3){c[v+292>>2]=d[v+p+31277>>0];c[v+296>>2]=d[v+p+31281>>0];break}else{c[v+292>>2]=d[v+31277>>0];c[v+296>>2]=d[v+31281>>0];break}}}else{c[v+288>>2]=d[v+31268>>0];c[v+292>>2]=d[v+31277>>0];c[v+296>>2]=d[v+31281>>0]}while(0);r=e+200|0;G=c[r>>2]|0;B=(c[G+13076>>2]|0)>>>0>>0;if(((!B?(c[G+13072>>2]|0)>>>0>>0:0)?(d[v+31255>>0]|0)>(o|0):0)?!(q<<24>>24!=0&(o|0)==0):0)q=(sb(e,n)|0)&255;else{if((c[G+13088>>2]|0)==0?(c[v+31244>>2]|0)==0:0)G=(o|0)==0&(c[v+31248>>2]|0)!=0;else G=0;if(B)q=1;else q=(q<<24>>24!=0&(o|0)==0|G)&1}B=(n|0)>2;G=c[(c[r>>2]|0)+4>>2]|0;if(B)if(!G)L=y;else E=20;else if((G|0)==3)E=20;else L=y;do if((E|0)==20){G=(o|0)==0;if(!((K|0)==0&(G^1))){K=tb(e,o)|0;c[w>>2]=K;if((c[(c[r>>2]|0)+4>>2]|0)==2?q<<24>>24==0|(n|0)==3:0){M=tb(e,o)|0;c[A>>2]=M}if(!G)E=25}else{K=0;E=25}if((E|0)==25)if(!y){L=0;break}L=tb(e,o)|0;c[t>>2]=L;if((c[(c[r>>2]|0)+4>>2]|0)==2?q<<24>>24==0|(n|0)==3:0){J=tb(e,o)|0;c[x>>2]=J}}while(0);if(!(q<<24>>24)){A=c[r>>2]|0;y=c[A+13072>>2]|0;x=1<>2]|0;if(((o|0)==0?(c[v+31244>>2]|0)!=1:0)&(K|0)==0&(L|0)==0)if((c[A+4>>2]|0)==2?(M|J|0)!=0:0)E=37;else o=1;else E=37;if((E|0)==37){o=ub(e,o)|0;A=c[r>>2]|0}G=c[z>>2]|0;A=n-(c[A+13172>>2]|0)|0;z=G+31244|0;if((c[z>>2]|0)==1){I=1<>2]|0;L=c[K+4>>2]|0;if((L|0)==2){if(M){E=46;break}if(J){M=0;E=46;break}}if(!((c[z>>2]|0)!=1|(L|0)==0)){if(B|(L|0)==3){t=1<<(c[K+13172>>2]|0)+A;w=1<<(c[K+13184>>2]|0)+A;Cc(e,f,g,t,w);Ub(e,f,g,A,1);Ub(e,f,g,A,2);if((c[(c[r>>2]|0)+4>>2]|0)!=2)break;M=(1<>2]|0)+n,Cc(e,h,j,F,H),Ub(e,h,j,n,1),Ub(e,h,j,n,2),(c[(c[r>>2]|0)+4>>2]|0)==2):0){M=(1<>2]|0)+4>>2]|0)==2){F=(M|J|0)==0;E=48}else{F=1;E=48}a:do if((E|0)==48){E=e+204|0;do if((a[(c[E>>2]|0)+22>>0]|0)!=0?(D=G+300|0,(a[D>>0]|0)==0):0){M=hb(e)|0;J=G+280|0;c[J>>2]=M;if(M){M=(ib(e)|0)==1;H=c[J>>2]|0;if(M){H=0-H|0;c[J>>2]=H}}else H=0;a[D>>0]=1;M=(c[(c[r>>2]|0)+13192>>2]|0)/2|0;if((H|0)<(-26-M|0)|(H|0)>(M+25|0)){M=-1094995529;i=s;return M|0}else{zb(e,k,l,m);break}}while(0);if((!((a[e+2080>>0]|0)==0|F)?(a[G+31256>>0]|0)==0:0)?(C=G+301|0,(a[C>>0]|0)==0):0){if(!(jb(e)|0)){a[G+302>>0]=0;a[G+303>>0]=0}else{l=c[E>>2]|0;if(!(a[l+1633>>0]|0))m=0;else{m=kb(e)|0;l=c[E>>2]|0}a[G+302>>0]=a[l+m+1634>>0]|0;a[G+303>>0]=a[(c[E>>2]|0)+m+1639>>0]|0}a[C>>0]=1}if((c[z>>2]|0)==1&(n|0)<4){m=c[G+288>>2]|0;if((m+ -6|0)>>>0<9)k=2;else k=(m+ -22|0)>>>0<9&1;m=c[G+292>>2]|0;if((m+ -6|0)>>>0<9)m=2;else m=(m+ -22|0)>>>0<9&1}else{k=0;m=0}l=G+304|0;a[l>>0]=0;if(I)xb(e,f,g,n,k,0);k=c[r>>2]|0;C=c[k+4>>2]|0;if(C){if(!(B|(C|0)==3)){if((p|0)!=3)break;p=1<>2]|0)+n;l=0;do{if((c[z>>2]|0)==1){M=(l<>2]|0)xb(e,h,(l<>2]|0)+4>>2]|0)==2?2:1)|0));w=0;while(1){if((c[z>>2]|0)==1){M=(w<>2]|0)xb(e,h,(w<=(((c[(c[r>>2]|0)+4>>2]|0)==2?2:1)|0))break a}}h=1<<(c[k+13172>>2]|0)+A;j=1<<(c[k+13184>>2]|0)+A;do if((a[(c[E>>2]|0)+1630>>0]|0)==0|I^1)a[l>>0]=0;else{if(c[z>>2]|0){M=(c[G+296>>2]|0)==4;a[l>>0]=M&1;if(!M)break}else a[l>>0]=1;Tb(e,0)}while(0);p=e+160|0;E=G+320|0;D=G+11680|0;C=1<0;B=e+(A+ -2<<2)+2612|0;F=G+284|0;I=0;do{if((c[z>>2]|0)==1){M=(I<>2]|0)){if(!(a[l>>0]|0))break;L=c[p>>2]|0;G=c[L+36>>2]|0;H=c[r>>2]|0;M=$(g>>c[H+13184>>2],G)|0;H=(c[L+4>>2]|0)+(M+(f>>c[H+13172>>2]<>2]))|0;if(k){I=0;do{b[D+(I<<1)>>1]=($(b[E+(I<<1)>>1]|0,c[F>>2]|0)|0)>>>3;I=I+1|0}while((I|0)!=(C|0));I=C}else I=0;Ea[c[B>>2]&7](H,D,G)}else xb(e,f,(I<>2]|0)+4>>2]|0)==2?2:1)|0));if(!(a[l>>0]|0))H=0;else{Tb(e,1);H=0}do{if((c[z>>2]|0)==1){M=(H<>2]|0)){if(!(a[l>>0]|0))break;L=c[p>>2]|0;w=c[L+40>>2]|0;G=c[r>>2]|0;M=$(g>>c[G+13188>>2],w)|0;G=(c[L+8>>2]|0)+(M+(f>>c[G+13176>>2]<>2]))|0;if(k){H=0;do{b[D+(H<<1)>>1]=($(b[E+(H<<1)>>1]|0,c[F>>2]|0)|0)>>>3;H=H+1|0}while((H|0)!=(C|0));H=C}else H=0;Ea[c[B>>2]&7](G,D,w)}else xb(e,f,(H<>2]|0)+4>>2]|0)==2?2:1)|0))}}while(0);if((o|0)!=0?(u=1<0):0){t=e+4344|0;r=0;do{w=$(r+g>>y,q)|0;h=0;do{a[(c[t>>2]|0)+((h+f>>y)+w)>>0]=1;h=h+x|0}while((h|0)<(u|0));r=r+x|0}while((r|0)<(u|0))}if(((a[e+2061>>0]|0)==0?(Ab(e,f,g,n),(a[(c[e+204>>2]|0)+40>>0]|0)!=0):0)?(a[v+31256>>0]|0)!=0:0)Rb(e,f,g,n)}else{v=n+ -1|0;u=1<>2]|0;f=vb(a,b)|0;if(!f){c[e+284>>2]=0;i=d;return}else{c[e+284>>2]=1-((wb(a,b)|0)<<1)<>2]|0;q=c[b+200>>2]|0;O=c[q+(h<<2)+13168>>2]|0;N=c[q+(h<<2)+13180>>2]|0;k=1<>2]|0;ga=k<>2]|0;P=e>>V&T;R=f>>V&T;S=T+2|0;Q=($(R,S)|0)+P|0;U=c[b+204>>2]|0;aa=c[U+1684>>2]|0;Q=c[aa+(Q<<2)>>2]|0;l=c[b+160>>2]|0;b=c[l+(h<<2)+32>>2]|0;l=c[l+(h<<2)>>2]|0;m=($(b,f>>N)|0)+(e>>O)|0;n=l+m|0;o=(h|0)==0;p=c[(o?r+288|0:r+292|0)>>2]|0;u=t+1|0;y=w+1|0;x=z+1|0;s=v+1|0;if(!(c[r+31288>>2]|0))fa=0;else fa=(Q|0)>(c[aa+(P+ -1+($(T&R+(ga>>V),S)|0)<<2)>>2]|0);da=fa&1;_=c[r+31292>>2]|0;H=c[r+31300>>2]|0;Z=c[r+31296>>2]|0;if(!(c[r+31304>>2]|0))ba=0;else ba=(Q|0)>(c[aa+(($(S,R+ -1|0)|0)+(T&P+(ea>>V))<<2)>>2]|0);S=ba&1;V=(ga<<1)+f|0;R=q+13124|0;aa=c[R>>2]|0;P=ga+f|0;V=((V|0)>(aa|0)?aa:V)-P>>N;aa=(ea<<1)+e|0;T=q+13120|0;ja=c[T>>2]|0;Q=ea+e|0;aa=((aa|0)>(ja|0)?ja:aa)-Q>>O;U=U+20|0;if((a[U>>0]|0)==1){ca=c[q+13084>>2]|0;ha=ga>>ca;ea=ea>>ca;ia=(1<>2]|0)-(P>>ca)|0;fa=(ha|0)>(fa|0)?fa:ha;if((fa|0)>0){da=0;ja=0;do{da=da|1;ja=ja+2|0}while((ja|0)<(fa|0))}else da=0}if(!((_|0)!=1|ia)){fa=(c[q+13160>>2]|0)-(f>>ca)|0;fa=(ha|0)>(fa|0)?fa:ha;if((fa|0)>0){_=0;ha=0;do{_=_|1;ha=ha+2|0}while((ha|0)<(fa|0))}else _=0}fa=(ga|0)!=0;if(!((Z|0)!=1|fa)){ga=(c[q+13156>>2]|0)-(e>>ca)|0;ga=(ea|0)>(ga|0)?ga:ea;if((ga|0)>0){Z=0;ha=0;do{Z=Z|1;ha=ha+2|0}while((ha|0)<(ga|0))}else Z=0}if(!(fa|ba^1)){ca=(c[q+13156>>2]|0)-(Q>>ca)|0;ca=(ea|0)>(ca|0)?ca:ea;if((ca|0)>0){S=0;ba=0;do{S=S|1;ba=ba+2|0}while((ba|0)<(ca|0))}else S=0}ba=u+0|0;ca=ba+64|0;do{a[ba>>0]=128;ba=ba+1|0}while((ba|0)<(ca|0));ba=w+0|0;ca=ba+65|0;do{a[ba>>0]=128;ba=ba+1|0}while((ba|0)<(ca|0));ea=S}else ea=S;ba=(H|0)!=0;if(ba){ja=a[l+(m+~b)>>0]|0;a[t>>0]=ja;a[w>>0]=ja}ca=(Z|0)!=0;if(ca)ee(y|0,l+(m-b)|0,k|0)|0;S=(ea|0)!=0;if(S?(Y=k+1|0,ee(w+Y|0,l+(k-b+m)|0,k|0)|0,X=$(d[l+(k+ -1-b+m+aa)>>0]|0,16843009)|0,W=k-aa|0,(W|0)>0):0){Y=aa+Y|0;aa=0;do{ja=w+(Y+aa)|0;a[ja>>0]=X;a[ja+1>>0]=X>>8;a[ja+2>>0]=X>>16;a[ja+3>>0]=X>>24;aa=aa+4|0}while((aa|0)<(W|0))}W=(_|0)!=0;if(W&(k|0)>0){Y=m+ -1|0;X=0;do{ja=X;X=X+1|0;a[t+X>>0]=a[l+(Y+($(ja,b)|0))>>0]|0}while((X|0)!=(k|0))}X=(da|0)!=0;if(X){aa=V+k|0;fa=m+ -1|0;if((V|0)>0){Y=k;do{ja=Y;Y=Y+1|0;a[t+Y>>0]=a[l+(fa+($(ja,b)|0))>>0]|0}while((Y|0)<(aa|0))}Y=$(d[l+(fa+($(aa+ -1|0,b)|0))>>0]|0,16843009)|0;aa=k-V|0;if((aa|0)>0){V=k+1+V|0;fa=0;do{ja=t+(V+fa)|0;a[ja>>0]=Y;a[ja+1>>0]=Y>>8;a[ja+2>>0]=Y>>16;a[ja+3>>0]=Y>>24;fa=fa+4|0}while((fa|0)<(aa|0))}}do if((a[U>>0]|0)==1?(ja=da|_,L=(ja|0)==0,ja=ja|H,M=(ja|0)==0,(Z|ea|ja|0)!=0):0){U=k<<1;V=c[T>>2]|0;if(((U<>O;R=c[R>>2]|0;if(((U<=(R|0))U=R-f>>N;if(!S)if((Q|0)<(V|0))O=k;else O=V-e>>O;else O=T;if(!X)if((P|0)<(R|0))U=k;else U=R-f>>N;N=a[w>>0]|0;if(M)a[t>>0]=N;a[t>>0]=N;if(!L){L=0;while(1)if((L|0)<(U|0))L=L+4|0;else break}if(!W?(K=$(N&255,16843009)|0,(k|0)>0):0){L=0;do{ja=t+(L|1)|0;a[ja>>0]=K;a[ja+1>>0]=K>>8;a[ja+2>>0]=K>>16;a[ja+3>>0]=K>>24;L=L+4|0}while((L|0)<(k|0))}do if(!X){L=$(d[t+k>>0]|0,16843009)|0;if((k|0)<=0)break;K=k+1|0;M=0;do{ja=t+(K+M)|0;a[ja>>0]=L;a[ja+1>>0]=L>>8;a[ja+2>>0]=L>>16;a[ja+3>>0]=L>>24;M=M+4|0}while((M|0)<(k|0))}while(0);f=(f|0)==0;if((e|0)==0&(U|0)>0){e=0;do{ja=t+(e|1)|0;a[ja>>0]=0;a[ja+1>>0]=0;a[ja+2>>0]=0;a[ja+3>>0]=0;e=e+4|0}while((e|0)<(U|0))}a[w>>0]=a[t>>0]|0;if(f)break;else e=0;while(1)if((e|0)<(O|0))e=e+4|0;else break}while(0);a:do if(!X){if(W){f=$(d[t+k>>0]|0,16843009)|0;if((k|0)<=0){J=84;break}J=k+1|0;e=0;while(1){ja=t+(J+e)|0;a[ja>>0]=f;a[ja+1>>0]=f>>8;a[ja+2>>0]=f>>16;a[ja+3>>0]=f>>24;e=e+4|0;if((e|0)>=(k|0)){J=84;break a}}}if(ba){e=$(d[t>>0]|0,16843009)|0;J=k<<1;if((k|0)>0)I=0;else{J=87;break}while(1){ja=t+(I|1)|0;a[ja>>0]=e;a[ja+1>>0]=e>>8;a[ja+2>>0]=e>>16;a[ja+3>>0]=e>>24;I=I+4|0;if((I|0)>=(J|0)){J=87;break a}}}if(ca){I=a[y>>0]|0;a[t>>0]=I;I=$(I&255,16843009)|0;H=k<<1;if((k|0)>0)J=0;else{J=89;break}while(1){ja=t+(J|1)|0;a[ja>>0]=I;a[ja+1>>0]=I>>8;a[ja+2>>0]=I>>16;a[ja+3>>0]=I>>24;J=J+4|0;if((J|0)>=(H|0)){J=89;break a}}}if(!S){a[t>>0]=-128;J=k<<1;f=(k|0)>0;if(f)e=0;else{J=84;break}do{ja=w+(e|1)|0;a[ja>>0]=-2139062144;a[ja+1>>0]=-2139062144>>8;a[ja+2>>0]=-2139062144>>16;a[ja+3>>0]=-2139062144>>24;e=e+4|0}while((e|0)<(J|0));if(f)e=0;else{J=84;break}while(1){ja=t+(e|1)|0;a[ja>>0]=-2139062144;a[ja+1>>0]=-2139062144>>8;a[ja+2>>0]=-2139062144>>16;a[ja+3>>0]=-2139062144>>24;e=e+4|0;if((e|0)>=(J|0)){J=84;break a}}}H=w+(k+1)|0;e=a[H>>0]|0;I=$(e&255,16843009)|0;G=(k|0)>0;if(G)J=0;else{a[t>>0]=e;break}do{ja=w+(J|1)|0;a[ja>>0]=I;a[ja+1>>0]=I>>8;a[ja+2>>0]=I>>16;a[ja+3>>0]=I>>24;J=J+4|0}while((J|0)<(k|0));I=a[H>>0]|0;a[t>>0]=I;I=$(I&255,16843009)|0;H=k<<1;if(G){G=0;do{ja=t+(G|1)|0;a[ja>>0]=I;a[ja+1>>0]=I>>8;a[ja+2>>0]=I>>16;a[ja+3>>0]=I>>24;G=G+4|0}while((G|0)<(H|0));J=92}else J=92}else J=84;while(0);if((J|0)==84)if((_|0)==0?(I=$(d[t+(k+1)>>0]|0,16843009)|0,(k|0)>0):0){J=0;do{ja=t+(J|1)|0;a[ja>>0]=I;a[ja+1>>0]=I>>8;a[ja+2>>0]=I>>16;a[ja+3>>0]=I>>24;J=J+4|0}while((J|0)<(k|0));J=87}else J=87;if((J|0)==87)if(!H){a[t>>0]=a[u>>0]|0;J=89}else J=89;if((J|0)==89)if((Z|0)==0?(G=$(d[t>>0]|0,16843009)|0,(k|0)>0):0){H=0;do{ja=w+(H|1)|0;a[ja>>0]=G;a[ja+1>>0]=G>>8;a[ja+2>>0]=G>>16;a[ja+3>>0]=G>>24;H=H+4|0}while((H|0)<(k|0));J=92}else J=92;if(((J|0)==92?!S:0)?(F=$(d[w+k>>0]|0,16843009)|0,(k|0)>0):0){H=k+1|0;G=0;do{ja=w+(H+G)|0;a[ja>>0]=F;a[ja+1>>0]=F>>8;a[ja+2>>0]=F>>16;a[ja+3>>0]=F>>24;G=G+4|0}while((G|0)<(k|0))}F=a[t>>0]|0;a[w>>0]=F;b:do if(!(c[q+13112>>2]|0)){if(o){if((p|0)==1|(k|0)==4){s=y;break}}else if(((p|0)==1?1:(c[q+4>>2]|0)!=3)|(k|0)==4){s=y;break}ja=p+ -26|0;ja=(ja|0)>-1?ja:26-p|0;ia=p+ -10|0;ia=(ia|0)>-1?ia:10-p|0;if((((ja|0)>(ia|0)?ia:ja)|0)>(c[1576+(g+ -3<<2)>>2]|0)){if((o&(a[q+13061>>0]|0)!=0&(g|0)==5?(D=F&255,E=a[w+64>>0]|0,C=E&255,ja=C+D-(d[w+32>>0]<<1)|0,(((ja|0)>-1?ja:0-ja|0)|0)<8):0)?(A=t+64|0,B=a[A>>0]|0,ja=(B&255)+D-(d[t+32>>0]<<1)|0,(((ja|0)>-1?ja:0-ja|0)|0)<8):0){a[v>>0]=F;a[v+64>>0]=E;w=0;do{ja=w;w=w+1|0;a[v+w>>0]=(($(D,63-ja|0)|0)+32+($(C,w)|0)|0)>>>6}while((w|0)!=63);w=0;while(1){v=w+1|0;a[t+v>>0]=(($(F&255,63-w|0)|0)+32+($(B&255,v)|0)|0)>>>6;if((v|0)==63)break b;F=a[t>>0]|0;B=a[A>>0]|0;w=v}}A=k<<1;D=a[t+A>>0]|0;a[z+A>>0]=D;B=a[w+A>>0]|0;a[v+A>>0]=B;A=A+ -2|0;C=(A|0)>-1;if(C){E=A;while(1){ja=E+1|0;ia=D;D=a[t+ja>>0]|0;a[z+ja>>0]=((ia&255)+2+((D&255)<<1)+(d[t+E>>0]|0)|0)>>>2;if((E|0)<=0)break;else E=E+ -1|0}}ja=((d[u>>0]|0)+2+((F&255)<<1)+(d[y>>0]|0)|0)>>>2&255;a[z>>0]=ja;a[v>>0]=ja;if(C)while(1){ja=A+1|0;ia=B;B=a[w+ja>>0]|0;a[v+ja>>0]=((ia&255)+2+((B&255)<<1)+(d[w+A>>0]|0)|0)>>>2;if((A|0)<=0){u=x;break}else A=A+ -1|0}else u=x}else s=y}else s=y;while(0);if(!p){Vb(n,s,u,b,g);i=j;return}else if((p|0)==1){if((k|0)>0){p=k;h=0;do{p=(d[u+h>>0]|0)+p+(d[s+h>>0]|0)|0;h=h+1|0}while((h|0)!=(k|0));q=p>>g+1;r=$(q,16843009)|0;g=0;do{p=($(g,b)|0)+m|0;h=0;do{ja=l+(p+h)|0;a[ja>>0]=r;a[ja+1>>0]=r>>8;a[ja+2>>0]=r>>16;a[ja+3>>0]=r>>24;h=h+4|0}while((h|0)<(k|0));g=g+1|0}while((g|0)!=(k|0))}else q=k>>g+1;if(!(o&(k|0)<32)){i=j;return}a[n>>0]=((q<<1)+2+(d[u>>0]|0)+(d[s>>0]|0)|0)>>>2;if((k|0)<=1){i=j;return}n=(q*3|0)+2|0;o=1;do{a[l+(o+m)>>0]=((d[s+o>>0]|0)+n|0)>>>2;o=o+1|0}while((o|0)!=(k|0));o=1;do{a[l+(($(o,b)|0)+m)>>0]=((d[u+o>>0]|0)+n|0)>>>2;o=o+1|0}while((o|0)!=(k|0));i=j;return}else{if(!(c[q+13104>>2]|0))l=0;else l=(a[r+31256>>0]|0)!=0;Wb(n,s,u,b,h,p,k,l&1);i=j;return}}function Vb(b,c,e,f,g){b=b|0;c=c|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;m=i;j=1<>0]|0,l-r|0)|0;s=r;r=r+1|0;u=$(d[h>>0]|0,r)|0;t=$(d[c+s>>0]|0,p)|0;a[b+(s+q)>>0]=v+j+u+t+($(d[k>>0]|0,n)|0)>>g}while((r|0)!=(j|0))}while((n|0)!=(j|0));i=m;return}function Wb(c,e,f,g,h,j,k,l){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;m=i;i=i+112|0;o=m;n=a[1592+(j+ -2)>>0]|0;p=o+k|0;q=($(n,k)|0)>>5;if((j|0)>17){s=e+ -1|0;r=j+ -11|0;if(r>>>0<15&(q|0)<-1){if((k|0)>=0){s=0;do{u=e+(s+ -1)|0;u=d[u>>0]|d[u+1>>0]<<8|d[u+2>>0]<<16|d[u+3>>0]<<24;v=o+(s+k)|0;a[v>>0]=u;a[v+1>>0]=u>>8;a[v+2>>0]=u>>16;a[v+3>>0]=u>>24;s=s+4|0}while((s|0)<=(k|0))}if((q|0)<0){r=b[1632+(r<<1)>>1]|0;do{a[o+(q+k)>>0]=a[f+((($(r,q)|0)+128>>8)+ -1)>>0]|0;q=q+1|0}while((q|0)!=0)}}else p=s;o=(k|0)>0;if(o){q=0;do{u=q;q=q+1|0;s=$(q,n)|0;r=s>>5;s=s&31;if(!s){r=r+1|0;s=$(u,g)|0;t=0;do{u=p+(r+t)|0;u=d[u>>0]|d[u+1>>0]<<8|d[u+2>>0]<<16|d[u+3>>0]<<24;v=c+(t+s)|0;a[v>>0]=u;a[v+1>>0]=u>>8;a[v+2>>0]=u>>16;a[v+3>>0]=u>>24;t=t+4|0}while((t|0)<(k|0))}else{t=32-s|0;v=$(u,g)|0;u=0;do{w=u+r|0;x=$(d[p+(w+1)>>0]|0,t)|0;a[c+(u+v)>>0]=(x+16+($(d[p+(w+2)>>0]|0,s)|0)|0)>>>5;w=u|1;x=w+r|0;y=$(d[p+(x+1)>>0]|0,t)|0;a[c+(w+v)>>0]=(y+16+($(d[p+(x+2)>>0]|0,s)|0)|0)>>>5;w=u|2;x=w+r|0;y=$(d[p+(x+1)>>0]|0,t)|0;a[c+(w+v)>>0]=(y+16+($(d[p+(x+2)>>0]|0,s)|0)|0)>>>5;w=u|3;x=w+r|0;y=$(d[p+(x+1)>>0]|0,t)|0;a[c+(w+v)>>0]=(y+16+($(d[p+(x+2)>>0]|0,s)|0)|0)>>>5;u=u+4|0}while((u|0)<(k|0))}}while((q|0)!=(k|0))}if(!((j|0)==26&(h|0)==0&(k|0)<32&(l|0)==0&o)){i=m;return}j=f+ -1|0;n=0;do{h=((d[f+n>>0]|0)-(d[j>>0]|0)>>1)+(d[e>>0]|0)|0;if(h>>>0>255)h=0-h>>31;a[c+($(n,g)|0)>>0]=h;n=n+1|0}while((n|0)!=(k|0));i=m;return}s=f+ -1|0;r=j+ -11|0;if(r>>>0<15&(q|0)<-1){if((k|0)>=0){s=0;do{x=f+(s+ -1)|0;x=d[x>>0]|d[x+1>>0]<<8|d[x+2>>0]<<16|d[x+3>>0]<<24;y=o+(s+k)|0;a[y>>0]=x;a[y+1>>0]=x>>8;a[y+2>>0]=x>>16;a[y+3>>0]=x>>24;s=s+4|0}while((s|0)<=(k|0))}if((q|0)<0){r=b[1632+(r<<1)>>1]|0;do{a[o+(q+k)>>0]=a[e+((($(r,q)|0)+128>>8)+ -1)>>0]|0;q=q+1|0}while((q|0)!=0)}}else p=s;q=(k|0)>0;if(q){o=0;do{r=o;o=o+1|0;t=$(o,n)|0;u=t>>5;t=t&31;if(!t){s=u+1|0;t=0;do{a[c+(($(t,g)|0)+r)>>0]=a[p+(s+t)>>0]|0;t=t+1|0}while((t|0)!=(k|0))}else{s=32-t|0;v=0;do{y=v+u|0;x=$(d[p+(y+1)>>0]|0,s)|0;a[c+(($(v,g)|0)+r)>>0]=(x+16+($(d[p+(y+2)>>0]|0,t)|0)|0)>>>5;v=v+1|0}while((v|0)!=(k|0))}}while((o|0)!=(k|0))}if(!((j|0)==10&(h|0)==0&(k|0)<32&(l|0)==0&q)){i=m;return}g=e+ -1|0;n=0;do{j=((d[e+n>>0]|0)-(d[g>>0]|0)>>1)+(d[f>>0]|0)|0;if(j>>>0>255)j=0-j>>31;a[c+n>>0]=j;j=n|1;h=((d[e+j>>0]|0)-(d[g>>0]|0)>>1)+(d[f>>0]|0)|0;if(h>>>0>255)h=0-h>>31;a[c+j>>0]=h;j=n|2;h=((d[e+j>>0]|0)-(d[g>>0]|0)>>1)+(d[f>>0]|0)|0;if(h>>>0>255)h=0-h>>31;a[c+j>>0]=h;j=n|3;h=((d[e+j>>0]|0)-(d[g>>0]|0)>>1)+(d[f>>0]|0)|0;if(h>>>0>255)h=0-h>>31;a[c+j>>0]=h;n=n+4|0}while((n|0)<(k|0));i=m;return}function Xb(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0;g=i;h=c[e>>2]|0;if(!h){i=g;return}if(!(c[h+304>>2]|0)){i=g;return}h=e+46|0;f=(d[h>>0]|0)&(f^255)&255;a[h>>0]=f;if(f<<24>>24){i=g;return}Uc(c[b+4>>2]|0,e+4|0);c[e+24>>2]=0;i=g;return}function Yb(a){a=a|0;var b=0;b=i;Xb(a,a+2524|0,6);i=b;return}function Zb(a){a=a|0;var b=0;b=i;Xb(a,a+2524|0,-1);i=b;return}function _b(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;g=i;h=d+4364|0;if(((c[(c[d+2524>>2]|0)+304>>2]|0)!=0?(b[d+2568>>1]|0)==(b[h>>1]|0):0)?(c[d+2544>>2]|0)==(f|0):0){j=-1094995529;i=g;return j|0}j=d+2524|0;if(c[(c[j>>2]|0)+304>>2]|0){j=-12;i=g;return j|0}if((Tc(c[d+4>>2]|0,d+2528|0,1)|0)<0){j=-12;i=g;return j|0}k=d+200|0;m=c[k>>2]|0;c[d+2540>>2]=$(c[m+13132>>2]|0,c[m+13128>>2]|0)|0;m=d+4520|0;l=c[j>>2]|0;c[l+244>>2]=(c[m>>2]|0)==1&1;c[l+240>>2]=((c[m>>2]|0)+ -1|0)>>>0<2&1;c[e>>2]=l;c[d+2520>>2]=j;a[d+2570>>0]=(a[d+1450>>0]|0)==0?2:3;c[d+2544>>2]=f;b[d+2568>>1]=b[h>>1]|0;j=d+2552|0;f=(c[k>>2]|0)+20|0;c[j+0>>2]=c[f+0>>2];c[j+4>>2]=c[f+4>>2];c[j+8>>2]=c[f+8>>2];c[j+12>>2]=c[f+12>>2];j=0;i=g;return j|0}function $b(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,p=0;g=i;l=d+2046|0;k=d+2572|0;h=d+4366|0;n=(f|0)==0;m=d+4364|0;f=d+200|0;while(1){if((a[l>>0]|0)==1){p=d+2524|0;o=d+2570|0;if(((a[o>>0]&8)==0?(c[d+2544>>2]|0)!=(c[k>>2]|0):0)?(b[d+2568>>1]|0)==(b[h>>1]|0):0)Xb(d,p,1)}else o=d+2570|0;if(!(a[o>>0]&1))o=0;else o=(b[d+2568>>1]|0)==(b[h>>1]|0)&1;if(((n?(b[h>>1]|0)==(b[m>>1]|0):0)?(j=c[f>>2]|0,(j|0)!=0):0)?(o|0)<=(c[j+(((c[j+72>>2]|0)+ -1|0)*12|0)+80>>2]|0):0){d=0;h=21;break}if(o){h=15;break}o=b[h>>1]|0;if(o<<16>>16==(b[m>>1]|0)){d=0;h=21;break}b[h>>1]=(o&65535)+1&255}if((h|0)==15){h=d+2524|0;e=Ad(e,c[h>>2]|0)|0;if(!(a[d+2570>>0]&8))Xb(d,h,1);else Xb(d,h,9);p=(e|0)<0?e:1;i=g;return p|0}else if((h|0)==21){i=g;return d|0}return 0}function ac(){var b=0,c=0,d=0,e=0,f=0;b=i;if(!(a[1664]|0))c=0;else{i=b;return}do{d=0;do{f=($(d<<1|1,c)|0)&127;e=f>>>0>63;f=e?f+ -64|0:f;e=e?-1:1;if((f|0)>31){f=64-f|0;e=0-e|0}a[1664+(c<<5)+d>>0]=$(a[2688+f>>0]|0,e)|0;d=d+1|0}while((d|0)!=32);c=c+1|0}while((c|0)!=32);i=b;return}function bc(a,b){a=a|0;b=b|0;c[a>>2]=1;c[a+4>>2]=1;c[a+8>>2]=2;c[a+12>>2]=3;c[a+16>>2]=4;c[a+20>>2]=1;c[a+24>>2]=5;c[a+28>>2]=2;c[a+32>>2]=2;c[a+36>>2]=3;c[a+40>>2]=4;c[a+44>>2]=5;c[a+48>>2]=3;c[a+52>>2]=4;c[a+56>>2]=5;c[a+60>>2]=6;c[a+64>>2]=1;c[a+68>>2]=1;c[a+72>>2]=2;c[a+1676>>2]=2;c[a+1680>>2]=3;c[a+1684>>2]=1;c[a+1688>>2]=2;c[a+1692>>2]=2;c[a+1696>>2]=3;c[a+1700>>2]=1;c[a+1704>>2]=2;return}function cc(b,c,d,e,f,g){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0;h=i;if((e|0)<=0){i=h;return}k=(d|0)>0;j=8-g|0;m=0;while(1){if(k){l=0;do{a[b+l>>0]=(_c(f,g)|0)<>1]|0)+(d[l>>0]|0)|0;if(m>>>0>255)m=0-m>>31;a[l>>0]=m;k=k+1|0;if((k|0)==4)break;else j=j+2|0}h=h+1|0;if((h|0)==4)break;else{e=e+8|0;c=c+f|0}}i=g;return}function ec(c,e,f){c=c|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;h=0;while(1){j=e;k=0;while(1){l=c+k|0;m=(b[j>>1]|0)+(d[l>>0]|0)|0;if(m>>>0>255)m=0-m>>31;a[l>>0]=m;k=k+1|0;if((k|0)==8)break;else j=j+2|0}h=h+1|0;if((h|0)==8)break;else{e=e+16|0;c=c+f|0}}i=g;return}function fc(c,e,f){c=c|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;h=0;while(1){j=e;k=0;while(1){l=c+k|0;m=(b[j>>1]|0)+(d[l>>0]|0)|0;if(m>>>0>255)m=0-m>>31;a[l>>0]=m;k=k+1|0;if((k|0)==16)break;else j=j+2|0}h=h+1|0;if((h|0)==16)break;else{e=e+32|0;c=c+f|0}}i=g;return}function gc(c,e,f){c=c|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;h=0;while(1){j=e;k=0;while(1){l=c+k|0;m=(b[j>>1]|0)+(d[l>>0]|0)|0;if(m>>>0>255)m=0-m>>31;a[l>>0]=m;k=k+1|0;if((k|0)==32)break;else j=j+2|0}h=h+1|0;if((h|0)==32)break;else{e=e+64|0;c=c+f|0}}i=g;return}function hc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;c=c<<16>>16;e=7-c|0;c=1<0){f=1<0)g=0;else{i=d;return}while(1){h=a;j=0;while(1){b[h>>1]=(b[h>>1]|0)+f>>e;j=j+1|0;if((j|0)==(c|0))break;else h=h+2|0}g=g+1|0;if((g|0)==(c|0))break;else a=a+(c<<1)|0}i=d;return}if((c|0)<=0){i=d;return}e=0-e|0;f=0;while(1){g=a;h=0;while(1){b[g>>1]=b[g>>1]<>16);if(d){d=c+ -1|0;if((d|0)<=0){i=f;return}g=(c|0)>0;h=0;do{if(g){j=0;do{k=a+(j+c<<1)|0;b[k>>1]=(e[k>>1]|0)+(e[a+(j<<1)>>1]|0);j=j+1|0}while((j|0)!=(c|0))}a=a+(c<<1)|0;h=h+1|0}while((h|0)!=(d|0));i=f;return}if((c|0)<=0){i=f;return}d=(c|0)>1;h=0;while(1){if(d){j=b[a>>1]|0;g=1;do{k=a+(g<<1)|0;j=(e[k>>1]|0)+(j&65535)&65535;b[k>>1]=j;g=g+1|0}while((g|0)!=(c|0))}h=h+1|0;if((h|0)==(c|0))break;else a=a+(c<<1)|0}i=f;return}function lc(a){a=a|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;c=i;e=0;d=a;while(1){p=b[d>>1]|0;m=d+16|0;n=b[m>>1]|0;g=n+p|0;f=d+24|0;o=b[f>>1]|0;l=o+n|0;j=p-o|0;h=d+8|0;k=(b[h>>1]|0)*74|0;o=((p-n+o|0)*74|0)+64|0;n=o>>7;if((n+32768|0)>>>0>65535)n=o>>31^32767;b[m>>1]=n;m=(g*29|0)+64+(l*55|0)+k|0;n=m>>7;if((n+32768|0)>>>0>65535)n=m>>31^32767;b[d>>1]=n;l=($(l,-29)|0)+64+(j*55|0)+k|0;m=l>>7;if((m+32768|0)>>>0>65535)m=l>>31^32767;b[h>>1]=m;g=(g*55|0)+64+(j*29|0)-k|0;h=g>>7;if((h+32768|0)>>>0>65535)h=g>>31^32767;b[f>>1]=h;e=e+1|0;if((e|0)==4){d=0;break}else d=d+2|0}while(1){p=b[a>>1]|0;l=a+4|0;m=b[l>>1]|0;g=m+p|0;e=a+6|0;n=b[e>>1]|0;k=n+m|0;h=p-n|0;f=a+2|0;j=(b[f>>1]|0)*74|0;n=((p-m+n|0)*74|0)+2048|0;m=n>>12;if((m+32768|0)>>>0>65535)m=n>>31^32767;b[l>>1]=m;l=(g*29|0)+2048+(k*55|0)+j|0;m=l>>12;if((m+32768|0)>>>0>65535)m=l>>31^32767;b[a>>1]=m;k=($(k,-29)|0)+2048+(h*55|0)+j|0;l=k>>12;if((l+32768|0)>>>0>65535)l=k>>31^32767;b[f>>1]=l;f=(g*55|0)+2048+(h*29|0)-j|0;g=f>>12;if((g+32768|0)>>>0>65535)g=f>>31^32767;b[e>>1]=g;d=d+1|0;if((d|0)==4)break;else a=a+8|0}i=c;return}function mc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;c=i;f=0;e=a;while(1){l=b[e>>1]<<6;j=e+16|0;k=b[j>>1]<<6;g=k+l|0;k=l-k|0;l=e+8|0;m=b[l>>1]|0;d=e+24|0;n=b[d>>1]|0;h=(n*36|0)+(m*83|0)|0;m=($(n,-83)|0)+(m*36|0)|0;n=g+64+h|0;o=n>>7;if((o+32768|0)>>>0>65535)o=n>>31^32767;b[e>>1]=o;o=k+64+m|0;n=o>>7;if((n+32768|0)>>>0>65535)n=o>>31^32767;b[l>>1]=n;l=k-m+64|0;k=l>>7;if((k+32768|0)>>>0>65535)k=l>>31^32767;b[j>>1]=k;h=g-h+64|0;g=h>>7;if((g+32768|0)>>>0>65535)g=h>>31^32767;b[d>>1]=g;f=f+1|0;if((f|0)==4){e=0;break}else e=e+2|0}while(1){k=b[a>>1]<<6;h=a+4|0;l=b[h>>1]<<6;g=l+k|0;l=k-l|0;k=a+2|0;j=b[k>>1]|0;d=a+6|0;m=b[d>>1]|0;f=(m*36|0)+(j*83|0)|0;j=($(m,-83)|0)+(j*36|0)|0;m=g+2048+f|0;n=m>>12;if((n+32768|0)>>>0>65535)n=m>>31^32767;b[a>>1]=n;m=l+2048+j|0;n=m>>12;if((n+32768|0)>>>0>65535)n=m>>31^32767;b[k>>1]=n;k=l-j+2048|0;j=k>>12;if((j+32768|0)>>>0>65535)j=k>>31^32767;b[h>>1]=j;f=g-f+2048|0;g=f>>12;if((g+32768|0)>>>0>65535)g=f>>31^32767;b[d>>1]=g;e=e+1|0;if((e|0)==4)break;else a=a+8|0}i=c;return}function nc(d,e){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;h=i;i=i+64|0;j=h+48|0;p=h+32|0;f=h+16|0;g=h;q=(e|0)>8;r=e+4|0;k=j+4|0;l=j+8|0;m=j+12|0;o=0;r=(r|0)>8?8:r;n=d;while(1){c[p+0>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;w=(r|0)>1;s=0;do{if(w){t=p+(s<<2)|0;v=c[t>>2]|0;u=1;do{v=($(b[n+(u<<3<<1)>>1]|0,a[1664+(u<<2<<5)+s>>0]|0)|0)+v|0;u=u+2|0}while((u|0)<(r|0));c[t>>2]=v}s=s+1|0}while((s|0)!=4);v=b[n>>1]<<6;u=b[n+64>>1]<<6;w=u+v|0;u=v-u|0;v=b[n+32>>1]|0;t=b[n+96>>1]|0;s=(t*36|0)+(v*83|0)|0;v=($(t,-83)|0)+(v*36|0)|0;t=s+w|0;c[j>>2]=t;c[k>>2]=v+u;c[l>>2]=u-v;c[m>>2]=w-s;s=0;while(1){u=c[p+(s<<2)>>2]|0;v=t+64+u|0;w=v>>7;if((w+32768|0)>>>0>65535)w=v>>31^32767;b[n+(s<<3<<1)>>1]=w;t=t-u+64|0;u=t>>7;if((u+32768|0)>>>0>65535)u=t>>31^32767;b[n+(7-s<<3<<1)>>1]=u;s=s+1|0;if((s|0)==4)break;t=c[j+(s<<2)>>2]|0}if((r|0)<8)r=(o&3|0)==0&(o|0)!=0?r+ -4|0:r;o=o+1|0;if((o|0)==8)break;else n=n+2|0}j=q?8:e;n=(j|0)>1;k=f+4|0;l=f+8|0;m=f+12|0;o=0;while(1){c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;e=0;do{if(n){r=g+(e<<2)|0;p=c[r>>2]|0;q=1;do{p=($(b[d+(q<<1)>>1]|0,a[1664+(q<<2<<5)+e>>0]|0)|0)+p|0;q=q+2|0}while((q|0)<(j|0));c[r>>2]=p}e=e+1|0}while((e|0)!=4);v=b[d>>1]<<6;u=b[d+8>>1]<<6;w=u+v|0;u=v-u|0;v=b[d+4>>1]|0;p=b[d+12>>1]|0;e=(p*36|0)+(v*83|0)|0;v=($(p,-83)|0)+(v*36|0)|0;p=e+w|0;c[f>>2]=p;c[k>>2]=v+u;c[l>>2]=u-v;c[m>>2]=w-e;e=0;while(1){q=c[g+(e<<2)>>2]|0;r=p+2048+q|0;s=r>>12;if((s+32768|0)>>>0>65535)s=r>>31^32767;b[d+(e<<1)>>1]=s;p=p-q+2048|0;q=p>>12;if((q+32768|0)>>>0>65535)q=p>>31^32767;b[d+(7-e<<1)>>1]=q;e=e+1|0;if((e|0)==4)break;p=c[f+(e<<2)>>2]|0}o=o+1|0;if((o|0)==8)break;else d=d+16|0}i=h;return}function oc(d,e){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;j=i;i=i+192|0;t=j+160|0;u=j+128|0;m=j+112|0;l=j+96|0;g=j+64|0;h=j+32|0;f=j+16|0;k=j;s=(e|0)>16;v=e+4|0;n=m+4|0;o=m+8|0;p=m+12|0;r=0;v=(v|0)>16?16:v;q=d;while(1){c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;c[u+12>>2]=0;c[u+16>>2]=0;c[u+20>>2]=0;c[u+24>>2]=0;c[u+28>>2]=0;A=(v|0)>1;z=0;do{if(A){y=u+(z<<2)|0;w=c[y>>2]|0;x=1;do{w=($(b[q+(x<<4<<1)>>1]|0,a[1664+(x<<1<<5)+z>>0]|0)|0)+w|0;x=x+2|0}while((x|0)<(v|0));c[y>>2]=w}z=z+1|0}while((z|0)!=8);c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;z=0;do{x=l+(z<<2)|0;w=c[x>>2]|0;y=1;do{w=($(b[q+(y<<5<<1)>>1]|0,a[1664+(y<<2<<5)+z>>0]|0)|0)+w|0;y=y+2|0}while((y|0)<8);c[x>>2]=w;z=z+1|0}while((z|0)!=4);z=b[q>>1]<<6;y=b[q+256>>1]<<6;A=y+z|0;y=z-y|0;z=b[q+128>>1]|0;w=b[q+384>>1]|0;x=(w*36|0)+(z*83|0)|0;z=($(w,-83)|0)+(z*36|0)|0;w=x+A|0;c[m>>2]=w;c[n>>2]=z+y;c[o>>2]=y-z;c[p>>2]=A-x;x=0;while(1){A=c[l+(x<<2)>>2]|0;c[t+(x<<2)>>2]=A+w;c[t+(7-x<<2)>>2]=w-A;x=x+1|0;if((x|0)==4){w=0;break}w=c[m+(x<<2)>>2]|0}do{x=c[t+(w<<2)>>2]|0;y=c[u+(w<<2)>>2]|0;A=x+64+y|0;z=A>>7;if((z+32768|0)>>>0>65535)z=A>>31^32767;b[q+(w<<4<<1)>>1]=z;x=x-y+64|0;y=x>>7;if((y+32768|0)>>>0>65535)y=x>>31^32767;b[q+(15-w<<4<<1)>>1]=y;w=w+1|0}while((w|0)!=8);if((v|0)<16)v=(r&3|0)==0&(r|0)!=0?v+ -4|0:v;r=r+1|0;if((r|0)==16)break;else q=q+2|0}o=s?16:e;p=(o|0)>1;l=f+4|0;m=f+8|0;n=f+12|0;q=0;while(1){c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[h+16>>2]=0;c[h+20>>2]=0;c[h+24>>2]=0;c[h+28>>2]=0;r=0;do{if(p){e=h+(r<<2)|0;t=c[e>>2]|0;s=1;do{t=($(b[d+(s<<1)>>1]|0,a[1664+(s<<1<<5)+r>>0]|0)|0)+t|0;s=s+2|0}while((s|0)<(o|0));c[e>>2]=t}r=r+1|0}while((r|0)!=8);c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;t=0;do{r=k+(t<<2)|0;s=c[r>>2]|0;e=1;do{s=($(b[d+(e<<1<<1)>>1]|0,a[1664+(e<<2<<5)+t>>0]|0)|0)+s|0;e=e+2|0}while((e|0)<8);c[r>>2]=s;t=t+1|0}while((t|0)!=4);z=b[d>>1]<<6;y=b[d+16>>1]<<6;A=y+z|0;y=z-y|0;z=b[d+8>>1]|0;r=b[d+24>>1]|0;e=(r*36|0)+(z*83|0)|0;z=($(r,-83)|0)+(z*36|0)|0;r=e+A|0;c[f>>2]=r;c[l>>2]=z+y;c[m>>2]=y-z;c[n>>2]=A-e;e=0;while(1){A=c[k+(e<<2)>>2]|0;c[g+(e<<2)>>2]=A+r;c[g+(7-e<<2)>>2]=r-A;e=e+1|0;if((e|0)==4){r=0;break}r=c[f+(e<<2)>>2]|0}do{e=c[g+(r<<2)>>2]|0;s=c[h+(r<<2)>>2]|0;u=e+2048+s|0;t=u>>12;if((t+32768|0)>>>0>65535)t=u>>31^32767;b[d+(r<<1)>>1]=t;e=e-s+2048|0;s=e>>12;if((s+32768|0)>>>0>65535)s=e>>31^32767;b[d+(15-r<<1)>>1]=s;r=r+1|0}while((r|0)!=8);q=q+1|0;if((q|0)==16)break;else d=d+32|0}i=j;return}function pc(d,e){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;m=i;i=i+320|0;g=m+256|0;l=m+192|0;o=m+160|0;s=m+128|0;u=m+112|0;t=m+96|0;f=m+64|0;j=m+32|0;h=m+16|0;k=m;q=(e|0)>32;x=e+4|0;v=u+4|0;w=u+8|0;n=u+12|0;p=0;x=(x|0)>32?32:x;r=d;while(1){y=l+0|0;z=y+64|0;do{c[y>>2]=0;y=y+4|0}while((y|0)<(z|0));B=(x|0)>1;A=0;do{if(B){z=l+(A<<2)|0;y=c[z>>2]|0;C=1;do{y=($(b[r+(C<<5<<1)>>1]|0,a[1664+(C<<5)+A>>0]|0)|0)+y|0;C=C+2|0}while((C|0)<(x|0));c[z>>2]=y}A=A+1|0}while((A|0)!=16);c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;c[s+12>>2]=0;c[s+16>>2]=0;c[s+20>>2]=0;c[s+24>>2]=0;c[s+28>>2]=0;y=(x|0)/2|0;z=(x|0)>3;A=0;do{if(z){D=s+(A<<2)|0;B=c[D>>2]|0;C=1;do{B=($(b[r+(C<<6<<1)>>1]|0,a[1664+(C<<1<<5)+A>>0]|0)|0)+B|0;C=C+2|0}while((C|0)<(y|0));c[D>>2]=B}A=A+1|0}while((A|0)!=8);c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;A=0;do{B=t+(A<<2)|0;z=c[B>>2]|0;y=1;do{z=($(b[r+(y<<7<<1)>>1]|0,a[1664+(y<<2<<5)+A>>0]|0)|0)+z|0;y=y+2|0}while((y|0)<8);c[B>>2]=z;A=A+1|0}while((A|0)!=4);C=b[r>>1]<<6;B=b[r+1024>>1]<<6;D=B+C|0;B=C-B|0;C=b[r+512>>1]|0;y=b[r+1536>>1]|0;z=(y*36|0)+(C*83|0)|0;C=($(y,-83)|0)+(C*36|0)|0;y=z+D|0;c[u>>2]=y;c[v>>2]=C+B;c[w>>2]=B-C;c[n>>2]=D-z;z=0;while(1){D=c[t+(z<<2)>>2]|0;c[o+(z<<2)>>2]=D+y;c[o+(7-z<<2)>>2]=y-D;z=z+1|0;if((z|0)==4){y=0;break}y=c[u+(z<<2)>>2]|0}do{C=c[o+(y<<2)>>2]|0;D=c[s+(y<<2)>>2]|0;c[g+(y<<2)>>2]=D+C;c[g+(15-y<<2)>>2]=C-D;y=y+1|0}while((y|0)!=8);y=0;do{z=c[g+(y<<2)>>2]|0;A=c[l+(y<<2)>>2]|0;B=z+64+A|0;C=B>>7;if((C+32768|0)>>>0>65535)C=B>>31^32767;b[r+(y<<5<<1)>>1]=C;z=z-A+64|0;A=z>>7;if((A+32768|0)>>>0>65535)A=z>>31^32767;b[r+(31-y<<5<<1)>>1]=A;y=y+1|0}while((y|0)!=16);if((x|0)<32)x=(p&3|0)==0&(p|0)!=0?x+ -4|0:x;p=p+1|0;if((p|0)==32)break;else r=r+2|0}p=q?32:e;o=(p|0)>1;n=(p|0)/2|0;q=(p|0)>3;s=h+4|0;r=h+8|0;e=h+12|0;t=0;while(1){y=l+0|0;z=y+64|0;do{c[y>>2]=0;y=y+4|0}while((y|0)<(z|0));v=0;do{if(o){w=l+(v<<2)|0;u=c[w>>2]|0;x=1;do{u=($(b[d+(x<<1)>>1]|0,a[1664+(x<<5)+v>>0]|0)|0)+u|0;x=x+2|0}while((x|0)<(p|0));c[w>>2]=u}v=v+1|0}while((v|0)!=16);c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[j+16>>2]=0;c[j+20>>2]=0;c[j+24>>2]=0;c[j+28>>2]=0;x=0;do{if(q){u=j+(x<<2)|0;w=c[u>>2]|0;v=1;do{D=v<<1;w=($(b[d+(D<<1)>>1]|0,a[1664+(D<<5)+x>>0]|0)|0)+w|0;v=v+2|0}while((v|0)<(n|0));c[u>>2]=w}x=x+1|0}while((x|0)!=8);c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;u=0;do{v=k+(u<<2)|0;x=c[v>>2]|0;w=1;do{D=w<<2;x=($(b[d+(D<<1)>>1]|0,a[1664+(D<<5)+u>>0]|0)|0)+x|0;w=w+2|0}while((w|0)<8);c[v>>2]=x;u=u+1|0}while((u|0)!=4);C=b[d>>1]<<6;B=b[d+32>>1]<<6;D=B+C|0;B=C-B|0;C=b[d+16>>1]|0;u=b[d+48>>1]|0;v=(u*36|0)+(C*83|0)|0;C=($(u,-83)|0)+(C*36|0)|0;u=v+D|0;c[h>>2]=u;c[s>>2]=C+B;c[r>>2]=B-C;c[e>>2]=D-v;v=0;while(1){D=c[k+(v<<2)>>2]|0;c[f+(v<<2)>>2]=D+u;c[f+(7-v<<2)>>2]=u-D;v=v+1|0;if((v|0)==4){u=0;break}u=c[h+(v<<2)>>2]|0}do{C=c[f+(u<<2)>>2]|0;D=c[j+(u<<2)>>2]|0;c[g+(u<<2)>>2]=D+C;c[g+(15-u<<2)>>2]=C-D;u=u+1|0}while((u|0)!=8);u=0;do{v=c[g+(u<<2)>>2]|0;w=c[l+(u<<2)>>2]|0;x=v+2048+w|0;y=x>>12;if((y+32768|0)>>>0>65535)y=x>>31^32767;b[d+(u<<1)>>1]=y;v=v-w+2048|0;w=v>>12;if((w+32768|0)>>>0>65535)w=v>>31^32767;b[d+(31-u<<1)>>1]=w;u=u+1|0}while((u|0)!=16);t=t+1|0;if((t|0)==32)break;else d=d+64|0}i=m;return}function qc(a){a=a|0;var c=0,d=0,e=0,f=0;c=i;d=((((b[a>>1]|0)+1|0)>>>1)+32|0)>>>6&65535;e=0;do{f=e<<2;b[a+(f<<1)>>1]=d;b[a+((f|1)<<1)>>1]=d;b[a+((f|2)<<1)>>1]=d;b[a+((f|3)<<1)>>1]=d;e=e+1|0}while((e|0)!=4);i=c;return}function rc(a){a=a|0;var c=0,d=0,e=0,f=0;c=i;d=((((b[a>>1]|0)+1|0)>>>1)+32|0)>>>6&65535;e=0;do{f=e<<3;b[a+(f<<1)>>1]=d;b[a+((f|1)<<1)>>1]=d;b[a+((f|2)<<1)>>1]=d;b[a+((f|3)<<1)>>1]=d;b[a+((f|4)<<1)>>1]=d;b[a+((f|5)<<1)>>1]=d;b[a+((f|6)<<1)>>1]=d;b[a+((f|7)<<1)>>1]=d;e=e+1|0}while((e|0)!=8);i=c;return}function sc(a){a=a|0;var c=0,d=0,e=0,f=0,g=0;c=i;e=((((b[a>>1]|0)+1|0)>>>1)+32|0)>>>6&65535;d=0;do{f=d<<4;g=0;do{b[a+(g+f<<1)>>1]=e;g=g+1|0}while((g|0)!=16);d=d+1|0}while((d|0)!=16);i=c;return}function tc(a){a=a|0;var c=0,d=0,e=0,f=0,g=0;c=i;e=((((b[a>>1]|0)+1|0)>>>1)+32|0)>>>6&65535;d=0;do{f=d<<5;g=0;do{b[a+(g+f<<1)>>1]=e;g=g+1|0}while((g|0)!=32);d=d+1|0}while((d|0)!=32);i=c;return}function uc(e,f,g,h,j,k,l,m,n){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0,q=0;o=i;i=i+128|0;k=o;q=k+0|0;p=q+128|0;do{c[q>>2]=0;q=q+4|0}while((q|0)<(p|0));q=d[j+n+96>>0]|0;c[k+((q&31)<<2)>>2]=b[j+(n*10|0)+114>>1];c[k+((q+1&31)<<2)>>2]=b[j+(n*10|0)+116>>1];c[k+((q+2&31)<<2)>>2]=b[j+(n*10|0)+118>>1];c[k+((q+3&31)<<2)>>2]=b[j+(n*10|0)+120>>1];if((m|0)<=0){i=o;return}n=(l|0)>0;j=0;while(1){if(n){p=0;do{q=d[f+p>>0]|0;q=q+(c[k+(q>>>3<<2)>>2]|0)|0;if(q>>>0>255)q=0-q>>31;a[e+p>>0]=q;p=p+1|0}while((p|0)!=(l|0))}j=j+1|0;if((j|0)==(m|0))break;else{e=e+g|0;f=f+h|0}}i=o;return}function vc(e,f,g,h,j,k,l,m,n,o,p,q){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;var r=0,s=0,t=0,u=0;p=i;o=j+(n*10|0)+112|0;r=c[j+(n<<2)+100>>2]|0;if((r|0)!=1){if(c[k>>2]|0){q=b[o>>1]|0;if((m|0)>0){s=0;do{t=(d[f+($(s,h)|0)>>0]|0)+q|0;if(t>>>0>255)t=0-t>>31;a[e+($(s,g)|0)>>0]=t;s=s+1|0}while((s|0)!=(m|0));q=1}else q=1}else q=0;if(c[k+8>>2]|0){s=b[o>>1]|0;l=l+ -1|0;if((m|0)>0){t=0;do{u=(d[f+(($(t,h)|0)+l)>>0]|0)+s|0;if(u>>>0>255)u=0-u>>31;a[e+(($(t,g)|0)+l)>>0]=u;t=t+1|0}while((t|0)!=(m|0))}}if(!r){s=m;t=q;u=0;r=l;Dc(e,f,g,h,j,r,s,n,t,u);i=p;return}}else q=0;if(c[k+4>>2]|0){r=b[o>>1]|0;if((q|0)<(l|0)){s=q;do{t=(d[f+s>>0]|0)+r|0;if(t>>>0>255)t=0-t>>31;a[e+s>>0]=t;s=s+1|0}while((s|0)!=(l|0));r=1}else r=1}else r=0;if(!(c[k+12>>2]|0)){s=m;t=q;u=r;r=l;Dc(e,f,g,h,j,r,s,n,t,u);i=p;return}k=b[o>>1]|0;o=m+ -1|0;t=$(o,g)|0;m=$(o,h)|0;if((q|0)<(l|0))s=q;else{s=o;t=q;u=r;r=l;Dc(e,f,g,h,j,r,s,n,t,u);i=p;return}do{u=(d[f+(s+m)>>0]|0)+k|0;if(u>>>0>255)u=0-u>>31;a[e+(s+t)>>0]=u;s=s+1|0}while((s|0)!=(l|0));Dc(e,f,g,h,j,l,o,n,q,r);i=p;return}function wc(e,f,g,h,j,k,l,m,n,o,p,q){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;var 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;s=i;C=j+(n*10|0)+112|0;B=c[j+(n<<2)+100>>2]|0;A=(B|0)!=1;if(A){if(c[k>>2]|0){D=b[C>>1]|0;if((m|0)>0){E=0;do{G=(d[f+($(E,h)|0)>>0]|0)+D|0;if(G>>>0>255)G=0-G>>31;a[e+($(E,g)|0)>>0]=G;E=E+1|0}while((E|0)!=(m|0));D=1}else D=1}else D=0;if(c[k+8>>2]|0){E=b[C>>1]|0;l=l+ -1|0;if((m|0)>0){G=0;do{H=(d[f+(($(G,h)|0)+l)>>0]|0)+E|0;if(H>>>0>255)H=0-H>>31;a[e+(($(G,g)|0)+l)>>0]=H;G=G+1|0}while((G|0)!=(m|0))}}if(!B){C=1;E=0}else F=13}else{D=0;F=13}if((F|0)==13){if(c[k+4>>2]|0){F=b[C>>1]|0;if((D|0)<(l|0)){E=D;do{G=(d[f+E>>0]|0)+F|0;if(G>>>0>255)G=0-G>>31;a[e+E>>0]=G;E=E+1|0}while((E|0)!=(l|0));E=1}else E=1}else E=0;if(c[k+12>>2]|0){C=b[C>>1]|0;m=m+ -1|0;G=$(m,g)|0;H=$(m,h)|0;if((D|0)<(l|0)){F=D;do{I=(d[f+(F+H)>>0]|0)+C|0;if(I>>>0>255)I=0-I>>31;a[e+(F+G)>>0]=I;F=F+1|0}while((F|0)!=(l|0));C=0}else C=0}else C=0}Dc(e,f,g,h,j,l,m,n,D,E);j=(B|0)==2;if((a[q>>0]|0)==0&j?(c[k>>2]|0)==0:0)n=(c[k+4>>2]|0)==0;else n=0;H=n&1;n=q+1|0;B=(B|0)==3;if((a[n>>0]|0)==0&B?(c[k+4>>2]|0)==0:0)F=(c[k+8>>2]|0)==0;else F=0;J=F&1;F=q+2|0;if((a[F>>0]|0)==0&j?(c[k+8>>2]|0)==0:0)G=(c[k+12>>2]|0)==0;else G=0;I=G&1;G=q+3|0;if((a[G>>0]|0)==0&B?(c[k>>2]|0)==0:0)k=(c[k+12>>2]|0)==0;else k=0;k=k&1;A=A^1;if(!((a[o>>0]|0)==0|A)?(z=H+E|0,y=m-k|0,(z|0)<(y|0)):0)do{a[e+($(z,g)|0)>>0]=a[f+($(z,h)|0)>>0]|0;z=z+1|0}while((z|0)!=(y|0));if(!((a[o+1>>0]|0)==0|A)?(x=J+E|0,w=m-I|0,(x|0)<(w|0)):0){o=l+ -1|0;do{a[e+(o+($(x,g)|0))>>0]=a[f+(o+($(x,h)|0))>>0]|0;x=x+1|0}while((x|0)!=(w|0))}if(!((a[p>>0]|0)==0|C)?(v=H+D|0,u=l-J|0,(v|0)<(u|0)):0)do{a[e+v>>0]=a[f+v>>0]|0;v=v+1|0}while((v|0)!=(u|0));if(!((a[p+1>>0]|0)==0|C)?(t=k+D|0,r=l-I|0,(t|0)<(r|0)):0){u=m+ -1|0;p=$(u,h)|0;u=$(u,g)|0;do{a[e+(t+u)>>0]=a[f+(t+p)>>0]|0;t=t+1|0}while((t|0)!=(r|0))}if((a[q>>0]|0)!=0&j)a[e>>0]=a[f>>0]|0;if((a[n>>0]|0)!=0&B){J=l+ -1|0;a[e+J>>0]=a[f+J>>0]|0}if((a[F>>0]|0)!=0&j){J=m+ -1|0;I=l+ -1|0;a[e+(I+($(J,g)|0))>>0]=a[f+(I+($(J,h)|0))>>0]|0}if(!((a[G>>0]|0)!=0&B)){i=s;return}J=m+ -1|0;a[e+($(J,g)|0)>>0]=a[f+($(J,h)|0)>>0]|0;i=s;return}function xc(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;g=i;Cc(a,b,1,c,d,e,f);i=g;return}function yc(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;g=i;Cc(a,1,b,c,d,e,f);i=g;return}function zc(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0;f=i;Bc(a,b,1,c,d,e);i=f;return}function Ac(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0;f=i;Bc(a,1,b,c,d,e);i=f;return}function Bc(b,e,f,g,h,j){b=b|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;m=i;l=$(e,-2)|0;k=0-e|0;n=0;while(1){p=c[g+(n<<2)>>2]|0;if((p|0)>=1){s=0-p|0;r=(a[h+n>>0]|0)==0;q=(a[j+n>>0]|0)==0;o=0;t=b;while(1){v=t+k|0;x=d[v>>0]|0;u=d[t>>0]|0;w=(d[t+l>>0]|0)+4-(d[t+e>>0]|0)+(u-x<<2)>>3;if((w|0)<(s|0))w=s;else w=(w|0)>(p|0)?p:w;if(r){x=w+x|0;if(x>>>0>255)x=0-x>>31;a[v>>0]=x}if(q){u=u-w|0;if(u>>>0>255)u=0-u>>31;a[t>>0]=u}o=o+1|0;if((o|0)==4)break;else t=t+f|0}}n=n+1|0;if((n|0)==2)break;else b=b+(f<<2)|0}i=m;return}function Cc(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,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,aa=0,ba=0;t=i;o=$(e,-3)|0;p=$(e,-2)|0;q=0-e|0;r=e<<1;D=f*3|0;B=D+o|0;C=D+p|0;A=D-e|0;E=D+r|0;l=D+e|0;y=g>>3;v=g>>2;n=$(e,-4)|0;s=e*3|0;w=D+n|0;x=(f+e|0)*3|0;u=(g>>1)+g>>3;z=f<<2;m=f<<2;F=0;do{U=a[b+o>>0]|0;T=a[b+p>>0]|0;S=a[b+q>>0]|0;J=S&255;N=(U&255)-((T&255)<<1)+J|0;N=(N|0)>-1?N:0-N|0;P=a[b+r>>0]|0;Q=a[b+e>>0]|0;R=a[b>>0]|0;X=R&255;V=(P&255)-((Q&255)<<1)+X|0;V=(V|0)>-1?V:0-V|0;_=d[b+A>>0]|0;M=(d[b+B>>0]|0)-((d[b+C>>0]|0)<<1)+_|0;M=(M|0)>-1?M:0-M|0;Y=d[b+D>>0]|0;O=(d[b+E>>0]|0)-((d[b+l>>0]|0)<<1)+Y|0;O=(O|0)>-1?O:0-O|0;H=V+N|0;I=O+M|0;G=c[h+(F<<2)>>2]|0;W=a[j+F>>0]|0;L=a[k+F>>0]|0;do if((I+H|0)<(g|0)){Z=(G*5|0)+1>>1;aa=(d[b+n>>0]|0)-J|0;K=a[b+s>>0]|0;ba=(K&255)-X|0;if((((((((ba|0)>-1?ba:0-ba|0)+((aa|0)>-1?aa:0-aa|0)|0)<(y|0)?(ba=J-X|0,(((ba|0)>-1?ba:0-ba|0)|0)<(Z|0)):0)?(ba=(d[b+w>>0]|0)-_|0,aa=(d[b+x>>0]|0)-Y|0,(((aa|0)>-1?aa:0-aa|0)+((ba|0)>-1?ba:0-ba|0)|0)<(y|0)):0)?(ba=_-Y|0,(((ba|0)>-1?ba:0-ba|0)|0)<(Z|0)):0)?(H<<1|0)<(v|0):0)?(I<<1|0)<(v|0):0){G=G<<1;H=W<<24>>24==0;I=0-G|0;J=L<<24>>24==0;Y=K;K=1;L=b;while(1){V=L+o|0;U=U&255;W=L+p|0;T=T&255;X=L+q|0;N=S&255;R=R&255;S=L+e|0;Q=Q&255;M=L+r|0;O=P&255;P=Y&255;if(H){Y=d[L+n>>0]|0;Z=(U+4+Q+(N+T+R<<1)>>3)-N|0;if((Z|0)<(I|0))Z=I;else Z=(Z|0)>(G|0)?G:Z;a[X>>0]=Z+N;X=((U+2+T+N+R|0)>>>2)-T|0;if((X|0)<(I|0))X=I;else X=(X|0)>(G|0)?G:X;a[W>>0]=X+T;W=((U*3|0)+4+T+N+R+(Y<<1)>>3)-U|0;if((W|0)<(I|0))W=I;else W=(W|0)>(G|0)?G:W;a[V>>0]=W+U}if(J){T=(T+4+O+(R+N+Q<<1)>>3)-R|0;if((T|0)<(I|0))T=I;else T=(T|0)>(G|0)?G:T;a[L>>0]=T+R;T=((N+2+R+Q+O|0)>>>2)-Q|0;if((T|0)<(I|0))T=I;else T=(T|0)>(G|0)?G:T;a[S>>0]=T+Q;N=(N+4+R+Q+(O*3|0)+(P<<1)>>3)-O|0;if((N|0)<(I|0))N=I;else N=(N|0)>(G|0)?G:N;a[M>>0]=N+O}M=L+f|0;if((K|0)==4)break;U=a[L+(o+f)>>0]|0;T=a[L+(p+f)>>0]|0;S=a[L+(f-e)>>0]|0;R=a[M>>0]|0;Q=a[L+(f+e)>>0]|0;P=a[L+(r+f)>>0]|0;Y=a[L+(s+f)>>0]|0;K=K+1|0;L=M}b=b+m|0;break}H=G>>1;I=G*10|0;J=0-G|0;K=W<<24>>24!=0;L=L<<24>>24!=0;M=(M+N|0)<(u|0)&(K^1);N=0-H|0;O=(O+V|0)<(u|0)&(L^1);V=T;W=R;Y=Q;Q=1;R=b;while(1){X=U&255;T=R+p|0;V=V&255;_=R+q|0;Z=S&255;W=W&255;S=R+e|0;U=Y&255;P=P&255;Y=((W-Z|0)*9|0)+8+($(U-V|0,-3)|0)>>4;if((((Y|0)>-1?Y:0-Y|0)|0)<(I|0)){if((Y|0)<(J|0))Y=J;else Y=(Y|0)>(G|0)?G:Y;if(!K){aa=Y+Z|0;if(aa>>>0>255)aa=0-aa>>31;a[_>>0]=aa}if(!L){_=W-Y|0;if(_>>>0>255)_=0-_>>31;a[R>>0]=_}if(M){X=((X+1+Z|0)>>>1)-V+Y>>1;if((X|0)<(N|0))X=N;else X=(X|0)>(H|0)?H:X;V=X+V|0;if(V>>>0>255)V=0-V>>31;a[T>>0]=V}if(O){P=((W+1+P|0)>>>1)-U-Y>>1;if((P|0)<(N|0))P=N;else P=(P|0)>(H|0)?H:P;P=P+U|0;if(P>>>0>255)P=0-P>>31;a[S>>0]=P}}T=R+f|0;if((Q|0)==4)break;U=a[R+(o+f)>>0]|0;V=a[R+(p+f)>>0]|0;S=a[R+(f-e)>>0]|0;W=a[T>>0]|0;Y=a[R+(f+e)>>0]|0;P=a[R+(r+f)>>0]|0;Q=Q+1|0;R=T}b=b+m|0}else b=b+z|0;while(0);F=F+1|0}while((F|0)!=2);i=t;return}function Dc(e,f,g,h,j,k,l,m,n,o){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var 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;t=i;v=c[j+(m<<2)+100>>2]|0;q=a[2728+(v<<2)>>0]|0;r=a[2730+(v<<2)>>0]|0;if((o|0)>=(l|0)){i=t;return}u=(n|0)<(k|0);s=o;p=$((a[2729+(v<<2)>>0]|0)+o|0,h)|0;v=$((a[2731+(v<<2)>>0]|0)+o|0,h)|0;w=$(o,g)|0;o=$(o,h)|0;while(1){if(u){y=p+q|0;x=v+r|0;z=n;do{A=a[f+(z+o)>>0]|0;B=a[f+(y+z)>>0]|0;if((A&255)>(B&255))B=3;else B=((A<<24>>24!=B<<24>>24)<<31>>31)+2|0;C=a[f+(x+z)>>0]|0;if((A&255)>(C&255))C=1;else C=(A<<24>>24!=C<<24>>24)<<31>>31;A=(b[j+(m*10|0)+(d[2720+(C+B)>>0]<<1)+112>>1]|0)+(A&255)|0;if(A>>>0>255)A=0-A>>31;a[e+(z+w)>>0]=A;z=z+1|0}while((z|0)!=(k|0))}s=s+1|0;if((s|0)==(l|0))break;else{p=p+h|0;v=v+h|0;w=w+g|0;o=o+h|0}}i=t;return}function Ec(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;j=i;k=c[b+136>>2]|0;l=(c[b+200>>2]|0)+13080|0;r=(1<>2])+ -1|0;o=r&e;n=r&f;q=(n|0)!=0|(a[k+309>>0]|0)!=0;m=q&1;c[k+31296>>2]=m;p=(o|0)!=0|(a[k+308>>0]|0)!=0;b=p&1;c[k+31292>>2]=b;if(!(r&(f|e)))p=d[k+311>>0]|0;else p=p&q&1;c[k+31300>>2]=p;if((o+g|0)==(1<>2]|0))m=(a[k+310>>0]|0)!=0&(n|0)==0&1;c[k+31308>>2]=m;if(!m){q=0;q=q&1;r=k+31304|0;c[r>>2]=q;r=h+f|0;q=k+316|0;q=c[q>>2]|0;q=(r|0)<(q|0);q=q?b:0;r=k+31288|0;c[r>>2]=q;i=j;return}q=(g+e|0)<(c[k+312>>2]|0);q=q&1;r=k+31304|0;c[r>>2]=q;r=h+f|0;q=k+316|0;q=c[q>>2]|0;q=(r|0)<(q|0);q=q?b:0;r=k+31288|0;c[r>>2]=q;i=j;return}function Fc(b){b=b|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;f=i;i=i+16|0;e=f;h=c[b+136>>2]|0;g=h+204|0;j=ud(13196)|0;c[e>>2]=j;if(!j){t=-12;i=f;return t|0}j=c[j+4>>2]|0;l=ud(468)|0;if(!l){t=-12;i=f;return t|0}k=c[l+4>>2]|0;c[k+4>>2]=1;n=k+8|0;c[n>>2]=1;a[k>>0]=0;c[k+348>>2]=1;p=k+352|0;m=k+380|0;q=k+408|0;o=0;do{c[p+(o<<2)>>2]=1;c[m+(o<<2)>>2]=0;c[q+(o<<2)>>2]=-1;o=o+1|0}while((o|0)<(c[n>>2]|0));c[k+436>>2]=0;c[k+440>>2]=1;a[k+444>>0]=0;o=b+208|0;wd(o);c[o>>2]=l;c[j>>2]=0;o=j+72|0;c[o>>2]=1;t=ad(g,8)|0;p=j+4|0;c[p>>2]=t;do if((t|0)<=3){a[j+8>>0]=0;n=j+13120|0;c[n>>2]=ed(g,32)|0;k=ed(g,32)|0;m=j+13124|0;c[m>>2]=k;k=Sc(c[n>>2]|0,k,0,c[b+4>>2]|0)|0;if((k|0)>=0){t=ad(g,8)|0;l=j+52|0;c[l>>2]=t+8;if(!t){p=c[p>>2]|0;if((p|0)==1){c[j+60>>2]=0;p=0}else if((p|0)==2){c[j+60>>2]=4;p=4}else if(!p){c[j+60>>2]=8;p=8}else{c[j+60>>2]=5;p=5}c[j+56>>2]=0;p=Cd(p)|0;if(p){c[j+13180>>2]=0;c[j+13168>>2]=0;t=d[p+5>>0]|0;c[j+13172>>2]=t;c[j+13176>>2]=t;t=d[p+6>>0]|0;c[j+13184>>2]=t;c[j+13188>>2]=t;c[j+64>>2]=8;if((c[o>>2]|0)>0){p=j+76|0;q=0;do{c[p+(q*12|0)>>2]=1;c[p+(q*12|0)+4>>2]=0;c[p+(q*12|0)+8>>2]=-1;q=q+1|0}while((q|0)<(c[o>>2]|0))}s=(fd(g)|0)+3|0;t=j+13064|0;c[t>>2]=s;s=1<>2]=r+(c[n>>2]|0)&s;c[m>>2]=r+(c[m>>2]|0)&s;s=j+13068|0;c[s>>2]=fd(g)|0;r=j+13072|0;c[r>>2]=(fd(g)|0)+2;o=fd(g)|0;p=c[r>>2]|0;q=j+13076|0;c[q>>2]=p+o;if(p>>>0<(c[t>>2]|0)>>>0){p=j+13088|0;c[p>>2]=0;o=j+13092|0;c[o>>2]=fd(g)|0;a[j+12941>>0]=dd(g)|0;u=dd(g)|0;c[j+68>>2]=u;if(u){u=j+13044|0;a[u>>0]=(ad(g,4)|0)+1;a[j+13045>>0]=(ad(g,4)|0)+1;v=(fd(g)|0)+3|0;c[j+13048>>2]=v;c[j+13052>>2]=v+(fd(g)|0);if((d[u>>0]|0|0)>(c[l>>2]|0)){k=-1094995529;break}a[j+13056>>0]=dd(g)|0}c[j+2184>>2]=0;a[j+12942>>0]=0;a[j+13060>>0]=0;a[j+13061>>0]=dd(g)|0;c[j+160>>2]=0;c[j+164>>2]=1;if((dd(g)|0)!=0?(v=dd(g)|0,cd(g,7),(v|0)!=0):0){c[j+13096>>2]=dd(g)|0;c[j+13100>>2]=dd(g)|0;c[j+13104>>2]=dd(g)|0;c[j+13108>>2]=dd(g)|0;dd(g)|0;c[j+13112>>2]=dd(g)|0;dd(g)|0;c[j+13116>>2]=dd(g)|0;dd(g)|0}g=c[n>>2]|0;c[j+12>>2]=g;n=c[m>>2]|0;c[j+16>>2]=n;t=c[t>>2]|0;v=(c[s>>2]|0)+t|0;c[j+13080>>2]=v;s=t+ -1|0;c[j+13084>>2]=s;m=1<>v;c[j+13128>>2]=u;m=n+ -1+m>>v;c[j+13132>>2]=m;c[j+13136>>2]=$(m,u)|0;c[j+13140>>2]=g>>t;c[j+13144>>2]=n>>t;u=c[r>>2]|0;c[j+13148>>2]=g>>u;c[j+13152>>2]=n>>u;c[j+13156>>2]=g>>s;c[j+13160>>2]=n>>s;u=v-u|0;c[j+13164>>2]=(1<>2]=((c[l>>2]|0)*6|0)+ -48;t=(1<>>0>6):0)?(c[p>>2]|0)>>>0<=u>>>0:0)?(c[o>>2]|0)>>>0<=u>>>0:0)?(c[q>>2]|0)>>>0<=(v>>>0>5?5:v)>>>0:0)?((c[h+216>>2]|0)-(c[h+212>>2]|0)|0)>=0:0){g=b+272|0;h=c[g>>2]|0;if((h|0)!=0?(v=c[e>>2]|0,(Vd(c[h+4>>2]|0,c[v+4>>2]|0,c[v+8>>2]|0)|0)==0):0){wd(e);v=0;i=f;return v|0}else h=0;do{j=b+(h<<2)+400|0;k=c[j>>2]|0;do if(k){if(c[c[k+4>>2]>>2]|0)break;wd(j)}while(0);h=h+1|0}while((h|0)!=256);h=c[g>>2]|0;do if(h){j=b+200|0;if((c[j>>2]|0)!=(c[h+4>>2]|0))break;u=b+1424|0;wd(u);v=vd(c[g>>2]|0)|0;c[u>>2]=v;if(v)break;c[j>>2]=0}while(0);wd(g);c[g>>2]=c[e>>2];v=0;i=f;return v|0}}else k=-1094995529}else k=-22}else k=-1094995529}}else k=-1094995529;while(0);wd(e);v=k;i=f;return v|0}function Gc(b){b=b|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,E=0,F=0,G=0,H=0,I=0;f=i;i=i+16|0;e=f+4|0;j=f;l=b+136|0;g=c[l>>2]|0;n=g+204|0;h=nd(1692)|0;c[j>>2]=h;if(!h){I=-12;i=f;return I|0}I=rd(h,1692,6,0,0)|0;c[e>>2]=I;if(!I){kd(j);I=-12;i=f;return I|0}a[(c[j>>2]|0)+53>>0]=1;h=c[j>>2]|0;c[h+44>>2]=1;c[h+48>>2]=1;a[h+52>>0]=1;a[(c[j>>2]|0)+57>>0]=0;h=c[j>>2]|0;c[h+60>>2]=0;c[h+64>>2]=0;a[h+1629>>0]=2;h=fd(n)|0;a:do if((h>>>0<=255?(k=fd(n)|0,c[c[j>>2]>>2]=k,k>>>0<=31):0)?(m=c[b+(k<<2)+272>>2]|0,(m|0)!=0):0){k=c[m+4>>2]|0;I=(dd(n)|0)&255;a[(c[j>>2]|0)+41>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+39>>0]=I;I=ad(n,3)|0;c[(c[j>>2]|0)+1624>>2]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+4>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+5>>0]=I;I=(fd(n)|0)+1|0;c[(c[j>>2]|0)+8>>2]=I;I=(fd(n)|0)+1|0;c[(c[j>>2]|0)+12>>2]=I;I=gd(n)|0;c[(c[j>>2]|0)+16>>2]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+20>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+21>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+22>>0]=I;I=c[j>>2]|0;c[I+24>>2]=0;if(a[I+22>>0]|0){I=fd(n)|0;c[(c[j>>2]|0)+24>>2]=I}I=gd(n)|0;c[(c[j>>2]|0)+28>>2]=I;if((I+12|0)>>>0<=24?(I=gd(n)|0,c[(c[j>>2]|0)+32>>2]=I,(I+12|0)>>>0<=24):0){I=(dd(n)|0)&255;a[(c[j>>2]|0)+36>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+37>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+38>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+40>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+42>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+43>>0]=I;if(a[(c[j>>2]|0)+42>>0]|0){m=(fd(n)|0)+1|0;c[(c[j>>2]|0)+44>>2]=m;m=(fd(n)|0)+1|0;o=c[j>>2]|0;c[o+48>>2]=m;o=c[o+44>>2]|0;if(!o){b=-1094995529;break}if((m|0)==0?1:(o|0)>=(c[k+13120>>2]|0)){b=-1094995529;break}if((m|0)>=(c[k+13124>>2]|0)){b=-1094995529;break}m=pd(o,4)|0;c[(c[j>>2]|0)+1648>>2]=m;m=pd(c[(c[j>>2]|0)+48>>2]|0,4)|0;c[(c[j>>2]|0)+1652>>2]=m;m=c[j>>2]|0;if(!(c[m+1648>>2]|0)){b=-12;break}if(!(c[m+1652>>2]|0)){b=-12;break}p=(dd(n)|0)&255;a[(c[j>>2]|0)+52>>0]=p;p=c[j>>2]|0;if(!(a[p+52>>0]|0)){q=(c[p+44>>2]|0)+ -1|0;if((q|0)>0){o=0;m=0;r=0;do{q=(fd(n)|0)+1|0;p=c[j>>2]|0;c[(c[p+1648>>2]|0)+(r<<2)>>2]=q;o=_d(q|0,0,o|0,m|0)|0;m=D;r=r+1|0;q=(c[p+44>>2]|0)+ -1|0}while((r|0)<(q|0))}else{m=0;o=0}r=c[k+13128>>2]|0;s=((r|0)<0)<<31>>31;if(!(m>>>0>>0|(m|0)==(s|0)&o>>>0>>0)){b=-1094995529;break}I=Zd(r|0,s|0,o|0,m|0)|0;c[(c[p+1648>>2]|0)+(q<<2)>>2]=I;q=(c[p+48>>2]|0)+ -1|0;if((q|0)>0){p=0;o=0;r=0;do{q=(fd(n)|0)+1|0;m=c[j>>2]|0;c[(c[m+1652>>2]|0)+(r<<2)>>2]=q;p=_d(q|0,0,p|0,o|0)|0;o=D;r=r+1|0;q=(c[m+48>>2]|0)+ -1|0}while((r|0)<(q|0))}else{m=p;o=0;p=0}r=c[k+13132>>2]|0;s=((r|0)<0)<<31>>31;if(!(o>>>0>>0|(o|0)==(s|0)&p>>>0>>0)){b=-1094995529;break}I=Zd(r|0,s|0,p|0,o|0)|0;c[(c[m+1652>>2]|0)+(q<<2)>>2]=I}I=(dd(n)|0)&255;a[(c[j>>2]|0)+53>>0]=I}I=(dd(n)|0)&255;a[(c[j>>2]|0)+54>>0]=I;I=(dd(n)|0)&255;a[(c[j>>2]|0)+55>>0]=I;if((a[(c[j>>2]|0)+55>>0]|0)!=0?(I=(dd(n)|0)&255,a[(c[j>>2]|0)+56>>0]=I,I=(dd(n)|0)&255,a[(c[j>>2]|0)+57>>0]=I,(a[(c[j>>2]|0)+57>>0]|0)==0):0){m=(gd(n)|0)<<1;c[(c[j>>2]|0)+60>>2]=m;m=(gd(n)|0)<<1;I=c[j>>2]|0;c[I+64>>2]=m;if(((c[I+60>>2]|0)+13|0)>>>0>26){b=-1094995529;break}if((m+13|0)>>>0>26){b=-1094995529;break}}p=(dd(n)|0)&255;a[(c[j>>2]|0)+68>>0]=p;p=c[j>>2]|0;if(a[p+68>>0]|0){q=0;do{o=p+(q<<6)+69|0;m=o+16|0;do{a[o>>0]=16;o=o+1|0}while((o|0)<(m|0));a[p+q+1605>>0]=16;a[p+q+1611>>0]=16;q=q+1|0}while((q|0)!=6);o=p+453|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+517|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+581|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+645|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+709|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+773|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+837|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+901|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+965|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1029|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1093|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1157|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1221|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1285|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1349|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1413|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1477|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1541|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));m=c[j>>2]|0;v=(c[l>>2]|0)+204|0;w=0;do{p=(w|0)>0?64:16;q=(w|0)>1;o=w+ -2|0;x=(w|0)==3?3:1;r=1<<(w<<1)+4;t=(r|0)>0;s=(w|0)==0;r=(r|0)<64?r:64;u=0;do{if(!(((dd(v)|0)&255)<<24>>24)){y=fd(v)|0;if(y){if(u>>>0>>0){b=-1094995529;break a}y=u-y|0;ce(m+(w*384|0)+(u<<6)+69|0,m+(w*384|0)+(y<<6)+69|0,p|0)|0;if(q)a[m+(o*6|0)+u+1605>>0]=a[m+(o*6|0)+y+1605>>0]|0}}else{if(q){z=(gd(v)|0)+8|0;a[m+(o*6|0)+u+1605>>0]=z}else z=8;if(t){y=0;do{if(s)A=(d[24+y>>0]<<2)+(d[8+y>>0]|0)|0;else A=(d[104+y>>0]<<3)+(d[40+y>>0]|0)|0;z=(z+256+(gd(v)|0)|0)%256|0;a[m+(w*384|0)+(u<<6)+A+69>>0]=z;y=y+1|0}while((y|0)!=(r|0))}}u=u+x|0}while((u|0)<6);w=w+1|0}while((w|0)<4);if((c[k+4>>2]|0)==3){o=0;do{a[m+o+1285>>0]=a[m+o+901>>0]|0;a[m+o+1349>>0]=a[m+o+965>>0]|0;a[m+o+1477>>0]=a[m+o+1093>>0]|0;a[m+o+1541>>0]=a[m+o+1157>>0]|0;o=o+1|0}while((o|0)!=64);a[m+1612>>0]=a[m+1606>>0]|0;a[m+1613>>0]=a[m+1607>>0]|0;a[m+1615>>0]=a[m+1609>>0]|0;a[m+1616>>0]=a[m+1610>>0]|0}}I=(dd(n)|0)&255;a[(c[j>>2]|0)+1617>>0]=I;I=(fd(n)|0)+2|0;c[(c[j>>2]|0)+1620>>2]=I;m=k+13080|0;if(I>>>0<=(c[m>>2]|0)>>>0){I=(dd(n)|0)&255;a[(c[j>>2]|0)+1628>>0]=I;do if((dd(n)|0)!=0?(I=dd(n)|0,ad(n,7)|0,(I|0)!=0):0){n=c[j>>2]|0;p=(c[l>>2]|0)+204|0;if(a[n+21>>0]|0)a[n+1629>>0]=(fd(p)|0)+2;a[n+1630>>0]=dd(p)|0;I=(dd(p)|0)&255;a[n+1631>>0]=I;if(I<<24>>24){a[n+1632>>0]=fd(p)|0;I=fd(p)|0;o=n+1633|0;a[o>>0]=I;if((I&255)>>>0<5)l=0;else break;while(1){a[n+l+1634>>0]=gd(p)|0;a[n+l+1639>>0]=gd(p)|0;if((l|0)<(d[o>>0]|0))l=l+1|0;else break}}a[n+1644>>0]=fd(p)|0;a[n+1645>>0]=fd(p)|0}while(0);l=pd((c[(c[j>>2]|0)+44>>2]|0)+1|0,4)|0;c[(c[j>>2]|0)+1656>>2]=l;l=pd((c[(c[j>>2]|0)+48>>2]|0)+1|0,4)|0;c[(c[j>>2]|0)+1660>>2]=l;l=k+13128|0;o=pd(c[l>>2]|0,4)|0;c[(c[j>>2]|0)+1664>>2]=o;o=c[j>>2]|0;n=c[o+1656>>2]|0;if(((n|0)!=0?(c[o+1660>>2]|0)!=0:0)?(c[o+1664>>2]|0)!=0:0){if(a[o+52>>0]|0){p=c[o+1648>>2]|0;if(!p){o=pd(c[o+44>>2]|0,4)|0;c[(c[j>>2]|0)+1648>>2]=o;o=pd(c[(c[j>>2]|0)+48>>2]|0,4)|0;c[(c[j>>2]|0)+1652>>2]=o;o=c[j>>2]|0;p=c[o+1648>>2]|0;if(!p){b=-12;break}}n=c[o+1652>>2]|0;if(!n){b=-12;break}q=o+44|0;s=c[q>>2]|0;if((s|0)>0){r=0;do{I=r;r=r+1|0;H=c[l>>2]|0;c[p+(I<<2)>>2]=(($(H,r)|0)/(s|0)|0)-(($(H,I)|0)/(s|0)|0);s=c[q>>2]|0}while((r|0)<(s|0))}q=o+48|0;s=c[q>>2]|0;if((s|0)>0){p=k+13132|0;r=0;do{I=r;r=r+1|0;H=c[p>>2]|0;c[n+(I<<2)>>2]=(($(H,r)|0)/(s|0)|0)-(($(H,I)|0)/(s|0)|0);s=c[q>>2]|0}while((r|0)<(s|0))}n=c[o+1656>>2]|0}c[n>>2]=0;q=o+44|0;if((c[q>>2]|0)>0){p=c[o+1648>>2]|0;r=0;s=0;do{r=(c[p+(s<<2)>>2]|0)+r|0;s=s+1|0;c[n+(s<<2)>>2]=r}while((s|0)<(c[q>>2]|0))}s=c[o+1660>>2]|0;c[s>>2]=0;r=o+48|0;if((c[r>>2]|0)>0){q=c[o+1652>>2]|0;t=0;p=0;do{t=(c[q+(p<<2)>>2]|0)+t|0;p=p+1|0;c[s+(p<<2)>>2]=t}while((p|0)<(c[r>>2]|0))}r=c[l>>2]|0;if((r|0)>0){o=c[o+1664>>2]|0;p=0;q=0;do{q=(p>>>0>(c[n+(q<<2)>>2]|0)>>>0&1)+q|0;c[o+(p<<2)>>2]=q;p=p+1|0;r=c[l>>2]|0}while((p|0)<(r|0))}x=$(c[k+13132>>2]|0,r)|0;n=pd(x,4)|0;c[(c[j>>2]|0)+1668>>2]=n;n=pd(x,4)|0;c[(c[j>>2]|0)+1672>>2]=n;n=pd(x,4)|0;c[(c[j>>2]|0)+1676>>2]=n;n=k+13164|0;q=(c[n>>2]|0)+2|0;q=pd($(q,q)|0,4)|0;c[(c[j>>2]|0)+1688>>2]=q;q=c[j>>2]|0;p=c[q+1668>>2]|0;if(!p){b=-12;break}w=c[q+1672>>2]|0;if(!w){b=-12;break}o=c[q+1676>>2]|0;if(!o){b=-12;break}if(!(c[q+1688>>2]|0)){b=-12;break}if((x|0)>0){B=q+44|0;r=q+48|0;s=c[q+1660>>2]|0;v=c[q+1648>>2]|0;u=c[q+1656>>2]|0;t=q+1652|0;A=0;do{C=c[l>>2]|0;y=(A|0)%(C|0)|0;z=(A|0)/(C|0)|0;G=c[B>>2]|0;E=0;while(1){if((E|0)>=(G|0)){E=0;break}F=E+1|0;if(y>>>0<(c[u+(F<<2)>>2]|0)>>>0)break;else E=F}H=c[r>>2]|0;F=0;while(1){if((F|0)>=(H|0)){F=0;break}G=F+1|0;if(z>>>0<(c[s+(G<<2)>>2]|0)>>>0)break;else F=G}if((E|0)>0){G=c[(c[t>>2]|0)+(F<<2)>>2]|0;H=0;I=0;do{I=($(c[v+(H<<2)>>2]|0,G)|0)+I|0;H=H+1|0}while((H|0)!=(E|0))}else I=0;if((F|0)>0){G=c[t>>2]|0;H=0;do{I=($(c[G+(H<<2)>>2]|0,C)|0)+I|0;H=H+1|0}while((H|0)!=(F|0))}H=$(c[v+(E<<2)>>2]|0,z-(c[s+(F<<2)>>2]|0)|0)|0;I=I+y+H-(c[u+(E<<2)>>2]|0)|0;c[p+(A<<2)>>2]=I;c[w+(I<<2)>>2]=A;A=A+1|0}while((A|0)!=(x|0))}else r=q+48|0;x=c[r>>2]|0;if((x|0)>0){s=q+44|0;t=q+1660|0;q=q+1656|0;z=c[s>>2]|0;u=0;w=0;while(1){v=u;u=u+1|0;if((z|0)>0){x=c[t>>2]|0;y=x+(u<<2)|0;G=c[y>>2]|0;B=z;z=0;do{E=c[x+(v<<2)>>2]|0;A=z;z=z+1|0;if(E>>>0>>0){B=c[q>>2]|0;C=B+(z<<2)|0;F=c[C>>2]|0;do{H=c[B+(A<<2)>>2]|0;if(H>>>0>>0){do{c[o+(c[p+(($(c[l>>2]|0,E)|0)+H<<2)>>2]<<2)>>2]=w;H=H+1|0;F=c[C>>2]|0}while(H>>>0>>0);G=c[y>>2]|0}E=E+1|0}while(E>>>0>>0);B=c[s>>2]|0}w=w+1|0}while((z|0)<(B|0));v=c[r>>2]|0;z=B}else v=x;if((u|0)>=(v|0))break;else x=v}}else w=0;o=pd(w,4)|0;c[(c[j>>2]|0)+1680>>2]=o;o=c[j>>2]|0;p=c[o+1680>>2]|0;if(!p){b=-12;break}r=o+48|0;u=c[r>>2]|0;if((u|0)>0){q=o+44|0;t=c[q>>2]|0;s=0;do{if((t|0)>0){u=c[o+1660>>2]|0;v=c[o+1656>>2]|0;w=0;do{I=$(c[l>>2]|0,c[u+(s<<2)>>2]|0)|0;c[p+(($(t,s)|0)+w<<2)>>2]=(c[v+(w<<2)>>2]|0)+I;w=w+1|0;t=c[q>>2]|0}while((w|0)<(t|0));u=c[r>>2]|0}s=s+1|0}while((s|0)<(u|0))}k=(c[m>>2]|0)-(c[k+13072>>2]|0)|0;v=c[n>>2]|0;c[o+1684>>2]=(c[o+1688>>2]|0)+(v+3<<2);p=v+2|0;if((p|0)>0){m=c[(c[j>>2]|0)+1688>>2]|0;o=0;do{c[m+(($(p,o)|0)<<2)>>2]=-1;c[m+(o<<2)>>2]=-1;o=o+1|0;v=c[n>>2]|0;p=v+2|0}while((o|0)<(p|0))}if((v|0)>-1){m=c[j>>2]|0;j=m+1668|0;p=k<<1;o=(k|0)>0;m=m+1684|0;q=0;while(1){if((v|0)>-1){r=q>>k;t=c[j>>2]|0;s=c[m>>2]|0;u=0;while(1){z=c[t+(($(c[l>>2]|0,r)|0)+(u>>k)<<2)>>2]<>2]=z;v=c[n>>2]|0;if((u|0)<(v|0))u=u+1|0;else break}}if((q|0)<(v|0))q=q+1|0;else break}}if(((c[g+216>>2]|0)-(c[g+212>>2]|0)|0)<0){b=0;break}I=b+(h<<2)+400|0;wd(I);c[I>>2]=c[e>>2];I=0;i=f;return I|0}else b=-12}else b=-1094995529}else b=-1094995529}else b=-1094995529;while(0);wd(e);I=b;i=f;return I|0}function Hc(a,b){a=a|0;b=b|0;var d=0;a=i;i=i+16|0;d=a;c[d>>2]=b;kd(b+1648|0);kd(b+1652|0);kd(b+1656|0);kd(b+1660|0);kd(b+1664|0);kd(b+1668|0);kd(b+1672|0);kd(b+1680|0);kd(b+1676|0);kd(b+1688|0);kd(d);i=a;return}function Ic(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0;b=i;d=a+136|0;e=a+2512|0;while(1){f=(c[d>>2]|0)+204|0;g=0;do{h=ad(f,8)|0;g=h+g|0}while((h|0)==255);h=0;do{j=ad(f,8)|0;h=j+h|0}while((j|0)==255);do if((c[e>>2]|0)==39)if((g|0)==256){Jc(a);break}else{cd(f,h<<3);break}else if((g|0)==132){Jc(a);break}else{cd(f,h<<3);break}while(0);f=c[d>>2]|0;if(((c[f+216>>2]|0)-(c[f+212>>2]|0)|0)<=0){a=14;break}if((bd(f+204|0,8)|0)==128){a=14;break}}if((a|0)==14){i=b;return 1}return 0}function Jc(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;e=(c[b+136>>2]|0)+204|0;g=(ad(e,8)|0)&255;f=b+4468|0;h=0;do{if((g|0)==1)cd(e,16);else if(!g){a[f>>0]=1;j=0;do{a[b+(h<<4)+j+4420>>0]=ad(e,8)|0;j=j+1|0}while((j|0)!=16)}else if((g|0)==2)cd(e,32);h=h+1|0}while((h|0)!=3);i=d;return}function Kc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;d=i;f=c[b+52>>2]|0;e=a+60|0;if((f|0)>0){if((c[e>>2]|0)==0?(f=nd(f)|0,c[e>>2]=f,(f|0)==0):0){f=-12;i=d;return f|0}}else c[e>>2]=0;f=a+12|0;c[f>>2]=b;c[a+424>>2]=0;c[a+800>>2]=1;h=a+912|0;g=a+936|0;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[g>>2]=0;c[g+4>>2]=-2147483648;g=a+928|0;c[g>>2]=0;c[g+4>>2]=-2147483648;a=Fa[c[b+76>>2]&3](a)|0;if((a|0)>=0){h=0;i=d;return h|0}kd(e);c[f>>2]=0;h=a;i=d;return h|0}function Lc(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;if(!a){i=b;return 0}e=a+12|0;f=c[e>>2]|0;if((f|0)!=0?(d=c[f+92>>2]|0,(d|0)!=0):0)Fa[d&3](a)|0;c[a+796>>2]=0;kd(a+60|0);c[e>>2]=0;c[a+808>>2]=0;i=b;return 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,l=0;h=i;if((f|0)<=0){i=h;return 0}j=(e|0)==0;k=0;do{l=d+($(k,g)|0)|0;l=Ka[b&1](a,l)|0;if(!j)c[e+(k<<2)>>2]=l;k=k+1|0}while((k|0)!=(f|0));i=h;return 0}function Nc(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;if((f|0)<=0){i=g;return 0}h=(e|0)==0;j=0;do{k=Ia[b&1](a,d,j,0)|0;if(!h)c[e+(j<<2)>>2]=k;j=j+1|0}while((j|0)!=(f|0));i=g;return 0}function Oc(b,f,g){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;g=i;h=Cd(c[f+76>>2]|0)|0;b=h+4|0;if(!(a[b>>0]|0)){p=0;i=g;return p|0}k=f+64|0;l=h+5|0;m=f+68|0;n=h+6|0;j=0;while(1){p=($((((e[h+(j<<1)+8>>1]|0)>>>11&15)+8|0)>>>3,c[k>>2]|0)|0)+31&-32;if((j+ -1|0)>>>0<2){p=0-(0-p>>d[l>>0])|0;c[f+(j<<2)+32>>2]=p;o=0-(0-((c[m>>2]|0)+31&-32)>>d[n>>0])|0}else{c[f+(j<<2)+32>>2]=p;o=(c[m>>2]|0)+31&-32}o=td(($(p,o)|0)+32|0)|0;c[f+(j<<2)+304>>2]=o;if(!o){b=-1;f=8;break}c[f+(j<<2)>>2]=c[o+4>>2];j=j+1|0;if((j|0)>=(d[b>>0]|0)){b=0;f=8;break}}if((f|0)==8){i=g;return b|0}return 0}function Pc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;ae(a|0,0,976)|0;e=(b|0)!=0;if(e){c[a+8>>2]=c[b+8>>2];c[a+48>>2]=c[b+12>>2]}else c[a+8>>2]=-1;c[a+100>>2]=0;c[a+104>>2]=1;c[a+888>>2]=0;c[a+892>>2]=1;c[a+896>>2]=0;c[a+900>>2]=1;c[a+476>>2]=1;c[a+816>>2]=1;c[a+820>>2]=1;c[a+220>>2]=0;c[a+224>>2]=1;c[a+136>>2]=-1;c[a+416>>2]=-1;g=a+696|0;c[g>>2]=0;c[g+4>>2]=-2147483648;if((e?(f=c[b+52>>2]|0,(f|0)!=0):0)?(g=nd(f)|0,c[a+60>>2]=g,(g|0)==0):0){g=-12;i=d;return g|0}g=0;i=d;return g|0}function Qc(a){a=a|0;var b=0,c=0;b=i;c=hd(976)|0;if(c){if((Pc(c,a)|0)<0){jd(c);c=0}}else c=0;i=b;return c|0}function Rc(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+80|0;g=f;k=g+0|0;j=e+0|0;h=k+80|0;do{c[k>>2]=c[j>>2];k=k+4|0;j=j+4|0}while((k|0)<(h|0));h=a+12|0;j=c[h>>2]|0;if(!j){k=-22;i=f;return k|0}if(c[j+8>>2]|0){k=-22;i=f;return k|0}c[d>>2]=0;j=c[a+124>>2]|0;k=c[a+128>>2]|0;if(!j){if(k){k=-22;i=f;return k|0}}else{if(!((j|0)>0&(k|0)>0)){k=-22;i=f;return k|0}if((j+128|0)>>>0>=(268435455/((k+128|0)>>>0)|0)>>>0){k=-22;i=f;return k|0}}zd(b);h=c[h>>2]|0;if(((c[h+16>>2]&32|0)==0?(c[e+28>>2]|0)==0:0)?(c[a+808>>2]&1|0)==0:0){k=0;i=f;return k|0}g=Ia[c[h+88>>2]&1](a,b,d,g)|0;if(!(c[d>>2]|0)){zd(b);k=g;i=f;return k|0}else{k=a+424|0;c[k>>2]=(c[k>>2]|0)+1;k=g;i=f;return k|0}return 0}function Sc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=i;if((a|0)>0&(b|0)>0?(a+128|0)>>>0<(268435455/((b+128|0)>>>0)|0)>>>0:0){d=0;i=c;return d|0}d=-22;i=c;return d|0}function Tc(a,b){a=a|0;b=b|0;return 0}function Uc(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;f=i;e=a+8|0;if(!(c[e>>2]|0)){g=c[a+116>>2]|0;h=a+120|0;j=c[h>>2]|0;if(!((g|0)>0&(j|0)>0)){l=-22;i=f;return l|0}if((g+128|0)>>>0>=(268435455/((j+128|0)>>>0)|0)>>>0){l=-22;i=f;return l|0}j=c[a+136>>2]|0;if((j|0)<0){l=-22;i=f;return l|0}k=b+64|0;l=b+68|0;if((c[k>>2]|0)>=1?(c[l>>2]|0)>=1:0)g=1;else{m=a+792|0;n=0-(0-(c[a+124>>2]|0)>>c[m>>2])|0;c[k>>2]=(g|0)>(n|0)?g:n;k=c[h>>2]|0;g=0-(0-(c[a+128>>2]|0)>>c[m>>2])|0;c[l>>2]=(k|0)>(g|0)?k:g;g=0}c[b+76>>2]=j}else g=1;d=za[c[a+476>>2]&1](a,b,d)|0;if(c[e>>2]|g){n=d;i=f;return n|0}c[b+64>>2]=c[a+116>>2];c[b+68>>2]=c[a+120>>2];n=d;i=f;return n|0}function Vc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=i;c[b+4>>2]=a;a=Uc(a,c[b>>2]|0,d)|0;i=e;return a|0}function Wc(a,b){a=a|0;b=b|0;a=i;b=c[b>>2]|0;if(b)zd(b);i=a;return}function Xc(a){a=a|0;return}function Yc(a,b,c){a=a|0;b=b|0;c=c|0;return}function Zc(a){a=a|0;var b=0,d=0;b=i;d=a+8|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+16|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+64|0;c[d>>2]=-1;c[d+4>>2]=-1;d=a+72|0;c[d>>2]=0;c[d+4>>2]=0;d=a+32|0;c[a>>2]=0;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;i=b;return}function _c(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;g=a+16|0;c[a+12>>2]=b;c[a+20>>2]=b+e;h=b+1|0;c[g>>2]=h;e=(d[b>>0]|0)<<18;c[a>>2]=e;f=b+2|0;c[g>>2]=f;e=(d[h>>0]|0)<<10|e;c[a>>2]=e;c[g>>2]=b+3;c[a>>2]=(d[f>>0]|0)<<2|e|2;c[a+4>>2]=510;return}function $c(){var b=0,e=0,f=0,g=0,h=0,j=0;b=i;if(!(c[718]|0))e=0;else{i=b;return}while(1)if(e){g=(e&65280|0)==0;a[2880+e>>0]=(g?8:0)-(d[4680+(g?e:e>>>8)>>0]|0);e=e+1|0;if((e|0)==512){e=0;break}else continue}else{a[2880]=9;e=1;continue}while(1){f=e<<1;g=0;do{j=a[4224+(e<<2)+g>>0]|0;h=(g<<7)+f|0;a[(h|1)+3392>>0]=j;a[h+3392>>0]=j;g=g+1|0}while((g|0)!=4);j=(d[4480+e>>0]|0)<<1;a[f+4032>>0]=j;a[f+4033>>0]=j|1;if(e){h=(d[4544+e>>0]|0)<<1;j=128-f|0;a[j+3903>>0]=h;a[j+3902>>0]=h|1;e=e+1|0;if((e|0)==64)break;else continue}else{e=128-f|0;a[e+3903>>0]=1;a[e+3902>>0]=0;e=1;continue}}g=4160|0;f=4608|0;e=g+63|0;do{a[g>>0]=a[f>>0]|0;g=g+1|0;f=f+1|0}while((g|0)<(e|0));c[718]=1;i=b;return}function ad(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0;e=i;f=a+8|0;h=c[f>>2]|0;g=c[a+16>>2]|0;a=(c[a>>2]|0)+(h>>>3)|0;a=(Xd(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(h&7)>>>(32-b|0);b=h+b|0;c[f>>2]=g>>>0>b>>>0?b:g;i=e;return a|0}function bd(a,b){a=a|0;b=b|0;var e=0,f=0;e=i;f=c[a+8>>2]|0;a=(c[a>>2]|0)+(f>>>3)|0;a=(Xd(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(f&7)>>>(32-b|0);i=e;return a|0}function cd(a,b){a=a|0;b=b|0;var d=0;d=a+8|0;a=c[a+16>>2]|0;b=(c[d>>2]|0)+b|0;c[d>>2]=a>>>0>b>>>0?b:a;return}function dd(a){a=a|0;var b=0,e=0,f=0;e=a+8|0;f=c[e>>2]|0;b=(d[(c[a>>2]|0)+(f>>>3)>>0]|0)<<(f&7)>>>7&1;c[e>>2]=((f|0)<(c[a+16>>2]|0)&1)+f;return b|0}function ed(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;if(!b){j=0;i=e;return j|0}f=a+8|0;h=c[f>>2]|0;g=c[a+16>>2]|0;j=c[a>>2]|0;a=j+(h>>>3)|0;a=(Xd(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(h&7);if((b|0)<26){j=h+b|0;c[f>>2]=g>>>0>j>>>0?j:g;j=a>>>(32-b|0);i=e;return j|0}else{k=h+16|0;k=g>>>0>k>>>0?k:g;c[f>>2]=k;h=b+ -16|0;j=j+(k>>>3)|0;j=(Xd(d[j>>0]|d[j+1>>0]<<8|d[j+2>>0]<<16|d[j+3>>0]<<24|0)|0)<<(k&7)>>>(48-b|0);b=k+h|0;c[f>>2]=g>>>0>b>>>0?b:g;j=j|a>>>16<>2]=c[a+0>>2];c[e+4>>2]=c[a+4>>2];c[e+8>>2]=c[a+8>>2];c[e+12>>2]=c[a+12>>2];c[e+16>>2]=c[a+16>>2];e=ed(e,32)|0;f=e>>>0>65535;e=f?e>>>16:e;f=f?16:0;if(e&65280){f=f|8;e=e>>>8}j=31-f-(d[4680+e>>0]|0)|0;g=a+8|0;f=c[g>>2]|0;e=0-f|0;h=(c[a+16>>2]|0)-f|0;if((j|0)<(e|0)){h=e;h=h+f|0;c[g>>2]=h;j=j+1|0;j=ed(a,j)|0;j=j+ -1|0;i=b;return j|0}h=(h|0)<(j|0)?h:j;h=h+f|0;c[g>>2]=h;j=j+1|0;j=ed(a,j)|0;j=j+ -1|0;i=b;return j|0}function gd(a){a=a|0;var b=0;b=i;a=fd(a)|0;if(!(a&1)){a=0-(a>>>1)|0;i=b;return a|0}else{a=(a+1|0)>>>1;i=b;return a|0}return 0}function hd(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[1168]|0;if((d+ -32|0)>>>0>=a>>>0){e=Sd(a)|0;if((e|0)==0&(a|0)==0)if((d|0)==32)e=0;else e=Sd(1)|0}else e=0;i=b;return e|0}function id(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;f=$(d,b)|0;if((d|b)>>>0>65535&(d|0)!=0?((f>>>0)/(d>>>0)|0|0)!=(b|0):0){Td(a);d=0;i=e;return d|0}if(((c[1168]|0)+ -32|0)>>>0>>0)b=0;else b=Ud(a,((f|0)==0&1)+f|0)|0;if((b|0)!=0|(f|0)==0){d=b;i=e;return d|0}Td(a);d=0;i=e;return d|0}function jd(a){a=a|0;var b=0;b=i;Td(a);i=b;return}function kd(a){a=a|0;var b=0;b=i;Td(c[a>>2]|0);c[a>>2]=0;i=b;return}function ld(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if(((d|0)!=0?(2147483647/(d>>>0)|0)>>>0>b>>>0:0)?(f=$(d,b)|0,((c[1168]|0)+ -32|0)>>>0>=f>>>0):0)a=Ud(a,((f|0)==0&1)+f|0)|0;else a=0;i=e;return a|0}function md(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=i;e=id(c[a>>2]|0,b,d)|0;c[a>>2]=e;i=f;return((e|0)!=0|(b|0)==0|(d|0)==0?0:-12)|0}function nd(a){a=a|0;var b=0,c=0;c=i;b=hd(a)|0;if(b)ae(b|0,0,a|0)|0;i=c;return b|0}function od(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if((c[b>>2]|0)>>>0>d>>>0){i=e;return}f=((d*17|0)>>>4)+32|0;d=f>>>0>d>>>0?f:d;Td(c[a>>2]|0);f=hd(d)|0;c[a>>2]=f;c[b>>2]=(f|0)==0?0:d;i=e;return}function pd(a,b){a=a|0;b=b|0;var c=0;c=i;if((b|0)!=0?(2147483647/(b>>>0)|0)>>>0>a>>>0:0)b=hd($(b,a)|0)|0;else b=0;i=c;return b|0}function qd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=i;if(((b|0)!=0?(2147483647/(b>>>0)|0)>>>0>a>>>0:0)?(e=$(b,a)|0,d=hd(e)|0,(d|0)!=0):0)ae(d|0,0,e|0)|0;else d=0;i=c;return d|0}function rd(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;g=i;i=i+16|0;h=g;j=nd(24)|0;c[h>>2]=j;if(!j){f=0;i=g;return f|0}c[j>>2]=a;c[j+4>>2]=b;c[j+12>>2]=(d|0)!=0?d:7;c[j+16>>2]=e;c[j+8>>2]=1;if(f&1){f=(c[h>>2]|0)+20|0;c[f>>2]=c[f>>2]|1}j=nd(12)|0;if(!j){kd(h);f=0;i=g;return f|0}else{c[j>>2]=c[h>>2];c[j+4>>2]=a;c[j+8>>2]=b;f=j;i=g;return f|0}return 0}function sd(a,b){a=a|0;b=b|0;a=i;jd(b);i=a;return}function td(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b;e=hd(a)|0;c[d>>2]=e;if(e){a=rd(e,a,7,0,0)|0;if(!a){kd(d);a=0}}else a=0;i=b;return a|0}function ud(a){a=a|0;var b=0,d=0;b=i;d=td(a)|0;if(!d){d=0;i=b;return d|0}ae(c[d+4>>2]|0,0,a|0)|0;i=b;return d|0}function vd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b;d=nd(12)|0;if(!d){e=0;i=b;return e|0}c[d+0>>2]=c[a+0>>2];c[d+4>>2]=c[a+4>>2];c[d+8>>2]=c[a+8>>2];f=(c[a>>2]|0)+8|0;a=c[f>>2]|0;c[f>>2]=a+1;c[e>>2]=a+1;e=d;i=b;return e|0}function wd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+4|0;d=b;if(!a){i=b;return}f=c[a>>2]|0;if(!f){i=b;return}f=c[f>>2]|0;c[d>>2]=f;kd(a);a=f+8|0;f=c[a>>2]|0;c[a>>2]=f+ -1;c[e>>2]=f+ -1;if(c[e>>2]|0){i=b;return}f=c[d>>2]|0;Ca[c[f+12>>2]&7](c[f+16>>2]|0,c[f>>2]|0);kd(d);i=b;return}function xd(){var a=0,b=0,d=0;a=i;b=nd(400)|0;if(!b){b=0;i=a;return b|0}ae(b|0,0,400)|0;d=b+136|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+144|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+128|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+360|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+376|0;c[d>>2]=0;c[d+4>>2]=0;d=b+368|0;c[d>>2]=-1;c[d+4>>2]=-1;c[b+392>>2]=-1;c[b+80>>2]=1;c[b+120>>2]=0;c[b+124>>2]=1;c[b+76>>2]=-1;c[b+344>>2]=2;c[b+348>>2]=2;c[b+352>>2]=2;c[b+340>>2]=0;c[b+356>>2]=0;i=a;return b|0}function yd(a){a=a|0;var b=0,d=0;b=i;if((a|0)!=0?(d=c[a>>2]|0,(d|0)!=0):0){zd(d);kd(a)}i=b;return}function zd(a){a=a|0;var b=0,d=0;b=i;wd(a+304|0);wd(a+308|0);wd(a+312|0);wd(a+316|0);wd(a+320|0);wd(a+324|0);wd(a+328|0);wd(a+332|0);ae(a|0,0,400)|0;d=a+136|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+144|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+128|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+360|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+376|0;c[d>>2]=0;c[d+4>>2]=0;d=a+368|0;c[d>>2]=-1;c[d+4>>2]=-1;c[a+392>>2]=-1;c[a+80>>2]=1;c[a+120>>2]=0;c[a+124>>2]=1;c[a+76>>2]=-1;c[a+344>>2]=2;c[a+348>>2]=2;c[a+352>>2]=2;c[a+340>>2]=0;c[a+356>>2]=0;i=b;return}function Ad(a,b){a=a|0;b=b|0;var d=0;d=i;ce(a|0,b|0,400)|0;ae(b|0,0,400)|0;a=b+136|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+144|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+128|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+360|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+376|0;c[a>>2]=0;c[a+4>>2]=0;a=b+368|0;c[a>>2]=-1;c[a+4>>2]=-1;c[b+392>>2]=-1;c[b+80>>2]=1;c[b+120>>2]=0;c[b+124>>2]=1;c[b+76>>2]=-1;c[b+344>>2]=2;c[b+348>>2]=2;c[b+352>>2]=2;c[b+340>>2]=0;c[b+356>>2]=0;i=d;return}function Bd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;c[a+76>>2]=c[b+76>>2];c[a+64>>2]=c[b+64>>2];c[a+68>>2]=c[b+68>>2];c[a+388>>2]=c[b+388>>2];j=b+296|0;h=c[j+4>>2]|0;f=a+296|0;c[f>>2]=c[j>>2];c[f+4>>2]=h;c[a+72>>2]=c[b+72>>2];f=c[b+304>>2]|0;if(!f)sa();else{e=f;g=0}while(1){if((e|0)!=0?(j=vd(e)|0,c[a+(g<<2)+304>>2]=j,(j|0)==0):0){e=5;break}g=g+1|0;if(g>>>0>=8){e=8;break}e=c[b+(g<<2)+304>>2]|0}if((e|0)==5){zd(a);j=-12;i=d;return j|0}else if((e|0)==8){c[a+0>>2]=c[b+0>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];c[a+28>>2]=c[b+28>>2];j=a+32|0;h=b+32|0;c[j+0>>2]=c[h+0>>2];c[j+4>>2]=c[h+4>>2];c[j+8>>2]=c[h+8>>2];c[j+12>>2]=c[h+12>>2];c[j+16>>2]=c[h+16>>2];c[j+20>>2]=c[h+20>>2];c[j+24>>2]=c[h+24>>2];c[j+28>>2]=c[h+28>>2];j=0;i=d;return j|0}return 0}function Cd(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;e=0;while(1){f=e+1|0;if((c[4936+(e*24|0)>>2]|0)==(a|0))break;if(f>>>0<4)e=f;else{e=0;b=5;break}}if((b|0)==5){i=d;return e|0}f=4940+(e*24|0)|0;i=d;return f|0}function Dd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;g=(c[b+16>>2]|0)==0?1:3;if((g|0)>(e|0)){b=c[b>>2]|0;c[d>>2]=c[b+(e<<2)+32>>2];b=c[b+(e<<2)>>2]|0;i=f;return b|0}if((a[b+20>>0]|0)!=0&(g|0)==(e|0)){b=c[b+4>>2]|0;c[d>>2]=c[b+32>>2];b=c[b>>2]|0;i=f;return b|0}else{c[d>>2]=0;b=0;i=f;return b|0}return 0}function Ed(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=i;if(!(c[b>>2]|0)){h=-1;i=f;return h|0}c[e>>2]=c[b+8>>2];c[e+4>>2]=c[b+12>>2];c[e+8>>2]=c[b+16>>2];g=b+22|0;if(!(a[b+20>>0]|0))h=0;else h=(a[g>>0]|0)==0;c[e+12>>2]=h&1;c[e+24>>2]=d[b+24>>0];c[e+28>>2]=d[g>>0];c[e+32>>2]=d[b+23>>0];c[e+16>>2]=c[b+28>>2];c[e+20>>2]=d[b+21>>0];h=0;i=f;return h|0}function Fd(b,e){b=b|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;h=i;f=c[b+8>>2]|0;g=b+44|0;l=c[g>>2]|0;if(l>>>0>=(c[b+12>>2]|0)>>>0){v=-1;i=h;return v|0}m=(c[b+56>>2]|0)+($(c[b+72>>2]|0,l)|0)|0;j=b+40|0;k=(d[j>>0]|0)+3|0;n=c[b+16>>2]|0;if(!n)Ma[c[b+212>>2]&7](b+164|0,e,m,0,0,f,k);else if((n|0)==1){t=l>>1;o=(t|0)%8|0;u=b+88|0;s=c[u>>2]|0;r=b+96|0;n=b+160|0;q=c[n>>2]|0;v=b+21|0;p=d[v>>0]|0;if(!(l&1)){Gd(s,r,f,o,q,p,0);Gd(c[b+92>>2]|0,b+128|0,f,o,c[n>>2]|0,d[v>>0]|0,0)}else{Gd(s,r,f,o,q,p,1);Gd(c[b+92>>2]|0,b+128|0,f,o,c[n>>2]|0,d[v>>0]|0,1);s=(o+5|0)%8|0;r=t+5|0;t=c[b+52>>2]|0;t=(r|0)<(t|0)?r:t+ -1|0;r=(c[b+60>>2]|0)+($(t,c[b+76>>2]|0)|0)|0;t=(c[b+64>>2]|0)+($(c[b+80>>2]|0,t)|0)|0;v=b+48|0;ce(c[b+(s<<2)+96>>2]|0,r|0,c[v>>2]|0)|0;ce(c[b+(s<<2)+128>>2]|0,t|0,c[v>>2]|0)|0}Ma[c[b+212>>2]&7](b+164|0,e,m,c[u>>2]|0,c[b+92>>2]|0,f,k)}else if((n|0)==2){v=(c[b+60>>2]|0)+($(c[b+76>>2]|0,l)|0)|0;s=(c[b+64>>2]|0)+($(c[b+80>>2]|0,l)|0)|0;u=b+88|0;t=b+21|0;Hd(c[u>>2]|0,v,f,d[t>>0]|0);v=b+92|0;Hd(c[v>>2]|0,s,f,d[t>>0]|0);Ma[c[b+212>>2]&7](b+164|0,e,m,c[u>>2]|0,c[v>>2]|0,f,k)}else if((n|0)==3){u=(c[b+60>>2]|0)+($(c[b+76>>2]|0,l)|0)|0;v=(c[b+64>>2]|0)+($(c[b+80>>2]|0,l)|0)|0;Ma[c[b+212>>2]&7](b+164|0,e,m,u,v,f,k)}else{v=-1;i=h;return v|0}a:do if(!(a[b+22>>0]|0)){if(a[j>>0]|0){if(!(a[b+20>>0]|0)){if((f|0)<=0)break;b=e+3|0;e=0;while(1){a[b>>0]=-1;e=e+1|0;if((e|0)==(f|0))break a;else b=b+4|0}}j=c[b+68>>2]|0;k=$(c[b+84>>2]|0,l)|0;o=e+3|0;if((c[b+204>>2]|0)==8){if((f|0)>0){l=0;while(1){a[o>>0]=a[j+(l+k)>>0]|0;l=l+1|0;if((l|0)==(f|0))break;else o=o+4|0}}}else{m=c[b+172>>2]|0;l=c[b+168>>2]|0;n=c[b+164>>2]|0;if((f|0)>0){p=0;while(1){a[o>>0]=($(d[j+(p+k)>>0]|0,m)|0)+l>>n;p=p+1|0;if((p|0)==(f|0))break;else o=o+4|0}}}if(a[b+24>>0]|0){if(!(c[1264]|0)){c[1264]=1;b=1;do{c[5064+(b<<2)>>2]=(((b|0)/2|0)+16711808|0)/(b|0)|0;b=b+1|0}while((b|0)!=256)}if((f|0)>0){b=0;while(1){k=a[e+3>>0]|0;if(!(k<<24>>24)){a[e>>0]=-1;a[e+1>>0]=-1;a[e+2>>0]=-1}else{j=c[5064+((k&255)<<2)>>2]|0;l=a[e>>0]|0;if((l&255)<(k&255))l=(($(l&255,j)|0)+32768|0)>>>16&255;else l=-1;a[e>>0]=l;l=e+1|0;m=a[l>>0]|0;if((m&255)<(k&255))m=(($(m&255,j)|0)+32768|0)>>>16&255;else m=-1;a[l>>0]=m;l=e+2|0;m=a[l>>0]|0;if((m&255)<(k&255))j=(($(m&255,j)|0)+32768|0)>>>16&255;else j=-1;a[l>>0]=j}b=b+1|0;if((b|0)==(f|0))break;else e=e+4|0}}}}}else{m=c[b+68>>2]|0;l=$(c[b+84>>2]|0,l)|0;b=c[b+204>>2]|0;n=1<0;if(q){o=e;p=0;while(1){u=d[m+(p+l)>>0]|0;a[o>>0]=($(d[o>>0]|0,u)|0)+n>>b;v=o+1|0;a[v>>0]=($(d[v>>0]|0,u)|0)+n>>b;v=o+2|0;a[v>>0]=($(d[v>>0]|0,u)|0)+n>>b;p=p+1|0;if((p|0)==(f|0))break;else o=o+k|0}}if(!((a[j>>0]|0)==0|q^1)){e=e+3|0;b=0;while(1){a[e>>0]=-1;b=b+1|0;if((b|0)==(f|0))break;else e=e+4|0}}}while(0);c[g>>2]=(c[g>>2]|0)+1;v=0;i=h;return v|0}function Gd(e,f,g,h,j,k,l){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;m=i;n=c[f+((h+5&7)<<2)>>2]|0;o=c[f+((h+6&7)<<2)>>2]|0;s=c[f+((h+7&7)<<2)>>2]|0;r=c[f+((h&7)<<2)>>2]|0;q=c[f+((h+1&7)<<2)>>2]|0;p=c[f+((h+2&7)<<2)>>2]|0;h=c[f+((h+3&7)<<2)>>2]|0;t=k+ -8|0;f=(g+1|0)/2|0;u=(g|0)>0;if(!l){if(u){l=0;do{z=($(d[o+l>>0]|0,-6)|0)+(d[n+l>>0]<<1)|0;z=z+((d[s+l>>0]|0)*18|0)+((d[r+l>>0]|0)*57|0)+($(d[q+l>>0]|0,-10)|0)|0;b[j+(l+3<<1)>>1]=z+(d[p+l>>0]<<2)-(d[h+l>>0]|0)>>t;l=l+1|0}while((l|0)<(f|0))}}else if(u){l=0;do{z=(d[o+l>>0]<<2)-(d[n+l>>0]|0)+($(d[s+l>>0]|0,-10)|0)|0;z=z+((d[r+l>>0]|0)*57|0)+((d[q+l>>0]|0)*18|0)+($(d[p+l>>0]|0,-6)|0)|0;b[j+(l+3<<1)>>1]=z+(d[h+l>>0]<<1)>>t;l=l+1|0}while((l|0)<(f|0))}s=j+6|0;n=b[s>>1]&255;b[j>>1]=n;v=j+2|0;b[v>>1]=n;u=j+4|0;b[u>>1]=n;n=b[j+(f+2<<1)>>1]&255;b[j+(f+3<<1)>>1]=n;b[j+(f+4<<1)>>1]=n;b[j+(f+5<<1)>>1]=n;b[j+(f+6<<1)>>1]=n;n=(1<>1]|0;v=b[v>>1]|0;u=b[u>>1]|0;f=b[s>>1]|0;l=b[j+8>>1]|0;h=b[j+10>>1]|0;if((g|0)>1){q=g+ -2|0;p=q>>>1;r=p<<1;x=e;while(1){w=b[s+6>>1]|0;y=f*57|0;z=(h<<2)+o+($(l,-10)|0)+y+(u*18|0)+($(v,-6)|0)+(t<<1)-w>>k;if((z|0)<0)z=0;else z=((z|0)>(n|0)?n:z)&255;a[x>>0]=z;t=($(h,-6)|0)+o+(l*18|0)+y+($(u,-10)|0)-t+(v<<2)+(w<<1)>>k;if((t|0)<0)t=0;else t=((t|0)>(n|0)?n:t)&255;a[x+1>>0]=t;g=g+ -2|0;if((g|0)<=1)break;else{B=h;A=l;y=f;z=u;t=v;h=w;x=x+2|0;s=s+2|0;l=B;f=A;u=y;v=z}}t=v;v=u;u=f;f=l;l=h;h=w;e=e+(r+2)|0;g=q-r|0;s=j+(p+4<<1)|0}if(!g){i=m;return}j=(h<<2)+o+($(l,-10)|0)+(f*57|0)+(u*18|0)+($(v,-6)|0)+(t<<1)-(b[s+6>>1]|0)>>k;if((j|0)<0)j=0;else j=((j|0)>(n|0)?n:j)&255;a[e>>0]=j;i=m;return}function Hd(b,c,e,f){b=b|0;c=c|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;g=i;o=(e+1|0)/2|0;h=hd(o+7|0)|0;l=h+3|0;ce(l|0,c|0,o|0)|0;ae(h|0,a[c>>0]|0,3)|0;ae(h+(o+3)|0,a[c+(o+ -1)>>0]|0,4)|0;c=(1<>0]|0;r=d[h+1>>0]|0;m=d[h+2>>0]|0;q=d[l>>0]|0;p=d[h+4>>0]|0;n=d[h+5>>0]|0;if((e|0)>1){j=e+ -2|0;f=j>>>1;k=f<<1;t=b;while(1){s=d[l+3>>0]|0;u=q*57|0;v=(n<<2)+32+($(p,-10)|0)+u+(m*18|0)+($(r,-6)|0)+(o<<1)-s>>6;if((v|0)<0)v=0;else v=((v|0)>(c|0)?c:v)&255;a[t>>0]=v;o=($(n,-6)|0)+32+(p*18|0)+u+($(m,-10)|0)-o+(r<<2)+(s<<1)>>6;if((o|0)<0)o=0;else o=((o|0)>(c|0)?c:o)&255;a[t+1>>0]=o;e=e+ -2|0;if((e|0)<=1)break;else{x=n;w=p;u=q;v=m;o=r;n=s;t=t+2|0;l=l+1|0;p=x;q=w;m=u;r=v}}o=r;r=m;m=q;q=p;p=n;n=s;b=b+(k+2)|0;e=j-k|0;l=h+(f+4)|0}if(!e){jd(h);i=g;return}f=(n<<2)+32+($(p,-10)|0)+(q*57|0)+(m*18|0)+($(r,-6)|0)+(o<<1)-(d[l+3>>0]|0)>>6;if((f|0)<0)c=0;else c=((f|0)>(c|0)?c:f)&255;a[b>>0]=c;jd(h);i=g;return}function Id(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0.0,o=0,p=0.0,q=0.0,r=0.0,s=0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0,B=0.0;f=i;if(!(c[b>>2]|0)){w=-1;i=f;return w|0}g=b+44|0;if((c[g>>2]|0)>-1|e>>>0>1){w=-1;i=f;return w|0}a[b+40>>0]=(e|0)==1&1;k=b+41|0;a[k>>0]=0;c[b+56>>2]=Dd(b,b+72|0,0)|0;e=b+16|0;if(!(c[e>>2]|0))m=1;else{c[b+60>>2]=Dd(b,b+76|0,1)|0;c[b+64>>2]=Dd(b,b+80|0,2)|0;m=3}if(!(a[b+20>>0]|0))c[b+68>>2]=0;else c[b+68>>2]=Dd(b,b+84|0,m)|0;if(((c[e>>2]|0)+ -1|0)>>>0<2?(w=b+8|0,v=c[w>>2]|0,l=b+48|0,c[l>>2]=(v+1|0)/2|0,j=b+52|0,c[j>>2]=((c[b+12>>2]|0)+1|0)/2|0,c[b+88>>2]=hd(v)|0,c[b+92>>2]=hd(c[w>>2]|0)|0,(c[e>>2]|0)==1):0){o=c[l>>2]|0;m=0;do{c[b+(m<<2)+96>>2]=hd(o)|0;c[b+(m<<2)+128>>2]=hd(c[l>>2]|0)|0;m=m+1|0;o=c[l>>2]|0}while((m|0)!=8);c[b+160>>2]=hd((o<<1)+14|0)|0;m=b+60|0;o=b+76|0;s=b+64|0;u=b+80|0;v=0;do{w=(v|0)>4?v+ -8|0:v;if((w|0)<0)w=0;else{x=c[j>>2]|0;w=(w|0)<(x|0)?w:x+ -1|0}y=(c[m>>2]|0)+($(c[o>>2]|0,w)|0)|0;x=(c[s>>2]|0)+($(c[u>>2]|0,w)|0)|0;ce(c[b+(v<<2)+96>>2]|0,y|0,c[l>>2]|0)|0;ce(c[b+(v<<2)+128>>2]|0,x|0,c[l>>2]|0)|0;v=v+1|0}while((v|0)!=8)}j=d[b+21>>0]|0;y=(a[k>>0]|0)!=0?16:8;m=b+28|0;s=c[m>>2]|0;l=a[b+23>>0]|0;k=l&255;o=30-y|0;n=+((1<>24!=0;if(l){y=j+ -8|0;q=n/+(224<>2]=ra(+(q*B*2.0))|0;z=1.0-t;A=z-r;c[b+188>>2]=ra(+(q*(t*2.0*z/A)))|0;c[b+192>>2]=ra(+(q*(r*2.0*B/A)))|0;c[b+196>>2]=ra(+(q*z*2.0))|0}h=ra(+p)|0;c[b+172>>2]=h;c[b+164>>2]=o;s=1<>2]=s;c[b+200>>2]=1<>2]=y;y=$(y,-16<>2]=y+(c[o>>2]|0)}else{c[b+176>>2]=h;c[b+180>>2]=s}c[b+204>>2]=j;c[b+208>>2]=k;if(!(c[e>>2]|0))c[b+212>>2]=4;else c[b+212>>2]=c[5032+(c[m>>2]<<2)>>2];c[g>>2]=0;y=0;i=f;return y|0}function Jd(){var a=0,b=0;a=i;b=nd(216)|0;if(!b)b=0;i=a;return b|0}function Kd(b,d,e){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+48|0;m=f+36|0;l=f;if((e|0)<6){u=-1;i=f;return u|0}if((a[d>>0]|0)!=66){u=-1;i=f;return u|0}if((a[d+1>>0]|0)!=80){u=-1;i=f;return u|0}if((a[d+2>>0]|0)!=71){u=-1;i=f;return u|0}if((a[d+3>>0]|0)!=-5){u=-1;i=f;return u|0}t=a[d+4>>0]|0;u=t&255;n=u>>>5;k=l+8|0;c[k>>2]=n;if(t<<24>>24<0){u=-1;i=f;return u|0}t=(u&15)+8|0;a[l+13>>0]=t;if((t&255)>>>0>14){u=-1;i=f;return u|0}q=a[d+5>>0]|0;j=q&255;p=j>>>4;h=l+20|0;c[h>>2]=p;o=j&8;r=j>>>2&1;g=l+16|0;a[g>>0]=j>>>1&1;j=l+12|0;a[j>>0]=0;s=l+14|0;a[s>>0]=0;t=l+15|0;a[t>>0]=0;if(!(u&16))if(!r)r=0;else{a[j>>0]=1;a[s>>0]=1;r=1}else{a[j>>0]=1;a[t>>0]=r;r=0}if((q&255)>79){u=-1;i=f;return u|0}if(!((n|0)!=0|(p|0)==0)){u=-1;i=f;return u|0}if(r<<24>>24!=0&(n|0)==0){u=-1;i=f;return u|0}n=Nd(l,d+6|0,e+ -6|0)|0;if((n|0)<0){u=-1;i=f;return u|0}n=n+6|0;p=l+4|0;q=Nd(p,d+n|0,e-n|0)|0;if((q|0)<0){u=-1;i=f;return u|0}q=q+n|0;if(!(c[l>>2]|0)){u=-1;i=f;return u|0}if(!(c[p>>2]|0)){u=-1;i=f;return u|0}n=l+24|0;r=Nd(n,d+q|0,e-q|0)|0;if((r|0)<0){u=-1;i=f;return u|0}s=r+q|0;c[m>>2]=0;q=(o|0)!=0;do if(q){o=Nd(m,d+s|0,e-s|0)|0;if((o|0)<0){u=-1;i=f;return u|0}else{s=o+s|0;break}}while(0);o=l+28|0;c[o>>2]=0;do if(a[j>>0]|0){r=Nd(o,d+s|0,e-s|0)|0;if((r|0)<0){u=-1;i=f;return u|0}else{s=r+s|0;break}}while(0);c[l+32>>2]=0;do if(q){m=(c[m>>2]|0)+s|0;if((m|0)>(e|0))b=-1;else break;i=f;return b|0}else m=s;while(0);if((m|0)<0){u=m;i=f;return u|0}l=c[l>>2]|0;p=c[p>>2]|0;k=c[k>>2]|0;t=c[j>>2]|0;j=t&255;u=c[h>>2]|0;s=(t&65535)>>>8;h=s&65535;r=b+8|0;c[r>>2]=l;q=b+12|0;c[q>>2]=p;c[b+16>>2]=k;a[b+20>>0]=j;a[b+24>>0]=t>>>24;a[b+22>>0]=t>>>16;a[b+23>>0]=a[g>>0]|0;c[b+28>>2]=u;a[b+21>>0]=s;g=b+36|0;c[g>>2]=0;s=c[n>>2]|0;n=s+m|0;a:do if(n>>>0>e>>>0)d=b;else{m=Ld(d+m|0,s,l,p,k,h)|0;c[b>>2]=m;if(!m){d=b;break}if((c[m+64>>2]|0)<(c[r>>2]|0)){d=b;break}if((c[m+68>>2]|0)<(c[q>>2]|0)){d=b;break}switch(c[m+76>>2]|0){case 4:case 56:{if((k|0)!=2){d=b;break a}break};case 5:case 58:{if((k|0)!=3){d=b;break a}break};case 8:case 32:{if(k){d=b;break a}break};case 0:case 54:{if((k|0)!=1){d=b;break a}break};default:{d=b;break a}}if(j<<24>>24){j=c[o>>2]|0;if((j+n|0)>>>0>e>>>0){d=b;break}u=Ld(d+n|0,j,l,p,0,h)|0;c[b+4>>2]=u;if(!u){d=b;break}}c[b+44>>2]=-1;u=0;i=f;return u|0}while(0);if(c[d>>2]|0)yd(d);b=b+4|0;if(c[b>>2]|0)yd(b);c[g>>2]=0;u=-1;i=f;return u|0}function Ld(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;k=i;i=i+96|0;n=k+88|0;o=k;l=k+84|0;q=k+80|0;p=Nd(q,b,d)|0;if((p|0)<0){b=0;i=k;return b|0}r=d-p|0;s=c[q>>2]|0;if(s>>>0>r>>>0){b=0;i=k;return b|0}d=s+10|0;q=hd(d)|0;a[q>>0]=g;a[q+1>>0]=e>>>24;a[q+2>>0]=e>>>16;a[q+3>>0]=e>>>8;a[q+4>>0]=e;a[q+5>>0]=f>>>24;a[q+6>>0]=f>>>16;a[q+7>>0]=f>>>8;a[q+8>>0]=f;a[q+9>>0]=h+248;ce(q+10|0,b+p|0,s|0)|0;g=b+(s+p)|0;r=r-s|0;p=hd((d<<1)+10-s+r|0)|0;a[p>>0]=0;a[p+1>>0]=0;a[p+2>>0]=0;a[p+3>>0]=1;a[p+4>>0]=96;a[p+5>>0]=1;if((d|0)>0){f=0;s=6;while(1){e=f+1|0;h=a[q+f>>0]|0;if((e|0)<(d|0)&h<<24>>24==0)if(!(a[q+e>>0]|0)){a[p+s>>0]=0;a[p+(s+1)>>0]=0;a[p+(s+2)>>0]=3;e=f+2|0;s=s+3|0}else{h=0;j=7}else j=7;if((j|0)==7){j=0;a[p+s>>0]=h;s=s+1|0}if((e|0)<(d|0))f=e;else break}if(!s){s=0;j=11}else j=10}else{s=6;j=10}if((j|0)==10)if(!(a[p+(s+ -1)>>0]|0))j=11;if((j|0)==11){a[p+s>>0]=-128;s=s+1|0}jd(q);a[p+s>>0]=0;a[p+(s+1)>>0]=0;a[p+(s+2)>>0]=0;b=s+4|0;a[p+(s+3)>>0]=1;ce(p+b|0,g|0,r|0)|0;r=b+r|0;Zc(o);g=Qc(1416)|0;if(!g)wa(1);if(c[358]&8){b=g+84|0;c[b>>2]=c[b>>2]|65536}b=g+688|0;c[b>>2]=c[b>>2]|1;if((Kc(g,1416,0)|0)<0)wa(1);s=xd()|0;c[l>>2]=s;if(!s){b=0;i=k;return b|0}q=o+28|0;c[q>>2]=r;d=o+24|0;c[d>>2]=p;if((r|0)>0){r=s;s=0;while(1){r=Rc(g,r,n,o)|0;if((r|0)<0){j=26;break}m=((c[n>>2]|0)!=0&1)+s|0;s=c[d>>2]|0;e=c[q>>2]|0;if(s){e=e-r|0;c[q>>2]=e;c[d>>2]=s+r}if((e|0)<=0)break;r=c[l>>2]|0;s=m}if((j|0)==26)wa(1);Lc(g)|0;jd(g);jd(p);if(m){b=c[l>>2]|0;i=k;return b|0}}else{Lc(g)|0;jd(g);jd(p)}yd(l);b=0;i=k;return b|0}function Md(a){a=a|0;var b=0,d=0;b=i;jd(c[a+88>>2]|0);jd(c[a+92>>2]|0);d=0;do{jd(c[a+(d<<2)+96>>2]|0);jd(c[a+(d<<2)+128>>2]|0);d=d+1|0}while((d|0)!=8);jd(c[a+160>>2]|0);if(c[a>>2]|0)yd(a);d=a+4|0;if(!(c[d>>2]|0)){jd(a);i=b;return}yd(d);jd(a);i=b;return}function Nd(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;if((f|0)<1){l=-1;i=g;return l|0}k=e+1|0;l=a[e>>0]|0;j=l&255;if(l<<24>>24<=-1){if(l<<24>>24==-128){l=-1;i=g;return l|0}j=j&127;while(1){if((f|0)<2){b=-1;h=10;break}l=k;k=k+1|0;l=d[l>>0]|0;j=l&127|j<<7;if(!(l&128))break;else f=f+ -1|0}if((h|0)==10){i=g;return b|0}c[b>>2]=j;h=k-e|0;if((h|0)<0){l=h;i=g;return l|0}}else{c[b>>2]=j;h=1}l=j>>>0>1073741823?-1:h;i=g;return l|0}function Od(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;h=i;if((c[b+40>>2]|0)==8?(c[b+44>>2]|0)==0:0){if((j|0)>0)g=0;else{i=h;return}while(1){n=a[f+g>>0]|0;a[e>>0]=n;a[e+1>>0]=n;a[e+2>>0]=n;g=g+1|0;if((g|0)==(j|0))break;else e=e+k|0}i=h;return}l=c[b+12>>2]|0;g=c[b+16>>2]|0;b=c[b>>2]|0;if((j|0)>0)m=0;else{i=h;return}while(1){n=($(d[f+m>>0]|0,l)|0)+g>>b;if((n|0)<0)n=0;else n=(n|0)>255?-1:n&255;a[e>>0]=n;a[e+1>>0]=n;a[e+2>>0]=n;m=m+1|0;if((m|0)==(j|0))break;else e=e+k|0}i=h;return}function Pd(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;q=i;s=c[b+20>>2]|0;n=c[b+24>>2]|0;o=c[b+28>>2]|0;l=c[b+32>>2]|0;p=c[b+12>>2]|0;r=c[b+16>>2]|0;m=c[b>>2]|0;b=c[b+36>>2]|0;if((j|0)>0)t=0;else{i=q;return}while(1){v=$(d[f+t>>0]|0,p)|0;u=(d[g+t>>0]|0)-b|0;w=(d[h+t>>0]|0)-b|0;v=v+r|0;x=v+($(w,s)|0)>>m;if((x|0)<0)x=0;else x=(x|0)>255?-1:x&255;a[e>>0]=x;w=v-($(u,n)|0)-($(w,o)|0)>>m;if((w|0)<0)w=0;else w=(w|0)>255?-1:w&255;a[e+1>>0]=w;u=v+($(u,l)|0)>>m;if((u|0)<0)u=0;else u=(u|0)>255?-1:u&255;a[e+2>>0]=u;t=t+1|0;if((t|0)==(j|0))break;else e=e+k|0}i=q;return}function Qd(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;l=i;if((c[b+40>>2]|0)==8?(c[b+44>>2]|0)==0:0){if((j|0)>0)m=0;else{i=l;return}while(1){a[e>>0]=a[h+m>>0]|0;a[e+1>>0]=a[f+m>>0]|0;a[e+2>>0]=a[g+m>>0]|0;m=m+1|0;if((m|0)==(j|0))break;else e=e+k|0}i=l;return}n=c[b+12>>2]|0;m=c[b+16>>2]|0;b=c[b>>2]|0;if((j|0)>0)o=0;else{i=l;return}while(1){p=($(d[h+o>>0]|0,n)|0)+m>>b;if((p|0)<0)p=0;else p=(p|0)>255?-1:p&255;a[e>>0]=p;p=($(d[f+o>>0]|0,n)|0)+m>>b;if((p|0)<0)p=0;else p=(p|0)>255?-1:p&255;a[e+1>>0]=p;p=($(d[g+o>>0]|0,n)|0)+m>>b;if((p|0)<0)p=0;else p=(p|0)>255?-1:p&255;a[e+2>>0]=p;o=o+1|0;if((o|0)==(j|0))break;else e=e+k|0}i=l;return}function Rd(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;o=i;l=c[b+12>>2]|0;m=c[b+16>>2]|0;n=c[b>>2]|0;b=c[b+36>>2]|0;if((j|0)>0)p=0;else{i=o;return}while(1){t=d[f+p>>0]|0;s=(d[g+p>>0]|0)-b|0;r=(d[h+p>>0]|0)-b|0;q=t-s|0;u=($(q+r|0,l)|0)+m>>n;if((u|0)<0)u=0;else u=(u|0)>255?-1:u&255;a[e>>0]=u;s=($(s+t|0,l)|0)+m>>n;if((s|0)<0)s=0;else s=(s|0)>255?-1:s&255;a[e+1>>0]=s;q=($(q-r|0,l)|0)+m>>n;if((q|0)<0)q=0;else q=(q|0)>255?-1:q&255;a[e+2>>0]=q;p=p+1|0;if((p|0)==(j|0))break;else e=e+k|0}i=o;return}function Sd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;if((b|0)==0|b>>>0>2147483583){k=0;i=d;return k|0}do if(!(c[1523]|0)){e=ta(64)|0;if((e|0)==(-1|0)){k=0;i=d;return k|0}else{c[1524]=ta(0)|0;c[1523]=6088;c[1522]=6088;c[1527]=6104;c[1526]=6104;k=e+16|0;a[e+15>>0]=-86;j=c[1527]|0;c[1527]=k;c[k>>2]=6104;c[e+20>>2]=j;c[j>>2]=k;j=e+24|0;k=c[1523]|0;c[1523]=j;c[j>>2]=6088;c[e+28>>2]=k;c[k>>2]=j;break}}while(0);e=b+40&-32;h=c[1524]|0;g=c[1522]|0;k=6092|0;while(1){f=c[k>>2]|0;b=f+ -8|0;k=c[f+ -4>>2]|0;if((k|0)==6104)j=h;else j=k;j=j-b|0;if(e>>>0>>0){h=12;break}if((f|0)==(g|0)){h=10;break}k=f+4|0;if((e|0)==(j|0)){h=15;break}}do if((h|0)==10)if((ta(e+32-j|0)|0)==(-1|0)){k=0;i=d;return k|0}else{c[1524]=ta(0)|0;k=c[g+ -4>>2]|0;f=g;h=12;break}else if((h|0)==15){j=c[f>>2]|0;k=c[k>>2]|0;c[j+4>>2]=k;c[k>>2]=j}while(0);if((h|0)==12){h=b+e|0;c[f+ -4>>2]=h;c[h>>2]=b;c[b+(e|4)>>2]=k;c[k>>2]=h;h=b+(e|8)|0;k=f+4|0;j=c[k>>2]|0;c[k>>2]=h;c[h>>2]=f;c[b+(e|12)>>2]=j;c[j>>2]=h;a[b+(e+ -1)>>0]=-86;j=c[f>>2]|0;k=c[k>>2]|0;c[j+4>>2]=k;c[k>>2]=j}a[b+ -1>>0]=85;k=f;i=d;return k|0}function Td(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;if(!b){i=d;return}g=b+ -8|0;e=c[1523]|0;c[1523]=b;c[b>>2]=6088;f=b+4|0;c[f>>2]=e;c[e>>2]=b;a[b+ -9>>0]=-86;e=c[g>>2]|0;if((e|0)!=6104?(a[e+ -1>>0]|0)==-86:0){g=c[b+ -4>>2]|0;c[e+4>>2]=g;c[g>>2]=e;b=c[b>>2]|0;g=c[f>>2]|0;c[b+4>>2]=g;c[g>>2]=b}else e=g;b=c[e+4>>2]|0;if((b|0)==6104){i=d;return}if((a[b+ -1>>0]|0)!=-86){i=d;return}g=c[b>>2]|0;h=c[b+4>>2]|0;c[g+4>>2]=h;c[h>>2]=g;h=e+8|0;g=c[h>>2]|0;j=e+12|0;f=c[j>>2]|0;c[g+4>>2]=f;c[f>>2]=g;f=b+8|0;g=b+12|0;e=c[g>>2]|0;c[g>>2]=h;c[h>>2]=f;c[j>>2]=e;c[e>>2]=h;f=c[f>>2]|0;g=c[g>>2]|0;c[f+4>>2]=g;c[g>>2]=f;i=d;return}function Ud(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;do if(a){if(!b){Td(a);e=0;break}e=Sd(b)|0;if(!e)e=0;else{f=(c[a+ -4>>2]|0)-a+ -1|0;ce(e|0,a|0,(f>>>0>b>>>0?b:f)|0)|0;Td(a)}}else e=Sd(b)|0;while(0);i=d;return e|0}function Vd(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;f=i;if(!d){h=0;i=f;return h|0}while(1){g=a[b>>0]|0;h=a[c>>0]|0;if(g<<24>>24!=h<<24>>24)break;d=d+ -1|0;if(!d){b=0;e=5;break}else{b=b+1|0;c=c+1|0}}if((e|0)==5){i=f;return b|0}h=(g&255)-(h&255)|0;i=f;return h|0}function Wd(){}function Xd(a){a=a|0;return(a&255)<<24|(a>>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function Yd(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>c;return a>>>c|(b&(1<>c-32|0}function Zd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;b=b-d-(c>>>0>a>>>0|0)>>>0;return(D=b,a-c>>>0|0)|0}function _d(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return(D=b+d+(c>>>0>>0|0)>>>0,c|0)|0}function $d(b){b=b|0;var c=0;c=b;while(a[c>>0]|0)c=c+1|0;return c-b|0}function ae(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;i=b&3;h=d|d<<8|d<<16|d<<24;g=f&~3;if(i){i=b+4-i|0;while((b|0)<(i|0)){a[b>>0]=d;b=b+1|0}}while((b|0)<(g|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 be(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b<>>32-c;return a<=4096)return ua(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 de(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>>c;return a>>>c|(b&(1<>>c-32|0}function ee(b){b=b|0;var c=0;c=a[n+(b>>>24)>>0]|0;if((c|0)<8)return c|0;c=a[n+(b>>16&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>8&255)>>0]|0;if((c|0)<8)return c+16|0;return(a[n+(b&255)>>0]|0)+24|0}function fe(b){b=b|0;var c=0;c=a[m+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return(a[m+(b>>>24)>>0]|0)+24|0}function ge(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;d=b&65535;c=$(d,f)|0;e=a>>>16;d=(c>>>16)+($(d,e)|0)|0;b=b>>>16;a=$(b,f)|0;return(D=(d>>>16)+($(b,e)|0)+(((d&65535)+a|0)>>>16)|0,d+a<<16|c&65535|0)|0}function he(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;f=c;a=ge(e,f)|0;c=D;return(D=($(b,f)|0)+($(d,e)|0)+c|c&0,a|0|0)|0}function ie(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return za[a&1](b|0,c|0,d|0)|0}function je(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;Aa[a&3](b|0,c|0,d|0,e|0,f|0)}function ke(a,b){a=a|0;b=b|0;Ba[a&7](b|0)}function le(a,b,c){a=a|0;b=b|0;c=c|0;Ca[a&7](b|0,c|0)}function me(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return Da[a&1](b|0,c|0,d|0,e|0,f|0,g|0)|0}function ne(a,b,c,d,e,f,g,h,i,j,k,l,m){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;Ea[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0,l|0,m|0)}function oe(a,b){a=a|0;b=b|0;return Fa[a&3](b|0)|0}function pe(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Ga[a&7](b|0,c|0,d|0)}function qe(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;Ha[a&1](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0)}function re(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Ia[a&1](b|0,c|0,d|0,e|0)|0}function se(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;Ja[a&3](b|0,c|0,d|0,e|0,f|0,g|0)}function te(a,b,c){a=a|0;b=b|0;c=c|0;return Ka[a&1](b|0,c|0)|0}function ue(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return La[a&1](b|0,c|0,d|0,e|0,f|0)|0}function ve(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;Ma[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0)}function we(a,b,c){a=a|0;b=b|0;c=c|0;aa(0);return 0}function xe(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;aa(1)}function ye(a){a=a|0;aa(2)}function ze(a,b){a=a|0;b=b|0;aa(3)}function Ae(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(4);return 0}function Be(a,b,c,d,e,f,g,h,i,j,k,l){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;aa(5)}function Ce(a){a=a|0;aa(6);return 0}function De(a,b,c){a=a|0;b=b|0;c=c|0;aa(7)}function Ee(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;aa(8)}function Fe(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aa(9);return 0}function Ge(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(10)}function He(a,b){a=a|0;b=b|0;aa(11);return 0}function Ie(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;aa(12);return 0}function Je(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;aa(13)} +function ic(a,c,d){a=a|0;c=c|0;d=d|0;var f=0,g=0,h=0,j=0,k=0;f=i;c=1<<(c<<16>>16);if(d){d=c+ -1|0;if((d|0)<=0){i=f;return}g=(c|0)>0;h=0;do{if(g){j=0;do{k=a+(j+c<<1)|0;b[k>>1]=(e[k>>1]|0)+(e[a+(j<<1)>>1]|0);j=j+1|0}while((j|0)!=(c|0))}a=a+(c<<1)|0;h=h+1|0}while((h|0)!=(d|0));i=f;return}if((c|0)<=0){i=f;return}d=(c|0)>1;h=0;while(1){if(d){j=b[a>>1]|0;g=1;do{k=a+(g<<1)|0;j=(e[k>>1]|0)+(j&65535)&65535;b[k>>1]=j;g=g+1|0}while((g|0)!=(c|0))}h=h+1|0;if((h|0)==(c|0))break;else a=a+(c<<1)|0}i=f;return}function jc(a){a=a|0;var c=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;c=i;e=0;d=a;while(1){p=b[d>>1]|0;m=d+16|0;n=b[m>>1]|0;g=n+p|0;f=d+24|0;o=b[f>>1]|0;l=o+n|0;j=p-o|0;h=d+8|0;k=(b[h>>1]|0)*74|0;o=((p-n+o|0)*74|0)+64|0;n=o>>7;if((n+32768|0)>>>0>65535)n=o>>31^32767;b[m>>1]=n;m=(g*29|0)+64+(l*55|0)+k|0;n=m>>7;if((n+32768|0)>>>0>65535)n=m>>31^32767;b[d>>1]=n;l=($(l,-29)|0)+64+(j*55|0)+k|0;m=l>>7;if((m+32768|0)>>>0>65535)m=l>>31^32767;b[h>>1]=m;g=(g*55|0)+64+(j*29|0)-k|0;h=g>>7;if((h+32768|0)>>>0>65535)h=g>>31^32767;b[f>>1]=h;e=e+1|0;if((e|0)==4){d=0;break}else d=d+2|0}while(1){p=b[a>>1]|0;l=a+4|0;m=b[l>>1]|0;g=m+p|0;e=a+6|0;n=b[e>>1]|0;k=n+m|0;h=p-n|0;f=a+2|0;j=(b[f>>1]|0)*74|0;n=((p-m+n|0)*74|0)+2048|0;m=n>>12;if((m+32768|0)>>>0>65535)m=n>>31^32767;b[l>>1]=m;l=(g*29|0)+2048+(k*55|0)+j|0;m=l>>12;if((m+32768|0)>>>0>65535)m=l>>31^32767;b[a>>1]=m;k=($(k,-29)|0)+2048+(h*55|0)+j|0;l=k>>12;if((l+32768|0)>>>0>65535)l=k>>31^32767;b[f>>1]=l;f=(g*55|0)+2048+(h*29|0)-j|0;g=f>>12;if((g+32768|0)>>>0>65535)g=f>>31^32767;b[e>>1]=g;d=d+1|0;if((d|0)==4)break;else a=a+8|0}i=c;return}function kc(a,c){a=a|0;c=c|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;c=i;f=0;e=a;while(1){l=b[e>>1]<<6;j=e+16|0;k=b[j>>1]<<6;g=k+l|0;k=l-k|0;l=e+8|0;m=b[l>>1]|0;d=e+24|0;n=b[d>>1]|0;h=(n*36|0)+(m*83|0)|0;m=($(n,-83)|0)+(m*36|0)|0;n=g+64+h|0;o=n>>7;if((o+32768|0)>>>0>65535)o=n>>31^32767;b[e>>1]=o;o=k+64+m|0;n=o>>7;if((n+32768|0)>>>0>65535)n=o>>31^32767;b[l>>1]=n;l=k-m+64|0;k=l>>7;if((k+32768|0)>>>0>65535)k=l>>31^32767;b[j>>1]=k;h=g-h+64|0;g=h>>7;if((g+32768|0)>>>0>65535)g=h>>31^32767;b[d>>1]=g;f=f+1|0;if((f|0)==4){e=0;break}else e=e+2|0}while(1){k=b[a>>1]<<6;h=a+4|0;l=b[h>>1]<<6;g=l+k|0;l=k-l|0;k=a+2|0;j=b[k>>1]|0;d=a+6|0;m=b[d>>1]|0;f=(m*36|0)+(j*83|0)|0;j=($(m,-83)|0)+(j*36|0)|0;m=g+2048+f|0;n=m>>12;if((n+32768|0)>>>0>65535)n=m>>31^32767;b[a>>1]=n;m=l+2048+j|0;n=m>>12;if((n+32768|0)>>>0>65535)n=m>>31^32767;b[k>>1]=n;k=l-j+2048|0;j=k>>12;if((j+32768|0)>>>0>65535)j=k>>31^32767;b[h>>1]=j;f=g-f+2048|0;g=f>>12;if((g+32768|0)>>>0>65535)g=f>>31^32767;b[d>>1]=g;e=e+1|0;if((e|0)==4)break;else a=a+8|0}i=c;return}function lc(d,e){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;h=i;i=i+64|0;j=h+48|0;p=h+32|0;f=h+16|0;g=h;q=(e|0)>8;r=e+4|0;k=j+4|0;l=j+8|0;m=j+12|0;o=0;r=(r|0)>8?8:r;n=d;while(1){c[p+0>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;w=(r|0)>1;s=0;do{if(w){t=p+(s<<2)|0;v=c[t>>2]|0;u=1;do{v=($(b[n+(u<<3<<1)>>1]|0,a[1664+(u<<2<<5)+s>>0]|0)|0)+v|0;u=u+2|0}while((u|0)<(r|0));c[t>>2]=v}s=s+1|0}while((s|0)!=4);v=b[n>>1]<<6;u=b[n+64>>1]<<6;w=u+v|0;u=v-u|0;v=b[n+32>>1]|0;t=b[n+96>>1]|0;s=(t*36|0)+(v*83|0)|0;v=($(t,-83)|0)+(v*36|0)|0;t=s+w|0;c[j>>2]=t;c[k>>2]=v+u;c[l>>2]=u-v;c[m>>2]=w-s;s=0;while(1){u=c[p+(s<<2)>>2]|0;v=t+64+u|0;w=v>>7;if((w+32768|0)>>>0>65535)w=v>>31^32767;b[n+(s<<3<<1)>>1]=w;t=t-u+64|0;u=t>>7;if((u+32768|0)>>>0>65535)u=t>>31^32767;b[n+(7-s<<3<<1)>>1]=u;s=s+1|0;if((s|0)==4)break;t=c[j+(s<<2)>>2]|0}if((r|0)<8)r=(o&3|0)==0&(o|0)!=0?r+ -4|0:r;o=o+1|0;if((o|0)==8)break;else n=n+2|0}j=q?8:e;n=(j|0)>1;k=f+4|0;l=f+8|0;m=f+12|0;o=0;while(1){c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;e=0;do{if(n){r=g+(e<<2)|0;p=c[r>>2]|0;q=1;do{p=($(b[d+(q<<1)>>1]|0,a[1664+(q<<2<<5)+e>>0]|0)|0)+p|0;q=q+2|0}while((q|0)<(j|0));c[r>>2]=p}e=e+1|0}while((e|0)!=4);v=b[d>>1]<<6;u=b[d+8>>1]<<6;w=u+v|0;u=v-u|0;v=b[d+4>>1]|0;p=b[d+12>>1]|0;e=(p*36|0)+(v*83|0)|0;v=($(p,-83)|0)+(v*36|0)|0;p=e+w|0;c[f>>2]=p;c[k>>2]=v+u;c[l>>2]=u-v;c[m>>2]=w-e;e=0;while(1){q=c[g+(e<<2)>>2]|0;r=p+2048+q|0;s=r>>12;if((s+32768|0)>>>0>65535)s=r>>31^32767;b[d+(e<<1)>>1]=s;p=p-q+2048|0;q=p>>12;if((q+32768|0)>>>0>65535)q=p>>31^32767;b[d+(7-e<<1)>>1]=q;e=e+1|0;if((e|0)==4)break;p=c[f+(e<<2)>>2]|0}o=o+1|0;if((o|0)==8)break;else d=d+16|0}i=h;return}function mc(d,e){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;j=i;i=i+192|0;t=j+160|0;u=j+128|0;m=j+112|0;l=j+96|0;g=j+64|0;h=j+32|0;f=j+16|0;k=j;s=(e|0)>16;v=e+4|0;n=m+4|0;o=m+8|0;p=m+12|0;r=0;v=(v|0)>16?16:v;q=d;while(1){c[u+0>>2]=0;c[u+4>>2]=0;c[u+8>>2]=0;c[u+12>>2]=0;c[u+16>>2]=0;c[u+20>>2]=0;c[u+24>>2]=0;c[u+28>>2]=0;A=(v|0)>1;z=0;do{if(A){y=u+(z<<2)|0;w=c[y>>2]|0;x=1;do{w=($(b[q+(x<<4<<1)>>1]|0,a[1664+(x<<1<<5)+z>>0]|0)|0)+w|0;x=x+2|0}while((x|0)<(v|0));c[y>>2]=w}z=z+1|0}while((z|0)!=8);c[l+0>>2]=0;c[l+4>>2]=0;c[l+8>>2]=0;c[l+12>>2]=0;z=0;do{x=l+(z<<2)|0;w=c[x>>2]|0;y=1;do{w=($(b[q+(y<<5<<1)>>1]|0,a[1664+(y<<2<<5)+z>>0]|0)|0)+w|0;y=y+2|0}while((y|0)<8);c[x>>2]=w;z=z+1|0}while((z|0)!=4);z=b[q>>1]<<6;y=b[q+256>>1]<<6;A=y+z|0;y=z-y|0;z=b[q+128>>1]|0;w=b[q+384>>1]|0;x=(w*36|0)+(z*83|0)|0;z=($(w,-83)|0)+(z*36|0)|0;w=x+A|0;c[m>>2]=w;c[n>>2]=z+y;c[o>>2]=y-z;c[p>>2]=A-x;x=0;while(1){A=c[l+(x<<2)>>2]|0;c[t+(x<<2)>>2]=A+w;c[t+(7-x<<2)>>2]=w-A;x=x+1|0;if((x|0)==4){w=0;break}w=c[m+(x<<2)>>2]|0}do{x=c[t+(w<<2)>>2]|0;y=c[u+(w<<2)>>2]|0;A=x+64+y|0;z=A>>7;if((z+32768|0)>>>0>65535)z=A>>31^32767;b[q+(w<<4<<1)>>1]=z;x=x-y+64|0;y=x>>7;if((y+32768|0)>>>0>65535)y=x>>31^32767;b[q+(15-w<<4<<1)>>1]=y;w=w+1|0}while((w|0)!=8);if((v|0)<16)v=(r&3|0)==0&(r|0)!=0?v+ -4|0:v;r=r+1|0;if((r|0)==16)break;else q=q+2|0}o=s?16:e;p=(o|0)>1;l=f+4|0;m=f+8|0;n=f+12|0;q=0;while(1){c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[h+16>>2]=0;c[h+20>>2]=0;c[h+24>>2]=0;c[h+28>>2]=0;r=0;do{if(p){e=h+(r<<2)|0;t=c[e>>2]|0;s=1;do{t=($(b[d+(s<<1)>>1]|0,a[1664+(s<<1<<5)+r>>0]|0)|0)+t|0;s=s+2|0}while((s|0)<(o|0));c[e>>2]=t}r=r+1|0}while((r|0)!=8);c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;t=0;do{r=k+(t<<2)|0;s=c[r>>2]|0;e=1;do{s=($(b[d+(e<<1<<1)>>1]|0,a[1664+(e<<2<<5)+t>>0]|0)|0)+s|0;e=e+2|0}while((e|0)<8);c[r>>2]=s;t=t+1|0}while((t|0)!=4);z=b[d>>1]<<6;y=b[d+16>>1]<<6;A=y+z|0;y=z-y|0;z=b[d+8>>1]|0;r=b[d+24>>1]|0;e=(r*36|0)+(z*83|0)|0;z=($(r,-83)|0)+(z*36|0)|0;r=e+A|0;c[f>>2]=r;c[l>>2]=z+y;c[m>>2]=y-z;c[n>>2]=A-e;e=0;while(1){A=c[k+(e<<2)>>2]|0;c[g+(e<<2)>>2]=A+r;c[g+(7-e<<2)>>2]=r-A;e=e+1|0;if((e|0)==4){r=0;break}r=c[f+(e<<2)>>2]|0}do{e=c[g+(r<<2)>>2]|0;s=c[h+(r<<2)>>2]|0;u=e+2048+s|0;t=u>>12;if((t+32768|0)>>>0>65535)t=u>>31^32767;b[d+(r<<1)>>1]=t;e=e-s+2048|0;s=e>>12;if((s+32768|0)>>>0>65535)s=e>>31^32767;b[d+(15-r<<1)>>1]=s;r=r+1|0}while((r|0)!=8);q=q+1|0;if((q|0)==16)break;else d=d+32|0}i=j;return}function nc(d,e){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;m=i;i=i+320|0;g=m+256|0;l=m+192|0;o=m+160|0;s=m+128|0;u=m+112|0;t=m+96|0;f=m+64|0;j=m+32|0;h=m+16|0;k=m;q=(e|0)>32;x=e+4|0;v=u+4|0;w=u+8|0;n=u+12|0;p=0;x=(x|0)>32?32:x;r=d;while(1){y=l+0|0;z=y+64|0;do{c[y>>2]=0;y=y+4|0}while((y|0)<(z|0));B=(x|0)>1;A=0;do{if(B){z=l+(A<<2)|0;y=c[z>>2]|0;C=1;do{y=($(b[r+(C<<5<<1)>>1]|0,a[1664+(C<<5)+A>>0]|0)|0)+y|0;C=C+2|0}while((C|0)<(x|0));c[z>>2]=y}A=A+1|0}while((A|0)!=16);c[s+0>>2]=0;c[s+4>>2]=0;c[s+8>>2]=0;c[s+12>>2]=0;c[s+16>>2]=0;c[s+20>>2]=0;c[s+24>>2]=0;c[s+28>>2]=0;y=(x|0)/2|0;z=(x|0)>3;A=0;do{if(z){D=s+(A<<2)|0;B=c[D>>2]|0;C=1;do{B=($(b[r+(C<<6<<1)>>1]|0,a[1664+(C<<1<<5)+A>>0]|0)|0)+B|0;C=C+2|0}while((C|0)<(y|0));c[D>>2]=B}A=A+1|0}while((A|0)!=8);c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;A=0;do{B=t+(A<<2)|0;z=c[B>>2]|0;y=1;do{z=($(b[r+(y<<7<<1)>>1]|0,a[1664+(y<<2<<5)+A>>0]|0)|0)+z|0;y=y+2|0}while((y|0)<8);c[B>>2]=z;A=A+1|0}while((A|0)!=4);C=b[r>>1]<<6;B=b[r+1024>>1]<<6;D=B+C|0;B=C-B|0;C=b[r+512>>1]|0;y=b[r+1536>>1]|0;z=(y*36|0)+(C*83|0)|0;C=($(y,-83)|0)+(C*36|0)|0;y=z+D|0;c[u>>2]=y;c[v>>2]=C+B;c[w>>2]=B-C;c[n>>2]=D-z;z=0;while(1){D=c[t+(z<<2)>>2]|0;c[o+(z<<2)>>2]=D+y;c[o+(7-z<<2)>>2]=y-D;z=z+1|0;if((z|0)==4){y=0;break}y=c[u+(z<<2)>>2]|0}do{C=c[o+(y<<2)>>2]|0;D=c[s+(y<<2)>>2]|0;c[g+(y<<2)>>2]=D+C;c[g+(15-y<<2)>>2]=C-D;y=y+1|0}while((y|0)!=8);y=0;do{z=c[g+(y<<2)>>2]|0;A=c[l+(y<<2)>>2]|0;B=z+64+A|0;C=B>>7;if((C+32768|0)>>>0>65535)C=B>>31^32767;b[r+(y<<5<<1)>>1]=C;z=z-A+64|0;A=z>>7;if((A+32768|0)>>>0>65535)A=z>>31^32767;b[r+(31-y<<5<<1)>>1]=A;y=y+1|0}while((y|0)!=16);if((x|0)<32)x=(p&3|0)==0&(p|0)!=0?x+ -4|0:x;p=p+1|0;if((p|0)==32)break;else r=r+2|0}p=q?32:e;o=(p|0)>1;n=(p|0)/2|0;q=(p|0)>3;s=h+4|0;r=h+8|0;e=h+12|0;t=0;while(1){y=l+0|0;z=y+64|0;do{c[y>>2]=0;y=y+4|0}while((y|0)<(z|0));v=0;do{if(o){w=l+(v<<2)|0;u=c[w>>2]|0;x=1;do{u=($(b[d+(x<<1)>>1]|0,a[1664+(x<<5)+v>>0]|0)|0)+u|0;x=x+2|0}while((x|0)<(p|0));c[w>>2]=u}v=v+1|0}while((v|0)!=16);c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[j+16>>2]=0;c[j+20>>2]=0;c[j+24>>2]=0;c[j+28>>2]=0;x=0;do{if(q){u=j+(x<<2)|0;w=c[u>>2]|0;v=1;do{D=v<<1;w=($(b[d+(D<<1)>>1]|0,a[1664+(D<<5)+x>>0]|0)|0)+w|0;v=v+2|0}while((v|0)<(n|0));c[u>>2]=w}x=x+1|0}while((x|0)!=8);c[k+0>>2]=0;c[k+4>>2]=0;c[k+8>>2]=0;c[k+12>>2]=0;u=0;do{v=k+(u<<2)|0;x=c[v>>2]|0;w=1;do{D=w<<2;x=($(b[d+(D<<1)>>1]|0,a[1664+(D<<5)+u>>0]|0)|0)+x|0;w=w+2|0}while((w|0)<8);c[v>>2]=x;u=u+1|0}while((u|0)!=4);C=b[d>>1]<<6;B=b[d+32>>1]<<6;D=B+C|0;B=C-B|0;C=b[d+16>>1]|0;u=b[d+48>>1]|0;v=(u*36|0)+(C*83|0)|0;C=($(u,-83)|0)+(C*36|0)|0;u=v+D|0;c[h>>2]=u;c[s>>2]=C+B;c[r>>2]=B-C;c[e>>2]=D-v;v=0;while(1){D=c[k+(v<<2)>>2]|0;c[f+(v<<2)>>2]=D+u;c[f+(7-v<<2)>>2]=u-D;v=v+1|0;if((v|0)==4){u=0;break}u=c[h+(v<<2)>>2]|0}do{C=c[f+(u<<2)>>2]|0;D=c[j+(u<<2)>>2]|0;c[g+(u<<2)>>2]=D+C;c[g+(15-u<<2)>>2]=C-D;u=u+1|0}while((u|0)!=8);u=0;do{v=c[g+(u<<2)>>2]|0;w=c[l+(u<<2)>>2]|0;x=v+2048+w|0;y=x>>12;if((y+32768|0)>>>0>65535)y=x>>31^32767;b[d+(u<<1)>>1]=y;v=v-w+2048|0;w=v>>12;if((w+32768|0)>>>0>65535)w=v>>31^32767;b[d+(31-u<<1)>>1]=w;u=u+1|0}while((u|0)!=16);t=t+1|0;if((t|0)==32)break;else d=d+64|0}i=m;return}function oc(a){a=a|0;var c=0,d=0,e=0,f=0;c=i;d=((((b[a>>1]|0)+1|0)>>>1)+32|0)>>>6&65535;e=0;do{f=e<<2;b[a+(f<<1)>>1]=d;b[a+((f|1)<<1)>>1]=d;b[a+((f|2)<<1)>>1]=d;b[a+((f|3)<<1)>>1]=d;e=e+1|0}while((e|0)!=4);i=c;return}function pc(a){a=a|0;var c=0,d=0,e=0,f=0;c=i;d=((((b[a>>1]|0)+1|0)>>>1)+32|0)>>>6&65535;e=0;do{f=e<<3;b[a+(f<<1)>>1]=d;b[a+((f|1)<<1)>>1]=d;b[a+((f|2)<<1)>>1]=d;b[a+((f|3)<<1)>>1]=d;b[a+((f|4)<<1)>>1]=d;b[a+((f|5)<<1)>>1]=d;b[a+((f|6)<<1)>>1]=d;b[a+((f|7)<<1)>>1]=d;e=e+1|0}while((e|0)!=8);i=c;return}function qc(a){a=a|0;var c=0,d=0,e=0,f=0,g=0;c=i;e=((((b[a>>1]|0)+1|0)>>>1)+32|0)>>>6&65535;d=0;do{f=d<<4;g=0;do{b[a+(g+f<<1)>>1]=e;g=g+1|0}while((g|0)!=16);d=d+1|0}while((d|0)!=16);i=c;return}function rc(a){a=a|0;var c=0,d=0,e=0,f=0,g=0;c=i;e=((((b[a>>1]|0)+1|0)>>>1)+32|0)>>>6&65535;d=0;do{f=d<<5;g=0;do{b[a+(g+f<<1)>>1]=e;g=g+1|0}while((g|0)!=32);d=d+1|0}while((d|0)!=32);i=c;return}function sc(e,f,g,h,j,k,l,m,n){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0,q=0;o=i;i=i+128|0;k=o;q=k+0|0;p=q+128|0;do{c[q>>2]=0;q=q+4|0}while((q|0)<(p|0));q=d[j+n+96>>0]|0;c[k+((q&31)<<2)>>2]=b[j+(n*10|0)+114>>1];c[k+((q+1&31)<<2)>>2]=b[j+(n*10|0)+116>>1];c[k+((q+2&31)<<2)>>2]=b[j+(n*10|0)+118>>1];c[k+((q+3&31)<<2)>>2]=b[j+(n*10|0)+120>>1];if((m|0)<=0){i=o;return}n=(l|0)>0;j=0;while(1){if(n){p=0;do{q=d[f+p>>0]|0;q=q+(c[k+(q>>>3<<2)>>2]|0)|0;if(q>>>0>255)q=0-q>>31;a[e+p>>0]=q;p=p+1|0}while((p|0)!=(l|0))}j=j+1|0;if((j|0)==(m|0))break;else{e=e+g|0;f=f+h|0}}i=o;return}function tc(e,f,g,h,j,k,l,m,n,o,p,q){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;var r=0,s=0,t=0,u=0;p=i;o=j+(n*10|0)+112|0;r=c[j+(n<<2)+100>>2]|0;if((r|0)!=1){if(c[k>>2]|0){q=b[o>>1]|0;if((m|0)>0){s=0;do{t=(d[f+($(s,h)|0)>>0]|0)+q|0;if(t>>>0>255)t=0-t>>31;a[e+($(s,g)|0)>>0]=t;s=s+1|0}while((s|0)!=(m|0));q=1}else q=1}else q=0;if(c[k+8>>2]|0){s=b[o>>1]|0;l=l+ -1|0;if((m|0)>0){t=0;do{u=(d[f+(($(t,h)|0)+l)>>0]|0)+s|0;if(u>>>0>255)u=0-u>>31;a[e+(($(t,g)|0)+l)>>0]=u;t=t+1|0}while((t|0)!=(m|0))}}if(!r){s=m;t=q;u=0;r=l;Bc(e,f,g,h,j,r,s,n,t,u);i=p;return}}else q=0;if(c[k+4>>2]|0){r=b[o>>1]|0;if((q|0)<(l|0)){s=q;do{t=(d[f+s>>0]|0)+r|0;if(t>>>0>255)t=0-t>>31;a[e+s>>0]=t;s=s+1|0}while((s|0)!=(l|0));r=1}else r=1}else r=0;if(!(c[k+12>>2]|0)){s=m;t=q;u=r;r=l;Bc(e,f,g,h,j,r,s,n,t,u);i=p;return}k=b[o>>1]|0;o=m+ -1|0;t=$(o,g)|0;m=$(o,h)|0;if((q|0)<(l|0))s=q;else{s=o;t=q;u=r;r=l;Bc(e,f,g,h,j,r,s,n,t,u);i=p;return}do{u=(d[f+(s+m)>>0]|0)+k|0;if(u>>>0>255)u=0-u>>31;a[e+(s+t)>>0]=u;s=s+1|0}while((s|0)!=(l|0));Bc(e,f,g,h,j,l,o,n,q,r);i=p;return}function uc(e,f,g,h,j,k,l,m,n,o,p,q){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;p=p|0;q=q|0;var 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;s=i;C=j+(n*10|0)+112|0;B=c[j+(n<<2)+100>>2]|0;A=(B|0)!=1;if(A){if(c[k>>2]|0){D=b[C>>1]|0;if((m|0)>0){E=0;do{G=(d[f+($(E,h)|0)>>0]|0)+D|0;if(G>>>0>255)G=0-G>>31;a[e+($(E,g)|0)>>0]=G;E=E+1|0}while((E|0)!=(m|0));D=1}else D=1}else D=0;if(c[k+8>>2]|0){E=b[C>>1]|0;l=l+ -1|0;if((m|0)>0){G=0;do{H=(d[f+(($(G,h)|0)+l)>>0]|0)+E|0;if(H>>>0>255)H=0-H>>31;a[e+(($(G,g)|0)+l)>>0]=H;G=G+1|0}while((G|0)!=(m|0))}}if(!B){C=1;E=0}else F=13}else{D=0;F=13}if((F|0)==13){if(c[k+4>>2]|0){F=b[C>>1]|0;if((D|0)<(l|0)){E=D;do{G=(d[f+E>>0]|0)+F|0;if(G>>>0>255)G=0-G>>31;a[e+E>>0]=G;E=E+1|0}while((E|0)!=(l|0));E=1}else E=1}else E=0;if(c[k+12>>2]|0){C=b[C>>1]|0;m=m+ -1|0;G=$(m,g)|0;H=$(m,h)|0;if((D|0)<(l|0)){F=D;do{I=(d[f+(F+H)>>0]|0)+C|0;if(I>>>0>255)I=0-I>>31;a[e+(F+G)>>0]=I;F=F+1|0}while((F|0)!=(l|0));C=0}else C=0}else C=0}Bc(e,f,g,h,j,l,m,n,D,E);j=(B|0)==2;if((a[q>>0]|0)==0&j?(c[k>>2]|0)==0:0)n=(c[k+4>>2]|0)==0;else n=0;H=n&1;n=q+1|0;B=(B|0)==3;if((a[n>>0]|0)==0&B?(c[k+4>>2]|0)==0:0)F=(c[k+8>>2]|0)==0;else F=0;J=F&1;F=q+2|0;if((a[F>>0]|0)==0&j?(c[k+8>>2]|0)==0:0)G=(c[k+12>>2]|0)==0;else G=0;I=G&1;G=q+3|0;if((a[G>>0]|0)==0&B?(c[k>>2]|0)==0:0)k=(c[k+12>>2]|0)==0;else k=0;k=k&1;A=A^1;if(!((a[o>>0]|0)==0|A)?(z=H+E|0,y=m-k|0,(z|0)<(y|0)):0)do{a[e+($(z,g)|0)>>0]=a[f+($(z,h)|0)>>0]|0;z=z+1|0}while((z|0)!=(y|0));if(!((a[o+1>>0]|0)==0|A)?(x=J+E|0,w=m-I|0,(x|0)<(w|0)):0){o=l+ -1|0;do{a[e+(o+($(x,g)|0))>>0]=a[f+(o+($(x,h)|0))>>0]|0;x=x+1|0}while((x|0)!=(w|0))}if(!((a[p>>0]|0)==0|C)?(v=H+D|0,u=l-J|0,(v|0)<(u|0)):0)do{a[e+v>>0]=a[f+v>>0]|0;v=v+1|0}while((v|0)!=(u|0));if(!((a[p+1>>0]|0)==0|C)?(t=k+D|0,r=l-I|0,(t|0)<(r|0)):0){u=m+ -1|0;p=$(u,h)|0;u=$(u,g)|0;do{a[e+(t+u)>>0]=a[f+(t+p)>>0]|0;t=t+1|0}while((t|0)!=(r|0))}if((a[q>>0]|0)!=0&j)a[e>>0]=a[f>>0]|0;if((a[n>>0]|0)!=0&B){J=l+ -1|0;a[e+J>>0]=a[f+J>>0]|0}if((a[F>>0]|0)!=0&j){J=m+ -1|0;I=l+ -1|0;a[e+(I+($(J,g)|0))>>0]=a[f+(I+($(J,h)|0))>>0]|0}if(!((a[G>>0]|0)!=0&B)){i=s;return}J=m+ -1|0;a[e+($(J,g)|0)>>0]=a[f+($(J,h)|0)>>0]|0;i=s;return}function vc(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;g=i;Ac(a,b,1,c,d,e,f);i=g;return}function wc(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;g=i;Ac(a,1,b,c,d,e,f);i=g;return}function xc(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0;f=i;zc(a,b,1,c,d,e);i=f;return}function yc(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0;f=i;zc(a,1,b,c,d,e);i=f;return}function zc(b,e,f,g,h,j){b=b|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;m=i;l=$(e,-2)|0;k=0-e|0;n=0;while(1){p=c[g+(n<<2)>>2]|0;if((p|0)>=1){s=0-p|0;r=(a[h+n>>0]|0)==0;q=(a[j+n>>0]|0)==0;o=0;t=b;while(1){v=t+k|0;x=d[v>>0]|0;u=d[t>>0]|0;w=(d[t+l>>0]|0)+4-(d[t+e>>0]|0)+(u-x<<2)>>3;if((w|0)<(s|0))w=s;else w=(w|0)>(p|0)?p:w;if(r){x=w+x|0;if(x>>>0>255)x=0-x>>31;a[v>>0]=x}if(q){u=u-w|0;if(u>>>0>255)u=0-u>>31;a[t>>0]=u}o=o+1|0;if((o|0)==4)break;else t=t+f|0}}n=n+1|0;if((n|0)==2)break;else b=b+(f<<2)|0}i=m;return}function Ac(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,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,aa=0,ba=0;t=i;o=$(e,-3)|0;p=$(e,-2)|0;q=0-e|0;r=e<<1;D=f*3|0;B=D+o|0;C=D+p|0;A=D-e|0;E=D+r|0;l=D+e|0;y=g>>3;v=g>>2;n=$(e,-4)|0;s=e*3|0;w=D+n|0;x=(f+e|0)*3|0;u=(g>>1)+g>>3;z=f<<2;m=f<<2;F=0;do{U=a[b+o>>0]|0;T=a[b+p>>0]|0;S=a[b+q>>0]|0;J=S&255;N=(U&255)-((T&255)<<1)+J|0;N=(N|0)>-1?N:0-N|0;P=a[b+r>>0]|0;Q=a[b+e>>0]|0;R=a[b>>0]|0;X=R&255;V=(P&255)-((Q&255)<<1)+X|0;V=(V|0)>-1?V:0-V|0;_=d[b+A>>0]|0;M=(d[b+B>>0]|0)-((d[b+C>>0]|0)<<1)+_|0;M=(M|0)>-1?M:0-M|0;Y=d[b+D>>0]|0;O=(d[b+E>>0]|0)-((d[b+l>>0]|0)<<1)+Y|0;O=(O|0)>-1?O:0-O|0;H=V+N|0;I=O+M|0;G=c[h+(F<<2)>>2]|0;W=a[j+F>>0]|0;L=a[k+F>>0]|0;do if((I+H|0)<(g|0)){Z=(G*5|0)+1>>1;aa=(d[b+n>>0]|0)-J|0;K=a[b+s>>0]|0;ba=(K&255)-X|0;if((((((((ba|0)>-1?ba:0-ba|0)+((aa|0)>-1?aa:0-aa|0)|0)<(y|0)?(ba=J-X|0,(((ba|0)>-1?ba:0-ba|0)|0)<(Z|0)):0)?(ba=(d[b+w>>0]|0)-_|0,aa=(d[b+x>>0]|0)-Y|0,(((aa|0)>-1?aa:0-aa|0)+((ba|0)>-1?ba:0-ba|0)|0)<(y|0)):0)?(ba=_-Y|0,(((ba|0)>-1?ba:0-ba|0)|0)<(Z|0)):0)?(H<<1|0)<(v|0):0)?(I<<1|0)<(v|0):0){G=G<<1;H=W<<24>>24==0;I=0-G|0;J=L<<24>>24==0;Y=K;K=1;L=b;while(1){V=L+o|0;U=U&255;W=L+p|0;T=T&255;X=L+q|0;N=S&255;R=R&255;S=L+e|0;Q=Q&255;M=L+r|0;O=P&255;P=Y&255;if(H){Y=d[L+n>>0]|0;Z=(U+4+Q+(N+T+R<<1)>>3)-N|0;if((Z|0)<(I|0))Z=I;else Z=(Z|0)>(G|0)?G:Z;a[X>>0]=Z+N;X=((U+2+T+N+R|0)>>>2)-T|0;if((X|0)<(I|0))X=I;else X=(X|0)>(G|0)?G:X;a[W>>0]=X+T;W=((U*3|0)+4+T+N+R+(Y<<1)>>3)-U|0;if((W|0)<(I|0))W=I;else W=(W|0)>(G|0)?G:W;a[V>>0]=W+U}if(J){T=(T+4+O+(R+N+Q<<1)>>3)-R|0;if((T|0)<(I|0))T=I;else T=(T|0)>(G|0)?G:T;a[L>>0]=T+R;T=((N+2+R+Q+O|0)>>>2)-Q|0;if((T|0)<(I|0))T=I;else T=(T|0)>(G|0)?G:T;a[S>>0]=T+Q;N=(N+4+R+Q+(O*3|0)+(P<<1)>>3)-O|0;if((N|0)<(I|0))N=I;else N=(N|0)>(G|0)?G:N;a[M>>0]=N+O}M=L+f|0;if((K|0)==4)break;U=a[L+(o+f)>>0]|0;T=a[L+(p+f)>>0]|0;S=a[L+(f-e)>>0]|0;R=a[M>>0]|0;Q=a[L+(f+e)>>0]|0;P=a[L+(r+f)>>0]|0;Y=a[L+(s+f)>>0]|0;K=K+1|0;L=M}b=b+m|0;break}H=G>>1;I=G*10|0;J=0-G|0;K=W<<24>>24!=0;L=L<<24>>24!=0;M=(M+N|0)<(u|0)&(K^1);N=0-H|0;O=(O+V|0)<(u|0)&(L^1);V=T;W=R;Y=Q;Q=1;R=b;while(1){X=U&255;T=R+p|0;V=V&255;_=R+q|0;Z=S&255;W=W&255;S=R+e|0;U=Y&255;P=P&255;Y=((W-Z|0)*9|0)+8+($(U-V|0,-3)|0)>>4;if((((Y|0)>-1?Y:0-Y|0)|0)<(I|0)){if((Y|0)<(J|0))Y=J;else Y=(Y|0)>(G|0)?G:Y;if(!K){aa=Y+Z|0;if(aa>>>0>255)aa=0-aa>>31;a[_>>0]=aa}if(!L){_=W-Y|0;if(_>>>0>255)_=0-_>>31;a[R>>0]=_}if(M){X=((X+1+Z|0)>>>1)-V+Y>>1;if((X|0)<(N|0))X=N;else X=(X|0)>(H|0)?H:X;V=X+V|0;if(V>>>0>255)V=0-V>>31;a[T>>0]=V}if(O){P=((W+1+P|0)>>>1)-U-Y>>1;if((P|0)<(N|0))P=N;else P=(P|0)>(H|0)?H:P;P=P+U|0;if(P>>>0>255)P=0-P>>31;a[S>>0]=P}}T=R+f|0;if((Q|0)==4)break;U=a[R+(o+f)>>0]|0;V=a[R+(p+f)>>0]|0;S=a[R+(f-e)>>0]|0;W=a[T>>0]|0;Y=a[R+(f+e)>>0]|0;P=a[R+(r+f)>>0]|0;Q=Q+1|0;R=T}b=b+m|0}else b=b+z|0;while(0);F=F+1|0}while((F|0)!=2);i=t;return}function Bc(e,f,g,h,j,k,l,m,n,o){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var 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;t=i;v=c[j+(m<<2)+100>>2]|0;q=a[2728+(v<<2)>>0]|0;r=a[2730+(v<<2)>>0]|0;if((o|0)>=(l|0)){i=t;return}u=(n|0)<(k|0);s=o;p=$((a[2729+(v<<2)>>0]|0)+o|0,h)|0;v=$((a[2731+(v<<2)>>0]|0)+o|0,h)|0;w=$(o,g)|0;o=$(o,h)|0;while(1){if(u){y=p+q|0;x=v+r|0;z=n;do{A=a[f+(z+o)>>0]|0;B=a[f+(y+z)>>0]|0;if((A&255)>(B&255))B=3;else B=((A<<24>>24!=B<<24>>24)<<31>>31)+2|0;C=a[f+(x+z)>>0]|0;if((A&255)>(C&255))C=1;else C=(A<<24>>24!=C<<24>>24)<<31>>31;A=(b[j+(m*10|0)+(d[2720+(C+B)>>0]<<1)+112>>1]|0)+(A&255)|0;if(A>>>0>255)A=0-A>>31;a[e+(z+w)>>0]=A;z=z+1|0}while((z|0)!=(k|0))}s=s+1|0;if((s|0)==(l|0))break;else{p=p+h|0;v=v+h|0;w=w+g|0;o=o+h|0}}i=t;return}function Cc(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;j=i;k=c[b+136>>2]|0;l=(c[b+200>>2]|0)+13080|0;r=(1<>2])+ -1|0;o=r&e;n=r&f;q=(n|0)!=0|(a[k+309>>0]|0)!=0;m=q&1;c[k+31296>>2]=m;p=(o|0)!=0|(a[k+308>>0]|0)!=0;b=p&1;c[k+31292>>2]=b;if(!(r&(f|e)))p=d[k+311>>0]|0;else p=p&q&1;c[k+31300>>2]=p;if((o+g|0)==(1<>2]|0))m=(a[k+310>>0]|0)!=0&(n|0)==0&1;c[k+31308>>2]=m;if(!m){q=0;q=q&1;r=k+31304|0;c[r>>2]=q;r=h+f|0;q=k+316|0;q=c[q>>2]|0;q=(r|0)<(q|0);q=q?b:0;r=k+31288|0;c[r>>2]=q;i=j;return}q=(g+e|0)<(c[k+312>>2]|0);q=q&1;r=k+31304|0;c[r>>2]=q;r=h+f|0;q=k+316|0;q=c[q>>2]|0;q=(r|0)<(q|0);q=q?b:0;r=k+31288|0;c[r>>2]=q;i=j;return}function Dc(b){b=b|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;f=i;i=i+16|0;e=f;h=c[b+136>>2]|0;g=h+204|0;j=td(13196)|0;c[e>>2]=j;if(!j){t=-12;i=f;return t|0}j=c[j+4>>2]|0;l=td(468)|0;if(!l){t=-12;i=f;return t|0}k=c[l+4>>2]|0;c[k+4>>2]=1;n=k+8|0;c[n>>2]=1;a[k>>0]=0;c[k+348>>2]=1;p=k+352|0;m=k+380|0;q=k+408|0;o=0;do{c[p+(o<<2)>>2]=1;c[m+(o<<2)>>2]=0;c[q+(o<<2)>>2]=-1;o=o+1|0}while((o|0)<(c[n>>2]|0));c[k+436>>2]=0;c[k+440>>2]=1;a[k+444>>0]=0;o=b+208|0;vd(o);c[o>>2]=l;c[j>>2]=0;o=j+72|0;c[o>>2]=1;t=_c(g,8)|0;p=j+4|0;c[p>>2]=t;do if((t|0)<=3){a[j+8>>0]=0;n=j+13120|0;c[n>>2]=cd(g,32)|0;k=cd(g,32)|0;m=j+13124|0;c[m>>2]=k;k=Qc(c[n>>2]|0,k,0,c[b+4>>2]|0)|0;if((k|0)>=0){t=_c(g,8)|0;l=j+52|0;c[l>>2]=t+8;if(!t){p=c[p>>2]|0;if((p|0)==2){c[j+60>>2]=4;p=4}else if(!p){c[j+60>>2]=8;p=8}else if((p|0)==1){c[j+60>>2]=0;p=0}else{c[j+60>>2]=5;p=5}c[j+56>>2]=0;p=Bd(p)|0;if(p){c[j+13180>>2]=0;c[j+13168>>2]=0;t=d[p+5>>0]|0;c[j+13172>>2]=t;c[j+13176>>2]=t;t=d[p+6>>0]|0;c[j+13184>>2]=t;c[j+13188>>2]=t;c[j+64>>2]=8;if((c[o>>2]|0)>0){p=j+76|0;q=0;do{c[p+(q*12|0)>>2]=1;c[p+(q*12|0)+4>>2]=0;c[p+(q*12|0)+8>>2]=-1;q=q+1|0}while((q|0)<(c[o>>2]|0))}s=(dd(g)|0)+3|0;t=j+13064|0;c[t>>2]=s;s=1<>2]=r+(c[n>>2]|0)&s;c[m>>2]=r+(c[m>>2]|0)&s;s=j+13068|0;c[s>>2]=dd(g)|0;r=j+13072|0;c[r>>2]=(dd(g)|0)+2;o=dd(g)|0;p=c[r>>2]|0;q=j+13076|0;c[q>>2]=p+o;if(p>>>0<(c[t>>2]|0)>>>0){p=j+13088|0;c[p>>2]=0;o=j+13092|0;c[o>>2]=dd(g)|0;a[j+12941>>0]=bd(g)|0;u=bd(g)|0;c[j+68>>2]=u;if(u){u=j+13044|0;a[u>>0]=(_c(g,4)|0)+1;a[j+13045>>0]=(_c(g,4)|0)+1;v=(dd(g)|0)+3|0;c[j+13048>>2]=v;c[j+13052>>2]=v+(dd(g)|0);if((d[u>>0]|0|0)>(c[l>>2]|0)){k=-1094995529;break}a[j+13056>>0]=bd(g)|0}c[j+2184>>2]=0;a[j+12942>>0]=0;a[j+13060>>0]=0;a[j+13061>>0]=bd(g)|0;c[j+160>>2]=0;c[j+164>>2]=1;if((bd(g)|0)!=0?(v=bd(g)|0,ad(g,7),(v|0)!=0):0){c[j+13096>>2]=bd(g)|0;c[j+13100>>2]=bd(g)|0;c[j+13104>>2]=bd(g)|0;c[j+13108>>2]=bd(g)|0;bd(g)|0;c[j+13112>>2]=bd(g)|0;bd(g)|0;c[j+13116>>2]=bd(g)|0;bd(g)|0}g=c[n>>2]|0;c[j+12>>2]=g;n=c[m>>2]|0;c[j+16>>2]=n;t=c[t>>2]|0;v=(c[s>>2]|0)+t|0;c[j+13080>>2]=v;s=t+ -1|0;c[j+13084>>2]=s;m=1<>v;c[j+13128>>2]=u;m=n+ -1+m>>v;c[j+13132>>2]=m;c[j+13136>>2]=$(m,u)|0;c[j+13140>>2]=g>>t;c[j+13144>>2]=n>>t;u=c[r>>2]|0;c[j+13148>>2]=g>>u;c[j+13152>>2]=n>>u;c[j+13156>>2]=g>>s;c[j+13160>>2]=n>>s;u=v-u|0;c[j+13164>>2]=(1<>2]=((c[l>>2]|0)*6|0)+ -48;t=(1<>>0>6):0)?(c[p>>2]|0)>>>0<=u>>>0:0)?(c[o>>2]|0)>>>0<=u>>>0:0)?(c[q>>2]|0)>>>0<=(v>>>0>5?5:v)>>>0:0)?((c[h+216>>2]|0)-(c[h+212>>2]|0)|0)>=0:0){g=b+272|0;h=c[g>>2]|0;if((h|0)!=0?(v=c[e>>2]|0,(Xd(c[h+4>>2]|0,c[v+4>>2]|0,c[v+8>>2]|0)|0)==0):0){vd(e);v=0;i=f;return v|0}else h=0;do{j=b+(h<<2)+400|0;k=c[j>>2]|0;do if(k){if(c[c[k+4>>2]>>2]|0)break;vd(j)}while(0);h=h+1|0}while((h|0)!=256);h=c[g>>2]|0;do if(h){j=b+200|0;if((c[j>>2]|0)!=(c[h+4>>2]|0))break;u=b+1424|0;vd(u);v=ud(c[g>>2]|0)|0;c[u>>2]=v;if(v)break;c[j>>2]=0}while(0);vd(g);c[g>>2]=c[e>>2];v=0;i=f;return v|0}}else k=-1094995529}else k=-22}else k=-1094995529}}else k=-1094995529;while(0);vd(e);v=k;i=f;return v|0}function Ec(b){b=b|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,E=0,F=0,G=0,H=0,I=0;f=i;i=i+16|0;e=f+4|0;j=f;l=b+136|0;g=c[l>>2]|0;n=g+204|0;h=md(1692)|0;c[j>>2]=h;if(!h){I=-12;i=f;return I|0}I=qd(h,1692,6,0,0)|0;c[e>>2]=I;if(!I){jd(j);I=-12;i=f;return I|0}a[(c[j>>2]|0)+53>>0]=1;h=c[j>>2]|0;c[h+44>>2]=1;c[h+48>>2]=1;a[h+52>>0]=1;a[(c[j>>2]|0)+57>>0]=0;h=c[j>>2]|0;c[h+60>>2]=0;c[h+64>>2]=0;a[h+1629>>0]=2;h=dd(n)|0;a:do if((h>>>0<=255?(k=dd(n)|0,c[c[j>>2]>>2]=k,k>>>0<=31):0)?(m=c[b+(k<<2)+272>>2]|0,(m|0)!=0):0){k=c[m+4>>2]|0;I=(bd(n)|0)&255;a[(c[j>>2]|0)+41>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+39>>0]=I;I=_c(n,3)|0;c[(c[j>>2]|0)+1624>>2]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+4>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+5>>0]=I;I=(dd(n)|0)+1|0;c[(c[j>>2]|0)+8>>2]=I;I=(dd(n)|0)+1|0;c[(c[j>>2]|0)+12>>2]=I;I=ed(n)|0;c[(c[j>>2]|0)+16>>2]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+20>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+21>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+22>>0]=I;I=c[j>>2]|0;c[I+24>>2]=0;if(a[I+22>>0]|0){I=dd(n)|0;c[(c[j>>2]|0)+24>>2]=I}I=ed(n)|0;c[(c[j>>2]|0)+28>>2]=I;if((I+12|0)>>>0<=24?(I=ed(n)|0,c[(c[j>>2]|0)+32>>2]=I,(I+12|0)>>>0<=24):0){I=(bd(n)|0)&255;a[(c[j>>2]|0)+36>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+37>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+38>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+40>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+42>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+43>>0]=I;if(a[(c[j>>2]|0)+42>>0]|0){m=(dd(n)|0)+1|0;c[(c[j>>2]|0)+44>>2]=m;m=(dd(n)|0)+1|0;o=c[j>>2]|0;c[o+48>>2]=m;o=c[o+44>>2]|0;if(!o){b=-1094995529;break}if((m|0)==0?1:(o|0)>=(c[k+13120>>2]|0)){b=-1094995529;break}if((m|0)>=(c[k+13124>>2]|0)){b=-1094995529;break}m=od(o,4)|0;c[(c[j>>2]|0)+1648>>2]=m;m=od(c[(c[j>>2]|0)+48>>2]|0,4)|0;c[(c[j>>2]|0)+1652>>2]=m;m=c[j>>2]|0;if(!(c[m+1648>>2]|0)){b=-12;break}if(!(c[m+1652>>2]|0)){b=-12;break}p=(bd(n)|0)&255;a[(c[j>>2]|0)+52>>0]=p;p=c[j>>2]|0;if(!(a[p+52>>0]|0)){q=(c[p+44>>2]|0)+ -1|0;if((q|0)>0){o=0;m=0;r=0;do{q=(dd(n)|0)+1|0;p=c[j>>2]|0;c[(c[p+1648>>2]|0)+(r<<2)>>2]=q;o=$d(q|0,0,o|0,m|0)|0;m=D;r=r+1|0;q=(c[p+44>>2]|0)+ -1|0}while((r|0)<(q|0))}else{m=0;o=0}r=c[k+13128>>2]|0;s=((r|0)<0)<<31>>31;if(!(m>>>0>>0|(m|0)==(s|0)&o>>>0>>0)){b=-1094995529;break}I=_d(r|0,s|0,o|0,m|0)|0;c[(c[p+1648>>2]|0)+(q<<2)>>2]=I;q=(c[p+48>>2]|0)+ -1|0;if((q|0)>0){p=0;o=0;r=0;do{q=(dd(n)|0)+1|0;m=c[j>>2]|0;c[(c[m+1652>>2]|0)+(r<<2)>>2]=q;p=$d(q|0,0,p|0,o|0)|0;o=D;r=r+1|0;q=(c[m+48>>2]|0)+ -1|0}while((r|0)<(q|0))}else{m=p;o=0;p=0}r=c[k+13132>>2]|0;s=((r|0)<0)<<31>>31;if(!(o>>>0>>0|(o|0)==(s|0)&p>>>0>>0)){b=-1094995529;break}I=_d(r|0,s|0,p|0,o|0)|0;c[(c[m+1652>>2]|0)+(q<<2)>>2]=I}I=(bd(n)|0)&255;a[(c[j>>2]|0)+53>>0]=I}I=(bd(n)|0)&255;a[(c[j>>2]|0)+54>>0]=I;I=(bd(n)|0)&255;a[(c[j>>2]|0)+55>>0]=I;if((a[(c[j>>2]|0)+55>>0]|0)!=0?(I=(bd(n)|0)&255,a[(c[j>>2]|0)+56>>0]=I,I=(bd(n)|0)&255,a[(c[j>>2]|0)+57>>0]=I,(a[(c[j>>2]|0)+57>>0]|0)==0):0){m=(ed(n)|0)<<1;c[(c[j>>2]|0)+60>>2]=m;m=(ed(n)|0)<<1;I=c[j>>2]|0;c[I+64>>2]=m;if(((c[I+60>>2]|0)+13|0)>>>0>26){b=-1094995529;break}if((m+13|0)>>>0>26){b=-1094995529;break}}p=(bd(n)|0)&255;a[(c[j>>2]|0)+68>>0]=p;p=c[j>>2]|0;if(a[p+68>>0]|0){q=0;do{o=p+(q<<6)+69|0;m=o+16|0;do{a[o>>0]=16;o=o+1|0}while((o|0)<(m|0));a[p+q+1605>>0]=16;a[p+q+1611>>0]=16;q=q+1|0}while((q|0)!=6);o=p+453|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+517|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+581|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+645|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+709|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+773|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+837|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+901|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+965|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1029|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1093|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1157|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1221|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1285|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1349|0;q=2744;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1413|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1477|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));o=p+1541|0;q=2808;m=o+64|0;do{a[o>>0]=a[q>>0]|0;o=o+1|0;q=q+1|0}while((o|0)<(m|0));m=c[j>>2]|0;v=(c[l>>2]|0)+204|0;w=0;do{p=(w|0)>0?64:16;q=(w|0)>1;o=w+ -2|0;x=(w|0)==3?3:1;r=1<<(w<<1)+4;t=(r|0)>0;s=(w|0)==0;r=(r|0)<64?r:64;u=0;do{if(!(((bd(v)|0)&255)<<24>>24)){y=dd(v)|0;if(y){if(u>>>0>>0){b=-1094995529;break a}y=u-y|0;ee(m+(w*384|0)+(u<<6)+69|0,m+(w*384|0)+(y<<6)+69|0,p|0)|0;if(q)a[m+(o*6|0)+u+1605>>0]=a[m+(o*6|0)+y+1605>>0]|0}}else{if(q){z=(ed(v)|0)+8|0;a[m+(o*6|0)+u+1605>>0]=z}else z=8;if(t){y=0;do{if(s)A=(d[24+y>>0]<<2)+(d[8+y>>0]|0)|0;else A=(d[104+y>>0]<<3)+(d[40+y>>0]|0)|0;z=(z+256+(ed(v)|0)|0)%256|0;a[m+(w*384|0)+(u<<6)+A+69>>0]=z;y=y+1|0}while((y|0)!=(r|0))}}u=u+x|0}while((u|0)<6);w=w+1|0}while((w|0)<4);if((c[k+4>>2]|0)==3){o=0;do{a[m+o+1285>>0]=a[m+o+901>>0]|0;a[m+o+1349>>0]=a[m+o+965>>0]|0;a[m+o+1477>>0]=a[m+o+1093>>0]|0;a[m+o+1541>>0]=a[m+o+1157>>0]|0;o=o+1|0}while((o|0)!=64);a[m+1612>>0]=a[m+1606>>0]|0;a[m+1613>>0]=a[m+1607>>0]|0;a[m+1615>>0]=a[m+1609>>0]|0;a[m+1616>>0]=a[m+1610>>0]|0}}I=(bd(n)|0)&255;a[(c[j>>2]|0)+1617>>0]=I;I=(dd(n)|0)+2|0;c[(c[j>>2]|0)+1620>>2]=I;m=k+13080|0;if(I>>>0<=(c[m>>2]|0)>>>0){I=(bd(n)|0)&255;a[(c[j>>2]|0)+1628>>0]=I;do if((bd(n)|0)!=0?(I=bd(n)|0,_c(n,7)|0,(I|0)!=0):0){n=c[j>>2]|0;p=(c[l>>2]|0)+204|0;if(a[n+21>>0]|0)a[n+1629>>0]=(dd(p)|0)+2;a[n+1630>>0]=bd(p)|0;I=(bd(p)|0)&255;a[n+1631>>0]=I;if(I<<24>>24){a[n+1632>>0]=dd(p)|0;I=dd(p)|0;o=n+1633|0;a[o>>0]=I;if((I&255)>>>0<5)l=0;else break;while(1){a[n+l+1634>>0]=ed(p)|0;a[n+l+1639>>0]=ed(p)|0;if((l|0)<(d[o>>0]|0))l=l+1|0;else break}}a[n+1644>>0]=dd(p)|0;a[n+1645>>0]=dd(p)|0}while(0);l=od((c[(c[j>>2]|0)+44>>2]|0)+1|0,4)|0;c[(c[j>>2]|0)+1656>>2]=l;l=od((c[(c[j>>2]|0)+48>>2]|0)+1|0,4)|0;c[(c[j>>2]|0)+1660>>2]=l;l=k+13128|0;o=od(c[l>>2]|0,4)|0;c[(c[j>>2]|0)+1664>>2]=o;o=c[j>>2]|0;n=c[o+1656>>2]|0;if(((n|0)!=0?(c[o+1660>>2]|0)!=0:0)?(c[o+1664>>2]|0)!=0:0){if(a[o+52>>0]|0){p=c[o+1648>>2]|0;if(!p){o=od(c[o+44>>2]|0,4)|0;c[(c[j>>2]|0)+1648>>2]=o;o=od(c[(c[j>>2]|0)+48>>2]|0,4)|0;c[(c[j>>2]|0)+1652>>2]=o;o=c[j>>2]|0;p=c[o+1648>>2]|0;if(!p){b=-12;break}}n=c[o+1652>>2]|0;if(!n){b=-12;break}q=o+44|0;s=c[q>>2]|0;if((s|0)>0){r=0;do{I=r;r=r+1|0;H=c[l>>2]|0;c[p+(I<<2)>>2]=(($(H,r)|0)/(s|0)|0)-(($(H,I)|0)/(s|0)|0);s=c[q>>2]|0}while((r|0)<(s|0))}q=o+48|0;s=c[q>>2]|0;if((s|0)>0){p=k+13132|0;r=0;do{I=r;r=r+1|0;H=c[p>>2]|0;c[n+(I<<2)>>2]=(($(H,r)|0)/(s|0)|0)-(($(H,I)|0)/(s|0)|0);s=c[q>>2]|0}while((r|0)<(s|0))}n=c[o+1656>>2]|0}c[n>>2]=0;q=o+44|0;if((c[q>>2]|0)>0){p=c[o+1648>>2]|0;r=0;s=0;do{r=(c[p+(s<<2)>>2]|0)+r|0;s=s+1|0;c[n+(s<<2)>>2]=r}while((s|0)<(c[q>>2]|0))}s=c[o+1660>>2]|0;c[s>>2]=0;r=o+48|0;if((c[r>>2]|0)>0){q=c[o+1652>>2]|0;t=0;p=0;do{t=(c[q+(p<<2)>>2]|0)+t|0;p=p+1|0;c[s+(p<<2)>>2]=t}while((p|0)<(c[r>>2]|0))}r=c[l>>2]|0;if((r|0)>0){o=c[o+1664>>2]|0;p=0;q=0;do{q=(p>>>0>(c[n+(q<<2)>>2]|0)>>>0&1)+q|0;c[o+(p<<2)>>2]=q;p=p+1|0;r=c[l>>2]|0}while((p|0)<(r|0))}x=$(c[k+13132>>2]|0,r)|0;n=od(x,4)|0;c[(c[j>>2]|0)+1668>>2]=n;n=od(x,4)|0;c[(c[j>>2]|0)+1672>>2]=n;n=od(x,4)|0;c[(c[j>>2]|0)+1676>>2]=n;n=k+13164|0;q=(c[n>>2]|0)+2|0;q=od($(q,q)|0,4)|0;c[(c[j>>2]|0)+1688>>2]=q;q=c[j>>2]|0;p=c[q+1668>>2]|0;if(!p){b=-12;break}w=c[q+1672>>2]|0;if(!w){b=-12;break}o=c[q+1676>>2]|0;if(!o){b=-12;break}if(!(c[q+1688>>2]|0)){b=-12;break}if((x|0)>0){B=q+44|0;r=q+48|0;s=c[q+1660>>2]|0;v=c[q+1648>>2]|0;u=c[q+1656>>2]|0;t=q+1652|0;A=0;do{C=c[l>>2]|0;y=(A|0)%(C|0)|0;z=(A|0)/(C|0)|0;G=c[B>>2]|0;E=0;while(1){if((E|0)>=(G|0)){E=0;break}F=E+1|0;if(y>>>0<(c[u+(F<<2)>>2]|0)>>>0)break;else E=F}H=c[r>>2]|0;F=0;while(1){if((F|0)>=(H|0)){F=0;break}G=F+1|0;if(z>>>0<(c[s+(G<<2)>>2]|0)>>>0)break;else F=G}if((E|0)>0){G=c[(c[t>>2]|0)+(F<<2)>>2]|0;H=0;I=0;do{I=($(c[v+(H<<2)>>2]|0,G)|0)+I|0;H=H+1|0}while((H|0)!=(E|0))}else I=0;if((F|0)>0){G=c[t>>2]|0;H=0;do{I=($(c[G+(H<<2)>>2]|0,C)|0)+I|0;H=H+1|0}while((H|0)!=(F|0))}H=$(c[v+(E<<2)>>2]|0,z-(c[s+(F<<2)>>2]|0)|0)|0;I=I+y+H-(c[u+(E<<2)>>2]|0)|0;c[p+(A<<2)>>2]=I;c[w+(I<<2)>>2]=A;A=A+1|0}while((A|0)!=(x|0))}else r=q+48|0;x=c[r>>2]|0;if((x|0)>0){s=q+44|0;t=q+1660|0;q=q+1656|0;z=c[s>>2]|0;u=0;w=0;while(1){v=u;u=u+1|0;if((z|0)>0){x=c[t>>2]|0;y=x+(u<<2)|0;G=c[y>>2]|0;B=z;z=0;do{E=c[x+(v<<2)>>2]|0;A=z;z=z+1|0;if(E>>>0>>0){B=c[q>>2]|0;C=B+(z<<2)|0;F=c[C>>2]|0;do{H=c[B+(A<<2)>>2]|0;if(H>>>0>>0){do{c[o+(c[p+(($(c[l>>2]|0,E)|0)+H<<2)>>2]<<2)>>2]=w;H=H+1|0;F=c[C>>2]|0}while(H>>>0>>0);G=c[y>>2]|0}E=E+1|0}while(E>>>0>>0);B=c[s>>2]|0}w=w+1|0}while((z|0)<(B|0));v=c[r>>2]|0;z=B}else v=x;if((u|0)>=(v|0))break;else x=v}}else w=0;o=od(w,4)|0;c[(c[j>>2]|0)+1680>>2]=o;o=c[j>>2]|0;p=c[o+1680>>2]|0;if(!p){b=-12;break}r=o+48|0;u=c[r>>2]|0;if((u|0)>0){q=o+44|0;t=c[q>>2]|0;s=0;do{if((t|0)>0){u=c[o+1660>>2]|0;v=c[o+1656>>2]|0;w=0;do{I=$(c[l>>2]|0,c[u+(s<<2)>>2]|0)|0;c[p+(($(t,s)|0)+w<<2)>>2]=(c[v+(w<<2)>>2]|0)+I;w=w+1|0;t=c[q>>2]|0}while((w|0)<(t|0));u=c[r>>2]|0}s=s+1|0}while((s|0)<(u|0))}k=(c[m>>2]|0)-(c[k+13072>>2]|0)|0;v=c[n>>2]|0;c[o+1684>>2]=(c[o+1688>>2]|0)+(v+3<<2);p=v+2|0;if((p|0)>0){m=c[(c[j>>2]|0)+1688>>2]|0;o=0;do{c[m+(($(p,o)|0)<<2)>>2]=-1;c[m+(o<<2)>>2]=-1;o=o+1|0;v=c[n>>2]|0;p=v+2|0}while((o|0)<(p|0))}if((v|0)>-1){m=c[j>>2]|0;j=m+1668|0;p=k<<1;o=(k|0)>0;m=m+1684|0;q=0;while(1){if((v|0)>-1){r=q>>k;t=c[j>>2]|0;s=c[m>>2]|0;u=0;while(1){z=c[t+(($(c[l>>2]|0,r)|0)+(u>>k)<<2)>>2]<>2]=z;v=c[n>>2]|0;if((u|0)<(v|0))u=u+1|0;else break}}if((q|0)<(v|0))q=q+1|0;else break}}if(((c[g+216>>2]|0)-(c[g+212>>2]|0)|0)<0){b=0;break}I=b+(h<<2)+400|0;vd(I);c[I>>2]=c[e>>2];I=0;i=f;return I|0}else b=-12}else b=-1094995529}else b=-1094995529}else b=-1094995529;while(0);vd(e);I=b;i=f;return I|0}function Fc(a,b){a=a|0;b=b|0;var d=0;a=i;i=i+16|0;d=a;c[d>>2]=b;jd(b+1648|0);jd(b+1652|0);jd(b+1656|0);jd(b+1660|0);jd(b+1664|0);jd(b+1668|0);jd(b+1672|0);jd(b+1680|0);jd(b+1676|0);jd(b+1688|0);jd(d);i=a;return}function Gc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0;b=i;d=a+136|0;e=a+2512|0;while(1){f=(c[d>>2]|0)+204|0;g=0;do{h=_c(f,8)|0;g=h+g|0}while((h|0)==255);h=0;do{j=_c(f,8)|0;h=j+h|0}while((j|0)==255);do if((c[e>>2]|0)==39)if((g|0)==256){Hc(a);break}else{ad(f,h<<3);break}else if((g|0)==132){Hc(a);break}else{ad(f,h<<3);break}while(0);f=c[d>>2]|0;if(((c[f+216>>2]|0)-(c[f+212>>2]|0)|0)<=0){a=14;break}if(($c(f+204|0,8)|0)==128){a=14;break}}if((a|0)==14){i=b;return 1}return 0}function Hc(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;e=(c[b+136>>2]|0)+204|0;g=(_c(e,8)|0)&255;f=b+4468|0;h=0;do{if((g|0)==1)ad(e,16);else if((g|0)==2)ad(e,32);else if(!g){a[f>>0]=1;j=0;do{a[b+(h<<4)+j+4420>>0]=_c(e,8)|0;j=j+1|0}while((j|0)!=16)}h=h+1|0}while((h|0)!=3);i=d;return}function Ic(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;d=i;f=c[b+52>>2]|0;e=a+60|0;if((f|0)>0){if((c[e>>2]|0)==0?(f=md(f)|0,c[e>>2]=f,(f|0)==0):0){f=-12;i=d;return f|0}}else c[e>>2]=0;f=a+12|0;c[f>>2]=b;c[a+424>>2]=0;c[a+800>>2]=1;h=a+912|0;g=a+936|0;c[h+0>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[g>>2]=0;c[g+4>>2]=-2147483648;g=a+928|0;c[g>>2]=0;c[g+4>>2]=-2147483648;a=Da[c[b+76>>2]&3](a)|0;if((a|0)>=0){h=0;i=d;return h|0}jd(e);c[f>>2]=0;h=a;i=d;return h|0}function Jc(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;if(!a){i=b;return 0}e=a+12|0;f=c[e>>2]|0;if((f|0)!=0?(d=c[f+92>>2]|0,(d|0)!=0):0)Da[d&3](a)|0;c[a+796>>2]=0;jd(a+60|0);c[e>>2]=0;c[a+808>>2]=0;i=b;return 0}function Kc(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;if((f|0)<=0){i=h;return 0}j=(e|0)==0;k=0;do{l=d+($(k,g)|0)|0;l=Ia[b&1](a,l)|0;if(!j)c[e+(k<<2)>>2]=l;k=k+1|0}while((k|0)!=(f|0));i=h;return 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;g=i;if((f|0)<=0){i=g;return 0}h=(e|0)==0;j=0;do{k=Ga[b&1](a,d,j,0)|0;if(!h)c[e+(j<<2)>>2]=k;j=j+1|0}while((j|0)!=(f|0));i=g;return 0}function Mc(b,f,g){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;g=i;h=Bd(c[f+76>>2]|0)|0;b=h+4|0;if(!(a[b>>0]|0)){p=0;i=g;return p|0}k=f+64|0;l=h+5|0;m=f+68|0;n=h+6|0;j=0;while(1){p=($((((e[h+(j<<1)+8>>1]|0)>>>11&15)+8|0)>>>3,c[k>>2]|0)|0)+31&-32;if((j+ -1|0)>>>0<2){p=0-(0-p>>d[l>>0])|0;c[f+(j<<2)+32>>2]=p;o=0-(0-((c[m>>2]|0)+31&-32)>>d[n>>0])|0}else{c[f+(j<<2)+32>>2]=p;o=(c[m>>2]|0)+31&-32}o=sd(($(p,o)|0)+32|0)|0;c[f+(j<<2)+304>>2]=o;if(!o){b=-1;f=8;break}c[f+(j<<2)>>2]=c[o+4>>2];j=j+1|0;if((j|0)>=(d[b>>0]|0)){b=0;f=8;break}}if((f|0)==8){i=g;return b|0}return 0}function Nc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;be(a|0,0,976)|0;e=(b|0)!=0;if(e){c[a+8>>2]=c[b+8>>2];c[a+48>>2]=c[b+12>>2]}else c[a+8>>2]=-1;c[a+100>>2]=0;c[a+104>>2]=1;c[a+888>>2]=0;c[a+892>>2]=1;c[a+896>>2]=0;c[a+900>>2]=1;c[a+476>>2]=1;c[a+816>>2]=1;c[a+820>>2]=1;c[a+220>>2]=0;c[a+224>>2]=1;c[a+136>>2]=-1;c[a+416>>2]=-1;g=a+696|0;c[g>>2]=0;c[g+4>>2]=-2147483648;if((e?(f=c[b+52>>2]|0,(f|0)!=0):0)?(g=md(f)|0,c[a+60>>2]=g,(g|0)==0):0){g=-12;i=d;return g|0}g=0;i=d;return g|0}function Oc(a){a=a|0;var b=0,c=0;b=i;c=fd(976)|0;if(c){if((Nc(c,a)|0)<0){id(c);c=0}}else c=0;i=b;return c|0}function Pc(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+80|0;g=f;k=g+0|0;j=e+0|0;h=k+80|0;do{c[k>>2]=c[j>>2];k=k+4|0;j=j+4|0}while((k|0)<(h|0));h=a+12|0;j=c[h>>2]|0;if(!j){k=-22;i=f;return k|0}if(c[j+8>>2]|0){k=-22;i=f;return k|0}c[d>>2]=0;j=c[a+124>>2]|0;k=c[a+128>>2]|0;if(!j){if(k){k=-22;i=f;return k|0}}else{if(!((j|0)>0&(k|0)>0)){k=-22;i=f;return k|0}if((j+128|0)>>>0>=(268435455/((k+128|0)>>>0)|0)>>>0){k=-22;i=f;return k|0}}yd(b);h=c[h>>2]|0;if(((c[h+16>>2]&32|0)==0?(c[e+28>>2]|0)==0:0)?(c[a+808>>2]&1|0)==0:0){k=0;i=f;return k|0}g=Ga[c[h+88>>2]&1](a,b,d,g)|0;if(!(c[d>>2]|0)){yd(b);k=g;i=f;return k|0}else{k=a+424|0;c[k>>2]=(c[k>>2]|0)+1;k=g;i=f;return k|0}return 0}function Qc(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=i;if((a|0)>0&(b|0)>0?(a+128|0)>>>0<(268435455/((b+128|0)>>>0)|0)>>>0:0){d=0;i=c;return d|0}d=-22;i=c;return d|0}function Rc(a,b){a=a|0;b=b|0;return 0}function Sc(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;f=i;e=a+8|0;if(!(c[e>>2]|0)){g=c[a+116>>2]|0;h=a+120|0;j=c[h>>2]|0;if(!((g|0)>0&(j|0)>0)){l=-22;i=f;return l|0}if((g+128|0)>>>0>=(268435455/((j+128|0)>>>0)|0)>>>0){l=-22;i=f;return l|0}j=c[a+136>>2]|0;if((j|0)<0){l=-22;i=f;return l|0}k=b+64|0;l=b+68|0;if((c[k>>2]|0)>=1?(c[l>>2]|0)>=1:0)g=1;else{m=a+792|0;n=0-(0-(c[a+124>>2]|0)>>c[m>>2])|0;c[k>>2]=(g|0)>(n|0)?g:n;k=c[h>>2]|0;g=0-(0-(c[a+128>>2]|0)>>c[m>>2])|0;c[l>>2]=(k|0)>(g|0)?k:g;g=0}c[b+76>>2]=j}else g=1;d=xa[c[a+476>>2]&1](a,b,d)|0;if(c[e>>2]|g){n=d;i=f;return n|0}c[b+64>>2]=c[a+116>>2];c[b+68>>2]=c[a+120>>2];n=d;i=f;return n|0}function Tc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=i;c[b+4>>2]=a;a=Sc(a,c[b>>2]|0,d)|0;i=e;return a|0}function Uc(a,b){a=a|0;b=b|0;a=i;b=c[b>>2]|0;if(b)yd(b);i=a;return}function Vc(a){a=a|0;return}function Wc(a,b,c){a=a|0;b=b|0;c=c|0;return}function Xc(a){a=a|0;var b=0,d=0;b=i;d=a+8|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+16|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+64|0;c[d>>2]=-1;c[d+4>>2]=-1;d=a+72|0;c[d>>2]=0;c[d+4>>2]=0;d=a+32|0;c[a>>2]=0;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;i=b;return}function Yc(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0;g=a+16|0;c[a+12>>2]=b;c[a+20>>2]=b+e;h=b+1|0;c[g>>2]=h;e=(d[b>>0]|0)<<18;c[a>>2]=e;f=b+2|0;c[g>>2]=f;e=(d[h>>0]|0)<<10|e;c[a>>2]=e;c[g>>2]=b+3;c[a>>2]=(d[f>>0]|0)<<2|e|2;c[a+4>>2]=510;return}function Zc(){var b=0,e=0,f=0,g=0,h=0,j=0;b=i;if(!(c[718]|0))e=0;else{i=b;return}while(1)if(e){g=(e&65280|0)==0;a[2880+e>>0]=(g?8:0)-(d[4680+(g?e:e>>>8)>>0]|0);e=e+1|0;if((e|0)==512){e=0;break}else continue}else{a[2880]=9;e=1;continue}while(1){f=e<<1;g=0;do{j=a[4224+(e<<2)+g>>0]|0;h=(g<<7)+f|0;a[(h|1)+3392>>0]=j;a[h+3392>>0]=j;g=g+1|0}while((g|0)!=4);j=(d[4480+e>>0]|0)<<1;a[f+4032>>0]=j;a[f+4033>>0]=j|1;if(e){h=(d[4544+e>>0]|0)<<1;j=128-f|0;a[j+3903>>0]=h;a[j+3902>>0]=h|1;e=e+1|0;if((e|0)==64)break;else continue}else{e=128-f|0;a[e+3903>>0]=1;a[e+3902>>0]=0;e=1;continue}}g=4160|0;f=4608|0;e=g+63|0;do{a[g>>0]=a[f>>0]|0;g=g+1|0;f=f+1|0}while((g|0)<(e|0));c[718]=1;i=b;return}function _c(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0;e=i;f=a+8|0;h=c[f>>2]|0;g=c[a+16>>2]|0;a=(c[a>>2]|0)+(h>>>3)|0;a=(de(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(h&7)>>>(32-b|0);b=h+b|0;c[f>>2]=g>>>0>b>>>0?b:g;i=e;return a|0}function $c(a,b){a=a|0;b=b|0;var e=0,f=0;e=i;f=c[a+8>>2]|0;a=(c[a>>2]|0)+(f>>>3)|0;a=(de(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(f&7)>>>(32-b|0);i=e;return a|0}function ad(a,b){a=a|0;b=b|0;var d=0;d=a+8|0;a=c[a+16>>2]|0;b=(c[d>>2]|0)+b|0;c[d>>2]=a>>>0>b>>>0?b:a;return}function bd(a){a=a|0;var b=0,e=0,f=0;e=a+8|0;f=c[e>>2]|0;b=(d[(c[a>>2]|0)+(f>>>3)>>0]|0)<<(f&7)>>>7&1;c[e>>2]=((f|0)<(c[a+16>>2]|0)&1)+f;return b|0}function cd(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;if(!b){j=0;i=e;return j|0}f=a+8|0;h=c[f>>2]|0;g=c[a+16>>2]|0;j=c[a>>2]|0;a=j+(h>>>3)|0;a=(de(d[a>>0]|d[a+1>>0]<<8|d[a+2>>0]<<16|d[a+3>>0]<<24|0)|0)<<(h&7);if((b|0)<26){j=h+b|0;c[f>>2]=g>>>0>j>>>0?j:g;j=a>>>(32-b|0);i=e;return j|0}else{k=h+16|0;k=g>>>0>k>>>0?k:g;c[f>>2]=k;h=b+ -16|0;j=j+(k>>>3)|0;j=(de(d[j>>0]|d[j+1>>0]<<8|d[j+2>>0]<<16|d[j+3>>0]<<24|0)|0)<<(k&7)>>>(48-b|0);b=k+h|0;c[f>>2]=g>>>0>b>>>0?b:g;j=j|a>>>16<>2]=c[a+0>>2];c[e+4>>2]=c[a+4>>2];c[e+8>>2]=c[a+8>>2];c[e+12>>2]=c[a+12>>2];c[e+16>>2]=c[a+16>>2];e=cd(e,32)|0;f=e>>>0>65535;e=f?e>>>16:e;f=f?16:0;if(e&65280){f=f|8;e=e>>>8}j=31-f-(d[4680+e>>0]|0)|0;g=a+8|0;f=c[g>>2]|0;e=0-f|0;h=(c[a+16>>2]|0)-f|0;if((j|0)<(e|0)){h=e;h=h+f|0;c[g>>2]=h;j=j+1|0;j=cd(a,j)|0;j=j+ -1|0;i=b;return j|0}h=(h|0)<(j|0)?h:j;h=h+f|0;c[g>>2]=h;j=j+1|0;j=cd(a,j)|0;j=j+ -1|0;i=b;return j|0}function ed(a){a=a|0;var b=0;b=i;a=dd(a)|0;if(!(a&1)){a=0-(a>>>1)|0;i=b;return a|0}else{a=(a+1|0)>>>1;i=b;return a|0}return 0}function fd(a){a=a|0;var b=0,d=0,e=0;b=i;d=c[1168]|0;if((d+ -32|0)>>>0>=a>>>0){e=Ud(a)|0;if((e|0)==0&(a|0)==0)if((d|0)==32)e=0;else e=Ud(1)|0}else e=0;i=b;return e|0}function gd(a,b){a=a|0;b=b|0;var d=0;d=i;if(((c[1168]|0)+ -32|0)>>>0>>0){b=0;i=d;return b|0}b=Wd(a,((b|0)==0&1)+b|0)|0;i=d;return b|0}function hd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;f=$(d,b)|0;if((d|b)>>>0>65535&(d|0)!=0?((f>>>0)/(d>>>0)|0|0)!=(b|0):0){Vd(a);d=0;i=e;return d|0}if(((c[1168]|0)+ -32|0)>>>0>>0)b=0;else b=Wd(a,((f|0)==0&1)+f|0)|0;if((b|0)!=0|(f|0)==0){d=b;i=e;return d|0}Vd(a);d=0;i=e;return d|0}function id(a){a=a|0;var b=0;b=i;Vd(a);i=b;return}function jd(a){a=a|0;var b=0;b=i;Vd(c[a>>2]|0);c[a>>2]=0;i=b;return}function kd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if(((d|0)!=0?(2147483647/(d>>>0)|0)>>>0>b>>>0:0)?(f=$(d,b)|0,((c[1168]|0)+ -32|0)>>>0>=f>>>0):0)a=Wd(a,((f|0)==0&1)+f|0)|0;else a=0;i=e;return a|0}function ld(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;f=i;e=hd(c[a>>2]|0,b,d)|0;c[a>>2]=e;i=f;return((e|0)!=0|(b|0)==0|(d|0)==0?0:-12)|0}function md(a){a=a|0;var b=0,c=0;c=i;b=fd(a)|0;if(b)be(b|0,0,a|0)|0;i=c;return b|0}function nd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;if((c[b>>2]|0)>>>0>d>>>0){i=e;return}f=((d*17|0)>>>4)+32|0;d=f>>>0>d>>>0?f:d;Vd(c[a>>2]|0);f=fd(d)|0;c[a>>2]=f;c[b>>2]=(f|0)==0?0:d;i=e;return}function od(a,b){a=a|0;b=b|0;var c=0;c=i;if((b|0)!=0?(2147483647/(b>>>0)|0)>>>0>a>>>0:0)b=fd($(b,a)|0)|0;else b=0;i=c;return b|0}function pd(a,b){a=a|0;b=b|0;var c=0,d=0,e=0;c=i;if(((b|0)!=0?(2147483647/(b>>>0)|0)>>>0>a>>>0:0)?(e=$(b,a)|0,d=fd(e)|0,(d|0)!=0):0)be(d|0,0,e|0)|0;else d=0;i=c;return d|0}function qd(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;g=i;i=i+16|0;h=g;j=md(24)|0;c[h>>2]=j;if(!j){f=0;i=g;return f|0}c[j>>2]=a;c[j+4>>2]=b;c[j+12>>2]=(d|0)!=0?d:7;c[j+16>>2]=e;c[j+8>>2]=1;if(f&1){f=(c[h>>2]|0)+20|0;c[f>>2]=c[f>>2]|1}j=md(12)|0;if(!j){jd(h);f=0;i=g;return f|0}else{c[j>>2]=c[h>>2];c[j+4>>2]=a;c[j+8>>2]=b;f=j;i=g;return f|0}return 0}function rd(a,b){a=a|0;b=b|0;a=i;id(b);i=a;return}function sd(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b;e=fd(a)|0;c[d>>2]=e;if(e){a=qd(e,a,7,0,0)|0;if(!a){jd(d);a=0}}else a=0;i=b;return a|0}function td(a){a=a|0;var b=0,d=0;b=i;d=sd(a)|0;if(!d){d=0;i=b;return d|0}be(c[d+4>>2]|0,0,a|0)|0;i=b;return d|0}function ud(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b;d=md(12)|0;if(!d){e=0;i=b;return e|0}c[d+0>>2]=c[a+0>>2];c[d+4>>2]=c[a+4>>2];c[d+8>>2]=c[a+8>>2];f=(c[a>>2]|0)+8|0;a=c[f>>2]|0;c[f>>2]=a+1;c[e>>2]=a+1;e=d;i=b;return e|0}function vd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+4|0;d=b;if(!a){i=b;return}f=c[a>>2]|0;if(!f){i=b;return}f=c[f>>2]|0;c[d>>2]=f;jd(a);a=f+8|0;f=c[a>>2]|0;c[a>>2]=f+ -1;c[e>>2]=f+ -1;if(c[e>>2]|0){i=b;return}f=c[d>>2]|0;Aa[c[f+12>>2]&7](c[f+16>>2]|0,c[f>>2]|0);jd(d);i=b;return}function wd(){var a=0,b=0,d=0;a=i;b=md(400)|0;if(!b){b=0;i=a;return b|0}be(b|0,0,400)|0;d=b+136|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+144|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+128|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+360|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=b+376|0;c[d>>2]=0;c[d+4>>2]=0;d=b+368|0;c[d>>2]=-1;c[d+4>>2]=-1;c[b+392>>2]=-1;c[b+80>>2]=1;c[b+120>>2]=0;c[b+124>>2]=1;c[b+76>>2]=-1;c[b+344>>2]=2;c[b+348>>2]=2;c[b+352>>2]=2;c[b+340>>2]=0;c[b+356>>2]=0;i=a;return b|0}function xd(a){a=a|0;var b=0,d=0;b=i;if((a|0)!=0?(d=c[a>>2]|0,(d|0)!=0):0){yd(d);jd(a)}i=b;return}function yd(a){a=a|0;var b=0,d=0;b=i;vd(a+304|0);vd(a+308|0);vd(a+312|0);vd(a+316|0);vd(a+320|0);vd(a+324|0);vd(a+328|0);vd(a+332|0);be(a|0,0,400)|0;d=a+136|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+144|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+128|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+360|0;c[d>>2]=0;c[d+4>>2]=-2147483648;d=a+376|0;c[d>>2]=0;c[d+4>>2]=0;d=a+368|0;c[d>>2]=-1;c[d+4>>2]=-1;c[a+392>>2]=-1;c[a+80>>2]=1;c[a+120>>2]=0;c[a+124>>2]=1;c[a+76>>2]=-1;c[a+344>>2]=2;c[a+348>>2]=2;c[a+352>>2]=2;c[a+340>>2]=0;c[a+356>>2]=0;i=b;return}function zd(a,b){a=a|0;b=b|0;var d=0;d=i;ee(a|0,b|0,400)|0;be(b|0,0,400)|0;a=b+136|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+144|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+128|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+360|0;c[a>>2]=0;c[a+4>>2]=-2147483648;a=b+376|0;c[a>>2]=0;c[a+4>>2]=0;a=b+368|0;c[a>>2]=-1;c[a+4>>2]=-1;c[b+392>>2]=-1;c[b+80>>2]=1;c[b+120>>2]=0;c[b+124>>2]=1;c[b+76>>2]=-1;c[b+344>>2]=2;c[b+348>>2]=2;c[b+352>>2]=2;c[b+340>>2]=0;c[b+356>>2]=0;i=d;return}function Ad(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;c[a+76>>2]=c[b+76>>2];c[a+64>>2]=c[b+64>>2];c[a+68>>2]=c[b+68>>2];c[a+388>>2]=c[b+388>>2];j=b+296|0;h=c[j+4>>2]|0;f=a+296|0;c[f>>2]=c[j>>2];c[f+4>>2]=h;c[a+72>>2]=c[b+72>>2];f=c[b+304>>2]|0;if(!f)ta();else{e=f;g=0}while(1){if((e|0)!=0?(j=ud(e)|0,c[a+(g<<2)+304>>2]=j,(j|0)==0):0){e=5;break}g=g+1|0;if(g>>>0>=8){e=8;break}e=c[b+(g<<2)+304>>2]|0}if((e|0)==5){yd(a);j=-12;i=d;return j|0}else if((e|0)==8){c[a+0>>2]=c[b+0>>2];c[a+4>>2]=c[b+4>>2];c[a+8>>2]=c[b+8>>2];c[a+12>>2]=c[b+12>>2];c[a+16>>2]=c[b+16>>2];c[a+20>>2]=c[b+20>>2];c[a+24>>2]=c[b+24>>2];c[a+28>>2]=c[b+28>>2];j=a+32|0;h=b+32|0;c[j+0>>2]=c[h+0>>2];c[j+4>>2]=c[h+4>>2];c[j+8>>2]=c[h+8>>2];c[j+12>>2]=c[h+12>>2];c[j+16>>2]=c[h+16>>2];c[j+20>>2]=c[h+20>>2];c[j+24>>2]=c[h+24>>2];c[j+28>>2]=c[h+28>>2];j=0;i=d;return j|0}return 0}function Bd(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;e=0;while(1){f=e+1|0;if((c[4936+(e*24|0)>>2]|0)==(a|0))break;if(f>>>0<4)e=f;else{e=0;b=5;break}}if((b|0)==5){i=d;return e|0}f=4940+(e*24|0)|0;i=d;return f|0}function Cd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;g=(c[b+16>>2]|0)==0?1:3;if((g|0)>(e|0)){b=c[b>>2]|0;c[d>>2]=c[b+(e<<2)+32>>2];b=c[b+(e<<2)>>2]|0;i=f;return b|0}if((a[b+21>>0]|0)!=0&(g|0)==(e|0)){b=c[b+4>>2]|0;c[d>>2]=c[b+32>>2];b=c[b>>2]|0;i=f;return b|0}else{c[d>>2]=0;b=0;i=f;return b|0}return 0}function Dd(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=i;if(!(c[b>>2]|0)){h=-1;i=f;return h|0}c[e>>2]=c[b+8>>2];c[e+4>>2]=c[b+12>>2];c[e+8>>2]=c[b+16>>2];g=b+23|0;if(!(a[b+21>>0]|0))h=0;else h=(a[g>>0]|0)==0;c[e+12>>2]=h&1;c[e+24>>2]=d[b+25>>0];c[e+28>>2]=d[g>>0];c[e+32>>2]=d[b+24>>0];c[e+16>>2]=c[b+28>>2];c[e+20>>2]=d[b+22>>0];h=0;i=f;return h|0}function Ed(b,e){b=b|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;h=i;f=c[b+8>>2]|0;g=b+44|0;l=c[g>>2]|0;if(l>>>0>=(c[b+12>>2]|0)>>>0){q=-1;i=h;return q|0}m=(c[b+56>>2]|0)+($(c[b+72>>2]|0,l)|0)|0;j=b+40|0;k=(d[j>>0]|0)+3|0;n=c[b+16>>2]|0;if(!n)Ka[c[b+212>>2]&7](b+164|0,e,m,0,0,f,k);else if((n|0)==1){p=l>>1;q=(p|0)%8|0;r=l&1;o=b+88|0;u=b+160|0;t=b+22|0;s=b+20|0;Fd(c[o>>2]|0,b+96|0,f,q,c[u>>2]|0,d[t>>0]|0,r,d[s>>0]|0);n=b+92|0;Fd(c[n>>2]|0,b+128|0,f,q,c[u>>2]|0,d[t>>0]|0,r,d[s>>0]|0);if(r){s=(q+5|0)%8|0;r=p+5|0;t=c[b+52>>2]|0;t=(r|0)<(t|0)?r:t+ -1|0;r=(c[b+60>>2]|0)+($(t,c[b+76>>2]|0)|0)|0;t=(c[b+64>>2]|0)+($(c[b+80>>2]|0,t)|0)|0;u=b+48|0;ee(c[b+(s<<2)+96>>2]|0,r|0,c[u>>2]|0)|0;ee(c[b+(s<<2)+128>>2]|0,t|0,c[u>>2]|0)|0}Ka[c[b+212>>2]&7](b+164|0,e,m,c[o>>2]|0,c[n>>2]|0,f,k)}else if((n|0)==2){u=(c[b+60>>2]|0)+($(c[b+76>>2]|0,l)|0)|0;p=(c[b+64>>2]|0)+($(c[b+80>>2]|0,l)|0)|0;t=b+88|0;q=b+22|0;r=b+20|0;s=b+160|0;Gd(c[t>>2]|0,u,f,d[q>>0]|0,d[r>>0]|0,c[s>>2]|0);u=b+92|0;Gd(c[u>>2]|0,p,f,d[q>>0]|0,d[r>>0]|0,c[s>>2]|0);Ka[c[b+212>>2]&7](b+164|0,e,m,c[t>>2]|0,c[u>>2]|0,f,k)}else if((n|0)==3){t=(c[b+60>>2]|0)+($(c[b+76>>2]|0,l)|0)|0;u=(c[b+64>>2]|0)+($(c[b+80>>2]|0,l)|0)|0;Ka[c[b+212>>2]&7](b+164|0,e,m,t,u,f,k)}else{u=-1;i=h;return u|0}a:do if(!(a[b+23>>0]|0)){if(a[j>>0]|0){if(!(a[b+21>>0]|0)){if((f|0)<=0)break;e=e+3|0;b=0;while(1){a[e>>0]=-1;b=b+1|0;if((b|0)==(f|0))break a;else e=e+4|0}}j=c[b+68>>2]|0;k=$(c[b+84>>2]|0,l)|0;o=e+3|0;if((c[b+204>>2]|0)==8){if((f|0)>0){l=0;while(1){a[o>>0]=a[j+(l+k)>>0]|0;l=l+1|0;if((l|0)==(f|0))break;else o=o+4|0}}}else{n=c[b+172>>2]|0;l=c[b+168>>2]|0;m=c[b+164>>2]|0;if((f|0)>0){p=0;while(1){a[o>>0]=($(d[j+(p+k)>>0]|0,n)|0)+l>>m;p=p+1|0;if((p|0)==(f|0))break;else o=o+4|0}}}if(a[b+25>>0]|0){if(!(c[1264]|0)){c[1264]=1;b=1;do{c[5064+(b<<2)>>2]=(((b|0)/2|0)+16711808|0)/(b|0)|0;b=b+1|0}while((b|0)!=256)}if((f|0)>0){b=0;while(1){k=a[e+3>>0]|0;if(!(k<<24>>24)){a[e>>0]=-1;a[e+1>>0]=-1;a[e+2>>0]=-1}else{j=c[5064+((k&255)<<2)>>2]|0;l=a[e>>0]|0;if((l&255)<(k&255))l=(($(l&255,j)|0)+32768|0)>>>16&255;else l=-1;a[e>>0]=l;l=e+1|0;m=a[l>>0]|0;if((m&255)<(k&255))m=(($(m&255,j)|0)+32768|0)>>>16&255;else m=-1;a[l>>0]=m;l=e+2|0;m=a[l>>0]|0;if((m&255)<(k&255))j=(($(m&255,j)|0)+32768|0)>>>16&255;else j=-1;a[l>>0]=j}b=b+1|0;if((b|0)==(f|0))break;else e=e+4|0}}}}}else{m=c[b+68>>2]|0;l=$(c[b+84>>2]|0,l)|0;n=c[b+204>>2]|0;b=1<0;if(p){o=e;q=0;while(1){t=d[m+(q+l)>>0]|0;a[o>>0]=($(d[o>>0]|0,t)|0)+b>>n;u=o+1|0;a[u>>0]=($(d[u>>0]|0,t)|0)+b>>n;u=o+2|0;a[u>>0]=($(d[u>>0]|0,t)|0)+b>>n;q=q+1|0;if((q|0)==(f|0))break;else o=o+k|0}}if(!((a[j>>0]|0)==0|p^1)){e=e+3|0;b=0;while(1){a[e>>0]=-1;b=b+1|0;if((b|0)==(f|0))break;else e=e+4|0}}}while(0);c[g>>2]=(c[g>>2]|0)+1;u=0;i=h;return u|0}function Fd(e,f,g,h,j,k,l,m){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=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;n=i;p=c[f+((h+5&7)<<2)>>2]|0;t=c[f+((h+6&7)<<2)>>2]|0;q=c[f+((h+7&7)<<2)>>2]|0;s=c[f+((h&7)<<2)>>2]|0;r=c[f+((h+1&7)<<2)>>2]|0;o=c[f+((h+2&7)<<2)>>2]|0;f=c[f+((h+3&7)<<2)>>2]|0;u=k+ -8|0;v=1<>1;h=(g+1|0)/2|0;w=(g|0)>0;if(!l){if(w){l=0;do{y=$(d[t+l>>0]|0,-6)|0;z=$(d[r+l>>0]|0,-10)|0;b[j+(l+3<<1)>>1]=(d[p+l>>0]<<1)+v+y+((d[q+l>>0]|0)*18|0)+((d[s+l>>0]|0)*57|0)+z+(d[o+l>>0]<<2)-(d[f+l>>0]|0)>>u;l=l+1|0}while((l|0)<(h|0))}}else if(w){l=0;do{y=$(d[q+l>>0]|0,-10)|0;z=$(d[o+l>>0]|0,-6)|0;b[j+(l+3<<1)>>1]=v-(d[p+l>>0]|0)+(d[t+l>>0]<<2)+y+((d[s+l>>0]|0)*57|0)+((d[r+l>>0]|0)*18|0)+z+(d[f+l>>0]<<1)>>u;l=l+1|0}while((l|0)<(h|0))}o=j+6|0;z=b[o>>1]&255;b[j>>1]=z;q=j+2|0;b[q>>1]=z;p=j+4|0;b[p>>1]=z;z=b[j+(h+2<<1)>>1]&255;b[j+(h+3<<1)>>1]=z;b[j+(h+4<<1)>>1]=z;b[j+(h+5<<1)>>1]=z;b[j+(h+6<<1)>>1]=z;h=(1<>1;t=20-k|0;s=1<1){r=g+ -2|0;k=r>>>1;q=k<<1;f=e;while(1){u=(b[o>>1]|0)+m>>p;if((u|0)<0)u=0;else u=((u|0)>(h|0)?h:u)&255;a[f>>0]=u;z=$((b[o+4>>1]|0)+(b[o+ -2>>1]|0)|0,-11)|0;u=o;o=o+2|0;u=s-(b[u+ -6>>1]|0)-(b[u+8>>1]|0)+((b[u+6>>1]|0)+(b[u+ -4>>1]|0)<<2)+z+(((b[o>>1]|0)+(b[u>>1]|0)|0)*40|0)>>t;if((u|0)<0)u=0;else u=((u|0)>(h|0)?h:u)&255;a[f+1>>0]=u;g=g+ -2|0;if((g|0)<=1)break;else f=f+2|0}e=e+(q+2)|0;g=r-q|0;o=j+(k+4<<1)|0}if(!g){i=n;return}j=(b[o>>1]|0)+m>>p;if((j|0)<0)j=0;else j=((j|0)>(h|0)?h:j)&255;a[e>>0]=j;i=n;return}else{k=20-k|0;m=1<>1]|0;v=b[q>>1]|0;u=b[p>>1]|0;f=b[o>>1]|0;s=b[j+8>>1]|0;t=b[j+10>>1]|0;if((g|0)>1){r=g+ -2|0;p=r>>>1;q=p<<1;x=e;while(1){w=b[o+6>>1]|0;y=f*57|0;z=(t<<2)+m+($(s,-10)|0)+y+(u*18|0)+($(v,-6)|0)+(l<<1)-w>>k;if((z|0)<0)z=0;else z=((z|0)>(h|0)?h:z)&255;a[x>>0]=z;l=($(t,-6)|0)+m+(s*18|0)+y+($(u,-10)|0)-l+(v<<2)+(w<<1)>>k;if((l|0)<0)l=0;else l=((l|0)>(h|0)?h:l)&255;a[x+1>>0]=l;g=g+ -2|0;if((g|0)<=1)break;else{B=t;A=s;y=f;z=u;l=v;t=w;x=x+2|0;o=o+2|0;s=B;f=A;u=y;v=z}}l=v;v=u;u=f;f=s;s=t;t=w;e=e+(q+2)|0;g=r-q|0;o=j+(p+4<<1)|0}if(!g){i=n;return}j=(t<<2)+m+($(s,-10)|0)+(f*57|0)+(u*18|0)+($(v,-6)|0)+(l<<1)-(b[o+6>>1]|0)>>k;if((j|0)<0)j=0;else j=((j|0)>(h|0)?h:j)&255;a[e>>0]=j;i=n;return}}function Gd(b,c,e,f,g,h){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;var 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;j=i;v=(e+1|0)/2|0;k=h+3|0;ee(k|0,c|0,v|0)|0;be(h|0,a[c>>0]|0,3)|0;be(h+(v+3)|0,a[c+(v+ -1)>>0]|0,4)|0;c=(1<1){f=e+ -2|0;g=f>>>1;l=g<<1;m=b;while(1){a[m>>0]=a[k>>0]|0;v=$((d[k+2>>0]|0)+(d[k+ -1>>0]|0)|0,-11)|0;n=k;k=k+1|0;n=32-(d[n+ -3>>0]|0)-(d[n+4>>0]|0)+((d[n+3>>0]|0)+(d[n+ -2>>0]|0)<<2)+v+(((d[k>>0]|0)+(d[n>>0]|0)|0)*40|0)>>6;if((n|0)<0)n=0;else n=((n|0)>(c|0)?c:n)&255;a[m+1>>0]=n;e=e+ -2|0;if((e|0)<=1)break;else m=m+2|0}b=b+(l+2)|0;e=f-l|0;k=h+(g+4)|0}if(!e){i=j;return}a[b>>0]=a[k>>0]|0;i=j;return}q=d[h>>0]|0;r=d[h+1>>0]|0;m=d[h+2>>0]|0;p=d[k>>0]|0;o=d[h+4>>0]|0;n=d[h+5>>0]|0;if((e|0)>1){f=e+ -2|0;g=f>>>1;l=g<<1;t=b;while(1){s=d[k+3>>0]|0;u=p*57|0;v=(n<<2)+32+($(o,-10)|0)+u+(m*18|0)+($(r,-6)|0)+(q<<1)-s>>6;if((v|0)<0)v=0;else v=((v|0)>(c|0)?c:v)&255;a[t>>0]=v;q=($(n,-6)|0)+32+(o*18|0)+u+($(m,-10)|0)-q+(r<<2)+(s<<1)>>6;if((q|0)<0)q=0;else q=((q|0)>(c|0)?c:q)&255;a[t+1>>0]=q;e=e+ -2|0;if((e|0)<=1)break;else{x=n;w=o;u=p;v=m;q=r;n=s;t=t+2|0;k=k+1|0;o=x;p=w;m=u;r=v}}q=r;r=m;m=p;p=o;o=n;n=s;b=b+(l+2)|0;e=f-l|0;k=h+(g+4)|0}if(!e){i=j;return}h=(n<<2)+32+($(o,-10)|0)+(p*57|0)+(m*18|0)+($(r,-6)|0)+(q<<1)-(d[k+3>>0]|0)>>6;if((h|0)<0)h=0;else h=((h|0)>(c|0)?c:h)&255;a[b>>0]=h;i=j;return}function Hd(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0.0,o=0,p=0.0,q=0.0,r=0,s=0.0,t=0.0,u=0,v=0,w=0,x=0,y=0,z=0.0,A=0.0,B=0.0;f=i;if(!(c[b>>2]|0)){w=-1;i=f;return w|0}g=b+44|0;if((c[g>>2]|0)>-1|e>>>0>1){w=-1;i=f;return w|0}a[b+40>>0]=(e|0)==1&1;l=b+41|0;a[l>>0]=0;c[b+56>>2]=Cd(b,b+72|0,0)|0;e=b+16|0;if(!(c[e>>2]|0))m=1;else{c[b+60>>2]=Cd(b,b+76|0,1)|0;c[b+64>>2]=Cd(b,b+80|0,2)|0;m=3}if(!(a[b+21>>0]|0))c[b+68>>2]=0;else c[b+68>>2]=Cd(b,b+84|0,m)|0;if(((c[e>>2]|0)+ -1|0)>>>0<2?(w=b+8|0,v=c[w>>2]|0,k=b+48|0,c[k>>2]=(v+1|0)/2|0,j=b+52|0,c[j>>2]=((c[b+12>>2]|0)+1|0)/2|0,c[b+88>>2]=fd(v)|0,c[b+92>>2]=fd(c[w>>2]|0)|0,c[b+160>>2]=fd((c[k>>2]<<1)+14|0)|0,(c[e>>2]|0)==1):0){m=0;do{c[b+(m<<2)+96>>2]=fd(c[k>>2]|0)|0;c[b+(m<<2)+128>>2]=fd(c[k>>2]|0)|0;m=m+1|0}while((m|0)!=8);v=b+60|0;o=b+76|0;m=b+64|0;r=b+80|0;u=0;do{w=(u|0)>4?u+ -8|0:u;if((w|0)<0)w=0;else{x=c[j>>2]|0;w=(w|0)<(x|0)?w:x+ -1|0}y=(c[v>>2]|0)+($(c[o>>2]|0,w)|0)|0;x=(c[m>>2]|0)+($(c[r>>2]|0,w)|0)|0;ee(c[b+(u<<2)+96>>2]|0,y|0,c[k>>2]|0)|0;ee(c[b+(u<<2)+128>>2]|0,x|0,c[k>>2]|0)|0;u=u+1|0}while((u|0)!=8)}j=d[b+22>>0]|0;y=(a[l>>0]|0)!=0?16:8;m=b+28|0;r=c[m>>2]|0;l=a[b+24>>0]|0;k=l&255;o=30-y|0;n=+((1<>24!=0;if(l){y=j+ -8|0;p=n/+(224<>2]=sa(+(p*B*2.0))|0;z=1.0-s;A=z-t;c[b+188>>2]=sa(+(p*(s*2.0*z/A)))|0;c[b+192>>2]=sa(+(p*(t*2.0*B/A)))|0;c[b+196>>2]=sa(+(p*z*2.0))|0}h=sa(+q)|0;c[b+172>>2]=h;c[b+164>>2]=o;r=1<>2]=r;c[b+200>>2]=1<>2]=y;y=$(y,-16<>2]=y+(c[o>>2]|0)}else{c[b+176>>2]=h;c[b+180>>2]=r}c[b+204>>2]=j;c[b+208>>2]=k;if(!(c[e>>2]|0))c[b+212>>2]=4;else c[b+212>>2]=c[5032+(c[m>>2]<<2)>>2];c[g>>2]=0;y=0;i=f;return y|0}function Id(){var a=0,b=0;a=i;b=md(216)|0;if(!b)b=0;i=a;return b|0}function Jd(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,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;i=i+80|0;m=g+68|0;j=g+64|0;h=g+60|0;n=g+56|0;k=g+44|0;l=g+32|0;s=g;if((f|0)<6){D=-1;i=g;return D|0}if((a[e>>0]|0)!=66){D=-1;i=g;return D|0}if((a[e+1>>0]|0)!=80){D=-1;i=g;return D|0}if((a[e+2>>0]|0)!=71){D=-1;i=g;return D|0}if((a[e+3>>0]|0)!=-5){D=-1;i=g;return D|0}D=a[e+4>>0]|0;y=D&255;w=y>>>5;r=s+8|0;c[r>>2]=w;if((D&255)>191){D=-1;i=g;return D|0}D=(y&15)+8|0;a[s+13>>0]=D;if((D&255)>>>0>14){D=-1;i=g;return D|0}u=a[e+5>>0]|0;p=u&255;v=p>>>4;o=s+20|0;c[o>>2]=v;t=p&8;A=p>>>2&1;q=s+16|0;a[q>>0]=p>>>1&1;p=s+12|0;a[p>>0]=0;x=s+14|0;a[x>>0]=0;z=s+15|0;a[z>>0]=0;if(!(y&16))if(!A)x=0;else{a[p>>0]=1;a[x>>0]=1;x=1}else{a[p>>0]=1;a[z>>0]=A;x=0}if((u&255)>79){D=-1;i=g;return D|0}if(!((w|0)!=0|(v|0)==0)){D=-1;i=g;return D|0}if(x<<24>>24!=0&(w|0)==0){D=-1;i=g;return D|0}u=Pd(s,e+6|0,f+ -6|0)|0;if((u|0)<0){D=-1;i=g;return D|0}v=u+6|0;x=s+4|0;u=Pd(x,e+v|0,f-v|0)|0;if((u|0)<0){D=-1;i=g;return D|0}u=u+v|0;if(!(c[s>>2]|0)){D=-1;i=g;return D|0}if(!(c[x>>2]|0)){D=-1;i=g;return D|0}v=s+24|0;w=Pd(v,e+u|0,f-u|0)|0;if((w|0)<0){D=-1;i=g;return D|0}u=w+u|0;c[m>>2]=0;if(t){t=Pd(m,e+u|0,f-u|0)|0;if((t|0)<0){D=-1;i=g;return D|0}c[s+28>>2]=0;u=t+u+(c[m>>2]|0)|0;if((u|0)>(f|0)){D=-1;i=g;return D|0}}else c[s+28>>2]=0;w=c[v>>2]|0;if(!w){w=f-u|0;c[v>>2]=w}if((u|0)<0){D=u;i=g;return D|0}v=c[s>>2]|0;x=c[x>>2]|0;D=c[p>>2]|0;t=D&255;A=c[o>>2]|0;y=(D&65535)>>>8;s=y&255;y=y&65535;o=b+8|0;c[o>>2]=v;p=b+12|0;c[p>>2]=x;z=c[r>>2]|0;C=b+16|0;c[C>>2]=z;B=D>>>24&255;r=D>>>16&255;if((z|0)==5){c[C>>2]=2;a[b+20>>0]=0;z=2}else if((z|0)==4){c[C>>2]=1;a[b+20>>0]=0;z=1}else{c[C>>2]=z;a[b+20>>0]=1}a[b+21>>0]=t;a[b+25>>0]=B;a[b+23>>0]=r;a[b+24>>0]=a[q>>0]|0;c[b+28>>2]=A;a[b+22>>0]=s;q=b+36|0;c[q>>2]=0;do if((w+u|0)>>>0>f>>>0){j=c[b>>2]|0;e=77}else{f=b+4|0;A=e+u|0;c[j>>2]=0;c[h>>2]=0;c[k>>2]=0;c[k+4>>2]=0;s=k+8|0;c[s>>2]=0;c[l>>2]=0;c[l+4>>2]=0;r=l+8|0;c[r>>2]=0;t=t<<24>>24!=0;do if(t){A=Ld(n,m,A,w,v,x,0,y)|0;if((A|0)<0){e=72;break}B=c[n>>2]|0;if((Md(k,B,c[m>>2]|0)|0)<0){e=72;break}Vd(B);u=e+(A+u)|0;w=w-A|0;e=37}else{u=A;e=37}while(0);a:do if((e|0)==37){y=Ld(n,m,u,w,v,x,z,y)|0;if((y|0)<0){e=72;break}x=c[n>>2]|0;if((Md(l,x,c[m>>2]|0)|0)<0){e=72;break}v=w-y|0;Vd(x);b:do if((v|0)>0){u=u+y|0;x=1;c:while(1){d:do if((x|0)!=1){do if((v|0)>3){if(a[u>>0]|0)break;if(a[u+1>>0]|0)break;if(a[u+2>>0]|0)break;if((a[u+3>>0]|0)==1){w=4;break d}}while(0);if((v|0)<=2)break c;if(a[u>>0]|0)break c;if(a[u+1>>0]|0)break c;if((a[u+2>>0]|0)==1)w=3;else break c}else w=0;while(0);y=w+2|0;if((y|0)>(v|0))break;e:do if((y|0)<(v|0))while(1){B=(a[u+w>>0]|0)==0;do if(B){if(a[u+(w+1)>>0]|0)break;if((a[u+y>>0]|0)==1)break e}while(0);A=y;y=w+3|0;if((y|0)>=(v|0)){w=v;break e}z=w+1|0;if(!B){w=z;continue}if(a[u+z>>0]|0){w=z;continue}if(a[u+A>>0]|0){w=z;continue}A=(a[u+y>>0]|0)==1;if(A){w=A?w:v;break}else w=z}else w=v;while(0);c[m>>2]=w;if((w|0)<0){e=72;break a}if(!x)A=(a[u+2>>0]|0)==0?4:3;else A=0;y=u+A|0;z=w-A|0;x=z+3|0;A=t&(d[y>>0]<<5&32|(d[u+(A+1)>>0]|0)>>>3|0)==1;C=A?k:l;B=C+8|0;if((Nd(C,(c[B>>2]|0)+x|0)|0)<0){e=72;break a}C=c[C>>2]|0;D=c[B>>2]|0;E=C+D|0;c[n>>2]=E;a[E>>0]=0;a[C+(D+1)>>0]=0;a[C+(D+2)>>0]=1;ee(C+(D+3)|0,y|0,z|0)|0;if(A){E=C+(D+4)|0;a[E>>0]=d[E>>0]&7}c[B>>2]=D+x;v=v-w|0;if((v|0)<=0)break b;else{u=u+w|0;x=0}}c[m>>2]=-1;e=72;break a}while(0);if(t?(E=Od(c[k>>2]|0,c[s>>2]|0)|0,c[h>>2]=E,(E|0)==0):0){e=72;break}m=c[l>>2]|0;E=Od(m,c[r>>2]|0)|0;c[j>>2]=E;if(!E)e=72;else l=0}while(0);if((e|0)==72){xd(j);xd(h);m=c[l>>2]|0;l=1}id(c[k>>2]|0);id(m);j=c[j>>2]|0;c[b>>2]=j;c[f>>2]=c[h>>2];if(l){e=77;break}if((c[j+64>>2]|0)<(c[o>>2]|0)){e=77;break}if((c[j+68>>2]|0)<(c[p>>2]|0)){e=78;break}c[b+44>>2]=-1;E=0;i=g;return E|0}while(0);if((e|0)==77?(j|0)!=0:0)e=78;if((e|0)==78)xd(b);b=b+4|0;if(c[b>>2]|0)xd(b);c[q>>2]=0;E=-1;i=g;return E|0}function Kd(a){a=a|0;var b=0,d=0;b=i;id(c[a+88>>2]|0);id(c[a+92>>2]|0);d=0;do{id(c[a+(d<<2)+96>>2]|0);id(c[a+(d<<2)+128>>2]|0);d=d+1|0}while((d|0)!=8);id(c[a+160>>2]|0);if(c[a>>2]|0)xd(a);d=a+4|0;if(!(c[d>>2]|0)){id(a);i=b;return}xd(d);id(a);i=b;return}function Ld(b,d,e,f,g,h,j,k){b=b|0;d=d|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;m=i;i=i+16|0;n=m;c[b>>2]=0;r=Pd(n,e,f)|0;if((r|0)<0){r=-1;i=m;return r|0}q=f-r|0;p=c[n>>2]|0;if(p>>>0>q>>>0){r=-1;i=m;return r|0}o=p+10|0;n=fd(o)|0;a[n>>0]=j;a[n+1>>0]=g>>>24;a[n+2>>0]=g>>>16;a[n+3>>0]=g>>>8;a[n+4>>0]=g;a[n+5>>0]=h>>>24;a[n+6>>0]=h>>>16;a[n+7>>0]=h>>>8;a[n+8>>0]=h;a[n+9>>0]=k+248;ee(n+10|0,e+r|0,p|0)|0;h=q-p|0;k=fd((o<<1)+10-p+h|0)|0;a[k>>0]=0;a[k+1>>0]=0;a[k+2>>0]=0;a[k+3>>0]=1;a[k+4>>0]=96;a[k+5>>0]=1;if((o|0)>0){q=0;e=6;while(1){p=q+1|0;g=a[n+q>>0]|0;if((p|0)<(o|0)&g<<24>>24==0)if(!(a[n+p>>0]|0)){a[k+e>>0]=0;a[k+(e+1)>>0]=0;a[k+(e+2)>>0]=3;p=q+2|0;e=e+3|0}else{g=0;l=7}else l=7;if((l|0)==7){l=0;a[k+e>>0]=g;e=e+1|0}if((p|0)<(o|0))q=p;else break}if(!e){e=0;l=11}else l=10}else{e=6;l=10}if((l|0)==10)if(!(a[k+(e+ -1)>>0]|0))l=11;if((l|0)==11){a[k+e>>0]=-128;e=e+1|0}id(n);c[d>>2]=e;c[b>>2]=k;r=f-h|0;i=m;return r|0}function Md(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;f=a+8|0;if((Nd(a,(c[f>>2]|0)+d|0)|0)<0){d=-1;i=e;return d|0}ee((c[a>>2]|0)+(c[f>>2]|0)|0,b|0,d|0)|0;c[f>>2]=(c[f>>2]|0)+d;d=0;i=e;return d|0}function Nd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;e=a+4|0;f=c[e>>2]|0;if((f|0)<(b|0)){f=(f*3|0)/2|0;f=(f|0)<(b|0)?b:f;b=gd(c[a>>2]|0,f)|0;if(!b)a=-1;else{c[a>>2]=b;c[e>>2]=f;a=0}}else a=0;i=d;return a|0}function Od(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;f=i;i=i+96|0;h=f;g=f+84|0;d=f+80|0;e=Oc(1416)|0;if(((e|0)!=0?(j=wd()|0,c[d>>2]=j,(j|0)!=0):0)?(j=e+688|0,c[j>>2]=c[j>>2]|1,(Ic(e,1416,0)|0)>=0):0){j=c[d>>2]|0;Xc(h);c[h+24>>2]=a;c[h+28>>2]=b;a=Pc(e,j,g,h)|0;if((a|0)<0)g=0;else{g=(c[g>>2]|0)!=0;a=0}Jc(e)|0;if((a|0)>-1&g){id(e);j=c[d>>2]|0;i=f;return j|0}}id(e);xd(d);j=0;i=f;return j|0}function Pd(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;if((f|0)<1){l=-1;i=g;return l|0}k=e+1|0;l=a[e>>0]|0;j=l&255;if(l<<24>>24<=-1){if(l<<24>>24==-128){l=-1;i=g;return l|0}j=j&127;while(1){if((f|0)<2){b=-1;h=10;break}l=k;k=k+1|0;l=d[l>>0]|0;j=l&127|j<<7;if(!(l&128))break;else f=f+ -1|0}if((h|0)==10){i=g;return b|0}c[b>>2]=j;h=k-e|0;if((h|0)<0){l=h;i=g;return l|0}}else{c[b>>2]=j;h=1}l=j>>>0>1073741823?-1:h;i=g;return l|0}function Qd(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;h=i;if((c[b+40>>2]|0)==8?(c[b+44>>2]|0)==0:0){if((j|0)>0)g=0;else{i=h;return}while(1){n=a[f+g>>0]|0;a[e>>0]=n;a[e+1>>0]=n;a[e+2>>0]=n;g=g+1|0;if((g|0)==(j|0))break;else e=e+k|0}i=h;return}l=c[b+12>>2]|0;g=c[b+16>>2]|0;b=c[b>>2]|0;if((j|0)>0)m=0;else{i=h;return}while(1){n=($(d[f+m>>0]|0,l)|0)+g>>b;if((n|0)<0)n=0;else n=(n|0)>255?-1:n&255;a[e>>0]=n;a[e+1>>0]=n;a[e+2>>0]=n;m=m+1|0;if((m|0)==(j|0))break;else e=e+k|0}i=h;return}function Rd(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;q=i;s=c[b+20>>2]|0;n=c[b+24>>2]|0;o=c[b+28>>2]|0;l=c[b+32>>2]|0;p=c[b+12>>2]|0;r=c[b+16>>2]|0;m=c[b>>2]|0;b=c[b+36>>2]|0;if((j|0)>0)t=0;else{i=q;return}while(1){v=$(d[f+t>>0]|0,p)|0;u=(d[g+t>>0]|0)-b|0;w=(d[h+t>>0]|0)-b|0;v=v+r|0;x=v+($(w,s)|0)>>m;if((x|0)<0)x=0;else x=(x|0)>255?-1:x&255;a[e>>0]=x;w=v-($(u,n)|0)-($(w,o)|0)>>m;if((w|0)<0)w=0;else w=(w|0)>255?-1:w&255;a[e+1>>0]=w;u=v+($(u,l)|0)>>m;if((u|0)<0)u=0;else u=(u|0)>255?-1:u&255;a[e+2>>0]=u;t=t+1|0;if((t|0)==(j|0))break;else e=e+k|0}i=q;return}function Sd(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;l=i;if((c[b+40>>2]|0)==8?(c[b+44>>2]|0)==0:0){if((j|0)>0)m=0;else{i=l;return}while(1){a[e>>0]=a[h+m>>0]|0;a[e+1>>0]=a[f+m>>0]|0;a[e+2>>0]=a[g+m>>0]|0;m=m+1|0;if((m|0)==(j|0))break;else e=e+k|0}i=l;return}n=c[b+12>>2]|0;m=c[b+16>>2]|0;b=c[b>>2]|0;if((j|0)>0)o=0;else{i=l;return}while(1){p=($(d[h+o>>0]|0,n)|0)+m>>b;if((p|0)<0)p=0;else p=(p|0)>255?-1:p&255;a[e>>0]=p;p=($(d[f+o>>0]|0,n)|0)+m>>b;if((p|0)<0)p=0;else p=(p|0)>255?-1:p&255;a[e+1>>0]=p;p=($(d[g+o>>0]|0,n)|0)+m>>b;if((p|0)<0)p=0;else p=(p|0)>255?-1:p&255;a[e+2>>0]=p;o=o+1|0;if((o|0)==(j|0))break;else e=e+k|0}i=l;return}function Td(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;o=i;l=c[b+12>>2]|0;m=c[b+16>>2]|0;n=c[b>>2]|0;b=c[b+36>>2]|0;if((j|0)>0)p=0;else{i=o;return}while(1){t=d[f+p>>0]|0;s=(d[g+p>>0]|0)-b|0;r=(d[h+p>>0]|0)-b|0;q=t-s|0;u=($(q+r|0,l)|0)+m>>n;if((u|0)<0)u=0;else u=(u|0)>255?-1:u&255;a[e>>0]=u;s=($(s+t|0,l)|0)+m>>n;if((s|0)<0)s=0;else s=(s|0)>255?-1:s&255;a[e+1>>0]=s;q=($(q-r|0,l)|0)+m>>n;if((q|0)<0)q=0;else q=(q|0)>255?-1:q&255;a[e+2>>0]=q;p=p+1|0;if((p|0)==(j|0))break;else e=e+k|0}i=o;return}function Ud(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;if((b|0)==0|b>>>0>2147483583){k=0;i=d;return k|0}do if(!(c[1523]|0)){e=ra(64)|0;if((e|0)==(-1|0)){k=0;i=d;return k|0}else{c[1524]=ra(0)|0;c[1523]=6088;c[1522]=6088;c[1527]=6104;c[1526]=6104;k=e+16|0;a[e+15>>0]=-86;j=c[1527]|0;c[1527]=k;c[k>>2]=6104;c[e+20>>2]=j;c[j>>2]=k;j=e+24|0;k=c[1523]|0;c[1523]=j;c[j>>2]=6088;c[e+28>>2]=k;c[k>>2]=j;break}}while(0);e=b+40&-32;h=c[1524]|0;g=c[1522]|0;k=6092|0;while(1){f=c[k>>2]|0;b=f+ -8|0;k=c[f+ -4>>2]|0;if((k|0)==6104)j=h;else j=k;j=j-b|0;if(e>>>0>>0){h=12;break}if((f|0)==(g|0)){h=10;break}k=f+4|0;if((e|0)==(j|0)){h=15;break}}do if((h|0)==10)if((ra(e+32-j|0)|0)==(-1|0)){k=0;i=d;return k|0}else{c[1524]=ra(0)|0;k=c[g+ -4>>2]|0;f=g;h=12;break}else if((h|0)==15){j=c[f>>2]|0;k=c[k>>2]|0;c[j+4>>2]=k;c[k>>2]=j}while(0);if((h|0)==12){h=b+e|0;c[f+ -4>>2]=h;c[h>>2]=b;c[b+(e|4)>>2]=k;c[k>>2]=h;h=b+(e|8)|0;k=f+4|0;j=c[k>>2]|0;c[k>>2]=h;c[h>>2]=f;c[b+(e|12)>>2]=j;c[j>>2]=h;a[b+(e+ -1)>>0]=-86;j=c[f>>2]|0;k=c[k>>2]|0;c[j+4>>2]=k;c[k>>2]=j}a[b+ -1>>0]=85;k=f;i=d;return k|0}function Vd(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;if(!b){i=d;return}g=b+ -8|0;e=c[1523]|0;c[1523]=b;c[b>>2]=6088;f=b+4|0;c[f>>2]=e;c[e>>2]=b;a[b+ -9>>0]=-86;e=c[g>>2]|0;if((e|0)!=6104?(a[e+ -1>>0]|0)==-86:0){g=c[b+ -4>>2]|0;c[e+4>>2]=g;c[g>>2]=e;b=c[b>>2]|0;g=c[f>>2]|0;c[b+4>>2]=g;c[g>>2]=b}else e=g;b=c[e+4>>2]|0;if((b|0)==6104){i=d;return}if((a[b+ -1>>0]|0)!=-86){i=d;return}g=c[b>>2]|0;h=c[b+4>>2]|0;c[g+4>>2]=h;c[h>>2]=g;h=e+8|0;g=c[h>>2]|0;j=e+12|0;f=c[j>>2]|0;c[g+4>>2]=f;c[f>>2]=g;f=b+8|0;g=b+12|0;e=c[g>>2]|0;c[g>>2]=h;c[h>>2]=f;c[j>>2]=e;c[e>>2]=h;f=c[f>>2]|0;g=c[g>>2]|0;c[f+4>>2]=g;c[g>>2]=f;i=d;return}function Wd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;do if(a){if(!b){Vd(a);e=0;break}e=Ud(b)|0;if(!e)e=0;else{f=(c[a+ -4>>2]|0)-a+ -1|0;ee(e|0,a|0,(f>>>0>b>>>0?b:f)|0)|0;Vd(a)}}else e=Ud(b)|0;while(0);i=d;return e|0}function Xd(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0;f=i;if(!d){h=0;i=f;return h|0}while(1){g=a[b>>0]|0;h=a[c>>0]|0;if(g<<24>>24!=h<<24>>24)break;d=d+ -1|0;if(!d){b=0;e=5;break}else{b=b+1|0;c=c+1|0}}if((e|0)==5){i=f;return b|0}h=(g&255)-(h&255)|0;i=f;return h|0}function Yd(){}function Zd(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>c;return a>>>c|(b&(1<>c-32|0}function _d(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;b=b-d-(c>>>0>a>>>0|0)>>>0;return(D=b,a-c>>>0|0)|0}function $d(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return(D=b+d+(c>>>0>>0|0)>>>0,c|0)|0}function ae(b){b=b|0;var c=0;c=b;while(a[c>>0]|0)c=c+1|0;return c-b|0}function be(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;i=b&3;h=d|d<<8|d<<16|d<<24;g=f&~3;if(i){i=b+4-i|0;while((b|0)<(i|0)){a[b>>0]=d;b=b+1|0}}while((b|0)<(g|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 ce(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b<>>32-c;return a<>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function ee(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return ua(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 fe(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>>c;return a>>>c|(b&(1<>>c-32|0}function ge(b){b=b|0;var c=0;c=a[n+(b>>>24)>>0]|0;if((c|0)<8)return c|0;c=a[n+(b>>16&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>8&255)>>0]|0;if((c|0)<8)return c+16|0;return(a[n+(b&255)>>0]|0)+24|0}function he(b){b=b|0;var c=0;c=a[m+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return(a[m+(b>>>24)>>0]|0)+24|0}function ie(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;d=b&65535;c=$(d,f)|0;e=a>>>16;d=(c>>>16)+($(d,e)|0)|0;b=b>>>16;a=$(b,f)|0;return(D=(d>>>16)+($(b,e)|0)+(((d&65535)+a|0)>>>16)|0,d+a<<16|c&65535|0)|0}function je(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;f=c;a=ie(e,f)|0;c=D;return(D=($(b,f)|0)+($(d,e)|0)+c|c&0,a|0|0)|0}function ke(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return xa[a&1](b|0,c|0,d|0)|0}function le(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;ya[a&3](b|0,c|0,d|0,e|0,f|0)}function me(a,b){a=a|0;b=b|0;za[a&7](b|0)}function ne(a,b,c){a=a|0;b=b|0;c=c|0;Aa[a&7](b|0,c|0)}function oe(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return Ba[a&1](b|0,c|0,d|0,e|0,f|0,g|0)|0}function pe(a,b,c,d,e,f,g,h,i,j,k,l,m){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;m=m|0;Ca[a&3](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0,k|0,l|0,m|0)}function qe(a,b){a=a|0;b=b|0;return Da[a&3](b|0)|0}function re(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Ea[a&7](b|0,c|0,d|0)}function se(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;Fa[a&1](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0)}function te(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return Ga[a&1](b|0,c|0,d|0,e|0)|0}function ue(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;Ha[a&3](b|0,c|0,d|0,e|0,f|0,g|0)}function ve(a,b,c){a=a|0;b=b|0;c=c|0;return Ia[a&1](b|0,c|0)|0}function we(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return Ja[a&1](b|0,c|0,d|0,e|0,f|0)|0}function xe(a,b,c,d,e,f,g,h){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;Ka[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0)}function ye(a,b,c){a=a|0;b=b|0;c=c|0;aa(0);return 0}function ze(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;aa(1)}function Ae(a){a=a|0;aa(2)}function Be(a,b){a=a|0;b=b|0;aa(3)}function Ce(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(4);return 0}function De(a,b,c,d,e,f,g,h,i,j,k,l){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;l=l|0;aa(5)}function Ee(a){a=a|0;aa(6);return 0}function Fe(a,b,c){a=a|0;b=b|0;c=c|0;aa(7)}function Ge(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;aa(8)}function He(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aa(9);return 0}function Ie(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(10)}function Je(a,b){a=a|0;b=b|0;aa(11);return 0}function Ke(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;aa(12);return 0}function Le(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;aa(13)} // EMSCRIPTEN_END_FUNCS -var za=[we,Oc];var Aa=[xe,zc,Ac,xe];var Ba=[ye,Ob,lc,qc,rc,sc,tc,ye];var Ca=[ze,jc,mc,nc,oc,pc,Hc,sd];var Da=[Ae,Mc];var Ea=[Be,vc,wc,Be];var Fa=[Ce,Lb,Nb,Ce];var Ga=[De,fc,gc,hc,ic,kc,De,De];var Ha=[Ee,uc];var Ia=[Fe,Mb];var Ja=[Ge,ec,xc,yc];var Ka=[He,Rb];var La=[Ie,Nc];var Ma=[Je,Pd,Qd,Rd,Od,Je,Je,Je];return{_i64Subtract:Zd,_free:Td,_bpg_decoder_decode:Kd,_bpg_decoder_start:Id,_realloc:Ud,_i64Add:_d,_bpg_decoder_open:Jd,_bitshift64Ashr:Yd,_strlen:$d,_bpg_decoder_close:Md,_memset:ae,_malloc:Sd,_memcpy:ce,_bpg_decoder_get_line:Fd,_bpg_decoder_get_info:Ed,_llvm_bswap_i32:Xd,_bitshift64Shl:be,runPostSets:Wd,stackAlloc:Na,stackSave:Oa,stackRestore:Pa,setThrew:Qa,setTempRet0:Ta,getTempRet0:Ua,dynCall_iiii:ie,dynCall_viiiii:je,dynCall_vi:ke,dynCall_vii:le,dynCall_iiiiiii:me,dynCall_viiiiiiiiiiii:ne,dynCall_ii:oe,dynCall_viii:pe,dynCall_viiiiiiiii:qe,dynCall_iiiii:re,dynCall_viiiiii:se,dynCall_iii:te,dynCall_iiiiii:ue,dynCall_viiiiiii:ve}}) +var xa=[ye,Mc];var ya=[ze,xc,yc,ze];var za=[Ae,Mb,jc,oc,pc,qc,rc,Ae];var Aa=[Be,hc,kc,lc,mc,nc,Fc,rd];var Ba=[Ce,Kc];var Ca=[De,tc,uc,De];var Da=[Ee,Jb,Lb,Ee];var Ea=[Fe,dc,ec,fc,gc,ic,Fe,Fe];var Fa=[Ge,sc];var Ga=[He,Kb];var Ha=[Ie,cc,vc,wc];var Ia=[Je,Pb];var Ja=[Ke,Lc];var Ka=[Le,Rd,Sd,Td,Qd,Le,Le,Le];return{_i64Subtract:_d,_free:Vd,_bpg_decoder_decode:Jd,_bpg_decoder_start:Hd,_realloc:Wd,_i64Add:$d,_bpg_decoder_open:Id,_bitshift64Ashr:Zd,_strlen:ae,_bpg_decoder_close:Kd,_memset:be,_malloc:Ud,_memcpy:ee,_bpg_decoder_get_line:Ed,_bpg_decoder_get_info:Dd,_llvm_bswap_i32:de,_bitshift64Shl:ce,runPostSets:Yd,stackAlloc:La,stackSave:Ma,stackRestore:Na,setThrew:Oa,setTempRet0:Ra,getTempRet0:Sa,dynCall_iiii:ke,dynCall_viiiii:le,dynCall_vi:me,dynCall_vii:ne,dynCall_iiiiiii:oe,dynCall_viiiiiiiiiiii:pe,dynCall_ii:qe,dynCall_viii:re,dynCall_viiiiiiiii:se,dynCall_iiiii:te,dynCall_viiiiii:ue,dynCall_iii:ve,dynCall_iiiiii:we,dynCall_viiiiiii:xe}}) // EMSCRIPTEN_END_ASM -(l.v,l.w,S),Ra=l._i64Subtract=Z._i64Subtract;l._free=Z._free;l._bpg_decoder_decode=Z._bpg_decoder_decode;l._bpg_decoder_start=Z._bpg_decoder_start;l._realloc=Z._realloc;var Sa=l._i64Add=Z._i64Add; -l._bpg_decoder_open=Z._bpg_decoder_open;var Qa=l._bitshift64Ashr=Z._bitshift64Ashr,Ta=l._strlen=Z._strlen;l._bpg_decoder_close=Z._bpg_decoder_close;var Ua=l._memset=Z._memset,ua=l._malloc=Z._malloc,Ya=l._memcpy=Z._memcpy;l._bpg_decoder_get_line=Z._bpg_decoder_get_line;l._bpg_decoder_get_info=Z._bpg_decoder_get_info;var Pa=l._llvm_bswap_i32=Z._llvm_bswap_i32,Va=l._bitshift64Shl=Z._bitshift64Shl;l.runPostSets=Z.runPostSets;l.dynCall_iiii=Z.dynCall_iiii;l.dynCall_viiiii=Z.dynCall_viiiii; -l.dynCall_vi=Z.dynCall_vi;l.dynCall_vii=Z.dynCall_vii;l.dynCall_iiiiiii=Z.dynCall_iiiiiii;l.dynCall_viiiiiiiiiiii=Z.dynCall_viiiiiiiiiiii;l.dynCall_ii=Z.dynCall_ii;l.dynCall_viii=Z.dynCall_viii;l.dynCall_viiiiiiiii=Z.dynCall_viiiiiiiii;l.dynCall_iiiii=Z.dynCall_iiiii;l.dynCall_viiiiii=Z.dynCall_viiiiii;l.dynCall_iii=Z.dynCall_iii;l.dynCall_iiiiii=Z.dynCall_iiiiii;l.dynCall_viiiiiii=Z.dynCall_viiiiiii;z.d=Z.stackAlloc;z.m=Z.stackSave;z.q=Z.stackRestore;z.M=Z.setTempRet0;z.J=Z.getTempRet0; -if(X)if("function"===typeof l.locateFile?X=l.locateFile(X):l.memoryInitializerPrefixURL&&(X=l.memoryInitializerPrefixURL+X),u||w){var ab=l.readBinary(X);P.set(ab,Q)}else Ma(),Browser.V(X,function(a){P.set(a,Q);Na()},function(){b("could not load memory initializer "+X)});function ea(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}ea.prototype=Error();var $=k,W=function bb(){!l.calledRun&&cb&&db();l.calledRun||(W=bb)}; -function db(){function a(){if(!l.calledRun&&(l.calledRun=j,!G)){Ha||(Ha=j,T(Da));T(Ea);v&&$!==k&&l.a("pre-main prep time: "+(Date.now()-$)+" ms");if(l.postRun)for("function"==typeof l.postRun&&(l.postRun=[l.postRun]);l.postRun.length;)Ja(l.postRun.shift());T(Ga)}}$===k&&($=Date.now());if(!(0c.A(f,a,a.length))console.log("could not decode image");else{i=c.p(36);c.B(f,i);a=l.HEAPU32;g=a[i>>2];a=a[i+4>>2];c.n(i);c.F(f,1);p=c.p(4*g);i=c.H.createImageData(g,a);D=i.data;m=0;r=l.HEAPU8;g*=4;for(n=0;ndata) { - pkt->size -= len; - pkt->data += len; - } return 0; } extern AVCodec ff_hevc_decoder; -static AVFrame *hevc_decode(const uint8_t *input_data, int input_data_len, - int width, int height, int chroma_format_idc, - int bit_depth) +static int build_msps(uint8_t **pbuf, int *pbuf_len, + const uint8_t *input_data, int input_data_len1, + int width, int height, int chroma_format_idc, + int bit_depth) { - AVCodec *codec; - AVCodecContext *c= NULL; - int frame_count, idx, msps_len, ret, buf_len, i; - AVPacket avpkt; - AVFrame *frame; + int input_data_len = input_data_len1; + int idx, msps_len, ret, buf_len, i; uint32_t len; uint8_t *buf, *msps_buf; + *pbuf = NULL; + /* build the modified SPS header to please libavcodec */ ret = get_ue(&len, input_data, input_data_len); if (ret < 0) - return NULL; + return -1; input_data += ret; input_data_len -= ret; if (len > input_data_len) - return NULL; + return -1; msps_len = 1 + 4 + 4 + 1 + len; msps_buf = av_malloc(msps_len); @@ -265,74 +268,211 @@ static AVFrame *hevc_decode(const uint8_t *input_data, int input_data_len, /* the last byte cannot be 0 */ if (idx == 0 || buf[idx - 1] == 0x00) buf[idx++] = 0x80; - av_free(msps_buf); - - /* NAL start code (Note: should be 3 bytes depending on exact NAL - type, but it is not critical for libavcodec) */ - buf[idx++] = 0x00; - buf[idx++] = 0x00; - buf[idx++] = 0x00; - buf[idx++] = 0x01; - - memcpy(buf + idx, input_data, input_data_len); - idx += input_data_len; - assert(idx < buf_len); + *pbuf_len = idx; + *pbuf = buf; + return input_data_len1 - input_data_len; +} - av_init_packet(&avpkt); +static AVFrame *hevc_decode_frame(const uint8_t *buf, int buf_len) +{ + AVCodec *codec; + AVCodecContext *c; + AVFrame *frame; + int frame_count, ret; codec = &ff_hevc_decoder; c = avcodec_alloc_context3(codec); - if (!c) { -#ifdef DEBUG - fprintf(stderr, "Could not allocate video codec context\n"); -#endif - exit(1); - } - - if(codec->capabilities&CODEC_CAP_TRUNCATED) - c->flags|= CODEC_FLAG_TRUNCATED; /* we do not send complete frames */ - + if (!c) + goto fail; + frame = av_frame_alloc(); + if (!frame) + goto fail; /* for testing: use the MD5 or CRC in SEI to check the decoded bit stream. */ c->err_recognition |= AV_EF_CRCCHECK; - /* open it */ - if (avcodec_open2(c, codec, NULL) < 0) { -#ifdef DEBUG - fprintf(stderr, "Could not open codec\n"); -#endif - exit(1); + if (avcodec_open2(c, codec, NULL) < 0) + goto fail; + + frame_count = 0; + ret = decode_write_data(c, frame, &frame_count, buf, buf_len); + avcodec_close(c); + if (ret < 0 || frame_count != 1) + goto fail; + av_free(c); + return frame; + fail: + av_free(c); + av_frame_free(&frame); + return NULL; +} + +/* return the position of the end of the NAL or -1 if error */ +static int find_nal_end(const uint8_t *buf, int buf_len, int has_startcode) +{ + int idx; + + idx = 0; + if (has_startcode) { + if (buf_len >= 4 && + buf[0] == 0 && buf[1] == 0 && buf[2] == 0 && buf[3] == 1) { + idx = 4; + } else if (buf_len >= 3 && + buf[0] == 0 && buf[1] == 0 && buf[2] == 1) { + idx = 3; + } else { + return -1; + } + } + /* NAL header */ + if (idx + 2 > buf_len) + return -1; + /* find the last byte */ + for(;;) { + if (idx + 2 >= buf_len) { + idx = buf_len; + break; + } + if (buf[idx] == 0 && buf[idx + 1] == 0 && buf[idx + 2] == 1) + break; + if (idx + 3 < buf_len && + buf[idx] == 0 && buf[idx + 1] == 0 && buf[idx + 2] == 0 && buf[idx + 3] == 1) + break; + idx++; + } + return idx; +} + +typedef struct { + uint8_t *buf; + int size; + int len; +} DynBuf; + +static void dyn_buf_init(DynBuf *s) +{ + s->buf = NULL; + s->size = 0; + s->len = 0; +} + +static int dyn_buf_resize(DynBuf *s, int size) +{ + int new_size; + uint8_t *new_buf; + + if (size <= s->size) + return 0; + new_size = (s->size * 3) / 2; + if (new_size < size) + new_size = size; + new_buf = av_realloc(s->buf, new_size); + if (!new_buf) + return -1; + s->buf = new_buf; + s->size = new_size; + return 0; +} + +static int dyn_buf_push(DynBuf *s, const uint8_t *data, int len) +{ + if (dyn_buf_resize(s, s->len + len) < 0) + return -1; + memcpy(s->buf + s->len, data, len); + s->len += len; + return 0; +} + +static int hevc_decode(AVFrame **pcframe, AVFrame **paframe, + const uint8_t *buf, int buf_len, + int width, int height, int chroma_format_idc, + int bit_depth, int has_alpha) +{ + int nal_len, start, first_nal, nal_buf_len, ret, nuh_layer_id; + AVFrame *cframe = NULL, *aframe = NULL; + uint8_t *nal_buf; + DynBuf abuf_s, *abuf = &abuf_s; + DynBuf cbuf_s, *cbuf = &cbuf_s; + DynBuf *pbuf; + + dyn_buf_init(abuf); + dyn_buf_init(cbuf); + + if (has_alpha) { + ret = build_msps(&nal_buf, &nal_len, buf, buf_len, + width, height, 0, bit_depth); + if (ret < 0) + goto fail; + buf += ret; + buf_len -= ret; + if (dyn_buf_push(abuf, nal_buf, nal_len) < 0) + goto fail; + free(nal_buf); + } + + ret = build_msps(&nal_buf, &nal_len, buf, buf_len, + width, height, chroma_format_idc, bit_depth); + if (ret < 0) + goto fail; + buf += ret; + buf_len -= ret; + if (dyn_buf_push(cbuf, nal_buf, nal_len) < 0) + goto fail; + free(nal_buf); + + first_nal = 1; + while (buf_len > 0) { + nal_len = find_nal_end(buf, buf_len, !first_nal); + if (nal_len < 0) + goto fail; + if (first_nal) + start = 0; + else + start = 3 + (buf[2] == 0); + nuh_layer_id = ((buf[start] & 1) << 5) | (buf[start + 1] >> 3); + nal_buf_len = nal_len - start + 3; + if (has_alpha && nuh_layer_id == 1) + pbuf = abuf; + else + pbuf = cbuf; + if (dyn_buf_resize(pbuf, pbuf->len + nal_buf_len) < 0) + goto fail; + nal_buf = pbuf->buf + pbuf->len; + nal_buf[0] = 0x00; + nal_buf[1] = 0x00; + nal_buf[2] = 0x01; + memcpy(nal_buf + 3, buf + start, nal_len - start); + if (has_alpha && nuh_layer_id == 1) + nal_buf[4] &= 0x7; + pbuf->len += nal_buf_len; + buf += nal_len; + buf_len -= nal_len; + first_nal = 0; } - frame = av_frame_alloc(); - if (!frame) { -#ifdef DEBUG - fprintf(stderr, "Could not allocate video frame\n"); -#endif - return NULL; - } - - avpkt.size = idx; - avpkt.data = buf; - frame_count = 0; - while (avpkt.size > 0) { - if (decode_write_frame(c, frame, &frame_count, &avpkt, 0) < 0) - exit(1); - } - - avcodec_close(c); - av_free(c); - av_free(buf); - - if (frame_count == 0) { - av_frame_free(&frame); - return NULL; - } else { - return frame; + if (has_alpha) { + aframe = hevc_decode_frame(abuf->buf, abuf->len); + if (!aframe) + goto fail; } + cframe = hevc_decode_frame(cbuf->buf, cbuf->len); + if (!cframe) + goto fail; + ret = 0; + done: + av_free(abuf->buf); + av_free(cbuf->buf); + *pcframe = cframe; + *paframe = aframe; + return ret; + fail: + av_frame_free(&cframe); + av_frame_free(&aframe); + ret = -1; + goto done; } uint8_t *bpg_decoder_get_data(BPGDecoderContext *img, int *pline_size, int plane) @@ -390,18 +530,72 @@ static inline int clamp8(int a) return a; } -/* 7 tap Lanczos interpolator */ -#define IC0 (-1) -#define IC1 4 -#define IC2 (-10) -#define IC3 57 -#define IC4 18 -#define IC5 (-6) -#define IC6 2 +/* 8 tap Lanczos interpolator (phase=0, symmetric) */ +#define IP0C0 40 +#define IP0C1 (-11) +#define IP0C2 4 +#define IP0C3 (-1) + +/* 7 tap Lanczos interpolator (phase=0.5) */ +#define IP1C0 (-1) +#define IP1C1 4 +#define IP1C2 (-10) +#define IP1C3 57 +#define IP1C4 18 +#define IP1C5 (-6) +#define IP1C6 2 + +/* interpolate by a factor of two assuming chroma is aligned with the + luma samples. */ +static void interp2p0_simple(PIXEL *dst, const PIXEL *src, int n, int bit_depth) +{ + int pixel_max; + + pixel_max = (1 << bit_depth) - 1; + while (n >= 2) { + dst[0] = src[0]; + dst[1] = clamp_pix(((src[-3] + src[4]) * IP0C3 + + (src[-2] + src[3]) * IP0C2 + + (src[-1] + src[2]) * IP0C1 + + (src[0] + src[1]) * IP0C0 + 32) >> 6, pixel_max); + dst += 2; + src++; + n -= 2; + } + if (n) { + dst[0] = src[0]; + } +} + +static void interp2p0_simple16(PIXEL *dst, const int16_t *src, int n, int bit_depth) +{ + int shift1, offset1, shift0, offset0, pixel_max; + + pixel_max = (1 << bit_depth) - 1; + shift0 = 14 - bit_depth; + offset0 = (1 << shift0) >> 1; + shift1 = 20 - bit_depth; + offset1 = 1 << (shift1 - 1); + + while (n >= 2) { + dst[0] = clamp_pix((src[0] + offset0) >> shift0, pixel_max); + dst[1] = clamp_pix(((src[-3] + src[4]) * IP0C3 + + (src[-2] + src[3]) * IP0C2 + + (src[-1] + src[2]) * IP0C1 + + (src[0] + src[1]) * IP0C0 + offset1) >> shift1, + pixel_max); + dst += 2; + src++; + n -= 2; + } + if (n) { + dst[0] = clamp_pix((src[0] + offset0) >> shift0, pixel_max); + } +} /* interpolate by a factor of two assuming chroma is between the luma samples. */ -static void interp2_simple(PIXEL *dst, const PIXEL *src, int n, int bit_depth) +static void interp2p1_simple(PIXEL *dst, const PIXEL *src, int n, int bit_depth) { int pixel_max, a0, a1, a2, a3, a4, a5, a6; @@ -422,11 +616,11 @@ static void interp2_simple(PIXEL *dst, const PIXEL *src, int n, int bit_depth) a4 = a5; a5 = a6; a6 = src[3]; - dst[0] = clamp_pix((a0 * IC6 + a1 * IC5 + a2 * IC4 + a3 * IC3 + - a4 * IC2 + a5 * IC1 + a6 * IC0 + 32) >> 6, + dst[0] = clamp_pix((a0 * IP1C6 + a1 * IP1C5 + a2 * IP1C4 + a3 * IP1C3 + + a4 * IP1C2 + a5 * IP1C1 + a6 * IP1C0 + 32) >> 6, pixel_max); - dst[1] = clamp_pix((a0 * IC0 + a1 * IC1 + a2 * IC2 + a3 * IC3 + - a4 * IC4 + a5 * IC5 + a6 * IC6 + 32) >> 6, + dst[1] = clamp_pix((a0 * IP1C0 + a1 * IP1C1 + a2 * IP1C2 + a3 * IP1C3 + + a4 * IP1C4 + a5 * IP1C5 + a6 * IP1C6 + 32) >> 6, pixel_max); dst += 2; src++; @@ -440,35 +634,14 @@ static void interp2_simple(PIXEL *dst, const PIXEL *src, int n, int bit_depth) a4 = a5; a5 = a6; a6 = src[3]; - dst[0] = clamp_pix((a0 * IC6 + a1 * IC5 + a2 * IC4 + a3 * IC3 + - a4 * IC2 + a5 * IC1 + a6 * IC0 + 32) >> 6, + dst[0] = clamp_pix((a0 * IP1C6 + a1 * IP1C5 + a2 * IP1C4 + a3 * IP1C3 + + a4 * IP1C2 + a5 * IP1C1 + a6 * IP1C0 + 32) >> 6, pixel_max); } } -static void interp2_h(PIXEL *dst, const PIXEL *src, int n, int bit_depth) -{ - PIXEL *src1, v; - int i, n2; - - /* add extra pixels and do the interpolation (XXX: could go faster) */ - n2 = (n + 1) / 2; - src1 = av_malloc((n2 + ITAPS - 1) * sizeof(PIXEL)); - memcpy(src1 + ITAPS2 - 1, src, n2 * sizeof(PIXEL)); - - v = src[0]; - for(i = 0; i < ITAPS2 - 1; i++) - src1[i] = v; - - v = src[n2 - 1]; - for(i = 0; i < ITAPS2; i++) - src1[ITAPS2 - 1 + n2 + i] = v; - interp2_simple(dst, src1 + ITAPS2 - 1, n, bit_depth); - av_free(src1); -} - -static void interp2_simple2(PIXEL *dst, const int16_t *src, int n, - int bit_depth) +static void interp2p1_simple16(PIXEL *dst, const int16_t *src, int n, + int bit_depth) { int shift, offset, pixel_max, a0, a1, a2, a3, a4, a5, a6; @@ -491,11 +664,11 @@ static void interp2_simple2(PIXEL *dst, const int16_t *src, int n, a4 = a5; a5 = a6; a6 = src[3]; - dst[0] = clamp_pix((a0 * IC6 + a1 * IC5 + a2 * IC4 + a3 * IC3 + - a4 * IC2 + a5 * IC1 + a6 * IC0 + offset) >> shift, + dst[0] = clamp_pix((a0 * IP1C6 + a1 * IP1C5 + a2 * IP1C4 + a3 * IP1C3 + + a4 * IP1C2 + a5 * IP1C1 + a6 * IP1C0 + offset) >> shift, pixel_max); - dst[1] = clamp_pix((a0 * IC0 + a1 * IC1 + a2 * IC2 + a3 * IC3 + - a4 * IC4 + a5 * IC5 + a6 * IC6 + offset) >> shift, + dst[1] = clamp_pix((a0 * IP1C0 + a1 * IP1C1 + a2 * IP1C2 + a3 * IP1C3 + + a4 * IP1C4 + a5 * IP1C5 + a6 * IP1C6 + offset) >> shift, pixel_max); dst += 2; src++; @@ -509,19 +682,44 @@ static void interp2_simple2(PIXEL *dst, const int16_t *src, int n, a4 = a5; a5 = a6; a6 = src[3]; - dst[0] = clamp_pix((a0 * IC6 + a1 * IC5 + a2 * IC4 + a3 * IC3 + - a4 * IC2 + a5 * IC1 + a6 * IC0 + offset) >> shift, + dst[0] = clamp_pix((a0 * IP1C6 + a1 * IP1C5 + a2 * IP1C4 + a3 * IP1C3 + + a4 * IP1C2 + a5 * IP1C1 + a6 * IP1C0 + offset) >> shift, pixel_max); } } +/* tmp_buf is a temporary buffer of length (n2 + 2 * ITAPS2 - 1) */ +static void interp2_h(PIXEL *dst, const PIXEL *src, int n, int bit_depth, + int phase, PIXEL *tmp_buf) +{ + PIXEL *src1 = tmp_buf, v; + int i, n2; + + /* add extra pixels and do the interpolation (XXX: could go faster) */ + n2 = (n + 1) / 2; + memcpy(src1 + ITAPS2 - 1, src, n2 * sizeof(PIXEL)); + + v = src[0]; + for(i = 0; i < ITAPS2 - 1; i++) + src1[i] = v; + + v = src[n2 - 1]; + for(i = 0; i < ITAPS2; i++) + src1[ITAPS2 - 1 + n2 + i] = v; + if (phase == 0) + interp2p0_simple(dst, src1 + ITAPS2 - 1, n, bit_depth); + else + interp2p1_simple(dst, src1 + ITAPS2 - 1, n, bit_depth); +} + /* y_pos is the position of the sample '0' in the 'src' circular - buffer. tmp is a temporary buffer of length (n2 + 2 * ITAPS - 1) */ + buffer. tmp_buf is a temporary buffer of length (n2 + 2 * ITAPS2 - 1) */ static void interp2_vh(PIXEL *dst, PIXEL **src, int n, int y_pos, - int16_t *tmp_buf, int bit_depth, int frac_pos) + int16_t *tmp_buf, int bit_depth, int frac_pos, + int c_h_phase) { const PIXEL *src0, *src1, *src2, *src3, *src4, *src5, *src6; - int i, n2, shift; + int i, n2, shift, rnd; PIXEL v; src0 = src[(y_pos - 3) & 7]; @@ -533,24 +731,24 @@ static void interp2_vh(PIXEL *dst, PIXEL **src, int n, int y_pos, src6 = src[(y_pos + 3) & 7]; /* vertical interpolation first */ - /* XXX: should round but not critical */ shift = bit_depth - 8; + rnd = (1 << shift) >> 1; n2 = (n + 1) / 2; if (frac_pos == 0) { for(i = 0; i < n2; i++) { tmp_buf[ITAPS2 - 1 + i] = - (src0[i] * IC6 + src1[i] * IC5 + - src2[i] * IC4 + src3[i] * IC3 + - src4[i] * IC2 + src5[i] * IC1 + - src6[i] * IC0) >> shift; + (src0[i] * IP1C6 + src1[i] * IP1C5 + + src2[i] * IP1C4 + src3[i] * IP1C3 + + src4[i] * IP1C2 + src5[i] * IP1C1 + + src6[i] * IP1C0 + rnd) >> shift; } } else { for(i = 0; i < n2; i++) { tmp_buf[ITAPS2 - 1 + i] = - (src0[i] * IC0 + src1[i] * IC1 + - src2[i] * IC2 + src3[i] * IC3 + - src4[i] * IC4 + src5[i] * IC5 + - src6[i] * IC6) >> shift; + (src0[i] * IP1C0 + src1[i] * IP1C1 + + src2[i] * IP1C2 + src3[i] * IP1C3 + + src4[i] * IP1C4 + src5[i] * IP1C5 + + src6[i] * IP1C6 + rnd) >> shift; } } @@ -561,7 +759,10 @@ static void interp2_vh(PIXEL *dst, PIXEL **src, int n, int y_pos, v = tmp_buf[ITAPS2 - 1 + n2 - 1]; for(i = 0; i < ITAPS2; i++) tmp_buf[ITAPS2 - 1 + n2 + i] = v; - interp2_simple2(dst, tmp_buf + ITAPS2 - 1, n, bit_depth); + if (c_h_phase == 0) + interp2p0_simple16(dst, tmp_buf + ITAPS2 - 1, n, bit_depth); + else + interp2p1_simple16(dst, tmp_buf + ITAPS2 - 1, n, bit_depth); } static void ycc_to_rgb24(ColorConvertState *s, uint8_t *dst, const PIXEL *y_ptr, @@ -1076,13 +1277,14 @@ static int bpg_decoder_output_init(BPGDecoderContext *s, s->h2 = (s->h + 1) / 2; s->cb_buf2 = av_malloc(s->w * sizeof(PIXEL)); s->cr_buf2 = av_malloc(s->w * sizeof(PIXEL)); + /* Note: too large if 422 and sizeof(PIXEL) = 1 */ + s->c_buf4 = av_malloc((s->w2 + 2 * ITAPS2 - 1) * sizeof(int16_t)); if (s->format == BPG_FORMAT_420) { for(i = 0; i < ITAPS; i++) { s->cb_buf3[i] = av_malloc(s->w2 * sizeof(PIXEL)); s->cr_buf3[i] = av_malloc(s->w2 * sizeof(PIXEL)); } - s->c_buf4 = av_malloc((s->w2 + 2 * ITAPS2 - 1) * sizeof(int16_t)); /* init the vertical interpolation buffer */ for(i = 0; i < ITAPS; i++) { @@ -1141,7 +1343,7 @@ static void bpg_decoder_output_end(BPGDecoderContext *s) int bpg_decoder_get_line(BPGDecoderContext *s, void *rgb_line1) { uint8_t *rgb_line = rgb_line1; - int w, h, y, pos, y2, y1, incr; + int w, h, y, pos, y2, y1, incr, y_frac; PIXEL *y_ptr, *cb_ptr, *cr_ptr, *a_ptr; w = s->w; @@ -1160,17 +1362,12 @@ int bpg_decoder_get_line(BPGDecoderContext *s, void *rgb_line1) case BPG_FORMAT_420: y2 = y >> 1; pos = y2 % ITAPS; - if ((y & 1) == 0) { - interp2_vh(s->cb_buf2, s->cb_buf3, w, pos, s->c_buf4, - s->bit_depth, 0); - interp2_vh(s->cr_buf2, s->cr_buf3, w, pos, s->c_buf4, - s->bit_depth, 0); - } else { - interp2_vh(s->cb_buf2, s->cb_buf3, w, pos, s->c_buf4, - s->bit_depth, 1); - interp2_vh(s->cr_buf2, s->cr_buf3, w, pos, s->c_buf4, - s->bit_depth, 1); - + y_frac = y & 1; + interp2_vh(s->cb_buf2, s->cb_buf3, w, pos, s->c_buf4, + s->bit_depth, y_frac, s->c_h_phase); + interp2_vh(s->cr_buf2, s->cr_buf3, w, pos, s->c_buf4, + s->bit_depth, y_frac, s->c_h_phase); + if (y_frac) { /* add a new line in the circular buffer */ pos = (pos + ITAPS2 + 1) % ITAPS; y1 = y2 + ITAPS2 + 1; @@ -1186,8 +1383,10 @@ int bpg_decoder_get_line(BPGDecoderContext *s, void *rgb_line1) case BPG_FORMAT_422: cb_ptr = (PIXEL *)(s->cb_buf + y * s->cb_linesize); cr_ptr = (PIXEL *)(s->cr_buf + y * s->cr_linesize); - interp2_h(s->cb_buf2, cb_ptr, w, s->bit_depth); - interp2_h(s->cr_buf2, cr_ptr, w, s->bit_depth); + interp2_h(s->cb_buf2, cb_ptr, w, s->bit_depth, s->c_h_phase, + (PIXEL *)s->c_buf4); + interp2_h(s->cr_buf2, cr_ptr, w, s->bit_depth, s->c_h_phase, + (PIXEL *)s->c_buf4); s->cvt_func(&s->cvt, rgb_line, y_ptr, s->cb_buf2, s->cr_buf2, w, incr); break; case BPG_FORMAT_444: @@ -1279,8 +1478,7 @@ typedef struct { uint8_t premultiplied_alpha; uint8_t limited_range; BPGColorSpaceEnum color_space; - uint32_t ycc_data_len; - uint32_t alpha_data_len; + uint32_t hevc_data_len; BPGExtensionData *first_md; } BPGHeaderData; @@ -1302,7 +1500,7 @@ static int bpg_decode_header(BPGHeaderData *h, idx = 4; flags1 = buf[idx++]; h->format = flags1 >> 5; - if (h->format > 3) + if (h->format > 5) return -1; alpha1_flag = (flags1 >> 4) & 1; h->bit_depth = (flags1 & 0xf) + 8; @@ -1343,7 +1541,7 @@ static int bpg_decode_header(BPGHeaderData *h, if (header_only) return idx; - ret = get_ue(&h->ycc_data_len, buf + idx, buf_len - idx); + ret = get_ue(&h->hevc_data_len, buf + idx, buf_len - idx); if (ret < 0) return -1; idx += ret; @@ -1356,14 +1554,6 @@ static int bpg_decode_header(BPGHeaderData *h, idx += ret; } - h->alpha_data_len = 0; - if (h->has_alpha) { - ret = get_ue(&h->alpha_data_len, buf + idx, buf_len - idx); - if (ret < 0) - return -1; - idx += ret; - } - h->first_md = NULL; if (has_extension) { int ext_end; @@ -1407,12 +1597,16 @@ static int bpg_decode_header(BPGHeaderData *h, idx += extension_data_len; } } + + if (h->hevc_data_len == 0) + h->hevc_data_len = buf_len - idx; + return idx; } int bpg_decoder_decode(BPGDecoderContext *img, const uint8_t *buf, int buf_len) { - int idx, has_alpha, format, bit_depth, chroma_format_idc, color_space; + int idx, has_alpha, bit_depth, color_space; uint32_t width, height; BPGHeaderData h_s, *h = &h_s; @@ -1421,14 +1615,23 @@ int bpg_decoder_decode(BPGDecoderContext *img, const uint8_t *buf, int buf_len) return idx; width = h->width; height = h->height; - format = h->format; has_alpha = h->has_alpha; color_space = h->color_space; bit_depth = h->bit_depth; img->w = width; img->h = height; - img->format = format; + img->format = h->format; + if (h->format == BPG_FORMAT_422_VIDEO) { + img->format = BPG_FORMAT_422; + img->c_h_phase = 0; + } else if (h->format == BPG_FORMAT_420_VIDEO) { + img->format = BPG_FORMAT_420; + img->c_h_phase = 0; + } else { + img->format = h->format; + img->c_h_phase = 1; + } img->has_alpha = has_alpha; img->premultiplied_alpha = h->premultiplied_alpha; img->has_w_plane = h->has_w_plane; @@ -1437,53 +1640,17 @@ int bpg_decoder_decode(BPGDecoderContext *img, const uint8_t *buf, int buf_len) img->bit_depth = bit_depth; img->first_md = h->first_md; - if (idx + h->ycc_data_len > buf_len) + if (idx + h->hevc_data_len > buf_len) goto fail; - chroma_format_idc = format; - img->frame = hevc_decode(buf + idx, h->ycc_data_len, - width, height, chroma_format_idc, bit_depth); - if (!img->frame) + if (hevc_decode(&img->frame, &img->alpha_frame, + buf + idx, h->hevc_data_len, + width, height, img->format, bit_depth, has_alpha) < 0) goto fail; - idx += h->ycc_data_len; + idx += h->hevc_data_len; if (img->frame->width < img->w || img->frame->height < img->h) goto fail; - switch(img->frame->format) { - case AV_PIX_FMT_YUV420P16: - case AV_PIX_FMT_YUV420P: - if (format != BPG_FORMAT_420) - goto fail; - break; - case AV_PIX_FMT_YUV422P16: - case AV_PIX_FMT_YUV422P: - if (format != BPG_FORMAT_422) - goto fail; - break; - case AV_PIX_FMT_YUV444P16: - case AV_PIX_FMT_YUV444P: - if (format != BPG_FORMAT_444) - goto fail; - break; - case AV_PIX_FMT_GRAY16: - case AV_PIX_FMT_GRAY8: - if (format != BPG_FORMAT_GRAY) - goto fail; - break; - default: - goto fail; - } - - if (has_alpha) { - if (idx + h->alpha_data_len > buf_len) - goto fail; - img->alpha_frame = hevc_decode(buf + idx, h->alpha_data_len, - width, height, 0, bit_depth); - if (!img->alpha_frame) - goto fail; - idx += h->alpha_data_len; - } - img->y = -1; return 0; diff --git a/libbpg.h b/libbpg.h index c8714ed..b1eae34 100644 --- a/libbpg.h +++ b/libbpg.h @@ -28,9 +28,11 @@ typedef struct BPGDecoderContext BPGDecoderContext; typedef enum { BPG_FORMAT_GRAY, - BPG_FORMAT_420, - BPG_FORMAT_422, + BPG_FORMAT_420, /* chroma at offset (0.5, 0.5) (JPEG) */ + BPG_FORMAT_422, /* chroma at offset (0.5, 0) (JPEG) */ BPG_FORMAT_444, + BPG_FORMAT_420_VIDEO, /* chroma at offset (0, 0.5) (MPEG2) */ + BPG_FORMAT_422_VIDEO, /* chroma at offset (0, 0) (MPEG2) */ } BPGImageFormatEnum; typedef enum {