Adding container independent transcoding support. See methods basisu_lowlevel_etc1s_transcoder::transcode_image() and basisu_lowlevel_uastc_transcoder::transcode_image().
diff --git a/transcoder/basisu_transcoder.cpp b/transcoder/basisu_transcoder.cpp
index 558d3cf..9366f0a 100644
--- a/transcoder/basisu_transcoder.cpp
+++ b/transcoder/basisu_transcoder.cpp
@@ -3814,7 +3814,7 @@
 		assert(num_bits < 32);
 		assert(val < (1ULL << num_bits));
 
-		uint32_t mask = (1ULL << num_bits) - 1;
+		uint32_t mask = static_cast<uint32_t>((1ULL << num_bits) - 1);
 
 		while (num_bits)
 		{
@@ -7880,7 +7880,7 @@
 	}
 
 	bool basisu_lowlevel_etc1s_transcoder::transcode_slice(void* pDst_blocks, uint32_t num_blocks_x, uint32_t num_blocks_y, const uint8_t* pImage_data, uint32_t image_data_size, block_format fmt,
-		uint32_t output_block_or_pixel_stride_in_bytes, bool bc1_allow_threecolor_blocks, const basis_file_header& header, const basis_slice_desc& slice_desc, uint32_t output_row_pitch_in_blocks_or_pixels,
+		uint32_t output_block_or_pixel_stride_in_bytes, bool bc1_allow_threecolor_blocks, const bool is_video, const bool is_alpha_slice, const uint32_t level_index, const uint32_t orig_width, const uint32_t orig_height, uint32_t output_row_pitch_in_blocks_or_pixels,
 		basisu_transcoder_state* pState, bool transcode_alpha, void *pAlpha_blocks, uint32_t output_rows_in_pixels)
 	{
 		// 'pDst_blocks' unused when disabling *all* hardware transcode options
@@ -7893,17 +7893,16 @@
 		if (!pState)
 			pState = &m_def_state;
 
-		const bool is_video = (header.m_tex_type == cBASISTexTypeVideoFrames);
 		const uint32_t total_blocks = num_blocks_x * num_blocks_y;
 
 		if (!output_row_pitch_in_blocks_or_pixels)
 		{
 			if (basis_block_format_is_uncompressed(fmt))
-				output_row_pitch_in_blocks_or_pixels = slice_desc.m_orig_width;
+				output_row_pitch_in_blocks_or_pixels = orig_width;
 			else
 			{
 				if (fmt == block_format::cFXT1_RGB)
-					output_row_pitch_in_blocks_or_pixels = (slice_desc.m_orig_width + 7) / 8;
+					output_row_pitch_in_blocks_or_pixels = (orig_width + 7) / 8;
 				else
 					output_row_pitch_in_blocks_or_pixels = num_blocks_x;
 			}
@@ -7912,15 +7911,15 @@
 		if (basis_block_format_is_uncompressed(fmt))
 		{
 			if (!output_rows_in_pixels)
-				output_rows_in_pixels = slice_desc.m_orig_height;
+				output_rows_in_pixels = orig_height;
 		}
 		
 		std::vector<uint32_t>* pPrev_frame_indices = nullptr;
 		if (is_video)
 		{
 			// TODO: Add check to make sure the caller hasn't tried skipping past p-frames
-			const bool alpha_flag = (slice_desc.m_flags & cSliceDescFlagsHasAlpha) != 0;
-			const uint32_t level_index = slice_desc.m_level_index;
+			//const bool alpha_flag = (slice_desc.m_flags & cSliceDescFlagsHasAlpha) != 0;
+			//const uint32_t level_index = slice_desc.m_level_index;
 
 			if (level_index >= basisu_transcoder_state::cMaxPrevFrameLevels)
 			{
@@ -7928,7 +7927,7 @@
 				return false;
 			}
 
-			pPrev_frame_indices = &pState->m_prev_frame_indices[alpha_flag][level_index];
+			pPrev_frame_indices = &pState->m_prev_frame_indices[is_alpha_slice][level_index];
 			if (pPrev_frame_indices->size() < total_blocks)
 				pPrev_frame_indices->resize(total_blocks);
 		}
@@ -8687,13 +8686,642 @@
 
 		return true;
 	}
+
+	bool basis_validate_output_buffer_size(transcoder_texture_format target_format,
+		uint32_t output_blocks_buf_size_in_blocks_or_pixels,
+		uint32_t orig_width, uint32_t orig_height,
+		uint32_t output_row_pitch_in_blocks_or_pixels,
+		uint32_t output_rows_in_pixels,
+		uint32_t total_slice_blocks)
+	{
+		if (basis_transcoder_format_is_uncompressed(target_format))
+		{
+			// Assume the output buffer is orig_width by orig_height
+			if (!output_row_pitch_in_blocks_or_pixels)
+				output_row_pitch_in_blocks_or_pixels = orig_width;
+
+			if (!output_rows_in_pixels)
+				output_rows_in_pixels = orig_height;
+
+			// Now make sure the output buffer is large enough, or we'll overwrite memory.
+			if (output_blocks_buf_size_in_blocks_or_pixels < (output_rows_in_pixels * output_row_pitch_in_blocks_or_pixels))
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: output_blocks_buf_size_in_blocks_or_pixels < (output_rows_in_pixels * output_row_pitch_in_blocks_or_pixels)\n");
+				return false;
+			}
+		}
+		else if (target_format == transcoder_texture_format::cTFFXT1_RGB)
+		{
+			const uint32_t num_blocks_fxt1_x = (orig_width + 7) / 8;
+			const uint32_t num_blocks_fxt1_y = (orig_height + 3) / 4;
+			const uint32_t total_blocks_fxt1 = num_blocks_fxt1_x * num_blocks_fxt1_y;
+
+			if (output_blocks_buf_size_in_blocks_or_pixels < total_blocks_fxt1)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: output_blocks_buf_size_in_blocks_or_pixels < total_blocks_fxt1\n");
+				return false;
+			}
+		}
+		else
+		{
+			if (output_blocks_buf_size_in_blocks_or_pixels < total_slice_blocks)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: output_blocks_buf_size_in_blocks_or_pixels < transcode_image\n");
+				return false;
+			}
+		}
+		return true;
+	}
+
+	bool basisu_lowlevel_etc1s_transcoder::transcode_image(
+			transcoder_texture_format target_format,
+			void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
+			const uint8_t* pCompressed_data, uint32_t compressed_data_length,
+			uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
+			uint32_t rgb_offset, uint32_t rgb_length, uint32_t alpha_offset, uint32_t alpha_length,
+			uint32_t decode_flags,
+			bool basis_file_has_alpha_slices,
+			bool is_video,
+			uint32_t output_row_pitch_in_blocks_or_pixels,
+			basisu_transcoder_state* pState,
+			uint32_t output_rows_in_pixels)
+	{
+		if (((uint64_t)rgb_offset + rgb_length) > (uint64_t)compressed_data_length)
+		{
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: source data buffer too small (color)\n");
+			return false;
+		}
+
+		if (alpha_length)
+		{
+			if (((uint64_t)alpha_offset + alpha_length) > (uint64_t)compressed_data_length)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: source data buffer too small (alpha)\n");
+				return false;
+			}
+		}
+		else
+		{
+			assert(!basis_file_has_alpha_slices);
+		}
+
+		if ((target_format == transcoder_texture_format::cTFPVRTC1_4_RGB) || (target_format == transcoder_texture_format::cTFPVRTC1_4_RGBA))
+		{
+			if ((!basisu::is_pow2(num_blocks_x * 4)) || (!basisu::is_pow2(num_blocks_y * 4)))
+			{
+				// PVRTC1 only supports power of 2 dimensions
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: PVRTC1 only supports power of 2 dimensions\n");
+				return false;
+			}
+		}
+
+		if ((target_format == transcoder_texture_format::cTFPVRTC1_4_RGBA) && (!basis_file_has_alpha_slices))
+		{
+			// Switch to PVRTC1 RGB if the input doesn't have alpha.
+			target_format = transcoder_texture_format::cTFPVRTC1_4_RGB;
+		}
+				
+		const bool transcode_alpha_data_to_opaque_formats = (decode_flags & cDecodeFlagsTranscodeAlphaDataToOpaqueFormats) != 0;
+		const uint32_t bytes_per_block_or_pixel = basis_get_bytes_per_block_or_pixel(target_format);
+		const uint32_t total_slice_blocks = num_blocks_x * num_blocks_y;
+
+		if (!basis_validate_output_buffer_size(target_format, output_blocks_buf_size_in_blocks_or_pixels, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, output_rows_in_pixels, total_slice_blocks))
+		{
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: output buffer size too small\n");
+			return false;
+		}
+
+		bool status = false;
+
+		const uint8_t* pData = pCompressed_data + rgb_offset;
+		uint32_t data_len = rgb_length;
+		bool is_alpha_slice = false;
+
+		// If the caller wants us to transcode the mip level's alpha data, then use the next slice.
+		if ((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats))
+		{
+			pData = pCompressed_data + alpha_offset;
+			data_len = alpha_length;
+			is_alpha_slice = true;
+		}
+
+		switch (target_format)
+		{
+		case transcoder_texture_format::cTFETC1_RGB:
+		{
+			//status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC1, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pData, data_len, block_format::cETC1, bytes_per_block_or_pixel, false, is_video, is_alpha_slice, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+							
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to ETC1 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFBC1_RGB:
+		{
+#if !BASISD_SUPPORT_DXT1
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: BC1/DXT1 unsupported\n");
+			return false;
+#endif
+			// status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC1, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pData, data_len, block_format::cBC1, bytes_per_block_or_pixel, true, is_video, is_alpha_slice, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to BC1 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFBC4_R:
+		{
+#if !BASISD_SUPPORT_DXT5A
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: BC4/DXT5A unsupported\n");
+			return false;
+#endif
+			//status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pData, data_len, block_format::cBC4, bytes_per_block_or_pixel, false, is_video, is_alpha_slice, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to BC4 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFPVRTC1_4_RGB:
+		{
+#if !BASISD_SUPPORT_PVRTC1
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: PVRTC1 4 unsupported\n");
+			return false;
+#endif
+			// output_row_pitch_in_blocks_or_pixels is actually ignored because we're transcoding to PVRTC1. (Print a dev warning if it's != 0?)
+			//status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC1_4_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pData, data_len, block_format::cPVRTC1_4_RGB, bytes_per_block_or_pixel, false, is_video, is_alpha_slice, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to PVRTC1 4 RGB failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFPVRTC1_4_RGBA:
+		{
+#if !BASISD_SUPPORT_PVRTC1
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: PVRTC1 4 unsupported\n");
+			return false;
+#endif
+			assert(basis_file_has_alpha_slices);
+			assert(alpha_length);
+
+			// Temp buffer to hold alpha block endpoint/selector indices
+			std::vector<uint32_t> temp_block_indices(total_slice_blocks);
+
+			// First transcode alpha data to temp buffer
+			//status = transcode_slice(pData, data_size, slice_index + 1, &temp_block_indices[0], total_slice_blocks, block_format::cIndices, sizeof(uint32_t), decode_flags, pSlice_descs[slice_index].m_num_blocks_x, pState);
+			status = transcode_slice(&temp_block_indices[0], num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cIndices, sizeof(uint32_t), false, is_video, true, level_index, orig_width, orig_height, num_blocks_x, pState, false, nullptr, 0);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to PVRTC1 4 RGBA failed (0)\n");
+			}
+			else
+			{
+				// output_row_pitch_in_blocks_or_pixels is actually ignored because we're transcoding to PVRTC1. (Print a dev warning if it's != 0?)
+				//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC1_4_RGBA, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState, &temp_block_indices[0]);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cPVRTC1_4_RGBA, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, &temp_block_indices[0], 0);
+				if (!status)
+				{
+					BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to PVRTC1 4 RGBA failed (1)\n");
+				}
+			}
+
+			break;
+		}
+		case transcoder_texture_format::cTFBC7_RGBA:
+		case transcoder_texture_format::cTFBC7_ALT:
+		{
+#if !BASISD_SUPPORT_BC7_MODE5
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: BC7 unsupported\n");
+			return false;
+#else
+			assert(bytes_per_block_or_pixel == 16);
+			// We used to support transcoding just alpha to BC7 - but is that useful at all?
+
+			// First transcode the color slice. The cBC7_M5_COLOR transcoder will output opaque mode 5 blocks.
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC7_M5_COLOR, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cBC7_M5_COLOR, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+
+			if ((status) && (basis_file_has_alpha_slices))
+			{
+				// Now transcode the alpha slice. The cBC7_M5_ALPHA transcoder will now change the opaque mode 5 blocks to blocks with alpha.
+				//status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC7_M5_ALPHA, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cBC7_M5_ALPHA, bytes_per_block_or_pixel, false, is_video, true, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			}
+
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to BC7 failed (0)\n");
+			}
+
+			break;
+#endif
+		}
+		case transcoder_texture_format::cTFETC2_RGBA:
+		{
+#if !BASISD_SUPPORT_ETC2_EAC_A8
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: ETC2 EAC A8 unsupported\n");
+			return false;
+#endif
+			assert(bytes_per_block_or_pixel == 16);
+
+			if (basis_file_has_alpha_slices)
+			{
+				// First decode the alpha data 
+				//status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_A8, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cETC2_EAC_A8, bytes_per_block_or_pixel, false, is_video, true, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			}
+			else
+			{
+				//write_opaque_alpha_blocks(pSlice_descs[slice_index].m_num_blocks_x, pSlice_descs[slice_index].m_num_blocks_y, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_A8, 16, output_row_pitch_in_blocks_or_pixels);
+				basisu_transcoder::write_opaque_alpha_blocks(num_blocks_x, num_blocks_y, pOutput_blocks, block_format::cETC2_EAC_A8, 16, output_row_pitch_in_blocks_or_pixels);
+				status = true;
+			}
+
+			if (status)
+			{
+				// Now decode the color data
+				//status = transcode_slice(pData, data_size, slice_index, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC1, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice((uint8_t *)pOutput_blocks + 8, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cETC1, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+				if (!status)
+				{
+					BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to ETC2 RGB failed\n");
+				}
+			}
+			else
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to ETC2 A failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFBC3_RGBA:
+		{
+#if !BASISD_SUPPORT_DXT1
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: DXT1 unsupported\n");
+			return false;
+#endif
+#if !BASISD_SUPPORT_DXT5A
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: DXT5A unsupported\n");
+			return false;
+#endif
+			assert(bytes_per_block_or_pixel == 16);
+						
+			// First decode the alpha data 
+			if (basis_file_has_alpha_slices)
+			{
+				//status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cBC4, bytes_per_block_or_pixel, false, is_video, true, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			}
+			else
+			{
+				basisu_transcoder::write_opaque_alpha_blocks(num_blocks_x, num_blocks_y, pOutput_blocks, block_format::cBC4, 16, output_row_pitch_in_blocks_or_pixels);
+				status = true;
+			}
+
+			if (status)
+			{
+				// Now decode the color data. Forbid 3 color blocks, which aren't allowed in BC3.
+				//status = transcode_slice(pData, data_size, slice_index, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC1, 16, decode_flags | cDecodeFlagsBC1ForbidThreeColorBlocks, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice((uint8_t *)pOutput_blocks + 8, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cBC1, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+				if (!status)
+				{
+					BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to BC3 RGB failed\n");
+				}
+			}
+			else
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to BC3 A failed\n");
+			}
+
+			break;
+		}
+		case transcoder_texture_format::cTFBC5_RG:
+		{
+#if !BASISD_SUPPORT_DXT5A
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: DXT5A unsupported\n");
+			return false;
+#endif
+			assert(bytes_per_block_or_pixel == 16);
+
+			//bool transcode_slice(void* pDst_blocks, uint32_t num_blocks_x, uint32_t num_blocks_y, const uint8_t* pImage_data, uint32_t image_data_size, block_format fmt,
+				//	uint32_t output_block_or_pixel_stride_in_bytes, bool bc1_allow_threecolor_blocks, const bool is_video, const bool is_alpha_slice, const uint32_t level_index, const uint32_t orig_width, const uint32_t orig_height, uint32_t output_row_pitch_in_blocks_or_pixels = 0,
+				//	basisu_transcoder_state* pState = nullptr, bool astc_transcode_alpha = false, void* pAlpha_blocks = nullptr, uint32_t output_rows_in_pixels = 0);
+
+			// Decode the R data (actually the green channel of the color data slice in the basis file)
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cBC4, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			if (status)
+			{
+				if (basis_file_has_alpha_slices)
+				{
+					// Decode the G data (actually the green channel of the alpha data slice in the basis file)
+					//status = transcode_slice(pData, data_size, slice_index + 1, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+					status = transcode_slice((uint8_t *)pOutput_blocks + 8, num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cBC4, bytes_per_block_or_pixel, false, is_video, true, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+					if (!status)
+					{
+						BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to BC5 1 failed\n");
+					}
+				}
+				else
+				{
+					basisu_transcoder::write_opaque_alpha_blocks(num_blocks_x, num_blocks_y, (uint8_t*)pOutput_blocks + 8, block_format::cBC4, 16, output_row_pitch_in_blocks_or_pixels);
+					status = true;
+				}
+			}
+			else
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to BC5 channel 0 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFASTC_4x4_RGBA:
+		{
+#if !BASISD_SUPPORT_ASTC
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: ASTC unsupported\n");
+			return false;
+#endif
+			assert(bytes_per_block_or_pixel == 16);
+
+			if (basis_file_has_alpha_slices)
+			{
+				// First decode the alpha data to the output (we're using the output texture as a temp buffer here).
+				//status = transcode_slice(pData, data_size, slice_index + 1, (uint8_t*)pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cIndices, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cIndices, bytes_per_block_or_pixel, false, is_video, true, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+				if (status)
+				{
+					// Now decode the color data and transcode to ASTC. The transcoder function will read the alpha selector data from the output texture as it converts and
+					// transcode both the alpha and color data at the same time to ASTC.
+					//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cASTC_4x4, 16, decode_flags | cDecodeFlagsOutputHasAlphaIndices, output_row_pitch_in_blocks_or_pixels, pState);
+					status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cASTC_4x4, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, true, nullptr, output_rows_in_pixels);
+				}
+			}
+			else
+				//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cASTC_4x4, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cASTC_4x4, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to ASTC failed (0)\n");
+			}
+
+			break;
+		}
+		case transcoder_texture_format::cTFATC_RGB:
+		{
+#if !BASISD_SUPPORT_ATC
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: ATC unsupported\n");
+			return false;
+#endif
+			//status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cATC_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pData, data_len, block_format::cATC_RGB, bytes_per_block_or_pixel, false, is_video, is_alpha_slice, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to ATC_RGB failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFATC_RGBA:
+		{
+#if !BASISD_SUPPORT_ATC
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: ATC unsupported\n");
+			return false;
+#endif
+#if !BASISD_SUPPORT_DXT5A
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: DXT5A unsupported\n");
+			return false;
+#endif
+			assert(bytes_per_block_or_pixel == 16);
+
+			// First decode the alpha data 
+			if (basis_file_has_alpha_slices)
+			{
+				//status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cBC4, bytes_per_block_or_pixel, false, is_video, true, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			}
+			else
+			{
+				basisu_transcoder::write_opaque_alpha_blocks(num_blocks_x, num_blocks_y, pOutput_blocks, block_format::cBC4, 16, output_row_pitch_in_blocks_or_pixels);
+				status = true;
+			}
+
+			if (status)
+			{
+				//status = transcode_slice(pData, data_size, slice_index, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cATC_RGB, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice((uint8_t *)pOutput_blocks + 8, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cATC_RGB, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+				if (!status)
+				{
+					BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to ATC RGB failed\n");
+				}
+			}
+			else
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to ATC A failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFPVRTC2_4_RGB:
+		{
+#if !BASISD_SUPPORT_PVRTC2
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: PVRTC2 unsupported\n");
+			return false;
+#endif
+			//status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC2_4_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pData, data_len, block_format::cPVRTC2_4_RGB, bytes_per_block_or_pixel, false, is_video, is_alpha_slice, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to cPVRTC2_4_RGB failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFPVRTC2_4_RGBA:
+		{
+#if !BASISD_SUPPORT_PVRTC2
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: PVRTC2 unsupported\n");
+			return false;
+#endif
+			if (basis_file_has_alpha_slices)
+			{
+				// First decode the alpha data to the output (we're using the output texture as a temp buffer here).
+				//status = transcode_slice(pData, data_size, slice_index + 1, (uint8_t*)pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cIndices, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cIndices, bytes_per_block_or_pixel, false, is_video, true, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+				if (!status)
+				{
+					BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to failed\n");
+				}
+				else
+				{
+					// Now decode the color data and transcode to PVRTC2 RGBA. 
+					//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC2_4_RGBA, bytes_per_block_or_pixel, decode_flags | cDecodeFlagsOutputHasAlphaIndices, output_row_pitch_in_blocks_or_pixels, pState);
+					status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cPVRTC2_4_RGBA, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, true, nullptr, output_rows_in_pixels);
+				}
+			}
+			else
+				//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC2_4_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cPVRTC2_4_RGB, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to cPVRTC2_4_RGBA failed\n");
+			}
+
+			break;
+		}
+		case transcoder_texture_format::cTFRGBA32:
+		{
+			// Raw 32bpp pixels, decoded in the usual raster order (NOT block order) into an image in memory.
+
+			// First decode the alpha data 
+			if (basis_file_has_alpha_slices)
+				//status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cA32, sizeof(uint32_t), decode_flags, output_row_pitch_in_blocks_or_pixels, pState, nullptr, output_rows_in_pixels);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cA32, sizeof(uint32_t), false, is_video, true, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			else
+				status = true;
+
+			if (status)
+			{
+				//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, basis_file_has_alpha_slices ? block_format::cRGB32 : block_format::cRGBA32, sizeof(uint32_t), decode_flags, output_row_pitch_in_blocks_or_pixels, pState, nullptr, output_rows_in_pixels);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, basis_file_has_alpha_slices ? block_format::cRGB32 : block_format::cRGBA32, sizeof(uint32_t), false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+				if (!status)
+				{
+					BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to RGBA32 RGB failed\n");
+				}
+			}
+			else
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to RGBA32 A failed\n");
+			}
+
+			break;
+		}
+		case transcoder_texture_format::cTFRGB565:
+		case transcoder_texture_format::cTFBGR565:
+		{
+			// Raw 16bpp pixels, decoded in the usual raster order (NOT block order) into an image in memory.
+
+			//status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, (fmt == transcoder_texture_format::cTFRGB565) ? block_format::cRGB565 : block_format::cBGR565, sizeof(uint16_t), decode_flags, output_row_pitch_in_blocks_or_pixels, pState, nullptr, output_rows_in_pixels);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pData, data_len, (target_format == transcoder_texture_format::cTFRGB565) ? block_format::cRGB565 : block_format::cBGR565, sizeof(uint16_t), false, is_video, is_alpha_slice, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to RGB565 RGB failed\n");
+			}
+
+			break;
+		}
+		case transcoder_texture_format::cTFRGBA4444:
+		{
+			// Raw 16bpp pixels, decoded in the usual raster order (NOT block order) into an image in memory.
+
+			// First decode the alpha data 
+			if (basis_file_has_alpha_slices)
+				//status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cRGBA4444_ALPHA, sizeof(uint16_t), decode_flags, output_row_pitch_in_blocks_or_pixels, pState, nullptr, output_rows_in_pixels);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cRGBA4444_ALPHA, sizeof(uint16_t), false, is_video, true, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			else
+				status = true;
+
+			if (status)
+			{
+				//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, basis_file_has_alpha_slices ? block_format::cRGBA4444_COLOR : block_format::cRGBA4444_COLOR_OPAQUE, sizeof(uint16_t), decode_flags, output_row_pitch_in_blocks_or_pixels, pState, nullptr, output_rows_in_pixels);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, basis_file_has_alpha_slices ? block_format::cRGBA4444_COLOR : block_format::cRGBA4444_COLOR_OPAQUE, sizeof(uint16_t), false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+				if (!status)
+				{
+					BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to RGBA4444 RGB failed\n");
+				}
+			}
+			else
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to RGBA4444 A failed\n");
+			}
+
+			break;
+		}
+		case transcoder_texture_format::cTFFXT1_RGB:
+		{
+#if !BASISD_SUPPORT_FXT1
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: FXT1 unsupported\n");
+			return false;
+#endif
+			//status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cFXT1_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pData, data_len, block_format::cFXT1_RGB, bytes_per_block_or_pixel, false, is_video, is_alpha_slice, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to FXT1_RGB failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFETC2_EAC_R11:
+		{
+#if !BASISD_SUPPORT_ETC2_EAC_RG11
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: EAC_RG11 unsupported\n");
+			return false;
+#endif
+			//status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_R11, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pData, data_len, block_format::cETC2_EAC_R11, bytes_per_block_or_pixel, false, is_video, is_alpha_slice, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to ETC2_EAC_R11 failed\n");
+			}
+
+			break;
+		}
+		case transcoder_texture_format::cTFETC2_EAC_RG11:
+		{
+#if !BASISD_SUPPORT_ETC2_EAC_RG11
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: EAC_RG11 unsupported\n");
+			return false;
+#endif
+			assert(bytes_per_block_or_pixel == 16);
+
+			if (basis_file_has_alpha_slices)
+			{
+				// First decode the alpha data to G
+				//status = transcode_slice(pData, data_size, slice_index + 1, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_R11, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice((uint8_t *)pOutput_blocks + 8, num_blocks_x, num_blocks_y, pCompressed_data + alpha_offset, alpha_length, block_format::cETC2_EAC_R11, bytes_per_block_or_pixel, false, is_video, true, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+			}
+			else
+			{
+				basisu_transcoder::write_opaque_alpha_blocks(num_blocks_x, num_blocks_y, (uint8_t*)pOutput_blocks + 8, block_format::cETC2_EAC_R11, 16, output_row_pitch_in_blocks_or_pixels);
+				status = true;
+			}
+
+			if (status)
+			{
+				// Now decode the color data to R
+				//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_R11, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+				status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + rgb_offset, rgb_length, block_format::cETC2_EAC_R11, bytes_per_block_or_pixel, false, is_video, false, level_index, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, false, nullptr, output_rows_in_pixels);
+				if (!status)
+				{
+					BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to ETC2_EAC_R11 R failed\n");
+				}
+			}
+			else
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: transcode_slice() to ETC2_EAC_R11 G failed\n");
+			}
+
+			break;
+		}
+		default:
+		{
+			assert(0);
+			BASISU_DEVEL_ERROR("basisu_lowlevel_etc1s_transcoder::transcode_image: Invalid fmt\n");
+			break;
+		}
+		}
+
+		return status;
+	}
 	
 	basisu_lowlevel_uastc_transcoder::basisu_lowlevel_uastc_transcoder()
 	{
 	}
 
 	bool basisu_lowlevel_uastc_transcoder::transcode_slice(void* pDst_blocks, uint32_t num_blocks_x, uint32_t num_blocks_y, const uint8_t* pImage_data, uint32_t image_data_size, block_format fmt,
-		uint32_t output_block_or_pixel_stride_in_bytes, bool bc1_allow_threecolor_blocks, const basis_file_header& header, const basis_slice_desc& slice_desc, uint32_t output_row_pitch_in_blocks_or_pixels,
+        uint32_t output_block_or_pixel_stride_in_bytes, bool bc1_allow_threecolor_blocks, bool has_alpha, const uint32_t orig_width, const uint32_t orig_height, uint32_t output_row_pitch_in_blocks_or_pixels,
 		basisu_transcoder_state* pState, uint32_t output_rows_in_pixels, int channel0, int channel1, uint32_t decode_flags)
 	{
 		BASISU_NOTE_UNUSED(pState);
@@ -8705,11 +9333,11 @@
 		if (!output_row_pitch_in_blocks_or_pixels)
 		{
 			if (basis_block_format_is_uncompressed(fmt))
-				output_row_pitch_in_blocks_or_pixels = slice_desc.m_orig_width;
+				output_row_pitch_in_blocks_or_pixels = orig_width;
 			else
 			{
 				if (fmt == block_format::cFXT1_RGB)
-					output_row_pitch_in_blocks_or_pixels = (slice_desc.m_orig_width + 7) / 8;
+					output_row_pitch_in_blocks_or_pixels = (orig_width + 7) / 8;
 				else
 					output_row_pitch_in_blocks_or_pixels = num_blocks_x;
 			}
@@ -8718,7 +9346,7 @@
 		if (basis_block_format_is_uncompressed(fmt))
 		{
 			if (!output_rows_in_pixels)
-				output_rows_in_pixels = slice_desc.m_orig_height;
+				output_rows_in_pixels = orig_height;
 		}
 
 		uint32_t total_expected_block_bytes = sizeof(uastc_block) * total_blocks;
@@ -8731,7 +9359,7 @@
 		const uastc_block* pSource_block = reinterpret_cast<const uastc_block *>(pImage_data);
 
 		const bool high_quality = (decode_flags & cDecodeFlagsHighQuality) != 0;
-		const bool from_alpha = ((header.m_flags & cBASISHeaderFlagHasAlphaSlices) != 0) &&	(decode_flags & cDecodeFlagsTranscodeAlphaDataToOpaqueFormats) != 0;
+		const bool from_alpha = has_alpha && (decode_flags & cDecodeFlagsTranscodeAlphaDataToOpaqueFormats) != 0;
 
 		bool status = false;
 		if ((fmt == block_format::cPVRTC1_4_RGB) || (fmt == block_format::cPVRTC1_4_RGBA))
@@ -8941,6 +9569,283 @@
 		return false;
 #endif
 	}
+		
+	bool basisu_lowlevel_uastc_transcoder::transcode_image(
+		transcoder_texture_format target_format,
+		void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
+		const uint8_t* pCompressed_data, uint32_t compressed_data_length,
+		uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
+		uint32_t slice_offset, uint32_t slice_length,
+		uint32_t decode_flags,
+		bool basis_file_has_alpha_slices,
+		bool is_video,
+		uint32_t output_row_pitch_in_blocks_or_pixels,
+		basisu_transcoder_state* pState,
+		uint32_t output_rows_in_pixels,
+		int channel0, int channel1)
+	{
+		BASISU_NOTE_UNUSED(is_video);
+		BASISU_NOTE_UNUSED(level_index);
+
+		if (((uint64_t)slice_offset + slice_length) > (uint64_t)compressed_data_length)
+		{
+			BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: source data buffer too small\n");
+			return false;
+		}	
+
+		if ((target_format == transcoder_texture_format::cTFPVRTC1_4_RGB) || (target_format == transcoder_texture_format::cTFPVRTC1_4_RGBA))
+		{
+			if ((!basisu::is_pow2(num_blocks_x * 4)) || (!basisu::is_pow2(num_blocks_y * 4)))
+			{
+				// PVRTC1 only supports power of 2 dimensions
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: PVRTC1 only supports power of 2 dimensions\n");
+				return false;
+			}
+		}
+
+		if ((target_format == transcoder_texture_format::cTFPVRTC1_4_RGBA) && (!basis_file_has_alpha_slices))
+		{
+			// Switch to PVRTC1 RGB if the input doesn't have alpha.
+			target_format = transcoder_texture_format::cTFPVRTC1_4_RGB;
+		}
+
+		const bool transcode_alpha_data_to_opaque_formats = (decode_flags & cDecodeFlagsTranscodeAlphaDataToOpaqueFormats) != 0;
+		const uint32_t bytes_per_block_or_pixel = basis_get_bytes_per_block_or_pixel(target_format);
+		const uint32_t total_slice_blocks = num_blocks_x * num_blocks_y;
+
+		if (!basis_validate_output_buffer_size(target_format, output_blocks_buf_size_in_blocks_or_pixels, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, output_rows_in_pixels, total_slice_blocks))
+		{
+			BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: output buffer size too small\n");
+			return false;
+		}
+				
+		bool status = false;
+
+		// UASTC4x4
+		switch (target_format)
+		{
+		case transcoder_texture_format::cTFETC1_RGB:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC1, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cETC1,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels, channel0, channel1);
+				
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to ETC1 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFETC2_RGBA:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_RGBA, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cETC2_RGBA,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels, channel0, channel1);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to ETC2 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFBC1_RGB:
+		{
+			// TODO: ETC1S allows BC1 from alpha channel. That doesn't seem actually useful, though.
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC1, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cBC1,
+				bytes_per_block_or_pixel, true, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels, channel0, channel1);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to BC1 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFBC3_RGBA:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC3, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cBC3,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels, channel0, channel1);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to BC3 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFBC4_R:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState,
+			//	nullptr, 0,
+			//	((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats)) ? 3 : 0);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cBC4,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels,
+				((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats)) ? 3 : 0);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to BC4 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFBC5_RG:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC5, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState,
+			//	nullptr, 0,
+			//	0, 3);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cBC5,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels,
+				0, 3);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to BC5 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFBC7_RGBA:
+		case transcoder_texture_format::cTFBC7_ALT:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC7, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cBC7,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to BC7 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFPVRTC1_4_RGB:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC1_4_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cPVRTC1_4_RGB,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to PVRTC1 RGB 4bpp failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFPVRTC1_4_RGBA:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC1_4_RGBA, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cPVRTC1_4_RGBA,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to PVRTC1 RGBA 4bpp failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFASTC_4x4_RGBA:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cASTC_4x4, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cASTC_4x4,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to ASTC 4x4 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFATC_RGB:
+		case transcoder_texture_format::cTFATC_RGBA:
+		{
+			BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: UASTC->ATC currently unsupported\n");
+			return false;
+		}
+		case transcoder_texture_format::cTFFXT1_RGB:
+		{
+			BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: UASTC->FXT1 currently unsupported\n");
+			return false;
+		}
+		case transcoder_texture_format::cTFPVRTC2_4_RGB:
+		{
+			BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: UASTC->PVRTC2 currently unsupported\n");
+			return false;
+		}
+		case transcoder_texture_format::cTFPVRTC2_4_RGBA:
+		{
+			BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: UASTC->PVRTC2 currently unsupported\n");
+			return false;
+		}
+		case transcoder_texture_format::cTFETC2_EAC_R11:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_R11, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState,
+			//	nullptr, 0,
+			//	((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats)) ? 3 : 0);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cETC2_EAC_R11,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels,
+				((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats)) ? 3 : 0);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to EAC R11 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFETC2_EAC_RG11:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_RG11, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState,
+			//	nullptr, 0,
+			//	0, 3);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cETC2_EAC_RG11,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels,
+				0, 3);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_basisu_lowlevel_uastc_transcodertranscoder::transcode_image: transcode_slice() to EAC RG11 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFRGBA32:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cRGBA32, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cRGBA32,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to RGBA32 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFRGB565:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cRGB565, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cRGB565,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to RGB565 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFBGR565:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBGR565, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cBGR565,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to RGB565 failed\n");
+			}
+			break;
+		}
+		case transcoder_texture_format::cTFRGBA4444:
+		{
+			//status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cRGBA4444, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
+			status = transcode_slice(pOutput_blocks, num_blocks_x, num_blocks_y, pCompressed_data + slice_offset, slice_length, block_format::cRGBA4444,
+				bytes_per_block_or_pixel, false, basis_file_has_alpha_slices, orig_width, orig_height, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels);
+			if (!status)
+			{
+				BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: transcode_slice() to RGBA4444 failed\n");
+			}
+			break;
+		}
+		default:
+		{
+			assert(0);
+			BASISU_DEVEL_ERROR("basisu_lowlevel_uastc_transcoder::transcode_image: Invalid format\n");
+			break;
+		}
+		}
+
+		return status;
+	}
 	
 	basisu_transcoder::basisu_transcoder(const etc1_global_selector_codebook* pGlobal_sel_codebook) :
 		m_lowlevel_etc1s_decoder(pGlobal_sel_codebook),
@@ -9686,9 +10591,9 @@
 		return -1;
 	}
 
-	static void write_opaque_alpha_blocks(
+	void basisu_transcoder::write_opaque_alpha_blocks(
 		uint32_t num_blocks_x, uint32_t num_blocks_y,
-		void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels, block_format fmt,
+		void* pOutput_blocks, block_format fmt,
 		uint32_t block_stride_in_bytes, uint32_t output_row_pitch_in_blocks_or_pixels)
 	{
 		// 'num_blocks_y', 'pOutput_blocks' & 'block_stride_in_bytes' unused
@@ -9696,7 +10601,6 @@
 		BASISU_NOTE_UNUSED(num_blocks_y);
 		BASISU_NOTE_UNUSED(pOutput_blocks);
 		BASISU_NOTE_UNUSED(block_stride_in_bytes);
-		BASISU_NOTE_UNUSED(output_blocks_buf_size_in_blocks_or_pixels);
 
 		if (!output_row_pitch_in_blocks_or_pixels)
 			output_row_pitch_in_blocks_or_pixels = num_blocks_x;
@@ -9847,708 +10751,40 @@
 		
 		if (pHeader->m_tex_format == (int)basis_tex_format::cUASTC4x4)
 		{
-			// UASTC4x4
-			switch (fmt)
-			{
-			case transcoder_texture_format::cTFETC1_RGB:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC1, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ETC1 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFETC2_RGBA:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_RGBA, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ETC2 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFBC1_RGB:
-			{
-				// TODO: ETC1S allows BC1 from alpha channel. That doesn't seem actually useful, though.
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC1, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC1 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFBC3_RGBA:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC3, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC3 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFBC4_R:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState,
-					nullptr, 0,
-					((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats)) ? 3 : 0);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC4 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFBC5_RG:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC5, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState, 
-					nullptr, 0, 
-					0, 3);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC5 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFBC7_RGBA:
-			case transcoder_texture_format::cTFBC7_ALT:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC7, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC7 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFPVRTC1_4_RGB:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC1_4_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to PVRTC1 RGB 4bpp failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFPVRTC1_4_RGBA:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC1_4_RGBA, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to PVRTC1 RGBA 4bpp failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFASTC_4x4_RGBA:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cASTC_4x4, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ASTC 4x4 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFATC_RGB:
-			case transcoder_texture_format::cTFATC_RGBA:
-			{
-				BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: UASTC->ATC currently unsupported\n");
-				return false;
-			}
-			case transcoder_texture_format::cTFFXT1_RGB:
-			{
-				BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: UASTC->FXT1 currently unsupported\n");
-				return false;
-			}
-			case transcoder_texture_format::cTFPVRTC2_4_RGB:
-			{
-				BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: UASTC->PVRTC2 currently unsupported\n");
-				return false;
-			}
-			case transcoder_texture_format::cTFPVRTC2_4_RGBA:
-			{
-				BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: UASTC->PVRTC2 currently unsupported\n");
-				return false;
-			}
-			case transcoder_texture_format::cTFETC2_EAC_R11:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_R11, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState, 
-					nullptr, 0,
-					((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats)) ? 3 : 0);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to EAC R11 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFETC2_EAC_RG11:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_RG11, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState, 
-					nullptr, 0, 
-					0, 3);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to EAC RG11 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFRGBA32:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cRGBA32, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to RGBA32 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFRGB565:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cRGB565, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to RGB565 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFBGR565:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBGR565, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to RGB565 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFRGBA4444:
-			{
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cRGBA4444, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to RGBA4444 failed\n");
-				}
-				break;
-			}
-			default:
-			{
-				assert(0);
-				BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: Invalid fmt\n");
-				break;
-			}
-			}
+			const basis_slice_desc* pSlice_desc = &pSlice_descs[slice_index];
+
+			// Use the container independent image transcode method.
+			status = m_lowlevel_uastc_decoder.transcode_image(fmt,
+				pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels,
+				(const uint8_t*)pData, data_size, pSlice_desc->m_num_blocks_x, pSlice_desc->m_num_blocks_y, pSlice_desc->m_orig_width, pSlice_desc->m_orig_height, pSlice_desc->m_level_index,
+				pSlice_desc->m_file_ofs, pSlice_desc->m_file_size,
+				decode_flags, basis_file_has_alpha_slices, pHeader->m_tex_type == cBASISTexTypeVideoFrames, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels);
 		}
 		else 
 		{
 			// ETC1S
+			const basis_slice_desc* pSlice_desc = &pSlice_descs[slice_index];
+			const basis_slice_desc* pAlpha_slice_desc = basis_file_has_alpha_slices ? &pSlice_descs[slice_index + 1] : nullptr;
 
-			switch (fmt)
+			assert((pSlice_desc->m_flags & cSliceDescFlagsHasAlpha) == 0);
+
+			if (pAlpha_slice_desc)
 			{
-			case transcoder_texture_format::cTFETC1_RGB:
-			{
-				uint32_t slice_index_to_decode = slice_index;
-				// If the caller wants us to transcode the mip level's alpha data, then use the next slice.
-				if ((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats))
-					slice_index_to_decode++;
-
-				status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC1, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ETC1 failed\n");
-				}
-				break;
+				// Basic sanity checks
+				assert((pAlpha_slice_desc->m_flags & cSliceDescFlagsHasAlpha) != 0);
+				assert(pSlice_desc->m_num_blocks_x == pAlpha_slice_desc->m_num_blocks_x);
+				assert(pSlice_desc->m_num_blocks_y == pAlpha_slice_desc->m_num_blocks_y);
+				assert(pSlice_desc->m_level_index == pAlpha_slice_desc->m_level_index);
 			}
-			case transcoder_texture_format::cTFBC1_RGB:
-			{
-#if !BASISD_SUPPORT_DXT1
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: DXT1 unsupported\n");
-				return false;
-#endif
-				uint32_t slice_index_to_decode = slice_index;
-				// If the caller wants us to transcode the mip level's alpha data, then use the next slice.
-				if ((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats))
-					slice_index_to_decode++;
 
-				status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC1, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC1 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFBC4_R:
-			{
-#if !BASISD_SUPPORT_DXT5A
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: DXT5A unsupported\n");
-				return false;
-#endif
-				uint32_t slice_index_to_decode = slice_index;
-				// If the caller wants us to transcode the mip level's alpha data, then use the next slice.
-				if ((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats))
-					slice_index_to_decode++;
+			// Use the container independent image transcode method.
+			status = m_lowlevel_etc1s_decoder.transcode_image(fmt,
+				pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels,
+				(const uint8_t *)pData, data_size, pSlice_desc->m_num_blocks_x, pSlice_desc->m_num_blocks_y, pSlice_desc->m_orig_width, pSlice_desc->m_orig_height, pSlice_desc->m_level_index,
+				pSlice_desc->m_file_ofs, pSlice_desc->m_file_size,
+				(pAlpha_slice_desc != nullptr) ? (uint32_t)pAlpha_slice_desc->m_file_ofs : 0U, (pAlpha_slice_desc != nullptr) ? (uint32_t)pAlpha_slice_desc->m_file_size : 0U,
+				decode_flags, basis_file_has_alpha_slices, pHeader->m_tex_type == cBASISTexTypeVideoFrames, output_row_pitch_in_blocks_or_pixels, pState, output_rows_in_pixels);
 
-				status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC4 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFPVRTC1_4_RGB:
-			{
-#if !BASISD_SUPPORT_PVRTC1
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: PVRTC1 unsupported\n");
-				return false;
-#endif
-				uint32_t slice_index_to_decode = slice_index;
-				// If the caller wants us to transcode the mip level's alpha data, then use the next slice.
-				if ((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats))
-					slice_index_to_decode++;
-
-				// output_row_pitch_in_blocks_or_pixels is actually ignored because we're transcoding to PVRTC1. (Print a dev warning if it's != 0?)
-				status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC1_4_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to PVRTC1 4 RGB failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFPVRTC1_4_RGBA:
-			{
-#if !BASISD_SUPPORT_PVRTC1
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: PVRTC1 unsupported\n");
-				return false;
-#endif
-				assert(basis_file_has_alpha_slices);
-
-				// Temp buffer to hold alpha block endpoint/selector indices
-				std::vector<uint32_t> temp_block_indices(total_slice_blocks);
-
-				// First transcode alpha data to temp buffer
-				status = transcode_slice(pData, data_size, slice_index + 1, &temp_block_indices[0], total_slice_blocks, block_format::cIndices, sizeof(uint32_t), decode_flags, pSlice_descs[slice_index].m_num_blocks_x, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to PVRTC1 4 RGBA failed (0)\n");
-				}
-				else
-				{
-					// output_row_pitch_in_blocks_or_pixels is actually ignored because we're transcoding to PVRTC1. (Print a dev warning if it's != 0?)
-					status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC1_4_RGBA, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState, &temp_block_indices[0]);
-					if (!status)
-					{
-						BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to PVRTC1 4 RGBA failed (1)\n");
-					}
-				}
-
-				break;
-			}
-			case transcoder_texture_format::cTFBC7_RGBA:
-			case transcoder_texture_format::cTFBC7_ALT:
-			{
-#if !BASISD_SUPPORT_BC7_MODE5
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: BC7 unsupported\n");
-				return false;
-#else
-				assert(bytes_per_block_or_pixel == 16);
-				// We used to support transcoding just alpha to BC7 - but is that useful at all?
-
-				// First transcode the color slice. The cBC7_M5_COLOR transcoder will output opaque mode 5 blocks.
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC7_M5_COLOR, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-
-				if ((status) && (basis_file_has_alpha_slices))
-				{
-					// Now transcode the alpha slice. The cBC7_M5_ALPHA transcoder will now change the opaque mode 5 blocks to blocks with alpha.
-					status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC7_M5_ALPHA, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				}
-            
-            if (!status)
-            {
-               BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC7 failed (0)\n");
-            }
-
-				break;
-#endif
-			}
-			case transcoder_texture_format::cTFETC2_RGBA:
-			{
-#if !BASISD_SUPPORT_ETC2_EAC_A8
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: ETC2 EAC A8 unsupported\n");
-				return false;
-#endif
-				assert(bytes_per_block_or_pixel == 16);
-
-				if (basis_file_has_alpha_slices)
-				{
-					// First decode the alpha data 
-					status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_A8, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				}
-				else
-				{
-					write_opaque_alpha_blocks(pSlice_descs[slice_index].m_num_blocks_x, pSlice_descs[slice_index].m_num_blocks_y, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_A8, 16, output_row_pitch_in_blocks_or_pixels);
-					status = true;
-				}
-
-				if (status)
-				{
-					// Now decode the color data
-					status = transcode_slice(pData, data_size, slice_index, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC1, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-					if (!status)
-					{
-						BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ETC2 RGB failed\n");
-					}
-				}
-				else
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ETC2 A failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFBC3_RGBA:
-			{
-#if !BASISD_SUPPORT_DXT1
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: DXT1 unsupported\n");
-				return false;
-#endif
-#if !BASISD_SUPPORT_DXT5A
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: DXT5A unsupported\n");
-				return false;
-#endif
-				assert(bytes_per_block_or_pixel == 16);
-
-				// First decode the alpha data 
-				if (basis_file_has_alpha_slices)
-				{
-					status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				}
-				else
-				{
-					write_opaque_alpha_blocks(pSlice_descs[slice_index].m_num_blocks_x, pSlice_descs[slice_index].m_num_blocks_y, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, output_row_pitch_in_blocks_or_pixels);
-					status = true;
-				}
-
-				if (status)
-				{
-					// Now decode the color data. Forbid 3 color blocks, which aren't allowed in BC3.
-					status = transcode_slice(pData, data_size, slice_index, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC1, 16, decode_flags | cDecodeFlagsBC1ForbidThreeColorBlocks, output_row_pitch_in_blocks_or_pixels, pState);
-					if (!status)
-					{
-						BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC3 RGB failed\n");
-					}
-				}
-				else
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC3 A failed\n");
-				}
-
-				break;
-			}
-			case transcoder_texture_format::cTFBC5_RG:
-			{
-#if !BASISD_SUPPORT_DXT5A
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: DXT5A unsupported\n");
-				return false;
-#endif
-				assert(bytes_per_block_or_pixel == 16);
-
-				// Decode the R data (actually the green channel of the color data slice in the basis file)
-				status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (status)
-				{
-					if (basis_file_has_alpha_slices)
-					{
-						// Decode the G data (actually the green channel of the alpha data slice in the basis file)
-						status = transcode_slice(pData, data_size, slice_index + 1, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-						if (!status)
-						{
-							BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC5 1 failed\n");
-						}
-					}
-					else
-					{
-						write_opaque_alpha_blocks(pSlice_descs[slice_index].m_num_blocks_x, pSlice_descs[slice_index].m_num_blocks_y, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, output_row_pitch_in_blocks_or_pixels);
-						status = true;
-					}
-				}
-				else
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to BC5 channel 0 failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFASTC_4x4_RGBA:
-			{
-#if !BASISD_SUPPORT_ASTC
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: ASTC unsupported\n");
-				return false;
-#endif
-				assert(bytes_per_block_or_pixel == 16);
-
-				if (basis_file_has_alpha_slices)
-				{
-					// First decode the alpha data to the output (we're using the output texture as a temp buffer here).
-					status = transcode_slice(pData, data_size, slice_index + 1, (uint8_t*)pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cIndices, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-					if (status)
-					{
-						// Now decode the color data and transcode to ASTC. The transcoder function will read the alpha selector data from the output texture as it converts and
-						// transcode both the alpha and color data at the same time to ASTC.
-						status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cASTC_4x4, 16, decode_flags | cDecodeFlagsOutputHasAlphaIndices, output_row_pitch_in_blocks_or_pixels, pState);
-					}
-				}
-				else
-					status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cASTC_4x4, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-
-            if (!status)
-            {               
-               BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ASTC failed (0)\n");
-            }
-
-				break;
-			}
-			case transcoder_texture_format::cTFATC_RGB:
-			{
-#if !BASISD_SUPPORT_ATC
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: ATC unsupported\n");
-				return false;
-#endif
-				uint32_t slice_index_to_decode = slice_index;
-				// If the caller wants us to transcode the mip level's alpha data, then use the next slice.
-				if ((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats))
-					slice_index_to_decode++;
-
-				status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cATC_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ATC_RGB failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFATC_RGBA:
-			{
-#if !BASISD_SUPPORT_ATC
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: ATC unsupported\n");
-				return false;
-#endif
-#if !BASISD_SUPPORT_DXT5A
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: DXT5A unsupported\n");
-   			return false;
-#endif
-				assert(bytes_per_block_or_pixel == 16);
-
-				// First decode the alpha data 
-				if (basis_file_has_alpha_slices)
-				{
-					status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				}
-				else
-				{
-					write_opaque_alpha_blocks(pSlice_descs[slice_index].m_num_blocks_x, pSlice_descs[slice_index].m_num_blocks_y, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cBC4, 16, output_row_pitch_in_blocks_or_pixels);
-					status = true;
-				}
-
-				if (status)
-				{
-					status = transcode_slice(pData, data_size, slice_index, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cATC_RGB, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-					if (!status)
-					{
-						BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ATC RGB failed\n");
-					}
-				}
-				else
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ATC A failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFPVRTC2_4_RGB:
-			{
-#if !BASISD_SUPPORT_PVRTC2
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: PVRTC2 unsupported\n");
-				return false;
-#endif
-				uint32_t slice_index_to_decode = slice_index;
-				// If the caller wants us to transcode the mip level's alpha data, then use the next slice.
-				if ((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats))
-					slice_index_to_decode++;
-
-				status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC2_4_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to cPVRTC2_4_RGB failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFPVRTC2_4_RGBA:
-			{
-#if !BASISD_SUPPORT_PVRTC2
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: PVRTC2 unsupported\n");
-				return false;
-#endif
-				if (basis_file_has_alpha_slices)
-				{
-					// First decode the alpha data to the output (we're using the output texture as a temp buffer here).
-					status = transcode_slice(pData, data_size, slice_index + 1, (uint8_t*)pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cIndices, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-					if (!status)
-					{
-						BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to failed\n");
-					}
-					else
-					{
-						// Now decode the color data and transcode to PVRTC2 RGBA. 
-						status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC2_4_RGBA, bytes_per_block_or_pixel, decode_flags | cDecodeFlagsOutputHasAlphaIndices, output_row_pitch_in_blocks_or_pixels, pState);
-					}
-				}
-				else
-					status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cPVRTC2_4_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to cPVRTC2_4_RGBA failed\n");
-				}
-
-				break;
-			}
-			case transcoder_texture_format::cTFRGBA32:
-			{
-				// Raw 32bpp pixels, decoded in the usual raster order (NOT block order) into an image in memory.
-
-				// First decode the alpha data 
-				if (basis_file_has_alpha_slices)
-					status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cA32, sizeof(uint32_t), decode_flags, output_row_pitch_in_blocks_or_pixels, pState, nullptr, output_rows_in_pixels);
-				else
-					status = true;
-
-				if (status)
-				{
-					status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, basis_file_has_alpha_slices ? block_format::cRGB32 : block_format::cRGBA32, sizeof(uint32_t), decode_flags, output_row_pitch_in_blocks_or_pixels, pState, nullptr, output_rows_in_pixels);
-					if (!status)
-					{
-						BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to RGBA32 RGB failed\n");
-					}
-				}
-				else
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to RGBA32 A failed\n");
-				}
-
-				break;
-			}
-			case transcoder_texture_format::cTFRGB565:
-			case transcoder_texture_format::cTFBGR565:
-			{
-				// Raw 16bpp pixels, decoded in the usual raster order (NOT block order) into an image in memory.
-
-				uint32_t slice_index_to_decode = slice_index;
-				// If the caller wants us to transcode the mip level's alpha data, then use the next slice.
-				if ((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats))
-					slice_index_to_decode++;
-
-				status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, (fmt == transcoder_texture_format::cTFRGB565) ? block_format::cRGB565 : block_format::cBGR565, sizeof(uint16_t), decode_flags, output_row_pitch_in_blocks_or_pixels, pState, nullptr, output_rows_in_pixels);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to RGB565 RGB failed\n");
-				}
-
-				break;
-			}
-			case transcoder_texture_format::cTFRGBA4444:
-			{
-				// Raw 16bpp pixels, decoded in the usual raster order (NOT block order) into an image in memory.
-
-				// First decode the alpha data 
-				if (basis_file_has_alpha_slices)
-					status = transcode_slice(pData, data_size, slice_index + 1, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cRGBA4444_ALPHA, sizeof(uint16_t), decode_flags, output_row_pitch_in_blocks_or_pixels, pState, nullptr, output_rows_in_pixels);
-				else
-					status = true;
-
-				if (status)
-				{
-					status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, basis_file_has_alpha_slices ? block_format::cRGBA4444_COLOR : block_format::cRGBA4444_COLOR_OPAQUE, sizeof(uint16_t), decode_flags, output_row_pitch_in_blocks_or_pixels, pState, nullptr, output_rows_in_pixels);
-					if (!status)
-					{
-						BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to RGBA4444 RGB failed\n");
-					}
-				}
-				else
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to RGBA4444 A failed\n");
-				}
-
-				break;
-			}
-			case transcoder_texture_format::cTFFXT1_RGB:
-			{
-#if !BASISD_SUPPORT_FXT1
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: FXT1 unsupported\n");
-				return false;
-#endif
-				uint32_t slice_index_to_decode = slice_index;
-				// If the caller wants us to transcode the mip level's alpha data, then use the next slice.
-				if ((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats))
-					slice_index_to_decode++;
-
-				status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cFXT1_RGB, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to FXT1_RGB failed\n");
-				}
-				break;
-			}
-			case transcoder_texture_format::cTFETC2_EAC_R11:
-			{
-#if !BASISD_SUPPORT_ETC2_EAC_RG11
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: EAC_RG11 unsupported\n");
-				return false;
-#endif
-				uint32_t slice_index_to_decode = slice_index;
-				// If the caller wants us to transcode the mip level's alpha data, then use the next slice.
-				if ((basis_file_has_alpha_slices) && (transcode_alpha_data_to_opaque_formats))
-					slice_index_to_decode++;
-
-				status = transcode_slice(pData, data_size, slice_index_to_decode, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_R11, bytes_per_block_or_pixel, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				if (!status)
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ETC2_EAC_R11 failed\n");
-				}
-
-				break;
-			}
-			case transcoder_texture_format::cTFETC2_EAC_RG11:
-			{
-#if !BASISD_SUPPORT_ETC2_EAC_RG11
-            BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: EAC_RG11 unsupported\n");
-				return false;
-#endif
-				assert(bytes_per_block_or_pixel == 16);
-
-				if (basis_file_has_alpha_slices)
-				{
-					// First decode the alpha data to G
-					status = transcode_slice(pData, data_size, slice_index + 1, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_R11, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-				}
-				else
-				{
-					write_opaque_alpha_blocks(pSlice_descs[slice_index].m_num_blocks_x, pSlice_descs[slice_index].m_num_blocks_y, (uint8_t*)pOutput_blocks + 8, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_R11, 16, output_row_pitch_in_blocks_or_pixels);
-					status = true;
-				}
-
-				if (status)
-				{
-					// Now decode the color data to R
-					status = transcode_slice(pData, data_size, slice_index, pOutput_blocks, output_blocks_buf_size_in_blocks_or_pixels, block_format::cETC2_EAC_R11, 16, decode_flags, output_row_pitch_in_blocks_or_pixels, pState);
-					if (!status)
-					{
-						BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ETC2_EAC_R11 R failed\n");
-					}
-				}
-				else
-				{
-					BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: transcode_slice() to ETC2_EAC_R11 G failed\n");
-				}
-
-				break;
-			}
-			default:
-			{
-				assert(0);
-				BASISU_DEVEL_ERROR("basisu_transcoder::transcode_image_level: Invalid fmt\n");
-				break;
-			}
-			}
 		} // if (pHeader->m_tex_format == (int)basis_tex_format::cUASTC4x4)
       
       if (!status)
@@ -10635,6 +10871,36 @@
 		return "";
 	}
 
+	const char* basis_get_block_format_name(block_format fmt)
+	{
+		switch (fmt)
+		{
+		case block_format::cETC1: return "ETC1";
+		case block_format::cBC1: return "BC1";
+		case block_format::cPVRTC1_4_RGB: return "PVRTC1_4_RGB";
+		case block_format::cPVRTC1_4_RGBA: return "PVRTC1_4_RGBA";
+		case block_format::cBC7: return "BC7";
+		case block_format::cETC2_RGBA: return "ETC2_RGBA";
+		case block_format::cBC3: return "BC3";
+		case block_format::cASTC_4x4: return "ASTC_4x4";
+		case block_format::cATC_RGB: return "ATC_RGB";
+		case block_format::cRGBA32: return "RGBA32";
+		case block_format::cRGB565: return "RGB565";
+		case block_format::cBGR565: return "BGR565";
+		case block_format::cRGBA4444: return "RGBA4444";
+		case block_format::cFXT1_RGB: return "FXT1_RGB";
+		case block_format::cPVRTC2_4_RGB: return "PVRTC2_4_RGB";
+		case block_format::cPVRTC2_4_RGBA: return "PVRTC2_4_RGBA";
+		case block_format::cETC2_EAC_R11: return "ETC2_EAC_R11";
+		case block_format::cETC2_EAC_RG11: return "ETC2_EAC_RG11";
+		default:
+			assert(0);
+			BASISU_DEVEL_ERROR("basis_get_basisu_texture_format: Invalid fmt\n");
+		break;
+		}
+		return "";
+	}
+
 	const char* basis_get_texture_type_name(basis_texture_type tex_type)
 	{
 		switch (tex_type)
diff --git a/transcoder/basisu_transcoder.h b/transcoder/basisu_transcoder.h
index a34726b..41e7c39 100644
--- a/transcoder/basisu_transcoder.h
+++ b/transcoder/basisu_transcoder.h
@@ -107,6 +107,9 @@
 	// Returns format's name in ASCII
 	const char* basis_get_format_name(transcoder_texture_format fmt);
 
+    // Returns block format name in ASCII
+	const char* basis_get_block_format_name(block_format fmt);
+
 	// Returns true if the format supports an alpha channel.
 	bool basis_transcoder_format_has_alpha(transcoder_texture_format fmt);
 
@@ -130,6 +133,15 @@
 
 	// Returns true if the specified format was enabled at compile time.
 	bool basis_is_format_supported(transcoder_texture_format tex_type, basis_tex_format fmt = basis_tex_format::cETC1S);
+
+	// Validates that the output buffer is large enough to hold the entire transcoded texture.
+	// For uncompressed texture formats, most input parameters are in pixels, not blocks. Blocks are 4x4 pixels.
+	bool basis_validate_output_buffer_size(transcoder_texture_format target_format,
+		uint32_t output_blocks_buf_size_in_blocks_or_pixels,
+		uint32_t orig_width, uint32_t orig_height,
+		uint32_t output_row_pitch_in_blocks_or_pixels,
+		uint32_t output_rows_in_pixels,
+		uint32_t total_slice_blocks);
 		
 	class basisu_transcoder;
 
@@ -164,9 +176,35 @@
 		bool decode_tables(const uint8_t *pTable_data, uint32_t table_data_size);
 
 		bool transcode_slice(void *pDst_blocks, uint32_t num_blocks_x, uint32_t num_blocks_y, const uint8_t *pImage_data, uint32_t image_data_size, block_format fmt, 
-			uint32_t output_block_or_pixel_stride_in_bytes, bool bc1_allow_threecolor_blocks, const basis_file_header &header, const basis_slice_desc& slice_desc, uint32_t output_row_pitch_in_blocks_or_pixels = 0,
+			uint32_t output_block_or_pixel_stride_in_bytes, bool bc1_allow_threecolor_blocks, const bool is_video, const bool is_alpha_slice, const uint32_t level_index, const uint32_t orig_width, const uint32_t orig_height, uint32_t output_row_pitch_in_blocks_or_pixels = 0,
 			basisu_transcoder_state *pState = nullptr, bool astc_transcode_alpha = false, void* pAlpha_blocks = nullptr, uint32_t output_rows_in_pixels = 0);
 
+		bool transcode_slice(void *pDst_blocks, uint32_t num_blocks_x, uint32_t num_blocks_y, const uint8_t *pImage_data, uint32_t image_data_size, block_format fmt, 
+			uint32_t output_block_or_pixel_stride_in_bytes, bool bc1_allow_threecolor_blocks, const basis_file_header &header, const basis_slice_desc& slice_desc, uint32_t output_row_pitch_in_blocks_or_pixels = 0,
+			basisu_transcoder_state *pState = nullptr, bool astc_transcode_alpha = false, void* pAlpha_blocks = nullptr, uint32_t output_rows_in_pixels = 0)
+		{
+			return transcode_slice(pDst_blocks, num_blocks_x, num_blocks_y, pImage_data, image_data_size, fmt, output_block_or_pixel_stride_in_bytes, bc1_allow_threecolor_blocks,
+				header.m_tex_type == cBASISTexTypeVideoFrames, (slice_desc.m_flags & cSliceDescFlagsHasAlpha) != 0, slice_desc.m_level_index,
+				slice_desc.m_orig_width, slice_desc.m_orig_height, output_row_pitch_in_blocks_or_pixels, pState,
+				astc_transcode_alpha,
+				pAlpha_blocks,
+				output_rows_in_pixels);
+		}
+
+		// Container independent transcoding
+		bool transcode_image(
+			transcoder_texture_format target_format,
+			void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
+			const uint8_t* pCompressed_data, uint32_t compressed_data_length,
+			uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index, 
+			uint32_t rgb_offset, uint32_t rgb_length, uint32_t alpha_offset, uint32_t alpha_length,
+			uint32_t decode_flags = 0,
+			bool basis_file_has_alpha_slices = false,
+			bool is_video = false,
+			uint32_t output_row_pitch_in_blocks_or_pixels = 0,
+			basisu_transcoder_state* pState = nullptr,
+			uint32_t output_rows_in_pixels = 0);
+
 		void clear()
 		{
 			m_endpoints.clear();
@@ -194,7 +232,7 @@
 		basisu_transcoder_state m_def_state;
 	};
 
-	enum
+	enum basisu_decode_flags
 	{
 		// PVRTC1: decode non-pow2 ETC1S texture level to the next larger power of 2 (not implemented yet, but we're going to support it). Ignored if the slice's dimensions are already a power of 2.
 		cDecodeFlagsPVRTCDecodeToNextPow2 = 2,
@@ -221,11 +259,35 @@
 	public:
 		basisu_lowlevel_uastc_transcoder();
 
+        bool transcode_slice(void* pDst_blocks, uint32_t num_blocks_x, uint32_t num_blocks_y, const uint8_t* pImage_data, uint32_t image_data_size, block_format fmt,
+            uint32_t output_block_or_pixel_stride_in_bytes, bool bc1_allow_threecolor_blocks, bool has_alpha, const uint32_t orig_width, const uint32_t orig_height, uint32_t output_row_pitch_in_blocks_or_pixels = 0,
+            basisu_transcoder_state* pState = nullptr, uint32_t output_rows_in_pixels = 0, int channel0 = -1, int channel1 = -1, uint32_t decode_flags = 0);
+
 		bool transcode_slice(void* pDst_blocks, uint32_t num_blocks_x, uint32_t num_blocks_y, const uint8_t* pImage_data, uint32_t image_data_size, block_format fmt,
 			uint32_t output_block_or_pixel_stride_in_bytes, bool bc1_allow_threecolor_blocks, const basis_file_header& header, const basis_slice_desc& slice_desc, uint32_t output_row_pitch_in_blocks_or_pixels = 0,
-			basisu_transcoder_state* pState = nullptr, uint32_t output_rows_in_pixels = 0, int channel0 = -1, int channel1 = -1, uint32_t decode_flags = 0);
-	};
+			basisu_transcoder_state* pState = nullptr, uint32_t output_rows_in_pixels = 0, int channel0 = -1, int channel1 = -1, uint32_t decode_flags = 0)
+        {
+            return transcode_slice(pDst_blocks, num_blocks_x, num_blocks_y, pImage_data, image_data_size, fmt,
+                                   output_block_or_pixel_stride_in_bytes, bc1_allow_threecolor_blocks, (header.m_flags & cBASISHeaderFlagHasAlphaSlices) != 0, slice_desc.m_orig_width, slice_desc.m_orig_height, output_row_pitch_in_blocks_or_pixels,
+                                   pState, output_rows_in_pixels, channel0, channel1, decode_flags);
+        }
 
+		// Container independent transcoding
+		bool transcode_image(
+			transcoder_texture_format target_format,
+			void* pOutput_blocks, uint32_t output_blocks_buf_size_in_blocks_or_pixels,
+			const uint8_t* pCompressed_data, uint32_t compressed_data_length,
+			uint32_t num_blocks_x, uint32_t num_blocks_y, uint32_t orig_width, uint32_t orig_height, uint32_t level_index,
+			uint32_t slice_offset, uint32_t slice_length, 
+			uint32_t decode_flags = 0,
+			bool basis_file_has_alpha_slices = false,
+			bool is_video = false,
+			uint32_t output_row_pitch_in_blocks_or_pixels = 0,
+			basisu_transcoder_state* pState = nullptr,
+			uint32_t output_rows_in_pixels = 0,
+			int channel0 = -1, int channel1 = -1);
+	};
+	
 	struct basisu_slice_info
 	{
 		uint32_t m_orig_width;
@@ -411,6 +473,11 @@
 			block_format fmt, uint32_t output_block_stride_in_bytes, uint32_t decode_flags = 0, uint32_t output_row_pitch_in_blocks_or_pixels = 0, basisu_transcoder_state * pState = nullptr, void* pAlpha_blocks = nullptr, 
 			uint32_t output_rows_in_pixels = 0, int channel0 = -1, int channel1 = -1) const;
 
+		static void write_opaque_alpha_blocks(
+			uint32_t num_blocks_x, uint32_t num_blocks_y,
+			void* pOutput_blocks, block_format fmt,
+			uint32_t block_stride_in_bytes, uint32_t output_row_pitch_in_blocks_or_pixels);
+
 	private:
 		mutable basisu_lowlevel_etc1s_transcoder m_lowlevel_etc1s_decoder;
 		mutable basisu_lowlevel_uastc_transcoder m_lowlevel_uastc_decoder;
diff --git a/webgl_videotest/basis.js b/webgl_videotest/basis.js
index 0d3441e..eb881fd 100644
--- a/webgl_videotest/basis.js
+++ b/webgl_videotest/basis.js
@@ -1,19 +1,19 @@
-var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&filename!=nodePath["resolve"](filename)){filename=path.join(__dirname,"..","src",filename);ret=nodeFS["readFileSync"](filename)}if(ret&&!binary)ret=ret.toString();return ret};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};Module["load"]=function load(f){globalEval(read(f))};if(!Module["thisProgram"]){if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}else{Module["thisProgram"]="unknown-program"}}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(!Module["print"])Module["print"]=print;if(typeof printErr!="undefined")Module["printErr"]=printErr;if(typeof read!="undefined"){Module["read"]=read}else{Module["read"]=function read(){throw"no read() available (jsc?)"}}Module["readBinary"]=function readBinary(f){if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}var data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof console!=="undefined"){if(!Module["print"])Module["print"]=function print(x){console.log(x)};if(!Module["printErr"])Module["printErr"]=function printErr(x){console.log(x)}}else{var TRY_USE_DUMP=false;if(!Module["print"])Module["print"]=TRY_USE_DUMP&&typeof dump!=="undefined"?(function(x){dump(x)}):(function(x){})}if(ENVIRONMENT_IS_WORKER){Module["load"]=importScripts}if(typeof Module["setWindowTitle"]==="undefined"){Module["setWindowTitle"]=(function(title){document.title=title})}}else{throw"Unknown runtime environment. Where are we?"}function globalEval(x){eval.call(null,x)}if(!Module["load"]&&Module["read"]){Module["load"]=function load(f){globalEval(Module["read"](f))}}if(!Module["print"]){Module["print"]=(function(){})}if(!Module["printErr"]){Module["printErr"]=Module["print"]}if(!Module["arguments"]){Module["arguments"]=[]}if(!Module["thisProgram"]){Module["thisProgram"]="./this.program"}Module.print=Module["print"];Module.printErr=Module["printErr"];Module["preRun"]=[];Module["postRun"]=[];for(var key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}var Runtime={setTempRet0:(function(value){tempRet0=value}),getTempRet0:(function(){return tempRet0}),stackSave:(function(){return STACKTOP}),stackRestore:(function(stackTop){STACKTOP=stackTop}),getNativeTypeSize:(function(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return Runtime.QUANTUM_SIZE}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}),getNativeFieldSize:(function(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE)}),STACK_ALIGN:16,prepVararg:(function(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}),getAlignSize:(function(type,size,vararg){if(!vararg&&(type=="i64"||type=="double"))return 8;if(!type)return Math.min(size,8);return Math.min(size||(type?Runtime.getNativeFieldSize(type):0),Runtime.QUANTUM_SIZE)}),dynCall:(function(sig,ptr,args){if(args&&args.length){if(!args.splice)args=Array.prototype.slice.call(args);args.splice(0,0,ptr);return Module["dynCall_"+sig].apply(null,args)}else{return Module["dynCall_"+sig].call(null,ptr)}}),functionPointers:[],addFunction:(function(func){for(var i=0;i<Runtime.functionPointers.length;i++){if(!Runtime.functionPointers[i]){Runtime.functionPointers[i]=func;return 2*(1+i)}}throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."}),removeFunction:(function(index){Runtime.functionPointers[(index-2)/2]=null}),warnOnce:(function(text){if(!Runtime.warnOnce.shown)Runtime.warnOnce.shown={};if(!Runtime.warnOnce.shown[text]){Runtime.warnOnce.shown[text]=1;Module.printErr(text)}}),funcWrappers:{},getFuncWrapper:(function(func,sig){assert(sig);if(!Runtime.funcWrappers[sig]){Runtime.funcWrappers[sig]={}}var sigCache=Runtime.funcWrappers[sig];if(!sigCache[func]){sigCache[func]=function dynCall_wrapper(){return Runtime.dynCall(sig,func,arguments)}}return sigCache[func]}),getCompilerSetting:(function(name){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"}),stackAlloc:(function(size){var ret=STACKTOP;STACKTOP=STACKTOP+size|0;STACKTOP=STACKTOP+15&-16;return ret}),staticAlloc:(function(size){var ret=STATICTOP;STATICTOP=STATICTOP+size|0;STATICTOP=STATICTOP+15&-16;return ret}),dynamicAlloc:(function(size){var ret=DYNAMICTOP;DYNAMICTOP=DYNAMICTOP+size|0;DYNAMICTOP=DYNAMICTOP+15&-16;if(DYNAMICTOP>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){DYNAMICTOP=ret;return 0}}return ret}),alignMemory:(function(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:16))*(quantum?quantum:16);return ret}),makeBigInt:(function(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*+4294967296:+(low>>>0)+ +(high|0)*+4294967296;return ret}),GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module["Runtime"]=Runtime;var __THREW__=0;var ABORT=false;var EXITSTATUS=0;var undef=0;var tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat;var tempI64,tempI64b;var tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var globalScope=this;function getCFunc(ident){var func=Module["_"+ident];if(!func){try{func=eval("_"+ident)}catch(e){}}assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)");return func}var cwrap,ccall;((function(){var JSfuncs={"stackSave":(function(){Runtime.stackSave()}),"stackRestore":(function(){Runtime.stackRestore()}),"arrayToC":(function(arr){var ret=Runtime.stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=Runtime.stackAlloc((str.length<<2)+1);writeStringToMemory(str,ret)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};ccall=function ccallFunc(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=Runtime.stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);if(returnType==="string")ret=Pointer_stringify(ret);if(stack!==0){if(opts&&opts.async){EmterpreterAsync.asyncFinalizers.push((function(){Runtime.stackRestore(stack)}));return}Runtime.stackRestore(stack)}return ret};var sourceRegex=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;function parseJSFunc(jsfunc){var parsed=jsfunc.toString().match(sourceRegex).slice(1);return{arguments:parsed[0],body:parsed[1],returnValue:parsed[2]}}var JSsource={};for(var fun in JSfuncs){if(JSfuncs.hasOwnProperty(fun)){JSsource[fun]=parseJSFunc(JSfuncs[fun])}}cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident);var numericArgs=argTypes.every((function(type){return type==="number"}));var numericRet=returnType!=="string";if(numericRet&&numericArgs){return cfunc}var argNames=argTypes.map((function(x,i){return"$"+i}));var funcstr="(function("+argNames.join(",")+") {";var nargs=argTypes.length;if(!numericArgs){funcstr+="var stack = "+JSsource["stackSave"].body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if(type==="number")continue;var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";";funcstr+=convertCode.body+";";funcstr+=arg+"="+convertCode.returnValue+";"}}var cfuncname=parseJSFunc((function(){return cfunc})).returnValue;funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");";if(!numericRet){var strgfy=parseJSFunc((function(){return Pointer_stringify})).returnValue;funcstr+="ret = "+strgfy+"(ret);"}if(!numericArgs){funcstr+=JSsource["stackRestore"].body.replace("()","(stack)")+";"}funcstr+="return ret})";return eval(funcstr)}}))();Module["ccall"]=ccall;Module["cwrap"]=cwrap;function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}Module["setValue"]=setValue;function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for setValue: "+type)}return null}Module["getValue"]=getValue;var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;var ALLOC_DYNAMIC=3;var ALLOC_NONE=4;Module["ALLOC_NORMAL"]=ALLOC_NORMAL;Module["ALLOC_STACK"]=ALLOC_STACK;Module["ALLOC_STATIC"]=ALLOC_STATIC;Module["ALLOC_DYNAMIC"]=ALLOC_DYNAMIC;Module["ALLOC_NONE"]=ALLOC_NONE;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var ptr=ret,stop;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr<stop;ptr+=4){HEAP32[ptr>>2]=0}stop=ret+size;while(ptr<stop){HEAP8[ptr++>>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i<size){var curr=slab[i];if(typeof curr==="function"){curr=Runtime.getFunctionIndex(curr)}type=singleType||types[i];if(type===0){i++;continue}if(type=="i64")type="i32";setValue(ret+i,curr,type);if(previousType!==type){typeSize=Runtime.getNativeTypeSize(type);previousType=type}i+=typeSize}return ret}Module["allocate"]=allocate;function getMemory(size){if(!staticSealed)return Runtime.staticAlloc(size);if(typeof _sbrk!=="undefined"&&!_sbrk.called||!runtimeInitialized)return Runtime.dynamicAlloc(size);return _malloc(size)}Module["getMemory"]=getMemory;function Pointer_stringify(ptr,length){if(length===0||!ptr)return"";var hasUtf=0;var t;var i=0;while(1){t=HEAPU8[ptr+i>>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return Module["UTF8ToString"](ptr)}Module["Pointer_stringify"]=Pointer_stringify;function AsciiToString(ptr){var str="";while(1){var ch=HEAP8[ptr++>>0];if(!ch)return str;str+=String.fromCharCode(ch)}}Module["AsciiToString"]=AsciiToString;function stringToAscii(str,outPtr){return writeAsciiToMemory(str,outPtr,false)}Module["stringToAscii"]=stringToAscii;function UTF8ArrayToString(u8Array,idx){var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}Module["UTF8ArrayToString"]=UTF8ArrayToString;function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}Module["UTF8ToString"]=UTF8ToString;function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}Module["stringToUTF8Array"]=stringToUTF8Array;function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}Module["stringToUTF8"]=stringToUTF8;function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}Module["lengthBytesUTF8"]=lengthBytesUTF8;function UTF16ToString(ptr){var i=0;var str="";while(1){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)return str;++i;str+=String.fromCharCode(codeUnit)}}Module["UTF16ToString"]=UTF16ToString;function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite<str.length*2?maxBytesToWrite/2:str.length;for(var i=0;i<numCharsToWrite;++i){var codeUnit=str.charCodeAt(i);HEAP16[outPtr>>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}Module["stringToUTF16"]=stringToUTF16;function lengthBytesUTF16(str){return str.length*2}Module["lengthBytesUTF16"]=lengthBytesUTF16;function UTF32ToString(ptr){var i=0;var str="";while(1){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)return str;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}}Module["UTF32ToString"]=UTF32ToString;function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}Module["stringToUTF32"]=stringToUTF32;function lengthBytesUTF32(str){var len=0;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343)++i;len+=4}return len}Module["lengthBytesUTF32"]=lengthBytesUTF32;function demangle(func){var hasLibcxxabi=!!Module["___cxa_demangle"];if(hasLibcxxabi){try{var buf=_malloc(func.length);writeStringToMemory(func.substr(1),buf);var status=_malloc(4);var ret=Module["___cxa_demangle"](buf,0,0,status);if(getValue(status,"i32")===0&&ret){return Pointer_stringify(ret)}}catch(e){}finally{if(buf)_free(buf);if(status)_free(status);if(ret)_free(ret)}}var i=3;var basicTypes={"v":"void","b":"bool","c":"char","s":"short","i":"int","l":"long","f":"float","d":"double","w":"wchar_t","a":"signed char","h":"unsigned char","t":"unsigned short","j":"unsigned int","m":"unsigned long","x":"long long","y":"unsigned long long","z":"..."};var subs=[];var first=true;function dump(x){if(x)Module.print(x);Module.print(func);var pre="";for(var a=0;a<i;a++)pre+=" ";Module.print(pre+"^")}function parseNested(){i++;if(func[i]==="K")i++;var parts=[];while(func[i]!=="E"){if(func[i]==="S"){i++;var next=func.indexOf("_",i);var num=func.substring(i,next)||0;parts.push(subs[num]||"?");i=next+1;continue}if(func[i]==="C"){parts.push(parts[parts.length-1]);i+=2;continue}var size=parseInt(func.substr(i));var pre=size.toString().length;if(!size||!pre){i--;break}var curr=func.substr(i+pre,size);parts.push(curr);subs.push(curr);i+=pre+size}i++;return parts}function parse(rawList,limit,allowVoid){limit=limit||Infinity;var ret="",list=[];function flushList(){return"("+list.join(", ")+")"}var name;if(func[i]==="N"){name=parseNested().join("::");limit--;if(limit===0)return rawList?[name]:name}else{if(func[i]==="K"||first&&func[i]==="L")i++;var size=parseInt(func.substr(i));if(size){var pre=size.toString().length;name=func.substr(i+pre,size);i+=pre+size}}first=false;if(func[i]==="I"){i++;var iList=parse(true);var iRet=parse(true,1,true);ret+=iRet[0]+" "+name+"<"+iList.join(", ")+">"}else{ret=name}paramLoop:while(i<func.length&&limit-->0){var c=func[i++];if(c in basicTypes){list.push(basicTypes[c])}else{switch(c){case"P":list.push(parse(true,1,true)[0]+"*");break;case"R":list.push(parse(true,1,true)[0]+"&");break;case"L":{i++;var end=func.indexOf("E",i);var size=end-i;list.push(func.substr(i,size));i+=size+2;break};case"A":{var size=parseInt(func.substr(i));i+=size.toString().length;if(func[i]!=="_")throw"?";i++;list.push(parse(true,1,true)[0]+" ["+size+"]");break};case"E":break paramLoop;default:ret+="?"+c;break paramLoop}}}if(!allowVoid&&list.length===1&&list[0]==="void")list=[];if(rawList){if(ret){list.push(ret+"?")}return list}else{return ret+flushList()}}var parsed=func;try{if(func=="Object._main"||func=="_main"){return"main()"}if(typeof func==="number")func=Pointer_stringify(func);if(func[0]!=="_")return func;if(func[1]!=="_")return func;if(func[2]!=="Z")return func;switch(func[3]){case"n":return"operator new()";case"d":return"operator delete()"}parsed=parse()}catch(e){parsed+="?"}if(parsed.indexOf("?")>=0&&!hasLibcxxabi){Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling")}return parsed}function demangleAll(text){return text.replace(/__Z[\w\d_]+/g,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}Module["stackTrace"]=stackTrace;var PAGE_SIZE=4096;function alignMemoryPage(x){if(x%4096>0){x+=4096-x%4096}return x}var HEAP;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var STATIC_BASE=0,STATICTOP=0,staticSealed=false;var STACK_BASE=0,STACKTOP=0,STACK_MAX=0;var DYNAMIC_BASE=0,DYNAMICTOP=0;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value "+TOTAL_MEMORY+", (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||499974144;var totalMemory=64*1024;while(totalMemory<TOTAL_MEMORY||totalMemory<2*TOTAL_STACK){if(totalMemory<16*1024*1024){totalMemory*=2}else{totalMemory+=16*1024*1024}}if(totalMemory!==TOTAL_MEMORY){TOTAL_MEMORY=totalMemory}assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&!!(new Int32Array(1))["subarray"]&&!!(new Int32Array(1))["set"],"JS engine does not provide full typed array support");var buffer;buffer=new ArrayBuffer(TOTAL_MEMORY);HEAP8=new Int8Array(buffer);HEAP16=new Int16Array(buffer);HEAP32=new Int32Array(buffer);HEAPU8=new Uint8Array(buffer);HEAPU16=new Uint16Array(buffer);HEAPU32=new Uint32Array(buffer);HEAPF32=new Float32Array(buffer);HEAPF64=new Float64Array(buffer);HEAP32[0]=255;assert(HEAPU8[0]===255&&HEAPU8[3]===0,"Typed arrays 2 must be run on a little-endian system");Module["HEAP"]=HEAP;Module["buffer"]=buffer;Module["HEAP8"]=HEAP8;Module["HEAP16"]=HEAP16;Module["HEAP32"]=HEAP32;Module["HEAPU8"]=HEAPU8;Module["HEAPU16"]=HEAPU16;Module["HEAPU32"]=HEAPU32;Module["HEAPF32"]=HEAPF32;Module["HEAPF64"]=HEAPF64;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Runtime.dynCall("v",func)}else{Runtime.dynCall("vi",func,[callback.arg])}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}Module["addOnPreRun"]=addOnPreRun;function addOnInit(cb){__ATINIT__.unshift(cb)}Module["addOnInit"]=addOnInit;function addOnPreMain(cb){__ATMAIN__.unshift(cb)}Module["addOnPreMain"]=addOnPreMain;function addOnExit(cb){__ATEXIT__.unshift(cb)}Module["addOnExit"]=addOnExit;function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}Module["addOnPostRun"]=addOnPostRun;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["intArrayFromString"]=intArrayFromString;function intArrayToString(array){var ret=[];for(var i=0;i<array.length;i++){var chr=array[i];if(chr>255){chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}Module["intArrayToString"]=intArrayToString;function writeStringToMemory(string,buffer,dontAddNull){var array=intArrayFromString(string,dontAddNull);var i=0;while(i<array.length){var chr=array[i];HEAP8[buffer+i>>0]=chr;i=i+1}}Module["writeStringToMemory"]=writeStringToMemory;function writeArrayToMemory(array,buffer){for(var i=0;i<array.length;i++){HEAP8[buffer++>>0]=array[i]}}Module["writeArrayToMemory"]=writeArrayToMemory;function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}Module["writeAsciiToMemory"]=writeAsciiToMemory;function unSign(value,bits,ignore){if(value>=0){return value}return bits<=32?2*Math.abs(1<<bits-1)+value:Math.pow(2,bits)+value}function reSign(value,bits,ignore){if(value<=0){return value}var half=bits<=32?Math.abs(1<<bits-1):Math.pow(2,bits-1);if(value>=half&&(bits<=32||value>half)){value=-2*half+value}return value}if(!Math["imul"]||Math["imul"](4294967295,5)!==-5)Math["imul"]=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};Math.imul=Math["imul"];if(!Math["clz32"])Math["clz32"]=(function(x){x=x>>>0;for(var i=0;i<32;i++){if(x&1<<31-i)return i}return 32});Math.clz32=Math["clz32"];var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_min=Math.min;var Math_clz32=Math.clz32;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}Module["addRunDependency"]=addRunDependency;function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["removeRunDependency"]=removeRunDependency;Module["preloadedImages"]={};Module["preloadedAudios"]={};var memoryInitializer=null;var ASM_CONSTS=[];STATIC_BASE=8;STATICTOP=STATIC_BASE+510608;__ATINIT__.push();memoryInitializer="basis.js.mem";var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);function copyTempFloat(ptr){HEAP8[tempDoublePtr]=HEAP8[ptr];HEAP8[tempDoublePtr+1]=HEAP8[ptr+1];HEAP8[tempDoublePtr+2]=HEAP8[ptr+2];HEAP8[tempDoublePtr+3]=HEAP8[ptr+3]}function copyTempDouble(ptr){HEAP8[tempDoublePtr]=HEAP8[ptr];HEAP8[tempDoublePtr+1]=HEAP8[ptr+1];HEAP8[tempDoublePtr+2]=HEAP8[ptr+2];HEAP8[tempDoublePtr+3]=HEAP8[ptr+3];HEAP8[tempDoublePtr+4]=HEAP8[ptr+4];HEAP8[tempDoublePtr+5]=HEAP8[ptr+5];HEAP8[tempDoublePtr+6]=HEAP8[ptr+6];HEAP8[tempDoublePtr+7]=HEAP8[ptr+7]}var _fabsf=Math_abs;function ___assert_fail(condition,filename,line,func){ABORT=true;throw"Assertion failed: "+Pointer_stringify(condition)+", at: "+[filename?Pointer_stringify(filename):"unknown filename",line,func?Pointer_stringify(func):"unknown function"]+" at "+stackTrace()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:(function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var ptr in EXCEPTIONS.infos){var info=EXCEPTIONS.infos[ptr];if(info.adjusted===adjusted){return ptr}}return adjusted}),addRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount++}),decRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];assert(info.refcount>0);info.refcount--;if(info.refcount===0){if(info.destructor){Runtime.dynCall("vi",info.destructor,[ptr])}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}}),clearRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0})};function ___resumeException(ptr){if(!EXCEPTIONS.last){EXCEPTIONS.last=ptr}EXCEPTIONS.clearRef(EXCEPTIONS.deAdjust(ptr));throw ptr+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function ___cxa_find_matching_catch(){var thrown=EXCEPTIONS.last;if(!thrown){return(asm["setTempRet0"](0),0)|0}var info=EXCEPTIONS.infos[thrown];var throwntype=info.type;if(!throwntype){return(asm["setTempRet0"](0),thrown)|0}var typeArray=Array.prototype.slice.call(arguments);var pointer=Module["___cxa_is_pointer_type"](throwntype);if(!___cxa_find_matching_catch.buffer)___cxa_find_matching_catch.buffer=_malloc(4);HEAP32[___cxa_find_matching_catch.buffer>>2]=thrown;thrown=___cxa_find_matching_catch.buffer;for(var i=0;i<typeArray.length;i++){if(typeArray[i]&&Module["___cxa_can_catch"](typeArray[i],throwntype,thrown)){thrown=HEAP32[thrown>>2];info.adjusted=thrown;return(asm["setTempRet0"](typeArray[i]),thrown)|0}}thrown=HEAP32[thrown>>2];return(asm["setTempRet0"](throwntype),thrown)|0}function ___cxa_throw(ptr,type,destructor){EXCEPTIONS.infos[ptr]={ptr:ptr,adjusted:ptr,type:type,destructor:destructor,refcount:0};EXCEPTIONS.last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exception=1}else{__ZSt18uncaught_exceptionv.uncaught_exception++}throw ptr+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}Module["_memset"]=_memset;function _pthread_cleanup_push(routine,arg){__ATEXIT__.push((function(){Runtime.dynCall("vi",routine,[arg])}));_pthread_cleanup_push.level=__ATEXIT__.length}Module["_bitshift64Lshr"]=_bitshift64Lshr;Module["_bitshift64Shl"]=_bitshift64Shl;function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!");__ATEXIT__.pop();_pthread_cleanup_push.level=__ATEXIT__.length}function _abort(){Module["abort"]()}var _sqrtf=Math_sqrt;function ___unlock(){}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can   access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}),normalize:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path}),dirname:(function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir}),basename:(function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return!!p})),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")})};var TTY={ttys:[],init:(function(){}),shutdown:(function(){}),register:(function(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)}),stream_ops:{open:(function(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}stream.tty=tty;stream.seekable=false}),close:(function(stream){stream.tty.ops.flush(stream.tty)}),flush:(function(stream){stream.tty.ops.flush(stream.tty)}),read:(function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(ERRNO_CODES.ENXIO)}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty)}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(ERRNO_CODES.EAGAIN)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead}),write:(function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(ERRNO_CODES.ENXIO)}for(var i=0;i<length;i++){try{stream.tty.ops.put_char(stream.tty,buffer[offset+i])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}}if(length){stream.node.timestamp=Date.now()}return i})},default_tty_ops:{get_char:(function(tty){if(!tty.input.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=new Buffer(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;var usingDevice=false;try{fd=fs.openSync("/dev/stdin","r");usingDevice=true}catch(e){}bytesRead=fs.readSync(fd,buf,0,BUFSIZE,null);if(usingDevice){fs.closeSync(fd)}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;i<node.usedBytes;++i)arr.push(node.contents[i]);return arr}return node.contents}),getFileDataAsTypedArray:(function(node){if(!node.contents)return new Uint8Array;if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)}),expandFileStorage:(function(node,newCapacity){if(node.contents&&node.contents.subarray&&newCapacity>node.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.buffer.byteLength:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)|0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.length<newCapacity)node.contents.push(0)}),resizeFileStorage:(function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;return}if(!node.contents||node.contents.subarray){var oldContents=node.contents;node.contents=new Uint8Array(new ArrayBuffer(newSize));if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize;return}if(!node.contents)node.contents=[];if(node.contents.length>newSize)node.contents.length=newSize;else while(node.contents.length<newSize)node.contents.push(0);node.usedBytes=newSize}),node_ops:{getattr:(function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr}),setattr:(function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}}),lookup:(function(parent,name){throw FS.genericErrors[ERRNO_CODES.ENOENT]}),mknod:(function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)}),rename:(function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}}}delete old_node.parent.contents[old_node.name];old_node.name=new_name;new_dir.contents[new_name]=old_node;old_node.parent=new_dir}),unlink:(function(parent,name){delete parent.contents[name]}),rmdir:(function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}delete parent.contents[name]}),readdir:(function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries}),symlink:(function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node}),readlink:(function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return node.link})},stream_ops:{read:(function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i]}return size}),write:(function(stream,buffer,offset,length,position,canOwn){if(!length)return 0;var node=stream.node;node.timestamp=Date.now();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length}else if(node.usedBytes===0&&position===0){node.contents=new Uint8Array(buffer.subarray(offset,offset+length));node.usedBytes=length;return length}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray)node.contents.set(buffer.subarray(offset,offset+length),position);else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i]}}node.usedBytes=Math.max(node.usedBytes,position+length);return length}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.usedBytes}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position}),allocate:(function(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&(contents.buffer===buffer||contents.buffer===buffer.buffer)){allocated=false;ptr=contents.byteOffset}else{if(position>0||position+length<stream.node.usedBytes){if(contents.subarray){contents=contents.subarray(position,position+length)}else{contents=Array.prototype.slice.call(contents,position,position+length)}}allocated=true;ptr=_malloc(length);if(!ptr){throw new FS.ErrnoError(ERRNO_CODES.ENOMEM)}buffer.set(contents,ptr)}return{ptr:ptr,allocated:allocated}}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}if(mmapFlags&2){return 0}var bytesWritten=MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0})}};var IDBFS={dbs:{},indexedDB:(function(){if(typeof indexedDB!=="undefined")return indexedDB;var ret=null;if(typeof window==="object")ret=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;assert(ret,"IDBFS used, but indexedDB not supported");return ret}),DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:(function(mount){return MEMFS.mount.apply(null,arguments)}),syncfs:(function(mount,populate,callback){IDBFS.getLocalSet(mount,(function(err,local){if(err)return callback(err);IDBFS.getRemoteSet(mount,(function(err,remote){if(err)return callback(err);var src=populate?remote:local;var dst=populate?local:remote;IDBFS.reconcile(src,dst,callback)}))}))}),getDB:(function(name,callback){var db=IDBFS.dbs[name];if(db){return callback(null,db)}var req;try{req=IDBFS.indexedDB().open(name,IDBFS.DB_VERSION)}catch(e){return callback(e)}req.onupgradeneeded=(function(e){var db=e.target.result;var transaction=e.target.transaction;var fileStore;if(db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)){fileStore=transaction.objectStore(IDBFS.DB_STORE_NAME)}else{fileStore=db.createObjectStore(IDBFS.DB_STORE_NAME)}if(!fileStore.indexNames.contains("timestamp")){fileStore.createIndex("timestamp","timestamp",{unique:false})}});req.onsuccess=(function(){db=req.result;IDBFS.dbs[name]=db;callback(null,db)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),getLocalSet:(function(mount,callback){var entries={};function isRealDir(p){return p!=="."&&p!==".."}function toAbsolute(root){return(function(p){return PATH.join2(root,p)})}var check=FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));while(check.length){var path=check.pop();var stat;try{stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){check.push.apply(check,FS.readdir(path).filter(isRealDir).map(toAbsolute(path)))}entries[path]={timestamp:stat.mtime}}return callback(null,{type:"local",entries:entries})}),getRemoteSet:(function(mount,callback){var entries={};IDBFS.getDB(mount.mountpoint,(function(err,db){if(err)return callback(err);var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readonly");transaction.onerror=(function(e){callback(this.error);e.preventDefault()});var store=transaction.objectStore(IDBFS.DB_STORE_NAME);var index=store.index("timestamp");index.openKeyCursor().onsuccess=(function(event){var cursor=event.target.result;if(!cursor){return callback(null,{type:"remote",db:db,entries:entries})}entries[cursor.primaryKey]={timestamp:cursor.key};cursor.continue()})}))}),loadLocalEntry:(function(path,callback){var stat,node;try{var lookup=FS.lookupPath(path);node=lookup.node;stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){return callback(null,{timestamp:stat.mtime,mode:stat.mode})}else if(FS.isFile(stat.mode)){node.contents=MEMFS.getFileDataAsTypedArray(node);return callback(null,{timestamp:stat.mtime,mode:stat.mode,contents:node.contents})}else{return callback(new Error("node type not supported"))}}),storeLocalEntry:(function(path,entry,callback){try{if(FS.isDir(entry.mode)){FS.mkdir(path,entry.mode)}else if(FS.isFile(entry.mode)){FS.writeFile(path,entry.contents,{encoding:"binary",canOwn:true})}else{return callback(new Error("node type not supported"))}FS.chmod(path,entry.mode);FS.utime(path,entry.timestamp,entry.timestamp)}catch(e){return callback(e)}callback(null)}),removeLocalEntry:(function(path,callback){try{var lookup=FS.lookupPath(path);var stat=FS.stat(path);if(FS.isDir(stat.mode)){FS.rmdir(path)}else if(FS.isFile(stat.mode)){FS.unlink(path)}}catch(e){return callback(e)}callback(null)}),loadRemoteEntry:(function(store,path,callback){var req=store.get(path);req.onsuccess=(function(event){callback(null,event.target.result)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),storeRemoteEntry:(function(store,path,entry,callback){var req=store.put(entry,path);req.onsuccess=(function(){callback(null)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),removeRemoteEntry:(function(store,path,callback){var req=store.delete(path);req.onsuccess=(function(){callback(null)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),reconcile:(function(src,dst,callback){var total=0;var create=[];Object.keys(src.entries).forEach((function(key){var e=src.entries[key];var e2=dst.entries[key];if(!e2||e.timestamp>e2.timestamp){create.push(key);total++}}));var remove=[];Object.keys(dst.entries).forEach((function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}}));if(!total){return callback(null)}var errored=false;var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault()});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)}))}else{IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)}))}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}}))})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&146)>>1}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:(function(flags){flags&=~32768;if(flags in NODEFS.flagsToPermissionStringMap){return NODEFS.flagsToPermissionStringMap[flags]}else{throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsToPermissionString(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;var nbuffer=new Buffer(length);var res;try{res=fs.readSync(stream.nfd,nbuffer,0,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(res>0){for(var i=0;i<res;i++){buffer[offset+i]=nbuffer[i]}}return res}),write:(function(stream,buffer,offset,length,position){var nbuffer=new Buffer(buffer.subarray(offset,offset+length));var res;try{res=fs.writeSync(stream.nfd,nbuffer,0,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}return res}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:(function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i<parts.length-1;i++){var curr=parts.slice(0,i+1).join("/");if(!createdParents[curr]){createdParents[curr]=WORKERFS.createNode(parent,curr,WORKERFS.DIR_MODE,0)}parent=createdParents[curr]}return parent}function base(path){var parts=path.split("/");return parts[parts.length-1]}Array.prototype.forEach.call(mount.opts["files"]||[],(function(file){WORKERFS.createNode(ensureParent(file.name),base(file.name),WORKERFS.FILE_MODE,0,file,file.lastModifiedDate)}));(mount.opts["blobs"]||[]).forEach((function(obj){WORKERFS.createNode(ensureParent(obj["name"]),base(obj["name"]),WORKERFS.FILE_MODE,0,obj["data"])}));(mount.opts["packages"]||[]).forEach((function(pack){pack["metadata"].files.forEach((function(file){var name=file.filename.substr(1);WORKERFS.createNode(ensureParent(name),base(name),WORKERFS.FILE_MODE,0,pack["blob"].slice(file.start,file.end))}))}));return root}),createNode:(function(parent,name,mode,dev,contents,mtime){var node=FS.createNode(parent,name,mode);node.mode=mode;node.node_ops=WORKERFS.node_ops;node.stream_ops=WORKERFS.stream_ops;node.timestamp=(mtime||new Date).getTime();assert(WORKERFS.FILE_MODE!==WORKERFS.DIR_MODE);if(mode===WORKERFS.FILE_MODE){node.size=contents.size;node.contents=contents}else{node.size=4096;node.contents={}}if(parent){parent.contents[name]=node}return node}),node_ops:{getattr:(function(node){return{dev:1,ino:undefined,mode:node.mode,nlink:1,uid:0,gid:0,rdev:undefined,size:node.size,atime:new Date(node.timestamp),mtime:new Date(node.timestamp),ctime:new Date(node.timestamp),blksize:4096,blocks:Math.ceil(node.size/4096)}}),setattr:(function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}}),lookup:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}),mknod:(function(parent,name,mode,dev){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),rename:(function(oldNode,newDir,newName){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),unlink:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),rmdir:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),readdir:(function(node){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),symlink:(function(parent,newName,oldPath){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),readlink:(function(node){throw new FS.ErrnoError(ERRNO_CODES.EPERM)})},stream_ops:{read:(function(stream,buffer,offset,length,position){if(position>=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var _stdin=allocate(1,"i32*",ALLOC_STATIC);var _stdout=allocate(1,"i32*",ALLOC_STATIC);var _stderr=allocate(1,"i32*",ALLOC_STATIC);var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),false);var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count});current=lookup.node;if(count++>40){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}}}return{path:current_path,node:current}}),getPath:(function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}}),hashName:(function(parentid,name){var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0}return(parentid+hash>>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node}),hashRemoveNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}}),lookupNode:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)}),createNode:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return(this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode})},write:{get:(function(){return(this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node)}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return!!node.mounted}),isFile:(function(mode){return(mode&61440)===32768}),isDir:(function(mode){return(mode&61440)===16384}),isLink:(function(mode){return(mode&61440)===40960}),isChrdev:(function(mode){return(mode&61440)===8192}),isBlkdev:(function(mode){return(mode&61440)===24576}),isFIFO:(function(mode){return(mode&61440)===4096}),isSocket:(function(mode){return(mode&49152)===49152}),flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return ERRNO_CODES.EACCES}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return ERRNO_CODES.EACCES}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return ERRNO_CODES.EACCES}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return ERRNO_CODES.EACCES;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return ERRNO_CODES.ENOTDIR}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return ERRNO_CODES.EBUSY}}else{if(FS.isDir(node.mode)){return ERRNO_CODES.EISDIR}}return 0}),mayOpen:(function(node,flags){if(!node){return ERRNO_CODES.ENOENT}if(FS.isLink(node.mode)){return ERRNO_CODES.ELOOP}else if(FS.isDir(node.mode)){if((flags&2097155)!==0||flags&512){return ERRNO_CODES.EISDIR}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(ERRNO_CODES.EMFILE)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val})},isRead:{get:(function(){return(this.flags&2097155)!==1})},isWrite:{get:(function(){return(this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}}),llseek:(function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops}}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}var mounts=FS.getMounts(FS.root.mount);var completed=0;function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=mounts.length){callback(null)}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)}))}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot}),unmount:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdev:(function(path,mode,dev){if(typeof dev==="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)}),symlink:(function(oldpath,newpath){if(!PATH.resolve(oldpath)){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}var newname=PATH.basename(newpath);var err=FS.mayCreate(parent,newname);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.symlink(parent,newname,oldpath)}),rename:(function(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;try{lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!old_dir||!new_dir)throw new FS.ErrnoError(ERRNO_CODES.ENOENT);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(ERRNO_CODES.EXDEV)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}relative=PATH.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var err=FS.mayDelete(old_dir,old_name,isdir);if(err){throw new FS.ErrnoError(err)}err=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(err){throw new FS.ErrnoError(err)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(new_dir!==old_dir){err=FS.nodePermissions(old_dir,"w");if(err){throw new FS.ErrnoError(err)}}try{if(FS.trackingDelegate["willMovePath"]){FS.trackingDelegate["willMovePath"](old_path,new_path)}}catch(e){console.log("FS.trackingDelegate['willMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name)}catch(e){throw e}finally{FS.hashAddNode(old_node)}try{if(FS.trackingDelegate["onMovePath"])FS.trackingDelegate["onMovePath"](old_path,new_path)}catch(e){console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}}),rmdir:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,true);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}return node.node_ops.readdir(node)}),unlink:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,false);if(err){if(err===ERRNO_CODES.EISDIR)err=ERRNO_CODES.EPERM;throw new FS.ErrnoError(err)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.unlink(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readlink:(function(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!link.node_ops.readlink){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return PATH.resolve(FS.getPath(link.parent),link.node_ops.readlink(link))}),stat:(function(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!node.node_ops.getattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return node.node_ops.getattr(node)}),lstat:(function(path){return FS.stat(path,true)}),chmod:(function(path,mode,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()})}),lchmod:(function(path,mode){FS.chmod(path,mode,true)}),fchmod:(function(fd,mode){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}FS.chmod(stream.node,mode)}),chown:(function(path,uid,gid,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}node.node_ops.setattr(node,{timestamp:Date.now()})}),lchown:(function(path,uid,gid){FS.chown(path,uid,gid,true)}),fchown:(function(fd,uid,gid){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}FS.chown(stream.node,uid,gid)}),truncate:(function(path,len){if(len<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.nodePermissions(node,"w");if(err){throw new FS.ErrnoError(err)}node.node_ops.setattr(node,{size:len,timestamp:Date.now()})}),ftruncate:(function(fd,len){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}FS.truncate(stream.node,len)}),utime:(function(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)})}),open:(function(path,flags,mode,fd_start,fd_end){if(path===""){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}flags=typeof flags==="string"?FS.modeStringToFlags(flags):flags;mode=typeof mode==="undefined"?438:mode;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;if(typeof path==="object"){node=path}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(ERRNO_CODES.EEXIST)}}else{node=FS.mknod(path,mode,0);created=true}}if(!node){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}if(!created){var err=FS.mayOpen(node,flags);if(err){throw new FS.ErrnoError(err)}}if(flags&512){FS.truncate(node,0)}flags&=~(128|512);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false},fd_start,fd_end);if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(Module["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;Module["printErr"]("read file: "+path)}}try{if(FS.trackingDelegate["onOpenFile"]){var trackingFlags=0;if((flags&2097155)!==1){trackingFlags|=FS.tracking.openFlags.READ}if((flags&2097155)!==0){trackingFlags|=FS.tracking.openFlags.WRITE}FS.trackingDelegate["onOpenFile"](path,trackingFlags)}}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: "+e.message)}return stream}),close:(function(stream){if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}}),llseek:(function(stream,offset,whence){if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position}),read:(function(stream,buffer,offset,length,position){if(length<0||position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!stream.stream_ops.read){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var seeking=true;if(typeof position==="undefined"){position=stream.position;seeking=false}else if(!stream.seekable){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead}),write:(function(stream,buffer,offset,length,position,canOwn){if(length<0||position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!stream.stream_ops.write){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if(stream.flags&1024){FS.llseek(stream,0,2)}var seeking=true;if(typeof position==="undefined"){position=stream.position;seeking=false}else if(!stream.seekable){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;try{if(stream.path&&FS.trackingDelegate["onWriteToFile"])FS.trackingDelegate["onWriteToFile"](stream.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return bytesWritten}),allocate:(function(stream,offset,length){if(offset<0||length<=0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(!FS.isFile(stream.node.mode)&&!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP)}stream.stream_ops.allocate(stream,offset,length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if((stream.flags&2097155)===1){throw new FS.ErrnoError(ERRNO_CODES.EACCES)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}return stream.stream_ops.mmap(stream,buffer,offset,length,position,prot,flags)}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!stream||!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)}),munmap:(function(stream){return 0}),ioctl:(function(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(ERRNO_CODES.ENOTTY)}return stream.stream_ops.ioctl(stream,cmd,arg)}),readFile:(function(path,opts){opts=opts||{};opts.flags=opts.flags||"r";opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret}),writeFile:(function(path,data,opts){opts=opts||{};opts.flags=opts.flags||"w";opts.encoding=opts.encoding||"utf8";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var stream=FS.open(path,opts.flags,opts.mode);if(opts.encoding==="utf8"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,0,opts.canOwn)}else if(opts.encoding==="binary"){FS.write(stream,data,0,data.length,0,opts.canOwn)}FS.close(stream)}),cwd:(function(){return FS.currentPath}),chdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}var err=FS.nodePermissions(lookup.node,"x");if(err){throw new FS.ErrnoError(err)}FS.currentPath=lookup.path}),createDefaultDirectories:(function(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")}),createDefaultDevices:(function(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:(function(){return 0}),write:(function(stream,buffer,offset,length,pos){return length})});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var random_device;if(typeof crypto!=="undefined"){var randomBuffer=new Uint8Array(1);random_device=(function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]})}else if(ENVIRONMENT_IS_NODE){random_device=(function(){return require("crypto").randomBytes(1)[0]})}else{random_device=(function(){return Math.random()*256|0})}FS.createDevice("/dev","random",random_device);FS.createDevice("/dev","urandom",random_device);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")}),createSpecialDirectories:(function(){FS.mkdir("/proc");FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:(function(){var node=FS.createNode("/proc/self","fd",16384|511,73);node.node_ops={lookup:(function(parent,name){var fd=+name;var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:(function(){return stream.path})}};ret.parent=ret;return ret})};return node})},{},"/proc/self/fd")}),createStandardStreams:(function(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin","r");assert(stdin.fd===0,"invalid handle for stdin ("+stdin.fd+")");var stdout=FS.open("/dev/stdout","w");assert(stdout.fd===1,"invalid handle for stdout ("+stdout.fd+")");var stderr=FS.open("/dev/stderr","w");assert(stderr.fd===2,"invalid handle for stderr ("+stderr.fd+")")}),ensureErrnoError:(function(){if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.node=node;this.setErrno=(function(errno){this.errno=errno;for(var key in ERRNO_CODES){if(ERRNO_CODES[key]===errno){this.code=key;break}}});this.setErrno(errno);this.message=ERRNO_MESSAGES[errno]};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[ERRNO_CODES.ENOENT].forEach((function(code){FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>"}))}),staticInit:(function(){FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS,"IDBFS":IDBFS,"NODEFS":NODEFS,"WORKERFS":WORKERFS}}),init:(function(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()}),quit:(function(){FS.init.initialized=false;var fflush=Module["_fflush"];if(fflush)fflush(0);for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue}FS.close(stream)}}),getMode:(function(canRead,canWrite){var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode}),joinPath:(function(parts,forceRelative){var path=PATH.join.apply(null,parts);if(forceRelative&&path[0]=="/")path=path.substr(1);return path}),absolutePath:(function(relative,base){return PATH.resolve(base,relative)}),standardizePath:(function(path){return PATH.normalize(path)}),findObject:(function(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(ret.exists){return ret.object}else{___setErrNo(ret.error);return null}}),analyzePath:(function(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/"}catch(e){ret.error=e.errno}return ret}),createFolder:(function(parent,name,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.mkdir(path,mode)}),createPath:(function(parent,path,canRead,canWrite){parent=typeof parent==="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){}parent=current}return current}),createFile:(function(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.create(path,mode)}),createDataFile:(function(parent,name,data,canRead,canWrite,canOwn){var path=name?PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name):parent;var mode=FS.getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data==="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr}FS.chmod(node,mode|146);var stream=FS.open(node,"w");FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode)}return node}),createDevice:(function(parent,name,input,output){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:(function(stream){stream.seekable=false}),close:(function(stream){if(output&&output.buffer&&output.buffer.length){output(10)}}),read:(function(stream,buffer,offset,length,pos){var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input()}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(ERRNO_CODES.EAGAIN)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead}),write:(function(stream,buffer,offset,length,pos){for(var i=0;i<length;i++){try{output(buffer[offset+i])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}}if(length){stream.node.timestamp=Date.now()}return i})});return FS.mkdev(path,mode,dev)}),createLink:(function(parent,name,target,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);return FS.symlink(target,path)}),forceLoadFile:(function(obj){if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;var success=true;if(typeof XMLHttpRequest!=="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.")}else if(Module["read"]){try{obj.contents=intArrayFromString(Module["read"](obj.url),true);obj.usedBytes=obj.contents.length}catch(e){success=false}}else{throw new Error("Cannot load without read() or XMLHttpRequest.")}if(!success)___setErrNo(ERRNO_CODES.EIO);return success}),createLazyFile:(function(parent,name,url,canRead,canWrite){function LazyUint8Array(){this.lengthKnown=false;this.chunks=[]}LazyUint8Array.prototype.get=function LazyUint8Array_get(idx){if(idx>this.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperty(lazyArray,"length",{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})});Object.defineProperty(lazyArray,"chunkSize",{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize})});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperty(node,"usedBytes",{get:(function(){return this.contents.length})});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)}}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i]}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i)}}return size};node.stream_ops=stream_ops;return node}),createPreloadedFile:(function(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){Browser.init();var fullname=name?PATH.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp "+fullname);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS.createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}var handled=false;Module["preloadPlugins"].forEach((function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,(function(){if(onerror)onerror();removeRunDependency(dep)}));handled=true}}));if(!handled)finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){Browser.asyncLoad(url,(function(byteArray){processData(byteArray)}),onerror)}else{processData(url)}}),indexedDB:(function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB}),DB_NAME:(function(){return"EM_FS_"+window.location.pathname}),DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=function openRequest_onupgradeneeded(){console.log("creating db");var db=openRequest.result;db.createObjectStore(FS.DB_STORE_NAME)};openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;var transaction=db.transaction([FS.DB_STORE_NAME],"readwrite");var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var putRequest=files.put(FS.analyzePath(path).object.contents,path);putRequest.onsuccess=function putRequest_onsuccess(){ok++;if(ok+fail==total)finish()};putRequest.onerror=function putRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror}),loadFilesFromDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=onerror;openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;try{var transaction=db.transaction([FS.DB_STORE_NAME],"readonly")}catch(e){onerror(e);return}var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var getRequest=files.get(path);getRequest.onsuccess=function getRequest_onsuccess(){if(FS.analyzePath(path).exists){FS.unlink(path)}FS.createDataFile(PATH.dirname(path),PATH.basename(path),getRequest.result,true,true,true);ok++;if(ok+fail==total)finish()};getRequest.onerror=function getRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror})};var SYSCALLS={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:(function(dirfd,path){if(path[0]!=="/"){var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=FS.getStream(dirfd);if(!dirstream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);dir=dirstream.path}path=PATH.join2(dir,path)}return path}),doStat:(function(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-ERRNO_CODES.ENOTDIR}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return-ERRNO_CODES.EINVAL;var ret=FS.readlink(path);ret=ret.slice(0,Math.max(0,bufsize));writeStringToMemory(ret,buf,true);return ret.length}),doAccess:(function(path,amode){if(amode&~7){return-ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break}return ret}),doWritev:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(ERRNO_CODES.EINVAL);return-1}function _sbrk(bytes){var self=_sbrk;if(!self.called){DYNAMICTOP=alignMemoryPage(DYNAMICTOP);self.called=true;assert(Runtime.dynamicAlloc);self.alloc=Runtime.dynamicAlloc;Runtime.dynamicAlloc=(function(){abort("cannot dynamically allocate, sbrk now has control")})}var ret=DYNAMICTOP;if(bytes!=0){var success=self.alloc(bytes);if(!success)return-1>>>0}return ret}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}Module["_memcpy"]=_memcpy;function ___lock(){}function _emscripten_set_main_loop_timing(mode,value){Browser.mainLoop.timingMode=mode;Browser.mainLoop.timingValue=value;if(!Browser.mainLoop.func){return 1}if(mode==0){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setTimeout(){setTimeout(Browser.mainLoop.runner,value)};Browser.mainLoop.method="timeout"}else if(mode==1){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_rAF(){Browser.requestAnimationFrame(Browser.mainLoop.runner)};Browser.mainLoop.method="rAF"}else if(mode==2){if(!window["setImmediate"]){var setImmediates=[];var emscriptenMainLoopMessageId="__emcc";function Browser_setImmediate_messageHandler(event){if(event.source===window&&event.data===emscriptenMainLoopMessageId){event.stopPropagation();setImmediates.shift()()}}window.addEventListener("message",Browser_setImmediate_messageHandler,true);window["setImmediate"]=function Browser_emulated_setImmediate(func){setImmediates.push(func);window.postMessage(emscriptenMainLoopMessageId,"*")}}Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setImmediate(){window["setImmediate"](Browser.mainLoop.runner)};Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(func,fps,simulateInfiniteLoop,arg,noSetTiming){Module["noExitRuntime"]=true;assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.");Browser.mainLoop.func=func;Browser.mainLoop.arg=arg;var thisMainLoopId=Browser.mainLoop.currentlyRunningMainloop;Browser.mainLoop.runner=function Browser_mainLoop_runner(){if(ABORT)return;if(Browser.mainLoop.queue.length>0){var start=Date.now();var blocker=Browser.mainLoop.queue.shift();blocker.func(blocker.arg);if(Browser.mainLoop.remainingBlockers){var remaining=Browser.mainLoop.remainingBlockers;var next=remaining%1==0?remaining-1:Math.floor(remaining);if(blocker.counted){Browser.mainLoop.remainingBlockers=next}else{next=next+.5;Browser.mainLoop.remainingBlockers=(8*remaining+next)/9}}console.log('main loop blocker "'+blocker.name+'" took '+(Date.now()-start)+" ms");Browser.mainLoop.updateStatus();setTimeout(Browser.mainLoop.runner,0);return}if(thisMainLoopId<Browser.mainLoop.currentlyRunningMainloop)return;Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0;if(Browser.mainLoop.timingMode==1&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}if(Browser.mainLoop.method==="timeout"&&Module.ctx){Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!");Browser.mainLoop.method=""}Browser.mainLoop.runIter((function(){if(typeof arg!=="undefined"){Runtime.dynCall("vi",func,[arg])}else{Runtime.dynCall("v",func)}}));if(thisMainLoopId<Browser.mainLoop.currentlyRunningMainloop)return;if(typeof SDL==="object"&&SDL.audio&&SDL.audio.queueNewAudioData)SDL.audio.queueNewAudioData();Browser.mainLoop.scheduler()};if(!noSetTiming){if(fps&&fps>0)_emscripten_set_main_loop_timing(0,1e3/fps);else _emscripten_set_main_loop_timing(1,1);Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw"SimulateInfiniteLoop"}}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:(function(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++}),resume:(function(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;_emscripten_set_main_loop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()}),updateStatus:(function(){if(Module["setStatus"]){var message=Module["statusMessage"]||"Please wait...";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining<expected){Module["setStatus"](message+" ("+(expected-remaining)+"/"+expected+")")}else{Module["setStatus"](message)}}else{Module["setStatus"]("")}}}),runIter:(function(func){if(ABORT)return;if(Module["preMainLoop"]){var preRet=Module["preMainLoop"]();if(preRet===false){return}}try{func()}catch(e){if(e instanceof ExitStatus){return}else{if(e&&typeof e==="object"&&e.stack)Module.printErr("exception thrown: "+[e,e.stack]);throw e}}if(Module["postMainLoop"])Module["postMainLoop"]()})},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:(function(){if(!Module["preloadPlugins"])Module["preloadPlugins"]=[];if(Browser.initted)return;Browser.initted=true;try{new Blob;Browser.hasBlobConstructor=true}catch(e){Browser.hasBlobConstructor=false;console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder=typeof MozBlobBuilder!="undefined"?MozBlobBuilder:typeof WebKitBlobBuilder!="undefined"?WebKitBlobBuilder:!Browser.hasBlobConstructor?console.log("warning: no BlobBuilder"):null;Browser.URLObject=typeof window!="undefined"?window.URL?window.URL:window.webkitURL:undefined;if(!Module.noImageDecoding&&typeof Browser.URLObject==="undefined"){console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.");Module.noImageDecoding=true}var imagePlugin={};imagePlugin["canHandle"]=function imagePlugin_canHandle(name){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(name)};imagePlugin["handle"]=function imagePlugin_handle(byteArray,name,onload,onerror){var b=null;if(Browser.hasBlobConstructor){try{b=new Blob([byteArray],{type:Browser.getMimetype(name)});if(b.size!==byteArray.length){b=new Blob([(new Uint8Array(byteArray)).buffer],{type:Browser.getMimetype(name)})}}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}}if(!b){var bb=new Browser.BlobBuilder;bb.append((new Uint8Array(byteArray)).buffer);b=bb.getBlob()}var url=Browser.URLObject.createObjectURL(b);var img=new Image;img.onload=function img_onload(){assert(img.complete,"Image "+name+" could not be decoded");var canvas=document.createElement("canvas");canvas.width=img.width;canvas.height=img.height;var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);Module["preloadedImages"][name]=canvas;Browser.URLObject.revokeObjectURL(url);if(onload)onload(byteArray)};img.onerror=function img_onerror(event){console.log("Image "+url+" could not be decoded");if(onerror)onerror()};img.src=url};Module["preloadPlugins"].push(imagePlugin);var audioPlugin={};audioPlugin["canHandle"]=function audioPlugin_canHandle(name){return!Module.noAudioDecoding&&name.substr(-4)in{".ogg":1,".wav":1,".mp3":1}};audioPlugin["handle"]=function audioPlugin_handle(byteArray,name,onload,onerror){var done=false;function finish(audio){if(done)return;done=true;Module["preloadedAudios"][name]=audio;if(onload)onload(byteArray)}function fail(){if(done)return;done=true;Module["preloadedAudios"][name]=new Audio;if(onerror)onerror()}if(Browser.hasBlobConstructor){try{var b=new Blob([byteArray],{type:Browser.getMimetype(name)})}catch(e){return fail()}var url=Browser.URLObject.createObjectURL(b);var audio=new Audio;audio.addEventListener("canplaythrough",(function(){finish(audio)}),false);audio.onerror=function audio_onerror(event){if(done)return;console.log("warning: browser could not fully decode audio "+name+", trying slower base64 approach");function encode64(data){var BASE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var PAD="=";var ret="";var leftchar=0;var leftbits=0;for(var i=0;i<data.length;i++){leftchar=leftchar<<8|data[i];leftbits+=8;while(leftbits>=6){var curr=leftchar>>leftbits-6&63;leftbits-=6;ret+=BASE[curr]}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD}else if(leftbits==4){ret+=BASE[(leftchar&15)<<2];ret+=PAD}return ret}audio.src="data:audio/x-"+name.substr(-3)+";base64,"+encode64(byteArray);finish(audio)};audio.src=url;Browser.safeSetTimeout((function(){finish(audio)}),1e4)}else{return fail()}};Module["preloadPlugins"].push(audioPlugin);var canvas=Module["canvas"];function pointerLockChange(){Browser.pointerLock=document["pointerLockElement"]===canvas||document["mozPointerLockElement"]===canvas||document["webkitPointerLockElement"]===canvas||document["msPointerLockElement"]===canvas}if(canvas){canvas.requestPointerLock=canvas["requestPointerLock"]||canvas["mozRequestPointerLock"]||canvas["webkitRequestPointerLock"]||canvas["msRequestPointerLock"]||(function(){});canvas.exitPointerLock=document["exitPointerLock"]||document["mozExitPointerLock"]||document["webkitExitPointerLock"]||document["msExitPointerLock"]||(function(){});canvas.exitPointerLock=canvas.exitPointerLock.bind(document);document.addEventListener("pointerlockchange",pointerLockChange,false);document.addEventListener("mozpointerlockchange",pointerLockChange,false);document.addEventListener("webkitpointerlockchange",pointerLockChange,false);document.addEventListener("mspointerlockchange",pointerLockChange,false);if(Module["elementPointerLock"]){canvas.addEventListener("click",(function(ev){if(!Browser.pointerLock&&canvas.requestPointerLock){canvas.requestPointerLock();ev.preventDefault()}}),false)}}}),createContext:(function(canvas,useWebGL,setInModule,webGLContextAttributes){if(useWebGL&&Module.ctx&&canvas==Module.canvas)return Module.ctx;var ctx;var contextHandle;if(useWebGL){var contextAttributes={antialias:false,alpha:false};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}canvas.style.backgroundColor="black"}else{ctx=canvas.getContext("2d")}if(!ctx)return null;if(setInModule){if(!useWebGL)assert(typeof GLctx==="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it");Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach((function(callback){callback()}));Browser.init()}return ctx}),destroyContext:(function(canvas,useWebGL,setInModule){}),fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:(function(lockPointer,resizeCanvas,vrDevice){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;Browser.vrDevice=vrDevice;if(typeof Browser.lockPointer==="undefined")Browser.lockPointer=true;if(typeof Browser.resizeCanvas==="undefined")Browser.resizeCanvas=false;if(typeof Browser.vrDevice==="undefined")Browser.vrDevice=null;var canvas=Module["canvas"];function fullScreenChange(){Browser.isFullScreen=false;var canvasContainer=canvas.parentNode;if((document["webkitFullScreenElement"]||document["webkitFullscreenElement"]||document["mozFullScreenElement"]||document["mozFullscreenElement"]||document["fullScreenElement"]||document["fullscreenElement"]||document["msFullScreenElement"]||document["msFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvasContainer){canvas.cancelFullScreen=document["cancelFullScreen"]||document["mozCancelFullScreen"]||document["webkitCancelFullScreen"]||document["msExitFullscreen"]||document["exitFullscreen"]||(function(){});canvas.cancelFullScreen=canvas.cancelFullScreen.bind(document);if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullScreen=true;if(Browser.resizeCanvas)Browser.setFullScreenCanvasSize()}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas)Browser.setWindowedCanvasSize()}if(Module["onFullScreen"])Module["onFullScreen"](Browser.isFullScreen);Browser.updateCanvasDimensions(canvas)}if(!Browser.fullScreenHandlersInstalled){Browser.fullScreenHandlersInstalled=true;document.addEventListener("fullscreenchange",fullScreenChange,false);document.addEventListener("mozfullscreenchange",fullScreenChange,false);document.addEventListener("webkitfullscreenchange",fullScreenChange,false);document.addEventListener("MSFullscreenChange",fullScreenChange,false)}var canvasContainer=document.createElement("div");canvas.parentNode.insertBefore(canvasContainer,canvas);canvasContainer.appendChild(canvas);canvasContainer.requestFullScreen=canvasContainer["requestFullScreen"]||canvasContainer["mozRequestFullScreen"]||canvasContainer["msRequestFullscreen"]||(canvasContainer["webkitRequestFullScreen"]?(function(){canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"])}):null);if(vrDevice){canvasContainer.requestFullScreen({vrDisplay:vrDevice})}else{canvasContainer.requestFullScreen()}}),nextRAF:0,fakeRequestAnimationFrame:(function(func){var now=Date.now();if(Browser.nextRAF===0){Browser.nextRAF=now+1e3/60}else{while(now+2>=Browser.nextRAF){Browser.nextRAF+=1e3/60}}var delay=Math.max(Browser.nextRAF-now,0);setTimeout(func,delay)}),requestAnimationFrame:function requestAnimationFrame(func){if(typeof window==="undefined"){Browser.fakeRequestAnimationFrame(func)}else{if(!window.requestAnimationFrame){window.requestAnimationFrame=window["requestAnimationFrame"]||window["mozRequestAnimationFrame"]||window["webkitRequestAnimationFrame"]||window["msRequestAnimationFrame"]||window["oRequestAnimationFrame"]||Browser.fakeRequestAnimationFrame}window.requestAnimationFrame(func)}},safeCallback:(function(func){return(function(){if(!ABORT)return func.apply(null,arguments)})}),allowAsyncCallbacks:true,queuedAsyncCallbacks:[],pauseAsyncCallbacks:(function(){Browser.allowAsyncCallbacks=false}),resumeAsyncCallbacks:(function(){Browser.allowAsyncCallbacks=true;if(Browser.queuedAsyncCallbacks.length>0){var callbacks=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[];callbacks.forEach((function(func){func()}))}}),safeRequestAnimationFrame:(function(func){return Browser.requestAnimationFrame((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}}))}),safeSetTimeout:(function(func,timeout){Module["noExitRuntime"]=true;return setTimeout((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}}),timeout)}),safeSetInterval:(function(func,timeout){Module["noExitRuntime"]=true;return setInterval((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}}),timeout)}),getMimetype:(function(name){return{"jpg":"image/jpeg","jpeg":"image/jpeg","png":"image/png","bmp":"image/bmp","ogg":"audio/ogg","wav":"audio/wav","mp3":"audio/mpeg"}[name.substr(name.lastIndexOf(".")+1)]}),getUserMedia:(function(func){if(!window.getUserMedia){window.getUserMedia=navigator["getUserMedia"]||navigator["mozGetUserMedia"]}window.getUserMedia(func)}),getMovementX:(function(event){return event["movementX"]||event["mozMovementX"]||event["webkitMovementX"]||0}),getMovementY:(function(event){return event["movementY"]||event["mozMovementY"]||event["webkitMovementY"]||0}),getMouseWheelDelta:(function(event){var delta=0;switch(event.type){case"DOMMouseScroll":delta=event.detail;break;case"mousewheel":delta=event.wheelDelta;break;case"wheel":delta=event["deltaY"];break;default:throw"unrecognized mouse wheel event: "+event.type}return delta}),mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:(function(event){if(Browser.pointerLock){if(event.type!="mousemove"&&"mozMovementX"in event){Browser.mouseMovementX=Browser.mouseMovementY=0}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event)}if(typeof SDL!="undefined"){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY}else{Browser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY}}else{var rect=Module["canvas"].getBoundingClientRect();var cw=Module["canvas"].width;var ch=Module["canvas"].height;var scrollX=typeof window.scrollX!=="undefined"?window.scrollX:window.pageXOffset;var scrollY=typeof window.scrollY!=="undefined"?window.scrollY:window.pageYOffset;if(event.type==="touchstart"||event.type==="touchend"||event.type==="touchmove"){var touch=event.touch;if(touch===undefined){return}var adjustedX=touch.pageX-(scrollX+rect.left);var adjustedY=touch.pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);var coords={x:adjustedX,y:adjustedY};if(event.type==="touchstart"){Browser.lastTouches[touch.identifier]=coords;Browser.touches[touch.identifier]=coords}else if(event.type==="touchend"||event.type==="touchmove"){var last=Browser.touches[touch.identifier];if(!last)last=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}var x=event.pageX-(scrollX+rect.left);var y=event.pageY-(scrollY+rect.top);x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y}}),xhrLoad:(function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response)}else{onerror()}};xhr.onerror=onerror;xhr.send(null)}),asyncLoad:(function(url,onload,onerror,noRunDep){Browser.xhrLoad(url,(function(arrayBuffer){assert(arrayBuffer,'Loading data file "'+url+'" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(!noRunDep)removeRunDependency("al "+url)}),(function(event){if(onerror){onerror()}else{throw'Loading data file "'+url+'" failed.'}}));if(!noRunDep)addRunDependency("al "+url)}),resizeListeners:[],updateResizeListeners:(function(){var canvas=Module["canvas"];Browser.resizeListeners.forEach((function(listener){listener(canvas.width,canvas.height)}))}),setCanvasSize:(function(width,height,noUpdates){var canvas=Module["canvas"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()}),windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:(function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];flags=flags|8388608;HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=flags}Browser.updateResizeListeners()}),setWindowedCanvasSize:(function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];flags=flags&~8388608;HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=flags}Browser.updateResizeListeners()}),updateCanvasDimensions:(function(canvas,wNative,hNative){if(wNative&&hNative){canvas.widthNative=wNative;canvas.heightNative=hNative}else{wNative=canvas.widthNative;hNative=canvas.heightNative}var w=wNative;var h=hNative;if(Module["forcedAspectRatio"]&&Module["forcedAspectRatio"]>0){if(w/h<Module["forcedAspectRatio"]){w=Math.round(h*Module["forcedAspectRatio"])}else{h=Math.round(w/Module["forcedAspectRatio"])}}if((document["webkitFullScreenElement"]||document["webkitFullscreenElement"]||document["mozFullScreenElement"]||document["mozFullscreenElement"]||document["fullScreenElement"]||document["fullscreenElement"]||document["msFullScreenElement"]||document["msFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvas.parentNode&&typeof screen!="undefined"){var factor=Math.min(screen.width/w,screen.height/h);w=Math.round(w*factor);h=Math.round(h*factor)}if(Browser.resizeCanvas){if(canvas.width!=w)canvas.width=w;if(canvas.height!=h)canvas.height=h;if(typeof canvas.style!="undefined"){canvas.style.removeProperty("width");canvas.style.removeProperty("height")}}else{if(canvas.width!=wNative)canvas.width=wNative;if(canvas.height!=hNative)canvas.height=hNative;if(typeof canvas.style!="undefined"){if(w!=wNative||h!=hNative){canvas.style.setProperty("width",w+"px","important");canvas.style.setProperty("height",h+"px","important")}else{canvas.style.removeProperty("width");canvas.style.removeProperty("height")}}}}),wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:(function(){var handle=Browser.nextWgetRequestHandle;Browser.nextWgetRequestHandle++;return handle})};function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}function _pthread_self(){return 0}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;assert(offset_high===0);FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _malloc(bytes){var ptr=Runtime.dynamicAlloc(bytes+8);return ptr+8&4294967288}Module["_malloc"]=_malloc;function ___cxa_allocate_exception(size){return _malloc(size)}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21505:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21506:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return-ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init()}));__ATMAIN__.push((function(){FS.ignorePermissions=false}));__ATEXIT__.push((function(){FS.quit()}));Module["FS_createFolder"]=FS.createFolder;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createLink"]=FS.createLink;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;__ATINIT__.unshift((function(){TTY.init()}));__ATEXIT__.push((function(){TTY.shutdown()}));if(ENVIRONMENT_IS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}Module["requestFullScreen"]=function Module_requestFullScreen(lockPointer,resizeCanvas,vrDevice){Browser.requestFullScreen(lockPointer,resizeCanvas,vrDevice)};Module["requestAnimationFrame"]=function Module_requestAnimationFrame(func){Browser.requestAnimationFrame(func)};Module["setCanvasSize"]=function Module_setCanvasSize(width,height,noUpdates){Browser.setCanvasSize(width,height,noUpdates)};Module["pauseMainLoop"]=function Module_pauseMainLoop(){Browser.mainLoop.pause()};Module["resumeMainLoop"]=function Module_resumeMainLoop(){Browser.mainLoop.resume()};Module["getUserMedia"]=function Module_getUserMedia(){Browser.getUserMedia()};Module["createContext"]=function Module_createContext(canvas,useWebGL,setInModule,webGLContextAttributes){return Browser.createContext(canvas,useWebGL,setInModule,webGLContextAttributes)};STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP);staticSealed=true;STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX);assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");function invoke_iiii(index,a1,a2,a3){try{return Module["dynCall_iiii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_vi(index,a1){try{Module["dynCall_vi"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_ii(index,a1){try{return Module["dynCall_ii"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viii(index,a1,a2,a3){try{Module["dynCall_viii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_v(index){try{Module["dynCall_v"](index)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viiii(index,a1,a2,a3,a4){try{Module["dynCall_viiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}Module.asmGlobalArg={"Math":Math,"Int8Array":Int8Array,"Int16Array":Int16Array,"Int32Array":Int32Array,"Uint8Array":Uint8Array,"Uint16Array":Uint16Array,"Uint32Array":Uint32Array,"Float32Array":Float32Array,"Float64Array":Float64Array,"NaN":NaN,"Infinity":Infinity};Module.asmLibraryArg={"abort":abort,"assert":assert,"invoke_iiii":invoke_iiii,"invoke_viiiii":invoke_viiiii,"invoke_vi":invoke_vi,"invoke_ii":invoke_ii,"invoke_viii":invoke_viii,"invoke_v":invoke_v,"invoke_viiiiii":invoke_viiiiii,"invoke_viiii":invoke_viiii,"_pthread_cleanup_pop":_pthread_cleanup_pop,"___syscall54":___syscall54,"___syscall6":___syscall6,"___setErrNo":___setErrNo,"___assert_fail":___assert_fail,"___cxa_allocate_exception":___cxa_allocate_exception,"___cxa_find_matching_catch":___cxa_find_matching_catch,"_emscripten_set_main_loop_timing":_emscripten_set_main_loop_timing,"_fabsf":_fabsf,"_sbrk":_sbrk,"_emscripten_memcpy_big":_emscripten_memcpy_big,"___resumeException":___resumeException,"__ZSt18uncaught_exceptionv":__ZSt18uncaught_exceptionv,"_sysconf":_sysconf,"_pthread_self":_pthread_self,"_sqrtf":_sqrtf,"___unlock":___unlock,"_emscripten_set_main_loop":_emscripten_set_main_loop,"___cxa_throw":___cxa_throw,"___lock":___lock,"_abort":_abort,"_pthread_cleanup_push":_pthread_cleanup_push,"_time":_time,"___syscall140":___syscall140,"___syscall146":___syscall146,"STACKTOP":STACKTOP,"STACK_MAX":STACK_MAX,"tempDoublePtr":tempDoublePtr,"ABORT":ABORT};// EMSCRIPTEN_START_ASM
+var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&filename!=nodePath["resolve"](filename)){filename=path.join(__dirname,"..","src",filename);ret=nodeFS["readFileSync"](filename)}if(ret&&!binary)ret=ret.toString();return ret};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};Module["load"]=function load(f){globalEval(read(f))};if(!Module["thisProgram"]){if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}else{Module["thisProgram"]="unknown-program"}}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(!Module["print"])Module["print"]=print;if(typeof printErr!="undefined")Module["printErr"]=printErr;if(typeof read!="undefined"){Module["read"]=read}else{Module["read"]=function read(){throw"no read() available (jsc?)"}}Module["readBinary"]=function readBinary(f){if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}var data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof console!=="undefined"){if(!Module["print"])Module["print"]=function print(x){console.log(x)};if(!Module["printErr"])Module["printErr"]=function printErr(x){console.log(x)}}else{var TRY_USE_DUMP=false;if(!Module["print"])Module["print"]=TRY_USE_DUMP&&typeof dump!=="undefined"?(function(x){dump(x)}):(function(x){})}if(ENVIRONMENT_IS_WORKER){Module["load"]=importScripts}if(typeof Module["setWindowTitle"]==="undefined"){Module["setWindowTitle"]=(function(title){document.title=title})}}else{throw"Unknown runtime environment. Where are we?"}function globalEval(x){eval.call(null,x)}if(!Module["load"]&&Module["read"]){Module["load"]=function load(f){globalEval(Module["read"](f))}}if(!Module["print"]){Module["print"]=(function(){})}if(!Module["printErr"]){Module["printErr"]=Module["print"]}if(!Module["arguments"]){Module["arguments"]=[]}if(!Module["thisProgram"]){Module["thisProgram"]="./this.program"}Module.print=Module["print"];Module.printErr=Module["printErr"];Module["preRun"]=[];Module["postRun"]=[];for(var key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}var Runtime={setTempRet0:(function(value){tempRet0=value}),getTempRet0:(function(){return tempRet0}),stackSave:(function(){return STACKTOP}),stackRestore:(function(stackTop){STACKTOP=stackTop}),getNativeTypeSize:(function(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return Runtime.QUANTUM_SIZE}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}),getNativeFieldSize:(function(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE)}),STACK_ALIGN:16,prepVararg:(function(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}),getAlignSize:(function(type,size,vararg){if(!vararg&&(type=="i64"||type=="double"))return 8;if(!type)return Math.min(size,8);return Math.min(size||(type?Runtime.getNativeFieldSize(type):0),Runtime.QUANTUM_SIZE)}),dynCall:(function(sig,ptr,args){if(args&&args.length){if(!args.splice)args=Array.prototype.slice.call(args);args.splice(0,0,ptr);return Module["dynCall_"+sig].apply(null,args)}else{return Module["dynCall_"+sig].call(null,ptr)}}),functionPointers:[],addFunction:(function(func){for(var i=0;i<Runtime.functionPointers.length;i++){if(!Runtime.functionPointers[i]){Runtime.functionPointers[i]=func;return 2*(1+i)}}throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."}),removeFunction:(function(index){Runtime.functionPointers[(index-2)/2]=null}),warnOnce:(function(text){if(!Runtime.warnOnce.shown)Runtime.warnOnce.shown={};if(!Runtime.warnOnce.shown[text]){Runtime.warnOnce.shown[text]=1;Module.printErr(text)}}),funcWrappers:{},getFuncWrapper:(function(func,sig){assert(sig);if(!Runtime.funcWrappers[sig]){Runtime.funcWrappers[sig]={}}var sigCache=Runtime.funcWrappers[sig];if(!sigCache[func]){sigCache[func]=function dynCall_wrapper(){return Runtime.dynCall(sig,func,arguments)}}return sigCache[func]}),getCompilerSetting:(function(name){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"}),stackAlloc:(function(size){var ret=STACKTOP;STACKTOP=STACKTOP+size|0;STACKTOP=STACKTOP+15&-16;return ret}),staticAlloc:(function(size){var ret=STATICTOP;STATICTOP=STATICTOP+size|0;STATICTOP=STATICTOP+15&-16;return ret}),dynamicAlloc:(function(size){var ret=DYNAMICTOP;DYNAMICTOP=DYNAMICTOP+size|0;DYNAMICTOP=DYNAMICTOP+15&-16;if(DYNAMICTOP>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){DYNAMICTOP=ret;return 0}}return ret}),alignMemory:(function(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:16))*(quantum?quantum:16);return ret}),makeBigInt:(function(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*+4294967296:+(low>>>0)+ +(high|0)*+4294967296;return ret}),GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module["Runtime"]=Runtime;var __THREW__=0;var ABORT=false;var EXITSTATUS=0;var undef=0;var tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat;var tempI64,tempI64b;var tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var globalScope=this;function getCFunc(ident){var func=Module["_"+ident];if(!func){try{func=eval("_"+ident)}catch(e){}}assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)");return func}var cwrap,ccall;((function(){var JSfuncs={"stackSave":(function(){Runtime.stackSave()}),"stackRestore":(function(){Runtime.stackRestore()}),"arrayToC":(function(arr){var ret=Runtime.stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){ret=Runtime.stackAlloc((str.length<<2)+1);writeStringToMemory(str,ret)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};ccall=function ccallFunc(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=Runtime.stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);if(returnType==="string")ret=Pointer_stringify(ret);if(stack!==0){if(opts&&opts.async){EmterpreterAsync.asyncFinalizers.push((function(){Runtime.stackRestore(stack)}));return}Runtime.stackRestore(stack)}return ret};var sourceRegex=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;function parseJSFunc(jsfunc){var parsed=jsfunc.toString().match(sourceRegex).slice(1);return{arguments:parsed[0],body:parsed[1],returnValue:parsed[2]}}var JSsource={};for(var fun in JSfuncs){if(JSfuncs.hasOwnProperty(fun)){JSsource[fun]=parseJSFunc(JSfuncs[fun])}}cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident);var numericArgs=argTypes.every((function(type){return type==="number"}));var numericRet=returnType!=="string";if(numericRet&&numericArgs){return cfunc}var argNames=argTypes.map((function(x,i){return"$"+i}));var funcstr="(function("+argNames.join(",")+") {";var nargs=argTypes.length;if(!numericArgs){funcstr+="var stack = "+JSsource["stackSave"].body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if(type==="number")continue;var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";";funcstr+=convertCode.body+";";funcstr+=arg+"="+convertCode.returnValue+";"}}var cfuncname=parseJSFunc((function(){return cfunc})).returnValue;funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");";if(!numericRet){var strgfy=parseJSFunc((function(){return Pointer_stringify})).returnValue;funcstr+="ret = "+strgfy+"(ret);"}if(!numericArgs){funcstr+=JSsource["stackRestore"].body.replace("()","(stack)")+";"}funcstr+="return ret})";return eval(funcstr)}}))();Module["ccall"]=ccall;Module["cwrap"]=cwrap;function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}Module["setValue"]=setValue;function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for setValue: "+type)}return null}Module["getValue"]=getValue;var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;var ALLOC_DYNAMIC=3;var ALLOC_NONE=4;Module["ALLOC_NORMAL"]=ALLOC_NORMAL;Module["ALLOC_STACK"]=ALLOC_STACK;Module["ALLOC_STATIC"]=ALLOC_STATIC;Module["ALLOC_DYNAMIC"]=ALLOC_DYNAMIC;Module["ALLOC_NONE"]=ALLOC_NONE;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var ptr=ret,stop;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr<stop;ptr+=4){HEAP32[ptr>>2]=0}stop=ret+size;while(ptr<stop){HEAP8[ptr++>>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i<size){var curr=slab[i];if(typeof curr==="function"){curr=Runtime.getFunctionIndex(curr)}type=singleType||types[i];if(type===0){i++;continue}if(type=="i64")type="i32";setValue(ret+i,curr,type);if(previousType!==type){typeSize=Runtime.getNativeTypeSize(type);previousType=type}i+=typeSize}return ret}Module["allocate"]=allocate;function getMemory(size){if(!staticSealed)return Runtime.staticAlloc(size);if(typeof _sbrk!=="undefined"&&!_sbrk.called||!runtimeInitialized)return Runtime.dynamicAlloc(size);return _malloc(size)}Module["getMemory"]=getMemory;function Pointer_stringify(ptr,length){if(length===0||!ptr)return"";var hasUtf=0;var t;var i=0;while(1){t=HEAPU8[ptr+i>>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return Module["UTF8ToString"](ptr)}Module["Pointer_stringify"]=Pointer_stringify;function AsciiToString(ptr){var str="";while(1){var ch=HEAP8[ptr++>>0];if(!ch)return str;str+=String.fromCharCode(ch)}}Module["AsciiToString"]=AsciiToString;function stringToAscii(str,outPtr){return writeAsciiToMemory(str,outPtr,false)}Module["stringToAscii"]=stringToAscii;function UTF8ArrayToString(u8Array,idx){var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}Module["UTF8ArrayToString"]=UTF8ArrayToString;function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}Module["UTF8ToString"]=UTF8ToString;function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}Module["stringToUTF8Array"]=stringToUTF8Array;function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}Module["stringToUTF8"]=stringToUTF8;function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}Module["lengthBytesUTF8"]=lengthBytesUTF8;function UTF16ToString(ptr){var i=0;var str="";while(1){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)return str;++i;str+=String.fromCharCode(codeUnit)}}Module["UTF16ToString"]=UTF16ToString;function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite<str.length*2?maxBytesToWrite/2:str.length;for(var i=0;i<numCharsToWrite;++i){var codeUnit=str.charCodeAt(i);HEAP16[outPtr>>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}Module["stringToUTF16"]=stringToUTF16;function lengthBytesUTF16(str){return str.length*2}Module["lengthBytesUTF16"]=lengthBytesUTF16;function UTF32ToString(ptr){var i=0;var str="";while(1){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)return str;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}}Module["UTF32ToString"]=UTF32ToString;function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}Module["stringToUTF32"]=stringToUTF32;function lengthBytesUTF32(str){var len=0;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343)++i;len+=4}return len}Module["lengthBytesUTF32"]=lengthBytesUTF32;function demangle(func){var hasLibcxxabi=!!Module["___cxa_demangle"];if(hasLibcxxabi){try{var buf=_malloc(func.length);writeStringToMemory(func.substr(1),buf);var status=_malloc(4);var ret=Module["___cxa_demangle"](buf,0,0,status);if(getValue(status,"i32")===0&&ret){return Pointer_stringify(ret)}}catch(e){}finally{if(buf)_free(buf);if(status)_free(status);if(ret)_free(ret)}}var i=3;var basicTypes={"v":"void","b":"bool","c":"char","s":"short","i":"int","l":"long","f":"float","d":"double","w":"wchar_t","a":"signed char","h":"unsigned char","t":"unsigned short","j":"unsigned int","m":"unsigned long","x":"long long","y":"unsigned long long","z":"..."};var subs=[];var first=true;function dump(x){if(x)Module.print(x);Module.print(func);var pre="";for(var a=0;a<i;a++)pre+=" ";Module.print(pre+"^")}function parseNested(){i++;if(func[i]==="K")i++;var parts=[];while(func[i]!=="E"){if(func[i]==="S"){i++;var next=func.indexOf("_",i);var num=func.substring(i,next)||0;parts.push(subs[num]||"?");i=next+1;continue}if(func[i]==="C"){parts.push(parts[parts.length-1]);i+=2;continue}var size=parseInt(func.substr(i));var pre=size.toString().length;if(!size||!pre){i--;break}var curr=func.substr(i+pre,size);parts.push(curr);subs.push(curr);i+=pre+size}i++;return parts}function parse(rawList,limit,allowVoid){limit=limit||Infinity;var ret="",list=[];function flushList(){return"("+list.join(", ")+")"}var name;if(func[i]==="N"){name=parseNested().join("::");limit--;if(limit===0)return rawList?[name]:name}else{if(func[i]==="K"||first&&func[i]==="L")i++;var size=parseInt(func.substr(i));if(size){var pre=size.toString().length;name=func.substr(i+pre,size);i+=pre+size}}first=false;if(func[i]==="I"){i++;var iList=parse(true);var iRet=parse(true,1,true);ret+=iRet[0]+" "+name+"<"+iList.join(", ")+">"}else{ret=name}paramLoop:while(i<func.length&&limit-->0){var c=func[i++];if(c in basicTypes){list.push(basicTypes[c])}else{switch(c){case"P":list.push(parse(true,1,true)[0]+"*");break;case"R":list.push(parse(true,1,true)[0]+"&");break;case"L":{i++;var end=func.indexOf("E",i);var size=end-i;list.push(func.substr(i,size));i+=size+2;break};case"A":{var size=parseInt(func.substr(i));i+=size.toString().length;if(func[i]!=="_")throw"?";i++;list.push(parse(true,1,true)[0]+" ["+size+"]");break};case"E":break paramLoop;default:ret+="?"+c;break paramLoop}}}if(!allowVoid&&list.length===1&&list[0]==="void")list=[];if(rawList){if(ret){list.push(ret+"?")}return list}else{return ret+flushList()}}var parsed=func;try{if(func=="Object._main"||func=="_main"){return"main()"}if(typeof func==="number")func=Pointer_stringify(func);if(func[0]!=="_")return func;if(func[1]!=="_")return func;if(func[2]!=="Z")return func;switch(func[3]){case"n":return"operator new()";case"d":return"operator delete()"}parsed=parse()}catch(e){parsed+="?"}if(parsed.indexOf("?")>=0&&!hasLibcxxabi){Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling")}return parsed}function demangleAll(text){return text.replace(/__Z[\w\d_]+/g,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}Module["stackTrace"]=stackTrace;var PAGE_SIZE=4096;function alignMemoryPage(x){if(x%4096>0){x+=4096-x%4096}return x}var HEAP;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var STATIC_BASE=0,STATICTOP=0,staticSealed=false;var STACK_BASE=0,STACKTOP=0,STACK_MAX=0;var DYNAMIC_BASE=0,DYNAMICTOP=0;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value "+TOTAL_MEMORY+", (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||499974144;var totalMemory=64*1024;while(totalMemory<TOTAL_MEMORY||totalMemory<2*TOTAL_STACK){if(totalMemory<16*1024*1024){totalMemory*=2}else{totalMemory+=16*1024*1024}}if(totalMemory!==TOTAL_MEMORY){TOTAL_MEMORY=totalMemory}assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&!!(new Int32Array(1))["subarray"]&&!!(new Int32Array(1))["set"],"JS engine does not provide full typed array support");var buffer;buffer=new ArrayBuffer(TOTAL_MEMORY);HEAP8=new Int8Array(buffer);HEAP16=new Int16Array(buffer);HEAP32=new Int32Array(buffer);HEAPU8=new Uint8Array(buffer);HEAPU16=new Uint16Array(buffer);HEAPU32=new Uint32Array(buffer);HEAPF32=new Float32Array(buffer);HEAPF64=new Float64Array(buffer);HEAP32[0]=255;assert(HEAPU8[0]===255&&HEAPU8[3]===0,"Typed arrays 2 must be run on a little-endian system");Module["HEAP"]=HEAP;Module["buffer"]=buffer;Module["HEAP8"]=HEAP8;Module["HEAP16"]=HEAP16;Module["HEAP32"]=HEAP32;Module["HEAPU8"]=HEAPU8;Module["HEAPU16"]=HEAPU16;Module["HEAPU32"]=HEAPU32;Module["HEAPF32"]=HEAPF32;Module["HEAPF64"]=HEAPF64;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Runtime.dynCall("v",func)}else{Runtime.dynCall("vi",func,[callback.arg])}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}Module["addOnPreRun"]=addOnPreRun;function addOnInit(cb){__ATINIT__.unshift(cb)}Module["addOnInit"]=addOnInit;function addOnPreMain(cb){__ATMAIN__.unshift(cb)}Module["addOnPreMain"]=addOnPreMain;function addOnExit(cb){__ATEXIT__.unshift(cb)}Module["addOnExit"]=addOnExit;function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}Module["addOnPostRun"]=addOnPostRun;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["intArrayFromString"]=intArrayFromString;function intArrayToString(array){var ret=[];for(var i=0;i<array.length;i++){var chr=array[i];if(chr>255){chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}Module["intArrayToString"]=intArrayToString;function writeStringToMemory(string,buffer,dontAddNull){var array=intArrayFromString(string,dontAddNull);var i=0;while(i<array.length){var chr=array[i];HEAP8[buffer+i>>0]=chr;i=i+1}}Module["writeStringToMemory"]=writeStringToMemory;function writeArrayToMemory(array,buffer){for(var i=0;i<array.length;i++){HEAP8[buffer++>>0]=array[i]}}Module["writeArrayToMemory"]=writeArrayToMemory;function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}Module["writeAsciiToMemory"]=writeAsciiToMemory;function unSign(value,bits,ignore){if(value>=0){return value}return bits<=32?2*Math.abs(1<<bits-1)+value:Math.pow(2,bits)+value}function reSign(value,bits,ignore){if(value<=0){return value}var half=bits<=32?Math.abs(1<<bits-1):Math.pow(2,bits-1);if(value>=half&&(bits<=32||value>half)){value=-2*half+value}return value}if(!Math["imul"]||Math["imul"](4294967295,5)!==-5)Math["imul"]=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};Math.imul=Math["imul"];if(!Math["clz32"])Math["clz32"]=(function(x){x=x>>>0;for(var i=0;i<32;i++){if(x&1<<31-i)return i}return 32});Math.clz32=Math["clz32"];var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_min=Math.min;var Math_clz32=Math.clz32;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}Module["addRunDependency"]=addRunDependency;function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["removeRunDependency"]=removeRunDependency;Module["preloadedImages"]={};Module["preloadedAudios"]={};var memoryInitializer=null;var ASM_CONSTS=[];STATIC_BASE=8;STATICTOP=STATIC_BASE+510960;__ATINIT__.push();memoryInitializer="basis.js.mem";var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);function copyTempFloat(ptr){HEAP8[tempDoublePtr]=HEAP8[ptr];HEAP8[tempDoublePtr+1]=HEAP8[ptr+1];HEAP8[tempDoublePtr+2]=HEAP8[ptr+2];HEAP8[tempDoublePtr+3]=HEAP8[ptr+3]}function copyTempDouble(ptr){HEAP8[tempDoublePtr]=HEAP8[ptr];HEAP8[tempDoublePtr+1]=HEAP8[ptr+1];HEAP8[tempDoublePtr+2]=HEAP8[ptr+2];HEAP8[tempDoublePtr+3]=HEAP8[ptr+3];HEAP8[tempDoublePtr+4]=HEAP8[ptr+4];HEAP8[tempDoublePtr+5]=HEAP8[ptr+5];HEAP8[tempDoublePtr+6]=HEAP8[ptr+6];HEAP8[tempDoublePtr+7]=HEAP8[ptr+7]}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(ERRNO_CODES.EINVAL);return-1}var _fabsf=Math_abs;function ___assert_fail(condition,filename,line,func){ABORT=true;throw"Assertion failed: "+Pointer_stringify(condition)+", at: "+[filename?Pointer_stringify(filename):"unknown filename",line,func?Pointer_stringify(func):"unknown function"]+" at "+stackTrace()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:(function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var ptr in EXCEPTIONS.infos){var info=EXCEPTIONS.infos[ptr];if(info.adjusted===adjusted){return ptr}}return adjusted}),addRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount++}),decRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];assert(info.refcount>0);info.refcount--;if(info.refcount===0){if(info.destructor){Runtime.dynCall("vi",info.destructor,[ptr])}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}}),clearRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0})};function ___resumeException(ptr){if(!EXCEPTIONS.last){EXCEPTIONS.last=ptr}EXCEPTIONS.clearRef(EXCEPTIONS.deAdjust(ptr));throw ptr+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function ___cxa_find_matching_catch(){var thrown=EXCEPTIONS.last;if(!thrown){return(asm["setTempRet0"](0),0)|0}var info=EXCEPTIONS.infos[thrown];var throwntype=info.type;if(!throwntype){return(asm["setTempRet0"](0),thrown)|0}var typeArray=Array.prototype.slice.call(arguments);var pointer=Module["___cxa_is_pointer_type"](throwntype);if(!___cxa_find_matching_catch.buffer)___cxa_find_matching_catch.buffer=_malloc(4);HEAP32[___cxa_find_matching_catch.buffer>>2]=thrown;thrown=___cxa_find_matching_catch.buffer;for(var i=0;i<typeArray.length;i++){if(typeArray[i]&&Module["___cxa_can_catch"](typeArray[i],throwntype,thrown)){thrown=HEAP32[thrown>>2];info.adjusted=thrown;return(asm["setTempRet0"](typeArray[i]),thrown)|0}}thrown=HEAP32[thrown>>2];return(asm["setTempRet0"](throwntype),thrown)|0}function ___cxa_throw(ptr,type,destructor){EXCEPTIONS.infos[ptr]={ptr:ptr,adjusted:ptr,type:type,destructor:destructor,refcount:0};EXCEPTIONS.last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exception=1}else{__ZSt18uncaught_exceptionv.uncaught_exception++}throw ptr+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}Module["_memset"]=_memset;function _pthread_cleanup_push(routine,arg){__ATEXIT__.push((function(){Runtime.dynCall("vi",routine,[arg])}));_pthread_cleanup_push.level=__ATEXIT__.length}Module["_bitshift64Lshr"]=_bitshift64Lshr;Module["_bitshift64Shl"]=_bitshift64Shl;function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!");__ATEXIT__.pop();_pthread_cleanup_push.level=__ATEXIT__.length}function _abort(){Module["abort"]()}var _sqrtf=Math_sqrt;function ___unlock(){}var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can   access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};var PATH={splitPath:(function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)}),normalizeArray:(function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}),normalize:(function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path}),dirname:(function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir}),basename:(function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)}),extname:(function(path){return PATH.splitPath(path)[3]}),join:(function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))}),join2:(function(l,r){return PATH.normalize(l+"/"+r)}),resolve:(function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter((function(p){return!!p})),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."}),relative:(function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")})};var TTY={ttys:[],init:(function(){}),shutdown:(function(){}),register:(function(dev,ops){TTY.ttys[dev]={input:[],output:[],ops:ops};FS.registerDevice(dev,TTY.stream_ops)}),stream_ops:{open:(function(stream){var tty=TTY.ttys[stream.node.rdev];if(!tty){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}stream.tty=tty;stream.seekable=false}),close:(function(stream){stream.tty.ops.flush(stream.tty)}),flush:(function(stream){stream.tty.ops.flush(stream.tty)}),read:(function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.get_char){throw new FS.ErrnoError(ERRNO_CODES.ENXIO)}var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=stream.tty.ops.get_char(stream.tty)}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(ERRNO_CODES.EAGAIN)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead}),write:(function(stream,buffer,offset,length,pos){if(!stream.tty||!stream.tty.ops.put_char){throw new FS.ErrnoError(ERRNO_CODES.ENXIO)}for(var i=0;i<length;i++){try{stream.tty.ops.put_char(stream.tty,buffer[offset+i])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}}if(length){stream.node.timestamp=Date.now()}return i})},default_tty_ops:{get_char:(function(tty){if(!tty.input.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=new Buffer(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;var usingDevice=false;try{fd=fs.openSync("/dev/stdin","r");usingDevice=true}catch(e){}bytesRead=fs.readSync(fd,buf,0,BUFSIZE,null);if(usingDevice){fs.closeSync(fd)}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()}),put_char:(function(tty,val){if(val===null||val===10){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["print"](UTF8ArrayToString(tty.output,0));tty.output=[]}})},default_tty1_ops:{put_char:(function(tty,val){if(val===null||val===10){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}}),flush:(function(tty){if(tty.output&&tty.output.length>0){Module["printErr"](UTF8ArrayToString(tty.output,0));tty.output=[]}})}};var MEMFS={ops_table:null,mount:(function(mount){return MEMFS.createNode(null,"/",16384|511,0)}),createNode:(function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node}),getFileDataAsRegularArray:(function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;i<node.usedBytes;++i)arr.push(node.contents[i]);return arr}return node.contents}),getFileDataAsTypedArray:(function(node){if(!node.contents)return new Uint8Array;if(node.contents.subarray)return node.contents.subarray(0,node.usedBytes);return new Uint8Array(node.contents)}),expandFileStorage:(function(node,newCapacity){if(node.contents&&node.contents.subarray&&newCapacity>node.contents.length){node.contents=MEMFS.getFileDataAsRegularArray(node);node.usedBytes=node.contents.length}if(!node.contents||node.contents.subarray){var prevCapacity=node.contents?node.contents.buffer.byteLength:0;if(prevCapacity>=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity<CAPACITY_DOUBLING_MAX?2:1.125)|0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return}if(!node.contents&&newCapacity>0)node.contents=[];while(node.contents.length<newCapacity)node.contents.push(0)}),resizeFileStorage:(function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;return}if(!node.contents||node.contents.subarray){var oldContents=node.contents;node.contents=new Uint8Array(new ArrayBuffer(newSize));if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize;return}if(!node.contents)node.contents=[];if(node.contents.length>newSize)node.contents.length=newSize;else while(node.contents.length<newSize)node.contents.push(0);node.usedBytes=newSize}),node_ops:{getattr:(function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr}),setattr:(function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}}),lookup:(function(parent,name){throw FS.genericErrors[ERRNO_CODES.ENOENT]}),mknod:(function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)}),rename:(function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}}}delete old_node.parent.contents[old_node.name];old_node.name=new_name;new_dir.contents[new_name]=old_node;old_node.parent=new_dir}),unlink:(function(parent,name){delete parent.contents[name]}),rmdir:(function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}delete parent.contents[name]}),readdir:(function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries}),symlink:(function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node}),readlink:(function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return node.link})},stream_ops:{read:(function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i<size;i++)buffer[offset+i]=contents[position+i]}return size}),write:(function(stream,buffer,offset,length,position,canOwn){if(!length)return 0;var node=stream.node;node.timestamp=Date.now();if(buffer.subarray&&(!node.contents||node.contents.subarray)){if(canOwn){node.contents=buffer.subarray(offset,offset+length);node.usedBytes=length;return length}else if(node.usedBytes===0&&position===0){node.contents=new Uint8Array(buffer.subarray(offset,offset+length));node.usedBytes=length;return length}else if(position+length<=node.usedBytes){node.contents.set(buffer.subarray(offset,offset+length),position);return length}}MEMFS.expandFileStorage(node,position+length);if(node.contents.subarray&&buffer.subarray)node.contents.set(buffer.subarray(offset,offset+length),position);else{for(var i=0;i<length;i++){node.contents[position+i]=buffer[offset+i]}}node.usedBytes=Math.max(node.usedBytes,position+length);return length}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.usedBytes}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position}),allocate:(function(stream,offset,length){MEMFS.expandFileStorage(stream.node,offset+length);stream.node.usedBytes=Math.max(stream.node.usedBytes,offset+length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}var ptr;var allocated;var contents=stream.node.contents;if(!(flags&2)&&(contents.buffer===buffer||contents.buffer===buffer.buffer)){allocated=false;ptr=contents.byteOffset}else{if(position>0||position+length<stream.node.usedBytes){if(contents.subarray){contents=contents.subarray(position,position+length)}else{contents=Array.prototype.slice.call(contents,position,position+length)}}allocated=true;ptr=_malloc(length);if(!ptr){throw new FS.ErrnoError(ERRNO_CODES.ENOMEM)}buffer.set(contents,ptr)}return{ptr:ptr,allocated:allocated}}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!FS.isFile(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}if(mmapFlags&2){return 0}var bytesWritten=MEMFS.stream_ops.write(stream,buffer,0,length,offset,false);return 0})}};var IDBFS={dbs:{},indexedDB:(function(){if(typeof indexedDB!=="undefined")return indexedDB;var ret=null;if(typeof window==="object")ret=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;assert(ret,"IDBFS used, but indexedDB not supported");return ret}),DB_VERSION:21,DB_STORE_NAME:"FILE_DATA",mount:(function(mount){return MEMFS.mount.apply(null,arguments)}),syncfs:(function(mount,populate,callback){IDBFS.getLocalSet(mount,(function(err,local){if(err)return callback(err);IDBFS.getRemoteSet(mount,(function(err,remote){if(err)return callback(err);var src=populate?remote:local;var dst=populate?local:remote;IDBFS.reconcile(src,dst,callback)}))}))}),getDB:(function(name,callback){var db=IDBFS.dbs[name];if(db){return callback(null,db)}var req;try{req=IDBFS.indexedDB().open(name,IDBFS.DB_VERSION)}catch(e){return callback(e)}req.onupgradeneeded=(function(e){var db=e.target.result;var transaction=e.target.transaction;var fileStore;if(db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)){fileStore=transaction.objectStore(IDBFS.DB_STORE_NAME)}else{fileStore=db.createObjectStore(IDBFS.DB_STORE_NAME)}if(!fileStore.indexNames.contains("timestamp")){fileStore.createIndex("timestamp","timestamp",{unique:false})}});req.onsuccess=(function(){db=req.result;IDBFS.dbs[name]=db;callback(null,db)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),getLocalSet:(function(mount,callback){var entries={};function isRealDir(p){return p!=="."&&p!==".."}function toAbsolute(root){return(function(p){return PATH.join2(root,p)})}var check=FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));while(check.length){var path=check.pop();var stat;try{stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){check.push.apply(check,FS.readdir(path).filter(isRealDir).map(toAbsolute(path)))}entries[path]={timestamp:stat.mtime}}return callback(null,{type:"local",entries:entries})}),getRemoteSet:(function(mount,callback){var entries={};IDBFS.getDB(mount.mountpoint,(function(err,db){if(err)return callback(err);var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readonly");transaction.onerror=(function(e){callback(this.error);e.preventDefault()});var store=transaction.objectStore(IDBFS.DB_STORE_NAME);var index=store.index("timestamp");index.openKeyCursor().onsuccess=(function(event){var cursor=event.target.result;if(!cursor){return callback(null,{type:"remote",db:db,entries:entries})}entries[cursor.primaryKey]={timestamp:cursor.key};cursor.continue()})}))}),loadLocalEntry:(function(path,callback){var stat,node;try{var lookup=FS.lookupPath(path);node=lookup.node;stat=FS.stat(path)}catch(e){return callback(e)}if(FS.isDir(stat.mode)){return callback(null,{timestamp:stat.mtime,mode:stat.mode})}else if(FS.isFile(stat.mode)){node.contents=MEMFS.getFileDataAsTypedArray(node);return callback(null,{timestamp:stat.mtime,mode:stat.mode,contents:node.contents})}else{return callback(new Error("node type not supported"))}}),storeLocalEntry:(function(path,entry,callback){try{if(FS.isDir(entry.mode)){FS.mkdir(path,entry.mode)}else if(FS.isFile(entry.mode)){FS.writeFile(path,entry.contents,{encoding:"binary",canOwn:true})}else{return callback(new Error("node type not supported"))}FS.chmod(path,entry.mode);FS.utime(path,entry.timestamp,entry.timestamp)}catch(e){return callback(e)}callback(null)}),removeLocalEntry:(function(path,callback){try{var lookup=FS.lookupPath(path);var stat=FS.stat(path);if(FS.isDir(stat.mode)){FS.rmdir(path)}else if(FS.isFile(stat.mode)){FS.unlink(path)}}catch(e){return callback(e)}callback(null)}),loadRemoteEntry:(function(store,path,callback){var req=store.get(path);req.onsuccess=(function(event){callback(null,event.target.result)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),storeRemoteEntry:(function(store,path,entry,callback){var req=store.put(entry,path);req.onsuccess=(function(){callback(null)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),removeRemoteEntry:(function(store,path,callback){var req=store.delete(path);req.onsuccess=(function(){callback(null)});req.onerror=(function(e){callback(this.error);e.preventDefault()})}),reconcile:(function(src,dst,callback){var total=0;var create=[];Object.keys(src.entries).forEach((function(key){var e=src.entries[key];var e2=dst.entries[key];if(!e2||e.timestamp>e2.timestamp){create.push(key);total++}}));var remove=[];Object.keys(dst.entries).forEach((function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}}));if(!total){return callback(null)}var errored=false;var completed=0;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=total){return callback(null)}}transaction.onerror=(function(e){done(this.error);e.preventDefault()});create.sort().forEach((function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,(function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)}))}else{IDBFS.loadLocalEntry(path,(function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)}))}}));remove.sort().reverse().forEach((function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}}))})};var NODEFS={isWindows:false,staticInit:(function(){NODEFS.isWindows=!!process.platform.match(/^win/)}),mount:(function(mount){assert(ENVIRONMENT_IS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)}),createNode:(function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node}),getMode:(function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&146)>>1}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return stat.mode}),realPath:(function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)}),flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:(function(flags){flags&=~32768;if(flags in NODEFS.flagsToPermissionStringMap){return NODEFS.flagsToPermissionStringMap[flags]}else{throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}}),node_ops:{getattr:(function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}}),setattr:(function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),lookup:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)}),mknod:(function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return node}),rename:(function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),unlink:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),rmdir:(function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readdir:(function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),symlink:(function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),readlink:(function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}})},stream_ops:{open:(function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsToPermissionString(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),close:(function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}),read:(function(stream,buffer,offset,length,position){if(length===0)return 0;var nbuffer=new Buffer(length);var res;try{res=fs.readSync(stream.nfd,nbuffer,0,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(res>0){for(var i=0;i<res;i++){buffer[offset+i]=nbuffer[i]}}return res}),write:(function(stream,buffer,offset,length,position){var nbuffer=new Buffer(buffer.subarray(offset,offset+length));var res;try{res=fs.writeSync(stream.nfd,nbuffer,0,length,position)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}return res}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:(function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i<parts.length-1;i++){var curr=parts.slice(0,i+1).join("/");if(!createdParents[curr]){createdParents[curr]=WORKERFS.createNode(parent,curr,WORKERFS.DIR_MODE,0)}parent=createdParents[curr]}return parent}function base(path){var parts=path.split("/");return parts[parts.length-1]}Array.prototype.forEach.call(mount.opts["files"]||[],(function(file){WORKERFS.createNode(ensureParent(file.name),base(file.name),WORKERFS.FILE_MODE,0,file,file.lastModifiedDate)}));(mount.opts["blobs"]||[]).forEach((function(obj){WORKERFS.createNode(ensureParent(obj["name"]),base(obj["name"]),WORKERFS.FILE_MODE,0,obj["data"])}));(mount.opts["packages"]||[]).forEach((function(pack){pack["metadata"].files.forEach((function(file){var name=file.filename.substr(1);WORKERFS.createNode(ensureParent(name),base(name),WORKERFS.FILE_MODE,0,pack["blob"].slice(file.start,file.end))}))}));return root}),createNode:(function(parent,name,mode,dev,contents,mtime){var node=FS.createNode(parent,name,mode);node.mode=mode;node.node_ops=WORKERFS.node_ops;node.stream_ops=WORKERFS.stream_ops;node.timestamp=(mtime||new Date).getTime();assert(WORKERFS.FILE_MODE!==WORKERFS.DIR_MODE);if(mode===WORKERFS.FILE_MODE){node.size=contents.size;node.contents=contents}else{node.size=4096;node.contents={}}if(parent){parent.contents[name]=node}return node}),node_ops:{getattr:(function(node){return{dev:1,ino:undefined,mode:node.mode,nlink:1,uid:0,gid:0,rdev:undefined,size:node.size,atime:new Date(node.timestamp),mtime:new Date(node.timestamp),ctime:new Date(node.timestamp),blksize:4096,blocks:Math.ceil(node.size/4096)}}),setattr:(function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}}),lookup:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}),mknod:(function(parent,name,mode,dev){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),rename:(function(oldNode,newDir,newName){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),unlink:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),rmdir:(function(parent,name){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),readdir:(function(node){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),symlink:(function(parent,newName,oldPath){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}),readlink:(function(node){throw new FS.ErrnoError(ERRNO_CODES.EPERM)})},stream_ops:{read:(function(stream,buffer,offset,length,position){if(position>=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size}),write:(function(stream,buffer,offset,length,position){throw new FS.ErrnoError(ERRNO_CODES.EIO)}),llseek:(function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return position})}};var _stdin=allocate(1,"i32*",ALLOC_STATIC);var _stdout=allocate(1,"i32*",ALLOC_STATIC);var _stderr=allocate(1,"i32*",ALLOC_STATIC);var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,handleFSError:(function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)}),lookupPath:(function(path,opts){path=PATH.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}var parts=PATH.normalizeArray(path.split("/").filter((function(p){return!!p})),false);var current=FS.root;var current_path="/";for(var i=0;i<parts.length;i++){var islast=i===parts.length-1;if(islast&&opts.parent){break}current=FS.lookupNode(current,parts[i]);current_path=PATH.join2(current_path,parts[i]);if(FS.isMountpoint(current)){if(!islast||islast&&opts.follow_mount){current=current.mounted.root}}if(!islast||opts.follow){var count=0;while(FS.isLink(current.mode)){var link=FS.readlink(current_path);current_path=PATH.resolve(PATH.dirname(current_path),link);var lookup=FS.lookupPath(current_path,{recurse_count:opts.recurse_count});current=lookup.node;if(count++>40){throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}}}return{path:current_path,node:current}}),getPath:(function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}}),hashName:(function(parentid,name){var hash=0;for(var i=0;i<name.length;i++){hash=(hash<<5)-hash+name.charCodeAt(i)|0}return(parentid+hash>>>0)%FS.nameTable.length}),hashAddNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node}),hashRemoveNode:(function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}}),lookupNode:(function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)}),createNode:(function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=(function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev});FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:(function(){return(this.mode&readMode)===readMode}),set:(function(val){val?this.mode|=readMode:this.mode&=~readMode})},write:{get:(function(){return(this.mode&writeMode)===writeMode}),set:(function(val){val?this.mode|=writeMode:this.mode&=~writeMode})},isFolder:{get:(function(){return FS.isDir(this.mode)})},isDevice:{get:(function(){return FS.isChrdev(this.mode)})}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node}),destroyNode:(function(node){FS.hashRemoveNode(node)}),isRoot:(function(node){return node===node.parent}),isMountpoint:(function(node){return!!node.mounted}),isFile:(function(mode){return(mode&61440)===32768}),isDir:(function(mode){return(mode&61440)===16384}),isLink:(function(mode){return(mode&61440)===40960}),isChrdev:(function(mode){return(mode&61440)===8192}),isBlkdev:(function(mode){return(mode&61440)===24576}),isFIFO:(function(mode){return(mode&61440)===4096}),isSocket:(function(mode){return(mode&49152)===49152}),flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:(function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags}),flagsToPermissionString:(function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms}),nodePermissions:(function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return ERRNO_CODES.EACCES}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return ERRNO_CODES.EACCES}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return ERRNO_CODES.EACCES}return 0}),mayLookup:(function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return ERRNO_CODES.EACCES;return 0}),mayCreate:(function(dir,name){try{var node=FS.lookupNode(dir,name);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(dir,"wx")}),mayDelete:(function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return ERRNO_CODES.ENOTDIR}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return ERRNO_CODES.EBUSY}}else{if(FS.isDir(node.mode)){return ERRNO_CODES.EISDIR}}return 0}),mayOpen:(function(node,flags){if(!node){return ERRNO_CODES.ENOENT}if(FS.isLink(node.mode)){return ERRNO_CODES.ELOOP}else if(FS.isDir(node.mode)){if((flags&2097155)!==0||flags&512){return ERRNO_CODES.EISDIR}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))}),MAX_OPEN_FDS:4096,nextfd:(function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(ERRNO_CODES.EMFILE)}),getStream:(function(fd){return FS.streams[fd]}),createStream:(function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=(function(){});FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:(function(){return this.node}),set:(function(val){this.node=val})},isRead:{get:(function(){return(this.flags&2097155)!==1})},isWrite:{get:(function(){return(this.flags&2097155)!==0})},isAppend:{get:(function(){return this.flags&1024})}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream}),closeStream:(function(fd){FS.streams[fd]=null}),chrdev_stream_ops:{open:(function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}}),llseek:(function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)})},major:(function(dev){return dev>>8}),minor:(function(dev){return dev&255}),makedev:(function(ma,mi){return ma<<8|mi}),registerDevice:(function(dev,ops){FS.devices[dev]={stream_ops:ops}}),getDevice:(function(dev){return FS.devices[dev]}),getMounts:(function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts}),syncfs:(function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}var mounts=FS.getMounts(FS.root.mount);var completed=0;function done(err){if(err){if(!done.errored){done.errored=true;return callback(err)}return}if(++completed>=mounts.length){callback(null)}}mounts.forEach((function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)}))}),mount:(function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot}),unmount:(function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach((function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}}));node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)}),lookup:(function(parent,name){return parent.node_ops.lookup(parent,name)}),mknod:(function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.mknod(parent,name,mode,dev)}),create:(function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)}),mkdir:(function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)}),mkdev:(function(path,mode,dev){if(typeof dev==="undefined"){dev=mode;mode=438}mode|=8192;return FS.mknod(path,mode,dev)}),symlink:(function(oldpath,newpath){if(!PATH.resolve(oldpath)){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}var lookup=FS.lookupPath(newpath,{parent:true});var parent=lookup.node;if(!parent){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}var newname=PATH.basename(newpath);var err=FS.mayCreate(parent,newname);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.symlink){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return parent.node_ops.symlink(parent,newname,oldpath)}),rename:(function(old_path,new_path){var old_dirname=PATH.dirname(old_path);var new_dirname=PATH.dirname(new_path);var old_name=PATH.basename(old_path);var new_name=PATH.basename(new_path);var lookup,old_dir,new_dir;try{lookup=FS.lookupPath(old_path,{parent:true});old_dir=lookup.node;lookup=FS.lookupPath(new_path,{parent:true});new_dir=lookup.node}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(!old_dir||!new_dir)throw new FS.ErrnoError(ERRNO_CODES.ENOENT);if(old_dir.mount!==new_dir.mount){throw new FS.ErrnoError(ERRNO_CODES.EXDEV)}var old_node=FS.lookupNode(old_dir,old_name);var relative=PATH.relative(old_path,new_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}relative=PATH.relative(new_path,old_dirname);if(relative.charAt(0)!=="."){throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(old_node===new_node){return}var isdir=FS.isDir(old_node.mode);var err=FS.mayDelete(old_dir,old_name,isdir);if(err){throw new FS.ErrnoError(err)}err=new_node?FS.mayDelete(new_dir,new_name,isdir):FS.mayCreate(new_dir,new_name);if(err){throw new FS.ErrnoError(err)}if(!old_dir.node_ops.rename){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(old_node)||new_node&&FS.isMountpoint(new_node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(new_dir!==old_dir){err=FS.nodePermissions(old_dir,"w");if(err){throw new FS.ErrnoError(err)}}try{if(FS.trackingDelegate["willMovePath"]){FS.trackingDelegate["willMovePath"](old_path,new_path)}}catch(e){console.log("FS.trackingDelegate['willMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}FS.hashRemoveNode(old_node);try{old_dir.node_ops.rename(old_node,new_dir,new_name)}catch(e){throw e}finally{FS.hashAddNode(old_node)}try{if(FS.trackingDelegate["onMovePath"])FS.trackingDelegate["onMovePath"](old_path,new_path)}catch(e){console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: "+e.message)}}),rmdir:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,true);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.rmdir){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.rmdir(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;if(!node.node_ops.readdir){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}return node.node_ops.readdir(node)}),unlink:(function(path){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);var node=FS.lookupNode(parent,name);var err=FS.mayDelete(parent,name,false);if(err){if(err===ERRNO_CODES.EISDIR)err=ERRNO_CODES.EPERM;throw new FS.ErrnoError(err)}if(!parent.node_ops.unlink){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isMountpoint(node)){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}try{if(FS.trackingDelegate["willDeletePath"]){FS.trackingDelegate["willDeletePath"](path)}}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+path+"') threw an exception: "+e.message)}parent.node_ops.unlink(parent,name);FS.destroyNode(node);try{if(FS.trackingDelegate["onDeletePath"])FS.trackingDelegate["onDeletePath"](path)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: "+e.message)}}),readlink:(function(path){var lookup=FS.lookupPath(path);var link=lookup.node;if(!link){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!link.node_ops.readlink){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}return PATH.resolve(FS.getPath(link.parent),link.node_ops.readlink(link))}),stat:(function(path,dontFollow){var lookup=FS.lookupPath(path,{follow:!dontFollow});var node=lookup.node;if(!node){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(!node.node_ops.getattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}return node.node_ops.getattr(node)}),lstat:(function(path){return FS.stat(path,true)}),chmod:(function(path,mode,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}node.node_ops.setattr(node,{mode:mode&4095|node.mode&~4095,timestamp:Date.now()})}),lchmod:(function(path,mode){FS.chmod(path,mode,true)}),fchmod:(function(fd,mode){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}FS.chmod(stream.node,mode)}),chown:(function(path,uid,gid,dontFollow){var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:!dontFollow});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}node.node_ops.setattr(node,{timestamp:Date.now()})}),lchown:(function(path,uid,gid){FS.chown(path,uid,gid,true)}),fchown:(function(fd,uid,gid){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}FS.chown(stream.node,uid,gid)}),truncate:(function(path,len){if(len<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var node;if(typeof path==="string"){var lookup=FS.lookupPath(path,{follow:true});node=lookup.node}else{node=path}if(!node.node_ops.setattr){throw new FS.ErrnoError(ERRNO_CODES.EPERM)}if(FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!FS.isFile(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var err=FS.nodePermissions(node,"w");if(err){throw new FS.ErrnoError(err)}node.node_ops.setattr(node,{size:len,timestamp:Date.now()})}),ftruncate:(function(fd,len){var stream=FS.getStream(fd);if(!stream){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}FS.truncate(stream.node,len)}),utime:(function(path,atime,mtime){var lookup=FS.lookupPath(path,{follow:true});var node=lookup.node;node.node_ops.setattr(node,{timestamp:Math.max(atime,mtime)})}),open:(function(path,flags,mode,fd_start,fd_end){if(path===""){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}flags=typeof flags==="string"?FS.modeStringToFlags(flags):flags;mode=typeof mode==="undefined"?438:mode;if(flags&64){mode=mode&4095|32768}else{mode=0}var node;if(typeof path==="object"){node=path}else{path=PATH.normalize(path);try{var lookup=FS.lookupPath(path,{follow:!(flags&131072)});node=lookup.node}catch(e){}}var created=false;if(flags&64){if(node){if(flags&128){throw new FS.ErrnoError(ERRNO_CODES.EEXIST)}}else{node=FS.mknod(path,mode,0);created=true}}if(!node){throw new FS.ErrnoError(ERRNO_CODES.ENOENT)}if(FS.isChrdev(node.mode)){flags&=~512}if(flags&65536&&!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}if(!created){var err=FS.mayOpen(node,flags);if(err){throw new FS.ErrnoError(err)}}if(flags&512){FS.truncate(node,0)}flags&=~(128|512);var stream=FS.createStream({node:node,path:FS.getPath(node),flags:flags,seekable:true,position:0,stream_ops:node.stream_ops,ungotten:[],error:false},fd_start,fd_end);if(stream.stream_ops.open){stream.stream_ops.open(stream)}if(Module["logReadFiles"]&&!(flags&1)){if(!FS.readFiles)FS.readFiles={};if(!(path in FS.readFiles)){FS.readFiles[path]=1;Module["printErr"]("read file: "+path)}}try{if(FS.trackingDelegate["onOpenFile"]){var trackingFlags=0;if((flags&2097155)!==1){trackingFlags|=FS.tracking.openFlags.READ}if((flags&2097155)!==0){trackingFlags|=FS.tracking.openFlags.WRITE}FS.trackingDelegate["onOpenFile"](path,trackingFlags)}}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: "+e.message)}return stream}),close:(function(stream){if(stream.getdents)stream.getdents=null;try{if(stream.stream_ops.close){stream.stream_ops.close(stream)}}catch(e){throw e}finally{FS.closeStream(stream.fd)}}),llseek:(function(stream,offset,whence){if(!stream.seekable||!stream.stream_ops.llseek){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}stream.position=stream.stream_ops.llseek(stream,offset,whence);stream.ungotten=[];return stream.position}),read:(function(stream,buffer,offset,length,position){if(length<0||position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===1){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!stream.stream_ops.read){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}var seeking=true;if(typeof position==="undefined"){position=stream.position;seeking=false}else if(!stream.seekable){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}var bytesRead=stream.stream_ops.read(stream,buffer,offset,length,position);if(!seeking)stream.position+=bytesRead;return bytesRead}),write:(function(stream,buffer,offset,length,position,canOwn){if(length<0||position<0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(FS.isDir(stream.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.EISDIR)}if(!stream.stream_ops.write){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if(stream.flags&1024){FS.llseek(stream,0,2)}var seeking=true;if(typeof position==="undefined"){position=stream.position;seeking=false}else if(!stream.seekable){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}var bytesWritten=stream.stream_ops.write(stream,buffer,offset,length,position,canOwn);if(!seeking)stream.position+=bytesWritten;try{if(stream.path&&FS.trackingDelegate["onWriteToFile"])FS.trackingDelegate["onWriteToFile"](stream.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return bytesWritten}),allocate:(function(stream,offset,length){if(offset<0||length<=0){throw new FS.ErrnoError(ERRNO_CODES.EINVAL)}if((stream.flags&2097155)===0){throw new FS.ErrnoError(ERRNO_CODES.EBADF)}if(!FS.isFile(stream.node.mode)&&!FS.isDir(node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}if(!stream.stream_ops.allocate){throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP)}stream.stream_ops.allocate(stream,offset,length)}),mmap:(function(stream,buffer,offset,length,position,prot,flags){if((stream.flags&2097155)===1){throw new FS.ErrnoError(ERRNO_CODES.EACCES)}if(!stream.stream_ops.mmap){throw new FS.ErrnoError(ERRNO_CODES.ENODEV)}return stream.stream_ops.mmap(stream,buffer,offset,length,position,prot,flags)}),msync:(function(stream,buffer,offset,length,mmapFlags){if(!stream||!stream.stream_ops.msync){return 0}return stream.stream_ops.msync(stream,buffer,offset,length,mmapFlags)}),munmap:(function(stream){return 0}),ioctl:(function(stream,cmd,arg){if(!stream.stream_ops.ioctl){throw new FS.ErrnoError(ERRNO_CODES.ENOTTY)}return stream.stream_ops.ioctl(stream,cmd,arg)}),readFile:(function(path,opts){opts=opts||{};opts.flags=opts.flags||"r";opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var ret;var stream=FS.open(path,opts.flags);var stat=FS.stat(path);var length=stat.size;var buf=new Uint8Array(length);FS.read(stream,buf,0,length,0);if(opts.encoding==="utf8"){ret=UTF8ArrayToString(buf,0)}else if(opts.encoding==="binary"){ret=buf}FS.close(stream);return ret}),writeFile:(function(path,data,opts){opts=opts||{};opts.flags=opts.flags||"w";opts.encoding=opts.encoding||"utf8";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error('Invalid encoding type "'+opts.encoding+'"')}var stream=FS.open(path,opts.flags,opts.mode);if(opts.encoding==="utf8"){var buf=new Uint8Array(lengthBytesUTF8(data)+1);var actualNumBytes=stringToUTF8Array(data,buf,0,buf.length);FS.write(stream,buf,0,actualNumBytes,0,opts.canOwn)}else if(opts.encoding==="binary"){FS.write(stream,data,0,data.length,0,opts.canOwn)}FS.close(stream)}),cwd:(function(){return FS.currentPath}),chdir:(function(path){var lookup=FS.lookupPath(path,{follow:true});if(!FS.isDir(lookup.node.mode)){throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR)}var err=FS.nodePermissions(lookup.node,"x");if(err){throw new FS.ErrnoError(err)}FS.currentPath=lookup.path}),createDefaultDirectories:(function(){FS.mkdir("/tmp");FS.mkdir("/home");FS.mkdir("/home/web_user")}),createDefaultDevices:(function(){FS.mkdir("/dev");FS.registerDevice(FS.makedev(1,3),{read:(function(){return 0}),write:(function(stream,buffer,offset,length,pos){return length})});FS.mkdev("/dev/null",FS.makedev(1,3));TTY.register(FS.makedev(5,0),TTY.default_tty_ops);TTY.register(FS.makedev(6,0),TTY.default_tty1_ops);FS.mkdev("/dev/tty",FS.makedev(5,0));FS.mkdev("/dev/tty1",FS.makedev(6,0));var random_device;if(typeof crypto!=="undefined"){var randomBuffer=new Uint8Array(1);random_device=(function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]})}else if(ENVIRONMENT_IS_NODE){random_device=(function(){return require("crypto").randomBytes(1)[0]})}else{random_device=(function(){return Math.random()*256|0})}FS.createDevice("/dev","random",random_device);FS.createDevice("/dev","urandom",random_device);FS.mkdir("/dev/shm");FS.mkdir("/dev/shm/tmp")}),createSpecialDirectories:(function(){FS.mkdir("/proc");FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd");FS.mount({mount:(function(){var node=FS.createNode("/proc/self","fd",16384|511,73);node.node_ops={lookup:(function(parent,name){var fd=+name;var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);var ret={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:(function(){return stream.path})}};ret.parent=ret;return ret})};return node})},{},"/proc/self/fd")}),createStandardStreams:(function(){if(Module["stdin"]){FS.createDevice("/dev","stdin",Module["stdin"])}else{FS.symlink("/dev/tty","/dev/stdin")}if(Module["stdout"]){FS.createDevice("/dev","stdout",null,Module["stdout"])}else{FS.symlink("/dev/tty","/dev/stdout")}if(Module["stderr"]){FS.createDevice("/dev","stderr",null,Module["stderr"])}else{FS.symlink("/dev/tty1","/dev/stderr")}var stdin=FS.open("/dev/stdin","r");assert(stdin.fd===0,"invalid handle for stdin ("+stdin.fd+")");var stdout=FS.open("/dev/stdout","w");assert(stdout.fd===1,"invalid handle for stdout ("+stdout.fd+")");var stderr=FS.open("/dev/stderr","w");assert(stderr.fd===2,"invalid handle for stderr ("+stderr.fd+")")}),ensureErrnoError:(function(){if(FS.ErrnoError)return;FS.ErrnoError=function ErrnoError(errno,node){this.node=node;this.setErrno=(function(errno){this.errno=errno;for(var key in ERRNO_CODES){if(ERRNO_CODES[key]===errno){this.code=key;break}}});this.setErrno(errno);this.message=ERRNO_MESSAGES[errno]};FS.ErrnoError.prototype=new Error;FS.ErrnoError.prototype.constructor=FS.ErrnoError;[ERRNO_CODES.ENOENT].forEach((function(code){FS.genericErrors[code]=new FS.ErrnoError(code);FS.genericErrors[code].stack="<generic error, no stack>"}))}),staticInit:(function(){FS.ensureErrnoError();FS.nameTable=new Array(4096);FS.mount(MEMFS,{},"/");FS.createDefaultDirectories();FS.createDefaultDevices();FS.createSpecialDirectories();FS.filesystems={"MEMFS":MEMFS,"IDBFS":IDBFS,"NODEFS":NODEFS,"WORKERFS":WORKERFS}}),init:(function(input,output,error){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");FS.init.initialized=true;FS.ensureErrnoError();Module["stdin"]=input||Module["stdin"];Module["stdout"]=output||Module["stdout"];Module["stderr"]=error||Module["stderr"];FS.createStandardStreams()}),quit:(function(){FS.init.initialized=false;var fflush=Module["_fflush"];if(fflush)fflush(0);for(var i=0;i<FS.streams.length;i++){var stream=FS.streams[i];if(!stream){continue}FS.close(stream)}}),getMode:(function(canRead,canWrite){var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode}),joinPath:(function(parts,forceRelative){var path=PATH.join.apply(null,parts);if(forceRelative&&path[0]=="/")path=path.substr(1);return path}),absolutePath:(function(relative,base){return PATH.resolve(base,relative)}),standardizePath:(function(path){return PATH.normalize(path)}),findObject:(function(path,dontResolveLastLink){var ret=FS.analyzePath(path,dontResolveLastLink);if(ret.exists){return ret.object}else{___setErrNo(ret.error);return null}}),analyzePath:(function(path,dontResolveLastLink){try{var lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});path=lookup.path}catch(e){}var ret={isRoot:false,exists:false,error:0,name:null,path:null,object:null,parentExists:false,parentPath:null,parentObject:null};try{var lookup=FS.lookupPath(path,{parent:true});ret.parentExists=true;ret.parentPath=lookup.path;ret.parentObject=lookup.node;ret.name=PATH.basename(path);lookup=FS.lookupPath(path,{follow:!dontResolveLastLink});ret.exists=true;ret.path=lookup.path;ret.object=lookup.node;ret.name=lookup.node.name;ret.isRoot=lookup.path==="/"}catch(e){ret.error=e.errno}return ret}),createFolder:(function(parent,name,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.mkdir(path,mode)}),createPath:(function(parent,path,canRead,canWrite){parent=typeof parent==="string"?parent:FS.getPath(parent);var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);try{FS.mkdir(current)}catch(e){}parent=current}return current}),createFile:(function(parent,name,properties,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(canRead,canWrite);return FS.create(path,mode)}),createDataFile:(function(parent,name,data,canRead,canWrite,canOwn){var path=name?PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name):parent;var mode=FS.getMode(canRead,canWrite);var node=FS.create(path,mode);if(data){if(typeof data==="string"){var arr=new Array(data.length);for(var i=0,len=data.length;i<len;++i)arr[i]=data.charCodeAt(i);data=arr}FS.chmod(node,mode|146);var stream=FS.open(node,"w");FS.write(stream,data,0,data.length,0,canOwn);FS.close(stream);FS.chmod(node,mode)}return node}),createDevice:(function(parent,name,input,output){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);var mode=FS.getMode(!!input,!!output);if(!FS.createDevice.major)FS.createDevice.major=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{open:(function(stream){stream.seekable=false}),close:(function(stream){if(output&&output.buffer&&output.buffer.length){output(10)}}),read:(function(stream,buffer,offset,length,pos){var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input()}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(result===undefined&&bytesRead===0){throw new FS.ErrnoError(ERRNO_CODES.EAGAIN)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}if(bytesRead){stream.node.timestamp=Date.now()}return bytesRead}),write:(function(stream,buffer,offset,length,pos){for(var i=0;i<length;i++){try{output(buffer[offset+i])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}}if(length){stream.node.timestamp=Date.now()}return i})});return FS.mkdev(path,mode,dev)}),createLink:(function(parent,name,target,canRead,canWrite){var path=PATH.join2(typeof parent==="string"?parent:FS.getPath(parent),name);return FS.symlink(target,path)}),forceLoadFile:(function(obj){if(obj.isDevice||obj.isFolder||obj.link||obj.contents)return true;var success=true;if(typeof XMLHttpRequest!=="undefined"){throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.")}else if(Module["read"]){try{obj.contents=intArrayFromString(Module["read"](obj.url),true);obj.usedBytes=obj.contents.length}catch(e){success=false}}else{throw new Error("Cannot load without read() or XMLHttpRequest.")}if(!success)___setErrNo(ERRNO_CODES.EIO);return success}),createLazyFile:(function(parent,name,url,canRead,canWrite){function LazyUint8Array(){this.lengthKnown=false;this.chunks=[]}LazyUint8Array.prototype.get=function LazyUint8Array_get(idx){if(idx>this.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=(function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}});var lazyArray=this;lazyArray.setDataGetter((function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]}));this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperty(lazyArray,"length",{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._length})});Object.defineProperty(lazyArray,"chunkSize",{get:(function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize})});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperty(node,"usedBytes",{get:(function(){return this.contents.length})});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach((function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return fn.apply(null,arguments)}}));stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(ERRNO_CODES.EIO)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i<size;i++){buffer[offset+i]=contents[position+i]}}else{for(var i=0;i<size;i++){buffer[offset+i]=contents.get(position+i)}}return size};node.stream_ops=stream_ops;return node}),createPreloadedFile:(function(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){Browser.init();var fullname=name?PATH.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency("cp "+fullname);function processData(byteArray){function finish(byteArray){if(preFinish)preFinish();if(!dontCreateFile){FS.createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}if(onload)onload();removeRunDependency(dep)}var handled=false;Module["preloadPlugins"].forEach((function(plugin){if(handled)return;if(plugin["canHandle"](fullname)){plugin["handle"](byteArray,fullname,finish,(function(){if(onerror)onerror();removeRunDependency(dep)}));handled=true}}));if(!handled)finish(byteArray)}addRunDependency(dep);if(typeof url=="string"){Browser.asyncLoad(url,(function(byteArray){processData(byteArray)}),onerror)}else{processData(url)}}),indexedDB:(function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB}),DB_NAME:(function(){return"EM_FS_"+window.location.pathname}),DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=function openRequest_onupgradeneeded(){console.log("creating db");var db=openRequest.result;db.createObjectStore(FS.DB_STORE_NAME)};openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;var transaction=db.transaction([FS.DB_STORE_NAME],"readwrite");var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var putRequest=files.put(FS.analyzePath(path).object.contents,path);putRequest.onsuccess=function putRequest_onsuccess(){ok++;if(ok+fail==total)finish()};putRequest.onerror=function putRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror}),loadFilesFromDB:(function(paths,onload,onerror){onload=onload||(function(){});onerror=onerror||(function(){});var indexedDB=FS.indexedDB();try{var openRequest=indexedDB.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return onerror(e)}openRequest.onupgradeneeded=onerror;openRequest.onsuccess=function openRequest_onsuccess(){var db=openRequest.result;try{var transaction=db.transaction([FS.DB_STORE_NAME],"readonly")}catch(e){onerror(e);return}var files=transaction.objectStore(FS.DB_STORE_NAME);var ok=0,fail=0,total=paths.length;function finish(){if(fail==0)onload();else onerror()}paths.forEach((function(path){var getRequest=files.get(path);getRequest.onsuccess=function getRequest_onsuccess(){if(FS.analyzePath(path).exists){FS.unlink(path)}FS.createDataFile(PATH.dirname(path),PATH.basename(path),getRequest.result,true,true,true);ok++;if(ok+fail==total)finish()};getRequest.onerror=function getRequest_onerror(){fail++;if(ok+fail==total)finish()}}));transaction.onerror=onerror};openRequest.onerror=onerror})};var SYSCALLS={DEFAULT_POLLMASK:5,mappings:{},umask:511,calculateAt:(function(dirfd,path){if(path[0]!=="/"){var dir;if(dirfd===-100){dir=FS.cwd()}else{var dirstream=FS.getStream(dirfd);if(!dirstream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);dir=dirstream.path}path=PATH.join2(dir,path)}return path}),doStat:(function(func,path,buf){try{var stat=func(path)}catch(e){if(e&&e.node&&PATH.normalize(path)!==PATH.normalize(FS.getPath(e.node))){return-ERRNO_CODES.ENOTDIR}throw e}HEAP32[buf>>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;HEAP32[buf+36>>2]=stat.size;HEAP32[buf+40>>2]=4096;HEAP32[buf+44>>2]=stat.blocks;HEAP32[buf+48>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+52>>2]=0;HEAP32[buf+56>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ino;return 0}),doMsync:(function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)}),doMkdir:(function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0}),doMknod:(function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-ERRNO_CODES.EINVAL}FS.mknod(path,mode,dev);return 0}),doReadlink:(function(path,buf,bufsize){if(bufsize<=0)return-ERRNO_CODES.EINVAL;var ret=FS.readlink(path);ret=ret.slice(0,Math.max(0,bufsize));writeStringToMemory(ret,buf,true);return ret.length}),doAccess:(function(path,amode){if(amode&~7){return-ERRNO_CODES.EINVAL}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-ERRNO_CODES.EACCES}return 0}),doDup:(function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd}),doReadv:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr<len)break}return ret}),doWritev:(function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret}),varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),getStreamFromFD:(function(){var stream=FS.getStream(SYSCALLS.get());if(!stream)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return stream}),getSocketFromFD:(function(){var socket=SOCKFS.getSocket(SYSCALLS.get());if(!socket)throw new FS.ErrnoError(ERRNO_CODES.EBADF);return socket}),getSocketAddress:(function(allowNull){var addrp=SYSCALLS.get(),addrlen=SYSCALLS.get();if(allowNull&&addrp===0)return null;var info=__read_sockaddr(addrp,addrlen);if(info.errno)throw new FS.ErrnoError(info.errno);info.addr=DNS.lookup_addr(info.addr)||info.addr;return info}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}Module["_i64Add"]=_i64Add;function _sbrk(bytes){var self=_sbrk;if(!self.called){DYNAMICTOP=alignMemoryPage(DYNAMICTOP);self.called=true;assert(Runtime.dynamicAlloc);self.alloc=Runtime.dynamicAlloc;Runtime.dynamicAlloc=(function(){abort("cannot dynamically allocate, sbrk now has control")})}var ret=DYNAMICTOP;if(bytes!=0){var success=self.alloc(bytes);if(!success)return-1>>>0}return ret}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doWritev(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}Module["_memcpy"]=_memcpy;function ___lock(){}function _emscripten_set_main_loop_timing(mode,value){Browser.mainLoop.timingMode=mode;Browser.mainLoop.timingValue=value;if(!Browser.mainLoop.func){return 1}if(mode==0){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setTimeout(){setTimeout(Browser.mainLoop.runner,value)};Browser.mainLoop.method="timeout"}else if(mode==1){Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_rAF(){Browser.requestAnimationFrame(Browser.mainLoop.runner)};Browser.mainLoop.method="rAF"}else if(mode==2){if(!window["setImmediate"]){var setImmediates=[];var emscriptenMainLoopMessageId="__emcc";function Browser_setImmediate_messageHandler(event){if(event.source===window&&event.data===emscriptenMainLoopMessageId){event.stopPropagation();setImmediates.shift()()}}window.addEventListener("message",Browser_setImmediate_messageHandler,true);window["setImmediate"]=function Browser_emulated_setImmediate(func){setImmediates.push(func);window.postMessage(emscriptenMainLoopMessageId,"*")}}Browser.mainLoop.scheduler=function Browser_mainLoop_scheduler_setImmediate(){window["setImmediate"](Browser.mainLoop.runner)};Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(func,fps,simulateInfiniteLoop,arg,noSetTiming){Module["noExitRuntime"]=true;assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.");Browser.mainLoop.func=func;Browser.mainLoop.arg=arg;var thisMainLoopId=Browser.mainLoop.currentlyRunningMainloop;Browser.mainLoop.runner=function Browser_mainLoop_runner(){if(ABORT)return;if(Browser.mainLoop.queue.length>0){var start=Date.now();var blocker=Browser.mainLoop.queue.shift();blocker.func(blocker.arg);if(Browser.mainLoop.remainingBlockers){var remaining=Browser.mainLoop.remainingBlockers;var next=remaining%1==0?remaining-1:Math.floor(remaining);if(blocker.counted){Browser.mainLoop.remainingBlockers=next}else{next=next+.5;Browser.mainLoop.remainingBlockers=(8*remaining+next)/9}}console.log('main loop blocker "'+blocker.name+'" took '+(Date.now()-start)+" ms");Browser.mainLoop.updateStatus();setTimeout(Browser.mainLoop.runner,0);return}if(thisMainLoopId<Browser.mainLoop.currentlyRunningMainloop)return;Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0;if(Browser.mainLoop.timingMode==1&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}if(Browser.mainLoop.method==="timeout"&&Module.ctx){Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!");Browser.mainLoop.method=""}Browser.mainLoop.runIter((function(){if(typeof arg!=="undefined"){Runtime.dynCall("vi",func,[arg])}else{Runtime.dynCall("v",func)}}));if(thisMainLoopId<Browser.mainLoop.currentlyRunningMainloop)return;if(typeof SDL==="object"&&SDL.audio&&SDL.audio.queueNewAudioData)SDL.audio.queueNewAudioData();Browser.mainLoop.scheduler()};if(!noSetTiming){if(fps&&fps>0)_emscripten_set_main_loop_timing(0,1e3/fps);else _emscripten_set_main_loop_timing(1,1);Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw"SimulateInfiniteLoop"}}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:(function(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++}),resume:(function(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;_emscripten_set_main_loop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()}),updateStatus:(function(){if(Module["setStatus"]){var message=Module["statusMessage"]||"Please wait...";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining<expected){Module["setStatus"](message+" ("+(expected-remaining)+"/"+expected+")")}else{Module["setStatus"](message)}}else{Module["setStatus"]("")}}}),runIter:(function(func){if(ABORT)return;if(Module["preMainLoop"]){var preRet=Module["preMainLoop"]();if(preRet===false){return}}try{func()}catch(e){if(e instanceof ExitStatus){return}else{if(e&&typeof e==="object"&&e.stack)Module.printErr("exception thrown: "+[e,e.stack]);throw e}}if(Module["postMainLoop"])Module["postMainLoop"]()})},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:(function(){if(!Module["preloadPlugins"])Module["preloadPlugins"]=[];if(Browser.initted)return;Browser.initted=true;try{new Blob;Browser.hasBlobConstructor=true}catch(e){Browser.hasBlobConstructor=false;console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder=typeof MozBlobBuilder!="undefined"?MozBlobBuilder:typeof WebKitBlobBuilder!="undefined"?WebKitBlobBuilder:!Browser.hasBlobConstructor?console.log("warning: no BlobBuilder"):null;Browser.URLObject=typeof window!="undefined"?window.URL?window.URL:window.webkitURL:undefined;if(!Module.noImageDecoding&&typeof Browser.URLObject==="undefined"){console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.");Module.noImageDecoding=true}var imagePlugin={};imagePlugin["canHandle"]=function imagePlugin_canHandle(name){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(name)};imagePlugin["handle"]=function imagePlugin_handle(byteArray,name,onload,onerror){var b=null;if(Browser.hasBlobConstructor){try{b=new Blob([byteArray],{type:Browser.getMimetype(name)});if(b.size!==byteArray.length){b=new Blob([(new Uint8Array(byteArray)).buffer],{type:Browser.getMimetype(name)})}}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}}if(!b){var bb=new Browser.BlobBuilder;bb.append((new Uint8Array(byteArray)).buffer);b=bb.getBlob()}var url=Browser.URLObject.createObjectURL(b);var img=new Image;img.onload=function img_onload(){assert(img.complete,"Image "+name+" could not be decoded");var canvas=document.createElement("canvas");canvas.width=img.width;canvas.height=img.height;var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);Module["preloadedImages"][name]=canvas;Browser.URLObject.revokeObjectURL(url);if(onload)onload(byteArray)};img.onerror=function img_onerror(event){console.log("Image "+url+" could not be decoded");if(onerror)onerror()};img.src=url};Module["preloadPlugins"].push(imagePlugin);var audioPlugin={};audioPlugin["canHandle"]=function audioPlugin_canHandle(name){return!Module.noAudioDecoding&&name.substr(-4)in{".ogg":1,".wav":1,".mp3":1}};audioPlugin["handle"]=function audioPlugin_handle(byteArray,name,onload,onerror){var done=false;function finish(audio){if(done)return;done=true;Module["preloadedAudios"][name]=audio;if(onload)onload(byteArray)}function fail(){if(done)return;done=true;Module["preloadedAudios"][name]=new Audio;if(onerror)onerror()}if(Browser.hasBlobConstructor){try{var b=new Blob([byteArray],{type:Browser.getMimetype(name)})}catch(e){return fail()}var url=Browser.URLObject.createObjectURL(b);var audio=new Audio;audio.addEventListener("canplaythrough",(function(){finish(audio)}),false);audio.onerror=function audio_onerror(event){if(done)return;console.log("warning: browser could not fully decode audio "+name+", trying slower base64 approach");function encode64(data){var BASE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var PAD="=";var ret="";var leftchar=0;var leftbits=0;for(var i=0;i<data.length;i++){leftchar=leftchar<<8|data[i];leftbits+=8;while(leftbits>=6){var curr=leftchar>>leftbits-6&63;leftbits-=6;ret+=BASE[curr]}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD}else if(leftbits==4){ret+=BASE[(leftchar&15)<<2];ret+=PAD}return ret}audio.src="data:audio/x-"+name.substr(-3)+";base64,"+encode64(byteArray);finish(audio)};audio.src=url;Browser.safeSetTimeout((function(){finish(audio)}),1e4)}else{return fail()}};Module["preloadPlugins"].push(audioPlugin);var canvas=Module["canvas"];function pointerLockChange(){Browser.pointerLock=document["pointerLockElement"]===canvas||document["mozPointerLockElement"]===canvas||document["webkitPointerLockElement"]===canvas||document["msPointerLockElement"]===canvas}if(canvas){canvas.requestPointerLock=canvas["requestPointerLock"]||canvas["mozRequestPointerLock"]||canvas["webkitRequestPointerLock"]||canvas["msRequestPointerLock"]||(function(){});canvas.exitPointerLock=document["exitPointerLock"]||document["mozExitPointerLock"]||document["webkitExitPointerLock"]||document["msExitPointerLock"]||(function(){});canvas.exitPointerLock=canvas.exitPointerLock.bind(document);document.addEventListener("pointerlockchange",pointerLockChange,false);document.addEventListener("mozpointerlockchange",pointerLockChange,false);document.addEventListener("webkitpointerlockchange",pointerLockChange,false);document.addEventListener("mspointerlockchange",pointerLockChange,false);if(Module["elementPointerLock"]){canvas.addEventListener("click",(function(ev){if(!Browser.pointerLock&&canvas.requestPointerLock){canvas.requestPointerLock();ev.preventDefault()}}),false)}}}),createContext:(function(canvas,useWebGL,setInModule,webGLContextAttributes){if(useWebGL&&Module.ctx&&canvas==Module.canvas)return Module.ctx;var ctx;var contextHandle;if(useWebGL){var contextAttributes={antialias:false,alpha:false};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}canvas.style.backgroundColor="black"}else{ctx=canvas.getContext("2d")}if(!ctx)return null;if(setInModule){if(!useWebGL)assert(typeof GLctx==="undefined","cannot set in module if GLctx is used, but we are a non-GL context that would replace it");Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach((function(callback){callback()}));Browser.init()}return ctx}),destroyContext:(function(canvas,useWebGL,setInModule){}),fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:(function(lockPointer,resizeCanvas,vrDevice){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;Browser.vrDevice=vrDevice;if(typeof Browser.lockPointer==="undefined")Browser.lockPointer=true;if(typeof Browser.resizeCanvas==="undefined")Browser.resizeCanvas=false;if(typeof Browser.vrDevice==="undefined")Browser.vrDevice=null;var canvas=Module["canvas"];function fullScreenChange(){Browser.isFullScreen=false;var canvasContainer=canvas.parentNode;if((document["webkitFullScreenElement"]||document["webkitFullscreenElement"]||document["mozFullScreenElement"]||document["mozFullscreenElement"]||document["fullScreenElement"]||document["fullscreenElement"]||document["msFullScreenElement"]||document["msFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvasContainer){canvas.cancelFullScreen=document["cancelFullScreen"]||document["mozCancelFullScreen"]||document["webkitCancelFullScreen"]||document["msExitFullscreen"]||document["exitFullscreen"]||(function(){});canvas.cancelFullScreen=canvas.cancelFullScreen.bind(document);if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullScreen=true;if(Browser.resizeCanvas)Browser.setFullScreenCanvasSize()}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas)Browser.setWindowedCanvasSize()}if(Module["onFullScreen"])Module["onFullScreen"](Browser.isFullScreen);Browser.updateCanvasDimensions(canvas)}if(!Browser.fullScreenHandlersInstalled){Browser.fullScreenHandlersInstalled=true;document.addEventListener("fullscreenchange",fullScreenChange,false);document.addEventListener("mozfullscreenchange",fullScreenChange,false);document.addEventListener("webkitfullscreenchange",fullScreenChange,false);document.addEventListener("MSFullscreenChange",fullScreenChange,false)}var canvasContainer=document.createElement("div");canvas.parentNode.insertBefore(canvasContainer,canvas);canvasContainer.appendChild(canvas);canvasContainer.requestFullScreen=canvasContainer["requestFullScreen"]||canvasContainer["mozRequestFullScreen"]||canvasContainer["msRequestFullscreen"]||(canvasContainer["webkitRequestFullScreen"]?(function(){canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"])}):null);if(vrDevice){canvasContainer.requestFullScreen({vrDisplay:vrDevice})}else{canvasContainer.requestFullScreen()}}),nextRAF:0,fakeRequestAnimationFrame:(function(func){var now=Date.now();if(Browser.nextRAF===0){Browser.nextRAF=now+1e3/60}else{while(now+2>=Browser.nextRAF){Browser.nextRAF+=1e3/60}}var delay=Math.max(Browser.nextRAF-now,0);setTimeout(func,delay)}),requestAnimationFrame:function requestAnimationFrame(func){if(typeof window==="undefined"){Browser.fakeRequestAnimationFrame(func)}else{if(!window.requestAnimationFrame){window.requestAnimationFrame=window["requestAnimationFrame"]||window["mozRequestAnimationFrame"]||window["webkitRequestAnimationFrame"]||window["msRequestAnimationFrame"]||window["oRequestAnimationFrame"]||Browser.fakeRequestAnimationFrame}window.requestAnimationFrame(func)}},safeCallback:(function(func){return(function(){if(!ABORT)return func.apply(null,arguments)})}),allowAsyncCallbacks:true,queuedAsyncCallbacks:[],pauseAsyncCallbacks:(function(){Browser.allowAsyncCallbacks=false}),resumeAsyncCallbacks:(function(){Browser.allowAsyncCallbacks=true;if(Browser.queuedAsyncCallbacks.length>0){var callbacks=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[];callbacks.forEach((function(func){func()}))}}),safeRequestAnimationFrame:(function(func){return Browser.requestAnimationFrame((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}}))}),safeSetTimeout:(function(func,timeout){Module["noExitRuntime"]=true;return setTimeout((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}}),timeout)}),safeSetInterval:(function(func,timeout){Module["noExitRuntime"]=true;return setInterval((function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}}),timeout)}),getMimetype:(function(name){return{"jpg":"image/jpeg","jpeg":"image/jpeg","png":"image/png","bmp":"image/bmp","ogg":"audio/ogg","wav":"audio/wav","mp3":"audio/mpeg"}[name.substr(name.lastIndexOf(".")+1)]}),getUserMedia:(function(func){if(!window.getUserMedia){window.getUserMedia=navigator["getUserMedia"]||navigator["mozGetUserMedia"]}window.getUserMedia(func)}),getMovementX:(function(event){return event["movementX"]||event["mozMovementX"]||event["webkitMovementX"]||0}),getMovementY:(function(event){return event["movementY"]||event["mozMovementY"]||event["webkitMovementY"]||0}),getMouseWheelDelta:(function(event){var delta=0;switch(event.type){case"DOMMouseScroll":delta=event.detail;break;case"mousewheel":delta=event.wheelDelta;break;case"wheel":delta=event["deltaY"];break;default:throw"unrecognized mouse wheel event: "+event.type}return delta}),mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:(function(event){if(Browser.pointerLock){if(event.type!="mousemove"&&"mozMovementX"in event){Browser.mouseMovementX=Browser.mouseMovementY=0}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event)}if(typeof SDL!="undefined"){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY}else{Browser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY}}else{var rect=Module["canvas"].getBoundingClientRect();var cw=Module["canvas"].width;var ch=Module["canvas"].height;var scrollX=typeof window.scrollX!=="undefined"?window.scrollX:window.pageXOffset;var scrollY=typeof window.scrollY!=="undefined"?window.scrollY:window.pageYOffset;if(event.type==="touchstart"||event.type==="touchend"||event.type==="touchmove"){var touch=event.touch;if(touch===undefined){return}var adjustedX=touch.pageX-(scrollX+rect.left);var adjustedY=touch.pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);var coords={x:adjustedX,y:adjustedY};if(event.type==="touchstart"){Browser.lastTouches[touch.identifier]=coords;Browser.touches[touch.identifier]=coords}else if(event.type==="touchend"||event.type==="touchmove"){var last=Browser.touches[touch.identifier];if(!last)last=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}var x=event.pageX-(scrollX+rect.left);var y=event.pageY-(scrollY+rect.top);x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y}}),xhrLoad:(function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response)}else{onerror()}};xhr.onerror=onerror;xhr.send(null)}),asyncLoad:(function(url,onload,onerror,noRunDep){Browser.xhrLoad(url,(function(arrayBuffer){assert(arrayBuffer,'Loading data file "'+url+'" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(!noRunDep)removeRunDependency("al "+url)}),(function(event){if(onerror){onerror()}else{throw'Loading data file "'+url+'" failed.'}}));if(!noRunDep)addRunDependency("al "+url)}),resizeListeners:[],updateResizeListeners:(function(){var canvas=Module["canvas"];Browser.resizeListeners.forEach((function(listener){listener(canvas.width,canvas.height)}))}),setCanvasSize:(function(width,height,noUpdates){var canvas=Module["canvas"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()}),windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:(function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];flags=flags|8388608;HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=flags}Browser.updateResizeListeners()}),setWindowedCanvasSize:(function(){if(typeof SDL!="undefined"){var flags=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];flags=flags&~8388608;HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=flags}Browser.updateResizeListeners()}),updateCanvasDimensions:(function(canvas,wNative,hNative){if(wNative&&hNative){canvas.widthNative=wNative;canvas.heightNative=hNative}else{wNative=canvas.widthNative;hNative=canvas.heightNative}var w=wNative;var h=hNative;if(Module["forcedAspectRatio"]&&Module["forcedAspectRatio"]>0){if(w/h<Module["forcedAspectRatio"]){w=Math.round(h*Module["forcedAspectRatio"])}else{h=Math.round(w/Module["forcedAspectRatio"])}}if((document["webkitFullScreenElement"]||document["webkitFullscreenElement"]||document["mozFullScreenElement"]||document["mozFullscreenElement"]||document["fullScreenElement"]||document["fullscreenElement"]||document["msFullScreenElement"]||document["msFullscreenElement"]||document["webkitCurrentFullScreenElement"])===canvas.parentNode&&typeof screen!="undefined"){var factor=Math.min(screen.width/w,screen.height/h);w=Math.round(w*factor);h=Math.round(h*factor)}if(Browser.resizeCanvas){if(canvas.width!=w)canvas.width=w;if(canvas.height!=h)canvas.height=h;if(typeof canvas.style!="undefined"){canvas.style.removeProperty("width");canvas.style.removeProperty("height")}}else{if(canvas.width!=wNative)canvas.width=wNative;if(canvas.height!=hNative)canvas.height=hNative;if(typeof canvas.style!="undefined"){if(w!=wNative||h!=hNative){canvas.style.setProperty("width",w+"px","important");canvas.style.setProperty("height",h+"px","important")}else{canvas.style.removeProperty("width");canvas.style.removeProperty("height")}}}}),wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:(function(){var handle=Browser.nextWgetRequestHandle;Browser.nextWgetRequestHandle++;return handle})};function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}function _pthread_self(){return 0}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;assert(offset_high===0);FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function _malloc(bytes){var ptr=Runtime.dynamicAlloc(bytes+8);return ptr+8&4294967288}Module["_malloc"]=_malloc;function ___cxa_allocate_exception(size){return _malloc(size)}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),op=SYSCALLS.get();switch(op){case 21505:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21506:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return 0};case 21519:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0};case 21520:{if(!stream.tty)return-ERRNO_CODES.ENOTTY;return-ERRNO_CODES.EINVAL};case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)};default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}FS.staticInit();__ATINIT__.unshift((function(){if(!Module["noFSInit"]&&!FS.init.initialized)FS.init()}));__ATMAIN__.push((function(){FS.ignorePermissions=false}));__ATEXIT__.push((function(){FS.quit()}));Module["FS_createFolder"]=FS.createFolder;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createLink"]=FS.createLink;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;__ATINIT__.unshift((function(){TTY.init()}));__ATEXIT__.push((function(){TTY.shutdown()}));if(ENVIRONMENT_IS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}Module["requestFullScreen"]=function Module_requestFullScreen(lockPointer,resizeCanvas,vrDevice){Browser.requestFullScreen(lockPointer,resizeCanvas,vrDevice)};Module["requestAnimationFrame"]=function Module_requestAnimationFrame(func){Browser.requestAnimationFrame(func)};Module["setCanvasSize"]=function Module_setCanvasSize(width,height,noUpdates){Browser.setCanvasSize(width,height,noUpdates)};Module["pauseMainLoop"]=function Module_pauseMainLoop(){Browser.mainLoop.pause()};Module["resumeMainLoop"]=function Module_resumeMainLoop(){Browser.mainLoop.resume()};Module["getUserMedia"]=function Module_getUserMedia(){Browser.getUserMedia()};Module["createContext"]=function Module_createContext(canvas,useWebGL,setInModule,webGLContextAttributes){return Browser.createContext(canvas,useWebGL,setInModule,webGLContextAttributes)};STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP);staticSealed=true;STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX);assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_DYNAMIC);function invoke_iiii(index,a1,a2,a3){try{return Module["dynCall_iiii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_vi(index,a1){try{Module["dynCall_vi"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_ii(index,a1){try{return Module["dynCall_ii"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viii(index,a1,a2,a3){try{Module["dynCall_viii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_v(index){try{Module["dynCall_v"](index)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}function invoke_viiii(index,a1,a2,a3,a4){try{Module["dynCall_viiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;asm["setThrew"](1,0)}}Module.asmGlobalArg={"Math":Math,"Int8Array":Int8Array,"Int16Array":Int16Array,"Int32Array":Int32Array,"Uint8Array":Uint8Array,"Uint16Array":Uint16Array,"Uint32Array":Uint32Array,"Float32Array":Float32Array,"Float64Array":Float64Array,"NaN":NaN,"Infinity":Infinity};Module.asmLibraryArg={"abort":abort,"assert":assert,"invoke_iiii":invoke_iiii,"invoke_viiiii":invoke_viiiii,"invoke_vi":invoke_vi,"invoke_ii":invoke_ii,"invoke_viii":invoke_viii,"invoke_v":invoke_v,"invoke_viiiiii":invoke_viiiiii,"invoke_viiii":invoke_viiii,"_pthread_cleanup_pop":_pthread_cleanup_pop,"___syscall54":___syscall54,"___syscall6":___syscall6,"___setErrNo":___setErrNo,"___assert_fail":___assert_fail,"___cxa_allocate_exception":___cxa_allocate_exception,"___cxa_find_matching_catch":___cxa_find_matching_catch,"_emscripten_set_main_loop_timing":_emscripten_set_main_loop_timing,"_fabsf":_fabsf,"_sbrk":_sbrk,"_emscripten_memcpy_big":_emscripten_memcpy_big,"___resumeException":___resumeException,"__ZSt18uncaught_exceptionv":__ZSt18uncaught_exceptionv,"_sysconf":_sysconf,"_pthread_self":_pthread_self,"_sqrtf":_sqrtf,"___unlock":___unlock,"_emscripten_set_main_loop":_emscripten_set_main_loop,"___cxa_throw":___cxa_throw,"___lock":___lock,"_abort":_abort,"_pthread_cleanup_push":_pthread_cleanup_push,"_time":_time,"___syscall140":___syscall140,"___syscall146":___syscall146,"STACKTOP":STACKTOP,"STACK_MAX":STACK_MAX,"tempDoublePtr":tempDoublePtr,"ABORT":ABORT,"cttz_i8":cttz_i8};// EMSCRIPTEN_START_ASM
 var asm=(function(global,env,buffer) {
-"use asm";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=0;var n=0;var o=0;var p=0;var q=global.NaN,r=global.Infinity;var s=0,t=0,u=0,v=0,w=0.0,x=0,y=0,z=0,A=0.0;var B=0;var C=0;var D=0;var E=0;var F=0;var G=0;var H=0;var I=0;var J=0;var K=0;var L=global.Math.floor;var M=global.Math.abs;var N=global.Math.sqrt;var O=global.Math.pow;var P=global.Math.cos;var Q=global.Math.sin;var R=global.Math.tan;var S=global.Math.acos;var T=global.Math.asin;var U=global.Math.atan;var V=global.Math.atan2;var W=global.Math.exp;var X=global.Math.log;var Y=global.Math.ceil;var Z=global.Math.imul;var _=global.Math.min;var $=global.Math.clz32;var aa=env.abort;var ba=env.assert;var ca=env.invoke_iiii;var da=env.invoke_viiiii;var ea=env.invoke_vi;var fa=env.invoke_ii;var ga=env.invoke_viii;var ha=env.invoke_v;var ia=env.invoke_viiiiii;var ja=env.invoke_viiii;var ka=env._pthread_cleanup_pop;var la=env.___syscall54;var ma=env.___syscall6;var na=env.___setErrNo;var oa=env.___assert_fail;var pa=env.___cxa_allocate_exception;var qa=env.___cxa_find_matching_catch;var ra=env._emscripten_set_main_loop_timing;var sa=env._fabsf;var ta=env._sbrk;var ua=env._emscripten_memcpy_big;var va=env.___resumeException;var wa=env.__ZSt18uncaught_exceptionv;var xa=env._sysconf;var ya=env._pthread_self;var za=env._sqrtf;var Aa=env.___unlock;var Ba=env._emscripten_set_main_loop;var Ca=env.___cxa_throw;var Da=env.___lock;var Ea=env._abort;var Fa=env._pthread_cleanup_push;var Ga=env._time;var Ha=env.___syscall140;var Ia=env.___syscall146;var Ja=0.0;
+"use asm";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=env.cttz_i8|0;var n=0;var o=0;var p=0;var q=0;var r=global.NaN,s=global.Infinity;var t=0,u=0,v=0,w=0,x=0.0,y=0,z=0,A=0,B=0.0;var C=0;var D=0;var E=0;var F=0;var G=0;var H=0;var I=0;var J=0;var K=0;var L=0;var M=global.Math.floor;var N=global.Math.abs;var O=global.Math.sqrt;var P=global.Math.pow;var Q=global.Math.cos;var R=global.Math.sin;var S=global.Math.tan;var T=global.Math.acos;var U=global.Math.asin;var V=global.Math.atan;var W=global.Math.atan2;var X=global.Math.exp;var Y=global.Math.log;var Z=global.Math.ceil;var _=global.Math.imul;var $=global.Math.min;var aa=global.Math.clz32;var ba=env.abort;var ca=env.assert;var da=env.invoke_iiii;var ea=env.invoke_viiiii;var fa=env.invoke_vi;var ga=env.invoke_ii;var ha=env.invoke_viii;var ia=env.invoke_v;var ja=env.invoke_viiiiii;var ka=env.invoke_viiii;var la=env._pthread_cleanup_pop;var ma=env.___syscall54;var na=env.___syscall6;var oa=env.___setErrNo;var pa=env.___assert_fail;var qa=env.___cxa_allocate_exception;var ra=env.___cxa_find_matching_catch;var sa=env._emscripten_set_main_loop_timing;var ta=env._fabsf;var ua=env._sbrk;var va=env._emscripten_memcpy_big;var wa=env.___resumeException;var xa=env.__ZSt18uncaught_exceptionv;var ya=env._sysconf;var za=env._pthread_self;var Aa=env._sqrtf;var Ba=env.___unlock;var Ca=env._emscripten_set_main_loop;var Da=env.___cxa_throw;var Ea=env.___lock;var Fa=env._abort;var Ga=env._pthread_cleanup_push;var Ha=env._time;var Ia=env.___syscall140;var Ja=env.___syscall146;var Ka=0.0;
 // EMSCRIPTEN_START_FUNCS
-function lb(b,f,g,h){b=b|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;j=i;i=i+16|0;k=j;l=a[g+8>>0]|0;m=l&255;n=a[g+9>>0]|0;o=n&255;p=a[f+4>>0]|0;q=p&255;if(l<<24>>24==n<<24>>24){if((l&255)>=4)oa(499656,474791,827,499666);r=d[f>>0]|0;s=d[f+1>>0]|0;t=s<<3|s>>>2;s=d[f+2>>0]|0;u=s<<3|s>>>2;s=c[17484+(q<<4)+(m<<2)>>2]|0;v=(r<<3|r>>>2)+s|0;if(v>>>0>255)if((v|0)<0){w=0;x=6}else y=255;else{w=v;x=6}if((x|0)==6)y=w;w=t+s|0;if(w>>>0>255)if((w|0)<0){z=0;x=9}else A=255;else{z=w;x=9}if((x|0)==9)A=z;z=u+s|0;if(z>>>0>255)if((z|0)<0){B=0;x=12}else C=255;else{B=z;x=12}if((x|0)==12)C=B;B=d[468643+(A<<1)>>0]<<5|d[467619+(y<<1)>>0]<<11|d[467619+(C<<1)>>0];z=d[468643+(A<<1)+1>>0]<<5|d[467619+(y<<1)+1>>0]<<11|d[467619+(C<<1)+1>>0];if((z|0)==(B|0)&(h^1))if(!B){D=1;E=0;F=0;G=0;H=85}else{I=B+-1|0;J=0;x=16}else{I=z;J=170;x=16}if((x|0)==16){z=B>>>0<I>>>0;C=z?I:B;y=z?B:I;D=C&255;E=y&255;F=(C&65535)>>>8&255;G=(y&65535)>>>8&255;H=(z?J|85:J)&255}a[b>>0]=D;a[b+1>>0]=F;a[b+2>>0]=E;a[b+3>>0]=G;Fd(b+4|0,H|0,4)|0;i=j;return}if((p&255)>6?n<<24>>24==3&(l<<24>>24==0&(a[g+10>>0]|0)==2):0){nb(k,f,q);l=c[k>>2]|0;n=c[k+12>>2]|0;k=d[469155+((l>>>8&255)<<1)>>0]<<5|d[468131+((l&255)<<1)>>0]<<11|d[468131+((l>>>16&255)<<1)>>0];l=d[469155+((n>>>8&255)<<1)>>0]<<5|d[468131+((n&255)<<1)>>0]<<11|d[468131+((n>>>16&255)<<1)>>0];if((l|0)==(k|0))if(!k){K=1;L=0;M=0;N=0;O=1;P=1}else{Q=k+-1|0;R=0;x=23}else{Q=l;R=1;x=23}if((x|0)==23){l=k>>>0<Q>>>0;n=l?Q:k;p=l?k:Q;K=n&255;L=p&255;M=(n&65535)>>>8&255;N=(p&65535)>>>8&255;O=l?0:R;P=l&1}a[b>>0]=K;a[b+1>>0]=M;a[b+2>>0]=L;a[b+3>>0]=N;N=0;while(1){L=g+N|0;M=b+4+N|0;K=(a[L>>0]&3)==3?O:P;if((K|N)>>>0>=4){x=27;break}l=d[M>>0]&252|K;a[M>>0]=l;K=(a[L>>0]&12)==12?O:P;if((K|N)>>>0>=4){x=27;break}R=l&243|K<<2;a[M>>0]=R;K=(a[L>>0]&48)==48?O:P;if((K|N)>>>0>=4){x=27;break}l=R&207|K<<4;a[M>>0]=l;if((N|3|0)!=3){x=25;break}K=(d[L>>0]|0)>191?O:P;if((K|N)>>>0>=4){x=27;break}a[M>>0]=l&63|K<<6;N=N+1|0;if(N>>>0>=4){x=33;break}}if((x|0)==25)oa(499394,499239,740,499559);else if((x|0)==27)oa(499621,474791,957,499546);else if((x|0)==33){i=j;return}}x=q<<5;q=(c[16480+(m<<4)+(o<<2)>>2]|0)*10|0;o=(((d[f>>0]|0)+x|0)*60|0)+q|0;m=(((d[f+1>>0]|0)+x|0)*60|0)+q|0;N=(((d[f+2>>0]|0)+x|0)*60|0)+q|0;q=(e[147612+(m<<2)+2>>1]|0)+(e[86172+(o<<2)+2>>1]|0)+(e[86172+(N<<2)+2>>1]|0)|0;x=(e[147612+((m|1)<<2)+2>>1]|0)+(e[86172+((o|1)<<2)+2>>1]|0)+(e[86172+((N|1)<<2)+2>>1]|0)|0;f=x>>>0<q>>>0;P=f?x:q;q=(e[147612+(m+2<<2)+2>>1]|0)+(e[86172+(o+2<<2)+2>>1]|0)+(e[86172+(N+2<<2)+2>>1]|0)|0;x=q>>>0<P>>>0;O=x?q:P;P=(e[147612+(m+3<<2)+2>>1]|0)+(e[86172+(o+3<<2)+2>>1]|0)+(e[86172+(N+3<<2)+2>>1]|0)|0;q=P>>>0<O>>>0;K=q?P:O;O=(e[147612+(m+4<<2)+2>>1]|0)+(e[86172+(o+4<<2)+2>>1]|0)+(e[86172+(N+4<<2)+2>>1]|0)|0;P=O>>>0<K>>>0;l=P?O:K;K=(e[147612+(m+5<<2)+2>>1]|0)+(e[86172+(o+5<<2)+2>>1]|0)+(e[86172+(N+5<<2)+2>>1]|0)|0;O=K>>>0<l>>>0;M=O?K:l;l=(e[147612+(m+6<<2)+2>>1]|0)+(e[86172+(o+6<<2)+2>>1]|0)+(e[86172+(N+6<<2)+2>>1]|0)|0;K=l>>>0<M>>>0;L=K?l:M;M=(e[147612+(m+7<<2)+2>>1]|0)+(e[86172+(o+7<<2)+2>>1]|0)+(e[86172+(N+7<<2)+2>>1]|0)|0;l=M>>>0<L>>>0;R=l?M:L;L=(e[147612+(m+8<<2)+2>>1]|0)+(e[86172+(o+8<<2)+2>>1]|0)+(e[86172+(N+8<<2)+2>>1]|0)|0;M=L>>>0<R>>>0;p=((e[147612+(m+9<<2)+2>>1]|0)+(e[86172+(o+9<<2)+2>>1]|0)+(e[86172+(N+9<<2)+2>>1]|0)|0)>>>0<(M?L:R)>>>0?9:M?8:l?7:K?6:O?5:P?4:q?3:x?2:f&1;f=p+o|0;o=p+m|0;m=p+N|0;N=d[86172+(f<<2)>>0]<<11&63488|d[86172+(m<<2)>>0]|d[147612+(o<<2)>>0]<<5;x=d[86172+(f<<2)+1>>0]<<11&63488|d[86172+(m<<2)+1>>0]|d[147612+(o<<2)+1>>0]<<5;o=N>>>0<x>>>0;m=o?x:N;f=o?N:x;x=o?472231:469671;a[b>>0]=m;o=b+1|0;a[o>>0]=(m&65535)>>>8;N=b+2|0;a[N>>0]=f;q=b+3|0;a[q>>0]=(f&65535)>>>8;if((m|0)!=(f|0)){a[b+4>>0]=a[(d[g>>0]|0)+(x+(p<<8))>>0]|0;a[b+5>>0]=a[(d[g+1>>0]|0)+(x+(p<<8))>>0]|0;a[b+6>>0]=a[(d[g+2>>0]|0)+(x+(p<<8))>>0]|0;a[b+7>>0]=a[(d[g+3>>0]|0)+(x+(p<<8))>>0]|0;i=j;return}if(h)S=0;else{h=(m|0)==0;p=h?0:m+-1|0;x=h?1:m;a[b>>0]=x;a[o>>0]=(x&65535)>>>8;a[N>>0]=p;a[q>>0]=(p&65535)>>>8;S=h?85:0}Fd(b+4|0,S|0,4)|0;i=j;return}function mb(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,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;h=i;i=i+16|0;j=h;k=b+4|0;l=c[k>>2]&2147450878|-2147450880;c[k>>2]=l;m=a[g+8>>0]|0;n=m&255;o=a[g+9>>0]|0;p=o&255;q=a[f+4>>0]|0;r=q&255;if(m<<24>>24!=o<<24>>24){if((q&255)>6?o<<24>>24==3&(m<<24>>24==0&(a[g+10>>0]|0)==2):0){nb(j,f,r);o=c[j>>2]|0;q=j+12|0;j=a[495619+((o&255)<<1)+1>>0]|0;s=a[495619+((o>>>8&255)<<1)+1>>0]|0;t=a[495107+((o>>>16&255)<<1)+1>>0]|0;if(!(((s|j)&255)<32&(t&255)<16))oa(501356,474791,6735,507209);o=d[q+2>>0]|0;u=d[q+1>>0]|0;v=d[q>>0]|0;q=(s&255)<<5&992|(j&255)<<10&31744|(t&255)<<1&30|c[k>>2]&-32767;c[k>>2]=q;t=a[495619+(v<<1)+1>>0]|0;v=a[495619+(u<<1)+1>>0]|0;u=a[495619+(o<<1)+1>>0]|0;if(((v|t|u)&255)>=32)oa(500240,474791,6744,507256);c[k>>2]=(t&255)<<26&2080374784|q&-2147418113|(v&255)<<21&65011712|(u&255)<<16&2031616;a[b>>0]=a[g>>0]|0;a[b+1>>0]=a[g+1>>0]|0;a[b+2>>0]=a[g+2>>0]|0;a[b+3>>0]=a[g+3>>0]|0;i=h;return}u=r<<5;v=(c[18148+(n<<4)+(p<<2)>>2]|0)*10|0;p=(((d[f>>0]|0)+u|0)*60|0)+v|0;q=(((d[f+1>>0]|0)+u|0)*60|0)+v|0;t=(((d[f+2>>0]|0)+u|0)*60|0)+v|0;v=(e[278684+(q<<2)+2>>1]|0)+(e[278684+(p<<2)+2>>1]|0)+(e[401564+(t<<2)+2>>1]|0)|0;u=(e[278684+((q|1)<<2)+2>>1]|0)+(e[278684+((p|1)<<2)+2>>1]|0)+(e[401564+((t|1)<<2)+2>>1]|0)|0;o=u>>>0<v>>>0;j=o?u:v;v=(e[278684+(q+2<<2)+2>>1]|0)+(e[278684+(p+2<<2)+2>>1]|0)+(e[401564+(t+2<<2)+2>>1]|0)|0;u=v>>>0<j>>>0;s=u?v:j;j=(e[278684+(q+3<<2)+2>>1]|0)+(e[278684+(p+3<<2)+2>>1]|0)+(e[401564+(t+3<<2)+2>>1]|0)|0;v=j>>>0<s>>>0;w=v?j:s;s=(e[278684+(q+4<<2)+2>>1]|0)+(e[278684+(p+4<<2)+2>>1]|0)+(e[401564+(t+4<<2)+2>>1]|0)|0;j=s>>>0<w>>>0;x=j?s:w;w=(e[278684+(q+5<<2)+2>>1]|0)+(e[278684+(p+5<<2)+2>>1]|0)+(e[401564+(t+5<<2)+2>>1]|0)|0;s=w>>>0<x>>>0;y=s?w:x;x=(e[278684+(q+6<<2)+2>>1]|0)+(e[278684+(p+6<<2)+2>>1]|0)+(e[401564+(t+6<<2)+2>>1]|0)|0;w=x>>>0<y>>>0;z=w?x:y;y=(e[278684+(q+7<<2)+2>>1]|0)+(e[278684+(p+7<<2)+2>>1]|0)+(e[401564+(t+7<<2)+2>>1]|0)|0;x=y>>>0<z>>>0;A=x?y:z;z=(e[278684+(q+8<<2)+2>>1]|0)+(e[278684+(p+8<<2)+2>>1]|0)+(e[401564+(t+8<<2)+2>>1]|0)|0;y=z>>>0<A>>>0;B=((e[278684+(q+9<<2)+2>>1]|0)+(e[278684+(p+9<<2)+2>>1]|0)+(e[401564+(t+9<<2)+2>>1]|0)|0)>>>0<(y?z:A)>>>0?9:y?8:x?7:w?6:s?5:j?4:v?3:u?2:o&1;o=B+p|0;p=a[278684+(o<<2)>>0]|0;u=B+q|0;q=a[278684+(u<<2)>>0]|0;v=B+t|0;t=a[401564+(v<<2)>>0]|0;if(!(((q|p)&255)<32&(t&255)<16))oa(501356,474791,6735,507209);j=(q&255)<<5&992|(p&255)<<10&31744|(t&255)<<1&30|c[k>>2]&-32767;c[k>>2]=j;t=a[278684+(o<<2)+1>>0]|0;o=a[278684+(u<<2)+1>>0]|0;u=a[401564+(v<<2)+1>>0]|0;if(((o|t|u)&255)>=32)oa(500240,474791,6744,507256);c[k>>2]=(t&255)<<26&2080374784|j&-2147418113|(o&255)<<21&65011712|(u&255)<<16&2031616;u=a[g>>0]|0;if((B|0)==6){a[b>>0]=u;a[b+1>>0]=a[g+1>>0]|0;a[b+2>>0]=a[g+2>>0]|0;a[b+3>>0]=a[g+3>>0]|0;i=h;return}else{o=u&255;u=d[g+1>>0]|0;j=d[g+2>>0]|0;t=d[g+3>>0]|0;g=d[(u>>>2&3)+(507169+(B<<2))>>0]<<2|d[(u&3)+(507169+(B<<2))>>0]|d[(u>>>4&3)+(507169+(B<<2))>>0]<<4|d[(u>>>6)+(507169+(B<<2))>>0]<<6;u=d[(j>>>2&3)+(507169+(B<<2))>>0]<<2|d[(j&3)+(507169+(B<<2))>>0]|d[(j>>>4&3)+(507169+(B<<2))>>0]<<4|d[(j>>>6)+(507169+(B<<2))>>0]<<6;j=d[(t>>>2&3)+(507169+(B<<2))>>0]<<2|d[(t&3)+(507169+(B<<2))>>0]|d[(t>>>4&3)+(507169+(B<<2))>>0]<<4|d[(t>>>6)+(507169+(B<<2))>>0]<<6;a[b>>0]=d[(o>>>2&3)+(507169+(B<<2))>>0]<<2|d[(o&3)+(507169+(B<<2))>>0]|d[(o>>>4&3)+(507169+(B<<2))>>0]<<4|d[(o>>>6)+(507169+(B<<2))>>0]<<6;a[b+1>>0]=g;a[b+2>>0]=u;a[b+3>>0]=j;i=h;return}}else{if((m&255)>=4)oa(499656,474791,827,499666);m=d[f>>0]|0;j=d[f+1>>0]|0;u=j<<3|j>>>2;j=d[f+2>>0]|0;f=j<<3|j>>>2;j=c[17484+(r<<4)+(n<<2)>>2]|0;n=(m<<3|m>>>2)+j|0;if(n>>>0>255)if((n|0)<0){C=0;D=6}else E=255;else{C=n;D=6}if((D|0)==6)E=C;C=u+j|0;if(C>>>0>255)if((C|0)<0){F=0;D=9}else G=255;else{F=C;D=9}if((D|0)==9)G=F;F=f+j|0;if(F>>>0>255)if((F|0)<0){H=0;D=12}else I=255;else{H=F;D=12}if((D|0)==12)I=H;H=a[494083+(E<<1)>>0]|0;D=a[494083+(G<<1)>>0]|0;F=a[493571+(I<<1)>>0]|0;if(!(((D|H)&255)<32&(F&255)<16))oa(501356,474791,6735,507209);j=(D&255)<<5&992|(H&255)<<10&31744|(F&255)<<1&30;c[k>>2]=j|l&-32768;l=a[494083+(E<<1)+1>>0]|0;E=a[494083+(G<<1)+1>>0]|0;G=a[493571+(I<<1)+1>>0]|0;if(((E|l|G)&255)>=32)oa(500240,474791,6744,507256);c[k>>2]=(l&255)<<26|(j|-2147450880)|(E&255)<<21&65011712|(G&255)<<16&2031616;a[b>>0]=85;a[b+1>>0]=85;a[b+2>>0]=85;a[b+3>>0]=85;i=h;return}}function nb(b,d,e){b=b|0;d=d|0;e=e|0;var 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,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;f=c[d>>2]|0;d=f&255;g=f>>>5;h=f>>>10&63;i=f>>>13;j=f>>>18&63;f=d<<3&248|d>>>2;d=c[17484+(e<<4)>>2]|0;k=f+d|0;if(k>>>0>255)if((k|0)<0){l=0;m=3}else n=255;else{l=k;m=3}if((m|0)==3)n=l;l=g&248|h;h=d+l|0;if(h>>>0>255)if((h|0)<0){o=0;m=6}else p=255;else{o=h;m=6}if((m|0)==6)p=o;o=i&248|j;j=d+o|0;if(j>>>0>255)if((j|0)<0){q=0;m=9}else r=255;else{q=j;m=9}if((m|0)==9)r=q;a[b>>0]=n;a[b+1>>0]=p;a[b+2>>0]=r;a[b+3>>0]=-1;r=b+4|0;p=c[17484+(e<<4)+4>>2]|0;n=p+f|0;if(n>>>0>255)if((n|0)<0){s=0;m=12}else t=255;else{s=n;m=12}if((m|0)==12)t=s;s=p+l|0;if(s>>>0>255)if((s|0)<0){u=0;m=15}else v=255;else{u=s;m=15}if((m|0)==15)v=u;u=p+o|0;if(u>>>0>255)if((u|0)<0){w=0;m=18}else x=255;else{w=u;m=18}if((m|0)==18)x=w;a[r>>0]=t;a[r+1>>0]=v;a[r+2>>0]=x;a[r+3>>0]=-1;r=b+8|0;x=c[17484+(e<<4)+8>>2]|0;v=x+f|0;if(v>>>0>255)if((v|0)<0){y=0;m=21}else z=255;else{y=v;m=21}if((m|0)==21)z=y;y=x+l|0;if(y>>>0>255)if((y|0)<0){A=0;m=24}else B=255;else{A=y;m=24}if((m|0)==24)B=A;A=x+o|0;if(A>>>0>255)if((A|0)<0){C=0;m=27}else D=255;else{C=A;m=27}if((m|0)==27)D=C;a[r>>0]=z;a[r+1>>0]=B;a[r+2>>0]=D;a[r+3>>0]=-1;r=b+12|0;b=c[17484+(e<<4)+12>>2]|0;e=b+f|0;if(e>>>0>255)if((e|0)<0){E=0;m=30}else F=255;else{E=e;m=30}if((m|0)==30)F=E;E=b+l|0;if(E>>>0>255)if((E|0)<0){G=0;m=33}else H=255;else{G=E;m=33}if((m|0)==33)H=G;G=b+o|0;if(G>>>0>255)if((G|0)<0)I=0;else{J=255;K=F&255;a[r>>0]=K;L=H&255;M=r+1|0;a[M>>0]=L;N=J&255;O=r+2|0;a[O>>0]=N;P=r+3|0;a[P>>0]=-1;return}else I=G;J=I;K=F&255;a[r>>0]=K;L=H&255;M=r+1|0;a[M>>0]=L;N=J&255;O=r+2|0;a[O>>0]=N;P=r+3|0;a[P>>0]=-1;return}function ob(e,f,g,h,j,k,l,m,n,o,p,q,r,s,t,u,v){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;s=s|0;t=t|0;u=u|0;v=v|0;var 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,_=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,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0;r=i;i=i+256|0;n=r+96|0;e=r;w=l+-21|0;do if(!q){if(w>>>0<9){x=(d[p+6>>0]|0)<<8|(d[p+5>>0]|0);y=6;break}if((l|0)==15){z=(((d[p+6>>0]|0)<<8|(d[p+5>>0]|0))+7|0)>>>3;A=s}else{z=g;A=s}}else{x=q;y=6}while(0);if((y|0)==6)if(w>>>0>8|(s|0)!=0){z=x;A=s}else{z=x;A=(d[p+8>>0]|0)<<8|(d[p+7>>0]|0)}if((Z(g<<4,h)|0)>>>0>k>>>0){B=0;i=r;return B|0}k=(v&4&(d[o+21>>0]|0)|0)!=0;if((l&-2|0)==6)if((l|0)==7){pb(j,f,g,h,0)|0;B=1;i=r;return B|0}else{qb(j,f,g,h,0,k)|0;B=1;i=r;return B|0}if(!h){B=1;i=r;return B|0}o=Z(z,m)|0;p=(g|0)==0;x=n+104|0;s=n+108|0;w=n+112|0;q=n+104|0;C=n+108|0;D=n+112|0;E=(v&32|0)!=0;v=n+104|0;F=n+112|0;G=n+108|0;H=n+112|0;I=n+104|0;J=n+112|0;K=n+108|0;L=n+112|0;M=n+104|0;N=n+112|0;O=n+104|0;P=n+112|0;Q=n+108|0;R=n+112|0;S=E?2:1;T=n+104|0;U=n+108|0;V=n+112|0;W=(m|0)==4;X=z<<2;Y=n+104|0;_=n+108|0;$=n+112|0;aa=(m|0)==2;ba=z<<1;ca=(l|0)==24;da=n+104|0;ea=n+108|0;fa=n+112|0;ga=~z;ha=t;t=u;u=0;ia=~A;ja=j;a:while(1){j=(ia|0)>-5?~ia:4;b:do if(p){ka=ha;la=t;ma=ja}else{na=Z(u,z)|0;pa=(A|0)==(u<<2|0);qa=ha;ra=t;sa=0;ta=ga;ua=f+(Z(o,u)|0)|0;va=ja;while(1){wa=(ta|0)>-5?~ta:4;c:do switch(l|0){case 0:{if(k)if(rb(va,ua,3)|0){xa=ra;ya=qa;break c}else{B=0;y=101;break a}if(!(Ob(va,n,0,1)|0)){y=98;break a}za=c[x>>2]|0;if((za|0)!=8)Pb(za,c[s>>2]|0,w,n,e,0)|0;Tb(n,e,ua);xa=ra;ya=qa;break}case 1:{if(!(Ob(va,n,0,1)|0)){y=28;break a}za=c[q>>2]|0;if((za|0)!=8)Pb(za,c[C>>2]|0,D,n,e,0)|0;Ub(n,e,ua);Tb(n,e,ua+8|0);xa=ra;ya=qa;break}case 2:{if(sb(va,ua,E)|0){xa=ra;ya=qa}else{B=0;y=101;break a}break}case 3:{if(tb(va,ua,E)|0){xa=ra;ya=qa}else{B=0;y=101;break a}break}case 4:{za=(qa|0)<0?0:qa;if(!(Ob(va,n,0,1)|0)){y=36;break a}Aa=c[v>>2]|0;if((Aa|0)==8){Ba=a[F+za>>0]|0;a[ua>>0]=Ba;a[ua+1>>0]=Ba;Ba=ua+2|0;a[Ba>>0]=0;a[Ba+1>>0]=0;a[Ba+2>>0]=0;a[Ba+3>>0]=0;a[Ba+4>>0]=0;a[Ba+5>>0]=0}else{Pb(Aa,c[G>>2]|0,H,n,e,0)|0;Vb(ua,e+za|0,4)}xa=ra;ya=za;break}case 5:{za=(qa|0)<0?0:qa;Aa=(ra|0)<0?3:ra;if(!(Ob(va,n,0,1)|0)){y=42;break a}Ba=c[I>>2]|0;Ca=ua+8|0;if((Ba|0)==8){Da=a[J+za>>0]|0;a[ua>>0]=Da;a[ua+1>>0]=Da;Da=ua+2|0;a[Da>>0]=0;a[Da+1>>0]=0;a[Da+2>>0]=0;a[Da+3>>0]=0;a[Da+4>>0]=0;a[Da+5>>0]=0;Da=a[J+Aa>>0]|0;a[Ca>>0]=Da;a[ua+9>>0]=Da;Da=ua+10|0;a[Da>>0]=0;a[Da+1>>0]=0;a[Da+2>>0]=0;a[Da+3>>0]=0;a[Da+4>>0]=0;a[Da+5>>0]=0}else{Pb(Ba,c[K>>2]|0,L,n,e,0)|0;Vb(ua,e+za|0,4);Vb(Ca,e+Aa|0,4)}xa=Aa;ya=za;break}case 9:case 8:{if(!(Ob(va,n,0,0)|0)){y=44;break a}if(!(Qb(n,e)|0))break a;Lb(ua,e);xa=ra;ya=qa;break}case 12:{if(!(Ob(va,n,1,0)|0)){y=53;break a}za=c[M>>2]|0;if((za|0)==8)Mb(ua,N);else Nb(ua,n,za)|0;xa=ra;ya=qa;break}case 18:{za=(qa|0)<0?0:qa;if(!(Ob(va,n,0,1)|0)){y=62;break a}Aa=c[O>>2]|0;if((Aa|0)!=8){Pb(Aa,c[Q>>2]|0,R,n,e,0)|0;if((za|0)==3)Ub(n,e,ua);else Oa[S&3](ua,e+za|0,4)}else{b[ua>>1]=d[P+za>>0]|0|3328;Aa=ua+2|0;a[Aa>>0]=a[463004]|0;a[Aa+1>>0]=a[463005]|0;a[Aa+2>>0]=a[463006]|0;a[Aa+3>>0]=a[463007]|0;a[Aa+4>>0]=a[463008]|0;a[Aa+5>>0]=a[463009]|0}xa=ra;ya=za;break}case 19:{za=(qa|0)<0?0:qa;Aa=(ra|0)<3?3:ra;if(ub(va,ua,E,za,Aa)|0){xa=Aa;ya=za}else{B=0;y=101;break a}break}case 22:{if(Ob(va,n,0,0)|0){P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=101;break a}break}case 29:{if(Ob(va,n,0,0)|0){Pb(c[da>>2]|0,c[ea>>2]|0,fa,n,e,0)|0;La=1}else La=0;if(!aa){y=90;break a}if(!pa){Ca=(z|0)==(sa<<2|0);za=f+(sa+na<<3)|0;Aa=0;while(1){if(!Ca){Ba=0;do{Ia=c[e+(Aa<<4)+(Ba<<2)>>2]|0;Ja=((Ia&255)*15|0)+128|0;Ha=((Ia>>>8&255)*15|0)+128|0;Da=((Ia>>>16&255)*15|0)+128|0;Fa=((Da>>>8)+Da|0)>>>8<<4;Da=((Ia>>>24)*15|0)+128|0;Ia=Ba<<1;a[za+Ia>>0]=Fa|((Da>>>8)+Da|0)>>>8;a[za+(Ia|1)>>0]=(((Ja>>>8)+Ja|0)>>>8<<12|(Ha>>>8)+Ha&16128|Fa)>>>8;Ba=Ba+1|0}while((Ba|0)!=(wa|0))}Aa=Aa+1|0;if((Aa|0)==(j|0))break;else za=za+ba|0}}if(La){xa=ra;ya=qa}else{B=0;y=101;break a}break}default:{y=97;break a}}while(0);sa=sa+1|0;wa=va+16|0;if(sa>>>0>=g>>>0){ka=ya;la=xa;ma=wa;break b}else{qa=ya;ra=xa;ta=ta+4|0;ua=ua+m|0;va=wa}}}while(0);u=u+1|0;if(u>>>0>=h>>>0){B=1;y=101;break}else{ha=ka;t=la;ia=ia+4|0;ja=ma}}switch(y|0){case 28:{B=0;i=r;return B|0}case 36:{B=0;i=r;return B|0}case 42:{B=0;i=r;return B|0}case 44:break;case 53:{B=0;i=r;return B|0}case 62:{B=0;i=r;return B|0}case 67:{oa(475075,474791,8825,474827);break}case 77:{oa(475133,474791,8854,474827);break}case 90:{oa(475133,474791,8883,474827);break}case 97:{oa(475191,474791,8906,474827);break}case 98:{B=0;i=r;return B|0}case 101:{i=r;return B|0}}B=0;i=r;return B|0}function pb(b,f,g,h,j){b=b|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,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u,g)|0;x=0;while(1){y=x+w|0;if(!(Ob(b+(y<<4)|0,k,0,0)|0)){z=36;break a}Pb(c[r>>2]|0,c[v>>2]|0,t,k,l,0)|0;A=-1;B=-1;C=-1;D=-1;E=0;F=0;G=0;H=0;I=0;while(1){J=c[l+(I<<2)>>2]|0;K=J&255;L=(K&255)<(A&255)?K:A;M=(J&65535)>>>8&255;N=(M&255)<(B&255)?M:B;O=J>>>16&255;P=(O&255)<(C&255)?O:C;Q=J>>>24&255;J=(Q&255)<(D&255)?Q:D;R=(E&255)<(K&255)?K:E;K=(F&255)<(M&255)?M:F;M=(G&255)<(O&255)?O:G;O=(H&255)<(Q&255)?Q:H;I=I+1|0;if((I|0)==16){S=L;T=N;U=P;V=J;W=R;X=K;Y=M;_=O;break}else{A=L;B=N;C=P;D=J;E=R;F=K;G=M;H=O}}H=a[500827+(V&255)>>0]|0;G=S&255;if(V<<24>>24==-1){F=a[499728+G>>0]|0;E=a[499728+(T&255)>>0]|0;if(((E|F)&255)>=32){z=17;break a}D=(F&255)<<10|(E&255)<<5|(d[499984+(U&255)>>0]|0)<<1|32768;if(D>>>0<65536)$=D;else{z=19;break a}}else{D=a[499984+G>>0]|0;G=a[499984+(T&255)>>0]|0;E=a[501083+(U&255)>>0]|0;if(!(((G|D)&255)<16&((E|H)&255)<8)){z=21;break a}F=(D&255)<<8|(H&255)<<12|(G&255)<<4|(E&255)<<1;if(F>>>0<65536)$=F;else{z=23;break a}}F=_&255;E=a[501476+F>>0]|0;G=W&255;if((F+-239|0)>>>0<17){F=a[500315+G>>0]|0;H=a[500315+(X&255)>>0]|0;D=a[500315+(Y&255)>>0]|0;if(((H|F|D)&255)>=32){z=26;break a}C=(F&255)<<10|(H&255)<<5|D&255|32768;if(C>>>0>=65536){z=28;break a}aa=C<<16|$&65535}else{C=a[500571+G>>0]|0;G=a[500571+(X&255)>>0]|0;D=a[500571+(Y&255)>>0]|0;if(!((_&255)<239?((G|C|D)&255)<16:0)){z=31;break a}H=(C&255)<<8|(E&255)<<12|(G&255)<<4|D&255;if(H>>>0>=65536){z=33;break a}aa=H<<16|$&65535}H=c[p>>2]|0;c[H+(y<<2)>>2]=aa;x=x+1|0;if(x>>>0>=g>>>0){ba=H;break}}u=u+1|0;if(u>>>0>=h>>>0){ca=ba;z=38;break}}switch(z|0){case 17:{oa(501356,474791,3147,501339);break}case 19:{oa(500273,474791,3176,501339);break}case 21:{oa(501389,474791,3164,501339);break}case 23:{oa(500273,474791,3176,501339);break}case 26:{oa(500240,474791,3154,501339);break}case 28:{oa(500273,474791,3176,501339);break}case 31:{oa(501432,474791,3171,501339);break}case 33:{oa(500273,474791,3176,501339);break}case 36:{da=0;break}case 38:{z=g+-1|0;ba=h+-1|0;if(!z)ea=0;else{u=z;aa=0;while(1){u=u>>>1;$=aa+1|0;if(!u){ea=$;break}else aa=$}}if(!ba)fa=0;else{aa=ba;u=0;while(1){aa=aa>>>1;$=u+1|0;if(!aa){fa=$;break}else u=$}}u=ea>>>0<fa>>>0?ea:fa;fa=u<<1;ea=(1<<fa)+-1|0;if((h|0)>0){aa=(g|0)>0;$=k+104|0;_=k+108|0;Y=k+112|0;X=(g|0)==(h|0);W=l+32|0;U=m+32|0;T=n+4|0;V=l+36|0;S=m+36|0;t=n+8|0;v=l+40|0;r=m+40|0;x=l+16|0;w=l+4|0;H=l+20|0;D=m+16|0;G=m+4|0;E=m+20|0;C=l+8|0;F=l+24|0;B=m+8|0;A=m+24|0;I=g>>>0>h>>>0;O=o+4|0;M=o+16|0;K=o+20|0;R=o+8|0;J=o+12|0;P=o+24|0;N=o+28|0;L=o+32|0;Q=o+36|0;ga=o+48|0;ha=o+52|0;ia=o+40|0;ja=o+44|0;ka=o+56|0;la=o+60|0;ma=0;na=0;while(1){pa=na+-1|0;qa=0;do{ra=Z(pa+qa&ba,g)|0;c[n+(qa<<2)>>2]=ca+(ra<<2);sa=0;do{ta=c[ca+((sa+-1&z)+ra<<2)>>2]|0;if(!(ta&32768)){ua=a[508474+(ta>>>12&7)>>0]|0;va=d[508466+(ta>>>1&7)>>0]|0;wa=d[508450+(ta>>>4&15)>>0]|0;xa=d[508450+(ta>>>8&15)>>0]|0}else{ua=-1;va=d[508450+(ta>>>1&15)>>0]|0;wa=d[508418+(ta>>>5&31)>>0]|0;xa=d[508418+(ta>>>10&31)>>0]|0}c[l+(sa<<4)+(qa<<2)>>2]=wa+xa+va+(ua&255);ya=ta>>>16;if(!(ya&32768)){za=a[508474+(ta>>>28&7)>>0]|0;Aa=d[508450+(ya&15)>>0]|0;Ba=d[508450+(ta>>>20&15)>>0]|0;Ca=d[508450+(ta>>>24&15)>>0]|0}else{za=-1;Aa=d[508418+(ya&31)>>0]|0;Ba=d[508418+(ta>>>21&31)>>0]|0;Ca=d[508418+(ta>>>26&31)>>0]|0}c[m+(sa<<4)+(qa<<2)>>2]=Ba+Ca+Aa+(za&255);sa=sa+1|0}while((sa|0)!=3);qa=qa+1|0}while((qa|0)!=3);if(aa){qa=(e[467106+(na>>8<<1)>>1]|0)<<16|(e[467106+((na&255)<<1)>>1]|0);pa=c[n>>2]|0;sa=c[T>>2]|0;ra=c[t>>2]|0;y=na>>u<<fa;ta=ma;ya=0;while(1){if(Ob(b+(ta<<4)|0,k,0,0)|0)Pb(c[$>>2]|0,c[_>>2]|0,Y,k,o,0)|0;Da=qa|(e[467106+(ya>>8<<1)>>1]|0)<<17|(e[467106+((ya&255)<<1)>>1]|0)<<1;do if(!X){Ea=Da&ea;if(I){Fa=Ea|ya>>u<<fa;break}else{Fa=Ea|y;break}}else Fa=Da;while(0);c[f+(Fa<<3)+4>>2]=c[ca+(ta<<2)>>2];ya=ya+1|0;Da=ya&z;Ea=c[pa+(Da<<2)>>2]|0;if(!(Ea&32768)){Ga=a[508474+(Ea>>>12&7)>>0]|0;Ha=d[508466+(Ea>>>1&7)>>0]|0;Ia=d[508450+(Ea>>>4&15)>>0]|0;Ja=d[508450+(Ea>>>8&15)>>0]|0}else{Ga=-1;Ha=d[508450+(Ea>>>1&15)>>0]|0;Ia=d[508418+(Ea>>>5&31)>>0]|0;Ja=d[508418+(Ea>>>10&31)>>0]|0}c[W>>2]=Ia+Ja+Ha+(Ga&255);Ka=Ea>>>16;if(!(Ka&32768)){La=a[508474+(Ea>>>28&7)>>0]|0;Ma=d[508450+(Ka&15)>>0]|0;Na=d[508450+(Ea>>>20&15)>>0]|0;Oa=d[508450+(Ea>>>24&15)>>0]|0}else{La=-1;Ma=d[508418+(Ka&31)>>0]|0;Na=d[508418+(Ea>>>21&31)>>0]|0;Oa=d[508418+(Ea>>>26&31)>>0]|0}c[U>>2]=Na+Oa+Ma+(La&255);Ea=c[sa+(Da<<2)>>2]|0;if(!(Ea&32768)){Pa=a[508474+(Ea>>>12&7)>>0]|0;Qa=d[508466+(Ea>>>1&7)>>0]|0;Ra=d[508450+(Ea>>>4&15)>>0]|0;Sa=d[508450+(Ea>>>8&15)>>0]|0}else{Pa=-1;Qa=d[508450+(Ea>>>1&15)>>0]|0;Ra=d[508418+(Ea>>>5&31)>>0]|0;Sa=d[508418+(Ea>>>10&31)>>0]|0}c[V>>2]=Ra+Sa+Qa+(Pa&255);Ka=Ea>>>16;if(!(Ka&32768)){Ta=a[508474+(Ea>>>28&7)>>0]|0;Ua=d[508450+(Ka&15)>>0]|0;Va=d[508450+(Ea>>>20&15)>>0]|0;Wa=d[508450+(Ea>>>24&15)>>0]|0}else{Ta=-1;Ua=d[508418+(Ka&31)>>0]|0;Va=d[508418+(Ea>>>21&31)>>0]|0;Wa=d[508418+(Ea>>>26&31)>>0]|0}c[S>>2]=Va+Wa+Ua+(Ta&255);Ea=c[ra+(Da<<2)>>2]|0;if(!(Ea&32768)){Xa=a[508474+(Ea>>>12&7)>>0]|0;Ya=d[508466+(Ea>>>1&7)>>0]|0;Za=d[508450+(Ea>>>4&15)>>0]|0;_a=d[508450+(Ea>>>8&15)>>0]|0}else{Xa=-1;Ya=d[508450+(Ea>>>1&15)>>0]|0;Za=d[508418+(Ea>>>5&31)>>0]|0;_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lb|0)>(Jb*13|0)?201326592:(Lb|0)>(Jb<<3|0)?134217728:(Lb|0)>(Jb*3|0)?67108864:0)|((tb|0)>(xb*13|0)?3145728:(tb|0)>(xb<<3|0)?2097152:(tb|0)>(xb*3|0)?1048576:0)|((ib|0)>(pb*13|0)?12582912:(ib|0)>(pb<<3|0)?8388608:(ib|0)>(pb*3|0)?4194304:0)|((Ib|0)>(eb*13|0)?805306368:(Ib|0)>(eb<<3|0)?536870912:(Ib|0)>(eb*3|0)?268435456:0)|((Ab|0)>(zb*13|0)?-1073741824:(Ab|0)>(zb<<3|0)?-2147483648:(Ab|0)>(zb*3|0)?1073741824:0);c[l>>2]=c[x>>2];c[x>>2]=c[W>>2];c[w>>2]=c[H>>2];c[H>>2]=c[V>>2];c[C>>2]=c[F>>2];c[F>>2]=c[v>>2];c[m>>2]=c[D>>2];c[D>>2]=c[U>>2];c[G>>2]=c[E>>2];c[E>>2]=c[S>>2];c[B>>2]=c[A>>2];c[A>>2]=c[r>>2];if((ya|0)==(g|0))break;else ta=ta+1|0}Sb=ma+g|0}else Sb=ma;na=na+1|0;if((na|0)==(h|0))break;else ma=Sb}}da=1;break}}Sb=c[p>>2]|0;if(!Sb){q=da;i=j;return q|0}p=c[s>>2]|0;if((p|0)!=(Sb|0))c[s>>2]=p+(~((p+-4-Sb|0)>>>2)<<2);Kc(Sb);q=da;i=j;return q|0}function qb(b,f,g,h,j,k){b=b|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,_=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,pa=0,qa=0,ra=0,sa=0,ta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?U:S)&255;S=(T>>>0<U>>>0?U:T)&255;V=R;W=R;X=R;Y=S;_=S;$=S}else{S=-1;R=-1;T=-1;U=0;aa=0;ba=0;ca=0;while(1){da=c[m+(ca<<2)>>2]|0;ea=da&255;fa=(ea&255)<(S&255)?ea:S;ga=(da&65535)>>>8&255;ha=(ga&255)<(R&255)?ga:R;ia=da>>>16&255;da=(ia&255)<(T&255)?ia:T;ja=(U&255)<(ea&255)?ea:U;ea=(aa&255)<(ga&255)?ga:aa;ga=(ba&255)<(ia&255)?ia:ba;ca=ca+1|0;if((ca|0)==16){V=da;W=ha;X=fa;Y=ga;_=ea;$=ja;break}else{S=fa;R=ha;T=da;U=ja;aa=ea;ba=ga}}}ba=(d[499984+(V&255)>>0]|0)<<1;if(ba>>>0>=32){Q=17;break a}aa=ba|(d[499728+(W&255)>>0]|0)<<5|(d[499728+(X&255)>>0]|0)<<10|32768;if(aa>>>0>=65536){Q=19;break a}ba=d[500315+(Y&255)>>0]|0|(d[500315+(_&255)>>0]|0)<<5|(d[500315+($&255)>>0]|0)<<10|32768;if(ba>>>0>=65536){Q=21;break a}U=c[q>>2]|0;c[U+(P<<2)>>2]=ba<<16|aa&65534;O=O+1|0;if(O>>>0>=g>>>0){ka=U;break}}M=M+1|0;if(M>>>0>=h>>>0){la=ka;Q=25;break}}if((Q|0)==17)oa(500240,474791,3082,499702);else if((Q|0)==19)oa(500273,474791,3092,499702);else if((Q|0)==21)oa(500273,474791,3123,500290);else if((Q|0)==23)ma=0;else if((Q|0)==25){ka=g+-1|0;M=h+-1|0;if(!ka)na=0;else{$=ka;_=0;while(1){$=$>>>1;Y=_+1|0;if(!$){na=Y;break}else _=Y}}if(!M)pa=0;else{_=M;$=0;while(1){_=_>>>1;Y=$+1|0;if(!_){pa=Y;break}else $=Y}}$=na>>>0<pa>>>0?na:pa;pa=$<<1;na=(1<<pa)+-1|0;b:do if((h|0)>0){_=(g|0)>0;Y=l+104|0;X=l+108|0;W=l+112|0;V=(g|0)==(h|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Zb;a[sb>>0]=Zb;a[tb>>0]=Zb;a[ub>>0]=-1;Zb=a[wb>>0]|0;a[vb>>0]=Zb;a[xb>>0]=Zb;a[yb>>0]=Zb;a[zb>>0]=-1}Zb=Ub|(e[467106+(Xb>>8<<1)>>1]|0)<<17|(e[467106+((Xb&255)<<1)>>1]|0)<<1;do if(!V){_b=Zb&na;if(s){$b=_b|Xb>>$<<pa;break}else{$b=_b|Wb;break}}else $b=Zb;while(0);c[f+($b<<3)+4>>2]=c[la+(Yb<<2)>>2];Xb=Xb+1|0;Zb=Xb&ka;_b=c[Tb+(Zb<<2)>>2]|0;if(!(_b&32768)){Q=48;break c}ac=_b&30;c[L>>2]=((((_b>>>10&31)+(_b>>>5&31)+(ac>>>4|ac)|0)*255|0)>>>0)/31|0;ac=_b>>>16;if(!(ac&32768)){Q=50;break c}c[K>>2]=((((_b>>>26&31)+(_b>>>21&31)+(ac&31)|0)*255|0)>>>0)/31|0;ac=c[P+(Zb<<2)>>2]|0;if(!(ac&32768)){Q=52;break c}_b=ac&30;c[I>>2]=((((ac>>>10&31)+(ac>>>5&31)+(_b>>>4|_b)|0)*255|0)>>>0)/31|0;_b=ac>>>16;if(!(_b&32768)){Q=54;break c}c[H>>2]=((((ac>>>26&31)+(ac>>>21&31)+(_b&31)|0)*255|0)>>>0)/31|0;_b=c[Vb+(Zb<<2)>>2]|0;if(!(_b&32768)){Q=56;break c}Zb=_b&30;c[F>>2]=((((_b>>>10&31)+(_b>>>5&31)+(Zb>>>4|Zb)|0)*255|0)>>>0)/31|0;Zb=_b>>>16;if(!(Zb&32768)){Q=58;break c}ac=((((_b>>>26&31)+(_b>>>21&31)+(Zb&31)|0)*255|0)>>>0)/31|0;c[E>>2]=ac;Zb=c[m>>2]|0;_b=c[D>>2]|0;bc=c[C>>2]|0;cc=c[B>>2]|0;dc=c[n>>2]|0;ec=c[A>>2]|0;fc=c[z>>2]|0;gc=c[y>>2]|0;hc=_b+Zb+bc+cc<<2;ic=ec+dc+fc+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)?2048:(uc|0)>(zc*3|0)?1024:0)|((Bc|0)>(Fc*13|0)?48:(Bc|0)>(Fc<<3|0)?32:(Bc|0)>(Fc*3|0)?16:0)|((Ec|0)>(ic*13|0)?192:(Ec|0)>(ic<<3|0)?128:(Ec|0)>(ic*3|0)?64:0)|((oc|0)>(Cc*13|0)?12288:(oc|0)>(Cc<<3|0)?8192:(oc|0)>(Cc*3|0)?4096:0)|((ec|0)>(jc*13|0)?49152:(ec|0)>(jc<<3|0)?32768:(ec|0)>(jc*3|0)?16384:0)|((Lc|0)>(Qc*13|0)?196608:(Lc|0)>(Qc<<3|0)?131072:(Lc|0)>(Qc*3|0)?65536:0)|((Pc|0)>(Nc*13|0)?786432:(Pc|0)>(Nc<<3|0)?524288:(Pc|0)>(Nc*3|0)?262144:0)|((Oc|0)>(bc*13|0)?50331648:(Oc|0)>(bc<<3|0)?33554432:(Oc|0)>(bc*3|0)?16777216:0)|((Mc|0)>(Hc*13|0)?201326592:(Mc|0)>(Hc<<3|0)?134217728:(Mc|0)>(Hc*3|0)?67108864:0)|((rc|0)>(vc*13|0)?3145728:(rc|0)>(vc<<3|0)?2097152:(rc|0)>(vc*3|0)?1048576:0)|((gc|0)>(nc*13|0)?12582912:(gc|0)>(nc<<3|0)?8388608:(gc|0)>(nc*3|0)?4194304:0)|((Gc|0)>(cc*13|0)?805306368:(Gc|0)>(cc<<3|0)?536870912:(Gc|0)>(cc*3|0)?268435456:0)|((yc|0)>(xc*13|0)?-1073741824:(yc|0)>(xc<<3|0)?-2147483648:(yc|0)>(xc*3|0)?1073741824:0);c[m>>2]=c[D>>2];c[D>>2]=c[L>>2];c[C>>2]=c[B>>2];c[B>>2]=c[I>>2];c[x>>2]=c[v>>2];c[v>>2]=c[F>>2];c[n>>2]=c[A>>2];c[A>>2]=c[K>>2];c[z>>2]=c[y>>2];c[y>>2]=c[H>>2];c[u>>2]=c[w>>2];c[w>>2]=c[E>>2];xc=Yb+1|0;if((Xb|0)>=(g|0)){Rc=xc;break}else Yb=xc}}else Rc=Rb;Sb=Sb+1|0;if((Sb|0)>=(h|0))break b;else Rb=Rc}if((Q|0)==33)oa(508356,474791,3304,508372);else if((Q|0)==35)oa(508356,474791,3319,508395);else if((Q|0)==48)oa(508356,474791,3304,508372);else if((Q|0)==50)oa(508356,474791,3319,508395);else if((Q|0)==52)oa(508356,474791,3304,508372);else if((Q|0)==54)oa(508356,474791,3319,508395);else if((Q|0)==56)oa(508356,474791,3304,508372);else if((Q|0)==58)oa(508356,474791,3319,508395)}while(0);ma=1}Q=c[q>>2]|0;if(!Q){r=ma;i=j;return r|0}q=c[t>>2]|0;if((q|0)!=(Q|0))c[t>>2]=q+(~((q+-4-Q|0)>>>2)<<2);Kc(Q);r=ma;i=j;return r|0}function rb(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,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,_=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,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,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,ab=0,bb=0,cb=0;h=i;i=i+336|0;j=h+168|0;k=h+104|0;l=h+320|0;m=h+24|0;n=h+16|0;o=h+96|0;p=h+80|0;q=h+72|0;r=h+64|0;s=h+48|0;t=h+8|0;u=h+32|0;v=h;if(!(Ob(b,j,0,1)|0)){w=0;i=h;return w|0}b=c[j+104>>2]|0;if((b|0)==8){if(g>>>0>=4)oa(499375,499239,685,499383);x=e[22684+((d[j+112+g>>0]|0)<<1)>>1]|0;y=x>>>7;a[f+3>>0]=y<<2|y<<5|2;y=x<<3&255;a[f>>0]=y;a[f+1>>0]=y;a[f+2>>0]=y;y=f+4|0;z=490641+((x>>>5&3)<<2)|0;x=d[z>>0]|d[z+1>>0]<<8|d[z+2>>0]<<16|d[z+3>>0]<<24;a[y>>0]=x;a[y+1>>0]=x>>8;a[y+2>>0]=x>>16;a[y+3>>0]=x>>24;w=1;i=h;return w|0}Pb(b,c[j+108>>2]|0,j+112|0,j,k,0)|0;if(g>>>0>=4)oa(499375,499239,685,499383);j=a[k+g>>0]|0;a[l>>0]=j;b=a[k+4+g>>0]|0;a[l+1>>0]=b;x=a[k+8+g>>0]|0;a[l+2>>0]=x;y=a[k+12+g>>0]|0;a[l+3>>0]=y;z=a[k+16+g>>0]|0;a[l+4>>0]=z;A=a[k+20+g>>0]|0;a[l+5>>0]=A;B=a[k+24+g>>0]|0;a[l+6>>0]=B;C=a[k+28+g>>0]|0;a[l+7>>0]=C;D=a[k+32+g>>0]|0;a[l+8>>0]=D;E=a[k+36+g>>0]|0;a[l+9>>0]=E;F=a[k+40+g>>0]|0;a[l+10>>0]=F;G=a[k+44+g>>0]|0;a[l+11>>0]=G;H=a[k+48+g>>0]|0;a[l+12>>0]=H;I=a[k+52+g>>0]|0;a[l+13>>0]=I;J=a[k+56+g>>0]|0;a[l+14>>0]=J;K=a[k+60+g>>0]|0;a[l+15>>0]=K;g=j&255;k=z&255;z=b&255;b=A&255;A=x&255;x=B&255;B=y&255;y=C&255;C=x+A+B+y|0;L=D&255;D=H&255;H=E&255;E=I&255;I=D+L+H+E|0;M=F&255;F=J&255;J=G&255;G=K&255;K=F+M+J+G|0;N=g+4+k+z+b|0;O=(C+N|0)>>>3;P=(I+4+K|0)>>>3;Q=(I+N|0)>>>3;N=(C+4+K|0)>>>3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;c[F>>2]=aa>>>10&3;c[J>>2]=aa>>>12&3;c[M>>2]=aa>>>14;$=(k|0)!=0;R=(x&255|(aa&7)<<($?2:5))&255;a[ca>>0]=R;aa=z<<($?0:4);$=B&255|aa;a[f>>0]=$;z=D&255|aa;a[A>>0]=z;I=H&255|aa;a[G>>0]=I;aa=k<<1;if(S){C=n+(k<<2)|0;j=L;K=b;_=aa;T=0;while(1){V=T+aa|0;W=d[l+(V<<2)>>0]|0;if(W>>>0<ia>>>0){ja=26;break a}U=c[C>>2]|0;if(W>>>0>U>>>0){ja=26;break a}Y=W-ia|0;if(Y>>>0>=4){ja=28;break a}W=d[490805+(c[p+(Y<<2)>>2]|0)>>0]|0;Y=_+4|0;X=d[l+(V<<2)+1>>0]|0;if(X>>>0<ia>>>0|X>>>0>U>>>0){ja=26;break a}ka=X-ia|0;if(ka>>>0>=4){ja=28;break a}X=d[490805+(c[p+(ka<<2)>>2]|0)>>0]|0;ka=_+8|0;la=d[l+(V<<2)+2>>0]|0;if(la>>>0<ia>>>0|la>>>0>U>>>0){ja=26;break a}ma=la-ia|0;if(ma>>>0>=4){ja=28;break a}la=d[490805+(c[p+(ma<<2)>>2]|0)>>0]|0;ma=_+12|0;na=d[l+(V<<2)+3>>0]|0;if(na>>>0<ia>>>0|na>>>0>U>>>0){ja=26;break a}U=na-ia|0;if(U>>>0>=4){ja=28;break a}na=d[490805+(c[p+(U<<2)>>2]|0)>>0]|0;U=((na&1)<<ma|((la&1)<<ka|((X&1)<<Y|((W&1)<<_|K&65535))))&65535;V=(na>>>1<<ma|(la>>>1<<ka|(X>>>1<<Y|(W>>>1<<_|j&65535))))&65535;T=T+1|0;if(T>>>0>=2){pa=V;qa=U;break}else{j=V;K=U;_=_+1|0}}}else{_=n+(k<<2)|0;K=L;j=b;T=k<<3;C=0;while(1){U=C+aa|0;V=d[l+U>>0]|0;if(V>>>0<ia>>>0){ja=33;break a}W=c[_>>2]|0;if(V>>>0>W>>>0){ja=33;break a}Y=V-ia|0;if(Y>>>0>=4){ja=35;break a}V=d[490805+(c[p+(Y<<2)>>2]|0)>>0]|0;Y=T|1;X=d[l+4+U>>0]|0;if(X>>>0<ia>>>0|X>>>0>W>>>0){ja=33;break a}ka=X-ia|0;if(ka>>>0>=4){ja=35;break a}X=d[490805+(c[p+(ka<<2)>>2]|0)>>0]|0;ka=T|2;la=d[l+8+U>>0]|0;if(la>>>0<ia>>>0|la>>>0>W>>>0){ja=33;break a}ma=la-ia|0;if(ma>>>0>=4){ja=35;break a}la=d[490805+(c[p+(ma<<2)>>2]|0)>>0]|0;ma=T|3;na=d[l+12+U>>0]|0;if(na>>>0<ia>>>0|na>>>0>W>>>0){ja=33;break a}W=na-ia|0;if(W>>>0>=4){ja=35;break a}na=d[490805+(c[p+(W<<2)>>2]|0)>>0]|0;W=((na&1)<<ma|((la&1)<<ka|((X&1)<<Y|((V&1)<<T|j&65535))))&65535;U=(na>>>1<<ma|(la>>>1<<ka|(X>>>1<<Y|(V>>>1<<T|K&65535))))&65535;C=C+1|0;if(C>>>0>=2){pa=U;qa=W;break}else{K=U;j=W;T=T+4|0}}}T=k+1|0;if(T>>>0>=2){ra=pa;sa=qa;ja=39;break}y=c[o+(T<<2)>>2]|0;x=R;B=$;D=z;H=I;L=pa;b=qa;k=T}if((ja|0)==21)oa(490721,474791,13787,490732);else if((ja|0)==26)oa(490756,474791,13805,490732);else if((ja|0)==28)oa(490798,474791,13807,490732);else if((ja|0)==33)oa(490756,474791,13828,490732);else if((ja|0)==35)oa(490798,474791,13830,490732);else if((ja|0)==39){a[f+7>>0]=sa;a[f+6>>0]=(sa&65535)>>>8;a[f+5>>0]=ra;a[f+4>>0]=(ra&65535)>>>8;break}}else{k=S?O:Q;b=(((k*31|0)+127|0)>>>0)/255|0;L=S?P:N;H=((((L*31|0)+127|0)>>>0)/255|0)-b|0;if((H+4|0)>>>0>7){D=(((k*15|0)+127|0)>>>0)/255|0;k=(((L*15|0)+127|0)>>>0)/255|0;L=D<<4;B=(k|L)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=64;break b}Fa=Ca-Aa|0;if(Fa>>>0>=4){ja=66;break b}Ca=d[490805+(c[s+(Fa<<2)>>2]|0)>>0]|0;Fa=I|1;Ga=d[l+4+Ea>>0]|0;if(Ga>>>0<Aa>>>0|Ga>>>0>Da>>>0){ja=64;break b}Ha=Ga-Aa|0;if(Ha>>>0>=4){ja=66;break b}Ga=d[490805+(c[s+(Ha<<2)>>2]|0)>>0]|0;Ha=I|2;Ia=d[l+8+Ea>>0]|0;if(Ia>>>0<Aa>>>0|Ia>>>0>Da>>>0){ja=64;break b}Ja=Ia-Aa|0;if(Ja>>>0>=4){ja=66;break b}Ia=d[490805+(c[s+(Ja<<2)>>2]|0)>>0]|0;Ja=I|3;Ka=d[l+12+Ea>>0]|0;if(Ka>>>0<Aa>>>0|Ka>>>0>Da>>>0){ja=64;break b}Da=Ka-Aa|0;if(Da>>>0>=4){ja=66;break b}Ka=d[490805+(c[s+(Da<<2)>>2]|0)>>0]|0;Da=((Ka&1)<<Ja|((Ia&1)<<Ha|((Ga&1)<<Fa|((Ca&1)<<I|R&65535))))&65535;Ea=(Ka>>>1<<Ja|(Ia>>>1<<Ha|(Ga>>>1<<Fa|(Ca>>>1<<I|z&65535))))&65535;na=na+1|0;if(na>>>0>=2){La=$;Ma=Ea;Na=Da;break}else{z=Ea;R=Da;I=I+4|0}}}}else ja=68;do if((ja|0)==68){ja=0;I=c[q+(la<<2)>>2]|0;R=0-I|0;z=255-I|0;if((z|I|0)<=-1){ja=69;break b}$=c[r+(la<<2)>>2]|0;if($>>>0<52){na=$>>>0>22?14:15;ma=($+-4|0)>>>0>35?na&13:na;na=$>>>0<9?ma&11:ma;Oa=$>>>0<12?na&7:na}else{na=$>>>0>60?248:252;ma=$>>>0>89?na&244:na;na=$>>>0>120?ma&236:ma;ma=$>>>0>136?na&220:na;Oa=$>>>0>174?ma&188:ma}ma=n+(la<<2)|0;$=la<<1;na=m+(la<<2)|0;Ba=$|1;Da=$|1;Ea=$|1;Ca=-1;Fa=0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)<<R|((z&1)<<ma|((Ba&1)<<na|((Ea&1)<<I|((Da&1)<<Ga|((Ca&1)<<$|ka&65535))))))))&65535;break}else{Ca=la<<3;Ga=d[t>>0]|0;Da=Ca|1;I=d[K>>0]|0;Ea=Da+1|0;na=d[C>>0]|0;Ba=Ca|3;ma=d[_>>0]|0;z=Ba+1|0;R=d[aa>>0]|0;Ja=Ba+2|0;Qa=d[W>>0]|0;Pa=Ba+3|0;Ha=d[U>>0]|0;Ia=Ca|7;Ka=d[V>>0]|0;La=Fa;Ma=(Ka>>>1<<Ia|(Ha>>>1<<Pa|(Qa>>>1<<Ja|(R>>>1<<z|(ma>>>1<<Ba|(na>>>1<<Ea|(I>>>1<<Da|(Ga>>>1<<Ca|X&65535))))))))&65535;Na=((Ka&1)<<Ia|((Ha&1)<<Pa|((Qa&1)<<Ja|((R&1)<<z|((ma&1)<<Ba|((na&1)<<Ea|((I&1)<<Da|((Ga&1)<<Ca|ka&65535))))))))&65535;break}}while(0);la=la+1|0;if(la>>>0>=2){bb=Ma;cb=Na;ja=99;break}else{Y=La;X=Ma;ka=Na}}if((ja|0)==52)oa(490721,474791,13904,490732);else if((ja|0)==57)oa(490756,474791,13928,490732);else if((ja|0)==59)oa(490798,474791,13930,490732);else if((ja|0)==64)oa(490756,474791,13951,490732);else if((ja|0)==66)oa(490798,474791,13953,490732);else if((ja|0)==69)oa(490809,474791,13977,490732);else if((ja|0)==76)oa(490843,474791,14027,490732);else if((ja|0)==78)oa(490882,474791,14035,490732);else if((ja|0)==99){a[f+7>>0]=cb;a[f+6>>0]=(cb&65535)>>>8;a[f+5>>0]=bb;a[f+4>>0]=(bb&65535)>>>8;break}}while(0);w=1;i=h;return w|0}function sb(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;g=i;i=i+224|0;h=g+64|0;j=g;if(!(Ob(b,h,0,1)|0)){k=0;i=g;return k|0}b=h+104|0;l=c[b>>2]|0;if((l|0)==8){m=c[h+112>>2]|0;n=m&255;o=m>>>8&255;p=m>>>16&255;m=d[468643+(o<<1)>>0]<<5|d[467619+(n<<1)>>0]<<11|d[467619+(p<<1)>>0];q=d[468643+(o<<1)+1>>0]<<5|d[467619+(n<<1)+1>>0]<<11|d[467619+(p<<1)+1>>0];if((q|0)==(m|0))if(!m){r=1;s=0;t=0;u=0;v=85}else{w=m+-1|0;x=0;y=6}else{w=q;x=170;y=6}if((y|0)==6){y=m>>>0<w>>>0;q=y?w:m;p=y?m:w;r=q&255;s=p&255;t=(q&65535)>>>8&255;u=(p&65535)>>>8&255;v=(y?x|85:x)&255}a[e>>0]=r;a[e+1>>0]=t;a[e+2>>0]=s;a[e+3>>0]=u;Fd(e+4|0,v|0,4)|0;k=1;i=g;return k|0}if(!f?(a[h+116>>0]|0)!=0:0){Zb(h,e);k=1;i=g;return k|0}Pb(l,c[h+108>>2]|0,h+112|0,h,j,0)|0;if(!(a[h+117>>0]|0))Wb(e,j,f&1);else{l=c[b>>2]|0;a[e>>0]=1;a[e+1>>0]=0;a[e+2>>0]=0;a[e+3>>0]=0;b=c[17612+(d[476467+l>>0]<<2)>>2]|0;v=(d[476543+l>>0]|0)+-1|0;l=15;u=0;while(1){s=d[b+(d[(l<<v)+(h+39)>>0]|0)>>0]|u<<2;if((l|0)>0){l=l+-1|0;u=s}else{z=s;A=u;break}}a[e+4>>0]=z;a[e+5>>0]=A>>>6;a[e+6>>0]=A>>>14;a[e+7>>0]=A>>>22;Wb(e,j,f&1|4)}k=1;i=g;return k|0}function tb(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;h=i;i=i+224|0;j=h+64|0;k=h;if(!(Ob(e,j,0,1)|0)){l=0;i=h;return l|0}e=j+104|0;m=c[e>>2]|0;n=f+8|0;if((m|0)==8){o=j+112|0;p=a[o+3>>0]|0;a[f>>0]=p;a[f+1>>0]=p;p=f+2|0;a[p>>0]=0;a[p+1>>0]=0;a[p+2>>0]=0;a[p+3>>0]=0;a[p+4>>0]=0;a[p+5>>0]=0;p=c[o>>2]|0;o=p&255;q=p>>>8&255;r=p>>>16&255;p=(d[468643+(q<<1)>>0]|0)<<5|(d[467619+(o<<1)>>0]|0)<<11|(d[467619+(r<<1)>>0]|0);s=(d[468643+(q<<1)+1>>0]|0)<<5|(d[467619+(o<<1)+1>>0]|0)<<11|(d[467619+(r<<1)+1>>0]|0);if((s|0)==(p|0))if(!p){t=1;u=0;v=0;w=0;x=85}else{y=p+-1|0;z=0;A=6}else{y=s;z=170;A=6}if((A|0)==6){s=p>>>0<y>>>0;r=s?y:p;o=s?p:y;t=r&255;u=o&255;v=(r&65535)>>>8&255;w=(o&65535)>>>8&255;x=(s?z|85:z)&255}a[n>>0]=t;a[f+9>>0]=v;a[f+10>>0]=u;a[f+11>>0]=w;Fd(f+12|0,x|0,4)|0;l=1;i=h;return l|0}Pb(m,c[j+108>>2]|0,j+112|0,j,k,0)|0;Vb(f,k+3|0,4);do if(!g){m=b[j+116>>1]|0;if(!((m&255)<<24>>24)){B=(m&65535)>>>8&255;A=13;break}else{Zb(j,n);break}}else{B=a[j+117>>0]|0;A=13}while(0);do if((A|0)==13){if(!(B<<24>>24)){Wb(n,k,g&1);break}m=c[e>>2]|0;a[n>>0]=1;a[f+9>>0]=0;a[f+10>>0]=0;a[f+11>>0]=0;x=c[17612+((d[476467+m>>0]|0)<<2)>>2]|0;w=(d[476543+m>>0]|0)+-1|0;m=15;u=0;while(1){v=d[x+(d[(m<<w)+(j+39)>>0]|0)>>0]|0|u<<2;if((m|0)>0){m=m+-1|0;u=v}else{C=v;D=u;break}}a[f+12>>0]=C;a[f+13>>0]=D>>>6;a[f+14>>0]=D>>>14;a[f+15>>0]=D>>>22;Wb(n,k,g&1|4)}while(0);l=1;i=h;return l|0}function ub(e,f,g,h,j){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;k=i;i=i+224|0;l=k+64|0;m=k;if(!(Ob(e,l,0,1)|0)){n=0;i=k;return n|0}e=c[l+104>>2]|0;if((e|0)==8){o=l+112|0;b[f>>1]=d[o+h>>0]|0|3328;p=f+2|0;a[p>>0]=a[463004]|0;a[p+1>>0]=a[463005]|0;a[p+2>>0]=a[463006]|0;a[p+3>>0]=a[463007]|0;a[p+4>>0]=a[463008]|0;a[p+5>>0]=a[463009]|0;b[f+8>>1]=d[o+j>>0]|0|3328;o=f+10|0;a[o>>0]=a[463004]|0;a[o+1>>0]=a[463005]|0;a[o+2>>0]=a[463006]|0;a[o+3>>0]=a[463007]|0;a[o+4>>0]=a[463008]|0;a[o+5>>0]=a[463009]|0;n=1;i=k;return n|0}Pb(e,c[l+108>>2]|0,l+112|0,l,m,0)|0;if((h|0)==3)Ub(l,m,f);else Oa[(g?2:1)&3](f,m+h|0,4);if((j|0)==3)Ub(l,m,f+8|0);else Oa[(g?2:1)&3](f+8|0,m+j|0,4);n=1;i=k;return n|0}function vb(b,d){b=b|0;d=d|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;c[b+24>>2]=d;Fd(b+28|0,0,148)|0;eb(b+176|0);a[b+585>>0]=0;return}function wb(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0;if(e>>>0<78)return 0;if((d[c+1>>0]<<8|d[c>>0]|0)!=17011)return 0;if((d[c+3>>0]<<8|d[c+2>>0]|0)!=19)return 0;if((d[c+5>>0]<<8|d[c+4>>0]|0)!=77)return 0;if(((d[c+10>>0]<<16|d[c+11>>0]<<24|d[c+9>>0]<<8|d[c+8>>0])+77|0)>>>0>e>>>0)return 0;b=d[c+18>>0]<<8|d[c+19>>0]<<16|d[c+17>>0];if(!b)return 0;f=d[c+14>>0]|0;g=d[c+15>>0]<<8|d[c+16>>0]<<16|f;if((g|0)==0|b>>>0>g>>>0)return 0;b=a[c+21>>0]|0;h=b&255;if(!(a[c+20>>0]|0)){if((h&4|0)!=0&(f&1|0)!=0|(b&1)==0)return 0}else if(h&1)return 0;h=d[c+67>>0]<<16|d[c+68>>0]<<24|d[c+66>>0]<<8|d[c+65>>0];if(h>>>0<e>>>0)return (e-h|0)>>>0>=(g*23|0)>>>0|0;else return 0;return 0}function xb(a,b,c){a=a|0;b=b|0;c=c|0;var e=0;if(c>>>0<78)return 0;if(((d[b+1>>0]|0)<<8|(d[b>>0]|0)|0)!=17011)return 0;if(((d[b+3>>0]|0)<<8|(d[b+2>>0]|0)|0)!=19)return 0;if(((d[b+5>>0]|0)<<8|(d[b+4>>0]|0)|0)!=77)return 0;if((((d[b+10>>0]|0)<<16|(d[b+11>>0]|0)<<24|(d[b+9>>0]|0)<<8|(d[b+8>>0]|0))+77|0)>>>0>c>>>0)return 0;a=(d[b+15>>0]|0)<<8|(d[b+16>>0]|0)<<16|(d[b+14>>0]|0);if(!a)return 0;if(!((d[b+18>>0]|0)<<8|(d[b+19>>0]|0)<<16|(d[b+17>>0]|0)))return 0;e=(d[b+67>>0]|0)<<16|(d[b+68>>0]|0)<<24|(d[b+66>>0]|0)<<8|(d[b+65>>0]|0);if(e>>>0<c>>>0)return (c-e|0)>>>0>=(a*23|0)>>>0|0;else return 0;return 0}function yb(a,b,c){a=a|0;b=b|0;c=c|0;var e=0;if(!(xb(0,b,c)|0)){e=0;return e|0}e=(d[b+18>>0]|0)<<8|(d[b+19>>0]|0)<<16|(d[b+17>>0]|0);return e|0}function zb(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;if(!(xb(0,e,f)|0)){i=0;return i|0}f=d[e+15>>0]<<8|d[e+16>>0]<<16|d[e+14>>0];if(!f){i=0;return i|0}b=e+(d[e+67>>0]<<16|d[e+68>>0]<<24|d[e+66>>0]<<8|d[e+65>>0])|0;j=0;while(1){if((d[b+(j*23|0)+1>>0]<<8|d[b+(j*23|0)+2>>0]<<16|d[b+(j*23|0)>>0]|0)==(h|0)?(a[b+(j*23|0)+3>>0]|0)==0:0){k=j;break}j=j+1|0;if(j>>>0>=f>>>0){i=0;l=17;break}}if((l|0)==17)return i|0;if((k|0)<0){i=0;return i|0}if((d[e+18>>0]<<8|d[e+19>>0]<<16|d[e+17>>0])>>>0<=h>>>0){i=0;return i|0}l=k+1|0;if(l>>>0<f>>>0){j=l;l=1;while(1){if((d[b+(j*23|0)+1>>0]<<8|d[b+(j*23|0)+2>>0]<<16|d[b+(j*23|0)>>0]|0)!=(h|0)){m=l;break}n=(d[b+(j*23|0)+3>>0]|0)+1|0;o=l>>>0>n>>>0?l:n;j=j+1|0;if(j>>>0>=f>>>0){m=o;break}else l=o}if(m>>>0>16){i=0;return i|0}else p=m}else p=1;c[g>>2]=h;c[g+4>>2]=p;p=g+40|0;a[p>>0]=0;if(!(a[e+20>>0]|0)){q=b+(k*23|0)+4|0;r=(d[e+21>>0]|0)>>>2}else{e=b+(k*23|0)+4|0;q=e;r=d[e>>0]|0}a[p>>0]=r&1;a[g+41>>0]=(d[q>>0]|0)>>>1&1;q=b+(k*23|0)+10|0;r=b+(k*23|0)+9|0;c[g+16>>2]=(d[q>>0]<<8|d[r>>0])<<2;p=b+(k*23|0)+12|0;e=b+(k*23|0)+11|0;c[g+20>>2]=(d[p>>0]<<8|d[e>>0])<<2;c[g+8>>2]=d[b+(k*23|0)+6>>0]<<8|d[b+(k*23|0)+5>>0];c[g+12>>2]=d[b+(k*23|0)+8>>0]<<8|d[b+(k*23|0)+7>>0];b=d[q>>0]<<8|d[r>>0];c[g+24>>2]=b;r=d[p>>0]<<8|d[e>>0];c[g+28>>2]=r;c[g+32>>2]=Z(r,b)|0;c[g+36>>2]=k;i=1;return i|0}function Ab(a,b,e,f,g,h,i,j){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0;if(!(xb(0,b,e)|0)){k=0;return k|0}e=(d[b+15>>0]|0)<<8|(d[b+16>>0]|0)<<16|(d[b+14>>0]|0);if(!e){k=0;return k|0}a=b+((d[b+67>>0]|0)<<16|(d[b+68>>0]|0)<<24|(d[b+66>>0]|0)<<8|(d[b+65>>0]|0))|0;l=0;while(1){if(((d[a+(l*23|0)+1>>0]|0)<<8|(d[a+(l*23|0)+2>>0]|0)<<16|(d[a+(l*23|0)>>0]|0)|0)==(f|0)?(d[a+(l*23|0)+3>>0]|0|0)==(g|0):0){m=l;break}l=l+1|0;if(l>>>0>=e>>>0){k=0;n=10;break}}if((n|0)==10)return k|0;if((m|0)<0){k=0;return k|0}if(((d[b+18>>0]|0)<<8|(d[b+19>>0]|0)<<16|(d[b+17>>0]|0))>>>0<=f>>>0){k=0;return k|0}c[h>>2]=(d[a+(m*23|0)+6>>0]|0)<<8|(d[a+(m*23|0)+5>>0]|0);c[i>>2]=(d[a+(m*23|0)+8>>0]|0)<<8|(d[a+(m*23|0)+7>>0]|0);c[j>>2]=Z((d[a+(m*23|0)+12>>0]|0)<<8|(d[a+(m*23|0)+11>>0]|0),(d[a+(m*23|0)+10>>0]|0)<<8|(d[a+(m*23|0)+9>>0]|0))|0;k=1;return k|0}function Bb(b,e,f,g,h,i){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0;if(!(xb(0,e,f)|0)){j=0;return j|0}f=d[e+15>>0]<<8|d[e+16>>0]<<16|d[e+14>>0];if(!f){j=0;return j|0}b=e+(d[e+67>>0]<<16|d[e+68>>0]<<24|d[e+66>>0]<<8|d[e+65>>0])|0;k=0;while(1){if((d[b+(k*23|0)+1>>0]<<8|d[b+(k*23|0)+2>>0]<<16|d[b+(k*23|0)>>0]|0)==(h|0)?(d[b+(k*23|0)+3>>0]|0)==(i|0):0){l=k;break}k=k+1|0;if(k>>>0>=f>>>0){j=0;m=13;break}}if((m|0)==13)return j|0;if((l|0)<0){j=0;return j|0}if((d[e+18>>0]<<8|d[e+19>>0]<<16|d[e+17>>0])>>>0<=h>>>0){j=0;return j|0}c[g>>2]=h;c[g+4>>2]=i;if(!(a[e+20>>0]|0)){n=b+(l*23|0)+4|0;o=(d[e+21>>0]|0)>>>2}else{e=b+(l*23|0)+4|0;n=e;o=d[e>>0]|0}a[g+40>>0]=o&1;a[g+41>>0]=(d[n>>0]|0)>>>1&1;n=b+(l*23|0)+10|0;o=b+(l*23|0)+9|0;c[g+16>>2]=(d[n>>0]<<8|d[o>>0])<<2;e=b+(l*23|0)+12|0;i=b+(l*23|0)+11|0;c[g+20>>2]=(d[e>>0]<<8|d[i>>0])<<2;c[g+8>>2]=d[b+(l*23|0)+6>>0]<<8|d[b+(l*23|0)+5>>0];c[g+12>>2]=d[b+(l*23|0)+8>>0]<<8|d[b+(l*23|0)+7>>0];b=d[n>>0]<<8|d[o>>0];c[g+24>>2]=b;o=d[e>>0]<<8|d[i>>0];c[g+28>>2]=o;c[g+32>>2]=Z(o,b)|0;c[g+36>>2]=l;j=1;return j|0}function Cb(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;if(!(xb(0,e,f)|0)){g=0;return g|0}h=(c[b+4>>2]|0)!=(c[b>>2]|0);if(!(a[e+20>>0]|0)){if(h)Db(b);i=d[e+43>>0]<<16|d[e+44>>0]<<24|d[e+42>>0]<<8|d[e+41>>0];if(i>>>0>f>>>0){g=0;return g|0}j=d[e+52>>0]<<16|d[e+53>>0]<<24|d[e+51>>0]<<8|d[e+50>>0];if(j>>>0>f>>>0){g=0;return g|0}k=e+57|0;l=e+60|0;m=e+59|0;n=e+58|0;o=d[m>>0]<<16|d[l>>0]<<24|d[n>>0]<<8|d[k>>0];if(o>>>0>f>>>0){g=0;return g|0}p=d[e+46>>0]<<8|d[e+47>>0]<<16|d[e+45>>0];if(p>>>0>(f-i|0)>>>0){g=0;return g|0}q=d[e+55>>0]<<8|d[e+56>>0]<<16|d[e+54>>0];if(q>>>0>(f-j|0)>>>0){g=0;return g|0}r=e+61|0;s=e+64|0;t=e+63|0;u=e+62|0;if((d[t>>0]<<16|d[s>>0]<<24|d[u>>0]<<8|d[r>>0])>>>0>(f-o|0)>>>0){g=0;return g|0}if(!(fb(b,d[e+40>>0]<<8|d[e+39>>0],e+i|0,p,d[e+49>>0]<<8|d[e+48>>0],e+j|0,q)|0)){g=0;return g|0}if(!(jb(b,e+(d[m>>0]<<16|d[l>>0]<<24|d[n>>0]<<8|d[k>>0])|0,d[t>>0]<<16|d[s>>0]<<24|d[u>>0]<<8|d[r>>0])|0)){g=0;return g|0}}else if(h)Db(b);a[b+585>>0]=1;g=1;return g|0}function Db(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a>>2]|0;d=a+4|0;e=c[d>>2]|0;if((e|0)!=(b|0))c[d>>2]=e+(~((e+-8-b|0)>>>3)<<3);b=c[a+12>>2]|0;e=a+16|0;d=c[e>>2]|0;if((d|0)!=(b|0))c[e>>2]=d+(~(((0-b+(d+-11)|0)>>>0)/11|0)*11|0);d=c[a+28>>2]|0;b=a+32|0;if((c[b>>2]|0)!=(d|0))c[b>>2]=d;d=c[a+40>>2]|0;b=a+44|0;e=c[b>>2]|0;if((d|0)!=(e|0))c[b>>2]=e+(~((e+-4-d|0)>>>2)<<2);d=c[a+52>>2]|0;e=a+56|0;b=c[e>>2]|0;if((d|0)!=(b|0))c[e>>2]=b+(~((b+-2-d|0)>>>1)<<1);d=c[a+64>>2]|0;b=a+68|0;if((c[b>>2]|0)!=(d|0))c[b>>2]=d;d=c[a+76>>2]|0;b=a+80|0;e=c[b>>2]|0;if((d|0)!=(e|0))c[b>>2]=e+(~((e+-4-d|0)>>>2)<<2);d=c[a+88>>2]|0;e=a+92|0;b=c[e>>2]|0;if((d|0)!=(b|0))c[e>>2]=b+(~((b+-2-d|0)>>>1)<<1);d=c[a+100>>2]|0;b=a+104|0;if((c[b>>2]|0)!=(d|0))c[b>>2]=d;d=c[a+112>>2]|0;b=a+116|0;e=c[b>>2]|0;if((d|0)!=(e|0))c[b>>2]=e+(~((e+-4-d|0)>>>2)<<2);d=c[a+124>>2]|0;e=a+128|0;b=c[e>>2]|0;if((d|0)!=(b|0))c[e>>2]=b+(~((b+-2-d|0)>>>1)<<1);d=c[a+136>>2]|0;b=a+140|0;if((c[b>>2]|0)!=(d|0))c[b>>2]=d;d=c[a+148>>2]|0;b=a+152|0;e=c[b>>2]|0;if((d|0)!=(e|0))c[b>>2]=e+(~((e+-4-d|0)>>>2)<<2);d=c[a+160>>2]|0;e=a+164|0;b=c[e>>2]|0;if((d|0)==(b|0)){f=a+172|0;c[f>>2]=0;return}c[e>>2]=b+(~((b+-2-d|0)>>>1)<<1);f=a+172|0;c[f>>2]=0;return}function Eb(b){b=b|0;Db(b);a[b+585>>0]=0;return 1}function Fb(b,c,e,f,g,h,i,j,k,l,m,n,o,p,q){b=b|0;c=c|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;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;if(!((k&2|0)==0&(a[b+585>>0]|0)!=0)){r=0;return r|0}if(!(xb(0,c,e)|0)){r=0;return r|0}if((d[c+15>>0]<<8|d[c+16>>0]<<16|d[c+14>>0])>>>0<=f>>>0){r=0;return r|0}s=c+(d[c+67>>0]<<16|d[c+68>>0]<<24|d[c+66>>0]<<8|d[c+65>>0])|0;t=s+(f*23|0)|0;u=d[s+(f*23|0)+10>>0]<<8|d[s+(f*23|0)+9>>0];v=d[s+(f*23|0)+12>>0]<<8|d[s+(f*23|0)+11>>0];w=Z(v,u)|0;do if((i+-21|0)>>>0<9){if(!l)x=d[s+(f*23|0)+6>>0]<<8|d[s+(f*23|0)+5>>0];else x=l;if(!o)y=d[s+(f*23|0)+8>>0]<<8|d[s+(f*23|0)+7>>0];else y=o;if((Z(y,x)|0)>>>0>h>>>0){r=0;return r|0}else{z=x;A=y;B=13}}else if((i|0)==15){if((Z(((d[s+(f*23|0)+8>>0]<<8|d[s+(f*23|0)+7>>0])+3|0)>>>2,((d[s+(f*23|0)+6>>0]<<8|d[s+(f*23|0)+5>>0])+7|0)>>>3)|0)>>>0>h>>>0)r=0;else{C=l;D=o;break}return r|0}else{if(w>>>0>h>>>0)r=0;else{z=l;A=o;B=13;break}return r|0}while(0);if((B|0)==13)if((i|0)!=0&(i&-2|0)==6){B=u<<2;if(!u){r=0;return r|0}if(B+262143&B){r=0;return r|0}B=v<<2;if(!v){r=0;return r|0}if(B+262143&B){r=0;return r|0}else{C=z;D=A}}else{C=z;D=A}A=d[s+(f*23|0)+15>>0]<<16|d[s+(f*23|0)+16>>0]<<24|d[s+(f*23|0)+14>>0]<<8|d[s+(f*23|0)+13>>0];if(A>>>0>e>>>0){r=0;return r|0}z=d[s+(f*23|0)+19>>0]<<16|d[s+(f*23|0)+20>>0]<<24|d[s+(f*23|0)+18>>0]<<8|d[s+(f*23|0)+17>>0];if((e-A|0)>>>0<z>>>0){r=0;return r|0}if((a[c+20>>0]|0)==1){r=ob(0,g,u,v,c+A|0,z,i,j,0,c,t,C,0,D,p,q,k)|0;return r|0}else{r=kb(b,g,u,v,c+A|0,z,i,j,(k&8|0)==0,c,t,C,m,(k&16|0)!=0,n,D)|0;return r|0}return 0}function Gb(b,e,f,g,h,j,k,l,m,n,o,p){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;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,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;q=i;i=i+32|0;r=q+12|0;s=q;switch(l|0){case 20:case 19:case 18:case 11:case 9:case 8:case 4:case 2:case 0:{t=8;break}case 21:case 17:case 12:case 10:case 5:case 3:case 1:case 7:case 6:{t=16;break}case 13:{t=4;break}case 16:case 15:case 14:{t=2;break}default:oa(475191,474791,10597,475274)}if(!(a[b+585>>0]|0)){u=0;i=q;return u|0}v=m>>>2;if(m&2){u=0;i=q;return u|0}if(!(xb(0,e,f)|0)){u=0;i=q;return u|0}w=e+(d[e+67>>0]<<16|d[e+68>>0]<<24|d[e+66>>0]<<8|d[e+65>>0])|0;x=(d[e+21>>0]|0)>>>2;y=d[e+15>>0]<<8|d[e+16>>0]<<16|d[e+14>>0];if(!y){u=0;i=q;return u|0}else z=0;while(1){if((d[w+(z*23|0)+1>>0]<<8|d[w+(z*23|0)+2>>0]<<16|d[w+(z*23|0)>>0]|0)==(g|0)?(d[w+(z*23|0)+3>>0]|0)==(h|0):0){A=z;break}z=z+1|0;if(z>>>0>=y>>>0){u=0;B=144;break}}if((B|0)==144){i=q;return u|0}if((A|0)<0){u=0;i=q;return u|0}B=x&1;z=(B|0)==0;h=(l|0)==9&z?8:l;l=e+20|0;g=a[l>>0]|0;if(!(g<<24>>24)){if(a[w+(A*23|0)+4>>0]&1){u=0;i=q;return u|0}if(!z){C=A+1|0;if(C>>>0>=y>>>0){u=0;i=q;return u|0}if(!(a[w+(C*23|0)+4>>0]&1)){u=0;i=q;return u|0}if((d[w+(A*23|0)+10>>0]<<8|d[w+(A*23|0)+9>>0]|0)!=(d[w+(C*23|0)+10>>0]<<8|d[w+(C*23|0)+9>>0]|0)){u=0;i=q;return u|0}if((d[w+(A*23|0)+12>>0]<<8|d[w+(A*23|0)+11>>0]|0)!=(d[w+(C*23|0)+12>>0]<<8|d[w+(C*23|0)+11>>0]|0)){u=0;i=q;return u|0}}}C=w+(A*23|0)+10|0;y=w+(A*23|0)+9|0;D=w+(A*23|0)+12|0;E=w+(A*23|0)+11|0;w=Z(d[D>>0]<<8|d[E>>0],d[C>>0]<<8|d[y>>0])|0;if((h&-2|0)==8&w>>>0<k>>>0){Fd(j+(Z(w,t)|0)|0,0,Z(k-w|0,t)|0)|0;F=a[l>>0]|0}else F=g;if(F<<24>>24==1)do switch(h|0){case 0:{u=Fb(b,e,f,A,j,k,0,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 1:{u=Fb(b,e,f,A,j,k,1,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 2:{u=Fb(b,e,f,A,j,k,2,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 3:{u=Fb(b,e,f,A,j,k,3,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 4:{u=Fb(b,e,f,A,j,k,4,t,m,n,o,0,0,(v&1&x|0)!=0?3:0,-1)|0;i=q;return u|0}case 5:{u=Fb(b,e,f,A,j,k,5,t,m,n,o,0,0,0,3)|0;i=q;return u|0}case 7:case 6:{u=Fb(b,e,f,A,j,k,8,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 8:{u=Fb(b,e,f,A,j,k,6,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 9:{u=Fb(b,e,f,A,j,k,7,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 10:{u=Fb(b,e,f,A,j,k,12,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 20:{u=Fb(b,e,f,A,j,k,18,t,m,n,o,0,0,(v&1&x|0)!=0?3:0,-1)|0;i=q;return u|0}case 21:{u=Fb(b,e,f,A,j,k,19,t,m,n,o,0,0,0,3)|0;i=q;return u|0}case 13:{u=Fb(b,e,f,A,j,k,22,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 14:{u=Fb(b,e,f,A,j,k,24,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 15:{u=Fb(b,e,f,A,j,k,25,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 16:{u=Fb(b,e,f,A,j,k,29,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 19:case 18:case 17:case 12:case 11:{u=0;i=q;return u|0}default:oa(475191,474791,10030,475193)}while(0);do switch(h|0){case 0:{u=Fb(b,e,f,A+(v&1&x)|0,j,k,0,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 2:{u=Fb(b,e,f,A+(v&1&x)|0,j,k,2,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 4:{u=Fb(b,e,f,A+(v&1&x)|0,j,k,4,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 8:{u=Fb(b,e,f,A+(v&1&x)|0,j,k,6,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 9:{if(z)oa(475215,474791,10117,475193);c[s>>2]=0;F=s+4|0;c[F>>2]=0;c[s+8>>2]=0;do if(w)if(w>>>0>1073741823)Ic(s);else{g=w<<2;l=Jc(g)|0;c[s>>2]=l;G=l+(w<<2)|0;c[s+8>>2]=G;Fd(l|0,0,g|0)|0;c[F>>2]=G;H=s;I=l;break}else{H=s;I=0}while(0);if(Fb(b,e,f,A+1|0,I,w,20,4,m,d[C>>0]<<8|d[y>>0],o,0,0,-1,-1)|0)J=Fb(b,e,f,A,j,k,7,t,m,n,o,c[H>>2]|0,0,-1,-1)|0;else J=0;l=c[s>>2]|0;if(!l){u=J;i=q;return u|0}G=c[F>>2]|0;if((G|0)!=(l|0))c[F>>2]=G+(~((G+-4-l|0)>>>2)<<2);Kc(l);u=J;i=q;return u|0}case 7:case 6:{if((t|0)!=16)oa(475243,474791,10147,475193);l=Fb(b,e,f,A,j,k,9,16,m,n,o,0,0,-1,-1)|0;if(z|l^1){u=l;i=q;return u|0}u=Fb(b,e,f,A+1|0,j,k,10,16,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 1:{if((t|0)!=16)oa(475243,474791,10173,475193);if(z){l=d[C>>0]<<8|d[y>>0];G=d[D>>0]<<8|d[E>>0];if(G){g=((n|0)==0?l:n)<<4;K=(l|0)==0;L=0;do{if(!K){M=Z(g,L)|0;N=0;while(1){O=j+M|0;a[O>>0]=255;a[O+1>>0]=29;O=j+(M|2)|0;a[O>>0]=a[463004]|0;a[O+1>>0]=a[463005]|0;a[O+2>>0]=a[463006]|0;a[O+3>>0]=a[463007]|0;a[O+4>>0]=a[463008]|0;a[O+5>>0]=a[463009]|0;N=N+1|0;if((N|0)==(l|0))break;else M=M+16|0}}L=L+1|0}while((L|0)!=(G|0))}}else if(!(Fb(b,e,f,A+1|0,j,k,11,16,m,n,o,0,0,-1,-1)|0)){u=0;i=q;return u|0}u=Fb(b,e,f,A,j+8|0,k,0,16,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 3:{if((t|0)!=16)oa(475243,474791,10211,475193);if(z){G=d[C>>0]<<8|d[y>>0];L=d[D>>0]<<8|d[E>>0];a[r>>0]=0;a[r+1>>0]=0;a[r+2>>0]=0;a[r+3>>0]=0;a[r+4>>0]=0;a[r+5>>0]=0;if(L){l=((n|0)==0?G:n)<<4;g=(G|0)==0;K=0;do{if(!g){F=Z(l,K)|0;M=0;while(1){a[j+F>>0]=-1;a[j+(F|1)>>0]=-1;N=j+(F|2)|0;a[N>>0]=a[r>>0]|0;a[N+1>>0]=a[r+1>>0]|0;a[N+2>>0]=a[r+2>>0]|0;a[N+3>>0]=a[r+3>>0]|0;a[N+4>>0]=a[r+4>>0]|0;a[N+5>>0]=a[r+5>>0]|0;M=M+1|0;if((M|0)==(G|0))break;else F=F+16|0}}K=K+1|0}while((K|0)!=(L|0))}}else if(!(Fb(b,e,f,A+1|0,j,k,4,16,m,n,o,0,0,-1,-1)|0)){u=0;i=q;return u|0}u=Fb(b,e,f,A,j+8|0,k,2,16,m|8,n,o,0,0,-1,-1)|0;i=q;return u|0}case 5:{if((t|0)!=16)oa(475243,474791,10246,475193);if(!(Fb(b,e,f,A,j,k,4,16,m,n,o,0,0,-1,-1)|0)){u=0;i=q;return u|0}if(!z){u=Fb(b,e,f,A+1|0,j+8|0,k,4,16,m,n,o,0,0,-1,-1)|0;i=q;return u|0}L=d[C>>0]<<8|d[y>>0];K=d[D>>0]<<8|d[E>>0];a[r>>0]=0;a[r+1>>0]=0;a[r+2>>0]=0;a[r+3>>0]=0;a[r+4>>0]=0;a[r+5>>0]=0;if(K){G=((n|0)==0?L:n)<<4;l=(L|0)==0;g=0;do{if(!l){F=Z(G,g)|0;M=0;while(1){a[j+(F+8)>>0]=-1;a[j+((F|1)+8)>>0]=-1;N=j+((F|2)+8)|0;a[N>>0]=a[r>>0]|0;a[N+1>>0]=a[r+1>>0]|0;a[N+2>>0]=a[r+2>>0]|0;a[N+3>>0]=a[r+3>>0]|0;a[N+4>>0]=a[r+4>>0]|0;a[N+5>>0]=a[r+5>>0]|0;M=M+1|0;if((M|0)==(L|0))break;else F=F+16|0}}g=g+1|0}while((g|0)!=(K|0))}u=1;i=q;return u|0}case 10:{if((t|0)!=16)oa(475243,474791,10279,475193);if(z){u=Fb(b,e,f,A,j,k,12,16,m,n,o,0,0,-1,-1)|0;i=q;return u|0}if(!(Fb(b,e,f,A+1|0,j,k,20,16,m,n,o,0,0,-1,-1)|0)){u=0;i=q;return u|0}u=Fb(b,e,f,A,j,k,12,16,m|16,n,o,0,0,-1,-1)|0;i=q;return u|0}case 11:{u=Fb(b,e,f,A+(v&1&x)|0,j,k,13,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 12:{if((t|0)!=16)oa(475243,474791,10330,475193);if(z){K=d[C>>0]<<8|d[y>>0];g=d[D>>0]<<8|d[E>>0];a[r>>0]=0;a[r+1>>0]=0;a[r+2>>0]=0;a[r+3>>0]=0;a[r+4>>0]=0;a[r+5>>0]=0;if(g){L=((n|0)==0?K:n)<<4;G=(K|0)==0;l=0;do{if(!G){F=Z(L,l)|0;M=0;while(1){a[j+F>>0]=-1;a[j+(F|1)>>0]=-1;N=j+(F|2)|0;a[N>>0]=a[r>>0]|0;a[N+1>>0]=a[r+1>>0]|0;a[N+2>>0]=a[r+2>>0]|0;a[N+3>>0]=a[r+3>>0]|0;a[N+4>>0]=a[r+4>>0]|0;a[N+5>>0]=a[r+5>>0]|0;M=M+1|0;if((M|0)==(K|0))break;else F=F+16|0}}l=l+1|0}while((l|0)!=(g|0))}}else if(!(Fb(b,e,f,A+1|0,j,k,4,16,m,n,o,0,0,-1,-1)|0)){u=0;i=q;return u|0}u=Fb(b,e,f,A,j+8|0,k,13,16,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 18:{u=Fb(b,e,f,A+(v&1&x)|0,j,k,16,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 19:{if(z){u=Fb(b,e,f,A,j,k,16,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}if(!(Fb(b,e,f,A+1|0,j,k,20,t,m,n,o,0,0,-1,-1)|0)){u=0;i=q;return u|0}u=Fb(b,e,f,A,j,k,17,t,m|16,n,o,0,0,-1,-1)|0;i=q;return u|0}case 13:{if(!z?!(Fb(b,e,f,A+1|0,j,k,23,4,m,n,o,0,p,-1,-1)|0):0){u=0;i=q;return u|0}u=Fb(b,e,f,A,j,k,22-B|0,4,m,n,o,0,p,-1,-1)|0;i=q;return u|0}case 15:case 14:{u=Fb(b,e,f,A+(v&1&x)|0,j,k,(h|0)==14?24:25,2,m,n,o,0,p,-1,-1)|0;i=q;return u|0}case 16:{if(!z?!(Fb(b,e,f,A+1|0,j,k,27,2,m,n,o,0,p,-1,-1)|0):0){u=0;i=q;return u|0}u=Fb(b,e,f,A,j,k,(B<<1^2)+26|0,2,m,n,o,0,p,-1,-1)|0;i=q;return u|0}case 17:{u=Fb(b,e,f,A+(v&1&x)|0,j,k,15,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 20:{u=Fb(b,e,f,A+(v&1&x)|0,j,k,18,t,m,n,o,0,0,-1,-1)|0;i=q;return u|0}case 21:{if((t|0)!=16)oa(475243,474791,10516,475193);if(z){g=d[C>>0]<<8|d[y>>0];l=d[D>>0]<<8|d[E>>0];if(l){K=((n|0)==0?g:n)<<4;L=(g|0)==0;G=0;do{if(!L){F=Z(K,G)|0;M=0;while(1){N=j+(F+8)|0;a[N>>0]=255;a[N+1>>0]=29;N=j+((F|2)+8)|0;a[N>>0]=a[463004]|0;a[N+1>>0]=a[463005]|0;a[N+2>>0]=a[463006]|0;a[N+3>>0]=a[463007]|0;a[N+4>>0]=a[463008]|0;a[N+5>>0]=a[463009]|0;M=M+1|0;if((M|0)==(g|0))break;else F=F+16|0}}G=G+1|0}while((G|0)!=(l|0))}}else if(!(Fb(b,e,f,A+1|0,j+8|0,k,18,16,m,n,o,0,0,-1,-1)|0)){u=0;i=q;return u|0}u=Fb(b,e,f,A,j,k,18,16,m,n,o,0,0,-1,-1)|0;i=q;return u|0}default:oa(475191,474791,10547,475193)}while(0);return 0}function Hb(a){a=a|0;var b=0;switch(a|0){case 20:case 19:case 18:case 11:case 9:case 8:case 4:case 2:case 0:{b=8;break}case 21:case 17:case 12:case 10:case 5:case 3:case 1:case 7:case 6:{b=16;break}case 13:{b=4;break}case 16:case 15:case 14:{b=2;break}default:oa(475191,474791,10597,475274)}return b|0}function Ib(a){a=a|0;return (a+-13|0)>>>0<4|0}function Jb(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;if(f>>>0>=21)oa(487333,474791,11110,487366);g=c[16704+(f*12|0)>>2]|0;if(!(898778>>>f&1)){if(!(e|d)){h=8;i=0}else oa(487388,474791,11119,487366);while(1){j=(h|0)<(g|0);k=j?h:g;l=b>>>(j?g-k|0:0);if(l>>>0>=1<<k>>>0){m=7;break}h=h-k|0;k=l<<h|i;if((h|0)<=0){n=k;m=14;break}else i=k}if((m|0)==7)oa(487420,474791,11130,487366);else if((m|0)==14)return n|0}m=(b&1|0)!=0?511:0;i=c[16956+(f<<3)+4>>2]|0;if(!(898768>>>f&1))oa(487434,474791,11142,487366);h=c[16956+(f<<3)>>2]|0;g=a[h>>0]|0;if(g<<24>>24==48)o=0;else o=b>>>(((g&255)<<24)+-1627389952>>24)<<1&2;g=a[h+1>>0]|0;if(g<<24>>24==48)p=o;else p=b>>>(((g&255)<<24)+-1627389952>>24)&1|o;o=p<<1;p=a[h+2>>0]|0;if(p<<24>>24==48)q=o;else q=b>>>(((p&255)<<24)+-1627389952>>24)&1|o;o=q<<1;q=a[h+3>>0]|0;if(q<<24>>24==48)r=o;else r=b>>>(((q&255)<<24)+-1627389952>>24)&1|o;o=r<<1;r=a[h+4>>0]|0;if(r<<24>>24==48)s=o;else s=b>>>(((r&255)<<24)+-1627389952>>24)&1|o;o=s<<1;s=a[h+5>>0]|0;if(s<<24>>24==48)t=o;else t=b>>>(((s&255)<<24)+-1627389952>>24)&1|o;o=t<<1;t=a[h+6>>0]|0;if(t<<24>>24==48)u=o;else u=b>>>(((t&255)<<24)+-1627389952>>24)&1|o;o=u<<1;u=a[h+7>>0]|0;if(u<<24>>24==48)v=o;else v=b>>>(((u&255)<<24)+-1627389952>>24)&1|o;o=v<<1;v=a[h+8>>0]|0;if(v<<24>>24==48)w=o;else w=b>>>(((v&255)<<24)+-1627389952>>24)&1|o;n=(w+(Z(i,(599186>>>f&1|0)!=0?d:e)|0)^m)>>>2|m&128;return n|0}function Kb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(b>>>0>=21)oa(487333,474791,11167,487436);d=c[16704+(b*12|0)>>2]|0;if((c[16704+(b*12|0)+4>>2]<<1|1)+(c[16704+(b*12|0)+8>>2]<<2)<<d>>>0<=a>>>0)oa(487462,474791,11168,487436);if(!(898778>>>b&1)){e=Jb(a,0,0,b)|0;return e|0}f=(1<<d)+-1&a;g=a>>>d;if(!(599186>>>b&1)){e=Jb(f,0,g,b)|0;return e|0}else{e=Jb(f,g,0,b)|0;return e|0}return 0}function Lb(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,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0;f=i;i=i+96|0;g=f+80|0;h=f+64|0;j=f+52|0;k=f+40|0;l=f+16|0;m=f;n=c[e>>2]|0;o=d[489764+n>>0]|0;p=n+-4|0;do if(p>>>0>=3){q=c[e+4>>2]<<4;if(!(138>>>n&1)){r=488548+q|0;break}else{r=487524+q|0;break}}else r=487508;while(0);q=g;s=e+8|0;t=q+16|0;do{a[q>>0]=a[s>>0]|0;q=q+1|0;s=s+1|0}while((q|0)<(t|0));q=h;s=e+24|0;t=q+16|0;do{a[q>>0]=a[s>>0]|0;q=q+1|0;s=s+1|0}while((q|0)<(t|0));q=j;s=e+40|0;t=q+12|0;do{a[q>>0]=a[s>>0]|0;q=q+1|0;s=s+1|0}while((q|0)<(t|0));q=k;s=e+52|0;t=q+12|0;do{a[q>>0]=a[s>>0]|0;q=q+1|0;s=s+1|0}while((q|0)<(t|0));s=e+64|0;c[l>>2]=c[s>>2];c[l+4>>2]=c[s+4>>2];c[l+8>>2]=c[s+8>>2];c[l+12>>2]=c[s+12>>2];c[l+16>>2]=c[s+16>>2];c[l+20>>2]=c[s+20>>2];c[m>>2]=-1;c[m+4>>2]=-1;c[m+8>>2]=-1;s=c[e+88>>2]|0;u=1<<(d[489772+n>>0]|0)+s;v=u>>>1;w=(n&-2|0)==4;x=489796+n|0;y=u+255|0;u=(n|0)==1;z=(n&-3|0)==0;A=e+4|0;C=0;do{do if(C){if(z&(C|0)==1){D=d[489636+(c[A>>2]|0)>>0]|0;break}E=c[A>>2]|0;if(z&(C|0)==2){D=d[489700+E>>0]|0;break}else{D=d[489572+E>>0]|0;break}}else D=0;while(0);c[m+(C<<2)>>2]=D;if(v&d[g+D>>0]){E=0;do{if((d[r+E>>0]|0)==(C|0)){F=g+E|0;a[F>>0]=y-(d[F>>0]|0)}E=E+1|0}while((E|0)!=16);if(w){E=j+(C<<2)|0;F=a[E>>0]|0;G=k+(C<<2)|0;a[E>>0]=a[G>>0]|0;a[G>>0]=F;F=j+(C<<2)+1|0;G=a[F>>0]|0;E=k+(C<<2)+1|0;a[F>>0]=a[E>>0]|0;a[E>>0]=G;G=j+(C<<2)+2|0;E=a[G>>0]|0;F=k+(C<<2)+2|0;a[G>>0]=a[F>>0]|0;a[F>>0]=E}else{E=j+(C<<2)|0;F=d[E>>0]|d[E+1>>0]<<8|d[E+2>>0]<<16|d[E+3>>0]<<24;G=k+(C<<2)|0;H=d[G>>0]|d[G+1>>0]<<8|d[G+2>>0]<<16|d[G+3>>0]<<24;a[E>>0]=H;a[E+1>>0]=H>>8;a[E+2>>0]=H>>16;a[E+3>>0]=H>>24;a[G>>0]=F;a[G+1>>0]=F>>8;a[G+2>>0]=F>>16;a[G+3>>0]=F>>24}if(!u){F=l+(C<<3)|0;G=c[F>>2]|0;H=l+(C<<3)+4|0;c[F>>2]=c[H>>2];c[H>>2]=G;I=21}}else I=21;if(((I|0)==21?(I=0,w):0)?(G=1<<(d[x>>0]|0)-s,(G>>>1&d[h+D>>0]|0)!=0):0){H=G+255|0;G=0;do{if((d[r+G>>0]|0)==(C|0)){F=h+G|0;a[F>>0]=H-(d[F>>0]|0)}G=G+1|0}while((G|0)!=16);G=j+(C<<2)+3|0;H=a[G>>0]|0;F=k+(C<<2)+3|0;a[G>>0]=a[F>>0]|0;a[F>>0]=H}C=C+1|0}while(C>>>0<o>>>0);q=b;t=q+16|0;do{a[q>>0]=0;q=q+1|0}while((q|0)<(t|0));q=1<<n;t=n+1|0;if(t>>>0>=33)oa(508584,474791,11245,508631);C=Hd(1,0,t|0)|0;r=B;if(!(0<r>>>0|0==(r|0)&q>>>0<C>>>0))oa(508584,474791,11245,508631);if(t){C=t;t=q;q=0;while(1){r=q&7;D=8-r|0;s=D>>>0<C>>>0?D:C;D=b+(q>>>3)|0;a[D>>0]=d[D>>0]|t<<r;r=s+q|0;if((C|0)==(s|0)){J=r;break}else{C=C-s|0;t=t>>>s;q=r}}if(J>>>0<129)K=J;else oa(508650,474791,11254,508631)}else K=0;J=(n|0)==4;q=(n&-2|0)==4;if(q){t=c[e+92>>2]|0;if(t>>>0<4){L=2;M=t;N=K}else oa(508584,474791,11245,508631);while(1){t=N&7;C=8-t|0;r=C>>>0<L>>>0?C:L;C=b+(N>>>3)|0;a[C>>0]=d[C>>0]|M<<t;t=r+N|0;if((L|0)==(r|0)){O=t;break}else{L=L-r|0;M=M>>>r;N=t}}if(O>>>0<129)P=O;else oa(508650,474791,11254,508631)}else P=K;if(J){J=c[e+88>>2]|0;if(J>>>0<2){Q=1;R=J;S=P}else oa(508584,474791,11245,508631);while(1){J=S&7;K=8-J|0;O=K>>>0<Q>>>0?K:Q;K=b+(S>>>3)|0;a[K>>0]=d[K>>0]|R<<J;J=O+S|0;if((Q|0)==(O|0)){T=J;break}else{Q=Q-O|0;R=R>>>O;S=J}}if(T>>>0<129)U=T;else oa(508650,474791,11254,508631)}else U=P;if(p>>>0>2){p=c[e+4>>2]|0;P=142>>>n<<1&2|4;T=Hd(1,0,P|0)|0;S=B;if(0<S>>>0|0==(S|0)&p>>>0<T>>>0){V=P;W=p;X=U}else oa(508584,474791,11245,508631);while(1){p=X&7;P=8-p|0;T=P>>>0<V>>>0?P:V;P=b+(X>>>3)|0;a[P>>0]=d[P>>0]|W<<p;p=T+X|0;if((V|0)==(T|0)){Y=p;break}else{V=V-T|0;W=W>>>T;X=p}}if(Y>>>0<129)Z=Y;else oa(508650,474791,11254,508631)}else Z=U;U=n>>>0>3?4:3;Y=489788+n|0;X=489780+n|0;W=Z;Z=0;a:while(1){V=(Z|0)==3;p=W;T=0;while(1){P=a[j+(T<<2)+Z>>0]|0;if(V)_=a[Y>>0]|0;else _=d[X>>0]|0;if(_>>>0>=33){I=62;break a}S=Hd(1,0,_|0)|0;R=B;if(!(0<R>>>0|0==(R|0)&(P&255)>>>0<S>>>0)){I=62;break a}if(_){S=_;R=P&255;P=p;while(1){Q=P&7;J=8-Q|0;O=J>>>0<S>>>0?J:S;J=b+(P>>>3)|0;a[J>>0]=d[J>>0]|R<<Q;Q=O+P|0;if((S|0)==(O|0)){$=Q;break}else{S=S-O|0;R=R>>>O;P=Q}}if($>>>0<129)aa=$;else{I=66;break a}}else aa=p;P=a[k+(T<<2)+Z>>0]|0;if(V)ba=a[Y>>0]|0;else ba=d[X>>0]|0;if(ba>>>0>=33){I=72;break a}R=Hd(1,0,ba|0)|0;S=B;if(!(0<S>>>0|0==(S|0)&(P&255)>>>0<R>>>0)){I=72;break a}if(ba){R=ba;S=P&255;P=aa;while(1){Q=P&7;O=8-Q|0;J=O>>>0<R>>>0?O:R;O=b+(P>>>3)|0;a[O>>0]=d[O>>0]|S<<Q;Q=J+P|0;if((R|0)==(J|0)){ca=Q;break}else{R=R-J|0;S=S>>>J;P=Q}}if(ca>>>0<129)da=ca;else{I=76;break a}}else da=aa;T=T+1|0;if(T>>>0>=o>>>0){ea=da;break}else p=da}Z=Z+1|0;if(Z>>>0>=U>>>0){fa=ea;I=78;break}else W=ea}if((I|0)==62)oa(508584,474791,11245,508631);else if((I|0)==66)oa(508650,474791,11254,508631);else if((I|0)==72)oa(508584,474791,11245,508631);else if((I|0)==76)oa(508650,474791,11254,508631);else if((I|0)==78){b:do if(203>>>n&1){ea=(n|0)==1;W=fa;U=0;while(1){Z=c[l+(U<<3)>>2]|0;if(Z>>>0<2){ga=1;ha=Z;ia=W}else{I=82;break}while(1){Z=ia&7;da=8-Z|0;aa=da>>>0<ga>>>0?da:ga;da=b+(ia>>>3)|0;a[da>>0]=d[da>>0]|ha<<Z;Z=aa+ia|0;if((ga|0)==(aa|0)){ja=Z;break}else{ga=ga-aa|0;ha=ha>>>aa;ia=Z}}if(ja>>>0>=129){I=85;break}if(!ea){Z=c[l+(U<<3)+4>>2]|0;if(Z>>>0<2){ka=1;la=Z;ma=ja}else{I=88;break}while(1){Z=ma&7;aa=8-Z|0;da=aa>>>0<ka>>>0?aa:ka;aa=b+(ma>>>3)|0;a[aa>>0]=d[aa>>0]|la<<Z;Z=da+ma|0;if((ka|0)==(da|0)){na=Z;break}else{ka=ka-da|0;la=la>>>da;ma=Z}}if(na>>>0<129)pa=na;else{I=91;break}}else pa=ja;U=U+1|0;if(U>>>0>=o>>>0){qa=pa;break b}else W=pa}if((I|0)==82)oa(508584,474791,11245,508631);else if((I|0)==85)oa(508650,474791,11254,508631);else if((I|0)==88)oa(508584,474791,11245,508631);else if((I|0)==91)oa(508650,474791,11254,508631)}else qa=fa;while(0);fa=e+88|0;e=489772+n|0;pa=c[m>>2]|0;o=c[m+4>>2]|0;ja=c[m+8>>2]|0;m=489796+n|0;n=qa;qa=0;c:while(1){na=qa<<2;ma=n;la=0;while(1){ka=la+na|0;l=c[fa>>2]|0;ia=(l|0)==0;if(ia)ra=d[e>>0]|0;else ra=(d[m>>0]|0)-l|0;l=ra+(((ka|0)==(pa|0)|(ka|0)==(o|0)|(ka|0)==(ja|0))<<31>>31)|0;ha=a[(ia?g:h)+ka>>0]|0;if(l>>>0>=33){I=100;break c}ka=Hd(1,0,l|0)|0;ia=B;if(!(0<ia>>>0|0==(ia|0)&(ha&255)>>>0<ka>>>0)){I=100;break c}if(l){ka=l;l=ha&255;ha=ma;while(1){ia=ha&7;ga=8-ia|0;W=ga>>>0<ka>>>0?ga:ka;ga=b+(ha>>>3)|0;a[ga>>0]=d[ga>>0]|l<<ia;ia=W+ha|0;if((ka|0)==(W|0)){sa=ia;break}else{ka=ka-W|0;l=l>>>W;ha=ia}}if(sa>>>0<129)ta=sa;else{I=104;break c}}else ta=ma;la=la+1|0;if(la>>>0>=4){ua=ta;break}else ma=ta}qa=qa+1|0;if(qa>>>0>=4){va=ua;I=106;break}else n=ua}if((I|0)==100)oa(508584,474791,11245,508631);else if((I|0)==104)oa(508650,474791,11254,508631);else if((I|0)==106){d:do if(q){ua=va;n=0;e:while(1){qa=n<<2;ta=ua;sa=0;while(1){ra=sa+qa|0;ma=c[fa>>2]|0;la=(ma|0)==0;if(la)wa=d[m>>0]|0;else wa=(d[e>>0]|0)+ma|0;ma=wa+(((ra|0)==(pa|0)|(ra|0)==(o|0)|(ra|0)==(ja|0))<<31>>31)|0;na=a[(la?h:g)+ra>>0]|0;if(ma>>>0>=33){I=114;break e}ra=Hd(1,0,ma|0)|0;la=B;if(!(0<la>>>0|0==(la|0)&(na&255)>>>0<ra>>>0)){I=114;break e}if(ma){ra=ma;ma=na&255;na=ta;while(1){la=na&7;ha=8-la|0;l=ha>>>0<ra>>>0?ha:ra;ha=b+(na>>>3)|0;a[ha>>0]=d[ha>>0]|ma<<la;la=l+na|0;if((ra|0)==(l|0)){xa=la;break}else{ra=ra-l|0;ma=ma>>>l;na=la}}if(xa>>>0<129)ya=xa;else{I=118;break e}}else ya=ta;sa=sa+1|0;if(sa>>>0>=4){za=ya;break}else ta=ya}n=n+1|0;if(n>>>0>=4){Aa=za;break d}else ua=za}if((I|0)==114)oa(508584,474791,11245,508631);else if((I|0)==118)oa(508650,474791,11254,508631)}else Aa=va;while(0);if((Aa|0)==128){i=f;return}else oa(489804,474791,11424,489823)}}}function Mb(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;f=d[e>>0]|0;g=a[e+1>>0]|0;h=a[e+2>>0]|0;i=a[e+3>>0]|0;a[b>>0]=-4;a[b+1>>0]=-3;a[b+2>>0]=-1;a[b+3>>0]=-1;c[b+4>>2]=-1;c[b+8>>2]=0;c[b+12>>2]=0;e=16;j=f<<8|f;f=64;while(1){k=f&7;l=8-k|0;m=(l|0)<(e|0)?l:e;l=b+(f>>3)|0;a[l>>0]=d[l>>0]|0|j<<k;k=m+f|0;if((e|0)==(m|0)){n=k;break}else{e=e-m|0;j=j>>>m;f=k}}f=g&255;g=h&255;h=i&255;i=16;j=f<<8|f;f=n;while(1){n=f&7;e=8-n|0;k=(e|0)<(i|0)?e:i;e=b+(f>>3)|0;a[e>>0]=d[e>>0]|0|j<<n;n=k+f|0;if((i|0)==(k|0)){o=n;break}else{i=i-k|0;j=j>>>k;f=n}}f=16;j=g<<8|g;g=o;while(1){o=g&7;i=8-o|0;n=(i|0)<(f|0)?i:f;i=b+(g>>3)|0;a[i>>0]=d[i>>0]|0|j<<o;o=n+g|0;if((f|0)==(n|0)){p=o;break}else{f=f-n|0;j=j>>>n;g=o}}g=16;j=h<<8|h;h=p;while(1){p=h&7;f=8-p|0;o=(f|0)<(g|0)?f:g;f=b+(h>>3)|0;a[f>>0]=d[f>>0]|0|j<<p;if((g|0)==(o|0))break;else{g=g-o|0;j=j>>>o;h=o+h|0}}return}function Nb(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,F=0,G=0,H=0,I=0,J=0,K=0;g=i;i=i+32|0;h=g+20|0;j=g;k=g+24|0;if(f>>>0>=19)oa(489840,474791,11631,489871);l=e+20|0;m=(a[l>>0]|0)!=0?32:16;n=c[17372+(f<<2)>>2]|0;a[b>>0]=n;o=n>>>8;n=b+1|0;a[n>>0]=o;p=b+2|0;q=p;r=q+14|0;do{a[q>>0]=0;q=q+1|0}while((q|0)<(r|0));q=c[e>>2]|0;if(599186>>>q&1)oa(489887,474791,11646,489871);if(299592>>>q&1)oa(489887,474791,11646,489871);r=c[16704+(q*12|0)>>2]|0;q=e+4|0;s=o|(c[q>>2]<<3)+248;a[n>>0]=s;if((c[q>>2]|0)==1){o=c[e+12>>2]|0;a[n>>0]=s|o<<5;a[p>>0]=o>>>3;t=17}else{o=10;p=c[e+8>>2]|0;s=13;while(1){n=s&7;u=8-n|0;v=(u|0)<(o|0)?u:o;u=b+(s>>3)|0;a[u>>0]=d[u>>0]|p<<n;n=v+s|0;if((o|0)==(v|0)){w=n;break}else{o=o-v|0;p=p>>>v;s=n}}s=w&7;p=(c[e+12>>2]<<2&60)<<s;o=w>>3;n=b+o|0;a[n>>0]=p|d[n>>0];if((8-s|0)>>>0<6){s=b+(o+1)|0;a[s>>0]=d[s>>0]|p>>>8}t=w+6|0}do if(a[l>>0]|0){w=Z(r,m)|0;if((w+-24|0)>>>0<73){p=b+(126-w>>3)|0;a[p>>0]=d[p>>0]|c[e+16>>2]<<6;break}else oa(489994,474791,11669,489871)}while(0);l=Z((c[e+12>>2]>>2)+1|0,c[q>>2]|0)|0;if((l|0)>=10)oa(490049,474791,11676,489871);q=l<<1;p=d[476505+f>>0]|0;c[h>>2]=t;c[j>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;c[j+16>>2]=0;f=c[16704+(p*12|0)>>2]|0;if(!(599186>>>p&1))if(!(299592>>>p&1)){if((l|0)>0){l=(p&253|0)==1;p=t;t=0;while(1){if(l)x=p;else{w=p&7;s=d[e+21+t>>0]<<w;o=p>>3;n=j+o|0;a[n>>0]=d[n>>0]|s;if((8-w|0)>>>0<f>>>0){w=j+(o+1)|0;a[w>>0]=d[w>>0]|s>>>8}s=p+f|0;c[h>>2]=s;x=s}t=t+1|0;if((t|0)==(q|0))break;else p=x}}}else{y=3;z=23}else{y=5;z=23}a:do if((z|0)==23?(x=(y|0)==5,p=x?(q+4|0)/5|0:(q+2|0)/3|0,(p|0)>0):0){t=(1<<f)+-1|0;l=k+1|0;s=k+2|0;w=f<<1;o=f*3|0;n=o+7|0;v=(n|0)==0;u=f+3|0;A=w+3|0;B=w+5|0;w=o+5|0;o=~q;C=~y;D=0;while(1){E=Z(D,y)|0;F=E+o|0;a[k>>0]=0;a[k+1>>0]=0;a[k+2>>0]=0;a[k+3>>0]=0;a[k+4>>0]=0;G=q-E|0;if((((G|0)<(y|0)?G:y)|0)>0)Id(k|0,e+21+E|0,~((F|0)>(C|0)?F:C)|0)|0;if(!x){F=d[k>>0]|0;E=d[l>>0]|0;G=d[s>>0]|0;H=((E>>>f)*5|0)+(F>>>f)+((G>>>f)*25|0)|0;if((H|0)>=125)break;I=d[508713+H>>0]|0;if(!v){H=n;J=(E&t)<<u|F&t|(G&t)<<B|(I&7)<<f|(I>>>3&3)<<A|(I>>>5&3)<<w;I=c[h>>2]|0;while(1){G=I&7;F=8-G|0;E=(F|0)<(H|0)?F:H;F=j+(I>>3)|0;a[F>>0]=d[F>>0]|J<<G;G=E+I|0;if((H|0)==(E|0)){K=G;break}else{H=H-E|0;J=J>>>E;I=G}}c[h>>2]=K}}else mc(j,k,h,f);D=D+1|0;if((D|0)>=(p|0))break a}oa(508681,474791,11571,508694)}while(0);c[b>>2]=c[b>>2]|c[j>>2];f=b+4|0;c[f>>2]=c[f>>2]|c[j+4>>2];f=b+8|0;c[f>>2]=c[f>>2]|c[j+8>>2];f=b+12|0;c[f>>2]=c[f>>2]|c[j+12>>2];switch(r|0){case 1:{r=0;do{j=127-r|0;f=b+(j>>>3)|0;a[f>>0]=d[f>>0]|d[e+39+r>>0]<<(j&7);r=r+1|0}while((r|0)<(m|0));i=g;return 1}case 2:{r=0;do{j=126-(r<<1)|0;f=b+(j>>>3)|0;a[f>>0]=d[f>>0]|d[506892+(d[e+39+r>>0]|0)>>0]<<(j&6);r=r+1|0}while((r|0)<(m|0));i=g;return 1}case 3:{r=0;while(1){j=(Z(r,-3)|0)+125|0;f=d[490068+(d[e+39+r>>0]|0)>>0]<<(j&7);h=j>>>3;if(j>>>0>=128){z=45;break}j=h+1|0;k=b+h|0;a[k>>0]=d[k>>0]|f;if(j>>>0<16){k=b+j|0;a[k>>0]=d[k>>0]|f>>>8}r=r+1|0;if((r|0)>=(m|0)){z=59;break}}if((z|0)==45)oa(490076,474791,11717,489871);else if((z|0)==59){i=g;return 1}break}case 4:{r=0;while(1){f=124-(r<<2)|0;if((f|0)<=-1){z=51;break}k=f>>3;if((k|0)>=16){z=51;break}j=b+k|0;a[j>>0]=d[j>>0]|d[490087+(d[e+39+r>>0]|0)>>0]<<(f&4);r=r+1|0;if((r|0)>=(m|0)){z=59;break}}if((z|0)==51)oa(490103,474791,11731,489871);else if((z|0)==59){i=g;return 1}break}case 5:{r=0;while(1){f=(Z(r,-5)|0)+123|0;j=d[490131+(d[e+39+r>>0]|0)>>0]<<(f&7);k=f>>>3;if(f>>>0>=128){z=54;break}f=k+1|0;h=b+k|0;a[h>>0]=d[h>>0]|j;if(f>>>0<16){h=b+f|0;a[h>>0]=d[h>>0]|j>>>8}r=r+1|0;if((r|0)>=(m|0)){z=59;break}}if((z|0)==54)oa(490076,474791,11747,489871);else if((z|0)==59){i=g;return 1}break}default:oa(475191,474791,11756,489871)}return 0}function Ob(b,f,g,h){b=b|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,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,_=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,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;j=i;i=i+48|0;k=j;l=j+32|0;m=d[b>>0]&127;n=a[490179+m>>0]|0;o=n&255;if((m|0)==69){p=0;i=j;return p|0}c[f+104>>2]=o;m=c[16544+(o<<3)+4>>2]|0;if(n<<24>>24==8){q=m>>>3;r=m&7;s=(d[b+q>>0]|0)>>>r;t=8-r|0;if(t>>>0>7)u=s;else u=d[b+(q+1)>>0]<<t|s;s=m+8|0;t=f+112|0;a[t>>0]=u;if(s>>>0>=112)oa(508858,474791,11855,508838);u=s>>>3;q=s&7;s=(d[b+u>>0]|0)>>>q;r=8-q|0;if(r>>>0>7)v=s;else v=d[b+(u+1)>>0]<<r|s;s=m+16|0;a[t+1>>0]=v;if(s>>>0>=112)oa(508858,474791,11855,508838);v=s>>>3;r=s&7;s=(d[b+v>>0]|0)>>>r;u=8-r|0;if(u>>>0>7)w=s;else w=d[b+(v+1)>>0]<<u|s;s=m+24|0;a[t+2>>0]=w;if(s>>>0>=112)oa(508858,474791,11855,508838);w=s>>>3;u=s&7;s=(d[b+w>>0]|0)>>>u;v=8-u|0;if(v>>>0>7)x=s;else x=d[b+(w+1)>>0]<<v|s;s=m+32|0;a[t+3>>0]=x;if(!h){p=1;i=j;return p|0}a[f+118>>0]=0;x=m+33|0;a[f+119>>0]=(d[b+(s>>>3)>>0]&1<<(s&7)|0)!=0&1;if(x>>>0>=112)oa(508858,474791,11855,508838);s=x>>>3;t=x&7;x=(d[b+s>>0]|0)>>>t;v=8-t|0;if(v>>>0>2)y=x;else y=d[b+(s+1)>>0]<<v|x;x=m+36|0;c[f+120>>2]=y&7;c[f+124>>2]=0;if(x>>>0>=112)oa(508858,474791,11855,508838);y=x>>>3;v=x&7;x=(d[b+y>>0]|0)>>>v;s=8-v|0;if(s>>>0>1)z=x;else z=d[b+(y+1)>>0]<<s|x;x=m+38|0;c[f+136>>2]=z&3;if(x>>>0>=112)oa(508858,474791,11855,508838);z=x>>>3;s=x&7;x=(d[b+z>>0]|0)>>>s;y=8-s|0;if(y>>>0>4)A=x;else A=d[b+(z+1)>>0]<<y|x;x=m+43|0;c[f+140>>2]=A&31;if(x>>>0>=112)oa(508858,474791,11855,508838);A=x>>>3;y=x&7;x=(d[b+A>>0]|0)>>>y;z=8-y|0;if(z>>>0>4)C=x;else C=d[b+(A+1)>>0]<<z|x;x=m+48|0;c[f+144>>2]=C&31;if(x>>>0>=112)oa(508858,474791,11855,508838);C=x>>>3;z=x&7;x=(d[b+C>>0]|0)>>>z;A=8-z|0;if(A>>>0>4)D=x;else D=d[b+(C+1)>>0]<<A|x;c[f+148>>2]=D&31;c[f+128>>2]=0;c[f+132>>2]=0;p=1;i=j;return p|0}do if(h){D=m+1|0;a[f+116>>0]=(d[b+(m>>>3)>>0]&1<<(m&7)|0)!=0&1;x=(516863>>>o&1|0)==0;if(x){E=0;F=D}else{E=(d[b+(D>>>3)>>0]&1<<(D&7)|0)!=0&1;F=m+2|0}a[f+117>>0]=E;D=F+1|0;a[f+118>>0]=(d[b+(F>>>3)>>0]&1<<(F&7)|0)!=0&1;A=F+2|0;a[f+119>>0]=(d[b+(D>>>3)>>0]&1<<(D&7)|0)!=0&1;if(A>>>0>=112)oa(508858,474791,11855,508838);D=A>>>3;C=A&7;A=(d[b+D>>0]|0)>>>C;z=8-C|0;if(z>>>0>2)G=A;else G=d[b+(D+1)>>0]<<z|A;A=F+5|0;c[f+120>>2]=G&7;if(A>>>0>=112)oa(508858,474791,11855,508838);z=A>>>3;D=A&7;A=(d[b+z>>0]|0)>>>D;C=8-D|0;if(C>>>0>2)H=A;else H=d[b+(z+1)>>0]<<C|A;A=F+8|0;c[f+124>>2]=H&7;if(x){c[f+128>>2]=0;I=A}else{if(A>>>0>=112)oa(508858,474791,11855,508838);x=A>>>3;C=A&7;A=(d[b+x>>0]|0)>>>C;z=8-C|0;if(z>>>0>4)J=A;else J=d[b+(x+1)>>0]<<z|A;c[f+128>>2]=J&31;I=F+13|0}if((o+-8|0)>>>0>=10){c[f+132>>2]=0;K=I;break}if(I>>>0>=112)oa(508858,474791,11855,508838);A=I>>>3;z=I&7;x=(d[b+A>>0]|0)>>>z;C=8-z|0;if(C>>>0>7)L=x;else L=d[b+(A+1)>>0]<<C|x;c[f+132>>2]=L&255;K=I+8|0}else K=(d[490307+o>>0]|0)+m|0;while(0);switch(o|0){case 16:case 9:case 7:case 4:case 2:{if(K>>>0>=112)oa(508858,474791,11855,508838);m=K>>>3;I=K&7;L=(d[b+m>>0]|0)>>>I;F=8-I|0;if(F>>>0>4)M=L;else M=d[b+(m+1)>>0]<<F|L;c[f+108>>2]=M&31;N=K+5|0;O=2;break}case 3:{if(K>>>0>=112)oa(508858,474791,11855,508838);M=K>>>3;L=K&7;F=(d[b+M>>0]|0)>>>L;m=8-L|0;if(m>>>0>3)P=F;else P=d[b+(M+1)>>0]<<m|F;c[f+108>>2]=P&15;N=K+4|0;O=3;break}default:{N=K;O=1}}a:do switch(o|0){case 16:case 9:case 4:case 2:{K=c[f+108>>2]|0;if(K>>>0>29){p=0;i=j;return p|0}else{Q=e[19252+(K*6|0)+2>>1]|0;R=83;break a}break}case 3:{K=c[f+108>>2]|0;if(K>>>0>10){p=0;i=j;return p|0}else{S=N;T=e[19546+(K*6|0)+2>>1]|0;U=1;break a}break}case 7:{K=c[f+108>>2]|0;if(K>>>0>18){p=0;i=j;return p|0}else{S=N;T=e[19432+(K*6|0)+2>>1]|0;U=1;break a}break}default:{Q=0;R=83}}while(0);b:do if((R|0)==83){switch(o|0){case 13:case 11:case 6:break;case 17:{c[f+16>>2]=3;S=N;T=Q;U=2;break b;break}default:{S=N;T=Q;U=1;break b}}if(N>>>0>=112)oa(508858,474791,11855,508838);K=N>>>3;P=N&7;F=(d[b+K>>0]|0)>>>P;m=8-P|0;if(m>>>0>1)V=F;else V=d[b+(K+1)>>0]<<m|F;c[f+16>>2]=V&3;S=N+2|0;T=Q;U=2}while(0);Q=(U|0)==2;a[f+20>>0]=Q&1;c[f+4>>2]=O;c[f+8>>2]=T;T=d[476562+o>>0]|0;N=d[476467+o>>0]|0;c[f>>2]=d[476486+o>>0];V=T<<1;F=Z(V,O)|0;m=d[476505+o>>0]|0;c[f+12>>2]=d[490326+o>>0];K=c[16704+(m*12|0)>>2]|0;P=599186>>>m&1;M=(P|0)!=0;if(!M)if(!(299592>>>m&1)){W=S;X=1;Y=0;_=0;$=0}else{aa=3;ba=5;ca=((F+2|0)>>>0)/3|0;R=94}else{aa=5;ba=3;ca=((F+4|0)>>>0)/5|0;R=94}c:do if((R|0)==94){L=(ca|0)==0;if(!L){I=P+7|0;J=ca+-1|0;H=F-(Z(J,aa)|0)|0;G=(299592>>>m&1|0)==0;E=I>>>0<10;h=S;x=0;while(1){d:do if((x|0)==(J|0)){if(!M){if(G){R=107;break}switch(H|0){case 1:{da=3;break d;break}case 2:break;default:{R=107;break d}}da=5;break}switch(H|0){case 1:{da=2;break d;break}case 2:{da=4;break d;break}case 3:{da=5;break d;break}case 4:{da=7;break d;break}default:{R=107;break d}}}else R=107;while(0);if((R|0)==107){R=0;if(E)da=I;else{R=108;break}}if(h>>>0>=112){R=110;break}C=h>>>3;A=h&7;z=(d[b+C>>0]|0)>>>A;D=8-A|0;A=(D|0)>(da|0)?da:D;if((A|0)==(da|0))ea=z;else ea=d[b+(C+1)>>0]<<A|z;z=da+h|0;c[k+(x<<2)>>2]=ea&(1<<da)+-1;x=x+1|0;if(x>>>0>=ca>>>0){W=z;X=L;Y=aa;_=ba;$=ca;break c}else h=z}if((R|0)==108)oa(508667,474791,11852,508838);else if((R|0)==110)oa(508858,474791,11855,508838)}else{W=S;X=1;Y=aa;_=ba;$=0}}while(0);e:do if(F){ba=(m&253|0)==1;aa=(1<<K)+-1|0;S=W;ca=0;da=0;ea=0;M=0;while(1){if(ba){fa=0;ga=S}else{if(S>>>0>=112){R=116;break}P=S>>>3;h=S&7;L=(d[b+P>>0]|0)>>>h;x=8-h|0;h=(x|0)>(K|0)?K:x;if((h|0)==(K|0))ha=L;else ha=d[b+(P+1)>>0]<<h|L;fa=ha&aa;ga=S+K|0}if(X){ia=ca;ja=da;ka=M;la=fa}else{if(!da){if(M>>>0>=$>>>0){R=123;break}ma=c[k+(M<<2)>>2]|0;na=Y;pa=M+1|0}else{ma=ca;na=da;pa=M}ia=(ma>>>0)/(_>>>0)|0;ja=na+-1|0;ka=pa;la=((ma>>>0)%(_>>>0)|0)<<K|fa}a[f+21+ea>>0]=la;ea=ea+1|0;if(ea>>>0>=F>>>0){qa=ga;break e}else{S=ga;ca=ia;da=ja;M=ka}}if((R|0)==116)oa(508858,474791,11855,508838);else if((R|0)==123)oa(490345,474791,12117,490371)}else qa=W;while(0);W=c[f+108>>2]|0;do if(O>>>0>1){if((O|0)==3){ra=475807+(W<<4)|0;sa=476377+(W*3|0)|0;R=133;break}if(n<<24>>24==7){ta=475983+(W<<4)|0;ua=476410+(W*3|0)|0;R=141;break}else{ra=475327+(W<<4)|0;sa=476287+(W*3|0)|0;R=133;break}}else{ra=490163;sa=490163;R=133}while(0);f:do if((R|0)==133)if(n<<24>>24==18){W=qa;ka=0;while(1){ja=(((ka|0)==0)<<31>>31)+N|0;if(ja>>>0>=10)break;if(!ja){va=0;wa=W}else{ia=W>>>3;ga=W&7;F=(d[b+ia>>0]|0)>>>ga;la=8-ga|0;ga=(la|0)>(ja|0)?ja:la;if((ga|0)==(ja|0))xa=F;else xa=d[b+(ia+1)>>0]<<ga|F;va=xa&(1<<ja)+-1;wa=ja+W|0}a[f+39+ka>>0]=va;ka=ka+1|0;if(ka>>>0>=16){ya=ra;break f}else W=wa}oa(508667,474791,11799,508875)}else{ta=ra;ua=sa;R=141}while(0);g:do if((R|0)==141){sa=128-qa|0;ra=(sa|0)<64?sa:64;if(ra>>>0>=65)oa(508891,474791,11829,508907);if(!ra){za=0;Aa=0}else{sa=qa;wa=0;va=0;xa=0;while(1){n=sa&7;W=ra-xa|0;ka=8-n|0;ja=(W|0)<(ka|0)?W:ka;ka=Hd((1<<ja)+-1&(d[b+(sa>>>3)>>0]|0)>>>n|0,0,xa|0)|0;n=ka|wa;ka=B|va;xa=ja+xa|0;if(xa>>>0>=ra>>>0){za=n;Aa=ka;break}else{sa=ja+sa|0;wa=n;va=ka}}}va=(1<<N)+-1|0;wa=N+-1|0;sa=(1<<wa)+-1|0;if(Q){a[f+39>>0]=za&sa;ra=Gd(za|0,Aa|0,wa|0)|0;a[f+40>>0]=ra&sa;ra=wa<<1;xa=2;while(1){ka=Gd(za|0,Aa|0,ra|0)|0;a[f+39+xa>>0]=ka&va;xa=xa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else Ba=g;o=o+1|0;if(o>>>0>=O>>>0)break;else g=Ba}if(!Ba){p=1;i=j;return p|0}Ba=(1<<N)+-1|0;N=0;do{if((a[l+(d[ya+N>>0]|0)>>0]|0)!=0?(g=Z(N,U)|0,O=f+39+g|0,a[O>>0]=Ba-(d[O>>0]|0),Q):0){O=g+1+(f+39)|0;a[O>>0]=Ba-(d[O>>0]|0)}N=N+1|0}while((N|0)!=16);p=1;i=j;return p|0}function Pb(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,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;k=i;i=i+416|0;l=k+384|0;m=k;if((b|0)==8){c[h>>2]=c[f>>2];c[h+4>>2]=c[f>>2];c[h+8>>2]=c[f>>2];c[h+12>>2]=c[f>>2];c[h+16>>2]=c[f>>2];c[h+20>>2]=c[f>>2];c[h+24>>2]=c[f>>2];c[h+28>>2]=c[f>>2];c[h+32>>2]=c[f>>2];c[h+36>>2]=c[f>>2];c[h+40>>2]=c[f>>2];c[h+44>>2]=c[f>>2];c[h+48>>2]=c[f>>2];c[h+52>>2]=c[f>>2];c[h+56>>2]=c[f>>2];c[h+60>>2]=c[f>>2];i=k;return 1}f=d[476524+b>>0]|0;n=(b+-8|0)>>>0>6;o=n?d[476562+b>>0]|0:4;p=d[476505+b>>0]|0;q=d[476467+b>>0]|0;r=1<<q;s=o<<1;t=0;a:do{switch(o|0){case 2:{u=Z(s,t)|0;v=a[476581+(p<<9)+((d[g+21+u>>0]|0)<<1)>>0]|0;w=a[476581+(p<<9)+((d[(u|1)+(g+21)>>0]|0)<<1)>>0]|0;x=a[476581+(p<<9)+((d[u+2+(g+21)>>0]|0)<<1)>>0]|0;y=a[476581+(p<<9)+((d[u+3+(g+21)>>0]|0)<<1)>>0]|0;u=l+(t<<3)|0;a[u>>0]=v;a[u+1>>0]=v;a[u+2>>0]=v;a[u+3>>0]=x;x=l+(t<<3)+4|0;a[x>>0]=w;a[x+1>>0]=w;a[x+2>>0]=w;a[x+3>>0]=y;break}case 0:{z=7;break}default:{y=Z(t,o)|0;x=l+(t<<3)|0;w=l+(t<<3)+4|0;u=0;while(1){v=u+y<<1;if(u>>>0>=4){z=10;break a}a[x+u>>0]=a[476581+(p<<9)+((d[g+21+v>>0]|0)<<1)>>0]|0;a[w+u>>0]=a[476581+(p<<9)+((d[(v|1)+(g+21)>>0]|0)<<1)>>0]|0;u=u+1|0;if(u>>>0>=o>>>0){z=7;break}}}}if((z|0)==7?(z=0,n):0){u=l+(t<<3)|0;w=l+(t<<3)+4|0;x=o;do{a[u+x>>0]=-1;a[w+x>>0]=-1;x=x+1|0}while(x>>>0<4)}t=t+1|0}while(t>>>0<f>>>0);if((z|0)==10)oa(499375,499239,685,499383);t=c[17448+(q<<2)>>2]|0;q=0;b:do{n=l+(q<<3)|0;p=l+(q<<3)+4|0;s=0;do{x=m+(q<<7)+(s<<2)|0;switch(o|0){case 2:{w=c[n>>2]|0;u=w&255;y=c[p>>2]|0;v=y&255;A=c[t+(s<<2)>>2]|0;B=u<<8;C=w>>>24;w=y>>>24;if(j){D=B|128;E=v<<8|128}else{D=B|u;E=v<<8|v}v=64-A|0;u=((Z(E,A)|0)+32+(Z(D,v)|0)|0)>>>14;B=C<<8;if(j){F=B|128;G=w<<8|128}else{F=B|C;G=w<<8|w}w=((Z(G,A)|0)+32+(Z(F,v)|0)|0)>>>14;v=u&255;a[x>>0]=v;a[x+1>>0]=v;a[x+2>>0]=v;a[x+3>>0]=w;break}case 0:{H=0;z=26;break}default:{w=t+(s<<2)|0;v=0;while(1){if(v>>>0>=4){z=28;break b}u=d[n+v>>0]|0;A=d[p+v>>0]|0;C=c[w>>2]|0;B=u<<8;if(j){I=B|128;J=A<<8|128}else{I=B|u;J=A<<8|A}a[x+v>>0]=((Z(J,C)|0)+32+(Z(I,64-C|0)|0)|0)>>>14;C=v+1|0;if(C>>>0<o>>>0)v=C;else{K=C;break}}if(K>>>0<4){H=K;z=26}}}if((z|0)==26){z=0;Fd(x+H|0,-1,4-H|0)|0}s=s+1|0}while(s>>>0<r>>>0);q=q+1|0}while(q>>>0<f>>>0);if((z|0)==28)oa(499375,499239,685,499383);c:do if(!(66204>>>b&1))L=490163;else switch(b|0){case 3:{L=475807+(e<<4)|0;break c;break}case 7:{L=475983+(e<<4)|0;break c;break}default:{L=475327+(e<<4)|0;break c}}while(0);e=(457827>>>b&1|0)!=0;d:do if(382655>>>b&1)if(e){z=0;while(1){f=d[g+39+z>>0]|0;if(f>>>0>=r>>>0)break;c[h+(z<<2)>>2]=c[m+(f<<2)>>2];z=z+1|0;if(z>>>0>=16)break d}oa(490384,474791,12438,490371)}else{z=0;while(1){f=d[g+39+z>>0]|0;if(f>>>0>=r>>>0)break;c[h+(z<<2)>>2]=c[m+((d[L+z>>0]|0)<<7)+(f<<2)>>2];z=z+1|0;if(z>>>0>=16)break d}oa(490384,474791,12446,490371)}else{if(!e)oa(490418,474791,12453,490371);z=g+16|0;f=0;while(1){q=f<<1;H=d[g+39+q>>0]|0;K=d[(q|1)+(g+39)>>0]|0;if(!(H>>>0<r>>>0&K>>>0<r>>>0))break;q=h+(f<<2)|0;o=m+(K<<2)|0;K=m+(H<<2)|0;if(!(c[z>>2]|0))a[q>>0]=a[o>>0]|0;else a[q>>0]=a[K>>0]|0;if((c[z>>2]|0)==1)a[q+1>>0]=a[o+1>>0]|0;else a[q+1>>0]=a[K+1>>0]|0;if((c[z>>2]|0)==2)a[q+2>>0]=a[o+2>>0]|0;else a[q+2>>0]=a[K+2>>0]|0;if((c[z>>2]|0)==3)a[q+3>>0]=a[o+3>>0]|0;else a[q+3>>0]=a[K+3>>0]|0;f=f+1|0;if(f>>>0>=16)break d}oa(490437,474791,12462,490371)}while(0);i=k;return 1}
-function Qb(b,f){b=b|0;f=f|0;var h=0,j=0,k=0,l=0,m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<<9)+(d[b+25>>0]<<1)>>0]|0)/255.0;g[k>>2]=+(d[476581+(K<<9)+(d[b+22>>0]<<1)>>0]|0)/255.0;g[k+4>>2]=+(d[476581+(K<<9)+(d[b+24>>0]<<1)>>0]|0)/255.0;g[k+8>>2]=+(d[476581+(K<<9)+(d[b+26>>0]<<1)>>0]|0)/255.0;O=J+-8|0;if(O>>>0<7){g[j+12>>2]=+(d[476581+(K<<9)+(d[b+27>>0]<<1)>>0]|0)/255.0;g[k+12>>2]=+(d[476581+(K<<9)+(d[b+28>>0]<<1)>>0]|0)/255.0;P=O;Q=k;break}else{g[j+12>>2]=1.0;g[k+12>>2]=1.0;P=O;Q=k;break}}else{R=+(d[476581+(K<<9)+(d[b+22>>0]<<1)>>0]|0)/255.0;g[k>>2]=R;g[j+4>>2]=N;g[k+4>>2]=R;g[j+8>>2]=N;g[k+8>>2]=R;g[j+12>>2]=+(d[476581+(K<<9)+(d[b+23>>0]<<1)>>0]|0)/255.0;g[k+12>>2]=+(d[476581+(K<<9)+(d[b+24>>0]<<1)>>0]|0)/255.0;P=J+-8|0;Q=k}while(0);Rb(M?4:L,7,j,Q,m,n,l);O=f+40|0;S=c[m>>2]|0;a[O>>0]=S;a[O+1>>0]=S>>8;a[O+2>>0]=S>>16;a[O+3>>0]=S>>24;S=f+52|0;O=c[n>>2]|0;a[S>>0]=O;a[S+1>>0]=O>>8;a[S+2>>0]=O>>16;a[S+3>>0]=O>>24;if(P>>>0>9){a[f+43>>0]=127;a[f+55>>0]=127}c[f+64>>2]=c[l>>2];c[f+68>>2]=c[l+4>>2];switch(J|0){case 18:{a[f+8>>0]=a[490500+(d[b+39>>0]|0)>>0]|0;a[f+9>>0]=a[490500+(d[b+40>>0]|0)>>0]|0;a[f+10>>0]=a[490500+(d[b+41>>0]|0)>>0]|0;a[f+11>>0]=a[490500+(d[b+42>>0]|0)>>0]|0;a[f+12>>0]=a[490500+(d[b+43>>0]|0)>>0]|0;a[f+13>>0]=a[490500+(d[b+44>>0]|0)>>0]|0;a[f+14>>0]=a[490500+(d[b+45>>0]|0)>>0]|0;a[f+15>>0]=a[490500+(d[b+46>>0]|0)>>0]|0;a[f+16>>0]=a[490500+(d[b+47>>0]|0)>>0]|0;a[f+17>>0]=a[490500+(d[b+48>>0]|0)>>0]|0;a[f+18>>0]=a[490500+(d[b+49>>0]|0)>>0]|0;a[f+19>>0]=a[490500+(d[b+50>>0]|0)>>0]|0;a[f+20>>0]=a[490500+(d[b+51>>0]|0)>>0]|0;a[f+21>>0]=a[490500+(d[b+52>>0]|0)>>0]|0;a[f+22>>0]=a[490500+(d[b+53>>0]|0)>>0]|0;a[f+23>>0]=a[490500+(d[b+54>>0]|0)>>0]|0;T=1;i=h;return T|0}case 14:{a[f+8>>0]=a[490532+(d[b+39>>0]|0)>>0]|0;a[f+9>>0]=a[490532+(d[b+40>>0]|0)>>0]|0;a[f+10>>0]=a[490532+(d[b+41>>0]|0)>>0]|0;a[f+11>>0]=a[490532+(d[b+42>>0]|0)>>0]|0;a[f+12>>0]=a[490532+(d[b+43>>0]|0)>>0]|0;a[f+13>>0]=a[490532+(d[b+44>>0]|0)>>0]|0;a[f+14>>0]=a[490532+(d[b+45>>0]|0)>>0]|0;a[f+15>>0]=a[490532+(d[b+46>>0]|0)>>0]|0;a[f+16>>0]=a[490532+(d[b+47>>0]|0)>>0]|0;a[f+17>>0]=a[490532+(d[b+48>>0]|0)>>0]|0;a[f+18>>0]=a[490532+(d[b+49>>0]|0)>>0]|0;a[f+19>>0]=a[490532+(d[b+50>>0]|0)>>0]|0;a[f+20>>0]=a[490532+(d[b+51>>0]|0)>>0]|0;a[f+21>>0]=a[490532+(d[b+52>>0]|0)>>0]|0;a[f+22>>0]=a[490532+(d[b+53>>0]|0)>>0]|0;a[f+23>>0]=a[490532+(d[b+54>>0]|0)>>0]|0;T=1;i=h;return T|0}case 5:case 12:{a[f+8>>0]=a[490536+(d[b+39>>0]|0)>>0]|0;a[f+9>>0]=a[490536+(d[b+40>>0]|0)>>0]|0;a[f+10>>0]=a[490536+(d[b+41>>0]|0)>>0]|0;a[f+11>>0]=a[490536+(d[b+42>>0]|0)>>0]|0;a[f+12>>0]=a[490536+(d[b+43>>0]|0)>>0]|0;a[f+13>>0]=a[490536+(d[b+44>>0]|0)>>0]|0;a[f+14>>0]=a[490536+(d[b+45>>0]|0)>>0]|0;a[f+15>>0]=a[490536+(d[b+46>>0]|0)>>0]|0;a[f+16>>0]=a[490536+(d[b+47>>0]|0)>>0]|0;a[f+17>>0]=a[490536+(d[b+48>>0]|0)>>0]|0;a[f+18>>0]=a[490536+(d[b+49>>0]|0)>>0]|0;a[f+19>>0]=a[490536+(d[b+50>>0]|0)>>0]|0;a[f+20>>0]=a[490536+(d[b+51>>0]|0)>>0]|0;a[f+21>>0]=a[490536+(d[b+52>>0]|0)>>0]|0;a[f+22>>0]=a[490536+(d[b+53>>0]|0)>>0]|0;a[f+23>>0]=a[490536+(d[b+54>>0]|0)>>0]|0;T=1;i=h;return T|0}default:{a[f+8>>0]=a[b+39>>0]|0;a[f+9>>0]=a[b+40>>0]|0;a[f+10>>0]=a[b+41>>0]|0;a[f+11>>0]=a[b+42>>0]|0;a[f+12>>0]=a[b+43>>0]|0;a[f+13>>0]=a[b+44>>0]|0;a[f+14>>0]=a[b+45>>0]|0;a[f+15>>0]=a[b+46>>0]|0;a[f+16>>0]=a[b+47>>0]|0;a[f+17>>0]=a[b+48>>0]|0;a[f+18>>0]=a[b+49>>0]|0;a[f+19>>0]=a[b+50>>0]|0;a[f+20>>0]=a[b+51>>0]|0;a[f+21>>0]=a[b+52>>0]|0;a[f+22>>0]=a[b+53>>0]|0;a[f+23>>0]=a[b+54>>0]|0;T=1;i=h;return T|0}}break}case 1:{c[f>>2]=3;g[o>>2]=+(d[b+21>>0]|0)/255.0;g[o+4>>2]=+(d[b+23>>0]|0)/255.0;g[o+8>>2]=+(d[b+25>>0]|0)/255.0;g[o+12>>2]=1.0;g[p>>2]=+(d[b+22>>0]|0)/255.0;g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|0;a[f+15>>0]=a[b+46>>0]|0;a[f+16>>0]=a[b+47>>0]|0;a[f+17>>0]=a[b+48>>0]|0;a[f+18>>0]=a[b+49>>0]|0;a[f+19>>0]=a[b+50>>0]|0;a[f+20>>0]=a[b+51>>0]|0;a[f+21>>0]=a[b+52>>0]|0;a[f+22>>0]=a[b+53>>0]|0;a[f+23>>0]=a[b+54>>0]|0;T=1;i=h;return T|0}case 3:{c[f>>2]=2;U=c[b+108>>2]|0;c[f+4>>2]=d[19546+(U*6|0)>>0];ga=d[19546+(U*6|0)+4>>0]|0;U=0;do{fa=U*6|0;ea=d[475309+(ga*3|0)+U>>0]|0;da=((((d[476581+(K<<9)+(d[(fa|1)+(b+21)>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+40+(ea<<2)>>0]=((((d[476581+(K<<9)+(d[b+21+fa>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+52+(ea<<2)>>0]=da;da=((((d[476581+(K<<9)+(d[fa+3+(b+21)>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+40+(ea<<2)+1>>0]=((((d[476581+(K<<9)+(d[fa+2+(b+21)>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+52+(ea<<2)+1>>0]=da;da=((((d[476581+(K<<9)+(d[fa+5+(b+21)>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+40+(ea<<2)+2>>0]=((((d[476581+(K<<9)+(d[fa+4+(b+21)>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+52+(ea<<2)+2>>0]=da;U=U+1|0}while((U|0)!=3);a[f+8>>0]=a[b+39>>0]|0;a[f+9>>0]=a[b+40>>0]|0;a[f+10>>0]=a[b+41>>0]|0;a[f+11>>0]=a[b+42>>0]|0;a[f+12>>0]=a[b+43>>0]|0;a[f+13>>0]=a[b+44>>0]|0;a[f+14>>0]=a[b+45>>0]|0;a[f+15>>0]=a[b+46>>0]|0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<2)+3>>0]=127;c[f+64+(aa<<3)>>2]=c[z>>2];c[f+64+(aa<<3)+4>>2]=c[U>>2];ca=ca+1|0}while((ca|0)!=2);a[f+8>>0]=a[b+39>>0]|0;a[f+9>>0]=a[b+40>>0]|0;a[f+10>>0]=a[b+41>>0]|0;a[f+11>>0]=a[b+42>>0]|0;a[f+12>>0]=a[b+43>>0]|0;a[f+13>>0]=a[b+44>>0]|0;a[f+14>>0]=a[b+45>>0]|0;a[f+15>>0]=a[b+46>>0]|0;a[f+16>>0]=a[b+47>>0]|0;a[f+17>>0]=a[b+48>>0]|0;a[f+18>>0]=a[b+49>>0]|0;a[f+19>>0]=a[b+50>>0]|0;a[f+20>>0]=a[b+51>>0]|0;a[f+21>>0]=a[b+52>>0]|0;a[f+22>>0]=a[b+53>>0]|0;a[f+23>>0]=a[b+54>>0]|0;T=1;i=h;return T|0}case 17:case 13:case 11:case 6:{c[f>>2]=5;ca=b+16|0;U=c[ca>>2]|0;c[f+92>>2]=U+1&3;do if((J+-15|0)>>>0<3)if((U|0)==3){S=(((((d[476581+(K<<9)+(d[b+21>>0]<<1)>>0]|0)*127|0)+127|0)>>>0)/255|0)&255;a[f+40>>0]=S;fa=(((((d[476581+(K<<9)+(d[b+22>>0]<<1)>>0]|0)*127|0)+127|0)>>>0)/255|0)&255;a[f+52>>0]=fa;a[f+41>>0]=S;a[f+53>>0]=fa;a[f+42>>0]=S;a[f+54>>0]=fa;a[f+43>>0]=a[476581+(K<<9)+(d[b+23>>0]<<1)>>0]|0;a[f+55>>0]=a[476581+(K<<9)+(d[b+24>>0]<<1)>>0]|0;$a=0;break}else oa(490544,474791,12916,490579);else{fa=U;S=0;while(1){ea=(S|0)==(fa|0)?3:(S|0)==3?fa:S;if(S>>>0<L>>>0){da=S<<1;ab=d[476581+(K<<9)+(d[(da|1)+(b+21)>>0]<<1)>>0]|0;bb=d[476581+(K<<9)+(d[b+21+da>>0]<<1)>>0]|0}else{ab=255;bb=255}if(ea>>>0<3){cb=(((ab*127|0)+127|0)>>>0)/255|0;db=(((bb*127|0)+127|0)>>>0)/255|0}else{cb=ab;db=bb}a[f+40+ea>>0]=db;a[f+52+ea>>0]=cb;ea=S+1|0;if((ea|0)==4)break;fa=c[ca>>2]|0;S=ea}if((J|0)==13){S=0;do{fa=S<<1;a[f+8+S>>0]=(a[b+39+fa>>0]|0)!=0?3:0;a[f+24+S>>0]=(a[(fa|1)+(b+39)>>0]|0)!=0?3:0;S=S+1|0}while((S|0)!=16);T=1;i=h;return T|0}else $a=0}while(0);do{ca=$a<<1;a[f+8+$a>>0]=a[b+39+ca>>0]|0;a[f+24+$a>>0]=a[(ca|1)+(b+39)>>0]|0;$a=$a+1|0}while(($a|0)!=16);T=1;i=h;return T|0}case 7:{c[f>>2]=2;ca=c[b+108>>2]|0;c[f+4>>2]=d[19432+(ca*6|0)>>0];U=d[19432+(ca*6|0)+4>>0]|0;ca=U>>>1;S=(U&1|0)==0;U=0;do{switch(ca|0){case 0:{eb=U>>>0>1&1;break}case 1:{eb=(U|0)!=0&1;break}case 2:{eb=(U&-3|0)!=0&1;break}default:eb=U}fa=(S?eb:1-eb|0)*6|0;a[f+40+(U<<2)>>0]=((((d[476581+(K<<9)+(d[b+21+fa>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+52+(U<<2)>>0]=((((d[476581+(K<<9)+(d[(fa|1)+(b+21)>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+40+(U<<2)+1>>0]=((((d[476581+(K<<9)+(d[fa+2+(b+21)>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+52+(U<<2)+1>>0]=((((d[476581+(K<<9)+(d[fa+3+(b+21)>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+40+(U<<2)+2>>0]=((((d[476581+(K<<9)+(d[fa+4+(b+21)>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;a[f+52+(U<<2)+2>>0]=((((d[476581+(K<<9)+(d[fa+5+(b+21)>>0]<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;U=U+1|0}while((U|0)!=3);a[f+8>>0]=a[b+39>>0]|0;a[f+9>>0]=a[b+40>>0]|0;a[f+10>>0]=a[b+41>>0]|0;a[f+11>>0]=a[b+42>>0]|0;a[f+12>>0]=a[b+43>>0]|0;a[f+13>>0]=a[b+44>>0]|0;a[f+14>>0]=a[b+45>>0]|0;a[f+15>>0]=a[b+46>>0]|0;a[f+16>>0]=a[b+47>>0]|0;a[f+17>>0]=a[b+48>>0]|0;a[f+18>>0]=a[b+49>>0]|0;a[f+19>>0]=a[b+50>>0]|0;a[f+20>>0]=a[b+51>>0]|0;a[f+21>>0]=a[b+52>>0]|0;a[f+22>>0]=a[b+53>>0]|0;a[f+23>>0]=a[b+54>>0]|0;T=1;i=h;return T|0}case 8:{U=b+112|0;S=d[U>>0]|0;ca=d[U+1>>0]|0;fa=d[U+2>>0]|0;ea=d[U+3>>0]|0;da=(e[19612+(ca<<3)>>1]|0)+(e[19612+(S<<3)>>1]|0)+(e[19612+(fa<<3)>>1]|0)+(e[19612+(ea<<3)>>1]|0)|0;ga=(e[19612+(ca<<3)+4>>1]|0)+(e[19612+(S<<3)+4>>1]|0)+(e[19612+(fa<<3)+4>>1]|0)+(e[19612+(ea<<3)+4>>1]|0)|0;if((da|0)!=0&(ga|0)!=0){c[f>>2]=5;a[f+40>>0]=a[21660+(d[U>>0]<<2)+2>>0]|0;a[f+52>>0]=a[21660+(d[U>>0]<<2)+3>>0]|0;ea=U+1|0;a[f+41>>0]=a[21660+(d[ea>>0]<<2)+2>>0]|0;a[f+53>>0]=a[21660+(d[ea>>0]<<2)+3>>0]|0;ea=U+2|0;a[f+42>>0]=a[21660+(d[ea>>0]<<2)+2>>0]|0;a[f+54>>0]=a[21660+(d[ea>>0]<<2)+3>>0]|0;H=f+8|0;I=H+16|0;do{a[H>>0]=1;H=H+1|0}while((H|0)<(I|0));ea=U+3|0;a[f+43>>0]=a[ea>>0]|0;a[f+55>>0]=a[ea>>0]|0;T=1;i=h;return T|0}else{c[f>>2]=6;ea=ga>>>0<da>>>0&1;a[f+40>>0]=a[19612+(d[U>>0]<<3)+(ea<<2)+2>>0]|0;a[f+52>>0]=a[19612+(d[U>>0]<<3)+(ea<<2)+3>>0]|0;fa=U+1|0;a[f+41>>0]=a[19612+(d[fa>>0]<<3)+(ea<<2)+2>>0]|0;a[f+53>>0]=a[19612+(d[fa>>0]<<3)+(ea<<2)+3>>0]|0;fa=U+2|0;a[f+42>>0]=a[19612+(d[fa>>0]<<3)+(ea<<2)+2>>0]|0;a[f+54>>0]=a[19612+(d[fa>>0]<<3)+(ea<<2)+3>>0]|0;fa=U+3|0;a[f+43>>0]=a[19612+(d[fa>>0]<<3)+(ea<<2)+2>>0]|0;a[f+55>>0]=a[19612+(d[fa>>0]<<3)+(ea<<2)+3>>0]|0;c[f+64>>2]=ea;c[f+68>>2]=ea;H=f+8|0;I=H+16|0;do{a[H>>0]=5;H=H+1|0}while((H|0)<(I|0));T=1;i=h;return T|0}break}case 16:case 9:{c[f>>2]=7;U=c[b+108>>2]|0;c[f+4>>2]=d[19252+(U*6|0)>>0];da=(1029946068>>>U&1|0)!=0;U=(J+-15|0)>>>0<3;ga=C+4|0;ea=D+4|0;fa=C+8|0;S=D+8|0;ca=C+12|0;V=D+12|0;W=E+4|0;X=0;do{if(U){Y=X<<2;ra=+(d[476581+(K<<9)+(d[b+21+Y>>0]<<1)>>0]|0)/255.0;g[C>>2]=ra;qa=+(d[476581+(K<<9)+(d[(Y|1)+(b+21)>>0]<<1)>>0]|0)/255.0;g[D>>2]=qa;g[ga>>2]=ra;g[ea>>2]=qa;g[fa>>2]=ra;g[S>>2]=qa;g[ca>>2]=+(d[476581+(K<<9)+(d[(Y|2)+(b+21)>>0]<<1)>>0]|0)/255.0;fb=Y|3}else{Y=X<<3;g[C>>2]=+(d[476581+(K<<9)+(d[b+21+Y>>0]<<1)>>0]|0)/255.0;g[ga>>2]=+(d[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)+N|0;_=(Q|0)<0?N:(Z|0)>(P|0)?P:Z;Z=_&255;Q=~~((q*+g[C>>2]-O)*.5+.5);$=(Q<<1)+N|0;aa=(Q|0)<0?N:($|0)>(P|0)?P:$;$=aa&255;Q=~~((q*+g[D>>2]-O)*.5+.5);ba=(Q<<1)+N|0;ca=(Q|0)<0?N:(ba|0)>(P|0)?P:ba;ba=ca&255;Q=~~((q*+g[E>>2]-O)*.5+.5);da=(Q<<1)+N|0;ea=(Q|0)<0?N:(da|0)>(P|0)?P:da;da=ea&255;P=(S&255)<<p;S=((P&255)>>>o|P)&255;a[m>>0]=S;P=(U&255)<<p;U=((P&255)>>>o|P)&255;a[n>>0]=U;P=(W&255)<<p;a[F>>0]=(P&255)>>>o|P;P=(Y&255)<<p;a[G>>0]=(P&255)>>>o|P;P=(_&255)<<p;a[H>>0]=(P&255)>>>o|P;P=(aa&255)<<p;a[I>>0]=(P&255)>>>o|P;P=(ca&255)<<p;a[J>>0]=(P&255)>>>o|P;P=(ea&255)<<p;a[K>>0]=(P&255)>>>o|P;a:do if(d){fa=0.0;ga=0.0}else{P=S;ea=U;O=0.0;ha=0.0;ca=0;while(1){ia=+(P&255|0)-+g[e+(ca<<2)>>2]*255.0;ja=O+ia*ia;ia=+(ea&255|0)-+g[f+(ca<<2)>>2]*255.0;ka=ha+ia*ia;aa=ca+1|0;if((aa|0)==(b|0)){fa=ja;ga=ka;break a}P=a[m+aa>>0]|0;ea=a[n+aa>>0]|0;O=ja;ha=ka;ca=aa}}while(0);if(fa<L){c[k>>2]=N;a[h>>0]=(R&255)>>>1;a[s>>0]=(V&255)>>>1;a[t>>0]=(Z&255)>>>1;a[u>>0]=(ba&255)>>>1;la=fa}else la=L;if(ga<M){c[v>>2]=N;a[j>>0]=(T&255)>>>1;a[w>>0]=(X&255)>>>1;a[x>>0]=($&255)>>>1;a[y>>0]=(da&255)>>>1;ma=ga}else ma=M;N=N+1|0;if((N|0)==2)break;else{L=la;M=ma}}i=l;return}function Sb(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;h=(g|0)==0;i=h<<31>>31;j=(g|0)!=0;g=j?-1:1;k=j&1;l=j<<31>>31;j=h&1;m=0;while(1){do switch(e|0){case 2:{n=h?((m|0)==0)<<31>>31:0;break}case 5:{n=h?((m|0)==1)<<31>>31:0;break}case 6:{n=h?((m|0)==2)<<31>>31:0;break}case 7:{n=h?(m|0)==0&1:0;break}case 11:{n=h?(m|0)==1&1:0;break}case 15:{n=h?(m|0)==2&1:0;break}case 18:{n=h?0:((m|0)==0)<<31>>31;break}case 19:{n=h?0:((m|0)==1)<<31>>31;break}case 20:{n=h?0:((m|0)==2)<<31>>31;break}case 21:{n=h?0:(m|0)==0&1;break}case 24:{n=h?0:(m|0)==1&1;break}case 8:{n=h?0:(m|0)==2&1;break}case 10:{n=-2;break}case 27:{n=i;break}case 28:{n=g;break}case 29:{n=k;break}case 30:{n=l;break}case 31:{n=j;break}default:n=((((e>>>0)/((c[17472+(m<<2)>>2]|0)>>>0)|0)>>>0)%3|0)+-1|0}while(0);o=a[d+m>>0]|0;p=o&255;do if(!(o<<24>>24))if((n|0)==-2){q=p+3|0;break}else{q=n+1+p|0;break}else if((p|0)==(f|0)){q=n+-1+f|0;break}else{r=p+n|0;q=(r|0)<0|(r|0)>(f|0)?p-n|0:r;break}while(0);if((q|0)<=-1){s=29;break}if((q|0)>(f|0)){s=31;break}a[b+m>>0]=q;m=m+1|0;if(m>>>0>=3){s=33;break}}if((s|0)==29)oa(490602,474791,13201,490609);else if((s|0)==31)oa(490625,474791,13202,490609);else if((s|0)==33)return}function Tb(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,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;h=i;i=i+32|0;j=h+16|0;k=h+8|0;l=h;m=b+104|0;if((c[m>>2]|0)==8){n=b+119|0;o=c[b+120>>2]|0;a[g+3>>0]=d[n>>0]<<1|o<<5|o<<2;o=c[b+140>>2]|0;if(!(a[n>>0]|0)){a[g>>0]=o<<4|o;n=c[b+144>>2]|0;a[g+1>>0]=n<<4|n;n=c[b+148>>2]|0;p=n<<4|n}else{a[g>>0]=o<<3;a[g+1>>0]=c[b+144>>2]<<3;p=c[b+148>>2]<<3}a[g+2>>0]=p;p=g+4|0;o=490641+(c[b+136>>2]<<2)|0;n=d[o>>0]|d[o+1>>0]<<8|d[o+2>>0]<<16|d[o+3>>0]<<24;a[p>>0]=n;a[p+1>>0]=n>>8;a[p+2>>0]=n>>16;a[p+3>>0]=n>>24;i=h;return}n=a[b+119>>0]|0;p=d[b+118>>0]|0;o=g+3|0;a[o>>0]=(n&255)<<1|p|c[b+120>>2]<<5|c[b+124>>2]<<2;q=n<<24>>24!=0;n=q?31:15;r=b+128|0;b=0;do{s=f+(d[490657+(p<<5)+(b<<4)+1>>0]<<4)+(d[490657+(p<<5)+(b<<4)>>0]<<2)|0;t=f+(d[490657+(p<<5)+(b<<4)+3>>0]<<4)+(d[490657+(p<<5)+(b<<4)+2>>0]<<2)|0;u=f+(d[490657+(p<<5)+(b<<4)+5>>0]<<4)+(d[490657+(p<<5)+(b<<4)+4>>0]<<2)|0;v=f+(d[490657+(p<<5)+(b<<4)+7>>0]<<4)+(d[490657+(p<<5)+(b<<4)+6>>0]<<2)|0;w=f+(d[490657+(p<<5)+(b<<4)+9>>0]<<4)+(d[490657+(p<<5)+(b<<4)+8>>0]<<2)|0;x=f+(d[490657+(p<<5)+(b<<4)+11>>0]<<4)+(d[490657+(p<<5)+(b<<4)+10>>0]<<2)|0;y=f+(d[490657+(p<<5)+(b<<4)+13>>0]<<4)+(d[490657+(p<<5)+(b<<4)+12>>0]<<2)|0;z=f+(d[490657+(p<<5)+(b<<4)+15>>0]<<4)+(d[490657+(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54|0)+((n>>>16&255)*19|0)|0;n=c[E>>2]|0;k=((n>>>8&255)*183|0)+((n&255)*54|0)+((n>>>16&255)*19|0)|0;n=c[r>>2]|0;B=((b>>>8&255)*183|0)+((b&255)*54|0)+((b>>>16&255)*19|0)+q|0;b=k+q|0;q=((n>>>8&255)*183|0)+((n&255)*54|0)+((n>>>16&255)*19|0)+k|0;k=p<<1;if(!(a[o>>0]&1)){n=l;C=m;s=p<<3;A=0;while(1){t=A+k|0;u=f+(t<<2)|0;v=((d[u+1>>0]|0)*366|0)+((d[u>>0]|0)*108|0)+((d[u+2>>0]|0)*38|0)|0;u=d[508919+((v>>>0<B>>>0&1)+(v>>>0<b>>>0&1)+(v>>>0<q>>>0&1))>>0]|0;v=s|1;w=f+(t+4<<2)|0;x=((d[w+1>>0]|0)*366|0)+((d[w>>0]|0)*108|0)+((d[w+2>>0]|0)*38|0)|0;w=d[508919+((x>>>0<B>>>0&1)+(x>>>0<b>>>0&1)+(x>>>0<q>>>0&1))>>0]|0;x=s|2;y=f+(t+8<<2)|0;z=((d[y+1>>0]|0)*366|0)+((d[y>>0]|0)*108|0)+((d[y+2>>0]|0)*38|0)|0;y=d[508919+((z>>>0<B>>>0&1)+(z>>>0<b>>>0&1)+(z>>>0<q>>>0&1))>>0]|0;z=s|3;F=f+(t+12<<2)|0;t=((d[F+1>>0]|0)*366|0)+((d[F>>0]|0)*108|0)+((d[F+2>>0]|0)*38|0)|0;F=d[508919+((t>>>0<B>>>0&1)+(t>>>0<b>>>0&1)+(t>>>0<q>>>0&1))>>0]|0;t=((u&1)<<s|C&65535|(w&1)<<v|(y&1)<<x|(F&1)<<z)&65535;G=(u>>>1<<s|n&65535|w>>>1<<v|y>>>1<<x|F>>>1<<z)&65535;A=A+1|0;if((A|0)==2){H=G;I=t;break}else{n=G;C=t;s=s+4|0}}}else{s=l;C=m;n=k;A=0;while(1){t=A+k<<2;G=f+(t<<2)|0;z=((d[G+1>>0]|0)*366|0)+((d[G>>0]|0)*108|0)+((d[G+2>>0]|0)*38|0)|0;G=d[508919+((z>>>0<B>>>0&1)+(z>>>0<b>>>0&1)+(z>>>0<q>>>0&1))>>0]|0;z=n+4|0;F=f+((t|1)<<2)|0;x=((d[F+1>>0]|0)*366|0)+((d[F>>0]|0)*108|0)+((d[F+2>>0]|0)*38|0)|0;F=d[508919+((x>>>0<B>>>0&1)+(x>>>0<b>>>0&1)+(x>>>0<q>>>0&1))>>0]|0;x=n+8|0;y=f+((t|2)<<2)|0;v=((d[y+1>>0]|0)*366|0)+((d[y>>0]|0)*108|0)+((d[y+2>>0]|0)*38|0)|0;y=d[508919+((v>>>0<B>>>0&1)+(v>>>0<b>>>0&1)+(v>>>0<q>>>0&1))>>0]|0;v=n+12|0;w=f+((t|3)<<2)|0;t=((d[w+1>>0]|0)*366|0)+((d[w>>0]|0)*108|0)+((d[w+2>>0]|0)*38|0)|0;w=d[508919+((t>>>0<B>>>0&1)+(t>>>0<b>>>0&1)+(t>>>0<q>>>0&1))>>0]|0;t=((G&1)<<n|C&65535|(F&1)<<z|(y&1)<<x|(w&1)<<v)&65535;u=(G>>>1<<n|s&65535|F>>>1<<z|y>>>1<<x|w>>>1<<v)&65535;A=A+1|0;if((A|0)==2){H=u;I=t;break}else{s=u;C=t;n=n+1|0}}}p=p+1|0;if((p|0)==2){J=H;K=I;break}else{l=H;m=I}}a[g+7>>0]=K;a[g+6>>0]=(K&65535)>>>8;a[g+5>>0]=J;a[g+4>>0]=(J&65535)>>>8;i=h;return}function Ub(e,f,g){e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0.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,C=0,D=0;h=c[e+104>>2]|0;i=(h|0)==8;if(i|(h+-8|0)>>>0>9){if(i)j=d[e+112+3>>0]|7424;else j=7679;b[g>>1]=j;j=g+2|0;a[j>>0]=a[463004]|0;a[j+1>>0]=a[463005]|0;a[j+2>>0]=a[463006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)oa(490927,474791,14261,490943);k=h&15;l=490974+(k<<3)+7|0;m=a[490974+(k<<3)+3>>0]|0;n=+(j>>>0);j=~~+gd(n+(+(i>>>0)-n)*(+(0-m|0)/+((a[l>>0]|0)-m|0)));b[g>>1]=j&255|((h&65535)<<8&3840|e<<12&65535);h=(Z(a[490974+(k<<3)>>0]|0,e)|0)+j|0;i=(h>>>0>255?h>>31^255:h)&255;h=(Z(a[490974+(k<<3)+1>>0]|0,e)|0)+j|0;o=(h>>>0>255?h>>31^255:h)&255;h=(Z(a[490974+(k<<3)+2>>0]|0,e)|0)+j|0;p=(h>>>0>255?h>>31^255:h)&255;h=(Z(m,e)|0)+j|0;m=(h>>>0>255?h>>31^255:h)&255;h=(Z(a[490974+(k<<3)+4>>0]|0,e)|0)+j|0;q=(h>>>0>255?h>>31^255:h)&255;h=(Z(a[490974+(k<<3)+5>>0]|0,e)|0)+j|0;r=(h>>>0>255?h>>31^255:h)&255;h=(Z(a[490974+(k<<3)+6>>0]|0,e)|0)+j|0;k=(h>>>0>255?h>>31^255:h)&255;h=(Z(a[l>>0]|0,e)|0)+j|0;j=(h>>>0>255?h>>31^255:h)&255;h=0;e=0;l=0;while(1){s=d[f+((l&3)<<4)+(l>>>2<<2)+3>>0]|0;t=i-s|0;u=((t|0)<0?0-t|0:t)<<3;t=o-s|0;v=((t|0)<0?0-t|0:t)<<3|1;t=p-s|0;w=((t|0)<0?0-t|0:t)<<3|2;t=m-s|0;x=((t|0)<0?0-t|0:t)<<3|3;t=q-s|0;y=((t|0)<0?0-t|0:t)<<3|4;t=r-s|0;z=((t|0)<0?0-t|0:t)<<3|5;t=k-s|0;A=((t|0)<0?0-t|0:t)<<3|6;t=j-s|0;s=u>>>0<v>>>0?u:v;v=s>>>0<w>>>0?s:w;w=v>>>0<x>>>0?v:x;x=w>>>0<y>>>0?w:y;y=x>>>0<z>>>0?x:z;z=y>>>0<A>>>0?y:A;A=z>>>0<(((t|0)<0?0-t|0:t)<<3|7)>>>0;t=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<1)>>0];r=d[468643+(o<<1)+1>>0]<<5|d[467619+(m<<1)+1>>0]<<11|d[467619+(q<<1)+1>>0];if((r|0)==(D|0))if(!D){F=1;G=0;H=0;I=0;J=85}else{K=D+-1|0;L=0;E=12}else{K=r;L=170;E=12}if((E|0)==12){E=D>>>0<K>>>0;r=E?K:D;p=E?D:K;F=r&255;G=p&255;H=(r&65535)>>>8&255;I=(p&65535)>>>8&255;J=(E?L|85:L)&255}a[b>>0]=F;a[b+1>>0]=H;a[b+2>>0]=G;a[b+3>>0]=I;Fd(b+4|0,J|0,4)|0;i=f;return}else{t=m;u=o;v=q;w=m;x=o;y=q;z=1;A=q;B=o;C=m}while(1){m=c+(z<<2)|0;o=d[m>>0]|0;q=d[m+1>>0]|0;J=d[m+2>>0]|0;m=(t|0)<(o|0)?o:t;I=(u|0)<(q|0)?q:u;G=(v|0)<(J|0)?J:v;H=(o|0)<(w|0)?o:w;F=(q|0)<(x|0)?q:x;L=(J|0)<(y|0)?J:y;E=o+C|0;o=q+B|0;q=J+A|0;z=z+1|0;if((z|0)==16){N=m;O=I;P=G;Q=H;R=F;S=L;T=E;U=o;V=q;break}else{t=m;u=I;v=G;w=H;x=F;y=L;A=q;B=o;C=E}}C=T+8>>4;T=U+8>>4;U=V+8>>4;V=0;B=0;A=0;y=0;x=0;w=0;v=0;while(1){u=c+(v<<2)|0;t=(d[u>>0]|0)-C|0;z=(d[u+1>>0]|0)-T|0;E=(d[u+2>>0]|0)-U|0;u=V+(Z(t,t)|0)|0;o=B+(Z(z,t)|0)|0;q=A+(Z(E,t)|0)|0;t=y+(Z(z,z)|0)|0;L=x+(Z(E,z)|0)|0;z=w+(Z(E,E)|0)|0;v=v+1|0;if((v|0)==16){W=u;X=o;Y=q;_=t;$=L;aa=z;break}else{V=u;B=o;A=q;y=t;x=L;w=z}}ba=+(W|0)*.003921568859368563;ca=+(X|0)*.003921568859368563;da=+(Y|0)*.003921568859368563;ea=+(_|0)*.003921568859368563;fa=+($|0)*.003921568859368563;ga=+(aa|0)*.003921568859368563;ha=+(N-Q|0);ia=+(O-R|0);ja=+(P-S|0);ka=ha*ba+ia*ca+ja*da;la=ha*ca+ia*ea+ja*fa;ma=ha*da+ia*fa+ja*ga;ja=ka*ba+la*ca+ma*da;ia=ka*ca+la*ea+ma*fa;ha=ka*da+la*fa+ma*ga;ma=ja*ba+ia*ca+ha*da;la=ja*ca+ia*ea+ha*fa;ka=ja*da+ia*fa+ha*ga;ha=ma*ba+la*ca+ka*da;ba=ma*ca+la*ea+ka*fa;ea=ma*da+la*fa+ka*ga;ga=+M(+ha);ka=+M(+ba);fa=+M(+ea);la=ga>ka?ga:ka;ka=la>fa?la:fa;if(!(ka>=2.0)){na=117;pa=601;qa=306}else{fa=1024.0/ka;na=~~(ea*fa);pa=~~(ba*fa);qa=~~(ha*fa)}S=0;P=-2147483648;R=0;O=0;Q=2147483647;while(1){N=c+(R<<2)|0;aa=Z(d[N>>0]|0,qa)|0;$=(Z(d[N+1>>0]|0,pa)|0)+aa|0;aa=$+(Z(d[N+2>>0]|0,na)|0)|0;N=(aa|0)<(Q|0);$=N?R:O;_=(aa|0)>(P|0);Y=_?R:S;R=R+1|0;if((R|0)==16){ra=Y;sa=$;break}else{S=Y;P=_?aa:P;O=$;Q=N?aa:Q}}Q=c+(sa<<2)|0;sa=((d[Q>>0]|0)*31|0)+128|0;O=((d[Q+1>>0]|0)*63|0)+128|0;P=((d[Q+2>>0]|0)*31|0)+128|0;Q=c+(ra<<2)|0;ra=((d[Q>>0]|0)*31|0)+128|0;S=((d[Q+1>>0]|0)*63|0)+128|0;R=((d[Q+2>>0]|0)*31|0)+128|0;Xb(c,((sa>>>8)+sa|0)>>>8,((O>>>8)+O|0)>>>8,((P>>>8)+P|0)>>>8,((ra>>>8)+ra|0)>>>8,((S>>>8)+S|0)>>>8,((R>>>8)+R|0)>>>8,h);ta=h;ua=U;va=T;wa=C}else{C=d[b+4>>0]|0;T=d[b+5>>0]|0;U=d[b+6>>0]|0;R=d[b+7>>0]|0;a[h>>0]=a[491183+(C&3)>>0]|0;a[h+1>>0]=a[491183+(C>>>2&3)>>0]|0;a[h+2>>0]=a[491183+(C>>>4&3)>>0]|0;a[h+3>>0]=a[491183+(C>>>6)>>0]|0;a[h+4>>0]=a[491183+(T&3)>>0]|0;a[h+5>>0]=a[491183+(T>>>2&3)>>0]|0;a[h+6>>0]=a[491183+(T>>>4&3)>>0]|0;a[h+7>>0]=a[491183+(T>>>6)>>0]|0;a[h+8>>0]=a[491183+(U&3)>>0]|0;a[h+9>>0]=a[491183+(U>>>2&3)>>0]|0;a[h+10>>0]=a[491183+(U>>>4&3)>>0]|0;a[h+11>>0]=a[491183+(U>>>6)>>0]|0;a[h+12>>0]=a[491183+(R&3)>>0]|0;a[h+13>>0]=a[491183+(R>>>2&3)>>0]|0;a[h+14>>0]=a[491183+(R>>>4&3)>>0]|0;a[h+15>>0]=a[491183+(R>>>6)>>0]|0;ta=h;ua=0;va=0;wa=-1}R=(e&2|0)==0?(e&1)+1|0:3;e=j+4|0;U=j+8|0;T=k+4|0;C=k+8|0;S=ua;ua=va;va=wa;wa=0;while(1){if(Yb(c,ta,j,k)|0){ra=~~(+g[j>>2]*.12156862765550613+.5);P=~~(+g[e>>2]*.24705882370471954+.5);O=~~(+g[U>>2]*.12156862765550613+.5);sa=~~(+g[k>>2]*.12156862765550613+.5);Q=~~(+g[T>>2]*.24705882370471954+.5);na=~~(+g[C>>2]*.12156862765550613+.5);xa=S;ya=ua;za=va;Aa=(na|0)<0?0:(na|0)>31?31:na;Ba=(Q|0)<0?0:(Q|0)>63?63:Q;Ca=(sa|0)<0?0:(sa|0)>31?31:sa;Da=(O|0)<0?0:(O|0)>31?31:O;Ea=(P|0)<0?0:(P|0)>63?63:P;Fa=(ra|0)<0?0:(ra|0)>31?31:ra}else{if((va|0)<0){ra=0;P=0;O=0;sa=0;while(1){Q=c+(ra<<2)|0;na=(d[Q>>0]|0)+sa|0;pa=(d[Q+1>>0]|0)+O|0;qa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>0?v:u,v=x>>>0>u>>>0?x:u,u=d[n+b>>0]|0,x=t>>>0<u>>>0?t:u,t=v>>>0>u>>>0?v:u,u=d[m+b>>0]|0,v=x>>>0<u>>>0?x:u,x=t>>>0>u>>>0?t:u,u=d[l+b>>0]|0,t=v>>>0<u>>>0?v:u,v=x>>>0>u>>>0?x:u,u=d[k+b>>0]|0,x=t>>>0<u>>>0?t:u,t=v>>>0>u>>>0?v:u,u=d[j+b>>0]|0,v=x>>>0<u>>>0?x:u,x=t>>>0>u>>>0?t:u,u=d[i+b>>0]|0,t=v>>>0<u>>>0?v:u,v=x>>>0>u>>>0?x:u,u=d[h+b>>0]|0,x=t>>>0<u>>>0?t:u,(x|0)==((v>>>0>u>>>0?v:u)|0)):0){N=+(x>>>0);g[w>>2]=N;g[f+(b<<2)>>2]=N}b=b+1|0}while((b|0)!=3);Q=1;return Q|0}function Zb(b,e){b=b|0;e=e|0;var 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,A=0;f=c[b+104>>2]|0;g=d[476505+f>>0]|0;h=a[476581+(g<<9)+((d[b+21>>0]|0)<<1)>>0]|0;if((f+-15|0)>>>0<3){i=a[476581+(g<<9)+((d[b+22>>0]|0)<<1)>>0]|0;j=h&255;k=(j*31|0)+127|0;l=(k>>>0)/255|0;m=(j*63|0)+127|0;j=(k>>>0<7905?l<<11|l:63519)|(m>>>0<16065?((m>>>0)/255|0)<<5:2016);m=j&255;a[e>>0]=m;l=(j&65535)>>>8&255;j=e+1|0;a[j>>0]=l;k=i&255;i=(k*31|0)+127|0;n=(i>>>0)/255|0;o=(k*63|0)+127|0;p=(i>>>0<7905?n|n<<11:63519)|(o>>>0<16065?((o>>>0)/255|0)<<5:2016);q=j;r=m;s=l}else{l=((h&255)*31|0)+127|0;h=((d[476581+(g<<9)+((d[b+23>>0]|0)<<1)>>0]|0)*63|0)+127|0;m=((((d[476581+(g<<9)+((d[b+25>>0]|0)<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;j=(h>>>0<16065?((h>>>0)/255|0)<<5:2016)|(l>>>0<7905?((l>>>0)/255|0)<<11:63488)|(m>>>0<31?m:31);m=j&255;a[e>>0]=m;l=(j&65535)>>>8&255;j=e+1|0;a[j>>0]=l;h=((d[476581+(g<<9)+((d[b+22>>0]|0)<<1)>>0]|0)*31|0)+127|0;o=((d[476581+(g<<9)+((d[b+24>>0]|0)<<1)>>0]|0)*63|0)+127|0;n=((((d[476581+(g<<9)+((d[b+26>>0]|0)<<1)>>0]|0)*31|0)+127|0)>>>0)/255|0;p=(o>>>0<16065?((o>>>0)/255|0)<<5:2016)|(h>>>0<7905?((h>>>0)/255|0)<<11:63488)|(n>>>0<31?n:31);q=j;r=m;s=l}l=(p&65535)>>>8;m=l&255;j=p&255;n=e+2|0;a[n>>0]=j;h=e+3|0;a[h>>0]=m;o=(s&255)<<8|r&255;g=(l&65535)<<8|p&255;if((o|0)==(g|0)){if(o){p=o&65535;l=p+-1<<16>>16;if(!(p<<16>>16))oa(491171,474791,15255,491191);else{t=l&255;u=(l&65535)>>>8&255;v=r;w=(p&65535)>>>8&255;x=0}}else{t=0;u=0;v=1;w=0;x=85}a[e>>0]=v;a[q>>0]=w;a[n>>0]=t;a[h>>0]=u;Fd(e+4|0,x|0,4)|0;return}if(o>>>0<g>>>0){a[e>>0]=j;a[n>>0]=r;a[q>>0]=m;a[h>>0]=s;y=1}else y=0;s=c[17612+((d[476467+f>>0]|0)<<2)>>2]|0;h=(d[476543+f>>0]|0)+-1|0;f=15;m=0;while(1){q=(d[s+(d[(f<<h)+(b+39)>>0]|0)>>0]|0)^y|m<<2;if((f|0)>0){f=f+-1|0;m=q}else{z=q;A=m;break}}a[e+4>>0]=z;a[e+5>>0]=A>>>6;a[e+6>>0]=A>>>14;a[e+7>>0]=A>>>22;return}function _b(e,f,g){e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=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255|3328;p=e+2|0;a[p>>0]=a[463004]|0;a[p+1>>0]=a[463005]|0;a[p+2>>0]=a[463006]|0;a[p+3>>0]=a[463007]|0;a[p+4>>0]=a[463008]|0;a[p+5>>0]=a[463009]|0;i=h;return}p=o-n|0;if(p>>>0<6){q=o+-2|0;r=q>>>0>255?q>>31^255:q;b[e>>1]=r&255|7424;q=3-(r&255)|0;r=0;s=0;t=0;while(1){u=q+(d[f+(Z(t,g)|0)>>0]|0)|0;if(u>>>0>=6){v=6;break}w=Hd(d[509002+u>>0]|0,0,d[508986+t>>0]|0)|0;u=w|r;w=B|s;t=t+1|0;if(t>>>0>=16){x=u;y=w;break}else{r=u;s=w}}if((v|0)==6)oa(508943,474791,15671,508964);v=Gd(x|0,y|0,40)|0;a[e+2>>0]=v;a[e+3>>0]=y;v=Gd(x|0,y|0,24)|0;a[e+4>>0]=v;v=Gd(x|0,y|0,16)|0;a[e+5>>0]=v;v=Gd(x|0,y|0,8)|0;a[e+6>>0]=v;a[e+7>>0]=x;i=h;return}z=+(n>>>0);A=+(o>>>0)-z;C=+(p>>>0);p=0;do{o=a[490974+(p<<3)+3>>0]|0;D=+((a[490974+(p<<3)+7>>0]|0)-o|0);n=~~+gd(z+A*(+(0-o|0)/D));c[j+(p<<2)>>2]=(n>>>0>255?n>>31^255:n)&255;n=~~+gd(C/D);c[k+(p<<2)>>2]=(n|0)<1?1:(n|0)>15?15:n;p=p+1|0}while((p|0)!=16);p=l;n=p+64|0;do{c[p>>2]=0;p=p+4|0}while((p|0)<(n|0));p=0;do{n=490974+(p<<3)|0;o=c[k+(p<<2)>>2]|0;x=c[j+(p<<2)>>2]|0;v=l+(p<<2)|0;y=490974+(p<<3)+1|0;s=490974+(p<<3)+2|0;r=490974+(p<<3)+3|0;t=490974+(p<<3)+4|0;q=490974+(p<<3)+5|0;w=490974+(p<<3)+6|0;u=490974+(p<<3)+7|0;E=0;F=-1;G=0;H=c[v>>2]|0;while(1){I=d[f+(Z(E,g)|0)>>0]|0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>>0<m>>>0?o:m;m=o>>>0>n>>>0?o:n;n=d[f+(g*9|0)>>0]|0;o=n>>>0<p>>>0?n:p;p=n>>>0>m>>>0?n:m;m=d[f+(g*10|0)>>0]|0;n=m>>>0<o>>>0?m:o;o=m>>>0>p>>>0?m:p;p=d[f+(g*11|0)>>0]|0;m=p>>>0<n>>>0?p:n;n=p>>>0>o>>>0?p:o;o=d[f+(g*12|0)>>0]|0;p=o>>>0<m>>>0?o:m;m=o>>>0>n>>>0?o:n;n=d[f+(g*13|0)>>0]|0;o=n>>>0<p>>>0?n:p;p=n>>>0>m>>>0?n:m;m=d[f+(g*14|0)>>0]|0;n=m>>>0<o>>>0?m:o;o=m>>>0>p>>>0?m:p;p=d[f+(g*15|0)>>0]|0;m=p>>>0<n>>>0?p:n;n=p>>>0>o>>>0?p:o;if((n|0)==(m|0)){b[e>>1]=m&255|3328;o=e+2|0;a[o>>0]=a[463004]|0;a[o+1>>0]=a[463005]|0;a[o+2>>0]=a[463006]|0;a[o+3>>0]=a[463007]|0;a[o+4>>0]=a[463008]|0;a[o+5>>0]=a[463009]|0;i=h;return}o=n-m|0;if(o>>>0<6){p=n+-2|0;q=p>>>0>255?p>>31^255:p;b[e>>1]=q&255|7424;p=3-(q&255)|0;q=0;r=0;s=0;while(1){t=p+(d[f+(Z(s,g)|0)>>0]|0)|0;if(t>>>0>=6){u=7;break}v=Hd(d[509002+t>>0]|0,0,d[508986+s>>0]|0)|0;t=v|q;v=B|r;s=s+1|0;if(s>>>0>=16){w=t;x=v;break}else{q=t;r=v}}if((u|0)==7)oa(508943,474791,15514,509008);u=Gd(w|0,x|0,40)|0;a[e+2>>0]=u;a[e+3>>0]=x;u=Gd(w|0,x|0,24)|0;a[e+4>>0]=u;u=Gd(w|0,x|0,16)|0;a[e+5>>0]=u;u=Gd(w|0,x|0,8)|0;a[e+6>>0]=u;a[e+7>>0]=w;i=h;return}y=+(m>>>0);z=+(n>>>0)-y;A=+(o>>>0);o=0;n=0;while(1){m=d[509017+o>>0]|0;w=a[490974+(m<<3)+3>>0]|0;C=+((a[490974+(m<<3)+7>>0]|0)-w|0);m=~~+gd(y+z*(+(0-w|0)/C));c[j+(o<<2)>>2]=(m>>>0>255?m>>31^255:m)&255;m=~~+gd(A/C);w=(m|0)<1?1:(m|0)>15?15:m;c[k+(o<<2)>>2]=w;m=w|n;o=o+1|0;if((o|0)==4){D=m;break}else n=m}n=(D|0)==1;D=c[j>>2]|0;o=c[j+4>>2]|0;m=c[j+8>>2]|0;w=c[j+12>>2]|0;u=c[k>>2]|0;x=c[k+4>>2]|0;r=c[k+8>>2]|0;q=c[k+12>>2]|0;s=0;p=0;v=0;t=0;E=0;while(1){F=a[f+(Z(E,g)|0)>>0]|0;G=F&255;if((F+-7&255)<=241){F=D-G|0;H=o-G|0;I=m-G|0;J=w-G|0;if(n){K=-1;L=-1;M=-1;N=-1;O=0;while(1){P=(a[490990+O>>0]|0)+F|0;Q=(a[491038+O>>0]|0)+H|0;R=(a[491062+O>>0]|0)+I|0;S=(a[491078+O>>0]|0)+J|0;T=((P|0)<0?0-P|0:P)<<3|O;P=T>>>0<K>>>0?T:K;T=((Q|0)<0?0-Q|0:Q)<<3|O;Q=T>>>0<L>>>0?T:L;T=((R|0)<0?0-R|0:R)<<3|O;R=T>>>0<M>>>0?T:M;T=((S|0)<0?0-S|0:S)<<3|O;S=T>>>0<N>>>0?T:N;O=O+1|0;if((O|0)==8){U=P;V=Q;W=R;X=S;break}else{K=P;L=Q;M=R;N=S}}}else{N=-1;M=-1;L=-1;K=-1;O=0;while(1){S=(Z(a[490990+O>>0]|0,u)|0)+F|0;R=(Z(a[491038+O>>0]|0,x)|0)+H|0;Q=(Z(a[491062+O>>0]|0,r)|0)+I|0;P=(Z(a[491078+O>>0]|0,q)|0)+J|0;T=((S|0)<0?0-S|0:S)<<3|O;S=T>>>0<N>>>0?T:N;T=((R|0)<0?0-R|0:R)<<3|O;R=T>>>0<M>>>0?T:M;T=((Q|0)<0?0-Q|0:Q)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(l|0))c[m>>2]=l;l=c[d+12>>2]|0;m=d+16|0;n=c[m>>2]|0;if((l|0)!=(n|0))c[m>>2]=n+(~((n+-4-l|0)>>>2)<<2);l=c[d+24>>2]|0;n=d+28|0;m=c[n>>2]|0;if((l|0)==(m|0)){o=1;i=h;return o|0}c[n>>2]=m+(~((m+-2-l|0)>>>1)<<1);o=1;i=h;return o|0}l=d+4|0;m=c[l>>2]|0;n=c[d>>2]|0;p=m-n|0;if(p>>>0>=e>>>0)if(p>>>0>e>>>0?(q=n+e|0,(m|0)!=(q|0)):0){c[l>>2]=q;r=n}else r=n;else{bc(d,e-p|0);r=c[d>>2]|0}Id(r|0,f|0,e|0)|0;r=1<<g;p=d+12|0;n=d+16|0;q=c[n>>2]|0;l=c[p>>2]|0;m=l;if((q|0)==(l|0))s=q;else{t=q+(~((q+-4-m|0)>>>2)<<2)|0;c[n>>2]=t;s=t}t=s-m>>2;if(r>>>0<=t>>>0){if(r>>>0<t>>>0?(m=l+(r<<2)|0,(s|0)!=(m|0)):0)c[n>>2]=s+(~((s+-4-m|0)>>>2)<<2)}else cc(p,r-t|0);t=d+24|0;m=d+28|0;d=c[m>>2]|0;s=c[t>>2]|0;n=s;if((d|0)==(s|0))u=d;else{l=d+(~((d+-2-n|0)>>>1)<<1)|0;c[m>>2]=l;u=l}l=e<<1;d=u-n>>1;if(l>>>0<=d>>>0){if(l>>>0<d>>>0?(n=s+(l<<1)|0,(u|0)!=(n|0)):0)c[m>>2]=u+(~((u+-2-n|0)>>>1)<<1)}else dc(t,l-d|0);d=j;l=d+128|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(l|0));d=0;while(1){l=a[f+d>>0]|0;if((l&255)>31){v=0;break}n=j+((l&255)<<2)|0;c[n>>2]=(c[n>>2]|0)+1;d=d+1|0;if(d>>>0>=e>>>0){w=30;break}}if((w|0)==30){c[k+4>>2]=0;c[k>>2]=0;w=1;d=0;n=0;while(1){l=c[j+(w<<2)>>2]|0;u=l+n|0;s=l+d<<1;w=w+1|0;c[k+(w<<2)>>2]=s;if((w|0)==31){x=u;y=s;break}else{d=s;n=u}}a:do if(!((y|0)!=-2147483648&x>>>0>1))if((e|0)>0){n=r+-1|0;d=g+-1|0;w=g+1|0;j=0;u=-1;while(1){s=a[f+j>>0]|0;l=s&255;b:do if(!(s<<24>>24))z=u;else{q=k+(l<<2)|0;A=c[q>>2]|0;c[q>>2]=A+1;q=A;A=l;B=0;while(1){C=q&1|B<<1;A=A+-1|0;if(!A){D=C;break}else{q=q>>>1;B=C}}if(l>>>0<=g>>>0){B=l<<16|j;if(D>>>0>=r>>>0){z=u;break}q=c[p>>2]|0;A=1<<l;C=D;while(1){E=q+(C<<2)|0;if(c[E>>2]|0){F=0;break a}c[E>>2]=B;C=C+A|0;if(C>>>0>=r>>>0){z=u;break b}}}C=(c[p>>2]|0)+((D&n)<<2)|0;A=c[C>>2]|0;if(!A){c[C>>2]=u;G=u;H=u+-2|0}else{G=A;H=u}if((G|0)>-1){F=0;break a}A=D>>>d>>>1;C=(A&1)-G|0;B=C+-1|0;q=(C|0)<1;if((l|0)>(w|0)){E=C;I=B;J=A;A=q;K=l;L=H;while(1){if(A){F=0;break a}M=c[m>>2]|0;N=c[t>>2]|0;O=M-N>>1;do if((E|0)>(O|0)){if(E>>>0>O>>>0){dc(t,E-O|0);P=c[t>>2]|0;break}if(E>>>0>=O>>>0){P=N;break}Q=N+(E<<1)|0;if((M|0)==(Q|0)){P=N;break}c[m>>2]=M+(~((M+-2-Q|0)>>>1)<<1);P=N}else P=N;while(0);N=P+(I<<1)|0;M=b[N>>1]|0;if(M<<16>>16)if(M<<16>>16>-1){F=0;break a}else{R=M<<16>>16;S=L}else{b[N>>1]=L;R=L;S=L+-2|0}K=K+-1|0;J=J>>>1;N=(J&1)-R|0;M=N+-1|0;O=(N|0)<1;if((K|0)<=(w|0)){T=N;U=M;V=O;W=S;break}else{E=N;I=M;A=O;L=S}}}else{T=C;U=B;V=q;W=H}if(V){F=0;break a}L=c[m>>2]|0;A=c[t>>2]|0;I=L-A>>1;do if((T|0)>(I|0)){if(T>>>0>I>>>0){dc(t,T-I|0);X=c[t>>2]|0;break}if(T>>>0>=I>>>0){X=A;break}E=A+(T<<1)|0;if((L|0)==(E|0)){X=A;break}c[m>>2]=L+(~((L+-2-E|0)>>>1)<<1);X=A}else X=A;while(0);A=X+(U<<1)|0;if(b[A>>1]|0){F=0;break a}b[A>>1]=j;z=W}while(0);j=j+1|0;if((j|0)>=(e|0)){F=1;break}else u=z}}else F=1;else F=0;while(0);v=F}o=v;i=h;return o|0}function bc(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=b+8|0;f=c[e>>2]|0;g=b+4|0;h=c[g>>2]|0;i=h;if((f-i|0)>>>0>=d>>>0){j=d;k=h;do{a[k>>0]=0;k=(c[g>>2]|0)+1|0;c[g>>2]=k;j=j+-1|0}while((j|0)!=0);return}j=c[b>>2]|0;k=i-j+d|0;if((k|0)<0)Ic(b);i=j;j=f-i|0;if(j>>>0<1073741823){f=j<<1;j=f>>>0<k>>>0?k:f;f=(c[g>>2]|0)-i|0;if(!j){l=0;m=0;n=f}else{o=j;p=f;q=8}}else{o=2147483647;p=(c[g>>2]|0)-i|0;q=8}if((q|0)==8){l=o;m=Jc(o)|0;n=p}p=m+n|0;o=m+l|0;l=d;d=p;q=p;while(1){a[d>>0]=0;d=q+1|0;p=d;l=l+-1|0;if(!l){r=p;break}else q=p}q=c[b>>2]|0;l=(c[g>>2]|0)-q|0;d=m+(n-l)|0;Id(d|0,q|0,l|0)|0;c[b>>2]=d;c[g>>2]=r;c[e>>2]=o;if(!q)return;Kc(q);return}function cc(a,b){a=a|0;b=b|0;var 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;d=a+8|0;e=c[d>>2]|0;f=a+4|0;g=c[f>>2]|0;h=g;if(e-h>>2>>>0>=b>>>0){Fd(g|0,0,b<<2|0)|0;c[f>>2]=g+(b<<2);return}g=c[a>>2]|0;i=g;j=(h-i>>2)+b|0;if(j>>>0>1073741823)Ic(a);h=g;k=e-h|0;if(k>>2>>>0<536870911){e=k>>1;k=e>>>0<j>>>0?j:e;e=(c[f>>2]|0)-h|0;j=e>>2;if(!k){l=0;m=0;n=j;o=e}else{p=k;q=j;r=e;s=8}}else{e=(c[f>>2]|0)-h|0;p=1073741823;q=e>>2;r=e;s=8}if((s|0)==8){l=p;m=Jc(p<<2)|0;n=q;o=r}Fd(m+(n<<2)|0,0,b<<2|0)|0;Id(m|0,g|0,o|0)|0;c[a>>2]=m;c[f>>2]=m+(n+b<<2);c[d>>2]=m+(l<<2);if(!i)return;Kc(i);return}function dc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=a+8|0;e=c[d>>2]|0;f=a+4|0;g=c[f>>2]|0;h=g;if(e-h>>1>>>0>=b>>>0){Fd(g|0,0,b<<1|0)|0;c[f>>2]=g+(b<<1);return}i=c[a>>2]|0;j=i;k=(h-j>>1)+b|0;if((k|0)<0)Ic(a);h=i;l=e-h|0;e=l>>1>>>0<1073741823?(l>>>0<k>>>0?k:l):2147483647;l=g-h|0;h=l>>1;if(!e)m=0;else m=Jc(e<<1)|0;Fd(m+(h<<1)|0,0,b<<1|0)|0;Id(m|0,i|0,l|0)|0;c[a>>2]=m;c[f>>2]=m+(h+b<<1);c[d>>2]=m+(e<<1);if(!j)return;Kc(j);return}function ec(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;f=i;i=i+160|0;g=f+144|0;h=f+128|0;j=f+112|0;k=f+96|0;l=f+80|0;m=f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[e+6>>0]|0)!=0,d[e+12>>0]|0);r=b;s=j;c=r+16|0;do{a[r>>0]=a[s>>0]|0;r=r+1|0;s=s+1|0}while((r|0)<(c|0));if(a[e+7>>0]|0){gc(k,b);r=b;s=k;c=r+16|0;do{a[r>>0]=a[s>>0]|0;r=r+1|0;s=s+1|0}while((r|0)<(c|0))}if(a[e+10>>0]|0){hc(l,b);r=b;s=l;c=r+16|0;do{a[r>>0]=a[s>>0]|0;r=r+1|0;s=s+1|0}while((r|0)<(c|0))}if(a[e+11>>0]|0){ic(m,b);r=b;s=m;c=r+16|0;do{a[r>>0]=a[s>>0]|0;r=r+1|0;s=s+1|0}while((r|0)<(c|0))}if(a[e+1>>0]|0){jc(n,b);r=b;s=n;c=r+16|0;do{a[r>>0]=a[s>>0]|0;r=r+1|0;s=s+1|0}while((r|0)<(c|0))}if(a[e+3>>0]|0){n=b+1|0;m=a[499448+(d[n>>0]|0)>>0]|0;l=b+2|0;k=a[499448+(d[l>>0]|0)>>0]|0;j=b+3|0;h=a[499448+(d[j>>0]|0)>>0]|0;g=b+4|0;t=a[499448+(d[g>>0]|0)>>0]|0;u=b+5|0;v=a[499448+(d[u>>0]|0)>>0]|0;w=b+6|0;x=a[499448+(d[w>>0]|0)>>0]|0;y=b+7|0;z=a[499448+(d[y>>0]|0)>>0]|0;A=b+8|0;B=a[499448+(d[A>>0]|0)>>0]|0;C=b+9|0;D=a[499448+(d[C>>0]|0)>>0]|0;E=b+10|0;F=a[499448+(d[E>>0]|0)>>0]|0;G=b+11|0;H=a[499448+(d[G>>0]|0)>>0]|0;I=b+12|0;J=a[499448+(d[I>>0]|0)>>0]|0;K=b+13|0;L=a[499448+(d[K>>0]|0)>>0]|0;M=b+14|0;N=a[499448+(d[M>>0]|0)>>0]|0;O=b+15|0;P=a[499448+(d[O>>0]|0)>>0]|0;a[b>>0]=a[499448+(d[b>>0]|0)>>0]|0;a[n>>0]=m;a[l>>0]=k;a[j>>0]=h;a[g>>0]=t;a[u>>0]=v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>>0]|0;r=r+1|0;s=s+1|0}while((r|0)<(c|0));i=f;return}function fc(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;g=f;h=g;j=h+16|0;do{a[h>>0]=0;h=h+1|0}while((h|0)<(j|0));if(d){a[g>>0]=a[c+12>>0]|0;a[g+1>>0]=a[c+13>>0]|0;a[g+2>>0]=a[c+14>>0]|0;a[g+3>>0]=a[c+15>>0]|0;a[g+4>>0]=a[c+8>>0]|0;a[g+5>>0]=a[c+9>>0]|0;a[g+6>>0]=a[c+10>>0]|0;a[g+7>>0]=a[c+11>>0]|0;a[g+8>>0]=a[c+4>>0]|0;a[g+9>>0]=a[c+5>>0]|0;a[g+10>>0]=a[c+6>>0]|0;a[g+11>>0]=a[c+7>>0]|0;a[g+12>>0]=a[c>>0]|0;a[g+13>>0]=a[c+1>>0]|0;a[g+14>>0]=a[c+2>>0]|0;a[g+15>>0]=a[c+3>>0]|0}else{h=g;k=c;j=h+16|0;do{a[h>>0]=a[k>>0]|0;h=h+1|0;k=k+1|0}while((h|0)<(j|0))}h=b;j=h+16|0;do{a[h>>0]=0;h=h+1|0}while((h|0)<(j|0));switch(e|0){case 0:{h=b;k=g;j=h+16|0;do{a[h>>0]=a[k>>0]|0;h=h+1|0;k=k+1|0}while((h|0)<(j|0));i=f;return}case 1:{a[b>>0]=a[g+12>>0]|0;a[b+1>>0]=a[g+8>>0]|0;a[b+2>>0]=a[g+4>>0]|0;a[b+3>>0]=a[g>>0]|0;a[b+4>>0]=a[g+13>>0]|0;a[b+5>>0]=a[g+9>>0]|0;a[b+6>>0]=a[g+5>>0]|0;a[b+7>>0]=a[g+1>>0]|0;a[b+8>>0]=a[g+14>>0]|0;a[b+9>>0]=a[g+10>>0]|0;a[b+10>>0]=a[g+6>>0]|0;a[b+11>>0]=a[g+2>>0]|0;a[b+12>>0]=a[g+15>>0]|0;a[b+13>>0]=a[g+11>>0]|0;a[b+14>>0]=a[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((n|g)>>>0>=4){p=6;break a}o=d[c+(n+l)>>0]|0}if((m|g)>>>0>=4){p=6;break a}n=d[c+(m+l)>>0]|0;q=o>>>0>n>>>0?o:n;n=m+1|0;if(n>>>0>3)r=q;else{if((n|g)>>>0>=4){p=6;break a}s=d[c+(n+l)>>0]|0;r=q>>>0>s>>>0?q:s}}else r=0;s=m+-1|0;if(s>>>0>3)t=r;else{if((s|i)>>>0>=4){p=6;break a}q=d[c+(s+f)>>0]|0;t=r>>>0>q>>>0?r:q}if((m|i)>>>0>=4){p=6;break a}q=d[c+(m+f)>>0]|0;s=t>>>0>q>>>0?t:q;q=m+1|0;if(q>>>0>3)u=s;else{if((q|i)>>>0>=4){p=6;break a}n=d[c+(q+f)>>0]|0;u=s>>>0>n>>>0?s:n}if(!j){n=m+-1|0;if(n>>>0>3)v=u;else{if((n|e)>>>0>=4){p=6;break a}s=d[c+(n+k)>>0]|0;v=u>>>0>s>>>0?u:s}if((m|e)>>>0>=4){p=6;break a}s=d[c+(m+k)>>0]|0;n=v>>>0>s>>>0?v:s;s=m+1|0;if(s>>>0>3)w=n;else{if((s|e)>>>0>=4){p=6;break a}q=d[c+(s+k)>>0]|0;w=n>>>0>q>>>0?n:q}}else w=u;if((m|i)>>>0>=4){p=8;break a}a[b+(m+f)>>0]=w;m=m+1|0}while(m>>>0<4);if(e>>>0>=4){p=11;break}}if((p|0)==6)oa(499394,491220,151,499413);else if((p|0)==8)oa(499394,491220,152,499413);else if((p|0)==11)return}function hc(b,c){b=b|0;c=c|0;var 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;e=b;f=e+16|0;do{a[e>>0]=0;e=e+1|0}while((e|0)<(f|0));e=0;a:while(1){f=e<<2;g=e+-1|0;h=g>>>0>3;i=e;e=e+1|0;j=e>>>0>3;k=e<<2;l=g<<2;m=0;do{if(!h){n=m+-1|0;if(n>>>0>3)o=99;else{if((n|g)>>>0>=4){p=6;break a}q=d[c+(n+l)>>0]|0;o=q>>>0>99?99:q}if((m|g)>>>0>=4){p=6;break a}q=d[c+(m+l)>>0]|0;n=o>>>0<q>>>0?o:q;q=m+1|0;if(q>>>0>3)r=n;else{if((q|g)>>>0>=4){p=6;break a}s=d[c+(q+l)>>0]|0;r=n>>>0<s>>>0?n:s}}else r=99;s=m+-1|0;if(s>>>0>3)t=r;else{if((s|i)>>>0>=4){p=6;break a}n=d[c+(s+f)>>0]|0;t=r>>>0<n>>>0?r:n}if((m|i)>>>0>=4){p=6;break a}n=d[c+(m+f)>>0]|0;s=t>>>0<n>>>0?t:n;n=m+1|0;if(n>>>0>3)u=s;else{if((n|i)>>>0>=4){p=6;break a}q=d[c+(n+f)>>0]|0;u=s>>>0<q>>>0?s:q}if(!j){q=m+-1|0;if(q>>>0>3)v=u;else{if((q|e)>>>0>=4){p=6;break a}s=d[c+(q+k)>>0]|0;v=u>>>0<s>>>0?u:s}if((m|e)>>>0>=4){p=6;break a}s=d[c+(m+k)>>0]|0;q=v>>>0<s>>>0?v:s;s=m+1|0;if(s>>>0>3)w=q;else{if((s|e)>>>0>=4){p=6;break a}n=d[c+(s+k)>>0]|0;w=q>>>0<n>>>0?q:n}}else w=u;if((m|i)>>>0>=4){p=8;break a}a[b+(m+f)>>0]=w;m=m+1|0}while(m>>>0<4);if(e>>>0>=4){p=11;break}}if((p|0)==6)oa(499394,491220,151,499413);else if((p|0)==8)oa(499394,491220,152,499413);else if((p|0)==11)return}function ic(b,c){b=b|0;c=c|0;var 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;e=b;f=e+16|0;do{a[e>>0]=0;e=e+1|0}while((e|0)<(f|0));e=0;a:while(1){f=e<<2;g=-1+e|0;h=(g|0)<0?0:(g|0)>3?3:g;g=h<<2;i=(e|0)<0?0:(e|0)>3?3:e;j=i<<2;k=1+e|0;l=(k|0)<0?0:(k|0)>3?3:k;k=l<<2;m=0;do{n=m+-1|0;o=(n|0)<0?0:n;n=m;m=m+1|0;p=(m|0)>3?3:m;if((p|(o|(n|h)))>>>0>=4){q=4;break a}r=Z(d[c+(n+g)>>0]|0,-1)|0;if((p|(o|(n|i)))>>>0>=4){q=4;break a}s=((d[c+(n+j)>>0]|0)<<3)+((Z(d[c+(o+j)>>0]|0,-1)|0)+r)|0;r=(Z(d[c+(p+j)>>0]|0,-1)|0)+s|0;if((p|(o|(n|l)))>>>0>=4){q=4;break a}o=(Z(d[c+(n+k)>>0]|0,-1)|0)+r|0;if((n|e)>>>0>=4){q=5;break a}a[b+(n+f)>>0]=(o|0)<-3?0:(o|0)>15?3:((o|0)/4|0)&255}while(m>>>0<4);e=e+1|0;if(e>>>0>=4){q=8;break}}if((q|0)==4)oa(499394,491220,151,499413);else if((q|0)==5)oa(499394,491220,152,499413);else if((q|0)==8)return}function jc(b,c){b=b|0;c=c|0;var 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;e=(d[c+1>>0]|0)<<2|(d[c>>0]|0)|(d[c+2>>0]|0)<<4|(d[c+3>>0]|0)<<6|((d[c+5>>0]|0)<<2|(d[c+4>>0]|0)|(d[c+6>>0]|0)<<4|(d[c+7>>0]|0)<<6)<<8|((d[c+9>>0]|0)<<2|(d[c+8>>0]|0)|(d[c+10>>0]|0)<<4|(d[c+11>>0]|0)<<6)<<16|((d[c+13>>0]|0)<<2|(d[c+12>>0]|0)|(d[c+14>>0]|0)<<4|(d[c+15>>0]|0)<<6)<<24;f=b;g=f+16|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(g|0));f=e;e=0;a:while(1){g=e<<2;h=f;i=0;while(1){if((i|e)>>>0>=4){j=4;break a}k=i+g|0;l=d[c+k>>0]|0;m=((h|0)==0&1)+h|0;n=((m&65535)*36969|0)+(m>>>16)|0;m=((n|0)==0&1)+n|0;o=((m&65535)*36969|0)+(m>>>16)|0;m=(((o&65535^o>>>16)*6|0)>>>16)+(((n&65535^n>>>16)*6|0)>>>16)|0;b:do switch(m|0){case 0:{p=l+-2|0;break}case 10:{p=l+2|0;break}default:if(m>>>0<3){p=l+-1|0;break b}else{p=l+(m>>>0>7&1)|0;break b}}while(0);a[b+k>>0]=(p|0)<0?0:(p|0)>3?3:p&255;i=i+1|0;if(i>>>0>=4){q=o;break}else h=o}h=e+1|0;if(h>>>0<4){f=q;e=h}else{j=13;break}}if((j|0)==4)oa(499394,491220,151,499413);else if((j|0)==13)return}function kc(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0;if((e|0)<4){f=b;g=f+16|0;do{a[f>>0]=0;f=f+1|0}while((f|0)<(g|0));a[b>>0]=a[(d[c>>0]|0)+(499481+(e<<2))>>0]|0;a[b+1>>0]=a[(d[c+1>>0]|0)+(499481+(e<<2))>>0]|0;a[b+2>>0]=a[(d[c+2>>0]|0)+(499481+(e<<2))>>0]|0;a[b+3>>0]=a[(d[c+3>>0]|0)+(499481+(e<<2))>>0]|0;a[b+4>>0]=a[(d[c+4>>0]|0)+(499481+(e<<2))>>0]|0;a[b+5>>0]=a[(d[c+5>>0]|0)+(499481+(e<<2))>>0]|0;a[b+6>>0]=a[(d[c+6>>0]|0)+(499481+(e<<2))>>0]|0;a[b+7>>0]=a[(d[c+7>>0]|0)+(499481+(e<<2))>>0]|0;a[b+8>>0]=a[(d[c+8>>0]|0)+(499481+(e<<2))>>0]|0;a[b+9>>0]=a[(d[c+9>>0]|0)+(499481+(e<<2))>>0]|0;a[b+10>>0]=a[(d[c+10>>0]|0)+(499481+(e<<2))>>0]|0;a[b+11>>0]=a[(d[c+11>>0]|0)+(499481+(e<<2))>>0]|0;a[b+12>>0]=a[(d[c+12>>0]|0)+(499481+(e<<2))>>0]|0;a[b+13>>0]=a[(d[c+13>>0]|0)+(499481+(e<<2))>>0]|0;a[b+14>>0]=a[(d[c+14>>0]|0)+(499481+(e<<2))>>0]|0;a[b+15>>0]=a[(d[c+15>>0]|0)+(499481+(e<<2))>>0]|0;return}else oa(499452,491220,239,499468)}function lc(b,c){b=b|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,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;d=i;i=i+16|0;e=d;f=d+8|0;g=b;h=g+16|0;do{a[g>>0]=0;g=g+1|0}while((g|0)<(h|0));g=0;a:while(1){h=g<<2;j=-1+g|0;k=j>>>0>3;l=g>>>0>3;m=1+g|0;n=m>>>0>3;o=m<<2;p=g<<2;q=j<<2;r=0;do{s=r+-1|0;t=s>>>0>3;u=r+1|0;v=u>>>0>3;if(!k){if(t)w=0;else{if((s|j)>>>0>=4){x=6;break a}a[f>>0]=a[c+(s+q)>>0]|0;w=1}if((r|j)>>>0>=4){x=6;break a}y=w+1|0;a[f+w>>0]=a[c+(r+q)>>0]|0;if(v)z=y;else{if((u|j)>>>0>=4){x=6;break a}a[f+y>>0]=a[c+(u+q)>>0]|0;z=y+1|0}}else z=0;if(!l){if(t)A=z;else{if((s|g)>>>0>=4){x=6;break a}a[f+z>>0]=a[c+(s+p)>>0]|0;A=z+1|0}if(v)B=A;else{if((u|g)>>>0>=4){x=6;break a}a[f+A>>0]=a[c+(u+p)>>0]|0;B=A+1|0}}else B=z;if(!n){if(t)C=B;else{if((s|m)>>>0>=4){x=6;break a}a[f+B>>0]=a[c+(s+o)>>0]|0;C=B+1|0}if((r|m)>>>0>=4){x=6;break a}s=C+1|0;a[f+C>>0]=a[c+(r+o)>>0]|0;if(v)D=s;else{if((u|m)>>>0>=4){x=6;break a}a[f+s>>0]=a[c+(u+o)>>0]|0;D=s+1|0}}else D=B;sd(f,f+D|0,e);if((r|g)>>>0>=4){x=9;break a}a[b+(r+h)>>0]=a[f+(D>>>1)>>0]|0;r=r+1|0}while(r>>>0<4);g=g+1|0;if(g>>>0>=4){x=12;break}}if((x|0)==6)oa(499394,491220,151,499413);else if((x|0)==9)oa(499394,491220,152,499413);else if((x|0)==12){i=d;return}}function mc(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;h=(1<<g)+-1|0;i=d[e>>0]|0;j=d[e+1>>0]|0;k=d[e+2>>0]|0;l=k&h;m=d[e+3>>0]|0;n=m&h;o=d[e+4>>0]|0;e=((o>>>g)*81|0)+(((m>>>g)*27|0)+(((k>>>g)*9|0)+(((j>>>g)*3|0)+(i>>>g))))|0;k=o&h;if((e|0)>=243)oa(506896,474791,5114,506908);o=d[506926+e>>0]|0;e=g+2|0;m=g<<1;p=m+2|0;if(p){q=p;p=(o&3)<<g|i&h|(j&h)<<e;h=c[f>>2]|0;while(1){j=h&7;i=8-j|0;r=(i|0)<(q|0)?i:q;i=b+(h>>3)|0;a[i>>0]=d[i>>0]|0|p<<j;h=r+(c[f>>2]|0)|0;c[f>>2]=h;if((q|0)==(r|0))break;else{q=q-r|0;p=p>>>r}}}p=g*3|0;q=p+6|0;if(!q)return;h=q;q=o>>>7<<p+5|o>>>2&3|(o>>>4&1)<<e|(o>>>5&3)<<m+3|l<<2|n<<g+3|k<<m+5;m=c[f>>2]|0;while(1){k=m&7;g=8-k|0;n=(g|0)<(h|0)?g:h;g=b+(m>>3)|0;a[g>>0]=d[g>>0]|0|q<<k;m=n+(c[f>>2]|0)|0;c[f>>2]=m;if((h|0)==(n|0))break;else{h=h-n|0;q=q>>>n}}return}function nc(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0;g=a[b+3>>0]|0;h=(f|0)==0;i=d[b>>0]|0;do if(!(g&2)){j=a[b+1>>0]|0;k=a[b+2>>0]|0;if(h){l=(k&255)>>>4;m=(j&255)>>>4;n=i>>>4}else{l=k&255;m=j&255;n=i}j=l&15;k=m&15;o=j<<4|j;p=k<<4|k;q=n<<4&240|n&15;r=11}else{k=i>>>3;j=d[b+1>>0]|0;s=j>>>3;t=d[b+2>>0]|0;u=t>>>3;if(h){v=i>>>5|k<<3|(s<<3|j>>>5)<<8|(u<<3|t>>>5)<<16|-16777216;w=v;x=v>>>8;y=v>>>16;break}v=t&7;z=i<<6&448;A=z>>>6;B=(j<<3&56|z)>>>3;j=B&7;C=(z>>>0>192?A|-8:A)+k|0;k=(j>>>0>3?B|-8:j)+s|0;s=(v>>>0>3?t|-8:v)+u|0;if((s|C|k)>>>0>31){D=(s|0)<0?0:(s|0)>31?31:s;E=(k|0)<0?0:(k|0)>31?31:k;F=(C|0)<0?0:(C|0)>31?31:C}else{D=s;E=k;F=C}o=D<<3|D>>2;p=E<<3|E>>2;q=F<<3|F>>2;r=11}while(0);if((r|0)==11)if(f>>>0<2){w=q;x=p;y=o}else oa(499583,474791,584,508923);o=(g&255)>>>((f|0)!=0?2:5)&7;f=w&255;w=c[17484+(o<<4)>>2]|0;g=w+f|0;if(g>>>0>255)if((g|0)<0){G=0;r=15}else H=255;else{G=g;r=15}if((r|0)==15)H=G;G=x&255;x=w+G|0;if(x>>>0>255)if((x|0)<0){I=0;r=18}else J=255;else{I=x;r=18}if((r|0)==18)J=I;I=y&255;y=w+I|0;if(y>>>0>255)if((y|0)<0){K=0;r=21}else L=255;else{K=y;r=21}if((r|0)==21)L=K;a[e>>0]=H;a[e+1>>0]=J;a[e+2>>0]=L;a[e+3>>0]=-1;L=e+4|0;J=c[17484+(o<<4)+4>>2]|0;H=J+f|0;if(H>>>0>255)if((H|0)<0){M=0;r=24}else N=255;else{M=H;r=24}if((r|0)==24)N=M;M=J+G|0;if(M>>>0>255)if((M|0)<0){O=0;r=27}else P=255;else{O=M;r=27}if((r|0)==27)P=O;O=J+I|0;if(O>>>0>255)if((O|0)<0){Q=0;r=30}else R=255;else{Q=O;r=30}if((r|0)==30)R=Q;a[L>>0]=N;a[L+1>>0]=P;a[L+2>>0]=R;a[L+3>>0]=-1;L=e+8|0;R=c[17484+(o<<4)+8>>2]|0;P=R+f|0;if(P>>>0>255)if((P|0)<0){S=0;r=33}else T=255;else{S=P;r=33}if((r|0)==33)T=S;S=R+G|0;if(S>>>0>255)if((S|0)<0){U=0;r=36}else V=255;else{U=S;r=36}if((r|0)==36)V=U;U=R+I|0;if(U>>>0>255)if((U|0)<0){W=0;r=39}else X=255;else{W=U;r=39}if((r|0)==39)X=W;a[L>>0]=T;a[L+1>>0]=V;a[L+2>>0]=X;a[L+3>>0]=-1;L=e+12|0;e=c[17484+(o<<4)+12>>2]|0;o=e+f|0;if(o>>>0>255)if((o|0)<0){Y=0;r=42}else Z=255;else{Y=o;r=42}if((r|0)==42)Z=Y;Y=e+G|0;if(Y>>>0>255)if((Y|0)<0){_=0;r=45}else $=255;else{_=Y;r=45}if((r|0)==45)$=_;_=e+I|0;if(_>>>0>255)if((_|0)<0)aa=0;else{ba=255;ca=Z&255;a[L>>0]=ca;da=$&255;ea=L+1|0;a[ea>>0]=da;fa=ba&255;ga=L+2|0;a[ga>>0]=fa;ha=L+3|0;a[ha>>0]=-1;return}else aa=_;ba=aa;ca=Z&255;a[L>>0]=ca;da=$&255;ea=L+1|0;a[ea>>0]=da;fa=ba&255;ga=L+2|0;a[ga>>0]=fa;ha=L+3|0;a[ha>>0]=-1;return}function oc(b,d){b=b|0;d=d|0;var 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;e=b+8|0;f=c[e>>2]|0;g=b+4|0;h=c[g>>2]|0;i=h;if(f-i>>4>>>0>=d>>>0){j=d;k=h;do{l=k;m=l+16|0;do{a[l>>0]=0;l=l+1|0}while((l|0)<(m|0));k=(c[g>>2]|0)+16|0;c[g>>2]=k;j=j+-1|0}while((j|0)!=0);return}j=c[b>>2]|0;k=(i-j>>4)+d|0;if(k>>>0>268435455)Ic(b);i=j;j=f-i|0;if(j>>4>>>0<134217727){f=j>>3;j=f>>>0<k>>>0?k:f;f=(c[g>>2]|0)-i>>4;if(!j){n=0;o=0;p=f}else{q=j;r=f;s=8}}else{q=268435455;r=(c[g>>2]|0)-i>>4;s=8}if((s|0)==8){n=q;o=Jc(q<<4)|0;p=r}r=o+(p<<4)|0;q=o+(n<<4)|0;n=d;d=r;s=r;while(1){l=d;m=l+16|0;do{a[l>>0]=0;l=l+1|0}while((l|0)<(m|0));d=s+16|0;r=d;n=n+-1|0;if(!n){t=r;break}else s=r}s=c[b>>2]|0;n=(c[g>>2]|0)-s|0;d=o+(p-(n>>4)<<4)|0;Id(d|0,s|0,n|0)|0;c[b>>2]=d;c[g>>2]=t;c[e>>2]=q;if(!s)return;Kc(s);return}function pc(a,b){a=a|0;b=b|0;var 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;d=a+8|0;e=c[d>>2]|0;f=a+4|0;g=c[f>>2]|0;h=g;if(e-h>>3>>>0>=b>>>0){i=b;j=g;do{g=j;c[g>>2]=0;c[g+4>>2]=0;j=(c[f>>2]|0)+8|0;c[f>>2]=j;i=i+-1|0}while((i|0)!=0);return}i=c[a>>2]|0;j=(h-i>>3)+b|0;if(j>>>0>536870911)Ic(a);h=i;i=e-h|0;if(i>>3>>>0<268435455){e=i>>2;i=e>>>0<j>>>0?j:e;e=(c[f>>2]|0)-h>>3;if(!i){k=0;l=0;m=e}else{n=i;o=e;p=8}}else{n=536870911;o=(c[f>>2]|0)-h>>3;p=8}if((p|0)==8){k=n;l=Jc(n<<3)|0;m=o}o=l+(m<<3)|0;n=l+(k<<3)|0;k=b;b=o;p=o;while(1){o=b;c[o>>2]=0;c[o+4>>2]=0;b=p+8|0;o=b;k=k+-1|0;if(!k){q=o;break}else p=o}p=c[a>>2]|0;k=(c[f>>2]|0)-p|0;b=l+(m-(k>>3)<<3)|0;Id(b|0,p|0,k|0)|0;c[a>>2]=b;c[f>>2]=q;c[d>>2]=n;if(!p)return;Kc(p);return}function qc(b,d){b=b|0;d=d|0;var 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;e=b+8|0;f=c[e>>2]|0;g=b+4|0;h=c[g>>2]|0;i=h;if(((f-i|0)/11|0)>>>0>=d>>>0){j=d;k=h;do{l=k;m=l+11|0;do{a[l>>0]=0;l=l+1|0}while((l|0)<(m|0));k=(c[g>>2]|0)+11|0;c[g>>2]=k;j=j+-1|0}while((j|0)!=0);return}j=c[b>>2]|0;k=((i-j|0)/11|0)+d|0;if(k>>>0>390451572)Ic(b);i=j;j=(f-i|0)/11|0;if(j>>>0<195225786){f=j<<1;j=f>>>0<k>>>0?k:f;f=((c[g>>2]|0)-i|0)/11|0;if(!j){n=0;o=0;p=f}else{q=j;r=f;s=8}}else{q=390451572;r=((c[g>>2]|0)-i|0)/11|0;s=8}if((s|0)==8){n=q;o=Jc(q*11|0)|0;p=r}r=o+(p*11|0)|0;q=o+(n*11|0)|0;n=d;d=r;s=r;while(1){l=d;m=l+11|0;do{a[l>>0]=0;l=l+1|0}while((l|0)<(m|0));d=s+11|0;r=d;n=n+-1|0;if(!n){t=r;break}else s=r}s=c[b>>2]|0;n=(c[g>>2]|0)-s|0;d=o+((((n|0)/-11|0)+p|0)*11|0)|0;Id(d|0,s|0,n|0)|0;c[b>>2]=d;c[g>>2]=t;c[e>>2]=q;if(!s)return;Kc(s);return}function rc(a,b){a=a|0;b=b|0;var 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;d=a+8|0;e=c[d>>2]|0;f=a+4|0;g=c[f>>2]|0;h=g;if(e-h>>2>>>0>=b>>>0){Fd(g|0,0,b<<2|0)|0;c[f>>2]=g+(b<<2);return}g=c[a>>2]|0;i=g;j=(h-i>>2)+b|0;if(j>>>0>1073741823)Ic(a);h=g;k=e-h|0;if(k>>2>>>0<536870911){e=k>>1;k=e>>>0<j>>>0?j:e;e=(c[f>>2]|0)-h|0;j=e>>2;if(!k){l=0;m=0;n=j;o=e}else{p=k;q=j;r=e;s=8}}else{e=(c[f>>2]|0)-h|0;p=1073741823;q=e>>2;r=e;s=8}if((s|0)==8){l=p;m=Jc(p<<2)|0;n=q;o=r}Fd(m+(n<<2)|0,0,b<<2|0)|0;Id(m|0,g|0,o|0)|0;c[a>>2]=m;c[f>>2]=m+(n+b<<2);c[d>>2]=m+(l<<2);if(!i)return;Kc(i);return}function sc(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=a+8|0;f=c[e>>2]|0;g=a+4|0;h=c[g>>2]|0;i=h;if(f-i>>2>>>0>=d>>>0){j=d;k=h;do{b[k>>1]=0;b[k+2>>1]=0>>>16;k=(c[g>>2]|0)+4|0;c[g>>2]=k;j=j+-1|0}while((j|0)!=0);return}j=c[a>>2]|0;k=(i-j>>2)+d|0;if(k>>>0>1073741823)Ic(a);i=j;j=f-i|0;if(j>>2>>>0<536870911){f=j>>1;j=f>>>0<k>>>0?k:f;f=(c[g>>2]|0)-i>>2;if(!j){l=0;m=0;n=f}else{o=j;p=f;q=8}}else{o=1073741823;p=(c[g>>2]|0)-i>>2;q=8}if((q|0)==8){l=o;m=Jc(o<<2)|0;n=p}p=m+(n<<2)|0;o=m+(l<<2)|0;l=d;d=p;q=p;while(1){b[d>>1]=0;b[d+2>>1]=0>>>16;d=q+4|0;p=d;l=l+-1|0;if(!l){r=p;break}else q=p}q=c[a>>2]|0;l=(c[g>>2]|0)-q|0;d=m+(n-(l>>2)<<2)|0;Id(d|0,q|0,l|0)|0;c[a>>2]=d;c[g>>2]=r;c[e>>2]=o;if(!q)return;Kc(q);return}function tc(a){a=a|0;ab(a);return}function uc(){return $a()|0}function vc(){var a=0,b=0;cb();if(c[4621]|0)return;a=Jc(12)|0;b=c[4119]|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;bb(a,b,92);c[4621]=a;return}function wc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;if(!((a|0)!=0&(b|0)!=0)){d=0;return d|0}e=Jc(600)|0;f=e+4|0;vb(f,c[4621]|0);c[e+592>>2]=a;c[e+596>>2]=b;if(wb(f,a,b)|0){c[e>>2]=-559038751;d=e;return d|0}else{Hc(f);Kc(e);d=0;return d|0}return 0}function xc(a){a=a|0;if(!a)return;if((c[a>>2]|0)!=-559038751)oa(509021,509041,86,509060);Hc(a+4|0);Kc(a);return}function yc(a){a=a|0;var b=0,e=0,f=0,g=0;b=i;i=i+48|0;e=b;if(!a){f=0;i=b;return f|0}if((c[a>>2]|0)!=-559038751)oa(509021,509041,99,509072);g=Bb(a+4|0,c[a+592>>2]|0,c[a+596>>2]|0,e,0,0)|0;f=g?d[e+40>>0]|0:0;i=b;return f|0}function zc(a){a=a|0;var b=0;if(!a){b=0;return b|0}if((c[a>>2]|0)!=-559038751)oa(509021,509041,117,509092);b=yb(a+4|0,c[a+592>>2]|0,c[a+596>>2]|0)|0;return b|0}function Ac(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+48|0;e=d;if(!a){f=0;i=d;return f|0}if((c[a>>2]|0)!=-559038751)oa(509021,509041,130,509113);g=zb(a+4|0,c[a+592>>2]|0,c[a+596>>2]|0,e,b)|0;f=g?c[e+4>>2]|0:0;i=d;return f|0}function Bc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;if(!a){i=e;return 0}if((c[a>>2]|0)==-559038751){g=Ab(a+4|0,c[a+592>>2]|0,c[a+596>>2]|0,b,d,f,e+4|0,e)|0;i=e;return (g?c[f>>2]|0:0)|0}else oa(509021,509041,148,509134);return 0}function Cc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;if(!a){i=e;return 0}if((c[a>>2]|0)==-559038751){g=Ab(a+4|0,c[a+592>>2]|0,c[a+596>>2]|0,b,d,e+8|0,f,e)|0;i=e;return (g?c[f>>2]|0:0)|0}else oa(509021,509041,165,509156);return 0}function Dc(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+16|0;g=f+8|0;h=f+4|0;j=f;if(!a){k=0;i=f;return k|0}if((c[a>>2]|0)!=-559038751)oa(509021,509041,182,509179);if(e>>>0>21){k=0;i=f;return k|0}if(!(Ab(a+4|0,c[a+592>>2]|0,c[a+596>>2]|0,b,d,g,h,j)|0)){k=0;i=f;return k|0}d=Hb(e)|0;if(Ib(e)|0){k=Z(Z(c[g>>2]|0,d)|0,c[h>>2]|0)|0;i=f;return k|0}else{k=Z(c[j>>2]|0,d)|0;i=f;return k|0}return 0}function Ec(a){a=a|0;var b=0;if(!a){b=0;return b|0}if((c[a>>2]|0)!=-559038751)oa(509021,509041,206,509220);b=(Cb(a+4|0,c[a+592>>2]|0,c[a+596>>2]|0)|0)&1;return b|0}function Fc(a){a=a|0;var b=0;if(!a){b=0;return b|0}if((c[a>>2]|0)!=-559038751)oa(509021,509041,219,509244);b=(Eb(a+4|0)|0)&1;return b|0}function Gc(a,b,d,e,f,g,h,i){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0;if(!a){j=0;return j|0}if((c[a>>2]|0)!=-559038751)oa(509021,509041,234,509267);if(g>>>0>21){j=0;return j|0}h=Hb(g)|0;j=(Gb(a+4|0,c[a+592>>2]|0,c[a+596>>2]|0,e,f,b,(d>>>0)/(h>>>0)|0,g,(i|0)!=0?4:0,0,0,0)|0)&1;return j|0}function Hc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=a+200|0;d=a+584|0;do{e=d;d=d+-12|0;f=c[d>>2]|0;g=f;if(f){h=e+-8|0;e=c[h>>2]|0;if((e|0)!=(f|0))c[h>>2]=e+(~((e+-4-g|0)>>>2)<<2);Kc(f)}}while((d|0)!=(b|0));b=c[a+188>>2]|0;d=b;if(b){f=a+192|0;g=c[f>>2]|0;if((g|0)!=(b|0))c[f>>2]=g+(~((g+-4-d|0)>>>2)<<2);Kc(b)}b=c[a+176>>2]|0;d=b;if(b){g=a+180|0;f=c[g>>2]|0;if((f|0)!=(b|0))c[g>>2]=f+(~((f+-4-d|0)>>>2)<<2);Kc(b)}b=c[a+160>>2]|0;d=b;if(b){f=a+164|0;g=c[f>>2]|0;if((g|0)!=(b|0))c[f>>2]=g+(~((g+-2-d|0)>>>1)<<1);Kc(b)}b=c[a+148>>2]|0;d=b;if(b){g=a+152|0;f=c[g>>2]|0;if((f|0)!=(b|0))c[g>>2]=f+(~((f+-4-d|0)>>>2)<<2);Kc(b)}b=c[a+136>>2]|0;if(b){d=a+140|0;if((c[d>>2]|0)!=(b|0))c[d>>2]=b;Kc(b)}b=c[a+124>>2]|0;d=b;if(b){f=a+128|0;g=c[f>>2]|0;if((g|0)!=(b|0))c[f>>2]=g+(~((g+-2-d|0)>>>1)<<1);Kc(b)}b=c[a+112>>2]|0;d=b;if(b){g=a+116|0;f=c[g>>2]|0;if((f|0)!=(b|0))c[g>>2]=f+(~((f+-4-d|0)>>>2)<<2);Kc(b)}b=c[a+100>>2]|0;if(b){d=a+104|0;if((c[d>>2]|0)!=(b|0))c[d>>2]=b;Kc(b)}b=c[a+88>>2]|0;d=b;if(b){f=a+92|0;g=c[f>>2]|0;if((g|0)!=(b|0))c[f>>2]=g+(~((g+-2-d|0)>>>1)<<1);Kc(b)}b=c[a+76>>2]|0;d=b;if(b){g=a+80|0;f=c[g>>2]|0;if((f|0)!=(b|0))c[g>>2]=f+(~((f+-4-d|0)>>>2)<<2);Kc(b)}b=c[a+64>>2]|0;if(b){d=a+68|0;if((c[d>>2]|0)!=(b|0))c[d>>2]=b;Kc(b)}b=c[a+52>>2]|0;d=b;if(b){f=a+56|0;g=c[f>>2]|0;if((g|0)!=(b|0))c[f>>2]=g+(~((g+-2-d|0)>>>1)<<1);Kc(b)}b=c[a+40>>2]|0;d=b;if(b){g=a+44|0;f=c[g>>2]|0;if((f|0)!=(b|0))c[g>>2]=f+(~((f+-4-d|0)>>>2)<<2);Kc(b)}b=c[a+28>>2]|0;if(b){d=a+32|0;if((c[d>>2]|0)!=(b|0))c[d>>2]=b;Kc(b)}b=c[a+12>>2]|0;if(b){d=a+16|0;f=c[d>>2]|0;if((f|0)!=(b|0))c[d>>2]=f+(~(((0-b+(f+-11)|0)>>>0)/11|0)*11|0);Kc(b)}b=c[a>>2]|0;if(!b)return;f=a+4|0;a=c[f>>2]|0;if((a|0)!=(b|0))c[f>>2]=a+(~((a+-8-b|0)>>>3)<<3);Kc(b);return}function Ic(a){a=a|0;oa(509432,509455,303,509530)}function Jc(a){a=a|0;var b=0,d=0,e=0;b=(a|0)==0?1:a;a=qd(b)|0;a:do if(!a){while(1){d=Oc()|0;if(!d)break;Pa[d&0]();d=qd(b)|0;if(d){e=d;break a}}d=pa(4)|0;c[d>>2]=18496;Ca(d|0,8,1)}else e=a;while(0);return e|0}function Kc(a){a=a|0;rd(a);return}function Lc(a){a=a|0;return}function Mc(a){a=a|0;Kc(a);return}function Nc(a){a=a|0;return 509551}function Oc(){var a=0;a=c[4627]|0;c[4627]=a+0;return a|0}function Pc(a){a=a|0;return}function Qc(a){a=a|0;return}function Rc(a){a=a|0;return}function Sc(a){a=a|0;return}function Tc(a){a=a|0;return}function Uc(a){a=a|0;Kc(a);return}function Vc(a){a=a|0;Kc(a);return}function Wc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+64|0;f=e;if((a|0)!=(b|0))if((b|0)!=0?(g=_c(b,40,56,0)|0,(g|0)!=0):0){b=f;h=b+56|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(h|0));c[f>>2]=g;c[f+8>>2]=a;c[f+12>>2]=-1;c[f+48>>2]=1;Ra[c[(c[g>>2]|0)+28>>2]&3](g,f,c[d>>2]|0,1);if((c[f+24>>2]|0)==1){c[d>>2]=c[f+16>>2];j=1}else j=0;k=j}else k=0;else k=1;i=e;return k|0}function Xc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;b=d+16|0;g=c[b>>2]|0;do if(g){if((g|0)!=(e|0)){h=d+36|0;c[h>>2]=(c[h>>2]|0)+1;c[d+24>>2]=2;a[d+54>>0]=1;break}h=d+24|0;if((c[h>>2]|0)==2)c[h>>2]=f}else{c[b>>2]=e;c[d+24>>2]=f;c[d+36>>2]=1}while(0);return}function Yc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;if((a|0)==(c[b+8>>2]|0))Xc(0,b,d,e);return}function Zc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;if((a|0)==(c[b+8>>2]|0))Xc(0,b,d,e);else{f=c[a+8>>2]|0;Ra[c[(c[f>>2]|0)+28>>2]&3](f,b,d,e)}return}function _c(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;h=i;i=i+64|0;j=h;k=c[d>>2]|0;l=d+(c[k+-8>>2]|0)|0;m=c[k+-4>>2]|0;c[j>>2]=f;c[j+4>>2]=d;c[j+8>>2]=e;c[j+12>>2]=g;g=j+16|0;e=j+20|0;d=j+24|0;k=j+28|0;n=j+32|0;o=j+40|0;p=(m|0)==(f|0);q=g;r=q+36|0;do{c[q>>2]=0;q=q+4|0}while((q|0)<(r|0));b[g+36>>1]=0;a[g+38>>0]=0;a:do if(p){c[j+48>>2]=1;Qa[c[(c[f>>2]|0)+20>>2]&3](f,j,l,l,1,0);s=(c[d>>2]|0)==1?l:0}else{La[c[(c[m>>2]|0)+24>>2]&3](m,j,l,1,0);switch(c[j+36>>2]|0){case 0:{s=(c[o>>2]|0)==1&(c[k>>2]|0)==1&(c[n>>2]|0)==1?c[e>>2]|0:0;break a;break}case 1:break;default:{s=0;break a}}if((c[d>>2]|0)!=1?!((c[o>>2]|0)==0&(c[k>>2]|0)==1&(c[n>>2]|0)==1):0){s=0;break}s=c[g>>2]|0}while(0);i=h;return s|0}function $c(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0;a[d+53>>0]=1;do if((c[d+4>>2]|0)==(f|0)){a[d+52>>0]=1;b=d+16|0;h=c[b>>2]|0;if(!h){c[b>>2]=e;c[d+24>>2]=g;c[d+36>>2]=1;if(!((g|0)==1?(c[d+48>>2]|0)==1:0))break;a[d+54>>0]=1;break}if((h|0)!=(e|0)){h=d+36|0;c[h>>2]=(c[h>>2]|0)+1;a[d+54>>0]=1;break}h=d+24|0;b=c[h>>2]|0;if((b|0)==2){c[h>>2]=g;i=g}else i=b;if((i|0)==1?(c[d+48>>2]|0)==1:0)a[d+54>>0]=1}while(0);return}function ad(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;a:do if((b|0)==(c[d+8>>2]|0)){if((c[d+4>>2]|0)==(e|0)?(h=d+28|0,(c[h>>2]|0)!=1):0)c[h>>2]=f}else{if((b|0)!=(c[d>>2]|0)){h=c[b+8>>2]|0;La[c[(c[h>>2]|0)+24>>2]&3](h,d,e,f,g);break}if((c[d+16>>2]|0)!=(e|0)?(h=d+20|0,(c[h>>2]|0)!=(e|0)):0){c[d+32>>2]=f;i=d+44|0;if((c[i>>2]|0)==4)break;j=d+52|0;a[j>>0]=0;k=d+53|0;a[k>>0]=0;l=c[b+8>>2]|0;Qa[c[(c[l>>2]|0)+20>>2]&3](l,d,e,e,1,g);if(a[k>>0]|0){if(!(a[j>>0]|0)){m=1;n=13}}else{m=0;n=13}do if((n|0)==13){c[h>>2]=e;j=d+40|0;c[j>>2]=(c[j>>2]|0)+1;if((c[d+36>>2]|0)==1?(c[d+24>>2]|0)==2:0){a[d+54>>0]=1;if(m)break}else n=16;if((n|0)==16?m:0)break;c[i>>2]=4;break a}while(0);c[i>>2]=3;break}if((f|0)==1)c[d+32>>2]=1}while(0);return}function bd(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;do if((b|0)==(c[d+8>>2]|0)){if((c[d+4>>2]|0)==(e|0)?(g=d+28|0,(c[g>>2]|0)!=1):0)c[g>>2]=f}else if((b|0)==(c[d>>2]|0)){if((c[d+16>>2]|0)!=(e|0)?(g=d+20|0,(c[g>>2]|0)!=(e|0)):0){c[d+32>>2]=f;c[g>>2]=e;g=d+40|0;c[g>>2]=(c[g>>2]|0)+1;if((c[d+36>>2]|0)==1?(c[d+24>>2]|0)==2:0)a[d+54>>0]=1;c[d+44>>2]=4;break}if((f|0)==1)c[d+32>>2]=1}while(0);return}function cd(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;if((a|0)==(c[b+8>>2]|0))$c(0,b,d,e,f);else{h=c[a+8>>2]|0;Qa[c[(c[h>>2]|0)+20>>2]&3](h,b,d,e,f,g)}return}function dd(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;if((a|0)==(c[b+8>>2]|0))$c(0,b,d,e,f);return}function ed(){var a=0;if(!(c[4648]|0))a=18640;else a=c[(ya()|0)+60>>2]|0;return a|0}function fd(a){a=a|0;var b=0;if(a>>>0>4294963200){c[(ed()|0)>>2]=0-a;b=-1}else b=a;return b|0}function gd(a){a=+a;var b=0,d=0,e=0.0,f=0,h=0.0,i=0.0,j=0.0,l=0.0;b=(g[k>>2]=a,c[k>>2]|0);d=b>>>23&255;do if(d>>>0>149)e=a;else{f=(b|0)<0;h=f?-a:a;if(d>>>0<126){e=a*0.0;break}i=h+8388608.0+-8388608.0-h;if(!(i>.5)){j=h+i;if(!(i<=-.5))l=j;else l=j+1.0}else l=h+i+-1.0;e=f?-l:l}while(0);return +e}function hd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;do if(a){if((c[a+76>>2]|0)<=-1){b=od(a)|0;break}d=(id(a)|0)==0;e=od(a)|0;if(d)b=e;else{jd(a);b=e}}else{if(!(c[4659]|0))f=0;else f=hd(c[4659]|0)|0;Da(18620);e=c[4654]|0;if(!e)g=f;else{d=e;e=f;while(1){if((c[d+76>>2]|0)>-1)h=id(d)|0;else h=0;if((c[d+20>>2]|0)>>>0>(c[d+28>>2]|0)>>>0)i=od(d)|0|e;else i=e;if(h)jd(d);d=c[d+56>>2]|0;if(!d){g=i;break}else e=i}}Aa(18620);b=g}while(0);return b|0}function id(a){a=a|0;return 0}function jd(a){a=a|0;return}function kd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=c[a+60>>2];a=fd(ma(6,d|0)|0)|0;i=b;return a|0}function ld(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+32|0;f=e;g=e+20|0;c[f>>2]=c[a+60>>2];c[f+4>>2]=0;c[f+8>>2]=b;c[f+12>>2]=g;c[f+16>>2]=d;if((fd(Ha(140,f|0)|0)|0)<0){c[g>>2]=-1;h=-1}else h=c[g>>2]|0;i=e;return h|0}function md(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;e=i;i=i+48|0;f=e+16|0;g=e;h=e+32|0;j=a+28|0;k=c[j>>2]|0;c[h>>2]=k;l=a+20|0;m=(c[l>>2]|0)-k|0;c[h+4>>2]=m;c[h+8>>2]=b;c[h+12>>2]=d;b=a+60|0;k=a+44|0;n=h;h=2;o=m+d|0;while(1){if(!(c[4648]|0)){c[f>>2]=c[b>>2];c[f+4>>2]=n;c[f+8>>2]=h;p=fd(Ia(146,f|0)|0)|0}else{Fa(8,a|0);c[g>>2]=c[b>>2];c[g+4>>2]=n;c[g+8>>2]=h;m=fd(Ia(146,g|0)|0)|0;ka(0);p=m}if((o|0)==(p|0)){q=6;break}if((p|0)<0){r=n;s=h;q=8;break}m=o-p|0;t=c[n+4>>2]|0;if(p>>>0<=t>>>0)if((h|0)==2){c[j>>2]=(c[j>>2]|0)+p;u=t;v=p;w=n;x=2}else{u=t;v=p;w=n;x=h}else{y=c[k>>2]|0;c[j>>2]=y;c[l>>2]=y;u=c[n+12>>2]|0;v=p-t|0;w=n+8|0;x=h+-1|0}c[w>>2]=(c[w>>2]|0)+v;c[w+4>>2]=u-v;n=w;h=x;o=m}if((q|0)==6){o=c[k>>2]|0;c[a+16>>2]=o+(c[a+48>>2]|0);k=o;c[j>>2]=k;c[l>>2]=k;z=d}else if((q|0)==8){c[a+16>>2]=0;c[j>>2]=0;c[l>>2]=0;c[a>>2]=c[a>>2]|32;if((s|0)==2)z=0;else z=d-(c[r+4>>2]|0)|0}i=e;return z|0}function nd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+80|0;g=f;c[b+36>>2]=4;if((c[b>>2]&64|0)==0?(c[g>>2]=c[b+60>>2],c[g+4>>2]=21505,c[g+8>>2]=f+12,(la(54,g|0)|0)!=0):0)a[b+75>>0]=-1;g=md(b,d,e)|0;i=f;return g|0}function od(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=a+20|0;d=a+28|0;if((c[b>>2]|0)>>>0>(c[d>>2]|0)>>>0?(Ka[c[a+36>>2]&7](a,0,0)|0,(c[b>>2]|0)==0):0)e=-1;else{f=a+4|0;g=c[f>>2]|0;h=a+8|0;i=c[h>>2]|0;if(g>>>0<i>>>0)Ka[c[a+40>>2]&7](a,g-i|0,1)|0;c[a+16>>2]=0;c[d>>2]=0;c[b>>2]=0;c[h>>2]=0;c[f>>2]=0;e=0}return e|0}function pd(a){a=a|0;if(!(c[a+68>>2]|0))jd(a);return}function qd(a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(i|0)){if(i>>>0<(c[4693]|0)>>>0)Ea();l=i+12|0;if((c[l>>2]|0)==(p|0)){c[l>>2]=q;c[o>>2]=i;s=c[4691]|0;break}else Ea()}else{c[4689]=e&~(1<<r);s=j}while(0);j=r<<3;e=j-b|0;c[p+4>>2]=b|3;i=p+b|0;c[p+(b|4)>>2]=e|1;c[p+j>>2]=e;if(s){j=c[4694]|0;o=s>>>3;q=o<<1;d=18796+(q<<2)|0;f=c[4689]|0;k=1<<o;if(f&k){o=18796+(q+2<<2)|0;h=c[o>>2]|0;if(h>>>0<(c[4693]|0)>>>0)Ea();else{t=o;u=h}}else{c[4689]=f|k;t=18796+(q+2<<2)|0;u=d}c[t>>2]=j;c[u+12>>2]=j;c[j+8>>2]=u;c[j+12>>2]=d}c[4691]=e;c[4694]=i;n=m;return n|0}i=c[4690]|0;if(i){e=(i&0-i)+-1|0;i=e>>>12&16;d=e>>>i;e=d>>>5&8;j=d>>>e;d=j>>>2&4;q=j>>>d;j=q>>>1&2;k=q>>>j;q=k>>>1&1;f=c[19060+((e|i|d|j|q)+(k>>>q)<<2)>>2]|0;q=(c[f+4>>2]&-8)-b|0;k=f;j=f;while(1){f=c[k+16>>2]|0;if(!f){d=c[k+20>>2]|0;if(!d){v=q;w=j;break}else x=d}else x=f;f=(c[x+4>>2]&-8)-b|0;d=f>>>0<q>>>0;q=d?f:q;k=x;j=d?x:j}j=c[4693]|0;if(w>>>0<j>>>0)Ea();k=w+b|0;if(w>>>0>=k>>>0)Ea();q=c[w+24>>2]|0;m=c[w+12>>2]|0;do if((m|0)==(w|0)){p=w+20|0;r=c[p>>2]|0;if(!r){d=w+16|0;f=c[d>>2]|0;if(!f){y=0;break}else{z=f;A=d}}else{z=r;A=p}while(1){p=z+20|0;r=c[p>>2]|0;if(r){z=r;A=p;continue}p=z+16|0;r=c[p>>2]|0;if(!r){B=z;C=A;break}else{z=r;A=p}}if(C>>>0<j>>>0)Ea();else{c[C>>2]=0;y=B;break}}else{p=c[w+8>>2]|0;if(p>>>0<j>>>0)Ea();r=p+12|0;if((c[r>>2]|0)!=(w|0))Ea();d=m+8|0;if((c[d>>2]|0)==(w|0)){c[r>>2]=m;c[d>>2]=p;y=m;break}else Ea()}while(0);do if(q){m=c[w+28>>2]|0;j=19060+(m<<2)|0;if((w|0)==(c[j>>2]|0)){c[j>>2]=y;if(!y){c[4690]=c[4690]&~(1<<m);break}}else{if(q>>>0<(c[4693]|0)>>>0)Ea();m=q+16|0;if((c[m>>2]|0)==(w|0))c[m>>2]=y;else c[q+20>>2]=y;if(!y)break}m=c[4693]|0;if(y>>>0<m>>>0)Ea();c[y+24>>2]=q;j=c[w+16>>2]|0;do if(j)if(j>>>0<m>>>0)Ea();else{c[y+16>>2]=j;c[j+24>>2]=y;break}while(0);j=c[w+20>>2]|0;if(j)if(j>>>0<(c[4693]|0)>>>0)Ea();else{c[y+20>>2]=j;c[j+24>>2]=y;break}}while(0);if(v>>>0<16){q=v+b|0;c[w+4>>2]=q|3;j=w+(q+4)|0;c[j>>2]=c[j>>2]|1}else{c[w+4>>2]=b|3;c[w+(b|4)>>2]=v|1;c[w+(v+b)>>2]=v;j=c[4691]|0;if(j){q=c[4694]|0;m=j>>>3;j=m<<1;p=18796+(j<<2)|0;d=c[4689]|0;r=1<<m;if(d&r){m=18796+(j+2<<2)|0;f=c[m>>2]|0;if(f>>>0<(c[4693]|0)>>>0)Ea();else{D=m;E=f}}else{c[4689]=d|r;D=18796+(j+2<<2)|0;E=p}c[D>>2]=q;c[E+12>>2]=q;c[q+8>>2]=E;c[q+12>>2]=p}c[4691]=v;c[4694]=k}n=w+8|0;return n|0}else F=b}else F=b}else if(a>>>0<=4294967231){p=a+11|0;q=p&-8;j=c[4690]|0;if(j){r=0-q|0;d=p>>>8;if(d)if(q>>>0>16777215)G=31;else{p=(d+1048320|0)>>>16&8;f=d<<p;d=(f+520192|0)>>>16&4;m=f<<d;f=(m+245760|0)>>>16&2;i=14-(d|p|f)+(m<<f>>>15)|0;G=q>>>(i+7|0)&1|i<<1}else G=0;i=c[19060+(G<<2)>>2]|0;a:do if(!i){H=r;I=0;J=0;K=86}else{f=r;m=0;p=q<<((G|0)==31?0:25-(G>>>1)|0);d=i;e=0;while(1){h=c[d+4>>2]&-8;o=h-q|0;if(o>>>0<f>>>0)if((h|0)==(q|0)){L=o;M=d;N=d;K=90;break a}else{O=o;P=d}else{O=f;P=e}o=c[d+20>>2]|0;d=c[d+16+(p>>>31<<2)>>2]|0;h=(o|0)==0|(o|0)==(d|0)?m:o;if(!d){H=O;I=h;J=P;K=86;break}else{f=O;m=h;p=p<<1;e=P}}}while(0);if((K|0)==86){if((I|0)==0&(J|0)==0){i=2<<G;r=j&(i|0-i);if(!r){F=q;break}i=(r&0-r)+-1|0;r=i>>>12&16;b=i>>>r;i=b>>>5&8;k=b>>>i;b=k>>>2&4;e=k>>>b;k=e>>>1&2;p=e>>>k;e=p>>>1&1;Q=c[19060+((i|r|b|k|e)+(p>>>e)<<2)>>2]|0;R=0}else{Q=I;R=J}if(!Q){S=H;T=R}else{L=H;M=Q;N=R;K=90}}if((K|0)==90)while(1){K=0;e=(c[M+4>>2]&-8)-q|0;p=e>>>0<L>>>0;k=p?e:L;e=p?M:N;p=c[M+16>>2]|0;if(p){L=k;M=p;N=e;K=90;continue}M=c[M+20>>2]|0;if(!M){S=k;T=e;break}else{L=k;N=e;K=90}}if((T|0)!=0?S>>>0<((c[4691]|0)-q|0)>>>0:0){j=c[4693]|0;if(T>>>0<j>>>0)Ea();e=T+q|0;if(T>>>0>=e>>>0)Ea();k=c[T+24>>2]|0;p=c[T+12>>2]|0;do if((p|0)==(T|0)){b=T+20|0;r=c[b>>2]|0;if(!r){i=T+16|0;m=c[i>>2]|0;if(!m){U=0;break}else{V=m;W=i}}else{V=r;W=b}while(1){b=V+20|0;r=c[b>>2]|0;if(r){V=r;W=b;continue}b=V+16|0;r=c[b>>2]|0;if(!r){X=V;Y=W;break}else{V=r;W=b}}if(Y>>>0<j>>>0)Ea();else{c[Y>>2]=0;U=X;break}}else{b=c[T+8>>2]|0;if(b>>>0<j>>>0)Ea();r=b+12|0;if((c[r>>2]|0)!=(T|0))Ea();i=p+8|0;if((c[i>>2]|0)==(T|0)){c[r>>2]=p;c[i>>2]=b;U=p;break}else Ea()}while(0);do if(k){p=c[T+28>>2]|0;j=19060+(p<<2)|0;if((T|0)==(c[j>>2]|0)){c[j>>2]=U;if(!U){c[4690]=c[4690]&~(1<<p);break}}else{if(k>>>0<(c[4693]|0)>>>0)Ea();p=k+16|0;if((c[p>>2]|0)==(T|0))c[p>>2]=U;else c[k+20>>2]=U;if(!U)break}p=c[4693]|0;if(U>>>0<p>>>0)Ea();c[U+24>>2]=k;j=c[T+16>>2]|0;do if(j)if(j>>>0<p>>>0)Ea();else{c[U+16>>2]=j;c[j+24>>2]=U;break}while(0);j=c[T+20>>2]|0;if(j)if(j>>>0<(c[4693]|0)>>>0)Ea();else{c[U+20>>2]=j;c[j+24>>2]=U;break}}while(0);b:do if(S>>>0>=16){c[T+4>>2]=q|3;c[T+(q|4)>>2]=S|1;c[T+(S+q)>>2]=S;k=S>>>3;if(S>>>0<256){j=k<<1;p=18796+(j<<2)|0;b=c[4689]|0;i=1<<k;if(b&i){k=18796+(j+2<<2)|0;r=c[k>>2]|0;if(r>>>0<(c[4693]|0)>>>0)Ea();else{Z=k;_=r}}else{c[4689]=b|i;Z=18796+(j+2<<2)|0;_=p}c[Z>>2]=e;c[_+12>>2]=e;c[T+(q+8)>>2]=_;c[T+(q+12)>>2]=p;break}p=S>>>8;if(p)if(S>>>0>16777215)$=31;else{j=(p+1048320|0)>>>16&8;i=p<<j;p=(i+520192|0)>>>16&4;b=i<<p;i=(b+245760|0)>>>16&2;r=14-(p|j|i)+(b<<i>>>15)|0;$=S>>>(r+7|0)&1|r<<1}else $=0;r=19060+($<<2)|0;c[T+(q+28)>>2]=$;c[T+(q+20)>>2]=0;c[T+(q+16)>>2]=0;i=c[4690]|0;b=1<<$;if(!(i&b)){c[4690]=i|b;c[r>>2]=e;c[T+(q+24)>>2]=r;c[T+(q+12)>>2]=e;c[T+(q+8)>>2]=e;break}b=c[r>>2]|0;c:do if((c[b+4>>2]&-8|0)!=(S|0)){r=S<<(($|0)==31?0:25-($>>>1)|0);i=b;while(1){j=i+16+(r>>>31<<2)|0;p=c[j>>2]|0;if(!p){aa=j;ba=i;break}if((c[p+4>>2]&-8|0)==(S|0)){ca=p;break c}else{r=r<<1;i=p}}if(aa>>>0<(c[4693]|0)>>>0)Ea();else{c[aa>>2]=e;c[T+(q+24)>>2]=ba;c[T+(q+12)>>2]=e;c[T+(q+8)>>2]=e;break b}}else ca=b;while(0);b=ca+8|0;i=c[b>>2]|0;r=c[4693]|0;if(i>>>0>=r>>>0&ca>>>0>=r>>>0){c[i+12>>2]=e;c[b>>2]=e;c[T+(q+8)>>2]=i;c[T+(q+12)>>2]=ca;c[T+(q+24)>>2]=0;break}else Ea()}else{i=S+q|0;c[T+4>>2]=i|3;b=T+(i+4)|0;c[b>>2]=c[b>>2]|1}while(0);n=T+8|0;return n|0}else F=q}else F=q}else F=-1;while(0);T=c[4691]|0;if(T>>>0>=F>>>0){S=T-F|0;ca=c[4694]|0;if(S>>>0>15){c[4694]=ca+F;c[4691]=S;c[ca+(F+4)>>2]=S|1;c[ca+T>>2]=S;c[ca+4>>2]=F|3}else{c[4691]=0;c[4694]=0;c[ca+4>>2]=T|3;S=ca+(T+4)|0;c[S>>2]=c[S>>2]|1}n=ca+8|0;return n|0}ca=c[4692]|0;if(ca>>>0>F>>>0){S=ca-F|0;c[4692]=S;ca=c[4695]|0;c[4695]=ca+F;c[ca+(F+4)>>2]=S|1;c[ca+4>>2]=F|3;n=ca+8|0;return n|0}do if(!(c[4807]|0)){ca=xa(30)|0;if(!(ca+-1&ca)){c[4809]=ca;c[4808]=ca;c[4810]=-1;c[4811]=-1;c[4812]=0;c[4800]=0;c[4807]=(Ga(0)|0)&-16^1431655768;break}else Ea()}while(0);ca=F+48|0;S=c[4809]|0;T=F+47|0;ba=S+T|0;aa=0-S|0;S=ba&aa;if(S>>>0<=F>>>0){n=0;return n|0}$=c[4799]|0;if(($|0)!=0?(_=c[4797]|0,Z=_+S|0,Z>>>0<=_>>>0|Z>>>0>$>>>0):0){n=0;return n|0}d:do if(!(c[4800]&4)){$=c[4695]|0;e:do if($){Z=19204;while(1){_=c[Z>>2]|0;if(_>>>0<=$>>>0?(U=Z+4|0,(_+(c[U>>2]|0)|0)>>>0>$>>>0):0){da=Z;ea=U;break}Z=c[Z+8>>2]|0;if(!Z){K=174;break e}}Z=ba-(c[4692]|0)&aa;if(Z>>>0<2147483647){U=ta(Z|0)|0;_=(U|0)==((c[da>>2]|0)+(c[ea>>2]|0)|0);X=_?Z:0;if(_)if((U|0)==(-1|0))fa=X;else{ga=U;ha=X;K=194;break d}else{ia=U;ja=Z;ka=X;K=184}}else fa=0}else K=174;while(0);do if((K|0)==174){$=ta(0)|0;if(($|0)!=(-1|0)){q=$;X=c[4808]|0;Z=X+-1|0;if(!(Z&q))la=S;else la=S-q+(Z+q&0-X)|0;X=c[4797]|0;q=X+la|0;if(la>>>0>F>>>0&la>>>0<2147483647){Z=c[4799]|0;if((Z|0)!=0?q>>>0<=X>>>0|q>>>0>Z>>>0:0){fa=0;break}Z=ta(la|0)|0;q=(Z|0)==($|0);X=q?la:0;if(q){ga=$;ha=X;K=194;break d}else{ia=Z;ja=la;ka=X;K=184}}else fa=0}else fa=0}while(0);f:do if((K|0)==184){X=0-ja|0;do if(ca>>>0>ja>>>0&(ja>>>0<2147483647&(ia|0)!=(-1|0))?(Z=c[4809]|0,$=T-ja+Z&0-Z,$>>>0<2147483647):0)if((ta($|0)|0)==(-1|0)){ta(X|0)|0;fa=ka;break f}else{ma=$+ja|0;break}else ma=ja;while(0);if((ia|0)==(-1|0))fa=ka;else{ga=ia;ha=ma;K=194;break d}}while(0);c[4800]=c[4800]|4;na=fa;K=191}else{na=0;K=191}while(0);if((((K|0)==191?S>>>0<2147483647:0)?(fa=ta(S|0)|0,S=ta(0)|0,fa>>>0<S>>>0&((fa|0)!=(-1|0)&(S|0)!=(-1|0))):0)?(ma=S-fa|0,S=ma>>>0>(F+40|0)>>>0,S):0){ga=fa;ha=S?ma:na;K=194}if((K|0)==194){na=(c[4797]|0)+ha|0;c[4797]=na;if(na>>>0>(c[4798]|0)>>>0)c[4798]=na;na=c[4695]|0;g:do if(na){ma=19204;do{S=c[ma>>2]|0;fa=ma+4|0;ia=c[fa>>2]|0;if((ga|0)==(S+ia|0)){oa=S;pa=fa;qa=ia;ra=ma;K=204;break}ma=c[ma+8>>2]|0}while((ma|0)!=0);if(((K|0)==204?(c[ra+12>>2]&8|0)==0:0)?na>>>0<ga>>>0&na>>>0>=oa>>>0:0){c[pa>>2]=qa+ha;ma=(c[4692]|0)+ha|0;ia=na+8|0;fa=(ia&7|0)==0?0:0-ia&7;ia=ma-fa|0;c[4695]=na+fa;c[4692]=ia;c[na+(fa+4)>>2]=ia|1;c[na+(ma+4)>>2]=40;c[4696]=c[4811];break}ma=c[4693]|0;if(ga>>>0<ma>>>0){c[4693]=ga;sa=ga}else sa=ma;ma=ga+ha|0;ia=19204;while(1){if((c[ia>>2]|0)==(ma|0)){ua=ia;va=ia;K=212;break}ia=c[ia+8>>2]|0;if(!ia){wa=19204;break}}if((K|0)==212)if(!(c[va+12>>2]&8)){c[ua>>2]=ga;ia=va+4|0;c[ia>>2]=(c[ia>>2]|0)+ha;ia=ga+8|0;ma=(ia&7|0)==0?0:0-ia&7;ia=ga+(ha+8)|0;fa=(ia&7|0)==0?0:0-ia&7;ia=ga+(fa+ha)|0;S=ma+F|0;ka=ga+S|0;ja=ia-(ga+ma)-F|0;c[ga+(ma+4)>>2]=F|3;h:do if((ia|0)!=(na|0)){if((ia|0)==(c[4694]|0)){T=(c[4691]|0)+ja|0;c[4691]=T;c[4694]=ka;c[ga+(S+4)>>2]=T|1;c[ga+(T+S)>>2]=T;break}T=ha+4|0;ca=c[ga+(T+fa)>>2]|0;if((ca&3|0)==1){la=ca&-8;ea=ca>>>3;i:do if(ca>>>0>=256){da=c[ga+((fa|24)+ha)>>2]|0;aa=c[ga+(ha+12+fa)>>2]|0;do if((aa|0)==(ia|0)){ba=fa|16;X=ga+(T+ba)|0;$=c[X>>2]|0;if(!$){Z=ga+(ba+ha)|0;ba=c[Z>>2]|0;if(!ba){ya=0;break}else{za=ba;Aa=Z}}else{za=$;Aa=X}while(1){X=za+20|0;$=c[X>>2]|0;if($){za=$;Aa=X;continue}X=za+16|0;$=c[X>>2]|0;if(!$){Ba=za;Ca=Aa;break}else{za=$;Aa=X}}if(Ca>>>0<sa>>>0)Ea();else{c[Ca>>2]=0;ya=Ba;break}}else{X=c[ga+((fa|8)+ha)>>2]|0;if(X>>>0<sa>>>0)Ea();$=X+12|0;if((c[$>>2]|0)!=(ia|0))Ea();Z=aa+8|0;if((c[Z>>2]|0)==(ia|0)){c[$>>2]=aa;c[Z>>2]=X;ya=aa;break}else Ea()}while(0);if(!da)break;aa=c[ga+(ha+28+fa)>>2]|0;X=19060+(aa<<2)|0;do if((ia|0)!=(c[X>>2]|0)){if(da>>>0<(c[4693]|0)>>>0)Ea();Z=da+16|0;if((c[Z>>2]|0)==(ia|0))c[Z>>2]=ya;else c[da+20>>2]=ya;if(!ya)break i}else{c[X>>2]=ya;if(ya)break;c[4690]=c[4690]&~(1<<aa);break i}while(0);aa=c[4693]|0;if(ya>>>0<aa>>>0)Ea();c[ya+24>>2]=da;X=fa|16;Z=c[ga+(X+ha)>>2]|0;do if(Z)if(Z>>>0<aa>>>0)Ea();else{c[ya+16>>2]=Z;c[Z+24>>2]=ya;break}while(0);Z=c[ga+(T+X)>>2]|0;if(!Z)break;if(Z>>>0<(c[4693]|0)>>>0)Ea();else{c[ya+20>>2]=Z;c[Z+24>>2]=ya;break}}else{Z=c[ga+((fa|8)+ha)>>2]|0;aa=c[ga+(ha+12+fa)>>2]|0;da=18796+(ea<<1<<2)|0;do if((Z|0)!=(da|0)){if(Z>>>0<sa>>>0)Ea();if((c[Z+12>>2]|0)==(ia|0))break;Ea()}while(0);if((aa|0)==(Z|0)){c[4689]=c[4689]&~(1<<ea);break}do if((aa|0)==(da|0))Da=aa+8|0;else{if(aa>>>0<sa>>>0)Ea();X=aa+8|0;if((c[X>>2]|0)==(ia|0)){Da=X;break}Ea()}while(0);c[Z+12>>2]=aa;c[Da>>2]=Z}while(0);Fa=ga+((la|fa)+ha)|0;Ha=la+ja|0}else{Fa=ia;Ha=ja}ea=Fa+4|0;c[ea>>2]=c[ea>>2]&-2;c[ga+(S+4)>>2]=Ha|1;c[ga+(Ha+S)>>2]=Ha;ea=Ha>>>3;if(Ha>>>0<256){T=ea<<1;ca=18796+(T<<2)|0;da=c[4689]|0;X=1<<ea;do if(!(da&X)){c[4689]=da|X;Ia=18796+(T+2<<2)|0;Ja=ca}else{ea=18796+(T+2<<2)|0;$=c[ea>>2]|0;if($>>>0>=(c[4693]|0)>>>0){Ia=ea;Ja=$;break}Ea()}while(0);c[Ia>>2]=ka;c[Ja+12>>2]=ka;c[ga+(S+8)>>2]=Ja;c[ga+(S+12)>>2]=ca;break}T=Ha>>>8;do if(!T)Ka=0;else{if(Ha>>>0>16777215){Ka=31;break}X=(T+1048320|0)>>>16&8;da=T<<X;la=(da+520192|0)>>>16&4;$=da<<la;da=($+245760|0)>>>16&2;ea=14-(la|X|da)+($<<da>>>15)|0;Ka=Ha>>>(ea+7|0)&1|ea<<1}while(0);T=19060+(Ka<<2)|0;c[ga+(S+28)>>2]=Ka;c[ga+(S+20)>>2]=0;c[ga+(S+16)>>2]=0;ca=c[4690]|0;ea=1<<Ka;if(!(ca&ea)){c[4690]=ca|ea;c[T>>2]=ka;c[ga+(S+24)>>2]=T;c[ga+(S+12)>>2]=ka;c[ga+(S+8)>>2]=ka;break}ea=c[T>>2]|0;j:do if((c[ea+4>>2]&-8|0)!=(Ha|0)){T=Ha<<((Ka|0)==31?0:25-(Ka>>>1)|0);ca=ea;while(1){da=ca+16+(T>>>31<<2)|0;$=c[da>>2]|0;if(!$){La=da;Ma=ca;break}if((c[$+4>>2]&-8|0)==(Ha|0)){Na=$;break j}else{T=T<<1;ca=$}}if(La>>>0<(c[4693]|0)>>>0)Ea();else{c[La>>2]=ka;c[ga+(S+24)>>2]=Ma;c[ga+(S+12)>>2]=ka;c[ga+(S+8)>>2]=ka;break h}}else Na=ea;while(0);ea=Na+8|0;ca=c[ea>>2]|0;T=c[4693]|0;if(ca>>>0>=T>>>0&Na>>>0>=T>>>0){c[ca+12>>2]=ka;c[ea>>2]=ka;c[ga+(S+8)>>2]=ca;c[ga+(S+12)>>2]=Na;c[ga+(S+24)>>2]=0;break}else Ea()}else{ca=(c[4692]|0)+ja|0;c[4692]=ca;c[4695]=ka;c[ga+(S+4)>>2]=ca|1}while(0);n=ga+(ma|8)|0;return n|0}else wa=19204;while(1){S=c[wa>>2]|0;if(S>>>0<=na>>>0?(ka=c[wa+4>>2]|0,ja=S+ka|0,ja>>>0>na>>>0):0){Oa=S;Pa=ka;Qa=ja;break}wa=c[wa+8>>2]|0}ma=Oa+(Pa+-39)|0;ja=Oa+(Pa+-47+((ma&7|0)==0?0:0-ma&7))|0;ma=na+16|0;ka=ja>>>0<ma>>>0?na:ja;ja=ka+8|0;S=ga+8|0;ia=(S&7|0)==0?0:0-S&7;S=ha+-40-ia|0;c[4695]=ga+ia;c[4692]=S;c[ga+(ia+4)>>2]=S|1;c[ga+(ha+-36)>>2]=40;c[4696]=c[4811];S=ka+4|0;c[S>>2]=27;c[ja>>2]=c[4801];c[ja+4>>2]=c[4802];c[ja+8>>2]=c[4803];c[ja+12>>2]=c[4804];c[4801]=ga;c[4802]=ha;c[4804]=0;c[4803]=ja;ja=ka+28|0;c[ja>>2]=7;if((ka+32|0)>>>0<Qa>>>0){ia=ja;do{ja=ia;ia=ia+4|0;c[ia>>2]=7}while((ja+8|0)>>>0<Qa>>>0)}if((ka|0)!=(na|0)){ia=ka-na|0;c[S>>2]=c[S>>2]&-2;c[na+4>>2]=ia|1;c[ka>>2]=ia;ja=ia>>>3;if(ia>>>0<256){fa=ja<<1;ca=18796+(fa<<2)|0;ea=c[4689]|0;T=1<<ja;if(ea&T){ja=18796+(fa+2<<2)|0;Z=c[ja>>2]|0;if(Z>>>0<(c[4693]|0)>>>0)Ea();else{Ra=ja;Sa=Z}}else{c[4689]=ea|T;Ra=18796+(fa+2<<2)|0;Sa=ca}c[Ra>>2]=na;c[Sa+12>>2]=na;c[na+8>>2]=Sa;c[na+12>>2]=ca;break}ca=ia>>>8;if(ca)if(ia>>>0>16777215)Ta=31;else{fa=(ca+1048320|0)>>>16&8;T=ca<<fa;ca=(T+520192|0)>>>16&4;ea=T<<ca;T=(ea+245760|0)>>>16&2;Z=14-(ca|fa|T)+(ea<<T>>>15)|0;Ta=ia>>>(Z+7|0)&1|Z<<1}else Ta=0;Z=19060+(Ta<<2)|0;c[na+28>>2]=Ta;c[na+20>>2]=0;c[ma>>2]=0;T=c[4690]|0;ea=1<<Ta;if(!(T&ea)){c[4690]=T|ea;c[Z>>2]=na;c[na+24>>2]=Z;c[na+12>>2]=na;c[na+8>>2]=na;break}ea=c[Z>>2]|0;k:do if((c[ea+4>>2]&-8|0)!=(ia|0)){Z=ia<<((Ta|0)==31?0:25-(Ta>>>1)|0);T=ea;while(1){fa=T+16+(Z>>>31<<2)|0;ca=c[fa>>2]|0;if(!ca){Ua=fa;Va=T;break}if((c[ca+4>>2]&-8|0)==(ia|0)){Wa=ca;break k}else{Z=Z<<1;T=ca}}if(Ua>>>0<(c[4693]|0)>>>0)Ea();else{c[Ua>>2]=na;c[na+24>>2]=Va;c[na+12>>2]=na;c[na+8>>2]=na;break g}}else Wa=ea;while(0);ea=Wa+8|0;ia=c[ea>>2]|0;ma=c[4693]|0;if(ia>>>0>=ma>>>0&Wa>>>0>=ma>>>0){c[ia+12>>2]=na;c[ea>>2]=na;c[na+8>>2]=ia;c[na+12>>2]=Wa;c[na+24>>2]=0;break}else Ea()}}else{ia=c[4693]|0;if((ia|0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=d[s+6>>0]<<8|d[s+5>>0];$=6;break}if((o|0)==15){aa=((d[s+6>>0]<<8|d[s+5>>0])+7|0)>>>3;ba=x}else{aa=j;ba=x}}else{_=t;$=6}while(0);if(($|0)==6)if(Y>>>0>8|(x|0)!=0){aa=_;ba=x}else{aa=_;ba=d[s+8>>0]<<8|d[s+7>>0]}if(u){_=a[s+3>>0]|0;if((_&255)>15){ca=0;i=y;return ca|0}x=_&255;_=d[s+4>>0]&1;s=X+24+(_*192|0)+(x*12|0)|0;Y=(c[X+24+(_*192|0)+(x*12|0)+4>>2]|0)-(c[s>>2]|0)>>2;if(r>>>0>Y>>>0){rc(s,r-Y|0);da=s}else da=s}else da=0;if((m|0)==0&(n|0)!=0){ca=0;i=y;return ca|0}s=m+n|0;n=f+172|0;Y=c[n>>2]|0;c[K>>2]=0;x=K+4|0;c[x>>2]=0;c[K+8>>2]=0;if(!Y)ea=0;else{cc(K,Y);ea=c[n>>2]|0}_=K+12|0;c[_>>2]=Y>>>1;Y=f+16|0;t=f+12|0;fa=ea+(((c[Y>>2]|0)-(c[t>>2]|0)|0)/11|0)|0;if((o&-2|0)==6){ea=qd(r*12|0)|0;if(!ea)ga=0;else{ha=ea+(r<<3)|0;ia=ea;$=18}}else{ha=0;ia=0;$=18}a:do if(($|0)==18){ea=(c[X+4>>2]|0)-(c[X>>2]|0)>>2;do if(ea>>>0<j>>>0){sc(X,j-ea|0);ja=X+12|0;ka=X+16|0;la=c[ka>>2]|0;ma=c[ja>>2]|0;na=la-ma>>2;if(na>>>0<j>>>0){sc(ja,j-na|0);break}if(na>>>0>j>>>0?(na=ma+(j<<2)|0,(la|0)!=(na|0)):0)c[ka>>2]=la+(~((la+-4-na|0)>>>2)<<2)}while(0);b:do if(l){ea=(j|0)==0;na=f+32|0;la=f+28|0;ka=f+40|0;ma=f+52|0;ja=f+68|0;pa=f+64|0;qa=f+76|0;ra=f+4|0;sa=f+88|0;ta=u^1;ua=f+104|0;va=f+100|0;wa=f+112|0;xa=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){case 0:{if(!ne){$=58;break c}else{kf=se;$=82}break}case 1:{if(ee){$=61;break c}kf=e[(c[$d>>2]|0)+(ne<<2)>>1]|0;$=82;break}case 2:{if(u){Oe=c[(c[da>>2]|0)+(ne+be<<2)>>2]|0;lf=we;mf=xe;nf=ye;of=Oe&65535;pf=Oe>>>16;$=83;break e}if(!(fe&(ne|0)!=0)){$=67;break c}lf=we;mf=xe;nf=ye;of=e[(c[$d>>2]|0)+(ne+-1<<2)>>1]|0;pf=0;$=83;break}default:{if((c[ja>>2]|0)==(c[pa>>2]|0)){$=71;break c}else{qf=we;rf=ye;sf=xe}while(1){if(qf>>>0>=16){tf=sf;uf=rf;vf=qf;break}if(rf>>>0<s>>>0){wf=rf+1|0;xf=d[rf>>0]|0}else{wf=rf;xf=0}sf=xf<<qf|sf;qf=qf+8|0;if(qf>>>0>=33){$=76;break c}else rf=wf}Oe=c[(c[qa>>2]|0)+((tf&1023)<<2)>>2]|0;if((Oe|0)>-1){yf=Oe>>16;zf=Oe&65535}else{Pe=c[sa>>2]|0;Ke=10;Qe=Oe;while(1){Oe=Ke+1|0;Af=b[Pe+((tf>>>Ke&1)+~Qe<<1)>>1]|0;Bf=Af<<16>>16;if(Af<<16>>16<0){Ke=Oe;Qe=Bf}else{yf=Oe;zf=Bf;break}}}Qe=zf+se|0;Ke=(c[ra>>2]|0)-(c[f>>2]|0)>>3;lf=vf-yf|0;mf=tf>>>yf;nf=uf;of=Qe-(Qe>>>0<Ke>>>0?0:Ke)|0;pf=0;$=83}}while(0);if(($|0)==82){$=0;Ke=kf&65535;b[(c[ae>>2]|0)+(ne<<2)>>1]=Ke;Cf=Ke;Df=ye;Ef=xe;Ff=we;Gf=kf;$=84}else if(($|0)==83){$=0;Ke=of&65535;b[(c[ae>>2]|0)+(ne<<2)>>1]=Ke;if((Ne|0)!=2|ta){Cf=Ke;Df=nf;Ef=mf;Ff=lf;Gf=of;$=84}else{Hf=Ke;If=lf;Jf=mf;Kf=nf;Lf=pe;Mf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>>>0<s>>>0){lg=hg+1|0;mg=d[hg>>0]|0}else{lg=hg;mg=0}Qe=mg<<Af|Qe;Af=Af+8|0;if(Af>>>0>=33){$=114;break c}else hg=lg}hg=ig>>>8;Af=kg+-8|0;Qe=ig&127;if(!(ig&128)){ng=Af;og=hg;pg=jg;qg=Qe;break}else{rg=Af;sg=jg;tg=hg}while(1){if(rg>>>0>=8){ug=tg;vg=sg;wg=rg;break}if(sg>>>0<s>>>0){xg=sg+1|0;yg=d[sg>>0]|0}else{xg=sg;yg=0}tg=yg<<rg|tg;rg=rg+8|0;if(rg>>>0>=33){$=114;break c}else sg=xg}hg=ug>>>8;Af=wg+-8|0;gg=ug<<7&16256|Qe;if(!(ug&128)){ng=Af;og=hg;pg=vg;qg=gg;break}else{zg=Af;Ag=vg;Bg=hg}while(1){if(zg>>>0>=8){Cg=Bg;Dg=Ag;Eg=zg;break}if(Ag>>>0<s>>>0){Fg=Ag+1|0;Gg=d[Ag>>0]|0}else{Fg=Ag;Gg=0}Bg=Gg<<zg|Bg;zg=zg+8|0;if(zg>>>0>=33){$=114;break c}else Ag=Fg}Qe=Cg>>>8;hg=Eg+-8|0;Af=Cg<<14&2080768|gg;if(!(Cg&128)){ng=hg;og=Qe;pg=Dg;qg=Af;break}else{Hg=hg;Ig=Dg;Jg=Qe}while(1){if(Hg>>>0>=8){Kg=Jg;Lg=Ig;Mg=Hg;break}if(Ig>>>0<s>>>0){Ng=Ig+1|0;Og=d[Ig>>0]|0}else{Ng=Ig;Og=0}Jg=Og<<Hg|Jg;Hg=Hg+8|0;if(Hg>>>0>=33){$=114;break c}else Ig=Ng}gg=Kg>>>8;Qe=Mg+-8|0;hg=Kg<<21&266338304|Af;if(!(Kg&128)){ng=Qe;og=gg;pg=Lg;qg=hg;break}else{Pg=Qe;Qg=Lg;Rg=gg}while(1){if(Pg>>>0>=8){Sg=Rg;Tg=Qg;Ug=Pg;break}if(Qg>>>0<s>>>0){Vg=Qg+1|0;Wg=d[Qg>>0]|0}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h=ge;break f}if(!(ih&4)){ah=je;bh=ie;ch=he;dh=ge;break f}a[h+(hh+4)>>0]=0;a[h+(hh+5)>>0]=0;a[h+(hh+6)>>0]=85;a[h+(hh+7)>>0]=85;ah=je;bh=ie;ch=he;dh=ge;break f;break}case 4:{hh=Z(ne+ce|0,p)|0;ih=h+hh|0;fh=a[Ke+(Nf*11|0)+8>>0]|0;gh=fh&255;lh=a[Ke+(Nf*11|0)+9>>0]|0;eh=lh&255;kh=d[Qe+(Mf<<3)+4>>0]|0;g:do if(fh<<24>>24==lh<<24>>24){if((fh&255)>=4){$=149;break c}jh=d[Oe>>0]|0;mh=(jh<<3|jh>>>2)+(c[17484+(kh<<4)+(gh<<2)>>2]|0)|0;if(mh>>>0>255)if((mh|0)<0){nh=0;$=152}else oh=255;else{nh=mh;$=152}if(($|0)==152){$=0;oh=nh}mh=oh&255;a[ih>>0]=mh;a[h+(hh+1)>>0]=mh;mh=h+(hh+2)|0;a[mh>>0]=0;a[mh+1>>0]=0;a[mh+2>>0]=0;a[mh+3>>0]=0;a[mh+4>>0]=0;a[mh+5>>0]=0}else{if((a[Ke+(Nf*11|0)+10>>0]|0)==2){nb(F,Oe,kh);mh=a[F+(eh<<2)>>0]|0;a[ih>>0]=a[F+(gh<<2)>>0]|0;a[h+(hh+1)>>0]=mh;mh=0;while(1){jh=Ke+(Nf*11|0)+mh|0;ph=mh<<2;qh=0;do{if((qh|mh)>>>0>=4){$=159;break c}rh=(qh+ph|0)*3|0;sh=rh>>>3;th=rh&7;uh=ih+2+sh|0;vh=d[uh>>0]|0;wh=rh>>>0<40;if(wh)xh=d[sh+1+(ih+2)>>0]<<8|vh;else xh=vh;vh=xh&~(7<<th)|(((d[jh>>0]|0)>>>(qh<<1)&3|0)==(eh|0)&1)<<th;a[uh>>0]=vh;if(wh)a[sh+1+(ih+2)>>0]=vh>>>8;qh=qh+1|0}while(qh>>>0<4);mh=mh+1|0;if(mh>>>0>=4)break g}}h:do switch(fh<<24>>24){case 0:{if(lh<<24>>24==3){yh=0;break h}if(lh<<24>>24==2)yh=2;else $=180;break}case 1:{if(lh<<24>>24==3){yh=1;break h}if(lh<<24>>24==2)yh=3;else $=180;break}default:$=180}while(0);if(($|0)==180){$=0;yh=4}mh=yh>>>0>3?0:yh;qh=(d[Oe>>0]|0)+(kh<<5)|0;a[ih>>0]=a[209052+(qh<<4)+(mh<<2)>>0]|0;a[h+(hh+1)>>0]=a[209052+(qh<<4)+(mh<<2)+1>>0]|0;jh=209052+(qh<<4)+(mh<<2)+2|0;mh=0;do{qh=Ke+(Nf*11|0)+mh|0;ph=mh<<2;vh=0;do{if((vh|mh)>>>0>=4){$=170;break c}sh=(vh+ph|0)*3|0;wh=sh>>>3;uh=sh&7;th=ih+2+wh|0;rh=d[th>>0]|0;zh=sh>>>0<40;if(zh)Ah=d[wh+1+(ih+2)>>0]<<8|rh;else Ah=rh;rh=Ah&~(7<<uh)|((e[jh>>1]|0)>>>(((d[qh>>0]|0)>>>(vh<<1)&3)*3|0)&7)<<uh;a[th>>0]=rh;if(zh)a[wh+1+(ih+2)>>0]=rh>>>8;vh=vh+1|0}while(vh>>>0<4);mh=mh+1|0}while(mh>>>0<4)}while(0);ah=je;bh=ie;ch=he;dh=ge;break f;break}case 6:{ih=a[Oe>>0]|0;hh=a[Oe+1>>0]|0;kh=d[Oe+2>>0]|0;lh=(hh&255)<31?(hh&255)<<5:992;hh=(kh>>>0<31?kh:31)|lh;kh=(lh|((ih&255)<31?(ih&255)<<10:31744))>>>7&248|ge&7;ih=kh&255;lh=hh>>>2&248|he&7;fh=lh&255;eh=hh<<3|ie&7;hh=eh&255;gh=Qe+(Mf<<3)+4|0;hg=a[gh>>0]|0;mh=hg&255;if((hg&255)>=8){$=183;break c}hg=mh<<5|je&3|mh<<2;mh=a[Ke+(Nf*11|0)+4>>0]|0;jh=a[Ke+(Nf*11|0)+5>>0]|0;vh=a[Ke+(Nf*11|0)+6>>0]|0;qh=ne+be|0;ph=Hd(d[Ke+(Nf*11|0)+7>>0]|0,0,56)|0;rh=B;wh=Hd(vh&255|0,0,48)|0;vh=B;zh=Hd(jh&255|0,0,40)|0;jh=ia+(qh<<3)|0;c[jh>>2]=kh|hg<<24|eh<<16&16711680|lh<<8|zh|wh|ph;c[jh+4>>2]=mh&255|B|vh|rh;rh=hg&255;hg=d[gh>>0]|0;gh=d[Ke+(Nf*11|0)+9>>0]|0;vh=c[Oe>>2]|0;mh=vh&255;jh=vh>>>5;ph=vh>>>10&63;wh=vh>>>13;zh=vh>>>18&63;vh=mh<<3&248|mh>>>2;mh=c[17484+(hg<<4)+(d[Ke+(Nf*11|0)+8>>0]<<2)>>2]|0;lh=vh+mh|0;if(lh>>>0>255)if((lh|0)<0){Bh=0;$=186}else Ch=255;else{Bh=lh;$=186}if(($|0)==186){$=0;Ch=Bh}lh=jh&248|ph;ph=lh+mh|0;if(ph>>>0>255)if((ph|0)<0){Dh=0;$=189}else Eh=255;else{Dh=ph;$=189}if(($|0)==189){$=0;Eh=Dh}ph=wh&248|zh;zh=ph+mh|0;if(zh>>>0>255)if((zh|0)<0){Fh=0;$=192}else Gh=255;else{Fh=zh;$=192}if(($|0)==192){$=0;Gh=Fh}zh=Ch&255;mh=Eh&255;wh=Gh&255;jh=c[17484+(hg<<4)+(gh<<2)>>2]|0;gh=jh+vh|0;if(gh>>>0>255)if((gh|0)<0){Hh=0;$=195}else Ih=255;else{Hh=gh;$=195}if(($|0)==195){$=0;Ih=Hh}gh=jh+lh|0;if(gh>>>0>255)if((gh|0)<0){Jh=0;$=198}else Kh=255;else{Jh=gh;$=198}if(($|0)==198){$=0;Kh=Jh}gh=jh+ph|0;if(gh>>>0>255)if((gh|0)<0){Lh=0;$=201}else Mh=255;else{Lh=gh;$=201}if(($|0)==201){$=0;Mh=Lh}if((zh&255)>(Ih&255)){$=203;break c}if((mh&255)>(Kh&255)){$=205;break c}if((wh&255)>(Mh&255)){$=207;break c}wh=d[499984+(Gh&255)>>0]<<1;if(wh>>>0>=32){$=209;break c}mh=wh|d[499728+(Eh&255)>>0]<<5|d[499728+(Ch&255)>>0]<<10|32768;if(mh>>>0>=65536){$=211;break c}wh=d[500315+(Mh&255)>>0]|d[500315+(Kh&255)>>0]<<5|d[500315+(Ih&255)>>0]<<10|32768;if(wh>>>0>=65536){$=213;break c}c[ha+(qh<<2)>>2]=wh<<16|mh&65534;ah=rh;bh=hh;ch=fh;dh=ih;break f;break}case 7:{if(Da){$=216;break c}ih=a[Oe>>0]|0;fh=a[Oe+1>>0]|0;hh=d[Oe+2>>0]|0;rh=(fh&255)<31?(fh&255)<<5:992;fh=(hh>>>0<31?hh:31)|rh;hh=(rh|((ih&255)<31?(ih&255)<<10:31744))>>>7&248|ge&7;ih=hh&255;rh=fh>>>2&248|he&7;mh=rh&255;wh=fh<<3|ie&7;fh=wh&255;qh=Qe+(Mf<<3)+4|0;zh=a[qh>>0]|0;gh=zh&255;if((zh&255)>=8){$=218;break c}zh=gh<<5|je&3|gh<<2;gh=a[Af>>0]|0;ph=a[Ke+(Nf*11|0)+1>>0]|0;jh=a[Ke+(Nf*11|0)+2>>0]|0;lh=ne+be|0;vh=Hd(d[Ke+(Nf*11|0)+3>>0]|0,0,56)|0;hg=B;eh=Hd(jh&255|0,0,48)|0;jh=B;kh=Hd(ph&255|0,0,40)|0;ph=ia+(lh<<3)|0;c[ph>>2]=hh|zh<<24|wh<<16&16711680|rh<<8|kh|eh|vh;c[ph+4>>2]=gh&255|B|jh|hg;hg=zh&255;zh=d[qh>>0]|0;qh=d[Ke+(Nf*11|0)+9>>0]|0;jh=c[Oe>>2]|0;gh=jh&255;ph=jh>>>5;vh=jh>>>10&63;eh=jh>>>13;kh=jh>>>18&63;jh=gh<<3&248|gh>>>2;gh=c[17484+(zh<<4)+(d[Ke+(Nf*11|0)+8>>0]<<2)>>2]|0;rh=jh+gh|0;if(rh>>>0>255)if((rh|0)<0){Nh=0;$=221}else Oh=255;else{Nh=rh;$=221}if(($|0)==221){$=0;Oh=Nh}rh=ph&248|vh;vh=rh+gh|0;if(vh>>>0>255)if((vh|0)<0){Ph=0;$=224}else Qh=255;else{Ph=vh;$=224}if(($|0)==224){$=0;Qh=Ph}vh=eh&248|kh;kh=vh+gh|0;if(kh>>>0>255)if((kh|0)<0){Rh=0;$=227}else Sh=255;else{Rh=kh;$=227}if(($|0)==227){$=0;Sh=Rh}kh=Oh&255;gh=Qh&255;eh=Sh&255;ph=c[17484+(zh<<4)+(qh<<2)>>2]|0;qh=ph+jh|0;if(qh>>>0>255)if((qh|0)<0){Th=0;$=230}else Uh=255;else{Th=qh;$=230}if(($|0)==230){$=0;Uh=Th}qh=ph+rh|0;if(qh>>>0>255)if((qh|0)<0){Vh=0;$=233}else Wh=255;else{Vh=qh;$=233}if(($|0)==233){$=0;Wh=Vh}qh=ph+vh|0;if(qh>>>0>255)if((qh|0)<0){Xh=0;$=236}else Yh=255;else{Xh=qh;$=236}if(($|0)==236){$=0;Yh=Xh}if((kh&255)>(Uh&255)){$=238;break c}if((gh&255)>(Wh&255)){$=240;break c}if((eh&255)>(Yh&255)){$=242;break c}eh=lh<<2;gh=e[w+eh>>1]|0;kh=e[w+(eh|2)>>1]|0;eh=d[Qe+(gh<<3)+4>>0]|0;qh=d[Ke+(kh*11|0)+9>>0]|0;vh=d[Qe+(gh<<3)+1>>0]|0;gh=vh<<3&248|vh>>>2;vh=gh+(c[17484+(eh<<4)+(d[Ke+(kh*11|0)+8>>0]<<2)>>2]|0)|0;if(vh>>>0>255)if((vh|0)<0){Zh=0;$=245}else _h=255;else{Zh=vh;$=245}if(($|0)==245){$=0;_h=Zh}vh=(c[17484+(eh<<4)+(qh<<2)>>2]|0)+gh|0;if(vh>>>0>255)if((vh|0)<0){$h=0;$=248}else ai=255;else{$h=vh;$=248}if(($|0)==248){$=0;ai=$h}if(_h>>>0>ai>>>0){$=250;break c}vh=ai&255;gh=a[500827+(_h&255)>>0]|0;qh=Oh&255;if((_h&255)<<24>>24==-1){eh=a[499728+qh>>0]|0;kh=a[499728+(Qh&255)>>0]|0;if(((kh|eh)&255)>=32){$=253;break c}ph=(eh&255)<<10|(kh&255)<<5|d[499984+(Sh&255)>>0]<<1|32768;if(ph>>>0<65536)bi=ph;else{$=255;break c}}else{ph=a[499984+qh>>0]|0;qh=a[499984+(Qh&255)>>0]|0;kh=a[501083+(Sh&255)>>0]|0;if(!(((qh|ph)&255)<16&((kh|gh)&255)<8)){$=257;break c}eh=(ph&255)<<8|(gh&255)<<12|(qh&255)<<4|(kh&255)<<1;if(eh>>>0<65536)bi=eh;else{$=259;break c}}eh=ai&255;kh=a[501476+eh>>0]|0;qh=Uh&255;if((eh+-239|0)>>>0<17){eh=a[500315+qh>>0]|0;gh=a[500315+(Wh&255)>>0]|0;ph=a[500315+(Yh&255)>>0]|0;if(((gh|eh|ph)&255)>=32){$=262;break c}rh=(eh&255)<<10|(gh&255)<<5|ph&255|32768;if(rh>>>0>=65536){$=264;break c}ci=rh<<16|bi&65535}else{rh=a[500571+qh>>0]|0;qh=a[500571+(Wh&255)>>0]|0;ph=a[500571+(Yh&255)>>0]|0;if(!((vh&255)<239?((qh|rh|ph)&255)<16:0)){$=267;break c}vh=(rh&255)<<8|(kh&255)<<12|(qh&255)<<4|ph&255;if(vh>>>0>=65536){$=269;break c}ci=vh<<16|bi&65535}c[ha+(lh<<2)>>2]=ci;ah=hg;bh=fh;ch=mh;dh=ih;break f;break}case 9:case 8:{ih=Z(ne+ce|0,p)|0;mh=h+ih|0;fh=mh;c[fh>>2]=32;c[fh+4>>2]=-262144;fh=h+(ih+8)|0;c[fh>>2]=3;c[fh+4>>2]=0;fh=a[Ke+(Nf*11|0)+8>>0]|0;hg=fh&255;lh=d[Ke+(Nf*11|0)+9>>0]|0;vh=a[Oe>>0]|0;ph=a[Oe+1>>0]|0;qh=a[Oe+2>>0]|0;kh=d[Qe+(Mf<<3)+4>>0]|0;switch(a[Ke+(Nf*11|0)+10>>0]|0){case 1:{if((fh&255)>=4){$=274;break c}fh=vh&255;rh=ph&255;gh=rh<<3|rh>>>2;rh=qh&255;eh=rh<<3|rh>>>2;rh=c[17484+(kh<<4)+(hg<<2)>>2]|0;jh=rh+(fh<<3|fh>>>2)|0;if(jh>>>0>255)if((jh|0)<0){di=0;$=277}else ei=255;else{di=jh;$=277}if(($|0)==277){$=0;ei=di}jh=rh+gh|0;if(jh>>>0>255)if((jh|0)<0){fi=0;$=280}else gi=255;else{fi=jh;$=280}if(($|0)==280){$=0;gi=fi}jh=rh+eh|0;if(jh>>>0>255)if((jh|0)<0){hi=0;$=283}else ii=255;else{hi=jh;$=283}if(($|0)==283){$=0;ii=hi}jh=Hd(d[501732+(ei<<1)+1>>0]|0,0,8)|0;eh=Hd(d[501732+(gi<<1)+1>>0]|0,0,22)|0;Hd(d[501732+(ii<<1)+1>>0]|0,0,36)|0;rh=B&2032;gh=Hd(d[501732+(ei<<1)>>0]|0,0,15)|0;fh=Hd(d[501732+(gi<<1)>>0]|0,0,29)|0;zh=B&15;wh=mh;c[wh>>2]=Hd(d[501732+(ii<<1)>>0]|0,0,43)|0|(jh&32512|eh&532676608|gh&4161536|fh&-536870912)|32;c[wh+4>>2]=rh|zh|B|-262144;zh=66;rh=31;wh=715827883;fh=2147483647;while(1){gh=zh&7;eh=8-gh|0;jh=eh>>>0<rh>>>0?eh:rh;eh=h+((zh>>>3)+ih)|0;a[eh>>0]=d[eh>>0]&(fh<<gh^255)|wh<<gh;if((rh|0)==(jh|0))break;else{zh=jh+zh|0;rh=rh-jh|0;wh=wh>>>jh;fh=fh>>>jh}}break}case 2:{a[z>>0]=vh;a[Ea>>0]=ph;a[Fa>>0]=qh;a[Ga>>0]=-1;nb(F,z,kh);fh=c[F+(hg<<2)>>2]|0;wh=fh>>>9&127;rh=fh>>>17&127;zh=c[F+(lh<<2)>>2]|0;jh=zh>>>9&127;gh=zh>>>17&127;eh=fh>>>1&127;fh=mh;hh=c[fh>>2]|0;th=c[fh+4>>2]|0;fh=Hd(eh|0,0,8)|0;uh=B;sh=Hd(wh|0,0,22)|0;ji=B;ki=Hd(rh|0,0,36)|0;li=B;mi=zh>>>1&127;zh=Hd(mi|0,0,15)|0;ni=B;oi=Hd(jh|0,0,29)|0;pi=B;qi=Hd(gh|0,0,43)|0;ri=fh|hh&255|sh|ki|zh|oi|qi;qi=uh|th&-262144|ji|li|ni|pi|B;pi=mh;c[pi>>2]=ri;c[pi+4>>2]=qi;pi=Hd(mi|0,0,8)|0;mi=B;ni=Hd(jh|0,0,22)|0;jh=B;li=Hd(gh|0,0,36)|0;gh=B;ji=Hd(eh|0,0,15)|0;eh=B;th=Hd(wh|0,0,29)|0;wh=B;uh=Hd(rh|0,0,43)|0;rh=th|ji|uh|pi|ni|li;li=wh|eh|B|mi|jh|gh;gh=ri;ri=qi;qi=0;jh=0;mi=0;eh=0;while(1){wh=Ke+(Nf*11|0)+eh|0;ni=a[wh>>0]|0;pi=(ni&3|0)==(hg|0)?mi:mi^3;do if(!eh){if(!(pi&2)){si=ni;ti=gh;ui=ri;vi=1;wi=pi;xi=mi;break}uh=rh|gh&255;ji=li|ri&-262144;th=mh;c[th>>2]=uh;c[th+4>>2]=ji;si=a[wh>>0]|0;ti=uh;ui=ji;vi=1;wi=0;xi=3}else{si=ni;ti=gh;ui=ri;vi=2;wi=pi;xi=mi}while(0);pi=vi+qi|0;ni=si&255;wh=xi^3;ji=wi<<qi|jh|((ni>>>6|0)==(hg|0)?xi:wh)<<pi+4|((ni>>>2&3|0)==(hg|0)?xi:wh)<<pi|((ni>>>4&3|0)==(hg|0)?xi:wh)<<pi+2;eh=eh+1|0;if((eh|0)==4){yi=ji;break}else{gh=ti;ri=ui;qi=pi+6|0;jh=ji;mi=xi}}if((yi|0)>-1){zi=66;Ai=31;Bi=yi;Ci=2147483647}else{$=291;break c}while(1){mi=zi&7;jh=8-mi|0;qi=jh>>>0<Ai>>>0?jh:Ai;jh=h+((zi>>>3)+ih)|0;a[jh>>0]=d[jh>>0]&(Ci<<mi^255)|Bi<<mi;if((Ai|0)==(qi|0))break;else{zi=qi+zi|0;Ai=Ai-qi|0;Bi=Bi>>>qi;Ci=Ci>>>qi}}break}default:{qi=kh<<5;mi=(c[17764+(hg<<4)+(lh<<2)>>2]|0)*10|0;jh=mi+((qi+(vh&255)|0)*60|0)|0;ri=mi+((qi+(ph&255)|0)*60|0)|0;gh=mi+((qi+(qh&255)|0)*60|0)|0;qi=(e[213148+(ri<<2)+2>>1]|0)+(e[213148+(jh<<2)+2>>1]|0)+(e[213148+(gh<<2)+2>>1]|0)|0;mi=(e[213148+((ri|1)<<2)+2>>1]|0)+(e[213148+((jh|1)<<2)+2>>1]|0)+(e[213148+((gh|1)<<2)+2>>1]|0)|0;eh=mi>>>0<qi>>>0;li=eh?mi:qi;qi=(e[213148+(ri+2<<2)+2>>1]|0)+(e[213148+(jh+2<<2)+2>>1]|0)+(e[213148+(gh+2<<2)+2>>1]|0)|0;mi=qi>>>0<li>>>0;rh=mi?qi:li;li=(e[213148+(ri+3<<2)+2>>1]|0)+(e[213148+(jh+3<<2)+2>>1]|0)+(e[213148+(gh+3<<2)+2>>1]|0)|0;qi=li>>>0<rh>>>0;ji=qi?li:rh;rh=(e[213148+(ri+4<<2)+2>>1]|0)+(e[213148+(jh+4<<2)+2>>1]|0)+(e[213148+(gh+4<<2)+2>>1]|0)|0;li=rh>>>0<ji>>>0;pi=li?rh:ji;ji=(e[213148+(ri+5<<2)+2>>1]|0)+(e[213148+(jh+5<<2)+2>>1]|0)+(e[213148+(gh+5<<2)+2>>1]|0)|0;rh=ji>>>0<pi>>>0;wh=rh?ji:pi;pi=(e[213148+(ri+6<<2)+2>>1]|0)+(e[213148+(jh+6<<2)+2>>1]|0)+(e[213148+(gh+6<<2)+2>>1]|0)|0;ji=pi>>>0<wh>>>0;ni=ji?pi:wh;wh=(e[213148+(ri+7<<2)+2>>1]|0)+(e[213148+(jh+7<<2)+2>>1]|0)+(e[213148+(gh+7<<2)+2>>1]|0)|0;pi=wh>>>0<ni>>>0;uh=pi?wh:ni;ni=(e[213148+(ri+8<<2)+2>>1]|0)+(e[213148+(jh+8<<2)+2>>1]|0)+(e[213148+(gh+8<<2)+2>>1]|0)|0;wh=ni>>>0<uh>>>0;th=((e[213148+(ri+9<<2)+2>>1]|0)+(e[213148+(jh+9<<2)+2>>1]|0)+(e[213148+(gh+9<<2)+2>>1]|0)|0)>>>0<(wh?ni:uh)>>>0?9:wh?8:pi?7:ji?6:rh?5:li?4:qi?3:mi?2:eh&1;eh=th+jh|0;jh=a[213148+(eh<<2)>>0]|0;if(!(a[(d[Af>>0]&3)+(507169+(th<<2))>>0]&2)){mi=mh;qi=c[mi>>2]|0;li=c[mi+4>>2]|0;mi=Hd(jh&255|0,0,8)|0;rh=th+ri|0;ji=Hd(d[213148+(rh<<2)>>0]|0,0,22)|0;pi=th+gh|0;Hd(d[213148+(pi<<2)>>0]|0,0,36)|0;wh=li&-2048|B&2032;li=Hd(d[213148+(eh<<2)+1>>0]|0,0,15)|0;uh=Hd(d[213148+(rh<<2)+1>>0]|0,0,29)|0;rh=qi&255|mi&32512|ji&532676608|li&4161536|uh&-536870912;uh=wh|B&15;wh=mh;c[wh>>2]=rh;c[wh+4>>2]=uh;Hd(d[213148+(pi<<2)+1>>0]|0,0,43)|0;Di=rh;Ei=uh&-260097|B&260096;Fi=0}else{uh=mh;rh=c[uh>>2]|0;pi=c[uh+4>>2]|0;uh=Hd(d[213148+(eh<<2)+1>>0]|0,0,8)|0;eh=th+ri|0;ri=Hd(d[213148+(eh<<2)+1>>0]|0,0,22)|0;wh=th+gh|0;Hd(d[213148+(wh<<2)+1>>0]|0,0,36)|0;gh=B&2032;li=Hd(jh&255|0,0,15)|0;jh=Hd(d[213148+(eh<<2)>>0]|0,0,29)|0;eh=rh&255|li&4161536|uh&32512|ri&532676608|jh&-536870912;jh=pi&-2048|gh|B&15;gh=mh;c[gh>>2]=eh;c[gh+4>>2]=jh;Hd(d[213148+(wh<<2)>>0]|0,0,43)|0;Di=eh;Ei=jh&-260097|B&260096;Fi=3}jh=mh;c[jh>>2]=Di;c[jh+4>>2]=Ei;jh=0;eh=0;wh=0;while(1){gh=d[Ke+(Nf*11|0)+wh>>0]|0;pi=((wh|0)==0?1:2)+jh|0;ri=(d[(gh>>>4&3)+(507169+(th<<2))>>0]^Fi)<<pi+2|eh|(d[(gh>>>2&3)+(507169+(th<<2))>>0]^Fi)<<pi|(d[(gh&3)+(507169+(th<<2))>>0]^Fi)<<jh|(d[(gh>>>6)+(507169+(th<<2))>>0]^Fi)<<pi+4;wh=wh+1|0;if(wh>>>0>=4){Gi=ri;break}else{jh=pi+6|0;eh=ri}}if((Gi|0)>-1){Hi=66;Ii=31;Ji=Gi;Ki=2147483647}else{$=298;break c}while(1){eh=Hi&7;jh=8-eh|0;wh=jh>>>0<Ii>>>0?jh:Ii;jh=h+((Hi>>>3)+ih)|0;a[jh>>0]=d[jh>>0]&(Ki<<eh^255)|Ji<<eh;if((Ii|0)==(wh|0))break;else{Hi=wh+Hi|0;Ii=Ii-wh|0;Ji=Ji>>>wh;Ki=Ki>>>wh}}}}ah=je;bh=ie;ch=he;dh=ge;break f;break}case 10:{ih=Z(ne+ce|0,p)|0;wh=h+ih|0;eh=a[Ke+(Nf*11|0)+8>>0]|0;jh=eh&255;th=d[Ke+(Nf*11|0)+9>>0]|0;mh=d[Qe+(Mf<<3)+4>>0]|0;switch(a[Ke+(Nf*11|0)+10>>0]|0){case 1:{if((eh&255)>=4){$=305;break c}eh=d[Oe>>0]|0;qh=(eh<<3|eh>>>2)+(c[17484+(mh<<4)+(jh<<2)>>2]|0)|0;if(qh>>>0>255)if((qh|0)<0){Li=0;$=308}else Mi=255;else{Li=qh;$=308}if(($|0)==308){$=0;Mi=Li}qh=wh;eh=c[qh>>2]|0;ph=c[qh+4>>2]|0;Hd(Mi|0,0,50)|0;qh=B;vh=wh;c[vh>>2]=Hd(Mi|0,0,58)|0|eh;c[vh+4>>2]=B|ph&262143|qh&66846720;qh=h+(ih+8)|0;ph=qh;vh=c[ph+4>>2]|0;eh=qh;c[eh>>2]=c[ph>>2]&-4|Mi>>>6&3;c[eh+4>>2]=vh;break}case 2:{vh=d[Oe+1>>0]|0;eh=vh<<3|vh>>>2;vh=eh+(c[17484+(mh<<4)>>2]|0)|0;if(vh>>>0>255)if((vh|0)<0){Ni=0;$=312}else Oi=255;else{Ni=vh;$=312}if(($|0)==312){$=0;Oi=Ni}c[I>>2]=Oi;vh=(c[17484+(mh<<4)+4>>2]|0)+eh|0;if(vh>>>0>255)if((vh|0)<0){Pi=0;$=315}else Qi=255;else{Pi=vh;$=315}if(($|0)==315){$=0;Qi=Pi}c[Ha>>2]=Qi;vh=(c[17484+(mh<<4)+8>>2]|0)+eh|0;if(vh>>>0>255)if((vh|0)<0){Ri=0;$=318}else Si=255;else{Ri=vh;$=318}if(($|0)==318){$=0;Si=Ri}c[Ia>>2]=Si;vh=(c[17484+(mh<<4)+12>>2]|0)+eh|0;if(vh>>>0>255)if((vh|0)<0){Ti=0;$=321}else Ui=255;else{Ti=vh;$=321}if(($|0)==321){$=0;Ui=Ti}c[Ja>>2]=Ui;vh=c[I+(jh<<2)>>2]|0;eh=wh;ph=c[eh>>2]|0;qh=c[eh+4>>2]|0;Hd(vh|0,0,50)|0;eh=B&66846720|qh&262143;qh=c[I+(th<<2)>>2]|0;lh=ph|(Hd(qh|0,0,58)|0);ph=eh|B;eh=wh;c[eh>>2]=lh;c[eh+4>>2]=ph;eh=h+(ih+8)|0;hg=eh;kh=c[hg+4>>2]|0;ri=qh>>>6&3|c[hg>>2]&-4;hg=eh;c[hg>>2]=ri;c[hg+4>>2]=kh;Hd(qh|0,0,50)|0;qh=B&66846720;hg=Hd(vh|0,0,58)|0;pi=vh>>>6&3;vh=qh|B;qh=ph;ph=lh;lh=ri;ri=kh;kh=0;gh=0;uh=0;li=0;while(1){rh=Ke+(Nf*11|0)+li|0;ji=(d[rh>>0]&3|0)==(jh|0)?uh:uh^3;do if(!li){if(!(ji&2)){Vi=lh;Wi=ri;Xi=ph;Yi=qh;Zi=1;_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h=Hd(eh|0,0,50)|0;eh=B;li=Hd(gh|0,0,58)|0;gh=(uh&255)>>>6;uh=kh|li;li=eh|B;eh=pi;pi=vh;vh=lh;lh=ri;ri=0;kh=0;hg=ph;ph=0;while(1){ni=Ke+(Nf*11|0)+ph|0;ji=hg>>>(d[ni>>0]<<1&6);mi=ji&3;do if(!ph){if(!(ji&2)){fj=vh;gj=lh;hj=pi;ij=eh;jj=1;kj=mi;lj=hg;break}qi=uh|pi;oi=li|eh&262143;zh=wh;c[zh>>2]=qi;c[zh+4>>2]=oi;zh=vh&-4|gh;ki=qh;c[ki>>2]=zh;c[ki+4>>2]=lh;fj=zh;gj=lh;hj=qi;ij=oi;jj=1;kj=mi^3;lj=hg^255}else{fj=vh;gj=lh;hj=pi;ij=eh;jj=2;kj=mi;lj=hg}while(0);mi=jj+ri|0;ji=d[ni>>0]|0;rh=(lj>>>(ji>>>5&6)&3)<<mi+4|((lj>>>(ji>>>3&6)&3)<<mi+2|((lj>>>(ji>>>1&6)&3)<<mi|(kj<<ri|kh)));ph=ph+1|0;if(ph>>>0>=4){mj=rh;break}else{eh=ij;pi=hj;vh=fj;lh=gj;ri=mi+6|0;kh=rh;hg=lj}}if((mj|0)>-1){nj=97;oj=31;pj=mj;qj=2147483647}else{$=334;break c}while(1){hg=nj&7;kh=8-hg|0;ri=kh>>>0<oj>>>0?kh:oj;kh=h+((nj>>>3)+ih)|0;a[kh>>0]=d[kh>>0]&(qj<<hg^255)|pj<<hg;if((oj|0)==(ri|0))break;else{nj=ri+nj|0;oj=oj-ri|0;pj=pj>>>ri;qj=qj>>>ri}}}}ah=je;bh=ie;ch=he;dh=ge;break f;break}case 11:{ih=Z(ne+ce|0,p)|0;ri=h+ih|0;hg=a[Ke+(Nf*11|0)+8>>0]|0;kh=hg&255;lh=a[Ke+(Nf*11|0)+9>>0]|0;vh=d[Qe+(Mf<<3)+4>>0]|0;if(hg<<24>>24==lh<<24>>24){if((hg&255)>=4){$=340;break c}pi=d[Oe>>0]|0;eh=(pi<<3|pi>>>2)+(c[17484+(vh<<4)+(kh<<2)>>2]|0)|0;if(eh>>>0>255)if((eh|0)<0){rj=0;$=343}else sj=255;else{rj=eh;$=343}if(($|0)==343){$=0;sj=rj}b[ri>>1]=sj&255|7424;eh=h+(ih+2)|0;a[eh>>0]=a[463004]|0;a[eh+1>>0]=a[463005]|0;a[eh+2>>0]=a[463006]|0;a[eh+3>>0]=a[463007]|0;a[eh+4>>0]=a[463008]|0;a[eh+5>>0]=a[463009]|0;ah=je;bh=ie;ch=he;dh=ge;break f}i:do switch(hg<<24>>24){case 0:{if(lh<<24>>24==3){tj=0;break i}if(lh<<24>>24==2)tj=2;else $=352;break}case 1:{if(lh<<24>>24==3){tj=1;break i}if(lh<<24>>24==2)tj=3;else $=352;break}default:$=352}while(0);if(($|0)==352){$=0;tj=4}lh=tj>>>0>3?0:tj;hg=(d[Oe>>0]|0)+(vh<<5)|0;eh=a[274588+(hg<<4)+(lh<<2)+1>>0]|0;b[ri>>1]=(eh&255)<<12&65535|d[274588+(hg<<4)+(lh<<2)>>0]|((eh&255)>>>4&255)<<8&65535;eh=e[274588+(hg<<4)+(lh<<2)+2>>1]|0;lh=0;hg=0;kh=0;while(1){pi=d[Ke+(Nf*11|0)+kh>>0]|0;ph=Z(kh,-3)|0;qh=Hd(eh>>>((pi>>>4&3)*3|0)&7|0,0,ph+21|0)|0;gh=B;wh=Hd(eh>>>((pi>>>2&3)*3|0)&7|0,0,ph+33|0)|0;li=B;uh=Hd(eh>>>((pi&3)*3|0)&7|0,0,ph+45|0)|0;mh=B|hg;th=Hd(eh>>>((pi>>>6)*3|0)&7|0,0,ph+9|0)|0;ph=uh|lh|th|wh|qh;qh=mh|B|li|gh;kh=kh+1|0;if(kh>>>0>=4){uj=ph;vj=qh;break}else{lh=ph;hg=qh}}hg=Gd(uj|0,vj|0,40)|0;a[h+(ih+2)>>0]=hg;a[h+(ih+3)>>0]=vj;hg=Gd(uj|0,vj|0,24)|0;a[h+(ih+4)>>0]=hg;hg=Gd(uj|0,vj|0,16)|0;a[h+(ih+5)>>0]=hg;hg=Gd(uj|0,vj|0,8)|0;a[h+(ih+6)>>0]=hg;a[h+(ih+7)>>0]=uj;ah=je;bh=ie;ch=he;dh=ge;break f;break}case 12:{hg=Z(ne+ce|0,p)|0;lh=h+hg|0;a[Ka>>0]=0;a[La>>0]=0;do if(v){kh=e[h+(hg+2)>>1]|0;eh=a[Ke+(kh*11|0)+10>>0]|0;ri=eh&255;if(eh<<24>>24!=1){wj=255;xj=ri;break}eh=e[lh>>1]|0;vh=d[Qe+(eh<<3)+4>>0]|0;qh=d[Qe+(eh<<3)+1>>0]|0;eh=qh<<3|qh>>>2;qh=eh+(c[17484+(vh<<4)>>2]|0)|0;if(qh>>>0>255)if((qh|0)<0){yj=0;$=357}else zj=255;else{yj=qh;$=357}if(($|0)==357){$=0;zj=yj}c[I>>2]=zj;qh=(c[17484+(vh<<4)+4>>2]|0)+eh|0;if(qh>>>0>255)if((qh|0)<0){Aj=0;$=360}else Bj=255;else{Aj=qh;$=360}if(($|0)==360){$=0;Bj=Aj}c[Ha>>2]=Bj;qh=(c[17484+(vh<<4)+8>>2]|0)+eh|0;if(qh>>>0>255)if((qh|0)<0){Cj=0;$=363}else Dj=255;else{Cj=qh;$=363}if(($|0)==363){$=0;Dj=Cj}c[Ia>>2]=Dj;qh=(c[17484+(vh<<4)+12>>2]|0)+eh|0;if(qh>>>0>255)if((qh|0)<0){Ej=0;$=366}else Fj=255;else{Ej=qh;$=366}if(($|0)==366){$=0;Fj=Ej}c[Ja>>2]=Fj;wj=c[I+(d[Ke+(kh*11|0)+8>>0]<<2)>>2]|0;xj=ri}else{wj=255;xj=1}while(0);ih=a[Qe+(Mf<<3)+4>>0]|0;ri=ih&255;kh=Ke+(Nf*11|0)+8|0;qh=a[kh>>0]|0;eh=qh&255;vh=Ke+(Nf*11|0)+9|0;ph=a[vh>>0]|0;gh=ph&255;li=Ke+(Nf*11|0)+10|0;mh=a[li>>0]|0;j:do if((xj|0)==1&mh<<24>>24==1){if((qh&255)>=4){$=370;break c}wh=d[Oe>>0]|0;th=d[Oe+1>>0]|0;uh=th<<3|th>>>2;th=d[Oe+2>>0]|0;pi=th<<3|th>>>2;th=c[17484+(ri<<4)+(eh<<2)>>2]|0;jh=(wh<<3|wh>>>2)+th|0;if(jh>>>0>255)if((jh|0)<0){Gj=0;$=373}else Hj=255;else{Gj=jh;$=373}if(($|0)==373){$=0;Hj=Gj}jh=uh+th|0;if(jh>>>0>255)if((jh|0)<0){Ij=0;$=376}else Jj=255;else{Ij=jh;$=376}if(($|0)==376){$=0;Jj=Ij}jh=pi+th|0;if(jh>>>0>255)if((jh|0)<0){Kj=0;$=379}else Lj=255;else{Kj=jh;$=379}if(($|0)==379){$=0;Lj=Kj}a[lh>>0]=-4;a[h+(hg+1)>>0]=-3;a[h+(hg+2)>>0]=-1;a[h+(hg+3)>>0]=-1;c[h+(hg+4)>>2]=-1;c[h+(hg+8)>>2]=0;c[h+(hg+12)>>2]=0;jh=16;th=Hj<<8|Hj;pi=64;while(1){uh=pi&7;wh=8-uh|0;rh=(wh|0)<(jh|0)?wh:jh;wh=h+((pi>>3)+hg)|0;a[wh>>0]=d[wh>>0]|th<<uh;uh=rh+pi|0;if((jh|0)==(rh|0)){Mj=uh;break}else{jh=jh-rh|0;th=th>>>rh;pi=uh}}pi=16;th=Jj<<8|Jj;jh=Mj;while(1){ni=jh&7;uh=8-ni|0;rh=(uh|0)<(pi|0)?uh:pi;uh=h+((jh>>3)+hg)|0;a[uh>>0]=d[uh>>0]|th<<ni;ni=rh+jh|0;if((pi|0)==(rh|0)){Nj=ni;break}else{pi=pi-rh|0;th=th>>>rh;jh=ni}}jh=16;th=Lj<<8|Lj;pi=Nj;while(1){ni=pi&7;rh=8-ni|0;uh=(rh|0)<(jh|0)?rh:jh;rh=h+((pi>>3)+hg)|0;a[rh>>0]=d[rh>>0]|th<<ni;ni=uh+pi|0;if((jh|0)==(uh|0)){Oj=ni;break}else{jh=jh-uh|0;th=th>>>uh;pi=ni}}pi=16;th=wj<<8|wj;jh=Oj;while(1){ni=jh&7;uh=8-ni|0;rh=(uh|0)<(pi|0)?uh:pi;uh=h+((jh>>3)+hg)|0;a[uh>>0]=d[uh>>0]|th<<ni;if((pi|0)==(rh|0))break;else{pi=pi-rh|0;th=th>>>rh;jh=rh+jh|0}}}else{if(xj>>>0<3&(mh&255)<3){nb(F,Oe,ri);jh=c[F+(eh<<2)>>2]|0;th=jh&255;a[A>>0]=th;pi=(jh&65535)>>>8;rh=pi&255;a[Ma>>0]=rh;ni=jh>>>16;uh=ni&255;a[Na>>0]=uh;wh=c[F+(gh<<2)>>2]|0;mi=wh&255;a[Oa>>0]=mi;ji=(wh&65535)>>>8;oi=ji&255;a[Pa>>0]=oi;qi=wh>>>16;zh=qi&255;a[Qa>>0]=zh;if(((qi&255)+(wh&255)+(ji&65535)|0)<((ni&255)+(jh&255)+(pi&65535)|0)){a[A>>0]=mi;a[Oa>>0]=th;a[Ma>>0]=oi;a[Pa>>0]=rh;a[Na>>0]=zh;a[Qa>>0]=uh;Pj=mi;Qj=1}else{Pj=th;Qj=0}if(v){th=e[lh>>1]|0;mi=e[h+(hg+2)>>1]|0;uh=d[Qe+(th<<3)+4>>0]|0;zh=d[Ke+(mi*11|0)+8>>0]|0;rh=d[Ke+(mi*11|0)+9>>0]|0;oi=d[Qe+(th<<3)+1>>0]|0;th=oi<<3|oi>>>2;oi=th+(c[17484+(uh<<4)>>2]|0)|0;if(oi>>>0>255)if((oi|0)<0){Rj=0;$=394}else Sj=255;else{Rj=oi;$=394}if(($|0)==394){$=0;Sj=Rj}c[J>>2]=Sj;oi=(c[17484+(uh<<4)+4>>2]|0)+th|0;if(oi>>>0>255)if((oi|0)<0){Tj=0;$=397}else Uj=255;else{Tj=oi;$=397}if(($|0)==397){$=0;Uj=Tj}c[Ra>>2]=Uj;oi=(c[17484+(uh<<4)+8>>2]|0)+th|0;if(oi>>>0>255)if((oi|0)<0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*11|0)+3>>0]|0;a[gb>>0]=(ji&3|0)==(jh|0)?3:0;a[hb>>0]=(ji>>>2&3|0)==(jh|0)?3:0;a[ib>>0]=(ji>>>4&3|0)==(jh|0)?3:0;a[jb>>0]=(ji>>>6|0)==(jh|0)?3:0;break k}while(0);pi=c[17892+(uh<<4)+(jh<<2)>>2]|0;th=d[zh+1>>0]|0;mi=d[491267+(th*48|0)+(oi*6|0)+pi>>0]|0;ji=mi+(pi*10|0)+((th+(oi<<5)|0)*60|0)|0;a[Ua>>0]=a[24732+(ji<<2)>>0]|0;a[Va>>0]=a[24732+(ji<<2)+1>>0]|0;ji=d[Ke+(rh*11|0)>>0]|0;a[Wa>>0]=a[(ji&3)+(507169+(mi<<2))>>0]|0;a[Xa>>0]=a[(ji>>>2&3)+(507169+(mi<<2))>>0]|0;a[Ya>>0]=a[(ji>>>4&3)+(507169+(mi<<2))>>0]|0;a[Za>>0]=a[(ji>>>6)+(507169+(mi<<2))>>0]|0;ji=d[Ke+(rh*11|0)+1>>0]|0;a[_a>>0]=a[(ji&3)+(507169+(mi<<2))>>0]|0;a[$a>>0]=a[(ji>>>2&3)+(507169+(mi<<2))>>0]|0;a[ab>>0]=a[(ji>>>4&3)+(507169+(mi<<2))>>0]|0;a[bb>>0]=a[(ji>>>6)+(507169+(mi<<2))>>0]|0;ji=d[Ke+(rh*11|0)+2>>0]|0;a[cb>>0]=a[(ji&3)+(507169+(mi<<2))>>0]|0;a[db>>0]=a[(ji>>>2&3)+(507169+(mi<<2))>>0]|0;a[eb>>0]=a[(ji>>>4&3)+(507169+(mi<<2))>>0]|0;a[fb>>0]=a[(ji>>>6)+(507169+(mi<<2))>>0]|0;ji=d[Ke+(rh*11|0)+3>>0]|0;a[gb>>0]=a[(ji&3)+(507169+(mi<<2))>>0]|0;a[hb>>0]=a[(ji>>>2&3)+(507169+(mi<<2))>>0]|0;a[ib>>0]=a[(ji>>>4&3)+(507169+(mi<<2))>>0]|0;a[jb>>0]=a[(ji>>>6)+(507169+(mi<<2))>>0]|0;break}mi=d[zh+1>>0]|0;ji=mi<<3|mi>>>2;mi=ji+(c[17484+(oi<<4)>>2]|0)|0;if(mi>>>0>255)if((mi|0)<0){$j=0;$=415}else ak=255;else{$j=mi;$=415}if(($|0)==415){$=0;ak=$j}c[G>>2]=ak;mi=(c[17484+(oi<<4)+4>>2]|0)+ji|0;if(mi>>>0>255)if((mi|0)<0){bk=0;$=418}else ck=255;else{bk=mi;$=418}if(($|0)==418){$=0;ck=bk}c[kb>>2]=ck;mi=(c[17484+(oi<<4)+8>>2]|0)+ji|0;if(mi>>>0>255)if((mi|0)<0){dk=0;$=421}else ek=255;else{dk=mi;$=421}if(($|0)==421){$=0;ek=dk}c[ob>>2]=ek;mi=(c[17484+(oi<<4)+12>>2]|0)+ji|0;if(mi>>>0>255)if((mi|0)<0){fk=0;$=424}else gk=255;else{fk=mi;$=424}if(($|0)==424){$=0;gk=fk}c[pb>>2]=gk;mi=c[G+(uh<<2)>>2]|0;a[Ua>>0]=a[492803+(mi<<1)>>0]|0;a[Va>>0]=a[492803+(mi<<1)+1>>0]|0;a[Wa>>0]=1;a[Xa>>0]=1;a[Ya>>0]=1;a[Za>>0]=1;a[_a>>0]=1;a[$a>>0]=1;a[ab>>0]=1;a[bb>>0]=1;a[cb>>0]=1;a[db>>0]=1;a[eb>>0]=1;a[fb>>0]=1;a[gb>>0]=1;a[hb>>0]=1;a[ib>>0]=1;a[jb>>0]=1}else{a[Ua>>0]=1;a[Va>>0]=1;a[Wa>>0]=0;a[Xa>>0]=0;a[Ya>>0]=0;a[Za>>0]=0;a[_a>>0]=0;a[$a>>0]=0;a[ab>>0]=0;a[bb>>0]=0;a[cb>>0]=0;a[db>>0]=0;a[eb>>0]=0;a[fb>>0]=0;a[gb>>0]=0;a[hb>>0]=0;a[ib>>0]=0;a[jb>>0]=0}while(0);l:do if(qh<<24>>24==ph<<24>>24){nb(D,Oe,ri);mi=c[D+(eh<<2)>>2]|0;ji=mi&255;th=mi>>>8&255;pi=mi>>>16&255;mi=a[492803+(ji<<1)>>0]|0;a[A>>0]=mi;ni=a[492803+(ji<<1)+1>>0]|0;a[Oa>>0]=ni;ji=a[492803+(th<<1)>>0]|0;a[Ma>>0]=ji;wh=a[492803+(th<<1)+1>>0]|0;a[Pa>>0]=wh;th=a[492803+(pi<<1)>>0]|0;a[Na>>0]=th;qi=a[492803+(pi<<1)+1>>0]|0;a[Qa>>0]=qi;if(((c[17956+((wh&255)<<2)>>2]|0)+(c[17956+((ni&255)<<2)>>2]|0)+(c[17956+((qi&255)<<2)>>2]|0)|0)<((c[17956+((ji&255)<<2)>>2]|0)+(c[17956+((mi&255)<<2)>>2]|0)+(c[17956+((th&255)<<2)>>2]|0)|0)){a[A>>0]=ni;a[Oa>>0]=mi;a[Ma>>0]=wh;a[Pa>>0]=ji;a[Na>>0]=qi;a[Qa>>0]=th;hk=2}else hk=1;a[sb>>0]=hk;a[tb>>0]=hk;a[ub>>0]=hk;a[vb>>0]=hk;a[wb>>0]=hk;a[xb>>0]=hk;a[yb>>0]=hk;a[zb>>0]=hk;a[Ab>>0]=hk;a[Bb>>0]=hk;a[Cb>>0]=hk;a[Db>>0]=hk;a[Eb>>0]=hk;a[Fb>>0]=hk;a[Gb>>0]=hk;a[Hb>>0]=hk}else{do if((ih&255)>6){if((a[li>>0]|0)!=2)break;if(a[kh>>0]|0)break;if((a[vh>>0]|0)!=3)break;nb(E,Oe,ri);th=c[E>>2]|0;qi=c[Ib>>2]|0;ji=a[493315+(th&255)>>0]|0;a[A>>0]=ji;wh=a[493315+(qi&255)>>0]|0;a[Oa>>0]=wh;mi=a[493315+(th>>>8&255)>>0]|0;a[Ma>>0]=mi;ni=a[493315+(qi>>>8&255)>>0]|0;a[Pa>>0]=ni;pi=a[493315+(th>>>16&255)>>0]|0;a[Na>>0]=pi;th=a[493315+(qi>>>16&255)>>0]|0;a[Qa>>0]=th;if(((c[17956+((ni&255)<<2)>>2]|0)+(c[17956+((wh&255)<<2)>>2]|0)+(c[17956+((th&255)<<2)>>2]|0)|0)<((c[17956+((mi&255)<<2)>>2]|0)+(c[17956+((ji&255)<<2)>>2]|0)+(c[17956+((pi&255)<<2)>>2]|0)|0)){a[A>>0]=wh;a[Oa>>0]=ji;a[Ma>>0]=ni;a[Pa>>0]=mi;a[Na>>0]=th;a[Qa>>0]=pi;ik=1}else ik=0;pi=0;while(1){th=d[Ke+(Nf*11|0)+pi>>0]|0;mi=(th&3|0)==(eh|0)?0:3;ni=pi<<3;a[A+10+ni>>0]=ik?mi^3:mi;mi=(th>>>2&3|0)==(eh|0)?0:3;a[(ni|2)+(A+10)>>0]=ik?mi^3:mi;mi=(th>>>4&3|0)==(eh|0)?0:3;a[(ni|4)+(A+10)>>0]=ik?mi^3:mi;mi=(th>>>6|0)==(eh|0)?0:3;a[(ni|6)+(A+10)>>0]=ik?mi^3:mi;pi=pi+1|0;if(pi>>>0>=4)break l}}while(0);uh=ri<<5;oi=(c[17892+(eh<<4)+(gh<<2)>>2]|0)*10|0;zh=(((d[Oe>>0]|0)+uh|0)*60|0)+oi|0;rh=(((d[Oe+1>>0]|0)+uh|0)*60|0)+oi|0;jh=(((d[Oe+2>>0]|0)+uh|0)*60|0)+oi|0;oi=(e[24732+(rh<<2)+2>>1]|0)+(e[24732+(zh<<2)+2>>1]|0)+(e[24732+(jh<<2)+2>>1]|0)|0;uh=(e[24732+((rh|1)<<2)+2>>1]|0)+(e[24732+((zh|1)<<2)+2>>1]|0)+(e[24732+((jh|1)<<2)+2>>1]|0)|0;pi=uh>>>0<oi>>>0;mi=pi?uh:oi;oi=(e[24732+(rh+2<<2)+2>>1]|0)+(e[24732+(zh+2<<2)+2>>1]|0)+(e[24732+(jh+2<<2)+2>>1]|0)|0;uh=oi>>>0<mi>>>0;ni=uh?oi:mi;mi=(e[24732+(rh+3<<2)+2>>1]|0)+(e[24732+(zh+3<<2)+2>>1]|0)+(e[24732+(jh+3<<2)+2>>1]|0)|0;oi=mi>>>0<ni>>>0;th=oi?mi:ni;ni=(e[24732+(rh+4<<2)+2>>1]|0)+(e[24732+(zh+4<<2)+2>>1]|0)+(e[24732+(jh+4<<2)+2>>1]|0)|0;mi=ni>>>0<th>>>0;ji=mi?ni:th;th=(e[24732+(rh+5<<2)+2>>1]|0)+(e[24732+(zh+5<<2)+2>>1]|0)+(e[24732+(jh+5<<2)+2>>1]|0)|0;ni=th>>>0<ji>>>0;wh=ni?th:ji;ji=(e[24732+(rh+6<<2)+2>>1]|0)+(e[24732+(zh+6<<2)+2>>1]|0)+(e[24732+(jh+6<<2)+2>>1]|0)|0;th=ji>>>0<wh>>>0;qi=th?ji:wh;wh=(e[24732+(rh+7<<2)+2>>1]|0)+(e[24732+(zh+7<<2)+2>>1]|0)+(e[24732+(jh+7<<2)+2>>1]|0)|0;ji=wh>>>0<qi>>>0;ki=ji?wh:qi;qi=(e[24732+(rh+8<<2)+2>>1]|0)+(e[24732+(zh+8<<2)+2>>1]|0)+(e[24732+(jh+8<<2)+2>>1]|0)|0;wh=qi>>>0<ki>>>0;sh=((e[24732+(rh+9<<2)+2>>1]|0)+(e[24732+(zh+9<<2)+2>>1]|0)+(e[24732+(jh+9<<2)+2>>1]|0)|0)>>>0<(wh?qi:ki)>>>0?9:wh?8:ji?7:th?6:ni?5:mi?4:oi?3:uh?2:pi&1;pi=sh+zh|0;zh=a[24732+(pi<<2)>>0]|0;a[A>>0]=zh;uh=a[24732+(pi<<2)+1>>0]|0;a[Oa>>0]=uh;pi=sh+rh|0;rh=a[24732+(pi<<2)>>0]|0;a[Ma>>0]=rh;oi=a[24732+(pi<<2)+1>>0]|0;a[Pa>>0]=oi;pi=sh+jh|0;jh=a[24732+(pi<<2)>>0]|0;a[Na>>0]=jh;mi=a[24732+(pi<<2)+1>>0]|0;a[Qa>>0]=mi;if(((c[17956+((oi&255)<<2)>>2]|0)+(c[17956+((uh&255)<<2)>>2]|0)+(c[17956+((mi&255)<<2)>>2]|0)|0)<((c[17956+((rh&255)<<2)>>2]|0)+(c[17956+((zh&255)<<2)>>2]|0)+(c[17956+((jh&255)<<2)>>2]|0)|0)){a[A>>0]=uh;a[Oa>>0]=zh;a[Ma>>0]=oi;a[Pa>>0]=rh;a[Na>>0]=mi;a[Qa>>0]=jh;jk=1}else jk=0;jh=0;do{mi=d[Ke+(Nf*11|0)+jh>>0]|0;rh=d[(mi&3)+(507169+(sh<<2))>>0]|0;oi=jh<<3;a[A+10+oi>>0]=jk?3-rh|0:rh;rh=d[(mi>>>2&3)+(507169+(sh<<2))>>0]|0;a[(oi|2)+(A+10)>>0]=jk?3-rh|0:rh;rh=d[(mi>>>4&3)+(507169+(sh<<2))>>0]|0;a[(oi|4)+(A+10)>>0]=jk?3-rh|0:rh;rh=d[(mi>>>6)+(507169+(sh<<2))>>0]|0;a[(oi|6)+(A+10)>>0]=jk?3-rh|0:rh;jh=jh+1|0}while(jh>>>0<4)}while(0);a[lh>>0]=66;a[h+(hg+1)>>0]=-124;a[h+(hg+2)>>0]=1;jh=h+(hg+3)|0;a[jh>>0]=0;a[jh+1>>0]=0;a[jh+2>>0]=0;a[jh+3>>0]=0;a[h+(hg+7)>>0]=-64;c[h+(hg+8)>>2]=0;c[h+(hg+12)>>2]=0;c[z>>2]=17;mc(lh,A,z,4);mc(lh,Qa,z,4);jh=0;do{sh=126-(jh<<1)|0;rh=h+((sh>>>3)+hg)|0;a[rh>>0]=d[rh>>0]|d[506892+(d[A+10+jh>>0]|0)>>0]<<(sh&6);jh=jh+1|0}while((jh|0)!=32)}while(0);ah=je;bh=ie;ch=he;dh=ge;break f;break}case 13:{hg=Z(ne+ce|0,p)|0;lh=h+hg|0;gh=a[Ke+(Nf*11|0)+8>>0]|0;eh=gh&255;ri=a[Ke+(Nf*11|0)+9>>0]|0;vh=ri&255;kh=a[Qe+(Mf<<3)+4>>0]|0;li=kh&255;m:do if(gh<<24>>24!=ri<<24>>24){do if((kh&255)>6){if(!(ri<<24>>24==3&(gh<<24>>24==0?(a[Ke+(Nf*11|0)+10>>0]|0)==2:0)))break;nb(F,Oe,li);ih=c[F>>2]|0;ph=a[495619+((ih&255)<<1)+1>>0]|0;qh=a[495619+((ih>>>8&255)<<1)+1>>0]|0;mh=a[495619+((ih>>>16&255)<<1)+1>>0]|0;if(((qh|ph|mh)&255)>=32){$=469;break c}ih=d[Kb>>0]|0;jh=d[Lb>>0]|0;sh=d[Jb>>0]|0;rh=(qh&255)<<5;a[lh>>0]=rh|mh&255;a[h+(hg+1)>>0]=(rh|(ph&255)<<10)>>>8;ph=a[495619+(sh<<1)+1>>0]|0;sh=a[496131+(jh<<1)+1>>0]|0;jh=a[495619+(ih<<1)+1>>0]|0;if(!((sh&255)<64&((jh|ph)&255)<32)){$=471;break c}ih=(sh&255)<<5;a[h+(hg+2)>>0]=ih|jh&255;a[h+(hg+3)>>0]=(ih|(ph&255)<<11)>>>8;a[h+(hg+4)>>0]=a[Af>>0]|0;a[h+(hg+5)>>0]=a[Ke+(Nf*11|0)+1>>0]|0;a[h+(hg+6)>>0]=a[Ke+(Nf*11|0)+2>>0]|0;a[h+(hg+7)>>0]=a[Ke+(Nf*11|0)+3>>0]|0;break m}while(0);ph=li<<5;ih=(c[18148+(eh<<4)+(vh<<2)>>2]|0)*10|0;jh=(((d[Oe>>0]|0)+ph|0)*60|0)+ih|0;sh=(((d[Oe+1>>0]|0)+ph|0)*60|0)+ih|0;rh=(((d[Oe+2>>0]|0)+ph|0)*60|0)+ih|0;ih=(e[340124+(sh<<2)+2>>1]|0)+(e[278684+(jh<<2)+2>>1]|0)+(e[278684+(rh<<2)+2>>1]|0)|0;ph=(e[340124+((sh|1)<<2)+2>>1]|0)+(e[278684+((jh|1)<<2)+2>>1]|0)+(e[278684+((rh|1)<<2)+2>>1]|0)|0;mh=ph>>>0<ih>>>0;qh=mh?ph:ih;ih=(e[340124+(sh+2<<2)+2>>1]|0)+(e[278684+(jh+2<<2)+2>>1]|0)+(e[278684+(rh+2<<2)+2>>1]|0)|0;ph=ih>>>0<qh>>>0;oi=ph?ih:qh;qh=(e[340124+(sh+3<<2)+2>>1]|0)+(e[278684+(jh+3<<2)+2>>1]|0)+(e[278684+(rh+3<<2)+2>>1]|0)|0;ih=qh>>>0<oi>>>0;mi=ih?qh:oi;oi=(e[340124+(sh+4<<2)+2>>1]|0)+(e[278684+(jh+4<<2)+2>>1]|0)+(e[278684+(rh+4<<2)+2>>1]|0)|0;qh=oi>>>0<mi>>>0;zh=qh?oi:mi;mi=(e[340124+(sh+5<<2)+2>>1]|0)+(e[278684+(jh+5<<2)+2>>1]|0)+(e[278684+(rh+5<<2)+2>>1]|0)|0;oi=mi>>>0<zh>>>0;uh=oi?mi:zh;zh=(e[340124+(sh+6<<2)+2>>1]|0)+(e[278684+(jh+6<<2)+2>>1]|0)+(e[278684+(rh+6<<2)+2>>1]|0)|0;mi=zh>>>0<uh>>>0;pi=mi?zh:uh;uh=(e[340124+(sh+7<<2)+2>>1]|0)+(e[278684+(jh+7<<2)+2>>1]|0)+(e[278684+(rh+7<<2)+2>>1]|0)|0;zh=uh>>>0<pi>>>0;ni=zh?uh:pi;pi=(e[340124+(sh+8<<2)+2>>1]|0)+(e[278684+(jh+8<<2)+2>>1]|0)+(e[278684+(rh+8<<2)+2>>1]|0)|0;uh=pi>>>0<ni>>>0;th=((e[340124+(sh+9<<2)+2>>1]|0)+(e[278684+(jh+9<<2)+2>>1]|0)+(e[278684+(rh+9<<2)+2>>1]|0)|0)>>>0<(uh?pi:ni)>>>0?9:uh?8:zh?7:mi?6:oi?5:qh?4:ih?3:ph?2:mh&1;mh=th+jh|0;jh=a[278684+(mh<<2)>>0]|0;ph=th+sh|0;sh=a[340124+(ph<<2)>>0]|0;ih=th+rh|0;rh=a[278684+(ih<<2)>>0]|0;if(((sh|jh|rh)&255)>=32){$=474;break c}qh=(sh&255)<<5;a[lh>>0]=qh|rh&255;a[h+(hg+1)>>0]=(qh|(jh&255)<<10)>>>8;jh=a[278684+(mh<<2)+1>>0]|0;mh=a[340124+(ph<<2)+1>>0]|0;ph=a[278684+(ih<<2)+1>>0]|0;if(!((mh&255)<64&((ph|jh)&255)<32)){$=476;break c}ih=(mh&255)<<5;a[h+(hg+2)>>0]=ih|ph&255;a[h+(hg+3)>>0]=(ih|(jh&255)<<11)>>>8;jh=a[Af>>0]|0;if((th|0)==6){a[h+(hg+4)>>0]=jh;a[h+(hg+5)>>0]=a[Ke+(Nf*11|0)+1>>0]|0;a[h+(hg+6)>>0]=a[Ke+(Nf*11|0)+2>>0]|0;a[h+(hg+7)>>0]=a[Ke+(Nf*11|0)+3>>0]|0;break}else{ih=jh&255;jh=d[Ke+(Nf*11|0)+1>>0]|0;ph=d[Ke+(Nf*11|0)+2>>0]|0;mh=d[Ke+(Nf*11|0)+3>>0]|0;qh=d[(jh>>>2&3)+(507169+(th<<2))>>0]<<2|d[(jh&3)+(507169+(th<<2))>>0]|d[(jh>>>4&3)+(507169+(th<<2))>>0]<<4|d[(jh>>>6)+(507169+(th<<2))>>0]<<6;jh=d[(ph>>>2&3)+(507169+(th<<2))>>0]<<2|d[(ph&3)+(507169+(th<<2))>>0]|d[(ph>>>4&3)+(507169+(th<<2))>>0]<<4|d[(ph>>>6)+(507169+(th<<2))>>0]<<6;ph=d[(mh>>>2&3)+(507169+(th<<2))>>0]<<2|d[(mh&3)+(507169+(th<<2))>>0]|d[(mh>>>4&3)+(507169+(th<<2))>>0]<<4|d[(mh>>>6)+(507169+(th<<2))>>0]<<6;a[h+(hg+4)>>0]=d[(ih>>>2&3)+(507169+(th<<2))>>0]<<2|d[(ih&3)+(507169+(th<<2))>>0]|d[(ih>>>4&3)+(507169+(th<<2))>>0]<<4|d[(ih>>>6)+(507169+(th<<2))>>0]<<6;a[h+(hg+5)>>0]=qh;a[h+(hg+6)>>0]=jh;a[h+(hg+7)>>0]=ph;break}}else{if((gh&255)>=4){$=451;break c}ph=d[Oe>>0]|0;jh=d[Oe+1>>0]|0;qh=jh<<3|jh>>>2;jh=d[Oe+2>>0]|0;th=jh<<3|jh>>>2;jh=c[17484+(li<<4)+(eh<<2)>>2]|0;ih=(ph<<3|ph>>>2)+jh|0;if(ih>>>0>255)if((ih|0)<0){kk=0;$=454}else lk=255;else{kk=ih;$=454}if(($|0)==454){$=0;lk=kk}ih=qh+jh|0;if(ih>>>0>255)if((ih|0)<0){mk=0;$=457}else nk=255;else{mk=ih;$=457}if(($|0)==457){$=0;nk=mk}ih=th+jh|0;if(ih>>>0>255)if((ih|0)<0){ok=0;$=460}else pk=255;else{ok=ih;$=460}if(($|0)==460){$=0;pk=ok}ih=a[494083+(lk<<1)>>0]|0;jh=a[494595+(nk<<1)>>0]|0;th=a[494083+(pk<<1)>>0]|0;if(((jh|ih|th)&255)>=32){$=462;break c}qh=(jh&255)<<5;a[lh>>0]=qh|th&255;a[h+(hg+1)>>0]=(qh|(ih&255)<<10)>>>8;ih=a[494083+(lk<<1)+1>>0]|0;qh=a[494595+(nk<<1)+1>>0]|0;th=a[494083+(pk<<1)+1>>0]|0;if(!((qh&255)<64&((th|ih)&255)<32)){$=464;break c}jh=(qh&255)<<5;a[h+(hg+2)>>0]=jh|th&255;a[h+(hg+3)>>0]=(jh|(ih&255)<<11)>>>8;ih=h+(hg+4)|0;a[ih>>0]=85;a[ih+1>>0]=85;a[ih+2>>0]=85;a[ih+3>>0]=85}while(0);ah=je;bh=ie;ch=he;dh=ge;break f;break}case 15:{hg=Z((ne>>>1)+ce|0,p)|0;lb(z,Oe,Af,0);lh=d[z>>0]|0;eh=a[Mb>>0]|0;li=d[Nb>>0]|0;gh=a[Ob>>0]|0;vh=((eh&255)<<8|lh)>>>5;ri=(eh&255)>>>3;eh=((gh&255)<<8|li)>>>5;kh=(gh&255)>>>3;gh=vh&1;ih=eh&1;jh=(vh&62)>>>1;vh=(eh&62)>>>1;eh=d[Pb>>0]|0;th=d[507275+(eh&15)>>0]|0;qh=d[507275+(eh>>>4)>>0]<<4|th;eh=qh&255;a[Pb>>0]=eh;ph=d[Qb>>0]|0;mh=d[507275+(ph>>>4)>>0]<<4|d[507275+(ph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)>>0]=a[507271+((yk&255)>>>6)>>0]|0;a[h+(hg+6)>>0]=a[507271+((zk&255)>>>6)>>0]|0;Bk=a[507271+((Ak&255)>>>6)>>0]|0}else{jh=Gd(qh|0,oi|0,61)|0;Hd(jh&1|sk<<1|0,0,61)|0;jh=B&1610612736;eh=Hd(tk&255|0,0,40)|0;mi=B;Hd(uk&255|0,0,35)|0;ph=B&248;uh=Hd(qk|0,0,30)|0;gh=B;ri=Hd(vk&255|0,0,55)|0;kh=B;Hd(wk&255|0,0,50)|0;ji=B&8126464;Hd(rk|0,0,45)|0;th=sh;c[th>>2]=eh|uh&-1073741824|ri|qh&1073741823;c[th+4>>2]=mi|gh&7|ph|B&253952|kh|ji|oi&-1879048192|jh;a[h+(hg+4)>>0]=xk;a[h+(hg+5)>>0]=yk;a[h+(hg+6)>>0]=zk;Bk=Ak}a[h+(hg+7)>>0]=Bk;ah=je;bh=ie;ch=he;dh=ge;break f;break}case 16:{mb(h+(Z(ne+ce|0,p)|0)|0,Oe,Af);ah=je;bh=ie;ch=he;dh=ge;break f;break}case 17:{if(!v){$=489;break c}hg=Z(ne+ce|0,p)|0;jh=h+hg|0;oi=e[jh>>1]|0;ji=h+(hg+2)|0;kh=e[ji>>1]|0;ph=h+(hg+4)|0;c[ph>>2]=c[ph>>2]&2147450878|32768;gh=a[Ke+(kh*11|0)+10>>0]|0;mi=d[Qe+(oi<<3)+4>>0]|0;th=d[Qe+(oi<<3)+1>>0]|0;oi=th<<3|th>>>2;th=oi+(c[17484+(mi<<4)>>2]|0)|0;if(th>>>0>255)if((th|0)<0){Ck=0;$=492}else Dk=255;else{Ck=th;$=492}if(($|0)==492){$=0;Dk=Ck}c[I>>2]=Dk;th=(c[17484+(mi<<4)+4>>2]|0)+oi|0;if(th>>>0>255)if((th|0)<0){Ek=0;$=495}else Fk=255;else{Ek=th;$=495}if(($|0)==495){$=0;Fk=Ek}c[Ha>>2]=Fk;th=(c[17484+(mi<<4)+8>>2]|0)+oi|0;if(th>>>0>255)if((th|0)<0){Gk=0;$=498}else Hk=255;else{Gk=th;$=498}if(($|0)==498){$=0;Hk=Gk}c[Ia>>2]=Hk;th=(c[17484+(mi<<4)+12>>2]|0)+oi|0;if(th>>>0>255)if((th|0)<0){Ik=0;$=501}else Jk=255;else{Ik=th;$=501}if(($|0)==501){$=0;Jk=Ik}c[Ja>>2]=Jk;th=Ke+(kh*11|0)+8|0;oi=d[th>>0]|0;mi=c[I+(oi<<2)>>2]|0;n:do if(gh<<24>>24==1)$=506;else{qh=d[Ke+(kh*11|0)+9>>0]|0;ri=oi;while(1){ri=ri+1|0;if(ri>>>0>qh>>>0){$=506;break n}if((mi|0)!=(c[I+(ri<<2)>>2]|0)){Kk=-1;$=508;break}}}while(0);do if(($|0)==506){$=0;if((mi|0)<=249){Kk=mi;$=508;break}mb(jh,Oe,Af)}while(0);o:do if(($|0)==508){$=0;mi=a[Ke+(Nf*11|0)+8>>0]|0;oi=a[Ke+(Nf*11|0)+10>>0]|0;gh=d[Oe>>0]|0;ri=Oe+1|0;qh=d[ri>>0]|0;uh=Oe+2|0;eh=d[uh>>0]|0;sh=d[Qe+(Mf<<3)+4>>0]|0;mh=mi&255;wh=d[Ke+(Nf*11|0)+9>>0]|0;ih=gh<<3|gh>>>2;gh=qh<<3|qh>>>2;qh=eh<<3|eh>>>2;eh=c[17484+(sh<<4)>>2]|0;rh=eh+ih|0;ki=gh+eh|0;zh=qh+eh|0;a[F>>0]=rh>>>0>255?rh>>31^255:rh;a[Tb>>0]=ki>>>0>255?ki>>31^255:ki;a[Ub>>0]=zh>>>0>255?zh>>31^255:zh;zh=Dk>>>0>255?Dk>>31^255:Dk;a[Vb>>0]=zh;ki=c[17484+(sh<<4)+4>>2]|0;rh=ki+ih|0;eh=ki+gh|0;ni=qh+ki|0;ki=rh>>>0>255?rh>>31^255:rh;a[Wb>>0]=ki;rh=eh>>>0>255?eh>>31^255:eh;a[Xb>>0]=rh;eh=ni>>>0>255?ni>>31^255:ni;a[Yb>>0]=eh;ni=Fk>>>0>255?Fk>>31^255:Fk;a[Zb>>0]=ni;lh=c[17484+(sh<<4)+8>>2]|0;vh=lh+ih|0;pi=lh+gh|0;li=lh+qh|0;lh=vh>>>0>255?vh>>31^255:vh;a[_b>>0]=lh;vh=pi>>>0>255?pi>>31^255:pi;a[$b>>0]=vh;pi=li>>>0>255?li>>31^255:li;a[ac>>0]=pi;li=Hk>>>0>255?Hk>>31^255:Hk;a[bc>>0]=li;qi=c[17484+(sh<<4)+12>>2]|0;hh=qi+ih|0;ih=qi+gh|0;gh=qi+qh|0;qh=c[Ja>>2]|0;qi=hh>>>0>255?hh>>31^255:hh;a[dc>>0]=qi;hh=ih>>>0>255?ih>>31^255:ih;a[ec>>0]=hh;ih=gh>>>0>255?gh>>31^255:gh;a[fc>>0]=ih;gh=qh>>>0>255?qh>>31^255:qh;a[gc>>0]=gh;p:do if((oi&255)>1){qh=F+(mh<<2)|0;fh=mh;while(1){fh=fh+1|0;if(fh>>>0>wh>>>0){$=514;break p}Lk=c[qh>>2]|0;Mk=Lk&255;Nk=c[F+(fh<<2)>>2]|0;Ok=Lk>>>16;Pk=Ok&255;Qk=Lk&65535;if(Mk<<24>>24!=(Nk&255)<<24>>24){Rk=Lk;Sk=Mk;Tk=Ok;Uk=Pk;Vk=Qk;$=512;break}Wk=(Qk&65535)>>>8;if(!(Pk<<24>>24==(Nk>>>16&255)<<24>>24?(Wk&255)<<24>>24==((Nk&65535)>>>8&255)<<24>>24:0)){Xk=Wk;Yk=Lk;Zk=Ok;_k=Mk;$k=Pk;break}}if(($|0)==512){$=0;Xk=(Vk&65535)>>>8;Yk=Rk;Zk=Tk;_k=Sk;$k=Uk}if((Kk|0)>-1){fh=(g[k>>2]=+(Yk&255|0)*.003921568859368563,c[k>>2]|0);qh=(g[k>>2]=+(Xk&65535|0)*.003921568859368563,c[k>>2]|0);Pk=(g[k>>2]=+(Zk&255|0)*.003921568859368563,c[k>>2]|0);Mk=(g[k>>2]=+(Kk|0)*.003921568859368563,c[k>>2]|0);Ok=c[F+(wh<<2)>>2]|0;Lk=(g[k>>2]=+(Ok&255|0)*.003921568859368563,c[k>>2]|0);Wk=(g[k>>2]=+(Ok>>>8&255|0)*.003921568859368563,c[k>>2]|0);al=fh;bl=qh;cl=Pk;dl=Mk;el=Lk;fl=Wk;gl=(g[k>>2]=+(Ok>>>16&255|0)*.003921568859368563,c[k>>2]|0);hl=Mk;break}do if(_k<<24>>24){Mk=F+(wh<<2)|0;Ok=c[Mk>>2]|0;Wk=Ok>>>16;Lk=(e[Mk>>1]|0)>>>8&65535;if((Wk&255)<<24>>24==-1|($k<<24>>24==0|((Ok&65280|0)==65280|(Xk<<16>>16==0|(Ok&255)<<24>>24==-1))))break;Mk=a[F+(d[th>>0]<<2)+3>>0]|0;if(!(Mk<<24>>24))break;Pk=a[F+(d[Ke+(kh*11|0)+9>>0]<<2)+3>>0]|0;if(Pk<<24>>24==-1)break;qh=c[F>>2]|0;c[J>>2]=(qh>>>8&255)+(qh&255)+(qh>>>16&255);c[G>>2]=(qh>>>24)*3;c[Ra>>2]=(rh&255)+(ki&255)+(eh&255);c[kb>>2]=(ni&255)*3;c[Sa>>2]=(vh&255)+(lh&255)+(pi&255);c[ob>>2]=(li&255)*3;c[Ta>>2]=(hh&255)+(qi&255)+(ih&255);c[pb>>2]=(gh&255)*3;qh=-2147483648;fh=2147483647;Nk=-2147483648;Qk=2147483647;il=0;while(1){jl=d[Ke+(Nf*11|0)+il>>0]|0;kl=d[Ke+(kh*11|0)+il>>0]|0;ll=c[J+((jl&3)<<2)>>2]|0;ml=c[G+((kl&3)<<2)>>2]|0;nl=ml+ll|0;ol=(fh|0)<(nl|0)?fh:nl;pl=(qh|0)>(nl|0)?qh:nl;nl=ll-ml|0;ml=(Qk|0)<(nl|0)?Qk:nl;ll=(Nk|0)>(nl|0)?Nk:nl;nl=c[J+((jl>>>2&3)<<2)>>2]|0;ql=c[G+((kl>>>2&3)<<2)>>2]|0;rl=ql+nl|0;sl=(ol|0)<(rl|0)?ol:rl;ol=(pl|0)>(rl|0)?pl:rl;rl=nl-ql|0;ql=(ml|0)<(rl|0)?ml:rl;ml=(ll|0)>(rl|0)?ll:rl;rl=c[J+((jl>>>4&3)<<2)>>2]|0;ll=c[G+((kl>>>4&3)<<2)>>2]|0;nl=ll+rl|0;pl=(sl|0)<(nl|0)?sl:nl;sl=(ol|0)>(nl|0)?ol:nl;nl=rl-ll|0;ll=(ql|0)<(nl|0)?ql:nl;ql=(ml|0)>(nl|0)?ml:nl;nl=c[J+(jl>>>6<<2)>>2]|0;jl=c[G+(kl>>>6<<2)>>2]|0;kl=jl+nl|0;ml=(pl|0)<(kl|0)?pl:kl;pl=(sl|0)>(kl|0)?sl:kl;kl=nl-jl|0;jl=(ll|0)<(kl|0)?ll:kl;ll=(ql|0)>(kl|0)?ql:kl;il=il+1|0;if((il|0)==4){tl=ml;ul=pl;vl=jl;wl=ll;break}else{qh=pl;fh=ml;Nk=ll;Qk=jl}}Qk=(g[k>>2]=+(Yk&255|0)*.003921568859368563,c[k>>2]|0);Nk=(g[k>>2]=+(Xk&65535|0)*.003921568859368563,c[k>>2]|0);fh=(g[k>>2]=+(Zk&255|0)*.003921568859368563,c[k>>2]|0);qh=(g[k>>2]=+(Mk&255|0)*.003921568859368563,c[k>>2]|0);il=(g[k>>2]=+(Ok&255|0)*.003921568859368563,c[k>>2]|0);jl=(g[k>>2]=+(Lk|0)*.003921568859368563,c[k>>2]|0);ll=(g[k>>2]=+(Wk&255|0)*.003921568859368563,c[k>>2]|0);ml=(wl-vl|0)>(ul-tl|0);al=ml?il:Qk;bl=ml?jl:Nk;cl=ml?ll:fh;dl=qh;el=ml?Qk:il;fl=ml?Nk:jl;gl=ml?fh:ll;hl=(g[k>>2]=+(Pk&255|0)*.003921568859368563,c[k>>2]|0);break p}while(0);ll=0;fh=0;ml=0;jl=0;Nk=0;while(1){il=ll>>>2;Qk=ll<<1&6;qh=c[F+(((d[Ke+(Nf*11|0)+il>>0]|0)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bl;Dl=Jl}}Dl=rm*.003921568859368563;Sl=sm*.003921568859368563;Gl=Kl+nm*Dl;Fl=Ll+om*Dl;Hl=Ml+pm*Dl;Il=Nl+qm*Dl;Dl=Kl+nm*Sl;Jl=Ll+om*Sl;Bl=Ml+pm*Sl;Cl=Nl+qm*Sl;do if(Gl<0.0)tm=0.0;else{if(!(Gl>1.0)){tm=Gl;break}tm=1.0}while(0);do if(Fl<0.0)um=0.0;else{if(!(Fl>1.0)){um=Fl;break}um=1.0}while(0);do if(Hl<0.0)vm=0.0;else{if(!(Hl>1.0)){vm=Hl;break}vm=1.0}while(0);do if(Il<0.0)wm=0.0;else{if(!(Il>1.0)){wm=Il;break}wm=1.0}while(0);Nk=(g[k>>2]=tm,c[k>>2]|0);jl=(g[k>>2]=um,c[k>>2]|0);ml=(g[k>>2]=vm,c[k>>2]|0);fh=(g[k>>2]=wm,c[k>>2]|0);do if(Dl<0.0)xm=0.0;else{if(!(Dl>1.0)){xm=Dl;break}xm=1.0}while(0);do if(Jl<0.0)ym=0.0;else{if(!(Jl>1.0)){ym=Jl;break}ym=1.0}while(0);do if(Bl<0.0)zm=0.0;else{if(!(Bl>1.0)){zm=Bl;break}zm=1.0}while(0);do if(Cl<0.0)Am=0.0;else{if(!(Cl>1.0)){Am=Cl;break}Am=1.0}while(0);ll=(g[k>>2]=xm,c[k>>2]|0);Qk=(g[k>>2]=ym,c[k>>2]|0);qh=(g[k>>2]=zm,c[k>>2]|0);pl=(g[k>>2]=Am,c[k>>2]|0);if(wm>Am){Bm=pl;Cm=qh;Dm=Qk;Em=ll;Fm=fh;Gm=ml;Hm=jl;Im=Nk}else{Bm=fh;Cm=ml;Dm=jl;Em=Nk;Fm=pl;Gm=qh;Hm=Qk;Im=ll}al=Em;bl=Dm;cl=Cm;dl=Bm;el=Im;fl=Hm;gl=Gm;hl=Fm}else $=514;while(0);do if(($|0)==514){$=0;if((Kk|0)<=-1){ih=c[F+(mh<<2)>>2]|0;wh=(g[k>>2]=+(ih&255|0)*.003921568859368563,c[k>>2]|0);oi=(g[k>>2]=+(ih>>>8&255|0)*.003921568859368563,c[k>>2]|0);ll=(g[k>>2]=+(ih>>>16&255|0)*.003921568859368563,c[k>>2]|0);ih=(g[k>>2]=+(d[F+(d[th>>0]<<2)+3>>0]|0)*.003921568859368563,c[k>>2]|0);al=wh;bl=oi;cl=ll;dl=ih;el=wh;fl=oi;gl=ll;hl=(g[k>>2]=+(d[F+(d[Ke+(kh*11|0)+9>>0]<<2)+3>>0]|0)*.003921568859368563,c[k>>2]|0);break}if((mi&255)>=4){$=516;break c}ll=d[Oe>>0]|0;oi=d[ri>>0]|0;wh=oi<<3|oi>>>2;oi=d[uh>>0]|0;ih=oi<<3|oi>>>2;oi=c[17484+(sh<<4)+(mh<<2)>>2]|0;Qk=(ll<<3|ll>>>2)+oi|0;if(Qk>>>0>255)if((Qk|0)<0){Jm=0;$=519}else Km=255;else{Jm=Qk;$=519}if(($|0)==519){$=0;Km=Jm}Qk=wh+oi|0;if(Qk>>>0>255)if((Qk|0)<0){Lm=0;$=522}else Mm=255;else{Lm=Qk;$=522}if(($|0)==522){$=0;Mm=Lm}Qk=ih+oi|0;if(Qk>>>0>255)if((Qk|0)<0){Nm=0;$=525}else Om=255;else{Nm=Qk;$=525}if(($|0)==525){$=0;Om=Nm}Qk=(((Km*15|0)+128|0)>>>0)/255|0;oi=(((Mm*15|0)+128|0)>>>0)/255|0;ih=(((Om*7|0)+128|0)>>>0)/255|0;wh=d[497155+(Kk<<1)>>0]|0;ll=Qk<<1|Qk>>>3;qh=oi<<1|oi>>>3;pl=ih<<2|ih>>>1;kl=(ll<<3|ll>>>2)-Km|0;ll=(qh<<3|qh>>>2)-Mm|0;qh=(Z(ll,ll)|0)+(Z(kl,kl)|0)|0;kl=(pl<<3|pl>>>2)-Om|0;pl=(wh<<5|wh<<1)-Kk|0;ll=qh+(Z(kl,kl)|0)+(Z(pl<<1,pl)|0)|0;if((Kk|0)<3|(ll|0)==0){if(!((oi|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){$=532;break c}ol=rl<<4&240|qh<<8&3840|Pm<<1&14|Xm<<12&28672|c[ph>>2]&-32767;c[ph>>2]=ol;if(!((Ym&255)<8?((Sm|Qm|Um)&255)<16:0)){$=534;break c}c[ph>>2]=Tm<<20&15728640|Rm<<24&251658240|Vm<<16&983040|Zm<<28&1879048192|ol&-2147418113;a[jh>>0]=85;a[jh+1>>0]=85;a[jh+2>>0]=85;a[jh+3>>0]=85;break o}if(ll>>>0<nl>>>0){if(!((oi|Qk)>>>0<16&(wh|ih)>>>0<8)){$=538;break c}c[ph>>2]=oi<<4&240|Qk<<8&3840|ih<<1&14|wh<<12&28672|c[ph>>2]&-2147450879;a[jh>>0]=0;a[jh+1>>0]=0;a[jh+2>>0]=0;a[jh+3>>0]=0;break o}else{wh=c[ph>>2]|0;c[ph>>2]=wh&-32767;if(!((oi|Qk|pl)>>>0<16&(kl&255)<8)){$=541;break c}c[ph>>2]=oi<<20&15728640|Qk<<24&251658240|pl<<16&983040|ql<<28&1879048192|wh&-2147450879;a[jh>>0]=-1;a[jh+1>>0]=-1>>8;a[jh+2>>0]=-1>>16;a[jh+3>>0]=-1>>24;break o}}while(0);mh=~~((c[k>>2]=al,+g[k>>2])*15.0+.5);sh=~~((c[k>>2]=bl,+g[k>>2])*15.0+.5);uh=~~((c[k>>2]=cl,+g[k>>2])*7.0+.5);ri=~~((c[k>>2]=dl,+g[k>>2])*7.0+.5);mi=~~((c[k>>2]=el,+g[k>>2])*15.0+.5);wh=~~((c[k>>2]=fl,+g[k>>2])*15.0+.5);ql=~~((c[k>>2]=gl,+g[k>>2])*15.0+.5);pl=~~((c[k>>2]=hl,+g[k>>2])*7.0+.5);Qk=(mh>>>0>255?mh>>31^255:mh)&255;mh=(sh>>>0>255?sh>>31^255:sh)&255;sh=(uh>>>0>255?uh>>31^255:uh)&255;uh=(ri>>>0>255?ri>>31^255:ri)&255;if(!((sh|uh)>>>0<8&(Qk|mh)>>>0<16)){$=605;break c}ri=pl>>>0>255?pl>>31^255:pl;pl=mi>>>0>255?mi>>31^255:mi;mi=sh<<1&14|uh<<12&28672|mh<<4&240|Qk<<8&3840|c[ph>>2]&-32767;c[ph>>2]=mi;oi=pl&255;kl=(wh>>>0>255?wh>>31^255:wh)&255;wh=(ql>>>0>255?ql>>31^255:ql)&255;ql=ri&255;if(!(ql>>>0<8&(kl|wh|oi)>>>0<16)){$=607;break c}c[ph>>2]=wh<<16&983040|ri<<28&1879048192|pl<<24&251658240|kl<<20&15728640|mi&-2147418113;mi=Qk<<1&254|Qk>>>3;Qk=mh<<1&254|mh>>>3;mh=sh<<2&252|sh>>>1;sh=oi<<1&254|oi>>>3;oi=kl<<1&254|kl>>>3;kl=wh<<1&254|wh>>>3;wh=ql<<1&254|1;ql=mi<<3&248|mi>>>2;mi=Qk<<3&248|Qk>>>2;Qk=mh<<3&248|mh>>>2;mh=(uh<<5|uh<<1)&254;uh=(sh<<3&248|sh>>>2)-ql|0;sh=(oi<<3&248|oi>>>2)-mi|0;oi=(kl<<3&248|kl>>>2)-Qk|0;kl=(wh<<4&240|wh)-mh|0;wh=(Z(oi,oi)|0)+(Z(kl,kl)|0)+(Z(sh,sh)|0)+(Z(uh,uh)|0)|0;pl=(wh*3|0)>>>4;ri=wh>>>1;ih=(wh*13|0)>>>4;if(!(sh|oi|uh)){wh=Z((zh&255)-mh|0,kl)|0;c[D>>2]=((wh|0)>=(ih|0)&1)+((wh|0)>=(ri|0)&1)+((wh|0)>=(pl|0)&1);wh=Z(kl,(ni&255)-mh|0)|0;c[oc>>2]=((wh|0)>=(ih|0)&1)+((wh|0)>=(ri|0)&1)+((wh|0)>=(pl|0)&1);wh=Z(kl,(li&255)-mh|0)|0;c[pc>>2]=((wh|0)>=(ih|0)&1)+((wh|0)>=(ri|0)&1)+((wh|0)>=(pl|0)&1);wh=Z(kl,(gh&255)-mh|0)|0;c[qc>>2]=((wh|0)>=(ih|0)&1)+((wh|0)>=(ri|0)&1)+((wh|0)>=(pl|0)&1);wh=d[Ke+(k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>>0]|0;mi=d[Ke+(kh*11|0)+kl>>0]|0;oi=(c[H+((mi&3)<<2)>>2]|0)+(c[E+((mh&3)<<2)>>2]|0)|0;Qk=(c[H+((mi>>>2&3)<<2)>>2]|0)+(c[E+((mh>>>2&3)<<2)>>2]|0)|0;wh=(c[H+((mi>>>4&3)<<2)>>2]|0)+(c[E+((mh>>>4&3)<<2)>>2]|0)|0;sh=(c[H+(mi>>>6<<2)>>2]|0)+(c[E+(mh>>>6<<2)>>2]|0)|0;a[h+(kl+hg)>>0]=((Qk|0)>=(ih|0)&1)+((Qk|0)>=(ri|0)&1)+((Qk|0)>=(pl|0)&1)<<2|((oi|0)>=(ih|0)&1)+((oi|0)>=(ri|0)&1)+((oi|0)>=(pl|0)&1)|((wh|0)>=(ih|0)&1)+((wh|0)>=(ri|0)&1)+((wh|0)>=(pl|0)&1)<<4|((sh|0)>=(ih|0)&1)+((sh|0)>=(ri|0)&1)+((sh|0)>=(pl|0)&1)<<6;kl=kl+1|0}while((kl|0)!=4)}while(0);ah=je;bh=ie;ch=he;dh=ge;break f;break}case 20:{hg=Z(ne+ce|0,p)|0;b[h+hg>>1]=Hf;b[h+(hg+2)>>1]=Nf;ah=je;bh=ie;ch=he;dh=ge;break f;break}case 23:{if(!zc){$=615;break c}hg=h+(ne+ce<<4)|0;kh=aa-(ne<<2)|0;ji=(kh|0)>4?4:kh;kh=d[Qe+(Mf<<3)+4>>0]|0;jh=d[Oe+1>>0]|0;ph=jh<<3|jh>>>2;jh=ph+(c[17484+(kh<<4)>>2]|0)|0;if(jh>>>0>255)if((jh|0)<0){gn=0;$=618}else hn=255;else{gn=jh;$=618}if(($|0)==618){$=0;hn=gn}c[L>>2]=hn;jh=(c[17484+(kh<<4)+4>>2]|0)+ph|0;if(jh>>>0>255)if((jh|0)<0){jn=0;$=621}else kn=255;else{jn=jh;$=621}if(($|0)==621){$=0;kn=jn}c[Ac>>2]=kn;jh=(c[17484+(kh<<4)+8>>2]|0)+ph|0;if(jh>>>0>255)if((jh|0)<0){ln=0;$=624}else mn=255;else{ln=jh;$=624}if(($|0)==624){$=0;mn=ln}c[Bc>>2]=mn;jh=(c[17484+(kh<<4)+12>>2]|0)+ph|0;if(jh>>>0>255)if((jh|0)<0){nn=0;$=627}else on=255;else{nn=jh;$=627}if(($|0)==627){$=0;on=nn}c[Cc>>2]=on;if((ji|0)==4){if(de){ah=je;bh=ie;ch=he;dh=ge;break f}else{pn=hg;qn=0}while(1){jh=d[Ke+(Nf*11|0)+qn>>0]|0;a[pn+3>>0]=c[L+((jh&3)<<2)>>2];a[pn+7>>0]=c[L+((jh>>>2&3)<<2)>>2];a[pn+11>>0]=c[L+((jh>>>4&3)<<2)>>2];a[pn+15>>0]=c[L+(jh>>>6<<2)>>2];qn=qn+1|0;if((qn|0)==(Md|0)){ah=je;bh=ie;ch=he;dh=ge;break f}else pn=pn+Dc|0}}if(de){ah=je;bh=ie;ch=he;dh=ge;break f}jh=(ji|0)==0;ph=hg;kh=0;while(1){th=d[Ke+(Nf*11|0)+kh>>0]|0;if(!jh){kl=0;do{a[ph+(kl<<2|3)>>0]=c[L+((th>>>(kl<<1)&3)<<2)>>2];kl=kl+1|0}while((kl|0)!=(ue|0))}kh=kh+1|0;if((kh|0)==(Md|0)){ah=je;bh=ie;ch=he;dh=ge;break}else ph=ph+Dc|0}break}case 21:{if(!zc){$=637;break c}nb(M,Oe,d[Qe+(Mf<<3)+4>>0]|0);if(de){ah=je;bh=ie;ch=he;dh=ge;break f}ph=(aa|0)==(ne<<2|0);kh=h+(ne+ce<<4)|0;jh=0;while(1){hg=d[Ke+(Nf*11|0)+jh>>0]|0;if(!ph){ji=0;do{kl=M+((hg>>>(ji<<1)&3)<<2)|0;th=ji<<2;a[kh+th>>0]=a[kl>>0]|0;a[kh+(th|1)>>0]=a[kl+1>>0]|0;a[kh+(th|2)>>0]=a[kl+2>>0]|0;ji=ji+1|0}while((ji|0)!=(ue|0))}jh=jh+1|0;if((jh|0)==(Md|0)){ah=je;bh=ie;ch=he;dh=ge;break}else kh=kh+Dc|0}break}case 22:{if(!zc){$=644;break c}nb(O,Oe,d[Qe+(Mf<<3)+4>>0]|0);if(de){ah=je;bh=ie;ch=he;dh=ge;break f}kh=(aa|0)==(ne<<2|0);jh=h+(ne+ce<<4)|0;ph=0;while(1){ji=d[Ke+(Nf*11|0)+ph>>0]|0;if(!kh){hg=0;do{kl=O+((ji>>>(hg<<1)&3)<<2)|0;th=hg<<2;a[jh+th>>0]=a[kl>>0]|0;a[jh+(th|1)>>0]=a[kl+1>>0]|0;a[jh+(th|2)>>0]=a[kl+2>>0]|0;a[jh+(th|3)>>0]=-1;hg=hg+1|0}while((hg|0)!=(ue|0))}ph=ph+1|0;if((ph|0)==(Md|0)){ah=je;bh=ie;ch=he;dh=ge;break}else jh=jh+Dc|0}break}case 25:case 24:{if(!Ec){$=651;break c}nb(P,Oe,d[Qe+(Mf<<3)+4>>0]|0);if(Fc){jh=c[P>>2]|0;ph=((jh&255)*31|0)+128|0;kh=((jh>>>8&255)*63|0)+128|0;hg=((jh>>>16&255)*31|0)+128|0;b[Q>>1]=((kh>>>8)+kh|0)>>>8<<5|((ph>>>8)+ph|0)>>>8<<11|((hg>>>8)+hg|0)>>>8;hg=c[Ic>>2]|0;ph=((hg&255)*31|0)+128|0;kh=((hg>>>8&255)*63|0)+128|0;jh=((hg>>>16&255)*31|0)+128|0;b[Jc>>1]=((kh>>>8)+kh|0)>>>8<<5|((ph>>>8)+ph|0)>>>8<<11|((jh>>>8)+jh|0)>>>8;jh=c[Lc>>2]|0;ph=((jh&255)*31|0)+128|0;kh=((jh>>>8&255)*63|0)+128|0;hg=((jh>>>16&255)*31|0)+128|0;b[Mc>>1]=((kh>>>8)+kh|0)>>>8<<5|((ph>>>8)+ph|0)>>>8<<11|((hg>>>8)+hg|0)>>>8;hg=c[Nc>>2]|0;ph=((hg&255)*31|0)+128|0;kh=((hg>>>8&255)*63|0)+128|0;jh=((hg>>>16&255)*31|0)+128|0;b[Oc>>1]=((kh>>>8)+kh|0)>>>8<<5|((ph>>>8)+ph|0)>>>8<<11|((jh>>>8)+jh|0)>>>8}else{jh=((d[Pc>>0]|0)*31|0)+128|0;ph=((d[Qc>>0]|0)*63|0)+128|0;kh=((d[P>>0]|0)*31|0)+128|0;b[Q>>1]=((ph>>>8)+ph|0)>>>8<<5|((jh>>>8)+jh|0)>>>8<<11|((kh>>>8)+kh|0)>>>8;kh=((d[Sc>>0]|0)*31|0)+128|0;jh=((d[Tc>>0]|0)*63|0)+128|0;ph=((d[Rc>>0]|0)*31|0)+128|0;b[Uc>>1]=((jh>>>8)+jh|0)>>>8<<5|((kh>>>8)+kh|0)>>>8<<11|((ph>>>8)+ph|0)>>>8;ph=((d[Wc>>0]|0)*31|0)+128|0;kh=((d[Xc>>0]|0)*63|0)+128|0;jh=((d[Vc>>0]|0)*31|0)+128|0;b[Yc>>1]=((kh>>>8)+kh|0)>>>8<<5|((ph>>>8)+ph|0)>>>8<<11|((jh>>>8)+jh|0)>>>8;jh=((d[_c>>0]|0)*31|0)+128|0;ph=((d[$c>>0]|0)*63|0)+128|0;kh=((d[Zc>>0]|0)*31|0)+128|0;b[ad>>1]=((ph>>>8)+ph|0)>>>8<<5|((jh>>>8)+jh|0)>>>8<<11|((kh>>>8)+kh|0)>>>8}if(de){ah=je;bh=ie;ch=he;dh=ge;break f}kh=(aa|0)==(ne<<2|0);jh=h+(ne+ce<<3)|0;ph=0;while(1){hg=d[Ke+(Nf*11|0)+ph>>0]|0;if(!kh){ji=0;do{b[jh+(ji<<1)>>1]=b[Q+((hg>>>(ji<<1)&3)<<1)>>1]|0;ji=ji+1|0}while((ji|0)!=(ue|0))}ph=ph+1|0;if((ph|0)==(Md|0)){ah=je;bh=ie;ch=he;dh=ge;break}else jh=jh+Gc|0}break}case 26:{if(!Ec){$=662;break c}nb(R,Oe,d[Qe+(Mf<<3)+4>>0]|0);jh=c[R>>2]|0;ph=((jh&255)*15|0)+128|0;kh=((jh>>>8&255)*15|0)+128|0;ji=((jh>>>16&255)*15|0)+128|0;b[S>>1]=((ph>>>8)+ph|0)>>>8<<12|(kh>>>8)+kh&16128|((ji>>>8)+ji|0)>>>8<<4;ji=c[bd>>2]|0;kh=((ji&255)*15|0)+128|0;ph=((ji>>>8&255)*15|0)+128|0;jh=((ji>>>16&255)*15|0)+128|0;b[cd>>1]=((kh>>>8)+kh|0)>>>8<<12|(ph>>>8)+ph&16128|((jh>>>8)+jh|0)>>>8<<4;jh=c[dd>>2]|0;ph=((jh&255)*15|0)+128|0;kh=((jh>>>8&255)*15|0)+128|0;ji=((jh>>>16&255)*15|0)+128|0;b[ed>>1]=((ph>>>8)+ph|0)>>>8<<12|(kh>>>8)+kh&16128|((ji>>>8)+ji|0)>>>8<<4;ji=c[fd>>2]|0;kh=((ji&255)*15|0)+128|0;ph=((ji>>>8&255)*15|0)+128|0;jh=((ji>>>16&255)*15|0)+128|0;b[gd>>1]=((kh>>>8)+kh|0)>>>8<<12|(ph>>>8)+ph&16128|((jh>>>8)+jh|0)>>>8<<4;if(de){ah=je;bh=ie;ch=he;dh=ge;break f}jh=(aa|0)==(ne<<2|0);ph=h+(ne+ce<<3)|0;kh=0;while(1){ji=d[Ke+(Nf*11|0)+kh>>0]|0;if(!jh){hg=0;do{th=ph+(hg<<1)|0;b[th>>1]=e[th>>1]&15|e[S+((ji>>>(hg<<1)&3)<<1)>>1];hg=hg+1|0}while((hg|0)!=(ue|0))}kh=kh+1|0;if((kh|0)==(Md|0)){ah=je;bh=ie;ch=he;dh=ge;break}else ph=ph+Gc|0}break}case 28:{if(!Ec){$=670;break c}nb(T,Oe,d[Qe+(Mf<<3)+4>>0]|0);ph=c[T>>2]|0;kh=((ph&255)*15|0)+128|0;jh=((ph>>>8&255)*15|0)+128|0;hg=((ph>>>16&255)*15|0)+128|0;b[U>>1]=(jh>>>8)+jh&16128|((kh>>>8)+kh|0)>>>8<<12|((hg>>>8)+hg|0)>>>4|15;hg=c[hd>>2]|0;kh=((hg&255)*15|0)+128|0;jh=((hg>>>8&255)*15|0)+128|0;ph=((hg>>>16&255)*15|0)+128|0;b[id>>1]=(jh>>>8)+jh&16128|((kh>>>8)+kh|0)>>>8<<12|((ph>>>8)+ph|0)>>>4|15;ph=c[jd>>2]|0;kh=((ph&255)*15|0)+128|0;jh=((ph>>>8&255)*15|0)+128|0;hg=((ph>>>16&255)*15|0)+128|0;b[kd>>1]=(jh>>>8)+jh&16128|((kh>>>8)+kh|0)>>>8<<12|((hg>>>8)+hg|0)>>>4|15;hg=c[ld>>2]|0;kh=((hg&255)*15|0)+128|0;jh=((hg>>>8&255)*15|0)+128|0;ph=((hg>>>16&255)*15|0)+128|0;b[md>>1]=(jh>>>8)+jh&16128|((kh>>>8)+kh|0)>>>8<<12|((ph>>>8)+ph|0)>>>4|15;if(de){ah=je;bh=ie;ch=he;dh=ge;break f}ph=(aa|0)==(ne<<2|0);kh=h+(ne+ce<<3)|0;jh=0;while(1){hg=d[Ke+(Nf*11|0)+jh>>0]|0;if(!ph){ji=0;do{b[kh+(ji<<1)>>1]=b[U+((hg>>>(ji<<1)&3)<<1)>>1]|0;ji=ji+1|0}while((ji|0)!=(ue|0))}jh=jh+1|0;if((jh|0)==(Md|0)){ah=je;bh=ie;ch=he;dh=ge;break}else kh=kh+Gc|0}break}case 27:{if(!Ec){$=678;break c}nb(V,Oe,d[Qe+(Mf<<3)+4>>0]|0);kh=((d[nd>>0]|0)*15|0)+128|0;b[W>>1]=((kh>>>8)+kh|0)>>>8&255;kh=((d[od>>0]|0)*15|0)+128|0;b[pd>>1]=((kh>>>8)+kh|0)>>>8&255;kh=((d[sd>>0]|0)*15|0)+128|0;b[td>>1]=((kh>>>8)+kh|0)>>>8&255;kh=((d[ud>>0]|0)*15|0)+128|0;b[vd>>1]=((kh>>>8)+kh|0)>>>8&255;if(de){ah=je;bh=ie;ch=he;dh=ge;break f}kh=(aa|0)==(ne<<2|0);jh=h+(ne+ce<<3)|0;ph=0;while(1){ji=d[Ke+(Nf*11|0)+ph>>0]|0;if(!kh){hg=0;do{b[jh+(hg<<1)>>1]=b[W+((ji>>>(hg<<1)&3)<<1)>>1]|0;hg=hg+1|0}while((hg|0)!=(ue|0))}ph=ph+1|0;if((ph|0)==(Md|0)){ah=je;bh=ie;ch=he;dh=ge;break}else jh=jh+Gc|0}break}case 18:{jh=Z(ne+ce|0,p)|0;ph=h+jh|0;kh=a[Ke+(Nf*11|0)+8>>0]|0;hg=kh&255;ji=a[Ke+(Nf*11|0)+9>>0]|0;th=d[Qe+(Mf<<3)+4>>0]|0;if(kh<<24>>24==ji<<24>>24){if((kh&255)>=4){$=688;break c}kl=d[Oe>>0]|0;pl=(kl<<3|kl>>>2)+(c[17484+(th<<4)+(hg<<2)>>2]|0)|0;if(pl>>>0>255)if((pl|0)<0){rn=0;$=691}else sn=255;else{rn=pl;$=691}if(($|0)==691){$=0;sn=rn}b[ph>>1]=sn&255|7424;pl=h+(jh+2)|0;a[pl>>0]=a[463004]|0;a[pl+1>>0]=a[463005]|0;a[pl+2>>0]=a[463006]|0;a[pl+3>>0]=a[463007]|0;a[pl+4>>0]=a[463008]|0;a[pl+5>>0]=a[463009]|0;ah=je;bh=ie;ch=he;dh=ge;break f}q:do switch(kh<<24>>24){case 0:{if(ji<<24>>24==3){tn=0;break q}if(ji<<24>>24==2)tn=2;else $=700;break}case 1:{if(ji<<24>>24==3){tn=1;break q}if(ji<<24>>24==2)tn=3;else $=700;break}default:$=700}while(0);if(($|0)==700){$=0;tn=4}ji=tn>>>0>3?0:tn;kh=(d[Oe>>0]|0)+(th<<5)|0;pl=a[463010+(kh<<4)+(ji<<2)+1>>0]|0;b[ph>>1]=(pl&255)<<12&65535|d[463010+(kh<<4)+(ji<<2)>>0]|((pl&255)>>>4&255)<<8&65535;pl=e[463010+(kh<<4)+(ji<<2)+2>>1]|0;ji=0;kh=0;hg=0;while(1){kl=d[Ke+(Nf*11|0)+hg>>0]|0;ri=Z(hg,-3)|0;ih=Hd(pl>>>((kl>>>4&3)*3|0)&7|0,0,ri+21|0)|0;hh=B;qi=Hd(pl>>>((kl>>>2&3)*3|0)&7|0,0,ri+33|0)|0;li=B;lh=Hd(pl>>>((kl&3)*3|0)&7|0,0,ri+45|0)|0;pi=B|kh;vh=Hd(pl>>>((kl>>>6)*3|0)&7|0,0,ri+9|0)|0;ri=lh|ji|vh|qi|ih;ih=pi|B|li|hh;hg=hg+1|0;if(hg>>>0>=4){un=ri;vn=ih;break}else{ji=ri;kh=ih}}kh=Gd(un|0,vn|0,40)|0;a[h+(jh+2)>>0]=kh;a[h+(jh+3)>>0]=vn;kh=Gd(un|0,vn|0,24)|0;a[h+(jh+4)>>0]=kh;kh=Gd(un|0,vn|0,16)|0;a[h+(jh+5)>>0]=kh;kh=Gd(un|0,vn|0,8)|0;a[h+(jh+6)>>0]=kh;a[h+(jh+7)>>0]=un;ah=je;bh=ie;ch=he;dh=ge;break f;break}default:{$=701;break c}}while(0)}while(0);ne=ne+1|0;if(ne>>>0>=j>>>0){Od=ah;Pd=bh;Qd=ch;Rd=dh;Sd=If;Td=Jf;Ud=Kf;Vd=Re;Wd=Lf;Xd=Ae;Yd=Mf;Zd=Be;break d}else{ge=dh;he=ch;ie=bh;je=ah;ke=Kf;le=Jf;me=If;oe=Re;pe=Lf;qe=Ae;re=re+4|0;se=Mf;te=Be}}}while(0);Dd=Dd+1|0;if(Dd>>>0>=l>>>0){wn=Xd;$=704;break}else{wd=Rd;xd=Qd;yd=Pd;zd=Od;Ad=Ud;Bd=Td;Cd=Sd;Ed=Vd;Fd=Wd;Id=Xd;Jd=Jd+4|0;Kd=Yd;Ld=Zd}}switch($|0){case 33:{oa(499337,499239,445,499360);break}case 38:{oa(499316,499239,457,499360);break}case 49:{oa(499316,499239,332,499306);break}case 52:{oa(475191,499239,435,499572);break}case 58:{if(!ia){ga=0;break a}rd(ia);ga=0;break a;break}case 61:{if(!ia){ga=0;break a}rd(ia);ga=0;break a;break}case 67:{if(!ia){ga=0;break a}rd(ia);ga=0;break a;break}case 71:{oa(499337,499239,445,499360);break}case 76:{oa(499316,499239,457,499360);break}case 87:{oa(499337,499239,445,499360);break}case 92:{oa(499316,499239,457,499360);break}case 99:{oa(499337,499239,445,499360);break}case 104:{oa(499316,499239,457,499360);break}case 114:{oa(499316,499239,332,499306);break}case 117:{if(!ia){ga=0;break a}rd(ia);ga=0;break a;break}case 122:{oa(474843,474791,8128,474827);break}case 124:{if(!ia){ga=0;break a}rd(ia);ga=0;break a;break}case 133:{if(!ia){ga=0;break a}rd(ia);ga=0;break a;break}case 141:{oa(499615,474791,377,499599);break}case 149:{oa(499656,474791,842,499683);break}case 159:{oa(499394,499239,740,499559);break}case 170:{oa(499394,499239,740,499559);break}case 183:{oa(499615,474791,377,499599);break}case 203:{oa(474875,474791,8242,474827);break}case 205:{oa(474916,474791,8243,474827);break}case 207:{oa(474957,474791,8244,474827);break}case 209:{oa(500240,474791,3082,499702);break}case 211:{oa(500273,474791,3092,499702);break}case 213:{oa(500273,474791,3123,500290);break}case 216:{oa(474998,474791,8261,474827);break}case 218:{oa(499615,474791,377,499599);break}case 238:{oa(474875,474791,8278,474827);break}case 240:{oa(474916,474791,8279,474827);break}case 242:{oa(474957,474791,8280,474827);break}case 250:{oa(475012,474791,8293,474827);break}case 253:{oa(501356,474791,3147,501339);break}case 255:{oa(500273,474791,3176,501339);break}case 257:{oa(501389,474791,3164,501339);break}case 259:{oa(500273,474791,3176,501339);break}case 262:{oa(500240,474791,3154,501339);break}case 264:{oa(500273,474791,3176,501339);break}case 267:{oa(501432,474791,3171,501339);break}case 269:{oa(500273,474791,3176,501339);break}case 274:{oa(499656,474791,827,499666);break}case 291:{oa(502259,474791,3815,502244);break}case 298:{oa(502259,474791,3815,502244);break}case 305:{oa(499656,474791,842,499683);break}case 327:{oa(502259,474791,3815,502244);break}case 334:{oa(502259,474791,3815,502244);break}case 340:{oa(499656,474791,842,499683);break}case 370:{oa(499656,474791,827,499666);break}case 451:{oa(499656,474791,827,499666);break}case 462:{oa(500240,474791,6105,507209);break}case 464:{oa(507223,474791,6113,507256);break}case 469:{oa(500240,474791,6105,507209);break}case 471:{oa(507223,474791,6113,507256);break}case 474:{oa(500240,474791,6105,507209);break}case 476:{oa(507223,474791,6113,507256);break}case 489:{oa(475059,474791,8386,474827);break}case 516:{oa(499656,474791,827,499666);break}case 528:{oa(501389,474791,6753,507291);break}case 532:{oa(501389,474791,6753,507291);break}case 534:{oa(501432,474791,6763,507311);break}case 538:{oa(501389,474791,6753,507291);break}case 541:{oa(501432,474791,6763,507311);break}case 605:{oa(501389,474791,6753,507291);break}case 607:{oa(501432,474791,6763,507311);break}case 615:{oa(475075,474791,8403,474827);break}case 637:{oa(475075,474791,8443,474827);break}case 644:{oa(475075,474791,8472,474827);break}case 651:{oa(475133,474791,8503,474827);break}case 662:{oa(475133,474791,8546,474827);break}case 670:{oa(475133,474791,8586,474827);break}case 678:{oa(475133,474791,8617,474827);break}case 688:{oa(499656,474791,842,499683);break}case 701:{oa(475191,474791,8660,474827);break}case 704:{if(!wn)break b;else{ga=0;break a}break}case 811:{oa(475191,499239,435,499572);break}}}while(0);switch(o|0){case 6:{Ld=j+-1|0;Kd=l+-1|0;if(!Ld)xn=0;else{Jd=Ld;Id=0;while(1){Jd=Jd>>>1;Fd=Id+1|0;if(!Jd){xn=Fd;break}else Id=Fd}}if(!Kd)yn=0;else{Id=Kd;Jd=0;while(1){Id=Id>>>1;Fd=Jd+1|0;if(!Id){yn=Fd;break}else Jd=Fd}}Jd=xn>>>0<yn>>>0?xn:yn;Id=Jd<<1;Fd=(1<<Id)+-1|0;r:do if((l|0)>0){Ed=(j|0)>0;Cd=(j|0)==(l|0);Bd=I+4|0;Ad=I+8|0;zd=I+12|0;yd=z+32|0;xd=A+32|0;wd=C+4|0;Dd=z+36|0;Gc=A+36|0;vd=C+8|0;ud=z+40|0;td=A+40|0;sd=z+16|0;pd=z+4|0;od=z+20|0;nd=A+16|0;Ec=A+4|0;md=A+20|0;ld=z+8|0;kd=z+24|0;jd=A+8|0;id=A+24|0;hd=j>>>0>l>>>0;gd=Ld&1;fd=0;ed=0;s:while(1){dd=ed+-1|0;cd=0;do{bd=Z(dd+cd&Kd,j)|0;ad=ha+(bd<<2)|0;c[C+(cd<<2)>>2]=ad;Zc=c[ha+(bd+Ld<<2)>>2]|0;if(!(Zc&32768)){$=714;break s}$c=Zc&30;c[z+(cd<<2)>>2]=((((Zc>>>10&31)+(Zc>>>5&31)+($c>>>4|$c)|0)*255|0)>>>0)/31|0;$c=Zc>>>16;if(!($c&32768)){$=716;break s}c[A+(cd<<2)>>2]=((((Zc>>>26&31)+(Zc>>>21&31)+($c&31)|0)*255|0)>>>0)/31|0;$c=c[ad>>2]|0;if(!($c&32768)){$=714;break s}ad=$c&30;c[z+16+(cd<<2)>>2]=(((($c>>>10&31)+($c>>>5&31)+(ad>>>4|ad)|0)*255|0)>>>0)/31|0;ad=$c>>>16;if(!(ad&32768)){$=716;break s}c[A+16+(cd<<2)>>2]=(((($c>>>26&31)+($c>>>21&31)+(ad&31)|0)*255|0)>>>0)/31|0;ad=c[ha+(bd+gd<<2)>>2]|0;if(!(ad&32768)){$=714;break s}bd=ad&30;c[z+32+(cd<<2)>>2]=((((ad>>>10&31)+(ad>>>5&31)+(bd>>>4|bd)|0)*255|0)>>>0)/31|0;bd=ad>>>16;if(!(bd&32768)){$=716;break s}c[A+32+(cd<<2)>>2]=((((ad>>>26&31)+(ad>>>21&31)+(bd&31)|0)*255|0)>>>0)/31|0;cd=cd+1|0}while((cd|0)<3);if(Ed){cd=e[467106+(ed>>8<<1)>>1]<<16|e[467106+((ed&255)<<1)>>1];dd=c[C>>2]|0;bd=c[wd>>2]|0;ad=c[vd>>2]|0;$c=ed>>Jd<<Id;Zc=fd;_c=0;while(1){Yc=cd|e[467106+(_c>>8<<1)>>1]<<17|e[467106+((_c&255)<<1)>>1]<<1;do if(!Cd){Vc=Yc&Fd;if(hd){zn=Vc|_c>>Jd<<Id;break}else{zn=Vc|$c;break}}else zn=Yc;while(0);c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|0)?768:(xc|0)>(wc<<3|0)?512:(xc|0)>(wc*3|0)?256:0)|((vc|0)>(pc*13|0)?3072:(vc|0)>(pc<<3|0)?2048:(vc|0)>(pc*3|0)?1024:0)|((ic|0)>(lc*13|0)?48:(ic|0)>(lc<<3|0)?32:(ic|0)>(lc*3|0)?16:0)|((nc|0)>(Ac*13|0)?192:(nc|0)>(Ac<<3|0)?128:(nc|0)>(Ac*3|0)?64:0)|((Jc|0)>(kc*13|0)?12288:(Jc|0)>(kc<<3|0)?8192:(Jc|0)>(kc*3|0)?4096:0)|((hc|0)>(Wc*13|0)?49152:(hc|0)>(Wc<<3|0)?32768:(hc|0)>(Wc*3|0)?16384:0)|((ob|0)>(gc*13|0)?196608:(ob|0)>(gc<<3|0)?131072:(ob|0)>(gc*3|0)?65536:0)|((Ra|0)>(fc*13|0)?786432:(Ra|0)>(fc<<3|0)?524288:(Ra|0)>(fc*3|0)?262144:0)|((Nc|0)>(kb*13|0)?50331648:(Nc|0)>(kb<<3|0)?33554432:(Nc|0)>(kb*3|0)?16777216:0)|((Uc|0)>(uc*13|0)?201326592:(Uc|0)>(uc<<3|0)?134217728:(Uc|0)>(uc*3|0)?67108864:0)|((Mc|0)>(Cc*13|0)?3145728:(Mc|0)>(Cc<<3|0)?2097152:(Mc|0)>(Cc*3|0)?1048576:0)|((jc|0)>(Rc*13|0)?12582912:(jc|0)>(Rc<<3|0)?8388608:(jc|0)>(Rc*3|0)?4194304:0)|((Xc|0)>(yc*13|0)?805306368:(Xc|0)>(yc<<3|0)?536870912:(Xc|0)>(yc*3|0)?268435456:0)|((qc|0)>(pb*13|0)?-1073741824:(qc|0)>(pb<<3|0)?-2147483648:(qc|0)>(pb*3|0)?1073741824:0);c[z>>2]=c[sd>>2];c[sd>>2]=c[yd>>2];c[pd>>2]=c[od>>2];c[od>>2]=c[Dd>>2];c[ld>>2]=c[kd>>2];c[kd>>2]=c[ud>>2];c[A>>2]=c[nd>>2];c[nd>>2]=c[xd>>2];c[Ec>>2]=c[md>>2];c[md>>2]=c[Gc>>2];c[jd>>2]=c[id>>2];c[id>>2]=c[td>>2];pb=Zc+1|0;if((_c|0)>=(j|0)){An=pb;break}else Zc=pb}}else An=fd;ed=ed+1|0;if((ed|0)>=(l|0))break r;else fd=An}if(($|0)==714)oa(508356,474791,3304,508372);else if(($|0)==716)oa(508356,474791,3319,508395);else if(($|0)==725)oa(508356,474791,3304,508372);else if(($|0)==727)oa(508356,474791,3319,508395);else if(($|0)==729)oa(508356,474791,3304,508372);else if(($|0)==731)oa(508356,474791,3319,508395);else if(($|0)==733)oa(508356,474791,3304,508372);else if(($|0)==735)oa(508356,474791,3319,508395)}while(0);break}case 7:{Ld=c[f>>2]|0;Id=c[t>>2]|0;Jd=j+-1|0;Fd=l+-1|0;if(!Jd)Bn=0;else{Kd=Jd;fd=0;while(1){Kd=Kd>>>1;ed=fd+1|0;if(!Kd){Bn=ed;break}else fd=ed}}if(!Fd)Cn=0;else{fd=Fd;Kd=0;while(1){fd=fd>>>1;ed=Kd+1|0;if(!fd){Cn=ed;break}else Kd=ed}}Kd=Bn>>>0<Cn>>>0?Bn:Cn;fd=Kd<<1;ed=(1<<fd)+-1|0;if((l|0)>0){td=(j|0)>0;id=(j|0)==(l|0);jd=I+4|0;Gc=I+8|0;md=I+12|0;Ec=J+4|0;xd=J+8|0;nd=J+12|0;ud=z+32|0;kd=A+32|0;ld=C+4|0;Dd=z+36|0;od=A+36|0;pd=C+8|0;yd=z+40|0;sd=A+40|0;zd=z+16|0;Ad=z+4|0;Bd=z+20|0;hd=A+16|0;Cd=A+4|0;vd=A+20|0;wd=z+8|0;Ed=z+24|0;gd=A+8|0;Zc=A+24|0;_c=j>>>0>l>>>0;ad=0;bd=0;while(1){dd=bd+-1|0;$c=0;do{cd=Z(dd+$c&Fd,j)|0;c[C+($c<<2)>>2]=ha+(cd<<2);pb=0;do{qc=c[ha+((pb+-1&Jd)+cd<<2)>>2]|0;if(!(qc&32768)){Dn=a[508474+(qc>>>12&7)>>0]|0;En=d[508466+(qc>>>1&7)>>0]|0;Fn=d[508450+(qc>>>4&15)>>0]|0;Gn=d[508450+(qc>>>8&15)>>0]|0}else{Dn=-1;En=d[508450+(qc>>>1&15)>>0]|0;Fn=d[508418+(qc>>>5&31)>>0]|0;Gn=d[508418+(qc>>>10&31)>>0]|0}c[z+(pb<<4)+($c<<2)>>2]=Fn+Gn+En+(Dn&255);yc=qc>>>16;if(!(yc&32768)){Hn=a[508474+(qc>>>28&7)>>0]|0;In=d[508450+(yc&15)>>0]|0;Jn=d[508450+(qc>>>20&15)>>0]|0;Kn=d[508450+(qc>>>24&15)>>0]|0}else{Hn=-1;In=d[508418+(yc&31)>>0]|0;Jn=d[508418+(qc>>>21&31)>>0]|0;Kn=d[508418+(qc>>>26&31)>>0]|0}c[A+(pb<<4)+($c<<2)>>2]=Jn+Kn+In+(Hn&255);pb=pb+1|0}while((pb|0)!=3);$c=$c+1|0}while(($c|0)!=3);if(td){$c=Z(bd,j)|0;dd=e[467106+(bd>>8<<1)>>1]<<16|e[467106+((bd&255)<<1)>>1];pb=c[C>>2]|0;cd=c[ld>>2]|0;qc=c[pd>>2]|0;yc=bd>>Kd<<fd;Xc=c[Ad>>2]|0;Rc=c[Bd>>2]|0;jc=c[zd>>2]|0;Cc=c[z>>2]|0;Mc=c[Cd>>2]|0;uc=c[vd>>2]|0;Uc=c[hd>>2]|0;kb=c[A>>2]|0;Nc=c[wd>>2]|0;fc=c[Ed>>2]|0;Ra=c[gd>>2]|0;gc=c[Zc>>2]|0;ob=ad;Wc=0;while(1){hc=w+(Wc+$c<<2)|0;kc=e[hc>>1]|0;Jc=Ld+(kc<<3)|0;Ac=e[hc+2>>1]|0;hc=dd|e[467106+(Wc>>8<<1)>>1]<<17|e[467106+((Wc&255)<<1)>>1]<<1;do if(!id){nc=hc&ed;if(_c){Ln=nc|Wc>>Kd<<fd;break}else{Ln=nc|yc;break}}else Ln=hc;while(0);c[h+(Ln<<3)+4>>2]=c[ha+(ob<<2)>>2];hc=ia+(ob<<3)|0;nc=c[hc>>2]|0;lc=nc>>>29;ic=(d[508418+(nc>>>11&31)>>0]|0)+(d[508418+(nc>>>3&31)>>0]|0)+(d[508418+(nc>>>19&31)>>0]|0)<<4;nc=ic+(c[18212+(lc<<4)>>2]|0)|0;c[I>>2]=(nc|0)<0?0:(nc|0)>12240?12240:nc;nc=ic+(c[18212+(lc<<4)+4>>2]|0)|0;c[jd>>2]=(nc|0)<0?0:(nc|0)>12240?12240:nc;nc=ic+(c[18212+(lc<<4)+8>>2]|0)|0;c[Gc>>2]=(nc|0)<0?0:(nc|0)>12240?12240:nc;nc=(c[18212+(lc<<4)+12>>2]|0)+ic|0;c[md>>2]=(nc|0)<0?0:(nc|0)>12240?12240:nc;nc=d[508418+(d[Jc+1>>0]|0)>>0]<<4;ic=d[Ld+(kc<<3)+4>>0]|0;lc=nc+(c[18340+(ic<<4)>>2]|0)|0;c[J>>2]=(lc|0)<0?0:(lc|0)>4080?4080:lc;lc=(c[18340+(ic<<4)+4>>2]|0)+nc|0;c[Ec>>2]=(lc|0)<0?0:(lc|0)>4080?4080:lc;lc=(c[18340+(ic<<4)+8>>2]|0)+nc|0;c[xd>>2]=(lc|0)<0?0:(lc|0)>4080?4080:lc;lc=(c[18340+(ic<<4)+12>>2]|0)+nc|0;c[nd>>2]=(lc|0)<0?0:(lc|0)>4080?4080:lc;Wc=Wc+1|0;lc=Wc&Jd;nc=c[pb+(lc<<2)>>2]|0;if(!(nc&32768)){Mn=a[508474+(nc>>>12&7)>>0]|0;Nn=d[508466+(nc>>>1&7)>>0]|0;On=d[508450+(nc>>>4&15)>>0]|0;Pn=d[508450+(nc>>>8&15)>>0]|0}else{Mn=-1;Nn=d[508450+(nc>>>1&15)>>0]|0;On=d[508418+(nc>>>5&31)>>0]|0;Pn=d[508418+(nc>>>10&31)>>0]|0}ic=On+Pn+Nn+(Mn&255)|0;pc=nc>>>16;if(!(pc&32768)){Qn=a[508474+(nc>>>28&7)>>0]|0;Rn=d[508450+(pc&15)>>0]|0;Sn=d[508450+(nc>>>20&15)>>0]|0;Tn=d[508450+(nc>>>24&15)>>0]|0}else{Qn=-1;Rn=d[508418+(pc&31)>>0]|0;Sn=d[508418+(nc>>>21&31)>>0]|0;Tn=d[508418+(nc>>>26&31)>>0]|0}nc=Sn+Tn+Rn+(Qn&255)|0;pc=c[cd+(lc<<2)>>2]|0;if(!(pc&32768)){Un=a[508474+(pc>>>12&7)>>0]|0;Vn=d[508466+(pc>>>1&7)>>0]|0;Wn=d[508450+(pc>>>4&15)>>0]|0;Xn=d[508450+(pc>>>8&15)>>0]|0}else{Un=-1;Vn=d[508450+(pc>>>1&15)>>0]|0;Wn=d[508418+(pc>>>5&31)>>0]|0;Xn=d[508418+(pc>>>10&31)>>0]|0}vc=Wn+Xn+Vn+(Un&255)|0;wc=pc>>>16;if(!(wc&32768)){Yn=a[508474+(pc>>>28&7)>>0]|0;Zn=d[508450+(wc&15)>>0]|0;_n=d[508450+(pc>>>20&15)>>0]|0;$n=d[508450+(pc>>>24&15)>>0]|0}else{Yn=-1;Zn=d[508418+(wc&31)>>0]|0;_n=d[508418+(pc>>>21&31)>>0]|0;$n=d[508418+(pc>>>26&31)>>0]|0}pc=_n+$n+Zn+(Yn&255)|0;wc=c[qc+(lc<<2)>>2]|0;if(!(wc&32768)){ao=a[508474+(wc>>>12&7)>>0]|0;bo=d[508466+(wc>>>1&7)>>0]|0;co=d[508450+(wc>>>4&15)>>0]|0;eo=d[508450+(wc>>>8&15)>>0]|0}else{ao=-1;bo=d[508450+(wc>>>1&15)>>0]|0;co=d[508418+(wc>>>5&31)>>0]|0;eo=d[508418+(wc>>>10&31)>>0]|0}lc=co+eo+bo+(ao&255)|0;xc=wc>>>16;if(!(xc&32768)){fo=a[508474+(wc>>>28&7)>>0]|0;go=d[508450+(xc&15)>>0]|0;ho=d[508450+(wc>>>20&15)>>0]|0;io=d[508450+(wc>>>24&15)>>0]|0}else{fo=-1;go=d[508418+(xc&31)>>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(Pb<<3|0)?8388608:(Qb|0)>(Pb*3|0)?4194304:0)|((Kb|0)>(Nb*13|0)?805306368:(Kb|0)>(Nb<<3|0)?536870912:(Kb|0)>(Nb*3|0)?268435456:0)|((Bc|0)>(Ic*13|0)?-1073741824:(Bc|0)>(Ic<<3|0)?-2147483648:(Bc|0)>(Ic*3|0)?1073741824:0);if((Wc|0)==(j|0)){jo=gc;ko=fc;lo=uc;mo=Uc;no=Rc;oo=jc;po=ic;qo=nc;ro=vc;so=pc;to=lc;uo=wc;break}else{Ic=gc;Bc=fc;Nb=Uc;Kb=uc;Pb=jc;Qb=Rc;Rc=vc;jc=ic;uc=pc;Uc=nc;fc=lc;gc=wc;ob=ob+1|0;Ra=Ic;Nc=Bc;kb=Nb;Mc=Kb;Cc=Pb;Xc=Qb}}c[ud>>2]=po;c[kd>>2]=qo;c[Dd>>2]=ro;c[od>>2]=so;c[yd>>2]=to;c[sd>>2]=uo;c[z>>2]=oo;c[zd>>2]=po;c[Ad>>2]=no;c[Bd>>2]=ro;c[A>>2]=mo;c[hd>>2]=qo;c[Cd>>2]=lo;c[vd>>2]=so;c[wd>>2]=ko;c[Ed>>2]=to;c[gd>>2]=jo;c[Zc>>2]=uo;vo=ad+j|0}else vo=ad;bd=bd+1|0;if((bd|0)==(l|0))break;else ad=vo}}break}default:{}}if(!ia)ga=1;else{rd(ia);ga=1}}while(0);ia=c[K>>2]|0;if(!ia){ca=ga;i=y;return ca|0}K=c[x>>2]|0;if((K|0)!=(ia|0))c[x>>2]=K+(~((K+-4-ia|0)>>>2)<<2);Kc(ia);ca=ga;i=y;return ca|0}
-function Sa(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+15&-16;return b|0}function Ta(){return i|0}function Ua(a){a=a|0;i=a}function Va(a,b){a=a|0;b=b|0;i=a;j=b}function Wa(a,b){a=a|0;b=b|0;if(!m){m=a;n=b}}function Xa(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 Ya(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 Za(a){a=a|0;B=a}function _a(){return B|0}function $a(){return c[22]|0}function ab(a){a=a|0;c[22]=a;return}function bb(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;f=b+4|0;g=c[f>>2]|0;h=c[b>>2]|0;i=g-h>>4;if(i>>>0>=d>>>0){if(i>>>0>d>>>0?(j=h+(d<<4)|0,(g|0)!=(j|0)):0)c[f>>2]=g+(~((0-j+(g+-16)|0)>>>4)<<4)}else oc(b,d-i|0);if(!d)return;else k=0;do{i=c[b>>2]|0;g=c[e+(k<<2)>>2]|0;a[i+(k<<4)>>0]=g&3;a[i+(k<<4)+1>>0]=g>>>2&3;a[i+(k<<4)+2>>0]=g>>>4&3;a[i+(k<<4)+3>>0]=g>>>6&3;a[i+(k<<4)+4>>0]=g>>>8&3;a[i+(k<<4)+5>>0]=g>>>10&3;a[i+(k<<4)+6>>0]=g>>>12&3;a[i+(k<<4)+7>>0]=g>>>14&3;a[i+(k<<4)+8>>0]=g>>>16&3;a[i+(k<<4)+9>>0]=g>>>18&3;a[i+(k<<4)+10>>0]=g>>>20&3;a[i+(k<<4)+11>>0]=g>>>22&3;a[i+(k<<4)+12>>0]=g>>>24&3;a[i+(k<<4)+13>>0]=g>>>26&3;a[i+(k<<4)+14>>0]=g>>>28&3;a[i+(k<<4)+15>>0]=g>>>30;k=k+1|0}while((k|0)!=(d|0));return}function cb(){var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0;f=i;i=i+112|0;g=f+72|0;h=f+8|0;j=f+4|0;k=f;if(a[467618]|0){i=f;return}db();l=0;do{m=0;do{n=((m<<5)+l|0)*60|0;o=0;do{p=(o*10|0)+n|0;q=b[24732+(p<<2)+2>>1]|0;r=b[24732+((p|1)<<2)+2>>1]|0;s=(r&65535)<(q&65535);t=s?r:q;q=b[24732+(p+2<<2)+2>>1]|0;r=(q&65535)<(t&65535);u=r?q:t;t=b[24732+(p+3<<2)+2>>1]|0;q=(t&65535)<(u&65535);v=q?t:u;u=b[24732+(p+4<<2)+2>>1]|0;t=(u&65535)<(v&65535);w=t?u:v;v=b[24732+(p+5<<2)+2>>1]|0;u=(v&65535)<(w&65535);x=u?v:w;w=b[24732+(p+6<<2)+2>>1]|0;v=(w&65535)<(x&65535);y=v?w:x;x=b[24732+(p+7<<2)+2>>1]|0;w=(x&65535)<(y&65535);z=w?x:y;y=b[24732+(p+8<<2)+2>>1]|0;x=(y&65535)<(z&65535);a[491267+(l*48|0)+(m*6|0)+o>>0]=(e[24732+(p+9<<2)+2>>1]|0)<((x?y:z)&65535)?9:x?8:w?7:v?6:u?5:t?4:q?3:r?2:s&1;o=o+1|0}while((o|0)!=6);m=m+1|0}while((m|0)!=8);l=l+1|0}while((l|0)!=32);c[4476]=0;c[4480]=1;c[4475]=2;c[4479]=3;c[4484]=4;c[4474]=5;l=0;do{m=(l&1|0)!=0?511:0;o=l>>>1;c[17956+(l<<2)>>2]=((o<<6|o)^m)>>>2|m&128;l=l+1|0}while((l|0)!=16);A=0;do{l=(A&1|0)!=0?511:0;m=A>>>1;c[17956+((A|16)<<2)>>2]=((m<<6|m)+22^l)>>>2|l&128;A=A+1|0}while((A|0)!=16);B=0;do{A=(B&1|0)!=0?511:0;l=B>>>1;c[17956+((B|32)<<2)>>2]=((l<<6|l)+44^A)>>>2|A&128;B=B+1|0}while((B|0)!=16);C=0;do{B=492803+(C<<1)+1|0;A=492803+(C<<1)|0;l=0;m=2147483647;while(1){o=c[17956+(l<<2)>>2]|0;n=((o<<8|o)*43|0)+32|0;o=l&255;s=0;r=m;while(1){q=c[17956+(s<<2)>>2]|0;t=(((n+((q<<8|q)*21|0)|0)/64|0)>>8)-C|0;q=(t|0)>-1?t:0-t|0;if((q|0)<(r|0)){a[B>>0]=s;a[A>>0]=o;D=q}else D=r;s=s+1|0;if((s|0)==48){E=D;break}else r=D}r=l+1|0;if((r|0)==48)break;else{l=r;m=E}}C=C+1|0}while((C|0)!=256);F=0;do{C=493315+F|0;E=0;D=2147483647;while(1){m=(c[17956+(E<<2)>>2]|0)-F|0;l=(m|0)>-1?m:0-m|0;if((l|0)<(D|0)){a[C>>0]=E;G=l}else G=D;E=E+1|0;if((E|0)==48)break;else D=G}F=F+1|0}while((F|0)!=256);H=0;do{a[g+H>>0]=H<<3|H>>>2;H=H+1|0}while((H|0)!=32);I=0;do{H=467619+(I<<1)|0;F=467619+(I<<1)+1|0;G=0;D=256;while(1){E=G&255;C=d[g+G>>0]|0;l=0;m=D;while(1){A=d[g+l>>0]|0;B=((((A<<1)+C|0)>>>0)/3|0)-I|0;r=A-C|0;A=((B|0)<0?0-B|0:B)+(((((r|0)<0?0-r|0:r)*3|0)>>>0)/100|0)|0;if((A|0)<(m|0)){a[H>>0]=l;a[F>>0]=E;J=A}else J=m;l=l+1|0;if((l|0)==32){K=J;break}else m=J}m=G+1|0;if((m|0)==32)break;else{G=m;D=K}}I=I+1|0}while((I|0)!=256);L=0;do{I=468131+(L<<1)|0;K=468131+(L<<1)+1|0;J=0;D=256;while(1){G=(d[g+J>>0]|0)-L|0;F=(G|0)<0?0-G|0:G;if((F|0)<(D|0)){a[I>>0]=J;a[K>>0]=0;M=F}else M=D;J=J+1|0;if((J|0)==32)break;else D=M}L=L+1|0}while((L|0)!=256);L=0;do{a[h+L>>0]=L<<2|L>>>4;L=L+1|0}while((L|0)!=64);N=0;do{L=468643+(N<<1)|0;M=468643+(N<<1)+1|0;g=0;D=256;while(1){J=g&255;K=d[h+g>>0]|0;I=0;F=D;while(1){G=d[h+I>>0]|0;H=((((G<<1)+K|0)>>>0)/3|0)-N|0;m=G-K|0;G=((H|0)<0?0-H|0:H)+(((((m|0)<0?0-m|0:m)*3|0)>>>0)/100|0)|0;if((G|0)<(F|0)){a[L>>0]=I;a[M>>0]=J;O=G}else O=F;I=I+1|0;if((I|0)==64){P=O;break}else F=O}F=g+1|0;if((F|0)==64)break;else{g=F;D=P}}N=N+1|0}while((N|0)!=256);Q=0;do{N=469155+(Q<<1)|0;P=469155+(Q<<1)+1|0;O=0;D=256;while(1){g=(d[h+O>>0]|0)-Q|0;M=(g|0)<0?0-g|0:g;if((M|0)<(D|0)){a[N>>0]=O;a[P>>0]=0;R=M}else R=D;O=O+1|0;if((O|0)==64)break;else D=R}Q=Q+1|0}while((Q|0)!=256);c[4123]=0;c[4127]=1;c[4122]=2;c[4126]=3;c[4131]=4;c[4121]=5;Q=j+1|0;R=k+1|0;h=j+2|0;D=k+2|0;O=j+3|0;P=k+3|0;N=0;do{M=a[491187+(d[507169+(N<<2)>>0]|0)>>0]|0;a[j>>0]=M;a[k>>0]=a[469667+(M&255)>>0]|0;M=a[491187+(d[507169+(N<<2)+1>>0]|0)>>0]|0;a[Q>>0]=M;a[R>>0]=a[469667+(M&255)>>0]|0;M=a[491187+(d[507169+(N<<2)+2>>0]|0)>>0]|0;a[h>>0]=M;a[D>>0]=a[469667+(M&255)>>0]|0;M=a[491187+(d[507169+(N<<2)+3>>0]|0)>>0]|0;a[O>>0]=M;a[P>>0]=a[469667+(M&255)>>0]|0;M=0;do{g=M&3;L=M>>>2&3;F=M>>>4&3;I=M>>>6&3;J=d[k+I>>0]<<6|(d[k+F>>0]<<4|(d[k+L>>0]<<2|d[k+g>>0]));a[469671+(N<<8)+M>>0]=d[j+I>>0]<<6|(d[j+F>>0]<<4|(d[j+L>>0]<<2|d[j+g>>0]));a[472231+(N<<8)+M>>0]=J;M=M+1|0}while((M|0)!=256);N=N+1|0}while((N|0)!=10);c[4444]=0;c[4448]=1;c[4443]=2;c[4447]=3;c[4452]=4;c[4442]=5;c[4460]=0;c[4464]=1;c[4459]=2;c[4463]=3;c[4468]=4;c[4458]=5;N=0;do{j=493571+(N<<1)|0;k=493571+(N<<1)+1|0;P=0;O=256;while(1){D=P<<1|P>>3;h=(D<<3|D>>2)*5|0;D=P&255;R=0;Q=O;while(1){M=((((R<<3|R>>2)*3|0)+h|0)/8|0)-N|0;J=(M|0)>-1?M:0-M|0;if((J|0)<(Q|0)){a[j>>0]=D;a[k>>0]=R;S=J}else S=Q;R=R+1|0;if((R|0)==32){T=S;break}else Q=S}Q=P+1|0;if((Q|0)==16)break;else{P=Q;O=T}}N=N+1|0}while((N|0)!=256);U=0;do{N=494083+(U<<1)|0;T=494083+(U<<1)+1|0;S=0;O=256;while(1){P=(S<<3|S>>2)*5|0;k=S&255;j=0;Q=O;while(1){R=((((j<<3|j>>2)*3|0)+P|0)/8|0)-U|0;D=(R|0)>-1?R:0-R|0;if((D|0)<(Q|0)){a[N>>0]=k;a[T>>0]=j;V=D}else V=Q;j=j+1|0;if((j|0)==32){W=V;break}else Q=V}Q=S+1|0;if((Q|0)==32)break;else{S=Q;O=W}}U=U+1|0}while((U|0)!=256);X=0;do{U=494595+(X<<1)|0;W=494595+(X<<1)+1|0;V=0;O=256;while(1){S=(V<<3|V>>2)*5|0;T=V&255;N=0;Q=O;while(1){j=((((N<<2|N>>4)*3|0)+S|0)/8|0)-X|0;k=(j|0)>-1?j:0-j|0;if((k|0)<(Q|0)){a[U>>0]=T;a[W>>0]=N;Y=k}else Y=Q;N=N+1|0;if((N|0)==64){Z=Y;break}else Q=Y}Q=V+1|0;if((Q|0)==32)break;else{V=Q;O=Z}}X=X+1|0}while((X|0)!=256);_=0;do{X=495107+(_<<1)|0;Z=495107+(_<<1)+1|0;Y=0;O=256;while(1){V=Y<<1|Y>>3;W=(V<<3|V>>2)-_|0;V=(W|0)>-1?W:0-W|0;if((V|0)<(O|0)){a[X>>0]=0;a[Z>>0]=Y;$=V}else $=O;Y=Y+1|0;if((Y|0)==16)break;else O=$}_=_+1|0}while((_|0)!=256);aa=0;do{_=495619+(aa<<1)|0;$=495619+(aa<<1)+1|0;O=0;Y=256;while(1){Z=(O<<3|O>>2)-aa|0;X=(Z|0)>-1?Z:0-Z|0;if((X|0)<(Y|0)){a[_>>0]=0;a[$>>0]=O;ba=X}else ba=Y;O=O+1|0;if((O|0)==32)break;else Y=ba}aa=aa+1|0}while((aa|0)!=256);ca=0;do{aa=496131+(ca<<1)|0;ba=496131+(ca<<1)+1|0;Y=0;O=256;while(1){$=(Y<<2|Y>>4)-ca|0;_=($|0)>-1?$:0-$|0;if((_|0)<(O|0)){a[aa>>0]=0;a[ba>>0]=Y;da=_}else da=O;Y=Y+1|0;if((Y|0)==64)break;else O=da}ca=ca+1|0}while((ca|0)!=256);c[4540]=0;c[4544]=1;c[4539]=2;c[4543]=3;c[4548]=4;c[4538]=5;ca=0;do{da=0;O=0;Y=0;ba=2147483647;while(1){aa=(Y<<5|Y<<1)*5|0;_=ca-((aa+51|0)>>>3)|0;$=(_|0)>-1?_:0-_|0;_=($|0)<(ba|0);X=_?$:ba;$=ca-((aa+153|0)>>>3)|0;Z=($|0)>-1?$:0-$|0;$=(Z|0)<(X|0);V=$?Z:X;X=ca-((aa+255|0)>>>3)|0;Z=(X|0)>-1?X:0-X|0;X=(Z|0)<(V|0);W=X?Z:V;V=ca-((aa+357|0)>>>3)|0;Z=(V|0)>-1?V:0-V|0;V=(Z|0)<(W|0);U=V?Z:W;W=ca-((aa+459|0)>>>3)|0;Z=(W|0)>-1?W:0-W|0;W=(Z|0)<(U|0);Q=W?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ea=ha+-119|0;ca=(ea|0)>-1?ea:119-ha|0;ea=(ca|0)<(fa|0);O=ea?ca:fa;fa=ha+-153|0;ca=(fa|0)>-1?fa:153-ha|0;fa=(ca|0)<(O|0);da=fa?ca:O;O=ha+-187|0;ca=(O|0)>-1?O:187-ha|0;O=(ca|0)<(da|0);Y=O?ca:da;da=ha+-221|0;ca=(da|0)>-1?da:221-ha|0;da=(ca|0)<(Y|0);T=ha+-255|0;ba=(((T|0)>-1?T:255-ha|0)|0)<((da?ca:Y)|0)?7:da?6:O?5:fa?4:ea?3:N?2:ga&1;a[497667+(ha<<1)>>0]=ba;a[497667+(ha<<1)+1>>0]=ba;ha=ha+1|0}while((ha|0)!=256);ia=0;do{ha=0;ba=0;ga=0;N=2147483647;while(1){ea=ga<<2|ga>>>1;fa=(ea<<3|ea>>>2)*5|0;ea=ha;O=ba;da=0;Y=N;while(1){ca=da<<1|da>>>3;T=ia-((((ca<<3|ca>>>2)*3|0)+fa|0)>>>3)|0;ca=(T|0)>-1?T:0-T|0;T=(ca|0)<(Y|0);aa=T?ga:O;S=T?da:ea;Z=T?ca:Y;da=da+1|0;if((da|0)==16){ja=Z;ka=S;la=aa;break}else{ea=S;O=aa;Y=Z}}Y=ga+1|0;if((Y|0)==8){ma=ka;na=la;break}else{ha=ka;ba=la;ga=Y;N=ja}}a[498179+(ia<<1)>>0]=na;a[498179+(ia<<1)+1>>0]=ma;ia=ia+1|0}while((ia|0)!=256);oa=0;do{ia=0;ma=0;na=0;ja=2147483647;while(1){la=na<<1|na>>>3;ka=(la<<3|la>>>2)*5|0;la=ia;N=ma;ga=0;ba=ja;while(1){ha=ga<<1|ga>>>3;Y=oa-((((ha<<3|ha>>>2)*3|0)+ka|0)>>>3)|0;ha=(Y|0)>-1?Y:0-Y|0;Y=(ha|0)<(ba|0);O=Y?na:N;ea=Y?ga:la;da=Y?ha:ba;ga=ga+1|0;if((ga|0)==16){pa=da;qa=ea;ra=O;break}else{la=ea;N=O;ba=da}}ba=na+1|0;if((ba|0)==16){sa=qa;ta=ra;break}else{ia=qa;ma=ra;na=ba;ja=pa}}a[498691+(oa<<1)>>0]=ta;a[498691+(oa<<1)+1>>0]=sa;oa=oa+1|0}while((oa|0)!=256);a[467618]=1;i=f;return}function db(){var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,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;d=i;i=i+1040|0;e=d;f=d+8|0;g=0;do{if((1497965>>>g&1|0)!=0?(1797559>>>g&1|0)!=0:0)h=5;else h=4;if((h|0)==4?(h=0,(898768>>>g&1|0)!=0):0)h=5;if((h|0)==5){h=0;j=(c[16704+(g*12|0)+4>>2]<<1|1)+(c[16704+(g*12|0)+8>>2]<<2)<<c[16704+(g*12|0)>>2];k=0;do{c[f+(k<<2)>>2]=(Kb(k,g)|0)<<8|k;k=k+1|0}while(k>>>0<j>>>0);ud(f,f+(j<<2)|0,e);k=0;do{l=c[f+(k<<2)>>2]|0;m=l&255;a[476581+(g<<9)+(m<<1)>>0]=l>>>8;a[476581+(g<<9)+(m<<1)+1>>0]=k;k=k+1|0}while(k>>>0<j>>>0)}g=g+1|0}while(g>>>0<21);n=0;o=0;p=0;while(1){g=-1;f=n;e=o;h=0;while(1){j=(h*86|0)+32|0;k=h&255;m=g;l=f;q=e;r=0;while(1){s=((j+(r*42|0)|0)>>>6)-p|0;t=Z(s,s)|0;s=t>>>0<(m&65535)>>>0;u=s?t&65535:m;t=s?k:l;v=s?r&255:q;r=r+1|0;if((r|0)==128){w=u;x=t;y=v;break}else{m=u;l=t;q=v}}h=h+1|0;if((h|0)==128){z=w;A=x;B=y;break}else{g=w;f=x;e=y}}b[19612+(p<<3)>>1]=z;a[19612+(p<<3)+2>>0]=A;a[19612+(p<<3)+3>>0]=B;e=-1;f=A;g=B;h=0;while(1){q=((h<<1|1)*43|0)+32|0;l=h&255;m=e;r=f;k=g;j=0;while(1){v=((q+((j<<1|1)*21|0)|0)>>>6)-p|0;t=Z(v,v)|0;v=t>>>0<(m&65535)>>>0;u=v?t&65535:m;t=v?l:r;s=v?j&255:k;j=j+1|0;if((j|0)==128){C=u;D=t;E=s;break}else{m=u;r=t;k=s}}h=h+1|0;if((h|0)==128){F=C;G=D;H=E;break}else{e=C;f=D;g=E}}b[19612+(p<<3)+4>>1]=F;a[19612+(p<<3)+6>>0]=G;a[19612+(p<<3)+7>>0]=H;g=p+1|0;if((g|0)==256){I=0;J=0;K=0;break}else{n=G;o=H;p=g}}while(1){p=-1;H=I;o=J;G=0;while(1){n=((G<<1|G>>>6)*43|0)+32|0;F=G&255;E=p;D=H;C=o;B=0;while(1){A=((n+((B<<1|B>>>6)*21|0)|0)>>>6)-K|0;z=Z(A,A)|0;A=z>>>0<(E&65535)>>>0;y=A?B&255:C;x=A?F:D;w=A?z&65535:E;B=B+1|0;if((B|0)==128){L=w;M=x;N=y;break}else{E=w;D=x;C=y}}G=G+1|0;if((G|0)==128){O=L;P=M;Q=N;break}else{p=L;H=M;o=N}}b[21660+(K<<2)>>1]=O;a[21660+(K<<2)+2>>0]=P;a[21660+(K<<2)+3>>0]=Q;o=K+1|0;if((o|0)==256)break;else{I=P;J=Q;K=o}}i=d;return}function eb(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=0;c[a+24>>2]=0;c[a+28>>2]=0;c[a+32>>2]=0;c[a+36>>2]=0;c[a+40>>2]=0;c[a+44>>2]=0;c[a+48>>2]=0;c[a+52>>2]=0;c[a+56>>2]=0;c[a+60>>2]=0;c[a+64>>2]=0;c[a+68>>2]=0;c[a+72>>2]=0;c[a+76>>2]=0;c[a+80>>2]=0;c[a+84>>2]=0;c[a+88>>2]=0;c[a+92>>2]=0;c[a+96>>2]=0;c[a+100>>2]=0;c[a+104>>2]=0;c[a+108>>2]=0;c[a+112>>2]=0;c[a+116>>2]=0;c[a+120>>2]=0;c[a+124>>2]=0;c[a+128>>2]=0;c[a+132>>2]=0;c[a+136>>2]=0;c[a+140>>2]=0;c[a+144>>2]=0;c[a+148>>2]=0;c[a+152>>2]=0;c[a+156>>2]=0;c[a+160>>2]=0;c[a+164>>2]=0;c[a+168>>2]=0;c[a+172>>2]=0;c[a+176>>2]=0;c[a+180>>2]=0;c[a+184>>2]=0;c[a+188>>2]=0;c[a+192>>2]=0;c[a+196>>2]=0;c[a+200>>2]=0;c[a+204>>2]=0;c[a+208>>2]=0;c[a+212>>2]=0;c[a+216>>2]=0;c[a+220>>2]=0;c[a+224>>2]=0;c[a+228>>2]=0;c[a+232>>2]=0;c[a+236>>2]=0;c[a+240>>2]=0;c[a+244>>2]=0;c[a+248>>2]=0;c[a+252>>2]=0;c[a+256>>2]=0;c[a+260>>2]=0;c[a+264>>2]=0;c[a+268>>2]=0;c[a+272>>2]=0;c[a+276>>2]=0;c[a+280>>2]=0;c[a+284>>2]=0;c[a+288>>2]=0;c[a+292>>2]=0;c[a+296>>2]=0;c[a+300>>2]=0;c[a+304>>2]=0;c[a+308>>2]=0;c[a+312>>2]=0;c[a+316>>2]=0;c[a+320>>2]=0;c[a+324>>2]=0;c[a+328>>2]=0;c[a+332>>2]=0;c[a+336>>2]=0;c[a+340>>2]=0;c[a+344>>2]=0;c[a+348>>2]=0;c[a+352>>2]=0;c[a+356>>2]=0;c[a+360>>2]=0;c[a+364>>2]=0;c[a+368>>2]=0;c[a+372>>2]=0;c[a+376>>2]=0;c[a+380>>2]=0;c[a+384>>2]=0;c[a+388>>2]=0;c[a+392>>2]=0;c[a+396>>2]=0;c[a+400>>2]=0;c[a+404>>2]=0;return}function fb(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,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=o+4|0,(c[G>>2]|0)!=(c[o>>2]|0)):0)?(H=p+4|0,(c[H>>2]|0)!=(c[p>>2]|0)):0)?(I=q+4|0,(c[I>>2]|0)!=(c[q>>2]|0)):0)?(J=r+4|0,(c[J>>2]|0)!=(c[r>>2]|0)):0){K=c[g>>2]|0;if(!K){L=c[D>>2]|0;if(L>>>0<(c[F>>2]|0)>>>0){c[D>>2]=L+1;M=d[L>>0]|0}else M=0;c[h>>2]=c[h>>2]|M;c[g>>2]=8;N=8}else N=K;K=c[h>>2]|0;M=K&1;c[h>>2]=K>>>1;c[g>>2]=N+-1;N=(M|0)==0;K=e+4|0;L=c[K>>2]|0;O=c[e>>2]|0;P=L-O>>3;if(P>>>0>=f>>>0){if(P>>>0>f>>>0?(Q=O+(f<<3)|0,(L|0)!=(Q|0)):0)c[K>>2]=L+(~((L+-8-Q|0)>>>3)<<3)}else pc(e,f-P|0);a[s>>0]=16;a[s+1>>0]=16;a[s+2>>0]=16;a[s+3>>0]=0;a:do if(f){P=r+12|0;Q=M<<1^3;L=o+12|0;K=o+24|0;O=p+12|0;R=p+24|0;S=q+12|0;T=q+24|0;U=r+24|0;V=0;W=0;b:while(1){if((c[J>>2]|0)==(c[r>>2]|0)){X=22;break}Y=c[g>>2]|0;while(1){if(Y>>>0>=16){Z=Y;break}_=c[D>>2]|0;if(_>>>0<(c[F>>2]|0)>>>0){c[D>>2]=_+1;$=d[_>>0]|0}else $=0;c[h>>2]=c[h>>2]|$<<Y;Y=Y+8|0;c[g>>2]=Y;if(Y>>>0>=33){X=28;break b}}Y=c[h>>2]|0;_=c[(c[P>>2]|0)+((Y&1023)<<2)>>2]|0;if((_|0)>-1){aa=_>>16;ba=_&65535}else{ca=c[U>>2]|0;da=10;ea=_;while(1){_=da+1|0;fa=b[ca+((Y>>>da&1)+~ea<<1)>>1]|0;ga=fa<<16>>16;if(fa<<16>>16<0){da=_;ea=ga}else{aa=_;ba=ga;break}}}c[h>>2]=Y>>>aa;c[g>>2]=Z-aa;W=ba+W&7;a[(c[e>>2]|0)+(V<<3)+4>>0]=W;ea=0;do{da=s+ea|0;ca=a[da>>0]|0;do if((ca&255)>=10)if((ca&255)<22){if((c[H>>2]|0)==(c[p>>2]|0)){X=50;break b}ga=c[g>>2]|0;while(1){if(ga>>>0>=16){ha=ga;break}_=c[D>>2]|0;if(_>>>0<(c[F>>2]|0)>>>0){c[D>>2]=_+1;ia=d[_>>0]|0}else ia=0;c[h>>2]=c[h>>2]|ia<<ga;ga=ga+8|0;c[g>>2]=ga;if(ga>>>0>=33){X=56;break b}}ga=c[h>>2]|0;_=c[(c[O>>2]|0)+((ga&1023)<<2)>>2]|0;if((_|0)>-1){ja=_>>16;ka=_&65535}else{fa=c[R>>2]|0;la=10;ma=_;while(1){_=la+1|0;na=b[fa+((ga>>>la&1)+~ma<<1)>>1]|0;pa=na<<16>>16;if(na<<16>>16<0){la=_;ma=pa}else{ja=_;ka=pa;break}}}c[h>>2]=ga>>>ja;c[g>>2]=ha-ja;qa=ka;break}else{if((c[I>>2]|0)==(c[q>>2]|0)){X=63;break b}ma=c[g>>2]|0;while(1){if(ma>>>0>=16){ra=ma;break}la=c[D>>2]|0;if(la>>>0<(c[F>>2]|0)>>>0){c[D>>2]=la+1;sa=d[la>>0]|0}else sa=0;c[h>>2]=c[h>>2]|sa<<ma;ma=ma+8|0;c[g>>2]=ma;if(ma>>>0>=33){X=69;break b}}ma=c[h>>2]|0;ga=c[(c[S>>2]|0)+((ma&1023)<<2)>>2]|0;if((ga|0)>-1){ta=ga>>16;ua=ga&65535}else{la=c[T>>2]|0;fa=10;pa=ga;while(1){ga=fa+1|0;_=b[la+((ma>>>fa&1)+~pa<<1)>>1]|0;na=_<<16>>16;if(_<<16>>16<0){fa=ga;pa=na}else{ta=ga;ua=na;break}}}c[h>>2]=ma>>>ta;c[g>>2]=ra-ta;qa=ua;break}else{if((c[G>>2]|0)==(c[o>>2]|0)){X=36;break b}pa=c[g>>2]|0;while(1){if(pa>>>0>=16){va=pa;break}fa=c[D>>2]|0;if(fa>>>0<(c[F>>2]|0)>>>0){c[D>>2]=fa+1;wa=d[fa>>0]|0}else wa=0;c[h>>2]=c[h>>2]|wa<<pa;pa=pa+8|0;c[g>>2]=pa;if(pa>>>0>=33){X=42;break b}}pa=c[h>>2]|0;ma=c[(c[L>>2]|0)+((pa&1023)<<2)>>2]|0;if((ma|0)>-1){xa=ma>>16;ya=ma&65535}else{fa=c[K>>2]|0;la=10;na=ma;while(1){ma=la+1|0;ga=b[fa+((pa>>>la&1)+~na<<1)>>1]|0;_=ga<<16>>16;if(ga<<16>>16<0){la=ma;na=_}else{xa=ma;ya=_;break}}}c[h>>2]=pa>>>xa;c[g>>2]=va-xa;qa=ya}while(0);na=(ca&255)+qa&31;a[(c[e>>2]|0)+(V<<3)+ea>>0]=na;a[da>>0]=na;ea=ea+1|0}while(ea>>>0<Q>>>0);if(!N){ea=(c[e>>2]|0)+(V<<3)|0;a[ea+1>>0]=a[ea>>0]|0;ea=(c[e>>2]|0)+(V<<3)|0;a[ea+2>>0]=a[ea>>0]|0}V=V+1|0;if(V>>>0>=f>>>0)break a}if((X|0)==22)oa(499337,499239,445,499360);else if((X|0)==28)oa(499316,499239,457,499360);else if((X|0)==36)oa(499337,499239,445,499360);else if((X|0)==42)oa(499316,499239,457,499360);else if((X|0)==50)oa(499337,499239,445,499360);else if((X|0)==56)oa(499316,499239,457,499360);else if((X|0)==63)oa(499337,499239,445,499360);else if((X|0)==69)oa(499316,499239,457,499360)}while(0);f=e+12|0;N=e+16|0;qa=c[N>>2]|0;ya=c[f>>2]|0;xa=(qa-ya|0)/11|0;if(xa>>>0>=j>>>0){if(xa>>>0>j>>>0?(va=ya+(j*11|0)|0,(qa|0)!=(va|0)):0)c[N>>2]=qa+(~(((0-va+(qa+-11)|0)>>>0)/11|0)*11|0)}else qc(f,j-xa|0);if(!((k|0)==0&(l|0)!=0)){c[n>>2]=l;c[D>>2]=k;c[E>>2]=k;E=k+l|0;c[F>>2]=E;c[h>>2]=0;c[g>>2]=0;B=t;C=B+36|0;do{c[B>>2]=0;B=B+4|0}while((B|0)<(C|0));if((l|0)>0){l=k+1|0;c[D>>2]=l;za=l;Aa=d[k>>0]|0}else{za=k;Aa=0}c[h>>2]=Aa;c[g>>2]=8;k=Aa>>>1;c[h>>2]=k;c[g>>2]=7;c:do if(!(Aa&1)){l=Aa>>>2;c[h>>2]=l;c[g>>2]=6;if(!(k&1)){c[h>>2]=Aa>>>3;c[g>>2]=5;if(l&1){if(!j){X=284;break}else Ba=0;d:while(1){xa=0;do{qa=c[g>>2]|0;while(1){if(qa>>>0>=8){Ca=qa;break}va=c[D>>2]|0;if(va>>>0<(c[F>>2]|0)>>>0){c[D>>2]=va+1;Da=d[va>>0]|0}else Da=0;c[h>>2]=c[h>>2]|Da<<qa;qa=qa+8|0;c[g>>2]=qa;if(qa>>>0>=33){X=239;break d}}qa=c[h>>2]|0;da=qa&255;c[h>>2]=qa>>>8;c[g>>2]=Ca+-8;qa=0;do{ca=c[f>>2]|0;va=qa<<1;N=da>>>va&3;if((qa|xa)>>>0>=4){X=242;break d}ya=ca+(Ba*11|0)+xa|0;a[ya>>0]=(d[ya>>0]|0)&(3<<va^255)|N<<va;va=(qa<<2)+xa|0;ya=3-(va>>>3)|0;wa=ca+(Ba*11|0)+4+ya|0;G=va&7;va=d[490805+N>>0]|0;N=~(1<<G);a[wa>>0]=(d[wa>>0]|0)&N|(va&1)<<G;wa=ya+-2+(ca+(Ba*11|0)+4)|0;a[wa>>0]=(d[wa>>0]|0)&N|va>>>1<<G;qa=qa+1|0}while(qa>>>0<4);xa=xa+1|0}while(xa>>>0<4);ib((c[f>>2]|0)+(Ba*11|0)|0);Ba=Ba+1|0;if(Ba>>>0>=j>>>0){X=284;break c}}if((X|0)==239)oa(499316,499239,332,499306);else if((X|0)==242)oa(499528,499239,748,499546)}if(!(gb(n,t)|0)){Ea=0;break}if(j>>>0<=1){c[A>>2]=0;if(!j){X=284;break}}else{if((c[t+4>>2]|0)==(c[t>>2]|0)){Ea=0;break}c[A>>2]=0}xa=t+4|0;qa=t+12|0;da=t+24|0;G=0;e:while(1){if(!G){va=0;do{N=c[g>>2]|0;while(1){if(N>>>0>=8){Fa=N;break}wa=c[D>>2]|0;if(wa>>>0<(c[F>>2]|0)>>>0){c[D>>2]=wa+1;Ga=d[wa>>0]|0}else Ga=0;c[h>>2]=c[h>>2]|Ga<<N;N=N+8|0;c[g>>2]=N;if(N>>>0>=33){X=258;break e}}N=c[h>>2]|0;wa=N&255;c[h>>2]=N>>>8;c[g>>2]=Fa+-8;a[A+va>>0]=N;N=0;do{ca=c[f>>2]|0;ya=N<<1;ua=wa>>>ya&3;if((N|va)>>>0>=4){X=261;break e}ta=ca+va|0;a[ta>>0]=(d[ta>>0]|0)&(3<<ya^255)|ua<<ya;ya=(N<<2)+va|0;ta=3-(ya>>>3)|0;ra=ca+4+ta|0;sa=ya&7;ya=d[490805+ua>>0]|0;ua=~(1<<sa);a[ra>>0]=(d[ra>>0]|0)&ua|(ya&1)<<sa;ra=ta+-2+(ca+4)|0;a[ra>>0]=(d[ra>>0]|0)&ua|ya>>>1<<sa;N=N+1|0}while(N>>>0<4);va=va+1|0}while(va>>>0<4);ib(c[f>>2]|0)}else{va=0;do{if((c[xa>>2]|0)==(c[t>>2]|0)){X=266;break e}N=c[g>>2]|0;while(1){if(N>>>0>=16){Ha=N;break}wa=c[D>>2]|0;if(wa>>>0<(c[F>>2]|0)>>>0){c[D>>2]=wa+1;Ia=d[wa>>0]|0}else Ia=0;c[h>>2]=c[h>>2]|Ia<<N;N=N+8|0;c[g>>2]=N;if(N>>>0>=33){X=272;break e}}N=c[h>>2]|0;wa=c[(c[qa>>2]|0)+((N&1023)<<2)>>2]|0;if((wa|0)>-1){Ja=wa>>16;Ka=wa&65535}else{sa=c[da>>2]|0;ya=10;ua=wa;while(1){wa=ya+1|0;ra=b[sa+((N>>>ya&1)+~ua<<1)>>1]|0;ca=ra<<16>>16;if(ra<<16>>16<0){ya=wa;ua=ca}else{Ja=wa;Ka=ca;break}}}c[h>>2]=N>>>Ja;c[g>>2]=Ha-Ja;ua=A+va|0;ya=(d[ua>>0]|0)^Ka;a[ua>>0]=ya;ua=0;do{sa=c[f>>2]|0;ca=ua<<1;wa=ya>>>ca&3;if((ua|va)>>>0>=4){X=279;break e}ra=sa+(G*11|0)+va|0;a[ra>>0]=(d[ra>>0]|0)&(3<<ca^255)|wa<<ca;ca=(ua<<2)+va|0;ra=3-(ca>>>3)|0;ta=sa+(G*11|0)+4+ra|0;I=ca&7;ca=d[490805+wa>>0]|0;wa=~(1<<I);a[ta>>0]=(d[ta>>0]|0)&wa|(ca&1)<<I;ta=ra+-2+(sa+(G*11|0)+4)|0;a[ta>>0]=(d[ta>>0]|0)&wa|ca>>>1<<I;ua=ua+1|0}while(ua>>>0<4);va=va+1|0}while(va>>>0<4);ib((c[f>>2]|0)+(G*11|0)|0)}G=G+1|0;if(G>>>0>=j>>>0){X=284;break c}}if((X|0)==258)oa(499316,499239,332,499306);else if((X|0)==261)oa(499528,499239,748,499546);else if((X|0)==266)oa(499337,499239,445,499360);else if((X|0)==272)oa(499316,499239,457,499360);else if((X|0)==279)oa(499528,499239,748,499546)}G=l&15;da=l>>>4;c[h>>2]=da;qa=6+-4|0;c[g>>2]=qa;xa=qa;qa=za;va=da;while(1){if(xa>>>0>=4){La=va;Ma=xa;break}if(qa>>>0<E>>>0){da=qa+1|0;c[D>>2]=da;Na=da;Oa=d[qa>>0]|0}else{Na=qa;Oa=0}va=va|Oa<<xa;c[h>>2]=va;xa=xa+8|0;c[g>>2]=xa;if(xa>>>0>=33){X=145;break}else qa=Na}if((X|0)==145)oa(499316,499239,332,499306);qa=La&15;c[h>>2]=La>>>4;c[g>>2]=Ma+-4;B=u;C=B+36|0;do{c[B>>2]=0;B=B+4|0}while((B|0)<(C|0));do if(gb(n,u)|0){xa=u+4|0;if((c[xa>>2]|0)==(c[u>>2]|0)){Pa=1;break}B=x;C=B+36|0;do{c[B>>2]=0;B=B+4|0}while((B|0)<(C|0));va=(qa|0)!=0;do if(va){if(!(gb(n,x)|0)){Qa=1;break}if((c[x+4>>2]|0)==(c[x>>2]|0))Qa=1;else X=151}else X=151;while(0);f:do if((X|0)==151){if(!j){Qa=0;break}l=u+12|0;da=u+24|0;ua=(G|0)==0;ya=x+4|0;N=x+12|0;I=x+24|0;ca=e+24|0;wa=z+12|0;ta=z+6|0;sa=z+5|0;ra=z+4|0;ka=z+2|0;ja=z+3|0;ha=z+1|0;ia=z+7|0;H=z+8|0;s=z+9|0;ba=z+10|0;aa=z+11|0;Z=0;$=0;J=0;g:while(1){if(!J){if((c[xa>>2]|0)==(c[u>>2]|0)){X=155;break}M=c[g>>2]|0;while(1){if(M>>>0>=16){Ra=M;break}V=c[D>>2]|0;if(V>>>0<(c[F>>2]|0)>>>0){c[D>>2]=V+1;Sa=d[V>>0]|0}else Sa=0;c[h>>2]=c[h>>2]|Sa<<M;M=M+8|0;c[g>>2]=M;if(M>>>0>=33){X=161;break g}}M=c[h>>2]|0;pa=c[(c[l>>2]|0)+((M&1023)<<2)>>2]|0;if((pa|0)>-1){Ta=pa>>16;Ua=pa&65535}else{V=c[da>>2]|0;Q=10;K=pa;while(1){pa=Q+1|0;L=b[V+((M>>>Q&1)+~K<<1)>>1]|0;T=L<<16>>16;if(L<<16>>16<0){Q=pa;K=T}else{Ta=pa;Ua=T;break}}}c[h>>2]=M>>>Ta;c[g>>2]=Ra-Ta;Va=Ua;Wa=8}else{Va=Z;Wa=J}J=Wa+-1|0;Z=Va>>>1;if(!(Va&1)){K=0;do{Q=c[g>>2]|0;while(1){if(Q>>>0>=8){Xa=Q;break}V=c[D>>2]|0;if(V>>>0<(c[F>>2]|0)>>>0){c[D>>2]=V+1;Ya=d[V>>0]|0}else Ya=0;c[h>>2]=c[h>>2]|Ya<<Q;Q=Q+8|0;c[g>>2]=Q;if(Q>>>0>=33){X=198;break g}}Q=c[h>>2]|0;V=Q&255;c[h>>2]=Q>>>8;c[g>>2]=Xa+-8;Q=0;do{T=c[f>>2]|0;pa=Q<<1;L=V>>>pa&3;if((Q|K)>>>0>=4){X=201;break g}S=T+($*11|0)+K|0;a[S>>0]=(d[S>>0]|0)&(3<<pa^255)|L<<pa;pa=(Q<<2)+K|0;S=3-(pa>>>3)|0;R=T+($*11|0)+4+S|0;O=pa&7;pa=d[490805+L>>0]|0;L=~(1<<O);a[R>>0]=(d[R>>0]|0)&L|(pa&1)<<O;R=S+-2+(T+($*11|0)+4)|0;a[R>>0]=(d[R>>0]|0)&L|pa>>>1<<O;Q=Q+1|0}while(Q>>>0<4);K=K+1|0}while(K>>>0<4)}else{if(ua)Za=0;else Za=hb(n,G)|0;if(va){if((c[ya>>2]|0)==(c[x>>2]|0)){X=172;break}K=c[g>>2]|0;while(1){if(K>>>0>=16){_a=K;break}M=c[D>>2]|0;if(M>>>0<(c[F>>2]|0)>>>0){c[D>>2]=M+1;$a=d[M>>0]|0}else $a=0;c[h>>2]=c[h>>2]|$a<<K;K=K+8|0;c[g>>2]=K;if(K>>>0>=33){X=178;break g}}K=c[h>>2]|0;M=c[(c[N>>2]|0)+((K&1023)<<2)>>2]|0;if((M|0)>-1){ab=M>>16;bb=M&65535}else{Q=c[I>>2]|0;V=10;O=M;while(1){M=V+1|0;pa=b[Q+((K>>>V&1)+~O<<1)>>1]|0;L=pa<<16>>16;if(pa<<16>>16<0){V=M;O=L}else{ab=M;bb=L;break}}}c[h>>2]=K>>>ab;c[g>>2]=_a-ab;cb=bb}else cb=0;O=c[ca>>2]|0;V=c[O>>2]|0;if(Za>>>0>=(c[O+4>>2]|0)-V>>4>>>0){Qa=1;break f}if(cb>>>0>=32768){X=186;break}a[wa>>0]=cb&3;a[ta>>0]=cb>>>2&1;a[sa>>0]=cb>>>3&1;a[z>>0]=cb>>>4&3;a[ra>>0]=cb>>>6&1;a[ka>>0]=cb>>>7&1;a[ja>>0]=cb>>>8&1;a[ha>>0]=cb>>>9&1;a[ia>>0]=cb>>>10&1;a[H>>0]=cb>>>11&1;a[s>>0]=cb>>>12&1;a[ba>>0]=cb>>>13&1;a[aa>>0]=cb>>>14&1;ec(y,V+(Za<<4)|0,z);V=0;do{O=V<<2;Q=0;do{L=c[f>>2]|0;M=d[y+(Q+O)>>0]|0;if((Q|V|M)>>>0>=4){X=190;break g}pa=Q<<1;R=L+($*11|0)+V|0;a[R>>0]=(d[R>>0]|0)&(3<<pa^255)|M<<pa;pa=(Q<<2)+V|0;R=3-(pa>>>3)|0;T=L+($*11|0)+4+R|0;S=pa&7;pa=d[490805+M>>0]|0;M=~(1<<S);a[T>>0]=(d[T>>0]|0)&M|(pa&1)<<S;T=R+-2+(L+($*11|0)+4)|0;a[T>>0]=(d[T>>0]|0)&M|pa>>>1<<S;Q=Q+1|0}while(Q>>>0<4);V=V+1|0}while(V>>>0<4)}ib((c[f>>2]|0)+($*11|0)|0);$=$+1|0;if($>>>0>=j>>>0){Qa=0;break f}}if((X|0)==155)oa(499337,499239,445,499360);else if((X|0)==161)oa(499316,499239,457,499360);else if((X|0)==172)oa(499337,499239,445,499360);else if((X|0)==178)oa(499316,499239,457,499360);else if((X|0)==186)oa(499497,491220,48,499518);else if((X|0)==190)oa(499528,499239,748,499546);else if((X|0)==198)oa(499316,499239,332,499306);else if((X|0)==201)oa(499528,499239,748,499546)}while(0);va=c[x+24>>2]|0;xa=va;if(va){$=x+28|0;aa=c[$>>2]|0;if((aa|0)!=(va|0))c[$>>2]=aa+(~((aa+-2-xa|0)>>>1)<<1);Kc(va)}va=c[x+12>>2]|0;xa=va;if(va){aa=x+16|0;$=c[aa>>2]|0;if(($|0)!=(va|0))c[aa>>2]=$+(~(($+-4-xa|0)>>>2)<<2);Kc(va)}va=c[x>>2]|0;if(va){xa=x+4|0;if((c[xa>>2]|0)!=(va|0))c[xa>>2]=va;Kc(va)}Pa=Qa}else Pa=1;while(0);G=c[u+24>>2]|0;qa=G;if(G){va=u+28|0;xa=c[va>>2]|0;if((xa|0)!=(G|0))c[va>>2]=xa+(~((xa+-2-qa|0)>>>1)<<1);Kc(G)}G=c[u+12>>2]|0;qa=G;if(G){xa=u+16|0;va=c[xa>>2]|0;if((va|0)!=(G|0))c[xa>>2]=va+(~((va+-4-qa|0)>>>2)<<2);Kc(G)}G=c[u>>2]|0;if(G){qa=u+4|0;if((c[qa>>2]|0)!=(G|0))c[qa>>2]=G;Kc(G)}if(!Pa)X=284;else Ea=0}else{G=k&15;qa=k>>>4;c[h>>2]=qa;va=7+-4|0;c[g>>2]=va;xa=va;va=za;$=qa;while(1){if(xa>>>0>=4){db=$;eb=xa;break}if(va>>>0<E>>>0){qa=va+1|0;c[D>>2]=qa;fb=qa;jb=d[va>>0]|0}else{fb=va;jb=0}$=$|jb<<xa;c[h>>2]=$;xa=xa+8|0;c[g>>2]=xa;if(xa>>>0>=33){X=93;break}else va=fb}if((X|0)==93)oa(499316,499239,332,499306);va=db&15;c[h>>2]=db>>>4;c[g>>2]=eb+-4;B=u;C=B+36|0;do{c[B>>2]=0;B=B+4|0}while((B|0)<(C|0));xa=(va|0)!=0;do if(xa){if(!(gb(n,u)|0)){$=c[u+24>>2]|0;qa=$;if($){aa=u+28|0;ba=c[aa>>2]|0;if((ba|0)!=($|0))c[aa>>2]=ba+(~((ba+-2-qa|0)>>>1)<<1);Kc($)}$=c[u+12>>2]|0;qa=$;if($){ba=u+16|0;aa=c[ba>>2]|0;if((aa|0)!=($|0))c[ba>>2]=aa+(~((aa+-4-qa|0)>>>2)<<2);Kc($)}$=c[u>>2]|0;if($){qa=u+4|0;if((c[qa>>2]|0)!=($|0))c[qa>>2]=$;Kc($)}Ea=0;break c}$=u+4|0;if((c[$>>2]|0)!=(c[u>>2]|0))break;qa=c[u+24>>2]|0;aa=qa;if(qa){ba=u+28|0;s=c[ba>>2]|0;if((s|0)!=(qa|0))c[ba>>2]=s+(~((s+-2-aa|0)>>>1)<<1);Kc(qa)}qa=c[u+12>>2]|0;aa=qa;if(qa){s=u+16|0;ba=c[s>>2]|0;if((ba|0)!=(qa|0))c[s>>2]=ba+(~((ba+-4-aa|0)>>>2)<<2);Kc(qa)}qa=c[u>>2]|0;if(qa){if((c[$>>2]|0)!=(qa|0))c[$>>2]=qa;Kc(qa)}Ea=0;break c}while(0);h:do if(j){va=(G|0)==0;qa=u+4|0;$=u+12|0;aa=u+24|0;ba=e+24|0;s=w+12|0;H=w+6|0;ia=w+5|0;ha=w+4|0;ja=w+2|0;ka=w+3|0;ra=w+1|0;sa=w+7|0;ta=w+8|0;wa=w+9|0;ca=w+10|0;I=w+11|0;N=0;i:while(1){if(va)kb=0;else kb=hb(n,G)|0;if(xa){if((c[qa>>2]|0)==(c[u>>2]|0)){X=104;break}ya=c[g>>2]|0;while(1){if(ya>>>0>=16){lb=ya;break}ua=c[D>>2]|0;if(ua>>>0<(c[F>>2]|0)>>>0){c[D>>2]=ua+1;mb=d[ua>>0]|0}else mb=0;c[h>>2]=c[h>>2]|mb<<ya;ya=ya+8|0;c[g>>2]=ya;if(ya>>>0>=33){X=110;break i}}ya=c[h>>2]|0;ua=c[(c[$>>2]|0)+((ya&1023)<<2)>>2]|0;if((ua|0)>-1){nb=ua>>16;ob=ua&65535}else{Z=c[aa>>2]|0;J=10;da=ua;while(1){ua=J+1|0;l=b[Z+((ya>>>J&1)+~da<<1)>>1]|0;V=l<<16>>16;if(l<<16>>16<0){J=ua;da=V}else{nb=ua;ob=V;break}}}c[h>>2]=ya>>>nb;c[g>>2]=lb-nb;pb=ob}else pb=0;da=c[ba>>2]|0;J=c[da>>2]|0;if(kb>>>0>=(c[da+4>>2]|0)-J>>4>>>0){X=311;break}if(pb>>>0>=32768){X=118;break}a[s>>0]=pb&3;a[H>>0]=pb>>>2&1;a[ia>>0]=pb>>>3&1;a[w>>0]=pb>>>4&3;a[ha>>0]=pb>>>6&1;a[ja>>0]=pb>>>7&1;a[ka>>0]=pb>>>8&1;a[ra>>0]=pb>>>9&1;a[sa>>0]=pb>>>10&1;a[ta>>0]=pb>>>11&1;a[wa>>0]=pb>>>12&1;a[ca>>0]=pb>>>13&1;a[I>>0]=pb>>>14&1;ec(v,J+(kb<<4)|0,w);J=0;do{da=J<<2;Z=0;do{V=c[f>>2]|0;ua=d[v+(Z+da)>>0]|0;if((Z|J|ua)>>>0>=4){X=122;break i}l=Z<<1;K=V+(N*11|0)+J|0;a[K>>0]=(d[K>>0]|0)&(3<<l^255)|ua<<l;l=(Z<<2)+J|0;K=3-(l>>>3)|0;Q=V+(N*11|0)+4+K|0;O=l&7;l=d[490805+ua>>0]|0;ua=~(1<<O);a[Q>>0]=(d[Q>>0]|0)&ua|(l&1)<<O;Q=K+-2+(V+(N*11|0)+4)|0;a[Q>>0]=(d[Q>>0]|0)&ua|l>>>1<<O;Z=Z+1|0}while(Z>>>0<4);J=J+1|0}while(J>>>0<4);ib((c[f>>2]|0)+(N*11|0)|0);N=N+1|0;if(N>>>0>=j>>>0){qb=aa;break h}}if((X|0)==104)oa(499337,499239,445,499360);else if((X|0)==110)oa(499316,499239,457,499360);else if((X|0)==118)oa(499497,491220,48,499518);else if((X|0)==122)oa(499528,499239,748,499546);else if((X|0)==311){N=c[aa>>2]|0;I=N;if(N){ca=u+28|0;wa=c[ca>>2]|0;if((wa|0)!=(N|0))c[ca>>2]=wa+(~((wa+-2-I|0)>>>1)<<1);Kc(N)}N=c[$>>2]|0;I=N;if(N){wa=u+16|0;ca=c[wa>>2]|0;if((ca|0)!=(N|0))c[wa>>2]=ca+(~((ca+-4-I|0)>>>2)<<2);Kc(N)}N=c[u>>2]|0;if(N){if((c[qa>>2]|0)!=(N|0))c[qa>>2]=N;Kc(N)}Ea=0;break c}}else qb=u+24|0;while(0);xa=c[qb>>2]|0;G=xa;if(xa){N=u+28|0;I=c[N>>2]|0;if((I|0)!=(xa|0))c[N>>2]=I+(~((I+-2-G|0)>>>1)<<1);Kc(xa)}xa=c[u+12>>2]|0;G=xa;if(xa){I=u+16|0;N=c[I>>2]|0;if((N|0)!=(xa|0))c[I>>2]=N+(~((N+-4-G|0)>>>2)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1;q=d[p>>0]|0}else q=0;c[n>>2]=c[n>>2]|q<<e;e=e+8|0;c[k>>2]=e;if(e>>>0>=33){r=12;break}}if((r|0)==12)oa(499316,499239,332,499306);e=c[n>>2]|0;q=e&16383;p=e>>>14;c[n>>2]=p;s=o+-14|0;c[k>>2]=s;if(!q){t=1;i=g;return t|0}o=h;u=o+21|0;do{a[o>>0]=0;o=o+1|0}while((o|0)<(u|0));v=s;s=p;while(1){if(v>>>0>=5){w=s;x=v;break}p=c[l>>2]|0;if(p>>>0<(c[m>>2]|0)>>>0){c[l>>2]=p+1;y=d[p>>0]|0}else y=0;s=s|y<<v;c[n>>2]=s;v=v+8|0;c[k>>2]=v;if(v>>>0>=33){r=19;break}}if((r|0)==19)oa(499316,499239,332,499306);v=w&31;s=w>>>5;c[n>>2]=s;w=x+-5|0;c[k>>2]=w;if((v+-1|0)>>>0>20){t=0;i=g;return t|0}a:do if(v){x=w;y=s;p=0;b:while(1){z=x;A=y;while(1){if(z>>>0>=3){B=A;C=z;break}D=c[l>>2]|0;if(D>>>0<(c[m>>2]|0)>>>0){c[l>>2]=D+1;E=d[D>>0]|0}else E=0;A=A|E<<z;c[n>>2]=A;z=z+8|0;c[k>>2]=z;if(z>>>0>=33)break b}y=B>>>3;c[n>>2]=y;x=C+-3|0;c[k>>2]=x;a[h+(d[499203+p>>0]|0)>>0]=B&7;p=p+1|0;if(p>>>0>=v>>>0)break a}oa(499316,499239,332,499306)}while(0);o=j;u=o+36|0;do{c[o>>2]=0;o=o+4|0}while((o|0)<(u|0));if(ac(j,21,h,10)|0?(c[j+4>>2]|0)!=(c[j>>2]|0):0){h=Jc(q)|0;Fd(h|0,0,e&16383|0)|0;e=j+12|0;o=j+24|0;u=0;c:while(1){v=c[k>>2]|0;while(1){if(v>>>0>=16){F=v;break}B=c[l>>2]|0;if(B>>>0<(c[m>>2]|0)>>>0){c[l>>2]=B+1;G=d[B>>0]|0}else G=0;c[n>>2]=c[n>>2]|G<<v;v=v+8|0;c[k>>2]=v;if(v>>>0>=33){r=37;break c}}v=c[n>>2]|0;B=c[(c[e>>2]|0)+((v&1023)<<2)>>2]|0;if((B|0)>-1){H=B>>16;I=B&65535}else{C=c[o>>2]|0;E=10;s=B;while(1){B=E+1|0;w=b[C+((v>>>E&1)+~s<<1)>>1]|0;p=w<<16>>16;if(w<<16>>16<0){E=B;s=p}else{H=B;I=p;break}}}s=v>>>H;c[n>>2]=s;E=F-H|0;c[k>>2]=E;d:do if((I|0)<17){a[h+u>>0]=I;J=u+1|0}else switch(I|0){case 17:{C=E;p=s;while(1){if(C>>>0>=3){K=p;L=C;break}B=c[l>>2]|0;if(B>>>0<(c[m>>2]|0)>>>0){c[l>>2]=B+1;M=d[B>>0]|0}else M=0;p=p|M<<C;c[n>>2]=p;C=C+8|0;c[k>>2]=C;if(C>>>0>=33){r=49;break c}}c[n>>2]=K>>>3;c[k>>2]=L+-3;J=u+3+(K&7)|0;break d;break}case 18:{C=E;p=s;while(1){if(C>>>0>=7){N=p;O=C;break}B=c[l>>2]|0;if(B>>>0<(c[m>>2]|0)>>>0){c[l>>2]=B+1;P=d[B>>0]|0}else P=0;p=p|P<<C;c[n>>2]=p;C=C+8|0;c[k>>2]=C;if(C>>>0>=33){r=56;break c}}c[n>>2]=N>>>7;c[k>>2]=O+-7;J=u+11+(N&127)|0;break d;break}default:{if(!u){Q=0;break c}if((I|0)==19){C=E;p=s;while(1){if(C>>>0>=2){R=p;S=C;break}B=c[l>>2]|0;if(B>>>0<(c[m>>2]|0)>>>0){c[l>>2]=B+1;T=d[B>>0]|0}else T=0;p=p|T<<C;c[n>>2]=p;C=C+8|0;c[k>>2]=C;if(C>>>0>=33){r=64;break c}}c[n>>2]=R>>>2;c[k>>2]=S+-2;U=(R&3)+3|0}else{C=E;p=s;while(1){if(C>>>0>=7){V=p;W=C;break}B=c[l>>2]|0;if(B>>>0<(c[m>>2]|0)>>>0){c[l>>2]=B+1;X=d[B>>0]|0}else X=0;p=p|X<<C;c[n>>2]=p;C=C+8|0;c[k>>2]=C;if(C>>>0>=33){r=70;break c}}c[n>>2]=V>>>7;c[k>>2]=W+-7;U=(V&127)+7|0}C=a[h+(u+-1)>>0]|0;if(!(C<<24>>24)){Q=0;break c}else{Y=u;Z=U}while(1){if(Y>>>0>=q>>>0){Q=0;break c}p=Y+1|0;a[h+Y>>0]=C;Z=Z+-1|0;if(!Z){J=p;break}else Y=p}}}while(0);if(J>>>0<q>>>0)u=J;else{_=J;r=75;break}}if((r|0)==37)oa(499316,499239,457,499360);else if((r|0)==49)oa(499316,499239,332,499306);else if((r|0)==56)oa(499316,499239,332,499306);else if((r|0)==64)oa(499316,499239,332,499306);else if((r|0)==70)oa(499316,499239,332,499306);else if((r|0)==75)if((_|0)==(q|0))Q=ac(f,q,h,10)|0;else Q=0;Kc(h);$=Q}else $=0;Q=c[j+24>>2]|0;h=Q;if(Q){q=j+28|0;f=c[q>>2]|0;if((f|0)!=(Q|0))c[q>>2]=f+(~((f+-2-h|0)>>>1)<<1);Kc(Q)}Q=c[j+12>>2]|0;h=Q;if(Q){f=j+16|0;q=c[f>>2]|0;if((q|0)!=(Q|0))c[f>>2]=q+(~((q+-4-h|0)>>>2)<<2);Kc(Q)}Q=c[j>>2]|0;if(Q){h=j+4|0;if((c[h>>2]|0)!=(Q|0))c[h>>2]=Q;Kc(Q)}t=$;i=g;return t|0}function hb(a,b){a=a|0;b=b|0;var 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,A=0,B=0,C=0;if(b>>>0<=25){do if(b){e=a+20|0;f=a+4|0;g=a+12|0;h=a+16|0;i=c[e>>2]|0;while(1){if(i>>>0>=b>>>0){j=i;k=28;break}l=c[f>>2]|0;if(l>>>0<(c[g>>2]|0)>>>0){c[f>>2]=l+1;m=d[l>>0]|0}else m=0;c[h>>2]=c[h>>2]|m<<i;i=i+8|0;c[e>>2]=i;if(i>>>0>=33){k=27;break}}if((k|0)==27)oa(499316,499239,332,499306);else if((k|0)==28){i=c[h>>2]|0;n=i&(1<<b)+-1;o=e;p=h;q=i;r=j;break}}else{i=a+16|0;f=a+20|0;n=0;o=f;p=i;q=c[i>>2]|0;r=c[f>>2]|0}while(0);c[p>>2]=q>>>b;c[o>>2]=r-b;s=n;return s|0}if(b>>>0>=33)oa(499224,499239,350,499282);n=a+20|0;r=a+4|0;o=a+12|0;q=a+16|0;a=c[n>>2]|0;while(1){if(a>>>0>=25){t=a;break}p=c[r>>2]|0;if(p>>>0<(c[o>>2]|0)>>>0){c[r>>2]=p+1;u=d[p>>0]|0}else u=0;c[q>>2]=c[q>>2]|u<<a;a=a+8|0;c[n>>2]=a;if(a>>>0>=33){k=9;break}}if((k|0)==9)oa(499316,499239,332,499306);a=c[q>>2]|0;u=a&33554431;p=a>>>25;c[q>>2]=p;a=t+-25|0;c[n>>2]=a;t=b+-25|0;do if(t){if(t>>>0<26){v=a;w=p}else oa(499291,499239,322,499306);while(1){if(v>>>0>=t>>>0){x=w;y=v;k=18;break}b=c[r>>2]|0;if(b>>>0<(c[o>>2]|0)>>>0){c[r>>2]=b+1;z=d[b>>0]|0}else z=0;w=w|z<<v;c[q>>2]=w;v=v+8|0;c[n>>2]=v;if(v>>>0>=33){k=17;break}}if((k|0)==17)oa(499316,499239,332,499306);else if((k|0)==18){A=(x&(1<<t)+127)<<25;B=x;C=y;break}}else{A=0;B=p;C=a}while(0);c[q>>2]=B>>>t;c[n>>2]=C-t;s=A|u;return s|0}function ib(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;e=i;i=i+16|0;f=e;c[f>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;g=d[b>>0]|0;h=f+((g&3)<<2)|0;c[h>>2]=(c[h>>2]|0)+1;h=f+((g>>>2&3)<<2)|0;c[h>>2]=(c[h>>2]|0)+1;h=f+((g>>>4&3)<<2)|0;c[h>>2]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>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;c[g+20>>2]=0;if((b|0)==0&(e|0)!=0){h=0;i=f;return h|0}c[g>>2]=e;j=g+4|0;c[j>>2]=b;c[g+8>>2]=b;k=g+12|0;c[k>>2]=b+e;e=g+16|0;c[e>>2]=0;b=g+20|0;c[b>>2]=0;l=a+28|0;if(!(gb(g,l)|0)){h=0;i=f;return h|0}if((c[a+32>>2]|0)==(c[l>>2]|0)){h=0;i=f;return h|0}l=a+64|0;if(!(gb(g,l)|0)){h=0;i=f;return h|0}if((c[a+68>>2]|0)==(c[l>>2]|0)){h=0;i=f;return h|0}l=a+100|0;if(!(gb(g,l)|0)){h=0;i=f;return h|0}if((c[a+104>>2]|0)==(c[l>>2]|0)){h=0;i=f;return h|0}l=a+136|0;if(!(gb(g,l)|0)){h=0;i=f;return h|0}if((c[a+140>>2]|0)==(c[l>>2]|0)){h=0;i=f;return h|0}l=c[b>>2]|0;while(1){if(l>>>0>=13){m=l;break}g=c[j>>2]|0;if(g>>>0<(c[k>>2]|0)>>>0){c[j>>2]=g+1;n=d[g>>0]|0}else n=0;c[e>>2]=c[e>>2]|n<<l;l=l+8|0;c[b>>2]=l;if(l>>>0>=33){o=15;break}}if((o|0)==15)oa(499316,499239,332,499306);o=c[e>>2]|0;c[e>>2]=o>>>13;c[b>>2]=m+-13;c[a+172>>2]=o&8191;h=1;i=f;return h|0}
-function rd(a){a=a|0;var b=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,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;if(!a)return;b=a+-8|0;d=c[4693]|0;if(b>>>0<d>>>0)Ea();e=c[a+-4>>2]|0;f=e&3;if((f|0)==1)Ea();g=e&-8;h=a+(g+-8)|0;do if(!(e&1)){i=c[b>>2]|0;if(!f)return;j=-8-i|0;k=a+j|0;l=i+g|0;if(k>>>0<d>>>0)Ea();if((k|0)==(c[4694]|0)){m=a+(g+-4)|0;n=c[m>>2]|0;if((n&3|0)!=3){o=k;p=l;break}c[4691]=l;c[m>>2]=n&-2;c[a+(j+4)>>2]=l|1;c[h>>2]=l;return}n=i>>>3;if(i>>>0<256){i=c[a+(j+8)>>2]|0;m=c[a+(j+12)>>2]|0;q=18796+(n<<1<<2)|0;if((i|0)!=(q|0)){if(i>>>0<d>>>0)Ea();if((c[i+12>>2]|0)!=(k|0))Ea()}if((m|0)==(i|0)){c[4689]=c[4689]&~(1<<n);o=k;p=l;break}if((m|0)!=(q|0)){if(m>>>0<d>>>0)Ea();q=m+8|0;if((c[q>>2]|0)==(k|0))r=q;else Ea()}else r=m+8|0;c[i+12>>2]=m;c[r>>2]=i;o=k;p=l;break}i=c[a+(j+24)>>2]|0;m=c[a+(j+12)>>2]|0;do if((m|0)==(k|0)){q=a+(j+20)|0;n=c[q>>2]|0;if(!n){s=a+(j+16)|0;t=c[s>>2]|0;if(!t){u=0;break}else{v=t;w=s}}else{v=n;w=q}while(1){q=v+20|0;n=c[q>>2]|0;if(n){v=n;w=q;continue}q=v+16|0;n=c[q>>2]|0;if(!n){x=v;y=w;break}else{v=n;w=q}}if(y>>>0<d>>>0)Ea();else{c[y>>2]=0;u=x;break}}else{q=c[a+(j+8)>>2]|0;if(q>>>0<d>>>0)Ea();n=q+12|0;if((c[n>>2]|0)!=(k|0))Ea();s=m+8|0;if((c[s>>2]|0)==(k|0)){c[n>>2]=m;c[s>>2]=q;u=m;break}else Ea()}while(0);if(i){m=c[a+(j+28)>>2]|0;q=19060+(m<<2)|0;if((k|0)==(c[q>>2]|0)){c[q>>2]=u;if(!u){c[4690]=c[4690]&~(1<<m);o=k;p=l;break}}else{if(i>>>0<(c[4693]|0)>>>0)Ea();m=i+16|0;if((c[m>>2]|0)==(k|0))c[m>>2]=u;else c[i+20>>2]=u;if(!u){o=k;p=l;break}}m=c[4693]|0;if(u>>>0<m>>>0)Ea();c[u+24>>2]=i;q=c[a+(j+16)>>2]|0;do if(q)if(q>>>0<m>>>0)Ea();else{c[u+16>>2]=q;c[q+24>>2]=u;break}while(0);q=c[a+(j+20)>>2]|0;if(q)if(q>>>0<(c[4693]|0)>>>0)Ea();else{c[u+20>>2]=q;c[q+24>>2]=u;o=k;p=l;break}else{o=k;p=l}}else{o=k;p=l}}else{o=b;p=g}while(0);if(o>>>0>=h>>>0)Ea();b=a+(g+-4)|0;u=c[b>>2]|0;if(!(u&1))Ea();if(!(u&2)){if((h|0)==(c[4695]|0)){d=(c[4692]|0)+p|0;c[4692]=d;c[4695]=o;c[o+4>>2]=d|1;if((o|0)!=(c[4694]|0))return;c[4694]=0;c[4691]=0;return}if((h|0)==(c[4694]|0)){d=(c[4691]|0)+p|0;c[4691]=d;c[4694]=o;c[o+4>>2]=d|1;c[o+d>>2]=d;return}d=(u&-8)+p|0;x=u>>>3;do if(u>>>0>=256){y=c[a+(g+16)>>2]|0;w=c[a+(g|4)>>2]|0;do if((w|0)==(h|0)){v=a+(g+12)|0;r=c[v>>2]|0;if(!r){f=a+(g+8)|0;e=c[f>>2]|0;if(!e){z=0;break}else{A=e;B=f}}else{A=r;B=v}while(1){v=A+20|0;r=c[v>>2]|0;if(r){A=r;B=v;continue}v=A+16|0;r=c[v>>2]|0;if(!r){C=A;D=B;break}else{A=r;B=v}}if(D>>>0<(c[4693]|0)>>>0)Ea();else{c[D>>2]=0;z=C;break}}else{v=c[a+g>>2]|0;if(v>>>0<(c[4693]|0)>>>0)Ea();r=v+12|0;if((c[r>>2]|0)!=(h|0))Ea();f=w+8|0;if((c[f>>2]|0)==(h|0)){c[r>>2]=w;c[f>>2]=v;z=w;break}else Ea()}while(0);if(y){w=c[a+(g+20)>>2]|0;l=19060+(w<<2)|0;if((h|0)==(c[l>>2]|0)){c[l>>2]=z;if(!z){c[4690]=c[4690]&~(1<<w);break}}else{if(y>>>0<(c[4693]|0)>>>0)Ea();w=y+16|0;if((c[w>>2]|0)==(h|0))c[w>>2]=z;else c[y+20>>2]=z;if(!z)break}w=c[4693]|0;if(z>>>0<w>>>0)Ea();c[z+24>>2]=y;l=c[a+(g+8)>>2]|0;do if(l)if(l>>>0<w>>>0)Ea();else{c[z+16>>2]=l;c[l+24>>2]=z;break}while(0);l=c[a+(g+12)>>2]|0;if(l)if(l>>>0<(c[4693]|0)>>>0)Ea();else{c[z+20>>2]=l;c[l+24>>2]=z;break}}}else{l=c[a+g>>2]|0;w=c[a+(g|4)>>2]|0;y=18796+(x<<1<<2)|0;if((l|0)!=(y|0)){if(l>>>0<(c[4693]|0)>>>0)Ea();if((c[l+12>>2]|0)!=(h|0))Ea()}if((w|0)==(l|0)){c[4689]=c[4689]&~(1<<x);break}if((w|0)!=(y|0)){if(w>>>0<(c[4693]|0)>>>0)Ea();y=w+8|0;if((c[y>>2]|0)==(h|0))E=y;else Ea()}else E=w+8|0;c[l+12>>2]=w;c[E>>2]=l}while(0);c[o+4>>2]=d|1;c[o+d>>2]=d;if((o|0)==(c[4694]|0)){c[4691]=d;return}else F=d}else{c[b>>2]=u&-2;c[o+4>>2]=p|1;c[o+p>>2]=p;F=p}p=F>>>3;if(F>>>0<256){u=p<<1;b=18796+(u<<2)|0;d=c[4689]|0;E=1<<p;if(d&E){p=18796+(u+2<<2)|0;h=c[p>>2]|0;if(h>>>0<(c[4693]|0)>>>0)Ea();else{G=p;H=h}}else{c[4689]=d|E;G=18796+(u+2<<2)|0;H=b}c[G>>2]=o;c[H+12>>2]=o;c[o+8>>2]=H;c[o+12>>2]=b;return}b=F>>>8;if(b)if(F>>>0>16777215)I=31;else{H=(b+1048320|0)>>>16&8;G=b<<H;b=(G+520192|0)>>>16&4;u=G<<b;G=(u+245760|0)>>>16&2;E=14-(b|H|G)+(u<<G>>>15)|0;I=F>>>(E+7|0)&1|E<<1}else I=0;E=19060+(I<<2)|0;c[o+28>>2]=I;c[o+20>>2]=0;c[o+16>>2]=0;G=c[4690]|0;u=1<<I;a:do if(G&u){H=c[E>>2]|0;b:do if((c[H+4>>2]&-8|0)!=(F|0)){b=F<<((I|0)==31?0:25-(I>>>1)|0);d=H;while(1){h=d+16+(b>>>31<<2)|0;p=c[h>>2]|0;if(!p){J=h;K=d;break}if((c[p+4>>2]&-8|0)==(F|0)){L=p;break b}else{b=b<<1;d=p}}if(J>>>0<(c[4693]|0)>>>0)Ea();else{c[J>>2]=o;c[o+24>>2]=K;c[o+12>>2]=o;c[o+8>>2]=o;break a}}else L=H;while(0);H=L+8|0;d=c[H>>2]|0;b=c[4693]|0;if(d>>>0>=b>>>0&L>>>0>=b>>>0){c[d+12>>2]=o;c[H>>2]=o;c[o+8>>2]=d;c[o+12>>2]=L;c[o+24>>2]=0;break}else Ea()}else{c[4690]=G|u;c[E>>2]=o;c[o+24>>2]=E;c[o+12>>2]=o;c[o+8>>2]=o}while(0);o=(c[4697]|0)+-1|0;c[4697]=o;if(!o)M=19212;else return;while(1){o=c[M>>2]|0;if(!o)break;else M=o+8|0}c[4697]=-1;return}function sd(b,c,d){b=b|0;c=c|0;d=d|0;var 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,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0;e=b;b=c;a:while(1){c=b;f=b+-1|0;g=e;b:while(1){h=g;i=c-h|0;switch(i|0){case 1:case 0:{break a;break}case 2:{j=g;k=f;l=4;break a;break}case 3:{m=g;n=f;l=6;break a;break}case 4:{o=g;p=f;l=7;break a;break}case 5:{q=g;r=f;l=8;break a;break}default:{}}if((i|0)<31){s=g;t=b;l=10;break a}u=(i|0)/2|0;v=g+u|0;if((i|0)>999){w=(i|0)/4|0;x=yd(g,g+w|0,v,g+(w+u)|0,f,d)|0}else x=wd(g,v,f,d)|0;u=a[g>>0]|0;w=a[v>>0]|0;do if((u&255)<(w&255)){y=f;z=x}else{i=f;while(1){A=i+-1|0;if((g|0)==(A|0))break;B=a[A>>0]|0;if((B&255)<(w&255)){C=B;D=A;l=29;break}else i=A}if((l|0)==29){l=0;a[g>>0]=C;a[D>>0]=u;y=D;z=x+1|0;break}i=g+1|0;A=a[f>>0]|0;if((u&255)<(A&255))E=i;else{if((i|0)==(f|0))break a;else{F=g;G=i}while(1){i=a[G>>0]|0;if((u&255)<(i&255)){H=F;I=i;J=G;break}i=G+1|0;if((i|0)==(f|0))break a;else{B=G;G=i;F=B}}a[J>>0]=A;a[f>>0]=I;E=H+2|0}if((E|0)==(f|0))break a;else{K=E;L=f}while(1){B=a[g>>0]|0;i=K;while(1){M=a[i>>0]|0;N=i+1|0;if((B&255)<(M&255)){O=M;P=N;Q=i;break}else i=N}i=L;while(1){N=i+-1|0;M=a[N>>0]|0;if((B&255)<(M&255))i=N;else{R=N;S=M;break}}if(Q>>>0>=R>>>0){g=Q;continue b}a[Q>>0]=S;a[R>>0]=O;K=P;L=R}}while(0);u=g+1|0;c:do if(u>>>0<y>>>0){w=u;A=y;i=v;B=z;while(1){M=a[i>>0]|0;N=w;while(1){T=a[N>>0]|0;U=N+1|0;if((T&255)<(M&255))N=U;else{V=T;W=U;X=N;break}}N=A;while(1){U=N+-1|0;T=a[U>>0]|0;if((T&255)<(M&255)){Y=U;Z=T;break}else N=U}if(X>>>0>Y>>>0){_=X;$=i;aa=B;break c}a[X>>0]=Z;a[Y>>0]=V;w=W;A=Y;i=(i|0)==(X|0)?Y:i;B=B+1|0}}else{_=u;$=v;aa=z}while(0);if((_|0)!=($|0)?(v=a[$>>0]|0,u=a[_>>0]|0,(v&255)<(u&255)):0){a[_>>0]=v;a[$>>0]=u;ba=aa+1|0}else ba=aa;if(!ba){ca=td(g,_,d)|0;u=_+1|0;if(td(u,b,d)|0){l=42;break}if(ca){g=u;continue}}u=_;if((u-h|0)>=(c-u|0)){da=g;ea=_;l=46;break}sd(g,_,d);g=_+1|0}if((l|0)==42){l=0;if(ca)break;else{e=g;b=_;continue}}else if((l|0)==46){l=0;sd(ea+1|0,b,d);e=da;b=ea;continue}}if((l|0)==4){ea=a[k>>0]|0;b=a[j>>0]|0;if((ea&255)<(b&255)){a[j>>0]=ea;a[k>>0]=b}}else if((l|0)==6)wd(m,m+1|0,n,d)|0;else if((l|0)==7)xd(o,o+1|0,o+2|0,p,d)|0;else if((l|0)==8)yd(q,q+1|0,q+2|0,q+3|0,r,d)|0;else if((l|0)==10)zd(s,t,d);return}function td(b,c,d){b=b|0;c=c|0;d=d|0;var 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;a:do switch(c-b|0){case 1:case 0:{e=1;break}case 2:{f=c+-1|0;g=a[f>>0]|0;h=a[b>>0]|0;if((g&255)<(h&255)){a[b>>0]=g;a[f>>0]=h;e=1}else e=1;break}case 3:{wd(b,b+1|0,c+-1|0,d)|0;e=1;break}case 4:{xd(b,b+1|0,b+2|0,c+-1|0,d)|0;e=1;break}case 5:{yd(b,b+1|0,b+2|0,b+3|0,c+-1|0,d)|0;e=1;break}default:{h=b+2|0;wd(b,b+1|0,h,d)|0;f=b+3|0;if((f|0)==(c|0))e=1;else{g=0;i=f;f=h;while(1){h=a[i>>0]|0;j=a[f>>0]|0;if((h&255)<(j&255)){k=j;j=i;l=f;while(1){a[j>>0]=k;if((l|0)==(b|0)){m=b;break}n=l+-1|0;k=a[n>>0]|0;if((h&255)>=(k&255)){m=l;break}else{o=l;l=n;j=o}}a[m>>0]=h;j=g+1|0;if((j|0)==8){p=i;break}else q=j}else q=g;j=i+1|0;if((j|0)==(c|0)){e=1;break a}else{l=i;g=q;i=j;f=l}}e=(p+1|0)==(c|0)}}}while(0);return e|0}function ud(a,b,d){a=a|0;b=b|0;d=d|0;var 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,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0;e=a;a=b;a:while(1){b=a;f=a+-4|0;g=e;b:while(1){h=g;i=b-h|0;j=i>>2;switch(j|0){case 1:case 0:{break a;break}case 2:{k=g;l=f;m=4;break a;break}case 3:{n=g;o=f;m=6;break a;break}case 4:{p=g;q=f;m=7;break a;break}case 5:{r=g;s=f;m=8;break a;break}default:{}}if((i|0)<124){t=g;u=a;m=10;break a}v=(j|0)/2|0;w=g+(v<<2)|0;if((i|0)>3996){i=(j|0)/4|0;x=Cd(g,g+(i<<2)|0,w,g+(i+v<<2)|0,f,d)|0}else x=Ad(g,w,f,d)|0;v=c[g>>2]|0;i=c[w>>2]|0;do if(v>>>0<i>>>0){y=f;z=x}else{j=f;while(1){A=j+-4|0;if((g|0)==(A|0))break;B=c[A>>2]|0;if(B>>>0<i>>>0){C=B;D=A;m=29;break}else j=A}if((m|0)==29){m=0;c[g>>2]=C;c[D>>2]=v;y=D;z=x+1|0;break}j=g+4|0;A=c[f>>2]|0;if(v>>>0<A>>>0)E=j;else{if((j|0)==(f|0))break a;else{F=g;G=j}while(1){j=c[G>>2]|0;if(v>>>0<j>>>0){H=F;I=j;J=G;break}j=G+4|0;if((j|0)==(f|0))break a;else{B=G;G=j;F=B}}c[J>>2]=A;c[f>>2]=I;E=H+8|0}if((E|0)==(f|0))break a;else{K=E;L=f}while(1){B=c[g>>2]|0;j=K;while(1){M=c[j>>2]|0;N=j+4|0;if(B>>>0<M>>>0){O=M;P=N;Q=j;break}else j=N}j=L;while(1){N=j+-4|0;M=c[N>>2]|0;if(B>>>0<M>>>0)j=N;else{R=N;S=M;break}}if(Q>>>0>=R>>>0){g=Q;continue b}c[Q>>2]=S;c[R>>2]=O;K=P;L=R}}while(0);v=g+4|0;c:do if(v>>>0<y>>>0){i=v;A=y;j=w;B=z;while(1){M=c[j>>2]|0;N=i;while(1){T=c[N>>2]|0;U=N+4|0;if(T>>>0<M>>>0)N=U;else{V=T;W=U;X=N;break}}N=A;while(1){U=N+-4|0;T=c[U>>2]|0;if(T>>>0<M>>>0){Y=U;Z=T;break}else N=U}if(X>>>0>Y>>>0){_=X;$=j;aa=B;break c}c[X>>2]=Z;c[Y>>2]=V;i=W;A=Y;j=(j|0)==(X|0)?Y:j;B=B+1|0}}else{_=v;$=w;aa=z}while(0);if((_|0)!=($|0)?(w=c[$>>2]|0,v=c[_>>2]|0,w>>>0<v>>>0):0){c[_>>2]=w;c[$>>2]=v;ba=aa+1|0}else ba=aa;if(!ba){ca=vd(g,_,d)|0;v=_+4|0;if(vd(v,a,d)|0){m=42;break}if(ca){g=v;continue}}v=_;if((v-h|0)>=(b-v|0)){da=g;ea=_;m=46;break}ud(g,_,d);g=_+4|0}if((m|0)==42){m=0;if(ca)break;else{e=g;a=_;continue}}else if((m|0)==46){m=0;ud(ea+4|0,a,d);e=da;a=ea;continue}}if((m|0)==4){ea=c[l>>2]|0;a=c[k>>2]|0;if(ea>>>0<a>>>0){c[k>>2]=ea;c[l>>2]=a}}else if((m|0)==6)Ad(n,n+4|0,o,d)|0;else if((m|0)==7)Bd(p,p+4|0,p+8|0,q,d)|0;else if((m|0)==8)Cd(r,r+4|0,r+8|0,r+12|0,s,d)|0;else if((m|0)==10)Dd(t,u,d);return}function vd(a,b,d){a=a|0;b=b|0;d=d|0;var 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;a:do switch(b-a>>2|0){case 1:case 0:{e=1;break}case 2:{f=b+-4|0;g=c[f>>2]|0;h=c[a>>2]|0;if(g>>>0<h>>>0){c[a>>2]=g;c[f>>2]=h;e=1}else e=1;break}case 3:{Ad(a,a+4|0,b+-4|0,d)|0;e=1;break}case 4:{Bd(a,a+4|0,a+8|0,b+-4|0,d)|0;e=1;break}case 5:{Cd(a,a+4|0,a+8|0,a+12|0,b+-4|0,d)|0;e=1;break}default:{h=a+8|0;Ad(a,a+4|0,h,d)|0;f=a+12|0;if((f|0)==(b|0))e=1;else{g=0;i=f;f=h;while(1){h=c[i>>2]|0;j=c[f>>2]|0;if(h>>>0<j>>>0){k=j;j=i;l=f;while(1){c[j>>2]=k;if((l|0)==(a|0)){m=a;break}n=l+-4|0;k=c[n>>2]|0;if(h>>>0>=k>>>0){m=l;break}else{o=l;l=n;j=o}}c[m>>2]=h;j=g+1|0;if((j|0)==8){p=i;break}else q=j}else q=g;j=i+4|0;if((j|0)==(b|0)){e=1;break a}else{l=i;g=q;i=j;f=l}}e=(p+4|0)==(b|0)}}}while(0);return e|0}function wd(b,c,d,e){b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;e=a[c>>0]|0;f=a[b>>0]|0;g=a[d>>0]|0;h=(g&255)<(e&255);do if((e&255)<(f&255)){if(h){a[b>>0]=g;a[d>>0]=f;i=1;break}a[b>>0]=e;a[c>>0]=f;j=a[d>>0]|0;if((j&255)<(f&255)){a[c>>0]=j;a[d>>0]=f;i=2}else i=1}else if(h){a[c>>0]=g;a[d>>0]=e;j=a[c>>0]|0;k=a[b>>0]|0;if((j&255)<(k&255)){a[b>>0]=j;a[c>>0]=k;i=2}else i=1}else i=0;while(0);return i|0}function xd(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=wd(b,c,d,f)|0;f=a[e>>0]|0;h=a[d>>0]|0;if((f&255)<(h&255)){a[d>>0]=f;a[e>>0]=h;h=g+1|0;e=a[d>>0]|0;f=a[c>>0]|0;if((e&255)<(f&255)){a[c>>0]=e;a[d>>0]=f;f=a[c>>0]|0;d=a[b>>0]|0;if((f&255)<(d&255)){a[b>>0]=f;a[c>>0]=d;i=g+3|0}else i=g+2|0}else i=h}else i=g;return i|0}function yd(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,i=0,j=0;h=xd(b,c,d,e,g)|0;g=a[f>>0]|0;i=a[e>>0]|0;if((g&255)<(i&255)){a[e>>0]=g;a[f>>0]=i;i=h+1|0;f=a[e>>0]|0;g=a[d>>0]|0;if((f&255)<(g&255)){a[d>>0]=f;a[e>>0]=g;g=h+2|0;e=a[d>>0]|0;f=a[c>>0]|0;if((e&255)<(f&255)){a[c>>0]=e;a[d>>0]=f;f=a[c>>0]|0;d=a[b>>0]|0;if((f&255)<(d&255)){a[b>>0]=f;a[c>>0]=d;j=h+4|0}else j=h+3|0}else j=g}else j=i}else j=h;return j|0}function zd(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=b+2|0;wd(b,b+1|0,e,d)|0;d=b+3|0;if((d|0)!=(c|0)){f=d;d=e;while(1){e=a[f>>0]|0;g=a[d>>0]|0;if((e&255)<(g&255)){h=g;g=f;i=d;while(1){a[g>>0]=h;if((i|0)==(b|0)){j=b;break}k=i+-1|0;h=a[k>>0]|0;if((e&255)>=(h&255)){j=i;break}else{l=i;i=k;g=l}}a[j>>0]=e}g=f+1|0;if((g|0)==(c|0))break;else{i=f;f=g;d=i}}}return}function Ad(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;e=c[b>>2]|0;f=c[a>>2]|0;g=c[d>>2]|0;h=g>>>0<e>>>0;do if(e>>>0<f>>>0){if(h){c[a>>2]=g;c[d>>2]=f;i=1;break}c[a>>2]=e;c[b>>2]=f;j=c[d>>2]|0;if(j>>>0<f>>>0){c[b>>2]=j;c[d>>2]=f;i=2}else i=1}else if(h){c[b>>2]=g;c[d>>2]=e;j=c[b>>2]|0;k=c[a>>2]|0;if(j>>>0<k>>>0){c[a>>2]=j;c[b>>2]=k;i=2}else i=1}else i=0;while(0);return i|0}function Bd(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,i=0;g=Ad(a,b,d,f)|0;f=c[e>>2]|0;h=c[d>>2]|0;if(f>>>0<h>>>0){c[d>>2]=f;c[e>>2]=h;h=g+1|0;e=c[d>>2]|0;f=c[b>>2]|0;if(e>>>0<f>>>0){c[b>>2]=e;c[d>>2]=f;f=c[b>>2]|0;d=c[a>>2]|0;if(f>>>0<d>>>0){c[a>>2]=f;c[b>>2]=d;i=g+3|0}else i=g+2|0}else i=h}else i=g;return i|0}function Cd(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,i=0,j=0;h=Bd(a,b,d,e,g)|0;g=c[f>>2]|0;i=c[e>>2]|0;if(g>>>0<i>>>0){c[e>>2]=g;c[f>>2]=i;i=h+1|0;f=c[e>>2]|0;g=c[d>>2]|0;if(f>>>0<g>>>0){c[d>>2]=f;c[e>>2]=g;g=h+2|0;e=c[d>>2]|0;f=c[b>>2]|0;if(e>>>0<f>>>0){c[b>>2]=e;c[d>>2]=f;f=c[b>>2]|0;d=c[a>>2]|0;if(f>>>0<d>>>0){c[a>>2]=f;c[b>>2]=d;j=h+4|0}else j=h+3|0}else j=g}else j=i}else j=h;return j|0}function Dd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;e=a+8|0;Ad(a,a+4|0,e,d)|0;d=a+12|0;if((d|0)!=(b|0)){f=d;d=e;while(1){e=c[f>>2]|0;g=c[d>>2]|0;if(e>>>0<g>>>0){h=g;g=f;i=d;while(1){c[g>>2]=h;if((i|0)==(a|0)){j=a;break}k=i+-4|0;h=c[k>>2]|0;if(e>>>0>=h>>>0){j=i;break}else{l=i;i=k;g=l}}c[j>>2]=e}g=f+4|0;if((g|0)==(b|0))break;else{i=f;f=g;d=i}}}return}function Ed(){}function Fd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;g=b&3;h=d|d<<8|d<<16|d<<24;i=f&~3;if(g){g=b+4-g|0;while((b|0)<(g|0)){a[b>>0]=d;b=b+1|0}}while((b|0)<(i|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b>>0]=d;b=b+1|0}return b-e|0}function Gd(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){B=b>>>c;return a>>>c|(b&(1<<c)-1)<<32-c}B=0;return b>>>c-32|0}function Hd(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){B=b<<c|(a&(1<<c)-1<<32-c)>>>32-c;return a<<c}B=a<<c-32;return 0}function Id(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 Jd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Ka[a&7](b|0,c|0,d|0)|0}function Kd(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;La[a&3](b|0,c|0,d|0,e|0,f|0)}function Ld(a,b){a=a|0;b=b|0;Ma[a&15](b|0)}function Md(a,b){a=a|0;b=b|0;return Na[a&3](b|0)|0}function Nd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;Oa[a&3](b|0,c|0,d|0)}function Od(a){a=a|0;Pa[a&0]()}function Pd(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;Qa[a&3](b|0,c|0,d|0,e|0,f|0,g|0)}function Qd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Ra[a&3](b|0,c|0,d|0,e|0)}function Rd(a,b,c){a=a|0;b=b|0;c=c|0;aa(0);return 0}function Sd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;aa(1)}function Td(a){a=a|0;aa(2)}function Ud(a){a=a|0;aa(3);return 0}function Vd(a,b,c){a=a|0;b=b|0;c=c|0;aa(4)}function Wd(){aa(5)}function Xd(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)}function Yd(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aa(7)}
+function mb(b,f,g,h){b=b|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;j=i;i=i+16|0;k=j;l=a[g+8>>0]|0;m=l&255;n=a[g+9>>0]|0;o=n&255;p=a[f+4>>0]|0;q=p&255;if(l<<24>>24==n<<24>>24){if((l&255)>=4)pa(500021,474791,827,500031);r=d[f>>0]|0;s=d[f+1>>0]|0;t=s<<3|s>>>2;s=d[f+2>>0]|0;u=s<<3|s>>>2;s=c[17484+(q<<4)+(m<<2)>>2]|0;v=(r<<3|r>>>2)+s|0;if(v>>>0>255)if((v|0)<0){w=0;x=6}else y=255;else{w=v;x=6}if((x|0)==6)y=w;w=t+s|0;if(w>>>0>255)if((w|0)<0){z=0;x=9}else A=255;else{z=w;x=9}if((x|0)==9)A=z;z=u+s|0;if(z>>>0>255)if((z|0)<0){B=0;x=12}else C=255;else{B=z;x=12}if((x|0)==12)C=B;B=d[468643+(A<<1)>>0]<<5|d[467619+(y<<1)>>0]<<11|d[467619+(C<<1)>>0];z=d[468643+(A<<1)+1>>0]<<5|d[467619+(y<<1)+1>>0]<<11|d[467619+(C<<1)+1>>0];if((z|0)==(B|0)&(h^1))if(!B){D=1;E=0;F=0;G=0;H=85}else{I=B+-1|0;J=0;x=16}else{I=z;J=170;x=16}if((x|0)==16){z=B>>>0<I>>>0;C=z?I:B;y=z?B:I;D=C&255;E=y&255;F=(C&65535)>>>8&255;G=(y&65535)>>>8&255;H=(z?J|85:J)&255}a[b>>0]=D;a[b+1>>0]=F;a[b+2>>0]=E;a[b+3>>0]=G;Hd(b+4|0,H|0,4)|0;i=j;return}if((p&255)>6?n<<24>>24==3&(l<<24>>24==0&(a[g+10>>0]|0)==2):0){ob(k,f,q);l=c[k>>2]|0;n=c[k+12>>2]|0;k=d[469155+((l>>>8&255)<<1)>>0]<<5|d[468131+((l&255)<<1)>>0]<<11|d[468131+((l>>>16&255)<<1)>>0];l=d[469155+((n>>>8&255)<<1)>>0]<<5|d[468131+((n&255)<<1)>>0]<<11|d[468131+((n>>>16&255)<<1)>>0];if((l|0)==(k|0))if(!k){K=1;L=0;M=0;N=0;O=1;P=1}else{Q=k+-1|0;R=0;x=23}else{Q=l;R=1;x=23}if((x|0)==23){l=k>>>0<Q>>>0;n=l?Q:k;p=l?k:Q;K=n&255;L=p&255;M=(n&65535)>>>8&255;N=(p&65535)>>>8&255;O=l?0:R;P=l&1}a[b>>0]=K;a[b+1>>0]=M;a[b+2>>0]=L;a[b+3>>0]=N;N=0;while(1){L=g+N|0;M=b+4+N|0;K=(a[L>>0]&3)==3?O:P;if((K|N)>>>0>=4){x=27;break}l=d[M>>0]&252|K;a[M>>0]=l;K=(a[L>>0]&12)==12?O:P;if((K|N)>>>0>=4){x=27;break}R=l&243|K<<2;a[M>>0]=R;K=(a[L>>0]&48)==48?O:P;if((K|N)>>>0>=4){x=27;break}l=R&207|K<<4;a[M>>0]=l;if((N|3|0)!=3){x=25;break}K=(d[L>>0]|0)>191?O:P;if((K|N)>>>0>=4){x=27;break}a[M>>0]=l&63|K<<6;N=N+1|0;if(N>>>0>=4){x=33;break}}if((x|0)==25)pa(499759,499604,740,499924);else if((x|0)==27)pa(499986,474791,957,499911);else if((x|0)==33){i=j;return}}x=q<<5;q=(c[16480+(m<<4)+(o<<2)>>2]|0)*10|0;o=(((d[f>>0]|0)+x|0)*60|0)+q|0;m=(((d[f+1>>0]|0)+x|0)*60|0)+q|0;N=(((d[f+2>>0]|0)+x|0)*60|0)+q|0;q=(e[147612+(m<<2)+2>>1]|0)+(e[86172+(o<<2)+2>>1]|0)+(e[86172+(N<<2)+2>>1]|0)|0;x=(e[147612+((m|1)<<2)+2>>1]|0)+(e[86172+((o|1)<<2)+2>>1]|0)+(e[86172+((N|1)<<2)+2>>1]|0)|0;f=x>>>0<q>>>0;P=f?x:q;q=(e[147612+(m+2<<2)+2>>1]|0)+(e[86172+(o+2<<2)+2>>1]|0)+(e[86172+(N+2<<2)+2>>1]|0)|0;x=q>>>0<P>>>0;O=x?q:P;P=(e[147612+(m+3<<2)+2>>1]|0)+(e[86172+(o+3<<2)+2>>1]|0)+(e[86172+(N+3<<2)+2>>1]|0)|0;q=P>>>0<O>>>0;K=q?P:O;O=(e[147612+(m+4<<2)+2>>1]|0)+(e[86172+(o+4<<2)+2>>1]|0)+(e[86172+(N+4<<2)+2>>1]|0)|0;P=O>>>0<K>>>0;l=P?O:K;K=(e[147612+(m+5<<2)+2>>1]|0)+(e[86172+(o+5<<2)+2>>1]|0)+(e[86172+(N+5<<2)+2>>1]|0)|0;O=K>>>0<l>>>0;M=O?K:l;l=(e[147612+(m+6<<2)+2>>1]|0)+(e[86172+(o+6<<2)+2>>1]|0)+(e[86172+(N+6<<2)+2>>1]|0)|0;K=l>>>0<M>>>0;L=K?l:M;M=(e[147612+(m+7<<2)+2>>1]|0)+(e[86172+(o+7<<2)+2>>1]|0)+(e[86172+(N+7<<2)+2>>1]|0)|0;l=M>>>0<L>>>0;R=l?M:L;L=(e[147612+(m+8<<2)+2>>1]|0)+(e[86172+(o+8<<2)+2>>1]|0)+(e[86172+(N+8<<2)+2>>1]|0)|0;M=L>>>0<R>>>0;p=((e[147612+(m+9<<2)+2>>1]|0)+(e[86172+(o+9<<2)+2>>1]|0)+(e[86172+(N+9<<2)+2>>1]|0)|0)>>>0<(M?L:R)>>>0?9:M?8:l?7:K?6:O?5:P?4:q?3:x?2:f&1;f=p+o|0;o=p+m|0;m=p+N|0;N=d[86172+(f<<2)>>0]<<11&63488|d[86172+(m<<2)>>0]|d[147612+(o<<2)>>0]<<5;x=d[86172+(f<<2)+1>>0]<<11&63488|d[86172+(m<<2)+1>>0]|d[147612+(o<<2)+1>>0]<<5;o=N>>>0<x>>>0;m=o?x:N;f=o?N:x;x=o?472231:469671;a[b>>0]=m;o=b+1|0;a[o>>0]=(m&65535)>>>8;N=b+2|0;a[N>>0]=f;q=b+3|0;a[q>>0]=(f&65535)>>>8;if((m|0)!=(f|0)){a[b+4>>0]=a[(d[g>>0]|0)+(x+(p<<8))>>0]|0;a[b+5>>0]=a[(d[g+1>>0]|0)+(x+(p<<8))>>0]|0;a[b+6>>0]=a[(d[g+2>>0]|0)+(x+(p<<8))>>0]|0;a[b+7>>0]=a[(d[g+3>>0]|0)+(x+(p<<8))>>0]|0;i=j;return}if(h)S=0;else{h=(m|0)==0;p=h?0:m+-1|0;x=h?1:m;a[b>>0]=x;a[o>>0]=(x&65535)>>>8;a[N>>0]=p;a[q>>0]=(p&65535)>>>8;S=h?85:0}Hd(b+4|0,S|0,4)|0;i=j;return}function nb(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,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;h=i;i=i+16|0;j=h;k=b+4|0;l=c[k>>2]&2147450878|-2147450880;c[k>>2]=l;m=a[g+8>>0]|0;n=m&255;o=a[g+9>>0]|0;p=o&255;q=a[f+4>>0]|0;r=q&255;if(m<<24>>24!=o<<24>>24){if((q&255)>6?o<<24>>24==3&(m<<24>>24==0&(a[g+10>>0]|0)==2):0){ob(j,f,r);o=c[j>>2]|0;q=j+12|0;j=a[495984+((o&255)<<1)+1>>0]|0;s=a[495984+((o>>>8&255)<<1)+1>>0]|0;t=a[495472+((o>>>16&255)<<1)+1>>0]|0;if(!(((s|j)&255)<32&(t&255)<16))pa(501721,474791,6735,507574);o=d[q+2>>0]|0;u=d[q+1>>0]|0;v=d[q>>0]|0;q=(s&255)<<5&992|(j&255)<<10&31744|(t&255)<<1&30|c[k>>2]&-32767;c[k>>2]=q;t=a[495984+(v<<1)+1>>0]|0;v=a[495984+(u<<1)+1>>0]|0;u=a[495984+(o<<1)+1>>0]|0;if(((v|t|u)&255)>=32)pa(500605,474791,6744,507621);c[k>>2]=(t&255)<<26&2080374784|q&-2147418113|(v&255)<<21&65011712|(u&255)<<16&2031616;a[b>>0]=a[g>>0]|0;a[b+1>>0]=a[g+1>>0]|0;a[b+2>>0]=a[g+2>>0]|0;a[b+3>>0]=a[g+3>>0]|0;i=h;return}u=r<<5;v=(c[18148+(n<<4)+(p<<2)>>2]|0)*10|0;p=(((d[f>>0]|0)+u|0)*60|0)+v|0;q=(((d[f+1>>0]|0)+u|0)*60|0)+v|0;t=(((d[f+2>>0]|0)+u|0)*60|0)+v|0;v=(e[278684+(q<<2)+2>>1]|0)+(e[278684+(p<<2)+2>>1]|0)+(e[401564+(t<<2)+2>>1]|0)|0;u=(e[278684+((q|1)<<2)+2>>1]|0)+(e[278684+((p|1)<<2)+2>>1]|0)+(e[401564+((t|1)<<2)+2>>1]|0)|0;o=u>>>0<v>>>0;j=o?u:v;v=(e[278684+(q+2<<2)+2>>1]|0)+(e[278684+(p+2<<2)+2>>1]|0)+(e[401564+(t+2<<2)+2>>1]|0)|0;u=v>>>0<j>>>0;s=u?v:j;j=(e[278684+(q+3<<2)+2>>1]|0)+(e[278684+(p+3<<2)+2>>1]|0)+(e[401564+(t+3<<2)+2>>1]|0)|0;v=j>>>0<s>>>0;w=v?j:s;s=(e[278684+(q+4<<2)+2>>1]|0)+(e[278684+(p+4<<2)+2>>1]|0)+(e[401564+(t+4<<2)+2>>1]|0)|0;j=s>>>0<w>>>0;x=j?s:w;w=(e[278684+(q+5<<2)+2>>1]|0)+(e[278684+(p+5<<2)+2>>1]|0)+(e[401564+(t+5<<2)+2>>1]|0)|0;s=w>>>0<x>>>0;y=s?w:x;x=(e[278684+(q+6<<2)+2>>1]|0)+(e[278684+(p+6<<2)+2>>1]|0)+(e[401564+(t+6<<2)+2>>1]|0)|0;w=x>>>0<y>>>0;z=w?x:y;y=(e[278684+(q+7<<2)+2>>1]|0)+(e[278684+(p+7<<2)+2>>1]|0)+(e[401564+(t+7<<2)+2>>1]|0)|0;x=y>>>0<z>>>0;A=x?y:z;z=(e[278684+(q+8<<2)+2>>1]|0)+(e[278684+(p+8<<2)+2>>1]|0)+(e[401564+(t+8<<2)+2>>1]|0)|0;y=z>>>0<A>>>0;B=((e[278684+(q+9<<2)+2>>1]|0)+(e[278684+(p+9<<2)+2>>1]|0)+(e[401564+(t+9<<2)+2>>1]|0)|0)>>>0<(y?z:A)>>>0?9:y?8:x?7:w?6:s?5:j?4:v?3:u?2:o&1;o=B+p|0;p=a[278684+(o<<2)>>0]|0;u=B+q|0;q=a[278684+(u<<2)>>0]|0;v=B+t|0;t=a[401564+(v<<2)>>0]|0;if(!(((q|p)&255)<32&(t&255)<16))pa(501721,474791,6735,507574);j=(q&255)<<5&992|(p&255)<<10&31744|(t&255)<<1&30|c[k>>2]&-32767;c[k>>2]=j;t=a[278684+(o<<2)+1>>0]|0;o=a[278684+(u<<2)+1>>0]|0;u=a[401564+(v<<2)+1>>0]|0;if(((o|t|u)&255)>=32)pa(500605,474791,6744,507621);c[k>>2]=(t&255)<<26&2080374784|j&-2147418113|(o&255)<<21&65011712|(u&255)<<16&2031616;u=a[g>>0]|0;if((B|0)==6){a[b>>0]=u;a[b+1>>0]=a[g+1>>0]|0;a[b+2>>0]=a[g+2>>0]|0;a[b+3>>0]=a[g+3>>0]|0;i=h;return}else{o=u&255;u=d[g+1>>0]|0;j=d[g+2>>0]|0;t=d[g+3>>0]|0;g=d[(u>>>2&3)+(507534+(B<<2))>>0]<<2|d[(u&3)+(507534+(B<<2))>>0]|d[(u>>>4&3)+(507534+(B<<2))>>0]<<4|d[(u>>>6)+(507534+(B<<2))>>0]<<6;u=d[(j>>>2&3)+(507534+(B<<2))>>0]<<2|d[(j&3)+(507534+(B<<2))>>0]|d[(j>>>4&3)+(507534+(B<<2))>>0]<<4|d[(j>>>6)+(507534+(B<<2))>>0]<<6;j=d[(t>>>2&3)+(507534+(B<<2))>>0]<<2|d[(t&3)+(507534+(B<<2))>>0]|d[(t>>>4&3)+(507534+(B<<2))>>0]<<4|d[(t>>>6)+(507534+(B<<2))>>0]<<6;a[b>>0]=d[(o>>>2&3)+(507534+(B<<2))>>0]<<2|d[(o&3)+(507534+(B<<2))>>0]|d[(o>>>4&3)+(507534+(B<<2))>>0]<<4|d[(o>>>6)+(507534+(B<<2))>>0]<<6;a[b+1>>0]=g;a[b+2>>0]=u;a[b+3>>0]=j;i=h;return}}else{if((m&255)>=4)pa(500021,474791,827,500031);m=d[f>>0]|0;j=d[f+1>>0]|0;u=j<<3|j>>>2;j=d[f+2>>0]|0;f=j<<3|j>>>2;j=c[17484+(r<<4)+(n<<2)>>2]|0;n=(m<<3|m>>>2)+j|0;if(n>>>0>255)if((n|0)<0){C=0;D=6}else E=255;else{C=n;D=6}if((D|0)==6)E=C;C=u+j|0;if(C>>>0>255)if((C|0)<0){F=0;D=9}else G=255;else{F=C;D=9}if((D|0)==9)G=F;F=f+j|0;if(F>>>0>255)if((F|0)<0){H=0;D=12}else I=255;else{H=F;D=12}if((D|0)==12)I=H;H=a[494448+(E<<1)>>0]|0;D=a[494448+(G<<1)>>0]|0;F=a[493936+(I<<1)>>0]|0;if(!(((D|H)&255)<32&(F&255)<16))pa(501721,474791,6735,507574);j=(D&255)<<5&992|(H&255)<<10&31744|(F&255)<<1&30;c[k>>2]=j|l&-32768;l=a[494448+(E<<1)+1>>0]|0;E=a[494448+(G<<1)+1>>0]|0;G=a[493936+(I<<1)+1>>0]|0;if(((E|l|G)&255)>=32)pa(500605,474791,6744,507621);c[k>>2]=(l&255)<<26|(j|-2147450880)|(E&255)<<21&65011712|(G&255)<<16&2031616;a[b>>0]=85;a[b+1>>0]=85;a[b+2>>0]=85;a[b+3>>0]=85;i=h;return}}function ob(b,d,e){b=b|0;d=d|0;e=e|0;var 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,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;f=c[d>>2]|0;d=f&255;g=f>>>5;h=f>>>10&63;i=f>>>13;j=f>>>18&63;f=d<<3&248|d>>>2;d=c[17484+(e<<4)>>2]|0;k=f+d|0;if(k>>>0>255)if((k|0)<0){l=0;m=3}else n=255;else{l=k;m=3}if((m|0)==3)n=l;l=g&248|h;h=d+l|0;if(h>>>0>255)if((h|0)<0){o=0;m=6}else p=255;else{o=h;m=6}if((m|0)==6)p=o;o=i&248|j;j=d+o|0;if(j>>>0>255)if((j|0)<0){q=0;m=9}else r=255;else{q=j;m=9}if((m|0)==9)r=q;a[b>>0]=n;a[b+1>>0]=p;a[b+2>>0]=r;a[b+3>>0]=-1;r=b+4|0;p=c[17484+(e<<4)+4>>2]|0;n=p+f|0;if(n>>>0>255)if((n|0)<0){s=0;m=12}else t=255;else{s=n;m=12}if((m|0)==12)t=s;s=p+l|0;if(s>>>0>255)if((s|0)<0){u=0;m=15}else v=255;else{u=s;m=15}if((m|0)==15)v=u;u=p+o|0;if(u>>>0>255)if((u|0)<0){w=0;m=18}else x=255;else{w=u;m=18}if((m|0)==18)x=w;a[r>>0]=t;a[r+1>>0]=v;a[r+2>>0]=x;a[r+3>>0]=-1;r=b+8|0;x=c[17484+(e<<4)+8>>2]|0;v=x+f|0;if(v>>>0>255)if((v|0)<0){y=0;m=21}else z=255;else{y=v;m=21}if((m|0)==21)z=y;y=x+l|0;if(y>>>0>255)if((y|0)<0){A=0;m=24}else B=255;else{A=y;m=24}if((m|0)==24)B=A;A=x+o|0;if(A>>>0>255)if((A|0)<0){C=0;m=27}else D=255;else{C=A;m=27}if((m|0)==27)D=C;a[r>>0]=z;a[r+1>>0]=B;a[r+2>>0]=D;a[r+3>>0]=-1;r=b+12|0;b=c[17484+(e<<4)+12>>2]|0;e=b+f|0;if(e>>>0>255)if((e|0)<0){E=0;m=30}else F=255;else{E=e;m=30}if((m|0)==30)F=E;E=b+l|0;if(E>>>0>255)if((E|0)<0){G=0;m=33}else H=255;else{G=E;m=33}if((m|0)==33)H=G;G=b+o|0;if(G>>>0>255)if((G|0)<0)I=0;else{J=255;K=F&255;a[r>>0]=K;L=H&255;M=r+1|0;a[M>>0]=L;N=J&255;O=r+2|0;a[O>>0]=N;P=r+3|0;a[P>>0]=-1;return}else I=G;J=I;K=F&255;a[r>>0]=K;L=H&255;M=r+1|0;a[M>>0]=L;N=J&255;O=r+2|0;a[O>>0]=N;P=r+3|0;a[P>>0]=-1;return}function pb(a){a=a|0;return (a+-13|0)>>>0<4|0}function qb(b,d,e,f,g,h,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){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;n=n|0;o=o|0;p=p|0;q=q|0;r=r|0;s=s|0;t=t|0;u=u|0;v=v|0;w=w|0;x=x|0;var y=0,z=0,A=0,B=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;y=i;i=i+32|0;z=y+12|0;A=y;B=Kd(p|0,0,o|0,0)|0;D=C;if(D>>>0>0|(D|0)==0&B>>>0>h>>>0){E=0;i=y;return E|0}B=(r|0)!=0;if(B){D=Kd(r|0,0,q|0,0)|0;F=C;if(F>>>0>0|(F|0)==0&D>>>0>h>>>0){E=0;i=y;return E|0}}else if(t)pa(475193,474791,8765,475222);h=(d|0)==9;if((d&-2|0)==8){D=j<<2;if(!D){E=0;i=y;return E|0}if(D+-1&D){E=0;i=y;return E|0}D=k<<2;if(!D){E=0;i=y;return E|0}if(D+-1&D){E=0;i=y;return E|0}}D=h?(t?d:8):d;d=(s&4|0)==0;switch(D|0){case 20:case 19:case 18:case 11:case 9:case 8:case 4:case 2:case 0:{G=8;H=16;break}case 21:case 17:case 12:case 10:case 5:case 3:case 1:case 7:case 6:{G=16;H=16;break}case 13:{I=4;J=_(k,j)|0;H=17;break}case 16:case 15:case 14:{G=2;H=16;break}default:pa(475191,474791,10833,475639)}do if((H|0)==16){s=_(k,j)|0;if((D+-13|0)>>>0>=4)if((D|0)==17){if((_((m+3|0)>>>2,(l+7|0)>>>3)|0)>>>0>f>>>0)E=0;else{K=G;L=s;break}i=y;return E|0}else{if(s>>>0>f>>>0)E=0;else{K=G;L=s;break}i=y;return E|0}else{I=G;J=s;H=17}}while(0);if((H|0)==17)if((_((x|0)==0?m:x,(v|0)==0?l:v)|0)>>>0>f>>>0){E=0;i=y;return E|0}else{K=I;L=J}J=g+o|0;if(t){M=d?p:r;N=d^1;O=d?J:g+q|0}else{M=p;N=0;O=J}do switch(D|0){case 0:{E=lb(b,e,j,k,O,M,0,K,0,u,N,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 2:{E=lb(b,e,j,k,O,M,2,K,1,u,N,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 4:{E=lb(b,e,j,k,O,M,4,K,0,u,N,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 8:{E=lb(b,e,j,k,O,M,6,K,0,u,N,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 9:{if(!t)pa(475238,474791,8870,475222);if(!B)pa(475266,474791,8871,475222);c[A>>2]=0;d=A+4|0;c[d>>2]=0;c[A+8>>2]=0;do if(L)if(L>>>0>1073741823)Kc(A);else{o=L<<2;I=Lc(o)|0;c[A>>2]=I;f=I+(L<<2)|0;c[A+8>>2]=f;Hd(I|0,0,o|0)|0;c[d>>2]=f;P=A;Q=I;break}else{P=A;Q=0}while(0);if(lb(b,Q,j,k,g+q|0,r,20,4,0,u,1,n,l,m,j,w,0,0,0)|0)R=lb(b,e,j,k,J,p,7,K,0,u,0,n,l,m,v,w,0,c[P>>2]|0,0)|0;else R=0;I=c[A>>2]|0;if(!I){E=R;i=y;return E|0}f=c[d>>2]|0;if((f|0)!=(I|0))c[d>>2]=f+(~((f+-4-I|0)>>>2)<<2);Mc(I);E=R;i=y;return E|0}case 7:case 6:{if((K|0)!=16)pa(475279,474791,8903,475222);I=lb(b,e,j,k,J,p,9,16,0,u,0,n,l,m,v,w,0,0,x)|0;if(!(I&t)){E=I;i=y;return E|0}E=lb(b,e,j,k,g+q|0,r,10,16,0,u,1,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 1:{if((K|0)!=16)pa(475279,474791,8931,475222);if(t){if(!(lb(b,e,j,k,g+q|0,r,11,16,0,u,1,n,l,m,v,w,0,0,x)|0)){E=0;i=y;return E|0}}else if(k){I=((v|0)==0?j:v)<<4;f=(j|0)==0;o=0;do{if(!f){H=_(I,o)|0;G=0;while(1){s=e+H|0;a[s>>0]=255;a[s+1>>0]=29;s=e+(H+2)|0;a[s>>0]=a[463004]|0;a[s+1>>0]=a[463005]|0;a[s+2>>0]=a[463006]|0;a[s+3>>0]=a[463007]|0;a[s+4>>0]=a[463008]|0;a[s+5>>0]=a[463009]|0;G=G+1|0;if((G|0)==(j|0))break;else H=H+16|0}}o=o+1|0}while((o|0)!=(k|0))}E=lb(b,e+8|0,j,k,J,p,0,16,0,u,0,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 3:{if((K|0)!=16)pa(475279,474791,8972,475222);if(t){if(!(lb(b,e,j,k,g+q|0,r,4,16,0,u,1,n,l,m,v,w,0,0,x)|0)){E=0;i=y;return E|0}}else{a[z>>0]=0;a[z+1>>0]=0;a[z+2>>0]=0;a[z+3>>0]=0;a[z+4>>0]=0;a[z+5>>0]=0;if(k){o=((v|0)==0?j:v)<<4;I=(j|0)==0;f=0;do{if(!I){d=_(o,f)|0;H=0;while(1){a[e+d>>0]=-1;a[e+(d+1)>>0]=-1;G=e+(d+2)|0;a[G>>0]=a[z>>0]|0;a[G+1>>0]=a[z+1>>0]|0;a[G+2>>0]=a[z+2>>0]|0;a[G+3>>0]=a[z+3>>0]|0;a[G+4>>0]=a[z+4>>0]|0;a[G+5>>0]=a[z+5>>0]|0;H=H+1|0;if((H|0)==(j|0))break;else d=d+16|0}}f=f+1|0}while((f|0)!=(k|0))}}E=lb(b,e+8|0,j,k,J,p,2,16,0,u,0,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 5:{if((K|0)!=16)pa(475279,474791,9009,475222);if(!(lb(b,e,j,k,J,p,4,16,0,u,0,n,l,m,v,w,0,0,x)|0)){E=0;i=y;return E|0}if(t){E=lb(b,e+8|0,j,k,g+q|0,r,4,16,0,u,1,n,l,m,v,w,0,0,x)|0;i=y;return E|0};a[z>>0]=0;a[z+1>>0]=0;a[z+2>>0]=0;a[z+3>>0]=0;a[z+4>>0]=0;a[z+5>>0]=0;if(k){f=((v|0)==0?j:v)<<4;o=(j|0)==0;I=0;do{if(!o){d=_(f,I)|0;H=0;while(1){a[e+(d+8)>>0]=-1;a[e+(d+9)>>0]=-1;G=e+(d+10)|0;a[G>>0]=a[z>>0]|0;a[G+1>>0]=a[z+1>>0]|0;a[G+2>>0]=a[z+2>>0]|0;a[G+3>>0]=a[z+3>>0]|0;a[G+4>>0]=a[z+4>>0]|0;a[G+5>>0]=a[z+5>>0]|0;H=H+1|0;if((H|0)==(j|0))break;else d=d+16|0}}I=I+1|0}while((I|0)!=(k|0))}E=1;i=y;return E|0}case 10:{if((K|0)!=16)pa(475279,474791,9048,475222);if(!t){E=lb(b,e,j,k,J,p,12,16,0,u,0,n,l,m,v,w,0,0,x)|0;i=y;return E|0}if(!(lb(b,e,j,k,g+q|0,r,20,16,0,u,1,n,l,m,v,w,0,0,x)|0)){E=0;i=y;return E|0}E=lb(b,e,j,k,J,p,12,16,0,u,0,n,l,m,v,w,1,0,x)|0;i=y;return E|0}case 11:{E=lb(b,e,j,k,O,M,13,K,0,u,N,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 12:{if((K|0)!=16)pa(475279,474791,9098,475222);if(t){if(!(lb(b,e,j,k,g+q|0,r,4,16,0,u,1,n,l,m,v,w,0,0,x)|0)){E=0;i=y;return E|0}}else{a[z>>0]=0;a[z+1>>0]=0;a[z+2>>0]=0;a[z+3>>0]=0;a[z+4>>0]=0;a[z+5>>0]=0;if(k){I=((v|0)==0?j:v)<<4;f=(j|0)==0;o=0;do{if(!f){d=_(I,o)|0;H=0;while(1){a[e+d>>0]=-1;a[e+(d+1)>>0]=-1;G=e+(d+2)|0;a[G>>0]=a[z>>0]|0;a[G+1>>0]=a[z+1>>0]|0;a[G+2>>0]=a[z+2>>0]|0;a[G+3>>0]=a[z+3>>0]|0;a[G+4>>0]=a[z+4>>0]|0;a[G+5>>0]=a[z+5>>0]|0;H=H+1|0;if((H|0)==(j|0))break;else d=d+16|0}}o=o+1|0}while((o|0)!=(k|0))}}E=lb(b,e+8|0,j,k,J,p,13,16,0,u,0,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 18:{E=lb(b,e,j,k,O,M,16,K,0,u,N,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 19:{if(!t){E=lb(b,e,j,k,J,p,16,K,0,u,0,n,l,m,v,w,0,0,x)|0;i=y;return E|0}if(!(lb(b,e,j,k,g+q|0,r,20,K,0,u,1,n,l,m,v,w,0,0,x)|0)){E=0;i=y;return E|0}E=lb(b,e,j,k,J,p,17,K,0,u,0,n,l,m,v,w,1,0,x)|0;i=y;return E|0}case 13:{if(t?!(lb(b,e,j,k,g+q|0,r,23,4,0,u,1,n,l,m,v,w,0,0,x)|0):0){E=0;i=y;return E|0}E=lb(b,e,j,k,J,p,t?21:22,4,0,u,0,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 15:case 14:{E=lb(b,e,j,k,O,M,(D|0)==14?24:25,2,0,u,N,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 16:{if(t?!(lb(b,e,j,k,g+q|0,r,27,2,0,u,1,n,l,m,v,w,0,0,x)|0):0){E=0;i=y;return E|0}E=lb(b,e,j,k,J,p,t?26:28,2,0,u,0,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 17:{E=lb(b,e,j,k,O,M,15,K,0,u,N,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 20:{E=lb(b,e,j,k,O,M,18,K,0,u,N,n,l,m,v,w,0,0,x)|0;i=y;return E|0}case 21:{if((K|0)!=16)pa(475279,474791,9277,475222);if(t){if(!(lb(b,e+8|0,j,k,g+q|0,r,18,16,0,u,1,n,l,m,v,w,0,0,x)|0)){E=0;i=y;return E|0}}else if(k){o=((v|0)==0?j:v)<<4;I=(j|0)==0;f=0;do{if(!I){d=_(o,f)|0;H=0;while(1){G=e+(d+8)|0;a[G>>0]=255;a[G+1>>0]=29;G=e+(d+10)|0;a[G>>0]=a[463004]|0;a[G+1>>0]=a[463005]|0;a[G+2>>0]=a[463006]|0;a[G+3>>0]=a[463007]|0;a[G+4>>0]=a[463008]|0;a[G+5>>0]=a[463009]|0;H=H+1|0;if((H|0)==(j|0))break;else d=d+16|0}}f=f+1|0}while((f|0)!=(k|0))}E=lb(b,e,j,k,J,p,18,16,0,u,0,n,l,m,v,w,0,0,x)|0;i=y;return E|0}default:pa(475191,474791,9310,475222)}while(0);return 0}function rb(a){a=a|0;var b=0;switch(a|0){case 20:case 19:case 18:case 11:case 9:case 8:case 4:case 2:case 0:{b=8;break}case 21:case 17:case 12:case 10:case 5:case 3:case 1:case 7:case 6:{b=16;break}case 13:{b=4;break}case 16:case 15:case 14:{b=2;break}default:pa(475191,474791,10833,475639)}return b|0}function sb(e,f,g,h,j,k,l,m,n,o,p,q,r,s,t,u,v,w){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;s=s|0;t=t|0;u=u|0;v=v|0;w=w|0;var 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,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0;s=i;i=i+256|0;n=s+96|0;e=s;x=l+-21|0;if(!r)if(x>>>0>=9)if((l|0)==15)y=(p+7|0)>>>3;else y=g;else y=p;else y=r;r=x>>>0>8|(t|0)!=0?t:q;if((_(g<<4,h)|0)>>>0>k>>>0){z=0;i=s;return z|0}k=(w&4|0)!=0&o;if((l&-2|0)==6)if((l|0)==7){tb(j,f,g,h,0)|0;z=1;i=s;return z|0}else{ub(j,f,g,h,0,k)|0;z=1;i=s;return z|0}if(!h){z=1;i=s;return z|0}o=_(y,m)|0;q=(g|0)==0;t=n+104|0;x=n+108|0;p=n+112|0;A=n+104|0;B=n+108|0;C=n+112|0;D=(w&32|0)!=0;w=n+104|0;E=n+112|0;F=n+108|0;G=n+112|0;H=n+104|0;I=n+112|0;J=n+108|0;K=n+112|0;L=n+104|0;M=n+112|0;N=n+104|0;O=n+112|0;P=n+108|0;Q=n+112|0;R=D?2:1;S=n+104|0;T=n+108|0;U=n+112|0;V=(m|0)==4;W=y<<2;X=n+104|0;Y=n+108|0;Z=n+112|0;$=(m|0)==2;aa=y<<1;ba=(l|0)==24;ca=n+104|0;da=n+108|0;ea=n+112|0;fa=~y;ga=u;u=v;v=0;ha=~r;ia=j;a:while(1){j=(ha|0)>-5?~ha:4;b:do if(q){ja=ga;ka=u;la=ia}else{ma=_(v,y)|0;na=(r|0)==(v<<2|0);oa=ga;qa=u;ra=0;sa=fa;ta=f+(_(o,v)|0)|0;ua=ia;while(1){va=(sa|0)>-5?~sa:4;c:do switch(l|0){case 0:{if(k)if(vb(ua,ta,3)|0){wa=qa;xa=oa;break c}else{z=0;ya=98;break a}if(!(Qb(ua,n,0,1)|0)){ya=95;break a}za=c[t>>2]|0;if((za|0)!=8)Rb(za,c[x>>2]|0,p,n,e,0)|0;Vb(n,e,ta);wa=qa;xa=oa;break}case 1:{if(!(Qb(ua,n,0,1)|0)){ya=25;break a}za=c[A>>2]|0;if((za|0)!=8)Rb(za,c[B>>2]|0,C,n,e,0)|0;Wb(n,e,ta);Vb(n,e,ta+8|0);wa=qa;xa=oa;break}case 2:{if(wb(ua,ta,D)|0){wa=qa;xa=oa}else{z=0;ya=98;break a}break}case 3:{if(xb(ua,ta,D)|0){wa=qa;xa=oa}else{z=0;ya=98;break a}break}case 4:{za=(oa|0)<0?0:oa;if(!(Qb(ua,n,0,1)|0)){ya=33;break a}Aa=c[w>>2]|0;if((Aa|0)==8){Ba=a[E+za>>0]|0;a[ta>>0]=Ba;a[ta+1>>0]=Ba;Ba=ta+2|0;a[Ba>>0]=0;a[Ba+1>>0]=0;a[Ba+2>>0]=0;a[Ba+3>>0]=0;a[Ba+4>>0]=0;a[Ba+5>>0]=0}else{Rb(Aa,c[F>>2]|0,G,n,e,0)|0;Xb(ta,e+za|0,4)}wa=qa;xa=za;break}case 5:{za=(oa|0)<0?0:oa;Aa=(qa|0)<0?3:qa;if(!(Qb(ua,n,0,1)|0)){ya=39;break a}Ba=c[H>>2]|0;Ca=ta+8|0;if((Ba|0)==8){Da=a[I+za>>0]|0;a[ta>>0]=Da;a[ta+1>>0]=Da;Da=ta+2|0;a[Da>>0]=0;a[Da+1>>0]=0;a[Da+2>>0]=0;a[Da+3>>0]=0;a[Da+4>>0]=0;a[Da+5>>0]=0;Da=a[I+Aa>>0]|0;a[Ca>>0]=Da;a[ta+9>>0]=Da;Da=ta+10|0;a[Da>>0]=0;a[Da+1>>0]=0;a[Da+2>>0]=0;a[Da+3>>0]=0;a[Da+4>>0]=0;a[Da+5>>0]=0}else{Rb(Ba,c[J>>2]|0,K,n,e,0)|0;Xb(ta,e+za|0,4);Xb(Ca,e+Aa|0,4)}wa=Aa;xa=za;break}case 9:case 8:{if(!(Qb(ua,n,0,0)|0)){ya=41;break a}if(!(Sb(n,e)|0))break a;Nb(ta,e);wa=qa;xa=oa;break}case 12:{if(!(Qb(ua,n,1,0)|0)){ya=50;break a}za=c[L>>2]|0;if((za|0)==8)Ob(ta,M);else Pb(ta,n,za)|0;wa=qa;xa=oa;break}case 18:{za=(oa|0)<0?0:oa;if(!(Qb(ua,n,0,1)|0)){ya=59;break a}Aa=c[N>>2]|0;if((Aa|0)!=8){Rb(Aa,c[P>>2]|0,Q,n,e,0)|0;if((za|0)==3)Wb(n,e,ta);else Pa[R&3](ta,e+za|0,4)}else{b[ta>>1]=d[O+za>>0]|0|3328;Aa=ta+2|0;a[Aa>>0]=a[463004]|0;a[Aa+1>>0]=a[463005]|0;a[Aa+2>>0]=a[463006]|0;a[Aa+3>>0]=a[463007]|0;a[Aa+4>>0]=a[463008]|0;a[Aa+5>>0]=a[463009]|0}wa=qa;xa=za;break}case 19:{za=(oa|0)<0?0:oa;Aa=(qa|0)<3?3:qa;if(yb(ua,ta,D,za,Aa)|0){wa=Aa;xa=za}else{z=0;ya=98;break a}break}case 22:{if(Qb(ua,n,0,0)|0){Rb(c[S>>2]|0,c[T>>2]|0,U,n,e,0)|0;Ea=1}else Ea=0;if(!V){ya=64;break a}if(!na){za=(y|0)==(ra<<2|0);Aa=f+(ra+ma<<4)|0;Ca=0;while(1){if(!za){Ba=0;do{Da=e+(Ca<<4)+(Ba<<2)|0;Fa=Ba<<2;a[Aa+Fa>>0]=a[Da>>0]|0;a[Aa+(Fa|1)>>0]=a[Da+1>>0]|0;a[Aa+(Fa|2)>>0]=a[Da+2>>0]|0;a[Aa+(Fa|3)>>0]=a[Da+3>>0]|0;Ba=Ba+1|0}while((Ba|0)!=(va|0))}Ca=Ca+1|0;if((Ca|0)==(j|0))break;else Aa=Aa+W|0}}if(Ea){wa=qa;xa=oa}else{z=0;ya=98;break a}break}case 25:case 24:{if(Qb(ua,n,0,0)|0){Rb(c[X>>2]|0,c[Y>>2]|0,Z,n,e,0)|0;Ga=1}else Ga=0;if(!$){ya=74;break a}if(!na){Aa=(y|0)==(ra<<2|0);Ca=f+(ra+ma<<3)|0;za=0;while(1){if(!Aa){Ba=0;do{Da=e+(za<<4)+(Ba<<2)|0;if(ba){Fa=c[Da>>2]|0;Ha=((Fa&255)*31|0)+128|0;Ia=((Fa>>>8&255)*63|0)+128|0;Ja=((Fa>>>16&255)*31|0)+128|0;Ka=((Ia>>>8)+Ia|0)>>>8<<5|((Ha>>>8)+Ha|0)>>>8<<11|((Ja>>>8)+Ja|0)>>>8}else{Ja=((d[Da+2>>0]|0)*31|0)+128|0;Ha=((d[Da+1>>0]|0)*63|0)+128|0;Ia=((d[Da>>0]|0)*31|0)+128|0;Ka=((Ha>>>8)+Ha|0)>>>8<<5|((Ja>>>8)+Ja|0)>>>8<<11|((Ia>>>8)+Ia|0)>>>8}Ia=Ba<<1;a[Ca+Ia>>0]=Ka;a[Ca+(Ia|1)>>0]=Ka>>>8;Ba=Ba+1|0}while((Ba|0)!=(va|0))}za=za+1|0;if((za|0)==(j|0))break;else Ca=Ca+aa|0}}if(Ga){wa=qa;xa=oa}else{z=0;ya=98;break a}break}case 29:{if(Qb(ua,n,0,0)|0){Rb(c[ca>>2]|0,c[da>>2]|0,ea,n,e,0)|0;La=1}else La=0;if(!$){ya=87;break a}if(!na){Ca=(y|0)==(ra<<2|0);za=f+(ra+ma<<3)|0;Aa=0;while(1){if(!Ca){Ba=0;do{Ia=c[e+(Aa<<4)+(Ba<<2)>>2]|0;Ja=((Ia&255)*15|0)+128|0;Ha=((Ia>>>8&255)*15|0)+128|0;Da=((Ia>>>16&255)*15|0)+128|0;Fa=((Da>>>8)+Da|0)>>>8<<4;Da=((Ia>>>24)*15|0)+128|0;Ia=Ba<<1;a[za+Ia>>0]=Fa|((Da>>>8)+Da|0)>>>8;a[za+(Ia|1)>>0]=(((Ja>>>8)+Ja|0)>>>8<<12|(Ha>>>8)+Ha&16128|Fa)>>>8;Ba=Ba+1|0}while((Ba|0)!=(va|0))}Aa=Aa+1|0;if((Aa|0)==(j|0))break;else za=za+aa|0}}if(La){wa=qa;xa=oa}else{z=0;ya=98;break a}break}default:{ya=94;break a}}while(0);ra=ra+1|0;va=ua+16|0;if(ra>>>0>=g>>>0){ja=xa;ka=wa;la=va;break b}else{oa=xa;qa=wa;sa=sa+4|0;ta=ta+m|0;ua=va}}}while(0);v=v+1|0;if(v>>>0>=h>>>0){z=1;ya=98;break}else{ga=ja;u=ka;ha=ha+4|0;ia=la}}switch(ya|0){case 25:{z=0;i=s;return z|0}case 33:{z=0;i=s;return z|0}case 39:{z=0;i=s;return z|0}case 41:break;case 50:{z=0;i=s;return z|0}case 59:{z=0;i=s;return z|0}case 64:{pa(475075,474791,9453,474827);break}case 74:{pa(475133,474791,9482,474827);break}case 87:{pa(475133,474791,9511,474827);break}case 94:{pa(475191,474791,9534,474827);break}case 95:{z=0;i=s;return z|0}case 98:{i=s;return z|0}}z=0;i=s;return z|0}function tb(b,f,g,h,j){b=b|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=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J&65535)>>>8&255;N=(M&255)<(B&255)?M:B;O=J>>>16&255;P=(O&255)<(C&255)?O:C;Q=J>>>24&255;J=(Q&255)<(D&255)?Q:D;R=(E&255)<(K&255)?K:E;K=(F&255)<(M&255)?M:F;M=(G&255)<(O&255)?O:G;O=(H&255)<(Q&255)?Q:H;I=I+1|0;if((I|0)==16){S=L;T=N;U=P;V=J;W=R;X=K;Y=M;Z=O;break}else{A=L;B=N;C=P;D=J;E=R;F=K;G=M;H=O}}H=a[501192+(V&255)>>0]|0;G=S&255;if(V<<24>>24==-1){F=a[500093+G>>0]|0;E=a[500093+(T&255)>>0]|0;if(((E|F)&255)>=32){z=17;break a}D=(F&255)<<10|(E&255)<<5|(d[500349+(U&255)>>0]|0)<<1|32768;if(D>>>0<65536)$=D;else{z=19;break a}}else{D=a[500349+G>>0]|0;G=a[500349+(T&255)>>0]|0;E=a[501448+(U&255)>>0]|0;if(!(((G|D)&255)<16&((E|H)&255)<8)){z=21;break a}F=(D&255)<<8|(H&255)<<12|(G&255)<<4|(E&255)<<1;if(F>>>0<65536)$=F;else{z=23;break a}}F=Z&255;E=a[501841+F>>0]|0;G=W&255;if((F+-239|0)>>>0<17){F=a[500680+G>>0]|0;H=a[500680+(X&255)>>0]|0;D=a[500680+(Y&255)>>0]|0;if(((H|F|D)&255)>=32){z=26;break a}C=(F&255)<<10|(H&255)<<5|D&255|32768;if(C>>>0>=65536){z=28;break a}aa=C<<16|$&65535}else{C=a[500936+G>>0]|0;G=a[500936+(X&255)>>0]|0;D=a[500936+(Y&255)>>0]|0;if(!((Z&255)<239?((G|C|D)&255)<16:0)){z=31;break a}H=(C&255)<<8|(E&255)<<12|(G&255)<<4|D&255;if(H>>>0>=65536){z=33;break a}aa=H<<16|$&65535}H=c[p>>2]|0;c[H+(y<<2)>>2]=aa;x=x+1|0;if(x>>>0>=g>>>0){ba=H;break}}u=u+1|0;if(u>>>0>=h>>>0){ca=ba;z=38;break}}switch(z|0){case 17:{pa(501721,474791,3147,501704);break}case 19:{pa(500638,474791,3176,501704);break}case 21:{pa(501754,474791,3164,501704);break}case 23:{pa(500638,474791,3176,501704);break}case 26:{pa(500605,474791,3154,501704);break}case 28:{pa(500638,474791,3176,501704);break}case 31:{pa(501797,474791,3171,501704);break}case 33:{pa(500638,474791,3176,501704);break}case 36:{da=0;break}case 38:{z=g+-1|0;ba=h+-1|0;if(!z)ea=0;else{u=z;aa=0;while(1){u=u>>>1;$=aa+1|0;if(!u){ea=$;break}else aa=$}}if(!ba)fa=0;else{aa=ba;u=0;while(1){aa=aa>>>1;$=u+1|0;if(!aa){fa=$;break}else u=$}}u=ea>>>0<fa>>>0?ea:fa;fa=u<<1;ea=(1<<fa)+-1|0;if((h|0)>0){aa=(g|0)>0;$=k+104|0;Z=k+108|0;Y=k+112|0;X=(g|0)==(h|0);W=l+32|0;U=m+32|0;T=n+4|0;V=l+36|0;S=m+36|0;t=n+8|0;v=l+40|0;r=m+40|0;x=l+16|0;w=l+4|0;H=l+20|0;D=m+16|0;G=m+4|0;E=m+20|0;C=l+8|0;F=l+24|0;B=m+8|0;A=m+24|0;I=g>>>0>h>>>0;O=o+4|0;M=o+16|0;K=o+20|0;R=o+8|0;J=o+12|0;P=o+24|0;N=o+28|0;L=o+32|0;Q=o+36|0;ga=o+48|0;ha=o+52|0;ia=o+40|0;ja=o+44|0;ka=o+56|0;la=o+60|0;ma=0;na=0;while(1){oa=na+-1|0;qa=0;do{ra=_(oa+qa&ba,g)|0;c[n+(qa<<2)>>2]=ca+(ra<<2);sa=0;do{ta=c[ca+((sa+-1&z)+ra<<2)>>2]|0;if(!(ta&32768)){ua=a[508839+(ta>>>12&7)>>0]|0;va=d[508831+(ta>>>1&7)>>0]|0;wa=d[508815+(ta>>>4&15)>>0]|0;xa=d[508815+(ta>>>8&15)>>0]|0}else{ua=-1;va=d[508815+(ta>>>1&15)>>0]|0;wa=d[508783+(ta>>>5&31)>>0]|0;xa=d[508783+(ta>>>10&31)>>0]|0}c[l+(sa<<4)+(qa<<2)>>2]=wa+xa+va+(ua&255);ya=ta>>>16;if(!(ya&32768)){za=a[508839+(ta>>>28&7)>>0]|0;Aa=d[508815+(ya&15)>>0]|0;Ba=d[508815+(ta>>>20&15)>>0]|0;Ca=d[508815+(ta>>>24&15)>>0]|0}else{za=-1;Aa=d[508783+(ya&31)>>0]|0;Ba=d[508783+(ta>>>21&31)>>0]|0;Ca=d[508783+(ta>>>26&31)>>0]|0}c[m+(sa<<4)+(qa<<2)>>2]=Ba+Ca+Aa+(za&255);sa=sa+1|0}while((sa|0)!=3);qa=qa+1|0}while((qa|0)!=3);if(aa){qa=(e[467106+(na>>8<<1)>>1]|0)<<16|(e[467106+((na&255)<<1)>>1]|0);oa=c[n>>2]|0;sa=c[T>>2]|0;ra=c[t>>2]|0;y=na>>u<<fa;ta=ma;ya=0;while(1){if(Qb(b+(ta<<4)|0,k,0,0)|0)Rb(c[$>>2]|0,c[Z>>2]|0,Y,k,o,0)|0;Da=qa|(e[467106+(ya>>8<<1)>>1]|0)<<17|(e[467106+((ya&255)<<1)>>1]|0)<<1;do if(!X){Ea=Da&ea;if(I){Fa=Ea|ya>>u<<fa;break}else{Fa=Ea|y;break}}else Fa=Da;while(0);c[f+(Fa<<3)+4>>2]=c[ca+(ta<<2)>>2];ya=ya+1|0;Da=ya&z;Ea=c[oa+(Da<<2)>>2]|0;if(!(Ea&32768)){Ga=a[508839+(Ea>>>12&7)>>0]|0;Ha=d[508831+(Ea>>>1&7)>>0]|0;Ia=d[508815+(Ea>>>4&15)>>0]|0;Ja=d[508815+(Ea>>>8&15)>>0]|0}else{Ga=-1;Ha=d[508815+(Ea>>>1&15)>>0]|0;Ia=d[508783+(Ea>>>5&31)>>0]|0;Ja=d[508783+(Ea>>>10&31)>>0]|0}c[W>>2]=Ia+Ja+Ha+(Ga&255);Ka=Ea>>>16;if(!(Ka&32768)){La=a[508839+(Ea>>>28&7)>>0]|0;Ma=d[508815+(Ka&15)>>0]|0;Na=d[508815+(Ea>>>20&15)>>0]|0;Oa=d[508815+(Ea>>>24&15)>>0]|0}else{La=-1;Ma=d[508783+(Ka&31)>>0]|0;Na=d[508783+(Ea>>>21&31)>>0]|0;Oa=d[508783+(Ea>>>26&31)>>0]|0}c[U>>2]=Na+Oa+Ma+(La&255);Ea=c[sa+(Da<<2)>>2]|0;if(!(Ea&32768)){Pa=a[508839+(Ea>>>12&7)>>0]|0;Qa=d[508831+(Ea>>>1&7)>>0]|0;Ra=d[508815+(Ea>>>4&15)>>0]|0;Sa=d[508815+(Ea>>>8&15)>>0]|0}else{Pa=-1;Qa=d[508815+(Ea>>>1&15)>>0]|0;Ra=d[508783+(Ea>>>5&31)>>0]|0;Sa=d[508783+(Ea>>>10&31)>>0]|0}c[V>>2]=Ra+Sa+Qa+(Pa&255);Ka=Ea>>>16;if(!(Ka&32768)){Ta=a[508839+(Ea>>>28&7)>>0]|0;Ua=d[508815+(Ka&15)>>0]|0;Va=d[508815+(Ea>>>20&15)>>0]|0;Wa=d[508815+(Ea>>>24&15)>>0]|0}else{Ta=-1;Ua=d[508783+(Ka&31)>>0]|0;Va=d[508783+(Ea>>>21&31)>>0]|0;Wa=d[508783+(Ea>>>26&31)>>0]|0}c[S>>2]=Va+Wa+Ua+(Ta&255);Ea=c[ra+(Da<<2)>>2]|0;if(!(Ea&32768)){Xa=a[508839+(Ea>>>12&7)>>0]|0;Ya=d[508831+(Ea>>>1&7)>>0]|0;Za=d[508815+(Ea>>>4&15)>>0]|0;_a=d[508815+(Ea>>>8&15)>>0]|0}else{Xa=-1;Ya=d[508815+(Ea>>>1&15)>>0]|0;Za=d[508783+(Ea>>>5&31)>>0]|0;_a=d[508783+(Ea>>>10&31)>>0]|0}c[v>>2]=Za+_a+Ya+(Xa&255);Da=Ea>>>16;if(!(Da&32768)){$a=a[508839+(Ea>>>28&7)>>0]|0;ab=d[508815+(Da&15)>>0]|0;bb=d[508815+(Ea>>>20&15)>>0]|0;cb=d[508815+(Ea>>>24&15)>>0]|0}else{$a=-1;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+Ea+Ab+Da|0;Da=c[la>>2]|0;Ab=hb-zb|0;Ea=((Da>>>24)+(Da&255)+(Da>>>8&255)+(Da>>>16&255)<<4)-zb<<4;Da=(hb|0)<(zb|0);zb=Da?0-Ab|0:Ab;Ab=Da?0-Ea|0:Ea;c[f+(Fa<<3)>>2]=((ob|0)>(vb*13|0)?12:(ob|0)>(vb<<3|0)?8:(ob|0)>(vb*3|0)?4:0)|((jb|0)>(nb*13|0)?3:(jb|0)>(nb<<3|0)?2:(jb|0)>(nb*3|0)&1)|((ub|0)>(sb*13|0)?768:(ub|0)>(sb<<3|0)?512:(ub|0)>(sb*3|0)?256:0)|((wb|0)>(Bb*13|0)?3072:(wb|0)>(Bb<<3|0)?2048:(wb|0)>(Bb*3|0)?1024:0)|((Db|0)>(Hb*13|0)?48:(Db|0)>(Hb<<3|0)?32:(Db|0)>(Hb*3|0)?16:0)|((Gb|0)>(kb*13|0)?192:(Gb|0)>(kb<<3|0)?128:(Gb|0)>(kb*3|0)?64:0)|((qb|0)>(Eb*13|0)?12288:(qb|0)>(Eb<<3|0)?8192:(qb|0)>(Eb*3|0)?4096:0)|((gb|0)>(lb*13|0)?49152:(gb|0)>(lb<<3|0)?32768:(gb|0)>(lb*3|0)?16384:0)|((Kb|0)>(Pb*13|0)?196608:(Kb|0)>(Pb<<3|0)?131072:(Kb|0)>(Pb*3|0)?65536:0)|((Ob|0)>(Mb*13|0)?786432:(Ob|0)>(Mb<<3|0)?524288:(Ob|0)>(Mb*3|0)?262144:0)|((Nb|0)>(db*13|0)?50331648:(Nb|0)>(db<<3|0)?33554432:(Nb|0)>(db*3|0)?16777216:0)|((Lb|0)>(Jb*13|0)?201326592:(Lb|0)>(Jb<<3|0)?134217728:(Lb|0)>(Jb*3|0)?67108864:0)|((tb|0)>(xb*13|0)?3145728:(tb|0)>(xb<<3|0)?2097152:(tb|0)>(xb*3|0)?1048576:0)|((ib|0)>(pb*13|0)?12582912:(ib|0)>(pb<<3|0)?8388608:(ib|0)>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ia=da>>>16&255;da=(ia&255)<(T&255)?ia:T;ja=(U&255)<(ea&255)?ea:U;ea=(aa&255)<(ga&255)?ga:aa;ga=(ba&255)<(ia&255)?ia:ba;ca=ca+1|0;if((ca|0)==16){V=da;W=ha;X=fa;Y=ga;Z=ea;$=ja;break}else{S=fa;R=ha;T=da;U=ja;aa=ea;ba=ga}}}ba=(d[500349+(V&255)>>0]|0)<<1;if(ba>>>0>=32){Q=17;break a}aa=ba|(d[500093+(W&255)>>0]|0)<<5|(d[500093+(X&255)>>0]|0)<<10|32768;if(aa>>>0>=65536){Q=19;break a}ba=d[500680+(Y&255)>>0]|0|(d[500680+(Z&255)>>0]|0)<<5|(d[500680+($&255)>>0]|0)<<10|32768;if(ba>>>0>=65536){Q=21;break a}U=c[q>>2]|0;c[U+(P<<2)>>2]=ba<<16|aa&65534;O=O+1|0;if(O>>>0>=g>>>0){ka=U;break}}M=M+1|0;if(M>>>0>=h>>>0){la=ka;Q=25;break}}if((Q|0)==17)pa(500605,474791,3082,500067);else if((Q|0)==19)pa(500638,474791,3092,500067);else if((Q|0)==21)pa(500638,474791,3123,500655);else if((Q|0)==23)ma=0;else if((Q|0)==25){ka=g+-1|0;M=h+-1|0;if(!ka)na=0;else{$=ka;Z=0;while(1){$=$>>>1;Y=Z+1|0;if(!$){na=Y;break}else Z=Y}}if(!M)oa=0;else{Z=M;$=0;while(1){Z=Z>>>1;Y=$+1|0;if(!Z){oa=Y;break}else $=Y}}$=na>>>0<oa>>>0?na:oa;oa=$<<1;na=(1<<oa)+-1|0;b:do if((h|0)>0){Z=(g|0)>0;Y=l+104|0;X=l+108|0;W=l+112|0;V=(g|0)==(h|0);L=m+32|0;K=n+32|0;J=o+4|0;I=m+36|0;H=n+36|0;G=o+8|0;F=m+40|0;E=n+40|0;D=m+16|0;C=m+4|0;B=m+20|0;A=n+16|0;z=n+4|0;y=n+20|0;x=m+8|0;v=m+24|0;u=n+8|0;w=n+24|0;s=g>>>0>h>>>0;O=ka&1;N=p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1;do if(!V){_b=Zb&na;if(s){$b=_b|Xb>>$<<oa;break}else{$b=_b|Wb;break}}else $b=Zb;while(0);c[f+($b<<3)+4>>2]=c[la+(Yb<<2)>>2];Xb=Xb+1|0;Zb=Xb&ka;_b=c[Tb+(Zb<<2)>>2]|0;if(!(_b&32768)){Q=48;break c}ac=_b&30;c[L>>2]=((((_b>>>10&31)+(_b>>>5&31)+(ac>>>4|ac)|0)*255|0)>>>0)/31|0;ac=_b>>>16;if(!(ac&32768)){Q=50;break c}c[K>>2]=((((_b>>>26&31)+(_b>>>21&31)+(ac&31)|0)*255|0)>>>0)/31|0;ac=c[P+(Zb<<2)>>2]|0;if(!(ac&32768)){Q=52;break c}_b=ac&30;c[I>>2]=((((ac>>>10&31)+(ac>>>5&31)+(_b>>>4|_b)|0)*255|0)>>>0)/31|0;_b=ac>>>16;if(!(_b&32768)){Q=54;break c}c[H>>2]=((((ac>>>26&31)+(ac>>>21&31)+(_b&31)|0)*255|0)>>>0)/31|0;_b=c[Vb+(Zb<<2)>>2]|0;if(!(_b&32768)){Q=56;break c}Zb=_b&30;c[F>>2]=((((_b>>>10&31)+(_b>>>5&31)+(Zb>>>4|Zb)|0)*255|0)>>>0)/31|0;Zb=_b>>>16;if(!(Zb&32768)){Q=58;break c}ac=((((_b>>>26&31)+(_b>>>21&31)+(Zb&31)|0)*255|0)>>>0)/31|0;c[E>>2]=ac;Zb=c[m>>2]|0;_b=c[D>>2]|0;bc=c[C>>2]|0;cc=c[B>>2]|0;dc=c[n>>2]|0;ec=c[A>>2]|0;fc=c[z>>2]|0;gc=c[y>>2]|0;hc=_b+Zb+bc+cc<<2;ic=ec+dc+fc+gc<<2;jc=c[p>>2]|0;kc=ic-hc|0;lc=((jc>>>8&255)+(jc&255)+(jc>>>16&255)<<4)-hc<<4;jc=(ic|0)<(hc|0);hc=jc?0-lc|0:lc;lc=jc?0-kc|0:kc;kc=Zb<<1;jc=_b*6|0;ic=cc*6|0;mc=jc+kc+(bc<<1)+ic|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288:(oc|0)>(Cc<<3|0)?8192:(oc|0)>(Cc*3|0)?4096:0)|((ec|0)>(jc*13|0)?49152:(ec|0)>(jc<<3|0)?32768:(ec|0)>(jc*3|0)?16384:0)|((Ic|0)>(Qc*13|0)?196608:(Ic|0)>(Qc<<3|0)?131072:(Ic|0)>(Qc*3|0)?65536:0)|((Pc|0)>(Nc*13|0)?786432:(Pc|0)>(Nc<<3|0)?524288:(Pc|0)>(Nc*3|0)?262144:0)|((Oc|0)>(bc*13|0)?50331648:(Oc|0)>(bc<<3|0)?33554432:(Oc|0)>(bc*3|0)?16777216:0)|((Jc|0)>(Hc*13|0)?201326592:(Jc|0)>(Hc<<3|0)?134217728:(Jc|0)>(Hc*3|0)?67108864:0)|((rc|0)>(vc*13|0)?3145728:(rc|0)>(vc<<3|0)?2097152:(rc|0)>(vc*3|0)?1048576:0)|((gc|0)>(nc*13|0)?12582912:(gc|0)>(nc<<3|0)?8388608:(gc|0)>(nc*3|0)?4194304:0)|((Gc|0)>(cc*13|0)?805306368:(Gc|0)>(cc<<3|0)?536870912:(Gc|0)>(cc*3|0)?268435456:0)|((yc|0)>(xc*13|0)?-1073741824:(yc|0)>(xc<<3|0)?-2147483648:(yc|0)>(xc*3|0)?1073741824:0);c[m>>2]=c[D>>2];c[D>>2]=c[L>>2];c[C>>2]=c[B>>2];c[B>>2]=c[I>>2];c[x>>2]=c[v>>2];c[v>>2]=c[F>>2];c[n>>2]=c[A>>2];c[A>>2]=c[K>>2];c[z>>2]=c[y>>2];c[y>>2]=c[H>>2];c[u>>2]=c[w>>2];c[w>>2]=c[E>>2];xc=Yb+1|0;if((Xb|0)>=(g|0)){Rc=xc;break}else Yb=xc}}else Rc=Pb;Sb=Sb+1|0;if((Sb|0)>=(h|0))break b;else Pb=Rc}if((Q|0)==33)pa(508721,474791,3304,508737);else if((Q|0)==35)pa(508721,474791,3319,508760);else if((Q|0)==48)pa(508721,474791,3304,508737);else if((Q|0)==50)pa(508721,474791,3319,508760);else if((Q|0)==52)pa(508721,474791,3304,508737);else if((Q|0)==54)pa(508721,474791,3319,508760);else if((Q|0)==56)pa(508721,474791,3304,508737);else if((Q|0)==58)pa(508721,474791,3319,508760)}while(0);ma=1}Q=c[q>>2]|0;if(!Q){r=ma;i=j;return r|0}q=c[t>>2]|0;if((q|0)!=(Q|0))c[t>>2]=q+(~((q+-4-Q|0)>>>2)<<2);Mc(Q);r=ma;i=j;return r|0}function vb(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,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,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,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,ab=0,bb=0,cb=0;h=i;i=i+336|0;j=h+168|0;k=h+104|0;l=h+320|0;m=h+24|0;n=h+16|0;o=h+96|0;p=h+80|0;q=h+72|0;r=h+64|0;s=h+48|0;t=h+8|0;u=h+32|0;v=h;if(!(Qb(b,j,0,1)|0)){w=0;i=h;return w|0}b=c[j+104>>2]|0;if((b|0)==8){if(g>>>0>=4)pa(499740,499604,685,499748);x=e[22684+((d[j+112+g>>0]|0)<<1)>>1]|0;y=x>>>7;a[f+3>>0]=y<<2|y<<5|2;y=x<<3&255;a[f>>0]=y;a[f+1>>0]=y;a[f+2>>0]=y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(S){C=n+(k<<2)|0;j=L;K=b;Z=aa;T=0;while(1){V=T+aa|0;W=d[l+(V<<2)>>0]|0;if(W>>>0<ia>>>0){ja=26;break a}U=c[C>>2]|0;if(W>>>0>U>>>0){ja=26;break a}Y=W-ia|0;if(Y>>>0>=4){ja=28;break a}W=d[491170+(c[p+(Y<<2)>>2]|0)>>0]|0;Y=Z+4|0;X=d[l+(V<<2)+1>>0]|0;if(X>>>0<ia>>>0|X>>>0>U>>>0){ja=26;break a}ka=X-ia|0;if(ka>>>0>=4){ja=28;break a}X=d[491170+(c[p+(ka<<2)>>2]|0)>>0]|0;ka=Z+8|0;la=d[l+(V<<2)+2>>0]|0;if(la>>>0<ia>>>0|la>>>0>U>>>0){ja=26;break a}ma=la-ia|0;if(ma>>>0>=4){ja=28;break a}la=d[491170+(c[p+(ma<<2)>>2]|0)>>0]|0;ma=Z+12|0;na=d[l+(V<<2)+3>>0]|0;if(na>>>0<ia>>>0|na>>>0>U>>>0){ja=26;break a}U=na-ia|0;if(U>>>0>=4){ja=28;break a}na=d[491170+(c[p+(U<<2)>>2]|0)>>0]|0;U=((na&1)<<ma|((la&1)<<ka|((X&1)<<Y|((W&1)<<Z|K&65535))))&65535;V=(na>>>1<<ma|(la>>>1<<ka|(X>>>1<<Y|(W>>>1<<Z|j&65535))))&65535;T=T+1|0;if(T>>>0>=2){oa=V;qa=U;break}else{j=V;K=U;Z=Z+1|0}}}else{Z=n+(k<<2)|0;K=L;j=b;T=k<<3;C=0;while(1){U=C+aa|0;V=d[l+U>>0]|0;if(V>>>0<ia>>>0){ja=33;break a}W=c[Z>>2]|0;if(V>>>0>W>>>0){ja=33;break a}Y=V-ia|0;if(Y>>>0>=4){ja=35;break a}V=d[491170+(c[p+(Y<<2)>>2]|0)>>0]|0;Y=T|1;X=d[l+4+U>>0]|0;if(X>>>0<ia>>>0|X>>>0>W>>>0){ja=33;break a}ka=X-ia|0;if(ka>>>0>=4){ja=35;break a}X=d[491170+(c[p+(ka<<2)>>2]|0)>>0]|0;ka=T|2;la=d[l+8+U>>0]|0;if(la>>>0<ia>>>0|la>>>0>W>>>0){ja=33;break a}ma=la-ia|0;if(ma>>>0>=4){ja=35;break a}la=d[491170+(c[p+(ma<<2)>>2]|0)>>0]|0;ma=T|3;na=d[l+12+U>>0]|0;if(na>>>0<ia>>>0|na>>>0>W>>>0){ja=33;break a}W=na-ia|0;if(W>>>0>=4){ja=35;break a}na=d[491170+(c[p+(W<<2)>>2]|0)>>0]|0;W=((na&1)<<ma|((la&1)<<ka|((X&1)<<Y|((V&1)<<T|j&65535))))&65535;U=(na>>>1<<ma|(la>>>1<<ka|(X>>>1<<Y|(V>>>1<<T|K&65535))))&65535;C=C+1|0;if(C>>>0>=2){oa=U;qa=W;break}else{K=U;j=W;T=T+4|0}}}T=k+1|0;if(T>>>0>=2){ra=oa;sa=qa;ja=39;break}y=c[o+(T<<2)>>2]|0;x=R;B=$;D=z;H=I;L=oa;b=qa;k=T}if((ja|0)==21)pa(491086,474791,14053,491097);else if((ja|0)==26)pa(491121,474791,14071,491097);else if((ja|0)==28)pa(491163,474791,14073,491097);else if((ja|0)==33)pa(491121,474791,14094,491097);else if((ja|0)==35)pa(491163,474791,14096,491097);else if((ja|0)==39){a[f+7>>0]=sa;a[f+6>>0]=(sa&65535)>>>8;a[f+5>>0]=ra;a[f+4>>0]=(ra&65535)>>>8;break}}else{k=S?O:Q;b=(((k*31|0)+127|0)>>>0)/255|0;L=S?P:N;H=((((L*31|0)+127|0)>>>0)/255|0)-b|0;if((H+4|0)>>>0>7){D=(((k*15|0)+127|0)>>>0)/255|0;k=(((L*15|0)+127|0)>>>0)/255|0;L=D<<4;B=(k|L)&255;a[f>>0]=B;ta=q+4|0;ua=L|D;va=B;wa=ba;xa=k<<4|k;ya=0}else{k=(H|0)<-4?-4:(H|0)>3?3:H;H=k+b|0;B=b<<3;D=(((k|0)<0?k+8|0:k)|B)&255;a[f>>0]=D;k=(S&1|2)&255;a[ca>>0]=k;ta=q+4|0;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ha>>>0>=4){ja=66;break b}Ga=d[491170+(c[s+(Ha<<2)>>2]|0)>>0]|0;Ha=I|2;Ia=d[l+8+Ea>>0]|0;if(Ia>>>0<Aa>>>0|Ia>>>0>Da>>>0){ja=64;break b}Ja=Ia-Aa|0;if(Ja>>>0>=4){ja=66;break b}Ia=d[491170+(c[s+(Ja<<2)>>2]|0)>>0]|0;Ja=I|3;Ka=d[l+12+Ea>>0]|0;if(Ka>>>0<Aa>>>0|Ka>>>0>Da>>>0){ja=64;break b}Da=Ka-Aa|0;if(Da>>>0>=4){ja=66;break b}Ka=d[491170+(c[s+(Da<<2)>>2]|0)>>0]|0;Da=((Ka&1)<<Ja|((Ia&1)<<Ha|((Ga&1)<<Fa|((Ca&1)<<I|R&65535))))&65535;Ea=(Ka>>>1<<Ja|(Ia>>>1<<Ha|(Ga>>>1<<Fa|(Ca>>>1<<I|z&65535))))&65535;na=na+1|0;if(na>>>0>=2){La=$;Ma=Ea;Na=Da;break}else{z=Ea;R=Da;I=I+4|0}}}}else ja=68;do if((ja|0)==68){ja=0;I=c[q+(la<<2)>>2]|0;R=0-I|0;z=255-I|0;if((z|I|0)<=-1){ja=69;break b}$=c[r+(la<<2)>>2]|0;if($>>>0<52){na=$>>>0>22?14:15;ma=($+-4|0)>>>0>35?na&13:na;na=$>>>0<9?ma&11:ma;Oa=$>>>0<12?na&7:na}else{na=$>>>0>60?248:252;ma=$>>>0>89?na&244:na;na=$>>>0>120?ma&236:ma;ma=$>>>0>136?na&220:na;Oa=$>>>0>174?ma&188:ma}ma=n+(la<<2)|0;$=la<<1;na=m+(la<<2)|0;Ba=$|1;Da=$|1;Ea=$|1;Ca=-1;Fa=0;Ga=0;while(1){if(1<<Ga&Oa){Ha=c[17484+(Ga<<4)>>2]|0;Ia=(Ha|0)>(R|0)?Ha:R;Ha=c[17484+(Ga<<4)+4>>2]|0;Ja=(Ha|0)>(R|0)?Ha:R;Ha=c[17484+(Ga<<4)+8>>2]|0;Ka=(Ha|0)<(z|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[aa>>0]|0;Ja=Ba+2|0;Qa=d[W>>0]|0;Pa=Ba+3|0;Ha=d[U>>0]|0;Ia=Ca|7;Ka=d[V>>0]|0;La=Fa;Ma=(Ka>>>1<<Ia|(Ha>>>1<<Pa|(Qa>>>1<<Ja|(R>>>1<<z|(ma>>>1<<Ba|(na>>>1<<Ea|(I>>>1<<Da|(Ga>>>1<<Ca|X&65535))))))))&65535;Na=((Ka&1)<<Ia|((Ha&1)<<Pa|((Qa&1)<<Ja|((R&1)<<z|((ma&1)<<Ba|((na&1)<<Ea|((I&1)<<Da|((Ga&1)<<Ca|ka&65535))))))))&65535;break}}while(0);la=la+1|0;if(la>>>0>=2){bb=Ma;cb=Na;ja=99;break}else{Y=La;X=Ma;ka=Na}}if((ja|0)==52)pa(491086,474791,14170,491097);else if((ja|0)==57)pa(491121,474791,14194,491097);else if((ja|0)==59)pa(491163,474791,14196,491097);else if((ja|0)==64)pa(491121,474791,14217,491097);else if((ja|0)==66)pa(491163,474791,14219,491097);else if((ja|0)==69)pa(491174,474791,14243,491097);else if((ja|0)==76)pa(491208,474791,14293,491097);else if((ja|0)==78)pa(491247,474791,14301,491097);else if((ja|0)==99){a[f+7>>0]=cb;a[f+6>>0]=(cb&65535)>>>8;a[f+5>>0]=bb;a[f+4>>0]=(bb&65535)>>>8;break}}while(0);w=1;i=h;return w|0}function wb(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;g=i;i=i+224|0;h=g+64|0;j=g;if(!(Qb(b,h,0,1)|0)){k=0;i=g;return k|0}b=h+104|0;l=c[b>>2]|0;if((l|0)==8){m=c[h+112>>2]|0;n=m&255;o=m>>>8&255;p=m>>>16&255;m=d[468643+(o<<1)>>0]<<5|d[467619+(n<<1)>>0]<<11|d[467619+(p<<1)>>0];q=d[468643+(o<<1)+1>>0]<<5|d[467619+(n<<1)+1>>0]<<11|d[467619+(p<<1)+1>>0];if((q|0)==(m|0))if(!m){r=1;s=0;t=0;u=0;v=85}else{w=m+-1|0;x=0;y=6}else{w=q;x=170;y=6}if((y|0)==6){y=m>>>0<w>>>0;q=y?w:m;p=y?m:w;r=q&255;s=p&255;t=(q&65535)>>>8&255;u=(p&65535)>>>8&255;v=(y?x|85:x)&255}a[e>>0]=r;a[e+1>>0]=t;a[e+2>>0]=s;a[e+3>>0]=u;Hd(e+4|0,v|0,4)|0;k=1;i=g;return k|0}if(!f?(a[h+116>>0]|0)!=0:0){$b(h,e);k=1;i=g;return k|0}Rb(l,c[h+108>>2]|0,h+112|0,h,j,0)|0;if(!(a[h+117>>0]|0))Yb(e,j,f&1);else{l=c[b>>2]|0;a[e>>0]=1;a[e+1>>0]=0;a[e+2>>0]=0;a[e+3>>0]=0;b=c[17612+(d[476832+l>>0]<<2)>>2]|0;v=(d[476908+l>>0]|0)+-1|0;l=15;u=0;while(1){s=d[b+(d[(l<<v)+(h+39)>>0]|0)>>0]|u<<2;if((l|0)>0){l=l+-1|0;u=s}else{z=s;A=u;break}}a[e+4>>0]=z;a[e+5>>0]=A>>>6;a[e+6>>0]=A>>>14;a[e+7>>0]=A>>>22;Yb(e,j,f&1|4)}k=1;i=g;return k|0}function xb(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;h=i;i=i+224|0;j=h+64|0;k=h;if(!(Qb(e,j,0,1)|0)){l=0;i=h;return l|0}e=j+104|0;m=c[e>>2]|0;n=f+8|0;if((m|0)==8){o=j+112|0;p=a[o+3>>0]|0;a[f>>0]=p;a[f+1>>0]=p;p=f+2|0;a[p>>0]=0;a[p+1>>0]=0;a[p+2>>0]=0;a[p+3>>0]=0;a[p+4>>0]=0;a[p+5>>0]=0;p=c[o>>2]|0;o=p&255;q=p>>>8&255;r=p>>>16&255;p=(d[468643+(q<<1)>>0]|0)<<5|(d[467619+(o<<1)>>0]|0)<<11|(d[467619+(r<<1)>>0]|0);s=(d[468643+(q<<1)+1>>0]|0)<<5|(d[467619+(o<<1)+1>>0]|0)<<11|(d[467619+(r<<1)+1>>0]|0);if((s|0)==(p|0))if(!p){t=1;u=0;v=0;w=0;x=85}else{y=p+-1|0;z=0;A=6}else{y=s;z=170;A=6}if((A|0)==6){s=p>>>0<y>>>0;r=s?y:p;o=s?p:y;t=r&255;u=o&255;v=(r&65535)>>>8&255;w=(o&65535)>>>8&255;x=(s?z|85:z)&255}a[n>>0]=t;a[f+9>>0]=v;a[f+10>>0]=u;a[f+11>>0]=w;Hd(f+12|0,x|0,4)|0;l=1;i=h;return l|0}Rb(m,c[j+108>>2]|0,j+112|0,j,k,0)|0;Xb(f,k+3|0,4);do if(!g){m=b[j+116>>1]|0;if(!((m&255)<<24>>24)){B=(m&65535)>>>8&255;A=13;break}else{$b(j,n);break}}else{B=a[j+117>>0]|0;A=13}while(0);do if((A|0)==13){if(!(B<<24>>24)){Yb(n,k,g&1);break}m=c[e>>2]|0;a[n>>0]=1;a[f+9>>0]=0;a[f+10>>0]=0;a[f+11>>0]=0;x=c[17612+((d[476832+m>>0]|0)<<2)>>2]|0;w=(d[476908+m>>0]|0)+-1|0;m=15;u=0;while(1){v=d[x+(d[(m<<w)+(j+39)>>0]|0)>>0]|0|u<<2;if((m|0)>0){m=m+-1|0;u=v}else{C=v;D=u;break}}a[f+12>>0]=C;a[f+13>>0]=D>>>6;a[f+14>>0]=D>>>14;a[f+15>>0]=D>>>22;Yb(n,k,g&1|4)}while(0);l=1;i=h;return l|0}function yb(e,f,g,h,j){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;k=i;i=i+224|0;l=k+64|0;m=k;if(!(Qb(e,l,0,1)|0)){n=0;i=k;return n|0}e=c[l+104>>2]|0;if((e|0)==8){o=l+112|0;b[f>>1]=d[o+h>>0]|0|3328;p=f+2|0;a[p>>0]=a[463004]|0;a[p+1>>0]=a[463005]|0;a[p+2>>0]=a[463006]|0;a[p+3>>0]=a[463007]|0;a[p+4>>0]=a[463008]|0;a[p+5>>0]=a[463009]|0;b[f+8>>1]=d[o+j>>0]|0|3328;o=f+10|0;a[o>>0]=a[463004]|0;a[o+1>>0]=a[463005]|0;a[o+2>>0]=a[463006]|0;a[o+3>>0]=a[463007]|0;a[o+4>>0]=a[463008]|0;a[o+5>>0]=a[463009]|0;n=1;i=k;return n|0}Rb(e,c[l+108>>2]|0,l+112|0,l,m,0)|0;if((h|0)==3)Wb(l,m,f);else Pa[(g?2:1)&3](f,m+h|0,4);if((j|0)==3)Wb(l,m,f+8|0);else Pa[(g?2:1)&3](f+8|0,m+j|0,4);n=1;i=k;return n|0}function zb(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){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;o=o|0;p=p|0;q=q|0;r=r|0;s=s|0;t=t|0;u=u|0;var v=0,w=0,x=0,y=0,z=0,A=0,B=0,D=0;r=Kd(m|0,0,l|0,0)|0;p=C;if(p>>>0>0|(p|0)==0&r>>>0>f>>>0){v=0;return v|0}f=(b|0)==9;if((b&-2|0)==8){r=g<<2;if(!r){v=0;return v|0}if(r+-1&r){v=0;return v|0}r=h<<2;if(!r){v=0;return v|0}if(r+-1&r){v=0;return v|0}}r=f?(o?b:8):b;b=n>>>2;switch(r|0){case 20:case 19:case 18:case 11:case 9:case 8:case 4:case 2:case 0:{w=8;x=11;break}case 21:case 17:case 12:case 10:case 5:case 3:case 1:case 7:case 6:{w=16;x=11;break}case 13:{y=4;x=12;break}case 16:case 15:case 14:{w=2;x=11;break}default:pa(475191,474791,10833,475639)}if((x|0)==11)if((r+-13|0)>>>0>=4)if((_(h,g)|0)>>>0>d>>>0|(r|0)==17){v=0;return v|0}else z=w;else{y=w;x=12}if((x|0)==12)if((_((s|0)==0?j:s,(q|0)==0?i:q)|0)>>>0>d>>>0){v=0;return v|0}else z=y;do switch(r|0){case 0:{v=sb(0,c,g,h,e+l|0,m,0,z,0,o,i,j,q,0,s,t,u,0)|0;return v|0}case 1:{v=sb(0,c,g,h,e+l|0,m,1,z,0,o,i,j,q,0,s,t,u,0)|0;return v|0}case 2:{if((_(g<<4,h)|0)>>>0>m>>>0){v=0;return v|0}if(!h){v=1;return v|0}y=_(z,(q|0)==0?g:q)|0;d=(g|0)==0;w=0;n=e+l|0;a:while(1){if(d)A=n;else{f=0;p=c+(_(y,w)|0)|0;k=n;while(1){if(!(wb(k,p,0)|0)){v=0;x=55;break a}f=f+1|0;a=k+16|0;if(f>>>0>=g>>>0){A=a;break}else{p=p+z|0;k=a}}}w=w+1|0;if(w>>>0>=h>>>0){v=1;x=55;break}else n=A}if((x|0)==55)return v|0;break}case 3:{if((_(g<<4,h)|0)>>>0>m>>>0){v=0;return v|0}if(!h){v=1;return v|0}n=_(z,(q|0)==0?g:q)|0;w=(g|0)==0;y=0;d=e+l|0;b:while(1){if(w)B=d;else{k=0;p=c+(_(n,y)|0)|0;f=d;while(1){if(!(xb(f,p,0)|0)){v=0;x=55;break b}k=k+1|0;a=f+16|0;if(k>>>0>=g>>>0){B=a;break}else{p=p+z|0;f=a}}}y=y+1|0;if(y>>>0>=h>>>0){v=1;x=55;break}else d=B}if((x|0)==55)return v|0;break}case 4:{v=sb(0,c,g,h,e+l|0,m,4,z,0,o,i,j,q,0,s,(b&1|0)!=0&o?3:0,-1,0)|0;return v|0}case 5:{v=sb(0,c,g,h,e+l|0,m,5,z,0,o,i,j,q,0,s,0,3,0)|0;return v|0}case 7:case 6:{v=sb(0,c,g,h,e+l|0,m,8,z,0,o,i,j,q,0,s,-1,-1,0)|0;return v|0}case 8:{if((_(g<<4,h)|0)>>>0>m>>>0){v=0;return v|0}ub(e+l|0,c,g,h,0,0)|0;v=1;return v|0}case 9:{if((_(g<<4,h)|0)>>>0>m>>>0){v=0;return v|0}tb(e+l|0,c,g,h,0)|0;v=1;return v|0}case 10:{v=sb(0,c,g,h,e+l|0,m,12,z,0,o,i,j,q,0,s,-1,-1,0)|0;return v|0}case 20:{v=sb(0,c,g,h,e+l|0,m,18,z,0,o,i,j,q,0,s,(b&1|0)!=0&o?3:0,-1,0)|0;return v|0}case 21:{if((_(g<<4,h)|0)>>>0>m>>>0){v=0;return v|0}if(!h){v=1;return v|0}d=_(z,(q|0)==0?g:q)|0;y=(g|0)==0;n=0;w=e+l|0;c:while(1){if(y)D=w;else{f=0;p=c+(_(d,n)|0)|0;k=w;while(1){if(!(yb(k,p,0,0,3)|0)){v=0;x=55;break c}f=f+1|0;a=k+16|0;if(f>>>0>=g>>>0){D=a;break}else{p=p+z|0;k=a}}}n=n+1|0;if(n>>>0>=h>>>0){v=1;x=55;break}else w=D}if((x|0)==55)return v|0;break}case 13:{v=sb(0,c,g,h,e+l|0,m,22,z,0,o,i,j,q,0,s,-1,-1,0)|0;return v|0}case 14:{v=sb(0,c,g,h,e+l|0,m,24,z,0,o,i,j,q,0,s,-1,-1,0)|0;return v|0}case 15:{v=sb(0,c,g,h,e+l|0,m,25,z,0,o,i,j,q,0,s,-1,-1,0)|0;return v|0}case 16:{v=sb(0,c,g,h,e+l|0,m,29,z,0,o,i,j,q,0,s,-1,-1,0)|0;return v|0}case 19:case 18:case 17:case 12:case 11:{v=0;return v|0}default:pa(475191,474791,9841,475222)}while(0);return 0}function Ab(b,d){b=b|0;d=d|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;c[b+24>>2]=d;Hd(b+28|0,0,148)|0;fb(b+176|0);a[b+585>>0]=0;return}function Bb(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0;if(e>>>0<78)return 0;if((d[c+1>>0]<<8|d[c>>0]|0)!=17011)return 0;if((d[c+3>>0]<<8|d[c+2>>0]|0)!=19)return 0;if((d[c+5>>0]<<8|d[c+4>>0]|0)!=77)return 0;if(((d[c+10>>0]<<16|d[c+11>>0]<<24|d[c+9>>0]<<8|d[c+8>>0])+77|0)>>>0>e>>>0)return 0;b=d[c+18>>0]<<8|d[c+19>>0]<<16|d[c+17>>0];if(!b)return 0;f=d[c+14>>0]|0;g=d[c+15>>0]<<8|d[c+16>>0]<<16|f;if((g|0)==0|b>>>0>g>>>0)return 0;b=a[c+21>>0]|0;h=b&255;if(!(a[c+20>>0]|0)){if((h&4|0)!=0&(f&1|0)!=0|(b&1)==0)return 0}else if(h&1)return 0;h=d[c+67>>0]<<16|d[c+68>>0]<<24|d[c+66>>0]<<8|d[c+65>>0];if(h>>>0<e>>>0)return (e-h|0)>>>0>=(g*23|0)>>>0|0;else return 0;return 0}function Cb(a,b,c){a=a|0;b=b|0;c=c|0;var e=0;if(c>>>0<78)return 0;if(((d[b+1>>0]|0)<<8|(d[b>>0]|0)|0)!=17011)return 0;if(((d[b+3>>0]|0)<<8|(d[b+2>>0]|0)|0)!=19)return 0;if(((d[b+5>>0]|0)<<8|(d[b+4>>0]|0)|0)!=77)return 0;if((((d[b+10>>0]|0)<<16|(d[b+11>>0]|0)<<24|(d[b+9>>0]|0)<<8|(d[b+8>>0]|0))+77|0)>>>0>c>>>0)return 0;a=(d[b+15>>0]|0)<<8|(d[b+16>>0]|0)<<16|(d[b+14>>0]|0);if(!a)return 0;if(!((d[b+18>>0]|0)<<8|(d[b+19>>0]|0)<<16|(d[b+17>>0]|0)))return 0;e=(d[b+67>>0]|0)<<16|(d[b+68>>0]|0)<<24|(d[b+66>>0]|0)<<8|(d[b+65>>0]|0);if(e>>>0<c>>>0)return (c-e|0)>>>0>=(a*23|0)>>>0|0;else return 0;return 0}function Db(a,b,c){a=a|0;b=b|0;c=c|0;var e=0;if(!(Cb(0,b,c)|0)){e=0;return e|0}e=(d[b+18>>0]|0)<<8|(d[b+19>>0]|0)<<16|(d[b+17>>0]|0);return e|0}function Eb(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;if(!(Cb(0,e,f)|0)){i=0;return i|0}f=d[e+15>>0]<<8|d[e+16>>0]<<16|d[e+14>>0];if(!f){i=0;return i|0}b=e+(d[e+67>>0]<<16|d[e+68>>0]<<24|d[e+66>>0]<<8|d[e+65>>0])|0;j=0;while(1){if((d[b+(j*23|0)+1>>0]<<8|d[b+(j*23|0)+2>>0]<<16|d[b+(j*23|0)>>0]|0)==(h|0)?(a[b+(j*23|0)+3>>0]|0)==0:0){k=j;break}j=j+1|0;if(j>>>0>=f>>>0){i=0;l=17;break}}if((l|0)==17)return i|0;if((k|0)<0){i=0;return i|0}if((d[e+18>>0]<<8|d[e+19>>0]<<16|d[e+17>>0])>>>0<=h>>>0){i=0;return i|0}l=k+1|0;if(l>>>0<f>>>0){j=l;l=1;while(1){if((d[b+(j*23|0)+1>>0]<<8|d[b+(j*23|0)+2>>0]<<16|d[b+(j*23|0)>>0]|0)!=(h|0)){m=l;break}n=(d[b+(j*23|0)+3>>0]|0)+1|0;o=l>>>0>n>>>0?l:n;j=j+1|0;if(j>>>0>=f>>>0){m=o;break}else l=o}if(m>>>0>16){i=0;return i|0}else p=m}else p=1;c[g>>2]=h;c[g+4>>2]=p;p=g+40|0;a[p>>0]=0;if(!(a[e+20>>0]|0)){q=b+(k*23|0)+4|0;r=(d[e+21>>0]|0)>>>2}else{e=b+(k*23|0)+4|0;q=e;r=d[e>>0]|0}a[p>>0]=r&1;a[g+41>>0]=(d[q>>0]|0)>>>1&1;q=b+(k*23|0)+10|0;r=b+(k*23|0)+9|0;c[g+16>>2]=(d[q>>0]<<8|d[r>>0])<<2;p=b+(k*23|0)+12|0;e=b+(k*23|0)+11|0;c[g+20>>2]=(d[p>>0]<<8|d[e>>0])<<2;c[g+8>>2]=d[b+(k*23|0)+6>>0]<<8|d[b+(k*23|0)+5>>0];c[g+12>>2]=d[b+(k*23|0)+8>>0]<<8|d[b+(k*23|0)+7>>0];b=d[q>>0]<<8|d[r>>0];c[g+24>>2]=b;r=d[p>>0]<<8|d[e>>0];c[g+28>>2]=r;c[g+32>>2]=_(r,b)|0;c[g+36>>2]=k;i=1;return i|0}function Fb(a,b,e,f,g,h,i,j){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0;if(!(Cb(0,b,e)|0)){k=0;return k|0}e=(d[b+15>>0]|0)<<8|(d[b+16>>0]|0)<<16|(d[b+14>>0]|0);if(!e){k=0;return k|0}a=b+((d[b+67>>0]|0)<<16|(d[b+68>>0]|0)<<24|(d[b+66>>0]|0)<<8|(d[b+65>>0]|0))|0;l=0;while(1){if(((d[a+(l*23|0)+1>>0]|0)<<8|(d[a+(l*23|0)+2>>0]|0)<<16|(d[a+(l*23|0)>>0]|0)|0)==(f|0)?(d[a+(l*23|0)+3>>0]|0|0)==(g|0):0){m=l;break}l=l+1|0;if(l>>>0>=e>>>0){k=0;n=10;break}}if((n|0)==10)return k|0;if((m|0)<0){k=0;return k|0}if(((d[b+18>>0]|0)<<8|(d[b+19>>0]|0)<<16|(d[b+17>>0]|0))>>>0<=f>>>0){k=0;return k|0}c[h>>2]=(d[a+(m*23|0)+6>>0]|0)<<8|(d[a+(m*23|0)+5>>0]|0);c[i>>2]=(d[a+(m*23|0)+8>>0]|0)<<8|(d[a+(m*23|0)+7>>0]|0);c[j>>2]=_((d[a+(m*23|0)+12>>0]|0)<<8|(d[a+(m*23|0)+11>>0]|0),(d[a+(m*23|0)+10>>0]|0)<<8|(d[a+(m*23|0)+9>>0]|0))|0;k=1;return k|0}function Gb(b,e,f,g,h,i){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0;if(!(Cb(0,e,f)|0)){j=0;return j|0}f=d[e+15>>0]<<8|d[e+16>>0]<<16|d[e+14>>0];if(!f){j=0;return j|0}b=e+(d[e+67>>0]<<16|d[e+68>>0]<<24|d[e+66>>0]<<8|d[e+65>>0])|0;k=0;while(1){if((d[b+(k*23|0)+1>>0]<<8|d[b+(k*23|0)+2>>0]<<16|d[b+(k*23|0)>>0]|0)==(h|0)?(d[b+(k*23|0)+3>>0]|0)==(i|0):0){l=k;break}k=k+1|0;if(k>>>0>=f>>>0){j=0;m=13;break}}if((m|0)==13)return j|0;if((l|0)<0){j=0;return j|0}if((d[e+18>>0]<<8|d[e+19>>0]<<16|d[e+17>>0])>>>0<=h>>>0){j=0;return j|0}c[g>>2]=h;c[g+4>>2]=i;if(!(a[e+20>>0]|0)){n=b+(l*23|0)+4|0;o=(d[e+21>>0]|0)>>>2}else{e=b+(l*23|0)+4|0;n=e;o=d[e>>0]|0}a[g+40>>0]=o&1;a[g+41>>0]=(d[n>>0]|0)>>>1&1;n=b+(l*23|0)+10|0;o=b+(l*23|0)+9|0;c[g+16>>2]=(d[n>>0]<<8|d[o>>0])<<2;e=b+(l*23|0)+12|0;i=b+(l*23|0)+11|0;c[g+20>>2]=(d[e>>0]<<8|d[i>>0])<<2;c[g+8>>2]=d[b+(l*23|0)+6>>0]<<8|d[b+(l*23|0)+5>>0];c[g+12>>2]=d[b+(l*23|0)+8>>0]<<8|d[b+(l*23|0)+7>>0];b=d[n>>0]<<8|d[o>>0];c[g+24>>2]=b;o=d[e>>0]<<8|d[i>>0];c[g+28>>2]=o;c[g+32>>2]=_(o,b)|0;c[g+36>>2]=l;j=1;return j|0}function Hb(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;if(!(Cb(0,e,f)|0)){g=0;return g|0}h=(c[b+4>>2]|0)!=(c[b>>2]|0);if(!(a[e+20>>0]|0)){if(h)Ib(b);i=d[e+43>>0]<<16|d[e+44>>0]<<24|d[e+42>>0]<<8|d[e+41>>0];if(i>>>0>f>>>0){g=0;return g|0}j=d[e+52>>0]<<16|d[e+53>>0]<<24|d[e+51>>0]<<8|d[e+50>>0];if(j>>>0>f>>>0){g=0;return g|0}k=e+57|0;l=e+60|0;m=e+59|0;n=e+58|0;o=d[m>>0]<<16|d[l>>0]<<24|d[n>>0]<<8|d[k>>0];if(o>>>0>f>>>0){g=0;return g|0}p=d[e+46>>0]<<8|d[e+47>>0]<<16|d[e+45>>0];if(p>>>0>(f-i|0)>>>0){g=0;return g|0}q=d[e+55>>0]<<8|d[e+56>>0]<<16|d[e+54>>0];if(q>>>0>(f-j|0)>>>0){g=0;return g|0}r=e+61|0;s=e+64|0;t=e+63|0;u=e+62|0;if((d[t>>0]<<16|d[s>>0]<<24|d[u>>0]<<8|d[r>>0])>>>0>(f-o|0)>>>0){g=0;return g|0}if(!(gb(b,d[e+40>>0]<<8|d[e+39>>0],e+i|0,p,d[e+49>>0]<<8|d[e+48>>0],e+j|0,q)|0)){g=0;return g|0}if(!(kb(b,e+(d[m>>0]<<16|d[l>>0]<<24|d[n>>0]<<8|d[k>>0])|0,d[t>>0]<<16|d[s>>0]<<24|d[u>>0]<<8|d[r>>0])|0)){g=0;return g|0}}else if(h)Ib(b);a[b+585>>0]=1;g=1;return g|0}function Ib(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a>>2]|0;d=a+4|0;e=c[d>>2]|0;if((e|0)!=(b|0))c[d>>2]=e+(~((e+-8-b|0)>>>3)<<3);b=c[a+12>>2]|0;e=a+16|0;d=c[e>>2]|0;if((d|0)!=(b|0))c[e>>2]=d+(~(((0-b+(d+-11)|0)>>>0)/11|0)*11|0);d=c[a+28>>2]|0;b=a+32|0;if((c[b>>2]|0)!=(d|0))c[b>>2]=d;d=c[a+40>>2]|0;b=a+44|0;e=c[b>>2]|0;if((d|0)!=(e|0))c[b>>2]=e+(~((e+-4-d|0)>>>2)<<2);d=c[a+52>>2]|0;e=a+56|0;b=c[e>>2]|0;if((d|0)!=(b|0))c[e>>2]=b+(~((b+-2-d|0)>>>1)<<1);d=c[a+64>>2]|0;b=a+68|0;if((c[b>>2]|0)!=(d|0))c[b>>2]=d;d=c[a+76>>2]|0;b=a+80|0;e=c[b>>2]|0;if((d|0)!=(e|0))c[b>>2]=e+(~((e+-4-d|0)>>>2)<<2);d=c[a+88>>2]|0;e=a+92|0;b=c[e>>2]|0;if((d|0)!=(b|0))c[e>>2]=b+(~((b+-2-d|0)>>>1)<<1);d=c[a+100>>2]|0;b=a+104|0;if((c[b>>2]|0)!=(d|0))c[b>>2]=d;d=c[a+112>>2]|0;b=a+116|0;e=c[b>>2]|0;if((d|0)!=(e|0))c[b>>2]=e+(~((e+-4-d|0)>>>2)<<2);d=c[a+124>>2]|0;e=a+128|0;b=c[e>>2]|0;if((d|0)!=(b|0))c[e>>2]=b+(~((b+-2-d|0)>>>1)<<1);d=c[a+136>>2]|0;b=a+140|0;if((c[b>>2]|0)!=(d|0))c[b>>2]=d;d=c[a+148>>2]|0;b=a+152|0;e=c[b>>2]|0;if((d|0)!=(e|0))c[b>>2]=e+(~((e+-4-d|0)>>>2)<<2);d=c[a+160>>2]|0;e=a+164|0;b=c[e>>2]|0;if((d|0)==(b|0)){f=a+172|0;c[f>>2]=0;return}c[e>>2]=b+(~((b+-2-d|0)>>>1)<<1);f=a+172|0;c[f>>2]=0;return}function Jb(b){b=b|0;Ib(b);a[b+585>>0]=0;return 1}function Kb(b,c,e,f,g,h,i,j,k,l,m,n){b=b|0;c=c|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;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,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;switch(j|0){case 20:case 19:case 18:case 11:case 9:case 8:case 4:case 2:case 0:{o=8;break}case 21:case 17:case 12:case 10:case 5:case 3:case 1:case 7:case 6:{o=16;break}case 13:{o=4;break}case 16:case 15:case 14:{o=2;break}default:pa(475191,474791,10833,475639)}if(!((k&2|0)==0&(a[b+585>>0]|0)!=0)){p=0;return p|0}if(!(Cb(0,c,e)|0)){p=0;return p|0}q=c+(d[c+67>>0]<<16|d[c+68>>0]<<24|d[c+66>>0]<<8|d[c+65>>0])|0;r=(d[c+21>>0]|0)>>>2;s=d[c+15>>0]<<8|d[c+16>>0]<<16|d[c+14>>0];if(!s){p=0;return p|0}else t=0;while(1){if((d[q+(t*23|0)+1>>0]<<8|d[q+(t*23|0)+2>>0]<<16|d[q+(t*23|0)>>0]|0)==(f|0)?(u=q+(t*23|0)+3|0,(d[u>>0]|0)==(g|0)):0){v=u;w=t;break}t=t+1|0;if(t>>>0>=s>>>0){p=0;x=39;break}}if((x|0)==39)return p|0;if((w|0)<0){p=0;return p|0}x=r&1;r=(x|0)==0;t=(j|0)==9&r?8:j;j=c+20|0;g=a[j>>0]|0;if(!(g<<24>>24)){if(a[q+(w*23|0)+4>>0]&1){p=0;return p|0}if(!r){r=w+1|0;if(r>>>0>=s>>>0){p=0;return p|0}if(!(a[q+(r*23|0)+4>>0]&1)){p=0;return p|0}if((d[q+(w*23|0)+10>>0]<<8|d[q+(w*23|0)+9>>0]|0)!=(d[q+(r*23|0)+10>>0]<<8|d[q+(r*23|0)+9>>0]|0)){p=0;return p|0}if((d[q+(w*23|0)+12>>0]<<8|d[q+(w*23|0)+11>>0]|0)!=(d[q+(r*23|0)+12>>0]<<8|d[q+(r*23|0)+11>>0]|0)){p=0;return p|0}}}r=q+(w*23|0)+10|0;s=q+(w*23|0)+9|0;f=q+(w*23|0)+12|0;u=q+(w*23|0)+11|0;y=_(d[f>>0]<<8|d[u>>0],d[r>>0]<<8|d[s>>0])|0;if((t&-2|0)==8&y>>>0<i>>>0){Hd(h+(_(y,o)|0)|0,0,_(i-y|0,o)|0)|0;z=a[j>>0]|0}else z=g;if(z<<24>>24==1){p=zb(0,t,h,i,c,e,d[r>>0]<<8|d[s>>0],d[f>>0]<<8|d[u>>0],d[q+(w*23|0)+6>>0]<<8|d[q+(w*23|0)+5>>0],d[q+(w*23|0)+8>>0]<<8|d[q+(w*23|0)+7>>0],0,d[q+(w*23|0)+15>>0]<<16|d[q+(w*23|0)+16>>0]<<24|d[q+(w*23|0)+14>>0]<<8|d[q+(w*23|0)+13>>0],d[q+(w*23|0)+19>>0]<<16|d[q+(w*23|0)+20>>0]<<24|d[q+(w*23|0)+18>>0]<<8|d[q+(w*23|0)+17>>0],k,(x|0)!=0,0,l,0,n,-1,-1)|0;return p|0}z=(x|0)!=0;x=z?q+((w+1|0)*23|0)|0:0;if(a[q+(w*23|0)+4>>0]&1)pa(475310,474791,10769,475364);g=(x|0)!=0;if(g){if(!(a[x+4>>0]&1))pa(475386,474791,10774,475364);j=a[r>>0]|0;o=a[s>>0]|0;if(((j&255)<<8|o&255|0)!=(d[x+10>>0]<<8|d[x+9>>0]|0))pa(475446,474791,10775,475364);y=a[f>>0]|0;A=a[u>>0]|0;if(((y&255)<<8|A&255|0)!=(d[x+12>>0]<<8|d[x+11>>0]|0))pa(475511,474791,10776,475364);B=a[v>>0]|0;if(B<<24>>24==(a[x+3>>0]|0)){C=j;D=o;E=y;F=A;G=B}else pa(475576,474791,10777,475364)}else{C=a[r>>0]|0;D=a[s>>0]|0;E=a[f>>0]|0;F=a[u>>0]|0;G=a[v>>0]|0}if(g){H=d[x+15>>0]<<16|d[x+16>>0]<<24|d[x+14>>0]<<8|d[x+13>>0];I=d[x+19>>0]<<16|d[x+20>>0]<<24|d[x+18>>0]<<8|d[x+17>>0]}else{H=0;I=0}p=qb(b,t,h,i,c,e,(C&255)<<8|D&255,(E&255)<<8|F&255,d[q+(w*23|0)+6>>0]<<8|d[q+(w*23|0)+5>>0],d[q+(w*23|0)+8>>0]<<8|d[q+(w*23|0)+7>>0],G&255,d[q+(w*23|0)+15>>0]<<16|d[q+(w*23|0)+16>>0]<<24|d[q+(w*23|0)+14>>0]<<8|d[q+(w*23|0)+13>>0],d[q+(w*23|0)+19>>0]<<16|d[q+(w*23|0)+20>>0]<<24|d[q+(w*23|0)+18>>0]<<8|d[q+(w*23|0)+17>>0],H,I,k,z,(a[c+23>>0]|0)==3,l,m,n)|0;return p|0}function Lb(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;if(f>>>0>=21)pa(487698,474791,11376,487731);g=c[16704+(f*12|0)>>2]|0;if(!(898778>>>f&1)){if(!(e|d)){h=8;i=0}else pa(487753,474791,11385,487731);while(1){j=(h|0)<(g|0);k=j?h:g;l=b>>>(j?g-k|0:0);if(l>>>0>=1<<k>>>0){m=7;break}h=h-k|0;k=l<<h|i;if((h|0)<=0){n=k;m=14;break}else i=k}if((m|0)==7)pa(487785,474791,11396,487731);else if((m|0)==14)return n|0}m=(b&1|0)!=0?511:0;i=c[16956+(f<<3)+4>>2]|0;if(!(898768>>>f&1))pa(487799,474791,11408,487731);h=c[16956+(f<<3)>>2]|0;g=a[h>>0]|0;if(g<<24>>24==48)o=0;else o=b>>>(((g&255)<<24)+-1627389952>>24)<<1&2;g=a[h+1>>0]|0;if(g<<24>>24==48)p=o;else p=b>>>(((g&255)<<24)+-1627389952>>24)&1|o;o=p<<1;p=a[h+2>>0]|0;if(p<<24>>24==48)q=o;else q=b>>>(((p&255)<<24)+-1627389952>>24)&1|o;o=q<<1;q=a[h+3>>0]|0;if(q<<24>>24==48)r=o;else r=b>>>(((q&255)<<24)+-1627389952>>24)&1|o;o=r<<1;r=a[h+4>>0]|0;if(r<<24>>24==48)s=o;else s=b>>>(((r&255)<<24)+-1627389952>>24)&1|o;o=s<<1;s=a[h+5>>0]|0;if(s<<24>>24==48)t=o;else t=b>>>(((s&255)<<24)+-1627389952>>24)&1|o;o=t<<1;t=a[h+6>>0]|0;if(t<<24>>24==48)u=o;else u=b>>>(((t&255)<<24)+-1627389952>>24)&1|o;o=u<<1;u=a[h+7>>0]|0;if(u<<24>>24==48)v=o;else v=b>>>(((u&255)<<24)+-1627389952>>24)&1|o;o=v<<1;v=a[h+8>>0]|0;if(v<<24>>24==48)w=o;