diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,17 +1,265 @@
-Changelog for Shake
+Changelog for Shake (* = breaking change)
 
-0.15.11
+0.19.9, released 2026-01-19
+    Test with GHC 9.12, improving some errors
+0.19.8, released 2024-01-14
+    Test with GHC 9.8
+    #844, optimise database reading/writing with use unsafeUseAsCString
+    #836, add threaded flag to disable using threaded runtime
+    #837, require filepath-1.14
+0.19.7, released 2022-09-15
+    #815, improve corrupt database handling code
+    Don't say (changed) for files that don't build
+0.19.6, released 2021-09-07
+    #810, don't hash files in &%> if you don't have to
+0.19.5, released 2021-07-04
+    #807, fix space leak in Database module
+    #796, fix a bug with newCache dependencies
+    #798, optimise dependency checking
+0.19.4, released 2021-01-14
+    #790, add option shakeAllowRedefineRules
+*   #790, remove overrideBuiltinRule
+0.19.3, released 2021-01-14
+    #789, add overrideBuiltinRule
+    #787, more documentation on doesFileExist
+0.19.2, released 2020-11-15
+    #780, Autodeps should consider a rename as a write to the destination
+    #778, AutoDeps shouldn't trigger for files read and written
+    #779, merge dependencies in O(n and a bit)
+    #779, merge local traces in O(n)
+    #768, the embed-files flag work on the executable too
+0.19.1, released 2020-06-06
+    #757, make sure shared cache writes are atomic
+    Remove a small space leak if using the Database module
+    #755, add instance IsCmdArgument (NonEmpty String)
+    #754, tighten bounds to exclude GHC 7.10
+0.19, released 2020-05-23
+    #738, improve the help text
+    #679, allow Ninja to depend on a directory
+*   #748, close stdin by default in cmd
+    #748, add NoProcessGroup and InheritStdin to cmd
+    Delete stuff deprecated since 2014 - **>, ?>>, *>>, *>, |*>, &*>
+    Mark askOracleWith and deprioritize as DEPRECATED
+    #753, fix timing information for batch
+    #746, optimise file modification times on Linux
+    #746, add an instance for CmdArgument ()
+    Allow getting FSATrace ByteString as a result
+*   Make the FSATrace type polymorphic over the FilePath
+    Speed up FSATrace parsing
+    Require extra-1.6.19
+0.18.5, released 2020-02-02
+    Use uninterruptibleMask_ to ensure all cleanup happens robustly
+    #742, make the Chrome profile only include the last run
+    #740, make CmdArgument an instance of IsCmdArgument
+0.18.4, released 2019-12-15
+    #734, add Forward.cacheActionWith
+    #734, make forward fail if shakeLintInside is empty
+*   #701, make shakeSymlink=False the default
+    #694, embed data files in the binary (use embed-files Cabal flag)
+    #722, don't close file handles in cmd unless CloseFileHandles
+    #727, add actionBracket for bracket-like operations
+    #720, add --share-sanity to sanity check shared cache contents
+    #719, write history key after cached files to ensure it is coherent
+    #703, print rebuild warnings in yellow and errors in red
+    #706, rename Verbosity's constructors and add Warn
+    #443, add getEnvError
+    #662, add Partial to command/cmd
+    #708, rename deprioritize to reschedule
+    #689, allow adding help messages at the end using addHelpSuffix
+    #686, rename Build.hs to Shakefile.hs
+    #690, make Ninja mode use -j0 by default (more like Ninja)
+0.18.3, released 2019-07-01
+    Add shakeSymlink to enable/disable symlinks in the shared cache
+    Improve cmd on async exceptions with nested processes on Windows
+0.18.2, released 2019-05-19
+    #678, fix serious bug in writeFileChanged
+0.18.1, released 2019-05-19
+    #678, fix serious bug in writeFile', deleting the wrong file
+0.18, released 2019-05-14
+*   Make files copied to the shared cache read-only
+    Delete files before writing, giving symlink/readonly safety
+    #677, make --help work even if the build system throws errors
+*   Use parallelism for Applicative adjacent needs
+    Support GHC 8.8
+0.17.9, released 2019-05-01
+    #675, allow --compact=yes|no|auto
+    Make lintTrackAllow work after the lintTrackRead/Write
+*   Merge successive Cwd declarations to cmd
+    #671, change the file format to permit rsync of caches
+    Speed up lint tracking
+    #670, make cloud values more portable between machines
+    #666, exceptions in --share-list, --share-remove are warnings
+0.17.8, released 2019-04-02
+    Eliminate a corner case of losing exception messages
+    Make FSATrace available as a result type
+    Commands which have AutoDeps aren't also linted
+    #278, add StdoutTrim - like Stdout, but with trim applied
+    #659, require base >= 4.8
+0.17.7, released 2019-03-18
+    Add back -B as an alias for --rebuild
+    Make --help say which other options have changed
+    Add --lint-ignore flag to set shakeLintIgnore
+    Improve the documentation for produces, call trackWrite
+    Make trackWrite/trackRead respect shakeLintIgnore
+    Make --lint-fsatrace also add to shakeLintInside
+    #656, make --lint-fsatrace work with relative directories
+    Make sure --no-build does not destroy previous profile output
+    #437, #414, #298 rewrite the profile view
+    #588, #521 add end times and traced top-levels to the profile
+    Add askOracles
+    Generate nested dependency information in profiles
+    Don't add .exe add the end of traced cmd calls
+    Change the profiling .json format
+    #651, remove support for GHC 7.4, 7.6 and 7.8
+0.17.6, released 2019-02-17
+    Make --progress on Windows work with non-ASCII characters
+    #18, add --compact for a Bazel/Buck style output
+    Make the progress message display a more traditional count
+    #638, add shakeTrace to record start/stop of traced commands
+    Show user-added options separately
+    #625, make --help show the list of targets
+    #625, add addTarget/getTargets to track the available targets
+    #416, generalise Forward.cacheAction to be in label and output
+    #642, detect files that change with --lint-watch
+    #649, add --share-list and --share-remove to work with the cache
+    #626, improve the display of error messages with call stacks
+    Make sure exceptions don't change based on verbosity setting
+    Make sure all thread pool threads terminate before shake returns
+    #646, change the identity property to require a Maybe
+    Use symlinks for --shared
+    #643, add MonadFail Rules
+0.17.5, released 2019-02-05
+    Remove dependency on heaps
+0.17.4, released 2019-01-10
+    Add shakeProfileDatabase to generate profile information
+    Don't suggest -qb (irrelevant with -qg)
+0.17.3, released 2018-12-04
+    #632, remove O(n^2) behaviour when constructing user rules
+    In diagnostic mode, show the number of actions/rules/user rules
+0.17.2, released 2018-11-29
+    Make needHasChanged work even between runs
+0.17.1, released 2018-11-14
+    Add actionCatch, to catch exceptions in Action
+    #622, avoid potential maxBound overflow in batch
+    Reduce the context required for addBuiltinRule
+0.17, released 2018-10-15
+    Add Database module for repeated execution from one database
+*   Don't export the body of the Typeable type class
+    Mark deprecated operators as DEPRECATED
+    Improve async exception safety in some corner cases
+    Support shakeFiles=/dev/null to avoid any database
+    Add reprioritise to change the priority of a running rule
+    Add a dependency on heaps package
+    #611, fix a race condition in actionFinally that reran handlers
+    Remove a potential space leak in the Rules monad
+    #412, clarify that removeFilesAfter should be used sparingly
+    #409, improve the documentation of newCache
+    Generalise operations like versioned to Rules a -> Rules a
+    Make the Shake database version string contain os and arch
+    Don't delete the whole database when an oracle disappears
+    #300, soften the database version change message
+    IMPORTANT: Incompatible on disk format change
+    #590, print "Build completed" timing with better accuracy
+    #581, improve the information and display of call stacks
+    Add actionRetry to retry actions if they fail
+    #143, give locations when several rules match
+    Compatibility with unix-2.8
+    Add shakeShare, --share and history functions for shared builds
+    #574, extensive documentation of Development.Shake.Rule
+*   Change how alternative and priority rules interact
+    Add versioned for rules
+*   Change all the ways of obtaining user rules, see getUserRuleOne
+    Improve time recording for unsafeExtraThread, parallel, batch
+    #553, improve file-hash performance when nothing changes
+*   Require addBuiltinRule to take a BuiltinIdentity argument
+*   Make the third argument to BuiltinRun a real ADT
+    Disable all the lintTrack functions unless lint is enabled
+*   Change the Development.Shake.Rule.track* functions to lintTrack*
+    #584, add Semigroup/Monoid instances for Action
+    Add produces to declare which untracked files a rule produces
+    Add historyDisable to note which rules cannot be cached
+    #583, add replaceDirectory1
+    Add addOracleHash for oracles with reduced storage requirements
+0.16.4, released 2018-04-04
+    #185, add addOracleCache which doesn't always rerun
+    #576, remove incorrect Cabal description
+    #575, print --help message at Quiet verbosity or above
+0.16.3, released 2018-02-23
+    Allow reading data files from next to the executable
+    #566, require extra-1.6.1
+    #565, deal with multi-file rules that don't create their contents
+    Improve the documentation of getDirectoryContents
+0.16.2, released 2018-02-13
+    Set the correct lower bound on unordered-containers of 0.2.7
+0.16.1, released 2018-02-11
+    Support process-1.6.3.0
+    #290, add withTempFileInside and withTempDirInside
+    #549, Semigroup-Monoid proposal support
+    Hadrian-462, fail gracefully if on-disk formats change
+    #469, only print timing information at normal verbosity or above
+    #340, add runAfter
+    #372, deprecate askOracleWith
+    #520, only record each dependency once
+    #548, rebuild the Ninja files, if they change, restart
+    #547, make Ninja --lint checking see through phonys
+    #546, support Ninja line continuations in more places
+    #470, make --verbose and --quiet help text clearer
+    #534, make writeFile' and writeFileChanged create the directory
+    #543, add resultHasChanged to track results which have changed
+    Add getShakeExtraRules, like getShakeOptionsRules for shakeExtra
+    #535, add shakeArgsOptionsWith to manipulate ShakeOptions
+    #538, make sure processes can be killed properly
+    #502, add needHasChanged to track what in a need has changed
+    Weaken the typeclasses required for apply/apply1
+    #502, add batch function to batch commands with high startup
+    Avoid parallel duplicating local state such as discounting
+    Prefer to resume tasks rather than start new ones
+0.16, released 2017-09-20
+    #536, make --skip work for oracles
+    Ensure shakeOutput is used more consistently
+    #49, add shakeColor and --color flags
+    #490, recommend -threaded as standard
+    #517, ignore ./ in FilePattern
+    Require extra-1.5.3
+    #499, add a filePattern function, like ?== but with the matches
+    #474, never spawn user actions unmasked
+    Allow user arguments to replace builtin arguments
+    #522, make copyFile create directories if necessary
+    #516, add an example for withTempDir
+    #514, expose more about cmd arguments
+    #523, #524, make sure phony doesn't run its dependencies first
+    #515, add cmd_ function
+    #506, allow duplicate type names in different modules
+    #503, require shakeExtra to obey the sensible invariants
+    #503, add getShakeExtra/addShakeExtra
+    #492, fix the single letter flag documentation
+    Expose 'Process' from Development.Shake
+    #495, remove dangling link from LICENSE
+    #436, remove Assume, switch to Rebuild
+    Remove --always-make, use --rebuild instead
+    #419, remove --assume-old and --assume-new, which never worked
+    Remove support for running Makefile scripts
+    Add getShakeOptionsRules, to get ShakeOptions in Rules
+    #479, improve the robustness of the Pool tests
+    #481, document how to raise errors in Action
+    Delete the deprecated system* functions
+    #427, check stored value after checking dependencies
+    Significant changes to defining custom rules
+    Delete the deprecated defaultRule
+    IMPORTANT: Incompatible on disk format change
+    #428, don't persist errors to the database
+0.15.11, released 2017-01-18
     #488, make sure parallel tracks dependencies
     #513, permit process-1.4.3.0 and above
-0.15.10
+0.15.10, released 2016-06-14
     #465, fix phony names which clash with directories
-0.15.9
+0.15.9, released 2016-06-12
     Documentation tweaks
     Optimise the thread pool
     Fix progress output through wget
-0.15.8
+0.15.8, released 2016-06-01
     Extra base bounds to rule out building on GHC 7.4
-0.15.7
+0.15.7, released 2016-06-01
     Require extra-1.4.8
     #457, better error message when calling need on a directory
     #456, use displayException for inner exceptions
@@ -19,7 +267,7 @@
     #448, fix FSATrace on Mac 10.11
     #444, optimise copyFileChanged
     #58, change writeFile functions to MonadIO
-0.15.6
+0.15.6, released 2016-04-19
     Require the primitive package
     #431, make it an error to need a directory
     #393, add orderOnlyAction, a general version of orderOnly
@@ -74,18 +322,18 @@
     #295, discount time spent waiting for a cache
     #294, give better error messages if you hit GHC bug #10793
     #4, add a lock file to stop corrupting databases
-0.15.5
+0.15.5, released 2015-08-04
     #279, make usingConfigFile do a need on the config file
     Fix a bug where predicted progress could sometimes be ??
     #264, make the the suite more less non-deterministic
-0.15.4
+0.15.4, released 2015-06-20
     Undo a locally modified file
-0.15.3
+0.15.3, released 2015-06-20
     #254, in staunch mode, print out all exceptions
     Require extra-1.3
     #259, discount time waiting for a resource in profiles
     #252, have the docs test configure not in dist
-0.15.2
+0.15.2, released 2015-05-22
     #248, add another example of using cmd
     #245, initial support for fsatrace lint checking
     Reexport -<.> from filepath where available
@@ -93,7 +341,7 @@
     Add AddEnv and AddPath command options
     #243, close fds in child processes when spawning commands
     Make Ninja variable handling more accurate
-0.15.1
+0.15.1, released 2015-04-25
     If you have Shakefile.hs, pass it all arguments without interp
     Add shakeArgsPrune and shakeArgsPruneWith
     #228, allow running cmd async by collecting the ProcessHandle
@@ -104,7 +352,7 @@
     #226, add escaping for GraphViz labels
     #227, add StdinBS for passing a bytestring as Stdin
     Make cmd Timeout call terminateProcess as well
-0.15
+0.15, released 2015-03-26
     #203, make shakeFiles a directory rather than a file prefix
     #220, add getHashedShakeVersion helper
     #220, add shakeVersionIgnore to ignore version numbers
@@ -124,17 +372,17 @@
     Add unit for use with cmd
     IMPORTANT: Incompatible on disk format change
     #209, improve orderOnly dependencies
-0.14.3
+0.14.3, released 2015-01-07
     Support for the filepath shipped with GHC 7.10
     Add Timeout option to command
-0.14.2
+0.14.2, released 2014-11-27
     #198, add <//> operator to join FilePatterns
     #198, fix the <.> and other extension methods to work with //
-0.14.1
+0.14.1, released 2014-11-21
     #196, change the links to point at http://www.shakebuild.com/
     Improve the error messages when &%> or &?> go wrong
     Normalise file patterns used by &?>
-0.14
+0.14, released 2014-11-19
     Make FilePattern on Windows cope with all path separators
     Rename normalise to normaliseEx
     Expose native System.FilePath in Development.Shake.FilePath
@@ -151,9 +399,9 @@
     Fix incorrect units when showing profile to the console
     Require the extra library
     #178, make --help show the current executable name
-0.13.4
+0.13.4, released 2014-09-19
     #171, fix the --demo mode on Linux
-0.13.3
+0.13.3, released 2014-09-16
     Ensure you wait until the progress thread cleans up
     Add --demo mode
     Add --progress=record and --progress=replay
@@ -178,16 +426,16 @@
     Add Maybe instances for cmd arguments
     Add a --profile flag (alias for --report)
     Switch to an underlying continuation monad
-0.13.2
+0.13.2, released 2014-06-20
     #95, ensure progress never gets corrupted
     #124, add a profile report demo
     #128, allow long Ninja command lines
     Fix --report=- for builds with no commands in them
-0.13.1
+0.13.1, released 2014-05-28
     Remove all package upper bounds
     #126, Ninja compatibility if Ninja fails to create a file
     #123, generate Chrome compatible traces
-0.13
+0.13, released 2014-05-27
     #122, make --report=- write a report to stdout
     Improve the profile report summary
     #122, turn shakeReport into a list of files, instead of a Maybe
@@ -201,7 +449,7 @@
     Deprecate defaultRule
     Make literal *> matches take precedence over wildcard matches
     #120, add a priority function
-0.12
+0.12, released 2014-05-09
     #62, move to a ReaderT/IORef for the Action monad
     Add DEPRECATED pragmas on system' calls
     Delete Development.Shake.Sys, use command or cmd instead
@@ -211,13 +459,13 @@
     #117, use higher precision times for Unicode files on Windows
     #118, add support for Ninja -t compdb
     #119, more test fixes for Linux GHC 7.8
-0.11.7
+0.11.7, released 2014-05-05
     #119, test fixes for Linux GHC 7.8
-0.11.6
+0.11.6, released 2014-05-04
     #114, run build.sh in the test suite with sh
     #115, fix the test suite on Linux GHC 7.8
     #116, fix for GHC 7.10
-0.11.5
+0.11.5, released 2014-04-25
     Include the sources for flot and jQuery in the dist tarball
     Note that .. in FilePattern values is unlikely to be correct
     #109, make removeFiles delete directories that match
@@ -226,20 +474,20 @@
     #110, don't give a warning if -threaded is turned off
     #103, don't suggest -qg and -qb, they fail without -threaded
     #102, fix up </> when the LHS starts with .
-0.11.4
+0.11.4, released 2014-03-20
     Work with QuickCheck-2.7 (which defines ===)
     #100, handle GraphViz missing gracefully
     Fix up the profiling report generation
     #99, add getEnvWithDefault
-0.11.3
+0.11.3, released 2014-02-27
     #97, fix a serialisation bug when > 254 arguments to need
-0.11.2
+0.11.2, released 2014-02-18
     #96, fix a bug in addPath that caused $PATH to be added twice
-0.11.1
+0.11.1, released 2014-02-06
     #94, GHC 7.8 support
     Add a Config module
     #89, support :: as a build rule separator
-0.11
+0.11, released 2014-01-03
     Add alternatives to allow overlapping rules
     Make storedValue take a ShakeOptions structure
     Generalise the newCache function
@@ -254,9 +502,9 @@
     Mark Development.Shake.Sys as DEPRECATED with a pragma
     Change shakeLint to be of type Maybe Lint, instead of Bool
     #50, add shakeArgsAccumulate
-0.10.10
+0.10.10, released 2013-11-16
     Improve Ninja --lint checking
-0.10.9
+0.10.9, released 2013-11-15
     #76, add Ninja specific lint checking
     #75, add orderOnly dependencies
     #76, add needed, to assert a need doesn't rebuild
@@ -278,11 +526,11 @@
     Add a --no-build flag
     #74, allow cmd to be used with result IO
     Add a Util module, with Makefile parsing
-0.10.8
+0.10.8, released 2013-10-15
     Allow unix-1.5.1 again
     Require Cabal 1.10 or above
     Convert to the cabal test compatible test suite
-0.10.7
+0.10.7, released 2013-09-26
     Support time-1.2
     #71, fix a bug when requesting all three outputs from command
     #64, add progressProgram and use it in progressSimple
@@ -307,16 +555,16 @@
     Reduce stack usage when lint checking
     #24, create the output directories for the multiple file rule
     Improvements to match Ninja behaviour
-0.10.6
+0.10.6, released 2013-06-28
     Include command/cmd in the default module
     #16, change the scoping in subninja
     #15, fix up the Ninja default targets
     Fix up --version output
-0.10.5
+0.10.5, released 2013-06-14
     Improve progress prediction for the first build
     Fix removeFiles when there is a directory argument and a pattern
     Delete shakeDeterministic, shakeThreads=1 has the same effect
-0.10.4
+0.10.4, released 2013-06-13
     Fix writeFileChanged for line endings on Windows
     Support arguments to --progress
     Set the number of capabilities based on -j flags
@@ -329,10 +577,10 @@
     Add -<.> alias for replaceExtension
     Add selectors on Stdout/Stdin/Exit
     Add CmdResult instance for ExitCode
-0.10.3
+0.10.3, released 2013-05-12
     Upgrade to Flot-0.8
     Small documentation markup fixes
-0.10.2
+0.10.2, released 2013-03-30
     Require process-1.1 or above
     Improve progress guesses (use exponential decay of work rate)
     Improve profiling report error messages
@@ -349,9 +597,9 @@
     Add a --no-time flag
     Makefile improvements
     Avoid use of ghc-options in .cabal file
-0.10.1
+0.10.1, released 2013-03-18
     Allow the shake executable to build
-0.10
+0.10, released 2013-03-17
     Add phony, for writing phony actions
     Add removeFilesAfter
     Switch to the new profiling code
@@ -364,9 +612,9 @@
     Change how progress messages are written
     Do not write a beep in progressDisplay, avoids a beep
     Add exe function to FilePath
-0.9.1
+0.9.1, released 2013-02-28
     GHC head (7.7) compatibility by removing the Rules fundep
-0.9
+0.9, released 2013-02-16
     Make the tests work on Linux
     Fix report generation on machines whose text format is not ASCII
     Make Directory functions work the same on Linux/Mac
@@ -381,10 +629,10 @@
     Add newCache to cache the parsed contents of files
     Add newResourceIO and move newResource into the Rules monad
     Add shakeStorageLog, to help diagnosing obscure database errors
-0.8
+0.8, released 2013-01-31
     Improve the Oracle documentation
     Allow getDirectoryFiles to operate recursively
-0.7
+0.7, released 2013-01-29
     Change getDirectoryFiles to take a set of file patterns
     Add doesDirectoryExist function
     Add shakeAbbreviations feature
@@ -399,16 +647,16 @@
     Change the storage to not write messages on --silent
     Add Applicative on Rules
     Add Applicative on Action
-0.6
+0.6, released 2013-01-09
     Make addOracle return a result of askOracle
     Export the class bodies from Classes
     Don't export ShakeValue from Classes
-0.5
+0.5, released 2013-01-05
     IMPORTANT: Incompatible on disk format change
     Add the ShakeValue constraint synonym
     Change the Oracle to be strongly typed
     Add a Classes module
-0.4
+0.4, released 2013-01-02
     Add shakeFlush to control how often flush is called
     Fix a serious space leak in the thread pool
     #502, add shakeAssume to assume files are clean/dirty
@@ -418,29 +666,29 @@
     #501, add statistics gathering functions to help report progress
     Ensure registering witnesses is thread safe
     Ensure GHC does not over-optimise type registration
-0.3.10
+0.3.10, released 2012-12-17
     Add Paths.hs so you can run the tests from the tarball
-0.3.9
+0.3.9, released 2012-12-17
     Don't rely on toList returning a consistent order
     Allow hashable-1.2
-0.3.8
+0.3.8, released 2012-12-12
     Fix up FilePattern so "foo//bar" ?== "foo/bar"
-0.3.7
+0.3.7, released 2012-12-02
     Update the cabal file
-0.3.6
+0.3.6, released 2012-11-27
     Add addOracles, for implementing more advanced oracles
     Add withoutActions, for implementing command line arguments
-0.3.5
+0.3.5, released 2012-11-27
     #571, vastly improve the correctness of FilePattern
     #574, documentation typos
     Expose rulePriority
-0.3.4
+0.3.4, released 2012-09-17
     Update documentation with links to ICFP 2012 paper/talk
-0.3.3
+0.3.3, released 2012-09-17
     Minor refactorings
-0.3.2
+0.3.2, released 2012-09-12
     Fix cabal specification on non-Windows
-0.3.1
+0.3.1, released 2012-09-08
     Don't use syntax also stolen by QuasiQuotes
     Avoid warnings about unused monadic values
     Fix up getModificationTime for GHC 7.6
@@ -460,7 +708,7 @@
     Switch to ByteString for storing File
     Add shakeDeterministic, along with a default random pool
     Make the Monad/Monoid instance for Rules strict
-0.3
+0.3, released 2012-06-17
     #550, ensure the journal thread is locked
     #550, if your thread dies while reading the database then die
     #550, ensure you reset to before the slop before writing
@@ -470,13 +718,13 @@
     Better messages on invalid database versions
     Complete rewrite of the storage layer and journal design
     IMPORTANT: Incompatible on disk format change
-0.2.11
+0.2.11, released 2012-05-19
     IMPORTANT: #546, don't save the database to where it was created
-0.2.10
+0.2.10, released 2012-05-19
     Add systemCwd for running with a particular current directory
     Ensure the database is saved to where it was created
     #545, make sure if shake is killed, it kills its children
-0.2.9
+0.2.9, released 2012-03-25
     Require unordered-containers 2.1 or higher, fixes bugs
     Allow transformers-0.3.*
     Add a random script generator and tester
@@ -484,31 +732,31 @@
     Fix the unordered-containers constraint, was too loose
     Don't write report generation messages in Quiet mode
     Add ?>> operator, a generalisation of *>>
-0.2.8
+0.2.8, released 2012-02-24
     Rename shakeDump to shakeReport
     Add profile report generator
-0.2.7
+0.2.7, released 2012-02-18
     #530, require unordered-containers >= 0.1.4.3
-0.2.6
+0.2.6, released 2012-02-17
     Improve the documentation code fragments (more links)
     Add support for managing finite resources
-0.2.5
+0.2.5, released 2012-02-15
     Require hashable-1.1.2.3, which has a TypeRep instance
     Add Data/Typeable instances for ShakeOptions
     Add Data instance for Verbosity
-0.2.4
+0.2.4, released 2012-02-11
     Include the C example source files
     Significant documentation improvements
-0.2.3
+0.2.3, released 2012-02-09
     Create the shakeFiles directory if missing
-0.2.2
+0.2.2, released 2012-02-05
     Allow deepseq-1.3.*
     Add a basic lint checking mode
     Remove the Dirty state entirely (was incorrect)
-0.2.1
+0.2.1, released 2012-01-28
     Put diagnostics in more places
     Add a C example
-0.2
+0.2, released 2012-01-23
     Add shakeStaunch
     Rename shakeParallel to shakeThreads
     Delete the lint support (never actually worked)
@@ -520,25 +768,25 @@
     Add an Oracle module
     Add an explicit Verbosity type
     Change to lower precedence for *> etc
-0.1.5
+0.1.5, released 2012-01-01
     Allow deepseq-1.2
-0.1.4
+0.1.4, released 2012-01-01
     Don't export currentRule/currentStack
     Fix **>, was matching the wrong way round
     Fix FilePath normalise so it works properly on Windows
     Properly detect recursive rules, instead of looping
     Add *>> for building multiple files at once
-0.1.3
+0.1.3, released 2011-12-22
     Fix a bug where a file rule could return with a lazy error
     Make sure all the files are stored in binary, not text
     Fix a pattern match error in getDirectoryFiles
-0.1.2
+0.1.2, released 2011-12-18
     Add a warning in the description
-0.1.1
+0.1.1, released 2011-12-18
     Significantly improved documentation
     system' now takes an initial argument for the program
-0.1
+0.1, released 2011-12-18
     Many changes to signatures, some basic documentation
     Additional demo, to build shake itself
-0.0
+0.0, released 2011-12-11
     Initial version, not ready for public use
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright Neil Mitchell 2011-2017.
+Copyright Neil Mitchell 2011-2026.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,3 @@
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-Some of the JavaScript files in html/ have different copyright and licenses.
-Please consult the corresponding source file in js-src/
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,19 +1,19 @@
-# Shake [![Hackage version](https://img.shields.io/hackage/v/shake.svg?label=Hackage)](https://hackage.haskell.org/package/shake) [![Stackage version](https://www.stackage.org/package/shake/badge/lts?label=Stackage)](https://www.stackage.org/package/shake) [![Linux Build Status](https://img.shields.io/travis/ndmitchell/shake.svg?label=Linux%20build)](https://travis-ci.org/ndmitchell/shake) [![Windows Build Status](https://img.shields.io/appveyor/ci/ndmitchell/shake.svg?label=Windows%20build)](https://ci.appveyor.com/project/ndmitchell/shake)
+# Shake [![Hackage version](https://img.shields.io/hackage/v/shake.svg?label=Hackage)](https://hackage.haskell.org/package/shake) [![Stackage version](https://www.stackage.org/package/shake/badge/nightly?label=Stackage)](https://www.stackage.org/package/shake) [![Build status](https://img.shields.io/github/actions/workflow/status/ndmitchell/shake/ci.yml?branch=master)](https://github.com/ndmitchell/shake/actions)
 
-Shake is a tool for writing build systems - an alternative to make, Scons, Ant etc. Shake has been used commercially for over five years, running thousands of builds per day. The website for Shake users is at [shakebuild.com](http://shakebuild.com).
+Shake is a tool for writing build systems - an alternative to make, Scons, Ant etc. Shake has been used commercially for over five years, running thousands of builds per day. The website for Shake users is at [shakebuild.com](https://shakebuild.com).
 
 #### Documentation
 
-* **Why use Shake?** Shake lets you write large robust build systems, which deal properly with generated source files and run quickly. If you are writing a custom build system of any moderate size (more than a few rules) you should use Shake. The advantages over other build systems are detailed in the document [Why choose Shake?](http://shakebuild.com/why).
-* **How do I use Shake?** Shake is a Haskell library that you use to define your rules. The [Shake manual](http://shakebuild.com/manual) provides a walk through of a small but realistic example, assuming no Haskell knowledge.
-* [Generated documentation](http://hackage.haskell.org/packages/archive/shake/latest/doc/html/Development-Shake.html) for all functions, includes lots of examples.
-* [Blog posts](http://neilmitchell.blogspot.co.uk/search/label/shake) detailing ongoing development work.
-* [Academic paper](http://ndmitchell.com/downloads/paper-shake_before_building-10_sep_2012.pdf) on the underlying principles behind Shake.
+* **Why use Shake?** Shake lets you write large robust build systems, which deal properly with generated source files and run quickly. If you are writing a custom build system of any moderate size (more than a few rules) you should use Shake. The advantages over other build systems are detailed in the document [Why choose Shake?](https://shakebuild.com/why).
+* **How do I use Shake?** Shake is a Haskell library that you use to define your rules. The [Shake manual](https://shakebuild.com/manual) provides a walk through of a small but realistic example, assuming no Haskell knowledge.
+* [Generated documentation](https://hackage.haskell.org/packages/archive/shake/latest/doc/html/Development-Shake.html) for all functions, includes lots of examples.
+* [Blog posts](https://neilmitchell.blogspot.co.uk/search/label/shake) detailing ongoing development work.
+* [Academic paper](https://ndmitchell.com/downloads/paper-shake_before_building-10_sep_2012.pdf) on the underlying principles behind Shake.
 
 #### Other links
 
-* [Download the Haskell package](http://hackage.haskell.org/package/shake) from Hackage and install it using Cabal.
+* [Download the Haskell package](https://hackage.haskell.org/package/shake) from Hackage and install it using Cabal.
 * [Mailing list](https://groups.google.com/forum/?fromgroups#!forum/shake-build-system) for any questions/bugs/thoughts on Shake. If you need more information and aren't sure where to start, use the mailing list.
-* [Questions](http://stackoverflow.com/questions/tagged/shake-build-system) can be asked on StackOverflow with the tag `shake-build-system`.
+* [Questions](https://stackoverflow.com/questions/tagged/shake-build-system) can be asked on StackOverflow with the tag `shake-build-system`.
 
-Is your company using Shake? Write something public (even just a [tweet to `@ndm_haskell`](https://twitter.com/ndm_haskell)) and I'll include a link [on the website](http://shakebuild.com/#who-uses-shake).
+Is your company using Shake? Write something public (even just a [tweet to `@ndm_haskell`](https://twitter.com/ndm_haskell)) and I'll include a link [on the website](https://shakebuild.com/#who-uses-shake).
diff --git a/docs/Manual.md b/docs/Manual.md
--- a/docs/Manual.md
+++ b/docs/Manual.md
@@ -8,36 +8,36 @@
     import Development.Shake.Command
     import Development.Shake.FilePath
     import Development.Shake.Util
-    
+
     main :: IO ()
     main = shakeArgs shakeOptions{shakeFiles="_build"} $ do
         want ["_build/run" <.> exe]
-    
+
         phony "clean" $ do
-            putNormal "Cleaning files in _build"
+            putInfo "Cleaning files in _build"
             removeFilesAfter "_build" ["//*"]
-    
+
         "_build/run" <.> exe %> \out -> do
             cs <- getDirectoryFiles "" ["//*.c"]
             let os = ["_build" </> c -<.> "o" | c <- cs]
             need os
-            cmd "gcc -o" [out] os
-    
+            cmd_ "gcc -o" [out] os
+
         "_build//*.o" %> \out -> do
             let c = dropDirectory1 $ out -<.> "c"
             let m = out -<.> "m"
-            () <- cmd "gcc -c" [c] "-o" [out] "-MMD -MF" [m]
-            needMakefileDependencies m
+            cmd_ "gcc -c" [c] "-o" [out] "-MMD -MF" [m]
+            neededMakefileDependencies m
 
-This build system builds the executable `_build/run` from all C source files in the current directory. It will rebuild if you add/remove any C files to the directory, if the C files themselves change, or if any headers used by the C files change. All generated files are placed in `_build`, and a `clean` command is provided that will wipe all the generated files. In the rest of this manual we'll explain how the above code works and how to extend it. 
+This build system builds the executable `_build/run` from all C source files in the current directory. It will rebuild if you add/remove any C files to the directory, if the C files themselves change, or if any headers used by the C files change. All generated files are placed in `_build`, and a `clean` command is provided that will wipe all the generated files. In the rest of this manual we'll explain how the above code works and how to extend it.
 
 #### Running this example
 
 To run the example above:
 
-1. Install the [Haskell Stack](http://haskellstack.org/), which provides a Haskell compiler and package manager.
-3. Type `stack install shake`, to build and install Shake and all its dependencies.
-4. Type `stack exec -- shake --demo`, which will create a directory containing a sample project, the above Shake script (named `Build.hs`), and execute it (which can be done by `runhaskell Build.hs`). For more details see a [trace of `shake --demo`](Demo.md).
+1. Install the [Haskell Stack](https://haskellstack.org/), which provides a Haskell compiler and package manager.
+2. Type `stack install shake`, to build and install Shake and all its dependencies.
+3. Type `stack exec -- shake --demo`, which will create a directory containing a sample project, the above Shake script (named `Shakefile.hs`), and execute it (which can be done by `runhaskell Shakefile.hs`). For more details see a [trace of `shake --demo`](Demo.md).
 
 ## Basic syntax
 
@@ -106,15 +106,15 @@
     "*.rot13" %> \out -> do
         let src = out -<.> "txt"
         need [src]
-        cmd "rot13" src "-o" out
+        cmd_ "rot13" src "-o" out
 
 This rule can build any `.rot13` file. Imagine we are building `"file.rot13"`, it proceeds by:
 
 * Using `let` to define a local variable `src`, using the `-<.>` extension replacement method, which removes the extension from a file and adds a new extension. When `out` is `"file.rot13"` the variable `src` will become `file.txt`.
 * Using `need` to introduce a dependency on the `src` file, ensuring that if `src` changes then `out` will be rebuilt and that `src` will be up-to-date before any further commands are run.
-* Using `cmd` to run the command line `rot13 file.txt -o file.rot13`, which should read `file.txt` and write out `file.rot13` being the ROT13 encoding of the file.
+* Using `cmd_` to run the command line `rot13 file.txt -o file.rot13`, which should read `file.txt` and write out `file.rot13` being the ROT13 encoding of the file.
 
-Many rules follow this pattern -- calculate some local variables, `need` some dependencies, then use `cmd` to perform some actions. We now discuss each of the three statements.
+Many rules follow this pattern -- calculate some local variables, `need` some dependencies, then use `cmd_` to perform some actions. We now discuss each of the three statements.
 
 #### Local variables
 
@@ -128,11 +128,11 @@
 
 An <tt><i>expression</i></tt> is any combination of variables and function calls, for example `out -<.> "txt"`. A list of some common functions is discussed later.
 
-Variables are evaluated by substituting the <tt><i>expression</i></tt> everywhere the <tt><i>variable</i></tt> is used. In the simple example we could have equivalently written: 
+Variables are evaluated by substituting the <tt><i>expression</i></tt> everywhere the <tt><i>variable</i></tt> is used. In the simple example we could have equivalently written:
 
     "*.rot13" %> \out -> do
         need [out -<.> "txt"]
-        cmd "rot13" (out -<.> "txt") "-o" out
+        cmd_ "rot13" (out -<.> "txt") "-o" out
 
 Variables are local to the rule they are defined in, cannot be modified, and should not be defined multiple times within a single rule.
 
@@ -155,24 +155,22 @@
 
 #### Running external commands
 
-The `cmd` function allows you to call system commands, e.g. `gcc`. Taking the initial example, we see: 
+The `cmd_` function allows you to call system commands, e.g. `gcc`. Taking the initial example, we see:
 
-    cmd "gcc -o" [out] os
+    cmd_ "gcc -o" [out] os
 
 After substituting `out` (a string variable) and `os` (a list of strings variable) we might get:
 
-    cmd "gcc -o" ["_make/run"] ["_build/main.o","_build/constants.o"]
+    cmd_ "gcc -o" ["_make/run"] ["_build/main.o","_build/constants.o"]
 
-The `cmd` function takes any number of space-separated expressions. Each expression can be either a string (which is treated as a space-separated list of arguments) or a list of strings (which is treated as a direct list of arguments).  Therefore the above command line is equivalent to either of:
+The `cmd_` function takes any number of space-separated expressions. Each expression can be either a string (which is treated as a space-separated list of arguments) or a list of strings (which is treated as a direct list of arguments).  Therefore the above command line is equivalent to either of:
 
-    cmd "gcc -o _make/run _build/main.o _build/constants.o"
-    cmd ["gcc","-o","_make/run","_build/main.o","_build/constants.o"]
+    cmd_ "gcc -o _make/run _build/main.o _build/constants.o"
+    cmd_ ["gcc","-o","_make/run","_build/main.o","_build/constants.o"]
 
 To properly handle unknown string variables it is recommended to enclose them in a list, e.g. `[out]`, so that even if `out` contains a space it will be treated as a single argument.
 
-The `cmd` function as presented here will fail if the system command returns a non-zero exit code, but see later for how to treat failing commands differently.
-
-As a wart, if the `cmd` call is _not_ the last line of a rule, you must precede it with `() <- cmd ...`.
+The `cmd_` function as presented here will fail if the system command returns a non-zero exit code, but see later for how to treat failing commands differently.
 
 #### Filepath manipulation functions
 
@@ -200,7 +198,7 @@
 
     files <- getDirectoryFiles "src" ["//*.c","//*.cpp"]
 
-The `getDirectoryFiles` operation is tracked by the build system, so if the files in a directory changes the rule will rebuild in the next run. You should only use `getDirectoryFiles` on source files, not files that are generated by the build system, otherwise the results will change while you are running the build and the build may be inconsistent.
+The `getDirectoryFiles` operation is tracked by the build system, so if the files in a directory change the rule will rebuild in the next run. You should only use `getDirectoryFiles` on source files, not files that are generated by the build system, otherwise the results will change while you are running the build and the build may be inconsistent.
 
 #### List manipulations
 
@@ -226,24 +224,24 @@
 
 That will compile `main.c` to `main.o`, and also produce a file `main.m` containing the dependencies. To add these dependencies as dependencies of this rule we can call:
 
-    needMakefileDependencies "main.m"
+    neededMakefileDependencies "main.m"
 
 Now, if either `main.c` or any headers transitively imported by `main.c` change, the file will be rebuilt. In the initial example the complete rule is:
 
     "_build//*.o" %> \out -> do
         let c = dropDirectory1 $ out -<.> "c"
         let m = out -<.> "m"
-        () <- cmd "gcc -c" [c] "-o" [out] "-MMD -MF" [m]
-        needMakefileDependencies m
+        cmd_ "gcc -c" [c] "-o" [out] "-MMD -MF" [m]
+        neededMakefileDependencies m
 
-We first compute the source file `c` (e.g. `"main.c"`) that is associated with the `out` file (e.g. `"_build/main.o"`). We then compute a temporary file `m` to write the dependencies to (e.g. `"_build/main.m"`). We then call `gcc` using the `-MMD -MF` flags and then finally call `needMakefileDependencies`.
+We first compute the source file `c` (e.g. `"main.c"`) that is associated with the `out` file (e.g. `"_build/main.o"`). We then compute a temporary file `m` to write the dependencies to (e.g. `"_build/main.m"`). We then call `gcc` using the `-MMD -MF` flags and then finally call `neededMakefileDependencies`.
 
 #### Top-level variables
 
 Variables local to a rule are defined using `let`, but you can also define top-level variables. Top-level variables are defined before the `main` call, for example:
 
     buildDir = "_build"
- 
+
 You can now use `buildDir` in place of `"_build"` throughout. You can also define parametrised variables (functions) by adding argument names:
 
     buildDir x = "_build" </> x
@@ -253,26 +251,26 @@
     buildDir ("run" <.> exe) %> \out -> do
         ...
 
-All top-level variables and functions can be though of as being expanded wherever they are used, although in practice may have their evaluation shared.
+All top-level variables and functions can be thought of as being expanded wherever they are used, although in practice may have their evaluation shared.
 
 #### A clean command
 
 A standard clean command is defined as:
 
     phony "clean" $ do
-        putNormal "Cleaning files in _build"
+        putInfo "Cleaning files in _build"
         removeFilesAfter "_build" ["//*"]
 
-Running the build system with the `clean` argument, e.g. `runhaskell Build.hs clean` will remove all files under the `_build` directory. This clean command is formed from two separate pieces. Firstly, we can define `phony` commands as:
+Running the build system with the `clean` argument, e.g. `runhaskell Shakefile.hs clean` will remove all files under the `_build` directory. This clean command is formed from two separate pieces. Firstly, we can define `phony` commands as:
 
 <pre>
 phony "<i>name</i>" $ do
     <i>actions</i>
 </pre>
 
-Where <tt><i>name</i></tt> is the name used on the command line to invoke the actions, and <tt><i>actions</i></tt> are the list of things to do in response. These names are not dependency tracked and are simply run afresh each time they are requested.
+Where <tt><i>name</i></tt> is the name used on the command line to invoke the actions, and <tt><i>actions</i></tt> are the list of things to do in response. These names are not dependency tracked and are run afresh each time they are requested.
 
-The <tt><i>actions</i></tt> can be any standard build actions, although for a `clean` rule, `removeFilesAfter` is typical. This function waits until after any files have finished building (which will be none, if you do `runhaskell Build.hs clean`) then deletes all files matching `//*` in the `_build` directory. The `putNormal` function writes out a message to the console, as long as `--quiet` was not passed.
+The <tt><i>actions</i></tt> can be any standard build actions, although for a `clean` rule, `removeFilesAfter` is typical. This function waits until after any files have finished building (which will be none, if you do `runhaskell Shakefile.hs clean`) then deletes all files matching `//*` in the `_build` directory. The `putInfo` function writes out a message to the console, as long as `--quiet` was not passed.
 
 ## Running
 
@@ -280,17 +278,17 @@
 
 #### Compiling the build system
 
-As shown before, we can use `runhaskell Build.hs` to execute our build system, but doing so causes the build script to be compiled afresh each time. A more common approach is to add a shell script that compiles the build system and runs it. In the example directory you will find `build.sh` (Linux) and `build.bat` (Windows), both of which execute the same interesting commands. Looking at `build.sh`:
+As shown before, we can use `runhaskell Shakefile.hs` to execute our build system, but doing so causes the build script to be compiled afresh each time. A more common approach is to add a shell script that compiles the build system and runs it. In the example directory you will find `build.sh` (Linux) and `build.bat` (Windows), both of which execute the same interesting commands. Looking at `build.sh`:
 
     #!/bin/sh
     mkdir -p _shake
-    ghc --make Build.hs -rtsopts -with-rtsopts=-I0 -outputdir=_shake -o _shake/build && _shake/build "$@"
+    ghc --make Shakefile.hs -rtsopts -threaded -with-rtsopts=-I0 -outputdir=_shake -o _shake/build && _shake/build "$@"
 
-This script creates a folder named `_shake` for the build system objects to live in, then runs `ghc --make Build.hs` to produce `_shake/build`, then executes `_shake/build` with all arguments it was given. The `-with-rtsopts` flag instructs the Haskell compiler to disable "idle garbage collection", making more CPU available for the commands you are running, as [explained here](http://stackoverflow.com/questions/34588057/why-does-shake-recommend-disabling-idle-garbage-collection/).
+This script creates a folder named `_shake` for the build system objects to live in, then runs `ghc --make Shakefile.hs` to produce `_shake/build`, then executes `_shake/build` with all arguments it was given. The `-with-rtsopts` flag instructs the Haskell compiler to disable "idle garbage collection", making more CPU available for the commands you are running, as [explained here](https://stackoverflow.com/questions/34588057/why-does-shake-recommend-disabling-idle-garbage-collection/).
 
-Now you can run a build by simply typing `stack exec ./build.sh` on Linux, or `stack exec build.bat` on Windows. On Linux you may want to alias `build` to `stack exec ./build.sh`. For the rest of this document we will assume `build` runs the build system.
+Now you can run a build by typing `stack exec ./build.sh` on Linux, or `stack exec build.bat` on Windows. On Linux you may want to alias `build` to `stack exec ./build.sh`. For the rest of this document we will assume `build` runs the build system.
 
-_Warning:_ You should not use the `-threaded` for GHC 7.6 or below because of a [GHC bug](https://ghc.haskell.org/trac/ghc/ticket/7646). If you do turn on `-threaded`, you should include `-qg -qb` in `-with-rtsopts`. 
+_Warning:_ You should not use the `-threaded` for GHC 7.6 or below because of a [GHC bug](https://ghc.haskell.org/trac/ghc/ticket/7646). If you do turn on `-threaded`, you should include `-qg` in `-with-rtsopts`.
 
 #### Command line flags
 
@@ -313,22 +311,22 @@
 * Running `build --progress`
 * Setting `shakeOptions{shakeProgress = progressSimple}`
 
-The progress message will be displayed in the titlebar of the window, for example `3m12s (82%)` to indicate that the build is 82% complete and is predicted to take a further 3 minutes and 12 seconds. If you are running Windows 7 or higher and place the [`shake-progress`](https://github.org/ndmitchell/shake) utility somewhere on your `%PATH%` then the progress will also be displayed in the taskbar progress indicator:
+The progress message will be displayed in the titlebar of the window, for example `3m12s (82%)` to indicate that the build is 82% complete and is predicted to take a further 3 minutes and 12 seconds. If you are running Windows 7 or higher and place the [`shake-progress`](https://github.com/ndmitchell/shake/releases/tag/shake-progress-1) utility somewhere on your `%PATH%` then the progress will also be displayed in the taskbar progress indicator:
 
 ![](shake-progress.png)
 
-Progress prediction is likely to be relatively poor during the first build and after running `build clean`, as then Shake has no information about the predicted execution time for each rule. To rebuild from scratch without running clean (because you really want to see the progress bar!) you can use the argument `--always-make`, which assumes all rules need rerunning. 
+Progress prediction is likely to be relatively poor during the first build and after running `build clean`, as then Shake has no information about the predicted execution time for each rule. To rebuild from scratch without running clean (because you really want to see the progress bar!) you can use the argument `--always-make`, which assumes all rules need rerunning.
 
 <span class="target" id="lint"></span>
 
 #### Lint
 
-Shake features a built in "lint" features to check the build system is well formed. To run use `build --lint`. You are likely to catch more lint violations if you first `build clean`. Sadly, lint does _not_ catch missing dependencies. However, it does catch:
+Shake features a built in "lint" feature to check the build system is well formed. To run use `build --lint`. You are likely to catch more lint violations if you first `build clean`. Sadly, lint does _not_ catch missing dependencies. However, it does catch:
 
-* Changing the current directory, typically with `setCurrentDirectory`. You should never change the current directory within the build system as multiple rules running at the same time share the current directory. You can still run `cmd` calls in different directories using the `Cwd` argument.
+* Changing the current directory, typically with `setCurrentDirectory`. You should never change the current directory within the build system as multiple rules running at the same time share the current directory. You can still run `cmd_` calls in different directories using the `Cwd` argument.
 * Outputs that change after Shake has built them. The usual cause of this error is if the rule for `foo` also writes to the file `bar`, despite `bar` having a different rule producing it.
 
-There is a performance penalty for building with `--lint`, but it is typically small.
+There is a performance penalty for building with `--lint`, but it is typically small. For more details see [this page on all the Lint options](Lint.md).
 
 <span class="target" id="profiling"></span>
 
@@ -344,8 +342,8 @@
 * Run in single-threaded mode (`-j1`) to make any output clearer by not interleaving commands.
 * By default a Shake build system prints out a message every time it runs a command. Use verbose mode (`--verbose`) to print more information to the screen, such as which rule is being run. Additional `--verbose` flags increase the verbosity. Three verbosity flags produce output intended for someone debugging the Shake library itself, rather than a build system based on it.
 * To raise a build error call `error "error message"`. Shake will abort, showing the error message.
-* To output additional information use `putNormal "output message"`. This message will be printed to the console when it is reached.
-* To show additional information with either `error` or `putNormal`, use `error $ show ("message", myVariable)`. This allows you to show any local variables.
+* To output additional information use `putInfo "output message"`. This message will be printed to the console when it is reached.
+* To show additional information with either `error` or `putInfo`, use `error $ show ("message", myVariable)`. This allows you to show any local variables.
 
 ## Extensions
 
@@ -353,15 +351,15 @@
 
 #### Advanced `cmd` usage
 
-The `cmd` function can also obtain the stdout and stderr streams, along with the  exit code. As an example:
+The `cmd_` has a related function `cmd` that can also obtain the stdout and stderr streams, along with the  exit code. As an example:
 
     (Exit code, Stdout out, Stderr err) <- cmd "gcc --version"
 
 Now the variable `code` is bound to the exit code, while `out` and `err` are bound to the stdout and stderr streams. If `ExitCode` is not requested then any non-zero return value will raise an error.
 
-The `cmd` function also takes additional parameters to control how the command is run. As an example:
+Both `cmd_` and `cmd` also take additional parameters to control how the command is run. As an example:
 
-    cmd Shell (Cwd "temp") "pwd"
+    cmd_ Shell (Cwd "temp") "pwd"
 
 This runs the `pwd` command through the system shell, after first changing to the `temp` directory.
 
@@ -370,8 +368,8 @@
 You can use tracked dependencies on environment variables using the `getEnv` function. As an example:
 
     link <- getEnv "C_LINK_FLAGS"
-    let linkFlags = fromMaybe "" link    
-    cmd "gcc -o" [output] inputs linkFlags
+    let linkFlags = fromMaybe "" link
+    cmd_ "gcc -o" [output] inputs linkFlags
 
 This example gets the `$C_LINK_FLAGS` environment variable (which is `Maybe String`, namely a `String` that might be missing), then using `fromMaybe` defines a local variable `linkFlags` that is the empty string when `$C_LINK_FLAGS` is not set. It then passes these flags to `gcc`.
 
@@ -398,9 +396,9 @@
     want [show i <.> "exe" | i <- [1..100]]
     "*.exe" %> \out -> do
         withResource disk 1 $ do
-            cmd "ld -o" [out] ...
+            cmd_ "ld -o" [out] ...
     "*.o" %> \out -> do
-        cmd "cl -o" [out] ...
+        cmd_ "cl -o" [out] ...
 
 Assuming `-j8`, this allows up to 8 compilers, but only a maximum of 4 linkers.
 
@@ -410,19 +408,19 @@
 
     ["//*.bison.h","//*.bison.c"] &%> \[outh, outc] -> do
         let src = outc -<.> "y"
-        cmd "bison -d -o" [outc] [src]
+        cmd_ "bison -d -o" [outc] [src]
 
 Now we define a list of patterns that are matched, and get a list of output files. If any output file is required, then all output files will be built, with proper dependencies.
 
 #### Changing build rules
 
-Shake build systems are set up to rebuild files when the dependencies change, but mostly assume that the build rules themselves do not change. To minimise the impact of build rule changes there are three approaches:
+Shake build systems are set up to rebuild files when the dependencies change, but mostly assume that the build rules themselves do not change (including both the code and the shell commands contained within). To minimise the impact of build rule changes there are three approaches:
 
 _Use configuration files:_ Most build information, such as which files a C file includes, can be computed from source files. Where such information is not available, such as which C files should be linked together to form an executable, use configuration files to provide the information. The rule for linking can use these configuration files, which can be properly tracked. Moving any regularly changing configuration into separate files will significantly reduce the number of build system changes.
 
 _Depend on the build source:_ One approach is to depend on the build system source in each of the rules, then if _any_ rules change, _everything_ will rebuild. While this option is safe, it may cause a significant number of redundant rebuilds. As a restricted version of this technique, for a generated file you can include a dependency on the generator source and use `writeFileChanged`. If the generator changes it will rerun, but typically only a few generated files will change, so little is rebuilt.
 
-_Use a version stamp:_ There is a field named `shakeVersion` in the `ShakeOptions` record. If the build system changes in a significant and incompatible way, you can change this field to force a full rebuild. If you want all rules to depend on all rules, you can put a hash of the build system source in the version field, as [described here](http://stackoverflow.com/questions/18532552/shake-how-to-reliably-automatically-force-rebuild-when-my-rules-change-becomi/18532553#18532553).
+_Use a version stamp:_ There is a field named `shakeVersion` in the `ShakeOptions` record. If the build system changes in a significant and incompatible way, you can change this field to force a full rebuild. If you want all rules to depend on all rules, you can put a hash of the build system source in the version field, as [described here](https://stackoverflow.com/questions/18532552/shake-how-to-reliably-automatically-force-rebuild-when-my-rules-change-becomi/18532553#18532553).
 
 ## The Haskell Zone
 
@@ -445,7 +443,7 @@
 
     pattern %> actions = (pattern ?==) ?> actions
 
-Where `?==` is a function for matching file patterns. 
+Where `?==` is a function for matching file patterns.
 
 #### Haskell Actions
 
diff --git a/docs/manual/Build.hs b/docs/manual/Build.hs
deleted file mode 100644
--- a/docs/manual/Build.hs
+++ /dev/null
@@ -1,24 +0,0 @@
-import Development.Shake
-import Development.Shake.Command
-import Development.Shake.FilePath
-import Development.Shake.Util
-
-main :: IO ()
-main = shakeArgs shakeOptions{shakeFiles="_build"} $ do
-    want ["_build/run" <.> exe]
-
-    phony "clean" $ do
-        putNormal "Cleaning files in _build"
-        removeFilesAfter "_build" ["//*"]
-
-    "_build/run" <.> exe %> \out -> do
-        cs <- getDirectoryFiles "" ["//*.c"]
-        let os = ["_build" </> c -<.> "o" | c <- cs]
-        need os
-        cmd "gcc -o" [out] os
-
-    "_build//*.o" %> \out -> do
-        let c = dropDirectory1 $ out -<.> "c"
-        let m = out -<.> "m"
-        () <- cmd "gcc -c" [c] "-o" [out] "-MMD -MF" [m]
-        needMakefileDependencies m
diff --git a/docs/manual/Shakefile.hs b/docs/manual/Shakefile.hs
new file mode 100644
--- /dev/null
+++ b/docs/manual/Shakefile.hs
@@ -0,0 +1,24 @@
+import Development.Shake
+import Development.Shake.Command
+import Development.Shake.FilePath
+import Development.Shake.Util
+
+main :: IO ()
+main = shakeArgs shakeOptions{shakeFiles="_build"} $ do
+    want ["_build/run" <.> exe]
+
+    phony "clean" $ do
+        putInfo "Cleaning files in _build"
+        removeFilesAfter "_build" ["//*"]
+
+    "_build/run" <.> exe %> \out -> do
+        cs <- getDirectoryFiles "" ["//*.c"]
+        let os = ["_build" </> c -<.> "o" | c <- cs]
+        need os
+        cmd_ "gcc -o" [out] os
+
+    "_build//*.o" %> \out -> do
+        let c = dropDirectory1 $ out -<.> "c"
+        let m = out -<.> "m"
+        cmd_ "gcc -c" [c] "-o" [out] "-MMD -MF" [m]
+        neededMakefileDependencies m
diff --git a/docs/manual/build.bat b/docs/manual/build.bat
--- a/docs/manual/build.bat
+++ b/docs/manual/build.bat
@@ -1,2 +1,2 @@
 @mkdir _shake 2> nul
-@ghc --make Build.hs -rtsopts -with-rtsopts=-I0 -outputdir=_shake -o _shake/build && _shake\build %*
+@ghc --make Shakefile.hs -rtsopts -threaded -with-rtsopts=-I0 -outputdir=_shake -o _shake/build && _shake\build %*
diff --git a/docs/manual/build.sh b/docs/manual/build.sh
--- a/docs/manual/build.sh
+++ b/docs/manual/build.sh
@@ -1,3 +1,3 @@
 #!/bin/sh
 mkdir -p _shake
-ghc --make Build.hs -rtsopts -with-rtsopts=-I0 -outputdir=_shake -o _shake/build && _shake/build "$@"
+ghc --make Shakefile.hs -rtsopts -threaded -with-rtsopts=-I0 -outputdir=_shake -o _shake/build && _shake/build "$@"
diff --git a/html/profile.html b/html/profile.html
--- a/html/profile.html
+++ b/html/profile.html
@@ -6,167 +6,205 @@
 <title>Shake report</title>
 
 <!-- Profiling output -->
-<script src="profile-data.js"></script>
-<script src="version.js"></script>
+<script src="data/profile-data.js"></script>
+<script src="data/metadata.js"></script>
 <!-- Libraries -->
 <script src="lib/jquery.js"></script>
 <script src="lib/jquery.flot.js"></script>
 <script src="lib/jquery.flot.stack.js"></script>
-<script src="viz.js"></script>
+<script src="lib/jquery.dgtable.js"></script>
 <!-- Functions for creating info from Shake builds -->
 <script src="shake.js"></script>
-<script language="javascript">
-function name(a, b) { return named(a, b); }
-initProfile();
-</script>
 
 <style type="text/css">
-body {font-family: sans-serif; font-size: 10pt;}
+body {font-family: sans-serif; font-size: 10pt; background-color: #e8e8e8;}
 .data {font-size: 9pt; border-spacing: 0px; border-collapse: collapse;}
 .data td {padding-left: 7px; padding-right: 7px;}
 .header {font-weight: bold; background-color: #eee !important;}
 .header td:hover {background-color: #ccc !important;}
 .header td {border: 1px solid #ccc; cursor: pointer;}
 .data tr:hover {background-color: #ddd !important; color: black !important;}
-input, select {border: 1px solid #ccc;}
 * {box-sizing: border-box;}
-html, body {height: 100%; width:100%;}
-#run {font-weight: bold;}
-.sort {color: #aaa;}
-#link:visited {color: rgb(0,0,238);}
-ul.space > li {padding-top: 8px; padding-bottom: 8px;}
-ul.space {padding-left: 20px;}
-.version {color: gray; font-style: italic;}
-.shake {
-    text-decoration: none;
-    font-family: monospace;
-    color: black;
+html, body, .fill {height: 100%; width:100%;}
+table.fill {border-spacing: 0px;}
+input:focus {border-color: rgb(77, 144, 254) !important; outline-width: 0px !important;}
+.note {margin-left: 10px;}
+.note, .note a {color: gray;}
+a tt {color: #315273;}
+
+.tabstrip a {
+    border-radius: 4px 4px 0px 0px;
+    border: 1px solid gray;
+    padding: 4px 8px;
+    box-sizing: border-box;
+    cursor: pointer;
+    white-space: nowrap;
+    user-select: none;
+ }
+.tabstrip .bottom {
+    padding: 4px 8px;
+    border-bottom: 1px solid gray;
 }
-</style>
+.tabstrip .active {
+    border-top: 4px solid orange;
+    border-bottom: 3px solid white;
+    background-color: white;
+}
+.right { text-align: right; }
+.dropdown {
+    border:1px solid gray;
+    background-color:white;
+    white-space:nowrap;
+    position:absolute;
+    right:10px;
+    padding-right:10px;
+    box-shadow: 3px 3px 5px #ccc;
+    z-index: 100;
+}
+.dropdown a tt {
+    cursor: pointer;
+    color: #1467bb !important;
+}
+.details a {
+    cursor: pointer;
+    color: #1467bb;
+}
 
-</head>
-<body style="margin:0px;padding:0px;">
+/* My overrides */
+/* Make the colors and font size match better */
+.dgtable-row:hover { background-color: #e8e8e8 !important; }
+.dgtable-header-cell:hover { background-color: #ddd !important; }
+.dgtable-header-cell { background-color: #eee !important; }
+.dgtable-cell:last-child, .dgtable-header-cell:last-child { border-right: 1px solid #ccc; }
 
-<table style="width:100%;height:100%;padding:8px;">
-    <tr><td>
-        <table width="100%"><tr>
-            <td>
-                <button id="run">Run</button>
-            </td>
-            <td>
-                <select id="mode">
-                    <option value="summary">Summary</option>
-                    <option value="help">Help</option>
-                    <option value="cmd-plot">Command plot</option>
-                    <option value="cmd-table">Command table</option>
-                    <option value="rule-table">Rule table</option>
-                    <option value="rule-graph">Rule graph</option>
-                </select>
-            </td>
-            <td width="100%">
-                <input id="query" style="width:100%;" />
-            </td>
-            <td style="padding-left:10px;">
-                <a title="A link to the currently typed query" id="link" target="_blank" href="">Link</a>
-            </td>
-        </tr></table>
-    </td></tr>
-    <tr><td>
-        <hr style="border-top:1px solid #ccc;" />
-    </td></tr>
-    <tr style="height:100%;width:100%;"><td>
-        <div style="height:100%;width:100%;min-width:150px;min-height:150px;overflow:auto;" id="output">Loading...</div>
-    </td></tr>
-</table>
+/* Make the header smaller */
+.dgtable-header-row, .dgtable-header-cell { height: 22px !important; }
+.dgtable-header-cell { padding: 2px 4px !important; }
+.dgtable-header-cell, .dgtable-cell-preview.header { font-size: 9pt !important; }
 
-<div id="welcome" style="display:none;">
-    <p>
-        <b>New to Shake reports?</b> Select 'Help' from the drop-down box (currently displaying 'Summary') then press 'Run'.
-    </p>
-</div>
+/* Make the rows smaller */
+.dgtable-row { height: 22px !important; }
+.dgtable-row:first-child { height: 23px !important; }
+.dgtable-cell { padding: 2px 4px !important; height: 22px !important; }
+.dgtable-cell, .dgtable-cell-preview{ font-size: 9pt !important; }
 
-<div id="error" style="display:none;">
-    <h3 style="color:#d00;">Query <span class="name">parse</span> error</h3>
-    <table>
-        <tr><td><ul style="margin:0px;"><li>Error message:</li></ul></td><td><code><span class="message">message</span></code></td></tr>
-        <tr><td><ul style="margin:0px;"><li>User query:</li></ul></td><td><code><span class="query">the query</span></code></td></tr>
-    </table>
-    <p>
-        For information about the query language, see <a class="example" data-mode="help" data-query="">Help</a>.
-    </p>
-</div>
+.dgtable-wrapper * {
+    box-sizing: border-box;
+}
+.dgtable-wrapper {
+    border: solid 1px #ccc;
+}
+.dgtable {
+    border-top: solid 1px #ccc;
+    max-width: 100%;
+    background-color: transparent;
+}
+.dgtable-header {
+    max-width: 100%;
+    overflow: hidden;
+    background: #eee;
+}
+.dgtable-header-row {
+    height: 26px;
+}
+.dgtable-header-cell {
+    float: left;
+    padding: 4px;
+    height: 26px;
+    border-left: solid 1px #ccc;
+    background: #ddd;
+    font-size: 13px;
+    line-height: 16px;
+    font-weight: bold;
+    cursor: default;
+    text-align: left;
+}
+.dgtable-header-cell:first-child {
+    border-left: 0;
+}
+.dgtable-header-cell > div {
+    border: 1px dashed transparent;
+    white-space: nowrap;
+    overflow-x: hidden;
+    text-overflow: ellipsis;
+}
+.dgtable-header-cell.drag-over > div {
+    border-color: #666;
+    background: #bbb;
+}
+.dgtable-row {
+    border-top: solid 1px #ccc;
+    height: 28px;
+}
+.dgtable-row:first-child {
+    border-top: 0;
+    height: 29px;
+}
+.dgtable.virtual .dgtable-row {
+    border-top: 0;
+    border-bottom: solid 1px #ccc;
+}
+.dgtable-cell {
+    float: left;
+    padding: 4px 4px 4px;
+    height: 28px;
+    border-left: solid 1px #ccc;
+    font-size: 16px;
+    line-height: 19px;
+}
+.dgtable-cell > div {
+    max-height: 100%;
+    white-space: nowrap;
+    overflow: hidden
+}
+.dgtable-cell:first-child {
+    border-left: 0;
+}
+.dgtable-header-cell.sortable {
+    cursor: pointer;
+}
+.dgtable-header-cell.sorted .sort-arrow {
+    float: right;
+    display: inline-block;
+    width: 15px;
+    height: 6px;
+    margin: 5px 0 0 0;
+    background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAGCAMAAAAi7JTKAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMAUExURQNOov///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH52dxwAAAACdFJOU/8A5bcwSgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAB9JREFUCB0FwQEBAAAAgJD8Px0VoFKgRKEIpRBUEAgMBlQAL3y6umEAAAAASUVORK5CYII=") no-repeat center center;
+}
 
-<div id="help" style="display:none;">
-    <p>
-        Shake reports provide a way of filtering, grouping and viewing the result of running a Shake build system. A query is entered at the top using the text box, run using the 'Run' button, and produces a report whose type is selected from the drop-down box. The 'Link' hyperlink provides a link to the currently entered query, which is useful for copying/sharing.
-    </p>
-    <h3>Report types</h3>
-    <p>
-        The drop-down box, currently displaying 'Help', let's you pick the type of report. The best way to learn about the report types is to try them out (all work with the empty query). The types are:
-    </p>
-    <ul class="space">
-        <li><b>Summary:</b> Display summary statistics about the Shake database. The term 'rule' refers to any Shake rule, and there will be one rule for everything that gets built or tracked, including source files. The term 'traced command' refers to any call to <a class="shake">traced</a>, which is automatically inserted by the <a class="shake">command</a> function. The reported parallelism refers to the average number of traced commands executing during the last build - for example, a parallelism of 4.0 when using <a class="shake">shakeThreads</a>=4 would be a perfect speedup. The time spent not executing traced commands includes time when Shake was checking dependencies and any Haskell operations performed by the rules.</li>
-        <li><b>Help:</b> This help document.</li>
-        <li><b>Command plot:</b> This plot shows which traced commands were executing at any time. The Y axis is the number of simultaneous traced commands and the X axis is the progress through the last run of the build system that executed any rules. Some useful queries are:
-            <ul>
-                <li><a class="example" data-mode="cmd-plot" data-query="">by default</a> - display when each traced command was executing.</li>
-                <li><a class="example" data-mode="cmd-plot">group("commands")</a> - display a the total parallelism, not grouped by command.</li>
-                <li><a class="example" data-mode="cmd-plot">name(/(\.[a-zA-Z0-9_]+)$/, "???")</a> - display parallelism grouped by result extension.</li>
-            </ul>
-        </li>
-        <li><b>Command table:</b> This table shows all traced commands. 'name' is the group name, by default the string passed to <a class="shake">trace</a>. 'count' is the number of commands that were grouped together. 'time' is the amount of time spent executing the commands, both in absolute terms and as a percentage of the time required to build everything (including rules which are not traced). Some useful queries are:
-            <ul>
-                <li><a class="example" data-mode="cmd-table" data-query="">by default</a> - display all traced commands.</li>
-                <li><a class="example" data-mode="cmd-table">name(/(\.[a-zA-Z0-9_]+)$/, "???")</a> - display parallelism grouped by result extension.</li>
-                <li><a class="example" data-mode="cmd-table">group(command() + " - " + name())</a> - the complete list of all commands by rule.</li>
-                <li><a class="example" data-mode="cmd-table">name(/^(.*)\/[^\/]*/,"root") &amp;&amp; group(command())</a> - commands grouped per directory.</li>
-                <li><a class="example" data-mode="cmd-table">name(slowestRule())</a> - what commands did the slowest rule run.</li>
-            </ul>
-        </li>
-        <li><b>Rule table:</b> This table shows all rules. 'name', 'count' and 'time' are the same as for the command table, with the default name being the rule result. 'cost' is the time to rebuild if all the files changed, where a higher cost is worse. 'leaf' is true if the rule has no dependencies, typically source files. 'runs' is the number of executions since the file was built, where 0 means it was built in the last run. 'unchanged' is true if the last time the rule built it did not change value, and thus rules depending on it did not rebuild. Some useful queries are:
-            <ul>
-                <li><a class="example" data-mode="rule-table" data-query="">by default</a> - display all rules.</li>
-                <li><a class="example" data-mode="rule-table">name(/(\.[a-zA-Z0-9_]+)$/, "???")</a> - display rules grouped by result extension.</li>
-                <li><a class="example" data-mode="rule-table">ancestorOf(slowestRule()) && leaf() && run() == 0</a> - while leaf nodes changed in the last run to cause a rebuild of a particular rule (replace <code>slowestRule()</code> with <code>"rule name"</code> to use a different rule.</li>
-                <li><a class="example" data-mode="rule-table">parentOf(slowestRule()) && !unchanged()</a> - what immediate dependency caused a particular rule to rebuild most recently (sort by 'run' to see the answer first).</li>
-                <li><a class="example" data-mode="rule-table">!name(/\.[a-zA-Z0-9_]+$/)</a> - which rules have no extension.</li>
-            </ul>
-        </li>
-        <li><b>Rule graph:</b> This table shows the rules and their dependencies. An arrow from a child node to a parent node indicates that the child depends on the parent. A solid line is a direct dependency, a dashed line is an indirect dependency, through some hidden intermediate node. Some useful queries are:
-            <ul>
-                <li><a class="example" data-mode="rule-graph">name(/(\.[a-zA-Z0-9_]+)$/, "???")</a> - display rules grouped by result extension.</li>
-            </ul>
-        </li>
-    </ul>
-    <h3>Query language</h3>
-    <p>
-        The query language is a Javascript expression which produces <code>true</code> to include the row, and may call <code>group</code> to indicate grouping. You can use the standard Javascript operators (e.g. <code>==</code> and <code>&amp;&amp;</code>). Anything which takes a <code>RegExp</code> can also accept a <code>string</code>, which is then treated as a literal unanchored regular expression. The following functions are available:
-    </p>
-    <ul class="space">
-        <li><code>group(x : string) : true</code> - assign this item the given group. Multiple calls to <code>group</code> result in a space-separated name. The group name can also be set using <code>name</code> or <code>command</code> with captured regular expressions.</li>
-        <li><code>leaf() : bool</code> - is the rule a leaf, with no dependencies.</li>
-        <li><code>run() : int</code> - when was the rule last run, with 0 for run in the last tracked build, and higher numbers for run longer ago.</li>
-        <li><code>run(x : int) : bool</code> - equality against a run number, <code>run(0)</code> is equivalent to <code>run() == 0</code>.</li>
-        <li><code>unchanged() : bool</code> - last time the rule was built, did the value not change.</li>
-        <li><code>slowestRule() : string</code> - the name of the rule which took longest to build.</li>
-        <li><code>name() : string</code> - the name of the current rule.</li>
-        <li><code>name(x : RegExp) : bool</code> - a regular expression to match against the name of the current rule. If the regular expression contains captured patterns, these will be used as the <code>group</code></li>
-        <li><code>name(x : RegExp, def : string) : true</code> - a regular expression to match against the name of the current rule, including captured patterns for the <code>group</code>. If the regular expression does not match, the function will still return true but <code>def</code> will be used as the group.</li>
-        <li><code>rename(from : string, to : string) : true</code> - change <code>name</code> so any string <code>from</code> is replaced with <code>to</code>, useful for replacing an object directory (which is uninteresting) with something like $OBJ.</li>
-        <li><code>rename(from : string) : true</code> - rename using <code>""</code> as the replacement string.</li>
-        <li><code>command() : string</code> - when matching rules this is the name of the first command the rule executed, or <code>""</code> if the rule ran no commands. When matching commands this is the name of each command in turn.</li>
-        <li><code>command(x : RegExp) : bool</code> - a regular expression to match against any of the commands, including grouping as per <code>name</code>.</li>
-        <li><code>command(x : RegExp, def : string) : true</code> - works the same as the <code>name</code> function which takes two arguments.</li>
-        <li><code>childOf(x : RegExp) : bool</code> - is this rule a direct child of <code>x</code>, the rule for this item calls <a class="shake">need</a>/<a class="shake">apply</a> on <code>x</code>.</li>
-        <li><code>descendantOf(x : RegExp) : bool</code> - is this rule a descendant of <code>x</code>, a change in <code>x</code> will cause this rule to rebuild (ignoring unchanging rules).</li>
-        <li><code>parentOf(x : RegExp) : bool</code> - is this rule a direct parent of <code>x</code>, the rule for <code>x</code> calls <a class="shake">need</a>/<a class="shake">apply</a> on this item.</li>
-        <li><code>ancestorOf(x : RegExp) : bool</code> - is this rule an ancestor of <code>x</code>, a change in this rule will cause <code>x</code> to rebuild (ignoring unchanging rules).</li>
-        <li><code>textColor(c : color) : true</code> - set the color of this group to the given color, represented as a string - either the name of a color (<code>"red"</code>) or a hex value (<code>"#ff0000</code>). If multiple <code>textColor</code> calls are given in one query, the last one will be used. If multiple different <code>textColor</code> values are given to one group, the group will not be colored.</li>
-        <li><code>textColor(c : color, b : bool) : true</code> - set the <code>textColor</code> of this group if the second argument is <code>true</code>.</li>
-        <li><code>backColor(c : color) : true</code> - like <code>textColor</code> but to set the background color.</li>
-        <li><code>backColor(c : color, b : bool) : true</code> -  like <code>textColor</code> but to set the background color.</li>
-    </ul>
-</div>
+.dgtable-header-cell.sorted.desc .sort-arrow {
+    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAGCAMAAAAi7JTKAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMAUExURQNOov///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH52dxwAAAACdFJOU/8A5bcwSgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAB9JREFUCB0FwQEBAAAAgJD8Px2BQFBBKIUoFClQKkANBywAL6PcDsUAAAAASUVORK5CYII=");
+}
 
+.dgtable-cell-preview {
+    font-size: 16px;
+    line-height: 19px;
+}
+
+/* Making the cell preview show correct styling when previewing header cells */
+.dgtable-cell-preview.header {
+    font-size: 13px;
+    line-height: 16px;
+    font-weight: bold;
+    text-align: left;
+}
+
+.dgtable-cell-preview.header > div {
+    border: 1px dashed transparent;
+}
+
+.dgtable-cell-preview.header.sortable {
+    cursor: pointer;
+}
+
+.dgtable-cell-preview.header.drag-over > div {
+    border-color: #666;
+    background: #bbb;
+}
+</style>
+
+</head>
+<body style="margin:0px;padding:0px;" onload="profileLoaded(profile)">
+    Loading...
 </body>
 </html>
diff --git a/html/progress.html b/html/progress.html
--- a/html/progress.html
+++ b/html/progress.html
@@ -10,8 +10,8 @@
 <script src="lib/jquery.flot.js"></script>
 <script src="lib/jquery.flot.stack.js"></script>
 <!-- Progress output -->
-<script src="progress-data.js"></script>
-<script src="version.js"></script>
+<script src="data/progress-data.js"></script>
+<script src="data/metadata.js"></script>
 <!-- Functions for creating info from progress info -->
 <script src="shake.js"></script>
 <script>
diff --git a/html/shake.js b/html/shake.js
--- a/html/shake.js
+++ b/html/shake.js
@@ -1,978 +1,1029 @@
 "use strict";
-var Summary = (function () {
-    function Summary() {
-        this.count = 0;
-        this.countLast = 0;
-        this.highestRun = 0;
-        this.sumExecution = 0;
-        this.maxExecution = 0;
-        this.maxExecutionName = "";
-        this.countTrace = 0;
-        this.countTraceLast = 0;
-        this.sumTrace = 0;
-        this.sumTraceLast = 0;
-        this.maxTrace = 0;
-        this.maxTraceName = "";
-        this.maxTraceStopLast = 0;
-    }
-    return Summary;
-})();
-function summary(dat) {
-    var res = new Summary();
-    res.count = dat.length;
-    for (var _i = 0; _i < dat.length; _i++) {
-        var e = dat[_i];
-        var isLast = e.built === 0;
-        res.countLast += isLast ? 1 : 0;
-        res.sumExecution += e.execution;
-        res.maxExecution = Math.max(res.maxExecution, e.execution);
-        if (res.maxExecution === e.execution)
-            res.maxExecutionName = e.name;
-        res.highestRun = Math.max(res.highestRun, e.changed);
-        var traces = e.traces;
-        if (!traces)
-            continue;
-        for (var _a = 0; _a < traces.length; _a++) {
-            var t_1 = traces[_a];
-            var time = t_1.stop - t_1.start;
-            res.countTrace += 1;
-            res.countTraceLast += isLast ? 1 : 0;
-            res.sumTrace += time;
-            res.sumTraceLast += isLast ? time : 0;
-            res.maxTrace = Math.max(res.maxTrace, time);
-            if (res.maxTrace == time)
-                res.maxTraceName = t_1.command;
-            res.maxTraceStopLast = Math.max(res.maxTraceStopLast, isLast ? t_1.stop : 0);
-        }
-    }
-    return res;
-}
-function showSummary(sum) {
-    return ["This database has tracked " + (sum.highestRun + 1) + " run" + plural(sum.highestRun + 1) + ".",
-        "There are " + sum.count + " rules (" + sum.countLast + " rebuilt in the last run).",
-        "Building required " + sum.countTrace + " traced commands (" + sum.countTraceLast + " in the last run).",
-        "The total (unparallelised) build time is " + showTime(sum.sumExecution) + " of which " + showTime(sum.sumTrace) + " is traced commands.",
-        "The longest rule takes " + showTime(sum.maxExecution) + " (" + sum.maxExecutionName + ") and the longest traced command takes " + showTime(sum.maxTrace) + " (" + sum.maxTraceName + ").",
-        "Last run gave an average parallelism of " + (sum.maxTraceStopLast === 0 ? 0 : sum.sumTraceLast / sum.maxTraceStopLast).toFixed(2) + " times over " + showTime(sum.maxTraceStopLast) + "."
-    ];
-}
-var Prepare = (function () {
-    function Prepare() {
-    }
-    return Prepare;
-})();
-function addRdeps(dat) {
-    var rdeps = [];
-    for (var i = 0; i < dat.length; i++)
-        rdeps[i] = {};
-    for (var i = 0; i < dat.length; i++) {
-        for (var _i = 0, _a = dat[i].depends; _i < _a.length; _i++) {
-            var j = _a[_i];
-            rdeps[j][i] = null;
-        }
-    }
-    var res = dat;
-    for (var i = 0; i < rdeps.length; i++) {
-        var ans = [];
-        for (var j in rdeps[i])
-            ans.push(Number(j));
-        res[i].rdeps = ans;
-    }
-    return res;
-}
-function calcRebuildCosts(dat, xs) {
-    var seen = {};
-    var tot = 0;
-    function f(i) {
-        if (i in seen)
-            return;
-        seen[i] = null;
-        tot += dat[i].execution;
-        for (var _i = 0, _a = dat[i].rdeps; _i < _a.length; _i++) {
-            var j = _a[_i];
-            f(j);
-        }
-    }
-    if (xs.length === 1 && dat[xs[0]].depends.length === 1)
-        tot = dat[dat[xs[0]].depends[0]].cost + dat[xs[0]].execution;
-    else {
-        for (var _i = 0; _i < xs.length; _i++) {
-            var x = xs[_i];
-            f(x);
-        }
-    }
-    return tot;
-}
-function addCost(dat) {
-    var res = dat;
-    for (var i = 0; i < dat.length; i++) {
-        res[i].cost = calcRebuildCosts(res, [i]);
-    }
-    return res;
-}
-function prepare(dat_) {
-    var sum = summary(dat_);
-    var dat = addCost(addRdeps(dat_));
-    function toHash(r) {
-        return typeof r === "string" ? "$" + r : "/" + r.source;
-    }
-    function findDirect(key) {
-        var c = cache(toHash, function (r) {
-            var want = {};
-            for (var _i = 0; _i < dat.length; _i++) {
-                var e = dat[_i];
-                if (testRegExp(r, e.name)) {
-                    var deps = (e)[key];
-                    for (var _a = 0; _a < deps.length; _a++) {
-                        var j = deps[_a];
-                        want[j] = null;
-                    }
-                }
-            }
-            return want;
-        });
-        return function (i, r) { return i in c(r); };
-    }
-    function findTransitive(key, dirFwd) {
-        var c = cache(toHash, function (r) {
-            var want = {};
-            for (var i = 0; i < dat.length; i++) {
-                var j = dirFwd ? i : dat.length - 1 - i;
-                if ((j in want) || testRegExp(r, dat[j].name)) {
-                    want[j] = null;
-                    var deps = (dat[j])[key];
-                    for (var _i = 0; _i < deps.length; _i++) {
-                        var k = deps[_i];
-                        want[k] = null;
-                    }
-                }
-            }
-            return want;
-        });
-        return function (i, r) { return i in c(r); };
-    }
-    return {
-        original: dat,
-        summary: sum,
-        dependsOnThis: findDirect("rdeps"),
-        thisDependsOn: findDirect("depends"),
-        dependsOnThisTransitive: findTransitive("depends", false),
-        thisDependsOnTransitive: findTransitive("rdeps", true)
-    };
-}
-function colorAnd(c1, c2) {
-    return c1 === null ? c2 : c1 === c2 ? c1 : undefined;
-}
-var Result = (function () {
-    function Result() {
-    }
-    return Result;
-})();
-function ruleFilter(dat, query) {
-    queryData = dat;
-    var f = readQuery(query);
-    var res = {};
-    for (queryKey = 0; queryKey < dat.original.length; queryKey++) {
-        queryVal = dat.original[queryKey];
-        queryName = queryVal.name;
-        queryGroup = null;
-        queryBackColor = null;
-        queryTextColor = null;
-        if (f()) {
-            if (queryGroup === null)
-                queryGroup = queryName;
-            if (!(queryGroup in res))
-                res[queryGroup] = { items: [queryKey], text: queryTextColor, back: queryBackColor };
-            else {
-                var c = res[queryGroup];
-                c.items.push(queryKey);
-                c.text = colorAnd(c.text, queryTextColor);
-                c.back = colorAnd(c.back, queryBackColor);
-            }
-        }
-    }
-    return res;
-}
-var ResultTable = (function () {
-    function ResultTable() {
-    }
-    return ResultTable;
-})();
-function ruleTable(dat, query) {
-    function bools(x, y) {
-        return x === "" ? y : x === y ? x : "both";
-    }
-    var res = ruleFilter(dat, query);
-    var ans = [];
-    for (var s in res) {
-        var xs = res[s].items;
-        var time = 0;
-        var leaf = "";
-        var unchanged = "";
-        var run = 100000;
-        for (var i = 0; i < xs.length; i++) {
-            var x = dat.original[xs[i]];
-            time += x.execution;
-            leaf = bools(leaf, x.depends.length === 0);
-            unchanged = bools(unchanged, x.changed !== x.built);
-            run = Math.min(run, x.built);
-        }
-        ans.push({ name: s, count: xs.length, time: time, back: res[s].back, text: res[s].text, cost: calcRebuildCosts(dat.original, xs), leaf: leaf, run: run, unchanged: unchanged });
-    }
-    return ans;
-}
-var ResultGraph = (function () {
-    function ResultGraph() {
-    }
-    return ResultGraph;
-})();
-function ruleGraph(dat, query) {
-    var res = ruleFilter(dat, query);
-    var map = {};
-    var direct = {};
-    var ind = -1;
-    for (var s in res) {
-        ind++;
-        var xs = res[s].items;
-        for (var i = 0; i < xs.length; i++)
-            direct[xs[i]] = ind;
-    }
-    function getDirect(key) {
-        return key in direct ? [direct[key]] : [];
-    }
-    var indirect = {};
-    function getIndirect(key) {
-        if (key in indirect)
-            return indirect[key];
-        if (key in direct)
-            return [];
-        var ds = dat.original[key].depends;
-        var res = [];
-        for (var j = 0; j < ds.length; j++) {
-            res.push(getIndirect(ds[j]));
-            res.push(getDirect(ds[j]));
-        }
-        var res2 = concatNub(res);
-        indirect[key] = res2;
-        return res2;
-    }
-    var ans = [];
-    for (var s in res) {
-        var xs = res[s].items;
-        var ds = [];
-        var is = [];
-        for (var i = 0; i < xs.length; i++) {
-            var depends = dat.original[xs[i]].depends;
-            for (var j = 0; j < depends.length; j++) {
-                ds.push(getDirect(depends[j]));
-                is.push(getIndirect(depends[j]));
-            }
-        }
-        ans.push({ name: s, text: res[s].text, back: res[s].back, parents: concatNub(ds), ancestors: concatNub(is) });
-    }
-    return ans;
-}
-function commandFilter(last, dat, query) {
-    queryData = dat;
-    var f = readQuery(query);
-    var res = {};
-    for (queryKey = 0; queryKey < dat.original.length; queryKey++) {
-        queryVal = dat.original[queryKey];
-        if (last && queryVal.built !== 0)
-            continue;
-        var val = recordCopy(queryVal);
-        var ts = queryVal.traces || [];
-        queryVal = val;
-        queryName = queryVal.name;
-        queryBackColor = null;
-        queryTextColor = null;
-        for (var i = 0; i < ts.length; i++) {
-            queryVal.traces = [ts[i]];
-            queryGroup = null;
-            if (f()) {
-                if (queryGroup === null)
-                    queryGroup = ts[i].command;
-                if (!(queryGroup in res))
-                    res[queryGroup] = { items: [ts[i]], text: queryTextColor, back: queryBackColor };
-                else {
-                    var c = res[queryGroup];
-                    c.items.push(ts[i]);
-                    c.text = colorAnd(c.text, queryTextColor);
-                    c.back = colorAnd(c.back, queryBackColor);
-                }
-            }
-        }
-    }
-    return res;
-}
-var CommandTable = (function () {
-    function CommandTable() {
-    }
-    return CommandTable;
-})();
-function commandTable(dat, query) {
-    var res = commandFilter(false, dat, query);
-    var ans = [];
-    for (var s in res) {
-        var xs = res[s].items;
-        var time = 0;
-        for (var _i = 0; _i < xs.length; _i++) {
-            var t_2 = xs[_i];
-            time += t_2.stop - t_2.start;
-        }
-        ans.push({ name: s, count: xs.length, text: res[s].text, back: res[s].back, time: time });
-    }
-    return ans;
-}
-function commandPlot(dat, query, buckets) {
-    var end = dat.summary.maxTraceStopLast;
-    var res = commandFilter(true, dat, query);
-    var ans = {};
-    for (var s in res) {
-        var ts = res[s].items;
-        var xs = [];
-        for (var i = 0; i <= buckets; i++)
-            xs.push(0);
-        for (var _i = 0; _i < ts.length; _i++) {
-            var t_3 = ts[_i];
-            var start = t_3.start * buckets / end;
-            var stop = t_3.stop * buckets / end;
-            if (Math.floor(start) === Math.floor(stop))
-                xs[Math.floor(start)] += stop - start;
-            else {
-                for (var j = Math.ceil(start); j < Math.floor(stop); j++)
-                    xs[j]++;
-                xs[Math.floor(start)] += Math.ceil(start) - start;
-                xs[Math.floor(stop)] += stop - Math.floor(stop);
-            }
-        }
-        ans[s] = { items: xs.slice(0, buckets), back: res[s].back || null };
-    }
-    return ans;
-}
-function readQuery(query) {
-    if (query === "")
-        return function () { return true; };
-    var f;
-    try {
-        f = (new Function("return " + query));
-    }
-    catch (e) {
-        throw { user: true, name: "parse", query: query, message: e.toString() };
-    }
-    return function () {
-        try {
-            return f();
-        }
-        catch (e) {
-            throw { user: true, name: "execution", query: query, message: e.toString() };
-        }
-    };
-}
-var queryData = {};
-var queryKey = 0;
-var queryVal = {};
-var queryName = "";
-var queryGroup = null;
-var queryBackColor = null;
-var queryTextColor = null;
-function childOf(r) { return queryData.dependsOnThis(queryKey, r); }
-function parentOf(r) { return queryData.thisDependsOn(queryKey, r); }
-function ancestorOf(r) { return queryData.dependsOnThisTransitive(queryKey, r); }
-function descendantOf(r) { return queryData.thisDependsOnTransitive(queryKey, r); }
-function descendentOf(r) { return descendantOf(r); }
-function group(x) {
-    if (queryGroup === null)
-        queryGroup = "";
-    queryGroup += (queryGroup === "" ? "" : " ") + x;
-    return true;
-}
-function backColor(c, b) {
-    if (b === void 0) { b = true; }
-    if (b)
-        queryBackColor = c;
-    return true;
-}
-function textColor(c, b) {
-    if (b === void 0) { b = true; }
-    if (b === undefined || b)
-        queryTextColor = c;
-    return true;
-}
-function rename(from, to) {
-    if (to === void 0) { to = ""; }
-    queryName = queryName.replace(from, to);
-    return true;
-}
-function slowestRule() {
-    return queryData.summary.maxExecutionName;
-}
-function leaf() {
-    return queryVal.depends.length === 0;
-}
-function run(i) {
-    if (i === undefined)
-        return queryVal.built;
-    else
-        return queryVal.built === i;
-}
-function unchanged() {
-    return queryVal.changed !== queryVal.built;
-}
-function named(r, groupName) {
-    if (r === undefined)
-        return queryName;
-    var res = execRegExp(r, queryName);
-    if (res === null) {
-        if (groupName === undefined)
-            return false;
-        else {
-            group(groupName);
-            return true;
-        }
-    }
-    if (res.length !== 1) {
-        for (var i = 1; i < res.length; i++)
-            group(res[i]);
-    }
-    return true;
-}
-function command(r, groupName) {
-    var n = (queryVal.traces || []).length;
-    if (r === undefined)
-        return n === 0 ? "" : queryVal.traces[0].command;
-    for (var _i = 0, _a = queryVal.traces; _i < _a.length; _i++) {
-        var t_4 = _a[_i];
-        var res = execRegExp(r, t_4.command);
-        if (res === null)
-            continue;
-        if (res.length !== 1) {
-            for (var j = 1; j < res.length; j++)
-                group(res[j]);
-        }
-        return true;
-    }
-    if (groupName === undefined)
-        return false;
-    else {
-        group(groupName);
-        return true;
-    }
-}
-"use strict";
-function initProgress() {
-    $(function () {
-        $(".version").html("Generated by <a href='http://shakebuild.com'>Shake " + version + "</a>.");
-        $("#output").html("");
-        for (var _i = 0; _i < progress.length; _i++) {
-            var x = progress[_i];
-            var actual = [];
-            var ideal = [];
-            for (var t = 5; t < x.values.length; t++) {
-                var y = x.values[t];
-                actual.push([y.idealSecs, y.actualSecs]);
-                ideal.push([y.idealSecs, y.idealSecs]);
-            }
-            var ys = [{ data: ideal, color: "gray" }, { label: x.name, data: actual, color: "red" }];
-            var div = $("<div class='plot'>");
-            $("#output").append(div);
-            $.plot(div, ys, {
-                xaxis: {
-                    transform: function (v) { return -v; },
-                    inverseTransform: function (v) { return -v; }
-                }
-            });
-        }
-    });
-}
-"use strict";
-function t(a, b, c) { return { start: a, stop: b, command: c }; }
-var dat1 = [{ name: "Functional", built: 0, changed: 3, depends: [], execution: 1, traces: [t(0, 1, "gen")] },
-    { name: "Imperative", built: 0, changed: 0, depends: [], execution: 2, traces: [t(0, 1, "gen"), t(1, 2, "gen")] },
-    { name: "HsSource", built: 3, changed: 3, depends: [], execution: 0 },
-    { name: "Haskell", built: 3, changed: 3, depends: [0, 2], execution: 8, traces: [t(1, 8.9, "ghc")] },
-    { name: "C", built: 0, changed: 0, depends: [1], execution: 15, traces: [t(2, 16.9, "gcc")] },
-    { name: "Cpp", built: 0, changed: 0, depends: [1], execution: 10, traces: [t(2, 10, "gcc")] },
-    { name: "Exe", built: 0, changed: 0, depends: [3, 4, 5], execution: 5, traces: [t(17, 22, "link")] }
-];
-function test() {
-    function assert(b) {
-        if (!b)
-            throw "Assertion failed";
-    }
-    function assertEq(got, want) {
-        if (want != got) {
-            console.log("Wanted: " + want);
-            console.log("Got: " + got);
-            assert(false);
-        }
-    }
-    function assertRegex(want, got) {
-        if (!want.test(got)) {
-            console.log("Wanted: " + want);
-            console.log("Got: " + got);
-            assert(false);
-        }
-    }
-    var tab1 = prepare(dat1);
-    var ssum1 = showSummary(tab1.summary);
-    console.log(ssum1);
-    var want = ["4 runs", "7 rules", "5 rebuilt", "7 traced", "6 in", "build time is 41.00s", "38.80s is traced",
-        "longest rule takes 15.00s", "longest traced command takes 14.90s", "parallelism of 1.40", "22.00s"];
-    assertRegex(new RegExp(want.join(".*")), ssum1.join(" "));
-    var par1 = commandPlot(tab1, "group('x')", 10)['x'];
-    console.log(par1);
-    var pars1 = par1.items.map(function (i) { return Math.round(i * 10) / 10; });
-    assert(listEq(pars1, [1.5, 2, 2, 2, 1.5, 1, 1, 1, 1, 1]));
-    function chk(f, query, n) {
-        var ans = f(tab1, query);
-        console_table(ans);
-        assertEq(ans.length, n);
-    }
-    chk(ruleTable, "", 7);
-    chk(ruleTable, "leaf()", 3);
-    chk(ruleTable, "named(/^(.)/)", 5);
-    chk(commandTable, "", 4);
-    chk(commandTable, "command(/g(.*)/)", 3);
-    chk(ruleTable, "childOf('Imperative')", 2);
-    return "passed";
-}
-function console_table(xs) {
-    if ("table" in console)
-        console["table"](xs);
-    else if (xs.length === 0)
-        console.log("No data");
-    else {
-        var widths = [];
-        var cells = [];
-        for (var i_1 = 0; i_1 <= xs.length; i_1++)
-            cells.push([]);
-        for (var s_1 in xs[0]) {
-            var len = s_1.length;
-            cells[0].push(s_1);
-            for (var i = 0; i < xs.length; i++) {
-                var ss = "" + xs[i][s_1];
-                len = Math.max(len, ss.length);
-                cells[i + 1].push(ss);
-            }
-            widths.push(len);
-        }
-        var s = "";
-        for (var x = 0; x < cells.length; x++) {
-            for (var y = 0; y < widths.length; y++)
-                s += "|" + pad(widths[y], cells[x][y]);
-            s += "|\n";
-        }
-        console.log(s);
-    }
-}
-function pad(n, s) {
-    var res = s;
-    for (var i = s.length; i < n; i++)
-        res += " ";
-    return res;
-}
-"use strict";
-var prepared = prepare(profile);
-var currentTable = null;
-var Report = (function () {
-    function Report(mode_, query_) {
-        if (mode_ === void 0) { mode_ = "summary"; }
-        if (query_ === void 0) { query_ = ""; }
-        this.sort = "time";
-        this.sortRev = false;
-        this.mode = mode_;
-        this.query = query_;
-    }
-    return Report;
-})();
-var report = new Report(null, null);
-function reportEq(r1, r2) {
-    return r1.mode === r2.mode && r1.query === r2.query && r1.sort === r2.sort && r1.sortRev === r2.sortRev;
-}
-function reportToURL(r) {
-    var def = new Report();
-    return "?mode=" + r.mode +
-        (r.query === def.query ? "" : "&query=" + encodeURI(r.query).replace(/\+/g, "%2B")) +
-        ((!r.sortRev && r.sort === def.sort) ? "" :
-            "&sort=" + (r.sortRev ? "!" : "") + r.sort);
-}
-function reportFromURL(s) {
-    if (s === void 0) { s = window.location.search; }
-    var res = new Report();
-    var params = uriQueryParameters(s);
-    if ("mode" in params)
-        res.mode = params["mode"];
-    if ("query" in params)
-        res.query = params["query"];
-    if ("sort" in params) {
-        var sort = params["sort"];
-        res.sortRev = sort.substr(0, 1) == "!";
-        res.sort = sort.substr(res.sortRev ? 1 : 0);
-    }
-    return res;
-}
-function reportFromUser() {
-    return new Report($("#mode").val(), $("#query").val());
-}
-function setReport(set, replace, run) {
-    var report2 = set(recordCopy(report));
-    $("#mode").val(report2.mode);
-    $("#query").val(report2.query);
-    $("#run").enable(false).attr("title", "The current query is displayed");
-    if (reportEq(report, report2))
-        return;
-    report = report2;
-    if (window.history) {
-        var title = report.mode + (report.query === "" ? "" : ": " + report.query);
-        var url = reportToURL(report);
-        try {
-            if (replace)
-                window.history.replaceState(report, title, url);
-            else
-                window.history.pushState(report, title, url);
-        }
-        catch (e) {
-        }
-    }
-    $("#link").attr("href", reportToURL(report));
-    if (run)
-        runReport();
-}
-var rightAlign = { count: null, time: null, cost: null, run: null, leaf: null, unchanged: null };
-var twoColumns = { cost: null, time: null };
-var defaultRevSort = { run: null, name: null };
-function tableSort(x) {
-    if (report.sort === x)
-        setReport(function (r) { r.sortRev = !r.sortRev; return r; }, true, false);
-    else
-        setReport(function (r) { r.sort = x; r.sortRev = x in defaultRevSort; return r; }, true, false);
-    showTable(currentTable);
-}
-function showTable(xs) {
-    currentTable = xs;
-    if (xs.length === 0) {
-        $("#output").html("No data found");
-        return;
-    }
-    if (!(report.sort in xs[0]))
-        setReport(function (r) { return new Report(r.mode, r.query); }, true, false);
-    xs.sort(function (a, b) { return (report.sortRev ? -1 : 1) * (b[report.sort] > a[report.sort] ? 1 : -1); });
-    var res = "<table class='data'><tr class='header'>";
-    for (var s in xs[0]) {
-        if (s === "back" || s === "text")
-            continue;
-        res += s in twoColumns ? "<td colspan='2' style='text-align:center;'" :
-            s in rightAlign ? "<td style='text-align:right;'" :
-                "<td";
-        res += " onclick=\"tableSort('" + s + "')\">" + s;
-        if (s === report.sort)
-            res += " <span class='sort'>" + (report.sortRev ? "&#9650;" : "&#9660;") + "</span>";
-        res += "</td>";
-    }
-    res += "</tr>";
-    for (var _i = 0; _i < xs.length; _i++) {
-        var x = xs[_i];
-        res += "<tr";
-        if (x["back"])
-            res += " style='background-color:" + x["back"] + ";'";
-        if (x["text"])
-            res += " style='color:" + x["text"] + ";'";
-        res += ">";
-        for (var s in xs[0]) {
-            if (s === "text" || s === "back")
-                continue;
-            res += "<td" + (s in rightAlign ? " style='text-align:right;'" : "") + ">";
-            if (s === "count")
-                res += x[s] + " &times;";
-            else if (s === "time" || s === "cost")
-                res += showTime(x[s]) + "</td><td style='text-align:right;'>" + showPerc(x[s] / prepared.summary.sumExecution);
-            else
-                res += x[s];
-            res += "</td>";
-        }
-        res += "</tr>";
-    }
-    res += "</table>";
-    $("#output").html(res);
-}
-var currentPlot = null;
-function showPlot(series, options) {
-    var $output = $("#output");
-    var width = $output.width();
-    var height = $output.height();
-    if (series === null && options === null) {
-        if (width === currentPlot.width && height === currentPlot.height)
-            return;
-        series = currentPlot.series;
-        options = currentPlot.options;
-    }
-    currentPlot = { series: series, options: options, width: width, height: height };
-    var div = $("<div>").width(width - 20).height(height - 10);
-    $("#output").html("").append(div);
-    $.plot(div, series, options);
-}
-window.onresize = function () {
-    if (currentPlot !== null)
-        showPlot(null, null);
-};
-function runReport() {
-    currentTable = null;
-    currentPlot = null;
-    try {
-        switch (report.mode) {
-            case "summary":
-                var res = showSummary(prepared.summary);
-                var s_2 = $("#welcome").html();
-                s_2 += "<ul>";
-                for (var i = 0; i < res.length; i++)
-                    s_2 += "<li>" + res[i] + "</li>";
-                s_2 += "</ul>";
-                s_2 += "<p class='version'>Generated by <a href='http://shakebuild.com'>Shake " + version + "</a>.</p>";
-                $("#output").html(s_2);
-                break;
-            case "cmd-plot":
-                {
-                    var xs = commandPlot(prepared, report.query, 100);
-                    var ys = [];
-                    for (var s_3 in xs) {
-                        var x = xs[s_3].items;
-                        var data = [];
-                        for (var j = 0; j < x.length; j++)
-                            data.push([j, x[j]]);
-                        ys.push({ label: s_3, data: data, color: xs[s_3].back, avg: sum(x) / x.length });
-                    }
-                    if (ys.length === 0) {
-                        $("#output").html("No data found, " +
-                            (prepared.summary.countTraceLast === 0
-                                ? "there were no traced commands in the last run."
-                                : "perhaps your filter is too restrictive?"));
-                    }
-                    else {
-                        ys.sort(function (a, b) { return a.avg - b.avg; });
-                        showPlot(ys, {
-                            legend: { show: true, position: "nw", sorted: "reverse" },
-                            series: { stack: true, lines: { lineWidth: 0, fill: 1 } },
-                            yaxis: { min: 0 },
-                            xaxis: { tickFormatter: function (i) { return showTime(prepared.summary.maxTraceStopLast * i / 100); } }
-                        });
-                    }
-                }
-                break;
-            case "cmd-table":
-                showTable(commandTable(prepared, report.query));
-                break;
-            case "rule-table":
-                showTable(ruleTable(prepared, report.query));
-                break;
-            case "rule-graph":
-                {
-                    var xs = ruleGraph(prepared, report.query);
-                    if (xs.length > 250)
-                        $("#output").html("Viewing a graph with > 250 nodes is not supported, and you have " + xs.length + " nodes. Try grouping more aggressively");
-                    else if (typeof Viz === 'undefined')
-                        $("#output").html("Profile reports do not seem to have been built with GraphViz support, this feature is unavailable.");
-                    else {
-                        var res_1 = "digraph \"\"{";
-                        res_1 += "graph[nodesep=0.15,ranksep=0.3];";
-                        res_1 += "node[fontname=\"sans-serif\",fontsize=9,penwidth=0.5,height=0,width=0];";
-                        res_1 += "edge[penwidth=0.5,arrowsize=0.5];";
-                        for (var i = 0; i < xs.length; i++) {
-                            res_1 += "a" + i + "[label=\"" + xs[i].name.split("\\").join("\\\\").split("\"").join("\\\"") + "\"";
-                            if (xs[i].back)
-                                res_1 += ",style=filled,color=\"" + xs[i].back + "\"";
-                            if (xs[i].text)
-                                res_1 += ",fontcolor=\"" + xs[i].text + "\"";
-                            res_1 += "];";
-                            var parents = xs[i].parents;
-                            for (var j = 0; j < parents.length; j++)
-                                res_1 += "a" + i + "->a" + parents[j] + ";";
-                            var ancestors = xs[i].ancestors;
-                            for (var j = 0; j < ancestors.length; j++)
-                                res_1 += "a" + i + "->a" + ancestors[j] + "[style=dashed];";
-                        }
-                        res_1 += "}";
-                        $("#output").html(Viz(res_1, "svg"));
-                    }
-                }
-                break;
-            case "help":
-                $("#output").html($("#help").html());
-                break;
-            default:
-                throw "Unknown report type: " + report.mode;
-                break;
-        }
-    }
-    catch (e) {
-        if (!(e && e.user))
-            throw e;
-        $("#output").html($("#error").html());
-        for (var s in e)
-            $("#output ." + s).text(e[s]);
-    }
-}
-function example(mode, query) {
-    setReport(function (_) { return new Report(mode, query); }, false, true);
-    return false;
-}
-function initProfile() {
-    $(function () {
-        setReport(function (_) { return reportFromURL(); }, true, true);
-        $("#mode,#query").bind("input change", function () {
-            var mode = $("#mode").val();
-            var query = $("#query").val();
-            var enable = mode !== report.mode || query !== report.query;
-            $("#run").enable(enable).attr("title", enable ? "" : "The current query is displayed");
-            $("#link").attr("href", reportToURL(reportFromUser()));
-        });
-        $("#run").click(function () {
-            setReport(function (_) { return reportFromUser(); }, false, true);
-        });
-        $("#query").keypress(function (e) {
-            if (e.which == 13)
-                $("#run").click();
-        });
-        window.onpopstate = function (e) {
-            setReport(function (_) { return reportFromUser(); }, true, true);
-        };
-        $("a.example").each(function () {
-            var mode = $(this).attr("data-mode");
-            var query = $(this).attr("data-query");
-            if (query === undefined)
-                query = $(this).text();
-            var href = reportToURL(new Report(mode, query));
-            var onclick = "return example(decodeURI('" + encodeURI(mode) + "'),decodeURI('" + encodeURI(query) + "'));";
-            $(this).attr("href", href).attr("target", "_blank")[0].setAttribute("onclick", onclick);
-        });
-        $("a.shake").each(function () {
-            var href = "http://hackage.haskell.org/packages/archive/shake/latest/doc/html/Development-Shake.html#v:" +
-                $(this).text().replace("'", "-39-");
-            $(this).attr("href", href).attr("target", "_blank");
-        });
-    });
-}
-"use strict";
-jQuery.fn.enable = function (x) {
-    return this.each(function () {
-        if (x)
-            $(this).removeAttr('disabled');
-        else
-            $(this).attr('disabled', 'disabled');
-    });
-};
-function uriQueryParameters(s) {
-    var params = {};
-    var a = /\+/g;
-    var r = /([^&=]+)=?([^&]*)/g;
-    var d = function (s) { return decodeURIComponent(s.replace(a, " ")); };
-    var q = s.substring(1);
-    while (true) {
-        var e = r.exec(q);
-        if (!e)
-            break;
-        params[d(e[1])] = d(e[2]);
-    }
-    return params;
-}
-;
-function showTime(x) {
-    function digits(x) { var s = String(x); return s.length === 1 ? "0" + s : s; }
-    if (x >= 3600) {
-        x = Math.round(x / 60);
-        return Math.floor(x / 60) + "h" + digits(x % 60) + "m";
-    }
-    else if (x >= 60) {
-        x = Math.round(x);
-        return Math.floor(x / 60) + "m" + digits(x % 60) + "s";
-    }
-    else
-        return x.toFixed(2) + "s";
-}
-function showPerc(x) {
-    return (x * 100).toFixed(2) + "%";
-}
-function plural(n, not1, is1) {
-    if (not1 === void 0) { not1 = "s"; }
-    if (is1 === void 0) { is1 = ""; }
-    return n === 1 ? is1 : not1;
-}
-function sum(xs) {
-    var res = 0;
-    for (var _i = 0; _i < xs.length; _i++) {
-        var x = xs[_i];
-        res += x;
-    }
-    return res;
-}
-function testRegExp(r, s) {
-    if (typeof r === "string")
-        return s.indexOf(r) !== -1;
-    else
-        return r.test(s);
-}
-function execRegExp(r, s) {
-    if (typeof r === "string")
-        return s.indexOf(r) === -1 ? null : [];
-    else
-        return r.exec(s);
-}
-function listEq(xs, ys) {
-    if (xs.length !== ys.length)
-        return false;
-    for (var i = 0; i < xs.length; i++) {
-        if (xs[i] !== ys[i])
-            return false;
-    }
-    return true;
-}
-function cache(key, op) {
-    var store = {};
-    return function (k) {
-        var s = key(k);
-        if (!(s in store))
-            store[s] = op(k);
-        return store[s];
-    };
-}
-function mapEq(xs, ys) {
-    function f(a, b) {
-        for (var s in a) {
-            if (a[s] !== b[s])
-                return false;
-        }
-        return true;
-    }
-    return f(xs, ys) && f(ys, xs);
-}
-function recordCopy(xs) {
-    return mapCopy(xs);
-}
-function mapCopy(xs) {
-    var res = {};
-    for (var s in xs)
-        res[s] = xs[s];
-    return res;
-}
-function mapUnion(xs, ys) {
-    var res = mapCopy(ys);
-    for (var s in xs)
-        res[s] = xs[s];
-    return res;
-}
-function concatNub(xss) {
-    var res = [];
-    var seen = {};
-    for (var _i = 0; _i < xss.length; _i++) {
-        var xs = xss[_i];
-        for (var _a = 0; _a < xs.length; _a++) {
-            var x = xs[_a];
-            var v = x;
-            if (!(v in seen)) {
-                seen[v] = null;
-                res.push(x);
-            }
-        }
-    }
-    return res;
+function bindPlot(element, data, options) {
+    const redraw = () => {
+        if ($(element).is(":visible"))
+            $.plot($(element), data.get(), options);
+    };
+    window.setTimeout(redraw, 1);
+    $(window).on("resize", redraw);
+    data.event(redraw);
+}
+function varLink(name) {
+    return React.createElement("a", { href: "https://hackage.haskell.org/package/shake/docs/Development-Shake.html#v:" + name },
+        React.createElement("tt", null, name));
+}
+function newTable(columns, data, sortColumn, sortDescend) {
+    const f = (x) => ({ name: x.field, label: x.label, width: x.width, cellClasses: x.alignRight ? "right" : "" });
+    const formatters = {};
+    for (const c of columns)
+        formatters[c.field] = c.show || ((x) => x);
+    const table = new DGTable({
+        adjustColumnWidthForSortArrow: false,
+        cellFormatter: (val, colname) => formatters[colname](val),
+        columns: columns.map(f),
+        width: DGTable.Width.SCROLL
+    });
+    $(table.el).css("height", "100%");
+    window.setTimeout(() => {
+        table.render();
+        table.tableHeightChanged();
+        if (sortColumn)
+            table.sort(sortColumn, sortDescend);
+        table.setRows(data.get(), true);
+    }, 1);
+    let toRender = false;
+    data.event(xs => {
+        table.setRows(xs, true);
+        if ($(table.el).is(":visible"))
+            table.render();
+        else
+            toRender = true;
+    });
+    $(window).on("resize", () => {
+        if ($(table.el).is(":visible")) {
+            table.tableHeightChanged();
+            if (toRender) {
+                table.render();
+                toRender = false;
+            }
+        }
+    });
+    return React.createElement("div", { style: "height:100%;width:100%;" }, table.el);
+}
+// These are global variables mutated/queried by query execution
+let environmentAll; // All the profiles
+let environmentThis; // The specific profile under test
+let environmentGroup; // The group produced as a result
+function group(x) {
+    environmentGroup.push(x);
+    return true;
+}
+function leaf() {
+    return environmentThis.depends.length === 0;
+}
+function run(i) {
+    if (i === undefined)
+        return environmentThis.built;
+    else
+        return environmentThis.built === i;
+}
+function changed() {
+    return environmentThis.changed === environmentThis.built;
+}
+function unchanged() {
+    return !unchanged();
+}
+function named(r, groupName) {
+    if (r === undefined)
+        return environmentThis.name;
+    const res = execRegExp(r, environmentThis.name);
+    if (res === null) {
+        if (groupName === undefined)
+            return false;
+        else {
+            group(groupName);
+            return true;
+        }
+    }
+    if (res.length !== 1) {
+        for (let i = 1; i < res.length; i++)
+            group(res[i]);
+    }
+    return true;
+}
+function command(r, groupName) {
+    const n = (environmentThis.traces || []).length;
+    if (r === undefined)
+        return n === 0 ? "" : environmentThis.traces[0].command;
+    for (const t of environmentThis.traces) {
+        const res = execRegExp(r, t.command);
+        if (res === null)
+            continue;
+        if (res.length !== 1) {
+            for (let j = 1; j < res.length; j++)
+                group(res[j]);
+        }
+        return true;
+    }
+    if (groupName === undefined)
+        return false;
+    else {
+        group(groupName);
+        return true;
+    }
+}
+function profileLoaded(profileRaw) {
+    $(document.body).empty().append(profileRoot(unraw(profileRaw)));
+}
+function unraw(xs) {
+    const ans = xs.map((x, i) => ({
+        index: i,
+        name: x[0],
+        execution: x[1],
+        built: x[2],
+        changed: x[3],
+        depends: x.length > 4 ? x[4] : [],
+        rdepends: [],
+        traces: x.length > 5 ? x[5].map(y => ({ command: y[0], start: y[1], stop: y[2] })) : []
+    }));
+    for (const p of ans)
+        for (const ds of p.depends)
+            for (const d of ds)
+                ans[d].rdepends.push(p.index);
+    return ans;
+}
+function profileRoot(profile) {
+    const [s, search] = createSearch(profile);
+    const t = createTabs([["Summary", () => reportSummary(profile)],
+        ["Command plot", () => reportCmdPlot(profile)],
+        ["Commands", () => reportCmdTable(profile, search)],
+        ["Rules", () => reportRuleTable(profile, search)],
+        ["Parallelizability", () => reportParallelism(profile)],
+        ["Details", () => reportDetails(profile, search)]
+        // , ["Why rebuild", () => reportRebuild(profile, search)]
+    ]);
+    return React.createElement("table", { class: "fill" },
+        React.createElement("tr", null,
+            React.createElement("td", { style: "padding-top: 8px; padding-bottom: 8px;" },
+                React.createElement("a", { href: "https://shakebuild.com/", style: "font-size: 20px; text-decoration: none; color: #3131a7; font-weight: bold;" }, "Shake profile report"),
+                React.createElement("span", { style: "color:gray;white-space:pre;" },
+                    "   - generated at ",
+                    generated,
+                    " by Shake v",
+                    version))),
+        React.createElement("tr", null,
+            React.createElement("td", null, s)),
+        React.createElement("tr", null,
+            React.createElement("td", { height: "100%" }, t)));
+}
+function createTabs(xs) {
+    const bodies = xs.map(x => {
+        const el = React.createElement("div", { style: "padding:5px;width:100%;height:100%;min-width:150px;min-height:150px;overflow:auto;display:none;" });
+        const upd = lazy(() => $(el).append(x[1]()));
+        return pair(el, upd);
+    });
+    let lbls = [];
+    const f = (i) => () => {
+        bodies[i][1]();
+        lbls.map((x, j) => $(x).toggleClass("active", i === j));
+        bodies.map((x, j) => $(x[0]).toggle(i === j));
+        $(window).trigger("resize");
+    };
+    lbls = xs.map((x, i) => React.createElement("a", { onclick: f(i) }, x[0]));
+    f(0)();
+    return React.createElement("table", { class: "fill" },
+        React.createElement("tr", null,
+            React.createElement("td", null,
+                React.createElement("table", { width: "100%", style: "border-spacing:0px;" },
+                    React.createElement("tr", { class: "tabstrip" },
+                        React.createElement("td", { width: "20", class: "bottom" }, "\u00A0"),
+                        React.createElement("td", { style: "padding:0px;" }, lbls),
+                        React.createElement("td", { width: "100%", class: "bottom" }, "\u00A0"))))),
+        React.createElement("tr", { height: "100%" },
+            React.createElement("td", { style: "background-color:white;" }, bodies.map(fst))));
+}
+// A mapping from names (rule names or those matched from rule parts)
+// to the indicies in profiles.
+class Search {
+    constructor(profile, mapping) {
+        this.profile = profile;
+        if (mapping !== undefined)
+            this.mapping = mapping;
+        else {
+            this.mapping = {};
+            for (const p of profile)
+                this.mapping[p.name] = [p.index];
+        }
+    }
+    forEachProfiles(f) {
+        for (const s in this.mapping)
+            f(this.mapping[s].map(i => this.profile[i]), s);
+    }
+    forEachProfile(f) {
+        this.forEachProfiles((ps, group) => ps.forEach(p => f(p, group)));
+    }
+    mapProfiles(f) {
+        const res = [];
+        this.forEachProfiles((ps, group) => res.push(f(ps, group)));
+        return res;
+    }
+    mapProfile(f) {
+        const res = [];
+        this.forEachProfile((p, group) => res.push(f(p, group)));
+        return res;
+    }
+}
+function createSearch(profile) {
+    const caption = React.createElement("div", null,
+        "Found ",
+        profile.length,
+        " entries, not filtered or grouped.");
+    const input = React.createElement("input", { id: "search", type: "text", value: "", placeholder: "Filter and group", style: "width: 100%; font-size: 16px; border-radius: 8px; padding: 5px 10px; border: 2px solid #999;" });
+    const res = new Prop(new Search(profile));
+    $(input).on("change keyup paste", () => {
+        const s = $(input).val();
+        if (s === "") {
+            res.set(new Search(profile));
+            $(caption).text("Found " + profile.length + " entries, not filtered or grouped.");
+        }
+        else if (s.indexOf("(") === -1) {
+            const mapping = {};
+            let found = 0;
+            for (const p of profile) {
+                if (p.name.indexOf(s) !== -1) {
+                    found++;
+                    mapping[p.name] = [p.index];
+                }
+            }
+            res.set(new Search(profile, mapping));
+            $(caption).text("Substring filtered to " + found + " / " + profile.length + " entries, not grouped.");
+        }
+        else {
+            let f;
+            try {
+                f = new Function("return " + s);
+            }
+            catch (e) {
+                $(caption).text("Error compiling function, " + e);
+                return;
+            }
+            const mapping = {};
+            let groups = 0;
+            let found = 0;
+            environmentAll = profile;
+            for (const p of profile) {
+                environmentThis = p;
+                environmentGroup = [];
+                let bool;
+                try {
+                    bool = f();
+                }
+                catch (e) {
+                    $(caption).text("Error running function, " + e);
+                    return;
+                }
+                if (bool) {
+                    found++;
+                    const name = environmentGroup.length === 0 ? p.name : environmentGroup.join(" ");
+                    if (name in mapping)
+                        mapping[name].push(p.index);
+                    else {
+                        groups++;
+                        mapping[name] = [p.index];
+                    }
+                }
+            }
+            res.set(new Search(profile, mapping));
+            $(caption).text("Function filtered to " + found + " / " + profile.length + " entries, " +
+                (groups === found ? "not grouped." : groups + " groups."));
+        }
+    });
+    const body = React.createElement("table", { width: "100%", style: "padding-bottom: 17px;" },
+        React.createElement("tr", null,
+            React.createElement("td", { width: "100%" }, input),
+            React.createElement("td", { style: "padding-left:6px;padding-right: 6px;" }, searchHelp(input))),
+        React.createElement("tr", null,
+            React.createElement("td", null, caption)));
+    return [body, res];
+}
+function searchHelp(input) {
+    const examples = [["Only the last run", "run(0)"],
+        ["Named 'Main'", "named(\"Main\")"],
+        ["Group by file extension", "named(/(\\.[_0-9a-z]+)$/)"],
+        ["No dependencies (an input)", "leaf()"],
+        ["Didn't change when it last rebuilt", "unchanged()"],
+        ["Ran 'gcc'", "command(\"gcc\")"]
+    ];
+    const f = (code) => () => {
+        $(input).val((i, x) => x + (x === "" ? "" : " && ") + code);
+        $(input).trigger("change");
+    };
+    const dropdown = React.createElement("div", { class: "dropdown", style: "display:none;" },
+        React.createElement("ul", { style: "padding-left:30px;" }, examples.map(([desc, code]) => React.createElement("li", null,
+            React.createElement("a", { onclick: f(code) },
+                React.createElement("tt", null, code)),
+            " ",
+            React.createElement("span", { class: "note" }, desc)))));
+    const arrow_down = React.createElement("span", { style: "vertical-align:middle;font-size:80%;" }, "\u25BC");
+    const arrow_up = React.createElement("span", { style: "vertical-align:middle;font-size:80%;display:none;" }, "\u25B2");
+    const show_inner = () => { $(dropdown).toggle(); $(arrow_up).toggle(); $(arrow_down).toggle(); };
+    return React.createElement("div", null,
+        React.createElement("button", { style: "white-space:nowrap;padding-top:5px;padding-bottom:5px;", onclick: show_inner },
+            React.createElement("b", { style: "font-size:150%;vertical-align:middle;" }, "+"),
+            "\u00A0 Filter and Group \u00A0",
+            arrow_down,
+            arrow_up),
+        dropdown);
+}
+function initProgress() {
+    $(function () {
+        $(".version").html("Generated by <a href='https://shakebuild.com'>Shake " + version + "</a>.");
+        $("#output").html("");
+        for (const x of progress) {
+            var actual = [];
+            var ideal = [];
+            // Start at t = 5 seconds, since the early progress jumps a lot
+            for (var t = 5; t < x.values.length; t++) {
+                var y = x.values[t];
+                actual.push([y.idealSecs, y.actualSecs]);
+                ideal.push([y.idealSecs, y.idealSecs]);
+            }
+            var ys = [{ data: ideal, color: "gray" }, { label: x.name, data: actual, color: "red" }];
+            var div = $("<div class='plot'>");
+            $("#output").append(div);
+            $.plot(div, ys, {
+                xaxis: {
+                    transform: function (v) { return -v; },
+                    inverseTransform: function (v) { return -v; }
+                }
+            });
+        }
+    });
+}
+// Stuff that Shake generates and injects in
+function untraced(p) {
+    return Math.max(0, p.execution - p.traces.map(t => t.stop - t.start).sum());
+}
+/////////////////////////////////////////////////////////////////////
+// BASIC UI TOOLKIT
+class Prop {
+    constructor(val) { this.val = val; this.callback = () => { return; }; }
+    get() { return this.val; }
+    set(val) {
+        this.val = val;
+        this.callback(val);
+    }
+    event(next) {
+        const old = this.callback;
+        this.callback = val => { old(val); next(val); };
+        next(this.val);
+    }
+    map(f) {
+        const res = new Prop(f(this.get()));
+        this.event(a => res.set(f(a)));
+        return res;
+    }
+}
+jQuery.fn.enable = function (x) {
+    // Set the values to enabled/disabled
+    return this.each(function () {
+        if (x)
+            $(this).removeAttr("disabled");
+        else
+            $(this).attr("disabled", "disabled");
+    });
+};
+/////////////////////////////////////////////////////////////////////
+// BROWSER HELPER METHODS
+// Given "?foo=bar&baz=1" returns {foo:"bar",baz:"1"}
+function uriQueryParameters(s) {
+    // From https://stackoverflow.com/questions/901115/get-querystring-values-with-jquery/3867610#3867610
+    const params = {};
+    const a = /\+/g; // Regex for replacing addition symbol with a space
+    const r = /([^&=]+)=?([^&]*)/g;
+    const d = (x) => decodeURIComponent(x.replace(a, " "));
+    const q = s.substring(1);
+    while (true) {
+        const e = r.exec(q);
+        if (!e)
+            break;
+        params[d(e[1])] = d(e[2]);
+    }
+    return params;
+}
+/////////////////////////////////////////////////////////////////////
+// STRING FORMATTING
+function showTime(x) {
+    function digits(x) { const s = String(x); return s.length === 1 ? "0" + s : s; }
+    if (x >= 3600) {
+        x = Math.round(x / 60);
+        return Math.floor(x / 60) + "h" + digits(x % 60) + "m";
+    }
+    else if (x >= 60) {
+        x = Math.round(x);
+        return Math.floor(x / 60) + "m" + digits(x % 60) + "s";
+    }
+    else
+        return x.toFixed(2) + "s";
+}
+function showPerc(x) {
+    return (x * 100).toFixed(2) + "%";
+}
+function showInt(x) {
+    // From https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript
+    // Show, with commas
+    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+}
+function showRun(run) {
+    return run === 0 ? "Latest run" : run + " run" + plural(run) + " ago";
+}
+function plural(n, not1 = "s", is1 = "") {
+    return n === 1 ? is1 : not1;
+}
+/////////////////////////////////////////////////////////////////////
+// MISC
+function compareFst(a, b) {
+    return a[0] - b[0];
+}
+function compareSnd(a, b) {
+    return a[1] - b[1];
+}
+function compareSndRev(a, b) {
+    return b[1] - a[1];
+}
+function pair(a, b) {
+    return [a, b];
+}
+function triple(a, b, c) {
+    return [a, b, c];
+}
+function fst([x, _]) {
+    return x;
+}
+function snd([_, x]) {
+    return x;
+}
+function execRegExp(r, s) {
+    if (typeof r === "string")
+        return s.indexOf(r) === -1 ? null : [];
+    else
+        return r.exec(s);
+}
+function cache(key, op) {
+    const store = {};
+    return k => {
+        const s = key(k);
+        if (!(s in store))
+            store[s] = op(k);
+        return store[s];
+    };
+}
+function lazy(thunk) {
+    let store = null;
+    let done = false;
+    return () => {
+        if (!done) {
+            store = thunk();
+            done = true;
+        }
+        return store;
+    };
+}
+Array.prototype.sum = function () {
+    let res = 0;
+    for (const x of this)
+        res += x;
+    return res;
+};
+Array.prototype.insertSorted = function (x, compare) {
+    let start = 0;
+    let stop = this.length - 1;
+    let middle = 0;
+    while (start <= stop) {
+        middle = Math.floor((start + stop) / 2);
+        if (compare(this[middle], x) > 0)
+            stop = middle - 1;
+        else
+            start = middle + 1;
+    }
+    this.splice(start, 0, x);
+    return this;
+};
+Array.prototype.concatLength = function () {
+    let res = 0;
+    for (const x of this)
+        res += x.length;
+    return res;
+};
+Array.prototype.sortOn = function (f) {
+    return this.map(x => pair(f(x), x)).sort(compareFst).map(snd);
+};
+Array.prototype.last = function () {
+    return this[this.length - 1];
+};
+Array.prototype.maximum = function (def) {
+    if (this.length === 0)
+        return def;
+    let res = this[0];
+    for (let i = 1; i < this.length; i++)
+        res = Math.max(res, this[i]);
+    return res;
+};
+Array.prototype.minimum = function (def) {
+    if (this.length === 0)
+        return def;
+    let res = this[0];
+    for (let i = 1; i < this.length; i++)
+        res = Math.min(res, this[i]);
+    return res;
+};
+// Use JSX with el instead of React.createElement
+// Originally from https://gist.github.com/sergiodxa/a493c98b7884128081bb9a281952ef33
+// our element factory
+function createElement(type, props, ...children) {
+    const element = document.createElement(type);
+    for (const name in props || {}) {
+        if (name.substr(0, 2) === "on")
+            element.addEventListener(name.substr(2), props[name]);
+        else
+            element.setAttribute(name, props[name]);
+    }
+    for (const child of children.flat(10)) {
+        const c = typeof child === "object" ? child : document.createTextNode(child.toString());
+        element.appendChild(c);
+    }
+    return element;
+}
+// How .tsx gets desugared
+const React = { createElement };
+function reportCmdPlot(profile) {
+    // first find the end point
+    const runs = findRuns(profile);
+    if (runs.length === 0) {
+        return React.createElement("div", null,
+            React.createElement("h2", null, "No data found"),
+            React.createElement("p", null, "The Shake database contains no rules which ran traced commands."),
+            React.createElement("p", null,
+                "You can populate this information by using ",
+                varLink("cmd"),
+                " or wrapping your ",
+                React.createElement("tt", null, "IO"),
+                " actions in ",
+                varLink("traced"),
+                "."));
+    }
+    const combo = React.createElement("select", null,
+        runs.map(([run, time], i) => React.createElement("option", null,
+            showRun(run) + " (" + showTime(time) + ") ",
+            i === 0 ? "" : " - may be incomplete")),
+        ";");
+    const warning = React.createElement("i", null);
+    const plot = React.createElement("div", { style: "width:100%; height:100%;" });
+    const plotData = new Prop([]);
+    bindPlot(plot, plotData, {
+        legend: { show: true, position: "nw", sorted: "reverse" },
+        series: { stack: true, lines: { fill: 1, lineWidth: 0 } },
+        yaxis: { min: 0 },
+        xaxis: { tickFormatter: showTime }
+    });
+    function setPlotData(runsIndex) {
+        const [run, end] = runs[runsIndex];
+        const profileRun = profile.filter(p => p.built === run);
+        // Make sure we max(0,) every step in the process, in case one does parallelism of threads
+        const missing = profileRun.map(untraced).sum();
+        $(warning).text(missing < 1 ? "" : "Warning: " + showTime(missing) + " of execution was not traced.");
+        const series = calcPlotData(end, profileRun, 100);
+        const res = [];
+        for (const s in series)
+            res.push({ label: s, data: series[s].map((x, i) => pair(end * i / 100, x)) });
+        plotData.set(res);
+    }
+    setPlotData(0);
+    $(combo).change(() => setPlotData(combo.selectedIndex));
+    return React.createElement("table", { class: "fill" },
+        React.createElement("tr", null,
+            React.createElement("td", { width: "100%", style: "text-align:center;" },
+                React.createElement("h2", null, "Number of commands executing over time")),
+            React.createElement("td", null, combo)),
+        React.createElement("tr", null,
+            React.createElement("td", { height: "100%", colspan: "2" }, plot)),
+        React.createElement("tr", null,
+            React.createElement("td", { colspan: "2", style: "text-align:center;" },
+                "Time since the start of building. ",
+                warning)));
+}
+// Find which runs had traced commands and when the last stopped, sort so most recent first
+function findRuns(profile) {
+    const runs = {};
+    for (const p of profile) {
+        if (p.traces.length > 0) {
+            if (p.traces.length === 1 && p.traces[0].command === "")
+                continue; // the fake end command
+            const old = runs[p.built];
+            const end = p.traces.last().stop;
+            runs[p.built] = old === undefined ? end : Math.max(old, end);
+        }
+    }
+    const runsList = [];
+    for (const i in runs)
+        runsList.push(pair(Number(i), runs[i]));
+    runsList.sort(compareFst);
+    return runsList;
+}
+function calcPlotData(end, profile, buckets) {
+    const ans = {};
+    for (const p of profile) {
+        for (const t of p.traces) {
+            let xs;
+            if (t.command in ans)
+                xs = ans[t.command];
+            else {
+                xs = [];
+                for (let i = 0; i < buckets; i++)
+                    xs.push(0); // fill with 1 more element, but the last bucket will always be 0
+                ans[t.command] = xs;
+            }
+            const start = t.start * buckets / end;
+            const stop = t.stop * buckets / end;
+            if (Math.floor(start) === Math.floor(stop))
+                xs[Math.floor(start)] += stop - start;
+            else {
+                for (let j = Math.ceil(start); j < Math.floor(stop); j++)
+                    xs[j]++;
+                xs[Math.floor(start)] += Math.ceil(start) - start;
+                xs[Math.floor(stop)] += stop - Math.floor(stop);
+            }
+        }
+    }
+    return ans;
+}
+function reportCmdTable(profile, search) {
+    const columns = [{ field: "name", label: "Name", width: 200 },
+        { field: "count", label: "Count", width: 65, alignRight: true, show: showInt },
+        { field: "total", label: "Total", width: 75, alignRight: true, show: showTime },
+        { field: "average", label: "Average", width: 75, alignRight: true, show: showTime },
+        { field: "max", label: "Max", width: 75, alignRight: true, show: showTime }
+    ];
+    return newTable(columns, search.map(cmdData), "total", true);
+}
+function cmdData(search) {
+    const res = {};
+    search.forEachProfile(p => {
+        for (const t of p.traces) {
+            const time = t.stop - t.start;
+            if (t.command === "")
+                continue; // do nothing
+            else if (!(t.command in res))
+                res[t.command] = { count: 1, total: time, max: time };
+            else {
+                const ans = res[t.command];
+                ans.count++;
+                ans.total += time;
+                ans.max = Math.max(ans.max, time);
+            }
+        }
+    });
+    const res2 = [];
+    for (const i in res)
+        res2.push({ name: i, average: res[i].total / res[i].count, ...res[i] });
+    return res2;
+}
+function reportDetails(profile, search) {
+    const result = React.createElement("div", { class: "details" });
+    const self = new Prop(0);
+    search.event(xs => self.set(xs.mapProfile((p, _) => p.index).maximum()));
+    const f = (i) => React.createElement("a", { onclick: () => self.set(i) }, profile[i].name);
+    self.event(i => {
+        const p = profile[i];
+        const content = React.createElement("ul", null,
+            React.createElement("li", null,
+                React.createElement("b", null, "Name:"),
+                " ",
+                p.name),
+            React.createElement("li", null,
+                React.createElement("b", null, "Built:"),
+                " ",
+                showRun(p.built)),
+            React.createElement("li", null,
+                React.createElement("b", null, "Changed:"),
+                " ",
+                showRun(p.changed)),
+            React.createElement("li", null,
+                React.createElement("b", null, "Execution time:"),
+                showTime(p.execution)),
+            React.createElement("li", null,
+                React.createElement("b", null, "Traced commands:"),
+                React.createElement("ol", null, p.traces.map(t => React.createElement("li", null,
+                    t.command,
+                    " took ",
+                    showTime(t.stop - t.start))))),
+            React.createElement("li", null,
+                React.createElement("b", null, "Dependencies:"),
+                React.createElement("ol", null, p.depends.map(ds => React.createElement("li", null,
+                    React.createElement("ul", null, ds.map(d => React.createElement("li", null, f(d)))))))),
+            React.createElement("li", null,
+                React.createElement("b", null, "Things that depend on me:"),
+                React.createElement("ul", null, p.rdepends.map(d => React.createElement("li", null, f(d))))));
+        $(result).empty().append(content);
+    });
+    return result;
+}
+function reportParallelism(profile) {
+    // now simulate for -j1 .. -j24
+    const plotData = [{ label: "Realistic (based on current dependencies)", data: [], color: "#3131a7" },
+        { label: "Ideal (if no dependencies and perfect speedup)", data: [], color: "green" },
+        { label: "Gap", data: [], color: "orange" }
+    ];
+    let threads1;
+    for (let threads = 1; threads <= 24; threads++) {
+        const taken = simulateThreads(profile, threads)[0];
+        if (threads === 1)
+            threads1 = taken;
+        plotData[0].data.push([threads, taken]);
+        plotData[1].data.push([threads, threads1 / threads]);
+        plotData[2].data.push([threads, Math.max(0, taken - (threads1 / threads))]);
+    }
+    const plot = React.createElement("div", { style: "width:100%; height:100%;" });
+    bindPlot(plot, new Prop(plotData), {
+        xaxis: { tickDecimals: 0 },
+        yaxis: { min: 0, tickFormatter: showTime }
+    });
+    return React.createElement("table", { class: "fill" },
+        React.createElement("tr", null,
+            React.createElement("td", { style: "text-align:center;" },
+                React.createElement("h2", null, "Time to build at different number of threads"))),
+        React.createElement("tr", null,
+            React.createElement("td", { height: "100%" }, plot)),
+        React.createElement("tr", null,
+            React.createElement("td", { style: "text-align:center;" }, "Number of threads available.")));
+}
+// Simulate running N threads over the profile, return:
+// [total time take, point at which each entry kicked off]
+function simulateThreads(profile, threads) {
+    // How far are we through this simulation
+    let timestamp = 0;
+    // Who is currently running, with the highest seconds FIRST
+    const running = [];
+    const started = [];
+    // Things that are done
+    const ready = profile.filter(x => x.depends.length === 0);
+    const waiting = profile.map(x => x.depends.concatLength()); // number I am waiting on before I am done
+    function runningWait() {
+        const [ind, time] = running.pop();
+        timestamp = time;
+        for (const d of profile[ind].rdepends) {
+            waiting[d]--;
+            if (waiting[d] === 0)
+                ready.push(profile[d]);
+        }
+    }
+    while (true) {
+        // Queue up as many people as we can
+        while (running.length < threads && ready.length > 0) {
+            const p = ready.pop();
+            started[p.index] = timestamp;
+            running.insertSorted([p.index, timestamp + p.execution], compareSndRev);
+        }
+        if (running.length === 0) {
+            if (waiting.maximum(0) > 0)
+                throw new Error("Failed to run all tasks");
+            return [timestamp, started];
+        }
+        runningWait();
+    }
+}
+function reportRebuild(profile, search) {
+    const depth = [];
+    for (const p of profile) {
+        depth[p.index] = p.depends.flat().map(d => depth[d] + 1).maximum(0);
+    }
+    const ind = search.get().mapProfile((p, _) => p.index).sortOn(i => -depth[i])[0];
+    const p = profile[ind];
+    function f(p) {
+        const res = [];
+        while (p.depends.length !== 0) {
+            const ds = p.depends.flat().sortOn(i => -depth[i]);
+            res.push(React.createElement("li", null,
+                React.createElement("select", { style: "width:400px;" }, ds.slice(0, 1).map(x => React.createElement("option", null, profile[x].name)))));
+            p = profile[ds[0]];
+        }
+        return res;
+    }
+    return React.createElement("div", null,
+        React.createElement("h2", null, "Why did it rebuild?"),
+        React.createElement("p", null,
+            "Rule ",
+            p.name + " " + (p.built === 0 ? "rebuild in the last run" : "did not rebuild")),
+        React.createElement("ul", null, f(p)));
+}
+function reportRuleTable(profile, search) {
+    const [etimes, wtimes] = calcEWTimes(profile, 24);
+    const columns = [{ field: "name", label: "Name", width: 400 },
+        { field: "count", label: "Count", width: 65, alignRight: true, show: showInt },
+        { field: "leaf", label: "Leaf", width: 60, alignRight: true },
+        { field: "run", label: "Run", width: 50, alignRight: true },
+        { field: "changed", label: "Change", width: 60, alignRight: true },
+        { field: "time", label: "Time", width: 75, alignRight: true, show: showTime },
+        { field: "etime", label: "ETime", width: 75, alignRight: true, show: showTime },
+        { field: "wtime", label: "WTime", width: 75, alignRight: true, show: showTime },
+        { field: "untraced", label: "Untraced", width: 100, alignRight: true, show: showTime }
+    ];
+    return newTable(columns, search.map(s => ruleData(etimes, wtimes, s)), "time", true);
+}
+// Calculate the exclusive time of each rule at some number of threads
+function calcEWTimes(profile, threads) {
+    const [_, started] = simulateThreads(profile, threads);
+    const starts = started.map((s, i) => pair(i, s)).sort(compareSnd);
+    const costs = starts.map(([ind, start], i) => {
+        // find out who else runs before I finish
+        const execution = profile[ind].execution;
+        const end = start + execution;
+        let overlap = 0; // how much time I am overlapped for
+        let exclusive = 0; // how much time I am the only runner
+        let finisher = start; // the first overlapping person to finish
+        for (let j = i + 1; j < starts.length; j++) {
+            const [jInd, jStarts] = starts[j];
+            if (jStarts > end)
+                break;
+            overlap += Math.min(end - jStarts, profile[jInd].execution);
+            exclusive += Math.max(0, Math.min(jStarts, end) - finisher);
+            finisher = Math.max(finisher, jStarts + profile[jInd].execution);
+        }
+        exclusive += Math.max(0, end - finisher);
+        return triple(ind, execution === 0 ? 0 : execution * (execution / (execution + overlap)), exclusive);
+    });
+    const etimes = [];
+    const wtimes = [];
+    for (const [ind, etime, wtime] of costs) {
+        etimes[ind] = etime;
+        wtimes[ind] = wtime;
+    }
+    return [etimes, wtimes];
+}
+function ruleData(etimes, wtimes, search) {
+    return search.mapProfiles((ps, name) => ({
+        name,
+        count: ps.length,
+        leaf: ps.every(p => p.depends.length === 0),
+        run: ps.map(p => p.built).minimum(),
+        changed: ps.some(p => p.built === p.changed),
+        time: ps.map(p => p.execution).sum(),
+        etime: ps.map(p => etimes[p.index]).sum(),
+        wtime: ps.map(p => wtimes[p.index]).sum(),
+        untraced: ps.map(untraced).sum()
+    }));
+}
+function reportSummary(profile) {
+    let countLast = 0; // number of rules run in the last run
+    let highestRun = 0; // highest run you have seen (add 1 to get the count of runs)
+    let sumExecution = 0; // build time in total
+    let sumExecutionLast = 0; // build time in total
+    let countTrace = -1;
+    let countTraceLast = -1; // traced commands run
+    // start both are -1 because the end command will have run in the previous step
+    let maxTraceStopLast = 0; // time the last traced command stopped
+    for (const p of profile) {
+        sumExecution += p.execution;
+        highestRun = Math.max(highestRun, p.changed); // changed is always greater or equal to built
+        countTrace += p.traces.length;
+        if (p.built === 0) {
+            sumExecutionLast += p.execution;
+            countLast++;
+            countTraceLast += p.traces.length;
+            if (p.traces.length > 0)
+                maxTraceStopLast = Math.max(maxTraceStopLast, p.traces.last().stop);
+        }
+    }
+    return React.createElement("div", null,
+        React.createElement("h2", null, "Totals"),
+        React.createElement("ul", null,
+            React.createElement("li", null,
+                React.createElement("b", null, "Runs:"),
+                " ",
+                showInt(highestRun + 1),
+                " ",
+                React.createElement("span", { class: "note" }, "number of times Shake has been run.")),
+            React.createElement("li", null,
+                React.createElement("b", null, "Rules:"),
+                " ",
+                showInt(profile.length),
+                " (",
+                showInt(countLast),
+                " in last run) ",
+                React.createElement("span", { class: "note" }, "number of defined rules, e.g. individual files.")),
+            React.createElement("li", null,
+                React.createElement("b", null, "Traced:"),
+                " ",
+                showInt(countTrace),
+                " (",
+                showInt(countTraceLast),
+                " in last run)",
+                React.createElement("span", { class: "note" },
+                    "number of calls to ",
+                    varLink("cmd"),
+                    " or ",
+                    varLink("traced"),
+                    "."))),
+        React.createElement("h2", null, "Performance"),
+        React.createElement("ul", null,
+            React.createElement("li", null,
+                React.createElement("b", null, "Build time:"),
+                " ",
+                showTime(sumExecution),
+                " ",
+                React.createElement("span", { class: "note" }, "how long a complete build would take single threaded.")),
+            React.createElement("li", null,
+                React.createElement("b", null, "Last build time:"),
+                " ",
+                showTime(maxTraceStopLast),
+                " ",
+                React.createElement("span", { class: "note" }, "how long the last build take.")),
+            React.createElement("li", null,
+                React.createElement("b", null, "Parallelism:"),
+                " ",
+                (maxTraceStopLast === 0 ? 0 : sumExecutionLast / maxTraceStopLast).toFixed(2),
+                " ",
+                React.createElement("span", { class: "note" }, "average number of commands executing simultaneously in the last build.")),
+            React.createElement("li", null,
+                React.createElement("b", null, "Speculative critical path:"),
+                " ",
+                showTime(speculativeCriticalPath(profile)),
+                " ",
+                React.createElement("span", { class: "note" }, "how long it would take on infinite CPUs.")),
+            React.createElement("li", null,
+                React.createElement("b", null, "Precise critical path:"),
+                " ",
+                showTime(preciseCriticalPath(profile)),
+                " ",
+                React.createElement("span", { class: "note" }, "critical path not speculatively executing."))));
+}
+function speculativeCriticalPath(profile) {
+    const criticalPath = []; // the critical path to any element
+    let maxCriticalPath = 0;
+    for (const p of profile) {
+        let cost = 0;
+        for (const ds of p.depends)
+            for (const d of ds)
+                cost = Math.max(cost, criticalPath[d]);
+        cost += p.execution;
+        maxCriticalPath = Math.max(cost, maxCriticalPath);
+        criticalPath[p.index] = cost;
+    }
+    return maxCriticalPath;
+}
+/*
+Calculating a precise critical path, taking into account the deep dependeny structure, is non-obvious.
+Dependencies have the type [{X}], e.g:
+
+    X = [{a,b},{c,d}]
+
+That is r builds a and b, then after those both complete (assuming they don't change), it builds c and d,
+then it is finished. Importantly, r doesn't start building c/d until after a and b have finished. This
+detail extends the critical path.
+
+To calculate the precise critical path, we simulate with the notion of demand and waiting.
+*/
+function preciseCriticalPath(profile) {
+    const waiting = profile.map(x => x.depends.concatLength()); // number I am waiting on before I am done
+    const demanded = []; // I have been demanded by someone
+    const oncomplete = []; // Completion functions
+    const complete = []; // Who is complete already
+    const running = [];
+    let timestamp = 0;
+    // demand dependency set N of a rule
+    function demandN(p, round) {
+        for (; round < p.depends.length; round++) {
+            let todo = p.depends[round].length; // Number before we continue
+            const step = () => {
+                todo--;
+                if (todo === 0)
+                    demandN(p, round + 1);
+            };
+            for (const d of p.depends[round]) {
+                if (complete[d])
+                    todo--;
+                else {
+                    const old = oncomplete[d];
+                    oncomplete[d] = !old ? step : () => { old(); step(); };
+                    demand(profile[d]);
+                }
+            }
+            if (todo !== 0)
+                break;
+            // todo === 0, so continue (equivalent to calling step but tail recursive)
+        }
+    }
+    // demand a particular rule
+    function demand(p) {
+        if (demanded[p.index])
+            return;
+        demanded[p.index] = true;
+        if (waiting[p.index] === 0)
+            running.insertSorted([p.index, timestamp + p.execution], compareSndRev);
+        else
+            demandN(p, 0);
+    }
+    // We don't know the targets we ask for, so we approximate by saying the ones which nothing depends on
+    for (const p of profile) {
+        if (p.rdepends.length === 0)
+            demand(p);
+    }
+    while (running.length > 0) {
+        const [ind, time] = running.pop();
+        timestamp = time;
+        complete[ind] = true;
+        if (oncomplete[ind]) {
+            oncomplete[ind]();
+            delete oncomplete[ind];
+        }
+        for (const d of profile[ind].rdepends) {
+            waiting[d]--;
+            if (waiting[d] === 0 && demanded[d])
+                running.insertSorted([d, timestamp + profile[d].execution], compareSndRev);
+        }
+    }
+    for (let i = 0; i < profile.length; i++)
+        if (!complete[i])
+            throw new Error("Failed to run all tasks");
+    return timestamp;
 }
diff --git a/html/viz.js b/html/viz.js
deleted file mode 100644
--- a/html/viz.js
+++ /dev/null
@@ -1,9 +0,0 @@
-function Ub(nr){throw nr}var cc=void 0,wc=!0,xc=null,ee=!1;function bk(){return(function(){})}
-
-
-
-("undefined"!==typeof exports&&exports!==xc?exports:this).Viz=(function(nr,rQa){function ck(a,b){var i=16;if(b<a&&a<b+i){b+=i;for(a+=i;i--;){a--,b--,m[a]=m[b]}}else{tf(a,b,i)}}function YB(a){eval.call(xc,a)}function Yg(a){K.print(a+":\n"+Error().stack);Ub("Assertion: "+a)}function Ae(a,b){a||Yg("Assertion failed: "+b)}function ZB(a){try{var b=eval("_"+a)}catch(i){try{b=sQa.Module["_"+a]}catch(g){}}Ae(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)");return b}function $B(a,b,i,g){function q(a,b){if("string"==b){if(a===xc||a===cc||0===a){return 0}Xa||(Xa=Qa.ga());var x=Qa.fa(a.length+1);aC(a,x);return x}return"array"==b?(Xa||(Xa=Qa.ga()),x=Qa.fa(a.length),bC(a,x),x):a}var Xa=0,d=0,g=g?g.map((function(a){return q(a,i[d++])})):[];a=a.apply(xc,g);"string"==b?b=Oe(a):(Ae("array"!=b),b=a);Xa&&Qa.Aa(Xa);return b}function dk(x,r,i){i=i||"i8";"*"===i.charAt(i.length-1)&&(i="i32");switch(i){case"i1":m[x]=r;break;case"i8":m[x]=r;break;case"i16":D[x>>1]=r;break;case"i32":a[x>>2]=r;break;case"i64":ji=[r>>>0,Math.min(Math.floor(r/4294967296),4294967295)];a[x>>2]=ji[0];a[x+4>>2]=ji[1];break;case"float":ib[x>>2]=r;break;case"double":f[0]=r;a[x>>2]=b[0];a[x+4>>2]=b[1];break;default:Yg("invalid type for setValue: "+i)}}function ki(x,r){r=r||"i8";"*"===r.charAt(r.length-1)&&(r="i32");switch(r){case"i1":return m[x];case"i8":return m[x];case"i16":return D[x>>1];case"i32":return a[x>>2];case"i64":return a[x>>2];case"float":return ib[x>>2];case"double":return b[0]=a[x>>2],b[1]=a[x+4>>2],f[0];default:Yg("invalid type for setValue: "+r)}return xc}function d(a,b,i,g){var q,Xa;"number"===typeof a?(q=wc,Xa=a):(q=ee,Xa=a.length);var d="string"===typeof b?b:xc,i=i==cC?g:[Gb,Qa.fa,Qa.Ba][i===cc?c:i](Math.max(Xa,d?1:b.length));if(q){return li(i,Xa),i}for(q=0;q<Xa;){var f=a[q];"function"===typeof f&&(f=Qa.dd(f));g=d||b[q];0===g?q++:("i64"==g&&(g="i32"),dk(i+q,f,g),q+=Qa.Y(g))}return i}function Oe(a,b){for(var i=new Qa.Q,g="undefined"==typeof b,q="",Xa=0,d;;){d=Be[a+Xa];if(g&&0==d){break}q+=i.wa(d);Xa+=1;if(!g&&Xa==b){break}}return q}function qn(a){for(;0<a.length;){var b=a.shift(),i=b.U;"number"===typeof i&&(i=J[i]);i(b.Ja===cc?xc:b.Ja)}}function Ba(a){for(var b=a;m[b++];){}return b-a-1}function Nd(a,b,i){a=(new Qa.Q).ib(a);i&&(a.length=i);b||a.push(0);return a}function aC(a,b,i){a=Nd(a,i);for(i=0;i<a.length;){m[b+i]=a[i],i+=1}}function bC(a,b){for(var i=0;i<a.length;i++){m[b+i]=a[i]}}function or(a,b){return 0<=a?a:32>=b?2*Math.abs(1<<b-1)+a:Math.pow(2,b)+a}function dC(a,b){if(0>=a){return a}var i=32>=b?Math.abs(1<<b-1):Math.pow(2,b-1);if(a>=i&&(32>=b||a>i)){a=-2*i+a}return a}function pr(a){Zg++;K.monitorRunDependencies&&K.monitorRunDependencies(Zg);a?(Ae(!ek[a]),ek[a]=1,fk===xc&&"undefined"!==typeof setInterval&&(fk=setInterval((function(){var a=ee,b;for(b in ek){a||(a=wc,K.n("still waiting on run dependencies:")),K.n("dependency: "+b)}a&&K.n("(end of list)")}),6e3))):K.n("warning: run dependency added without ID")}function rn(a){Zg--;K.monitorRunDependencies&&K.monitorRunDependencies(Zg);a?(Ae(ek[a]),delete ek[a]):K.n("warning: run dependency removed without ID");0==Zg&&(fk!==xc&&(clearInterval(fk),fk=xc),eC||qr())}function td(a,b,i){for(var g=0;g<i;){var q=Be[a+g],Xa=Be[b+g];if(q==Xa&&0==q){break}if(0==q){return-1}if(0==Xa){return 1}if(q==Xa){g++}else{return q>Xa?1:-1}}return 0}function ka(a,b){return td(a,b,gk)}function Ve(a,b,i){for(var g=0;g<i;g++){var q=Be[a+g],Xa=Be[b+g];if(q!=Xa){return q>Xa?1:-1}}return 0}function tf(b,r,i){if(20<=i&&r%2==b%2){if(r%4==b%4){for(i=r+i;r%4;){m[b++]=m[r++]}for(var r=r>>2,b=b>>2,g=i>>2;r<g;){a[b++]=a[r++]}r<<=2;for(b<<=2;r<i;){m[b++]=m[r++]}}else{i=r+i;r%2&&(m[b++]=m[r++]);r>>=1;b>>=1;for(g=i>>1;r<g;){D[b++]=D[r++]}r<<=1;b<<=1;r<i&&(m[b++]=m[r++])}}else{for(;i--;){m[b++]=m[r++]}}}function Ea(b){Ea.c||(Ea.c=d([0],"i32",c));return a[Ea.c>>2]=b}function fC(a,b,i){var g=Q.a[a];if(g){if(g.q){if(0>i){return Ea(va.i),-1}if(g.object.d){if(g.object.l){for(var q=0;q<i;q++){try{g.object.l(m[b+q])}catch(Xa){return Ea(va.r),-1}}g.object.timestamp=Date.now();return q}Ea(va.ja);return-1}q=g.position;a=Q.a[a];if(!a||a.object.d){Ea(va.j),b=-1}else{if(a.q){if(a.object.e){Ea(va.N),b=-1}else{if(0>i||0>q){Ea(va.i),b=-1}else{for(var d=a.object.b;d.length<q;){d.push(0)}for(var c=0;c<i;c++){d[q+c]=Be[b+c]}a.object.timestamp=Date.now();b=c}}}else{Ea(va.h),b=-1}}-1!=b&&(g.position+=b);return b}Ea(va.h);return-1}Ea(va.j);return-1}function Lc(a,b,i,g){i*=b;if(0==i){return 0}a=fC(g,a,i);return-1==a?(Q.a[g]&&(Q.a[g].error=wc),0):Math.floor(a/b)}function gC(x,r){function i(x){var i;"double"===x?i=(b[0]=a[r+q>>2],b[1]=a[r+(q+4)>>2],f[0]):"i64"==x?i=[a[r+q>>2],a[r+(q+4)>>2]]:(x="i32",i=a[r+q>>2]);q+=Qa.W(x);return i}for(var g=x,q=0,Xa=[],d,c;;){var n=g;d=m[g];if(0===d){break}c=m[g+1];if(37==d){var z=ee,h=ee,e=ee,j=ee;a:for(;;){switch(c){case 43:z=wc;break;case 45:h=wc;break;case 35:e=wc;break;case 48:if(j){break a}else{j=wc;break};default:break a}g++;c=m[g+1]}var t=0;if(42==c){t=i("i32"),g++,c=m[g+1]}else{for(;48<=c&&57>=c;){t=10*t+(c-48),g++,c=m[g+1]}}var u=ee;if(46==c){var w=0,u=wc;g++;c=m[g+1];if(42==c){w=i("i32"),g++}else{for(;;){c=m[g+1];if(48>c||57<c){break}w=10*w+(c-48);g++}}c=m[g+1]}else{w=6}var A;switch(String.fromCharCode(c)){case"h":c=m[g+2];104==c?(g++,A=1):A=2;break;case"l":c=m[g+2];108==c?(g++,A=8):A=4;break;case"L":;case"q":;case"j":A=8;break;case"z":;case"t":;case"I":A=4;break;default:A=xc}A&&g++;c=m[g+1];if(-1!="diuoxXp".split("").indexOf(String.fromCharCode(c))){n=100==c||105==c;A=A||4;var B=d=i("i"+8*A),C;8==A&&(d=Qa.cb(d[0],d[1],117==c));4>=A&&(d=(n?dC:or)(d&Math.pow(256,A)-1,8*A));var P=Math.abs(d),n="";if(100==c||105==c){C=8==A&&hk?hk.stringify(B[0],B[1],xc):dC(d,8*A).toString(10)}else{if(117==c){C=8==A&&hk?hk.stringify(B[0],B[1],wc):or(d,8*A).toString(10),d=Math.abs(d)}else{if(111==c){C=(e?"0":"")+P.toString(8)}else{if(120==c||88==c){n=e?"0x":"";if(8==A&&hk){C=(B[1]>>>0).toString(16)+(B[0]>>>0).toString(16)}else{if(0>d){d=-d;C=(P-1).toString(16);B=[];for(e=0;e<C.length;e++){B.push((15-parseInt(C[e],16)).toString(16))}for(C=B.join("");C.length<2*A;){C="f"+C}}else{C=P.toString(16)}}88==c&&(n=n.toUpperCase(),C=C.toUpperCase())}else{112==c&&(0===P?C="(nil)":(n="0x",C=P.toString(16)))}}}}if(u){for(;C.length<w;){C="0"+C}}for(z&&(n=0>d?"-"+n:"+"+n);n.length+C.length<t;){h?C+=" ":j?C="0"+C:n=" "+n}C=n+C;C.split("").forEach((function(a){Xa.push(a.charCodeAt(0))}))}else{if(-1!="fFeEgG".split("").indexOf(String.fromCharCode(c))){d=i("double");if(isNaN(d)){C="nan",j=ee}else{if(isFinite(d)){u=ee;A=Math.min(w,20);if(103==c||71==c){u=wc,w=w||1,A=parseInt(d.toExponential(A).split("e")[1],10),w>A&&-4<=A?(c=(103==c?"f":"F").charCodeAt(0),w-=A+1):(c=(103==c?"e":"E").charCodeAt(0),w--),A=Math.min(w,20)}if(101==c||69==c){C=d.toExponential(A),/[eE][-+]\d$/.test(C)&&(C=C.slice(0,-1)+"0"+C.slice(-1))}else{if(102==c||70==c){C=d.toFixed(A)}}n=C.split("e");if(u&&!e){for(;1<n[0].length&&-1!=n[0].indexOf(".")&&("0"==n[0].slice(-1)||"."==n[0].slice(-1));){n[0]=n[0].slice(0,-1)}}else{for(e&&-1==C.indexOf(".")&&(n[0]+=".");w>A++;){n[0]+="0"}}C=n[0]+(1<n.length?"e"+n[1]:"");69==c&&(C=C.toUpperCase());z&&0<=d&&(C="+"+C)}else{C=(0>d?"-":"")+"inf",j=ee}}for(;C.length<t;){C=h?C+" ":j&&("-"==C[0]||"+"==C[0])?C[0]+"0"+C.slice(1):(j?"0":" ")+C}97>c&&(C=C.toUpperCase());C.split("").forEach((function(a){Xa.push(a.charCodeAt(0))}))}else{if(115==c){z=i("i8*")||tQa;j=Ba(z);u&&(j=Math.min(j,w));if(!h){for(;j<t--;){Xa.push(32)}}for(e=0;e<j;e++){Xa.push(Be[z++])}if(h){for(;j<t--;){Xa.push(32)}}}else{if(99==c){for(h&&Xa.push(i("i8"));0<--t;){Xa.push(32)}h||Xa.push(i("i8"))}else{if(110==c){h=i("i32*"),a[h>>2]=Xa.length}else{if(37==c){Xa.push(d)}else{for(e=n;e<g+2;e++){Xa.push(m[e])}}}}}}}g+=2}else{Xa.push(d),g+=1}}return Xa}function Va(a,b,i){i=gC(b,i);b=Qa.ga();a=Lc(d(i,"i8",$g),1,i.length,a);Qa.Aa(b);return a}function sa(a,b,i,g){Ub("Assertion failed: "+(g?Oe(g):"unknown condition")+", at: "+[a?Oe(a):"unknown filename",b,i?Oe(i):"unknown function"])}function Hb(a){var b=Ba(a),i=Gb(b+1);tf(i,a,b);m[i+b]=0;return i}function hC(a,b,i,g){for(var i=gC(i,g),g=b===cc?i.length:Math.min(i.length,Math.max(b-1,0)),q=0;q<g;q++){m[a+q]=i[q]}if(g<b||b===cc){m[a+q]=0}return i.length}function Ma(a,b,i){return hC(a,cc,b,i)}function mi(){mi.c||(mi.c=d([0],"i8",sn));return mi.c}function li(b,r){var i=0;if(20<=r){for(var g=b+r;b%4;){m[b++]=i}0>i&&(i+=256);for(var q=b>>2,c=g>>2,d=i|i<<8|i<<16|i<<24;q<c;){a[q++]=d}for(b=q<<2;b<g;){m[b++]=i}}else{for(;r--;){m[b++]=i}}}function He(x,r,i,g){He.whiteSpace||(He.whiteSpace={},He.whiteSpace[32]=1,He.whiteSpace[9]=1,He.whiteSpace[10]=1,He.whiteSpace[" "]=1,He.whiteSpace["\t"]=1,He.whiteSpace["\n"]=1);var x=Oe(x),q=0;if(0<=x.indexOf("%n")){var c=r,r=(function(){q++;return c()}),d=i,i=(function(){q--;return d()})}var k=0,n=0,z=0,h,k=0;a:for(;k<x.length;){if("%"===x[k]&&"n"==x[k+1]){var e=a[g+z>>2],z=z+Qa.W("void*");a[e>>2]=q;k+=2}else{for(;;){h=r();if(0==h){return n}if(!(h in He.whiteSpace)){break}}i();if("%"===x[k]){k++;for(var j=k;48<=x[k].charCodeAt(0)&&57>=x[k].charCodeAt(0);){k++}var t;k!=j&&(t=parseInt(x.slice(j,k),10));var u=j=ee,w=ee;"l"==x[k]?(j=wc,k++,"l"==x[k]&&(w=wc,k++)):"h"==x[k]&&(u=wc,k++);var A=x[k];k++;var B=0,e=[];if("f"==A){B=0;for(h=r();0<h;){e.push(String.fromCharCode(h)),/^[+-]?[0-9]*\.?[0-9]+([eE][+-]?[0-9]+)?$/.exec(e.join(""))&&(B=e.length),h=r()}for(h=0;h<e.length-B+1;h++){i()}e.length=B}else{h=r();for(var C=wc;(B<t||isNaN(t))&&0<h;){if(!(h in He.whiteSpace)&&("s"==A||("d"===A||"u"==A||"i"==A)&&(48<=h&&57>=h||C&&45==h)||"x"===A&&(48<=h&&57>=h||97<=h&&102>=h||65<=h&&70>=h))&&(k>=x.length||h!==x[k].charCodeAt(0))){e.push(String.fromCharCode(h)),h=r(),B++,C=ee}else{break}}i()}if(0===e.length){return 0}h=e.join("");e=a[g+z>>2];z+=Qa.W("void*");switch(A){case"d":;case"u":;case"i":u?D[e>>1]=parseInt(h,10):w?(ji=[parseInt(h,10)>>>0,Math.min(Math.floor(parseInt(h,10)/4294967296),4294967295)],a[e>>2]=ji[0],a[e+4>>2]=ji[1]):a[e>>2]=parseInt(h,10);break;case"x":a[e>>2]=parseInt(h,16);break;case"f":j?(f[0]=parseFloat(h),a[e>>2]=b[0],a[e+4>>2]=b[1]):ib[e>>2]=parseFloat(h);break;case"s":j=Nd(h);for(u=0;u<j.length;u++){m[e+u]=j[u]}}n++}else{if(x[k]in He.whiteSpace){for(h=r();h in He.whiteSpace;){if(0>=h){break a}h=r()}i(h)}else{if(h=r(),x[k].charCodeAt(0)!==h){i(h);break a}}k++}}}return n}function Cd(a,b,i){var g=0;return He(b,(function(){return m[a+g++]}),(function(){g--}),i)}function he(a,b){rr||(rr=Gb(4));var i;a:{i=a;var g=rr,q,c,d,f;if(0==i&&0==(i=ki(g,"i8*"))){i=0}else{b:for(;;){c=ki(i++,"i8");for(q=b;0!=(d=ki(q++,"i8"));){if(c==d){continue b}}break}if(0==c){dk(g,0,"i8*"),i=0}else{for(f=i-1;;){c=ki(i++,"i8");q=b;do{if((d=ki(q++,"i8"))==c){0==c?i=0:dk(i-1,0,"i8");dk(g,i,"i8*");i=f;break a}}while(0!=d)}Yg("strtok_r error!");i=cc}}}return i}function ah(a){return a in{32:0,9:0,10:0,11:0,12:0,13:0}}function Rf(a,b){var i=0;do{m[a+i]=m[b+i],i++}while(0!=m[b+(i-1)])}function uf(a,b){var i=Ba(a),g=0;do{m[a+i+g]=m[b+g],g++}while(0!=m[b+(g-1)])}function Jc(a,b){a--;do{a++;var i=m[a];if(i==b){return a}}while(i);return 0}function wg(b,r){for(var i=b;ah(m[b]);){b++}var g=1;45==m[b]?(g=-1,b++):43==m[b]&&b++;for(var q,c=0,d=ee;;){q=m[b];if(!(48<=q&&57>=q)){break}d=wc;c=10*c+q-48;b++}var f=ee;if(46==m[b]){b++;for(var n=.1;;){q=m[b];if(!(48<=q&&57>=q)){break}f=wc;c+=n*(q-48);n/=10;b++}}if(!d&&!f){return r&&(a[r>>2]=i),0}q=m[b];if(101==q||69==q){b++;i=0;d=ee;q=m[b];45==q?(d=wc,b++):43==q&&b++;for(q=m[b];48<=q&&57>=q;){i=10*i+q-48,b++,q=m[b]}d&&(i=-i);c*=Math.pow(10,i)}r&&(a[r>>2]=b);return c*g}function bh(a){for(;ah(m[a]);){a++}var b=1;45==m[a]?(b=-1,a++):43==m[a]&&a++;var i=10;!i&&48==m[a]&&(120==m[a+1]||88==m[a+1]?(i=16,a+=2):(i=8,a++));i||(i=10);for(var g,q=0;0!=(g=m[a])&&!(g=parseInt(String.fromCharCode(g),i),isNaN(g));){q=q*i+g,a++}q*=b;if(2147483647<q||-2147483648>q){q=2147483647<q?2147483647:-2147483648,Ea(va.ka)}return q}function uQa(a,b,i,g){var q=Q.a[a];if(!q||q.object.d){return Ea(va.j),-1}if(q.p){if(q.object.e){return Ea(va.N),-1}if(0>i||0>g){return Ea(va.i),-1}for(a=0;q.g.length&&0<i;){m[b++]=q.g.pop(),i--,a++}q=q.object.b;i=Math.min(q.length-g,i);if(q.subarray||q.slice){for(var c=0;c<i;c++){m[b+c]=q[g+c]}}else{for(c=0;c<i;c++){m[b+c]=q.get(g+c)}}return a+i}Ea(va.h);return-1}function sr(a,b,i){var g=Q.a[a];if(g){if(g.p){if(0>i){return Ea(va.i),-1}if(g.object.d){if(g.object.input){for(a=0;g.g.length&&0<i;){m[b++]=g.g.pop(),i--,a++}for(var q=0;q<i;q++){try{var c=g.object.input()}catch(d){return Ea(va.r),-1}if(c===xc||c===cc){break}a++;m[b+q]=c}return a}Ea(va.ja);return-1}c=g.g.length;a=uQa(a,b,i,g.position);-1!=a&&(g.position+=g.g.length-c+a);return a}Ea(va.h);return-1}Ea(va.j);return-1}function ni(a){if(!Q.a[a]){return-1}var b=Q.a[a];if(b.f||b.error){return-1}a=sr(a,ni.c,1);return 0==a?(b.f=wc,-1):-1==a?(b.error=wc,-1):Be[ni.c]}function oi(a,b,i){if(!Q.a[i]){return 0}var g=Q.a[i];if(g.error||g.f){return 0}for(var q,c=0;c<b-1&&10!=q;c++){q=ni(i);if(-1==q){if(g.error){return 0}if(g.f){break}}m[a+c]=q}m[a+c]=0;return a}function ik(a,b){var i=a+Ba(a);do{if(m[i]==b){return i}i--}while(i>=a);return 0}function vQa(a){a=Oe(a);a=Q.o(a);return a===xc?-1:!a.v?(Ea(va.h),-1):0}function jk(a,b){for(var i=ee,g,q=0;63>q;q++){g=i?0:m[b+q],m[a+q]=g,i=i||0==m[b+q]}}function tn(a,b,i,g,q){for(var q=J[q],c=0,d,f,n;c<i;){if(d=c+i>>>1,n=b+d*g,f=q(a,n),0>f){i=d}else{if(0<f){c=d+1}else{return n}}}return 0}function Pe(){qn(tr);iC.print();Ub("exit(1) called, at "+Error().stack)}function vf(a){return 65<=a&&90>=a?a-65+97:a}function S(){Ub("abort() at "+Error().stack)}function kk(a,b){var i=or(a&255);m[kk.c]=i;return-1==fC(b,kk.c,1)?(Q.a[b]&&(Q.a[b].error=wc),-1):i}function pi(a,b){return Math.sqrt(a*a+b*b)}function wQa(b,r,i){var g=a[i>>2],q=r&3,i=0!=q,q=1!=q,c=Boolean(r&512),d=Boolean(r&2048),f=Boolean(r&1024),n=Boolean(r&8),b=Q.D(Oe(b));if(!b.L){return Ea(b.error),-1}if(r=b.object||xc){if(c&&d){return Ea(va.ha),-1}if((i||c||f)&&r.e){return Ea(va.N),-1}if(q&&!r.v||i&&!r.write){return Ea(va.h),-1}if(f&&!r.d){r.b=[]}else{if(!Q.ua(r)){return Ea(va.r),-1}}b=b.path}else{if(!c){return Ea(va.O),-1}if(!b.u.write){return Ea(va.h),-1}r=Q.S(b.u,b.name,[],g&256,g&128);b=b.ba+"/"+b.name}g=Q.a.length;if(r.e){i=0;jC&&(i=Gb(jC.A));var q=[],h;for(h in r.b){q.push(h)}Q.a[g]={path:b,object:r,position:-2,p:wc,q:ee,K:ee,error:ee,f:ee,g:[],b:q,qa:i}}else{Q.a[g]={path:b,object:r,position:0,p:q,q:i,K:n,error:ee,f:ee,g:[]}}return g}function qi(a,b){var i,b=Oe(b);if("r"==b[0]){i=-1!=b.indexOf("+")?2:0}else{if("w"==b[0]){i=-1!=b.indexOf("+")?2:1,i|=1536}else{if("a"==b[0]){i=-1!=b.indexOf("+")?2:1,i|=512,i|=8}else{return Ea(va.i),0}}}i=wQa(a,i,d([511,0,0,0],"i32",$g));return-1==i?0:i}function ri(a){Q.a[a]||Ea(va.j);Q.a[a]?(Q.a[a].qa&&G(Q.a[a].qa),Q.a[a]=xc):Ea(va.j)}function un(a,b){var i=0,g;do{i||(g=a,i=b);var q=m[a++],c=m[i++];if(0==c){return g}c!=q&&(a=g+1,i=0)}while(q);return 0}function kC(b,r){if(Q.a[b]){var i=Nd(Q.a[b].path);i=d(i,"i8",$g);i=Q.o(Oe(i),cc);if(i!==xc&&Q.ua(i)){var g=xQa;a[r+g.yb>>2]=1;a[r+g.Bb>>2]=0;a[r+g.ub>>2]=0;a[r+g.qb>>2]=4096;a[r+g.vb>>2]=i.$;var q=Math.floor(i.timestamp/1e3);if(g.ea===cc){g.ea=g.pb.Da;g.za=g.xb.Da;g.ya=g.sb.Da;var c=1e3*(i.timestamp%1e3);a[r+g.pb.Ca>>2]=c;a[r+g.xb.Ca>>2]=c;a[r+g.sb.Ca>>2]=c}a[r+g.ea>>2]=q;a[r+g.za>>2]=q;a[r+g.ya>>2]=q;var l=0,f=q=0,n=c=0;i.d?(c=n=i.$,q=f=0,l=8192):(c=1,n=0,i.e?(q=4096,f=1,l=16384):(l=i.b||i.link,q=l.length,f=Math.ceil(l.length/4096),l=i.link===cc?32768:40960));a[r+g.tb>>2]=c;a[r+g.zb>>2]=n;a[r+g.Ab>>2]=q;a[r+g.rb>>2]=f;i.v&&(l|=365);i.write&&(l|=146);a[r+g.wb>>2]=l}}else{Ea(va.j)}}function xg(a,b,i){if(Q.a[a]&&!Q.a[a].object.d){var g=Q.a[a];1===i?b+=g.position:2===i&&(b+=g.object.b.length);0>b?(Ea(va.i),i=-1):(g.g=[],i=g.position=b)}else{Ea(va.j),i=-1}-1!=i&&(Q.a[a].f=ee)}function lC(a,b,i,g){i*=b;if(0==i){return 0}a=sr(g,a,i);g=Q.a[g];if(-1==a){return g&&(g.error=wc),0}a<i&&(g.f=wc);return Math.floor(a/b)}function mC(b){var r,i;ur===xc?(Ee.USER="root",Ee.PATH="/",Ee.PWD="/",Ee.HOME="/home/emscripten",Ee.LANG="en_US.UTF-8",Ee._="./this.program",r=d(1024,"i8",c),i=d(256,"i8*",c),a[i>>2]=r,ur=d([i],"i8**",c)):(i=a[ur>>2],r=a[i>>2]);var g=[],q=0,Xa;for(Xa in b){if("string"===typeof b[Xa]){var l=Xa+"="+b[Xa];g.push(l);q+=l.length}}1024<q&&Ub(Error("Environment size exceeded TOTAL_ENV_SIZE!"));for(b=0;b<g.length;b++){l=g[b];for(q=0;q<l.length;q++){m[r+q]=l.charCodeAt(q)}m[r+q]=0;a[i+4*b>>2]=r;r+=l.length+1}a[i+4*g.length>>2]=0}function lk(a){if(0===a){return 0}a=Oe(a);if(!Ee.hasOwnProperty(a)){return 0}lk.c&&G(lk.c);lk.c=d(Nd(Ee[a]),"i8",sn);return lk.c}function mk(a){0!==a&&li(a,yQa.A)}function si(a){si.buffer||(si.buffer=Gb(256));var b=si.buffer;if(a in vr){if(255<vr[a].length){Ea(va.ka)}else{for(var a=vr[a],i=0;i<a.length;i++){m[b+i]=a.charCodeAt(i)}m[b+i]=0}}else{Ea(va.i)}return si.buffer}function nC(a){return Number(Q.a[a]&&Q.a[a].error)}function oC(a){return 48<=a&&57>=a||97<=a&&122>=a||65<=a&&90>=a}function ti(a){return 97<=a&&122>=a||65<=a&&90>=a}function zQa(a){if(Q.a[a]){return a=Q.a[a],a.object.d?(Ea(va.Fa),-1):a.position}Ea(va.j);return-1}function vn(a,b,i){var g=Q.o(b||"/tmp");if(!g||!g.e){if(b="/tmp",g=Q.o(b),!g||!g.e){return 0}}i=i||"file";do{i+=String.fromCharCode(65+Math.floor(25*Math.random()))}while(i in g.b);b=b+"/"+i;vn.buffer||(vn.buffer=Gb(256));a||(a=vn.buffer);for(g=0;g<b.length;g++){m[a+g]=b.charCodeAt(g)}m[a+g]=0;return a}function wn(){wn.mode&&(wn.mode=d(Nd("w+"),"i8",sn));return qi(vn(0),wn.mode)}function ch(a,b,i){if(0!=b){for(var i=J[i],g=[],q=0;q<b;q++){g.push(q)}g.sort((function(b,g){return i(a+4*b,a+4*g)}));var c=Gb(4*b);tf(c,a,4*b);for(q=0;q<b;q++){g[q]!=q&&tf(a+4*q,c+4*g[q],4)}G(c)}}function AQa(){switch(8){case 8:return BQa;case 54:;case 56:;case 21:;case 61:;case 63:;case 22:;case 67:;case 23:;case 24:;case 25:;case 26:;case 27:;case 69:;case 28:;case 101:;case 70:;case 71:;case 29:;case 30:;case 199:;case 75:;case 76:;case 32:;case 43:;case 44:;case 80:;case 46:;case 47:;case 45:;case 48:;case 49:;case 42:;case 82:;case 33:;case 7:;case 108:;case 109:;case 107:;case 112:;case 119:;case 121:return 200809;case 13:;case 104:;case 94:;case 95:;case 34:;case 35:;case 77:;case 81:;case 83:;case 84:;case 85:;case 86:;case 87:;case 88:;case 89:;case 90:;case 91:;case 94:;case 95:;case 110:;case 111:;case 113:;case 114:;case 115:;case 116:;case 117:;case 118:;case 120:;case 40:;case 16:;case 79:;case 19:return-1;case 92:;case 93:;case 5:;case 72:;case 6:;case 74:;case 92:;case 93:;case 96:;case 97:;case 98:;case 99:;case 102:;case 103:;case 105:return 1;case 38:;case 66:;case 50:;case 51:;case 4:return 1024;case 15:;case 64:;case 41:return 32;case 55:;case 37:;case 17:return 2147483647;case 18:;case 1:return 47839;case 59:;case 57:return 99;case 68:;case 58:return 2048;case 0:return 2097152;case 3:return 65536;case 14:return 32768;case 73:return 32767;case 39:return 16384;case 60:return 1e3;case 106:return 700;case 52:return 256;case 62:return 255;case 2:return 100;case 65:return 64;case 36:return 20;case 100:return 16;case 20:return 6;case 53:return 4}Ea(va.i);return-1}function Ie(a){var b=Ie;b.Oa||(We=We+4095>>12<<12,b.Oa=wc,Ie.Eb=We);b=We;0!=a&&Qa.Ba(a);return b}function pC(){return a[pC.La>>2]}function qC(b){var r;r=(b+8|0)>>2;var b=a[r]>>2,i=a[b];if(0!=(i&4096|0)){var g=a[b+1];return g}var q=0==(i&3|0);a:do{if(q){if(0!=(i&112|0)){g=a[b+2]}else{var c=a[b+1];if(0==(c|0)){g=0}else{var d=c+4|0,f=a[d>>2],n=0==(f|0);b:do{if(n){var h=c,e=a[c>>2]}else{for(var s=c,j=d,t=f;;){var m=t|0;a[j>>2]=a[m>>2];a[m>>2]=s;j=t+4|0;m=a[j>>2];if(0==(m|0)){h=t;e=s;break b}else{s=t,t=m}}}}while(0);if(0==(e|0)){g=h}else{c=h|0;for(f=e;;){d=a[f+4>>2];if(0==(d|0)){c=f}else{for(;!(n=d|0,a[f+4>>2]=a[n>>2],a[n>>2]=f,n=a[d+4>>2],0==(n|0));){f=d,d=n}c=a[c>>2]=d}c|=0;d=a[c>>2];if(0==(d|0)){g=h;break a}else{f=d}}}}}}else{if(d=a[b+2],f=a[b+3],c=(f<<2)+d|0,0<(f|0)){for(n=f=0;;){s=a[d>>2];if(0!=(s|0)){0==(f|0)?f=n=s:a[f>>2]=s;for(;!(s=a[f>>2],0==(s|0));){f=s}a[d>>2]=f}d=d+4|0;if(d>>>0>=c>>>0){g=n;break a}}}else{g=0}}}while(0);a[a[r]+4>>2]=g;h=a[r]|0;a[h>>2]|=4096;return g}function rC(b,r){var i=h;if(0==(a[qa+12>>2]|0)){a[qa>>2]=288;a[qa+4>>2]=304;a[qa+8>>2]=184;m[qa+31|0]=1;var g;g=xn(sC|0,0);a[qa+12>>2]=g;g=(g+40|0)>>2;0!=(a[ui(a[a[g]+4>>2]|0,wr|0,Y|0)+8>>2]|0)&&S();var q=ui(a[a[g]+4>>2]|0,vi|0,Y|0);1!=(a[q+8>>2]|0)&&S();m[q+12|0]=0;g=ui(a[a[g]+4>>2]|0,wi|0,Y|0);2==(a[g+8>>2]|0)?m[g+12|0]=0:S()}else{288==(a[qa>>2]|0)&304==(a[qa+4>>2]|0)&184==(a[qa+8>>2]|0)||la(0,tC|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j))}h=i;xi(0,dh|0,yg|0);i=fa(340);g=i>>2;0!=(i|0)&&(a[g]=nk|0,a[g+4]=94,a[g+8]=0,a[g+9]=1);g=a[i+32>>2];if(0!=(g|0)&&(q=a[g>>2],0!=(q|0))){for(;!(103==m[q]<<24>>24&&0!=(un(q,uC|0)|0)&&xr(i,a[g+4>>2]),g=g+8|0,q=a[g>>2],0==(q|0));){}}m[i+44|0]=0;g=eh(i,2,yr|0);0!=(g|0)&&(a[i+132>>2]=a[a[g+16>>2]+12>>2]);xr(i,yn);xr(i,zn);g=a[qa+32>>2];a[qa+32>>2]=22;vC(b);zr();a[qa+32>>2]=g;g=a[qa+16>>2];An(i,g,ok|0);var c=a[zg>>2],d,q=a[g+32>>2];wC(i,r);var f=a[i+124>>2];d=f>>2;a[d+14]=Bn(f,a[d+13]);0==(a[q+44>>2]|0)&&0==(a[d+37]&67108864|0)?Lc(Ar|0,20,1,a[oa>>2]):(a[d+9]=c,0==(c|0)&&(c=f+148|0,a[c>>2]|=134217728),Br(i,q),Cr(f),Dr(i));q=g+176|0;f=a[q>>2];0!=(f|0)&&(J[f](g),a[q>>2]=0);q=g+44|0;0!=(a[q>>2]|0)&&(xC(g),a[q>>2]=0,a[a[g+32>>2]+44>>2]=0);Sf(g);g=a[yi>>2];0!=(g|0)&&(Kc(g),a[yi>>2]=0);g=a[i+52>>2];q=0==(g|0);b:do{if(!q){for(f=g;;){if(c=a[f+4>>2],G(f),0==(c|0)){break b}else{f=c}}}}while(0);q=a[i+100>>2];f=0==(q|0);b:do{if(!f){c=q;for(g=c>>2;;){if(d=a[g],G(a[g+1]),G(a[g+2]),G(c),0==(d|0)){break b}else{c=d,g=c>>2}}}}while(0);Dr(i);g=a[i+40>>2];0!=(g|0)&&G(g);g=a[i+48>>2];0!=(g|0)&&G(g);G(i)}function Kc(b){var r=b>>2;if(0==(b|0)||0<(a[r+6]|0)){return-1}var i=a[r+1],g=i+32|0,q=a[g>>2];if(0==(q|0)){q=0}else{if(q=J[q](b,2,0,i),0>(q|0)){return-1}}0!=(a[r+7]|0)&&yC(b,0);if(q=0==(q|0)){J[a[a[r+4]>>2]](b,0,64);if(0<(rc(b)|0)){return-1}var c=b+8|0,d=a[c>>2],f=b+12|0;0<(a[d+12>>2]|0)?(J[a[f>>2]](b,a[d+8>>2],0,i),c=a[c>>2]):c=d;J[a[f>>2]](b,c,0,i)}f=a[r+5];if(0==(f|0)){G(b)}else{if(q&1==(f|0)){J[a[r+3]](b,b,0,i)}}r=a[g>>2];if(0==(r|0)){return 0}J[r](b,6,0,i);return 0}function pk(b,r,i){var g,q;q=(b+4|0)>>2;var c=a[q];if(0==(c|0)){a[q]=r;c=a[r+28>>2];a[b+12>>2]=0==(c|0)?144:c;var d;return r}if(0==(r|0)){return c}var f=a[a[b+16>>2]>>2];g=(b+8|0)>>2;0!=(a[a[g]>>2]&4096|0)&&Ag(b,0);var n=a[c+32>>2];if(0!=(n|0)&&0>(J[n](b,3,r,c)|0)){return 0}a[q]=r;q=a[r+28>>2];a[b+12>>2]=0==(q|0)?144:q;q=a[a[g]>>2];if(0!=(q&112|0)){return c}if(0==(q&2|0)){if(0==(q&3|0)){if(0!=(i&1|0)){return c}}else{if(3==(i&3|0)){return c}}}else{if(0!=(i&2|0)){return c}}q=qC(b);n=a[g]|0;a[n>>2]&=-4097;a[a[g]+4>>2]=0;a[a[g]+16>>2]=0;g=a[g]>>2;n=0==(a[g]&3|0);a:do{if(!n){var h=a[g+2],e=a[g+3],s=(e<<2)+h|0;if(0<(e|0)){for(;;){if(e=h+4|0,a[h>>2]=0,e>>>0<s>>>0){h=e}else{break a}}}}}while(0);if(0==(q|0)){return c}g=r+8|0;n=r+4|0;s=r|0;h=r+24|0;if(0==(i&2|0)){i=q>>2}else{for(r=q;;){if(i=a[r>>2],J[f](b,r,32),0==(i|0)){d=c;break}else{r=i}}return d}for(;;){var e=a[i],j=a[g>>2],t=a[n>>2],j=(0>(j|0)?a[i+2]:q+ -j|0)+a[s>>2]|0,j=0>(t|0)?a[j>>2]:j,m=a[h>>2],t=0==(m|0)?Cn(0,j,t):J[m](b,j,r);a[i+1]=t;J[f](b,q,32);if(0==(e|0)){d=c;break}else{q=e,i=q>>2}}return d}function zC(b,r,i){var g,q,c,d,f,n,h,e,s,j,t,m,w,A=b>>2,B;w=(b+8|0)>>2;0!=(a[a[w]>>2]&4096|0)&&Ag(b,0);var C=a[A+1];m=C>>2;var P=a[m],T=a[m+1];t=(C+8|0)>>2;var gb=a[t],$e=a[m+5];j=(b+20|0)>>2;a[j]&=-32769;var M=0==(r|0);a:do{if(M){if(0==(i&24|0)){var X=a[w];s=X>>2;if(1>(a[s+4]|0)){var O=0;return O}if(0==(i&448|0)){return O=0}var y=a[s+2],Da=a[s+3],ia=(Da<<2)+y|0,D=0<(Da|0);if(0==(i&64|0)){b:do{if(D){var F=0==(i&256|0);c:do{if(F){for(var Tf=y;;){var sc=Tf+4|0,E=a[Tf>>2],G=0==(E|0);if(sc>>>0<ia>>>0&G){Tf=sc}else{var H=E,hc=G;break c}}}else{for(var ca=ia;;){var I=ca-4|0,K=a[I>>2],zb=0==(K|0);if(y>>>0<I>>>0&zb){ca=I}else{H=K;hc=zb;break c}}}}while(0);if(hc|F){var ja=hc?0:H}else{for(var aa=H;;){var da=a[aa>>2];if(0==(da|0)){ja=aa;break b}else{aa=da}}}}else{ja=0}}while(0);var ea=X+20|0;a[ea>>2]=a[ea>>2]+1|0;a[a[w]+4>>2]=ja;return 0==(ja|0)?O=0:O=0>(gb|0)?a[ja+8>>2]:ja+ -gb|0}if(D){for(var xa=C+16|0,L=b+12|0,Od=0>(gb|0),ha=-gb|0,ga=y;;){var N=a[ga>>2];a[ga>>2]=0;var Rb=a[xa>>2];if(0==(Rb|0)){if(!(-1<(a[t]|0)|0==(N|0))){var Xe=N,tb=Rb;B=121}}else{0!=(N|0)&&(Xe=N,tb=Rb,B=121)}b:do{if(121==B){for(;;){B=0;var ya=a[Xe>>2];if(0!=(tb|0)){J[tb](b,Od?a[Xe+8>>2]:Xe+ha|0,C)}if(0>(a[t]|0)){J[a[L>>2]](b,Xe,0,C)}if(0==(ya|0)){break b}Xe=ya;tb=a[xa>>2]}}}while(0);var Uf=ga+4|0;if(Uf>>>0<ia>>>0){ga=Uf}else{break}}var wa=a[w]}else{wa=X}a[wa+4>>2]=0;a[a[w]+16>>2]=0;return O=a[a[w]+20>>2]=0}}else{var Ab=2==(a[a[A+4]+4>>2]|0);b:do{if(Ab){if(0==(i&4098|0)){B=150}else{if(0==(J[a[A]](b,r,4)|0)){return O=0}e=a[w]>>2;for(var Fa=a[e+1],Ga=((a[e+3]-1&a[Fa+4>>2])<<2)+a[e+2]|0,Bg=0>(gb|0),ta=-gb|0,Ka=Ga,za=0,ma=0;;){var pa=a[Ka>>2];if(0==(pa|0)){var wf=Ga,Ha=Fa;h=Ha>>2;var Ra=za;break b}if(((Bg?a[pa+8>>2]:pa+ta|0)|0)==(r|0)){wf=Ga;Ha=pa;h=Ha>>2;Ra=ma;break b}Ka=pa|0;za=(pa|0)==(Fa|0)?ma:za;ma=pa}}}else{B=150}}while(0);b:do{if(150==B){var W=0==(i&2565|0);c:do{if(W){if(0!=(i&1056|0)){var BC=0>(gb|0)?a[r+8>>2]:r+ -gb|0,La=BC+P|0,Vf=BC,Ya=r,Q=0>(T|0)?a[La>>2]:La,Za=a[r+4>>2]}else{n=a[w]>>2;var S=a[n+1];do{if(0!=(S|0)&&((0>(gb|0)?a[S+8>>2]:S+ -gb|0)|0)==(r|0)){var ab=a[S+4>>2],$a=r,jb=((a[n+3]-1&ab)<<2)+a[n+2]|0,Ca=S,Ia=0,eb=ab;B=192;break c}}while(0);var ub=r+P|0,Sa=0>(T|0)?a[ub>>2]:ub,U=a[m+6];0==(U|0)?(Vf=r,Q=Sa,Za=Cn(0,Sa,T)):(Vf=r,Q=Sa,Za=J[U](b,Sa,C))}}else{if(0==(i&512|0)){var ua=r+P|0,Oa=0>(T|0)?a[ua>>2]:ua}else{Oa=r}var Wa=a[m+6];0==(Wa|0)?(Vf=r,Q=Oa,Za=Cn(0,Oa,T)):(Vf=r,Q=Oa,Za=J[Wa](b,Oa,C))}B=175}while(0);c:do{if(175==B){var pb=a[w],ob=a[pb+12>>2];if(1>(ob|0)){var bb=0}else{var qb=((ob-1&Za)<<2)+a[pb+8>>2]|0,bb=a[qb>>2],V=qb}var kb=0>(gb|0),Y=0>(T|0),vb=0==($e|0),xb=1>(T|0),la=-gb|0,nb=bb;f=nb>>2;for(var rb=0;;){if(0==(nb|0)){var lb=Za,Ta=rb,cb=Ya,fb=0;d=fb>>2;var Ua=V;c=Ua>>2;var sb=Vf,Na=0;break c}if((Za|0)==(a[f+1]|0)){var R=(kb?a[f+2]:nb+la|0)+P|0,Db=Y?a[R>>2]:R;if(0==((vb?xb?ka(Q,Db):Ve(Q,Db,T):J[$e](b,Q,Db,C))|0)){var $a=Vf,jb=V,Ca=nb,Ob=Ya,Ia=rb,eb=Za;B=192;break c}}rb=nb;nb=a[f];f=nb>>2}}}while(0);192==B&&(0==(Ca|0)?(lb=eb,Ta=Ia,cb=Ob,fb=0,d=fb>>2,Ua=jb,c=Ua>>2,sb=$a,Na=0):(a[j]|=32768,lb=eb,Ta=Ia,cb=Ob,fb=Ca,d=fb>>2,Ua=jb,c=Ua>>2,sb=$a,Na=1));if(0!=(i&1540|0)){if(!Na){return O=0}if(0!=(Ta|0)){var Eb=a[w];if(0!=(a[Eb>>2]&1|0)&&1>(a[Eb+20>>2]|0)){var $=fb|0;a[Ta>>2]=a[$>>2];a[$>>2]=a[c];a[c]=fb}}a[a[w]+4>>2]=fb;return O=0>(gb|0)?a[d+2]:fb+ -gb|0}var Bb=0==(i&2049|0);c:do{if(Bb){var Ja=0==(i&8|0);d:do{if(Ja){if(0!=(i&16|0)){if(!(Na&0==(Ta|0))){var fa=Ta;B=251;break}var Z=a[c];if((Z|0)!=(fb|0)){for(var sa=Z;;){var CC=a[sa>>2];if((CC|0)==(fb|0)){fa=sa;B=251;break d}else{sa=CC}}}for(var DC=a[w],Wf=a[DC+8>>2],ic=Ua;;){var ra=ic-4|0;if(ra>>>0<Wf>>>0){B=247;break}var ba=a[ra>>2];if(0==(ba|0)){ic=ra}else{var qa=ba;B=249;break}}if(247==B){a[DC+4>>2]=0;break a}else{if(249==B){for(;;){B=0;var na=a[qa>>2];if(0==(na|0)){var oa=qa;B=250;break d}else{qa=na,B=249}}}}}if(0==(i&32|0)){wf=Ua;Ha=fb;h=Ha>>2;Ra=Ta;break b}if(!Na){var pc=sb,Wc=cb;break c}if(0!=(a[a[w]>>2]&2|0)){pc=sb;Wc=cb;break c}var Vb=a[m+4];if(0!=(Vb|0)){J[Vb](b,sb,C)}if(0>(a[t]|0)){J[a[A+3]](b,cb,0,C)}return O=0>(gb|0)?a[d+2]:fb+ -gb|0}if(Na){var Xd=a[d];if(0!=(Xd|0)){oa=Xd,B=250}else{q=a[w]>>2;for(var Ba=(a[q+3]<<2)+a[q+2]|0,Ea=Ua;;){var Aa=Ea+4|0;if(Aa>>>0>=Ba>>>0){break}var Cb=a[Aa>>2];if(0==(Cb|0)){Ea=Aa}else{oa=Cb;B=250;break d}}a[q+1]=0;break a}}else{fa=Ta,B=251}}while(0);if(250==B){var Ma=a[a[w]+4>>2]=oa}else{if(251==B){if(a[a[w]+4>>2]=fa,0==(fa|0)){break a}else{Ma=fa}}}var lc=a[w]|0;a[lc>>2]|=8192;return O=0>(gb|0)?a[Ma+8>>2]:Ma+ -gb|0}if(Na){var wb=a[w];if(0!=(a[wb>>2]&1|0)){return a[wb+4>>2]=fb,O=0>(gb|0)?a[d+2]:fb+ -gb|0}}var Jd=C+12|0,va=a[Jd>>2];if(0==(va|0)){var Hc=sb}else{if(0==(i&1|0)){Hc=sb}else{var Pa=J[va](b,sb,C);if(0==(Pa|0)){return O=0}Hc=Pa}}if(-1<(gb|0)){var oe=Hc+gb|0}else{var Qa=J[a[A+3]](b,0,12,C);if(0!=(Qa|0)){a[Qa+8>>2]=Hc,oe=Qa}else{if(0==(a[Jd>>2]|0)){return O=0}var Qb=a[m+4];if(0==(Qb|0)||0==(i&1|0)){return O=0}J[Qb](b,Hc,C);return O=0}}a[oe+4>>2]=lb;pc=Hc;Wc=oe}while(0);var tc=a[w]+16|0,Sc=a[tc>>2]+1|0;a[tc>>2]=Sc;var Gb=a[w],Va=a[Gb+12>>2];if((Sc|0)>(Va<<1|0)){if(1>(a[Gb+20>>2]|0)){Er(b);var hb=a[w],rd=hb,oc=a[hb+12>>2]}else{var rd=Gb,oc=Va}}else{rd=Gb,oc=Va}if(0!=(oc|0)){var ib=((oc-1&lb)<<2)+a[rd+8>>2]|0;if(Na){var Ib=fb|0;a[Wc>>2]=a[Ib>>2];a[Ib>>2]=Wc}else{a[Wc>>2]=a[ib>>2],a[ib>>2]=Wc}a[a[w]+4>>2]=Wc;return O=pc}var ve=rd+16|0;a[ve>>2]=a[ve>>2]-1|0;var Rd=a[m+4];if(0!=(Rd|0)&&0!=(i&1|0)){J[Rd](b,pc,C)}if(0<=(a[t]|0)){return O=0}J[a[m+7]](b,Wc,0,C);return O=0}}while(0);if(0==(Ha|0)){return O=0}do{if(0==(Ra|0)){var Bc=a[wf>>2];if((Bc|0)==(Ha|0)){var Sd=a[h],fd=a[wf>>2]=Sd}else{for(var yb=Bc;;){var yc=yb|0,Nb=a[yc>>2];if((Nb|0)==(Ha|0)){break}else{yb=Nb}}a[yc>>2]=a[h];fd=yb}}else{a[Ra>>2]=a[h],fd=Ra}}while(0);var Hb=0>(gb|0)?a[h+2]:Ha+ -gb|0,Tc=a[w]+16|0;a[Tc>>2]=a[Tc>>2]-1|0;a[a[w]+4>>2]=fd;var mb=a[m+4];if(0!=(mb|0)&&0!=(i&2|0)){J[mb](b,Hb,C)}if(0<=(a[t]|0)){return O=Hb}J[a[A+3]](b,Ha,0,C);return O=Hb}}while(0);var Mc=a[w]+20|0,id=a[Mc>>2]-1|0;a[Mc>>2]=id;0>(id|0)&&(a[a[w]+20>>2]=0);g=a[w]>>2;if((a[g+4]|0)<=(a[g+3]<<1|0)||1<=(a[g+5]|0)){return O=0}Er(b);return O=0}function Er(b){var r,i,g=h;h+=4;var q;i=g>>2;r=(b+8|0)>>2;var c=a[r],d=c+24|0;if(!(0<(a[d>>2]|0)&&0<(a[c+12>>2]|0))){a[d>>2]=0;a[i]=a[a[r]+12>>2];c=b+4|0;d=a[c>>2];do{if(0==(d|0)){q=325}else{var f=a[d+32>>2];if(0==(f|0)){q=325}else{if(0<(J[f](b,7,g,d)|0)){f=a[i];do{if(0>(f|0)){a[a[r]+24>>2]=1;if(0<(a[a[r]+12>>2]|0)){h=g;return}var n=a[i]}else{for(n=2;;){if((n|0)<(f|0)){n<<=1}else{break}}a[i]=n}}while(0);if(1>(n|0)){q=329}else{var z=n,e=a[r]}}else{q=325}}}}while(0);325==q&&(a[i]=0,q=329);a:do{if(329==q){d=a[r];f=a[d+12>>2];n=0==(f|0)?256:f;a[i]=n;var f=d+16|0,s=n<<1;if((a[f>>2]|0)>(s|0)){for(n=s;;){if(a[i]=n,s=n<<1,(a[f>>2]|0)>(s|0)){n=s}else{z=n;e=d;break a}}}else{z=n,e=d}}}while(0);q=a[e+12>>2];if((z|0)!=(q|0)&&(b=J[a[b+12>>2]](b,0==(q|0)?0:a[e+8>>2],z<<2,a[c>>2]),0!=(b|0))){q=a[r];e=a[q+12>>2];z=(e<<2)+b|0;a[q+8>>2]=b;a[a[r]+12>>2]=a[i];r=a[i]-1|0;e=(r|0)<(e|0);a:do{if(!e){for(q=(r<<2)+b|0;;){if(a[q>>2]=0,q=q-4|0,q>>>0<z>>>0){break a}}}}while(0);if(b>>>0<z>>>0){for(r=b;;){e=a[r>>2];q=0;a:for(;;){c=0==(q|0);d=q|0;for(f=e;;){if(0==(f|0)){break a}var n=f|0,s=a[n>>2],j=((a[i]-1&a[f+4>>2])<<2)+b|0;if((j|0)==(r|0)){e=s;q=f;continue a}c?a[r>>2]=s:a[d>>2]=s;a[n>>2]=a[j>>2];a[j>>2]=f;f=s}}r=r+4|0;if(r>>>0>=z>>>0){break}}}}}h=g}function FC(b,r,i){var g,q,c,d,f,n;d=(b+8|0)>>2;0!=(a[a[d]>>2]&4096|0)&&Ag(b,0);var h=a[b+4>>2];q=h>>2;var e=a[q],s=a[q+1];n=(h+8|0)>>2;var j=a[n],m=a[q+5];f=(b+20|0)>>2;a[f]&=-32769;do{if(0==(r|0)){if(0!=(i&384|0)){d=a[d]>>2;b=a[d+2];if(0==(b|0)){var u=0;return u}if(0==(i&256|0)){d=a[d+1]=b}else{i=a[b+4>>2];a[d+1]=i;if(0==(i|0)){return u=0}d=i}return u=0>(j|0)?a[d+8>>2]:d+ -j|0}if(0!=(i&4098|0)){g=a[d];if(0!=(a[g>>2]&144|0)){return u=0}g=a[g+8>>2];if(0==(g|0)){u=0}else{var w=g;c=w>>2;break}return u}if(0==(i&64|0)){return u=0}i=h+16|0;q=a[i>>2];0==(q|0)?0>(a[n]|0)&&(g=372):g=372;a:do{if(372==g&&(m=a[a[d]+8>>2],0!=(m|0))){f=b+12|0;e=0>(j|0);s=-j|0;for(u=q;;){w=a[m>>2];if(0!=(u|0)){J[u](b,e?a[m+8>>2]:m+s|0,h)}if(0>(a[n]|0)){J[a[f>>2]](b,m,0,h)}if(0==(w|0)){break a}m=w;u=a[i>>2]}}}while(0);a[a[d]+4>>2]=0;a[a[d]+8>>2]=0;u=a[a[d]+16>>2]=0}else{if(0==(i&2049|0)){w=a[d];do{if(0==(i&512|0)){c=a[w+4>>2];if(0!=(c|0)&&((0>(j|0)?a[c+8>>2]:c+ -j|0)|0)==(r|0)){var A=c;break}g=r+e|0;var B=0>(s|0)?a[g>>2]:g}else{B=r}g=428}while(0);a:do{if(428==g){g=0>(j|0);c=0>(s|0);for(var r=0==(m|0),A=1>(s|0),C=-j|0,w=w+8|0;;){w=a[w>>2];if(0==(w|0)){u=0;break}var P=(g?a[w+8>>2]:w+C|0)+e|0,P=c?a[P>>2]:P;if(0==((r?A?ka(B,P):Ve(B,P,s):J[m](b,B,P,h))|0)){A=w;break a}else{w|=0}}return u}}while(0);if(0==(A|0)){return u=0}a[f]|=32768;if(0!=(i&4098|0)){w=A;c=w>>2;break}if(0==(i&8|0)){if(0==(i&16|0)){i=A}else{if(i=a[d],(A|0)!=(a[i+8>>2]|0)){i=a[A+4>>2]}else{return u=a[i+4>>2]=0}}}else{i=a[A>>2]}a[a[d]+4>>2]=i;return 0==(i|0)?u=0:u=0>(j|0)?a[i+8>>2]:i+ -j|0}n=h+12|0;f=a[n>>2];if(0==(f|0)){f=r}else{if(0==(i&1|0)){f=r}else{if(f=J[f](b,r,h),0==(f|0)){return u=0}}}if(-1<(j|0)){h=f+j|0,b=h>>2}else{if(e=J[a[b+12>>2]](b,0,12,h),0!=(e|0)){a[e+8>>2]=f,h=e,b=h>>2}else{if(0==(a[n>>2]|0)){return u=0}j=a[q+4];if(0==(j|0)||0==(i&1|0)){return u=0}J[j](b,f,h);return u=0}}n=h;f=a[d];q=f>>2;e=a[q];0==(e&128|0)?0==(e&16|0)?g=0==(e&32|0)?411:407:(e=a[q+1],s=0!=(e|0),0==(i&8192|0)?s?(e|0)==(a[q+2]|0)?g=407:(i=e+4|0,s=a[i>>2],a[b+1]=s,a[s>>2]=n,a[b]=e,a[i>>2]=h):g=407:s?(i=e|0,s=a[i>>2],0==(s|0)?g=411:(a[b]=s,a[s+4>>2]=h,a[b+1]=e,a[i>>2]=n)):g=411):g=0==(i&8192|0)?407:411;407==g?(q=a[q+2],i=h,a[i>>2]=q,0==(q|0)?a[b+1]=n:(q=q+4|0,a[b+1]=a[q>>2],a[q>>2]=h),a[a[d]+8>>2]=i):411==g&&(i=f+8|0,q=a[i>>2],0==(q|0)?(q=h,a[i>>2]=q,a[b+1]=n,i=q):(q=i=q+4|0,a[a[q>>2]>>2]=n,a[b+1]=a[q>>2],i=a[i>>2]=h),a[i>>2]=0);i=a[d];q=i+16|0;g=a[q>>2];-1<(g|0)?(a[q>>2]=g+1|0,d=a[d]):d=i;a[d+4>>2]=n;u=0>(j|0)?a[b+2]:h+ -j|0}return u}while(0);g=(w|0)>>2;f=a[g];0==(f|0)?f=0:(a[f+4>>2]=a[c+1],f=a[g]);s=a[d]+8|0;e=a[s>>2];(w|0)==(e|0)?(a[s>>2]=f|0,f=a[a[d]+8>>2],0!=(f|0)&&(a[f+4>>2]=a[c+1])):(s=w+4|0,a[a[s>>2]>>2]=f,f=e+4|0,(w|0)==(a[f>>2]|0)&&(a[f>>2]=a[s>>2]));f=a[d]+4|0;a[f>>2]=(w|0)==(a[f>>2]|0)?a[g]:0;d=a[d]+16|0;a[d>>2]=a[d>>2]-1|0;j=0>(j|0)?a[c+2]:w+ -j|0;d=a[q+4];if(0!=(d|0)&&0!=(i&2|0)){J[d](b,j,h)}if(0<=(a[n]|0)){return j}J[a[b+12>>2]](b,w,0,h);return j}function Cn(a,b,i){if(1>(i|0)){var i=m[b],g=0==i<<24>>24;a:do{if(g){var q=b,c=a}else{for(var d=b,f=a,n=i;;){var h=m[d+1|0],f=17109811*(((n&255)<<8)+f+(h&255))|0,d=d+(0!=h<<24>>24?2:1)|0,h=m[d];if(0==h<<24>>24){q=d;c=f;break a}else{n=h}}}}while(0);a=c+(q-b|0)|0;return 17109811*a|0}c=i-1|0;q=b+c|0;c=0<(c|0);a:do{if(c){f=b;for(h=a;;){if(h=17109811*(((m[f]&255)<<8)+(m[f+1|0]&255)+h)|0,f=f+2|0,f>>>0>=q>>>0){g=f;d=h;break a}}}else{g=b,d=a}}while(0);if(g>>>0>q>>>0){return a=d+i|0,17109811*a|0}a=17109811*(((m[g]&255)<<8)+d)|0;a=a+i|0;return 17109811*a|0}function Nc(b,r){var i,g,q,c,d,f=h;h+=4;var n;d=f>>2;if(0==(b|0)|0==(r|0)){return h=f,0}var z=Gb(40);c=z>>2;if(0==(z|0)){return h=f,0}a[c]=0;a[c+4]=0;a[c+1]=0;pk(z,b,0);q=(z+20|0)>>2;c=b+32|0;a[q]=0;a[q+1]=0;a[q+2]=0;a[q+3]=0;a[q+4]=0;q=a[c>>2];if(0==(q|0)){i=z,n=566}else{if(a[d]=0,q=J[q](z,1,f,b),0>(q|0)){var e=z;n=567}else{if(0<(q|0)){if(q=a[d],0!=(q|0)){if(0==(a[r+4>>2]&a[q>>2]|0)){e=z,n=567}else{var s=z;g=s>>2;var j=q}}else{if(n=b+28|0,0==(a[n>>2]|0)){e=z,n=567}else{G(z);n=J[a[n>>2]](0,0,40,b);i=n>>2;if(0==(n|0)){return h=f,0}a[i]=0;a[i+4]=0;a[i+1]=0;pk(n,b,0);a[i+5]=1;a[i+6]=0;a[i+8]=0;a[i+7]=0;i=n;n=566}}}else{i=z,n=566}}}566==n&&(z=J[a[i+12>>2]](i,0,28,b),a[d]=z,0==(z|0)?(e=i,n=567):(a[z>>2]=a[r+4>>2],a[a[d]+4>>2]=0,a[a[d]+8>>2]=0,a[a[d]+20>>2]=0,a[a[d]+16>>2]=0,a[a[d]+12>>2]=0,a[a[d]+24>>2]=0,s=i,g=s>>2,j=a[d]));if(567==n){return G(e),h=f,0}a[g+2]=j;a[g]=a[r>>2];a[g+4]=r;g=a[c>>2];if(0==(g|0)){return h=f,s}J[g](s,5,s,b);h=f;return s}function rc(b){var r,i;i=(b+8|0)>>2;r=a[i];0!=(a[r>>2]&4096|0)&&(Ag(b,0),r=a[i]);b=r>>2;r=(r+16|0)>>2;do{if(0>(a[r]|0)){var g=a[b];if(0!=(g&12|0)){a[r]=Fr(a[b+1])}else{if(0!=(g&112|0)){var g=a[b+2],q=0==(g|0);a:do{if(q){var c=0}else{for(var d=0,f=g;;){if(d=d+1|0,f=a[f>>2],0==(f|0)){c=d;break a}}}}while(0);a[r]=c}}}}while(0);return a[a[i]+16>>2]}function Fr(b){return 0==(b|0)?0:Fr(a[b+4>>2])+Fr(a[b>>2])+1|0}function GC(b,r,i){var g,q,c,d,f,n,z,e,s,j,m,u,w,A,B,C,P=h;h+=128;var T;C=P>>2;B=P+8>>2;A=(b+8|0)>>2;var gb=a[A];if(0==(a[gb>>2]&4096|0)){var $e=gb}else{Ag(b,0),$e=a[A]}var M=a[b+4>>2];w=M>>2;var X=a[w],O=a[w+1];u=(M+8|0)>>2;var y=a[u],Da=a[w+5];m=(b+20|0)>>2;a[m]&=-32769;var ia=a[$e+4>>2];if(0==(r|0)){if(0==(ia|0)){var D=0;h=P;return D}if(0==(i&448|0)){return D=0,h=P,D}if(0==(i&64|0)){var F=0==(i&256|0);a:do{if(F){var Tf=ia+4|0,sc=a[Tf>>2];if(0==(sc|0)){var E=ia}else{for(var G=ia,H=Tf,hc=sc;;){var ca=hc|0;a[H>>2]=a[ca>>2];a[ca>>2]=G;var I=hc+4|0,K=a[I>>2];if(0==(K|0)){E=hc;break a}else{G=hc,H=I,hc=K}}}}else{var zb=ia|0,ja=a[zb>>2];if(0==(ja|0)){E=ia}else{for(var aa=ia,da=zb,ea=ja;;){var xa=ea+4|0;a[da>>2]=a[xa>>2];a[xa>>2]=aa;var L=ea|0,N=a[L>>2];if(0==(N|0)){E=ea;break a}else{aa=ea,da=L,ea=N}}}}}while(0);a[a[A]+4>>2]=E;D=0>(y|0)?a[E+8>>2]:E+ -y|0;h=P;return D}var ha=M+16|0;if(0==(a[ha>>2]|0)){if(0>(a[u]|0)){T=599}else{var ga=$e}}else{T=599}if(599==T){for(var Zd=b+12|0,Rb=0>(y|0),Xe=-y|0,tb=ia;;){var ya=tb+4|0,Uf=a[ya>>2];if(0!=(Uf|0)){var wa=Uf|0;a[ya>>2]=a[wa>>2];a[wa>>2]=tb;tb=Uf}else{var Ab=a[tb>>2],Fa=a[ha>>2];if(0!=(Fa|0)){J[Fa](b,Rb?a[tb+8>>2]:tb+Xe|0,M)}if(0>(a[u]|0)){J[a[Zd>>2]](b,tb,0,M)}if(0==(Ab|0)){break}else{tb=Ab}}}ga=a[A]}a[ga+16>>2]=0;D=a[a[A]+4>>2]=0;h=P;return D}j=(b+16|0)>>2;var Ga=8==(a[a[j]+4>>2]|0);a:do{if(Ga){if(0==(i&4098|0)){T=637}else{for(var Bg=0>(O|0),ta=r+X|0,Ka=Bg?a[ta>>2]:ta,za=b,ma=0==(Da|0),pa=1>(O|0),wf=J[a[za>>2]](b,r,4);;){if(0==(wf|0)){T=637;break a}var Ha=wf+X|0,Ra=Bg?a[Ha>>2]:Ha;if(0!=((ma?pa?ka(Ka,Ra):Ve(Ka,Ra,O):J[Da](b,Ka,Ra,M))|0)){T=637;break a}if((wf|0)==(r|0)){break}wf=J[a[za>>2]](b,wf,8)}var W=a[a[A]+4>>2];a[C]=a[W+4>>2];a[C+1]=a[W>>2];var Q=W,La=P;T=779}}else{T=637}}while(0);a:do{if(637==T){if(0==(i&2565|0)){if(0!=(i&32|0)){var S=r,Ya=0>(y|0)?a[r+8>>2]:r+ -y|0,U=Ya+X|0,Za=0>(O|0)?a[U>>2]:U;if(0==(ia|0)){var V=P,ab=P,$a=S,jb=Ya;T=799}else{var Ca=Ya,Ia=S,eb=Za;T=656}}else{if(0==(ia|0)){ab=V=P,jb=r,T=799}else{if(((0>(y|0)?a[ia+8>>2]:ia+ -y|0)|0)==(r|0)){var ub=r,Sa=ia,Y=P,ua=P;T=736}else{var Oa=r+X|0;0>(O|0)?(Ca=r,eb=a[Oa>>2]):(Ca=r,eb=Oa);T=656}}}}else{if(0==(i&512|0)){var Wa=r+X|0,pb=0>(O|0)?a[Wa>>2]:Wa}else{pb=r}0==(ia|0)?(ab=V=P,jb=r,T=799):(Ca=r,eb=pb,T=656)}b:do{if(656==T){var ob=4==(a[a[j]+4>>2]|0);c:do{if(ob){var bb=a[a[A]+24>>2];if(0==(bb|0)){var qb=ia,R=P,kb=P}else{if(0==(i&516|0)){qb=ia,kb=R=P}else{for(var la=0>(y|0),vb=0>(O|0),xb=0==(Da|0),$=1>(O|0),nb=-y|0,rb=0,lb=ia;;){if((rb|0)>=(bb|0)){T=661;break}var Ta=(la?a[lb+8>>2]:lb+nb|0)+X|0,cb=vb?a[Ta>>2]:Ta,fb=xb?$?ka(eb,cb):Ve(eb,cb,O):J[Da](b,eb,cb,M);if(0==(fb|0)){T=673;break}a[(rb<<2>>2)+B]=fb;var Ua=a[(0>(fb|0)?lb+4|0:lb|0)>>2];if(0==(Ua|0)){D=0;T=825;break}else{rb=rb+1|0,lb=Ua}}if(673==T){return D=la?a[lb+8>>2]:lb+nb|0,h=P,D}if(661==T){if(0<(bb|0)){var sb=P;s=sb>>2;var Na=P;e=Na>>2;for(var Fb=ia,Db=0;;){if(0>(a[(Db<<2>>2)+B]|0)){var Ob=Fb+4|0,Eb=a[Ob>>2];if(0>(a[((Db|1)<<2>>2)+B]|0)){var fa=Eb|0;a[Ob>>2]=a[fa>>2];a[fa>>2]=Fb;a[e+1]=Eb;var Bb=Eb+4|0,Ja=Eb,Z=sb}else{a[s]=Eb,a[e+1]=Fb,Bb=Eb|0,Ja=Fb,Z=Eb}}else{var sa=Fb|0,xf=a[sa>>2];if(0<(a[((Db|1)<<2>>2)+B]|0)){var ra=xf+4|0;a[sa>>2]=a[ra>>2];a[ra>>2]=Fb;a[s]=xf;Bb=xf|0;Ja=Na;Z=xf}else{a[e+1]=xf,a[s]=Fb,Bb=xf+4|0,Ja=xf,Z=Fb}}var qa=a[Bb>>2],ba=Db+2|0;if((ba|0)<(bb|0)){sb=Z,s=sb>>2,Na=Ja,e=Na>>2,Fb=qa,Db=ba}else{qb=qa;R=Ja;kb=Z;break c}}}else{qb=ia,kb=R=P}}else{if(825==T){return h=P,D}}}}}else{qb=ia,kb=R=P}}while(0);var ic=0>(y|0),na=0>(O|0),oa=0!=(Da|0),Ba=1>(O|0),Ea=-y|0,Aa=qb,pc=R,Wc=kb;z=Wc>>2;c:for(;;){var Vb=Aa,Xd=pc;for(n=Xd>>2;;){var Cb=(ic?a[Vb+8>>2]:Vb+Ea|0)+X|0,Ma=na?a[Cb>>2]:Cb,wb=oa?J[Da](b,eb,Ma,M):Ba?ka(eb,Ma):Ve(eb,Ma,O);if(0==(wb|0)){var ub=Ca,va=Ia,Sa=Vb,Y=Xd,ua=Wc;T=736;break b}if(0<=(wb|0)){break}var Pa=Vb+4|0,lc=a[Pa>>2];f=lc>>2;if(0==(lc|0)){T=718;break c}var Gb=(ic?a[f+2]:lc+Ea|0)+X|0,Jd=na?a[Gb>>2]:Gb,Qa=oa?J[Da](b,eb,Jd,M):Ba?ka(eb,Jd):Ve(eb,Jd,O);if(0<=(Qa|0)){T=715;break}var Hc=lc|0;a[Pa>>2]=a[Hc>>2];a[Hc>>2]=Vb;a[n+1]=lc;var Va=a[f+1];if(0==(Va|0)){V=Wc;ab=lc;$a=Ia;jb=Ca;T=799;break b}else{Vb=Va,Xd=lc,n=Xd>>2}}if(715==T){T=0;if(0==(Qa|0)){T=716;break}a[z]=lc;a[n+1]=Vb;var oe=a[f];if(0==(oe|0)){V=lc;ab=Vb;$a=Ia;jb=Ca;T=799;break b}else{Aa=oe;pc=Vb;Wc=lc;z=Wc>>2;continue}}var hb=Vb|0,Qb=a[hb>>2];d=Qb>>2;if(0==(Qb|0)){T=735;break}var tc=(ic?a[d+2]:Qb+Ea|0)+X|0,Sc=na?a[tc>>2]:tc,ib=oa?J[Da](b,eb,Sc,M):Ba?ka(eb,Sc):Ve(eb,Sc,O);if(0<(ib|0)){var Ib=Qb+4|0;a[hb>>2]=a[Ib>>2];a[Ib>>2]=Vb;a[z]=Qb;var yb=a[d];if(0==(yb|0)){V=Qb;ab=Xd;$a=Ia;jb=Ca;T=799;break b}else{Aa=yb;pc=Xd;Wc=Qb;z=Wc>>2;continue}}if(0==(ib|0)){T=733;break}a[n+1]=Qb;a[z]=Vb;var rd=a[d+1];if(0==(rd|0)){V=Vb;ab=Qb;$a=Ia;jb=Ca;T=799;break b}else{Aa=rd,pc=Qb,Wc=Vb,z=Wc>>2}}733==T?(a[z]=Vb,ub=Ca,va=Ia,Sa=Qb,Y=Xd,ua=Vb,T=736):716==T?(a[n+1]=Vb,ub=Ca,va=Ia,Sa=lc,Y=Vb,ua=Wc,T=736):718==T?(a[n+1]=Vb,V=Wc,ab=Vb,$a=Ia,jb=Ca,T=799):735==T&&(V=a[z]=Vb,ab=Xd,$a=Ia,jb=Ca,T=799)}}while(0);do{if(736==T){if(0==(Sa|0)){V=ua,ab=Y,$a=va,jb=ub,T=799}else{if(a[m]|=32768,c=(Sa+4|0)>>2,a[ua>>2]=a[c],q=(Sa|0)>>2,a[Y+4>>2]=a[q],0!=(i&516|0)){var oc=Sa;g=oc>>2}else{if(0!=(i&8|0)){var Hb=P|0;a[c]=a[Hb>>2];a[q]=0;a[Hb>>2]=Sa;var Nb=Y,ve=ub;T=766}else{if(0!=(i&16|0)){var Rd=P+4|0;a[q]=a[Rd>>2];a[c]=0;a[Rd>>2]=Sa;var Bc=Y,Sd=ub;T=773}else{if(0!=(i&4098|0)){Q=Sa;La=Y;T=779;break a}if(0!=(i&2049|0)){if(0!=(a[a[j]+4>>2]&4|0)){oc=Sa,g=oc>>2}else{a[c]=0;var fd=P+4|0;a[q]=a[fd>>2];a[fd>>2]=Sa;var mb=Y,yc=Sa,db=ub;T=806}}else{if(0==(i&32|0)){return D=0,h=P,D}if(0==(a[a[j]+4>>2]&4|0)){a[va+4>>2]=0;var Lb=P+4|0;a[va>>2]=a[Lb>>2];a[Lb>>2]=va;var Tc=a[A]+16|0;a[Tc>>2]=a[Tc>>2]+1|0}else{var $b=a[w+4];if(0!=($b|0)){J[$b](b,ub,M)}if(0>(a[u]|0)){J[a[b+12>>2]](b,va,0,M)}}oc=Sa;g=oc>>2}}}}}}}while(0);do{if(799==T){if(a[ab+4>>2]=0,a[V>>2]=0,0!=(i&8|0)){Nb=ab,ve=jb,T=766}else{if(0!=(i&16|0)){Bc=ab,Sd=jb,T=773}else{if(0!=(i&516|0)){var Mc=jb,id=ab;break a}if(0!=(i&2049|0)){mb=ab,yc=0,db=jb,T=806}else{if(0==(i&32|0)){Mc=0;id=ab;break a}var Pb=a[A]+16|0;a[Pb>>2]=a[Pb>>2]+1|0;oc=$a;g=oc>>2}}}}}while(0);do{if(806==T){var Jb=M+12|0,Yb=a[Jb>>2],mf=0==(Yb|0)?db:0==(i&1|0)?db:J[Yb](b,db,M);if(0==(mf|0)){var nf=yc}else{if(-1<(y|0)){nf=mf+y|0}else{var Kb=J[a[b+12>>2]](b,0,12,M),af=Kb;if(0!=(Kb|0)){a[Kb+8>>2]=mf}else{if(0!=(a[Jb>>2]|0)){var yf=a[w+4];if(0!=(yf|0)&&0!=(i&1|0)){J[yf](b,mf,M)}}}nf=af}}if(0==(nf|0)){Mc=mf;id=mb;break a}var Td=a[A]+16|0,Fe=a[Td>>2];-1<(Fe|0)&&(a[Td>>2]=Fe+1|0);oc=nf;g=oc>>2}else{if(766==T){var gf=P+4|0,fe=a[gf>>2];if(0==(fe|0)){Mc=ve;id=Nb;break a}var fh=fe+4|0,df=a[fh>>2],jd=0==(df|0);b:do{if(jd){var md=fe,je=a[fe>>2]}else{for(var Qe=fe,Xf=fh,Uc=df;;){var bf=Uc|0;a[Xf>>2]=a[bf>>2];a[bf>>2]=Qe;var rk=Uc+4|0,Mb=a[rk>>2];if(0==(Mb|0)){md=Uc;je=Qe;break b}else{Qe=Uc,Xf=rk,Uc=Mb}}}}while(0);a[gf>>2]=je;oc=md;g=oc>>2}else{if(773==T){var Wb=P|0,ef=a[Wb>>2];if(0==(ef|0)){Mc=Sd;id=Bc;break a}var kd=ef|0,Tb=a[kd>>2],En=0==(Tb|0);b:do{if(En){var sk=ef,HC=a[ef+4>>2]}else{for(var Gr=ef,nd=kd,zd=Tb;;){var cf=zd+4|0;a[nd>>2]=a[cf>>2];a[cf>>2]=Gr;var uc=zd|0,ec=a[uc>>2];if(0==(ec|0)){sk=zd;HC=Gr;break b}else{Gr=zd,nd=uc,zd=ec}}}}while(0);a[Wb>>2]=HC;oc=sk;g=oc>>2}}}}while(0);a[g+1]=a[C];a[g]=a[C+1];var zi=0==(a[a[j]+4>>2]&8|0);b:do{if(zi){var we=oc}else{if(0==(i&516|0)){we=oc}else{for(var pe=0>(y|0),IC=0>(O|0),Kd=(pe?a[g+2]:oc+ -y|0)+X|0,Dd=IC?a[Kd>>2]:Kd,bc=0==(Da|0),rc=1>(O|0),Ye=-y|0,Ad=oc;;){var Ud=Ad+4|0,Vd=a[Ud>>2];if(0==(Vd|0)){we=Ad;break b}var jc=Vd|0,mc=a[jc>>2],gd=0==(mc|0);c:do{if(gd){var ud=Vd,Zb=jc}else{for(var qc=Vd,of=jc,Sb=mc;;){var kc=Sb+4|0;a[of>>2]=a[kc>>2];a[kc>>2]=qc;var Xb=Sb|0,Ac=a[Xb>>2];if(0==(Ac|0)){ud=Sb;Zb=Xb;break c}else{qc=Sb,of=Xb,Sb=Ac}}}}while(0);var ac=Ud|0;a[ac>>2]=ud;var dc=(pe?a[ud+8>>2]:ud+Ye|0)+X|0,fc=IC?a[dc>>2]:dc;if(0!=((bc?rc?ka(Dd,fc):Ve(Dd,fc,O):J[Da](b,Dd,fc,M))|0)){we=Ad;break b}a[ac>>2]=a[Zb>>2];a[Zb>>2]=Ad;Ad=ud}}}}while(0);a[a[A]+4>>2]=we;D=0>(y|0)?a[we+8>>2]:we+ -y|0;h=P;return D}}while(0);if(779==T){var nc=0>(y|0)?a[Q+8>>2]:Q+ -y|0,gc=a[w+4];if(0!=(gc|0)&&0!=(i&2|0)){J[gc](b,nc,M)}if(0>(a[u]|0)){J[a[b+12>>2]](b,Q,0,M)}var $c=a[A]+16|0,zc=a[$c>>2]-1|0;a[$c>>2]=zc;0>(zc|0)&&(a[a[A]+16>>2]=-1);Mc=nc;id=La}for(var Cc=id;;){var Ic=Cc+4|0,vc=a[Ic>>2];if(0==(vc|0)){break}else{Cc=vc}}a[Ic>>2]=a[C];a[a[A]+4>>2]=a[C+1];D=0!=(i&2|0)?Mc:0;h=P;return D}function Ag(b,r){var i,g=a[a[b+16>>2]>>2];i=(b+8|0)>>2;var q=a[i],c=q|0,d=a[c>>2],f=d&4096;if(0==(r|0)){if(0==(f|0)){var n;return-1}q=a[q+4>>2]}else{if(0==(a[q+16>>2]|0)){f=0,q=r}else{return-1}}a[c>>2]=d&-4097;d=a[i];c=a[d>>2];if(0==(c&3|0)){n=d+4|0;0==(c&12|0)?(a[n>>2]=0,a[a[i]+8>>2]=q|0):a[n>>2]=q;if(0!=(f|0)){return 0}a[a[i]+16>>2]=-1;return 0}a[d+4>>2]=0;i=a[i]>>2;if(0==(f|0)){a[i+4]=0;if(0==(q|0)){return 0}for(;;){if(i=a[q>>2],J[g](b,q,32),0==(i|0)){n=0;break}else{q=i}}return n}f=a[i+2];i=a[i+3];g=(i<<2)+f|0;if(0<(i|0)){i=f}else{return 0}for(;;){if(f=a[i>>2],0!=(f|0)&&(a[i>>2]=q,q=f|0,f=a[q>>2],a[q>>2]=0,q=f),i=i+4|0,i>>>0>=g>>>0){n=0;break}}return n}function yC(b,r){var i,g=b>>2;0!=(a[a[g+2]>>2]&4096|0)&&Ag(b,0);var q=0!=(r|0);if(q){if(0!=(a[a[r+8>>2]>>2]&4096|0)&&Ag(r,0),(a[r+16>>2]|0)==(a[g+4]|0)){var c=r}else{var d;return 0}}else{c=0}for(;0!=(c|0);){if((c|0)==(b|0)){d=0;i=896;break}c=a[c+28>>2]}if(896==i){return d}i=(b+28|0)>>2;c=a[i];0!=(c|0)&&(d=c+24|0,a[d>>2]=a[d>>2]-1|0);a[g+8]=0;a[i]=0;q?(a[i]=r,a[g]=372,g=r+24|0,a[g>>2]=a[g>>2]+1|0,d=r):(a[g]=a[a[g+4]>>2],d=c);return d}function JC(b,r,i){var g,q,c;if(0!=(i&99|0)){var d=J[a[a[b+16>>2]>>2]](b,r,i);return d}q=0==(i&516|0);a:do{if(q){var f=a[b+16>>2],n=0==(a[f+4>>2]&12|0);do{if(0==(i&384|0)){if(n){if(0==(i&24|0)){return d=0}q=(b+32|0)>>2;var h=a[q];if(0==(h|0)){var e=b;c=931}else{var s=a[a[h+4>>2]+8>>2];g=a[a[h+8>>2]+4>>2];if(((0>(s|0)?a[g+8>>2]:g+ -s|0)|0)==(r|0)){var j=r,m=h}else{e=b,c=931}}do{if(931==c){for(;;){c=0;if(0==(e|0)){break}var u=J[a[a[e+16>>2]>>2]](e,r,4);if(0!=(u|0)){c=933;break}e=a[e+28>>2]}if(933==c){a[q]=e,j=u,m=e}else{return d=a[q]=0}}}while(0);var h=0==(i&8|0),w=J[a[a[m+16>>2]>>2]](m,j,i),s=m;b:for(;;){for(g=s+16|0;0!=(w|0);){var A=b;for(;;){if((A|0)==(s|0)){d=w;c=949;break b}if(0!=(J[a[a[A+16>>2]>>2]](A,w,4)|0)){break}A=a[A+28>>2]}w=J[a[a[g>>2]>>2]](s,w,i)}s=a[s+28>>2];a[q]=s;if(0==(s|0)){d=0;c=955;break}g=a[a[s+16>>2]>>2];w=h?J[g](s,0,256):J[g](s,0,128)}if(955==c||949==c){return d}}}else{if(n){f=b;break a}}}while(0);if(0==(i&408|0)){return d=0}var B=0==(b|0);b:do{if(B){var C=0,P=0}else{c=0!=(i&136|0);d=0!=(i&272|0);e=0;j=b;u=m=0;for(q=f;;){q=J[a[q>>2]](j,r,i);do{if(0==(q|0)){n=u,h=m,s=e}else{n=a[j+4>>2];g=n>>2;h=a[g+1];s=a[g+5];g=q+a[g]|0;g=0>(h|0)?a[g>>2]:g;if(0!=(m|0)&&(n=0==(s|0)?1>(h|0)?ka(g,u):Ve(g,u,h):J[s](j,g,u,n),!(c&0>(n|0)|d&0<(n|0)))){n=u;h=m;s=e;break}n=g;h=q;s=j}}while(0);q=a[j+28>>2];if(0==(q|0)){C=s;P=h;break b}e=s;j=q;m=h;u=n;q=a[q+16>>2]}}}while(0);a[b+32>>2]=C;return d=P}f=b}while(0);for(;;){if(0==(f|0)){B=0;break}C=J[a[a[f+16>>2]>>2]](f,r,i);if(0!=(C|0)){B=C;break}f=a[f+28>>2]}a[b+32>>2]=f;return B}function Gn(b,r){for(var i=b|0,g=b+32|0,q=J[a[i>>2]](b,0,128);0!=(q|0);){var c=a[g>>2],d=J[a[i>>2]](b,q,8);if(0>(J[r](0==(c|0)?b:c,q,0)|0)){break}else{q=d}}}function tk(b,r,i){var g,q=r>>2,c=h;h+=8;var d=c+4;a[q]=0;var f=b+16|0,n=a[a[a[f>>2]+20>>2]>>2]>>>4&1;a[i>>2]=n;var e=a[Hr>>2],p=0==(e|0);a:do{if(p){g=n}else{var s=mb(b|0,a[e+8>>2]),j=m[s];if(0==j<<24>>24){g=n}else{var t=Ai|0;for(g=t>>2;;){var u=a[g];if(0==(u|0)){g=n;break a}if(j<<24>>24==m[u]<<24>>24&&0==(ka(s,u)|0)){break}t=t+12|0;g=t>>2}a[q]=a[g+1];g=a[g+2];a[i>>2]=g}}}while(0);n=a[Ir>>2];0!=(n|0)&1==(g|0)&&(n=mb(b|0,a[n+8>>2]),0!=m[n]<<24>>24&&KC(n,i));n=a[Jr>>2];0!=(n|0)&&1==(a[q]|0)&&(n=mb(b|0,a[n+8>>2]),0!=m[n]<<24>>24&&KC(n,r));0!=m[b+161|0]<<24>>24&&(b=a[b+12>>2],tk(Kr(a[b+20>>2],b,a[f>>2]),c,d),a[i>>2]|=a[c>>2],a[q]|=a[d>>2]);h=c}function KC(b,r){var i=h;h+=4;a[r>>2]=0;if(0!=m[b]<<24>>24){for(var g=b,q=0;;){a[i>>2]=0;var c=g,g=i,d=cc,f=h;h+=4;d=f>>2;a[d]=0;var n=Lr(c,Mr|0,f);if((n|0)==(c|0)){for(;!(n=Lr(c,gh|0,f),(c|0)==(n|0));){c=n}c=Lr(c,xe|0,f)}else{c=n}n=a[d];0!=(n|0)&0==(n&7|0)&&(n|=1,a[d]=n);d=n;n=a[g>>2];d|=n;a[g>>2]=d;h=f;g=c;a[r>>2]|=a[i>>2]<<(q<<3);q=q+1|0;if(!(0!=m[g]<<24>>24&4>(q|0))){break}}}h=i}function Cg(x,r){for(var i,g=r&7,q=Bi|0;;){if(0==(a[q+12>>2]|0)){var c=0;break}if((g|0)==(a[q>>2]|0)){i=989;break}else{q=q+16|0}}989==i&&(c=q+4|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]));g=r>>>8&7;for(q=Bi|0;;){if(0==(a[q+12>>2]|0)){var d=c;break}if((g|0)==(a[q>>2]|0)){i=993;break}else{q=q+16|0}}993==i&&(d=q+4|0,d=c+(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]));c=r>>>16&7;for(g=Bi|0;;){if(0==(a[g+12>>2]|0)){var k=d;break}if((c|0)==(a[g>>2]|0)){i=997;break}else{g=g+16|0}}997==i&&(k=g+4|0,k=d+(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]));d=r>>>24&7;for(c=Bi|0;;){if(0==(a[c+12>>2]|0)){var n=k;i=1003;break}if((d|0)==(a[c>>2]|0)){break}else{c=c+16|0}}if(1003==i){return i=10*n,k=a[uk>>2],k=Xb(x|0,k,1,0),i*k}i=c+4|0;n=k+(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);i=10*n;k=a[uk>>2];k=Xb(x|0,k,1,0);return i*k}function Hn(x,r,i,g,q,c){var d,k,n,e,p=h;h+=80;d=p+8;var s=p+72,x=Cg(x,c),x=x*x;f[0]=x;a[s>>2]=b[0];a[s+4>>2]=b[1];a[q+12>>2]=c;c=g+3|0;k=(c<<4)+r|0;q=(q+32|0)>>2;n=k>>2;a[q]=a[n];a[q+1]=a[n+1];a[q+2]=a[n+2];a[q+3]=a[n+3];(g|0)>(i|0)&&(i=(g<<4)+r|0,k|=0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),k=(g<<4)+r+8|0,c=(c<<4)+r+8|0,c=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])-(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),g=i*i+c*c<x?g-3|0:g);e=(d+48|0)>>2;n=((g<<4)+r|0)>>2;a[e]=a[n];a[e+1]=a[n+1];a[e+2]=a[n+2];a[e+3]=a[n+3];k=(d+32|0)>>2;i=((g+1<<4)+r|0)>>2;a[k]=a[i];a[k+1]=a[i+1];a[k+2]=a[i+2];a[k+3]=a[i+3];c=(d+16|0)>>2;x=((g+2<<4)+r|0)>>2;a[c]=a[x];a[c+1]=a[x+1];a[c+2]=a[x+2];a[c+3]=a[x+3];var j=d|0;d>>=2;a[d]=a[q];a[d+1]=a[q+1];a[d+2]=a[q+2];a[d+3]=a[q+3];a[p>>2]=j;a[p+4>>2]=s;vk(p,338,j,1);a[n]=a[e];a[n+1]=a[e+1];a[n+2]=a[e+2];a[n+3]=a[e+3];a[i]=a[k];a[i+1]=a[k+1];a[i+2]=a[k+2];a[i+3]=a[k+3];a[x]=a[c];a[x+1]=a[c+1];a[x+2]=a[c+2];a[x+3]=a[c+3];r=((g+3<<4)+r|0)>>2;a[r]=a[d];a[r+1]=a[d+1];a[r+2]=a[d+2];a[r+3]=a[d+3];h=p;return g}function In(x,r,i,g,q,c){var d,k,n,e=h;h+=80;var p=e+8,s=e+72,x=Cg(x,c),x=x*x;f[0]=x;a[s>>2]=b[0];a[s+4>>2]=b[1];a[q+8>>2]=c;c=(i<<4)+r|0;q=(q+16|0)>>2;d=c>>2;a[q]=a[d];a[q+1]=a[d+1];a[q+2]=a[d+2];a[q+3]=a[d+3];if((g|0)>(i|0)){c|=0;g=i+3|0;d=(g<<4)+r|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])-(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);d=(i<<4)+r+8|0;k=(g<<4)+r+8|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);var j=c*c+d*d<x?g:i}else{j=i}n=p>>2;k=((j+3<<4)+r|0)>>2;a[n]=a[k];a[n+1]=a[k+1];a[n+2]=a[k+2];a[n+3]=a[k+3];d=(p+16|0)>>2;c=((j+2<<4)+r|0)>>2;a[d]=a[c];a[d+1]=a[c+1];a[d+2]=a[c+2];a[d+3]=a[c+3];g=(p+32|0)>>2;x=((j+1<<4)+r|0)>>2;a[g]=a[x];a[g+1]=a[x+1];a[g+2]=a[x+2];a[g+3]=a[x+3];var m=p+48|0,i=m>>2;a[i]=a[q];a[i+1]=a[q+1];a[i+2]=a[q+2];a[i+3]=a[q+3];a[e>>2]=m;a[e+4>>2]=s;vk(e,338,p|0,0);r=((j<<4)+r|0)>>2;a[r]=a[i];a[r+1]=a[i+1];a[r+2]=a[i+2];a[r+3]=a[i+3];a[x]=a[g];a[x+1]=a[g+1];a[x+2]=a[g+2];a[x+3]=a[g+3];a[c]=a[d];a[c+1]=a[d+1];a[c+2]=a[d+2];a[c+3]=a[d+3];a[k]=a[n];a[k+1]=a[n+1];a[k+2]=a[n+2];a[k+3]=a[n+3];h=e;return j}function LC(x,r,i,g,q,c,d){var k,n,h,e,s,j,m;n=0!=(c|0);m=0==(d|0);if(n&(m^1)&(g|0)==(i|0)){h=(g<<4)+r|0;var i=h|0,u=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),i=(g<<4)+r+8|0;j=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);n=g+3|0;k=(n<<4)+r|0;m=(k|0)>>2;i=(b[0]=a[m],b[1]=a[m+1],f[0]);s=((n<<4)+r+8|0)>>2;n=(b[0]=a[s],b[1]=a[s+1],f[0]);e=Cg(x,c);var x=Cg(x,d),w=u-i,A=j-n,w=$c(w*w+A*A);x+e<w?(A=x,x=e):A=x=w/3;j==n?(u<i?(e=u+x,w=j,x=i-A):(e=u-x,w=j,x=i+A),u=j):j<n?(e=u,w=j+x,x=u,u=n-A):(e=u,w=j-x,x=u,u=n+A);A=g+1|0;j=(A<<4)+r|0;var B=j|0;f[0]=e;a[B>>2]=b[0];a[B+4>>2]=b[1];e=(A<<4)+r+8|0;f[0]=w;a[e>>2]=b[0];a[e+4>>2]=b[1];h>>=2;j>>=2;a[h]=a[j];a[h+1]=a[j+1];a[h+2]=a[j+2];a[h+3]=a[j+3];f[0]=x;a[m]=b[0];a[m+1]=b[1];f[0]=u;a[s]=b[0];a[s+1]=b[1];r=((g+2<<4)+r|0)>>2;g=k>>2;a[r]=a[g];a[r+1]=a[g+1];a[r+2]=a[g+2];a[r+3]=a[g+3];a[q+12>>2]=d;r=q+32|0;d=q+40|0;a[q+8>>2]=c;f[0]=i;a[r>>2]=b[0];a[r+4>>2]=b[1];f[0]=n;a[d>>2]=b[0];a[d+4>>2]=b[1]}else{if(!m){w=Cg(x,d);k=(g<<4)+r|0;u=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);k=(g<<4)+r+8|0;j=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);m=g+3|0;h=(m<<4)+r|0;s=(h|0)>>2;k=(b[0]=a[s],b[1]=a[s+1],f[0]);e=((m<<4)+r+8|0)>>2;m=(b[0]=a[e],b[1]=a[e+1],f[0]);A=u-k;B=j-m;A=.9*$c(A*A+B*B);w=w<A?w:A;j==m?(A=u<k?k-w:k+w,B=j):j<m?(A=u,B=m-w):(A=u,B=m+w);var C=g+1|0,P=(C<<4)+r|0;f[0]=u;a[P>>2]=b[0];a[P+4>>2]=b[1];u=(C<<4)+r+8|0;f[0]=j;a[u>>2]=b[0];a[u+4>>2]=b[1];f[0]=A;a[s]=b[0];a[s+1]=b[1];f[0]=B;a[e]=b[0];a[e+1]=b[1];g=((g+2<<4)+r|0)>>2;h>>=2;a[g]=a[h];a[g+1]=a[h+1];a[g+2]=a[h+2];a[g+3]=a[h+3];a[q+12>>2]=d;d=q+32|0;f[0]=k;a[d>>2]=b[0];a[d+4>>2]=b[1];d=q+40|0;f[0]=m;a[d>>2]=b[0];a[d+4>>2]=b[1];k=w}n&&(h=Cg(x,c),n=(i<<4)+r|0,d=n|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),g=(i<<4)+r+8|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),m=i+3|0,x=(m<<4)+r|0,x=(b[0]=a[x>>2],b[1]=a[x+4>>2],f[0]),m=(m<<4)+r+8|0,m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]),s=d-x,u=g-m,s=.9*$c(s*s+u*u),g==m?(h=d<x?d+(h<s?h:s):d-k,s=g):g<m?(h=d,s=g+k):(h=d,s=g-k),u=i+1|0,k=(u<<4)+r|0,j=k|0,f[0]=h,a[j>>2]=b[0],a[j+4>>2]=b[1],h=(u<<4)+r+8|0,f[0]=s,a[h>>2]=b[0],a[h+4>>2]=b[1],n>>=2,k>>=2,a[n]=a[k],a[n+1]=a[k+1],a[n+2]=a[k+2],a[n+3]=a[k+3],i=i+2|0,n=(i<<4)+r|0,f[0]=x,a[n>>2]=b[0],a[n+4>>2]=b[1],r=(i<<4)+r+8|0,f[0]=m,a[r>>2]=b[0],a[r+4>>2]=b[1],a[q+8>>2]=c,c=q+16|0,f[0]=d,a[c>>2]=b[0],a[c+4>>2]=b[1],q=q+24|0,f[0]=g,a[q>>2]=b[0],a[q+4>>2]=b[1])}}function hh(x,r,i,g,q,c){var g=g-r,q=q-i,c=10*c/($c(g*g+q*q)+1e-4),d=(g+(0<=g?1e-4:-1e-4))*c,k=(q+(0<=q?1e-4:-1e-4))*c,n=.5*d,q=.5*k,g=r-q,c=i-n,q=q+r,n=n+i,h=g+d,e=c+k,s=q+d,d=n+k,i=h>s?h:s,i=q>i?q:i,r=e>d?e:d,r=n>r?n:r,h=h<s?h:s,q=q<h?q:h,e=e<d?e:d,n=n<e?n:e,e=x|0;f[0]=g<q?g:q;a[e>>2]=b[0];a[e+4>>2]=b[1];q=x+8|0;f[0]=c<n?c:n;a[q>>2]=b[0];a[q+4>>2]=b[1];q=x+16|0;f[0]=g>i?g:i;a[q>>2]=b[0];a[q+4>>2]=b[1];x=x+24|0;f[0]=c>r?c:r;a[x>>2]=b[0];a[x+4>>2]=b[1]}function Ci(x,r,i,g,q,c,d,k,n){var e,p=h;h+=16;var s;e=(a[x+16>>2]+12|0)>>2;var j=a[e];a[e]=r;Ke(x,a[a[x>>2]+296>>2]);for(var r=q-i,q=c-g,m=10/($c(r*r+q*q)+1e-4),c=(r+(0<=r?1e-4:-1e-4))*m,r=(q+(0<=q?1e-4:-1e-4))*m,q=p|0,m=p+8|0,u=0,w=i,A=g;;){if(4<=(u|0)){s=1054;break}var B=n>>(u<<3)&255;if(0==(B|0)){s=1053;break}for(var g=p,i=x,C=c,P=r,T=d,gb=k,$e=cc,M=B&7,y=Bi|0;;){var O=a[y>>2];if(0==(O|0)){var D=w,Da=A;break}if((M|0)==(O|0)){$e=1058;break}else{y=y+16|0}}1058==$e&&(D=y+4|0,D=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0])*T,Da=D*C,P*=D,J[a[y+12>>2]](i,w,A,Da,P,T,gb,B),D=Da+w,Da=P+A);i=g|0;f[0]=D;a[i>>2]=b[0];a[i+4>>2]=b[1];g=g+8|0;f[0]=Da;a[g>>2]=b[0];a[g+4>>2]=b[1];u=u+1|0;w=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);A=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0])}1053==s?(a[e]=j,h=p):1054==s&&(a[e]=j,h=p)}function MC(x,r,i,g,q,c,d,k){var n,e,c=h;h+=80;var d=4<d?.0875*d:.35,p=d*-q,d=d*g,g=r+g,q=i+q;n=c+64|0;e=(n|0)>>2;0==(k&16|0)?(f[0]=g,a[e]=b[0],a[e+1]=b[1],e=c+72|0,f[0]=q,a[e>>2]=b[0],a[e+4>>2]=b[1],e=c>>2,n>>=2,a[e]=a[n],a[e+1]=a[n+1],a[e+2]=a[n+2],a[e+3]=a[n+3],n=c+16|0,f[0]=g-p,a[n>>2]=b[0],a[n+4>>2]=b[1],n=c+24|0,f[0]=q-d,a[n>>2]=b[0],a[n+4>>2]=b[1],n=c+32|0,f[0]=r,a[n>>2]=b[0],a[n+4>>2]=b[1],r=c+40|0,f[0]=i,a[r>>2]=b[0],a[r+4>>2]=b[1],i=c+48|0,f[0]=g+p,a[i>>2]=b[0],a[i+4>>2]=b[1],i=c+56|0,f[0]=q+d,a[i>>2]=b[0],a[i+4>>2]=b[1]):(f[0]=r,a[e]=b[0],a[e+1]=b[1],e=c+72|0,f[0]=i,a[e>>2]=b[0],a[e+4>>2]=b[1],e=c>>2,n>>=2,a[e]=a[n],a[e+1]=a[n+1],a[e+2]=a[n+2],a[e+3]=a[n+3],n=c+16|0,f[0]=r-p,a[n>>2]=b[0],a[n+4>>2]=b[1],n=c+24|0,f[0]=i-d,a[n>>2]=b[0],a[n+4>>2]=b[1],n=c+32|0,f[0]=g,a[n>>2]=b[0],a[n+4>>2]=b[1],g=c+40|0,f[0]=q,a[g>>2]=b[0],a[g+4>>2]=b[1],q=c+48|0,f[0]=p+r,a[q>>2]=b[0],a[q+4>>2]=b[1],r=c+56|0,f[0]=d+i,a[r>>2]=b[0],a[r+4>>2]=b[1]);0!=(k&32|0)?zc(x,c|0,3,(k>>>3&1^1)&255):0==(k&64|0)?zc(x,c+16|0,3,(k>>>3&1^1)&255):zc(x,c+32|0,3,(k>>>3&1^1)&255);h=c}function NC(x,r,i,g,q,c,d,k){var n,e,p,s=h;h+=144;var j=4*c,m=k&16,j=j>=d|0==(m|0)?.45:.45*(d/j);if(1<d){if(0==(m|0)){var u=c=0}else{c=.05*(d-1)/c,u=m}}else{c=0,u=m}d=-q;m=j*d;j*=g;d*=c;c*=g;n=r+g;e=i+q;var w=.5*g+r,g=.5*q+i,q=s|0,A=s+128|0;p=(A|0)>>2;0==(u|0)?(f[0]=n,a[p]=b[0],a[p+1]=b[1],n=s+136|0,f[0]=e,a[n>>2]=b[0],a[n+4>>2]=b[1],e=s>>2,n=A>>2,a[e]=a[n],a[e+1]=a[n+1],a[e+2]=a[n+2],a[e+3]=a[n+3],e=s+16|0,f[0]=r-m,a[e>>2]=b[0],a[e+4>>2]=b[1],e=s+24|0,f[0]=i-j,a[e>>2]=b[0],a[e+4>>2]=b[1],e=s+32|0,f[0]=w-d,a[e>>2]=b[0],a[e+4>>2]=b[1],e=s+40|0,f[0]=g-c,a[e>>2]=b[0],a[e+4>>2]=b[1],e=s+48|0,f[0]=r,a[e>>2]=b[0],a[e+4>>2]=b[1],e=s+56|0,f[0]=i,a[e>>2]=b[0],a[e+4>>2]=b[1],e=s+64|0,f[0]=r,a[e>>2]=b[0],a[e+4>>2]=b[1],e=s+72|0,f[0]=i,a[e>>2]=b[0],a[e+4>>2]=b[1],e=s+80|0,f[0]=r,a[e>>2]=b[0],a[e+4>>2]=b[1],e=s+88|0,f[0]=i,a[e>>2]=b[0],a[e+4>>2]=b[1],e=s+96|0,f[0]=w+d,a[e>>2]=b[0],a[e+4>>2]=b[1],d=s+104|0,f[0]=g+c,a[d>>2]=b[0],a[d+4>>2]=b[1],c=s+112|0,f[0]=m+r,a[c>>2]=b[0],a[c+4>>2]=b[1],m=s+120|0,f[0]=j+i):(f[0]=r,a[p]=b[0],a[p+1]=b[1],r=s+136|0,f[0]=i,a[r>>2]=b[0],a[r+4>>2]=b[1],i=s>>2,r=A>>2,a[i]=a[r],a[i+1]=a[r+1],a[i+2]=a[r+2],a[i+3]=a[r+3],i=s+16|0,f[0]=n-m,a[i>>2]=b[0],a[i+4>>2]=b[1],i=s+24|0,f[0]=e-j,a[i>>2]=b[0],a[i+4>>2]=b[1],i=s+32|0,f[0]=w-d,a[i>>2]=b[0],a[i+4>>2]=b[1],i=s+40|0,f[0]=g-c,a[i>>2]=b[0],a[i+4>>2]=b[1],i=s+48|0,f[0]=n-d,a[i>>2]=b[0],a[i+4>>2]=b[1],i=s+56|0,f[0]=e-c,a[i>>2]=b[0],a[i+4>>2]=b[1],i=s+64|0,f[0]=n,a[i>>2]=b[0],a[i+4>>2]=b[1],i=s+72|0,f[0]=e,a[i>>2]=b[0],a[i+4>>2]=b[1],i=s+80|0,f[0]=n+d,a[i>>2]=b[0],a[i+4>>2]=b[1],i=s+88|0,f[0]=e+c,a[i>>2]=b[0],a[i+4>>2]=b[1],i=s+96|0,f[0]=w+d,a[i>>2]=b[0],a[i+4>>2]=b[1],d=s+104|0,f[0]=g+c,a[d>>2]=b[0],a[d+4>>2]=b[1],c=s+112|0,f[0]=n+m,a[c>>2]=b[0],a[c+4>>2]=b[1],m=s+120|0,f[0]=e+j);a[m>>2]=b[0];a[m+4>>2]=b[1];0!=(k&32|0)?zc(x,q,6,1):0==(k&64|0)?zc(x,q,9,1):zc(x,s+48|0,6,1);h=s}function OC(x,r,i,g,q,c,d,k){var n,e,p,s,j,m=h;h+=64;var u=r+g,w=i+q,A=.2*g+r,B=.2*q+i,C=.6*g+r,P=.6*q+i,T=m|0;j=(m|0)>>2;f[0]=A-q;a[j]=b[0];a[j+1]=b[1];s=(m+8|0)>>2;f[0]=B+g;a[s]=b[0];a[s+1]=b[1];p=(m+16|0)>>2;f[0]=A+q;a[p]=b[0];a[p+1]=b[1];e=(m+24|0)>>2;f[0]=B-g;a[e]=b[0];a[e+1]=b[1];n=(m+32|0)>>2;f[0]=C+q;a[n]=b[0];a[n+1]=b[1];d=(m+40|0)>>2;f[0]=P-g;a[d]=b[0];a[d+1]=b[1];c=(m+48|0)>>2;f[0]=C-q;a[c]=b[0];a[c+1]=b[1];q=(m+56|0)>>2;f[0]=P+g;a[q]=b[0];a[q+1]=b[1];0==(k&32|0)?0!=(k&64|0)&&(f[0]=A,a[p]=b[0],a[p+1]=b[1],f[0]=B,a[e]=b[0],a[e+1]=b[1],f[0]=C,a[n]=b[0],a[n+1]=b[1],f[0]=P,a[d]=b[0],a[d+1]=b[1]):(f[0]=A,a[j]=b[0],a[j+1]=b[1],f[0]=B,a[s]=b[0],a[s+1]=b[1],f[0]=C,a[c]=b[0],a[c+1]=b[1],f[0]=P,a[q]=b[0],a[q+1]=b[1]);zc(x,T,4,1);f[0]=r;a[j]=b[0];a[j+1]=b[1];f[0]=i;a[s]=b[0];a[s+1]=b[1];f[0]=u;a[p]=b[0];a[p+1]=b[1];f[0]=w;a[e]=b[0];a[e+1]=b[1];Gd(x,T,2);h=m}function PC(x,r,i,g,q,c,d,k){var n,e,p,s,j,m,u,c=h;h+=64;n=-.4*q;var d=.4*g,w=.8*g+r,A=.8*q+i,g=r+g,B=i+q,C=c|0;u=(c|0)>>2;f[0]=n+r;a[u]=b[0];a[u+1]=b[1];m=(c+8|0)>>2;f[0]=d+i;a[m]=b[0];a[m+1]=b[1];j=(c+16|0)>>2;f[0]=r-n;a[j]=b[0];a[j+1]=b[1];s=(c+24|0)>>2;f[0]=i-d;a[s]=b[0];a[s+1]=b[1];p=(c+32|0)>>2;f[0]=w-n;a[p]=b[0];a[p+1]=b[1];e=(c+40|0)>>2;f[0]=A-d;a[e]=b[0];a[e+1]=b[1];q=(c+48|0)>>2;f[0]=w+n;a[q]=b[0];a[q+1]=b[1];n=(c+56|0)>>2;f[0]=A+d;a[n]=b[0];a[n+1]=b[1];0==(k&32|0)?0!=(k&64|0)&&(f[0]=r,a[j]=b[0],a[j+1]=b[1],f[0]=i,a[s]=b[0],a[s+1]=b[1],f[0]=w,a[p]=b[0],a[p+1]=b[1],f[0]=A,a[e]=b[0],a[e+1]=b[1]):(f[0]=r,a[u]=b[0],a[u+1]=b[1],f[0]=i,a[m]=b[0],a[m+1]=b[1],f[0]=w,a[q]=b[0],a[q+1]=b[1],f[0]=A,a[n]=b[0],a[n+1]=b[1]);zc(x,C,4,(k>>>3&1^1)&255);f[0]=w;a[u]=b[0];a[u+1]=b[1];f[0]=A;a[m]=b[0];a[m+1]=b[1];f[0]=g;a[j]=b[0];a[j+1]=b[1];f[0]=B;a[s]=b[0];a[s+1]=b[1];Gd(x,C,2);h=c}function QC(x,r,i,g,q,c,d,k){c=h;h+=80;var n=-q/3,e=g/3,p=.5*g+r,s=.5*q+i,d=c|0,j=c+64|0,m=j|0;f[0]=r+g;a[m>>2]=b[0];a[m+4>>2]=b[1];g=c+72|0;f[0]=i+q;a[g>>2]=b[0];a[g+4>>2]=b[1];q=c>>2;g=j>>2;a[q]=a[g];a[q+1]=a[g+1];a[q+2]=a[g+2];a[q+3]=a[g+3];q=c+16|0;f[0]=p+n;a[q>>2]=b[0];a[q+4>>2]=b[1];q=c+24|0;f[0]=s+e;a[q>>2]=b[0];a[q+4>>2]=b[1];q=c+32|0;g=q|0;f[0]=r;a[g>>2]=b[0];a[g+4>>2]=b[1];r=c+40|0;f[0]=i;a[r>>2]=b[0];a[r+4>>2]=b[1];i=c+48|0;f[0]=p-n;a[i>>2]=b[0];a[i+4>>2]=b[1];i=c+56|0;f[0]=s-e;a[i>>2]=b[0];a[i+4>>2]=b[1];0!=(k&32|0)?zc(x,q,3,(k>>>3&1^1)&255):(i=(k>>>3&1^1)&255,0==(k&64|0)?zc(x,d,4,i):zc(x,d,3,i));h=c}function Lr(b,r,i){for(var g;;){var q=a[r>>2];if(0==(q|0)){var c=b;g=1124;break}var d=Ba(q);if(0==(td(b,q,d)|0)){break}else{r=r+8|0}}if(1124==g){return c}a[i>>2]|=a[r+4>>2];return b+d|0}function RC(x){var r,i=h;h+=52;r=i>>2;var g=V(x|0,Di|0);if(0==(g|0)||0==m[g]<<24>>24){return h=i,0}0!=m[ld]<<24>>24&&mk(ih);var q=DQa(g,0,80);0==(q|0)&&(la(0,SC|0,(j=h,h+=4,a[j>>2]=a[x+12>>2],j)),la(3,TC|0,(j=h,h+=4,a[j>>2]=g,j)));if(0==m[ld]<<24>>24){return r=q,h=i,r}x=Jn();EQa(q,i);Va(a[oa>>2],UC|0,(j=h,h+=12,a[j>>2]=a[r],f[0]=x,a[j+4>>2]=b[0],a[j+8>>2]=b[1],j));x=a[r+3];Va(a[oa>>2],VC|0,(j=h,h+=8,a[j>>2]=a[r+2],a[j+4>>2]=x,j));x=a[r+5];Va(a[oa>>2],WC|0,(j=h,h+=8,a[j>>2]=a[r+4],a[j+4>>2]=x,j));x=a[r+7];Va(a[oa>>2],XC|0,(j=h,h+=8,a[j>>2]=a[r+6],a[j+4>>2]=x,j));Va(a[oa>>2],YC|0,(j=h,h+=4,a[j>>2]=a[r+1],j));Va(a[oa>>2],ZC|0,(j=h,h+=4,a[j>>2]=a[r+8],j));r=q;h=i;return r}function wk(x){var r,i=h,g=fa(244);r=g>>2;0==(g|0)&&la(1,$C|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));var q=x+16|0,x=a[q>>2];a[r]=x;a[q>>2]=g;if(0==(x|0)){a[r+22]=3,a[r+23]=0,r=g+96|0,f[0]=1,a[r>>2]=b[0],a[r+4>>2]=b[1]}else{for(var q=(x+16|0)>>2,c=(g+16|0)>>2,d=q+9;q<d;q++,c++){a[c]=a[q]}q=(x+52|0)>>2;c=(g+52|0)>>2;for(d=q+9;q<d;q++,c++){a[c]=a[q]}a[r+22]=a[x+88>>2];a[r+23]=a[x+92>>2];r=x+96|0;r=(b[0]=a[r>>2],b[1]=a[r+4>>2],f[0]);x=g+96|0;f[0]=r;a[x>>2]=b[0];a[x+4>>2]=b[1]}h=i;return g}function Ei(b){var r=b+16|0,i=a[r>>2],b=i>>2;0==(i|0)&&sa(Fi|0,110,aD|0,Nr|0);G(a[b+38]);G(a[b+37]);G(a[b+39]);G(a[b+40]);G(a[b+41]);G(a[b+42]);G(a[b+43]);G(a[b+44]);G(a[b+45]);G(a[b+46]);G(a[b+47]);G(a[b+48]);G(a[b+49]);G(a[b+53]);G(a[b+56]);G(a[b+55]);a[r>>2]=a[b];G(i)}function Or(b,r,i,g,q,c,d){var f,n=a[b+16>>2];f=n>>2;b=a[b+148>>2];0==(b&32768|0)|0==(r|0)||(a[f+33]=r);0==(b&65536|0)?r=0:(a[f+38]=ec(c,d),0==(i|0)?r=0:0==m[i]<<24>>24?r=0:(a[f+37]=ec(i,d),r=1));i=0==(b&4194304|0);a:do{if(i){c=r}else{do{if(0!=(g|0)&&0!=m[g]<<24>>24){a[f+42]=ec(g,d);g=n+200|0;a[g>>2]|=1;c=1;break a}}while(0);c=a[f+33];0==(c|0)?c=r:(a[f+42]=Hb(c),c=1)}}while(0);if(0==(b&8388608|0)|0==(q|0)||0==m[q]<<24>>24){return c}a[f+46]=ec(q,d);return 1}function Kn(b,r,i){var g=h;h+=32;var b=a[a[a[a[b>>2]+128>>2]+44>>2]+92>>2],q=V(r,Pr|0);if(0!=(q|0)&&0!=m[q]<<24>>24){return h=g,q}q=a[r>>2]<<28>>28;if(1==(q|0)){var c=jh|0,d=a[r+16>>2]}else{2==(q|0)?(c=Dg|0,d=a[r+20>>2]):3==(q|0)&&(c=Yf|0,d=a[a[r+36>>2]+16>>2])}if(0==(b|0)){r=(i+4|0)>>2,b=i+8|0}else{db(i,b);var q=i+4|0,r=q>>2,f=a[r],b=i+8|0;f>>>0<a[b>>2]>>>0||(na(i,1),f=a[r]);a[r]=f+1|0;m[f]=95;r=q>>2}db(i,c);c=g|0;Ma(c,bD|0,(j=h,h+=4,a[j>>2]=d,j));db(i,c);d=a[r];d>>>0<a[b>>2]>>>0||(na(i,1),d=a[r]);m[d]=0;i=a[i>>2];a[r]=i;h=g;return i}function Ln(b,r){var i,g,q,c,d=h;c=r>>2;r=h;h+=32;a[r>>2]=a[c];a[r+4>>2]=a[c+1];a[r+8>>2]=a[c+2];a[r+12>>2]=a[c+3];a[r+16>>2]=a[c+4];a[r+20>>2]=a[c+5];a[r+24>>2]=a[c+6];a[r+28>>2]=a[c+7];i=a[b+16>>2];q=i>>2;c=a[b+148>>2];if(0!=(c&4259840|0)){var f=0!=(c&131072|0);g=i+204|0;f?(a[g>>2]=0,a[q+52]=2):(a[g>>2]=2,a[q+52]=4);g=i+212|0;G(a[g>>2]);q=fa(a[q+52]<<4);i=q>>2;a[g>>2]=q;g=r>>2;a[i]=a[g];a[i+1]=a[g+1];a[i+2]=a[g+2];a[i+3]=a[g+3];g=(q+16|0)>>2;i=(r+16|0)>>2;a[g]=a[i];a[g+1]=a[i+1];a[g+2]=a[i+2];a[g+3]=a[i+3];0==(c&8192|0)&&Re(b,q,q,2);f||Mn(q)}h=d}function xk(x,r){var i,g,q,c,d=h;h+=144;q=d+64;g=d+128;c=r|0;var k=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);c=(x+16|0)>>2;var n=(b[0]=a[c],b[1]=a[c+1],f[0]),e=k>n;if(!e&&(i=x|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),k>=i)){var p=r+8|0,s=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),p=x+24|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]);if(s<=p){var j=x+8|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);if(s>=j&&(s=r+16|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),!(s>n|s<i)&&(s=r+24|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),!(s>p|s<j)&&(s=r+32|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),!(s>n|s<i)&&(s=r+40|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),!(s>p|s<j)&&(s=r+48|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),!(s>n|s<i)&&(i=r+56|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),!(i>p|i<j)))))))){h=d;return}}}if(0==(cD(r)|0)){c=d|0,k=q|0,Ld(g,r,3,.5,c,k),xk(x,c),xk(x,k)}else{q=(x+24|0)>>2;g=(x+8|0)>>2;i=(x|0)>>2;if(e){f[0]=k,a[c]=b[0],a[c+1]=b[1]}else{if(k<(b[0]=a[i],b[1]=a[i+1],f[0])){f[0]=k,a[i]=b[0],a[i+1]=b[1]}k=n}n=r+8|0;n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);e=(b[0]=a[q],b[1]=a[q+1],f[0]);if(n>e){f[0]=n,a[q]=b[0],a[q+1]=b[1]}else{if(n<(b[0]=a[g],b[1]=a[g+1],f[0])){f[0]=n,a[g]=b[0],a[g+1]=b[1]}n=e}e=r+16|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);if(e>k){f[0]=e,a[c]=b[0],a[c+1]=b[1],k=e}else{if(e<(b[0]=a[i],b[1]=a[i+1],f[0])){f[0]=e,a[i]=b[0],a[i+1]=b[1]}}e=r+24|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);if(e>n){f[0]=e,a[q]=b[0],a[q+1]=b[1],n=e}else{if(e<(b[0]=a[g],b[1]=a[g+1],f[0])){f[0]=e,a[g]=b[0],a[g+1]=b[1]}}e=r+32|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);if(e>k){f[0]=e,a[c]=b[0],a[c+1]=b[1],k=e}else{if(e<(b[0]=a[i],b[1]=a[i+1],f[0])){f[0]=e,a[i]=b[0],a[i+1]=b[1]}}e=r+40|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);if(e>n){f[0]=e,a[q]=b[0],a[q+1]=b[1],n=e}else{if(e<(b[0]=a[g],b[1]=a[g+1],f[0])){f[0]=e,a[g]=b[0],a[g+1]=b[1]}}e=r+48|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);if(e>k){f[0]=e,a[c]=b[0],a[c+1]=b[1]}else{if(e<(b[0]=a[i],b[1]=a[i+1],f[0])){f[0]=e,a[i]=b[0],a[i+1]=b[1]}}c=r+56|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);if(c>n){f[0]=c,a[q]=b[0],a[q+1]=b[1]}else{if(c<(b[0]=a[g],b[1]=a[g+1],f[0])){f[0]=c,a[g]=b[0],a[g+1]=b[1]}}}h=d}function cD(x){var r=x|0,r=(b[0]=a[r>>2],b[1]=a[r+4>>2],f[0]),i=x+8|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),g=x+48|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),q=x+56|0,q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]),c=x+16|0,d=x+24|0,c=dD(r,i,g,q,(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])),d=x+32|0,x=x+40|0;return 4>c&4>dD(r,i,g,q,(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),(b[0]=a[x>>2],b[1]=a[x+4>>2],f[0]))&1}function Qr(b){var r=a[b+192>>2];-1<(r|0)?(r|0)<(a[b+160>>2]|0)?(r=a[b+196>>2],b=-1<(r|0)?(r|0)<(a[b+164>>2]|0):0):b=0:b=0;return b&1}function Rr(x,r){var i,g,q=x>>2;i=a[q+37];var c=x+348|0,d=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),c=x+424|0;g=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);var c=d*g/72,k=x+480|0;f[0]=c;a[k>>2]=b[0];a[k+4>>2]=b[1];var k=x+432|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),d=d*k/72,n=x+488|0;f[0]=d;a[n>>2]=b[0];a[n+4>>2]=b[1];n=x+512|0;f[0]=g/72;a[n>>2]=b[0];a[n+4>>2]=b[1];k/=72;g=(x+520|0)>>2;f[0]=k;a[g]=b[0];a[g+1]=b[1];0!=(i&4096|a[Ic>>2]|0)&&(f[0]=-1*k,a[g]=b[0],a[g+1]=b[1]);g=a[q+110]>>>0;0==(a[q+89]|0)?(k=x+360|0,f[0]=g/c,a[k>>2]=b[0],a[k+4>>2]=b[1],c=x+368|0,f[0]=(a[q+111]>>>0)/d,a[c>>2]=b[0],a[c+4>>2]=b[1]):(k=x+368|0,f[0]=g/d,a[k>>2]=b[0],a[k+4>>2]=b[1],d=x+360|0,f[0]=(a[q+111]>>>0)/c,a[d>>2]=b[0],a[d+4>>2]=b[1]);q=r|0;yk(x,jc(q,$(q,Nn|0),Y|0));q=wk(x)>>2;a[q+1]=0;a[q+2]=r;a[q+3]=0;Sr(x,a[r+48>>2],r|0);c=a[x>>2];q=a[x+60>>2];if(0!=(q|0)){d=a[q+8>>2];if(0!=(d|0)){J[d](x)}d=V(r|0,zk|0);if(0!=(d|0)&&0!=m[d]<<24>>24&&(c=c+300|0,Tr(a[x+68>>2],d,c),q=a[q+92>>2],0!=(q|0))){J[q](x,c)}}0!=(i&2|0)&&eD(x,r);i=ra(r);q=0==(i|0);a:do{if(!q){for(c=i;;){if(m[c+132|0]=0,c=ba(r,c),0==(c|0)){break a}}}}while(0);i=h;q=a[a[x>>2]+280>>2];c=x+152|0;a[c>>2]=q;1<(q|0)&&0==(a[x+148>>2]&64|0)&&(la(0,fD|0,(j=h,h+=4,a[j>>2]=a[x+52>>2],j)),a[c>>2]=1);a[x+156>>2]=1;h=i;i=(x+152|0)>>2;c=a[i];q=x+156|0;if(0!=((a[q>>2]|0)<=(c|0)&1)<<24>>24){for(;;){1<(c|0)&&(c=a[x+60>>2],0!=(c|0)&&(c=a[c+16>>2],0!=(c|0)&&(d=a[x+156>>2],J[c](x,a[a[a[x>>2]+276>>2]+(d<<2)>>2],d,a[x+152>>2]))));c=x+168|0;d=x+192|0;g=a[c+4>>2];a[d>>2]=a[c>>2];a[d+4>>2]=g;c=0==Qr(x)<<24>>24;a:do{if(!c){for(;;){if(gD(x,r),hD(x),0==Qr(x)<<24>>24){break a}}}}while(0);if(1<(a[i]|0)&&(c=a[x+60>>2],0!=(c|0)&&(c=a[c+20>>2],0!=(c|0)))){J[c](x)}c=x+156|0;a[c>>2]=a[c>>2]+1|0;c=a[i];if(0==((a[q>>2]|0)<=(c|0)&1)<<24>>24){break}}}i=a[x+60>>2];if(0!=(i|0)&&(i=a[i+12>>2],0!=(i|0))){J[i](x)}i=a[x+76>>2];if(0!=(i|0)&&(i=a[i+4>>2],0!=(i|0))){J[i](x)}iD(x);Ei(x)}function eD(a,b){$b(a,qe|0);var i=b|0,g=V(i,zk|0);0!=(g|0)&&0!=m[g]<<24>>24&&$b(a,g);i=V(i,Eg|0);0!=(i|0)&&0!=m[i]<<24>>24&&Pa(a,i);jD(a,b);i=ra(b);if(0!=(i|0)){for(;;){var g=i|0,q=V(g,kh|0);0!=(q|0)&&0!=m[q]<<24>>24&&Pa(a,q);q=V(g,Ak|0);0!=(q|0)&&0!=m[q]<<24>>24&&$b(a,q);g=V(g,Eg|0);0!=(g|0)&&0!=m[g]<<24>>24&&Pa(a,g);g=Ib(b,i);q=0==(g|0);a:do{if(!q){for(var c=g;;){var d=c|0,f=V(d,kh|0);do{if(0!=(f|0)&&0!=m[f]<<24>>24){if(0==(Jc(f,58)|0)){Pa(a,f)}else{var n=Hb(f),h=he(n,zf|0),e=0==(h|0);b:do{if(!e){for(var j=h;;){if(0!=m[j]<<24>>24&&Pa(a,j),j=he(0,zf|0),0==(j|0)){break b}}}}while(0);G(n)}}}while(0);d=V(d,Eg|0);0!=(d|0)&&0!=m[d]<<24>>24&&Pa(a,d);c=yb(b,c);if(0==(c|0)){break a}}}}while(0);i=ba(b,i);if(0==(i|0)){break}}}}function gD(b,r){var i,g,q,c=a[b+16>>2];q=c>>2;var d=a[b+148>>2];Bk(V(r|0,lh|0));kD(b);var f=a[b+60>>2];if(0!=(f|0)&&(f=a[f+24>>2],0!=(f|0))){J[f](b)}Pa(b,Ac|0);$b(b,qe|0);if(0!=(d&4259840|0)&&!(0==(a[q+37]|0)&&0==(a[q+50]&1|0))){if(0==(d&655360|0)){var n=0,f=0}else{var n=d&131072,h=n>>>16^2,f=h+2|0;a[q+51]=h;h=fa(f<<4);g=h>>2;i=(b+284|0)>>2;a[g]=a[i];a[g+1]=a[i+1];a[g+2]=a[i+2];a[g+3]=a[i+3];g=(h+16|0)>>2;i=(b+300|0)>>2;a[g]=a[i];a[g+1]=a[i+1];a[g+2]=a[i+2];a[g+3]=a[i+3];0==(n|0)&&Mn(h);n=h}0==(d&8192|0)&&Re(b,n,n,f);a[q+53]=n;a[q+52]=f}0!=(d&32768|0)&&(f=a[r+48>>2],0!=(f|0)&&(a[q+33]=a[f>>2]));f=0!=(d&4|0);f||(c=c+148|0,0==(a[c>>2]|0)&&0==(a[q+50]&1|0)||(Ln(b,b+252|0),ad(b,a[c>>2],a[q+42],a[q+46],a[q+38])));if(1==(a[b+152>>2]|0)){var e,n=V(r|0,zk|0);0==(n|0)?(c=1,n=hf|0):(h=0==m[n]<<24>>24,c=h&1,n=h?hf|0:n);h=a[b+148>>2];i=116==m[n]<<24>>24;if(0==(h&256|0)){var j=i?0==(ka(n,On|0)|0)?hf|0:n:n;e=2410}else{i?0!=(ka(n,On|0)|0)&&(j=n,e=2410):(j=n,e=2410)}2410==e&&0==(h&33554432|0)|0==(c|0)&&($b(b,j),Pa(b,j),mh(b,b+252|0,1));e=a[a[r+44>>2]+88>>2];0!=(e|0)&&lD(b,e)}e=a[r+48>>2];0!=(e|0)&&Fg(b,4,e);if(!f){if(0==(a[q+37]|0)&&0==(a[q+50]&1|0)){Ur(b,r,d);mD(b);return}Se(b)}Ur(b,r,d);mD(b)}function hD(b){var r,i=b>>2,g=h;h+=16;var q=g+8;r=b+192|0;var c=r|0,d=b+196|0,f=a[d>>2],n=a[i+47];a[g>>2]=a[i+46]+a[c>>2]|0;a[g+4>>2]=n+f|0;r>>=2;n=a[g>>2];f=a[g+4>>2];a[r]=n;a[r+1]=f;0==Qr(b)<<24>>24&&(b=a[i+45],0==(b|0)?(c=a[i+43],a[d>>2]=c,d=n):(d=a[i+42],a[c>>2]=d,c=f),a[q>>2]=a[i+44]+d|0,a[q+4>>2]=b+c|0,i=a[q+4>>2],a[r]=a[q>>2],a[r+1]=i);h=g}function nD(b){var r=a[yi>>2];0==(r|0)&&(r=Nc(oD,a[Pn>>2]),a[yi>>2]=r);if(0!=(J[a[r>>2]](r,b,4)|0)){return 0}var r=a[yi>>2],i=a[r>>2],b=Dc(b);J[i](r,b,1);return 1}function Ck(x,r,i){var g,q,c,d,k,n=h;h+=68;k=n>>2;var e=n+4,p=r+208|0;if(1<=(a[p>>2]|0)){var j=r+212|0,v=0!=(i&4|0),t=x+16|0,u=0==(i&8|0),w=e|0;d=e>>2;for(var A=e+32|0,r=A>>2,A=A|0,B=e+16|0,C=e+8|0,P=e+24|0,T=e|0,gb=e+48|0,$e=e+40|0,e=e+56|0,M=1;;){var y=a[a[j>>2]+(M<<2)>>2];do{c=x;q=y;var O=2>(a[c+152>>2]|0);a:do{if(O){var D=1}else{if(g=q|0,g=jc(g,$(g,Qn|0),Y|0),0!=Gi(c,g)<<24>>24){D=1}else{if(0!=m[g]<<24>>24){D=0}else{g=q;for(var Da=ra(g);;){if(0==(Da|0)){D=0;break a}if(0!=pD(c,q,Da)<<24>>24){D=1;break a}Da=ba(g,Da)}}}}}while(0);if(0!=D<<24>>24){v&&Ck(x,y,i);c=x;q=y;O=cc;O=wk(c)>>2;a[O+1]=1;a[O+2]=q;a[O+3]=1;Sr(c,a[q+48>>2],q|0);q=a[c+60>>2];if(0!=(q|0)&&(q=a[q+32>>2],0!=(q|0))){J[q](c)}q=a[t>>2];c=q>>2;q=(q+148|0)>>2;O=0==(a[q]|0)?0!=(a[c+50]&1|0):1;g=y|0;Bk(V(g,lh|0));v|O^1||(Ln(x,y+52|0),ad(x,a[q],a[c+42],a[c+46],a[c+38]));a[k]=0;var Da=n,ia=cc,Je=V(y|0,Rn|0),F=0==(Je|0);a:do{if(F){var E=0,sc=0}else{if(0==m[Je]<<24>>24){sc=E=0}else{nh(Je);for(var G=Cc|0,lf=0;;){for(;;){var H=a[G>>2];if(0==(H|0)){E=lf;sc=Cc|0;break a}if(0==(ka(H,Hi|0)|0)){ia=1489;break}if(0==(ka(H,Vr|0)|0)){var hc=G;break}else{G=G+4|0}}if(1489==ia){ia=0,G=G+4|0,lf|=1}else{for(;;){var H=hc+4|0,ca=a[H>>2];a[hc>>2]=ca;if(0==(ca|0)){break}else{hc=H}}lf|=2}}}}}while(0);a[Da>>2]=E;Da=sc;0==(Da|0)?Da=0:(Ke(x,Da),Da=a[k]&1);ia=m[y+148|0]&255;0==(ia&1|0)?0!=(ia&2|0)?(ia=Aa(g,a[Wr>>2],Dk|0),Je=1,F=Aa(g,a[Xr>>2],Ek|0)):0!=(ia&8|0)?(ia=Aa(g,a[qD>>2],Fk|0),Je=1,F=Aa(g,a[rD>>2],Gk|0)):0!=(ia&4|0)?(ia=Aa(g,a[sD>>2],Hk|0),Je=1,F=Aa(g,a[tD>>2],Ik|0)):(ia=V(g,kh|0),Je=0==(ia|0)?0:0==m[ia]<<24>>24?0:ia,ia=V(g,uD|0),ia=0==(ia|0)?Je:0==m[ia]<<24>>24?Je:ia,F=V(g,Ak|0),F=0==(F|0)?Je:0==m[F]<<24>>24?Je:F,0!=(Da|0)?Je=Da:(Da=V(g,zk|0),0==(Da|0)?Je=0:(lf=0==m[Da]<<24>>24,Je=lf&1^1,F=lf?F:Da))):(ia=Aa(g,a[Wr>>2],Jk|0),Je=1,F=Aa(g,a[Xr>>2],Kk|0));Da=0==(ia|0)?Ac|0:ia;ia=0==(F|0)?qe|0:F;F=a[Yr>>2];0!=(F|0)&&(lf=mb(g,a[F+8>>2]),0!=(lf|0)&&0!=m[lf]<<24>>24&&Zr(x,Xb(g,F,1,0)));F=a[k];0==(F&2|0)?(Pa(x,Da),$b(x,ia),0!=(Zf(g,a[Sn>>2],1)|0)?mh(x,y+52|0,Je&255):0!=(Je|0)&&((ia|0)!=(Da|0)&&Pa(x,ia),mh(x,y+52|0,Je&255))):0!=(Zf(g,a[Sn>>2],1)|Je|0)&&(g=(y+52|0)>>2,a[d]=a[g],a[d+1]=a[g+1],a[d+2]=a[g+2],a[d+3]=a[g+3],g=(y+68|0)>>2,a[r]=a[g],a[r+1]=a[g+1],a[r+2]=a[g+2],a[r+3]=a[g+3],g=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]),f[0]=g,a[B>>2]=b[0],a[B+4>>2]=b[1],g=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),f[0]=g,a[P>>2]=b[0],a[P+4>>2]=b[1],g=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0]),f[0]=g,a[gb>>2]=b[0],a[gb+4>>2]=b[1],g=(b[0]=a[$e>>2],b[1]=a[$e+4>>2],f[0]),f[0]=g,a[e>>2]=b[0],a[e+4>>2]=b[1],Ii(x,ia,Da,w,4,F,F&1));g=a[y+48>>2];0!=(g|0)&&Fg(x,5,g);O&&(v&&(Ln(x,y+52|0),ad(x,a[q],a[c+42],a[c+46],a[c+38])),Se(x));a:do{if(!u&&(c=y,q=ra(c),0!=(q|0))){for(;;){oh(x,q);O=Ib(c,q);g=0==(O|0);b:do{if(!g){for(Da=O;;){if(Ji(x,Da),Da=yb(c,Da),0==(Da|0)){break b}}}}while(0);q=ba(c,q);if(0==(q|0)){break a}}}}while(0);c=x;q=a[c+60>>2];if(0!=(q|0)&&(q=a[q+36>>2],0!=(q|0))){J[q](c)}Ei(c);v||Ck(x,y,i)}}while(0);M=M+1|0;if((M|0)>(a[p>>2]|0)){break}}}h=n}function oh(b,r){var i=a[b>>2],g=r+24|0,q;if(q=0!=(a[g>>2]|0)){if(q=0!=pD(b,a[r+20>>2],r)<<24>>24){var c,d;q=h;d=(b+252|0)>>2;c=h;h+=32;a[c>>2]=a[d];a[c+4>>2]=a[d+1];a[c+8>>2]=a[d+2];a[c+12>>2]=a[d+3];a[c+16>>2]=a[d+4];a[c+20>>2]=a[d+5];a[c+24>>2]=a[d+6];a[c+28>>2]=a[d+7];c=ph(r+64|0,c)&255;h=q;q=0!=c<<24>>24}}if(q&&(q=r+132|0,i=a[i+28>>2],(m[q]<<24>>24|0)!=(i|0))){m[q]=i&255;yk(b,a[r+12>>2]);i=r|0;q=jc(i,a[$r>>2],Y|0);0!=m[q]<<24>>24&&yk(b,q);i=jc(i,a[Ki>>2],Y|0);q=0==m[i]<<24>>24;a:do{if(!q){nh(i);for(q=Cc|0;;){i=q+4|0;q=a[q>>2];if(0==(q|0)){break a}if(105!=m[q]<<24>>24){q=i}else{if(0==(ka(q,qh|0)|0)){break}else{q=i}}}return}}while(0);vD(b,r);J[a[a[a[g>>2]+4>>2]+20>>2]](b,r);g=a[r+124>>2];0!=(g|0)&&Fg(b,10,g);g=a[b+60>>2];if(0!=(g|0)&&(g=a[g+60>>2],0!=(g|0))){J[g](b)}Ei(b)}}function Ji(b,r){var i,g,q=h;g=(b+252|0)>>2;i=h;h+=32;a[i>>2]=a[g];a[i+4>>2]=a[g+1];a[i+8>>2]=a[g+2];a[i+12>>2]=a[g+3];a[i+16>>2]=a[g+4];a[i+20>>2]=a[g+5];a[i+24>>2]=a[g+6];a[i+28>>2]=a[g+7];var c;g=a[r+24>>2];if(0==(g|0)){c=1823}else{if(0==(ph(g+8|0,i)|0)){c=1823}else{var d=1}}1823==c&&(c=a[r+108>>2],0!=(c|0)&&0!=as(c,i)<<24>>24?d=1:(c=a[r+120>>2],d=0!=(c|0)&&0!=as(c,i)<<24>>24?1:0));h=q;if(0!=d<<24>>24){i=(r+12|0)>>2;q=2>(a[b+152>>2]|0);a:do{if(q){var f=1}else{if(c=jc(r|0,a[Tn>>2],Y|0),0!=Gi(b,c)<<24>>24){f=1}else{if(0!=m[c]<<24>>24){f=0}else{c=r+16|0;d=r+12|0;for(g=0;;){if(2<=(g|0)){f=0;break a}var n=jc(a[(1>(g|0)?c:d)>>2]|0,a[Un>>2],Y|0);if(0==m[n]<<24>>24){f=1;break a}if(0==Gi(b,n)<<24>>24){g=g+1|0}else{f=1;break a}}}}}}while(0);if(0!=f<<24>>24){q=r+16|0;f=Gb(Ba(a[a[q>>2]+12>>2])+Ba(a[a[i]+12>>2])+3|0);Rf(f,a[a[q>>2]+12>>2]);q=f+Ba(f)|0;0==(a[a[a[i]+20>>2]>>2]&16|0)?(m[q]=m[Af|0],m[q+1]=m[(Af|0)+1],m[q+2]=m[(Af|0)+2]):(m[q]=m[Bf|0],m[q+1]=m[(Bf|0)+1],m[q+2]=m[(Bf|0)+2]);uf(f,a[a[i]+12>>2]);yk(b,f);G(f);f=r|0;i=jc(f,a[bs>>2],Y|0);0!=m[i]<<24>>24&&yk(b,i);f=jc(f,a[Vn>>2],Y|0);i=0==m[f]<<24>>24;a:do{if(i){q=0}else{nh(f);for(i=Cc|0;;){f=i+4|0;i=a[i>>2];if(0==(i|0)){q=Cc|0;break a}if(105!=m[i]<<24>>24){i=f}else{if(0==(ka(i,qh|0)|0)){break}else{i=f}}}return}}while(0);wD(b,r,q);xD(b,r,q);yD(b)}}}function nh(b){var r,i=h;h+=148;var g,q=i+128,c=i+132;m[cs]||(fc(Ec,128,zD|0),m[cs]=1);fc(c,128,i|0);a[q>>2]=b;r=(c+4|0)>>2;var d=c+8|0,f=c|0,n=0,e=0;a:for(;;){for(var p=n;;){for(var n=q,s=c,v=cc,t=a[n>>2];;){v=m[t];if(0==v<<24>>24){var u=0;break}if(0==(ah(v<<24>>24)|0)&&(v=m[t],44!=v<<24>>24)){u=v;break}t=t+1|0}var w=u<<24>>24;b:do{if(40==(w|0)||41==(w|0)){var A=w,B=t+1|0}else{if(0==(w|0)){A=0,B=t}else{if(0!=AD(w)<<24>>24){A=1,B=t}else{for(var v=(s+4|0)>>2,C=s+8|0,P=t,T=u;;){var gb=a[v];gb>>>0<a[C>>2]>>>0||(na(s,1),gb=a[v]);a[v]=gb+1|0;m[gb]=T;P=P+1|0;T=m[P];if(0!=AD(T<<24>>24)<<24>>24){A=1;B=P;break b}}}}}}while(0);a[n>>2]=B;n=A;if(0==(n|0)){g=1553;break a}else{if(41==(n|0)){if(0==p<<24>>24){g=1541;break a}else{p=0}}else{if(40==(n|0)){if(0==p<<24>>24){p=1}else{g=1539;break a}}else{break}}}}if(0==p<<24>>24){if(63==(e|0)){g=1544;break}n=a[Ec+4>>2];n>>>0<a[Ec+8>>2]>>>0||(na(Ec,1),n=a[Ec+4>>2]);a[Ec+4>>2]=n+1|0;m[n]=0;a[Cc+(e<<2)>>2]=a[Ec+4>>2];e=e+1|0}n=a[r];n>>>0<a[d>>2]>>>0||(na(c,1),n=a[r]);m[n]=0;n=a[f>>2];a[r]=n;db(Ec,n);n=a[Ec+4>>2];n>>>0<a[Ec+8>>2]>>>0||(na(Ec,1),n=a[Ec+4>>2]);a[Ec+4>>2]=n+1|0;m[n]=0;n=p}if(1544==g){return la(0,BD|0,(j=h,h+=4,a[j>>2]=b,j)),a[Cc+252>>2]=0,uc(c),h=i,Cc|0}if(1539==g){return la(1,CD|0,(j=h,h+=4,a[j>>2]=b,j)),a[Cc>>2]=0,uc(c),h=i,Cc|0}if(1553==g){if(0!=p<<24>>24){return la(1,DD|0,(j=h,h+=4,a[j>>2]=b,j)),a[Cc>>2]=0,uc(c),h=i,Cc|0}a[Cc+(e<<2)>>2]=0;uc(c);b=a[Ec+4>>2];b>>>0<a[Ec+8>>2]>>>0||(na(Ec,1),b=a[Ec+4>>2]);m[b]=0;a[Ec+4>>2]=a[Ec>>2];h=i;return Cc|0}if(1541==g){return la(1,ED|0,(j=h,h+=4,a[j>>2]=b,j)),a[Cc>>2]=0,uc(c),h=i,Cc|0}}function Gg(b){var r=a[Wn>>2];0!=(b|0)?(a[Wn>>2]=r+1|0,0==(r|0)&&(b=Hb(mi()),a[ds>>2]=b,mi())):0<(r|0)&&(b=r-1|0,a[Wn>>2]=b,0==(b|0)&&(mi(),G(a[ds>>2])))}function Br(x,r){var i,g,q,c,d=h,k;c=(r+44|0)>>2;if(0==(a[c]|0)){return la(1,FD|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),h=d,-1}q=ra(r);if(0!=(q|0)){for(;;){var n=r,e=q,p=e+32|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),s=e+104|0,s=p-(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]);g=e+64|0;f[0]=s;a[g>>2]=b[0];a[g+4>>2]=b[1];s=e+40|0;s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]);g=e+96|0;g=.5*(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);var v=e+72|0;f[0]=s-g;a[v>>2]=b[0];a[v+4>>2]=b[1];v=e+112|0;p+=(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0]);v=e+80|0;f[0]=p;a[v>>2]=b[0];a[v+4>>2]=b[1];p=e+88|0;f[0]=s+g;a[p>>2]=b[0];a[p+4>>2]=b[1];e=Ib(n,e);if(0!=(e|0)){for(;!(p=a[e+24>>2],0!=(p|0)&&GD(p),e=yb(n,e),0==(e|0));){}}q=ba(r,q);if(0==(q|0)){break}}}HD(x,r);q=x+272|0;n=a[q>>2];0!=(n|0)&&(G(n),a[q>>2]=0);q=(x+276|0)>>2;n=a[q];0!=(n|0)&&(G(n),a[q]=0);n=V(r|0,ID|0);0==(n|0)?(a[q]=0,a[x+280>>2]=1):a[x+280>>2]=JD(x,r,n);a[x+104>>2]=Oc|0;a[x+108>>2]=a[KD>>2];Gg(1);n=x+56|0;e=x|0;p=x+156|0;q=(x+164|0)>>2;s=x+28|0;g=a[x+120>>2];v=a[x+124>>2]=g;for(g=v>>2;;){if(0==(v|0)){k=1616;break}k=a[n>>2];0==(k|0)?(a[g+5]=0,a[g+6]=0):(a[g+5]=a[k+8>>2],a[g+6]=a[a[n>>2]+12>>2]);var t=v+12|0;a[t>>2]=e;a[g+7]=a[p>>2];if(0==(a[c]|0)){k=1597;break}i=(v+52|0)>>2;k=Bn(v,a[i]);a[g+14]=k;if(21==(k|0)){k=v+148|0,a[k>>2]|=1}else{if(24==(k|0)){k=v+148|0,a[k>>2]|=520}else{if(999==(k|0)){k=1599;break}else{k=v+148|0;var u=a,w=k>>2,A;a:{A=V(r|0,LD|0);if(0!=(A|0)){var B=m[A];if(110==B<<24>>24){if(0==(ka(A+1|0,MD|0)|0)){A=1;break a}}else{if(101==B<<24>>24&&0==(ka(A+1|0,ND|0)|0)){A=16;break a}}}A=0}u[w]=A|a[k>>2]}}}u=a[q];w=0==(u|0);a:do{if(!w){do{if(0!=(a[u+148>>2]&32|0)&&0==(ka(a[i],a[u+52>>2])|0)){k=a[Xn>>2];if(0==(k|0)){k=1610;break a}a[k+8>>2]=v;a[g+9]=a[k+36>>2];k=1612;break a}}while(0);Cr(u);a[q]=0;a[s>>2]=0}a[Xn>>2]=0;k=1610}while(0);if(1610==k){k=0;u=v;w=a[u+60>>2];if(0==(OD(u)|0)){if(0!=(w|0)&&(w=a[w>>2],0!=(w|0))){J[w](u)}u=0}else{u=1}0==(u|0)&&(a[q]=v,k=1612)}1612==k&&(k=0,a[g+2]=0,a[g+26]=PD,u=v,w=A=cc,A=a[u>>2],0!=m[A+264|0]<<24>>24?(w=(u+236|0)>>2,A=(A+188|0)>>2,a[w]=a[A],a[w+1]=a[A+1],a[w+2]=a[A+2],a[w+3]=a[A+3]):(300==(a[u+56>>2]|0)?(w=a[u+68>>2]+4|0,w=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),A=u+244|0,f[0]=w,a[A>>2]=b[0],a[A+4>>2]=b[1],u=u+236|0,f[0]=w):(w=u+244|0,f[0]=4,a[w>>2]=b[0],a[w+4>>2]=b[1],u=u+236|0,f[0]=4),a[u>>2]=b[0],a[u+4>>2]=b[1]),u=v,w=A=A=w=w=cc,A=a[u>>2],0!=m[A+265|0]<<24>>24?(w=(u+408|0)>>2,A=(A+172|0)>>2,a[w]=a[A],a[w+1]=a[A+1],a[w+2]=a[A+2],a[w+3]=a[A+3]):(w=a[u+56>>2],300==(w|0)?(A=(u+408|0)>>2,w=(a[u+84>>2]+4|0)>>2,a[A]=a[w],a[A+1]=a[w+1],a[A+2]=a[w+2],a[A+3]=a[w+3]):2==(w|0)||3==(w|0)||4==(w|0)||22==(w|0)||21==(w|0)||30==(w|0)?(w=u+416|0,f[0]=36,a[w>>2]=b[0],a[w+4>>2]=b[1],u=u+408|0,f[0]=36,a[u>>2]=b[0],a[u+4>>2]=b[1]):(w=(u+408|0)>>2,a[w]=0,a[w+1]=0,a[w+2]=0,a[w+3]=0)),w=a[c]+24|0,u=v,w=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),A=B=B=A=cc,B=a[a[u>>2]+164>>2],0!=w?(A=u+432|0,f[0]=w,a[A>>2]=b[0],a[A+4>>2]=b[1],u=u+424|0,f[0]=w,a[u>>2]=b[0],a[u+4>>2]=b[1]):0!=(B|0)&&0!=m[B+124|0]<<24>>24?(A=(u+424|0)>>2,B=(B+108|0)>>2,a[A]=a[B],a[A+1]=a[B+1],a[A+2]=a[B+2],a[A+3]=a[B+3]):(w=u+424|0,300==(a[u+56>>2]|0)?(B=w>>2,A=(a[u+84>>2]+36|0)>>2,a[B]=a[A],a[B+1]=a[A+1],a[B+2]=a[A+2],a[B+3]=a[A+3]):(u=u+432|0,f[0]=96,a[u>>2]=b[0],a[u+4>>2]=b[1],u=w|0,f[0]=96,a[u>>2]=b[0],a[u+4>>2]=b[1])),QD(v,r),RD(v,r),0==(a[g+37]&128|0)&&(a[a[t>>2]+20>>2]=a[Yn>>2],Rr(v,r)),a[Xn>>2]=v);g=cc;g=(x+124|0)>>2;v=a[g];t=a[v+4>>2];0!=(t|0)&&(u=t+52|0,0==(a[u>>2]|0)&&(a[u>>2]=a[v+52>>2]));v=a[g]=t;g=v>>2}if(1597==k){return la(1,SD|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Gg(0),h=d,-1}if(1599==k){return la(1,TD|0,(j=h,h+=4,a[j>>2]=a[i],j)),Gg(0),h=d,-1}if(1616==k){return Gg(0),h=d,0}}function HD(x,r){var i,g,q,c,d,k,n=x>>2,e=h;h+=16;d=e>>2;q=e+8;g=q>>2;a[n+32]=r;c=x+265|0;m[c]=0;i=r|0;k=V(i,Zn|0);if(0!=(k|0)){var p=Cd(k,Lk|0,(j=h,h+=8,a[j>>2]=e,a[j+4>>2]=q,j));if(0<(p|0)){var s=72*(b[0]=a[d],b[1]=a[d+1],f[0]);k=(x+180|0)>>2;f[0]=s;a[k]=b[0];a[k+1]=b[1];var v=x+172|0;f[0]=s;a[v>>2]=b[0];a[v+4>>2]=b[1];1<(p|0)&&(p=72*(b[0]=a[g],b[1]=a[g+1],f[0]),f[0]=p,a[k]=b[0],a[k+1]=b[1]);m[c]=1}}c=x+264|0;m[c]=0;k=V(i,UD|0);0!=(k|0)&&(q=Cd(k,Lk|0,(j=h,h+=8,a[j>>2]=e,a[j+4>>2]=q,j)),0<(q|0)&&(k=72*(b[0]=a[d],b[1]=a[d+1],f[0]),d=(x+196|0)>>2,f[0]=k,a[d]=b[0],a[d+1]=b[1],p=x+188|0,f[0]=k,a[p>>2]=b[0],a[p+4>>2]=b[1],1<(q|0)&&(g=72*(b[0]=a[g],b[1]=a[g+1],f[0]),f[0]=g,a[d]=b[0],a[d+1]=b[1]),m[c]=1));d=x+266|0;m[d]=0;g=(r+44|0)>>2;c=(x+204|0)>>2;q=(a[g]+48|0)>>2;a[c]=a[q];a[c+1]=a[q+1];a[c+2]=a[q+2];a[c+3]=a[q+3];q=a[g];c=q+48|0;.001<(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])?(c=q+56|0,.001<(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])?(m[d]=1,g=a[g]):g=q):g=q;a[n+65]=0==m[g+81|0]<<24>>24?0:90;g=x+168|0;a[g>>2]=VD|0;i=V(i,WD|0);0!=(i|0)&&0!=m[i]<<24>>24&&(a[g>>2]=i);g=(x+228|0)>>2;i=(r+52|0)>>2;a[g]=a[i];a[g+1]=a[i+1];a[g+2]=a[i+2];a[g+3]=a[i+3];a[g+4]=a[i+4];a[g+5]=a[i+5];a[g+6]=a[i+6];a[g+7]=a[i+7];i=r+32|0;g=$(a[i>>2]|0,es|0);a[Sn>>2]=g;i=$(a[i>>2]|0,$n|0);a[Yr>>2]=i;i=r+40|0;a[n+71]=Aa(a[a[i>>2]>>2]|0,a[ao>>2],Li|0);i=Xb(a[a[i>>2]>>2]|0,a[bo>>2],14,1);g=x+288|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];a[n+74]=co|0;a[n+40]=a[r+12>>2];h=e}function QD(x,r){var i,g,q,c,d,k=h;h+=40;d=k>>2;var n=k+8;c=n>>2;var e=k+16;q=e>>2;var p=k+24;i=p>>2;var s=k+32;g=s>>2;var v=a[x>>2],t=v+244|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),u=v+252|0,u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),w=v+228|0,w=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),A=v+236|0,A=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]),B=x+236|0,C=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),B=w-C,P=x+204|0;f[0]=B;a[P>>2]=b[0];a[P+4>>2]=b[1];var P=x+244|0,T=(b[0]=a[P>>2],b[1]=a[P+4>>2],f[0]),P=A-T,gb=x+212|0;f[0]=P;a[gb>>2]=b[0];a[gb+4>>2]=b[1];C=t+C;gb=x+220|0;f[0]=C;a[gb>>2]=b[0];a[gb+4>>2]=b[1];T=u+T;gb=x+228|0;f[0]=T;a[gb>>2]=b[0];a[gb+4>>2]=b[1];B=C-B;P=T-P;f[0]=1;a[q]=b[0];a[q+1]=b[1];C=a[r+44>>2];T=C+64|0;T=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0]);.001<T?(gb=C+72|0,gb=(b[0]=a[gb>>2],b[1]=a[gb+4>>2],f[0]),.001<gb?!(T<B|gb<P)&&!(0!=m[C+80|0]<<24>>24&T>B&gb>P)?C=1:(C=T/B,T=gb/P,C=C<T?C:T,f[0]=C,a[q]=b[0],a[q+1]=b[1]):C=1):C=1;t=.5*(w+t);f[0]=t;a[i]=b[0];a[i+1]=b[1];u=.5*(A+u);f[0]=u;a[g]=b[0];a[g+1]=b[1];a[x+356>>2]=a[v+260>>2];v=B*C;f[0]=v;a[d]=b[0];a[d+1]=b[1];w=P*C;f[0]=w;a[c]=b[0];a[c+1]=b[1];A=V(r|0,XD|0);0==(A|0)?(g=u,i=(x+360|0)>>2,f[0]=v,a[i]=b[0],a[i+1]=b[1],i=(x+368|0)>>2,f[0]=w,a[i]=b[0],a[i+1]=b[1],i=(x+348|0)>>2,f[0]=C,a[i]=b[0],a[i+1]=b[1],i=(x+332|0)>>2,f[0]=t):(v=Gb(Ba(A)+1|0),t=Gb(Ba(A)+1|0),4==(Cd(A,YD|0,(j=h,h+=16,a[j>>2]=k,a[j+4>>2]=n,a[j+8>>2]=e,a[j+12>>2]=v,j))|0)?(n=Mi(a[r+32>>2],v),0!=(n|0)&&(n=n+24|0,e=n+8|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),f[0]=e,a[i]=b[0],a[i+1]=b[1],n=n+16|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),f[0]=n,a[g]=b[0],a[g+1]=b[1])):4!=(Cd(A,ZD|0,(j=h,h+=20,a[j>>2]=k,a[j+4>>2]=n,a[j+8>>2]=e,a[j+12>>2]=v,a[j+16>>2]=t,j))|0)?Cd(A,$D|0,(j=h,h+=20,a[j>>2]=k,a[j+4>>2]=n,a[j+8>>2]=e,a[j+12>>2]=p,a[j+16>>2]=s,j)):(n=Mi(a[r+32>>2],v),0!=(n|0)&&(n=n+24|0,e=n+8|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),f[0]=e,a[i]=b[0],a[i+1]=b[1],n=n+16|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),f[0]=n,a[g]=b[0],a[g+1]=b[1])),G(v),G(t),d=(b[0]=a[d],b[1]=a[d+1],f[0]),c=(b[0]=a[c],b[1]=a[c+1],f[0]),n=(b[0]=a[q],b[1]=a[q+1],f[0]),q=(b[0]=a[i],b[1]=a[i+1],f[0]),g=(b[0]=a[g],b[1]=a[g+1],f[0]),i=(x+360|0)>>2,f[0]=d,a[i]=b[0],a[i+1]=b[1],i=(x+368|0)>>2,f[0]=c,a[i]=b[0],a[i+1]=b[1],i=(x+348|0)>>2,f[0]=n,a[i]=b[0],a[i+1]=b[1],i=(x+332|0)>>2,f[0]=q);a[i]=b[0];a[i+1]=b[1];i=x+340|0;i>>=2;f[0]=g;a[i]=b[0];a[i+1]=b[1];h=k}function AD(a){return 40==(a|0)||41==(a|0)||44==(a|0)||0==(a|0)?1:0}function Mk(x,r,i){var g=x|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];x=x+8|0;f[0]=r;a[x>>2]=b[0];a[x+4>>2]=b[1]}function eo(b,r,i){i=i<<24>>24;66==(i|0)?(r=0,i=1):82==(i|0)?(a[r+168>>2]=a[r+160>>2]-1|0,r=-1,i=0):84==(i|0)?(a[r+172>>2]=a[r+164>>2]-1|0,r=0,i=-1):(r=76==(i|0)?1:0,i=0);a[b>>2]=r;a[b+4>>2]=i}function fo(b,r,i){a[b>>2]=i;a[b+4>>2]=r}function RD(x,r){var i,g,q,c,d,k,n,e=x>>2,p=h;h+=128;var s,v=p+16,t=p+24,u=p+32,w=p+40,A=p+48,B=p+64,C=p+80,P=p+96,T=p+112,gb=p+120,y=a[e],M=x+360|0,X=(b[0]=a[M>>2],b[1]=a[M+4>>2],f[0]),O=x+368|0,D=(b[0]=a[O>>2],b[1]=a[O+4>>2],f[0]);n=(x+356|0)>>2;if(0==(a[n]|0)){var Da=X,ia=D}else{Mk(p,X,D);var F=p|0,E=p+8|0,Da=(b[0]=a[F>>2],b[1]=a[F+4>>2],f[0]),ia=(b[0]=a[E>>2],b[1]=a[E+4>>2],f[0])}var G=x+408|0,sc=(b[0]=a[G>>2],b[1]=a[G+4>>2],f[0]),J=x+416|0,H=(b[0]=a[J>>2],b[1]=a[J+4>>2],f[0]);if(0==m[y+266|0]<<24>>24){s=1737}else{if(0==(a[e+37]&32|0)){s=1737}else{var I=y+204|0,hc=(b[0]=a[I>>2],b[1]=a[I+4>>2],f[0])-2*sc,ca=y+212|0,K=(b[0]=a[ca>>2],b[1]=a[ca+4>>2],f[0])-2*H;if(1e-4>hc){var L=a[e+40]=1}else{var zb=Da/hc&-1,ja=x+160|0;a[ja>>2]=zb;if(1e-4<Da-(zb|0)*hc){var aa=zb+1|0,L=a[ja>>2]=aa}else{L=zb}}if(1e-4>K){var da=a[e+41]=1}else{var ea=ia/K&-1,xa=x+164|0;a[xa>>2]=ea;if(1e-4<ia-(ea|0)*K){var N=ea+1|0,da=a[xa>>2]=N}else{da=ea}}a[e+50]=da*L|0;var Od=hc,ha=K,ga=Da<hc?Da:hc,Zd=ia<K?ia:K}}if(1737==s){if(0==(a[e+17]|0)){var Rb=0,Xe=0}else{var tb=a[e+21],ya=tb+20|0,Uf=(b[0]=a[ya>>2],b[1]=a[ya+4>>2],f[0])-2*sc,wa=0>Uf?0:Uf,Ab=tb+28|0,Fa=(b[0]=a[Ab>>2],b[1]=a[Ab+4>>2],f[0])-2*H;0>Fa?(Rb=wa,Xe=0):(Rb=wa,Xe=Fa)}a[e+50]=1;a[e+41]=1;a[e+40]=1;var Ga=Rb<Da?Da:Rb;Xe<ia?(Od=Ga,ha=ia):(Od=Ga,ha=Xe);ga=Da;Zd=ia}k=(x+424|0)>>2;var Bg=(Od+2*sc)*(b[0]=a[k],b[1]=a[k+1],f[0])/72;a[e+110]=(0>Bg?Bg-.5:Bg+.5)&-1;d=(x+432|0)>>2;var ta=(ha+2*H)*(b[0]=a[d],b[1]=a[d+1],f[0])/72;a[e+111]=(0>ta?ta-.5:ta+.5)&-1;var Ka=x+176|0;c=(y+168|0)>>2;q=(x+168|0)>>2;a[q]=0;a[q+1]=0;a[q+2]=0;a[q+3]=0;a[q+4]=0;a[q+5]=0;eo(v,x,m[a[c]]);var za=v|0;g=za>>2;var ma=v+4|0;i=ma>>2;var pa=a[i],Q=Ka|0;a[Q>>2]=a[g];var Ha=Ka+4|0;a[Ha>>2]=pa;eo(t,x,m[a[c]+1|0]);var Ra=x+184|0,W=a[t>>2],V=a[t+4>>2];a[Ra>>2]=W;a[Ra+4>>2]=V;var La=W+a[Ka>>2]|0;if(1==((-1<(La|0)?La:-La|0)|0)){var S=V+a[e+45]|0;if(1!=((-1<(S|0)?S:-S|0)|0)){s=1750}}else{s=1750}if(1750==s){eo(u,x,66);var Ya=a[u+4>>2];a[Ka>>2]=a[u>>2];a[Ka+4>>2]=Ya;eo(w,x,76);var Y=a[w+4>>2],za=Ra|0;g=za>>2;a[g]=a[w>>2];ma=Ra+4|0;i=ma>>2;a[i]=Y;la(0,aE|0,(j=h,h+=4,a[j>>2]=a[c],j))}if(0==m[a[r+44>>2]+82|0]<<24>>24){var Za=0,U=0}else{var ab=Od>ga?.5*(Od-ga):0;ha>Zd?(Za=ab,U=.5*(ha-Zd)):(Za=ab,U=0)}if(0==(a[n]|0)){var $a=ga,jb=Zd,Ca=sc,Ia=H,eb=Za,ub=U}else{Mk(A,ga,Zd);var Sa=A|0,R=(b[0]=a[Sa>>2],b[1]=a[Sa+4>>2],f[0]),ua=A+8|0,Oa=(b[0]=a[ua>>2],b[1]=a[ua+4>>2],f[0]);Mk(B,Od,ha);Mk(C,sc,H);var Wa=C|0,pb=(b[0]=a[Wa>>2],b[1]=a[Wa+4>>2],f[0]),ob=C+8|0,bb=(b[0]=a[ob>>2],b[1]=a[ob+4>>2],f[0]);Mk(P,Za,U);var qb=P|0,$=P+8|0,$a=R,jb=Oa,Ca=pb,Ia=bb,eb=(b[0]=a[qb>>2],b[1]=a[qb+4>>2],f[0]),ub=(b[0]=a[$>>2],b[1]=a[$+4>>2],f[0])}var kb=Ca+eb,fa=x+376|0;f[0]=kb;a[fa>>2]=b[0];a[fa+4>>2]=b[1];var vb=Ia+ub,xb=x+384|0;f[0]=vb;a[xb>>2]=b[0];a[xb+4>>2]=b[1];var Z=kb+$a,nb=x+392|0;f[0]=Z;a[nb>>2]=b[0];a[nb+4>>2]=b[1];var rb=vb+jb,lb=x+400|0;f[0]=rb;a[lb>>2]=b[0];a[lb+4>>2]=b[1];var Ta=x+348|0,cb=(b[0]=a[Ta>>2],b[1]=a[Ta+4>>2],f[0]),fb=x+316|0;f[0]=$a/cb;a[fb>>2]=b[0];a[fb+4>>2]=b[1];var Ua=x+324|0;f[0]=jb/cb;a[Ua>>2]=b[0];a[Ua+4>>2]=b[1];var sb=(b[0]=a[k],b[1]=a[k+1],f[0]),Na=kb*sb/72,Fb=(0>Na?Na-.5:Na+.5)&-1,Db=x+448|0;a[Db>>2]=Fb;var Ob=(b[0]=a[d],b[1]=a[d+1],f[0]),Eb=vb*Ob/72,ka=(0>Eb?Eb-.5:Eb+.5)&-1;a[e+113]=ka;var Bb=Z*sb/72,Ja=x+456|0,sa=Ja|0;a[sa>>2]=(0>Bb?Bb-.5:Bb+.5)&-1;var ra=rb*Ob/72,xf=x+460|0;a[xf>>2]=(0>ra?ra-.5:ra+.5)&-1;if(0!=(a[n]|0)){fo(T,Fb,ka);var qa=a[T+4>>2];a[Db>>2]=a[T>>2];a[Db+4>>2]=qa;fo(gb,a[sa>>2],a[xf>>2]);za=gb|0;g=za>>2;ma=gb+4|0;i=ma>>2;var ba=a[i],Q=Ja|0;a[Q>>2]=a[g];Ha=Ja+4|0;a[Ha>>2]=ba}h=p}function JD(b,r,i){var g=V(r|0,bE|0),r=(b+268|0)>>2;a[r]=0==(g|0)?cE|0:g;i=Hb(i);a[b+272>>2]=i;g=he(i,a[r]);if(0==(g|0)){return 0}for(var b=(b+276|0)>>2,q=i=0;;){var c=i+1|0;if((c|0)>(q|0)){var q=q+128|0,d=a[b],d=0==(d|0)?Cb(q<<2):wb(d,q<<2);a[b]=d}else{d=a[b]}a[d+(c<<2)>>2]=g;g=he(0,a[r]);if(0==(g|0)){break}else{i=c}}if(0==(c|0)){return 0}r=wb(a[b],(c<<2)+8|0);a[b]=r;a[r>>2]=0;a[a[b]+(i+2<<2)>>2]=0;return c}function GD(x){var r,i,g,q,c,d,k,n=h;h+=128;var e=n+32,p=n+64,j=n+96;k=(x+4|0)>>2;0<(a[k]|0)||sa(Fi|0,3408,dE|0,eE|0);var m=x|0,t=a[m>>2];d=t>>2;var u=a[d],w=a[d+1],A=a[d+2],B=a[d+3],C=t+16|0,P=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),T=t+24|0,gb=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0]),y=t+32|0,M=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),X=t+40|0,O=(b[0]=a[X>>2],b[1]=a[X+4>>2],f[0]);fs(n,t);var D=n|0,Da=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),ia=n+8|0,F=(b[0]=a[ia>>2],b[1]=a[ia+4>>2],f[0]),E=n+16|0,G=(b[0]=a[E>>2],b[1]=a[E+4>>2],f[0]),sc=n+24|0,J=(b[0]=a[sc>>2],b[1]=a[sc+4>>2],f[0]);if(0<(a[k]|0)){for(var H=e|0,I=e+8|0,hc=e+16|0,ca=e+24|0,K=j|0,L=j+8|0,zb=j+16|0,ja=j+24|0,aa=p|0,da=p+8|0,ea=p+16|0,xa=p+24|0,N=J,Od=G,ha=F,ga=Da,Zd=0,Rb=u,Xe=w,tb=A,ya=B,Q=P,wa=gb,Ab=M,Fa=O;;){if(0<(Zd|0)){var Ga=a[m>>2];r=Ga>>2;var W=Ga+48*Zd|0,ta=a[W>>2],Ka=a[r+(12*Zd|0)+1],za=a[r+(12*Zd|0)+2],ma=a[r+(12*Zd|0)+3],pa=Ga+48*Zd+16|0,S=(b[0]=a[pa>>2],b[1]=a[pa+4>>2],f[0]),Ha=Ga+48*Zd+24|0,Ra=(b[0]=a[Ha>>2],b[1]=a[Ha+4>>2],f[0]),V=Ga+48*Zd+32|0,U=(b[0]=a[V>>2],b[1]=a[V+4>>2],f[0]),La=Ga+48*Zd+40|0,Y=(b[0]=a[La>>2],b[1]=a[La+4>>2],f[0]);fs(e,W);var Ya=(b[0]=a[H>>2],b[1]=a[H+4>>2],f[0]),R=(b[0]=a[I>>2],b[1]=a[I+4>>2],f[0]),Za=(b[0]=a[hc>>2],b[1]=a[hc+4>>2],f[0]),la=(b[0]=a[ca>>2],b[1]=a[ca+4>>2],f[0]),ab=ga<Ya?ga:Ya,$a=ha<R?ha:R,jb=Od>Za?Od:Za,Ca=N>la?N:la,Ia=ta,eb=Ka,ub=za,Sa=ma,$=S,ua=Ra,Oa=U,Wa=Y}else{ab=ga,$a=ha,jb=Od,Ca=N,Ia=Rb,eb=Xe,ub=tb,Sa=ya,$=Q,ua=wa,Oa=Ab,Wa=Fa}if(0==(ub|0)){var pb=ab,ob=$a,bb=jb,qb=Ca}else{var fa=Ia|0,kb=Ia+8|0;hh(p,$,ua,(b[0]=a[fa>>2],b[1]=a[fa+4>>2],f[0]),(b[0]=a[kb>>2],b[1]=a[kb+4>>2],f[0]),1);var Z=(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]),vb=(b[0]=a[da>>2],b[1]=a[da+4>>2],f[0]),xb=(b[0]=a[ea>>2],b[1]=a[ea+4>>2],f[0]),ka=(b[0]=a[xa>>2],b[1]=a[xa+4>>2],f[0]),pb=ab<Z?ab:Z,ob=$a<vb?$a:vb,bb=jb>xb?jb:xb,qb=Ca>ka?Ca:ka}if(0==(Sa|0)){var nb=pb,rb=ob,lb=bb,Ta=qb}else{var cb=eb-1|0,fb=(cb<<4)+Ia|0,Ua=(cb<<4)+Ia+8|0;hh(j,Oa,Wa,(b[0]=a[fb>>2],b[1]=a[fb+4>>2],f[0]),(b[0]=a[Ua>>2],b[1]=a[Ua+4>>2],f[0]),1);var sb=(b[0]=a[K>>2],b[1]=a[K+4>>2],f[0]),Na=(b[0]=a[L>>2],b[1]=a[L+4>>2],f[0]),Fb=(b[0]=a[zb>>2],b[1]=a[zb+4>>2],f[0]),Db=(b[0]=a[ja>>2],b[1]=a[ja+4>>2],f[0]),nb=pb<sb?pb:sb,rb=ob<Na?ob:Na,lb=bb>Fb?bb:Fb,Ta=qb>Db?qb:Db}var Ob=Zd+1|0;if((Ob|0)<(a[k]|0)){N=Ta,Od=lb,ha=rb,ga=nb,Zd=Ob,Rb=Ia,Xe=eb,tb=ub,ya=Sa,Q=$,wa=ua,Ab=Oa,Fa=Wa}else{Eb=Ta;ne=lb;Bb=rb;Ja=nb;break}}ra=x+8|0;c=ra>>2;f[0]=Ja;a[c]=b[0];a[c+1]=b[1];qa=x+16|0;q=qa>>2;f[0]=Bb;a[q]=b[0];a[q+1]=b[1];ba=x+24|0;g=ba>>2;f[0]=ne;a[g]=b[0];a[g+1]=b[1];na=x+32|0}else{var Eb=J,ne=G,Bb=F,Ja=Da,ra=x+8|0;c=ra>>2;f[0]=Ja;a[c]=b[0];a[c+1]=b[1];var qa=x+16|0;q=qa>>2;f[0]=Bb;a[q]=b[0];a[q+1]=b[1];var ba=x+24|0;g=ba>>2;f[0]=ne;a[g]=b[0];a[g+1]=b[1];var na=x+32|0}i=na>>2;f[0]=Eb;a[i]=b[0];a[i+1]=b[1];h=n}function fs(x,r){var i=h,g=r,r=h;h+=48;for(var g=g>>2,q=r>>2,c=g+12;g<c;g++,q++){a[q]=a[g]}g=a[r+4>>2];0<(g|0)||sa(Fi|0,3382,gs|0,fE|0);1!=(g%3|0)&&sa(Fi|0,3383,gs|0,gE|0);var q=a[r>>2],c=q|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),d=q+8|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),k=1<(g|0);a:do{if(k){for(var n=c,e=d,p=c,j=d,m=1;;){var t=(m<<4)+q|0,u=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),t=(m<<4)+q+8|0,w=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),t=m+1|0,A=(t<<4)+q|0,B=(t<<4)+q+8|0,t=m+2|0,u=.5*(u+(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])),w=.5*(w+(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0])),n=n<u?n:u,e=e<w?e:w,p=p>u?p:u,j=j>w?j:w,u=(t<<4)+q|0,u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),t=(t<<4)+q+8|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),n=n<u?n:u,e=e<t?e:t,p=p>u?p:u,j=j>t?j:t,m=m+3|0;if((m|0)>=(g|0)){var C=n,P=e,T=p,gb=j;break a}}}else{C=c,P=d,T=c,gb=d}}while(0);g=x|0;f[0]=C;a[g>>2]=b[0];a[g+4>>2]=b[1];C=x+8|0;f[0]=P;a[C>>2]=b[0];a[C+4>>2]=b[1];P=x+16|0;f[0]=T;a[P>>2]=b[0];a[P+4>>2]=b[1];T=x+24|0;f[0]=gb;a[T>>2]=b[0];a[T+4>>2]=b[1];h=i}function wD(x,r,i){var g,q,c,d=r>>2,k=h;h+=156;var n;c=k>>2;var e=k+4,p=k+8,j=k+12,v=k+28,t=a[x+148>>2];a[c]=0;a[e>>2]=0;a[p>>2]=0;var u=wk(x);q=u>>2;a[q+1]=3;a[q+2]=r;a[q+3]=9;0!=(i|0)&&0!=(a[d+6]|0)&&Ke(x,i);var w=a[hs>>2];if(0!=(w|0)){var A=r|0,B=mb(A,a[w+8>>2]);0!=(B|0)&&0!=m[B]<<24>>24&&Zr(x,Xb(A,w,1,0))}if(0!=(t&16777216|0)){var C=a[d+4];if(2<(D[a[C+20>>2]+206>>1]&65535)){var P=a[C+148>>2]+16|0,T=72*(b[0]=a[P>>2],b[1]=a[P+4>>2],f[0]),gb=u+116|0;f[0]=(0>T?T-.5:T+.5)&-1|0;a[gb>>2]=b[0];a[gb+4>>2]=b[1];var y=a[a[d+3]+148>>2]+16|0,M=72*(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),X=u+124|0;f[0]=(0>M?M-.5:M+.5)&-1|0;a[X>>2]=b[0];a[X+4>>2]=b[1]}else{g=(u+116|0)>>2,a[g]=0,a[g+1]=0,a[g+2]=0,a[g+3]=0}}if(0!=(t&32768|0)){var O=a[d+27];if(0==(O|0)){var Dn=a[q+33]}else{var Da=a[O>>2],Dn=a[q+33]=Da}var ia=u+136|0;a[ia>>2]=Dn;var F=u+144|0;a[F>>2]=Dn;var E=u+140|0;a[E>>2]=Dn;var Tf=a[d+30];0!=(Tf|0)&&(a[ia>>2]=a[Tf>>2]);var sc=a[d+29];0!=(sc|0)&&(a[E>>2]=a[sc>>2]);var AC=a[d+28];0!=(AC|0)&&(a[F>>2]=a[AC>>2])}var H=0==(t&65536|0);a:do{if(H){var I=0}else{fc(j,128,v|0);var hc=r|0;a[q+38]=ec(Kn(x,hc,j),hc);uc(j);var ca=V(hc,Ni|0);if(0==(ca|0)){n=1867}else{if(0==m[ca]<<24>>24){n=1867}else{var K=ca;n=1869}}if(1867==n){var L=V(hc,Oi|0);if(0==(L|0)){var zb=0}else{0==m[L]<<24>>24?zb=0:(K=L,n=1869)}}1869==n&&(zb=ec(K,hc));var ja=V(hc,hE|0);if(0==(ja|0)){n=1872}else{if(0==m[ja]<<24>>24){n=1872}else{var aa=ja;n=1874}}if(1872==n){var da=V(hc,iE|0);0!=(da|0)&&0!=m[da]<<24>>24?(aa=da,n=1874):0!=(zb|0)&&(a[q+37]=Hb(zb))}1874==n&&(a[q+37]=ec(aa,hc));var ea=V(hc,jE|0);if(0==(ea|0)){n=1879}else{if(0==m[ea]<<24>>24){n=1879}else{var xa=ea;n=1881}}if(1879==n){var N=V(hc,kE|0);0!=(N|0)&&0!=m[N]<<24>>24?(xa=N,n=1881):0!=(zb|0)&&(a[q+39]=Hb(zb))}1881==n&&(a[q+39]=ec(xa,hc));var Od=V(hc,lE|0);if(0==(Od|0)){n=1886}else{if(0==m[Od]<<24>>24){n=1886}else{var ha=Od;n=1888}}if(1886==n){var ga=V(hc,mE|0);0!=(ga|0)&&0!=m[ga]<<24>>24?(ha=ga,n=1888):0!=(zb|0)&&(a[q+40]=Hb(zb))}if(1888==n){a[q+40]=ec(ha,hc);var Zd=u+200|0;a[Zd>>2]|=128}var Rb=V(hc,nE|0);if(0==(Rb|0)){n=1893}else{if(0==m[Rb]<<24>>24){n=1893}else{var Q=Rb}}do{if(1893==n){var tb=V(hc,oE|0);if(0!=(tb|0)&&0!=m[tb]<<24>>24){Q=tb}else{if(0==(zb|0)){I=0;break a}a[q+41]=Hb(zb);I=zb;break a}}}while(0);a[q+41]=ec(Q,hc);var ya=u+200|0;a[ya>>2]|=256;I=zb}}while(0);var W=0==(t&8388608|0);a:do{if(W){var wa=0}else{var Ab=r|0,Fa=V(Ab,is|0),Ga=0==(Fa|0)?0:0==m[Fa]<<24>>24?0:ec(Fa,Ab),S=V(Ab,pE|0);if(0==(S|0)){n=1905}else{if(0==m[S]<<24>>24){n=1905}else{var ta=u+200|0;a[ta>>2]|=64;a[q+46]=ec(S,Ab)}}1905==n&&0!=(Ga|0)&&(a[q+46]=Hb(Ga));var Ka=V(Ab,qE|0);0==(Ka|0)?n=1910:0==m[Ka]<<24>>24?n=1910:a[q+47]=ec(Ka,Ab);1910==n&&0!=(Ga|0)&&(a[q+47]=Hb(Ga));var za=V(Ab,rE|0);if(0==(za|0)){n=1915}else{if(0==m[za]<<24>>24){n=1915}else{a[q+48]=ec(za,Ab);var ma=u+200|0;a[ma>>2]|=16}}1915==n&&0!=(Ga|0)&&(a[q+48]=Hb(Ga));var pa=V(Ab,sE|0);do{if(0!=(pa|0)&&0!=m[pa]<<24>>24){var U=u+200|0;a[U>>2]|=32;a[q+49]=ec(pa,Ab);wa=Ga;break a}}while(0);0==(Ga|0)?wa=0:(a[q+49]=Hb(Ga),wa=Ga)}}while(0);var Ha=0==(t&4194304|0);a:do{if(!Ha){var Ra=r|0,Y=V(Ra,Pi|0);if(0==(Y|0)){n=1925}else{if(0==m[Y]<<24>>24){n=1925}else{var R=Y;n=1927}}if(1925==n){var La=V(Ra,tE|0);if(0!=(La|0)&&0!=m[La]<<24>>24){R=La,n=1927}else{var la=a[q+33];0!=(la|0)&&(a[q+42]=Hb(la))}}if(1927==n){a[q+42]=ec(R,Ra);var Ya=u+200|0;a[Ya>>2]|=1}var $=V(Ra,uE|0);if(0==($|0)){n=1933}else{if(0==m[$]<<24>>24){n=1933}else{a[q+43]=ec($,Ra);var Za=u+200|0;a[Za>>2]|=8}}if(1933==n){var fa=a[q+33];0!=(fa|0)&&(a[q+43]=Hb(fa))}var ab=V(Ra,vE|0);if(0==(ab|0)){n=1938}else{if(0==m[ab]<<24>>24){n=1938}else{a[q+44]=ec(ab,Ra);var $a=u+200|0;a[$a>>2]|=2}}if(1938==n){var jb=a[q+35];0!=(jb|0)&&(a[q+44]=Hb(jb))}var Ca=V(Ra,wE|0);do{if(0!=(Ca|0)&&0!=m[Ca]<<24>>24){a[q+45]=ec(Ca,Ra);var Ia=u+200|0;a[Ia>>2]|=4;break a}}while(0);var eb=a[q+36];0!=(eb|0)&&(a[q+45]=Hb(eb))}}while(0);G(I);G(wa);do{if(0!=(t&4259840|0)){var ub=a[d+6];if(0!=(ub|0)&&!(0==(a[q+37]|0)&&0==(a[q+42]|0))&&0!=(t&524288|0)){var Sa=a[x+16>>2]+96|0,Z=.5*(b[0]=a[Sa>>2],b[1]=a[Sa+4>>2],f[0]),ua=2<Z?Z:2,Oa=a[ub+4>>2];if(0<(Oa|0)){for(var Wa=ub|0,pb=0;;){xE(k,e,p,a[Wa>>2]+48*pb|0,ua);var ob=pb+1|0;if((ob|0)==(Oa|0)){break}else{pb=ob}}var bb=a[p>>2],qb=a[e>>2]}else{qb=bb=0}a[q+54]=bb;a[q+55]=qb;if(0==(t&8192|0)){var ka=0<(bb|0);a:do{if(ka){for(var kb=0,sa=0;;){var vb=a[qb+(kb<<2)>>2]+sa|0,xb=kb+1|0;if((xb|0)<(bb|0)){kb=xb,sa=vb}else{var hd=vb;break a}}}else{hd=0}}while(0);var nb=a[c];Re(x,nb,nb,hd);var rb=nb}else{rb=a[c]}a[q+56]=rb;a[q+51]=2;a[q+53]=rb;a[q+52]=a[qb>>2]}}}while(0);var lb=a[x+60>>2];if(0!=(lb|0)){var Ta=a[lb+64>>2];if(0!=(Ta|0)){J[Ta](x)}}var cb=a[q+37];0==(cb|0)&&0==(a[q+50]&1|0)||ad(x,cb,a[q+42],a[q+46],a[q+38]);h=k}function xD(x,r,i){var g,q,c,d,k,n,e,p,j,v,t,u,w,A,B,C,P=h;h+=64;var T,gb=P+16,y=P+32,M=P+48,X=a[x+16>>2]+96|0,O=(b[0]=a[X>>2],b[1]=a[X+4>>2],f[0]),D=r|0;Bk(V(D,lh|0));C=(r+24|0)>>2;if(0!=(a[C]|0)){for(var Da=Xb(D,a[uk>>2],1,0),ia=jc(D,a[go>>2],Y|0),F=ia,E=0,J=0;;){var sc=m[F];if(58==sc<<24>>24){var H=E+1|0,I=J}else{if(44==sc<<24>>24){H=E,I=J+1|0}else{if(0==sc<<24>>24){break}else{H=E,I=J}}}F=F+1|0;E=H;J=I}var K=0==(E|0);if(0==(J|0)|K){var hc=ia}else{if(0!=(yE(x,r,i,ia,E+1|0,Da,O)|0)){hc=Ac|0}else{h=P;return}}var ca=r+127|0,L=m[ca]&255;if(0==(L&1|0)){if(0!=(L&2|0)){var N=Aa(D,a[zE>>2],ho(hc,Dk|0)),zb=Aa(D,a[AE>>2],Ek|0);T=1982}else{if(0!=(L&8|0)){N=Aa(D,a[BE>>2],ho(hc,Fk|0)),zb=Aa(D,a[CE>>2],Gk|0),T=1982}else{if(0==(L&4|0)){var ja=hc}else{N=Aa(D,a[DE>>2],ho(hc,Hk|0)),zb=Aa(D,a[EE>>2],Ik|0),T=1982}}}}else{N=Aa(D,a[FE>>2],ho(hc,Jk|0)),zb=Aa(D,a[GE>>2],Kk|0),T=1982}1982==T&&((N|0)!=(hc|0)&&Pa(x,N),(zb|0)!=(hc|0)&&$b(x,zb),ja=N);if(K){0==(m[ca]&3)<<24>>24&&(0==m[ja]<<24>>24?(Pa(x,Ac|0),$b(x,Ac|0)):(Pa(x,ja),$b(x,ja)));var aa=a[C];if(0<(a[aa+4>>2]|0)){for(var da=x+148|0,ea=0==(i|0),xa=0,Q=aa;;){var Od=a[Q>>2];B=Od>>2;var ha=a[B+(12*xa|0)],ga=a[B+(12*xa|0)+1],Zd=a[B+(12*xa|0)+2],Rb=a[B+(12*xa|0)+3],W=Od+48*xa+16|0,tb=(b[0]=a[W>>2],b[1]=a[W+4>>2],f[0]),ya=Od+48*xa+24|0,S=(b[0]=a[ya>>2],b[1]=a[ya+4>>2],f[0]),wa=Od+48*xa+32|0,Ab=(b[0]=a[wa>>2],b[1]=a[wa+4>>2],f[0]),Fa=Od+48*xa+40|0,Ga=(b[0]=a[Fa>>2],b[1]=a[Fa+4>>2],f[0]);if(0==(a[da>>2]&16384|0)){$f(x,ha,ga,0,0,0);if(0!=(Zd|0)){var U=ha|0,ta=ha+8|0;Ci(x,2,tb,S,(b[0]=a[U>>2],b[1]=a[U+4>>2],f[0]),(b[0]=a[ta>>2],b[1]=a[ta+4>>2],f[0]),Da,O,Zd)}if(0!=(Rb|0)){var Ka=ga-1|0,za=(Ka<<4)+ha|0,ma=(Ka<<4)+ha+8|0;Ci(x,3,Ab,Ga,(b[0]=a[za>>2],b[1]=a[za+4>>2],f[0]),(b[0]=a[ma>>2],b[1]=a[ma+4>>2],f[0]),Da,O,Rb)}1<(a[a[C]+4>>2]|0)&&(0==(Rb|Zd|0)|ea||Ke(x,i))}else{$f(x,ha,ga,Zd,Rb,0)}var pa=xa+1|0,R=a[C];if((pa|0)<(a[R+4>>2]|0)){xa=pa,Q=R}else{break}}}}else{var Ha=a[a[C]+4>>2],Ra=48*Ha|0,la=Gb(Ra);A=la>>2;var $=Gb(Ra);w=$>>2;var La=.5*(E+2|0),fa=0<(Ha|0);a:do{if(fa){u=M>>2;t=P>>2;v=y>>2;j=gb>>2;for(var Ya=0,Z=0,Za=0;;){var ka=a[a[C]>>2];p=ka>>2;var ab=a[p+(12*Za|0)],$a=a[p+(12*Za|0)+1],jb=a[p+(12*Za|0)+2],Ca=a[p+(12*Za|0)+3],Ia=ka+48*Za+16|0,eb=(b[0]=a[Ia>>2],b[1]=a[Ia+4>>2],f[0]),ub=ka+48*Za+24|0,Sa=(b[0]=a[ub>>2],b[1]=a[ub+4>>2],f[0]),sa=ka+48*Za+32|0,ua=(b[0]=a[sa>>2],b[1]=a[sa+4>>2],f[0]),Oa=ka+48*Za+40|0,Wa=(b[0]=a[Oa>>2],b[1]=a[Oa+4>>2],f[0]);a[A+(12*Za|0)+1]=$a;a[w+(12*Za|0)+1]=$a;var pb=$a<<4,ob=Gb(pb);a[A+(12*Za|0)]=ob;var bb=Gb(pb);a[w+(12*Za|0)]=bb;var qb=ab|0,ra=(b[0]=a[qb>>2],b[1]=a[qb+4>>2],f[0]),kb=ab+8|0,ie=(b[0]=a[kb>>2],b[1]=a[kb+4>>2],f[0]),vb=$a-1|0,xb=0<(vb|0);b:do{if(xb){for(var hd=Ya,nb=Z,rb=ra,lb=ie,Ta=0;;){var cb=Ta+1|0,fb=(cb<<4)+ab|0,Ua=(b[0]=a[fb>>2],b[1]=a[fb+4>>2],f[0]),sb=(cb<<4)+ab+8|0,Na=(b[0]=a[sb>>2],b[1]=a[sb+4>>2],f[0]),Fb=(Ta<<4)+ob|0;0==(Ta|0)?(js(P,rb,lb,Ua,Na),e=Fb>>2,a[e]=a[t],a[e+1]=a[t+1],a[e+2]=a[t+2],a[e+3]=a[t+3]):(js(gb,hd,nb,Ua,Na),n=Fb>>2,a[n]=a[j],a[n+1]=a[j+1],a[n+2]=a[j+2],a[n+3]=a[j+3]);var Db=Ta+2|0,Ob=(Db<<4)+ab|0,Eb=(b[0]=a[Ob>>2],b[1]=a[Ob+4>>2],f[0]),ne=(Db<<4)+ab+8|0,Bb=(b[0]=a[ne>>2],b[1]=a[ne+4>>2],f[0]),Ja=Ta+3|0,qa=(Ja<<4)+ab|0,ba=(b[0]=a[qa>>2],b[1]=a[qa+4>>2],f[0]),na=(Ja<<4)+ab+8|0,oa=(b[0]=a[na>>2],b[1]=a[na+4>>2],f[0]),Ba=(cb<<4)+ob|0,Wf=(Db<<4)+ob|0,ic=y,Ea=rb,va=lb,Cb=ba,Ma=oa,wb=Ua-Eb,pc=Na-Bb,Wc=$c(wb*wb+pc*pc);if(1e-4>Wc){var Vb=Ea-Cb,Xd=va-Ma,Qa=$c(Vb*Vb+Xd*Xd+1e-4),Va=Vb,hb=Xd}else{Qa=Wc,Va=wb,hb=pc}var ib=2/Qa,Ib=ib*-Va,lc=ic|0;f[0]=hb*ib;a[lc>>2]=b[0];a[lc+4>>2]=b[1];var yb=ic+8|0;f[0]=Ib;a[yb>>2]=b[0];a[yb+4>>2]=b[1];k=Wf>>2;a[k]=a[v];a[k+1]=a[v+1];a[k+2]=a[v+2];a[k+3]=a[v+3];d=Ba>>2;a[d]=a[v];a[d+1]=a[v+1];a[d+2]=a[v+2];a[d+3]=a[v+3];var Jd=Fb|0,Nb=rb-La*(b[0]=a[Jd>>2],b[1]=a[Jd+4>>2],f[0]),Hc=(Ta<<4)+bb|0;f[0]=Nb;a[Hc>>2]=b[0];a[Hc+4>>2]=b[1];var mb=(Ta<<4)+ob+8|0,oe=lb-La*(b[0]=a[mb>>2],b[1]=a[mb+4>>2],f[0]),db=(Ta<<4)+bb+8|0;f[0]=oe;a[db>>2]=b[0];a[db+4>>2]=b[1];var Qb=Ba|0,tc=Ua-La*(b[0]=a[Qb>>2],b[1]=a[Qb+4>>2],f[0]),Sc=(cb<<4)+bb|0;f[0]=tc;a[Sc>>2]=b[0];a[Sc+4>>2]=b[1];var Lb=(cb<<4)+ob+8|0,Pb=Na-La*(b[0]=a[Lb>>2],b[1]=a[Lb+4>>2],f[0]),Jb=(cb<<4)+bb+8|0;f[0]=Pb;a[Jb>>2]=b[0];a[Jb+4>>2]=b[1];var rd=Wf|0,oc=Eb-La*(b[0]=a[rd>>2],b[1]=a[rd+4>>2],f[0]),EC=(Db<<4)+bb|0;f[0]=oc;a[EC>>2]=b[0];a[EC+4>>2]=b[1];var qk=(Db<<4)+ob+8|0,ve=Bb-La*(b[0]=a[qk>>2],b[1]=a[qk+4>>2],f[0]),Rd=(Db<<4)+bb+8|0;f[0]=ve;a[Rd>>2]=b[0];a[Rd+4>>2]=b[1];if((Ja|0)<(vb|0)){hd=Eb,nb=Bb,rb=ba,lb=oa,Ta=Ja}else{var Bc=Eb,Sd=Bb,fd=ba,Kb=oa,yc=Ja;break b}}}else{Bc=Ya,Sd=Z,fd=ra,Kb=ie,yc=0}}while(0);var Yb=(yc<<4)+ob|0;js(M,Bc,Sd,fd,Kb);c=Yb>>2;a[c]=a[u];a[c+1]=a[u+1];a[c+2]=a[u+2];a[c+3]=a[u+3];var Mb=Yb|0,Tc=fd-La*(b[0]=a[Mb>>2],b[1]=a[Mb+4>>2],f[0]),Wb=(yc<<4)+bb|0;f[0]=Tc;a[Wb>>2]=b[0];a[Wb+4>>2]=b[1];var Mc=(yc<<4)+ob+8|0,id=Kb-La*(b[0]=a[Mc>>2],b[1]=a[Mc+4>>2],f[0]),Tb=(yc<<4)+bb+8|0;f[0]=id;a[Tb>>2]=b[0];a[Tb+4>>2]=b[1];var Sb=Za+1|0;if((Sb|0)==(Ha|0)){var uc=Wa,mf=ua,nf=Sa,ec=eb,af=Ca,yf=jb,Td=vb,Fe=ab;break a}else{Ya=Bc,Z=Sd,Za=Sb}}}}while(0);var gf=Hb(ja),fe=he(gf,zf|0),fh=0==(fe|0);a:do{if(fh){var df=ja,jd=ja}else{for(var md=ja,je=ja,Qe=ja,Xf=fe,Uc=0;;){var bf=0==m[Xf]<<24>>24?Ac|0:Xf;if((bf|0)==(md|0)){var rk=md}else{0==(m[ca]&3)<<24>>24&&(Pa(x,bf),$b(x,bf)),rk=bf}var Zb=0==(Uc|0),mc=Zb?bf:Qe,ef=1==(Uc|0)?bf:Zb?bf:je;b:do{if(fa){for(var kd=0;;){var qc=a[w+(12*kd|0)],En=a[A+(12*kd|0)],sk=$+48*kd+4|0,kc=a[sk>>2],bc=0<(kc|0);c:do{if(bc){for(var nd=0;;){var zd=(nd<<4)+En|0;q=((nd<<4)+qc|0)>>2;var cf=(b[0]=a[zd>>2],b[1]=a[zd+4>>2],f[0])+(b[0]=a[q],b[1]=a[q+1],f[0]);f[0]=cf;a[q]=b[0];a[q+1]=b[1];var rc=(nd<<4)+En+8|0;g=((nd<<4)+qc+8|0)>>2;var fc=(b[0]=a[rc>>2],b[1]=a[rc+4>>2],f[0])+(b[0]=a[g],b[1]=a[g+1],f[0]);f[0]=fc;a[g]=b[0];a[g+1]=b[1];var zi=nd+1|0,we=a[sk>>2];if((zi|0)<(we|0)){nd=zi}else{var pe=we;break c}}}else{pe=kc}}while(0);$f(x,qc,pe,0,0,0);var ac=kd+1|0;if((ac|0)==(Ha|0)){break b}else{kd=ac}}}}while(0);var Kd=he(0,zf|0);if(0==(Kd|0)){df=ef;jd=mc;break a}else{md=rk,je=ef,Qe=mc,Xf=Kd,Uc=Uc+1|0}}}}while(0);if(0==(yf|0)){var Dd=0}else{if(0==(df|0)){var dc=0}else{0==(m[ca]&3)<<24>>24&&(Pa(x,df),$b(x,df)),dc=df}var nc=Fe|0,Ye=Fe+8|0;Ci(x,2,ec,nf,(b[0]=a[nc>>2],b[1]=a[nc+4>>2],f[0]),(b[0]=a[Ye>>2],b[1]=a[Ye+4>>2],f[0]),Da,O,yf);Dd=dc}if(0!=(af|0)){(Dd|0)!=(jd|0)&&0==(m[ca]&3)<<24>>24&&(Pa(x,jd),$b(x,jd));var Ad=(Td<<4)+Fe|0,Ud=(Td<<4)+Fe+8|0;Ci(x,3,mf,uc,(b[0]=a[Ad>>2],b[1]=a[Ad+4>>2],f[0]),(b[0]=a[Ud>>2],b[1]=a[Ud+4>>2],f[0]),Da,O,af)}G(gf);a:do{if(fa){for(var Vd=0;;){G(a[A+(12*Vd|0)]);G(a[w+(12*Vd|0)]);var gc=Vd+1|0;if((gc|0)==(Ha|0)){break a}else{Vd=gc}}}}while(0);G(la);G($)}}h=P}function yD(x){var r,i,g,q,c=a[x+16>>2];r=c>>2;var d=a[r+2];g=c+148|0;0==(a[g>>2]|0)?0!=(a[r+50]&1|0)&&(q=2041):q=2041;a:do{if(2041==q){Se(x);i=c+216|0;var k=a[i>>2];if(0!=(k|0)){var n=c+220|0;if(1<(k|0)){for(var e=a[n>>2],k=c+208|0,h=c+224|0,j=c+212|0,m=c+168|0,t=c+184|0,u=c+152|0,w=1,A=a[e>>2];;){if(a[k>>2]=a[e+(w<<2)>>2],a[j>>2]=(A<<4)+a[h>>2]|0,ad(x,a[g>>2],a[m>>2],a[t>>2],a[u>>2]),Se(x),e=a[n>>2],A=a[e+(w<<2)>>2]+A|0,w=w+1|0,(w|0)>=(a[i>>2]|0)){break a}}}}}}while(0);a[r+52]=0;a[r+53]=0;q=(d+24|0)>>2;g=a[q];0==(g|0)?r=c+200|0:(g=a[g>>2],n=a[g>>2],0==(a[g+8>>2]|0)?(i=n|0,n=n+8|0):(i=g+16|0,n=g+24|0),g=c+200|0,k=a[g>>2],HE(x,(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),k<<24>>31&255,a[r+40],k<<30>>31&255),i=a[q],n=a[i+4>>2]-1|0,k=a[i>>2],i=k>>2,0==(a[i+(12*n|0)+3]|0)?(k=a[i+(12*n|0)],n=a[i+(12*n|0)+1]-1|0,i=(n<<4)+k|0,n=(n<<4)+k+8|0):(i=k+48*n+32|0,n=k+48*n+40|0),k=a[g>>2],HE(x,(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),k<<23>>31&255,a[r+41],k<<29>>31&255),r=g);g=r>>2;j=a[d+108>>2];m=a[g]<<28>>31;h=c+156|0;t=a[h>>2];k=c+172|0;u=a[k>>2];n=c+188|0;w=a[n>>2];r=(c+152|0)>>2;A=a[r];i=d|0;e=0==re(jc(i,a[io>>2],Ze|0))<<24>>24?0:a[q];Qi(x,j,11,m,t,u,w,A,e);j=a[d+120>>2];m=a[g]<<28>>31;h=a[h>>2];k=a[k>>2];n=a[n>>2];t=a[r];0==re(jc(i,a[io>>2],Ze|0))<<24>>24?Qi(x,j,11,m,h,k,n,t,0):(q=a[q],Qi(x,j,11,m,h,k,n,t,q));q=a[(d+112|0)>>2];i=a[g];i=i<<29>>31;n=a[(c+164|0)>>2];k=a[(c+180|0)>>2];h=a[(c+196|0)>>2];j=a[r];Qi(x,q,7,i,n,k,h,j,0);d=a[(d+116|0)>>2];q=a[g];q=q<<30>>31;g=a[(c+160|0)>>2];i=a[(c+176|0)>>2];c=a[(c+192|0)>>2];r=a[r];Qi(x,d,6,q,g,i,c,r,0);c=a[x+60>>2];if(0!=(c|0)&&(c=a[c+68>>2],0!=(c|0))){J[c](x)}Ei(x)}function HE(b,r,i,g,q,c){var d=a[b+16>>2],g=0==g<<24>>24?a[d+148>>2]:q;0==c<<24>>24&&0==(g|0)&0==(a[d+200>>2]&1|0)||IE(b,r,i)}function Qi(b,r,i,g,q,c,d,f,n){var e=h,p=a[b+148>>2];if(0!=(r|0)){if(0==(f|0)){f=0}else{var s=fa(Ba(f)+11|0);if(11==(i|0)){var m=dh|0}else{7==(i|0)?m=ks|0:6==(i|0)?m=ls|0:sa(Fi|0,2201,JE|0,vd|0)}Ma(s,KE|0,(j=h,h+=8,a[j>>2]=f,a[j+4>>2]=m,j));f=s}var s=b+16|0,t=a[s>>2]+12|0,m=a[t>>2];a[t>>2]=i;g=0==(q|0)&0==(g|0);!g&&0==(p&4|0)&&(ms(b,r),ad(b,q,c,d,f));Fg(b,i,r);0!=(n|0)&&LE(b,r,n);g||(0!=(p&4|0)&&(ms(b,r),ad(b,q,c,d,f)),Se(b));0!=(f|0)&&G(f);a[a[s>>2]+12>>2]=m}h=e}function ME(x,r,i){var g=x|0;f[0]=r;a[g>>2]=b[0];a[g+4>>2]=b[1];x=x+8|0;f[0]=i;a[x>>2]=b[0];a[x+4>>2]=b[1]}function ms(x,r){var i,g,q,c,d;i=a[x+16>>2];d=i>>2;var k=a[x+148>>2];if(0!=(k&4259840|0)){var n=0!=(k&131072|0);g=i+204|0;n?(a[g>>2]=0,a[d+52]=2):(a[g>>2]=2,a[d+52]=4);i=i+212|0;G(a[i>>2]);d=fa(a[d+52]<<4);a[i>>2]=d;c=(r+56|0)>>2;q=(r+24|0)>>2;i=(b[0]=a[c],b[1]=a[c+1],f[0])-.5*(b[0]=a[q],b[1]=a[q+1],f[0]);f[0]=i;a[d>>2]=b[0];a[d+4>>2]=b[1];g=(r+64|0)>>2;i=(r+32|0)>>2;var e=(b[0]=a[g],b[1]=a[g+1],f[0])-.5*(b[0]=a[i],b[1]=a[i+1],f[0]),h=d+8|0;f[0]=e;a[h>>2]=b[0];a[h+4>>2]=b[1];q=(b[0]=a[c],b[1]=a[c+1],f[0])+.5*(b[0]=a[q],b[1]=a[q+1],f[0]);c=d+16|0;f[0]=q;a[c>>2]=b[0];a[c+4>>2]=b[1];i=(b[0]=a[g],b[1]=a[g+1],f[0])+.5*(b[0]=a[i],b[1]=a[i+1],f[0]);g=d+24|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];0==(k&8192|0)&&Re(x,d,d,2);n||Mn(d)}}function LE(x,r,i){var g,q,c,d,k,n,e=h;h+=96;c=e+48;q=e+64;g=e+80;for(n=a[r>>2];;){var p=m[n];if(0==p<<24>>24){k=2112;break}if(0==(ah(p&255)|0)){break}else{n=n+1|0}}2112!=k&&0!=m[n]<<24>>24&&(k=r+24|0,p=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),k=r+32|0,d=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),n=(r+56|0)>>2,k=(r+64|0)>>2,ME(c,(b[0]=a[n],b[1]=a[n+1],f[0])+.5*p,(b[0]=a[k],b[1]=a[k+1],f[0])-.5*d),d=e>>2,c>>=2,a[d]=a[c],a[d+1]=a[c+1],a[d+2]=a[c+2],a[d+3]=a[c+3],c=e|0,d=e+8|0,ME(q,(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])-p,(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])),c=(e+16|0)>>2,q>>=2,a[c]=a[q],a[c+1]=a[q+1],a[c+2]=a[q+2],a[c+3]=a[q+3],NE(g,i,(b[0]=a[n],b[1]=a[n+1],f[0]),(b[0]=a[k],b[1]=a[k+1],f[0])),i=(e+32|0)>>2,g>>=2,a[i]=a[g],a[i+1]=a[g+1],a[i+2]=a[g+2],a[i+3]=a[g+3],Ke(x,a[a[x>>2]+296>>2]),Pa(x,a[r+8>>2]),Gd(x,e|0,3));h=e}function IE(x,r,i){var g,q=a[x+16>>2];g=q>>2;var c=a[x+148>>2];if(0!=(c&4259840|0)){var d=0!=(c&131072|0),k=q+204|0;d?(a[k>>2]=0,a[g+52]=2):(a[k>>2]=2,a[g+52]=4);q=q+212|0;G(a[q>>2]);g=fa(a[g+52]<<4);a[q>>2]=g;f[0]=r-3;a[g>>2]=b[0];a[g+4>>2]=b[1];q=g+8|0;f[0]=i-3;a[q>>2]=b[0];a[q+4>>2]=b[1];q=g+16|0;f[0]=r+3;a[q>>2]=b[0];a[q+4>>2]=b[1];r=g+24|0;f[0]=i+3;a[r>>2]=b[0];a[r+4>>2]=b[1];0==(c&8192|0)&&Re(x,g,g,2);d||Mn(g)}}function yE(x,r,i,g,q,c,d){var k=h;h+=196;var n=k+48,e=k+96,p=k+144,s=k+192,g=OE(g,q,s);if(1<(g|0)){var q=a[r+16>>2],m=0!=(a[a[q+20>>2]>>2]&16|0)?ns|0:os|0,t=a[a[r+12>>2]+12>>2];la(3,PE|0,(j=h,h+=12,a[j>>2]=a[q+12>>2],a[j+4>>2]=m,a[j+8>>2]=t,j));if(2==(g|0)){return h=k,1}}else{if(1==(g|0)){return h=k,1}}g=(r+24|0)>>2;q=a[g];m=0<(a[q+4>>2]|0);a:do{if(m){for(var t=k,u=k+8|0,w=k+12|0,A=0==(i|0),B=k+4|0,C=k|0,P=k+32|0,T=k+40|0,gb=k+16|0,y=k+24|0,M=e|0,X=e+4|0,O=n,D=p,Da=n|0,ia=p|0,F=p+4|0,E=a[s>>2],r=(E+4|0)>>2,J=0,sc=q;;){for(var H,I=(a[sc>>2]+48*J|0)>>2,K=t>>2,hc=I+12;I<hc;I++,K++){a[K]=a[I]}var sc=a[r]|0,ca=a[sc>>2],L=0==(ca|0);b:do{if(L){var N=H}else{for(var zb=H,ja=sc,aa=ca;;){Pa(x,aa);aa=ja+4|0;I=ib[aa>>2];if((ja|0)==(a[r]|0)){ps(k,I,e,p),aa=a[M>>2],$f(x,aa,a[X>>2],0,0,0)}else{if(1>I){I=D>>2;K=O>>2;for(hc=I+12;I<hc;I++,K++){a[K]=a[I]}ps(n,ib[aa>>2],e,p);G(a[Da>>2]);aa=a[M>>2];$f(x,aa,a[X>>2],0,0,0)}else{zb=a[ja>>2],aa=a[ia>>2],$f(x,aa,a[F>>2],0,0,0)}}G(aa);ja=ja+8|0;aa=a[ja>>2];if(0==(aa|0)){N=zb;break b}}}}while(0);sc=a[u>>2];H=0==(sc|0);H||(Pa(x,a[a[r]>>2]),$b(x,a[a[r]>>2]),zb=a[C>>2],ca=(b[0]=a[gb>>2],b[1]=a[gb+4>>2],f[0]),L=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),ja=zb|0,zb=zb+8|0,Ci(x,2,ca,L,(b[0]=a[ja>>2],b[1]=a[ja+4>>2],f[0]),(b[0]=a[zb>>2],b[1]=a[zb+4>>2],f[0]),c,d,sc));sc=a[w>>2];0==(sc|0)?ca=0:(Pa(x,N),$b(x,N),zb=a[B>>2]-1|0,aa=a[C>>2],ca=(b[0]=a[P>>2],b[1]=a[P+4>>2],f[0]),L=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0]),ja=(zb<<4)+aa|0,zb=(zb<<4)+aa+8|0,Ci(x,3,ca,L,(b[0]=a[ja>>2],b[1]=a[ja+4>>2],f[0]),(b[0]=a[zb>>2],b[1]=a[zb+4>>2],f[0]),c,d,sc),ca=sc);L=a[g];ja=a[L+4>>2];do{if(1<(ja|0)){if(H){if(0==(ca|0)|A){sc=L;zb=ja;break}}else{if(A){sc=L;zb=ja;break}}Ke(x,i);sc=zb=a[g];zb=a[zb+4>>2]}else{sc=L,zb=ja}}while(0);J=J+1|0;if((J|0)<(zb|0)){H=N}else{var da=E;break a}}}else{da=a[s>>2]}}while(0);G(da);h=k;return 0}function ho(b,r){for(var i=1,g=b;;){var q=m[g];if(0==q<<24>>24){break}else{i=58==q<<24>>24?i+1|0:i}g=g+1|0}g=(Ba(r)+1)*i|0;(a[qs>>2]|0)<(g|0)&&(g=g+10|0,a[qs>>2]=g,g=mc(a[Ri>>2],g),a[Ri>>2]=g);Rf(a[Ri>>2],r);i=i-1|0;g=a[Ri>>2];if(0==(i|0)){var c;return g}for(;;){if(q=g+Ba(g)|0,Pb=58,m[q]=Pb&255,Pb>>=8,m[q+1]=Pb&255,uf(g,r),i=i-1|0,g=a[Ri>>2],0==(i|0)){c=g;break}}return c}function js(x,r,i,g,q){r-=g;q=i-q;i=2/$c(r*r+q*q+1e-4);g=x|0;f[0]=q*i;a[g>>2]=b[0];a[g+4>>2]=b[1];x=x+8|0;f[0]=i*-r;a[x>>2]=b[0];a[x+4>>2]=b[1]}function OE(b,r,i){var g,q=h,c,d=fa(8);g=(r<<3)+8|0;fa(g);var f=Hb(b);a[d>>2]=f;var n=fa(g);g=n>>2;a[d+4>>2]=n;var e=n=0,p=0,f=he(f,zf|0);a:for(;0!=(f|0);){var s=r-1|0;do{if((p|0)==(s|0)){if(1>e){var v=Jc(f,44);0!=(v|0)&&(m[v]=0);a[(p<<3>>2)+g]=f;ib[((p<<3)+4>>2)+g]=1;v=n;t=r;u=e;w=p+1|0}else{var v=n,t=r,u=e,w=p}}else{w=f;t=e;v=h;h+=4;u=Jc(w,44);0==(u|0)?(la(1,QE|0,(j=h,h+=4,a[j>>2]=w,j)),t=-1):(w=u+1|0,m[u]=0,u=wg(w,v),t=(a[v>>2]|0)!=(w|0)&&u>=t&1>=u?u:-1);h=v;u=t;if(0>u){c=2180;break a}e<u?(a[(p<<3>>2)+g]=f,ib[((p<<3)+4>>2)+g]=(u-e)/(1-e),v=n,t=r,w=p+1|0):(m[Nk]?v=n:(la(0,RE|0,(j=h,h+=4,a[j>>2]=b,j)),m[Nk]=1,v=3),t=s,u=e,w=p)}}while(0);n=v;r=t;e=u;p=w;f=he(0,zf|0)}if(2180==c){return m[Nk]?b=1:(la(1,SE|0,(j=h,h+=4,a[j>>2]=b,j)),m[Nk]=1,b=2),TE(d),h=q,b}0==(p|0)?(TE(d),d=1):(a[i>>2]=d,d=n);h=q;return d}function ps(x,r,i,g){var q,c,d,k,n,e=h;h+=32;var p=e+16,j=a[x+4>>2],m=j-1|0;k=(m|0)/3&-1;if(3>(j-4|0)>>>0){a[i+4>>2]=4;p=i|0;a[p>>2]=fa(64);a[g+4>>2]=4;var t=fa(64);a[g>>2]=t;Ld(e,a[x>>2],3,r,a[p>>2],t)}else{j=fa(k<<3);x=(x|0)>>2;m=2<(m|0);a:do{if(m){var u=0;d=0;for(n=a[x];;){q=n;c=q|0;var w=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);c=q+16|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);var A=w-c,w=q+8|0,B=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),w=q+24|0,w=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),B=B-w,B=$c(A*A+B*B),A=q+32|0,A=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]),C=c-A;c=q+40|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);w-=c;w=B+$c(C*C+w*w);B=q+48|0;A-=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]);q=q+56|0;q=c-(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);q=w+$c(A*A+q*q);c=(u<<3)+j|0;f[0]=q;a[c>>2]=b[0];a[c+4>>2]=b[1];d+=q;u=u+1|0;if((u|0)<(k|0)){n=n+48|0}else{var P=d;break a}}}else{P=0}}while(0);r*=P;for(P=m=0;;){if((P|0)>=(k|0)){t=m;break}n=(P<<3)+j|0;m+=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);if(m<r){P=P+1|0}else{t=m;break}}m=3*P|0;u=m+4|0;n=(i+4|0)>>2;a[n]=u;i=(i|0)>>2;a[i]=fa(u<<4);u=3*(k-P)+1|0;k=(g+4|0)>>2;a[k]=u;g=(g|0)>>2;a[g]=fa(u<<4);if(0<(a[n]|0)){for(u=0;;){if(q=((u<<4)+a[i]|0)>>2,d=((u<<4)+a[x]|0)>>2,a[q]=a[d],a[q+1]=a[d+1],a[q+2]=a[d+2],a[q+3]=a[d+3],d=u+1|0,(d|0)<(a[n]|0)){u=d}else{break}}n=u-3|0}else{n=-4}u=0<(a[k]|0);a:do{if(u){w=0;for(d=n;;){c=((w<<4)+a[g]|0)>>2;q=((d<<4)+a[x]|0)>>2;a[c]=a[q];a[c+1]=a[q+1];a[c+2]=a[q+2];a[c+3]=a[q+3];q=w+1|0;if((q|0)>=(a[k]|0)){break a}w=q;d=d+1|0}}}while(0);k=(P<<3)+j|0;k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);Ld(p,(m<<4)+a[x]|0,3,(r-(t-k))/k,(m<<4)+a[i]|0,a[g]);G(j)}h=e}function TE(b){G(a[b>>2]);G(a[b+4>>2]);G(b)}function ph(x,r){var i,g=h;i=x>>2;x=h;h+=32;a[x>>2]=a[i];a[x+4>>2]=a[i+1];a[x+8>>2]=a[i+2];a[x+12>>2]=a[i+3];a[x+16>>2]=a[i+4];a[x+20>>2]=a[i+5];a[x+24>>2]=a[i+6];a[x+28>>2]=a[i+7];i=r>>2;r=h;h+=32;a[r>>2]=a[i];a[r+4>>2]=a[i+1];a[r+8>>2]=a[i+2];a[r+12>>2]=a[i+3];a[r+16>>2]=a[i+4];a[r+20>>2]=a[i+5];a[r+24>>2]=a[i+6];a[r+28>>2]=a[i+7];i=x+16|0;var c=r|0;if((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])){return h=g,0}i=r+16|0;c=x|0;if((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])){return h=g,0}i=x+24|0;c=r+8|0;if((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])){return h=g,0}i=r+24|0;c=x+8|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])>=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);h=g;return i&1}function xE(x,r,i,g,c){var d,l,k,n,e,p,j,m,t,u=h;h+=1664;var w=u+64,A=u+864,B=Cb(20);a[B+16>>2]=1;p=a[g+4>>2]-1|0;k=(p|0)/3&-1;d=2<(p|0);a:do{if(d){l=g|0;var C=u|0;t=u>>2;m=(u+16|0)>>2;j=(u+32|0)>>2;p=(u+48|0)>>2;for(var P=B,T=0;;){n=3*T|0;var gb=a[l>>2];e=((n<<4)+gb|0)>>2;a[t]=a[e];a[t+1]=a[e+1];a[t+2]=a[e+2];a[t+3]=a[e+3];e=((n+1<<4)+gb|0)>>2;a[m]=a[e];a[m+1]=a[e+1];a[m+2]=a[e+2];a[m+3]=a[e+3];e=((n+2<<4)+gb|0)>>2;a[j]=a[e];a[j+1]=a[e+1];a[j+2]=a[e+2];a[j+3]=a[e+3];n=((n+3<<4)+gb|0)>>2;a[p]=a[n];a[p+1]=a[n+1];a[p+2]=a[n+2];a[p+3]=a[n+3];T=T+1|0;if((T|0)<(k|0)){P=rs(C,P)}else{break a}}}}while(0);if(0!=(B|0)){p=A|0;j=w|0;k=w>>2;g=A>>2;m=B;for(C=P=0;;){t=a[m+16>>2];l=(C<<4)+w|0;d=(C<<4)+A|0;n=m|0;var T=m+8|0,y=P,P=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);n=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0]);var M=t,gb=l,T=d;e=c;if(0==(y|0)){var y=M|0,X=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),M=M+8|0,O=(b[0]=a[M>>2],b[1]=a[M+4>>2],f[0]),M=O,y=X,X=2*P-X,O=2*n-O}else{X=y|0,X=(b[0]=a[X>>2],b[1]=a[X+4>>2],f[0]),y=y+8|0,O=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),0==(M|0)?(M=2*n-O,y=2*P-X):(y=M|0,y=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),M=M+8|0,M=(b[0]=a[M>>2],b[1]=a[M+4>>2],f[0]))}var D=P,Da=n,M=Cf(M-Da,y-D),y=Cf(O-Da,X-D),M=M-y,y=y+.5*(0<M?M-6.283185307179586:M),M=se(y)*e;e*=Ce(y);y=e+n;X=gb|0;f[0]=M+P;a[X>>2]=b[0];a[X+4>>2]=b[1];gb=gb+8|0;f[0]=y;a[gb>>2]=b[0];a[gb+4>>2]=b[1];n-=e;gb=T|0;f[0]=P-M;a[gb>>2]=b[0];a[gb+4>>2]=b[1];P=T+8|0;f[0]=n;a[P>>2]=b[0];a[P+4>>2]=b[1];P=C+1|0;C=0==(t|0);C|50==(P|0)?(UE(x,r,i,P,j,p),l>>=2,a[k]=a[l],a[k+1]=a[l+1],a[k+2]=a[l+2],a[k+3]=a[l+3],d>>=2,a[g]=a[d],a[g+1]=a[d+1],a[g+2]=a[d+2],a[g+3]=a[d+3],d=1):d=P;if(C){var ia=B;break}else{P=m,m=t,C=d}}for(;!(x=a[ia+16>>2],G(ia),0==(x|0));){ia=x}}h=u}function rs(x,r){var i,g,c=h;h+=144;if(0==(cD(x)|0)){return i=c|0,g=c+64|0,Ld(c+128,x,3,.5,i,g),i=rs(g,rs(i,r)),h=c,i}i=r+16|0;1==(a[i>>2]|0)&&(a[i>>2]=0,g=r>>2,i=x>>2,a[g]=a[i],a[g+1]=a[i+1],a[g+2]=a[i+2],a[g+3]=a[i+3]);i=x+48|0;g=x+56|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);var d=Cb(20);a[d+16>>2]=0;f[0]=i;a[d>>2]=b[0];a[d+4>>2]=b[1];i=d+8|0;f[0]=g;a[i>>2]=b[0];a[i+4>>2]=b[1];a[r+16>>2]=d;h=c;return d}function UE(b,r,i,g,c,d){var f,k=g<<1;f=a[i>>2];if(0<(f|0)){for(var n=a[r>>2],e=0,h=0;;){var j=a[n+(e<<2)>>2]+h|0,e=e+1|0;if((e|0)<(f|0)){h=j}else{break}}n=1<(f|0)?f:1}else{j=n=0}f=f+1|0;a[i>>2]=f;i=wb(a[r>>2],f<<2);a[r>>2]=i;a[i+(n<<2)>>2]=k;i=wb(a[b>>2],j+k<<4);a[b>>2]=i;if(0<(g|0)){k=k-1+j|0;for(r=0;;){f=((r+j<<4)+i|0)>>2;i=((r<<4)+c|0)>>2;a[f]=a[i];a[f+1]=a[i+1];a[f+2]=a[i+2];a[f+3]=a[i+3];f=((k-r<<4)+a[b>>2]|0)>>2;i=((r<<4)+d|0)>>2;a[f]=a[i];a[f+1]=a[i+1];a[f+2]=a[i+2];a[f+3]=a[i+3];r=r+1|0;if((r|0)==(g|0)){break}i=a[b>>2]}}}function Gi(b,r){var i,g=h;h+=144;var c=g+128,d=a[b>>2];fc(c,128,g|0);db(c,r);i=(c+4|0)>>2;var f=a[i];f>>>0<a[c+8>>2]>>>0||(na(c,1),f=a[i]);m[f]=0;var k=a[c>>2];a[i]=k;f=d+268|0;i=he(k,a[f>>2]);f=(k=0!=(i|0))?he(0,a[f>>2]):0;k=(0!=(f|0)&1)+(k&1)|0;1==(k|0)?(f=a[b+156>>2],d=(ss(d,i,f)|0)==(f|0)&1):2==(k|0)?(i=ss(d,i,0),d=ss(d,f,a[b+152>>2]),f=-1<(d|i|0)&(i|0)>(d|0),k=a[b+156>>2],d=(k|0)<=((f?i:d)|0)&((f?d:i)|0)<=(k|0)&1):d=0;uc(c);h=g;return d}function ss(b,r,i){var g,c=a[b+124>>2],d=m[r];if(97==d<<24>>24&&0==(ka(r,VE|0)|0)){var f;return i}for(var k,i=r;;){var n=m[i];if(0==n<<24>>24){var e=1;k=2222;break}if(10>((n&255)-48|0)>>>0){i=i+1|0}else{e=0;k=2221;break}}if(0!=(2221==k||2222==k?e:cc)<<24>>24){return f=bh(r)}b=a[b+276>>2];if(0==(b|0)){return-1}c=a[c+152>>2];for(k=1;;){if((k|0)>(c|0)){f=-1;g=2297;break}e=a[b+(k<<2)>>2];if(d<<24>>24==m[e]<<24>>24&&0==(ka(r,e)|0)){f=k;g=2298;break}k=k+1|0}if(2298==g||2297==g){return f}}function pD(b,r,i){var g=2>(a[b+152>>2]|0);a:do{if(g){var c=1}else{var d=jc(i|0,a[Un>>2],Y|0);if(0!=Gi(b,d)<<24>>24){c=1}else{if(0!=m[d]<<24>>24){c=0}else{var d=r,f=i;if(0==(Ok(d,f)|0)){c=1}else{for(var k=Ok(d,f);;){if(0==(k|0)){c=0;break a}var n=jc(k|0,a[Tn>>2],Y|0);if(0==m[n]<<24>>24){c=1;break a}if(0!=Gi(b,n)<<24>>24){c=1;break a}k=Pk(d,k,f)}}}}}}while(0);return c}function vD(x,r){var i,g,c,d,l,k,n,e,h,j=a[x+148>>2],v=wk(x);e=v>>2;a[e+1]=2;a[e+2]=r;a[e+3]=8;if(0!=(j&16777216|0)){if(2<(D[a[r+20>>2]+206>>1]&65535)){var t=a[r+148>>2]+16|0,u=72*(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),w=v+108|0;f[0]=(0>u?u-.5:u+.5)&-1|0;a[w>>2]=b[0];a[w+4>>2]=b[1]}else{var A=v+108|0;f[0]=0;a[A>>2]=b[0];a[A+4>>2]=b[1]}}var B=r|0;Sr(x,a[r+120>>2],B);if(0==(j&4259840|0)){var C=V(B,lh|0)}else{if(0==(a[e+37]|0)&&0==(a[e+50]&1|0)){C=V(B,lh|0);Bk(C);WE(x);return}var P=ts(r),T=r+32|0,gb=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0]),y=r+40|0,M=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),X;var O=Aa(r|0,a[Ki>>2],Y|0);if(0==m[O]<<24>>24){var F=0}else{nh(O);var Da=a[Cc>>2];if(0==(Da|0)){F=0}else{for(var ia=Cc|0,E=0,G=Da;;){var J=0==(ka(G,Hi|0)|0)?1:E,sc=ia+4|0,H=a[sc>>2];if(0==(H|0)){F=J;break}else{ia=sc,E=J,G=H}}}}X=F;a:do{if(3==(P|0)||1==(P|0)){var I=a[r+28>>2];n=I>>2;var K=0==FQa(I)<<24>>24?1:0==(a[n+1]|X|0);if(0!=(I|0)&K){if(0==(j&524288|0)){h=2342}else{k=(I+8|0)>>2;var hc=a[k],ca=3>(hc|0)?1:hc,L=I+4|0,N=a[L>>2],zb=1<(N|0)?N:1,ja=a[n+10],aa=V(B,us|0),da=0==(aa|0)?0:bh(aa),ea=56<(da-4|0)>>>0?20:da;if(0==(a[L>>2]|X|0)){a[e+51]=0;var xa=fa(32),Q=xa;l=(r+104|0)>>2;var Od=gb-(b[0]=a[l],b[1]=a[l+1],f[0]),ha=xa;f[0]=Od;a[ha>>2]=b[0];a[ha+4>>2]=b[1];d=(r+96|0)>>2;var ga=M-.5*(b[0]=a[d],b[1]=a[d+1],f[0]),W=xa+8|0;f[0]=ga;a[W>>2]=b[0];a[W+4>>2]=b[1];var Rb=gb+(b[0]=a[l],b[1]=a[l+1],f[0]),S=xa+16|0;f[0]=Rb;a[S>>2]=b[0];a[S+4>>2]=b[1];var tb=M+.5*(b[0]=a[d],b[1]=a[d+1],f[0]),ya=xa+24|0;f[0]=tb;a[ya>>2]=b[0];a[ya+4>>2]=b[1];var U=Q,wa=2}else{var Ab=a[k];do{if(3>(Ab|0)){var Fa=I+28|0;if(0==(b[0]=a[Fa>>2],b[1]=a[Fa+4>>2],f[0])){var Ga=I+20|0;if(0==(b[0]=a[Ga>>2],b[1]=a[Ga+4>>2],f[0])){var R=v+204|0;if(0!=(a[n]|0)){a[R>>2]=1;var ta=fa(32),Ka=ta,za=ta;f[0]=gb;a[za>>2]=b[0];a[za+4>>2]=b[1];var ma=ta+8|0;f[0]=M;a[ma>>2]=b[0];a[ma+4>>2]=b[1];var pa=(zb<<1)-1|0,la=(pa<<4)+ja|0,Ha=gb+(b[0]=a[la>>2],b[1]=a[la+4>>2],f[0]),Ra=ta+16|0;f[0]=Ha;a[Ra>>2]=b[0];a[Ra+4>>2]=b[1];var $=(pa<<4)+ja+8|0,Z=M+(b[0]=a[$>>2],b[1]=a[$+4>>2],f[0]),La=ta+24|0;f[0]=Z;a[La>>2]=b[0];a[La+4>>2]=b[1];U=Ka;wa=2;break a}a[R>>2]=2;var Vf=(zb<<1)-1|0,Ya=(Vf<<4)+ja|0,sa=(Vf<<4)+ja+8|0,Za;var ra=(b[0]=a[Ya>>2],b[1]=a[Ya+4>>2],f[0]),ab=(b[0]=a[sa>>2],b[1]=a[sa+4>>2],f[0]),$a=ea,jb=6.283185307179586/($a|0),Ca=fa($a<<4);if(0<($a|0)){for(var Ia=0,eb=0;;){var ub=se(Ia)*ra,Sa=(eb<<4)+Ca|0;f[0]=ub;a[Sa>>2]=b[0];a[Sa+4>>2]=b[1];var CQa=Ce(Ia)*ab,ua=(eb<<4)+Ca+8|0;f[0]=CQa;a[ua>>2]=b[0];a[ua+4>>2]=b[1];var Oa=eb+1|0;if((Oa|0)==($a|0)){break}else{Ia+=jb,eb=Oa}}}Za=Ca;if(0<(ea|0)){var Wa=0}else{U=Za;wa=ea;break a}for(;;){c=((Wa<<4)+Za|0)>>2;var pb=(b[0]=a[c],b[1]=a[c+1],f[0])+gb;f[0]=pb;a[c]=b[0];a[c+1]=b[1];g=((Wa<<4)+Za+8|0)>>2;var ob=(b[0]=a[g],b[1]=a[g+1],f[0])+M;f[0]=ob;a[g]=b[0];a[g+1]=b[1];var bb=Wa+1|0;if((bb|0)==(ea|0)){U=Za;wa=ea;break a}else{Wa=bb}}}}}}while(0);var qb=Ab*(zb-1)|0;a[e+51]=2;var ba=a[k];if((ba|0)<(ea|0)){var kb=fa(ca<<4);if(0<(ca|0)){for(var ie=0;;){var vb=ie+qb|0,xb=(vb<<4)+ja|0,hd=gb+(b[0]=a[xb>>2],b[1]=a[xb+4>>2],f[0]),nb=(ie<<4)+kb|0;f[0]=hd;a[nb>>2]=b[0];a[nb+4>>2]=b[1];var rb=(vb<<4)+ja+8|0,lb=M+(b[0]=a[rb>>2],b[1]=a[rb+4>>2],f[0]),Ta=(ie<<4)+kb+8|0;f[0]=lb;a[Ta>>2]=b[0];a[Ta+4>>2]=b[1];var cb=ie+1|0;if((cb|0)==(ca|0)){U=kb;wa=ca;break a}else{ie=cb}}}else{U=kb,wa=ca}}else{var fb=(ba|0)/(ea|0)&-1,Ua=fa(ea<<4);if(0<(ea|0)){for(var sb=0,Na=0;;){var Fb=Na+qb|0,Db=(Fb<<4)+ja|0,Ob=gb+(b[0]=a[Db>>2],b[1]=a[Db+4>>2],f[0]),Eb=(sb<<4)+Ua|0;f[0]=Ob;a[Eb>>2]=b[0];a[Eb+4>>2]=b[1];var ne=(Fb<<4)+ja+8|0,Bb=M+(b[0]=a[ne>>2],b[1]=a[ne+4>>2],f[0]),Ja=(sb<<4)+Ua+8|0;f[0]=Bb;a[Ja>>2]=b[0];a[Ja+4>>2]=b[1];var qa=sb+1|0;if((qa|0)==(ea|0)){U=Ua;wa=ea;break a}else{sb=qa,Na=Na+fb|0}}}else{U=Ua,wa=ea}}}}}else{h=2342}}else{h=2342}}while(0);if(2342==h){a[e+51]=0;var na=fa(32),oa=r+104|0,Ba=gb-(b[0]=a[oa>>2],b[1]=a[oa+4>>2],f[0]);f[0]=Ba;a[na>>2]=b[0];a[na+4>>2]=b[1];i=(r+96|0)>>2;var Ea=M-.5*(b[0]=a[i],b[1]=a[i+1],f[0]),Wf=na+8|0;f[0]=Ea;a[Wf>>2]=b[0];a[Wf+4>>2]=b[1];var ic=r+112|0,va=gb+(b[0]=a[ic>>2],b[1]=a[ic+4>>2],f[0]),Cb=na+16|0;f[0]=va;a[Cb>>2]=b[0];a[Cb+4>>2]=b[1];var Ma=M+.5*(b[0]=a[i],b[1]=a[i+1],f[0]),wb=na+24|0;f[0]=Ma;a[wb>>2]=b[0];a[wb+4>>2]=b[1];U=na;wa=2}0==(j&8192|0)&&Re(x,U,U,wa);a[e+53]=U;a[e+52]=wa;C=V(B,lh|0)}Bk(C);WE(x)}function FQa(x){if(4!=(a[x+8>>2]|0)){return 0}var r=x+12|0,r=(b[0]=a[r>>2],b[1]=a[r+4>>2],f[0]);if(0!=(((0>r?r-.5:r+.5)&-1)%90|0)){return 0}r=x+20|0;if(0!=(b[0]=a[r>>2],b[1]=a[r+4>>2],f[0])){return 0}x=x+28|0;x=0==(b[0]=a[x>>2],b[1]=a[x+4>>2],f[0]);return x&1}function Sr(b,r,i){var g=h;h+=144;var c,d=g+128,f=V(i,Ni|0),k=V(i,Pi|0),n=V(i,is|0);fc(d,128,g|0);r=0==(r|0)?0:a[r>>2];if(0==(f|0)){c=2368}else{if(0==m[f]<<24>>24){c=2368}else{var e=f}}2368==c&&(e=V(i,Oi|0));Or(b,r,e,k,n,Kn(b,i,d),i);uc(d);h=g}function kD(x){var r,i,g=x>>2,c=h;h+=16;var d=c+8,l=a[g+48],k=a[g+49],n=a[g+40],e=a[g+41],p=x+356|0;0==(a[p>>2]|0)?d=e:(fo(c,l,k),l=a[c>>2],k=a[c+4>>2],fo(d,n,e),n=a[d>>2],d=a[d+4>>2]);var l=l|0,e=x+316|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),j=x+236|0;r=l*e-(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);j=x+284|0;f[0]=r;a[j>>2]=b[0];a[j+4>>2]=b[1];j=k|0;k=x+324|0;k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);i=x+244|0;i=j*k-(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);var m=x+292|0;f[0]=i;a[m>>2]=b[0];a[m+4>>2]=b[1];m=x+300|0;f[0]=r+e;a[m>>2]=b[0];a[m+4>>2]=b[1];r=x+308|0;f[0]=i+k;a[r>>2]=b[0];a[r+4>>2]=b[1];r=x+464|0;0==(a[a[g+3]+28>>2]|0)?(i=r>>2,r=(x+448|0)>>2,a[i]=a[r],a[i+1]=a[r+1],a[i+2]=a[r+2],a[i+3]=a[r+3]):(r|=0,i=a[r>>2],m=a[g+112],a[r>>2]=(i|0)<(m|0)?i:m,r=x+468|0,i=a[r>>2],m=a[g+113],a[r>>2]=(i|0)<(m|0)?i:m,r=x+472|0,i=a[r>>2],m=a[g+114],a[r>>2]=(i|0)>(m|0)?i:m,r=x+476|0,i=a[r>>2],m=a[g+115],a[r>>2]=(i|0)>(m|0)?i:m);g=a[g+37];r=x+332|0;r=(b[0]=a[r>>2],b[1]=a[r+4>>2],f[0]);0==(g&128|0)?(n=r+e*(l-.5*(n|0)),l=x+252|0,f[0]=n,a[l>>2]=b[0],a[l+4>>2]=b[1],l=x+340|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])+k*(j-.5*(d|0))-1,d=x+260|0,f[0]=l,a[d>>2]=b[0],a[d+4>>2]=b[1],j=n+(e+1),d=x+268|0,f[0]=j,a[d>>2]=b[0],a[d+4>>2]=b[1],e=l+(k+1),d=x+276|0,f[0]=e,a[d>>2]=b[0],a[d+4>>2]=b[1],d=n,n=l,k=j):(d=x+360|0,n=.5*(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),d=r-n,e=x+252|0,f[0]=d,a[e>>2]=b[0],a[e+4>>2]=b[1],e=x+340|0,l=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),e=x+368|0,j=.5*(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),e=l-j,k=x+260|0,f[0]=e,a[k>>2]=b[0],a[k+4>>2]=b[1],k=r+n,n=x+268|0,f[0]=k,a[n>>2]=b[0],a[n+4>>2]=b[1],l+=j,n=x+276|0,f[0]=l,a[n>>2]=b[0],a[n+4>>2]=b[1],n=e,e=l);0==(a[p>>2]|0)?(p=x+376|0,k=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),p=x+348|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),l=x+496|0,f[0]=k/p-d,a[l>>2]=b[0],a[l+4>>2]=b[1],0==(g&4096|a[Ic>>2]|0)?(g=x+384|0,p=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])/p-n):(g=x+384|0,p=-e-(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])/p),x=x+504|0,f[0]=p,a[x>>2]=b[0],a[x+4>>2]=b[1]):(n=x+376|0,p=x+384|0,j=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),p=x+348|0,l=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),p=x+496|0,x=x+504|0,f[0]=-e-j/l,a[x>>2]=b[0],a[x+4>>2]=b[1],0==(g&4096|a[Ic>>2]|0)?(x=n|0,x=(b[0]=a[x>>2],b[1]=a[x+4>>2],f[0])/l-d):(x=n|0,x=-k-(b[0]=a[x>>2],b[1]=a[x+4>>2],f[0])/l),p|=0,f[0]=x,a[p>>2]=b[0],a[p+4>>2]=b[1]);h=c}function Ur(b,r,i){var g=a[b>>2]+28|0;a[g>>2]=a[g>>2]+1|0;(g=0!=(i&4|0))||Ck(b,r,i);var c=0==(i&1|0);a:do{if(c){if(0!=(i&16|0)){vs(b);var d=r,f=ra(d),k=0==(f|0);b:do{if(!k){for(var n=f;;){var e=Ib(d,n),h=0==(e|0);c:do{if(!h){for(var j=e;;){if(Ji(b,j),j=yb(d,j),0==(j|0)){break c}}}}while(0);n=ba(d,n);if(0==(n|0)){break b}}}}while(0);ws(b);xs(b);f=ra(d);k=0==(f|0);b:do{if(!k){for(n=f;;){if(oh(b,n),n=ba(d,n),0==(n|0)){break b}}}}while(0);ys(b)}else{if(0==(i&8|0)){d=r;f=ra(d);if(0==(f|0)){break}for(;;){oh(b,f);k=Ib(d,f);n=0==(k|0);b:do{if(!n){for(e=k;;){if(oh(b,a[e+12>>2]),Ji(b,e),e=yb(d,e),0==(e|0)){break b}}}}while(0);f=ba(d,f);if(0==(f|0)){break a}}}xs(b);d=r;f=ra(d);k=0==(f|0);b:do{if(!k){for(n=f;;){e=n;for(var h=cc,j=r+212|0,m=r+208|0,t=e|0,u=1;;){if((u|0)>(a[m>>2]|0)){var w=1,h=2460;break}if(0==(Ed(a[a[j>>2]+(u<<2)>>2],t)|0)){u=u+1|0}else{w=0;h=2461;break}}h=2461==h||2460==h?w:cc;0!=h<<24>>24&&oh(b,e);n=ba(d,n);if(0==(n|0)){break b}}}}while(0);ys(b);vs(b);f=ra(d);k=0==(f|0);b:do{if(!k){for(n=f;;){e=Ib(d,n);h=0==(e|0);c:do{if(!h){for(j=e;;){m=j;for(var t=cc,u=r+212|0,A=r+208|0,B=m|0,C=1;;){if((C|0)>(a[A>>2]|0)){var P=1,t=2466;break}if(0==(Ed(a[a[u>>2]+(C<<2)>>2],B)|0)){C=C+1|0}else{P=0;t=2467;break}}t=2466==t||2467==t?P:cc;0!=t<<24>>24&&Ji(b,m);j=yb(d,j);if(0==(j|0)){break c}}}}while(0);n=ba(d,n);if(0==(n|0)){break b}}}}while(0);ws(b)}}else{xs(b);d=r;f=ra(d);k=0==(f|0);b:do{if(!k){for(n=f;;){if(oh(b,n),n=ba(d,n),0==(n|0)){break b}}}}while(0);ys(b);vs(b);f=ra(d);k=0==(f|0);b:do{if(!k){for(n=f;;){e=Ib(d,n);h=0==(e|0);c:do{if(!h){for(j=e;;){if(Ji(b,j),j=yb(d,j),0==(j|0)){break c}}}}while(0);n=ba(d,n);if(0==(n|0)){break b}}}}while(0);ws(b)}}while(0);g&&Ck(b,r,i)}function lD(x,r){var i,g,c,d=h;h+=4;a[d>>2]=1e3;var l=Cb(16e3),k=r|0;if(0<(a[k>>2]|0)){var n=x+252|0,e=a[r+8>>2];g=e>>2;for(var p=l,l=1,s=0,m=0;;){c=(e|0)>>2;i=a[c];if(0==(i|0)||1==(i|0)){if(0!=(ph(e+44|0,n)|0)){i=e+4|0;g=(e+20|0)>>2;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])-(b[0]=a[g],b[1]=a[g+1],f[0]);var t=p|0;f[0]=i;a[t>>2]=b[0];a[t+4>>2]=b[1];t=e+12|0;i=(e+28|0)>>2;var t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])-(b[0]=a[i],b[1]=a[i+1],f[0]),u=p+8|0;f[0]=t;a[u>>2]=b[0];a[u+4>>2]=b[1];g=(b[0]=a[g],b[1]=a[g+1],f[0]);t=p+16|0;f[0]=g;a[t>>2]=b[0];a[t+4>>2]=b[1];g=(b[0]=a[i],b[1]=a[i+1],f[0]);i=p+24|0;f[0]=g;a[i>>2]=b[0];a[i+4>>2]=b[1];Qk(x,p,0==(a[c]|0)&1)}c=m}else{if(11==(i|0)){nh(a[g+1]),Ke(x,Cc|0),c=Cc|0}else{if(6==(i|0)){0!=(ph(e+44|0,n)|0)&&(c=g=e+4|0,p=zs(p,d,a[g+4>>2],a[c>>2]),Gd(x,p,a[c>>2])),c=m}else{if(12==(i|0)){0!=(l|0)&&la(0,XE|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),c=m,l=0}else{if(2==(i|0)||3==(i|0)){0!=(ph(e+44|0,n)|0)&&(g=i=e+4|0,p=zs(p,d,a[i+4>>2],a[g>>2]),zc(x,p,a[g>>2],2==(a[c]|0)&1))}else{if(7==(i|0)){0!=(ph(e+44|0,n)|0)&&(c=e+4|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),i=p|0,f[0]=c,a[i>>2]=b[0],a[i+4>>2]=b[1],i=e+12|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),t=p+8|0,f[0]=i,a[t>>2]=b[0],a[t+4>>2]=b[1],As(x,c,i,a[g+19]))}else{if(9==(i|0)){Pa(x,a[g+1])}else{if(8==(i|0)){$b(x,a[g+1])}else{if((4==(i|0)||5==(i|0))&&0!=(ph(e+44|0,n)|0)){g=i=e+4|0,p=zs(p,d,a[i+4>>2],a[g>>2]),$f(x,p,a[g>>2],0,0,4==(a[c]|0)&1)}}}}}c=m}}}}i=p;s=s+1|0;if((s|0)<(a[k>>2]|0)){e=e+80|0,g=e>>2,p=i,m=c}else{break}}0!=(c|0)&&Ke(x,a[a[x>>2]+296>>2]);k=i}else{k=l}G(k);h=d}function Rk(b,r){var i;i=(b+12|0)>>2;var g=a[i];a[i]=g+4|0;a[g>>2]=r;a[i]>>>0<a[b+4>>2]>>>0||(a[i]=a[b>>2])}function Sk(b){var r;r=(b+8|0)>>2;var i=a[r];if((i|0)==(a[b+12>>2]|0)){return 0}var g=i+4|0;a[r]=g;i=a[i>>2];if(g>>>0<a[b+4>>2]>>>0){return i}a[r]=a[b>>2];return i}function Zb(b){var r,i=b+224|0,g=a[i>>2];if((g|0)!=(b|0)&0!=(g|0)){b=i,i=g}else{var c;return b}for(;;){g=a[i+224>>2];if(0==(g|0)){c=i;r=2510;break}a[b>>2]=g;b=g+224|0;i=a[b>>2];if(!((i|0)!=(g|0)&0!=(i|0))){c=g;r=2509;break}}if(2509==r||2510==r){return c}}function YE(b){a[b+220>>2]=1;a[b+224>>2]=0;m[b+165|0]=0}function zs(x,r,i,g){var c=a[r>>2];(c|0)<(g|0)&&(c<<=1,c=(c|0)>(g|0)?c:g,x=wb(x,c<<4),a[r>>2]=c);r=x;if(0<(g|0)){x=0}else{return r}for(;;){var c=i+24*x|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),d=(x<<4)+r|0;f[0]=c;a[d>>2]=b[0];a[d+4>>2]=b[1];c=i+24*x+8|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);d=(x<<4)+r+8|0;f[0]=c;a[d>>2]=b[0];a[d+4>>2]=b[1];x=x+1|0;if((x|0)==(g|0)){break}}return r}function jD(b,r){var i=r+208|0;if(1<=(a[i>>2]|0)){for(var g=r+212|0,c=1;;){var d=a[a[g>>2]+(c<<2)>>2];jD(b,d);var d=d|0,f=V(d,kh|0);0!=(f|0)&&0!=m[f]<<24>>24&&Pa(b,f);f=V(d,Ak|0);0!=(f|0)&&0!=m[f]<<24>>24&&$b(b,f);d=V(d,Eg|0);0!=(d|0)&&0!=m[d]<<24>>24&&Pa(b,d);c=c+1|0;if((c|0)>(a[i>>2]|0)){break}}}}function ZE(b){var r,i=fa(16);r=i>>2;var b=2>(b|0)?2:b,g=fa(b<<2);a[r]=g;a[r+3]=g;a[r+2]=g;a[r+1]=(b<<2)+g|0;return i}function Zf(b,r,i){0!=(r|0)&&(b=mb(b,a[r+8>>2]),0!=(b|0)&&0!=m[b]<<24>>24&&(i=bh(b),i=0>(i|0)?0:i));return i}function Xb(b,r,i,g){0==(r|0)|0==(b|0)?g=i:(b=mb(b,a[r+8>>2]),0==(b|0)?g=i:0==m[b]<<24>>24?g=i:(i=wg(b,xc),g=i<g?g:i));return g}function jc(b,r,i){return 0==(r|0)|0==(b|0)?i:b=mb(b,a[r+8>>2])}function Aa(a,b,i){a=jc(a,b,i);return 0!=(a|0)&&0!=m[a]<<24>>24?a:i}function jo(a){return re(a)}function Tk(b,r){var i,g;if((b|0)==(r|0)){return b}g=b+224|0;if(0==(a[g>>2]|0)){a[g>>2]=b;a[b+220>>2]=1;var c=b}else{c=Zb(b)}g=c>>2;i=r+224|0;if(0==(a[i>>2]|0)){a[i>>2]=r;a[r+220>>2]=1;var d=r}else{d=Zb(r)}i=d>>2;(a[g+4]|0)>(a[i+4]|0)?(a[g+56]=d,c=d+220|0,a[c>>2]=a[c>>2]+a[g+55]|0,g=d):(a[i+56]=c,g=c+220|0,a[g>>2]=a[g>>2]+a[i+55]|0,g=c);return g}function Ld(x,r,i,g,c,d){var l,k,n=h;h+=576;if(0<=(i|0)){for(var e=i+1|0,p=0;!(k=((p<<4)+n|0)>>2,l=((p<<4)+r|0)>>2,a[k]=a[l],a[k+1]=a[l+1],a[k+2]=a[l+2],a[k+3]=a[l+3],l=p+1|0,(l|0)==(e|0));){p=l}r=1>(i|0);a:do{if(!r){l=1-g;p=1;for(k=i;;){var j=0>(i-p|0);b:do{if(!j){for(var m=p-1|0,t=n+96*m|0,u=n+96*m+8|0,w=0,A=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]);;){var t=w+1|0,B=(t<<4)+n+96*m|0,B=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),C=(w<<4)+n+96*p|0;f[0]=l*A+B*g;a[C>>2]=b[0];a[C+4>>2]=b[1];A=(t<<4)+n+96*m+8|0;C=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]);w=(w<<4)+n+96*p+8|0;f[0]=l*u+C*g;a[w>>2]=b[0];a[w+4>>2]=b[1];if((t|0)==(k|0)){break b}else{w=t,A=B,u=C}}}}while(0);p=p+1|0;if((p|0)==(e|0)){break a}else{k=k-1|0}}}}while(0);g=0==(c|0);a:do{if(!g){for(k=0;;){if(l=((k<<4)+c|0)>>2,r=(n+96*k|0)>>2,a[l]=a[r],a[l+1]=a[r+1],a[l+2]=a[r+2],a[l+3]=a[r+3],r=k+1|0,(r|0)==(e|0)){break a}else{k=r}}}}while(0);if(0!=(d|0)){for(r=0;!(g=((r<<4)+d|0)>>2,c=((r<<4)+n+96*(i-r)|0)>>2,a[g]=a[c],a[g+1]=a[c+1],a[g+2]=a[c+2],a[g+3]=a[c+3],c=r+1|0,(c|0)==(e|0));){r=c}}}x>>=2;i=n+96*i|0;i>>=2;a[x]=a[i];a[x+1]=a[i+1];a[x+2]=a[i+2];a[x+3]=a[i+3];h=n}function $E(b){for(var r,i=0;;){var g=a[ko>>2];if(1024>(g-i|0)){g=g+1024|0;a[ko>>2]=g;var c=wb(a[Si>>2],g);a[Si>>2]=c;g=a[ko>>2]}else{c=a[Si>>2]}g=oi(c+i|0,g-i|0,b);if(0==(g|0)){break}g=Ba(g)+i|0;c=a[Si>>2];if(10==m[c+(g-1)|0]<<24>>24){var d=g,f=c;r=2612;break}else{i=g}}if(2612==r){return f=0<(d|0)?f:0}f=a[Si>>2];return f=(b=0<(i|0))?f:0}function Uk(b){var r=h,i;if(0==(b|0)){var g;h=r;return 0}if(0==m[b]<<24>>24){return h=r,0}var c=a[aF>>2];if(0==(c|0)){return h=r,b}var d=a[Bs>>2];if(0==(d|0)){if(m[Vk]){return h=r,0}la(0,bF|0,(j=h,h+=4,a[j>>2]=c,j));m[Vk]=1;h=r;return 0}if(!m[Cs]){var c=he(Hb(d),zf|0),d=0==(c|0),f=a[Wk>>2];a:do{if(d){var k=0,n=f}else{for(var e=0,p=c,s=f;;){var v=0==(s|0)?Cb((e<<2)+8|0):wb(s,(e<<2)+8|0);a[Wk>>2]=v;s=e+1|0;a[v+(e<<2)>>2]=p;e=a[lo>>2];p=Ba(p);a[lo>>2]=e>>>0>p>>>0?e:p;p=he(0,zf|0);v=a[Wk>>2];if(0==(p|0)){k=s;n=v;break a}else{e=s,s=v}}}}while(0);a[n+(k<<2)>>2]=0;m[Cs]=1}k=ik(b,47);k=0==(k|0)?b:k+1|0;n=ik(k,92);k=0==(n|0)?k:n+1|0;n=ik(k,58);k=0==(n|0)?k:n+1|0;m[Vk]|(k|0)==(b|0)||(n=a[Bs>>2],la(0,cF|0,(j=h,h+=8,a[j>>2]=b,a[j+4>>2]=n,j)),m[Vk]=1);b=mc(a[Ti>>2],a[lo>>2]+Ba(k)+2|0);a[Ti>>2]=b;for(b=a[Wk>>2];;){n=a[b>>2];if(0==(n|0)){g=0;i=2639;break}Ma(a[Ti>>2],dF|0,(j=h,h+=12,a[j>>2]=n,a[j+4>>2]=eF|0,a[j+8>>2]=k,j));if(0==(vQa(a[Ti>>2])|0)){break}else{b=b+4|0}}if(2639==i){return h=r,g}g=a[Ti>>2];h=r;return g}function Ds(b,r,i){var g=0==(b|0),c=0;a:for(;;){var d=a[r+(c<<2)>>2];if(0==(d|0)){break}do{if(!g&&m[b]<<24>>24==m[d]<<24>>24&&0==(ka(b,d)|0)){break a}}while(0);c=c+1|0}return a[i+(c<<2)>>2]}function re(a){return 0==(a|0)?0:0==m[a]<<24>>24?0:0==(Lb(a,Ze|0)|0)?0:0==(Lb(a,fF|0)|0)?0:0==(Lb(a,Es|0)|0)?1:0==(Lb(a,gF|0)|0)?1:10>((m[a]<<24>>24)-48|0)>>>0?bh(a)&255:0}function Lb(a,b){for(var i,g=a,c=b;;){var d=m[g];if(0==d<<24>>24){var f=0;break}if((vf(d&255)|0)!=(vf(m[c]&255)|0)){i=2659;break}g=g+1|0;c=c+1|0}2659==i&&(f=m[g]&255);return vf(f)-vf(m[c]&255)|0}function NE(x,r,i,g){var c=h;h+=80;var d,l=c+64,k=a[r+4>>2],n=0<(k|0),r=a[r>>2]>>2;a:do{if(n){for(var e=1e+38,p=-1,j=-1,m=0;;){var t=a[r+(12*m|0)],u=a[r+(12*m|0)+1],w=0<(u|0);b:do{if(w){for(var A=e,B=p,C=j,P=0;;){var T=(P<<4)+t|0,gb=(P<<4)+t+8|0,T=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0])-i,gb=(b[0]=a[gb>>2],b[1]=a[gb+4>>2],f[0])-g,T=T*T+gb*gb,A=(gb=-1==(B|0)|T<A)?T:A,B=gb?P:B,C=gb?m:C,P=P+1|0;if((P|0)==(u|0)){var y=A,M=B,X=C;break b}}}else{y=e,M=p,X=j}}while(0);m=m+1|0;if((m|0)<(k|0)){e=y,p=M,j=X}else{var O=M,D=X;break a}}}else{D=O=-1}}while(0);n=a[r+(12*D|0)];O=(O|0)/3&-1;y=(((O|0)>=(k|0))<<31>>31)+O|0;k=(y<<4)+n|0;k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);O=c|0;f[0]=k;a[O>>2]=b[0];a[O+4>>2]=b[1];O=(y<<4)+n+8|0;O=(b[0]=a[O>>2],b[1]=a[O+4>>2],f[0]);M=c+8|0;f[0]=O;a[M>>2]=b[0];a[M+4>>2]=b[1];M=y+1|0;X=(M<<4)+n|0;X=(b[0]=a[X>>2],b[1]=a[X+4>>2],f[0]);D=c+16|0;f[0]=X;a[D>>2]=b[0];a[D+4>>2]=b[1];M=(M<<4)+n+8|0;M=(b[0]=a[M>>2],b[1]=a[M+4>>2],f[0]);X=c+24|0;f[0]=M;a[X>>2]=b[0];a[X+4>>2]=b[1];M=y+2|0;X=(M<<4)+n|0;X=(b[0]=a[X>>2],b[1]=a[X+4>>2],f[0]);D=c+32|0;f[0]=X;a[D>>2]=b[0];a[D+4>>2]=b[1];M=(M<<4)+n+8|0;M=(b[0]=a[M>>2],b[1]=a[M+4>>2],f[0]);X=c+40|0;f[0]=M;a[X>>2]=b[0];a[X+4>>2]=b[1];M=y+3|0;y=(M<<4)+n|0;y=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]);X=c+48|0;f[0]=y;a[X>>2]=b[0];a[X+4>>2]=b[1];n=(M<<4)+n+8|0;M=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);n=c+56|0;f[0]=M;a[n>>2]=b[0];a[n+4>>2]=b[1];n=c|0;X=k-i;D=O-g;r=y-i;e=M-g;k=l|0;O=l+8|0;y=1;M=0;X=X*X+D*D;for(D=r*r+e*e;;){r=.5*(M+y);Ld(l,n,3,r,0,0);var Da=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),ia=(b[0]=a[O>>2],b[1]=a[O+4>>2],f[0]);if(1>be(X-D)){d=2672;break}if(1e-5>be(y-M)){d=2673;break}e=X<D;p=Da-i;j=ia-g;p=p*p+j*j;y=e?r:y;M=e?M:r;X=e?X:p;D=e?p:D}2673==d?(i=(x|0)>>2,f[0]=Da,a[i]=b[0],a[i+1]=b[1],x=(x+8|0)>>2,f[0]=ia,a[x]=b[0],a[x+1]=b[1],h=c):2672==d&&(i=(x|0)>>2,f[0]=Da,a[i]=b[0],a[i+1]=b[1],x=(x+8|0)>>2,f[0]=ia,a[x]=b[0],a[x+1]=b[1],h=c)}function hF(x){var r=x|0,i=Xb(r,a[rh>>2],.75,.01),g=x+48|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];i=Xb(r,a[sh>>2],.5,.02);g=x+56|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];var i=x+24|0,g=a,c=i>>2,d;a:{d=Aa(r,a[Fs>>2],Gs|0);var l;d=0==(Uk(V(x|0,Xk|0))|0)?d:101==m[d]<<24>>24&&0==(ka(d,Hs|0)|0)?d:th|0;var k=m[d];if(99==k<<24>>24){if(0!=(ka(d,th|0)|0)){var n=W;l=1910}}else{n=W,l=1910}b:do{if(1910==l){for(;;){l=0;var e=a[n>>2];if(0==(e|0)){break b}if(m[e]<<24>>24==k<<24>>24&&0==(ka(e,d)|0)){break}n=n+16|0}if(0!=(n|0)){d=n;break a}}}while(0);l=h;n=Is(d);0!=(n|0)?d=n:(n=a[mo>>2],k=n+1|0,a[mo>>2]=k,e=a[Yk>>2],k=0==(e|0)?Cb(k<<2):wb(e,k<<2),a[Yk>>2]=k,k=fa(16),e=k>>2,a[a[Yk>>2]+(n<<2)>>2]=k,a[e]=a[W>>2],a[e+1]=a[W+4>>2],a[e+2]=a[W+8>>2],a[e+3]=a[W+12>>2],n=Hb(d),a[e]=n,0==(a[iF>>2]|0)&&!(99==m[d]<<24>>24&&0==(ka(d,th|0)|0))?(d=a[W>>2],la(0,jF|0,(j=h,h+=8,a[j>>2]=d,a[j+4>>2]=n,j)),m[k+12|0]=0):m[k+12|0]=1,d=k);h=l}g[c]=d;l=mb(r,a[a[no>>2]+8>>2]);g=Xb(r,a[bo>>2],14,1);c=Aa(r,a[ao>>2],Li|0);d=Aa(r,a[Js>>2],Ac|0);a[x+120>>2]=ag(r,l,(0!=(bg(l)|0)?2:0)|(2==(ts(x)|0)?4:0),g,c,d);l=a[Ks>>2];0!=(l|0)&&(l=mb(r,a[l+8>>2]),0!=(l|0)&&0!=m[l]<<24>>24&&(a[x+124>>2]=ag(r,l,0!=(bg(l)|0)?2:0,g,c,d),g=a[x+20>>2]+149|0,m[g]|=16));m[x+160|0]=Zf(r,a[Ls>>2],0)&255;J[a[a[a[i>>2]+4>>2]>>2]](x)}function kF(x){var r,i,g,c=x>>2,d=h;h+=112;var l=d+16,k=d+32,n=d+72;g=(x+16|0)>>2;var e=a[a[g]+20>>2];i=(d+8|0)>>2;a[i]=0;r=(l+8|0)>>2;a[r]=0;var p=a[Ms>>2];if(0==(p|0)){var j=0,v=0}else{if(j=x|0,p=mb(j,a[p+8>>2]),0==(p|0)){v=j=0}else{if(0==m[p]<<24>>24){v=j=0}else{Ns(x,d);var t=0!=(bg(p)|0)?2:0,u=d|0,w=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),v=a[i],u=a[d+12>>2];a[c+27]=ag(j,p,t,w,v,u);p=e+149|0;m[p]|=1;m[x+126|0]=re(jc(j,a[Os>>2],Ze|0));j=1}}}t=a[Ps>>2];0!=(t|0)&&(p=x|0,t=mb(p,a[t+8>>2]),0!=(t|0)&&0!=m[t]<<24>>24&&(0==(v|0)?(Ns(x,d),u=d|0,w=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),i=a[i],u=a[d+12>>2]):i=v,a[c+30]=ag(p,t,0!=(bg(t)|0)?2:0,w,i,u),i=e+149|0,m[i]|=32));u=a[Zk>>2];i=x|0;if(0==(u|0)){u=0}else{if(u=mb(i,a[u+8>>2]),0==(u|0)){u=0}else{if(0==m[u]<<24>>24){u=0}else{lF(x,d,l);var w=0!=(bg(u)|0)?2:0,A=l|0,B=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]),p=a[r],A=a[l+12>>2];a[c+28]=ag(i,u,w,B,p,A);u=e+149|0;m[u]|=2;u=p}}}w=a[$k>>2];0!=(w|0)&&(w=mb(i,a[w+8>>2]),0!=(w|0)&&0!=m[w]<<24>>24&&(0==(u|0)?(lF(x,d,l),A=l|0,B=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]),r=a[r],l=a[l+12>>2]):(r=u,l=A),a[c+29]=ag(i,w,0!=(bg(w)|0)?2:0,B,r,l),e=e+149|0,m[e]|=4));e=V(i,vi|0);0!=(e|0)&&0!=m[e]<<24>>24&&(m[a[g]+161|0]=1);g=a[g];Qs(k,a[a[a[g+24>>2]+4>>2]+8>>2],g,e);k>>=2;g=(x+28|0)>>2;for(e=k+10;k<e;k++,g++){a[g]=a[k]}0!=mF(x,a[Rs>>2])<<24>>24&&(m[x+58|0]=0);k=V(i,wi|0);0!=(k|0)&&0!=m[k]<<24>>24&&(m[a[c+3]+161|0]=1);c=a[c+3];Qs(n,a[a[a[c+24>>2]+4>>2]+8>>2],c,k);k=n>>2;g=(x+68|0)>>2;for(e=k+10;k<e;k++,g++){a[g]=a[k]}if(0==mF(x,a[Ss>>2])<<24>>24){return h=d,j}m[x+98|0]=0;h=d;return j}function Ns(x,r){var i=x|0,g=Xb(i,a[Ts>>2],14,1),c=r|0;f[0]=g;a[c>>2]=b[0];a[c+4>>2]=b[1];a[r+8>>2]=Aa(i,a[Us>>2],Li|0);a[r+12>>2]=Aa(i,a[Vs>>2],Ac|0)}function lF(x,r,i){var g=r+8|0;0==(a[g>>2]|0)&&Ns(x,r);var x=x|0,c=r|0,c=Xb(x,a[Ws>>2],(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),1),d=i|0;f[0]=c;a[d>>2]=b[0];a[d+4>>2]=b[1];a[i+8>>2]=Aa(x,a[Xs>>2],a[g>>2]);a[i+12>>2]=Aa(x,a[Ys>>2],a[r+12>>2])}function Qs(b,r,i,g){var c,d=h;h+=80;var f=d+40,k=Jc(g,58);if(0==(k|0)){J[r](f,i,g,0);var r=f>>2,k=a[r+9],f=a[r+8],n=a[r+7],e=a[r+6],p=a[r+5],j=a[r+4],v=a[r+3],t=a[r+2],i=a[r+1],r=a[r]}else{m[k]=0;f=k+1|0;J[r](d,i,g,f);c=d>>2;var r=a[c],i=a[c+1],t=a[c+2],v=a[c+3],j=a[c+4],p=a[c+5],e=a[c+6],n=a[c+7],u=a[c+8];c=a[c+9];m[k]=58;k=c&0|f;f=u&-1|0;n=n&-1|0;e=e&-1|0;p=p&-1|0;j=j&-1|0;v=v&-1|0;t=t&-1|0;i=i&-1|0;r=r&-1|0}b>>=2;a[b]=r&-1|0;a[b+1]=i&-1|0;a[b+2]=t&-1|0;a[b+3]=v&-1|0;a[b+4]=j&-1|0;a[b+5]=p&-1|0;a[b+6]=e&-1|0;a[b+7]=n&-1|0;a[b+8]=f&-1|0;a[b+9]=k&0|g;h=d}function mF(b,r){if(0==(r|0)){var i=0}else{i=mb(b|0,a[r+8>>2]),i=0==(i|0)?0:0==m[i]<<24>>24?0:0==re(i)<<24>>24&1}return i}function al(x,r){var i,g,c=h;h+=32;i=x+52|0;var d,l=a[x+152>>2]&1,k,n,e,p;g=h;k=i>>2;d=h;h+=32;a[d>>2]=a[k];a[d+4>>2]=a[k+1];a[d+8>>2]=a[k+2];a[d+12>>2]=a[k+3];a[d+16>>2]=a[k+4];a[d+20>>2]=a[k+5];a[d+24>>2]=a[k+6];a[d+28>>2]=a[k+7];k=r+56|0;n=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);k=r+64|0;k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);var l=0==l<<24>>24,j=r+24|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),m=r+32|0,m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]);p=.5*(l?j:m);e=n-p;n+=p;p=(d|0)>>2;if(e<(b[0]=a[p],b[1]=a[p+1],f[0])){f[0]=e,a[p]=b[0],a[p+1]=b[1]}e=(d+16|0)>>2;if(n>(b[0]=a[e],b[1]=a[e+1],f[0])){f[0]=n,a[e]=b[0],a[e+1]=b[1]}n=.5*(l?m:j);l=k-n;k+=n;n=(d+8|0)>>2;if(l<(b[0]=a[n],b[1]=a[n+1],f[0])){f[0]=l,a[n]=b[0],a[n+1]=b[1]}l=(d+24|0)>>2;if(k>(b[0]=a[l],b[1]=a[l+1],f[0])){f[0]=k,a[l]=b[0],a[l+1]=b[1]}k=c>>2;d>>=2;a[k]=a[d];a[k+1]=a[d+1];a[k+2]=a[d+2];a[k+3]=a[d+3];a[k+4]=a[d+4];a[k+5]=a[d+5];a[k+6]=a[d+6];a[k+7]=a[d+7];h=g;g=i>>2;i=c>>2;a[g]=a[i];a[g+1]=a[i+1];a[g+2]=a[i+2];a[g+3]=a[i+3];a[g+4]=a[i+4];a[g+5]=a[i+5];a[g+6]=a[i+6];a[g+7]=a[i+7];h=c}function nF(x,r,i,g,c){var d=x|0;f[0]=r-g;a[d>>2]=b[0];a[d+4>>2]=b[1];x=x+8|0;f[0]=i-c;a[x>>2]=b[0];a[x+4>>2]=b[1]}function Df(a,b,i){var g;if(0==(i|0)){var c;return 0}for(;;){var d=i-1|0;if(0==(i|0)){g=2817;break}if((vf(m[a]&255)|0)!=(vf(m[b]&255)|0)){g=2817;break}if(0==(d|0)){c=0;g=2819;break}if(0==m[a]<<24>>24){c=0;g=2822;break}if(0==m[b]<<24>>24){c=0;g=2820;break}a=a+1|0;b=b+1|0;i=d}if(2819==g||2822==g){return c}if(2817==g){return c=vf(m[a]&255)-vf(m[b]&255)|0}if(2820==g){return c}}function oF(b){var r=oo(b,pF|0),i=ra(b),g=0==(i|0);a:do{if(!g){for(var c=i;;){var d=Ib(b,c),f=0==(d|0);b:do{if(!f){for(var k=d;;){var n=r,e=a[k+16>>2],h=a[k+12>>2];if(!(0==m[e+134|0]<<24>>24&&0==m[h+134|0]<<24>>24)){var j=k,e=Zs(e,n),n=Zs(h,n),n=uh(a[e+20>>2],e,n);po(j|0,n|0)}k=yb(b,k);if(0==(k|0)){break b}}}}while(0);c=ba(b,c);if(0==(c|0)){break a}}}}while(0);i=ra(r);if(0!=(i|0)){for(;!(bl(b,i|0),i=ba(r,i),0==(i|0));){}}Sf(r)}function ac(a,b,i,g,c){b=$(b,i);return 0!=(b|0)?b:a=J[c](a,i,g)}function GQa(x,r){var i,g=h;i=x>>2;x=h;h+=32;a[x>>2]=a[i];a[x+4>>2]=a[i+1];a[x+8>>2]=a[i+2];a[x+12>>2]=a[i+3];a[x+16>>2]=a[i+4];a[x+20>>2]=a[i+5];a[x+24>>2]=a[i+6];a[x+28>>2]=a[i+7];i=r>>2;r=h;h+=32;a[r>>2]=a[i];a[r+4>>2]=a[i+1];a[r+8>>2]=a[i+2];a[r+12>>2]=a[i+3];a[r+16>>2]=a[i+4];a[r+20>>2]=a[i+5];a[r+24>>2]=a[i+6];a[r+28>>2]=a[i+7];i=x+16|0;var c=r|0;if((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])){return h=g,0}i=r+16|0;c=x|0;if((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])){return h=g,0}i=x+24|0;c=r+8|0;if((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])){return h=g,0}i=r+24|0;c=x+8|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])>=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);h=g;return i&1}function $s(b){var r=h;h+=20;var i=r+8,g=a[b>>2],c=35==m[g]<<24>>24;a:do{if(c){var d=m[g+1|0],f=d&255;b:do{if(120==d<<24>>24||88==d<<24>>24){for(var k=0,e=2,z=f;;){if(8<=(e|0)){var p=k,j=e,v=z;break b}var z=m[g+e|0],t=z&255;do{if(6>(z-65&255)){var u=t-55|0}else{if(6>(z-97&255)){u=t-87|0}else{if(10<=(z-48&255)){p=k;j=e;v=t;break b}u=t-48|0}}}while(0);k=(k<<4)+u|0;e=e+1|0;z=u}}else{k=0;e=1;for(z=f;;){if(8<=(e|0)){p=k;j=e;v=z;break b}z=m[g+e|0];t=z&255;if(10<=(z-48&255)){p=k;j=e;v=t;break b}k=10*k-48+t|0;e=e+1|0;z=t}}}while(0);59!=(v|0)?(f=0,d=g):(f=p,d=j+(g+1)|0)}else{d=i|0;f=a[r>>2]=d;for(d=0;;){if(8<=(d|0)){f=0;d=g;break a}k=m[g+d|0];if(0==k<<24>>24){f=0;d=g;break a}else{if(59==k<<24>>24){break}}m[f]=k;f=f+1|0;d=d+1|0}m[f]=0;f=tn(r,F,252,8,110);0==(f|0)?(f=0,d=g):(f=a[f+4>>2],d=d+(g+1)|0)}}while(0);a[b>>2]=d;h=r;return f}function at(b){var r,i,g=h;h+=1044;i=g>>2;var c=g+4;fc(c,1024,g+20|0);a[i]=b+1|0;var d=m[b],f=0==d<<24>>24,b=(c+4|0)>>2;r=(c+8|0)>>2;a:do{if(!f){for(var k=d;;){38==k<<24>>24?(k=$s(g),k=0==(k|0)?38:k):k&=255;if(127>k>>>0){var e=a[b];e>>>0<a[r]>>>0||(na(c,1),e=a[b]);a[b]=e+1|0;m[e]=k&255}else{var z=a[b],e=a[r],p=z>>>0>=e>>>0;2047>k>>>0?(p&&(na(c,1),z=a[b],e=a[r]),p=z+1|0,a[b]=p,m[z]=(k>>>6|192)&255):(p&&(na(c,1),z=a[b],e=a[r]),p=z+1|0,a[b]=p,m[z]=(k>>>12|224)&255,p>>>0<e>>>0?z=p:(na(c,1),z=a[b],e=a[r]),p=z+1|0,a[b]=p,m[z]=(k>>>6&63|128)&255);p>>>0<e>>>0?e=p:(na(c,1),e=a[b]);a[b]=e+1|0;m[e]=(k&63|128)&255}k=a[i];a[i]=k+1|0;k=m[k];if(0==k<<24>>24){break a}}}}while(0);i=a[b];if(i>>>0<a[r]>>>0){return m[i]=0,r=a[(c|0)>>2],a[b]=r,b=Hb(r),uc(c),h=g,b}na(c,1);r=a[b];m[r]=0;r=a[(c|0)>>2];a[b]=r;b=Hb(r);uc(c);h=g;return b}function bt(b){var r,i=h;h+=1040;fc(i,1024,i+16|0);var g=m[b],c=0==g<<24>>24;r=(i+4|0)>>2;a:do{if(c){var d=a[r],f=i+8|0}else{for(var k=i+8|0,e=b,z=g;;){var p=e+1|0;if(127>(z&255)){e=a[r];if(e>>>0<a[k>>2]>>>0){var j=e}else{na(i,1),j=a[r]}e=j+1|0;a[r]=e;m[j]=z;z=p}else{z=m[p]&63|z<<6,p=a[r],p>>>0<a[k>>2]>>>0?j=p:(na(i,1),j=a[r]),p=j+1|0,a[r]=p,m[j]=z,z=e+2|0,e=p}p=m[z];if(0==p<<24>>24){d=e;f=k;break a}else{e=z,z=p}}}}while(0);if(d>>>0<a[f>>2]>>>0){return m[d]=0,b=a[(i|0)>>2],a[r]=b,r=Hb(b),uc(i),h=i,r}na(i,1);b=a[r];m[b]=0;b=a[(i|0)>>2];a[r]=b;r=Hb(b);uc(i);h=i;return r}function qF(x,r){var i,g=h;h+=40;i=r>>2;r=h;h+=32;a[r>>2]=a[i];a[r+4>>2]=a[i+1];a[r+8>>2]=a[i+2];a[r+12>>2]=a[i+3];a[r+16>>2]=a[i+4];a[r+20>>2]=a[i+5];a[r+24>>2]=a[i+6];a[r+28>>2]=a[i+7];var c=g+8;i=g+24;var d=r+16|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),l=x+64|0;if(d<(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])){return h=g,0}var l=x+80|0,k=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),l=r|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);if(k<l){return h=g,0}var k=r+24|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),e=x+72|0;if(k<(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])){return h=g,0}var e=x+88|0,z=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),e=r+8|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);if(z<e){return h=g,0}z=c|0;f[0]=.5*(d+l);a[z>>2]=b[0];a[z+4>>2]=b[1];d=c+8|0;f[0]=.5*(k+e);a[d>>2]=b[0];a[d+4>>2]=b[1];d=x+32|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);l=x+40|0;l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);k=c|0;c=c+8|0;nF(i,d,l,(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]));c=i|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);i=i+8|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);a[g>>2]=x;a[g+4>>2]=0;i=J[a[a[a[x+24>>2]+4>>2]+12>>2]](g,c,i);h=g;return i}function as(x,r){var i,g,c,d=h;h+=32;c=r>>2;r=h;h+=32;a[r>>2]=a[c];a[r+4>>2]=a[c+1];a[r+8>>2]=a[c+2];a[r+12>>2]=a[c+3];a[r+16>>2]=a[c+4];a[r+20>>2]=a[c+5];a[r+24>>2]=a[c+6];a[r+28>>2]=a[c+7];c=d+16;var l=x+24|0,k=.5*(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),l=x+32|0,e=.5*(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);g=(x+56|0)>>2;i=(x+64|0)>>2;nF(d,(b[0]=a[g],b[1]=a[g+1],f[0]),(b[0]=a[i],b[1]=a[i+1],f[0]),k,e);var l=d|0,z=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),l=d+8|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);g=(b[0]=a[g],b[1]=a[g+1],f[0]);i=(b[0]=a[i],b[1]=a[i+1],f[0])+e;e=c|0;f[0]=g+k;a[e>>2]=b[0];a[e+4>>2]=b[1];k=c+8|0;f[0]=i;a[k>>2]=b[0];a[k+4>>2]=b[1];k=c+8|0;k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);i=r+16|0;if((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<z){return h=d,0}c|=0;z=r|0;if((b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])<(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0])){return h=d,0}c=r+24|0;if((b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])<l){return h=d,0}c=r+8|0;c=k>=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);h=d;return c&1}function rF(x,r){var i,g=h;i=x>>2;x=h;h+=48;for(var c=x>>2,d=i+12;i<d;i++,c++){a[c]=a[i]}i=r>>2;r=h;h+=32;a[r>>2]=a[i];a[r+4>>2]=a[i+1];a[r+8>>2]=a[i+2];a[r+12>>2]=a[i+3];a[r+16>>2]=a[i+4];a[r+20>>2]=a[i+5];a[r+24>>2]=a[i+6];a[r+28>>2]=a[i+7];var l,c=a[x+4>>2];0==(c|0)&&sa(qo|0,1634,sF|0,tF|0);i=a[x>>2];for(var d=i|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),k=i+8|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),e=1,z=k,p=d;(e|0)<(c|0);){var j=(e<<4)+i|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),m=(e<<4)+i+8|0,m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]);if(-1==(uF(j,m,p,z,r)|0)){e=e+1|0,z=m,p=j}else{var t=1;l=3034;break}}if(3034==l){return h=g,t}if(0!=(a[x+8>>2]|0)&&(l=x+16|0,t=x+24|0,0!=vF((b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),d,k,r)<<24>>24)||0!=(a[x+12>>2]|0)&&(l=c-1|0,t=x+32|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),c=x+40|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),d=(l<<4)+i|0,i=(l<<4)+i+8|0,0!=vF(t,c,(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),r)<<24>>24)){return h=g,1}h=g;return 0}function ct(b){var r,i,g,c=h;h+=1044;var d;g=c>>2;var f=c+4;a[g]=b;fc(f,1024,c+20|0);i=(f+4|0)>>2;r=(f+8|0)>>2;a:for(;;){var k=b+1|0;a[g]=k;var e=m[b];if(0==e<<24>>24){d=3071;break}do{if(192>(e&255)){if(38!=e<<24>>24){var z=e}else{if(z=$s(c),0==(z|0)){z=38}else{if(127>z>>>0){z&=255}else{var p=a[i],s=a[r],v=p>>>0>=s>>>0;2047>z>>>0?(v?(na(f,1),s=a[i]):s=p,a[i]=s+1|0,m[s]=(z>>>6|192)&255):(v&&(na(f,1),p=a[i],s=a[r]),v=p+1|0,a[i]=v,m[p]=(z>>>12|224)&255,v>>>0<s>>>0?s=v:(na(f,1),s=a[i]),a[i]=s+1|0,m[s]=(z>>>6&63|128)&255);z=(z&63|128)&255}}}}else{if(224>(e&255)){if(-128!=(m[k]&-64)<<24>>24){d=3057;break a}z=a[i];z>>>0<a[r]>>>0||(na(f,1),z=a[i]);a[i]=z+1|0;m[z]=e;a[g]=b+2|0;z=m[k]}else{if(240<=(e&255)){d=3067;break a}if(-128!=(m[k]&-64)<<24>>24){d=3074;break a}z=b+2|0;if(-128!=(m[z]&-64)<<24>>24){d=3075;break a}s=a[i];p=a[r];s>>>0<p>>>0||(na(f,1),s=a[i],p=a[r]);v=s+1|0;a[i]=v;m[s]=e;a[g]=z;s=m[k];v>>>0<p>>>0?p=v:(na(f,1),p=a[i]);a[i]=p+1|0;m[p]=s;a[g]=b+3|0;z=m[z]}}}while(0);b=a[i];b>>>0<a[r]>>>0||(na(f,1),b=a[i]);a[i]=b+1|0;m[b]=z;b=a[g]}if(3067==d){la(1,wF|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Pe()}else{if(3074==d){la(1,dt|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Pe()}else{if(3075==d){la(1,dt|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Pe()}else{if(3071==d){g=a[i];if(g>>>0<a[r]>>>0){return m[g]=0,r=a[(f|0)>>2],a[i]=r,i=Hb(r),uc(f),h=c,i}na(f,1);r=a[i];m[r]=0;r=a[(f|0)>>2];a[i]=r;i=Hb(r);uc(f);h=c;return i}3057==d&&(la(1,xF|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Pe())}}}}function et(x,r){if(0==r<<24>>24){var i=x+48|0,i=36*(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),g=x+112|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];g=x+104|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];i=x+56|0}else{i=x+56|0,i=36*(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),g=x+112|0,f[0]=i,a[g>>2]=b[0],a[g+4>>2]=b[1],g=x+104|0,f[0]=i,a[g>>2]=b[0],a[g+4>>2]=b[1],i=x+48|0}i=72*(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);g=x+96|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1]}function yF(b,r){var i=h,g,c=0==(b|0);a:do{if(c){var d=r}else{d=m[b];if(0!=d<<24>>24){d=d<<24>>24;do{if(116==(d|0)||84==(d|0)){var f=0==(Lb(b+1|0,zF|0)|0)?8:0;g=3098}else{if(110==(d|0)||78==(d|0)){var k=b+1|0;if(0==(Lb(k,AF|0)|0)){d=0;break a}if(0==(Lb(k,ft|0)|0)){d=2;break a}}else{if(48==(d|0)){d=2;break a}else{if(99==(d|0)||67==(d|0)){f=0==(Lb(b+1|0,BF|0)|0)?10:0,g=3098}else{if(112==(d|0)||80==(d|0)){f=0==(Lb(b+1|0,CF|0)|0)?4:0,g=3098}else{if(115==(d|0)||83==(d|0)){f=0==(Lb(b+1|0,DF|0)|0)?8:0,g=3098}else{if(108==(d|0)||76==(d|0)){f=0==(Lb(b+1|0,EF|0)|0)?2:0,g=3098}else{if(49==(d|0)||50==(d|0)||51==(d|0)||52==(d|0)||53==(d|0)||54==(d|0)||55==(d|0)||56==(d|0)||57==(d|0)){d=8;break a}else{if(102==(d|0)||70==(d|0)){f=0==(Lb(b+1|0,FF|0)|0)?2:0,g=3098}else{if(111==(d|0)||79==(d|0)){f=0==(Lb(b+1|0,GF|0)|0)?6:0,g=3098}else{if(121==(d|0)||89==(d|0)){f=0==(Lb(b+1|0,HF|0)|0)?8:0,g=3098}}}}}}}}}}}}while(0);if(3098==g&&0!=(f|0)){d=f;break}la(0,IF|0,(j=h,h+=4,a[j>>2]=b,j))}d=r}}while(0);h=i;return d}function JF(a,b){var i=V(a|0,KF|0),i=0==(i|0)?b:0==m[i]<<24>>24?0:yF(i,b),g=a+164|0;D[g>>1]=(D[g>>1]&65535|i)&65535}function vF(x,r,i,g,c){var d,l=h;h+=128;d=c>>2;c=h;h+=32;a[c>>2]=a[d];a[c+4>>2]=a[d+1];a[c+8>>2]=a[d+2];a[c+12>>2]=a[d+3];a[c+16>>2]=a[d+4];a[c+20>>2]=a[d+5];a[c+24>>2]=a[d+6];a[c+28>>2]=a[d+7];var k=l+32,e=l+64;d=l+96;var z=c+16|0,z=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]);hh(l,x,r,i,g,1);var p=l|0;if(z>=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])){if(hh(k,x,r,i,g,1),k=k+16|0,z=c|0,(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])>=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0])){if(k=c+24|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),hh(e,x,r,i,g,1),e=e+8|0,k>=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])){if(hh(d,x,r,i,g,1),x=d+24|0,c=c+8|0,(b[0]=a[x>>2],b[1]=a[x+4>>2],f[0])>=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])){return h=l,1}}}}h=l;return 0}function Zs(b,r){var i=a[b+20>>2];if(0==m[b+134|0]<<24>>24){var g;return b}var c=b|0;gt(r,c);var d=Jc(a[b+12>>2],58);0==(d|0)&&sa(qo|0,1243,LF|0,MF|0);var d=d+1|0,f=Mi(i,d);if(0!=(f|0)){return f}i=cl(i,d);d=a[ro(c)+8>>2];f=a[d>>2];if(0==(f|0)){return i}for(c=i|0;;){var d=d+4|0,k=a[f+8>>2],f=a[f+4>>2];(mb(c,k)|0)!=(f|0)&&qc(c,k,f);f=a[d>>2];if(0==(f|0)){g=i;break}}return g}function ht(b,r){var i,g,c=a[r>>2];g=(r+24|0)>>2;a[g]=0;a[g+1]=0;a[g+2]=0;a[g+3]=0;if(0!=m[c]<<24>>24){var d=Cb(Ba(c)+1|0);m[d]=0;var f=r+12|0,k=d;a:for(;;){for(;;){var e=c+1|0,h=m[c];if(0==h<<24>>24){var p=k;break a}if(!(161>(h&255)|2!=(a[f>>2]|0)|-1==h<<24>>24)){m[k]=h;var h=m[e],j=k+2|0;m[k+1|0]=h;if(0==h<<24>>24){p=j;break a}else{k=j;c=c+2|0;continue}}if(10==h<<24>>24){i=3161;break}else{if(92==h<<24>>24){break}}m[k]=h;k=k+1|0;c=e}3161==i?(i=0,h=k+1|0,m[k]=0,so(b,r,d,110),k=h,c=e,d=h):(h=m[e],j=h<<24>>24,110==(j|0)||108==(j|0)||114==(j|0)?(h=k+1|0,m[k]=0,so(b,r,d,m[e]),d=k=h):(m[k]=h,k=k+1|0),c=0==m[e]<<24>>24?e:c+2|0)}(d|0)!=(p|0)&&(m[p]=0,so(b,r,d,110));i=(r+40|0)>>2;a[i]=a[g];a[i+1]=a[g+1];a[i+2]=a[g+2];a[i+3]=a[g+3]}}function so(x,r,i,g){var c,d=h;h+=16;var l;c=(r+76|0)>>1;var k=D[c]<<16>>16,e=r+72|0,z=a[e>>2],k=0==(z|0)?fa(76*k+152|0):NF(z,k+2|0,76,k+1|0);a[e>>2]=k;e=D[c]<<16>>16;z=k+76*e|0;a[z>>2]=i;m[k+76*e+72|0]=g;if(0==(i|0)){l=3175}else{if(0==m[i]<<24>>24){l=3175}else{var p=r+16|0,i=a[r+4>>2],g=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),s,p=h;h+=4;a[p>>2]=0;s=(z+20|0)>>2;a[s]=i;var v=z+24|0;f[0]=g;a[v>>2]=b[0];a[v+4>>2]=b[1];g=a;v=z+4>>2;var t=a[to>>2];0!=(t|0)&&0==(Lb(t,i)|0)?i=a[it>>2]:(a[to>>2]=i,i=tn(to,H,35,36,310),a[it>>2]=i);g[v]=i;i=0==m[ld]<<24>>24?0:0==(nD(a[s])|0)?0:p;x=a[a[x+172>>2]+132>>2];0==(x|0)?x=0:(x=a[x>>2],x=0==(x|0)?0:J[x](z,i));0==x<<24>>24&&OF(z,i);0!=(i|0)&&(x=a[p>>2],i=a[oa>>2],s=a[s],0==(x|0)?Va(i,PF|0,(j=h,h+=4,a[j>>2]=s,j)):Va(i,QF|0,(j=h,h+=8,a[j>>2]=s,a[j+4>>2]=x,j)));x=z+56|0;x=(b[0]=a[x>>2],b[1]=a[x+4>>2],f[0]);z=z+64|0;z=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]);s=d|0;f[0]=x;a[s>>2]=b[0];a[s+4>>2]=b[1];x=d+8|0;f[0]=z;a[x>>2]=b[0];a[x+4>>2]=b[1];h=p;p=d|0;z=d+8|0;p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]);s=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0])}}3175==l&&(l=r+16|0,l=1.2*(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])&-1|0,k=k+76*e+64|0,f[0]=l,a[k>>2]=b[0],a[k+4>>2]=b[1],p=0,s=l);D[c]=D[c]+1&65535;c=(r+24|0)>>2;l=(b[0]=a[c],b[1]=a[c+1],f[0]);f[0]=l>p?l:p;a[c]=b[0];a[c+1]=b[1];r=(r+32|0)>>2;c=(b[0]=a[r],b[1]=a[r+1],f[0])+s;f[0]=c;a[r]=b[0];a[r+1]=b[1];h=d}function ag(x,r,i,g,c,d){var l,k,e=h,z=fa(84);k=z>>2;var p=a[x>>2]<<28>>28;if(3==(p|0)){var s=l=0,v=x,p=a[x+32>>2]}else{1==(p|0)?(l=0,s=x,v=0,p=a[a[x+20>>2]+32>>2]):2==(p|0)?(l=x,v=s=0,p=a[a[a[x+12>>2]+20>>2]+32>>2]):p=v=s=l=0}a[k+1]=c;a[k+2]=d;c=z+16|0;f[0]=g;a[c>>2]=b[0];a[c+4>>2]=b[1];g=z+12|0;a[g>>2]=m[p+151|0]&255;if(0!=(i&4|0)){a[k]=Hb(r);if(0==(i&2|0)){return h=e,z}m[z+82|0]=1;h=e;return z}if(2==(i|0)){a[k]=Hb(r);m[z+82|0]=1;if(0==(RF(x,z)|0)){return h=e,z}x=a[x>>2]<<28>>28;3==(x|0)?la(3,SF|0,(j=h,h+=4,a[j>>2]=a[v+12>>2],j)):1==(x|0)?la(3,TF|0,(j=h,h+=4,a[j>>2]=a[s+12>>2],j)):2==(x|0)&&(p=0!=(a[p>>2]&16|0)?Bf|0:Af|0,x=a[a[l+12>>2]+12>>2],la(3,UF|0,(j=h,h+=12,a[j>>2]=a[a[l+16>>2]+12>>2],a[j+4>>2]=p,a[j+8>>2]=x,j)));h=e;return z}0!=(i|0)&&sa(VF|0,169,WF|0,XF|0);x=jt(r,x,0);l=z>>2;a[l]=x;x=1==(a[g>>2]|0)?at(x):ct(x);G(a[l]);a[l]=x;ht(p,z);h=e;return z}function jt(b,r,i){var g=r>>2,c=a[g]<<28>>28;if(3==(c|0)){var d=a[g+3],f=Ba(d),k=a[g+12];if(0==(k|0)){var e=0,h=0,p=Y|0,j=Y|0,v=d,t=yg|0,u=cg|0,w=Hg|0,A=Ig|0,B=dl|0,C=f,P=2,T=2,gb=2,y=2,M=2,D=0}else{var O=a[k>>2];if(0==(b|0)){h=e=0,p=Y|0,j=Y|0,v=d,t=yg|0,u=cg|0,w=Hg|0,A=Ig|0,B=O,C=f,M=y=gb=T=P=2}else{var F=Ba(O),h=e=0,p=Y|0,j=Y|0,v=d,t=yg|0,u=cg|0,w=Hg|0,A=Ig|0,B=O,C=f,y=gb=T=P=2,M=F}D=0}}else{if(2==(c|0)){var Da=a[g+4],ia=a[a[Da+20>>2]+32>>2],E=a[ia+12>>2],G=Ba(E),J=a[Da+12>>2],sc=Ba(J),H=a[g+16],I=0==(H|0)?0:Ba(H),K=a[a[g+3]+12>>2],L=a[g+26],ca=0==(L|0)?0:Ba(L),N=Ba(K),U=a[g+27];if(0==(U|0)){var zb=dl|0,ja=2}else{var aa=a[U>>2];0==(b|0)?(zb=aa,ja=2):(zb=aa,ja=Ba(aa))}e=1;h=ca;p=H;j=L;v=E;t=yg|0;u=0==(a[ia>>2]&16|0)?Af|0:Bf|0;w=K;A=J;B=zb;C=G;P=2;T=sc+(0==(I|0)?0:I+1|0)+N+(0==(ca|0)?0:ca+1|0)+2|0;gb=N;y=sc;M=ja;D=I}else{if(1==(c|0)){var da=a[a[g+5]+12>>2],ea=Ba(da),xa=a[g+3],Q=Ba(xa),Od=a[g+30];if(0==(Od|0)){h=e=0,p=Y|0,j=Y|0,v=da,t=xa,u=cg|0,w=Hg|0,A=Ig|0,B=dl|0,C=ea,P=Q,M=y=gb=T=2}else{var ha=a[Od>>2];if(0==(b|0)){h=e=0,p=Y|0,j=Y|0,v=da,t=xa,u=cg|0,w=Hg|0,A=Ig|0,B=ha,C=ea,P=Q,M=y=gb=T=2}else{var ga=Ba(ha),h=e=0,p=Y|0,j=Y|0,v=da,t=xa,u=cg|0,w=Hg|0,A=Ig|0,B=ha,C=ea,P=Q,y=gb=T=2,M=ga}}}else{h=e=0,p=Y|0,j=Y|0,v=YF|0,t=yg|0,u=cg|0,w=Hg|0,A=Ig|0,B=dl|0,M=y=gb=T=P=C=2}D=0}}var W=0==(i|0),Rb=0,S=b;a:for(;;){var tb=S+1|0,ya=m[S];if(0==ya<<24>>24){break}else{if(92!=ya<<24>>24){Rb=Rb+1|0;S=tb;continue}}var V=S+2|0,wa=m[tb]<<24>>24;do{if(71==(wa|0)){Rb=Rb+C|0;S=V;continue a}else{if(78==(wa|0)){Rb=Rb+P|0;S=V;continue a}else{if(69==(wa|0)){Rb=Rb+T|0;S=V;continue a}else{if(72==(wa|0)){Rb=Rb+gb|0;S=V;continue a}else{if(84==(wa|0)){Rb=Rb+y|0;S=V;continue a}else{if(76==(wa|0)){Rb=Rb+M|0;S=V;continue a}else{if(92==(wa|0)&&!W){Rb=Rb+1|0;S=V;continue a}}}}}}}}while(0);Rb=Rb+2|0;S=V}var Ab=Cb(Rb+1|0),Fa=0==(e|0),Ga=0==(D|0),R=0==(h|0),ta=b,Ka=Ab;a:for(;;){var za=ta+1|0,ma=m[ta];if(0==ma<<24>>24){break}else{if(92!=ma<<24>>24){m[Ka]=ma;ta=za;Ka=Ka+1|0;continue}}var pa=ta+2|0,la=m[za],Ha=la<<24>>24;do{if(76==(Ha|0)){var Ra=m[B];m[Ka]=Ra;if(0==Ra<<24>>24){ta=pa;continue a}else{var $=B,fa=Ka}for(;;){var La=$+1|0,Z=fa+1|0,Ya=m[La];m[Z]=Ya;if(0==Ya<<24>>24){ta=pa;Ka=Z;continue a}else{$=La,fa=Z}}}else{if(72==(Ha|0)){var ka=m[w];m[Ka]=ka;if(0==ka<<24>>24){ta=pa;continue a}else{var Za=w,sa=Ka}for(;;){var ab=Za+1|0,$a=sa+1|0,jb=m[ab];m[$a]=jb;if(0==jb<<24>>24){ta=pa;Ka=$a;continue a}else{Za=ab,sa=$a}}}else{if(84==(Ha|0)){var Ca=m[A];m[Ka]=Ca;if(0==Ca<<24>>24){ta=pa;continue a}else{var Ia=A,eb=Ka}for(;;){var ub=Ia+1|0,Sa=eb+1|0,ra=m[ub];m[Sa]=ra;if(0==ra<<24>>24){ta=pa;Ka=Sa;continue a}else{Ia=ub,eb=Sa}}}else{if(78==(Ha|0)){var ua=m[t];m[Ka]=ua;if(0==ua<<24>>24){ta=pa;continue a}else{var Oa=t,Wa=Ka}for(;;){var pb=Oa+1|0,ob=Wa+1|0,bb=m[pb];m[ob]=bb;if(0==bb<<24>>24){ta=pa;Ka=ob;continue a}else{Oa=pb,Wa=ob}}}else{if(71==(Ha|0)){var qb=m[v];m[Ka]=qb;if(0==qb<<24>>24){ta=pa;continue a}else{var ba=v,kb=Ka}for(;;){var qa=ba+1|0,vb=kb+1|0,xb=m[qa];m[vb]=xb;if(0==xb<<24>>24){ta=pa;Ka=vb;continue a}else{ba=qa,kb=vb}}}else{if(69==(Ha|0)){if(Fa){ta=pa;continue a}var hd=m[A];m[Ka]=hd;var nb=0==hd<<24>>24;b:do{if(nb){var rb=Ka}else{for(var lb=A,Ta=Ka;;){var cb=lb+1|0,fb=Ta+1|0,Ua=m[cb];m[fb]=Ua;if(0==Ua<<24>>24){rb=fb;break b}else{lb=cb,Ta=fb}}}}while(0);b:do{if(Ga){var sb=rb}else{m[rb]=58;for(var Na=rb,Fb=p;;){var Db=Na+1|0,Ob=m[Fb];m[Db]=Ob;if(0==Ob<<24>>24){sb=Db;break b}else{Na=Db,Fb=Fb+1|0}}}}while(0);var Eb=m[u];m[sb]=Eb;var na=0==Eb<<24>>24;b:do{if(na){var Bb=sb}else{for(var Ja=u,oa=sb;;){var Ea=Ja+1|0,va=oa+1|0,Ma=m[Ea];m[va]=Ma;if(0==Ma<<24>>24){Bb=va;break b}else{Ja=Ea,oa=va}}}}while(0);var Aa=m[w];m[Bb]=Aa;var Wf=0==Aa<<24>>24;b:do{if(Wf){var ic=Bb}else{for(var wb=w,Qa=Bb;;){var Va=wb+1|0,Pa=Qa+1|0,hb=m[Va];m[Pa]=hb;if(0==hb<<24>>24){ic=Pa;break b}else{wb=Va,Qa=Pa}}}}while(0);if(R){ta=pa;Ka=ic;continue a}m[ic]=58;for(var pc=ic,Wc=j;;){var Vb=pc+1|0,Xd=m[Wc];m[Vb]=Xd;if(0==Xd<<24>>24){ta=pa;Ka=Vb;continue a}else{pc=Vb,Wc=Wc+1|0}}}else{if(92==(Ha|0)&&!W){m[Ka]=92;ta=pa;Ka=Ka+1|0;continue a}}}}}}}}while(0);m[Ka]=92;m[Ka+1|0]=la;ta=pa;Ka=Ka+2|0}m[Ka]=0;return Ab}function ZF(b,r){var i;if(0!=(b|0)){var g=0<(r|0);a:do{if(g){var c=0,d=b;for(i=d>>2;;){if(0==(c|0)){var f=a[i];0!=(f|0)&&G(f)}f=a[i+2];if(0!=(f|0)&&(i=a[i+3],0!=(i|0))){J[i](f)}c=c+1|0;if((c|0)==(r|0)){break a}else{d=d+76|0,i=d>>2}}}}while(0);G(b)}}function vh(b){if(0!=(b|0)){G(a[b>>2]);var r=b+72|0;0==m[b+82|0]<<24>>24?ZF(a[r>>2],D[b+76>>1]<<16>>16):$F(a[r>>2],1);G(b)}}function Fg(x,r,i){var g,c,d;d=(a[x+16>>2]+12|0)>>2;var l=a[d];a[d]=r;if(0!=m[i+82|0]<<24>>24){aG(x,a[i+72>>2],i),a[d]=l}else{if(r=(i+76|0)>>1,1<=D[r]<<16>>16){bG(x,0);Pa(x,a[i+8>>2]);g=m[i+80|0]<<24>>24;if(116==(g|0)){g=i+64|0;c=i+48|0;var k=i+16|0,k=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])+.5*(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])}else{if(98==(g|0)){g=i+64|0;c=i+48|0;var k=i+32|0,e=i+16|0,k=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-.5*(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])+(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])-(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])}else{g=i+64|0,c=i+32|0,k=i+16|0,k=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])+.5*(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])}}e=0<D[r]<<16>>16;a:do{if(e){var h=i+72|0;c=(i+56|0)>>2;g=(i+40|0)>>2;for(var p=k,j=0,v=a[h>>2];;){var t=m[v+76*j+72|0]<<24>>24,t=114==(t|0)?(b[0]=a[c],b[1]=a[c+1],f[0])+.5*(b[0]=a[g],b[1]=a[g+1],f[0]):108==(t|0)?(b[0]=a[c],b[1]=a[c+1],f[0])-.5*(b[0]=a[g],b[1]=a[g+1],f[0]):(b[0]=a[c],b[1]=a[c+1],f[0]);As(x,t,p,v+76*j|0);v=a[h>>2];t=v+76*j+64|0;j=j+1|0;if((j|0)<(D[r]<<16>>16|0)){p-=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])}else{break a}}}}while(0);cG(x);a[d]=l}}}function ec(a,b){return jt(a,b,1)}function nc(b){var r,i=a[uo>>2];if(0==(i|0)){a[vo>>2]=64;var i=Cb(64),g=a[uo>>2]=i,c=0,d=0}else{g=i,d=c=0}for(;;){if(0==(b|0)){r=148;break}var f=m[b];if(0==f<<24>>24){r=147;break}var k=a[vo>>2];(d|0)>(k-8|0)&&(g=k<<1,a[vo>>2]=g,i=wb(i,g),a[uo>>2]=i,g=i+d|0,f=m[b]);if(60==f<<24>>24){var e=wo|0,h=4}else{38==f<<24>>24?0==(dG(b)|0)?(e=xo|0,h=5):r=142:62==f<<24>>24?(e=yo|0,h=4):45==f<<24>>24?(e=kt|0,h=5):32==f<<24>>24?0==(c|0)?r=142:32==m[c]<<24>>24?(e=lt|0,h=6):r=142:34==f<<24>>24?(e=zo|0,h=6):39!=f<<24>>24?r=142:(e=Ao|0,h=5)}142==r&&(r=0,e=b,h=1);d=h+d|0;k=h;c=e;for(f=g;!(k=k-1|0,m[f]=m[c],0==(k|0));){c=c+1|0,f=f+1|0}c=b;b=b+1|0;g=g+h|0}if(147==r||148==r){return m[g]=0,i}}function dG(a){var b=a+1|0,i=m[b];if(35!=i<<24>>24){for(a=b;;){b=a+1|0;if(!(26>(i-97&255)|26>(i-65&255))){var g=i;break}a=b;i=m[b]}return g=59==g<<24>>24&1}b=a+2|0;i=m[b];if(120==i<<24>>24||88==i<<24>>24){for(a=a+3|0;;){if(i=m[a],10>(i-48&255)|6>(i-97&255)|6>(i-65&255)){a=a+1|0}else{g=i;break}}}else{for(a=b;;){b=a+1|0;if(10<=(i-48&255)){g=i;break}a=b;i=m[b]}}return g=59==g<<24>>24&1}function uF(x,r,i,g,c){var d,l=h;d=c>>2;c=h;h+=32;a[c>>2]=a[d];a[c+4>>2]=a[d+1];a[c+8>>2]=a[d+2];a[c+12>>2]=a[d+3];a[c+16>>2]=a[d+4];a[c+20>>2]=a[d+5];a[c+24>>2]=a[d+6];a[c+28>>2]=a[d+7];var k;d=c|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);var e=d>x;if(e){var j=0}else{j=c+16|0,(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])<x?j=0:(j=c+8|0,(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])>r?j=0:(j=c+24|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])>=r))}if(d>i){k=170}else{var p=c+16|0;if((b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])<i){k=170}else{if(p=c+8|0,(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])>g){k=170}else{p=c+24|0;p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])>=g;if(j^p){return h=l,0}if(j&p){return h=l,1}}}}if(170==k&&j){return h=l,0}do{if(x==i){if(k=c+8|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),!(e|k<=r^k<=g^1)&&(k=c+16|0,(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])>=x)){return r=0,h=l,r}}else{if(r==g){if(!(d<=x^d<=i)){break}x=c+8|0;if((b[0]=a[x>>2],b[1]=a[x+4>>2],f[0])>r){break}c=c+24|0;if((b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])<r){break}else{r=0}h=l;return r}k=(g-r)/(i-x);var m=(j=x<i)?x:i,v=j?i:x,t=(d-x)*k+r,j=c+8|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);if(!(d<m|d>v|t<j)&&(p=c+24|0,t<=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]))){return r=0,h=l,r}p=c+16|0;p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]);t+=(p-d)*k;if(t>=j){var u=c+24|0;if(!(t>(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])|p<m|p>v)){return r=0,h=l,r}}m=(v=r<g)?r:g;v=v?g:r;t=(j-r)/k+x;if(t>=d&&!(t>p|j<m|j>v)){return r=0,h=l,r}u=c+24|0;u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]);k=t+(u-j)/k;if(k>=d&&!(k>p|u<m|u>v)){return r=0,h=l,r}}}while(0);h=l;return-1}function Mn(x){var r;r=(x+16|0)>>2;var i=(b[0]=a[r],b[1]=a[r+1],f[0]),g=x+32|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];g=x+48|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];i=x+24|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);g=x+40|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];i=x+8|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);g=x+56|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];x|=0;x=(b[0]=a[x>>2],b[1]=a[x+4>>2],f[0]);f[0]=x;a[r]=b[0];a[r+1]=b[1]}function Bo(b){var r,i=a[Co>>2];if(0==(i|0)){a[Do>>2]=64;var i=Cb(64),g=a[Co>>2]=i,c=0}else{g=i,c=0}for(;;){if(0==(b|0)){r=217;break}var d=m[b];if(0==d<<24>>24){r=218;break}var f=a[Do>>2];(c|0)>(f-8|0)&&(g=f<<1,a[Do>>2]=g,i=wb(i,g),a[Co>>2]=i,g=i+c|0,d=m[b]);if(60==d<<24>>24){var k=wo|0,e=4}else{34==d<<24>>24?(k=zo|0,e=6):39==d<<24>>24?(k=Ao|0,e=5):38==d<<24>>24?0==(dG(b)|0)?(k=xo|0,e=5):r=212:62==d<<24>>24?(k=yo|0,e=4):r=212}212==r&&(r=0,k=b,e=1);for(var c=e+c|0,h=e,d=k,f=g;!(h=h-1|0,m[f]=m[d],0==(h|0));){d=d+1|0,f=f+1|0}b=b+1|0;g=g+e|0}if(217==r||218==r){return m[g]=0,i}}function fa(a){if(0==(a|0)){a=0}else{var b=Cb(a);li(b,a);a=b}return a}function OF(x,r){var i,g,c;c=(x+56|0)>>2;f[0]=0;a[c]=b[0];a[c+1]=b[1];g=(x+24|0)>>2;i=(b[0]=a[g],b[1]=a[g+1],f[0]);var d=x+64|0;f[0]=1.2*i;a[d>>2]=b[0];a[d+4>>2]=b[1];d=x+40|0;f[0]=0;a[d>>2]=b[0];a[d+4>>2]=b[1];d=x+48|0;f[0]=.1*i;a[d>>2]=b[0];a[d+4>>2]=b[1];i=(x+20|0)>>2;d=a[i];a[x+8>>2]=d;a[x+12>>2]=0;0==(Df(d,eG|0,4)|0)?(d=fG|0,i=gG|0):0==(Df(a[i],hG|0,5)|0)?(d=mt|0,i=nt|0):(d=(i=0==(Df(a[i],iG|0,9)|0))?mt|0:jG|0,i=i?nt|0:kG|0);0!=(r|0)&&(a[r>>2]=d);d=a[x>>2];if(0!=(d|0)){var l=m[d],k=0==l<<24>>24,e=(b[0]=a[c],b[1]=a[c+1],f[0]);a:do{if(k){var h=e}else{for(var p=d,j=l,v=e;;){if(p=p+1|0,j=((j&255)<<3)+i|0,v+=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),f[0]=v,a[c]=b[0],a[c+1]=b[1],j=m[p],0==j<<24>>24){h=v;break a}}}}while(0);g=h*(b[0]=a[g],b[1]=a[g+1],f[0]);f[0]=g;a[c]=b[0];a[c+1]=b[1]}}function lG(x,r,i,g){for(var c;;){if(180==(g|0)){c=291;break}else{if(0==(g|0)){var d=r,l=i;break}else{if(90==(g|0)){c=290;break}else{if(270==(g|0)){c=297;break}}}}if(0>(g|0)){c=293;break}if(360>=(g|0)){c=296;break}g=(g|0)%360}if(291==c){d=r,l=-i}else{if(293==c){Ui(x,r,i,-g|0);return}if(290==c){d=i,l=-r}else{if(296==c){mG(x,r,i,g);return}297==c&&(d=i,l=r)}}r=x|0;f[0]=d;a[r>>2]=b[0];a[r+4>>2]=b[1];x=x+8|0;f[0]=l;a[x>>2]=b[0];a[x+4>>2]=b[1]}function Ui(x,r,i,g){for(var c;;){if(270==(g|0)){c=312;break}else{if(180==(g|0)){c=306;break}else{if(90==(g|0)){c=305;break}else{if(0==(g|0)){var d=r,l=i;break}}}}if(0>(g|0)){c=308;break}if(360>=(g|0)){c=311;break}g=(g|0)%360}if(312==c){d=i,l=r}else{if(306==c){d=r,l=-i}else{if(308==c){lG(x,r,i,-g|0);return}if(311==c){mG(x,r,i,360-g|0);return}305==c&&(d=-i,l=r)}}r=x|0;f[0]=d;a[r>>2]=b[0];a[r+4>>2]=b[1];x=x+8|0;f[0]=l;a[x>>2]=b[0];a[x+4>>2]=b[1]}function mG(x,r,i,g){if((a[ot>>2]|0)==(g|0)){var g=(b[0]=a[el>>2],b[1]=a[el+4>>2],f[0]),c=(b[0]=a[fl>>2],b[1]=a[fl+4>>2],f[0])}else{var d=(g|0)/6.283185307179586,c=Ce(d);f[0]=c;a[fl>>2]=b[0];a[fl+4>>2]=b[1];d=se(d);f[0]=d;a[el>>2]=b[0];a[el+4>>2]=b[1];a[ot>>2]=g;g=d}d=x|0;f[0]=g*r-c*i;a[d>>2]=b[0];a[d+4>>2]=b[1];x=x+8|0;f[0]=g*i+c*r;a[x>>2]=b[0];a[x+4>>2]=b[1]}function Cb(b){if(0==(b|0)){return 0}b=Gb(b);if(0==(b|0)){Lc(Eo|0,14,1,a[oa>>2]),S()}else{return b}}function NF(b,r,i,g){b=mc(b,i*r|0);0!=(b|0)|0==(r|0)||(Lc(Eo|0,14,1,a[oa>>2]),S());if(g>>>0>=r>>>0){return b}li(b+g*i|0,(r-g)*i|0);return b}function wb(b,r){var i=mc(b,r);if(0!=(i|0)|0==(r|0)){return i}Lc(Eo|0,14,1,a[oa>>2]);S()}function dD(a,b,i,g,c,d){i-=a;g-=b;a=(d-b)*i-(c-a)*g;a*=a;return 1e-10>a?0:a/(i*i+g*g)}function aG(x,r,i){var g,c,d=h;h+=60;var l;nG(x);c=d>>2;g=(i+56|0)>>2;a[c]=a[g];a[c+1]=a[g+1];a[c+2]=a[g+2];a[c+3]=a[g+3];a[d+20>>2]=a[i+8>>2];a[d+16>>2]=a[i+4>>2];i=i+16|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);g=d+32|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];g=x+16|0;c=V(a[a[g>>2]+8>>2]|0,pt|0);var k=d+48|0;a[k>>2]=c;i=d+52|0;a[i>>2]=a[a[g>>2]+152>>2];g=d+56|0;m[g]=0;0==(c|0)?l=551:0==m[c]<<24>>24&&(l=551);551==l&&(a[k>>2]=Ze|0);1==m[r+4|0]<<24>>24?(r=a[r>>2],Ke(x,a[a[x>>2]+296>>2]),l=a[r+24>>2],0==(l|0)?Pa(x,Ac|0):Pa(x,l),qt(x,r,d)):oG(x,a[r>>2],d);0!=m[g]<<24>>24&&G(a[i>>2]);r=a[x+16>>2]>>2;a[r+37]=0;a[r+42]=0;a[r+46]=0;a[r+38]=0;Ei(x);h=d}function nG(b){var r,i=wk(b);r=i>>2;var b=a[r]>>2,g=a[b+1];a[r+1]=g;a[r+3]=a[b+3];0==(g|0)?a[r+2]=a[b+2]:3==(g|0)?a[r+2]=a[b+2]:1==(g|0)?a[r+2]=a[b+2]:2==(g|0)&&(a[r+2]=a[b+2]);a[r+37]=a[b+37];a[r+42]=a[b+42];a[r+46]=a[b+46];r=i+200|0;a[r>>2]=a[r>>2]&-2|a[b+50]&1}function qt(x,r,i){var g,c,d,l,k,e=r>>2,j=h;h+=132;var p=j+32,s=j+68,v=r|0;c=j>>2;k=(r+40|0)>>2;a[c]=a[k];a[c+1]=a[k+1];a[c+2]=a[k+2];a[c+3]=a[k+3];a[c+4]=a[k+4];a[c+5]=a[k+5];a[c+6]=a[k+6];a[c+7]=a[k+7];k=i|0;l=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);k=i+8|0;var t=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);k=a[e+19];var u=0==(a[e]|0)?0!=(a[e+2]|0):1,w=r+100|0;g=a[w>>2];if(0!=(g|0)){d=i+16|0;var A=a[d>>2];if(0!=(A|0)){var B=a[g>>2];0==(B|0)?a[Fo>>2]=0:(a[Fo>>2]=A,a[d>>2]=B)}d=i+20|0;A=a[d>>2];0!=(A|0)&&(B=a[g+4>>2],0==(B|0)?a[Go>>2]=0:(a[Go>>2]=A,a[d>>2]=B));d=(i+32|0)>>2;A=(b[0]=a[d],b[1]=a[d+1],f[0]);0>A||(g=g+16|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),0>g?(f[0]=-1,a[wh>>2]=b[0],a[wh+4>>2]=b[1]):(f[0]=A,a[wh>>2]=b[0],a[wh+4>>2]=b[1],f[0]=g,a[d]=b[0],a[d+1]=b[1]))}g=(j|0)>>2;d=(b[0]=a[g],b[1]=a[g+1],f[0])+l;f[0]=d;a[g]=b[0];a[g+1]=b[1];g=j+16|0;d=(g|0)>>2;l=(b[0]=a[d],b[1]=a[d+1],f[0])+l;f[0]=l;a[d]=b[0];a[d+1]=b[1];l=(j+8|0)>>2;d=(b[0]=a[l],b[1]=a[l+1],f[0])+t;f[0]=d;a[l]=b[0];a[l+1]=b[1];l=(j+24|0)>>2;t=(b[0]=a[l],b[1]=a[l+1],f[0])+t;f[0]=t;a[l]=b[0];a[l+1]=b[1];t=u?0!=(a[x+148>>2]&4|0)?0:gl(x,i,v,j,p,1):0;l=m[r+104|0];0==(l&2)<<24>>24?(s=a[e+5],0!=(s|0)&&pG(x,s,j),s=m[r+29|0],0!=s<<24>>24&&qG(x,a[e+6],s&255,j)):(r=a[e+6],r=0==(r|0)?Ac|0:r,d=s>>2,a[d]=a[c],a[d+1]=a[c+1],a[d+2]=a[c+2],a[d+3]=a[c+3],d=s+32|0,c=d>>2,g>>=2,a[c]=a[g],a[c+1]=a[g+1],a[c+2]=a[g+2],a[c+3]=a[g+3],c=d|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),g=s+16|0,f[0]=c,a[g>>2]=b[0],a[g+4>>2]=b[1],c=s+8|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),g=s+24|0,f[0]=c,a[g>>2]=b[0],a[g+4>>2]=b[1],c=s|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),g=s+48|0,f[0]=c,a[g>>2]=b[0],a[g+4>>2]=b[1],c=s+40|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),g=s+56|0,f[0]=c,a[g>>2]=b[0],a[g+4>>2]=b[1],e=a[e+5],Ii(x,e,r,s|0,4,l&255,0!=(e|0)&1));e=a[k>>2];s=0==(e|0);a:do{if(!s){c=k;for(r=e;;){if(rG(x,r,i),c=c+4|0,r=a[c>>2],0==(r|0)){break a}}}}while(0);0!=(t|0)&&hl(x,p,1);u&&0!=(a[x+148>>2]&4|0)&&0!=(gl(x,i,v,j,p,0)|0)&&hl(x,p,0);0!=(a[w>>2]|0)&&(x=a[Fo>>2],0!=(x|0)&&(a[i+16>>2]=x),x=a[Go>>2],0!=(x|0)&&(a[i+20>>2]=x),x=(b[0]=a[wh>>2],b[1]=a[wh+4>>2],f[0]),0>x||(i=i+32|0,f[0]=x,a[i>>2]=b[0],a[i+4>>2]=b[1]));h=j}function oG(x,r,i){var g=D[r+4>>1];if(1<=g<<16>>16){var c=r+24|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),d=r+8|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),l=i|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])+.5*(c+d),k=i+8|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),e=r+32|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),h=r+16|0,h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]);sG(x,g<<16>>16,a[r>>2],l,k+.5*(e+h),.5*(c-d),i+16|0,h,e)}}function Ho(b){var r=b+12|0,i=a[r>>2]-1|0;a[r>>2]=i;0==(i|0)&&(r=a[b>>2],0!=(r|0)&&G(r),r=a[b+4>>2],0!=(r|0)&&G(r),G(b))}function Io(b){b>>=2;G(a[b]);G(a[b+1]);G(a[b+2]);G(a[b+4]);G(a[b+3]);G(a[b+5]);G(a[b+6])}function rt(b){var r;if(0!=(b|0)){var i=b|0,g=b+4|0,c=D[g>>1],d=0<c<<16>>16;a:do{if(d){for(var f=0,k=a[i>>2],e=c;;){var h=k+4|0;if(0<D[h>>1]<<16>>16){e=a[k>>2];r=e>>2;for(var j=0;;){var m=a[r];0!=(m|0)&&G(m);m=a[r+4];0!=(m|0)&&Ho(m);m=a[r+2];if(0!=(m|0)&&(r=a[r+3],0!=(r|0))){J[r](m)}j=j+1|0;if((j|0)<(D[h>>1]<<16>>16|0)){e=e+76|0,r=e>>2}else{break}}h=D[g>>1]}else{h=e}f=f+1|0;if((f|0)<(h<<16>>16|0)){k=k+24|0,e=h}else{break a}}}}while(0);i=a[i>>2];0!=(i|0)&&G(i);G(b)}}function $F(b,r){var i=m[b+4|0];if(3==i<<24>>24){i=a[b>>2],G(a[i+32>>2]),G(i)}else{if(1==i<<24>>24){var i=a[b>>2],g=i+76|0,c=a[g>>2];if(-1==(a[i+92>>2]|0)){Kc(c)}else{G(a[i+84>>2]);G(a[i+88>>2]);var d=a[c>>2],f=0==(d|0);a:do{if(!f){for(var k=c,e=d;;){if($F(e+80|0,0),Io(e|0),G(e),k=k+4|0,e=a[k>>2],0==(e|0)){break a}}}}while(0);G(a[g>>2])}g=a[i+100>>2];0!=(g|0)&&Ho(g);Io(i|0);G(i)}else{rt(a[b>>2])}}0!=(r|0)&&G(b)}function tG(b,r){var i,g=a[b+4>>2];if(0!=(g|0)&&0==(Lb(g,r)|0)){var c;return b|0}for(g=a[b+76>>2];;){var d=a[g>>2];if(0==(d|0)){c=0;i=668;break}var f=a[d+4>>2],d=0!=(f|0)&&0==(Lb(f,r)|0)?d|0:1!=m[d+84|0]<<24>>24?0:tG(a[d+80>>2],r);if(0==(d|0)){g=g+4|0}else{c=d;i=667;break}}if(668==i||667==i){return c}}function RF(b,r){var i,g=h;h+=148;var c=g+4,d=g+20;i=a[b>>2]<<28>>28;if(1==(i|0)){var f=a[b+20>>2]}else{2==(i|0)?f=a[a[b+12>>2]+20>>2]:3==(i|0)&&(f=a[b+32>>2])}f=a[f+32>>2];i=(r|0)>>2;var k=h;h+=152;var e=k+128,z=k+144;a[z>>2]=0;a[z+4>>2]=0;a[st>>2]=z;a[uG>>2]=0;a[vG>>2]=0;z=Nc(wG,a[Jo>>2]);a[Ko>>2]=z;z=Nc(xG,a[Jo>>2]);a[Lo>>2]=z;fc(e,128,k|0);a[yG>>2]=e;z=h;0==(a[Mo>>2]|0)&&(la(0,zG|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),a[Mo>>2]=a[Mo>>2]+1|0);h=z;a[g>>2]=2;Kc(a[Ko>>2]);Kc(a[Lo>>2]);a[Ko>>2]=0;a[Lo>>2]=0;a[st>>2]=0;uc(e);h=k;fc(c,128,d|0);m[r+82|0]=0;d=Hb(AG(b,c));a[i]=d;d=1==(a[r+12>>2]|0)?at(d):ct(d);k=a[i];G(k);a[i]=d;ht(f,r);uc(c);c=a[g>>2];h=g;return c}function AG(b,r){var i;i=a[b>>2]<<28>>28;2==(i|0)?(db(r,a[a[b+16>>2]+12>>2]),i=b+12|0,db(r,a[a[i>>2]+12>>2]),0==(a[a[a[i>>2]+20>>2]>>2]&16|0)?db(r,Af|0):db(r,Bf|0)):3==(i|0)?db(r,a[b+12>>2]):1==(i|0)&&db(r,a[b+12>>2]);i=(r+4|0)>>2;var g=a[i];if(g>>>0<a[r+8>>2]>>>0){return m[g]=0,g=a[(r|0)>>2],a[i]=g}na(r,1);g=a[i];m[g]=0;g=a[(r|0)>>2];return a[i]=g}function sG(x,r,i,g,c,d,l,k,e){var j,p,s=h;h+=76;p=l>>2;l=h;h+=24;a[l>>2]=a[p];a[l+4>>2]=a[p+1];a[l+8>>2]=a[p+2];a[l+12>>2]=a[p+3];a[l+16>>2]=a[p+4];a[l+20>>2]=a[p+5];var v;p=g-d;var t=g+d;bG(x,1);if(0<(r|0)){for(var d=(l+16|0)>>2,u=l|0,l=l+4|0,w=s|0,A=s+20|0,B=s+24|0,C=s+40|0,P=s+48|0,T=s+4|0,y=s+8|0,$e=s+56|0,M=s+64|0,X=s+72|0,O=.5*(e-k)+c,c=0;;){k=m[i+24*c+6|0]<<24>>24;114==(k|0)?(k=i+24*c+8|0,e=t-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])):108==(k|0)?e=p:(k=i+24*c+8|0,e=g-.5*(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]));var k=(i+24*c+16|0)>>2,O=O-(b[0]=a[k],b[1]=a[k+1],f[0]),F=i+24*c+4|0,Da=0<D[F>>1]<<16>>16;a:do{if(Da){var ia=e,E=0,J=a[(i>>2)+(6*c|0)];for(j=J>>2;;){var G=a[j+4];if(0==(G|0)){var sc=(b[0]=a[d],b[1]=a[d+1],f[0]),H=a[u>>2];v=844}else{var I=G+16|0,I=(b[0]=a[I>>2],b[1]=a[I+4>>2],f[0]),I=0<I?I:(b[0]=a[d],b[1]=a[d+1],f[0]),K=a[G>>2],K=0==(K|0)?a[u>>2]:K,G=a[G+4>>2];if(0==(G|0)){sc=I,H=K,v=844}else{var L=G,ca=I,N=K}}844==v&&(v=0,L=a[l>>2],ca=sc,N=H);Pa(x,L);a[w>>2]=a[j];a[A>>2]=N;f[0]=ca;a[B>>2]=b[0];a[B+4>>2]=b[1];G=J+40|0;G=(b[0]=a[G>>2],b[1]=a[G+4>>2],f[0]);f[0]=G;a[C>>2]=b[0];a[C+4>>2]=b[1];f[0]=1;a[P>>2]=b[0];a[P+4>>2]=b[1];a[T>>2]=a[j+1];a[y>>2]=a[j+2];j=(J+32|0)>>2;G=(b[0]=a[j],b[1]=a[j+1],f[0]);f[0]=G;a[$e>>2]=b[0];a[$e+4>>2]=b[1];G=(b[0]=a[k],b[1]=a[k+1],f[0]);f[0]=G;a[M>>2]=b[0];a[M+4>>2]=b[1];m[X]=108;As(x,ia,O,s);E=E+1|0;if((E|0)<(D[F>>1]<<16>>16|0)){ia+=(b[0]=a[j],b[1]=a[j+1],f[0]),J=J+76|0,j=J>>2}else{break a}}}}while(0);c=c+1|0;if((c|0)==(r|0)){break}}}cG(x);h=s}function gl(b,r,i,g,c,d){var f,k=h;h+=176;f=g>>2;g=h;h+=32;a[g>>2]=a[f];a[g+4>>2]=a[f+1];a[g+8>>2]=a[f+2];a[g+12>>2]=a[f+3];a[g+16>>2]=a[f+4];a[g+20>>2]=a[f+5];a[g+24>>2]=a[f+6];a[g+28>>2]=a[f+7];var e,z=k+16,p=k+48,s=a[b+16>>2];f=(s+148|0)>>2;var v=c|0;a[v>>2]=a[f];var t=s+168|0;a[c+4>>2]=a[t>>2];var u=s+184|0;a[c+8>>2]=a[u>>2];var w=s+152|0;a[c+12>>2]=a[w>>2];var A=s+200|0,c=c+16|0;m[c]=a[A>>2]<<31>>31&255;var B=a[i+16>>2];if(0==(B|0)){e=852}else{if(0==m[B]<<24>>24){e=852}else{var C=0,P=B}}852==e&&(fc(k,128,p|0),C=r+52|0,e=a[C>>2],0==(e|0)&&(e=Hb(Kn(b,a[s+8>>2]|0,k)),a[C>>2]=e,m[r+56|0]=1),r=e,db(k,r),r=z|0,z=a[tt>>2],a[tt>>2]=z+1|0,Ma(r,BG|0,(j=h,h+=4,a[j>>2]=z,j)),db(k,r),r=(k+4|0)>>2,z=a[r],z>>>0<a[k+8>>2]>>>0||(na(k,1),z=a[r]),m[z]=0,z=a[k>>2],a[r]=z,C=1,P=z);i=Or(b,0,a[i>>2],a[i+12>>2],a[i+8>>2],P,a[s+8>>2]|0);C&&uc(k);if(0==(i|0)){return h=k,i}0!=(d|0)&&!(0==(a[v>>2]|0)&&0==m[c]<<24>>24)&&Se(b);if(0==(a[f]|0)&&0==(a[A>>2]&1|0)){return h=k,i}Ln(b,g);ad(b,a[f],a[t>>2],a[u>>2],a[w>>2]);h=k;return i}function pG(b,r,i){var g,c=h;g=i>>2;i=h;h+=32;a[i>>2]=a[g];a[i+4>>2]=a[g+1];a[i+8>>2]=a[g+2];a[i+12>>2]=a[g+3];a[i+16>>2]=a[g+4];a[i+20>>2]=a[g+5];a[i+24>>2]=a[g+6];a[i+28>>2]=a[g+7];$b(b,r);Pa(b,r);mh(b,i,1);h=c}function qG(x,r,i,g){var c,d=h;c=g>>2;g=h;h+=32;a[g>>2]=a[c];a[g+4>>2]=a[c+1];a[g+8>>2]=a[c+2];a[g+12>>2]=a[c+3];a[g+16>>2]=a[c+4];a[g+20>>2]=a[c+5];a[g+24>>2]=a[c+6];a[g+28>>2]=a[c+7];r=0==(r|0)?Ac|0:r;$b(x,r);Pa(x,r);if(1==(i|0)){mh(x,g,0)}else{r=g+24|0;r=(b[0]=a[r>>2],b[1]=a[r+4>>2],f[0]);c=g+8|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);var l=r-c,k=g+16|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),g=g|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),e=k-g,j=i-1|0;No(x,g,c,j,l);i=1-i|0;No(x,g,r,e,i);No(x,k,r,i,-l);No(x,k,c,-e,j)}h=d}function rG(x,r,i){var g,c,d,l,k=h;h+=68;var e=k+36,j=r|0;l=e>>2;d=(r+40|0)>>2;a[l]=a[d];a[l+1]=a[d+1];a[l+2]=a[d+2];a[l+3]=a[d+3];a[l+4]=a[d+4];a[l+5]=a[d+5];a[l+6]=a[d+6];a[l+7]=a[d+7];d=i|0;g=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);d=i+8|0;l=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);d=0==(a[r>>2]|0)?0!=(a[r+8>>2]|0):1;c=(e|0)>>2;var p=(b[0]=a[c],b[1]=a[c+1],f[0])+g;f[0]=p;a[c]=b[0];a[c+1]=b[1];c=(e+16|0)>>2;g=(b[0]=a[c],b[1]=a[c+1],f[0])+g;f[0]=g;a[c]=b[0];a[c+1]=b[1];g=(e+8|0)>>2;c=(b[0]=a[g],b[1]=a[g+1],f[0])+l;f[0]=c;a[g]=b[0];a[g+1]=b[1];g=(e+24|0)>>2;l=(b[0]=a[g],b[1]=a[g+1],f[0])+l;f[0]=l;a[g]=b[0];a[g+1]=b[1];l=d?0!=(a[x+148>>2]&4|0)?0:gl(x,i,j,e,k,1):0;g=a[r+20>>2];0!=(g|0)&&pG(x,g,e);g=m[r+29|0];0!=g<<24>>24&&qG(x,a[r+24>>2],g&255,e);g=(r+80|0)>>2;r=m[r+84|0];if(3==r<<24>>24){g=a[g];r=h;h+=64;c=g|0;p=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);c=g+8|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);var s=g+16|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),v=g+24|0,v=(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0]),t=i|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),p=p+t,u=i+8|0,u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]);c+=u;s+=t;v+=u;t=r|0;f[0]=s;a[t>>2]=b[0];a[t+4>>2]=b[1];t=r+8|0;f[0]=v;a[t>>2]=b[0];a[t+4>>2]=b[1];t=r+32|0;f[0]=p;a[t>>2]=b[0];a[t+4>>2]=b[1];t=r+40|0;f[0]=c;a[t>>2]=b[0];a[t+4>>2]=b[1];t=r+16|0;f[0]=p;a[t>>2]=b[0];a[t+4>>2]=b[1];p=r+24|0;f[0]=v;a[p>>2]=b[0];a[p+4>>2]=b[1];p=r+48|0;f[0]=s;a[p>>2]=b[0];a[p+4>>2]=b[1];p=r+56|0;f[0]=c;a[p>>2]=b[0];a[p+4>>2]=b[1];c=a[g+36>>2];0==(c|0)&&(c=a[i+48>>2]);g=a[(g+32|0)>>2];ut(x,g,r|0,4,1,c);h=r}else{1==r<<24>>24?qt(x,a[g],i):oG(x,a[g],i)}0!=(l|0)&&hl(x,k,1);d&&0!=(a[x+148>>2]&4|0)&&0!=(gl(x,i,j,e,k,0)|0)&&hl(x,k,0);h=k}function hl(b,r,i){var g,c,d,f=a[b+16>>2];d=(f+148|0)>>2;0==(a[d]|0)?0==(a[f+200>>2]&1|0)?c=0:g=911:g=911;911==g&&(Se(b),c=a[d]);g=r|0;(c|0)!=(a[g>>2]|0)&&(G(c),a[d]=a[g>>2]);c=(f+168|0)>>2;g=a[c];var k=r+4|0;(g|0)!=(a[k>>2]|0)&&(G(g),a[c]=a[k>>2]);g=(f+184|0)>>2;var k=a[g],e=r+8|0;(k|0)!=(a[e>>2]|0)&&(G(k),a[g]=a[e>>2]);var k=f+152|0,e=a[k>>2],h=r+12|0;(e|0)!=(a[h>>2]|0)&&(G(e),e=a[h>>2],a[k>>2]=e);k=e;r=m[r+16|0]&1;f=f+200|0;a[f>>2]=a[f>>2]&-2|r;0!=(i|0)&&(i=a[d],0==(i|0)&0==(r|0)||ad(b,i,a[c],a[g],k))}function No(x,r,i,g,c){var d=h;h+=32;var l=d|0;f[0]=r;a[l>>2]=b[0];a[l+4>>2]=b[1];l=d+8|0;f[0]=i;a[l>>2]=b[0];a[l+4>>2]=b[1];l=d+16|0;f[0]=r+g;a[l>>2]=b[0];a[l+4>>2]=b[1];r=d+24|0;f[0]=i+c;a[r>>2]=b[0];a[r+4>>2]=b[1];mh(x,d,1);h=d}function Oo(x,r,i){var g=h;h+=8;var c=g+4;if(0!=m[ld]<<24>>24){var d=a[x+216>>2];if(0==(d|0)){var l=0,k=0}else{for(var e=0,z=0;;){var e=e+1|0,p=a[d+184>>2],s=0==(a[p>>2]|0);a:do{if(s){var v=z}else{for(var t=0,u=z;;){if(u=u+1|0,t=t+1|0,0==(a[p+(t<<2)>>2]|0)){v=u;break a}}}}while(0);d=a[d+168>>2];if(0==(d|0)){l=e;k=v;break}else{z=v}}}a[g>>2]=l;a[c>>2]=k;l=a[g>>2];c=a[c>>2];Va(a[oa>>2],CG|0,(j=h,h+=20,a[j>>2]=Po|0,a[j+4>>2]=l,a[j+8>>2]=c,a[j+12>>2]=i,a[j+16>>2]=r,j));mk(ih)}0==(DG(x)|0)&&EG();if(1>(i|0)){return vt(),h=g,0}x=V(x|0,FG|0);x=0==(x|0)?30:bh(x);a[Qo>>2]=x;if(0==(GG()|0)){x=0}else{return vt(),h=g,1}for(;;){c=HG();if(0==(c|0)){var w=x;break}IG(c,JG(a[c+12>>2],a[c+16>>2]));x=x+1|0;0!=m[ld]<<24>>24&&0==(x%100|0)&&(c=(x|0)%1e3,l=a[oa>>2],100==(c|0)?(Lc(Po|0,17,1,l),Va(a[oa>>2],wt|0,(j=h,h+=4,a[j>>2]=x,j))):(Va(l,wt|0,(j=h,h+=4,a[j>>2]=x,j)),0==(c|0)&&kk(10,a[oa>>2])));if((x|0)>=(i|0)){w=x;break}}1==(r|0)?KG():2==(r|0)?LG():MG();if(0==m[ld]<<24>>24){return h=g,0}99<(w|0)&&kk(10,a[oa>>2]);r=a[oa>>2];i=a[Le>>2];x=a[Ro>>2];c=Jn();Va(r,NG|0,(j=h,h+=24,a[j>>2]=Po|0,a[j+4>>2]=i,a[j+8>>2]=x,a[j+12>>2]=w,f[0]=c,a[j+16>>2]=b[0],a[j+20>>2]=b[1],j));h=g;return 0}function DG(b){var r;a[Ef>>2]=b;a[il>>2]=0;a[Ro>>2]=0;a[Le>>2]=0;var b=b+216|0,i=a[b>>2];if(0==(i|0)){r=0}else{for(var g=0,c=0;;){m[i+163|0]=0;r=g+1|0;a[Le>>2]=r;var g=a[i+184>>2],d=0==(a[g>>2]|0);a:do{if(d){var f=c}else{for(var e=0,h=c;;){if(h=h+1|0,a[Ro>>2]=h,e=e+1|0,0==(a[g+(e<<2)>>2]|0)){f=h;break a}}}}while(0);i=a[i+168>>2];if(0==(i|0)){break}else{g=r,c=f}}r<<=2}f=a[Vi>>2];r=0==(f|0)?Cb(r):wb(f,r);a[Vi>>2]=r;a[dg>>2]=0;r=a[eg>>2];r=0==(r|0)?Cb(a[Le>>2]<<2):wb(r,a[Le>>2]<<2);a[eg>>2]=r;a[jf>>2]=0;b=a[b>>2];if(0==(b|0)){var j;return 1}i=1;f=b;for(b=f>>2;;){r=(f+292|0)>>2;a[r]=0;f=f+176|0;g=a[a[f>>2]>>2];if(0==(g|0)){r=i,f=4}else{c=i;for(d=i=1;;){a[r]=d;a[g+168>>2]=0;a[g+172>>2]=-1;var p=0==(c|0)?0:(a[a[g+12>>2]+236>>2]-a[a[g+16>>2]+236>>2]|0)<(D[g+178>>1]&65535|0)?0:c,g=a[a[f>>2]+(i<<2)>>2];if(0==(g|0)){break}c=p;i=i+1|0;d=a[r]+1|0}r=p;f=(i<<2)+4|0}a[b+66]=fa(f);a[b+67]=0;f=a[b+46];for(i=0;;){var s=i+1|0;if(0==(a[f+(i<<2)>>2]|0)){break}else{i=s}}a[b+68]=fa(s<<2);a[b+69]=0;b=a[b+42];if(0==(b|0)){j=r;break}else{i=r,f=b,b=f>>2}}return j}function EG(){var b,r=h,i=ZE(a[Le>>2]),g=a[a[Ef>>2]+216>>2],c=0==(g|0);a:do{if(!c){for(var d=g;;){if(0==(a[d+292>>2]|0)&&Rk(i,d),d=a[d+168>>2],0==(d|0)){break a}}}}while(0);g=Sk(i);c=0==(g|0);a:do{if(c){b=0}else{for(var d=0,f=g;;){var e=f+236|0;a[e>>2]=0;var d=d+1|0,n=a[f+176>>2],z=a[n>>2],p=0==(z|0);b:do{if(!p){for(var m=0,v=z,t=0;;){if(v=(D[v+178>>1]&65535)+a[a[v+16>>2]+236>>2]|0,t=(t|0)>(v|0)?t:v,a[e>>2]=t,m=m+1|0,v=a[n+(m<<2)>>2],0==(v|0)){break b}}}}while(0);f=f+184|0;e=a[a[f>>2]>>2];n=0==(e|0);b:do{if(!n){z=0;for(p=e;;){if(p=p+12|0,m=a[p>>2]+292|0,t=a[m>>2]-1|0,a[m>>2]=t,1>(t|0)&&Rk(i,a[p>>2]),z=z+1|0,p=a[a[f>>2]+(z<<2)>>2],0==(p|0)){break b}}}}while(0);f=Sk(i);if(0==(f|0)){b=d;break a}}}}while(0);if((b|0)!=(a[Le>>2]|0)&&(la(1,OG|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),b=a[a[Ef>>2]+216>>2],0!=(b|0))){for(b>>=2;!(g=a[b+73],0!=(g|0)&&la(3,PG|0,(j=h,h+=8,a[j>>2]=a[b+3],a[j+4>>2]=g,j)),b=a[b+42],0==(b|0));){b>>=2}}G(a[i>>2]);G(i);h=r}function vt(){var b;b=a[a[Ef>>2]+216>>2];if(0!=(b|0)){var r=b;for(b=r>>2;;){var i=a[b+66];0!=(i|0)&&G(i);i=a[b+68];0!=(i|0)&&G(i);m[r+163|0]=0;b=a[b+42];if(0==(b|0)){break}else{r=b,b=r>>2}}}}function HG(){for(var b,r=a[il>>2],i=a[jf>>2],g=0,c=0,d=r;(d|0)<(i|0);){var f=a[a[eg>>2]+(d<<2)>>2],e=a[f+168>>2];if(0>(e|0)){if(e=0==(g|0)?f:(a[g+168>>2]|0)>(e|0)?f:g,f=c+1|0,(f|0)<(a[Qo>>2]|0)){g=e,c=f}else{var h=e;b=1036;break}}d=d+1|0;a[il>>2]=d}if(1036==b){return h}if(0<(r|0)){i=0}else{return g}for(;;){a[il>>2]=i;if((i|0)>=(r|0)){h=g;b=1033;break}d=a[a[eg>>2]+(i<<2)>>2];f=a[d+168>>2];if(0>(f|0)&&(g=0==(g|0)?d:(a[g+168>>2]|0)>(f|0)?d:g,c=c+1|0,(c|0)>=(a[Qo>>2]|0))){h=g;b=1035;break}i=i+1|0}if(1033==b||1035==b){return h}}function MG(){a[So>>2]=2147483647;a[xh>>2]=-2147483647;var b=a[a[Ef>>2]+216>>2],r=0==(b|0);a:do{if(r){var i=2147483647,g=-2147483647}else{for(var c=b,d=2147483647,f=-2147483647;;){if(0==m[c+162|0]<<24>>24){var e=a[c+236>>2],h=(d|0)<(e|0)?d:e;a[So>>2]=h;f=(f|0)>(e|0)?f:e;a[xh>>2]=f;e=h}else{e=d}h=f;c=a[c+168>>2];if(0==(c|0)){break}else{d=e,f=h}}if(0==(e|0)){return}for(c=b;;){if(f=c+236|0,a[f>>2]=a[f>>2]-e|0,c=a[c+168>>2],0==(c|0)){i=e;g=h;break a}}}}while(0);a[xh>>2]=g-i|0;a[So>>2]=0}function QG(b,r,i,g){var c,r=r+288|0,d=-i|0,f=0==(g|0)&1;for(c=b>>2;;){var e=a[r>>2];if((a[c+71]|0)<=(e|0)&&(e|0)<=(a[c+72]|0)){break}e=a[c+70];c=a[e+16>>2];var h=e+168|0;a[h>>2]=(0==(((b|0)==(c|0)?g:f)|0)?d:i)+a[h>>2]|0;b=a[e+12>>2];b=(a[c+288>>2]|0)>(a[b+288>>2]|0)?c:b;c=b>>2}return b}function RG(b,r){var i,g;g=(b+172|0)>>2;a[r+172>>2]=a[g];a[a[eg>>2]+(a[g]<<2)>>2]=r;a[g]=-1;var c=a[b+16>>2],d=c+276|0;g=a[d>>2]-1|0;a[d>>2]=g;for(var c=c+272|0,d=a[c>>2],f=0;;){var e=(f<<2)+d|0;if((f|0)>(g|0)){var h=e;break}if((a[e>>2]|0)==(b|0)){h=e;break}else{f=f+1|0}}a[h>>2]=a[d+(g<<2)>>2];a[a[c>>2]+(g<<2)>>2]=0;g=a[b+12>>2];c=g+268|0;h=a[c>>2]-1|0;a[c>>2]=h;g=g+264|0;c=a[g>>2];for(d=0;;){f=(d<<2)+c|0;if((d|0)>(h|0)){i=f;break}if((a[f>>2]|0)==(b|0)){i=f;break}else{d=d+1|0}}a[i>>2]=a[c+(h<<2)>>2];a[a[g>>2]+(h<<2)>>2]=0;g=a[r+16>>2];i=(g+276|0)>>2;h=a[i];a[i]=h+1|0;g=g+272|0;a[a[g>>2]+(h<<2)>>2]=r;a[a[g>>2]+(a[i]<<2)>>2]=0;g=a[r+12>>2];i=(g+268|0)>>2;h=a[i];a[i]=h+1|0;g=g+264|0;a[a[g>>2]+(h<<2)>>2]=r;a[a[g>>2]+(a[i]<<2)>>2]=0}function GG(){var b;if(2>(a[Le>>2]|0)){var r;return 0}a:for(;;){if((SG()|0)>=(a[Le>>2]|0)){b=1075;break}var i=a[a[Ef>>2]+216>>2];if(0==(i|0)){r=1;b=1078;break}else{var g=0}for(;;){var c=a[i+184>>2],d=a[c>>2],f=0==(d|0);b:do{if(f){var e=g}else{for(var h=g,j=0,p=d;;){if(0>(a[p+172>>2]|0)){var m=a[p+12>>2],v=a[p+16>>2],h=0==(TG(m,v)|0)?h:0!=(h|0)&&(a[m+236>>2]-a[v+236>>2]-(D[p+178>>1]&65535)|0)>=(a[a[h+12>>2]+236>>2]-a[a[h+16>>2]+236>>2]-(D[h+178>>1]&65535)|0)?h:p}j=j+1|0;p=a[c+(j<<2)>>2];if(0==(p|0)){e=h;break b}}}}while(0);i=a[i+168>>2];if(0==(i|0)){break}else{g=e}}if(0==(e|0)){r=1;b=1080;break}g=a[e+12>>2];i=a[e+16>>2];c=a[g+236>>2]-a[i+236>>2]|0;d=D[e+178>>1]&65535;f=c-d|0;if((c|0)!=(d|0)&&(g=(TG(g,i)|0)==(g|0)?-f|0:f,i=a[dg>>2],0<(i|0))){c=a[Vi>>2];for(d=0;;){if(f=a[c+(d<<2)>>2]+236|0,a[f>>2]=a[f>>2]+g|0,d=d+1|0,(d|0)>=(i|0)){continue a}}}}if(1080==b){return r}if(1075==b){return b=a[Ef>>2]+216|0,jl(a[b>>2],0,1),xt(a[b>>2],0),0}if(1078==b){return r}}function JG(b,r){var i=(a[r+288>>2]|0)<(a[b+288>>2]|0),g=i?r:b;a[yh>>2]=0;a[Ff>>2]=2147483647;a[To>>2]=a[g+284>>2];a[Uo>>2]=a[g+288>>2];i?Vo(g):Wo(g);return i=a[yh>>2]}function KG(){var b,r;MG();var i=fa((a[xh>>2]<<2)+4|0);r=i>>2;b=a[xh>>2];var g=0>(b|0);a:do{if(!g){for(var c=0;;){if(a[(c<<2>>2)+r]=0,c=c+1|0,(c|0)>(b|0)){break a}}}}while(0);b=a[Ef>>2]+216|0;g=a[b>>2];if(0!=(g|0)){for(;!(0==m[g+162|0]<<24>>24&&(c=(a[g+236>>2]<<2)+i|0,a[c>>2]=a[c>>2]+1|0),g=a[g+168>>2],0==(g|0));){}b=a[b>>2];if(0!=(b|0)){g=b;for(b=g>>2;;){if(0==m[g+162|0]<<24>>24){var c=a[xh>>2],d=a[b+44],f=a[d>>2],e=0==(f|0);a:do{if(e){var h=0,j=0}else{for(var p=0,s=0,v=0,t=f;;){if(p=p+ib[t+164>>2]&-1,t=(D[t+178>>1]&65535)+a[a[t+16>>2]+236>>2]|0,s=(s|0)>(t|0)?s:t,v=v+1|0,t=a[d+(v<<2)>>2],0==(t|0)){h=p;j=s;break a}}}}while(0);d=a[b+46];f=a[d>>2];e=0==(f|0);a:do{if(e){var u=0,w=c}else{p=0;s=c;v=0;for(t=f;;){if(p=p+ib[t+164>>2]&-1,t=a[a[t+12>>2]+236>>2]-(D[t+178>>1]&65535)|0,s=(s|0)<(t|0)?s:t,v=v+1|0,t=a[d+(v<<2)>>2],0==(t|0)){u=p;w=s;break a}}}}while(0);c=0>(j|0)?0:j;if((h|0)==(u|0)){d=c+1|0;f=(d|0)>(w|0);a:do{if(f){var A=c}else{e=c;for(s=d;;){if(e=(a[(s<<2>>2)+r]|0)<(a[(e<<2>>2)+r]|0)?s:e,s=s+1|0,(s|0)>(w|0)){A=e;break a}}}}while(0);c=g+236|0;d=(a[c>>2]<<2)+i|0;a[d>>2]=a[d>>2]-1|0;d=(A<<2)+i|0;a[d>>2]=a[d>>2]+1|0;a[c>>2]=A}c=a[b+66];0!=(c|0)&&G(c);c=a[b+68];0!=(c|0)&&G(c);m[g+163|0]=0}b=a[b+42];if(0==(b|0)){break}else{g=b,b=g>>2}}}}G(i)}function LG(){var b=a[jf>>2];if(0<(b|0)){for(var r=a[eg>>2],i=0;;){var g=a[r+(i<<2)>>2];if(0==(a[g+168>>2]|0)){var c=g+12|0,d=g+16|0,g=JG(a[c>>2],a[d>>2]);0!=(g|0)&&(g=a[a[g+12>>2]+236>>2]-a[a[g+16>>2]+236>>2]-(D[g+178>>1]&65535)|0,2>(g|0)||(d=a[d>>2],c=a[c>>2],(a[d+288>>2]|0)<(a[c+288>>2]|0)?fg(d,(g|0)/2&-1):fg(c,(g|0)/-2&-1)))}i=i+1|0;if((i|0)>=(b|0)){break}}}vt()}function fg(b,r){var i=b+236|0;a[i>>2]=a[i>>2]-r|0;var i=b+272|0,g=a[i>>2],c=a[g>>2],d=0==(c|0);a:do{if(!d){for(var f=b+280|0,e=1,h=c,j=g;;){(h|0)!=(a[f>>2]|0)&&(fg(a[h+12>>2],r),j=a[i>>2]);h=a[j+(e<<2)>>2];if(0==(h|0)){break a}e=e+1|0}}}while(0);i=b+264|0;f=a[i>>2];d=a[f>>2];if(0!=(d|0)){g=b+280|0;for(c=1;;){(d|0)!=(a[g>>2]|0)&&(fg(a[d+16>>2],r),f=a[i>>2]);d=a[f+(c<<2)>>2];if(0==(d|0)){break}c=c+1|0}}}function IG(b,r){var i,g,c,d;d=(r+12|0)>>2;c=(r+16|0)>>2;var f=a[a[d]+236>>2]-a[a[c]+236>>2]-(D[r+178>>1]&65535)|0;if(0<(f|0)){var e=a[b+16>>2];g=e>>2;if(1==(a[g+69]+a[g+67]|0)){fg(e,f)}else{var h=a[b+12>>2];i=h>>2;1==(a[i+69]+a[i+67]|0)?fg(h,-f|0):(a[g+72]|0)<(a[i+72]|0)?fg(e,f):fg(h,-f|0)}}i=b+168|0;g=a[i>>2];f=QG(a[c],a[d],g,1);(QG(a[d],a[c],g,0)|0)==(f|0)?(a[r+168>>2]=-g|0,a[i>>2]=0,RG(b,r),jl(f,a[f+280>>2],a[f+284>>2])):S()}function TG(a,b){var i,g=0==m[a+163|0]<<24>>24;if(0==m[b+163|0]<<24>>24){if(g){i=1154}else{var c=a}}else{g?c=b:i=1154}1154==i&&(c=0);return c}function yt(b,r,i){var b=b>>2,g,c=a[b+4],d=(c|0)==(r|0),c=a[(d?a[b+3]:c)+288>>2];if((a[r+284>>2]|0)>(c|0)){g=1160}else{if((c|0)>(a[r+288>>2]|0)){g=1160}else{var f=0,e=(-1<(a[b+43]|0)?a[b+42]|0:0)-ib[b+41]}}1160==g&&(f=1,e=ib[b+41]);g=e&-1;r=0<(i|0)?(a[b+3]|0)==(r|0)?1:-1:d?1:-1;f=0==(f|0)?r:-r|0;return f=0>(f|0)?-g|0:g}function jl(b,r,i){a[b+280>>2]=r;a[b+284>>2]=i;var g=b+272|0,c=a[g>>2],d=a[c>>2],f=0==(d|0);a:do{if(f){var e=i}else{for(var h=0,j=i,p=d,m=c;;){if((p|0)!=(r|0)&&(j=jl(a[p+12>>2],p,j),m=a[g>>2]),h=h+1|0,p=a[m+(h<<2)>>2],0==(p|0)){e=j;break a}}}}while(0);i=b+264|0;c=a[i>>2];d=a[c>>2];if(0==(d|0)){var v=e;a[(b+288|0)>>2]=v;return v+1|0}for(g=0;;){if((d|0)!=(r|0)&&(e=jl(a[d+16>>2],d,e),c=a[i>>2]),g=g+1|0,d=a[c+(g<<2)>>2],0==(d|0)){v=e;break}}a[(b+288|0)>>2]=v;return v+1|0}function Wo(b){var r=b+184|0,i=a[r>>2],g=a[i>>2],c=0==(g|0);a:do{if(!c){for(var d=b+288|0,f=0,e=g,h=i;;){if(0>(a[e+172>>2]|0)){var j=a[e+12>>2],p=a[j+288>>2];(a[To>>2]|0)>(p|0)|(p|0)>(a[Uo>>2]|0)&&(j=a[j+236>>2]-a[a[e+16>>2]+236>>2]-(D[e+178>>1]&65535)|0,(j|0)<(a[Ff>>2]|0)|0==(a[yh>>2]|0)&&(a[yh>>2]=e,a[Ff>>2]=j))}else{e=a[e+12>>2],(a[e+288>>2]|0)<(a[d>>2]|0)&&(Wo(e),h=a[r>>2])}f=f+1|0;e=a[h+(f<<2)>>2];if(0==(e|0)){break a}}}}while(0);r=b+264|0;d=a[r>>2];g=a[d>>2];c=a[Ff>>2];if(0!=(g|0)&0<(c|0)){b=b+288|0;for(i=1;;){g=a[g+16>>2];(a[g+288>>2]|0)<(a[b>>2]|0)&&(Wo(g),d=a[r>>2],c=a[Ff>>2]);g=a[d+(i<<2)>>2];if(!(0!=(g|0)&0<(c|0))){break}i=i+1|0}}}function Vo(b){var c=b+176|0,i=a[c>>2],g=a[i>>2],d=0==(g|0);a:do{if(!d){for(var f=b+288|0,e=0,k=g,h=i;;){if(0>(a[k+172>>2]|0)){var j=a[k+16>>2],p=a[j+288>>2];(a[To>>2]|0)>(p|0)|(p|0)>(a[Uo>>2]|0)&&(j=a[a[k+12>>2]+236>>2]-a[j+236>>2]-(D[k+178>>1]&65535)|0,(j|0)<(a[Ff>>2]|0)|0==(a[yh>>2]|0)&&(a[yh>>2]=k,a[Ff>>2]=j))}else{k=a[k+16>>2],(a[k+288>>2]|0)<(a[f>>2]|0)&&(Vo(k),h=a[c>>2])}e=e+1|0;k=a[h+(e<<2)>>2];if(0==(k|0)){break a}}}}while(0);c=b+272|0;f=a[c>>2];g=a[f>>2];d=a[Ff>>2];if(0!=(g|0)&0<(d|0)){b=b+288|0;for(i=1;;){g=a[g+12>>2];(a[g+288>>2]|0)<(a[b>>2]|0)&&(Vo(g),f=a[c>>2],d=a[Ff>>2]);g=a[f+(i<<2)>>2];if(!(0!=(g|0)&0<(d|0))){break}i=i+1|0}}}function SG(){var b,c=a[Ef>>2]+216|0,i=a[c>>2],g=0==(i|0);a:do{if(!g){var d=i;for(b=d>>2;;){if(m[d+163|0]=0,a[a[b+68]>>2]=0,a[a[b+66]>>2]=0,a[b+69]=0,a[b+67]=0,b=a[b+42],0==(b|0)){break a}else{d=b,b=d>>2}}}}while(0);i=a[jf>>2];g=0<(i|0);a:do{if(g){b=a[eg>>2];for(d=0;;){if(a[a[b+(d<<2)>>2]+172>>2]=-1,d=d+1|0,(d|0)>=(i|0)){break a}}}}while(0);a[jf>>2]=0;a[dg>>2]=0;c=a[c>>2];if(0==(c|0)){return 0}for(;!(Xo(c),c=a[c+168>>2],!(0!=(c|0)&0==(a[jf>>2]|0)));){}return c=a[dg>>2]}function xt(b,c){var i=b+272|0,g=a[i>>2],d=a[g>>2],f=0==(d|0);a:do{if(!f){for(var e=0,k=d,h=g;;){if((k|0)!=(c|0)&&(xt(a[k+12>>2],k),h=a[i>>2]),e=e+1|0,k=a[h+(e<<2)>>2],0==(k|0)){break a}}}}while(0);i=b+264|0;g=a[i>>2];d=a[g>>2];f=0==(d|0);a:do{if(!f){e=0;k=d;for(h=g;;){if((k|0)!=(c|0)&&(xt(a[k+16>>2],k),h=a[i>>2]),e=e+1|0,k=a[h+(e<<2)>>2],0==(k|0)){break a}}}}while(0);if(0!=(c|0)){g=a[c+16>>2];(a[g+280>>2]|0)==(c|0)?i=1:(i=-1,g=a[c+12>>2]);d=a[g+184>>2];f=a[d>>2];e=0==(f|0);a:do{if(e){var j=0}else{for(var k=h=0,p=f;;){if(h=yt(p,g,i)+h|0,k=k+1|0,p=a[d+(k<<2)>>2],0==(p|0)){j=h;break a}}}}while(0);d=a[g+176>>2];e=a[d>>2];if(0==(e|0)){var m=j}else{for(f=0;;){if(j=yt(e,g,i)+j|0,f=f+1|0,e=a[d+(f<<2)>>2],0==(e|0)){m=j;break}}}j=c+168|0;a[j>>2]=m}}function Xo(b){var c,i=b+184|0,g=0;a:for(;;){var d=a[a[i>>2]+(g<<2)>>2];if(0==(d|0)){c=1253;break}var f=d+12|0,e=a[f>>2];do{if(0==m[e+163|0]<<24>>24&&(a[e+236>>2]-a[a[d+16>>2]+236>>2]|0)==(D[d+178>>1]&65535|0)){zt(d);if((a[jf>>2]|0)==(a[Le>>2]-1|0)){var k=1;c=1268;break a}if(0!=(Xo(a[f>>2])|0)){k=1;c=1269;break a}}}while(0);g=g+1|0}if(1268==c){return k}if(1253==c){b=b+176|0;i=0;a:for(;;){g=a[a[b>>2]+(i<<2)>>2];if(0==(g|0)){k=0;c=1266;break}d=g+16|0;f=a[d>>2];do{if(0==m[f+163|0]<<24>>24&&(a[a[g+12>>2]+236>>2]-a[f+236>>2]|0)==(D[g+178>>1]&65535|0)){zt(g);if((a[jf>>2]|0)==(a[Le>>2]-1|0)){k=1;c=1267;break a}if(0!=(Xo(a[d>>2])|0)){k=1;c=1270;break a}}}while(0);i=i+1|0}if(1270==c||1266==c||1267==c){return k}}else{if(1269==c){return k}}}function At(x,c){var i,g,d,e,l,k=h;h+=144;var n=k+16,j=k+32,p=k+48,m=k+64,v=k+80,t=k+96,u=k+112;i=k+128;l=(x+52|0)>>2;var w=(b[0]=a[l],b[1]=a[l+1],f[0]);e=(x+60|0)>>2;var A=(b[0]=a[e],b[1]=a[e+1],f[0]);d=(x+68|0)>>2;var B=(b[0]=a[d],b[1]=a[d+1],f[0]);g=(x+76|0)>>2;var C=(b[0]=a[g],b[1]=a[g+1],f[0]);2>(c-1|0)>>>0?(zh(k,w,C),u=k|0,t=k+8|0,ce(n,(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])),u=n|0,u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),t=n+8|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),zh(j,B,A),B=j|0,j=j+8|0,ce(p,(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])),B=p|0,j=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),B=p+8|0,B=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),A=j,j=t,p=u):(zh(m,w,A),p=m|0,j=m+8|0,ce(v,(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])),p=v|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),j=v+8|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),zh(t,B,C),B=t|0,t=t+8|0,ce(u,(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])),B=u|0,t=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),B=u+8|0,B=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),A=t);f[0]=p;a[l]=b[0];a[l+1]=b[1];f[0]=j;a[e]=b[0];a[e+1]=b[1];f[0]=A;a[d]=b[0];a[d+1]=b[1];f[0]=B;a[g]=b[0];a[g+1]=b[1];e=a[x+48>>2];0!=(e|0)&&(g=e+56|0,d=g|0,e=e+64|0,ce(i,(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])),g>>=2,i>>=2,a[g]=a[i],a[g+1]=a[i+1],a[g+2]=a[i+2],a[g+3]=a[i+3]);i=x+208|0;if(1<=(a[i>>2]|0)){g=x+212|0;for(d=1;!(At(a[a[g>>2]+(d<<2)>>2],c),d=d+1|0,(d|0)>(a[i>>2]|0));){}}h=k}function zt(b){var c,i;c=b+172|0;-1<(a[c>>2]|0)&&S();i=a[jf>>2];a[c>>2]=i;a[jf>>2]=i+1|0;a[a[eg>>2]+(i<<2)>>2]=b;i=b+16|0;c=a[i>>2];if(0==m[c+163|0]<<24>>24){var g=a[dg>>2];a[dg>>2]=g+1|0;a[a[Vi>>2]+(g<<2)>>2]=c}c=b+12|0;g=a[c>>2];if(0==m[g+163|0]<<24>>24){var d=a[dg>>2];a[dg>>2]=d+1|0;a[a[Vi>>2]+(d<<2)>>2]=g}g=a[i>>2];m[g+163|0]=1;i=(g+276|0)>>2;d=a[i];a[i]=d+1|0;var f=g+272|0;a[a[f>>2]+(d<<2)>>2]=b;a[a[f>>2]+(a[i]<<2)>>2]=0;0==(a[a[g+184>>2]+(a[i]-1<<2)>>2]|0)&&S();i=a[c>>2];m[i+163|0]=1;c=(i+268|0)>>2;g=a[c];a[c]=g+1|0;d=i+264|0;a[a[d>>2]+(g<<2)>>2]=b;a[a[d>>2]+(a[c]<<2)>>2]=0;0==(a[a[i+176>>2]+(a[c]-1<<2)>>2]|0)&&S()}function zh(x,c,i){var g=x|0;f[0]=c;a[g>>2]=b[0];a[g+4>>2]=b[1];x=x+8|0;f[0]=i;a[x>>2]=b[0];a[x+4>>2]=b[1]}function ce(x,c,i){var g=h;h+=16;Ui(g,c,i,90*a[kl>>2]|0);var c=g|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),i=g+8|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),c=c-(b[0]=a[Yb>>2],b[1]=a[Yb+4>>2],f[0]),i=i-(b[0]=a[Yb+8>>2],b[1]=a[Yb+12>>2],f[0]),d=x|0;f[0]=c;a[d>>2]=b[0];a[d+4>>2]=b[1];x=x+8|0;f[0]=i;a[x>>2]=b[0];a[x+4>>2]=b[1];h=g}function Bt(x,c){var i,g,d,e=h;h+=1072;i=e+16;var l=e+32,k=e+48,n=ra(x);if(0!=(n|0)){for(;;){var z;g=n+24|0;var p=a[n+124>>2];if(0!=(p|0)){var s=g+8|0,v=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),s=g+16|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]);g=g+88|0;d=p+24|0;z=z+(v+(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]))+.5*(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);v=p+56|0;f[0]=z;a[v>>2]=b[0];a[v+4>>2]=b[1];v=p+64|0;f[0]=s;a[v>>2]=b[0];a[v+4>>2]=b[1];m[p+81|0]=1}p=z;n=ba(x,n);if(0==(n|0)){break}else{z=p}}}n=a[x+152>>2];p=n&3;a[kl>>2]=p;n&=1;m[Ct]=n;(g=0==n<<24>>24)?Dt(x):Et(x);n=x+48|0;z=a[n>>2];if(0==(z|0)){v=s=0}else{if(0!=m[z+81|0]<<24>>24){v=s=0}else{s=z+24|0;v=z+32|0;s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0])+16;v=(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0])+8;d=0!=(m[x+283|0]&1)<<24>>24;if(g){g=0==(p|0);d?g?(g=(x+76|0)>>2,d=(b[0]=a[g],b[1]=a[g+1],f[0])+v):(g=(x+60|0)>>2,d=(b[0]=a[g],b[1]=a[g+1],f[0])-v):g?(g=(x+60|0)>>2,d=(b[0]=a[g],b[1]=a[g+1],f[0])-v):(g=(x+76|0)>>2,d=(b[0]=a[g],b[1]=a[g+1],f[0])+v);f[0]=d;a[g]=b[0];a[g+1]=b[1];d=(x+68|0)>>2;var t=(b[0]=a[d],b[1]=a[d+1],f[0]);g=(x+52|0)>>2;var u=(b[0]=a[g],b[1]=a[g+1],f[0]),w=t-u}else{d?(g=(x+68|0)>>2,d=(b[0]=a[g],b[1]=a[g+1],f[0])+v):(g=(x+52|0)>>2,d=(b[0]=a[g],b[1]=a[g+1],f[0])-v),f[0]=d,a[g]=b[0],a[g+1]=b[1],d=(x+76|0)>>2,t=(b[0]=a[d],b[1]=a[d+1],f[0]),g=(x+60|0)>>2,u=(b[0]=a[g],b[1]=a[g+1],f[0]),w=t-u}s>w&&(w=.5*(s-w),f[0]=u-w,a[g]=b[0],a[g+1]=b[1],f[0]=t+w,a[d]=b[0],a[d+1]=b[1])}}0==(c|0)?i=z:(1==(p|0)?(i=x+76|0,l=x+52|0,zh(e,-(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])),i=e>>2,a[Yb>>2]=a[i],a[Yb+4>>2]=a[i+1],a[Yb+8>>2]=a[i+2],a[Yb+12>>2]=a[i+3]):0==(p|0)?(i=(x+52|0)>>2,a[Yb>>2]=a[i],a[Yb+4>>2]=a[i+1],a[Yb+8>>2]=a[i+2],a[Yb+12>>2]=a[i+3]):2==(p|0)?(l=x+52|0,p=x+76|0,zh(i,(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),-(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])),i>>=2,a[Yb>>2]=a[i],a[Yb+4>>2]=a[i+1],a[Yb+8>>2]=a[i+2],a[Yb+12>>2]=a[i+3]):3==(p|0)&&(i=x+60|0,p=x+52|0,zh(l,(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])),i=l>>2,a[Yb>>2]=a[i],a[Yb+4>>2]=a[i+1],a[Yb+8>>2]=a[i+2],a[Yb+12>>2]=a[i+3]),UG(x),i=a[n>>2]);0!=(i|0)&&0==m[i+81|0]<<24>>24&&(n=s,i=v,l=m[x+283|0],p=l<<24>>24,0==(p&4|0)?(z=x+52|0,z=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]),0==(p&2|0)?(n=x+68|0,n=.5*(z+(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]))):n=z+.5*n):(p=x+68|0,n=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])-.5*n),0==(l&1)<<24>>24?(l=x+60|0,i=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])+.5*i):(l=x+76|0,i=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])-.5*i),l=x+48|0,p=a[l>>2],z=p+56|0,f[0]=n,a[z>>2]=b[0],a[z+4>>2]=b[1],n=p+64|0,f[0]=i,a[n>>2]=b[0],a[n+4>>2]=b[1],m[a[l>>2]+81|0]=1);0!=(a[Yn>>2]|0)&&(k|=0,0==m[Ct]<<24>>24?(i=(b[0]=a[Yb+8>>2],b[1]=a[Yb+12>>2],f[0]),l=(b[0]=a[Yb>>2],b[1]=a[Yb+4>>2],f[0]),Ma(k,VG|0,(j=h,h+=48,f[0]=i,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=i,a[j+16>>2]=b[0],a[j+20>>2]=b[1],f[0]=l,a[j+24>>2]=b[0],a[j+28>>2]=b[1],f[0]=-l,a[j+32>>2]=b[0],a[j+36>>2]=b[1],f[0]=-i,a[j+40>>2]=b[0],a[j+44>>2]=b[1],j))):(i=(b[0]=a[Yb>>2],b[1]=a[Yb+4>>2],f[0]),l=(b[0]=a[Yb+8>>2],b[1]=a[Yb+12>>2],f[0]),Ma(k,WG|0,(j=h,h+=32,f[0]=i,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=i,a[j+16>>2]=b[0],a[j+20>>2]=b[1],f[0]=l,a[j+24>>2]=b[0],a[j+28>>2]=b[1],j))),k=Hb(k),a[a[Yn>>2]>>2]=k);h=e}function Et(x){if((a[x+32>>2]|0)!=(x|0)){var c=x+48|0,i=a[c>>2];if(0!=(i|0)&&0==m[i+81|0]<<24>>24){var g=m[x+283|0];if(0==(g&1)<<24>>24){var d=x+132|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),e=x+52|0,d=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])+.5*d,e=x+140|0}else{d=x+100|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),e=x+68|0,d=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])-.5*d,e=x+108|0}e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);g=g<<24>>24;0==(g&4|0)?0==(g&2|0)?(g=x+60|0,e=x+76|0,g=.5*((b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])+(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]))):(g=x+76|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-.5*e):(g=x+60|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])+.5*e);e=i+56|0;f[0]=d;a[e>>2]=b[0];a[e+4>>2]=b[1];i=i+64|0;f[0]=g;a[i>>2]=b[0];a[i+4>>2]=b[1];m[a[c>>2]+81|0]=1}}c=x+208|0;if(1<=(a[c>>2]|0)){x=x+212|0;for(i=1;!(Et(a[a[x>>2]+(i<<2)>>2]),i=i+1|0,(i|0)>(a[c>>2]|0));){}}}function Dt(x){if((a[x+32>>2]|0)!=(x|0)){var c=x+48|0,i=a[c>>2];if(0!=(i|0)&&0==m[i+81|0]<<24>>24){var g=m[x+283|0];if(0==(g&1)<<24>>24){var d=x+92|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),e=x+60|0,d=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])+.5*d,e=x+84|0}else{d=x+124|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),e=x+76|0,d=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])-.5*d,e=x+116|0}e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);g=g<<24>>24;if(0==(g&4|0)){var l=x+52|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);0==(g&2|0)?(g=x+68|0,g=.5*(l+(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]))):g=l+.5*e}else{g=x+68|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-.5*e}e=i+56|0;f[0]=g;a[e>>2]=b[0];a[e+4>>2]=b[1];i=i+64|0;f[0]=d;a[i>>2]=b[0];a[i+4>>2]=b[1];m[a[c>>2]+81|0]=1}}c=x+208|0;if(1<=(a[c>>2]|0)){x=x+212|0;for(i=1;!(Dt(a[a[x>>2]+(i<<2)>>2]),i=i+1|0,(i|0)>(a[c>>2]|0));){}}}function UG(x){var c,i,g,d=h;h+=32;var e=d+16;if(0==(b[0]=a[Yb>>2],b[1]=a[Yb+4>>2],f[0])){if(!(0!=(b[0]=a[Yb+8>>2],b[1]=a[Yb+12>>2],f[0])|0!=(a[kl>>2]|0))){h=d;return}}var l=ra(x),k=0==(l|0);a:do{if(!k){g=d>>2;i=e>>2;for(var n=l;;){0!=(a[kl>>2]|0)&&et(n,0);var j=c=n+32|0,p=n+40|0;ce(d,(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]));c>>=2;a[c]=a[g];a[c+1]=a[g+1];a[c+2]=a[g+2];a[c+3]=a[g+3];j=a[n+124>>2];0!=(j|0)&&(p=j+56|0,c=p>>2,j=j+64|0,ce(e,(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])),a[c]=a[i],a[c+1]=a[i+1],a[c+2]=a[i+2],a[c+3]=a[i+3]);c=1==(a[Ah>>2]|0);b:do{if(c&&(j=Ib(x,n),0!=(j|0))){for(;;){if(XG(j),j=yb(x,j),0==(j|0)){break b}}}}while(0);n=ba(x,n);if(0==(n|0)){break a}}}}while(0);At(x,a[x+152>>2]&3);h=d}function XG(x){var c,i,g,d,e,l,k,n,z,p,s;i=x>>2;var v=h;h+=112;var t=v+16,u=v+32;e=v+48;d=v+64;g=v+80;c=v+96;l=(x+24|0)>>2;var w=a[l];if(0==(w|0)){if(0!=m[Wi]<<24>>24&&6==m[x+124|0]<<24>>24){h=v;return}c=a[a[i+3]+12>>2];la(1,YG|0,(j=h,h+=8,a[j>>2]=a[a[i+4]+12>>2],a[j+4>>2]=c,j))}else{var A=0<(a[w+4>>2]|0);a:do{if(A){s=u>>2;p=t>>2;var x=v>>2,B=0;for(k=w;;){k=a[k>>2]>>2;n=a[k+(12*B|0)];var C=a[k+(12*B|0)+1],P=a[k+(12*B|0)+2];k=a[k+(12*B|0)+3];var T=0<(C|0);b:do{if(T){for(var y=0;;){z=(y<<4)+n|0;var D=z|0,M=(y<<4)+n+8|0;ce(v,(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),(b[0]=a[M>>2],b[1]=a[M+4>>2],f[0]));z>>=2;a[z]=a[x];a[z+1]=a[x+1];a[z+2]=a[x+2];a[z+3]=a[x+3];y=y+1|0;if((y|0)==(C|0)){break b}}}}while(0);0!=(P|0)&&(P=a[a[l]>>2],n=P+48*B+16|0,C=n|0,P=P+48*B+24|0,ce(t,(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),(b[0]=a[P>>2],b[1]=a[P+4>>2],f[0])),n>>=2,a[n]=a[p],a[n+1]=a[p+1],a[n+2]=a[p+2],a[n+3]=a[p+3]);0!=(k|0)&&(C=a[a[l]>>2],k=C+48*B+32|0,n=k|0,C=C+48*B+40|0,ce(u,(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0])),k>>=2,a[k]=a[s],a[k+1]=a[s+1],a[k+2]=a[s+2],a[k+3]=a[s+3]);B=B+1|0;k=a[l];if((B|0)>=(a[k+4>>2]|0)){break a}}}}while(0);u=a[i+27];0!=(u|0)&&(l=u+56|0,t=l|0,u=u+64|0,ce(e,(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])),l>>=2,e>>=2,a[l]=a[e],a[l+1]=a[e+1],a[l+2]=a[e+2],a[l+3]=a[e+3]);t=a[i+30];0!=(t|0)&&(e=t+56|0,l=e|0,t=t+64|0,ce(d,(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])),e>>=2,d>>=2,a[e]=a[d],a[e+1]=a[d+1],a[e+2]=a[d+2],a[e+3]=a[d+3]);l=a[i+28];0!=(l|0)&&(d=l+56|0,e=d|0,l=l+64|0,ce(g,(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])),d>>=2,g>>=2,a[d]=a[g],a[d+1]=a[g+1],a[d+2]=a[g+2],a[d+3]=a[g+3]);d=a[i+29];0!=(d|0)&&(i=d+56|0,g=i|0,d=d+64|0,ce(c,(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])),i>>=2,c>>=2,a[i]=a[c],a[i+1]=a[c+1],a[i+2]=a[c+2],a[i+3]=a[c+3])}h=v}function Ft(x,c,i,g,d,e,l,k){var n,j,p=h;h+=88;var m=p+8;j=m>>2;var v=p+16;n=p+24;var t=p+56,u=p|0;a[u>>2]=d;d=p+4|0;a[d>>2]=e;e=n|0;f[0]=x;a[e>>2]=b[0];a[e+4>>2]=b[1];x=n+8|0;f[0]=c;a[x>>2]=b[0];a[x+4>>2]=b[1];c=n+16|0;f[0]=i;a[c>>2]=b[0];a[c+4>>2]=b[1];i=n+24|0;f[0]=g;a[i>>2]=b[0];a[i+4>>2]=b[1];if(-1==(Gt(p,n|0,m)|0)){return h=p,0}do{if(0==(k|0)){g=a[d>>2];m=a[Bh>>2];(g|0)>(a[ll>>2]|0)&&(m=0==(m|0)?Cb(g<<5):wb(m,g<<5),a[Bh>>2]=m,a[ll>>2]=g);n=0<(g|0);a:do{if(n){i=a[u>>2];for(c=0;;){if(e=((c<<5)+m|0)>>2,x=((c<<4)+i|0)>>2,a[e]=a[x],a[e+1]=a[x+1],a[e+2]=a[x+2],a[e+3]=a[x+3],x=c+1|0,e=((c<<5)+m+16|0)>>2,c=((x%g<<4)+i|0)>>2,a[e]=a[c],a[e+1]=a[c+1],a[e+2]=a[c+2],a[e+3]=a[c+3],(x|0)<(g|0)){c=x}else{break a}}}}while(0);n=t>>2;a[n]=0;a[n+1]=0;a[n+2]=0;a[n+3]=0;a[n+4]=0;a[n+5]=0;a[n+6]=0;a[n+7]=0;if(-1==(ZG(m,g,a[j],a[j+1],t|0,v)|0)){return l=0,h=p,l}}else{Ht(a[j],a[j+1],v)}}while(0);k=a[v+4>>2];$G(k);j=0<(k|0);t=a[Ch>>2];a:do{if(j){u=a[v>>2];for(m=0;;){if(g=((m<<4)+t|0)>>2,d=((m<<4)+u|0)>>2,a[g]=a[d],a[g+1]=a[d+1],a[g+2]=a[d+2],a[g+3]=a[d+3],d=m+1|0,(d|0)<(k|0)){m=d}else{var w=t;break a}}}else{w=t}}while(0);a[l>>2]=k;h=p;return w}function $G(b){var c=h,i=a[Yo>>2];(i|0)<(b|0)&&(b=i+(b+300)-b%300|0,i=wb(a[Ch>>2],b<<4),a[Ch>>2]=i,0==(i|0)&&(la(1,aH|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),S()),a[Yo>>2]=b);h=c}function ff(x,c,i){var g,d,e,l,k,n,z,p,s,v,t,u,w,A,B,C,P,T,y,D,M,X,O,F,Da,ia,E=h;h+=88;var G,J=E+8;ia=J>>2;var sc=E+16,H=E+24,I=E+56;a[ml>>2]=a[ml>>2]+1|0;var K=a[x+80>>2];a[nl>>2]=a[nl>>2]+K|0;var L=a[x+88>>2];for(Da=L>>2;;){if(0==(L|0)){G=1477;break}if(0==m[L+124|0]<<24>>24){break}L=a[Da+32];Da=L>>2}1477==G&&(la(1,bH|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),S());var ca=a[x+84>>2];cH(K,ca,x);var N=K<<3;if((N|0)>(a[It>>2]|0)){var U=a[ol>>2],zb=0==(U|0)?Cb(K<<7):wb(U,K<<7);a[ol>>2]=zb;a[It>>2]=N}var ja=1<(K|0);a:do{if(ja){var aa=ca+8|0,da=(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]),ea=ca+40|0;if(da>(b[0]=a[ea>>2],b[1]=a[ea+4>>2],f[0])){if(0<(K|0)){for(var xa=0,Q=da;;){F=((xa<<5)+ca+24|0)>>2;var Od=(b[0]=a[F],b[1]=a[F+1],f[0]),ha=(xa<<5)+ca+8|0;f[0]=-1*Q;a[F]=b[0];a[F+1]=b[1];f[0]=-Od;a[ha>>2]=b[0];a[ha+4>>2]=b[1];var ga=xa+1|0;if((ga|0)==(K|0)){Rb=1;break a}var W=(ga<<5)+ca+8|0,xa=ga,Q=(b[0]=a[W>>2],b[1]=a[W+4>>2],f[0])}}else{Rb=1}}else{var Rb=0}}else{Rb=0}}while(0);(a[Da+4]|0)==(a[Da+3]|0)&&S();var V=K-1|0,tb=a[ol>>2],ya=0,R=0;a:for(;;){if((R|0)>=(K|0)){var wa=ya,Ab=V;break}if(0<(R|0)){var Fa=(R<<5)+ca+8|0,Ga=(R-1<<5)+ca+8|0,Y=(b[0]=a[Fa>>2],b[1]=a[Fa+4>>2],f[0])>(b[0]=a[Ga>>2],b[1]=a[Ga+4>>2],f[0])?-1:1}else{Y=0}if((R|0)<(V|0)){var ta=(R+1<<5)+ca+8|0,Ka=(R<<5)+ca+8|0,za=(b[0]=a[ta>>2],b[1]=a[ta+4>>2],f[0])>(b[0]=a[Ka>>2],b[1]=a[Ka+4>>2],f[0])?1:-1}else{za=0}do{if((Y|0)==(za|0)){if(-1==(Y|0)){var ma=ya}else{if(0!=(Y|0)){G=1501;break a}O=((R<<5)+ca|0)>>2;var pa=(b[0]=a[O],b[1]=a[O+1],f[0]),$=(ya<<4)+tb|0;f[0]=pa;a[$>>2]=b[0];a[$+4>>2]=b[1];var Ha=(R<<5)+ca+24|0,Ra=(b[0]=a[Ha>>2],b[1]=a[Ha+4>>2],f[0]),fa=ya+1|0,Z=(ya<<4)+tb+8|0;f[0]=Ra;a[Z>>2]=b[0];a[Z+4>>2]=b[1];var La=(b[0]=a[O],b[1]=a[O+1],f[0]),ka=(fa<<4)+tb|0;f[0]=La;a[ka>>2]=b[0];a[ka+4>>2]=b[1];var Ya=(R<<5)+ca+8|0,sa=(b[0]=a[Ya>>2],b[1]=a[Ya+4>>2],f[0]),Za=ya+2|0,ra=(fa<<4)+tb+8|0;f[0]=sa;a[ra>>2]=b[0];a[ra+4>>2]=b[1];ma=Za}}else{if(-1==(za|0)|1==(Y|0)){X=((R<<5)+ca|0)>>2;var ab=(b[0]=a[X],b[1]=a[X+1],f[0]),$a=(ya<<4)+tb|0;f[0]=ab;a[$a>>2]=b[0];a[$a+4>>2]=b[1];var jb=(R<<5)+ca+24|0,Ca=(b[0]=a[jb>>2],b[1]=a[jb+4>>2],f[0]),Ia=ya+1|0,eb=(ya<<4)+tb+8|0;f[0]=Ca;a[eb>>2]=b[0];a[eb+4>>2]=b[1];var ub=(b[0]=a[X],b[1]=a[X+1],f[0]),Sa=(Ia<<4)+tb|0;f[0]=ub;a[Sa>>2]=b[0];a[Sa+4>>2]=b[1];var ba=(R<<5)+ca+8|0,ua=(b[0]=a[ba>>2],b[1]=a[ba+4>>2],f[0]),Oa=ya+2|0,Wa=(Ia<<4)+tb+8|0;f[0]=ua;a[Wa>>2]=b[0];a[Wa+4>>2]=b[1];ma=Oa}else{M=((R<<5)+ca+16|0)>>2;var pb=(b[0]=a[M],b[1]=a[M+1],f[0]),ob=(ya<<4)+tb|0;f[0]=pb;a[ob>>2]=b[0];a[ob+4>>2]=b[1];var bb=(R<<5)+ca+8|0,qb=(b[0]=a[bb>>2],b[1]=a[bb+4>>2],f[0]),qa=ya+1|0,kb=(ya<<4)+tb+8|0;f[0]=qb;a[kb>>2]=b[0];a[kb+4>>2]=b[1];var na=(b[0]=a[M],b[1]=a[M+1],f[0]),vb=(qa<<4)+tb|0;f[0]=na;a[vb>>2]=b[0];a[vb+4>>2]=b[1];var xb=(R<<5)+ca+24|0,hd=(b[0]=a[xb>>2],b[1]=a[xb+4>>2],f[0]),nb=ya+2|0,rb=(qa<<4)+tb+8|0;f[0]=hd;a[rb>>2]=b[0];a[rb+4>>2]=b[1];ma=nb}}}while(0);ya=ma;R=R+1|0}1501==G&&S();a:for(;-1<(Ab|0);){if((Ab|0)<(V|0)){var lb=(Ab<<5)+ca+8|0,Ta=(Ab+1<<5)+ca+8|0,cb=(b[0]=a[lb>>2],b[1]=a[lb+4>>2],f[0])>(b[0]=a[Ta>>2],b[1]=a[Ta+4>>2],f[0])?-1:1}else{cb=0}if(0<(Ab|0)){var fb=(Ab-1<<5)+ca+8|0,Ua=(Ab<<5)+ca+8|0,sb=(b[0]=a[fb>>2],b[1]=a[fb+4>>2],f[0])>(b[0]=a[Ua>>2],b[1]=a[Ua+4>>2],f[0])?1:-1}else{sb=0}do{if((cb|0)==(sb|0)){if(0==(cb|0)){D=((Ab<<5)+ca+16|0)>>2;var Na=(b[0]=a[D],b[1]=a[D+1],f[0]),Fb=(wa<<4)+tb|0;f[0]=Na;a[Fb>>2]=b[0];a[Fb+4>>2]=b[1];var Db=(Ab<<5)+ca+8|0,Ob=(b[0]=a[Db>>2],b[1]=a[Db+4>>2],f[0]),Eb=wa+1|0,ne=(wa<<4)+tb+8|0;f[0]=Ob;a[ne>>2]=b[0];a[ne+4>>2]=b[1];var Bb=(b[0]=a[D],b[1]=a[D+1],f[0]),Ja=(Eb<<4)+tb|0;f[0]=Bb;a[Ja>>2]=b[0];a[Ja+4>>2]=b[1];var oa=(Ab<<5)+ca+24|0,Ba=(b[0]=a[oa>>2],b[1]=a[oa+4>>2],f[0]),Ea=wa+2|0,va=(Eb<<4)+tb+8|0;f[0]=Ba;a[va>>2]=b[0];a[va+4>>2]=b[1];var Ma=Ea}else{if(-1==(cb|0)){y=((Ab<<5)+ca+16|0)>>2;var Aa=(b[0]=a[y],b[1]=a[y+1],f[0]),ic=(wa<<4)+tb|0;f[0]=Aa;a[ic>>2]=b[0];a[ic+4>>2]=b[1];T=((Ab<<5)+ca+8|0)>>2;var Pa=(b[0]=a[T],b[1]=a[T+1],f[0]),Qa=wa+1|0,Va=(wa<<4)+tb+8|0;f[0]=Pa;a[Va>>2]=b[0];a[Va+4>>2]=b[1];var hb=(b[0]=a[y],b[1]=a[y+1],f[0]),ib=(Qa<<4)+tb|0;f[0]=hb;a[ib>>2]=b[0];a[ib+4>>2]=b[1];P=((Ab<<5)+ca+24|0)>>2;var pc=(b[0]=a[P],b[1]=a[P+1],f[0]),Wc=wa+2|0,Vb=(Qa<<4)+tb+8|0;f[0]=pc;a[Vb>>2]=b[0];a[Vb+4>>2]=b[1];C=((Ab<<5)+ca|0)>>2;var Xd=(b[0]=a[C],b[1]=a[C+1],f[0]),Gb=(Wc<<4)+tb|0;f[0]=Xd;a[Gb>>2]=b[0];a[Gb+4>>2]=b[1];var Ib=(b[0]=a[P],b[1]=a[P+1],f[0]),yb=wa+3|0,Nb=(Wc<<4)+tb+8|0;f[0]=Ib;a[Nb>>2]=b[0];a[Nb+4>>2]=b[1];var mb=(b[0]=a[C],b[1]=a[C+1],f[0]),lc=(yb<<4)+tb|0;f[0]=mb;a[lc>>2]=b[0];a[lc+4>>2]=b[1];var Hb=(b[0]=a[T],b[1]=a[T+1],f[0]),Jd=wa+4|0,db=(yb<<4)+tb+8|0;f[0]=Hb;a[db>>2]=b[0];a[db+4>>2]=b[1];Ma=Jd}else{G=1514;break a}}}else{if(-1==(sb|0)|1==(cb|0)){B=((Ab<<5)+ca|0)>>2;var Hc=(b[0]=a[B],b[1]=a[B+1],f[0]),Lb=(wa<<4)+tb|0;f[0]=Hc;a[Lb>>2]=b[0];a[Lb+4>>2]=b[1];var oe=(Ab<<5)+ca+24|0,Pb=(b[0]=a[oe>>2],b[1]=a[oe+4>>2],f[0]),Qb=wa+1|0,tc=(wa<<4)+tb+8|0;f[0]=Pb;a[tc>>2]=b[0];a[tc+4>>2]=b[1];var Sc=(b[0]=a[B],b[1]=a[B+1],f[0]),Kb=(Qb<<4)+tb|0;f[0]=Sc;a[Kb>>2]=b[0];a[Kb+4>>2]=b[1];var Jb=(Ab<<5)+ca+8|0,$b=(b[0]=a[Jb>>2],b[1]=a[Jb+4>>2],f[0]),rd=wa+2|0,oc=(Qb<<4)+tb+8|0;f[0]=$b;a[oc>>2]=b[0];a[oc+4>>2]=b[1];Ma=rd}else{A=((Ab<<5)+ca+16|0)>>2;var Yb=(b[0]=a[A],b[1]=a[A+1],f[0]),qk=(wa<<4)+tb|0;f[0]=Yb;a[qk>>2]=b[0];a[qk+4>>2]=b[1];var ve=(Ab<<5)+ca+8|0,Rd=(b[0]=a[ve>>2],b[1]=a[ve+4>>2],f[0]),Bc=wa+1|0,Sd=(wa<<4)+tb+8|0;f[0]=Rd;a[Sd>>2]=b[0];a[Sd+4>>2]=b[1];var fd=(b[0]=a[A],b[1]=a[A+1],f[0]),Mb=(Bc<<4)+tb|0;f[0]=fd;a[Mb>>2]=b[0];a[Mb+4>>2]=b[1];var yc=(Ab<<5)+ca+24|0,Wb=(b[0]=a[yc>>2],b[1]=a[yc+4>>2],f[0]),Tb=wa+2|0,Tc=(Bc<<4)+tb+8|0;f[0]=Wb;a[Tc>>2]=b[0];a[Tc+4>>2]=b[1];Ma=Tb}}}while(0);wa=Ma;Ab=Ab-1|0}1514==G&&(a[c>>2]=0,S());var Sb=0==(Rb|0);a:do{if(!Sb){var Mc=0<(K|0);b:do{if(Mc){for(var id=0;;){w=((id<<5)+ca+24|0)>>2;var uc=(b[0]=a[w],b[1]=a[w+1],f[0])&-1;u=((id<<5)+ca+8|0)>>2;var Zb=-1*(b[0]=a[u],b[1]=a[u+1],f[0]);f[0]=Zb;a[w]=b[0];a[w+1]=b[1];f[0]=-uc|0;a[u]=b[0];a[u+1]=b[1];var qc=id+1|0;if((qc|0)==(K|0)){break b}else{id=qc}}}}while(0);if(0<(wa|0)){for(var mf=0;;){t=((mf<<4)+tb+8|0)>>2;var nf=-1*(b[0]=a[t],b[1]=a[t+1],f[0]);f[0]=nf;a[t]=b[0];a[t+1]=b[1];var ec=mf+1|0;if((ec|0)==(wa|0)){break a}else{mf=ec}}}}}while(0);var af=0<(K|0);a:do{if(af){for(var yf=0;;){var Td=(yf<<5)+ca|0;f[0]=2147483647;a[Td>>2]=b[0];a[Td+4>>2]=b[1];var Fe=(yf<<5)+ca+16|0;f[0]=-2147483648;a[Fe>>2]=b[0];a[Fe+4>>2]=b[1];var gf=yf+1|0;if((gf|0)==(K|0)){break a}else{yf=gf}}}}while(0);a[E>>2]=tb;var fe=E+4|0;a[fe>>2]=wa;var fh=x|0,df=(b[0]=a[fh>>2],b[1]=a[fh+4>>2],f[0]),jd=H|0,md=H|0;f[0]=df;a[md>>2]=b[0];a[md+4>>2]=b[1];var je=x+8|0,Qe=(b[0]=a[je>>2],b[1]=a[je+4>>2],f[0]),Xf=H+8|0;f[0]=Qe;a[Xf>>2]=b[0];a[Xf+4>>2]=b[1];var Uc=x+40|0,bf=(b[0]=a[Uc>>2],b[1]=a[Uc+4>>2],f[0]),mc=H+16|0;f[0]=bf;a[mc>>2]=b[0];a[mc+4>>2]=b[1];var kc=x+48|0,rc=(b[0]=a[kc>>2],b[1]=a[kc+4>>2],f[0]),ef=H+24|0;f[0]=rc;a[ef>>2]=b[0];a[ef+4>>2]=b[1];-1==(Gt(E,jd,J)|0)&&S();do{if(0==(i|0)){var kd=a[fe>>2];if((kd|0)>(a[ll>>2]|0)){var ac=a[Bh>>2],dc=0==(ac|0)?Cb(kd<<5):wb(ac,kd<<5);a[Bh>>2]=dc;a[ll>>2]=kd}var bc=0<(kd|0);a:do{if(bc){for(var jc=a[Bh>>2],fc=a[ol>>2],nd=0;;){v=((nd<<5)+jc|0)>>2;s=((nd<<4)+fc|0)>>2;a[v]=a[s];a[v+1]=a[s+1];a[v+2]=a[s+2];a[v+3]=a[s+3];var zd=nd+1|0;p=((nd<<5)+jc+16|0)>>2;z=((zd%kd<<4)+fc|0)>>2;a[p]=a[z];a[p+1]=a[z+1];a[p+2]=a[z+2];a[p+3]=a[z+3];if((zd|0)<(kd|0)){nd=zd}else{break a}}}}while(0);if(0==m[x+29|0]<<24>>24){n=I>>2,a[n]=0,a[n+1]=0,a[n+2]=0,a[n+3]=0}else{var cf=x+16|0,nc=(b[0]=a[cf>>2],b[1]=a[cf+4>>2],f[0]),gc=se(nc),Xb=I|0;f[0]=gc;a[Xb>>2]=b[0];a[Xb+4>>2]=b[1];var we=Ce(nc),pe=I+8|0;f[0]=we;a[pe>>2]=b[0];a[pe+4>>2]=b[1]}if(0==m[x+69|0]<<24>>24){k=(I+16|0)>>2,a[k]=0,a[k+1]=0,a[k+2]=0,a[k+3]=0}else{var Ac=x+56|0,Kd=(b[0]=a[Ac>>2],b[1]=a[Ac+4>>2],f[0]),Dd=-se(Kd),$c=I+16|0;f[0]=Dd;a[$c>>2]=b[0];a[$c+4>>2]=b[1];var zc=-Ce(Kd),Ye=I+24|0;f[0]=zc;a[Ye>>2]=b[0];a[Ye+4>>2]=b[1]}-1==(ZG(a[Bh>>2],kd,a[ia],a[ia+1],I|0,sc)|0)&&S()}else{Ht(a[ia],a[ia+1],sc)}}while(0);var Ad=a[sc+4>>2];$G(Ad);a:do{if(af){for(var Ud=0;;){var Vd=(Ud<<5)+ca|0;f[0]=2147483647;a[Vd>>2]=b[0];a[Vd+4>>2]=b[1];var Cc=(Ud<<5)+ca+16|0;f[0]=-2147483648;a[Cc>>2]=b[0];a[Cc+4>>2]=b[1];var Ic=Ud+1|0;if((Ic|0)==(K|0)){break a}else{Ud=Ic}}}}while(0);var gd=0<(Ad|0),ud=a[Ch>>2];a:do{if(gd){for(var vc=a[sc>>2],Fn=0;;){l=((Fn<<4)+ud|0)>>2;e=((Fn<<4)+vc|0)>>2;a[l]=a[e];a[l+1]=a[e+1];a[l+2]=a[e+2];a[l+3]=a[e+3];var of=Fn+1|0;if((of|0)<(Ad|0)){Fn=of}else{break a}}}}while(0);var ld=3<(Ad|0),Dc=10;a:for(;;){b:do{if(ld){for(var Qc=Dc*K|0,Yc=0>(Qc|0),Jc=Qc|0,Kc=0,Nc=3;;){c:do{if(!Yc){for(var Ec=(Kc<<4)+ud|0,Pc=(Kc<<4)+ud+8|0,Fc=Kc+1|0,Gc=(Fc<<4)+ud|0,Zc=(Fc<<4)+ud+8|0,Vc=Kc+2|0,Bd=(Vc<<4)+ud|0,Rc=(Vc<<4)+ud+8|0,Cd=(Nc<<4)+ud|0,vd=(Nc<<4)+ud+8|0,bd=0;;){var te=(bd|0)/Jc,pd=(b[0]=a[Ec>>2],b[1]=a[Ec+4>>2],f[0]),cd=(b[0]=a[Pc>>2],b[1]=a[Pc+4>>2],f[0]),qd=(b[0]=a[Gc>>2],b[1]=a[Gc+4>>2],f[0]),Jt=(b[0]=a[Zc>>2],b[1]=a[Zc+4>>2],f[0]),Gd=(b[0]=a[Bd>>2],b[1]=a[Bd+4>>2],f[0]),ad=(b[0]=a[Rc>>2],b[1]=a[Rc+4>>2],f[0]),Fd=pd+te*(qd-pd),yd=cd+te*(Jt-cd),Xc=qd+te*(Gd-qd),dd=Jt+te*(ad-Jt),od=Fd+te*(Xc-Fd),Md=yd+te*(dd-yd),ed=od+te*(Xc+te*(Gd+te*((b[0]=a[Cd>>2],b[1]=a[Cd+4>>2],f[0])-Gd)-Xc)-od),Ld=Md+te*(dd+te*(ad+te*((b[0]=a[vd>>2],b[1]=a[vd+4>>2],f[0])-ad)-dd)-Md);d:do{if(af){for(var Oc=0;;){var be=(Oc<<5)+ca+24|0;if(Ld<=(b[0]=a[be>>2],b[1]=a[be+4>>2],f[0])+1e-4){var wd=(Oc<<5)+ca+8|0;if(Ld>=(b[0]=a[wd>>2],b[1]=a[wd+4>>2],f[0])-1e-4){d=((Oc<<5)+ca|0)>>2;if((b[0]=a[d],b[1]=a[d+1],f[0])>ed){f[0]=ed,a[d]=b[0],a[d+1]=b[1]}g=((Oc<<5)+ca+16|0)>>2;if((b[0]=a[g],b[1]=a[g+1],f[0])<ed){f[0]=ed,a[g]=b[0],a[g+1]=b[1]}}}var xd=Oc+1|0;if((xd|0)==(K|0)){break d}else{Oc=xd}}}}while(0);var ke=bd+1|0;if((ke|0)>(Qc|0)){break c}else{bd=ke}}}}while(0);var sd=Nc+3|0;if((sd|0)<(Ad|0)){Kc=Nc,Nc=sd}else{var Lc=0;break b}}}else{Lc=0}}while(0);for(;;){if((Lc|0)>=(K|0)){break a}var Ed=(Lc<<5)+ca|0;if(2147483647==(b[0]=a[Ed>>2],b[1]=a[Ed+4>>2],f[0])){break}var Wd=(Lc<<5)+ca+16|0;if(-2147483648==(b[0]=a[Wd>>2],b[1]=a[Wd+4>>2],f[0])){break}else{Lc=Lc+1|0}}Dc<<=1}a[c>>2]=Ad;h=E;return ud}function dH(a,b,i,g){if(!((b|0)>(i|0)&(a|0)<(g|0))){return 0}if(!((i|0)>(a|0)|(a|0)>(g|0))){return g-a|0}(i|0)>(b|0)|(b|0)>(g|0)?(a=b-a|0,i=g-i|0,i=(a|0)<(i|0)?a:i):i=b-i|0;return i}function Jg(x){var c,i=h;c=(x+80|0)>>2;Va(a[oa>>2],eH|0,(j=h,h+=4,a[j>>2]=a[c],j));var g=0<(a[c]|0),d=a[oa>>2];a:do{if(g){for(var e=x+84|0,l=0,k=d;;){var n=a[e>>2],z=(l<<5)+n|0,z=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]),p=(l<<5)+n+8|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),s=(l<<5)+n+16|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),n=(l<<5)+n+24|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);Va(k,fH|0,(j=h,h+=36,a[j>>2]=l,f[0]=z,a[j+4>>2]=b[0],a[j+8>>2]=b[1],f[0]=p,a[j+12>>2]=b[0],a[j+16>>2]=b[1],f[0]=s,a[j+20>>2]=b[0],a[j+24>>2]=b[1],f[0]=n,a[j+28>>2]=b[0],a[j+32>>2]=b[1],j));l=l+1|0;k=a[oa>>2];if((l|0)>=(a[c]|0)){var v=k;break a}}}else{v=d}}while(0);c=x|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);g=x+8|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);d=x+16|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);e=0!=m[x+29|0]<<24>>24?Kt|0:Lt|0;Va(v,gH|0,(j=h,h+=28,f[0]=c,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=g,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=d,a[j+16>>2]=b[0],a[j+20>>2]=b[1],a[j+24>>2]=e,j));v=a[oa>>2];c=x+40|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);g=x+48|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);d=x+56|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);x=0!=m[x+69|0]<<24>>24?Kt|0:Lt|0;Va(v,hH|0,(j=h,h+=28,f[0]=c,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=g,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=d,a[j+16>>2]=b[0],a[j+20>>2]=b[1],a[j+24>>2]=x,j));h=i}function cH(x,c,i){var g,d,e,l,k,n,z,p,s,v,t,u,w,A,B,C,P,T,y,D=h,M,X=0<(x|0);a:do{if(X){for(var O=0,F=0;;){var Da=(F<<5)+c|0,ia=(F<<5)+c+8|0,E=(F<<5)+c+24|0,G=(b[0]=a[ia>>2],b[1]=a[ia+4>>2],f[0])-(b[0]=a[E>>2],b[1]=a[E+4>>2],f[0]);if(.01>(0>G?-G:G)){var J=O}else{var sc=Da|0,I=(F<<5)+c+16|0,H=(b[0]=a[sc>>2],b[1]=a[sc+4>>2],f[0])-(b[0]=a[I>>2],b[1]=a[I+4>>2],f[0]);.01>(0>H?-H:H)?J=O:((O|0)!=(F|0)&&(y=((O<<5)+c|0)>>2,T=Da>>2,a[y]=a[T],a[y+1]=a[T+1],a[y+2]=a[T+2],a[y+3]=a[T+3],a[y+4]=a[T+4],a[y+5]=a[T+5],a[y+6]=a[T+6],a[y+7]=a[T+7]),J=O+1|0)}var K=F+1|0;if((K|0)==(x|0)){var L=J;break a}else{O=J,F=K}}}else{L=0}}while(0);P=(c|0)>>2;var ca=(b[0]=a[P],b[1]=a[P+1],f[0]);C=(c+16|0)>>2;var N=(b[0]=a[C],b[1]=a[C+1],f[0]);ca>N&&(la(1,Mt|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Jg(i),S());B=(c+8|0)>>2;var U=(b[0]=a[B],b[1]=a[B+1],f[0]);A=(c+24|0)>>2;var zb=(b[0]=a[A],b[1]=a[A+1],f[0]);U>zb&&(la(1,Mt|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Jg(i),S());for(var ja=L-1|0,aa=0,da=N,ea=ca,xa=zb,Q=U;;){if((aa|0)>=(ja|0)){M=1642;break}var R=aa+1|0;w=((R<<5)+c|0)>>2;var ha=(b[0]=a[w],b[1]=a[w+1],f[0]);u=((R<<5)+c+16|0)>>2;var ga=(b[0]=a[u],b[1]=a[u+1],f[0]);if(ha>ga){M=1673;break}t=((R<<5)+c+8|0)>>2;var W=(b[0]=a[t],b[1]=a[t+1],f[0]);v=((R<<5)+c+24|0)>>2;var Rb=(b[0]=a[v],b[1]=a[v+1],f[0]);if(W>Rb){M=1674;break}s=((aa<<5)+c+16|0)>>2;var V=da<ha,tb=V&1;p=((aa<<5)+c|0)>>2;var ya=ea>ga,Y=ya&1;z=((aa<<5)+c+24|0)>>2;var wa=xa<W,Ab=wa&1;n=((aa<<5)+c+8|0)>>2;var Fa=Q>Rb,Ga=Fa&1,$=Y+tb+Ab+Ga|0,ta=0<($|0);0==m[ld]<<24>>24|ta^1||(Va(a[oa>>2],iH|0,(j=h,h+=8,a[j>>2]=aa,a[j+4>>2]=R,j)),Jg(i));a:do{if(ta){if(V){var Ka=(b[0]=a[s],b[1]=a[s+1],f[0])&-1,za=(b[0]=a[w],b[1]=a[w+1],f[0]);f[0]=za;a[s]=b[0];a[s+1]=b[1];f[0]=Ka|0;a[w]=b[0];a[w+1]=b[1];var ma=Ga,pa=Ab,fa=Y,Ha=0}else{if(ya){var Ra=(b[0]=a[p],b[1]=a[p+1],f[0])&-1,Z=(b[0]=a[u],b[1]=a[u+1],f[0]);f[0]=Z;a[p]=b[0];a[p+1]=b[1];f[0]=Ra|0;a[u]=b[0];a[u+1]=b[1];ma=Ga;pa=Ab;fa=0}else{if(wa){var ka=(b[0]=a[z],b[1]=a[z+1],f[0])&-1,La=(b[0]=a[t],b[1]=a[t+1],f[0]);f[0]=La;a[z]=b[0];a[z+1]=b[1];f[0]=ka|0;a[t]=b[0];a[t+1]=b[1];ma=Ga;pa=0}else{if(Fa){var sa=(b[0]=a[n],b[1]=a[n+1],f[0])&-1,Ya=(b[0]=a[v],b[1]=a[v+1],f[0]);f[0]=Ya;a[n]=b[0];a[n+1]=b[1];f[0]=sa|0;a[v]=b[0];a[v+1]=b[1];ma=0}else{ma=Ga}pa=Ab}fa=Y}Ha=tb}if(0<($-1|0)){for(var ra=((ya^1)<<31>>31)+tb+Ab+Ga|0,Za=Ha,ba=fa,ab=0,$a=pa,jb=ma;;){if(1==(Za|0)){var Ca=.5*((b[0]=a[s],b[1]=a[s+1],f[0])+(b[0]=a[w],b[1]=a[w+1],f[0]))+.5&-1|0;f[0]=Ca;a[w]=b[0];a[w+1]=b[1];f[0]=Ca;a[s]=b[0];a[s+1]=b[1];var Ia=jb,eb=$a,ub=ba,Sa=0}else{if(1==(ba|0)){var qa=.5*((b[0]=a[p],b[1]=a[p+1],f[0])+(b[0]=a[u],b[1]=a[u+1],f[0]))+.5&-1|0;f[0]=qa;a[u]=b[0];a[u+1]=b[1];f[0]=qa;a[p]=b[0];a[p+1]=b[1];Ia=jb;eb=$a;ub=0}else{if(1==($a|0)){var ua=.5*((b[0]=a[z],b[1]=a[z+1],f[0])+(b[0]=a[t],b[1]=a[t+1],f[0]))+.5&-1|0;f[0]=ua;a[t]=b[0];a[t+1]=b[1];f[0]=ua;a[z]=b[0];a[z+1]=b[1];Ia=jb;eb=0}else{if(1!=(jb|0)){Ia=jb}else{var Oa=.5*((b[0]=a[n],b[1]=a[n+1],f[0])+(b[0]=a[v],b[1]=a[v+1],f[0]))+.5&-1|0;f[0]=Oa;a[v]=b[0];a[v+1]=b[1];f[0]=Oa;a[n]=b[0];a[n+1]=b[1];Ia=0}eb=$a}ub=ba}Sa=Za}var Wa=ab+1|0;if((Wa|0)==(ra|0)){break a}else{Za=Sa,ba=ub,ab=Wa,$a=eb,jb=Ia}}}}}while(0);var pb=(b[0]=a[p],b[1]=a[p+1],f[0]),ob=(b[0]=a[s],b[1]=a[s+1],f[0]),bb=(b[0]=a[w],b[1]=a[w+1],f[0]),qb=(b[0]=a[u],b[1]=a[u+1],f[0]),na=dH(pb&-1,ob&-1,bb&-1,qb&-1),kb=(b[0]=a[n],b[1]=a[n+1],f[0]),ie=(b[0]=a[z],b[1]=a[z+1],f[0]),vb=(b[0]=a[t],b[1]=a[t+1],f[0]),xb=(b[0]=a[v],b[1]=a[v+1],f[0]),hd=dH(kb&-1,ie&-1,vb&-1,xb&-1);if(0==(na|0)|0==(hd|0)){aa=R,da=qb,ea=bb,xa=xb,Q=vb}else{if((na|0)<(hd|0)){var nb=ob<qb;ob-pb>qb-bb?(nb?(f[0]=bb,a[s]=b[0],a[s+1]=b[1]):(f[0]=qb,a[p]=b[0],a[p+1]=b[1]),aa=R,da=qb,ea=bb):nb?(f[0]=ob,a[w]=b[0],a[w+1]=b[1],aa=R,da=qb,ea=ob):(f[0]=pb,a[u]=b[0],a[u+1]=b[1],aa=R,da=pb,ea=bb);xa=xb;Q=vb}else{var rb=ie<xb;ie-kb>xb-vb?(rb?(f[0]=vb,a[z]=b[0],a[z+1]=b[1]):(f[0]=xb,a[n]=b[0],a[n+1]=b[1]),aa=R,da=qb,ea=bb,xa=xb,Q=vb):rb?(f[0]=ie,a[t]=b[0],a[t+1]=b[1],aa=R,da=qb,ea=bb,xa=xb,Q=ie):(f[0]=kb,a[v]=b[0],a[v+1]=b[1],aa=R,da=qb,ea=bb,xa=kb,Q=vb)}}}if(1642==M){k=(i|0)>>2;var lb=(b[0]=a[k],b[1]=a[k+1],f[0]),Ta=(b[0]=a[P],b[1]=a[P+1],f[0]);if(lb<Ta){M=1646}else{if(lb>(b[0]=a[C],b[1]=a[C+1],f[0])){M=1646}else{var cb=i+8|0,fb=(b[0]=a[cb>>2],b[1]=a[cb+4>>2],f[0]);if(fb<(b[0]=a[B],b[1]=a[B+1],f[0])){M=1646}else{if(fb>(b[0]=a[A],b[1]=a[A+1],f[0])){M=1646}}}}if(1646==M){if(0==m[ld]<<24>>24){var Ua=lb,sb=Ta}else{Lc(jH|0,42,1,a[oa>>2]),Jg(i),Ua=(b[0]=a[k],b[1]=a[k+1],f[0]),sb=(b[0]=a[P],b[1]=a[P+1],f[0])}if(Ua<sb){f[0]=sb;a[k]=b[0];a[k+1]=b[1];var Na=sb}else{Na=Ua}var Fb=(b[0]=a[C],b[1]=a[C+1],f[0]);Na>Fb&&(f[0]=Fb,a[k]=b[0],a[k+1]=b[1]);l=(i+8|0)>>2;var Db=(b[0]=a[l],b[1]=a[l+1],f[0]),Ob=(b[0]=a[B],b[1]=a[B+1],f[0]);if(Db<Ob){f[0]=Ob;a[l]=b[0];a[l+1]=b[1];var Eb=Ob}else{Eb=Db}var ne=(b[0]=a[A],b[1]=a[A+1],f[0]);Eb>ne&&(f[0]=ne,a[l]=b[0],a[l+1]=b[1])}e=(i+40|0)>>2;var Bb=(b[0]=a[e],b[1]=a[e+1],f[0]);d=((ja<<5)+c|0)>>2;var Ja=(b[0]=a[d],b[1]=a[d+1],f[0]);if(Bb>=Ja){var Ba=(ja<<5)+c+16|0;if(Bb<=(b[0]=a[Ba>>2],b[1]=a[Ba+4>>2],f[0])){var Ea=i+48|0,va=(b[0]=a[Ea>>2],b[1]=a[Ea+4>>2],f[0]),Ma=(ja<<5)+c+8|0;if(va>=(b[0]=a[Ma>>2],b[1]=a[Ma+4>>2],f[0])){var Aa=(ja<<5)+c+24|0;if(va<=(b[0]=a[Aa>>2],b[1]=a[Aa+4>>2],f[0])){h=D;return}}}}if(0==m[ld]<<24>>24){var wb=Bb,ic=Ja}else{Lc(kH|0,39,1,a[oa>>2]),Jg(i),wb=(b[0]=a[e],b[1]=a[e+1],f[0]),ic=(b[0]=a[d],b[1]=a[d+1],f[0])}if(wb<ic){f[0]=ic;a[e]=b[0];a[e+1]=b[1];var Cb=ic}else{Cb=wb}var Qa=(ja<<5)+c+16|0,Pa=(b[0]=a[Qa>>2],b[1]=a[Qa+4>>2],f[0]);Cb>Pa&&(f[0]=Pa,a[e]=b[0],a[e+1]=b[1]);g=(i+48|0)>>2;var hb=(b[0]=a[g],b[1]=a[g+1],f[0]),ib=(ja<<5)+c+8|0,pc=(b[0]=a[ib>>2],b[1]=a[ib+4>>2],f[0]);if(hb<pc){f[0]=pc;a[g]=b[0];a[g+1]=b[1];var Wc=pc}else{Wc=hb}var Vb=(ja<<5)+c+24|0,Xd=(b[0]=a[Vb>>2],b[1]=a[Vb+4>>2],f[0]);Wc>Xd&&(f[0]=Xd,a[g]=b[0],a[g+1]=b[1]);h=D}else{1673==M?(la(1,Nt|0,(j=h,h+=4,a[j>>2]=R,j)),Jg(i),S()):1674==M&&(la(1,Nt|0,(j=h,h+=4,a[j>>2]=R,j)),Jg(i),S())}}function Zo(x,c,i,g,d,e){var l=x|0;f[0]=(d-i)*c+i;a[l>>2]=b[0];a[l+4>>2]=b[1];x=x+8|0;f[0]=(e-g)*c+g;a[x>>2]=b[0];a[x+4>>2]=b[1]}function ts(b){b=a[b+24>>2];0==(b|0)?b=0:(b=a[a[b+4>>2]>>2],b=270==(b|0)?1:56==(b|0)?2:54==(b|0)?3:356==(b|0)?4:0);return b}function Ii(x,c,i,g,d,e,l){var k,n,j,p,m,v,t,u,w,A,B,C,P,T,y,D,M,X,O,F,Da,ia,E,J,H,I,K,L,N,hc,ca,R,Q,zb,ja,aa,da,ea,xa,U,S,ha,ga,W,Rb,V,tb,ya,Y,wa,Ab,Fa,Ga,$,ta,Ka,za,ma,pa,la,Ha,Ra,Z,ka,La,ba,Ya,ra,Za,qa,ab,$a,jb,Ca,Ia,eb,ub,Sa,na,ua,Oa,Wa,pb,ob,bb,qb,oa,kb,ie,vb,xb,hd,nb,rb,lb,Ta,cb,fb,Ua,sb,Na=h;h+=128;var Fb=Na+64,Db=Na+80,Ob=Na+96,Eb=Na+112;if(0==(e&4|0)){var ne=e&992,Bb=0==(ne|0)?2:ne}else{Bb=4}var Ja=fa((d<<6)+64|0);sb=Ja>>2;var Ba=0<(d|0);a:do{if(Ba){for(var Ea=d-1|0,va=g+8|0,Ma=12,Aa=0;;){var wb=(Aa<<4)+g|0,ic=(b[0]=a[wb>>2],b[1]=a[wb+4>>2],f[0]),Qa=(Aa<<4)+g+8|0,hb=(b[0]=a[Qa>>2],b[1]=a[Qa+4>>2],f[0]),Va=Aa+1|0;if((Aa|0)<(Ea|0)){var ib=(Va<<4)+g|0,Gb=(Va<<4)+g+8|0}else{ib=g,Gb=va}var pc=ib|0,Wc=(b[0]=a[pc>>2],b[1]=a[pc+4>>2],f[0])-ic,Vb=(b[0]=a[Gb>>2],b[1]=a[Gb+4>>2],f[0])-hb,Xd=$c(Wc*Wc+Vb*Vb)/3,yb=Ma<Xd?Ma:Xd;if((Va|0)==(d|0)){break}else{Ma=yb,Aa=Va}}var Ib=0==(e&768|0),Nb=0==(e&32|0),mb=2==(Bb|0);Ua=Fb>>2;fb=Db>>2;cb=Ob>>2;Ta=Eb>>2;for(var db=0,lc=0;;){var Hb=(lc<<4)+g|0,Jd=(b[0]=a[Hb>>2],b[1]=a[Hb+4>>2],f[0]),Lb=(lc<<4)+g+8|0,Hc=(b[0]=a[Lb>>2],b[1]=a[Lb+4>>2],f[0]);if((lc|0)<(Ea|0)){var Kb=lc+1|0,oe=(Kb<<4)+g|0,Jb=(Kb<<4)+g+8|0}else{oe=g,Jb=va}var Qb=oe|0,tc=(b[0]=a[Qb>>2],b[1]=a[Qb+4>>2],f[0]),Sc=(b[0]=a[Jb>>2],b[1]=a[Jb+4>>2],f[0]),Pb=tc-Jd,Yb=Sc-Hc,Mb=yb/$c(Pb*Pb+Yb*Yb),rd=Ib?Nb?Mb:.5*Mb:Mb/3;if(mb){Zo(Fb,.5*rd,Jd,Hc,tc,Sc),lb=((db<<4)+Ja|0)>>2,a[lb]=a[Ua],a[lb+1]=a[Ua+1],a[lb+2]=a[Ua+2],a[lb+3]=a[Ua+3]}else{var oc=(db<<4)+Ja|0;f[0]=Jd;a[oc>>2]=b[0];a[oc+4>>2]=b[1];var Wb=(db<<4)+Ja+8|0;f[0]=Hc;a[Wb>>2]=b[0];a[Wb+4>>2]=b[1]}Zo(Db,rd,Jd,Hc,tc,Sc);rb=((db+1<<4)+Ja|0)>>2;a[rb]=a[fb];a[rb+1]=a[fb+1];a[rb+2]=a[fb+2];a[rb+3]=a[fb+3];var Tb=db+3|0;Zo(Ob,1-rd,Jd,Hc,tc,Sc);nb=((db+2<<4)+Ja|0)>>2;a[nb]=a[cb];a[nb+1]=a[cb+1];a[nb+2]=a[cb+2];a[nb+3]=a[cb+3];if(mb){Zo(Eb,1-.5*rd,Jd,Hc,tc,Sc);hd=((Tb<<4)+Ja|0)>>2;a[hd]=a[Ta];a[hd+1]=a[Ta+1];a[hd+2]=a[Ta+2];a[hd+3]=a[Ta+3];var ve=db+4|0}else{ve=Tb}var Rd=lc+1|0;if((Rd|0)==(d|0)){var Bc=ve;break a}else{db=ve,lc=Rd}}}else{Bc=0}}while(0);xb=((Bc<<4)+Ja|0)>>2;a[xb]=a[sb];a[xb+1]=a[sb+1];a[xb+2]=a[sb+2];a[xb+3]=a[sb+3];var Sd=Ja+16|0;vb=Sd>>2;ie=((Bc+1<<4)+Ja|0)>>2;a[ie]=a[vb];a[ie+1]=a[vb+1];a[ie+2]=a[vb+2];a[ie+3]=a[vb+3];var fd=Ja+32|0;kb=fd>>2;oa=((Bc+2<<4)+Ja|0)>>2;a[oa]=a[kb];a[oa+1]=a[kb+1];a[oa+2]=a[kb+2];a[oa+3]=a[kb+3];if(256==(Bb|0)){4!=(d|0)&&sa(Ot|0,562,Pt|0,Qt|0);Pa(x,i);0!=(l|0)&&$b(x,c);var Sb=d+2|0,yc=fa(Sb<<4);qb=yc>>2;bb=g>>2;a[qb]=a[bb];a[qb+1]=a[bb+1];a[qb+2]=a[bb+2];a[qb+3]=a[bb+3];ob=(yc+16|0)>>2;a[ob]=a[kb];a[ob+1]=a[kb+1];a[ob+2]=a[kb+2];a[ob+3]=a[kb+3];pb=(yc+32|0)>>2;Wa=(Ja+64|0)>>2;a[pb]=a[Wa];a[pb+1]=a[Wa+1];a[pb+2]=a[Wa+2];a[pb+3]=a[Wa+3];Oa=(yc+48|0)>>2;ua=(g+32|0)>>2;a[Oa]=a[ua];a[Oa+1]=a[ua+1];a[Oa+2]=a[ua+2];a[Oa+3]=a[ua+3];na=(yc+64|0)>>2;Sa=(Ja+128|0)>>2;a[na]=a[Sa];a[na+1]=a[Sa+1];a[na+2]=a[Sa+2];a[na+3]=a[Sa+3];ub=(yc+80|0)>>2;eb=(Ja+160|0)>>2;a[ub]=a[eb];a[ub+1]=a[eb+1];a[ub+2]=a[eb+2];a[ub+3]=a[eb+3];zc(x,yc,Sb,l&255);G(yc);var qc=(b[0]=a[Sd>>2],b[1]=a[Sd+4>>2],f[0]),ec=Ja+176|0,Tc=qc+((b[0]=a[ec>>2],b[1]=a[ec+4>>2],f[0])-(b[0]=a[Ja>>2],b[1]=a[Ja+4>>2],f[0])),uc=Na|0,Mc=Na|0;f[0]=Tc;a[Mc>>2]=b[0];a[Mc+4>>2]=b[1];var id=Ja+24|0,mc=(b[0]=a[id>>2],b[1]=a[id+4>>2],f[0]),Zb=Ja+184|0,kc=Ja+8|0,ac=mc+((b[0]=a[Zb>>2],b[1]=a[Zb+4>>2],f[0])-(b[0]=a[kc>>2],b[1]=a[kc+4>>2],f[0])),nf=Na+8|0;f[0]=ac;a[nf>>2]=b[0];a[nf+4>>2]=b[1];Ia=(Na+16|0)>>2;a[Ia]=a[Wa];a[Ia+1]=a[Wa+1];a[Ia+2]=a[Wa+2];a[Ia+3]=a[Wa+3];Gd(x,uc,2);a[Ia]=a[Sa];a[Ia+1]=a[Sa+1];a[Ia+2]=a[Sa+2];a[Ia+3]=a[Sa+3];Gd(x,uc,2);a[Ia]=a[sb];a[Ia+1]=a[sb+1];a[Ia+2]=a[sb+2];a[Ia+3]=a[sb+3];Gd(x,uc,2)}else{if(2==(Bb|0)){var rc=0==(l|0);a:do{if(!rc){var af=d<<1,jc=Cb(d<<5),Td=jc;Pa(x,c);$b(x,c);if(Ba){var Fe=0,gf=0}else{zc(x,Td,af,1);G(jc);Pa(x,i);G(Ja);h=Na;return}for(;;){var fe=Fe<<2;Ca=((gf<<4)+Td|0)>>2;jb=(((fe|1)<<4)+Ja|0)>>2;a[Ca]=a[jb];a[Ca+1]=a[jb+1];a[Ca+2]=a[jb+2];a[Ca+3]=a[jb+3];$a=(((gf|1)<<4)+Td|0)>>2;ab=(((fe|2)<<4)+Ja|0)>>2;a[$a]=a[ab];a[$a+1]=a[ab+1];a[$a+2]=a[ab+2];a[$a+3]=a[ab+3];var fc=Fe+1|0;if((fc|0)==(d|0)){break}else{Fe=fc,gf=gf+2|0}}zc(x,Td,af,1);G(jc);for(var df=0;;){$f(x,((df<<2|2)<<4)+Ja|0,4,0,0,1);var jd=df+1|0;if((jd|0)==(d|0)){break a}else{df=jd}}}}while(0);Pa(x,i);if(Ba){for(var md=0;;){var je=md<<2;Gd(x,((je|1)<<4)+Ja|0,2);$f(x,((je|2)<<4)+Ja|0,4,0,0,0);var Qe=md+1|0;if((Qe|0)==(d|0)){break}else{md=Qe}}}}else{if(128==(Bb|0)){Pa(x,i);0!=(l|0)&&$b(x,c);var nc=d+3|0,Uc=fa(nc<<4);qa=Uc>>2;Za=g>>2;a[qa]=a[Za];a[qa+1]=a[Za+1];a[qa+2]=a[Za+2];a[qa+3]=a[Za+3];ra=(g|0)>>2;var bf=(b[0]=a[ra],b[1]=a[ra+1],f[0]);Ya=Sd>>2;var dc=bf-.25*(bf-(b[0]=a[Ya],b[1]=a[Ya+1],f[0])),bc=Uc+16|0;f[0]=dc;a[bc>>2]=b[0];a[bc+4>>2]=b[1];var Xb=g+8|0,gc=(b[0]=a[Xb>>2],b[1]=a[Xb+4>>2],f[0]),kd=Ja+48|0;ba=(Ja+56|0)>>2;var Ac=Ja+72|0,Cc=gc+((b[0]=a[ba],b[1]=a[ba+1],f[0])-(b[0]=a[Ac>>2],b[1]=a[Ac+4>>2],f[0]))/3,Ic=Uc+24|0;f[0]=Cc;a[Ic>>2]=b[0];a[Ic+4>>2]=b[1];var vc=(b[0]=a[ra],b[1]=a[ra+1],f[0]),Kc=vc-2*(vc-(b[0]=a[Ya],b[1]=a[Ya+1],f[0])),nd=Uc+32|0;f[0]=Kc;a[nd>>2]=b[0];a[nd+4>>2]=b[1];var zd=Uc+40|0;f[0]=Cc;a[zd>>2]=b[0];a[zd+4>>2]=b[1];var cf=(b[0]=a[ra],b[1]=a[ra+1],f[0]),Nc=cf-2.25*(cf-(b[0]=a[Ya],b[1]=a[Ya+1],f[0])),Dc=Uc+48|0;f[0]=Nc;a[Dc>>2]=b[0];a[Dc+4>>2]=b[1];var zi=(b[0]=a[ba],b[1]=a[ba+1],f[0]),we=Uc+56|0;f[0]=zi;a[we>>2]=b[0];a[we+4>>2]=b[1];var pe=(b[0]=a[kd>>2],b[1]=a[kd+4>>2],f[0]),Qc=Uc+64|0;f[0]=pe;a[Qc>>2]=b[0];a[Qc+4>>2]=b[1];var Kd=(b[0]=a[ba],b[1]=a[ba+1],f[0]),Dd=Uc+72|0;f[0]=Kd;a[Dd>>2]=b[0];a[Dd+4>>2]=b[1];var ld=4<(nc|0);a:do{if(ld){for(var Ec=4;;){La=((Ec<<4)+Uc|0)>>2;ka=((Ec-3<<4)+g|0)>>2;a[La]=a[ka];a[La+1]=a[ka+1];a[La+2]=a[ka+2];a[La+3]=a[ka+3];var Ye=Ec+1|0;if((Ye|0)==(nc|0)){break a}else{Ec=Ye}}}}while(0);zc(x,Uc,nc,l&255);G(Uc)}else{if(4==(Bb|0)){if(Pa(x,i),0!=(l|0)&&$b(x,c),zc(x,g,d,l&255),Ba){var Ad=Na|0;Z=Na>>2;Ra=(Na+16|0)>>2;for(var Ud=0;;){var Vd=3*Ud|0;Ha=((Vd+2<<4)+Ja|0)>>2;a[Z]=a[Ha];a[Z+1]=a[Ha+1];a[Z+2]=a[Ha+2];a[Z+3]=a[Ha+3];la=((Vd+4<<4)+Ja|0)>>2;a[Ra]=a[la];a[Ra+1]=a[la+1];a[Ra+2]=a[la+2];a[Ra+3]=a[la+3];Gd(x,Ad,2);var Oc=Ud+1|0;if((Oc|0)==(d|0)){break}else{Ud=Oc}}}}else{if(512==(Bb|0)){4!=(d|0)&&sa(Ot|0,588,Pt|0,Qt|0);Pa(x,i);0!=(l|0)&&$b(x,c);var Pc=d+8|0,gd=fa(Pc<<4);pa=gd>>2;ma=g>>2;a[pa]=a[ma];a[pa+1]=a[ma+1];a[pa+2]=a[ma+2];a[pa+3]=a[ma+3];za=(gd+16|0)>>2;Ka=(g+16|0)>>2;a[za]=a[Ka];a[za+1]=a[Ka+1];a[za+2]=a[Ka+2];a[za+3]=a[Ka+3];ta=(Ja+48|0)>>2;var ud=(b[0]=a[ta],b[1]=a[ta+1],f[0]);$=(Ja+64|0)>>2;var Fc=ud+((b[0]=a[$],b[1]=a[$+1],f[0])-ud),Yc=gd+32|0;Ga=Yc>>2;Fa=Yc>>2;f[0]=Fc;a[Fa]=b[0];a[Fa+1]=b[1];Ab=(Ja+56|0)>>2;var of=(b[0]=a[Ab],b[1]=a[Ab+1],f[0]);wa=(Ja+72|0)>>2;var Gc=of+((b[0]=a[wa],b[1]=a[wa+1],f[0])-of);Y=(gd+40|0)>>2;f[0]=Gc;a[Y]=b[0];a[Y+1]=b[1];var Zc=Fc+((b[0]=a[ta],b[1]=a[ta+1],f[0])-(b[0]=a[fd>>2],b[1]=a[fd+4>>2],f[0]));ya=(gd+48|0)>>2;f[0]=Zc;a[ya]=b[0];a[ya+1]=b[1];var Lc=Ja+40|0,Jc=Gc+((b[0]=a[Ab],b[1]=a[Ab+1],f[0])-(b[0]=a[Lc>>2],b[1]=a[Lc+4>>2],f[0]));tb=(gd+56|0)>>2;f[0]=Jc;a[tb]=b[0];a[tb+1]=b[1];var bd=Zc+((b[0]=a[$],b[1]=a[$+1],f[0])-(b[0]=a[ta],b[1]=a[ta+1],f[0]));V=(gd+64|0)>>2;f[0]=bd;a[V]=b[0];a[V+1]=b[1];var Vc=Jc+((b[0]=a[wa],b[1]=a[wa+1],f[0])-(b[0]=a[Ab],b[1]=a[Ab+1],f[0]));Rb=(gd+72|0)>>2;f[0]=Vc;a[Rb]=b[0];a[Rb+1]=b[1];var Bd=bd+(Fc-Zc),Rc=gd+80|0;W=Rc>>2;f[0]=Bd;a[Rc>>2]=b[0];a[Rc+4>>2]=b[1];var ed=gd+88|0;f[0]=Vc+(Gc-Jc);a[ed>>2]=b[0];a[ed+4>>2]=b[1];ga=(Ja+96|0)>>2;var qd=(b[0]=a[ga],b[1]=a[ga+1],f[0]);ha=(Ja+80|0)>>2;var Cd=qd+((b[0]=a[ha],b[1]=a[ha+1],f[0])-qd),ad=gd+144|0;S=ad>>2;f[0]=Cd;a[ad>>2]=b[0];a[ad+4>>2]=b[1];U=(Ja+104|0)>>2;var vd=(b[0]=a[U],b[1]=a[U+1],f[0]);xa=(Ja+88|0)>>2;var Xc=vd+((b[0]=a[xa],b[1]=a[xa+1],f[0])-vd),dd=gd+152|0;f[0]=Xc;a[dd>>2]=b[0];a[dd+4>>2]=b[1];var pd=Ja+112|0,cd=Cd+((b[0]=a[ga],b[1]=a[ga+1],f[0])-(b[0]=a[pd>>2],b[1]=a[pd+4>>2],f[0]));ea=(gd+128|0)>>2;f[0]=cd;a[ea]=b[0];a[ea+1]=b[1];var Fd=Ja+120|0,te=Xc+((b[0]=a[U],b[1]=a[U+1],f[0])-(b[0]=a[Fd>>2],b[1]=a[Fd+4>>2],f[0]));da=(gd+136|0)>>2;f[0]=te;a[da]=b[0];a[da+1]=b[1];var yd=cd+((b[0]=a[ha],b[1]=a[ha+1],f[0])-(b[0]=a[ga],b[1]=a[ga+1],f[0]));aa=(gd+112|0)>>2;f[0]=yd;a[aa]=b[0];a[aa+1]=b[1];var od=te+((b[0]=a[xa],b[1]=a[xa+1],f[0])-(b[0]=a[U],b[1]=a[U+1],f[0]));ja=(gd+120|0)>>2;f[0]=od;a[ja]=b[0];a[ja+1]=b[1];var Md=yd+(Cd-cd),Ld=gd+96|0;zb=Ld>>2;Q=Ld>>2;f[0]=Md;a[Q]=b[0];a[Q+1]=b[1];var be=od+(Xc-te);R=(gd+104|0)>>2;f[0]=be;a[R]=b[0];a[R+1]=b[1];ca=(gd+160|0)>>2;hc=(g+32|0)>>2;a[ca]=a[hc];a[ca+1]=a[hc+1];a[ca+2]=a[hc+2];a[ca+3]=a[hc+3];N=(gd+176|0)>>2;L=(g+48|0)>>2;a[N]=a[L];a[N+1]=a[L+1];a[N+2]=a[L+2];a[N+3]=a[L+3];zc(x,gd,Pc,l&255);var wd=Na|0;K=Na>>2;a[K]=a[Ga];a[K+1]=a[Ga+1];a[K+2]=a[Ga+2];a[K+3]=a[Ga+3];var xd=(b[0]=a[Fa],b[1]=a[Fa+1],f[0]),ke=xd-((b[0]=a[ya],b[1]=a[ya+1],f[0])-xd);I=(Na+16|0)>>2;f[0]=ke;a[I]=b[0];a[I+1]=b[1];var sd=(b[0]=a[Y],b[1]=a[Y+1],f[0]),Ed=sd-((b[0]=a[tb],b[1]=a[tb+1],f[0])-sd);H=(Na+24|0)>>2;f[0]=Ed;a[H]=b[0];a[H+1]=b[1];var Wd=ke+((b[0]=a[V],b[1]=a[V+1],f[0])-(b[0]=a[ya],b[1]=a[ya+1],f[0]));J=(Na+32|0)>>2;f[0]=Wd;a[J]=b[0];a[J+1]=b[1];var se=Ed+((b[0]=a[Rb],b[1]=a[Rb+1],f[0])-(b[0]=a[tb],b[1]=a[tb+1],f[0]));E=(Na+40|0)>>2;f[0]=se;a[E]=b[0];a[E+1]=b[1];ia=(Na+48|0)>>2;a[ia]=a[W];a[ia+1]=a[W+1];a[ia+2]=a[W+2];a[ia+3]=a[W+3];Gd(x,wd,4);a[K]=a[zb];a[K+1]=a[zb+1];a[K+2]=a[zb+2];a[K+3]=a[zb+3];var Pd=(b[0]=a[Q],b[1]=a[Q+1],f[0]),de=Pd-((b[0]=a[aa],b[1]=a[aa+1],f[0])-Pd);f[0]=de;a[I]=b[0];a[I+1]=b[1];var Id=(b[0]=a[R],b[1]=a[R+1],f[0]),le=Id-((b[0]=a[ja],b[1]=a[ja+1],f[0])-Id);f[0]=le;a[H]=b[0];a[H+1]=b[1];var he=de+((b[0]=a[ea],b[1]=a[ea+1],f[0])-(b[0]=a[aa],b[1]=a[aa+1],f[0]));f[0]=he;a[J]=b[0];a[J+1]=b[1];var Ce=le+((b[0]=a[da],b[1]=a[da+1],f[0])-(b[0]=a[ja],b[1]=a[ja+1],f[0]));f[0]=Ce;a[E]=b[0];a[E+1]=b[1];a[ia]=a[S];a[ia+1]=a[S+1];a[ia+2]=a[S+2];a[ia+3]=a[S+3];Gd(x,wd,4);G(gd)}else{if(32==(Bb|0)){Pa(x,i);0!=(l|0)&&$b(x,c);var ce=d+1|0,Hd=fa(ce<<4);Da=Hd>>2;var ue=1<(d|0);a:do{if(ue){for(var Yd=1;;){F=((Yd<<4)+Hd|0)>>2;O=((Yd<<4)+g|0)>>2;a[F]=a[O];a[F+1]=a[O+1];a[F+2]=a[O+2];a[F+3]=a[O+3];var Qd=Yd+1|0;if((Qd|0)==(d|0)){break a}else{Yd=Qd}}}}while(0);var $d=3*d|0;X=(($d+1<<4)+Ja|0)>>2;a[Da]=a[X];a[Da+1]=a[X+1];a[Da+2]=a[X+2];a[Da+3]=a[X+3];M=((d<<4)+Hd|0)>>2;D=(($d-1<<4)+Ja|0)>>2;a[M]=a[D];a[M+1]=a[D+1];a[M+2]=a[D+2];a[M+3]=a[D+3];zc(x,Hd,ce,l&255);G(Hd);var De=Na|0;y=Na>>2;a[y]=a[D];a[y+1]=a[D+1];a[y+2]=a[D+2];a[y+3]=a[D+3];var ae=Na+16|0;T=ae>>2;a[T]=a[X];a[T+1]=a[X+1];a[T+2]=a[X+2];a[T+3]=a[X+3];var Ae=ae|0,He=(b[0]=a[Ae>>2],b[1]=a[Ae+4>>2],f[0]),Ee=Na|0,xe=($d<<4)+Ja|0,Ke=He+((b[0]=a[Ee>>2],b[1]=a[Ee+4>>2],f[0])-(b[0]=a[xe>>2],b[1]=a[xe+4>>2],f[0])),qe=Na+32|0,re=qe|0;f[0]=Ke;a[re>>2]=b[0];a[re+4>>2]=b[1];var Ge=Na+24|0,ye=(b[0]=a[Ge>>2],b[1]=a[Ge+4>>2],f[0]),ze=Na+8|0,me=($d<<4)+Ja+8|0,Oe=ye+((b[0]=a[ze>>2],b[1]=a[ze+4>>2],f[0])-(b[0]=a[me>>2],b[1]=a[me+4>>2],f[0])),Be=Na+40|0;f[0]=Oe;a[Be>>2]=b[0];a[Be+4>>2]=b[1];Gd(x,ae,2);P=qe>>2;a[T]=a[P];a[T+1]=a[P+1];a[T+2]=a[P+2];a[T+3]=a[P+3];Gd(x,De,2)}else{if(64==(Bb|0)){Pa(x,i);0!=(l|0)&&$b(x,c);var Nd=d+2|0,td=fa(Nd<<4);C=td>>2;B=g>>2;a[C]=a[B];a[C+1]=a[B+1];a[C+2]=a[B+2];a[C+3]=a[B+3];A=(td+16|0)>>2;a[A]=a[kb];a[A+1]=a[kb+1];a[A+2]=a[kb+2];a[A+3]=a[kb+3];var Pe=(b[0]=a[fd>>2],b[1]=a[fd+4>>2],f[0]),Ie=Ja+48|0;w=Ie>>2;u=Ie>>2;t=(Ja+64|0)>>2;var We=Pe+((b[0]=a[u],b[1]=a[u+1],f[0])-(b[0]=a[t],b[1]=a[t+1],f[0]))/3,Le=td+32|0;f[0]=We;a[Le>>2]=b[0];a[Le+4>>2]=b[1];var Me=Ja+40|0,Te=(b[0]=a[Me>>2],b[1]=a[Me+4>>2],f[0]);v=(Ja+56|0)>>2;m=(Ja+72|0)>>2;var Ue=Te+((b[0]=a[v],b[1]=a[v+1],f[0])-(b[0]=a[m],b[1]=a[m+1],f[0]))/3,Ve=td+40|0;f[0]=Ue;a[Ve>>2]=b[0];a[Ve+4>>2]=b[1];var Re=(b[0]=a[u],b[1]=a[u+1],f[0]),hf=Re+(Re-(b[0]=a[t],b[1]=a[t+1],f[0]))/3,Se=td+48|0;f[0]=hf;a[Se>>2]=b[0];a[Se+4>>2]=b[1];var Ze=(b[0]=a[v],b[1]=a[v+1],f[0]),jf=Ze+(Ze-(b[0]=a[m],b[1]=a[m+1],f[0]))/3,ff=td+56|0;f[0]=jf;a[ff>>2]=b[0];a[ff+4>>2]=b[1];var kf=4<(Nd|0);a:do{if(kf){for(var ge=4;;){p=((ge<<4)+td|0)>>2;j=((ge-2<<4)+g|0)>>2;a[p]=a[j];a[p+1]=a[j+1];a[p+2]=a[j+2];a[p+3]=a[j+3];var Ne=ge+1|0;if((Ne|0)==(Nd|0)){break a}else{ge=Ne}}}}while(0);zc(x,td,Nd,l&255);G(td);n=Na>>2;a[n]=a[w];a[n+1]=a[w+1];a[n+2]=a[w+2];a[n+3]=a[w+3];k=(Na+16|0)>>2;a[k]=a[kb];a[k+1]=a[kb+1];a[k+2]=a[kb+2];a[k+3]=a[kb+3];Gd(x,Na|0,2)}}}}}}}G(Ja);h=Na}function lH(x){var c,i,g,d,e,l,k,n,z=h;h+=32;var p;n=z>>2;var s=z+8;k=s>>2;var v=z+16,t=z+24,u=fa(44);l=u>>2;var w=x+24|0,A=a[a[w>>2]+8>>2];e=A>>2;var B=a[e],C=a[e+1],P=a[e+2],T=A+12|0,y=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0]),D=A+28|0,M=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),X=A+20|0,O=(b[0]=a[X>>2],b[1]=a[X+4>>2],f[0]),F=x|0,Da=jo(V(F,mH|0))&255|B,ia=0!=(Da|0);if(ia){var E,G=x|0,J=Xb(G,a[rh>>2],0,.01),H=Xb(G,a[sh>>2],0,.02),I=72*(J>H?J:H);E=(0>I?I-.5:I+.5)&-1|0;if(0<E){var K=E,L=E}else{var N=x+48|0,ca=(b[0]=a[N>>2],b[1]=a[N+4>>2],f[0]),R=x+56|0,Q=(b[0]=a[R>>2],b[1]=a[R+4>>2],f[0]),zb=72*(ca<Q?ca:Q),ja=(0>zb?zb-.5:zb+.5)&-1|0,L=K=ja}}else{var aa=x+48|0,da=72*(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]),ea=0>da?da-.5:da+.5,xa=x+56|0,U=72*(b[0]=a[xa>>2],b[1]=a[xa+4>>2],f[0]),K=(0>U?U-.5:U+.5)&-1|0,L=ea&-1|0}var S=Zf(F,a[$o>>2],C),ha=y+Xb(F,a[Rt>>2],0,-360);if(0==(P|0)){var ga=Xb(F,a[St>>2],0,-100),W=Zf(F,a[Tt>>2],4),Rb=Xb(F,a[Ut>>2],0,-100),Y=ga,tb=W}else{Rb=O,Y=M,tb=P}d=(x+120|0)>>2;var ya=a[d],$=ya+24|0,wa=(b[0]=a[$>>2],b[1]=a[$+4>>2],f[0]),Ab=ya+32|0,Fa=(b[0]=a[Ab>>2],b[1]=a[Ab+4>>2],f[0]),Ga=wa&-1,Z=-1<(Ga|0)?Ga:-Ga|0,ta=Z|0;p=-1<(Z|0)?0==(ta+.5&-1|0)?1774:1777:0==(ta-.5&-1|0)?1774:1777;if(1774==p){var Ka=Fa&-1,za=-1<(Ka|0)?Ka:-Ka|0,ma=za|0;if(-1<(za|0)){if(0==(ma+.5&-1|0)){var pa=wa,sa=Fa}else{p=1777}}else{0==(ma-.5&-1|0)?(pa=wa,sa=Fa):p=1777}}if(1777==p){var Ha=V(F,Zn|0);if(0==(Ha|0)){pa=wa+16,sa=Fa+8}else{var Ra=Cd(Ha,Lk|0,(j=h,h+=8,a[j>>2]=z,a[j+4>>2]=s,j)),ba=(b[0]=a[n],b[1]=a[n+1],f[0]);if(0>ba){f[0]=0;a[n]=b[0];a[n+1]=b[1];var ra=0}else{ra=ba}var La=(b[0]=a[k],b[1]=a[k+1],f[0]);if(0>La){f[0]=0;a[k]=b[0];a[k+1]=b[1];var qa=0}else{qa=La}if(0<(Ra|0)){var Ya=72*ra,na=0>Ya,Za=wa+(((na?Ya-.5:Ya+.5)&-1)<<1|0);if(1<(Ra|0)){var oa=72*qa,ab=0>oa?oa-.5:oa+.5,pa=Za,sa=Fa+((ab&-1)<<1|0)}else{var $a=na?Ya-.5:Ya+.5,pa=Za,sa=Fa+(($a&-1)<<1|0)}}else{pa=wa+16,sa=Fa+8}}}var jb=a[d]+24|0,Ca=pa-(b[0]=a[jb>>2],b[1]=a[jb+4>>2],f[0]);g=(x+20|0)>>2;var Ia=a[a[g]+44>>2]|0,eb=(b[0]=a[Ia>>2],b[1]=a[Ia+4>>2],f[0]);if(0<eb){var ub=72*eb,Sa=(0>ub?ub-.5:ub+.5)&-1|0,Ba=nH(pa,Sa),ua=nH(sa,Sa)}else{Ba=pa,ua=sa}var Oa=a[w>>2];if(0==m[Oa+12|0]<<24>>24){var Wa=V(F,ap|0);if(0==(Wa|0)){var pb=0,ob=0}else{if(0==m[Wa]<<24>>24){ob=pb=0}else{oH(t,a[g],Wa);var bb=a[t>>2],qb=a[t+4>>2];if(-1==(bb|0)&-1==(qb|0)){var Ma=a[x+12>>2];la(0,pH|0,(j=h,h+=8,a[j>>2]=Wa,a[j+4>>2]=Ma,j));ob=pb=0}else{m[a[g]+150|0]=1,pb=bb+2|0,ob=qb+2|0}}}}else{var kb=a[Oa>>2];if(99!=m[kb]<<24>>24){ob=pb=0}else{if(0!=(ka(kb,th|0)|0)){ob=pb=0}else{var ie=V(F,Xk|0);oH(v,a[g],ie);var vb=a[v>>2],xb=a[v+4>>2];if(-1==(vb|0)&-1==(xb|0)){var hd=0!=(ie|0)?ie:qH|0,nb=a[x+12>>2];la(0,rH|0,(j=h,h+=8,a[j>>2]=hd,a[j+4>>2]=nb,j));ob=pb=0}else{m[a[g]+150|0]=1,pb=vb+2|0,ob=xb+2|0}}}}var rb=pb|0,lb=Ba>rb?Ba:rb,Ta=ob|0,cb=ua>Ta?ua:Ta,fb=3>(tb|0)?0!=Rb|0!=Y?120:tb:tb,Ua=V(F,Vt|0);if(0==(Ua|0)){p=1818}else{var sb=m[Ua];116==sb<<24>>24||98==sb<<24>>24?m[a[d]+80|0]=sb:p=1818}1818==p&&(m[a[d]+80|0]=99);if(4==(fb|0)){if(0==(((0>ha?ha-.5:ha+.5)&-1)%90|0)&0==Rb&0==Y){var Na=lb,Fb=cb,Db=1}else{p=1824}}else{p=1824}if(1824==p){var Ob=1.4142135623730951*cb;if(K>Ob){if(99!=m[a[d]+80|0]<<24>>24){var Eb=1.4142135623730951,ne=Ob}else{var Bb=cb/K,Eb=$c(1/(1-Bb*Bb)),ne=cb}}else{Eb=1.4142135623730951,ne=Ob}var Ja=lb*Eb;if(2<(fb|0)){var Ea=se(3.141592653589793/(fb|0)),Na=Ja/Ea,Fb=ne/Ea}else{Na=Ja,Fb=ne}Db=0}if(0==re(jc(F,a[bp>>2],Ze|0))<<24>>24){var va=L>Na?L:Na,Aa=K>Fb?K:Fb}else{if(L<Na|K<Fb){var wb=a[a[g]+12>>2];la(0,sH|0,(j=h,h+=8,a[j>>2]=a[x+12>>2],a[j+4>>2]=wb,j))}va=L;Aa=K}if(ia){var Cb=va>Aa?va:Aa,Qa=Cb,ic=Cb}else{Qa=va,ic=Aa}if(0==re(jc(F,a[cp>>2],Ze|0))<<24>>24){if(Db){var Va=a[d]+40|0;f[0]=(Ba>Qa?Ba:Qa)-Ca;a[Va>>2]=b[0];a[Va+4>>2]=b[1]}else{if(ua<ic){var Pa=Qa*$c(1-ua*ua/(ic*ic)),hb=a[d]+40|0;f[0]=(Ba>Pa?Ba:Pa)-Ca;a[hb>>2]=b[0];a[hb+4>>2]=b[1]}else{var ib=a[d]+40|0;f[0]=Ba-Ca;a[ib>>2]=b[0];a[ib+4>>2]=b[1]}}}else{var Gb=a[d]+40|0;f[0]=Ba-Ca;a[Gb>>2]=b[0];a[Gb+4>>2]=b[1]}var pc=ic-Fb,Wc=a[d]+48|0;f[0]=ua+(ua<Ta?pc+(Ta-ua):pc);a[Wc>>2]=b[0];a[Wc+4>>2]=b[1];var Vb=1>(S|0)?1:S,Xd=3>(fb|0);a:do{if(Xd){var yb=fa(Vb<<5),db=yb,Ib=.5*Qa,Nb=.5*ic,mb=yb;f[0]=-Ib;a[mb>>2]=b[0];a[mb+4>>2]=b[1];var lc=yb+8|0;f[0]=-Nb;a[lc>>2]=b[0];a[lc+4>>2]=b[1];var Hb=yb+16|0;f[0]=Ib;a[Hb>>2]=b[0];a[Hb+4>>2]=b[1];var Jd=yb+24|0;f[0]=Nb;a[Jd>>2]=b[0];a[Jd+4>>2]=b[1];if(1<(S|0)){for(var Lb=Nb,Hc=Ib,Jb=2,oe=1;;){var Kb=Hc+4,Qb=Lb+4,tc=(Jb<<4)+db|0;f[0]=-Kb;a[tc>>2]=b[0];a[tc+4>>2]=b[1];var Sc=(Jb<<4)+db+8|0;f[0]=-Qb;a[Sc>>2]=b[0];a[Sc+4>>2]=b[1];var Pb=Jb|1,Yb=(Pb<<4)+db|0;f[0]=Kb;a[Yb>>2]=b[0];a[Yb+4>>2]=b[1];var Mb=(Pb<<4)+db+8|0;f[0]=Qb;a[Mb>>2]=b[0];a[Mb+4>>2]=b[1];var rd=oe+1|0;if((rd|0)==(S|0)){break}else{Lb=Qb,Hc=Kb,Jb=Jb+2|0,oe=rd}}oc=db;Wb=2;Tb=2*Kb;ve=2*Qb}else{var oc=db,Wb=2,Tb=Qa,ve=ic}}else{for(var Rd=fa((Vb<<4)*fb|0),Bc=Rd,Sd=6.283185307179586/(fb|0),fd=.5*Sd,$b=Ce(fd),yc=pi(be(Rb)+be(Y),1),Sb=1.4142135623730951*Rb/se(fd),uc=.5*Y,Tc=.5*(Sd-3.141592653589793),ec=3.141592653589793*(ha/180),Mc=0,id=Tc+.5*(3.141592653589793-Sd),Zb=0,qc=0,nc=.5*Ce(Tc),kc=.5*se(Tc);;){if((Mc|0)>=(fb|0)){var mc=Zb,fc=qc;break}var af=id+Sd,ac=Ce(af),Td=kc+$b*se(af),Fe=nc+$b*ac,bc=Td*(yc+Fe*Sb)+Fe*uc,fe=ec+Cf(Fe,bc),rc=Ce(fe),dc=se(fe),jd=pi(bc,Fe),md=jd*dc*Qa,je=jd*rc*ic,Qe=be(md)>Zb?be(md):Zb,Ac=be(je)>qc?be(je):qc,Uc=(Mc<<4)+Bc|0;f[0]=md;a[Uc>>2]=b[0];a[Uc+4>>2]=b[1];var gc=(Mc<<4)+Bc+8|0;f[0]=je;a[gc>>2]=b[0];a[gc+4>>2]=b[1];if(Db){p=1855;break}else{Mc=Mc+1|0,id=af,Zb=Qe,qc=Ac,nc=Fe,kc=Td}}if(1855==p){var Cc=-md,Ic=Rd+16|0;f[0]=Cc;a[Ic>>2]=b[0];a[Ic+4>>2]=b[1];var vc=Rd+24|0;f[0]=je;a[vc>>2]=b[0];a[vc+4>>2]=b[1];var ef=Rd+32|0;f[0]=Cc;a[ef>>2]=b[0];a[ef+4>>2]=b[1];var kd=-je,Kc=Rd+40|0;f[0]=kd;a[Kc>>2]=b[0];a[Kc+4>>2]=b[1];var Nc=Rd+48|0;f[0]=md;a[Nc>>2]=b[0];a[Nc+4>>2]=b[1];var zc=Rd+56|0;f[0]=kd;a[zc>>2]=b[0];a[zc+4>>2]=b[1];mc=Qe;fc=Ac}var Dc=2*mc,Ec=2*fc,nd=Qa>Dc?Qa:Dc,zd=ic>Ec?ic:Ec,cf=nd/Dc,Qc=zd/Ec,Fc=0<(fb|0);b:do{if(Fc){for(var Gc=0;;){i=((Gc<<4)+Bc|0)>>2;c=((Gc<<4)+Bc+8|0)>>2;var we=(b[0]=a[i],b[1]=a[i+1],f[0])*cf,pe=(b[0]=a[c],b[1]=a[c+1],f[0])*Qc;f[0]=we;a[i]=b[0];a[i+1]=b[1];f[0]=pe;a[c]=b[0];a[c+1]=b[1];var Zc=Gc+1|0;if((Zc|0)==(fb|0)){break b}else{Gc=Zc}}}}while(0);if(1<(S|0)){var Kd=fb-1|0,Dd=(Kd<<4)+Bc|0,Jc=(b[0]=a[Dd>>2],b[1]=a[Dd+4>>2],f[0]),Oc=(Kd<<4)+Bc+8|0,Ye=(b[0]=a[Oc>>2],b[1]=a[Oc+4>>2],f[0]),Ad=Rd,Ud=(b[0]=a[Ad>>2],b[1]=a[Ad+4>>2],f[0]),Vd=Rd+8|0,Pc=(b[0]=a[Vd>>2],b[1]=a[Vd+4>>2],f[0]);if(Fc){for(var Yc=Ud,gd=Pc,ud=0,Rc=Cf(Pc-Ye,Ud-Jc);;){for(var Lc=ud+1|0,of=(Lc|0)==(fb|0),ld=of?0:Lc,ad=(ld<<4)+Bc|0,bd=(b[0]=a[ad>>2],b[1]=a[ad+4>>2],f[0]),Xc=(ld<<4)+Bc+8|0,Vc=(b[0]=a[Xc>>2],b[1]=a[Xc+4>>2],f[0]),cd=Cf(Vc-gd,bd-Yc),ed=.5*(Rc+3.141592653589793-cd),qd=4/Ce(ed),vd=Rc-ed,dd=Ce(vd)*qd,Bd=se(vd)*qd,pd=gd,Fd=Yc,yd=1;;){var od=Fd+Bd,td=pd+dd,Ld=yd*fb+ud|0,wd=(Ld<<4)+Bc|0;f[0]=od;a[wd>>2]=b[0];a[wd+4>>2]=b[1];var te=(Ld<<4)+Bc+8|0;f[0]=td;a[te>>2]=b[0];a[te+4>>2]=b[1];var xd=yd+1|0;if((xd|0)==(S|0)){break}else{pd=td,Fd=od,yd=xd}}if(of){break}else{Yc=bd,gd=Vc,ud=Lc,Rc=cd}}for(var ke=fb*(S-1)|0,sd=zd,Md=nd,Gd=0;;){var Ed=Gd+ke|0,Wd=(Ed<<4)+Bc|0,Hd=(b[0]=a[Wd>>2],b[1]=a[Wd+4>>2],f[0]),Yd=(Ed<<4)+Bc+8|0,$d=(b[0]=a[Yd>>2],b[1]=a[Yd+4>>2],f[0]),Pd=2*be(Hd)>Md?2*be(Hd):Md,de=2*be($d)>sd?2*be($d):sd,Id=Gd+1|0;if((Id|0)==(fb|0)){oc=Bc;Wb=fb;Tb=Pd;ve=de;break a}else{sd=de,Md=Pd,Gd=Id}}}else{oc=Bc,Wb=fb,Tb=nd,ve=zd}}else{oc=Bc,Wb=fb,Tb=nd,ve=zd}}}while(0);a[l]=Da;a[l+1]=S;a[l+2]=Wb;var le=u+12|0;f[0]=ha;a[le>>2]=b[0];a[le+4>>2]=b[1];var ae=u+28|0;f[0]=Y;a[ae>>2]=b[0];a[ae+4>>2]=b[1];var Nd=u+20|0;f[0]=Rb;a[Nd>>2]=b[0];a[Nd+4>>2]=b[1];a[l+10]=oc;var ce=x+48|0;f[0]=Tb/72;a[ce>>2]=b[0];a[ce+4>>2]=b[1];var Qd=x+56|0;f[0]=ve/72;a[Qd>>2]=b[0];a[Qd+4>>2]=b[1];a[x+28>>2]=u;h=z}function tH(x){var c,i,g,d=h;h+=32;var e=d+16,l=a[a[x+20>>2]+152>>2]>>>2&1^1;i=x+120|0;g=a[a[i>>2]>>2];a[Fd>>2]=g;g=Ba(g);g=fa(1<(g|0)?g+1|0:2);c=dp(x,l,1,g);0==(c|0)?(la(1,uH|0,(j=h,h+=4,a[j>>2]=a[a[i>>2]>>2],j)),a[Fd>>2]=yg|0,l=dp(x,l,1,g)):l=c;G(g);Wt(d,x,l);g=(x+48|0)>>2;i=72*(b[0]=a[g],b[1]=a[g+1],f[0]);var k=(0>i?i-.5:i+.5)&-1|0;i=(x+56|0)>>2;c=72*(b[0]=a[i],b[1]=a[i+1],f[0]);var n=(0>c?c-.5:c+.5)&-1|0,z=x|0;c=(l|0)>>2;if(0==re(jc(z,a[bp>>2],Ze|0))<<24>>24){var p=(b[0]=a[c],b[1]=a[c+1],f[0]),m=l+8|0,v=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]),n=v>n?v:n,p=p>k?p:k,k=m}else{p=k,k=l+8|0}Xt(l,p,n,re(jc(z,a[cp>>2],Ze|0))&255);Xi(e,-.5*p,.5*n);z=e|0;e=e+8|0;Yt(l,(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]),(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),15);e=(b[0]=a[c],b[1]=a[c+1],f[0])/72;f[0]=e;a[g]=b[0];a[g+1]=b[1];e=((b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])+1)/72;f[0]=e;a[i]=b[0];a[i+1]=b[1];a[x+28>>2]=l;h=d}function vH(c){var d,i,g,q=fa(44);g=q>>2;var e=a[a[a[c+24>>2]+8>>2]+4>>2];d=c|0;i=Xb(d,a[rh>>2],1.7976931348623157e+308,3e-4);var l=Xb(d,a[sh>>2],1.7976931348623157e+308,3e-4),k=i<l?i:l;i=(c+56|0)>>2;1.7976931348623157e+308==k&1.7976931348623157e+308==l?(f[0]=.05,a[i]=b[0],a[i+1]=b[1],l=c+48|0,f[0]=.05,a[l>>2]=b[0],a[l+4>>2]=b[1],k=3.6):(f[0]=k,a[i]=b[0],a[i+1]=b[1],l=c+48|0,f[0]=k,a[l>>2]=b[0],a[l+4>>2]=b[1],k*=72);l=c+48|0;d=Zf(d,a[$o>>2],e);var e=fa(1>(d|0)?32:d<<5),h=.5*k,j=-h;f[0]=j;a[e>>2]=b[0];a[e+4>>2]=b[1];var p=e+8|0;f[0]=j;a[p>>2]=b[0];a[p+4>>2]=b[1];j=e+16|0;f[0]=h;a[j>>2]=b[0];a[j+4>>2]=b[1];j=e+24|0;f[0]=h;a[j>>2]=b[0];a[j+4>>2]=b[1];if(1<(d|0)){p=j=h;k=2;for(h=1;;){var m=p+4,j=j+4,p=(k<<4)+e|0;f[0]=-m;a[p>>2]=b[0];a[p+4>>2]=b[1];p=(k<<4)+e+8|0;f[0]=-j;a[p>>2]=b[0];a[p+4>>2]=b[1];var p=k|1,v=(p<<4)+e|0;f[0]=m;a[v>>2]=b[0];a[v+4>>2]=b[1];p=(p<<4)+e+8|0;f[0]=j;a[p>>2]=b[0];a[p+4>>2]=b[1];h=h+1|0;if((h|0)==(d|0)){break}else{p=m,k=k+2|0}}m*=2}else{m=k}a[g]=1;a[g+1]=d;a[g+2]=2;d=(q+12|0)>>2;a[d]=0;a[d+1]=0;a[d+2]=0;a[d+3]=0;a[d+4]=0;a[d+5]=0;a[g+10]=e;g=m/72;f[0]=g;a[l>>2]=b[0];a[l+4>>2]=b[1];f[0]=g;a[i]=b[0];a[i+1]=b[1];a[c+28>>2]=q}function Is(b){var c,i=a[Yk>>2];if(0==(i|0)){var g;return 0}for(var d=a[mo>>2],f=0;;){if((f|0)>=(d|0)){g=0;c=1901;break}var e=a[i+(f<<2)>>2],k=a[e>>2];if(m[k]<<24>>24==m[b]<<24>>24&&0==(ka(k,b)|0)){g=e;c=1902;break}f=f+1|0}if(1902==c||1901==c){return g}}function wH(b,c,i,g){var d=h;h+=40;i=xH(c,i,g);a[d+36>>2]=a[g+36>>2];Yi(c,a[g+24>>2],d,i,m[g+33|0]&255,0);c=d>>2;b>>=2;for(g=c+10;c<g;c++,b++){a[b]=a[c]}h=d}function xH(c,d,i){var g=h;h+=16;var q=g+8,e=c+20|0,l=a[a[a[e>>2]+32>>2]+152>>2]&3,k=c+32|0,n=c+40|0;yH(g,(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),l);k=d+32|0;d=d+40|0;yH(q,(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),l);d=m[i+33|0];l=d&255;if(15==d<<24>>24||0==d<<24>>24){return h=g,0}i=a[i+24>>2];if(0==(i|0)){var e=0==(a[a[e>>2]+152>>2]&1|0),i=c+96|0,i=.5*(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),d=-i,c=c+104|0,k=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),n=-k,c=e?n:d,j=e?d:n,p=e?k:i,n=e?i:k}else{c=i|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),e=i+8|0,d=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),e=i+16|0,i=i+24|0,j=d,p=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),n=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])}var i=a[g>>2],e=a[g+4>>2],d=a[q>>2],q=a[q+4>>2],s=.5*(c+p)&-1,k=.5*(j+n)&-1;if(0==(l&1|0)){var v=0,j=0}else{v=i+s-d|0,j=e+(j&-1)-q|0,v=j*j+v*v|0,j=zH|0}if(0==(l&2|0)){p=v}else{var p=i+(p&-1)-d|0,t=e+k-q|0,p=t*t+p*p|0,p=(t=0==(j|0)|(p|0)<(v|0))?p:v,j=t?Zt|0:j}0==(l&4|0)?(n=p,s=j):(s=i+s-d|0,n=e+(n&-1)-q|0,n=n*n+s*s|0,n=(s=0==(j|0)|(n|0)<(p|0))?n:p,s=s?$t|0:j);if(0==(l&8|0)){return h=g,s}l=i+(c&-1)-d|0;c=e+k-q|0;l=0==(s|0)|(c*c+l*l|0)<(n|0)?au|0:s;h=g;return l}function Yi(c,d,i,g,q,e){var l=h;h+=128;var k=l+16,n=l+32,j=l+48,p=l+64,s=l+80,v=l+96,t=l+112;if(0==(d|0)){var u=0==(a[a[c+20>>2]+152>>2]&1|0),w=c+96|0,w=.5*(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),A=c+104|0,A=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]),B=u?w:A,w=u?A:w,A=0,u=-w,C=-B,P=B,T=B=0}else{var u=d|0,u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),w=d+8|0,w=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),A=d+16|0,P=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]),A=d+24|0,y=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]);Xi(l,.5*(u+P),.5*(w+y));B=l|0;T=l+8|0;A=1;C=w;w=P;P=y;B=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]);T=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0])}0==(g|0)?(e=A,k=1,j=p=n=q=s=0,v=B,u=T):(y=m[g],0==y<<24>>24?(e=A,k=1,j=p=n=q=s=0,v=B,u=T):(y=y<<24>>24,g=g+1|0,119==(y|0)?(v=0==m[g]<<24>>24,j=v&1,e=v?1:A,k=j^1,s=v?q&8:0,q=0,n=v&1^1,p=v?3.141592653589793:0,v=v?u:B,u=T):115==(y|0)?(p=m[g]<<24>>24,119==(p|0)?(0==(e|0)?(v=u,u=C):(Zi(j,e,-2147483647,-2147483647),e=j|0,k=j+8|0,v=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),u=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])),e=1,k=0,s=q&9,n=q=0,p=-2.356194490192345,j=1):0==(p|0)?(0==(e|0)?(v=B,u=C):(Zi(k,e,-2147483647,B),e=k|0,k=k+8|0,v=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),u=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])),e=1,k=0,s=q&1,n=q=0,p=-1.5707963267948966,j=1):101==(p|0)?(0==(e|0)?(v=w,u=C):(Zi(n,e,-2147483647,2147483647),e=n|0,k=n+8|0,v=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),u=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])),e=1,k=0,s=q&3,n=q=0,p=-.7853981633974483,j=1):(e=A,k=1,q=s=0,n=1,j=p=0,v=B,u=T)):101==(y|0)?(v=0==m[g]<<24>>24,j=v&1,e=v?1:A,k=j^1,s=v?q&2:0,q=0,n=v&1^1,p=0,v=v?w:B,u=T):99==(y|0)?(e=A,k=1,j=p=n=q=s=0,v=B,u=T):95==(y|0)?(e=A,k=1,s=q,q=1,j=p=n=0,v=B,u=T):110==(y|0)?(k=m[g]<<24>>24,101==(k|0)?(0==(e|0)?(v=w,u=P):(Zi(s,e,2147483647,2147483647),e=s|0,k=s+8|0,v=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),u=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])),e=1,k=0,s=q&6,n=q=0,p=.7853981633974483,j=1):0==(k|0)?(0==(e|0)?(v=B,u=P):(Zi(p,e,2147483647,B),e=p|0,k=p+8|0,v=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),u=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])),e=1,k=0,s=q&4,n=q=0,p=1.5707963267948966,j=1):119==(k|0)?(0==(e|0)?(v=u,u=P):(Zi(v,e,2147483647,-2147483647),e=v|0,k=v+8|0,v=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),u=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])),e=1,k=0,s=q&12,n=q=0,p=2.356194490192345,j=1):(e=A,k=1,q=s=0,n=1,j=p=0,v=B,u=T)):(e=A,k=1,q=s=0,n=1,j=p=0,v=B,u=T)));c=(c+20|0)>>2;lG(t,v,u,90*(a[a[c]+152>>2]&3)|0);v=t|0;v=(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0]);t=t+8|0;t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]);m[i+33|0]=0==q<<24>>24?(2==(a[a[c]+152>>2]&3|0)?4==(s|0)?1:1==(s|0)?4:s:3==(a[a[c]+152>>2]&3|0)?4==(s|0)?2:8==(s|0)?1:2==(s|0)?4:1==(s|0)?8:s:1==(a[a[c]+152>>2]&3|0)?1==(s|0)?8:4==(s|0)?2:8==(s|0)?4:2==(s|0)?1:s:s)&255:s&255;a[i+24>>2]=d;d=i|0;f[0]=(0>v?v-.5:v+.5)&-1|0;a[d>>2]=b[0];a[d+4>>2]=b[1];d=i+8|0;f[0]=(0>t?t-.5:t+.5)&-1|0;a[d>>2]=b[0];a[d+4>>2]=b[1];d=i+16|0;a:{if(c=a[a[c]+152>>2]&3,2==(c|0)){c=-1*p}else{if(3==(c|0)){if(3.141592653589793==p){c=-1.5707963267948966}else{if(2.356194490192345==p){c=-.7853981633974483}else{if(1.5707963267948966==p){c=0}else{if(.7853981633974483==p){c=p}else{if(0==p){c=1.5707963267948966}else{if(-.7853981633974483==p){c=2.356194490192345}else{c=-1.5707963267948966==p?3.141592653589793:p;break a}}}}}}}else{c=1==(c|0)?p-1.5707963267948966:p}}}f[0]=c;a[d>>2]=b[0];a[d+4>>2]=b[1];if(0==v&0==t){return m[i+32|0]=-128,m[i+29|0]=j,m[i+28|0]=e,m[i+30|0]=k,m[i+31|0]=q,h=l,n}d=Cf(t,v)+4.71238898038469;m[i+32|0]=256*(6.283185307179586>d?d:d-6.283185307179586)/6.283185307179586&255;m[i+29|0]=j;m[i+28|0]=e;m[i+30|0]=k;m[i+31|0]=q;h=l;return n}function Xi(c,d,i){var g=c|0;f[0]=d;a[g>>2]=b[0];a[g+4>>2]=b[1];c=c+8|0;f[0]=i;a[c>>2]=b[0];a[c+4>>2]=b[1]}function yH(b,c,i,g){if(2==(g|0)){var d=-i,f=c,c=2026}else{if(0==(g|0)){d=i,f=c,c=2026}else{if(1==(g|0)){d=c,f=-i,c=2026}else{if(3==(g|0)){d=c,f=i,c=2026}else{var e=0,k=0,c=2027}}}}if(2026==c){if(0>f){var h=f-.5,j=d}else{e=f,k=d,c=2027}}2027==c&&(h=e+.5,j=k);a[b>>2]=h&-1;a[b+4>>2]=(0>j?j-.5:j+.5)&-1}function Zi(c,d,i,g){var q,e=h;h+=64;var l=a[d>>2],k=e+16|0;q=e>>2;a[q]=0;a[q+1]=0;a[q+2]=0;a[q+3]=0;f[0]=g/3;a[k>>2]=b[0];a[k+4>>2]=b[1];k=e+24|0;f[0]=i/3;a[k>>2]=b[0];a[k+4>>2]=b[1];k=e+32|0;f[0]=2*g/3;a[k>>2]=b[0];a[k+4>>2]=b[1];k=e+40|0;f[0]=2*i/3;a[k>>2]=b[0];a[k+4>>2]=b[1];k=e+48|0;f[0]=g;a[k>>2]=b[0];a[k+4>>2]=b[1];g=e+56|0;f[0]=i;a[g>>2]=b[0];a[g+4>>2]=b[1];vk(d,a[a[a[l+24>>2]+4>>2]+12>>2],e|0,1);c>>=2;a[c]=a[q];a[c+1]=a[q+1];a[c+2]=a[q+2];a[c+3]=a[q+3];h=e}function AH(b,c,i,g){var d,f=h;h+=52;var e,k=f+40;d=k>>2;var n=f+44;if(0==m[i]<<24>>24){c=bu>>2}else{g=0==(g|0)?cu|0:g;a[d]=15;if(0==m[a[c+120>>2]+82|0]<<24>>24){e=2047}else{var z=a[a[c+120>>2]+72>>2];2==m[z+4|0]<<24>>24?k=0:(z=tG(a[z>>2],i),0==(z|0)?k=0:(a[k>>2]=m[z+31|0]&255,k=z+40|0));0==(k|0)?e=2047:0!=(Yi(c,k,f,g,a[d],0)|0)&&la(0,du|0,(j=h,h+=12,a[j>>2]=a[c+12>>2],a[j+4>>2]=i,a[j+8>>2]=g,j))}2047==e&&((a[a[c+24>>2]+8>>2]|0)==(pl|0)?e=0:(a[n>>2]=c,a[n+4>>2]=0,e=n),0!=(Yi(c,0,f,i,a[d],e)|0)&&BH(a[c+12>>2],i));c=f>>2}b>>=2;for(i=c+10;c<i;c++,b++){a[b]=a[c]}h=f}function CH(c,d){var i,g,q,e=h,l=a[c+16>>2];q=l>>2;l=l+148|0;g=a[l>>2];var k=0==(g|0)?0!=(a[q+50]&1|0):1,n=a[d+28>>2];i=n>>2;if(0!=(n|0)){k&&0==(a[c+148>>2]&4|0)&&ad(c,g,a[q+42],a[q+46],a[q+38]);g=a[c+36>>2];var n=d+32|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])+(a[i+1]|0),z=d+40|0,z=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0])+(a[i+2]|0);i=a[i];Va(g,DH|0,(j=h,h+=20,f[0]=n,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=z,a[j+8>>2]=b[0],a[j+12>>2]=b[1],a[j+16>>2]=i,j));n=d+120|0;g=(a[n>>2]+56|0)>>2;i=(d+32|0)>>2;a[g]=a[i];a[g+1]=a[i+1];a[g+2]=a[i+2];a[g+3]=a[i+3];Fg(c,10,a[n>>2]);k&&(0!=(a[c+148>>2]&4|0)&&ad(c,a[l>>2],a[q+42],a[q+46],a[q+38]),Se(c))}h=e}function BH(b,c){var i=h;la(0,EH|0,(j=h,h+=8,a[j>>2]=b,a[j+4>>2]=c,j));h=i}function FH(c,d,i){var g=h;h+=16;var q=a[c+4>>2],c=a[c>>2];Ui(g,d,i,90*(a[a[c+20>>2]+152>>2]&3)|0);d=g|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);i=g+8|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);if(0==(q|0)){var q=a[c+28>>2],e=q+16|0,l=q+24|0,c=q+32|0,q=q+40|0}else{e=q,l=q+8|0,c=q+16|0,q=q+24|0}e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);if(e>d){return h=g,0}l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);if(d>(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])|l>i){return h=g,0}d=i<=q&1;h=g;return d}function GH(c,d,i,g,q){var e,l,k=h;h+=32;var n;if(0==m[d+28|0]<<24>>24){var j;h=k;return 0}for(var d=d|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),p=a[c+28>>2],s=a[p+48>>2],v=c+20|0,p=p+56|0,t=0;;){if((t|0)>=(s|0)){j=i;n=2114;break}var u=0==(a[a[v>>2]+152>>2]&1|0);l=a[a[p>>2]+(t<<2)>>2];if(u){var w=l+32|0,A=l+16|0}else{w=l+40|0,A=l+24|0}A=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])&-1|0;if(A<=d&&(e=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0])&-1|0,d<=e)){break}t=t+1|0}if(2114==n){return h=k,j}u?(l=(c+32|0)>>2,n=(b[0]=a[l],b[1]=a[l+1],f[0])+A,j=g|0,f[0]=n,a[j>>2]=b[0],a[j+4>>2]=b[1],j=c+40|0,n=c+96|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])-.5*(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),u=g+8|0,f[0]=j,a[u>>2]=b[0],a[u+4>>2]=b[1],e=(b[0]=a[l],b[1]=a[l+1],f[0])+e,l=g+16|0,f[0]=e,a[l>>2]=b[0],a[l+4>>2]=b[1],e=n):(e=c+32|0,n=c+40|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),j=h,l=(l+16|0)>>2,A=h,h+=32,a[A>>2]=a[l],a[A+4>>2]=a[l+1],a[A+8>>2]=a[l+2],a[A+12>>2]=a[l+3],a[A+16>>2]=a[l+4],a[A+20>>2]=a[l+5],a[A+24>>2]=a[l+6],a[A+28>>2]=a[l+7],l=A+24|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),u=A+16|0,u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),d=A+8|0,s=A|0,A=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])+e,d=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0])+n,s=k|0,f[0]=A,a[s>>2]=b[0],a[s+4>>2]=b[1],A=k+8|0,f[0]=d,a[A>>2]=b[0],a[A+4>>2]=b[1],A=k+16|0,f[0]=l+e,a[A>>2]=b[0],a[A+4>>2]=b[1],e=k+24|0,f[0]=u+n,a[e>>2]=b[0],a[e+4>>2]=b[1],h=j,l=g>>2,e=k>>2,a[l]=a[e],a[l+1]=a[e+1],a[l+2]=a[e+2],a[l+3]=a[e+3],a[l+4]=a[e+4],a[l+5]=a[e+5],a[l+6]=a[e+6],a[l+7]=a[e+7],e=c+96|0);c=c+40|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])+.5*(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);g=g+24|0;f[0]=c;a[g>>2]=b[0];a[g+4>>2]=b[1];a[q>>2]=1;h=k;return i}function HH(c,d){var i,g,q,e,l,k=h;h+=96;var n=k+32,j=a[c+16>>2];l=j>>2;var j=j+148|0,p=a[j>>2],s=0==(p|0)?0!=(a[l+50]&1|0):1,v=a[d+28>>2];i=(v+16|0)>>2;g=k>>2;a[g]=a[i];a[g+1]=a[i+1];a[g+2]=a[i+2];a[g+3]=a[i+3];a[g+4]=a[i+4];a[g+5]=a[i+5];a[g+6]=a[i+6];a[g+7]=a[i+7];i=d+32|0;q=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);i=(k|0)>>2;var t=(b[0]=a[i],b[1]=a[i+1],f[0])+q;f[0]=t;a[i]=b[0];a[i+1]=b[1];i=d+40|0;t=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);i=(k+8|0)>>2;e=(b[0]=a[i],b[1]=a[i+1],f[0])+t;f[0]=e;a[i]=b[0];a[i+1]=b[1];i=k+16|0;e=(i|0)>>2;q=(b[0]=a[e],b[1]=a[e+1],f[0])+q;f[0]=q;a[e]=b[0];a[e+1]=b[1];q=(k+24|0)>>2;t=(b[0]=a[q],b[1]=a[q+1],f[0])+t;f[0]=t;a[q]=b[0];a[q+1]=b[1];s&&0==(a[c+148>>2]&4|0)&&ad(c,p,a[l+42],a[l+46],a[l+38]);p=IH(c,d);ep(c,d);0!=(p&1|0)&&$b(c,Dh(d,qe|0));q=a[a[d+24>>2]>>2];p=77==m[q]<<24>>24?0==(ka(q,eu|0)|0)?p|2:p:p;0==(p&998|0)?mh(c,k,p&1):(q=n>>2,a[q]=a[g],a[q+1]=a[g+1],a[q+2]=a[g+2],a[q+3]=a[g+3],q=n+32|0,g=q>>2,i>>=2,a[g]=a[i],a[g+1]=a[i+1],a[g+2]=a[i+2],a[g+3]=a[i+3],g=q|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),i=n+16|0,f[0]=g,a[i>>2]=b[0],a[i+4>>2]=b[1],g=n+8|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),i=n+24|0,f[0]=g,a[i>>2]=b[0],a[i+4>>2]=b[1],g=n|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),i=n+48|0,f[0]=g,a[i>>2]=b[0],a[i+4>>2]=b[1],g=n+40|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),i=n+56|0,f[0]=g,a[i>>2]=b[0],a[i+4>>2]=b[1],Ii(c,Dh(d,qe|0),fu(d),n|0,4,p,p&1));gu(c,d,v);s&&(0!=(a[c+148>>2]&4|0)&&ad(c,a[j>>2],a[l+42],a[l+46],a[l+38]),Se(c));h=k}function IH(b,c){var i=h;h+=4;var g=hu(c,i);0!=(g|0)&&Ke(b,g);g=a[iu>>2];if(0!=(g|0)){var d=c|0,f=mb(d,a[g+8>>2]);0!=(f|0)&&0!=m[f]<<24>>24&&Zr(b,Xb(d,g,1,0))}h=i;return a[i>>2]}function ep(b,c){var i=Aa(c|0,a[Eh>>2],Y|0);0==m[i]<<24>>24?Pa(b,Ac|0):Pa(b,i)}function fp(c,d,i,g,q){var e=c|0;f[0]=d+g;a[e>>2]=b[0];a[e+4>>2]=b[1];c=c+8|0;f[0]=i+q;a[c>>2]=b[0];a[c+4>>2]=b[1]}function gu(c,d,i){var g,q,e,l,k,n,j,p,s,v,t=h;h+=96;var u=t+32;s=t+48;var w=t+64,A=t+80,B=i+52|0;v=a[B>>2];0==(v|0)?(B=d+32|0,s=d+40|0):(l=i+16|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=i+24|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),n=i+32|0,j=i+40|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),p=u|0,f[0]=.5*(l+n),a[p>>2]=b[0],a[p+4>>2]=b[1],l=u+8|0,f[0]=.5*(k+j),a[l>>2]=b[0],a[l+4>>2]=b[1],l=u|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),u=u+8|0,n=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),k=d+32|0,u=d+40|0,fp(s,l,n,(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])),v=(v+56|0)>>2,s>>=2,a[v]=a[s],a[v+1]=a[s+1],a[v+2]=a[s+2],a[v+3]=a[s+3],Fg(c,10,a[B>>2]),ep(c,d),B=k,s=u);B=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]);s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]);v=i+48|0;if(0<(a[v>>2]|0)){u=i+64|0;e=t+16|0;var C=i+56|0;p=e>>2;j=(t|0)>>2;n=(t+24|0)>>2;k=(t+8|0)>>2;var P=t|0;l=t>>2;var i=w>>2,T=e|0;e=A>>2;for(var y=t+16|0,D=0;;){if(0<(D|0)){q=((D<<2)+a[C>>2]|0)>>2;g=a[q];if(0==m[u]<<24>>24){g=(g+32|0)>>2;a[p]=a[g];a[p+1]=a[g+1];a[p+2]=a[g+2];a[p+3]=a[g+3];q=a[q]+16|0;q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);f[0]=q;a[j]=b[0];a[j+1]=b[1];var M=(b[0]=a[n],b[1]=a[n+1],f[0]);f[0]=M;a[k]=b[0];a[k+1]=b[1];g=M;var X=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0])}else{g=(g+16|0)>>2,a[l]=a[g],a[l+1]=a[g+1],a[l+2]=a[g+2],a[l+3]=a[g+3],X=(b[0]=a[j],b[1]=a[j+1],f[0]),f[0]=X,a[y>>2]=b[0],a[y+4>>2]=b[1],q=a[q]+40|0,M=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]),f[0]=M,a[n]=b[0],a[n+1]=b[1],q=X,g=(b[0]=a[k],b[1]=a[k+1],f[0])}fp(w,q,g,B,s);a[l]=a[i];a[l+1]=a[i+1];a[l+2]=a[i+2];a[l+3]=a[i+3];fp(A,X,M,B,s);a[p]=a[e];a[p+1]=a[e+1];a[p+2]=a[e+2];a[p+3]=a[e+3];Gd(c,P,2)}gu(c,d,a[a[C>>2]+(D<<2)>>2]);D=D+1|0;if((D|0)>=(a[v>>2]|0)){break}}}h=t}function fu(b){b=Aa(b|0,a[Eh>>2],Y|0);return 0==m[b]<<24>>24?Ac|0:b}function Dh(b,c){var i=b|0,g=Aa(i,a[gp>>2],Y|0);return 0==m[g]<<24>>24?(i=Aa(i,a[Eh>>2],Y|0),0==m[i]<<24>>24?c:i):g}function hu(b,c){var i,g=Aa(b|0,a[Ki>>2],Y|0),d=0==m[g]<<24>>24;a:do{if(d){var f=0,e=0}else{nh(g);for(var k=Cc|0,h=0;;){for(var j=k;;){var p=a[j>>2];if(0==(p|0)){f=h;e=Cc|0;break a}var s=m[p];if(114==s<<24>>24){if(0==(ka(p,Vr|0)|0)){var v=j;i=2181;break}}else{if(105==s<<24>>24){if(0==(ka(p,qh|0)|0)){i=2185;break}}else{if(102==s<<24>>24){if(0==(ka(p,Hi|0)|0)){i=2179;break}}else{if(100==s<<24>>24&&0==(ka(p,JH|0)|0)){var t=j;i=2183;break}}}}j=j+4|0}if(2181==i){for(;!(i=0,k=v+4|0,p=a[k>>2],a[v>>2]=p,0==(p|0));){v=k,i=2181}k=j;h|=2}else{if(2179==i){i=0,k=j+4|0,h|=1}else{if(2185==i){i=0,k=j+4|0,h|=16}else{if(2183==i){for(;!(i=0,k=t+4|0,p=a[k>>2],a[t>>2]=p,0==(p|0));){t=k,i=2183}k=j;h|=4}}}}}}}while(0);i=a[a[b+24>>2]+8>>2];if(0==(i|0)){return a[c>>2]=f,e}f|=a[i+36>>2];a[c>>2]=f;return e}function KH(b,c){var i,g=a[b+60>>2];if(0!=(g|0)&&m[g]<<24>>24==m[c]<<24>>24&&0==(ka(g,c)|0)){var d;return b}for(var g=b+56|0,f=a[b+48>>2],e=0;;){if((e|0)>=(f|0)){d=0;i=2201;break}var k=KH(a[a[g>>2]+(e<<2)>>2],c);if(0==(k|0)){e=e+1|0}else{d=k;i=2199;break}}if(2199==i||2201==i){return d}}function ju(b){var c=b+48|0,i=0<(a[c>>2]|0),g=b+56|0;a:do{if(i){for(var d=0;;){if(ju(a[a[g>>2]+(d<<2)>>2]),d=d+1|0,(d|0)>=(a[c>>2]|0)){break a}}}}while(0);G(a[b+60>>2]);vh(a[b+52>>2]);G(a[g>>2]);G(b)}function LH(c,d,i){var g=h;h+=16;c=a[c>>2];Ui(g,d,i,90*(a[a[c+20>>2]+152>>2]&3)|0);d=g|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);i=g+8|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);if((c|0)!=(a[ku>>2]|0)){var q=a[c+28>>2],e=(a[q+4>>2]<<1)-2|0,q=((0>(e|0)?1:e|1)<<4)+a[q+40>>2]|0,q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);f[0]=q;a[gg>>2]=b[0];a[gg+4>>2]=b[1];a[ku>>2]=c}if(be(d)>(b[0]=a[gg>>2],b[1]=a[gg+4>>2],f[0])||be(i)>(b[0]=a[gg>>2],b[1]=a[gg+4>>2],f[0])){return h=g,0}c=pi(d,i)<=(b[0]=a[gg>>2],b[1]=a[gg+4>>2],f[0])&1;h=g;return c}function MH(c,d){var i,g,q=h;h+=4;var e,l=a[c+16>>2];g=l>>2;var l=l+148|0,k=a[l>>2];if(0==(k|0)){if(0==(a[g+50]&1|0)){var n=0}else{e=2221}}else{e=2221}2221==e&&(0==(a[c+148>>2]&4|0)&&ad(c,k,a[g+42],a[g+46],a[g+38]),n=1);i=a[d+28>>2]>>2;var k=a[i+10],j=a[i+2];i=a[i+1];if((a[lu>>2]|0)<(j|0)){var p=j+2|0;a[lu>>2]=p;var s=a[ql>>2],p=0==(s|0)?Cb(p<<4):wb(s,p<<4);a[ql>>2]=p}hu(d,q);0==(a[q>>2]&16|0)?Ke(c,rl+4|0):Ke(c,rl|0);p=m[d+133|0]&255;0==(p&1|0)?0!=(p&2|0)?(p=d|0,Pa(c,Aa(p,a[mu>>2],Dk|0)),p=Aa(p,a[nu>>2],Ek|0),$b(c,p)):0!=(p&8|0)?(p=d|0,Pa(c,Aa(p,a[ou>>2],Fk|0)),p=Aa(p,a[pu>>2],Gk|0),$b(c,p)):0==(p&4|0)?(p=Dh(d,Ac|0),$b(c,p),ep(c,d)):(p=d|0,Pa(c,Aa(p,a[qu>>2],Hk|0)),p=Aa(p,a[ru>>2],Ik|0),$b(c,p)):(p=d|0,Pa(c,Aa(p,a[su>>2],Jk|0)),p=Aa(p,a[tu>>2],Kk|0),$b(c,p));if(0==(i|0)){if(0==m[p]<<24>>24){var v=1}else{Pa(c,p),v=1}e=2244}else{0<(i|0)&&(v=i,e=2244)}a:do{if(2244==e){i=0<(j|0);for(var p=d+32|0,s=d+40|0,t=0,u=1;;){b:do{if(i){for(var w=t*j|0,A=a[ql>>2],B=0;;){var C=B+w|0,P=(C<<4)+k|0,P=(b[0]=a[P>>2],b[1]=a[P+4>>2],f[0]),C=(C<<4)+k+8|0,C=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),P=P+(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),T=(B<<4)+A|0;f[0]=P;a[T>>2]=b[0];a[T+4>>2]=b[1];P=C+(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]);C=(B<<4)+A+8|0;f[0]=P;a[C>>2]=b[0];a[C+4>>2]=b[1];B=B+1|0;if((B|0)==(j|0)){var y=A;break b}}}else{y=a[ql>>2]}}while(0);Qk(c,y,u);t=t+1|0;if((t|0)==(v|0)){break a}else{u=0}}}}while(0);n&&(0!=(a[c+148>>2]&4|0)&&ad(c,a[l>>2],a[g+42],a[g+46],a[g+38]),Se(c));h=q}function NH(c,d,i){var g,q=h;h+=16;var e;g=a[c+4>>2];var c=a[c>>2],l=c+20|0;Ui(q,d,i,90*(a[a[l>>2]+152>>2]&3)|0);d=q|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);i=q+8|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);if(0!=(g|0)){var k=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);e=g+24|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);k>d?e=0:(k=g+8|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),c=g+16|0,e=d>(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])|k>i?0:i<=e);h=q;return e&1}if((c|0)==(a[uu>>2]|0)){c=(b[0]=a[sl>>2],b[1]=a[sl+4>>2],f[0]),g=(b[0]=a[tl>>2],b[1]=a[tl+4>>2],f[0])}else{g=a[c+28>>2]>>2;a[vu>>2]=a[g+10];var n=a[g+2];a[wu>>2]=n;var j=0==(a[a[l>>2]+152>>2]&1|0),l=c+104|0,p=c+112|0,p=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])+(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),l=c+96|0,m=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),l=j?m:p,m=j?p:m,j=c+48|0,j=72*(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),p=0>j,m=((p?j-.5:j+.5)&-1|0)/(0==m?1:m);f[0]=m;a[sl>>2]=b[0];a[sl+4>>2]=b[1];var v=c+56|0,v=72*(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0]),t=0>v,l=((t?v-.5:v+.5)&-1|0)/(0==l?1:l);f[0]=l;a[tl>>2]=b[0];a[tl+4>>2]=b[1];f[0]=.5*((p?j-.5:j+.5)&-1|0);a[Fh>>2]=b[0];a[Fh+4>>2]=b[1];f[0]=.5*((t?v-.5:v+.5)&-1|0);a[ul>>2]=b[0];a[ul+4>>2]=b[1];g=(a[g+1]-1)*n|0;a[xu>>2]=0>(g|0)?0:g;a[uu>>2]=c;c=m;g=l}d*=c;i*=g;if(be(d)>(b[0]=a[Fh>>2],b[1]=a[Fh+4>>2],f[0])){return h=q,0}c=be(i);g=(b[0]=a[ul>>2],b[1]=a[ul+4>>2],f[0]);if(c>g){return h=q,0}c=a[wu>>2];if(3>(c|0)){return e=1>pi(d/(b[0]=a[Fh>>2],b[1]=a[Fh+4>>2],f[0]),i/g)&1,h=q,e}m=(a[hp>>2]|0)%(c|0);j=(m+1|0)%(c|0);g=a[xu>>2];var l=g+m|0,n=a[vu>>2],p=(l<<4)+n|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),l=(l<<4)+n+8|0,v=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),l=g+j|0,t=(l<<4)+n|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),l=(l<<4)+n+8|0,u=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);if(0==(ip(d,i,0,0,p,v,t,u)|0)){return h=q,0}if(l=0!=(ip(d,i,p,v,t,u,0,0)|0)){if(0==(ip(d,i,t,u,0,0,p,v)|0)){p=1}else{return h=q,1}}else{p=1}for(;;){if((p|0)>=(c|0)){e=2290;break}l?(k=j,j=(j+1|0)%(c|0)):(k=(m-1+c|0)%(c|0),j=m);var u=g+k|0,v=g+j|0,t=(u<<4)+n|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),u=(u<<4)+n+8|0,u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),w=(v<<4)+n|0,v=(v<<4)+n+8|0;if(0==(ip(d,i,0,0,t,u,(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0]))|0)){e=2289;break}else{p=p+1|0,m=k}}if(2290==e){return a[hp>>2]=m,h=q,1}if(2289==e){return a[hp>>2]=k,h=q,0}}function ip(a,b,i,c,d,f,e,k){k=-(k-f);e-=d;d=k*d+e*f;return(0<=k*a+e*b-d^0<=k*i+e*c-d)&1^1}function OH(c,d){var i,g,q,e,l,k=a[c+16>>2];e=k>>2;var k=k+148|0,h=a[k>>2];if(0==(h|0)){if(0==(a[e+50]&1|0)){var j=0}else{l=2303}}else{l=2303}2303==l&&(0==(a[c+148>>2]&4|0)&&ad(c,h,a[e+42],a[e+46],a[e+38]),j=1);q=a[d+28>>2]>>2;var h=a[q+10],p=a[q+2],s=a[q+1];if((a[yu>>2]|0)<(p|0)){q=p+5|0;a[yu>>2]=q;var v=a[hg>>2];q=0==(v|0)?Cb(q<<4):wb(v,q<<4);a[hg>>2]=q}q=d+120|0;v=d+32|0;g=(a[q>>2]+56|0)>>2;i=v>>2;a[g]=a[i];a[g+1]=a[i+1];a[g+2]=a[i+2];a[g+3]=a[i+3];i=d+104|0;g=d+112|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])+(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);g=d+48|0;g=72*(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);i/=(0>g?g-.5:g+.5)&-1|0;g=d+96|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);var t=d+56|0,t=72*(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]);g/=(0>t?t-.5:t+.5)&-1|0;var t=IH(c,d),u=m[d+133|0]&255;0==(u&1|0)?0!=(u&2|0)?(u=d|0,Pa(c,Aa(u,a[mu>>2],Dk|0)),$b(c,Aa(u,a[nu>>2],Ek|0)),u=1):0!=(u&8|0)?(u=d|0,Pa(c,Aa(u,a[ou>>2],Fk|0)),$b(c,Aa(u,a[pu>>2],Gk|0)),u=1):0!=(u&4|0)?(u=d|0,Pa(c,Aa(u,a[qu>>2],Hk|0)),$b(c,Aa(u,a[ru>>2],Ik|0)),u=1):(0==(t&1|0)?u=0:($b(c,Dh(d,qe|0)),u=1),ep(c,d)):(u=d|0,Pa(c,Aa(u,a[su>>2],Jk|0)),$b(c,Aa(u,a[tu>>2],Kk|0)),u=1);var w=d+24|0,A=a[w>>2],B=m[A+12|0];if(0==B<<24>>24){var C=0;l=2331}else{if(l=a[A>>2],99==m[l]<<24>>24){C=0!=(ka(l,th|0)|0),l=2331}else{var P=l,T=1,y=0==u<<24>>24,D=s;l=2339}}if(2331==l){var M=0==u<<24>>24;0!=(s|0)|M|C?w=M:(C=Dh(d,qe|0),0==m[C]<<24>>24?(s=1,C=w=0):(Pa(c,C),B=a[w>>2],s=1,C=w=0,A=B,B=m[B+12|0]));if(0==B<<24>>24){if(B=V(d|0,ap|0),0==(B|0)){var X=u,O=s}else{P=B,T=C,y=w,D=s,l=2339}}else{P=a[A>>2],P=99!=m[P]<<24>>24?P:0!=(ka(P,th|0)|0)?P:V(d|0,Xk|0),T=C,y=w,D=s,l=2339}}if(2339==l){X=0<(p|0);a:do{if(X){O=v|0;C=a[hg>>2];s=d+40|0;for(l=0;;){if(B=(l<<4)+h|0,A=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),B=(l<<4)+h+8|0,B=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),A=A*i+(b[0]=a[O>>2],b[1]=a[O+4>>2],f[0]),w=(l<<4)+C|0,f[0]=A,a[w>>2]=b[0],a[w+4>>2]=b[1],B=B*g+(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),A=(l<<4)+C+8|0,f[0]=B,a[A>>2]=b[0],a[A+4>>2]=b[1],l=l+1|0,(l|0)==(p|0)){break a}}}}while(0);X=u&255;y|T||(3>(p|0)?(Qk(c,a[hg>>2],u),0!=(t&4|0)&&PH(c,d)):(O=a[hg>>2],0==(t&6|0)?zc(c,O,p,u):Ii(c,Dh(d,qe|0),fu(d),O,p,t,X)));ut(c,P,a[hg>>2],p,u,jc(d|0,a[zu>>2],Ze|0));X=0;O=D}P=0<(O|0);a:do{if(P){D=0<(p|0);T=3>(p|0);y=0==(t&4|0);u=0==(t&998|0);C=v|0;s=d+40|0;l=0;for(B=X;;){b:do{if(D){A=l*p|0;w=a[hg>>2];for(M=0;;){var F=M+A|0,Da=(F<<4)+h|0,Da=(b[0]=a[Da>>2],b[1]=a[Da+4>>2],f[0]),F=(F<<4)+h+8|0,F=(b[0]=a[F>>2],b[1]=a[F+4>>2],f[0]),Da=Da*i+(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),ia=(M<<4)+w|0;f[0]=Da;a[ia>>2]=b[0];a[ia+4>>2]=b[1];Da=F*g+(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]);F=(M<<4)+w+8|0;f[0]=Da;a[F>>2]=b[0];a[F+4>>2]=b[1];M=M+1|0;if((M|0)==(p|0)){var E=w;break b}}}else{E=a[hg>>2]}}while(0);T?(Qk(c,E,B),y||PH(c,d)):u?zc(c,E,p,B):Ii(c,Dh(d,qe|0),fu(d),E,p,t,B&255);l=l+1|0;if((l|0)==(O|0)){break a}else{B=0}}}}while(0);Fg(c,10,a[q>>2]);j&&(0!=(a[c+148>>2]&4|0)&&ad(c,a[k>>2],a[e+42],a[e+46],a[e+38]),Se(c))}function PH(c,d){var i,g,q=h;h+=48;i=q+32;var e=d+96|0,e=.375*(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),l=d+112|0,k=.6614*(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),l=q|0;g=d+32|0;var n=d+40|0;fp(i,k,e,(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]));g=q>>2;i>>=2;a[g]=a[i];a[g+1]=a[i+1];a[g+2]=a[i+2];a[g+3]=a[i+3];g=(q+8|0)>>2;n=(b[0]=a[g],b[1]=a[g+1],f[0]);i=(q+24|0)>>2;f[0]=n;a[i]=b[0];a[i+1]=b[1];n=q|0;k=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])-2*k;n=q+16|0;f[0]=k;a[n>>2]=b[0];a[n+4>>2]=b[1];Gd(c,l,2);e=(b[0]=a[g],b[1]=a[g+1],f[0])-2*e;f[0]=e;a[g]=b[0];a[g+1]=b[1];f[0]=e;a[i]=b[0];a[i+1]=b[1];Gd(c,l,2);h=q}function nH(a,b){var i=a/b&-1;return(((i|0)*b+1e-5<a&1)+i|0)*b}function dp(c,d,i,g){var q,e,l=fa(68),k=a[c+120>>2],h=0,j=a[Fd>>2],p=1;a:for(;;){var s=m[j];do{if(0==s<<24>>24){var v=p;break a}else{if(92==s<<24>>24){var t=j+1|0,u=m[t];if(92==u<<24>>24||123==u<<24>>24||125==u<<24>>24||124==u<<24>>24){var w=h,A=t,B=p}else{var C=t,P=u;e=2375}}else{C=j,P=s,e=2375}}}while(0);if(2375==e){e=0;if(124==P<<24>>24){var T=h,y=(0==(h|0)&1)+p|0}else{T=125==P<<24>>24?h-1|0:123==P<<24>>24?h+1|0:h,y=p}if(0>(T|0)){v=y;break}else{w=T,A=C,B=y}}h=w;j=A+1|0;p=B}q=(l+56|0)>>2;a[q]=fa(v<<2);m[l+64|0]=d&255;var D=0==(d|0)&1,M=k+82|0,X=g+1|0,O=0==(i|0),F=c|0,Da=k+16|0,ia=k+4|0,E=k+8|0,G=0,J=0,I=0,H=0,K=0,L=g,N=0,ca=g,R=0;a:for(;;){for(var S=G,zb=J,ja=H,aa=K,da=L,ea=N,xa=ca,Q=R;;){var U=S,ha=zb,ga=ja,W=da,V=ea,Y=xa,tb=Q,ya=0;b:for(;;){var $=U,wa=ha,Ab=ga,Fa=W,Ga=V,la=Y,ta=tb;c:for(;;){var Ka=$,za=Ab,ma=Ga,pa=ta;d:for(;;){for(var Z=Ka,Ha=za;;){if(I){e=2448;break a}var Ra=a[Fd>>2],ka=m[Ra],sa=ka<<24>>24;if(60==(sa|0)){break}else{if(62==(sa|0)){e=2393;break d}else{if(92==(sa|0)){e=2422;break d}else{if(125==(sa|0)||124==(sa|0)||0==(sa|0)){break b}else{if(123!=(sa|0)){var La=wa,ba=Ha,Ya=Fa,ra=Ra;break d}}}}}var Za=Ra+1|0;a[Fd>>2]=Za;if(0!=(Ha|0)){e=2402;break a}if(0==m[Za]<<24>>24){e=2402;break a}var qa=dp(c,D,0,g);a[a[q]+(Z<<2)>>2]=qa;if(0==(qa|0)){e=2404;break a}else{Z=Z+1|0,Ha=4}}if(0!=(Ha&6|0)){e=2390;break a}if(0!=m[M]<<24>>24){La=wa;ba=Ha;Ya=Fa;ra=Ra;break}a[Fd>>2]=Ra+1|0;Ka=Z;za=Ha|18;pa=ma=g}d:do{if(2393==e){if(e=0,0==m[M]<<24>>24){break c}else{La=wa,ba=Ha,Ya=Fa,ra=Ra}}else{if(2422==e){e=0;var ab=Ra+1|0,$a=m[ab];if(0==$a<<24>>24){La=wa,ba=Ha,Ya=Fa,ra=Ra}else{if(123==$a<<24>>24||125==$a<<24>>24||124==$a<<24>>24||60==$a<<24>>24||62==$a<<24>>24){a[Fd>>2]=ab,La=wa,ba=Ha,Ya=Fa}else{32==$a<<24>>24&&(e=2424);do{if(2424==e&&(e=0,0==m[M]<<24>>24)){a[Fd>>2]=ab;La=1;ba=Ha;Ya=Fa;ra=ab;break d}}while(0);m[Fa]=92;a[Fd>>2]=ab;La=wa;ba=Ha|9;Ya=Fa+1|0}ra=ab}}}}while(0);if(0!=(ba&4|0)&&32!=m[ra]<<24>>24){e=2429;break a}var jb=0==(ba&24|0)?32==m[ra]<<24>>24?ba:ba|9:ba;if(0==(jb&8|0)){if(0==(jb&16|0)){var Ca=Ya,Ia=ma,eb=la,ub=pa}else{var Sa=m[ra],na=0==(La|0);if(32==Sa<<24>>24&na){if((ma|0)==(g|0)){var ua=ma}else{32==m[ma-1|0]<<24>>24?ua=ma:e=2443}}else{e=2443}2443==e&&(e=0,m[ma]=Sa,ua=ma+1|0);na?(Ca=Ya,Ia=ua,eb=la,ub=pa):(Ca=Ya,Ia=ua,eb=la,ub=ua-1|0)}}else{var Oa=m[ra],Wa=0==(La|0);if(32==Oa<<24>>24&Wa){if(32!=m[Ya-1|0]<<24>>24){e=2436}else{if(0==m[M]<<24>>24){var pb=Ya}else{e=2436}}}else{e=2436}2436==e&&(e=0,m[Ya]=Oa,pb=Ya+1|0);Wa?(Ca=pb,Ia=ma,eb=la):(Ca=pb,Ia=ma,eb=pb-1|0);ub=pa}var ob=ra+1|0;a[Fd>>2]=ob;var bb=m[ob];if(0>bb<<24>>24){for(var qb=Ca,oa=ob,kb=bb;;){var Ba=oa+1|0;a[Fd>>2]=Ba;var vb=qb+1|0;m[qb]=kb;var xb=m[Ba];if(0>xb<<24>>24){qb=vb,oa=Ba,kb=xb}else{$=Z;wa=La;Ab=jb;Fa=vb;Ga=Ia;la=eb;ta=ub;continue c}}}else{$=Z,wa=La,Ab=jb,Fa=Ca,Ga=Ia,la=eb,ta=ub}}if(0==(Ha&16|0)){e=2395;break a}if(ma>>>0>X>>>0){var hd=ma-1|0,nb=(hd|0)==(pa|0)?ma:32==m[hd]<<24>>24?hd:ma}else{nb=ma}m[nb]=0;var rb=Hb(g);a[Fd>>2]=a[Fd>>2]+1|0;U=Z;ha=wa;ga=Ha&-17;W=Fa;V=nb;Y=la;tb=pa;ya=rb}if(0==ka<<24>>24&O){e=2407;break a}if(0!=(Ha&16|0)){e=2407;break a}if(0==(Ha&4|0)){var lb=fa(68);a[a[q]+(Z<<2)>>2]=lb;var Ta=Z+1|0,cb=lb}else{Ta=Z,cb=aa}0!=(ya|0)&&(a[cb+60>>2]=ya);if(0==(Ha&5|0)){m[Fa]=32;var fb=Ha|1,Ua=Fa+1|0}else{fb=Ha,Ua=Fa}if(0==(fb&1|0)){var sb=Ua,Na=la}else{if(Ua>>>0>X>>>0){var Fb=Ua-1|0,Db=(Fb|0)==(la|0)?Ua:32==m[Fb]<<24>>24?Fb:Ua}else{Db=Ua}m[Db]=0;var Ob=Hb(g);a[cb+52>>2]=ag(F,Ob,0!=m[M]<<24>>24?2:0,(b[0]=a[Da>>2],b[1]=a[Da+4>>2],f[0]),a[ia>>2],a[E>>2]);m[cb+64|0]=1;Na=sb=g}var Eb=a[Fd>>2],va=m[Eb];if(0==va<<24>>24){G=Ta;J=wa;I=1;H=fb;K=cb;L=sb;N=ma;ca=Na;R=pa;continue a}else{if(125==va<<24>>24){e=2420;break a}}a[Fd>>2]=Eb+1|0;S=Ta;zb=wa;ja=0;aa=cb;da=sb;ea=ma;xa=Na;Q=pa}}if(2390==e){$i(l,ya);var Bb=0;return Bb}if(2407==e||2395==e||2404==e||2429==e){return $i(l,ya),Bb=0}if(2448==e){return a[l+48>>2]=Z,Bb=l}if(2420==e){return a[Fd>>2]=Eb+1|0,a[l+48>>2]=Ta,Bb=l}if(2402==e){return $i(l,ya),Bb=0}}function Wt(c,d,i){var g=h;h+=32;var q=g+8,e=g+16,l=a[i+52>>2],k=0==(l|0);a:do{if(k){var n=i+48|0;if(0<(a[n>>2]|0)){for(var z=i+56|0,p=e|0,s=e+8|0,v=i+64|0,t=0,u=0,w=0;;){Wt(e,d,a[a[z>>2]+(w<<2)>>2]);var A=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),B=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]);0==m[v]<<24>>24?(u=u>A?u:A,t+=B):(u+=A,t=t>B?t:B);w=w+1|0;if((w|0)>=(a[n>>2]|0)){C=u;P=t;break a}}}else{var C=0,P=0}}else{C=l+24|0,n=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),C=l+32|0,P=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),0<n|0<P?(C=V(d|0,Zn|0),0==(C|0)?(C=n+16,P+=8):(C=Cd(C,Lk|0,(j=h,h+=8,a[j>>2]=g,a[j+4>>2]=q,j)),0<(C|0)?(z=72*(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),n+=((0>z?z-.5:z+.5)&-1)<<1|0,z=72*(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]),z=(p=0<=z)?z+.5:z-.5,C=n,P+=(z&-1)<<1|0):(C=n+16,P+=8))):C=n}}while(0);d=i|0;f[0]=C;a[d>>2]=b[0];a[d+4>>2]=b[1];i=i+8|0;f[0]=P;a[i>>2]=b[0];a[i+4>>2]=b[1];i=c|0;f[0]=C;a[i>>2]=b[0];a[i+4>>2]=b[1];c=c+8|0;f[0]=P;a[c>>2]=b[0];a[c+4>>2]=b[1];h=g}function Xt(c,d,i,g){var q,e,l=h;h+=32;var k=l+16;e=(c|0)>>2;var n=d-(b[0]=a[e],b[1]=a[e+1],f[0]);q=(c+8|0)>>2;var j=i-(b[0]=a[q],b[1]=a[q+1],f[0]);f[0]=d;a[e]=b[0];a[e+1]=b[1];f[0]=i;a[q]=b[0];a[q+1]=b[1];q=c+52|0;e=a[q>>2];if(0!=(e|0)&0==(g|0)){e=(e+40|0)>>2;var p=(b[0]=a[e],b[1]=a[e+1],f[0])+n;f[0]=p;a[e]=b[0];a[e+1]=b[1];q=(a[q>>2]+48|0)>>2;e=(b[0]=a[q],b[1]=a[q+1],f[0])+j;f[0]=e;a[q]=b[0];a[q+1]=b[1]}q=c+48|0;p=a[q>>2];if(0!=(p|0)){e=c+64|0;var s=m[e],n=(0==s<<24>>24?j:n)/(p|0);if(0<(p|0)){for(var c=c+56|0,j=k|0,p=k+8|0,v=l|0,t=l+8|0,u=0,w=s;;){var s=a[a[c>>2]+(u<<2)>>2],A=u+1|0,u=(A*n&-1)-(u*n&-1)|0;0==w<<24>>24?(w=s+8|0,Xi(k,d,(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0])+(u|0)),w=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),u=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])):(w=s|0,Xi(l,(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0])+(u|0),i),w=(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0]),u=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]));Xt(s,w,u,g);if((A|0)>=(a[q>>2]|0)){break}u=A;w=m[e]}}}h=l}function Yt(c,d,i,g){var q,e,l,k=h;h+=32;q=k+16;m[c+65|0]=g&255;e=c+8|0;Xi(k,d,i-(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]));l=(c+16|0)>>2;e=k>>2;a[l]=a[e];a[l+1]=a[e+1];a[l+2]=a[e+2];a[l+3]=a[e+3];e=c|0;Xi(q,(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])+d,i);e=(c+32|0)>>2;q>>=2;a[e]=a[q];a[e+1]=a[q+1];a[e+2]=a[q+2];a[e+3]=a[q+3];q=a[c+48>>2];e=q-1|0;if(0<=(e|0)){l=0==(g|0);for(var n=c+56|0,c=c+64|0,j=d,d=0;;){if(l){var p=0}else{var p=0==(d|0),s=(d|0)==(e|0),p=0==m[c]<<24>>24?p?s?15:14:s?11:10:p?s?15:13:s?7:5}Yt(a[a[n>>2]+(d<<2)>>2],j,i,p&g);p=a[a[n>>2]+(d<<2)>>2];0==m[c]<<24>>24?(p=p+8|0,i-=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])):(p|=0,j+=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]));d=d+1|0;if((d|0)==(q|0)){break}}}h=k}function $i(a,b){ju(a);0!=(b|0)&&G(b)}function vk(c,d,i,g){var q,e,l,k=h;h+=96;var n=k+64;l=n>>2;var j=k+72;e=j>>2;var p=k+80;q=k|0;if(0==g<<24>>24){var g=n,m=q,v=0,n=i+48|0;q=i+56|0}else{g=j,j=n,m=0,v=q,n=i|0,q=i+8|0}var t=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),u=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);f[0]=0;a[l]=b[0];a[l+1]=b[1];f[0]=1;a[e]=b[0];a[e+1]=b[1];var w=p|0,A=p+8|0,B=k|0,C=k+8|0,P=k+16|0,T=P|0,y=k+24|0,n=k+32|0,D=n|0,M=k+40|0;q=k+48|0;for(var X=q|0,O=k+56|0,F=0,Da=1,ia=0;;){var E,G,I,H,K,L,N,R,ca=.5*(Da+ia);Ld(p,i,3,ca,m,v);Da=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]);ia=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]);if(0==J[d](c,Da,ia)<<24>>24){var S=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),Q=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),zb=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0]),ja=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),aa=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),da=(b[0]=a[M>>2],b[1]=a[M+4>>2],f[0]),ea=(b[0]=a[X>>2],b[1]=a[X+4>>2],f[0]),xa=(b[0]=a[O>>2],b[1]=a[O+4>>2],f[0]);f[0]=ca;a[g>>2]=b[0];a[g+4>>2]=b[1];ca=1}else{f[0]=ca,a[j>>2]=b[0],a[j+4>>2]=b[1],ca=F,S=R,Q=N,zb=L,ja=K,aa=H,da=I,ea=G,xa=E}t-=Da;if(.5>=(0>t?-t:t)){if(t=u-ia,.5>=(0>t?-t:t)){break}}F=ca;t=Da;u=ia;Da=(b[0]=a[e],b[1]=a[e+1],f[0]);ia=(b[0]=a[l],b[1]=a[l+1],f[0]);R=S;N=Q;L=zb;K=ja;H=aa;I=da;G=ea;E=xa}0==ca<<24>>24?(d=i>>2,c=k>>2,a[d]=a[c],a[d+1]=a[c+1],a[d+2]=a[c+2],a[d+3]=a[c+3],c=(i+16|0)>>2,d=P>>2,a[c]=a[d],a[c+1]=a[d+1],a[c+2]=a[d+2],a[c+3]=a[d+3],c=(i+32|0)>>2,d=n>>2,a[c]=a[d],a[c+1]=a[d+1],a[c+2]=a[d+2],a[c+3]=a[d+3],i=(i+48|0)>>2,q>>=2,a[i]=a[q],a[i+1]=a[q+1],a[i+2]=a[q+2],a[i+3]=a[q+3]):(q=i|0,f[0]=S,a[q>>2]=b[0],a[q+4>>2]=b[1],q=i+8|0,f[0]=Q,a[q>>2]=b[0],a[q+4>>2]=b[1],q=i+16|0,f[0]=zb,a[q>>2]=b[0],a[q+4>>2]=b[1],q=i+24|0,f[0]=ja,a[q>>2]=b[0],a[q+4>>2]=b[1],q=i+32|0,f[0]=aa,a[q>>2]=b[0],a[q+4>>2]=b[1],q=i+40|0,f[0]=da,a[q>>2]=b[0],a[q+4>>2]=b[1],q=i+48|0,f[0]=ea,a[q>>2]=b[0],a[q+4>>2]=b[1],i=i+56|0,f[0]=xa,a[i>>2]=b[0],a[i+4>>2]=b[1]);h=k}function jp(c,d,i,g){var q,e,l,k,n,j,p,m,v,t,u,w,A,B,C,P,T,y,D=h;h+=64;y=(d+112|0)>>2;var M=(b[0]=a[y],b[1]=a[y+1],f[0]);T=(d+32|0)>>2;e=(b[0]=a[T],b[1]=a[T+1],f[0]);P=(d+40|0)>>2;q=(b[0]=a[P],b[1]=a[P+1],f[0]);C=(i|0)>>2;l=(b[0]=a[C],b[1]=a[C+1],f[0])-e;B=(D|0)>>2;f[0]=l;a[B]=b[0];a[B+1]=b[1];A=(i+8|0)>>2;l=(b[0]=a[A],b[1]=a[A+1],f[0])-q;w=(D+8|0)>>2;f[0]=l;a[w]=b[0];a[w+1]=b[1];u=(i+16|0)>>2;l=(b[0]=a[u],b[1]=a[u+1],f[0])-e;t=(D+16|0)>>2;f[0]=l;a[t]=b[0];a[t+1]=b[1];v=(i+24|0)>>2;l=(b[0]=a[v],b[1]=a[v+1],f[0])-q;m=(D+24|0)>>2;f[0]=l;a[m]=b[0];a[m+1]=b[1];p=(i+32|0)>>2;l=(b[0]=a[p],b[1]=a[p+1],f[0])-e;j=(D+32|0)>>2;f[0]=l;a[j]=b[0];a[j+1]=b[1];n=(i+40|0)>>2;l=(b[0]=a[n],b[1]=a[n+1],f[0])-q;k=(D+40|0)>>2;f[0]=l;a[k]=b[0];a[k+1]=b[1];l=(i+48|0)>>2;var X=(b[0]=a[l],b[1]=a[l+1],f[0])-e;e=(D+48|0)>>2;f[0]=X;a[e]=b[0];a[e+1]=b[1];i=(i+56|0)>>2;X=(b[0]=a[i],b[1]=a[i+1],f[0])-q;q=(D+56|0)>>2;f[0]=X;a[q]=b[0];a[q+1]=b[1];M&=-1;vk(c,a[a[a[d+24>>2]+4>>2]+12>>2],D|0,g);c=(b[0]=a[B],b[1]=a[B+1],f[0])+(b[0]=a[T],b[1]=a[T+1],f[0]);f[0]=c;a[C]=b[0];a[C+1]=b[1];C=(b[0]=a[w],b[1]=a[w+1],f[0])+(b[0]=a[P],b[1]=a[P+1],f[0]);f[0]=C;a[A]=b[0];a[A+1]=b[1];A=(b[0]=a[t],b[1]=a[t+1],f[0])+(b[0]=a[T],b[1]=a[T+1],f[0]);f[0]=A;a[u]=b[0];a[u+1]=b[1];u=(b[0]=a[m],b[1]=a[m+1],f[0])+(b[0]=a[P],b[1]=a[P+1],f[0]);f[0]=u;a[v]=b[0];a[v+1]=b[1];v=(b[0]=a[j],b[1]=a[j+1],f[0])+(b[0]=a[T],b[1]=a[T+1],f[0]);f[0]=v;a[p]=b[0];a[p+1]=b[1];p=(b[0]=a[k],b[1]=a[k+1],f[0])+(b[0]=a[P],b[1]=a[P+1],f[0]);f[0]=p;a[n]=b[0];a[n+1]=b[1];T=(b[0]=a[e],b[1]=a[e+1],f[0])+(b[0]=a[T],b[1]=a[T+1],f[0]);f[0]=T;a[l]=b[0];a[l+1]=b[1];P=(b[0]=a[q],b[1]=a[q+1],f[0])+(b[0]=a[P],b[1]=a[P+1],f[0]);f[0]=P;a[i]=b[0];a[i+1]=b[1];f[0]=M|0;a[y]=b[0];a[y+1]=b[1];h=D}function Au(b,c){var i,g;i=0==m[b+124|0]<<24>>24;a:do{if(i){g=b}else{for(var d=b;;){if(d=a[d+128>>2],0==m[d+124|0]<<24>>24){g=d;break a}}}}while(0);i=(g+24|0)>>2;g=a[i];0==(g|0)&&(g=fa(40),a[i]=g);g>>=2;d=a[g];g=0==(d|0)?Cb(48*a[g+1]+48|0):wb(d,48*a[g+1]+48|0);a[a[i]>>2]=g;d=a[i]+4|0;g=a[d>>2];a[d>>2]=g+1|0;d=a[a[i]>>2];i=d>>2;d=d+48*g|0;a[d>>2]=fa(c<<4);a[i+(12*g|0)+1]=c;a[i+(12*g|0)+3]=0;a[i+(12*g|0)+2]=0;return d}function Wd(c,d,i,g,q){var e,l,k,n,j,p,s,v=h;h+=80;var t;j=v>>2;p=v+4;n=p>>2;var u=v+8;l=u>>2;k=v+16;var w=a[c+16>>2];s=w>>2;var A=a[s+5],B=Au(c,g),C=0==m[c+124|0]<<24>>24;a:do{if(C){var P=c}else{for(var y=c;;){if(y=a[y+128>>2],0==m[y+124|0]<<24>>24){P=y;break a}}}}while(0);0==m[q+8|0]<<24>>24?(a[s+59]|0)!=(a[d+236>>2]|0)?s=d:(s=(C=(a[s+60]|0)>(a[d+240>>2]|0))?w:d,w=C?d:w):s=d;if((w|0)==(a[P+16>>2]|0)){var d=P+92|0,y=P+52|0,D=P+98|0,C=P+58|0}else{d=P+52|0,y=P+92|0,D=P+58|0,C=P+98|0}P=m[D];d=a[d>>2];y=a[y>>2];do{if(0==m[C]<<24>>24){t=2574}else{var D=w+24|0,F=a[D>>2];if(0==(F|0)){t=2574}else{if(0==(a[a[F+4>>2]+12>>2]|0)){t=2574}else{a[l]=w;a[l+1]=y|0;for(var M=g-4|0,F=w+32|0,X=w+40|0,O=0;(O|0)<(M|0);){var E=O+3|0,Da=(E<<4)+i|0,Da=(b[0]=a[Da>>2],b[1]=a[Da+4>>2],f[0])-(b[0]=a[F>>2],b[1]=a[F+4>>2],f[0]),ia=(E<<4)+i+8|0;if(0==J[a[a[a[D>>2]+4>>2]+12>>2]](u,Da,(b[0]=a[ia>>2],b[1]=a[ia+4>>2],f[0])-(b[0]=a[X>>2],b[1]=a[X+4>>2],f[0]))<<24>>24){break}else{O=E}}a[j]=O;jp(u,w,(O<<4)+i|0,1);M=O}}}}while(0);2574==t&&(M=a[j]=0);do{if(0==P<<24>>24){t=2583}else{if(w=s+24|0,C=a[w>>2],0==(C|0)){t=2583}else{if(0==(a[a[C+4>>2]+12>>2]|0)){t=2583}else{a[l]=s;a[l+1]=d|0;e=s+32|0;C=s+40|0;for(y=g-4|0;0<(y|0);){D=(y<<4)+i|0;D=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0])-(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);F=(y<<4)+i+8|0;if(0==J[a[a[a[w>>2]+4>>2]+12>>2]](u,D,(b[0]=a[F>>2],b[1]=a[F+4>>2],f[0])-(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]))<<24>>24){break}y=y-3|0}a[n]=y;jp(u,s,(y<<4)+i|0,0);e=y}}}}while(0);2583==t&&(e=g-4|0,a[n]=e);for(g=g-4|0;;){if((M|0)>=(g|0)){var G=e;break}u=(M<<4)+i|0;l=M+3|0;P=(l<<4)+i|0;u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])-(b[0]=a[P>>2],b[1]=a[P+4>>2],f[0]);M=(M<<4)+i+8|0;P=(l<<4)+i+8|0;M=(b[0]=a[M>>2],b[1]=a[M+4>>2],f[0])-(b[0]=a[P>>2],b[1]=a[P+4>>2],f[0]);if(1e-6<=u*u+M*M){G=e;break}M=a[j]=l}for(;0<(G|0);){g=(G<<4)+i|0;e=G+3|0;l=(e<<4)+i|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);l=(G<<4)+i+8|0;e=(e<<4)+i+8|0;e=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])-(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);if(1e-6<=g*g+e*e){break}G=G-3|0;a[n]=G}QH(c,s,i,v,p,B,q);c=a[j];G=a[n]+4|0;p=(B|0)>>2;j=k>>2;s=k|0;q=(k+16|0)>>2;n=(k+32|0)>>2;k=(k+48|0)>>2;A=A+52|0;for(e=c;;){if((e|0)>=(G|0)){t=2597;break}l=((e-c<<4)+a[p]|0)>>2;g=((e<<4)+i|0)>>2;a[l]=a[g];a[l+1]=a[g+1];a[l+2]=a[g+2];a[l+3]=a[g+3];a[j]=a[g];a[j+1]=a[g+1];a[j+2]=a[g+2];a[j+3]=a[g+3];l=e+1|0;if((l|0)>=(G|0)){t=2596;break}g=((l-c<<4)+a[p]|0)>>2;l=((l<<4)+i|0)>>2;a[g]=a[l];a[g+1]=a[l+1];a[g+2]=a[l+2];a[g+3]=a[l+3];a[q]=a[l];a[q+1]=a[l+1];a[q+2]=a[l+2];a[q+3]=a[l+3];l=e+2|0;g=((l-c<<4)+a[p]|0)>>2;l=((l<<4)+i|0)>>2;a[g]=a[l];a[g+1]=a[l+1];a[g+2]=a[l+2];a[g+3]=a[l+3];a[n]=a[l];a[n+1]=a[l+1];a[n+2]=a[l+2];a[n+3]=a[l+3];g=e+3|0;e=((g<<4)+i|0)>>2;a[k]=a[e];a[k+1]=a[e+1];a[k+2]=a[e+2];a[k+3]=a[e+3];xk(A,s);e=g}2596==t?(a[(B+4|0)>>2]=G-c|0,h=v):2597==t&&(a[(B+4|0)>>2]=G-c|0,h=v)}function QH(b,c,i,g,d,f,e){var k,n,j=h;h+=8;n=j>>2;var p=j+4;k=p>>2;for(var s=b;;){var v=a[s+128>>2];if(0==(v|0)){break}else{s=v}}v=0==m[e+8|0]<<24>>24?J[a[e>>2]](s)&255:0;tk(s,j,p);p=e+4|0;0!=J[a[p>>2]](c)<<24>>24&&(a[k]=0);0!=J[a[p>>2]](a[b+16>>2])<<24>>24&&(a[n]=0);0!=(v|0)&&(b=a[n],a[n]=a[k],a[k]=b);0!=m[e+9|0]<<24>>24?(k=a[k],n=a[n],0!=(k|n|0)&&LC(s,i,a[g>>2],a[d>>2],f,n,k)):(n=a[n],0!=(n|0)&&(a[g>>2]=In(s,i,a[g>>2],a[d>>2],f,n)),k=a[k],0!=(k|0)&&(a[d>>2]=Hn(s,i,a[g>>2],a[d>>2],f,k)));h=j}function bd(c,d){var i,g,q=h;i=d>>2;d=h;h+=32;a[d>>2]=a[i];a[d+4>>2]=a[i+1];a[d+8>>2]=a[i+2];a[d+12>>2]=a[i+3];a[d+16>>2]=a[i+4];a[d+20>>2]=a[i+5];a[d+24>>2]=a[i+6];a[d+28>>2]=a[i+7];i=d|0;g=d+16|0;if((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])){if(i=d+8|0,g=d+24|0,(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])){i=c+80|0,g=a[i>>2],a[i>>2]=g+1|0,g=((g<<5)+a[c+84>>2]|0)>>2,i=d>>2,a[g]=a[i],a[g+1]=a[i+1],a[g+2]=a[i+2],a[g+3]=a[i+3],a[g+4]=a[i+4],a[g+5]=a[i+5],a[g+6]=a[i+6],a[g+7]=a[i+7]}}h=q}function RH(c,d,i,g,q){var e=c|0;f[0]=d+g;a[e>>2]=b[0];a[e+4>>2]=b[1];c=c+8|0;f[0]=i+q;a[c>>2]=b[0];a[c+4>>2]=b[1]}function vl(c,d,i,g,q){var e,l,k,n,j,p,s,v,t,u,w,A,B,C=g>>2,P=h;h+=56;var y,D=P+40,F=d+16|0,M=a[F>>2];B=M>>2;var X=d+28|0;if(0!=m[d+59|0]<<24>>24){wH(P,M,a[d+12>>2],X);for(var O=P>>2,E=X>>2,Da=O+10;O<Da;O++,E++){a[E]=a[O]}}var ia=a[B+6],G=0==(ia|0)?0:a[a[ia+4>>2]+16>>2];A=(M+32|0)>>2;var I=(b[0]=a[A],b[1]=a[A+1],f[0]);w=(M+40|0)>>2;var H=(b[0]=a[w],b[1]=a[w+1],f[0]),K=X|0,L=d+36|0;RH(D,I,H,(b[0]=a[K>>2],b[1]=a[K+4>>2],f[0]),(b[0]=a[L>>2],b[1]=a[L+4>>2],f[0]));u=c>>2;t=D>>2;a[u]=a[t];a[u+1]=a[t+1];a[u+2]=a[t+2];a[u+3]=a[t+3];if(0==q<<24>>24){if(0==m[d+57|0]<<24>>24){m[c+29|0]=0}else{var N=d+44|0,R=(b[0]=a[N>>2],b[1]=a[N+4>>2],f[0]),S=c+16|0;f[0]=R;a[S>>2]=b[0];a[S+4>>2]=b[1];m[c+29|0]=1}}else{var ca=Bu(a[F>>2]),Q=c+16|0;f[0]=ca;a[Q>>2]=b[0];a[Q+4>>2]=b[1];m[c+29|0]=1}a[c+80>>2]=0;a[c+88>>2]=d|0;v=(g+32|0)>>2;a[v]=a[u];a[v+1]=a[u+1];a[v+2]=a[u+2];a[v+3]=a[u+3];var U=1==(i|0);do{if(U){if(0!=m[M+162|0]<<24>>24){var zb=1}else{var ja=m[d+61|0],aa=ja&255;if(0==ja<<24>>24){y=2673}else{var da=g|0,ea=(b[0]=a[da>>2],b[1]=a[da+4>>2],f[0]),xa=g+8|0,W=(b[0]=a[xa>>2],b[1]=a[xa+4>>2],f[0]),V=g+16|0,ha=(b[0]=a[V>>2],b[1]=a[V+4>>2],f[0]),ga=g+24|0,Y=(b[0]=a[ga>>2],b[1]=a[ga+4>>2],f[0]);if(0==(aa&4|0)){if(0!=(aa&1|0)){a[C+12]=1;s=(c+8|0)>>2;var Rb=(b[0]=a[s],b[1]=a[s+1],f[0]),Z=Y>Rb?Y:Rb,tb=g+56|0;f[0]=ea;a[tb>>2]=b[0];a[tb+4>>2]=b[1];var ya=g+64|0;f[0]=W;a[ya>>2]=b[0];a[ya+4>>2]=b[1];var $=g+72|0;f[0]=ha;a[$>>2]=b[0];a[$+4>>2]=b[1];var wa=g+80|0;f[0]=Z;a[wa>>2]=b[0];a[wa+4>>2]=b[1];a[C+13]=1;var la=(b[0]=a[s],b[1]=a[s+1],f[0])-1;f[0]=la;a[s]=b[0];a[s+1]=b[1]}else{var Fa=g+48|0;if(0==(aa&8|0)){a[Fa>>2]=2;p=(c|0)>>2;var Ga=(b[0]=a[p],b[1]=a[p+1],f[0]),fa=(b[0]=a[w],b[1]=a[w+1],f[0]),ta=M+96|0,Ka=(b[0]=a[ta>>2],b[1]=a[ta+4>>2],f[0]),za=fa-((((0>Ka?Ka-.5:Ka+.5)&-1)+1|0)/2&-1|0),ma=c+8|0,pa=(b[0]=a[ma>>2],b[1]=a[ma+4>>2],f[0]),ba=g+56|0;f[0]=Ga;a[ba>>2]=b[0];a[ba+4>>2]=b[1];var Ha=g+64|0;f[0]=za;a[Ha>>2]=b[0];a[Ha+4>>2]=b[1];var Ra=g+72|0;f[0]=ha;a[Ra>>2]=b[0];a[Ra+4>>2]=b[1];var ka=g+80|0;f[0]=pa;a[ka>>2]=b[0];a[ka+4>>2]=b[1];a[C+13]=1;var ra=(b[0]=a[p],b[1]=a[p+1],f[0])+1;f[0]=ra;a[p]=b[0];a[p+1]=b[1]}else{a[Fa>>2]=8;j=(c|0)>>2;var La=(b[0]=a[j],b[1]=a[j+1],f[0]),qa=(b[0]=a[w],b[1]=a[w+1],f[0]),Ya=M+96|0,na=(b[0]=a[Ya>>2],b[1]=a[Ya+4>>2],f[0]),Za=qa-((((0>na?na-.5:na+.5)&-1)+1|0)/2&-1|0),oa=c+8|0,ab=(b[0]=a[oa>>2],b[1]=a[oa+4>>2],f[0]),$a=g+56|0;f[0]=ea;a[$a>>2]=b[0];a[$a+4>>2]=b[1];var jb=g+64|0;f[0]=Za;a[jb>>2]=b[0];a[jb+4>>2]=b[1];var Ca=g+72|0;f[0]=La;a[Ca>>2]=b[0];a[Ca+4>>2]=b[1];var Ia=g+80|0;f[0]=ab;a[Ia>>2]=b[0];a[Ia+4>>2]=b[1];a[C+13]=1;var eb=(b[0]=a[j],b[1]=a[j+1],f[0])-1;f[0]=eb;a[j]=b[0];a[j+1]=b[1]}}}else{a[C+12]=4;var ub=c|0,Sa=(b[0]=a[ub>>2],b[1]=a[ub+4>>2],f[0]),Ba=(b[0]=a[A],b[1]=a[A+1],f[0]);if(Sa<Ba){var ua=ea-1,Oa=c+8|0,Wa=(b[0]=a[Oa>>2],b[1]=a[Oa+4>>2],f[0]),pb=(b[0]=a[w],b[1]=a[w+1],f[0]),ob=M+96|0,bb=(b[0]=a[ob>>2],b[1]=a[ob+4>>2],f[0]),qb=0>bb,va=pb+((((qb?bb-.5:bb+.5)&-1)+1|0)/2&-1|0)+((a[a[B+5]+260>>2]|0)/2&-1|0),kb=M+104|0,Aa=Ba-(b[0]=a[kb>>2],b[1]=a[kb+4>>2],f[0]),vb=pb-((((qb?bb-.5:bb+.5)&-1)+1|0)/2&-1|0),xb=g+56|0;f[0]=ua;a[xb>>2]=b[0];a[xb+4>>2]=b[1];var hd=g+64|0;f[0]=Wa;a[hd>>2]=b[0];a[hd+4>>2]=b[1];var nb=g+72|0;f[0]=ha;a[nb>>2]=b[0];a[nb+4>>2]=b[1];var rb=g+80|0;f[0]=va;a[rb>>2]=b[0];a[rb+4>>2]=b[1];var lb=g+88|0;f[0]=ua;a[lb>>2]=b[0];a[lb+4>>2]=b[1];var Ta=g+96|0;f[0]=vb;a[Ta>>2]=b[0];a[Ta+4>>2]=b[1];var cb=g+104|0;f[0]=Aa;a[cb>>2]=b[0];a[cb+4>>2]=b[1];var fb=g+112|0;f[0]=Wa;a[fb>>2]=b[0];a[fb+4>>2]=b[1]}else{var Ua=c+8|0,sb=(b[0]=a[Ua>>2],b[1]=a[Ua+4>>2],f[0]),Na=ha+1,Fb=(b[0]=a[w],b[1]=a[w+1],f[0]),Db=M+96|0,Ob=(b[0]=a[Db>>2],b[1]=a[Db+4>>2],f[0]),Eb=0>Ob,Ea=Fb+((((Eb?Ob-.5:Ob+.5)&-1)+1|0)/2&-1|0)+((a[a[B+5]+260>>2]|0)/2&-1|0),Bb=M+112|0,Ja=Ba+(b[0]=a[Bb>>2],b[1]=a[Bb+4>>2],f[0]),Ma=Fb-((((Eb?Ob-.5:Ob+.5)&-1)+1|0)/2&-1|0),Qa=g+56|0;f[0]=ea;a[Qa>>2]=b[0];a[Qa+4>>2]=b[1];var wb=g+64|0;f[0]=sb;a[wb>>2]=b[0];a[wb+4>>2]=b[1];var Cb=g+72|0;f[0]=Na;a[Cb>>2]=b[0];a[Cb+4>>2]=b[1];var Va=g+80|0;f[0]=Ea;a[Va>>2]=b[0];a[Va+4>>2]=b[1];var Pa=g+88|0;f[0]=Ja;a[Pa>>2]=b[0];a[Pa+4>>2]=b[1];var ic=g+96|0;f[0]=Ma;a[ic>>2]=b[0];a[ic+4>>2]=b[1];var hb=g+104|0;f[0]=Na;a[hb>>2]=b[0];a[hb+4>>2]=b[1];var ib=g+112|0;f[0]=sb;a[ib>>2]=b[0];a[ib+4>>2]=b[1]}n=(c+8|0)>>2;var yb=(b[0]=a[n],b[1]=a[n+1],f[0])+1;f[0]=yb;a[n]=b[0];a[n+1]=b[1];a[C+13]=2}var Gb=0==m[d+124|0]<<24>>24;a:do{if(Gb){var db=d}else{for(var pc=d;;){var Wc=a[pc+128>>2];if(0==m[Wc+124|0]<<24>>24){db=Wc;break a}else{pc=Wc}}}}while(0);(M|0)==(a[db+16>>2]|0)?m[db+58|0]=0:m[db+98|0]=0;h=P;return}}}else{y=2673}}while(0);do{if(2673==y){do{if(2==(i|0)){var Vb=m[d+61|0],Ib=Vb&255;if(0!=Vb<<24>>24){var Nb=g|0,mb=(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0]),Jb=g+8|0,Hb=(b[0]=a[Jb>>2],b[1]=a[Jb+4>>2],f[0]),Lb=g+16|0,lc=(b[0]=a[Lb>>2],b[1]=a[Lb+4>>2],f[0]),Kb=g+24|0,Jd=(b[0]=a[Kb>>2],b[1]=a[Kb+4>>2],f[0]);if(0==(Ib&4|0)){if(0!=(Ib&1|0)){if(4!=(a[C+12]|0)){var Pb=c+8|0,Hc=(b[0]=a[Pb>>2],b[1]=a[Pb+4>>2],f[0]),Wb=Jd>Hc?Jd:Hc,oe=g+56|0;f[0]=mb;a[oe>>2]=b[0];a[oe+4>>2]=b[1];var Tb=g+64|0;f[0]=Hb;a[Tb>>2]=b[0];a[Tb+4>>2]=b[1];var Qb=g+72|0;f[0]=lc;a[Qb>>2]=b[0];a[Qb+4>>2]=b[1];var tc=g+80|0;f[0]=Wb;a[tc>>2]=b[0];a[tc+4>>2]=b[1];a[C+13]=1}else{var Sc=(b[0]=a[w],b[1]=a[w+1],f[0]),Yb=M+96|0,Mb=(b[0]=a[Yb>>2],b[1]=a[Yb+4>>2],f[0]),$b=0>Mb,rd=Sc-(((($b?Mb-.5:Mb+.5)&-1)+1|0)/2&-1|0),oc=lc+1,Zb=c|0,qc=(b[0]=a[Zb>>2],b[1]=a[Zb+4>>2],f[0]),ve=rd-((a[a[B+5]+260>>2]|0)/2&-1|0),Rd=M+112|0,Bc=(b[0]=a[A],b[1]=a[A+1],f[0])+(b[0]=a[Rd>>2],b[1]=a[Rd+4>>2],f[0]),Sd=Sc+(((($b?Mb-.5:Mb+.5)&-1)+1|0)/2&-1|0),fd=g+56|0;f[0]=qc;a[fd>>2]=b[0];a[fd+4>>2]=b[1];var Sb=g+64|0;f[0]=ve;a[Sb>>2]=b[0];a[Sb+4>>2]=b[1];var yc=g+72|0;f[0]=oc;a[yc>>2]=b[0];a[yc+4>>2]=b[1];var uc=g+80|0;f[0]=rd;a[uc>>2]=b[0];a[uc+4>>2]=b[1];var nc=g+88|0;f[0]=Bc;a[nc>>2]=b[0];a[nc+4>>2]=b[1];var Tc=g+96|0;f[0]=rd;a[Tc>>2]=b[0];a[Tc+4>>2]=b[1];var kc=g+104|0;f[0]=oc;a[kc>>2]=b[0];a[kc+4>>2]=b[1];var Mc=g+112|0;f[0]=Sd;a[Mc>>2]=b[0];a[Mc+4>>2]=b[1];a[C+13]=2}}else{var id=c|0,ec=(b[0]=a[id>>2],b[1]=a[id+4>>2],f[0]);if(0==(Ib&8|0)){var mc=4==(a[C+12]|0),fc=(b[0]=a[w],b[1]=a[w+1],f[0]),bc=M+96|0,ac=(b[0]=a[bc>>2],b[1]=a[bc+4>>2],f[0]),rc=0<=ac;if(mc){var jc=c+8|0,Ac=fc+((((rc?ac+.5:ac-.5)&-1)+1|0)/2&-1|0),Td=(b[0]=a[jc>>2],b[1]=a[jc+4>>2],f[0])}else{var gc=rc?ac+.5:ac-.5,dc=c+8|0,Ac=(b[0]=a[dc>>2],b[1]=a[dc+4>>2],f[0])+1,Td=fc-(((gc&-1)+1|0)/2&-1|0)}var fe=g+56|0;f[0]=ec;a[fe>>2]=b[0];a[fe+4>>2]=b[1];var Xb=g+64|0;f[0]=Td;a[Xb>>2]=b[0];a[Xb+4>>2]=b[1];var Cc=g+72|0;f[0]=lc;a[Cc>>2]=b[0];a[Cc+4>>2]=b[1];var jd=g+80|0;f[0]=Ac;a[jd>>2]=b[0];a[jd+4>>2]=b[1]}else{var md=ec+1,je=4==(a[C+12]|0),Qe=(b[0]=a[w],b[1]=a[w+1],f[0]),Ic=M+96|0,Uc=(b[0]=a[Ic>>2],b[1]=a[Ic+4>>2],f[0]),vc=0<=Uc;if(je){var Dc=c+8|0,Ec=Qe+((((vc?Uc+.5:Uc-.5)&-1)+1|0)/2&-1|0),Gc=(b[0]=a[Dc>>2],b[1]=a[Dc+4>>2],f[0])-1}else{var Kc=vc?Uc+.5:Uc-.5,kd=c+8|0,Ec=(b[0]=a[kd>>2],b[1]=a[kd+4>>2],f[0])+1,Gc=Qe-(((Kc&-1)+1|0)/2&-1|0)}var Nc=g+56|0;f[0]=mb;a[Nc>>2]=b[0];a[Nc+4>>2]=b[1];var zc=g+64|0;f[0]=Gc;a[zc>>2]=b[0];a[zc+4>>2]=b[1];var Fc=g+72|0;f[0]=md;a[Fc>>2]=b[0];a[Fc+4>>2]=b[1];var Qc=g+80|0;f[0]=Ec;a[Qc>>2]=b[0];a[Qc+4>>2]=b[1]}a[C+13]=1}}else{var Yc=c+8|0,nd=(b[0]=a[Yc>>2],b[1]=a[Yc+4>>2],f[0]),zd=Hb<nd?Hb:nd,cf=g+56|0;f[0]=mb;a[cf>>2]=b[0];a[cf+4>>2]=b[1];var Zc=g+64|0;f[0]=zd;a[Zc>>2]=b[0];a[Zc+4>>2]=b[1];var Rc=g+72|0;f[0]=lc;a[Rc>>2]=b[0];a[Rc+4>>2]=b[1];var Lc=g+80|0;f[0]=Jd;a[Lc>>2]=b[0];a[Lc+4>>2]=b[1];a[C+13]=1}var $c=0==m[d+124|0]<<24>>24;a:do{if($c){var pe=d}else{for(var Oc=d;;){var Kd=a[Oc+128>>2];if(0==m[Kd+124|0]<<24>>24){pe=Kd;break a}else{Oc=Kd}}}}while(0);(M|0)==(a[pe+16>>2]|0)?m[pe+58|0]=0:m[pe+98|0]=0;a[C+12]=Ib;h=P;return}}}while(0);zb=U?1:a[C+12]}}while(0);var Dd=g+56|0,Pc=g+52|0;if(0!=(G|0)){var Jc=J[G](M,X,zb,Dd,Pc);if(0!=(Jc|0)){a[C+12]=Jc;h=P;return}}k=Dd>>2;l=g>>2;a[k]=a[l];a[k+1]=a[l+1];a[k+2]=a[l+2];a[k+3]=a[l+3];a[k+4]=a[l+4];a[k+5]=a[l+5];a[k+6]=a[l+6];a[k+7]=a[l+7];a[Pc>>2]=1;if(2==(i|0)){var ld=4==(a[C+12]|0),Ad=c+8|0,Ud=(b[0]=a[Ad>>2],b[1]=a[Ad+4>>2],f[0]);if(ld){var Vd=g+64|0;f[0]=Ud;a[Vd>>2]=b[0];a[Vd+4>>2]=b[1]}else{var ad=g+80|0;f[0]=Ud;a[ad>>2]=b[0];a[ad+4>>2]=b[1]}}else{if(1==(i|0)){e=(c+8|0)>>2;var bd=(b[0]=a[e],b[1]=a[e+1],f[0]),gd=g+80|0;f[0]=bd;a[gd>>2]=b[0];a[gd+4>>2]=b[1];a[C+12]=1;var ud=(b[0]=a[e],b[1]=a[e+1],f[0])-1;f[0]=ud;a[e]=b[0];a[e+1]=b[1]}else{if(8==(i|0)){sa(wl|0,565,SH|0,vd|0);var Xc=c+8|0,Vc=(b[0]=a[Xc>>2],b[1]=a[Xc+4>>2],f[0])-1,cd=g+80|0;f[0]=Vc;a[cd>>2]=b[0];a[cd+4>>2]=b[1];a[C+12]=1}}}h=P}function Bu(c){var d,i=a[c+176>>2],g=a[i>>2];if(0==(g|0)){var q=0,e=0}else{for(var e=q=0,l=g;;){var k=a[l+16>>2]+32|0,k=e+(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),h=q+1|0,l=a[i+(h<<2)>>2];if(0==(l|0)){break}else{q=h,e=k}}q=h|0;e=k}var i=c+184|0,k=a[i>>2],j=a[k>>2];if(0==(j|0)){var p=0,k=0}else{for(l=h=0;!(d=a[j+12>>2]+32|0,d=l+(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),p=h+1|0,j=a[k+(p<<2)>>2],0==(j|0));){h=p,l=d}p|=0;k=d}d=(c+32|0)>>2;q=(b[0]=a[d],b[1]=a[d+1],f[0])-e/q;c=(c+40|0)>>2;g=a[g+16>>2]+40|0;g=Cf((b[0]=a[c],b[1]=a[c+1],f[0])-(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),q);d=k/p-(b[0]=a[d],b[1]=a[d+1],f[0]);i=a[a[a[i>>2]>>2]+12>>2]+40|0;return.5*(g+Cf((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])-(b[0]=a[c],b[1]=a[c+1],f[0]),d))}function HQa(c){var d,i=a[c+108>>2];0==m[c+56|0]<<24>>24?0!=m[c+96|0]<<24>>24&&(d=2744):d=2744;if(2744==d){d=m[c+61|0];var g=d&255;if(0!=(g&8|0)){return 0}var q=m[c+101|0];if(0!=(q&8)<<24>>24||d<<24>>24==q<<24>>24&&0!=(g&5|0)){return 0}}if(0==(i|0)){return 18}c=0==(a[a[a[c+12>>2]+20>>2]+152>>2]&1|0)?i+24|0:i+32|0;return c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])+18&-1}function xl(c,d,i,g,q){var e,l,k,n,j,p,s,v,t,u,w,A,B,C=g>>2,P=h;h+=56;var y,D=P+40,F=d+12|0,M=a[F>>2];B=M>>2;var X=d+68|0;if(0!=m[d+99|0]<<24>>24){wH(P,M,a[d+16>>2],X);for(var O=P>>2,E=X>>2,Da=O+10;O<Da;O++,E++){a[E]=a[O]}}var ia=a[B+6],G=0==(ia|0)?0:a[a[ia+4>>2]+16>>2],I=c+40|0;A=(M+32|0)>>2;var H=(b[0]=a[A],b[1]=a[A+1],f[0]);w=(M+40|0)>>2;var K=(b[0]=a[w],b[1]=a[w+1],f[0]),L=X|0,N=d+76|0;RH(D,H,K,(b[0]=a[L>>2],b[1]=a[L+4>>2],f[0]),(b[0]=a[N>>2],b[1]=a[N+4>>2],f[0]));u=I>>2;t=D>>2;a[u]=a[t];a[u+1]=a[t+1];a[u+2]=a[t+2];a[u+3]=a[t+3];if(0==q<<24>>24){if(0==m[d+97|0]<<24>>24){m[c+69|0]=0}else{var R=d+84|0,S=(b[0]=a[R>>2],b[1]=a[R+4>>2],f[0]),ca=c+56|0;f[0]=S;a[ca>>2]=b[0];a[ca+4>>2]=b[1];m[c+69|0]=1}}else{var Q=Bu(a[F>>2])+3.141592653589793,U=c+56|0;f[0]=Q;a[U>>2]=b[0];a[U+4>>2]=b[1];6.283185307179586>Q||sa(wl|0,602,Cu|0,TH|0);m[c+69|0]=1}v=(g+32|0)>>2;a[v]=a[u];a[v+1]=a[u+1];a[v+2]=a[u+2];a[v+3]=a[u+3];var zb=1==(i|0);do{if(zb){if(0!=m[M+162|0]<<24>>24){var ja=4}else{var aa=m[d+101|0],da=aa&255;if(0==aa<<24>>24){y=2804}else{var ea=g|0,xa=(b[0]=a[ea>>2],b[1]=a[ea+4>>2],f[0]),W=g+8|0,V=(b[0]=a[W>>2],b[1]=a[W+4>>2],f[0]),ha=g+16|0,ga=(b[0]=a[ha>>2],b[1]=a[ha+4>>2],f[0]);if(0==(da&4|0)){if(0==(da&1|0)){var Y=g+48|0;if(0==(da&8|0)){a[Y>>2]=2;s=(I|0)>>2;var Rb=(b[0]=a[s],b[1]=a[s+1],f[0]),$=(b[0]=a[w],b[1]=a[w+1],f[0]),tb=M+96|0,ya=(b[0]=a[tb>>2],b[1]=a[tb+4>>2],f[0]),Z=$+((((0>ya?ya-.5:ya+.5)&-1)+1|0)/2&-1|0),wa=c+48|0,la=(b[0]=a[wa>>2],b[1]=a[wa+4>>2],f[0]),Fa=g+56|0;f[0]=Rb;a[Fa>>2]=b[0];a[Fa+4>>2]=b[1];var Ga=g+64|0;f[0]=la;a[Ga>>2]=b[0];a[Ga+4>>2]=b[1];var fa=g+72|0;f[0]=ga;a[fa>>2]=b[0];a[fa+4>>2]=b[1];var ta=g+80|0;f[0]=Z;a[ta>>2]=b[0];a[ta+4>>2]=b[1];a[C+13]=1;var Ka=(b[0]=a[s],b[1]=a[s+1],f[0])+1;f[0]=Ka;a[s]=b[0];a[s+1]=b[1]}else{a[Y>>2]=8;p=(I|0)>>2;var za=(b[0]=a[p],b[1]=a[p+1],f[0]),ma=(b[0]=a[w],b[1]=a[w+1],f[0]),pa=M+96|0,ba=(b[0]=a[pa>>2],b[1]=a[pa+4>>2],f[0]),Ha=ma+((((0>ba?ba-.5:ba+.5)&-1)+1|0)/2&-1|0),Ra=c+48|0,ka=(b[0]=a[Ra>>2],b[1]=a[Ra+4>>2],f[0]),ra=g+56|0;f[0]=xa;a[ra>>2]=b[0];a[ra+4>>2]=b[1];var La=g+64|0;f[0]=ka;a[La>>2]=b[0];a[La+4>>2]=b[1];var qa=g+72|0;f[0]=za;a[qa>>2]=b[0];a[qa+4>>2]=b[1];var Ya=g+80|0;f[0]=Ha;a[Ya>>2]=b[0];a[Ya+4>>2]=b[1];a[C+13]=1;var na=(b[0]=a[p],b[1]=a[p+1],f[0])-1;f[0]=na;a[p]=b[0];a[p+1]=b[1]}}else{a[C+12]=1;var Za=I|0,oa=(b[0]=a[Za>>2],b[1]=a[Za+4>>2],f[0]),ab=(b[0]=a[A],b[1]=a[A+1],f[0]);if(oa<ab){var $a=xa-1,jb=c+48|0,Ca=(b[0]=a[jb>>2],b[1]=a[jb+4>>2],f[0]),Ia=(b[0]=a[w],b[1]=a[w+1],f[0]),eb=M+96|0,ub=(b[0]=a[eb>>2],b[1]=a[eb+4>>2],f[0]),Sa=0>ub,Ba=Ia-((((Sa?ub-.5:ub+.5)&-1)+1|0)/2&-1|0)-((a[a[B+5]+260>>2]|0)/2&-1|0),ua=M+104|0,Oa=ab-(b[0]=a[ua>>2],b[1]=a[ua+4>>2],f[0]),Wa=Ia+((((Sa?ub-.5:ub+.5)&-1)+1|0)/2&-1|0),pb=g+56|0;f[0]=$a;a[pb>>2]=b[0];a[pb+4>>2]=b[1];var ob=g+64|0;f[0]=Ba;a[ob>>2]=b[0];a[ob+4>>2]=b[1];var bb=g+72|0;f[0]=ga;a[bb>>2]=b[0];a[bb+4>>2]=b[1];var qb=g+80|0;f[0]=Ca;a[qb>>2]=b[0];a[qb+4>>2]=b[1];var va=g+88|0;f[0]=$a;a[va>>2]=b[0];a[va+4>>2]=b[1];var kb=g+96|0;f[0]=Ca;a[kb>>2]=b[0];a[kb+4>>2]=b[1];var Aa=g+104|0;f[0]=Oa;a[Aa>>2]=b[0];a[Aa+4>>2]=b[1];var vb=g+112|0;f[0]=Wa;a[vb>>2]=b[0];a[vb+4>>2]=b[1]}else{var xb=c+48|0,hd=(b[0]=a[xb>>2],b[1]=a[xb+4>>2],f[0]),nb=ga+1,rb=(b[0]=a[w],b[1]=a[w+1],f[0]),lb=M+96|0,Ta=(b[0]=a[lb>>2],b[1]=a[lb+4>>2],f[0]),cb=0>Ta,fb=rb-((((cb?Ta-.5:Ta+.5)&-1)+1|0)/2&-1|0)-((a[a[B+5]+260>>2]|0)/2&-1|0),Ua=M+112|0,sb=ab+(b[0]=a[Ua>>2],b[1]=a[Ua+4>>2],f[0]),Na=rb+((((cb?Ta-.5:Ta+.5)&-1)+1|0)/2&-1|0),Fb=g+56|0;f[0]=xa;a[Fb>>2]=b[0];a[Fb+4>>2]=b[1];var Db=g+64|0;f[0]=fb;a[Db>>2]=b[0];a[Db+4>>2]=b[1];var Ob=g+72|0;f[0]=nb;a[Ob>>2]=b[0];a[Ob+4>>2]=b[1];var Eb=g+80|0;f[0]=hd;a[Eb>>2]=b[0];a[Eb+4>>2]=b[1];var Ea=g+88|0;f[0]=sb;a[Ea>>2]=b[0];a[Ea+4>>2]=b[1];var Bb=g+96|0;f[0]=hd;a[Bb>>2]=b[0];a[Bb+4>>2]=b[1];var Ja=g+104|0;f[0]=nb;a[Ja>>2]=b[0];a[Ja+4>>2]=b[1];var Ma=g+112|0;f[0]=Na;a[Ma>>2]=b[0];a[Ma+4>>2]=b[1]}a[C+13]=2;j=(c+48|0)>>2;var Qa=(b[0]=a[j],b[1]=a[j+1],f[0])-1;f[0]=Qa;a[j]=b[0];a[j+1]=b[1]}}else{var wb=g+24|0,Cb=(b[0]=a[wb>>2],b[1]=a[wb+4>>2],f[0]);a[C+12]=4;n=(c+48|0)>>2;var Va=(b[0]=a[n],b[1]=a[n+1],f[0]),Pa=V<Va?V:Va,ic=g+56|0;f[0]=xa;a[ic>>2]=b[0];a[ic+4>>2]=b[1];var hb=g+64|0;f[0]=Pa;a[hb>>2]=b[0];a[hb+4>>2]=b[1];var ib=g+72|0;f[0]=ga;a[ib>>2]=b[0];a[ib+4>>2]=b[1];var db=g+80|0;f[0]=Cb;a[db>>2]=b[0];a[db+4>>2]=b[1];a[C+13]=1;var yb=(b[0]=a[n],b[1]=a[n+1],f[0])+1;f[0]=yb;a[n]=b[0];a[n+1]=b[1]}var Gb=0==m[d+124|0]<<24>>24;a:do{if(Gb){var pc=d}else{for(var Ib=d;;){var Vb=a[Ib+128>>2];if(0==m[Vb+124|0]<<24>>24){pc=Vb;break a}else{Ib=Vb}}}}while(0);(M|0)==(a[pc+12>>2]|0)?m[pc+98|0]=0:m[pc+58|0]=0;a[C+12]=da;h=P;return}}}else{y=2804}}while(0);do{if(2804==y){do{if(2==(i|0)){var Nb=m[d+101|0],mb=Nb&255;if(0!=Nb<<24>>24){var Hb=g|0,Jb=(b[0]=a[Hb>>2],b[1]=a[Hb+4>>2],f[0]),Lb=g+8|0,Kb=(b[0]=a[Lb>>2],b[1]=a[Lb+4>>2],f[0]),lc=g+16|0,Mb=(b[0]=a[lc>>2],b[1]=a[lc+4>>2],f[0]),Jd=g+24|0,Pb=(b[0]=a[Jd>>2],b[1]=a[Jd+4>>2],f[0]);if(0==(mb&4|0)){if(0!=(mb&1|0)){if(4!=(a[C+12]|0)){var Hc=c+8|0,Tb=(b[0]=a[Hc>>2],b[1]=a[Hc+4>>2],f[0]),Yb=Pb>Tb?Pb:Tb,Wb=g+56|0;f[0]=Jb;a[Wb>>2]=b[0];a[Wb+4>>2]=b[1];var Qb=g+64|0;f[0]=Kb;a[Qb>>2]=b[0];a[Qb+4>>2]=b[1];var tc=g+72|0;f[0]=Mb;a[tc>>2]=b[0];a[tc+4>>2]=b[1];var Sc=g+80|0;f[0]=Yb;a[Sc>>2]=b[0];a[Sc+4>>2]=b[1];a[C+13]=1}else{var $b=Jb-1,Zb=(b[0]=a[w],b[1]=a[w+1],f[0]),qc=M+96|0,rd=(b[0]=a[qc>>2],b[1]=a[qc+4>>2],f[0]),oc=0>rd,Sb=Zb-((((oc?rd-.5:rd+.5)&-1)+1|0)/2&-1|0),uc=I|0,ac=(b[0]=a[uc>>2],b[1]=a[uc+4>>2],f[0]),nc=Sb-((a[a[B+5]+260>>2]|0)/2&-1|0),Bc=M+104|0,Sd=(b[0]=a[A],b[1]=a[A+1],f[0])-(b[0]=a[Bc>>2],b[1]=a[Bc+4>>2],f[0])-2,fd=Zb+((((oc?rd-.5:rd+.5)&-1)+1|0)/2&-1|0),kc=g+56|0;f[0]=$b;a[kc>>2]=b[0];a[kc+4>>2]=b[1];var yc=g+64|0;f[0]=nc;a[yc>>2]=b[0];a[yc+4>>2]=b[1];var ec=g+72|0;f[0]=ac;a[ec>>2]=b[0];a[ec+4>>2]=b[1];var fc=g+80|0;f[0]=Sb;a[fc>>2]=b[0];a[fc+4>>2]=b[1];var Tc=g+88|0;f[0]=$b;a[Tc>>2]=b[0];a[Tc+4>>2]=b[1];var mc=g+96|0;f[0]=Sb;a[mc>>2]=b[0];a[mc+4>>2]=b[1];var Mc=g+104|0;f[0]=Sd;a[Mc>>2]=b[0];a[Mc+4>>2]=b[1];var id=g+112|0;f[0]=fd;a[id>>2]=b[0];a[id+4>>2]=b[1];a[C+13]=2}}else{var bc=I|0,rc=(b[0]=a[bc>>2],b[1]=a[bc+4>>2],f[0]);if(0==(mb&8|0)){var jc=rc-1,Ac=4==(a[C+12]|0),dc=(b[0]=a[w],b[1]=a[w+1],f[0]),gc=M+96|0,Xb=(b[0]=a[gc>>2],b[1]=a[gc+4>>2],f[0]),Cc=0<=Xb;if(Ac){var Td=c+48|0,Ic=dc+((((Cc?Xb+.5:Xb-.5)&-1)+1|0)/2&-1|0),vc=(b[0]=a[Td>>2],b[1]=a[Td+4>>2],f[0])-1}else{var fe=Cc?Xb+.5:Xb-.5,Dc=c+48|0,Ic=(b[0]=a[Dc>>2],b[1]=a[Dc+4>>2],f[0]),vc=dc-(((fe&-1)+1|0)/2&-1|0)}var Ec=g+56|0;f[0]=jc;a[Ec>>2]=b[0];a[Ec+4>>2]=b[1];var jd=g+64|0;f[0]=vc;a[jd>>2]=b[0];a[jd+4>>2]=b[1];var md=g+72|0;f[0]=Mb;a[md>>2]=b[0];a[md+4>>2]=b[1];var je=g+80|0;f[0]=Ic;a[je>>2]=b[0];a[je+4>>2]=b[1]}else{var Gc=rc+1,Nc=4==(a[C+12]|0),Uc=(b[0]=a[w],b[1]=a[w+1],f[0]),zc=M+96|0,Kc=(b[0]=a[zc>>2],b[1]=a[zc+4>>2],f[0]),Fc=0<=Kc;if(Nc){var Qc=c+48|0,Yc=Uc+((((Fc?Kc+.5:Kc-.5)&-1)+1|0)/2&-1|0),kd=(b[0]=a[Qc>>2],b[1]=a[Qc+4>>2],f[0])-1}else{var Zc=Fc?Kc+.5:Kc-.5,Rc=c+48|0,Yc=(b[0]=a[Rc>>2],b[1]=a[Rc+4>>2],f[0])+1,kd=Uc-(((Zc&-1)+1|0)/2&-1|0)}var Lc=g+56|0;f[0]=Jb;a[Lc>>2]=b[0];a[Lc+4>>2]=b[1];var Oc=g+64|0;f[0]=kd;a[Oc>>2]=b[0];a[Oc+4>>2]=b[1];var Pc=g+72|0;f[0]=Gc;a[Pc>>2]=b[0];a[Pc+4>>2]=b[1];var nd=g+80|0;f[0]=Yc;a[nd>>2]=b[0];a[nd+4>>2]=b[1]}a[C+13]=1}}else{var zd=c+48|0,Jc=(b[0]=a[zd>>2],b[1]=a[zd+4>>2],f[0]),$c=Kb<Jc?Kb:Jc,ad=g+56|0;f[0]=Jb;a[ad>>2]=b[0];a[ad+4>>2]=b[1];var Xc=g+64|0;f[0]=$c;a[Xc>>2]=b[0];a[Xc+4>>2]=b[1];var cd=g+72|0;f[0]=Mb;a[cd>>2]=b[0];a[cd+4>>2]=b[1];var ld=g+80|0;f[0]=Pb;a[ld>>2]=b[0];a[ld+4>>2]=b[1];a[C+13]=1}var bd=0==m[d+124|0]<<24>>24;a:do{if(bd){var Kd=d}else{for(var Dd=d;;){var Vc=a[Dd+128>>2];if(0==m[Vc+124|0]<<24>>24){Kd=Vc;break a}else{Dd=Vc}}}}while(0);(M|0)==(a[Kd+12>>2]|0)?m[Kd+98|0]=0:m[Kd+58|0]=0;a[C+12]=mb;h=P;return}}}while(0);ja=zb?4:a[C+12]}}while(0);var ed=g+56|0,qd=g+52|0;if(0!=(G|0)){var Ad=J[G](M,X,ja,ed,qd);if(0!=(Ad|0)){a[C+12]=Ad;h=P;return}}k=ed>>2;l=g>>2;a[k]=a[l];a[k+1]=a[l+1];a[k+2]=a[l+2];a[k+3]=a[l+3];a[k+4]=a[l+4];a[k+5]=a[l+5];a[k+6]=a[l+6];a[k+7]=a[l+7];a[qd>>2]=1;if(1==(i|0)){e=(c+48|0)>>2;var Ud=(b[0]=a[e],b[1]=a[e+1],f[0]),Vd=g+64|0;f[0]=Ud;a[Vd>>2]=b[0];a[Vd+4>>2]=b[1];a[C+12]=4;var yd=(b[0]=a[e],b[1]=a[e+1],f[0])+1;f[0]=yd;a[e]=b[0];a[e+1]=b[1]}else{if(8==(i|0)){sa(wl|0,757,Cu|0,vd|0);var pd=c+48|0,gd=(b[0]=a[pd>>2],b[1]=a[pd+4>>2],f[0])+1,ud=g+64|0;f[0]=gd;a[ud>>2]=b[0];a[ud+4>>2]=b[1];a[C+12]=4}else{if(2==(i|0)){var Fd=4==(a[C+12]|0),dd=c+48|0,od=(b[0]=a[dd>>2],b[1]=a[dd+4>>2],f[0]);if(Fd){var sd=g+64|0;f[0]=od;a[sd>>2]=b[0];a[sd+4>>2]=b[1]}else{var Bd=g+80|0;f[0]=od;a[Bd>>2]=b[0];a[Bd+4>>2]=b[1]}}}}h=P}function UH(b,c,i,g,d,f,e){var k,b=a[c+(i<<2)>>2];0==m[b+56|0]<<24>>24?0!=m[b+96|0]<<24>>24&&(k=2867):k=2867;a:do{if(2867==k){k=m[b+61|0];var h=k&255;do{if(0==(h&8|0)){var j=m[b+101|0],p=0==(j&8)<<24>>24;if(p){if(k<<24>>24!=j<<24>>24){break a}if(0==(h&5|0)){break a}if(p){if(0!=(h&4|0)){Du(c,i,g,d,f,e);return}0==(h&1|0)?sa(wl|0,1114,VH|0,vd|0):WH(c,i,g,d,f,e);return}}}}while(0);if(0==(k&2)<<24>>24&&0==(m[b+101|0]&2)<<24>>24){XH(c,i,g,d,f,e);return}Du(c,i,g,d,f,e);return}}while(0);YH(c,i,g,d,f,e)}function YH(c,d,i,g,q,e){var l,k,n,j,p,s,v,t,u,w,A,B,C=h;h+=16080;var P=C+16e3,y=C+16016,D=C+16032,F=C+16048,M=C+16064,X=a[c+(d<<2)>>2];k=a[X+16>>2];var q=.5*q/(i|0),O=2<q?q:2;B=(k+32|0)>>2;var E=(b[0]=a[B],b[1]=a[B+1],f[0]),q=(k+40|0)>>2,Da=(b[0]=a[q],b[1]=a[q+1],f[0]),ia=X+28|0,G=X+36|0,ia=(b[0]=a[ia>>2],b[1]=a[ia+4>>2],f[0])+E,G=(b[0]=a[G>>2],b[1]=a[G+4>>2],f[0])+Da,J=X+68|0;n=X+76|0;J=(b[0]=a[J>>2],b[1]=a[J+4>>2],f[0])+E;Da=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])+Da;k=k+112|0;var I=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);k=E+I;var H=3*(k-ia),K=3*(k-J);if(0<(i|0)){var L=(G<Da?-1:1)*O,N=C|0,R=C+8|0;A=(C+16|0)>>2;w=P>>2;u=(C+32|0)>>2;t=y>>2;var ca=.5*(G+Da);v=(C+48|0)>>2;s=D>>2;p=(C+64|0)>>2;j=F>>2;n=(C+80|0)>>2;k=M>>2;var Q=C+96|0,S=C+104|0,U=C|0,i=i+d|0,ja=I,H=I<H?I:H,I=I<K?I:K,K=0;for(l=d;;){d=l+1|0;ja+=g;H+=g;I+=g;K+=L;f[0]=ia;a[N>>2]=b[0];a[N+4>>2]=b[1];f[0]=G;a[R>>2]=b[0];a[R+4>>2]=b[1];var aa=G+K;Pc(P,ia+H/3,aa);a[A]=a[w];a[A+1]=a[w+1];a[A+2]=a[w+2];a[A+3]=a[w+3];l=E+ja;Pc(y,l,aa);a[u]=a[t];a[u+1]=a[t+1];a[u+2]=a[t+2];a[u+3]=a[t+3];Pc(D,l,ca);a[v]=a[s];a[v+1]=a[s+1];a[v+2]=a[s+2];a[v+3]=a[s+3];aa=Da-K;Pc(F,l,aa);a[p]=a[j];a[p+1]=a[j+1];a[p+2]=a[j+2];a[p+3]=a[j+3];Pc(M,J+I/3,aa);a[n]=a[k];a[n+1]=a[k+1];a[n+2]=a[k+2];a[n+3]=a[k+3];f[0]=J;a[Q>>2]=b[0];a[Q+4>>2]=b[1];f[0]=Da;a[S>>2]=b[0];a[S+4>>2]=b[1];l=(X+108|0)>>2;var da=a[l];if(0!=(da|0)){var ea=da+24|0;0==(a[a[a[X+16>>2]+20>>2]+152>>2]&1|0)?(aa=da+32|0,ea|=0):(aa=ea|0,ea=da+32|0);var aa=(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]),ea=(b[0]=a[ea>>2],b[1]=a[ea+4>>2],f[0]),xa=(b[0]=a[B],b[1]=a[B+1],f[0])+ja+.5*ea,da=da+56|0;f[0]=xa;a[da>>2]=b[0];a[da+4>>2]=b[1];da=(b[0]=a[q],b[1]=a[q+1],f[0]);xa=a[l]+64|0;f[0]=da;a[xa>>2]=b[0];a[xa+4>>2]=b[1];m[a[l]+81|0]=1;ja=ea>g?ja+(ea-g):ja;K=K+O<aa?K+(aa-O):K}Wd(X,a[X+12>>2],U,7,e);if((d|0)==(i|0)){break}l=d;X=a[c+(d<<2)>>2]}}h=C}function Du(c,d,i,g,q,e){var l,k,n,j,p,s,v,t,u,w,A,B,C=h;h+=16080;var P=C+16e3,y=C+16016,D=C+16032,F=C+16048,M=C+16064,X=a[c+(d<<2)>>2];k=a[X+16>>2];var g=.5*g/(i|0),O=2<g?g:2;B=(k+32|0)>>2;var E=(b[0]=a[B],b[1]=a[B+1],f[0]),g=(k+40|0)>>2,Da=(b[0]=a[g],b[1]=a[g+1],f[0]),ia=X+28|0,G=X+36|0,ia=(b[0]=a[ia>>2],b[1]=a[ia+4>>2],f[0])+E,G=(b[0]=a[G>>2],b[1]=a[G+4>>2],f[0])+Da;n=X+68|0;var J=X+76|0,E=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])+E,J=(b[0]=a[J>>2],b[1]=a[J+4>>2],f[0])+Da;k=k+96|0;var I=.5*(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);k=Da+I;var H=3*(k-G),K=3*(k-J);if(0<(i|0)){var L=(ia<E?-1:1)*O,N=C|0,R=C+8|0;A=(C+16|0)>>2;w=P>>2;u=(C+32|0)>>2;t=y>>2;var ca=.5*(ia+E);v=(C+48|0)>>2;s=D>>2;p=(C+64|0)>>2;j=F>>2;n=(C+80|0)>>2;k=M>>2;var Q=C+96|0,S=C+104|0,U=C|0,i=i+d|0,ja=0,H=I<H?I:H,K=I<K?I:K;for(l=d;;){d=l+1|0;I+=q;H+=q;K+=q;ja+=L;f[0]=ia;a[N>>2]=b[0];a[N+4>>2]=b[1];f[0]=G;a[R>>2]=b[0];a[R+4>>2]=b[1];var aa=ia+ja;Pc(P,aa,G+H/3);a[A]=a[w];a[A+1]=a[w+1];a[A+2]=a[w+2];a[A+3]=a[w+3];l=Da+I;Pc(y,aa,l);a[u]=a[t];a[u+1]=a[t+1];a[u+2]=a[t+2];a[u+3]=a[t+3];Pc(D,ca,l);a[v]=a[s];a[v+1]=a[s+1];a[v+2]=a[s+2];a[v+3]=a[s+3];aa=E-ja;Pc(F,aa,l);a[p]=a[j];a[p+1]=a[j+1];a[p+2]=a[j+2];a[p+3]=a[j+3];Pc(M,aa,J+K/3);a[n]=a[k];a[n+1]=a[k+1];a[n+2]=a[k+2];a[n+3]=a[k+3];f[0]=E;a[Q>>2]=b[0];a[Q+4>>2]=b[1];f[0]=J;a[S>>2]=b[0];a[S+4>>2]=b[1];l=(X+108|0)>>2;var da=a[l];if(0!=(da|0)){var ea=da+24|0;if(0==(a[a[a[X+16>>2]+20>>2]+152>>2]&1|0)){var aa=da+32|0,xa=ea|0}else{aa=ea|0,xa=da+32|0}ea=(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]);aa=(b[0]=a[xa>>2],b[1]=a[xa+4>>2],f[0]);xa=(b[0]=a[g],b[1]=a[g+1],f[0])+I+.5*ea;da=da+64|0;f[0]=xa;a[da>>2]=b[0];a[da+4>>2]=b[1];da=(b[0]=a[B],b[1]=a[B+1],f[0]);xa=a[l]+56|0;f[0]=da;a[xa>>2]=b[0];a[xa+4>>2]=b[1];m[a[l]+81|0]=1;I=ea>q?I+(ea-q):I;ja+O<aa&&(ja+=aa-O)}Wd(X,a[X+12>>2],U,7,e);if((d|0)==(i|0)){break}l=d;X=a[c+(d<<2)>>2]}}h=C}function XH(c,d,i,g,q,e){var l,k,n,j,p,s,v,t,u,w,A,B,C=h;h+=16080;var P=C+16e3,y=C+16016,D=C+16032,F=C+16048,M=C+16064,X=a[c+(d<<2)>>2];k=a[X+16>>2];var q=.5*q/(i|0),O=2<q?q:2;B=(k+32|0)>>2;var E=(b[0]=a[B],b[1]=a[B+1],f[0]),q=(k+40|0)>>2,G=(b[0]=a[q],b[1]=a[q+1],f[0]),ia=X+28|0,J=X+36|0,ia=(b[0]=a[ia>>2],b[1]=a[ia+4>>2],f[0])+E,J=(b[0]=a[J>>2],b[1]=a[J+4>>2],f[0])+G,I=X+68|0;n=X+76|0;I=(b[0]=a[I>>2],b[1]=a[I+4>>2],f[0])+E;G=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])+G;k=k+104|0;var H=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),K=3*(ia+H-E),L=3*(I+H-E);if(0<(i|0)){var N=(J<G?-1:1)*O,R=C|0,Q=C+8|0;A=(C+16|0)>>2;w=P>>2;u=(C+32|0)>>2;t=y>>2;var ca=.5*(J+G);v=(C+48|0)>>2;s=D>>2;p=(C+64|0)>>2;j=F>>2;n=(C+80|0)>>2;k=M>>2;var S=C+96|0,U=C+104|0,zb=C|0,i=i+d|0,ja=H,K=H<K?H:K,H=H<L?H:L,L=0;for(l=d;;){d=l+1|0;ja+=g;K+=g;H+=g;L+=N;f[0]=ia;a[R>>2]=b[0];a[R+4>>2]=b[1];f[0]=J;a[Q>>2]=b[0];a[Q+4>>2]=b[1];var aa=J+L;Pc(P,ia-K/3,aa);a[A]=a[w];a[A+1]=a[w+1];a[A+2]=a[w+2];a[A+3]=a[w+3];l=E-ja;Pc(y,l,aa);a[u]=a[t];a[u+1]=a[t+1];a[u+2]=a[t+2];a[u+3]=a[t+3];Pc(D,l,ca);a[v]=a[s];a[v+1]=a[s+1];a[v+2]=a[s+2];a[v+3]=a[s+3];aa=G-L;Pc(F,l,aa);a[p]=a[j];a[p+1]=a[j+1];a[p+2]=a[j+2];a[p+3]=a[j+3];Pc(M,I-H/3,aa);a[n]=a[k];a[n+1]=a[k+1];a[n+2]=a[k+2];a[n+3]=a[k+3];f[0]=I;a[S>>2]=b[0];a[S+4>>2]=b[1];f[0]=G;a[U>>2]=b[0];a[U+4>>2]=b[1];l=(X+108|0)>>2;var da=a[l];if(0!=(da|0)){var ea=da+24|0;0==(a[a[a[X+16>>2]+20>>2]+152>>2]&1|0)?(aa=da+32|0,ea|=0):(aa=ea|0,ea=da+32|0);var aa=(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]),ea=(b[0]=a[ea>>2],b[1]=a[ea+4>>2],f[0]),xa=(b[0]=a[B],b[1]=a[B+1],f[0])-ja-.5*ea,da=da+56|0;f[0]=xa;a[da>>2]=b[0];a[da+4>>2]=b[1];da=(b[0]=a[q],b[1]=a[q+1],f[0]);xa=a[l]+64|0;f[0]=da;a[xa>>2]=b[0];a[xa+4>>2]=b[1];m[a[l]+81|0]=1;ja=ea>g?ja+(ea-g):ja;L=L+O<aa?L+(aa-O):L}Wd(X,a[X+12>>2],zb,7,e);if((d|0)==(i|0)){break}l=d;X=a[c+(d<<2)>>2]}}h=C}function Pc(c,d,i){var g=c|0;f[0]=d;a[g>>2]=b[0];a[g+4>>2]=b[1];c=c+8|0;f[0]=i;a[c>>2]=b[0];a[c+4>>2]=b[1]}function WH(c,d,i,g,q,e){var l,k,n,j,p,s,v,t,u,w,A,B,C=h;h+=16080;var P=C+16e3,y=C+16016,D=C+16032,F=C+16048,M=C+16064,X=a[c+(d<<2)>>2];k=a[X+16>>2];var g=.5*g/(i|0),O=2<g?g:2;B=(k+32|0)>>2;var E=(b[0]=a[B],b[1]=a[B+1],f[0]),g=(k+40|0)>>2,G=(b[0]=a[g],b[1]=a[g+1],f[0]),ia=X+28|0,J=X+36|0,ia=(b[0]=a[ia>>2],b[1]=a[ia+4>>2],f[0])+E,J=(b[0]=a[J>>2],b[1]=a[J+4>>2],f[0])+G;n=X+68|0;var I=X+76|0,E=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])+E,I=(b[0]=a[I>>2],b[1]=a[I+4>>2],f[0])+G;k=k+96|0;var H=.5*(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),K=3*(J+H-G),L=3*(I+H-G);if(0<(i|0)){var N=(ia<E?-1:1)*O,R=C|0,Q=C+8|0;A=(C+16|0)>>2;w=P>>2;u=(C+32|0)>>2;t=y>>2;var ca=.5*(ia+E);v=(C+48|0)>>2;s=D>>2;p=(C+64|0)>>2;j=F>>2;n=(C+80|0)>>2;k=M>>2;var S=C+96|0,U=C+104|0,zb=C|0,i=i+d|0,K=H<K?H:K,L=H<L?H:L,ja=0;for(l=d;;){d=l+1|0;H+=q;K+=q;L+=q;ja+=N;f[0]=ia;a[R>>2]=b[0];a[R+4>>2]=b[1];f[0]=J;a[Q>>2]=b[0];a[Q+4>>2]=b[1];var aa=ia+ja;Pc(P,aa,J-K/3);a[A]=a[w];a[A+1]=a[w+1];a[A+2]=a[w+2];a[A+3]=a[w+3];l=G-H;Pc(y,aa,l);a[u]=a[t];a[u+1]=a[t+1];a[u+2]=a[t+2];a[u+3]=a[t+3];Pc(D,ca,l);a[v]=a[s];a[v+1]=a[s+1];a[v+2]=a[s+2];a[v+3]=a[s+3];aa=E-ja;Pc(F,aa,l);a[p]=a[j];a[p+1]=a[j+1];a[p+2]=a[j+2];a[p+3]=a[j+3];Pc(M,aa,I-L/3);a[n]=a[k];a[n+1]=a[k+1];a[n+2]=a[k+2];a[n+3]=a[k+3];f[0]=E;a[S>>2]=b[0];a[S+4>>2]=b[1];f[0]=I;a[U>>2]=b[0];a[U+4>>2]=b[1];l=(X+108|0)>>2;var da=a[l];if(0!=(da|0)){var ea=da+24|0;if(0==(a[a[a[X+16>>2]+20>>2]+152>>2]&1|0)){var aa=da+32|0,xa=ea|0}else{aa=ea|0,xa=da+32|0}ea=(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]);aa=(b[0]=a[xa>>2],b[1]=a[xa+4>>2],f[0]);xa=(b[0]=a[g],b[1]=a[g+1],f[0])-H-.5*ea;da=da+64|0;f[0]=xa;a[da>>2]=b[0];a[da+4>>2]=b[1];da=(b[0]=a[B],b[1]=a[B+1],f[0]);xa=a[l]+56|0;f[0]=da;a[xa>>2]=b[0];a[xa+4>>2]=b[1];m[a[l]+81|0]=1;H=ea>q?H+(ea-q):H;ja+O<aa&&(ja+=aa-O)}Wd(X,a[X+12>>2],zb,7,e);if((d|0)==(i|0)){break}l=d;X=a[c+(d<<2)>>2]}}h=C}function Eu(c,d){var i,g,q,e,l,k,n=h;h+=96;var j=n+64,p=n+80;if(6!=m[c+124|0]<<24>>24){k=0==d<<24>>24;var s=a[(k?c+116|0:c+112|0)>>2];i=yl(c)>>2;k?(i=a[i],k=i>>2,0==(a[k+2]|0)?(i=a[k],p=i|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),k=i+8|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),g=n>>2,l=i>>2,a[g]=a[l],a[g+1]=a[l+1],a[g+2]=a[l+2],a[g+3]=a[l+3],g=(n+16|0)>>2,l=(i+16|0)>>2,a[g]=a[l],a[g+1]=a[l+1],a[g+2]=a[l+2],a[g+3]=a[l+3],g=(n+32|0)>>2,l=(i+32|0)>>2,a[g]=a[l],a[g+1]=a[l+1],a[g+2]=a[l+2],a[g+3]=a[l+3],l=(n+48|0)>>2,i=(i+48|0)>>2,a[l]=a[i],a[l+1]=a[i+1],a[l+2]=a[i+2],a[l+3]=a[i+3],Ld(j,n|0,3,.1,0,0),i=j|0,l=j+8|0,j=k,k=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])):(p=i+16|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),j=i+24|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),i=a[k],k=i|0,i=i+8|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),l=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]))):(k=a[i+1]-1|0,i=a[i],l=i>>2,j=i+48*k|0,0==(a[l+(12*k|0)+3]|0)?(g=a[l+(12*k|0)+1],i=g-1|0,l=a[j>>2],j=(i<<4)+l|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),k=(i<<4)+l+8|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),e=n>>2,q=((g-4<<4)+l|0)>>2,a[e]=a[q],a[e+1]=a[q+1],a[e+2]=a[q+2],a[e+3]=a[q+3],e=(n+16|0)>>2,q=((g-3<<4)+l|0)>>2,a[e]=a[q],a[e+1]=a[q+1],a[e+2]=a[q+2],a[e+3]=a[q+3],q=(n+32|0)>>2,g=((g-2<<4)+l|0)>>2,a[q]=a[g],a[q+1]=a[g+1],a[q+2]=a[g+2],a[q+3]=a[g+3],g=(n+48|0)>>2,i=((i<<4)+l|0)>>2,a[g]=a[i],a[g+1]=a[i+1],a[g+2]=a[i+2],a[g+3]=a[i+3],Ld(p,n|0,3,.9,0,0),i=p|0,l=p+8|0,p=j,j=k,k=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])):(p=i+48*k+32|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),i=i+48*k+40|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),l=a[l+(12*k|0)+1]-1|0,j=a[j>>2],k=(l<<4)+j|0,l=(l<<4)+j+8|0,j=i,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])),l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]));i=c|0;k=Cf(l-j,k-p)+3.141592653589793*(Xb(i,a[Fu>>2],-25,-180)/180);i=10*Xb(i,a[Gu>>2],1,0);p+=i*se(k);l=s+56|0;f[0]=p;a[l>>2]=b[0];a[l+4>>2]=b[1];p=j+i*Ce(k);j=s+64|0;f[0]=p;a[j>>2]=b[0];a[j+4>>2]=b[1];m[s+81|0]=1}h=n}function ZH(b){var c=Ba(b);if((c|0)<(a[Hu>>2]|0)){c=a[zl>>2]}else{if(c=c+11|0,a[Hu>>2]=c,c=wb(a[zl>>2],c),a[zl>>2]=c,0==(c|0)){return 0}}var i=m[b];if(0==i<<24>>24){var g=c}else{for(;;){var b=b+1|0,d=i&255,g=c+1|0;m[c]=0==((65<=d&&90>=d)|0)?i:vf(d)&255;i=m[b];if(0==i<<24>>24){break}else{c=g}}c=a[zl>>2]}m[g]=0;return c}function yl(b){for(var c;;){var i=a[b+24>>2];if(0!=(i|0)){c=105;break}if(0==m[b+124|0]<<24>>24){c=104;break}b=a[b+128>>2]}if(104==c){S()}else{if(105==c){return i}}}function Bk(b){a[aj>>2]=b}function Iu(c,d,i,g,q,e,l){l>>=2;e>>=2;q>>=2;g>>=2;f[0]=1-c;a[g]=b[0];a[g+1]=b[1];f[0]=1-d;a[q]=b[0];a[q+1]=b[1];f[0]=1-i;a[e]=b[0];a[e+1]=b[1];c=(b[0]=a[g],b[1]=a[g+1],f[0]);d=(b[0]=a[q],b[1]=a[q+1],f[0]);c=c<d?c:d;f[0]=c;a[l]=b[0];a[l+1]=b[1];d=(b[0]=a[e],b[1]=a[e+1],f[0]);c=d<c?d:c;f[0]=c;a[l]=b[0];a[l+1]=b[1];c=(b[0]=a[g],b[1]=a[g+1],f[0])-c;f[0]=c;a[g]=b[0];a[g+1]=b[1];g=(b[0]=a[l],b[1]=a[l+1],f[0]);g=(b[0]=a[q],b[1]=a[q+1],f[0])-g;f[0]=g;a[q]=b[0];a[q+1]=b[1];l=(b[0]=a[l],b[1]=a[l+1],f[0]);l=(b[0]=a[e],b[1]=a[e+1],f[0])-l;f[0]=l;a[e]=b[0];a[e+1]=b[1]}function kp(c,d,i,g,q,e){e>>=2;q>>=2;g>>=2;if(0<d){var l=1>c?6*c:0,c=l&-1,k=l-(c|0),l=(1-d)*i,h=(1-k*d)*i,d=(1-(1-k)*d)*i;0==(c|0)?(f[0]=i,a[g]=b[0],a[g+1]=b[1],f[0]=d,a[q]=b[0],a[q+1]=b[1],f[0]=l,a[e]=b[0],a[e+1]=b[1]):1==(c|0)?(f[0]=h,a[g]=b[0],a[g+1]=b[1],f[0]=i,a[q]=b[0],a[q+1]=b[1],f[0]=l,a[e]=b[0],a[e+1]=b[1]):2==(c|0)?(f[0]=l,a[g]=b[0],a[g+1]=b[1],f[0]=i,a[q]=b[0],a[q+1]=b[1],f[0]=d,a[e]=b[0],a[e+1]=b[1]):3==(c|0)?(f[0]=l,a[g]=b[0],a[g+1]=b[1],f[0]=h,a[q]=b[0],a[q+1]=b[1],f[0]=i,a[e]=b[0],a[e+1]=b[1]):5==(c|0)?(f[0]=i,a[g]=b[0],a[g+1]=b[1],f[0]=l,a[q]=b[0],a[q+1]=b[1],f[0]=h,a[e]=b[0],a[e+1]=b[1]):4==(c|0)&&(f[0]=d,a[g]=b[0],a[g+1]=b[1],f[0]=l,a[q]=b[0],a[q+1]=b[1],f[0]=i,a[e]=b[0],a[e+1]=b[1])}else{f[0]=i,a[g]=b[0],a[g+1]=b[1],f[0]=i,a[q]=b[0],a[q+1]=b[1],f[0]=i,a[e]=b[0],a[e+1]=b[1]}}function $H(c,d,i){var g,q,Xa,l,k,n,z,p,s,v,t,u,w,A,B,C,P=d>>2,y=h;h+=108;var D,F=y+12;C=F>>2;var M=y+20;B=M>>2;var X=y+28;A=X>>2;var O=y+36;w=O>>2;var E=y+44;u=E>>2;var G=y+52;t=G>>2;var ia=y+60;v=ia>>2;var J=y+68;s=J>>2;var I=y+76;p=I>>2;var H=y+84;z=H>>2;var K=y+92;n=K>>2;var L=y+96;k=L>>2;var N=y+100;l=N>>2;var R=y+104;Xa=R>>2;a[P+8]=i;for(var Q=c;;){if(32==m[Q]<<24>>24){Q=Q+1|0}else{break}}a[Xa]=255;var ca=m[Q];if(35==ca<<24>>24){if(2<(Cd(Q,aI|0,(j=h,h+=16,a[j>>2]=K,a[j+4>>2]=L,a[j+8>>2]=N,a[j+12>>2]=R,j))|0)){if(0==(i|0)){var S=(a[n]>>>0)/255;f[0]=S;a[w]=b[0];a[w+1]=b[1];var U=(a[k]>>>0)/255;f[0]=U;a[u]=b[0];a[u+1]=b[1];var zb=(a[l]>>>0)/255;f[0]=zb;a[t]=b[0];a[t+1]=b[1];var ja=(a[Xa]>>>0)/255,aa=U<zb?U:zb,da=U>zb?U:zb,ea=da<S?S:da;if(0<ea){var xa=ea-(aa>S?S:aa),W=xa/ea;if(0<W){var V=(ea-S)/xa,ha=(ea-U)/xa,ga=(ea-zb)/xa,Y=60*(ea==S?ga-ha:ea==U?V+2-ga:ea!=zb?0:ha+4-V),$=0>Y?Y+360:Y,Z=W}else{var $=0,Z=W}}else{Z=$=0}f[0]=$/360;a[F>>2]=b[0];a[F+4>>2]=b[1];f[0]=ea;a[X>>2]=b[0];a[X+4>>2]=b[1];f[0]=Z;a[M>>2]=b[0];a[M+4>>2]=b[1];var tb=(b[0]=a[C],b[1]=a[C+1],f[0]),ya=d|0;f[0]=tb;a[ya>>2]=b[0];a[ya+4>>2]=b[1];var la=(b[0]=a[B],b[1]=a[B+1],f[0]),wa=d+8|0;f[0]=la;a[wa>>2]=b[0];a[wa+4>>2]=b[1];var Ab=(b[0]=a[A],b[1]=a[A+1],f[0]),Fa=d+16|0;f[0]=Ab;a[Fa>>2]=b[0];a[Fa+4>>2]=b[1];var Ga=d+24|0;f[0]=ja;a[Ga>>2]=b[0];a[Ga+4>>2]=b[1];var ba=0}else{if(1==(i|0)){m[d]=a[n]&255,m[d+1|0]=a[k]&255,m[d+2|0]=a[l]&255,m[d+3|0]=a[Xa]&255}else{if(3==(i|0)){var ta=(a[n]>>>0)/255;f[0]=ta;a[w]=b[0];a[w+1]=b[1];var Ka=(a[k]>>>0)/255;f[0]=Ka;a[u]=b[0];a[u+1]=b[1];var za=(a[l]>>>0)/255;f[0]=za;a[t]=b[0];a[t+1]=b[1];Iu(ta,Ka,za,ia,J,I,H);m[d]=255*((b[0]=a[v],b[1]=a[v+1],f[0])&-1)&255;m[d+1|0]=255*((b[0]=a[s],b[1]=a[s+1],f[0])&-1)&255;m[d+2|0]=255*((b[0]=a[p],b[1]=a[p+1],f[0])&-1)&255;m[d+3|0]=255*((b[0]=a[z],b[1]=a[z+1],f[0])&-1)&255}else{if(2==(i|0)){a[P]=Math.floor(((65535*a[n]|0)>>>0)/255),a[d+4>>2]=Math.floor(((65535*a[k]|0)>>>0)/255),a[P+2]=Math.floor(((65535*a[l]|0)>>>0)/255),a[d+12>>2]=Math.floor(((65535*a[Xa]|0)>>>0)/255)}else{if(4==(i|0)){var ma=d|0;f[0]=(a[n]>>>0)/255;a[ma>>2]=b[0];a[ma+4>>2]=b[1];var pa=d+8|0;f[0]=(a[k]>>>0)/255;a[pa>>2]=b[0];a[pa+4>>2]=b[1];var fa=d+16|0;f[0]=(a[l]>>>0)/255;a[fa>>2]=b[0];a[fa+4>>2]=b[1];var Ha=d+24|0;f[0]=(a[Xa]>>>0)/255;a[Ha>>2]=b[0];a[Ha+4>>2]=b[1]}}}}ba=0}h=y;return ba}var Ra=m[Q]}else{Ra=ca}46==Ra<<24>>24?D=150:10>((Ra&255)-48|0)>>>0&&(D=150);do{if(150==D){var sa=Ba(Q);if((sa|0)<(a[Ju>>2]|0)){var ra=a[lp>>2]}else{var La=sa+11|0;a[Ju>>2]=La;var qa=wb(a[lp>>2],La);a[lp>>2]=qa;if(0==(qa|0)){return ba=-1,h=y,ba}ra=qa}for(var Ya=Q,na=ra;;){var Za=Ya+1|0,oa=m[Ya];if(44==oa<<24>>24){var ab=32}else{if(0==oa<<24>>24){break}else{ab=oa}}m[na]=ab;Ya=Za;na=na+1|0}m[na]=0;if(3==(Cd(ra,bI|0,(j=h,h+=12,a[j>>2]=F,a[j+4>>2]=M,a[j+8>>2]=X,j))|0)){var $a=(b[0]=a[C],b[1]=a[C+1],f[0]),jb=1>$a?$a:1,Ca=0<jb?jb:0;f[0]=Ca;a[C]=b[0];a[C+1]=b[1];var Ia=(b[0]=a[B],b[1]=a[B+1],f[0]),eb=1>Ia?Ia:1,ub=0<eb?eb:0;f[0]=ub;a[B]=b[0];a[B+1]=b[1];var Sa=(b[0]=a[A],b[1]=a[A+1],f[0]),va=1>Sa?Sa:1,ua=0<va?va:0;f[0]=ua;a[A]=b[0];a[A+1]=b[1];if(2==(i|0)){kp(Ca,ub,ua,O,E,G);var Oa=d;a[P]=65535*(b[0]=a[w],b[1]=a[w+1],f[0])&-1;a[Oa+4>>2]=65535*(b[0]=a[u],b[1]=a[u+1],f[0])&-1;a[P+2]=65535*(b[0]=a[t],b[1]=a[t+1],f[0])&-1;a[Oa+12>>2]=65535}else{if(4==(i|0)){kp(Ca,ub,ua,O,E,G);var Wa=(b[0]=a[w],b[1]=a[w+1],f[0]),pb=d|0;f[0]=Wa;a[pb>>2]=b[0];a[pb+4>>2]=b[1];var ob=(b[0]=a[u],b[1]=a[u+1],f[0]),bb=d+8|0;f[0]=ob;a[bb>>2]=b[0];a[bb+4>>2]=b[1];var qb=(b[0]=a[t],b[1]=a[t+1],f[0]),Aa=d+16|0;f[0]=qb;a[Aa>>2]=b[0];a[Aa+4>>2]=b[1];var kb=d+24|0;f[0]=1;a[kb>>2]=b[0];a[kb+4>>2]=b[1]}else{if(0==(i|0)){var Ea=d|0;f[0]=Ca;a[Ea>>2]=b[0];a[Ea+4>>2]=b[1];var vb=d+8|0;f[0]=ub;a[vb>>2]=b[0];a[vb+4>>2]=b[1];var xb=d+16|0;f[0]=ua;a[xb>>2]=b[0];a[xb+4>>2]=b[1];var hd=d+24|0;f[0]=1;a[hd>>2]=b[0];a[hd+4>>2]=b[1]}else{if(1==(i|0)){kp(Ca,ub,ua,O,E,G);var nb=d;m[d]=255*(b[0]=a[w],b[1]=a[w+1],f[0])&255;m[nb+1|0]=255*(b[0]=a[u],b[1]=a[u+1],f[0])&255;m[nb+2|0]=255*(b[0]=a[t],b[1]=a[t+1],f[0])&255;m[nb+3|0]=-1}else{if(3==(i|0)){kp(Ca,ub,ua,O,E,G);var rb=(b[0]=a[w],b[1]=a[w+1],f[0]);Iu(rb,(b[0]=a[u],b[1]=a[u+1],f[0]),(b[0]=a[t],b[1]=a[t+1],f[0]),ia,J,I,H);var lb=d;m[d]=255*((b[0]=a[v],b[1]=a[v+1],f[0])&-1)&255;m[lb+1|0]=255*((b[0]=a[s],b[1]=a[s+1],f[0])&-1)&255;m[lb+2|0]=255*((b[0]=a[p],b[1]=a[p+1],f[0])&-1)&255;m[lb+3|0]=255*((b[0]=a[z],b[1]=a[z+1],f[0])&-1)&255}}}}}ba=0;h=y;return ba}}}while(0);var Ta=cI(Q);a[y>>2]=Ta;if(0==(Ta|0)){return ba=-1,h=y,ba}var cb=a[Ku>>2];if(0==(cb|0)){D=168}else{var fb=a[cb>>2];if(m[fb]<<24>>24!=m[Ta]<<24>>24){D=168}else{if(0==(ka(fb,Ta)|0)){var Ua=cb}else{D=168}}}if(168==D){var sb=tn(y,e,2491,12,314),Ua=a[Ku>>2]=sb}if(0==(Ua|0)){if(0==(i|0)){var Na=d+24|0;q=d>>2;a[q]=0;a[q+1]=0;a[q+2]=0;a[q+3]=0;a[q+4]=0;a[q+5]=0;f[0]=1;a[Na>>2]=b[0];a[Na+4>>2]=b[1]}else{if(1==(i|0)){m[d+2|0]=0,m[d+1|0]=0,m[d]=0,m[d+3|0]=-1}else{if(3==(i|0)){Pb=0,m[d]=Pb&255,Pb>>=8,m[d+1]=Pb&255,Pb>>=8,m[d+2]=Pb&255,Pb>>=8,m[d+3]=Pb&255}else{if(2==(i|0)){a[P+2]=0,a[d+4>>2]=0,a[P]=0,a[d+12>>2]=65535}else{if(4==(i|0)){var Fb=d+24|0;g=d>>2;a[g]=0;a[g+1]=0;a[g+2]=0;a[g+3]=0;a[g+4]=0;a[g+5]=0;f[0]=1;a[Fb>>2]=b[0];a[Fb+4>>2]=b[1]}}}}}ba=1}else{if(0==(i|0)){var Db=d|0;f[0]=(m[Ua+4|0]&255)/255;a[Db>>2]=b[0];a[Db+4>>2]=b[1];var Ob=d+8|0;f[0]=(m[Ua+5|0]&255)/255;a[Ob>>2]=b[0];a[Ob+4>>2]=b[1];var Eb=d+16|0;f[0]=(m[Ua+6|0]&255)/255;a[Eb>>2]=b[0];a[Eb+4>>2]=b[1];var Ma=d+24|0;f[0]=(m[Ua+10|0]&255)/255;a[Ma>>2]=b[0];a[Ma+4>>2]=b[1]}else{if(1==(i|0)){m[d]=m[Ua+7|0],m[d+1|0]=m[Ua+8|0],m[d+2|0]=m[Ua+9|0],m[d+3|0]=m[Ua+10|0]}else{if(3==(i|0)){var Bb=(m[Ua+7|0]&255|0)/255;f[0]=Bb;a[w]=b[0];a[w+1]=b[1];var Ja=(m[Ua+8|0]&255|0)/255;f[0]=Ja;a[u]=b[0];a[u+1]=b[1];var Qa=(m[Ua+9|0]&255|0)/255;f[0]=Qa;a[t]=b[0];a[t+1]=b[1];Iu(Bb,Ja,Qa,ia,J,I,H);m[d]=255*((b[0]=a[v],b[1]=a[v+1],f[0])&-1)&255;m[d+1|0]=255*((b[0]=a[s],b[1]=a[s+1],f[0])&-1)&255;m[d+2|0]=255*((b[0]=a[p],b[1]=a[p+1],f[0])&-1)&255;m[d+3|0]=255*((b[0]=a[z],b[1]=a[z+1],f[0])&-1)&255}else{if(2==(i|0)){a[P]=Math.floor(((65535*(m[Ua+7|0]&255)|0)>>>0)/255),a[d+4>>2]=Math.floor(((65535*(m[Ua+8|0]&255)|0)>>>0)/255),a[P+2]=Math.floor(((65535*(m[Ua+9|0]&255)|0)>>>0)/255),a[d+12>>2]=Math.floor(((65535*(m[Ua+10|0]&255)|0)>>>0)/255)}else{if(4==(i|0)){var Cb=d|0;f[0]=(m[Ua+7|0]&255|0)/255;a[Cb>>2]=b[0];a[Cb+4>>2]=b[1];var Va=d+8|0;f[0]=(m[Ua+8|0]&255|0)/255;a[Va>>2]=b[0];a[Va+4>>2]=b[1];var hb=d+16|0;f[0]=(m[Ua+9|0]&255|0)/255;a[hb>>2]=b[0];a[hb+4>>2]=b[1];var Pa=d+24|0;f[0]=(m[Ua+10|0]&255|0)/255;a[Pa>>2]=b[0];a[Pa+4>>2]=b[1]}}}}}ba=0}h=y;return ba}function cI(b){var c=m[b];if(98==c<<24>>24){return b}var i=b+1|0;if(0==(td(i,dI|0,4)|0)|119==c<<24>>24||0==(td(i,eI|0,4)|0)|108==c<<24>>24||0==(td(i,fI|0,8)|0)){return b}c=47==c<<24>>24;a:do{if(c){var d=Jc(i,47);if(0==(d|0)){d=i}else{if(47!=m[i]<<24>>24){d=0==(Df(mp|0,i,4)|0)?d+1|0:b}else{d=a[aj>>2];do{if(0!=(d|0)&&0!=m[d]<<24>>24&&0!=(Df(mp|0,d,3)|0)){d=gI(a[aj>>2],b+2|0);break a}}while(0);d=b+2|0}}}else{d=a[aj>>2],d=0==(d|0)?b:0==m[d]<<24>>24?b:0==(Df(mp|0,d,3)|0)?b:gI(a[aj>>2],b)}}while(0);return b=ZH(d)}function gI(b,c){var i=h,d=Ba(b)+Ba(c)|0;(d+3|0)<(a[Lu>>2]|0)?d=a[Al>>2]:(d=d+13|0,a[Lu>>2]=d,d=wb(a[Al>>2],d),a[Al>>2]=d);Ma(d,hI|0,(j=h,h+=8,a[j>>2]=b,a[j+4>>2]=c,j));d=a[Al>>2];h=i;return d}function iI(b){var c,i=h;h+=1112;var d=i+1024,f=i+1096,e=i+1100,l=i+1104,k=i+1108,n=a[bj>>2];0==(n|0)&&(n=Nc(Mu,a[Pn>>2]),a[bj>>2]=n);n=J[a[n>>2]](n,b,512);if(0!=(n|0)){return h=i,n}n=qi(b,cj|0);if(0==(n|0)){return la(0,jI|0,(j=h,h+=4,a[j>>2]=b,j)),h=i,0}c=i|0;for(var z=0,p=0;;){if(0==(oi(c,1024,n)|0)){var s=z,v=p;break}p=4==(Cd(c,Nu|0,(j=h,h+=16,a[j>>2]=f,a[j+4>>2]=e,a[j+8>>2]=l,a[j+12>>2]=k,j))|0)?1:p;z=37==m[c]<<24>>24?z:0==(un(c,kI|0)|0)?z:1;if(!(0==(p|0)|0==(z|0))){s=z;v=p;break}}0==(v|0)?(la(0,lI|0,(j=h,h+=4,a[j>>2]=b,j)),s=0):(v=Cb(64),c=v>>2,a[c+8]=a[f>>2],z=v+36|0,a[z>>2]=a[e>>2],a[c+10]=a[l>>2]-a[f>>2]|0,a[z>>2]=a[k>>2]-a[e>>2]|0,a[c+2]=b,b=a[Ou>>2],a[Ou>>2]=b+1|0,a[c+3]=b,kC(n,d),d=a[d+28>>2],b=Cb(d+1|0),a[c+13]=b,xg(n,0,0),lC(b,d,1,n),m[b+d|0]=0,d=a[bj>>2],J[a[d>>2]](d,v,1),m[v+16|0]=s&255,s=v);ri(n);h=i;return s}function np(b,c,i){var d=h,f,e=0!=(c|0);a:do{if(e){for(var l=1,k=0;;){if(0==l<<24>>24){break a}var n=a[c+(k<<2)>>2];if(0==(n|0)){f=280;break a}l=0==m[n]<<24>>24?0:l;k=k+1|0}}else{f=280}}while(0);a:do{if(280==f&&(n=a[i>>2],0!=(n|0))){l=b;for(k=i;;){if(y(l,n),y(l,wd|0),k=k+4|0,n=a[k>>2],0==(n|0)){break a}}}}while(0);if(e&&(f=a[c>>2],0!=(f|0))){for(i=0;;){do{if(0!=m[f]<<24>>24){if(l=Uk(f),0==(l|0)){la(0,mI|0,(j=h,h+=4,a[j>>2]=f,j))}else{if(e=qi(l,cj|0),0==(e|0)){la(0,nI|0,(j=h,h+=4,a[j>>2]=l,j))}else{l=$E(e);k=0==(l|0);a:do{if(!k){for(n=l;;){if(y(b,n),n=$E(e),0==(n|0)){break a}}}}while(0);y(b,wd|0);ri(e)}}}}while(0);i=i+1|0;f=a[c+(i<<2)>>2];if(0==(f|0)){break}}}h=d}function Pu(b,c){var i,d=a[c+52>>2];a:for(;;){var f=m[d];b:do{if(37==f<<24>>24){if(37!=m[d+1|0]<<24>>24){var e=d}else{f=d+2|0;do{if(0==(Df(f,oI|0,3)|0)){e=d}else{if(0==(Df(f,pI|0,5)|0)){e=d}else{if(0==(Df(f,qI|0,3)|0)){e=d}else{if(0==(Df(f,rI|0,7)|0)){e=d}else{e=d;break b}}}}}while(0);for(;;){var l=m[e];if(13==l<<24>>24){i=311;break}else{if(0==l<<24>>24||10==l<<24>>24){i=313;break}}e=e+1|0}do{if(311==i){if(i=0,d=e+1|0,10!=m[d]<<24>>24){var k=d}else{d=e+2|0;continue a}}else{313==i&&(i=0,k=e+1|0)}}while(0);d=0==l<<24>>24?e:k;continue a}}else{if(0==f<<24>>24){break a}else{e=d}}}while(0);for(;;){var h=m[e];if(0==h<<24>>24||10==h<<24>>24){i=319;break}else{if(13==h<<24>>24){i=317;break}}sI(b,h<<24>>24);e=e+1|0}if(319==i){var j=e+1|0;i=320}else{if(317==i){if(i=0,d=e+1|0,10!=m[d]<<24>>24){j=d,i=320}else{var p=e+2|0}}}320==i&&(i=0,p=0==h<<24>>24?e:j);sI(b,10);d=p}}function Qu(b,c){var i=h;if(0==(c|0)){var d;var f=b,e=0;b:for(;;){for(;;){var l=m[f];if(0==l<<24>>24){var k=e;d=246;break b}if(127>(l&255)){f=f+1|0}else{break}}if(-64==(l&-4)<<24>>24){f=f+2|0,e=1}else{k=2;d=245;break}}d=245==d||246==d?k:cc;1==(d|0)?d=bt(b):(2==(d|0)&&!m[Ru]&&(la(0,tI|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),m[Ru]=1),d=b)}else{d=bt(b)}0==(a[Mb>>2]|0)&&fc(Mb,0,0);e=a[Mb+4>>2];e>>>0<a[Mb+8>>2]>>>0||(na(Mb,1),e=a[Mb+4>>2]);a[Mb+4>>2]=e+1|0;m[e]=40;for(e=d;;){l=m[e];if(40==l<<24>>24||41==l<<24>>24||92==l<<24>>24){l=a[Mb+4>>2],l>>>0<a[Mb+8>>2]>>>0||(na(Mb,1),l=a[Mb+4>>2]),a[Mb+4>>2]=l+1|0,m[l]=92}else{if(0==l<<24>>24){break}}l=a[Mb+4>>2];l>>>0<a[Mb+8>>2]>>>0||(na(Mb,1),l=a[Mb+4>>2]);k=m[e];a[Mb+4>>2]=l+1|0;m[l]=k;e=e+1|0}e=a[Mb+4>>2];e>>>0<a[Mb+8>>2]>>>0||(na(Mb,1),e=a[Mb+4>>2]);a[Mb+4>>2]=e+1|0;m[e]=41;(d|0)!=(b|0)&&G(d);d=a[Mb+4>>2];if(d>>>0<a[Mb+8>>2]>>>0){return m[d]=0,d=a[Mb>>2],a[Mb+4>>2]=d,h=i,d}na(Mb,1);d=a[Mb+4>>2];m[d]=0;d=a[Mb>>2];a[Mb+4>>2]=d;h=i;return d}function uI(c,d){var i,g,q,e,l=c>>2,k=h;h+=8;var n;e=k>>2;q=(c+44|0)>>2;a[q]=fa(96);var z=c|0,p=V(z,vI|0);if(0==(p|0)){var s=lk(wI|0);if(0!=(s|0)){var v=s;n=516}}else{v=p,n=516}if(516==n){var t=wb(a[op>>2],Ba(v)+12|0);a[op>>2]=t;for(var u=xI|0,w=t,A=u+12;u<A;u++,w++){m[w]=m[u]}uf(t,v);var B=a[op>>2];if(0===B){Ea(va.i)}else{var B=Oe(B),C=B.indexOf("=");if(""===B||-1===B.indexOf("=")){Ea(va.i)}else{var P=B.slice(0,C),y=B.slice(C+1);if(!(P in Ee)||Ee[P]!==y){Ee[P]=y,mC(Ee)}}}}var D=m,F=c+151|0,M=h,X=Aa(c|0,$(a[c+32>>2]|0,yI|0),Su|0);if(0==(Lb(X,zI|0)|0)){var O=1}else{0==(Lb(X,AI|0)|0)?O=1:0==(Lb(X,BI|0)|0)?O=1:0==(Lb(X,CI|0)|0)?O=1:0==(Lb(X,DI|0)|0)?O=1:0==(Lb(X,EI|0)|0)?O=1:0==(Lb(X,FI|0)|0)?O=1:0==(Lb(X,GI|0)|0)?O=2:0==(Lb(X,HI|0)|0)?O=2:(0!=(Lb(X,Su|0)|0)&&0!=(Lb(X,II|0)|0)&&la(0,JI|0,(j=h,h+=4,a[j>>2]=X,j)),O=0)}h=M;D[F]=O&255;g=(c+32|0)>>2;var E=Xb(z,$(a[g]|0,KI|0),0,0),G=a[q]|0;f[0]=E;a[G>>2]=b[0];a[G+4>>2]=b[1];var ia=V(z,LI|0);do{if(0==(ia|0)){var J=0}else{var I=m[ia];if(76==I<<24>>24){if(0==(ka(ia,MI|0)|0)){J=1;break}}else{if(82==I<<24>>24){J=0==(ka(ia,NI|0)|0)?3:0;break}else{if(66==I<<24>>24){if(0==(ka(ia,OI|0)|0)){J=2;break}}else{J=0;break}}}J=0}}while(0);var H=J<<2;a[l+38]=0==d<<24>>24?H:H|J;var K=Xb(z,$(a[g]|0,PI|0),.25,.02);f[0]=K;a[e]=b[0];a[e+1]=b[1];var L=72*K;a[l+64]=(0>L?L-.5:L+.5)&-1;var N=jc(z,$(a[g]|0,QI|0),0);if(0==(N|0)){f[0]=.5;a[e]=b[0];a[e+1]=b[1];var Q=.5}else{if(0==(Cd(N,RI|0,(j=h,h+=4,a[j>>2]=k,j))|0)){f[0]=.5;a[e]=b[0];a[e+1]=b[1];var S=.5}else{var ca=(b[0]=a[e],b[1]=a[e+1],f[0]);.02>ca?(f[0]=.02,a[e]=b[0],a[e+1]=b[1],S=.02):S=ca}0!=(un(N,SI|0)|0)&&(m[c+284|0]=1);Q=S}var R=72*Q;a[l+65]=(0>R?R-.5:R+.5)&-1;m[c+249|0]=Zf(z,$(a[g]|0,pp|0),0)&255;a[l+63]=Ds(jc(z,$(a[g]|0,TI|0),0),Bl|0,UI|0);VI(c);var U=Tu(c,WI|0,a[q]+64|0);m[a[q]+80|0]=U;Tu(c,XI|0,a[q]+48|0);var W=jo(V(z,YI|0));m[a[q]+82|0]=W;var ja=V(z,ZI|0);if(0==(ja|0)){var aa=V(z,Uu|0);if(0!=(aa|0)){var da=m[aa];m[a[q]+81|0]=(108==da<<24>>24|76==da<<24>>24)&1}else{var ea=V(z,$I|0);if(0!=(ea|0)){var xa=re(ea);m[a[q]+81|0]=xa}}}else{var Y=90==(bh(ja)|0)&1;m[a[q]+81|0]=Y}var Z=Ds(V(z,aJ|0),Cl|0,bJ|0);a[Dl>>2]=Z;var ha=jo(V(z,cJ|0));m[Wi]=ha;a[Ah>>2]=0;var ga=a[q]+24|0;f[0]=0;a[ga>>2]=b[0];a[ga+4>>2]=b[1];var ba=V(z,dJ|0);if(0==(ba|0)){n=548}else{if(0==m[ba]<<24>>24){n=548}else{var Rb=ba;n=550}}if(548==n){var sa=V(z,eJ|0);0!=(sa|0)&&0!=m[sa]<<24>>24&&(Rb=sa,n=550)}if(550==n){var tb=wg(Rb,xc),ya=a[q]+24|0;f[0]=tb;a[ya>>2]=b[0];a[ya+4>>2]=b[1]}Vu(c);f[0]=1e+37;a[Wu>>2]=b[0];a[Wu+4>>2]=b[1];var ra=$(a[g]|0,Xu|0);a[Yu>>2]=ra;i=(c+40|0)>>2;var wa=$(a[a[i]>>2]|0,qp|0);a[sh>>2]=wa;var Ab=$(a[a[i]>>2]|0,rp|0);a[rh>>2]=Ab;var Fa=$(a[a[i]>>2]|0,fJ|0);a[Fs>>2]=Fa;var Ga=$(a[a[i]>>2]|0,kh|0);a[Eh>>2]=Ga;var qa=$(a[a[i]>>2]|0,Ak|0);a[gp>>2]=qa;var ta=$(a[a[i]>>2]|0,Rn|0);a[Ki>>2]=ta;var Ka=$(a[a[i]>>2]|0,sp|0);a[bo>>2]=Ka;var za=$(a[a[i]>>2]|0,tp|0);a[ao>>2]=za;var ma=$(a[a[i]>>2]|0,Eg|0);a[Js>>2]=ma;var pa=$(a[a[i]>>2]|0,dh|0);a[no>>2]=pa;var na=$(a[a[i]>>2]|0,Zu|0);a[Ks>>2]=na;var Ha=$(a[a[i]>>2]|0,pp|0);a[Ls>>2]=Ha;var Ra=$(a[a[i]>>2]|0,$n|0);a[iu>>2]=Ra;var oa=$(a[a[i]>>2]|0,Xu|0);a[El>>2]=oa;var Ma=$(a[a[i]>>2]|0,gJ|0);a[Tt>>2]=Ma;var La=$(a[a[i]>>2]|0,es|0);a[$o>>2]=La;var Qa=$(a[a[i]>>2]|0,hJ|0);a[St>>2]=Qa;var Ya=$(a[a[i]>>2]|0,Uu|0);a[Rt>>2]=Ya;var Cb=$(a[a[i]>>2]|0,iJ|0);a[Ut>>2]=Cb;var Za=$(a[a[i]>>2]|0,jJ|0);a[bp>>2]=Za;var Va=$(a[a[i]>>2]|0,pt|0);a[zu>>2]=Va;var ab=$(a[a[i]>>2]|0,kJ|0);a[cp>>2]=ab;var $a=$(a[a[i]>>2]|0,Qn|0);a[Un>>2]=$a;var jb=$(a[a[i]>>2]|0,lJ|0);a[Gh>>2]=jb;var Ca=$(a[a[i]>>2]|0,Nn|0);a[$r>>2]=Ca;var Ia=$(a[a[i]>>2]|0,mJ|0);a[up>>2]=Ia;var eb=$(a[a[i]>>2]|0,nJ|0);a[oJ>>2]=eb;var ub=$(a[a[i]+4>>2]|0,vp|0);a[Kg>>2]=ub;var Sa=$(a[a[i]+4>>2]|0,kh|0);a[go>>2]=Sa;var hb=$(a[a[i]+4>>2]|0,sp|0);a[Ts>>2]=hb;var ua=$(a[a[i]+4>>2]|0,tp|0);a[Us>>2]=ua;var Oa=$(a[a[i]+4>>2]|0,Eg|0);a[Vs>>2]=Oa;var Wa=$(a[a[i]+4>>2]|0,dh|0);a[Ms>>2]=Wa;var pb=$(a[a[i]+4>>2]|0,Zu|0);a[Ps>>2]=pb;var ob=$(a[a[i]+4>>2]|0,pJ|0);a[Os>>2]=ob;var bb=$(a[a[i]+4>>2]|0,qJ|0);a[Hr>>2]=bb;var qb=$(a[a[i]+4>>2]|0,rJ|0);a[Ir>>2]=qb;var Pa=$(a[a[i]+4>>2]|0,sJ|0);a[Jr>>2]=Pa;var kb=$(a[a[i]+4>>2]|0,ks|0);a[Zk>>2]=kb;var ib=$(a[a[i]+4>>2]|0,ls|0);a[$k>>2]=ib;var vb=$(a[a[i]+4>>2]|0,tJ|0);a[Ws>>2]=vb;var xb=$(a[a[i]+4>>2]|0,uJ|0);a[Xs>>2]=xb;var hd=$(a[a[i]+4>>2]|0,vJ|0);a[Ys>>2]=hd;var nb=$(a[a[i]+4>>2]|0,wJ|0);a[Gu>>2]=nb;var rb=$(a[a[i]+4>>2]|0,xJ|0);a[Fu>>2]=rb;var lb=$(a[a[i]+4>>2]|0,yJ|0);a[Hh>>2]=lb;var Ta=$(a[a[i]+4>>2]|0,pp|0);a[$u>>2]=Ta;var cb=$(a[a[i]+4>>2]|0,Rn|0);a[Vn>>2]=cb;var fb=$(a[a[i]+4>>2]|0,zJ|0);a[io>>2]=fb;var Ua=$(a[a[i]+4>>2]|0,AJ|0);a[uk>>2]=Ua;var sb=$(a[a[i]+4>>2]|0,BJ|0);a[dj>>2]=sb;var Na=$(a[a[i]+4>>2]|0,Qn|0);a[Tn>>2]=Na;var Fb=$(a[a[i]+4>>2]|0,Nn|0);a[bs>>2]=Fb;var Db=$(a[a[i]+4>>2]|0,CJ|0);a[Rs>>2]=Db;var Ob=$(a[a[i]+4>>2]|0,DJ|0);a[Ss>>2]=Ob;var Eb=$(a[a[i]+4>>2]|0,$n|0);a[hs>>2]=Eb;var db=RC(c);a[a[q]+88>>2]=db;var Bb=V(z,Pr|0);if(0!=(Bb|0)&&0!=m[Bb]<<24>>24){var Ja=ec(Bb,z);a[a[q]+92>>2]=Ja}h=k}function VI(c){var d=V(c|0,EJ|0);if(0!=(d|0)){var i=m[d];if(0!=i<<24>>24){var g=i<<24>>24;101==(g|0)?101==i<<24>>24&&0==(ka(d,FJ|0)|0)&&(a[a[c+44>>2]+84>>2]=5):99==(g|0)?99==i<<24>>24&&0==(ka(d,GJ|0)|0)&&(a[a[c+44>>2]+84>>2]=3):102==(g|0)?102==i<<24>>24&&0==(ka(d,HJ|0)|0)&&(a[a[c+44>>2]+84>>2]=2):97==(g|0)?97==i<<24>>24&&0==(ka(d,IJ|0)|0)&&(a[a[c+44>>2]+84>>2]=4):(d=wg(d,xc),0<d&&(c=c+44|0,a[a[c>>2]+84>>2]=1,c=a[c>>2]+16|0,f[0]=d,a[c>>2]=b[0],a[c+4>>2]=b[1]))}}}function Tu(c,d,i){var g,q=h;h+=20;g=q>>2;var e=q+8,l=q+16;m[l]=0;c=V(c|0,d);if(0==(c|0)){return h=q,0}if(1<(Cd(c,JJ|0,(j=h,h+=12,a[j>>2]=q,a[j+4>>2]=e,a[j+8>>2]=l,j))|0)){if(d=(b[0]=a[g],b[1]=a[g+1],f[0]),0<d&&(e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),0<e)){return g=72*d,c=i|0,f[0]=(0>g?g-.5:g+.5)&-1|0,a[c>>2]=b[0],a[c+4>>2]=b[1],g=72*e,i=i+8|0,f[0]=(0>g?g-.5:g+.5)&-1|0,a[i>>2]=b[0],a[i+4>>2]=b[1],l=33==m[l]<<24>>24&1,h=q,l}}m[l]=0;if(0>=(Cd(c,KJ|0,(j=h,h+=8,a[j>>2]=q,a[j+4>>2]=l,j))|0)){return h=q,0}g=(b[0]=a[g],b[1]=a[g+1],f[0]);if(0>=g){return h=q,0}g*=72;g=(0>g?g-.5:g+.5)&-1|0;e=i|0;f[0]=g;a[e>>2]=b[0];a[e+4>>2]=b[1];i=i+8|0;f[0]=g;a[i>>2]=b[0];a[i+4>>2]=b[1];h=q;return 33==m[l]<<24>>24&1}function LJ(c){if(0!=(a[Ic>>2]|0)){var d=c+76|0,c=c+60|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])+(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);f[0]=d;a[Nb>>2]=b[0];a[Nb+4>>2]=b[1];f[0]=d/72;a[Ih>>2]=b[0];a[Ih+4>>2]=b[1]}}function Vu(c){var d,i=c|0,g=V(i,dh|0);if(0!=(g|0)&&0!=m[g]<<24>>24){d=(c+32|0)>>2;var q=a[d]+149|0;m[q]|=8;var e=0!=(bg(g)|0)?2:0,l=Xb(i,$(a[d]|0,sp|0),14,1),q=c+48|0;a[q>>2]=ag(i,g,e,l,Aa(i,$(a[d]|0,tp|0),Li|0),Aa(i,$(a[d]|0,Eg|0),Ac|0));g=V(i,Vt|0);e=0!=(g|0);g=(a[d]|0)==(c|0)?e&&116==m[g]<<24>>24?1:0:e&&98==m[g]<<24>>24?0:1;i=V(i,MJ|0);0==(i|0)?i=g:(i=m[i],i=108==i<<24>>24?g|2:114==i<<24>>24?g|4:g);m[c+283|0]=i;g=a[d];(g|0)!=(c|0)&&(q=a[q>>2],d=q+24|0,q=q+32|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])+16,q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0])+8,i=0!=(i&1)<<24>>24,0==(a[g+152>>2]&1|0)?(i=i?2:0,g=(i<<4)+c+84|0,f[0]=d,a[g>>2]=b[0],a[g+4>>2]=b[1],c=(i<<4)+c+92|0,f[0]=q):(i=i?1:3,g=(i<<4)+c+84|0,f[0]=q,a[g>>2]=b[0],a[g+4>>2]=b[1],c=(i<<4)+c+92|0,f[0]=d),a[c>>2]=b[0],a[c+4>>2]=b[1])}}function xC(b){var c,i=b+44|0;c=(i|0)>>2;var d=a[c],f=a[d+88>>2];0!=(f|0)&&(IQa(f),d=a[c]);f=a[d+92>>2];0!=(f|0)&&(G(f),d=a[c]);G(d);a[c]=0;vh(a[b+48>>2]);b=i>>2;for(c=b+61;b<c;b++){a[b]=0}}function Jn(){var b=h;h+=16;mk(b);var c=((a[b+4>>2]+a[b>>2]-a[ih>>2]-a[ih+4>>2]|0)>>>0)/60;h=b;return c}function av(c,d,i,g){var q,e,l;LJ(d);var k=d+68|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),n=d+76|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),c=c+348|0;Jh(i,NJ|0,(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]));Jh(i,gc|0,k/72);Jh(i,gc|0,n/72);Ge(10,i);c=ra(d);k=0==(c|0);a:do{if(!k){n=c;for(l=n>>2;;){if(0==m[n+134|0]<<24>>24){e=xd(a[l+3]);Me(i,OJ|0,e);e=n+32|0;var z=n+40|0;bv(i,(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]));e=a[l+30];0==m[e+82|0]<<24>>24?(e=cv(a[e>>2]),z=n|0):(z=n|0,e=xd(mb(z,a[a[no>>2]+8>>2])));q=n+48|0;Jh(i,gc|0,(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]));q=n+56|0;Jh(i,gc|0,(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]));Me(i,gc|0,e);Me(i,gc|0,Aa(z,a[Ki>>2],wp|0));Me(i,gc|0,a[a[l+6]>>2]);Me(i,gc|0,Aa(z,a[Eh>>2],Ac|0));l=Aa(z,a[gp>>2],Y|0);Me(i,gc|0,0==m[l]<<24>>24?Aa(z,a[Eh>>2],qe|0):l);Ge(10,i)}n=ba(d,n);if(0==(n|0)){break a}else{l=n>>2}}}}while(0);c=ra(d);if(0!=(c|0)){for(g=0==g<<24>>24;;){k=Ib(d,c);n=0==(k|0);a:do{if(!n){l=k;for(e=l>>2;;){if(g){var z=Y|0,p=Y|0}else{q=a[e+1],0==(q|0)?(z=Y|0,p=Y|0):(z=a[q+4>>2],p=a[q+8>>2])}q=(l+24|0)>>2;var s=a[q],v=0==(s|0);b:do{if(!v){var t=a[s+4>>2],u=0<(t|0);c:do{if(u){for(var w=a[s>>2],A=0,B=0;;){if(A=a[(w+4>>2)+(12*B|0)]+A|0,B=B+1|0,(B|0)>=(t|0)){var C=A;break c}}}else{C=0}}while(0);Me(i,0,Dg|0);t=a[e+4];PJ(i,a[t+12>>2],m[t+134|0],z);t=a[e+3];PJ(i,a[t+12>>2],m[t+134|0],p);t=i;u=C;w=h;h+=1024;hb(gc|0,t);A=w|0;Ma(A,dv|0,(j=h,h+=4,a[j>>2]=u,j));hb(A,t);h=w;u=a[q];if(0<(a[u+4>>2]|0)){t=0;for(A=u;;){w=a[A>>2];u=a[(w>>2)+(12*t|0)];w=a[(w+4>>2)+(12*t|0)];if(0<(w|0)){for(A=0;;){var B=(A<<4)+u|0,P=(A<<4)+u+8|0;bv(i,(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),(b[0]=a[P>>2],b[1]=a[P+4>>2],f[0]));A=A+1|0;if((A|0)==(w|0)){break}}u=a[q]}else{u=A}t=t+1|0;if((t|0)<(a[u+4>>2]|0)){A=u}else{break b}}}}}while(0);e=l+108|0;z=a[e>>2];0!=(z|0)&&(z=cv(a[z>>2]),Me(i,gc|0,z),z=a[e>>2],e=z+56|0,z=z+64|0,bv(i,(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0])));e=l|0;Me(i,gc|0,Aa(e,a[Vn>>2],wp|0));Me(i,gc|0,Aa(e,a[go>>2],Ac|0));Ge(10,i);l=yb(d,l);if(0==(l|0)){break a}else{e=l>>2}}}}while(0);c=ba(d,c);if(0==(c|0)){break}}}hb(QJ|0,i)}function Jh(c,d,i){var g=h;h+=1024;0!=(d|0)&&hb(d,c);d=g|0;Ma(d,xp|0,(j=h,h+=8,f[0]=i,a[j>>2]=b[0],a[j+4>>2]=b[1],j));hb(d,c);h=g}function Me(a,b,i){0!=(b|0)&&hb(b,a);hb(i,a)}function bv(c,d,i){Jh(c,gc|0,d/72);d=0==(a[Ic>>2]|0)?i:(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-i;Jh(c,gc|0,d/72)}function cv(a){var a=Dc(a),b=xd(a);dc(a);return b}function PJ(a,b,i,c){b=0==i<<24>>24?xd(b):cv(Jc(b,58)+1|0);Me(a,gc|0,b);0!=(c|0)&&0!=m[c]<<24>>24&&(c=xd(c),Me(a,zf|0,c))}function ev(c,d,i){var g,q,e,l,k,n,z,p,s,v,t=h;h+=2064;var u,w=t+2048;v=(c+206|0)>>1;var A=2<(D[v]&65535);Gg(1);LJ(c);fc(w,1024,t+1024|0);s=(c+40|0)>>2;ac(c,a[a[s]>>2]|0,ej|0,Y|0,212);ac(c,a[a[s]>>2]|0,fv|0,Y|0,212);var B=ac(c,a[a[s]>>2]|0,rp|0,Y|0,212);a[rh>>2]=B;var C=ac(c,a[a[s]>>2]|0,qp|0,Y|0,212);a[sh>>2]=C;ac(c,a[a[s]+4>>2]|0,ej|0,Y|0,286);var P=c+149|0,y=m[P];if(0==(y&16)<<24>>24){var gb=y}else{ac(c,a[a[s]>>2]|0,Fl|0,Y|0,212),gb=m[P]}if(0==(gb&1)<<24>>24){var F=gb}else{ac(c,a[a[s]+4>>2]|0,fj|0,Y|0,286),F=m[P]}if(0==(F&32)<<24>>24){var M=F}else{ac(c,a[a[s]+4>>2]|0,Fl|0,Y|0,286),M=m[P]}if(0==(M&2)<<24>>24){var X=M}else{ac(c,a[a[s]+4>>2]|0,gv|0,Y|0,286),X=m[P]}0!=(X&4)<<24>>24&&ac(c,a[a[s]+4>>2]|0,hv|0,Y|0,286);p=(c+48|0)>>2;var O=c|0;if(0!=(a[p]|0)){ac(c,O,fj|0,Y|0,202);ac(c,O,yp|0,Y|0,202);ac(c,O,zp|0,Y|0,202);var E=a[p];if(0!=m[a[E>>2]]<<24>>24){var G=E+56|0,ia=(b[0]=a[G>>2],b[1]=a[G+4>>2],f[0]),J=E+64|0,I=(b[0]=a[J>>2],b[1]=a[J+4>>2],f[0]),H=t|0,K=0==(a[Ic>>2]|0)?I:(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-I;Ma(H,Gf|0,(j=h,h+=16,f[0]=ia,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=K,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));yd(O,fj|0,H);var L=a[p],N=L+24|0,Q=(b[0]=a[N>>2],b[1]=a[N+4>>2],f[0]),S=L+32|0,ca=(b[0]=a[S>>2],b[1]=a[S+4>>2],f[0]);Ma(H,Gl|0,(j=h,h+=8,f[0]=Q/72,a[j>>2]=b[0],a[j+4>>2]=b[1],j));yd(O,yp|0,H);Ma(H,Gl|0,(j=h,h+=8,f[0]=ca/72,a[j>>2]=b[0],a[j+4>>2]=b[1],j));yd(O,zp|0,H)}}var R=ac(c,O,iv|0,Y|0,202),U=ra(c),W=0==(U|0);a:do{if(W){var ja=0,aa=0}else{var da=t|0;z=(w+4|0)>>2;n=(w+8|0)>>2;k=(w|0)>>2;for(var ea=0,xa=0,Z=U;;){var $=Z,ha=Z+24|0;l=ha>>2;var ga=Z+32|0,la=ga,Rb=(b[0]=a[la>>2],b[1]=a[la+4>>2],f[0]),sa=0!=(a[Ic>>2]|0);if(A){if(sa){var tb=ga+8|0,ya=(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-(b[0]=a[tb>>2],b[1]=a[tb+4>>2],f[0])}else{var fa=ga+8|0,ya=(b[0]=a[fa>>2],b[1]=a[fa+4>>2],f[0])}var wa=ha+124|0,Ab=a[wa>>2]+16|0,Fa=72*(b[0]=a[Ab>>2],b[1]=a[Ab+4>>2],f[0]);Ma(da,RJ|0,(j=h,h+=24,f[0]=Rb,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=ya,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=Fa,a[j+16>>2]=b[0],a[j+20>>2]=b[1],j));db(w,da);var Ga=3<(D[v]&65535);b:do{if(Ga){for(var qa=3;;){var ta=(qa<<3)+a[wa>>2]|0;Ma(da,SJ|0,(j=h,h+=8,f[0]=72*(b[0]=a[ta>>2],b[1]=a[ta+4>>2],f[0]),a[j>>2]=b[0],a[j+4>>2]=b[1],j));db(w,da);var Ka=qa+1|0;if((Ka|0)<(D[v]&65535|0)){qa=Ka}else{break b}}}}while(0);var za=a[z];if(za>>>0<a[n]>>>0){var ma=za}else{na(w,1),ma=a[z]}m[ma]=0;var pa=a[k];a[z]=pa;yd(Z|0,ej|0,pa)}else{if(sa){var oa=ga+8|0,Ha=(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-(b[0]=a[oa>>2],b[1]=a[oa+4>>2],f[0])}else{var Ra=Z+40|0,Ha=(b[0]=a[Ra>>2],b[1]=a[Ra+4>>2],f[0])}Ma(da,Gf|0,(j=h,h+=16,f[0]=Rb,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=Ha,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));yd(Z|0,ej|0,da)}var Ba=Z+96|0;Ma(da,xp|0,(j=h,h+=8,f[0]=(b[0]=a[Ba>>2],b[1]=a[Ba+4>>2],f[0])/72,a[j>>2]=b[0],a[j+4>>2]=b[1],j));var va=Z|0;qc(va,a[a[sh>>2]+8>>2],da);var La=Z+104|0,Aa=Z+112|0;Ma(da,xp|0,(j=h,h+=8,f[0]=((b[0]=a[La>>2],b[1]=a[La+4>>2],f[0])+(b[0]=a[Aa>>2],b[1]=a[Aa+4>>2],f[0]))/72,a[j>>2]=b[0],a[j+4>>2]=b[1],j));qc(va,a[a[rh>>2]+8>>2],da);var Ya=a[Z+124>>2];if(0!=(Ya|0)){var Ea=Ya+56|0,Za=(b[0]=a[Ea>>2],b[1]=a[Ea+4>>2],f[0]),Qa=Ya+64|0,ab=(b[0]=a[Qa>>2],b[1]=a[Qa+4>>2],f[0]),$a=0==(a[Ic>>2]|0)?ab:(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-ab;Ma(da,Gf|0,(j=h,h+=16,f[0]=Za,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=$a,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));yd(va,Fl|0,da)}do{if(0==(ka(a[a[l]>>2],jv|0)|0)){kv($,a[l+1],w);var jb=w+4|0,Ca=a[jb>>2];Ca>>>0>a[w>>2]>>>0&&(a[jb>>2]=Ca-1|0);var Ia=a[z];if(Ia>>>0<a[n]>>>0){var eb=Ia}else{na(w,1),eb=a[z]}m[eb]=0;var ub=a[k];a[z]=ub;yd(va,fv|0,ub)}else{var Sa;if(Sa=0!=(a[up>>2]|0)){var Cb;var ua=a[$+24>>2];if(0==(ua|0)){var Oa=0,Wa=Oa&1}else{Oa=270==(a[a[ua+4>>2]>>2]|0),Wa=Oa&1}Cb=Wa;Sa=0!=Cb<<24>>24}if(Sa){var pb=a[l+1],ob=pb+8|0,bb=a[ob>>2];if(3>(bb|0)){var qb=V(va,us|0),wb=0==(qb|0)?8:bh(qb),kb=3>(wb|0)?8:wb;if(0<(kb|0)){var Va=kb;u=763}}else{Va=bb,u=763}b:do{if(763==u){u=0;var vb=pb+40|0,xb=ha+24|0,hd=Va|0;e=(ha+32|0)>>2;for(var nb=0;;){if(0<(nb|0)){var rb=a[z];if(rb>>>0<a[n]>>>0){var lb=rb}else{na(w,1),lb=a[z]}a[z]=lb+1|0;m[lb]=32}if(2<(a[ob>>2]|0)){var Ta=a[vb>>2],cb=(nb<<4)+Ta|0,fb=(b[0]=a[cb>>2],b[1]=a[cb+4>>2],f[0])/72;if(0==(a[Ic>>2]|0)){var Ua=(nb<<4)+Ta+8|0,sb=(b[0]=a[Ua>>2],b[1]=a[Ua+4>>2],f[0])/72}else{var Na=(nb<<4)+Ta+8|0,sb=(b[0]=a[Ih>>2],b[1]=a[Ih+4>>2],f[0])-(b[0]=a[Na>>2],b[1]=a[Na+4>>2],f[0])/72}Ma(da,lv|0,(j=h,h+=16,f[0]=fb,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=sb,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j))}else{var Fb=6.283185307179586*((nb|0)/hd),Db=.5*(b[0]=a[xb>>2],b[1]=a[xb+4>>2],f[0])*se(Fb),Ob=0==(a[Ic>>2]|0)?.5*(b[0]=a[e],b[1]=a[e+1],f[0])*Ce(Fb):(b[0]=a[Ih>>2],b[1]=a[Ih+4>>2],f[0])-.5*(b[0]=a[e],b[1]=a[e+1],f[0])*Ce(Fb);Ma(da,lv|0,(j=h,h+=16,f[0]=Db,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=Ob,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j))}db(w,da);var Eb=nb+1|0;if((Eb|0)==(Va|0)){break b}else{nb=Eb}}}}while(0);var hb=a[a[up>>2]+8>>2],Bb=a[z];if(Bb>>>0<a[n]>>>0){var Ja=Bb}else{na(w,1),Ja=a[z]}m[Ja]=0;var Pa=a[k];a[z]=Pa;qc(va,hb,Pa)}}}while(0);var ib=0<(a[Ah>>2]|0);b:do{if(ib){var Gb=Ib(c,Z);if(0==(Gb|0)){var mb=xa,Jb=ea}else{var Hb=ea,ic=xa,Kb=Gb;for(q=Kb>>2;;){do{if(6==m[Kb+124|0]<<24>>24){var Lb=ic,Mb=Hb}else{g=(Kb+24|0)>>2;var Pb=a[g];if(0==(Pb|0)){Lb=ic,Mb=Hb}else{var Tb=0<(a[Pb+4>>2]|0);c:do{if(Tb){for(var pc=0,Wc=Hb,Vb=ic,Wb=Pb;;){if(0<(pc|0)){var Yb=a[z];if(Yb>>>0<a[n]>>>0){var $b=Yb}else{na(w,1),$b=a[z]}a[z]=$b+1|0;m[$b]=59;var Zb=a[g]}else{Zb=Wb}var Sb=a[Zb>>2];if(0==(a[(Sb+8>>2)+(12*pc|0)]|0)){var kc=Wc,lc=Zb,ec=Sb}else{var Jd=Sb+48*pc+16|0,nc=(b[0]=a[Jd>>2],b[1]=a[Jd+4>>2],f[0]);if(0==(a[Ic>>2]|0)){var Hc=Sb+48*pc+24|0,mc=(b[0]=a[Hc>>2],b[1]=a[Hc+4>>2],f[0])}else{var oe=Sb+48*pc+24|0,mc=(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-(b[0]=a[oe>>2],b[1]=a[oe+4>>2],f[0])}Ma(da,TJ|0,(j=h,h+=16,f[0]=nc,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=mc,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));db(w,da);var bc=a[g],kc=1,lc=bc,ec=a[bc>>2]}if(0==(a[(ec+12>>2)+(12*pc|0)]|0)){var Qb=Vb,tc=lc,Sc=ec}else{var Xb=ec+48*pc+32|0,rc=(b[0]=a[Xb>>2],b[1]=a[Xb+4>>2],f[0]);if(0==(a[Ic>>2]|0)){var dc=ec+48*pc+40|0,rd=(b[0]=a[dc>>2],b[1]=a[dc+4>>2],f[0])}else{var oc=ec+48*pc+40|0,rd=(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-(b[0]=a[oc>>2],b[1]=a[oc+4>>2],f[0])}Ma(da,UJ|0,(j=h,h+=16,f[0]=rc,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=rd,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));db(w,da);var jc=a[g],Qb=1,tc=jc,Sc=a[jc>>2]}var Ac=0<(a[(Sc+4>>2)+(12*pc|0)]|0);d:do{if(Ac){for(var gc=0,Rd=tc;;){if(0<(gc|0)){var Bc=a[z];if(Bc>>>0<a[n]>>>0){var Sd=Bc}else{na(w,1),Sd=a[z]}a[z]=Sd+1|0;m[Sd]=32;var fd=a[g]}else{fd=Rd}var Cc=a[(a[fd>>2]>>2)+(12*pc|0)],yc=(gc<<4)+Cc|0,Kc=(b[0]=a[yc>>2],b[1]=a[yc+4>>2],f[0]),vc=(gc<<4)+Cc+8|0,Tc=(b[0]=a[vc>>2],b[1]=a[vc+4>>2],f[0]),Dc=0==(a[Ic>>2]|0)?Tc:(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-Tc;Ma(da,Gf|0,(j=h,h+=16,f[0]=Kc,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=Dc,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));db(w,da);var Mc=gc+1|0,id=a[g];if((Mc|0)<(a[(a[id>>2]+4>>2)+(12*pc|0)]|0)){gc=Mc,Rd=id}else{var Ec=id;break d}}}else{Ec=tc}}while(0);var zc=pc+1|0;if((zc|0)<(a[Ec+4>>2]|0)){pc=zc,Wc=kc,Vb=Qb,Wb=Ec}else{var Gc=kc,Nc=Qb;break c}}}else{Gc=Hb,Nc=ic}}while(0);var Fc=Kb|0,Qc=a[z];if(Qc>>>0<a[n]>>>0){var Yc=Qc}else{na(w,1),Yc=a[z]}m[Yc]=0;var Rc=a[k];a[z]=Rc;yd(Fc,ej|0,Rc);var Td=a[q+27];if(0!=(Td|0)){var Lc=Td+56|0,Oc=(b[0]=a[Lc>>2],b[1]=a[Lc+4>>2],f[0]),fe=Td+64|0,Pc=(b[0]=a[fe>>2],b[1]=a[fe+4>>2],f[0]),Zc=0==(a[Ic>>2]|0)?Pc:(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-Pc;Ma(da,Gf|0,(j=h,h+=16,f[0]=Oc,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=Zc,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));yd(Fc,fj|0,da)}var jd=a[q+30];if(0!=(jd|0)){var md=jd+56|0,je=(b[0]=a[md>>2],b[1]=a[md+4>>2],f[0]),Jc=jd+64|0,ad=(b[0]=a[Jc>>2],b[1]=a[Jc+4>>2],f[0]),Uc=0==(a[Ic>>2]|0)?ad:(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-ad;Ma(da,Gf|0,(j=h,h+=16,f[0]=je,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=Uc,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));yd(Fc,Fl|0,da)}var Xc=a[q+28];if(0!=(Xc|0)){var Vc=Xc+56|0,cd=(b[0]=a[Vc>>2],b[1]=a[Vc+4>>2],f[0]),$c=Xc+64|0,ld=(b[0]=a[$c>>2],b[1]=a[$c+4>>2],f[0]),kd=0==(a[Ic>>2]|0)?ld:(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-ld;Ma(da,Gf|0,(j=h,h+=16,f[0]=cd,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=kd,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));yd(Fc,gv|0,da)}var bd=a[q+29];if(0!=(bd|0)){var ed=bd+56|0,qd=(b[0]=a[ed>>2],b[1]=a[ed+4>>2],f[0]),pd=bd+64|0,dd=(b[0]=a[pd>>2],b[1]=a[pd+4>>2],f[0]),nd=0==(a[Ic>>2]|0)?dd:(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-dd;Ma(da,Gf|0,(j=h,h+=16,f[0]=qd,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=nd,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));yd(Fc,hv|0,da)}Lb=Nc;Mb=Gc}}}while(0);var zd=yb(c,Kb);if(0==(zd|0)){mb=Lb;Jb=Mb;break b}else{Hb=Mb,ic=Lb,Kb=zd,q=Kb>>2}}}}else{mb=xa,Jb=ea}}while(0);var od=ba(c,Z);if(0==(od|0)){ja=Jb;aa=mb;break a}else{ea=Jb,xa=mb,Z=od}}}}while(0);mv(c,R);uc(w);0!=(D[c+164>>1]&1)<<16>>16&&oF(c);a[d>>2]=ja;a[i>>2]=aa;Gg(0);h=t}function kv(c,d,i){var g,q=h;h+=1024;g=(d+48|0)>>2;var e=a[g];if(0==(e|0)){var e=q|0,l=d+16|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=c+32|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);if(0==(a[Ic>>2]|0)){var n=d+24|0,m=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),n=c+40|0,p=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),n=d+40|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])+p,m=m+p}else{var m=(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0]),n=d+24|0,p=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),n=c+40|0,s=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),n=d+40|0,n=m-((b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])+s),m=m-(p+s)}p=d+32|0;p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])+k;Ma(e,VJ|0,(j=h,h+=32,f[0]=l+k,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=m,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=p,a[j+16>>2]=b[0],a[j+20>>2]=b[1],f[0]=n,a[j+24>>2]=b[0],a[j+28>>2]=b[1],j));db(i,e);e=a[g]}if(0<(e|0)){d=d+56|0;for(e=0;!(kv(c,a[a[d>>2]+(e<<2)>>2],i),e=e+1|0,(e|0)>=(a[g]|0));){}}h=q}function mv(c,d){var i=h;h+=1024;var g=i|0,q=c+52|0,q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);if(0==(a[Ic>>2]|0)){var e=c+60|0,l=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),e=c+76|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])}else{var e=(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0]),l=c+60|0,l=e-(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=c+76|0,e=e-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])}k=c+68|0;k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);Ma(g,WJ|0,(j=h,h+=32,f[0]=q,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=k,a[j+16>>2]=b[0],a[j+20>>2]=b[1],f[0]=e,a[j+24>>2]=b[0],a[j+28>>2]=b[1],j));q=c|0;qc(q,a[d+8>>2],g);e=c+48|0;k=a[e>>2];0!=(k|0)&&0!=m[a[k>>2]]<<24>>24&&(l=k+56|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=k+64|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),k=0==(a[Ic>>2]|0)?k:(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-k,Ma(g,Gf|0,(j=h,h+=16,f[0]=l,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=k,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j)),yd(q,fj|0,g),l=a[e>>2],e=l+24|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),l=l+32|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),Ma(g,Gl|0,(j=h,h+=8,f[0]=e/72,a[j>>2]=b[0],a[j+4>>2]=b[1],j)),yd(q,yp|0,g),Ma(g,Gl|0,(j=h,h+=8,f[0]=l/72,a[j>>2]=b[0],a[j+4>>2]=b[1],j)),yd(q,zp|0,g));g=c+208|0;if(1<=(a[g>>2]|0)){q=c+212|0;for(e=1;!(mv(a[a[q>>2]+(e<<2)>>2],d),e=e+1|0,(e|0)>(a[g>>2]|0));){}}h=i}function Ap(c,d,i){var g=h;h+=1024;var q=g|0;if(0==(a[Ic>>2]|0)){var e=i,l=0}else{e=(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-i,l=1}i=0>e?(l?(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-i:i)-.5:(l?(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0])-i:i)+.5;Ma(q,Hl|0,(j=h,h+=8,a[j>>2]=(0>d?d-.5:d+.5)&-1,a[j+4>>2]=i&-1,j));db(c,q);h=g}function An(c,d,i){var g=h;h+=256;if(999==(XJ(c,i)|0)){return d=nv(c,1,i),la(1,ov|0,(j=h,h+=8,a[j>>2]=i,a[j+4>>2]=d,j)),h=g,-1}YJ(c,d);var i=g|0,q=d+52|0;if(0==m[a[d+44>>2]+81|0]<<24>>24){var c=q|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),q=d+60|0,q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]),e=d+68|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),l=d+76|0}else{c=d+60|0,c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),q|=0,q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]),e=d+76|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),l=d+68|0}l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);Ma(i,ZJ|0,(j=h,h+=16,a[j>>2]=(0>c?c-.5:c+.5)&-1,a[j+4>>2]=(0>q?q-.5:q+.5)&-1,a[j+8>>2]=(0>e?e-.5:e+.5)&-1,a[j+12>>2]=(0>l?l-.5:l+.5)&-1,j));$J(d|0,iv|0,i,Y|0);h=g;return 0}function xr(b,c){var i;i=a[c>>2];var d,f=Cb(12);d=f>>2;a[d+1]=0;a[d+2]=Hb(i);i=b+100|0;a[d]=a[i>>2];a[i>>2]=f;d=a[c+4>>2];i=a[d+4>>2];if(0!=(i|0)){var e=i;for(i=e>>2;;){var l=a[i+1],k=0==(l|0);a:do{if(!k){for(var h=d|0,j=0,p=l;;){if(aK(b,a[h>>2],p,a[i+(5*j|0)+2],f,e+20*j|0),j=j+1|0,p=a[i+(5*j|0)+1],0==(p|0)){break a}}}}while(0);i=a[d+12>>2];if(0==(i|0)){break}else{d=d+8|0,e=i,i=e>>2}}}}function OD(b){var c,i=b>>2,d=h,f=a[i+19],e=a[i];if(0==(f|0)){c=994}else{if(f=a[f>>2],0==(f|0)){c=994}else{J[f](b)}}if(994==c&&0==(a[i+10]|0)&&(c=(b+36|0)>>2,0==(a[c]|0))){if(0!=m[e+13|0]<<24>>24&&bK(b),b=b+32|0,e=a[b>>2],0==(e|0)){a[c]=a[zg>>2]}else{if(e=qi(e,au|0),a[c]=e,0==(e|0)){return i=a[a[i+3]+16>>2],b=a[b>>2],c=si(a[Ea.c>>2]),J[i](cK|0,(j=h,h+=8,a[j>>2]=b,a[j+4>>2]=c,j)),h=d,1}}}if(0==(a[i+37]&1024|0)){return h=d,0}J[a[a[i+3]+16>>2]](pv|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));h=d;return 1}function Bp(b,c){if(-1e15>c){a[b>>2]=19;var i=qv|0;return i}if(1e15<c){return a[b>>2]=18,i=qv+1|0}var i=100*c,d=(0>i?i-.5:i+.5)&-1;if(0==(d|0)){return a[b>>2]=1,i=vd|0}for(var i=0>(d|0),f=0,d=i?-d|0:d,e=rv+20|0,l=2;;){var k=(d|0)%10,h=(d|0)/10&-1;0==(k|0)&0==f<<24>>24?k=e:(f=e-1|0,m[f]=(k|48)&255,k=f,f=1);1==(l|0)&&(0!=f<<24>>24&&(k=k-1|0,m[k]=46),f=1);l=l-1|0;if(18<(d+9|0)>>>0|0<(l|0)){d=h,e=k}else{break}}i?(i=k-1|0,m[i]=45):i=k;a[b>>2]=rv+20-i|0;return i}function bK(b){var c=h;h+=100;var i=a[b+24>>2],d=c|0;0==(i|0)?m[d]=0:Ma(d,dK|0,(j=h,h+=4,a[j>>2]=i+1|0,j));var i=a[b+20>>2],f=0==(i|0)?eK|0:i,i=b+52|0,e=Ba(f)+Ba(d)+Ba(a[i>>2])+1|0;a[sv>>2]>>>0<(e+1|0)>>>0?(e=e+11|0,a[sv>>2]=e,e=mc(a[ig>>2],e),a[ig>>2]=e):e=a[ig>>2];Rf(e,f);uf(a[ig>>2],d);d=a[ig>>2];d=d+Ba(d)|0;Pb=46;m[d]=Pb&255;Pb>>=8;m[d+1]=Pb&255;d=Hb(a[i>>2]);i=ik(d,58);f=a[ig>>2];if(0==(i|0)){var l;uf(f,d)}else{for(;;){if(uf(f,i+1|0),f=a[ig>>2],e=f+Ba(f)|0,Pb=46,m[e]=Pb&255,Pb>>=8,m[e+1]=Pb&255,m[i]=0,i=ik(d,58),0==(i|0)){l=f;break}}uf(l,d)}G(d);l=a[ig>>2];b=b+32|0;a[b>>2]=l;h=c}function y(a,b){jg(a,b,Ba(b))}function sI(a,b){var i=h;h+=4;m[i]=b&255;jg(a,i,1);h=i}function iD(b){var c=a[b+36>>2];if(0!=(c|0)&&0==m[b+140|0]<<24>>24&&0==(a[a[b>>2]+116>>2]|0)){b=(function(a){Q.a[a]&&Q.a[a].object.l&&(Q.a[a].aa||Q.a[a].object.l(xc))});try{if(0===c){for(c=0;c<Q.a.length;c++){Q.a[c]&&b(c)}}else{b(c)}}catch(i){Ea(va.r)}}}function N(b,c){var i=h;h+=1028;var d=i+1024;a[d>>2]=arguments[N.length];var f=i|0;jg(b,f,JQa(f,c,a[d>>2]));h=i}function gj(b,c){var i=h;h+=4;jg(b,Bp(i,c),a[i>>2]);h=i}function Hd(b,c,i){var d=h;h+=4;jg(b,Bp(d,c),a[d>>2]);jg(b,gc|0,1);jg(b,Bp(d,i),a[d>>2]);h=d}function kf(c,d,i){var g=d|0,q=d+8|0;Hd(c,(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]));if(1<(i|0)){for(g=1;;){jg(c,gc|0,1);var q=(g<<4)+d|0,e=(g<<4)+d+8|0;Hd(c,(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]),(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]));g=g+1|0;if((g|0)==(i|0)){break}}}}function XJ(b,c){var i;i=eh(b,1,c);if(0==(i|0)){return 999}i=a[i+16>>2]>>2;a[b+156>>2]=a[i+1];a[b+144>>2]=a[i+3];a[b+148>>2]=a[i];a[b+152>>2]=a[i+4];return 300}function YJ(b,c){var i=h;a[c+172>>2]=b;var d=c+32|0,f=a[d>>2];(f|0)!=(c|0)&&(a[f+172>>2]=b);f=V(c|0,tv|0);if(0!=(f|0)&&999==(XJ(b,f)|0)){return d=nv(b,1,f),la(1,ov|0,(j=h,h+=8,a[j>>2]=f,a[j+4>>2]=d,j)),h=i,-1}f=a[b+144>>2];if(0==(f|0)){return h=i,-1}Gg(1);uI(c,a[a[b+152>>2]>>2]&1);a[a[d>>2]+44>>2]=a[c+44>>2];d=a[f>>2];0!=(d|0)&&(J[d](c),d=a[f+4>>2],0!=(d|0)&&(a[c+176>>2]=d));Gg(0);h=i;return 0}function jg(b,c,i){var d=h;if(0==(i|0)|0==(c|0)){return h=d,0}0!=(a[b+148>>2]&1024|0)&&(J[a[a[b+12>>2]+16>>2]](pv|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Pe());if((fK(b,c,i)|0)==(i|0)){return h=d,i}J[a[a[b+12>>2]+16>>2]](gK|0,(j=h,h+=4,a[j>>2]=i,j));Pe()}function fK(b,c,i){var d,f,e=h;d=a[a[b>>2]+116>>2];if(0!=(d|0)){return i=J[d](b,c,i),h=e,i}f=(b+40|0)>>2;var l=a[f];if(0==(l|0)){return i=Lc(c,1,i,a[b+36>>2]),h=e,i}var k=b+44|0;d=(b+48|0)>>2;var n=a[d];if((a[k>>2]-1-n|0)>>>0<i>>>0){if(n=n+(i+4096)&-4096,a[k>>2]=n,l=mc(l,n),a[f]=l,0==(l|0)){J[a[a[b+12>>2]+16>>2]](hK|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Pe()}else{var z=l,p=a[d]}}else{z=l,p=n}tf(z+p|0,c,i);b=a[d]+i|0;a[d]=b;m[a[f]+b|0]=0;h=e;return i}function iK(b){var c=h,i=a[b+76>>2];0!=(a[b+148>>2]&1024|0)&&(J[a[a[b+12>>2]+16>>2]](jK|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Pe());if(0!=(i|0)&&(i=a[i+8>>2],0!=(i|0))){J[i](b);h=c;return}iD(b);i=b+32|0;if(0!=(a[i>>2]|0)){var d=b+36|0,f=a[d>>2];(f|0)!=(a[zg>>2]|0)&&0==m[b+140|0]<<24>>24&&(0!=(f|0)&&(ri(f),a[d>>2]=0),a[i>>2]=0)}h=c}function kK(c,d,i,g){var q,e;q=c>>2;if(3==(d|0)){uv(c,i,g),m[c+530|0]=1,m[c+533|0]=3,m[c+529|0]=1}else{if(2==(d|0)){m[c+530|0]=1,m[c+533|0]=2,m[c+529|0]=1}else{if(4==(d|0)){m[c+528|0]=0;if(0==(a[q+89]|0)){var l=.10000000000000009*(i-.5*(a[q+110]>>>0)),d=c+348|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),k=c+512|0;e=(c+332|0)>>2;l=l/(d*(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]))+(b[0]=a[e],b[1]=a[e+1],f[0]);f[0]=l;a[e]=b[0];a[e+1]=b[1];l=c+520|0;e=(c+340|0)>>2;q=.10000000000000009*(g-.5*(a[q+111]>>>0))/(d*(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]))+(b[0]=a[e],b[1]=a[e+1],f[0])}else{e=.10000000000000009*(g-.5*(a[q+111]>>>0)),d=c+348|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),l=c+520|0,l=e/(d*(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])),e=(c+332|0)>>2,l=(b[0]=a[e],b[1]=a[e+1],f[0])-l,f[0]=l,a[e]=b[0],a[e+1]=b[1],l=c+512|0,e=(c+340|0)>>2,q=.10000000000000009*(i-.5*(a[q+110]>>>0))/(d*(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]))+(b[0]=a[e],b[1]=a[e+1],f[0])}f[0]=q;a[e]=b[0];a[e+1]=b[1];q=d;d=c+348|0;f[0]=1.1*q;a[d>>2]=b[0];a[d+4>>2]=b[1];m[c+529|0]=1}else{5==(d|0)?(m[c+528|0]=0,e=(c+348|0)>>2,d=(b[0]=a[e],b[1]=a[e+1],f[0])/1.1,f[0]=d,a[e]=b[0],a[e+1]=b[1],0==(a[q+89]|0)?(e=c+512|0,l=.10000000000000009*(i-.5*(a[q+110]>>>0))/(d*(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])),e=(c+332|0)>>2,l=(b[0]=a[e],b[1]=a[e+1],f[0])-l,f[0]=l,a[e]=b[0],a[e+1]=b[1],e=c+520|0,d=.10000000000000009*(g-.5*(a[q+111]>>>0))/(d*(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]))):(l=c+520|0,e=(c+332|0)>>2,l=.10000000000000009*(g-.5*(a[q+111]>>>0))/(d*(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]))+(b[0]=a[e],b[1]=a[e+1],f[0]),f[0]=l,a[e]=b[0],a[e+1]=b[1],e=c+512|0,d=.10000000000000009*(i-.5*(a[q+110]>>>0))/(d*(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]))),q=(c+340|0)>>2,d=(b[0]=a[q],b[1]=a[q+1],f[0])-d,f[0]=d,a[q]=b[0],a[q+1]=b[1],m[c+529|0]=1):1==(d|0)&&(uv(c,i,g),lK(c),m[c+530|0]=1,m[c+533|0]=1,m[c+529|0]=1)}}}q=c+552|0;f[0]=i;a[q>>2]=b[0];a[q+4>>2]=b[1];c=c+560|0;f[0]=g;a[c>>2]=b[0];a[c+4>>2]=b[1]}function mK(c,d,i){var g,q,e,l,k;k=(c+552|0)>>2;l=c+512|0;e=(d-(b[0]=a[k],b[1]=a[k+1],f[0]))/(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);l=(c+560|0)>>2;g=c+520|0;g=(i-(b[0]=a[l],b[1]=a[l+1],f[0]))/(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);var h=e&-1;if(1>((-1<(h|0)?h:-h|0)|0)){if(h=g&-1,1>((-1<(h|0)?h:-h|0)|0)){return}}h=m[c+533|0]&255;0==(h|0)?uv(c,d,i):2==(h|0)&&(q=0==(a[c+356>>2]|0),h=c+348|0,h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),q?(q=(c+332|0)>>2,e=(b[0]=a[q],b[1]=a[q+1],f[0])-e/h,f[0]=e,a[q]=b[0],a[q+1]=b[1],e=(c+340|0)>>2,g=(b[0]=a[e],b[1]=a[e+1],f[0])-g/h,f[0]=g,a[e]=b[0],a[e+1]=b[1]):(q=(c+332|0)>>2,g=(b[0]=a[q],b[1]=a[q+1],f[0])-g/h,f[0]=g,a[q]=b[0],a[q+1]=b[1],g=(c+340|0)>>2,e=(b[0]=a[g],b[1]=a[g+1],f[0])+e/h,f[0]=e,a[g]=b[0],a[g+1]=b[1]),m[c+529|0]=1);f[0]=d;a[k]=b[0];a[k+1]=b[1];f[0]=i;a[l]=b[0];a[l+1]=b[1]}function nK(b,c,i){var d=a[b>>2];if(0==(c|0)){c=xn(oK|0,1);a[b+32>>2]=pK|0;var f=c}else{c=qi(c,cj|0);if(0==(c|0)){return}vC(c);zr();f=a[qa+16>>2];ri(c)}if(0!=(f|0)){var c=(d+128|0)>>2,e=a[c];if(0!=(e|0)){var l=a[d+144>>2];0!=(l|0)&&(l=a[l+4>>2],0!=(l|0)&&(J[l](e),e=a[c]));xC(e);Sf(a[c])}a[c]=f;a[f+172>>2]=d;An(d,f,i);a[b+572>>2]=0;a[b+568>>2]=0;m[b+529|0]=1}}function uv(c,d,i){var g=h;h+=48;var q=g+32,e;e=0==(a[c+356>>2]|0);var l=c+348|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);if(e){e=c+512|0;var k=c+496|0,d=d/(l*(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]))-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);e=c+520|0;k=c+504|0;l=i/(l*(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]))-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);e=(q|0)>>2;f[0]=d}else{e=c+520|0,k=c+496|0,i=i/(l*(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]))-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),e=c+512|0,k=c+504|0,l=-d/(l*(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]))-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),e=(q|0)>>2,f[0]=i}a[e]=b[0];a[e+1]=b[1];d=q+8|0;d>>=2;f[0]=l;a[d]=b[0];a[d+1]=b[1];l=q|0;l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);q=q+8|0;q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);d=c+348|0;d=1/(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);i=g+16|0;f[0]=l+d;a[i>>2]=b[0];a[i+4>>2]=b[1];i=g+24|0;f[0]=q+d;a[i>>2]=b[0];a[i+4>>2]=b[1];i=g|0;f[0]=l-d;a[i>>2]=b[0];a[i+4>>2]=b[1];l=g+8|0;f[0]=q-d;a[l>>2]=b[0];a[l+4>>2]=b[1];var n,q=a[a[c>>2]+128>>2],d=h,i=g>>2,l=h;h+=32;a[l>>2]=a[i];a[l+4>>2]=a[i+1];a[l+8>>2]=a[i+2];a[l+12>>2]=a[i+3];a[l+16>>2]=a[i+4];a[l+20>>2]=a[i+5];a[l+24>>2]=a[i+6];a[l+28>>2]=a[i+7];i=ra(q);a:for(;;){if(0==(i|0)){n=1222;break}for(var j=Ib(q,i);0!=(j|0);){b:{var p=j;e=l;var s=cc,k=h,s=e>>2;e=h;h+=32;a[e>>2]=a[s];a[e+4>>2]=a[s+1];a[e+8>>2]=a[s+2];a[e+12>>2]=a[s+3];a[e+16>>2]=a[s+4];a[e+20>>2]=a[s+5];a[e+24>>2]=a[s+6];a[e+28>>2]=a[s+7];var v=a[p+24>>2],s=0==(v|0);c:do{if(!s&&0!=(GQa(v+8|0,e)|0)){for(var s=v+4|0,v=v|0,t=0;;){if((t|0)>=(a[s>>2]|0)){break c}if(0==rF(a[v>>2]+48*t|0,e)<<24>>24){t=t+1|0}else{var u=1;break}}h=k;e=u;break b}}while(0);u=a[p+108>>2];u=0!=(u|0)&&0!=as(u,e)<<24>>24?1:0;h=k;e=u}if(0!=e<<24>>24){n=1219;break a}j=yb(q,j)}i=ba(q,i)}do{if(1222==n){var w;w=a[q+20>>2];for(w=J[a[w>>2]](w,0,256);0!=(w|0);){if(0!=qF(w,l)<<24>>24){n=1225;break}u=a[q+20>>2];w=J[a[u>>2]](u,w|0,16)}1225==n?w|=0:(w=qK(q,l),w=0==(w|0)?q|0:w|0)}else{1219==n&&(w=j|0)}}while(0);h=d;n=w;j=c+568|0;(n|0)!=(a[j>>2]|0)&&(w=a[c+568>>2],0!=(w|0)&&(u=a[w>>2]<<28>>28,1==(u|0)?(w=w+133|0,m[w]&=-2):2==(u|0)?(w=w+127|0,m[w]&=-2):3==(u|0)&&(w=w+148|0,m[w]&=-2)),a[c+576>>2]=0,a[j>>2]=n,rK(c),m[c+529|0]=1);h=g}function rK(b){var c,i;i=(b+576|0)>>2;c=a[i];0!=(c|0)&&(G(c),a[i]=0);b=a[b+568>>2];c=b>>2;if(0!=(b|0)){var d=a[c]<<28>>28;2==(d|0)?(d=b+127|0,m[d]|=1,c=$(a[a[a[a[c+3]+20>>2]+40>>2]+4>>2]|0,Pi|0),0!=(c|0)&&(a[i]=ec(mb(b,a[c+8>>2]),b))):1==(d|0)?(d=b+133|0,m[d]|=1,c=$(a[a[a[c+5]+40>>2]>>2]|0,Pi|0),0!=(c|0)&&(a[i]=ec(mb(b,a[c+8>>2]),b))):3==(d|0)&&(d=b+148|0,m[d]|=1,c=$(a[c+8]|0,Pi|0),0!=(c|0)&&(a[i]=ec(mb(b,a[c+8>>2]),b)))}}function qK(c,d){var i,g=h;i=d>>2;d=h;h+=32;a[d>>2]=a[i];a[d+4>>2]=a[i+1];a[d+8>>2]=a[i+2];a[d+12>>2]=a[i+3];a[d+16>>2]=a[i+4];a[d+20>>2]=a[i+5];a[d+24>>2]=a[i+6];a[d+28>>2]=a[i+7];var q;i=a[c+208>>2];for(var e=c+212|0,l=1;(l|0)<=(i|0);){var k=qK(a[a[e>>2]+(l<<2)>>2],d);if(0==(k|0)){l=l+1|0}else{var n=k;q=1259;break}}if(1259==q){return h=g,n}q=c+52|0;i=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);q=c+60|0;q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);n=c+76|0;n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);e=d+16|0;if((b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])>=i){if(i=c+68|0,e=d|0,(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])>=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])){if(i=d+24|0,(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])>=q){if(q=d+8|0,n>=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0])){return h=g,c}}}}h=g;return 0}function lK(b){var c=b+572|0,i=a[c>>2];if(0!=(i|0)){var d=a[i>>2]<<28>>28;1==(d|0)?(i=i+133|0,m[i]=m[i]&-7|4):2==(d|0)?(i=i+127|0,m[i]=m[i]&-7|4):3==(d|0)&&(i=i+148|0,m[i]=m[i]&-7|4)}i=b+580|0;d=a[i>>2];0!=(d|0)&&(G(d),a[i>>2]=0);i=a[b+568>>2];a[c>>2]=i;0!=(i|0)&&(c=a[i>>2]<<28>>28,3==(c|0)?(c=i+148|0,m[c]|=2,vv(b,i)):2==(c|0)?(c=i+127|0,m[c]|=2,sK(b,i)):1==(c|0)&&(c=i+133|0,m[c]|=2,tK(b,i)))}function vv(b,c){var i,d;i=b+584|0;d=(c+32|0)>>2;(a[d]|0)==(c|0)?0==(a[c>>2]&16|0)?Fc(i,0,Yf|0):Fc(i,0,wv|0):Fc(i,0,uK|0);Fc(i,1,a[c+12>>2]);a[b+588>>2]=2;var f=b+596|0;i=(c+16|0)>>2;var e=0<(rc(a[a[a[i]+12>>2]+4>>2])|0);a:do{if(e){for(var l=c|0,k=0,h=0;;){var j=a[a[a[a[i]+12>>2]+8>>2]+(h<<2)>>2];Fc(f,k,a[j>>2]);Fc(f,k+1|0,mb(l,a[j+8>>2]));j=k+3|0;Fc(f,k+2|0,0);h=h+1|0;if((h|0)<(rc(a[a[a[i]+12>>2]+4>>2])|0)){k=j}else{var p=j;break a}}}else{p=0}}while(0);a[b+600>>2]=p;p=$(a[d]|0,Ni|0);if(0==(p|0)){if(d=$(a[d]|0,Oi|0),0==(d|0)){return}}else{d=p}p=c|0;a[b+580>>2]=ec(mb(p,a[d+8>>2]),p)}function tK(b,c){var i,d;d=b+584|0;Fc(d,0,jh|0);Fc(d,1,a[c+12>>2]);a[b+588>>2]=2;var f=b+596|0;d=(c+20|0)>>2;i=(a[a[d]+32>>2]+16|0)>>2;var e=0<(rc(a[a[a[i]+4>>2]+4>>2])|0);a:do{if(e){for(var l=c|0,k=0,h=0;;){var j=a[a[a[a[i]+4>>2]+8>>2]+(h<<2)>>2];Fc(f,k,a[j>>2]);var p=k+2|0;Fc(f,k|1,mb(l,a[j+8>>2]));h=h+1|0;if((h|0)<(rc(a[a[a[i]+4>>2]+4>>2])|0)){k=p}else{var m=p;break a}}}else{m=0}}while(0);a[b+600>>2]=m;m=$(a[a[a[d]+40>>2]>>2]|0,Ni|0);if(0==(m|0)){if(d=$(a[a[a[d]+40>>2]>>2]|0,Oi|0),0==(d|0)){return}}else{d=m}m=c|0;a[b+580>>2]=ec(mb(m,a[d+8>>2]),m)}function sK(b,c){var i,d,f,e=b+584|0;Fc(e,0,Dg|0);d=c+16|0;Fc(e,1,a[a[d>>2]+12>>2]);Fc(e,3,0!=(a[a[a[d>>2]+20>>2]>>2]&16|0)?Bf|0:Af|0);d=(c+12|0)>>2;Fc(e,4,a[a[d]+12>>2]);a[b+588>>2]=7;var l=b+596|0;i=(a[a[a[d]+20>>2]+32>>2]+16|0)>>2;var k=0<(rc(a[a[a[i]+8>>2]+4>>2])|0);a:do{if(k){for(var h=c|0,j=0,p=0;;){var m=a[a[a[a[i]+8>>2]+8>>2]+(j<<2)>>2],v=m|0,t=a[v>>2];if(0==(ka(t,vi|0)|0)){f=m+8|0;Fc(e,2,mb(h,a[f>>2]));var u=f;f=1322}else{if(0==(ka(t,wi|0)|0)){f=m+8|0,Fc(e,5,mb(h,a[f>>2])),u=f,f=1322}else{if(m=m+8|0,0!=(ka(t,wr|0)|0)){u=m,f=1322}else{Fc(e,6,mb(h,a[m>>2]));var w=p}}}1322==f&&(f=0,Fc(l,p,a[v>>2]),Fc(l,p+1|0,mb(h,a[u>>2])),w=p+2|0);j=j+1|0;if((j|0)<(rc(a[a[a[i]+8>>2]+4>>2])|0)){p=w}else{var A=w;break a}}}else{A=0}}while(0);a[b+600>>2]=A;e=$(a[a[a[a[d]+20>>2]+40>>2]+4>>2]|0,Ni|0);if(0==(e|0)){if(d=$(a[a[a[a[d]+20>>2]+40>>2]+4>>2]|0,Oi|0),0==(d|0)){return}}else{d=e}e=c|0;a[b+580>>2]=ec(mb(e,a[d+8>>2]),e)}function wC(b,c){var i=b+120|0,d=a[i>>2];0==(d|0)?(d=fa(624),a[i>>2]=d,a[b+124>>2]=d,i=a[Kh>>2]=d):(i=a[Kh>>2],0==(i|0)?i=a[Kh>>2]=d:(i=a[i+4>>2],0==(i|0)&&(i=fa(624),a[a[Kh>>2]+4>>2]=i),a[Kh>>2]=i));a[i+52>>2]=c;a[i>>2]=b;eh(b,3,c)}function Fc(b,c,i){var d=b+8|0;if((a[d>>2]|0)>(c|0)){var f=a[b>>2]}else{f=c+10|0,a[d>>2]=f,b|=0,f=wb(a[b>>2],f<<2),a[b>>2]=f}c=(c<<2)+f|0;a[c>>2]=i}function vK(b){var c=b|0,i=a[c>>2];0!=(i|0)&&G(i);a[c>>2]=0;a[b+8>>2]=0;a[b+4>>2]=0}function Dr(b){var c,i=b+120|0,d=a[i>>2],f=0==(d|0);a:do{if(!f){var e=d;for(c=e>>2;;){var l=a[c+1];vK(e+596|0);vK(e+584|0);var k=a[c+144];0!=(k|0)&&G(k);c=a[c+145];0!=(c|0)&&G(c);G(e);if(0==(l|0)){break a}else{e=l,c=e>>2}}}}while(0);a[Kh>>2]=0;a[Lh>>2]=0;a[b+164>>2]=0;a[b+124>>2]=0;a[i>>2]=0;a[b+28>>2]=0}function aK(b,c,i,d,f,e){var l,k,n=h;h+=128;l=n|0;jk(l,i);var j=Jc(l,58);0!=(j|0)&&(m[j]=0);j=n+64|0;for(b=(c<<2)+b+60|0;;){c=a[b>>2];if(0==(c|0)){k=b;k>>=2;break}jk(j,a[c+4>>2]);c=Jc(j,58);0!=(c|0)&&(m[c]=0);if(1>(ka(l,j)|0)){k=b;k>>=2;break}b=a[b>>2]|0}for(;;){b=a[k];if(0==(b|0)){break}jk(j,a[b+4>>2]);b=Jc(j,58);0!=(b|0)&&(m[b]=0);if(0!=(ka(l,j)|0)){break}b=a[k];if((a[b+8>>2]|0)<=(d|0)){break}k=b|0;k>>=2}j=Cb(20);l=j>>2;a[l]=a[k];a[k]=j;a[l+1]=i;a[l+2]=d;a[l+3]=f;a[l+4]=e;h=n;return 1}function eh(b,c,i){var d,f=h;h+=128;var e,l=f+64,k=2>(c-3|0)>>>0?0:c,n=f|0;jk(n,i);i=Jc(n,58);if(0==(i|0)){var z=i=0}else{z=i+1|0,m[i]=0,i=Jc(z,58),0==(i|0)?i=0:(m[i]=0,i=i+1|0)}var l=l|0,p=0==(z|0),s=0==(i|0),v=(k|0)==(c|0);d=((c<<2)+b+60|0)>>2;a:for(;;){var t=a[d];if(0==(t|0)){var u=0;e=1413;break}jk(l,a[t+4>>2]);t=Jc(l,58);0==(t|0)?t=0:(m[t]=0,t=t+1|0);do{if(0==(ka(l,n)|0)){var w=0==(t|0);if(w|p||0==(ka(t,z)|0)){if(s||0==(ka(i,a[a[a[d]+12>>2]+8>>2])|0)){if(w|v){break a}if(0!=(eh(b,k,t)|0)){break a}}}}}while(0);d=a[d]|0;d>>=2}if(1413==e){return b=((c<<2)+b+80|0)>>2,a[b]=u,h=f,u}u=a[d];if(0==(u|0)){return u=0,b=((c<<2)+b+80|0)>>2,a[b]=u,h=f,u}e=u+16|0;k=a[e>>2];0==(k|0)?(k=h,la(1,wK|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),h=k,e=a[e>>2]):e=k;u=0==(e|0)?0:u;if(0==(u|0)){return u=0,b=((c<<2)+b+80|0)>>2,a[b]=u,h=f,u}if(0>=(a[b+8>>2]|0)){return b=((c<<2)+b+80|0)>>2,a[b]=u,h=f,u}e=a[Mh+(c<<2)>>2];k=a[u+4>>2];n=a[a[u+12>>2]+8>>2];Va(a[oa>>2],xK|0,(j=h,h+=12,a[j>>2]=e,a[j+4>>2]=k,a[j+8>>2]=n,j));b=((c<<2)+b+80|0)>>2;a[b]=u;h=f;return u}function nv(b,c,i){var d,f;m[xv]||(fc(Sb,0,0),m[xv]=1);var i=Hb(i),e=Jc(i,58);do{if(0==(e|0)){var l=(c<<2)+b+60|0;f=1432}else{m[e]=0;var k=(c<<2)+b+60|0;if(0==(e+1|0)){l=k,f=1432}else{var h=a[k>>2];if(0==(h|0)){G(i);var j=1,p=k;f=1434}else{d=k;d>>=2;for(var s=1;;){var h=Hb(a[h+4>>2]),v=Jc(h,58);0!=(v|0)&&(m[v]=0);if(0==m[i]<<24>>24){f=1426}else{if(0==(Lb(i,h)|0)){f=1426}else{var t=s}}1426==f&&(f=0,t=a[Sb+4>>2],t>>>0<a[Sb+8>>2]>>>0||(na(Sb,1),t=a[Sb+4>>2]),a[Sb+4>>2]=t+1|0,m[t]=32,db(Sb,a[a[d]+4>>2]),t=a[Sb+4>>2],t>>>0<a[Sb+8>>2]>>>0||(na(Sb,1),t=a[Sb+4>>2]),a[Sb+4>>2]=t+1|0,m[t]=58,db(Sb,a[a[a[d]+12>>2]+8>>2]),t=0);G(h);d=a[d]|0;h=a[d>>2];if(0==(h|0)){break}else{d>>=2,s=t}}G(i);0!=t<<24>>24&&(j=t,p=k,f=1434)}}}}while(0);1432==f&&(G(i),j=1,p=l,f=1434);do{if(1434==f){b=a[p>>2];do{if(0==(b|0)){var u=j;f=1445}else{c=p;l=0;i=j;for(e=b;;){var w=Hb(a[e+4>>2]),e=Jc(w,58);0!=(e|0)&&(m[e]=0);if(e=0!=(l|0)){if(0==(Lb(l,w)|0)){var A=i}else{f=1439}}else{f=1439}1439==f&&(f=0,A=a[Sb+4>>2],A>>>0<a[Sb+8>>2]>>>0||(na(Sb,1),A=a[Sb+4>>2]),a[Sb+4>>2]=A+1|0,m[A]=32,db(Sb,w),e||G(0),A=0);c=a[c>>2]|0;e=a[c>>2];if(0==(e|0)){break}else{l=w,i=A}}if(0==(w|0)){u=A,f=1445}else{var B=A}}}while(0);1445==f&&(G(0),B=u);if(0!=B<<24>>24){return f=Y|0}}}while(0);f=a[Sb+4>>2];f>>>0<a[Sb+8>>2]>>>0||(na(Sb,1),f=a[Sb+4>>2]);m[f]=0;f=a[Sb>>2];return a[Sb+4>>2]=f}function yv(c,d,i,g){var e=d+496|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),h=d+504|0,l=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),h=d+348|0,k=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),h=d+512|0,h=k*(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),n=d+520|0;0==(a[d+356>>2]|0)?(d=l+g,i=e+i):(d=e+i,i=-(l+g));g=d*k*(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);d=c|0;f[0]=i*h;a[d>>2]=b[0];a[d+4>>2]=b[1];c=c+8|0;f[0]=g;a[c>>2]=b[0];a[c+4>>2]=b[1]}function Re(c,d,i,g){var e=c+496|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),h=c+504|0,h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),l=c+348|0,k=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),l=c+512|0,l=k*(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),n=c+520|0,k=k*(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),n=0<(g|0);if(0==(a[c+356>>2]|0)){if(n){c=0}else{return i}for(;;){var n=(c<<4)+d|0,n=((b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])+e)*l,j=(c<<4)+i|0;f[0]=n;a[j>>2]=b[0];a[j+4>>2]=b[1];n=(c<<4)+d+8|0;n=((b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])+h)*k;j=(c<<4)+i+8|0;f[0]=n;a[j>>2]=b[0];a[j+4>>2]=b[1];c=c+1|0;if((c|0)==(g|0)){break}}}else{if(n){c=0}else{return i}for(;;){var n=(c<<4)+d+8|0,n=l*-((b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])+h),j=(c<<4)+d|0,j=((b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])+e)*k,p=(c<<4)+i+8|0;f[0]=j;a[p>>2]=b[0];a[p+4>>2]=b[1];j=(c<<4)+i|0;f[0]=n;a[j>>2]=b[0];a[j+4>>2]=b[1];c=c+1|0;if((c|0)==(g|0)){break}}}return i}function Bn(b,c){var d,g,f,e=b>>2;d=a[e];eh(d,3,c);g=a[d+92>>2];if(0==(g|0)){return 999}f=a[g+16>>2]>>2;var l=a[f+3];a[e+19]=l;var k=a[f+4];a[e+21]=k;f=a[f];a[e+20]=f;a[e+22]=a[g+4>>2];g=(b+148|0)>>2;k=a[g]|a[k>>2];a[g]=k;var h=a[d+80>>2];if(0==(h|0)){return a[e+15]=0,999}d=a[h+16>>2]>>2;a[e+15]=a[d+3];var j=a[d+4];a[e+17]=j;a[e+18]=a[h+4>>2];a[g]=k|a[j>>2];a[e+16]=0==(l|0)?f:a[d];return 300}function Cr(b){var c=a[b+60>>2];if(0!=(c|0)&&(c=a[c+4>>2],0!=(c|0))){J[c](b)}a[a[b>>2]+24>>2]=0;iK(b)}function Tr(b,c,d){var g=h;h+=4;a[d>>2]=c;a[d+32>>2]=5;a[g>>2]=ZH(c);var f=a[b+12>>2];0!=(f|0)&&0!=(tn(g,f,a[b+16>>2],4,128)|0)||(b=$H(c,d,a[b+20>>2]),1==(b|0)?(b=Cb(Ba(c)+16|0),Ma(b,yK|0,(j=h,h+=4,a[j>>2]=c,j)),0!=(nD(b)|0)&&la(0,zK|0,(j=h,h+=4,a[j>>2]=c,j)),G(b)):0!=(b|0)&&la(1,AK|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)));h=g}function mD(b){var c=a[b+60>>2];if(0!=(c|0)&&(c=a[c+28>>2],0!=(c|0))){J[c](b)}}function xs(b){var c=a[b+60>>2];if(0!=(c|0)&&(c=a[c+40>>2],0!=(c|0))){J[c](b)}}function ys(b){var c=a[b+60>>2];if(0!=(c|0)&&(c=a[c+44>>2],0!=(c|0))){J[c](b)}}function vs(b){var c=a[b+60>>2];if(0!=(c|0)&&(c=a[c+48>>2],0!=(c|0))){J[c](b)}}function ws(b){var c=a[b+60>>2];if(0!=(c|0)&&(c=a[c+52>>2],0!=(c|0))){J[c](b)}}function WE(b){var c=a[b+60>>2];if(0!=(c|0)&&(c=a[c+56>>2],0!=(c|0))){J[c](b)}}function ad(b,c,d,g,f){var e=a[b+60>>2];if(0!=(e|0)&&(e=a[e+72>>2],0!=(e|0))){J[e](b,c,d,g,f)}}function Se(b){var c=a[b+60>>2];if(0!=(c|0)&&(c=a[c+76>>2],0!=(c|0))){J[c](b)}}function bG(b,c){var d=a[b+60>>2];if(0!=(d|0)&&(d=a[d+80>>2],0!=(d|0))){J[d](b,c)}}function cG(b){var c=a[b+60>>2];if(0!=(c|0)&&(c=a[c+84>>2],0!=(c|0))){J[c](b)}}function As(c,d,i,g){var e=h;h+=16;var j=a[c+60>>2],l=a[g>>2];if(0!=(l|0)&&0!=m[l]<<24>>24){l=a[c+16>>2];if(0!=(l|0)&&0==(a[l+88>>2]|0)){h=e;return}0==(a[c+148>>2]&8192|0)&&(yv(e,c,d,i),d=e|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),i=e+8|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]));if(0!=(j|0)&&(j=a[j+88>>2],0!=(j|0))){J[j](c,d,i,g)}}h=e}function Pa(b,c){var d=a[b+60>>2],g=a[b+16>>2]+16|0,f=Jc(c,58),e=0!=(f|0);e&&(m[f]=0);if(0!=(d|0)&&(Tr(a[b+68>>2],c,g),d=a[d+92>>2],0!=(d|0))){J[d](b,g)}e&&(m[f]=58)}function $b(b,c){var d=a[b+60>>2],g=a[b+16>>2]+52|0,f=Jc(c,58),e=0!=(f|0);e&&(m[f]=0);if(0!=(d|0)&&(Tr(a[b+68>>2],c,g),d=a[d+92>>2],0!=(d|0))){J[d](b,g)}e&&(m[f]=58)}function Zr(c,d){if(0!=(a[c+60>>2]|0)){var i=a[c+16>>2]+96|0;f[0]=d;a[i>>2]=b[0];a[i+4>>2]=b[1]}}function BK(b,c,d,g){if(0==(c|0)){c=g=-1}else{var f=a[c+48>>2];0!=(f|0)&&(d=g=f|0);f=g;g=(72*a[c+40>>2]|0)/d&-1;c=(72*a[c+44>>2]|0)/f&-1}a[b>>2]=g;a[b+4>>2]=c}function Ke(c,d){var i,g,e=h,Xa;i=a[c+60>>2];var l=a[c+16>>2];a[l+104>>2]=d;if(!(0==(i|0)|0==(d|0))){var k=a[d>>2];if(0!=(k|0)){g=(l+88|0)>>2;i=(l+96|0)>>2;for(var l=l+92|0,n=d;;){var n=n+4|0,z=m[k];a:do{if(100==z<<24>>24){0==(ka(k,CK|0)|0)?a[g]=1:0==(ka(k,DK|0)|0)?a[g]=2:Xa=102==z<<24>>24?1818:117==z<<24>>24?1820:1822}else{if(115==z<<24>>24){if(0==(ka(k,wp|0)|0)){a[g]=3}else{if(0==(ka(k,Cp|0)|0)){for(var p=k,s=0;;){var v=p+1|0;if(s){break}p=v;s=0==m[v]<<24>>24}p=wg(v,xc);f[0]=p;a[i]=b[0];a[i+1]=b[1]}else{Xa=1822}}}else{if(105==z<<24>>24){do{if(0!=(ka(k,qh|0)|0)&&0!=(ka(k,EK|0)|0)){Xa=98==z<<24>>24?1811:102==z<<24>>24?1818:117==z<<24>>24?1820:1822;break a}}while(0);a[g]=0}else{Xa=98==z<<24>>24?1811:102==z<<24>>24?1818:117==z<<24>>24?1820:1822}}}}while(0);1811==Xa?(Xa=0,0!=(ka(k,Wb|0)|0)?Xa=1822:(f[0]=2,a[i]=b[0],a[i+1]=b[1])):1818==Xa?(Xa=0,0!=(ka(k,Hi|0)|0)?Xa=1822:a[l>>2]=1):1820==Xa&&(Xa=0,0!=(ka(k,FK|0)|0)?Xa=1822:a[l>>2]=0);1822==Xa&&(Xa=0,la(0,GK|0,(j=h,h+=4,a[j>>2]=k,j)));k=a[n>>2];if(0==(k|0)){break}}}}h=e}function Qk(c,d,i){var g,e=h;h+=32;var j=a[c+60>>2];if(0!=(j|0)&&(j=j+96|0,0!=(a[j>>2]|0)&&0!=(a[a[c+16>>2]+88>>2]|0))){var l=d|0;g=d+16|0;var k=g|0,k=.5*((b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])+(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])),l=e|0,n=e|0;f[0]=k;a[n>>2]=b[0];a[n+4>>2]=b[1];k=d+8|0;d=d+24|0;d=.5*((b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])+(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]));k=e+8|0;f[0]=d;a[k>>2]=b[0];a[k+4>>2]=b[1];d=(e+16|0)>>2;g>>=2;a[d]=a[g];a[d+1]=a[g+1];a[d+2]=a[g+2];a[d+3]=a[g+3];0==(a[c+148>>2]&8192|0)&&Re(c,l,l,2);J[a[j>>2]](c,l,i&255)}h=e}function zc(b,c,d,g){var f=a[b+60>>2];if(0!=(f|0)){var f=f+100|0,e=a[f>>2];if(0!=(e|0)&&0!=(a[a[b+16>>2]+88>>2]|0)){if(0!=(a[b+148>>2]&8192|0)){J[e](b,c,d,g&255)}else{(a[Nh>>2]|0)<(d|0)?(e=d+10|0,a[Nh>>2]=e,e=wb(a[Hf>>2],e<<4),a[Hf>>2]=e):e=a[Hf>>2],Re(b,c,e,d),J[a[f>>2]](b,e,d,g&255)}}}}function mh(c,d,i){var g,e,j=h;h+=64;e=d>>2;d=h;h+=32;a[d>>2]=a[e];a[d+4>>2]=a[e+1];a[d+8>>2]=a[e+2];a[d+12>>2]=a[e+3];a[d+16>>2]=a[e+4];a[d+20>>2]=a[e+5];a[d+24>>2]=a[e+6];a[d+28>>2]=a[e+7];g=j>>2;e=d>>2;a[g]=a[e];a[g+1]=a[e+1];a[g+2]=a[e+2];a[g+3]=a[e+3];e=j+32|0;g=e>>2;d=(d+16|0)>>2;a[g]=a[d];a[g+1]=a[d+1];a[g+2]=a[d+2];a[g+3]=a[d+3];d=j|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);g=j+16|0;f[0]=d;a[g>>2]=b[0];a[g+4>>2]=b[1];d=j+40|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);g=j+24|0;f[0]=d;a[g>>2]=b[0];a[g+4>>2]=b[1];e|=0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);d=j+48|0;f[0]=e;a[d>>2]=b[0];a[d+4>>2]=b[1];e=j+8|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);d=j+56|0;f[0]=e;a[d>>2]=b[0];a[d+4>>2]=b[1];zc(c,j|0,4,i);h=j}function $f(b,c,d,g,f,e){var l=a[b+60>>2];if(0!=(l|0)){var l=l+104|0,k=a[l>>2];if(0!=(k|0)&&0!=(a[a[b+16>>2]+88>>2]|0)){if(0!=(a[b+148>>2]&8192|0)){J[k](b,c,d,g,f,e&255)}else{(a[Nh>>2]|0)<(d|0)?(k=d+10|0,a[Nh>>2]=k,k=wb(a[Hf>>2],k<<4),a[Hf>>2]=k):k=a[Hf>>2],Re(b,c,k,d),J[a[l>>2]](b,k,d,g,f,e&255)}}}}function Gd(b,c,d){var g=a[b+60>>2];if(0!=(g|0)){var g=g+108|0,f=a[g>>2];if(0!=(f|0)&&0!=(a[a[b+16>>2]+88>>2]|0)){if(0!=(a[b+148>>2]&8192|0)){J[f](b,c,d)}else{(a[Nh>>2]|0)<(d|0)?(f=d+10|0,a[Nh>>2]=f,f=wb(a[Hf>>2],f<<4),a[Hf>>2]=f):f=a[Hf>>2],Re(b,c,f,d),J[a[g>>2]](b,f,d)}}}}function yk(b,c){var d=a[b+60>>2];if(0!=(c|0)&&!(0==m[c]<<24>>24|0==(d|0))&&(d=a[d+112>>2],0!=(d|0))){J[d](b,c)}}function ut(c,d,i,g,e,Xa){var l,k,n,z,p,s,v,t,u,w=h;h+=72;u=w+32;k=w+40;l=w+56;var A=a[c+60>>2],B=HK(d);if(0==(B|0)){if(!(0==(Is(d)|0)|0==(A|0))&&(B=a[A+116>>2],0!=(B|0))){J[B](c,d,i,g,e&255)}}else{var d=c+424|0,C=c+432|0;BK(u,B,(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]));var C=a[u>>2],y=a[u+4>>2];if(!(1>(C|0)&1>(y|0))){n=w+16|0;u=n>>2;p=i>>2;a[u]=a[p];a[u+1]=a[p+1];a[u+2]=a[p+2];a[u+3]=a[p+3];d=w>>2;a[d]=a[p];a[d+1]=a[p+1];a[d+2]=a[p+2];a[d+3]=a[p+3];if(1<(g|0)){t=(w|0)>>2;v=(w+8|0)>>2;s=(n|0)>>2;p=(w+24|0)>>2;for(var T=(b[0]=a[t],b[1]=a[t+1],f[0]),D=(b[0]=a[v],b[1]=a[v+1],f[0]),F=1,M=T,T=(b[0]=a[s],b[1]=a[s+1],f[0]),X=(b[0]=a[p],b[1]=a[p+1],f[0]);;){z=(F<<4)+i|0;var O=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]),E=M<O?M:O;z=(F<<4)+i+8|0;var G=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]);z=D<G?D:G;O=T>O?T:O;G=X>G?X:G;F=F+1|0;if((F|0)==(g|0)){break}else{M=E,D=z,T=O,X=G}}f[0]=G;a[p]=b[0];a[p+1]=b[1];f[0]=O;a[s]=b[0];a[s+1]=b[1];f[0]=z;a[v]=b[0];a[v+1]=b[1];f[0]=E;a[t]=b[0];a[t+1]=b[1];p=E;E=G;G=z}else{i=n|0,z=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),i=w|0,E=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),g=w+24|0,i=w+8|0,O=z,p=E,E=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),G=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])}z=(n|0)>>2;g=(w|0)>>2;v=O-p;i=(w+24|0)>>2;n=(w+8|0)>>2;s=E-G;y|=0;C|=0;t=v/C;F=s/y;Xa=0==m[Xa]<<24>>24?0:0==(Lb(Xa,rp|0)|0)?2:0==(Lb(Xa,qp|0)|0)?3:0==(Lb(Xa,zv|0)|0)?4:0!=re(Xa)<<24>>24&1;1==(Xa|0)?t<F?(Xa=y*t,C*=t):(Xa=y*F,C*=F):4==(Xa|0)?(Xa=y*F,C*=t):3==(Xa|0)?Xa=y*F:2==(Xa|0)?(Xa=y,C*=t):Xa=y;C<v?(C=.5*(v-C),y=p+C,f[0]=y,a[g]=b[0],a[g+1]=b[1],O-=C,f[0]=O,a[z]=b[0],a[z+1]=b[1],C=y):C=p;y=O;Xa<s?(Xa=.5*(s-Xa),O=G+Xa,f[0]=O,a[n]=b[0],a[n+1]=b[1],f[0]=E-Xa,a[i]=b[0],a[i+1]=b[1],Xa=O):Xa=G;0==(a[c+148>>2]&8192|0)?(yv(k,c,C,Xa),k>>=2,a[d]=a[k],a[d+1]=a[k+1],a[d+2]=a[k+2],a[d+3]=a[k+3],yv(l,c,(b[0]=a[z],b[1]=a[z+1],f[0]),(b[0]=a[i],b[1]=a[i+1],f[0])),l>>=2,a[u]=a[l],a[u+1]=a[l+1],a[u+2]=a[l+2],a[u+3]=a[l+3],l=(b[0]=a[g],b[1]=a[g+1],f[0]),k=(b[0]=a[z],b[1]=a[z+1],f[0])):(l=C,k=y);l>k&&(f[0]=k,a[g]=b[0],a[g+1]=b[1],f[0]=l,a[z]=b[0],a[z+1]=b[1]);l=(b[0]=a[n],b[1]=a[n+1],f[0]);k=(b[0]=a[i],b[1]=a[i+1],f[0]);l>k&&(f[0]=k,a[n]=b[0],a[n+1]=b[1],f[0]=l,a[i]=b[0],a[i+1]=b[1]);if(0!=(A|0)){u=a[c+72>>2];l=h;h+=128;k=w>>2;A=h;h+=32;a[A>>2]=a[k];a[A+4>>2]=a[k+1];a[A+8>>2]=a[k+2];a[A+12>>2]=a[k+3];a[A+16>>2]=a[k+4];a[A+20>>2]=a[k+5];a[A+24>>2]=a[k+6];a[A+28>>2]=a[k+7];k=l|0;Rf(k,a[B+28>>2]);d=l+Ba(k)|0;Pb=58;m[d]=Pb&255;Pb>>=8;m[d+1]=Pb&255;uf(k,u);u=eh(a[c>>2],4,k);0==(u|0)?u=999:(u=a[u+16>>2],a[c+92>>2]=a[u+12>>2],a[c+96>>2]=a[u>>2],u=300);999==(u|0)&&la(0,IK|0,(j=h,h+=4,a[j>>2]=k,j));k=a[c+92>>2];if(0!=(k|0)&&(k=a[k>>2],0!=(k|0))){J[k](c,B,A,e)}h=l}}}h=w}function HK(b){var c=h;h+=64;var d=a[Il>>2];if(0==(d|0)){return h=c,0}a[c+8>>2]=b;b=J[a[d>>2]](d,c,4);h=c;return b}function JK(b){var c=h;0==(b|0)&&sa(Av|0,363,Bv|0,Oh|0);var d=b+8|0;0==(a[d>>2]|0)&&sa(Av|0,364,Bv|0,Ph|0);var g=b+20|0,f=a[g>>2];0==(f|0)?(d=Uk(a[d>>2]),0==(d|0)?b=1:(f=qi(d,cj|0),a[g>>2]=f,0==(f|0)?(b=si(a[Ea.c>>2]),la(0,KK|0,(j=h,h+=8,a[j>>2]=b,a[j+4>>2]=d,j)),b=0):(g=a[Cv>>2],49<(g|0)?m[b+17|0]=1:a[Cv>>2]=g+1|0,b=1))):(xg(f,0,0),b=1);h=c;return b}function LK(b){if(0!=m[b+17|0]<<24>>24){var b=b+20|0,c=a[b>>2];0!=(c|0)&&(ri(c),a[b>>2]=0)}}function oH(c,d,i){0!=(i|0)&&0!=m[i]<<24>>24?(d=a[d+44>>2]+24|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),d=1>d?96:d,BK(c,MK(i),d,d)):(a[c>>2]=-1,a[c+4>>2]=-1)}function MK(b){var c=h;if(0==(a[Il>>2]|0)){var d=Nc(NK,a[Xc>>2]);a[Il>>2]=d}d=HK(b);if(0==(d|0)){d=fa(64);if(0==(d|0)){return h=c,0}var g=d+8|0;a[g>>2]=b;if(0==JK(d)<<24>>24){return h=c,0}b=OK(d);if(4==(b|0)){PK(d)}else{if(3==(b|0)){var f,b=h;h+=8;g=b+4;a[d+48>>2]=0;f=(d+20|0)>>2;xg(a[f],16,0);0!=If(a[f],4,b)<<24>>24&&0!=If(a[f],4,g)<<24>>24&&(a[d+40>>2]=a[b>>2],a[d+44>>2]=a[g>>2]);h=b}else{if(0==(b|0)){return f=a[g>>2],b=Is(f),a[d+52>>2]=b,0==(b|0)&&la(0,QK|0,(j=h,h+=4,a[j>>2]=f,j)),G(d),h=c,0}if(6==(b|0)){b=d>>2;g=h;h+=1040;var e=g+1024,l=g+1028,k=g+1032,n=g+1036;a[b+12]=72;var m=d+20|0;xg(a[m>>2],0,0);for(var p=g|0;;){if(0==(oi(p,1024,a[m>>2])|0)){f=2073;break}var s=un(p,RK|0);if(0!=(s|0)&&4==(Cd(s,Nu|0,(j=h,h+=16,a[j>>2]=e,a[j+4>>2]=l,a[j+8>>2]=k,a[j+12>>2]=n,j))|0)){break}}2073!=f&&(f=a[e>>2],a[b+8]=f,l=a[l>>2],a[b+9]=l,a[b+10]=a[k>>2]-f|0,a[b+11]=a[n>>2]-l|0);h=g}else{1==(b|0)?(b=h,h+=16,g=b+4,k=b+8,n=b+12,a[d+48>>2]=0,f=(d+20|0)>>2,xg(a[f],16,0),0!=hj(a[f],b)<<24>>24&&0!=hj(a[f],g)<<24>>24&&0!=hj(a[f],k)<<24>>24&&0!=hj(a[f],n)<<24>>24&&(a[d+40>>2]=a[b>>2]<<16|a[g>>2],a[d+44>>2]=a[k>>2]<<16|a[n>>2]),h=b):2==(b|0)?(b=h,h+=8,g=b+4,a[d+48>>2]=0,f=(d+20|0)>>2,xg(a[f],6,0),0!=hj(a[f],b)<<24>>24&&0!=hj(a[f],g)<<24>>24&&(a[d+40>>2]=a[b>>2],a[d+44>>2]=a[g>>2]),h=b):8==(b|0)&&SK(d)}}}f=a[Il>>2];J[a[f>>2]](f,d,1)}LK(d);h=c;return d}function OK(b){var c=h;h+=220;var d,g=c+20,f=b+20|0,e=a[f>>2],l=0==(e|0);a:do{if(!l){var k=c|0;if(20==(lC(k,1,20,e)|0)){var e=b+28|0,l=b+24|0,g=g|0,n=0;b:for(;;){if(8<=n>>>0){break a}var j=0==(Ve(k,a[Qc+(n<<4)>>2],a[Qc+(n<<4)+4>>2])|0);c:do{if(j){a[e>>2]=a[Qc+(n<<4)+12>>2];var p=a[Qc+(n<<4)+8>>2];a[l>>2]=p;if(7!=(n|0)){var m=p;d=2012;break b}for(;;){if(0==(oi(g,200,a[f>>2])|0)){break c}if(0==(Ve(g,TK|0,4)|0)){break b}}}}while(0);n=n+1|0}if(2012==d){return h=c,m}a[e>>2]=Dp|0;m=a[l>>2]=8;h=c;return m}}}while(0);a[b+28>>2]=UK|0;a[b+24>>2]=0;h=c;return 0}function PK(b){var c=b>>2,d=h;h+=20;var g,f=d+4,e=d+8,l=d+12,k=d+16;a[c+12]=0;for(b=(b+20|0)>>2;;){if(0==If(a[b],1,d)<<24>>24){g=2057;break}var n=a[d>>2];if(255!=(n|0)&&0==(Jc(VK|0,n)|0)){if(192==(n|0)){g=2044;break}var j=a[b];if(194==(n|0)){g=2049;break}if(0==If(j,2,f)<<24>>24){g=2064;break}xg(a[b],a[f>>2]-2|0,1)}}2064==g?h=d:2049==g?(0!=If(j,3,k)<<24>>24&&0!=If(a[b],2,e)<<24>>24&&0!=If(a[b],2,l)<<24>>24&&(a[c+11]=a[e>>2],a[c+10]=a[l>>2]),h=d):2044==g?(0!=If(a[b],3,k)<<24>>24&&0!=If(a[b],2,e)<<24>>24&&0!=If(a[b],2,l)<<24>>24&&(a[c+11]=a[e>>2],a[c+10]=a[l>>2]),h=d):2057==g&&(h=d)}function SK(c){var d,i=h;h+=220;var g;d=i>>2;var e=c+20|0,Xa=i+20|0;xg(a[e>>2],-Ba(Xa)|0,1);var l=i+8|0,k=0,n=0,z=0,p=0;a:for(;;){if(0==(oi(Xa,200,a[e>>2])|0)){g=2087;break}if(!(0==p<<24>>24|0==k<<24>>24)){g=2086;break}for(var s=k,v=n,t=z,u=he(Xa,gc|0),w=p;;){if(0==(u|0)){k=s;n=v;z=t;p=w;continue a}if(62==m[u+(Ba(u)-1)|0]<<24>>24){k=s;n=v;z=t;p=w;continue a}if(2==(Cd(u,WK|0,(j=h,h+=8,a[j>>2]=i,a[j+4>>2]=l,j))|0)){if(v=Dv((b[0]=a[d],b[1]=a[d+1],f[0]),l),0==s<<24>>24){w=1}else{k=s;n=v;z=t;p=1;continue a}}if(2==(Cd(u,XK|0,(j=h,h+=8,a[j>>2]=i,a[j+4>>2]=l,j))|0)){if(t=Dv((b[0]=a[d],b[1]=a[d+1],f[0]),l),0==w<<24>>24){s=1}else{k=1;n=v;z=t;p=w;continue a}}u=he(0,gc|0)}}2087==g?(a[(c+48|0)>>2]=72,a[(c+40|0)>>2]=n,a[(c+44|0)>>2]=z,h=i):2086==g&&(a[(c+48|0)>>2]=72,a[(c+40|0)>>2]=n,a[(c+44|0)>>2]=z,h=i)}function Dv(a,b){if(0==(ka(b,Ep|0)|0)){var c=72*a;return(0>c?c-.5:c+.5)&-1}if(0==(ka(b,YK|0)|0)){return c=72*a/96,(0>c?c-.5:c+.5)&-1}if(0==(ka(b,ZK|0)|0)){return c=72*a/6,(0>c?c-.5:c+.5)&-1}if(0!=(ka(b,$K|0)|0)&&0!=(ka(b,ue|0)|0)){if(0==(ka(b,aL|0)|0)){return c=28.346456664*a,(0>c?c-.5:c+.5)&-1}if(0!=(ka(b,bL|0)|0)){return 0}c=2.8346456663999997*a;return(0>c?c-.5:c+.5)&-1}return(0>a?a-.5:a+.5)&-1}function If(b,c,d){for(var g,f=a[d>>2]=0;;){if(f>>>0>=c>>>0){var e=1;g=2133;break}var l=ni(b);if(0!=(Number(Q.a[b]&&Q.a[b].f)|0)){e=0;g=2132;break}a[d>>2]=a[d>>2]<<8|l;f=f+1|0}if(2132==g||2133==g){return e}}function hj(b,c){for(var d,g=a[c>>2]=0;;){if(2<=g>>>0){var f=1;d=2139;break}var e=ni(b);if(0!=(Number(Q.a[b]&&Q.a[b].f)|0)){f=0;d=2140;break}a[c>>2]|=e<<(g<<3);g=g+1|0}if(2139==d||2140==d){return f}}function cL(a){var b=1-a;return 3*a*b*b}function Jf(c,d,i,g){var e=c|0;f[0]=d*g;a[e>>2]=b[0];a[e+4>>2]=b[1];c=c+8|0;f[0]=i*g;a[c>>2]=b[0];a[c+4>>2]=b[1]}function Ev(c,d,i,g,e){var h=c|0;f[0]=d+g;a[h>>2]=b[0];a[h+4>>2]=b[1];c=c+8|0;f[0]=i+e;a[c>>2]=b[0];a[c+4>>2]=b[1]}function Fp(c,d,i,g,e){var h=c|0;f[0]=d-g;a[h>>2]=b[0];a[h+4>>2]=b[1];c=c+8|0;f[0]=i-e;a[c>>2]=b[0];a[c+4>>2]=b[1]}function ZG(c,d,i,g,e,j){var l,k,n,m,p,s=h;h+=32;l=s+16;p=(e|0)>>2;m=(e+8|0)>>2;Jl(s,(b[0]=a[p],b[1]=a[p+1],f[0]),(b[0]=a[m],b[1]=a[m+1],f[0]));k=e>>2;n=s>>2;a[k]=a[n];a[k+1]=a[n+1];a[k+2]=a[n+2];a[k+3]=a[n+3];k=e+16|0;n=(k|0)>>2;e=(e+24|0)>>2;Jl(l,(b[0]=a[n],b[1]=a[n+1],f[0]),(b[0]=a[e],b[1]=a[e+1],f[0]));k>>=2;l>>=2;a[k]=a[l];a[k+1]=a[l+1];a[k+2]=a[l+2];a[k+3]=a[l+3];a[ge>>2]=0;Fv(4);l=a[ge>>2];a[ge>>2]=l+1|0;k=((l<<4)+a[Lg>>2]|0)>>2;l=i>>2;a[k]=a[l];a[k+1]=a[l+1];a[k+2]=a[l+2];a[k+3]=a[l+3];p=(b[0]=a[p],b[1]=a[p+1],f[0]);m=(b[0]=a[m],b[1]=a[m+1],f[0]);if(-1==(Gp(c,d,i,g,p,m,(b[0]=a[n],b[1]=a[n+1],f[0]),(b[0]=a[e],b[1]=a[e+1],f[0]))|0)){return h=s,-1}a[j+4>>2]=a[ge>>2];a[j>>2]=a[Lg>>2];h=s;return 0}function Jl(c,d,i){var g=d*d+i*i;1e-6<g&&(g=$c(g),d/=g,i/=g);g=c|0;f[0]=d;a[g>>2]=b[0];a[g+4>>2]=b[1];c=c+8|0;f[0]=i;a[c>>2]=b[0];a[c+4>>2]=b[1]}function Gp(c,d,i,g,e,j,l,k){var n,m,p,s,v,t,u,w,A=h;h+=256;var B=A+16,C=A+32,y=A+48,T=A+64,D=A+80,F=A+96,M=A+112,X=A+128,O=A+144,E=A+160,G=A+176,ia=A+192,J=A+208,I=A+224,H=A+240,K=a[Kl>>2];if((a[Gv>>2]|0)<(g|0)){if(0==(K|0)){var L=Gb(40*g|0);a[Kl>>2]=L;if(0==(L|0)){var N=-1;h=A;return N}var Q=L}else{var S=mc(K,40*g|0);a[Kl>>2]=S;if(0==(S|0)){return N=-1,h=A,N}Q=S}a[Gv>>2]=g;var ca=Q}else{ca=K}var R=ca|0;f[0]=0;a[R>>2]=b[0];a[R+4>>2]=b[1];var U=1<(g|0);a:do{if(U){for(var W=1,ja=0;;){var aa=W-1|0,da=(W<<4)+i|0,ea=(b[0]=a[da>>2],b[1]=a[da+4>>2],f[0]),xa=(W<<4)+i+8|0,Z=(b[0]=a[xa>>2],b[1]=a[xa+4>>2],f[0]),Y=(aa<<4)+i|0,ha=(aa<<4)+i+8|0,ga=ja+Hv(ea,Z,(b[0]=a[Y>>2],b[1]=a[Y+4>>2],f[0]),(b[0]=a[ha>>2],b[1]=a[ha+4>>2],f[0])),V=ca+40*W|0;f[0]=ga;a[V>>2]=b[0];a[V+4>>2]=b[1];var $=W+1|0;if(($|0)==(g|0)){break}else{W=$,ja=ga}}for(var la=ca+40*(g-1)|0,ba=1;;){var ya=(b[0]=a[la>>2],b[1]=a[la+4>>2],f[0]);w=(ca+40*ba|0)>>2;var sa=(b[0]=a[w],b[1]=a[w+1],f[0])/ya;f[0]=sa;a[w]=b[0];a[w+1]=b[1];var wa=ba+1|0;if((wa|0)==(g|0)){break a}else{ba=wa}}}}while(0);var Ab=0<(g|0);a:do{if(Ab){u=T>>2;t=D>>2;for(var Fa=0;;){v=(ca+40*Fa|0)>>2;Jf(T,e,j,cL((b[0]=a[v],b[1]=a[v+1],f[0])));s=(ca+40*Fa+8|0)>>2;a[s]=a[u];a[s+1]=a[u+1];a[s+2]=a[u+2];a[s+3]=a[u+3];var Ga=D,fa=l,ta=k,Ka=(b[0]=a[v],b[1]=a[v+1],f[0]);Jf(Ga,fa,ta,3*Ka*Ka*(1-Ka));p=(ca+40*Fa+24|0)>>2;a[p]=a[t];a[p+1]=a[t+1];a[p+2]=a[t+2];a[p+3]=a[t+3];var za=Fa+1|0;if((za|0)==(g|0)){break a}else{Fa=za}}}}while(0);dL(i,g,ca,e,j,l,k,A,C,B,y);var ma=A|0,pa=(b[0]=a[ma>>2],b[1]=a[ma+4>>2],f[0]),ra=A+8|0,Ha=(b[0]=a[ra>>2],b[1]=a[ra+4>>2],f[0]),Ra=C|0,ka=(b[0]=a[Ra>>2],b[1]=a[Ra+4>>2],f[0]),qa=C+8|0,La=(b[0]=a[qa>>2],b[1]=a[qa+4>>2],f[0]),na=B|0,Ya=(b[0]=a[na>>2],b[1]=a[na+4>>2],f[0]),oa=B+8|0,Za=(b[0]=a[oa>>2],b[1]=a[oa+4>>2],f[0]),Ba=y|0,ab=(b[0]=a[Ba>>2],b[1]=a[Ba+4>>2],f[0]),$a=y+8|0,jb=(b[0]=a[$a>>2],b[1]=a[$a+4>>2],f[0]);if(0!=(eL(c,d,pa,Ha,ka,La,Ya,Za,ab,jb,i,g)|0)){return N=0,h=A,N}Jf(F,ka,La,.3333333333333333);var Ca=F|0,Ia=F+8|0;Ev(M,pa,Ha,(b[0]=a[Ca>>2],b[1]=a[Ca+4>>2],f[0]),(b[0]=a[Ia>>2],b[1]=a[Ia+4>>2],f[0]));var eb=M|0,ub=(b[0]=a[eb>>2],b[1]=a[eb+4>>2],f[0]),Sa=M+8|0,va=(b[0]=a[Sa>>2],b[1]=a[Sa+4>>2],f[0]);Jf(X,ab,jb,.3333333333333333);var ua=X|0,Oa=X+8|0;Fp(O,Ya,Za,(b[0]=a[ua>>2],b[1]=a[ua+4>>2],f[0]),(b[0]=a[Oa>>2],b[1]=a[Oa+4>>2],f[0]));var Wa=O|0,pb=(b[0]=a[Wa>>2],b[1]=a[Wa+4>>2],f[0]),ob=O+8|0,bb=(b[0]=a[ob>>2],b[1]=a[ob+4>>2],f[0]),qb=g-1|0,Aa=1<(qb|0);a:do{if(Aa){for(var kb=a[Kl>>2],Ea=-1,vb=-1,xb=1;;){var Qa=kb+40*xb|0,nb=(b[0]=a[Qa>>2],b[1]=a[Qa+4>>2],f[0]),rb,lb=1-nb;rb=lb*lb*lb;var Ta=cL(nb),cb=3*nb*nb*(1-nb),fb=nb*nb*nb,Ua=(xb<<4)+i|0,sb=(xb<<4)+i+8|0,Na=Hv(rb*pa+Ta*ub+cb*pb+fb*Ya,rb*Ha+Ta*va+cb*bb+fb*Za,(b[0]=a[Ua>>2],b[1]=a[Ua+4>>2],f[0]),(b[0]=a[sb>>2],b[1]=a[sb+4>>2],f[0])),Fb=Na>Ea,Db=Fb?xb:vb,Ob=xb+1|0;if((Ob|0)==(qb|0)){var Eb=Db;break a}else{Ea=Fb?Na:Ea,vb=Db,xb=Ob}}}else{Eb=-1}}while(0);var Ma=(Eb<<4)+i|0,Bb=Eb-1|0;m=(Ma|0)>>2;var Ja=(b[0]=a[m],b[1]=a[m+1],f[0]);n=((Eb<<4)+i+8|0)>>2;var Va=(b[0]=a[n],b[1]=a[n+1],f[0]),Cb=(Bb<<4)+i|0,wb=(Bb<<4)+i+8|0;Fp(E,Ja,Va,(b[0]=a[Cb>>2],b[1]=a[Cb+4>>2],f[0]),(b[0]=a[wb>>2],b[1]=a[wb+4>>2],f[0]));var Pa=E|0,hb=E+8|0;Jl(G,(b[0]=a[Pa>>2],b[1]=a[Pa+4>>2],f[0]),(b[0]=a[hb>>2],b[1]=a[hb+4>>2],f[0]));var ib=G|0,ic=(b[0]=a[ib>>2],b[1]=a[ib+4>>2],f[0]),db=G+8|0,Ib=(b[0]=a[db>>2],b[1]=a[db+4>>2],f[0]),yb=Eb+1|0,mb=(yb<<4)+i|0,Kb=(b[0]=a[mb>>2],b[1]=a[mb+4>>2],f[0]),pc=(yb<<4)+i+8|0,Jb=(b[0]=a[pc>>2],b[1]=a[pc+4>>2],f[0]);Fp(ia,Kb,Jb,(b[0]=a[m],b[1]=a[m+1],f[0]),(b[0]=a[n],b[1]=a[n+1],f[0]));var Vb=ia|0,Hb=ia+8|0;Jl(J,(b[0]=a[Vb>>2],b[1]=a[Vb+4>>2],f[0]),(b[0]=a[Hb>>2],b[1]=a[Hb+4>>2],f[0]));var Lb=J|0,Mb=J+8|0;Ev(I,ic,Ib,(b[0]=a[Lb>>2],b[1]=a[Lb+4>>2],f[0]),(b[0]=a[Mb>>2],b[1]=a[Mb+4>>2],f[0]));var Nb=I|0,Pb=I+8|0;Jl(H,(b[0]=a[Nb>>2],b[1]=a[Nb+4>>2],f[0]),(b[0]=a[Pb>>2],b[1]=a[Pb+4>>2],f[0]));var Wb=H|0,lc=(b[0]=a[Wb>>2],b[1]=a[Wb+4>>2],f[0]),Tb=H+8|0,Yb=(b[0]=a[Tb>>2],b[1]=a[Tb+4>>2],f[0]);Gp(c,d,i,yb,e,j,lc,Yb);Gp(c,d,Ma,g-Eb|0,lc,Yb,l,k);N=0;h=A;return N}function Hv(a,b,c,d){a=c-a;b=d-b;return $c(a*a+b*b)}function dL(c,d,i,g,e,j,l,k,n,m,p){var s,v,t,u,w,A,B,C,y,T,D,F,M,X=h;h+=96;var O=X+16,E=X+32,G=X+48,ia=X+64,J=X+80,I=0<(d|0);a:do{if(I){for(var H=c|0,K=c+8|0,L=d-1|0,N=(L<<4)+c|0,S=(L<<4)+c+8|0,Q=O|0,ca=O+8|0,R=E|0,U=E+8|0,W=X|0,ja=X+8|0,aa=G|0,da=G+8|0,ea=0,xa=0,Y=0,Z=0,ha=0,ga=0;;){M=(i+40*ga+8|0)>>2;var V=(b[0]=a[M],b[1]=a[M+1],f[0]);F=(i+40*ga+16|0)>>2;var $=(b[0]=a[F],b[1]=a[F+1],f[0]),la=ea+(V*V+$*$);D=(i+40*ga+24|0)>>2;var ba=(b[0]=a[D],b[1]=a[D+1],f[0]);T=(i+40*ga+32|0)>>2;var ya=(b[0]=a[T],b[1]=a[T+1],f[0]),sa=xa+(V*ba+$*ya),wa=Y+(ba*ba+ya*ya);y=(i+40*ga|0)>>2;var fa,Fa=(b[0]=a[y],b[1]=a[y+1],f[0]),Ga=1-Fa;fa=Ga*Ga*(Ga+3*Fa);Jf(O,(b[0]=a[H>>2],b[1]=a[H+4>>2],f[0]),(b[0]=a[K>>2],b[1]=a[K+4>>2],f[0]),fa);var ra,ta=(b[0]=a[y],b[1]=a[y+1],f[0]);ra=ta*ta*(3*(1-ta)+ta);Jf(E,(b[0]=a[N>>2],b[1]=a[N+4>>2],f[0]),(b[0]=a[S>>2],b[1]=a[S+4>>2],f[0]),ra);var Ka=(b[0]=a[Q>>2],b[1]=a[Q+4>>2],f[0]),za=(b[0]=a[ca>>2],b[1]=a[ca+4>>2],f[0]);Ev(X,Ka,za,(b[0]=a[R>>2],b[1]=a[R+4>>2],f[0]),(b[0]=a[U>>2],b[1]=a[U+4>>2],f[0]));var ma=(ga<<4)+c|0,pa=(b[0]=a[ma>>2],b[1]=a[ma+4>>2],f[0]),ka=(ga<<4)+c+8|0,Ha=(b[0]=a[ka>>2],b[1]=a[ka+4>>2],f[0]);Fp(G,pa,Ha,(b[0]=a[W>>2],b[1]=a[W+4>>2],f[0]),(b[0]=a[ja>>2],b[1]=a[ja+4>>2],f[0]));var Ra=(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]),qa=(b[0]=a[da>>2],b[1]=a[da+4>>2],f[0]),na=Z,La=(b[0]=a[M],b[1]=a[M+1],f[0]),oa=(b[0]=a[F],b[1]=a[F+1],f[0]),Ya=na+(La*Ra+oa*qa),Ba=ha,Za=(b[0]=a[D],b[1]=a[D+1],f[0]),va=(b[0]=a[T],b[1]=a[T+1],f[0]),ab=Ba+(Za*Ra+va*qa),$a=ga+1|0;if(($a|0)==(d|0)){var jb=la,Ca=sa,Ia=wa,eb=Ya,ub=ab;break a}else{ea=la,xa=sa,Y=wa,Z=Ya,ha=ab,ga=$a}}}else{ub=eb=Ia=Ca=jb=0}}while(0);var Sa=jb*Ia-Ca*Ca,Ea=0<=Sa;if(1e-6>(Ea?Sa:-Sa)){var ua=0,Oa=0}else{ua=(jb*ub-Ca*eb)/Sa,Oa=(eb*Ia-ub*Ca)/Sa}var Wa=d-1|0;if(1e-6<=(Ea?Sa:-Sa)&0<Oa&0<ua){var pb=ua,ob=Oa,bb=k;C=bb>>2;var qb=c;B=qb>>2;a[C]=a[B];a[C+1]=a[B+1];a[C+2]=a[B+2];a[C+3]=a[B+3];Jf(ia,g,e,ob);var Aa=n;A=Aa>>2;var kb=ia;w=kb>>2;a[A]=a[w];a[A+1]=a[w+1];a[A+2]=a[w+2];a[A+3]=a[w+3];var Qa=(Wa<<4)+c|0,vb=m;u=vb>>2;var xb=Qa;t=xb>>2;a[u]=a[t];a[u+1]=a[t+1];a[u+2]=a[t+2];a[u+3]=a[t+3];Jf(J,j,l,pb);var Ma=p;v=Ma>>2;var nb=J}else{var rb=c|0,lb=(b[0]=a[rb>>2],b[1]=a[rb+4>>2],f[0]),Ta=c+8|0,cb=(b[0]=a[Ta>>2],b[1]=a[Ta+4>>2],f[0]),fb=(Wa<<4)+c|0,Ua=(Wa<<4)+c+8|0,sb=Hv(lb,cb,(b[0]=a[fb>>2],b[1]=a[fb+4>>2],f[0]),(b[0]=a[Ua>>2],b[1]=a[Ua+4>>2],f[0]))/3,ob=pb=sb,bb=k;C=bb>>2;qb=c;B=qb>>2;a[C]=a[B];a[C+1]=a[B+1];a[C+2]=a[B+2];a[C+3]=a[B+3];Jf(ia,g,e,ob);Aa=n;A=Aa>>2;kb=ia;w=kb>>2;a[A]=a[w];a[A+1]=a[w+1];a[A+2]=a[w+2];a[A+3]=a[w+3];Qa=(Wa<<4)+c|0;vb=m;u=vb>>2;xb=Qa;t=xb>>2;a[u]=a[t];a[u+1]=a[t+1];a[u+2]=a[t+2];a[u+3]=a[t+3];Jf(J,j,l,pb);Ma=p;v=Ma>>2;nb=J}s=nb>>2;a[v]=a[s];a[v+1]=a[s+1];a[v+2]=a[s+2];a[v+3]=a[s+3];h=X}function eL(c,d,i,g,e,j,l,k,n,m,p,s){var v,t,u,w,A,B,C=h;h+=64;var y,T=2==(s|0),D=C|0,F=C|0,M=C+8|0;B=(C+16|0)>>2;A=(C+24|0)>>2;w=(C+32|0)>>2;u=(C+40|0)>>2;t=(C+48|0)>>2;v=(C+56|0)>>2;for(var E=1,O=4,G=4;;){f[0]=i;a[F>>2]=b[0];a[F+4>>2]=b[1];f[0]=g;a[M>>2]=b[0];a[M+4>>2]=b[1];f[0]=G*e/3+i;a[B]=b[0];a[B+1]=b[1];f[0]=G*j/3+g;a[A]=b[0];a[A+1]=b[1];f[0]=l-O*n/3;a[w]=b[0];a[w+1]=b[1];f[0]=k-O*m/3;a[u]=b[0];a[u+1]=b[1];f[0]=l;a[t]=b[0];a[t+1]=b[1];f[0]=k;a[v]=b[0];a[v+1]=b[1];if(E&&fL(D,4)<fL(p,s)-.001){var J=0;y=2268;break}if(0!=(gL(c,d,D)|0)){y=2259;break}if(0==G&0==O){y=2261;break}.01<G?(E=0,O*=.5,G*=.5):G=O=E=0}if(2259==y){return Fv(a[ge>>2]+4|0),d=a[Lg>>2],c=a[ge>>2],B=(b[0]=a[B],b[1]=a[B+1],f[0]),i=(c<<4)+d|0,f[0]=B,a[i>>2]=b[0],a[i+4>>2]=b[1],B=(b[0]=a[A],b[1]=a[A+1],f[0]),A=c+1|0,i=(c<<4)+d+8|0,f[0]=B,a[i>>2]=b[0],a[i+4>>2]=b[1],w=(b[0]=a[w],b[1]=a[w+1],f[0]),B=(A<<4)+d|0,f[0]=w,a[B>>2]=b[0],a[B+4>>2]=b[1],w=(b[0]=a[u],b[1]=a[u+1],f[0]),u=c+2|0,A=(A<<4)+d+8|0,f[0]=w,a[A>>2]=b[0],a[A+4>>2]=b[1],t=(b[0]=a[t],b[1]=a[t+1],f[0]),w=(u<<4)+d|0,f[0]=t,a[w>>2]=b[0],a[w+4>>2]=b[1],v=(b[0]=a[v],b[1]=a[v+1],f[0]),t=(u<<4)+d+8|0,f[0]=v,a[t>>2]=b[0],a[t+4>>2]=b[1],a[ge>>2]=c+3|0,h=C,1}if(2268==y){return h=C,J}if(2261==y){if(!T){return h=C,0}Fv(a[ge>>2]+4|0);d=a[Lg>>2];c=a[ge>>2];B=(b[0]=a[B],b[1]=a[B+1],f[0]);i=(c<<4)+d|0;f[0]=B;a[i>>2]=b[0];a[i+4>>2]=b[1];B=(b[0]=a[A],b[1]=a[A+1],f[0]);A=c+1|0;i=(c<<4)+d+8|0;f[0]=B;a[i>>2]=b[0];a[i+4>>2]=b[1];w=(b[0]=a[w],b[1]=a[w+1],f[0]);B=(A<<4)+d|0;f[0]=w;a[B>>2]=b[0];a[B+4>>2]=b[1];w=(b[0]=a[u],b[1]=a[u+1],f[0]);u=c+2|0;A=(A<<4)+d+8|0;f[0]=w;a[A>>2]=b[0];a[A+4>>2]=b[1];t=(b[0]=a[t],b[1]=a[t+1],f[0]);w=(u<<4)+d|0;f[0]=t;a[w>>2]=b[0];a[w+4>>2]=b[1];v=(b[0]=a[v],b[1]=a[v+1],f[0]);t=(u<<4)+d+8|0;f[0]=v;a[t>>2]=b[0];a[t+4>>2]=b[1];a[ge>>2]=c+3|0;h=C;return 1}}function Fv(b){var c=h;if((a[Iv>>2]|0)<(b|0)){var d=a[Lg>>2];0==(d|0)?(d=Gb(b<<4),a[Lg>>2]=d,0==(d|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Jv|0,a[j+4>>2]=519,a[j+8>>2]=Kv|0,j)),S())):(d=mc(d,b<<4),a[Lg>>2]=d,0==(d|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Jv|0,a[j+4>>2]=525,a[j+8>>2]=Lv|0,j)),S()));a[Iv>>2]=b}h=c}function Ll(c,d,i,g,e){var i=3*i,h=e+24|0;f[0]=3*d+g-(i+c);a[h>>2]=b[0];a[h+4>>2]=b[1];g=e+16|0;f[0]=3*c+i-6*d;a[g>>2]=b[0];a[g+4>>2]=b[1];g=e+8|0;f[0]=3*(d-c);a[g>>2]=b[0];a[g+4>>2]=b[1];f[0]=c;a[e>>2]=b[0];a[e+4>>2]=b[1]}function Ml(c,d,i){0<=c&1>=c&&(d=(a[i>>2]<<3)+d|0,f[0]=c,a[d>>2]=b[0],a[d+4>>2]=b[1],a[i>>2]=a[i>>2]+1|0)}function fL(c,d){if(1>=(d|0)){var i;return 0}for(var g=c|0,e=c+8|0,h=1,l=0,k=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),n=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);;){if(e=(h<<4)+c|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),k=e-k,g=(h<<4)+c+8|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),n=g-n,l+=$c(k*k+n*n),h=h+1|0,(h|0)==(d|0)){i=l;break}else{k=e,n=g}}return i}function gL(c,d,i){var g,e,j,l=h;h+=64;var k,n=l+32,m=n|0;j=n>>2;var p=n+16|0;e=p>>2;var s=l|0,v=i|0,t=i+16|0,u=i+32|0,w=i+48|0,A=i+8|0,B=i+24|0,C=i+40|0,y=i+56|0,T=n|0,D=n+8|0,p=p|0,n=n+24|0,F=0;a:for(;;){if((F|0)>=(d|0)){var M=1;k=2306;break}g=((F<<5)+c|0)>>2;a[j]=a[g];a[j+1]=a[g+1];a[j+2]=a[g+2];a[j+3]=a[g+3];g=((F<<5)+c+16|0)>>2;a[e]=a[g];a[e+1]=a[g+1];a[e+2]=a[g+2];a[e+3]=a[g+3];g=hL(i,m,s);var E=4==(g|0);b:do{if(!E){for(var O=(b[0]=a[T>>2],b[1]=a[T+4>>2],f[0]),G=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),J=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),ia=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),H=0;;){if((H|0)>=(g|0)){break b}var I=(H<<3)+l|0,I=(b[0]=a[I>>2],b[1]=a[I+4>>2],f[0]);do{if(!(1e-6>I|.999999<I)){var K=I*I*I,L=3*I,N=1-I,S=L*I*N,L=L*N*N,Q=N*N*N,N=Q*(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0])+L*(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])+S*(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])+K*(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),K=Q*(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])+L*(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0])+S*(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0])+K*(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),S=N-O,L=K-G;if(.001<=S*S+L*L&&(N-=J,K-=ia,.001<=N*N+K*K)){M=0;k=2307;break a}}}while(0);H=H+1|0}}}while(0);F=F+1|0}if(2306==k||2307==k){return h=l,M}}function hL(c,d,i){var g,e,j,l,k,n=h;h+=84;var m=n+32;l=n+56;var p=n+80;k=p>>2;var s=d|0,v=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),s=d+16|0;g=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0])-v;s=d+8|0;s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]);d=d+24|0;j=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])-s;a[k]=0;if(0!=g){var t=j/g,d=c+8|0;l=(c|0)>>2;var u=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])-t*(b[0]=a[l],b[1]=a[l+1],f[0]);j=c+24|0;var d=(c+16|0)>>2,w=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])-t*(b[0]=a[d],b[1]=a[d+1],f[0]);e=c+40|0;j=(c+32|0)>>2;var A=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])-t*(b[0]=a[j],b[1]=a[j+1],f[0]),B=c+56|0;e=(c+48|0)>>2;var C=n|0,c=C>>2;Ll(u,w,A,(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0])-t*(b[0]=a[e],b[1]=a[e+1],f[0]),C);s=(b[0]=a[c],b[1]=a[c+1],f[0])+(t*v-s);f[0]=s;a[c]=b[0];a[c+1]=b[1];s=Hp(C,m|0);if(4==(s|0)){return h=n,4}if(0>=(s|0)){return h=n,0}t=n+8|0;u=n+16|0;w=n+24|0;for(A=0;;){B=(A<<3)+m|0;B=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]);if(0<=B&1>=B){var y=(b[0]=a[l],b[1]=a[l+1],f[0]),T=(b[0]=a[d],b[1]=a[d+1],f[0]);Ll(y,T,(b[0]=a[j],b[1]=a[j+1],f[0]),(b[0]=a[e],b[1]=a[e+1],f[0]),C);y=(b[0]=a[c],b[1]=a[c+1],f[0]);T=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]);y=(y+B*(T+B*((b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])+B*(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0])))-v)/g;0<=y&1>=y&&Ml(B,i,p)}A=A+1|0;if((A|0)==(s|0)){break}}i=a[k];h=n;return i}e=0==j;g=c|0;C=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);g=c+16|0;t=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);u=c+32|0;w=c+48|0;d=n|0;g=d>>2;Ll(C,t,(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),d);v=(b[0]=a[g],b[1]=a[g+1],f[0])-v;f[0]=v;a[g]=b[0];a[g+1]=b[1];v=Hp(d,m|0);if(!e){if(4==(v|0)){return h=n,4}if(0>=(v|0)){return h=n,0}l=c+8|0;e=c+24|0;C=c+40|0;c=c+56|0;t=n+8|0;u=n+16|0;w=n+24|0;for(A=0;!(B=(A<<3)+m|0,B=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),0<=B&1>=B&&(y=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),T=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),Ll(y,T,(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),d),y=(b[0]=a[g],b[1]=a[g+1],f[0]),T=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),y=(y+B*(T+B*((b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])+B*(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0])))-s)/j,0<=y&1>=y&&Ml(B,i,p)),A=A+1|0,(A|0)==(v|0));){}i=a[k];h=n;return i}j=c+8|0;j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);e=c+24|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);C=c+40|0;c=c+56|0;Ll(j,e,(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),d);s=(b[0]=a[g],b[1]=a[g+1],f[0])-s;f[0]=s;a[g]=b[0];a[g+1]=b[1];s=Hp(d,l|0);c=4==(v|0);g=4==(s|0);a:do{if(c){if(g){return i=4,h=n,i}if(0<(s|0)){for(d=0;;){if(j=(d<<3)+l|0,Ml((b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),i,p),d=d+1|0,(d|0)==(s|0)){break a}}}}else{d=0<(v|0);if(g){if(d){j=0}else{break}for(;;){if(e=(j<<3)+m|0,Ml((b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),i,p),j=j+1|0,(j|0)==(v|0)){break a}}}if(d){d=0<(s|0);for(j=0;;){b:do{if(d){e=(j<<3)+m|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);for(C=0;;){if(t=(C<<3)+l|0,e==(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])&&Ml(e,i,p),C=C+1|0,(C|0)==(s|0)){break b}}}}while(0);j=j+1|0;if((j|0)==(v|0)){break a}}}}}while(0);i=a[k];h=n;return i}function od(a,b,c,d,f,e){a=(b-d)*(f-c)-(e-d)*(a-c);return 0<a?1:0>a?2:3}function iL(b,c){var d,g,f,e=a[kg>>2];g=e>>2;for(var l=0;;){var k=e+52*b|0,h=e+52*c|0;d=((l<<4)+e+52*b+4|0)>>2;var j=a[a[d]>>2],p=a[a[g+(13*c|0)+1]>>2];if((j|0)==(p|0)){if(f=a[a[g+(13*c|0)+2]>>2],(a[a[((l<<4)+8>>2)+g+(13*b|0)]>>2]|0)==(f|0)){f=2362}else{var m=f;f=2360}}else{m=a[a[g+(13*c|0)+2]>>2],f=2360}if(2360==f){if(f=0,(j|0)!=(m|0)){var v=j}else{(a[a[((l<<4)+8>>2)+g+(13*b|0)]>>2]|0)==(p|0)?f=2362:v=j}}2362==f&&(a[((l<<4)+16>>2)+g+(13*b|0)]=h,a[g+(13*c|0)+4]=k,v=a[a[d]>>2]);j=a[a[g+(13*c|0)+5]>>2];if((v|0)==(j|0)){if(f=a[a[g+(13*c|0)+6]>>2],(a[a[((l<<4)+8>>2)+g+(13*b|0)]>>2]|0)==(f|0)){f=2369}else{var t=f;f=2367}}else{t=a[a[g+(13*c|0)+6]>>2],f=2367}if(2367==f){if(f=0,(v|0)!=(t|0)){var u=v}else{(a[a[((l<<4)+8>>2)+g+(13*b|0)]>>2]|0)==(j|0)?f=2369:u=v}}2369==f&&(a[((l<<4)+16>>2)+g+(13*b|0)]=h,a[g+(13*c|0)+8]=k,u=a[a[d]>>2]);d=a[a[g+(13*c|0)+9]>>2];if((u|0)==(d|0)){if(f=a[a[g+(13*c|0)+10]>>2],(a[a[((l<<4)+8>>2)+g+(13*b|0)]>>2]|0)==(f|0)){f=2375}else{var w=f;f=2373}}else{w=a[a[g+(13*c|0)+10]>>2],f=2373}2373==f&&(f=0,(u|0)==(w|0)&&(a[a[((l<<4)+8>>2)+g+(13*b|0)]>>2]|0)==(d|0)&&(f=2375));2375==f&&(a[((l<<4)+16>>2)+g+(13*b|0)]=h,a[g+(13*c|0)+12]=k);l=l+1|0;if(3==(l|0)){break}}}function Gt(c,d,i){var g,e,Xa,l,k,n,m,p,s,v,t,u,w,A,B,C,y=i>>2,T=h;h+=16;var D;C=T>>2;B=(c+4|0)>>2;jL(a[B]);a[Qh>>2]=0;a[ij>>2]=0;var F=a[B]<<1,M=h;if((a[Ip>>2]|0)<(F|0)){var E=a[Mg>>2];if(0==(E|0)){var O=Gb(F<<2);a[Mg>>2]=O;0==(O|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=564,a[j+8>>2]=kL|0,j)),S())}else{var G=mc(E,F<<2);a[Mg>>2]=G;0==(G|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=571,a[j+8>>2]=lL|0,j)),S())}a[Ip>>2]=F}h=M;var J=(a[Ip>>2]|0)/2&-1;a[lg>>2]=J;a[Ng>>2]=J-1|0;var I=a[B],H=0<(I|0);A=(c|0)>>2;var K=a[A];a:do{if(H){for(var L=Infinity,N=-1,Q=0;;){var R=(Q<<4)+K|0,U=(b[0]=a[R>>2],b[1]=a[R+4>>2],f[0]),W=L>U,ca=W?Q:N,Y=Q+1|0;if((Y|0)<(I|0)){L=W?U:L,N=ca,Q=Y}else{var Z=ca;break a}}}else{Z=-1}}while(0);var V=(Z<<4)+K|0,ja=(b[0]=a[V>>2],b[1]=a[V+4>>2],f[0]),aa=(Z<<4)+K+8|0,da=(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]),ea=(0==(Z|0)?I:Z)-1|0,xa=(ea<<4)+K|0,$=(b[0]=a[xa>>2],b[1]=a[xa+4>>2],f[0]),la=(Z|0)==(I-1|0)?0:Z+1|0,ha=(la<<4)+K|0,ga=(b[0]=a[ha>>2],b[1]=a[ha+4>>2],f[0]),ba=(la<<4)+K+8|0,sa=(b[0]=a[ba>>2],b[1]=a[ba+4>>2],f[0]),fa=$==ja&ja==ga&sa>da;a:do{if(fa){D=2382}else{var tb=(ea<<4)+K+8|0;if(1!=(od($,(b[0]=a[tb>>2],b[1]=a[tb+4>>2],f[0]),ja,da,ga,sa)|0)){D=2382}else{if(H){for(var ya=0,ra=I,wa=K;;){if(0<(ya|0)){var Ab=(ya<<4)+wa|0,Fa=ya-1|0,Ga=(Fa<<4)+wa|0;if((b[0]=a[Ab>>2],b[1]=a[Ab+4>>2],f[0])!=(b[0]=a[Ga>>2],b[1]=a[Ga+4>>2],f[0])){D=2392}else{var ka=(ya<<4)+wa+8|0,ta=(Fa<<4)+wa+8|0;if((b[0]=a[ka>>2],b[1]=a[ka+4>>2],f[0])==(b[0]=a[ta>>2],b[1]=a[ta+4>>2],f[0])){var Ka=ra}else{D=2392}}}else{D=2392}if(2392==D){D=0;var za=a[Qh>>2],ma=a[jj>>2];a[ma+(za<<3)>>2]=(ya<<4)+wa|0;a[ma+(za<<3)+4>>2]=(za%a[B]<<3)+ma|0;a[a[Rh>>2]+(za<<2)>>2]=(za<<3)+ma|0;a[Qh>>2]=za+1|0;Ka=a[B]}var pa=ya+1|0;if((pa|0)>=(Ka|0)){break a}ya=pa;ra=Ka;wa=a[A]}}}}}while(0);a:do{if(2382==D&&H){for(var qa=I,Ha=I,Ra=K;;){var na=qa-1|0;if((na|0)<(Ha-1|0)){var Ba=(na<<4)+Ra|0,La=(qa<<4)+Ra|0;if((b[0]=a[Ba>>2],b[1]=a[Ba+4>>2],f[0])!=(b[0]=a[La>>2],b[1]=a[La+4>>2],f[0])){D=2388}else{var va=(na<<4)+Ra+8|0,Ya=(qa<<4)+Ra+8|0;if((b[0]=a[va>>2],b[1]=a[va+4>>2],f[0])!=(b[0]=a[Ya>>2],b[1]=a[Ya+4>>2],f[0])){D=2388}}}else{D=2388}if(2388==D){D=0;var Aa=a[Qh>>2],Za=a[jj>>2];a[Za+(Aa<<3)>>2]=(na<<4)+Ra|0;a[Za+(Aa<<3)+4>>2]=(Aa%a[B]<<3)+Za|0;a[a[Rh>>2]+(Aa<<2)>>2]=(Aa<<3)+Za|0;a[Qh>>2]=Aa+1|0}if(0>=(na|0)){break a}qa=na;Ha=a[B];Ra=a[A]}}}while(0);var Ea=a[Rh>>2],ab=a[Qh>>2],$a=Ea>>2,jb=h,Ca,Ia=ab,eb=ab;a:for(;;){var ub=eb-1|0;if(3<(Ia|0)){var Sa=0}else{Ca=2454;break}for(;;){if((Sa|0)>=(Ia|0)){Ca=2453;break a}var Qa=Sa+1|0,ua=(Sa+2|0)%(Ia|0);if(0==(mL(Sa,ua,Ea,Ia)|0)){Sa=Qa}else{break}}var Oa=(Qa|0)%(Ia|0);nL(a[(Sa<<2>>2)+$a],a[(Oa<<2>>2)+$a],a[(ua<<2>>2)+$a]);var Wa=Ia-1|0;if((Oa|0)<(Wa|0)){for(var pb=Oa;;){var ob=pb+1|0;a[(pb<<2>>2)+$a]=a[(ob<<2>>2)+$a];if((ob|0)==(ub|0)){Ia=Wa;eb=ub;continue a}else{pb=ob}}}else{Ia=Wa,eb=ub}}2454==Ca?(nL(a[$a],a[$a+1],a[$a+2]),h=jb):2453==Ca&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=315,a[j+8>>2]=oL|0,j)),h=jb);var bb=a[ij>>2],qb=0<(bb|0);a:do{if(qb){for(var Ma=0;;){var kb=Ma+1|0,Cb=(kb|0)<(bb|0);if(Cb){var vb=kb}else{break a}for(;;){iL(Ma,vb);var xb=vb+1|0;if((xb|0)<(bb|0)){vb=xb}else{break}}if(Cb){Ma=kb}else{break a}}}}while(0);for(var wb=d|0,nb=d+8|0,rb=0;(rb|0)<(bb|0);){if(0==(Mv(rb,(b[0]=a[wb>>2],b[1]=a[wb+4>>2],f[0]),(b[0]=a[nb>>2],b[1]=a[nb+4>>2],f[0]))|0)){rb=rb+1|0}else{break}}if((rb|0)==(bb|0)){Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=183,a[j+8>>2]=pL|0,j));var lb=-1;h=T;return lb}var Ta=d+16|0;w=(Ta|0)>>2;u=(d+24|0)>>2;for(var cb=0;(cb|0)<(bb|0);){if(0==(Mv(cb,(b[0]=a[w],b[1]=a[w+1],f[0]),(b[0]=a[u],b[1]=a[u+1],f[0]))|0)){cb=cb+1|0}else{break}}if((cb|0)==(bb|0)){return Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=191,a[j+8>>2]=qL|0,j)),lb=-1,h=T,lb}if(0==(rL(rb,cb)|0)){Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=198,a[j+8>>2]=sL|0,j));Nv(2);a[y+1]=2;var fb=a[Sh>>2];t=fb>>2;v=d>>2;a[t]=a[v];a[t+1]=a[v+1];a[t+2]=a[v+2];a[t+3]=a[v+3];s=(fb+16|0)>>2;p=Ta>>2;a[s]=a[p];a[s+1]=a[p+1];a[s+2]=a[p+2];a[s+3]=a[p+3];a[y]=fb;lb=0;h=T;return lb}if((rb|0)==(cb|0)){Nv(2);a[y+1]=2;var Ua=a[Sh>>2];m=Ua>>2;n=d>>2;a[m]=a[n];a[m+1]=a[n+1];a[m+2]=a[n+2];a[m+3]=a[n+3];k=(Ua+16|0)>>2;l=Ta>>2;a[k]=a[l];a[k+1]=a[l+1];a[k+2]=a[l+2];a[k+3]=a[l+3];a[y]=Ua;lb=0;h=T;return lb}a[C]=d;a[C+1]=0;var sb=T+8|0;a[sb>>2]=Ta;a[C+3]=0;Nl(1,T|0);var Na=a[lg>>2];a[Ol>>2]=Na;var Fb=-1==(rb|0);a:do{if(Fb){var Db=0,Ob=sb}else{var Eb=a[kg>>2];Xa=Eb>>2;for(var Pa=rb,Bb=Na;;){a[Xa+(13*Pa|0)]=2;for(var Ja=0;3>(Ja|0);){var hb=a[((Ja<<4)+16>>2)+Xa+(13*Pa|0)];if(0!=(hb|0)&&1==(a[hb>>2]|0)){break}Ja=Ja+1|0}if(3==(Ja|0)){var ib=a[Mg>>2],db=a[a[ib+(a[lg>>2]<<2)>>2]>>2],yb=a[ib+(a[Ng>>2]<<2)>>2],mb=a[yb>>2],Ib=(b[0]=a[w],b[1]=a[w+1],f[0]),ic=(b[0]=a[u],b[1]=a[u+1],f[0]),Hb=db|0,Kb=(b[0]=a[Hb>>2],b[1]=a[Hb+4>>2],f[0]),Jb=db+8|0,Lb=(b[0]=a[Jb>>2],b[1]=a[Jb+4>>2],f[0]),Mb=mb|0,pc=mb+8|0,Nb=1==(od(Ib,ic,Kb,Lb,(b[0]=a[Mb>>2],b[1]=a[Mb+4>>2],f[0]),(b[0]=a[pc>>2],b[1]=a[pc+4>>2],f[0]))|0),Vb=Nb?sb:yb,Pb=Nb?yb:sb}else{var Wb=a[((Ja<<4)+4>>2)+Xa+(13*Pa|0)],Tb=a[Wb>>2],Yb=a[a[(((Ja+1)%3<<4)+8>>2)+Xa+(13*Pa|0)]>>2],Sb=a[((Ja<<4)+8>>2)+Xa+(13*Pa|0)],$b=a[Sb>>2],lc=Tb|0,ec=(b[0]=a[lc>>2],b[1]=a[lc+4>>2],f[0]),Zb=Tb+8|0,kc=(b[0]=a[Zb>>2],b[1]=a[Zb+4>>2],f[0]),Hc=Yb|0,qc=(b[0]=a[Hc>>2],b[1]=a[Hc+4>>2],f[0]),nc=Yb+8|0,gc=(b[0]=a[nc>>2],b[1]=a[nc+4>>2],f[0]),Qb=$b|0,tc=$b+8|0,Sc=1==(od(ec,kc,qc,gc,(b[0]=a[Qb>>2],b[1]=a[Qb+4>>2],f[0]),(b[0]=a[tc>>2],b[1]=a[tc+4>>2],f[0]))|0),Vb=Sc?Wb:Sb,Pb=Sc?Sb:Wb}var bc=(Pa|0)==(rb|0);b:do{if(bc){Nl(2,Pb);Nl(1,Vb);var Xb=Bb}else{var uc=a[Mg>>2];do{if((a[uc+(a[lg>>2]<<2)>>2]|0)!=(Vb|0)&&(a[uc+(a[Ng>>2]<<2)>>2]|0)!=(Vb|0)){var rd=Ov(Vb);a[lg>>2]=rd;Nl(1,Vb);if((rd|0)<=(Bb|0)){Xb=Bb;break b}Xb=a[Ol>>2]=rd;break b}}while(0);var oc=Ov(Pb);a[Ng>>2]=oc;Nl(2,Pb);Xb=(oc|0)<(Bb|0)?a[Ol>>2]=oc:Bb}}while(0);for(var ac=0;;){if(3<=(ac|0)){Db=0;Ob=sb;break a}var dc=a[((ac<<4)+16>>2)+Xa+(13*Pa|0)];if(0!=(dc|0)&&1==(a[dc>>2]|0)){break}ac=ac+1|0}var rc=dc-Eb|0;if(-52==(rc|0)){Db=0;Ob=sb;break a}else{Pa=(rc|0)/52&-1,Bb=Xb}}}}while(0);for(;;){var jc=Db+1|0,Bc=a[Ob+4>>2];if(0==(Bc|0)){break}else{Db=jc,Ob=Bc}}Nv(jc);a[y+1]=jc;for(var fc=a[Sh>>2],fd=sb,Ac=Db;;){e=((Ac<<4)+fc|0)>>2;g=a[fd>>2]>>2;a[e]=a[g];a[e+1]=a[g+1];a[e+2]=a[g+2];a[e+3]=a[g+3];var yc=a[fd+4>>2];if(0==(yc|0)){break}else{fd=yc,Ac=Ac-1|0}}a[y]=fc;lb=0;h=T;return lb}function Mv(c,d,i){var g;g=a[kg>>2]>>2;var e=a[a[g+(13*c|0)+1]>>2],h=a[a[g+(13*c|0)+2]>>2],l=e|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),e=e+8|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),k=h|0,h=h+8|0,h=2!=(od(l,e,(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),d,i)|0)&1,k=a[a[g+(13*c|0)+5]>>2],l=a[a[g+(13*c|0)+6]>>2],e=k|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),k=k+8|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),n=l|0,l=l+8|0,h=(2!=(od(e,k,(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),d,i)|0)&1)+h|0,l=a[a[g+(13*c|0)+9]>>2],c=a[a[g+(13*c|0)+10]>>2];g=l|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);l=l+8|0;l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);e=c|0;c=c+8|0;d=(2!=(od(g,l,(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),d,i)|0)&1)+h|0;return(3==(d|0)|0==(d|0))&1}function jL(b){var c=h;if((a[Pv>>2]|0)<(b|0)){var d=a[jj>>2];0==(d|0)?(d=Gb(b<<3),a[jj>>2]=d,0==(d|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=514,a[j+8>>2]=tL|0,j)),S()),d=Gb(b<<2),a[Rh>>2]=d,0==(d|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=518,a[j+8>>2]=uL|0,j)),S())):(d=mc(d,b<<3),a[jj>>2]=d,0==(d|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=524,a[j+8>>2]=vL|0,j)),S()),d=mc(a[Rh>>2],b<<2),a[Rh>>2]=d,0==(d|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=530,a[j+8>>2]=wL|0,j)),S()));a[Pv>>2]=b}h=c}function Nl(b,c){var d,g=a[Ng>>2],f=a[lg>>2],e=-1<(g-f|0);d=a[Mg>>2]>>2;1==(b|0)?(e&&(a[c+4>>2]=a[(f<<2>>2)+d]),g=f-1|0,a[lg>>2]=g):(e&&(a[c+4>>2]=a[(g<<2>>2)+d]),g=g+1|0,a[Ng>>2]=g);a[(g<<2>>2)+d]=c}function rL(b,c){var d,g,f=a[kg>>2];d=(f+52*b|0)>>2;if(0!=(a[d]|0)){var e;return 0}a[d]=1;if((b|0)==(c|0)){return 1}for(var l=0;3>(l|0);){var k=a[((l<<4)+f+16>>2)+(13*b|0)];if(0!=(k|0)&&0!=(rL((k-f|0)/52&-1,c)|0)){e=1;g=2515;break}l=l+1|0}return 2515==g?e:a[d]=0}function Ov(c){var d,i,g=a[Ol>>2];d=a[Mg>>2]>>2;for(var c=c|0,e=a[lg>>2];(e|0)<(g|0);){var h=e+1|0,l=a[a[(h<<2>>2)+d]>>2],k=a[a[(e<<2>>2)+d]>>2],n=a[c>>2],j=l|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),l=l+8|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),p=k|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),k=k+8|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),m=n|0,n=n+8|0;if(1==(od(j,l,p,k,(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]),(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]))|0)){var v=e;i=2525;break}else{e=h}}if(2525==i){return v}for(e=a[Ng>>2];;){if((e|0)<=(g|0)){v=g;i=2526;break}h=e-1|0;l=a[a[(h<<2>>2)+d]>>2];k=a[a[(e<<2>>2)+d]>>2];n=a[c>>2];j=l|0;j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);l=l+8|0;l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);p=k|0;p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]);k=k+8|0;k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);m=n|0;n=n+8|0;if(2==(od(j,l,p,k,(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]),(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]))|0)){v=e;i=2524;break}else{e=h}}if(2524==i||2526==i){return v}}function mL(c,d,i,g){var i=i>>2,e,h=a[a[((c-1+g)%g<<2>>2)+i]>>2],l=a[a[(c<<2>>2)+i]>>2],k=a[a[((c+1)%g<<2>>2)+i]>>2],n=h|0,j=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),h=h+8|0,p=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),h=l|0,h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),l=l+8|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),n=k|0,m=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),k=k+8|0,v=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),t=1==(od(j,p,h,l,m,v)|0),n=a[a[(d<<2>>2)+i]>>2],k=n|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),n=n+8|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);if(0==((t?(1==(od(h,l,k,n,j,p)|0)?1==(od(k,n,h,l,m,v)|0):0)&1:2==(od(h,l,k,n,m,v)|0)&1)|0)){var u;return 0}for(p=0;;){if((p|0)>=(g|0)){u=1;e=2537;break}j=p+1|0;m=(j|0)%(g|0);if((p|0)==(c|0)|(m|0)==(c|0)|(p|0)==(d|0)|(m|0)==(d|0)){p=j}else{var p=a[a[(p<<2>>2)+i]>>2],w=a[a[(m<<2>>2)+i]>>2],A=p|0,B=p+8|0;a:{var p=h,m=l,v=k,t=n,A=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]),B=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),C=od(p,m,v,t,A,B);if(3!=(C|0)){var y=w|0,y=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),D=w+8|0,F=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),D=od(p,m,v,t,y,F);if(3!=(D|0)){var E=od(A,B,y,F,p,m);if(3!=(E|0)&&(y=od(A,B,y,F,v,t),3!=(y|0))){p=(1==(C|0)^1==(D|0)?1==(E|0)^1==(y|0):0)&1;break a}}}0!=(Jp(p,m,v,t,A,B)|0)?p=1:(C=w|0,C=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),w=w+8|0,w=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),p=0!=(Jp(p,m,v,t,C,w)|0)?1:0==(Jp(A,B,C,w,p,m)|0)?0!=(Jp(A,B,C,w,v,t)|0)&1:1)}if(0==(p|0)){p=j}else{u=0;e=2538;break}}}if(2538==e||2537==e){return u}}function nL(b,c,d){var g;g=a[ij>>2];var f=a[Kp>>2];if((g|0)<(f|0)){f=g}else{g=f+20|0;f=h;if((a[Kp>>2]|0)<(g|0)){var e=a[kg>>2];0==(e|0)?(e=Gb(52*g|0),a[kg>>2]=e,0==(e|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=543,a[j+8>>2]=xL|0,j)),S())):(e=mc(e,52*g|0),a[kg>>2]=e,0==(e|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=549,a[j+8>>2]=yL|0,j)),S()));a[Kp>>2]=g}h=f;f=a[ij>>2]}a[ij>>2]=f+1|0;e=a[kg>>2];g=e>>2;e=e+52*f|0;a[e>>2]=0;a[g+(13*f|0)+1]=b;a[g+(13*f|0)+2]=c;a[g+(13*f|0)+4]=0;a[g+(13*f|0)+5]=c;a[g+(13*f|0)+6]=d;a[g+(13*f|0)+8]=0;a[g+(13*f|0)+9]=d;a[g+(13*f|0)+10]=b;a[g+(13*f|0)+12]=0;a[g+(13*f|0)+3]=e;a[g+(13*f|0)+7]=e;a[g+(13*f|0)+11]=e}function Jp(a,b,c,d,f,e){var l=c-a,k=d-b,h=f-a,j=e-b;return 3!=(od(a,b,c,d,f,e)|0)?0:(0>h*l+j*k?0:h*h+j*j<=l*l+k*k)&1}function Hp(c,d){var i=c+24|0,g=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);if(1e-7>g&-1e-7<g){var e;e=c+16|0;i=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);1e-7>i&-1e-7<i?(e=c+8|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),i=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),1e-7>e&-1e-7<e?e=1e-7>i&-1e-7<i?4:0:(f[0]=-i/e,a[d>>2]=b[0],a[d+4>>2]=b[1],e=1)):(e=c+8|0,g=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])/(2*i),i=e*e-g/i,0>i?e=0:0==i?(f[0]=-e,a[d>>2]=b[0],a[d+4>>2]=b[1],e=1):(i=$c(i)-e,f[0]=i,a[d>>2]=b[0],a[d+4>>2]=b[1],g=d+8|0,f[0]=-2*e-i,a[g>>2]=b[0],a[g+4>>2]=b[1],e=2));return e}var h=c+8|0,i=c+16|0,l=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])/(3*g),h=h/g,k=i*i,l=2*i*k-i*h+l/g,g=h/3-k,h=l*l,g=h+4*g*g*g;if(0>g){h=.5*$c(h-g);g=Cf($c(-g),-l);h=2*(0>h?-1*kj(-h,.3333333333333333):kj(h,.3333333333333333));l=h*se(g/3);f[0]=l;a[d>>2]=b[0];a[d+4>>2]=b[1];var k=h*se((g+6.283185307179586)/3),n=d+8|0;f[0]=k;a[n>>2]=b[0];a[n+4>>2]=b[1];g=h*se((g-3.141592653589793-3.141592653589793)/3);h=d+16|0;f[0]=g;a[h>>2]=b[0];a[h+4>>2]=b[1];g=3}else{h=.5*($c(g)-l),l=-l-h,h=0>h?-1*kj(-h,.3333333333333333):kj(h,.3333333333333333),l=0>l?-1*kj(-l,.3333333333333333):kj(l,.3333333333333333),l=h+l,f[0]=l,a[d>>2]=b[0],a[d+4>>2]=b[1],0<g?g=1:(g=-.5*l,h=d+16|0,f[0]=g,a[h>>2]=b[0],a[h+4>>2]=b[1],h=d+8|0,f[0]=g,a[h>>2]=b[0],a[h+4>>2]=b[1],g=3)}h=l;for(l=0;;){k=(l<<3)+d|0;f[0]=h-i;a[k>>2]=b[0];a[k+4>>2]=b[1];l=l+1|0;if((l|0)>=(g|0)){e=g;break}h=(l<<3)+d|0;h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0])}return e}function zL(c,d,i,g){var i=i>>2,e,h=a[((c-1+g)%g<<2>>2)+i],l=a[(c<<2>>2)+i],k=a[((c+1)%g<<2>>2)+i],n=h|0,j=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),h=h+8|0,p=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),h=l|0,h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),l=l+8|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),n=k|0,m=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),k=k+8|0,v=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),t=1==(mg(j,p,h,l,m,v)|0),n=a[(d<<2>>2)+i],k=n|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),n=n+8|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);if(0==((t?(1==(mg(h,l,k,n,j,p)|0)?1==(mg(k,n,h,l,m,v)|0):0)&1:2==(mg(h,l,k,n,m,v)|0)&1)|0)){var u;return 0}for(p=0;;){if((p|0)>=(g|0)){u=1;e=2614;break}j=p+1|0;m=(j|0)%(g|0);if((p|0)==(c|0)|(m|0)==(c|0)|(p|0)==(d|0)|(m|0)==(d|0)){p=j}else{var p=a[(p<<2>>2)+i],w=a[(m<<2>>2)+i],A=p|0,B=p+8|0;a:{var p=h,m=l,v=k,t=n,A=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]),B=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]),C=mg(p,m,v,t,A,B);if(3!=(C|0)){var y=w|0,y=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),D=w+8|0,F=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),D=mg(p,m,v,t,y,F);if(3!=(D|0)){var E=mg(A,B,y,F,p,m);if(3!=(E|0)&&(y=mg(A,B,y,F,v,t),3!=(y|0))){p=(1==(C|0)^1==(D|0)?1==(E|0)^1==(y|0):0)&1;break a}}}0!=(Lp(p,m,v,t,A,B)|0)?p=1:(C=w|0,C=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),w=w+8|0,w=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),p=0!=(Lp(p,m,v,t,C,w)|0)?1:0==(Lp(A,B,C,w,p,m)|0)?0!=(Lp(A,B,C,w,v,t)|0)&1:1)}if(0==(p|0)){p=j}else{u=0;e=2616;break}}}if(2616==e||2614==e){return u}}function Nv(b){var c=h;if((a[Qv>>2]|0)<(b|0)){var d=a[Sh>>2];0==(d|0)?(d=Gb(b<<4),a[Sh>>2]=d,0==(d|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=584,a[j+8>>2]=Kv|0,j)),S())):(d=mc(d,b<<4),a[Sh>>2]=d,0==(d|0)&&(Va(a[oa>>2],dd|0,(j=h,h+=12,a[j>>2]=Pd|0,a[j+4>>2]=590,a[j+8>>2]=Lv|0,j)),S()));a[Qv>>2]=b}h=c}function AL(b,c,d,g){var f,e,l,k;k=b>>2;var n=h;h+=48;var j;if(3<(c|0)){for(e=0;;){if((e|0)>=(c|0)){j=2645;break}l=e+1|0;f=(e+2|0)%(c|0);if(0==(zL(e,f,b,c)|0)){e=l}else{break}}2645==j&&S();j=(l|0)%(c|0);l=n>>2;e=a[(e<<2>>2)+k]>>2;a[l]=a[e];a[l+1]=a[e+1];a[l+2]=a[e+2];a[l+3]=a[e+3];l=(n+16|0)>>2;e=a[(j<<2>>2)+k]>>2;a[l]=a[e];a[l+1]=a[e+1];a[l+2]=a[e+2];a[l+3]=a[e+3];e=(n+32|0)>>2;f=a[(f<<2>>2)+k]>>2;a[e]=a[f];a[e+1]=a[f+1];a[e+2]=a[f+2];a[e+3]=a[f+3];J[d](g,n|0);f=0<(c|0);a:do{if(f){for(l=e=0;;){if((e|0)!=(j|0)&&(a[(l<<2>>2)+k]=a[(e<<2>>2)+k],l=l+1|0),e=e+1|0,(e|0)==(c|0)){break a}}}}while(0);AL(b,c-1|0,d,g)}else{c=n>>2,b=a[k]>>2,a[c]=a[b],a[c+1]=a[b+1],a[c+2]=a[b+2],a[c+3]=a[b+3],c=(n+16|0)>>2,b=a[k+1]>>2,a[c]=a[b],a[c+1]=a[b+1],a[c+2]=a[b+2],a[c+3]=a[b+3],b=(n+32|0)>>2,k=a[k+2]>>2,a[b]=a[k],a[b+1]=a[k+1],a[b+2]=a[k+2],a[b+3]=a[k+3],J[d](g,n|0)}h=n}function mg(a,b,c,d,f,e){a=(b-d)*(f-c)-(e-d)*(a-c);return 0<a?2:0>a?1:3}function Lp(a,b,c,d,f,e){var l=c-a,k=d-b,h=f-a,j=e-b;return 3!=(mg(a,b,c,d,f,e)|0)?0:(0>h*l+j*k?0:h*h+j*j<=l*l+k*k)&1}function Ht(b,c,d){var g,f,e,l,k,h;g=3*c|0;var j=g-2|0,p=a[Rv>>2];(j|0)>(a[Sv>>2]|0)&&(p=0==(p|0)?Gb(j<<4):mc(p,j<<4),a[Rv>>2]=p,a[Sv>>2]=j);h=p>>2;k=b>>2;a[h]=a[k];a[h+1]=a[k+1];a[h+2]=a[k+2];a[h+3]=a[k+3];ck(p+16|0,b);c=c-1|0;if(1<(c|0)){h=1;for(k=2;!(l=((k<<4)+p|0)>>2,f=(h<<4)+b|0,e=f>>2,a[l]=a[e],a[l+1]=a[e+1],a[l+2]=a[e+2],a[l+3]=a[e+3],l=(k+1<<4)+p|0,e=l>>2,ck(l,f),f=((k+2<<4)+p|0)>>2,a[f]=a[e],a[f+1]=a[e+1],a[f+2]=a[e+2],a[f+3]=a[e+3],h=h+1|0,(h|0)==(c|0));){k=k+3|0}k=c;c=g-4|0}else{k=1,c=2}g=((c<<4)+p|0)>>2;k=(k<<4)+b|0;b=k>>2;a[g]=a[b];a[g+1]=a[b+1];a[g+2]=a[b+2];a[g+3]=a[b+3];ck((c+1<<4)+p|0,k);a[d+4>>2]=j;a[d>>2]=p}function ro(b){var c=a[b>>2]<<28>>28;return 3==(c|0)?a[a[b+16>>2]+12>>2]:2==(c|0)?a[a[a[a[b+16>>2]+20>>2]+16>>2]+8>>2]:1==(c|0)?a[a[a[b+20>>2]+16>>2]+4>>2]:0}function mb(b,c){if(-1>=(c|0)){var d;return 0}return d=a[a[b+4>>2]+(c<<2)>>2]}function fc(b,c,d){b>>=2;0==(d|0)?(c=0==(c|0)?1024:c,a[b+3]=1,d=Gb(c),a[b]=d):(a[b]=d,a[b+3]=0);a[b+2]=d+c|0;a[b+1]=d;m[d]=0}function na(b,c){var d,g=b+8|0;d=(b|0)>>2;var f=a[d],e=a[g>>2]-f|0,l=e<<1,e=e+c|0,l=e>>>0>l>>>0?e:l,e=b+4|0,k=a[e>>2]-f|0,h=b+12|0;0==(a[h>>2]|0)?(f=Gb(l),tf(f,a[d],k),a[h>>2]=1):f=mc(f,l);a[d]=f;a[e>>2]=f+k|0;a[g>>2]=f+l|0}function db(b,c){var d=Ba(c),g;g=(b+4|0)>>2;var f=a[g];(f+d|0)>>>0>a[b+8>>2]>>>0&&(na(b,d),f=a[g]);tf(f,c,d);a[g]=a[g]+d|0}function uc(b){0!=(a[b+12>>2]|0)&&G(a[b>>2])}function BL(b,c,d){var g,f=Yc(1,16);g=f>>2;a[g]=Dc(c);a[g+1]=Dc(d);m[f+12|0]=1;c=b+4|0;d=rc(a[c>>2]);a[g+2]=d;b=(b+8|0)>>2;g=a[b];g=0==(g|0)?Gb((d<<2)+8|0):mc(g,(d<<2)+8|0);a[b]=g;a[g+(d<<2)>>2]=f;a[a[b]+(d+1<<2)>>2]=0;c=a[c>>2];J[a[c>>2]](c,f,1);return f}function ui(b,c,d){var g,f=$(b,c);if(0==(f|0)){var e=1,l=BL(ro(b),c,d);g=2857}else{var c=f+4|0,k=a[c>>2];if(0==(ka(k,d)|0)){var h=f}else{dc(k),a[c>>2]=Dc(d),e=0,l=f,g=2857}}if(2857==g){if(0==(l|0)){h=0}else{d=a[b>>2]<<28>>28;if(2==(d|0)){CL(a[a[b+12>>2]+20>>2],l,e)}else{if(1==(d|0)){DL(a[b+20>>2],l,e)}else{if(3==(d|0)){if(d=l,g=b+36|0,f=a[g>>2],0==(f|0)){ng(b|0,d,e)}else{if(b=ra(a[f+20>>2]),0!=(b|0)){for(;!(ng(Yd(b)|0,d,e),b=ba(a[a[g>>2]+20>>2],b),0==(b|0));){}}}}}}h=l}}return h}function $(b,c){var d=a[ro(b)+4>>2];return J[a[d>>2]](d,c,512)}function DL(b,c,d){var g=ra(b),f=0==(g|0);a:do{if(!f){for(var e=g;;){if(ng(e|0,c,d),e=ba(b,e),0==(e|0)){break a}}}}while(0);g=b+36|0;f=a[g>>2];if(0==(f|0)){if(g=a[b+40>>2],0!=(g|0)){for(;!(ng(a[g>>2]|0,c,d),g=a[g+8>>2],0==(g|0));){}}}else{if(b=ra(a[f+20>>2]),0!=(b|0)){for(;;){f=a[Yd(b)+40>>2];e=0==(f|0);a:do{if(!e){for(var l=f;;){if(ng(a[l>>2]|0,c,d),l=a[l+8>>2],0==(l|0)){break a}}}}while(0);b=ba(a[a[g>>2]+20>>2],b);if(0==(b|0)){break}}}}}function CL(b,c,d){var g=ra(b),f=0==(g|0);a:do{if(!f){for(var e=g;;){var l=Ib(b,e),h=0==(l|0);b:do{if(!h){for(var n=l;;){if(ng(n|0,c,d),n=yb(b,n),0==(n|0)){break b}}}}while(0);e=ba(b,e);if(0==(e|0)){break a}}}}while(0);g=b+36|0;f=a[g>>2];if(0==(f|0)){if(b=a[b+40>>2],0!=(b|0)){for(;!(ng(a[b+4>>2]|0,c,d),b=a[b+8>>2],0==(b|0));){}}}else{if(b=ra(a[f+20>>2]),0!=(b|0)){for(;;){f=a[Yd(b)+40>>2];e=0==(f|0);a:do{if(!e){for(l=f;;){if(ng(a[l+4>>2]|0,c,d),l=a[l+8>>2],0==(l|0)){break a}}}}while(0);b=ba(a[a[g>>2]+20>>2],b);if(0==(b|0)){break}}}}}function Mp(b,c,d){b=0==(b|0)?a[qa+12>>2]:b;return(b|0)!=(a[b+32>>2]|0)?0:c=ui(b|0,c,d)}function xi(b,c,d){b=0==(b|0)?a[qa+12>>2]:b;return(b|0)!=(a[b+32>>2]|0)?0:c=ui(a[a[b+40>>2]>>2]|0,c,d)}function Th(b,c,d){b=0==(b|0)?a[qa+12>>2]:b;return(b|0)!=(a[b+32>>2]|0)?0:c=ui(a[a[b+40>>2]+4>>2]|0,c,d)}function Tv(b){Kc(a[b+4>>2]);var c=b+8|0,d=a[c>>2];if(0!=(d|0)){var g=a[d>>2],f=0==(g|0);a:do{if(f){var e=d}else{for(var l=0,h=g;;){l=l+1|0;dc(a[h>>2]);dc(a[h+4>>2]);G(h);var n=a[c>>2],h=a[n+(l<<2)>>2];if(0==(h|0)){e=n;break a}}}}while(0);G(e)}G(b)}function Uv(b){var c,d=Yc(1,12);c=d>>2;a[c]=b;a[c+1]=Nc(EL,a[Xc>>2]);a[c+2]=0;return d}function Vv(b,c){var d=rc(a[c+4>>2]);if(0<(d|0)){for(var g=c+8|0,f=0;;){var e=a[a[g>>2]+(f<<2)>>2],l=BL(b,a[e>>2],a[e+4>>2]);m[l+12|0]=m[e+12|0];m[l+13|0]=m[e+13|0];f=f+1|0;if((f|0)==(d|0)){break}}}}function V(a,b){return mb(a,FL(a,b))}function FL(b,c){var d=$(b,c);return 0==(d|0)?-1:d=a[d+8>>2]}function yd(a,b,c){qc(a,FL(a,b),c)}function qc(b,c,d){if(-1>=(c|0)){return-1}var g=(c<<2)+a[b+4>>2]|0;dc(a[g>>2]);a[g>>2]=Dc(d);b=a[b+8>>2]+((c|0)/8&-1)|0;m[b]=(m[b]&255|1<<(c&7))&255;return 0}function $J(b,c,d,g){var f=$(b,c);0==(f|0)?(g=0==(g|0)?Y|0:g,f=a[b>>2]<<28>>28,c=2==(f|0)?Th(a[a[b+12>>2]+20>>2],c,g):3==(f|0)?Mp(a[b+32>>2],c,g):1==(f|0)?xi(a[b+20>>2],c,g):0):c=f;qc(b,a[c+8>>2],d)}function po(b,c){var d,g=a[b>>2]<<28>>28,f=2==(g|0);if((g|0)==(a[c>>2]<<28>>28|0)){var g=0,e=a[ro(b)+8>>2];a:for(;;){for(g=0==(g|0);;){if(!g){break a}var l=e+4|0,e=a[e>>2];d=e>>2;if(0==(e|0)){break a}if(!f){break}if(0==(a[d+2]|0)){e=l}else{break}}g=$(c,a[d]);if(0==(g|0)){break}g=qc(c,a[g+8>>2],mb(b,a[d+2]));e=l}}}function ng(b,c,d){var g=a[c+8>>2];if(0==(d|0)){0==(m[a[b+8>>2]+((g|0)/8&-1)|0]<<24>>24&1<<(g&7)|0)&&(b=b+4|0,dc(a[a[b>>2]+(g<<2)>>2]),c=Dc(a[c+4>>2]),a[a[b>>2]+(g<<2)>>2]=c)}else{var d=(b+4|0)>>2,f=a[d],f=0==(f|0)?Gb((g<<2)+4|0):mc(f,(g<<2)+4|0);a[d]=f;c=Dc(a[c+4>>2]);a[a[d]+(g<<2)>>2]=c;0==(g&7|0)&&(b=b+8|0,c=a[b>>2],g=(g|0)/8&-1,d=g+1|0,c=0==(c|0)?Gb(d):mc(c,d),a[b>>2]=c,m[c+g|0]=0)}}function Kr(b,c,d){var g=b+24|0,f=lj(a[g>>2],c,d,0);return 0!=(f|0)?f:0!=(a[b>>2]&16|0)?0:b=lj(a[g>>2],d,c,0)}function lj(b,c,d,g){var f,e=h;h+=32;f=e>>2;var l=e+28|0;a[l>>2]=g;a[f+4]=c;a[f+3]=d;g=0!=(g|0);a[f+1]=g?l:0;f=a[b>>2];l=e|0;if(g){return c=J[f](b,l,4),h=e,c}b=J[f](b,l,8);if(0==(b|0)||(a[b+16>>2]|0)==(c|0)&&(a[b+12>>2]|0)==(d|0)){return h=e,b}h=e;return 0}function GL(b,c){var d=a[c>>2];16==(d&240|0)&&(a[c>>2]=d&-241|32);Pl(b,c)}function Pl(b,c){var d=b+24|0,g=a[d>>2],f=c|0;if(0==(J[a[g>>2]](g,f,4)|0)){g=c+16|0;mj(b,a[g>>2]);var e=c+12|0;mj(b,a[e>>2]);var l=b+28|0,h=a[l>>2];J[a[h>>2]](h,f,1);d=a[d>>2];J[a[d>>2]](d,f,1);d=a[l>>2];f=J[a[d>>2]](d,f,16);0!=(f|0)&&(a[f+16>>2]|0)==(a[g>>2]|0)&&(a[f+12>>2]|0)==(a[e>>2]|0)&&(f=a[c>>2],268435456>f<<24>>>0&&(a[c>>2]=f&-241|16));if(0==(a[b>>2]&64|0)&&(g=a[b+36>>2],f=a[g+20>>2],g=Og(f,g),0!=(g|0))){for(;!(Pl(Yd(a[g+16>>2]),c),g=Ql(f,g),0==(g|0));){}}}}function Ok(a,b){if(0==(a|0)|0==(b|0)){var c=0}else{c=Ib(a,b),c=0!=(c|0)?c:Og(a,b)}return c}function Ib(b,c){var d,g=h;h+=28;d=g>>2;if(0==(b|0)|0==(c|0)){return h=g,0}a[d+4]=c;a[d+3]=0;a[d+1]=0;d=a[b+28>>2];d=J[a[d>>2]](d,g|0,8);if(0==(d|0)){return h=g,d}h=g;return(a[d+16>>2]|0)==(c|0)?d:0}function Og(b,c){var d,g=h;h+=28;d=g>>2;if(0==(b|0)|0==(c|0)){return h=g,0}a[d+3]=c;a[d+4]=0;a[d+1]=0;d=a[b+24>>2];d=J[a[d>>2]](d,g|0,8);if(0==(d|0)){return h=g,d}h=g;return(a[d+12>>2]|0)==(c|0)?d:0}function Pk(b,c,d){var g;if(0==(b|0)|0==(c|0)|0==(d|0)){var f;return 0}var e=(a[c+16>>2]|0)==(d|0);a:do{if(e){var l=a[b+28>>2],l=J[a[l>>2]](l,c|0,8);if(0!=(l|0)&&(a[l+16>>2]|0)==(d|0)){return f=l}for(var l=b+24|0,h=Og(b,d);;){if(0==(h|0)){var n=0;break a}var j=a[h+12>>2];if(!((j|0)==(a[h+16>>2]|0)&(j|0)==(d|0))){n=h;break a}j=a[l>>2];h=J[a[j>>2]](j,h|0,8)}}else{if((a[c+12>>2]|0)==(d|0)){n=a[b+24>>2],n=J[a[n>>2]](n,c|0,8)}else{return f=0}}}while(0);b=b+24|0;for(c=n;;){if(0==(c|0)){f=0;g=101;break}var e=a[c+12>>2],p=(e|0)==(d|0);if(!((e|0)==(a[c+16>>2]|0)&p)){g=99;break}e=a[b>>2];c=J[a[e>>2]](e,c|0,8)}if(99==g){return p?c:0}if(101==g){return f}}function yb(b,c){var d=a[b+28>>2],d=J[a[d>>2]](d,c|0,8);return 0==(d|0)?d:(a[d+16>>2]|0)==(a[c+16>>2]|0)?d:0}function Ql(b,c){var d=a[b+24>>2],d=J[a[d>>2]](d,c|0,8);return 0==(d|0)?d:(a[d+12>>2]|0)==(a[c+12>>2]|0)?d:0}function Wv(b,c,d,g){var f,e=Yc(1,a[qa+8>>2]);f=e>>2;a[e>>2]=a[e>>2]&-16|2;a[f+4]=c;a[f+3]=d;d=(b+16|0)>>2;b=a[d]+20|0;c=a[b>>2];a[b>>2]=c+1|0;a[f+5]=c;c=rc(a[a[a[d]+8>>2]+4>>2]);if(0==(c|0)){return a[f+1]=0,a[f+2]=0,e}b=(e+4|0)>>2;a[b]=Yc(c,4);a[f+2]=Yc((c+7|0)/8&-1,1);if(0>=(c|0)){return e}f=g+4|0;if(0==(g|0)){for(g=0;!(f=Dc(a[a[a[a[a[d]+8>>2]+8>>2]+(g<<2)>>2]+4>>2]),a[a[b]+(g<<2)>>2]=f,g=g+1|0,(g|0)==(c|0));){}}else{for(g=0;!(d=Dc(a[a[f>>2]+(g<<2)>>2]),a[a[b]+(g<<2)>>2]=d,g=g+1|0,(g|0)==(c|0));){}}return e}function uh(b,c,d){var g,f,e=h;h+=128;g=(b+40|0)>>2;f=a[a[g]+4>>2];var l=a[a[f+4>>2]>>2];a[f+12>>2]=d;a[a[a[g]+4>>2]+16>>2]=c;f=b>>2;do{if(0==(a[f]&32|0)){if(0==m[l]<<24>>24){var k=e|0,n=a[Xv>>2];a[Xv>>2]=n+1|0;Ma(k,dv|0,(j=h,h+=4,a[j>>2]=n,j));a[a[a[a[g]+4>>2]+4>>2]>>2]=k;k=0}else{k=b+24|0;n=lj(a[k>>2],c,d,l);if(0==(n|0)){if(0!=(a[f]&16|0)){k=32;break}f=lj(a[k>>2],d,c,l);if(0==(f|0)){k=32;break}else{c=f}}else{c=n}GL(b,c);b=c;g=a[g];g=g+4|0;g>>=2;g=a[g];g=g+4|0;g>>=2;g=a[g];g>>=2;a[g]=l;h=e;return b}}else{k=b+24|0;n=lj(a[k>>2],c,d,0);if(0==(n|0)){if(0!=(a[f]&16|0)){k=0;break}f=lj(a[k>>2],d,c,0);if(0==(f|0)){k=0;break}else{c=f}}else{c=n}Pl(b,c);b=c;g=a[g];g=g+4|0;g>>=2;g=a[g];g=g+4|0;g>>=2;g=a[g];g>>=2;a[g]=l;h=e;return b}}while(0);c=Wv(b,c,d,a[a[g]+4>>2]);Pl(b,c);b=a[g];d=a[b>>2];a[a[b+4>>2]+16>>2]=d;a[a[a[g]+4>>2]+12>>2]=d;a[c>>2]=a[c>>2]&-241|k;g=a[g];g=(g+4|0)>>2;g=a[g];g=(g+4|0)>>2;g=a[g];a[g>>2]=l;h=e;return c}function HL(b){var c=b|0;a[b>>2]|=15;var d=rc(a[a[a[a[a[b+16>>2]+20>>2]+16>>2]+8>>2]+4>>2]),g=b+4|0,f=a[g>>2];if(0<(d|0)){for(var e=0;;){if(dc(a[f+(e<<2)>>2]),e=e+1|0,f=a[g>>2],(e|0)==(d|0)){l=f;break}}G(l)}else{var l,d=f;G(d)}b=a[(b+8|0)>>2];G(b);G(c)}function Np(b,c){var d,g=h;d=(b+24|0)>>2;var f=a[d],e=c|0;if(0==(J[a[f>>2]](f,e,4)|0)){la(1,IL|0,(j=h,h+=4,a[j>>2]=c,j)),Gn(a[d],70)}else{f=0==(a[b>>2]&64|0);a:do{if(f){var l=a[b+36>>2],k=a[l+20>>2],l=Ib(k,l);if(0!=(l|0)){for(;;){var n=Yd(a[l+12>>2]),m=a[n+24>>2];0!=(J[a[m>>2]](m,e,4)|0)&&Np(n,c);l=yb(k,l);if(0==(l|0)){break a}}}}}while(0);d=a[d];J[a[d>>2]](d,e,2);d=a[b+28>>2];J[a[d>>2]](d,e,2);(a[b+32>>2]|0)==(b|0)&&HL(c)}h=g}function Yd(b){return 0!=(a[a[b+20>>2]+36>>2]|0)?0:b=a[a[b+4>>2]>>2]}function JL(b,c){var d=0==(b|0)?0:a[b>>2],g=a[c+4>>2],g=0==(g|0)?0:a[g>>2];return 0==(d|0)?(0!=(g|0))<<31>>31:0==(g|0)?1:d=ka(d,g)}function Yv(b,c){var d,g=Yc(1,12);d=g>>2;var f=b+40|0;a[d+2]=a[f>>2];if(0==(c|0)){var e=0,l=0}else{e=a[c+4>>2],l=a[c>>2]}l=Zv(b,KL|0,l);a[d]=l;a[d+1]=Wv(b,l,l,e);a[f>>2]=g}function LL(b){var c;c=b+40|0;b=a[c>>2];if(0!=(b|0)){a[c>>2]=a[b+8>>2];var d=b|0,g=a[d>>2];c=(b+4|0)>>2;a[a[c]+12>>2]=g;a[a[c]+16>>2]=g;HL(a[c]);$v(a[d>>2]);G(b)}}function xn(b,c){var d=Op(b,0,c),g=Op(b,0,7);if(0==(d|0)|0==(g|0)){return 0}xi(g,ML|0,0);g=cl(g,b);a[d+36>>2]=g;a[a[g+4>>2]>>2]=d|0;return d}function Op(b,c,d){var g,f=h;if(0==m[qa+31|0]<<24>>24){return la(1,NL|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),h=f,0}var e=Yc(1,a[qa>>2]);g=e>>2;a[e>>2]=d<<4&240|a[e>>2]&-256|3;a[g+5]=Nc(Uh,a[Xc>>2]);a[g+6]=Nc(aw,a[Xc>>2]);a[g+7]=Nc(nj,a[Xc>>2]);d=0==(c|0);a:do{if(d){var l=OL();a[g+4]=l;a[g+8]=e;l=rc(a[a[l+12>>2]+4>>2]);if(0==(l|0)){a[g+1]=0,a[g+2]=0}else{var k=e+4|0;a[k>>2]=Yc(l,4);a[g+2]=Yc((l+7|0)/8&-1,1);if(0<(l|0)){for(var n=0;;){var z=Dc(a[a[a[qa+12>>2]+4>>2]+(n<<2)>>2]);a[a[k>>2]+(n<<2)>>2]=z;n=n+1|0;if((n|0)==(l|0)){break a}}}}}else{if(l=c+16|0,a[g+4]=a[l>>2],a[g+8]=a[c+32>>2],l=rc(a[a[a[l>>2]+12>>2]+4>>2]),0==(l|0)){a[g+1]=0,a[g+2]=0}else{if(k=e+4|0,a[k>>2]=Yc(l,4),a[g+2]=Yc((l+7|0)/8&-1,1),0<(l|0)){n=c+4|0;for(z=0;;){var p=Dc(a[a[n>>2]+(z<<2)>>2]);a[a[k>>2]+(z<<2)>>2]=p;z=z+1|0;if((z|0)==(l|0)){break a}}}}}}while(0);a[g+9]=0;a[g+3]=Dc(b);a[g+10]=0;d?Yv(e,a[e+40>>2]):Yv(e,a[c+40>>2]);h=f;return e}function oo(b,c){var d=a[a[b+36>>2]+20>>2],g=Mi(d,c);if(0==(g|0)){g=Op(c,b,a[b>>2]<<24>>28);if(0==(g|0)){return 0}d=cl(d,c);a[g+36>>2]=d;a[a[d+4>>2]>>2]=g|0;d=g}else{d=Yd(g)}PL(b,d);return d}function PL(b,c){var d=a[b+36>>2],g=a[c+36>>2];0==(d|0)|0==(g|0)||0==(QL(g,d)|0)&&uh(a[d+20>>2],d,g)}function RL(b,c){var d=a[b+36>>2];0==(d|0)?d=0:(d=Mi(a[d+20>>2],c),d=0==(d|0)?0:Yd(d));return d}function QL(b,c){var d=Nc(Uh,a[Xc>>2]),g=SL(d,b,c);Kc(d);return g}function Sf(b){var c,d=b>>2;if(0!=(b|0)){c=b>>2;var g=a[c];if(3==(g&15|0)){g=0==(g&64|0);a:do{if(g){for(var f=b+36|0,e=a[f>>2],l=a[e+20>>2],h=l,n=e;;){e=0;n=Ib(h,n);b:for(;;){for(;;){if(0==(n|0)){break b}var j=yb(h,n),p=n+12|0;if(0==(Ql(h,Og(h,a[p>>2]))|0)){break}else{n=j}}Sf(Yd(a[p>>2]));e=1;n=j}if(0==(e|0)){var m=l;break a}n=a[f>>2]}}else{m=0}}while(0);j=b+40|0;p=0==(a[j>>2]|0);a:do{if(!p){for(;;){if(LL(b),0==(a[j>>2]|0)){break a}}}}while(0);a:do{if(g&&(j=rc(a[a[a[d+4]+12>>2]+4>>2]),0<(j|0))){p=b+4|0;for(f=0;;){if(dc(a[a[p>>2]+(f<<2)>>2]),f=f+1|0,(f|0)==(j|0)){break a}}}}while(0);j=a[d+1];0!=(j|0)&&G(j);j=a[d+2];0!=(j|0)&&G(j);do{if((a[d+8]|0)==(b|0)){j=b;p=ra(j);f=0==(p|0);a:do{if(!f){for(l=p;;){if(h=ba(j,l),Pp(j,l),0==(h|0)){break a}else{l=h}}}}while(0);g&&Sf(a[a[d+9]+20>>2]);j=cc;j=(b+16|0)>>2;Tv(a[a[j]+12>>2]);Tv(a[a[j]+4>>2]);Tv(a[a[j]+8>>2]);Kc(a[a[j]>>2]);G(a[j])}else{g&&bl(m,a[d+9]|0)}}while(0);Kc(a[d+5]);Kc(a[d+6]);Kc(a[d+7]);dc(a[d+3]);a[c]|=15;G(b|0)}}}function bl(b,c){var d=a[c>>2]<<28>>28;1==(d|0)?Pp(b,c):2==(d|0)?Np(b,c):3==(d|0)&&Sf(c)}function Ed(b,c){var d=a[c>>2]<<28>>28;1==(d|0)?d=0!=(TL(b,a[c+16>>2])|0)&1:3==(d|0)?d=QL(a[b+36>>2],a[c+36>>2]):2==(d|0)?(d=a[b+24>>2],d=0!=(J[a[d>>2]](d,c,4)|0)&1):d=0;return d}function gt(b,c){var d=a[c>>2]<<28>>28;1==(d|0)?mj(b,c):2==(d|0)?GL(b,c):3==(d|0)&&PL(b,c)}function Vh(b){return rc(a[b+20>>2])}function UL(b,c){0!=(b|0)&&(a[qa+36>>2]=b);0!=(c|0)&&(a[qa+40>>2]=c)}function SL(b,c,d){var g,f;if((c|0)==(d|0)){var e;return 1}g=(c+20|0)>>2;if(0!=(Kr(a[a[g]+32>>2],c,d)|0)){return 1}var l=b|0;J[a[l>>2]](b,c|0,1);for(c=Ib(a[g],c);;){if(0==(c|0)){e=0;f=354;break}var h=c+12|0;if(0==(J[a[l>>2]](b,a[h>>2]|0,4)|0)&&0!=(SL(b,a[h>>2],d)|0)){e=1;f=353;break}c=yb(a[g],c)}if(353==f||354==f){return e}}function OL(){var b=Yc(1,24);a[b>>2]=Nc(bw,a[Xc>>2]);var c=b+12|0;a[c>>2]=Uv(Yf|0);var d=b+4|0;a[d>>2]=Uv(jh|0);var g=b+8|0;a[g>>2]=Uv(Dg|0);var f=a[qa+12>>2];if(0==(f|0)){return b}Vv(a[c>>2],a[a[f+16>>2]+12>>2]);Vv(a[d>>2],a[a[a[qa+12>>2]+16>>2]+4>>2]);Vv(a[g>>2],a[a[a[qa+12>>2]+16>>2]+8>>2]);return b}function VL(a,b){if(0==(bg(a)|0)){var c=Rl(a,b);return c}m[b]=60;var c=b+1|0,d=m[a],f=0==d<<24>>24;a:do{if(f){var e=b,l=c}else{for(var h=a,n=c,j=d;;){h=h+1|0;m[n]=j;var j=n+1|0,p=m[h];if(0==p<<24>>24){e=n;l=j;break a}else{n=j,j=p}}}}while(0);m[l]=62;m[e+2|0]=0;return b}function Rl(a,b){var c;if(0==(a|0)||0==m[a]<<24>>24){return c=oj|0}m[b]=34;var d=m[a],f=0==(pj(d)|0),e=1,l=0,h=a+1|0,n=d,d=b+1|0,j=0;a:for(;;){var p=l,l=n,s=d;b:for(;;){do{if(0==l<<24>>24){break a}else{if(34==l<<24>>24){m[s]=92;var d=1,v=s+1|0}else{v=95!=l<<24>>24&0==(oC(l&255)|0)&-1<l<<24>>24,d=v|f?v?1:p:0==(pj(l)|0)?1:p,v=s}}}while(0);var t=v+1|0;m[v]=l;var u=h+1|0,w=m[h],A=j+1|0,h=w&255,j=0!=w<<24>>24;do{if(!(e|j^1)){do{if(0==(pj(l)|0)&&0==(ti(l<<24>>24)|0)&&92!=m[v]<<24>>24){break b}}while(0);if(0==(pj(w)|0)&&0==(ti(h)|0)){break b}}}while(0);if(j){if(0!=(A&127|0)){p=d,h=u,l=w,s=t}else{l=m[v];0==(pj(l)|0)?0!=(ti(l<<24>>24)|0)?c=392:92==m[v]<<24>>24&&(c=392):c=392;if(392==c){c=0;if(0!=(pj(w)|0)){e=0;l=d;h=u;n=w;d=t;j=A;continue a}if(0!=(ti(h)|0)){e=0;l=d;h=u;n=w;d=t;j=A;continue a}}m[t]=92;m[v+2|0]=10;p=1;h=u;l=w;s=v+3|0}}else{p=d,h=u,l=0,s=t}j=A}m[t]=92;m[v+2|0]=10;l=e=1;h=u;n=w;d=v+3|0;j=A}m[s]=34;m[s+1|0]=0;return 0!=(p|0)?b:c=-1<(cw(a)|0)?b:a}function hb(b,c){J[a[qa+36>>2]](b,1,Ba(b),c)}function Ge(b,c){var d=h;h+=4;m[d]=b&255;J[a[qa+36>>2]](d,1,1,c);h=d}function xd(a){return VL(a,Sl(a))}function Sl(b){var b=(Ba(b)<<1)+2|0,b=1024<b>>>0?b:1024,c=a[dw>>2];if((b|0)<=(a[ew>>2]|0)){return c}c=0==(c|0)?Gb(b):mc(c,b);a[dw>>2]=c;a[ew>>2]=b;return c}function fw(b,c,d,g,f){var e,l=h;h+=4;a[l>>2]=0;var k=d+20|0,n=a[a[a[k>>2]+16>>2]+4>>2];do{if(0!=(g|0)){var j=n+4|0;if(0<(rc(a[j>>2])|0)){for(var p=n+8|0,s=d|0,v=d+12|0,t=b+40|0,u=0,w=0;;){var A=a[a[p>>2]+(u<<2)>>2];if(0!=m[A+12|0]<<24>>24){e=(A|0)>>2;var B=V(s,a[e]),A=(a[k>>2]|0)==(b|0)?a[A+4>>2]:V(a[a[t>>2]>>2]|0,a[e]);0!=(ka(A,B)|0)&&(0==(w|0)&&(Pg(c,f),hb(xd(a[v>>2]),c),w=1),WL(c,l,a[e],B))}e=w;u=u+1|0;if((u|0)<(rc(a[j>>2])|0)){w=e}else{break}}if(0!=(e|0)){hb(0<(a[l>>2]|0)?Tl|0:Wh|0,c);h=l;return}}}}while(0);0==(Ib(b,d)|0)&&0==(Og(b,d)|0)&&(Pg(c,f),hb(xd(a[d+12>>2]),c),hb(Wh|0,c));h=l}function Pg(a,b){if(0!=(b|0)){for(var c=b;!(c=c-1|0,Ge(9,a),0==(c|0));){}}}function WL(b,c,d,g){var f=a[c>>2];a[c>>2]=f+1|0;hb(0<(f|0)?gw|0:Qp|0,b);hb(xd(d),b);Ge(61,b);hb(xd(g),b)}function hw(b,c,d,g){var f,e=h;h+=4;a[e>>2]=0;var l=a[d+16>>2],k=a[a[a[l+20>>2]+16>>2]+8>>2],n=a[d+4>>2];if(0==(n|0)){var j=Y|0,n=Y|0}else{j=a[n+8>>2],n=a[n+4>>2]}XL(c,a[l+12>>2],n);hb(0!=(a[b>>2]&16|0)?ns|0:os|0,c);XL(c,a[a[d+12>>2]+12>>2],j);if(0==(g|0)){b=Wh|0}else{if(g=k+4|0,0<(rc(a[g>>2])|0)){for(var k=k+8|0,l=d|0,j=b+32|0,n=b+40|0,p=0;;){var s=a[a[k>>2]+(p<<2)>>2];if(0!=m[s+12|0]<<24>>24&&!(0==(p|0)&&32!=(a[d>>2]&240|0))){f=(s|0)>>2;var v=V(l,a[f]),s=(a[j>>2]|0)==(b|0)?a[s+4>>2]:V(a[a[n>>2]+4>>2]|0,a[f]);0!=(ka(s,v)|0)&&WL(c,e,a[f],v)}f=p+1|0;if((f|0)<(rc(a[g>>2])|0)){p=f}else{break}}b=0<(a[e>>2]|0)?Tl|0:Wh|0}else{b=Wh|0}}hb(b,c);h=e}function XL(a,b,c){hb(xd(b),a);0!=(c|0)&&0!=m[c]<<24>>24&&(0!=(bg(c)|0)?(Ge(58,a),hb(VL(c,Sl(c)),a)):(b=Jc(c,58),0==(b|0)?(Ge(58,a),hb(Rl(c,Sl(c)),a)):(m[b]=0,Ge(58,a),hb(Rl(c,Sl(c)),a),Ge(58,a),c=b+1|0,hb(Rl(c,Sl(c)),a),m[b]=58)))}function iw(b,c){var d;0==(a[qa+36>>2]|0)&&(a[qa+36>>2]=182);0==(a[qa+40>>2]|0)&&(a[qa+40>>2]=60);hb(0!=(a[b>>2]&32|0)?YL|0:Y|0,c);hb(0!=(a[b>>2]&16|0)?wv|0:Yf|0,c);d=b+12|0;0!=(td(a[d>>2],jw|0,10)|0)&&(Ge(32,c),hb(xd(a[d>>2]),c));hb(kw|0,c);d=(b+16|0)>>2;lw(a[a[d]+12>>2],c);lw(a[a[d]+4>>2],c);lw(a[a[d]+8>>2],c);var g;d=Yc(1,20);g=d>>2;var f=Nc(Uh,a[Xc>>2]);a[g]=f;var e=a[b+20>>2];a[Ul>>2]=f;Gn(e,230);f=Nc(Rp,a[Xc>>2]);a[g+1]=f;e=a[b+28>>2];a[Ul>>2]=f;Gn(e,230);a[g+4]=Nc(Uh,a[Xc>>2]);a[g+3]=Nc(nj,a[Xc>>2]);f=Nc(Uh,a[Xc>>2]);a[g+2]=f;g=a[a[a[b+36>>2]+20>>2]+20>>2];a[Ul>>2]=f;Gn(g,230);mw(b,c,0,0,d);hb(Sp|0,c);g=d>>2;Kc(a[g]);Kc(a[g+4]);Kc(a[g+1]);Kc(a[g+3]);Kc(a[g+2]);G(d);return J[a[qa+40>>2]](c)}function lw(b,c){var d=b+4|0;if(0<(rc(a[d>>2])|0)){for(var g=b+8|0,f=b|0,e=0,l=0;;){var h=a[a[g>>2]+(e<<2)>>2],j=h+4|0,z=a[j>>2];0==(z|0)?h=l:0==m[z]<<24>>24?h=l:(0==(l|0)?(Ge(9,c),hb(a[f>>2],c),hb(Qp|0,c)):hb(gw|0,c),hb(a[h>>2],c),Ge(61,c),hb(xd(a[j>>2]),c),h=l+1|0);e=e+1|0;if((e|0)<(rc(a[d>>2])|0)){l=h}else{break}}0<(h|0)&&hb(Tl|0,c)}}function pj(a){return 10>((a<<24>>24)-48|0)>>>0?1:46==a<<24>>24||45==a<<24>>24||43==a<<24>>24?1:0}function mw(b,c,d,g,f){var e,l,h,j,m=g+1|0;if(0==(g|0)){Vl(c,m,b|0,0,a[a[b+16>>2]+12>>2]);var p=b+36|0}else{Pg(c,g);h=f+8|0;j=a[h>>2];l=b+36|0;if(0==(J[a[j>>2]](j,a[l>>2]|0,4)|0)){hb(nw|0,c);hb(xd(a[b+12>>2]),c);hb(Wh|0,c);return}j=b+12|0;0==(td(a[j>>2],jw|0,10)|0)?hb(ZL|0,c):(hb(nw|0,c),hb(xd(a[j>>2]),c),hb(kw|0,c));j=(b+16|0)>>2;Vl(c,m,b|0,d|0,a[a[j]+12>>2]);(a[b+32>>2]|0)==(d|0)?e=d=0:(e=a[d+40>>2],d=a[e+4>>2],e=a[e>>2]);p=b+40|0;Vl(c,m,a[a[p>>2]>>2]|0,e|0,a[a[j]+4>>2]);Vl(c,m,a[a[p>>2]+4>>2]|0,d|0,a[a[j]+8>>2]);h=a[h>>2];J[a[h>>2]](h,a[l>>2]|0,2);p=l}h=(f+16|0)>>2;j=a[h];l=(f+12|0)>>2;d=a[l];e=a[a[p>>2]+20>>2];a[h]=Nc(bw,a[Xc>>2]);a[l]=Nc(nj,a[Xc>>2]);var p=Ib(e,a[p>>2]),s=0==(p|0);a:do{if(!s){for(var v=p;;){if(mw(Yd(a[v+12>>2]),c,b,m,f),v=yb(e,v),0==(v|0)){break a}}}}while(0);e=ra(b);p=0==(e|0);a:do{if(!p){for(var s=f|0,v=j|0,t=e;;){var u=a[s>>2],w=t|0;0==(J[a[u>>2]](u,w,4)|0)?(u=a[h],0==(J[a[u>>2]](u,w,4)|0)&&fw(b,c,t,0,m)):(fw(b,c,t,1,m),u=a[s>>2],J[a[u>>2]](u,w,2));J[a[v>>2]](j,w,1);t=ba(b,t);if(0==(t|0)){break a}}}}while(0);e=(b+28|0)>>2;pk(a[e],Rp,0);p=a[e];p=J[a[p>>2]](p,0,128);s=0==(p|0);a:do{if(!s){v=f+4|0;t=d|0;for(w=p;;){var u=w,A=a[v>>2];0==(J[a[A>>2]](A,w,4)|0)?(A=a[l],0==(J[a[A>>2]](A,w,4)|0)&&(Pg(c,m),hw(b,c,u,0))):(Pg(c,m),hw(b,c,u,1),u=a[v>>2],J[a[u>>2]](u,w,2));J[a[t>>2]](d,w,1);u=a[e];w=J[a[u>>2]](u,w,8);if(0==(w|0)){break a}}}}while(0);pk(a[e],nj,0);Kc(a[h]);a[h]=j;Kc(a[l]);a[l]=d;0<(g|0)&&(Pg(c,g),hb(Sp|0,c))}function Vl(b,c,d,g,f){var e,l=f+4|0;if(0<(rc(a[l>>2])|0)){for(var h=f+8|0,j=0==(g|0),f=f|0,z=c+1|0,p=0,s=0;;){var v=a[a[h>>2]+(p<<2)>>2];e=v>>2;if(0==m[v+12|0]<<24>>24){e=s}else{var v=a[e+2],t=mb(d,v);0==(ka(t,j?a[e+1]:mb(g,v))|0)?e=s:(0==(s|0)?(Pg(b,c),hb(a[f>>2],b),hb(Qp|0,b)):(hb($L|0,b),Pg(b,z)),hb(xd(a[e]),b),Ge(61,b),hb(xd(t),b),e=s+1|0)}p=p+1|0;if((p|0)<(rc(a[l>>2])|0)){s=e}else{break}}0<(e|0)&&hb(Tl|0,b)}}function vC(b){a[ow>>2]=b;var c=a[qa+32>>2];var d=0!=(c|0)?c:a[qa+32>>2]=386;a[Gc>>2]=0;c=a[qa+24>>2];0==(c|0)&&(a[Xh>>2]=1024,c=Yc(1024,1),a[qa+24>>2]=c,c=Yc(a[Xh>>2],1),a[Wl>>2]=c,d=a[qa+32>>2],c=a[qa+24>>2]);J[d](c,0,b);D[qa+28>>1]=0}function aM(){var b,c=h;h+=1040;var d,g=c+16;if(0!=m[qa+30|0]<<24>>24){m[qa+30|0]=0;var f;h=c;return-1}for(var e=a[Gc>>2];;){if(0==(e|0)){d=576}else{if(0==m[e]<<24>>24){d=576}else{var l=e}}if(576==d&&(d=0,l=pw(),a[Gc>>2]=l,0==(l|0))){d=577;break}if(1==(a[Qd>>2]|0)){if(0!=(td(l,bM|0,3)|0)){var k=l}else{k=l+3|0,a[Gc>>2]=k}}else{k=l}k=cM(k);a[Gc>>2]=k;var n=m[k];if(0==n<<24>>24){e=k}else{break}}if(577==d){if(!m[Xl]){return h=c,-1}f=m[qw]&255;la(0,dM|0,(j=h,h+=4,a[j>>2]=f,j));h=c;return-1}d=a[Wl>>2];if(34==n<<24>>24){f=eM(k,d),a[Gc>>2]=f,f=Dc(d),a[Yh>>2]=f,f=265}else{if(60==n<<24>>24){fc(c,1024,g|0);l=a[Gc>>2];m[rw]=a[Qd>>2]&255;d=h;g=(c+4|0)>>2;k=c+8|0;l=l+1|0;n=1;b:for(;;){for(;;){e=m[l];if(62==e<<24>>24){f=779;break}else{if(60==e<<24>>24){f=780;break}else{if(0!=e<<24>>24){var z=n,p=e;break}}}l=pw();if(0==(l|0)){break b}}if(779==f){if(f=0,z=n-1|0,0==(z|0)){b=l;f=787;break}else{p=62}}else{780==f&&(f=0,z=n+1|0,p=60)}n=a[g];n>>>0<a[k>>2]>>>0||(na(c,1),n=a[g]);a[g]=n+1|0;m[n]=p;l=l+1|0;n=z}787!=f&&(f=m[rw]&255,b=a[qj>>2],b=0!=(b|0)?b:Yl|0,la(0,fM|0,(j=h,h+=8,a[j>>2]=f,a[j+4>>2]=b,j)),b=0);h=d;f=b;a[Gc>>2]=0==(f|0)?0:f+1|0;b=(c+4|0)>>2;f=a[b];f>>>0<a[c+8>>2]>>>0||(na(c,1),f=a[b]);m[f]=0;f=a[c>>2];a[b]=f;0==(a[Ne>>2]|0)&&gM();0==(f|0)?f=0:(b=a[Ne>>2],b=J[a[b>>2]](b,f-12|0,4),0==(b|0)?(b=Gb(Ba(f)+16|0),a[b+8>>2]=m[Tp]?-2147483647:1,Rf(b+12|0,f),f=a[Ne>>2],J[a[f>>2]](f,b,1)):(f=b+8|0,a[f>>2]=a[f>>2]+1|0),f=b,f=f+12|0);a[Yh>>2]=f;uc(c)}else{f=a[qa+20>>2];if(0!=(f|0)&&(b=Ba(f),0==(td(k,f,b)|0))){return a[Gc>>2]=k+b|0,h=c,263}f=hM(k,d);if(0!=(f|0)){return a[Gc>>2]=f,f=Dc(d),a[Yh>>2]=f,h=c,264}f=m[a[Gc>>2]];b=a[Gc>>2];if(!(0==((33<=(f&255)&&47>=(f&255)||58<=(f&255)&&64>=(f&255)||91<=(f&255)&&96>=(f&255)||123<=(f&255)&&126>=(f&255))|0)|95==f<<24>>24)){return a[Gc>>2]=b+1|0,f=m[b]<<24>>24,h=c,f}if(0==(b|0)){f=0}else{f=b;for(b=d;;){z=m[f];if(0==(oC(m[f]&255)|0)&&!(95==z<<24>>24|0>z<<24>>24)){break}m[b]=z;f=f+1|0;b=b+1|0}m[b]=0}a[Gc>>2]=f;f=cw(d);if(-1!=(f|0)){return h=c,f}f=Dc(d);a[Yh>>2]=f}f=264}h=c;return f}function cw(b){D[rj>>1]=0;var c=m[b];do{if(0==c<<24>>24){var d=0}else{for(var d=b,g=c,f=0;;){var g=0>g<<24>>24?127:g,e=-1<f<<16>>16;a:do{if(e){var l=g&255;do{if(0==((65<=l&&90>=l)|0)){if(0!=((97<=l&&122>=l)|0)){var h=g}else{h=D[rj>>1]=-1;break a}}else{h=vf(l)&255}}while(0);l=D[rj>>1]<<16>>16;h&=255;if(0==(a[iM+(h-97<<2)>>2]&a[Up+(l<<3)+4>>2]|0)){h=D[rj>>1]=-1}else{for(l=D[Up+(l<<3)+2>>1];;){var j=l<<16>>16;if((D[sw+(j<<2)>>1]<<16>>16|0)==(h|0)){break}else{l=l+1&65535}}h=D[sw+(j<<2)+2>>1];D[rj>>1]=h}}else{h=f}}while(0);d=d+1|0;f=m[d];if(0==f<<24>>24){break}else{g=f,f=h}}if(0>h<<16>>16){return b=-1}d=h}}while(0);return b=D[Up+(d<<16>>16<<3)>>1]<<16>>16}function pw(){var b=h;h+=8;for(var c,d=b+4|0,g=0;;){var f=a[Xh>>2];(g+128|0)<(f|0)||(f=f+1024|0,a[Xh>>2]=f,f=mc(a[qa+24>>2],f),a[qa+24>>2]=f,f=mc(a[Wl>>2],a[Xh>>2]),a[Wl>>2]=f,f=a[Xh>>2]);f=J[a[qa+32>>2]](a[qa+24>>2]+g+1|0,f+(g^-1)|0,a[ow>>2]);if(0==(f|0)){var e=g;break}var l=Ba(f);do{if(10==m[f+(l-1)|0]<<24>>24){if(35==m[f]<<24>>24&0==(g|0)){var k=f+1|0,k=0==(td(k,jM|0,4)|0)?f+5|0:k,n=Cd(k,kM|0,(j=h,h+=12,a[j>>2]=Qd,a[j+4>>2]=d,a[j+8>>2]=b,j)),z=a[Qd>>2];do{if(1>(n|0)){a[Qd>>2]=z+1|0}else{if(a[Qd>>2]=z-1|0,1<(n|0)){for(var p=k+a[b>>2]|0,s=p;;){var v=m[s];if(34==v<<24>>24||0==v<<24>>24){break}s=s+1|0}(s|0)!=(p|0)&&(m[s]=0,v=p,p=s-p|0,s=a[tw>>2],(s|0)<(p|0)?(s=0==(s|0)?Gb(p+1|0):mc(a[Zl>>2],p+1|0),a[Zl>>2]=s,a[tw>>2]=p,p=s):p=a[Zl>>2],Rf(p,v),a[qj>>2]=a[Zl>>2])}}}while(0);m[f]=0;k=1;n=0}else{a[Qd>>2]=a[Qd>>2]+1|0;c=l-2|0;var t=f+c|0;92!=m[t]<<24>>24?t=l:(m[t]=0,t=c);c=642}}else{t=l,c=642}}while(0);642==c&&(c=0,k=t,n=t+g|0);if(10==m[f+(k-1)|0]<<24>>24){e=n;break}else{g=n}}if(0>=(e|0)){return h=b,0}d=a[qa+24>>2]+1|0;h=b;return d}function la(b,c){var d=h;h+=4;a[d>>2]=arguments[la.length];var g=uw(b,c,a[d>>2]);h=d;return g}function cM(b){var c;a:for(;;){var d=m[b];do{if(0!=d<<24>>24&&!(0==(ah(d&255)|0)&&0==((0<=(m[b]&255)&&31>=(m[b]&255)||127===(m[b]&255))|0))){b=b+1|0;continue a}}while(0);var g=m[Xl];b:do{if(g){for(var d=b,f=m[b];;){if(0==f<<24>>24){break b}else{var e=d}for(;;){var h=0==f<<24>>24,k=e+1|0;if(!(42!=f<<24>>24&(h^1))){break}e=k;f=m[k]}if(h){d=e}else{if(f=m[k],47==f<<24>>24){break}else{d=k}}}m[Xl]=0;d=e+2|0}else{d=b}}while(0);b=m[d];b:do{if(0==b<<24>>24){var j=d;c=676;break a}else{if(47==b<<24>>24){g=m[d+1|0];if(47==g<<24>>24){g=d,f=0}else{if(42==g<<24>>24){m[Xl]=1;m[qw]=a[Qd>>2]&255;var z=d+2|0;break}else{j=d;c=677;break a}}for(;;){var p=g+1|0;if(f){z=g;break b}g=p;f=0==m[p]<<24>>24}}else{if(0!=(ah(b&255)|0)){z=d}else{if(0==((0<=(m[d]&255)&&31>=(m[d]&255)||127===(m[d]&255))|0)){j=d;c=678;break a}else{z=d}}}}}while(0);if(0==m[z]<<24>>24){j=z;c=679;break}else{b=z}}if(679==c||677==c||678==c||676==c){return j}}function eM(b,c){var d=h,g=m[b],f=b+1|0,e=m[f],l=0==e<<24>>24,k=e<<24>>24!=g<<24>>24&(l^1);a:do{if(k){for(var n=c,z=b,p=f,s=e;;){if(92==s<<24>>24){var s=z+2|0,v=m[s];v<<24>>24==g<<24>>24?(p=s,s=n):92!=v<<24>>24?s=n:(m[n]=92,p=s,s=n+1|0)}else{s=n}n=s+1|0;m[s]=m[p];v=p+1|0;s=m[v];z=0==s<<24>>24;if(s<<24>>24!=g<<24>>24&(z^1)){z=p,p=v}else{var t=n,u=p,w=v,A=z;break a}}}else{t=c,u=b,w=f,A=l}}while(0);A?(g=a[qj>>2],g=0!=(g|0)?g:Yl|0,f=a[Qd>>2],la(0,lM|0,(j=h,h+=8,a[j>>2]=g,a[j+4>>2]=f,j))):w=u+2|0;m[t]=0;h=d;return w}function hM(b,c){var d=h,g,f=m[b];if(45==f<<24>>24){f=b+1|0;m[c]=45;var e=c+1|0,l=f,k=m[f]}else{e=c,l=b,k=f}46==k<<24>>24?(k=l+1|0,m[e]=46,f=e+1|0,l=k,e=1,k=m[k]):(f=e,e=0);var n=10>((k&255)-48|0)>>>0;a:do{if(n){for(var z=l,p=f,s=k;;){var z=z+1|0,v=p+1|0;m[p]=s;s=m[z];if(10>((s&255)-48|0)>>>0){p=v}else{var t=z,u=v,w=1,A=s;break a}}}else{t=l,u=f,w=0,A=k}}while(0);do{if(46==A<<24>>24&0==(e|0)){if(m[u]=46,k=u+1|0,l=t+1|0,f=m[l],10>((f&255)-48|0)>>>0){for(var B=k;;){m[B]=f;var C=B+1|0,y=l+1|0,f=m[y];if(10>((f&255)-48|0)>>>0){B=C,l=y}else{break}}m[C]=0;B=y}else{var D=k,F=l;g=703}}else{D=u,F=t,g=703}}while(0);if(703==g){m[D]=0;if(0==(w|0)){return h=d,0}B=F}g=m[B];if(0==g<<24>>24){return h=d,B}if(0==(ti(g&255)|0)){if(95==m[B]<<24>>24){g=B}else{return h=d,B}}else{g=B}for(;;){var E=g+1|0,M=m[E];if(0==M<<24>>24){break}if(95==M<<24>>24|0!=(ti(M&255)|0)){g=E}else{break}}m[E]=0;g=a[qj>>2];g=0!=(g|0)?g:Yl|0;t=a[Qd>>2];la(0,mM|0,(j=h,h+=20,a[j>>2]=g,a[j+4>>2]=t,a[j+8>>2]=b,a[j+12>>2]=c,a[j+16>>2]=B,j));m[E]=M;h=d;return B}function vw(b){var c=h,d=D[qa+28>>1];D[qa+28>>1]=d+1&65535;if(0==d<<16>>16){var d=a[qj>>2],d=0!=(d|0)?d:Yl|0,g=a[Qd>>2];la(1,nM|0,(j=h,h+=16,a[j>>2]=d,a[j+4>>2]=g,a[j+8>>2]=b,a[j+12>>2]=g,j));var b=h,f,d=a[qa+24>>2]+1|0;if(0!=(a[Gc>>2]|0)){la(3,oM|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));for(g=a[Gc>>2];;){var e=g-1|0;if(e>>>0<=d>>>0){break}if(0==(ah(m[e]&255)|0)){g=e}else{f=732;break}}732==f&&(f=m[e],m[e]=0,la(3,d,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),m[e]=f);la(3,pM|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));f=a[Gc>>2];d=m[f];m[f]=0;la(3,e,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));m[a[Gc>>2]]=d;la(3,qM|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));la(3,a[Gc>>2],(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j))}h=b}h=c}function uw(b,c,d){var g,f=h;h+=4;g=f>>2;a[g]=d;var e=3==(b|0),l=e?a[ww>>2]:2==(b|0)?1:b;a[ww>>2]=l;var k=a[xw>>2];a[xw>>2]=k>>>0>l>>>0?k:l;if(l>>>0<a[rM>>2]>>>0){b=a[Vp>>2];if(0==(b|0)&&(b=wn(),a[Vp>>2]=b,0==(b|0))){return h=f,1}e?e=b:(e=zQa(b),a[sM>>2]=e,e=a[Vp>>2]);tM(e,c,a[g])}else{if(0!=(a[$l>>2]|0)){return uM(b,c,d),h=f,0}e?g=d:(e=1==(b|0)?yw|0:zw|0,Va(a[oa>>2],vM|0,(j=h,h+=4,a[j>>2]=e,j)),g=a[g]);tM(a[oa>>2],c,g)}h=f;return 0}function wM(b){var c=h;h+=4;a[c>>2]=arguments[wM.length];uw(1,b,a[c>>2]);h=c}function uM(b,c,d){var g=h;h+=4;var f;a[g>>2]=d;if(0==(a[sj>>2]|0)&&(d=Gb(a[am>>2]),a[sj>>2]=d,0==(d|0))){Lc(Aw|0,35,1,a[oa>>2]);h=g;return}3!=(b|0)&&(J[a[$l>>2]](1==(b|0)?yw|0:zw|0),J[a[$l>>2]](xM|0));for(;;){b=KQa(a[sj>>2],a[am>>2],c,a[g>>2]);d=a[am>>2];if(-1<(b|0)&(b|0)<(d|0)){f=769;break}d<<=1;b=b+1|0;b=(d|0)>(b|0)?d:b;a[am>>2]=b;if(0==(mc(a[sj>>2],b)|0)){f=771;break}}771==f?(Lc(Aw|0,35,1,a[oa>>2]),h=g):769==f&&(J[a[$l>>2]](a[sj>>2]),h=g)}function Mi(b,c){var d=a[a[b+16>>2]>>2],d=J[a[d>>2]](d,c,512);if(0==(d|0)||(a[b+32>>2]|0)==(b|0)){return d}var g=a[b+20>>2];return d=J[a[g>>2]](g,d,4)}function TL(b,c){var d=h;h+=4;a[d>>2]=c;var g=a[b+20>>2],g=J[a[g>>2]](g,d,512);h=d;return g}function cl(b,c){var d=Mi(a[b+32>>2],c);if(0!=(d|0)){return mj(b,d),d}var d=Zv(b,c,a[a[b+40>>2]>>2]),g=a[a[b+16>>2]>>2];J[a[g>>2]](g,d|0,1);mj(b,d);return d}function Zv(b,c,d){var g,f=Yc(1,a[qa+4>>2]);g=f>>2;a[f>>2]=a[f>>2]&-16|1;a[g+3]=Dc(c);var c=(b+16|0)>>2,e=a[c]+16|0,h=a[e>>2];a[e>>2]=h+1|0;a[g+4]=h;a[g+5]=a[b+32>>2];e=rc(a[a[a[c]+4>>2]+4>>2]);if(0==(e|0)){return a[g+1]=0,a[g+2]=0,f}b=(f+4|0)>>2;a[b]=Yc(e,4);a[g+2]=Yc((e+7|0)/8&-1,1);if(0>=(e|0)){return f}g=d+4|0;if(0==(d|0)){for(d=0;!(g=Dc(a[a[a[a[a[c]+4>>2]+8>>2]+(d<<2)>>2]+4>>2]),a[a[b]+(d<<2)>>2]=g,d=d+1|0,(d|0)==(e|0));){}}else{for(c=0;!(d=Dc(a[a[g>>2]+(c<<2)>>2]),a[a[b]+(c<<2)>>2]=d,c=c+1|0,(c|0)==(e|0));){}}return f}function mj(b,c){if(0==(TL(b,a[c+16>>2])|0)){var d=a[b+20>>2];J[a[d>>2]](d,c|0,1);if(0==(a[b>>2]&64|0)){var g=a[b+36>>2],d=a[g+20>>2],g=Og(d,g);if(0!=(g|0)){for(;!(mj(Yd(a[g+16>>2]),c),g=Ql(d,g),0==(g|0));){}}}}}function Pp(b,c){var d=Ok(b,c),g=0==(d|0);a:do{if(!g){for(var f=d;;){var e=Pk(b,f,c);Np(b,f);if(0==(e|0)){break a}else{f=e}}}}while(0);d=0==(a[b>>2]&64|0);a:do{if(d&&(f=a[b+36>>2],g=a[f+20>>2],e=Ib(g,f),0!=(e|0))){for(f=c|0;;){var h=Yd(a[e+12>>2]),k=a[h+20>>2];0!=(J[a[k>>2]](k,f,4)|0)&&Pp(h,c);e=yb(g,e);if(0==(e|0)){break a}}}}while(0);d=a[b+20>>2];J[a[d>>2]](d,c|0,2);(a[b+32>>2]|0)==(b|0)&&$v(c)}function $v(b){var c=b|0,d=b+20|0,g=a[a[a[d>>2]+16>>2]>>2];J[a[g>>2]](g,c,2);a[b>>2]|=15;dc(a[b+12>>2]);d=a[d>>2];g=0==(a[d>>2]&64|0);a:do{if(g){var f=rc(a[a[a[d+16>>2]+4>>2]+4>>2]);if(0<(f|0)){for(var e=b+4|0,h=0;;){if(dc(a[a[e>>2]+(h<<2)>>2]),h=h+1|0,(h|0)==(f|0)){break a}}}}}while(0);G(a[b+4>>2]);G(a[b+8>>2]);G(c)}function ra(b){b=a[b+20>>2];return J[a[b>>2]](b,0,128)}function ba(b,c){var d=a[b+20>>2];return J[a[d>>2]](d,c|0,8)}function zr(){var b,c,d=h;h+=2032;var g,f=d+2e3,e=d+2008,l=d+2016,k=d+2024,n=d|0,z=d+400|0;a[Wp>>2]=0;a[Qg>>2]=-2;var p=f|0,s=f+4|0,v=e|0,t=e+4|0,u=l|0,w=l+4|0,A=k|0,B=k+4|0,C=0,y=0,T=n,F=n,E=z,M=z,X=200;a:for(;;){D[F>>1]=C&65535;if(((X-1<<1)+T|0)>>>0>F>>>0){var O=T,I=F,J=E,H=M;c=H>>2;var K=X}else{var L=F-T>>1,N=L+1|0;if(9999<X>>>0){g=941;break}var Q=X<<1,S=1e4<Q>>>0?1e4:Q,R=Gb(10*S+7|0);if(0==(R|0)){g=941;break}var U=R,W=T;tf(R,W,N<<1);var ca=(((S<<1)+7|0)>>>3<<3)+R|0;tf(ca,E,N<<3);(T|0)!=(n|0)&&G(W);if((S-1|0)>(L|0)){O=U,I=(L<<1)+U|0,J=ca,H=(L<<3)+ca|0,c=H>>2,K=S}else{var Z=U,Y=1;break}}if(9==(C|0)){Z=O;Y=0;break}var V=m[Bw+C|0],ja=V<<24>>24;if(-68==V<<24>>24){g=873}else{var aa=a[Qg>>2];if(-2==(aa|0)){var da=aM(),ea=a[Qg>>2]=da}else{ea=aa}var xa=1>(ea|0)?a[Qg>>2]=0:267>ea>>>0?m[yM+ea|0]&255:2;var $=xa+ja|0;if(80<$>>>0){g=873}else{if((m[Xp+$|0]<<24>>24|0)!=(xa|0)){g=873}else{var ba=m[Yp+$|0],ha=ba<<24>>24;if(1>ba<<24>>24){if(0==ba<<24>>24){g=929}else{var ga=-ha|0;g=874}}else{a[Qg>>2]=-2;var sa=H+8|0,fa=sa,ra=Yh,tb=a[ra+4>>2];a[fa>>2]=a[ra>>2];a[fa+4>>2]=tb;var ya=ha,ka=0==(y|0)?0:y-1|0,wa=I,Ab=sa}}}}if(873==g){var Fa=m[zM+C|0];0==Fa<<24>>24?g=929:(ga=Fa&255,g=874)}b:do{if(874==g){g=0;var Ga=m[AM+ga|0]&255,na=1-Ga|0,ta=a[(na<<3>>2)+c],Ka=(na<<3)+H+4|0,za=a[Ka>>2];if(5==(ga|0)){a[qa+16>>2]=0;var ma=ta,pa=za}else{if(6==(ga|0)){ma=a[c],pa=za}else{if(7==(ga|0)){ma=0,pa=za}else{if(8==(ga|0)){a[tj>>2]=0,a[qa+20>>2]=Af|0,ma=ta,pa=za}else{if(9==(ga|0)){a[tj>>2]=2,a[qa+20>>2]=Af|0,ma=ta,pa=za}else{if(11==(ga|0)){a[tj>>2]=3,a[qa+20>>2]=Bf|0,ma=ta,pa=za}else{if(12==(ga|0)){a[ye>>2]=3,ma=ta,pa=za}else{if(13==(ga|0)){a[ye>>2]=1,a[Zp>>2]=a[a[a[Vc>>2]+40>>2]>>2],ma=ta,pa=za}else{if(10==(ga|0)){a[tj>>2]=1,a[qa+20>>2]=Bf|0,ma=ta,pa=za}else{if(4==(ga|0)){var oa=a[qa+16>>2];0!=(oa|0)&&Sf(oa);a[qa+16>>2]=0;ma=ta;pa=za}else{if(2==(ga|0)){var Ha=H|0,Ra=a[Ha>>2],va=h;h+=128;if(0==(Ra|0)){var Aa=va|0;BM(Aa);var La=Aa}else{La=Ra}var Ea=xn(La,a[tj>>2]);a[qa+16>>2]=Ea;a[ye>>2]=3;Cw(Ea);m[Kf]=1;h=va;dc(a[Ha>>2]);ma=ta;pa=za}else{if(3==(ga|0)){m[qa+30|0]=1,CM(),ma=ta,pa=za}else{if(14==(ga|0)){a[ye>>2]=2,a[bm>>2]=a[a[a[Vc>>2]+40>>2]+4>>2],ma=ta,pa=za}else{if(23==(ga|0)){var Ya=H-16|0,Ma=H|0;Dw(a[Ya>>2],a[Ma>>2]);dc(a[Ya>>2]);dc(a[Ma>>2]);ma=ta;pa=za}else{if(25==(ga|0)){var Za=H|0;Dw(a[Za>>2],Es|0);dc(a[Za>>2]);ma=ta;pa=za}else{if(32==(ga|0)){vw(DM|0),ma=ta,pa=za}else{if(37==(ga|0)){a[ye>>2]=3,ma=ta,pa=za}else{if(38==(ga|0)){a[ye>>2]=3,ma=ta,pa=za}else{if(39==(ga|0)){var Qa=a[H-8>>2],ab=a[cm>>2];a[cm>>2]=0;ma=Qa;pa=ab}else{if(40==(ga|0)){var $a=H|0,jb,Ca=cl(a[Vc>>2],a[$a>>2]);m[Kf]=0;jb=Ca;dc(a[$a>>2]);ma=jb;pa=za}else{if(42==(ga|0)){a[cm>>2]=a[c],ma=ta,pa=za}else{if(43==(ga|0)){var Ia=H-16|0,eb=H|0,ub;var Sa=a[Ia>>2],Pa=a[eb>>2],ua=h;h+=1024;var Oa=Ba(Sa)+Ba(Pa)+2|0;if(1025>(Oa|0)){var Wa=ua|0,pb=Wa,ob=Wa}else{pb=Gb(Oa),ob=ua|0}Rf(pb,Sa);var bb=pb+Ba(pb)|0;Pb=58;m[bb]=Pb&255;Pb>>=8;m[bb+1]=Pb&255;uf(pb,Pa);var qb=Dc(pb);(pb|0)!=(ob|0)&&G(pb);h=ua;ub=qb;a[cm>>2]=ub;dc(a[Ia>>2]);dc(a[eb>>2]);ma=ta;pa=za}else{if(44==(ga|0)){a[ye>>2]=1,a[Zp>>2]=a[c],ma=ta,pa=za}else{if(45==(ga|0)){dc(a[H-16+4>>2]),a[ye>>2]=3,ma=ta,pa=za}else{if(46==(ga|0)){EM(a[c],a[c+1]),ma=ta,pa=za}else{if(47==(ga|0)){a[bm>>2]=a[a[a[a[Te>>2]>>2]+40>>2]+4>>2],a[ye>>2]=2,ma=ta,pa=za}else{if(48==(ga|0)){Ew(),ma=ta,pa=za}else{if(49==(ga|0)){EM(a[c],a[c+1]),ma=ta,pa=za}else{if(50==(ga|0)){a[bm>>2]=a[a[a[a[Te>>2]>>2]+40>>2]+4>>2],a[ye>>2]=2,ma=ta,pa=za}else{if(51==(ga|0)){Ew(),ma=ta,pa=za}else{if(52==(ga|0)){$p(a[c],a[c+1]),ma=ta,pa=za}else{if(53==(ga|0)){$p(a[c],a[c+1]),ma=ta,pa=za}else{if(55==(ga|0)){$p(a[c],a[c+1]),ma=ta,pa=za}else{if(56==(ga|0)){$p(a[c],a[c+1]),ma=ta,pa=za}else{if(58==(ga|0)){aq(f),ma=a[p>>2],pa=a[s>>2]}else{if(59==(ga|0)){FM(),ma=ta,pa=za}else{if(60==(ga|0)){aq(e),ma=a[v>>2],pa=a[t>>2]}else{if(61==(ga|0)){FM(),ma=ta,pa=za}else{if(62==(ga|0)){aq(l),ma=a[u>>2],pa=a[w>>2]}else{if(63==(ga|0)){var Cb=h,kb=a[a[Vc>>2]+12>>2],wb=a[Qd>>2];la(0,GM|0,(j=h,h+=8,a[j>>2]=kb,a[j+4>>2]=wb,j));la(3,HM|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));var vb=a[a[dm+(a[uj>>2]-2<<2)>>2]+12>>2];la(3,IM|0,(j=h,h+=4,a[j>>2]=vb,j));h=Cb;aq(k);ma=a[A>>2];pa=a[B>>2]}else{if(64==(ga|0)){b=(H|0)>>2;var xb=RL(a[qa+16>>2],a[b]),Va=a[Vc>>2];if(0==(xb|0)){var nb=oo(Va,a[b])}else{gt(Va,xb|0),nb=xb}Cw(nb);m[Kf]=0;dc(a[b]);ma=ta}else{if(65==(ga|0)){ma=a[c]}else{if(66==(ga|0)){ma=a[c]}else{if(67==(ga|0)){ma=a[c]}else{if(68==(ga|0)){var rb=H-16|0,lb=H|0,Ta;var cb=a[rb>>2],fb=a[lb>>2],Ua=h;h+=1024;var sb=Ba(cb)+Ba(fb)+1|0;if(1025>(sb|0)){var Na=Ua|0,Fb=Na,Db=Na}else{Fb=Gb(sb),Db=Ua|0}Rf(Fb,cb);uf(Fb,fb);var Ob=Dc(Fb);(Fb|0)!=(Db|0)&&G(Fb);h=Ua;Ta=Ob;dc(a[rb>>2]);dc(a[lb>>2]);ma=Ta}else{ma=ta}}}}}pa=za}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}var Eb=(-Ga<<1)+I|0,hb=(na<<3)+H|0;a[hb>>2]=ma;a[Ka>>2]=pa;var Bb=(m[JM+ga|0]&255)-21|0,Ja=D[Eb>>1]<<16>>16,ib=(m[KM+Bb|0]<<24>>24)+Ja|0;do{if(81>ib>>>0&&(m[Xp+ib|0]<<24>>24|0)==(Ja|0)){ya=m[Yp+ib|0]<<24>>24;ka=y;wa=Eb;Ab=hb;break b}}while(0);ya=m[LM+Bb|0]<<24>>24;ka=y;wa=Eb;Ab=hb}else{if(929==g){g=0;do{if(0==(y|0)){a[Wp>>2]=a[Wp>>2]+1|0;vw(MM|0);var db=I,yb=H,mb=V}else{if(3==(y|0)){var Ib=a[Qg>>2];if(1>(Ib|0)){if(0==(Ib|0)){Z=O;Y=1;break a}else{db=I,yb=H,mb=V}}else{a[Qg>>2]=-2,db=I,yb=H,mb=V}}else{db=I,yb=H,mb=V}}}while(0);c:for(;;){do{if(-68!=mb<<24>>24){var Hb=(mb<<24>>24)+1|0;if(81>Hb>>>0&&1==m[Xp+Hb|0]<<24>>24){var ic=m[Yp+Hb|0];if(0<ic<<24>>24){break c}}}}while(0);if((db|0)==(O|0)){Z=O;Y=1;break a}var Jb=db-2|0,db=Jb,yb=yb-8|0,mb=m[(D[Jb>>1]<<16>>16)+Bw|0]}var Kb=yb+8|0,Lb=Kb,Mb=Yh,Nb=a[Mb+4>>2];a[Lb>>2]=a[Mb>>2];a[Lb+4>>2]=Nb;ya=ic<<24>>24;ka=3;wa=db;Ab=Kb}}}while(0);C=ya;y=ka;T=O;F=wa+2|0;E=J;M=Ab;X=K}941==g&&(vw(NM|0),Z=T,Y=2);if((Z|0)==(n|0)){return h=d,Y}G(Z);h=d;return Y}function bg(b){return 0==(a[Ne>>2]|0)|0==(b|0)?0:b=(m[Tp]?-2147483648:0)&a[b-4>>2]}function Dw(b,c){if(m[Kf]){var d=a[Vc>>2],d=(a[d+32>>2]|0)==(d|0)?c:Y|0}else{d=Y|0}var g=a[ye>>2];if(2==(g|0)){g=$(a[a[a[Vc>>2]+40>>2]+4>>2]|0,b);if(0==(g|0)){d=Th(a[qa+16>>2],b,d)}else{if(0==m[g+13|0]<<24>>24){d=g}else{if(m[Kf]){if(d=a[Vc>>2],(a[d+32>>2]|0)!=(d|0)){d=g}else{return}}else{d=g}}}qc(a[bm>>2]|0,a[d+8>>2],c)}else{if(1==(g|0)){g=$(a[a[a[Vc>>2]+40>>2]>>2]|0,b);if(0==(g|0)){d=xi(a[qa+16>>2],b,d)}else{if(0!=m[g+13|0]<<24>>24&&m[Kf]){return}d=g}qc(a[Zp>>2]|0,a[d+8>>2],c)}else{if(0==(g|0)||3==(g|0)){g=$(a[Vc>>2]|0,b);if(0==(g|0)){d=Mp(a[qa+16>>2],b,d)}else{if(0!=m[g+13|0]<<24>>24&&m[Kf]){return}d=g}qc(a[Vc>>2]|0,a[d+8>>2],c)}}}}function EM(b,c){var d;d=Yc(1,20);a[d+16>>2]=a[Te>>2];a[Te>>2]=d;var g=Yc(1,12),f=a[Te>>2];d=f>>2;a[d+2]=g;f=f+4|0;a[f>>2]=g;a[g>>2]=b;a[g+4>>2]=c;a[a[f>>2]+8>>2]=0;a[d+3]=m[bq]<<24>>24;g=a[Vc>>2];a[d]=g;Yv(g,a[g+40>>2]);m[bq]=1}function $p(b,c){var d,g=Yc(1,12);d=(a[Te>>2]+8|0)>>2;a[a[d]+8>>2]=g;g=a[a[d]+8>>2];a[d]=g;a[g>>2]=b;a[g+4>>2]=c;a[a[d]+8>>2]=0}function aq(b){a[b>>2]=CM()|0;a[b+4>>2]=0}function FM(){var b=h;h+=128;m[Kf]=0;var c=b|0;BM(c);Cw(oo(a[Vc>>2],c));h=b}function BM(b){var c=h,d=a[Fw>>2];a[Fw>>2]=d+1|0;Ma(b,OM|0,(j=h,h+=4,a[j>>2]=d,j));h=c}function Dc(b){0==(a[Ne>>2]|0)&&gM();if(0==(b|0)){return 0}var c=a[Ne>>2],c=J[a[c>>2]](c,b-12|0,4);0==(c|0)?(c=Gb(Ba(b)+16|0),a[c+8>>2]=1,Rf(c+12|0,b),b=a[Ne>>2],J[a[b>>2]](b,c,1)):(b=c+8|0,a[b>>2]=a[b>>2]+1|0);b=c;return b+12|0}function gM(){var b=Nc(PM,a[Xc>>2]);a[Ne>>2]=b;m[Tp]=1;m[Gw]=1}function dc(b){var c=h,d=a[Ne>>2];if(!(0==(d|0)|0==(b|0))){if(d=J[a[d>>2]](d,b-12|0,4),0==(d|0)){la(1,QM|0,(j=h,h+=4,a[j>>2]=b,j))}else{var b=d+8|0,g=a[b>>2]-1|0;a[b>>2]=g;m[Gw]&0!=(g|0)||(b=a[Ne>>2],J[a[b>>2]](b,d,2),G(d))}}h=c}function Hw(b){pf(b);var c=a[b+12>>2],d=a[b+16>>2],g=Zh(c,d);0==(g|0)?de(c,d,b):og(b,g)}function RM(b){var c=b+163|0;if(0==m[c]<<24>>24){m[c]=1;c=b+164|0;m[c]=1;var b=b+184|0,d=a[a[b>>2]>>2],g=0==(d|0);a:do{if(!g){for(var f=0,e=d;;){var h=a[e+12>>2];0==m[h+164|0]<<24>>24?0==m[h+163|0]<<24>>24&&RM(h):(Hw(e),f=f-1|0);f=f+1|0;e=a[a[b>>2]+(f<<2)>>2];if(0==(e|0)){break a}}}}while(0);m[c]=0}}function Ew(){var b=a[Te>>2],c=a[b+4>>2],d=c+8|0,g=a[d>>2];if(0==(g|0)){g=b}else{for(var b=c,c=d,f=g;;){var g=a[b+4>>2],d=a[f+4>>2],e=a[b>>2],h=e;1==(a[e>>2]&15|0)?b=0:(b=h,e=ra(h));h=f=a[f>>2];1==(a[f>>2]&15|0)?h=0:f=ra(h);var k=0==(e|0);a:do{if(!k){for(var j=0==(f|0),z=0==(b|0),p=0==(h|0),s=e;;){b:do{if(!j){for(var v=f;;){var t=uh(a[Vc>>2],s,v);if(0!=(t|0)){var u=a[t+12>>2],w=(a[t+16>>2]|0)!=(u|0)&(u|0)==(s|0),u=w?d:g,w=w?g:d;0!=(u|0)&&0!=m[u]<<24>>24&&(qc(t|0,1,u),dc(u));0!=(w|0)&&0!=m[w]<<24>>24&&(qc(t|0,2,w),dc(w))}if(p){break b}v=ba(h,v);if(0==(v|0)){break b}}}}while(0);if(z){break a}s=ba(b,s);if(0==(s|0)){break a}}}}while(0);d=a[c>>2];c=d+8|0;g=a[c>>2];if(0==(g|0)){break}else{b=d,f=g}}g=c=a[Te>>2];c=a[c+4>>2]}if(0==(c|0)){c=g}else{for(;!(g=a[c+8>>2],1==(a[a[c>>2]>>2]&15|0)&&G(c),0==(g|0));){c=g}c=a[Te>>2]}g=a[Vc>>2];(g|0)==(a[c>>2]|0)?(LL(g),c=a[Te>>2],m[bq]=a[c+12>>2]&255,a[Te>>2]=a[c+16>>2],m[Kf]=0,G(c),a[ye>>2]=3):S()}function Cw(b){var c=h,d=a[uj>>2];63<(d|0)?(la(1,SM|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Pe()):(a[uj>>2]=d+1|0,a[dm+(d<<2)>>2]=b,a[Vc>>2]=b,h=c)}function CM(){var b=h,c=a[uj>>2];0==(c|0)&&(la(1,TM|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),Pe());var d=c-1|0;a[uj>>2]=d;var g=a[dm+(d<<2)>>2];if(0>=(d|0)){return a[Vc>>2]=0,h=b,g}c=a[dm+(c-2<<2)>>2];a[Vc>>2]=c;h=b;return g}function UM(){var b=a[$h>>2];if(0<(b|0)){for(var c=a[Id>>2],d=0,g=0,f=0;;){var e=c+36*f|0,h=c+36*f+12|0,k=a[h>>2],j=0==(k|0),m=0==(d|0);a:do{if(j){var p=m?a[e>>2]:g,s=d+1|0}else{if(m){p=g,s=0}else{if((a[e>>2]|0)>(g|0)&0<(k|0)){for(var v=0,t=k;;){var u=a[a[(c+4>>2)+(9*f|0)]+(v<<2)>>2],w=u+4|0;if(0<(a[w>>2]|0)){t=u|0;for(u=0;;){var A=a[a[t>>2]+(u<<2)>>2]+236|0;a[A>>2]=a[A>>2]-d|0;u=u+1|0;if((u|0)>=(a[w>>2]|0)){break}}w=a[h>>2]}else{w=t}v=v+1|0;if((v|0)<(w|0)){t=w}else{p=g;s=d;break a}}}else{p=g,s=d}}}}while(0);f=f+1|0;if((f|0)<(b|0)){d=s,g=p}else{break}}}}function VM(c,d){var i,g=h,e,Xa=a[d+24>>2];WM(c);var l=-1==(Xa|0);i=(d+8|0)>>2;for(var k=d|0,n=0;;){if(!((n|0)<(Xa|0)|l)){e=1151;break}var z=ra(c),p=0==(z|0);a:do{if(!p){for(var s=z;;){if(a[s+236>>2]=0,s=ba(c,s),0==(s|0)){break a}}}}while(0);Iw(c);z=XM(c);f[0]=z;a[i]=b[0];a[i+1]=b[1];0!=m[ld]<<24>>24&&Va(a[oa>>2],YM|0,(j=h,h+=8,f[0]=z,a[j>>2]=b[0],a[j+4>>2]=b[1],j));if(l&&(b[0]=a[i],b[1]=a[i+1],f[0])<=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])){break}z=c;p=fa(Vh(z)<<2);a[em>>2]=p;if(0<(Vh(z)|0)){for(p=0;!(a[a[em>>2]+(p<<2)>>2]=p,p=p+1|0,(p|0)>=(Vh(z)|0));){}}cq(z);ch(a[em>>2],Vh(z),334);ZM(z);n=n+1|0}1151!=e&&(e=d+20|0,a[d+16>>2]=a[e>>2],a[e>>2]=n);Iw(c);cq(c);UM();n=XM(c);f[0]=n;a[i]=b[0];a[i+1]=b[1];h=g}function WM(c){var d,i,g=Cb(24*Vh(c)|0);a[vj>>2]=g;a[ze>>2]=0;var g=ra(c),e=0==(g|0);a:do{if(!e){for(d=g;;){if(a[d+136>>2]=-1,d=ba(c,d),0==(d|0)){break a}}}}while(0);g=ra(c);if(0!=(g|0)){for(;;){i=g;e=g+24|0;if(0==(a[g+220>>2]|0)){var h=fa(4);d=a[ze>>2];var l=a[vj>>2];a[(l>>2)+(6*d|0)]=h;a[h>>2]=i;a[(l+4>>2)+(6*d|0)]=1;i=e+24|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);h=l+24*d+8|0;f[0]=i;a[h>>2]=b[0];a[h+4>>2]=b[1];i=e+32|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);l=l+24*d+16|0;f[0]=i;a[l>>2]=b[0];a[l+4>>2]=b[1];a[e+112>>2]=d;a[ze>>2]=d+1|0}else{if(h=Zb(i),d=h+136|0,l=a[d>>2],-1<(l|0)){d=a[vj>>2];var h=d+24*l+4|0,k=a[h>>2];a[h>>2]=k+1|0;a[a[(d>>2)+(6*l|0)]+(k<<2)>>2]=i;h=e+24|0;i=(d+24*l+8|0)>>2;h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0])+(b[0]=a[i],b[1]=a[i+1],f[0]);f[0]=h;a[i]=b[0];a[i+1]=b[1];d=(d+24*l+16|0)>>2;i=(b[0]=a[d],b[1]=a[d+1],f[0]);h=e+32|0;h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]);f[0]=i<h?h:i;a[d]=b[0];a[d+1]=b[1];a[e+112>>2]=l}else{var k=fa(a[h+220>>2]<<2),e=a[ze>>2],l=a[vj>>2],j=l+24*e|0;a[j>>2]=k;a[k>>2]=h;(h|0)==(i|0)?(a[(l+4>>2)+(6*e|0)]=1,i=g+48|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),h=l+24*e+8|0,f[0]=i,a[h>>2]=b[0],a[h+4>>2]=b[1],i=g+56|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),l=l+24*e+16|0,f[0]=i):(a[a[j>>2]+4>>2]=i,a[(l+4>>2)+(6*e|0)]=2,i=h+48|0,k=g+48|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])+(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),k=l+24*e+8|0,f[0]=i,a[k>>2]=b[0],a[k+4>>2]=b[1],i=h+56|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),h=g+56|0,h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),l=l+24*e+16|0,f[0]=i<h?h:i);a[l>>2]=b[0];a[l+4>>2]=b[1];a[d>>2]=e;a[g+136>>2]=e;a[ze>>2]=e+1|0}}g=ba(c,g);if(0==(g|0)){break}}}}function XM(c){cq(c);var d=a[$h>>2],i=(d-1)*a[c+260>>2]|0;if(0>=(d|0)){var g,e;return d=0/i}for(var h=a[Id>>2],c=a[c+256>>2],l=0,k=0;;){var j=h+36*k+20|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])+(c*a[(h+16>>2)+(9*k|0)]|0),l=l<j?j:l,j=h+36*k+28|0,i=i+(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),k=k+1|0;if((k|0)>=(d|0)){g=l;e=i;break}}return d=g/e}function cq(c){var d,i,g;a[$h>>2]=0;var e=a[Id>>2];if(0!=(e|0)){var h=0<(a[ze>>2]|0);a:do{if(h){i=0;for(var l=e;;){var k=a[(l+4>>2)+(9*i|0)];0!=(k|0)&&(G(k),l=a[Id>>2]);k=a[(l+8>>2)+(9*i|0)];0!=(k|0)&&(G(k),l=a[Id>>2]);i=i+1|0;if((i|0)>=(a[ze>>2]|0)){g=l;break a}}}else{g=e}}while(0);G(g)}e=fa(36*a[ze>>2]|0);a[Id>>2]=e;e=a[ze>>2];h=0<(e|0);a:do{if(h){g=0;for(i=e;;){if(i=fa(i<<2),a[(a[Id>>2]+4>>2)+(9*g|0)]=i,i=fa(a[ze>>2]<<2),l=a[Id>>2],a[(l+8>>2)+(9*g|0)]=i,a[(l>>2)+(9*g|0)]=g,i=g+1|0,g=(l+36*g+12|0)>>2,a[g]=0,a[g+1]=0,a[g+2]=0,a[g+3]=0,a[g+4]=0,a[g+5]=0,l=a[ze>>2],(i|0)<(l|0)){g=i,i=l}else{break a}}}}while(0);e=ra(c);h=0==(e|0);a:do{if(!h){for(g=e;;){i=Ib(c,g);l=0==(i|0);b:do{if(!l){for(k=i;;){d=a[a[k+16>>2]+236>>2]+1|0;var j=k+12|0,m=(d|0)<(a[a[j>>2]+236>>2]|0);c:do{if(m){for(var p=a[Id>>2],s=d;;){var v=p+36*s+16|0;a[v>>2]=a[v>>2]+1|0;s=s+1|0;if((s|0)>=(a[a[j>>2]+236>>2]|0)){break c}}}}while(0);k=yb(c,k);if(0==(k|0)){break b}}}}while(0);g=ba(c,g);if(0==(g|0)){break a}}}}while(0);e=a[ze>>2];if(0<(e|0)){c=c+256|0;h=a[vj>>2];g=0;for(l=a[$h>>2];!(i=(a[a[(h>>2)+(6*g|0)]>>2]+236|0)>>2,d=a[i],k=d+1|0,(k|0)>(l|0)&&(l=a[$h>>2]=k),k=h+24*g+8|0,j=72*(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),k=a[Id>>2],d=(k+36*d+20|0)>>2,m=(b[0]=a[d],b[1]=a[d+1],f[0]),f[0]=m+j+((0<m)<<31>>31&a[c>>2]|0),a[d]=b[0],a[d+1]=b[1],j=a[i],d=(k+36*j+28|0)>>2,m=(b[0]=a[d],b[1]=a[d+1],f[0]),p=h+24*g+16|0,p=72*(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),m<p?(f[0]=p,a[d]=b[0],a[d+1]=b[1],d=a[i]):d=j,a[a[(k+4>>2)+(9*d|0)]+(a[(k+12>>2)+(9*d|0)]<<2)>>2]=h+24*g|0,i=k+36*a[i]+12|0,a[i>>2]=a[i>>2]+1|0,g=g+1|0,(g|0)>=(e|0));){}}}function ZM(c){var d,i,g,e=a[$h>>2],h=a[em>>2];d=a[Id>>2];i=d>>2;for(var l=0;(l|0)<(e|0);){var k=a[h+(l<<2)>>2],j=l+1|0;if(2>(a[i+(9*k|0)+3]|0)){l=j}else{g=1215;break}}if(1215==g){if((e|0)>(j|0)){var z=d+36*a[h+(j<<2)>>2]+20|0,p=k,z=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0])}else{var p=k,z=0}}if((l|0)!=(e|0)){ch(a[i+(9*p|0)+1],a[i+(9*p|0)+3],14);k=a[Id>>2];i=k+36*p+20|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);if(z>.25*i){if(z<.75*i){var s=z}else{g=1220}}else{g=1220}1220==g&&(s=.5*i);g=a[(k+12>>2)+(9*p|0)];if(0<(g|0)){c=c+256|0;for(l=e=i=z=0;;){var v,h=a[(k+8>>2)+(9*p|0)];do{if(0==(a[h+(l<<2)>>2]|0)){var t=a[a[(k+4>>2)+(9*p|0)]+(l<<2)>>2];d=(t+8|0)>>2;var u=72*(b[0]=a[d],b[1]=a[d+1],f[0]),w=a[c>>2]&(0<e)<<31>>31|0,j=0==(z|0);if(e+u+w<=s|j){d=e+u+w,u=i,w=j?1:z,t=j?t:v,j=k}else{var j=v+4|0,A=a[j>>2];if(0<(A|0)){for(var u=t+4|0,w=v|0,t=t|0,B=0,C=a[u>>2];;){if(0<(C|0)){for(C=0;;){m[de(a[a[w>>2]+(B<<2)>>2],a[a[t>>2]+(C<<2)>>2],0)+124|0]=1;var C=C+1|0,y=a[u>>2];if((C|0)>=(y|0)){break}}C=y;A=a[j>>2]}B=B+1|0;if((B|0)>=(A|0)){break}}j=a[Id>>2];u=a[(j+8>>2)+(9*p|0)]}else{u=h,j=k}a[u+(l<<2)>>2]=1;u=j+36*p+12|0;a[u>>2]=a[u>>2]-1|0;u=j+36*p+16|0;a[u>>2]=a[u>>2]+1|0;u=72*(b[0]=a[d],b[1]=a[d+1],f[0])+(a[c>>2]|0);d=(j+36*p+20|0)>>2;u=(b[0]=a[d],b[1]=a[d+1],f[0])-u;f[0]=u;a[d]=b[0];a[d+1]=b[1];d=e;u=i;w=z;t=v}}else{d=e,u=i+1|0,w=z,t=v,j=k}}while(0);l=l+1|0;if((l|0)<(u+g|0)){v=t,z=w,i=u,e=d,k=j}else{break}}}}}function $M(b){var c=b+4|0;if(0>=(a[c>>2]|0)){var d;return 0}for(var b=b|0,g=0,f=0;;){var e=a[a[b>>2]+(f<<2)>>2],h=a[e+20>>2],e=Ib(h,e),k=0==(e|0);a:do{if(k){var j=g}else{for(var m=g,p=e;;){if(m=m+1|0,p=yb(h,p),0==(p|0)){j=m;break a}}}}while(0);f=f+1|0;if((f|0)<(a[c>>2]|0)){g=j}else{d=j;break}}return d}function aN(b){var c=a[dj>>2];return 0!=(c|0)&&(b=mb(b|0,a[c+8>>2]),0!=(b|0)&&0!=m[b]<<24>>24&&0==re(b)<<24>>24)?1:0}function bN(c,d){var i,g=(c|0)/2&-1|0;i=(d+104|0)>>2;var e=(b[0]=a[i],b[1]=a[i+1],f[0])+g;f[0]=e;a[i]=b[0];a[i+1]=b[1];i=(d+112|0)>>2;g=(b[0]=a[i],b[1]=a[i+1],f[0])+g;f[0]=g;a[i]=b[0];a[i+1]=b[1]}function cN(b){Jw(b);var c=ra(b);if(0!=(c|0)){for(;;){var d=Ib(b,c),g=0==(d|0);a:do{if(!g){for(var f=d;;){var e=f,h=0==(a[f+180>>2]|0);b:do{if(h&&0==(aN(e)|0)){var k=f+16|0,j=Zb(a[k>>2]),m=f+12|0,p=Zb(a[m>>2]);if((j|0)!=(p|0)){do{if(0==(a[j+216>>2]|0)&&0==(a[p+216>>2]|0)){h=Zh(j,p);0==(h|0)?de(j,p,e):og(e,h);break b}}while(0);dN(b,a[k>>2],a[m>>2],e)}}}while(0);f=yb(b,f);if(0==(f|0)){break a}}}}while(0);c=ba(b,c);if(0==(c|0)){break}}}}function dN(b,c,d,g){var f=a[g+16>>2],e=a[f+216>>2],h=a[g+12>>2],k=a[h+216>>2],e=(0==(e|0)?0:a[f+236>>2]-a[a[e+272>>2]+236>>2]|0)-(0==(k|0)?0:a[h+236>>2]-a[a[k+272>>2]+236>>2]|0)+(D[g+178>>1]&65535)|0;0<(e|0)?(f=e|0,e=0):(f=0,e=-e|0);b=Lf(b);m[b+162|0]=2;c=Zb(c);d=Zb(d);h=g+164|0;c=Zc(b,c,e,10*ib[h>>2]&-1);a[Zc(b,d,f,ib[h>>2]&-1)+128>>2]=g;a[c+128>>2]=g}function wj(b,c,d,g){var f=a[a[c+16>>2]+236>>2],e=a[a[c+12>>2]+236>>2],f=(f|0)>(e|0)?f:e,e=c+180|0;0!=(a[e>>2]|0)&&sa(dq|0,149,eN|0,Kw|0);a[e>>2]=d;for(var b=b+256|0,g=0==(g|0),e=c+162|0,h=c+164|0,c=c+176|0;;){if(!g){var k=d+176|0;D[k>>1]=D[k>>1]+D[c>>1]&65535}k=d+162|0;D[k>>1]=D[k>>1]+D[e>>1]&65535;k=d+164|0;ib[k>>2]+=ib[h>>2];d=d+12|0;k=a[d>>2];if((a[k+236>>2]|0)==(f|0)){break}bN(a[b>>2],k);d=a[a[a[d>>2]+184>>2]>>2];if(0==(d|0)){break}}}function fN(b,c){return!(0==(b|0)|0==(c|0))&&(a[b+16>>2]|0)==(a[c+16>>2]|0)&&(a[b+12>>2]|0)==(a[c+12>>2]|0)&&(a[b+108>>2]|0)==(a[c+108>>2]|0)&&0!=(fm(b,c)|0)?1:0}function Lw(b){var c,d,g,f,e,h=b+216|0;a[h>>2]=0;e=(b+240|0)>>2;a[e]=0;Jw(b);var k=b+208|0,j=1>(a[k>>2]|0);a:do{if(!j){var z=b+212|0;for(f=1;;){if(gN(b,a[a[z>>2]+(f<<2)>>2]),f=f+1|0,(f|0)>(a[k>>2]|0)){break a}}}}while(0);k=ra(b);j=0==(k|0);a:do{if(!j){for(z=k;;){f=Ib(b,z);var p=0==(f|0);b:do{if(!p){for(var s=f;;){var v=a[s+12>>2]+166|0;g=m[v];3>g<<24>>24&&(m[v]=g+1&255);v=a[s+16>>2]+166|0;g=m[v];3>g<<24>>24&&(m[v]=g+1&255);s=yb(b,s);if(0==(s|0)){break b}}}}while(0);z=ba(b,z);if(0==(z|0)){break a}}}}while(0);k=ra(b);j=0==(k|0);a:do{if(!j){for(z=k;;){f=z;0==(a[z+216>>2]|0)&&(f|0)==(Zb(f)|0)&&(Mw(b,f),a[e]=a[e]+1|0);p=Ib(b,z);s=0==(p|0);b:do{if(!s){v=0;f=v>>2;var t=p;for(g=t>>2;;){var u=t,w=t+24|0,A=0==(a[g+45]|0);c:do{if(A){if(d=7==m[a[u+16>>2]+165|0]<<24>>24?1:7==m[a[u+12>>2]+165|0]<<24>>24,d&=1,0!=(d|0)){0==(fN(v,u)|0)?(hN(b,u),d=u):(d=a[f+45],0!=(d|0)?(wj(b,u,d,0),Rg(u)):(a[a[g+4]+236>>2]|0)==(a[a[g+3]+236>>2]|0)&&(og(u,v),Rg(u)),d=v)}else{d=(t+16|0)>>2;var B=a[d];do{if(0!=(v|0)&&(B|0)==(a[f+4]|0)&&(c=a[g+3],(c|0)==(a[f+3]|0))){if((a[B+236>>2]|0)==(a[c+236>>2]|0)){og(u,v);Rg(u);d=v;break c}if(0==(a[w+84>>2]|0)&&0==(a[f+27]|0)&&0!=(fm(u,v)|0)){0==m[Wi]<<24>>24?(wj(b,u,a[f+45],1),Rg(u)):m[w+100|0]=6;d=v;break c}}}while(0);c=(t+12|0)>>2;if((B|0)==(a[c]|0)){Rg(u),d=u}else{var B=Zb(B),C=Zb(a[c]),y=a[d];if((y|0)!=(B|0)){d=v}else{var D=a[c];if((D|0)!=(C|0)){d=v}else{var F=a[y+236>>2],E=a[D+236>>2];if((F|0)==(E|0)){gm(b,u)}else{if((E|0)>(F|0)){hm(b,B,C,u)}else{C=B=Kr(b,D,y);do{if(!(0==(B|0)|(B|0)==(t|0))&&(y=B+24|0,D=y+156|0,0==(a[D>>2]|0)&&hm(b,a[B+16>>2],a[B+12>>2],C),0==(a[w+84>>2]|0)&&0==(a[y+84>>2]|0)&&0!=(fm(u,C)|0))){0==m[Wi]<<24>>24?(Rg(u),wj(b,u,a[D>>2],1)):(m[w+100|0]=6,m[y+137|0]=1);d=v;break c}}while(0);hm(b,a[c],a[d],u)}}d=u}}}}}else{d=u}}while(0);g=yb(b,t);if(0==(g|0)){break b}else{v=d,f=v>>2,t=g,g=t>>2}}}}while(0);z=ba(b,z);if(0==(z|0)){break a}}}}while(0);(a[b+32>>2]|0)!=(b|0)&&(b=b+224|0,e=a[b>>2],e=0==(e|0)?Cb(4):wb(e,4),a[b>>2]=e,a[e>>2]=a[h>>2])}function hN(b,c){var d=iN(a[c+16>>2]),g=iN(a[c+12>>2]),f=(a[d+236>>2]|0)>(a[g+236>>2]|0),e=f?g:d,g=f?d:g;if((a[e+216>>2]|0)!=(a[g+216>>2]|0)){if(d=Zh(e,g),0!=(d|0)){wj(b,c,d,1)}else{if(d=g+236|0,(a[e+236>>2]|0)!=(a[d>>2]|0)){hm(b,e,g,c);for(e=c+180|0;;){e=a[e>>2];if(0==(e|0)){break}g=a[e+12>>2];if((a[g+236>>2]|0)>(a[d>>2]|0)){break}m[e+124|0]=5;e=a[g+184>>2]}}}}}function hm(c,d,i,g){var e=0==(a[g+108>>2]|0)?-1:(a[i+236>>2]+a[d+236>>2]|0)/2&-1,h=g+180|0;0!=(a[h>>2]|0)&&sa(dq|0,90,Nw|0,jN|0);var l=a[d+236>>2]+1|0,k=i+236|0,j=a[k>>2],z=(l|0)>(j|0);a:do{if(!z){for(var p=d,s=l,v=j;;){if((s|0)<(v|0)){if((s|0)==(e|0)){var v=c,t=g,u=cc,u=t+108|0,w=a[u>>2],A=w+24|0,A=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0]),w=w+32|0,B=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),w=Lf(v);a[w+120>>2]=a[u>>2];u=w+104|0;f[0]=a[a[a[w+20>>2]+32>>2]+256>>2]|0;a[u>>2]=b[0];a[u+4>>2]=b[1];0==m[t+126|0]<<24>>24&&(u=(w+96|0)>>2,0==(a[a[v+32>>2]+152>>2]&1|0)?(f[0]=B,a[u]=b[0],a[u+1]=b[1],v=w+112|0,f[0]=A):(f[0]=A,a[u]=b[0],a[u+1]=b[1],v=w+112|0,f[0]=B),a[v>>2]=b[0],a[v+4>>2]=b[1]);v=w}else{v=c,t=Lf(v),bN(a[v+256>>2],t),v=t}a[v+236>>2]=s}else{v=i}p=de(p,v,g);t=p+164|0;ib[t>>2]*=a[((kN(a[p+12>>2])<<2)+lN>>2)+(3*kN(a[p+16>>2])|0)]|0;s=s+1|0;t=a[k>>2];if((s|0)>(t|0)){break a}else{p=v,v=t}}}}while(0);0==(a[h>>2]|0)&&sa(dq|0,104,Nw|0,mN|0)}function iN(b){return 7==m[b+165|0]<<24>>24?a[a[a[b+216>>2]+276>>2]+(a[b+236>>2]<<2)>>2]:Zb(b)}function nN(b){var c,d;d=(b+32|0)>>2;var g=a[d],f=ra(b);if(0!=(f|0)){for(;;){var e=Ok(a[d],f),h=0==(e|0);a:do{if(!h){var k=0,j=e;for(c=j>>2;;){var m=j;if(0==(Ed(b,j|0)|0)){var p=j,s=0==(fN(k,p)|0),v=j+16|0,t=a[v>>2],u=a[t+236>>2],w=j+12|0,A=a[w>>2],B=a[A+236>>2],C=(u|0)==(B|0);s?C?(u=oN(t,A),0==(u|0)?gm(g,p):((j|0)!=(u|0)&&(pN(p,a[p+16>>2]+208|0),0==(a[c+45]|0)&&og(p,u)),m=k)):(0==(a[c+45]|0)?(sa(Ow|0,234,qN|0,rN|0),p=a[w>>2],u=a[v>>2],k=p,p=a[p+236>>2],t=u,u=a[u+236>>2]):(k=A,p=B),(p|0)>(u|0)?sN(t,k,m):sN(k,t,m)):(a[c+45]=C?k:0,m=a[k+180>>2],0!=(m|0)&&(wj(b,p,m,0),pN(p,a[p+16>>2]+208|0)),m=k)}else{m=k}j=Pk(a[d],j,f);if(0==(j|0)){break a}else{k=m,c=j>>2}}}}while(0);f=ba(b,f);if(0==(f|0)){break}}}}function sN(b,c,d){var g=tN(b),f=tN(c);uN(g,f,d,a[d+180>>2],(g|0)==(b|0)&(f|0)==(c|0)?1:5)}function vN(b){var c,d,g;g=(b+32|0)>>2;var f=a[g],e=b+244|0,h=D[e>>1];0<h<<16>>16?(m[a[f+220>>2]+44*((h<<16>>16)-1)+33|0]=0,c=D[e>>1]):c=h;var e=c<<16>>16,h=b+246|0,k=c<<16>>16>D[h>>1]<<16>>16;a:do{if(k){var j=e}else{d=(b+220|0)>>2;var z=b+276|0;c=(f+220|0)>>2;for(var p=b,s=e;;){var v=a[a[a[z>>2]+(s<<2)>>2]+240>>2];Pw(f,s,v,a[(a[d]>>2)+(11*s|0)]);var t=a[d],u=0<(a[(t>>2)+(11*s|0)]|0);b:do{if(u){for(var w=0,A=v,B=t;;){if(B=a[a[(B+4>>2)+(11*s|0)]+(w<<2)>>2],a[a[(a[c]+4>>2)+(11*s|0)]+(A<<2)>>2]=B,a[B+240>>2]=A,a[B+20>>2]=a[g],Qw(p,B),Mw(a[g],B),B=a[g]+240|0,a[B>>2]=a[B>>2]+1|0,w=w+1|0,B=a[d],(w|0)<(a[(B>>2)+(11*s|0)]|0)){A=A+1|0}else{var C=B;break b}}}else{C=t}}while(0);a[(C+4>>2)+(11*s|0)]=(v<<2)+a[(a[c]+4>>2)+(11*s|0)]|0;m[a[c]+44*s+33|0]=0;s=s+1|0;if((s|0)>(D[h>>1]<<16>>16|0)){j=s;break a}}}}while(0);(j|0)<(D[f+246>>1]<<16>>16|0)&&(m[a[f+220>>2]+44*j+33|0]=0);b=b+280|0;m[b]=1}function wN(b){var c=D[b+244>>1],d=b+246|0;if(c<<16>>16<=D[d>>1]<<16>>16){for(var g=b+276|0,b=b+32|0,c=c<<16>>16;;){var f=a[a[g>>2]+(c<<2)>>2],e=f+184|0,h=a[a[e>>2]>>2],k=0==(h|0);a:do{if(!k){for(var j=h;;){if(pf(j),j=a[a[e>>2]>>2],0==(j|0)){break a}}}}while(0);e=f+176|0;h=a[a[e>>2]>>2];k=0==(h|0);a:do{if(!k){for(j=h;;){if(pf(j),j=a[a[e>>2]>>2],0==(j|0)){break a}}}}while(0);Qw(a[b>>2],f);a[a[g>>2]+(c<<2)>>2]=0;c=c+1|0;if((c|0)>(D[d>>1]<<16>>16|0)){break}}}}function Jw(b){var c=h,d=ra(b),g=0==(d|0);a:do{if(!g){for(var f=d;;){if(7==m[f+165|0]<<24>>24&&YE(f),a[f+216>>2]=0,f=ba(b,f),0==(f|0)){break a}}}}while(0);d=b+208|0;if(1<=(a[d>>2]|0)){g=b+212|0;b=b+12|0;for(f=1;;){var e=a[a[g>>2]+(f<<2)>>2],l=e,k=ra(l),n=0==(k|0);a:do{if(!n){for(var z=e+272|0,p=e,s=k;;){var v=ba(l,s),t=s+24|0,u=t+141|0,w=0==m[u]<<24>>24;b:do{if(w){var A=s,B=a[z>>2];(Zb(A)|0)!=(A|0)&&sa(qo|0,198,xN|0,yN|0);a[A+224>>2]=B;B=B+220|0;a[B>>2]=a[B>>2]+a[A+220>>2]|0;a[t+192>>2]=e;m[u]=7;A=Ib(l,s);if(0!=(A|0)){for(;;){var B=a[A+180>>2],C=0==(B|0);c:do{if(!C){for(var y=B;;){if(0==(y|0)){break c}var y=y+12|0,D=a[y>>2];if(1!=m[D+162|0]<<24>>24){break c}a[D+216>>2]=e;y=a[a[a[y>>2]+184>>2]>>2]}}}while(0);A=yb(l,A);if(0==(A|0)){break b}}}}else{A=a[b>>2],la(0,zN|0,(j=h,h+=8,a[j>>2]=a[s+12>>2],a[j+4>>2]=A,j)),bl(p,s|0)}}while(0);if(0==(v|0)){break a}else{s=v}}}}while(0);f=f+1|0;if((f|0)>(a[d>>2]|0)){break}}}h=c}function gN(b,c){var d,g;g=(c+246|0)>>1;d=(c+276|0)>>2;a[d]=fa((D[g]<<16>>16<<2)+8|0);var f=c+244|0,e=D[f>>1],h=e<<16>>16>D[g]<<16>>16;a:do{if(!h){for(var k=b,j=c,z=0,p=e<<16>>16;;){var s=Lf(k),v=s;a[a[d]+(p<<2)>>2]=v;a[s+236>>2]=p;m[s+165|0]=7;a[s+216>>2]=j;0!=(z|0)&&(z=de(z,s,0)+162|0,D[z>>1]=1e3*D[z>>1]&65535);p=p+1|0;if((p|0)>(D[g]<<16>>16|0)){break a}else{z=v}}}}while(0);e=ra(c);h=0==(e|0);a:do{if(!h){for(k=e;;){j=a[a[d]+(a[k+236>>2]<<2)>>2];v=j+220|0;a[v>>2]=a[v>>2]+1|0;v=Ib(c,k);z=0==(v|0);b:do{if(!z){p=j+184|0;for(s=v;;){var t=a[a[s+16>>2]+236>>2],u=s+12|0,w=(t|0)<(a[a[u>>2]+236>>2]|0);c:do{if(w){for(var A=t;;){var B=a[a[p>>2]>>2]+176|0;D[B>>1]=D[B>>1]+1&65535;A=A+1|0;if((A|0)>=(a[a[u>>2]+236>>2]|0)){break c}}}}while(0);s=yb(c,s);if(0==(s|0)){break b}}}}while(0);k=ba(c,k);if(0==(k|0)){break a}}}}while(0);f=D[f>>1];e=D[g];if(f<<16>>16<=e<<16>>16){for(f=f<<16>>16;!(h=a[a[d]+(f<<2)>>2]+220|0,k=a[h>>2],1<(k|0)&&(a[h>>2]=k-1|0,e=D[g]),f=f+1|0,(f|0)>(e<<16>>16|0));){}}}function AN(b,c,d,g){var f=a[c+216>>2],e=f+281|0,h=d+1|0;if((m[e]<<24>>24|0)!=(h|0)){var k=f+244|0,j=D[k>>1],c=(f+246|0)>>1,z=D[c];if(j<<16>>16>z<<16>>16){var b=j,p=z}else{z=f+276|0;for(j=j<<16>>16;!(Rw(b,a[a[z>>2]+(j<<2)>>2]),j=j+1|0,p=D[c],(j|0)>(p<<16>>16|0));){}b=D[k>>1]}p=b<<16>>16>p<<16>>16;a:do{if(!p){k=f+276|0;z=g;for(j=b<<16>>16;;){if(Sw(z,a[a[k>>2]+(j<<2)>>2],d),j=j+1|0,(j|0)>(D[c]<<16>>16|0)){break a}}}}while(0);m[e]=h&255}}function Tw(b){var c=ra(b);if(0!=(c|0)){for(;;){a[c+216>>2]=0;var d=Ib(b,c),g=0==(d|0);a:do{if(!g){for(var f=d;;){var e=a[f+180>>2],h=0==(e|0);b:do{if(!h){for(var k=e;;){if(0==(k|0)){break b}var k=k+12|0,j=a[k>>2];if(1!=m[j+162|0]<<24>>24){break b}a[j+216>>2]=0;k=a[a[a[k>>2]+184>>2]>>2]}}}while(0);f=yb(b,f);if(0==(f|0)){break a}}}}while(0);c=ba(b,c);if(0==(c|0)){break}}}Uw(b)}function Uw(b){var c=b+208|0,d=1>(a[c>>2]|0);a:do{if(!d){for(var g=b+212|0,f=1;;){if(Uw(a[a[g>>2]+(f<<2)>>2]),f=f+1|0,(f|0)>(a[c>>2]|0)){break a}}}}while(0);c=ra(b);if(0!=(c|0)){for(;;){d=c+216|0;0==(a[d>>2]|0)&&(a[d>>2]=b);d=Ib(b,c);g=0==(d|0);a:do{if(!g){for(f=d;;){var e=a[f+180>>2],h=0==(e|0);b:do{if(!h){for(var k=e;;){if(0==(k|0)){break b}var k=k+12|0,j=a[k>>2];if(1!=m[j+162|0]<<24>>24){break b}var z=j+216|0;0==(a[z>>2]|0)?(a[z>>2]=b,k=a[k>>2]):k=j;k=a[a[k+184>>2]>>2]}}}while(0);f=yb(b,f);if(0==(f|0)){break a}}}}while(0);c=ba(b,c);if(0==(c|0)){break}}}}function tN(b){var c=a[b+216>>2];return 0==(c|0)||0!=m[c+280|0]<<24>>24?b:b=a[a[c+276>>2]+(a[b+236>>2]<<2)>>2]}function Pw(b,c,d,g){var f,e,b=(b+220|0)>>2,h=a[b];e=h>>2;var k=a[e+(11*c|0)+1];f=k>>2;if(1>(g|0)){d=d-g|0;k=d+1|0;e=a[e+(11*c|0)];var j=(k|0)<(e|0);a:do{if(j){for(var m=d,p=k;;){var s=a[(p<<2>>2)+f],m=m+g|0;a[s+240>>2]=m;a[(m<<2>>2)+f]=s;var s=p+1|0,m=a[b],v=a[(m>>2)+(11*c|0)];if((s|0)<(v|0)){m=p,p=s}else{var t=m,u=v;break a}}}else{t=h,u=e}}while(0);g=g-1|0;h=g+u|0;if((h|0)<(u|0)){for(t=h;;){if(a[(t<<2>>2)+f]=0,t=t+1|0,u=a[b],(t|0)>=(a[(u>>2)+(11*c|0)]|0)){w=u;A=g;break}}c=(w+44*c|0)>>2;b=a[c];b=A+b|0}else{var w,A,c=t+44*c|0,c=c>>2,b=a[c],b=g+b|0}}else{A=a[e+(11*c|0)]-1|0;w=(A|0)>(d|0);a:do{if(w){t=g-1|0;for(u=A;;){if(h=a[(u<<2>>2)+f],e=t+u|0,a[h+240>>2]=e,a[(e<<2>>2)+f]=h,u=u-1|0,(u|0)<=(d|0)){break a}}}}while(0);f=d+1|0;(f|0)<(g+d|0)&&li((f<<2)+k|0,(g<<2)-4|0);w=a[b];c=w+44*c|0;c>>=2;b=a[c];b=(g-1|0)+b|0}a[c]=b}function uN(c,d,i,g,e){var h,l;l=(c+236|0)>>2;h=(d+236|0)>>2;(a[l]|0)<(a[h]|0)||sa(Ow|0,109,BN|0,CN|0);if(!((a[g+16>>2]|0)==(c|0)&&(a[g+12>>2]|0)==(d|0))){if(1<D[g+176>>1]<<16>>16){a[i+180>>2]=0;var k=a[h],j=a[l];if(1==(k-j|0)){var z=Zh(c,d);if(0!=(z|0)&&0!=(fm(i,z)|0)){og(i,z);if(0!=m[c+162|0]<<24>>24||0!=m[d+162|0]<<24>>24){return}Rg(i);return}}if((j|0)<(k|0)){z=c+20|0;e&=255;for(l=k;;){if((j|0)<(l-1|0)){l=g+12|0;var k=a[z>>2],p=a[l>>2],s=p+236|0,v=a[s>>2],t=p+240|0;Pw(k,v,a[t>>2],2);var u=Lf(k),w=p+104|0,w=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),A=u+104|0;f[0]=w;a[A>>2]=b[0];a[A+4>>2]=b[1];p=p+112|0;p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]);w=u+112|0;f[0]=p;a[w>>2]=b[0];a[w+4>>2]=b[1];a[u+236>>2]=a[s>>2];s=a[t>>2]+1|0;a[u+240>>2]=s;k=a[a[(a[k+220>>2]+4>>2)+(11*v|0)]+(s<<2)>>2]=u}else{k=d,l=g+12|0}m[de(c,k,i)+124|0]=e;g=g+176|0;D[g>>1]=D[g>>1]-1&65535;j=j+1|0;v=a[h];if((j|0)<(v|0)){g=a[a[a[l>>2]+184>>2]>>2],c=k,l=v}else{break}}}}else{k=1==(a[h]-a[l]|0);a:do{if(k){s=c;t=d;v=p=Zh(s,t);u=i;do{if(0!=(p|0)&&0!=(fm(u,p)|0)){a[i+180>>2]=v;m[p+124|0]=e&255;g=p+176|0;D[g>>1]=D[g>>1]+1&65535;if(0!=m[c+162|0]<<24>>24){break a}if(0!=m[d+162|0]<<24>>24){break a}Rg(u);break a}}while(0);a[i+180>>2]=0;v=de(s,t,u);m[v+124|0]=e&255}else{v=g}}while(0);k=a[h];if(1<(k-a[l]|0)){(a[v+16>>2]|0)==(c|0)?(g=v,h=k):(g=i+180|0,a[g>>2]=0,c=de(c,a[v+12>>2],i),a[g>>2]=c,pf(v),g=c,h=a[h]);c=a[g+12>>2];l=(a[c+236>>2]|0)==(h|0);a:do{if(l){z=g,j=c}else{for(k=c;;){if(k=a[a[k+184>>2]>>2],v=a[k+12>>2],(a[v+236>>2]|0)==(h|0)){z=k;j=v;break a}else{k=v}}}}while(0);(j|0)!=(d|0)&&(m[de(a[z+16>>2],d,i)+124|0]=e&255,pf(z))}}}}function xj(c,d,i){var g=i|0;(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])>c?d=0:(g=i+16|0,(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])<c?d=0:(c=i+8|0,(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])>d?d=0:(i=i+24|0,d=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])>=d)));return d&1}function yj(c,d,i,g,e){var h=c|0;f[0]=.5*(d+g);a[h>>2]=b[0];a[h+4>>2]=b[1];c=c+8|0;f[0]=.5*(i+e);a[c>>2]=b[0];a[c+4>>2]=b[1]}function DN(c,d){var i,g,e,m,l,k,n,z,p,s,v,t,u,w,A,B,C,y,D,F,E,M,X,O,H,I,J,K,L,N,S,Q,R,U,W,ca,Z,Y,$,ja,aa,da,ea,xa,ba,fa=h;h+=224;var ha,ga=fa+64,ra=fa+80,ka=fa+96,qa=fa+112,tb=fa+128,ya=fa+144,na=fa+160,wa=fa+176,Ab=fa+192,Fa=fa+208,Ga=d|0,oa=EN(c,V(Ga,eq|0)),ta=EN(c,V(Ga,fq|0)),Ka=0!=(ta|0),za=0==(oa|0);if(!(za&(Ka^1))){var ma=d+24|0,pa=a[ma>>2];if(0!=(pa|0)){if(1<(a[pa+4>>2]|0)){var Ba=a[a[d+12>>2]+12>>2];la(0,FN|0,(j=h,h+=8,a[j>>2]=a[a[d+16>>2]+12>>2],a[j+4>>2]=Ba,j))}else{var Ha=a[pa>>2],Ra=a[Ha+4>>2];ba=(d+12|0)>>2;var va=a[ba];xa=(d+16|0)>>2;var Aa=a[xa],La=Cb(48);ea=(Ha+12|0)>>2;a[La+12>>2]=a[ea];da=(Ha+8|0)>>2;a[La+8>>2]=a[da];do{if(za){ha=1647}else{var Ea=oa+52|0,Ya=va+32|0,Ma=va+40|0;if(0==(xj((b[0]=a[Ya>>2],b[1]=a[Ya+4>>2],f[0]),(b[0]=a[Ma>>2],b[1]=a[Ma+4>>2],f[0]),Ea)|0)){var Za=a[a[xa]+12>>2],Qa=a[a[ba]+12>>2],ab=V(Ga,eq|0);la(0,GN|0,(j=h,h+=12,a[j>>2]=Za,a[j+4>>2]=Qa,a[j+8>>2]=ab,j));ha=1647}else{aa=(Ha|0)>>2;var $a=a[aa],jb=$a|0,Ca=(b[0]=a[jb>>2],b[1]=a[jb+4>>2],f[0]),Ia=$a+8|0,eb=(b[0]=a[Ia>>2],b[1]=a[Ia+4>>2],f[0]);if(0!=(xj(Ca,eb,Ea)|0)){var ub=Aa+32|0,Sa=Aa+40|0;if(0!=(xj((b[0]=a[ub>>2],b[1]=a[ub+4>>2],f[0]),(b[0]=a[Sa>>2],b[1]=a[Sa+4>>2],f[0]),Ea)|0)){var Pa=a[a[xa]+12>>2],ua=a[a[ba]+12>>2],Oa=V(Ga,eq|0);la(0,HN|0,(j=h,h+=12,a[j>>2]=Pa,a[j+4>>2]=ua,a[j+8>>2]=Oa,j));ha=1647}else{if(0==(a[da]|0)){sa(zj|0,364,im|0,Vw|0);var Wa=a[aa],pb=Wa|0,ob=Wa+8|0,bb=(b[0]=a[pb>>2],b[1]=a[pb+4>>2],f[0]),qb=(b[0]=a[ob>>2],b[1]=a[ob+4>>2],f[0])}else{bb=Ca,qb=eb}ja=(Ha+16|0)>>2;$=(Ha+24|0)>>2;jm(ga,bb,qb,(b[0]=a[ja],b[1]=a[ja+1],f[0]),(b[0]=a[$],b[1]=a[$+1],f[0]),Ea);var wb=ga|0,kb=(b[0]=a[wb>>2],b[1]=a[wb+4>>2],f[0]),hb=ga+8|0,vb=(b[0]=a[hb>>2],b[1]=a[hb+4>>2],f[0]),xb=a[aa],Va=xb+48|0;f[0]=kb;a[Va>>2]=b[0];a[Va+4>>2]=b[1];var nb=xb+56|0;f[0]=vb;a[nb>>2]=b[0];a[nb+4>>2]=b[1];var rb=a[aa]+16|0;yj(ra,kb,vb,(b[0]=a[ja],b[1]=a[ja+1],f[0]),(b[0]=a[$],b[1]=a[$+1],f[0]));Y=rb>>2;Z=ra>>2;a[Y]=a[Z];a[Y+1]=a[Z+1];a[Y+2]=a[Z+2];a[Y+3]=a[Z+3];var lb=a[aa],Ta=lb+16|0,cb=(b[0]=a[Ta>>2],b[1]=a[Ta+4>>2],f[0]),fb=lb+24|0,Ua=(b[0]=a[fb>>2],b[1]=a[fb+4>>2],f[0]);yj(ka,cb,Ua,(b[0]=a[ja],b[1]=a[ja+1],f[0]),(b[0]=a[$],b[1]=a[$+1],f[0]));ca=lb>>2;W=ka>>2;a[ca]=a[W];a[ca+1]=a[W+1];a[ca+2]=a[W+2];a[ca+3]=a[W+3];var sb=a[aa],Na=sb+16|0,Fb=sb+24|0;yj(qa,(b[0]=a[Na>>2],b[1]=a[Na+4>>2],f[0]),(b[0]=a[Fb>>2],b[1]=a[Fb+4>>2],f[0]),kb,vb);U=(sb+32|0)>>2;R=qa>>2;a[U]=a[R];a[U+1]=a[R+1];a[U+2]=a[R+2];a[U+3]=a[R+3];var Db=a[ea],Ob=0==(Db|0)?3:Hn(d,a[aa],0,0,La,Db)+3|0}}else{for(var Eb=Ra-1|0,db=0;(db|0)<(Eb|0);){if(0==(Ww((db<<4)+a[aa]|0,Ea)|0)){db=db+3|0}else{break}}var Bb=a[ea],Ja=0!=(Bb|0);if((db|0)==(Eb|0)){Ja||sa(zj|0,382,im|0,Xw|0);Q=(La+32|0)>>2;var ib=a[aa],yb=Ha+32|0,mb=(b[0]=a[yb>>2],b[1]=a[yb+4>>2],f[0]),Hb=Ha+40|0,Ib=(b[0]=a[Hb>>2],b[1]=a[Hb+4>>2],f[0]),Jb=(Eb<<4)+ib|0,ic=(Eb<<4)+ib+8|0;jm(tb,mb,Ib,(b[0]=a[Jb>>2],b[1]=a[Jb+4>>2],f[0]),(b[0]=a[ic>>2],b[1]=a[ic+4>>2],f[0]),Ea);S=tb>>2;a[Q]=a[S];a[Q+1]=a[S+1];a[Q+2]=a[S+2];a[Q+3]=a[S+3];Ob=Eb}else{Ob=(Ja?Hn(d,a[aa],0,db,La,Bb):db)+3|0}}}}}while(0);if(1647==ha){var Kb=Ra-1|0;0!=(a[ea]|0)&&(N=(La+32|0)>>2,L=(Ha+32|0)>>2,a[N]=a[L],a[N+1]=a[L+1],a[N+2]=a[L+2],a[N+3]=a[L+3]);Ob=Kb}a:do{if(Ka){var Gb=ta+52|0,Lb=Aa+32|0,Mb=Aa+40|0;if(0==(xj((b[0]=a[Lb>>2],b[1]=a[Lb+4>>2],f[0]),(b[0]=a[Mb>>2],b[1]=a[Mb+4>>2],f[0]),Gb)|0)){var Nb=a[a[xa]+12>>2],Pb=a[a[ba]+12>>2],Wb=V(Ga,fq|0);la(0,IN|0,(j=h,h+=12,a[j>>2]=Nb,a[j+4>>2]=Pb,a[j+8>>2]=Wb,j));ha=1670}else{K=(Ha|0)>>2;var Vb=a[K],Tb=(Ob<<4)+Vb|0,Yb=(b[0]=a[Tb>>2],b[1]=a[Tb+4>>2],f[0]),Sb=(Ob<<4)+Vb+8|0,$b=(b[0]=a[Sb>>2],b[1]=a[Sb+4>>2],f[0]);if(0!=(xj(Yb,$b,Gb)|0)){var Zb=va+32|0,ec=va+40|0;if(0!=(xj((b[0]=a[Zb>>2],b[1]=a[Zb+4>>2],f[0]),(b[0]=a[ec>>2],b[1]=a[ec+4>>2],f[0]),Gb)|0)){var lc=a[a[xa]+12>>2],Xb=a[a[ba]+12>>2],kc=V(Ga,fq|0);la(0,JN|0,(j=h,h+=12,a[j>>2]=lc,a[j+4>>2]=Xb,a[j+8>>2]=kc,j));ha=1670}else{if(0==(a[ea]|0)){sa(zj|0,424,im|0,Xw|0);var ac=a[K],Hc=(Ob<<4)+ac|0,nc=(Ob<<4)+ac+8|0,uc=(b[0]=a[Hc>>2],b[1]=a[Hc+4>>2],f[0]),qc=(b[0]=a[nc>>2],b[1]=a[nc+4>>2],f[0])}else{uc=Yb,qc=$b}J=(La+32|0)>>2;I=(La+40|0)>>2;jm(ya,uc,qc,(b[0]=a[J],b[1]=a[J+1],f[0]),(b[0]=a[I],b[1]=a[I+1],f[0]),Gb);var Qb=ya|0,tc=(b[0]=a[Qb>>2],b[1]=a[Qb+4>>2],f[0]),Sc=ya+8|0,gc=(b[0]=a[Sc>>2],b[1]=a[Sc+4>>2],f[0]),dc=Ob-3|0,bc=a[K],jc=(dc<<4)+bc|0;f[0]=tc;a[jc>>2]=b[0];a[jc+4>>2]=b[1];var oc=(dc<<4)+bc+8|0;f[0]=gc;a[oc>>2]=b[0];a[oc+4>>2]=b[1];var rc=Ob-1|0,Ac=(rc<<4)+a[K]|0;yj(na,tc,gc,(b[0]=a[J],b[1]=a[J+1],f[0]),(b[0]=a[I],b[1]=a[I+1],f[0]));H=Ac>>2;O=na>>2;a[H]=a[O];a[H+1]=a[O+1];a[H+2]=a[O+2];a[H+3]=a[O+3];var fc=a[K],mc=(rc<<4)+fc|0,Bc=(b[0]=a[mc>>2],b[1]=a[mc+4>>2],f[0]),Cc=(rc<<4)+fc+8|0,fd=(b[0]=a[Cc>>2],b[1]=a[Cc+4>>2],f[0]);yj(wa,Bc,fd,(b[0]=a[J],b[1]=a[J+1],f[0]),(b[0]=a[I],b[1]=a[I+1],f[0]));X=((Ob<<4)+fc|0)>>2;M=wa>>2;a[X]=a[M];a[X+1]=a[M+1];a[X+2]=a[M+2];a[X+3]=a[M+3];var Ec=a[K],yc=(rc<<4)+Ec|0,Fc=(rc<<4)+Ec+8|0;yj(Ab,(b[0]=a[yc>>2],b[1]=a[yc+4>>2],f[0]),(b[0]=a[Fc>>2],b[1]=a[Fc+4>>2],f[0]),tc,gc);E=((Ob-2<<4)+Ec|0)>>2;F=Ab>>2;a[E]=a[F];a[E+1]=a[F+1];a[E+2]=a[F+2];a[E+3]=a[F+3];var vc=a[da],Tc=0==(vc|0)?dc:In(d,a[K],dc,dc,La,vc)}}else{var Kc=fa|0;D=fa>>2;y=(fa+16|0)>>2;C=(fa+32|0)>>2;B=(fa+48|0)>>2;for(var Mc=Ob;;){if(0>=(Mc|0)){ha=1663;break}A=((Mc<<4)+a[K]|0)>>2;a[D]=a[A];a[D+1]=a[A+1];a[D+2]=a[A+2];a[D+3]=a[A+3];var id=Mc-1|0;w=((id<<4)+a[K]|0)>>2;a[y]=a[w];a[y+1]=a[w+1];a[y+2]=a[w+2];a[y+3]=a[w+3];var zc=Mc-2|0;u=((zc<<4)+a[K]|0)>>2;a[C]=a[u];a[C+1]=a[u+1];a[C+2]=a[u+2];a[C+3]=a[u+3];var Ic=Mc-3|0;t=((Ic<<4)+a[K]|0)>>2;a[B]=a[t];a[B+1]=a[t+1];a[B+2]=a[t+2];a[B+3]=a[t+3];if(0==(Ww(Kc,Gb)|0)){Mc=Ic}else{ha=1662;break}}do{if(1662==ha){v=((Mc<<4)+a[K]|0)>>2;a[v]=a[D];a[v+1]=a[D+1];a[v+2]=a[D+2];a[v+3]=a[D+3];s=((id<<4)+a[K]|0)>>2;a[s]=a[y];a[s+1]=a[y+1];a[s+2]=a[y+2];a[s+3]=a[y+3];p=((zc<<4)+a[K]|0)>>2;a[p]=a[C];a[p+1]=a[C+1];a[p+2]=a[C+2];a[p+3]=a[C+3];z=((Ic<<4)+a[K]|0)>>2;a[z]=a[B];a[z+1]=a[B+1];a[z+2]=a[B+2];a[z+3]=a[B+3];var Dc=Ic}else{if(1663==ha){if(0!=(Mc|0)){Dc=Mc-3|0}else{0==(a[da]|0)&&sa(zj|0,447,im|0,Vw|0);n=(La+16|0)>>2;var Gc=a[K],Nc=Ha+16|0,Qc=(b[0]=a[Nc>>2],b[1]=a[Nc+4>>2],f[0]),Yc=Ha+24|0,Rc=(b[0]=a[Yc>>2],b[1]=a[Yc+4>>2],f[0]),Td=Gc|0,Lc=Gc+8|0;jm(Fa,Qc,Rc,(b[0]=a[Td>>2],b[1]=a[Td+4>>2],f[0]),(b[0]=a[Lc>>2],b[1]=a[Lc+4>>2],f[0]),Gb);k=Fa>>2;a[n]=a[k];a[n+1]=a[k+1];a[n+2]=a[k+2];a[n+3]=a[k+3];Tc=0;break a}}}}while(0);var Pc=a[da],Tc=0==(Pc|0)?Dc:In(d,a[K],Dc,Ob-3|0,La,Pc)}}}else{ha=1670}}while(0);1670==ha&&(0!=(a[da]|0)&&(l=(La+16|0)>>2,m=(Ha+16|0)>>2,a[l]=a[m],a[l+1]=a[m+1],a[l+2]=a[m+2],a[l+3]=a[m+3]),Tc=0);var Xc=Ob-Tc+1|0;e=(La+4|0)>>2;a[e]=Xc;var Jc=Cb(Xc<<4);a[La>>2]=Jc;var ad=0<(a[e]|0),jd=Ha|0;a:do{if(ad){for(var md=0,Oc=Tc,Vc=Jc;;){g=((md<<4)+Vc|0)>>2;i=((Oc<<4)+a[jd>>2]|0)>>2;a[g]=a[i];a[g+1]=a[i+1];a[g+2]=a[i+2];a[g+3]=a[i+3];var Zc=md+1|0;if((Zc|0)>=(a[e]|0)){break a}md=Zc;Oc=Oc+1|0;Vc=a[La>>2]}}}while(0);G(a[jd>>2]);G(Ha);a[a[ma>>2]>>2]=La}}}h=fa}function EN(b,c){var d=h;if(0==(c|0)){var g=0}else{0==m[c]<<24>>24?g=0:(g=RL(b,c),0==(g|0)&&la(0,KN|0,(j=h,h+=4,a[j>>2]=c,j)))}h=d;return g}function jm(c,d,i,g,e,m){var l=h;h+=400;var k=l+100,n=l+200,z=l+300,p=m|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),s=m+8|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),v=m+16|0,v=(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0]),m=m+24|0,m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]);if(p>g){var t=((p-d)*(i-e)/(d-g)&-1|0)+i;if(!(t<s|t>m)){z=c|0;f[0]=p;a[z>>2]=b[0];a[z+4>>2]=b[1];c=c+8|0;f[0]=t;a[c>>2]=b[0];a[c+4>>2]=b[1];h=l;return}}if(v<g){if(t=((v-d)*(i-e)/(d-g)&-1|0)+i,t<s|t>m){var u=v}else{z=c|0;f[0]=v;a[z>>2]=b[0];a[z+4>>2]=b[1];c=c+8|0;f[0]=t;a[c>>2]=b[0];a[c+4>>2]=b[1];h=l;return}}else{u=p}if(s>e){if(u=((s-i)*(d-g)/(i-e)&-1|0)+d,u<p|u>v){t=s}else{z=c|0;f[0]=u;a[z>>2]=b[0];a[z+4>>2]=b[1];c=c+8|0;f[0]=s;a[c>>2]=b[0];a[c+4>>2]=b[1];h=l;return}}if(m<e){if(u=((m-i)*(d-g)/(i-e)&-1|0)+d,u<p|u>v){t=m}else{z=c|0;f[0]=u;a[z>>2]=b[0];a[z+4>>2]=b[1];c=c+8|0;f[0]=m;a[c>>2]=b[0];a[c+4>>2]=b[1];h=l;return}}d=gq(d,i,l|0);g=gq(g,e,k|0);n=gq(p,s,n|0);z=gq(v,m,z|0);la(1,LN|0,(j=h,h+=16,a[j>>2]=d,a[j+4>>2]=g,a[j+8>>2]=n,a[j+12>>2]=z,j));sa(zj|0,78,MN|0,vd|0);z=c|0;f[0]=u;a[z>>2]=b[0];a[z+4>>2]=b[1];c=c+8|0;f[0]=t;a[c>>2]=b[0];a[c+4>>2]=b[1];h=l}function Ww(c,d){var i,g,e,j,l=h;h+=128;var k=l|0;g=l>>2;j=c>>2;a[g]=a[j];a[g+1]=a[j+1];a[g+2]=a[j+2];a[g+3]=a[j+3];g=(l+16|0)>>2;j=(c+16|0)>>2;a[g]=a[j];a[g+1]=a[j+1];a[g+2]=a[j+2];a[g+3]=a[j+3];g=(l+32|0)>>2;j=(c+32|0)>>2;a[g]=a[j];a[g+1]=a[j+1];a[g+2]=a[j+2];a[g+3]=a[j+3];g=(l+48|0)>>2;j=(c+48|0)>>2;a[g]=a[j];a[g+1]=a[j+1];a[g+2]=a[j+2];a[g+3]=a[j+3];j=(d|0)>>2;i=(b[0]=a[j],b[1]=a[j+1],f[0]);e=(d+8|0)>>2;g=(d+24|0)>>2;i=hq(c,0,1,i,(b[0]=a[e],b[1]=a[e+1],f[0]),(b[0]=a[g],b[1]=a[g+1],f[0]));if(0<=i&2>i){Ld(l+64,k,3,i,c,0);var n=i}else{n=2}i=(d+16|0)>>2;var m=(b[0]=a[i],b[1]=a[i+1],f[0]),m=hq(c,0,1<n?1:n,m,(b[0]=a[e],b[1]=a[e+1],f[0]),(b[0]=a[g],b[1]=a[g+1],f[0]));0<=m&m<n&&(Ld(l+80,k,3,m,c,0),n=m);e=(b[0]=a[e],b[1]=a[e+1],f[0]);e=iq(c,0,1<n?1:n,e,(b[0]=a[j],b[1]=a[j+1],f[0]),(b[0]=a[i],b[1]=a[i+1],f[0]));0<=e&e<n?Ld(l+96,k,3,e,c,0):e=n;g=(b[0]=a[g],b[1]=a[g+1],f[0]);j=iq(c,0,1<e?1:e,g,(b[0]=a[j],b[1]=a[j+1],f[0]),(b[0]=a[i],b[1]=a[i+1],f[0]));if(!(0<=j&j<e)){return k=2>e,h=l,k&1}Ld(l+112,k,3,j,c,0);k=2>j;h=l;return k&1}function hq(c,d,i,g,e,j){var l=h;h+=144;var k,n=l+64,m=l+128,p=NN(c,g);if(1==(p|0)){k=1717}else{if(0==(p|0)){return h=l,-1}}if(1717==k&&(k=c+48|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),((0>k?k-.5:k+.5)&-1|0)==((0>g?g-.5:g+.5)&-1|0))){return g=c+56|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),h=l,g<e|g>j?-1:i}k=l|0;n|=0;Ld(m,c,3,.5,k,n);c=.5*(d+i);d=hq(k,d,c,g,e,j);if(0<=d){return h=l,d}i=hq(n,c,i,g,e,j);h=l;return i}function ON(c,d){var i=c+8|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),i=i<d?-1:i>d&1,g=c+24|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),e=g<d?-1:g>d&1,g=c+40|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),g=g<d?-1:g>d&1,i=((g|0)!=(e|0)&0!=(e|0)&1)+((e|0)!=(i|0)&0!=(i|0)&1)+(0==(i|0)&1)|0,e=c+56|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);if(e<d){return g=-1!=(g|0)&0!=(g|0),i=(g&1)+i|0}e=(e>d&1|0)!=(g|0);g=e&0!=(g|0);return i=(g&1)+i|0}function NN(c,d){var i=c|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),i=i<d?-1:i>d&1,g=c+16|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),e=g<d?-1:g>d&1,g=c+32|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),g=g<d?-1:g>d&1,i=((g|0)!=(e|0)&0!=(e|0)&1)+((e|0)!=(i|0)&0!=(i|0)&1)+(0==(i|0)&1)|0,e=c+48|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);if(e<d){return g=-1!=(g|0)&0!=(g|0),i=(g&1)+i|0}e=(e>d&1|0)!=(g|0);g=e&0!=(g|0);return i=(g&1)+i|0}function PN(b){return(1==m[b+162|0]<<24>>24?1!=(a[b+180>>2]|0)?0:1!=(a[b+188>>2]|0)?0:0==(a[b+120>>2]|0):0)&1}function QN(b){return(1==m[b+162|0]<<24>>24?1!=(a[b+188>>2]|0)?0:1!=(a[b+180>>2]|0)?0:0==(a[b+120>>2]|0):0)&1}function iq(c,d,i,g,e,j){var l=h;h+=144;var k,n=l+64,m=l+128,p=ON(c,g);if(1==(p|0)){k=1764}else{if(0==(p|0)){return h=l,-1}}if(1764==k&&(k=c+56|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),((0>k?k-.5:k+.5)&-1|0)==((0>g?g-.5:g+.5)&-1|0))){return g=c+48|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),h=l,g<e|g>j?-1:i}k=l|0;n|=0;Ld(m,c,3,.5,k,n);c=.5*(d+i);d=iq(k,d,c,g,e,j);if(0<=d){return h=l,d}i=iq(n,c,i,g,e,j);h=l;return i}function gq(c,d,i){var g=h;Ma(i,RN|0,(j=h,h+=16,f[0]=c,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=d,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));h=g;return i}function SN(b){var c,d;if(2<=((D[b+246>>1]<<16>>16)-(D[b+244>>1]<<16>>16)|0)){c=(b+220|0)>>2;var g=a[c];do{if(0==(a[g+88>>2]|0)){var f=1,e=g;d=1791}else{for(var h=1,k=2,j=g;;){var m=a[(j>>2)+(11*h|0)],p=0<(m|0);a:do{if(p){for(var s=0,v=j,t=m;;){var u=a[(v+4>>2)+(11*h|0)],w=a[u+(s<<2)>>2];do{if(0==PN(w)<<24>>24){var A=v,B=t}else{A=w+176|0;for(B=s;;){var C=B+1|0;if((C|0)>=(t|0)){break}var y;y=a[a[A>>2]>>2];var T=a[u+(C<<2)>>2],F=a[a[T+176>>2]>>2];y=0==PN(T)<<24>>24?0:(a[y+16>>2]|0)!=(a[F+16>>2]|0)?0:(0==Yw(y,F)<<24>>24?0:0==(Aj(y+28|0,F+28|0)|0))&1;if(0==y<<24>>24){break}else{B=C}}1<(C-s|0)?(Zw(b,h,s,B,1),A=B=a[c],B=a[(B>>2)+(11*h|0)]):(A=v,B=t)}}while(0);s=s+1|0;if((s|0)<(B|0)){v=A,t=B}else{var E=A;break a}}}else{E=j}}while(0);j=k+1|0;if(0==(a[(E>>2)+(11*j|0)]|0)){break}else{h=k,k=j,j=E}}0<(k|0)&&(f=k,e=E,d=1791)}}while(0);a:do{if(1791==d){for(;;){d=a[(e>>2)+(11*f|0)];g=0<(d|0);b:do{if(g){h=0;k=e;for(C=d;;){E=a[(k+4>>2)+(11*f|0)];j=a[E+(h<<2)>>2];do{if(0==QN(j)<<24>>24){m=k,p=C}else{m=j+184|0;for(p=h;;){var M=p+1|0;if((M|0)>=(C|0)){break}s=a[a[m>>2]>>2];v=a[E+(M<<2)>>2];t=a[a[v+184>>2]>>2];s=0==QN(v)<<24>>24?0:(a[s+12>>2]|0)!=(a[t+12>>2]|0)?0:(0==Yw(s,t)<<24>>24?0:0==(Aj(s+68|0,t+68|0)|0))&1;if(0==s<<24>>24){break}else{p=M}}1<(M-h|0)?(Zw(b,f,h,p,0),m=p=a[c],p=a[(p>>2)+(11*f|0)]):(m=k,p=C)}}while(0);h=h+1|0;if((h|0)<(p|0)){k=m,C=p}else{var G=m;break b}}}else{G=e}}while(0);f=f-1|0;if(0<(f|0)){e=G,d=1791}else{break a}}}}while(0);c=b+208|0;if(1<=(a[c>>2]|0)){b=b+212|0;for(M=1;!($w(a[a[b>>2]+(M<<2)>>2]),M=M+1|0,(M|0)>(a[c>>2]|0));){}}}}function Zw(b,c,d,g,f){var e,h;e=(b+220|0)>>2;var k=a[e],j=a[(k+4>>2)+(11*c|0)],m=a[j+(d<<2)>>2],d=d+1|0,p=(d|0)>(g|0);a:do{if(p){var s=k}else{for(var v=1==(f|0),t=b,u=m+184|0,w=m,A=m+176|0,B=d,C=j;;){C=a[C+(B<<2)>>2];b:do{if(v){var y=C+184|0,D=a[a[y>>2]>>2];if(0!=(D|0)){for(var F=C+176|0;;){for(var E=a[u>>2],M=D+12|0,G=0;;){var O=a[E+(G<<2)>>2];if(0==(O|0)){h=1827;break}if((a[O+12>>2]|0)==(a[M>>2]|0)){var H=O;break}else{G=G+1|0}}1827==h&&(h=0,H=de(w,a[M>>2],D));E=a[a[F>>2]>>2];M=0==(E|0);c:do{if(!M){G=H;for(O=E;;){if(og(O,G),pf(O),O=a[a[F>>2]>>2],0==(O|0)){break c}}}}while(0);pf(D);D=a[a[y>>2]>>2];if(0==(D|0)){break b}}}}else{if(y=C+176|0,D=a[a[y>>2]>>2],0!=(D|0)){for(F=C+184|0;;){E=a[A>>2];M=D+16|0;for(G=0;;){O=a[E+(G<<2)>>2];if(0==(O|0)){h=1835;break}if((a[O+16>>2]|0)==(a[M>>2]|0)){var I=O;break}else{G=G+1|0}}1835==h&&(h=0,I=de(a[M>>2],w,D));E=a[a[F>>2]>>2];M=0==(E|0);c:do{if(!M){G=I;for(O=E;;){if(og(O,G),pf(O),O=a[a[F>>2]>>2],0==(O|0)){break c}}}}while(0);pf(D);D=a[a[y>>2]>>2];if(0==(D|0)){break b}}}}}while(0);(a[C+180>>2]|0)!=(-a[C+188>>2]|0)&&sa(TN|0,113,UN|0,VN|0);Qw(t,C);B=B+1|0;C=a[e];if((B|0)>(g|0)){s=C;break a}C=a[(C+4>>2)+(11*c|0)]}}}while(0);b=g+1|0;g=s+44*c|0;if((b|0)<(a[g>>2]|0)){for(;;){if(s=a[(s+4>>2)+(11*c|0)],g=a[s+(b<<2)>>2],a[s+(d<<2)>>2]=g,a[g+240>>2]=d,d=d+1|0,b=b+1|0,s=a[e],g=s+44*c|0,(b|0)>=(a[g>>2]|0)){J=d;K=g;break}}a[K>>2]=J}else{var J=d,K;a[g>>2]=J}e=a[e];c=a[(e+44*c+4|0)>>2];J=(J<<2)+c|0;a[J>>2]=0}function WN(b,c){var d=(a[c+236>>2]<<2)+b|0,g=a[d>>2];if(0==(g|0)||(a[g+240>>2]|0)>(a[c+240>>2]|0)){a[d>>2]=c}}function Yw(b,c){var d=0==m[b+124|0]<<24>>24;a:do{if(d){var g=b}else{for(var f=b;;){if(f=a[f+128>>2],0==m[f+124|0]<<24>>24){g=f;break a}}}}while(0);d=0==m[c+124|0]<<24>>24;a:do{if(d){var e=c}else{for(f=c;;){if(f=a[f+128>>2],0==m[f+124|0]<<24>>24){e=f;break a}}}}while(0);return 0!=m[g+161|0]<<24>>24||0!=m[e+161|0]<<24>>24?0:g=0<((a[a[g+16>>2]+236>>2]-a[a[g+12>>2]+236>>2])*(a[a[e+16>>2]+236>>2]-a[a[e+12>>2]+236>>2])|0)&1}function jq(b,c){var d;a[Bj>>2]=b;var g=m[pg]+1&255;m[pg]=0==g<<24>>24?1:g;a[b+228>>2]=0;a[b+240>>2]=0;var f=ra(b);if(0!=(f|0)){for(g=0<(c|0);;){var e=f;if(g){d=f+24|0;var h=a[d+192>>2];if(0==(h|0)){d=1886}else{var k=a[a[h+276>>2]+(a[d+212>>2]<<2)>>2];d=1887}}else{d=1886}1886==d&&(d=0,(e|0)==(Zb(e)|0)&&(k=e,d=1887));if(1887==d&&m[k+163|0]<<24>>24!=m[pg]<<24>>24){a[a[Bj>>2]+216>>2]=0;a[kq>>2]=0;Cj(k);var h=a[Bj>>2],j=h+228|0,e=a[j>>2];d=e+1|0;a[j>>2]=d;h=a[h+224>>2];d=0==(h|0)?Cb(d<<2):wb(h,d<<2);h=a[Bj>>2];a[h+224>>2]=d;a[d+(e<<2)>>2]=a[h+216>>2]}f=ba(b,f);if(0==(f|0)){break}}}}function Cj(b){var c=a[Bj>>2],d=c+240|0;a[d>>2]=a[d>>2]+1|0;m[b+163|0]=m[pg];var d=a[kq>>2],g=b+172|0;0==(d|0)?(a[g>>2]=0,a[c+216>>2]=b):(a[g>>2]=d,a[d+168>>2]=b);a[kq>>2]=b;c=b+168|0;a[c>>2]=0;var f=a[(b+184|0)>>2],e=0==(f|0),g=a[(b+176|0)>>2],d=a[(b+192|0)>>2],c=a[(b+200|0)>>2];a:do{if(!e){var h=a[f>>2];if(0!=(h|0)){for(var k=0;;){var j=a[h+12>>2],h=(j|0)==(b|0)?a[h+16>>2]:j;m[h+163|0]<<24>>24!=m[pg]<<24>>24&&(h|0)==(Zb(h)|0)&&Cj(h);k=k+1|0;h=a[f+(k<<2)>>2];if(0==(h|0)){break a}}}}}while(0);f=0==(g|0);a:do{if(!f&&(k=a[g>>2],0!=(k|0))){for(e=0;;){if(h=a[k+12>>2],k=(h|0)==(b|0)?a[k+16>>2]:h,m[k+163|0]<<24>>24!=m[pg]<<24>>24&&(k|0)==(Zb(k)|0)&&Cj(k),e=e+1|0,k=a[g+(e<<2)>>2],0==(k|0)){break a}}}}while(0);g=0==(d|0);a:do{if(!g&&(e=a[d>>2],0!=(e|0))){for(f=0;;){if(k=a[e+12>>2],e=(k|0)==(b|0)?a[e+16>>2]:k,m[e+163|0]<<24>>24!=m[pg]<<24>>24&&(e|0)==(Zb(e)|0)&&Cj(e),f=f+1|0,e=a[d+(f<<2)>>2],0==(e|0)){break a}}}}while(0);if(0!=(c|0)&&(g=a[c>>2],0!=(g|0))){for(d=0;!(f=a[g+12>>2],g=(f|0)==(b|0)?a[g+16>>2]:f,m[g+163|0]<<24>>24!=m[pg]<<24>>24&&(g|0)==(Zb(g)|0)&&Cj(g),d=d+1|0,g=a[c+(d<<2)>>2],0==(g|0));){}}}function XN(b){var c=ra(b),d=0==(c|0);a:do{if(!d){for(var g=c;;){var f=g,e=f>>2;hF(f);et(f,a[a[e+5]+152>>2]&1);a[e+45]=0;a[e+44]=fa(20);a[e+47]=0;a[e+46]=fa(20);a[e+51]=0;a[e+50]=fa(12);a[e+49]=0;a[e+48]=fa(12);a[e+53]=0;a[e+52]=fa(12);a[e+55]=1;g=ba(b,g);if(0==(g|0)){break a}}}}while(0);c=ra(b);if(0!=(c|0)){for(;;){d=Ib(b,c);g=0==(d|0);a:do{if(!g){for(f=d;;){var e=f,h=cc,k=cc;kF(e);var j=e|0,z=Xb(j,a[Kg>>2],1,0),k=(e+164|0)>>2;ib[k]=z;var h=a[Gh>>2],p=jc(a[e+16>>2]|0,h,Y|0),s=jc(a[e+12>>2]|0,h,Y|0),h=(e+162|0)>>1;D[h]=1;D[e+176>>1]=1;0!=m[p]<<24>>24&(p|0)==(s|0)&&(D[h]=1e3,ib[k]=100*z);0!=(aN(e)|0)&&(D[h]=0,ib[k]=0);m[e+160|0]=Zf(j,a[$u>>2],0)&255;D[e+178>>1]=Zf(j,a[Hh>>2],1)&65535;f=yb(b,f);if(0==(f|0)){break a}}}}while(0);c=ba(b,c);if(0==(c|0)){break}}}}function ax(b){var c=a[b+216>>2],d;if(0!=(c|0)){for(d=c>>2;;){var g=a[d+42],f=c,e=a[f+180>>2],h=0<(e|0);a:do{if(h){for(var k=f+176|0,j=e;;){var j=j-1|0,z=a[a[k>>2]+(j<<2)>>2];pf(z);G(z|0);if(0>=(j|0)){break a}}}}while(0);e=a[f+188>>2];if(0<(e|0)){for(f=f+184|0;!(e=e-1|0,h=a[a[f>>2]+(e<<2)>>2],pf(h),G(h|0),0>=(e|0));){}}1==m[c+162|0]<<24>>24&&(f=a[d+46],0!=(f|0)&&G(f),d=a[d+44],0!=(d|0)&&G(d),G(c|0));if(0==(g|0)){break}else{c=g,d=c>>2}}}c=ra(b);if(0!=(c|0)){for(;;){g=c;d=Ib(b,c);f=0==(d|0);a:do{if(!f){for(e=d;;){h=e;k=cc;k=(h+24|0)>>2;z=a[k];if(0!=(z|0)){j=0<(a[z+4>>2]|0);z=a[z>>2];b:do{if(j){for(var p=0,s=z;;){G(a[(s>>2)+(12*p|0)]);var p=p+1|0,v=a[k],s=a[v>>2];if((p|0)>=(a[v+4>>2]|0)){var t=s;break b}}}else{t=z}}while(0);G(t);G(a[k])}a[k]=0;vh(a[h+108>>2]);vh(a[h+120>>2]);vh(a[h+112>>2]);vh(a[h+116>>2]);h=(h+24|0)>>2;for(k=h+40;h<k;h++){a[h]=0}e=yb(b,e);if(0==(e|0)){break a}}}}while(0);YN(g);c=ba(b,c);if(0==(c|0)){break}}}ZN(b)}function $w(b){var c,d,g,f,e=h,l,k=b+244|0;d=D[k>>1];f=(b+246|0)>>1;var n=d<<16>>16>D[f]<<16>>16;a:do{if(n){g=b+276|0,g>>=2}else{for(var z=b+276|0,p=d<<16>>16;;){if(a[a[z>>2]+(p<<2)>>2]=0,p=p+1|0,(p|0)>(D[f]<<16>>16|0)){g=z;g>>=2;break a}}}}while(0);$N(b);d=ra(b);n=0==(d|0);a:do{if(!n){for(z=d;;){WN(a[g],z);var p=Ib(b,z),s=0==(p|0);b:do{if(!s){for(var v=p;;){for(var t=v;!(c=a[t+180>>2],0==(c|0));){t=c}t=t+12|0;c=a[t>>2];var u=v+12|0,w=(a[c+236>>2]|0)<(a[a[u>>2]+236>>2]|0);c:do{if(w){for(var A=t,B=c;;){if(WN(a[g],B),A=a[a[a[A>>2]+184>>2]>>2]+12|0,B=a[A>>2],(a[B+236>>2]|0)>=(a[a[u>>2]+236>>2]|0)){break c}}}}while(0);v=yb(b,v);if(0==(v|0)){break b}}}}while(0);z=ba(b,z);if(0==(z|0)){break a}}}}while(0);n=b+32|0;d=(b+220|0)>>2;z=b+12|0;for(k=D[k>>1]<<16>>16;(k|0)<=(D[f]<<16>>16|0);){p=a[a[g]+(k<<2)>>2];s=(a[p+240>>2]<<2)+a[(a[a[n>>2]+220>>2]+4>>2)+(11*k|0)]|0;if((a[s>>2]|0)!=(p|0)){l=1983;break}a[(a[d]+4>>2)+(11*k|0)]=s;p=0;s=-1;a:for(;;){v=a[d];if((p|0)>=(a[(v>>2)+(11*k|0)]|0)){break}v=a[a[(v+4>>2)+(11*k|0)]+(p<<2)>>2];if(0==(v|0)){break}t=0==m[v+162|0]<<24>>24;b:do{if(t){if(0==(Ed(b,v|0)|0)){break a}else{c=p}}else{u=a[a[v+176>>2]>>2];for(c=u>>2;;){if(0==(u|0)){c=s;break b}u=a[c+32];if(0==(u|0)){break}else{c=u>>2}}c=0==(Ed(b,a[c+4]|0)|0)?s:0==(Ed(b,a[c+3]|0)|0)?s:p}}while(0);p=p+1|0;s=c}-1==(s|0)&&la(0,aO|0,(j=h,h+=8,a[j>>2]=a[z>>2],a[j+4>>2]=k,j));a[(a[d]>>2)+(11*k|0)]=s+1|0;k=k+1|0}1983==l&&S();f=b+208|0;if(1<=(a[f>>2]|0)){b=b+212|0;for(l=1;!($w(a[a[b>>2]+(l<<2)>>2]),l=l+1|0,(l|0)>(a[f>>2]|0));){}}h=e}function Aj(c,d){var i=h,g=c,c=h;h+=40;for(var g=g>>2,e=c>>2,j=g+10;g<j;g++,e++){a[e]=a[g]}g=d;d=h;h+=40;g>>=2;e=d>>2;for(j=g+10;g<j;g++,e++){a[e]=a[g]}g=m[c+28|0];if(0==m[d+28|0]<<24>>24){return h=i,0!=g<<24>>24&1}if(0==g<<24>>24){return h=i,-1}g=c|0;e=d|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])&-1;if(0!=(g|0)){return h=i,g}g=c+8|0;e=d+8|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])&-1;h=i;return g}function YN(b){var c=b>>2,d=b+24|0,g=a[c+44];0!=(g|0)&&G(g);g=a[c+46];0!=(g|0)&&G(g);g=a[c+48];0!=(g|0)&&G(g);g=a[c+50];0!=(g|0)&&G(g);g=a[c+52];0!=(g|0)&&G(g);vh(a[c+30]);c=a[d>>2];if(0!=(c|0)){J[a[a[c+4>>2]+4>>2]](b)}b=d>>2;for(d=b+70;b<d;b++){a[b]=0}}function ZN(b){var c,d=b+44|0;c=b+208|0;var g=1>(a[c>>2]|0),f=b+212|0,e=a[f>>2];a:do{if(g){var h=e}else{for(var k=1,j=e;;){if(j=a[j+(k<<2)>>2],m[j+250|0]=0,ax(j),k=k+1|0,j=a[f>>2],(k|0)>(a[c>>2]|0)){h=j;break a}}}}while(0);0!=(h|0)&&G(h);c=a[b+276>>2];0!=(c|0)&&G(c);c=a[b+224>>2];0!=(c|0)&&G(c);c=(b+220|0)>>2;g=a[c];do{if(0!=(g|0)){f=b+244|0;h=D[f>>1];e=b+246|0;if(h<<16>>16>D[e>>1]<<16>>16){f=h,e=g}else{h=h<<16>>16;for(k=g;;){G(a[(k+12>>2)+(11*h|0)]);h=h+1|0;if((h|0)>(D[e>>1]<<16>>16|0)){break}k=a[c]}f=D[f>>1];e=a[c]}-1==f<<16>>16?G(e-44|0):G(e)}}while(0);if((a[b+32>>2]|0)!=(b|0)){b=d>>2;for(d=b+61;b<d;b++){a[b]=0}}}function lq(b,c,d,g){var f=b>>2;if(0==(c|0)){var c=a[f+4],e=a[f+3],b=(c|0)!=(e|0)?(a[c+236>>2]|0)==(a[e+236>>2]|0)?2:1:0!=m[b+56|0]<<24>>24?4:0==m[b+96|0]<<24>>24?8:4}else{b=c}a[f+43]=b|g|(0==(d|0)?2==(b|0)?(a[a[f+4]+240>>2]|0)<(a[a[f+3]+240>>2]|0)?16:32:1==(b|0)?(a[a[f+4]+236>>2]|0)<(a[a[f+3]+236>>2]|0)?16:32:16:d)}function bx(c,d){var i,g,e,Xa,l,k,n,z,p,s,v,t=h;h+=388;var u,w=t+184,A=t+368,B=D[c+164>>1]&14;if(0!=(B|0)){Tw(c);var C=h,y=a[km>>2];a[km>>2]=y+1|0;if(0>=(y|0)){var F=Cb(4800);a[Ch>>2]=F;0==(F|0)&&(la(1,bO|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),S());a[Yo>>2]=300;a[ml>>2]=0;a[nl>>2]=0;0!=m[ld]<<24>>24&&mk(ih)}h=C;var E=fa(92),H=a[c+256>>2];a[A+8>>2]=(H|0)/4&-1;var M=A+12|0;a[M>>2]=H;var I=fa(512);v=(A+4|0)>>2;a[v]=0;s=(A|0)>>2;a[s]=0;var O=c+244|0,K=D[O>>1],L=K<<16>>16;p=(c+246|0)>>1;var ia=D[p];if(K<<16>>16>ia<<16>>16){var N=I,Q=0,R=11520,U=L}else{for(var W=c+220|0,Z=I,Y=0,V=0,ca=L,$=a[W>>2],ka=ia;;){z=($+44*ca|0)>>2;var zb=a[z],ja=zb+V|0,aa=$+44*ca+4|0,da=a[a[aa>>2]>>2];if(0==(da|0)){var ea=zb}else{var xa=a[s]|0,qa=da+32|0,na=da+104|0,ha=(b[0]=a[qa>>2],b[1]=a[qa+4>>2],f[0])-(b[0]=a[na>>2],b[1]=a[na+4>>2],f[0]);a[s]=(xa<ha?xa:ha)&-1;ea=a[z]}if(0!=(ea|0)){var ga=a[a[aa>>2]+(ea-1<<2)>>2];if(0!=(ga|0)){var va=a[v]|0,Rb=ga+32|0,Aa=ga+112|0,tb=(b[0]=a[Rb>>2],b[1]=a[Rb+4>>2],f[0])+(b[0]=a[Aa>>2],b[1]=a[Aa+4>>2],f[0]);a[v]=(va>tb?va:tb)&-1}}a[s]=a[s]-16|0;a[v]=a[v]+16|0;if(0<(a[z]|0)){for(var ya=Z,Ba=Y,wa=0,Ab=$;;){var Fa=a[a[(Ab+4>>2)+(11*ca|0)]+(wa<<2)>>2],Ga=a[Fa+128>>2];if(0!=(Ga|0)){n=(Ga+108|0)>>2;var Ea=a[n];if(0==(Ea|0)){sa(cO|0,318,dO|0,eO|0);var ta=a[n]}else{ta=Ea}k=(ta+56|0)>>2;l=(Fa+32|0)>>2;a[k]=a[l];a[k+1]=a[l+1];a[k+2]=a[l+2];a[k+3]=a[l+3];m[a[n]+81|0]=1}var Ka=Fa+162|0;if(0==m[Ka]<<24>>24){u=2106}else{if(0==J[a[ke+4>>2]](Fa)<<24>>24){var za=Ba,ma=ya}else{u=2106}}a:do{if(2106==u){u=0;var pa=Fa+184|0,Ma=a[a[pa>>2]>>2],Ha=0==(Ma|0);b:do{if(Ha){var Ra=ya,Qa=Ba}else{for(var Pa=ya,La=Ba,db=0,Ya=Ma;;){var hb=m[Ya+124|0];if(4==hb<<24>>24||6==hb<<24>>24){var Za=La,ib=Pa}else{lq(Ya,1,16,64);var ab=La+1|0;a[Pa+(La<<2)>>2]=Ya;if(0!=(ab&127|0)){Za=ab,ib=Pa}else{var $a=0==(Pa|0)?Cb((La<<2)+516|0):wb(Pa,(La<<2)+516|0),Za=ab,ib=$a}}var jb=db+1|0,Ca=a[a[pa>>2]+(jb<<2)>>2];if(0==(Ca|0)){Ra=ib;Qa=Za;break b}else{Pa=ib,La=Za,db=jb,Ya=Ca}}}}while(0);var Ia=Fa+192|0,eb=a[Ia>>2],ub=0==(eb|0);b:do{if(ub){var Sa=Qa,mb=Ra}else{var ua=a[eb>>2];if(0==(ua|0)){Sa=Qa,mb=Ra}else{for(var Oa=Ra,Wa=Qa,pb=0,ob=ua;;){lq(ob,2,0,128);var bb=Wa+1|0;a[Oa+(Wa<<2)>>2]=ob;var qb=0==(bb&127|0)?0==(Oa|0)?Cb((Wa<<2)+516|0):wb(Oa,(Wa<<2)+516|0):Oa,Hb=pb+1|0,kb=a[a[Ia>>2]+(Hb<<2)>>2];if(0==(kb|0)){Sa=bb;mb=qb;break b}else{Oa=qb,Wa=bb,pb=Hb,ob=kb}}}}}while(0);var Gb=Fa+208|0,vb=a[Gb>>2];if(0==(vb|0)){za=Sa,ma=mb}else{if(0==m[Ka]<<24>>24){Xa=(Fa+112|0)>>2;var xb=(b[0]=a[Xa],b[1]=a[Xa+1],f[0]),Jb=Fa+244|0;f[0]=a[Jb>>2]|0;a[Xa]=b[0];a[Xa+1]=b[1];a[Jb>>2]=xb&-1}var nb=a[vb>>2];if(0==(nb|0)){za=Sa,ma=mb}else{for(var rb=mb,lb=Sa,Ta=0,cb=nb;;){lq(cb,0,0,128);var fb=lb+1|0;a[rb+(lb<<2)>>2]=cb;var Ua=0==(fb&127|0)?0==(rb|0)?Cb((lb<<2)+516|0):wb(rb,(lb<<2)+516|0):rb,sb=Ta+1|0,Na=a[a[Gb>>2]+(sb<<2)>>2];if(0==(Na|0)){za=fb;ma=Ua;break a}else{rb=Ua,lb=fb,Ta=sb,cb=Na}}}}}}while(0);var Fb=wa+1|0,Db=a[W>>2];if((Fb|0)<(a[(Db>>2)+(11*ca|0)]|0)){ya=ma,Ba=za,wa=Fb,Ab=Db}else{break}}var Ob=ma,Eb=za,Kb=Db,Bb=D[p]}else{Ob=Z,Eb=Y,Kb=$,Bb=ka}var Ja=ca+1|0;if((Ja|0)>(Bb<<16>>16|0)){break}else{Z=Ob,Y=Eb,V=ja,ca=Ja,$=Kb,ka=Bb}}N=Ob;Q=Eb;R=(ja<<5)+11520|0;U=Ja}var Lb=N;ch(Lb,Q,322);var Mb=E+84|0;a[Mb>>2]=fa(R);var Nb=A+16|0;a[Nb>>2]=fa(U<<5);var Pb=2==(B|0);a:do{if(Pb){var Wb=a[c+216>>2];if(0!=(Wb|0)){for(var Tb=Wb;;){1==m[Tb+162|0]<<24>>24&&0!=(a[Tb+120>>2]|0)&&fO(Tb);var ic=a[Tb+168>>2];if(0==(ic|0)){break a}else{Tb=ic}}}}}while(0);var Yb=0<(Q|0);a:do{if(Yb){var Sb=w|0,$b=w+16|0,Zb=w+12|0,ec=w+28|0,pc=w+68|0,dc=w+124|0,Vb=w+128|0;e=(c+220|0)>>2;for(var Xb=N,kc=c,rc=t|0,ac=t+16|0,nc=t+12|0,gc=t+28|0,lc=t+68|0,uc=t+124|0,qc=t+128|0,bc=0;;){var Hc=a[N+(bc<<2)>>2],jc=lm(Hc),fc=0==m[Hc+56|0]<<24>>24?0==m[Hc+96|0]<<24>>24?jc:Hc:Hc;g=fc>>2;if(0==(a[g+43]&32|0)){var mc=fc}else{for(var Qb=(fc|0)>>2,tc=rc>>2,Sc=Qb+46;Qb<Sc;Qb++,tc++){a[tc]=a[Qb]}a[ac>>2]=a[g+3];a[nc>>2]=a[g+4];Qb=(fc+68|0)>>2;tc=gc>>2;for(Sc=Qb+10;Qb<Sc;Qb++,tc++){a[tc]=a[Qb]}Qb=(fc+28|0)>>2;tc=lc>>2;for(Sc=Qb+10;Qb<Sc;Qb++,tc++){a[tc]=a[Qb]}m[uc]=1;a[qc>>2]=fc;mc=t}for(var Ac=mc+68|0,Cc=Hc+108|0,Ec=Hc+125|0,Ic=mc+28|0,oc=Hc+172|0,Fc=bc,vc=1;;){var Dc=Fc+1|0,Kc=(Dc|0)<(Q|0);if(!Kc){break}var Bc=(Dc<<2)+N|0,zc=a[Bc>>2];if((jc|0)!=(lm(zc)|0)){break}if(0==m[Ec]<<24>>24){var fd=0==m[zc+56|0]<<24>>24?0==m[zc+96|0]<<24>>24?jc:zc:zc;i=fd>>2;if(0==(a[i+43]&32|0)){var Gc=fd}else{Qb=(fd|0)>>2;tc=Sb>>2;for(Sc=Qb+46;Qb<Sc;Qb++,tc++){a[tc]=a[Qb]}a[$b>>2]=a[i+3];a[Zb>>2]=a[i+4];Qb=(fd+68|0)>>2;tc=ec>>2;for(Sc=Qb+10;Qb<Sc;Qb++,tc++){a[tc]=a[Qb]}Qb=(fd+28|0)>>2;tc=pc>>2;for(Sc=Qb+10;Qb<Sc;Qb++,tc++){a[tc]=a[Qb]}m[dc]=1;a[Vb>>2]=fd;Gc=w}if(0!=(Aj(Ic,Gc+28|0)|0)){break}if(0!=(Aj(Ac,Gc+68|0)|0)){break}if(2==(a[oc>>2]&15|0)&&(a[Cc>>2]|0)!=(a[zc+108>>2]|0)){break}if(0!=(a[a[Bc>>2]+172>>2]&64|0)){break}}Fc=Dc;vc=vc+1|0}var yc=a[Hc+16>>2],Nc=a[Hc+12>>2],Yc=(yc|0)==(Nc|0),Tc=a[yc+236>>2];b:do{if(Yc){if((Tc|0)==(D[p]<<16>>16|0)){if(0<(Tc|0)){var Lc=a[a[(a[e]+4>>2)+(11*(Tc-1)|0)]>>2]+40|0,Mc=yc+40|0,id=(b[0]=a[Lc>>2],b[1]=a[Lc+4>>2],f[0])-(b[0]=a[Mc>>2],b[1]=a[Mc+4>>2],f[0])&-1}else{var Oc=yc+96|0,id=(b[0]=a[Oc>>2],b[1]=a[Oc+4>>2],f[0])&-1}}else{if((Tc|0)==(D[O>>1]<<16>>16|0)){var Pc=yc+40|0,Xc=a[a[(a[e]+4>>2)+(11*(Tc+1)|0)]>>2]+40|0,id=(b[0]=a[Pc>>2],b[1]=a[Pc+4>>2],f[0])-(b[0]=a[Xc>>2],b[1]=a[Xc+4>>2],f[0])&-1}else{var Qc=a[e],Rc=a[a[(Qc+4>>2)+(11*(Tc-1)|0)]>>2]+40|0,Jc=(b[0]=a[Rc>>2],b[1]=a[Rc+4>>2],f[0]),Vc=yc+40|0,Zc=(b[0]=a[Vc>>2],b[1]=a[Vc+4>>2],f[0]),ad=Jc-Zc&-1,$c=a[a[(Qc+4>>2)+(11*(Tc+1)|0)]>>2]+40|0,bd=Zc-(b[0]=a[$c>>2],b[1]=a[$c+4>>2],f[0])&-1,id=(ad|0)<(bd|0)?ad:bd}}UH(0,Xb,bc,vc,a[M>>2]|0,(id|0)/2&-1|0,ke);if(0<(vc|0)){for(var cd=0;;){var ed=a[a[N+(cd+bc<<2)>>2]+108>>2];0!=(ed|0)&&al(kc,ed);var pd=cd+1|0;if((pd|0)==(vc|0)){break b}else{cd=pd}}}}else{(Tc|0)==(a[Nc+236>>2]|0)?gO(A,E,N,bc,vc,B):hO(A,E,N,bc,vc,B)}}while(0);if(Kc){bc=Dc}else{break a}}}}while(0);var jd=a[c+216>>2],md=0==(jd|0);a:do{if(!md){for(var qd=c,dd=jd;;){if(1==m[dd+162|0]<<24>>24){var od=dd+120|0;0!=(a[od>>2]|0)&&(fO(dd),al(qd,a[od>>2]))}var Uc=a[dd+168>>2];if(0==(Uc|0)){break a}else{dd=Uc}}}}while(0);if(0!=(d|0)){var yd=ra(c);if(0!=(yd|0)){for(var sd=yd;;){var Bd=Ib(c,sd),Fd=0==(Bd|0);a:do{if(!Fd){for(var vd=Bd;;){if(0!=J[a[ke>>2]](vd)<<24>>24){var kd=a[vd+24>>2];if(0!=(kd|0)){var Md=kd,td=cc,Cd=a[Md+4>>2],Gd=Cb(48*Cd|0),td=(Md|0)>>2;if(0<(Cd|0)){for(var Ld=Gd,nd=a[td]+48*(Cd-1)|0,zd=0;;){var wd=nd,xd=Ld,Ed=cc,Wd=cc,we=cc,pe=cc,Hd=cc,Kd=cc,Dd=a[wd+4>>2],Yd=Cb(Dd<<4),$d=0<(Dd|0);b:do{if($d){for(var Ye=Yd,Ad=(Dd-1<<4)+a[wd>>2]|0,Ud=0;;){Kd=Ye>>2;Hd=Ad>>2;a[Kd]=a[Hd];a[Kd+1]=a[Hd+1];a[Kd+2]=a[Hd+2];a[Kd+3]=a[Hd+3];var Vd=Ud+1|0;if((Vd|0)==(Dd|0)){break b}else{Ye=Ye+16|0,Ad=Ad-16|0,Ud=Vd}}}}while(0);a[xd>>2]=Yd;a[xd+4>>2]=Dd;a[xd+8>>2]=a[wd+12>>2];a[xd+12>>2]=a[wd+8>>2];pe=(xd+16|0)>>2;we=(wd+32|0)>>2;a[pe]=a[we];a[pe+1]=a[we+1];a[pe+2]=a[we+2];a[pe+3]=a[we+3];Wd=(xd+32|0)>>2;Ed=(wd+16|0)>>2;a[Wd]=a[Ed];a[Wd+1]=a[Ed+1];a[Wd+2]=a[Ed+2];a[Wd+3]=a[Ed+3];var be=zd+1|0;if((be|0)==(Cd|0)){break}else{Ld=Ld+48|0,nd=nd-48|0,zd=be}}for(var Pd=0,gd=a[td];;){G(a[(gd>>2)+(12*Pd|0)]);var ud=Pd+1|0,de=a[td];if((ud|0)==(Cd|0)){Id=de;break}else{Pd=ud,gd=de}}le=Id}else{var Id=a[td],le=Id}G(le);a[td]=Gd}}var ae=yb(c,vd);if(0==(ae|0)){break a}else{vd=ae}}}}while(0);var Nd=ba(c,sd);if(0==(Nd|0)){break}else{sd=Nd}}}}var ce=0!=(a[Zk>>2]|0)|0!=(a[$k>>2]|0);a:do{if(ce){var Qd=c,se=ra(Qd);if(0!=(se|0)){for(var Ae=c,he=se;;){var Ee=0==(a[Zk>>2]|0);b:do{if(!Ee){var xe=Og(Qd,he);if(0!=(xe|0)){for(var qe=xe;;){var re=qe+112|0;0!=(a[re>>2]|0)&&(Eu(qe,1),al(Ae,a[re>>2]));var Ce=Ql(Qd,qe);if(0==(Ce|0)){break b}else{qe=Ce}}}}}while(0);var Ge=0==(a[$k>>2]|0);b:do{if(!Ge){var ue=Ib(Qd,he);if(0!=(ue|0)){for(var ge=ue;;){var ze=ge+116|0;0!=(a[ze>>2]|0)&&(Eu(ge,0),al(Ae,a[ze>>2]));var De=yb(Qd,ge);if(0==(De|0)){break b}else{ge=De}}}}}while(0);var me=ba(Qd,he);if(0==(me|0)){break a}else{he=me}}}}}while(0);G(Lb);G(a[Mb>>2]);G(E);G(a[Nb>>2]);var te=h,Be=a[km>>2]-1|0;a[km>>2]=Be;if(0>=(Be|0)&&(G(a[Ch>>2]),0!=m[ld]<<24>>24)){var He=a[oa>>2],Ie=a[ml>>2],Ke=a[nl>>2],Le=Jn();Va(He,iO|0,(j=h,h+=16,a[j>>2]=Ie,a[j+4>>2]=Ke,f[0]=Le,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j))}h=te;a[Ah>>2]=1}h=t}function fO(c){var d;if(0!=(a[c+180>>2]|0)){for(d=a[c+184>>2];;){var i=a[d>>2];if(0==m[i+124|0]<<24>>24){break}else{d=i+128|0}}d=(i+108|0)>>2;var i=a[d],g=0==(a[a[c+20>>2]+152>>2]&1|0)?i+24|0:i+32|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),e=c+32|0,g=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])+.5*g,i=i+56|0;f[0]=g;a[i>>2]=b[0];a[i+4>>2]=b[1];c=c+40|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);i=a[d]+64|0;f[0]=c;a[i>>2]=b[0];a[i+4>>2]=b[1];m[a[d]+81|0]=1}}function lm(b){for(;;){var c=a[b+180>>2];if(0==(c|0)){var d=b;break}else{b=c}}for(;!(b=a[d+128>>2],0==(b|0));){d=b}return d}function jO(c,d){var i,g,e,j,l=h;h+=368;j=l>>2;var k=l+184;e=k>>2;var n=a[c>>2],z=a[d>>2],p=a[n+172>>2],s=p&15,v=a[z+172>>2],t=v&15;if((s|0)!=(t|0)){return h=l,t-s|0}t=lm(n);g=t>>2;s=lm(z);i=s>>2;var u=a[g+4],w=a[g+3],A=a[u+236>>2]-a[w+236>>2]|0,B=a[i+4],C=a[i+3],y=a[B+236>>2]-a[C+236>>2]|0,A=-1<(A|0)?A:-A|0,y=-1<(y|0)?y:-y|0;if((A|0)!=(y|0)){return h=l,A-y|0}u=u+32|0;w=w+32|0;w=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])-(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]);B=B+32|0;C=C+32|0;w&=-1;w=-1<(w|0)?w:-w|0;C=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0])-(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0])&-1;C=-1<(C|0)?C:-C|0;if((w|0)!=(C|0)){return h=l,w-C|0}g=a[g+5];i=a[i+5];if((g|0)!=(i|0)){return h=l,g-i|0}0==m[n+56|0]<<24>>24?(t=i=0==m[n+96|0]<<24>>24?t:n,i=a[i+172>>2]):(t=n,i=p);if(0==(i&32|0)){j=t}else{i=(t|0)>>2;g=(l|0)>>2;for(C=i+46;i<C;i++,g++){a[g]=a[i]}a[j+4]=a[t+12>>2];a[j+3]=a[t+16>>2];i=(t+68|0)>>2;g=(l+28|0)>>2;for(C=i+10;i<C;i++,g++){a[g]=a[i]}i=(t+28|0)>>2;g=(l+68|0)>>2;for(C=i+10;i<C;i++,g++){a[g]=a[i]}m[l+124|0]=1;a[j+32]=t;j=l}0==m[z+56|0]<<24>>24?(s=t=0==m[z+96|0]<<24>>24?s:z,t=a[t+172>>2]):(s=z,t=v);if(0==(t&32|0)){e=s}else{i=(s|0)>>2;g=(k|0)>>2;for(C=i+46;i<C;i++,g++){a[g]=a[i]}a[e+4]=a[s+12>>2];a[e+3]=a[s+16>>2];i=(s+68|0)>>2;g=(k+28|0)>>2;for(C=i+10;i<C;i++,g++){a[g]=a[i]}i=(s+28|0)>>2;g=(k+68|0)>>2;for(C=i+10;i<C;i++,g++){a[g]=a[i]}m[k+124|0]=1;a[e+32]=s;e=k}k=Aj(j+28|0,e+28|0);if(0!=(k|0)){return h=l,k}e=Aj(j+68|0,e+68|0);if(0!=(e|0)){return h=l,e}p&=192;v&=192;n=(p|0)==(v|0)?a[n+20>>2]-a[z+20>>2]|0:p-v|0;h=l;return n}function gO(c,d,i,g,e,j){var l,k,n,z=h;h+=1580;var p;n=z>>2;var s=z+184,v=z+188,t=z+884,u=a[i+(g<<2)>>2];k=u>>2;if(0==(a[k+43]&32|0)){n=u}else{var w=(u|0)>>2;l=(z|0)>>2;for(var A=w+46;w<A;w++,l++){a[l]=a[w]}a[n+4]=a[k+3];a[n+3]=a[k+4];w=(u+68|0)>>2;l=(z+28|0)>>2;for(A=w+10;w<A;w++,l++){a[l]=a[w]}w=(u+28|0)>>2;l=(z+68|0)>>2;for(A=w+10;w<A;w++,l++){a[l]=a[w]}m[z+124|0]=1;a[n+32]=u;n=z}k=n>>2;if(0!=m[u+125|0]<<24>>24){kO(i,g,e,a[k+3],a[k+4],j)}else{if(0!=(a[k+27]|0)){lO(c,d,n,j)}else{if(2==(j|0)){cx(a[k+4],a[k+3],i,g,e,2)}else{u=m[n+61|0];w=m[n+101|0];do{if(1!=u<<24>>24|4==w<<24>>24&&1!=w<<24>>24|4==u<<24>>24){var B=a[k+4],C=a[k+3],y=a[B+20>>2],A=a[B+236>>2];if(0<(A|0)){l=a[y+220>>2]>>2;var y=(0==(m[y+149|0]&1)<<24>>24?-1:-2)+A|0,D=a[a[l+(11*y|0)+1]>>2]+40|0,F=B+40|0,A=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0])-(a[l+(11*y|0)+4]|0)-(b[0]=a[F>>2],b[1]=a[F+4>>2],f[0])-(a[l+(11*A|0)+5]|0)}else{A=a[y+260>>2]|0}y=e+1|0;l=(a[c+12>>2]|0)/y;A/=y;mm(c,d,B,n,v,1);mm(c,d,C,n,t,0);for(var B=v+52|0,C=t+52|0,y=8==(j|0),D=d+80|0,E=0;;){if((E|0)>=(e|0)){p=2272;break}var F=a[i+(E+g<<2)>>2],M=a[B>>2],G=M-1|0,O=(G<<5)+v+56|0,O=(b[0]=a[O>>2],b[1]=a[O+4>>2],f[0]),H=(G<<5)+v+72|0,H=(b[0]=a[H>>2],b[1]=a[H+4>>2],f[0]),G=(G<<5)+v+80|0,I=(b[0]=a[G>>2],b[1]=a[G+4>>2],f[0]);f[0]=O;a[Z>>2]=b[0];a[Z+4>>2]=b[1];f[0]=I;a[Z+8>>2]=b[0];a[Z+12>>2]=b[1];var E=E+1|0,J=E|0,G=J*l;f[0]=H+G;a[Z+16>>2]=b[0];a[Z+20>>2]=b[1];H=I+J*A;f[0]=H;a[Z+24>>2]=b[0];a[Z+28>>2]=b[1];f[0]=O;a[Z+32>>2]=b[0];a[Z+36>>2]=b[1];f[0]=H;a[Z+40>>2]=b[0];a[Z+44>>2]=b[1];I=a[C>>2]-1|0;O=(I<<5)+t+72|0;O=(b[0]=a[O>>2],b[1]=a[O+4>>2],f[0]);f[0]=O;a[Z+48>>2]=b[0];a[Z+52>>2]=b[1];f[0]=H+A;a[Z+56>>2]=b[0];a[Z+60>>2]=b[1];J=(I<<5)+t+56|0;J=(b[0]=a[J>>2],b[1]=a[J+4>>2],f[0]);I=(I<<5)+t+80|0;I=(b[0]=a[I>>2],b[1]=a[I+4>>2],f[0]);f[0]=O;a[Z+80>>2]=b[0];a[Z+84>>2]=b[1];f[0]=I;a[Z+72>>2]=b[0];a[Z+76>>2]=b[1];f[0]=J-G;a[Z+64>>2]=b[0];a[Z+68>>2]=b[1];f[0]=H;a[Z+88>>2]=b[0];a[Z+92>>2]=b[1];M=0<(M|0);a:do{if(M){for(G=0;;){if(bd(d,(G<<5)+v+56|0),G=G+1|0,(G|0)>=(a[B>>2]|0)){break a}}}}while(0);bd(d,Z|0);bd(d,Z+32|0);bd(d,Z+64|0);M=a[C>>2];G=0<(M|0);a:do{if(G){for(O=M;;){if(O=O-1|0,bd(d,(O<<5)+t+56|0),0>=(O|0)){break a}}}}while(0);M=y?ff(d,s,0):ff(d,s,1);G=a[s>>2];if(0==(G|0)){p=2276;break}Wd(F,a[F+12>>2],M,G,ke);a[D>>2]=0}if(2272==p){h=z;return}if(2276==p){h=z;return}}}while(0);mO(c,d,i,g,e,n,8==(j|0)&1)}}}h=z}function hO(c,d,i,g,e,j){var l,k,n,z,p,s,v,t,u,w,A,B,C,y,D,F,E,M,G,O,H,I,K,L,N,Q,S,R,U,W,Y,ca,V,$,ba,ja,aa,da,ea,xa,fa,la,ha,ga,ka,sa,ra,qa,ya,na,wa,Ab,Fa,Ga=h;h+=2276;var oa;Fa=Ga>>2;var ta=Ga+4;Ab=ta>>2;var Ka=Ga+188;wa=Ka>>2;var za=Ga+372,ma=Ga+556,pa=Ga+1252,va=Ga+1948,Ha=Ga+1980;na=Ha>>2;var Ra=Ga+1984;ya=Ra>>2;var Ba=Ga+1988,Aa=Ga+2020,La=Ga+2052,Ea=Ga+2084,Ya=Ga+2116,Ma=Ga+2148,Za=Ga+2180,Qa=Ga+2212,ab=Ga+2244;if(0==(a[le>>2]|0)){var $a=Cb(32e3);a[le>>2]=$a;var jb=Cb(32e3);a[Dj>>2]=jb;a[ai>>2]=2e3;a[mq>>2]=2e3}var Ca=a[i+(g<<2)>>2];qa=(Ca+16|0)>>2;var Ia=a[qa],eb=a[Ia+20>>2];ra=(Ca+12|0)>>2;var ub=a[ra],Sa=a[Ia+236>>2]-a[ub+236>>2]|0;do{if(1<((-1<(Sa|0)?Sa:-Sa|0)|0)){for(var Pa=Ca|0,ua=Pa>>2,Oa=(ta|0)>>2,Wa=ua+46;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}for(var pb=0==(a[Ca+172>>2]&32|0),ob=Ka|0,ua=Pa>>2,Oa=ob>>2,Wa=ua+46;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}if(pb){var bb=a[qa],qb=a[Ab+4]=bb}else{a[wa+4]=a[ra];a[wa+3]=a[qa];for(var db=Ka+28|0,kb=Ca+68|0,ua=kb>>2,Oa=db>>2,Wa=ua+10;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}for(var hb=Ka+68|0,ua=(Ca+28|0)>>2,Oa=hb>>2,Wa=ua+10;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}m[Ka+124|0]=1;a[wa+32]=Ca;var vb=a[ra];a[Ab+4]=vb;for(var xb=ta+28|0,ua=kb>>2,Oa=xb>>2,Wa=ua+10;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}qb=vb}for(var ib=lm(Ca);;){var nb=a[ib+180>>2];if(0==(nb|0)){break}else{ib=nb}}var rb=a[ib+12>>2];a[Ab+3]=rb;m[ta+96|0]=0;m[ta+124|0]=1;sa=(ta+68|0)>>2;a[sa]=0;a[sa+1]=0;a[sa+2]=0;a[sa+3]=0;a[Ab+32]=Ca;var lb=1,Ta=ta,cb=qb,fb=rb}else{if(0==(a[Ca+172>>2]&32|0)){lb=0,Ta=Ca,cb=Ia,fb=ub}else{for(var Ua=ta|0,ua=(Ca|0)>>2,Oa=Ua>>2,Wa=ua+46;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}var sb=a[ra];a[Ab+4]=sb;var Na=a[qa];a[Ab+3]=Na;for(var Fb=ta+28|0,ua=(Ca+68|0)>>2,Oa=Fb>>2,Wa=ua+10;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}for(var Db=ta+68|0,ua=(Ca+28|0)>>2,Oa=Db>>2,Wa=ua+10;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}m[ta+124|0]=1;a[Ab+32]=Ca;lb=0;Ta=ta;cb=sb;fb=Na}}}while(0);var Ob=2==(j|0);if(Ob){var Eb=nO(Ta,a[le>>2],Ga);a[ya]=Eb;if(0==(Eb|0)){var Va=a[Ta+16>>2],Bb=a[Ta+12>>2];oa=2291}}else{Va=cb,Bb=fb,oa=2291}if(2291==oa){var Ja=8==(j|0);a[ya]=0;a[Fa]=Bb;Sg(Ba,c,Va,0,Ta);ka=ma>>2;ga=Ba>>2;a[ka]=a[ga];a[ka+1]=a[ga+1];a[ka+2]=a[ga+2];a[ka+3]=a[ga+3];a[ka+4]=a[ga+4];a[ka+5]=a[ga+5];a[ka+6]=a[ga+6];a[ka+7]=a[ga+7];ha=va>>2;a[ha]=a[ga];a[ha+1]=a[ga+1];a[ha+2]=a[ga+2];a[ha+3]=a[ga+3];a[ha+4]=a[ga+4];a[ha+5]=a[ga+5];a[ha+6]=a[ga+6];a[ha+7]=a[ga+7];vl(d,Ta,1,ma,nm(Va));la=(ma+52|0)>>2;var mb=a[la]-1|0,yb=(mb<<5)+ma+80|0,Hb=(b[0]=a[yb>>2],b[1]=a[yb+4>>2],f[0]);fa=(va+24|0)>>2;f[0]=Hb;a[fa]=b[0];a[fa+1]=b[1];var Gb=(mb<<5)+ma+64|0,Jb=(b[0]=a[Gb>>2],b[1]=a[Gb+4>>2],f[0]);xa=(va+8|0)>>2;f[0]=Jb;a[xa]=b[0];a[xa+1]=b[1];var Kb=Va+40|0;bi(Aa,va,1,(b[0]=a[Kb>>2],b[1]=a[Kb+4>>2],f[0])-a[(a[a[Va+20>>2]+220>>2]+16>>2)+(11*a[Va+236>>2]|0)]&-1);ea=Aa>>2;a[ha]=a[ea];a[ha+1]=a[ea+1];a[ha+2]=a[ea+2];a[ha+3]=a[ea+3];a[ha+4]=a[ea+4];a[ha+5]=a[ea+5];a[ha+6]=a[ea+6];a[ha+7]=a[ea+7];da=(va|0)>>2;aa=(va+16|0)>>2;if((b[0]=a[da],b[1]=a[da+1],f[0])<(b[0]=a[aa],b[1]=a[aa+1],f[0])){if((b[0]=a[xa],b[1]=a[xa+1],f[0])<(b[0]=a[fa],b[1]=a[fa+1],f[0])){var Ib=a[la];a[la]=Ib+1|0;ja=((Ib<<5)+ma+56|0)>>2;a[ja]=a[ha];a[ja+1]=a[ha+1];a[ja+2]=a[ha+2];a[ja+3]=a[ha+3];a[ja+4]=a[ha+4];a[ja+5]=a[ha+5];a[ja+6]=a[ha+6];a[ja+7]=a[ha+7]}}ba=La>>2;var Lb=eb+149|0;$=Ea>>2;V=pa>>2;ca=Ya>>2;Y=(pa+52|0)>>2;var Mb=d+56|0,Nb=d+69|0;W=Ma>>2;var Pb=d+16|0,Tb=d+29|0,Wb=-1,Yb=0,Vb=Va,Sb=Ta,$b=Bb;a:for(;;){for(var Zb=0,bc=Wb,ec=Yb,fc=Vb,lc=Sb,dc=0,Xb=$b;;){if(1!=m[Xb+162|0]<<24>>24){break a}if(0!=J[a[ke+4>>2]](Xb)<<24>>24){break a}var kc=dc|1,rc=(dc<<5)+Z|0;dx(La,c,eb,a[fc+236>>2]);U=rc>>2;a[U]=a[ba];a[U+1]=a[ba+1];a[U+2]=a[ba+2];a[U+3]=a[ba+3];a[U+4]=a[ba+4];a[U+5]=a[ba+5];a[U+6]=a[ba+6];a[U+7]=a[ba+7];if(0==(Zb|0)){var jc;for(var ac=cc,nc=Xb+32|0,Qb=Xb,tc=0;;){var gc=a[a[a[Qb+184>>2]>>2]+12>>2];if(1!=m[gc+162|0]<<24>>24){ac=2393;break}if(1!=(a[gc+188>>2]|0)){ac=2396;break}if(1!=(a[gc+180>>2]|0)){ac=2394;break}var uc=gc+32|0;if((b[0]=a[uc>>2],b[1]=a[uc+4>>2],f[0])!=(b[0]=a[nc>>2],b[1]=a[nc+4>>2],f[0])){ac=2395;break}else{Qb=gc,tc=tc+1|0}}jc=2396==ac||2393==ac||2395==ac||2394==ac?tc:cc;var mc=(jc|0)<((0!=(m[Lb]&1)<<24>>24?5:3)|0),qc=mc&1^1,vc=mc?bc:1,oc=mc?jc:jc-2|0}else{qc=Zb,vc=bc,oc=ec}if(!(0==(qc|0)|0<(vc|0))){break}var Ac=(kc<<5)+Z|0;Sg(Ea,c,Xb,lc,a[a[Xb+184>>2]>>2]);R=Ac>>2;a[R]=a[$];a[R+1]=a[$+1];a[R+2]=a[$+2];a[R+3]=a[$+3];a[R+4]=a[$+4];a[R+5]=a[$+5];a[R+6]=a[$+6];a[R+7]=a[$+7];var zc=a[a[a[Fa]+184>>2]>>2],Dc=a[zc+16>>2],Cc=a[zc+12>>2];a[Fa]=Cc;Zb=qc;bc=vc-1|0;ec=oc;fc=Dc;lc=zc;dc=dc+2|0;Xb=Cc}Sg(Ya,c,Xb,lc,a[a[Xb+184>>2]>>2]);a[V]=a[ca];a[V+1]=a[ca+1];a[V+2]=a[ca+2];a[V+3]=a[ca+3];a[V+4]=a[ca+4];a[V+5]=a[ca+5];a[V+6]=a[ca+6];a[V+7]=a[ca+7];xl(d,lc,1,pa,nm(a[lc+12>>2]));var Bc=a[Fa],Ec=Bc+40|0;bi(va,(a[Y]-1<<5)+pa+56|0,4,(b[0]=a[Ec>>2],b[1]=a[Ec+4>>2],f[0])+a[(a[a[Bc+20>>2]+220>>2]+20>>2)+(11*a[Bc+236>>2]|0)]&-1);if((b[0]=a[da],b[1]=a[da+1],f[0])<(b[0]=a[aa],b[1]=a[aa+1],f[0])){if((b[0]=a[xa],b[1]=a[xa+1],f[0])<(b[0]=a[fa],b[1]=a[fa+1],f[0])){var Fc=a[Y];a[Y]=Fc+1|0;S=((Fc<<5)+pa+56|0)>>2;a[S]=a[ha];a[S+1]=a[ha+1];a[S+2]=a[ha+2];a[S+3]=a[ha+3];a[S+4]=a[ha+4];a[S+5]=a[ha+5];a[S+6]=a[ha+6];a[S+7]=a[ha+7]}}f[0]=1.5707963267948966;a[Mb>>2]=b[0];a[Mb+4>>2]=b[1];m[Nb]=1;ex(d,Sb,lc,ma,pa,kc);if(Ja){var Ic=ff(d,Ha,0);oa=2310}else{var yc=ff(d,Ha,1);if(Ob){var Gc=a[na];if(4<(Gc|0)){Q=(yc+16|0)>>2;N=yc>>2;a[Q]=a[N];a[Q+1]=a[N+1];a[Q+2]=a[N+2];a[Q+3]=a[N+3];L=(yc+32|0)>>2;var Kc=(Gc-1<<4)+yc|0;K=Kc>>2;a[L]=a[K];a[L+1]=a[K+1];a[L+2]=a[K+2];a[L+3]=a[K+3];ck(yc+48|0,Kc);var Tc=a[na]=4,Nc=yc}else{var Mc=yc,Lc=Gc;oa=2311}}else{Ic=yc,oa=2310}}2310==oa&&(oa=0,Mc=Ic,Lc=a[na],oa=2311);if(2311==oa){if(oa=0,0==(Lc|0)){oa=2367;break}else{Tc=Lc,Nc=Mc}}var Oc=a[ya],Pc=Oc+Tc|0;if((Pc|0)>(a[ai>>2]|0)){a[ai>>2]=Pc<<1;var Xc=wb(a[le>>2],Pc<<5),Qc=a[le>>2]=Xc}else{Qc=a[le>>2]}if(0<(Tc|0)){for(var Yc=1<(Tc|0)?Tc:1,Rc=0,Vc=Oc;;){I=((Vc<<4)+Qc|0)>>2;H=((Rc<<4)+Nc|0)>>2;a[I]=a[H];a[I+1]=a[H+1];a[I+2]=a[H+2];a[I+3]=a[H+3];var Zc=Rc+1|0;if((Zc|0)<(Tc|0)){Rc=Zc,Vc=Vc+1|0}else{break}}a[ya]=Oc+Yc|0}var Jc,ad=a[a[a[Fa]+184>>2]>>2],cd=Qc,$c=cc,bd=cc,dd=cc,jd=cc,md=cc,ed=Ra>>2,ld=a[ed],pd=0==(oc|0);b:do{if(pd){var Uc=ad}else{for(var od=oc,qd=ad;;){var sd=od-1|0,td=a[a[a[qd+12>>2]+184>>2]>>2];if(0==(sd|0)){Uc=td;break b}else{od=sd,qd=td}}}}while(0);a[ed]=ld+1|0;md=((ld<<4)+cd|0)>>2;jd=((ld-1<<4)+cd|0)>>2;a[md]=a[jd];a[md+1]=a[jd+1];a[md+2]=a[jd+2];a[md+3]=a[jd+3];var vd=a[ed];a[ed]=vd+1|0;dd=((vd<<4)+cd|0)>>2;a[dd]=a[jd];a[dd+1]=a[jd+1];a[dd+2]=a[jd+2];a[dd+3]=a[jd+3];bd=((a[ed]<<4)+cd|0)>>2;$c=(a[Uc+16>>2]+32|0)>>2;a[bd]=a[$c];a[bd+1]=a[$c+1];a[bd+2]=a[$c+2];a[bd+3]=a[$c+3];Jc=Uc;fx(Sb,d);var kd=a[Jc+16>>2];O=kd>>2;var wd=a[Jc+12>>2];a[Fa]=wd;Sg(Ma,c,kd,a[a[O+44]>>2],Jc);a[ka]=a[W];a[ka+1]=a[W+1];a[ka+2]=a[W+2];a[ka+3]=a[W+3];a[ka+4]=a[W+4];a[ka+5]=a[W+5];a[ka+6]=a[W+6];a[ka+7]=a[W+7];vl(d,Jc,1,ma,nm(kd));var xd=kd+40|0;bi(va,(a[la]-1<<5)+ma+56|0,1,(b[0]=a[xd>>2],b[1]=a[xd+4>>2],f[0])-a[(a[a[O+5]+220>>2]+16>>2)+(11*a[O+59]|0)]&-1);if((b[0]=a[da],b[1]=a[da+1],f[0])<(b[0]=a[aa],b[1]=a[aa+1],f[0])){if((b[0]=a[xa],b[1]=a[xa+1],f[0])<(b[0]=a[fa],b[1]=a[fa+1],f[0])){var yd=a[la];a[la]=yd+1|0;G=((yd<<5)+ma+56|0)>>2;a[G]=a[ha];a[G+1]=a[ha+1];a[G+2]=a[ha+2];a[G+3]=a[ha+3];a[G+4]=a[ha+4];a[G+5]=a[ha+5];a[G+6]=a[ha+6];a[G+7]=a[ha+7]}}f[0]=-1.5707963267948966;a[Pb>>2]=b[0];a[Pb+4>>2]=b[1];m[Tb]=1;Wb=vc;Yb=oc;Vb=kd;Sb=Jc;$b=wd}if(2367==oa){h=Ga;return}var Bd=dc|1,Cd=(dc<<5)+Z|0;dx(Za,c,eb,a[fc+236>>2]);M=Cd>>2;E=Za>>2;a[M]=a[E];a[M+1]=a[E+1];a[M+2]=a[E+2];a[M+3]=a[E+3];a[M+4]=a[E+4];a[M+5]=a[E+5];a[M+6]=a[E+6];a[M+7]=a[E+7];Sg(Qa,c,Xb,lc,0);F=Qa>>2;a[V]=a[F];a[V+1]=a[F+1];a[V+2]=a[F+2];a[V+3]=a[F+3];a[V+4]=a[F+4];a[V+5]=a[F+5];a[V+6]=a[F+6];a[V+7]=a[F+7];a[ha]=a[F];a[ha+1]=a[F+1];a[ha+2]=a[F+2];a[ha+3]=a[F+3];a[ha+4]=a[F+4];a[ha+5]=a[F+5];a[ha+6]=a[F+6];a[ha+7]=a[F+7];var nd=0!=(lb|0),zd=lc+12|0;xl(d,nd?Ka:lc,1,pa,nm(a[zd>>2]));var Ed=a[Y]-1|0,Fd=(Ed<<5)+pa+80|0,Ld=(b[0]=a[Fd>>2],b[1]=a[Fd+4>>2],f[0]);f[0]=Ld;a[fa]=b[0];a[fa+1]=b[1];var Hd=(Ed<<5)+pa+64|0,Md=(b[0]=a[Hd>>2],b[1]=a[Hd+4>>2],f[0]);f[0]=Md;a[xa]=b[0];a[xa+1]=b[1];var Gd=a[Fa],Qd=Gd+40|0;bi(ab,va,4,(b[0]=a[Qd>>2],b[1]=a[Qd+4>>2],f[0])+a[(a[a[Gd+20>>2]+220>>2]+20>>2)+(11*a[Gd+236>>2]|0)]&-1);D=ab>>2;a[ha]=a[D];a[ha+1]=a[D+1];a[ha+2]=a[D+2];a[ha+3]=a[D+3];a[ha+4]=a[D+4];a[ha+5]=a[D+5];a[ha+6]=a[D+6];a[ha+7]=a[D+7];if((b[0]=a[da],b[1]=a[da+1],f[0])<(b[0]=a[aa],b[1]=a[aa+1],f[0])){if((b[0]=a[xa],b[1]=a[xa+1],f[0])<(b[0]=a[fa],b[1]=a[fa+1],f[0])){var Kd=a[Y];a[Y]=Kd+1|0;y=((Kd<<5)+pa+56|0)>>2;a[y]=a[ha];a[y+1]=a[ha+1];a[y+2]=a[ha+2];a[y+3]=a[ha+3];a[y+4]=a[ha+4];a[y+5]=a[ha+5];a[y+6]=a[ha+6];a[y+7]=a[ha+7]}}ex(d,Sb,lc,ma,pa,Bd);var Dd=Ja?ff(d,Ha,0):ff(d,Ha,1),Pd=a[na];if(Ob&4<(Pd|0)){C=(Dd+16|0)>>2;B=Dd>>2;a[C]=a[B];a[C+1]=a[B+1];a[C+2]=a[B+2];a[C+3]=a[B+3];A=(Dd+32|0)>>2;var Yd=(Pd-1<<4)+Dd|0;w=Yd>>2;a[A]=a[w];a[A+1]=a[w+1];a[A+2]=a[w+2];a[A+3]=a[w+3];ck(Dd+48|0,Yd);var Id=a[na]=4}else{if(0!=(Pd|0)){Id=Pd}else{h=Ga;return}}var Ad=a[ya],Ud=Ad+Id|0;if((Ud|0)>(a[ai>>2]|0)){a[ai>>2]=Ud<<1;var Vd=wb(a[le>>2],Ud<<5);a[le>>2]=Vd}if(0<(Id|0)){for(var be=a[le>>2],de=1<(Id|0)?Id:1,gd=0,ud=Ad;;){u=((ud<<4)+be|0)>>2;t=((gd<<4)+Dd|0)>>2;a[u]=a[t];a[u+1]=a[t+1];a[u+2]=a[t+2];a[u+3]=a[t+3];var $d=gd+1|0;if(($d|0)<(Id|0)){gd=$d,ud=ud+1|0}else{break}}a[ya]=Ad+de|0}fx(Sb,d);a[Fa]=nd?a[wa+3]:a[zd>>2]}if(1==(e|0)){Wd(Ta,a[Fa],a[le>>2],a[ya],ke)}else{var ae=c+12|0,Nd=a[ya],ce=Nd-1|0,he=1<(ce|0);a:do{if(he){for(var qe=(a[ae>>2]*(e-1)|0)/2&-1|0,se=a[le>>2],ge=1;;){v=((ge<<4)+se|0)>>2;var Ae=(b[0]=a[v],b[1]=a[v+1],f[0])-qe;f[0]=Ae;a[v]=b[0];a[v+1]=b[1];var xe=ge+1|0;if((xe|0)<(ce|0)){ge=xe}else{break a}}}}while(0);var re=a[ai>>2];if((re|0)>(a[mq>>2]|0)){a[mq>>2]=re;var Ce=wb(a[Dj>>2],re<<4),ue=a[Dj>>2]=Ce}else{ue=a[Dj>>2]}var ze=0<(Nd|0);a:do{if(ze){for(var De=a[le>>2],me=0;;){s=((me<<4)+ue|0)>>2;p=((me<<4)+De|0)>>2;a[s]=a[p];a[s+1]=a[p+1];a[s+2]=a[p+2];a[s+3]=a[p+3];var Be=me+1|0;if((Be|0)<(Nd|0)){me=Be}else{break a}}}}while(0);Wd(Ta,a[Fa],ue,Nd,ke);if(1<(e|0)){for(var Ee=za|0,Ge=za+16|0,He=za+12|0,Ie=za+28|0,te=za+68|0,Ke=za+124|0,Le=za+128|0,Me=1;;){var ye=a[i+(Me+g<<2)>>2];z=ye>>2;if(0==(a[z+43]&32|0)){var Oe=ye}else{ua=(ye|0)>>2;Oa=Ee>>2;for(Wa=ua+46;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}a[Ge>>2]=a[z+3];a[He>>2]=a[z+4];ua=(ye+68|0)>>2;Oa=Ie>>2;for(Wa=ua+10;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}ua=(ye+28|0)>>2;Oa=te>>2;for(Wa=ua+10;ua<Wa;ua++,Oa++){a[Oa]=a[ua]}m[Ke]=1;a[Le>>2]=ye;Oe=za}a:do{if(he){for(var Ve=a[le>>2],Pe=1;;){n=((Pe<<4)+Ve|0)>>2;var We=(a[ae>>2]|0)+(b[0]=a[n],b[1]=a[n+1],f[0]);f[0]=We;a[n]=b[0];a[n+1]=b[1];var Re=Pe+1|0;if((Re|0)==(ce|0)){break a}else{Pe=Re}}}}while(0);var Se=a[Dj>>2];a:do{if(ze){for(var Ze=a[le>>2],Ne=0;;){k=((Ne<<4)+Se|0)>>2;l=((Ne<<4)+Ze|0)>>2;a[k]=a[l];a[k+1]=a[l+1];a[k+2]=a[l+2];a[k+3]=a[l+3];var Te=Ne+1|0;if((Te|0)==(Nd|0)){break a}else{Ne=Te}}}}while(0);Wd(Oe,a[Oe+12>>2],Se,Nd,ke);var Ue=Me+1|0;if((Ue|0)==(e|0)){break}else{Me=Ue}}}}h=Ga}function nm(b){return(1==m[b+162|0]<<24>>24?1<(a[b+180>>2]|0)?1:1<(a[b+188>>2]|0):0)&1}function dx(c,d,i,g){var e,h,l,k,j;h=a[d+16>>2];j=((g<<5)+h|0)>>2;var m=(b[0]=a[j],b[1]=a[j+1],f[0]);k=((g<<5)+h+8|0)>>2;var p=(b[0]=a[k],b[1]=a[k+1],f[0]);l=((g<<5)+h+16|0)>>2;var s=(b[0]=a[l],b[1]=a[l+1],f[0]);h=((g<<5)+h+24|0)>>2;e=(b[0]=a[h],b[1]=a[h+1],f[0]);m==s?(e=a[i+220>>2]>>2,i=a[a[e+(11*g|0)+1]>>2],p=g+1|0,s=a[d>>2]|0,m=a[a[e+(11*p|0)+1]>>2]+40|0,p=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0])+(a[e+(11*p|0)+5]|0),d=a[d+4>>2]|0,i=i+40|0,g=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])-(a[e+(11*g|0)+4]|0),f[0]=s,a[j]=b[0],a[j+1]=b[1],f[0]=p,a[k]=b[0],a[k+1]=b[1],f[0]=d,a[l]=b[0],a[l+1]=b[1],f[0]=g,a[h]=b[0],a[h+1]=b[1],l=s,k=p,j=d):(l=m,k=p,j=s,g=e);h=c|0;f[0]=l;a[h>>2]=b[0];a[h+4>>2]=b[1];l=c+8|0;f[0]=k;a[l>>2]=b[0];a[l+4>>2]=b[1];l=c+16|0;f[0]=j;a[l>>2]=b[0];a[l+4>>2]=b[1];c=c+24|0;f[0]=g;a[c>>2]=b[0];a[c+4>>2]=b[1]}function nO(c,d,i){var g,e,j,l,k,n,z,p,s,v,t,u,w,A=h;h+=64;var B,C=A+16,y=A+32,D=A+48,F=0==m[c+124|0]<<24>>24;a:do{if(F){var E=c;w=E>>2}else{for(var G=c;;){var H=a[G+128>>2];if(0==m[H+124|0]<<24>>24){E=H;w=E>>2;break a}else{G=H}}}}while(0);var O=a[w+3];u=O>>2;var I=a[w+4],J=a[u+59]-a[I+236>>2]|0,K=-1<(J|0)?J:-J|0;if(2==(K|0)){B=2413}else{if(1==(K|0)){var L=0;h=A;return L}}if(2413==B&&0!=(m[a[u+5]+149|0]&1)<<24>>24){return L=0,h=A,L}if((a[c+16>>2]|0)==(I|0)){a[i>>2]=O;var N=I+32|0,Q=(b[0]=a[N>>2],b[1]=a[N+4>>2],f[0]),S=I+40|0,R=(b[0]=a[S>>2],b[1]=a[S+4>>2],f[0]),U=E+28|0,W=E+36|0;qf(A,Q,R,(b[0]=a[U>>2],b[1]=a[U+4>>2],f[0]),(b[0]=a[W>>2],b[1]=a[W+4>>2],f[0]));var V=A|0,ca=(b[0]=a[V>>2],b[1]=a[V+4>>2],f[0]),Y=A+8|0,Z=(b[0]=a[Y>>2],b[1]=a[Y+4>>2],f[0]),$=O+32|0,ja=(b[0]=a[$>>2],b[1]=a[$+4>>2],f[0]),aa=O+40|0,da=(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]),ea=E+68|0,ba=E+76|0;qf(C,ja,da,(b[0]=a[ea>>2],b[1]=a[ea+4>>2],f[0]),(b[0]=a[ba>>2],b[1]=a[ba+4>>2],f[0]));var fa=C|0,la=C+8|0,ha=ca,ga=Z,ka=(b[0]=a[fa>>2],b[1]=a[fa+4>>2],f[0]),sa=(b[0]=a[la>>2],b[1]=a[la+4>>2],f[0])}else{a[i>>2]=I;var ra=O+32|0,na=(b[0]=a[ra>>2],b[1]=a[ra+4>>2],f[0]),ya=O+40|0,qa=(b[0]=a[ya>>2],b[1]=a[ya+4>>2],f[0]),wa=E+68|0,oa=E+76|0;qf(y,na,qa,(b[0]=a[wa>>2],b[1]=a[wa+4>>2],f[0]),(b[0]=a[oa>>2],b[1]=a[oa+4>>2],f[0]));var Fa=y|0,Ga=(b[0]=a[Fa>>2],b[1]=a[Fa+4>>2],f[0]),va=y+8|0,ta=(b[0]=a[va>>2],b[1]=a[va+4>>2],f[0]),Ka=I+32|0,za=(b[0]=a[Ka>>2],b[1]=a[Ka+4>>2],f[0]),ma=I+40|0,pa=(b[0]=a[ma>>2],b[1]=a[ma+4>>2],f[0]),Ba=E+28|0,Ha=E+36|0;qf(D,za,pa,(b[0]=a[Ba>>2],b[1]=a[Ba+4>>2],f[0]),(b[0]=a[Ha>>2],b[1]=a[Ha+4>>2],f[0]));var Ra=D|0,Aa=D+8|0,ha=Ga,ga=ta,ka=(b[0]=a[Ra>>2],b[1]=a[Ra+4>>2],f[0]),sa=(b[0]=a[Aa>>2],b[1]=a[Aa+4>>2],f[0])}var Ea=a[w+27];if(0==(Ea|0)){var La=d+16|0,Ma=d|0;f[0]=ha;a[Ma>>2]=b[0];a[Ma+4>>2]=b[1];var Ya=d+8|0;f[0]=ga;a[Ya>>2]=b[0];a[Ya+4>>2]=b[1];t=La>>2;v=d>>2;a[t]=a[v];a[t+1]=a[v+1];a[t+2]=a[v+2];a[t+3]=a[v+3];var Qa=d+48|0,Za=d+32|0,Pa=Za|0;f[0]=ka;a[Pa>>2]=b[0];a[Pa+4>>2]=b[1];var ab=d+40|0;f[0]=sa;a[ab>>2]=b[0];a[ab+4>>2]=b[1];s=Qa>>2;p=Za>>2;a[s]=a[p];a[s+1]=a[p+1];a[s+2]=a[p+2];a[s+3]=a[p+3];L=4;h=A;return L}var $a=Ea+24|0,jb=(b[0]=a[$a>>2],b[1]=a[$a+4>>2],f[0]),Ca=Ea+32|0,Ia=(b[0]=a[Ca>>2],b[1]=a[Ca+4>>2],f[0]),eb=0==(a[a[u+5]+152>>2]&1|0),ub=eb?Ia:jb,Sa=Ea+56|0,Va=(b[0]=a[Sa>>2],b[1]=a[Sa+4>>2],f[0]),ua=Ea+64|0,Oa=(b[0]=a[ua>>2],b[1]=a[ua+4>>2],f[0]),Wa=.5*(eb?jb:Ia);if(0==(0<((sa-ga)*(Va-ha)-(Oa-ga)*(ka-ha)&-1|0)&1|0)){var pb=Va-Wa,ob=Oa+.5*ub}else{pb=Va+Wa,ob=Oa-.5*ub}var bb=d+16|0,qb=d|0;f[0]=ha;a[qb>>2]=b[0];a[qb+4>>2]=b[1];var db=d+8|0;f[0]=ga;a[db>>2]=b[0];a[db+4>>2]=b[1];z=bb>>2;n=d>>2;a[z]=a[n];a[z+1]=a[n+1];a[z+2]=a[n+2];a[z+3]=a[n+3];var kb=d+32|0,hb=d+48|0,vb=d+64|0,xb=vb|0;f[0]=pb;a[xb>>2]=b[0];a[xb+4>>2]=b[1];var ib=d+72|0;f[0]=ob;a[ib>>2]=b[0];a[ib+4>>2]=b[1];k=hb>>2;l=vb>>2;a[k]=a[l];a[k+1]=a[l+1];a[k+2]=a[l+2];a[k+3]=a[l+3];j=kb>>2;a[j]=a[l];a[j+1]=a[l+1];a[j+2]=a[l+2];a[j+3]=a[l+3];var nb=d+80|0,rb=d+96|0,lb=rb|0;f[0]=ka;a[lb>>2]=b[0];a[lb+4>>2]=b[1];var Ta=d+104|0;f[0]=sa;a[Ta>>2]=b[0];a[Ta+4>>2]=b[1];e=nb>>2;g=rb>>2;a[e]=a[g];a[e+1]=a[g+1];a[e+2]=a[g+2];a[e+3]=a[g+3];L=7;h=A;return L}function Sg(c,d,i,g,e){var h,l=i>>2,k=d>>2,j;h=a[l+5]>>2;var d=i+32|0,z=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),d=i+104|0,p=z-(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])-4,d=a[l+59],s=a[l+60],v=a[h+55],t=oO(v,d,s,g,e,-1);if(0==(t|0)){var t=0<=p,u=a[k],p=((t?p+.5:p-.5)&-1|0)<(u|0)?t?p+.5&-1:p-.5&-1:u}else{u=gx(i,t),0==(u|0)?(u=t+32|0,u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])+(a[t+244>>2]|0),t=0==m[t+162|0]<<24>>24?u+.5*(a[h+64]|0):u+(a[k+2]|0)):(t=u+68|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])+(a[k+2]|0)),p=t<p?t:p,p=(0>p?p-.5:p+.5)&-1}p|=0;if(t=1==m[i+162|0]<<24>>24){if(0==(a[l+30]|0)){j=2448}else{var w=z+10}}else{j=2448}2448==j&&(w=i+112|0,w=z+(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0])+4);g=oO(v,d,s,g,e,1);0==(g|0)?(h=0<=w,k=a[k+1],w=((h?w+.5:w-.5)&-1|0)>(k|0)?h?w+.5&-1:w-.5&-1:k):(e=gx(i,g),0==(e|0)?(e=g+32|0,j=g+104|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])-(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),k=0==m[g+162|0]<<24>>24?e-.5*(a[h+64]|0):e-(a[k+2]|0)):(h=e+52|0,k=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0])-(a[k+2]|0)),w=k>w?k:w,w=(0>w?w-.5:w+.5)&-1);w|=0;t?0==(a[l+30]|0)?l=w:(l=i+112|0,l=w-(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])):l=w;i=i+40|0;w=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);i=w-(a[(v+16>>2)+(11*d|0)]|0);d=w+(a[(v+20>>2)+(11*d|0)]|0);v=c|0;f[0]=p;a[v>>2]=b[0];a[v+4>>2]=b[1];v=c+8|0;f[0]=i;a[v>>2]=b[0];a[v+4>>2]=b[1];i=c+16|0;f[0]=l;a[i>>2]=b[0];a[i+4>>2]=b[1];c=c+24|0;f[0]=d;a[c>>2]=b[0];a[c+4>>2]=b[1]}function bi(c,d,i,g){var e,j=h;h+=64;e=d>>2;d=h;h+=32;a[d>>2]=a[e];a[d+4>>2]=a[e+1];a[d+8>>2]=a[e+2];a[d+12>>2]=a[e+3];a[d+16>>2]=a[e+4];a[d+20>>2]=a[e+5];a[d+24>>2]=a[e+6];a[d+28>>2]=a[e+7];e=j+32;if(1==(i|0)){e=d|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);var l=d+16|0,d=d+8|0;pO(j,e,g|0,(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]));g=j|0;l=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);g=j+8|0;d=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);e=j+16|0;var g=j+24|0,k=d,n=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),m=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])}else{4==(i|0)&&(l=d|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=d+24|0,d=d+16|0,pO(e,l,(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),g|0),g=e|0,l=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),g=e+8|0,d=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),g=e+16|0,e=e+24|0,k=d,n=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),m=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]))}g=c|0;f[0]=l;a[g>>2]=b[0];a[g+4>>2]=b[1];g=c+8|0;f[0]=k;a[g>>2]=b[0];a[g+4>>2]=b[1];g=c+16|0;f[0]=n;a[g>>2]=b[0];a[g+4>>2]=b[1];c=c+24|0;f[0]=m;a[c>>2]=b[0];a[c+4>>2]=b[1];h=j}function ex(b,c,d,g,f,e){var h=hx(c,-1),c=hx(c,1);0!=(h|0)&&yl(h);0!=(c|0)&&yl(c);h=ix(d,-1);d=ix(d,1);0!=(h|0)&&yl(h);0!=(d|0)&&yl(d);d=g+52|0;h=0<(a[d>>2]|0);a:do{if(h){for(c=0;;){if(bd(b,(c<<5)+g+56|0),c=c+1|0,(c|0)>=(a[d>>2]|0)){break a}}}}while(0);g=a[b+80>>2]+1|0;d=e-3+g|0;h=0<(e|0);a:do{if(h){for(c=0;;){if(bd(b,(c<<5)+Z|0),c=c+1|0,(c|0)==(e|0)){break a}}}}while(0);e=a[f+52>>2];if(0<(e|0)){for(;!(e=e-1|0,bd(b,(e<<5)+f+56|0),0>=(e|0));){}}qO(b,g,d)}function rO(c,d,i,g){var e=c+32|0;f[0]=i|0;a[e>>2]=b[0];a[e+4>>2]=b[1];e=c+104|0;f[0]=i-d|0;a[e>>2]=b[0];a[e+4>>2]=b[1];c=c+112|0;f[0]=g-i|0;a[c>>2]=b[0];a[c+4>>2]=b[1]}function hx(b,c){var d,g=a[a[b+16>>2]+184>>2],f=a[g>>2];if(0==(f|0)){var e;return 0}var h=a[a[b+12>>2]+240>>2],k=0,j=0,m=f;for(d=m>>2;;){var p=a[a[d+3]+240>>2];do{if(1>((p-h)*c|0)){f=k}else{if(0==(a[d+6]|0)){f=a[d+32];if(0==(f|0)){f=k;break}if(0==(a[f+24>>2]|0)){f=k;break}}f=0!=(k|0)&&0>=((a[a[k+12>>2]+240>>2]-p)*c|0)?k:m}}while(0);j=j+1|0;d=a[g+(j<<2)>>2];if(0==(d|0)){e=f;break}else{k=f,m=d,d=m>>2}}return e}function ix(b,c){var d,g=a[a[b+12>>2]+176>>2],f=a[g>>2];if(0==(f|0)){var e;return 0}var h=a[a[b+16>>2]+240>>2],k=0,j=0,m=f;for(d=m>>2;;){var p=a[a[d+4]+240>>2];do{if(1>((p-h)*c|0)){f=k}else{if(0==(a[d+6]|0)){f=a[d+32];if(0==(f|0)){f=k;break}if(0==(a[f+24>>2]|0)){f=k;break}}f=0!=(k|0)&&0>=((a[a[k+16>>2]+240>>2]-p)*c|0)?k:m}}while(0);j=j+1|0;d=a[g+(j<<2)>>2];if(0==(d|0)){e=f;break}else{k=f,m=d,d=m>>2}}return e}function qO(c,d,i){var g,e,h,l,k,j,m=d-1|0,p=i+1|0,s=(m|0)<(p|0);a:do{if(s){g=c+84|0;for(e=m;;){l=a[g>>2];k=((e<<5)+l|0)>>2;h=(b[0]=a[k],b[1]=a[k+1],f[0]);if(0==(e-d&1|0)){l=((e<<5)+l+16|0)>>2;var v=(b[0]=a[l],b[1]=a[l+1],f[0]);h<v||(h=.5*(h+v)&-1,f[0]=h-8|0,a[k]=b[0],a[k+1]=b[1],f[0]=h+8|0,a[l]=b[0],a[l+1]=b[1])}else{l=((e<<5)+l+16|0)>>2,v=(b[0]=a[l],b[1]=a[l+1],f[0]),h+16>v&&(h=.5*(h+v)&-1,f[0]=h-8|0,a[k]=b[0],a[k+1]=b[1],f[0]=h+8|0,a[l]=b[0],a[l+1]=b[1])}k=e+1|0;if((k|0)==(p|0)){break a}else{e=k}}}}while(0);m=c+80|0;if(0<(a[m>>2]-1|0)){c=c+84|0;for(g=0;;){k=a[c>>2];e=(g<<5)+k|0;p=g+1|0;s=(p<<5)+k|0;if((g|0)<(d|0)|(g|0)>(i|0)){j=2538}else{if(0!=(g-d&1|0)){j=2538}else{h=e|0;l=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0])+16;h=((p<<5)+k+16|0)>>2;if(l>(b[0]=a[h],b[1]=a[h+1],f[0])){f[0]=l,a[h]=b[0],a[h+1]=b[1]}h=(g<<5)+k+16|0;l=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0])-16;h=(s|0)>>2;if(l<(b[0]=a[h],b[1]=a[h+1],f[0])){f[0]=l,a[h]=b[0],a[h+1]=b[1]}}}2538==j&&(j=0,(p|0)>=(d|0)&(g|0)<(i|0)&&0==(p-d&1|0)&&(e=(e|0)>>2,h=(b[0]=a[e],b[1]=a[e+1],f[0])+16,l=(p<<5)+k+16|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),h>l&&(f[0]=l-16,a[e]=b[0],a[e+1]=b[1]),g=((g<<5)+k+16|0)>>2,k=(b[0]=a[g],b[1]=a[g+1],f[0])-16,s|=0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),k<s&&(f[0]=s+16,a[g]=b[0],a[g+1]=b[1])));if((p|0)<(a[m>>2]-1|0)){g=p}else{break}}}}function pO(c,d,i,g,e){var h=c|0;f[0]=d;a[h>>2]=b[0];a[h+4>>2]=b[1];d=c+8|0;f[0]=i;a[d>>2]=b[0];a[d+4>>2]=b[1];i=c+16|0;f[0]=g;a[i>>2]=b[0];a[i+4>>2]=b[1];c=c+24|0;f[0]=e;a[c>>2]=b[0];a[c+4>>2]=b[1]}function sO(c,d){var i=c+52|0,i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]),g=d+32|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);if(i>g){return 0}i=c+68|0;if(g>(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])){return 0}i=c+60|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);g=d+40|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);if(i>g){return 0}i=c+76|0;i=g<=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);return i&1}function tO(b,c,d,g){var f,b=b>>2,e,c=(a[b+60]|0)>(c|0);if(1!=(a[b+47]|0)){var h;return 0}var k=0==(g|0);a:do{if(!k){k=0;f=g;for(g=a[a[b+46]>>2];;){if(2<=(k|0)){break a}var j=a[g+12>>2],g=j>>2,z=a[f+12>>2];f=z>>2;if((j|0)==(z|0)){break a}if(c^(a[g+60]|0)>(a[f+60]|0)){h=1;break}if(1!=(a[g+47]|0)){break a}if(0==m[j+162|0]<<24>>24){break a}if(1!=(a[f+47]|0)){break a}if(0==m[z+162|0]<<24>>24){break a}k=k+1|0;f=a[a[f+46]>>2];g=a[a[g+46]>>2]}return h}}while(0);if(1!=(a[b+45]|0)|0==(d|0)){return 0}k=0;g=d;for(d=a[a[b+44]>>2];;){if(2<=(k|0)){h=0;e=2589;break}b=a[d+16>>2];d=b>>2;j=a[g+16>>2];g=j>>2;if((b|0)==(j|0)){h=0;e=2582;break}if(c^(a[d+60]|0)>(a[g+60]|0)){h=1;e=2584;break}if(1!=(a[d+45]|0)){h=0;e=2585;break}if(0==m[b+162|0]<<24>>24){h=0;e=2583;break}if(1!=(a[g+45]|0)){h=0;e=2586;break}if(0==m[j+162|0]<<24>>24){h=0;e=2588;break}k=k+1|0;g=a[a[g+44]>>2];d=a[a[d+44]>>2]}if(2583==e||2584==e||2582==e||2589==e||2585==e||2586==e||2588==e){return h}}function qf(c,d,i,g,e){var h=c|0;f[0]=d+g;a[h>>2]=b[0];a[h+4>>2]=b[1];c=c+8|0;f[0]=i+e;a[c>>2]=b[0];a[c+4>>2]=b[1]}function fx(c,d){var i=d+84|0,g=d+80|0,e=c,h=0;a:for(;;){e=a[e+12>>2];if(1!=m[e+162|0]<<24>>24){break}if(0!=J[a[ke+4>>2]](e)<<24>>24){break}for(var l=a[g>>2],k=e+40|0;;){if((h|0)>=(l|0)){break a}var j=a[i>>2],z=(h<<5)+j+8|0,p=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]),z=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);if(p>z){h=h+1|0}else{break}}l=(h<<5)+j+24|0;if((b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])>=z){var l=0==(a[e+120>>2]|0),k=(h<<5)+j|0,p=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),k=p&-1,s=(h<<5)+j+16|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]);l?rO(e,k,.5*(p+s)&-1,s&-1):(l=e+112|0,rO(e,k,s&-1,s+(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])&-1))}e=a[a[e+184>>2]>>2]}}function oO(b,c,d,g,f,e){for(var h,k=b+44*c|0,b=b+44*c+4|0,c=d;;){c=c+e|0;if(-1>=(c|0)){var j=0;h=2613;break}if((c|0)>=(a[k>>2]|0)){j=0;h=2617;break}var z=a[a[b>>2]+(c<<2)>>2],p=m[z+162|0];if(1==p<<24>>24){if(0!=(a[z+120>>2]|0)){j=z;h=2614;break}}else{if(0==p<<24>>24){j=z;h=2615;break}}if(0==tO(z,d,g,f)<<24>>24){j=z;h=2616;break}}if(2615==h||2617==h||2616==h||2614==h||2613==h){return j}}function gx(b,c){if(0==m[b+162|0]<<24>>24){var d=a[b+216>>2],g=d}else{d=a[a[a[b+184>>2]>>2]+128>>2],g=a[a[d+12>>2]+216>>2],d=a[a[d+16>>2]+216>>2]}if(0==m[c+162|0]<<24>>24){var f=a[c+216>>2];return 0==(f|0)|(f|0)==(d|0)|(f|0)==(g|0)?0:f}var f=a[a[a[c+184>>2]>>2]+128>>2],e=a[a[f+16>>2]+216>>2];if(!(0==(e|0)|(e|0)==(d|0)|(e|0)==(g|0))&&0!=(sO(e,c)|0)){return e}f=a[a[f+12>>2]+216>>2];return 0==(f|0)|(f|0)==(d|0)|(f|0)==(g|0)?0:0==(sO(f,c)|0)?0:f}function kO(c,d,i,g,e,j){var l,k,n,z,p,s,v,t,u,w,A,B,C,y,D,F,E,G,I,O,H,J,K,L,N,S,Q=h;h+=176;var R,U=Q+16,W=Q+32,V=Q+96,ca=Q+112,Y=Q+128,Z=Q+144,$=Q+160,ja=a[e+20>>2];do{if(0<(i|0)){for(var aa=0,da=0,ea=0;;){var ba=a[c+(ea+d<<2)>>2],fa=(0!=(a[ba+108>>2]|0)&1)+aa|0;if(0==m[ba+56|0]<<24>>24){if(0==m[ba+96|0]<<24>>24){var ka=da}else{R=2633}}else{R=2633}2633==R&&(R=0,ka=1);var ha=ea+1|0;if((ha|0)==(i|0)){break}else{aa=fa,da=ka,ea=ha}}if(0==(ka|0)){if(0==(fa|0)){break}uO(e,g,c,d,i,j,fa);h=Q;return}var ga=vO(ja),la=oo(ga,wO|0);yd(la|0,nq|0,jx|0);var sa=g+32|0,ra=(b[0]=a[sa>>2],b[1]=a[sa+4>>2],f[0])&-1,na=e+32|0,ya=(b[0]=a[na>>2],b[1]=a[na+4>>2],f[0])&-1;S=(ja+152|0)>>2;for(var qa=0==(a[S]&1|0),wa=qa?g:e,oa=qa?e:g,Fa=xO(la,oa),Ga=xO(ga,wa),va=0,ta=0;;){for(var Ka=(va+d<<2)+c|0;;){var za=a[Ka>>2];if(0==m[za+124|0]<<24>>24){break}else{Ka=za+128|0}}var ma;if((a[za+16>>2]|0)==(oa|0)){var pa=za,Ba=uh(ga,Fa,Ga);po(pa|0,Ba|0);ma=Ba}else{var Ha=za,Ra=uh(ga,Ga,Fa);po(Ha|0,Ra|0);ma=Ra}var Ea=ma;a[za+132>>2]=Ea|0;if(0==(ta|0)){if(0!=m[za+56|0]<<24>>24){var Aa=0}else{0!=m[za+96|0]<<24>>24?Aa=0:(a[Ea+132>>2]=za|0,Aa=Ea)}}else{Aa=ta}var La=va+1|0;if((La|0)==(i|0)){break}else{va=La,ta=Aa}}var Ma=0==(Aa|0)?uh(ga,Fa,Ga):Aa;qc(Ma|0,a[a[Kg>>2]+8>>2],yO|0);a[ga+172>>2]=a[ja+172>>2];var Ya=ga;JF(Ya,j);XN(ga);kx(ga,0);lx(Ya,0);zO(Ya,0);N=(oa+32|0)>>2;var Qa=Fa+32|0;L=Qa>>2;K=(Ga+32|0)>>2;var Za=a[ga+216>>2],Pa=0==(Za|0);a:do{if(!Pa){for(var ab=.5*((b[0]=a[K],b[1]=a[K+1],f[0])+(b[0]=a[L],b[1]=a[L+1],f[0]))&-1,$a=oa+112|0,jb=wa+32|0,Ca=(b[0]=a[$a>>2],b[1]=a[$a+4>>2],f[0]),Ia=(b[0]=a[N],b[1]=a[N+1],f[0]),eb=wa+104|0,ub=ra|0,Sa=ab|0,Va=ya|0,ua=.5*((b[0]=a[jb>>2],b[1]=a[jb+4>>2],f[0])+(Ia-Ca)+(b[0]=a[eb>>2],b[1]=a[eb+4>>2],f[0]))&-1|0,Oa=Fa+40|0,Wa=Ga+40|0,pb=Za;;){if((pb|0)==(Fa|0)){f[0]=ub,a[Oa>>2]=b[0],a[Oa+4>>2]=b[1],f[0]=Sa,a[L]=b[0],a[L+1]=b[1]}else{if((pb|0)==(Ga|0)){f[0]=Va,a[Wa>>2]=b[0],a[Wa+4>>2]=b[1],f[0]=Sa,a[K]=b[0],a[K+1]=b[1]}else{var ob=pb+40|0;f[0]=ua;a[ob>>2]=b[0];a[ob+4>>2]=b[1]}}var bb=a[pb+168>>2];if(0==(bb|0)){break a}else{pb=bb}}}}while(0);mx(ga);bx(ga,0);Bt(Ya,1);var qb=0==(a[S]&1|0),db=(b[0]=a[N],b[1]=a[N+1],f[0]);if(qb){var kb=oa+40|0,ib=Fa+40|0,vb=Qa,xb=(b[0]=a[kb>>2],b[1]=a[kb+4>>2],f[0])-(b[0]=a[ib>>2],b[1]=a[ib+4>>2],f[0])}else{var hb=oa+40|0,vb=Fa+40|0,xb=(b[0]=a[hb>>2],b[1]=a[hb+4>>2],f[0])+(b[0]=a[L],b[1]=a[L+1],f[0])}var nb=db-(b[0]=a[vb>>2],b[1]=a[vb+4>>2],f[0]);J=Q>>2;H=U>>2;O=V>>2;I=W>>2;var rb=W|0;G=ca>>2;E=(W+16|0)>>2;F=Y>>2;D=(W+32|0)>>2;y=(W+48|0)>>2;C=Z>>2;var lb=ja+52|0;B=$>>2;for(var Ta=ja,cb=0;;){for(var fb=(cb+d<<2)+c|0;;){var Ua=a[fb>>2];if(0==m[Ua+124|0]<<24>>24){break}else{fb=Ua+128|0}}var sb=a[Ua+132>>2];A=sb>>2;do{if(!((sb|0)==(Ma|0)&0==(a[A+33]|0))){var Na=a[a[A+6]>>2];w=(Na+4|0)>>2;var Fb=Au(Ua,a[w]);a[Fb+8>>2]=a[Na+8>>2];var Db=a[S]&1,wb=Na+16|0,Eb=Na+24|0;ci(Q,(b[0]=a[wb>>2],b[1]=a[wb+4>>2],f[0]),(b[0]=a[Eb>>2],b[1]=a[Eb+4>>2],f[0]),nb,xb,Db);u=(Fb+16|0)>>2;a[u]=a[J];a[u+1]=a[J+1];a[u+2]=a[J+2];a[u+3]=a[J+3];a[Fb+12>>2]=a[Na+12>>2];var Cb=a[S]&1,Bb=Na+32|0,Ja=Na+40|0;ci(U,(b[0]=a[Bb>>2],b[1]=a[Bb+4>>2],f[0]),(b[0]=a[Ja>>2],b[1]=a[Ja+4>>2],f[0]),nb,xb,Cb);t=(Fb+32|0)>>2;a[t]=a[H];a[t+1]=a[H+1];a[t+2]=a[H+2];a[t+3]=a[H+3];v=(Fb|0)>>2;s=(Na|0)>>2;for(var mb=0;(mb|0)<(a[w]|0);){var yb=(mb<<4)+a[v]|0,Gb=a[s],Hb=a[S]&1,Jb=(mb<<4)+Gb|0,Kb=(mb<<4)+Gb+8|0;ci(V,(b[0]=a[Jb>>2],b[1]=a[Jb+4>>2],f[0]),(b[0]=a[Kb>>2],b[1]=a[Kb+4>>2],f[0]),nb,xb,Hb);p=yb>>2;a[p]=a[O];a[p+1]=a[O+1];a[p+2]=a[O+2];a[p+3]=a[O+3];a[I]=a[O];a[I+1]=a[O+1];a[I+2]=a[O+2];a[I+3]=a[O+3];var Ib=mb+1|0;if((Ib|0)>=(a[w]|0)){break}var Mb=(Ib<<4)+a[v]|0,Lb=a[s],Nb=a[S]&1,Pb=(Ib<<4)+Lb|0,Tb=(Ib<<4)+Lb+8|0;ci(ca,(b[0]=a[Pb>>2],b[1]=a[Pb+4>>2],f[0]),(b[0]=a[Tb>>2],b[1]=a[Tb+4>>2],f[0]),nb,xb,Nb);z=Mb>>2;a[z]=a[G];a[z+1]=a[G+1];a[z+2]=a[G+2];a[z+3]=a[G+3];a[E]=a[G];a[E+1]=a[G+1];a[E+2]=a[G+2];a[E+3]=a[G+3];var Sb=mb+2|0,Wb=(Sb<<4)+a[v]|0,Vb=a[s],Yb=a[S]&1,Xb=(Sb<<4)+Vb|0,$b=(Sb<<4)+Vb+8|0;ci(Y,(b[0]=a[Xb>>2],b[1]=a[Xb+4>>2],f[0]),(b[0]=a[$b>>2],b[1]=a[$b+4>>2],f[0]),nb,xb,Yb);n=Wb>>2;a[n]=a[F];a[n+1]=a[F+1];a[n+2]=a[F+2];a[n+3]=a[F+3];a[D]=a[F];a[D+1]=a[F+1];a[D+2]=a[F+2];a[D+3]=a[F+3];var Zb=mb+3|0,ac=a[s],dc=a[S]&1,bc=(Zb<<4)+ac|0,ec=(Zb<<4)+ac+8|0;ci(Z,(b[0]=a[bc>>2],b[1]=a[bc+4>>2],f[0]),(b[0]=a[ec>>2],b[1]=a[ec+4>>2],f[0]),nb,xb,dc);a[y]=a[C];a[y+1]=a[C+1];a[y+2]=a[C+2];a[y+3]=a[C+3];xk(lb,rb);mb=Zb}k=(Ua+108|0)>>2;var fc=a[k];if(0!=(fc|0)){var gc=a[A+27],jc=a[S]&1,kc=gc+56|0,mc=gc+64|0;ci($,(b[0]=a[kc>>2],b[1]=a[kc+4>>2],f[0]),(b[0]=a[mc>>2],b[1]=a[mc+4>>2],f[0]),nb,xb,jc);l=(fc+56|0)>>2;a[l]=a[B];a[l+1]=a[B+1];a[l+2]=a[B+2];a[l+3]=a[B+3];m[a[k]+81|0]=1;al(Ta,a[k])}}}while(0);var nc=cb+1|0;if((nc|0)==(i|0)){break}else{cb=nc}}var Qb=ga;a[dj>>2]=a[nx>>2];a[di>>2]=a[ox>>2];a[Ej>>2]=a[px>>2];a[Kg>>2]=a[qx>>2];a[Hh>>2]=a[rx>>2];a[Gh>>2]=a[sx>>2];a[Ah>>2]=a[tx>>2];ax(Qb);Sf(Qb);h=Q;return}}while(0);cx(e,g,c,d,i,j);h=Q}function lO(c,d,i,g){var e,j,l,k,n,z,p,s,v,t,u=h;h+=1540;for(var w=u+696,A=u+1392,B=u+1396,C=u+1508,y=u+1524,D=a[i+16>>2],F=i+12|0,E=a[F>>2],G=a[D+20>>2],I=a[i+180>>2];;){var O=a[I+180>>2];if(0==(O|0)){break}else{I=O}}var H=a[I+16>>2];t=(i+108|0)>>2;var J=H+32|0;v=(a[t]+56|0)>>2;s=J>>2;a[v]=a[s];a[v+1]=a[s+1];a[v+2]=a[s+2];a[v+3]=a[s+3];m[a[t]+81|0]=1;do{if(2==(g|0)){var K=D+32|0,L=(b[0]=a[K>>2],b[1]=a[K+4>>2],f[0]),N=D+40|0,Q=(b[0]=a[N>>2],b[1]=a[N+4>>2],f[0]),S=i+28|0,R=i+36|0;qf(C,L,Q,(b[0]=a[S>>2],b[1]=a[S+4>>2],f[0]),(b[0]=a[R>>2],b[1]=a[R+4>>2],f[0]));var U=C|0,W=(b[0]=a[U>>2],b[1]=a[U+4>>2],f[0]),V=C+8|0,ca=(b[0]=a[V>>2],b[1]=a[V+4>>2],f[0]),Y=E+32|0,$=(b[0]=a[Y>>2],b[1]=a[Y+4>>2],f[0]),ba=E+40|0,ja=(b[0]=a[ba>>2],b[1]=a[ba+4>>2],f[0]),aa=i+68|0,da=i+76|0;qf(y,$,ja,(b[0]=a[aa>>2],b[1]=a[aa+4>>2],f[0]),(b[0]=a[da>>2],b[1]=a[da+4>>2],f[0]));var ea=y|0,fa=(b[0]=a[ea>>2],b[1]=a[ea+4>>2],f[0]),ka=y+8|0,la=(b[0]=a[ka>>2],b[1]=a[ka+4>>2],f[0]),ha=a[t],ga=ha+56|0,sa=(b[0]=a[ga>>2],b[1]=a[ga+4>>2],f[0]),ra=ha+64|0,na=ha+32|0,qa=(b[0]=a[ra>>2],b[1]=a[ra+4>>2],f[0])-.5*(b[0]=a[na>>2],b[1]=a[na+4>>2],f[0]),ya=B+16|0,oa=B|0,wa=B|0;f[0]=W;a[wa>>2]=b[0];a[wa+4>>2]=b[1];var va=B+8|0;f[0]=ca;a[va>>2]=b[0];a[va+4>>2]=b[1];p=ya>>2;z=B>>2;a[p]=a[z];a[p+1]=a[z+1];a[p+2]=a[z+2];a[p+3]=a[z+3];var Fa=B+32|0,Ga=B+48|0,Aa=B+64|0,ta=Aa|0;f[0]=sa;a[ta>>2]=b[0];a[ta+4>>2]=b[1];var Ka=B+72|0;f[0]=qa;a[Ka>>2]=b[0];a[Ka+4>>2]=b[1];n=Ga>>2;k=Aa>>2;a[n]=a[k];a[n+1]=a[k+1];a[n+2]=a[k+2];a[n+3]=a[k+3];l=Fa>>2;a[l]=a[k];a[l+1]=a[k+1];a[l+2]=a[k+2];a[l+3]=a[k+3];var za=B+80|0,ma=B+96|0,pa=ma|0;f[0]=fa;a[pa>>2]=b[0];a[pa+4>>2]=b[1];var Ea=B+104|0;f[0]=la;a[Ea>>2]=b[0];a[Ea+4>>2]=b[1];j=za>>2;e=ma>>2;a[j]=a[e];a[j+1]=a[e+1];a[j+2]=a[e+2];a[j+3]=a[e+3];a[A>>2]=7;var Ha=oa,Ra=7}else{var Ba=J|0,Ma=(b[0]=a[Ba>>2],b[1]=a[Ba+4>>2],f[0]),La=H+104|0,Qa=Ma-(b[0]=a[La>>2],b[1]=a[La+4>>2],f[0]),Ya=H+112|0,Pa=Ma+(b[0]=a[Ya>>2],b[1]=a[Ya+4>>2],f[0]),Za=H+40|0,Va=(b[0]=a[Za>>2],b[1]=a[Za+4>>2],f[0]),ab=H+96|0,$a=Va+.5*(b[0]=a[ab>>2],b[1]=a[ab+4>>2],f[0]),jb=a[D+236>>2],Ca=a[G+220>>2],Ia=D+40|0,eb=(Va-(a[(Ca+16>>2)+(11*jb|0)]|0)-(b[0]=a[Ia>>2],b[1]=a[Ia+4>>2],f[0])+a[(Ca+20>>2)+(11*jb|0)]&-1|0)/6&-1,ub=$a-(5>(eb|0)?5:eb|0);mm(c,d,D,i,u,1);mm(c,d,E,i,w,0);var Sa=u+52|0,db=a[Sa>>2],ua=db-1|0,Oa=(ua<<5)+u+56|0,Wa=(b[0]=a[Oa>>2],b[1]=a[Oa+4>>2],f[0]);f[0]=Wa;a[Z>>2]=b[0];a[Z+4>>2]=b[1];var pb=(ua<<5)+u+80|0,ob=(b[0]=a[pb>>2],b[1]=a[pb+4>>2],f[0]);f[0]=ob;a[Z+8>>2]=b[0];a[Z+12>>2]=b[1];f[0]=Qa;a[Z+16>>2]=b[0];a[Z+20>>2]=b[1];f[0]=ub;a[Z+24>>2]=b[0];a[Z+28>>2]=b[1];f[0]=Wa;a[Z+32>>2]=b[0];a[Z+36>>2]=b[1];f[0]=ub;a[Z+40>>2]=b[0];a[Z+44>>2]=b[1];var bb=w+52|0,qb=a[bb>>2]-1|0,ib=(qb<<5)+w+72|0,kb=(b[0]=a[ib>>2],b[1]=a[ib+4>>2],f[0]);f[0]=kb;a[Z+48>>2]=b[0];a[Z+52>>2]=b[1];f[0]=$a;a[Z+56>>2]=b[0];a[Z+60>>2]=b[1];f[0]=Pa;a[Z+64>>2]=b[0];a[Z+68>>2]=b[1];f[0]=ub;a[Z+88>>2]=b[0];a[Z+92>>2]=b[1];var hb=(qb<<5)+w+80|0,vb=(b[0]=a[hb>>2],b[1]=a[hb+4>>2],f[0]);f[0]=vb;a[Z+72>>2]=b[0];a[Z+76>>2]=b[1];f[0]=kb;a[Z+80>>2]=b[0];a[Z+84>>2]=b[1];var xb=0<(db|0);a:do{if(xb){for(var mb=0;;){bd(d,(mb<<5)+u+56|0);var nb=mb+1|0;if((nb|0)<(a[Sa>>2]|0)){mb=nb}else{break a}}}}while(0);bd(d,Z|0);bd(d,Z+32|0);bd(d,Z+64|0);var rb=a[bb>>2],lb=0<(rb|0);a:do{if(lb){for(var Ta=rb;;){var cb=Ta-1|0;bd(d,(cb<<5)+w+56|0);if(0<(cb|0)){Ta=cb}else{break a}}}}while(0);var fb=8==(g|0)?ff(d,A,0):ff(d,A,1),Ua=a[A>>2];if(0!=(Ua|0)){Ha=fb,Ra=Ua}else{h=u;return}}}while(0);Wd(i,a[F>>2],Ha,Ra,ke);h=u}function cx(c,d,i,g,e,j){var l,k,n,m,p,s,v,t,u,w,A,B,C,y,D=h;h+=320;var F=D+160,E=D+176,G=D+192,I=D+208,O=D+224,H=D+240,J=D+256,K=D+272,L=D+288,N=D+304,Q=a[i+(g<<2)>>2],S=c+32|0,S=(b[0]=a[S>>2],b[1]=a[S+4>>2],f[0]);m=c+40|0;m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]);p=Q+28|0;s=Q+36|0;qf(F,S,m,(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]));S=F|0;S=(b[0]=a[S>>2],b[1]=a[S+4>>2],f[0]);F=F+8|0;F=(b[0]=a[F>>2],b[1]=a[F+4>>2],f[0]);m=d+32|0;m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]);d=d+40|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);p=Q+68|0;Q=Q+76|0;qf(E,m,d,(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),(b[0]=a[Q>>2],b[1]=a[Q+4>>2],f[0]));Q=E|0;Q=(b[0]=a[Q>>2],b[1]=a[Q+4>>2],f[0]);E=E+8|0;E=(b[0]=a[E>>2],b[1]=a[E+4>>2],f[0]);if(1<(e|0)){var c=c+96|0,d=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),c=d/(e-1|0),R=.5*d}else{if(0<(e|0)){R=c=0}else{h=D;return}}var U=D|0,W=D+8|0;l=D+16|0;var V=l|0,Y=D+24|0,Z=(2*S+Q)/3;y=(D+32|0)>>2;C=O>>2;B=(D+48|0)>>2;A=H>>2;w=(D+64|0)>>2;u=J>>2;var $=(2*Q+S)/3;t=(D+80|0)>>2;v=K>>2;s=(D+96|0)>>2;p=L>>2;m=(D+112|0)>>2;var d=N>>2,ba=D+128|0,ja=D+136|0,aa=D+144|0,da=D+152|0,ea=D|0;n=l>>2;k=G>>2;l=I>>2;for(var fa=D+48|0,ka=D+56|0,la=0,R=F-R;;){var ha=a[i+(la+g<<2)>>2];f[0]=S;a[U>>2]=b[0];a[U+4>>2]=b[1];f[0]=F;a[W>>2]=b[0];a[W+4>>2]=b[1];if(8==(j|0)||2==(j|0)){Tg(G,Z,R);a[n]=a[k];a[n+1]=a[k+1];a[n+2]=a[k+2];a[n+3]=a[k+3];Tg(I,$,R);a[y]=a[l];a[y+1]=a[l+1];a[y+2]=a[l+2];a[y+3]=a[l+3];f[0]=Q;a[fa>>2]=b[0];a[fa+4>>2]=b[1];f[0]=E;a[ka>>2]=b[0];a[ka+4>>2]=b[1];var ga=4}else{f[0]=S,a[V>>2]=b[0],a[V+4>>2]=b[1],f[0]=F,a[Y>>2]=b[0],a[Y+4>>2]=b[1],Tg(O,Z,R),a[y]=a[C],a[y+1]=a[C+1],a[y+2]=a[C+2],a[y+3]=a[C+3],Tg(H,Z,R),a[B]=a[A],a[B+1]=a[A+1],a[B+2]=a[A+2],a[B+3]=a[A+3],Tg(J,Z,R),a[w]=a[u],a[w+1]=a[u+1],a[w+2]=a[u+2],a[w+3]=a[u+3],Tg(K,$,R),a[t]=a[v],a[t+1]=a[v+1],a[t+2]=a[v+2],a[t+3]=a[v+3],Tg(L,$,R),a[s]=a[p],a[s+1]=a[p+1],a[s+2]=a[p+2],a[s+3]=a[p+3],Tg(N,$,R),a[m]=a[d],a[m+1]=a[d+1],a[m+2]=a[d+2],a[m+3]=a[d+3],f[0]=Q,a[ba>>2]=b[0],a[ba+4>>2]=b[1],f[0]=E,a[ja>>2]=b[0],a[ja+4>>2]=b[1],f[0]=Q,a[aa>>2]=b[0],a[aa+4>>2]=b[1],f[0]=E,a[da>>2]=b[0],a[da+4>>2]=b[1],ga=10}Wd(ha,a[ha+12>>2],ea,ga,ke);la=la+1|0;if((la|0)==(e|0)){break}else{R+=c}}h=D}function Tg(c,d,i){var g=c|0;f[0]=d;a[g>>2]=b[0];a[g+4>>2]=b[1];c=c+8|0;f[0]=i;a[c>>2]=b[0];a[c+4>>2]=b[1]}function mO(c,d,i,g,e,j,l){var k,n=h;h+=1396;var m,p=n+4,s=n+700,v=a[j+16>>2],t=a[j+12>>2];k=a[v+20>>2];var u=a[v+236>>2];if((u|0)<(D[k+246>>1]<<16>>16|0)){k=a[k+220>>2]>>2;var w=u+1|0,A=v+40|0,B=a[a[k+(11*w|0)+1]>>2]+40|0;k=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])-(a[k+(11*u|0)+6]|0)-((b[0]=a[B>>2],b[1]=a[B+4>>2],f[0])+(a[k+(11*w|0)+7]|0))}else{k=a[k+260>>2]|0}w=e+1|0;u=(a[c+12>>2]|0)/w;k/=w;ux(c,d,v,j,p,1);ux(c,d,t,j,s,0);c=p+52|0;j=s+52|0;l=0==(l|0);v=d+80|0;for(w=0;;){if((w|0)>=(e|0)){m=2738;break}var t=a[i+(w+g<<2)>>2],A=a[c>>2],B=A-1|0,C=(B<<5)+p+56|0,C=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),y=(B<<5)+p+64|0,y=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),B=(B<<5)+p+72|0,F=(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0]);f[0]=C;a[Z>>2]=b[0];a[Z+4>>2]=b[1];f[0]=y;a[Z+24>>2]=b[0];a[Z+28>>2]=b[1];var w=w+1|0,E=w|0,B=E*u;f[0]=F+B;a[Z+16>>2]=b[0];a[Z+20>>2]=b[1];y-=E*k;f[0]=y;a[Z+8>>2]=b[0];a[Z+12>>2]=b[1];f[0]=C;a[Z+32>>2]=b[0];a[Z+36>>2]=b[1];f[0]=y;a[Z+56>>2]=b[0];a[Z+60>>2]=b[1];F=a[j>>2]-1|0;C=(F<<5)+s+72|0;C=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]);f[0]=C;a[Z+48>>2]=b[0];a[Z+52>>2]=b[1];f[0]=y-k;a[Z+40>>2]=b[0];a[Z+44>>2]=b[1];E=(F<<5)+s+56|0;E=(b[0]=a[E>>2],b[1]=a[E+4>>2],f[0]);F=(F<<5)+s+64|0;F=(b[0]=a[F>>2],b[1]=a[F+4>>2],f[0]);f[0]=C;a[Z+80>>2]=b[0];a[Z+84>>2]=b[1];f[0]=F;a[Z+88>>2]=b[0];a[Z+92>>2]=b[1];f[0]=E-B;a[Z+64>>2]=b[0];a[Z+68>>2]=b[1];f[0]=y;a[Z+72>>2]=b[0];a[Z+76>>2]=b[1];A=0<(A|0);a:do{if(A){for(B=0;;){if(bd(d,(B<<5)+p+56|0),B=B+1|0,(B|0)>=(a[c>>2]|0)){break a}}}}while(0);bd(d,Z|0);bd(d,Z+32|0);bd(d,Z+64|0);A=a[j>>2];B=0<(A|0);a:do{if(B){for(C=A;;){if(C=C-1|0,bd(d,(C<<5)+s+56|0),0>=(C|0)){break a}}}}while(0);A=l?ff(d,n,1):ff(d,n,0);B=a[n>>2];if(0==(B|0)){m=2739;break}Wd(t,a[t+12>>2],A,B,ke);a[v>>2]=0}2738==m?h=n:2739==m&&(h=n)}function mm(c,d,i,g,e,j){var l,k=h;h+=96;l=k+32;var n=k+64,m=a[i+20>>2];Sg(l,c,i,0,g);c=e>>2;l>>=2;a[c]=a[l];a[c+1]=a[l+1];a[c+2]=a[l+2];a[c+3]=a[l+3];a[c+4]=a[l+4];a[c+5]=a[l+5];a[c+6]=a[l+6];a[c+7]=a[l+7];c=k>>2;a[c]=a[l];a[c+1]=a[l+1];a[c+2]=a[l+2];a[c+3]=a[l+3];a[c+4]=a[l+4];a[c+5]=a[l+5];a[c+6]=a[l+6];a[c+7]=a[l+7];a[e+48>>2]=4;0==j<<24>>24?xl(d,g,2,e,0):vl(d,g,2,e,0);d=(e+52|0)>>2;j=a[d]-1|0;g=(j<<5)+e+80|0;l=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);g=(k+24|0)>>2;f[0]=l;a[g]=b[0];a[g+1]=b[1];j=(j<<5)+e+64|0;l=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);j=(k+8|0)>>2;f[0]=l;a[j]=b[0];a[j+1]=b[1];l=i+40|0;bi(n,k,4,(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])+a[(a[m+220>>2]+20>>2)+(11*a[i+236>>2]|0)]&-1);i=n>>2;a[c]=a[i];a[c+1]=a[i+1];a[c+2]=a[i+2];a[c+3]=a[i+3];a[c+4]=a[i+4];a[c+5]=a[i+5];a[c+6]=a[i+6];a[c+7]=a[i+7];i=k|0;n=k+16|0;if((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])){if((b[0]=a[j],b[1]=a[j+1],f[0])<(b[0]=a[g],b[1]=a[g+1],f[0])){i=a[d],a[d]=i+1|0,e=((i<<5)+e+56|0)>>2,a[e]=a[c],a[e+1]=a[c+1],a[e+2]=a[c+2],a[e+3]=a[c+3],a[e+4]=a[c+4],a[e+5]=a[c+5],a[e+6]=a[c+6],a[e+7]=a[c+7]}}h=k}function ux(c,d,i,g,e,j){var l,k=h;h+=96;l=k+32;var n=k+64,m=a[i+20>>2];Sg(l,c,i,0,g);c=e>>2;l>>=2;a[c]=a[l];a[c+1]=a[l+1];a[c+2]=a[l+2];a[c+3]=a[l+3];a[c+4]=a[l+4];a[c+5]=a[l+5];a[c+6]=a[l+6];a[c+7]=a[l+7];c=k>>2;a[c]=a[l];a[c+1]=a[l+1];a[c+2]=a[l+2];a[c+3]=a[l+3];a[c+4]=a[l+4];a[c+5]=a[l+5];a[c+6]=a[l+6];a[c+7]=a[l+7];a[e+48>>2]=1;0==j<<24>>24?xl(d,g,2,e,0):vl(d,g,2,e,0);d=(e+52|0)>>2;j=a[d]-1|0;g=(j<<5)+e+80|0;l=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);g=(k+24|0)>>2;f[0]=l;a[g]=b[0];a[g+1]=b[1];j=(j<<5)+e+64|0;l=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);j=(k+8|0)>>2;f[0]=l;a[j]=b[0];a[j+1]=b[1];l=i+40|0;bi(n,k,1,(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])-a[(a[m+220>>2]+20>>2)+(11*a[i+236>>2]|0)]&-1);i=n>>2;a[c]=a[i];a[c+1]=a[i+1];a[c+2]=a[i+2];a[c+3]=a[i+3];a[c+4]=a[i+4];a[c+5]=a[i+5];a[c+6]=a[i+6];a[c+7]=a[i+7];i=k|0;n=k+16|0;if((b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])<(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])){if((b[0]=a[j],b[1]=a[j+1],f[0])<(b[0]=a[g],b[1]=a[g+1],f[0])){i=a[d],a[d]=i+1|0,e=((i<<5)+e+56|0)>>2,a[e]=a[c],a[e+1]=a[c+1],a[e+2]=a[c+2],a[e+3]=a[c+3],a[e+4]=a[c+4],a[e+5]=a[c+5],a[e+6]=a[c+6],a[e+7]=a[c+7]}}h=k}function uO(c,d,i,g,e,j,l){var k,n,z,p,s,v,t,u,w,A,B,C,y,D,F,E,M,I,O=h;h+=196;var H,J=O+4,K=O+164,L=O+180,N=a[i+(g<<2)>>2],Q=fa(e<<2),S=0<(e|0);a:do{if(S){for(var R=0;;){a[Q+(R<<2)>>2]=a[i+(R+g<<2)>>2];var U=R+1|0;if((U|0)==(e|0)){break a}else{R=U}}}}while(0);ch(Q,e,364);var W=c+32|0,V=(b[0]=a[W>>2],b[1]=a[W+4>>2],f[0]),Y=c+40|0,Z=(b[0]=a[Y>>2],b[1]=a[Y+4>>2],f[0]),$=N+28|0,ba=N+36|0;qf(K,V,Z,(b[0]=a[$>>2],b[1]=a[$+4>>2],f[0]),(b[0]=a[ba>>2],b[1]=a[ba+4>>2],f[0]));var ja=K|0,aa=(b[0]=a[ja>>2],b[1]=a[ja+4>>2],f[0]),da=K+8|0,ea=(b[0]=a[da>>2],b[1]=a[da+4>>2],f[0]),ka=d+32|0,la=(b[0]=a[ka>>2],b[1]=a[ka+4>>2],f[0]),sa=d+40|0,ha=(b[0]=a[sa>>2],b[1]=a[sa+4>>2],f[0]),ga=N+68|0,ra=N+76|0;qf(L,la,ha,(b[0]=a[ga>>2],b[1]=a[ga+4>>2],f[0]),(b[0]=a[ra>>2],b[1]=a[ra+4>>2],f[0]));var na=L|0,qa=(b[0]=a[na>>2],b[1]=a[na+4>>2],f[0]),oa=L+8|0,ya=(b[0]=a[oa>>2],b[1]=a[oa+4>>2],f[0]),va=c+112|0,wa=aa+(b[0]=a[va>>2],b[1]=a[va+4>>2],f[0]),Aa=d+104|0,Fa=qa-(b[0]=a[Aa>>2],b[1]=a[Aa+4>>2],f[0]),Ga=.5*(wa+Fa);I=(J|0)>>2;f[0]=aa;a[I]=b[0];a[I+1]=b[1];M=(J+8|0)>>2;f[0]=ea;a[M]=b[0];a[M+1]=b[1];E=(J+16|0)>>2;f[0]=aa;a[E]=b[0];a[E+1]=b[1];F=(J+24|0)>>2;f[0]=ea;a[F]=b[0];a[F+1]=b[1];D=(J+32|0)>>2;f[0]=qa;a[D]=b[0];a[D+1]=b[1];y=(J+40|0)>>2;f[0]=ya;a[y]=b[0];a[y+1]=b[1];C=(J+48|0)>>2;f[0]=qa;a[C]=b[0];a[C+1]=b[1];B=(J+56|0)>>2;f[0]=ya;a[B]=b[0];a[B+1]=b[1];var Ea=J|0;Wd(N,a[N+12>>2],Ea,4,ke);A=(N+108|0)>>2;var ta=a[A]+56|0;f[0]=Ga;a[ta>>2]=b[0];a[ta+4>>2]=b[1];var Ka=a[A],za=Ka+32|0,ma=ea+.5*((b[0]=a[za>>2],b[1]=a[za+4>>2],f[0])+6),pa=Ka+64|0;f[0]=ma;a[pa>>2]=b[0];a[pa+4>>2]=b[1];m[a[A]+81|0]=1;var Ba=ea+3,Ha=a[A],Ra=Ha+32|0,Ma=Ba+(b[0]=a[Ra>>2],b[1]=a[Ra+4>>2],f[0]),Qa=Ha+24|0,La=.5*(b[0]=a[Qa>>2],b[1]=a[Qa+4>>2],f[0]),Pa=Ga-La,Ya=Ga+La;w=(J+64|0)>>2;u=(J+72|0)>>2;t=(J+80|0)>>2;v=(J+88|0)>>2;s=(J+96|0)>>2;p=(J+104|0)>>2;z=(J+112|0)>>2;n=(J+120|0)>>2;for(var Va=4==(j|0)&1,Za=Ma,db=Ba,ab=1;;){var $a,jb;if((ab|0)>=(l|0)){break}var Ca=a[i+(ab+g<<2)>>2];if(0==(ab&1|0)){f[0]=aa;a[I]=b[0];a[I+1]=b[1];f[0]=ea;a[M]=b[0];a[M+1]=b[1];f[0]=Pa;a[E]=b[0];a[E+1]=b[1];f[0]=ea;a[F]=b[0];a[F+1]=b[1];f[0]=Pa;a[D]=b[0];a[D+1]=b[1];f[0]=Za;a[y]=b[0];a[y+1]=b[1];f[0]=Ya;a[C]=b[0];a[C+1]=b[1];f[0]=Za;a[B]=b[0];a[B+1]=b[1];f[0]=Ya;a[w]=b[0];a[w+1]=b[1];f[0]=ya;a[u]=b[0];a[u+1]=b[1];f[0]=qa;a[t]=b[0];a[t+1]=b[1];f[0]=ya;a[v]=b[0];a[v+1]=b[1];f[0]=qa;a[s]=b[0];a[s+1]=b[1];var Ia=Za+6;f[0]=Ia;a[p]=b[0];a[p+1]=b[1];f[0]=aa;a[z]=b[0];a[z+1]=b[1];f[0]=Ia;a[n]=b[0];a[n+1]=b[1];var eb=a[Ca+108>>2]+32|0,ub=(b[0]=a[eb>>2],b[1]=a[eb+4>>2],f[0]),Sa=jb,ib=$a,ua=Za+(ub+6),Oa=db,Wa=Za+.5*ub+6}else{var pb=Ca+108|0,ob=a[pb>>2];if(1==(ab|0)){var bb=ob+24|0,qb=.5*(b[0]=a[bb>>2],b[1]=a[bb+4>>2],f[0]),hb=Ga+qb,kb=Ga-qb}else{hb=jb,kb=$a}var mb=ob+32|0,vb=db-((b[0]=a[mb>>2],b[1]=a[mb+4>>2],f[0])+6);f[0]=aa;a[I]=b[0];a[I+1]=b[1];f[0]=ea;a[M]=b[0];a[M+1]=b[1];f[0]=aa;a[E]=b[0];a[E+1]=b[1];var xb=vb-6;f[0]=xb;a[F]=b[0];a[F+1]=b[1];f[0]=qa;a[D]=b[0];a[D+1]=b[1];f[0]=xb;a[y]=b[0];a[y+1]=b[1];f[0]=qa;a[C]=b[0];a[C+1]=b[1];f[0]=ya;a[B]=b[0];a[B+1]=b[1];f[0]=hb;a[w]=b[0];a[w+1]=b[1];f[0]=ya;a[u]=b[0];a[u+1]=b[1];f[0]=hb;a[t]=b[0];a[t+1]=b[1];f[0]=vb;a[v]=b[0];a[v+1]=b[1];f[0]=kb;a[s]=b[0];a[s+1]=b[1];f[0]=vb;a[p]=b[0];a[p+1]=b[1];f[0]=kb;a[z]=b[0];a[z+1]=b[1];f[0]=ea;a[n]=b[0];a[n+1]=b[1];var wb=a[pb>>2]+32|0,Sa=hb,ib=kb,ua=Za,Oa=vb,Wa=vb+.5*(b[0]=a[wb>>2],b[1]=a[wb+4>>2],f[0])}var nb=Ft(aa,ea,qa,ya,Ea,8,O,Va),rb=a[O>>2];if(0==(rb|0)){H=2780;break}k=(Ca+108|0)>>2;var lb=a[k]+56|0;f[0]=Ga;a[lb>>2]=b[0];a[lb+4>>2]=b[1];var Ta=a[k]+64|0;f[0]=Wa;a[Ta>>2]=b[0];a[Ta+4>>2]=b[1];m[a[k]+81|0]=1;Wd(Ca,a[Ca+12>>2],nb,rb,ke);jb=Sa;$a=ib;Za=ua;db=Oa;ab=ab+1|0}if(2780!=H){for(var cb=(2*wa+Fa)/3,fb=(wa+2*Fa)/3,Ua=jb,sb=$a,Na=Za,Fb=db,Db=ab;(Db|0)<(e|0);){var Cb=a[i+(Db+g<<2)>>2];if(0==(Db&1|0)){f[0]=aa;a[I]=b[0];a[I+1]=b[1];f[0]=ea;a[M]=b[0];a[M+1]=b[1];f[0]=Pa;a[E]=b[0];a[E+1]=b[1];f[0]=ea;a[F]=b[0];a[F+1]=b[1];f[0]=Pa;a[D]=b[0];a[D+1]=b[1];f[0]=Na;a[y]=b[0];a[y+1]=b[1];f[0]=Ya;a[C]=b[0];a[C+1]=b[1];f[0]=Na;a[B]=b[0];a[B+1]=b[1];f[0]=Ya;a[w]=b[0];a[w+1]=b[1];f[0]=ya;a[u]=b[0];a[u+1]=b[1];f[0]=qa;a[t]=b[0];a[t+1]=b[1];f[0]=ya;a[v]=b[0];a[v+1]=b[1];f[0]=qa;a[s]=b[0];a[s+1]=b[1];var Eb=Na+6,yb=Ua,Bb=sb,Ja=Eb,Gb=Fb,Hb=Eb,Ib=aa,Jb=Eb}else{var Kb=1==(Db|0),Lb=Kb?cb:sb,Mb=Kb?fb:Ua,Nb=Fb-6;f[0]=aa;a[I]=b[0];a[I+1]=b[1];f[0]=ea;a[M]=b[0];a[M+1]=b[1];f[0]=aa;a[E]=b[0];a[E+1]=b[1];var Pb=Nb-6;f[0]=Pb;a[F]=b[0];a[F+1]=b[1];f[0]=qa;a[D]=b[0];a[D+1]=b[1];f[0]=Pb;a[y]=b[0];a[y+1]=b[1];f[0]=qa;a[C]=b[0];a[C+1]=b[1];f[0]=ya;a[B]=b[0];a[B+1]=b[1];f[0]=Mb;a[w]=b[0];a[w+1]=b[1];f[0]=ya;a[u]=b[0];a[u+1]=b[1];f[0]=Mb;a[t]=b[0];a[t+1]=b[1];f[0]=Nb;a[v]=b[0];a[v+1]=b[1];f[0]=Lb;a[s]=b[0];a[s+1]=b[1];yb=Mb;Bb=Lb;Ja=Na;Gb=Nb;Hb=ea;Ib=Lb;Jb=Nb}f[0]=Jb;a[p]=b[0];a[p+1]=b[1];f[0]=Ib;a[z]=b[0];a[z+1]=b[1];f[0]=Hb;a[n]=b[0];a[n+1]=b[1];var Tb=Ft(aa,ea,qa,ya,Ea,8,O,Va),Sb=a[O>>2];if(0==(Sb|0)){H=2781;break}Wd(Cb,a[Cb+12>>2],Tb,Sb,ke);Ua=yb;sb=Bb;Na=Ja;Fb=Gb;Db=Db+1|0}2781!=H&&G(Q)}h=O}function vO(c){var d,i=xn(AO|0,a[c>>2]>>>4&1);Mp(i,nq|0,Y|0);var g=fa(96),e=i+44|0;d=e>>2;a[e>>2]=g;var h=c+44|0,l=a[h>>2]|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);f[0]=l;a[g>>2]=b[0];a[g+4>>2]=b[1];g=a[h>>2]+24|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);h=a[e>>2]+24|0;f[0]=g;a[h>>2]=b[0];a[h+4>>2]=b[1];m[e+107|0]=m[c+151|0];a[d+27]=a[c+152>>2]&1^1;a[d+53]=a[c+256>>2];a[d+54]=a[c+260>>2];c=c+32|0;e=a[a[c>>2]+16>>2];g=a[a[e+4>>2]+8>>2];d=a[g>>2];if(0==(d|0)){c=e}else{for(e=g;!(e=e+4|0,xi(i,a[d>>2],a[d+4>>2]),d=a[e>>2],0==(d|0));){}c=a[a[c>>2]+16>>2]}c=a[a[c+8>>2]+8>>2];d=a[c>>2];e=0==(d|0);a:do{if(!e){g=c;for(h=d;;){if(g=g+4|0,Th(i,a[h>>2],a[h+4>>2]),h=a[g>>2],0==(h|0)){break a}}}}while(0);c=(i+40|0)>>2;0==($(a[a[c]+4>>2]|0,wi|0)|0)&&Th(i,wi|0,Y|0);0==($(a[a[c]+4>>2]|0,vi|0)|0)&&Th(i,vi|0,Y|0);a[nx>>2]=a[dj>>2];a[ox>>2]=a[di>>2];a[px>>2]=a[Ej>>2];a[qx>>2]=a[Kg>>2];a[rx>>2]=a[Hh>>2];a[sx>>2]=a[Gh>>2];a[tx>>2]=a[Ah>>2];a[dj>>2]=0;d=$(a[a[c]+4>>2]|0,vx|0);a[di>>2]=d;d=$(a[a[c]+4>>2]|0,wx|0);a[Ej>>2]=d;c=$(a[a[c]+4>>2]|0,vp|0);a[Kg>>2]=c;if(0!=(c|0)){return a[Hh>>2]=0,a[Gh>>2]=0,i}c=Th(i,vp|0,Y|0);a[Kg>>2]=c;a[Hh>>2]=0;a[Gh>>2]=0;return i}function xO(b,c){var d=h,g=cl(b,a[c+12>>2]),f=g|0;po(c|0,f);if(2!=(ts(c)|0)){return h=d,g}var e=c+120|0,l=Cb(Ba(a[a[e>>2]>>2])+3|0);Ma(l,BO|0,(j=h,h+=4,a[j>>2]=a[a[e>>2]>>2],j));yd(f,dh|0,l);h=d;return g}function ci(a,b,c,d,f,e){0==(e|0)?(e=b,b=c):(e=c,b=-b);qf(a,e,b,d,f)}function CO(b,c,d,g,f,e){var h;if(!(0<(d|0)&0<(e|0))){var k;return 0}if((d|0)<(e|0)){for(b=0;;){f=a[c+(b<<2)>>2];if(0==(f|0)){k=0;h=2824;break}if((a[f+12>>2]|0)==(g|0)){k=f;h=2825;break}else{b=b+1|0}}if(2825==h||2824==h){return k}}else{for(c=0;;){g=a[f+(c<<2)>>2];if(0==(g|0)){k=0;h=2826;break}if((a[g+16>>2]|0)==(b|0)){k=g;h=2827;break}else{c=c+1|0}}if(2826==h||2827==h){return k}}}function Fj(b,c){var d,g;d=(b+4|0)>>2;for(var f=a[d],e=b|0,h=0;;){if((h|0)>=(f|0)){g=2833;break}var k=a[e>>2],j=(h<<2)+k|0;if((a[j>>2]|0)==(c|0)){break}else{h=h+1|0}}2833!=g&&(g=f-1|0,a[d]=g,a[j>>2]=a[k+(g<<2)>>2],a[a[e>>2]+(a[d]<<2)>>2]=0)}function DO(a,b){var c=a+176|0;D[c>>1]=D[c>>1]-D[b+176>>1]&65535;c=a+162|0;D[c>>1]=D[c>>1]-D[b+162>>1]&65535;c=a+164|0;ib[c>>2]-=ib[b+164>>2]}function Zh(b,c){return CO(b,a[b+184>>2],a[b+188>>2],c,a[c+176>>2],a[c+180>>2])}function oN(b,c){return CO(b,a[b+192>>2],a[b+196>>2],c,a[c+200>>2],a[c+204>>2])}function xx(b){var c,d;d=(b+16|0)>>2;c=a[d]>>2;var g=a[c+46];c=0==(g|0)?Cb((a[c+47]<<2)+8|0):wb(g,(a[c+47]<<2)+8|0);a[a[d]+184>>2]=c;c=a[d]+188|0;g=a[c>>2];a[c>>2]=g+1|0;a[a[a[d]+184>>2]+(g<<2)>>2]=b;d=a[d];a[a[d+184>>2]+(a[d+188>>2]<<2)>>2]=0;d=(b+12|0)>>2;c=a[d]>>2;g=a[c+44];c=0==(g|0)?Cb((a[c+45]<<2)+8|0):wb(g,(a[c+45]<<2)+8|0);a[a[d]+176>>2]=c;c=a[d]+180|0;g=a[c>>2];a[c>>2]=g+1|0;a[a[a[d]+176>>2]+(g<<2)>>2]=b;d=a[d];a[a[d+176>>2]+(a[d+180>>2]<<2)>>2]=0;return b}function pf(b){0==(b|0)&&sa(qg|0,117,EO|0,oq|0);Fj(a[b+16>>2]+184|0,b);Fj(a[b+12>>2]+176|0,b)}function Rg(b){var c,d;d=(b+16|0)>>2;c=a[d]>>2;var g=a[c+52];c=0==(g|0)?Cb((a[c+53]<<2)+8|0):wb(g,(a[c+53]<<2)+8|0);a[a[d]+208>>2]=c;c=a[d]+212|0;g=a[c>>2];a[c>>2]=g+1|0;a[a[a[d]+208>>2]+(g<<2)>>2]=b;b=a[d];a[a[b+208>>2]+(a[b+212>>2]<<2)>>2]=0}function pN(b,c){var d,g,f;g=(c+4|0)>>2;var e=a[g];d=(c|0)>>2;for(var h=a[d],k=0;(k|0)<(e|0);){if((a[h+(k<<2)>>2]|0)==(b|0)){f=2869;break}else{k=k+1|0}}2869!=f&&(f=0==(h|0)?Cb((e<<2)+8|0):wb(h,(e<<2)+8|0),a[d]=f,e=a[g],a[g]=e+1|0,a[f+(e<<2)>>2]=b,a[a[d]+(a[g]<<2)>>2]=0)}function pq(b,c,d){var g=fa(184);a[g+16>>2]=b;a[g+12>>2]=c;m[g+124|0]=1;if(0==(d|0)){return ib[g+164>>2]=1,D[g+162>>1]=1,D[g+176>>1]=1,D[g+178>>1]=1,g}a[g+20>>2]=a[d+20>>2];D[g+176>>1]=D[d+176>>1];D[g+162>>1]=D[d+162>>1];ib[g+164>>2]=ib[d+164>>2];D[g+178>>1]=D[d+178>>1];var f=d+16|0;if((a[f>>2]|0)==(b|0)){for(var b=(d+28|0)>>2,e=(g+28|0)>>2,h=b+10;b<h;b++,e++){a[e]=a[b]}var k=d+12|0}else{if(k=d+12|0,(a[k>>2]|0)==(b|0)){b=(d+68|0)>>2;e=(g+28|0)>>2;for(h=b+10;b<h;b++,e++){a[e]=a[b]}}}if((a[k>>2]|0)==(c|0)){b=(d+68|0)>>2;e=(g+68|0)>>2;for(h=b+10;b<h;b++,e++){a[e]=a[b]}}else{if((a[f>>2]|0)==(c|0)){b=(d+28|0)>>2;e=(g+68|0)>>2;for(h=b+10;b<h;b++,e++){a[e]=a[b]}}}c=d+180|0;0==(a[c>>2]|0)&&(a[c>>2]=g);a[g+128>>2]=d;return g}function de(a,b,c){return xx(pq(a,b,c))}function Mw(b,c){var d=b+216|0,g=a[d>>2],f=c+168|0;a[f>>2]=g;0!=(g|0)&&(a[g+172>>2]=c);a[d>>2]=c;a[c+172>>2]=0;(a[f>>2]|0)==(c|0)&&sa(qg|0,215,FO|0,GO|0)}function Qw(b,c){for(var d=b+216|0;;){var g=a[d>>2];if(0==(g|0)|(g|0)==(c|0)){break}else{d=g+168|0}}0==(g|0)&&sa(qg|0,231,HO|0,IO|0);var g=c+168|0,f=a[g>>2],d=c+172|0;0==(f|0)?g=0:(a[f+172>>2]=a[d>>2],g=a[g>>2]);d=a[d>>2];0==(d|0)?a[b+216>>2]=g:a[d+168>>2]=g}function Lf(c){var d,i=fa(304);d=i>>2;a[d+3]=JO|0;a[d+5]=c;m[i+162|0]=1;var g=i+112|0;f[0]=1;a[g>>2]=b[0];a[g+4>>2]=b[1];g=i+104|0;f[0]=1;a[g>>2]=b[0];a[g+4>>2]=b[1];g=i+96|0;f[0]=1;a[g>>2]=b[0];a[g+4>>2]=b[1];a[d+55]=1;a[d+45]=0;a[d+44]=fa(20);a[d+47]=0;a[d+46]=fa(20);Mw(c,i);c=c+240|0;a[c>>2]=a[c>>2]+1|0;return i}function gm(b,c){var d,g;g=(c+16|0)>>2;d=a[g]>>2;var f=a[d+48];d=0==(f|0)?Cb((a[d+49]<<2)+8|0):wb(f,(a[d+49]<<2)+8|0);a[a[g]+192>>2]=d;d=a[g]+196|0;f=a[d>>2];a[d>>2]=f+1|0;a[a[a[g]+192>>2]+(f<<2)>>2]=c;g=a[g];a[a[g+192>>2]+(a[g+196>>2]<<2)>>2]=0;g=(c+12|0)>>2;d=a[g]>>2;f=a[d+50];d=0==(f|0)?Cb((a[d+51]<<2)+8|0):wb(f,(a[d+51]<<2)+8|0);a[a[g]+200>>2]=d;d=a[g]+204|0;f=a[d>>2];a[d>>2]=f+1|0;a[a[a[g]+200>>2]+(f<<2)>>2]=c;g=a[g];a[a[g+200>>2]+(a[g+204>>2]<<2)>>2]=0;m[b+248|0]=1;m[a[b+32>>2]+248|0]=1}function yx(b){0==(b|0)&&sa(qg|0,272,KO|0,oq|0);var c=a[b+128>>2];0!=(c|0)&&(c=c+180|0,(a[c>>2]|0)==(b|0)&&(a[c>>2]=0));Fj(a[b+16>>2]+192|0,b);Fj(a[b+12>>2]+200|0,b)}function og(b,c){var d=h,g=b+180|0,f=a[g>>2];if((f|0)==(c|0)){la(0,LO|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j))}else{0!=(f|0)&&sa(qg|0,343,MO|0,Kw|0);a[g>>2]=c;g=c+178|0;f=D[b+178>>1];(D[g>>1]&65535)<(f&65535)&&(D[g>>1]=f);for(var g=b+176|0,f=b+162|0,e=b+164|0,l=c;;){var k=l+176|0;D[k>>1]=D[k>>1]+D[g>>1]&65535;k=l+162|0;D[k>>1]=D[k>>1]+D[f>>1]&65535;k=l+164|0;ib[k>>2]+=ib[e>>2];l=a[l+180>>2];if(0==(l|0)){break}}}h=d}function NO(b){var c;c=(b+180|0)>>2;var d=a[c];if(0!=(d|0)){for(var g=d;;){DO(g,b);d=a[g+180>>2];for(0==D[g+176>>1]<<16>>16&&OO(g);1==m[g+124|0]<<24>>24;){g=a[g+12>>2];if(1!=m[g+162|0]<<24>>24){break}if(1!=(a[g+188>>2]|0)){break}g=a[a[g+184>>2]>>2];DO(g,b)}if(0==(d|0)){break}else{g=d}}}a[c]=0}function PO(b,c,d,g){var f=(b|0)>(c|0);a[d>>2]=f?c:b;a[g>>2]=f?b:c}function OO(b){0==(b|0)&&sa(qg|0,128,QO|0,oq|0);var c=b+16|0,d=a[c>>2],g=d+184|0,f=a[a[g>>2]>>2],e=0==(f|0);a:do{if(!e){for(var h=0,k=g,j=f,m=d;;){if((j|0)==(b|0)&&(Fj(k,b),m=a[c>>2]),h=h+1|0,k=m+184|0,j=a[a[k>>2]+(h<<2)>>2],0==(j|0)){break a}}}}while(0);c=b+12|0;f=a[c>>2];g=f+176|0;e=a[a[g>>2]>>2];if(0!=(e|0)){for(d=0;!((e|0)==(b|0)&&(Fj(g,b),f=a[c>>2]),d=d+1|0,g=f+176|0,e=a[a[g>>2]+(d<<2)>>2],0==(e|0));){}}}function RO(c){var d,i,g,e,h=c+216|0,l=a[h>>2],k=0==(l|0);a:do{if(!k){for(var j=l;;){var z=j+192|0,p=a[z>>2],s=0==(p|0);b:do{if(!s){var v=a[p>>2];if(0!=(v|0)){i=0;for(var t=p;;){g=a[v+16>>2]>>2;d=a[a[v+12>>2]+240>>2];var u=a[g+60],w=(u|0)<(d|0),A=w?d:u;g=a[a[g+5]+220>>2]+44*a[g+59]+4|0;for(d=w?u:d;;){var B=d+1|0;if((B|0)>=(A|0)){break}d=a[a[g>>2]+(B<<2)>>2];u=m[d+162|0];if(0==u<<24>>24){break}else{if(1!=u<<24>>24){d=B;continue}}if(0==(a[d+120>>2]|0)){d=B}else{break}}0!=((B|0)==(A|0)&1|0)&&(m[v+125|0]=1,t=a[z>>2]);i=i+1|0;v=a[t+(i<<2)>>2];if(0==(v|0)){break b}}}}}while(0);j=a[j+168>>2];if(0==(j|0)){break a}}}}while(0);l=a[c+220>>2];0==(a[l+40>>2]|0)?0<(a[c+208>>2]|0)&&(e=29):e=29;a:do{if(29==e){k=a[l+4>>2];B=0;b:for(;;){j=a[k+(B<<2)>>2];if(0==(j|0)){break a}j=a[j+200>>2];for(z=0;;){p=a[j+(z<<2)>>2];if(0==(p|0)){break}if(0!=(a[p+108>>2]|0)&&0==m[p+125|0]<<24>>24){break b}z=z+1|0}B=B+1|0}SO(c)}}while(0);TO(c);l=a[h>>2];if(0==(l|0)){return 0}e=c+152|0;for(h=0;;){k=l+192|0;B=a[k>>2];j=0==(B|0);a:do{if(j){var C=h}else{z=a[B>>2];p=0==(z|0);b:do{if(p){var y=h}else{s=h;i=0;for(v=z;;){if(t=a[v+108>>2],0!=(t|0)&&(0==m[v+125|0]<<24>>24?(zx(v),s=1):(t=0==(a[e>>2]&1|0)?t+24|0:t+32|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),v=v+144|0,f[0]=t,a[v>>2]=b[0],a[v+4>>2]=b[1])),i=i+1|0,v=a[a[k>>2]+(i<<2)>>2],0==(v|0)){y=s;break b}}}}while(0);z=l+212|0;if(0<(a[z>>2]|0)){p=l+208|0;s=y;for(v=0;;){t=a[a[p>>2]+(v<<2)>>2];i=t>>2;A=a[i+4];g=a[i+3];if((a[A+236>>2]|0)!=(a[g+236>>2]|0)|(A|0)==(g|0)){d=s}else{for(d=t;!(u=a[d+180>>2],0==(u|0));){d=u}u=m[d+125|0];m[t+125|0]=u;w=a[i+27];0==(w|0)?d=s:0==u<<24>>24?(zx(t),d=1):(u=0==(a[e>>2]&1|0)?w+24|0:w+32|0,u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0]),d=(d+144|0)>>2,w=(b[0]=a[d],b[1]=a[d+1],f[0]),f[0]=u>w?u:w,a[d]=b[0],a[d+1]=b[1],d=s)}i=v+1|0;if((i|0)<(a[z>>2]|0)){s=d,v=i}else{C=d;break a}}}else{C=y}}}while(0);l=a[l+168>>2];if(0==(l|0)){break}else{h=C}}if(0==(C|0)){return 0}qq(c);return C}function SO(b){var c;c=(b+244|0)>>1;0!=D[c]<<16>>16&&sa(Ax|0,190,UO|0,VO|0);var d=b+246|0,g=(D[d>>1]<<16>>16)+3|0,b=(b+220|0)>>2,f=a[b],g=(0==(f|0)?Cb(44*g|0):wb(f,44*g|0))+44|0;a[b]=g;f=D[d>>1];d=f<<16>>16;f=-1<f<<16>>16;a:do{if(f){for(var e=d,h=g;;){for(var k=e-1|0,j=(h+44*k|0)>>2,h=(h+44*e|0)>>2,m=j+11;j<m;j++,h++){a[h]=a[j]}j=a[b];if(0<(e|0)){e=k,h=j}else{var p=-1,s=j;break a}}}else{p=d,s=g}}while(0);a[(s+8>>2)+(11*p|0)]=0;a[(a[b]>>2)+(11*p|0)]=0;s=fa(8);a[(a[b]+12>>2)+(11*p|0)]=s;a[(a[b]+4>>2)+(11*p|0)]=s;a[(a[b]+40>>2)+(11*p|0)]=0;a[(a[b]+20>>2)+(11*p|0)]=1;a[(a[b]+16>>2)+(11*p|0)]=1;a[(a[b]+28>>2)+(11*p|0)]=1;a[(a[b]+24>>2)+(11*p|0)]=1;D[c]=D[c]-1&65535}function zx(c){var d,i,g,e,h,l,k,j;j=(c+108|0)>>2;if(0!=(a[j]|0)){k=(c+16|0)>>2;l=a[k]>>2;var z=a[l+5];i=a[l+59];h=(z+220|0)>>2;e=(c+12|0)>>2;var p=WO(a[h],a[a[e]+240>>2],i,a[l+60]);l=i-1|0;g=a[h]>>2;d=a[a[g+(11*l|0)+1]>>2];0==(d|0)?(d=a[a[g+(11*i|0)+1]>>2]+40|0,g=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])+(a[g+(11*i|0)+5]|0)+(a[z+260>>2]|0)):(i=d+40|0,g=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0])-(a[g+(11*l|0)+4]|0));g&=-1;p=XO(z,l,p);d=a[j];i=d+24|0;i=(b[0]=a[i>>2],b[1]=a[i+4>>2],f[0]);d=d+32|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);var s=0==(a[z+152>>2]&1|0),z=s?d:i,v=p+96|0;f[0]=z;a[v>>2]=b[0];a[v+4>>2]=b[1];z=.5*z&-1;s=.5*(s?i:d);i=(p+112|0)>>2;f[0]=s;a[i]=b[0];a[i+1]=b[1];d=(p+104|0)>>2;f[0]=s;a[d]=b[0];a[d+1]=b[1];a[p+120>>2]=a[j];j=p+40|0;f[0]=z+g|0;a[j>>2]=b[0];a[j+4>>2]=b[1];j=de(p,a[k],c);g=-(b[0]=a[d],b[1]=a[d+1],f[0]);d=j+28|0;f[0]=g;a[d>>2]=b[0];a[d+4>>2]=b[1];k=a[k]+112|0;k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);g=j+68|0;f[0]=k;a[g>>2]=b[0];a[g+4>>2]=b[1];m[j+124|0]=4;k=de(p,a[e],c);j=(b[0]=a[i],b[1]=a[i+1],f[0]);g=k+28|0;f[0]=j;a[g>>2]=b[0];a[g+4>>2]=b[1];e=a[e]+104|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);j=k+68|0;f[0]=e;a[j>>2]=b[0];a[j+4>>2]=b[1];m[k+124|0]=4;e=a[h];k=e+44*l+16|0;(a[k>>2]|0)<(z|0)?(a[k>>2]=z,h=a[h]):h=e;h=h+44*l+20|0;(a[h>>2]|0)<(z|0)&&(a[h>>2]=z);a[p+128>>2]=c|0}}function WO(b,c,d,g){var f=h;h+=24;var e=f+16,j=f+20,k=d-1|0,d=a[(b+4>>2)+(11*k|0)],n=a[(b>>2)+(11*k|0)],b=f+8|0;a[b>>2]=-1;k=f|0;a[k>>2]=-1;var m=f+12|0;a[m>>2]=n;var p=f+4|0;a[p>>2]=n;PO(g,c,e,j);for(var c=a[e>>2],j=a[j>>2],e=n,g=0,s=-1,v=n;;){n=e-1|0;if((g|0)>(n|0)){var t=s,u=v;break}Bx(a[d+(g<<2)>>2],k,c,j);(g|0)!=(n|0)&&Bx(a[d+(n<<2)>>2],k,c,j);v=a[p>>2];s=a[k>>2];if(2>(v-s|0)){t=s;u=v;break}else{e=n,g=g+1|0}}(t|0)>(u|0)?(t=a[m>>2]+a[b>>2]|0,t=(t+1|0)/2&-1):(t=(u+t|0)+1|0,t=(t|0)/2&-1);h=f;return t}function XO(b,c,d){var g,f;f=(b+220|0)>>2;var e=a[f];g=e+44*c|0;e=a[(e+4>>2)+(11*c|0)];e=0==(e|0)?Cb((a[g>>2]<<2)+8|0):wb(e,(a[g>>2]<<2)+8|0);g=e>>2;a[(a[f]+4>>2)+(11*c|0)]=e;var h=a[(a[f]>>2)+(11*c|0)],k=(h|0)>(d|0);a:do{if(k){for(var j=h;;){var m=j-1|0,p=a[(m<<2>>2)+g];a[(j<<2>>2)+g]=p;j=p+240|0;a[j>>2]=a[j>>2]+1|0;if((m|0)>(d|0)){j=m}else{break a}}}}while(0);h=Lf(b);b=(d<<2)+e|0;a[b>>2]=h;a[h+240>>2]=d;a[h+236>>2]=c;c=a[f]+44*c|0;d=a[c>>2]+1|0;a[c>>2]=d;a[(d<<2>>2)+g]=0;return a[b>>2]}function Bx(b,c,d,g){var c=c>>2,f=b>>2,e=h;h+=8;var j,k=e+4;if(1==m[b+162|0]<<24>>24){if(b=a[f+60],0!=(a[f+45]|0)){j=a[f+46];var n=a[j>>2];if(0!=(n|0)){for(var z=f=k=0;;){var p=a[a[n+12>>2]+240>>2];if((p|0)>(d|0)){var p=(p|0)<(g|0)?z:1,s=f}else{p=z,s=1}k=k+1|0;n=a[j+(k<<2)>>2];if(0==(n|0)){break}else{f=s,z=p}}0!=s<<24>>24&0==p<<24>>24&&(a[c]=b+1|0);0!=p<<24>>24&0==s<<24>>24&&(a[c+1]=b-1|0)}}else{if(2!=(a[f+47]|0)&&sa(Ax|0,63,YO|0,ZO|0),p=a[f+46],PO(a[a[a[p>>2]+12>>2]+240>>2],a[a[a[p+4>>2]+12>>2]+240>>2],e,k),p=a[k>>2],(p|0)>(d|0)){if(s=a[e>>2],(s|0)<(g|0)){if(k=(s|0)<(d|0),f=(p|0)>(g|0),!(k&f)){k?j=114:(s|0)==(d|0)&(p|0)<(g|0)&&(j=114);114==j&&(a[c+2]=b);if(!f&&!((p|0)==(g|0)&(s|0)>(d|0))){h=e;return}a[c+3]=b}}else{a[c+1]=b,a[c+3]=b}}else{a[c]=b,a[c+2]=b}}}h=e}function Cx(b){var c=b+276|0,d=a[c>>2];if(0!=(d|0)){var g=D[b+244>>1],f=b+246|0;if(g<<16>>16<=D[f>>1]<<16>>16){b=b+220|0;for(g=g<<16>>16;;){a[d+(g<<2)>>2]=a[a[(a[b>>2]+4>>2)+(11*g|0)]>>2];d=g+1|0;if((d|0)>(D[f>>1]<<16>>16|0)){break}g=d;d=a[c>>2]}}}}function lx(c,d){0!=m[ld]<<24>>24&&mk(ih);m[rq]=0;a[sd>>2]=c;var i=(rc(a[a[c+32>>2]+28>>2])<<2)+4|0,g=fa(i);a[om>>2]=g;i=fa(i);a[pm>>2]=i;a[qm>>2]=8;a[rm>>2]=24;f[0]=.995;a[sm>>2]=b[0];a[sm+4>>2]=b[1];i=V(c|0,$O|0);0!=(i|0)&&(i=wg(i,xc),0<i&&(g=(a[qm>>2]|0)*i,a[qm>>2]=1>g?1:g&-1,i*=a[rm>>2]|0,a[rm>>2]=1>i?1:i&-1));Lw(c);jq(c,1);Dx(c);sq(c);a[Ex>>2]=D[c+244>>1]<<16>>16;a[Fx>>2]=D[c+246>>1]<<16>>16;i=c+228|0;g=0<(a[i>>2]|0);a:do{if(g){for(var e=0,h=0;;){var j=c,k=e;a[j+216>>2]=a[a[j+224>>2]+(k<<2)>>2];if(0<(k|0)){var n=D[j+244>>1],k=j+246|0;if(n<<16>>16<=D[k>>1]<<16>>16){j=j+220|0;for(n=n<<16>>16;;){var z=a[j>>2],p=z+44*n+4|0;a[p>>2]=(a[(z>>2)+(11*n|0)]<<2)+a[p>>2]|0;a[(a[j>>2]>>2)+(11*n|0)]=0;n=n+1|0;if((n|0)>(D[k>>1]<<16>>16|0)){break}}}}h=tq(c,0,d)+h|0;e=e+1|0;if((e|0)>=(a[i>>2]|0)){var s=h;break a}}}else{s=0}}while(0);aP(c);i=c+208|0;if(1>(a[i>>2]|0)){var v=s}else{g=c+212|0;for(e=1;;){var v=bP(a[a[g>>2]+(e<<2)>>2],d)+s|0,s=e+1|0,t=a[i>>2];if((s|0)>(t|0)){break}else{e=s,s=v}}if(0<(t|0)){t=V(c|0,cP|0);if(0!=(t|0)&&0==re(t)<<24>>24){Gx(c,v);return}Tw(c);m[rq]=1;v=tq(c,2,d)}}Gx(c,v)}function tq(c,d,i){var g=h;if(1<(d|0)){var e=tm(),Xa=c+216|0;Hx(a[Xa>>2]);var l=e}else{l=2147483647,Xa=c+216|0}for(var e=c+32|0,k=l;;){var n;if(3<=(d|0)){var z=k,p=l,s=n;break}n=a[rm>>2];if(2>(d|0)){n=4<(n|0)?4:n;(a[e>>2]|0)==(c|0)&&Ix(c,d);0==(d|0)&&Jx(c);Kx(c);var v=tm();(v|0)>(k|0)?l=k:(Hx(a[Xa>>2]),l=v)}else{(l|0)>(k|0)&&dP(c),v=l=k}for(var k=l,t=v,u=0,l=0;(l|0)<(n|0);){0!=m[ld]<<24>>24&&Va(a[oa>>2],eP|0,(j=h,h+=20,a[j>>2]=d,a[j+4>>2]=l,a[j+8>>2]=u,a[j+12>>2]=t,a[j+16>>2]=k,j));v=u+1|0;if((u|0)>=(a[qm>>2]|0)|0==(t|0)){break}t=c;u=2>(l%4|0)&1;if(0==(l&1|0)){var w=D[t+244>>1],A=1,B=t+246|0,w=(w<<16>>16)+(w<<16>>16<=D[a[sd>>2]+244>>1]<<16>>16&1)|0}else{w=D[t+246>>1],A=-1,B=t+244|0,w=((w<<16>>16>=D[a[sd>>2]+246>>1]<<16>>16)<<31>>31)+(w<<16>>16)|0}B=(D[B>>1]<<16>>16)+A|0;if((w|0)!=(B|0)){for(;!(fP(t,w,u,gP(t,w,w-A|0)&255),w=w+A|0,(w|0)==(B|0));){}}u^=1;uq(t,u);t=tm();(t|0)>(k|0)?u=k:(Hx(a[Xa>>2]),u=t,v=(t|0)<(b[0]=a[sm>>2],b[1]=a[sm+4>>2],f[0])*(k|0)?0:v);k=u;u=v;l=l+1|0}if(0==(t|0)){z=k;p=0;s=n;break}else{l=t,d=d+1|0}}(p|0)>(z|0)&&dP(c);0<(z|0)&&(uq(c,0),z=tm());if(0!=(i|0)&0<(s|0)){i=0}else{return h=g,z}for(;!(hP(c),i=i+1|0,(i|0)==(s|0));){}h=g;return z}function aP(b){var c,d=h,g;c=(b+228|0)>>2;if(2<=(a[c]|0)){for(var f=b+224|0,e=0,l=0;;){var k=a[a[f>>2]+(l<<2)>>2];0!=(e|0)&&(a[e+168>>2]=k);a[k+172>>2]=e;for(e=k;!(k=a[e+168>>2],0==(k|0));){e=k}l=l+1|0;if((l|0)>=(a[c]|0)){break}}a[c]=1;a[b+216>>2]=a[a[f>>2]>>2];D[b+244>>1]=a[Ex>>2]&65535;D[b+246>>1]=a[Fx>>2]&65535}l=D[b+244>>1];f=b+246|0;if(l<<16>>16<=D[f>>1]<<16>>16){c=(b+220|0)>>2;b=b+12|0;for(l=l<<16>>16;;){e=a[c];a[(e>>2)+(11*l|0)]=a[(e+8>>2)+(11*l|0)];e=a[c];a[(e+4>>2)+(11*l|0)]=a[(e+12>>2)+(11*l|0)];for(e=0;;){var n=a[c],z=a[(n>>2)+(11*l|0)];if((e|0)>=(z|0)){break}k=a[a[(n+4>>2)+(11*l|0)]+(e<<2)>>2];if(0==(k|0)){g=206;break}a[k+240>>2]=e;e=e+1|0}206==g&&(g=0,0==m[ld]<<24>>24?k=n:(Va(a[oa>>2],iP|0,(j=h,h+=16,a[j>>2]=a[b>>2],a[j+4>>2]=l,a[j+8>>2]=e,a[j+12>>2]=z,j)),k=a[c]),a[(k>>2)+(11*l|0)]=e);l=l+1|0;if((l|0)>(D[f>>1]<<16>>16|0)){break}}}h=d}function bP(b,c){Lw(b);a[b+228>>2]=1;a[a[b+224>>2]>>2]=a[b+216>>2];Dx(b);Ix(b,0);vN(b);nN(b);wN(b);sq(b);Jx(b);Kx(b);var d=tq(b,2,c),g=b+208|0;if(1>(a[g>>2]|0)){var f=d;Cx(b);return f}for(var e=b+212|0,h=1;;){if(d=bP(a[a[e>>2]+(h<<2)>>2],c)+d|0,h=h+1|0,(h|0)>(a[g>>2]|0)){f=d;break}}Cx(b);return f}function Gx(c,d){var i=h,g=a[pm>>2];0!=(g|0)&&(G(g),a[pm>>2]=0);g=a[om>>2];0!=(g|0)&&(G(g),a[om>>2]=0);var g=c+208|0,e=1>(a[g>>2]|0);a:do{if(!e){for(var Xa=c+212|0,l=1;;){if(qq(a[a[Xa>>2]+(l<<2)>>2]),l=l+1|0,(l|0)>(a[g>>2]|0)){break a}}}}while(0);g=D[c+244>>1];e=c+246|0;Xa=g<<16>>16>D[e>>1]<<16>>16;a:do{if(!Xa){for(var l=c+220|0,k=g<<16>>16;;){var n=a[l>>2],z=0<(a[(n>>2)+(11*k|0)]|0);b:do{if(z){for(var p=0,s=n;;){s=a[a[(s+4>>2)+(11*k|0)]+(p<<2)>>2];a[s+240>>2]=p;var s=s+192|0,v=a[s>>2],t=0==(v|0);c:do{if(!t){var u=a[v>>2];if(0!=(u|0)){for(var w=0,A=u,u=v;;){if(4==m[A+124|0]<<24>>24&&(yx(A),G(A|0),w=w-1|0,u=a[s>>2]),w=w+1|0,A=a[u+(w<<2)>>2],0==(A|0)){break c}}}}}while(0);p=p+1|0;s=a[l>>2];if((p|0)>=(a[(s>>2)+(11*k|0)]|0)){var B=s;break b}}}else{B=n}}while(0);n=a[(B+40>>2)+(11*k|0)];0!=(n|0)&&(G(a[n+8>>2]),G(n));k=k+1|0;if((k|0)>(D[e>>1]<<16>>16|0)){break a}}}}while(0);0!=m[ld]<<24>>24&&(B=a[oa>>2],g=a[c+12>>2],e=Jn(),Va(B,jP|0,(j=h,h+=16,a[j>>2]=g,a[j+4>>2]=d,f[0]=e,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j)));h=i}function TO(b){Cx(b);var c=b+208|0;if(1<=(a[c>>2]|0)){for(var b=b+212|0,d=1;!(TO(a[a[b>>2]+(d<<2)>>2]),d=d+1|0,(d|0)>(a[c>>2]|0));){}}}function qq(b){var c;c=b+208|0;var d=1>(a[c>>2]|0);a:do{if(!d){for(var g=b+212|0,f=1;;){if(qq(a[a[g>>2]+(f<<2)>>2]),f=f+1|0,(f|0)>(a[c>>2]|0)){break a}}}}while(0);c=(b+276|0)>>2;var e=a[c];if(0!=(e|0)){var h=D[b+244>>1],d=b+246|0;if(h<<16>>16<=D[d>>1]<<16>>16){g=b+32|0;f=b+220|0;for(h=h<<16>>16;;){var k=a[e+(h<<2)>>2],e=kP(b,k,-1),k=kP(b,k,1);a[a[c]+(h<<2)>>2]=e;e=e+240|0;a[(a[f>>2]+4>>2)+(11*h|0)]=(a[e>>2]<<2)+a[(a[a[g>>2]+220>>2]+4>>2)+(11*h|0)]|0;a[(a[f>>2]>>2)+(11*h|0)]=a[k+240>>2]+1-a[e>>2]|0;h=h+1|0;if((h|0)>(D[d>>1]<<16>>16|0)){break}e=a[c]}}}}function kP(a,b,c){var d=lP(b,c);if(0==(d|0)){var f;return b}for(;;){if(b=0==(Lx(a,d)|0)?0==(Mx(a,d)|0)?b:d:d,d=lP(d,c),0==(d|0)){f=b;break}}return f}function Nx(b,c){var d,g,f=a[c+12>>2],e=a[f+192>>2],h=0==(e|0);g=(c+16|0)>>2;a:do{if(!h){for(h=0;;){d=a[e+(h<<2)>>2];if(0==(d|0)){break a}if((a[d+12>>2]|0)==(a[g]|0)){break}else{h=h+1|0}}og(c,d);f=c+180|0;0==(a[f>>2]|0)&&(a[f>>2]=d);4==m[d+124|0]<<24>>24&&(d=d+128|0,0==(a[d>>2]|0)&&(a[d>>2]=c));d=a[g]>>2;f=a[d+52];d=0==(f|0)?Cb((a[d+53]<<2)+8|0):wb(f,(a[d+53]<<2)+8|0);a[a[g]+208>>2]=d;d=a[g]+212|0;f=a[d>>2];a[d>>2]=f+1|0;a[a[a[g]+208>>2]+(f<<2)>>2]=c;g=a[g];a[a[g+208>>2]+(a[g+212>>2]<<2)>>2]=0;return}}while(0);g=pq(f,a[g],c);m[g+124|0]=4==m[c+124|0]<<24>>24?4:3;a[g+108>>2]=a[c+108>>2];gm(b,g)}function um(b,c){var d=a[b+236>>2],g=b+240|0,f=a[g>>2],e=c+240|0,h=a[e>>2];a[g>>2]=h;g=a[sd>>2]+220|0;a[a[(a[g>>2]+4>>2)+(11*d|0)]+(h<<2)>>2]=b;a[e>>2]=f;a[a[(a[g>>2]+4>>2)+(11*d|0)]+(f<<2)>>2]=c}function kN(a){return 1==m[a+162|0]<<24>>24?2:a=2>m[a+166|0]<<24>>24&1}function Dx(b){var c,d;d=(b+246|0)>>1;var g=fa((D[d]<<16>>16<<2)+8|0);c=ra(b);var f=0==(c|0);a:do{if(!f){for(var e=c;;){var h=(a[e+236>>2]<<2)+g|0;a[h>>2]=a[h>>2]+1|0;var h=Ib(b,e),k=0==(h|0);b:do{if(!k){for(var j=h;;){var m=a[a[j+16>>2]+236>>2],p=a[a[j+12>>2]+236>>2],s=(m|0)>(p|0),v=s?m:p,m=(s?p:m)+1|0,p=(m|0)<(v|0);c:do{if(p){for(s=m;;){var t=(s<<2)+g|0;a[t>>2]=a[t>>2]+1|0;s=s+1|0;if((s|0)>=(v|0)){break c}}}}while(0);j=yb(b,j);if(0==(j|0)){break b}}}}while(0);e=ba(b,e);if(0==(e|0)){break a}}}}while(0);f=fa(44*(D[d]<<16>>16)+88|0);c=(b+220|0)>>2;a[c]=f;b=D[b+244>>1];if(b<<16>>16<=D[d]<<16>>16){for(b=b<<16>>16;;){e=(b<<2)+g|0;h=a[e>>2];a[(f>>2)+(11*b|0)]=h;a[(a[c]+8>>2)+(11*b|0)]=h;f=fa((a[e>>2]<<2)+4|0);a[(a[c]+4>>2)+(11*b|0)]=f;a[(a[c]+12>>2)+(11*b|0)]=f;b=b+1|0;if((b|0)>(D[d]<<16>>16|0)){break}f=a[c]}}G(g)}function Ix(b,c){var d,g=h,f=ZE(a[b+240>>2]),e=b+216|0;d=a[e>>2];var l=0==(d|0);a:do{if(!l){for(var k=d;;){if(m[k+163|0]=0,k=a[k+168>>2],0==(k|0)){break a}}}}while(0);l=b+244|0;k=D[l>>1];d=(b+246|0)>>1;var n=k<<16>>16>D[d]<<16>>16;a:do{if(!n){for(var z=b+220|0,p=k<<16>>16;;){if(a[(a[z>>2]>>2)+(11*p|0)]=0,p=p+1|0,(p|0)>(D[d]<<16>>16|0)){break a}}}}while(0);e=a[e>>2];k=0==(e|0);a:do{if(!k){for(var n=0==(c|0),z=b,p=f,s=e;;){var v=0==(a[a[(n?s+176|0:s+184|0)>>2]>>2]|0);b:do{if(v){var t=s+163|0;if(0==m[t]<<24>>24&&(m[t]=1,Rk(f,s),t=Sk(f),0!=(t|0))){for(;;){if(7==m[t+165|0]<<24>>24?AN(z,t,c,p):(Rw(b,t),Sw(f,t,c)),t=Sk(f),0==(t|0)){break b}}}}}while(0);s=a[s+168>>2];if(0==(s|0)){break a}}}}while(0);0!=(Sk(f)|0)&&la(1,mP|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));l=D[l>>1];e=l<<16>>16>D[d]<<16>>16;a:do{if(!e){k=b+152|0;n=b+220|0;z=a[sd>>2];for(p=l<<16>>16;;){m[a[z+220>>2]+44*p+33|0]=0;s=0==(a[k>>2]&1|0);b:do{if(!s&&(v=a[n>>2],t=a[(v>>2)+(11*p|0)],0<(t|0))){for(var v=a[(v+4>>2)+(11*p|0)],t=t-1|0,u=(t|0)/2&-1,w=0;;){if(um(a[v+(w<<2)>>2],a[v+(t-w<<2)>>2]),w=w+1|0,(w|0)>(u|0)){break b}}}}while(0);p=p+1|0;if((p|0)>(D[d]<<16>>16|0)){break a}}}}while(0);(a[b+32>>2]|0)==(b|0)&&0<(tm()|0)&&uq(b,0);G(a[f>>2]);G(f);h=g}function Sw(b,c,d){if(0==(d|0)){var d=c+188|0,g=a[d>>2];if(0<(g|0)){for(var c=c+184|0,f=0;;){var e=a[a[c>>2]+(f<<2)>>2]+12|0,h=a[e>>2]+163|0;0==m[h]<<24>>24&&(m[h]=1,Rk(b,a[e>>2]),g=a[d>>2]);f=f+1|0;if((f|0)>=(g|0)){break}}}}else{if(d=c+180|0,g=a[d>>2],0<(g|0)){c=c+176|0;for(f=0;!(e=a[a[c>>2]+(f<<2)>>2]+16|0,h=a[e>>2]+163|0,0==m[h]<<24>>24&&(m[h]=1,Rk(b,a[e>>2]),g=a[d>>2]),f=f+1|0,(f|0)>=(g|0));){}}}}function tm(){var b,c=a[sd>>2],d=D[c+244>>1],g=c+246|0,f=D[g>>1];if(d<<16>>16>=f<<16>>16){var e;return 0}b=(c+220|0)>>2;for(var h=0,d=d<<16>>16;;){var k=a[b];0==m[k+44*d+33|0]<<24>>24?(f=nP(c,d),a[(a[b]+36>>2)+(11*d|0)]=f,m[a[b]+44*d+33|0]=1,k=f,f=D[g>>1]):k=a[(k+36>>2)+(11*d|0)];h=k+h|0;d=d+1|0;if((d|0)>=(f<<16>>16|0)){e=h;break}}return e}function uq(b,c){var d,g=b+244|0,f=D[g>>1];d=(b+246|0)>>1;var e=D[d],h=f<<16>>16>e<<16>>16;a:do{if(h){var k=e,j=b+220|0}else{for(var z=b+220|0,p=f<<16>>16;;){m[a[z>>2]+44*p+32|0]=1;var p=p+1|0,s=D[d];if((p|0)>(s<<16>>16|0)){k=s;j=z;break a}}}}while(0);for(f=k;;){e=D[g>>1];if(e<<16>>16>f<<16>>16){break}e=e<<16>>16;for(h=0;;){if(0==m[a[j>>2]+44*e+32|0]<<24>>24){var v=h,t=f}else{v=oP(b,e,c)+h|0,t=D[d]}f=e+1|0;if((f|0)>(t<<16>>16|0)){break}else{e=f,h=v,f=t}}if(0<(v|0)){f=t}else{break}}}function nP(b,c){var d,g;d=(b+220|0)>>2;var f=a[d],e=a[(f+4>>2)+(11*c|0)],h=c+1|0,k=a[(a[a[sd>>2]+220>>2]>>2)+(11*h|0)];(a[Ox>>2]|0)>(k|0)||(f=k+1|0,a[Ox>>2]=f,k=a[Gj>>2],f=0==(k|0)?Cb(f<<2):wb(k,f<<2),a[Gj>>2]=f,f=a[d]);k=0<(a[(f>>2)+(11*h|0)]|0);a:do{if(k){for(var j=a[Gj>>2],z=0;;){a[j+(z<<2)>>2]=0;var z=z+1|0,p=a[d];if((z|0)>=(a[(p>>2)+(11*h|0)]|0)){var s=p;break a}}}else{s=f}}while(0);f=0<(a[(s>>2)+(11*c|0)]|0);a:do{if(f){for(var v=k=0,j=0,z=s;;){var t=0<(k|0),u=(j<<2)+e|0,w=a[a[u>>2]+184>>2],p=a[w>>2];b:do{if(t){if(0==(p|0)){var A=k,B=z,C=v}else{for(var y=a[Gj>>2],F=0,E=v,G=p;;){var I=a[a[G+12>>2]+240>>2]+1|0,H=(I|0)>(k|0);c:do{if(H){var O=E}else{for(var J=D[G+162>>1]<<16>>16,K=E,L=I;;){if(K=J*a[y+(L<<2)>>2]+K|0,L=L+1|0,(L|0)>(k|0)){O=K;break c}}}}while(0);F=F+1|0;G=a[w+(F<<2)>>2];if(0==(G|0)){var N=O;g=390;break b}else{E=O}}}}else{N=v,g=390}}while(0);do{if(390==g){g=0;if(0==(p|0)){A=k,B=z}else{A=a[Gj>>2];B=1;C=k;for(v=p;;){var t=a[a[v+12>>2]+240>>2],Q=(t|0)>(C|0)?t:C,C=(t<<2)+A|0;a[C>>2]=(D[v+162>>1]<<16>>16)+a[C>>2]|0;v=a[a[a[u>>2]+184>>2]+(B<<2)>>2];if(0==(v|0)){break}B=B+1|0;C=Q}A=Q;B=a[d]}C=N}}while(0);j=j+1|0;u=a[(B>>2)+(11*c|0)];if((j|0)<(u|0)){k=A,v=C,z=B}else{break}}if(0<(u|0)){k=a[(B+4>>2)+(11*c|0)];j=C;for(z=0;;){if(p=a[k+(z<<2)>>2],j=0==m[p+161|0]<<24>>24?j:Px(a[p+184>>2],1)+j|0,z=z+1|0,(z|0)>=(u|0)){S=j;R=B;break a}}}else{var S=C,R=B}}else{S=0,R=s}}while(0);d=a[(R>>2)+(11*h|0)];if(0>=(d|0)){var U;return S}h=a[(R+4>>2)+(11*h|0)];for(R=0;;){if(g=a[h+(R<<2)>>2],S=0==m[g+161|0]<<24>>24?S:Px(a[g+176>>2],-1)+S|0,R=R+1|0,(R|0)>=(d|0)){U=S;break}}return U}function Rw(b,c){var d,g,f=h,e=a[c+236>>2];g=(b+220|0)>>2;d=a[g]>>2;var l=a[d+(11*e|0)];if(1>(a[d+(11*e|0)+2]|0)){var k=a[c+12>>2];la(1,pP|0,(j=h,h+=16,a[j>>2]=a[b+12>>2],a[j+4>>2]=k,a[j+8>>2]=e,a[j+12>>2]=l,j));S()}a[a[d+(11*e|0)+1]+(l<<2)>>2]=c;d=c+240|0;a[d>>2]=l;l=a[g]+44*e|0;a[l>>2]=a[l>>2]+1|0;l=a[g];(a[(l>>2)+(11*e|0)]|0)>(a[(l+8>>2)+(11*e|0)]|0)&&sa(rg|0,1028,qP|0,rP|0);l=a[d>>2];d=a[(a[a[sd>>2]+220>>2]+8>>2)+(11*e|0)];(l|0)>(d|0)&&S();(e|0)<(D[b+244>>1]<<16>>16|0)&&S();(e|0)>(D[b+246>>1]<<16>>16|0)&&S();g=a[g];((l<<2)+a[(g+4>>2)+(11*e|0)]|0)>>>0>((d<<2)+a[(g+12>>2)+(11*e|0)]|0)>>>0?S():h=f}function Px(c,d){var i,g=0<(d|0),e=a[c>>2];if(0==(e|0)){var h;return 0}var j=0,k=0;a:for(;;){var k=k+1|0,n=a[c+(k<<2)>>2],m=0==(n|0);b:do{if(g){if(m){h=j;i=436;break a}for(var p=a[a[e+12>>2]+240>>2],s=e+28|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),v=e+162|0,t=j,u=k,w=n;;){var A=w+28|0,t=0>(a[a[w+12>>2]+240>>2]-p|0)*((b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])-s)?(D[w+162>>1]<<16>>16)*(D[v>>1]<<16>>16)+t|0:t,u=u+1|0,w=a[c+(u<<2)>>2];if(0==(w|0)){var B=t;break b}}}else{if(m){h=j;i=437;break a}p=a[a[e+16>>2]+240>>2];s=e+68|0;s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]);v=e+162|0;t=j;u=k;for(w=n;;){if(A=w+68|0,t=0>(a[a[w+16>>2]+240>>2]-p|0)*((b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])-s)?(D[w+162>>1]<<16>>16)*(D[v>>1]<<16>>16)+t|0:t,u=u+1|0,w=a[c+(u<<2)>>2],0==(w|0)){B=t;break b}}}}while(0);if(m){h=B;i=438;break}else{j=B,e=n}}if(436==i||437==i||438==i){return h}}function vq(b,c,d){var g=a[c+216>>2],f=a[d+216>>2],e=(g|0)!=(f|0);if(m[rq]){if(e){return 1}}else{if(!(0==(g|0)|e^1|0==(f|0))){return 7==m[c+165|0]<<24>>24&&1==m[c+162|0]<<24>>24||7==m[d+165|0]<<24>>24&&1==m[d+162|0]<<24>>24?0:1}}g=a[(a[b+220>>2]+40>>2)+(11*a[c+236>>2]|0)];if(0==(g|0)){return 0}b=0==(a[b+152>>2]&1|0);return c=m[a[g+8>>2]+a[g+4>>2]*a[(b?c:d)+284>>2]+a[(b?d:c)+284>>2]|0]<<24>>24}function vm(c,d){var i,g=a[d>>2];if(0==(g|0)){var e;return 0}for(var h=a[c+176>>2],j=a[h>>2],k=0==(j|0),n=d,m=0;;){var p=D[g+162>>1]<<16>>16,s=a[a[g+16>>2]+240>>2];a:do{if(k){var v=m}else{for(var t=g+28|0,u=h,w=m,A=j;;){var B=a[a[A+16>>2]+240>>2];if(0<(B-s|0)){i=464}else{if((B|0)!=(s|0)){var C=w}else{A=A+28|0,(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])>(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])?i=464:C=w}}464==i&&(i=0,C=(D[a[u>>2]+162>>1]<<16>>16)*p+w|0);u=u+4|0;A=a[u>>2];if(0==(A|0)){v=C;break a}else{w=C}}}}while(0);n=n+4|0;g=a[n>>2];if(0==(g|0)){e=v;break}else{m=v}}return e}function wm(c,d){var i,g=a[d>>2];if(0==(g|0)){var e;return 0}for(var h=a[c+184>>2],j=a[h>>2],k=0==(j|0),n=d,m=0;;){var p=D[g+162>>1]<<16>>16,s=a[a[g+12>>2]+240>>2];a:do{if(k){var v=m}else{for(var t=g+68|0,u=h,w=m,A=j;;){var B=a[a[A+12>>2]+240>>2];if(0<(B-s|0)){i=477}else{if((B|0)!=(s|0)){var C=w}else{A=A+68|0,(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])>(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])?i=477:C=w}}477==i&&(i=0,C=(D[a[u>>2]+162>>1]<<16>>16)*p+w|0);u=u+4|0;A=a[u>>2];if(0==(A|0)){v=C;break a}else{w=C}}}}while(0);n=n+4|0;g=a[n>>2];if(0==(g|0)){e=v;break}else{m=v}}return e}function sP(b){for(b>>=2;;){var c=a[b+32];if(0==(c|0)){break}else{b=c,b>>=2}}return(a[a[b+4]+216>>2]|0)!=(a[a[b+3]+216>>2]|0)&1}function lP(b,c){var d=a[b+240>>2];return 0<=(c|0)?d=a[a[(a[a[sd>>2]+220>>2]+4>>2)+(11*a[b+236>>2]|0)]+(d+1<<2)>>2]:0>=(d|0)?0:d=a[a[(a[a[sd>>2]+220>>2]+4>>2)+(11*a[b+236>>2]|0)]+(d-1<<2)>>2]}function oP(b,c,d){var g,f,e,h;h=(b+220|0)>>2;m[a[h]+44*c+32|0]=0;var k=0<(c|0),j=c+1|0,d=0!=(d|0),z=b+244|0,p=c-1|0,s=b+246|0;e=g=0;a:for(;;){for(f=e;;){var v=a[h];if((f|0)>=(a[(v>>2)+(11*c|0)]-1|0)){break a}var t=a[(v+4>>2)+(11*c|0)],v=a[t+(f<<2)>>2];e=v>>2;var u=f+1|0,t=a[t+(u<<2)>>2];f=t>>2;(a[e+60]|0)<(a[f+60]|0)||sa(rg|0,523,tP|0,Qx|0);if(0!=(vq(b,v,t)|0)){f=u}else{if(k){var w=vm(v,a[f+44]),A=vm(t,a[e+44])}else{w=A=0}0<(a[(a[h]>>2)+(11*j|0)]|0)&&(w=wm(v,a[f+46])+w|0,A=wm(t,a[e+46])+A|0);if((A|0)<(w|0)){break}if(d&0<(w|0)&(A|0)==(w|0)){break}else{f=u}}}um(v,t);e=w-A+g|0;g=(a[sd>>2]+220|0)>>2;m[a[g]+44*c+33|0]=0;m[a[h]+44*c+32|0]=1;(D[z>>1]<<16>>16|0)<(c|0)&&(m[a[g]+44*p+33|0]=0,m[a[h]+44*p+32|0]=1);(D[s>>1]<<16>>16|0)>(c|0)&&(m[a[g]+44*j+33|0]=0,m[a[h]+44*j+32|0]=1);g=e;e=u}return g}function sq(b){var c=h,d=a[Yu>>2];if(0!=(d|0)|0!=(a[El>>2]|0)){if(d=jc(b|0,d,0),0==(d|0)){var g=a[b+36>>2],d=a[g+20>>2],g=Ib(d,g),f=0==(g|0);a:do{if(!f){for(var e=g;;){var l=Yd(a[e+12>>2]);0==(0==(td(a[l+12>>2],Rx|0,7)|0)&1|0)&&sq(l);e=yb(d,e);if(0==(e|0)){break a}}}}while(0);if(0!=(a[El>>2]|0)){d=h;g=ra(b);if(0!=(g|0)){for(;;){f=g;e=jc(g|0,a[El>>2],0);l=0==(e|0);a:do{if(!l){var k=m[e];do{if(105==k<<24>>24){if(0==(ka(e,Ep|0)|0)){wq(b,f,0);break a}}else{if(111==k<<24>>24){if(0==(ka(e,Sx|0)|0)){wq(b,f,1);break a}}else{if(0==k<<24>>24){break a}}}}while(0);k=a[g+12>>2];la(1,uP|0,(j=h,h+=8,a[j>>2]=e,a[j+4>>2]=k,j))}}while(0);g=ba(b,g);if(0==(g|0)){break}}}h=d}}else{g=m[d];if(111==g<<24>>24){if(0==(ka(d,Sx|0)|0)){vP(b,1);h=c;return}}else{if(105==g<<24>>24){if(0==(ka(d,Ep|0)|0)){vP(b,0);h=c;return}}else{if(0==g<<24>>24){h=c;return}}}la(1,wP|0,(j=h,h+=4,a[j>>2]=d,j))}}h=c}function vP(a,b){var c=ra(a);if(0!=(c|0)){for(;!(wq(a,c,b),c=ba(a,c),0==(c|0));){}}}function wq(b,c,d){var g,f=a[om>>2];g=f>>2;if(0==(a[c+216>>2]|0)){d=0!=(d|0);a:do{if(d){var e=c+184|0,h=a[e>>2],k=a[h>>2];if(0==(k|0)){return}for(var j=0,z=0;;){if(0==(sP(k)|0)&&(a[(j<<2>>2)+g]=k,j=j+1|0,h=a[e>>2]),z=z+1|0,k=a[h+(z<<2)>>2],0==(k|0)){var p=j;break a}}}else{e=c+176|0;h=a[e>>2];k=a[h>>2];if(0==(k|0)){return}for(z=j=0;;){if(0==(sP(k)|0)&&(a[(j<<2>>2)+g]=k,j=j+1|0,h=a[e>>2]),z=z+1|0,k=a[h+(z<<2)>>2],0==(k|0)){p=j;break a}}}}while(0);if(2<=(p|0)){a[(p<<2>>2)+g]=0;ch(f,p,120);for(c=1;;){p=a[(c<<2>>2)+g];if(0==(p|0)){break}f=a[(c-1<<2>>2)+g];d?(p=p+12|0,f=f+12|0):(p=p+16|0,f=f+16|0);p=a[p>>2];f=a[f>>2];if(0!=(oN(f,p)|0)){break}f=pq(f,p,0);m[f+124|0]=4;gm(b,f);c=c+1|0}}}}function Lx(a,b){return(0==m[b+162|0]<<24>>24?0!=(Ed(a,b|0)|0):0)&1}function Mx(b,c){do{if(1==m[c+162|0]<<24>>24&&1==(a[c+180>>2]|0)&&1==(a[c+188>>2]|0)){for(var d=a[c+184>>2];;){var g=a[d>>2];if(0==m[g+124|0]<<24>>24){break}else{d=g+128|0}}if(0!=(Ed(b,g|0)|0)){return d=1}}}while(0);return 0}function Hx(c){if(0!=(c|0)){for(;;){var d=c+32|0;f[0]=a[c+240>>2]|0;a[d>>2]=b[0];a[d+4>>2]=b[1];c=a[c+168>>2];if(0==(c|0)){break}}}}function Jx(b){var c,d=D[b+244>>1],g=b+246|0;if(d<<16>>16<=D[g>>1]<<16>>16){c=(b+220|0)>>2;for(var d=d<<16>>16,f=a[c];;){var e=0<(a[(f>>2)+(11*d|0)]|0);a:do{if(e){for(var h=0,k=0,j=f;;){var z=a[a[(j+4>>2)+(11*d|0)]+(k<<2)>>2];m[z+164|0]=0;m[z+163|0]=0;a[z+284>>2]=k;if(0<(a[z+196>>2]|0)&0==(h|0)){var p=a[(a[c]>>2)+(11*d|0)],z=p,s=cc,h=fa(12),s=h>>2;a[s]=z;a[s+1]=p;a[s+2]=fa(p*z|0);a[(a[c]+40>>2)+(11*d|0)]=h;z=1}else{z=h}k=k+1|0;p=a[c];s=a[(p>>2)+(11*d|0)];if((k|0)<(s|0)){h=z,j=p}else{break}}if(0!=(z|0)&0<(s|0)){k=0;for(h=p;;){if(j=a[a[(h+4>>2)+(11*d|0)]+(k<<2)>>2],0==m[j+163|0]<<24>>24&&(Tx(b,j),h=a[c]),k=k+1|0,(k|0)>=(a[(h>>2)+(11*d|0)]|0)){v=h;break a}}}else{var v=p}}else{v=f}}while(0);d=d+1|0;if((d|0)>(D[g>>1]<<16>>16|0)){break}else{f=v}}}}function Kx(b){var c;if(0!=m[b+248|0]<<24>>24){var d=D[b+244>>1],g=b+246|0;if(d<<16>>16<=D[g>>1]<<16>>16){c=(b+220|0)>>2;for(var f=b+152|0,e=0,d=d<<16>>16;;){var h=a[c];if(0<(a[(h>>2)+(11*d|0)]|0)){for(var j=0;;){m[a[a[(h+4>>2)+(11*d|0)]+(j<<2)>>2]+163|0]=0;var n=j+1|0,h=a[c];if((n|0)<(a[(h>>2)+(11*d|0)]|0)){j=n}else{break}}j=(n<<2)+4|0}else{j=4}var e=j=0==(e|0)?Cb(j):wb(e,j),h=a[c],z=0<(a[(h>>2)+(11*d|0)]|0);a:do{if(z){for(var p=0,s=0,v=h;;){var t=a[a[(v+4>>2)+(11*d|0)]+(s<<2)>>2],u=t+204|0,w=a[u>>2],v=0<(w|0);b:do{if(v){for(var A=t+200|0,B=0,C=0,y=w;;){var F=a[a[A>>2]+(C<<2)>>2];0<ib[F+164>>2]&&(B=(0!=(Lx(b,a[F+16>>2])|Mx(b,a[F+16>>2])|0)&1)+B|0,y=a[u>>2]);C=C+1|0;if((C|0)>=(y|0)){var E=B;break b}}}else{E=0}}while(0);u=t+196|0;w=a[u>>2];v=0<(w|0);b:do{if(v){A=t+192|0;C=B=0;for(y=w;;){if(F=a[a[A>>2]+(C<<2)>>2],0<ib[F+164>>2]&&(B=(0!=(Lx(b,a[F+12>>2])|Mx(b,a[F+12>>2])|0)&1)+B|0,y=a[u>>2]),C=C+1|0,(C|0)>=(y|0)){var I=B;break b}}}else{I=0}}while(0);do{if(0==(I|E|0)){a[e+(p<<2)>>2]=t,u=p+1|0}else{if(0!=m[t+163|0]<<24>>24|0!=(E|0)){u=p}else{u=(p<<2)+e|0;w=Ux(b,t,u,d);v=0==(a[f>>2]&1|0);b:do{if(v&&(A=p-1+w|0,(p|0)<(A|0))){A=(A<<2)+e|0;for(B=u;;){if(C=a[B>>2],a[B>>2]=a[A>>2],a[A>>2]=C,B=B+4|0,A=A-4|0,B>>>0>=A>>>0){break b}}}}while(0);u=w+p|0}}}while(0);s=s+1|0;t=a[c];w=a[(t>>2)+(11*d|0)];if((s|0)<(w|0)){p=u,v=t}else{break}}if(0!=(u|0)&0<(w|0)){p=a[sd>>2];s=0;for(v=t;;){var H=a[e+(s<<2)>>2];a[a[(v+4>>2)+(11*d|0)]+(s<<2)>>2]=H;a[H+240>>2]=(a[(a[c]+4>>2)+(11*d|0)]-a[(a[p+220>>2]+4>>2)+(11*d|0)]>>2)+s|0;var s=s+1|0,H=a[c],J=a[(H>>2)+(11*d|0)];if((s|0)<(J|0)){v=H}else{break}}if(0<(J|0)){p=0;for(s=H;;){v=a[a[(s+4>>2)+(11*d|0)]+(p<<2)>>2]+192|0;A=a[v>>2];if(0==(A|0)){B=s}else{if(C=a[A>>2],0==(C|0)){B=s}else{B=0;y=C;for(C=A;!((a[a[y+12>>2]+240>>2]|0)<(a[a[y+16>>2]+240>>2]|0)&&(yx(y),Nx(b,y),B=B-1|0,C=a[v>>2]),B=B+1|0,y=a[C+(B<<2)>>2],0==(y|0));){}B=a[c]}}p=p+1|0;if((p|0)<(a[(B>>2)+(11*d|0)]|0)){s=B}else{break a}}}}}}while(0);m[a[a[sd>>2]+220>>2]+44*d+33|0]=0;d=d+1|0;if((d|0)>(D[g>>1]<<16>>16|0)){break}}0!=(j|0)&&G(j)}}}function dP(c){var d=a[c+216>>2],e=0==(d|0);a:do{if(!e){for(var g=d;;){var h=g+32|0;a[g+240>>2]=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0])&-1;g=a[g+168>>2];if(0==(g|0)){break a}}}}while(0);e=D[c+244>>1];d=c+246|0;if(e<<16>>16<=D[d>>1]<<16>>16){c=c+220|0;for(e=e<<16>>16;!(m[a[a[sd>>2]+220>>2]+44*e+33|0]=0,g=a[c>>2],ch(a[(g+4>>2)+(11*e|0)],a[(g>>2)+(11*e|0)],380),e=e+1|0,(e|0)>(D[d>>1]<<16>>16|0));){}}}function hP(b){var c,d,g,f=D[b+246>>1],e=b+244|0;if(f<<16>>16>=D[e>>1]<<16>>16){g=(b+220|0)>>2;for(var f=f<<16>>16,h=a[g];;){m[h+44*f+32|0]=0;var h=a[g],j=0<(a[(h>>2)+(11*f|0)]-1|0);a:do{if(j){for(var n=0<(f|0),z=f+1|0,p=0,s=h;;){var v=a[(s+4>>2)+(11*f|0)],s=a[v+(p<<2)>>2];d=s>>2;p=p+1|0;v=a[v+(p<<2)>>2];c=v>>2;(a[d+60]|0)<(a[c+60]|0)||sa(rg|0,474,xP|0,Qx|0);if(0==(vq(b,s,v)|0)){if(n){var t=vm(s,a[c+44]),u=vm(v,a[d+44])}else{u=t=0}0<(a[(a[g]>>2)+(11*z|0)]|0)?(c=wm(s,a[c+46])+t|0,d=wm(v,a[d+46])+u|0):(c=t,d=u);(d|0)>(c|0)||yP(b,f,s,v)}s=a[g];if((p|0)>=(a[(s>>2)+(11*f|0)]-1|0)){var w=s;break a}}}else{w=h}}while(0);f=f-1|0;if((f|0)<(D[e>>1]<<16>>16|0)){break}else{h=w}}}}function yP(b,c,d,g){var f,e=m[d+162|0];if(e<<24>>24!=m[g+162|0]<<24>>24){var b=b+220|0,h=a[b>>2],j=a[(h>>2)+(11*c|0)],n=0<(j|0);do{if(n){for(var z=a[(h+4>>2)+(11*c|0)],p=0,s=0,v=0;;){var t=0==m[a[z+(v<<2)>>2]+162|0]<<24>>24&1,u=t+p|0,t=(t^1)+s|0,v=v+1|0;if((v|0)<(j|0)){p=u,s=t}else{break}}z=0==e<<24>>24;if((u|0)<(t|0)){var w=z?d:g}else{var A=z;f=724}}else{A=0==e<<24>>24,f=724}}while(0);724==f&&(w=A?g:d);f=h+44*c+4|0;a:do{if(n){e=a[f>>2];for(u=0;;){var B;B=(a[e+(u<<2)>>2]|0)==(w|0)?u:B;u=u+1|0;if((u|0)>=(j|0)){var C=B,y=f;break a}}}else{y=f}}while(0);B=0==m[w+162|0]<<24>>24&1;f=C;for(n=0;;){e=f-1|0;if(0>=(f|0)){var D=C,F=0;break}if((m[a[a[y>>2]+(e<<2)>>2]+162|0]<<24>>24|0)==(B|0)){f=e,n=n+1|0}else{D=C;F=0;break}}for(;;){D=D+1|0;if((D|0)>=(j|0)){break}if((m[a[a[y>>2]+(D<<2)>>2]+162|0]<<24>>24|0)==(B|0)){F=F+1|0}else{break}}um(d,g);j=a[b>>2];y=a[(j>>2)+(11*c|0)];b=0<(y|0);c=j+44*c+4|0;a:do{if(b){j=a[c>>2];D=C;for(f=0;;){if(D=(a[j+(f<<2)>>2]|0)==(w|0)?f:D,f=f+1|0,(f|0)>=(y|0)){var E=D,G=c;break a}}}else{E=C,G=c}}while(0);C=E;for(w=0;;){c=C-1|0;if(0>=(C|0)){var I=E,H=0;break}if((m[a[a[G>>2]+(c<<2)>>2]+162|0]<<24>>24|0)==(B|0)){C=c,w=w+1|0}else{I=E;H=0;break}}for(;;){E=I+1|0;if((E|0)>=(y|0)){break}if((m[a[a[G>>2]+(E<<2)>>2]+162|0]<<24>>24|0)==(B|0)){I=E,H=H+1|0}else{break}}G=w-H|0;F=n-F|0;((-1<(G|0)?G:-G|0)|0)>((-1<(F|0)?F:-F|0)|0)&&um(d,g)}}function zP(b){var c,d,b=b>>2;if(0<(a[b+51]|0)){d=a[b+50]>>2;var g=a[a[d]+16>>2],f=a[d+1],e=0==(f|0);a:do{if(e){c=g}else{for(var h=1,j=g,n=f;;){if(n=a[n+16>>2],j=(a[n+240>>2]|0)>(a[j+240>>2]|0)?n:j,h=h+1|0,n=a[(h<<2>>2)+d],0==(n|0)){c=j;break a}}}}while(0);c=a[c+244>>2];if(-1>=(c|0)){return 1}a[b+61]=c+1|0;return 0}if(0>=(a[b+49]|0)){return 1}c=a[b+48]>>2;g=a[a[c]+12>>2];f=a[c+1];e=0==(f|0);a:do{if(e){d=g}else{h=1;j=g;for(n=f;;){if(n=a[n+12>>2],j=(a[n+240>>2]|0)<(a[j+240>>2]|0)?n:j,h=h+1|0,n=a[(h<<2>>2)+c],0==(n|0)){d=j;break a}}}}while(0);c=a[d+244>>2];if(0>=(c|0)){return 1}a[b+61]=c-1|0;return 0}function gP(b,c,d){var g,f,e,h=a[pm>>2];f=h>>2;var b=(b+220|0)>>2,j=a[b],n=a[(j+4>>2)+(11*c|0)];if(0>=(a[(j>>2)+(11*c|0)]|0)){var z;return 0}for(var d=(d|0)>(c|0),j=h+4|0,p=0;;){var s=a[n+(p<<2)>>2];g=s>>2;a:do{if(d){var v=s+184|0,t=a[v>>2],u=a[t>>2];if(0==(u|0)){e=778}else{for(var w=0,A=0;;){if(0<D[u+162>>1]<<16>>16&&(a[(A<<2>>2)+f]=m[u+100|0]&255|a[a[u+12>>2]+240>>2]<<8,A=A+1|0,t=a[v>>2]),w=w+1|0,u=a[t+(w<<2)>>2],0==(u|0)){var B=A;e=777;break a}}}}else{if(v=s+176|0,t=a[v>>2],u=a[t>>2],0==(u|0)){e=778}else{for(A=w=0;;){if(0<D[u+162>>1]<<16>>16&&(a[(A<<2>>2)+f]=m[u+60|0]&255|a[a[u+16>>2]+240>>2]<<8,A=A+1|0,t=a[v>>2]),w=w+1|0,u=a[t+(w<<2)>>2],0==(u|0)){B=A;e=777;break a}}}}}while(0);777==e&&(e=0,0==(B|0)?e=778:2==(B|0)?a[g+61]=(a[j>>2]+a[f]|0)/2&-1:1==(B|0)?a[g+61]=a[f]:(ch(h,B,18),w=(B|0)/2&-1,0!=(B&1|0)?a[g+61]=a[(w<<2>>2)+f]:(s=a[(w<<2>>2)+f],v=a[(B-1<<2>>2)+f]-s|0,w=a[(w-1<<2>>2)+f],A=w-a[f]|0,a[g+61]=(A|0)==(v|0)?(w+s|0)/2&-1:(A*s+w*v|0)/(A+v|0)&-1)));778==e&&(e=0,a[g+61]=-1);p=p+1|0;g=a[b];s=a[(g>>2)+(11*c|0)];if((p|0)>=(s|0)){break}}if(0<(s|0)){e=f=0,h=g}else{return 0}for(;;){if(B=a[n+(f<<2)>>2],0==(a[B+188>>2]|0)&&0==(a[B+180>>2]|0)&&(e=(zP(B)|e&255)&255,h=a[b]),f=f+1|0,(f|0)>=(a[(h>>2)+(11*c|0)]|0)){z=e;break}}return z}function fP(b,c,d,g){var f,e=a[b+220>>2],h=a[(e+4>>2)+(11*c|0)],j=a[(e>>2)+(11*c|0)];if(0<(j|0)){for(var e=0==(d|0),d=0==(g|d|0),n=0,g=(j<<2)+h|0;;){var j=j-1|0,z=h,p=n;a:for(;;){n=z;b:for(;;){if(n>>>0>=g>>>0){break a}for(;;){if(n>>>0>=g>>>0){break a}var s=a[n>>2],v=a[s+244>>2];if(0>(v|0)){n=n+4|0}else{var t=n,u=0;break}}for(;;){n=0==u<<24>>24;for(z=t;;){var w=z+4|0;if(w>>>0>=g>>>0){break a}var A=a[w>>2];f=A>>2;if(n){break}if(0==(a[f+54]|0)){break}else{z=w}}if(0!=(vq(b,s,A)|0)){n=w;continue b}var B=a[f+61];if(-1<(B|0)){break}t=w;u=0==(a[f+54]|0)?u:1}if((v|0)<=(B|0)&((v|0)!=(B|0)|e)){n=w}else{break}}um(s,A);z=w;p=p+1|0}if(0<(j|0)){n=p,g=d?g-4|0:g}else{break}}0!=(p|0)&&(b=a[sd>>2]+220|0,m[a[b>>2]+44*c+33|0]=0,0<(c|0)&&(m[a[b>>2]+44*(c-1)+33|0]=0))}}function Ux(b,c,d,g){m[c+163|0]=1;var f=0<(a[c+196>>2]|0);a:do{if(f){var e=c+192|0,h=a[a[e>>2]>>2];if(0==(h|0)){var j=0}else{for(var n=b,z=0,p=0;;){if(0!=ib[h+164>>2]){var s=h+12|0,v=a[s>>2];0==m[v+162|0]<<24>>24&0==(Ed(n,v|0)|0)||(s=a[s>>2],p=(a[s+216>>2]|0)!=(a[a[h+16>>2]+216>>2]|0)?p:0!=m[s+163|0]<<24>>24?p:Ux(b,s,(p<<2)+d|0,g)+p|0)}z=z+1|0;h=a[a[e>>2]+(z<<2)>>2];if(0==(h|0)){j=p;break a}}}}else{j=0}}while(0);if((a[c+236>>2]|0)==(g|0)){return a[((j<<2)+d|0)>>2]=c,j+1|0}sa(rg|0,1161,AP|0,BP|0);a[((j<<2)+d|0)>>2]=c;return j+1|0}function Tx(b,c){var d,g,f,e,h=a[(a[b+220>>2]+40>>2)+(11*a[c+236>>2]|0)];m[c+163|0]=1;var j=c+164|0;m[j]=1;var n=0<(a[a[b+32>>2]+208>>2]|0),z=c+192|0;f=a[z>>2];if(0!=(f|0)){var p=a[f>>2];if(0!=(p|0)){var s=h|0;f=(h+4|0)>>2;var h=h+8|0,v=0;for(g=p>>2;;){n?0==(Ed(b,a[g+4]|0)|0)?d=v:0==(Ed(b,a[g+3]|0)|0)?d=v:e=842:e=842;if(842==e){e=0;if(0!=ib[g+41]){d=(p+12|0)>>2;g=a[d];var t=(a[g+284>>2]|0)<(a[s>>2]|0);if(1==m[g+164|0]<<24>>24){t||sa(rg|0,933,xm|0,Vx|0);g=p+16|0;var t=a[a[g>>2]+284>>2],u=a[f];(t|0)<(u|0)?g=t:(sa(rg|0,934,xm|0,Wx|0),u=a[f],g=a[a[g>>2]+284>>2]);m[a[h>>2]+g+u*a[a[d]+284>>2]|0]=1;yx(p);v=v-1|0;4!=m[p+124|0]<<24>>24&&Nx(b,p)}else{t||sa(rg|0,942,xm|0,Vx|0),g=p+16|0,t=a[a[g>>2]+284>>2],p=a[f],(t|0)<(p|0)?g=t:(sa(rg|0,943,xm|0,Wx|0),g=a[a[g>>2]+284>>2],p=a[f]),m[a[h>>2]+a[a[d]+284>>2]+p*g|0]=1,d=a[d],0==m[d+163|0]<<24>>24&&Tx(b,d)}}d=v}v=d+1|0;p=a[a[z>>2]+(v<<2)>>2];if(0==(p|0)){break}else{g=p>>2}}}}m[j]=0}function zO(c,d){if(0!=(a[c+216>>2]|0)){Tw(c);Xx(c);0!=m[Wi]<<24>>24&&SN(c);var e;CP(c);e=a[c+216>>2];if(0!=(e|0)){for(e>>=2;;){var g=a[e+57];0!=(g|0)&&Yx(c,g);g=a[e+58];0!=(g|0)&&Yx(c,g);var g=a[e+52],h=0==(g|0);a:do{if(!h){for(var j=0;;){if(0==(a[g+(j<<2)>>2]|0)){break a}else{j=j+1|0}}}}while(0);e=a[e+42];if(0==(e|0)){break}else{e>>=2}}}0!=(RO(c)|0)&&Xx(c);DP(a[c+216>>2]);EP(c);FP(c);0<(a[c+208>>2]|0)&&(GP(c),Zx(c),HP(c),$x(c));g=a[c+44>>2];3==(a[g+84>>2]|0)&&(e=g+64|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),g=g+72|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),1<e*g&&(ay(c),e=0==(a[c+152>>2]&1|0)?e:g,Zc(a[c+264>>2],a[c+268>>2],65535>e?e:65535,1e3)));0!=(Oo(c,2,IP(c))|0)&&(JP(c),0!=(Oo(c,2,IP(c))|0)&&sa(by|0,133,KP|0,LP|0));e=a[c+220>>2];h=D[c+244>>1];g=c+246|0;j=D[g>>1];if(h<<16>>16<=j<<16>>16){for(var h=h<<16>>16,l=j;;){j=e+44*h|0;if(0<(a[j>>2]|0)){for(var l=e+44*h+4|0,k=0;;){var n=a[a[l>>2]+(k<<2)>>2],z=n+236|0,n=n+32|0;f[0]=a[z>>2]|0;a[n>>2]=b[0];a[n+4>>2]=b[1];a[z>>2]=h;k=k+1|0;if((k|0)>=(a[j>>2]|0)){break}}j=D[g>>1]}else{j=l}h=h+1|0;if((h|0)>(j<<16>>16|0)){break}else{l=j}}}MP(c,d);NP(c)}}function Xx(c){var d,e,g,h,j=a[c+220>>2];h=j>>2;g=(c+244|0)>>1;var l=D[g];e=(c+246|0)>>1;var k=D[e],n=l<<16>>16>k<<16>>16;a:do{if(!n){for(var z=l<<16>>16,p=k;;){var s=j+44*z|0;if(0<(a[s>>2]|0)){for(var p=j+44*z+4|0,v=j+44*z+28|0,t=j+44*z+20|0,u=j+44*z+24|0,w=j+44*z+16|0,A=0;;){var B=a[a[p>>2]+(A<<2)>>2],C=B+96|0,C=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),C=(((0>C?C-.5:C+.5)&-1)+1|0)/2&-1,y=a[B+208>>2],F=0==(y|0);b:do{if(F){var E=C}else{if(d=a[y>>2],0==(d|0)){E=C}else{var G=C,I=0;for(d>>=2;;){if((a[d+4]|0)==(a[d+3]|0)&&(d=a[d+27],0!=(d|0)&&(G|=0,d=d+32|0,d=.5*(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),G=(G>d?G:d)&-1)),I=I+1|0,d=a[y+(I<<2)>>2],0==(d|0)){E=G;break b}else{d>>=2}}}}}while(0);(a[v>>2]|0)<(E|0)&&(a[t>>2]=E,a[v>>2]=E);(a[u>>2]|0)<(E|0)&&(a[w>>2]=E,a[u>>2]=E);y=a[B+216>>2];0!=(y|0)&&(C=(y|0)==(c|0)?0:8,B=B+236|0,F=a[B>>2],(F|0)==(D[y+244>>1]<<16>>16|0)?(F=y+160|0,I=a[F>>2],G=C+E|0,a[F>>2]=(I|0)>(G|0)?I:G,B=a[B>>2]):B=F,(B|0)==(D[y+246>>1]<<16>>16|0)&&(B=y+156|0,y=a[B>>2],C=C+E|0,a[B>>2]=(y|0)>(C|0)?y:C));A=A+1|0;if((A|0)>=(a[s>>2]|0)){break}}s=D[e]}else{s=p}z=z+1|0;if((z|0)>(s<<16>>16|0)){break a}else{p=s}}}}while(0);j=cy(c);n=D[e]<<16>>16;l=a[a[h+(11*n|0)+1]>>2]+40|0;f[0]=a[h+(11*n|0)+4]|0;a[l>>2]=b[0];a[l+4>>2]=b[1];s=n-1|0;z=D[g];if((s|0)<(z<<16>>16|0)){var H=0,J=z}else{l=c+260|0;k=0;E=n;for(n=s;!(J=a[h+(11*n|0)+6]+a[h+(11*E|0)+7]+a[l>>2]|0,H=a[h+(11*E|0)+5]+a[h+(11*n|0)+4]+8|0,H=(J|0)>(H|0)?J:H,0<(a[h+(11*n|0)]|0)?(J=a[a[h+(11*E|0)+1]>>2]+40|0,J=(b[0]=a[J>>2],b[1]=a[J+4>>2],f[0])+(H|0),E=a[a[h+(11*n|0)+1]>>2]+40|0,f[0]=J,a[E>>2]=b[0],a[E+4>>2]=b[1],J=D[g]):J=z,H=(k|0)>(H|0)?k:H,z=n-1|0,(z|0)<(J<<16>>16|0));){k=H,E=n,n=z,z=J}H|=0}l=c+284|0;k=0==m[l]<<24>>24;a:do{if(!k&&(E=D[e]<<16>>16,n=E-1|0,(n|0)>=(J<<16>>16|0))){for(z=J;;){if(0<(a[h+(11*n|0)]|0)&&(E=a[a[h+(11*E|0)+1]>>2]+40|0,E=(b[0]=a[E>>2],b[1]=a[E+4>>2],f[0])+H,z=a[a[h+(11*n|0)+1]>>2]+40|0,f[0]=E,a[z>>2]=b[0],a[z+4>>2]=b[1],z=D[g]),s=n-1|0,(s|0)<(z<<16>>16|0)){break a}else{E=n,n=s}}}}while(0);0!=(j|0)&&0!=(a[c+152>>2]&1|0)&&dy(c,m[l]&255);c=a[c+216>>2];if(0!=(c|0)){for(;!(e=a[a[h+(11*a[c+236>>2]|0)+1]>>2]+40|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),g=c+40|0,f[0]=e,a[g>>2]=b[0],a[g+4>>2]=b[1],c=a[c+168>>2],0==(c|0));){}}}function IP(a){var b=V(a|0,OP|0);return 0==(b|0)?2147483647:a=wg(b,xc)*Vh(a)&-1}function JP(b){var c,d=D[b+244>>1],g=b+246|0,f=D[g>>1];if(d<<16>>16<=f<<16>>16){for(var e=b+220|0,d=d<<16>>16;;){var h=a[e>>2],j=a[(h>>2)+(11*d|0)],n=h+44*d+4|0,z=0,p=0;a:for(;;){if((z|0)>=(j|0)){c=957;break}var s=a[a[n>>2]+(z<<2)>>2],v=a[s+256>>2],t=0==(v|0);b:do{if(!t){for(var u=0;;){var w=a[v+(u<<2)>>2];if(0==(w|0)){break b}if((a[a[w+12>>2]+236>>2]|0)>(d|0)){var A=f;break a}if((a[a[w+16>>2]+236>>2]|0)>(d|0)){A=f;break a}else{u=u+1|0}}}}while(0);v=a[s+248>>2];t=0==(v|0);b:do{if(!t){for(u=0;;){w=a[v+(u<<2)>>2];if(0==(w|0)){break b}if((a[a[w+16>>2]+236>>2]|0)>(d|0)){A=f;break a}if((a[a[w+12>>2]+236>>2]|0)>(d|0)){A=f;break a}else{u=u+1|0}}}}while(0);z=z+1|0;p=s}957==c&&(c=0,0==(p|0)?A=f:(A=a[a[n>>2]>>2],h=a[a[(h+4>>2)+(11*(((d|0)<(f<<16>>16|0)?1:-1)+d)|0)]>>2],0==(h|0)&&sa(by|0,110,PP|0,QP|0),f=Lf(b),m[f+162|0]=2,Zc(f,A,0,0),Zc(f,h,0,0),A=a[A+236>>2],h=a[h+236>>2],a[f+236>>2]=(A|0)<(h|0)?A:h,A=D[g>>1]));d=d+1|0;if((d|0)>(A<<16>>16|0)){break}else{f=A}}}}function MP(c,d){var e,g,h;RP(c,c);var j=0<D[c+246>>1]<<16>>16;a:do{if(j){var l=c+44|0,k=a[l>>2];e=a[k+84>>2];if(0!=(e|0)){h=(c+68|0)>>2;g=c+52|0;var n=(b[0]=a[h],b[1]=a[h+1],f[0])-(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])&-1;g=(c+76|0)>>2;var m=c+60|0,p=(b[0]=a[g],b[1]=a[g+1],f[0])-(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0])&-1,m=c+152|0,s=0==(a[m>>2]&1|0),v=s?p:n,n=s?n:p;4==(e|0)?(e=SP(c),l=a[l>>2]):(e=2==(e|0)&1,l=k);do{if(0==e<<24>>24){if(k=a[l+84>>2],5==(k|0)){k=l+64|0;k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);if(0>=k){break a}k/=(b[0]=a[h],b[1]=a[h+1],f[0]);p=l+72|0;p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])/(b[0]=a[g],b[1]=a[g+1],f[0]);if(!(1<k&1<p)){break a}k=p=k<p?k:p}else{if(1==(k|0)){k=l+16|0,p=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),s=(v|0)/(n|0),s<p?(k=1,p/=s):(k=s/p,p=1)}else{break a}}}else{k=l+64|0;k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);if(0>=k){break a}p=k/(n|0);k=l+72|0;s=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])/(v|0);1>p|1>s?p<s?(k=1,p=s/p):(k=p/s,p=1):(k=p,p=s)}}while(0);h=(g=0==(a[m>>2]&1|0))?p:k;g=g?k:p;m=a[c+216>>2];v=0==(m|0);b:do{if(!v){for(n=m;;){if(e=(n+32|0)>>2,l=(b[0]=a[e],b[1]=a[e+1],f[0])*g,f[0]=(0>l?l-.5:l+.5)&-1|0,a[e]=b[0],a[e+1]=b[1],e=(n+40|0)>>2,l=(b[0]=a[e],b[1]=a[e+1],f[0])*h,f[0]=(0>l?l-.5:l+.5)&-1|0,a[e]=b[0],a[e+1]=b[1],n=a[n+168>>2],0==(n|0)){break b}}}}while(0);TP(c,g,h)}}}while(0);0!=(d|0)&&UP(c,d)}function NP(b){var b=(b+216|0)>>2,c=a[b];do{if(0==(c|0)){var d=0,g=0}else{for(d=c;;){var g=d+184|0,f=g|0,e=a[f>>2],h=a[e>>2],j=0==(h|0);a:do{if(j){var n=e}else{for(var z=0,p=h;;){G(p|0);var z=z+1|0,s=a[f>>2],p=a[s+(z<<2)>>2];if(0==(p|0)){n=s;break a}}}}while(0);0!=(n|0)&&G(n);f=d+176|0;e=a[f>>2];0!=(e|0)&&G(e);e=d+256|0;h=a[e+4>>2];a[g>>2]=a[e>>2];a[g+4>>2]=h;g=d+248|0;e=a[g+4>>2];a[f>>2]=a[g>>2];a[f+4>>2]=e;d=a[d+168>>2];if(0==(d|0)){break}}d=0;g=a[b]}}while(0);a:for(;;){n=0==(d|0);c=d+168|0;for(f=g;;){if(0==(f|0)){break a}e=a[f+168>>2];if(2!=m[f+162|0]<<24>>24){d=f;g=e;continue a}n?a[b]=e:a[c>>2]=e;G(f|0);f=e}}a[a[b]+172>>2]=0}function Zc(b,c,d,g){var f=fa(184);a[f+16>>2]=b;a[f+12>>2]=c;65535<d&&VP(d);D[f+178>>1]=(0>d?d-.5:d+.5)&65535;ib[f+164>>2]=g|0;xx(f);return f}function VP(c){la(1,WP|0,(j=h,h+=12,f[0]=c,a[j>>2]=b[0],a[j+4>>2]=b[1],a[j+8>>2]=65535,j));Pe()}function fm(c,d){var e=m[c+96|0];if(e<<24>>24!=m[d+96|0]<<24>>24){return 0}var g=c+68|0,h=d+68|0;if((b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])==(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0])){if(g=c+76|0,h=d+76|0,!((b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])==(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0])|0==e<<24>>24)){return 0}}else{if(0!=e<<24>>24){return 0}}e=c+28|0;g=d+28|0;if((b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])==(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])){if(e=c+36|0,g=d+36|0,(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])==(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])){return 1}}e=0==m[c+56|0]<<24>>24;return e&1}function XP(c,d,e,g,h){var j=c|0;f[0]=d-g;a[j>>2]=b[0];a[j+4>>2]=b[1];c=c+8|0;f[0]=e-h;a[c>>2]=b[0];a[c+4>>2]=b[1]}function YP(c,d){var e,g=(a[c+32>>2]|0)==(c|0);a:do{if(g){var h=D[c+244>>1],j=D[c+246>>1],l=h<<16>>16>j<<16>>16;b:do{if(l){var k=-2147483647,n=2147483647}else{for(var z=a[c+220>>2],p=j<<16>>16,s=-2147483647,v=2147483647,t=h<<16>>16;;){var u=a[(z>>2)+(11*t|0)];do{if(0==(u|0)){e=v;var w=s}else{if(e=a[(z+4>>2)+(11*t|0)]>>2,w=a[e],0==(w|0)){e=v,w=s}else{var A=m[w+162|0],B=0!=A<<24>>24&1<(u|0);c:do{if(B){for(var y=1;;){var F=a[(y<<2>>2)+e],y=y+1|0,E=m[F+162|0];if(!(0!=E<<24>>24&(y|0)<(u|0))){var G=F,H=E;break c}}}else{G=w,H=A}}while(0);if(0!=H<<24>>24){e=v,w=s}else{w=G+32|0;A=G+104|0;w=(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0])-(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])&-1|0;w=v<w?v:w;A=a[(u-1<<2>>2)+e];B=0==m[A+162|0]<<24>>24;c:do{if(B){var I=A}else{for(F=u-2|0;;){if(y=a[(F<<2>>2)+e],0==m[y+162|0]<<24>>24){I=y;break c}else{F=F-1|0}}}}while(0);e=I+32|0;A=I+112|0;A=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])+(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])&-1|0;e=w;w=s>A?s:A}}}}while(0);t=t+1|0;if((t|0)>(p|0)){k=w;n=e;break b}else{s=w,v=e}}}}while(0);l=a[c+208>>2];if(1>(l|0)){var J=n,O=k,K=j,L=h}else{z=a[c+212>>2];p=k;v=n;for(s=1;;){if(t=a[z+(s<<2)>>2],u=t+52|0,u=(b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])-8&-1|0,v=v<u?v:u,t=t+68|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])+8&-1|0,p=p>t?p:t,s=s+1|0,(s|0)>(l|0)){J=v;O=p;K=j;L=h;break a}}}}else{J=a[a[c+264>>2]+236>>2]|0,O=a[a[c+268>>2]+236>>2]|0,K=D[c+246>>1],L=D[c+244>>1]}}while(0);g=a[d+220>>2];K=a[a[(g+4>>2)+(11*(K<<16>>16)|0)]>>2]+40|0;K=(b[0]=a[K>>2],b[1]=a[K+4>>2],f[0])-(a[c+156>>2]|0);L=a[a[(g+4>>2)+(11*(L<<16>>16)|0)]>>2]+40|0;L=(b[0]=a[L>>2],b[1]=a[L+4>>2],f[0])+(a[c+160>>2]|0);g=c+52|0;f[0]=J;a[g>>2]=b[0];a[g+4>>2]=b[1];J=c+60|0;f[0]=K;a[J>>2]=b[0];a[J+4>>2]=b[1];J=c+68|0;f[0]=O;a[J>>2]=b[0];a[J+4>>2]=b[1];O=c+76|0;f[0]=L;a[O>>2]=b[0];a[O+4>>2]=b[1]}function CP(b){var c=D[b+244>>1],d=b+246|0;if(c<<16>>16<=D[d>>1]<<16>>16){b=(b+220|0)>>2;for(c=c<<16>>16;;){var g=a[b],f=a[(g>>2)+(11*c|0)],e=0<(f|0);a:do{if(e){for(var h=0,j=0,n=g;;){n=a[a[(n+4>>2)+(11*c|0)]+(j<<2)>>2];a[n+240>>2]=h;var h=(6==m[n+165|0]<<24>>24?a[n+220>>2]:1)+h|0,j=j+1|0,n=a[b],z=a[(n>>2)+(11*c|0)];if((j|0)>=(z|0)){var p=h,s=n,v=z;break a}}}else{p=0,s=g,v=f}}while(0);if((p|0)>(v|0)){g=a[(s+4>>2)+(11*c|0)];g=0==(g|0)?Cb((p<<2)+4|0):wb(g,(p<<2)+4|0);a[(a[b]+4>>2)+(11*c|0)]=g;g=a[b];f=a[(g>>2)+(11*c|0)];e=0<(f|0);a:do{if(e){h=f;for(j=g;;){if(h=h-1|0,j=a[(j+4>>2)+(11*c|0)],n=a[j+(h<<2)>>2],a[j+(a[n+240>>2]<<2)>>2]=n,j=a[b],0>=(h|0)){var t=j;break a}}}else{t=g}}while(0);a[(t>>2)+(11*c|0)]=p;a[a[(a[b]+4>>2)+(11*c|0)]+(p<<2)>>2]=0}c=c+1|0;if((c|0)>(D[d>>1]<<16>>16|0)){break}}}}function Yx(c,d){var e,g,j=d>>2,m=h;h+=24;var l=m+8,k=m+16;if(2<=(a[j+55]|0)){var n=d+32|0,z=d+104|0,p=d+40|0;ZP(m,d,(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])-(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0])&-1,(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])&-1);n=a[m>>2];z=a[m+4>>2];if(0<(a[j+47]|0)){if(p=a[j+60],g=Og(c,a[a[a[j+46]>>2]+12>>2]),0!=(g|0)){for(var k=l|0,j=l+4|0,s=z,v=n,z=p+1|0,n=g;;){p=n;g=n+16|0;e=a[g>>2];if((e|0)!=(d|0)&&(Zb(e)|0)==(d|0)){$P(l,a[g>>2],v,s,z);v=a[k>>2];s=a[j>>2];NO(p);g=(n+12|0)>>2;e=(a[g]+24|0)>>2;var t=a[e+38];e=0==(t|0)?Cb((a[e+39]<<2)+8|0):wb(t,(a[e+39]<<2)+8|0);a[a[g]+176>>2]=e;e=a[g]+180|0;t=a[e>>2];a[e>>2]=t+1|0;a[a[a[g]+176>>2]+(t<<2)>>2]=p;p=a[g]+24|0;a[a[p+152>>2]+(a[p+156>>2]<<2)>>2]=0;z=z+1|0}p=v;n=Ql(c,n);if(0==(n|0)){break}else{v=p}}}}else{if(p=a[j+60],g=Ib(c,a[a[a[j+44]>>2]+16>>2]),0!=(g|0)){l=k|0;j=k+4|0;s=z;v=n;z=p+1|0;for(n=g;!(p=n,g=n+12|0,e=a[g>>2],(e|0)!=(d|0)&&(Zb(e)|0)==(d|0)&&($P(k,a[g>>2],v,s,z),v=a[l>>2],s=a[j>>2],NO(p),g=(n+16|0)>>2,e=(a[g]+24|0)>>2,t=a[e+40],e=0==(t|0)?Cb((a[e+41]<<2)+8|0):wb(t,(a[e+41]<<2)+8|0),a[a[g]+184>>2]=e,e=a[g]+188|0,t=a[e>>2],a[e>>2]=t+1|0,a[a[a[g]+184>>2]+(t<<2)>>2]=p,p=a[g]+24|0,a[a[p+160>>2]+(a[p+164>>2]<<2)>>2]=0,z=z+1|0),p=v,n=yb(c,n),0==(n|0));){v=p}}}}h=m}function ZP(c,d,e,g){var h=d+20|0;et(d,a[a[h>>2]+152>>2]&1);var j=d+40|0;f[0]=g|0;a[j>>2]=b[0];a[j+4>>2]=b[1];j=d+104|0;e=(e|0)+(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);j=d+32|0;f[0]=e;a[j>>2]=b[0];a[j+4>>2]=b[1];d=d+112|0;a[c>>2]=e+(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])+a[a[h>>2]+256>>2]&-1;a[c+4>>2]=g}function $P(b,c,d,g,e){var f=a[c+20>>2],h=Zb(c);if((h|0)!=(c|0)){var j;(h|0)==(c|0)&&sa(qg|0,220,ey|0,aQ|0);var n=c+168|0;0!=(a[n>>2]|0)&&sa(qg|0,221,ey|0,bQ|0);j=(h+168|0)>>2;a[n>>2]=a[j];n=a[j];0!=(n|0)&&(a[n+172>>2]=c);n=c+172|0;a[n>>2]=h;a[j]=c}a[c+240>>2]=e;h=a[h+236>>2];a[c+236>>2]=h;a[a[(a[f+220>>2]+4>>2)+(11*h|0)]+(e<<2)>>2]=c;ZP(b,c,d,g)}function RP(b,c){var d=b+208|0;if(1<=(a[d>>2]|0)){for(var g=b+212|0,e=1;!(RP(a[a[g>>2]+(e<<2)>>2],c),e=e+1|0,(e|0)>(a[d>>2]|0));){}}YP(b,c)}function SP(c){var d,e=h;h+=32;var g=e+16;d=(c+44|0)>>2;var j=a[d],m=j+48|0,m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]),l=j+56|0,k=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);if(.001>m|.001>k){return h=e,0}l=j+32|0;l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);j=j+40|0;j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);XP(e,m,k,l,j);m=e|0;k=e+8|0;XP(g,(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]),(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),l,j);m=g|0;m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]);g=g+8|0;l=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);g=c+68|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);c=c+76|0;c=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);j=m/g;k=l/c;if(!(1>j|1>k)){return h=e,0}j=j<k?j:k;j=.5<j?j:.5;m=cQ(j*g/m)*m/g;l=cQ(j*c/l)*l/c;j=a[d]+64|0;f[0]=g*m;a[j>>2]=b[0];a[j+4>>2]=b[1];d=a[d]+72|0;f[0]=c*l;a[d>>2]=b[0];a[d+4>>2]=b[1];h=e;return 1}function TP(c,d,e){var g;g=c+208|0;var h=1>(a[g>>2]|0);a:do{if(!h){for(var j=c+212|0,l=1;;){if(TP(a[a[j>>2]+(l<<2)>>2],d,e),l=l+1|0,(l|0)>(a[g>>2]|0)){break a}}}}while(0);g=(c+52|0)>>2;h=(b[0]=a[g],b[1]=a[g+1],f[0])*d;f[0]=h;a[g]=b[0];a[g+1]=b[1];g=(c+60|0)>>2;h=(b[0]=a[g],b[1]=a[g+1],f[0])*e;f[0]=h;a[g]=b[0];a[g+1]=b[1];g=(c+68|0)>>2;d*=(b[0]=a[g],b[1]=a[g+1],f[0]);f[0]=d;a[g]=b[0];a[g+1]=b[1];c=(c+76|0)>>2;e*=(b[0]=a[c],b[1]=a[c+1],f[0]);f[0]=e;a[c]=b[0];a[c+1]=b[1]}function UP(c,d){var e=h,g=c+68|0,q=c+52|0,q=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]),g=c+76|0,y=c+60|0,y=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),g=q/y;if(0!=m[ld]<<24>>24){Va(a[oa>>2],dQ|0,(j=h,h+=16,f[0]=g,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=q*y/1e4,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));q=a[oa>>2];y=ra(c);if(0==(y|0)){var l=0}else{for(var k=0;;){var n=Ib(c,y),z=0==(n|0);b:do{if(z){var p=k}else{for(var s=k,v=n;;){var t=a[a[v+12>>2]+236>>2],u=a[a[v+16>>2]+236>>2];(t|0)!=(u|0)&&(t=t-u|0,s=s-1+(-1<(t|0)?t:-t|0)|0);v=yb(c,v);if(0==(v|0)){p=s;break b}}}}while(0);y=ba(c,y);if(0==(y|0)){l=p;break}else{k=p}}}Va(q,eQ|0,(j=h,h+=4,a[j>>2]=l,j))}l=d|0;l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);if(g>1.1*l){a[d+24>>2]=l*(a[d+20>>2]-a[d+16>>2]|0)/g&-1}else{if(p=d+24|0,g>.8*l){a[p>>2]=0}else{a[p>>2]=-1;if(0==m[ld]<<24>>24){h=e;return}Lc(fQ|0,34,1,a[oa>>2])}}0!=m[ld]<<24>>24&&Va(a[oa>>2],gQ|0,(j=h,h+=4,a[j>>2]=a[d+24>>2],j));h=e}function hQ(c,d){var e,g,h,j,l=a[c+32>>2];j=a[l+220>>2]>>2;var k=D[c+246>>1]<<16>>16,n=D[c+244>>1]<<16>>16,m=a[j+(11*n|0)+5];h=(c+160|0)>>2;var p=a[h];e=m-p|0;var s=a[j+(11*k|0)+4];g=(c+156|0)>>2;var v=a[g],t=s-v|0;if((t+e|0)<(d|0)){m=k-n|0;m=(m+(d+1)|0)/(m+2|0)&-1;e=(D[l+246>>1]<<16>>16)-1|0;l=l+244|0;s=D[l>>1];if((e|0)<(s<<16>>16|0)){j=p}else{v=m;p=e;for(e=s;!(0<(a[j+(11*p|0)]|0)&&(e=(a[a[j+(11*p|0)+1]>>2]+40|0)>>2,s=(b[0]=a[e],b[1]=a[e+1],f[0])+(v|0),f[0]=s,a[e]=b[0],a[e+1]=b[1],e=D[l>>1]),p=p-1|0,(p|0)<(e<<16>>16|0));){v=v+m|0}j=a[h];v=a[g]}a[h]=j+m|0;a[g]=v+m|0}else{j=(d+1|0)/2&-1,(e|0)>(t|0)?(j|0)>(t|0)?(a[g]=s,a[h]=d-t+p|0):(a[g]=j+v|0,a[h]=d-j+p|0):(j|0)>(e|0)?(a[h]=m,a[g]=d-e+v|0):(a[h]=j+p|0,a[g]=d-j+v|0)}}function iQ(c,d){var e,g,h,j,l=a[c+32>>2];g=a[l+220>>2]>>2;var k=D[c+246>>1];e=k<<16>>16;var n=D[c+244>>1],m=n<<16>>16,p=(d+1|0)/2&-1;j=(c+156|0)>>2;var s=a[j]+p-a[g+(11*e|0)+4]|0;if(0<(s|0)){k=k<<16>>16<n<<16>>16;a:do{if(!k){for(var n=s|0,v=e;;){if(0<(a[g+(11*v|0)]|0)){h=(a[a[g+(11*v|0)+1]>>2]+40|0)>>2;var t=(b[0]=a[h],b[1]=a[h+1],f[0])+n;f[0]=t;a[h]=b[0];a[h+1]=b[1]}h=v-1|0;if((h|0)<(m|0)){break a}else{v=h}}}}while(0);e=a[c+160>>2];s=d-p+s+e-a[g+(11*m|0)+5]|0}else{e=a[c+160>>2],s=d-p+e-a[g+(11*m|0)+5]|0}if(0<(s|0)){k=m-1|0;l=l+244|0;n=D[l>>1];if((k|0)<(n<<16>>16|0)){g=e,l=c+160|0}else{m=s|0;s=k;for(e=n;!(0<(a[g+(11*s|0)]|0)&&(e=(a[a[g+(11*s|0)+1]>>2]+40|0)>>2,k=(b[0]=a[e],b[1]=a[e+1],f[0])+m,f[0]=k,a[e]=b[0],a[e+1]=b[1],e=D[l>>1]),s=s-1|0,(s|0)<(e<<16>>16|0));){}l=c+160|0;g=a[l>>2]}m=(d-p|0)+g|0;a[l>>2]=m}else{g=(c+160|0)>>2,m=(d-p|0)+e|0,a[g]=m}g=a[j];p=g+p|0;a[j]=p}function cy(c){var d,e,g=c+32|0,h=a[g>>2],j=a[h+220>>2];e=(c+156|0)>>2;var l=a[e];d=(c+160|0)>>2;var k=a[d],n=c+208|0;if(1>(a[n>>2]|0)){var n=k,m=l,p=0,g=h}else{for(var h=c+212|0,s=c+246|0,v=c+244|0,t=1,u=0;;){var w=a[a[h>>2]+(t<<2)>>2],p=cy(w)|u;D[w+246>>1]<<16>>16==D[s>>1]<<16>>16?(m=a[w+156>>2]+8|0,m=(l|0)>(m|0)?l:m):m=l;D[w+244>>1]<<16>>16==D[v>>1]<<16>>16?(w=a[w+160>>2]+8|0,w=(k|0)>(w|0)?k:w):w=k;t=t+1|0;if((t|0)>(a[n>>2]|0)){break}else{k=w,l=m,u=p}}n=w;g=a[g>>2]}if((g|0)==(c|0)){return a[e]=m,a[d]=n,p}0==(a[c+48>>2]|0)?(a[e]=m,d=a[d]=n,e=m,g=p):(0==(a[g+152>>2]&1|0)?(p=c+92|0,g=c+124|0,p=m+(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])&-1,g=n+(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])&-1):(p=m,g=n),a[e]=p,d=a[d]=g,e=p,g=1);p=j+44*(D[c+244>>1]<<16>>16)+20|0;n=a[p>>2];a[p>>2]=(n|0)>(d|0)?n:d;c=j+44*(D[c+246>>1]<<16>>16)+16|0;j=a[c>>2];a[c>>2]=(j|0)>(e|0)?j:e;return g}function dy(c,d){var e,g,h;h=(c+32|0)>>2;var j=a[h],l=a[j+220>>2];g=(c+156|0)>>2;var k=a[g];e=(c+160|0)>>2;var n=a[e],m=c+208|0;if(1>(a[m>>2]|0)){var m=k,p=n}else{for(var p=c+212|0,j=c+246|0,s=c+244|0,v=1;;){var t=a[a[p>>2]+(v<<2)>>2];dy(t,d);if(D[t+246>>1]<<16>>16==D[j>>1]<<16>>16){var u=a[t+156>>2]+8|0,u=(k|0)>(u|0)?k:u}else{u=k}D[t+244>>1]<<16>>16==D[s>>1]<<16>>16?(t=a[t+160>>2]+8|0,t=(n|0)>(t|0)?n:t):t=n;v=v+1|0;if((v|0)>(a[m>>2]|0)){break}else{k=u,n=t}}m=u;p=t;j=a[h]}a[g]=m;a[e]=p;(j|0)!=(c|0)&&0!=(a[c+48>>2]|0)&&(j=c+140|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),s=c+108|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),u=a[a[(l+4>>2)+(11*(D[c+244>>1]<<16>>16)|0)]>>2]+40|0,v=a[a[(l+4>>2)+(11*(D[c+246>>1]<<16>>16)|0)]>>2]+40|0,m=((j>s?j:s)&-1)-(p+m)-((b[0]=a[u>>2],b[1]=a[u+4>>2],f[0])-(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0])&-1)|0,0<(m|0)&&(0==(d|0)?iQ(c,m):hQ(c,m)));(a[h]|0)!=(c|0)&&(h=l+44*(D[c+244>>1]<<16>>16)+20|0,m=a[h>>2],e=a[e],a[h>>2]=(m|0)>(e|0)?m:e,l=l+44*(D[c+246>>1]<<16>>16)+16|0,e=a[l>>2],g=a[g],a[l>>2]=(e|0)>(g|0)?e:g)}function DP(b){if(0!=(b|0)){for(var c=b,b=c>>2;;){var d=c+176|0,g=d,e=c+248|0,f=a[g>>2],g=a[g+4>>2];a[e>>2]=f;a[e+4>>2]=g;var h=e=c+184|0,c=c+256|0,g=a[h>>2],h=a[h+4>>2];a[c>>2]=g;a[c+4>>2]=h;c=e|0;for(e=0;0!=(a[g+(e<<2)>>2]|0);){e=e+1|0}d|=0;for(g=0;0!=(a[f+(g<<2)>>2]|0);){g=g+1|0}a[b+45]=0;a[d>>2]=fa((g+e<<2)+16|0);a[b+47]=0;a[c>>2]=fa(16);b=a[b+42];if(0==(b|0)){break}else{c=b,b=c>>2}}}}function EP(c){var d,e,g,j,y=h;h+=8;var l;j=y>>2;var k=a[c+220>>2],n=0==(m[c+149|0]&1)<<24>>24;g=(c+256|0)>>2;var z=a[g];a[j]=z;a[j+1]=n?z:5;n=c+246|0;z=D[c+244>>1]<<16>>16;a:for(;;){if((z|0)>(D[n>>1]<<16>>16|0)){l=1254;break}c=(k+44*z+4|0)>>2;a[a[a[c]>>2]+236>>2]=0;var p=k+44*z|0,s=a[((z&1)<<2>>2)+j]|0,v=0,t=0;b:for(;(t|0)<(a[p>>2]|0);){var u=a[a[c]+(t<<2)>>2];e=u>>2;d=(u+112|0)>>2;var w=(b[0]=a[d],b[1]=a[d+1],f[0]);a[e+61]=w&-1;if(0<(a[e+53]|0)){var A=a[e+52],B=a[A>>2],C=0==(B|0);c:do{if(C){var F=0}else{for(var E=0,G=0,H=B;;){if(E=(a[H+16>>2]|0)==(a[H+12>>2]|0)?HQa(H)+E|0:E,G=G+1|0,H=a[A+(G<<2)>>2],0==(H|0)){F=E;break c}}}}while(0);w+=F|0;f[0]=w;a[d]=b[0];a[d+1]=b[1]}A=w;d=t+1|0;w=a[a[c]+(d<<2)>>2];0==(w|0)?w=v:(B=w+104|0,A=A+(b[0]=a[B>>2],b[1]=a[B+4>>2],f[0])+s,Zc(u,w,A,0),A=v+A&-1,a[w+236>>2]=A,w=A|0);A=a[e+32];0!=(A|0)&&(e=a[e+64],B=a[e>>2],C=a[e+4>>2],e=(E=(a[a[B+12>>2]+240>>2]|0)>(a[a[C+12>>2]+240>>2]|0))?B:C,E=E?C:B,B=((D[A+178>>1]&65535)*a[g]|0)/2&-1|0,C=a[E+12>>2],E=a[E+16>>2],0==(fy(E,C)|0)&&(G=E+104|0,H=C+112|0,Zc(C,E,(b[0]=a[G>>2],b[1]=a[G+4>>2],f[0])+(B+(b[0]=a[H>>2],b[1]=a[H+4>>2],f[0]))&-1|0,ib[A+164>>2]&-1)),C=a[e+16>>2],e=a[e+12>>2],0==(fy(e,C)|0)&&(E=e+104|0,G=C+112|0,Zc(C,e,(b[0]=a[E>>2],b[1]=a[E+4>>2],f[0])+(B+(b[0]=a[G>>2],b[1]=a[G+4>>2],f[0]))&-1|0,ib[A+164>>2]&-1)));e=u+196|0;u=u+192|0;for(A=0;;){if((A|0)>=(a[e>>2]|0)){v=w;t=d;continue b}var B=a[a[u>>2]+(A<<2)>>2],E=a[B+16>>2],G=a[B+12>>2],C=(H=(a[E+240>>2]|0)<(a[G+240>>2]|0))?E:G,E=H?G:E,G=C+112|0,H=E+104|0,G=(b[0]=a[G>>2],b[1]=a[G+4>>2],f[0])+(b[0]=a[H>>2],b[1]=a[H+4>>2],f[0]),H=a[g],I=(D[B+178>>1]&65535)*H+G&-1,J=Zh(C,E);do{if(0==(J|0)){0==(a[B+108>>2]|0)&&Zc(C,E,I|0,ib[B+164>>2]&-1)}else{var K=I|0,L=G+(H|0),N=B+144|0,N=(b[0]=a[N>>2],b[1]=a[N+4>>2],f[0]),Q=0>N,K=(K>L+((Q?N-.5:N+.5)&-1|0)?K:L+((Q?N-.5:N+.5)&-1|0))&-1;if(65535<(K|0)){l=1248;break a}L=J+178|0;N=D[L>>1]&65535;D[L>>1]=((N|0)>(K|0)?N:K)&65535}}while(0);A=A+1|0}}z=z+1|0}1254==l?h=y:1248==l&&VP(K|0)}function FP(c){var d=a[c+216>>2];if(0!=(d|0)){for(;;){var e=d+256|0,g=a[e>>2],h=0==(g|0);a:do{if(!h){var j=a[g>>2];if(0!=(j|0)){for(var l=0,k=j;;){j=Lf(c);m[j+162|0]=2;var n=k+68|0,z=k+28|0,z=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])-(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0])&-1,p=0<(z|0),n=p?0:-z|0,z=p?z:0,p=k+16|0,s=k+164|0;Zc(j,a[p>>2],z+1|0,ib[s>>2]&-1);k=k+12|0;Zc(j,a[k>>2],n+1|0,ib[s>>2]&-1);z=a[a[p>>2]+236>>2]-z-1|0;k=a[a[k>>2]+236>>2]-n-1|0;a[j+236>>2]=(z|0)<(k|0)?z:k;l=l+1|0;j=a[a[e>>2]+(l<<2)>>2];if(0==(j|0)){break a}else{k=j}}}}}while(0);d=a[d+168>>2];if(0==(d|0)){break}}}}function ay(c){var d=h;xq(c);var e=a[c+264>>2],g=a[c+268>>2],q=D[c+244>>1],m=c+246|0;if(q<<16>>16<=D[m>>1]<<16>>16){for(var l=c+220|0,k=c+12|0,n=c+132|0,c=c+100|0,q=q<<16>>16;;){var z=a[l>>2];if(0!=(a[(z>>2)+(11*q|0)]|0)){if(z=a[a[(z+4>>2)+(11*q|0)]>>2],0==(z|0)){la(1,jQ|0,(j=h,h+=8,a[j>>2]=a[k>>2],a[j+4>>2]=q,j))}else{var p=z+104|0;Zc(e,z,(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])+8+(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),0);z=a[l>>2];z=a[a[(z+4>>2)+(11*q|0)]+(a[(z>>2)+(11*q|0)]-1<<2)>>2];p=z+112|0;Zc(z,g,(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0])+8+(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]),0)}}q=q+1|0;if((q|0)>(D[m>>1]<<16>>16|0)){break}}}h=d}function xq(c){var d,e=c+264|0;if(0==(a[e>>2]|0)){d=(c+32|0)>>2;var g=Lf(a[d]);m[g+162|0]=2;var h=Lf(a[d]);m[h+162|0]=2;if(0!=(a[c+48>>2]|0)&&(d=a[d],(d|0)!=(c|0)&&0==(a[d+152>>2]&1|0))){d=c+84|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);var j=c+116|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);Zc(g,h,(d>j?d:j)&-1|0,0)}a[e>>2]=g;a[c+268>>2]=h}}function GP(b){if((a[b+32>>2]|0)!=(b|0)){ay(b);var c=a[b+264>>2],d=a[b+268>>2],g=Zh(c,d);0==(g|0)?Zc(c,d,1,128):(c=g+164|0,ib[c>>2]+=128)}c=b+208|0;if(1<=(a[c>>2]|0)){b=b+212|0;for(d=1;!(GP(a[a[b>>2]+(d<<2)>>2]),d=d+1|0,(d|0)>(a[c>>2]|0));){}}}function Zx(c){var d,e=D[c+244>>1],g=c+246|0,h=e<<16>>16>D[g>>1]<<16>>16;a:do{if(!h){for(var j=c+220|0,l=c+32|0,k=c+264|0,n=c+268|0,z=e<<16>>16;;){var p=a[j>>2],s=0==(a[(p>>2)+(11*z|0)]|0);b:do{if(!s){var v=a[a[(p+4>>2)+(11*z|0)]>>2];if(0!=(v|0)){for(var v=v+240|0,t=a[v>>2];;){var u=t-1|0;if(0>=(t|0)){break}var w=a[a[(a[a[l>>2]+220>>2]+4>>2)+(11*z|0)]+(u<<2)>>2];if(0==m[w+162|0]<<24>>24){d=1314;break}if(0==(kQ(c,w)|0)){t=u}else{d=1314;break}}1314==d&&(d=0,t=w+112|0,Zc(w,a[k>>2],(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])+8,0));for(v=a[(a[j>>2]>>2)+(11*z|0)]+a[v>>2]|0;;){t=a[a[l>>2]+220>>2];if((v|0)>=(a[(t>>2)+(11*z|0)]|0)){break b}var A=a[a[(t+4>>2)+(11*z|0)]+(v<<2)>>2];if(0==m[A+162|0]<<24>>24){break}if(0!=(kQ(c,A)|0)){break}v=v+1|0}v=A+104|0;Zc(a[n>>2],A,(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0])+8,0)}}}while(0);z=z+1|0;if((z|0)>(D[g>>1]<<16>>16|0)){break a}}}}while(0);d=c+208|0;if(1<=(a[d>>2]|0)){c=c+212|0;for(e=1;!(Zx(a[a[c>>2]+(e<<2)>>2]),e=e+1|0,(e|0)>(a[d>>2]|0));){}}}function HP(c){xq(c);var d=c+208|0;if(1<=(a[d>>2]|0)){for(var e=c+212|0,g=c+264|0,h=c+132|0,j=c+268|0,c=c+100|0,l=1;;){var k=a[a[e>>2]+(l<<2)>>2];xq(k);Zc(a[g>>2],a[k+264>>2],(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0])+8,0);Zc(a[k+268>>2],a[j>>2],(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])+8,0);HP(k);l=l+1|0;if((l|0)>(a[d>>2]|0)){break}}}}function $x(b){var c;c=(b+208|0)>>2;if(1<=(a[c]|0)){for(var b=(b+212|0)>>2,d=1;;){xq(a[a[b]+(d<<2)>>2]);var d=d+1|0,g=a[c];if((d|0)>(g|0)){break}}if(1<=(g|0)){for(var d=1,e=g;;){var g=d+1|0,f=(g|0)>(e|0),h=a[b],j=a[h+(d<<2)>>2];a:do{if(f){var n=j}else{for(var m=g,p=h,s=j,v=e;;){var t=a[p+(m<<2)>>2],u=D[s+244>>1]<<16>>16>D[t+244>>1]<<16>>16,w=u?s:t,s=u?t:s,t=D[w+244>>1],u=t<<16>>16;D[s+246>>1]<<16>>16<t<<16>>16?w=v:(p=(a[a[a[(a[s+220>>2]+4>>2)+(11*u|0)]>>2]+240>>2]|0)<(a[a[a[(a[w+220>>2]+4>>2)+(11*u|0)]>>2]+240>>2]|0),Zc(a[(p?s:w)+268>>2],a[(p?w:s)+264>>2],8,0),w=a[c],p=a[b]);m=m+1|0;v=a[p+(d<<2)>>2];if((m|0)>(w|0)){n=v;break a}else{s=v,v=w}}}}while(0);$x(n);e=a[c];if((g|0)>(e|0)){break}else{d=g}}}}}function kQ(b,c){var d;if(1!=m[c+162|0]<<24>>24){return 0}d=a[a[c+256>>2]>>2];for(d>>=2;;){var g=a[d+32];if(0==(g|0)){break}else{d=g,d>>=2}}return 0!=(Ed(b,a[d+4]|0)|0)?0:d=0==(Ed(b,a[d+3]|0)|0)&1}function fy(b,c){var d;if((b|0)==(c|0)){var g;return 1}for(var e=a[b+184>>2],f=0;;){var h=a[e+(f<<2)>>2];if(0==(h|0)){g=0;d=1361;break}if(0==(fy(a[h+12>>2],c)|0)){f=f+1|0}else{g=1;d=1362;break}}if(1361==d||1362==d){return g}}function $N(b){var c,d,g;g=(b+244|0)>>1;D[g]=32767;d=(b+246|0)>>1;D[d]=-1;var e=ra(b);if(0==(e|0)){var f=0}else{for(var h=0;;){var j=e;c=(e+236|0)>>2;var n=a[c];(D[d]<<16>>16|0)<(n|0)&&(D[d]=n&65535,n=a[c]);(D[g]<<16>>16|0)>(n|0)&&(D[g]=n&65535);h=0==(h|0)?j:(a[c]|0)<(a[h+236>>2]|0)?j:h;e=ba(b,e);if(0==(e|0)){f=h;break}}}b=b+272|0;a[b>>2]=f}function Iw(b){var c=V(b|0,lQ|0),c=0==(c|0)?2147483647:wg(c,xc)*Vh(b)&-1,d=b+228|0;if(0<(a[d>>2]|0)){for(var g=b+224|0,e=b+216|0,f=b+208|0,h=0;!(a[e>>2]=a[a[g>>2]+(h<<2)>>2],Oo(b,0==(a[f>>2]|0)&1,c),h=h+1|0,(h|0)>=(a[d>>2]|0));){}}}function kx(b,c){var d=h;h+=8;if(0!=(m[b+149|0]&1)<<24>>24){var g=ra(b),e=0==(g|0);a:do{if(!e){for(var f=g;;){var j=Ib(b,f),k=0==(j|0);b:do{if(!k){for(var n=j;;){var z=n+178|0;D[z>>1]<<=1;n=yb(b,n);if(0==(n|0)){break b}}}}while(0);f=ba(b,f);if(0==(f|0)){break a}}}}while(0);g=b+260|0;a[g>>2]=(a[g>>2]+1|0)/2&-1}if(j=0!=(c|0)){g=ra(b);if(0!=(g|0)){for(;!(a[g+220>>2]=0,g=ba(b,g),0==(g|0));){}}g=ra(b);if(0!=(g|0)){for(;;){e=g+180|0;f=0<(a[e>>2]|0);a:do{if(f){k=g+176|0;for(n=0;;){if(m[a[a[k>>2]+(n<<2)>>2]+124|0]=0,n=n+1|0,(n|0)>=(a[e>>2]|0)){break a}}}}while(0);g=ba(b,g);if(0==(g|0)){break}}}}mQ(b,b);cN(b);nQ(d,b);g=a[d>>2];e=a[d+4>>2];jq(b,0);do{if(j){if(1>=(a[b+228>>2]|0)&&0>=(a[b+208>>2]|0)){f=c;break}a[c+32>>2]=1}f=0}while(0);j=b+228|0;if(0<(a[j>>2]|0)){k=b+224|0;n=b+216|0;for(z=0;;){var p=a[a[k>>2]+(z<<2)>>2];a[n>>2]=p;var s=0==(p|0);a:do{if(!s){for(var v=p;!(m[v+163|0]=0,v=a[v+168>>2],0==(v|0));){}v=a[n>>2];if(0!=(v|0)){for(;;){if(RM(v),v=a[v+168>>2],0==(v|0)){break a}}}}}while(0);z=z+1|0;if((z|0)>=(a[j>>2]|0)){break}}}0!=(oQ(b,g,e)|0)&&jq(b,0);0==(f|0)?Iw(b):VM(b,f);pQ(b,f);qQ(b);h=d}function mQ(b,c){var d=a[c+36>>2],g=a[d+20>>2],d=Ib(g,d);if(0!=(d|0)){for(;;){var e=Yd(a[d+12>>2]),f;f=e;if(0!=(0==(td(a[f+12>>2],Rx|0,7)|0)&1|0)){f=7}else{var h=Ds(V(f|0,nq|0),ei|0,rQ|0);m[f+282|0]=h&255;f=h}0==(f|0)?mQ(b,e):7==(f|0)&100==(a[Dl>>2]|0)?sQ(b,e):tQ(b,e,f);d=yb(g,d);if(0==(d|0)){break}}}}function uQ(b){var c;c=(b+4|0)>>2;var d=a[c];if(-1<(d|0)){for(b|=0;;){if(a[a[b>>2]+(d<<2)>>2]=0,0<(d|0)){d=d-1|0}else{break}}}a[c]=0}function nQ(b,c){var d,g,e;g=(c+236|0)>>2;e=a[g];d=(c+232|0)>>2;var f=a[d],h=0==(f|0);if(0==(e|0)){if(h){a[b>>2]=0;a[b+4>>2]=0;return}e=1425}else{if(h){var j=e;e=1426}else{e=1425}}if(1425==e){if(f=Zb(f),a[d]=f,h=a[g],0==(h|0)){var n=0,z=f}else{j=h,e=1426}}if(1426==e){n=Zb(j);a[g]=n;z=0==(n|0);a:do{if(z){var p=0}else{if(g=5==m[n+165|0]<<24>>24&1,j=n+184|0,e=a[a[j>>2]>>2],0==(e|0)){p=g}else{for(;;){if(f=a[e+12>>2],(f|0)!=(Zb(f)|0)&&sa(ym|0,363,gy|0,vQ|0),Hw(e),e=a[a[j>>2]>>2],0==(e|0)){p=g;break a}}}}}while(0);n=p;z=a[d]}d=0==(z|0);a:do{if(d){var s=0}else{if(p=3==m[z+165|0]<<24>>24&1,g=z+176|0,j=a[a[g>>2]>>2],0==(j|0)){s=p}else{for(;;){if(e=a[j+16>>2],(e|0)!=(Zb(e)|0)&&sa(ym|0,370,gy|0,wQ|0),Hw(j),j=a[a[g>>2]>>2],0==(j|0)){s=p;break a}}}}}while(0);a[b>>2]=s;a[b+4>>2]=n}function oQ(b,c,d){var g=b+236|0;if(0==(a[g>>2]|0)&&0==(a[b+232>>2]|0)){var e;return b=0}var f=ra(b);if(0==(f|0)){return b=0}for(var d=d&65535,h=b+232|0,c=c&65535,j=0;;){var n=f,m=f;if((f|0)==(Zb(m)|0)){if(0==(a[f+188>>2]|0)){var p=a[g>>2];0==(p|0)|(n|0)==(p|0)||(j=de(m,p,0),D[j+178>>1]=d)}0!=(a[f+180>>2]|0)?n=j:(p=a[h>>2],0==(p|0)|(n|0)==(p|0)?n=j:(n=de(p,m,0),D[n+178>>1]=c))}else{n=j}f=ba(b,f);if(0==(f|0)){e=n;break}else{j=n}}return b=0!=(e|0)&1}function pQ(b,c){var d,g,e=ra(b);if(0==(e|0)){D[b+246>>1]=0,D[b+244>>1]=0}else{g=(b+244|0)>>1;D[g]=32767;d=(b+246|0)>>1;D[d]=-1;for(var f=0==(c|0);;){var h=e,j=e,n=Zb(j);do{if((n|0)==(j|0)){var z=a[e+236>>2]}else{var z=e+236|0,p=a[z>>2];if(!f){if(0==(p|0)){p=0}else{z=p;break}}p=p+a[n+236>>2]|0;z=a[z>>2]=p}}while(0);(D[d]<<16>>16|0)<(z|0)?(D[d]=z&65535,n=a[e+236>>2]):n=z;(D[g]<<16>>16|0)>(n|0)&&(D[g]=n&65535);h=m[h+165|0];0==h<<24>>24||6==h<<24>>24||YE(j);e=ba(b,e);if(0==(e|0)){break}}if((a[b+32>>2]|0)==(b|0)){if(100!=(a[Dl>>2]|0)){if(g=a[b+36>>2],d=a[g+20>>2],g=Ib(d,g),0!=(g|0)){for(;!(f=Yd(a[g+12>>2]),7==m[f+282|0]<<24>>24&&sQ(b,f),g=yb(d,g),0==(g|0));){}}}else{if(d=b+208|0,1<=(a[d>>2]|0)){g=b+212|0;for(f=1;!(xQ(a[a[g>>2]+(f<<2)>>2]),f=f+1|0,(f|0)>(a[d>>2]|0));){}}}}}}function qQ(b){var c,d=b+224|0;c=(b+228|0)>>2;var g=a[c],e=0<(g|0);a:do{if(e){for(var f=d|0,h=b+216|0,j=0,n=g;;){var z=a[a[f>>2]+(j<<2)>>2];a[h>>2]=z;if(0!=(z|0)){for(n=z;!(uQ(n+176|0),uQ(n+184|0),m[n+163|0]=0,n=a[n+168>>2],0==(n|0));){}n=a[c]}j=j+1|0;if((j|0)>=(n|0)){break a}}}}while(0);g=ra(b);if(0!=(g|0)){for(;;){e=Ib(b,g);f=0==(e|0);a:do{if(!f){for(h=e;;){j=h+180|0;z=n=a[j>>2];do{if(0!=(n|0)&&(h|0)==(a[n+128>>2]|0)){var p=Ib(b,g),s=0==(p|0);b:do{if(!s){for(var v=p;;){if((h|0)!=(v|0)){var t=v+180|0,u=a[t>>2];0!=(u|0)&(z|0)==(u|0)&&(a[t>>2]=0)}v=yb(b,v);if(0==(v|0)){break b}}}}while(0);G(n|0)}}while(0);a[j>>2]=0;h=yb(b,h);if(0==(h|0)){break a}}}}while(0);g=ba(b,g);if(0==(g|0)){break}}}b=(d|0)>>2;d=a[b];G(d);a[b]=0;a[c]=0}function xQ(b){var c=a[b+272>>2]+236|0,d=b+244|0;D[d>>1]=(D[d>>1]&65535)+a[c>>2]&65535;d=b+246|0;D[d>>1]=(D[d>>1]&65535)+a[c>>2]&65535;c=b+208|0;if(1<=(a[c>>2]|0)){b=b+212|0;for(d=1;!(xQ(a[a[b>>2]+(d<<2)>>2]),d=d+1|0,(d|0)>(a[c>>2]|0));){}}}function sQ(b,c){var d=c+250|0;if(0==m[d]<<24>>24&&(m[d]=1,yQ(b,c),0!=(ra(c)|0))){var g=b+208|0,e=a[g>>2],d=e+1|0;a[g>>2]=d;var g=b+212|0,f=a[g>>2],e=0==(f|0)?fa((e<<2)+8|0):NF(f,e+2|0,4,d);a[g>>2]=e;a[e+(d<<2)>>2]=c;Vu(c);100==(a[Dl>>2]|0)?(kx(c,0),zQ(c)):$N(c)}}function yQ(b,c){var d,g=ra(c),e=0==(g|0);a:do{if(!e){for(var f=c,h=b+212|0,j=b+208|0,n=g;;){var z=ba(c,n),p=n+24|0,n=n|0;if(0==m[p+141|0]<<24>>24){for(var s=1;;){var v=a[j>>2];if((s|0)>=(v|0)){var t=v;break}if(0==(Ed(a[a[h>>2]+(s<<2)>>2],n)|0)){s=s+1|0}else{d=1535;break}}1535==d&&(d=0,t=a[j>>2]);(s|0)<(t|0)&&bl(f,n);a[p+192>>2]=0}else{bl(f,n)}if(0==(z|0)){break a}else{n=z}}}}while(0);g=ra(c);if(0!=(g|0)){for(d=c+32|0;;){e=Ib(a[d>>2],g);f=0==(e|0);a:do{if(!f){for(h=e;;){if(0!=(Ed(c,a[h+12>>2]|0)|0)&&gt(c,h|0),h=yb(a[d>>2],h),0==(h|0)){break a}}}}while(0);g=ba(c,g);if(0==(g|0)){break}}}}function zQ(b){var c,d=a[b+216>>2];do{if(0==(d|0)){c=1559}else{for(var g=0,e=d;;){var f=0==(a[e+236>>2]|0)?0==m[e+162|0]<<24>>24?e:g:g,e=a[e+168>>2];if(0==(e|0)){break}else{g=f}}if(0==(f|0)){c=1559}else{var h=f}}}while(0);1559==c&&(sa(ym|0,235,hy|0,AQ|0),h=0);a[b+272>>2]=h;d=ra(b);if(0!=(d|0)){for(c=h;!(g=d,2>(a[d+220>>2]|0)|(g|0)==(h|0)||sa(ym|0,239,hy|0,BQ|0),Tk(d,c),m[g+165|0]=7,d=ba(b,d),0==(d|0));){}}}function tQ(b,c,d){var g=ra(c);if(0!=(g|0)){var e=d&255,f=g+165|0;m[f]=e;var h=ba(c,g),j=0==(h|0);a:do{if(!j){for(var n=g,z=h;;){if(Tk(n,z),m[z+165|0]=m[f],z=ba(c,z),0==(z|0)){break a}}}}while(0);if(4==(d|0)||5==(d|0)){c=(b+236|0)>>2,f=a[c],a[c]=0==(f|0)?g:Tk(f,g)}else{if(2==(d|0)||3==(d|0)){c=(b+232|0)>>2,f=a[c],a[c]=0==(f|0)?g:Tk(f,g)}else{return}}5==(d|0)?m[a[b+236>>2]+165|0]=e:3==(d|0)&&(m[a[b+232>>2]+165|0]=e)}}function mx(b){var c=h;h+=120;var d,g=b+40|0,e=$(a[a[g>>2]+4>>2]|0,vx|0);a[di>>2]=e;g=$(a[a[g>>2]+4>>2]|0,wx|0);a[Ej>>2]=g;if(0!=(a[di>>2]|0)|0!=(g|0)&&(e=ra(b),0!=(e|0))){for(g=c|0;;){var f=e;a[Hj>>2]=0;var j=Ok(b,e),k=0==(j|0);a:do{if(!k){for(var n=j;;){var z=n,p=a[di>>2];(a[n+12>>2]|0)==(e|0)&0!=(p|0)?(p=mb(n|0,a[p+8>>2]),0==m[p]<<24>>24?d=1600:iy(g,f,z,p)):d=1600;1600==d&&(d=0,p=a[Ej>>2],(a[n+16>>2]|0)==(e|0)&0!=(p|0)&&(p=mb(n|0,a[p+8>>2]),0!=m[p]<<24>>24&&iy(g,f,z,p)));n=Pk(b,n,e);if(0==(n|0)){break a}}}}while(0);j=0<(a[Hj>>2]|0);a:do{if(j){for(k=0;;){if(n=c+24*k+4|0,1<(a[(c+8>>2)+(6*k|0)]|0)&&CQ(f,n),n=a[n>>2],0!=(n|0)&&G(n),k=k+1|0,(k|0)>=(a[Hj>>2]|0)){break a}}}}while(0);e=ba(b,e);if(0==(e|0)){break}}}h=c}function iy(c,d,e,g){var q,y;y=c>>2;var l=h;h+=8;for(var k=l+4,n=a[Hj>>2],z=0;;){if((z|0)>=(n|0)){q=1624;break}var p=a[y+(6*z|0)];if(m[p]<<24>>24==m[g]<<24>>24&&0==(ka(p,g)|0)){q=1619;break}z=z+1|0}if(1619==q){g=(c+24*z+4|0)>>2,q=a[g],q=0==(q|0)?Cb((a[y+(6*z|0)+2]<<2)+8|0):wb(q,(a[y+(6*z|0)+2]<<2)+8|0),a[g]=q,y=(c+24*z+8|0)>>2,n=a[y],a[y]=n+1|0,a[q+(n<<2)>>2]=e,a[a[g]+(a[y]<<2)>>2]=0}else{if(1624==q){q=n+1|0;a[Hj>>2]=q;if(5<(q|0)){la(1,DQ|0,(j=h,h+=4,a[j>>2]=a[d+12>>2],j));h=l;return}q=(c+24*z+8|0)>>2;a[q]=0;n=fa(8);p=c+24*z+4|0;a[p>>2]=n;var s=a[q];a[q]=s+1|0;a[n+(s<<2)>>2]=e;a[a[p>>2]+(a[q]<<2)>>2]=0;a[y+(6*z|0)]=g;a[y+(6*z|0)+3]=0;y=c+24*z+16|0;f[0]=0;a[y>>2]=b[0];a[y+4>>2]=b[1]}}tk(e,l,k);d=(a[e+12>>2]|0)==(d|0)?a[k>>2]:a[l>>2];0!=(d|0)&&(k=c+24*z+12|0,y=a[k>>2],a[k>>2]=y+1|0,e=0==(y|0)?Cg(e,d):0,c=c+24*z+16|0,f[0]=e,a[c>>2]=b[0],a[c+4>>2]=b[1]);h=l}function CQ(c,d){var e,g,j,y,l,k,n,z,p,s=h;h+=72;var v=s+4,t=s+8;p=(d+4|0)>>2;l=0<(a[p]|0);a:do{if(l){var u=d|0,w=c+32|0;k=c+40|0;for(var A=g=0,B=0;;){var C=a[a[u>>2]+(B<<2)>>2],D=a[C+12>>2],D=(D|0)==(c|0)?a[C+16>>2]:D,C=D+32|0,C=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0])-(b[0]=a[w>>2],b[1]=a[w+4>>2],f[0]),D=D+40|0,D=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0])-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),F=pi(C,D),A=A+C/F;g+=D/F;B=B+1|0;if((B|0)>=(a[p]|0)){j=g;y=A;n=w;z=n>>2;n=k;n>>=2;break a}}}else{y=j=0,n=c+32|0,z=n>>2,n=c+40|0,n>>=2}}while(0);u=pi(y,j);g=(b[0]=a[z],b[1]=a[z+1],f[0]);w=(b[0]=a[n],b[1]=a[n+1],f[0]);k=(c+104|0)>>2;l=(c+112|0)>>2;B=(b[0]=a[k],b[1]=a[k+1],f[0])+(b[0]=a[l],b[1]=a[l+1],f[0]);A=c+96|0;A=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])+(a[a[c+20>>2]+260>>2]|0);A=B>A?B:A;B=y/u*A+g;A=j/u*A+w;u=t|0;y=(t|0)>>2;f[0]=g;a[y]=b[0];a[y+1]=b[1];j=(t+8|0)>>2;f[0]=w;a[j]=b[0];a[j+1]=b[1];C=t+16|0;f[0]=(2*g+B)/3;a[C>>2]=b[0];a[C+4>>2]=b[1];C=t+24|0;f[0]=(2*w+A)/3;a[C>>2]=b[0];a[C+4>>2]=b[1];C=t+32|0;f[0]=(2*B+g)/3;a[C>>2]=b[0];a[C+4>>2]=b[1];g=t+40|0;f[0]=(2*A+w)/3;a[g>>2]=b[0];a[g+4>>2]=b[1];w=t+48|0;f[0]=B;a[w>>2]=b[0];a[w+4>>2]=b[1];t=t+56|0;f[0]=A;a[t>>2]=b[0];a[t+4>>2]=b[1];t=h;h+=8;w=a[c+24>>2];0!=(w|0)&&(B=w+4|0,0!=(a[a[B>>2]+12>>2]|0)&&(a[t>>2]=c,a[t+4>>2]=0,w=(c+112|0)>>2,g=(b[0]=a[w],b[1]=a[w+1],f[0])&-1,A=u|0,C=c+32|0,A=(b[0]=a[A>>2],b[1]=a[A+4>>2],f[0])-(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]),C=u+8|0,D=c+40|0,B=J[a[a[B>>2]+12>>2]](t,A,(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0])-(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0])),f[0]=g|0,a[w]=b[0],a[w+1]=b[1],jp(t,c,u,B)));h=t;z=(b[0]=a[y],b[1]=a[y+1],f[0])-(b[0]=a[z],b[1]=a[z+1],f[0]);t=(b[0]=a[j],b[1]=a[j+1],f[0])-(b[0]=a[n],b[1]=a[n+1],f[0]);n=(0>z?z-.5:z+.5)&-1|0;z=(0>t?t-.5:t+.5)&-1|0;t=(b[0]=a[k],b[1]=a[k+1],f[0]);t=256*(t+n)/(t+(b[0]=a[l],b[1]=a[l+1],f[0]));t=0<=t?Math.floor(t):Math.ceil(t);if(0<(a[p]|0)){l=d|0;for(k=0;;){j=a[a[l>>2]+(k<<2)>>2];tk(j,s,v);y=0==(j|0);a:do{if(!y){for(u=j;;){w=0==(u|0);b:do{if(!w){B=u;for(g=B>>2;;){A=a[g+3];(A|0)==(c|0)&&(C=B+68|0,f[0]=n,a[C>>2]=b[0],a[C+4>>2]=b[1],C=B+76|0,f[0]=z,a[C>>2]=b[0],a[C+4>>2]=b[1],C=B+84|0,f[0]=0,a[C>>2]=b[0],a[C+4>>2]=b[1],a[g+23]=0,m[B+96|0]=1,m[B+97|0]=0,m[B+98|0]=0,m[B+99|0]=0,m[B+100|0]=t,m[B+101|0]=0,a[g+26]=0);(a[g+4]|0)==(c|0)&&(C=B+28|0,f[0]=n,a[C>>2]=b[0],a[C+4>>2]=b[1],C=B+36|0,f[0]=z,a[C>>2]=b[0],a[C+4>>2]=b[1],C=B+44|0,f[0]=0,a[C>>2]=b[0],a[C+4>>2]=b[1],a[g+13]=0,m[B+56|0]=1,m[B+57|0]=0,m[B+58|0]=0,m[B+59|0]=0,m[B+60|0]=t,m[B+61|0]=0,a[g+16]=0);if(1!=m[B+124|0]<<24>>24){var E=u;e=E>>2;break}if(1!=m[A+162|0]<<24>>24){E=u;e=E>>2;break}if(1!=(a[A+188>>2]|0)){E=u;e=E>>2;break}g=a[a[A+184>>2]>>2];if(0==(g|0)){E=u;e=E>>2;break}else{B=g,g=B>>2}}for(;;){(a[e+3]|0)==(c|0)&&(g=E+68|0,f[0]=n,a[g>>2]=b[0],a[g+4>>2]=b[1],g=E+76|0,f[0]=z,a[g>>2]=b[0],a[g+4>>2]=b[1],g=E+84|0,f[0]=0,a[g>>2]=b[0],a[g+4>>2]=b[1],a[e+23]=0,m[E+96|0]=1,m[E+97|0]=0,m[E+98|0]=0,m[E+99|0]=0,m[E+100|0]=t,m[E+101|0]=0,a[e+26]=0);g=a[e+4];(g|0)==(c|0)&&(B=E+28|0,f[0]=n,a[B>>2]=b[0],a[B+4>>2]=b[1],B=E+36|0,f[0]=z,a[B>>2]=b[0],a[B+4>>2]=b[1],B=E+44|0,f[0]=0,a[B>>2]=b[0],a[B+4>>2]=b[1],a[e+13]=0,m[E+56|0]=1,m[E+57|0]=0,m[E+58|0]=0,m[E+59|0]=0,m[E+60|0]=t,m[E+61|0]=0,a[e+16]=0);if(1!=m[E+124|0]<<24>>24){break b}if(1!=m[g+162|0]<<24>>24){break b}if(1!=(a[g+180>>2]|0)){break b}g=a[a[g+176>>2]>>2];if(0==(g|0)){break b}else{E=g,e=E>>2}}}}while(0);u=a[u+180>>2];if(0==(u|0)){break a}}}}while(0);k=k+1|0;if((k|0)>=(a[p]|0)){break}}}e=c+161|0;m[e]=1;h=s}function fi(b,c,d){var g=h;h+=1024;var e=g|0,f=Ba(d);Ma(e,EQ|0,(j=h,h+=8,a[j>>2]=c,a[j+4>>2]=f,j));b=a[Bd+(b<<2)>>2];db(b,e);db(b,d);d=(b+4|0)>>2;e=a[d];e>>>0<a[b+8>>2]>>>0||(na(b,1),e=a[d]);b=e+1|0;a[d]=b;m[e]=32;h=g}function FQ(c){var c=a[a[c+16>>2]+8>>2],d=a[U+20>>2];if((d|0)!=(a[U+16>>2]|0)){var e=a[a[a[Kb>>2]+8>>2]+8>>2];d>>>0<a[U+24>>2]>>>0||(na(U+16|0,1),d=a[U+20>>2]);m[d]=0;d=a[U+16>>2];a[U+20>>2]=d;qc(c|0,e,d)}d=a[U+84>>2];(d|0)!=(a[U+80>>2]|0)&&(e=a[a[a[Kb>>2]+12>>2]+8>>2],d>>>0<a[U+88>>2]>>>0||(na(U+80|0,1),d=a[U+84>>2]),m[d]=0,d=a[U+80>>2],a[U+84>>2]=d,qc(c|0,e,d));f[0]=1;a[kc+64>>2]=b[0];a[kc+68>>2]=b[1];f[0]=1;a[kc+80>>2]=b[0];a[kc+84>>2]=b[1]}function GQ(c){var c=a[a[c+16>>2]+8>>2],d=a[U+20>>2];if((d|0)!=(a[U+16>>2]|0)){var e=a[a[a[Kb>>2]+16>>2]+8>>2];d>>>0<a[U+24>>2]>>>0||(na(U+16|0,1),d=a[U+20>>2]);m[d]=0;d=a[U+16>>2];a[U+20>>2]=d;qc(c|0,e,d)}d=a[U+36>>2];(d|0)!=(a[U+32>>2]|0)&&(e=a[a[a[Kb>>2]+24>>2]+8>>2],d>>>0<a[U+40>>2]>>>0||(na(U+32|0,1),d=a[U+36>>2]),m[d]=0,d=a[U+32>>2],a[U+36>>2]=d,qc(c|0,e,d));d=a[U+52>>2];(d|0)!=(a[U+48>>2]|0)&&(e=a[a[a[Kb>>2]+20>>2]+8>>2],d>>>0<a[U+56>>2]>>>0||(na(U+48|0,1),d=a[U+52>>2]),m[d]=0,d=a[U+48>>2],a[U+52>>2]=d,qc(c|0,e,d));d=a[U+84>>2];(d|0)!=(a[U+80>>2]|0)&&(e=a[a[a[Kb>>2]+28>>2]+8>>2],d>>>0<a[U+88>>2]>>>0||(na(U+80|0,1),d=a[U+84>>2]),m[d]=0,d=a[U+80>>2],a[U+84>>2]=d,qc(c|0,e,d));d=a[U+100>>2];(d|0)!=(a[U+96>>2]|0)&&(e=a[a[a[Kb>>2]+36>>2]+8>>2],d>>>0<a[U+104>>2]>>>0||(na(U+96|0,1),d=a[U+100>>2]),m[d]=0,d=a[U+96>>2],a[U+100>>2]=d,qc(c|0,e,d));d=a[U+116>>2];(d|0)!=(a[U+112>>2]|0)&&(e=a[a[a[Kb>>2]+32>>2]+8>>2],d>>>0<a[U+120>>2]>>>0||(na(U+112|0,1),d=a[U+116>>2]),m[d]=0,d=a[U+112>>2],a[U+116>>2]=d,qc(c|0,e,d));f[0]=1;a[kc+72>>2]=b[0];a[kc+76>>2]=b[1];f[0]=1;a[kc+88>>2]=b[0];a[kc+92>>2]=b[1];f[0]=1;a[kc+16>>2]=b[0];a[kc+20>>2]=b[1];f[0]=1;a[kc+24>>2]=b[0];a[kc+28>>2]=b[1];f[0]=1;a[kc+48>>2]=b[0];a[kc+52>>2]=b[1];f[0]=1;a[kc+56>>2]=b[0];a[kc+60>>2]=b[1]}function HQ(c,d,e){var g,q,m=h;h+=1024;g=a[a[c+16>>2]+12>>2];zm(c);Am(c);0==(e|0)?(c=a[Bd+(g<<2)>>2],db(c,IQ|0)):(jy(c),c=a[Bd+(g<<2)>>2],db(c,JQ|0));q=(d|0)>>2;g=(d+8|0)>>2;Ap(c,(b[0]=a[q],b[1]=a[q+1],f[0]),(b[0]=a[g],b[1]=a[g+1],f[0]));var e=m|0,l=d+16|0;q=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])-(b[0]=a[q],b[1]=a[q+1],f[0]);d=d+24|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])-(b[0]=a[g],b[1]=a[g+1],f[0]);d=0>d?d-.5&-1:d+.5&-1;Ma(e,Hl|0,(j=h,h+=8,a[j>>2]=(0>q?q-.5:q+.5)&-1,a[j+4>>2]=d,j));db(c,e);h=m}function zm(c){var d,e,g,q=h;h+=1040;var y,l=q+1024,c=(c+16|0)>>2;d=a[c];e=d+96|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);g=((a[d+12>>2]<<3)+kc|0)>>2;if(e!=(b[0]=a[g],b[1]=a[g+1],f[0])){f[0]=e,a[g]=b[0],a[g+1]=b[1],d=q|0,Ma(d,KQ|0,(j=h,h+=8,f[0]=e,a[j>>2]=b[0],a[j+4>>2]=b[1],j)),fi(a[a[c]+12>>2],ky|0,d),d=a[c]}g=a[d+104>>2];if(0!=(g|0)){fc(l,1024,q|0);var k=a[g>>2],n=0==(k|0);a:do{if(!n){e=(l+4|0)>>2;d=(l+8|0)>>2;for(var z=l|0,p=g,s=k;;){var p=p+4|0,v=m[s];102==v<<24>>24?0!=(ka(s,Hi|0)|0)&&(y=1783):115==v<<24>>24?0!=(ka(s,Cp|0)|0)&&(y=1783):98==v<<24>>24?0!=(ka(s,Wb|0)|0)&&(y=1783):y=1783;if(1783==y){y=0;for(db(l,s);;){var t=s+1|0;if(0==m[s]<<24>>24){break}else{s=t}}if(0!=m[t]<<24>>24){s=a[e];s>>>0<a[d]>>>0||(na(l,1),s=a[e]);v=s+1|0;a[e]=v;m[s]=40;if(0==m[t]<<24>>24){s=v}else{v=t;for(s=0;;){if(0!=(s|0)){var u=a[e];u>>>0<a[d]>>>0||(na(l,1),u=a[e]);a[e]=u+1|0;m[u]=44}for(db(l,v);;){var w=v+1|0;if(0==m[v]<<24>>24){break}else{v=w}}if(0==m[w]<<24>>24){break}else{v=w,s=s+1|0}}s=a[e]}s>>>0<a[d]>>>0||(na(l,1),s=a[e]);a[e]=s+1|0;m[s]=41}s=a[e];s>>>0<a[d]>>>0||(na(l,1),s=a[e]);m[s]=0;s=a[z>>2];a[e]=s;fi(a[a[c]+12>>2],ky|0,s)}s=a[p>>2];if(0==(s|0)){break a}}}}while(0);uc(l)}h=q}function Am(b){b=b+16|0;LQ(a[b>>2]+16|0);fi(a[a[b>>2]+12>>2],ly|0,yq|0)}function Bm(c,d,e,g){var q,y=h;h+=1024;c=a[Bd+(c<<2)>>2];q=(c+4|0)>>2;var l=a[q];l>>>0<a[c+8>>2]>>>0||(na(c,1),l=a[q]);a[q]=l+1|0;m[l]=d;d=y|0;Ma(d,MQ|0,(j=h,h+=4,a[j>>2]=g,j));db(c,d);if(0<(g|0)){for(d=0;!(q=(d<<4)+e|0,l=(d<<4)+e+8|0,Ap(c,(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]),(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])),d=d+1|0,(d|0)==(g|0));){}}h=y}function LQ(b){var c=h,d=m[b+1|0]&255,g=m[b+2|0]&255,e=m[b+3|0]&255;Ma(yq|0,NQ|0,(j=h,h+=16,a[j>>2]=m[b]&255,a[j+4>>2]=d,a[j+8>>2]=g,a[j+12>>2]=e,j));h=c}function jy(b){b=b+16|0;LQ(a[b>>2]+52|0);fi(a[a[b>>2]+12>>2],OQ|0,yq|0)}function PQ(c){var d=a[U+4>>2];if((d|0)==(a[U>>2]|0)){var e=c|0}else{var g=a[a[Kb>>2]>>2],e=c|0;if(0==(g|0)){var d=ac(c,e,Di|0,Y|0,202),g=a[a[Kb>>2]>>2]=d,h=a[U+4>>2]}else{h=d}d=a[g+8>>2];h>>>0<a[U+8>>2]>>>0?g=h:(na(U|0,1),g=a[U+4>>2]);m[g]=0;g=a[U>>2];a[U+4>>2]=g;qc(e,d,g)}0!=(a[c+48>>2]|0)&&(c=a[a[a[Kb>>2]+4>>2]+8>>2],d=a[U+68>>2],d>>>0<a[U+72>>2]>>>0||(na(U+64|0,1),d=a[U+68>>2]),m[d]=0,d=a[U+64>>2],a[U+68>>2]=d,qc(e,c,d));$J(e,QQ|0,RQ|0,Y|0);uc(U|0);uc(U+16|0);uc(U+32|0);uc(U+48|0);uc(U+64|0);uc(U+80|0);uc(U+96|0);uc(U+112|0);G(a[Kb>>2]);f[0]=1;a[kc>>2]=b[0];a[kc+4>>2]=b[1];f[0]=1;a[kc+32>>2]=b[0];a[kc+36>>2]=b[1]}function SQ(b,c,d){var g=Gb(8232);a[Kb>>2]=g;if(0==(a[b+208>>2]|0)){a[g>>2]=0;var e=g}else{g=ac(b,b|0,Di|0,Y|0,202),e=a[Kb>>2],a[e>>2]=g}g=b+149|0;0==(m[g]&8)<<24>>24?a[e+4>>2]=0:(e=ac(b,b|0,zq|0,Y|0,202),a[a[Kb>>2]+4>>2]=e);var e=b,b=(b+40|0)>>2,f=ac(e,a[a[b]>>2]|0,Di|0,Y|0,212);a[a[Kb>>2]+8>>2]=f;f=ac(e,a[a[b]>>2]|0,zq|0,Y|0,212);a[a[Kb>>2]+12>>2]=f;var f=ac(e,a[a[b]+4>>2]|0,Di|0,Y|0,286),h=a[Kb>>2];a[h+16>>2]=f;0==(d|0)?(a[h+20>>2]=0,d=h):(d=ac(e,a[a[b]+4>>2]|0,TQ|0,Y|0,286),f=a[Kb>>2],a[f+20>>2]=d,d=f);0==(c|0)?a[d+24>>2]=0:(c=ac(e,a[a[b]+4>>2]|0,UQ|0,Y|0,286),d=a[Kb>>2],a[d+24>>2]=c);c=d;0==(m[g]&1)<<24>>24?a[c+28>>2]=0:(c=ac(e,a[a[b]+4>>2]|0,zq|0,Y|0,286),d=a[Kb>>2],a[d+28>>2]=c,c=d);0==(m[g]&2)<<24>>24?a[c+32>>2]=0:(c=ac(e,a[a[b]+4>>2]|0,VQ|0,Y|0,286),d=a[Kb>>2],a[d+32>>2]=c,c=d);0==(m[g]&4)<<24>>24?(a[c+36>>2]=0,g=c+40|0):(g=ac(e,a[a[b]+4>>2]|0,WQ|0,Y|0,286),e=a[Kb>>2],a[e+36>>2]=g,g=e+40|0);fc(U|0,1024,g);g=a[Kb>>2];fc(U+16|0,1024,g+1064|0);g=a[Kb>>2];fc(U+32|0,1024,g+2088|0);g=a[Kb>>2];fc(U+48|0,1024,g+3112|0);g=a[Kb>>2];fc(U+64|0,1024,g+4136|0);g=a[Kb>>2];fc(U+80|0,1024,g+5160|0);g=a[Kb>>2];fc(U+96|0,1024,g+6184|0);g=a[Kb>>2];g=g+7208|0;fc(U+112|0,1024,g)}function Aq(c,d,e){e>>=2;1==(c|0)?(a[d>>2]=1,f[0]=10):2==(c|0)?(a[d>>2]=2,f[0]=10):(a[d>>2]=0,f[0]=0);a[e]=b[0];a[e+1]=b[1]}function XQ(b,c,d,g){var e;a[b>>2]=0;for(var f=a[my>>2],h=195075,j=-1,n=0;(n|0)<(f|0);){var m=(D[ny+(n<<1)>>1]<<16>>16)-c|0,p=(D[oy+(n<<1)>>1]<<16>>16)-d|0,s=(D[py+(n<<1)>>1]<<16>>16)-g|0,m=p*p+m*m+s*s|0;if((m|0)<(h|0)){if(0==(m|0)){var v=n;e=1876;break}else{h=m,j=n}}n=n+1|0}if(1876==e){return v}a[my>>2]=f+1|0;if(256==(f|0)){return j}D[ny+(n<<1)>>1]=c&65535;D[oy+(n<<1)>>1]=d&65535;D[py+(n<<1)>>1]=g&65535;a[b>>2]=1;return n}function YQ(c,d,e,g){var q=h,y=a[a[c+16>>2]+16>>2],l=a[rf>>2],k=g+24|0,n=c+348|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])*(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),n=0!=(a[c+356>>2]|0)?1.5707963267948966:0,z=a[g+4>>2],z=0==(z|0)?-1:a[z+20>>2],p=m[g+72|0]<<24>>24,p=108==(p|0)?0:114==(p|0)?2:1,d=0>d?d-.5:d+.5,e=0>e?e-.5:e+.5,g=ZQ(a[g>>2]);N(c,$Q|0,(j=h,h+=72,a[j>>2]=4,a[j+4>>2]=p,a[j+8>>2]=y,a[j+12>>2]=l,a[j+16>>2]=0,a[j+20>>2]=z,f[0]=k,a[j+24>>2]=b[0],a[j+28>>2]=b[1],f[0]=n,a[j+32>>2]=b[0],a[j+36>>2]=b[1],a[j+40>>2]=6,f[0]=0,a[j+44>>2]=b[0],a[j+48>>2]=b[1],f[0]=0,a[j+52>>2]=b[0],a[j+56>>2]=b[1],a[j+60>>2]=d&-1,a[j+64>>2]=e&-1,a[j+68>>2]=g,j));h=q}function aR(b,c){var d,g=h;h+=4;var e;d=(c+32|0)>>2;var f=a[d];if(5==(f|0)){for(f=0;;){var l=a[Mf+(f<<2)>>2];if(8==(f|0)){e=1906;break}var k=a[c>>2];if(m[l]<<24>>24==m[k]<<24>>24&&0==(ka(l,k)|0)){break}f=f+1|0}1906!=e&&(a[c>>2]=f)}else{1==(f|0)?(k=c+1|0,l=c+2|0,e=XQ(g,m[c]&255,m[k]&255,m[l]&255)+32|0,0!=(a[g>>2]|0)&&(f=m[c]&255,k=m[k]&255,l=m[l]&255,N(b,bR|0,(j=h,h+=20,a[j>>2]=0,a[j+4>>2]=e,a[j+8>>2]=f,a[j+12>>2]=k,a[j+16>>2]=l,j))),a[c>>2]=e):sa(qy|0,165,cR|0,vd|0)}a[d]=6;h=g}function dR(c,d,e){var g,q=h;h+=12;var m=q+4,l=a[c+16>>2];g=l>>2;var l=l+96|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])&-1,k=a[g+4],n=a[g+13],z=a[rf>>2];Aq(a[g+22],q,m);g=d|0;var p=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);g=(0>p?p-.5:p+.5)&-1;var s=d+8|0,v=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),s=(0>v?v-.5:v+.5)&-1,t=d+16|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0]),p=t-p,d=d+24|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),v=d-v,u=a[q>>2],m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]);N(c,eR|0,(j=h,h+=88,a[j>>2]=1,a[j+4>>2]=1,a[j+8>>2]=u,a[j+12>>2]=l,a[j+16>>2]=k,a[j+20>>2]=n,a[j+24>>2]=z,a[j+28>>2]=0,a[j+32>>2]=0!=(e|0)?20:-1,f[0]=m,a[j+36>>2]=b[0],a[j+40>>2]=b[1],a[j+44>>2]=0,f[0]=0,a[j+48>>2]=b[0],a[j+52>>2]=b[1],a[j+56>>2]=g,a[j+60>>2]=s,a[j+64>>2]=(0>p?p-.5:p+.5)&-1,a[j+68>>2]=(0>v?v-.5:v+.5)&-1,a[j+72>>2]=g,a[j+76>>2]=s,a[j+80>>2]=(0>t?t-.5:t+.5)&-1,a[j+84>>2]=(0>d?d-.5:d+.5)&-1,j));h=q}function fR(c,d,e,g,q,m){var l,k,n,g=h;h+=92;var q=g+4,z=g+12,p=g+76,s=c+16|0,v=a[s>>2],t=v+96|0,t=(b[0]=a[t>>2],b[1]=a[t+4>>2],f[0])&-1,u=a[v+16>>2],w=a[rf>>2],A=3<(e|0);A||sa(qy|0,354,gR|0,hR|0);var B=Gb(140*e+140|0);Aq(a[v+88>>2],g,q);0==(m|0)?(m=-1,s=0,v=4):(m=20,s=a[a[s>>2]+52>>2],v=5);var C=d|0;l=(b[0]=a[C>>2],b[1]=a[C+4>>2],f[0]);C=z+48|0;n=C|0;f[0]=l;a[n>>2]=b[0];a[n+4>>2]=b[1];n=d+8|0;k=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);n=(z+56|0)>>2;f[0]=k;a[n]=b[0];a[n+1]=b[1];var D=Ma(B,Cm|0,(j=h,h+=8,a[j>>2]=(0>l?l-.5:l+.5)&-1,a[j+4>>2]=(0>k?k-.5:k+.5)&-1,j));a:do{if(A){var E=z|0;k=z>>2;l=C>>2;for(var F=p|0,H=p+8|0,I=z+16|0,J=z+24|0,K=z+32|0,L=z+40|0,Q=z+48|0,S=0,R=1,U=B+D|0,W=3;;){a[k]=a[l];a[k+1]=a[l+1];a[k+2]=a[l+2];a[k+3]=a[l+3];var V=S+1|0,Y=(V<<4)+d|0,Y=(b[0]=a[Y>>2],b[1]=a[Y+4>>2],f[0]);f[0]=Y;a[I>>2]=b[0];a[I+4>>2]=b[1];V=(V<<4)+d+8|0;V=(b[0]=a[V>>2],b[1]=a[V+4>>2],f[0]);f[0]=V;a[J>>2]=b[0];a[J+4>>2]=b[1];V=S+2|0;Y=(V<<4)+d|0;Y=(b[0]=a[Y>>2],b[1]=a[Y+4>>2],f[0]);f[0]=Y;a[K>>2]=b[0];a[K+4>>2]=b[1];V=(V<<4)+d+8|0;V=(b[0]=a[V>>2],b[1]=a[V+4>>2],f[0]);f[0]=V;a[L>>2]=b[0];a[L+4>>2]=b[1];S=S+3|0;V=(S<<4)+d|0;V=(b[0]=a[V>>2],b[1]=a[V+4>>2],f[0]);f[0]=V;a[Q>>2]=b[0];a[Q+4>>2]=b[1];S=(S<<4)+d+8|0;S=(b[0]=a[S>>2],b[1]=a[S+4>>2],f[0]);f[0]=S;a[n]=b[0];a[n+1]=b[1];for(S=1;;){Ld(p,E,3,(S|0)/6,0,0);var V=(b[0]=a[F>>2],b[1]=a[F+4>>2],f[0]),Z=(b[0]=a[H>>2],b[1]=a[H+4>>2],f[0]),V=0>V?V-.5:V+.5,Z=0>Z?Z-.5:Z+.5,Z=U+Ma(U,Cm|0,(j=h,h+=8,a[j>>2]=V&-1,a[j+4>>2]=Z&-1,j))|0,U=S+1|0;if(7==(U|0)){break}else{S=U,U=Z}}R=R+6|0;V=W+3|0;if((V|0)<(e|0)){S=W,U=Z,W=V}else{var $=R;break a}}}else{$=1}}while(0);d=a[g>>2];e=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);N(c,iR|0,(j=h,h+=60,a[j>>2]=3,a[j+4>>2]=v,a[j+8>>2]=d,a[j+12>>2]=t,a[j+16>>2]=u,a[j+20>>2]=s,a[j+24>>2]=w,a[j+28>>2]=0,a[j+32>>2]=m,f[0]=e,a[j+36>>2]=b[0],a[j+40>>2]=b[1],a[j+44>>2]=0,a[j+48>>2]=0,a[j+52>>2]=0,a[j+56>>2]=$,j));N(c,jR|0,(j=h,h+=4,a[j>>2]=B,j));G(B);if(0<($|0)){d=$-1|0;for(e=0;!(N(c,kR|0,(j=h,h+=4,a[j>>2]=0!=(e%d|0)&1,j)),e=e+1|0,(e|0)==($|0));){}}y(c,wd|0);h=g}function ry(c,d,e,g){var q=h,m=0<(e|0);a:do{if(m){for(var l=c,k=0;;){var n=(k<<4)+d|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),n=0>n?n-.5:n+.5,z=(k<<4)+d+8|0,z=(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]),z=0>z?z-.5:z+.5;N(l,Cm|0,(j=h,h+=8,a[j>>2]=n&-1,a[j+4>>2]=z&-1,j));k=k+1|0;if((k|0)==(e|0)){break a}}}}while(0);0!=(g|0)&&(e=d|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),d=d+8|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),N(c,Cm|0,(j=h,h+=8,a[j>>2]=(0>e?e-.5:e+.5)&-1,a[j+4>>2]=(0>d?d-.5:d+.5)&-1,j)));y(c,wd|0);h=q}function ZQ(b){var c=h,d=a[Ij>>2];0==(d|0)&&(a[Bq>>2]=64,d=Gb(64),a[Ij>>2]=d);var g=m[b];if(0==g<<24>>24){return m[d]=0,h=c,d}for(var e=d,d=0;;){var b=b+1|0,f=a[Bq>>2];(d|0)>(f-8|0)?(f<<=1,a[Bq>>2]=f,f=mc(a[Ij>>2],f),a[Ij>>2]=f,f=f+d|0):f=e;-1<g<<24>>24?(92==g<<24>>24&&(m[f]=92,d=d+1|0,f=f+1|0),m[f]=g,d=d+1|0,f=f+1|0):(m[f]=92,Ma(f+1|0,lR|0,(j=h,h+=4,a[j>>2]=g&255,j)),d=d+4|0,f=f+4|0);g=m[b];if(0==g<<24>>24){break}else{e=f}}d=a[Ij>>2];m[f]=0;h=c;return d}function mR(b){var c=a[b+16>>2],d=a[b+64>>2];if(1==(d|0)){var d=c+148|0,g=a[d>>2];0!=(g|0)&&0!=m[g]<<24>>24&&(y(b,sy|0),y(b,nc(a[d>>2])),y(b,gc|0),y(b,nc(a[a[c+8>>2]+12>>2])),y(b,wd|0))}else{3==(d|0)?(c=nc(a[a[c+8>>2]+12>>2]),y(b,nR|0),y(b,c),y(b,oR|0),y(b,c),y(b,ty|0)):0==(d|0)&&(y(b,pR|0),c=c+148|0,d=a[c>>2],0!=(d|0)&&0!=m[d]<<24>>24&&(y(b,sy|0),y(b,nc(a[c>>2])),y(b,wd|0)))}}function Cq(c,d,e,g,q,D,l,k){var n,z=h;if(!(0==(e|0)|0==(g|0))){(a[uy>>2]|0)<(g|0)&&(n=g+10|0,a[uy>>2]=n,n=mc(a[Ue>>2],n<<3),a[Ue>>2]=n);n=0<(g|0);a:do{if(n){for(var p=0;;){var s=(p<<4)+e|0,v=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),s=a[Ue>>2];a[s+(p<<3)>>2]=(0>v?v-.5:v+.5)&-1;v=(p<<4)+e+8|0;v=(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0]);a[s+(p<<3)+4>>2]=(0>v?v-.5:v+.5)&-1;p=p+1|0;if((p|0)==(g|0)){break a}}}}while(0);e=c+64|0;p=a[e>>2];s=0==(q|0);do{if(!(0!=(p|0)|s)&&0!=m[q]<<24>>24){if(2==(d|0)){N(c,qR|0,(j=h,h+=4,a[j>>2]=q,j));a:do{if(n){for(d=0;;){if(q=a[Ue>>2],D=a[q+(d<<3)+4>>2],N(c,rR|0,(j=h,h+=8,a[j>>2]=a[q+(d<<3)>>2],a[j+4>>2]=D,j)),d=d+1|0,(d|0)==(g|0)){break a}}}}while(0);y(c,wd|0)}else{0==(d|0)?(e=a[Ue>>2]>>2,g=a[e],d=a[e+3],D=a[e+2],e=a[e+1],N(c,sR|0,(j=h,h+=20,a[j>>2]=q,a[j+4>>2]=g,a[j+8>>2]=d,a[j+12>>2]=D,a[j+16>>2]=e,j))):1==(d|0)?(D=a[Ue>>2]>>2,g=a[D],d=a[D+1],D=a[D+2]-g|0,N(c,tR|0,(j=h,h+=16,a[j>>2]=q,a[j+4>>2]=g,a[j+8>>2]=d,a[j+12>>2]=D,j))):sa(Dq|0,65,Eq|0,vd|0)}h=z;return}}while(0);if(!(1!=(p|0)|s)&&0!=m[q]<<24>>24){0==(d|0)?(g=a[Ue>>2]>>2,d=a[g+3],e=a[g+2],n=a[g+1],N(c,uR|0,(j=h,h+=24,a[j>>2]=a[g],a[j+4>>2]=d,a[j+8>>2]=e,a[j+12>>2]=n,a[j+16>>2]=q,a[j+20>>2]=D,j))):sa(Dq|0,77,Eq|0,vd|0);h=z;return}if(2>(p-2|0)>>>0){1==(d|0)?y(c,vR|0):0==(d|0)?y(c,wR|0):2==(d|0)?y(c,xR|0):sa(Dq|0,93,Eq|0,vd|0);0!=(k|0)&&0!=m[k]<<24>>24&&(y(c,yR|0),y(c,Bo(k)),y(c,ue|0));!s&&0!=m[q]<<24>>24&&(y(c,zR|0),y(c,Bo(q)),y(c,ue|0));0!=(l|0)&&0!=m[l]<<24>>24&&(y(c,vy|0),y(c,nc(l)),y(c,ue|0));0!=(D|0)&&0!=m[D]<<24>>24&&(y(c,AR|0),y(c,nc(D)),y(c,ue|0));y(c,BR|0);y(c,CR|0);a:do{if(2==(d|0)){if(q=a[Ue>>2],D=a[q+4>>2],N(c,DR|0,(j=h,h+=8,a[j>>2]=a[q>>2],a[j+4>>2]=D,j)),1<(g|0)){for(q=1;;){if(D=a[Ue>>2],n=a[D+(q<<3)+4>>2],N(c,ER|0,(j=h,h+=8,a[j>>2]=a[D+(q<<3)>>2],a[j+4>>2]=n,j)),q=q+1|0,(q|0)==(g|0)){break a}}}}else{1==(d|0)?(n=a[Ue>>2]>>2,q=a[n],D=a[n+1],n=a[n+2]-q|0,N(c,FR|0,(j=h,h+=12,a[j>>2]=q,a[j+4>>2]=D,a[j+8>>2]=n,j))):0==(d|0)&&(q=a[Ue>>2]>>2,D=a[q+3],n=a[q+2],l=a[q+1],N(c,GR|0,(j=h,h+=16,a[j>>2]=a[q],a[j+4>>2]=D,a[j+8>>2]=n,a[j+12>>2]=l,j)))}}while(0);3==(a[e>>2]|0)?y(c,Dm|0):y(c,ty|0)}}h=z}function HR(b){var c,d=b>>2,e=h;h+=8;var f=a[d+4];m[Fq]=0;c=(b+12|0)>>2;var D=f+8|0;if(0==(a[a[c]+28>>2]|0)){N(b,IR|0,(j=h,h+=4,a[j>>2]=a[a[D>>2]+12>>2],j));var l=b+64|0;2==(a[l>>2]|0)?y(b,JR|0):y(b,KR|0);if(0==(a[a[c]+20>>2]|0)){if(2==(a[l>>2]|0)){var l=a[d+113],k=a[d+114],n=a[d+115];N(b,wy|0,(j=h,h+=16,a[j>>2]=a[d+112],a[j+4>>2]=l,a[j+8>>2]=k,a[j+12>>2]=n,j))}else{y(b,LR|0)}}y(b,MR|0);np(b,a[a[c]+24>>2],I|0);d=h;l=a[bj>>2];if(0!=(l|0)&&(l=J[a[l>>2]](l,0,128),0!=(l|0))){for(;!(0==m[l+16|0]<<24>>24&&(N(b,NR|0,(j=h,h+=4,a[j>>2]=a[l+12>>2],j)),y(b,OR|0),Pu(b,l),y(b,PR|0),y(b,QR|0)),k=a[bj>>2],l=J[a[k>>2]](k,l,8),0==(l|0));){}}h=d;c=a[a[c]+20>>2];0!=(c|0)&&(d=e|0,a[d>>2]=a[c>>2],a[e+4>>2]=0,np(b,0,d))}a[Gq>>2]=1==m[a[D>>2]+151|0]<<24>>24&1;m[Fq]||(y(b,RR|0),m[Fq]=1);f=a[f+148>>2];0!=(f|0)&&N(b,SR|0,(j=h,h+=4,a[j>>2]=f,j));h=e}function TR(c){var d,e=c>>2,g=h,q=a[e+112],m=a[e+113],l=a[e+114],k=a[e+115];d=(c+12|0)>>2;var n=a[a[d]+28>>2]+1|0;N(c,UR|0,(j=h,h+=8,a[j>>2]=n,a[j+4>>2]=n,j));0==(a[a[d]+20>>2]|0)&&N(c,VR|0,(j=h,h+=16,a[j>>2]=q,a[j+4>>2]=m,a[j+8>>2]=l,a[j+12>>2]=k,j));var z=c+356|0,n=0!=(a[z>>2]|0)?WR|0:XR|0;N(c,YR|0,(j=h,h+=4,a[j>>2]=n,j));n=c+64|0;1==(a[n>>2]|0)&&N(c,ZR|0,(j=h,h+=8,a[j>>2]=l,a[j+4>>2]=k,j));var p=a[e+49],s=a[e+50];N(c,$R|0,(j=h,h+=12,a[j>>2]=a[e+48],a[j+4>>2]=p,a[j+8>>2]=s,j));0==(a[a[d]+20>>2]|0)&&N(c,aS|0,(j=h,h+=16,a[j>>2]=q,a[j+4>>2]=m,a[j+8>>2]=l-q|0,a[j+12>>2]=k-m|0,j));var e=c+480|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),p=c+488|0,p=(b[0]=a[p>>2],b[1]=a[p+4>>2],f[0]),z=a[z>>2],s=c+496|0,s=(b[0]=a[s>>2],b[1]=a[s+4>>2],f[0]),v=c+504|0,v=(b[0]=a[v>>2],b[1]=a[v+4>>2],f[0]);N(c,bS|0,(j=h,h+=36,f[0]=e,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=p,a[j+8>>2]=b[0],a[j+12>>2]=b[1],a[j+16>>2]=z,f[0]=s,a[j+20>>2]=b[0],a[j+24>>2]=b[1],f[0]=v,a[j+28>>2]=b[0],a[j+32>>2]=b[1],j));if(1==(a[n>>2]|0)){if(14399<(l|0)|14399<(k|0)){J[a[a[d]+16>>2]](cS|0,(j=h,h+=12,a[j>>2]=l,a[j+4>>2]=k,a[j+8>>2]=14400,j))}N(c,dS|0,(j=h,h+=16,a[j>>2]=q,a[j+4>>2]=m,a[j+8>>2]=l,a[j+12>>2]=k,j))}h=g}function eS(c,d,e,g){var h;h=(c+16|0)>>2;do{if(0!=(g|0)){var j=a[h],l=j+76|0;if(.5<(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])){Nf(c,j+52|0);j=c;y(j,Jj|0);var l=d|0,k=d+8|0;Hd(j,(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]));y(j,Kj|0);l=1<(e|0);a:do{if(l){for(k=1;;){var n=(k<<4)+d|0,m=(k<<4)+d+8|0;Hd(j,(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]));y(j,Hq|0);k=k+1|0;if((k|0)==(e|0)){break a}}}}while(0);y(j,xy|0)}}}while(0);g=a[h]+40|0;if(.5<(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])){Em(c);Nf(c,a[h]+16|0);y(c,Jj|0);h=d|0;g=d+8|0;Hd(c,(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]));y(c,Kj|0);h=1<(e|0);a:do{if(h){for(g=1;;){if(j=(g<<4)+d|0,l=(g<<4)+d+8|0,Hd(c,(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])),y(c,Hq|0),g=g+1|0,(g|0)==(e|0)){break a}}}}while(0);y(c,fS|0)}}function gS(c,d,e,g,h,j){g=(c+16|0)>>2;do{if(0!=(j|0)){var h=a[g],l=h+76|0;if(.5<(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])){Nf(c,h+52|0);h=c;y(h,Jj|0);var l=d|0,k=d+8|0;Hd(h,(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]));y(h,Kj|0);l=1<(e|0);a:do{if(l){for(k=1;;){if(kf(h,(k<<4)+d|0,3),y(h,yy|0),k=k+3|0,(k|0)>=(e|0)){break a}}}}while(0);y(h,xy|0)}}}while(0);j=a[g]+40|0;if(.5<(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0])){Em(c);Nf(c,a[g]+16|0);y(c,Jj|0);j=d|0;g=d+8|0;Hd(c,(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]));y(c,Kj|0);j=1<(e|0);a:do{if(j){for(g=1;;){if(kf(c,(g<<4)+d|0,3),y(c,yy|0),g=g+3|0,(g|0)>=(e|0)){break a}}}}while(0);y(c,zy|0)}}function Nf(c,d){var e=h;if(0!=(d|0)){var g=a[a[c+16>>2]+4>>2],g=2==(g|0)?jh|0:3==(g|0)?Dg|0:0==(g|0)||1==(g|0)?Yf|0:hS|0,m=d|0,m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]),y=d+8|0,y=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),l=d+16|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);N(c,iS|0,(j=h,h+=28,f[0]=m,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=y,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=l,a[j+16>>2]=b[0],a[j+20>>2]=b[1],a[j+24>>2]=g,j))}h=e}function Em(c){var d=h,e,g=c+16|0,q=a[g>>2],D=q+96|0,q=a[q+104>>2];gj(c,(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]));for(y(c,jS|0);;){if(0==(q|0)){e=2216;break}D=q+4|0;q=a[q>>2];if(0==(q|0)){e=2217;break}if(0!=(ka(q,Cp|0)|0)){for(var l=q;;){var k=l+1|0;if(0==m[l]<<24>>24){break}else{l=k}}l=0==m[k]<<24>>24;a:do{if(!l){for(var n=k;;){for(N(c,kS|0,(j=h,h+=4,a[j>>2]=n,j));;){var z=n+1|0;if(0==m[n]<<24>>24){break}else{n=z}}if(0==m[z]<<24>>24){break a}else{n=z}}}}while(0);0==(ka(q,qh|0)|0)&&(l=a[g>>2]+96|0,f[0]=0,a[l>>2]=b[0],a[l+4>>2]=b[1]);N(c,lS|0,(j=h,h+=4,a[j>>2]=q,j))}q=D}2216==e?h=d:2217==e&&(h=d)}function mS(c,d,e,g){var q=h,D=a[c+16>>2];y(c,nS|0);var l=m[g+72|0]<<24>>24;108==(l|0)?y(c,oS|0):114==(l|0)?y(c,pS|0):y(c,qS|0);l=g+48|0;e=-((b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])+e);N(c,rS|0,(j=h,h+=16,f[0]=d,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=e,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));d=a[g+4>>2];if(0==(d|0)){N(c,sS|0,(j=h,h+=4,a[j>>2]=a[g+20>>2],j))}else{e=a[a[a[c>>2]+128>>2]+252>>2];if(1==(e|0)){var l=d+16|0,k=d+8|0,e=d|0}else{2==(e|0)?(l=d+32|0,k=d+28|0,e=d+24|0):(l=d+16|0,k=d+8|0,e=d+4|0)}var l=a[l>>2],k=a[k>>2],n=a[d+12>>2];N(c,tS|0,(j=h,h+=4,a[j>>2]=a[e>>2],j));d=a[d+24>>2];0!=(d|0)&&N(c,uS|0,(j=h,h+=4,a[j>>2]=d,j));y(c,ue|0);0!=(k|0)&&N(c,vS|0,(j=h,h+=4,a[j>>2]=k,j));0!=(n|0)&&N(c,wS|0,(j=h,h+=4,a[j>>2]=n,j));0!=(l|0)&&N(c,xS|0,(j=h,h+=4,a[j>>2]=l,j))}d=g+24|0;N(c,yS|0,(j=h,h+=8,f[0]=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),a[j>>2]=b[0],a[j+4>>2]=b[1],j));d=D+16|0;D=a[D+48>>2];5==(D|0)?0!=(Lb(a[d>>2],Ac|0)|0)&&N(c,zS|0,(j=h,h+=4,a[j>>2]=a[d>>2],j)):1==(D|0)?(D=m[d+1|0]&255,e=m[d+2|0]&255,N(c,AS|0,(j=h,h+=12,a[j>>2]=m[d]&255,a[j+4>>2]=D,a[j+8>>2]=e,j))):sa(Ay|0,379,BS|0,vd|0);y(c,CS|0);g=(g|0)>>2;g=a[g];g=nc(g);y(c,g);y(c,DS|0);h=q}function Fm(c,d){var e,g=h,q=a[c+16>>2];e=q>>2;y(c,ES|0);if(0==(d|0)){y(c,sg|0)}else{var D=q+52|0;FS(c,D);1==(a[e+21]|0)&&(D=m[D+3|0],0==D<<24>>24||-1==D<<24>>24||N(c,GS|0,(j=h,h+=8,f[0]=(D&255)/255,a[j>>2]=b[0],a[j+4>>2]=b[1],j)))}y(c,HS|0);D=q+16|0;FS(c,D);q=q+96|0;q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]);1!=q&&N(c,IS|0,(j=h,h+=8,f[0]=q,a[j>>2]=b[0],a[j+4>>2]=b[1],j));q=a[e+22];1==(q|0)?N(c,By|0,(j=h,h+=4,a[j>>2]=JS|0,j)):2==(q|0)&&N(c,By|0,(j=h,h+=4,a[j>>2]=KS|0,j));1==(a[e+12]|0)&&(e=m[D+3|0],0==e<<24>>24||-1==e<<24>>24||N(c,LS|0,(j=h,h+=8,f[0]=(e&255)/255,a[j>>2]=b[0],a[j+4>>2]=b[1],j)));y(c,ue|0);h=g}function FS(b,c){var d=h,e=c,c=h;h+=36;for(var e=e>>2,f=c>>2,D=e+9;e<D;e++,f++){a[f]=a[e]}e=a[c+32>>2];5==(e|0)?y(b,a[c>>2]):1==(e|0)?0==m[c+3|0]<<24>>24?y(b,sg|0):(e=a[c>>2],N(b,Iq|0,(j=h,h+=12,a[j>>2]=e&255,a[j+4>>2]=e>>>8&255,a[j+8>>2]=e>>>16&255,j))):sa(Ay|0,86,MS|0,vd|0);h=d}function NS(c,d,e,g){var q=h,D=a[c+16>>2];if(0!=(a[D+88>>2]|0)){var l=g+24|0,k=c+348|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])*(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])&-1;0!=(l|0)&&(Gm(c),y(c,OS|0),Hd(c,d,e-.55*(l|0)),y(c,PS|0),y(c,a[g>>2]),y(c,QS|0),y(c,Lj|0),gi(c,D+16|0),y(c,RS|0),d=a[g+4>>2],d=a[(0==(d|0)?g+20|0:d+4|0)>>2],y(c,ue|0),y(c,d),y(c,ue|0),N(c,SS|0,(j=h,h+=4,a[j>>2]=l,j)),g=m[g+72|0]<<24>>24,108==(g|0)?y(c,TS|0):114==(g|0)&&y(c,US|0),Mj(c),y(c,wd|0))}h=q}function VS(c,d,e){var g,h,j,l=a[c+16>>2];j=(l+88|0)>>2;if(0!=(a[j]|0)){h=d+16|0;var k=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]);h=(d|0)>>2;var n=(b[0]=a[h],b[1]=a[h+1],f[0]);g=d+24|0;var m=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);g=(d+8|0)>>2;var p=(b[0]=a[g],b[1]=a[g+1],f[0]);f[0]=n-(k-n);a[h]=b[0];a[h+1]=b[1];f[0]=p-(m-p);a[g]=b[0];a[g+1]=b[1];Gm(c);y(c,WS|0);kf(c,d,2);y(c,Lj|0);0==(e|0)?0==(a[tg>>2]|0)?y(c,oj|0):y(c,hf|0):gi(c,l+52|0);1==(a[tg>>2]|0)&&(a[tg>>2]=0);y(c,Jq|0);d=l+96|0;gj(c,(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]));y(c,Cy|0);gi(c,l+16|0);l=a[j];1==(l|0)?(y(c,Hm|0),j=a[j]):j=l;2==(j|0)&&y(c,Im|0);Mj(c);y(c,wd|0)}}function XS(c,d,e,g){var h,j=a[c+16>>2];h=(j+88|0)>>2;0!=(a[h]|0)&&(Gm(c),y(c,YS|0),kf(c,d,e),y(c,Lj|0),0==(g|0)?0==(a[tg>>2]|0)?y(c,oj|0):y(c,hf|0):gi(c,j+52|0),1==(a[tg>>2]|0)&&(a[tg>>2]=0),y(c,Jq|0),d=j+96|0,gj(c,(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])),y(c,Cy|0),gi(c,j+16|0),j=a[h],1==(j|0)?(y(c,Hm|0),h=a[h]):h=j,2==(h|0)&&y(c,Im|0),Mj(c),y(c,wd|0))}function Gm(b){0==m[b+140|0]<<24>>24?y(b,ZS|0):y(b,a[b+144>>2])}function gi(b,c){var d=h,e=c,c=h;h+=36;for(var e=e>>2,f=c>>2,D=e+9;e<D;e++,f++){a[f]=a[e]}e=a[c+32>>2];1==(e|0)?0==m[c+3|0]<<24>>24?y(b,oj|0):(e=a[c>>2],N(b,Iq|0,(j=h,h+=12,a[j>>2]=e&255,a[j+4>>2]=e>>>8&255,a[j+8>>2]=e>>>16&255,j))):5==(e|0)?y(b,a[c>>2]):sa(Dy|0,51,$S|0,vd|0);h=d}function Mj(b){var c,d=h;c=a[b+16>>2]>>2;var e=a[c+3];if(9==(e|0)||2==(e|0)||3==(e|0)){var f=a[a[c+2]>>2]>>8,m=Dg|0,l=1}else{8==(e|0)?(f=a[a[c+2]>>2]>>8,m=jh|0,l=1):0==(e|0)?(f=a[a[c+2]>>2]>>8,m=Yf|0,l=1):4==(e|0)?(f=a[a[c+2]>>2]>>8,m=aT|0,l=0):10==(e|0)?(f=a[a[c+2]>>2]>>8,m=jh|0,l=0):11==(e|0)||6==(e|0)||7==(e|0)?(f=a[a[c+2]>>2]>>8,m=Dg|0,l=0):5==(e|0)?(f=a[a[c+2]>>2]>>8,m=Yf|0,l=0):1==(e|0)?(f=a[a[c+2]>>2]>>8,m=Yf|0,l=1):sa(Dy|0,148,bT|0,vd|0)}N(b,cT|0,(j=h,h+=12,a[j>>2]=l,a[j+4>>2]=m,a[j+8>>2]=f,j));h=d}function Of(b){var c=h;h+=16;var d,e=a[Kq>>2];if(0==(e|0)){a[Lq>>2]=64;var e=Cb(64),f=a[Kq>>2]=e}else{f=e}var e=c+15|0,j=c+14|0,l=b,k=f,n=b=0,z=0,p=0,s=f;a:for(;;){for(var v=0==(b|0),f=l,t=k,l=z,k=p,u=s;;){if(0==(f|0)){d=2456;break a}var w=m[f];if(0==w<<24>>24){d=2455;break a}var A=a[Lq>>2];(n|0)>(A-8|0)?(A<<=1,a[Lq>>2]=A,w=wb(u,A),a[Kq>>2]=w,A=w+n|0,p=m[f]):(A=t,p=w,w=u);if(32==p<<24>>24){d=2433;break}else{if(38==p<<24>>24){d=2432;break}else{if(60==p<<24>>24){var y=wo|0,C=4;d=2447;break}else{if(45==p<<24>>24){var D=k,E=l,F=5,G=kt|0;break}else{if(62==p<<24>>24){var H=4,I=yo|0;d=2449;break}}}}}if(34==p<<24>>24){y=zo|0;C=6;d=2447;break}else{if(39==p<<24>>24){H=5;I=Ao|0;d=2449;break}}if(0<=p<<24>>24){y=f;C=1;d=2447;break}for(var J=0,K=127,L=p&255;;){var N=J+1|0,S=K&L,K=K>>>1;if(K>>>0<S>>>0){J=N,L=S}else{break}}0<(J|0)?(K=N,J=S):(K=l,J=(k<<6)+S|0);K=K-1|0;L=f+1|0;if(0<(K|0)){f=L,t=A,l=K,k=J,u=w}else{d=2443;break}}do{if(2433==d){v?d=2436:32==m[b]<<24>>24?(y=lt|0,C=6,d=2447):d=2436}else{if(2432==d){d=f+1|0;p=m[d];if(35!=p<<24>>24){for(;;){s=d+1|0;if(!(26>(p-97&255)|26>(p-65&255))){var Q=p;break}d=s;p=m[s]}}else{if(d=f+2|0,p=m[d],120==p<<24>>24||88==p<<24>>24){for(d=f+3|0;;){if(p=m[d],10>(p-48&255)|6>(p-97&255)|6>(p-65&255)){d=d+1|0}else{Q=p;break}}}else{for(;;){s=d+1|0;if(10<=(p-48&255)){Q=p;break}d=s;p=m[s]}}}d=59==Q<<24>>24;d&=1;0==(d|0)?(y=xo|0,C=5,d=2447):d=2436}else{if(2443==d){d=0;m[e]=59;p=j;s=3;for(z=J;;){var R=p-1|0;m[p]=((z>>>0)%10|48)&255;var U=Math.floor((z>>>0)/10),V=s+1|0;if(12<(V|0)){d=2445;break a}if(9<z>>>0){p=R,s=V,z=U}else{break}}p=p-2|0;m[R]=35;m[p]=38;if(0==(V|0)){l=L;k=A;b=f;z=K;p=U;s=w;continue a}else{D=U,E=K,F=V,G=p}}else{2449==d&&(d=0,D=k,E=l,F=H,G=I)}}}}while(0);2436==d&&(y=f,C=1,d=2447);2447==d&&(d=0,D=k,E=l,F=C,G=y);n=F+n|0;l=F;b=G;for(v=A;;){l=l-1|0;m[v]=m[b];if(0==(l|0)){break}b=b+1|0;v=v+1|0}l=f+1|0;k=A+F|0;b=f;z=E;p=D;s=w}if(2445==d){Lc(dT|0,46,1,a[oa>>2]),Pe()}else{if(2455==d||2456==d){return m[t]=0,h=c,u}}}function eT(c){var d=h,e=a[c+16>>2],g=c+228|0,q=c+212|0;a[$d>>2]=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0])&-1;g=c+220|0;q=c+204|0;a[Ug>>2]=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0])&-1;y(c,fT|0);y(c,gT|0);e=a[a[e+8>>2]+12>>2];0!=m[e]<<24>>24&&(y(c,hT|0),y(c,Of(e)),y(c,iT|0));N(c,jT|0,(j=h,h+=4,a[j>>2]=a[c+164>>2]*a[c+160>>2]|0,j));y(c,kT|0);y(c,lT|0);y(c,mT|0);y(c,nT|0);y(c,oT|0);y(c,pT|0);y(c,qT|0);y(c,rT|0);y(c,sT|0);y(c,tT|0);y(c,uT|0);y(c,vT|0);y(c,wT|0);y(c,Ey|0);y(c,Fy|0);y(c,Jm|0);y(c,Gy|0);y(c,Km|0);y(c,Lm|0);y(c,Hy|0);y(c,Iy|0);y(c,Jm|0);y(c,Jy|0);y(c,Km|0);y(c,Lm|0);y(c,xT|0);y(c,Ey|0);y(c,Fy|0);y(c,Jm|0);y(c,Jy|0);y(c,Km|0);y(c,Lm|0);y(c,Hy|0);y(c,Iy|0);y(c,Jm|0);y(c,Gy|0);y(c,Km|0);y(c,Lm|0);y(c,yT|0);y(c,zT|0);y(c,AT|0);y(c,BT|0);y(c,CT|0);y(c,DT|0);e=a[Ug>>2];g=a[$d>>2]+10|0;N(c,ET|0,(j=h,h+=8,a[j>>2]=e,a[j+4>>2]=g,j));y(c,FT|0);y(c,GT|0);y(c,HT|0);y(c,IT|0);y(c,JT|0);e=a[Ug>>2];g=a[$d>>2];N(c,KT|0,(j=h,h+=8,a[j>>2]=e,a[j+4>>2]=g,j));e=a[Ug>>2];g=a[$d>>2];N(c,LT|0,(j=h,h+=8,a[j>>2]=e,a[j+4>>2]=g,j));h=d}function MT(c,d,e,g){var q,D=h,l=a[c+16>>2],k=m[g+72|0]<<24>>24;if(108==(k|0)){var n=g+56|0,k=d,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])}else{114==(k|0)?(k=g+56|0,n=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),k=d-n):(k=g+56|0,n=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),k=d-.5*n)}q=(g+64|0)>>2;var z=(b[0]=a[q],b[1]=a[q+1],f[0]),d=(g+24|0)>>2,p=(b[0]=a[d],b[1]=a[d+1],f[0]);z<p&&(z=1.1*p+1,f[0]=z,a[q]=b[0],a[q+1]=b[1]);q=k-8;var e=(a[$d>>2]>>>0)-e,s=p/5,p=12>p?s+1.4:s+2,z=e-z+p;N(c,NT|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));N(c,Ky|0,(j=h,h+=16,f[0]=q,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=z,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));N(c,Ly|0,(j=h,h+=16,f[0]=k+(n+8)-q,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=e+p-z,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));y(c,OT|0);y(c,PT|0);e=(g+4|0)>>2;k=a[e];0==(k|0)?N(c,My|0,(j=h,h+=4,a[j>>2]=a[g+20>>2],j)):(N(c,My|0,(j=h,h+=4,a[j>>2]=a[k+4>>2],j)),k=a[e],n=a[k+8>>2],0!=(n|0)&&(N(c,QT|0,(j=h,h+=4,a[j>>2]=n,j)),k=a[e]),n=a[k+12>>2],0==(n|0)?e=k:(N(c,RT|0,(j=h,h+=4,a[j>>2]=n,j)),e=a[e]),e=a[e+16>>2],0!=(e|0)&&N(c,ST|0,(j=h,h+=4,a[j>>2]=e,j)));N(c,TT|0,(j=h,h+=8,f[0]=(b[0]=a[d],b[1]=a[d+1],f[0]),a[j>>2]=b[0],a[j+4>>2]=b[1],j));d=l+16|0;l=a[l+48>>2];1==(l|0)?(l=m[d+1|0]&255,e=m[d+2|0]&255,N(c,UT|0,(j=h,h+=12,a[j>>2]=m[d]&255,a[j+4>>2]=l,a[j+8>>2]=e,j))):5==(l|0)?0!=(Lb(a[d>>2],Ac|0)|0)&&N(c,VT|0,(j=h,h+=4,a[j>>2]=a[d>>2],j)):sa(Ny|0,442,WT|0,vd|0);y(c,XT|0);g=(g|0)>>2;g=a[g];g=Of(g);y(c,g);y(c,YT|0);y(c,ZT|0);h=D}function Mq(c){var d=h,e=a[c+16>>2];y(c,$T|0);aU(c,e+16|0);var g=e+96|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);1!=g&&N(c,bU|0,(j=h,h+=8,f[0]=g,a[j>>2]=b[0],a[j+4>>2]=b[1],j));e=a[e+88>>2];2==(e|0)?y(c,cU|0):1==(e|0)&&y(c,dU|0);y(c,eU|0);h=d}function aU(b,c){var d=h,e=c,c=h;h+=36;for(var e=e>>2,f=c>>2,D=e+9;e<D;e++,f++){a[f]=a[e]}e=a[c+32>>2];1==(e|0)?0==m[c+3|0]<<24>>24?y(b,sg|0):(e=a[c>>2],N(b,Iq|0,(j=h,h+=12,a[j>>2]=e&255,a[j+4>>2]=e>>>8&255,a[j+8>>2]=e>>>16&255,j))):5==(e|0)?y(b,a[c>>2]):sa(Ny|0,95,fU|0,vd|0);h=d}function Oy(b,c){if(0==(c|0)){y(b,gU|0)}else{var d=a[b+16>>2];y(b,hU|0);aU(b,d+52|0);y(b,iU|0)}}function jU(c,d,e){var g,q=d>>2,y=h;h+=72;g=e>>2;e=h;h+=32;a[e>>2]=a[g];a[e+4>>2]=a[g+1];a[e+8>>2]=a[g+2];a[e+12>>2]=a[g+3];a[e+16>>2]=a[g+4];a[e+20>>2]=a[g+5];a[e+24>>2]=a[g+6];a[e+28>>2]=a[g+7];var l;0==(c|0)&&sa(pd|0,146,Nq|0,Nj|0);0==(d|0)&&sa(pd|0,147,Nq|0,Oh|0);0==(a[q+2]|0)&&sa(pd|0,148,Nq|0,Ph|0);g=(d+52|0)>>2;if(0==(a[g]|0)){l=2592}else{var k=d+60|0,n=a[k>>2];100!=(n|0)&&(J[n](d),a[g]=0,a[k>>2]=0,a[q+14]=0,l=2592)}if(2592==l){if(0==JK(d)<<24>>24){h=y;return}l=a[q+5];2>(a[q+6]-6|0)>>>0&&(kC(l,y),k=a[y+28>>2],a[q+14]=k,n=Gb(k),a[g]=n,sr(l,n,k),m[d+16|0]=1);0!=(a[g]|0)&&(a[q+15]=100);LK(d);if(0==(a[g]|0)){h=y;return}}g=e|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(a[q+8]|0);e=e+8|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])-(a[q+9]|0);N(c,kU|0,(j=h,h+=16,f[0]=g,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=e,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));0==m[d+16|0]<<24>>24?N(c,lU|0,(j=h,h+=4,a[j>>2]=a[q+3],j)):Pu(c,d);N(c,Mm|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));h=y}function mU(c,d,e){var g,m=h;g=e>>2;e=h;h+=32;a[e>>2]=a[g];a[e+4>>2]=a[g+1];a[e+8>>2]=a[g+2];a[e+12>>2]=a[g+3];a[e+16>>2]=a[g+4];a[e+20>>2]=a[g+5];a[e+24>>2]=a[g+6];a[e+28>>2]=a[g+7];0==(c|0)&&sa(pd|0,90,Oq|0,Nj|0);0==(d|0)&&sa(pd|0,91,Oq|0,Oh|0);d=d+8|0;0==(a[d>>2]|0)&&sa(pd|0,92,Oq|0,Ph|0);g=e|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);g=(0>g?g-.5:g+.5)&-1;var y=e+8|0,y=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),y=(0>y?y-.5:y+.5)&-1,l=e+16|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),l=(0>l?l-.5:l+.5)&-1,e=e+24|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),e=(0>e?e-.5:e+.5)&-1,d=a[d>>2];N(c,nU|0,(j=h,h+=76,a[j>>2]=2,a[j+4>>2]=5,a[j+8>>2]=0,a[j+12>>2]=0,a[j+16>>2]=0,a[j+20>>2]=-1,a[j+24>>2]=1,a[j+28>>2]=-1,a[j+32>>2]=0,f[0]=0,a[j+36>>2]=b[0],a[j+40>>2]=b[1],a[j+44>>2]=0,a[j+48>>2]=0,a[j+52>>2]=0,a[j+56>>2]=0,a[j+60>>2]=0,a[j+64>>2]=5,a[j+68>>2]=0,a[j+72>>2]=d,j));N(c,oU|0,(j=h,h+=40,a[j>>2]=g,a[j+4>>2]=y,a[j+8>>2]=g,a[j+12>>2]=e,a[j+16>>2]=l,a[j+20>>2]=e,a[j+24>>2]=l,a[j+28>>2]=y,a[j+32>>2]=g,a[j+36>>2]=y,j));h=m}function pU(c,d,e){var g,m=h;g=e>>2;e=h;h+=32;a[e>>2]=a[g];a[e+4>>2]=a[g+1];a[e+8>>2]=a[g+2];a[e+12>>2]=a[g+3];a[e+16>>2]=a[g+4];a[e+20>>2]=a[g+5];a[e+24>>2]=a[g+6];a[e+28>>2]=a[g+7];0==(c|0)&&sa(pd|0,49,Pq|0,Nj|0);0==(d|0)&&sa(pd|0,50,Pq|0,Oh|0);d=d+8|0;0==(a[d>>2]|0)&&sa(pd|0,51,Pq|0,Ph|0);y(c,qU|0);y(c,a[d>>2]);var d=c+356|0,D=e+16|0;if(0==(a[d>>2]|0)){d=D|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);g=e|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);var l=e+24|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),e=e+8|0,e=l-(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);N(c,rU|0,(j=h,h+=32,f[0]=d-g,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=e,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=g,a[j+16>>2]=b[0],a[j+20>>2]=b[1],f[0]=-l,a[j+24>>2]=b[0],a[j+28>>2]=b[1],j))}else{g=e+24|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),l=e+8|0,l=g-(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),D|=0,D=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),e|=0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),N(c,sU|0,(j=h,h+=32,f[0]=l,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=D-e,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=e,a[j+16>>2]=b[0],a[j+20>>2]=b[1],f[0]=g,a[j+24>>2]=b[0],a[j+28>>2]=b[1],j)),N(c,tU|0,(j=h,h+=20,a[j>>2]=a[d>>2],f[0]=e,a[j+4>>2]=b[0],a[j+8>>2]=b[1],f[0]=g,a[j+12>>2]=b[0],a[j+16>>2]=b[1],j))}y(c,Py|0);h=m}function Gb(b){do{if(245>b>>>0){var c=11>b>>>0?16:b+11&-8,d=c>>>3,e=a[E>>2],f=e>>>(d>>>0);if(0!=(f&3|0)){var h=(f&1^1)+d|0,j=h<<1,c=(j<<2)+E+40|0,d=(j+2<<2)+E+40|0,b=a[d>>2],j=b+8|0,f=a[j>>2];(c|0)==(f|0)?a[E>>2]=e&(1<<h^-1):f>>>0<a[E+16>>2]>>>0?S():(a[d>>2]=f,a[f+12>>2]=c);h<<=3;a[b+4>>2]=h|3;h=b+(h|4)|0;a[h>>2]|=1;return j}if(c>>>0>a[E+8>>2]>>>0){if(0==(f|0)){if(0==(a[E+4>>2]|0)){e=c;break}j=uU(c);if(0==(j|0)){e=c;break}return j}var b=2<<d,b=f<<d&(b|-b),d=(b&-b)-1|0,b=d>>>12&16,f=d>>>(b>>>0),d=f>>>5&8,k=f>>>(d>>>0),f=k>>>2&4,n=k>>>(f>>>0),k=n>>>1&2,n=n>>>(k>>>0),m=n>>>1&1,f=(d|b|f|k|m)+(n>>>(m>>>0))|0,b=f<<1,k=(b<<2)+E+40|0,n=(b+2<<2)+E+40|0,d=a[n>>2],b=d+8|0,m=a[b>>2];(k|0)==(m|0)?a[E>>2]=e&(1<<f^-1):m>>>0<a[E+16>>2]>>>0?S():(a[n>>2]=m,a[m+12>>2]=k);f<<=3;e=f-c|0;a[d+4>>2]=c|3;k=d;d=k+c|0;a[k+(c|4)>>2]=e|1;a[k+f>>2]=e;m=a[E+8>>2];0!=(m|0)&&(c=a[E+20>>2],k=m>>>2&1073741822,f=(k<<2)+E+40|0,n=a[E>>2],m=1<<(m>>>3),0==(n&m|0)?(a[E>>2]=n|m,j=f,h=(k+2<<2)+E+40|0):(k=(k+2<<2)+E+40|0,n=a[k>>2],n>>>0<a[E+16>>2]>>>0?S():(j=n,h=k)),a[h>>2]=c,a[j+12>>2]=c,a[c+8>>2]=j,a[c+12>>2]=f);a[E+8>>2]=e;a[E+20>>2]=d;return j=b}e=c}else{if(4294967231<b>>>0){e=-1}else{if(e=b+11&-8,0!=(a[E+4>>2]|0)&&(c=vU(e),0!=(c|0))){return j=c}}}}while(0);h=a[E+8>>2];e>>>0>h>>>0?(j=a[E+12>>2],e>>>0<j>>>0?(j=j-e|0,a[E+12>>2]=j,h=a[E+24>>2],a[E+24>>2]=h+e|0,a[e+(h+4)>>2]=j|1,a[h+4>>2]=e|3,j=h+8|0):j=wU(e)):(c=h-e|0,j=a[E+20>>2],15<c>>>0?(a[E+20>>2]=j+e|0,a[E+8>>2]=c,a[e+(j+4)>>2]=c|1,a[j+h>>2]=c,a[j+4>>2]=e|3):(a[E+8>>2]=0,a[E+20>>2]=0,a[j+4>>2]=h|3,h=h+(j+4)|0,a[h>>2]|=1),j=j+8|0);return j}function uU(b){var c,d,e=a[E+4>>2],f=(e&-e)-1|0,e=f>>>12&16,h=f>>>(e>>>0),f=h>>>5&8;d=h>>>(f>>>0);var h=d>>>2&4,j=d>>>(h>>>0);d=j>>>1&2;var j=j>>>(d>>>0),k=j>>>1&1,e=h=f=a[E+((f|e|h|d|k)+(j>>>(k>>>0))<<2)+304>>2];d=e>>2;for(f=(a[f+4>>2]&-8)-b|0;;){j=a[h+16>>2];if(0==(j|0)){if(h=a[h+20>>2],0==(h|0)){break}else{d=h}}else{d=j}j=(a[d+4>>2]&-8)-b|0;k=j>>>0<f>>>0;h=d;e=k?d:e;d=e>>2;f=k?j:f}var j=e,n=a[E+16>>2];j>>>0<n>>>0&&S();h=j+b|0;j>>>0<h>>>0||S();var k=a[d+6],m=a[d+3],p=(m|0)==(e|0);a:do{if(p){var s=e+20|0,v=a[s>>2];do{if(0==(v|0)){var t=e+16|0,u=a[t>>2];if(0==(u|0)){var w=0;c=w>>2;break a}}else{t=s,u=v}}while(0);for(;;){if(s=u+20|0,v=a[s>>2],0!=(v|0)){t=s,u=v}else{if(s=u+16|0,v=a[s>>2],0==(v|0)){break}else{t=s,u=v}}}t>>>0<n>>>0?S():(a[t>>2]=0,w=u,c=w>>2)}else{t=a[d+2],t>>>0<n>>>0?S():(a[t+12>>2]=m,a[m+8>>2]=t,w=m,c=w>>2)}}while(0);n=0==(k|0);a:do{if(!n){m=e+28|0;p=(a[m>>2]<<2)+E+304|0;do{if((e|0)==(a[p>>2]|0)){if(a[p>>2]=w,0==(w|0)){a[E+4>>2]&=1<<a[m>>2]^-1;break a}}else{if(k>>>0<a[E+16>>2]>>>0&&S(),t=k+16|0,(a[t>>2]|0)==(e|0)?a[t>>2]=w:a[k+20>>2]=w,0==(w|0)){break a}}}while(0);w>>>0<a[E+16>>2]>>>0&&S();a[c+6]=k;m=a[d+4];0!=(m|0)&&(m>>>0<a[E+16>>2]>>>0?S():(a[c+4]=m,a[m+24>>2]=w));m=a[d+5];0!=(m|0)&&(m>>>0<a[E+16>>2]>>>0?S():(a[c+5]=m,a[m+24>>2]=w))}}while(0);if(16>f>>>0){var A=f+b|0;a[d+1]=A|3;A=A+(j+4)|0;a[A>>2]|=1;return A=e+8|0}a[d+1]=b|3;a[b+(j+4)>>2]=f|1;a[j+f+b>>2]=f;j=a[E+8>>2];if(0!=(j|0)){b=a[E+20>>2];w=j>>>2&1073741822;c=(w<<2)+E+40|0;d=a[E>>2];j=1<<(j>>>3);if(0==(d&j|0)){a[E>>2]=d|j;var A=c,y=(w+2<<2)+E+40|0}else{w=(w+2<<2)+E+40|0,d=a[w>>2],d>>>0<a[E+16>>2]>>>0?S():(A=d,y=w)}a[y>>2]=b;a[A+12>>2]=b;a[b+8>>2]=A;a[b+12>>2]=c}a[E+8>>2]=f;a[E+20>>2]=h;return A=e+8|0}function wU(b){var c,d;0==(a[Rc>>2]|0)&&xU();var e=0==(a[E+440>>2]&4|0);a:do{if(e){var f=a[E+24>>2];if(0==(f|0)){d=2751}else{if(f=Qy(f),0==(f|0)){d=2751}else{var h=a[Rc+8>>2],h=b+47-a[E+12>>2]+h&-h;if(2147483647>h>>>0){d=Ie(h);var j=(d|0)==(a[f>>2]+a[f+4>>2]|0);c=j?d:-1;var j=j?h:0,k=h,n=d;d=2758}else{var m=0}}}if(2751==d){if(f=Ie(0),-1==(f|0)){m=0}else{var h=a[Rc+8>>2],h=h+(b+47)&-h,p=f,s=a[Rc+4>>2],v=s-1|0,h=0==(v&p|0)?h:h-p+(v+p&-s)|0;2147483647>h>>>0?(d=Ie(h),c=(j=(d|0)==(f|0))?f:-1,j=j?h:0,k=h,n=d,d=2758):m=0}}b:do{if(2758==d){d=-k|0;if(-1!=(c|0)){var t=j,u=c;d=2771;break a}do{if(-1!=(n|0)&2147483647>k>>>0){if(k>>>0<(b+48|0)>>>0){if(m=a[Rc+8>>2],m=b+47-k+m&-m,2147483647>m>>>0){if(-1==(Ie(m)|0)){Ie(d);m=j;break b}else{m=m+k|0}}else{m=k}}else{m=k}}else{m=k}}while(0);if(-1!=(n|0)){t=m;u=n;d=2771;break a}a[E+440>>2]|=4;var w=j;d=2768;break a}}while(0);a[E+440>>2]|=4;w=m}else{w=0}d=2768}while(0);2768==d&&(e=a[Rc+8>>2],e=e+(b+47)&-e,2147483647>e>>>0&&(e=Ie(e),c=Ie(0),-1!=(c|0)&-1!=(e|0)&e>>>0<c>>>0&&(c=c-e|0,e=(j=c>>>0>(b+40|0)>>>0)?e:-1,-1!=(e|0)&&(t=j?c:w,u=e,d=2771))));do{if(2771==d){w=a[E+432>>2]+t|0;a[E+432>>2]=w;w>>>0>a[E+436>>2]>>>0&&(a[E+436>>2]=w);w=a[E+24>>2];e=0==(w|0);a:do{if(e){c=a[E+16>>2];0==(c|0)|u>>>0<c>>>0&&(a[E+16>>2]=u);a[E+444>>2]=u;a[E+448>>2]=t;a[E+456>>2]=0;a[E+36>>2]=a[Rc>>2];a[E+32>>2]=-1;for(c=0;!(j=c<<1,k=(j<<2)+E+40|0,a[E+(j+3<<2)+40>>2]=k,a[E+(j+2<<2)+40>>2]=k,c=c+1|0,32==(c|0));){}Qq(u,t-40|0)}else{j=E+444|0;for(c=j>>2;0!=(j|0);){var A=a[c],y=j+4|0,C=a[y>>2];if((u|0)==(A+C|0)){d=2780;break}j=a[c+2];c=j>>2}do{if(2780==d&&0==(a[c+3]&8|0)&&(j=w,j>>>0>=A>>>0&j>>>0<u>>>0)){a[y>>2]=C+t|0;Qq(a[E+24>>2],a[E+12>>2]+t|0);break a}}while(0);u>>>0<a[E+16>>2]>>>0&&(a[E+16>>2]=u);c=u+t|0;for(j=E+444|0;0!=(j|0);){var D=j|0;if((a[D>>2]|0)==(c|0)){d=2789;break}j=a[j+8>>2]}if(2789==d&&0==(a[j+12>>2]&8|0)){return a[D>>2]=u,A=j+4|0,a[A>>2]=a[A>>2]+t|0,b=yU(u,c,b)}zU(u,t)}}while(0);w=a[E+12>>2];if(w>>>0>b>>>0){return t=w-b|0,a[E+12>>2]=t,A=u=a[E+24>>2],a[E+24>>2]=A+b|0,a[b+(A+4)>>2]=t|1,a[u+4>>2]=b|3,b=u+8|0}}}while(0);a[Ea.c>>2]=12;return 0}function vU(b){var c,d,e,f,h,j=b>>2,k,n=-b|0,m=b>>>8;if(0==(m|0)){var p=0}else{if(16777215<b>>>0){p=31}else{var s=(m+1048320|0)>>>16&8,v=m<<s,t=(v+520192|0)>>>16&4,u=v<<t,w=(u+245760|0)>>>16&2,A=14-(t|s|w)+(u<<w>>>15)|0,p=b>>>((A+7|0)>>>0)&1|A<<1}}var y=a[E+(p<<2)+304>>2],C=0==(y|0);a:do{if(C){var D=0,F=n,G=0}else{var H=31==(p|0)?0:25-(p>>>1)|0,I=0,J=n,K=y;h=K>>2;for(var L=b<<H,N=0;;){var Q=a[h+1]&-8,R=Q-b|0;if(R>>>0<J>>>0){if((Q|0)==(b|0)){D=K;F=R;G=K;break a}else{var U=K,V=R}}else{U=I,V=J}var W=a[h+5],Y=a[((L>>>31<<2)+16>>2)+h],Z=0==(W|0)|(W|0)==(Y|0)?N:W;if(0==(Y|0)){D=U;F=V;G=Z;break a}else{I=U,J=V,K=Y,h=K>>2,L<<=1,N=Z}}}}while(0);if(0==(G|0)&0==(D|0)){var $=2<<p,ba=a[E+4>>2]&($|-$);if(0==(ba|0)){var ca=0;return ca}var fa=(ba&-ba)-1|0,ka=fa>>>12&16,la=fa>>>(ka>>>0),ja=la>>>5&8,aa=la>>>(ja>>>0),da=aa>>>2&4,ea=aa>>>(da>>>0),qa=ea>>>1&2,sa=ea>>>(qa>>>0),ra=sa>>>1&1,ha=a[E+((ja|ka|da|qa|ra)+(sa>>>(ra>>>0))<<2)+304>>2]}else{ha=G}var ga=0==(ha|0);a:do{if(ga){var na=F,oa=D;f=oa>>2}else{var va=ha;e=va>>2;for(var Aa=F,ya=D;;){var Ea=(a[e+1]&-8)-b|0,wa=Ea>>>0<Aa>>>0,Ba=wa?Ea:Aa,Fa=wa?va:ya,Ga=a[e+4];if(0!=(Ga|0)){va=Ga,e=va>>2,Aa=Ba,ya=Fa}else{var Ma=a[e+5];if(0==(Ma|0)){na=Ba;oa=Fa;f=oa>>2;break a}else{va=Ma,e=va>>2,Aa=Ba,ya=Fa}}}}}while(0);if(0==(oa|0)||na>>>0>=(a[E+8>>2]-b|0)>>>0){return ca=0}var ta=oa;d=ta>>2;var Ka=a[E+16>>2];ta>>>0<Ka>>>0&&S();var za=ta+b|0;ta>>>0<za>>>0||S();var ma=a[f+6],pa=a[f+3],Qa=(pa|0)==(oa|0);a:do{if(Qa){var Ha=oa+20|0,Ra=a[Ha>>2];do{if(0==(Ra|0)){var Pa=oa+16|0,db=a[Pa>>2];if(0==(db|0)){var La=0;c=La>>2;break a}else{var Va=Pa,Ya=db}}else{Va=Ha,Ya=Ra}}while(0);for(;;){var hb=Ya+20|0,Za=a[hb>>2];if(0!=(Za|0)){Va=hb,Ya=Za}else{var ib=Ya+16|0,ab=a[ib>>2];if(0==(ab|0)){break}else{Va=ib,Ya=ab}}}Va>>>0<Ka>>>0?S():(a[Va>>2]=0,La=Ya,c=La>>2)}else{var $a=a[f+2];$a>>>0<Ka>>>0?S():(a[$a+12>>2]=pa,a[pa+8>>2]=$a,La=pa,c=La>>2)}}while(0);var jb=0==(ma|0);a:do{if(jb){var Ca=oa}else{var Ia=oa+28|0,eb=(a[Ia>>2]<<2)+E+304|0;do{if((oa|0)==(a[eb>>2]|0)){if(a[eb>>2]=La,0==(La|0)){a[E+4>>2]&=1<<a[Ia>>2]^-1;Ca=oa;break a}}else{ma>>>0<a[E+16>>2]>>>0&&S();var ub=ma+16|0;(a[ub>>2]|0)==(oa|0)?a[ub>>2]=La:a[ma+20>>2]=La;if(0==(La|0)){Ca=oa;break a}}}while(0);La>>>0<a[E+16>>2]>>>0&&S();a[c+6]=ma;var Sa=a[f+4];0!=(Sa|0)&&(Sa>>>0<a[E+16>>2]>>>0?S():(a[c+4]=Sa,a[Sa+24>>2]=La));var mb=a[f+5];0==(mb|0)?Ca=oa:mb>>>0<a[E+16>>2]>>>0?S():(a[c+5]=mb,a[mb+24>>2]=La,Ca=oa)}}while(0);do{if(16>na>>>0){var ua=na+b|0;a[Ca+4>>2]=ua|3;var Oa=ua+(ta+4)|0;a[Oa>>2]|=1}else{if(a[Ca+4>>2]=b|3,a[j+(d+1)]=na|1,a[(na>>2)+d+j]=na,256>na>>>0){var Wa=na>>>2&1073741822,pb=(Wa<<2)+E+40|0,ob=a[E>>2],bb=1<<(na>>>3);if(0==(ob&bb|0)){a[E>>2]=ob|bb;var qb=pb,wb=(Wa+2<<2)+E+40|0}else{var kb=(Wa+2<<2)+E+40|0,Cb=a[kb>>2];Cb>>>0<a[E+16>>2]>>>0?S():(qb=Cb,wb=kb)}a[wb>>2]=za;a[qb+12>>2]=za;a[j+(d+2)]=qb;a[j+(d+3)]=pb}else{var vb=za,xb=na>>>8;if(0==(xb|0)){var yb=0}else{if(16777215<na>>>0){yb=31}else{var nb=(xb+1048320|0)>>>16&8,rb=xb<<nb,lb=(rb+520192|0)>>>16&4,Ta=rb<<lb,cb=(Ta+245760|0)>>>16&2,fb=14-(lb|nb|cb)+(Ta<<cb>>>15)|0,yb=na>>>((fb+7|0)>>>0)&1|fb<<1}}var Ua=(yb<<2)+E+304|0;a[j+(d+7)]=yb;a[j+(d+5)]=0;a[j+(d+4)]=0;var sb=a[E+4>>2],Na=1<<yb;if(0==(sb&Na|0)){a[E+4>>2]=sb|Na,a[Ua>>2]=vb,a[j+(d+6)]=Ua,a[j+(d+3)]=vb,a[j+(d+2)]=vb}else{for(var Fb=na<<(31==(yb|0)?0:25-(yb>>>1)|0),Db=a[Ua>>2];(a[Db+4>>2]&-8|0)!=(na|0);){var Gb=(Fb>>>31<<2)+Db+16|0,Eb=a[Gb>>2];if(0==(Eb|0)){k=2868;break}else{Fb<<=1,Db=Eb}}if(2868==k){if(Gb>>>0<a[E+16>>2]>>>0){S()}else{a[Gb>>2]=vb;a[j+(d+6)]=Db;a[j+(d+3)]=vb;a[j+(d+2)]=vb;break}}var Hb=Db+8|0,Bb=a[Hb>>2],Ja=a[E+16>>2];Db>>>0<Ja>>>0&&S();Bb>>>0<Ja>>>0?S():(a[Bb+12>>2]=vb,a[Hb>>2]=vb,a[j+(d+2)]=Bb,a[j+(d+3)]=Db,a[j+(d+6)]=0)}}}}while(0);return ca=Ca+8|0}function AU(b){var c;0==(a[Rc>>2]|0)&&xU();if(4294967232<=b>>>0){return 0}c=a[E+24>>2];if(0==(c|0)){return 0}var d=a[E+12>>2];if(d>>>0>(b+40|0)>>>0){var e=a[Rc+8>>2],d=(Math.floor(((-40-b-1+d+e|0)>>>0)/(e>>>0))-1)*e|0,f=Qy(c);if(0==(a[f+12>>2]&8|0)&&(b=Ie(0),c=(f+4|0)>>2,(b|0)==(a[f>>2]+a[c]|0)&&(d=Ie(-(2147483646<d>>>0?-2147483648-e|0:d)|0),e=Ie(0),-1!=(d|0)&e>>>0<b>>>0&&(d=b-e|0,(b|0)!=(e|0))))){return a[c]=a[c]-d|0,a[E+432>>2]=a[E+432>>2]-d|0,Qq(a[E+24>>2],a[E+12>>2]-d|0),1}}if(a[E+12>>2]>>>0<=a[E+28>>2]>>>0){return 0}a[E+28>>2]=-1;return 0}function G(b){var c,d,e,f,h,j,k,n=b>>2,m;if(0!=(b|0)){var p=b-8|0,s=a[E+16>>2];p>>>0<s>>>0&&S();var v=a[b-4>>2],t=v&3;1==(t|0)&&S();var u=v&-8;k=u>>2;var w=b+(u-8)|0,A=0==(v&1|0);a:do{if(A){var y=a[p>>2];if(0==(t|0)){return}var C=-8-y|0;j=C>>2;var D=b+C|0,F=D,G=y+u|0;D>>>0<s>>>0&&S();if((F|0)==(a[E+20>>2]|0)){h=(b+(u-4)|0)>>2;if(3!=(a[h]&3|0)){var H=F;f=H>>2;var I=G;break}a[E+8>>2]=G;a[h]&=-2;a[j+(n+1)]=G|1;a[w>>2]=G;return}var J=y>>>3;if(256>y>>>0){var K=a[j+(n+2)],L=a[j+(n+3)];if((K|0)==(L|0)){a[E>>2]&=1<<J^-1;H=F;f=H>>2;I=G;break}var N=((y>>>2&1073741822)<<2)+E+40|0;(K|0)!=(N|0)&K>>>0<s>>>0&&S();if((L|0)==(N|0)|L>>>0>=s>>>0){a[K+12>>2]=L;a[L+8>>2]=K;H=F;f=H>>2;I=G;break}else{S()}}var Q=D,R=a[j+(n+6)],U=a[j+(n+3)],V=(U|0)==(Q|0);b:do{if(V){var W=C+(b+20)|0,Y=a[W>>2];do{if(0==(Y|0)){var Z=C+(b+16)|0,$=a[Z>>2];if(0==($|0)){var ba=0;e=ba>>2;break b}else{var ca=Z,fa=$}}else{ca=W,fa=Y}}while(0);for(;;){var ka=fa+20|0,la=a[ka>>2];if(0!=(la|0)){ca=ka,fa=la}else{var ja=fa+16|0,aa=a[ja>>2];if(0==(aa|0)){break}else{ca=ja,fa=aa}}}ca>>>0<s>>>0?S():(a[ca>>2]=0,ba=fa,e=ba>>2)}else{var da=a[j+(n+2)];da>>>0<s>>>0?S():(a[da+12>>2]=U,a[U+8>>2]=da,ba=U,e=ba>>2)}}while(0);if(0==(R|0)){H=F,f=H>>2,I=G}else{var ea=C+(b+28)|0,na=(a[ea>>2]<<2)+E+304|0;do{if((Q|0)==(a[na>>2]|0)){if(a[na>>2]=ba,0==(ba|0)){a[E+4>>2]&=1<<a[ea>>2]^-1;H=F;f=H>>2;I=G;break a}}else{R>>>0<a[E+16>>2]>>>0&&S();var qa=R+16|0;(a[qa>>2]|0)==(Q|0)?a[qa>>2]=ba:a[R+20>>2]=ba;if(0==(ba|0)){H=F;f=H>>2;I=G;break a}}}while(0);ba>>>0<a[E+16>>2]>>>0&&S();a[e+6]=R;var oa=a[j+(n+4)];0!=(oa|0)&&(oa>>>0<a[E+16>>2]>>>0?S():(a[e+4]=oa,a[oa+24>>2]=ba));var ha=a[j+(n+5)];0==(ha|0)?(H=F,f=H>>2,I=G):ha>>>0<a[E+16>>2]>>>0?S():(a[e+5]=ha,a[ha+24>>2]=ba,H=F,f=H>>2,I=G)}}else{H=p,f=H>>2,I=u}}while(0);var ga=H;d=ga>>2;ga>>>0<w>>>0||S();var sa=b+(u-4)|0,ra=a[sa>>2];0==(ra&1|0)&&S();do{if(0==(ra&2|0)){if((w|0)==(a[E+24>>2]|0)){var va=a[E+12>>2]+I|0;a[E+12>>2]=va;a[E+24>>2]=H;a[f+1]=va|1;(H|0)==(a[E+20>>2]|0)&&(a[E+20>>2]=0,a[E+8>>2]=0);if(va>>>0<=a[E+28>>2]>>>0){return}AU(0);return}if((w|0)==(a[E+20>>2]|0)){var Aa=a[E+8>>2]+I|0;a[E+8>>2]=Aa;a[E+20>>2]=H;a[f+1]=Aa|1;a[(Aa>>2)+d]=Aa;return}var ya=(ra&-8)+I|0,Ea=ra>>>3,wa=256>ra>>>0;a:do{if(wa){var Ba=a[n+k],Fa=a[((u|4)>>2)+n];if((Ba|0)==(Fa|0)){a[E>>2]&=1<<Ea^-1}else{var Ga=((ra>>>2&1073741822)<<2)+E+40|0;(Ba|0)!=(Ga|0)&&Ba>>>0<a[E+16>>2]>>>0&&S();(Fa|0)!=(Ga|0)&&Fa>>>0<a[E+16>>2]>>>0&&S();a[Ba+12>>2]=Fa;a[Fa+8>>2]=Ba}}else{var Ma=w,ta=a[k+(n+4)],Ka=a[((u|4)>>2)+n],za=(Ka|0)==(Ma|0);b:do{if(za){var ma=u+(b+12)|0,pa=a[ma>>2];do{if(0==(pa|0)){var Qa=u+(b+8)|0,Ha=a[Qa>>2];if(0==(Ha|0)){var Ra=0;c=Ra>>2;break b}else{var Pa=Qa,Va=Ha}}else{Pa=ma,Va=pa}}while(0);for(;;){var La=Va+20|0,db=a[La>>2];if(0!=(db|0)){Pa=La,Va=db}else{var Ya=Va+16|0,hb=a[Ya>>2];if(0==(hb|0)){break}else{Pa=Ya,Va=hb}}}Pa>>>0<a[E+16>>2]>>>0?S():(a[Pa>>2]=0,Ra=Va,c=Ra>>2)}else{var Za=a[n+k];Za>>>0<a[E+16>>2]>>>0?S():(a[Za+12>>2]=Ka,a[Ka+8>>2]=Za,Ra=Ka,c=Ra>>2)}}while(0);if(0!=(ta|0)){var ib=u+(b+20)|0,ab=(a[ib>>2]<<2)+E+304|0;do{if((Ma|0)==(a[ab>>2]|0)){if(a[ab>>2]=Ra,0==(Ra|0)){a[E+4>>2]&=1<<a[ib>>2]^-1;break a}}else{ta>>>0<a[E+16>>2]>>>0&&S();var $a=ta+16|0;(a[$a>>2]|0)==(Ma|0)?a[$a>>2]=Ra:a[ta+20>>2]=Ra;if(0==(Ra|0)){break a}}}while(0);Ra>>>0<a[E+16>>2]>>>0&&S();a[c+6]=ta;var jb=a[k+(n+2)];0!=(jb|0)&&(jb>>>0<a[E+16>>2]>>>0?S():(a[c+4]=jb,a[jb+24>>2]=Ra));var Ca=a[k+(n+3)];0!=(Ca|0)&&(Ca>>>0<a[E+16>>2]>>>0?S():(a[c+5]=Ca,a[Ca+24>>2]=Ra))}}}while(0);a[f+1]=ya|1;a[(ya>>2)+d]=ya;if((H|0)!=(a[E+20>>2]|0)){var Ia=ya}else{a[E+8>>2]=ya;return}}else{a[sa>>2]=ra&-2,a[f+1]=I|1,Ia=a[(I>>2)+d]=I}}while(0);if(256>Ia>>>0){var eb=Ia>>>2&1073741822,mb=(eb<<2)+E+40|0,Sa=a[E>>2],wb=1<<(Ia>>>3);if(0==(Sa&wb|0)){a[E>>2]=Sa|wb;var ua=mb,Oa=(eb+2<<2)+E+40|0}else{var Wa=(eb+2<<2)+E+40|0,pb=a[Wa>>2];pb>>>0<a[E+16>>2]>>>0?S():(ua=pb,Oa=Wa)}a[Oa>>2]=H;a[ua+12>>2]=H;a[f+2]=ua;a[f+3]=mb}else{var ob=H,bb=Ia>>>8;if(0==(bb|0)){var qb=0}else{if(16777215<Ia>>>0){qb=31}else{var yb=(bb+1048320|0)>>>16&8,kb=bb<<yb,Cb=(kb+520192|0)>>>16&4,vb=kb<<Cb,xb=(vb+245760|0)>>>16&2,Gb=14-(Cb|yb|xb)+(vb<<xb>>>15)|0,qb=Ia>>>((Gb+7|0)>>>0)&1|Gb<<1}}var nb=(qb<<2)+E+304|0;a[f+7]=qb;a[f+5]=0;a[f+4]=0;var rb=a[E+4>>2],lb=1<<qb;do{if(0==(rb&lb|0)){a[E+4>>2]=rb|lb,a[nb>>2]=ob,a[f+6]=nb,a[f+3]=H,a[f+2]=H}else{for(var Ta=Ia<<(31==(qb|0)?0:25-(qb>>>1)|0),cb=a[nb>>2];(a[cb+4>>2]&-8|0)!=(Ia|0);){var fb=(Ta>>>31<<2)+cb+16|0,Ua=a[fb>>2];if(0==(Ua|0)){m=3020;break}else{Ta<<=1,cb=Ua}}if(3020==m){if(fb>>>0<a[E+16>>2]>>>0){S()}else{a[fb>>2]=ob;a[f+6]=cb;a[f+3]=H;a[f+2]=H;break}}var sb=cb+8|0,Na=a[sb>>2],Fb=a[E+16>>2];cb>>>0<Fb>>>0&&S();Na>>>0<Fb>>>0?S():(a[Na+12>>2]=ob,a[sb>>2]=ob,a[f+2]=Na,a[f+3]=cb,a[f+6]=0)}}while(0);var Db=a[E+32>>2]-1|0;a[E+32>>2]=Db;if(0==(Db|0)){for(var Hb=E+452|0;;){var Eb=a[Hb>>2];if(0==(Eb|0)){break}else{Hb=Eb+8|0}}a[E+32>>2]=-1}}}}function Yc(b,c){if(0==(b|0)){var d=0}else{d=c*b|0,d=65535<(c|b)>>>0?(Math.floor((d>>>0)/(b>>>0))|0)==(c|0)?d:-1:d}var e=Gb(d);if(0==(e|0)||0==(a[e-4>>2]&3|0)){return e}li(e,d);return e}function mc(a,b){return 0==(a|0)?Gb(b):BU(a,b)}function BU(b,c){var d,e,f;if(4294967231<c>>>0){return a[Ea.c>>2]=12,0}var h=b-8|0;e=(b-4|0)>>2;var j=a[e],k=j&-8,n=k-8|0,m=b+n|0;h>>>0<a[E+16>>2]>>>0&&S();var p=j&3;1!=(p|0)&-8<(n|0)||S();d=(b+(k-4)|0)>>2;0==(a[d]&1|0)&&S();n=11>c>>>0?16:c+11&-8;if(0==(p|0)){var s=0,v,j=a[h+4>>2]&-8;v=256>n>>>0?0:j>>>0>=(n+4|0)>>>0&&(j-n|0)>>>0<=a[Rc+8>>2]<<1>>>0?h:0;f=150}else{k>>>0<n>>>0?(m|0)==(a[E+24>>2]|0)&&(d=a[E+12>>2]+k|0,d>>>0>n>>>0&&(s=d-n|0,a[e]=n|j&1|2,a[b+(n-4)>>2]=s|1,a[E+24>>2]=b+(n-8)|0,a[E+12>>2]=s,s=0,v=h,f=150)):(s=k-n|0,15<s>>>0?(a[e]=n|j&1|2,a[b+(n-4)>>2]=s|3,a[d]|=1,s=b+n|0):s=0,v=h,f=150)}if(150==f&&0!=(v|0)){return 0!=(s|0)&&G(s),v+8|0}h=Gb(c);if(0==(h|0)){return 0}e=k-(0==(a[e]&3|0)?8:4)|0;tf(h,b,e>>>0<c>>>0?e:c);G(b);return h}function xU(){if(0==(a[Rc>>2]|0)){var b=AQa();0!=(b-1&b|0)&&S();a[Rc+8>>2]=b;a[Rc+4>>2]=b;a[Rc+12>>2]=-1;a[Rc+16>>2]=2097152;a[Rc+20>>2]=0;a[E+440>>2]=0;b=Math.floor(Date.now()/1e3);a[Rc>>2]=b&-16^1431655768}}function Qy(b){var c,d,e=E+444|0;for(c=e>>2;;){var f=a[c];if(f>>>0<=b>>>0&&(f+a[c+1]|0)>>>0>b>>>0){var h=e;d=185;break}c=a[c+2];if(0==(c|0)){h=0;d=186;break}else{e=c,c=e>>2}}if(185==d||186==d){return h}}function Qq(b,c){var d=b+8|0,d=0==(d&7|0)?0:-d&7,e=c-d|0;a[E+24>>2]=b+d|0;a[E+12>>2]=e;a[d+(b+4)>>2]=e|1;a[c+(b+4)>>2]=40;a[E+28>>2]=a[Rc+16>>2]}function yU(b,c,d){var e,f,h,j=c>>2,k=b>>2,n,m=b+8|0,m=0==(m&7|0)?0:-m&7;f=c+8|0;var p=0==(f&7|0)?0:-f&7;h=p>>2;var s=c+p|0,v=m+d|0;f=v>>2;var v=b+v|0,t=s-(b+m)-d|0;a[(m+4>>2)+k]=d|3;if((s|0)==(a[E+24>>2]|0)){return n=a[E+12>>2]+t|0,a[E+12>>2]=n,a[E+24>>2]=v,a[f+(k+1)]=n|1,b=b+(m|8)|0}if((s|0)==(a[E+20>>2]|0)){return n=a[E+8>>2]+t|0,a[E+8>>2]=n,a[E+20>>2]=v,a[f+(k+1)]=n|1,a[(n>>2)+k+f]=n,b=b+(m|8)|0}var u=a[h+(j+1)];if(1==(u&3|0)){var d=u&-8,w=u>>>3,A=256>u>>>0;a:do{if(A){var y=a[((p|8)>>2)+j],C=a[h+(j+3)];if((y|0)==(C|0)){a[E>>2]&=1<<w^-1}else{var D=((u>>>2&1073741822)<<2)+E+40|0;(y|0)!=(D|0)&&y>>>0<a[E+16>>2]>>>0&&S();(C|0)!=(D|0)&&C>>>0<a[E+16>>2]>>>0&&S();a[y+12>>2]=C;a[C+8>>2]=y}}else{var y=s,C=a[((p|24)>>2)+j],D=a[h+(j+3)],F=(D|0)==(y|0);b:do{if(F){var G=p|16,H=G+(c+4)|0,I=a[H>>2];do{if(0==(I|0)){var J=c+G|0,K=a[J>>2];if(0==(K|0)){var L=0;e=L>>2;break b}}else{J=H,K=I}}while(0);for(;;){if(G=K+20|0,H=a[G>>2],0!=(H|0)){J=G,K=H}else{if(G=K+16|0,H=a[G>>2],0==(H|0)){break}else{J=G,K=H}}}J>>>0<a[E+16>>2]>>>0?S():(a[J>>2]=0,L=K,e=L>>2)}else{J=a[((p|8)>>2)+j],J>>>0<a[E+16>>2]>>>0?S():(a[J+12>>2]=D,a[D+8>>2]=J,L=D,e=L>>2)}}while(0);if(0!=(C|0)){D=p+(c+28)|0;F=(a[D>>2]<<2)+E+304|0;do{if((y|0)==(a[F>>2]|0)){if(a[F>>2]=L,0==(L|0)){a[E+4>>2]&=1<<a[D>>2]^-1;break a}}else{if(C>>>0<a[E+16>>2]>>>0&&S(),J=C+16|0,(a[J>>2]|0)==(y|0)?a[J>>2]=L:a[C+20>>2]=L,0==(L|0)){break a}}}while(0);L>>>0<a[E+16>>2]>>>0&&S();a[e+6]=C;y=p|16;C=a[(y>>2)+j];0!=(C|0)&&(C>>>0<a[E+16>>2]>>>0?S():(a[e+4]=C,a[C+24>>2]=L));y=a[(y+4>>2)+j];0!=(y|0)&&(y>>>0<a[E+16>>2]>>>0?S():(a[e+5]=y,a[y+24>>2]=L))}}}while(0);e=c+(d|p)|0;c=d+t|0}else{e=s,c=t}e=e+4|0;a[e>>2]&=-2;a[f+(k+1)]=c|1;a[(c>>2)+k+f]=c;if(256>c>>>0){var N=c>>>2&1073741822;n=(N<<2)+E+40|0;e=a[E>>2];c=1<<(c>>>3);if(0==(e&c|0)){a[E>>2]=e|c;var Q=n,R=(N+2<<2)+E+40|0}else{N=(N+2<<2)+E+40|0,c=a[N>>2],c>>>0<a[E+16>>2]>>>0?S():(Q=c,R=N)}a[R>>2]=v;a[Q+12>>2]=v;a[f+(k+2)]=Q;a[f+(k+3)]=n;return b=b+(m|8)|0}R=c>>>8;0==(R|0)?R=0:16777215<c>>>0?R=31:(Q=(R+1048320|0)>>>16&8,e=R<<Q,R=(e+520192|0)>>>16&4,e<<=R,j=(e+245760|0)>>>16&2,Q=14-(R|Q|j)+(e<<j>>>15)|0,R=c>>>((Q+7|0)>>>0)&1|Q<<1);Q=(R<<2)+E+304|0;a[f+(k+7)]=R;a[f+(k+5)]=0;a[f+(k+4)]=0;e=a[E+4>>2];j=1<<R;if(0==(e&j|0)){return a[E+4>>2]=e|j,a[Q>>2]=v,a[f+(k+6)]=Q,a[f+(k+3)]=v,a[f+(k+2)]=v,b=b+(m|8)|0}R=c<<(31==(R|0)?0:25-(R>>>1)|0);for(Q=a[Q>>2];(a[Q+4>>2]&-8|0)!=(c|0);){if(N=(R>>>31<<2)+Q+16|0,e=a[N>>2],0==(e|0)){n=259;break}else{R<<=1,Q=e}}if(259==n){return N>>>0<a[E+16>>2]>>>0&&S(),a[N>>2]=v,a[f+(k+6)]=Q,a[f+(k+3)]=v,a[f+(k+2)]=v,b=b+(m|8)|0}n=Q+8|0;N=a[n>>2];R=a[E+16>>2];Q>>>0<R>>>0&&S();N>>>0<R>>>0&&S();a[N+12>>2]=v;a[n>>2]=v;a[f+(k+2)]=N;a[f+(k+3)]=Q;a[f+(k+6)]=0;return b=b+(m|8)|0}function zU(b,c){var d,e,f,h=a[E+24>>2];e=h>>2;var j=Qy(h),k=a[j>>2];d=a[j+4>>2];var j=k+d|0,n=k+(d-39)|0,k=k+(d-47)+(0==(n&7|0)?0:-n&7)|0,k=k>>>0<(h+16|0)>>>0?h:k,n=k+8|0;d=n>>2;Qq(b,c-40|0);a[k+4>>2]=27;a[d]=a[E+444>>2];a[d+1]=a[E+448>>2];a[d+2]=a[E+452>>2];a[d+3]=a[E+456>>2];a[E+444>>2]=b;a[E+448>>2]=c;a[E+456>>2]=0;a[E+452>>2]=n;d=k+28|0;a[d>>2]=7;n=(k+32|0)>>>0<j>>>0;a:do{if(n){for(var m=d;;){var p=m+4|0;a[p>>2]=7;if((m+8|0)>>>0<j>>>0){m=p}else{break a}}}}while(0);if((k|0)!=(h|0)){if(j=k-h|0,k=j+(h+4)|0,a[k>>2]&=-2,a[e+1]=j|1,a[h+j>>2]=j,256>j>>>0){var s=j>>>2&1073741822;f=(s<<2)+E+40|0;k=a[E>>2];j=1<<(j>>>3);if(0==(k&j|0)){a[E>>2]=k|j;var v=f,t=(s+2<<2)+E+40|0}else{s=(s+2<<2)+E+40|0,j=a[s>>2],j>>>0<a[E+16>>2]>>>0?S():(v=j,t=s)}a[t>>2]=h;a[v+12>>2]=h;a[e+2]=v;a[e+3]=f}else{if(t=j>>>8,0==(t|0)?t=0:16777215<j>>>0?t=31:(v=(t+1048320|0)>>>16&8,k=t<<v,t=(k+520192|0)>>>16&4,k<<=t,d=(k+245760|0)>>>16&2,v=14-(t|v|d)+(k<<d>>>15)|0,t=j>>>((v+7|0)>>>0)&1|v<<1),v=(t<<2)+E+304|0,a[e+7]=t,a[e+5]=0,a[e+4]=0,k=a[E+4>>2],d=1<<t,0==(k&d|0)){a[E+4>>2]=k|d,a[v>>2]=h,a[e+6]=v,a[e+3]=h,a[e+2]=h}else{t=j<<(31==(t|0)?0:25-(t>>>1)|0);for(v=a[v>>2];(a[v+4>>2]&-8|0)!=(j|0);){if(s=(t>>>31<<2)+v+16|0,k=a[s>>2],0==(k|0)){f=320;break}else{t<<=1,v=k}}320==f?(s>>>0<a[E+16>>2]>>>0&&S(),a[s>>2]=h,a[e+6]=v,a[e+3]=h,a[e+2]=h):(f=v+8|0,s=a[f>>2],t=a[E+16>>2],v>>>0<t>>>0&&S(),s>>>0<t>>>0&&S(),a[s+12>>2]=h,a[f>>2]=h,a[e+2]=s,a[e+3]=v,a[e+6]=0)}}}}function qr(a){function b(){var c=0;eC=wc;K._main&&(qn(CU),c=K.Na(a),K.noExitRuntime||(qn(tr),iC.print()));if(K.postRun){for("function"==typeof K.postRun&&(K.postRun=[K.postRun]);0<K.postRun.length;){K.postRun.pop()()}}return c}a=a||K.arguments;if(0<Zg){return K.n("run() called, but dependencies remain, so not running"),0}if(K.preRun){"function"==typeof K.preRun&&(K.preRun=[K.preRun]);var c=K.preRun;K.preRun=[];for(var d=c.length-1;0<=d;d--){c[d]()}if(0<Zg){return 0}}return K.setStatus?(K.setStatus("Running..."),setTimeout((function(){setTimeout((function(){K.setStatus("")}),1);b()}),1),0):b()}var K={"return":"",print:(function(a){K["return"]+=a+"\n"})};try{this.Module=K}catch(MQa){this.Module=K={}}var Ry="object"===typeof process&&"function"===typeof require,Rq="object"===typeof window,Oj="function"===typeof importScripts,DU=!Rq&&!Ry&&!Oj;if(Ry){K.print=(function(a){process.stdout.write(a+"\n")});K.printErr=(function(a){process.stderr.write(a+"\n")});var EU=require("fs"),FU=require("path");K.read=(function(a){var a=FU.normalize(a),b=EU.readFileSync(a).toString();!b&&a!=FU.resolve(a)&&(a=path.join(__dirname,"..","src",a),b=EU.readFileSync(a).toString());return b});K.load=(function(a){YB(read(a))});K.arguments||(K.arguments=process.argv.slice(2))}DU&&(K.print=print,"undefined"!=typeof printErr&&(K.printErr=printErr),K.read="undefined"!=typeof read?read:(function(a){snarf(a)}),K.arguments||("undefined"!=typeof scriptArgs?K.arguments=scriptArgs:"undefined"!=typeof arguments&&(K.arguments=arguments)));Rq&&!Oj&&(K.print||(K.print=(function(a){console.log(a)})),K.printErr||(K.printErr=(function(a){console.log(a)})));if(Rq||Oj){K.read=(function(a){var b=new XMLHttpRequest;b.open("GET",a,ee);b.send(xc);return b.responseText}),K.arguments||"undefined"!=typeof arguments&&(K.arguments=arguments)}Oj&&(K.print||(K.print=bk()),K.load=importScripts);!Oj&&!Rq&&!Ry&&!DU&&Ub("Unknown runtime environment. Where are we?");"undefined"==!K.load&&K.read&&(K.load=(function(a){YB(K.read(a))}));K.print||(K.print=bk());K.printErr||(K.printErr=K.print);K.arguments||(K.arguments=[]);K.print=K.print;K.n=K.printErr;K.preRun||(K.preRun=[]);K.postRun||(K.postRun=[]);var Qa={ga:(function(){return h}),Aa:(function(a){h=a}),bd:(function(a,b){b=b||4;if(1==b){return a}if(isNumber(a)&&isNumber(b)){return Math.ceil(a/b)*b}if(isNumber(b)&&isPowerOfTwo(b)){var c=log2(b);return"(((("+a+")+"+(b-1)+")>>"+c+")<<"+c+")"}return"Math.ceil(("+a+")/"+b+")*"+b}),Ya:(function(a){return a in Qa.Ha||a in Qa.Ga}),Za:(function(a){return"*"==a[a.length-1]}),ab:(function(a){return isPointerType(a)?ee:/^\[\d+\ x\ (.*)\]/.test(a)||/<?{ ?[^}]* ?}>?/.test(a)?wc:"%"==a[0]}),Ha:{i1:0,i8:0,i16:0,i32:0,i64:0},Ga:{"float":0,"double":0},Xc:(function(a,b,c,d){var e=Math.pow(2,d)-1;if(32>d){switch(c){case"shl":return[a<<d,b<<d|(a&e<<32-d)>>>32-d];case"ashr":return[(a>>>d|(b&e)<<32-d)>>0>>>0,b>>d>>>0];case"lshr":return[(a>>>d|(b&e)<<32-d)>>>0,b>>>d]}}else{if(32==d){switch(c){case"shl":return[0,a];case"ashr":return[b,0>(b|0)?e:0];case"lshr":return[b,0]}}else{switch(c){case"shl":return[0,a<<d-32];case"ashr":return[b>>d-32>>>0,0>(b|0)?e:0];case"lshr":return[b>>>d-32,0]}}}Yg("unknown bitshift64 op: "+[value,c,d])}),jd:(function(a,b){return(a|0|b|0)+4294967296*(Math.round(a/4294967296)|Math.round(b/4294967296))}),Wc:(function(a,b){return((a|0)&(b|0))+4294967296*(Math.round(a/4294967296)&Math.round(b/4294967296))}),Cd:(function(a,b){return((a|0)^(b|0))+4294967296*(Math.round(a/4294967296)^Math.round(b/4294967296))}),Y:(function(a){if(1==Qa.z){return 1}var b={"%i1":1,"%i8":1,"%i16":2,"%i32":4,"%i64":8,"%float":4,"%double":8}["%"+a];b||("*"==a.charAt(a.length-1)?b=Qa.z:"i"==a[0]&&(a=parseInt(a.substr(1)),Ae(0==a%8),b=a/8));return b}),W:(function(a){return Math.max(Qa.Y(a),Qa.z)}),Ta:(function(a,b){var c={};return b?a.filter((function(a){return c[a[b]]?ee:c[a[b]]=wc})):a.filter((function(a){return c[a]?ee:c[a]=wc}))}),set:(function(){for(var a="object"===typeof arguments[0]?arguments[0]:arguments,b={},c=0;c<a.length;c++){b[a[c]]=0}return b}),Ma:(function(a){a.m=0;a.C=0;var b=[],c=-1;a.ta=a.T.map((function(d){var e,f;Qa.Ya(d)||Qa.Za(d)?f=e=Qa.Y(d):Qa.ab(d)?(e=Types.types[d].m,f=Types.types[d].C):Ub("Unclear type in struct: "+d+", in "+a.fb+" :: "+dump(Types.types[a.fb]));f=a.kd?1:Math.min(f,Qa.z);a.C=Math.max(a.C,f);d=Qa.B(a.m,f);a.m=d+e;0<=c&&b.push(d-c);return c=d}));a.m=Qa.B(a.m,a.C);0==b.length?a.sa=a.m:1==Qa.Ta(b).length&&(a.sa=b[0]);a.gd=1!=a.sa;return a.ta}),Wa:(function(a,b,c){var d,e;if(b){c=c||0;d=("undefined"===typeof Types?Qa.zd:Types.types)[b];if(!d){return xc}if(d.T.length!=a.length){return printErr("Number of named fields must match the type for "+b+": possibly duplicate struct names. Cannot return structInfo"),xc}e=d.ta}else{d={T:a.map((function(a){return a[0]}))},e=Qa.Ma(d)}var f={A:d.m};b?a.forEach((function(a,b){if("string"===typeof a){f[a]=e[b]+c}else{var h,j;for(j in a){h=j}f[h]=Qa.Wa(a[h],d.T[b],e[b])}})):a.forEach((function(a,b){f[a[1]]=e[b]}));return f}),Vc:(function(a){var b=J.length;J.push(a);J.push(0);return b}),w:(function(a){Qa.w.da||(Qa.w.da={});Qa.w.da[a]||(Qa.w.da[a]=1,K.n(a))}),V:{},cd:(function(a){Qa.V[a]||(Qa.V[a]=(function(){J[a].apply(xc,arguments)}));return Qa.V[a]}),Q:(function(){var a=[],b=0;this.wa=(function(c){c&=255;b&&(a.push(c),b--);if(0==a.length){if(128>c){return String.fromCharCode(c)}a.push(c);b=191<c&&224>c?1:2;return""}if(0<b){return""}var c=a[0],d=a[1],e=a[2],c=191<c&&224>c?String.fromCharCode((c&31)<<6|d&63):String.fromCharCode((c&15)<<12|(d&63)<<6|e&63);a.length=0;return c});this.ib=(function(a){for(var a=unescape(encodeURIComponent(a)),b=[],c=0;c<a.length;c++){b.push(a.charCodeAt(c))}return b})}),fa:(function(a){var b=h;h+=a;h=h+3>>2<<2;return b}),Ba:(function(a){var b=We;We+=a;We=We+3>>2<<2;We>=gk&&Yg("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ( "+gk+"), (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.");return b}),B:(function(a,b){return Math.ceil(a/(b?b:4))*(b?b:4)}),cb:(function(a,b,c){return c?(a>>>0)+4294967296*(b>>>0):(a>>>0)+4294967296*(b|0)}),z:4,Uc:0},iC={Ia:0,na:0,pd:{},hd:(function(a,b){b||(this.na++,this.na>=this.Ia&&Yg("\n\nToo many corrections!"))}),print:bk()},j,Pb,ji,sQa=this;K.ccall=(function(a,b,c,d){return $B(ZB(a),b,c,d)});K.cwrap=(function(a,b,c){var d=ZB(a);return(function(){return $B(d,b,c,Array.prototype.slice.call(arguments))})});K.setValue=dk;K.getValue=ki;var sn=0,$g=1,c=2,cC=3;K.ALLOC_NORMAL=sn;K.ALLOC_STACK=$g;K.ALLOC_STATIC=c;K.ALLOC_NONE=cC;K.allocate=d;K.Pointer_stringify=Oe;K.Array_stringify=(function(a){for(var b="",c=0;c<a.length;c++){b+=String.fromCharCode(a[c])}return b});var J,BQa=4096,m,Be,D,GU,a,HU,ib,Sy,h,Sq,We,LQa=K.TOTAL_STACK||5242880,gk=K.TOTAL_MEMORY||10485760;Ae(!!Int32Array&&!!Float64Array&&!!(new Int32Array(1)).subarray&&!!(new Int32Array(1)).set,"Cannot fallback to non-typed array case: Code is too specialized");var Vg=new ArrayBuffer(gk);m=new Int8Array(Vg);D=new Int16Array(Vg);a=new Int32Array(Vg);Be=new Uint8Array(Vg);GU=new Uint16Array(Vg);HU=new Uint32Array(Vg);ib=new Float32Array(Vg);Sy=new Float64Array(Vg);a[0]=255;Ae(255===Be[0]&&0===Be[3],"Typed arrays 2 must be run on a little-endian system");K.HEAP=cc;K.HEAP8=m;K.HEAP16=D;K.HEAP32=a;K.HEAPU8=Be;K.HEAPU16=GU;K.HEAPU32=HU;K.HEAPF32=ib;K.HEAPF64=Sy;Sq=(h=Qa.B(1))+LQa;var Nm=Qa.B(Sq,8);m.subarray(Nm);var b=a.subarray(Nm>>2);ib.subarray(Nm>>2);var f=Sy.subarray(Nm>>3);Sq=Nm+8;We=Sq+4095>>12<<12;Ae(We<gk);var tQa=d(Nd("(null)"),"i8",c),IU=[],CU=[],tr=[];K.String_len=Ba;K.intArrayFromString=Nd;K.intArrayToString=(function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];255<d&&(d&=255);b.push(String.fromCharCode(d))}return b.join("")});K.writeStringToMemory=aC;K.writeArrayToMemory=bC;var Zg=0,ek={},eC=ee,fk=xc;K.addRunDependency=pr;K.removeRunDependency=rn;K.preloadedImages={};K.preloadedAudios={};var Do,Co,vo,uo,JU,Kb,Bd,U,cd,KU,am,sj,$l,kg,Kp,ij,it,to,LU,kG,lN,L,MU,yi,oD,tw,Zl,zg,Om,oa,em,Nh,ke,Fq,Ti,Vk,lo,Cs,Wk,NU,km,fl,ot,el,OU,Ty,PU,Uy,QU,RU,Vy,SU,Wy,Fd,Kl,Gv,Gj,Ox,ei,rQ,TU,Ec,I,Mb,Ru,Ch,H,ol,It,vu,wu,tl,sl,xu,uu,hp,ul,Fh,yu,hg,Jb,rl,gg,ku,lu,ql,UU,jj,Rh,Pv,Qh,kc,Cc,cs,Nk,VU,WU,XU,YU,ZU,$U,aV,Xy,bV,cV,dV,eV,fV,gV,hV,iV,jV,kV,Yy,lV,mV,nV,oV,pV,Zy,qV,pl,rV,sV,tV,Kh,Lh,zD,Sh,Lg,Qv,Iv,ge,vj,vc,ml,nl,Hj,ze,$h,Rc,Pm,Yo,qv,uy,Ue,uV,Tq,Dj,le,mq,ai,Sv,Rv,vV,Id,Qc,VK,Gq,Mo,tt,Lq,Kq,Cv,Qm,Rm,Sm,Tm,Um,Vm,Wg,rv,Sb,xv,zn,yn,R,Wm,KD,Oc,Uq,Vq,Wq,Xg,De,Xq,ae,PD,ds,Wn,Xn,Cl,bJ,Bl,UI,op,Ug,$d,dw,ew,Al,Lu,wG,xG,tg,Mf,Bq,Ij,Pf,wV,my,ny,oy,py,Yq,F,ug,Pj,Qj,hi,xV,Xm,Md,Rj,wh,Go,Fo,Bh,ll,Ol,Ng,lg,Ip,Mg,yV,zV,AV,BV,CV,DV,$y,Zq,$q,EV,FV,Sj,GV,co,qs,Ri,gG,Ku,lp,Ju,aj,e,yq,zl,Hu,Z,sv,ig,tx,sx,rx,qx,px,ox,nx,nt,ed,az,Mh,Fw,yM,Yp,AM,JM,KM,Bw,Wp,xw,Yh,bM,sM,Vp,ww,rM,Xv,LM,zM,Xp,Qg,nj,Uh,bw,EL,aw,Rp,HV,IV,JV,KV,LV,kT,MV,NV,OV,bz,PV,CJ,QV,RV,SV,uP,TV,uE,UV,VV,WV,XV,YV,jT,ZV,qR,$V,aW,cz,bW,BJ,zk,cW,dW,eW,fW,tE,gW,hW,iW,jW,kW,iT,lW,mW,nW,dz,oW,AJ,pW,qW,rW,sW,tW,uW,vW,wW,xW,yW,hT,zW,AW,BW,ez,CW,jF,zJ,DW,EW,FW,eH,GW,HW,sE,IW,JW,KW,LW,MW,gT,NW,OW,PW,fz,QW,QM,yJ,RW,SW,TW,UW,rE,VW,WW,XW,YW,ZW,$W,aX,fT,bX,cX,dX,gz,eX,xJ,fX,gX,hX,xM,iX,qE,jX,kX,lX,mX,nX,oX,Ym,pX,qX,rX,hz,sX,wJ,tX,uX,vX,wX,xX,pE,JN,yX,$C,hK,zX,AX,kw,tL,BX,ej,CX,DX,uC,rI,EX,FX,GX,iz,HX,vJ,IX,JX,KX,LX,is,MX,NX,OX,PX,QX,RX,SX,jx,TX,UX,jz,VX,uJ,QP,fF,WX,XX,YX,ZX,$X,oE,aY,bY,cY,dY,eY,fY,gY,hY,iY,kz,jY,tJ,kY,lY,mY,nY,nE,oY,pY,qY,rY,sY,tY,uY,vY,wY,xY,lz,yY,ls,zY,AY,BY,CY,mE,wP,DY,EY,FY,GY,HY,IY,JY,KY,tR,NM,LY,MY,ks,NY,OY,PY,QY,lE,RY,SY,TY,UY,VY,WY,XY,YY,ZY,Zm,$Y,sJ,aZ,bZ,cZ,dZ,eZ,kE,fZ,gZ,hZ,iZ,jZ,kZ,lZ,mZ,nZ,mz,oZ,rJ,pZ,qZ,rZ,kH,sZ,tZ,jE,uZ,vZ,wZ,xZ,yZ,$m,Kw,zZ,AZ,BZ,nz,CZ,qJ,DZ,EZ,FZ,GZ,iE,HZ,IZ,JZ,KZ,LZ,MZ,NZ,OZ,PZ,QZ,jh,RZ,SZ,pJ,TZ,UZ,VZ,WZ,hE,Aw,XZ,YZ,ZZ,AO,$Z,a_,ar,b_,c_,d_,e_,f_,oz,g_,h_,i_,j_,k_,IN,l_,m_,ZC,n_,jw,lL,o_,QJ,p_,q_,qI,r_,s_,t_,u_,pz,nJ,qz,v_,w_,x_,y_,z_,A_,B_,C_,D_,E_,F_,G_,H_,I_,J_,cP,rz,XK,mJ,OP,K_,L_,M_,N_,O_,QE,P_,Q_,R_,S_,Py,T_,U_,V_,W_,X_,Y_,sz,Nn,Z_,$_,a0,b0,SE,c0,d0,e0,f0,g0,sH,rU,h0,tz,i0,j0,k0,l0,uz,lJ,m0,n0,o0,p0,RE,q0,Ep,r0,s0,t0,tU,u0,vz,v0,w0,x0,y0,Ax,wz,Qn,sR,z0,A0,B0,C0,D0,E0,F0,G0,pH,sU,H0,ZT,I0,J0,K0,L0,xz,kJ,M0,N0,O0,P0,Q0,R0,S0,T0,zf,U0,qH,qU,V0,YT,W0,X0,Y0,Z0,yz,pt,$0,a1,b1,jH,c1,d1,PE,e1,f1,g1,h1,rH,oU,i1,XT,j1,LO,k1,l1,m1,qe,Af,jJ,n1,o1,p1,q1,r1,s1,t1,dT,u1,mH,nU,v1,UT,w1,x1,y1,Im,z1,A1,B1,iJ,C1,D1,E1,F1,KE,G1,zw,H1,I1,J1,Lk,Sp,dh,K1,VT,L1,jG,M1,N1,O1,zz,hJ,P1,Q1,R1,S1,T1,Xw,U1,V1,W1,kL,X1,YC,Zn,Y1,Z1,TT,Ar,pI,$1,a2,b2,c2,Az,es,Bz,d2,e2,f2,g2,h2,i2,j2,k2,aI,l2,m2,ST,n2,o2,p2,q2,r2,Cz,WK,gJ,WP,eF,s2,t2,u2,v2,w2,x2,y2,wl,z2,A2,B2,uH,C2,D2,RT,E2,F2,G2,H2,Dz,$n,I2,J2,K2,L2,M2,N2,O2,P2,Q2,Ze,R2,S2,QT,T2,U2,V2,W2,Ez,Zu,X2,Y2,Z2,$2,a3,b3,c3,Sx,d3,ap,e3,f3,My,g3,h3,i3,j3,Fz,Eg,k3,l3,m3,n3,o3,p3,q3,r3,s3,t3,u3,v3,PT,w3,x3,y3,z3,Gz,tp,A3,B3,C3,D3,E3,F3,G3,H3,I3,J3,K3,L3,OT,M3,N3,O3,P3,Hz,Zt,sp,Q3,R3,S3,iH,T3,U3,PG,V3,W3,X3,Y3,Ik,Z3,$3,NT,a4,b4,JO,c4,d4,Iz,Rn,e4,f4,g4,h4,gE,i4,j4,k4,Ao,l4,Hk,$t,m4,n4,o4,p4,Hm,q4,r4,s4,Jz,Ak,t4,u4,v4,w4,fE,x4,y4,z4,yw,A4,Gk,Nr,B4,Ly,BO,C4,mt,D4,E4,F4,Kz,kh,G4,H4,I4,XF,J4,K4,eE,Vw,wv,L4,M4,N4,dv,Lv,O4,Fk,Mm,P4,XC,Ky,jK,oI,Q4,R4,S4,T4,U4,Lz,fJ,Mz,V4,W4,X4,Y4,Ot,Z4,$4,a5,b5,c5,d5,Ek,lU,e5,f5,g5,h5,i5,wQ,j5,k5,Nz,jQ,l5,dF,m5,n5,o5,EK,p5,q5,r5,s5,t5,u5,Dk,kU,v5,w5,x5,bO,y5,z5,A5,B5,Oz,wK,C5,D5,E5,F5,WG,G5,H5,I5,J5,Kk,K5,L5,M5,N5,O5,P5,Q5,R5,Pz,Xu,S5,T5,U5,Po,V5,W5,X5,Y5,Z5,Jk,$5,Qx,a6,Qz,b6,c6,d6,e6,f6,Rz,eJ,g6,h6,i6,MM,j6,k6,l6,m6,n6,o6,sf,p6,gU,q6,r6,s6,t6,Sz,dJ,u6,v6,w6,x6,y6,WD,z6,A6,B6,C6,JH,an,D6,iU,E6,F6,G6,H6,I6,cJ,zH,J6,K6,L6,Nt,M6,N6,VD,OG,O6,P6,Q6,R6,Vr,Ph,S6,hU,T6,U6,V6,W6,X6,aJ,IO,Y6,Z6,$6,a7,UD,b7,c7,d7,zo,e7,Oh,f7,ue,g7,h7,bn,Lj,i7,j7,Tz,$I,k7,l7,m7,n7,o7,p7,q7,r7,s7,Nj,vM,t7,Y,u7,iG,yO,v7,w7,x7,y7,Uz,Uu,z7,A7,B7,VF,C7,D7,zj,E7,YL,F7,G7,dd,H7,pd,I7,ly,J7,nI,WC,K7,Vz,L7,M7,Wz,ZI,Xz,N7,O7,P7,Q7,cE,R7,KL,S7,T7,U7,V7,W7,X7,Y7,Z7,Yz,vQ,$7,a8,Zz,QK,YI,gQ,b8,cF,c8,d8,Kv,e8,f8,bE,g8,h8,i8,j8,EH,k8,l8,$z,m8,n8,o8,p8,q8,XI,r8,s8,t8,u8,ID,v8,w8,x8,y8,du,z8,A8,B8,C8,D8,E8,F8,G8,aA,WI,H8,I8,J8,K8,ND,L8,M8,N8,O8,cu,P8,Q8,mP,bA,R8,S8,T8,U8,V8,cA,TI,W8,X8,Y8,Z8,MD,$8,a9,b9,c9,d9,DH,e9,f9,br,g9,h9,cn,i9,j9,qg,dA,pp,xo,k9,l9,m9,n9,o9,LD,p9,q9,r9,s9,eu,t9,u9,eA,v9,w9,x9,y9,z9,fA,SI,th,A9,B9,C9,D9,Mt,E9,$D,NG,F9,G9,H9,I9,J9,K9,vd,L9,M9,gA,N9,O9,hA,P9,Q9,bQ,R9,S9,ZD,T9,U9,V9,lt,W9,X9,iA,Y9,Ny,Z9,$9,a$,jA,b$,c$,kA,PI,d$,e$,f$,g$,h$,YD,i$,j$,k$,l$,m$,n$,o$,Yl,Iq,p$,hG,q$,r$,s$,t$,lA,NI,u$,v$,w$,x$,y$,XD,Ow,z$,A$,B$,C$,D$,sL,os,E$,F$,G$,H$,sg,iv,I$,J$,VC,K$,L$,M$,mA,OI,N$,O$,P$,Q$,aE,R$,S$,T$,HN,U$,V$,W$,X$,eU,Y$,Z$,dn,BQ,$$,aaa,baa,nA,KK,caa,fQ,daa,eaa,faa,DK,gaa,TD,haa,iaa,jaa,kaa,laa,maa,naa,BG,cU,oaa,oA,paa,qaa,raa,saa,taa,pA,uaa,vaa,waa,xaa,SD,yaa,zaa,Aaa,Baa,Caa,Daa,Eaa,Faa,dU,Gaa,Haa,Iaa,Jaa,Kaa,KI,qA,Laa,Maa,Naa,Oaa,FD,Paa,Qaa,Raa,Saa,Taa,Uaa,Vaa,Waa,bU,Xaa,rP,Yaa,Zaa,$aa,aba,qL,tv,xI,rA,bba,cba,dba,eba,fba,gba,DM,hba,iba,jba,kba,lba,mba,nba,oba,$T,pba,qba,rba,sba,tba,uba,CN,wI,vba,sA,wba,xba,tF,yba,zba,Aba,DD,Bba,Cba,Dba,Eba,Fba,Gba,Hba,Iba,tA,Jba,Kba,Lba,Mba,xK,Nba,Oba,vI,uA,Hs,Pba,Qba,Rba,KF,Sba,oR,Tba,bH,Uba,BD,wt,Vba,Wba,Xba,Yba,Zba,$ba,aca,bca,cca,dca,vA,eca,en,fca,gca,wA,hca,ica,IF,jca,nR,kca,aQ,lca,ED,mca,nca,oca,kt,pca,qca,rca,sca,tca,uca,vca,wca,xca,yca,wd,zca,Aca,Bca,Cca,QF,Dca,HF,Eca,Fca,Gca,Hca,CD,Ica,Jca,Kca,Lca,Mca,Nca,Oca,Pca,Qca,Rca,Sca,US,fG,nM,Tca,Uca,Vca,Wca,Xca,Eo,Yca,xA,Zca,$ca,zF,ada,sy,bda,ok,cda,mN,dda,eda,wr,fda,gda,hda,ida,jda,kda,ns,lda,mda,yA,ZJ,mI,nda,TS,oda,pda,qda,EQ,UC,VJ,zA,gK,rda,AA,sda,DF,tda,pR,uda,vda,wda,xda,yda,zda,Ada,Bda,Cda,GN,Dda,Eda,Fda,Gda,SS,Hda,Qf,AQ,WQ,Ida,WJ,Jda,BA,cj,Kda,eQ,bF,Lda,CF,ii,Mda,Nda,CK,Oda,Pda,Qda,Rda,Sda,Tda,Uda,Vda,Wda,Xda,Yda,Zda,$da,aea,VQ,bea,cea,dea,eea,fea,gea,SF,hea,GF,iea,jea,ty,kea,lea,mea,nea,oea,pea,qea,rea,sea,tea,uea,vea,RS,wea,xea,yea,UQ,cO,YM,UJ,CA,zea,Aea,ft,Bea,Cea,Dea,MF,uD,Eea,Fea,Gea,Hea,Iea,Jea,Kea,Lea,Mea,Nea,Oea,Pea,Qea,Rea,cr,Sea,QS,Tea,Uea,Vea,rg,Wea,TQ,Xea,Yea,Zea,TJ,$ea,afa,bfa,cfa,AF,dfa,ER,efa,ffa,VO,gfa,hfa,ifa,jfa,kfa,lfa,mfa,Es,nfa,ofa,pfa,qfa,rfa,sfa,tfa,ufa,vfa,dr,wfa,xfa,tC,PS,yfa,zfa,fn,zq,Afa,Bfa,pL,lv,uK,DA,Cfa,Dfa,Efa,Ffa,EF,Gfa,TH,DR,Hfa,Ifa,Jfa,Kfa,Lfa,Mfa,Nfa,Ofa,Pfa,Qfa,Rfa,NJ,Sfa,Tfa,Ufa,Vfa,Wfa,Xfa,Yfa,Zfa,$fa,OS,aga,bga,Tj,RQ,cga,dga,zN,us,RI,ega,fga,gga,hga,iga,FF,jga,GR,kga,lga,aH,YG,mga,nga,FG,oga,pga,qga,rga,sga,tga,uga,vga,wga,xga,yga,zga,Aga,Uj,Bga,Cga,WS,Dga,Ega,Fga,QQ,Gga,Hga,jv,EA,Iga,Jga,Kga,BF,Lga,FR,Mga,Nga,Oga,Pga,CR,Xk,hI,mp,fI,eI,dI,GO,Qga,Rga,Sga,Tga,Uga,Vga,Wga,Xga,Yga,Zga,$ga,aha,bha,cha,dha,eha,fha,yo,gha,hha,iha,jha,kha,lha,mha,On,nha,oha,pha,qha,rha,sha,tha,uha,vha,wha,xha,yha,zha,Aha,Bha,Cha,Dha,Eha,Fha,Gha,hf,Hha,Iha,Jha,Kha,Lha,Mha,Cy,Nha,Oha,Pha,Qha,Rha,Sha,Tha,Uha,FA,Vha,Wha,Xha,Yha,Zha,$ha,Di,aia,bia,cia,dia,eia,xp,fia,gia,hia,iia,jia,kia,lia,mia,nia,oia,pia,qia,ria,sia,wF,tia,uia,via,wia,xia,yia,zia,Aia,Bia,Cia,Dia,Eia,Fia,Gia,Hia,Iia,BR,Jia,Kia,Lia,Mia,Nia,Oia,Pia,Qia,Ria,Sia,Tia,Uia,Via,Wia,Xia,Yia,Zia,$ia,aja,bja,cja,dja,eja,fja,gja,hja,ija,jja,kja,lja,mja,nja,oja,pja,qja,rja,sja,tja,lR,uja,vja,wja,xja,yja,zja,Aja,Bja,Cja,Dja,Eja,Fja,Gja,GA,Hja,Ija,Jja,Kja,Lja,eG,Mja,Nja,Oja,Pja,Qja,Rja,Sja,Tja,Uja,Vja,Wja,Xja,dM,Yja,Zja,$ja,aka,bka,cka,dka,eka,Tl,fka,SJ,gka,hka,ika,jka,kka,lka,mka,nka,oka,pka,qka,dt,rka,ska,wO,tka,uka,vka,UF,wka,xka,yka,zka,Aka,Bka,Cka,AR,Dka,Eka,Fka,jN,Gka,Hka,Ika,Jka,Kka,Lka,Mka,Nka,Oka,Pka,Qka,Rka,Ska,Tka,Uka,Vka,sC,Wka,Xka,Yka,Zka,$ka,ala,bla,cla,OJ,dla,ela,fla,gla,hla,ila,jla,kla,lla,$Q,mla,nla,ola,pla,qla,rla,sla,tla,ula,vla,HA,wla,xla,yla,YS,zla,Ala,Bla,Cla,Dla,Ela,Fla,Gla,Hla,Ila,Jla,Kla,Lla,Mla,Nla,Ola,Pla,Qla,Rla,Sla,Tla,Ula,Vla,RJ,Wla,Xla,gn,Yla,Zla,VN,$la,ama,TC,bma,cma,dma,IA,ema,fma,gma,hma,xF,ima,jma,kma,pv,lma,mma,nma,oma,pma,qma,rma,sma,tma,uma,vma,wma,xma,yma,zma,Ama,Bma,Cma,Dma,Ema,Fma,Gma,Hma,Ima,Jma,Kma,Lma,Mma,Nma,Oma,Pma,Qma,Rma,Sma,Tma,Uma,Vma,Wma,Xma,Yma,Zma,$ma,ana,bna,cna,dna,ena,fna,gna,hna,ina,jna,kna,lna,mna,nna,ona,pna,qna,rna,sna,tna,una,vna,wna,xna,yna,zna,Ana,Bna,Cna,Dna,Ena,Fna,DQ,Gna,Hna,Ina,FN,Jna,Kna,Lna,Mna,Vj,Nna,Ona,Pna,Qna,Rna,Sna,Tna,Una,Vna,Wna,Xna,Yna,Zna,$na,aoa,boa,coa,doa,qd,eoa,foa,goa,ym,hoa,ioa,joa,koa,IQ,loa,moa,noa,ooa,poa,qoa,roa,Ni,soa,toa,JA,uoa,voa,woa,xoa,yoa,zoa,Aoa,Boa,dQ,Coa,Doa,Eoa,yN,Foa,Goa,Hoa,Ioa,Joa,Dp,Koa,Loa,Moa,Noa,Ooa,Poa,Qoa,Roa,Soa,Toa,Uoa,Voa,Woa,Xoa,Yoa,Zoa,$oa,wp,apa,bpa,cpa,dpa,epa,fpa,gpa,zR,hpa,ipa,jpa,kpa,lpa,mpa,npa,opa,ppa,qpa,rpa,spa,tpa,upa,vpa,wpa,xpa,ypa,zpa,Apa,Bpa,Cpa,Dpa,Epa,Fpa,Gpa,Hpa,Ipa,Jpa,Kpa,Lpa,Mpa,Npa,Opa,Ppa,Qpa,Rpa,Spa,Tpa,Upa,Vpa,Wpa,KA,Xpa,Ypa,Zpa,$pa,aqa,bqa,cqa,dqa,eqa,fqa,gqa,bR,hqa,iqa,jqa,kqa,lqa,mqa,nqa,oqa,pqa,qqa,rqa,sqa,er,tqa,uqa,vqa,wqa,xqa,Jq,yqa,hn,zqa,Aqa,Bqa,Cqa,Dqa,Eqa,Fqa,Gqa,Hqa,Iqa,Jqa,jn,Kqa,Lqa,cg,Mqa,SR,Nqa,dl,Oqa,Pqa,JQ,Qqa,Rqa,aO,Sqa,Tqa,Uqa,Vqa,Gl,Wqa,Oi,Xqa,kn,Yqa,LA,RR,Zqa,$qa,ara,bra,cra,dra,era,fra,gra,hra,ira,jra,UK,kra,pF,MR,lra,mra,nra,ora,pra,qra,rra,sra,tra,ura,vra,wra,Wj,xra,wy,yra,zra,Ara,Bra,Cra,Dra,Era,Fra,Gra,Hra,Ira,Jra,Xj,Kra,LR,Lra,Mra,Nra,Ora,Pra,Qra,Rra,Sra,Tra,Ura,Vra,Wra,JR,Xra,Yra,Zra,$ra,asa,bsa,csa,dsa,esa,vy,fsa,gsa,KR,hsa,isa,jsa,ksa,lsa,msa,nsa,osa,psa,IR,qsa,rsa,ssa,tsa,usa,vsa,eR,wsa,xsa,ysa,zsa,Asa,Bsa,Csa,Dsa,Esa,MA,Fsa,Gsa,Hsa,ZS,dS,Isa,Jsa,Ksa,Lsa,Msa,Nsa,lh,Osa,Psa,Qsa,Rsa,Ssa,cS,Ig,Tsa,OQ,Usa,Vsa,Wsa,Xsa,Ysa,Gf,Zsa,au,$sa,DS,ata,NA,bS,bta,cta,dta,eta,fta,gta,hta,CS,ita,aS,jta,kta,lta,mta,nta,ota,pta,qta,rta,AS,$R,sta,tta,uta,vta,wta,xta,yta,zta,Ata,zS,Bta,yR,ZR,Cta,Dta,Eta,Fta,Gta,Hta,Ita,Jta,Kta,yS,Lta,XR,Mta,Nta,Ota,Pta,Qta,Rta,Sta,Tta,Uta,sS,Vta,Wta,WR,Xta,Yta,Zta,$ta,aua,bua,cua,dua,xS,eua,fua,YR,gua,hua,iua,jua,kua,lua,mua,kR,wS,VR,nua,oua,pua,qua,rua,fr,sua,tua,uua,vua,wua,vS,UR,xua,yua,zua,Aua,Bua,Cua,Dua,Eua,Fua,Gua,Hua,uS,Iua,Jua,Hg,Kua,Lua,Mua,Nua,Oua,Pua,Qua,Rua,zp,Sua,lI,Tua,Uua,tS,OA,Vua,Wua,pP,Xua,Yua,Zua,$ua,ava,bva,cva,dva,eva,fva,gva,rS,TK,hva,iva,jva,kva,lva,mva,nva,ova,pva,qva,rva,sva,tva,uva,qS,vva,wva,xva,yva,zva,Ava,Bva,Cva,Dva,Eva,Fva,Gva,Hva,Iva,pS,Jva,Kva,ZO,xR,TM,Lva,Mva,Nva,Ova,Pva,Qva,Rva,Sva,Tva,Uva,Vva,oS,gr,Wva,Xva,Yva,Zva,$va,awa,bwa,cwa,dwa,ewa,fwa,gwa,nS,hwa,iwa,jwa,kwa,lwa,mwa,nwa,owa,pwa,qwa,rwa,swa,twa,uwa,PA,vwa,wwa,Bf,xwa,ywa,zwa,Awa,Bwa,Cwa,Dwa,Ewa,Fwa,Gwa,jR,Hwa,Iwa,Jwa,Kwa,Lwa,Mwa,Nwa,Owa,hr,Pwa,Qwa,kM,Rwa,Swa,Twa,Uwa,oj,Vwa,Wwa,Xwa,Ywa,Zwa,$wa,axa,bxa,cxa,dxa,exa,fxa,gxa,hxa,ixa,jxa,kxa,lxa,mxa,nxa,oxa,Wb,pxa,qxa,rxa,sxa,txa,IL,uxa,yp,vxa,Pi,kI,wxa,xxa,yxa,zxa,QA,Axa,Bxa,Cxa,Dxa,Exa,Fxa,Gxa,Hxa,bI,Ixa,Jxa,Kxa,Lxa,Mxa,Nu,Nxa,Oxa,ln,Pxa,AK,Qxa,Rxa,Sxa,Txa,Uxa,Vxa,Wxa,Xxa,Yxa,Zxa,$xa,aya,bya,cya,dya,eya,fya,gya,hya,iya,jya,kya,lya,mya,nya,oya,pya,qya,rya,wR,OM,sya,tya,uya,vya,wya,xya,yya,zya,Aya,Bya,Cya,fS,Dya,Eya,Fya,Gya,Hya,Iya,Jya,Kya,Lya,Mya,Nya,Oya,Pya,xy,Qya,Rya,Sya,Tya,Uya,Vya,Wya,Xya,Yya,Zya,$ya,aza,Ay,bza,cza,yy,dza,yr,eza,fza,gza,hza,iza,jza,kza,lza,mza,nza,oza,iR,zy,pza,qza,rza,sza,tza,RA,uza,vza,wza,jM,xza,yza,zza,cT,Aza,JS,Hq,Bza,Cza,Dza,Eza,Fza,Gza,Hza,Iza,Jza,bD,mn,Kza,Lza,KS,Kj,Mza,Nza,Oza,Hi,Wx,Pza,Qza,Rza,Sza,Tza,Pd,Uza,hv,Vza,Wza,Xza,Jj,SA,Yza,Zza,$za,Qt,aAa,bAa,cAa,dAa,eAa,fAa,gAa,hAa,iAa,jAa,LS,RK,kAa,lAa,mAa,zK,nAa,oAa,pAa,qAa,rAa,sAa,tAa,uAa,iO,vAa,wAa,By,xAa,yAa,zAa,AAa,VG,BAa,CAa,DAa,EAa,FAa,GAa,HAa,Vx,IAa,JAa,KAa,IS,iS,LAa,MAa,CG,NAa,vR,IM,OAa,PAa,QAa,RAa,SAa,TAa,UAa,VAa,WAa,HS,hS,XAa,YAa,ZAa,$Aa,aBa,bBa,cBa,dBa,eBa,fBa,MI,gBa,hBa,iBa,jBa,kBa,lBa,mBa,nBa,oBa,pBa,qBa,rBa,sBa,tBa,uBa,GS,vBa,TA,wBa,xBa,yBa,zBa,ABa,BBa,CBa,DBa,EBa,FBa,GBa,HBa,ES,IBa,hR,JBa,KBa,LBa,MBa,Yj,NBa,OBa,PBa,QBa,lM,RBa,SBa,TBa,Dm,lS,UBa,VBa,WBa,XBa,YBa,ZBa,$Ba,aCa,bCa,cCa,dCa,eCa,fCa,UA,qh,gCa,hCa,YF,iCa,ky,jCa,kCa,rN,lCa,mCa,nCa,gw,yL,oCa,zG,gv,pCa,pK,jI,qCa,rCa,VA,kS,vx,WA,sCa,tCa,uCa,vCa,wCa,xCa,yCa,zCa,ACa,BCa,CCa,DCa,ECa,bL,Cp,FCa,GCa,HCa,yK,ICa,JCa,KCa,LCa,MCa,NCa,OCa,PCa,QCa,RCa,jS,SCa,TCa,UCa,VCa,WCa,XCa,YCa,ZCa,$Ca,aDa,bDa,BP,cDa,dDa,eDa,fDa,gDa,hDa,iDa,jDa,kDa,uR,HM,lDa,mDa,nDa,oDa,pDa,qDa,rDa,XA,sDa,tDa,oq,uDa,vDa,wDa,xDa,yDa,zDa,ADa,BDa,CDa,DDa,oK,EDa,wo,gc,FDa,GDa,HDa,IDa,JDa,KDa,LDa,MDa,NDa,ODa,PDa,QDa,RDa,YA,SDa,TDa,UDa,VDa,hH,WDa,XDa,YDa,ZDa,$Da,aEa,bEa,cEa,dEa,eEa,fEa,gEa,qy,hEa,iEa,jEa,ir,kEa,lEa,mEa,nEa,oEa,fM,pEa,Dy,qEa,ZA,rEa,sEa,tEa,uEa,vEa,wEa,xEa,yEa,zEa,AEa,BEa,bc,CEa,DEa,$A,EEa,FEa,GEa,HEa,KQ,IEa,JEa,KEa,vp,LEa,MEa,NEa,$L,xL,OEa,fj,PEa,tI,QEa,REa,SEa,aB,jr,TEa,bB,UEa,VEa,WEa,XEa,YEa,ZEa,$Ea,aFa,bFa,cFa,dFa,cB,aL,eFa,fFa,gFa,hFa,zv,iFa,jFa,kFa,lFa,mFa,nFa,oFa,pFa,qFa,rFa,sFa,dB,tFa,uFa,vFa,wFa,xFa,yFa,zFa,AFa,BFa,CFa,kr,DFa,EFa,eP,FFa,GFa,HFa,IFa,JFa,KFa,LFa,MFa,NFa,GM,OFa,PFa,lr,QFa,RFa,SFa,eB,TFa,UFa,VFa,WFa,XFa,YFa,ZFa,$Fa,aGa,bGa,cGa,dGa,eGa,fGa,gGa,fB,yg,hGa,iGa,jGa,kGa,lGa,mGa,nGa,oGa,pGa,qGa,rGa,sGa,tGa,uGa,vGa,gB,wGa,xGa,yGa,zGa,AGa,Lt,BGa,CGa,DGa,EGa,FGa,GGa,HGa,IGa,JGa,LT,KGa,LGa,MGa,hB,NGa,OGa,PGa,QGa,RGa,SGa,TGa,iB,UGa,VGa,WGa,KT,XGa,YGa,aT,mM,ZGa,jB,$Ga,aHa,PF,bHa,cHa,dHa,eHa,fHa,gHa,hHa,iHa,JT,jHa,vg,kHa,lHa,kB,mHa,nHa,oHa,pHa,NQ,Qp,qHa,rHa,eq,sHa,tHa,uHa,ML,Jv,vHa,Fl,IT,wHa,xHa,QR,yHa,zHa,lB,AHa,BHa,mB,ov,CHa,DHa,EHa,FHa,KN,GHa,HHa,IHa,JHa,HT,KHa,LHa,MHa,nB,NHa,lQ,OHa,PHa,oL,QHa,qp,RHa,SHa,THa,UHa,VHa,WHa,XHa,GT,YHa,ZHa,$Ha,aIa,bIa,TF,eO,cIa,dIa,eIa,fIa,gIa,hIa,iIa,jIa,kIa,lIa,FT,mIa,nIa,oIa,oB,iP,pIa,qIa,dq,rIa,sIa,tIa,uIa,vIa,wIa,xIa,Dq,SM,yIa,ET,zIa,AIa,BIa,pB,CIa,DIa,JI,EIa,FIa,GIa,HIa,IIa,JIa,KIa,LIa,DT,MIa,NIa,OIa,qB,PIa,QIa,II,QI,RIa,SIa,TIa,UIa,VIa,WIa,XIa,YIa,ZIa,CT,$Ia,aJa,bJa,rB,cJa,Gs,dJa,eJa,HI,fJa,Kt,gJa,hJa,iJa,jJa,kJa,lJa,mJa,BT,nJa,oJa,pJa,sB,qJa,rJa,GI,sJa,tJa,uJa,vJa,wJa,Cm,xJa,yJa,Zj,zJa,AJa,BJa,AT,CJa,DJa,Yf,EJa,tB,qM,FJa,GJa,HJa,Wh,FI,IJa,JJa,KJa,LJa,MJa,NJa,OJa,PJa,QJa,zT,RJa,SJa,TJa,uB,UJa,VJa,EI,WJa,XJa,Hl,YJa,ZJa,$Ja,aKa,bKa,ZL,wL,cKa,dKa,yT,PR,eKa,fKa,vB,gKa,hKa,wB,DI,iKa,jKa,kKa,lKa,mKa,nKa,RN,oKa,pKa,qKa,xT,rKa,nq,sKa,$K,tKa,uKa,TN,BI,Av,vKa,wKa,xKa,rp,yKa,zKa,SC,AKa,BKa,CKa,DKa,EKa,Jy,FKa,GKa,HKa,IKa,AI,cK,JKa,KKa,LKa,MKa,NKa,OKa,PKa,QKa,RKa,Iy,SKa,TKa,xB,UKa,VKa,zI,jP,WKa,XKa,YKa,ZKa,$Ka,aLa,bLa,cLa,dLa,Hy,eLa,fLa,yB,gLa,hLa,Su,iLa,jLa,kLa,lLa,mLa,nLa,oLa,pLa,qLa,Lm,rLa,sLa,zB,tLa,uLa,vLa,yI,wLa,xLa,yLa,zLa,ALa,BLa,CLa,DLa,ELa,Km,FLa,GLa,AB,IK,HLa,ILa,JLa,KLa,HJ,LLa,gH,MLa,NLa,OLa,PLa,QLa,RLa,SLa,TLa,Gy,ULa,VLa,wx,BB,WLa,by,XLa,FJ,YLa,ZLa,$La,aMa,bMa,cMa,Ac,dMa,CB,DB,eMa,fMa,gMa,Jm,hMa,Dg,iMa,EB,jMa,kMa,fq,NL,GJ,pM,lMa,mMa,vi,nMa,oMa,pMa,qMa,rMa,sMa,tMa,Fy,me,uMa,vMa,FB,wMa,xMa,IJ,Rx,yMa,zMa,AMa,MQ,BMa,qo,CMa,DMa,EMa,nw,vL,FMa,GMa,Ey,eK,OR,HMa,IMa,GB,JMa,KMa,EJ,LMa,MMa,NMa,OMa,PMa,QMa,RMa,SMa,TMa,LP,UMa,wT,VMa,WMa,XMa,YMa,HB,ZK,ZMa,$Ma,KJ,gF,aNa,bNa,cNa,dNa,GK,eNa,fD,fNa,gNa,hNa,iNa,jNa,vT,kNa,lNa,IB,mNa,nNa,JJ,oNa,pNa,qNa,rNa,XE,sNa,tNa,uNa,vNa,wNa,uT,xNa,yNa,JB,zNa,ANa,MJ,BNa,CNa,$O,DNa,ENa,FNa,GNa,HNa,INa,JNa,tT,rR,KNa,LNa,KB,MNa,NNa,Vt,ONa,PNa,QNa,RNa,SNa,TNa,UNa,VNa,WNa,sT,XNa,YNa,LB,ZNa,$Na,aOa,bOa,cOa,dOa,LI,eOa,fOa,gOa,hOa,iOa,jOa,rT,kOa,lOa,MB,mOa,NB,nOa,oOa,Li,pOa,qOa,fH,rOa,sOa,tOa,uOa,vOa,wOa,xOa,qT,yOa,zOa,AOa,BOa,COa,DOa,EOa,FOa,GOa,OB,HOa,IOa,JOa,KOa,LOa,MOa,pT,NOa,OOa,PB,POa,QOa,ROa,SOa,oM,TOa,UOa,wi,VOa,WOa,XOa,YOa,ZOa,oT,QB,$Oa,aPa,bPa,cPa,CI,dPa,ePa,fPa,gPa,hPa,Fi,LN,iPa,jPa,kPa,uL,lPa,fv,mPa,nT,dK,NR,nPa,oPa,pPa,RB,qPa,SB,rPa,sPa,tPa,uPa,VE,vPa,wPa,xPa,yPa,zPa,mT,APa,BPa,CPa,DPa,TB,YK,EPa,Pr,FPa,GPa,HPa,IPa,FK,JPa,wE,KPa,LPa,MPa,NPa,OPa,lT,PPa,QPa,RPa,UB,SPa,DJ,TPa,UPa,VPa,WPa,vE,XPa,E,WT,fU,tP,bT,$S,BS,MS,YO,QO,Pt,AP,aD,sF,gy,UN,MO,eN,BN,Eq,LF,WF,Nw,VH,im,qN,qP,dE,Bv,xm,cR,gR,ey,FO,Cu,JE,KP,KO,HO,EO,$j,Pq,mr,Nq,Oq,PP,hy,MN,gs,SH,xP,UO,dO,xN,nn,on,VB,YPa,ZPa,ak,pn,WB,$Pa,aQa,bQa,cQa,dQa,eQa,fQa,gQa,hQa,Nb,Ic,Ih,ld,Yk,sw,Up,dg,Vi,jf,eg,Wl,XB,pm,rj,om,ih,Ne,Ah,rw,Ff,Yn,W,Qo,il,Te,sd,PM,rq,kl,cm,Yb,oJ,Ks,rh,qu,ru,up,Ki,St,Tt,Ls,Fs,mu,nu,$o,iu,Rt,El,cp,Le,Un,no,zu,sh,Gh,bo,ao,Js,bp,gp,Ro,Ut,ou,pu,$r,Eh,su,tu,mo,Ou,Zp,So,qm,xh,rm,To,Qd,Xh,Uo,nk,iF,ow,Gc,kq,qj,Wu,bq,Kf,Xl,NK,Mu,Il,aF,st,yG,Lo,Ko,uG,vG,Tp,Bs,dm,Ex,Fx,sD,tD,Sn,Yr,Yu,qD,rD,Wr,Xr,uj,Bj,Vc,Ef,Ct,Si,ko,yh,Ps,Kg,DE,EE,$k,Rs,Vn,$u,zE,AE,Ej,di,hs,Hh,Tn,Ws,Xs,Ys,Gu,Fu,Os,Ms,Zk,Ss,Ts,Us,Vs,Hr,BE,CE,io,dj,bs,go,Jr,uk,Ir,FE,GE,bj,bm,Xc,iQa,jQa,Jo,Pn,kQa,lQa,mQa,nQa,oQa,pQa,rf,ye,Ul,sm,Wi,qw,pg,iM,bu,Gw,Dl,Bi,Mr,xe,gh,Ai,tj,qa,Hf;Do=d(4,"i8",c);Co=d(4,"i8",c);vo=d(4,"i8",c);uo=d(4,"i8",c);JU=d([0,0,0,0,0,0,0,0,284,0,0,0,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,278,0,0,0,0,0,0,0,306,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,324,0,0,0,0,0,0,0,262,0,0,0,256,0,0,0,348,0,0,0,152,0,0,0,0,0,0,0,0,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);Kb=d(4,"i8",c);Bd=d(48,"i8",c);U=d(128,"i8",c);cd=d(64,"i8",c);KU=d([108,0,0,0,0,0,0,0,116,0,0,0,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,0,0,0,188,0,0,0,0,0,0,0,0,0,0,0,300,0,0,0,0,0,0,0,122,0,0,0,172,0,0,0,68,0,0,0,124,0,0,0,8,0,0,0,0,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);am=d([1024],["i32",0,0,0],c);sj=d(4,"i8",c);$l=d(4,"i8",c);d(4,"i8",c);kg=d(4,"i8",c);Kp=d(4,"i8",c);ij=d(4,"i8",c);it=d(4,"i8",c);to=d(36,"i8",c);LU=d([16,0,0,0,0,0,0,0,206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,346,0,0,0,0,0,0,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,238,0,0,0,0,0,0,0,320,0,0,0,318,0,0,0,174,0,0,0,138,0,0,0,74,0,0,0,0,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);kG=d([.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.4079,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.8329,0,0,0,0,0,0,0,.7779,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5639,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5639,0,0,0,0,0,0,0,.5639,0,0,0,0,0,0,0,.5639,0,0,0,0,0,0,0,.4439,0,0,0,0,0,0,0,.9209,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3889,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.8889,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.9439,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.4689,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.4439,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.4439,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.4439,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.7779,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3889,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.4439,0,0,0,0,0,0,0,.4799,0,0,0,0,0,0,0,.1999,0,0,0,0,0,0,0,.4799,0,0,0,0,0,0,0,.5409,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.1669,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.1799,0,0,0,0,0,0,0,.4439,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.4529,0,0,0,0,0,0,0,.3499,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.4439,0,0,0,0,0,0,0,.4439,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.4439,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.8889,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.2759,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.8889,0,0,0,0,0,0,0,.3099,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0,.25,0,0,0,0,0,0,0],["double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);lN=d([1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,1,0,0,0,2,0,0,0,4,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],c);L=d(588,"i8",c);MU=d([76,0,0,0,0,0,0,0,140,0,0,0,220,0,0,0,232,0,0,0,26,0,0,0,150,0,0,0,154,0,0,0,44,0,0,0,280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,118,0,0,0,282,0,0,0,340,0,0,0,376,0,0,0,20,0,0,0,344,0,0,0,0,0,0,0,0,0,0,0,66,0,0,0,0,0,0,0,258,0,0,0,130,0,0,0,228,0,0,0,72,0,0,0,362,0,0,0,0,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);yi=d(4,"i8",c);oD=d([0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,308,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);tw=d(4,"i8",c);Zl=d(4,"i8",c);d(4,"i8",c);d(48,"i8",c);d(4,"i8",c);d(4,"i8",c);em=d(4,"i8",c);Nh=d(4,"i8",c);ke=d([156,0,0,0,276,0,0,0,0,0,0,0],["*",0,0,0,"*",0,0,0,"i8","i8","i8","i8"],c);Fq=d(4,"i8",c);Ti=d(4,"i8",c);Vk=d(4,"i8",c);lo=d(4,"i8",c);Cs=d(4,"i8",c);Wk=d(4,"i8",c);NU=d([8,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);km=d(4,"i8",c);fl=d(8,"i8",c);ot=d(4,"i8",c);el=d(8,"i8",c);OU=d([12656640,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0],c);Ty=d([12693504,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,1,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0],c);PU=d([33558528,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0],c);Uy=d([12693504,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,147,0,0,0,1,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0],c);QU=d([33759232,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0],c);RU=d([12816388,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0],c);Vy=d([4098,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,1,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0],c);SU=d([8192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0],c);Wy=d([56,0,0,0,224,0,0,0,392,0,0,0,326,0,0,0,342,0,0,0,358,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);Fd=d(4,"i8",c);Kl=d(4,"i8",c);Gv=d(4,"i8",c);Gj=d(4,"i8",c);Ox=d(4,"i8",c);ei=d(24,"i8",c);rQ=d([1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],c);TU=d([200,0,0,0,92,0,0,0,46,0,0,0,0,0,0,0,370,0,0,0,0,0,0,0,162,0,0,0,32,0,0,0,218,0,0,0,272,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,168,0,0,0,2,0,0,0,50,0,0,0,160,0,0,0,176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,166,0,0,0,0,0,0,0,134,0,0,0,98,0,0,0,106,0,0,0,136,0,0,0,316,0,0,0,216,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);Ec=d(16,"i8",c);I=d(688,"i8",c);Mb=d(16,"i8",c);Ru=d(4,"i8",c);Ch=d(4,"i8",c);H=d([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);ol=d(4,"i8",c);It=d(4,"i8",c);vu=d(4,"i8",c);wu=d(4,"i8",c);tl=d(8,"i8",c);sl=d(8,"i8",c);xu=d(4,"i8",c);uu=d(4,"i8",c);hp=d(4,"i8",c);ul=d(8,"i8",c);Fh=d(8,"i8",c);yu=d(4,"i8",c);hg=d(4,"i8",c);Jb=d([270,0,0,0,184,0,0,0,236,0,0,0,264,0,0,0,90,0,0,0,288,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);rl=d(12,"i8",c);gg=d(8,"i8",c);ku=d(4,"i8",c);lu=d(4,"i8",c);ql=d(4,"i8",c);UU=d([54,0,0,0,184,0,0,0,236,0,0,0,366,0,0,0,0,0,0,0,30,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);jj=d(4,"i8",c);Rh=d(4,"i8",c);Pv=d(4,"i8",c);Qh=d(4,"i8",c);kc=d([1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0],["double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);Cc=d(256,"i8",c);cs=d(4,"i8",c);Nk=d(4,"i8",c);VU=d([0,0,0,0,3,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);WU=d([0,0,0,0,1,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);XU=d([0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,-.4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);YU=d([0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);ZU=d([1,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);$U=d([0,0,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);aV=d([0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);Xy=d([0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);bV=d([0,0,0,0,1,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);cV=d([0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);dV=d([0,0,0,0,1,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);eV=d([0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);fV=d([0,0,0,0,1,0,0,0,3,0,0,0,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);gV=d([0,0,0,0,1,0,0,0,4,0,0,0,180,0,0,0,0,0,0,0,-.4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);hV=d([0,0,0,0,1,0,0,0,5,0,0,0,180,0,0,0,0,0,0,0,-.64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);iV=d([0,0,0,0,1,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,-.64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);jV=d([0,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);kV=d([0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);Yy=d([0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);lV=d([0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,-.3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);mV=d([0,0,0,0,2,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);nV=d([1,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);oV=d([0,0,0,0,1,0,0,0,4,0,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);pV=d([0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,512,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);Zy=d([1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);qV=d([0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,256,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);pl=d([0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);rV=d([1,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);sV=d([0,0,0,0,1,0,0,0,4,0,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);tV=d([1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"i32",0,0,0,"*",0,0,0],c);Kh=d(4,"i8",c);Lh=d(4,"i8",c);zD=d(128,"i8",c);Sh=d(4,"i8",c);Lg=d(4,"i8",c);Qv=d(4,"i8",c);Iv=d(4,"i8",c);ge=d(4,"i8",c);vj=d(4,"i8",c);vc=d(84,"i8",c);ml=d(4,"i8",c);nl=d(4,"i8",c);Hj=d(4,"i8",c);d(100,"i8",c);ze=d(4,"i8",c);$h=d(4,"i8",c);Rc=d(24,"i8",c);Pm=d(4,"i8",c);Yo=d(4,"i8",c);qv=d([45,57,57,57,57,57,57,57,57,57,57,57,57,57,57,57,46,57,57,0],"i8",c);uy=d(4,"i8",c);Ue=d(4,"i8",c);uV=d([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,198,0,0,0,354,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,292,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);Tq=d([8,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);Dj=d(4,"i8",c);le=d(4,"i8",c);mq=d(4,"i8",c);ai=d(4,"i8",c);Sv=d(4,"i8",c);Rv=d(4,"i8",c);vV=d(4,"i8",c);Id=d(4,"i8",c);Qc=d([0,0,0,0,8,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,9,0,0,0,0,0,0,0],["*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0],c);VK=d([1,208,209,210,211,212,213,214,215,216,217,0],"i8",c);Gq=d(4,"i8",c);Mo=d(4,"i8",c);tt=d(4,"i8",c);d([0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"i8",c);d([23,16,17,18,19,30,36,38,40,42,44,45,1,27,23,23,23,23,2,28,29,36,38,40,42,47,48,30,203,30,4,30,46,30,83,30,30,5,6,77,78,49,4,7,8,9,10,11,12,5,6,46,72,49,52,7,8,9,10,11,12,66,217,55,66,70,58,72,75,4,23,16,17,18,19,4,85,52,37,39,41,43,5,6,88,90,91,92,7,8,9,10,11,12,4,79,57,55,51,54,71,5,6,80,76,84,0,7,8,9,10,11,12,4,60,0,0,58,0,0,5,6,0,0,0,0,7,8,9,10,11,12,4,0,0,0,0,61,0,5,6,0,0,0,0,7,8,9,10,11,12,4,0,0,0,0,0,63,5,6,0,0,0,4,7,8,9,10,11,12,5,6,0,0,0,0,7,8,9,10,11,12],"i8",c);d([0,2,3,3,1,1,2,1,1,1,3,3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,0,6,1,3,3,3,3,1,0,1,2,0,4,1,2,0,4,0,4,0,4,0,3,2,1],"i8",c);d([0,31,32,32,32,33,34,34,35,35,35,35,35,35,35,35,36,37,38,39,40,41,42,43,44,45,46,47,48,48,49,49,51,50,52,52,52,52,52,53,53,54,54,56,55,57,57,59,58,60,58,61,58,62,58,63,63],"i8",c);d([245,245,23,246,247,255,61,0,60,1,55,2,71,245,245,245,245,245,254,62,245,31,34,245,33,245,245,32,245,245,245,245,245],"i8",c);d([11,0,-11,0,151,0,13,0,-11,0,-11,0,16,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,12,0,151,0,-11,0,151,0,151,0,151,0,151,0,151,0,151,0,-11,0,39,0,-11,0,17,0,3,0,-11,0,-11,0,-11,0,-11,0,151,0,151,0,151,0,151,0,20,0,30,0,42,0,63,0,40,0,82,0,48,0,101,0,50,0,120,0,139,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,-11,0,59,0,-11,0,56,0,-11,0,43,0,57,0,-11,0,18,0,28,0,-11,0,20,0,-11,0,-11,0,72,0,-11,0,-11,0,74,0,-11,0,-11,0,-11,0,-11,0,75,0,76,0,-11,0,77,0,-11,0,-11,0,-11,0],["i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0],c);d(4,"i8",c);d(4,"i8",c);d([255,3,13,14,15,31,50,32,53,33,56,34,59,20,62,21,64,22,35,24,65,25,26,67,68,69,73,74,87,86,89,81,82],"i8",c);d([0,4,40,0,30,29,0,16,18,20,22,24,26,0,5,7,40,40,40,40,0,0,9,8,34,0,0,1,28,2,6,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,31,3,32,17,10,35,19,11,36,21,13,38,23,12,37,25,14,27,15,0,43,0,41,0,40,42,40,0,45,39,33,56,0,49,47,0,51,44,46,55,0,0,54,0,50,48,52],"i8",c);d([2,2,2,2,2,14,16,17,18,19,20,21,1,0,16,17,18,19,7,3,8,31,32,33,34,8,23,36,10,38,12,40,12,42,6,44,45,19,20,21,22,11,12,25,26,27,28,29,30,19,20,12,24,11,14,25,26,27,28,29,30,5,23,15,5,9,16,24,70,12,72,72,72,72,72,12,4,14,16,17,18,19,19,20,10,10,10,10,25,26,27,28,29,30,12,72,41,15,37,39,67,19,20,72,70,73,255,25,26,27,28,29,30,12,43,255,255,16,255,255,19,20,255,255,255,255,25,26,27,28,29,30,12,255,255,255,255,17,255,19,20,255,255,255,255,25,26,27,28,29,30,12,255,255,255,255,255,18,19,20,255,255,255,12,25,26,27,28,29,30,19,20,255,255,255,255,25,26,27,28,29,30],"i8",c);d(4,"i8",c);Lq=d(4,"i8",c);Kq=d(4,"i8",c);Cv=d(4,"i8",c);Qm=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Rm=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Sm=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Tm=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Um=d([1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Vm=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Wg=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);rv=d(20,"i8",c);Sb=d(16,"i8",c);xv=d(4,"i8",c);zn=d(8,"i8",c);yn=d(8,"i8",c);R=d([15,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,26,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,29,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,29,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,29,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Wm=d(40,"i8",c);KD=d([14],["i32",0,0,0],c);Oc=d([0,0,0,0,260,0,0,0,0,0,0,0,332,0,0,0,0,0,0,0,332,0,0,0,0,0,0,0,388,0,0,0,0,0,0,0,388,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,112,0,0,0,0,0,0,0,112,0,0,0,0,0,0,0,36,0,0,0,0,0,0,0,36,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,194,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);Uq=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Vq=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Wq=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Xg=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);De=d([1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);Xq=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);ae=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0],c);PD=d([64,0,0,0,126,0,0,0,302,0,0,0,390,0,0,0,312,0,0,0,158,0,0,0,352,0,0,0,382,0,0,0,242,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);ds=d(4,"i8",c);Wn=d(4,"i8",c);Xn=d(4,"i8",c);d(4,"i8",c);d(4,"i8",c);d(4,"i8",c);d(4,"i8",c);d(4,"i8",c);Cl=d(16,"i8",c);bJ=d([100,0,0,0,101,0,0,0,102,0,0,0,100,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],c);Bl=d(16,"i8",c);UI=d([0,0,0,0,1,0,0,0,2,0,0,0,-1,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],c);op=d(4,"i8",c);Ug=d(4,"i8",c);$d=d(4,"i8",c);dw=d(4,"i8",c);ew=d(4,"i8",c);Al=d(4,"i8",c);Lu=d(4,"i8",c);wG=d([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);xG=d([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);tg=d(4,"i8",c);Mf=d(36,"i8",c);Bq=d(4,"i8",c);Ij=d(4,"i8",c);Pf=d(32,"i8",c);wV=d([0,0,0,0,0,0,0,0,296,0,0,0,222,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,330,0,0,0,378,0,0,0,88,0,0,0,350,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,178,0,0,0,336,0,0,0,274,0,0,0,384,0,0,0,28,0,0,0,304,0,0,0,204,0,0,0,0,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);my=d(4,"i8",c);ny=d(512,"i8",c);oy=d(512,"i8",c);py=d(512,"i8",c);d([1,0,0,0,1,0,0,0,-1,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);Yq=d([0,0,0,0,0,0,0,0,236,0,0,0,52,0,0,0,0,0,0,0,34,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);F=d([0,0,0,0,198,0,0,0,0,0,0,0,193,0,0,0,0,0,0,0,194,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,913,0,0,0,0,0,0,0,197,0,0,0,0,0,0,0,195,0,0,0,0,0,0,0,196,0,0,0,0,0,0,0,914,0,0,0,0,0,0,0,199,0,0,0,0,0,0,0,935,0,0,0,0,0,0,0,8225,0,0,0,0,0,0,0,916,0,0,0,0,0,0,0,208,0,0,0,0,0,0,0,201,0,0,0,0,0,0,0,202,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,917,0,0,0,0,0,0,0,919,0,0,0,0,0,0,0,203,0,0,0,0,0,0,0,915,0,0,0,0,0,0,0,205,0,0,0,0,0,0,0,206,0,0,0,0,0,0,0,204,0,0,0,0,0,0,0,921,0,0,0,0,0,0,0,207,0,0,0,0,0,0,0,922,0,0,0,0,0,0,0,923,0,0,0,0,0,0,0,924,0,0,0,0,0,0,0,209,0,0,0,0,0,0,0,925,0,0,0,0,0,0,0,338,0,0,0,0,0,0,0,211,0,0,0,0,0,0,0,212,0,0,0,0,0,0,0,210,0,0,0,0,0,0,0,937,0,0,0,0,0,0,0,927,0,0,0,0,0,0,0,216,0,0,0,0,0,0,0,213,0,0,0,0,0,0,0,214,0,0,0,0,0,0,0,934,0,0,0,0,0,0,0,928,0,0,0,0,0,0,0,8243,0,0,0,0,0,0,0,936,0,0,0,0,0,0,0,929,0,0,0,0,0,0,0,352,0,0,0,0,0,0,0,931,0,0,0,0,0,0,0,222,0,0,0,0,0,0,0,932,0,0,0,0,0,0,0,920,0,0,0,0,0,0,0,218,0,0,0,0,0,0,0,219,0,0,0,0,0,0,0,217,0,0,0,0,0,0,0,933,0,0,0,0,0,0,0,220,0,0,0,0,0,0,0,926,0,0,0,0,0,0,0,221,0,0,0,0,0,0,0,376,0,0,0,0,0,0,0,918,0,0,0,0,0,0,0,225,0,0,0,0,0,0,0,226,0,0,0,0,0,0,0,180,0,0,0,0,0,0,0,230,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,8501,0,0,0,0,0,0,0,945,0,0,0,0,0,0,0,38,0,0,0,0,0,0,0,8743,0,0,0,0,0,0,0,8736,0,0,0,0,0,0,0,229,0,0,0,0,0,0,0,8776,0,0,0,0,0,0,0,227,0,0,0,0,0,0,0,228,0,0,0,0,0,0,0,8222,0,0,0,0,0,0,0,946,0,0,0,0,0,0,0,166,0,0,0,0,0,0,0,8226,0,0,0,0,0,0,0,8745,0,0,0,0,0,0,0,231,0,0,0,0,0,0,0,184,0,0,0,0,0,0,0,162,0,0,0,0,0,0,0,967,0,0,0,0,0,0,0,710,0,0,0,0,0,0,0,9827,0,0,0,0,0,0,0,8773,0,0,0,0,0,0,0,169,0,0,0,0,0,0,0,8629,0,0,0,0,0,0,0,8746,0,0,0,0,0,0,0,164,0,0,0,0,0,0,0,8659,0,0,0,0,0,0,0,8224,0,0,0,0,0,0,0,8595,0,0,0,0,0,0,0,176,0,0,0,0,0,0,0,948,0,0,0,0,0,0,0,9830,0,0,0,0,0,0,0,247,0,0,0,0,0,0,0,233,0,0,0,0,0,0,0,234,0,0,0,0,0,0,0,232,0,0,0,0,0,0,0,8709,0,0,0,0,0,0,0,8195,0,0,0,0,0,0,0,8194,0,0,0,0,0,0,0,949,0,0,0,0,0,0,0,8801,0,0,0,0,0,0,0,951,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,235,0,0,0,0,0,0,0,8364,0,0,0,0,0,0,0,8707,0,0,0,0,0,0,0,402,0,0,0,0,0,0,0,8704,0,0,0,0,0,0,0,189,0,0,0,0,0,0,0,188,0,0,0,0,0,0,0,190,0,0,0,0,0,0,0,8260,0,0,0,0,0,0,0,947,0,0,0,0,0,0,0,8805,0,0,0,0,0,0,0,62,0,0,0,0,0,0,0,8660,0,0,0,0,0,0,0,8596,0,0,0,0,0,0,0,9829,0,0,0,0,0,0,0,8230,0,0,0,0,0,0,0,237,0,0,0,0,0,0,0,238,0,0,0,0,0,0,0,161,0,0,0,0,0,0,0,236,0,0,0,0,0,0,0,8465,0,0,0,0,0,0,0,8734,0,0,0,0,0,0,0,8747,0,0,0,0,0,0,0,953,0,0,0,0,0,0,0,191,0,0,0,0,0,0,0,8712,0,0,0,0,0,0,0,239,0,0,0,0,0,0,0,954,0,0,0,0,0,0,0,8656,0,0,0,0,0,0,0,955,0,0,0,0,0,0,0,9001,0,0,0,0,0,0,0,171,0,0,0,0,0,0,0,8592,0,0,0,0,0,0,0,8968,0,0,0,0,0,0,0,8220,0,0,0,0,0,0,0,8804,0,0,0,0,0,0,0,8970,0,0,0,0,0,0,0,8727,0,0,0,0,0,0,0,9674,0,0,0,0,0,0,0,8206,0,0,0,0,0,0,0,8249,0,0,0,0,0,0,0,8216,0,0,0,0,0,0,0,60,0,0,0,0,0,0,0,175,0,0,0,0,0,0,0,8212,0,0,0,0,0,0,0,181,0,0,0,0,0,0,0,183,0,0,0,0,0,0,0,8722,0,0,0,0,0,0,0,956,0,0,0,0,0,0,0,8711,0,0,0,0,0,0,0,160,0,0,0,0,0,0,0,8211,0,0,0,0,0,0,0,8800,0,0,0,0,0,0,0,8715,0,0,0,0,0,0,0,172,0,0,0,0,0,0,0,8713,0,0,0,0,0,0,0,8836,0,0,0,0,0,0,0,241,0,0,0,0,0,0,0,957,0,0,0,0,0,0,0,243,0,0,0,0,0,0,0,244,0,0,0,0,0,0,0,339,0,0,0,0,0,0,0,242,0,0,0,0,0,0,0,8254,0,0,0,0,0,0,0,969,0,0,0,0,0,0,0,959,0,0,0,0,0,0,0,8853,0,0,0,0,0,0,0,8744,0,0,0,0,0,0,0,170,0,0,0,0,0,0,0,186,0,0,0,0,0,0,0,248,0,0,0,0,0,0,0,245,0,0,0,0,0,0,0,8855,0,0,0,0,0,0,0,246,0,0,0,0,0,0,0,182,0,0,0,0,0,0,0,8706,0,0,0,0,0,0,0,8240,0,0,0,0,0,0,0,8869,0,0,0,0,0,0,0,966,0,0,0,0,0,0,0,960,0,0,0,0,0,0,0,982,0,0,0,0,0,0,0,177,0,0,0,0,0,0,0,163,0,0,0,0,0,0,0,8242,0,0,0,0,0,0,0,8719,0,0,0,0,0,0,0,8733,0,0,0,0,0,0,0,968,0,0,0,0,0,0,0,34,0,0,0,0,0,0,0,8658,0,0,0,0,0,0,0,8730,0,0,0,0,0,0,0,9002,0,0,0,0,0,0,0,187,0,0,0,0,0,0,0,8594,0,0,0,0,0,0,0,8969,0,0,0,0,0,0,0,8221,0,0,0,0,0,0,0,8476,0,0,0,0,0,0,0,174,0,0,0,0,0,0,0,8971,0,0,0,0,0,0,0,961,0,0,0,0,0,0,0,8207,0,0,0,0,0,0,0,8250,0,0,0,0,0,0,0,8217,0,0,0,0,0,0,0,8218,0,0,0,0,0,0,0,353,0,0,0,0,0,0,0,8901,0,0,0,0,0,0,0,167,0,0,0,0,0,0,0,173,0,0,0,0,0,0,0,963,0,0,0,0,0,0,0,962,0,0,0,0,0,0,0,8764,0,0,0,0,0,0,0,9824,0,0,0,0,0,0,0,8834,0,0,0,0,0,0,0,8838,0,0,0,0,0,0,0,8721,0,0,0,0,0,0,0,8835,0,0,0,0,0,0,0,185,0,0,0,0,0,0,0,178,0,0,0,0,0,0,0,179,0,0,0,0,0,0,0,8839,0,0,0,0,0,0,0,223,0,0,0,0,0,0,0,964,0,0,0,0,0,0,0,8756,0,0,0,0,0,0,0,952,0,0,0,0,0,0,0,977,0,0,0,0,0,0,0,8201,0,0,0,0,0,0,0,254,0,0,0,0,0,0,0,732,0,0,0,0,0,0,0,215,0,0,0,0,0,0,0,8482,0,0,0,0,0,0,0,8657,0,0,0,0,0,0,0,250,0,0,0,0,0,0,0,8593,0,0,0,0,0,0,0,251,0,0,0,0,0,0,0,249,0,0,0,0,0,0,0,168,0,0,0,0,0,0,0,978,0,0,0,0,0,0,0,965,0,0,0,0,0,0,0,252,0,0,0,0,0,0,0,8472,0,0,0,0,0,0,0,958,0,0,0,0,0,0,0,253,0,0,0,0,0,0,0,165,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,950,0,0,0,0,0,0,0,8205,0,0,0,0,0,0,0,8204,0,0,0],["*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0],c);ug=d([114,0,0,0],["*",0,0,0],c);Pj=d([78,0,0,0],["*",0,0,0],c);Qj=d([102,0,0,0],["*",0,0,0],c);hi=d([190,0,0,0],["*",0,0,0],c);xV=d([210,0,0,0],["*",0,0,0],c);Xm=d([40,0,0,0],["*",0,0,0],c);Md=d([234,0,0,0],["*",0,0,0],c);Rj=d([146,0,0,0],["*",0,0,0],c);wh=d(8,"i8",c);Go=d(4,"i8",c);Fo=d(4,"i8",c);Bh=d(4,"i8",c);ll=d(4,"i8",c);Ol=d(4,"i8",c);Ng=d(4,"i8",c);lg=d(4,"i8",c);Ip=d(4,"i8",c);Mg=d(4,"i8",c);yV=d([1,0,0,0],["i32",0,0,0],c);zV=d([142,0,0,0,196,0,0,0],["*",0,0,0,"*",0,0,0],c);AV=d([0,0,0,0,0,0,0,0,284,0,0,0,186,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);d([1280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);BV=d([256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);CV=d([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);d([1792,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);DV=d([256,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);$y=d([96,0,0,0,36,0,0,0,0,0,0,0,36,0,0,0,0,0,0,0,612,0,0,0,0,0,0,0,792,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);Zq=d([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);$q=d([786432,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);EV=d([4098,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1440,0,0,0,0,0,0,0,1440,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);FV=d([0,0,0,0,36,0,0,0,0,0,0,0,36,0,0,0,0,0,0,0,612,0,0,0,0,0,0,0,792,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);Sj=d([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);GV=d([67108864,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0,72,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);co=d(12,"i8",c);qs=d(4,"i8",c);Ri=d(4,"i8",c);gG=d([.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0,.5999,0,0,0,0,0,0,0],["double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);Ku=d(4,"i8",c);lp=d(4,"i8",c);Ju=d(4,"i8",c);aj=d(4,"i8",c);e=d([0,0,0,0,85,93,-55,127,-55,127,-1,0,0,0,0,0,-69,45,-44,-66,-82,-44,-1,0,0,0,0,0,20,119,-3,-3,-64,-122,-1,0,0,0,0,0,85,93,-55,127,-55,127,-1,0,0,0,0,0,-69,45,-44,-66,-82,-44,-1,0,0,0,0,0,20,119,-3,-3,-64,-122,-1,0,0,0,0,0,42,102,-1,-1,-1,-103,-1,0,0,0,0,0,85,93,-55,127,-55,127,-1,0,0,0,0,0,-69,45,-44,-66,-82,-44,-1,0,0,0,0,0,20,119,-3,-3,-64,-122,-1,0,0,0,0,0,42,102,-1,-1,-1,-103,-1,0,0,0,0,0,-105,-83,-80,56,108,-80,-1,0,0,0,0,0,85,93,-55,127,-55,127,-1,0,0,0,0,0,-69,45,-44,-66,-82,-44,-1,0,0,0,0,0,20,119,-3,-3,-64,-122,-1,0,0,0,0,0,42,102,-1,-1,-1,-103,-1,0,0,0,0,0,-105,-83,-80,56,108,-80,-1,0,0,0,0,0,-24,-4,-16,-16,2,127,-1,0,0,0,0,0,85,93,-55,127,-55,127,-1,0,0,0,0,0,-69,45,-44,-66,-82,-44,-1,0,0,0,0,0,20,119,-3,-3,-64,-122,-1,0,0,0,0,0,42,102,-1,-1,-1,-103,-1,0,0,0,0,0,-105,-83,-80,56,108,-80,-1,0,0,0,0,0,-24,-4,-16,-16,2,127,-1,0,0,0,0,0,17,-32,-65,-65,91,23,-1,0,0,0,0,0,85,93,-55,127,-55,127,-1,0,0,0,0,0,-69,45,-44,-66,-82,-44,-1,0,0,0,0,0,20,119,-3,-3,-64,-122,-1,0,0,0,0,0,42,102,-1,-1,-1,-103,-1,0,0,0,0,0,-105,-83,-80,56,108,-80,-1,0,0,0,0,0,-24,-4,-16,-16,2,127,-1,0,0,0,0,0,17,-32,-65,-65,91,23,-1,0,0,0,0,0,0,0,102,102,102,102,-1,0,0,0,0,0,-109,25,-9,-34,-21,-9,-1,0,0,0,0,0,-114,75,-31,-98,-54,-31,-1,0,0,0,0,0,-111,-68,-67,49,-126,-67,-1,0,0,0,0,0,-97,16,-1,-17,-13,-1,-1,0,0,0,0,0,-113,46,-25,-67,-41,-25,-1,0,0,0,0,0,-113,127,-42,107,-82,-42,-1,0,0,0,0,0,-109,-48,-75,33,113,-75,-1,0,0,0,0,0,-97,16,-1,-17,-13,-1,-1,0,0,0,0,0,-113,46,-25,-67,-41,-25,-1,0,0,0,0,0,-113,127,-42,107,-82,-42,-1,0,0,0,0,0,-111,-68,-67,49,-126,-67,-1,0,0,0,0,0,-107,-15,-100,8,81,-100,-1,0,0,0,0,0,-97,16,-1,-17,-13,-1,-1,0,0,0,0,0,-108,43,-17,-58,-37,-17,-1,0,0,0,0,0,-114,75,-31,-98,-54,-31,-1,0,0,0,0,0,-113,127,-42,107,-82,-42,-1,0,0,0,0,0,-111,-68,-67,49,-126,-67,-1,0,0,0,0,0,-107,-15,-100,8,81,-100,-1,0,0,0,0,0,-97,16,-1,-17,-13,-1,-1,0,0,0,0,0,-108,43,-17,-58,-37,-17,-1,0,0,0,0,0,-114,75,-31,-98,-54,-31,-1,0,0,0,0,0,-113,127,-42,107,-82,-42,-1,0,0,0,0,0,-112,-87,-58,66,-110,-58,-1,0,0,0,0,0,-109,-48,-75,33,113,-75,-1,0,0,0,0,0,-105,-15,-108,8,69,-108,-1,0,0,0,0,0,-108,8,-1,-9,-5,-1,-1,0,0,0,0,0,-109,25,-9,-34,-21,-9,-1,0,0,0,0,0,-108,43,-17,-58,-37,-17,-1,0,0,0,0,0,-114,75,-31,-98,-54,-31,-1,0,0,0,0,0,-113,127,-42,107,-82,-42,-1,0,0,0,0,0,-112,-87,-58,66,-110,-58,-1,0,0,0,0,0,-109,-48,-75,33,113,-75,-1,0,0,0,0,0,-105,-15,-108,8,69,-108,-1,0,0,0,0,0,-108,8,-1,-9,-5,-1,-1,0,0,0,0,0,-109,25,-9,-34,-21,-9,-1,0,0,0,0,0,-108,43,-17,-58,-37,-17,-1,0,0,0,0,0,-114,75,-31,-98,-54,-31,-1,0,0,0,0,0,-113,127,-42,107,-82,-42,-1,0,0,0,0,0,-112,-87,-58,66,-110,-58,-1,0,0,0,0,0,-109,-48,-75,33,113,-75,-1,0,0,0,0,0,-107,-15,-100,8,81,-100,-1,0,0,0,0,0,-104,-21,107,8,48,107,-1,0,0,0,0,0,23,-17,84,84,48,5,-1,0,0,0,0,0,119,-1,60,0,60,48,-1,0,0,0,0,0,23,-20,-116,-116,81,10,-1,0,0,0,0,0,24,-62,-65,-65,-127,45,-1,0,0,0,0,0,29,112,-33,-33,-62,125,-1,0,0,0,0,0,30,52,-10,-10,-24,-61,-1,0,0,0,0,0,121,38,-22,-57,-22,-27,-1,0,0,0,0,0,120,95,-51,-128,-51,-63,-1,0,0,0,0,0,124,-91,-105,53,-105,-113,-1,0,0,0,0,0,124,-4,102,1,102,94,-1,0,0,0,0,0,23,-17,84,84,48,5,-1,0,0,0,0,0,124,-4,102,1,102,94,-1,0,0,0,0,0,119,-1,60,0,60,48,-1,0,0,0,0,0,23,-20,-116,-116,81,10,-1,0,0,0,0,0,24,-62,-65,-65,-127,45,-1,0,0,0,0,0,29,112,-33,-33,-62,125,-1,0,0,0,0,0,30,52,-10,-10,-24,-61,-1,0,0,0,0,0,0,0,-11,-11,-11,-11,-1,0,0,0,0,0,121,38,-22,-57,-22,-27,-1,0,0,0,0,0,120,95,-51,-128,-51,-63,-1,0,0,0,0,0,124,-91,-105,53,-105,-113,-1,0,0,0,0,0,28,-121,-40,-40,-77,101,-1,0,0,0,0,0,0,0,-11,-11,-11,-11,-1,0,0,0,0,0,123,127,-76,90,-76,-84,-1,0,0,0,0,0,21,-41,-90,-90,97,26,-1,0,0,0,0,0,29,112,-33,-33,-62,125,-1,0,0,0,0,0,120,95,-51,-128,-51,-63,-1,0,0,0,0,0,121,-3,-123,1,-123,113,-1,0,0,0,0,0,21,-41,-90,-90,97,26,-1,0,0,0,0,0,29,112,-33,-33,-62,125,-1,0,0,0,0,0,0,0,-11,-11,-11,-11,-1,0,0,0,0,0,120,95,-51,-128,-51,-63,-1,0,0,0,0,0,121,-3,-123,1,-123,113,-1,0,0,0,0,0,23,-20,-116,-116,81,10,-1,0,0,0,0,0,28,-121,-40,-40,-77,101,-1,0,0,0,0,0,30,52,-10,-10,-24,-61,-1,0,0,0,0,0,121,38,-22,-57,-22,-27,-1,0,0,0,0,0,123,127,-76,90,-76,-84,-1,0,0,0,0,0,124,-4,102,1,102,94,-1,0,0,0,0,0,23,-20,-116,-116,81,10,-1,0,0,0,0,0,28,-121,-40,-40,-77,101,-1,0,0,0,0,0,30,52,-10,-10,-24,-61,-1,0,0,0,0,0,0,0,-11,-11,-11,-11,-1,0,0,0,0,0,121,38,-22,-57,-22,-27,-1,0,0,0,0,0,123,127,-76,90,-76,-84,-1,0,0,0,0,0,124,-4,102,1,102,94,-1,0,0,0,0,0,23,-20,-116,-116,81,10,-1,0,0,0,0,0,24,-62,-65,-65,-127,45,-1,0,0,0,0,0,29,112,-33,-33,-62,125,-1,0,0,0,0,0,30,52,-10,-10,-24,-61,-1,0,0,0,0,0,121,38,-22,-57,-22,-27,-1,0,0,0,0,0,120,95,-51,-128,-51,-63,-1,0,0,0,0,0,124,-91,-105,53,-105,-113,-1,0,0,0,0,0,124,-4,102,1,102,94,-1,0,0,0,0,0,23,-20,-116,-116,81,10,-1,0,0,0,0,0,24,-62,-65,-65,-127,45,-1,0,0,0,0,0,29,112,-33,-33,-62,125,-1,0,0,0,0,0,30,52,-10,-10,-24,-61,-1,0,0,0,0,0,0,0,-11,-11,-11,-11,-1,0,0,0,0,0,121,38,-22,-57,-22,-27,-1,0,0,0,0,0,120,95,-51,-128,-51,-63,-1,0,0,0,0,0,124,-91,-105,53,-105,-113,-1,0,0,0,0,0,124,-4,102,1,102,94,-1,0,0,0,0,0,-121,20,-7,-27,-11,-7,-1,0,0,0,0,0,117,74,-40,-103,-40,-55,-1,0,0,0,0,0,103,-71,-94,44,-94,95,-1,0,0,0,0,0,-120,14,-5,-19,-8,-5,-1,0,0,0,0,0,127,54,-30,-78,-30,-30,-1,0,0,0,0,0,113,120,-62,102,-62,-92,-1,0,0,0,0,0,98,-66,-117,35,-117,69,-1,0,0,0,0,0,-120,14,-5,-19,-8,-5,-1,0,0,0,0,0,127,54,-30,-78,-30,-30,-1,0,0,0,0,0,113,120,-62,102,-62,-92,-1,0,0,0,0,0,103,-71,-94,44,-94,95,-1,0,0,0,0,0,102,-1,109,0,109,44,-1,0,0,0,0,0,-120,14,-5,-19,-8,-5,-1,0,0,0,0,0,119,34,-20,-52,-20,-26,-1,0,0,0,0,0,117,74,-40,-103,-40,-55,-1,0,0,0,0,0,113,120,-62,102,-62,-92,-1,0,0,0,0,0,103,-71,-94,44,-94,95,-1,0,0,0,0,0,102,-1,109,0,109,44,-1,0,0,0,0,0,-120,14,-5,-19,-8,-5,-1,0,0,0,0,0,119,34,-20,-52,-20,-26,-1,0,0,0,0,0,117,74,-40,-103,-40,-55,-1,0,0,0,0,0,113,120,-62,102,-62,-92,-1,0,0,0,0,0,105,-97,-82,65,-82,118,-1,0,0,0,0,0,98,-66,-117,35,-117,69,-1,0,0,0,0,0,102,-1,88,0,88,36,-1,0,0,0,0,0,-122,6,-3,-9,-4,-3,-1,0,0,0,0,0,-121,20,-7,-27,-11,-7,-1,0,0,0,0,0,119,34,-20,-52,-20,-26,-1,0,0,0,0,0,117,74,-40,-103,-40,-55,-1,0,0,0,0,0,113,120,-62,102,-62,-92,-1,0,0,0,0,0,105,-97,-82,65,-82,118,-1,0,0,0,0,0,98,-66,-117,35,-117,69,-1,0,0,0,0,0,102,-1,88,0,88,36,-1,0,0,0,0,0,-122,6,-3,-9,-4,-3,-1,0,0,0,0,0,-121,20,-7,-27,-11,-7,-1,0,0,0,0,0,119,34,-20,-52,-20,-26,-1,0,0,0,0,0,117,74,-40,-103,-40,-55,-1,0,0,0,0,0,113,120,-62,102,-62,-92,-1,0,0,0,0,0,105,-97,-82,65,-82,118,-1,0,0,0,0,0,98,-66,-117,35,-117,69,-1,0,0,0,0,0,102,-1,109,0,109,44,-1,0,0,0,0,0,101,-1,68,0,68,27,-1,0,0,0,0,0,-112,20,-12,-32,-20,-12,-1,0,0,0,0,0,-108,70,-38,-98,-68,-38,-1,0,0,0,0,0,-60,123,-89,-120,86,-89,-1,0,0,0,0,0,-120,14,-5,-19,-8,-5,-1,0,0,0,0,0,-110,53,-29,-77,-51,-29,-1,0,0,0,0,0,-94,74,-58,-116,-106,-58,-1,0,0,0,0,0,-54,-107,-99,-120,65,-99,-1,0,0,0,0,0,-120,14,-5,-19,-8,-5,-1,0,0,0,0,0,-110,53,-29,-77,-51,-29,-1,0,0,0,0,0,-94,74,-58,-116,-106,-58,-1,0,0,0,0,0,-60,123,-89,-120,86,-89,-1,0,0,0,0,0,-42,-31,-127,-127,15,124,-1,0,0,0,0,0,-120,14,-5,-19,-8,-5,-1,0,0,0,0,0,-108,43,-26,-65,-45,-26,-1,0,0,0,0,0,-108,70,-38,-98,-68,-38,-1,0,0,0,0,0,-94,74,-58,-116,-106,-58,-1,0,0,0,0,0,-60,123,-89,-120,86,-89,-1,0,0,0,0,0,-42,-31,-127,-127,15,124,-1,0,0,0,0,0,-120,14,-5,-19,-8,-5,-1,0,0,0,0,0,-108,43,-26,-65,-45,-26,-1,0,0,0,0,0,-108,70,-38,-98,-68,-38,-1,0,0,0,0,0,-94,74,-58,-116,-106,-58,-1,0,0,0,0,0,-66,100,-79,-116,107,-79,-1,0,0,0,0,0,-54,-107,-99,-120,65,-99,-1,0,0,0,0,0,-43,-4,110,110,1,107,-1,0,0,0,0,0,-122,6,-3,-9,-4,-3,-1,0,0,0,0,0,-112,20,-12,-32,-20,-12,-1,0,0,0,0,0,-108,43,-26,-65,-45,-26,-1,0,0,0,0,0,-108,70,-38,-98,-68,-38,-1,0,0,0,0,0,-94,74,-58,-116,-106,-58,-1,0,0,0,0,0,-66,100,-79,-116,107,-79,-1,0,0,0,0,0,-54,-107,-99,-120,65,-99,-1,0,0,0,0,0,-43,-4,110,110,1,107,-1,0,0,0,0,0,-122,6,-3,-9,-4,-3,-1,0,0,0,0,0,-112,20,-12,-32,-20,-12,-1,0,0,0,0,0,-108,43,-26,-65,-45,-26,-1,0,0,0,0,0,-108,70,-38,-98,-68,-38,-1,0,0,0,0,0,-94,74,-58,-116,-106,-58,-1,0,0,0,0,0,-66,100,-79,-116,107,-79,-1,0,0,0,0,0,-54,-107,-99,-120,65,-99,-1,0,0,0,0,0,-42,-31,-127,-127,15,124,-1,0,0,0,0,0,-43,-1,77,77,0,75,-1,0,0,0,0,0,114,-45,-98,27,-98,119,-1,0,0,0,0,0,18,-4,-39,-39,95,2,-1,0,0,0,0,0,-83,95,-77,117,112,-77,-1,0,0,0,0,0,114,-45,-98,27,-98,119,-1,0,0,0,0,0,18,-4,-39,-39,95,2,-1,0,0,0,0,0,-83,95,-77,117,112,-77,-1,0,0,0,0,0,-23,-47,-25,-25,41,-118,-1,0,0,0,0,0,114,-45,-98,27,-98,119,-1,0,0,0,0,0,18,-4,-39,-39,95,2,-1,0,0,0,0,0,-83,95,-77,117,112,-77,-1,0,0,0,0,0,-23,-47,-25,-25,41,-118,-1,0,0,0,0,0,62,-48,-90,102,-90,30,-1,0,0,0,0,0,114,-45,-98,27,-98,119,-1,0,0,0,0,0,18,-4,-39,-39,95,2,-1,0,0,0,0,0,-83,95,-77,117,112,-77,-1,0,0,0,0,0,-23,-47,-25,-25,41,-118,-1,0,0,0,0,0,62,-48,-90,102,-90,30,-1,0,0,0,0,0,31,-4,-26,-26,-85,2,-1,0,0,0,0,0,114,-45,-98,27,-98,119,-1,0,0,0,0,0,18,-4,-39,-39,95,2,-1,0,0,0,0,0,-83,95,-77,117,112,-77,-1,0,0,0,0,0,-23,-47,-25,-25,41,-118,-1,0,0,0,0,0,62,-48,-90,102,-90,30,-1,0,0,0,0,0,31,-4,-26,-26,-85,2,-1,0,0,0,0,0,27,-46,-90,-90,118,29,-1,0,0,0,0,0,114,-45,-98,27,-98,119,-1,0,0,0,0,0,18,-4,-39,-39,95,2,-1,0,0,0,0,0,-83,95,-77,117,112,-77,-1,0,0,0,0,0,-23,-47,-25,-25,41,-118,-1,0,0,0,0,0,62,-48,-90,102,-90,30,-1,0,0,0,0,0,31,-4,-26,-26,-85,2,-1,0,0,0,0,0,27,-46,-90,-90,118,29,-1,0,0,0,0,0,0,0,102,102,102,102,-1,0,0,0,0,0,76,25,-13,-32,-13,-37,-1,0,0,0,0,0,95,61,-35,-88,-35,-75,-1,0,0,0,0,0,-116,-86,-54,67,-94,-54,-1,0,0,0,0,0,65,17,-7,-16,-7,-24,-1,0,0,0,0,0,87,46,-28,-70,-28,-68,-1,0,0,0,0,0,123,101,-52,123,-52,-60,-1,0,0,0,0,0,-115,-59,-66,43,-116,-66,-1,0,0,0,0,0,65,17,-7,-16,-7,-24,-1,0,0,0,0,0,87,46,-28,-70,-28,-68,-1,0,0,0,0,0,123,101,-52,123,-52,-60,-1,0,0,0,0,0,-116,-86,-54,67,-94,-54,-1,0,0,0,0,0,-111,-13,-84,8,104,-84,-1,0,0,0,0,0,65,17,-7,-16,-7,-24,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,95,61,-35,-88,-35,-75,-1,0,0,0,0,0,123,101,-52,123,-52,-60,-1,0,0,0,0,0,-116,-86,-54,67,-94,-54,-1,0,0,0,0,0,-111,-13,-84,8,104,-84,-1,0,0,0,0,0,65,17,-7,-16,-7,-24,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,95,61,-35,-88,-35,-75,-1,0,0,0,0,0,123,101,-52,123,-52,-60,-1,0,0,0,0,0,-119,-96,-45,78,-77,-45,-1,0,0,0,0,0,-115,-59,-66,43,-116,-66,-1,0,0,0,0,0,-109,-14,-98,8,88,-98,-1,0,0,0,0,0,60,12,-4,-9,-4,-16,-1,0,0,0,0,0,76,25,-13,-32,-13,-37,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,95,61,-35,-88,-35,-75,-1,0,0,0,0,0,123,101,-52,123,-52,-60,-1,0,0,0,0,0,-119,-96,-45,78,-77,-45,-1,0,0,0,0,0,-115,-59,-66,43,-116,-66,-1,0,0,0,0,0,-109,-14,-98,8,88,-98,-1,0,0,0,0,0,60,12,-4,-9,-4,-16,-1,0,0,0,0,0,76,25,-13,-32,-13,-37,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,95,61,-35,-88,-35,-75,-1,0,0,0,0,0,123,101,-52,123,-52,-60,-1,0,0,0,0,0,-119,-96,-45,78,-77,-45,-1,0,0,0,0,0,-115,-59,-66,43,-116,-66,-1,0,0,0,0,0,-111,-13,-84,8,104,-84,-1,0,0,0,0,0,-106,-17,-127,8,64,-127,-1,0,0,0,0,0,74,21,-11,-27,-11,-32,-1,0,0,0,0,0,80,72,-39,-95,-39,-101,-1,0,0,0,0,0,98,-78,-93,49,-93,84,-1,0,0,0,0,0,73,15,-8,-19,-8,-23,-1,0,0,0,0,0,78,54,-28,-70,-28,-77,-1,0,0,0,0,0,86,104,-60,116,-60,118,-1,0,0,0,0,0,98,-66,-117,35,-117,69,-1,0,0,0,0,0,73,15,-8,-19,-8,-23,-1,0,0,0,0,0,78,54,-28,-70,-28,-77,-1,0,0,0,0,0,86,104,-60,116,-60,118,-1,0,0,0,0,0,98,-78,-93,49,-93,84,-1,0,0,0,0,0,102,-1,109,0,109,44,-1,0,0,0,0,0,73,15,-8,-19,-8,-23,-1,0,0,0,0,0,77,44,-23,-57,-23,-64,-1,0,0,0,0,0,80,72,-39,-95,-39,-101,-1,0,0,0,0,0,86,104,-60,116,-60,118,-1,0,0,0,0,0,98,-78,-93,49,-93,84,-1,0,0,0,0,0,102,-1,109,0,109,44,-1,0,0,0,0,0,73,15,-8,-19,-8,-23,-1,0,0,0,0,0,77,44,-23,-57,-23,-64,-1,0,0,0,0,0,80,72,-39,-95,-39,-101,-1,0,0,0,0,0,86,104,-60,116,-60,118,-1,0,0,0,0,0,96,-98,-85,65,-85,93,-1,0,0,0,0,0,98,-66,-117,35,-117,69,-1,0,0,0,0,0,108,-1,90,0,90,50,-1,0,0,0,0,0,72,7,-4,-9,-4,-11,-1,0,0,0,0,0,74,21,-11,-27,-11,-32,-1,0,0,0,0,0,77,44,-23,-57,-23,-64,-1,0,0,0,0,0,80,72,-39,-95,-39,-101,-1,0,0,0,0,0,86,104,-60,116,-60,118,-1,0,0,0,0,0,96,-98,-85,65,-85,93,-1,0,0,0,0,0,98,-66,-117,35,-117,69,-1,0,0,0,0,0,108,-1,90,0,90,50,-1,0,0,0,0,0,72,7,-4,-9,-4,-11,-1,0,0,0,0,0,74,21,-11,-27,-11,-32,-1,0,0,0,0,0,77,44,-23,-57,-23,-64,-1,0,0,0,0,0,80,72,-39,-95,-39,-101,-1,0,0,0,0,0,86,104,-60,116,-60,118,-1,0,0,0,0,0,96,-98,-85,65,-85,93,-1,0,0,0,0,0,98,-66,-117,35,-117,69,-1,0,0,0,0,0,102,-1,109,0,109,44,-1,0,0,0,0,0,101,-1,68,0,68,27,-1,0,0,0,0,0,0,0,-16,-16,-16,-16,-1,0,0,0,0,0,0,0,-67,-67,-67,-67,-1,0,0,0,0,0,0,0,99,99,99,99,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,0,0,-52,-52,-52,-52,-1,0,0,0,0,0,0,0,-106,-106,-106,-106,-1,0,0,0,0,0,0,0,82,82,82,82,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,0,0,-52,-52,-52,-52,-1,0,0,0,0,0,0,0,-106,-106,-106,-106,-1,0,0,0,0,0,0,0,99,99,99,99,-1,0,0,0,0,0,0,0,37,37,37,37,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,0,0,-39,-39,-39,-39,-1,0,0,0,0,0,0,0,-67,-67,-67,-67,-1,0,0,0,0,0,0,0,-106,-106,-106,-106,-1,0,0,0,0,0,0,0,99,99,99,99,-1,0,0,0,0,0,0,0,37,37,37,37,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,0,0,-39,-39,-39,-39,-1,0,0,0,0,0,0,0,-67,-67,-67,-67,-1,0,0,0,0,0,0,0,-106,-106,-106,-106,-1,0,0,0,0,0,0,0,115,115,115,115,-1,0,0,0,0,0,0,0,82,82,82,82,-1,0,0,0,0,0,0,0,37,37,37,37,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-16,-16,-16,-16,-1,0,0,0,0,0,0,0,-39,-39,-39,-39,-1,0,0,0,0,0,0,0,-67,-67,-67,-67,-1,0,0,0,0,0,0,0,-106,-106,-106,-106,-1,0,0,0,0,0,0,0,115,115,115,115,-1,0,0,0,0,0,0,0,82,82,82,82,-1,0,0,0,0,0,0,0,37,37,37,37,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-16,-16,-16,-16,-1,0,0,0,0,0,0,0,-39,-39,-39,-39,-1,0,0,0,0,0,0,0,-67,-67,-67,-67,-1,0,0,0,0,0,0,0,-106,-106,-106,-106,-1,0,0,0,0,0,0,0,115,115,115,115,-1,0,0,0,0,0,0,0,82,82,82,82,-1,0,0,0,0,0,0,0,37,37,37,37,-1,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,21,48,-2,-2,-26,-50,-1,0,0,0,0,0,19,-109,-3,-3,-82,107,-1,0,0,0,0,0,14,-16,-26,-26,85,13,-1,0,0,0,0,0,19,32,-2,-2,-19,-34,-1,0,0,0,0,0,20,120,-3,-3,-66,-123,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,13,-3,-39,-39,71,1,-1,0,0,0,0,0,19,32,-2,-2,-19,-34,-1,0,0,0,0,0,20,120,-3,-3,-66,-123,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,14,-16,-26,-26,85,13,-1,0,0,0,0,0,13,-6,-90,-90,54,3,-1,0,0,0,0,0,19,32,-2,-2,-19,-34,-1,0,0,0,0,0,21,91,-3,-3,-48,-94,-1,0,0,0,0,0,19,-109,-3,-3,-82,107,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,14,-16,-26,-26,85,13,-1,0,0,0,0,0,13,-6,-90,-90,54,3,-1,0,0,0,0,0,19,32,-2,-2,-19,-34,-1,0,0,0,0,0,21,91,-3,-3,-48,-94,-1,0,0,0,0,0,19,-109,-3,-3,-82,107,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,16,-22,-15,-15,105,19,-1,0,0,0,0,0,13,-3,-39,-39,72,1,-1,0,0,0,0,0,12,-9,-116,-116,45,4,-1,0,0,0,0,0,21,20,-1,-1,-11,-21,-1,0,0,0,0,0,21,48,-2,-2,-26,-50,-1,0,0,0,0,0,21,91,-3,-3,-48,-94,-1,0,0,0,0,0,19,-109,-3,-3,-82,107,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,16,-22,-15,-15,105,19,-1,0,0,0,0,0,13,-3,-39,-39,72,1,-1,0,0,0,0,0,12,-9,-116,-116,45,4,-1,0,0,0,0,0,21,20,-1,-1,-11,-21,-1,0,0,0,0,0,21,48,-2,-2,-26,-50,-1,0,0,0,0,0,21,91,-3,-3,-48,-94,-1,0,0,0,0,0,19,-109,-3,-3,-82,107,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,16,-22,-15,-15,105,19,-1,0,0,0,0,0,13,-3,-39,-39,72,1,-1,0,0,0,0,0,13,-6,-90,-90,54,3,-1,0,0,0,0,0,12,-10,127,127,39,4,-1,0,0,0,0,0,25,54,-2,-2,-24,-56,-1,0,0,0,0,0,19,121,-3,-3,-69,-124,-1,0,0,0,0,0,5,-59,-29,-29,74,51,-1,0,0,0,0,0,26,37,-2,-2,-16,-39,-1,0,0,0,0,0,24,115,-3,-3,-52,-118,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,3,-38,-41,-41,48,31,-1,0,0,0,0,0,26,37,-2,-2,-16,-39,-1,0,0,0,0,0,24,115,-3,-3,-52,-118,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,5,-59,-29,-29,74,51,-1,0,0,0,0,0,0,-1,-77,-77,0,0,-1,0,0,0,0,0,26,37,-2,-2,-16,-39,-1,0,0,0,0,0,24,95,-3,-3,-44,-98,-1,0,0,0,0,0,19,121,-3,-3,-69,-124,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,5,-59,-29,-29,74,51,-1,0,0,0,0,0,0,-1,-77,-77,0,0,-1,0,0,0,0,0,26,37,-2,-2,-16,-39,-1,0,0,0,0,0,24,95,-3,-3,-44,-98,-1,0,0,0,0,0,19,121,-3,-3,-69,-124,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,7,-78,-17,-17,101,72,-1,0,0,0,0,0,3,-38,-41,-41,48,31,-1,0,0,0,0,0,0,-1,-103,-103,0,0,-1,0,0,0,0,0,24,18,-1,-1,-9,-20,-1,0,0,0,0,0,25,54,-2,-2,-24,-56,-1,0,0,0,0,0,24,95,-3,-3,-44,-98,-1,0,0,0,0,0,19,121,-3,-3,-69,-124,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,7,-78,-17,-17,101,72,-1,0,0,0,0,0,3,-38,-41,-41,48,31,-1,0,0,0,0,0,0,-1,-103,-103,0,0,-1,0,0,0,0,0,24,18,-1,-1,-9,-20,-1,0,0,0,0,0,25,54,-2,-2,-24,-56,-1,0,0,0,0,0,24,95,-3,-3,-44,-98,-1,0,0,0,0,0,19,121,-3,-3,-69,-124,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,7,-78,-17,-17,101,72,-1,0,0,0,0,0,3,-38,-41,-41,48,31,-1,0,0,0,0,0,0,-1,-77,-77,0,0,-1,0,0,0,0,0,0,-1,127,127,0,0,-1,0,0,0,0,0,-114,68,-29,-90,-50,-29,-1,0,0,0,0,0,-66,-103,-102,106,61,-102,-1,0,0,0,0,0,-112,-45,-76,31,120,-76,-1,0,0,0,0,0,65,97,-33,-78,-33,-118,-1,0,0,0,0,0,82,-72,-96,51,-96,44,-1,0,0,0,0,0,0,99,-5,-5,-102,-103,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,23,-113,-3,-3,-65,111,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,-58,42,-42,-54,-78,-42,-1,0,0,0,0,0,-114,68,-29,-90,-50,-29,-1,0,0,0,0,0,-66,-103,-102,106,61,-102,-1,0,0,0,0,0,42,102,-1,-1,-1,-103,-1,0,0,0,0,0,-112,-45,-76,31,120,-76,-1,0,0,0,0,0,65,97,-33,-78,-33,-118,-1,0,0,0,0,0,82,-72,-96,51,-96,44,-1,0,0,0,0,0,0,99,-5,-5,-102,-103,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,23,-113,-3,-3,-65,111,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,-58,42,-42,-54,-78,-42,-1,0,0,0,0,0,-114,68,-29,-90,-50,-29,-1,0,0,0,0,0,-66,-103,-102,106,61,-102,-1,0,0,0,0,0,42,102,-1,-1,-1,-103,-1,0,0,0,0,0,15,-59,-79,-79,89,40,-1,0,0,0,0,0,-112,-45,-76,31,120,-76,-1,0,0,0,0,0,65,97,-33,-78,-33,-118,-1,0,0,0,0,0,82,-72,-96,51,-96,44,-1,0,0,0,0,0,0,99,-5,-5,-102,-103,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,23,-113,-3,-3,-65,111,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,-58,42,-42,-54,-78,-42,-1,0,0,0,0,0,-114,68,-29,-90,-50,-29,-1,0,0,0,0,0,-112,-45,-76,31,120,-76,-1,0,0,0,0,0,65,97,-33,-78,-33,-118,-1,0,0,0,0,0,-114,68,-29,-90,-50,-29,-1,0,0,0,0,0,-112,-45,-76,31,120,-76,-1,0,0,0,0,0,65,97,-33,-78,-33,-118,-1,0,0,0,0,0,82,-72,-96,51,-96,44,-1,0,0,0,0,0,-114,68,-29,-90,-50,-29,-1,0,0,0,0,0,-112,-45,-76,31,120,-76,-1,0,0,0,0,0,65,97,-33,-78,-33,-118,-1,0,0,0,0,0,82,-72,-96,51,-96,44,-1,0,0,0,0,0,0,99,-5,-5,-102,-103,-1,0,0,0,0,0,-114,68,-29,-90,-50,-29,-1,0,0,0,0,0,-112,-45,-76,31,120,-76,-1,0,0,0,0,0,65,97,-33,-78,-33,-118,-1,0,0,0,0,0,82,-72,-96,51,-96,44,-1,0,0,0,0,0,0,99,-5,-5,-102,-103,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,-114,68,-29,-90,-50,-29,-1,0,0,0,0,0,-112,-45,-76,31,120,-76,-1,0,0,0,0,0,65,97,-33,-78,-33,-118,-1,0,0,0,0,0,82,-72,-96,51,-96,44,-1,0,0,0,0,0,0,99,-5,-5,-102,-103,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,23,-113,-3,-3,-65,111,-1,0,0,0,0,0,-114,68,-29,-90,-50,-29,-1,0,0,0,0,0,-112,-45,-76,31,120,-76,-1,0,0,0,0,0,65,97,-33,-78,-33,-118,-1,0,0,0,0,0,82,-72,-96,51,-96,44,-1,0,0,0,0,0,0,99,-5,-5,-102,-103,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,23,-113,-3,-3,-65,111,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,-114,68,-29,-90,-50,-29,-1,0,0,0,0,0,-112,-45,-76,31,120,-76,-1,0,0,0,0,0,65,97,-33,-78,-33,-118,-1,0,0,0,0,0,82,-72,-96,51,-96,44,-1,0,0,0,0,0,0,99,-5,-5,-102,-103,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,23,-113,-3,-3,-65,111,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,-58,42,-42,-54,-78,-42,-1,0,0,0,0,0,3,78,-5,-5,-76,-82,-1,0,0,0,0,0,-110,53,-29,-77,-51,-29,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,3,78,-5,-5,-76,-82,-1,0,0,0,0,0,-110,53,-29,-77,-51,-29,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,-54,27,-28,-34,-53,-28,-1,0,0,0,0,0,3,78,-5,-5,-76,-82,-1,0,0,0,0,0,-110,53,-29,-77,-51,-29,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,-54,27,-28,-34,-53,-28,-1,0,0,0,0,0,24,88,-2,-2,-39,-90,-1,0,0,0,0,0,3,78,-5,-5,-76,-82,-1,0,0,0,0,0,-110,53,-29,-77,-51,-29,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,-54,27,-28,-34,-53,-28,-1,0,0,0,0,0,24,88,-2,-2,-39,-90,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,3,78,-5,-5,-76,-82,-1,0,0,0,0,0,-110,53,-29,-77,-51,-29,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,-54,27,-28,-34,-53,-28,-1,0,0,0,0,0,24,88,-2,-2,-39,-90,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,28,44,-27,-27,-40,-67,-1,0,0,0,0,0,3,78,-5,-5,-76,-82,-1,0,0,0,0,0,-110,53,-29,-77,-51,-29,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,-54,27,-28,-34,-53,-28,-1,0,0,0,0,0,24,88,-2,-2,-39,-90,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,28,44,-27,-27,-40,-67,-1,0,0,0,0,0,-23,35,-3,-3,-38,-20,-1,0,0,0,0,0,3,78,-5,-5,-76,-82,-1,0,0,0,0,0,-110,53,-29,-77,-51,-29,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,-54,27,-28,-34,-53,-28,-1,0,0,0,0,0,24,88,-2,-2,-39,-90,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,28,44,-27,-27,-40,-67,-1,0,0,0,0,0,-23,35,-3,-3,-38,-20,-1,0,0,0,0,0,0,0,-14,-14,-14,-14,-1,0,0,0,0,0,108,53,-30,-77,-30,-51,-1,0,0,0,0,0,17,81,-3,-3,-51,-84,-1,0,0,0,0,0,-101,31,-24,-53,-43,-24,-1,0,0,0,0,0,108,53,-30,-77,-30,-51,-1,0,0,0,0,0,17,81,-3,-3,-51,-84,-1,0,0,0,0,0,-101,31,-24,-53,-43,-24,-1,0,0,0,0,0,-28,43,-12,-12,-54,-28,-1,0,0,0,0,0,108,53,-30,-77,-30,-51,-1,0,0,0,0,0,17,81,-3,-3,-51,-84,-1,0,0,0,0,0,-101,31,-24,-53,-43,-24,-1,0,0,0,0,0,-28,43,-12,-12,-54,-28,-1,0,0,0,0,0,56,45,-11,-26,-11,-55,-1,0,0,0,0,0,108,53,-30,-77,-30,-51,-1,0,0,0,0,0,17,81,-3,-3,-51,-84,-1,0,0,0,0,0,-101,31,-24,-53,-43,-24,-1,0,0,0,0,0,-28,43,-12,-12,-54,-28,-1,0,0,0,0,0,56,45,-11,-26,-11,-55,-1,0,0,0,0,0,35,81,-1,-1,-14,-82,-1,0,0,0,0,0,108,53,-30,-77,-30,-51,-1,0,0,0,0,0,17,81,-3,-3,-51,-84,-1,0,0,0,0,0,-101,31,-24,-53,-43,-24,-1,0,0,0,0,0,-28,43,-12,-12,-54,-28,-1,0,0,0,0,0,56,45,-11,-26,-11,-55,-1,0,0,0,0,0,35,81,-1,-1,-14,-82,-1,0,0,0,0,0,25,39,-15,-15,-30,-52,-1,0,0,0,0,0,108,53,-30,-77,-30,-51,-1,0,0,0,0,0,17,81,-3,-3,-51,-84,-1,0,0,0,0,0,-101,31,-24,-53,-43,-24,-1,0,0,0,0,0,-28,43,-12,-12,-54,-28,-1,0,0,0,0,0,56,45,-11,-26,-11,-55,-1,0,0,0,0,0,35,81,-1,-1,-14,-82,-1,0,0,0,0,0,25,39,-15,-15,-30,-52,-1,0,0,0,0,0,0,0,-52,-52,-52,-52,-1,0,0,0,0,0,-26,-3,-114,-114,1,82,-1,0,0,0,0,0,77,-65,100,39,100,25,-1,0,0,0,0,0,-26,-36,-59,-59,27,125,-1,0,0,0,0,0,-24,118,-34,-34,119,-82,-1,0,0,0,0,0,-27,62,-15,-15,-74,-38,-1,0,0,0,0,0,-23,29,-3,-3,-32,-17,-1,0,0,0,0,0,59,38,-11,-26,-11,-48,-1,0,0,0,0,0,61,103,-31,-72,-31,-122,-1,0,0,0,0,0,63,-90,-68,127,-68,65,-1,0,0,0,0,0,68,-59,-110,77,-110,33,-1,0,0,0,0,0,-26,-3,-114,-114,1,82,-1,0,0,0,0,0,68,-59,-110,77,-110,33,-1,0,0,0,0,0,77,-65,100,39,100,25,-1,0,0,0,0,0,-26,-36,-59,-59,27,125,-1,0,0,0,0,0,-24,118,-34,-34,119,-82,-1,0,0,0,0,0,-27,62,-15,-15,-74,-38,-1,0,0,0,0,0,-23,29,-3,-3,-32,-17,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,59,38,-11,-26,-11,-48,-1,0,0,0,0,0,61,103,-31,-72,-31,-122,-1,0,0,0,0,0,63,-90,-68,127,-68,65,-1,0,0,0,0,0,-25,76,-23,-23,-93,-55,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,63,-127,-41,-95,-41,106,-1,0,0,0,0,0,-28,-36,-48,-48,28,-117,-1,0,0,0,0,0,-27,62,-15,-15,-74,-38,-1,0,0,0,0,0,61,103,-31,-72,-31,-122,-1,0,0,0,0,0,72,-58,-84,77,-84,38,-1,0,0,0,0,0,-28,-36,-48,-48,28,-117,-1,0,0,0,0,0,-27,62,-15,-15,-74,-38,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,61,103,-31,-72,-31,-122,-1,0,0,0,0,0,72,-58,-84,77,-84,38,-1,0,0,0,0,0,-26,-36,-59,-59,27,125,-1,0,0,0,0,0,-25,76,-23,-23,-93,-55,-1,0,0,0,0,0,-23,29,-3,-3,-32,-17,-1,0,0,0,0,0,59,38,-11,-26,-11,-48,-1,0,0,0,0,0,63,-127,-41,-95,-41,106,-1,0,0,0,0,0,68,-59,-110,77,-110,33,-1,0,0,0,0,0,-26,-36,-59,-59,27,125,-1,0,0,0,0,0,-25,76,-23,-23,-93,-55,-1,0,0,0,0,0,-23,29,-3,-3,-32,-17,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,59,38,-11,-26,-11,-48,-1,0,0,0,0,0,63,-127,-41,-95,-41,106,-1,0,0,0,0,0,68,-59,-110,77,-110,33,-1,0,0,0,0,0,-26,-36,-59,-59,27,125,-1,0,0,0,0,0,-24,118,-34,-34,119,-82,-1,0,0,0,0,0,-27,62,-15,-15,-74,-38,-1,0,0,0,0,0,-23,29,-3,-3,-32,-17,-1,0,0,0,0,0,59,38,-11,-26,-11,-48,-1,0,0,0,0,0,61,103,-31,-72,-31,-122,-1,0,0,0,0,0,63,-90,-68,127,-68,65,-1,0,0,0,0,0,68,-59,-110,77,-110,33,-1,0,0,0,0,0,-26,-36,-59,-59,27,125,-1,0,0,0,0,0,-24,118,-34,-34,119,-82,-1,0,0,0,0,0,-27,62,-15,-15,-74,-38,-1,0,0,0,0,0,-23,29,-3,-3,-32,-17,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,59,38,-11,-26,-11,-48,-1,0,0,0,0,0,61,103,-31,-72,-31,-122,-1,0,0,0,0,0,63,-90,-68,127,-68,65,-1,0,0,0,0,0,68,-59,-110,77,-110,33,-1,0,0,0,0,0,-50,-1,75,64,0,75,-1,0,0,0,0,0,101,-1,68,0,68,27,-1,0,0,0,0,0,-50,-83,-125,118,42,-125,-1,0,0,0,0,0,-57,87,-85,-103,112,-85,-1,0,0,0,0,0,-57,51,-49,-62,-91,-49,-1,0,0,0,0,0,-46,21,-24,-25,-44,-24,-1,0,0,0,0,0,76,30,-16,-39,-16,-45,-1,0,0,0,0,0,80,68,-37,-90,-37,-96,-1,0,0,0,0,0,88,123,-82,90,-82,97,-1,0,0,0,0,0,97,-59,120,27,120,55,-1,0,0,0,0,0,-50,-1,75,64,0,75,-1,0,0,0,0,0,97,-59,120,27,120,55,-1,0,0,0,0,0,101,-1,68,0,68,27,-1,0,0,0,0,0,-50,-83,-125,118,42,-125,-1,0,0,0,0,0,-57,87,-85,-103,112,-85,-1,0,0,0,0,0,-57,51,-49,-62,-91,-49,-1,0,0,0,0,0,-46,21,-24,-25,-44,-24,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,76,30,-16,-39,-16,-45,-1,0,0,0,0,0,80,68,-37,-90,-37,-96,-1,0,0,0,0,0,88,123,-82,90,-82,97,-1,0,0,0,0,0,-60,70,-61,-81,-115,-61,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,82,90,-65,127,-65,123,-1,0,0,0,0,0,-55,-88,-108,123,50,-108,-1,0,0,0,0,0,-57,51,-49,-62,-91,-49,-1,0,0,0,0,0,80,68,-37,-90,-37,-96,-1,0,0,0,0,0,102,-1,-120,0,-120,55,-1,0,0,0,0,0,-55,-88,-108,123,50,-108,-1,0,0,0,0,0,-57,51,-49,-62,-91,-49,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,80,68,-37,-90,-37,-96,-1,0,0,0,0,0,102,-1,-120,0,-120,55,-1,0,0,0,0,0,-50,-83,-125,118,42,-125,-1,0,0,0,0,0,-60,70,-61,-81,-115,-61,-1,0,0,0,0,0,-46,21,-24,-25,-44,-24,-1,0,0,0,0,0,76,30,-16,-39,-16,-45,-1,0,0,0,0,0,82,90,-65,127,-65,123,-1,0,0,0,0,0,97,-59,120,27,120,55,-1,0,0,0,0,0,-50,-83,-125,118,42,-125,-1,0,0,0,0,0,-60,70,-61,-81,-115,-61,-1,0,0,0,0,0,-46,21,-24,-25,-44,-24,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,76,30,-16,-39,-16,-45,-1,0,0,0,0,0,82,90,-65,127,-65,123,-1,0,0,0,0,0,97,-59,120,27,120,55,-1,0,0,0,0,0,-50,-83,-125,118,42,-125,-1,0,0,0,0,0,-57,87,-85,-103,112,-85,-1,0,0,0,0,0,-57,51,-49,-62,-91,-49,-1,0,0,0,0,0,-46,21,-24,-25,-44,-24,-1,0,0,0,0,0,76,30,-16,-39,-16,-45,-1,0,0,0,0,0,80,68,-37,-90,-37,-96,-1,0,0,0,0,0,88,123,-82,90,-82,97,-1,0,0,0,0,0,97,-59,120,27,120,55,-1,0,0,0,0,0,-50,-83,-125,118,42,-125,-1,0,0,0,0,0,-57,87,-85,-103,112,-85,-1,0,0,0,0,0,-57,51,-49,-62,-91,-49,-1,0,0,0,0,0,-46,21,-24,-25,-44,-24,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,76,30,-16,-39,-16,-45,-1,0,0,0,0,0,80,68,-37,-90,-37,-96,-1,0,0,0,0,0,88,123,-82,90,-82,97,-1,0,0,0,0,0,97,-59,120,27,120,55,-1,0,0,0,0,0,-67,11,-14,-20,-25,-14,-1,0,0,0,0,0,-105,61,-37,-90,-67,-37,-1,0,0,0,0,0,-115,-59,-66,43,-116,-66,-1,0,0,0,0,0,-71,8,-10,-15,-18,-10,-1,0,0,0,0,0,-101,40,-31,-67,-55,-31,-1,0,0,0,0,0,-111,112,-49,116,-87,-49,-1,0,0,0,0,0,-113,-9,-80,5,112,-80,-1,0,0,0,0,0,-71,8,-10,-15,-18,-10,-1,0,0,0,0,0,-101,40,-31,-67,-55,-31,-1,0,0,0,0,0,-111,112,-49,116,-87,-49,-1,0,0,0,0,0,-115,-59,-66,43,-116,-66,-1,0,0,0,0,0,-113,-9,-115,4,90,-115,-1,0,0,0,0,0,-71,8,-10,-15,-18,-10,-1,0,0,0,0,0,-88,24,-26,-48,-47,-26,-1,0,0,0,0,0,-105,61,-37,-90,-67,-37,-1,0,0,0,0,0,-111,112,-49,116,-87,-49,-1,0,0,0,0,0,-115,-59,-66,43,-116,-66,-1,0,0,0,0,0,-113,-9,-115,4,90,-115,-1,0,0,0,0,0,-71,8,-10,-15,-18,-10,-1,0,0,0,0,0,-88,24,-26,-48,-47,-26,-1,0,0,0,0,0,-105,61,-37,-90,-67,-37,-1,0,0,0,0,0,-111,112,-49,116,-87,-49,-1,0,0,0,0,0,-114,-73,-64,54,-112,-64,-1,0,0,0,0,0,-113,-9,-80,5,112,-80,-1,0,0,0,0,0,-113,-8,123,3,78,123,-1,0,0,0,0,0,-23,8,-1,-1,-9,-5,-1,0,0,0,0,0,-67,11,-14,-20,-25,-14,-1,0,0,0,0,0,-88,24,-26,-48,-47,-26,-1,0,0,0,0,0,-105,61,-37,-90,-67,-37,-1,0,0,0,0,0,-111,112,-49,116,-87,-49,-1,0,0,0,0,0,-114,-73,-64,54,-112,-64,-1,0,0,0,0,0,-113,-9,-80,5,112,-80,-1,0,0,0,0,0,-113,-8,123,3,78,123,-1,0,0,0,0,0,-23,8,-1,-1,-9,-5,-1,0,0,0,0,0,-67,11,-14,-20,-25,-14,-1,0,0,0,0,0,-88,24,-26,-48,-47,-26,-1,0,0,0,0,0,-105,61,-37,-90,-67,-37,-1,0,0,0,0,0,-111,112,-49,116,-87,-49,-1,0,0,0,0,0,-114,-73,-64,54,-112,-64,-1,0,0,0,0,0,-113,-9,-80,5,112,-80,-1,0,0,0,0,0,-113,-9,-115,4,90,-115,-1,0,0,0,0,0,-113,-7,88,2,56,88,-1,0,0,0,0,0,-56,14,-16,-20,-30,-16,-1,0,0,0,0,0,-105,61,-37,-90,-67,-37,-1,0,0,0,0,0,-126,-48,-103,28,-112,-103,-1,0,0,0,0,0,-49,8,-9,-10,-17,-9,-1,0,0,0,0,0,-101,40,-31,-67,-55,-31,-1,0,0,0,0,0,-113,-128,-49,103,-87,-49,-1,0,0,0,0,0,-126,-5,-118,2,-127,-118,-1,0,0,0,0,0,-49,8,-9,-10,-17,-9,-1,0,0,0,0,0,-101,40,-31,-67,-55,-31,-1,0,0,0,0,0,-113,-128,-49,103,-87,-49,-1,0,0,0,0,0,-126,-48,-103,28,-112,-103,-1,0,0,0,0,0,119,-4,108,1,108,89,-1,0,0,0,0,0,-49,8,-9,-10,-17,-9,-1,0,0,0,0,0,-88,24,-26,-48,-47,-26,-1,0,0,0,0,0,-105,61,-37,-90,-67,-37,-1,0,0,0,0,0,-113,-128,-49,103,-87,-49,-1,0,0,0,0,0,-126,-48,-103,28,-112,-103,-1,0,0,0,0,0,119,-4,108,1,108,89,-1,0,0,0,0,0,-49,8,-9,-10,-17,-9,-1,0,0,0,0,0,-88,24,-26,-48,-47,-26,-1,0,0,0,0,0,-105,61,-37,-90,-67,-37,-1,0,0,0,0,0,-113,-128,-49,103,-87,-49,-1,0,0,0,0,0,-114,-73,-64,54,-112,-64,-1,0,0,0,0,0,-126,-5,-118,2,-127,-118,-1,0,0,0,0,0,118,-4,100,1,100,80,-1,0,0,0,0,0,-23,8,-1,-1,-9,-5,-1,0,0,0,0,0,-56,14,-16,-20,-30,-16,-1,0,0,0,0,0,-88,24,-26,-48,-47,-26,-1,0,0,0,0,0,-105,61,-37,-90,-67,-37,-1,0,0,0,0,0,-113,-128,-49,103,-87,-49,-1,0,0,0,0,0,-114,-73,-64,54,-112,-64,-1,0,0,0,0,0,-126,-5,-118,2,-127,-118,-1,0,0,0,0,0,118,-4,100,1,100,80,-1,0,0,0,0,0,-23,8,-1,-1,-9,-5,-1,0,0,0,0,0,-56,14,-16,-20,-30,-16,-1,0,0,0,0,0,-88,24,-26,-48,-47,-26,-1,0,0,0,0,0,-105,61,-37,-90,-67,-37,-1,0,0,0,0,0,-113,-128,-49,103,-87,-49,-1,0,0,0,0,0,-114,-73,-64,54,-112,-64,-1,0,0,0,0,0,-126,-5,-118,2,-127,-118,-1,0,0,0,0,0,119,-4,108,1,108,89,-1,0,0,0,0,0,117,-5,70,1,70,54,-1,0,0,0,0,0,18,-18,127,127,59,8,-1,0,0,0,0,0,-61,-1,75,45,0,75,-1,0,0,0,0,0,20,-10,-77,-77,88,6,-1,0,0,0,0,0,22,-24,-32,-32,-126,20,-1,0,0,0,0,0,23,-101,-3,-3,-72,99,-1,0,0,0,0,0,24,72,-2,-2,-32,-74,-1,0,0,0,0,0,-91,20,-21,-40,-38,-21,-1,0,0,0,0,0,-79,47,-46,-78,-85,-46,-1,0,0,0,0,0,-77,84,-84,-128,115,-84,-1,0,0,0,0,0,-67,-75,-120,84,39,-120,-1,0,0,0,0,0,18,-18,127,127,59,8,-1,0,0,0,0,0,-67,-75,-120,84,39,-120,-1,0,0,0,0,0,-61,-1,75,45,0,75,-1,0,0,0,0,0,20,-10,-77,-77,88,6,-1,0,0,0,0,0,22,-24,-32,-32,-126,20,-1,0,0,0,0,0,23,-101,-3,-3,-72,99,-1,0,0,0,0,0,24,72,-2,-2,-32,-74,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,-91,20,-21,-40,-38,-21,-1,0,0,0,0,0,-79,47,-46,-78,-85,-46,-1,0,0,0,0,0,-77,84,-84,-128,115,-84,-1,0,0,0,0,0,23,-69,-15,-15,-93,64,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,-78,69,-61,-103,-114,-61,-1,0,0,0,0,0,17,-3,-26,-26,97,1,-1,0,0,0,0,0,23,-101,-3,-3,-72,99,-1,0,0,0,0,0,-79,47,-46,-78,-85,-46,-1,0,0,0,0,0,-71,-101,-103,94,60,-103,-1,0,0,0,0,0,17,-3,-26,-26,97,1,-1,0,0,0,0,0,23,-101,-3,-3,-72,99,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,-79,47,-46,-78,-85,-46,-1,0,0,0,0,0,-71,-101,-103,94,60,-103,-1,0,0,0,0,0,20,-10,-77,-77,88,6,-1,0,0,0,0,0,23,-69,-15,-15,-93,64,-1,0,0,0,0,0,24,72,-2,-2,-32,-74,-1,0,0,0,0,0,-91,20,-21,-40,-38,-21,-1,0,0,0,0,0,-78,69,-61,-103,-114,-61,-1,0,0,0,0,0,-67,-75,-120,84,39,-120,-1,0,0,0,0,0,20,-10,-77,-77,88,6,-1,0,0,0,0,0,23,-69,-15,-15,-93,64,-1,0,0,0,0,0,24,72,-2,-2,-32,-74,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,-91,20,-21,-40,-38,-21,-1,0,0,0,0,0,-78,69,-61,-103,-114,-61,-1,0,0,0,0,0,-67,-75,-120,84,39,-120,-1,0,0,0,0,0,20,-10,-77,-77,88,6,-1,0,0,0,0,0,22,-24,-32,-32,-126,20,-1,0,0,0,0,0,23,-101,-3,-3,-72,99,-1,0,0,0,0,0,24,72,-2,-2,-32,-74,-1,0,0,0,0,0,-91,20,-21,-40,-38,-21,-1,0,0,0,0,0,-79,47,-46,-78,-85,-46,-1,0,0,0,0,0,-77,84,-84,-128,115,-84,-1,0,0,0,0,0,-67,-75,-120,84,39,-120,-1,0,0,0,0,0,20,-10,-77,-77,88,6,-1,0,0,0,0,0,22,-24,-32,-32,-126,20,-1,0,0,0,0,0,23,-101,-3,-3,-72,99,-1,0,0,0,0,0,24,72,-2,-2,-32,-74,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,-91,20,-21,-40,-38,-21,-1,0,0,0,0,0,-79,47,-46,-78,-85,-46,-1,0,0,0,0,0,-77,84,-84,-128,115,-84,-1,0,0,0,0,0,-67,-75,-120,84,39,-120,-1,0,0,0,0,0,-68,14,-17,-25,-31,-17,-1,0,0,0,0,0,-42,67,-55,-55,-108,-57,-1,0,0,0,0,0,-22,-34,-35,-35,28,119,-1,0,0,0,0,0,-71,8,-10,-15,-18,-10,-1,0,0,0,0,0,-45,41,-40,-41,-75,-40,-1,0,0,0,0,0,-28,-117,-33,-33,101,-80,-1,0,0,0,0,0,-17,-24,-50,-50,18,86,-1,0,0,0,0,0,-71,8,-10,-15,-18,-10,-1,0,0,0,0,0,-45,41,-40,-41,-75,-40,-1,0,0,0,0,0,-28,-117,-33,-33,101,-80,-1,0,0,0,0,0,-22,-34,-35,-35,28,119,-1,0,0,0,0,0,-20,-1,-104,-104,0,67,-1,0,0,0,0,0,-71,8,-10,-15,-18,-10,-1,0,0,0,0,0,-52,38,-38,-44,-71,-38,-1,0,0,0,0,0,-42,67,-55,-55,-108,-57,-1,0,0,0,0,0,-28,-117,-33,-33,101,-80,-1,0,0,0,0,0,-22,-34,-35,-35,28,119,-1,0,0,0,0,0,-20,-1,-104,-104,0,67,-1,0,0,0,0,0,-71,8,-10,-15,-18,-10,-1,0,0,0,0,0,-52,38,-38,-44,-71,-38,-1,0,0,0,0,0,-42,67,-55,-55,-108,-57,-1,0,0,0,0,0,-28,-117,-33,-33,101,-80,-1,0,0,0,0,0,-23,-47,-25,-25,41,-118,-1,0,0,0,0,0,-17,-24,-50,-50,18,86,-1,0,0,0,0,0,-20,-1,-111,-111,0,63,-1,0,0,0,0,0,-61,5,-7,-9,-12,-7,-1,0,0,0,0,0,-68,14,-17,-25,-31,-17,-1,0,0,0,0,0,-52,38,-38,-44,-71,-38,-1,0,0,0,0,0,-42,67,-55,-55,-108,-57,-1,0,0,0,0,0,-28,-117,-33,-33,101,-80,-1,0,0,0,0,0,-23,-47,-25,-25,41,-118,-1,0,0,0,0,0,-17,-24,-50,-50,18,86,-1,0,0,0,0,0,-20,-1,-111,-111,0,63,-1,0,0,0,0,0,-61,5,-7,-9,-12,-7,-1,0,0,0,0,0,-68,14,-17,-25,-31,-17,-1,0,0,0,0,0,-52,38,-38,-44,-71,-38,-1,0,0,0,0,0,-42,67,-55,-55,-108,-57,-1,0,0,0,0,0,-28,-117,-33,-33,101,-80,-1,0,0,0,0,0,-23,-47,-25,-25,41,-118,-1,0,0,0,0,0,-17,-24,-50,-50,18,86,-1,0,0,0,0,0,-20,-1,-104,-104,0,67,-1,0,0,0,0,0,-14,-1,103,103,0,31,-1,0,0,0,0,0,-76,8,-11,-17,-19,-11,-1,0,0,0,0,0,-88,37,-36,-68,-67,-36,-1,0,0,0,0,0,-80,100,-79,117,107,-79,-1,0,0,0,0,0,-74,7,-9,-14,-16,-9,-1,0,0,0,0,0,-83,28,-30,-53,-55,-30,-1,0,0,0,0,0,-83,58,-56,-98,-102,-56,-1,0,0,0,0,0,-74,-128,-93,106,81,-93,-1,0,0,0,0,0,-74,7,-9,-14,-16,-9,-1,0,0,0,0,0,-83,28,-30,-53,-55,-30,-1,0,0,0,0,0,-83,58,-56,-98,-102,-56,-1,0,0,0,0,0,-80,100,-79,117,107,-79,-1,0,0,0,0,0,-68,-71,-113,84,39,-113,-1,0,0,0,0,0,-74,7,-9,-14,-16,-9,-1,0,0,0,0,0,-86,18,-21,-38,-38,-21,-1,0,0,0,0,0,-88,37,-36,-68,-67,-36,-1,0,0,0,0,0,-83,58,-56,-98,-102,-56,-1,0,0,0,0,0,-80,100,-79,117,107,-79,-1,0,0,0,0,0,-68,-71,-113,84,39,-113,-1,0,0,0,0,0,-74,7,-9,-14,-16,-9,-1,0,0,0,0,0,-86,18,-21,-38,-38,-21,-1,0,0,0,0,0,-88,37,-36,-68,-67,-36,-1,0,0,0,0,0,-83,58,-56,-98,-102,-56,-1,0,0,0,0,0,-84,83,-70,-128,125,-70,-1,0,0,0,0,0,-74,-128,-93,106,81,-93,-1,0,0,0,0,0,-66,-40,-122,74,20,-122,-1,0,0,0,0,0,-65,2,-3,-4,-5,-3,-1,0,0,0,0,0,-76,8,-11,-17,-19,-11,-1,0,0,0,0,0,-86,18,-21,-38,-38,-21,-1,0,0,0,0,0,-88,37,-36,-68,-67,-36,-1,0,0,0,0,0,-83,58,-56,-98,-102,-56,-1,0,0,0,0,0,-84,83,-70,-128,125,-70,-1,0,0,0,0,0,-74,-128,-93,106,81,-93,-1,0,0,0,0,0,-66,-40,-122,74,20,-122,-1,0,0,0,0,0,-65,2,-3,-4,-5,-3,-1,0,0,0,0,0,-76,8,-11,-17,-19,-11,-1,0,0,0,0,0,-86,18,-21,-38,-38,-21,-1,0,0,0,0,0,-88,37,-36,-68,-67,-36,-1,0,0,0,0,0,-83,58,-56,-98,-102,-56,-1,0,0,0,0,0,-84,83,-70,-128,125,-70,-1,0,0,0,0,0,-74,-128,-93,106,81,-93,-1,0,0,0,0,0,-68,-71,-113,84,39,-113,-1,0,0,0,0,0,-65,-1,125,63,0,125,-1,0,0,0,0,0,-14,-1,103,103,0,31,-1,0,0,0,0,0,-106,-15,97,5,48,97,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,5,-93,-42,-42,96,77,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,-114,32,-16,-47,-27,-16,-1,0,0,0,0,0,-115,87,-34,-110,-59,-34,-1,0,0,0,0,0,-113,-89,-61,67,-109,-61,-1,0,0,0,0,0,-108,-50,-84,33,102,-84,-1,0,0,0,0,0,-14,-1,103,103,0,31,-1,0,0,0,0,0,-108,-50,-84,33,102,-84,-1,0,0,0,0,0,-106,-15,97,5,48,97,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,5,-93,-42,-42,96,77,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,-114,32,-16,-47,-27,-16,-1,0,0,0,0,0,-115,87,-34,-110,-59,-34,-1,0,0,0,0,0,-113,-89,-61,67,-109,-61,-1,0,0,0,0,0,12,-106,-17,-17,-118,98,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,-113,-128,-49,103,-87,-49,-1,0,0,0,0,0,-8,-1,-54,-54,0,32,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,-115,87,-34,-110,-59,-34,-1,0,0,0,0,0,-113,-9,-80,5,113,-80,-1,0,0,0,0,0,-8,-1,-54,-54,0,32,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,-115,87,-34,-110,-59,-34,-1,0,0,0,0,0,-113,-9,-80,5,113,-80,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,12,-106,-17,-17,-118,98,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,-114,32,-16,-47,-27,-16,-1,0,0,0,0,0,-113,-128,-49,103,-87,-49,-1,0,0,0,0,0,-108,-50,-84,33,102,-84,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,12,-106,-17,-17,-118,98,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,-114,32,-16,-47,-27,-16,-1,0,0,0,0,0,-113,-128,-49,103,-87,-49,-1,0,0,0,0,0,-108,-50,-84,33,102,-84,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,5,-93,-42,-42,96,77,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,-114,32,-16,-47,-27,-16,-1,0,0,0,0,0,-115,87,-34,-110,-59,-34,-1,0,0,0,0,0,-113,-89,-61,67,-109,-61,-1,0,0,0,0,0,-108,-50,-84,33,102,-84,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,5,-93,-42,-42,96,77,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,-114,32,-16,-47,-27,-16,-1,0,0,0,0,0,-115,87,-34,-110,-59,-34,-1,0,0,0,0,0,-113,-89,-61,67,-109,-61,-1,0,0,0,0,0,-108,-50,-84,33,102,-84,-1,0,0,0,0,0,-14,-1,103,103,0,31,-1,0,0,0,0,0,0,0,26,26,26,26,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,5,-93,-42,-42,96,77,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,0,0,-32,-32,-32,-32,-1,0,0,0,0,0,0,0,-70,-70,-70,-70,-1,0,0,0,0,0,0,0,-121,-121,-121,-121,-1,0,0,0,0,0,0,0,77,77,77,77,-1,0,0,0,0,0,-14,-1,103,103,0,31,-1,0,0,0,0,0,0,0,77,77,77,77,-1,0,0,0,0,0,0,0,26,26,26,26,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,5,-93,-42,-42,96,77,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-32,-32,-32,-32,-1,0,0,0,0,0,0,0,-70,-70,-70,-70,-1,0,0,0,0,0,0,0,-121,-121,-121,-121,-1,0,0,0,0,0,12,-106,-17,-17,-118,98,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-103,-103,-103,-103,-1,0,0,0,0,0,-8,-1,-54,-54,0,32,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,0,0,-70,-70,-70,-70,-1,0,0,0,0,0,0,0,64,64,64,64,-1,0,0,0,0,0,-8,-1,-54,-54,0,32,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-70,-70,-70,-70,-1,0,0,0,0,0,0,0,64,64,64,64,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,12,-106,-17,-17,-118,98,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,0,0,-32,-32,-32,-32,-1,0,0,0,0,0,0,0,-103,-103,-103,-103,-1,0,0,0,0,0,0,0,77,77,77,77,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,12,-106,-17,-17,-118,98,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-32,-32,-32,-32,-1,0,0,0,0,0,0,0,-103,-103,-103,-103,-1,0,0,0,0,0,0,0,77,77,77,77,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,5,-93,-42,-42,96,77,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,0,0,-32,-32,-32,-32,-1,0,0,0,0,0,0,0,-70,-70,-70,-70,-1,0,0,0,0,0,0,0,-121,-121,-121,-121,-1,0,0,0,0,0,0,0,77,77,77,77,-1,0,0,0,0,0,-7,-36,-78,-78,24,43,-1,0,0,0,0,0,5,-93,-42,-42,96,77,-1,0,0,0,0,0,13,119,-12,-12,-91,-126,-1,0,0,0,0,0,15,54,-3,-3,-37,-57,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-32,-32,-32,-32,-1,0,0,0,0,0,0,0,-70,-70,-70,-70,-1,0,0,0,0,0,0,0,-121,-121,-121,-121,-1,0,0,0,0,0,0,0,77,77,77,77,-1,0,0,0,0,0,3,32,-3,-3,-32,-35,-1,0,0,0,0,0,-12,92,-6,-6,-97,-75,-1,0,0,0,0,0,-29,-36,-59,-59,27,-118,-1,0,0,0,0,0,13,28,-2,-2,-21,-30,-1,0,0,0,0,0,-4,72,-5,-5,-76,-71,-1,0,0,0,0,0,-18,-109,-9,-9,104,-95,-1,0,0,0,0,0,-32,-3,-82,-82,1,126,-1,0,0,0,0,0,13,28,-2,-2,-21,-30,-1,0,0,0,0,0,-4,72,-5,-5,-76,-71,-1,0,0,0,0,0,-18,-109,-9,-9,104,-95,-1,0,0,0,0,0,-29,-36,-59,-59,27,-118,-1,0,0,0,0,0,-43,-4,122,122,1,119,-1,0,0,0,0,0,13,28,-2,-2,-21,-30,-1,0,0,0,0,0,3,60,-4,-4,-59,-64,-1,0,0,0,0,0,-12,92,-6,-6,-97,-75,-1,0,0,0,0,0,-18,-109,-9,-9,104,-95,-1,0,0,0,0,0,-29,-36,-59,-59,27,-118,-1,0,0,0,0,0,-43,-4,122,122,1,119,-1,0,0,0,0,0,13,28,-2,-2,-21,-30,-1,0,0,0,0,0,3,60,-4,-4,-59,-64,-1,0,0,0,0,0,-12,92,-6,-6,-97,-75,-1,0,0,0,0,0,-18,-109,-9,-9,104,-95,-1,0,0,0,0,0,-26,-61,-35,-35,52,-105,-1,0,0,0,0,0,-32,-3,-82,-82,1,126,-1,0,0,0,0,0,-43,-4,122,122,1,119,-1,0,0,0,0,0,14,12,-1,-1,-9,-13,-1,0,0,0,0,0,3,32,-3,-3,-32,-35,-1,0,0,0,0,0,3,60,-4,-4,-59,-64,-1,0,0,0,0,0,-12,92,-6,-6,-97,-75,-1,0,0,0,0,0,-18,-109,-9,-9,104,-95,-1,0,0,0,0,0,-26,-61,-35,-35,52,-105,-1,0,0,0,0,0,-32,-3,-82,-82,1,126,-1,0,0,0,0,0,-43,-4,122,122,1,119,-1,0,0,0,0,0,14,12,-1,-1,-9,-13,-1,0,0,0,0,0,3,32,-3,-3,-32,-35,-1,0,0,0,0,0,3,60,-4,-4,-59,-64,-1,0,0,0,0,0,-12,92,-6,-6,-97,-75,-1,0,0,0,0,0,-18,-109,-9,-9,104,-95,-1,0,0,0,0,0,-26,-61,-35,-35,52,-105,-1,0,0,0,0,0,-32,-3,-82,-82,1,126,-1,0,0,0,0,0,-43,-4,122,122,1,119,-1,0,0,0,0,0,-57,-1,106,73,0,106,-1,0,0,0,0,0,-11,-1,-91,-91,0,38,-1,0,0,0,0,0,-89,-85,-107,49,54,-107,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,30,110,-2,-2,-32,-112,-1,0,0,0,0,0,-120,24,-8,-32,-13,-8,-1,0,0,0,0,0,-118,67,-23,-85,-39,-23,-1,0,0,0,0,0,-113,113,-47,116,-83,-47,-1,0,0,0,0,0,-105,-99,-76,69,117,-76,-1,0,0,0,0,0,-11,-1,-91,-91,0,38,-1,0,0,0,0,0,-105,-99,-76,69,117,-76,-1,0,0,0,0,0,-89,-85,-107,49,54,-107,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,30,110,-2,-2,-32,-112,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,-120,24,-8,-32,-13,-8,-1,0,0,0,0,0,-118,67,-23,-85,-39,-23,-1,0,0,0,0,0,-113,113,-47,116,-83,-47,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,-113,86,-37,-111,-65,-37,-1,0,0,0,0,0,-2,-31,-41,-41,25,28,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,-118,67,-23,-85,-39,-23,-1,0,0,0,0,0,-111,-63,-74,44,123,-74,-1,0,0,0,0,0,-2,-31,-41,-41,25,28,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,-118,67,-23,-85,-39,-23,-1,0,0,0,0,0,-111,-63,-74,44,123,-74,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,30,110,-2,-2,-32,-112,-1,0,0,0,0,0,-120,24,-8,-32,-13,-8,-1,0,0,0,0,0,-113,86,-37,-111,-65,-37,-1,0,0,0,0,0,-105,-99,-76,69,117,-76,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,30,110,-2,-2,-32,-112,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,-120,24,-8,-32,-13,-8,-1,0,0,0,0,0,-113,86,-37,-111,-65,-37,-1,0,0,0,0,0,-105,-99,-76,69,117,-76,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,30,110,-2,-2,-32,-112,-1,0,0,0,0,0,-120,24,-8,-32,-13,-8,-1,0,0,0,0,0,-118,67,-23,-85,-39,-23,-1,0,0,0,0,0,-113,113,-47,116,-83,-47,-1,0,0,0,0,0,-105,-99,-76,69,117,-76,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,30,110,-2,-2,-32,-112,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,-120,24,-8,-32,-13,-8,-1,0,0,0,0,0,-118,67,-23,-85,-39,-23,-1,0,0,0,0,0,-113,113,-47,116,-83,-47,-1,0,0,0,0,0,-105,-99,-76,69,117,-76,-1,0,0,0,0,0,-11,-1,-91,-91,0,38,-1,0,0,0,0,0,107,-1,104,0,104,55,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,51,106,-17,-39,-17,-117,-1,0,0,0,0,0,62,-126,-39,-90,-39,106,-1,0,0,0,0,0,83,121,-67,102,-67,99,-1,0,0,0,0,0,103,-45,-104,26,-104,80,-1,0,0,0,0,0,-11,-1,-91,-91,0,38,-1,0,0,0,0,0,103,-45,-104,26,-104,80,-1,0,0,0,0,0,107,-1,104,0,104,55,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,51,106,-17,-39,-17,-117,-1,0,0,0,0,0,62,-126,-39,-90,-39,106,-1,0,0,0,0,0,83,121,-67,102,-67,99,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,66,-120,-49,-111,-49,96,-1,0,0,0,0,0,-2,-31,-41,-41,25,28,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,62,-126,-39,-90,-39,106,-1,0,0,0,0,0,98,-46,-106,26,-106,65,-1,0,0,0,0,0,-2,-31,-41,-41,25,28,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,62,-126,-39,-90,-39,106,-1,0,0,0,0,0,98,-46,-106,26,-106,65,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,51,106,-17,-39,-17,-117,-1,0,0,0,0,0,66,-120,-49,-111,-49,96,-1,0,0,0,0,0,103,-45,-104,26,-104,80,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,51,106,-17,-39,-17,-117,-1,0,0,0,0,0,66,-120,-49,-111,-49,96,-1,0,0,0,0,0,103,-45,-104,26,-104,80,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,51,106,-17,-39,-17,-117,-1,0,0,0,0,0,62,-126,-39,-90,-39,106,-1,0,0,0,0,0,83,121,-67,102,-67,99,-1,0,0,0,0,0,103,-45,-104,26,-104,80,-1,0,0,0,0,0,2,-48,-41,-41,48,39,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,51,106,-17,-39,-17,-117,-1,0,0,0,0,0,62,-126,-39,-90,-39,106,-1,0,0,0,0,0,83,121,-67,102,-67,99,-1,0,0,0,0,0,103,-45,-104,26,-104,80,-1,0,0,0,0,0,13,44,-2,-2,-32,-46,-1,0,0,0,0,0,9,-117,-4,-4,-110,114,-1,0,0,0,0,0,1,-45,-34,-34,45,38,-1,0,0,0,0,0,13,37,-2,-2,-27,-39,-1,0,0,0,0,0,11,108,-4,-4,-82,-111,-1,0,0,0,0,0,7,-77,-5,-5,106,74,-1,0,0,0,0,0,-3,-32,-53,-53,24,29,-1,0,0,0,0,0,13,37,-2,-2,-27,-39,-1,0,0,0,0,0,11,108,-4,-4,-82,-111,-1,0,0,0,0,0,7,-77,-5,-5,106,74,-1,0,0,0,0,0,1,-45,-34,-34,45,38,-1,0,0,0,0,0,-3,-25,-91,-91,15,21,-1,0,0,0,0,0,13,37,-2,-2,-27,-39,-1,0,0,0,0,0,12,92,-4,-4,-69,-95,-1,0,0,0,0,0,9,-117,-4,-4,-110,114,-1,0,0,0,0,0,7,-77,-5,-5,106,74,-1,0,0,0,0,0,1,-45,-34,-34,45,38,-1,0,0,0,0,0,-3,-25,-91,-91,15,21,-1,0,0,0,0,0,13,37,-2,-2,-27,-39,-1,0,0,0,0,0,12,92,-4,-4,-69,-95,-1,0,0,0,0,0,9,-117,-4,-4,-110,114,-1,0,0,0,0,0,7,-77,-5,-5,106,74,-1,0,0,0,0,0,3,-48,-17,-17,59,44,-1,0,0,0,0,0,-3,-32,-53,-53,24,29,-1,0,0,0,0,0,-5,-1,-103,-103,0,13,-1,0,0,0,0,0,14,15,-1,-1,-11,-16,-1,0,0,0,0,0,13,44,-2,-2,-32,-46,-1,0,0,0,0,0,12,92,-4,-4,-69,-95,-1,0,0,0,0,0,9,-117,-4,-4,-110,114,-1,0,0,0,0,0,7,-77,-5,-5,106,74,-1,0,0,0,0,0,3,-48,-17,-17,59,44,-1,0,0,0,0,0,-3,-32,-53,-53,24,29,-1,0,0,0,0,0,-5,-1,-103,-103,0,13,-1,0,0,0,0,0,14,15,-1,-1,-11,-16,-1,0,0,0,0,0,13,44,-2,-2,-32,-46,-1,0,0,0,0,0,12,92,-4,-4,-69,-95,-1,0,0,0,0,0,9,-117,-4,-4,-110,114,-1,0,0,0,0,0,7,-77,-5,-5,106,74,-1,0,0,0,0,0,3,-48,-17,-17,59,44,-1,0,0,0,0,0,-3,-32,-53,-53,24,29,-1,0,0,0,0,0,-3,-25,-91,-91,15,21,-1,0,0,0,0,0,-7,-1,103,103,0,13,-1,0,0,0,0,0,-2,-31,-28,-28,26,28,-1,0,0,0,0,0,-110,-78,-72,55,126,-72,-1,0,0,0,0,0,83,-109,-81,77,-81,74,-1,0,0,0,0,0,-2,-31,-28,-28,26,28,-1,0,0,0,0,0,-110,-78,-72,55,126,-72,-1,0,0,0,0,0,83,-109,-81,77,-81,74,-1,0,0,0,0,0,-49,-124,-93,-104,78,-93,-1,0,0,0,0,0,-2,-31,-28,-28,26,28,-1,0,0,0,0,0,-110,-78,-72,55,126,-72,-1,0,0,0,0,0,83,-109,-81,77,-81,74,-1,0,0,0,0,0,-49,-124,-93,-104,78,-93,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,-2,-31,-28,-28,26,28,-1,0,0,0,0,0,-110,-78,-72,55,126,-72,-1,0,0,0,0,0,83,-109,-81,77,-81,74,-1,0,0,0,0,0,-49,-124,-93,-104,78,-93,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,42,-52,-1,-1,-1,51,-1,0,0,0,0,0,-2,-31,-28,-28,26,28,-1,0,0,0,0,0,-110,-78,-72,55,126,-72,-1,0,0,0,0,0,83,-109,-81,77,-81,74,-1,0,0,0,0,0,-49,-124,-93,-104,78,-93,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,42,-52,-1,-1,-1,51,-1,0,0,0,0,0,15,-63,-90,-90,86,40,-1,0,0,0,0,0,-2,-31,-28,-28,26,28,-1,0,0,0,0,0,-110,-78,-72,55,126,-72,-1,0,0,0,0,0,83,-109,-81,77,-81,74,-1,0,0,0,0,0,-49,-124,-93,-104,78,-93,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,42,-52,-1,-1,-1,51,-1,0,0,0,0,0,15,-63,-90,-90,86,40,-1,0,0,0,0,0,-24,121,-9,-9,-127,-65,-1,0,0,0,0,0,-2,-31,-28,-28,26,28,-1,0,0,0,0,0,-110,-78,-72,55,126,-72,-1,0,0,0,0,0,83,-109,-81,77,-81,74,-1,0,0,0,0,0,-49,-124,-93,-104,78,-93,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,42,-52,-1,-1,-1,51,-1,0,0,0,0,0,15,-63,-90,-90,86,40,-1,0,0,0,0,0,-24,121,-9,-9,-127,-65,-1,0,0,0,0,0,0,0,-103,-103,-103,-103,-1,0,0,0,0,0,114,120,-62,102,-62,-91,-1,0,0,0,0,0,11,-101,-4,-4,-115,98,-1,0,0,0,0,0,-100,77,-53,-115,-96,-53,-1,0,0,0,0,0,114,120,-62,102,-62,-91,-1,0,0,0,0,0,11,-101,-4,-4,-115,98,-1,0,0,0,0,0,-100,77,-53,-115,-96,-53,-1,0,0,0,0,0,-28,102,-25,-25,-118,-61,-1,0,0,0,0,0,114,120,-62,102,-62,-91,-1,0,0,0,0,0,11,-101,-4,-4,-115,98,-1,0,0,0,0,0,-100,77,-53,-115,-96,-53,-1,0,0,0,0,0,-28,102,-25,-25,-118,-61,-1,0,0,0,0,0,58,-101,-40,-90,-40,84,-1,0,0,0,0,0,114,120,-62,102,-62,-91,-1,0,0,0,0,0,11,-101,-4,-4,-115,98,-1,0,0,0,0,0,-100,77,-53,-115,-96,-53,-1,0,0,0,0,0,-28,102,-25,-25,-118,-61,-1,0,0,0,0,0,58,-101,-40,-90,-40,84,-1,0,0,0,0,0,34,-48,-1,-1,-39,47,-1,0,0,0,0,0,114,120,-62,102,-62,-91,-1,0,0,0,0,0,11,-101,-4,-4,-115,98,-1,0,0,0,0,0,-100,77,-53,-115,-96,-53,-1,0,0,0,0,0,-28,102,-25,-25,-118,-61,-1,0,0,0,0,0,58,-101,-40,-90,-40,84,-1,0,0,0,0,0,34,-48,-1,-1,-39,47,-1,0,0,0,0,0,25,90,-27,-27,-60,-108,-1,0,0,0,0,0,114,120,-62,102,-62,-91,-1,0,0,0,0,0,11,-101,-4,-4,-115,98,-1,0,0,0,0,0,-100,77,-53,-115,-96,-53,-1,0,0,0,0,0,-28,102,-25,-25,-118,-61,-1,0,0,0,0,0,58,-101,-40,-90,-40,84,-1,0,0,0,0,0,34,-48,-1,-1,-39,47,-1,0,0,0,0,0,25,90,-27,-27,-60,-108,-1,0,0,0,0,0,0,0,-77,-77,-77,-77,-1,0,0,0,0,0,120,84,-45,-115,-45,-57,-1,0,0,0,0,0,-45,82,-67,-68,-128,-67,-1,0,0,0,0,0,42,76,-1,-1,-1,-77,-1,0,0,0,0,0,-81,37,-38,-66,-70,-38,-1,0,0,0,0,0,4,-117,-5,-5,-128,114,-1,0,0,0,0,0,-112,100,-45,-128,-79,-45,-1,0,0,0,0,0,22,-100,-3,-3,-76,98,-1,0,0,0,0,0,58,-122,-34,-77,-34,105,-1,0,0,0,0,0,-23,47,-4,-4,-51,-27,-1,0,0,0,0,0,0,0,-39,-39,-39,-39,-1,0,0,0,0,0,120,84,-45,-115,-45,-57,-1,0,0,0,0,0,-45,82,-67,-68,-128,-67,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,42,76,-1,-1,-1,-77,-1,0,0,0,0,0,-81,37,-38,-66,-70,-38,-1,0,0,0,0,0,4,-117,-5,-5,-128,114,-1,0,0,0,0,0,-112,100,-45,-128,-79,-45,-1,0,0,0,0,0,22,-100,-3,-3,-76,98,-1,0,0,0,0,0,58,-122,-34,-77,-34,105,-1,0,0,0,0,0,-23,47,-4,-4,-51,-27,-1,0,0,0,0,0,0,0,-39,-39,-39,-39,-1,0,0,0,0,0,120,84,-45,-115,-45,-57,-1,0,0,0,0,0,-45,82,-67,-68,-128,-67,-1,0,0,0,0,0,77,41,-21,-52,-21,-59,-1,0,0,0,0,0,37,-112,-1,-1,-19,111,-1,0,0,0,0,0,42,76,-1,-1,-1,-77,-1,0,0,0,0,0,-81,37,-38,-66,-70,-38,-1,0,0,0,0,0,4,-117,-5,-5,-128,114,-1,0,0,0,0,0,-112,100,-45,-128,-79,-45,-1,0,0,0,0,0,22,-100,-3,-3,-76,98,-1,0,0,0,0,0,58,-122,-34,-77,-34,105,-1,0,0,0,0,0,-23,47,-4,-4,-51,-27,-1,0,0,0,0,0,0,0,-39,-39,-39,-39,-1,0,0,0,0,0,120,84,-45,-115,-45,-57,-1,0,0,0,0,0,42,76,-1,-1,-1,-77,-1,0,0,0,0,0,-81,37,-38,-66,-70,-38,-1,0,0,0,0,0,120,84,-45,-115,-45,-57,-1,0,0,0,0,0,42,76,-1,-1,-1,-77,-1,0,0,0,0,0,-81,37,-38,-66,-70,-38,-1,0,0,0,0,0,4,-117,-5,-5,-128,114,-1,0,0,0,0,0,120,84,-45,-115,-45,-57,-1,0,0,0,0,0,42,76,-1,-1,-1,-77,-1,0,0,0,0,0,-81,37,-38,-66,-70,-38,-1,0,0,0,0,0,4,-117,-5,-5,-128,114,-1,0,0,0,0,0,-112,100,-45,-128,-79,-45,-1,0,0,0,0,0,120,84,-45,-115,-45,-57,-1,0,0,0,0,0,42,76,-1,-1,-1,-77,-1,0,0,0,0,0,-81,37,-38,-66,-70,-38,-1,0,0,0,0,0,4,-117,-5,-5,-128,114,-1,0,0,0,0,0,-112,100,-45,-128,-79,-45,-1,0,0,0,0,0,22,-100,-3,-3,-76,98,-1,0,0,0,0,0,120,84,-45,-115,-45,-57,-1,0,0,0,0,0,42,76,-1,-1,-1,-77,-1,0,0,0,0,0,-81,37,-38,-66,-70,-38,-1,0,0,0,0,0,4,-117,-5,-5,-128,114,-1,0,0,0,0,0,-112,100,-45,-128,-79,-45,-1,0,0,0,0,0,22,-100,-3,-3,-76,98,-1,0,0,0,0,0,58,-122,-34,-77,-34,105,-1,0,0,0,0,0,120,84,-45,-115,-45,-57,-1,0,0,0,0,0,42,76,-1,-1,-1,-77,-1,0,0,0,0,0,-81,37,-38,-66,-70,-38,-1,0,0,0,0,0,4,-117,-5,-5,-128,114,-1,0,0,0,0,0,-112,100,-45,-128,-79,-45,-1,0,0,0,0,0,22,-100,-3,-3,-76,98,-1,0,0,0,0,0,58,-122,-34,-77,-34,105,-1,0,0,0,0,0,-23,47,-4,-4,-51,-27,-1,0,0,0,0,0,120,84,-45,-115,-45,-57,-1,0,0,0,0,0,42,76,-1,-1,-1,-77,-1,0,0,0,0,0,-81,37,-38,-66,-70,-38,-1,0,0,0,0,0,4,-117,-5,-5,-128,114,-1,0,0,0,0,0,-112,100,-45,-128,-79,-45,-1,0,0,0,0,0,22,-100,-3,-3,-76,98,-1,0,0,0,0,0,58,-122,-34,-77,-34,105,-1,0,0,0,0,0,-23,47,-4,-4,-51,-27,-1,0,0,0,0,0,0,0,-39,-39,-39,-39,-1,0,0,0,0,0,-19,-3,-98,-98,1,66,-1,0,0,0,0,0,-79,-126,-94,94,79,-94,-1,0,0,0,0,0,-6,-76,-43,-43,62,79,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,49,96,-11,-26,-11,-104,-1,0,0,0,0,0,79,65,-35,-85,-35,-92,-1,0,0,0,0,0,114,120,-62,102,-62,-91,-1,0,0,0,0,0,-113,-69,-67,50,-120,-67,-1,0,0,0,0,0,-19,-3,-98,-98,1,66,-1,0,0,0,0,0,-113,-69,-67,50,-120,-67,-1,0,0,0,0,0,-79,-126,-94,94,79,-94,-1,0,0,0,0,0,-6,-76,-43,-43,62,79,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,49,96,-11,-26,-11,-104,-1,0,0,0,0,0,79,65,-35,-85,-35,-92,-1,0,0,0,0,0,114,120,-62,102,-62,-91,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,81,77,-43,-103,-43,-108,-1,0,0,0,0,0,-2,-31,-41,-41,25,28,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,79,65,-35,-85,-35,-92,-1,0,0,0,0,0,-113,-60,-70,43,-125,-70,-1,0,0,0,0,0,-2,-31,-41,-41,25,28,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,79,65,-35,-85,-35,-92,-1,0,0,0,0,0,-113,-60,-70,43,-125,-70,-1,0,0,0,0,0,-6,-76,-43,-43,62,79,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,49,96,-11,-26,-11,-104,-1,0,0,0,0,0,81,77,-43,-103,-43,-108,-1,0,0,0,0,0,-113,-69,-67,50,-120,-67,-1,0,0,0,0,0,-6,-76,-43,-43,62,79,-1,0,0,0,0,0,13,-92,-4,-4,-115,89,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,49,96,-11,-26,-11,-104,-1,0,0,0,0,0,81,77,-43,-103,-43,-108,-1,0,0,0,0,0,-113,-69,-67,50,-120,-67,-1,0,0,0,0,0,-6,-76,-43,-43,62,79,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,49,96,-11,-26,-11,-104,-1,0,0,0,0,0,79,65,-35,-85,-35,-92,-1,0,0,0,0,0,114,120,-62,102,-62,-91,-1,0,0,0,0,0,-113,-69,-67,50,-120,-67,-1,0,0,0,0,0,-6,-76,-43,-43,62,79,-1,0,0,0,0,0,10,-72,-12,-12,109,67,-1,0,0,0,0,0,20,-99,-3,-3,-82,97,-1,0,0,0,0,0,31,115,-2,-2,-32,-117,-1,0,0,0,0,0,42,64,-1,-1,-1,-65,-1,0,0,0,0,0,49,96,-11,-26,-11,-104,-1,0,0,0,0,0,79,65,-35,-85,-35,-92,-1,0,0,0,0,0,114,120,-62,102,-62,-91,-1,0,0,0,0,0,-113,-69,-67,50,-120,-67,-1,0,0,0,0,0,-109,15,-1,-16,-8,-1,-1,0,0,0,0,0,24,35,-6,-6,-21,-41,-1,0,0,0,0,0,127,-1,-1,0,-1,-1,-1,0,0,0,0,0,113,-128,-1,127,-1,-44,-1,0,0,0,0,0,127,15,-1,-16,-1,-1,-1,0,0,0,0,0,42,26,-11,-11,-11,-36,-1,0,0,0,0,0,23,58,-1,-1,-28,-60,-1,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,25,49,-1,-1,-21,-51,-1,0,0,0,0,0,-86,-1,-1,0,0,-1,-1,0,0,0,0,0,-64,-50,-30,-118,43,-30,-1,0,0,0,0,0,0,-66,-91,-91,42,42,-1,0,0,0,0,0,23,99,-34,-34,-72,-121,-1,0,0,0,0,0,-128,103,-96,95,-98,-96,-1,0,0,0,0,0,63,-1,-1,127,-1,0,-1,0,0,0,0,0,17,-38,-46,-46,105,30,-1,0,0,0,0,0,11,-81,-1,-1,127,80,-1,0,0,0,0,0,-102,-109,-19,100,-107,-19,-1,0,0,0,0,0,33,34,-1,-1,-8,-36,-1,0,0,0,0,0,-10,-25,-36,-36,20,60,-1,0,0,0,0,0,127,-1,-1,0,-1,-1,-1,0,0,0,0,0,-86,-1,-117,0,0,-117,-1,0,0,0,0,0,127,-1,-117,0,-117,-117,-1,0,0,0,0,0,30,-17,-72,-72,-122,11,-1,0,0,0,0,0,0,0,-87,-87,-87,-87,-1,0,0,0,0,0,85,-1,100,0,100,0,-1,0,0,0,0,0,0,0,-87,-87,-87,-87,-1,0,0,0,0,0,39,110,-67,-67,-73,107,-1,0,0,0,0,0,-44,-1,-117,-117,0,-117,-1,0,0,0,0,0,58,-114,107,85,107,47,-1,0,0,0,0,0,23,-1,-1,-1,-116,0,-1,0,0,0,0,0,-58,-64,-52,-103,50,-52,-1,0,0,0,0,0,0,-1,-117,-117,0,0,-1,0,0,0,0,0,10,121,-23,-23,-106,122,-1,0,0,0,0,0,85,61,-68,-113,-68,-113,-1,0,0,0,0,0,-81,-113,-117,72,61,-117,-1,0,0,0,0,0,127,103,79,47,79,79,-1,0,0,0,0,0,127,103,79,47,79,79,-1,0,0,0,0,0,-128,-1,-47,0,-50,-47,-1,0,0,0,0,0,-57,-1,-45,-108,0,-45,-1,0,0,0,0,0,-24,-21,-1,-1,20,-109,-1,0,0,0,0,0,-118,-1,-1,0,-65,-1,-1,0,0,0,0,0,0,0,105,105,105,105,-1,0,0,0,0,0,0,0,105,105,105,105,-1,0,0,0,0,0,-108,-31,-1,30,-112,-1,-1,0,0,0,0,0,0,-50,-78,-78,34,34,-1,0,0,0,0,0,28,15,-1,-1,-6,-16,-1,0,0,0,0,0,85,-64,-117,34,-117,34,-1,0,0,0,0,0,-44,-1,-1,-1,0,-1,-1,0,0,0,0,0,0,0,-36,-36,-36,-36,-1,0,0,0,0,0,-86,7,-1,-8,-8,-1,-1,0,0,0,0,0,35,-1,-1,-1,-41,0,-1,0,0,0,0,0,30,-39,-38,-38,-91,32,-1,0,0,0,0,0,0,0,-128,-128,-128,-128,-1,0,0,0,0,0,85,-1,-128,0,-128,0,-1,0,0,0,0,0,59,-48,-1,-83,-1,47,-1,0,0,0,0,0,0,0,-128,-128,-128,-128,-1,0,0,0,0,0,85,15,-1,-16,-1,-16,-1,0,0,0,0,0,-23,-106,-1,-1,105,-76,-1,0,0,0,0,0,0,-116,-51,-51,92,92,-1,0,0,0,0,0,-62,-1,-126,75,0,-126,-1,0,0,0,0,0,42,15,-1,-1,-1,-16,-1,0,0,0,0,0,38,106,-16,-16,-26,-116,-1,0,0,0,0,0,-86,20,-6,-26,-26,-6,-1,0,0,0,0,0,-16,15,-1,-1,-16,-11,-1,0,0,0,0,0,64,-1,-4,124,-4,0,-1,0,0,0,0,0,38,49,-1,-1,-6,-51,-1,0,0,0,0,0,-119,63,-26,-83,-40,-26,-1,0,0,0,0,0,0,119,-16,-16,-128,-128,-1,0,0,0,0,0,127,31,-1,-32,-1,-1,-1,0,0,0,0,0,42,40,-6,-6,-6,-46,-1,0,0,0,0,0,0,0,-45,-45,-45,-45,-1,0,0,0,0,0,85,100,-18,-112,-18,-112,-1,0,0,0,0,0,0,0,-45,-45,-45,-45,-1,0,0,0,0,0,-8,73,-1,-1,-74,-63,-1,0,0,0,0,0,12,-124,-1,-1,-96,122,-1,0,0,0,0,0,125,-47,-78,32,-78,-86,-1,0,0,0,0,0,-113,117,-6,-121,-50,-6,-1,0,0,0,0,0,-108,56,-103,119,-120,-103,-1,0,0,0,0,0,-108,56,-103,119,-120,-103,-1,0,0,0,0,0,-105,52,-34,-80,-60,-34,-1,0,0,0,0,0,42,31,-1,-1,-1,-32,-1,0,0,0,0,0,85,-1,-1,0,-1,0,-1,0,0,0,0,0,85,-64,-51,50,-51,50,-1,0,0,0,0,0,21,20,-6,-6,-16,-26,-1,0,0,0,0,0,-44,-1,-1,-1,0,-1,-1,0,0,0,0,0,0,-1,-128,-128,0,0,-1,0,0,0,0,0,113,-128,-51,102,-51,-86,-1,0,0,0,0,0,-86,-1,-51,0,0,-51,-1,0,0,0,0,0,-52,-104,-45,-70,85,-45,-1,0,0,0,0,0,-73,124,-37,-109,112,-37,-1,0,0,0,0,0,103,-87,-77,60,-77,113,-1,0,0,0,0,0,-80,-113,-18,123,104,-18,-1,0,0,0,0,0,111,-1,-6,0,-6,-102,-1,0,0,0,0,0,125,-89,-47,72,-47,-52,-1,0,0,0,0,0,-28,-28,-57,-57,21,-123,-1,0,0,0,0,0,-86,-58,112,25,25,112,-1,0,0,0,0,0,106,9,-1,-11,-1,-6,-1,0,0,0,0,0,4,30,-1,-1,-28,-31,-1,0,0,0,0,0,26,73,-1,-1,-28,-75,-1,0,0,0,0,0,25,81,-1,-1,-34,-83,-1,0,0,0,0,0,-86,-1,-128,0,0,-128,-1,0,0,0,0,0,27,23,-3,-3,-11,-26,-1,0,0,0,0,0,42,-1,-128,-128,-128,0,-1,0,0,0,0,0,56,-64,-114,107,-114,35,-1,0,0,0,0,0,27,-1,-1,-1,-91,0,-1,0,0,0,0,0,11,-1,-1,-1,69,0,-1,0,0,0,0,0,-42,123,-38,-38,112,-42,-1,0,0,0,0,0,38,72,-18,-18,-24,-86,-1,0,0,0,0,0,85,100,-5,-104,-5,-104,-1,0,0,0,0,0,127,67,-18,-81,-18,-18,-1,0,0,0,0,0,-15,124,-37,-37,112,-109,-1,0,0,0,0,0,26,41,-1,-1,-17,-43,-1,0,0,0,0,0,20,70,-1,-1,-38,-71,-1,0,0,0,0,0,20,-80,-51,-51,-123,63,-1,0,0,0,0,0,-9,63,-1,-1,-64,-53,-1,0,0,0,0,0,-44,70,-35,-35,-96,-35,-1,0,0,0,0,0,-124,59,-26,-80,-32,-26,-1,0,0,0,0,0,-44,-1,-128,-128,0,-128,-1,0,0,0,0,0,0,-1,-1,-1,0,0,-1,0,0,0,0,0,0,61,-68,-68,-113,-113,-1,0,0,0,0,0,-97,-75,-31,65,105,-31,-1,0,0,0,0,0,17,-36,-117,-117,69,19,-1,0,0,0,0,0,4,-118,-6,-6,-128,114,-1,0,0,0,0,0,19,-102,-12,-12,-92,96,-1,0,0,0,0,0,103,-86,-117,46,-117,87,-1,0,0,0,0,0,17,16,-1,-1,-11,-18,-1,0,0,0,0,0,13,-73,-96,-96,82,45,-1,0,0,0,0,0,0,0,-64,-64,-64,-64,-1,0,0,0,0,0,-117,108,-21,-121,-50,-21,-1,0,0,0,0,0,-81,-113,-51,106,90,-51,-1,0,0,0,0,0,-108,56,-112,112,-128,-112,-1,0,0,0,0,0,-108,56,-112,112,-128,-112,-1,0,0,0,0,0,0,5,-1,-1,-6,-6,-1,0,0,0,0,0,106,-1,-1,0,-1,127,-1,0,0,0,0,0,-110,-101,-76,70,-126,-76,-1,0,0,0,0,0,24,84,-46,-46,-76,-116,-1,0,0,0,0,0,127,-1,-128,0,-128,-128,-1,0,0,0,0,0,-44,29,-40,-40,-65,-40,-1,0,0,0,0,0,6,-72,-1,-1,99,71,-1,0,0,0,0,0,123,-74,-32,64,-32,-48,-1,0,0,0,0,0,-44,115,-18,-18,-126,-18,-1,0,0,0,0,0,27,68,-11,-11,-34,-77,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-11,-11,-11,-11,-1,0,0,0,0,0,42,-1,-1,-1,-1,0,-1,0,0,0,0,0,56,-64,-51,-102,-51,50,-1,0,0,0,0,0,45,67,-4,-9,-4,-71,-1,0,0,0,0,0,68,91,-35,-83,-35,-114,-1,0,0,0,0,0,98,-78,-93,49,-93,84,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,62,85,-26,-62,-26,-103,-1,0,0,0,0,0,85,100,-58,120,-58,121,-1,0,0,0,0,0,99,-69,-124,35,-124,67,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,62,85,-26,-62,-26,-103,-1,0,0,0,0,0,85,100,-58,120,-58,121,-1,0,0,0,0,0,98,-78,-93,49,-93,84,-1,0,0,0,0,0,107,-1,104,0,104,55,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,55,81,-16,-39,-16,-93,-1,0,0,0,0,0,68,91,-35,-83,-35,-114,-1,0,0,0,0,0,85,100,-58,120,-58,121,-1,0,0,0,0,0,98,-78,-93,49,-93,84,-1,0,0,0,0,0,107,-1,104,0,104,55,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,55,81,-16,-39,-16,-93,-1,0,0,0,0,0,68,91,-35,-83,-35,-114,-1,0,0,0,0,0,85,100,-58,120,-58,121,-1,0,0,0,0,0,96,-98,-85,65,-85,93,-1,0,0,0,0,0,99,-69,-124,35,-124,67,-1,0,0,0,0,0,108,-1,90,0,90,50,-1,0,0,0,0,0,42,25,-1,-1,-1,-27,-1,0,0,0,0,0,45,67,-4,-9,-4,-71,-1,0,0,0,0,0,55,81,-16,-39,-16,-93,-1,0,0,0,0,0,68,91,-35,-83,-35,-114,-1,0,0,0,0,0,85,100,-58,120,-58,121,-1,0,0,0,0,0,96,-98,-85,65,-85,93,-1,0,0,0,0,0,99,-69,-124,35,-124,67,-1,0,0,0,0,0,108,-1,90,0,90,50,-1,0,0,0,0,0,42,25,-1,-1,-1,-27,-1,0,0,0,0,0,45,67,-4,-9,-4,-71,-1,0,0,0,0,0,55,81,-16,-39,-16,-93,-1,0,0,0,0,0,68,91,-35,-83,-35,-114,-1,0,0,0,0,0,85,100,-58,120,-58,121,-1,0,0,0,0,0,96,-98,-85,65,-85,93,-1,0,0,0,0,0,99,-69,-124,35,-124,67,-1,0,0,0,0,0,107,-1,104,0,104,55,-1,0,0,0,0,0,110,-1,69,0,69,41,-1,0,0,0,0,0,49,73,-8,-19,-8,-79,-1,0,0,0,0,0,117,97,-51,127,-51,-69,-1,0,0,0,0,0,-112,-62,-72,44,127,-72,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,99,66,-38,-95,-38,-76,-1,0,0,0,0,0,-124,-86,-60,65,-74,-60,-1,0,0,0,0,0,-106,-53,-88,34,94,-88,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,99,66,-38,-95,-38,-76,-1,0,0,0,0,0,-124,-86,-60,65,-74,-60,-1,0,0,0,0,0,-112,-62,-72,44,127,-72,-1,0,0,0,0,0,-92,-65,-108,37,52,-108,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,69,58,-23,-57,-23,-76,-1,0,0,0,0,0,117,97,-51,127,-51,-69,-1,0,0,0,0,0,-124,-86,-60,65,-74,-60,-1,0,0,0,0,0,-112,-62,-72,44,127,-72,-1,0,0,0,0,0,-92,-65,-108,37,52,-108,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,69,58,-23,-57,-23,-76,-1,0,0,0,0,0,117,97,-51,127,-51,-69,-1,0,0,0,0,0,-124,-86,-60,65,-74,-60,-1,0,0,0,0,0,-117,-40,-64,29,-111,-64,-1,0,0,0,0,0,-106,-53,-88,34,94,-88,-1,0,0,0,0,0,-98,-25,-124,12,44,-124,-1,0,0,0,0,0,42,38,-1,-1,-1,-39,-1,0,0,0,0,0,49,73,-8,-19,-8,-79,-1,0,0,0,0,0,69,58,-23,-57,-23,-76,-1,0,0,0,0,0,117,97,-51,127,-51,-69,-1,0,0,0,0,0,-124,-86,-60,65,-74,-60,-1,0,0,0,0,0,-117,-40,-64,29,-111,-64,-1,0,0,0,0,0,-106,-53,-88,34,94,-88,-1,0,0,0,0,0,-98,-25,-124,12,44,-124,-1,0,0,0,0,0,42,38,-1,-1,-1,-39,-1,0,0,0,0,0,49,73,-8,-19,-8,-79,-1,0,0,0,0,0,69,58,-23,-57,-23,-76,-1,0,0,0,0,0,117,97,-51,127,-51,-69,-1,0,0,0,0,0,-124,-86,-60,65,-74,-60,-1,0,0,0,0,0,-117,-40,-64,29,-111,-64,-1,0,0,0,0,0,-106,-53,-88,34,94,-88,-1,0,0,0,0,0,-92,-65,-108,37,52,-108,-1,0,0,0,0,0,-98,-25,88,8,29,88,-1,0,0,0,0,0,37,66,-1,-1,-9,-68,-1,0,0,0,0,0,28,-81,-2,-2,-60,79,-1,0,0,0,0,0,16,-18,-39,-39,95,14,-1,0,0,0,0,0,42,42,-1,-1,-1,-44,-1,0,0,0,0,0,28,112,-2,-2,-39,-114,-1,0,0,0,0,0,22,-43,-2,-2,-103,41,-1,0,0,0,0,0,15,-4,-52,-52,76,2,-1,0,0,0,0,0,42,42,-1,-1,-1,-44,-1,0,0,0,0,0,28,112,-2,-2,-39,-114,-1,0,0,0,0,0,22,-43,-2,-2,-103,41,-1,0,0,0,0,0,16,-18,-39,-39,95,14,-1,0,0,0,0,0,13,-8,-103,-103,52,4,-1,0,0,0,0,0,42,42,-1,-1,-1,-44,-1,0,0,0,0,0,31,109,-2,-2,-29,-111,-1,0,0,0,0,0,28,-81,-2,-2,-60,79,-1,0,0,0,0,0,22,-43,-2,-2,-103,41,-1,0,0,0,0,0,16,-18,-39,-39,95,14,-1,0,0,0,0,0,13,-8,-103,-103,52,4,-1,0,0,0,0,0,42,42,-1,-1,-1,-44,-1,0,0,0,0,0,31,109,-2,-2,-29,-111,-1,0,0,0,0,0,28,-81,-2,-2,-60,79,-1,0,0,0,0,0,22,-43,-2,-2,-103,41,-1,0,0,0,0,0,18,-23,-20,-20,112,20,-1,0,0,0,0,0,15,-4,-52,-52,76,2,-1,0,0,0,0,0,12,-9,-116,-116,45,4,-1,0,0,0,0,0,42,25,-1,-1,-1,-27,-1,0,0,0,0,0,37,66,-1,-1,-9,-68,-1,0,0,0,0,0,31,109,-2,-2,-29,-111,-1,0,0,0,0,0,28,-81,-2,-2,-60,79,-1,0,0,0,0,0,22,-43,-2,-2,-103,41,-1,0,0,0,0,0,18,-23,-20,-20,112,20,-1,0,0,0,0,0,15,-4,-52,-52,76,2,-1,0,0,0,0,0,12,-9,-116,-116,45,4,-1,0,0,0,0,0,42,25,-1,-1,-1,-27,-1,0,0,0,0,0,37,66,-1,-1,-9,-68,-1,0,0,0,0,0,31,109,-2,-2,-29,-111,-1,0,0,0,0,0,28,-81,-2,-2,-60,79,-1,0,0,0,0,0,22,-43,-2,-2,-103,41,-1,0,0,0,0,0,18,-23,-20,-20,112,20,-1,0,0,0,0,0,15,-4,-52,-52,76,2,-1,0,0,0,0,0,13,-8,-103,-103,52,4,-1,0,0,0,0,0,13,-16,102,102,37,6,-1,0,0,0,0,0,34,95,-1,-1,-19,-96,-1,0,0,0,0,0,24,-78,-2,-2,-78,76,-1,0,0,0,0,0,5,-35,-16,-16,59,32,-1,0,0,0,0,0,42,77,-1,-1,-1,-78,-1,0,0,0,0,0,29,-94,-2,-2,-52,92,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,42,77,-1,-1,-1,-78,-1,0,0,0,0,0,29,-94,-2,-2,-52,92,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,5,-35,-16,-16,59,32,-1,0,0,0,0,0,-10,-1,-67,-67,0,38,-1,0,0,0,0,0,42,77,-1,-1,-1,-78,-1,0,0,0,0,0,30,-120,-2,-2,-39,118,-1,0,0,0,0,0,24,-78,-2,-2,-78,76,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,5,-35,-16,-16,59,32,-1,0,0,0,0,0,-10,-1,-67,-67,0,38,-1,0,0,0,0,0,42,77,-1,-1,-1,-78,-1,0,0,0,0,0,30,-120,-2,-2,-39,118,-1,0,0,0,0,0,24,-78,-2,-2,-78,76,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,7,-44,-4,-4,78,42,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,-11,-1,-79,-79,0,38,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,34,95,-1,-1,-19,-96,-1,0,0,0,0,0,30,-120,-2,-2,-39,118,-1,0,0,0,0,0,24,-78,-2,-2,-78,76,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,7,-44,-4,-4,78,42,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,-11,-1,-79,-79,0,38,-1,0,0,0,0,0,42,50,-1,-1,-1,-52,-1,0,0,0,0,0,34,95,-1,-1,-19,-96,-1,0,0,0,0,0,30,-120,-2,-2,-39,118,-1,0,0,0,0,0,24,-78,-2,-2,-78,76,-1,0,0,0,0,0,17,-62,-3,-3,-115,60,-1,0,0,0,0,0,7,-44,-4,-4,78,42,-1,0,0,0,0,0,-2,-31,-29,-29,26,28,-1,0,0,0,0,0,-10,-1,-67,-67,0,38,-1,0,0,0,0,0,-14,-1,-128,-128,0,38,-1,0,0,0,0,0,-109,15,-1,-16,-8,-1,-1,0,0,0,0,0,24,35,-6,-6,-21,-41,-1,0,0,0,0,0,23,36,-1,-1,-17,-37,-1,0,0,0,0,0,23,36,-18,-18,-33,-52,-1,0,0,0,0,0,23,36,-51,-51,-64,-80,-1,0,0,0,0,0,24,34,-117,-117,-125,120,-1,0,0,0,0,0,113,-128,-1,127,-1,-44,-1,0,0,0,0,0,113,-128,-1,127,-1,-44,-1,0,0,0,0,0,113,-128,-18,118,-18,-58,-1,0,0,0,0,0,113,-128,-51,102,-51,-86,-1,0,0,0,0,0,113,-128,-117,69,-117,116,-1,0,0,0,0,0,127,15,-1,-16,-1,-1,-1,0,0,0,0,0,127,15,-1,-16,-1,-1,-1,0,0,0,0,0,127,15,-18,-32,-18,-18,-1,0,0,0,0,0,127,14,-51,-63,-51,-51,-1,0,0,0,0,0,127,14,-117,-125,-117,-117,-1,0,0,0,0,0,42,26,-11,-11,-11,-36,-1,0,0,0,0,0,23,58,-1,-1,-28,-60,-1,0,0,0,0,0,23,58,-1,-1,-28,-60,-1,0,0,0,0,0,23,58,-18,-18,-43,-73,-1,0,0,0,0,0,22,58,-51,-51,-73,-98,-1,0,0,0,0,0,23,58,-117,-117,125,107,-1,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,25,49,-1,-1,-21,-51,-1,0,0,0,0,0,-86,-1,-1,0,0,-1,-1,0,0,0,0,0,-86,-1,-1,0,0,-1,-1,0,0,0,0,0,-86,-1,-18,0,0,-18,-1,0,0,0,0,0,-86,-1,-51,0,0,-51,-1,0,0,0,0,0,-86,-1,-117,0,0,-117,-1,0,0,0,0,0,-64,-50,-30,-118,43,-30,-1,0,0,0,0,0,0,-66,-91,-91,42,42,-1,0,0,0,0,0,0,-65,-1,-1,64,64,-1,0,0,0,0,0,0,-65,-18,-18,59,59,-1,0,0,0,0,0,0,-65,-51,-51,51,51,-1,0,0,0,0,0,0,-66,-117,-117,35,35,-1,0,0,0,0,0,23,99,-34,-34,-72,-121,-1,0,0,0,0,0,23,100,-1,-1,-45,-101,-1,0,0,0,0,0,23,99,-18,-18,-59,-111,-1,0,0,0,0,0,23,99,-51,-51,-86,125,-1,0,0,0,0,0,23,99,-117,-117,115,85,-1,0,0,0,0,0,-128,103,-96,95,-98,-96,-1,0,0,0,0,0,-125,103,-1,-104,-11,-1,-1,0,0,0,0,0,-125,102,-18,-114,-27,-18,-1,0,0,0,0,0,-125,103,-51,122,-59,-51,-1,0,0,0,0,0,-125,102,-117,83,-122,-117,-1,0,0,0,0,0,63,-1,-1,127,-1,0,-1,0,0,0,0,0,63,-1,-1,127,-1,0,-1,0,0,0,0,0,63,-1,-18,118,-18,0,-1,0,0,0,0,0,63,-1,-51,102,-51,0,-1,0,0,0,0,0,63,-1,-117,69,-117,0,-1,0,0,0,0,0,17,-38,-46,-46,105,30,-1,0,0,0,0,0,17,-37,-1,-1,127,36,-1,0,0,0,0,0,17,-37,-18,-18,118,33,-1,0,0,0,0,0,17,-38,-51,-51,102,29,-1,0,0,0,0,0,17,-36,-117,-117,69,19,-1,0,0,0,0,0,11,-81,-1,-1,127,80,-1,0,0,0,0,0,7,-87,-1,-1,114,86,-1,0,0,0,0,0,6,-87,-18,-18,106,80,-1,0,0,0,0,0,6,-87,-51,-51,91,69,-1,0,0,0,0,0,6,-88,-117,-117,62,47,-1,0,0,0,0,0,-102,-109,-19,100,-107,-19,-1,0,0,0,0,0,33,34,-1,-1,-8,-36,-1,0,0,0,0,0,33,34,-1,-1,-8,-36,-1,0,0,0,0,0,34,35,-18,-18,-24,-51,-1,0,0,0,0,0,34,34,-51,-51,-56,-79,-1,0,0,0,0,0,35,34,-117,-117,-120,120,-1,0,0,0,0,0,-10,-25,-36,-36,20,60,-1,0,0,0,0,0,127,-1,-1,0,-1,-1,-1,0,0,0,0,0,127,-1,-1,0,-1,-1,-1,0,0,0,0,0,127,-1,-18,0,-18,-18,-1,0,0,0,0,0,127,-1,-51,0,-51,-51,-1,0,0,0,0,0,127,-1,-117,0,-117,-117,-1,0,0,0,0,0,30,-17,-72,-72,-122,11,-1,0,0,0,0,0,30,-16,-1,-1,-71,15,-1,0,0,0,0,0,30,-16,-18,-18,-83,14,-1,0,0,0,0,0,30,-16,-51,-51,-107,12,-1,0,0,0,0,0,30,-16,-117,-117,101,8,-1,0,0,0,0,0,85,-1,100,0,100,0,-1,0,0,0,0,0,39,110,-67,-67,-73,107,-1,0,0,0,0,0,58,-114,107,85,107,47,-1,0,0,0,0,0,58,-113,-1,-54,-1,112,-1,0,0,0,0,0,58,-113,-18,-68,-18,104,-1,0,0,0,0,0,58,-113,-51,-94,-51,90,-1,0,0,0,0,0,58,-113,-117,110,-117,61,-1,0,0,0,0,0,23,-1,-1,-1,-116,0,-1,0,0,0,0,0,21,-1,-1,-1,127,0,-1,0,0,0,0,0,21,-1,-18,-18,118,0,-1,0,0,0,0,0,21,-1,-51,-51,102,0,-1,0,0,0,0,0,21,-1,-117,-117,69,0,-1,0,0,0,0,0,-58,-64,-52,-103,50,-52,-1,0,0,0,0,0,-58,-63,-1,-65,62,-1,-1,0,0,0,0,0,-58,-64,-18,-78,58,-18,-1,0,0,0,0,0,-58,-64,-51,-102,50,-51,-1,0,0,0,0,0,-58,-64,-117,104,34,-117,-1,0,0,0,0,0,10,121,-23,-23,-106,122,-1,0,0,0,0,0,85,61,-68,-113,-68,-113,-1,0,0,0,0,0,85,62,-1,-63,-1,-63,-1,0,0,0,0,0,85,62,-18,-76,-18,-76,-1,0,0,0,0,0,85,62,-51,-101,-51,-101,-1,0,0,0,0,0,85,62,-117,105,-117,105,-1,0,0,0,0,0,-81,-113,-117,72,61,-117,-1,0,0,0,0,0,127,103,79,47,79,79,-1,0,0,0,0,0,127,104,-1,-105,-1,-1,-1,0,0,0,0,0,127,103,-18,-115,-18,-18,-1,0,0,0,0,0,127,104,-51,121,-51,-51,-1,0,0,0,0,0,127,104,-117,82,-117,-117,-1,0,0,0,0,0,127,103,79,47,79,79,-1,0,0,0,0,0,-128,-1,-47,0,-50,-47,-1,0,0,0,0,0,-57,-1,-45,-108,0,-45,-1,0,0,0,0,0,-24,-21,-1,-1,20,-109,-1,0,0,0,0,0,-24,-21,-1,-1,20,-109,-1,0,0,0,0,0,-24,-21,-18,-18,18,-119,-1,0,0,0,0,0,-24,-21,-51,-51,16,118,-1,0,0,0,0,0,-25,-20,-117,-117,10,80,-1,0,0,0,0,0,-118,-1,-1,0,-65,-1,-1,0,0,0,0,0,-118,-1,-1,0,-65,-1,-1,0,0,0,0,0,-118,-1,-18,0,-78,-18,-1,0,0,0,0,0,-118,-1,-51,0,-102,-51,-1,0,0,0,0,0,-118,-1,-117,0,104,-117,-1,0,0,0,0,0,0,0,105,105,105,105,-1,0,0,0,0,0,0,0,105,105,105,105,-1,0,0,0,0,0,-108,-31,-1,30,-112,-1,-1,0,0,0,0,0,-108,-31,-1,30,-112,-1,-1,0,0,0,0,0,-108,-31,-18,28,-122,-18,-1,0,0,0,0,0,-108,-31,-51,24,116,-51,-1,0,0,0,0,0,-108,-31,-117,16,78,-117,-1,0,0,0,0,0,0,-50,-78,-78,34,34,-1,0,0,0,0,0,0,-49,-1,-1,48,48,-1,0,0,0,0,0,0,-49,-18,-18,44,44,-1,0,0,0,0,0,0,-49,-51,-51,38,38,-1,0,0,0,0,0,0,-49,-117,-117,26,26,-1,0,0,0,0,0,28,15,-1,-1,-6,-16,-1,0,0,0,0,0,85,-64,-117,34,-117,34,-1,0,0,0,0,0,0,0,-36,-36,-36,-36,-1,0,0,0,0,0,-86,7,-1,-8,-8,-1,-1,0,0,0,0,0,35,-1,-1,-1,-41,0,-1,0,0,0,0,0,35,-1,-1,-1,-41,0,-1,0,0,0,0,0,35,-1,-18,-18,-55,0,-1,0,0,0,0,0,35,-1,-51,-51,-83,0,-1,0,0,0,0,0,35,-1,-117,-117,117,0,-1,0,0,0,0,0,30,-39,-38,-38,-91,32,-1,0,0,0,0,0,30,-38,-1,-1,-63,37,-1,0,0,0,0,0,30,-38,-18,-18,-76,34,-1,0,0,0,0,0,30,-38,-51,-51,-101,29,-1,0,0,0,0,0,30,-38,-117,-117,105,20,-1,0,0,0,0,0,0,0,-64,-64,-64,-64,-1,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,3,3,3,3,-1,0,0,0,0,0,0,0,26,26,26,26,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,28,28,28,28,-1,0,0,0,0,0,0,0,31,31,31,31,-1,0,0,0,0,0,0,0,33,33,33,33,-1,0,0,0,0,0,0,0,36,36,36,36,-1,0,0,0,0,0,0,0,38,38,38,38,-1,0,0,0,0,0,0,0,41,41,41,41,-1,0,0,0,0,0,0,0,43,43,43,43,-1,0,0,0,0,0,0,0,46,46,46,46,-1,0,0,0,0,0,0,0,48,48,48,48,-1,0,0,0,0,0,0,0,5,5,5,5,-1,0,0,0,0,0,0,0,51,51,51,51,-1,0,0,0,0,0,0,0,54,54,54,54,-1,0,0,0,0,0,0,0,56,56,56,56,-1,0,0,0,0,0,0,0,59,59,59,59,-1,0,0,0,0,0,0,0,61,61,61,61,-1,0,0,0,0,0,0,0,64,64,64,64,-1,0,0,0,0,0,0,0,66,66,66,66,-1,0,0,0,0,0,0,0,69,69,69,69,-1,0,0,0,0,0,0,0,71,71,71,71,-1,0,0,0,0,0,0,0,74,74,74,74,-1,0,0,0,0,0,0,0,8,8,8,8,-1,0,0,0,0,0,0,0,77,77,77,77,-1,0,0,0,0,0,0,0,79,79,79,79,-1,0,0,0,0,0,0,0,82,82,82,82,-1,0,0,0,0,0,0,0,84,84,84,84,-1,0,0,0,0,0,0,0,87,87,87,87,-1,0,0,0,0,0,0,0,89,89,89,89,-1,0,0,0,0,0,0,0,92,92,92,92,-1,0,0,0,0,0,0,0,94,94,94,94,-1,0,0,0,0,0,0,0,97,97,97,97,-1,0,0,0,0,0,0,0,99,99,99,99,-1,0,0,0,0,0,0,0,10,10,10,10,-1,0,0,0,0,0,0,0,102,102,102,102,-1,0,0,0,0,0,0,0,105,105,105,105,-1,0,0,0,0,0,0,0,107,107,107,107,-1,0,0,0,0,0,0,0,110,110,110,110,-1,0,0,0,0,0,0,0,112,112,112,112,-1,0,0,0,0,0,0,0,115,115,115,115,-1,0,0,0,0,0,0,0,117,117,117,117,-1,0,0,0,0,0,0,0,120,120,120,120,-1,0,0,0,0,0,0,0,122,122,122,122,-1,0,0,0,0,0,0,0,125,125,125,125,-1,0,0,0,0,0,0,0,13,13,13,13,-1,0,0,0,0,0,0,0,127,127,127,127,-1,0,0,0,0,0,0,0,-126,-126,-126,-126,-1,0,0,0,0,0,0,0,-123,-123,-123,-123,-1,0,0,0,0,0,0,0,-121,-121,-121,-121,-1,0,0,0,0,0,0,0,-118,-118,-118,-118,-1,0,0,0,0,0,0,0,-116,-116,-116,-116,-1,0,0,0,0,0,0,0,-113,-113,-113,-113,-1,0,0,0,0,0,0,0,-111,-111,-111,-111,-1,0,0,0,0,0,0,0,-108,-108,-108,-108,-1,0,0,0,0,0,0,0,-106,-106,-106,-106,-1,0,0,0,0,0,0,0,15,15,15,15,-1,0,0,0,0,0,0,0,-103,-103,-103,-103,-1,0,0,0,0,0,0,0,-100,-100,-100,-100,-1,0,0,0,0,0,0,0,-98,-98,-98,-98,-1,0,0,0,0,0,0,0,-95,-95,-95,-95,-1,0,0,0,0,0,0,0,-93,-93,-93,-93,-1,0,0,0,0,0,0,0,-90,-90,-90,-90,-1,0,0,0,0,0,0,0,-88,-88,-88,-88,-1,0,0,0,0,0,0,0,-85,-85,-85,-85,-1,0,0,0,0,0,0,0,-83,-83,-83,-83,-1,0,0,0,0,0,0,0,-80,-80,-80,-80,-1,0,0,0,0,0,0,0,18,18,18,18,-1,0,0,0,0,0,0,0,-77,-77,-77,-77,-1,0,0,0,0,0,0,0,-75,-75,-75,-75,-1,0,0,0,0,0,0,0,-72,-72,-72,-72,-1,0,0,0,0,0,0,0,-70,-70,-70,-70,-1,0,0,0,0,0,0,0,-67,-67,-67,-67,-1,0,0,0,0,0,0,0,-65,-65,-65,-65,-1,0,0,0,0,0,0,0,-62,-62,-62,-62,-1,0,0,0,0,0,0,0,-60,-60,-60,-60,-1,0,0,0,0,0,0,0,-57,-57,-57,-57,-1,0,0,0,0,0,0,0,-55,-55,-55,-55,-1,0,0,0,0,0,0,0,20,20,20,20,-1,0,0,0,0,0,0,0,-52,-52,-52,-52,-1,0,0,0,0,0,0,0,-49,-49,-49,-49,-1,0,0,0,0,0,0,0,-47,-47,-47,-47,-1,0,0,0,0,0,0,0,-44,-44,-44,-44,-1,0,0,0,0,0,0,0,-42,-42,-42,-42,-1,0,0,0,0,0,0,0,-39,-39,-39,-39,-1,0,0,0,0,0,0,0,-37,-37,-37,-37,-1,0,0,0,0,0,0,0,-34,-34,-34,-34,-1,0,0,0,0,0,0,0,-32,-32,-32,-32,-1,0,0,0,0,0,0,0,-29,-29,-29,-29,-1,0,0,0,0,0,0,0,23,23,23,23,-1,0,0,0,0,0,0,0,-27,-27,-27,-27,-1,0,0,0,0,0,0,0,-24,-24,-24,-24,-1,0,0,0,0,0,0,0,-21,-21,-21,-21,-1,0,0,0,0,0,0,0,-19,-19,-19,-19,-1,0,0,0,0,0,0,0,-16,-16,-16,-16,-1,0,0,0,0,0,0,0,-14,-14,-14,-14,-1,0,0,0,0,0,0,0,-11,-11,-11,-11,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,0,0,-6,-6,-6,-6,-1,0,0,0,0,0,0,0,-4,-4,-4,-4,-1,0,0,0,0,0,85,-1,-1,0,-1,0,-1,0,0,0,0,0,85,-1,-1,0,-1,0,-1,0,0,0,0,0,85,-1,-18,0,-18,0,-1,0,0,0,0,0,85,-1,-51,0,-51,0,-1,0,0,0,0,0,85,-1,-117,0,-117,0,-1,0,0,0,0,0,59,-48,-1,-83,-1,47,-1,0,0,0,0,0,0,0,-64,-64,-64,-64,-1,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,3,3,3,3,-1,0,0,0,0,0,0,0,26,26,26,26,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,28,28,28,28,-1,0,0,0,0,0,0,0,31,31,31,31,-1,0,0,0,0,0,0,0,33,33,33,33,-1,0,0,0,0,0,0,0,36,36,36,36,-1,0,0,0,0,0,0,0,38,38,38,38,-1,0,0,0,0,0,0,0,41,41,41,41,-1,0,0,0,0,0,0,0,43,43,43,43,-1,0,0,0,0,0,0,0,46,46,46,46,-1,0,0,0,0,0,0,0,48,48,48,48,-1,0,0,0,0,0,0,0,5,5,5,5,-1,0,0,0,0,0,0,0,51,51,51,51,-1,0,0,0,0,0,0,0,54,54,54,54,-1,0,0,0,0,0,0,0,56,56,56,56,-1,0,0,0,0,0,0,0,59,59,59,59,-1,0,0,0,0,0,0,0,61,61,61,61,-1,0,0,0,0,0,0,0,64,64,64,64,-1,0,0,0,0,0,0,0,66,66,66,66,-1,0,0,0,0,0,0,0,69,69,69,69,-1,0,0,0,0,0,0,0,71,71,71,71,-1,0,0,0,0,0,0,0,74,74,74,74,-1,0,0,0,0,0,0,0,8,8,8,8,-1,0,0,0,0,0,0,0,77,77,77,77,-1,0,0,0,0,0,0,0,79,79,79,79,-1,0,0,0,0,0,0,0,82,82,82,82,-1,0,0,0,0,0,0,0,84,84,84,84,-1,0,0,0,0,0,0,0,87,87,87,87,-1,0,0,0,0,0,0,0,89,89,89,89,-1,0,0,0,0,0,0,0,92,92,92,92,-1,0,0,0,0,0,0,0,94,94,94,94,-1,0,0,0,0,0,0,0,97,97,97,97,-1,0,0,0,0,0,0,0,99,99,99,99,-1,0,0,0,0,0,0,0,10,10,10,10,-1,0,0,0,0,0,0,0,102,102,102,102,-1,0,0,0,0,0,0,0,105,105,105,105,-1,0,0,0,0,0,0,0,107,107,107,107,-1,0,0,0,0,0,0,0,110,110,110,110,-1,0,0,0,0,0,0,0,112,112,112,112,-1,0,0,0,0,0,0,0,115,115,115,115,-1,0,0,0,0,0,0,0,117,117,117,117,-1,0,0,0,0,0,0,0,120,120,120,120,-1,0,0,0,0,0,0,0,122,122,122,122,-1,0,0,0,0,0,0,0,125,125,125,125,-1,0,0,0,0,0,0,0,13,13,13,13,-1,0,0,0,0,0,0,0,127,127,127,127,-1,0,0,0,0,0,0,0,-126,-126,-126,-126,-1,0,0,0,0,0,0,0,-123,-123,-123,-123,-1,0,0,0,0,0,0,0,-121,-121,-121,-121,-1,0,0,0,0,0,0,0,-118,-118,-118,-118,-1,0,0,0,0,0,0,0,-116,-116,-116,-116,-1,0,0,0,0,0,0,0,-113,-113,-113,-113,-1,0,0,0,0,0,0,0,-111,-111,-111,-111,-1,0,0,0,0,0,0,0,-108,-108,-108,-108,-1,0,0,0,0,0,0,0,-106,-106,-106,-106,-1,0,0,0,0,0,0,0,15,15,15,15,-1,0,0,0,0,0,0,0,-103,-103,-103,-103,-1,0,0,0,0,0,0,0,-100,-100,-100,-100,-1,0,0,0,0,0,0,0,-98,-98,-98,-98,-1,0,0,0,0,0,0,0,-95,-95,-95,-95,-1,0,0,0,0,0,0,0,-93,-93,-93,-93,-1,0,0,0,0,0,0,0,-90,-90,-90,-90,-1,0,0,0,0,0,0,0,-88,-88,-88,-88,-1,0,0,0,0,0,0,0,-85,-85,-85,-85,-1,0,0,0,0,0,0,0,-83,-83,-83,-83,-1,0,0,0,0,0,0,0,-80,-80,-80,-80,-1,0,0,0,0,0,0,0,18,18,18,18,-1,0,0,0,0,0,0,0,-77,-77,-77,-77,-1,0,0,0,0,0,0,0,-75,-75,-75,-75,-1,0,0,0,0,0,0,0,-72,-72,-72,-72,-1,0,0,0,0,0,0,0,-70,-70,-70,-70,-1,0,0,0,0,0,0,0,-67,-67,-67,-67,-1,0,0,0,0,0,0,0,-65,-65,-65,-65,-1,0,0,0,0,0,0,0,-62,-62,-62,-62,-1,0,0,0,0,0,0,0,-60,-60,-60,-60,-1,0,0,0,0,0,0,0,-57,-57,-57,-57,-1,0,0,0,0,0,0,0,-55,-55,-55,-55,-1,0,0,0,0,0,0,0,20,20,20,20,-1,0,0,0,0,0,0,0,-52,-52,-52,-52,-1,0,0,0,0,0,0,0,-49,-49,-49,-49,-1,0,0,0,0,0,0,0,-47,-47,-47,-47,-1,0,0,0,0,0,0,0,-44,-44,-44,-44,-1,0,0,0,0,0,0,0,-42,-42,-42,-42,-1,0,0,0,0,0,0,0,-39,-39,-39,-39,-1,0,0,0,0,0,0,0,-37,-37,-37,-37,-1,0,0,0,0,0,0,0,-34,-34,-34,-34,-1,0,0,0,0,0,0,0,-32,-32,-32,-32,-1,0,0,0,0,0,0,0,-29,-29,-29,-29,-1,0,0,0,0,0,0,0,23,23,23,23,-1,0,0,0,0,0,0,0,-27,-27,-27,-27,-1,0,0,0,0,0,0,0,-24,-24,-24,-24,-1,0,0,0,0,0,0,0,-21,-21,-21,-21,-1,0,0,0,0,0,0,0,-19,-19,-19,-19,-1,0,0,0,0,0,0,0,-16,-16,-16,-16,-1,0,0,0,0,0,0,0,-14,-14,-14,-14,-1,0,0,0,0,0,0,0,-11,-11,-11,-11,-1,0,0,0,0,0,0,0,-9,-9,-9,-9,-1,0,0,0,0,0,0,0,-6,-6,-6,-6,-1,0,0,0,0,0,0,0,-4,-4,-4,-4,-1,0,0,0,0,0,85,15,-1,-16,-1,-16,-1,0,0,0,0,0,85,15,-1,-16,-1,-16,-1,0,0,0,0,0,85,15,-18,-32,-18,-32,-1,0,0,0,0,0,85,14,-51,-63,-51,-63,-1,0,0,0,0,0,85,14,-117,-125,-117,-125,-1,0,0,0,0,0,-23,-106,-1,-1,105,-76,-1,0,0,0,0,0,-22,-111,-1,-1,110,-76,-1,0,0,0,0,0,-21,-115,-18,-18,106,-89,-1,0,0,0,0,0,-20,-121,-51,-51,96,-112,-1,0,0,0,0,0,-22,-108,-117,-117,58,98,-1,0,0,0,0,0,0,-116,-51,-51,92,92,-1,0,0,0,0,0,0,-108,-1,-1,106,106,-1,0,0,0,0,0,0,-108,-18,-18,99,99,-1,0,0,0,0,0,0,-107,-51,-51,85,85,-1,0,0,0,0,0,0,-108,-117,-117,58,58,-1,0,0,0,0,0,-62,-1,-126,75,0,-126,-1,0,0,0,0,0,42,0,-1,-1,-1,-2,0,0,0,0,0,0,42,15,-1,-1,-1,-16,-1,0,0,0,0,0,42,15,-1,-1,-1,-16,-1,0,0,0,0,0,42,15,-18,-18,-18,-32,-1,0,0,0,0,0,42,14,-51,-51,-51,-63,-1,0,0,0,0,0,42,14,-117,-117,-117,-125,-1,0,0,0,0,0,38,106,-16,-16,-26,-116,-1,0,0,0,0,0,39,112,-1,-1,-10,-113,-1,0,0,0,0,0,39,112,-18,-18,-26,-123,-1,0,0,0,0,0,39,111,-51,-51,-58,115,-1,0,0,0,0,0,39,111,-117,-117,-122,78,-1,0,0,0,0,0,-86,20,-6,-26,-26,-6,-1,0,0,0,0,0,-16,15,-1,-1,-16,-11,-1,0,0,0,0,0,-16,15,-1,-1,-16,-11,-1,0,0,0,0,0,-17,15,-18,-18,-32,-27,-1,0,0,0,0,0,-16,14,-51,-51,-63,-59,-1,0,0,0,0,0,-17,14,-117,-117,-125,-122,-1,0,0,0,0,0,64,-1,-4,124,-4,0,-1,0,0,0,0,0,38,49,-1,-1,-6,-51,-1,0,0,0,0,0,38,49,-1,-1,-6,-51,-1,0,0,0,0,0,37,50,-18,-18,-23,-65,-1,0,0,0,0,0,38,49,-51,-51,-55,-91,-1,0,0,0,0,0,39,49,-117,-117,-119,112,-1,0,0,0,0,0,-119,63,-26,-83,-40,-26,-1,0,0,0,0,0,-118,64,-1,-65,-17,-1,-1,0,0,0,0,0,-118,64,-18,-78,-33,-18,-1,0,0,0,0,0,-118,63,-51,-102,-64,-51,-1,0,0,0,0,0,-119,64,-117,104,-125,-117,-1,0,0,0,0,0,0,119,-16,-16,-128,-128,-1,0,0,0,0,0,127,31,-1,-32,-1,-1,-1,0,0,0,0,0,127,31,-1,-32,-1,-1,-1,0,0,0,0,0,127,31,-18,-47,-18,-18,-1,0,0,0,0,0,127,31,-51,-76,-51,-51,-1,0,0,0,0,0,127,31,-117,122,-117,-117,-1,0,0,0,0,0,35,115,-18,-18,-35,-126,-1,0,0,0,0,0,35,116,-1,-1,-20,-117,-1,0,0,0,0,0,35,115,-18,-18,-36,-126,-1,0,0,0,0,0,35,115,-51,-51,-66,112,-1,0,0,0,0,0,35,115,-117,-117,-127,76,-1,0,0,0,0,0,42,40,-6,-6,-6,-46,-1,0,0,0,0,0,0,0,-45,-45,-45,-45,-1,0,0,0,0,0,0,0,-45,-45,-45,-45,-1,0,0,0,0,0,-8,73,-1,-1,-74,-63,-1,0,0,0,0,0,-7,81,-1,-1,-82,-71,-1,0,0,0,0,0,-8,81,-18,-18,-94,-83,-1,0,0,0,0,0,-7,80,-51,-51,-116,-107,-1,0,0,0,0,0,-7,80,-117,-117,95,101,-1,0,0,0,0,0,12,-124,-1,-1,-96,122,-1,0,0,0,0,0,12,-124,-1,-1,-96,122,-1,0,0,0,0,0,11,-124,-18,-18,-107,114,-1,0,0,0,0,0,12,-123,-51,-51,-127,98,-1,0,0,0,0,0,12,-123,-117,-117,87,66,-1,0,0,0,0,0,125,-47,-78,32,-78,-86,-1,0,0,0,0,0,-113,117,-6,-121,-50,-6,-1,0,0,0,0,0,-113,79,-1,-80,-30,-1,-1,0,0,0,0,0,-113,79,-18,-92,-45,-18,-1,0,0,0,0,0,-114,79,-51,-115,-74,-51,-1,0,0,0,0,0,-113,78,-117,96,123,-117,-1,0,0,0,0,0,-81,-113,-1,-124,112,-1,-1,0,0,0,0,0,-108,56,-103,119,-120,-103,-1,0,0,0,0,0,-108,56,-103,119,-120,-103,-1,0,0,0,0,0,-105,52,-34,-80,-60,-34,-1,0,0,0,0,0,-105,53,-1,-54,-31,-1,-1,0,0,0,0,0,-105,53,-18,-68,-46,-18,-1,0,0,0,0,0,-105,53,-51,-94,-75,-51,-1,0,0,0,0,0,-106,53,-117,110,123,-117,-1,0,0,0,0,0,42,31,-1,-1,-1,-32,-1,0,0,0,0,0,42,31,-1,-1,-1,-32,-1,0,0,0,0,0,42,31,-18,-18,-18,-47,-1,0,0,0,0,0,42,31,-51,-51,-51,-76,-1,0,0,0,0,0,42,31,-117,-117,-117,122,-1,0,0,0,0,0,85,-64,-51,50,-51,50,-1,0,0,0,0,0,21,20,-6,-6,-16,-26,-1,0,0,0,0,0,-44,-1,-1,-1,0,-1,-1,0,0,0,0,0,-44,-1,-1,-1,0,-1,-1,0,0,0,0,0,-44,-1,-18,-18,0,-18,-1,0,0,0,0,0,-44,-1,-51,-51,0,-51,-1,0,0,0,0,0,-44,-1,-117,-117,0,-117,-1,0,0,0,0,0,-17,-71,-80,-80,48,96,-1,0,0,0,0,0,-28,-53,-1,-1,52,-77,-1,0,0,0,0,0,-28,-53,-18,-18,48,-89,-1,0,0,0,0,0,-28,-52,-51,-51,41,-112,-1,0,0,0,0,0,-28,-53,-117,-117,28,98,-1,0,0,0,0,0,113,-128,-51,102,-51,-86,-1,0,0,0,0,0,-86,-1,-51,0,0,-51,-1,0,0,0,0,0,-52,-104,-45,-70,85,-45,-1,0,0,0,0,0,-53,-103,-1,-32,102,-1,-1,0,0,0,0,0,-53,-103,-18,-47,95,-18,-1,0,0,0,0,0,-53,-103,-51,-76,82,-51,-1,0,0,0,0,0,-53,-102,-117,122,55,-117,-1,0,0,0,0,0,-73,124,-37,-109,112,-37,-1,0,0,0,0,0,-73,125,-1,-85,-126,-1,-1,0,0,0,0,0,-73,125,-18,-97,121,-18,-1,0,0,0,0,0,-73,125,-51,-119,104,-51,-1,0,0,0,0,0,-73,124,-117,93,71,-117,-1,0,0,0,0,0,103,-87,-77,60,-77,113,-1,0,0,0,0,0,-80,-113,-18,123,104,-18,-1,0,0,0,0,0,111,-1,-6,0,-6,-102,-1,0,0,0,0,0,125,-89,-47,72,-47,-52,-1,0,0,0,0,0,-28,-28,-57,-57,21,-123,-1,0,0,0,0,0,-86,-58,112,25,25,112,-1,0,0,0,0,0,106,9,-1,-11,-1,-6,-1,0,0,0,0,0,4,30,-1,-1,-28,-31,-1,0,0,0,0,0,4,30,-1,-1,-28,-31,-1,0,0,0,0,0,4,30,-18,-18,-43,-46,-1,0,0,0,0,0,3,29,-51,-51,-73,-75,-1,0,0,0,0,0,5,29,-117,-117,125,123,-1,0,0,0,0,0,26,73,-1,-1,-28,-75,-1,0,0,0,0,0,25,81,-1,-1,-34,-83,-1,0,0,0,0,0,25,81,-1,-1,-34,-83,-1,0,0,0,0,0,25,82,-18,-18,-49,-95,-1,0,0,0,0,0,25,82,-51,-51,-77,-117,-1,0,0,0,0,0,25,82,-117,-117,121,94,-1,0,0,0,0,0,-86,-1,-128,0,0,-128,-1,0,0,0,0,0,-86,-1,-128,0,0,-128,-1,0,0,0,0,0,42,0,-1,-1,-1,-2,0,0,0,0,0,0,27,23,-3,-3,-11,-26,-1,0,0,0,0,0,56,-64,-114,107,-114,35,-1,0,0,0,0,0,56,-63,-1,-64,-1,62,-1,0,0,0,0,0,56,-64,-18,-77,-18,58,-1,0,0,0,0,0,56,-64,-51,-102,-51,50,-1,0,0,0,0,0,56,-64,-117,105,-117,34,-1,0,0,0,0,0,27,-1,-1,-1,-91,0,-1,0,0,0,0,0,27,-1,-1,-1,-91,0,-1,0,0,0,0,0,27,-1,-18,-18,-102,0,-1,0,0,0,0,0,27,-1,-51,-51,-123,0,-1,0,0,0,0,0,27,-1,-117,-117,90,0,-1,0,0,0,0,0,11,-1,-1,-1,69,0,-1,0,0,0,0,0,11,-1,-1,-1,69,0,-1,0,0,0,0,0,11,-1,-18,-18,64,0,-1,0,0,0,0,0,11,-1,-51,-51,55,0,-1,0,0,0,0,0,11,-1,-117,-117,37,0,-1,0,0,0,0,0,-42,123,-38,-38,112,-42,-1,0,0,0,0,0,-42,124,-1,-1,-125,-6,-1,0,0,0,0,0,-42,124,-18,-18,122,-23,-1,0,0,0,0,0,-42,124,-51,-51,105,-55,-1,0,0,0,0,0,-43,124,-117,-117,71,-119,-1,0,0,0,0,0,38,72,-18,-18,-24,-86,-1,0,0,0,0,0,85,100,-5,-104,-5,-104,-1,0,0,0,0,0,85,101,-1,-102,-1,-102,-1,0,0,0,0,0,85,100,-18,-112,-18,-112,-1,0,0,0,0,0,85,100,-51,124,-51,124,-1,0,0,0,0,0,85,100,-117,84,-117,84,-1,0,0,0,0,0,127,67,-18,-81,-18,-18,-1,0,0,0,0,0,127,68,-1,-69,-1,-1,-1,0,0,0,0,0,127,68,-18,-82,-18,-18,-1,0,0,0,0,0,127,68,-51,-106,-51,-51,-1,0,0,0,0,0,127,67,-117,102,-117,-117,-1,0,0,0,0,0,-15,124,-37,-37,112,-109,-1,0,0,0,0,0,-15,125,-1,-1,-126,-85,-1,0,0,0,0,0,-15,125,-18,-18,121,-97,-1,0,0,0,0,0,-15,125,-51,-51,104,-119,-1,0,0,0,0,0,-15,124,-117,-117,71,93,-1,0,0,0,0,0,26,41,-1,-1,-17,-43,-1,0,0,0,0,0,20,70,-1,-1,-38,-71,-1,0,0,0,0,0,20,70,-1,-1,-38,-71,-1,0,0,0,0,0,19,69,-18,-18,-53,-83,-1,0,0,0,0,0,19,69,-51,-51,-81,-107,-1,0,0,0,0,0,20,69,-117,-117,119,101,-1,0,0,0,0,0,20,-80,-51,-51,-123,63,-1,0,0,0,0,0,-9,63,-1,-1,-64,-53,-1,0,0,0,0,0,-11,73,-1,-1,-75,-59,-1,0,0,0,0,0,-11,73,-18,-18,-87,-72,-1,0,0,0,0,0,-11,74,-51,-51,-111,-98,-1,0,0,0,0,0,-11,73,-117,-117,99,108,-1,0,0,0,0,0,-44,70,-35,-35,-96,-35,-1,0,0,0,0,0,-44,68,-1,-1,-69,-1,-1,0,0,0,0,0,-44,68,-18,-18,-82,-18,-1,0,0,0,0,0,-44,68,-51,-51,-106,-51,-1,0,0,0,0,0,-44,67,-117,-117,102,-117,-1,0,0,0,0,0,-124,59,-26,-80,-32,-26,-1,0,0,0,0,0,-60,-35,-16,-96,32,-16,-1,0,0,0,0,0,-65,-49,-1,-101,48,-1,-1,0,0,0,0,0,-64,-49,-18,-111,44,-18,-1,0,0,0,0,0,-64,-49,-51,125,38,-51,-1,0,0,0,0,0,-64,-49,-117,85,26,-117,-1,0,0,0,0,0,0,-1,-1,-1,0,0,-1,0,0,0,0,0,0,-1,-1,-1,0,0,-1,0,0,0,0,0,0,-1,-18,-18,0,0,-1,0,0,0,0,0,0,-1,-51,-51,0,0,-1,0,0,0,0,0,0,-1,-117,-117,0,0,-1,0,0,0,0,0,0,61,-68,-68,-113,-113,-1,0,0,0,0,0,0,62,-1,-1,-63,-63,-1,0,0,0,0,0,0,62,-18,-18,-76,-76,-1,0,0,0,0,0,0,62,-51,-51,-101,-101,-1,0,0,0,0,0,0,62,-117,-117,105,105,-1,0,0,0,0,0,-97,-75,-31,65,105,-31,-1,0,0,0,0,0,-97,-73,-1,72,118,-1,-1,0,0,0,0,0,-97,-73,-18,67,110,-18,-1,0,0,0,0,0,-97,-74,-51,58,95,-51,-1,0,0,0,0,0,-97,-73,-117,39,64,-117,-1,0,0,0,0,0,17,-36,-117,-117,69,19,-1,0,0,0,0,0,4,-118,-6,-6,-128,114,-1,0,0,0,0,0,9,-106,-1,-1,-116,105,-1,0,0,0,0,0,9,-106,-18,-18,-126,98,-1,0,0,0,0,0,9,-106,-51,-51,112,84,-1,0,0,0,0,0,9,-106,-117,-117,76,57,-1,0,0,0,0,0,19,-102,-12,-12,-92,96,-1,0,0,0,0,0,103,-86,-117,46,-117,87,-1,0,0,0,0,0,103,-85,-1,84,-1,-97,-1,0,0,0,0,0,103,-85,-18,78,-18,-108,-1,0,0,0,0,0,103,-85,-51,67,-51,-128,-1,0,0,0,0,0,103,-86,-117,46,-117,87,-1,0,0,0,0,0,17,16,-1,-1,-11,-18,-1,0,0,0,0,0,17,16,-1,-1,-11,-18,-1,0,0,0,0,0,18,17,-18,-18,-27,-34,-1,0,0,0,0,0,18,17,-51,-51,-59,-65,-1,0,0,0,0,0,18,16,-117,-117,-122,-126,-1,0,0,0,0,0,13,-73,-96,-96,82,45,-1,0,0,0,0,0,13,-72,-1,-1,-126,71,-1,0,0,0,0,0,13,-72,-18,-18,121,66,-1,0,0,0,0,0,13,-72,-51,-51,104,57,-1,0,0,0,0,0,13,-71,-117,-117,71,38,-1,0,0,0,0,0,-117,108,-21,-121,-50,-21,-1,0,0,0,0,0,-112,120,-1,-121,-50,-1,-1,0,0,0,0,0,-112,120,-18,126,-64,-18,-1,0,0,0,0,0,-112,120,-51,108,-90,-51,-1,0,0,0,0,0,-111,119,-117,74,112,-117,-1,0,0,0,0,0,-81,-113,-51,106,90,-51,-1,0,0,0,0,0,-81,-112,-1,-125,111,-1,-1,0,0,0,0,0,-81,-112,-18,122,103,-18,-1,0,0,0,0,0,-81,-112,-51,105,89,-51,-1,0,0,0,0,0,-81,-112,-117,71,60,-117,-1,0,0,0,0,0,-108,56,-112,112,-128,-112,-1,0,0,0,0,0,-107,56,-1,-58,-30,-1,-1,0,0,0,0,0,-107,56,-18,-71,-45,-18,-1,0,0,0,0,0,-108,57,-51,-97,-74,-51,-1,0,0,0,0,0,-107,56,-117,108,123,-117,-1,0,0,0,0,0,-108,56,-112,112,-128,-112,-1,0,0,0,0,0,0,5,-1,-1,-6,-6,-1,0,0,0,0,0,0,5,-1,-1,-6,-6,-1,0,0,0,0,0,0,5,-18,-18,-23,-23,-1,0,0,0,0,0,0,4,-51,-51,-55,-55,-1,0,0,0,0,0,0,3,-117,-117,-119,-119,-1,0,0,0,0,0,106,-1,-1,0,-1,127,-1,0,0,0,0,0,106,-1,-1,0,-1,127,-1,0,0,0,0,0,106,-1,-18,0,-18,118,-1,0,0,0,0,0,106,-1,-51,0,-51,102,-1,0,0,0,0,0,106,-1,-117,0,-117,69,-1,0,0,0,0,0,-110,-101,-76,70,-126,-76,-1,0,0,0,0,0,-110,-100,-1,99,-72,-1,-1,0,0,0,0,0,-110,-100,-18,92,-84,-18,-1,0,0,0,0,0,-110,-100,-51,79,-108,-51,-1,0,0,0,0,0,-109,-101,-117,54,100,-117,-1,0,0,0,0,0,24,84,-46,-46,-76,-116,-1,0,0,0,0,0,20,-80,-1,-1,-91,79,-1,0,0,0,0,0,20,-80,-18,-18,-102,73,-1,0,0,0,0,0,20,-80,-51,-51,-123,63,-1,0,0,0,0,0,20,-80,-117,-117,90,43,-1,0,0,0,0,0,-44,29,-40,-40,-65,-40,-1,0,0,0,0,0,-44,30,-1,-1,-31,-1,-1,0,0,0,0,0,-44,30,-18,-18,-46,-18,-1,0,0,0,0,0,-44,29,-51,-51,-75,-51,-1,0,0,0,0,0,-44,29,-117,-117,123,-117,-1,0,0,0,0,0,6,-72,-1,-1,99,71,-1,0,0,0,0,0,6,-72,-1,-1,99,71,-1,0,0,0,0,0,6,-72,-18,-18,92,66,-1,0,0,0,0,0,6,-72,-51,-51,79,57,-1,0,0,0,0,0,6,-71,-117,-117,54,38,-1,0,0,0,0,0,42,0,-1,-1,-1,-2,0,0,0,0,0,0,123,-74,-32,64,-32,-48,-1,0,0,0,0,0,-127,-1,-1,0,-11,-1,-1,0,0,0,0,0,-127,-1,-18,0,-27,-18,-1,0,0,0,0,0,-127,-1,-51,0,-59,-51,-1,0,0,0,0,0,-127,-1,-117,0,-122,-117,-1,0,0,0,0,0,-44,115,-18,-18,-126,-18,-1,0,0,0,0,0,-29,-41,-48,-48,32,-112,-1,0,0,0,0,0,-21,-63,-1,-1,62,-106,-1,0,0,0,0,0,-21,-64,-18,-18,58,-116,-1,0,0,0,0,0,-21,-64,-51,-51,50,120,-1,0,0,0,0,0,-21,-64,-117,-117,34,82,-1,0,0,0,0,0,27,68,-11,-11,-34,-77,-1,0,0,0,0,0,27,69,-1,-1,-25,-70,-1,0,0,0,0,0,27,68,-18,-18,-40,-82,-1,0,0,0,0,0,27,68,-51,-51,-70,-106,-1,0,0,0,0,0,27,67,-117,-117,126,102,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-11,-11,-11,-11,-1,0,0,0,0,0,42,-1,-1,-1,-1,0,-1,0,0,0,0,0,42,-1,-1,-1,-1,0,-1,0,0,0,0,0,42,-1,-18,-18,-18,0,-1,0,0,0,0,0,42,-1,-51,-51,-51,0,-1,0,0,0,0,0,42,-1,-117,-117,-117,0,-1,0,0,0,0,0,56,-64,-51,-102,-51,50,-1,0],["*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8","*",0,0,0,"i8","i8","i8","i8","i8","i8","i8","i8"],c);yq=d(10,"i8",c);d(4,"i8",c);d([8,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);zl=d(4,"i8",c);Hu=d(4,"i8",c);Z=d(32e3,"i8",c);sv=d(4,"i8",c);ig=d(4,"i8",c);tx=d(4,"i8",c);sx=d(4,"i8",c);rx=d(4,"i8",c);qx=d(4,"i8",c);px=d(4,"i8",c);ox=d(4,"i8",c);nx=d(4,"i8",c);nt=d([.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.3549,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.8889,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.2209,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3889,0,0,0,0,0,0,0,.5839,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5839,0,0,0,0,0,0,0,.5839,0,0,0,0,0,0,0,.5839,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,1.0149,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.7779,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.8329,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.7779,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.7779,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.9439,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.6669,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.4689,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.2219,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.2219,0,0,0,0,0,0,0,.2219,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.2219,0,0,0,0,0,0,0,.8329,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.7219,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.3339,0,0,0,0,0,0,0,.2599,0,0,0,0,0,0,0,.3339,0,0,0,0,0,0,0,.5839,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.1669,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.1909,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.5,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5369,0,0,0,0,0,0,0,.3499,0,0,0,0,0,0,0,.2219,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,.3329,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.3699,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.5559,0,0,0,0,0,0,0,.7779,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,.3649,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.8889,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2219,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.9439,0,0,0,0,0,0,0,.6109,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0,.2779,0,0,0,0,0,0,0],["double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0],c);ed=d([3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0],c);az=d([1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0],c);Mh=d(20,"i8",c);Fw=d(4,"i8",c);yM=d([0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,20,14,2,2,2,2,2,2,2,2,2,2,2,2,2,19,18,2,17,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,15,2,16,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,12,2,13,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,3,4,5,6,7,8,9,10,11],"i8",c);Yp=d([13,65,57,55,251,1,9,2,3,4,85,16,87,19,66,20,68,40,21,22,17,10,11,23,24,229,10,11,23,24,7,8,57,88,89,18,59,42,10,11,19,39,20,64,44,21,22,67,10,11,23,24,230,10,11,46,76,210,207,49,52,62,53,70,69,78,59,203,71,80,81,200,86,82,73,74,0,75,0,0,45],"i8",c);AM=d([0,2,0,6,1,0,1,0,1,2,1,2,1,1,1,3,0,0,1,3,2,0,1,3,1,1,1,0,1,2,1,2,1,1,1,1,1,2,1,2,1,0,2,4,0,3,0,0,5,0,0,5,2,0,4,2,0,4,4,0,5,0,4,1,2,1,1,1,3],"i8",c);JM=d([0,21,23,22,22,22,24,24,25,25,25,25,26,26,26,27,27,28,28,29,30,30,31,32,33,33,34,34,35,35,36,36,36,37,37,37,37,38,38,39,40,41,41,41,43,42,45,46,44,47,48,44,49,50,49,49,51,49,52,53,52,54,52,52,55,56,56,57,57],"i8",c);KM=d([188,188,188,188,188,188,1,188,14,188,189,216,188,218,188,52,188,188,13,188,188,188,188,188,188,188,188,188,206,188,188,15,188,188,188,250,188],"i8",c);Bw=d([4,188,188,188,27,6,44,188,188,188,188,188,188,188,247,8,25,12,188,188,188,188,188,29,188,22,188,31,39,188,37,188,49,40,188,188,50,48,45,188,188,12,44,188,188,188,188,188,53,44,188,53,12,44,12,51,47,188,54,45,22,188,17,188,46,188,56,188,57,188,188,188,44,188,59,63,188,188,44,188,188,188,188,53,53,188,188,188,188,188],"i8",c);Wp=d(4,"i8",c);xw=d(4,"i8",c);Yh=d(8,"i8",c);bM=d([239,187,191],"i8",c);sM=d(4,"i8",c);Vp=d(4,"i8",c);ww=d(4,"i8",c);rM=d(4,"i8",c);Xv=d(4,"i8",c);LM=d([255,5,15,12,6,25,56,72,43,60,61,26,58,27,28,29,30,31,32,33,50,34,47,35,48,77,51,79,63,83,84,36,54,41,37,38,14],"i8",c);zM=d([0,4,8,10,0,0,7,9,11,1,65,67,2,6,66,0,0,0,68,32,12,13,14,0,61,0,38,0,0,28,30,35,44,41,33,34,36,63,40,59,64,0,16,37,3,29,31,21,0,0,39,0,0,0,0,0,0,24,17,25,22,45,0,47,42,50,0,23,0,62,19,18,16,20,52,55,40,21,0,21,58,60,15,0,0,48,43,51,54,57],"i8",c);Xp=d([6,51,42,41,0,1,0,3,4,5,77,20,79,1,52,3,54,23,6,7,12,9,10,11,12,13,9,10,11,12,3,4,72,83,84,10,42,15,9,10,1,12,3,49,13,6,7,53,9,10,11,12,13,9,10,18,62,8,8,19,12,8,17,16,13,19,72,8,14,13,13,8,78,72,60,62,255,62,255,255,28],"i8",c);Qg=d(4,"i8",c);nj=d([0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);Uh=d([16,0,0,0,4,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);bw=d([12,0,0,0,-1,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);EL=d([0,0,0,0,-1,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);aw=d([0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);Rp=d([20,0,0,0,4,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);d([108,110,114],"i8",c);HV=d([47,114,100,98,117,52,47,50,0],"i8",c);IV=d([47,98,114,98,103,51,47,50,0],"i8",c);JV=d([47,114,100,98,117,52,47,49,0],"i8",c);KV=d([47,114,100,98,117,51,47,51,0],"i8",c);LV=d([47,114,100,98,117,51,47,50,0],"i8",c);kT=d([32,32,32,60,83,67,82,73,80,84,32,76,65,78,71,85,65,71,69,61,39,74,97,118,97,115,99,114,105,112,116,39,62,10,0],"i8",c);MV=d([47,114,100,98,117,51,47,49,0],"i8",c);NV=d([47,114,100,98,117,49,49,47,57,0],"i8",c);OV=d([47,101,110,100,112,97,103,101,32,123,32,115,104,111,119,112,97,103,101,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);bz=d([109,105,110,116,99,114,101,97,109,0],"i8",c);PV=d([47,114,100,98,117,49,49,47,56,0],"i8",c);CJ=d([116,97,105,108,99,108,105,112,0],"i8",c);QV=d([97,99,117,116,101,0],"i8",c);RV=d([47,114,100,98,117,49,49,47,55,0],"i8",c);SV=d([47,114,100,98,117,49,49,47,54,0],"i8",c);uP=d([111,114,100,101,114,105,110,103,32,39,37,115,39,32,110,111,116,32,114,101,99,111,103,110,105,122,101,100,32,102,111,114,32,110,111,100,101,32,39,37,115,39,46,10,0],"i8",c);TV=d([47,114,100,98,117,49,49,47,53,0],"i8",c);uE=d([108,97,98,101,108,116,111,111,108,116,105,112,0],"i8",c);UV=d([47,114,100,98,117,49,49,47,52,0],"i8",c);VV=d([47,98,114,98,103,51,47,49,0],"i8",c);WV=d([47,114,100,98,117,49,49,47,51,0],"i8",c);XV=d([47,114,100,98,117,49,49,47,50,0],"i8",c);YV=d([47,114,100,98,117,49,49,47,49,49,0],"i8",c);jT=d([60,33,45,45,32,80,97,103,101,115,58,32,37,100,32,45,45,62,10,0],"i8",c);ZV=d([47,114,100,98,117,49,49,47,49,48,0],"i8",c);qR=d([112,111,108,121,32,37,115,0],"i8",c);$V=d([47,114,100,98,117,49,49,47,49,0],"i8",c);aW=d([9,115,101,116,109,97,116,114,105,120,0],"i8",c);cz=d([109,105,100,110,105,103,104,116,98,108,117,101,0],"i8",c);bW=d([47,114,100,98,117,49,48,47,57,0],"i8",c);BJ=d([99,111,110,115,116,114,97,105,110,116,0],"i8",c);zk=d([98,103,99,111,108,111,114,0],"i8",c);cW=d([97,99,105,114,99,0],"i8",c);dW=d([47,114,100,98,117,49,48,47,56,0],"i8",c);eW=d([47,114,100,98,117,49,48,47,55,0],"i8",c);fW=d([47,114,100,98,117,49,48,47,54,0],"i8",c);tE=d([101,100,103,101,116,111,111,108,116,105,112,0],"i8",c);gW=d([47,114,100,98,117,49,48,47,53,0],"i8",c);hW=d([47,98,114,98,103,49,49,47,57,0],"i8",c);iW=d([47,114,100,98,117,49,48,47,52,0],"i8",c);jW=d([47,114,100,98,117,49,48,47,51,0],"i8",c);kW=d([47,114,100,98,117,49,48,47,50,0],"i8",c);iT=d([60,47,84,73,84,76,69,62,0],"i8",c);lW=d([47,114,100,98,117,49,48,47,49,48,0],"i8",c);mW=d([47,114,100,98,117,49,48,47,49,0],"i8",c);nW=d([9,48,32,48,32,49,32,48,32,51,54,48,32,97,114,99,0],"i8",c);dz=d([109,101,100,105,117,109,118,105,111,108,101,116,114,101,100,0],"i8",c);oW=d([47,112,117,114,112,108,101,115,57,47,57,0],"i8",c);AJ=d([97,114,114,111,119,115,105,122,101,0],"i8",c);pW=d([47,97,99,99,101,110,116,53,47,49,0],"i8",c);qW=d([97,97,99,117,116,101,0],"i8",c);rW=d([47,112,117,114,112,108,101,115,57,47,56,0],"i8",c);sW=d([47,112,117,114,112,108,101,115,57,47,55,0],"i8",c);tW=d([47,112,117,114,112,108,101,115,57,47,54,0],"i8",c);uW=d([47,112,117,114,112,108,101,115,57,47,53,0],"i8",c);vW=d([47,98,114,98,103,49,49,47,56,0],"i8",c);wW=d([47,112,117,114,112,108,101,115,57,47,52,0],"i8",c);xW=d([47,112,117,114,112,108,101,115,57,47,51,0],"i8",c);yW=d([47,112,117,114,112,108,101,115,57,47,50,0],"i8",c);hT=d([60,84,73,84,76,69,62,0],"i8",c);zW=d([47,112,117,114,112,108,101,115,57,47,49,0],"i8",c);AW=d([47,112,117,114,112,108,101,115,56,47,56,0],"i8",c);BW=d([9,114,120,32,114,121,32,115,99,97,108,101,0],"i8",c);ez=d([109,101,100,105,117,109,116,117,114,113,117,111,105,115,101,0],"i8",c);CW=d([47,112,117,114,112,108,101,115,56,47,55,0],"i8",c);jF=d([117,115,105,110,103,32,37,115,32,102,111,114,32,117,110,107,110,111,119,110,32,115,104,97,112,101,32,37,115,10,0],"i8",c);zJ=d([100,101,99,111,114,97,116,101,0],"i8",c);DW=d([106,112,103,58,102,105,103,0],"i8",c);EW=d([90,101,116,97,0],"i8",c);FW=d([47,112,117,114,112,108,101,115,56,47,54,0],"i8",c);eH=d([37,100,32,98,111,120,101,115,58,10,0],"i8",c);GW=d([47,112,117,114,112,108,101,115,56,47,53,0],"i8",c);HW=d([47,112,117,114,112,108,101,115,56,47,52,0],"i8",c);sE=d([104,101,97,100,116,97,114,103,101,116,0],"i8",c);IW=d([47,112,117,114,112,108,101,115,56,47,51,0],"i8",c);JW=d([47,98,114,98,103,49,49,47,55,0],"i8",c);KW=d([47,112,117,114,112,108,101,115,56,47,50,0],"i8",c);LW=d([47,112,117,114,112,108,101,115,56,47,49,0],"i8",c);MW=d([47,112,117,114,112,108,101,115,55,47,55,0],"i8",c);gT=d([60,77,69,84,65,32,104,116,116,112,45,101,113,117,105,118,61,34,67,111,110,116,101,110,116,45,84,121,112,101,34,32,99,111,110,116,101,110,116,61,34,116,101,120,116,47,104,116,109,108,59,32,99,104,97,114,115,101,116,61,85,84,70,45,56,34,62,10,0],"i8",c);NW=d([47,112,117,114,112,108,101,115,55,47,54,0],"i8",c);OW=d([47,112,117,114,112,108,101,115,55,47,53,0],"i8",c);PW=d([9,120,32,121,32,116,114,97,110,115,108,97,116,101,0],"i8",c);fz=d([109,101,100,105,117,109,115,112,114,105,110,103,103,114,101,101,110,0],"i8",c);QW=d([47,112,117,114,112,108,101,115,55,47,52,0],"i8",c);QM=d([97,103,115,116,114,102,114,101,101,32,108,111,115,116,32,37,115,10,0],"i8",c);yJ=d([109,105,110,108,101,110,0],"i8",c);RW=d([89,117,109,108,0],"i8",c);SW=d([47,112,117,114,112,108,101,115,55,47,51,0],"i8",c);TW=d([47,112,117,114,112,108,101,115,55,47,50,0],"i8",c);UW=d([47,112,117,114,112,108,101,115,55,47,49,0],"i8",c);rE=d([116,97,105,108,116,97,114,103,101,116,0],"i8",c);VW=d([47,112,117,114,112,108,101,115,54,47,54,0],"i8",c);WW=d([118,109,108,58,118,109,108,0],"i8",c);XW=d([47,98,114,98,103,49,49,47,54,0],"i8",c);YW=d([47,112,117,114,112,108,101,115,54,47,53,0],"i8",c);ZW=d([47,112,117,114,112,108,101,115,54,47,52,0],"i8",c);$W=d([112,108,117,115,0],"i8",c);aX=d([47,112,117,114,112,108,101,115,54,47,51,0],"i8",c);fT=d([60,72,69,65,68,62,0],"i8",c);bX=d([47,112,117,114,112,108,101,115,54,47,50,0],"i8",c);cX=d([47,112,117,114,112,108,101,115,54,47,49,0],"i8",c);dX=d([9,110,101,119,112,97,116,104,0],"i8",c);gz=d([109,101,100,105,117,109,115,108,97,116,101,98,108,117,101,0],"i8",c);eX=d([47,112,117,114,112,108,101,115,53,47,53,0],"i8",c);xJ=d([108,97,98,101,108,97,110,103,108,101,0],"i8",c);fX=d([89,97,99,117,116,101,0],"i8",c);gX=d([47,112,117,114,112,108,101,115,53,47,52,0],"i8",c);hX=d([47,112,117,114,112,108,101,115,53,47,51,0],"i8",c);xM=d([58,32,0],"i8",c);iX=d([47,112,117,114,112,108,101,115,53,47,50,0],"i8",c);qE=d([108,97,98,101,108,116,97,114,103,101,116,0],"i8",c);jX=d([47,112,117,114,112,108,101,115,53,47,49,0],"i8",c);kX=d([47,98,114,98,103,49,49,47,53,0],"i8",c);lX=d([47,112,117,114,112,108,101,115,52,47,52,0],"i8",c);mX=d([47,112,117,114,112,108,101,115,52,47,51,0],"i8",c);nX=d([47,112,117,114,112,108,101,115,52,47,50,0],"i8",c);oX=d([60,47,66,79,68,89,62,10,60,47,72,84,77,76,62,10,0],"i8",c);Ym=d([85,82,87,32,71,111,116,104,105,99,32,76,0],"i8",c);pX=d([47,112,117,114,112,108,101,115,52,47,49,0],"i8",c);qX=d([47,112,117,114,112,108,101,115,51,47,51,0],"i8",c);rX=d([9,109,97,116,114,105,120,32,99,117,114,114,101,110,116,109,97,116,114,105,120,0],"i8",c);hz=d([109,101,100,105,117,109,115,101,97,103,114,101,101,110,0],"i8",c);sX=d([47,112,117,114,112,108,101,115,51,47,50,0],"i8",c);wJ=d([108,97,98,101,108,100,105,115,116,97,110,99,101,0],"i8",c);tX=d([88,105,0],"i8",c);uX=d([47,112,117,114,112,108,101,115,51,47,49,0],"i8",c);vX=d([47,112,117,114,100,57,47,57,0],"i8",c);wX=d([112,108,97,105,110,45,101,120,116,58,100,111,116,0],"i8",c);xX=d([47,112,117,114,100,57,47,56,0],"i8",c);pE=d([101,100,103,101,116,97,114,103,101,116,0],"i8",c);JN=d([37,115,32,45,62,32,37,115,58,32,104,101,97,100,32,105,115,32,105,110,115,105,100,101,32,116,97,105,108,32,99,108,117,115,116,101,114,32,37,115,10,0],"i8",c);yX=d([47,112,117,114,100,57,47,55,0],"i8",c);$C=d([110,111,32,109,101,109,111,114,121,32,102,114,111,109,32,122,109,97,108,108,111,99,40,41,10,0],"i8",c);hK=d([109,101,109,111,114,121,32,97,108,108,111,99,97,116,105,111,110,32,102,97,105,108,117,114,101,10,0],"i8",c);zX=d([47,98,114,98,103,49,49,47,52,0],"i8",c);AX=d([47,112,117,114,100,57,47,54,0],"i8",c);kw=d([32,123,10,0],"i8",c);tL=d([99,97,110,110,111,116,32,109,97,108,108,111,99,32,112,110,108,115,0],"i8",c);BX=d([47,112,117,114,100,57,47,53,0],"i8",c);ej=d([112,111,115,0],"i8",c);CX=d([47,112,117,114,100,57,47,52,0],"i8",c);DX=d([60,33,45,45,32,105,110,115,101,114,116,32,97,110,121,32,111,116,104,101,114,32,78,79,78,45,73,69,32,104,116,109,108,32,99,111,110,116,101,110,116,32,104,101,114,101,32,45,45,62,10,0],"i8",c);d([77,105,115,115,105,110,103,32,97,114,103,117,109,101,110,116,32,102,111,114,32,45,75,32,102,108,97,103,10,0],"i8",c);uC=d([95,76,84,88,95,108,105,98,114,97,114,121,0],"i8",c);rI=d([84,82,65,73,76,69,82,0],"i8",c);EX=d([47,112,117,114,100,57,47,51,0],"i8",c);FX=d([47,112,117,114,100,57,47,50,0],"i8",c);GX=d([9,47,120,32,101,120,99,104,32,100,101,102,0],"i8",c);iz=d([109,101,100,105,117,109,112,117,114,112,108,101,0],"i8",c);HX=d([47,112,117,114,100,57,47,49,0],"i8",c);vJ=d([108,97,98,101,108,102,111,110,116,99,111,108,111,114,0],"i8",c);IX=d([85,117,109,108,0],"i8",c);JX=d([47,112,117,114,100,56,47,56,0],"i8",c);KX=d([47,112,117,114,100,56,47,55,0],"i8",c);LX=d([47,112,117,114,100,56,47,54,0],"i8",c);is=d([116,97,114,103,101,116,0],"i8",c);MX=d([47,112,117,114,100,56,47,53,0],"i8",c);NX=d([47,98,114,98,103,49,49,47,51,0],"i8",c);OX=d([47,112,117,114,100,56,47,52,0],"i8",c);PX=d([47,112,117,114,100,56,47,51,0],"i8",c);QX=d([47,112,117,114,100,56,47,50,0],"i8",c);RX=d([60,68,73,86,32,105,100,61,39,95,110,111,116,86,77,76,50,95,39,32,115,116,121,108,101,61,34,112,111,115,105,116,105,111,110,58,114,101,108,97,116,105,118,101,59,34,62,10,0],"i8",c);SX=d([47,112,117,114,100,56,47,49,0],"i8",c);jx=d([115,111,117,114,99,101,0],"i8",c);TX=d([47,112,117,114,100,55,47,55,0],"i8",c);UX=d([9,47,121,32,101,120,99,104,32,100,101,102,0],"i8",c);jz=d([109,101,100,105,117,109,111,114,99,104,105,100,0],"i8",c);VX=d([47,112,117,114,100,55,47,54,0],"i8",c);uJ=d([108,97,98,101,108,102,111,110,116,110,97,109,101,0],"i8",c);QP=d([104,112,0],"i8",c);fF=d([110,111,0],"i8",c);WX=d([69,110,99,111,100,105,110,103,86,101,99,116,111,114,32,52,53,32,47,104,121,112,104,101,110,32,112,117,116,0],"i8",c);XX=d([85,112,115,105,108,111,110,0],"i8",c);YX=d([47,112,117,114,100,55,47,53,0],"i8",c);ZX=d([47,112,117,114,100,55,47,52,0],"i8",c);$X=d([47,112,117,114,100,55,47,51,0],"i8",c);oE=d([104,101,97,100,85,82,76,0],"i8",c);aY=d([47,112,117,114,100,55,47,50,0],"i8",c);bY=d([47,98,114,98,103,49,49,47,50,0],"i8",c);cY=d([47,112,117,114,100,55,47,49,0],"i8",c);dY=d([47,112,117,114,100,54,47,54,0],"i8",c);eY=d([47,112,117,114,100,54,47,53,0],"i8",c);fY=d([60,72,50,62,83,111,114,114,121,44,32,116,104,105,115,32,100,105,97,103,114,97,109,32,119,105,108,108,32,111,110,108,121,32,100,105,115,112,108,97,121,32,99,111,114,114,101,99,116,108,121,32,111,110,32,73,110,116,101,114,110,101,116,32,69,120,112,108,111,114,101,114,32,53,32,40,97,110,100,32,117,112,41,32,98,114,111,119,115,101,114,115,46,60,47,72,50,62,10,0],"i8",c);gY=d([47,112,117,114,100,54,47,52,0],"i8",c);hY=d([47,112,117,114,100,54,47,51,0],"i8",c);iY=d([9,47,114,120,32,101,120,99,104,32,100,101,102,0],"i8",c);kz=d([109,101,100,105,117,109,98,108,117,101,0],"i8",c);jY=d([47,112,117,114,100,54,47,50,0],"i8",c);tJ=d([108,97,98,101,108,102,111,110,116,115,105,122,101,0],"i8",c);kY=d([85,103,114,97,118,101,0],"i8",c);lY=d([47,112,117,114,100,54,47,49,0],"i8",c);mY=d([47,112,117,114,100,53,47,53,0],"i8",c);nY=d([47,112,117,114,100,53,47,52,0],"i8",c);nE=d([104,101,97,100,104,114,101,102,0],"i8",c);oY=d([112,101,110,0],"i8",c);pY=d([47,112,117,114,100,53,47,51,0],"i8",c);qY=d([47,98,114,98,103,49,49,47,49,49,0],"i8",c);rY=d([47,112,117,114,100,53,47,50,0],"i8",c);sY=d([47,112,117,114,100,53,47,49,0],"i8",c);tY=d([47,112,117,114,100,52,47,52,0],"i8",c);uY=d([60,33,45,45,32,116,104,105,115,32,115,104,111,117,108,100,32,111,110,108,121,32,100,105,115,112,108,97,121,32,111,110,32,78,79,78,45,73,69,32,98,114,111,119,115,101,114,115,32,45,45,62,10,0],"i8",c);vY=d([47,112,117,114,100,52,47,51,0],"i8",c);wY=d([47,112,117,114,100,52,47,50,0],"i8",c);xY=d([9,47,114,121,32,101,120,99,104,32,100,101,102,0],"i8",c);lz=d([109,101,100,105,117,109,97,113,117,97,109,97,114,105,110,101,0],"i8",c);yY=d([47,112,117,114,100,52,47,49,0],"i8",c);ls=d([116,97,105,108,108,97,98,101,108,0],"i8",c);zY=d([85,99,105,114,99,0],"i8",c);AY=d([47,112,117,114,100,51,47,51,0],"i8",c);BY=d([47,112,117,114,100,51,47,50,0],"i8",c);CY=d([47,112,117,114,100,51,47,49,0],"i8",c);mE=d([116,97,105,108,85,82,76,0],"i8",c);wP=d([111,114,100,101,114,105,110,103,32,39,37,115,39,32,110,111,116,32,114,101,99,111,103,110,105,122,101,100,46,10,0],"i8",c);DY=d([47,112,117,111,114,57,47,57,0],"i8",c);EY=d([47,98,114,98,103,49,49,47,49,48,0],"i8",c);FY=d([47,112,117,111,114,57,47,56,0],"i8",c);GY=d([47,112,117,111,114,57,47,55,0],"i8",c);HY=d([47,112,117,111,114,57,47,54,0],"i8",c);IY=d([60,68,73,86,32,105,100,61,39,95,110,111,116,86,77,76,49,95,39,32,115,116,121,108,101,61,34,112,111,115,105,116,105,111,110,58,114,101,108,97,116,105,118,101,59,34,62,10,0],"i8",c);JY=d([47,112,117,111,114,57,47,53,0],"i8",c);KY=d([47,112,117,111,114,57,47,52,0],"i8",c);tR=d([99,105,114,99,108,101,32,37,115,32,37,100,44,37,100,44,37,100,10,0],"i8",c);NM=d([109,101,109,111,114,121,32,101,120,104,97,117,115,116,101,100,0],"i8",c);LY=d([47,101,108,108,105,112,115,101,95,112,97,116,104,32,123,0],"i8",c);MY=d([47,112,117,111,114,57,47,51,0],"i8",c);ks=d([104,101,97,100,108,97,98,101,108,0],"i8",c);NY=d([85,97,99,117,116,101,0],"i8",c);OY=d([47,112,117,111,114,57,47,50,0],"i8",c);PY=d([47,112,117,111,114,57,47,49,0],"i8",c);QY=d([47,112,117,111,114,56,47,56,0],"i8",c);lE=d([116,97,105,108,104,114,101,102,0],"i8",c);RY=d([47,112,117,111,114,56,47,55,0],"i8",c);SY=d([47,98,114,98,103,49,49,47,49,0],"i8",c);TY=d([47,112,117,111,114,56,47,54,0],"i8",c);UY=d([47,112,117,111,114,56,47,53,0],"i8",c);VY=d([47,112,117,111,114,56,47,52,0],"i8",c);WY=d([60,33,45,45,32,105,110,115,101,114,116,32,97,110,121,32,111,116,104,101,114,32,104,116,109,108,32,99,111,110,116,101,110,116,32,104,101,114,101,32,45,45,62,10,0],"i8",c);XY=d([47,112,117,111,114,56,47,51,0],"i8",c);YY=d([47,112,117,111,114,56,47,50,0],"i8",c);ZY=d([9,9,99,108,111,115,101,112,97,116,104,0],"i8",c);Zm=d([109,97,103,101,110,116,97,0],"i8",c);$Y=d([47,112,117,111,114,56,47,49,0],"i8",c);sJ=d([97,114,114,111,119,116,97,105,108,0],"i8",c);aZ=d([47,97,99,99,101,110,116,52,47,52,0],"i8",c);bZ=d([84,104,101,116,97,0],"i8",c);cZ=d([47,112,117,111,114,55,47,55,0],"i8",c);dZ=d([47,112,117,111,114,55,47,54,0],"i8",c);eZ=d([47,112,117,111,114,55,47,53,0],"i8",c);kE=d([108,97,98,101,108,85,82,76,0],"i8",c);fZ=d([47,112,117,111,114,55,47,52,0],"i8",c);d([63,0],"i8",c);gZ=d([47,98,114,98,103,49,48,47,57,0],"i8",c);hZ=d([47,112,117,111,114,55,47,51,0],"i8",c);iZ=d([47,112,117,111,114,55,47,50,0],"i8",c);jZ=d([47,112,117,111,114,55,47,49,0],"i8",c);kZ=d([60,68,73,86,32,105,100,61,39,95,86,77,76,50,95,39,32,115,116,121,108,101,61,34,112,111,115,105,116,105,111,110,58,114,101,108,97,116,105,118,101,59,118,105,115,105,98,105,108,105,116,121,58,104,105,100,100,101,110,34,62,10,0],"i8",c);lZ=d([47,112,117,111,114,54,47,54,0],"i8",c);mZ=d([47,112,117,111,114,54,47,53,0],"i8",c);nZ=d([9,9,112,111,112,32,110,101,103,32,48,32,114,108,105,110,101,116,111,0],"i8",c);mz=d([108,105,110,101,110,0],"i8",c);oZ=d([47,112,117,111,114,54,47,52,0],"i8",c);rJ=d([97,114,114,111,119,104,101,97,100,0],"i8",c);pZ=d([106,112,101,58,102,105,103,0],"i8",c);qZ=d([47,112,117,111,114,54,47,51,0],"i8",c);rZ=d([84,97,117,0],"i8",c);kH=d([105,110,32,99,104,101,99,107,112,97,116,104,44,32,101,110,100,32,112,111,114,116,32,110,111,116,32,105,110,32,108,97,115,116,32,98,111,120,10,0],"i8",c);sZ=d([47,112,117,111,114,54,47,50,0],"i8",c);tZ=d([47,112,117,111,114,54,47,49,0],"i8",c);jE=d([108,97,98,101,108,104,114,101,102,0],"i8",c);uZ=d([47,112,117,111,114,53,47,53,0],"i8",c);vZ=d([47,98,114,98,103,49,48,47,56,0],"i8",c);wZ=d([47,112,117,111,114,53,47,52,0],"i8",c);xZ=d([47,112,117,111,114,53,47,51,0],"i8",c);yZ=d([47,112,117,111,114,53,47,50,0],"i8",c);$m=d([60,47,68,73,86,62,10,0],"i8",c);Kw=d([69,68,95,116,111,95,118,105,114,116,40,101,41,32,61,61,32,78,85,76,76,0],"i8",c);zZ=d([47,112,117,111,114,53,47,49,0],"i8",c);AZ=d([47,112,117,111,114,52,47,52,0],"i8",c);BZ=d([9,9,48,32,101,120,99,104,32,114,108,105,110,101,116,111,0],"i8",c);nz=d([108,105,109,101,103,114,101,101,110,0],"i8",c);CZ=d([47,112,117,111,114,52,47,51,0],"i8",c);qJ=d([100,105,114,0],"i8",c);DZ=d([47,112,117,111,114,52,47,50,0],"i8",c);EZ=d([84,72,79,82,78,0],"i8",c);FZ=d([47,112,117,111,114,52,47,49,0],"i8",c);GZ=d([47,112,117,111,114,51,47,51,0],"i8",c);iE=d([101,100,103,101,85,82,76,0],"i8",c);HZ=d([47,112,117,111,114,51,47,50,0],"i8",c);IZ=d([47,98,114,98,103,49,48,47,55,0],"i8",c);JZ=d([118,109,108,0],"i8",c);KZ=d([47,112,117,111,114,51,47,49,0],"i8",c);LZ=d([47,112,117,111,114,49,49,47,57,0],"i8",c);MZ=d([47,112,117,111,114,49,49,47,56,0],"i8",c);NZ=d([60,47,118,58,103,114,111,117,112,62,10,0],"i8",c);OZ=d([75,80,95,68,111,119,110,0],"i8",c);PZ=d([47,112,117,111,114,49,49,47,55,0],"i8",c);QZ=d([47,112,117,111,114,49,49,47,54,0],"i8",c);jh=d([110,111,100,101,0],"i8",c);RZ=d([9,9,101,120,99,104,32,48,32,114,108,105,110,101,116,111,0],"i8",c);SZ=d([47,112,117,111,114,49,49,47,53,0],"i8",c);pJ=d([108,97,98,101,108,102,108,111,97,116,0],"i8",c);TZ=d([47,112,117,111,114,49,49,47,52,0],"i8",c);UZ=d([83,105,103,109,97,0],"i8",c);VZ=d([47,112,117,111,114,49,49,47,51,0],"i8",c);WZ=d([47,112,117,111,114,49,49,47,50,0],"i8",c);hE=d([101,100,103,101,104,114,101,102,0],"i8",c);Aw=d([117,115,101,114,111,117,116,58,32,99,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,10,0],"i8",c);XZ=d([47,112,117,111,114,49,49,47,49,49,0],"i8",c);YZ=d([47,98,114,98,103,49,48,47,54,0],"i8",c);ZZ=d([47,112,117,111,114,49,49,47,49,48,0],"i8",c);AO=d([97,117,120,103,0],"i8",c);$Z=d([47,112,117,111,114,49,49,47,49,0],"i8",c);a_=d([47,112,117,111,114,49,48,47,57,0],"i8",c);ar=d([62,10,0],"i8",c);b_=d([65,118,97,110,116,71,97,114,100,101,45,66,111,111,107,0],"i8",c);c_=d([47,112,117,111,114,49,48,47,56,0],"i8",c);d_=d([47,112,117,111,114,49,48,47,55,0],"i8",c);e_=d([9,9,50,32,99,111,112,121,0],"i8",c);f_=d([47,112,117,111,114,49,48,47,54,0],"i8",c);oz=d([108,105,103,104,116,121,101,108,108,111,119,0],"i8",c);g_=d([47,112,117,111,114,49,48,47,53,0],"i8",c);h_=d([83,99,97,114,111,110,0],"i8",c);i_=d([47,112,117,111,114,49,48,47,52,0],"i8",c);j_=d([112,108,97,105,110,58,100,111,116,0],"i8",c);k_=d([47,112,117,111,114,49,48,47,51,0],"i8",c);IN=d([37,115,32,45,62,32,37,115,58,32,116,97,105,108,32,110,111,116,32,105,110,115,105,100,101,32,116,97,105,108,32,99,108,117,115,116,101,114,32,37,115,10,0],"i8",c);l_=d([47,112,117,111,114,49,48,47,50,0],"i8",c);m_=d([47,112,117,111,114,49,48,47,49,48,0],"i8",c);ZC=d([37,100,32,116,101,120,116,115,10,0],"i8",c);n_=d([47,98,114,98,103,49,48,47,53,0],"i8",c);jw=d([95,97,110,111,110,121,109,111,117,115,0],"i8",c);lL=d([99,97,110,110,111,116,32,114,101,97,108,108,111,99,32,100,113,46,112,110,108,115,0],"i8",c);o_=d([47,112,117,111,114,49,48,47,49,0],"i8",c);QJ=d([115,116,111,112,10,0],"i8",c);p_=d([47,112,117,98,117,103,110,57,47,57,0],"i8",c);q_=d([32,116,97,114,103,101,116,61,34,37,115,34,0],"i8",c);d([70,111,114,109,97,116,58,32,34,37,115,34,32,110,111,116,32,114,101,99,111,103,110,105,122,101,100,46,32,85,115,101,32,111,110,101,32,111,102,58,37,115,10,0],"i8",c);d([102,97,105,108,117,114,101,32,109,97,108,108,111,99,39,105,110,103,32,102,111,114,32,114,101,115,117,108,116,32,115,116,114,105,110,103,0],"i8",c);qI=d([69,78,68,0],"i8",c);r_=d([47,112,117,98,117,103,110,57,47,56,0],"i8",c);s_=d([47,112,117,98,117,103,110,57,47,55,0],"i8",c);t_=d([9,9,109,111,118,101,116,111,0],"i8",c);u_=d([47,112,117,98,117,103,110,57,47,54,0],"i8",c);pz=d([108,105,103,104,116,115,116,101,101,108,98,108,117,101,0],"i8",c);nJ=d([122,0],"i8",c);qz=d([98,105,115,113,117,101,0],"i8",c);v_=d([47,112,117,98,117,103,110,57,47,53,0],"i8",c);w_=d([82,104,111,0],"i8",c);x_=d([47,112,117,98,117,103,110,57,47,52,0],"i8",c);y_=d([47,112,117,98,117,103,110,57,47,51,0],"i8",c);z_=d([47,112,117,98,117,103,110,57,47,50,0],"i8",c);A_=d([47,112,117,98,117,103,110,57,47,49,0],"i8",c);B_=d([47,98,114,98,103,49,48,47,52,0],"i8",c);C_=d([47,112,117,98,117,103,110,56,47,56,0],"i8",c);D_=d([47,112,117,98,117,103,110,56,47,55,0],"i8",c);E_=d([32,116,105,116,108,101,61,34,37,115,34,0],"i8",c);F_=d([47,112,117,98,117,103,110,56,47,54,0],"i8",c);G_=d([47,112,117,98,117,103,110,56,47,53,0],"i8",c);H_=d([109,105,110,0],"i8",c);I_=d([9,9,52,32,50,32,114,111,108,108,0],"i8",c);J_=d([47,112,117,98,117,103,110,56,47,52,0],"i8",c);cP=d([114,101,109,105,110,99,114,111,115,115,0],"i8",c);rz=d([108,105,103,104,116,115,108,97,116,101,103,114,101,121,0],"i8",c);XK=d([104,101,105,103,104,116,61,34,37,108,102,37,50,115,34,0],"i8",c);mJ=d([118,101,114,116,105,99,101,115,0],"i8",c);OP=d([110,115,108,105,109,105,116,0],"i8",c);K_=d([73,83,79,76,97,116,105,110,49,69,110,99,111,100,105,110,103,32,48,32,50,53,53,32,103,101,116,105,110,116,101,114,118,97,108,32,112,117,116,105,110,116,101,114,118,97,108,0],"i8",c);L_=d([47,112,117,98,117,103,110,56,47,51,0],"i8",c);M_=d([80,115,105,0],"i8",c);N_=d([47,112,117,98,117,103,110,56,47,50,0],"i8",c);O_=d([47,112,117,98,117,103,110,56,47,49,0],"i8",c);QE=d([78,111,32,99,111,109,109,97,32,105,110,32,99,111,108,111,114,32,115,112,101,99,32,34,37,115,34,32,105,110,32,99,111,108,111,114,32,97,116,116,114,105,98,117,116,101,32,0],"i8",c);P_=d([47,112,117,98,117,103,110,55,47,55,0],"i8",c);Q_=d([47,112,117,98,117,103,110,55,47,54,0],"i8",c);R_=d([47,98,114,98,103,49,48,47,51,0],"i8",c);S_=d([47,112,117,98,117,103,110,55,47,53,0],"i8",c);Py=d([47,62,10,0],"i8",c);T_=d([47,112,117,98,117,103,110,55,47,52,0],"i8",c);U_=d([32,104,114,101,102,61,34,37,115,34,0],"i8",c);V_=d([47,112,117,98,117,103,110,55,47,51,0],"i8",c);W_=d([47,112,117,98,117,103,110,55,47,50,0],"i8",c);X_=d([47,98,111,120,112,114,105,109,32,123,9,9,9,9,37,32,120,99,111,114,110,101,114,32,121,99,111,114,110,101,114,32,120,115,105,122,101,32,121,115,105,122,101,0],"i8",c);Y_=d([47,112,117,98,117,103,110,55,47,49,0],"i8",c);sz=d([108,105,103,104,116,115,108,97,116,101,103,114,97,121,0],"i8",c);Nn=d([99,111,109,109,101,110,116,0],"i8",c);Z_=d([47,112,117,98,117,103,110,54,47,54,0],"i8",c);$_=d([80,114,105,109,101,0],"i8",c);a0=d([47,112,117,98,117,103,110,54,47,53,0],"i8",c);b0=d([47,112,117,98,117,103,110,54,47,52,0],"i8",c);SE=d([73,108,108,101,103,97,108,32,108,101,110,103,116,104,32,118,97,108,117,101,32,105,110,32,34,37,115,34,32,99,111,108,111,114,32,97,116,116,114,105,98,117,116,101,32,0],"i8",c);c0=d([118,101,101,0],"i8",c);d0=d([47,112,117,98,117,103,110,54,47,51,0],"i8",c);e0=d([47,112,117,98,117,103,110,54,47,50,0],"i8",c);f0=d([47,98,114,98,103,49,48,47,50,0],"i8",c);g0=d([47,112,117,98,117,103,110,54,47,49,0],"i8",c);sH=d([110,111,100,101,32,39,37,115,39,44,32,103,114,97,112,104,32,39,37,115,39,32,115,105,122,101,32,116,111,111,32,115,109,97,108,108,32,102,111,114,32,108,97,98,101,108,10,0],"i8",c);rU=d([34,32,119,105,100,116,104,61,34,37,103,112,120,34,32,104,101,105,103,104,116,61,34,37,103,112,120,34,32,112,114,101,115,101,114,118,101,65,115,112,101,99,116,82,97,116,105,111,61,34,120,77,105,110,89,77,105,110,32,109,101,101,116,34,32,120,61,34,37,103,34,32,121,61,34,37,103,34,0],"i8",c);h0=d([47,112,117,98,117,103,110,53,47,53,0],"i8",c);tz=d([60,97,0],"i8",c);i0=d([47,112,117,98,117,103,110,53,47,52,0],"i8",c);j0=d([47,112,117,98,117,103,110,53,47,51,0],"i8",c);k0=d([9,103,114,101,115,116,111,114,101,0],"i8",c);l0=d([47,112,117,98,117,103,110,53,47,50,0],"i8",c);uz=d([108,105,103,104,116,115,107,121,98,108,117,101,0],"i8",c);lJ=d([103,114,111,117,112,0],"i8",c);m0=d([47,112,117,98,117,103,110,53,47,49,0],"i8",c);n0=d([80,105,0],"i8",c);o0=d([47,112,117,98,117,103,110,52,47,52,0],"i8",c);p0=d([47,112,117,98,117,103,110,52,47,51,0],"i8",c);RE=d([48,45,108,101,110,103,116,104,32,105,110,32,99,111,108,111,114,32,115,112,101,99,32,34,37,115,34,10,0],"i8",c);q0=d([47,112,117,98,117,103,110,52,47,50,0],"i8",c);Ep=d([105,110,0],"i8",c);r0=d([47,112,117,98,117,103,110,52,47,49,0],"i8",c);s0=d([47,98,114,98,103,49,48,47,49,48,0],"i8",c);t0=d([47,112,117,98,117,103,110,51,47,51,0],"i8",c);tU=d([32,116,114,97,110,115,102,111,114,109,61,34,114,111,116,97,116,101,40,37,100,32,37,103,32,37,103,41,34,0],"i8",c);u0=d([47,112,117,98,117,103,110,51,47,50,0],"i8",c);vz=d([60,47,97,62,10,0],"i8",c);v0=d([47,112,117,98,117,103,110,51,47,49,0],"i8",c);w0=d([47,112,117,98,117,57,47,57,0],"i8",c);x0=d([9,9,125,32,105,102,0],"i8",c);y0=d([47,112,117,98,117,57,47,56,0],"i8",c);Ax=d([102,108,97,116,46,99,0],"i8",c);wz=d([108,105,103,104,116,115,101,97,103,114,101,101,110,0],"i8",c);Qn=d([108,97,121,101,114,0],"i8",c);sR=d([114,101,99,116,32,37,115,32,37,100,44,37,100,32,37,100,44,37,100,10,0],"i8",c);z0=d([47,112,117,98,117,57,47,55,0],"i8",c);A0=d([80,104,105,0],"i8",c);B0=d([47,112,117,98,117,57,47,54,0],"i8",c);C0=d([47,112,117,98,117,57,47,53,0],"i8",c);D0=d([47,112,117,98,117,57,47,52,0],"i8",c);E0=d([47,112,117,98,117,57,47,51,0],"i8",c);F0=d([47,98,114,98,103,49,48,47,49,0],"i8",c);G0=d([47,112,117,98,117,57,47,50,0],"i8",c);pH=d([78,111,32,111,114,32,105,109,112,114,111,112,101,114,32,105,109,97,103,101,61,34,37,115,34,32,102,111,114,32,110,111,100,101,32,34,37,115,34,10,0],"i8",c);sU=d([34,32,119,105,100,116,104,61,34,37,103,112,120,34,32,104,101,105,103,104,116,61,34,37,103,112,120,34,32,112,114,101,115,101,114,118,101,65,115,112,101,99,116,82,97,116,105,111,61,34,120,77,105,100,89,77,105,100,32,109,101,101,116,34,32,120,61,34,37,103,34,32,121,61,34,37,103,34,0],"i8",c);H0=d([47,112,117,98,117,57,47,49,0],"i8",c);ZT=d([60,47,118,58,114,101,99,116,62,10,0],"i8",c);I0=d([47,112,117,98,117,56,47,56,0],"i8",c);J0=d([47,112,117,98,117,56,47,55,0],"i8",c);K0=d([9,9,9,116,101,120,116,32,115,116,114,105,110,103,119,105,100,116,104,32,112,111,112,32,119,105,100,116,104,32,101,120,99,104,32,115,117,98,32,116,101,120,116,32,108,101,110,103,116,104,32,100,105,118,32,48,32,116,101,120,116,32,97,115,104,111,119,0],"i8",c);L0=d([47,112,117,98,117,56,47,54,0],"i8",c);xz=d([108,105,103,104,116,115,97,108,109,111,110,0],"i8",c);kJ=d([110,111,106,117,115,116,105,102,121,0],"i8",c);M0=d([47,97,99,99,101,110,116,52,47,51,0],"i8",c);N0=d([47,112,117,98,117,56,47,53,0],"i8",c);O0=d([79,117,109,108,0],"i8",c);P0=d([47,112,117,98,117,56,47,52,0],"i8",c);Q0=d([47,112,117,98,117,56,47,51,0],"i8",c);R0=d([47,112,117,98,117,56,47,50,0],"i8",c);S0=d([47,112,117,98,117,56,47,49,0],"i8",c);T0=d([47,98,108,117,101,115,57,47,57,0],"i8",c);zf=d([58,0],"i8",c);U0=d([47,112,117,98,117,55,47,55,0],"i8",c);qH=d([60,110,105,108,62,0],"i8",c);qU=d([60,105,109,97,103,101,32,120,108,105,110,107,58,104,114,101,102,61,34,0],"i8",c);V0=d([47,112,117,98,117,55,47,54,0],"i8",c);YT=d([60,47,99,101,110,116,101,114,62,60,47,118,58,116,101,120,116,98,111,120,62,10,0],"i8",c);W0=d([47,112,117,98,117,55,47,53,0],"i8",c);X0=d([47,112,117,98,117,55,47,52,0],"i8",c);Y0=d([9,9,9,91,93,32,48,32,115,101,116,100,97,115,104,0],"i8",c);Z0=d([47,112,117,98,117,55,47,51,0],"i8",c);yz=d([108,105,103,104,116,112,105,110,107,0],"i8",c);pt=d([105,109,97,103,101,115,99,97,108,101,0],"i8",c);$0=d([106,112,101,103,58,102,105,103,0],"i8",c);a1=d([47,112,117,98,117,55,47,50,0],"i8",c);b1=d([79,116,105,108,100,101,0],"i8",c);jH=d([105,110,32,99,104,101,99,107,112,97,116,104,44,32,115,116,97,114,116,32,112,111,114,116,32,110,111,116,32,105,110,32,102,105,114,115,116,32,98,111,120,10,0],"i8",c);c1=d([47,112,117,98,117,55,47,49,0],"i8",c);d1=d([47,112,117,98,117,54,47,54,0],"i8",c);PE=d([105,110,32,101,100,103,101,32,37,115,37,115,37,115,10,0],"i8",c);e1=d([47,112,117,98,117,54,47,53,0],"i8",c);f1=d([47,112,117,98,117,54,47,52,0],"i8",c);g1=d([47,98,108,117,101,115,57,47,56,0],"i8",c);h1=d([47,112,117,98,117,54,47,51,0],"i8",c);rH=d([78,111,32,111,114,32,105,109,112,114,111,112,101,114,32,115,104,97,112,101,102,105,108,101,61,34,37,115,34,32,102,111,114,32,110,111,100,101,32,34,37,115,34,10,0],"i8",c);oU=d([32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,10,0],"i8",c);i1=d([47,112,117,98,117,54,47,50,0],"i8",c);XT=d([34,62,60,99,101,110,116,101,114,62,0],"i8",c);j1=d([47,112,117,98,117,54,47,49,0],"i8",c);LO=d([109,101,114,103,101,95,111,110,101,119,97,121,32,103,108,105,116,99,104,10,0],"i8",c);k1=d([47,112,117,98,117,53,47,53,0],"i8",c);l1=d([9,9,119,105,100,116,104,32,48,32,103,116,32,123,0],"i8",c);m1=d([47,112,117,98,117,53,47,52,0],"i8",c);qe=d([108,105,103,104,116,103,114,101,121,0],"i8",c);Af=d([45,45,0],"i8",c);jJ=d([102,105,120,101,100,115,105,122,101,0],"i8",c);n1=d([47,112,117,98,117,53,47,51,0],"i8",c);o1=d([79,115,108,97,115,104,0],"i8",c);p1=d([47,112,117,98,117,53,47,50,0],"i8",c);q1=d([47,112,117,98,117,53,47,49,0],"i8",c);r1=d([47,112,117,98,117,52,47,52,0],"i8",c);s1=d([47,112,117,98,117,52,47,51,0],"i8",c);t1=d([47,98,108,117,101,115,57,47,55,0],"i8",c);dT=d([69,114,114,111,114,32,100,117,114,105,110,103,32,99,111,110,118,101,114,115,105,111,110,32,116,111,32,34,85,84,70,45,56,34,46,32,32,81,117,105,116,105,110,103,46,10,0],"i8",c);u1=d([47,112,117,98,117,52,47,50,0],"i8",c);mH=d([114,101,103,117,108,97,114,0],"i8",c);nU=d([37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,46,49,102,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,10,32,37,100,32,37,115,10,0],"i8",c);v1=d([47,112,117,98,117,52,47,49,0],"i8",c);UT=d([99,111,108,111,114,58,35,37,48,50,120,37,48,50,120,37,48,50,120,59,0],"i8",c);w1=d([47,112,117,98,117,51,47,51,0],"i8",c);x1=d([68,111,119,110,0],"i8",c);y1=d([47,112,117,98,117,51,47,50,0],"i8",c);Im=d([32,45,100,97,115,104,32,50,0],"i8",c);z1=d([9,103,115,97,118,101,0],"i8",c);A1=d([47,112,117,98,117,51,47,49,0],"i8",c);B1=d([108,105,103,104,116,103,114,101,101,110,0],"i8",c);iJ=d([100,105,115,116,111,114,116,105,111,110,0],"i8",c);C1=d([47,112,114,103,110,57,47,57,0],"i8",c);D1=d([79,109,105,99,114,111,110,0],"i8",c);E1=d([47,112,114,103,110,57,47,56,0],"i8",c);F1=d([47,112,114,103,110,57,47,55,0],"i8",c);KE=d([37,115,45,37,115,0],"i8",c);G1=d([47,112,114,103,110,57,47,54,0],"i8",c);zw=d([87,97,114,110,105,110,103,0],"i8",c);H1=d([47,112,114,103,110,57,47,53,0],"i8",c);I1=d([47,98,108,117,101,115,57,47,54,0],"i8",c);J1=d([47,112,114,103,110,57,47,52,0],"i8",c);Lk=d([37,108,102,44,37,108,102,0],"i8",c);Sp=d([125,10,0],"i8",c);dh=d([108,97,98,101,108,0],"i8",c);K1=d([47,112,114,103,110,57,47,51,0],"i8",c);VT=d([99,111,108,111,114,58,37,115,59,0],"i8",c);L1=d([47,112,114,103,110,57,47,50,0],"i8",c);jG=d([91,105,110,116,101,114,110,97,108,32,116,105,109,101,115,93,0],"i8",c);M1=d([47,112,114,103,110,57,47,49,0],"i8",c);N1=d([9,47,119,105,100,116,104,32,101,120,99,104,32,100,101,102,0],"i8",c);O1=d([47,112,114,103,110,56,47,56,0],"i8",c);zz=d([108,105,103,104,116,103,114,97,121,0],"i8",c);hJ=d([115,107,101,119,0],"i8",c);P1=d([47,112,114,103,110,56,47,55,0],"i8",c);Q1=d([79,109,101,103,97,0],"i8",c);R1=d([47,112,114,103,110,56,47,54,0],"i8",c);S1=d([99,97,110,111,110,58,100,111,116,0],"i8",c);T1=d([47,112,114,103,110,56,47,53,0],"i8",c);Xw=d([98,101,122,45,62,101,102,108,97,103,0],"i8",c);U1=d([47,112,114,103,110,56,47,52,0],"i8",c);V1=d([47,112,114,103,110,56,47,51,0],"i8",c);W1=d([47,98,108,117,101,115,57,47,53,0],"i8",c);kL=d([99,97,110,110,111,116,32,109,97,108,108,111,99,32,100,113,46,112,110,108,115,0],"i8",c);X1=d([47,112,114,103,110,56,47,50,0],"i8",c);YC=d([37,100,32,101,108,108,105,112,115,101,115,10,0],"i8",c);Zn=d([109,97,114,103,105,110,0],"i8",c);Y1=d([32,32,125,10,0],"i8",c);Z1=d([47,112,114,103,110,56,47,49,0],"i8",c);TT=d([32,102,111,110,116,45,115,105,122,101,58,32,37,46,50,102,112,116,59,0],"i8",c);d([77,105,115,115,105,110,103,32,97,114,103,117,109,101,110,116,32,102,111,114,32,45,84,32,102,108,97,103,10,0],"i8",c);Ar=d([76,97,121,111,117,116,32,119,97,115,32,110,111,116,32,100,111,110,101,10,0],"i8",c);pI=d([66,69,71,73,78,0],"i8",c);$1=d([47,112,114,103,110,55,47,55,0],"i8",c);a2=d([47,112,114,103,110,55,47,54,0],"i8",c);b2=d([9,47,116,101,120,116,32,101,120,99,104,32,100,101,102,0],"i8",c);c2=d([47,112,114,103,110,55,47,53,0],"i8",c);Az=d([108,105,103,104,116,103,111,108,100,101,110,114,111,100,121,101,108,108,111,119,0],"i8",c);es=d([112,101,114,105,112,104,101,114,105,101,115,0],"i8",c);Bz=d([98,101,105,103,101,0],"i8",c);d2=d([47,112,114,103,110,55,47,52,0],"i8",c);e2=d([79,103,114,97,118,101,0],"i8",c);f2=d([47,112,114,103,110,55,47,51,0],"i8",c);g2=d([47,112,114,103,110,55,47,50,0],"i8",c);h2=d([47,112,114,103,110,55,47,49,0],"i8",c);i2=d([47,112,114,103,110,54,47,54,0],"i8",c);j2=d([47,98,108,117,101,115,57,47,52,0],"i8",c);k2=d([47,112,114,103,110,54,47,53,0],"i8",c);aI=d([35,37,50,120,37,50,120,37,50,120,37,50,120,0],"i8",c);l2=d([32,32,32,32,116,101,120,116,117,114,101,32,73,109,97,103,101,84,101,120,116,117,114,101,32,123,32,117,114,108,32,34,37,115,34,32,125,10,0],"i8",c);m2=d([47,112,114,103,110,54,47,52,0],"i8",c);ST=d([102,111,110,116,45,115,116,121,108,101,58,32,37,115,59,0],"i8",c);n2=d([47,112,114,103,110,54,47,51,0],"i8",c);o2=d([47,112,114,103,110,54,47,50,0],"i8",c);p2=d([115,97,109,101,0],"i8",c);q2=d([109,97,112,0],"i8",c);r2=d([47,112,114,103,110,54,47,49,0],"i8",c);Cz=d([108,105,103,104,116,99,121,97,110,0],"i8",c);WK=d([119,105,100,116,104,61,34,37,108,102,37,50,115,34,0],"i8",c);gJ=d([115,105,100,101,115,0],"i8",c);WP=d([69,100,103,101,32,108,101,110,103,116,104,32,37,102,32,108,97,114,103,101,114,32,116,104,97,110,32,109,97,120,105,109,117,109,32,37,117,32,97,108,108,111,119,101,100,46,10,67,104,101,99,107,32,102,111,114,32,111,118,101,114,119,105,100,101,32,110,111,100,101,40,115,41,46,10,0],"i8",c);eF=d([47,0],"i8",c);s2=d([47,112,114,103,110,53,47,53,0],"i8",c);t2=d([32,69,110,99,111,100,105,110,103,86,101,99,116,111,114,32,48,0],"i8",c);u2=d([79,99,105,114,99,0],"i8",c);v2=d([47,97,108,105,103,110,101,100,116,101,120,116,32,123,9,9,9,37,32,119,105,100,116,104,32,116,101,120,116,0],"i8",c);w2=d([47,112,114,103,110,53,47,52,0],"i8",c);x2=d([47,112,114,103,110,53,47,51,0],"i8",c);y2=d([47,112,114,103,110,53,47,50,0],"i8",c);wl=d([115,112,108,105,110,101,115,46,99,0],"i8",c);z2=d([47,112,114,103,110,53,47,49,0],"i8",c);A2=d([47,98,108,117,101,115,57,47,51,0],"i8",c);B2=d([47,112,114,103,110,52,47,52,0],"i8",c);uH=d([98,97,100,32,108,97,98,101,108,32,102,111,114,109,97,116,32,37,115,10,0],"i8",c);C2=d([32,32,32,32,125,10,0],"i8",c);D2=d([47,112,114,103,110,52,47,51,0],"i8",c);RT=d([102,111,110,116,45,115,116,114,101,116,99,104,58,32,37,115,59,0],"i8",c);E2=d([47,112,114,103,110,52,47,50,0],"i8",c);F2=d([47,112,114,103,110,52,47,49,0],"i8",c);G2=d([37,32,100,114,97,119,32,116,101,120,116,32,102,105,116,116,101,100,32,116,111,32,105,116,115,32,101,120,112,101,99,116,101,100,32,119,105,100,116,104,0],"i8",c);H2=d([47,112,114,103,110,51,47,51,0],"i8",c);Dz=d([108,105,103,104,116,99,111,114,97,108,0],"i8",c);$n=d([112,101,110,119,105,100,116,104,0],"i8",c);I2=d([47,112,114,103,110,51,47,50,0],"i8",c);J2=d([79,97,99,117,116,101,0],"i8",c);K2=d([47,112,114,103,110,51,47,49,0],"i8",c);L2=d([47,112,114,103,110,49,49,47,57,0],"i8",c);M2=d([105,110,118,0],"i8",c);N2=d([47,112,114,103,110,49,49,47,56,0],"i8",c);O2=d([47,112,114,103,110,49,49,47,55,0],"i8",c);P2=d([47,98,108,117,101,115,57,47,50,0],"i8",c);Q2=d([47,112,114,103,110,49,49,47,54,0],"i8",c);Ze=d([102,97,108,115,101,0],"i8",c);R2=d([32,32,32,32,32,32,32,32,100,105,102,102,117,115,101,67,111,108,111,114,32,49,32,49,32,49,10,0],"i8",c);S2=d([47,112,114,103,110,49,49,47,53,0],"i8",c);QT=d([102,111,110,116,45,119,101,105,103,104,116,58,32,37,115,59,0],"i8",c);T2=d([47,112,114,103,110,49,49,47,52,0],"i8",c);U2=d([47,112,114,103,110,49,49,47,51,0],"i8",c);V2=d([9,115,99,97,108,101,102,111,110,116,32,115,101,116,102,111,110,116,0],"i8",c);W2=d([47,112,114,103,110,49,49,47,50,0],"i8",c);Ez=d([108,105,103,104,116,98,108,117,101,0],"i8",c);Zu=d([120,108,97,98,101,108,0],"i8",c);X2=d([47,112,114,103,110,49,49,47,49,49,0],"i8",c);Y2=d([79,69,108,105,103,0],"i8",c);Z2=d([47,112,114,103,110,49,49,47,49,48,0],"i8",c);$2=d([47,112,114,103,110,49,49,47,49,0],"i8",c);a3=d([47,112,114,103,110,49,48,47,57,0],"i8",c);b3=d([47,112,114,103,110,49,48,47,56,0],"i8",c);c3=d([47,98,108,117,101,115,57,47,49,0],"i8",c);Sx=d([111,117,116,0],"i8",c);d3=d([47,112,114,103,110,49,48,47,55,0],"i8",c);ap=d([105,109,97,103,101,0],"i8",c);e3=d([32,32,32,32,32,32,97,109,98,105,101,110,116,73,110,116,101,110,115,105,116,121,32,48,46,51,51,10,0],"i8",c);f3=d([47,112,114,103,110,49,48,47,54,0],"i8",c);My=d([102,111,110,116,45,102,97,109,105,108,121,58,32,39,37,115,39,59,0],"i8",c);g3=d([47,112,114,103,110,49,48,47,53,0],"i8",c);h3=d([47,112,114,103,110,49,48,47,52,0],"i8",c);i3=d([9,102,105,110,100,102,111,110,116,32,101,120,99,104,0],"i8",c);j3=d([47,112,114,103,110,49,48,47,51,0],"i8",c);Fz=d([108,101,109,111,110,99,104,105,102,102,111,110,0],"i8",c);Eg=d([102,111,110,116,99,111,108,111,114,0],"i8",c);k3=d([47,112,114,103,110,49,48,47,50,0],"i8",c);l3=d([78,117,0],"i8",c);m3=d([47,112,114,103,110,49,48,47,49,48,0],"i8",c);n3=d([47,112,114,103,110,49,48,47,49,0],"i8",c);o3=d([99,109,97,112,120,95,110,112,58,109,97,112,0],"i8",c);p3=d([47,112,105,121,103,57,47,57,0],"i8",c);q3=d([47,112,105,121,103,57,47,56,0],"i8",c);r3=d([47,98,108,117,101,115,56,47,56,0],"i8",c);s3=d([47,112,105,121,103,57,47,55,0],"i8",c);t3=d([102,105,108,108,101,100,0,0],"i8",c);u3=d([32,32,32,32,109,97,116,101,114,105,97,108,32,77,97,116,101,114,105,97,108,32,123,10,0],"i8",c);v3=d([47,112,105,121,103,57,47,54,0],"i8",c);PT=d([60,118,58,116,101,120,116,98,111,120,32,105,110,115,101,116,61,34,48,44,48,44,48,44,48,34,32,115,116,121,108,101,61,34,112,111,115,105,116,105,111,110,58,97,98,115,111,108,117,116,101,59,32,118,45,116,101,120,116,45,119,114,97,112,112,105,110,103,58,39,102,97,108,115,101,39,59,112,97,100,100,105,110,103,58,39,48,39,59,0],"i8",c);w3=d([47,112,105,121,103,57,47,53,0],"i8",c);x3=d([47,112,105,121,103,57,47,52,0],"i8",c);y3=d([47,115,101,116,95,102,111,110,116,32,123,0],"i8",c);z3=d([47,112,105,121,103,57,47,51,0],"i8",c);Gz=d([108,97,119,110,103,114,101,101,110,0],"i8",c);tp=d([102,111,110,116,110,97,109,101,0],"i8",c);A3=d([47,97,99,99,101,110,116,52,47,50,0],"i8",c);B3=d([47,112,105,121,103,57,47,50,0],"i8",c);C3=d([78,116,105,108,100,101,0],"i8",c);D3=d([47,112,105,121,103,57,47,49,0],"i8",c);E3=d([47,112,105,121,103,56,47,56,0],"i8",c);F3=d([47,112,105,121,103,56,47,55,0],"i8",c);G3=d([47,112,105,121,103,56,47,54,0],"i8",c);H3=d([47,98,108,117,101,115,56,47,55,0],"i8",c);I3=d([47,112,105,121,103,56,47,53,0],"i8",c);J3=d([105,110,118,105,115,0,0],"i8",c);K3=d([32,32,97,112,112,101,97,114,97,110,99,101,32,65,112,112,101,97,114,97,110,99,101,32,123,10,0],"i8",c);d([32,32,32,32,37,115,9,58,32,37,115,10,0],"i8",c);L3=d([47,112,105,121,103,56,47,52,0],"i8",c);OT=d([32,115,116,114,111,107,101,100,61,34,102,97,108,115,101,34,32,102,105,108,108,101,100,61,34,102,97,108,115,101,34,62,10,0],"i8",c);M3=d([47,112,105,121,103,56,47,51,0],"i8",c);N3=d([47,112,105,121,103,56,47,50,0],"i8",c);O3=d([9,125,32,105,102,0],"i8",c);P3=d([47,112,105,121,103,56,47,49,0],"i8",c);Hz=d([108,97,118,101,110,100,101,114,98,108,117,115,104,0],"i8",c);Zt=d([101,0],"i8",c);sp=d([102,111,110,116,115,105,122,101,0],"i8",c);Q3=d([103,105,102,58,102,105,103,0],"i8",c);R3=d([47,112,105,121,103,55,47,55,0],"i8",c);S3=d([77,117,0],"i8",c);iH=d([105,110,32,99,104,101,99,107,112,97,116,104,44,32,98,111,120,101,115,32,37,100,32,97,110,100,32,37,100,32,100,111,110,39,116,32,116,111,117,99,104,10,0],"i8",c);T3=d([47,112,105,121,103,55,47,54,0],"i8",c);U3=d([47,112,105,121,103,55,47,53,0],"i8",c);PG=d([9,37,115,32,37,100,10,0],"i8",c);V3=d([47,112,105,121,103,55,47,52,0],"i8",c);W3=d([47,112,105,121,103,55,47,51,0],"i8",c);X3=d([47,98,108,117,101,115,56,47,54,0],"i8",c);Y3=d([47,112,105,121,103,55,47,50,0],"i8",c);Ik=d([35,102,56,102,56,102,56,0],"i8",c);Z3=d([83,104,97,112,101,32,123,10,0],"i8",c);$3=d([47,112,105,121,103,55,47,49,0],"i8",c);NT=d([60,118,58,114,101,99,116,32,115,116,121,108,101,61,34,112,111,115,105,116,105,111,110,58,97,98,115,111,108,117,116,101,59,32,0],"i8",c);a4=d([47,112,105,121,103,54,47,54,0],"i8",c);b4=d([47,112,105,121,103,54,47,53,0],"i8",c);JO=d([118,105,114,116,117,97,108,0],"i8",c);c4=d([9,9,103,114,101,115,116,111,114,101,0],"i8",c);d4=d([47,112,105,121,103,54,47,52,0],"i8",c);Iz=d([108,97,118,101,110,100,101,114,0],"i8",c);Rn=d([115,116,121,108,101,0],"i8",c);e4=d([47,112,105,121,103,54,47,51,0],"i8",c);f4=d([76,97,109,98,100,97,0],"i8",c);g4=d([47,112,105,121,103,54,47,50,0],"i8",c);h4=d([47,112,105,121,103,54,47,49,0],"i8",c);gE=d([98,122,46,115,105,122,101,32,37,32,51,32,61,61,32,49,0],"i8",c);i4=d([47,112,105,121,103,53,47,53,0],"i8",c);j4=d([47,112,105,121,103,53,47,52,0],"i8",c);k4=d([47,98,108,117,101,115,56,47,53,0],"i8",c);Ao=d([38,35,51,57,59,0],"i8",c);l4=d([47,112,105,121,103,53,47,51,0],"i8",c);Hk=d([35,49,48,49,48,49,48,0],"i8",c);$t=d([110,0],"i8",c);m4=d([47,112,105,121,103,53,47,50,0],"i8",c);n4=d([60,47,118,58,111,118,97,108,62,10,0],"i8",c);o4=d([47,112,105,121,103,53,47,49,0],"i8",c);p4=d([47,112,105,121,103,52,47,52,0],"i8",c);Hm=d([32,45,100,97,115,104,32,53,0],"i8",c);q4=d([75,80,95,85,112,0],"i8",c);r4=d([9,9,9,40,92,40,41,32,115,104,111,119,32,105,32,115,116,114,32,99,118,115,32,115,104,111,119,32,40,44,41,32,115,104,111,119,32,106,32,115,116,114,32,99,118,115,32,115,104,111,119,32,40,92,41,41,32,115,104,111,119,0],"i8",c);s4=d([47,112,105,121,103,52,47,51,0],"i8",c);Jz=d([107,104,97,107,105,0],"i8",c);Ak=d([102,105,108,108,99,111,108,111,114,0],"i8",c);t4=d([47,112,105,121,103,52,47,50,0],"i8",c);u4=d([75,97,112,112,97,0],"i8",c);v4=d([47,112,105,121,103,52,47,49,0],"i8",c);w4=d([47,112,105,121,103,51,47,51,0],"i8",c);fE=d([98,122,46,115,105,122,101,32,62,32,48,0],"i8",c);x4=d([47,112,105,121,103,51,47,50,0],"i8",c);y4=d([47,112,105,121,103,51,47,49,0],"i8",c);z4=d([47,98,108,117,101,115,56,47,52,0],"i8",c);yw=d([69,114,114,111,114,0],"i8",c);A4=d([47,112,105,121,103,49,49,47,57,0],"i8",c);Gk=d([35,102,48,102,48,102,48,0],"i8",c);Nr=d([111,98,106,0],"i8",c);B4=d([47,112,105,121,103,49,49,47,56,0],"i8",c);Ly=d([32,119,105,100,116,104,58,32,37,46,50,102,59,32,104,101,105,103,104,116,58,32,37,46,50,102,34,0],"i8",c);BO=d([123,37,115,125,0],"i8",c);C4=d([47,112,105,121,103,49,49,47,55,0],"i8",c);mt=d([91,105,110,116,101,114,110,97,108,32,97,114,105,97,108,93,0],"i8",c);D4=d([47,112,105,121,103,49,49,47,54,0],"i8",c);E4=d([9,9,9,48,32,48,32,109,111,118,101,116,111,0],"i8",c);F4=d([47,112,105,121,103,49,49,47,53,0],"i8",c);Kz=d([105,118,111,114,121,0],"i8",c);kh=d([99,111,108,111,114,0],"i8",c);G4=d([47,112,105,121,103,49,49,47,52,0],"i8",c);H4=d([73,117,109,108,0],"i8",c);I4=d([47,112,105,121,103,49,49,47,51,0],"i8",c);XF=d([107,105,110,100,32,61,61,32,76,84,95,78,79,78,69,0],"i8",c);J4=d([103,118,58,100,111,116,0],"i8",c);K4=d([47,112,105,121,103,49,49,47,50,0],"i8",c);eE=d([115,112,108,45,62,115,105,122,101,32,62,32,48,0],"i8",c);Vw=d([98,101,122,45,62,115,102,108,97,103,0],"i8",c);wv=d([100,105,103,114,97,112,104,0],"i8",c);L4=d([47,112,105,121,103,49,49,47,49,49,0],"i8",c);M4=d([47,112,105,121,103,49,49,47,49,48,0],"i8",c);N4=d([47,98,108,117,101,115,56,47,51,0],"i8",c);dv=d([37,100,0],"i8",c);Lv=d([99,97,110,110,111,116,32,114,101,97,108,108,111,99,32,111,112,115,0],"i8",c);O4=d([47,112,105,121,103,49,49,47,49,0],"i8",c);Fk=d([35,101,48,101,48,101,48,0],"i8",c);Mm=d([103,114,101,115,116,111,114,101,10,0],"i8",c);P4=d([47,112,105,121,103,49,48,47,57,0],"i8",c);XC=d([37,100,32,98,101,122,105,101,114,115,32,37,100,32,112,111,105,110,116,115,10,0],"i8",c);Ky=d([32,108,101,102,116,58,32,37,46,50,102,59,32,116,111,112,58,32,37,46,50,102,59,0],"i8",c);d([77,105,115,115,105,110,103,32,97,114,103,117,109,101,110,116,32,102,111,114,32,45,69,32,102,108,97,103,10,0],"i8",c);jK=d([78,111,32,108,105,98,122,32,115,117,112,112,111,114,116,10,0],"i8",c);oI=d([69,79,70,0],"i8",c);Q4=d([47,112,105,121,103,49,48,47,56,0],"i8",c);R4=d([68,105,110,103,98,97,116,115,0],"i8",c);S4=d([47,112,105,121,103,49,48,47,55,0],"i8",c);T4=d([9,9,9,99,111,111,114,100,102,111,110,116,32,115,101,116,102,111,110,116,0],"i8",c);U4=d([47,112,105,121,103,49,48,47,54,0],"i8",c);Lz=d([105,110,100,105,103,111,0],"i8",c);fJ=d([115,104,97,112,101,0],"i8",c);Mz=d([97,122,117,114,101,0],"i8",c);V4=d([47,112,105,121,103,49,48,47,53,0],"i8",c);W4=d([73,111,116,97,0],"i8",c);X4=d([47,112,105,121,103,49,48,47,52,0],"i8",c);Y4=d([47,112,105,121,103,49,48,47,51,0],"i8",c);Ot=d([115,104,97,112,101,115,46,99,0],"i8",c);Z4=d([115,101,116,108,105,110,101,119,105,100,116,104,0,49,0,0],"i8",c);$4=d([47,112,105,121,103,49,48,47,50,0],"i8",c);a5=d([47,112,105,121,103,49,48,47,49,48,0],"i8",c);b5=d([47,98,108,117,101,115,56,47,50,0],"i8",c);c5=d([112,110,103,58,115,118,103,0],"i8",c);d5=d([47,112,105,121,103,49,48,47,49,0],"i8",c);Ek=d([35,101,56,101,56,101,56,0],"i8",c);lU=d([117,115,101,114,95,115,104,97,112,101,95,37,100,10,0],"i8",c);e5=d([47,112,97,115,116,101,108,50,56,47,56,0],"i8",c);f5=d([32,32,60,118,58,111,118,97,108,32,115,116,121,108,101,61,34,112,111,115,105,116,105,111,110,58,97,98,115,111,108,117,116,101,59,0],"i8",c);g5=d([47,112,97,115,116,101,108,50,56,47,55,0],"i8",c);h5=d([90,97,112,102,68,105,110,103,98,97,116,115,0],"i8",c);i5=d([47,112,97,115,116,101,108,50,56,47,54,0],"i8",c);wQ=d([97,103,116,97,105,108,40,101,41,32,61,61,32,85,70,95,102,105,110,100,40,97,103,116,97,105,108,40,101,41,41,0],"i8",c);j5=d([9,9,103,115,97,118,101,0],"i8",c);k5=d([47,112,97,115,116,101,108,50,56,47,53,0],"i8",c);Nz=d([105,110,100,105,97,110,114,101,100,0],"i8",c);jQ=d([99,111,110,116,97,105,110,95,110,111,100,101,115,32,99,108,117,115,116,32,37,115,32,114,97,110,107,32,37,100,32,109,105,115,115,105,110,103,32,110,111,100,101,10,0],"i8",c);l5=d([47,112,97,115,116,101,108,50,56,47,52,0],"i8",c);dF=d([37,115,37,115,37,115,0],"i8",c);m5=d([47,69,110,99,111,100,105,110,103,86,101,99,116,111,114,32,50,53,54,32,97,114,114,97,121,32,100,101,102,0],"i8",c);n5=d([73,103,114,97,118,101,0],"i8",c);o5=d([47,112,97,115,116,101,108,50,56,47,51,0],"i8",c);EK=d([105,110,118,105,115,105,98,108,101,0],"i8",c);p5=d([47,112,97,115,116,101,108,50,56,47,50,0],"i8",c);q5=d([115,111,108,105,100,0,0],"i8",c);r5=d([47,112,97,115,116,101,108,50,56,47,49,0],"i8",c);s5=d([47,112,97,115,116,101,108,50,55,47,55,0],"i8",c);t5=d([47,98,108,117,101,115,56,47,49,0],"i8",c);u5=d([47,112,97,115,116,101,108,50,55,47,54,0],"i8",c);Dk=d([35,51,48,51,48,51,48,0],"i8",c);kU=d([103,115,97,118,101,32,37,103,32,37,103,32,116,114,97,110,115,108,97,116,101,32,110,101,119,112,97,116,104,10,0],"i8",c);v5=d([47,112,97,115,116,101,108,50,55,47,53,0],"i8",c);w5=d([120,32,101,32,34,47,62,0],"i8",c);x5=d([47,112,97,115,116,101,108,50,55,47,52,0],"i8",c);bO=d([99,97,110,110,111,116,32,97,108,108,111,99,97,116,101,32,112,115,10,0],"i8",c);y5=d([109,101,100,105,117,109,0],"i8",c);z5=d([47,112,97,115,116,101,108,50,55,47,51,0],"i8",c);A5=d([9,110,112,97,103,101,115,32,49,32,103,116,32,123,0],"i8",c);B5=d([47,112,97,115,116,101,108,50,55,47,50,0],"i8",c);Oz=d([104,111,116,112,105,110,107,0],"i8",c);wK=d([100,121,110,97,109,105,99,32,108,111,97,100,105,110,103,32,110,111,116,32,97,118,97,105,108,97,98,108,101,10,0],"i8",c);C5=d([47,112,97,115,116,101,108,50,55,47,49,0],"i8",c);D5=d([73,99,105,114,99,0],"i8",c);E5=d([47,112,97,115,116,101,108,50,54,47,54,0],"i8",c);F5=d([47,112,97,115,116,101,108,50,54,47,53,0],"i8",c);WG=d([47,112,97,116,104,98,111,120,32,123,10,32,32,32,32,47,88,32,101,120,99,104,32,110,101,103,32,37,46,53,103,32,115,117,98,32,100,101,102,10,32,32,32,32,47,89,32,101,120,99,104,32,37,46,53,103,32,115,117,98,32,100,101,102,10,32,32,32,32,47,120,32,101,120,99,104,32,110,101,103,32,37,46,53,103,32,115,117,98,32,100,101,102,10,32,32,32,32,47,121,32,101,120,99,104,32,37,46,53,103,32,115,117,98,32,100,101,102,10,32,32,32,32,110,101,119,112,97,116,104,32,120,32,121,32,109,111,118,101,116,111,10,32,32,32,32,88,32,121,32,108,105,110,101,116,111,10,32,32,32,32,88,32,89,32,108,105,110,101,116,111,10,32,32,32,32,120,32,89,32,108,105,110,101,116,111,10,32,32,32,32,99,108,111,115,101,112,97,116,104,32,115,116,114,111,107,101,10,125,32,100,101,102,10,0],"i8",c);G5=d([47,112,97,115,116,101,108,50,54,47,52,0],"i8",c);H5=d([47,112,97,115,116,101,108,50,54,47,51,0],"i8",c);I5=d([47,98,108,117,101,115,55,47,55,0],"i8",c);J5=d([47,112,97,115,116,101,108,50,54,47,50,0],"i8",c);Kk=d([35,102,99,102,99,102,99,0],"i8",c);K5=d([93,32,32,37,100,32,102,97,108,115,101,32,37,115,10,0],"i8",c);L5=d([47,112,97,115,116,101,108,50,54,47,49,0],"i8",c);M5=d([108,32,0],"i8",c);N5=d([47,112,97,115,116,101,108,50,53,47,53,0],"i8",c);O5=d([85,82,87,32,67,104,97,110,99,101,114,121,32,76,0],"i8",c);P5=d([47,112,97,115,116,101,108,50,53,47,52,0],"i8",c);Q5=d([9,47,115,116,114,32,49,48,32,115,116,114,105,110,103,32,100,101,102,0],"i8",c);R5=d([47,112,97,115,116,101,108,50,53,47,51,0],"i8",c);Pz=d([104,111,110,101,121,100,101,119,0],"i8",c);Xu=d([111,114,100,101,114,105,110,103,0],"i8",c);S5=d([47,112,97,115,116,101,108,50,53,47,50,0],"i8",c);T5=d([73,97,99,117,116,101,0],"i8",c);U5=d([47,112,97,115,116,101,108,50,53,47,49,0],"i8",c);Po=d([110,101,116,119,111,114,107,32,115,105,109,112,108,101,120,58,32,0],"i8",c);V5=d([47,112,97,115,116,101,108,50,52,47,52,0],"i8",c);W5=d([47,112,97,115,116,101,108,50,52,47,51,0],"i8",c);X5=d([47,112,97,115,116,101,108,50,52,47,50,0],"i8",c);Y5=d([47,98,108,117,101,115,55,47,54,0],"i8",c);Z5=d([47,112,97,115,116,101,108,50,52,47,49,0],"i8",c);Jk=d([35,56,48,56,48,56,48,0],"i8",c);$5=d([93,32,32,37,100,32,116,114,117,101,32,37,115,10,0],"i8",c);Qx=d([78,68,95,111,114,100,101,114,40,118,41,32,60,32,78,68,95,111,114,100,101,114,40,119,41,0],"i8",c);a6=d([47,112,97,115,116,101,108,50,51,47,51,0],"i8",c);Qz=d([37,46,48,102,32,37,46,48,102,32,0],"i8",c);b6=d([47,112,97,115,116,101,108,50,51,47,50,0],"i8",c);c6=d([90,97,112,102,67,104,97,110,99,101,114,121,45,77,101,100,105,117,109,73,116,97,108,105,99,0],"i8",c);d6=d([47,112,97,115,116,101,108,50,51,47,49,0],"i8",c);e6=d([9,47,105,32,101,120,99,104,32,100,101,102,0],"i8",c);f6=d([47,112,97,115,116,101,108,49,57,47,57,0],"i8",c);Rz=d([103,114,101,121,0],"i8",c);eJ=d([114,101,115,111,108,117,116,105,111,110,0],"i8",c);g6=d([47,112,97,115,116,101,108,49,57,47,56,0],"i8",c);h6=d([71,97,109,109,97,0],"i8",c);i6=d([47,112,97,115,116,101,108,49,57,47,55,0],"i8",c);MM=d([115,121,110,116,97,120,32,101,114,114,111,114,0],"i8",c);j6=d([47,112,97,115,116,101,108,49,57,47,54,0],"i8",c);k6=d([47,112,97,115,116,101,108,49,57,47,53,0],"i8",c);l6=d([105,109,97,112,95,110,112,58,109,97,112,0],"i8",c);m6=d([47,112,97,115,116,101,108,49,57,47,52,0],"i8",c);n6=d([47,98,108,117,101,115,55,47,53,0],"i8",c);o6=d([47,112,97,115,116,101,108,49,57,47,51,0],"i8",c);sf=d([37,103,32,37,103,32,0],"i8",c);p6=d([47,112,97,115,116,101,108,49,57,47,50,0],"i8",c);gU=d([32,102,105,108,108,101,100,61,34,102,97,108,115,101,34,32,0],"i8",c);q6=d([47,112,97,115,116,101,108,49,57,47,49,0],"i8",c);r6=d([47,112,97,115,116,101,108,49,56,47,56,0],"i8",c);s6=d([9,47,106,32,101,120,99,104,32,100,101,102,0],"i8",c);t6=d([47,112,97,115,116,101,108,49,56,47,55,0],"i8",c);Sz=d([103,114,101,101,110,121,101,108,108,111,119,0],"i8",c);dJ=d([100,112,105,0],"i8",c);u6=d([47,97,99,99,101,110,116,52,47,49,0],"i8",c);v6=d([47,112,97,115,116,101,108,49,56,47,54,0],"i8",c);w6=d([69,117,109,108,0],"i8",c);x6=d([47,112,97,115,116,101,108,49,56,47,53,0],"i8",c);y6=d([47,112,97,115,116,101,108,49,56,47,52,0],"i8",c);WD=d([112,97,103,101,100,105,114,0],"i8",c);z6=d([47,112,97,115,116,101,108,49,56,47,51,0],"i8",c);A6=d([47,112,97,115,116,101,108,49,56,47,50,0],"i8",c);B6=d([47,98,108,117,101,115,55,47,52,0],"i8",c);C6=d([47,112,97,115,116,101,108,49,56,47,49,0],"i8",c);JH=d([100,105,97,103,111,110,97,108,115,0],"i8",c);an=d([91,32,0],"i8",c);D6=d([47,112,97,115,116,101,108,49,55,47,55,0],"i8",c);iU=d([34,32,0],"i8",c);d([117,110,114,101,99,111,103,110,105,122,101,100,32,97,112,105,32,110,97,109,101,32,34,37,115,34,10,0],"i8",c);E6=d([47,112,97,115,116,101,108,49,55,47,54,0],"i8",c);F6=d([47,112,97,115,116,101,108,49,55,47,53,0],"i8",c);G6=d([84,105,109,101,115,45,73,116,97,108,105,99,0],"i8",c);H6=d([9,47,110,112,97,103,101,115,32,101,120,99,104,32,100,101,102,0],"i8",c);I6=d([47,112,97,115,116,101,108,49,55,47,52,0],"i8",c);cJ=d([99,111,110,99,101,110,116,114,97,116,101,0],"i8",c);zH=d([115,0],"i8",c);J6=d([112,110,103,58,102,105,103,0],"i8",c);K6=d([47,112,97,115,116,101,108,49,55,47,51,0],"i8",c);L6=d([69,116,97,0],"i8",c);Nt=d([105,110,32,99,104,101,99,107,112,97,116,104,44,32,98,111,120,32,37,100,32,104,97,115,32,76,76,32,99,111,111,114,100,32,62,32,85,82,32,99,111,111,114,100,10,0],"i8",c);M6=d([47,112,97,115,116,101,108,49,55,47,50,0],"i8",c);N6=d([47,112,97,115,116,101,108,49,55,47,49,0],"i8",c);VD=d([66,76,0],"i8",c);OG=d([116,114,111,117,98,108,101,32,105,110,32,105,110,105,116,95,114,97,110,107,10,0],"i8",c);O6=d([47,112,97,115,116,101,108,49,54,47,54,0],"i8",c);P6=d([47,112,97,115,116,101,108,49,54,47,53,0],"i8",c);Q6=d([47,98,108,117,101,115,55,47,51,0],"i8",c);R6=d([47,112,97,115,116,101,108,49,54,47,52,0],"i8",c);Vr=d([114,111,117,110,100,101,100,0],"i8",c);Ph=d([117,115,45,62,110,97,109,101,0],"i8",c);S6=d([47,112,97,115,116,101,108,49,54,47,51,0],"i8",c);hU=d([32,102,105,108,108,101,100,61,34,116,114,117,101,34,32,102,105,108,108,99,111,108,111,114,61,34,0],"i8",c);T6=d([47,112,97,115,116,101,108,49,54,47,50,0],"i8",c);d([99,111,108,103,0],"i8",c);U6=d([47,112,97,115,116,101,108,49,54,47,49,0],"i8",c);V6=d([84,105,109,101,115,45,66,111,108,100,73,116,97,108,105,99,0],"i8",c);W6=d([47,98,101,103,105,110,112,97,103,101,32,123,9,37,32,105,32,106,32,110,112,97,103,101,115,0],"i8",c);X6=d([47,112,97,115,116,101,108,49,53,47,53,0],"i8",c);aJ=d([99,108,117,115,116,101,114,114,97,110,107,0],"i8",c);IO=d([102,105,110,100,95,102,97,115,116,95,110,111,100,101,40,103,44,32,110,41,0],"i8",c);Y6=d([47,112,97,115,116,101,108,49,53,47,52,0],"i8",c);Z6=d([69,112,115,105,108,111,110,0],"i8",c);$6=d([47,112,97,115,116,101,108,49,53,47,51,0],"i8",c);a7=d([47,112,97,115,116,101,108,49,53,47,50,0],"i8",c);UD=d([112,97,100,0],"i8",c);b7=d([47,112,97,115,116,101,108,49,53,47,49,0],"i8",c);c7=d([47,112,97,115,116,101,108,49,52,47,52,0],"i8",c);d7=d([47,98,108,117,101,115,55,47,50,0],"i8",c);zo=d([38,113,117,111,116,59,0],"i8",c);e7=d([47,112,97,115,116,101,108,49,52,47,51,0],"i8",c);Oh=d([117,115,0],"i8",c);f7=d([47,112,97,115,116,101,108,49,52,47,50,0],"i8",c);ue=d([34,0],"i8",c);g7=d([47,112,97,115,116,101,108,49,52,47,49,0],"i8",c);h7=d([47,112,97,115,116,101,108,49,51,47,51,0],"i8",c);bn=d([84,105,109,101,115,0],"i8",c);Lj=d([32,45,102,105,108,108,32,0],"i8",c);i7=d([47,110,111,112,99,111,108,111,114,32,123,112,111,112,32,112,111,112,32,112,111,112,125,32,98,105,110,100,32,100,101,102,0],"i8",c);j7=d([47,112,97,115,116,101,108,49,51,47,50,0],"i8",c);Tz=d([103,111,108,100,101,110,114,111,100,0],"i8",c);$I=d([108,97,110,100,115,99,97,112,101,0],"i8",c);k7=d([85,112,0],"i8",c);l7=d([47,112,97,115,116,101,108,49,51,47,49,0],"i8",c);m7=d([69,103,114,97,118,101,0],"i8",c);n7=d([47,112,97,105,114,101,100,57,47,57,0],"i8",c);o7=d([47,112,97,105,114,101,100,57,47,56,0],"i8",c);p7=d([47,112,97,105,114,101,100,57,47,55,0],"i8",c);q7=d([47,112,97,105,114,101,100,57,47,54,0],"i8",c);r7=d([47,98,108,117,101,115,55,47,49,0],"i8",c);s7=d([47,112,97,105,114,101,100,57,47,53,0],"i8",c);Nj=d([106,111,98,0],"i8",c);vM=d([37,115,58,32,0],"i8",c);t7=d([47,112,97,105,114,101,100,57,47,52,0],"i8",c);Y=d(1,"i8",c);u7=d([47,112,97,105,114,101,100,57,47,51,0],"i8",c);iG=d([104,101,108,118,101,116,105,99,97,0],"i8",c);yO=d([49,48,48,48,48,0],"i8",c);v7=d([47,112,97,105,114,101,100,57,47,50,0],"i8",c);w7=d([84,105,109,101,115,45,66,111,108,100,0],"i8",c);x7=d([47,103,114,97,112,104,99,111,108,111,114,32,123,32,115,101,116,104,115,98,99,111,108,111,114,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);y7=d([47,112,97,105,114,101,100,57,47,49,0],"i8",c);Uz=d([103,111,108,100,0],"i8",c);Uu=d([111,114,105,101,110,116,97,116,105,111,110,0],"i8",c);z7=d([47,112,97,105,114,101,100,56,47,56,0],"i8",c);A7=d([69,99,105,114,99,0],"i8",c);B7=d([47,112,97,105,114,101,100,56,47,55,0],"i8",c);VF=d([108,97,98,101,108,115,46,99,0],"i8",c);C7=d([100,111,116,58,100,111,116,0],"i8",c);D7=d([47,112,97,105,114,101,100,56,47,54,0],"i8",c);zj=d([99,111,109,112,111,117,110,100,46,99,0],"i8",c);E7=d([47,112,97,105,114,101,100,56,47,53,0],"i8",c);d([83,121,110,116,97,120,32,101,114,114,111,114,58,32,110,111,110,45,115,112,97,99,101,32,115,116,114,105,110,103,32,117,115,101,100,32,98,101,102,111,114,101,32,60,84,65,66,76,69,62,0],"i8",c);YL=d([115,116,114,105,99,116,32,0],"i8",c);F7=d([47,112,97,105,114,101,100,56,47,52,0],"i8",c);G7=d([47,98,108,117,101,115,54,47,54,0],"i8",c);dd=d([108,105,98,112,97,116,104,47,37,115,58,37,100,58,32,37,115,10,0],"i8",c);H7=d([47,112,97,105,114,101,100,56,47,51,0],"i8",c);pd=d([103,118,108,111,97,100,105,109,97,103,101,95,99,111,114,101,46,99,0],"i8",c);I7=d([47,112,97,105,114,101,100,56,47,50,0],"i8",c);d([37,115,32,105,110,32,108,105,110,101,32,37,100,32,10,0],"i8",c);ly=d([99,32,0],"i8",c);d([77,105,115,115,105,110,103,32,97,114,103,117,109,101,110,116,32,102,111,114,32,45,78,32,102,108,97,103,10,0],"i8",c);J7=d([47,112,97,105,114,101,100,56,47,49,0],"i8",c);nI=d([99,97,110,39,116,32,111,112,101,110,32,108,105,98,114,97,114,121,32,102,105,108,101,32,37,115,10,0],"i8",c);WC=d([37,100,32,112,111,108,121,108,105,110,101,115,32,37,100,32,112,111,105,110,116,115,10,0],"i8",c);K7=d([47,112,97,105,114,101,100,55,47,55,0],"i8",c);Vz=d([102,97,110,116,97,115,121,0],"i8",c);L7=d([47,101,100,103,101,99,111,108,111,114,32,123,32,115,101,116,104,115,98,99,111,108,111,114,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);M7=d([47,112,97,105,114,101,100,55,47,54,0],"i8",c);Wz=d([103,104,111,115,116,119,104,105,116,101,0],"i8",c);ZI=d([114,111,116,97,116,101,0],"i8",c);Xz=d([97,113,117,97,109,97,114,105,110,101,0],"i8",c);N7=d([47,112,97,105,114,101,100,55,47,53,0],"i8",c);O7=d([69,97,99,117,116,101,0],"i8",c);P7=d([47,112,97,105,114,101,100,55,47,52,0],"i8",c);Q7=d([47,112,97,105,114,101,100,55,47,51,0],"i8",c);cE=d([58,9,32,0],"i8",c);R7=d([47,112,97,105,114,101,100,55,47,50,0],"i8",c);KL=d([1,112,114,111,116,111,0],"i8",c);S7=d([47,112,97,105,114,101,100,55,47,49,0],"i8",c);T7=d([47,98,108,117,101,115,54,47,53,0],"i8",c);U7=d([47,112,97,105,114,101,100,54,47,54,0],"i8",c);V7=d([32,47,62,10,0],"i8",c);W7=d([47,112,97,105,114,101,100,54,47,53,0],"i8",c);X7=d([37,115,37,46,48,102,44,37,46,48,102,32,0],"i8",c);Y7=d([47,112,97,105,114,101,100,54,47,52,0],"i8",c);Z7=d([47,112,97,105,114,101,100,54,47,51,0],"i8",c);Yz=d([83,121,109,98,111,108,0],"i8",c);vQ=d([97,103,104,101,97,100,40,101,41,32,61,61,32,85,70,95,102,105,110,100,40,97,103,104,101,97,100,40,101,41,41,0],"i8",c);$7=d([47,110,111,100,101,99,111,108,111,114,32,123,32,115,101,116,104,115,98,99,111,108,111,114,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);a8=d([47,112,97,105,114,101,100,54,47,50,0],"i8",c);Zz=d([103,97,105,110,115,98,111,114,111,0],"i8",c);QK=d([34,37,115,34,32,119,97,115,32,110,111,116,32,102,111,117,110,100,32,97,115,32,97,32,102,105,108,101,32,111,114,32,97,115,32,97,32,115,104,97,112,101,32,108,105,98,114,97,114,121,32,109,101,109,98,101,114,10,0],"i8",c);YI=d([99,101,110,116,101,114,0],"i8",c);gQ=d([110,101,120,116,35,105,116,101,114,61,37,100,10,0],"i8",c);b8=d([47,112,97,105,114,101,100,54,47,49,0],"i8",c);cF=d([80,97,116,104,32,112,114,111,118,105,100,101,100,32,116,111,32,102,105,108,101,58,32,34,37,115,34,32,104,97,115,32,98,101,101,110,32,105,103,110,111,114,101,100,32,98,101,99,97,117,115,101,32,102,105,108,101,115,32,97,114,101,32,111,110,108,121,32,112,101,114,109,105,116,116,101,100,32,116,111,32,98,101,32,108,111,97,100,101,100,32,102,114,111,109,32,116,104,101,32,100,105,114,101,99,116,111,114,105,101,115,32,105,110,32,34,37,115,34,32,119,104,101,110,32,114,117,110,110,105,110,103,32,105,110,32,97,110,32,104,116,116,112,32,115,101,114,118,101,114,46,10,0],"i8",c);c8=d([109,97,114,107,0],"i8",c);d8=d([69,84,72,0],"i8",c);Kv=d([99,97,110,110,111,116,32,109,97,108,108,111,99,32,111,112,115,0],"i8",c);e8=d([47,112,97,105,114,101,100,53,47,53,0],"i8",c);f8=d([47,112,97,105,114,101,100,53,47,52,0],"i8",c);bE=d([108,97,121,101,114,115,101,112,0],"i8",c);g8=d([47,112,97,105,114,101,100,53,47,51,0],"i8",c);h8=d([47,112,97,105,114,101,100,53,47,50,0],"i8",c);i8=d([47,98,108,117,101,115,54,47,52,0],"i8",c);j8=d([47,112,97,105,114,101,100,53,47,49,0],"i8",c);EH=d([110,111,100,101,32,37,115,44,32,112,111,114,116,32,37,115,32,117,110,114,101,99,111,103,110,105,122,101,100,10,0],"i8",c);k8=d([60,118,58,105,109,97,103,101,32,115,114,99,61,34,37,115,34,32,115,116,121,108,101,61,34,32,112,111,115,105,116,105,111,110,58,97,98,115,111,108,117,116,101,59,32,119,105,100,116,104,58,37,46,50,102,59,32,104,101,105,103,104,116,58,37,46,50,102,59,32,108,101,102,116,58,37,46,50,102,32,59,32,116,111,112,58,37,46,50,102,34,0],"i8",c);l8=d([47,112,97,105,114,101,100,52,47,52,0],"i8",c);$z=d([109,32,0],"i8",c);m8=d([47,112,97,105,114,101,100,52,47,51,0],"i8",c);n8=d([47,112,97,105,114,101,100,52,47,50,0],"i8",c);o8=d([80,97,108,97,116,105,110,111,45,82,111,109,97,110,0],"i8",c);p8=d([37,32,104,111,111,107,115,32,102,111,114,32,115,101,116,116,105,110,103,32,99,111,108,111,114,32,0],"i8",c);q8=d([47,112,97,105,114,101,100,52,47,49,0],"i8",c);XI=d([112,97,103,101,0],"i8",c);r8=d([47,112,97,105,114,101,100,51,47,51,0],"i8",c);s8=d([68,101,108,116,97,0],"i8",c);t8=d([47,112,97,105,114,101,100,51,47,50,0],"i8",c);u8=d([47,112,97,105,114,101,100,51,47,49,0],"i8",c);ID=d([108,97,121,101,114,115,0],"i8",c);v8=d([47,112,97,105,114,101,100,49,50,47,57,0],"i8",c);w8=d([47,112,97,105,114,101,100,49,50,47,56,0],"i8",c);x8=d([47,98,108,117,101,115,54,47,51,0],"i8",c);y8=d([47,112,97,105,114,101,100,49,50,47,55,0],"i8",c);du=d([110,111,100,101,32,37,115,44,32,112,111,114,116,32,37,115,44,32,117,110,114,101,99,111,103,110,105,122,101,100,32,99,111,109,112,97,115,115,32,112,111,105,110,116,32,39,37,115,39,32,45,32,105,103,110,111,114,101,100,10,0],"i8",c);z8=d([106,112,103,58,118,109,108,0],"i8",c);A8=d([47,112,97,105,114,101,100,49,50,47,54,0],"i8",c);B8=d([47,62,60,47,118,58,115,104,97,112,101,62,10,0],"i8",c);C8=d([47,112,97,105,114,101,100,49,50,47,53,0],"i8",c);D8=d([47,112,97,105,114,101,100,49,50,47,52,0],"i8",c);E8=d([80,97,108,97,116,105,110,111,45,73,116,97,108,105,99,0],"i8",c);F8=d([47,100,105,97,103,111,110,97,108,115,32,123,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);G8=d([47,112,97,105,114,101,100,49,50,47,51,0],"i8",c);aA=d([102,111,114,101,115,116,103,114,101,101,110,0],"i8",c);WI=d([115,105,122,101,0],"i8",c);H8=d([47,112,97,105,114,101,100,49,50,47,50,0],"i8",c);I8=d([68,97,103,103,101,114,0],"i8",c);J8=d([47,112,97,105,114,101,100,49,50,47,49,50,0],"i8",c);K8=d([47,112,97,105,114,101,100,49,50,47,49,49,0],"i8",c);ND=d([100,103,101,115,102,105,114,115,116,0],"i8",c);L8=d([47,112,97,105,114,101,100,49,50,47,49,48,0],"i8",c);M8=d([47,112,97,105,114,101,100,49,50,47,49,0],"i8",c);N8=d([47,98,108,117,101,115,54,47,50,0],"i8",c);O8=d([47,112,97,105,114,101,100,49,49,47,57,0],"i8",c);cu=d([95,0],"i8",c);P8=d([106,112,101,58,118,109,108,0],"i8",c);Q8=d([47,112,97,105,114,101,100,49,49,47,56,0],"i8",c);mP=d([115,117,114,112,114,105,115,101,10,0],"i8",c);bA=d([60,118,58,112,97,116,104,32,32,118,61,34,0],"i8",c);R8=d([47,112,97,105,114,101,100,49,49,47,55,0],"i8",c);S8=d([47,112,97,105,114,101,100,49,49,47,54,0],"i8",c);T8=d([80,97,108,97,116,105,110,111,45,66,111,108,100,73,116,97,108,105,99,0],"i8",c);U8=d([47,114,111,117,110,100,101,100,32,123,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);V8=d([47,112,97,105,114,101,100,49,49,47,53,0],"i8",c);cA=d([102,108,111,114,97,108,119,104,105,116,101,0],"i8",c);TI=d([102,111,110,116,110,97,109,101,115,0],"i8",c);W8=d([47,112,97,105,114,101,100,49,49,47,52,0],"i8",c);X8=d([67,104,105,0],"i8",c);Y8=d([47,112,97,105,114,101,100,49,49,47,51,0],"i8",c);Z8=d([47,112,97,105,114,101,100,49,49,47,50,0],"i8",c);MD=d([111,100,101,115,102,105,114,115,116,0],"i8",c);$8=d([47,112,97,105,114,101,100,49,49,47,49,49,0],"i8",c);a9=d([47,112,97,105,114,101,100,49,49,47,49,48,0],"i8",c);b9=d([47,98,108,117,101,115,54,47,49,0],"i8",c);c9=d([99,109,97,112,120,58,109,97,112,0],"i8",c);d9=d([47,112,97,105,114,101,100,49,49,47,49,0],"i8",c);DH=d([37,46,53,103,32,37,46,53,103,32,116,114,97,110,115,108,97,116,101,32,110,101,119,112,97,116,104,32,117,115,101,114,95,115,104,97,112,101,95,37,100,10,0],"i8",c);e9=d([106,112,101,103,58,118,109,108,0],"i8",c);f9=d([47,112,97,105,114,101,100,49,48,47,57,0],"i8",c);br=d([32,62,0],"i8",c);g9=d([47,112,97,105,114,101,100,49,48,47,56,0],"i8",c);h9=d([47,112,97,105,114,101,100,49,48,47,55,0],"i8",c);cn=d([80,97,108,97,116,105,110,111,32,76,105,110,111,116,121,112,101,0],"i8",c);i9=d([47,117,110,102,105,108,108,101,100,32,123,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);j9=d([47,112,97,105,114,101,100,49,48,47,54,0],"i8",c);qg=d([102,97,115,116,103,114,46,99,0],"i8",c);dA=d([102,105,114,101,98,114,105,99,107,0],"i8",c);pp=d([115,104,111,119,98,111,120,101,115,0],"i8",c);xo=d([38,97,109,112,59,0],"i8",c);k9=d([47,97,99,99,101,110,116,51,47,51,0],"i8",c);l9=d([47,112,97,105,114,101,100,49,48,47,53,0],"i8",c);m9=d([67,99,101,100,105,108,0],"i8",c);n9=d([47,112,97,105,114,101,100,49,48,47,52,0],"i8",c);o9=d([47,112,97,105,114,101,100,49,48,47,51,0],"i8",c);LD=d([111,117,116,112,117,116,111,114,100,101,114,0],"i8",c);p9=d([47,112,97,105,114,101,100,49,48,47,50,0],"i8",c);q9=d([47,112,97,105,114,101,100,49,48,47,49,48,0],"i8",c);r9=d([47,98,108,117,101,115,53,47,53,0],"i8",c);s9=d([47,112,97,105,114,101,100,49,48,47,49,0],"i8",c);eu=d([77,114,101,99,111,114,100,0],"i8",c);t9=d([103,105,102,58,118,109,108,0],"i8",c);u9=d([47,111,114,114,100,57,47,57,0],"i8",c);eA=d([32,119,105,100,116,104,58,32,37,100,59,32,104,101,105,103,104,116,58,32,37,100,34,0],"i8",c);v9=d([47,111,114,114,100,57,47,56,0],"i8",c);w9=d([47,111,114,114,100,57,47,55,0],"i8",c);x9=d([80,97,108,97,116,105,110,111,45,66,111,108,100,0],"i8",c);y9=d([47,102,105,108,108,101,100,32,123,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);z9=d([47,111,114,114,100,57,47,54,0],"i8",c);fA=d([100,111,100,103,101,114,98,108,117,101,0],"i8",c);SI=d([101,113,117,97,108,108,121,0],"i8",c);th=d([99,117,115,116,111,109,0],"i8",c);A9=d([106,112,103,58,115,118,103,0],"i8",c);B9=d([47,111,114,114,100,57,47,53,0],"i8",c);C9=d([66,101,116,97,0],"i8",c);D9=d([47,111,114,114,100,57,47,52,0],"i8",c);Mt=d([105,110,32,99,104,101,99,107,112,97,116,104,44,32,98,111,120,32,48,32,104,97,115,32,76,76,32,99,111,111,114,100,32,62,32,85,82,32,99,111,111,114,100,10,0],"i8",c);E9=d([47,111,114,114,100,57,47,51,0],"i8",c);$D=d([37,108,102,44,37,108,102,44,37,108,102,44,37,108,102,44,37,108,102,0],"i8",c);NG=d([37,115,37,100,32,110,111,100,101,115,32,37,100,32,101,100,103,101,115,32,37,100,32,105,116,101,114,32,37,46,50,102,32,115,101,99,10,0],"i8",c);F9=d([47,111,114,114,100,57,47,50,0],"i8",c);G9=d([47,111,114,114,100,57,47,49,0],"i8",c);H9=d([47,98,108,117,101,115,53,47,52,0],"i8",c);I9=d([47,111,114,114,100,56,47,56,0],"i8",c);J9=d([112,110,103,58,118,109,108,0],"i8",c);K9=d([47,111,114,114,100,56,47,55,0],"i8",c);vd=d([48,0],"i8",c);L9=d([47,111,114,114,100,56,47,54,0],"i8",c);d([114,111,119,103,0],"i8",c);M9=d([47,111,114,114,100,56,47,53,0],"i8",c);gA=d([114,111,109,97,110,0],"i8",c);N9=d([47,98,111,108,100,32,123,32,50,32,115,101,116,108,105,110,101,119,105,100,116,104,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);O9=d([47,111,114,114,100,56,47,52,0],"i8",c);hA=d([100,105,109,103,114,101,121,0],"i8",c);P9=d([47,111,114,114,100,56,47,51,0],"i8",c);Q9=d([65,117,109,108,0],"i8",c);bQ=d([78,68,95,110,101,120,116,40,118,41,32,61,61,32,78,85,76,76,0],"i8",c);R9=d([47,111,114,114,100,56,47,50,0],"i8",c);S9=d([47,111,114,114,100,56,47,49,0],"i8",c);ZD=d([37,108,102,44,37,108,102,44,37,108,102,44,37,91,94,44,93,37,115,0],"i8",c);T9=d([47,111,114,114,100,55,47,55,0],"i8",c);U9=d([47,111,114,114,100,55,47,54,0],"i8",c);V9=d([47,98,108,117,101,115,53,47,51,0],"i8",c);lt=d([38,35,49,54,48,59,0],"i8",c);W9=d([47,111,114,114,100,55,47,53,0],"i8",c);X9=d([77,99,105,114,99,108,101,0],"i8",c);iA=d([115,118,103,58,115,118,103,0],"i8",c);Y9=d([47,111,114,114,100,55,47,52,0],"i8",c);Ny=d([103,118,114,101,110,100,101,114,95,99,111,114,101,95,118,109,108,46,99,0],"i8",c);Z9=d([47,111,114,114,100,55,47,51,0],"i8",c);$9=d([47,111,114,114,100,55,47,50,0],"i8",c);a$=d([78,101,119,67,101,110,116,117,114,121,83,99,104,108,98,107,45,82,111,109,97,110,0],"i8",c);jA=d([32,99,114,101,97,116,101,32,108,105,110,101,32,0],"i8",c);b$=d([47,105,110,118,105,115,32,123,47,102,105,108,108,32,123,110,101,119,112,97,116,104,125,32,100,101,102,32,47,115,116,114,111,107,101,32,123,110,101,119,112,97,116,104,125,32,100,101,102,32,47,115,104,111,119,32,123,112,111,112,32,110,101,119,112,97,116,104,125,32,100,101,102,125,32,98,105,110,100,32,100,101,102,0],"i8",c);c$=d([47,111,114,114,100,55,47,49,0],"i8",c);kA=d([100,105,109,103,114,97,121,0],"i8",c);PI=d([110,111,100,101,115,101,112,0],"i8",c);d$=d([47,111,114,114,100,54,47,54,0],"i8",c);e$=d([65,116,105,108,100,101,0],"i8",c);f$=d([75,80,95,82,105,103,104,116,0],"i8",c);g$=d([47,111,114,114,100,54,47,53,0],"i8",c);h$=d([47,111,114,114,100,54,47,52,0],"i8",c);YD=d([37,108,102,44,37,108,102,44,37,108,102,44,39,37,91,94,39,93,39,0],"i8",c);i$=d([47,111,114,114,100,54,47,51,0],"i8",c);j$=d([47,111,114,114,100,54,47,50,0],"i8",c);k$=d([47,98,108,117,101,115,53,47,50,0],"i8",c);l$=d([47,111,114,114,100,54,47,49,0],"i8",c);m$=d([77,115,113,117,97,114,101,0],"i8",c);n$=d([115,118,103,58,120,100,111,116,0],"i8",c);o$=d([47,111,114,114,100,53,47,53,0],"i8",c);Yl=d([60,117,110,107,110,111,119,110,62,0],"i8",c);Iq=d([35,37,48,50,120,37,48,50,120,37,48,50,120,0],"i8",c);p$=d([47,111,114,114,100,53,47,52,0],"i8",c);hG=d([97,114,105,97,108,0],"i8",c);q$=d([47,111,114,114,100,53,47,51,0],"i8",c);r$=d([78,101,119,67,101,110,116,117,114,121,83,99,104,108,98,107,45,73,116,97,108,105,99,0],"i8",c);s$=d([47,100,111,116,116,101,100,32,123,32,91,49,32,73,110,118,83,99,97,108,101,70,97,99,116,111,114,32,109,117,108,32,54,32,73,110,118,83,99,97,108,101,70,97,99,116,111,114,32,109,117,108,93,32,48,32,115,101,116,100,97,115,104,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);t$=d([47,111,114,114,100,53,47,50,0],"i8",c);lA=d([100,101,101,112,115,107,121,98,108,117,101,0],"i8",c);NI=d([82,76,0],"i8",c);u$=d([47,111,114,114,100,53,47,49,0],"i8",c);v$=d([65,114,105,110,103,0],"i8",c);w$=d([47,111,114,114,100,52,47,52,0],"i8",c);x$=d([120,100,111,116,0],"i8",c);y$=d([47,111,114,114,100,52,47,51,0],"i8",c);XD=d([118,105,101,119,112,111,114,116,0],"i8",c);Ow=d([99,108,117,115,116,101,114,46,99,0],"i8",c);z$=d([47,111,114,114,100,52,47,50,0],"i8",c);A$=d([47,111,114,114,100,52,47,49,0],"i8",c);B$=d([47,98,108,117,101,115,53,47,49,0],"i8",c);C$=d([116,107,0],"i8",c);D$=d([84,97,114,103,101,116,32,65,82,32,61,32,37,103,10,0],"i8",c);sL=d([99,97,110,110,111,116,32,102,105,110,100,32,116,114,105,97,110,103,108,101,32,112,97,116,104,0],"i8",c);os=d([32,45,45,32,0],"i8",c);E$=d([47,111,114,114,100,51,47,51,0],"i8",c);F$=d([77,100,105,97,109,111,110,100,0],"i8",c);G$=d([101,112,115,58,120,100,111,116,0],"i8",c);H$=d([47,111,114,114,100,51,47,50,0],"i8",c);d([77,105,115,115,105,110,103,32,97,114,103,117,109,101,110,116,32,102,111,114,32,45,71,32,102,108,97,103,10,0],"i8",c);sg=d([110,111,110,101,0],"i8",c);iv=d([98,98,0],"i8",c);I$=d([47,111,114,114,100,51,47,49,0],"i8",c);J$=d([47,111,114,97,110,103,101,115,57,47,57,0],"i8",c);VC=d([37,100,32,112,111,108,121,103,111,110,115,32,37,100,32,112,111,105,110,116,115,10,0],"i8",c);K$=d([78,101,119,67,101,110,116,117,114,121,83,99,104,108,98,107,45,66,111,108,100,73,116,97,108,105,99,0],"i8",c);L$=d([47,100,97,115,104,101,100,32,123,32,91,57,32,73,110,118,83,99,97,108,101,70,97,99,116,111,114,32,109,117,108,32,100,117,112,32,93,32,48,32,115,101,116,100,97,115,104,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);M$=d([47,111,114,97,110,103,101,115,57,47,56,0],"i8",c);mA=d([100,101,101,112,112,105,110,107,0],"i8",c);OI=d([66,84,0],"i8",c);N$=d([47,111,114,97,110,103,101,115,57,47,55,0],"i8",c);O$=d([65,108,112,104,97,0],"i8",c);P$=d([47,111,114,97,110,103,101,115,57,47,54,0],"i8",c);Q$=d([47,111,114,97,110,103,101,115,57,47,53,0],"i8",c);aE=d([112,97,103,101,100,105,114,61,37,115,32,105,103,110,111,114,101,100,10,0],"i8",c);R$=d([47,111,114,97,110,103,101,115,57,47,52,0],"i8",c);S$=d([47,111,114,97,110,103,101,115,57,47,51,0],"i8",c);T$=d([47,98,108,117,101,115,52,47,52,0],"i8",c);HN=d([37,115,32,45,62,32,37,115,58,32,116,97,105,108,32,105,115,32,105,110,115,105,100,101,32,104,101,97,100,32,99,108,117,115,116,101,114,32,37,115,10,0],"i8",c);U$=d([47,111,114,97,110,103,101,115,57,47,50,0],"i8",c);V$=d([105,110,118,104,111,117,115,101,0],"i8",c);W$=d([112,115,58,120,100,111,116,0],"i8",c);X$=d([47,111,114,97,110,103,101,115,57,47,49,0],"i8",c);eU=d([34,32,47,62,0],"i8",c);Y$=d([47,111,114,97,110,103,101,115,56,47,56,0],"i8",c);Z$=d([47,111,114,97,110,103,101,115,56,47,55,0],"i8",c);dn=d([67,101,110,116,117,114,121,32,83,99,104,111,111,108,98,111,111,107,32,76,0],"i8",c);BQ=d([40,78,68,95,85,70,95,115,105,122,101,40,110,41,32,60,61,32,49,41,32,124,124,32,40,110,32,61,61,32,108,101,97,100,101,114,41,0],"i8",c);$$=d([47,115,111,108,105,100,32,123,32,91,93,32,48,32,115,101,116,100,97,115,104,32,125,32,98,105,110,100,32,100,101,102,0],"i8",c);aaa=d([47,111,114,97,110,103,101,115,56,47,54,0],"i8",c);baa=d([108,111,97,100,105,109,97,103,101,0],"i8",c);nA=d([100,97,114,107,118,105,111,108,101,116,0],"i8",c);KK=d([37,115,32,119,104,105,108,101,32,111,112,101,110,105,110,103,32,37,115,10,0],"i8",c);caa=d([47,111,114,97,110,103,101,115,56,47,53,0],"i8",c);fQ=d([71,111,105,110,103,32,116,111,32,97,112,112,108,121,32,97,110,111,116,104,101,114,32,101,120,112,97,110,115,105,111,110,46,10,0],"i8",c);daa=d([47,115,101,116,117,112,76,97,116,105,110,49,32,123,0],"i8",c);eaa=d([65,103,114,97,118,101,0],"i8",c);faa=d([47,111,114,97,110,103,101,115,56,47,52,0],"i8",c);DK=d([100,111,116,116,101,100,0],"i8",c);gaa=d([47,111,114,97,110,103,101,115,56,47,51,0],"i8",c);TD=d([114,101,110,100,101,114,101,114,32,102,111,114,32,37,115,32,105,115,32,117,110,97,118,97,105,108,97,98,108,101,10,0],"i8",c);haa=d([47,111,114,97,110,103,101,115,56,47,50,0],"i8",c);iaa=d([47,111,114,97,110,103,101,115,56,47,49,0],"i8",c);jaa=d([47,98,108,117,101,115,52,47,51,0],"i8",c);kaa=d([47,111,114,97,110,103,101,115,55,47,55,0],"i8",c);laa=d([105,110,118,116,114,97,112,101,122,105,117,109,0],"i8",c);maa=d([106,112,103,58,120,100,111,116,0],"i8",c);naa=d([47,111,114,97,110,103,101,115,55,47,54,0],"i8",c);BG=d([95,37,100,0],"i8",c);cU=d([34,32,100,97,115,104,115,116,121,108,101,61,34,100,111,116,0],"i8",c);oaa=d([47,111,114,97,110,103,101,115,55,47,53,0],"i8",c);oA=d([41,10,0],"i8",c);paa=d([47,111,114,97,110,103,101,115,55,47,52,0],"i8",c);qaa=d([78,101,119,67,101,110,116,117,114,121,83,99,104,108,98,107,45,66,111,108,100,0],"i8",c);raa=d([37,32,115,116,121,108,101,115,0],"i8",c);saa=d([47,111,114,97,110,103,101,115,55,47,51,0],"i8",c);taa=d([100,101,118,105,99,101,0],"i8",c);pA=d([100,97,114,107,116,117,114,113,117,111,105,115,101,0],"i8",c);uaa=d([47,111,114,97,110,103,101,115,55,47,50,0],"i8",c);vaa=d([65,99,105,114,99,0],"i8",c);waa=d([47,111,114,97,110,103,101,115,55,47,49,0],"i8",c);xaa=d([47,111,114,97,110,103,101,115,54,47,54,0],"i8",c);SD=d([108,97,121,111,117,116,32,119,97,115,32,110,111,116,32,100,111,110,101,10,0],"i8",c);yaa=d([47,111,114,97,110,103,101,115,54,47,53,0],"i8",c);zaa=d([47,111,114,97,110,103,101,115,54,47,52,0],"i8",c);Aaa=d([47,98,108,117,101,115,52,47,50,0],"i8",c);Baa=d([47,111,114,97,110,103,101,115,54,47,51,0],"i8",c);Caa=d([105,110,118,116,114,105,97,110,103,108,101,0],"i8",c);Daa=d([106,112,101,58,120,100,111,116,0],"i8",c);Eaa=d([47,111,114,97,110,103,101,115,54,47,50,0],"i8",c);Faa=d([50,48,0],"i8",c);dU=d([34,32,100,97,115,104,115,116,121,108,101,61,34,100,97,115,104,0],"i8",c);Gaa=d([47,111,114,97,110,103,101,115,54,47,49,0],"i8",c);Haa=d([47,111,114,97,110,103,101,115,53,47,53,0],"i8",c);Iaa=d([72,101,108,118,101,116,105,99,97,45,79,98,108,105,113,117,101,0],"i8",c);Jaa=d([32,32,32,32,32,32,32,115,99,97,108,101,0],"i8",c);Kaa=d([47,111,114,97,110,103,101,115,53,47,52,0],"i8",c);KI=d([113,117,97,110,116,117,109,0],"i8",c);qA=d([100,97,114,107,115,108,97,116,101,103,114,101,121,0],"i8",c);Laa=d([47,111,114,97,110,103,101,115,53,47,51,0],"i8",c);Maa=d([65,97,99,117,116,101,0],"i8",c);Naa=d([47,111,114,97,110,103,101,115,53,47,50,0],"i8",c);Oaa=d([47,111,114,97,110,103,101,115,53,47,49,0],"i8",c);FD=d([76,97,121,111,117,116,32,119,97,115,32,110,111,116,32,100,111,110,101,46,32,32,77,105,115,115,105,110,103,32,108,97,121,111,117,116,32,112,108,117,103,105,110,115,63,32,10,0],"i8",c);Paa=d([47,111,114,97,110,103,101,115,52,47,52,0],"i8",c);Qaa=d([47,111,114,97,110,103,101,115,52,47,51,0],"i8",c);Raa=d([47,98,108,117,101,115,52,47,49,0],"i8",c);Saa=d([47,111,114,97,110,103,101,115,52,47,50,0],"i8",c);Taa=d([116,114,105,112,108,101,111,99,116,97,103,111,110,0],"i8",c);Uaa=d([106,112,101,103,58,120,100,111,116,0],"i8",c);Vaa=d([47,111,114,97,110,103,101,115,52,47,49,0],"i8",c);Waa=d([49,57,0],"i8",c);bU=d([34,32,119,101,105,103,104,116,61,34,37,46,48,102,112,116,0],"i8",c);Xaa=d([47,111,114,97,110,103,101,115,51,47,51,0],"i8",c);rP=d([71,68,95,114,97,110,107,40,103,41,91,114,93,46,110,32,60,61,32,71,68,95,114,97,110,107,40,103,41,91,114,93,46,97,110,0],"i8",c);Yaa=d([47,111,114,97,110,103,101,115,51,47,50,0],"i8",c);Zaa=d([72,101,108,118,101,116,105,99,97,45,78,97,114,114,111,119,45,79,98,108,105,113,117,101,0],"i8",c);$aa=d([32,32,32,32,32,32,32,100,117,112,32,49,32,101,120,99,104,32,100,105,118,32,47,73,110,118,83,99,97,108,101,70,97,99,116,111,114,32,101,120,99,104,32,100,101,102,0],"i8",c);aba=d([47,111,114,97,110,103,101,115,51,47,49,0],"i8",c);qL=d([100,101,115,116,105,110,97,116,105,111,110,32,112,111,105,110,116,32,110,111,116,32,105,110,32,97,110,121,32,116,114,105,97,110,103,108,101,0],"i8",c);tv=d([108,97,121,111,117,116,0],"i8",c);xI=d([71,68,70,79,78,84,80,65,84,72,61,0],"i8",c);rA=d([100,97,114,107,115,108,97,116,101,103,114,97,121,0],"i8",c);bba=d([47,103,114,101,121,115,57,47,57,0],"i8",c);cba=d([65,69,108,105,103,0],"i8",c);dba=d([47,103,114,101,121,115,57,47,56,0],"i8",c);eba=d([47,103,114,101,121,115,57,47,55,0],"i8",c);d([67,0],"i8",c);fba=d([114,101,110,100,101,114,0],"i8",c);gba=d([47,103,114,101,121,115,57,47,54,0],"i8",c);DM=d([115,121,110,116,97,120,32,101,114,114,111,114,44,32,115,116,97,116,101,109,101,110,116,32,115,107,105,112,112,101,100,0],"i8",c);hba=d([47,103,114,101,121,115,57,47,53,0],"i8",c);iba=d([47,98,108,117,101,115,51,47,51,0],"i8",c);jba=d([47,103,114,101,121,115,57,47,52,0],"i8",c);kba=d([100,111,117,98,108,101,111,99,116,97,103,111,110,0],"i8",c);lba=d([103,105,102,58,120,100,111,116,0],"i8",c);mba=d([105,109,97,112,58,109,97,112,0],"i8",c);nba=d([47,103,114,101,121,115,57,47,51,0],"i8",c);oba=d([49,56,0],"i8",c);$T=d([60,118,58,115,116,114,111,107,101,32,99,111,108,111,114,61,34,0],"i8",c);pba=d([47,103,114,101,121,115,57,47,50,0],"i8",c);qba=d([35,32,71,101,110,101,114,97,116,101,100,32,98,121,32,0],"i8",c);rba=d([47,103,114,101,121,115,57,47,49,0],"i8",c);sba=d([72,101,108,118,101,116,105,99,97,45,78,97,114,114,111,119,45,66,111,108,100,79,98,108,105,113,117,101,0],"i8",c);tba=d([32,50,10,0],"i8",c);uba=d([47,103,114,101,121,115,56,47,56,0],"i8",c);CN=d([78,68,95,114,97,110,107,40,102,114,111,109,41,32,60,32,78,68,95,114,97,110,107,40,116,111,41,0],"i8",c);wI=d([68,79,84,70,79,78,84,80,65,84,72,0],"i8",c);vba=d([81,0],"i8",c);sA=d([100,97,114,107,115,108,97,116,101,98,108,117,101,0],"i8",c);wba=d([47,97,99,99,101,110,116,51,47,50,0],"i8",c);xba=d([47,103,114,101,121,115,56,47,55,0],"i8",c);tF=d([98,122,46,115,105,122,101,0],"i8",c);yba=d([47,115,101,116,95,115,99,97,108,101,32,123,0],"i8",c);d([70,65,76,83,69,0],"i8",c);zba=d([47,103,114,101,121,115,56,47,54,0],"i8",c);Aba=d([47,103,114,101,121,115,56,47,53,0],"i8",c);DD=d([117,110,109,97,116,99,104,101,100,32,39,40,39,32,105,110,32,115,116,121,108,101,58,32,37,115,10,0],"i8",c);Bba=d([47,103,114,101,121,115,56,47,52,0],"i8",c);Cba=d([47,103,114,101,121,115,56,47,51,0],"i8",c);Dba=d([47,98,108,117,101,115,51,47,50,0],"i8",c);Eba=d([47,103,114,101,121,115,56,47,50,0],"i8",c);Fba=d([100,111,117,98,108,101,99,105,114,99,108,101,0],"i8",c);Gba=d([112,110,103,58,120,100,111,116,0],"i8",c);Hba=d([47,103,114,101,121,115,56,47,49,0],"i8",c);Iba=d([49,55,0],"i8",c);tA=d([60,47,118,58,115,104,97,112,101,62,10,0],"i8",c);Jba=d([47,103,114,101,121,115,55,47,55,0],"i8",c);Kba=d([32,80,97,103,101,115,58,32,37,100,10,0],"i8",c);Lba=d([47,103,114,101,121,115,55,47,54,0],"i8",c);Mba=d([72,101,108,118,101,116,105,99,97,45,78,97,114,114,111,119,45,66,111,108,100,0],"i8",c);xK=d([85,115,105,110,103,32,37,115,58,32,37,115,58,37,115,10,0],"i8",c);Nba=d([49,50,48,48,0],"i8",c);Oba=d([47,103,114,101,121,115,55,47,53,0],"i8",c);d([105,110,112,117,116,95,0],"i8",c);vI=d([102,111,110,116,112,97,116,104,0],"i8",c);uA=d([100,97,114,107,115,101,97,103,114,101,101,110,0],"i8",c);Hs=d([101,112,115,102,0],"i8",c);Pba=d([106,112,101,58,115,118,103,0],"i8",c);Qba=d([47,103,114,101,121,115,55,47,52,0],"i8",c);Rba=d([120,109,108,0],"i8",c);KF=d([115,112,108,105,110,101,115,0],"i8",c);Sba=d([47,73,110,118,83,99,97,108,101,70,97,99,116,111,114,32,49,46,48,32,100,101,102,0],"i8",c);oR=d([34,32,110,97,109,101,61,34,0],"i8",c);Tba=d([47,103,114,101,121,115,55,47,51,0],"i8",c);bH=d([105,110,32,114,111,117,116,101,115,112,108,105,110,101,115,44,32,99,97,110,110,111,116,32,102,105,110,100,32,78,79,82,77,65,76,32,101,100,103,101,10,0],"i8",c);Uba=d([47,103,114,101,121,115,55,47,50,0],"i8",c);BD=d([116,114,117,110,99,97,116,105,110,103,32,115,116,121,108,101,32,39,37,115,39,10,0],"i8",c);wt=d([37,100,32,0],"i8",c);Vba=d([47,103,114,101,121,115,55,47,49,0],"i8",c);Wba=d([47,103,114,101,121,115,54,47,54,0],"i8",c);Xba=d([47,98,108,117,101,115,51,47,49,0],"i8",c);Yba=d([47,103,114,101,121,115,54,47,53,0],"i8",c);Zba=d([115,113,117,97,114,101,0],"i8",c);$ba=d([115,118,103,58,100,111,116,0],"i8",c);aca=d([47,103,114,101,121,115,54,47,52,0],"i8",c);bca=d([49,54,0],"i8",c);cca=d([34,47,62,0],"i8",c);dca=d([47,103,114,101,121,115,54,47,51,0],"i8",c);vA=d([32,84,105,116,108,101,58,32,0],"i8",c);eca=d([47,103,114,101,121,115,54,47,50,0],"i8",c);en=d([99,111,110,100,101,110,115,101,100,0],"i8",c);fca=d([45,50,10,0],"i8",c);gca=d([47,103,114,101,121,115,54,47,49,0],"i8",c);wA=d([100,97,114,107,115,97,108,109,111,110,0],"i8",c);hca=d([47,103,114,101,121,115,53,47,53,0],"i8",c);ica=d([60,63,120,109,108,0],"i8",c);IF=d([85,110,107,110,111,119,110,32,34,115,112,108,105,110,101,115,34,32,118,97,108,117,101,58,32,34,37,115,34,32,45,32,105,103,110,111,114,101,100,10,0],"i8",c);jca=d([47,99,111,111,114,100,102,111,110,116,32,99,111,111,114,100,45,102,111,110,116,45,102,97,109,105,108,121,32,102,105,110,100,102,111,110,116,32,56,32,115,99,97,108,101,102,111,110,116,32,100,101,102,0],"i8",c);nR=d([60,109,97,112,32,105,100,61,34,0],"i8",c);kca=d([47,103,114,101,121,115,53,47,52,0],"i8",c);aQ=d([117,32,33,61,32,118,0],"i8",c);lca=d([47,103,114,101,121,115,53,47,51,0],"i8",c);ED=d([117,110,109,97,116,99,104,101,100,32,39,41,39,32,105,110,32,115,116,121,108,101,58,32,37,115,10,0],"i8",c);mca=d([47,103,114,101,121,115,53,47,50,0],"i8",c);nca=d([47,103,114,101,121,115,53,47,49,0],"i8",c);oca=d([47,97,99,99,101,110,116,56,47,56,0],"i8",c);kt=d([38,35,52,53,59,0],"i8",c);pca=d([47,103,114,101,121,115,52,47,52,0],"i8",c);qca=d([114,101,99,116,97,110,103,108,101,0],"i8",c);rca=d([101,112,115,58,100,111,116,0],"i8",c);sca=d([47,103,114,101,121,115,52,47,51,0],"i8",c);tca=d([49,53,0],"i8",c);uca=d([32,101,32,0],"i8",c);vca=d([47,103,114,101,121,115,52,47,50,0],"i8",c);wca=d([35,0],"i8",c);xca=d([47,103,114,101,121,115,52,47,49,0],"i8",c);yca=d([72,101,108,118,101,116,105,99,97,45,78,97,114,114,111,119,0],"i8",c);wd=d([10,0],"i8",c);zca=d([83,105,110,103,108,101,10,0],"i8",c);Aca=d([47,103,114,101,121,115,51,47,51,0],"i8",c);Bca=d([100,97,114,107,114,101,100,0],"i8",c);Cca=d([47,103,114,101,121,115,51,47,50,0],"i8",c);QF=d([102,111,110,116,110,97,109,101,58,32,34,37,115,34,32,114,101,115,111,108,118,101,100,32,116,111,58,32,37,115,10,0],"i8",c);Dca=d([101,112,115,0],"i8",c);HF=d([101,115,0],"i8",c);Eca=d([47,100,101,102,97,117,108,116,45,102,111,110,116,45,102,97,109,105,108,121,32,47,84,105,109,101,115,45,82,111,109,97,110,32,100,101,102,0],"i8",c);Fca=d([47,103,114,101,121,115,51,47,49,0],"i8",c);Gca=d([82,105,103,104,116,0],"i8",c);Hca=d([47,103,114,101,101,110,115,57,47,57,0],"i8",c);CD=d([110,101,115,116,105,110,103,32,110,111,116,32,97,108,108,111,119,101,100,32,105,110,32,115,116,121,108,101,58,32,37,115,10,0],"i8",c);Ica=d([47,103,114,101,101,110,115,57,47,56,0],"i8",c);Jca=d([47,103,114,101,101,110,115,57,47,55,0],"i8",c);Kca=d([47,97,99,99,101,110,116,56,47,55,0],"i8",c);Lca=d([49,48,48,46,48,48,10,0],"i8",c);Mca=d([47,103,114,101,101,110,115,57,47,54,0],"i8",c);Nca=d([114,101,99,116,0],"i8",c);Oca=d([112,115,58,100,111,116,0],"i8",c);Pca=d([47,103,114,101,101,110,115,57,47,53,0],"i8",c);Qca=d([49,52,0],"i8",c);Rca=d([32,108,32,0],"i8",c);Sca=d([47,103,114,101,101,110,115,57,47,52,0],"i8",c);US=d([32,45,97,110,99,104,111,114,32,101,0],"i8",c);fG=d([91,105,110,116,101,114,110,97,108,32,99,111,117,114,105,101,114,93,0],"i8",c);nM=d([37,115,58,37,100,58,32,37,115,32,110,101,97,114,32,108,105,110,101,32,37,100,10,0],"i8",c);Tca=d([47,103,114,101,101,110,115,57,47,51,0],"i8",c);Uca=d([72,101,108,118,101,116,105,99,97,45,66,111,108,100,79,98,108,105,113,117,101,0],"i8",c);Vca=d([115,116,100,58,58,98,97,100,95,97,108,108,111,99,0],"i8",c);Wca=d([47,103,114,101,101,110,115,57,47,50,0],"i8",c);Xca=d([102,105,103,0],"i8",c);Eo=d([111,117,116,32,111,102,32,109,101,109,111,114,121,10,0],"i8",c);d([111,117,116,112,117,116,95,102,111,114,109,97,116,115,0],"i8",c);Yca=d([103,100,0],"i8",c);xA=d([100,97,114,107,111,114,99,104,105,100,0],"i8",c);Zca=d([47,103,114,101,101,110,115,57,47,49,0],"i8",c);d([109,97,120,32,115,121,115,116,101,109,32,98,121,116,101,115,32,61,32,37,49,48,108,117,10,0],"i8",c);$ca=d([197,208,211,198,0],"i8",c);zF=d([114,117,101,0],"i8",c);ada=d([47,99,111,111,114,100,45,102,111,110,116,45,102,97,109,105,108,121,32,47,84,105,109,101,115,45,82,111,109,97,110,32,100,101,102,0],"i8",c);sy=d([100,101,102,97,117,108,116,32,0],"i8",c);bda=d([47,103,114,101,101,110,115,56,47,56,0],"i8",c);ok=d([100,111,116,0],"i8",c);cda=d([47,103,114,101,101,110,115,56,47,55,0],"i8",c);mN=d([69,68,95,116,111,95,118,105,114,116,40,111,114,105,103,41,32,33,61,32,78,85,76,76,0],"i8",c);dda=d([47,103,114,101,101,110,115,56,47,54,0],"i8",c);eda=d([47,103,114,101,101,110,115,56,47,53,0],"i8",c);wr=d([107,101,121,0],"i8",c);fda=d([47,97,99,99,101,110,116,56,47,54,0],"i8",c);gda=d([47,103,114,101,101,110,115,56,47,52,0],"i8",c);hda=d([76,101,116,116,101,114,10,0],"i8",c);ida=d([99,111,109,112,111,110,101,110,116,0],"i8",c);jda=d([106,112,103,58,100,111,116,0],"i8",c);kda=d([37,108,102,44,37,100,0],"i8",c);ns=d([32,45,62,32,0],"i8",c);lda=d([47,103,114,101,101,110,115,56,47,51,0],"i8",c);mda=d([49,51,0],"i8",c);d([37,115,32,45,32,37,115,32,118,101,114,115,105,111,110,32,37,115,32,40,37,115,41,10,0],"i8",c);yA=d([37,46,48,102,44,37,46,48,102,32,0],"i8",c);ZJ=d([37,100,32,37,100,32,37,100,32,37,100,0],"i8",c);mI=d([99,97,110,39,116,32,102,105,110,100,32,108,105,98,114,97,114,121,32,102,105,108,101,32,37,115,10,0],"i8",c);nda=d([47,103,114,101,101,110,115,56,47,50,0],"i8",c);TS=d([32,45,97,110,99,104,111,114,32,119,0],"i8",c);oda=d([47,103,114,101,101,110,115,56,47,49,0],"i8",c);pda=d([72,101,108,118,101,116,105,99,97,45,66,111,108,100,0],"i8",c);qda=d([47,103,114,101,101,110,115,55,47,55,0],"i8",c);EQ=d([37,115,37,100,32,45,0],"i8",c);UC=d([37,100,32,111,112,115,32,37,46,50,102,32,115,101,99,10,0],"i8",c);VJ=d([37,46,53,103,44,37,46,53,103,44,37,46,53,103,44,37,46,53,103,32,0],"i8",c);d([99,103,0],"i8",c);zA=d([100,97,114,107,111,114,97,110,103,101,0],"i8",c);gK=d([103,118,119,114,105,116,101,95,110,111,95,122,32,112,114,111,98,108,101,109,32,37,100,10,0],"i8",c);rda=d([47,103,114,101,101,110,115,55,47,54,0],"i8",c);AA=d([97,110,116,105,113,117,101,119,104,105,116,101,0],"i8",c);sda=d([112,100,102,0],"i8",c);DF=d([112,108,105,110,101,0],"i8",c);tda=d([37,37,66,101,103,105,110,82,101,115,111,117,114,99,101,58,32,112,114,111,99,115,101,116,32,103,114,97,112,104,118,105,122,32,48,32,48,0],"i8",c);pR=d([98,97,115,101,32,114,101,102,101,114,101,114,10,0],"i8",c);uda=d([47,103,114,101,101,110,115,55,47,53,0],"i8",c);vda=d([47,103,114,101,101,110,115,55,47,52,0],"i8",c);d([114,101,110,100,101,114,95,99,103,0],"i8",c);wda=d([47,103,114,101,101,110,115,55,47,51,0],"i8",c);xda=d([47,103,114,101,101,110,115,55,47,50,0],"i8",c);yda=d([47,97,99,99,101,110,116,56,47,53,0],"i8",c);zda=d([47,103,114,101,101,110,115,55,47,49,0],"i8",c);Ada=d([73,110,99,104,101,115,10,0],"i8",c);Bda=d([98,111,120,51,100,0],"i8",c);Cda=d([106,112,101,58,100,111,116,0],"i8",c);GN=d([37,115,32,45,62,32,37,115,58,32,104,101,97,100,32,110,111,116,32,105,110,115,105,100,101,32,104,101,97,100,32,99,108,117,115,116,101,114,32,37,115,10,0],"i8",c);Dda=d([47,103,114,101,101,110,115,54,47,54,0],"i8",c);Eda=d([49,50,0],"i8",c);Fda=d([32,109,32,0],"i8",c);Gda=d([47,103,114,101,101,110,115,54,47,53,0],"i8",c);SS=d([32,37,100,125,0],"i8",c);Hda=d([47,103,114,101,101,110,115,54,47,52,0],"i8",c);Qf=d([72,101,108,118,101,116,105,99,97,0],"i8",c);AQ=d([108,101,97,100,101,114,32,33,61,32,78,85,76,76,0],"i8",c);WQ=d([95,116,108,100,114,97,119,95,0],"i8",c);Ida=d([47,103,114,101,101,110,115,54,47,51,0],"i8",c);d([114,101,116,117,114,110,105,110,103,32,37,100,10,0],"i8",c);WJ=d([37,46,53,103,44,37,46,53,103,44,37,46,53,103,44,37,46,53,103,0],"i8",c);Jda=d([103,108,111,98,97,108,0],"i8",c);BA=d([100,97,114,107,111,108,105,118,101,103,114,101,101,110,0],"i8",c);cj=d([114,0],"i8",c);Kda=d([47,103,114,101,101,110,115,54,47,50,0],"i8",c);eQ=d([68,117,109,109,121,61,37,100,10,0],"i8",c);bF=d([102,105,108,101,32,108,111,97,100,105,110,103,32,105,115,32,100,105,115,97,98,108,101,100,32,98,101,99,97,117,115,101,32,116,104,101,32,101,110,118,105,114,111,110,109,101,110,116,32,99,111,110,116,97,105,110,115,32,83,69,82,86,69,82,95,78,65,77,69,61,34,37,115,34,110,97,110,100,32,116,104,101,114,101,32,105,115,32,110,111,32,71,86,95,70,73,76,69,95,80,65,84,72,32,118,97,114,105,97,98,108,101,32,115,101,116,46,10,0],"i8",c);Lda=d([37,80,68,70,45,0],"i8",c);CF=d([111,108,121,108,105,110,101,0],"i8",c);ii=d([125,32,98,105,110,100,32,100,101,102,0],"i8",c);Mda=d([60,47,109,97,112,62,10,0],"i8",c);Nda=d([47,103,114,101,101,110,115,54,47,49,0],"i8",c);CK=d([100,97,115,104,101,100,0],"i8",c);Oda=d([47,103,114,101,101,110,115,53,47,53,0],"i8",c);Pda=d([47,103,114,101,101,110,115,53,47,52,0],"i8",c);Qda=d([47,103,114,101,101,110,115,53,47,51,0],"i8",c);Rda=d([47,97,99,99,101,110,116,56,47,52,0],"i8",c);Sda=d([47,103,114,101,101,110,115,53,47,50,0],"i8",c);Tda=d([67,101,110,116,101,114,10,0],"i8",c);Uda=d([102,111,108,100,101,114,0],"i8",c);Vda=d([106,112,101,103,58,100,111,116,0],"i8",c);Wda=d([47,103,114,101,101,110,115,53,47,49,0],"i8",c);Xda=d([49,49,0],"i8",c);Yda=d([60,118,58,112,97,116,104,32,118,61,34,0],"i8",c);Zda=d([47,103,114,101,101,110,115,52,47,52,0],"i8",c);$da=d([47,103,114,101,101,110,115,52,47,51,0],"i8",c);aea=d([67,111,117,114,105,101,114,45,79,98,108,105,113,117,101,0],"i8",c);VQ=d([95,104,108,100,114,97,119,95,0],"i8",c);bea=d([47,103,114,101,101,110,115,52,47,50,0],"i8",c);d([103,118,47,100,111,116,0],"i8",c);cea=d([108,111,99,97,108,0],"i8",c);dea=d([100,97,114,107,109,97,103,101,110,116,97,0],"i8",c);eea=d([99,111,114,101,0],"i8",c);fea=d([47,103,114,101,101,110,115,52,47,49,0],"i8",c);gea=d([100,111,116,95,108,97,121,111,117,116,0],"i8",c);SF=d([105,110,32,108,97,98,101,108,32,111,102,32,103,114,97,112,104,32,37,115,10,0],"i8",c);hea=d([106,112,101,103,0],"i8",c);GF=d([114,116,104,111,0],"i8",c);iea=d([99,108,101,97,114,116,111,109,97,114,107,0],"i8",c);jea=d([47,103,114,101,101,110,115,51,47,51,0],"i8",c);ty=d([34,62,10,0],"i8",c);kea=d([47,103,114,101,101,110,115,51,47,50,0],"i8",c);lea=d([47,103,114,101,101,110,115,51,47,49,0],"i8",c);d([103,118,0],"i8",c);mea=d([47,103,110,98,117,57,47,57,0],"i8",c);nea=d([47,97,99,99,101,110,116,56,47,51,0],"i8",c);oea=d([47,103,110,98,117,57,47,56,0],"i8",c);pea=d([80,111,114,116,114,97,105,116,10,0],"i8",c);qea=d([116,97,98,0],"i8",c);rea=d([103,105,102,58,100,111,116,0],"i8",c);sea=d([47,103,110,98,117,57,47,55,0],"i8",c);d([95,95,0],"i8",c);tea=d([49,48,0],"i8",c);uea=d([47,103,110,98,117,57,47,54,0],"i8",c);vea=d([32,119,105,100,116,104,58,32,37,100,59,32,104,101,105,103,104,116,58,32,37,100,34,32,102,105,108,108,101,100,61,34,102,97,108,115,101,34,62,0],"i8",c);d([104,101,97,100,32,110,111,100,101,32,37,115,32,105,110,115,105,100,101,32,116,97,105,108,32,99,108,117,115,116,101,114,32,37,115,10,0],"i8",c);RS=d([32,45,102,111,110,116,32,123,0],"i8",c);wea=d([47,103,110,98,117,57,47,53,0],"i8",c);d([116,97,105,108,32,110,111,100,101,32,37,115,32,105,110,115,105,100,101,32,104,101,97,100,32,99,108,117,115,116,101,114,32,37,115,10,0],"i8",c);xea=d([67,111,117,114,105,101,114,45,66,111,108,100,79,98,108,105,113,117,101,0],"i8",c);yea=d([47,103,110,98,117,57,47,52,0],"i8",c);UQ=d([95,116,100,114,97,119,95,0],"i8",c);d([104,101,97,100,32,99,108,117,115,116,101,114,32,37,115,32,105,110,115,105,100,101,32,116,97,105,108,32,99,108,117,115,116,101,114,32,37,115,10,0],"i8",c);cO=d([100,111,116,115,112,108,105,110,101,115,46,99,0],"i8",c);YM=d([99,111,109,98,105,65,82,32,61,32,37,108,102,10,0],"i8",c);UJ=d([101,44,37,46,53,103,44,37,46,53,103,32,0],"i8",c);d([60,115,116,100,105,110,62,0],"i8",c);CA=d([100,97,114,107,107,104,97,107,105,0],"i8",c);zea=d([47,103,110,98,117,57,47,51,0],"i8",c);d([116,97,105,108,32,99,108,117,115,116,101,114,32,37,115,32,105,110,115,105,100,101,32,104,101,97,100,32,99,108,117,115,116,101,114,32,37,115,10,0],"i8",c);Aea=d([255,216,255,224,0],"i8",c);ft=d([111,0],"i8",c);Bea=d([47,67,111,117,114,105,101,114,45,66,111,108,100,79,98,108,105,113,117,101,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);Cea=d([47,103,110,98,117,57,47,50,0],"i8",c);d([99,108,117,115,116,101,114,32,99,121,99,108,101,32,37,115,32,45,45,32,37,115,32,110,111,116,32,115,117,112,112,111,114,116,101,100,10,0],"i8",c);Dea=d([47,103,110,98,117,57,47,49,0],"i8",c);MF=d([110,97,109,101,0],"i8",c);uD=d([112,101,110,99,111,108,111,114,0],"i8",c);Eea=d([47,103,110,98,117,56,47,56,0],"i8",c);Fea=d([122,119,110,106,0],"i8",c);Gea=d([47,103,110,98,117,56,47,55,0],"i8",c);Hea=d([122,119,106,0],"i8",c);Iea=d([47,97,99,99,101,110,116,56,47,50,0],"i8",c);Jea=d([47,103,110,98,117,56,47,54,0],"i8",c);Kea=d([122,101,116,97,0],"i8",c);Lea=d([35,32,80,97,103,101,115,58,32,37,100,10,0],"i8",c);Mea=d([110,111,116,101,0],"i8",c);Nea=d([112,110,103,58,100,111,116,0],"i8",c);Oea=d([47,103,110,98,117,56,47,53,0],"i8",c);Pea=d([121,117,109,108,0],"i8",c);Qea=d([57,0],"i8",c);Rea=d([47,103,110,98,117,56,47,52,0],"i8",c);cr=d([32,60,118,58,115,104,97,112,101,32,115,116,121,108,101,61,34,112,111,115,105,116,105,111,110,58,97,98,115,111,108,117,116,101,59,32,0],"i8",c);Sea=d([121,101,110,0],"i8",c);QS=d([125,0],"i8",c);Tea=d([47,103,110,98,117,56,47,51,0],"i8",c);Uea=d([121,97,99,117,116,101,0],"i8",c);Vea=d([67,111,117,114,105,101,114,45,66,111,108,100,0],"i8",c);rg=d([109,105,110,99,114,111,115,115,46,99,0],"i8",c);Wea=d([47,103,110,98,117,56,47,50,0],"i8",c);TQ=d([95,104,100,114,97,119,95,0],"i8",c);Xea=d([120,105,0],"i8",c);Yea=d([47,103,110,98,117,56,47,49,0],"i8",c);Zea=d([9,37,112,32,37,115,44,37,115,10,0],"i8",c);TJ=d([115,44,37,46,53,103,44,37,46,53,103,32,0],"i8",c);d([37,115,58,32,99,97,110,39,116,32,111,112,101,110,32,37,115,10,0],"i8",c);$ea=d([100,97,114,107,103,114,101,121,0],"i8",c);afa=d([119,101,105,101,114,112,0],"i8",c);bfa=d([47,103,110,98,117,55,47,55,0],"i8",c);cfa=d([103,105,102,0],"i8",c);AF=d([111,110,101,0],"i8",c);dfa=d([47,67,111,117,114,105,101,114,45,66,111,108,100,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);ER=d([44,37,100,44,37,100,0],"i8",c);efa=d([117,117,109,108,0],"i8",c);ffa=d([47,103,110,98,117,55,47,54,0],"i8",c);VO=d([71,68,95,109,105,110,114,97,110,107,40,103,41,32,61,61,32,48,0],"i8",c);gfa=d([117,112,115,105,108,111,110,0],"i8",c);hfa=d([47,103,110,98,117,55,47,53,0],"i8",c);ifa=d([117,112,115,105,104,0],"i8",c);jfa=d([47,103,110,98,117,55,47,52,0],"i8",c);d([120,49,49,47,120,108,105,98,0],"i8",c);kfa=d([117,109,108,0],"i8",c);lfa=d([47,103,110,98,117,55,47,51,0],"i8",c);mfa=d([47,97,99,99,101,110,116,56,47,49,0],"i8",c);Es=d([116,114,117,101,0],"i8",c);nfa=d([117,103,114,97,118,101,0],"i8",c);ofa=d([47,103,110,98,117,55,47,50,0],"i8",c);pfa=d([111,99,116,97,103,111,110,0],"i8",c);qfa=d([115,118,103,58,109,97,112,0],"i8",c);rfa=d([35,32,84,105,116,108,101,58,32,37,115,10,0],"i8",c);sfa=d([117,99,105,114,99,0],"i8",c);tfa=d([47,103,110,98,117,55,47,49,0],"i8",c);ufa=d([56,0],"i8",c);vfa=d([99,109,97,112,58,109,97,112,0],"i8",c);dr=d([32,45,45,62,10,0],"i8",c);wfa=d([117,97,114,114,0],"i8",c);xfa=d([47,103,110,98,117,54,47,54,0],"i8",c);tC=d([97,103,105,110,105,116,40,41,32,99,97,108,108,101,100,32,109,117,108,116,105,112,108,121,32,119,105,116,104,32,105,110,99,111,110,115,105,115,116,101,110,116,32,97,114,103,115,10,0],"i8",c);PS=d([32,45,116,101,120,116,32,123,0],"i8",c);yfa=d([117,97,99,117,116,101,0],"i8",c);zfa=d([47,103,110,98,117,54,47,53,0],"i8",c);fn=d([109,111,110,111,115,112,97,99,101,0],"i8",c);zq=d([95,108,100,114,97,119,95,0],"i8",c);Afa=d([117,65,114,114,0],"i8",c);Bfa=d([47,103,110,98,117,54,47,52,0],"i8",c);pL=d([115,111,117,114,99,101,32,112,111,105,110,116,32,110,111,116,32,105,110,32,97,110,121,32,116,114,105,97,110,103,108,101,0],"i8",c);lv=d([37,46,53,103,32,37,46,53,103,0],"i8",c);uK=d([115,117,98,103,114,97,112,104,0],"i8",c);DA=d([100,97,114,107,103,114,101,101,110,0],"i8",c);Cfa=d([116,114,97,100,101,0],"i8",c);Dfa=d([47,103,110,98,117,54,47,51,0],"i8",c);Efa=d([47,97,99,99,101,110,116,51,47,49,0],"i8",c);d([99,118,116,46,99,0],"i8",c);Ffa=d([71,73,70,56,0],"i8",c);EF=d([105,110,101,0],"i8",c);Gfa=d([47,67,111,117,114,105,101,114,45,79,98,108,105,113,117,101,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);TH=d([80,45,62,101,110,100,46,116,104,101,116,97,32,60,32,50,32,42,32,77,95,80,73,0],"i8",c);DR=d([37,100,44,37,100,0],"i8",c);Hfa=d([116,105,109,101,115,0],"i8",c);Ifa=d([47,103,110,98,117,54,47,50,0],"i8",c);Jfa=d([116,105,108,100,101,0],"i8",c);Kfa=d([47,103,110,98,117,54,47,49,0],"i8",c);Lfa=d([116,104,111,114,110,0],"i8",c);Mfa=d([47,103,110,98,117,53,47,53,0],"i8",c);d([120,108,105,98,0],"i8",c);Nfa=d([116,104,105,110,115,112,0],"i8",c);Ofa=d([47,103,110,98,117,53,47,52,0],"i8",c);Pfa=d([47,97,99,99,101,110,116,55,47,55,0],"i8",c);Qfa=d([116,104,101,116,97,115,121,109,0],"i8",c);Rfa=d([47,103,110,98,117,53,47,51,0],"i8",c);NJ=d([103,114,97,112,104,32,0],"i8",c);Sfa=d([115,101,112,116,97,103,111,110,0],"i8",c);Tfa=d([101,112,115,58,109,97,112,0],"i8",c);Ufa=d([35,32,71,101,110,101,114,97,116,101,100,32,98,121,32,37,115,32,118,101,114,115,105,111,110,32,37,115,32,40,37,115,41,10,0],"i8",c);Vfa=d([116,104,101,116,97,0],"i8",c);Wfa=d([47,103,110,98,117,53,47,50,0],"i8",c);Xfa=d([55,0],"i8",c);Yfa=d([32,32,32,32,32,32,60,33,45,45,32,0],"i8",c);Zfa=d([116,104,101,114,101,52,0],"i8",c);$fa=d([47,103,110,98,117,53,47,49,0],"i8",c);OS=d([32,99,114,101,97,116,101,32,116,101,120,116,32,0],"i8",c);aga=d([116,97,117,0],"i8",c);bga=d([47,103,110,98,117,52,47,52,0],"i8",c);Tj=d([67,111,117,114,105,101,114,0],"i8",c);RQ=d([49,46,50,0],"i8",c);cga=d([115,122,108,105,103,0],"i8",c);dga=d([47,103,110,98,117,52,47,51,0],"i8",c);zN=d([37,115,32,119,97,115,32,97,108,114,101,97,100,121,32,105,110,32,97,32,114,97,110,107,115,101,116,44,32,100,101,108,101,116,101,100,32,102,114,111,109,32,99,108,117,115,116,101,114,32,37,115,10,0],"i8",c);us=d([115,97,109,112,108,101,112,111,105,110,116,115,0],"i8",c);RI=d([37,108,102,0],"i8",c);ega=d([100,97,114,107,103,114,97,121,0],"i8",c);fga=d([115,117,112,101,0],"i8",c);gga=d([47,103,110,98,117,52,47,50,0],"i8",c);hga=d([106,112,101,103,58,115,118,103,0],"i8",c);iga=d([98,109,112,0],"i8",c);FF=d([97,108,115,101,0],"i8",c);jga=d([47,67,111,117,114,105,101,114,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);GR=d([37,100,44,37,100,44,37,100,44,37,100,0],"i8",c);kga=d([115,117,112,51,0],"i8",c);lga=d([47,103,110,98,117,52,47,49,0],"i8",c);aH=d([99,97,110,110,111,116,32,114,101,45,97,108,108,111,99,97,116,101,32,112,115,10,0],"i8",c);YG=d([108,111,115,116,32,37,115,32,37,115,32,101,100,103,101,10,0],"i8",c);mga=d([115,117,112,50,0],"i8",c);nga=d([47,103,110,98,117,51,47,51,0],"i8",c);FG=d([115,101,97,114,99,104,115,105,122,101,0],"i8",c);oga=d([115,117,112,49,0],"i8",c);pga=d([47,103,110,98,117,51,47,50,0],"i8",c);d([120,49,49,0],"i8",c);qga=d([115,117,112,0],"i8",c);rga=d([47,103,110,98,117,51,47,49,0],"i8",c);sga=d([47,97,99,99,101,110,116,55,47,54,0],"i8",c);tga=d([115,117,109,0],"i8",c);uga=d([47,100,97,114,107,50,56,47,56,0],"i8",c);vga=d([104,101,120,97,103,111,110,0],"i8",c);wga=d([112,115,58,109,97,112,0],"i8",c);xga=d([35,70,73,71,32,51,46,50,10,0],"i8",c);yga=d([115,117,98,101,0],"i8",c);zga=d([47,100,97,114,107,50,56,47,55,0],"i8",c);Aga=d([54,0],"i8",c);Uj=d([121,101,108,108,111,119,0],"i8",c);Bga=d([115,117,98,0],"i8",c);Cga=d([47,100,97,114,107,50,56,47,54,0],"i8",c);WS=d([32,99,114,101,97,116,101,32,111,118,97,108,32,0],"i8",c);Dga=d([115,112,97,100,101,115,0],"i8",c);Ega=d([47,100,97,114,107,50,56,47,53,0],"i8",c);Fga=d([66,111,111,107,109,97,110,45,76,105,103,104,116,73,116,97,108,105,99,0],"i8",c);QQ=d([120,100,111,116,118,101,114,115,105,111,110,0],"i8",c);Gga=d([115,105,109,0],"i8",c);Hga=d([47,100,97,114,107,50,56,47,52,0],"i8",c);d([46,46,46,32,37,115,32,46,46,46,10,0],"i8",c);jv=d([114,101,99,111,114,100,0],"i8",c);EA=d([100,97,114,107,103,111,108,100,101,110,114,111,100,0],"i8",c);d([60,105,110,116,101,114,110,97,108,62,0],"i8",c);Iga=d([115,105,103,109,97,102,0],"i8",c);Jga=d([47,100,97,114,107,50,56,47,51,0],"i8",c);Kga=d([66,77,0],"i8",c);BF=d([111,109,112,111,117,110,100,0],"i8",c);Lga=d([47,72,101,108,118,101,116,105,99,97,45,66,111,108,100,79,98,108,105,113,117,101,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);FR=d([37,100,44,37,100,44,37,100,0],"i8",c);Mga=d([115,105,103,109,97,0],"i8",c);Nga=d([47,100,97,114,107,50,56,47,50,0],"i8",c);Oga=d([115,104,121,0],"i8",c);Pga=d([47,100,97,114,107,50,56,47,49,0],"i8",c);CR=d([32,99,111,111,114,100,115,61,34,0],"i8",c);Xk=d([115,104,97,112,101,102,105,108,101,0],"i8",c);hI=d([47,37,115,47,37,115,0],"i8",c);mp=d([88,49,49,47,0],"i8",c);fI=d([105,103,104,116,103,114,101,121,0],"i8",c);eI=d([104,105,116,101,0],"i8",c);dI=d([108,97,99,107,0],"i8",c);GO=d([110,32,33,61,32,78,68,95,110,101,120,116,40,110,41,0],"i8",c);Qga=d([121,101,108,108,111,119,52,0],"i8",c);Rga=d([121,101,108,108,111,119,51,0],"i8",c);Sga=d([115,101,99,116,0],"i8",c);Tga=d([47,100,97,114,107,50,55,47,55,0],"i8",c);Uga=d([121,101,108,108,111,119,50,0],"i8",c);Vga=d([121,101,108,108,111,119,49,0],"i8",c);d([116,105,102,102,47,116,105,102,0],"i8",c);Wga=d([119,104,101,97,116,52,0],"i8",c);Xga=d([119,104,101,97,116,51,0],"i8",c);Yga=d([119,104,101,97,116,50,0],"i8",c);Zga=d([119,104,101,97,116,49,0],"i8",c);$ga=d([115,100,111,116,0],"i8",c);aha=d([47,100,97,114,107,50,55,47,54,0],"i8",c);bha=d([118,105,111,108,101,116,114,101,100,52,0],"i8",c);cha=d([118,105,111,108,101,116,114,101,100,51,0],"i8",c);dha=d([118,105,111,108,101,116,114,101,100,50,0],"i8",c);eha=d([118,105,111,108,101,116,114,101,100,49,0],"i8",c);fha=d([118,105,111,108,101,116,114,101,100,0],"i8",c);yo=d([38,103,116,59,0],"i8",c);gha=d([47,97,99,99,101,110,116,55,47,53,0],"i8",c);hha=d([116,117,114,113,117,111,105,115,101,52,0],"i8",c);iha=d([116,117,114,113,117,111,105,115,101,51,0],"i8",c);jha=d([116,117,114,113,117,111,105,115,101,50,0],"i8",c);kha=d([116,117,114,113,117,111,105,115,101,49,0],"i8",c);lha=d([115,99,97,114,111,110,0],"i8",c);mha=d([47,100,97,114,107,50,55,47,53,0],"i8",c);On=d([116,114,97,110,115,112,97,114,101,110,116,0],"i8",c);nha=d([115,98,113,117,111,0],"i8",c);oha=d([116,111,109,97,116,111,52,0],"i8",c);pha=d([116,111,109,97,116,111,51,0],"i8",c);qha=d([116,111,109,97,116,111,50,0],"i8",c);rha=d([112,101,110,116,97,103,111,110,0],"i8",c);sha=d([106,112,103,58,109,97,112,0],"i8",c);tha=d([116,111,109,97,116,111,49,0],"i8",c);uha=d([116,104,105,115,116,108,101,52,0],"i8",c);vha=d([35,32,101,110,100,32,111,102,32,70,73,71,32,102,105,108,101,10,0],"i8",c);wha=d([116,104,105,115,116,108,101,51,0],"i8",c);xha=d([116,104,105,115,116,108,101,50,0],"i8",c);yha=d([47,100,97,114,107,50,55,47,52,0],"i8",c);zha=d([116,104,105,115,116,108,101,49,0],"i8",c);Aha=d([116,97,110,52,0],"i8",c);Bha=d([53,0],"i8",c);Cha=d([116,97,110,51,0],"i8",c);Dha=d([116,97,110,50,0],"i8",c);Eha=d([116,97,110,49,0],"i8",c);Fha=d([115,116,101,101,108,98,108,117,101,52,0],"i8",c);Gha=d([115,116,101,101,108,98,108,117,101,51,0],"i8",c);hf=d([119,104,105,116,101,0],"i8",c);Hha=d([115,116,101,101,108,98,108,117,101,50,0],"i8",c);Iha=d([114,115,113,117,111,0],"i8",c);Jha=d([47,100,97,114,107,50,55,47,51,0],"i8",c);Kha=d([115,116,101,101,108,98,108,117,101,49,0],"i8",c);Lha=d([115,112,114,105,110,103,103,114,101,101,110,52,0],"i8",c);Mha=d([115,112,114,105,110,103,103,114,101,101,110,51,0],"i8",c);Cy=d([32,45,111,117,116,108,105,110,101,32,0],"i8",c);Nha=d([115,112,114,105,110,103,103,114,101,101,110,50,0],"i8",c);Oha=d([115,112,114,105,110,103,103,114,101,101,110,49,0],"i8",c);Pha=d([115,110,111,119,52,0],"i8",c);Qha=d([115,110,111,119,51,0],"i8",c);Rha=d([115,110,111,119,50,0],"i8",c);Sha=d([114,115,97,113,117,111,0],"i8",c);Tha=d([47,100,97,114,107,50,55,47,50,0],"i8",c);Uha=d([115,110,111,119,49,0],"i8",c);FA=d([108,105,103,104,116,0],"i8",c);Vha=d([115,108,97,116,101,103,114,97,121,52,0],"i8",c);Wha=d([115,108,97,116,101,103,114,97,121,51,0],"i8",c);Xha=d([115,108,97,116,101,103,114,97,121,50,0],"i8",c);Yha=d([35,32,0],"i8",c);Zha=d([115,108,97,116,101,103,114,97,121,49,0],"i8",c);$ha=d([115,108,97,116,101,98,108,117,101,52,0],"i8",c);Di=d([95,100,114,97,119,95,0],"i8",c);aia=d([115,108,97,116,101,98,108,117,101,51,0],"i8",c);bia=d([114,108,109,0],"i8",c);cia=d([47,100,97,114,107,50,55,47,49,0],"i8",c);dia=d([115,108,97,116,101,98,108,117,101,50,0],"i8",c);eia=d([115,108,97,116,101,98,108,117,101,49,0],"i8",c);xp=d([37,46,53,103,0],"i8",c);fia=d([115,107,121,98,108,117,101,52,0],"i8",c);gia=d([115,107,121,98,108,117,101,51,0],"i8",c);hia=d([115,107,121,98,108,117,101,50,0],"i8",c);iia=d([100,97,114,107,99,121,97,110,0],"i8",c);jia=d([115,107,121,98,108,117,101,49,0],"i8",c);kia=d([115,105,101,110,110,97,52,0],"i8",c);lia=d([115,105,101,110,110,97,51,0],"i8",c);mia=d([114,104,111,0],"i8",c);nia=d([47,100,97,114,107,50,54,47,54,0],"i8",c);oia=d([115,105,101,110,110,97,50,0],"i8",c);pia=d([115,105,101,110,110,97,49,0],"i8",c);qia=d([115,101,97,115,104,101,108,108,52,0],"i8",c);ria=d([115,101,97,115,104,101,108,108,51,0],"i8",c);sia=d([115,101,97,115,104,101,108,108,50,0],"i8",c);wF=d([85,84,70,56,32,99,111,100,101,115,32,62,32,51,32,98,121,116,101,115,32,97,114,101,32,110,111,116,32,99,117,114,114,101,110,116,108,121,32,115,117,112,112,111,114,116,101,100,46,32,79,114,32,112,101,114,104,97,112,115,32,34,45,71,99,104,97,114,115,101,116,61,108,97,116,105,110,49,34,32,105,115,32,110,101,101,100,101,100,63,10,0],"i8",c);tia=d([47,72,101,108,118,101,116,105,99,97,45,66,111,108,100,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);uia=d([115,101,97,115,104,101,108,108,49,0],"i8",c);via=d([115,101,97,103,114,101,101,110,52,0],"i8",c);wia=d([115,101,97,103,114,101,101,110,51,0],"i8",c);xia=d([114,102,108,111,111,114,0],"i8",c);yia=d([47,100,97,114,107,50,54,47,53,0],"i8",c);zia=d([115,101,97,103,114,101,101,110,50,0],"i8",c);Aia=d([115,101,97,103,114,101,101,110,49,0],"i8",c);Bia=d([115,97,108,109,111,110,52,0],"i8",c);Cia=d([115,97,108,109,111,110,51,0],"i8",c);Dia=d([115,97,108,109,111,110,50,0],"i8",c);Eia=d([115,97,108,109,111,110,49,0],"i8",c);Fia=d([114,101,103,0],"i8",c);Gia=d([116,101,101,0],"i8",c);Hia=d([47,100,97,114,107,50,54,47,52,0],"i8",c);Iia=d([114,111,121,97,108,98,108,117,101,52,0],"i8",c);BR=d([32,97,108,116,61,34,34,0],"i8",c);Jia=d([114,111,121,97,108,98,108,117,101,51,0],"i8",c);Kia=d([114,111,121,97,108,98,108,117,101,50,0],"i8",c);Lia=d([114,111,121,97,108,98,108,117,101,49,0],"i8",c);Mia=d([114,111,115,121,98,114,111,119,110,52,0],"i8",c);Nia=d([114,111,115,121,98,114,111,119,110,51,0],"i8",c);Oia=d([75,80,95,76,101,102,116,0],"i8",c);Pia=d([114,111,115,121,98,114,111,119,110,50,0],"i8",c);Qia=d([114,111,115,121,98,114,111,119,110,49,0],"i8",c);Ria=d([114,101,97,108,0],"i8",c);Sia=d([47,100,97,114,107,50,54,47,51,0],"i8",c);Tia=d([114,101,100,52,0],"i8",c);Uia=d([114,101,100,51,0],"i8",c);Via=d([114,101,100,50,0],"i8",c);Wia=d([114,101,100,49,0],"i8",c);Xia=d([112,117,114,112,108,101,52,0],"i8",c);d([116,105,102,0],"i8",c);Yia=d([112,117,114,112,108,101,51,0],"i8",c);Zia=d([112,117,114,112,108,101,50,0],"i8",c);$ia=d([112,117,114,112,108,101,49,0],"i8",c);aja=d([114,100,113,117,111,0],"i8",c);bja=d([47,100,97,114,107,50,54,47,50,0],"i8",c);cja=d([112,108,117,109,52,0],"i8",c);dja=d([112,108,117,109,51,0],"i8",c);eja=d([112,108,117,109,50,0],"i8",c);fja=d([112,108,117,109,49,0],"i8",c);gja=d([47,97,99,99,101,110,116,55,47,52,0],"i8",c);hja=d([112,105,110,107,52,0],"i8",c);ija=d([112,105,110,107,51,0],"i8",c);jja=d([112,105,110,107,50,0],"i8",c);kja=d([112,105,110,107,49,0],"i8",c);lja=d([114,99,101,105,108,0],"i8",c);mja=d([47,100,97,114,107,50,54,47,49,0],"i8",c);nja=d([112,101,97,99,104,112,117,102,102,52,0],"i8",c);oja=d([112,101,97,99,104,112,117,102,102,51,0],"i8",c);pja=d([112,101,97,99,104,112,117,102,102,50,0],"i8",c);qja=d([104,111,117,115,101,0],"i8",c);rja=d([106,112,101,58,109,97,112,0],"i8",c);sja=d([112,101,97,99,104,112,117,102,102,49,0],"i8",c);tja=d([112,97,108,101,118,105,111,108,101,116,114,101,100,52,0],"i8",c);lR=d([37,48,51,111,0],"i8",c);uja=d([112,97,108,101,118,105,111,108,101,116,114,101,100,51,0],"i8",c);vja=d([114,97,114,114,0],"i8",c);wja=d([47,100,97,114,107,50,53,47,53,0],"i8",c);xja=d([112,97,108,101,118,105,111,108,101,116,114,101,100,50,0],"i8",c);yja=d([112,97,108,101,118,105,111,108,101,116,114,101,100,49,0],"i8",c);zja=d([52,0],"i8",c);Aja=d([112,97,108,101,116,117,114,113,117,111,105,115,101,52,0],"i8",c);Bja=d([112,97,108,101,116,117,114,113,117,111,105,115,101,51,0],"i8",c);Cja=d([112,97,108,101,116,117,114,113,117,111,105,115,101,50,0],"i8",c);Dja=d([112,97,108,101,116,117,114,113,117,111,105,115,101,49,0],"i8",c);Eja=d([112,97,108,101,103,114,101,101,110,52,0],"i8",c);Fja=d([112,97,108,101,103,114,101,101,110,51,0],"i8",c);Gja=d([114,97,113,117,111,0],"i8",c);GA=d([116,101,97,108,0],"i8",c);Hja=d([47,100,97,114,107,50,53,47,52,0],"i8",c);Ija=d([112,97,108,101,103,114,101,101,110,50,0],"i8",c);Jja=d([112,97,108,101,103,114,101,101,110,49,0],"i8",c);Kja=d([111,114,99,104,105,100,52,0],"i8",c);Lja=d([111,114,99,104,105,100,51,0],"i8",c);eG=d([99,111,117,114,0],"i8",c);Mja=d([111,114,99,104,105,100,50,0],"i8",c);Nja=d([111,114,99,104,105,100,49,0],"i8",c);Oja=d([111,114,97,110,103,101,114,101,100,52,0],"i8",c);Pja=d([114,97,110,103,0],"i8",c);Qja=d([47,100,97,114,107,50,53,47,51,0],"i8",c);Rja=d([111,114,97,110,103,101,114,101,100,51,0],"i8",c);Sja=d([111,114,97,110,103,101,114,101,100,50,0],"i8",c);Tja=d([111,114,97,110,103,101,114,101,100,49,0],"i8",c);Uja=d([66,111,111,107,109,97,110,45,76,105,103,104,116,0],"i8",c);Vja=d([111,114,97,110,103,101,52,0],"i8",c);Wja=d([111,114,97,110,103,101,51,0],"i8",c);Xja=d([111,114,97,110,103,101,50,0],"i8",c);dM=d([110,111,110,116,101,114,109,105,110,97,116,101,100,32,99,111,109,109,101,110,116,32,105,110,32,108,105,110,101,32,37,100,10,0],"i8",c);Yja=d([111,114,97,110,103,101,49,0],"i8",c);d([105,110,32,117,115,101,32,98,121,116,101,115,32,32,32,32,32,61,32,37,49,48,108,117,10,0],"i8",c);Zja=d([84,32,0],"i8",c);$ja=d([111,108,105,118,101,100,114,97,98,52,0],"i8",c);aka=d([114,97,100,105,99,0],"i8",c);bka=d([100,111,116,32,100,111,101,115,32,110,111,116,32,115,117,112,112,111,114,116,32,116,104,101,32,97,115,112,101,99,116,32,97,116,116,114,105,98,117,116,101,32,102,111,114,32,100,105,115,99,111,110,110,101,99,116,101,100,32,103,114,97,112,104,115,32,111,114,32,103,114,97,112,104,115,32,119,105,116,104,32,99,108,117,115,116,101,114,115,10,0],"i8",c);cka=d([47,100,97,114,107,50,53,47,50,0],"i8",c);dka=d([111,108,105,118,101,100,114,97,98,51,0],"i8",c);eka=d([111,108,105,118,101,100,114,97,98,50,0],"i8",c);Tl=d([93,59,10,0],"i8",c);fka=d([111,108,105,118,101,100,114,97,98,49,0],"i8",c);SJ=d([44,37,46,53,103,0],"i8",c);d([85,110,97,98,108,101,32,116,111,32,102,105,110,100,32,101,118,101,110,32,116,104,101,32,100,101,102,97,117,108,116,32,34,45,84,100,111,116,34,32,114,101,110,100,101,114,101,114,46,32,32,72,97,115,32,116,104,101,32,99,111,110,102,105,103,10,102,105,108,101,32,98,101,101,110,32,103,101,110,101,114,97,116,101,100,32,98,121,32,114,117,110,110,105,110,103,32,34,100,111,116,32,45,99,34,32,119,105,116,104,32,105,110,115,116,97,108,108,101,114,39,115,32,112,114,105,118,105,108,101,100,103,101,115,63,10,0],"i8",c);gka=d([100,97,114,107,98,108,117,101,0],"i8",c);hka=d([110,97,118,121,98,108,117,101,0],"i8",c);ika=d([110,97,118,97,106,111,119,104,105,116,101,52,0],"i8",c);jka=d([110,97,118,97,106,111,119,104,105,116,101,51,0],"i8",c);kka=d([114,65,114,114,0],"i8",c);lka=d([47,100,97,114,107,50,53,47,49,0],"i8",c);mka=d([110,97,118,97,106,111,119,104,105,116,101,50,0],"i8",c);nka=d([110,97,118,97,106,111,119,104,105,116,101,49,0],"i8",c);oka=d([109,105,115,116,121,114,111,115,101,52,0],"i8",c);pka=d([37,33,80,83,45,65,100,111,98,101,45,0],"i8",c);qka=d([109,105,115,116,121,114,111,115,101,51,0],"i8",c);dt=d([73,110,118,97,108,105,100,32,51,45,98,121,116,101,32,85,84,70,56,32,102,111,117,110,100,32,105,110,32,105,110,112,117,116,46,32,80,101,114,104,97,112,115,32,34,45,71,99,104,97,114,115,101,116,61,108,97,116,105,110,49,34,32,105,115,32,110,101,101,100,101,100,63,10,0],"i8",c);rka=d([47,72,101,108,118,101,116,105,99,97,45,79,98,108,105,113,117,101,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);ska=d([109,105,115,116,121,114,111,115,101,50,0],"i8",c);wO=d([120,120,120,0],"i8",c);tka=d([109,105,115,116,121,114,111,115,101,49,0],"i8",c);uka=d([113,117,111,116,0],"i8",c);vka=d([47,100,97,114,107,50,52,47,52,0],"i8",c);UF=d([105,110,32,108,97,98,101,108,32,111,102,32,101,100,103,101,32,37,115,32,37,115,32,37,115,10,0],"i8",c);wka=d([109,101,100,105,117,109,112,117,114,112,108,101,52,0],"i8",c);xka=d([109,101,100,105,117,109,112,117,114,112,108,101,51,0],"i8",c);yka=d([109,101,100,105,117,109,112,117,114,112,108,101,50,0],"i8",c);zka=d([109,101,100,105,117,109,112,117,114,112,108,101,49,0],"i8",c);Aka=d([112,115,105,0],"i8",c);Bka=d([47,100,97,114,107,50,52,47,51,0],"i8",c);Cka=d([109,101,100,105,117,109,111,114,99,104,105,100,52,0],"i8",c);AR=d([32,116,105,116,108,101,61,34,0],"i8",c);Dka=d([109,101,100,105,117,109,111,114,99,104,105,100,51,0],"i8",c);Eka=d([109,101,100,105,117,109,111,114,99,104,105,100,50,0],"i8",c);Fka=d([109,101,100,105,117,109,111,114,99,104,105,100,49,0],"i8",c);jN=d([69,68,95,116,111,95,118,105,114,116,40,111,114,105,103,41,32,61,61,32,78,85,76,76,0],"i8",c);Gka=d([109,97,114,111,111,110,52,0],"i8",c);Hka=d([109,97,114,111,111,110,51,0],"i8",c);Ika=d([112,114,111,112,0],"i8",c);Jka=d([47,100,97,114,107,50,52,47,50,0],"i8",c);Kka=d([109,97,114,111,111,110,50,0],"i8",c);Lka=d([109,97,114,111,111,110,49,0],"i8",c);Mka=d([109,97,103,101,110,116,97,52,0],"i8",c);Nka=d([109,97,103,101,110,116,97,51,0],"i8",c);Oka=d([109,97,103,101,110,116,97,50,0],"i8",c);Pka=d([109,97,103,101,110,116,97,49,0],"i8",c);d([106,112,101,103,47,106,112,101,47,106,112,103,0],"i8",c);Qka=d([112,114,111,100,0],"i8",c);Rka=d([47,100,97,114,107,50,52,47,49,0],"i8",c);Ska=d([108,105,103,104,116,121,101,108,108,111,119,52,0],"i8",c);Tka=d([108,105,103,104,116,121,101,108,108,111,119,51,0],"i8",c);Uka=d([108,105,103,104,116,121,101,108,108,111,119,50,0],"i8",c);Vka=d([108,105,103,104,116,121,101,108,108,111,119,49,0],"i8",c);sC=d([80,114,111,116,111,71,114,97,112,104,0],"i8",c);Wka=d([108,105,103,104,116,115,116,101,101,108,98,108,117,101,52,0],"i8",c);Xka=d([47,97,99,99,101,110,116,55,47,51,0],"i8",c);Yka=d([108,105,103,104,116,115,116,101,101,108,98,108,117,101,51,0],"i8",c);Zka=d([108,105,103,104,116,115,116,101,101,108,98,108,117,101,50,0],"i8",c);$ka=d([108,105,103,104,116,115,116,101,101,108,98,108,117,101,49,0],"i8",c);ala=d([112,114,105,109,101,0],"i8",c);bla=d([47,100,97,114,107,50,51,47,51,0],"i8",c);cla=d([108,105,103,104,116,115,108,97,116,101,98,108,117,101,0],"i8",c);OJ=d([110,111,100,101,32,0],"i8",c);dla=d([108,105,103,104,116,115,107,121,98,108,117,101,52,0],"i8",c);ela=d([108,105,103,104,116,115,107,121,98,108,117,101,51,0],"i8",c);fla=d([112,97,114,97,108,108,101,108,111,103,114,97,109,0],"i8",c);gla=d([108,105,103,104,116,115,107,121,98,108,117,101,50,0],"i8",c);hla=d([106,112,101,103,58,109,97,112,0],"i8",c);ila=d([108,105,103,104,116,115,107,121,98,108,117,101,49,0],"i8",c);jla=d([108,105,103,104,116,115,97,108,109,111,110,52,0],"i8",c);kla=d([112,111,117,110,100,0],"i8",c);lla=d([47,100,97,114,107,50,51,47,50,0],"i8",c);$Q=d([37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,46,49,102,32,37,46,52,102,32,37,100,32,37,46,49,102,32,37,46,49,102,32,37,100,32,37,100,32,37,115,92,48,48,49,10,0],"i8",c);mla=d([108,105,103,104,116,115,97,108,109,111,110,51,0],"i8",c);nla=d([108,105,103,104,116,115,97,108,109,111,110,50,0],"i8",c);ola=d([108,105,103,104,116,115,97,108,109,111,110,49,0],"i8",c);pla=d([51,0],"i8",c);qla=d([108,105,103,104,116,112,105,110,107,52,0],"i8",c);rla=d([108,105,103,104,116,112,105,110,107,51,0],"i8",c);sla=d([108,105,103,104,116,112,105,110,107,50,0],"i8",c);tla=d([97,115,112,101,99,116,0],"i8",c);d([71,86,95,70,73,76,69,95,80,65,84,72,0],"i8",c);ula=d([108,105,103,104,116,112,105,110,107,49,0],"i8",c);vla=d([112,108,117,115,109,110,0],"i8",c);HA=d([115,105,108,118,101,114,0],"i8",c);wla=d([47,100,97,114,107,50,51,47,49,0],"i8",c);xla=d([108,105,103,104,116,103,111,108,100,101,110,114,111,100,52,0],"i8",c);yla=d([108,105,103,104,116,103,111,108,100,101,110,114,111,100,51,0],"i8",c);YS=d([32,99,114,101,97,116,101,32,112,111,108,121,103,111,110,32,0],"i8",c);zla=d([108,105,103,104,116,103,111,108,100,101,110,114,111,100,50,0],"i8",c);Ala=d([108,105,103,104,116,103,111,108,100,101,110,114,111,100,49,0],"i8",c);Bla=d([60,33,45,45,32,71,101,110,101,114,97,116,101,100,32,98,121,32,0],"i8",c);Cla=d([108,105,103,104,116,103,111,108,100,101,110,114,111,100,0],"i8",c);Dla=d([108,105,103,104,116,99,121,97,110,52,0],"i8",c);Ela=d([108,105,103,104,116,99,121,97,110,51,0],"i8",c);Fla=d([108,105,103,104,116,99,121,97,110,50,0],"i8",c);Gla=d([112,105,118,0],"i8",c);Hla=d([47,98,117,112,117,57,47,57,0],"i8",c);Ila=d([108,105,103,104,116,99,121,97,110,49,0],"i8",c);Jla=d([66,111,111,107,109,97,110,45,68,101,109,105,73,116,97,108,105,99,0],"i8",c);Kla=d([108,105,103,104,116,98,108,117,101,52,0],"i8",c);Lla=d([108,105,103,104,116,98,108,117,101,51,0],"i8",c);Mla=d([108,105,103,104,116,98,108,117,101,50,0],"i8",c);Nla=d([32,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,71,114,97,112,104,105,99,115,47,83,86,71,47,49,46,49,47,68,84,68,47,115,118,103,49,49,46,100,116,100,34,62,10,0],"i8",c);Ola=d([108,105,103,104,116,98,108,117,101,49,0],"i8",c);Pla=d([108,101,109,111,110,99,104,105,102,102,111,110,52,0],"i8",c);Qla=d([70,32,37,102,32,0],"i8",c);Rla=d([108,101,109,111,110,99,104,105,102,102,111,110,51,0],"i8",c);Sla=d([112,105,0],"i8",c);Tla=d([47,98,117,112,117,57,47,56,0],"i8",c);Ula=d([108,101,109,111,110,99,104,105,102,102,111,110,50,0],"i8",c);Vla=d([108,101,109,111,110,99,104,105,102,102,111,110,49,0],"i8",c);RJ=d([37,46,53,103,44,37,46,53,103,44,37,46,53,103,0],"i8",c);Wla=d([108,97,118,101,110,100,101,114,98,108,117,115,104,52,0],"i8",c);Xla=d([108,97,118,101,110,100,101,114,98,108,117,115,104,51,0],"i8",c);gn=d([99,121,97,110,0],"i8",c);Yla=d([60,33,68,79,67,84,89,80,69,32,115,118,103,32,80,85,66,76,73,67,32,34,45,47,47,87,51,67,47,47,68,84,68,32,83,86,71,32,49,46,49,47,47,69,78,34,10,0],"i8",c);Zla=d([108,97,118,101,110,100,101,114,98,108,117,115,104,50,0],"i8",c);VN=d([78,68,95,105,110,40,114,105,103,104,116,41,46,115,105,122,101,32,43,32,78,68,95,111,117,116,40,114,105,103,104,116,41,46,115,105,122,101,32,61,61,32,48,0],"i8",c);$la=d([112,104,105,0],"i8",c);ama=d([108,97,118,101,110,100,101,114,98,108,117,115,104,49,0],"i8",c);TC=d([32,32,34,37,115,34,10,0],"i8",c);bma=d([47,98,117,112,117,57,47,55,0],"i8",c);cma=d([107,104,97,107,105,52,0],"i8",c);dma=d([107,104,97,107,105,51,0],"i8",c);IA=d([97,108,105,99,101,98,108,117,101,0],"i8",c);ema=d([107,104,97,107,105,50,0],"i8",c);fma=d([107,104,97,107,105,49,0],"i8",c);gma=d([112,110,103,0],"i8",c);hma=d([105,118,111,114,121,52,0],"i8",c);xF=d([73,110,118,97,108,105,100,32,50,45,98,121,116,101,32,85,84,70,56,32,102,111,117,110,100,32,105,110,32,105,110,112,117,116,46,32,80,101,114,104,97,112,115,32,34,45,71,99,104,97,114,115,101,116,61,108,97,116,105,110,49,34,32,105,115,32,110,101,101,100,101,100,63,10,0],"i8",c);ima=d([47,72,101,108,118,101,116,105,99,97,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);jma=d([34,32,116,121,112,101,61,34,116,101,120,116,47,99,115,115,34,63,62,10,0],"i8",c);kma=d([105,118,111,114,121,51,0],"i8",c);pv=d([78,111,32,108,105,98,122,32,115,117,112,112,111,114,116,46,10,0],"i8",c);lma=d([105,118,111,114,121,50,0],"i8",c);mma=d([105,118,111,114,121,49,0],"i8",c);nma=d([112,101,114,112,0],"i8",c);oma=d([47,98,117,112,117,57,47,54,0],"i8",c);pma=d([105,110,100,105,97,110,114,101,100,52,0],"i8",c);qma=d([105,110,100,105,97,110,114,101,100,51,0],"i8",c);rma=d([105,110,100,105,97,110,114,101,100,50,0],"i8",c);sma=d([105,110,100,105,97,110,114,101,100,49,0],"i8",c);tma=d([60,63,120,109,108,45,115,116,121,108,101,115,104,101,101,116,32,104,114,101,102,61,34,0],"i8",c);uma=d([104,111,116,112,105,110,107,52,0],"i8",c);vma=d([104,111,116,112,105,110,107,51,0],"i8",c);wma=d([104,111,116,112,105,110,107,50,0],"i8",c);xma=d([112,101,114,109,105,108,0],"i8",c);yma=d([47,98,117,112,117,57,47,53,0],"i8",c);zma=d([104,111,116,112,105,110,107,49,0],"i8",c);Ama=d([104,111,110,101,121,100,101,119,52,0],"i8",c);Bma=d([104,111,110,101,121,100,101,119,51,0],"i8",c);Cma=d([104,111,110,101,121,100,101,119,50,0],"i8",c);Dma=d([104,111,110,101,121,100,101,119,49,0],"i8",c);Ema=d([115,116,121,108,101,115,104,101,101,116,0],"i8",c);Fma=d([103,114,101,121,57,57,0],"i8",c);Gma=d([103,114,101,121,57,56,0],"i8",c);Hma=d([103,114,101,121,57,55,0],"i8",c);Ima=d([112,97,114,116,0],"i8",c);Jma=d([47,98,117,112,117,57,47,52,0],"i8",c);Kma=d([103,114,101,121,57,54,0],"i8",c);Lma=d([103,114,101,121,57,53,0],"i8",c);Mma=d([103,114,101,121,57,52,0],"i8",c);Nma=d([103,114,101,121,57,51,0],"i8",c);Oma=d([103,114,101,121,57,50,0],"i8",c);Pma=d([103,114,101,121,57,49,0],"i8",c);Qma=d([60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,32,115,116,97,110,100,97,108,111,110,101,61,34,110,111,34,63,62,10,0],"i8",c);Rma=d([103,114,101,121,57,48,0],"i8",c);Sma=d([103,114,101,121,57,0],"i8",c);d([106,112,0],"i8",c);Tma=d([103,114,101,121,56,57,0],"i8",c);Uma=d([103,114,101,121,56,56,0],"i8",c);Vma=d([112,97,114,97,0],"i8",c);Wma=d([47,98,117,112,117,57,47,51,0],"i8",c);Xma=d([103,114,101,121,56,55,0],"i8",c);Yma=d([103,114,101,121,56,54,0],"i8",c);Zma=d([103,114,101,121,56,53,0],"i8",c);$ma=d([103,114,101,121,56,52,0],"i8",c);ana=d([103,114,101,121,56,51,0],"i8",c);bna=d([103,114,101,121,56,50,0],"i8",c);cna=d([47,97,99,99,101,110,116,55,47,50,0],"i8",c);dna=d([32,120,109,108,110,115,58,120,108,105,110,107,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,49,57,57,57,47,120,108,105,110,107,34,0],"i8",c);ena=d([103,114,101,121,56,49,0],"i8",c);fna=d([103,114,101,121,56,48,0],"i8",c);gna=d([103,114,101,121,56,0],"i8",c);hna=d([103,114,101,121,55,57,0],"i8",c);ina=d([111,117,109,108,0],"i8",c);jna=d([47,98,117,112,117,57,47,50,0],"i8",c);kna=d([103,114,101,121,55,56,0],"i8",c);lna=d([103,114,101,121,55,55,0],"i8",c);mna=d([103,114,101,121,55,54,0],"i8",c);nna=d([103,114,101,121,55,53,0],"i8",c);ona=d([103,114,101,121,55,52,0],"i8",c);pna=d([116,114,97,112,101,122,105,117,109,0],"i8",c);qna=d([103,114,101,121,55,51,0],"i8",c);rna=d([103,105,102,58,109,97,112,0],"i8",c);sna=d([32,120,109,108,110,115,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,50,48,48,48,47,115,118,103,34,0],"i8",c);tna=d([103,114,101,121,55,50,0],"i8",c);una=d([50,48,49,49,48,53,48,55,46,48,51,50,55,0],"i8",c);vna=d([103,114,101,121,55,49,0],"i8",c);wna=d([103,114,101,121,55,48,0],"i8",c);xna=d([103,114,101,121,55,0],"i8",c);yna=d([111,116,105,109,101,115,0],"i8",c);zna=d([47,98,117,112,117,57,47,49,0],"i8",c);Ana=d([103,114,101,121,54,57,0],"i8",c);Bna=d([103,114,101,121,54,56,0],"i8",c);Cna=d([103,114,101,121,54,55,0],"i8",c);Dna=d([103,114,101,121,54,54,0],"i8",c);Ena=d([50,0],"i8",c);Fna=d([103,114,101,121,54,53,0],"i8",c);DQ=d([116,111,111,32,109,97,110,121,32,115,97,109,101,123,104,101,97,100,44,116,97,105,108,125,32,103,114,111,117,112,115,32,102,111,114,32,110,111,100,101,32,37,115,10,0],"i8",c);Gna=d([103,114,101,121,54,52,0],"i8",c);Hna=d([32,118,105,101,119,66,111,120,61,34,37,46,50,102,32,37,46,50,102,32,37,46,50,102,32,37,46,50,102,34,0],"i8",c);Ina=d([103,114,101,121,54,51,0],"i8",c);FN=d([37,115,32,45,62,32,37,115,58,32,115,112,108,105,110,101,32,115,105,122,101,32,62,32,49,32,110,111,116,32,115,117,112,112,111,114,116,101,100,10,0],"i8",c);Jna=d([103,114,101,121,54,50,0],"i8",c);Kna=d([103,114,101,121,54,49,0],"i8",c);Lna=d([103,114,101,121,54,48,0],"i8",c);Mna=d([111,116,105,108,100,101,0],"i8",c);Vj=d([114,101,100,0],"i8",c);Nna=d([47,98,117,112,117,56,47,56,0],"i8",c);Ona=d([103,114,101,121,54,0],"i8",c);Pna=d([103,114,101,121,53,57,0],"i8",c);Qna=d([103,114,101,121,53,56,0],"i8",c);Rna=d([103,114,101,121,53,55,0],"i8",c);Sna=d([32,45,115,109,111,111,116,104,32,98,101,122,105,101,114,32,0],"i8",c);Tna=d([103,114,101,121,53,54,0],"i8",c);Una=d([103,114,101,121,53,53,0],"i8",c);Vna=d([60,115,118,103,32,119,105,100,116,104,61,34,37,100,112,116,34,32,104,101,105,103,104,116,61,34,37,100,112,116,34,10,0],"i8",c);Wna=d([103,114,101,121,53,52,0],"i8",c);Xna=d([103,114,101,121,53,51,0],"i8",c);Yna=d([103,114,101,121,53,50,0],"i8",c);Zna=d([103,114,101,121,53,49,0],"i8",c);$na=d([111,115,108,97,115,104,0],"i8",c);aoa=d([47,98,117,112,117,56,47,55,0],"i8",c);boa=d([103,114,101,121,53,48,0],"i8",c);coa=d([103,114,101,121,53,0],"i8",c);doa=d([103,114,101,121,52,57,0],"i8",c);qd=d([115,101,114,105,102,0],"i8",c);eoa=d([103,114,101,121,52,56,0],"i8",c);foa=d([103,114,101,121,52,55,0],"i8",c);goa=d([103,114,101,121,52,54,0],"i8",c);ym=d([114,97,110,107,46,99,0],"i8",c);hoa=d([32,80,97,103,101,115,58,32,37,100,32,45,45,62,10,0],"i8",c);ioa=d([103,114,101,121,52,53,0],"i8",c);joa=d([103,114,101,121,52,52,0],"i8",c);koa=d([103,114,101,121,52,51,0],"i8",c);IQ=d([101,32,0],"i8",c);loa=d([103,114,101,121,52,50,0],"i8",c);moa=d([111,114,100,109,0],"i8",c);noa=d([47,98,117,112,117,56,47,54,0],"i8",c);ooa=d([103,114,101,121,52,49,0],"i8",c);poa=d([103,114,101,121,52,48,0],"i8",c);qoa=d([103,114,101,121,52,0],"i8",c);roa=d([103,114,101,121,51,57,0],"i8",c);Ni=d([104,114,101,102,0],"i8",c);d([108,116,45,100,111,116,95,98,117,105,108,116,105,110,115,0],"i8",c);soa=d([103,114,101,121,51,56,0],"i8",c);toa=d([103,114,101,121,51,55,0],"i8",c);JA=d([99,114,105,109,115,111,110,0],"i8",c);uoa=d([103,114,101,121,51,54,0],"i8",c);voa=d([103,114,101,121,51,53,0],"i8",c);woa=d([103,114,101,121,51,52,0],"i8",c);xoa=d([103,114,101,121,51,51,0],"i8",c);yoa=d([111,114,100,102,0],"i8",c);zoa=d([47,98,117,112,117,56,47,53,0],"i8",c);Aoa=d([103,114,101,121,51,50,0],"i8",c);Boa=d([103,114,101,121,51,49,0],"i8",c);dQ=d([65,82,61,37,48,46,52,108,102,9,32,65,114,101,97,61,32,37,48,46,52,108,102,9,0],"i8",c);Coa=d([103,114,101,121,51,48,0],"i8",c);Doa=d([103,114,101,121,51,0],"i8",c);Eoa=d([103,114,101,121,50,57,0],"i8",c);yN=d([117,32,61,61,32,85,70,95,102,105,110,100,40,117,41,0],"i8",c);Foa=d([68,111,116,68,105,99,116,32,98,101,103,105,110,0],"i8",c);Goa=d([60,33,45,45,0],"i8",c);Hoa=d([137,80,78,71,13,10,26,10,0],"i8",c);Ioa=d([103,114,101,121,50,56,0],"i8",c);Joa=d([47,84,105,109,101,115,45,66,111,108,100,73,116,97,108,105,99,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);Dp=d([115,118,103,0],"i8",c);Koa=d([103,114,101,121,50,55,0],"i8",c);Loa=d([103,114,101,121,50,54,0],"i8",c);Moa=d([103,114,101,121,50,53,0],"i8",c);Noa=d([103,114,101,121,50,52,0],"i8",c);Ooa=d([111,114,0],"i8",c);Poa=d([47,98,117,112,117,56,47,52,0],"i8",c);Qoa=d([103,114,101,121,50,51,0],"i8",c);Roa=d([103,114,101,121,50,50,0],"i8",c);Soa=d([103,114,101,121,50,49,0],"i8",c);Toa=d([103,114,101,121,50,48,0],"i8",c);Uoa=d([103,114,101,121,50,0],"i8",c);Voa=d([60,47,115,118,103,62,10,0],"i8",c);Woa=d([103,114,101,121,49,57,0],"i8",c);Xoa=d([37,37,37,37,67,114,101,97,116,111,114,58,32,37,115,32,118,101,114,115,105,111,110,32,37,115,32,40,37,115,41,10,0],"i8",c);Yoa=d([103,114,101,121,49,56,0],"i8",c);Zoa=d([103,114,101,121,49,55,0],"i8",c);$oa=d([103,114,101,121,49,54,0],"i8",c);wp=d([115,111,108,105,100,0],"i8",c);apa=d([103,114,101,121,49,53,0],"i8",c);bpa=d([111,112,108,117,115,0],"i8",c);cpa=d([47,98,117,112,117,56,47,51,0],"i8",c);dpa=d([103,114,101,121,49,52,0],"i8",c);epa=d([103,114,101,121,49,51,0],"i8",c);fpa=d([103,114,101,121,49,50,0],"i8",c);gpa=d([103,114,101,121,49,49,0],"i8",c);zR=d([32,104,114,101,102,61,34,0],"i8",c);hpa=d([103,114,101,121,49,48,48,0],"i8",c);ipa=d([34,32,99,108,97,115,115,61,34,108,97,121,101,114,34,62,10,0],"i8",c);jpa=d([103,114,101,121,49,48,0],"i8",c);kpa=d([32,69,80,83,70,45,51,46,48,10,0],"i8",c);lpa=d([103,114,101,121,49,0],"i8",c);mpa=d([103,114,101,121,48,0],"i8",c);npa=d([111,109,105,99,114,111,110,0],"i8",c);opa=d([47,98,117,112,117,56,47,50,0],"i8",c);ppa=d([103,114,101,101,110,52,0],"i8",c);qpa=d([103,114,101,101,110,51,0],"i8",c);rpa=d([103,114,101,101,110,50,0],"i8",c);spa=d([103,114,101,101,110,49,0],"i8",c);tpa=d([32,116,114,97,110,115,102,111,114,109,61,34,115,99,97,108,101,40,37,103,32,37,103,41,32,114,111,116,97,116,101,40,37,100,41,32,116,114,97,110,115,108,97,116,101,40,37,103,32,37,103,41,34,62,10,0],"i8",c);upa=d([103,114,97,121,57,57,0],"i8",c);vpa=d([37,33,80,83,45,65,100,111,98,101,45,51,46,48,0],"i8",c);wpa=d([103,114,97,121,57,56,0],"i8",c);xpa=d([103,114,97,121,57,55,0],"i8",c);ypa=d([103,114,97,121,57,54,0],"i8",c);zpa=d([103,114,97,121,57,53,0],"i8",c);Apa=d([111,109,101,103,97,0],"i8",c);Bpa=d([47,98,117,112,117,56,47,49,0],"i8",c);Cpa=d([103,114,97,121,57,52,0],"i8",c);Dpa=d([103,114,97,121,57,51,0],"i8",c);Epa=d([103,114,97,121,57,50,0],"i8",c);Fpa=d([103,114,97,121,57,49,0],"i8",c);Gpa=d([103,114,97,121,57,48,0],"i8",c);Hpa=d([34,32,99,108,97,115,115,61,34,103,114,97,112,104,34,0],"i8",c);Ipa=d([103,114,97,121,57,0],"i8",c);Jpa=d([47,97,99,99,101,110,116,55,47,49,0],"i8",c);Kpa=d([37,37,69,79,70,10,0],"i8",c);Lpa=d([103,114,97,121,56,57,0],"i8",c);Mpa=d([103,114,97,121,56,56,0],"i8",c);Npa=d([103,114,97,121,56,55,0],"i8",c);Opa=d([103,114,97,121,56,54,0],"i8",c);Ppa=d([111,108,105,110,101,0],"i8",c);Qpa=d([47,98,117,112,117,55,47,55,0],"i8",c);Rpa=d([103,114,97,121,56,53,0],"i8",c);Spa=d([103,114,97,121,56,52,0],"i8",c);Tpa=d([103,114,97,121,56,51,0],"i8",c);Upa=d([103,114,97,121,56,50,0],"i8",c);Vpa=d([103,114,97,121,56,49,0],"i8",c);Wpa=d([34,32,99,108,97,115,115,61,34,99,108,117,115,116,101,114,34,62,0],"i8",c);KA=d([100,105,97,109,111,110,100,0],"i8",c);Xpa=d([103,114,97,121,56,48,0],"i8",c);Ypa=d([112,110,103,58,109,97,112,0],"i8",c);Zpa=d([101,110,100,10,114,101,115,116,111,114,101,10,0],"i8",c);$pa=d([103,114,97,121,56,0],"i8",c);aqa=d([103,114,97,121,55,57,0],"i8",c);bqa=d([103,114,97,121,55,56,0],"i8",c);cqa=d([103,114,97,121,55,55,0],"i8",c);dqa=d([111,103,114,97,118,101,0],"i8",c);eqa=d([47,98,117,112,117,55,47,54,0],"i8",c);fqa=d([103,114,97,121,55,54,0],"i8",c);gqa=d([103,114,97,121,55,53,0],"i8",c);bR=d([37,100,32,37,100,32,35,37,48,50,120,37,48,50,120,37,48,50,120,10,0],"i8",c);hqa=d([103,114,97,121,55,52,0],"i8",c);iqa=d([103,114,97,121,55,51,0],"i8",c);jqa=d([49,0],"i8",c);kqa=d([103,114,97,121,55,50,0],"i8",c);lqa=d([34,32,99,108,97,115,115,61,34,110,111,100,101,34,62,0],"i8",c);mqa=d([103,114,97,121,55,49,0],"i8",c);nqa=d([37,37,37,37,80,97,103,101,115,58,32,37,100,10,0],"i8",c);oqa=d([103,114,97,121,55,48,0],"i8",c);pqa=d([103,114,97,121,55,0],"i8",c);qqa=d([103,114,97,121,54,57,0],"i8",c);rqa=d([103,114,97,121,54,56,0],"i8",c);sqa=d([111,101,108,105,103,0],"i8",c);er=d([112,117,114,112,108,101,0],"i8",c);tqa=d([47,98,117,112,117,55,47,53,0],"i8",c);uqa=d([103,114,97,121,54,55,0],"i8",c);vqa=d([103,114,97,121,54,54,0],"i8",c);wqa=d([103,114,97,121,54,53,0],"i8",c);xqa=d([103,114,97,121,54,52,0],"i8",c);Jq=d([32,45,119,105,100,116,104,32,0],"i8",c);yqa=d([103,114,97,121,54,51,0],"i8",c);hn=d([60,47,116,105,116,108,101,62,10,0],"i8",c);zqa=d([103,114,97,121,54,50,0],"i8",c);Aqa=d([37,37,84,114,97,105,108,101,114,10,0],"i8",c);Bqa=d([103,114,97,121,54,49,0],"i8",c);Cqa=d([103,114,97,121,54,48,0],"i8",c);Dqa=d([103,114,97,121,54,0],"i8",c);Eqa=d([103,114,97,121,53,57,0],"i8",c);Fqa=d([111,99,105,114,99,0],"i8",c);Gqa=d([47,98,117,112,117,55,47,52,0],"i8",c);Hqa=d([103,114,97,121,53,56,0],"i8",c);Iqa=d([103,114,97,121,53,55,0],"i8",c);Jqa=d([103,114,97,121,53,54,0],"i8",c);jn=d([85,82,87,32,66,111,111,107,109,97,110,32,76,0],"i8",c);Kqa=d([103,114,97,121,53,53,0],"i8",c);Lqa=d([103,114,97,121,53,52,0],"i8",c);cg=d([92,69,0],"i8",c);Mqa=d([103,114,97,121,53,51,0],"i8",c);SR=d([91,32,123,67,97,116,97,108,111,103,125,32,60,60,32,47,85,82,73,32,60,60,32,47,66,97,115,101,32,40,37,115,41,32,62,62,32,62,62,10,47,80,85,84,32,112,100,102,109,97,114,107,10,0],"i8",c);Nqa=d([103,114,97,121,53,50,0],"i8",c);dl=d([92,76,0],"i8",c);Oqa=d([103,114,97,121,53,49,0],"i8",c);Pqa=d([103,114,97,121,53,48,0],"i8",c);JQ=d([69,32,0],"i8",c);Qqa=d([103,114,97,121,53,0],"i8",c);Rqa=d([111,97,99,117,116,101,0],"i8",c);aO=d([100,101,103,101,110,101,114,97,116,101,32,99,111,110,99,101,110,116,114,97,116,101,100,32,114,97,110,107,32,37,115,44,37,100,10,0],"i8",c);Sqa=d([47,98,117,112,117,55,47,51,0],"i8",c);Tqa=d([103,114,97,121,52,57,0],"i8",c);Uqa=d([103,114,97,121,52,56,0],"i8",c);Vqa=d([103,114,97,121,52,55,0],"i8",c);Gl=d([37,46,50,102,0],"i8",c);Wqa=d([103,114,97,121,52,54,0],"i8",c);Oi=d([85,82,76,0],"i8",c);d([108,116,45,100,111,116,0],"i8",c);Xqa=d([103,114,97,121,52,53,0],"i8",c);kn=d([60,116,105,116,108,101,62,0],"i8",c);Yqa=d([103,114,97,121,52,52,0],"i8",c);LA=d([99,111,114,110,115,105,108,107,0],"i8",c);RR=d([115,101,116,117,112,76,97,116,105,110,49,10,0],"i8",c);Zqa=d([103,114,97,121,52,51,0],"i8",c);$qa=d([103,114,97,121,52,50,0],"i8",c);ara=d([103,114,97,121,52,49,0],"i8",c);bra=d([103,114,97,121,52,48,0],"i8",c);cra=d([110,117,0],"i8",c);dra=d([47,98,117,112,117,55,47,50,0],"i8",c);era=d([103,114,97,121,52,0],"i8",c);fra=d([103,114,97,121,51,57,0],"i8",c);gra=d([103,114,97,121,51,56,0],"i8",c);hra=d([103,114,97,121,51,55,0],"i8",c);ira=d([103,114,97,121,51,54,0],"i8",c);jra=d([34,32,99,108,97,115,115,61,34,101,100,103,101,34,62,0],"i8",c);UK=d([40,108,105,98,41,0],"i8",c);kra=d([103,114,97,121,51,53,0],"i8",c);pF=d([95,95,99,108,117,115,116,101,114,110,111,100,101,115,0],"i8",c);MR=d([37,37,69,110,100,67,111,109,109,101,110,116,115,10,115,97,118,101,10,0],"i8",c);lra=d([47,84,105,109,101,115,45,66,111,108,100,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);mra=d([103,114,97,121,51,52,0],"i8",c);nra=d([103,114,97,121,51,51,0],"i8",c);ora=d([103,114,97,121,51,50,0],"i8",c);pra=d([103,114,97,121,51,49,0],"i8",c);qra=d([110,116,105,108,100,101,0],"i8",c);rra=d([47,98,117,112,117,55,47,49,0],"i8",c);sra=d([103,114,97,121,51,48,0],"i8",c);tra=d([103,114,97,121,51,0],"i8",c);ura=d([103,114,97,121,50,57,0],"i8",c);vra=d([103,114,97,121,50,56,0],"i8",c);wra=d([103,114,97,121,50,55,0],"i8",c);Wj=d([60,103,32,105,100,61,34,0],"i8",c);xra=d([103,114,97,121,50,54,0],"i8",c);wy=d([37,37,37,37,66,111,117,110,100,105,110,103,66,111,120,58,32,37,100,32,37,100,32,37,100,32,37,100,10,0],"i8",c);yra=d([103,114,97,121,50,53,0],"i8",c);zra=d([103,114,97,121,50,52,0],"i8",c);Ara=d([103,114,97,121,50,51,0],"i8",c);Bra=d([103,114,97,121,50,50,0],"i8",c);Cra=d([110,115,117,98,0],"i8",c);Dra=d([110,111,114,109,97,108,0],"i8",c);Era=d([47,98,117,112,117,54,47,54,0],"i8",c);Fra=d([103,114,97,121,50,49,0],"i8",c);Gra=d([103,114,97,121,50,48,0],"i8",c);Hra=d([103,114,97,121,50,0],"i8",c);Ira=d([103,114,97,121,49,57,0],"i8",c);Jra=d([103,114,97,121,49,56,0],"i8",c);Xj=d([60,47,103,62,10,0],"i8",c);Kra=d([103,114,97,121,49,55,0],"i8",c);LR=d([37,37,66,111,117,110,100,105,110,103,66,111,120,58,32,40,97,116,101,110,100,41,10,0],"i8",c);Lra=d([103,114,97,121,49,54,0],"i8",c);Mra=d([103,114,97,121,49,53,0],"i8",c);Nra=d([103,114,97,121,49,52,0],"i8",c);Ora=d([103,114,97,121,49,51,0],"i8",c);Pra=d([110,111,116,105,110,0],"i8",c);Qra=d([47,98,117,112,117,54,47,53,0],"i8",c);Rra=d([103,114,97,121,49,50,0],"i8",c);Sra=d([103,114,97,121,49,49,0],"i8",c);Tra=d([103,114,97,121,49,48,48,0],"i8",c);Ura=d([103,114,97,121,49,48,0],"i8",c);Vra=d([103,114,97,121,49,0],"i8",c);Wra=d([103,114,97,121,48,0],"i8",c);JR=d([37,37,80,97,103,101,115,58,32,49,10,0],"i8",c);Xra=d([103,111,108,100,101,110,114,111,100,52,0],"i8",c);Yra=d([103,111,108,100,101,110,114,111,100,51,0],"i8",c);Zra=d([103,111,108,100,101,110,114,111,100,50,0],"i8",c);$ra=d([110,111,116,0],"i8",c);asa=d([47,98,117,112,117,54,47,52,0],"i8",c);bsa=d([103,111,108,100,101,110,114,111,100,49,0],"i8",c);csa=d([103,111,108,100,52,0],"i8",c);dsa=d([103,111,108,100,51,0],"i8",c);esa=d([103,111,108,100,50,0],"i8",c);vy=d([32,116,97,114,103,101,116,61,34,0],"i8",c);fsa=d([103,111,108,100,49,0],"i8",c);gsa=d([47,97,99,99,101,110,116,54,47,54,0],"i8",c);KR=d([37,37,80,97,103,101,115,58,32,40,97,116,101,110,100,41,10,0],"i8",c);hsa=d([110,105,0],"i8",c);isa=d([47,98,117,112,117,54,47,51,0],"i8",c);jsa=d([102,105,114,101,98,114,105,99,107,52,0],"i8",c);ksa=d([102,105,114,101,98,114,105,99,107,51,0],"i8",c);lsa=d([102,105,114,101,98,114,105,99,107,50,0],"i8",c);msa=d([102,105,114,101,98,114,105,99,107,49,0],"i8",c);nsa=d([32,120,108,105,110,107,58,116,105,116,108,101,61,34,0],"i8",c);osa=d([112,108,97,105,110,116,101,120,116,0],"i8",c);psa=d([40,108,105,98,41,58,112,115,0],"i8",c);IR=d([37,37,37,37,84,105,116,108,101,58,32,37,115,10,0],"i8",c);qsa=d([100,111,100,103,101,114,98,108,117,101,52,0],"i8",c);rsa=d([100,111,100,103,101,114,98,108,117,101,51,0],"i8",c);ssa=d([100,111,100,103,101,114,98,108,117,101,50,0],"i8",c);tsa=d([100,111,100,103,101,114,98,108,117,101,49,0],"i8",c);usa=d([110,101,0],"i8",c);vsa=d([47,98,117,112,117,54,47,50,0],"i8",c);eR=d([37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,46,51,102,32,37,100,32,37,46,52,102,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,10,0],"i8",c);wsa=d([100,101,101,112,115,107,121,98,108,117,101,52,0],"i8",c);xsa=d([100,101,101,112,115,107,121,98,108,117,101,51,0],"i8",c);ysa=d([32,120,108,105,110,107,58,104,114,101,102,61,34,0],"i8",c);zsa=d([100,101,101,112,115,107,121,98,108,117,101,50,0],"i8",c);Asa=d([37,100,32,37,100,32,115,101,116,108,97,121,101,114,10,0],"i8",c);Bsa=d([100,101,101,112,115,107,121,98,108,117,101,49,0],"i8",c);Csa=d([100,101,101,112,112,105,110,107,52,0],"i8",c);Dsa=d([100,101,101,112,112,105,110,107,51,0],"i8",c);Esa=d([110,100,97,115,104,0],"i8",c);MA=d([111,108,105,118,101,0],"i8",c);Fsa=d([47,98,117,112,117,54,47,49,0],"i8",c);Gsa=d([100,101,101,112,112,105,110,107,50,0],"i8",c);Hsa=d([100,101,101,112,112,105,110,107,49,0],"i8",c);ZS=d([36,99,0],"i8",c);dS=d([91,32,47,67,114,111,112,66,111,120,32,91,37,100,32,37,100,32,37,100,32,37,100,93,32,47,80,65,71,69,83,32,112,100,102,109,97,114,107,10,0],"i8",c);Isa=d([100,97,114,107,115,108,97,116,101,103,114,97,121,52,0],"i8",c);Jsa=d([100,97,114,107,115,108,97,116,101,103,114,97,121,51,0],"i8",c);Ksa=d([100,97,114,107,115,108,97,116,101,103,114,97,121,50,0],"i8",c);Lsa=d([100,97,114,107,115,108,97,116,101,103,114,97,121,49,0],"i8",c);Msa=d([110,98,115,112,0],"i8",c);Nsa=d([47,98,117,112,117,53,47,53,0],"i8",c);lh=d([99,111,108,111,114,115,99,104,101,109,101,0],"i8",c);Osa=d([100,97,114,107,115,101,97,103,114,101,101,110,52,0],"i8",c);Psa=d([66,111,111,107,109,97,110,45,68,101,109,105,0],"i8",c);Qsa=d([100,97,114,107,115,101,97,103,114,101,101,110,51,0],"i8",c);Rsa=d([100,97,114,107,115,101,97,103,114,101,101,110,50,0],"i8",c);Ssa=d([100,97,114,107,115,101,97,103,114,101,101,110,49,0],"i8",c);cS=d([99,97,110,118,97,115,32,115,105,122,101,32,40,37,100,44,37,100,41,32,101,120,99,101,101,100,115,32,80,68,70,32,108,105,109,105,116,32,40,37,100,41,10,9,40,115,117,103,103,101,115,116,32,115,101,116,116,105,110,103,32,97,32,98,111,117,110,100,105,110,103,32,98,111,120,32,115,105,122,101,44,32,115,101,101,32,100,111,116,40,49,41,41,10,0],"i8",c);Ig=d([92,84,0],"i8",c);Tsa=d([100,97,114,107,111,114,99,104,105,100,52,0],"i8",c);OQ=d([67,32,0],"i8",c);Usa=d([100,97,114,107,111,114,99,104,105,100,51,0],"i8",c);Vsa=d([110,97,98,108,97,0],"i8",c);Wsa=d([47,98,117,112,117,53,47,52,0],"i8",c);Xsa=d([100,97,114,107,111,114,99,104,105,100,50,0],"i8",c);Ysa=d([100,97,114,107,111,114,99,104,105,100,49,0],"i8",c);Gf=d([37,46,53,103,44,37,46,53,103,0],"i8",c);Zsa=d([100,97,114,107,111,114,97,110,103,101,52,0],"i8",c);d([100,111,116,95,98,117,105,108,116,105,110,115,0],"i8",c);au=d([119,0],"i8",c);$sa=d([100,97,114,107,111,114,97,110,103,101,51,0],"i8",c);DS=d([60,47,116,101,120,116,62,10,0],"i8",c);ata=d([100,97,114,107,111,114,97,110,103,101,50,0],"i8",c);NA=d([99,111,114,110,102,108,111,119,101,114,98,108,117,101,0],"i8",c);bS=d([37,103,32,37,103,32,115,101,116,95,115,99,97,108,101,32,37,100,32,114,111,116,97,116,101,32,37,103,32,37,103,32,116,114,97,110,115,108,97,116,101,10,0],"i8",c);bta=d([100,97,114,107,111,114,97,110,103,101,49,0],"i8",c);cta=d([100,97,114,107,111,108,105,118,101,103,114,101,101,110,52,0],"i8",c);dta=d([100,97,114,107,111,108,105,118,101,103,114,101,101,110,51,0],"i8",c);eta=d([109,117,0],"i8",c);fta=d([47,98,117,112,117,53,47,51,0],"i8",c);gta=d([100,97,114,107,111,108,105,118,101,103,114,101,101,110,50,0],"i8",c);hta=d([100,97,114,107,111,108,105,118,101,103,114,101,101,110,49,0],"i8",c);CS=d([62,0],"i8",c);ita=d([100,97,114,107,103,111,108,100,101,110,114,111,100,52,0],"i8",c);aS=d([103,115,97,118,101,10,37,100,32,37,100,32,37,100,32,37,100,32,98,111,120,112,114,105,109,32,99,108,105,112,32,110,101,119,112,97,116,104,10,0],"i8",c);jta=d([47,84,105,109,101,115,45,73,116,97,108,105,99,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);kta=d([100,97,114,107,103,111,108,100,101,110,114,111,100,51,0],"i8",c);lta=d([100,97,114,107,103,111,108,100,101,110,114,111,100,50,0],"i8",c);mta=d([100,97,114,107,103,111,108,100,101,110,114,111,100,49,0],"i8",c);nta=d([47,98,117,112,117,53,47,50,0],"i8",c);ota=d([99,121,97,110,52,0],"i8",c);pta=d([99,121,97,110,51,0],"i8",c);qta=d([99,121,97,110,50,0],"i8",c);rta=d([99,121,97,110,49,0],"i8",c);AS=d([32,102,105,108,108,61,34,35,37,48,50,120,37,48,50,120,37,48,50,120,34,0],"i8",c);$R=d([37,100,32,37,100,32,37,100,32,98,101,103,105,110,112,97,103,101,10,0],"i8",c);sta=d([99,111,114,110,115,105,108,107,52,0],"i8",c);tta=d([99,111,114,110,115,105,108,107,51,0],"i8",c);uta=d([99,111,114,110,115,105,108,107,50,0],"i8",c);vta=d([99,111,114,110,115,105,108,107,49,0],"i8",c);wta=d([109,105,100,100,111,116,0],"i8",c);xta=d([47,98,117,112,117,53,47,49,0],"i8",c);yta=d([99,111,114,97,108,52,0],"i8",c);zta=d([99,111,114,97,108,51,0],"i8",c);Ata=d([99,111,114,97,108,50,0],"i8",c);zS=d([32,102,105,108,108,61,34,37,115,34,0],"i8",c);Bta=d([99,111,114,97,108,49,0],"i8",c);yR=d([32,105,100,61,34,0],"i8",c);ZR=d([60,60,32,47,80,97,103,101,83,105,122,101,32,91,37,100,32,37,100,93,32,62,62,32,115,101,116,112,97,103,101,100,101,118,105,99,101,10,0],"i8",c);Cta=d([99,104,111,99,111,108,97,116,101,52,0],"i8",c);Dta=d([99,104,111,99,111,108,97,116,101,51,0],"i8",c);Eta=d([99,104,111,99,111,108,97,116,101,50,0],"i8",c);Fta=d([109,105,99,114,111,0],"i8",c);Gta=d([47,98,117,112,117,52,47,52,0],"i8",c);Hta=d([99,104,111,99,111,108,97,116,101,49,0],"i8",c);Ita=d([99,104,97,114,116,114,101,117,115,101,52,0],"i8",c);Jta=d([99,104,97,114,116,114,101,117,115,101,51,0],"i8",c);Kta=d([99,104,97,114,116,114,101,117,115,101,50,0],"i8",c);yS=d([32,102,111,110,116,45,115,105,122,101,61,34,37,46,50,102,34,0],"i8",c);Lta=d([99,104,97,114,116,114,101,117,115,101,49,0],"i8",c);XR=d([80,111,114,116,114,97,105,116,0],"i8",c);Mta=d([99,97,100,101,116,98,108,117,101,52,0],"i8",c);Nta=d([99,97,100,101,116,98,108,117,101,51,0],"i8",c);Ota=d([99,97,100,101,116,98,108,117,101,50,0],"i8",c);Pta=d([109,100,97,115,104,0],"i8",c);Qta=d([47,98,117,112,117,52,47,51,0],"i8",c);Rta=d([99,97,100,101,116,98,108,117,101,49,0],"i8",c);d([99,108,117,115,116,101,114,95,0],"i8",c);Sta=d([98,117,114,108,121,119,111,111,100,52,0],"i8",c);Tta=d([98,117,114,108,121,119,111,111,100,51,0],"i8",c);Uta=d([98,117,114,108,121,119,111,111,100,50,0],"i8",c);sS=d([32,102,111,110,116,45,102,97,109,105,108,121,61,34,37,115,34,0],"i8",c);Vta=d([98,117,114,108,121,119,111,111,100,49,0],"i8",c);Wta=d([47,97,99,99,101,110,116,54,47,53,0],"i8",c);WR=d([76,97,110,100,115,99,97,112,101,0],"i8",c);Xta=d([98,114,111,119,110,52,0],"i8",c);Yta=d([98,114,111,119,110,51,0],"i8",c);Zta=d([98,114,111,119,110,50,0],"i8",c);$ta=d([109,97,99,114,0],"i8",c);aua=d([47,98,117,112,117,52,47,50,0],"i8",c);bua=d([98,114,111,119,110,49,0],"i8",c);cua=d([98,108,117,101,52,0],"i8",c);dua=d([98,108,117,101,51,0],"i8",c);xS=d([32,102,111,110,116,45,115,116,121,108,101,61,34,37,115,34,0],"i8",c);eua=d([98,108,117,101,50,0],"i8",c);fua=d([112,115,58,108,97,115,105,0],"i8",c);YR=d([37,37,37,37,80,97,103,101,79,114,105,101,110,116,97,116,105,111,110,58,32,37,115,10,0],"i8",c);gua=d([98,108,117,101,49,0],"i8",c);hua=d([108,116,0],"i8",c);iua=d([47,98,117,112,117,52,47,49,0],"i8",c);jua=d([98,105,115,113,117,101,52,0],"i8",c);kua=d([98,105,115,113,117,101,51,0],"i8",c);lua=d([98,105,115,113,117,101,50,0],"i8",c);mua=d([98,105,115,113,117,101,49,0],"i8",c);kR=d([32,37,100,0],"i8",c);wS=d([32,102,111,110,116,45,115,116,114,101,116,99,104,61,34,37,115,34,0],"i8",c);VR=d([37,37,37,37,80,97,103,101,66,111,117,110,100,105,110,103,66,111,120,58,32,37,100,32,37,100,32,37,100,32,37,100,10,0],"i8",c);nua=d([97,122,117,114,101,52,0],"i8",c);oua=d([97,122,117,114,101,51,0],"i8",c);pua=d([97,122,117,114,101,50,0],"i8",c);qua=d([97,122,117,114,101,49,0],"i8",c);rua=d([108,115,113,117,111,0],"i8",c);fr=d([110,97,118,121,0],"i8",c);sua=d([47,98,117,112,117,51,47,51,0],"i8",c);tua=d([97,113,117,97,109,97,114,105,110,101,52,0],"i8",c);uua=d([97,113,117,97,109,97,114,105,110,101,51,0],"i8",c);vua=d([97,113,117,97,109,97,114,105,110,101,50,0],"i8",c);wua=d([97,113,117,97,109,97,114,105,110,101,49,0],"i8",c);vS=d([32,102,111,110,116,45,119,101,105,103,104,116,61,34,37,115,34,0],"i8",c);UR=d([37,37,37,37,80,97,103,101,58,32,37,100,32,37,100,10,0],"i8",c);xua=d([97,110,116,105,113,117,101,119,104,105,116,101,52,0],"i8",c);yua=d([97,110,116,105,113,117,101,119,104,105,116,101,51,0],"i8",c);zua=d([97,110,116,105,113,117,101,119,104,105,116,101,50,0],"i8",c);Aua=d([97,110,116,105,113,117,101,119,104,105,116,101,49,0],"i8",c);Bua=d([108,115,97,113,117,111,0],"i8",c);Cua=d([47,98,117,112,117,51,47,50,0],"i8",c);Dua=d([47,121,108,111,114,114,100,57,47,57,0],"i8",c);Eua=d([65,118,97,110,116,71,97,114,100,101,45,68,101,109,105,79,98,108,105,113,117,101,0],"i8",c);Fua=d([47,121,108,111,114,114,100,57,47,56,0],"i8",c);Gua=d([47,121,108,111,114,114,100,57,47,55,0],"i8",c);Hua=d([47,121,108,111,114,114,100,57,47,54,0],"i8",c);uS=d([44,37,115,0],"i8",c);Iua=d([37,37,37,37,69,110,100,80,97,103,101,58,32,37,100,10,0],"i8",c);Jua=d([47,121,108,111,114,114,100,57,47,53,0],"i8",c);Hg=d([92,72,0],"i8",c);Kua=d([47,121,108,111,114,114,100,57,47,52,0],"i8",c);Lua=d([47,121,108,111,114,114,100,57,47,51,0],"i8",c);Mua=d([47,121,108,111,114,114,100,57,47,50,0],"i8",c);Nua=d([108,114,109,0],"i8",c);Oua=d([47,121,108,111,114,114,100,57,47,49,0],"i8",c);Pua=d([47,98,117,112,117,51,47,49,0],"i8",c);Qua=d([47,121,108,111,114,114,100,56,47,56,0],"i8",c);Rua=d([47,121,108,111,114,114,100,56,47,55,0],"i8",c);zp=d([108,104,101,105,103,104,116,0],"i8",c);Sua=d([47,121,108,111,114,114,100,56,47,54,0],"i8",c);d([100,111,116,95,115,116,97,116,105,99,0],"i8",c);lI=d([66,111,117,110,100,105,110,103,66,111,120,32,110,111,116,32,102,111,117,110,100,32,105,110,32,101,112,115,102,32,102,105,108,101,32,37,115,10,0],"i8",c);Tua=d([47,121,108,111,114,114,100,56,47,53,0],"i8",c);Uua=d([47,121,108,111,114,114,100,56,47,52,0],"i8",c);tS=d([32,102,111,110,116,45,102,97,109,105,108,121,61,34,37,115,0],"i8",c);OA=d([99,111,114,97,108,0],"i8",c);Vua=d([37,37,80,97,103,101,84,114,97,105,108,101,114,10,0],"i8",c);Wua=d([47,121,108,111,114,114,100,56,47,51,0],"i8",c);pP=d([105,110,115,116,97,108,108,95,105,110,95,114,97,110,107,32,37,115,32,37,115,32,114,97,110,107,32,37,100,32,105,32,61,32,37,100,32,97,110,32,61,32,48,10,0],"i8",c);Xua=d([47,121,108,111,114,114,100,56,47,50,0],"i8",c);Yua=d([47,121,108,111,114,114,100,56,47,49,0],"i8",c);Zua=d([47,121,108,111,114,114,100,55,47,55,0],"i8",c);$ua=d([108,111,122,0],"i8",c);ava=d([47,121,108,111,114,114,100,55,47,54,0],"i8",c);bva=d([47,98,117,103,110,57,47,57,0],"i8",c);cva=d([47,121,108,111,114,114,100,55,47,53,0],"i8",c);dva=d([47,121,108,111,114,114,100,55,47,52,0],"i8",c);eva=d([47,121,108,111,114,114,100,55,47,51,0],"i8",c);fva=d([47,121,108,111,114,114,100,55,47,50,0],"i8",c);gva=d([47,121,108,111,114,114,100,55,47,49,0],"i8",c);rS=d([32,120,61,34,37,103,34,32,121,61,34,37,103,34,0],"i8",c);TK=d([60,115,118,103,0],"i8",c);hva=d([101,110,100,112,97,103,101,10,115,104,111,119,112,97,103,101,10,103,114,101,115,116,111,114,101,10,0],"i8",c);iva=d([47,84,105,109,101,115,45,82,111,109,97,110,32,115,116,97,114,110,101,116,73,83,79,32,100,101,102,0],"i8",c);jva=d([47,121,108,111,114,114,100,54,47,54,0],"i8",c);kva=d([47,121,108,111,114,114,100,54,47,53,0],"i8",c);lva=d([47,121,108,111,114,114,100,54,47,52,0],"i8",c);mva=d([47,121,108,111,114,114,100,54,47,51,0],"i8",c);nva=d([108,111,119,97,115,116,0],"i8",c);ova=d([47,121,108,111,114,114,100,54,47,50,0],"i8",c);pva=d([47,98,117,103,110,57,47,56,0],"i8",c);qva=d([47,121,108,111,114,114,100,54,47,49,0],"i8",c);rva=d([47,121,108,111,114,114,100,53,47,53,0],"i8",c);sva=d([47,121,108,111,114,114,100,53,47,52,0],"i8",c);tva=d([47,121,108,111,114,114,100,53,47,51,0],"i8",c);uva=d([47,121,108,111,114,114,100,53,47,50,0],"i8",c);qS=d([32,116,101,120,116,45,97,110,99,104,111,114,61,34,109,105,100,100,108,101,34,0],"i8",c);vva=d([48,32,48,32,48,32,101,100,103,101,99,111,108,111,114,10,0],"i8",c);wva=d([47,121,108,111,114,114,100,53,47,49,0],"i8",c);xva=d([47,121,108,111,114,114,100,52,47,52,0],"i8",c);yva=d([47,121,108,111,114,114,100,52,47,51,0],"i8",c);zva=d([47,121,108,111,114,114,100,52,47,50,0],"i8",c);Ava=d([108,102,108,111,111,114,0],"i8",c);Bva=d([98,97,99,107,0],"i8",c);Cva=d([47,121,108,111,114,114,100,52,47,49,0],"i8",c);Dva=d([47,98,117,103,110,57,47,55,0],"i8",c);Eva=d([47,121,108,111,114,114,100,51,47,51,0],"i8",c);Fva=d([47,121,108,111,114,114,100,51,47,50,0],"i8",c);Gva=d([47,121,108,111,114,114,100,51,47,49,0],"i8",c);Hva=d([47,121,108,111,114,98,114,57,47,57,0],"i8",c);Iva=d([47,121,108,111,114,98,114,57,47,56,0],"i8",c);pS=d([32,116,101,120,116,45,97,110,99,104,111,114,61,34,101,110,100,34,0],"i8",c);Jva=d([37,37,32,37,115,10,0],"i8",c);Kva=d([47,121,108,111,114,98,114,57,47,55,0],"i8",c);ZO=d([78,68,95,111,117,116,40,118,41,46,115,105,122,101,32,61,61,32,50,0],"i8",c);xR=d([60,97,114,101,97,32,115,104,97,112,101,61,34,112,111,108,121,34,0],"i8",c);TM=d([71,115,116,97,99,107,32,117,110,100,101,114,102,108,111,119,32,105,110,32,103,114,97,112,104,32,112,97,114,115,101,114,10,0],"i8",c);Lva=d([47,121,108,111,114,98,114,57,47,54,0],"i8",c);Mva=d([47,121,108,111,114,98,114,57,47,53,0],"i8",c);Nva=d([47,121,108,111,114,98,114,57,47,52,0],"i8",c);Ova=d([108,101,0],"i8",c);Pva=d([47,121,108,111,114,98,114,57,47,51,0],"i8",c);Qva=d([47,98,117,103,110,57,47,54,0],"i8",c);Rva=d([47,121,108,111,114,98,114,57,47,50,0],"i8",c);Sva=d([47,121,108,111,114,98,114,57,47,49,0],"i8",c);Tva=d([47,121,108,111,114,98,114,56,47,56,0],"i8",c);Uva=d([47,121,108,111,114,98,114,56,47,55,0],"i8",c);Vva=d([47,121,108,111,114,98,114,56,47,54,0],"i8",c);oS=d([32,116,101,120,116,45,97,110,99,104,111,114,61,34,115,116,97,114,116,34,0],"i8",c);gr=d([103,115,97,118,101,10,0],"i8",c);Wva=d([47,121,108,111,114,98,114,56,47,53,0],"i8",c);Xva=d([47,121,108,111,114,98,114,56,47,52,0],"i8",c);Yva=d([47,121,108,111,114,98,114,56,47,51,0],"i8",c);Zva=d([47,121,108,111,114,98,114,56,47,50,0],"i8",c);$va=d([108,100,113,117,111,0],"i8",c);awa=d([47,121,108,111,114,98,114,56,47,49,0],"i8",c);bwa=d([47,98,117,103,110,57,47,53,0],"i8",c);cwa=d([47,121,108,111,114,98,114,55,47,55,0],"i8",c);d([80,108,117,103,105,110,115,0],"i8",c);dwa=d([47,121,108,111,114,98,114,55,47,54,0],"i8",c);ewa=d([47,121,108,111,114,98,114,55,47,53,0],"i8",c);fwa=d([47,121,108,111,114,98,114,55,47,52,0],"i8",c);gwa=d([47,121,108,111,114,98,114,55,47,51,0],"i8",c);nS=d([60,116,101,120,116,0],"i8",c);hwa=d([47,97,99,99,101,110,116,54,47,52,0],"i8",c);iwa=d([47,121,108,111,114,98,114,55,47,50,0],"i8",c);jwa=d([47,121,108,111,114,98,114,55,47,49,0],"i8",c);kwa=d([47,121,108,111,114,98,114,54,47,54,0],"i8",c);lwa=d([47,121,108,111,114,98,114,54,47,53,0],"i8",c);mwa=d([108,99,101,105,108,0],"i8",c);nwa=d([47,121,108,111,114,98,114,54,47,52,0],"i8",c);owa=d([47,98,117,103,110,57,47,52,0],"i8",c);pwa=d([47,121,108,111,114,98,114,54,47,51,0],"i8",c);qwa=d([47,121,108,111,114,98,114,54,47,50,0],"i8",c);rwa=d([47,121,108,111,114,98,114,54,47,49,0],"i8",c);swa=d([47,121,108,111,114,98,114,53,47,53,0],"i8",c);twa=d([47,121,108,111,114,98,114,53,47,52,0],"i8",c);uwa=d([116,114,105,97,110,103,108,101,0],"i8",c);PA=d([112,115,58,112,115,0],"i8",c);vwa=d([32,32,47,66,111,114,100,101,114,32,91,32,48,32,48,32,48,32,93,10,32,32,47,65,99,116,105,111,110,32,60,60,32,47,83,117,98,116,121,112,101,32,47,85,82,73,32,47,85,82,73,32,37,115,32,62,62,10,32,32,47,83,117,98,116,121,112,101,32,47,76,105,110,107,10,47,65,78,78,32,112,100,102,109,97,114,107,10,0],"i8",c);wwa=d([47,121,108,111,114,98,114,53,47,51,0],"i8",c);Bf=d([45,62,0],"i8",c);xwa=d([47,121,108,111,114,98,114,53,47,50,0],"i8",c);ywa=d([47,121,108,111,114,98,114,53,47,49,0],"i8",c);zwa=d([47,121,108,111,114,98,114,52,47,52,0],"i8",c);Awa=d([108,97,114,114,0],"i8",c);Bwa=d([47,121,108,111,114,98,114,52,47,51,0],"i8",c);Cwa=d([47,98,117,103,110,57,47,51,0],"i8",c);Dwa=d([47,121,108,111,114,98,114,52,47,50,0],"i8",c);Ewa=d([47,121,108,111,114,98,114,52,47,49,0],"i8",c);Fwa=d([47,121,108,111,114,98,114,51,47,51,0],"i8",c);Gwa=d([47,121,108,111,114,98,114,51,47,50,0],"i8",c);jR=d([32,37,115,10,0],"i8",c);Hwa=d([47,121,108,111,114,98,114,51,47,49,0],"i8",c);Iwa=d([32,114,120,61,34,37,103,34,32,114,121,61,34,37,103,34,0],"i8",c);Jwa=d([32,93,10,0],"i8",c);Kwa=d([47,121,108,103,110,98,117,57,47,57,0],"i8",c);Lwa=d([47,121,108,103,110,98,117,57,47,56,0],"i8",c);Mwa=d([47,121,108,103,110,98,117,57,47,55,0],"i8",c);Nwa=d([47,121,108,103,110,98,117,57,47,54,0],"i8",c);Owa=d([108,97,113,117,111,0],"i8",c);hr=d([109,97,114,111,111,110,0],"i8",c);Pwa=d([47,121,108,103,110,98,117,57,47,53,0],"i8",c);Qwa=d([47,98,117,103,110,57,47,50,0],"i8",c);kM=d([37,100,32,37,49,91,34,93,37,110,0],"i8",c);Rwa=d([47,121,108,103,110,98,117,57,47,52,0],"i8",c);Swa=d([47,121,108,103,110,98,117,57,47,51,0],"i8",c);Twa=d([47,121,108,103,110,98,117,57,47,50,0],"i8",c);Uwa=d([47,121,108,103,110,98,117,57,47,49,0],"i8",c);oj=d([34,34,0],"i8",c);Vwa=d([47,121,108,103,110,98,117,56,47,56,0],"i8",c);Wwa=d([32,99,120,61,34,37,103,34,32,99,121,61,34,37,103,34,0],"i8",c);Xwa=d([105,115,109,97,112,58,109,97,112,0],"i8",c);Ywa=d([47,121,108,103,110,98,117,56,47,55,0],"i8",c);Zwa=d([47,121,108,103,110,98,117,56,47,54,0],"i8",c);$wa=d([91,32,47,82,101,99,116,32,91,32,0],"i8",c);axa=d([47,121,108,103,110,98,117,56,47,53,0],"i8",c);bxa=d([47,121,108,103,110,98,117,56,47,52,0],"i8",c);cxa=d([108,97,110,103,0],"i8",c);dxa=d([47,121,108,103,110,98,117,56,47,51,0],"i8",c);exa=d([47,98,117,103,110,57,47,49,0],"i8",c);fxa=d([47,121,108,103,110,98,117,56,47,50,0],"i8",c);gxa=d([47,121,108,103,110,98,117,56,47,49,0],"i8",c);hxa=d([47,121,108,103,110,98,117,55,47,55,0],"i8",c);ixa=d([47,121,108,103,110,98,117,55,47,54,0],"i8",c);jxa=d([47,121,108,103,110,98,117,55,47,53,0],"i8",c);kxa=d([60,101,108,108,105,112,115,101,0],"i8",c);lxa=d([32,37,115,32,97,108,105,103,110,101,100,116,101,120,116,10,0],"i8",c);mxa=d([47,121,108,103,110,98,117,55,47,52,0],"i8",c);nxa=d([47,121,108,103,110,98,117,55,47,51,0],"i8",c);oxa=d([47,121,108,103,110,98,117,55,47,50,0],"i8",c);Wb=d([98,111,108,100,0],"i8",c);pxa=d([47,121,108,103,110,98,117,55,47,49,0],"i8",c);qxa=d([108,97,109,98,100,97,0],"i8",c);rxa=d([47,121,108,103,110,98,117,54,47,54,0],"i8",c);sxa=d([47,98,117,103,110,56,47,56,0],"i8",c);txa=d([47,121,108,103,110,98,117,54,47,53,0],"i8",c);IL=d([69,100,103,101,32,37,112,32,119,97,115,32,110,111,116,32,102,111,117,110,100,10,0],"i8",c);d([117,116,105,108,46,99,0],"i8",c);uxa=d([47,121,108,103,110,98,117,54,47,52,0],"i8",c);yp=d([108,119,105,100,116,104,0],"i8",c);vxa=d([47,121,108,103,110,98,117,54,47,51,0],"i8",c);Pi=d([116,111,111,108,116,105,112,0],"i8",c);d([37,115,58,32,111,112,116,105,111,110,32,45,37,99,32,117,110,114,101,99,111,103,110,105,122,101,100,10,10,0],"i8",c);kI=d([114,101,97,100,0],"i8",c);wxa=d([47,121,108,103,110,98,117,54,47,50,0],"i8",c);xxa=d([47,121,108,103,110,98,117,54,47,49,0],"i8",c);yxa=d([37,103,44,37,103,0],"i8",c);zxa=d([32,109,111,118,101,116,111,32,0],"i8",c);QA=d([99,104,111,99,111,108,97,116,101,0],"i8",c);Axa=d([47,121,108,103,110,98,117,53,47,53,0],"i8",c);Bxa=d([47,121,108,103,110,98,117,53,47,52,0],"i8",c);Cxa=d([47,121,108,103,110,98,117,53,47,51,0],"i8",c);Dxa=d([47,121,108,103,110,98,117,53,47,50,0],"i8",c);Exa=d([108,65,114,114,0],"i8",c);Fxa=d([47,121,108,103,110,98,117,53,47,49,0],"i8",c);Gxa=d([47,98,117,103,110,56,47,55,0],"i8",c);Hxa=d([47,121,108,103,110,98,117,52,47,52,0],"i8",c);bI=d([37,108,102,37,108,102,37,108,102,0],"i8",c);Ixa=d([47,121,108,103,110,98,117,52,47,51,0],"i8",c);Jxa=d([47,121,108,103,110,98,117,52,47,50,0],"i8",c);Kxa=d([47,121,108,103,110,98,117,52,47,49,0],"i8",c);Lxa=d([47,121,108,103,110,98,117,51,47,51,0],"i8",c);Mxa=d([60,112,111,108,121,103,111,110,0],"i8",c);Nu=d([37,37,37,37,66,111,117,110,100,105,110,103,66,111,120,58,32,37,100,32,37,100,32,37,100,32,37,100,0],"i8",c);Nxa=d([32,47,37,115,32,115,101,116,95,102,111,110,116,10,0],"i8",c);Oxa=d([47,121,108,103,110,98,117,51,47,50,0],"i8",c);ln=d([125,32,100,101,102,0],"i8",c);Pxa=d([47,121,108,103,110,98,117,51,47,49,0],"i8",c);AK=d([101,114,114,111,114,32,105,110,32,99,111,108,120,108,97,116,101,40,41,10,0],"i8",c);Qxa=d([47,121,108,103,110,57,47,57,0],"i8",c);Rxa=d([47,121,108,103,110,57,47,56,0],"i8",c);Sxa=d([107,97,112,112,97,0],"i8",c);Txa=d([47,121,108,103,110,57,47,55,0],"i8",c);Uxa=d([47,98,117,103,110,56,47,54,0],"i8",c);Vxa=d([47,121,108,103,110,57,47,54,0],"i8",c);Wxa=d([47,121,108,103,110,57,47,53,0],"i8",c);Xxa=d([47,121,108,103,110,57,47,52,0],"i8",c);Yxa=d([47,121,108,103,110,57,47,51,0],"i8",c);Zxa=d([47,121,108,103,110,57,47,50,0],"i8",c);$xa=d([37,99,37,103,44,37,103,0],"i8",c);aya=d([32,101,108,108,105,112,115,101,95,112,97,116,104,32,115,116,114,111,107,101,10,0],"i8",c);bya=d([47,121,108,103,110,57,47,49,0],"i8",c);cya=d([47,121,108,103,110,56,47,56,0],"i8",c);dya=d([47,121,108,103,110,56,47,55,0],"i8",c);eya=d([47,121,108,103,110,56,47,54,0],"i8",c);fya=d([105,117,109,108,0],"i8",c);gya=d([102,111,114,119,97,114,100,0],"i8",c);hya=d([47,121,108,103,110,56,47,53,0],"i8",c);iya=d([47,98,117,103,110,56,47,53,0],"i8",c);jya=d([47,121,108,103,110,56,47,52,0],"i8",c);kya=d([47,121,108,103,110,56,47,51,0],"i8",c);lya=d([47,121,108,103,110,56,47,50,0],"i8",c);mya=d([47,121,108,103,110,56,47,49,0],"i8",c);nya=d([47,121,108,103,110,55,47,55,0],"i8",c);oya=d([32,100,61,34,0],"i8",c);pya=d([32,101,108,108,105,112,115,101,95,112,97,116,104,32,102,105,108,108,10,0],"i8",c);qya=d([47,121,108,103,110,55,47,54,0],"i8",c);rya=d([47,121,108,103,110,55,47,53,0],"i8",c);wR=d([60,97,114,101,97,32,115,104,97,112,101,61,34,114,101,99,116,34,0],"i8",c);OM=d([95,97,110,111,110,121,109,111,117,115,95,37,100,0],"i8",c);sya=d([47,121,108,103,110,55,47,52,0],"i8",c);tya=d([47,121,108,103,110,55,47,51,0],"i8",c);uya=d([105,115,105,110,0],"i8",c);vya=d([47,121,108,103,110,55,47,50,0],"i8",c);wya=d([47,98,117,103,110,56,47,52,0],"i8",c);xya=d([47,121,108,103,110,55,47,49,0],"i8",c);yya=d([47,121,108,103,110,54,47,54,0],"i8",c);zya=d([47,121,108,103,110,54,47,53,0],"i8",c);Aya=d([47,121,108,103,110,54,47,52,0],"i8",c);Bya=d([47,121,108,103,110,54,47,51,0],"i8",c);Cya=d([60,112,97,116,104,0],"i8",c);fS=d([99,108,111,115,101,112,97,116,104,32,115,116,114,111,107,101,10,0],"i8",c);Dya=d([47,121,108,103,110,54,47,50,0],"i8",c);Eya=d([47,121,108,103,110,54,47,49,0],"i8",c);Fya=d([47,121,108,103,110,53,47,53,0],"i8",c);Gya=d([47,121,108,103,110,53,47,52,0],"i8",c);Hya=d([105,113,117,101,115,116,0],"i8",c);Iya=d([47,121,108,103,110,53,47,51,0],"i8",c);Jya=d([47,98,117,103,110,56,47,51,0],"i8",c);Kya=d([47,121,108,103,110,53,47,50,0],"i8",c);Lya=d([47,121,108,103,110,53,47,49,0],"i8",c);d([49,46,53,0],"i8",c);Mya=d([47,121,108,103,110,52,47,52,0],"i8",c);Nya=d([47,121,108,103,110,52,47,51,0],"i8",c);Oya=d([47,121,108,103,110,52,47,50,0],"i8",c);Pya=d([47,97,99,99,101,110,116,54,47,51,0],"i8",c);xy=d([99,108,111,115,101,112,97,116,104,32,102,105,108,108,10,0],"i8",c);Qya=d([47,121,108,103,110,52,47,49,0],"i8",c);Rya=d([47,121,108,103,110,51,47,51,0],"i8",c);Sya=d([47,121,108,103,110,51,47,50,0],"i8",c);Tya=d([47,121,108,103,110,51,47,49,0],"i8",c);Uya=d([105,111,116,97,0],"i8",c);Vya=d([47,115,118,103,47,121,101,108,108,111,119,103,114,101,101,110,0],"i8",c);Wya=d([47,98,117,103,110,56,47,50,0],"i8",c);Xya=d([47,115,118,103,47,121,101,108,108,111,119,0],"i8",c);Yya=d([47,115,118,103,47,119,104,105,116,101,115,109,111,107,101,0],"i8",c);Zya=d([47,115,118,103,47,119,104,105,116,101,0],"i8",c);$ya=d([47,115,118,103,47,119,104,101,97,116,0],"i8",c);aza=d([47,115,118,103,47,118,105,111,108,101,116,0],"i8",c);Ay=d([103,118,114,101,110,100,101,114,95,99,111,114,101,95,115,118,103,46,99,0],"i8",c);bza=d([101,103,103,0],"i8",c);cza=d([101,112,115,58,108,97,115,105,0],"i8",c);yy=d([32,99,117,114,118,101,116,111,10,0],"i8",c);dza=d([47,115,118,103,47,116,117,114,113,117,111,105,115,101,0],"i8",c);yr=d([116,101,120,116,108,97,121,111,117,116,0],"i8",c);eza=d([47,115,118,103,47,116,111,109,97,116,111,0],"i8",c);fza=d([47,115,118,103,47,116,104,105,115,116,108,101,0],"i8",c);gza=d([47,115,118,103,47,116,101,97,108,0],"i8",c);hza=d([105,110,116,0],"i8",c);iza=d([47,115,118,103,47,116,97,110,0],"i8",c);jza=d([47,98,117,103,110,56,47,49,0],"i8",c);kza=d([47,115,118,103,47,115,116,101,101,108,98,108,117,101,0],"i8",c);lza=d([47,115,118,103,47,115,112,114,105,110,103,103,114,101,101,110,0],"i8",c);mza=d([47,115,118,103,47,115,110,111,119,0],"i8",c);nza=d([47,115,118,103,47,115,108,97,116,101,103,114,101,121,0],"i8",c);oza=d([47,115,118,103,47,115,108,97,116,101,103,114,97,121,0],"i8",c);iR=d([37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,46,49,102,32,37,100,32,37,100,32,37,100,32,37,100,10,0],"i8",c);zy=d([115,116,114,111,107,101,10,0],"i8",c);pza=d([47,115,118,103,47,115,108,97,116,101,98,108,117,101,0],"i8",c);qza=d([47,115,118,103,47,115,107,121,98,108,117,101,0],"i8",c);rza=d([47,115,118,103,47,115,105,108,118,101,114,0],"i8",c);sza=d([47,115,118,103,47,115,105,101,110,110,97,0],"i8",c);tza=d([105,110,102,105,110,0],"i8",c);RA=d([108,105,109,101,0],"i8",c);uza=d([47,115,118,103,47,115,101,97,115,104,101,108,108,0],"i8",c);vza=d([47,98,117,103,110,55,47,55,0],"i8",c);wza=d([47,115,118,103,47,115,101,97,103,114,101,101,110,0],"i8",c);jM=d([108,105,110,101,0],"i8",c);xza=d([47,115,118,103,47,115,97,110,100,121,98,114,111,119,110,0],"i8",c);yza=d([47,115,118,103,47,115,97,108,109,111,110,0],"i8",c);zza=d([47,115,118,103,47,115,97,100,100,108,101,98,114,111,119,110,0],"i8",c);cT=d([32,45,116,97,103,115,32,123,37,100,37,115,37,100,125,0],"i8",c);Aza=d([47,115,118,103,47,114,111,121,97,108,98,108,117,101,0],"i8",c);JS=d([53,44,50,0],"i8",c);Hq=d([32,108,105,110,101,116,111,10,0],"i8",c);Bza=d([47,115,118,103,47,114,111,115,121,98,114,111,119,110,0],"i8",c);Cza=d([47,115,118,103,47,114,101,100,0],"i8",c);Dza=d([47,115,118,103,47,112,117,114,112,108,101,0],"i8",c);Eza=d([47,115,118,103,47,112,111,119,100,101,114,98,108,117,101,0],"i8",c);Fza=d([47,115,118,103,47,112,108,117,109,0],"i8",c);Gza=d([47,98,117,103,110,55,47,54,0],"i8",c);Hza=d([47,115,118,103,47,112,105,110,107,0],"i8",c);Iza=d([47,115,118,103,47,112,101,114,117,0],"i8",c);Jza=d([47,115,118,103,47,112,101,97,99,104,112,117,102,102,0],"i8",c);bD=d([37,108,100,0],"i8",c);mn=d([100,101,109,105,0],"i8",c);Kza=d([47,115,118,103,47,112,97,112,97,121,97,119,104,105,112,0],"i8",c);Lza=d([47,115,118,103,47,112,97,108,101,118,105,111,108,101,116,114,101,100,0],"i8",c);KS=d([49,44,53,0],"i8",c);Kj=d([32,109,111,118,101,116,111,10,0],"i8",c);Mza=d([47,115,118,103,47,112,97,108,101,116,117,114,113,117,111,105,115,101,0],"i8",c);Nza=d([47,115,118,103,47,112,97,108,101,103,114,101,101,110,0],"i8",c);Oza=d([47,115,118,103,47,112,97,108,101,103,111,108,100,101,110,114,111,100,0],"i8",c);Hi=d([102,105,108,108,101,100,0],"i8",c);Wx=d([102,108,97,116,105,110,100,101,120,40,97,103,116,97,105,108,40,101,41,41,32,60,32,77,45,62,110,99,111,108,115,0],"i8",c);Pza=d([47,115,118,103,47,111,114,99,104,105,100,0],"i8",c);Qza=d([105,103,114,97,118,101,0],"i8",c);Rza=d([47,115,118,103,47,111,114,97,110,103,101,114,101,100,0],"i8",c);Sza=d([47,98,117,103,110,55,47,53,0],"i8",c);Tza=d([47,115,118,103,47,111,114,97,110,103,101,0],"i8",c);Pd=d([115,104,111,114,116,101,115,116,46,99,0],"i8",c);Uza=d([47,115,118,103,47,111,108,105,118,101,100,114,97,98,0],"i8",c);hv=d([116,97,105,108,95,108,112,0],"i8",c);Vza=d([47,115,118,103,47,111,108,105,118,101,0],"i8",c);d([73,110,118,97,108,105,100,32,112,97,114,97,109,101,116,101,114,32,34,37,115,34,32,102,111,114,32,45,115,32,102,108,97,103,10,0],"i8",c);Wza=d([47,115,118,103,47,111,108,100,108,97,99,101,0],"i8",c);Xza=d([47,115,118,103,47,110,97,118,121,0],"i8",c);Jj=d([110,101,119,112,97,116,104,32,0],"i8",c);SA=d([99,104,97,114,116,114,101,117,115,101,0],"i8",c);Yza=d([47,115,118,103,47,110,97,118,97,106,111,119,104,105,116,101,0],"i8",c);Zza=d([47,115,118,103,47,109,111,99,99,97,115,105,110,0],"i8",c);$za=d([47,115,118,103,47,109,105,115,116,121,114,111,115,101,0],"i8",c);Qt=d([115,105,100,101,115,32,61,61,32,52,0],"i8",c);aAa=d([47,115,118,103,47,109,105,110,116,99,114,101,97,109,0],"i8",c);bAa=d([105,101,120,99,108,0],"i8",c);cAa=d([47,115,118,103,47,109,105,100,110,105,103,104,116,98,108,117,101,0],"i8",c);dAa=d([47,98,117,103,110,55,47,52,0],"i8",c);eAa=d([103,105,102,58,115,118,103,0],"i8",c);fAa=d([47,115,118,103,47,109,101,100,105,117,109,118,105,111,108,101,116,114,101,100,0],"i8",c);gAa=d([47,115,118,103,47,109,101,100,105,117,109,116,117,114,113,117,111,105,115,101,0],"i8",c);hAa=d([47,115,118,103,47,109,101,100,105,117,109,115,112,114,105,110,103,103,114,101,101,110,0],"i8",c);iAa=d([47,115,118,103,47,109,101,100,105,117,109,115,108,97,116,101,98,108,117,101,0],"i8",c);jAa=d([47,115,118,103,47,109,101,100,105,117,109,115,101,97,103,114,101,101,110,0],"i8",c);LS=d([34,32,115,116,114,111,107,101,45,111,112,97,99,105,116,121,61,34,37,102,0],"i8",c);RK=d([37,37,66,111,117,110,100,105,110,103,66,111,120,58,0],"i8",c);kAa=d([47,115,118,103,47,109,101,100,105,117,109,112,117,114,112,108,101,0],"i8",c);lAa=d([32,32,32,32,32,32,32,32,99,117,114,114,101,110,116,100,105,99,116,32,101,110,100,32,100,101,102,105,110,101,102,111,110,116,0],"i8",c);mAa=d([47,115,118,103,47,109,101,100,105,117,109,111,114,99,104,105,100,0],"i8",c);zK=d([37,115,32,105,115,32,110,111,116,32,97,32,107,110,111,119,110,32,99,111,108,111,114,46,10,0],"i8",c);nAa=d([47,115,118,103,47,109,101,100,105,117,109,98,108,117,101,0],"i8",c);oAa=d([47,115,118,103,47,109,101,100,105,117,109,97,113,117,97,109,97,114,105,110,101,0],"i8",c);pAa=d([105,99,105,114,99,0],"i8",c);qAa=d([47,115,118,103,47,109,97,114,111,111,110,0],"i8",c);rAa=d([47,98,117,103,110,55,47,51,0],"i8",c);sAa=d([47,115,118,103,47,109,97,103,101,110,116,97,0],"i8",c);tAa=d([47,115,118,103,47,108,105,110,101,110,0],"i8",c);uAa=d([47,115,118,103,47,108,105,109,101,103,114,101,101,110,0],"i8",c);iO=d([114,111,117,116,101,115,112,108,105,110,101,115,58,32,37,100,32,101,100,103,101,115,44,32,37,100,32,98,111,120,101,115,32,37,46,50,102,32,115,101,99,10,0],"i8",c);vAa=d([47,115,118,103,47,108,105,109,101,0],"i8",c);wAa=d([47,115,118,103,47,108,105,103,104,116,121,101,108,108,111,119,0],"i8",c);By=d([34,32,115,116,114,111,107,101,45,100,97,115,104,97,114,114,97,121,61,34,37,115,0],"i8",c);xAa=d([37,32,0],"i8",c);yAa=d([47,115,118,103,47,108,105,103,104,116,115,116,101,101,108,98,108,117,101,0],"i8",c);zAa=d([47,115,118,103,47,108,105,103,104,116,115,108,97,116,101,103,114,101,121,0],"i8",c);AAa=d([47,115,118,103,47,108,105,103,104,116,115,108,97,116,101,103,114,97,121,0],"i8",c);VG=d([47,112,97,116,104,98,111,120,32,123,10,32,32,32,32,47,89,32,101,120,99,104,32,37,46,53,103,32,115,117,98,32,100,101,102,10,32,32,32,32,47,88,32,101,120,99,104,32,37,46,53,103,32,115,117,98,32,100,101,102,10,32,32,32,32,47,121,32,101,120,99,104,32,37,46,53,103,32,115,117,98,32,100,101,102,10,32,32,32,32,47,120,32,101,120,99,104,32,37,46,53,103,32,115,117,98,32,100,101,102,10,32,32,32,32,110,101,119,112,97,116,104,32,120,32,121,32,109,111,118,101,116,111,10,32,32,32,32,88,32,121,32,108,105,110,101,116,111,10,32,32,32,32,88,32,89,32,108,105,110,101,116,111,10,32,32,32,32,120,32,89,32,108,105,110,101,116,111,10,32,32,32,32,99,108,111,115,101,112,97,116,104,32,115,116,114,111,107,101,10,32,125,32,100,101,102,10,47,100,98,103,115,116,97,114,116,32,123,32,103,115,97,118,101,32,37,46,53,103,32,37,46,53,103,32,116,114,97,110,115,108,97,116,101,32,125,32,100,101,102,10,47,97,114,114,111,119,108,101,110,103,116,104,32,49,48,32,100,101,102,10,47,97,114,114,111,119,119,105,100,116,104,32,97,114,114,111,119,108,101,110,103,116,104,32,50,32,100,105,118,32,100,101,102,10,47,97,114,114,111,119,104,101,97,100,32,123,10,32,32,32,32,103,115,97,118,101,10,32,32,32,32,114,111,116,97,116,101,10,32,32,32,32,99,117,114,114,101,110,116,112,111,105,110,116,10,32,32,32,32,110,101,119,112,97,116,104,10,32,32,32,32,109,111,118,101,116,111,10,32,32,32,32,97,114,114,111,119,108,101,110,103,116,104,32,97,114,114,111,119,119,105,100,116,104,32,50,32,100,105,118,32,114,108,105,110,101,116,111,10,32,32,32,32,48,32,97,114,114,111,119,119,105,100,116,104,32,110,101,103,32,114,108,105,110,101,116,111,10,32,32,32,32,99,108,111,115,101,112,97,116,104,32,102,105,108,108,10,32,32,32,32,103,114,101,115,116,111,114,101,10,125,32,98,105,110,100,32,100,101,102,10,47,109,97,107,101,97,114,114,111,119,32,123,10,32,32,32,32,99,117,114,114,101,110,116,112,111,105,110,116,32,101,120,99,104,32,112,111,112,32,115,117,98,32,101,120,99,104,32,99,117,114,114,101,110,116,112,111,105,110,116,32,112,111,112,32,115,117,98,32,97,116,97,110,10,32,32,32,32,97,114,114,111,119,104,101,97,100,10,125,32,98,105,110,100,32,100,101,102,10,47,112,111,105,110,116,32,123,32,32,32,32,110,101,119,112,97,116,104,32,32,32,32,50,32,48,32,51,54,48,32,97,114,99,32,102,105,108,108,125,32,100,101,102,47,109,97,107,101,118,101,99,32,123,10,32,32,32,32,47,89,32,101,120,99,104,32,100,101,102,10,32,32,32,32,47,88,32,101,120,99,104,32,100,101,102,10,32,32,32,32,47,121,32,101,120,99,104,32,100,101,102,10,32,32,32,32,47,120,32,101,120,99,104,32,100,101,102,10,32,32,32,32,110,101,119,112,97,116,104,32,120,32,121,32,109,111,118,101,116,111,10,32,32,32,32,88,32,89,32,108,105,110,101,116,111,32,115,116,114,111,107,101,10,32,32,32,32,88,32,89,32,109,111,118,101,116,111,10,32,32,32,32,120,32,121,32,109,97,107,101,97,114,114,111,119,10,125,32,100,101,102,10,0],"i8",c);BAa=d([47,115,118,103,47,108,105,103,104,116,115,107,121,98,108,117,101,0],"i8",c);CAa=d([105,97,99,117,116,101,0],"i8",c);DAa=d([105,110,118,101,109,112,116,121,0],"i8",c);EAa=d([47,115,118,103,47,108,105,103,104,116,115,101,97,103,114,101,101,110,0],"i8",c);FAa=d([47,98,117,103,110,55,47,50,0],"i8",c);GAa=d([47,115,118,103,47,108,105,103,104,116,115,97,108,109,111,110,0],"i8",c);HAa=d([47,115,118,103,47,108,105,103,104,116,112,105,110,107,0],"i8",c);Vx=d([102,108,97,116,105,110,100,101,120,40,97,103,104,101,97,100,40,101,41,41,32,60,32,77,45,62,110,114,111,119,115,0],"i8",c);IAa=d([47,115,118,103,47,108,105,103,104,116,103,114,101,121,0],"i8",c);JAa=d([47,115,118,103,47,108,105,103,104,116,103,114,101,101,110,0],"i8",c);KAa=d([47,115,118,103,47,108,105,103,104,116,103,114,97,121,0],"i8",c);IS=d([34,32,115,116,114,111,107,101,45,119,105,100,116,104,61,34,37,103,0],"i8",c);iS=d([37,46,53,103,32,37,46,53,103,32,37,46,53,103,32,37,115,99,111,108,111,114,10,0],"i8",c);LAa=d([47,115,118,103,47,108,105,103,104,116,103,111,108,100,101,110,114,111,100,121,101,108,108,111,119,0],"i8",c);MAa=d([47,115,118,103,47,108,105,103,104,116,99,121,97,110,0],"i8",c);CG=d([37,115,32,37,100,32,110,111,100,101,115,32,37,100,32,101,100,103,101,115,32,109,97,120,105,116,101,114,61,37,100,32,98,97,108,97,110,99,101,61,37,100,10,0],"i8",c);NAa=d([47,115,118,103,47,108,105,103,104,116,99,111,114,97,108,0],"i8",c);vR=d([60,97,114,101,97,32,115,104,97,112,101,61,34,99,105,114,99,108,101,34,0],"i8",c);IM=d([80,108,101,97,115,101,32,117,115,101,32,97,32,115,105,110,103,108,101,32,100,101,102,105,110,105,116,105,111,110,32,111,102,32,116,104,101,32,115,117,98,103,114,97,112,104,32,119,105,116,104,105,110,32,116,104,101,32,99,111,110,116,101,120,116,32,111,102,32,105,116,115,32,112,97,114,101,110,116,32,103,114,97,112,104,32,34,37,115,34,10,0],"i8",c);OAa=d([47,115,118,103,47,108,105,103,104,116,98,108,117,101,0],"i8",c);PAa=d([104,101,108,108,105,112,0],"i8",c);QAa=d([47,115,118,103,47,108,101,109,111,110,99,104,105,102,102,111,110,0],"i8",c);RAa=d([47,98,117,103,110,55,47,49,0],"i8",c);SAa=d([47,115,118,103,47,108,97,119,110,103,114,101,101,110,0],"i8",c);TAa=d([47,115,118,103,47,108,97,118,101,110,100,101,114,98,108,117,115,104,0],"i8",c);UAa=d([47,115,118,103,47,108,97,118,101,110,100,101,114,0],"i8",c);VAa=d([47,115,118,103,47,107,104,97,107,105,0],"i8",c);WAa=d([47,115,118,103,47,105,118,111,114,121,0],"i8",c);HS=d([34,32,115,116,114,111,107,101,61,34,0],"i8",c);hS=d([115,101,116,104,115,98,0],"i8",c);XAa=d([47,115,118,103,47,105,110,100,105,103,111,0],"i8",c);YAa=d([47,115,118,103,47,105,110,100,105,97,110,114,101,100,0],"i8",c);ZAa=d([47,115,118,103,47,104,111,116,112,105,110,107,0],"i8",c);$Aa=d([47,115,118,103,47,104,111,110,101,121,100,101,119,0],"i8",c);aBa=d([104,101,97,114,116,115,0],"i8",c);bBa=d([47,115,118,103,47,103,114,101,121,0],"i8",c);cBa=d([47,98,117,103,110,54,47,54,0],"i8",c);dBa=d([47,115,118,103,47,103,114,101,101,110,121,101,108,108,111,119,0],"i8",c);eBa=d([47,115,118,103,47,103,114,101,101,110,0],"i8",c);fBa=d([47,115,118,103,47,103,114,97,121,0],"i8",c);MI=d([76,82,0],"i8",c);gBa=d([47,115,118,103,47,103,111,108,100,101,110,114,111,100,0],"i8",c);hBa=d([47,115,118,103,47,103,111,108,100,0],"i8",c);iBa=d([47,97,99,99,101,110,116,54,47,50,0],"i8",c);jBa=d([47,115,118,103,47,103,104,111,115,116,119,104,105,116,101,0],"i8",c);kBa=d([47,115,118,103,47,103,97,105,110,115,98,111,114,111,0],"i8",c);lBa=d([47,115,118,103,47,102,117,99,104,115,105,97,0],"i8",c);mBa=d([47,115,118,103,47,102,111,114,101,115,116,103,114,101,101,110,0],"i8",c);nBa=d([104,97,114,114,0],"i8",c);oBa=d([47,115,118,103,47,102,108,111,114,97,108,119,104,105,116,101,0],"i8",c);pBa=d([47,98,117,103,110,54,47,53,0],"i8",c);qBa=d([47,115,118,103,47,102,105,114,101,98,114,105,99,107,0],"i8",c);rBa=d([47,115,118,103,47,100,111,100,103,101,114,98,108,117,101,0],"i8",c);sBa=d([47,115,118,103,47,100,105,109,103,114,101,121,0],"i8",c);tBa=d([47,115,118,103,47,100,105,109,103,114,97,121,0],"i8",c);uBa=d([47,115,118,103,47,100,101,101,112,115,107,121,98,108,117,101,0],"i8",c);GS=d([34,32,102,105,108,108,45,111,112,97,99,105,116,121,61,34,37,102,0],"i8",c);vBa=d([112,111,105,110,116,0],"i8",c);TA=d([101,112,115,58,112,115,0],"i8",c);wBa=d([47,115,118,103,47,100,101,101,112,112,105,110,107,0],"i8",c);xBa=d([47,115,118,103,47,100,97,114,107,118,105,111,108,101,116,0],"i8",c);yBa=d([47,115,118,103,47,100,97,114,107,116,117,114,113,117,111,105,115,101,0],"i8",c);zBa=d([47,115,118,103,47,100,97,114,107,115,108,97,116,101,103,114,101,121,0],"i8",c);ABa=d([104,65,114,114,0],"i8",c);BBa=d([47,115,118,103,47,100,97,114,107,115,108,97,116,101,103,114,97,121,0],"i8",c);CBa=d([47,98,117,103,110,54,47,52,0],"i8",c);DBa=d([47,115,118,103,47,100,97,114,107,115,108,97,116,101,98,108,117,101,0],"i8",c);EBa=d([47,115,118,103,47,100,97,114,107,115,101,97,103,114,101,101,110,0],"i8",c);FBa=d([47,115,118,103,47,100,97,114,107,115,97,108,109,111,110,0],"i8",c);GBa=d([47,115,118,103,47,100,97,114,107,114,101,100,0],"i8",c);HBa=d([47,115,118,103,47,100,97,114,107,111,114,99,104,105,100,0],"i8",c);ES=d([32,102,105,108,108,61,34,0],"i8",c);IBa=d([47,115,118,103,47,100,97,114,107,111,114,97,110,103,101,0],"i8",c);hR=d([110,32,62,61,32,52,0],"i8",c);JBa=d([47,115,118,103,47,100,97,114,107,111,108,105,118,101,103,114,101,101,110,0],"i8",c);KBa=d([47,115,118,103,47,100,97,114,107,109,97,103,101,110,116,97,0],"i8",c);LBa=d([47,115,118,103,47,100,97,114,107,107,104,97,107,105,0],"i8",c);MBa=d([103,116,0],"i8",c);Yj=d([103,114,101,101,110,0],"i8",c);NBa=d([47,115,118,103,47,100,97,114,107,103,114,101,121,0],"i8",c);OBa=d([47,98,117,103,110,54,47,51,0],"i8",c);PBa=d([47,115,118,103,47,100,97,114,107,103,114,101,101,110,0],"i8",c);QBa=d([47,115,118,103,47,100,97,114,107,103,114,97,121,0],"i8",c);lM=d([37,115,58,37,100,58,32,115,116,114,105,110,103,32,114,97,110,32,112,97,115,116,32,101,110,100,32,111,102,32,108,105,110,101,10,0],"i8",c);RBa=d([47,115,118,103,47,100,97,114,107,103,111,108,100,101,110,114,111,100,0],"i8",c);SBa=d([47,115,118,103,47,100,97,114,107,99,121,97,110,0],"i8",c);TBa=d([47,115,118,103,47,100,97,114,107,98,108,117,101,0],"i8",c);Dm=d([34,47,62,10,0],"i8",c);lS=d([37,115,10,0],"i8",c);UBa=d([47,115,118,103,47,99,121,97,110,0],"i8",c);VBa=d([47,115,118,103,47,99,114,105,109,115,111,110,0],"i8",c);WBa=d([47,115,118,103,47,99,111,114,110,115,105,108,107,0],"i8",c);XBa=d([47,115,118,103,47,99,111,114,110,102,108,111,119,101,114,98,108,117,101,0],"i8",c);YBa=d([103,101,0],"i8",c);ZBa=d([47,115,118,103,47,99,111,114,97,108,0],"i8",c);$Ba=d([47,98,117,103,110,54,47,50,0],"i8",c);aCa=d([47,115,118,103,47,99,104,111,99,111,108,97,116,101,0],"i8",c);bCa=d([47,115,118,103,47,99,104,97,114,116,114,101,117,115,101,0],"i8",c);cCa=d([47,115,118,103,47,99,97,100,101,116,98,108,117,101,0],"i8",c);dCa=d([65,118,97,110,116,71,97,114,100,101,45,68,101,109,105,0],"i8",c);eCa=d([47,115,118,103,47,98,117,114,108,121,119,111,111,100,0],"i8",c);fCa=d([47,115,118,103,47,98,114,111,119,110,0],"i8",c);UA=d([37,103,44,37,103,32,0],"i8",c);qh=d([105,110,118,105,115,0],"i8",c);gCa=d([47,115,118,103,47,98,108,117,101,118,105,111,108,101,116,0],"i8",c);hCa=d([47,115,118,103,47,98,108,117,101,0],"i8",c);YF=d([92,71,0],"i8",c);iCa=d([47,115,118,103,47,98,108,97,110,99,104,101,100,97,108,109,111,110,100,0],"i8",c);ky=d([83,32,0],"i8",c);jCa=d([47,115,118,103,47,98,108,97,99,107,0],"i8",c);d([83,121,110,116,97,120,32,101,114,114,111,114,58,32,110,111,110,45,115,112,97,99,101,32,115,116,114,105,110,103,32,117,115,101,100,32,97,102,116,101,114,32,60,47,84,65,66,76,69,62,0],"i8",c);kCa=d([103,97,109,109,97,0],"i8",c);rN=d([69,68,95,116,111,95,118,105,114,116,40,101,41,32,33,61,32,78,85,76,76,0],"i8",c);lCa=d([47,115,118,103,47,98,105,115,113,117,101,0],"i8",c);mCa=d([47,98,117,103,110,54,47,49,0],"i8",c);nCa=d([47,115,118,103,47,98,101,105,103,101,0],"i8",c);gw=d([44,32,0],"i8",c);yL=d([99,97,110,110,111,116,32,114,101,97,108,108,111,99,32,116,114,105,115,0],"i8",c);oCa=d([47,115,118,103,47,97,122,117,114,101,0],"i8",c);zG=d([78,111,116,32,98,117,105,108,116,32,119,105,116,104,32,108,105,98,101,120,112,97,116,46,32,84,97,98,108,101,32,102,111,114,109,97,116,116,105,110,103,32,105,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,46,10,0],"i8",c);gv=d([104,101,97,100,95,108,112,0],"i8",c);pCa=d([47,115,118,103,47,97,113,117,97,109,97,114,105,110,101,0],"i8",c);pK=d([110,101,119,46,103,118,0],"i8",c);d([73,110,118,97,108,105,100,32,112,97,114,97,109,101,116,101,114,32,34,37,115,34,32,102,111,114,32,45,113,32,102,108,97,103,32,45,32,105,103,110,111,114,101,100,10,0],"i8",c);jI=d([99,111,117,108,100,110,39,116,32,111,112,101,110,32,101,112,115,102,32,102,105,108,101,32,37,115,10,0],"i8",c);qCa=d([47,115,118,103,47,97,113,117,97,0],"i8",c);rCa=d([47,115,118,103,47,97,110,116,105,113,117,101,119,104,105,116,101,0],"i8",c);VA=d([32,112,111,105,110,116,115,61,34,0],"i8",c);kS=d([37,115,32,0],"i8",c);vx=d([115,97,109,101,104,101,97,100,0],"i8",c);WA=d([99,97,100,101,116,98,108,117,101,0],"i8",c);sCa=d([47,115,118,103,47,97,108,105,99,101,98,108,117,101,0],"i8",c);tCa=d([47,115,112,101,99,116,114,97,108,57,47,57,0],"i8",c);uCa=d([47,115,112,101,99,116,114,97,108,57,47,56,0],"i8",c);vCa=d([47,115,112,101,99,116,114,97,108,57,47,55,0],"i8",c);wCa=d([102,114,97,115,108,0],"i8",c);xCa=d([47,115,112,101,99,116,114,97,108,57,47,54,0],"i8",c);yCa=d([47,98,117,103,110,53,47,53,0],"i8",c);zCa=d([47,115,112,101,99,116,114,97,108,57,47,53,0],"i8",c);ACa=d([47,115,112,101,99,116,114,97,108,57,47,52,0],"i8",c);BCa=d([47,115,112,101,99,116,114,97,108,57,47,51,0],"i8",c);CCa=d([47,115,112,101,99,116,114,97,108,57,47,50,0],"i8",c);DCa=d([47,115,112,101,99,116,114,97,108,57,47,49,0],"i8",c);ECa=d([60,112,111,108,121,108,105,110,101,0],"i8",c);bL=d([109,109,0],"i8",c);Cp=d([115,101,116,108,105,110,101,119,105,100,116,104,0],"i8",c);FCa=d([47,115,112,101,99,116,114,97,108,56,47,56,0],"i8",c);GCa=d([32,32,32,32,32,32,32,32,47,69,110,99,111,100,105,110,103,32,69,110,99,111,100,105,110,103,86,101,99,116,111,114,32,100,101,102,0],"i8",c);HCa=d([47,115,112,101,99,116,114,97,108,56,47,55,0],"i8",c);yK=d([99,111,108,111,114,32,37,115,0],"i8",c);ICa=d([47,115,112,101,99,116,114,97,108,56,47,54,0],"i8",c);JCa=d([47,115,112,101,99,116,114,97,108,56,47,53,0],"i8",c);KCa=d([102,114,97,99,51,52,0],"i8",c);LCa=d([47,115,112,101,99,116,114,97,108,56,47,52,0],"i8",c);MCa=d([47,98,117,103,110,53,47,52,0],"i8",c);NCa=d([47,115,112,101,99,116,114,97,108,56,47,51,0],"i8",c);OCa=d([47,115,112,101,99,116,114,97,108,56,47,50,0],"i8",c);PCa=d([47,115,112,101,99,116,114,97,108,56,47,49,0],"i8",c);QCa=d([47,115,112,101,99,116,114,97,108,55,47,55,0],"i8",c);RCa=d([47,115,112,101,99,116,114,97,108,55,47,54,0],"i8",c);jS=d([32,115,101,116,108,105,110,101,119,105,100,116,104,10,0],"i8",c);SCa=d([47,115,112,101,99,116,114,97,108,55,47,53,0],"i8",c);TCa=d([47,115,112,101,99,116,114,97,108,55,47,52,0],"i8",c);UCa=d([47,115,112,101,99,116,114,97,108,55,47,51,0],"i8",c);VCa=d([47,115,112,101,99,116,114,97,108,55,47,50,0],"i8",c);WCa=d([102,114,97,99,49,52,0],"i8",c);XCa=d([104,97,108,102,0],"i8",c);YCa=d([47,115,112,101,99,116,114,97,108,55,47,49,0],"i8",c);ZCa=d([47,98,117,103,110,53,47,51,0],"i8",c);$Ca=d([47,115,112,101,99,116,114,97,108,54,47,54,0],"i8",c);aDa=d([47,115,112,101,99,116,114,97,108,54,47,53,0],"i8",c);bDa=d([47,115,112,101,99,116,114,97,108,54,47,52,0],"i8",c);BP=d([78,68,95,114,97,110,107,40,118,41,32,61,61,32,114,0],"i8",c);cDa=d([47,115,112,101,99,116,114,97,108,54,47,51,0],"i8",c);dDa=d([47,115,112,101,99,116,114,97,108,54,47,50,0],"i8",c);eDa=d([60,33,45,45,32,0],"i8",c);fDa=d([32,93,32,32,37,100,32,102,97,108,115,101,32,37,115,10,0],"i8",c);gDa=d([47,115,112,101,99,116,114,97,108,54,47,49,0],"i8",c);hDa=d([47,115,112,101,99,116,114,97,108,53,47,53,0],"i8",c);iDa=d([47,115,112,101,99,116,114,97,108,53,47,52,0],"i8",c);jDa=d([47,115,112,101,99,116,114,97,108,53,47,51,0],"i8",c);kDa=d([102,114,97,99,49,50,0],"i8",c);uR=d([114,101,99,116,97,110,103,108,101,32,40,37,100,44,37,100,41,32,40,37,100,44,37,100,41,32,37,115,32,37,115,10,0],"i8",c);HM=d([84,104,105,115,32,109,97,121,32,99,97,117,115,101,32,117,110,101,120,112,101,99,116,101,100,32,98,101,104,97,118,105,111,114,32,111,114,32,99,114,97,115,104,32,116,104,101,32,112,114,111,103,114,97,109,46,10,0],"i8",c);lDa=d([47,115,112,101,99,116,114,97,108,53,47,50,0],"i8",c);mDa=d([47,98,117,103,110,53,47,50,0],"i8",c);nDa=d([47,115,112,101,99,116,114,97,108,53,47,49,0],"i8",c);oDa=d([47,115,112,101,99,116,114,97,108,52,47,52,0],"i8",c);pDa=d([47,115,112,101,99,116,114,97,108,52,47,51,0],"i8",c);qDa=d([47,115,112,101,99,116,114,97,108,52,47,50,0],"i8",c);rDa=d([47,115,112,101,99,116,114,97,108,52,47,49,0],"i8",c);XA=d([121,101,108,108,111,119,103,114,101,101,110,0],"i8",c);sDa=d([32,93,32,32,37,100,32,116,114,117,101,32,37,115,10,0],"i8",c);tDa=d([47,115,112,101,99,116,114,97,108,51,47,51,0],"i8",c);oq=d([101,32,33,61,32,78,85,76,76,0],"i8",c);uDa=d([47,115,112,101,99,116,114,97,108,51,47,50,0],"i8",c);vDa=d([47,115,112,101,99,116,114,97,108,51,47,49,0],"i8",c);wDa=d([47,115,112,101,99,116,114,97,108,49,49,47,57,0],"i8",c);xDa=d([102,111,114,97,108,108,0],"i8",c);yDa=d([47,115,112,101,99,116,114,97,108,49,49,47,56,0],"i8",c);zDa=d([47,98,117,103,110,53,47,49,0],"i8",c);ADa=d([47,115,112,101,99,116,114,97,108,49,49,47,55,0],"i8",c);BDa=d([47,115,112,101,99,116,114,97,108,49,49,47,54,0],"i8",c);CDa=d([47,115,112,101,99,116,114,97,108,49,49,47,53,0],"i8",c);DDa=d([47,115,112,101,99,116,114,97,108,49,49,47,52,0],"i8",c);oK=d([71,0],"i8",c);EDa=d([47,115,112,101,99,116,114,97,108,49,49,47,51,0],"i8",c);wo=d([38,108,116,59,0],"i8",c);gc=d([32,0],"i8",c);FDa=d([47,97,99,99,101,110,116,54,47,49,0],"i8",c);GDa=d([47,115,112,101,99,116,114,97,108,49,49,47,50,0],"i8",c);HDa=d([47,115,112,101,99,116,114,97,108,49,49,47,49,49,0],"i8",c);IDa=d([47,115,112,101,99,116,114,97,108,49,49,47,49,48,0],"i8",c);JDa=d([47,115,112,101,99,116,114,97,108,49,49,47,49,0],"i8",c);KDa=d([102,110,111,102,0],"i8",c);LDa=d([47,115,112,101,99,116,114,97,108,49,48,47,57,0],"i8",c);MDa=d([47,98,117,103,110,52,47,52,0],"i8",c);NDa=d([47,115,112,101,99,116,114,97,108,49,48,47,56,0],"i8",c);ODa=d([47,115,112,101,99,116,114,97,108,49,48,47,55,0],"i8",c);PDa=d([47,115,112,101,99,116,114,97,108,49,48,47,54,0],"i8",c);QDa=d([47,115,112,101,99,116,114,97,108,49,48,47,53,0],"i8",c);RDa=d([47,115,112,101,99,116,114,97,108,49,48,47,52,0],"i8",c);YA=d([119,104,105,116,101,115,109,111,107,101,0],"i8",c);SDa=d([99,105,114,99,108,101,0],"i8",c);TDa=d([106,112,103,58,118,114,109,108,0],"i8",c);UDa=d([47,115,112,101,99,116,114,97,108,49,48,47,51,0],"i8",c);VDa=d([47,115,112,101,99,116,114,97,108,49,48,47,50,0],"i8",c);hH=d([101,110,100,32,112,111,114,116,58,32,40,37,46,53,103,44,32,37,46,53,103,41,44,32,116,97,110,103,101,110,116,32,97,110,103,108,101,58,32,37,46,53,103,44,32,37,115,10,0],"i8",c);WDa=d([47,115,112,101,99,116,114,97,108,49,48,47,49,48,0],"i8",c);XDa=d([47,115,112,101,99,116,114,97,108,49,48,47,49,0],"i8",c);YDa=d([101,120,105,115,116,0],"i8",c);ZDa=d([47,115,101,116,51,57,47,57,0],"i8",c);$Da=d([47,98,117,103,110,52,47,51,0],"i8",c);aEa=d([47,115,101,116,51,57,47,56,0],"i8",c);bEa=d([47,115,101,116,51,57,47,55,0],"i8",c);cEa=d([47,115,101,116,51,57,47,54,0],"i8",c);dEa=d([47,115,101,116,51,57,47,53,0],"i8",c);eEa=d([47,115,101,116,51,57,47,52,0],"i8",c);fEa=d([47,115,101,116,51,57,47,51,0],"i8",c);gEa=d([47,115,101,116,51,57,47,50,0],"i8",c);qy=d([103,118,114,101,110,100,101,114,95,99,111,114,101,95,102,105,103,46,99,0],"i8",c);hEa=d([47,115,101,116,51,57,47,49,0],"i8",c);iEa=d([47,115,101,116,51,56,47,56,0],"i8",c);jEa=d([101,117,114,111,0],"i8",c);ir=d([103,114,97,121,0],"i8",c);kEa=d([47,115,101,116,51,56,47,55,0],"i8",c);lEa=d([47,98,117,103,110,52,47,50,0],"i8",c);mEa=d([47,115,101,116,51,56,47,54,0],"i8",c);nEa=d([47,115,101,116,51,56,47,53,0],"i8",c);oEa=d([47,115,101,116,51,56,47,52,0],"i8",c);fM=d([110,111,110,45,116,101,114,109,105,110,97,116,101,100,32,72,84,77,76,32,115,116,114,105,110,103,32,115,116,97,114,116,105,110,103,32,108,105,110,101,32,37,100,44,32,102,105,108,101,32,37,115,10,0],"i8",c);pEa=d([47,115,101,116,51,56,47,51,0],"i8",c);Dy=d([103,118,114,101,110,100,101,114,95,99,111,114,101,95,116,107,46,99,0],"i8",c);qEa=d([47,115,101,116,51,56,47,50,0],"i8",c);ZA=d([119,104,101,97,116,0],"i8",c);rEa=d([112,115,50,58,112,115,0],"i8",c);sEa=d([47,115,101,116,51,56,47,49,0],"i8",c);tEa=d([47,115,101,116,51,55,47,55,0],"i8",c);uEa=d([47,115,101,116,51,55,47,54,0],"i8",c);vEa=d([47,115,101,116,51,55,47,53,0],"i8",c);wEa=d([101,117,109,108,0],"i8",c);xEa=d([47,115,101,116,51,55,47,52,0],"i8",c);yEa=d([47,98,117,103,110,52,47,49,0],"i8",c);zEa=d([47,115,101,116,51,55,47,51,0],"i8",c);AEa=d([47,115,101,116,51,55,47,50,0],"i8",c);BEa=d([47,115,101,116,51,55,47,49,0],"i8",c);bc=d([105,116,97,108,105,99,0],"i8",c);CEa=d([47,115,101,116,51,54,47,54,0],"i8",c);DEa=d([47,115,101,116,51,54,47,53,0],"i8",c);$A=d([118,105,111,108,101,116,0],"i8",c);EEa=d([98,97,100,95,97,114,114,97,121,95,110,101,119,95,108,101,110,103,116,104,0],"i8",c);FEa=d([47,115,101,116,51,54,47,52,0],"i8",c);GEa=d([47,115,101,116,51,54,47,51,0],"i8",c);HEa=d([47,115,101,116,51,54,47,50,0],"i8",c);KQ=d([115,101,116,108,105,110,101,119,105,100,116,104,40,37,46,51,102,41,0],"i8",c);IEa=d([116,107,58,116,107,0],"i8",c);JEa=d([47,115,101,116,51,54,47,49,0],"i8",c);KEa=d([101,116,104,0],"i8",c);vp=d([119,101,105,103,104,116,0],"i8",c);LEa=d([47,115,101,116,51,53,47,53,0],"i8",c);MEa=d([47,98,117,103,110,51,47,51,0],"i8",c);NEa=d([47,115,101,116,51,53,47,52,0],"i8",c);$L=d([44,10,0],"i8",c);xL=d([99,97,110,110,111,116,32,109,97,108,108,111,99,32,116,114,105,115,0],"i8",c);OEa=d([47,115,101,116,51,53,47,51,0],"i8",c);fj=d([108,112,0],"i8",c);PEa=d([47,115,101,116,51,53,47,50,0],"i8",c);d([77,105,115,115,105,110,103,32,97,114,103,117,109,101,110,116,32,102,111,114,32,45,108,32,102,108,97,103,10,0],"i8",c);tI=d([85,84,70,45,56,32,105,110,112,117,116,32,117,115,101,115,32,110,111,110,45,76,97,116,105,110,49,32,99,104,97,114,97,99,116,101,114,115,32,119,104,105,99,104,32,99,97,110,110,111,116,32,98,101,32,104,97,110,100,108,101,100,32,98,121,32,116,104,105,115,32,80,111,115,116,83,99,114,105,112,116,32,100,114,105,118,101,114,10,0],"i8",c);QEa=d([103,114,97,112,104,118,105,122,0],"i8",c);REa=d([47,115,101,116,51,53,47,49,0],"i8",c);SEa=d([47,115,101,116,51,52,47,52,0],"i8",c);aB=d([116,117,114,113,117,111,105,115,101,0],"i8",c);jr=d([112,115,0],"i8",c);TEa=d([47,115,101,116,51,52,47,51,0],"i8",c);bB=d([98,117,114,108,121,119,111,111,100,0],"i8",c);UEa=d([47,115,101,116,51,52,47,50,0],"i8",c);VEa=d([47,115,101,116,51,52,47,49,0],"i8",c);WEa=d([47,115,101,116,51,51,47,51,0],"i8",c);XEa=d([101,116,97,0],"i8",c);YEa=d([47,115,101,116,51,51,47,50,0],"i8",c);ZEa=d([47,98,117,103,110,51,47,50,0],"i8",c);$Ea=d([47,115,101,116,51,51,47,49,0],"i8",c);aFa=d([47,115,101,116,51,49,50,47,57,0],"i8",c);bFa=d([47,115,101,116,51,49,50,47,56,0],"i8",c);cFa=d([47,115,101,116,51,49,50,47,55,0],"i8",c);dFa=d([47,115,101,116,51,49,50,47,54,0],"i8",c);cB=d([116,111,109,97,116,111,0],"i8",c);aL=d([99,109,0],"i8",c);eFa=d([37,37,69,110,100,83,101,116,117,112,0],"i8",c);fFa=d([47,115,101,116,51,49,50,47,53,0],"i8",c);gFa=d([32,32,32,32,32,32,32,32,125,32,102,111,114,97,108,108,0],"i8",c);hFa=d([47,115,101,116,51,49,50,47,52,0],"i8",c);zv=d([98,111,116,104,0],"i8",c);iFa=d([47,115,101,116,51,49,50,47,51,0],"i8",c);jFa=d([47,115,101,116,51,49,50,47,50,0],"i8",c);kFa=d([101,113,117,105,118,0],"i8",c);lFa=d([47,115,101,116,51,49,50,47,49,50,0],"i8",c);mFa=d([47,98,117,103,110,51,47,49,0],"i8",c);nFa=d([47,115,101,116,51,49,50,47,49,49,0],"i8",c);oFa=d([47,115,101,116,51,49,50,47,49,48,0],"i8",c);pFa=d([41,10,45,45,62,10,0],"i8",c);qFa=d([47,115,101,116,51,49,50,47,49,0],"i8",c);rFa=d([47,115,101,116,51,49,49,47,57,0],"i8",c);sFa=d([47,115,101,116,51,49,49,47,56,0],"i8",c);dB=d([116,104,105,115,116,108,101,0],"i8",c);tFa=d([125,32,105,102,0],"i8",c);uFa=d([47,115,101,116,51,49,49,47,55,0],"i8",c);vFa=d([47,115,101,116,51,49,49,47,54,0],"i8",c);wFa=d([47,115,101,116,51,49,49,47,53,0],"i8",c);xFa=d([47,115,101,116,51,49,49,47,52,0],"i8",c);yFa=d([101,112,115,105,108,111,110,0],"i8",c);zFa=d([47,115,101,116,51,49,49,47,51,0],"i8",c);AFa=d([47,98,114,98,103,57,47,57,0],"i8",c);BFa=d([47,115,101,116,51,49,49,47,50,0],"i8",c);CFa=d([47,115,101,116,51,49,49,47,49,49,0],"i8",c);kr=d([32,40,0],"i8",c);DFa=d([47,115,101,116,51,49,49,47,49,48,0],"i8",c);EFa=d([47,115,101,116,51,49,49,47,49,0],"i8",c);eP=d([109,105,110,99,114,111,115,115,58,32,112,97,115,115,32,37,100,32,105,116,101,114,32,37,100,32,116,114,121,105,110,103,32,37,100,32,99,117,114,95,99,114,111,115,115,32,37,100,32,98,101,115,116,95,99,114,111,115,115,32,37,100,10,0],"i8",c);FFa=d([47,115,101,116,51,49,48,47,57,0],"i8",c);GFa=d([32,32,32,32,117,115,101,114,100,105,99,116,32,40,62,62,41,32,99,118,110,32,40,91,41,32,99,118,110,32,108,111,97,100,32,112,117,116,0],"i8",c);HFa=d([47,115,101,116,51,49,48,47,56,0],"i8",c);d([85,115,97,103,101,58,32,37,115,32,91,45,86,118,63,93,32,91,45,40,71,78,69,41,110,97,109,101,61,118,97,108,93,32,91,45,40,75,84,108,115,111,41,60,118,97,108,62,93,32,60,100,111,116,32,102,105,108,101,115,62,10,0],"i8",c);IFa=d([47,115,101,116,51,49,48,47,55,0],"i8",c);JFa=d([47,115,101,116,51,49,48,47,54,0],"i8",c);KFa=d([47,115,101,116,51,49,48,47,53,0],"i8",c);LFa=d([101,110,115,112,0],"i8",c);MFa=d([47,115,101,116,51,49,48,47,52,0],"i8",c);NFa=d([47,98,114,98,103,57,47,56,0],"i8",c);GM=d([84,104,101,32,117,115,101,32,111,102,32,34,115,117,98,103,114,97,112,104,32,37,115,34,44,32,108,105,110,101,32,37,100,44,32,119,105,116,104,111,117,116,32,97,32,98,111,100,121,32,105,115,32,100,101,112,114,101,99,97,116,101,100,46,10,0],"i8",c);OFa=d([47,115,101,116,51,49,48,47,51,0],"i8",c);PFa=d([47,115,101,116,51,49,48,47,50,0],"i8",c);lr=d([32,118,101,114,115,105,111,110,32,0],"i8",c);QFa=d([47,115,101,116,51,49,48,47,49,48,0],"i8",c);RFa=d([47,115,101,116,51,49,48,47,49,0],"i8",c);SFa=d([47,115,101,116,50,56,47,56,0],"i8",c);eB=d([116,97,110,0],"i8",c);TFa=d([32,32,32,32,117,115,101,114,100,105,99,116,32,40,60,60,41,32,99,118,110,32,40,91,41,32,99,118,110,32,108,111,97,100,32,112,117,116,0],"i8",c);UFa=d([47,115,101,116,50,56,47,55,0],"i8",c);d([40,97,100,100,105,116,105,111,110,97,108,32,111,112,116,105,111,110,115,32,102,111,114,32,110,101,97,116,111,41,32,32,32,32,91,45,120,93,32,91,45,110,60,118,62,93,10,0],"i8",c);VFa=d([76,101,102,116,0],"i8",c);WFa=d([47,115,101,116,50,56,47,54,0],"i8",c);XFa=d([47,115,101,116,50,56,47,53,0],"i8",c);YFa=d([47,115,101,116,50,56,47,52,0],"i8",c);ZFa=d([101,109,115,112,0],"i8",c);$Fa=d([47,115,101,116,50,56,47,51,0],"i8",c);aGa=d([47,98,114,98,103,57,47,55,0],"i8",c);bGa=d([47,115,101,116,50,56,47,50,0],"i8",c);cGa=d([47,115,101,116,50,56,47,49,0],"i8",c);dGa=d([10,60,33,45,45,32,71,101,110,101,114,97,116,101,100,32,98,121,32,0],"i8",c);eGa=d([47,115,101,116,50,55,47,55,0],"i8",c);fGa=d([47,115,101,116,50,55,47,54,0],"i8",c);gGa=d([47,115,101,116,50,55,47,53,0],"i8",c);fB=d([115,116,101,101,108,98,108,117,101,0],"i8",c);yg=d([92,78,0],"i8",c);hGa=d([50,32,108,116,32,123,0],"i8",c);iGa=d([47,97,99,99,101,110,116,53,47,53,0],"i8",c);jGa=d([47,115,101,116,50,55,47,52,0],"i8",c);d([40,97,100,100,105,116,105,111,110,97,108,32,111,112,116,105,111,110,115,32,102,111,114,32,102,100,112,41,32,32,32,32,32,32,91,45,76,40,103,79,41,93,32,91,45,76,40,110,85,67,84,41,60,118,97,108,62,93,10,0],"i8",c);kGa=d([47,115,101,116,50,55,47,51,0],"i8",c);lGa=d([47,115,101,116,50,55,47,50,0],"i8",c);mGa=d([47,115,101,116,50,55,47,49,0],"i8",c);nGa=d([101,109,112,116,121,0],"i8",c);oGa=d([47,115,101,116,50,54,47,54,0],"i8",c);pGa=d([47,98,114,98,103,57,47,54,0],"i8",c);qGa=d([47,115,101,116,50,54,47,53,0],"i8",c);rGa=d([47,115,101,116,50,54,47,52,0],"i8",c);sGa=d([60,72,84,77,76,62,10,0],"i8",c);tGa=d([47,115,101,116,50,54,47,51,0],"i8",c);uGa=d([47,115,101,116,50,54,47,50,0],"i8",c);vGa=d([47,115,101,116,50,54,47,49,0],"i8",c);gB=d([115,112,114,105,110,103,103,114,101,101,110,0],"i8",c);wGa=d([111,118,97,108,0],"i8",c);xGa=d([102,105,103,58,102,105,103,0],"i8",c);yGa=d([106,112,101,58,118,114,109,108,0],"i8",c);zGa=d([47,115,101,116,50,53,47,53,0],"i8",c);d([40,97,100,100,105,116,105,111,110,97,108,32,111,112,116,105,111,110,115,32,102,111,114,32,109,101,109,116,101,115,116,41,32,32,91,45,109,93,10,0],"i8",c);AGa=d([47,115,101,116,50,53,47,52,0],"i8",c);Lt=d([110,111,116,32,99,111,110,115,116,114,97,105,110,101,100,0],"i8",c);BGa=d([47,108,97,110,103,117,97,103,101,108,101,118,101,108,32,119,104,101,114,101,32,123,112,111,112,32,108,97,110,103,117,97,103,101,108,101,118,101,108,125,123,49,125,32,105,102,101,108,115,101,0],"i8",c);CGa=d([47,115,101,116,50,53,47,51,0],"i8",c);DGa=d([47,115,101,116,50,53,47,50,0],"i8",c);EGa=d([101,103,114,97,118,101,0],"i8",c);FGa=d([47,115,101,116,50,53,47,49,0],"i8",c);GGa=d([47,98,114,98,103,57,47,53,0],"i8",c);HGa=d([47,115,101,116,50,52,47,52,0],"i8",c);IGa=d([47,115,101,116,50,52,47,51,0],"i8",c);JGa=d([101,99,105,114,99,0],"i8",c);LT=d([32,99,111,111,114,100,111,114,105,103,105,110,61,34,48,44,48,34,32,99,111,111,114,100,115,105,122,101,61,34,37,100,44,37,100,34,32,62,0],"i8",c);KGa=d([47,115,101,116,50,52,47,50,0],"i8",c);LGa=d([47,115,101,116,50,52,47,49,0],"i8",c);MGa=d([47,115,101,116,50,51,47,51,0],"i8",c);hB=d([115,110,111,119,0],"i8",c);NGa=d([37,32,109,97,107,101,32,39,60,60,39,32,97,110,100,32,39,62,62,39,32,115,97,102,101,32,111,110,32,80,83,32,76,101,118,101,108,32,49,32,100,101,118,105,99,101,115,0],"i8",c);OGa=d([47,115,101,116,50,51,47,50,0],"i8",c);d([40,97,100,100,105,116,105,111,110,97,108,32,111,112,116,105,111,110,115,32,102,111,114,32,99,111,110,102,105,103,41,32,32,91,45,99,118,93,10,0],"i8",c);PGa=d([47,115,101,116,50,51,47,49,0],"i8",c);QGa=d([47,115,101,116,49,57,47,57,0],"i8",c);RGa=d([47,115,101,116,49,57,47,56,0],"i8",c);SGa=d([108,0],"i8",c);TGa=d([47,115,101,116,49,57,47,55,0],"i8",c);iB=d([102,117,99,104,115,105,97,0],"i8",c);UGa=d([47,98,114,98,103,57,47,52,0],"i8",c);VGa=d([47,115,101,116,49,57,47,54,0],"i8",c);WGa=d([47,115,101,116,49,57,47,53,0],"i8",c);KT=d([32,119,105,100,116,104,58,32,37,100,112,116,59,32,104,101,105,103,104,116,58,32,37,100,112,116,34,0],"i8",c);XGa=d([47,115,101,116,49,57,47,52,0],"i8",c);YGa=d([47,115,101,116,49,57,47,51,0],"i8",c);aT=d([103,114,97,112,104,32,108,97,98,101,108,0],"i8",c);mM=d([37,115,58,37,100,58,32,97,109,98,105,103,117,111,117,115,32,34,37,115,34,32,115,112,108,105,116,115,32,105,110,116,111,32,116,119,111,32,110,97,109,101,115,58,32,34,37,115,34,32,97,110,100,32,34,37,115,34,10,0],"i8",c);ZGa=d([47,115,101,116,49,57,47,50,0],"i8",c);jB=d([115,108,97,116,101,103,114,101,121,0],"i8",c);$Ga=d([47,112,100,102,109,97,114,107,32,119,104,101,114,101,32,123,112,111,112,125,32,123,117,115,101,114,100,105,99,116,32,47,112,100,102,109,97,114,107,32,47,99,108,101,97,114,116,111,109,97,114,107,32,108,111,97,100,32,112,117,116,125,32,105,102,101,108,115,101,0],"i8",c);aHa=d([47,115,101,116,49,57,47,49,0],"i8",c);PF=d([102,111,110,116,110,97,109,101,58,32,117,110,97,98,108,101,32,116,111,32,114,101,115,111,108,118,101,32,34,37,115,34,10,0],"i8",c);d([10,32,45,86,32,32,32,32,32,32,32,32,32,32,45,32,80,114,105,110,116,32,118,101,114,115,105,111,110,32,97,110,100,32,101,120,105,116,10,32,45,118,32,32,32,32,32,32,32,32,32,32,45,32,69,110,97,98,108,101,32,118,101,114,98,111,115,101,32,109,111,100,101,32,10,32,45,71,110,97,109,101,61,118,97,108,32,32,45,32,83,101,116,32,103,114,97,112,104,32,97,116,116,114,105,98,117,116,101,32,39,110,97,109,101,39,32,116,111,32,39,118,97,108,39,10,32,45,78,110,97,109,101,61,118,97,108,32,32,45,32,83,101,116,32,110,111,100,101,32,97,116,116,114,105,98,117,116,101,32,39,110,97,109,101,39,32,116,111,32,39,118,97,108,39,10,32,45,69,110,97,109,101,61,118,97,108,32,32,45,32,83,101,116,32,101,100,103,101,32,97,116,116,114,105,98,117,116,101,32,39,110,97,109,101,39,32,116,111,32,39,118,97,108,39,10,32,45,84,118,32,32,32,32,32,32,32,32,32,45,32,83,101,116,32,111,117,116,112,117,116,32,102,111,114,109,97,116,32,116,111,32,39,118,39,10,32,45,75,118,32,32,32,32,32,32,32,32,32,45,32,83,101,116,32,108,97,121,111,117,116,32,101,110,103,105,110,101,32,116,111,32,39,118,39,32,40,111,118,101,114,114,105,100,101,115,32,100,101,102,97,117,108,116,32,98,97,115,101,100,32,111,110,32,99,111,109,109,97,110,100,32,110,97,109,101,41,10,32,45,108,118,32,32,32,32,32,32,32,32,32,45,32,85,115,101,32,101,120,116,101,114,110,97,108,32,108,105,98,114,97,114,121,32,39,118,39,10,32,45,111,102,105,108,101,32,32,32,32,32,32,45,32,87,114,105,116,101,32,111,117,116,112,117,116,32,116,111,32,39,102,105,108,101,39,10,32,45,79,32,32,32,32,32,32,32,32,32,32,45,32,65,117,116,111,109,97,116,105,99,97,108,108,121,32,103,101,110,101,114,97,116,101,32,97,110,32,111,117,116,112,117,116,32,102,105,108,101,110,97,109,101,32,98,97,115,101,100,32,111,110,32,116,104,101,32,105,110,112,117,116,32,102,105,108,101,110,97,109,101,32,119,105,116,104,32,97,32,46,39,102,111,114,109,97,116,39,32,97,112,112,101,110,100,101,100,46,32,40,67,97,117,115,101,115,32,97,108,108,32,45,111,102,105,108,101,32,111,112,116,105,111,110,115,32,116,111,32,98,101,32,105,103,110,111,114,101,100,46,41,32,10,32,45,80,32,32,32,32,32,32,32,32,32,32,45,32,73,110,116,101,114,110,97,108,108,121,32,103,101,110,101,114,97,116,101,32,97,32,103,114,97,112,104,32,111,102,32,116,104,101,32,99,117,114,114,101,110,116,32,112,108,117,103,105,110,115,46,32,10,32,45,113,91,108,93,32,32,32,32,32,32,32,45,32,83,101,116,32,108,101,118,101,108,32,111,102,32,109,101,115,115,97,103,101,32,115,117,112,112,114,101,115,115,105,111,110,32,40,61,49,41,10,32,45,115,91,118,93,32,32,32,32,32,32,32,45,32,83,99,97,108,101,32,105,110,112,117,116,32,98,121,32,39,118,39,32,40,61,55,50,41,10,32,45,121,32,32,32,32,32,32,32,32,32,32,45,32,73,110,118,101,114,116,32,121,32,99,111,111,114,100,105,110,97,116,101,32,105,110,32,111,117,116,112,117,116,10,0],"i8",c);bHa=d([47,115,101,116,49,56,47,56,0],"i8",c);cHa=d([47,115,101,116,49,56,47,55,0],"i8",c);dHa=d([47,115,101,116,49,56,47,54,0],"i8",c);eHa=d([101,97,99,117,116,101,0],"i8",c);fHa=d([47,115,101,116,49,56,47,53,0],"i8",c);gHa=d([47,98,114,98,103,57,47,51,0],"i8",c);hHa=d([47,115,101,116,49,56,47,52,0],"i8",c);iHa=d([47,115,101,116,49,56,47,51,0],"i8",c);JT=d([32,60,118,58,103,114,111,117,112,32,115,116,121,108,101,61,34,112,111,115,105,116,105,111,110,58,114,101,108,97,116,105,118,101,59,32,0],"i8",c);jHa=d([47,115,101,116,49,56,47,50,0],"i8",c);vg=d([111,98,108,105,113,117,101,0],"i8",c);kHa=d([47,115,101,116,49,56,47,49,0],"i8",c);lHa=d([47,115,101,116,49,55,47,55,0],"i8",c);kB=d([115,108,97,116,101,103,114,97,121,0],"i8",c);mHa=d([37,32,109,97,107,101,32,115,117,114,101,32,112,100,102,109,97,114,107,32,105,115,32,104,97,114,109,108,101,115,115,32,102,111,114,32,80,83,45,105,110,116,101,114,112,114,101,116,101,114,115,32,111,116,104,101,114,32,116,104,97,110,32,68,105,115,116,105,108,108,101,114,0],"i8",c);nHa=d([47,115,101,116,49,55,47,54,0],"i8",c);d([10,32,45,110,91,118,93,32,32,32,32,32,32,32,45,32,78,111,32,108,97,121,111,117,116,32,109,111,100,101,32,39,118,39,32,40,61,49,41,10,32,45,120,32,32,32,32,32,32,32,32,32,32,45,32,82,101,100,117,99,101,32,103,114,97,112,104,10,0],"i8",c);oHa=d([47,115,101,116,49,55,47,53,0],"i8",c);d([115,121,115,116,101,109,32,98,121,116,101,115,32,32,32,32,32,61,32,37,49,48,108,117,10,0],"i8",c);pHa=d([47,115,101,116,49,55,47,52,0],"i8",c);NQ=d([35,37,48,50,120,37,48,50,120,37,48,50,120,37,48,50,120,0],"i8",c);Qp=d([32,91,0],"i8",c);qHa=d([47,115,101,116,49,55,47,51,0],"i8",c);rHa=d([100,105,118,105,100,101,0],"i8",c);eq=d([108,104,101,97,100,0],"i8",c);sHa=d([47,115,101,116,49,55,47,50,0],"i8",c);tHa=d([47,98,114,98,103,57,47,50,0],"i8",c);uHa=d([47,115,101,116,49,55,47,49,0],"i8",c);ML=d([97,103,117,115,101,114,103,114,97,112,104,0],"i8",c);Jv=d([114,111,117,116,101,46,99,0],"i8",c);vHa=d([47,115,101,116,49,54,47,54,0],"i8",c);Fl=d([120,108,112,0],"i8",c);IT=d([60,120,109,108,58,110,97,109,101,115,112,97,99,101,32,110,115,61,34,117,114,110,58,115,99,104,101,109,97,115,45,109,105,99,114,111,115,111,102,116,45,99,111,109,58,118,109,108,34,32,112,114,101,102,105,120,61,34,118,34,32,47,62,10,0],"i8",c);wHa=d([47,115,101,116,49,54,47,53,0],"i8",c);xHa=d([70,0],"i8",c);d([85,115,101,32,111,110,101,32,111,102,58,37,115,10,0],"i8",c);QR=d([125,32,98,105,110,100,32,100,101,102,10,0],"i8",c);yHa=d([47,115,101,116,49,54,47,52,0],"i8",c);zHa=d([47,115,101,116,49,54,47,51,0],"i8",c);lB=d([115,108,97,116,101,98,108,117,101,0],"i8",c);AHa=d([37,32,47,97,114,114,111,119,119,105,100,116,104,32,53,32,100,101,102,0],"i8",c);BHa=d([47,115,101,116,49,54,47,50,0],"i8",c);mB=d([98,114,111,119,110,0],"i8",c);d([115,116,114,105,110,103,32,118,97,108,32,105,115,32,37,115,10,0],"i8",c);d([10,32,45,76,103,32,32,32,32,32,32,32,32,32,45,32,68,111,110,39,116,32,117,115,101,32,103,114,105,100,10,32,45,76,79,32,32,32,32,32,32,32,32,32,45,32,85,115,101,32,111,108,100,32,97,116,116,114,97,99,116,105,118,101,32,102,111,114,99,101,10,32,45,76,110,60,105,62,32,32,32,32,32,32,45,32,83,101,116,32,110,117,109,98,101,114,32,111,102,32,105,116,101,114,97,116,105,111,110,115,32,116,111,32,105,10,32,45,76,85,60,105,62,32,32,32,32,32,32,45,32,83,101,116,32,117,110,115,99,97,108,101,100,32,102,97,99,116,111,114,32,116,111,32,105,10,32,45,76,67,60,118,62,32,32,32,32,32,32,45,32,83,101,116,32,111,118,101,114,108,97,112,32,101,120,112,97,110,115,105,111,110,32,102,97,99,116,111,114,32,116,111,32,118,10,32,45,76,84,91,42,93,60,118,62,32,32,32,45,32,83,101,116,32,116,101,109,112,101,114,97,116,117,114,101,32,40,116,101,109,112,101,114,97,116,117,114,101,32,102,97,99,116,111,114,41,32,116,111,32,118,10,0],"i8",c);ov=d([76,97,121,111,117,116,32,116,121,112,101,58,32,34,37,115,34,32,110,111,116,32,114,101,99,111,103,110,105,122,101,100,46,32,85,115,101,32,111,110,101,32,111,102,58,37,115,10,0],"i8",c);CHa=d([47,115,101,116,49,54,47,49,0],"i8",c);DHa=d([47,115,101,116,49,53,47,53,0],"i8",c);EHa=d([47,115,101,116,49,53,47,52,0],"i8",c);FHa=d([100,105,97,109,115,0],"i8",c);KN=d([99,108,117,115,116,101,114,32,110,97,109,101,100,32,37,115,32,110,111,116,32,102,111,117,110,100,10,0],"i8",c);GHa=d([47,115,101,116,49,53,47,51,0],"i8",c);HHa=d([47,98,114,98,103,57,47,49,0],"i8",c);IHa=d([47,115,101,116,49,53,47,50,0],"i8",c);JHa=d([47,115,101,116,49,53,47,49,0],"i8",c);HT=d([60,47,83,84,89,76,69,62,10,0],"i8",c);KHa=d([47,115,101,116,49,52,47,52,0],"i8",c);LHa=d([47,115,101,116,49,52,47,51,0],"i8",c);MHa=d([47,115,101,116,49,52,47,50,0],"i8",c);nB=d([115,107,121,98,108,117,101,0],"i8",c);NHa=d([37,32,47,97,114,114,111,119,108,101,110,103,116,104,32,49,48,32,100,101,102,0],"i8",c);lQ=d([110,115,108,105,109,105,116,49,0],"i8",c);OHa=d([47,115,101,116,49,52,47,49,0],"i8",c);d([10,32,45,109,32,32,32,32,32,32,32,32,32,32,45,32,77,101,109,111,114,121,32,116,101,115,116,32,40,79,98,115,101,114,118,101,32,110,111,32,103,114,111,119,116,104,32,119,105,116,104,32,116,111,112,46,32,75,105,108,108,32,119,104,101,110,32,100,111,110,101,46,41,10,0],"i8",c);PHa=d([32,32,32,32,32,32,32,32,123,32,49,32,105,110,100,101,120,32,47,70,73,68,32,110,101,32,123,32,100,101,102,32,125,123,32,112,111,112,32,112,111,112,32,125,32,105,102,101,108,115,101,0],"i8",c);oL=d([116,114,105,97,110,103,117,108,97,116,105,111,110,32,102,97,105,108,101,100,0],"i8",c);QHa=d([47,115,101,116,49,51,47,51,0],"i8",c);qp=d([104,101,105,103,104,116,0],"i8",c);RHa=d([47,115,101,116,49,51,47,50,0],"i8",c);SHa=d([47,115,101,116,49,51,47,49,0],"i8",c);THa=d([100,101,108,116,97,0],"i8",c);UHa=d([47,114,101,100,115,57,47,57,0],"i8",c);VHa=d([47,98,114,98,103,56,47,56,0],"i8",c);WHa=d([47,114,101,100,115,57,47,56,0],"i8",c);XHa=d([47,114,101,100,115,57,47,55,0],"i8",c);GT=d([118,92,58,42,32,123,32,98,101,104,97,118,105,111,114,58,32,117,114,108,40,35,100,101,102,97,117,108,116,35,86,77,76,41,59,100,105,115,112,108,97,121,58,105,110,108,105,110,101,45,98,108,111,99,107,125,10,0],"i8",c);YHa=d([47,114,101,100,115,57,47,54,0],"i8",c);ZHa=d([47,114,101,100,115,57,47,53,0],"i8",c);$Ha=d([47,114,101,100,115,57,47,52,0],"i8",c);aIa=d([49,32,115,101,116,109,105,116,101,114,108,105,109,105,116,0],"i8",c);bIa=d([47,114,101,100,115,57,47,51,0],"i8",c);TF=d([105,110,32,108,97,98,101,108,32,111,102,32,110,111,100,101,32,37,115,10,0],"i8",c);eO=d([69,68,95,108,97,98,101,108,40,102,101,41,0],"i8",c);cIa=d([73,32,0],"i8",c);d([10,32,45,99,32,32,32,32,32,32,32,32,32,32,45,32,67,111,110,102,105,103,117,114,101,32,112,108,117,103,105,110,115,32,40,87,114,105,116,101,115,32,36,112,114,101,102,105,120,47,108,105,98,47,103,114,97,112,104,118,105,122,47,99,111,110,102,105,103,32,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,119,105,116,104,32,97,118,97,105,108,97,98,108,101,32,112,108,117,103,105,110,32,105,110,102,111,114,109,97,116,105,111,110,46,32,32,78,101,101,100,115,32,119,114,105,116,101,32,112,114,105,118,105,108,101,103,101,46,41,10,32,45,118,32,32,32,32,32,32,32,32,32,32,45,32,69,110,97,98,108,101,32,118,101,114,98,111,115,101,32,109,111,100,101,32,10,0],"i8",c);dIa=d([47,114,101,100,115,57,47,50,0],"i8",c);eIa=d([47,114,101,100,115,57,47,49,0],"i8",c);fIa=d([47,114,101,100,115,56,47,56,0],"i8",c);gIa=d([100,101,103,0],"i8",c);hIa=d([99,114,111,119,0],"i8",c);iIa=d([47,114,101,100,115,56,47,55,0],"i8",c);jIa=d([47,98,114,98,103,56,47,55,0],"i8",c);kIa=d([47,114,101,100,115,56,47,54,0],"i8",c);lIa=d([47,114,101,100,115,56,47,53,0],"i8",c);FT=d([60,83,84,89,76,69,62,10,0],"i8",c);mIa=d([47,114,101,100,115,56,47,52,0],"i8",c);nIa=d([47,114,101,100,115,56,47,51,0],"i8",c);oIa=d([47,114,101,100,115,56,47,50,0],"i8",c);oB=d([115,105,101,110,110,97,0],"i8",c);iP=d([109,101,114,103,101,50,58,32,103,114,97,112,104,32,37,115,44,32,114,97,110,107,32,37,100,32,104,97,115,32,111,110,108,121,32,37,100,32,60,32,37,100,32,110,111,100,101,115,10,0],"i8",c);pIa=d([49,52,32,100,101,102,97,117,108,116,45,102,111,110,116,45,102,97,109,105,108,121,32,115,101,116,95,102,111,110,116,0],"i8",c);qIa=d([47,114,101,100,115,56,47,49,0],"i8",c);dq=d([99,108,97,115,115,50,46,99,0],"i8",c);rIa=d([47,114,101,100,115,55,47,55,0],"i8",c);sIa=d([47,114,101,100,115,55,47,54,0],"i8",c);tIa=d([47,114,101,100,115,55,47,53,0],"i8",c);uIa=d([100,97,114,114,0],"i8",c);vIa=d([47,114,101,100,115,55,47,52,0],"i8",c);wIa=d([47,98,114,98,103,56,47,54,0],"i8",c);xIa=d([47,114,101,100,115,55,47,51,0],"i8",c);Dq=d([103,118,114,101,110,100,101,114,95,99,111,114,101,95,109,97,112,46,99,0],"i8",c);SM=d([71,115,116,97,99,107,32,111,118,101,114,102,108,111,119,32,105,110,32,103,114,97,112,104,32,112,97,114,115,101,114,10,0],"i8",c);yIa=d([47,114,101,100,115,55,47,50,0],"i8",c);ET=d([32,119,105,100,116,104,58,32,37,100,112,116,59,32,104,101,105,103,104,116,58,32,37,100,112,116,34,62,10,0],"i8",c);zIa=d([47,114,101,100,115,55,47,49,0],"i8",c);AIa=d([47,114,101,100,115,54,47,54,0],"i8",c);BIa=d([47,114,101,100,115,54,47,53,0],"i8",c);pB=d([115,101,97,115,104,101,108,108,0],"i8",c);CIa=d([37,37,66,101,103,105,110,83,101,116,117,112,0],"i8",c);DIa=d([47,114,101,100,115,54,47,52,0],"i8",c);JI=d([85,110,115,117,112,112,111,114,116,101,100,32,99,104,97,114,115,101,116,32,34,37,115,34,32,45,32,97,115,115,117,109,105,110,103,32,117,116,102,45,56,10,0],"i8",c);EIa=d([47,114,101,100,115,54,47,51,0],"i8",c);FIa=d([47,114,101,100,115,54,47,50,0],"i8",c);GIa=d([47,114,101,100,115,54,47,49,0],"i8",c);HIa=d([100,97,103,103,101,114,0],"i8",c);IIa=d([47,114,101,100,115,53,47,53,0],"i8",c);JIa=d([47,98,114,98,103,56,47,53,0],"i8",c);KIa=d([47,114,101,100,115,53,47,52,0],"i8",c);LIa=d([47,114,101,100,115,53,47,51,0],"i8",c);DT=d([60,68,73,86,32,105,100,61,39,95,86,77,76,49,95,39,32,115,116,121,108,101,61,34,112,111,115,105,116,105,111,110,58,114,101,108,97,116,105,118,101,59,32,100,105,115,112,108,97,121,58,105,110,108,105,110,101,59,32,118,105,115,105,98,105,108,105,116,121,58,104,105,100,100,101,110,0],"i8",c);MIa=d([47,114,101,100,115,53,47,50,0],"i8",c);NIa=d([47,114,101,100,115,53,47,49,0],"i8",c);OIa=d([47,114,101,100,115,52,47,52,0],"i8",c);qB=d([115,101,97,103,114,101,101,110,0],"i8",c);PIa=d([47,114,101,100,115,52,47,51,0],"i8",c);QIa=d([47,97,99,99,101,110,116,53,47,52,0],"i8",c);II=d([117,116,102,56,0],"i8",c);QI=d([114,97,110,107,115,101,112,0],"i8",c);RIa=d([47,114,101,100,115,52,47,50,0],"i8",c);d([106,32,61,61,32,48,0],"i8",c);SIa=d([37,37,69,110,100,80,114,111,108,111,103,0],"i8",c);TIa=d([47,114,101,100,115,52,47,49,0],"i8",c);UIa=d([47,114,101,100,115,51,47,51,0],"i8",c);VIa=d([100,65,114,114,0],"i8",c);WIa=d([47,114,101,100,115,51,47,50,0],"i8",c);XIa=d([47,98,114,98,103,56,47,52,0],"i8",c);YIa=d([47,114,101,100,115,51,47,49,0],"i8",c);ZIa=d([47,114,100,121,108,103,110,57,47,57,0],"i8",c);CT=d([60,66,79,68,89,32,111,110,108,111,97,100,61,39,98,114,111,119,115,101,114,99,104,101,99,107,40,41,59,39,62,10,0],"i8",c);$Ia=d([47,114,100,121,108,103,110,57,47,56,0],"i8",c);aJa=d([47,114,100,121,108,103,110,57,47,55,0],"i8",c);bJa=d([47,114,100,121,108,103,110,57,47,54,0],"i8",c);rB=d([115,97,110,100,121,98,114,111,119,110,0],"i8",c);cJa=d([37,37,69,110,100,82,101,115,111,117,114,99,101,0],"i8",c);Gs=d([101,108,108,105,112,115,101,0],"i8",c);dJa=d([47,114,100,121,108,103,110,57,47,53,0],"i8",c);eJa=d([106,112,101,103,58,118,114,109,108,0],"i8",c);HI=d([98,105,103,53,0],"i8",c);fJa=d([47,114,100,121,108,103,110,57,47,52,0],"i8",c);Kt=d([99,111,110,115,116,114,97,105,110,101,100,0],"i8",c);gJa=d([47,114,100,121,108,103,110,57,47,51,0],"i8",c);hJa=d([47,114,100,121,108,103,110,57,47,50,0],"i8",c);iJa=d([99,117,114,114,101,110,0],"i8",c);jJa=d([47,114,100,121,108,103,110,57,47,49,0],"i8",c);kJa=d([47,98,114,98,103,56,47,51,0],"i8",c);lJa=d([47,114,100,121,108,103,110,56,47,56,0],"i8",c);mJa=d([47,114,100,121,108,103,110,56,47,55,0],"i8",c);BT=d([60,47,72,69,65,68,62,0],"i8",c);nJa=d([47,114,100,121,108,103,110,56,47,54,0],"i8",c);oJa=d([47,114,100,121,108,103,110,56,47,53,0],"i8",c);pJa=d([47,114,100,121,108,103,110,56,47,52,0],"i8",c);sB=d([115,97,108,109,111,110,0],"i8",c);qJa=d([47,99,117,114,108,97,121,101,114,32,48,32,100,101,102,0],"i8",c);rJa=d([47,114,100,121,108,103,110,56,47,51,0],"i8",c);GI=d([98,105,103,45,53,0],"i8",c);d([83,69,82,86,69,82,95,78,65,77,69,0],"i8",c);sJa=d([47,114,100,121,108,103,110,56,47,50,0],"i8",c);tJa=d([47,114,100,121,108,103,110,56,47,49,0],"i8",c);uJa=d([47,114,100,121,108,103,110,55,47,55,0],"i8",c);vJa=d([99,117,112,0],"i8",c);wJa=d([115,104,97,112,101,102,105,108,101,32,110,111,116,32,115,101,116,32,111,114,32,110,111,116,32,102,111,117,110,100,32,102,111,114,32,101,112,115,102,32,110,111,100,101,32,37,115,10,0],"i8",c);Cm=d([32,37,100,32,37,100,0],"i8",c);xJa=d([75,80,95,83,117,98,116,114,97,99,116,0],"i8",c);yJa=d([47,114,100,121,108,103,110,55,47,54,0],"i8",c);Zj=d([98,108,117,101,0],"i8",c);zJa=d([47,98,114,98,103,56,47,50,0],"i8",c);AJa=d([47,114,100,121,108,103,110,55,47,53,0],"i8",c);BJa=d([47,114,100,121,108,103,110,55,47,52,0],"i8",c);AT=d([32,32,32,60,47,83,67,82,73,80,84,62,10,0],"i8",c);CJa=d([47,114,100,121,108,103,110,55,47,51,0],"i8",c);DJa=d([47,114,100,121,108,103,110,55,47,50,0],"i8",c);Yf=d([103,114,97,112,104,0],"i8",c);EJa=d([47,114,100,121,108,103,110,55,47,49,0],"i8",c);tB=d([115,97,100,100,108,101,98,114,111,119,110,0],"i8",c);qM=d([32,60,60,60,32,0],"i8",c);FJa=d([9,123,105,110,118,105,115,125,32,105,102,0],"i8",c);GJa=d([47,114,100,121,108,103,110,54,47,54,0],"i8",c);HJa=d([99,111,109,112,111,117,110,100,0],"i8",c);Wh=d([59,10,0],"i8",c);FI=d([73,83,79,45,73,82,45,49,48,48,0],"i8",c);IJa=d([47,114,100,121,108,103,110,54,47,53,0],"i8",c);JJa=d([47,114,100,121,108,103,110,54,47,52,0],"i8",c);KJa=d([47,114,100,121,108,103,110,54,47,51,0],"i8",c);LJa=d([99,114,97,114,114,0],"i8",c);MJa=d([47,114,100,121,108,103,110,54,47,50,0],"i8",c);NJa=d([47,98,114,98,103,56,47,49,0],"i8",c);OJa=d([47,114,100,121,108,103,110,54,47,49,0],"i8",c);PJa=d([47,114,100,121,108,103,110,53,47,53,0],"i8",c);QJa=d([47,114,100,121,108,103,110,53,47,52,0],"i8",c);zT=d([32,32,32,125,10,0],"i8",c);RJa=d([65,118,97,110,116,71,97,114,100,101,45,66,111,111,107,79,98,108,105,113,117,101,0],"i8",c);SJa=d([47,114,100,121,108,103,110,53,47,51,0],"i8",c);TJa=d([47,114,100,121,108,103,110,53,47,50,0],"i8",c);uB=d([114,111,121,97,108,98,108,117,101,0],"i8",c);UJa=d([9,111,114,0],"i8",c);VJa=d([47,114,100,121,108,103,110,53,47,49,0],"i8",c);EI=d([73,83,79,56,56,53,57,45,49,0],"i8",c);WJa=d([47,114,100,121,108,103,110,52,47,52,0],"i8",c);XJa=d([47,114,100,121,108,103,110,52,47,51,0],"i8",c);Hl=d([37,100,32,37,100,32,0],"i8",c);YJa=d([47,114,100,121,108,103,110,52,47,50,0],"i8",c);ZJa=d([99,111,112,121,0],"i8",c);$Ja=d([47,114,100,121,108,103,110,52,47,49,0],"i8",c);aKa=d([47,98,114,98,103,55,47,55,0],"i8",c);bKa=d([47,114,100,121,108,103,110,51,47,51,0],"i8",c);ZL=d([123,10,0],"i8",c);wL=d([99,97,110,110,111,116,32,114,101,97,108,108,111,99,32,112,110,108,112,115,0],"i8",c);cKa=d([47,114,100,121,108,103,110,51,47,50,0],"i8",c);dKa=d([47,114,100,121,108,103,110,51,47,49,0],"i8",c);yT=d([32,32,32,32,32,125,10,0],"i8",c);d([80,101,114,104,97,112,115,32,34,100,111,116,32,45,99,34,32,110,101,101,100,115,32,116,111,32,98,101,32,114,117,110,32,40,119,105,116,104,32,105,110,115,116,97,108,108,101,114,39,115,32,112,114,105,118,105,108,101,103,101,115,41,32,116,111,32,114,101,103,105,115,116,101,114,32,116,104,101,32,112,108,117,103,105,110,115,63,10,0],"i8",c);PR=d([37,37,69,110,100,68,111,99,117,109,101,110,116,10,0],"i8",c);eKa=d([47,114,100,121,108,103,110,49,49,47,57,0],"i8",c);fKa=d([47,114,100,121,108,103,110,49,49,47,56,0],"i8",c);vB=d([114,111,115,121,98,114,111,119,110,0],"i8",c);gKa=d([9,99,117,114,108,97,121,101,114,32,109,121,117,112,112,101,114,32,103,116,0],"i8",c);hKa=d([47,114,100,121,108,103,110,49,49,47,55,0],"i8",c);wB=d([98,108,117,101,118,105,111,108,101,116,0],"i8",c);DI=d([73,83,79,95,56,56,53,57,45,49,0],"i8",c);iKa=d([47,114,100,121,108,103,110,49,49,47,54,0],"i8",c);jKa=d([47,114,100,121,108,103,110,49,49,47,53,0],"i8",c);kKa=d([47,114,100,121,108,103,110,49,49,47,52,0],"i8",c);lKa=d([99,111,110,103,0],"i8",c);mKa=d([47,114,100,121,108,103,110,49,49,47,51,0],"i8",c);nKa=d([47,98,114,98,103,55,47,54,0],"i8",c);RN=d([40,37,46,53,103,44,37,46,53,103,41,0],"i8",c);oKa=d([47,114,100,121,108,103,110,49,49,47,50,0],"i8",c);pKa=d([47,114,100,121,108,103,110,49,49,47,49,49,0],"i8",c);qKa=d([47,114,100,121,108,103,110,49,49,47,49,48,0],"i8",c);xT=d([32,32,32,32,32,125,101,108,115,101,123,10,0],"i8",c);rKa=d([47,114,100,121,108,103,110,49,49,47,49,0],"i8",c);nq=d([114,97,110,107,0],"i8",c);sKa=d([47,114,100,121,108,103,110,49,48,47,57,0],"i8",c);$K=d([112,116,0],"i8",c);tKa=d([9,99,117,114,108,97,121,101,114,32,109,121,108,111,119,101,114,32,108,116,0],"i8",c);uKa=d([47,114,100,121,108,103,110,49,48,47,56,0],"i8",c);TN=d([99,111,110,99,46,99,0],"i8",c);BI=d([108,49,0],"i8",c);Av=d([103,118,117,115,101,114,115,104,97,112,101,46,99,0],"i8",c);d([105,32,60,32,98,122,46,115,105,122,101,0],"i8",c);vKa=d([32,32,32,32,32,32,32,32,100,117,112,32,100,117,112,32,102,105,110,100,102,111,110,116,32,100,117,112,32,108,101,110,103,116,104,32,100,105,99,116,32,98,101,103,105,110,0],"i8",c);wKa=d([99,108,117,98,115,0],"i8",c);xKa=d([47,114,100,121,108,103,110,49,48,47,55,0],"i8",c);rp=d([119,105,100,116,104,0],"i8",c);yKa=d([47,114,100,121,108,103,110,49,48,47,54,0],"i8",c);zKa=d([47,114,100,121,108,103,110,49,48,47,53,0],"i8",c);SC=d([67,111,117,108,100,32,110,111,116,32,112,97,114,115,101,32,34,95,100,114,97,119,95,34,32,97,116,116,114,105,98,117,116,101,32,105,110,32,103,114,97,112,104,32,37,115,10,0],"i8",c);AKa=d([47,114,100,121,108,103,110,49,48,47,52,0],"i8",c);BKa=d([47,98,114,98,103,55,47,53,0],"i8",c);CKa=d([47,114,100,121,108,103,110,49,48,47,51,0],"i8",c);DKa=d([47,114,100,121,108,103,110,49,48,47,50,0],"i8",c);EKa=d([47,114,100,121,108,103,110,49,48,47,49,48,0],"i8",c);Jy=d([32,32,32,32,32,32,32,32,32,32,32,105,116,101,109,46,115,116,121,108,101,46,118,105,115,105,98,105,108,105,116,121,61,39,104,105,100,100,101,110,39,59,10,0],"i8",c);FKa=d([47,114,100,121,108,103,110,49,48,47,49,0],"i8",c);GKa=d([47,114,100,121,108,98,117,57,47,57,0],"i8",c);HKa=d([9,47,109,121,108,111,119,101,114,32,101,120,99,104,32,100,101,102,0],"i8",c);IKa=d([47,114,100,121,108,98,117,57,47,56,0],"i8",c);AI=d([108,97,116,105,110,49,0],"i8",c);cK=d([67,111,117,108,100,32,110,111,116,32,111,112,101,110,32,34,37,115,34,32,102,111,114,32,119,114,105,116,105,110,103,32,58,32,37,115,10,0],"i8",c);JKa=d([47,114,100,121,108,98,117,57,47,55,0],"i8",c);KKa=d([47,114,100,121,108,98,117,57,47,54,0],"i8",c);LKa=d([47,114,100,121,108,98,117,57,47,53,0],"i8",c);MKa=d([99,105,114,99,0],"i8",c);NKa=d([47,114,100,121,108,98,117,57,47,52,0],"i8",c);OKa=d([47,98,114,98,103,55,47,52,0],"i8",c);PKa=d([47,114,100,121,108,98,117,57,47,51,0],"i8",c);QKa=d([47,114,100,121,108,98,117,57,47,50,0],"i8",c);RKa=d([47,114,100,121,108,98,117,57,47,49,0],"i8",c);Iy=d([32,32,32,32,32,32,32,32,32,105,116,101,109,32,61,32,100,111,99,117,109,101,110,116,46,103,101,116,69,108,101,109,101,110,116,66,121,73,100,40,86,77,76,110,111,91,120,93,41,59,10,0],"i8",c);SKa=d([47,114,100,121,108,98,117,56,47,56,0],"i8",c);TKa=d([47,114,100,121,108,98,117,56,47,55,0],"i8",c);xB=d([112,111,119,100,101,114,98,108,117,101,0],"i8",c);UKa=d([9,47,109,121,117,112,112,101,114,32,101,120,99,104,32,100,101,102,0],"i8",c);VKa=d([47,114,100,121,108,98,117,56,47,54,0],"i8",c);zI=d([108,97,116,105,110,45,49,0],"i8",c);jP=d([109,105,110,99,114,111,115,115,32,37,115,58,32,37,100,32,99,114,111,115,115,105,110,103,115,44,32,37,46,50,102,32,115,101,99,115,46,10,0],"i8",c);WKa=d([47,114,100,121,108,98,117,56,47,53,0],"i8",c);XKa=d([47,114,100,121,108,98,117,56,47,52,0],"i8",c);YKa=d([47,114,100,121,108,98,117,56,47,51,0],"i8",c);ZKa=d([99,104,105,0],"i8",c);$Ka=d([47,114,100,121,108,98,117,56,47,50,0],"i8",c);aLa=d([47,98,114,98,103,55,47,51,0],"i8",c);bLa=d([47,114,100,121,108,98,117,56,47,49,0],"i8",c);cLa=d([47,114,100,121,108,98,117,55,47,55,0],"i8",c);dLa=d([47,114,100,121,108,98,117,55,47,54,0],"i8",c);Hy=d([32,32,32,32,32,32,32,102,111,114,32,40,120,32,105,110,32,86,77,76,110,111,41,123,10,0],"i8",c);eLa=d([47,114,100,121,108,98,117,55,47,53,0],"i8",c);fLa=d([47,114,100,121,108,98,117,55,47,52,0],"i8",c);yB=d([112,108,117,109,0],"i8",c);gLa=d([47,111,110,108,97,121,101,114,115,32,123,0],"i8",c);hLa=d([47,114,100,121,108,98,117,55,47,51,0],"i8",c);d([98,32,61,61,32,110,0],"i8",c);Su=d([117,116,102,45,56,0],"i8",c);iLa=d([47,114,100,121,108,98,117,55,47,50,0],"i8",c);jLa=d([47,114,100,121,108,98,117,55,47,49,0],"i8",c);kLa=d([47,114,100,121,108,98,117,54,47,54,0],"i8",c);lLa=d([99,101,110,116,0],"i8",c);mLa=d([47,114,100,121,108,98,117,54,47,53,0],"i8",c);nLa=d([47,98,114,98,103,55,47,50,0],"i8",c);oLa=d([47,114,100,121,108,98,117,54,47,52,0],"i8",c);pLa=d([47,114,100,121,108,98,117,54,47,51,0],"i8",c);qLa=d([47,114,100,121,108,98,117,54,47,50,0],"i8",c);Lm=d([32,32,32,32,32,32,32,125,10,0],"i8",c);rLa=d([47,114,100,121,108,98,117,54,47,49,0],"i8",c);sLa=d([47,114,100,121,108,98,117,53,47,53,0],"i8",c);zB=d([112,105,110,107,0],"i8",c);tLa=d([47,111,110,108,97,121,101,114,32,123,32,99,117,114,108,97,121,101,114,32,110,101,32,123,105,110,118,105,115,125,32,105,102,32,125,32,100,101,102,0],"i8",c);uLa=d([47,114,100,121,108,98,117,53,47,52,0],"i8",c);vLa=d([47,97,99,99,101,110,116,53,47,51,0],"i8",c);yI=d([99,104,97,114,115,101,116,0],"i8",c);wLa=d([47,114,100,121,108,98,117,53,47,51,0],"i8",c);xLa=d([47,114,100,121,108,98,117,53,47,50,0],"i8",c);yLa=d([47,114,100,121,108,98,117,53,47,49,0],"i8",c);zLa=d([99,101,100,105,108,0],"i8",c);ALa=d([47,114,100,121,108,98,117,52,47,52,0],"i8",c);BLa=d([47,98,114,98,103,55,47,49,0],"i8",c);CLa=d([47,114,100,121,108,98,117,52,47,51,0],"i8",c);DLa=d([47,114,100,121,108,98,117,52,47,50,0],"i8",c);ELa=d([47,114,100,121,108,98,117,52,47,49,0],"i8",c);Km=d([32,32,32,32,32,32,32,32,32,125,10,0],"i8",c);FLa=d([47,114,100,121,108,98,117,51,47,51,0],"i8",c);GLa=d([47,114,100,121,108,98,117,51,47,50,0],"i8",c);AB=d([112,101,114,117,0],"i8",c);IK=d([78,111,32,108,111,97,100,105,109,97,103,101,32,112,108,117,103,105,110,32,102,111,114,32,34,37,115,34,10,0],"i8",c);HLa=d([9,47,103,114,97,112,104,99,111,108,111,114,32,123,110,111,112,99,111,108,111,114,125,32,100,101,102,0],"i8",c);ILa=d([112,111,108,121,103,111,110,0],"i8",c);JLa=d([47,114,100,121,108,98,117,51,47,49,0],"i8",c);KLa=d([103,105,102,58,118,114,109,108,0],"i8",c);HJ=d([102,105,108,108,0],"i8",c);LLa=d([47,114,100,121,108,98,117,49,49,47,57,0],"i8",c);gH=d([115,116,97,114,116,32,112,111,114,116,58,32,40,37,46,53,103,44,32,37,46,53,103,41,44,32,116,97,110,103,101,110,116,32,97,110,103,108,101,58,32,37,46,53,103,44,32,37,115,10,0],"i8",c);MLa=d([47,114,100,121,108,98,117,49,49,47,56,0],"i8",c);NLa=d([47,114,100,121,108,98,117,49,49,47,55,0],"i8",c);OLa=d([99,99,101,100,105,108,0],"i8",c);PLa=d([47,114,100,121,108,98,117,49,49,47,54,0],"i8",c);QLa=d([47,98,114,98,103,54,47,54,0],"i8",c);RLa=d([47,114,100,121,108,98,117,49,49,47,53,0],"i8",c);SLa=d([47,114,100,121,108,98,117,49,49,47,52,0],"i8",c);TLa=d([47,114,100,121,108,98,117,49,49,47,51,0],"i8",c);Gy=d([32,32,32,32,32,32,32,32,32,32,32,105,116,101,109,46,115,116,121,108,101,46,118,105,115,105,98,105,108,105,116,121,61,39,118,105,115,105,98,108,101,39,59,10,0],"i8",c);ULa=d([47,114,100,121,108,98,117,49,49,47,50,0],"i8",c);VLa=d([47,114,100,121,108,98,117,49,49,47,49,49,0],"i8",c);wx=d([115,97,109,101,116,97,105,108,0],"i8",c);BB=d([112,101,97,99,104,112,117,102,102,0],"i8",c);WLa=d([9,47,101,100,103,101,99,111,108,111,114,32,123,110,111,112,99,111,108,111,114,125,32,100,101,102,0],"i8",c);by=d([112,111,115,105,116,105,111,110,46,99,0],"i8",c);XLa=d([47,114,100,121,108,98,117,49,49,47,49,48,0],"i8",c);FJ=d([101,120,112,97,110,100,0],"i8",c);YLa=d([50,46,50,56,46,48,0],"i8",c);ZLa=d([47,114,100,121,108,98,117,49,49,47,49,0],"i8",c);$La=d([47,114,100,121,108,98,117,49,48,47,57,0],"i8",c);aMa=d([47,114,100,121,108,98,117,49,48,47,56,0],"i8",c);bMa=d([99,97,112,0],"i8",c);cMa=d([47,114,100,121,108,98,117,49,48,47,55,0],"i8",c);Ac=d([98,108,97,99,107,0],"i8",c);dMa=d([47,98,114,98,103,54,47,53,0],"i8",c);CB=d([37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,46,49,102,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,32,37,100,10,0],"i8",c);DB=d([109,105,110,117,115,0],"i8",c);eMa=d([47,114,100,121,108,98,117,49,48,47,54,0],"i8",c);fMa=d([47,114,100,121,108,98,117,49,48,47,53,0],"i8",c);gMa=d([47,114,100,121,108,98,117,49,48,47,52,0],"i8",c);Jm=d([32,32,32,32,32,32,32,32,32,105,102,32,40,105,116,101,109,41,32,123,10,0],"i8",c);hMa=d([47,114,100,121,108,98,117,49,48,47,51,0],"i8",c);Dg=d([101,100,103,101,0],"i8",c);iMa=d([47,114,100,121,108,98,117,49,48,47,50,0],"i8",c);EB=d([112,97,112,97,121,97,119,104,105,112,0],"i8",c);jMa=d([9,47,110,111,100,101,99,111,108,111,114,32,123,110,111,112,99,111,108,111,114,125,32,100,101,102,0],"i8",c);kMa=d([47,114,100,121,108,98,117,49,48,47,49,48,0],"i8",c);fq=d([108,116,97,105,108,0],"i8",c);NL=d([108,105,98,97,103,32,101,114,114,111,114,32,45,45,32,97,103,105,110,105,116,40,41,32,119,97,115,32,110,111,116,32,99,97,108,108,101,100,10,0],"i8",c);GJ=d([99,111,109,112,114,101,115,115,0],"i8",c);pM=d([32,62,62,62,32,0],"i8",c);lMa=d([47,114,100,121,108,98,117,49,48,47,49,0],"i8",c);mMa=d([47,114,100,112,117,57,47,57,0],"i8",c);vi=d([116,97,105,108,112,111,114,116,0],"i8",c);nMa=d([47,114,100,112,117,57,47,56,0],"i8",c);oMa=d([98,117,108,108,0],"i8",c);pMa=d([47,114,100,112,117,57,47,55,0],"i8",c);qMa=d([47,98,114,98,103,54,47,52,0],"i8",c);rMa=d([47,114,100,112,117,57,47,54,0],"i8",c);sMa=d([47,114,100,112,117,57,47,53,0],"i8",c);tMa=d([47,114,100,112,117,57,47,52,0],"i8",c);Fy=d([32,32,32,32,32,32,32,32,32,105,116,101,109,32,61,32,100,111,99,117,109,101,110,116,46,103,101,116,69,108,101,109,101,110,116,66,121,73,100,40,86,77,76,121,101,115,91,120,93,41,59,10,0],"i8",c);me=d([115,97,110,115,45,83,101,114,105,102,0],"i8",c);uMa=d([47,114,100,112,117,57,47,51,0],"i8",c);vMa=d([47,114,100,112,117,57,47,50,0],"i8",c);FB=d([112,97,108,101,118,105,111,108,101,116,114,101,100,0],"i8",c);wMa=d([9,97,108,111,97,100,32,112,111,112,32,115,101,116,104,115,98,99,111,108,111,114,0],"i8",c);xMa=d([47,114,100,112,117,57,47,49,0],"i8",c);IJ=d([97,117,116,111,0],"i8",c);Rx=d([99,108,117,115,116,101,114,0],"i8",c);yMa=d([98,114,118,98,97,114,0],"i8",c);zMa=d([47,114,100,112,117,56,47,56,0],"i8",c);AMa=d([47,114,100,112,117,56,47,55,0],"i8",c);MQ=d([32,37,100,32,0],"i8",c);BMa=d([47,114,100,112,117,56,47,54,0],"i8",c);qo=d([117,116,105,108,115,46,99,0],"i8",c);CMa=d([47,114,100,112,117,56,47,53,0],"i8",c);DMa=d([47,98,114,98,103,54,47,51,0],"i8",c);EMa=d([47,114,100,112,117,56,47,52,0],"i8",c);nw=d([115,117,98,103,114,97,112,104,32,0],"i8",c);vL=d([99,97,110,110,111,116,32,114,101,97,108,108,111,99,32,112,110,108,115,0],"i8",c);FMa=d([47,114,100,112,117,56,47,51,0],"i8",c);GMa=d([47,114,100,112,117,56,47,50,0],"i8",c);Ey=d([32,32,32,32,32,32,32,102,111,114,32,40,120,32,105,110,32,86,77,76,121,101,115,41,123,10,0],"i8",c);eK=d([110,111,110,97,109,101,46,103,118,0],"i8",c);OR=d([37,37,66,101,103,105,110,68,111,99,117,109,101,110,116,58,10,0],"i8",c);HMa=d([47,114,100,112,117,56,47,49,0],"i8",c);IMa=d([47,114,100,112,117,55,47,55,0],"i8",c);GB=d([112,97,108,101,116,117,114,113,117,111,105,115,101,0],"i8",c);JMa=d([37,37,66,101,103,105,110,80,114,111,108,111,103,0],"i8",c);KMa=d([47,114,100,112,117,55,47,54,0],"i8",c);EJ=d([114,97,116,105,111,0],"i8",c);LMa=d([98,101,116,97,0],"i8",c);MMa=d([47,114,100,112,117,55,47,53,0],"i8",c);NMa=d([9,108,97,121,101,114,99,111,108,111,114,115,101,113,32,99,117,114,108,97,121,101,114,32,49,32,115,117,98,32,108,97,121,101,114,108,101,110,32,109,111,100,32,103,101,116,0],"i8",c);OMa=d([47,114,100,112,117,55,47,52,0],"i8",c);PMa=d([47,114,100,112,117,55,47,51,0],"i8",c);QMa=d([47,114,100,112,117,55,47,50,0],"i8",c);RMa=d([47,98,114,98,103,54,47,50,0],"i8",c);SMa=d([47,114,100,112,117,55,47,49,0],"i8",c);TMa=d([47,114,100,112,117,54,47,54,0],"i8",c);LP=d([114,97,110,107,40,103,44,32,50,44,32,110,115,105,116,101,114,50,40,103,41,41,32,61,61,32,48,0],"i8",c);UMa=d([47,114,100,112,117,54,47,53,0],"i8",c);wT=d([32,32,32,32,32,32,105,102,32,40,105,101,118,101,114,115,62,61,53,41,123,10,0],"i8",c);VMa=d([47,114,100,112,117,54,47,52,0],"i8",c);WMa=d([115,105,110,107,0],"i8",c);XMa=d([47,114,100,112,117,54,47,51,0],"i8",c);d([78,68,95,85,70,95,115,105,122,101,40,117,41,32,61,61,32,49,0],"i8",c);YMa=d([47,68,111,116,68,105,99,116,32,50,48,48,32,100,105,99,116,32,100,101,102,0],"i8",c);HB=d([112,97,108,101,103,114,101,101,110,0],"i8",c);ZK=d([112,99,0],"i8",c);ZMa=d([47,115,101,116,108,97,121,101,114,32,123,47,109,97,120,108,97,121,101,114,32,101,120,99,104,32,100,101,102,32,47,99,117,114,108,97,121,101,114,32,101,120,99,104,32,100,101,102,0],"i8",c);$Ma=d([47,114,100,112,117,54,47,50,0],"i8",c);KJ=d([37,108,102,37,99,0],"i8",c);gF=d([121,101,115,0],"i8",c);aNa=d([47,115,116,97,114,110,101,116,73,83,79,32,123,0],"i8",c);bNa=d([98,100,113,117,111,0],"i8",c);cNa=d([47,114,100,112,117,54,47,49,0],"i8",c);dNa=d([47,114,100,112,117,53,47,53,0],"i8",c);GK=d([103,118,114,101,110,100,101,114,95,115,101,116,95,115,116,121,108,101,58,32,117,110,115,117,112,112,111,114,116,101,100,32,115,116,121,108,101,32,37,115,32,45,32,105,103,110,111,114,105,110,103,10,0],"i8",c);eNa=d([47,114,100,112,117,53,47,52,0],"i8",c);fD=d([108,97,121,101,114,115,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,105,110,32,37,115,32,111,117,116,112,117,116,10,0],"i8",c);fNa=d([47,114,100,112,117,53,47,51,0],"i8",c);gNa=d([47,98,114,98,103,54,47,49,0],"i8",c);hNa=d([47,114,100,112,117,53,47,50,0],"i8",c);iNa=d([47,114,100,112,117,53,47,49,0],"i8",c);jNa=d([47,114,100,112,117,52,47,52,0],"i8",c);vT=d([32,32,32,32,32,32,125,10,0],"i8",c);kNa=d([47,114,100,112,117,52,47,51,0],"i8",c);lNa=d([47,114,100,112,117,52,47,50,0],"i8",c);IB=d([112,97,108,101,103,111,108,100,101,110,114,111,100,0],"i8",c);mNa=d([47,108,97,121,101,114,108,101,110,32,108,97,121,101,114,99,111,108,111,114,115,101,113,32,108,101,110,103,116,104,32,100,101,102,0],"i8",c);nNa=d([47,114,100,112,117,52,47,49,0],"i8",c);JJ=d([37,108,102,44,37,108,102,37,99,0],"i8",c);oNa=d([97,117,109,108,0],"i8",c);pNa=d([47,114,100,112,117,51,47,51,0],"i8",c);qNa=d([47,114,100,112,117,51,47,50,0],"i8",c);rNa=d([47,114,100,112,117,51,47,49,0],"i8",c);XE=d([73,109,97,103,101,115,32,117,110,115,117,112,112,111,114,116,101,100,32,105,110,32,34,98,97,99,107,103,114,111,117,110,100,34,32,97,116,116,114,105,98,117,116,101,10,0],"i8",c);sNa=d([47,114,100,103,121,57,47,57,0],"i8",c);tNa=d([47,98,114,98,103,53,47,53,0],"i8",c);uNa=d([47,114,100,103,121,57,47,56,0],"i8",c);vNa=d([47,114,100,103,121,57,47,55,0],"i8",c);wNa=d([47,114,100,103,121,57,47,54,0],"i8",c);uT=d([32,32,32,32,32,32,32,32,32,105,101,118,101,114,115,61,32,112,97,114,115,101,73,110,116,32,40,117,97,46,115,117,98,115,116,114,105,110,103,32,40,109,115,105,101,43,53,44,32,117,97,46,105,110,100,101,120,79,102,32,40,39,46,39,44,32,109,115,105,101,32,41,41,41,10,0],"i8",c);xNa=d([47,114,100,103,121,57,47,53,0],"i8",c);yNa=d([47,114,100,103,121,57,47,52,0],"i8",c);JB=d([111,114,99,104,105,100,0],"i8",c);zNa=d([100,101,102,0],"i8",c);ANa=d([47,114,100,103,121,57,47,51,0],"i8",c);MJ=d([108,97,98,101,108,106,117,115,116,0],"i8",c);BNa=d([97,116,105,108,100,101,0],"i8",c);CNa=d([47,114,100,103,121,57,47,50,0],"i8",c);$O=d([109,99,108,105,109,105,116,0],"i8",c);DNa=d([47,114,100,103,121,57,47,49,0],"i8",c);ENa=d([47,114,100,103,121,56,47,56,0],"i8",c);FNa=d([47,114,100,103,121,56,47,55,0],"i8",c);GNa=d([47,98,114,98,103,53,47,52,0],"i8",c);HNa=d([47,114,100,103,121,56,47,54,0],"i8",c);INa=d([47,114,100,103,121,56,47,53,0],"i8",c);JNa=d([47,114,100,103,121,56,47,52,0],"i8",c);tT=d([32,32,32,32,32,32,105,102,32,40,32,109,115,105,101,32,62,32,48,32,41,123,32,32,32,32,32,32,47,47,32,73,102,32,73,110,116,101,114,110,101,116,32,69,120,112,108,111,114,101,114,44,32,114,101,116,117,114,110,32,118,101,114,115,105,111,110,32,110,117,109,98,101,114,10,0],"i8",c);rR=d([32,37,100,44,37,100,0],"i8",c);KNa=d([47,114,100,103,121,56,47,51,0],"i8",c);LNa=d([47,114,100,103,121,56,47,50,0],"i8",c);KB=d([111,114,97,110,103,101,114,101,100,0],"i8",c);MNa=d([9,93,0],"i8",c);NNa=d([47,114,100,103,121,56,47,49,0],"i8",c);Vt=d([108,97,98,101,108,108,111,99,0],"i8",c);ONa=d([97,115,121,109,112,0],"i8",c);PNa=d([47,114,100,103,121,55,47,55,0],"i8",c);QNa=d([47,114,100,103,121,55,47,54,0],"i8",c);RNa=d([47,114,100,103,121,55,47,53,0],"i8",c);SNa=d([47,114,100,103,121,55,47,52,0],"i8",c);TNa=d([47,98,114,98,103,53,47,51,0],"i8",c);UNa=d([47,114,100,103,121,55,47,51,0],"i8",c);VNa=d([47,114,100,103,121,55,47,50,0],"i8",c);WNa=d([47,114,100,103,121,55,47,49,0],"i8",c);sT=d([32,32,32,32,32,32,118,97,114,32,86,77,76,110,111,61,110,101,119,32,65,114,114,97,121,40,39,95,110,111,116,86,77,76,49,95,39,44,39,95,110,111,116,86,77,76,50,95,39,41,59,10,0],"i8",c);XNa=d([47,114,100,103,121,54,47,54,0],"i8",c);YNa=d([47,114,100,103,121,54,47,53,0],"i8",c);LB=d([111,114,97,110,103,101,0],"i8",c);ZNa=d([9,9,91,46,56,32,46,56,32,46,56,93,0],"i8",c);$Na=d([47,114,100,103,121,54,47,52,0],"i8",c);aOa=d([47,97,99,99,101,110,116,53,47,50,0],"i8",c);bOa=d([97,114,105,110,103,0],"i8",c);cOa=d([47,114,100,103,121,54,47,51,0],"i8",c);dOa=d([47,114,100,103,121,54,47,50,0],"i8",c);LI=d([114,97,110,107,100,105,114,0],"i8",c);eOa=d([47,114,100,103,121,54,47,49,0],"i8",c);fOa=d([47,114,100,103,121,53,47,53,0],"i8",c);gOa=d([47,98,114,98,103,53,47,50,0],"i8",c);hOa=d([47,114,100,103,121,53,47,52,0],"i8",c);iOa=d([47,114,100,103,121,53,47,51,0],"i8",c);jOa=d([47,114,100,103,121,53,47,50,0],"i8",c);rT=d([32,32,32,32,32,32,118,97,114,32,86,77,76,121,101,115,61,110,101,119,32,65,114,114,97,121,40,39,95,86,77,76,49,95,39,44,39,95,86,77,76,50,95,39,41,59,10,0],"i8",c);kOa=d([47,114,100,103,121,53,47,49,0],"i8",c);lOa=d([47,114,100,103,121,52,47,52,0],"i8",c);MB=d([111,108,105,118,101,100,114,97,98,0],"i8",c);mOa=d([9,9,91,46,54,32,46,56,32,46,56,93,0],"i8",c);NB=d([98,111,120,0],"i8",c);nOa=d([47,114,100,103,121,52,47,51,0],"i8",c);oOa=d([112,110,103,58,118,114,109,108,0],"i8",c);Li=d([84,105,109,101,115,45,82,111,109,97,110,0],"i8",c);pOa=d([97,110,103,0],"i8",c);qOa=d([47,114,100,103,121,52,47,50,0],"i8",c);fH=d([37,100,32,40,37,46,53,103,44,32,37,46,53,103,41,44,32,40,37,46,53,103,44,32,37,46,53,103,41,10,0],"i8",c);rOa=d([47,114,100,103,121,52,47,49,0],"i8",c);sOa=d([47,114,100,103,121,51,47,51,0],"i8",c);tOa=d([47,114,100,103,121,51,47,50,0],"i8",c);uOa=d([47,98,114,98,103,53,47,49,0],"i8",c);vOa=d([47,114,100,103,121,51,47,49,0],"i8",c);wOa=d([47,114,100,103,121,49,49,47,57,0],"i8",c);xOa=d([47,114,100,103,121,49,49,47,56,0],"i8",c);qT=d([32,32,32,32,32,32,118,97,114,32,105,116,101,109,59,10,0],"i8",c);yOa=d([47,114,100,103,121,49,49,47,55,0],"i8",c);zOa=d([47,114,100,103,121,49,49,47,54,0],"i8",c);AOa=d([9,9,91,46,52,32,46,56,32,46,56,93,0],"i8",c);BOa=d([47,114,100,103,121,49,49,47,53,0],"i8",c);d([85,110,115,117,112,112,111,114,116,101,100,32,99,104,97,114,115,101,116,32,118,97,108,117,101,32,37,100,10,0],"i8",c);COa=d([97,110,100,0],"i8",c);DOa=d([47,114,100,103,121,49,49,47,52,0],"i8",c);EOa=d([47,114,100,103,121,49,49,47,51,0],"i8",c);FOa=d([47,114,100,103,121,49,49,47,50,0],"i8",c);GOa=d([47,114,100,103,121,49,49,47,49,49,0],"i8",c);OB=d([97,113,117,97,0],"i8",c);HOa=d([47,98,114,98,103,52,47,52,0],"i8",c);IOa=d([47,114,100,103,121,49,49,47,49,48,0],"i8",c);JOa=d([35,32,37,115,10,0],"i8",c);KOa=d([75,80,95,65,100,100,0],"i8",c);LOa=d([47,114,100,103,121,49,49,47,49,0],"i8",c);MOa=d([47,114,100,103,121,49,48,47,57,0],"i8",c);pT=d([32,32,32,32,32,32,118,97,114,32,105,101,118,101,114,115,59,10,0],"i8",c);NOa=d([47,114,100,103,121,49,48,47,56,0],"i8",c);OOa=d([47,114,100,103,121,49,48,47,55,0],"i8",c);PB=d([111,108,100,108,97,99,101,0],"i8",c);POa=d([9,9,91,46,50,32,46,56,32,46,56,93,0],"i8",c);QOa=d([47,114,100,103,121,49,48,47,54,0],"i8",c);d([66,73,71,45,53,0],"i8",c);ROa=d([97,109,112,0],"i8",c);SOa=d([47,114,100,103,121,49,48,47,53,0],"i8",c);oM=d([99,111,110,116,101,120,116,58,32,0],"i8",c);TOa=d([47,114,100,103,121,49,48,47,52,0],"i8",c);UOa=d([47,114,100,103,121,49,48,47,51,0],"i8",c);wi=d([104,101,97,100,112,111,114,116,0],"i8",c);VOa=d([47,114,100,103,121,49,48,47,50,0],"i8",c);WOa=d([47,98,114,98,103,52,47,51,0],"i8",c);XOa=d([47,114,100,103,121,49,48,47,49,48,0],"i8",c);YOa=d([47,114,100,103,121,49,48,47,49,0],"i8",c);ZOa=d([47,114,100,98,117,57,47,57,0],"i8",c);oT=d([32,32,32,32,32,32,118,97,114,32,109,115,105,101,32,61,32,117,97,46,105,110,100,101,120,79,102,32,40,32,39,77,83,73,69,32,39,32,41,10,0],"i8",c);QB=d([98,111,111,107,0],"i8",c);$Oa=d([47,114,100,98,117,57,47,56,0],"i8",c);aPa=d([47,114,100,98,117,57,47,55,0],"i8",c);bPa=d([9,9,91,48,32,48,32,48,93,0],"i8",c);cPa=d([47,114,100,98,117,57,47,54,0],"i8",c);CI=d([73,83,79,45,56,56,53,57,45,49,0],"i8",c);dPa=d([97,108,112,104,97,0],"i8",c);ePa=d([47,114,100,98,117,57,47,53,0],"i8",c);fPa=d([47,114,100,98,117,57,47,52,0],"i8",c);gPa=d([120,100,111,116,58,120,100,111,116,0],"i8",c);hPa=d([47,114,100,98,117,57,47,51,0],"i8",c);Fi=d([101,109,105,116,46,99,0],"i8",c);LN=d([115,101,103,109,101,110,116,32,91,37,115,44,37,115,93,32,100,111,101,115,32,110,111,116,32,105,110,116,101,114,115,101,99,116,32,98,111,120,32,108,108,61,37,115,44,117,114,61,37,115,10,0],"i8",c);iPa=d([47,114,100,98,117,57,47,50,0],"i8",c);jPa=d([47,98,114,98,103,52,47,50,0],"i8",c);kPa=d([47,114,100,98,117,57,47,49,0],"i8",c);uL=d([99,97,110,110,111,116,32,109,97,108,108,111,99,32,112,110,108,112,115,0],"i8",c);lPa=d([47,114,100,98,117,56,47,56,0],"i8",c);fv=d([114,101,99,116,115,0],"i8",c);mPa=d([47,114,100,98,117,56,47,55,0],"i8",c);nT=d([32,32,32,32,32,32,118,97,114,32,117,97,32,61,32,119,105,110,100,111,119,46,110,97,118,105,103,97,116,111,114,46,117,115,101,114,65,103,101,110,116,10,0],"i8",c);d([84,104,101,114,101,32,105,115,32,110,111,32,108,97,121,111,117,116,32,101,110,103,105,110,101,32,115,117,112,112,111,114,116,32,102,111,114,32,34,37,115,34,10,0],"i8",c);dK=d([46,37,100,0],"i8",c);NR=d([47,117,115,101,114,95,115,104,97,112,101,95,37,100,32,123,10,0],"i8",c);nPa=d([47,114,100,98,117,56,47,54,0],"i8",c);oPa=d([47,114,100,98,117,56,47,53,0],"i8",c);pPa=d([9,91,9,37,32,108,97,121,101,114,32,99,111,108,111,114,32,115,101,113,117,101,110,99,101,32,45,32,100,97,114,107,101,115,116,32,116,111,32,108,105,103,104,116,101,115,116,0],"i8",c);RB=d([110,97,118,97,106,111,119,104,105,116,101,0],"i8",c);qPa=d([47,114,100,98,117,56,47,52,0],"i8",c);d([85,84,70,45,56,0],"i8",c);SB=d([98,108,97,110,99,104,101,100,97,108,109,111,110,100,0],"i8",c);rPa=d([97,108,101,102,115,121,109,0],"i8",c);sPa=d([47,114,100,98,117,56,47,51,0],"i8",c);tPa=d([47,114,100,98,117,56,47,50,0],"i8",c);uPa=d([47,114,100,98,117,56,47,49,0],"i8",c);VE=d([97,108,108,0],"i8",c);vPa=d([47,114,100,98,117,55,47,55,0],"i8",c);wPa=d([47,98,114,98,103,52,47,49,0],"i8",c);xPa=d([47,114,100,98,117,55,47,54,0],"i8",c);yPa=d([47,114,100,98,117,55,47,53,0],"i8",c);zPa=d([47,114,100,98,117,55,47,52,0],"i8",c);mT=d([32,32,32,123,10,0],"i8",c);APa=d([47,114,100,98,117,55,47,51,0],"i8",c);BPa=d([109,97,120,0],"i8",c);CPa=d([47,114,100,98,117,55,47,50,0],"i8",c);DPa=d([47,108,97,121,101,114,99,111,108,111,114,115,101,113,0],"i8",c);TB=d([109,111,99,99,97,115,105,110,0],"i8",c);YK=d([112,120,0],"i8",c);EPa=d([47,114,100,98,117,55,47,49,0],"i8",c);Pr=d([105,100,0],"i8",c);FPa=d([37,32,83,101,116,32,117,112,32,73,83,79,32,76,97,116,105,110,32,49,32,99,104,97,114,97,99,116,101,114,32,101,110,99,111,100,105,110,103,0],"i8",c);GPa=d([97,103,114,97,118,101,0],"i8",c);HPa=d([47,114,100,98,117,54,47,54,0],"i8",c);IPa=d([47,114,100,98,117,54,47,53,0],"i8",c);FK=d([117,110,102,105,108,108,101,100,0],"i8",c);JPa=d([47,114,100,98,117,54,47,52,0],"i8",c);wE=d([104,101,97,100,116,111,111,108,116,105,112,0],"i8",c);KPa=d([47,114,100,98,117,54,47,51,0],"i8",c);LPa=d([47,98,114,98,103,51,47,51,0],"i8",c);MPa=d([47,114,100,98,117,54,47,50,0],"i8",c);NPa=d([47,114,100,98,117,54,47,49,0],"i8",c);OPa=d([47,114,100,98,117,53,47,53,0],"i8",c);lT=d([32,32,32,102,117,110,99,116,105,111,110,32,98,114,111,119,115,101,114,99,104,101,99,107,40,41,10,0],"i8",c);PPa=d([47,114,100,98,117,53,47,52,0],"i8",c);QPa=d([47,114,100,98,117,53,47,51,0],"i8",c);RPa=d([47,115,104,111,119,112,97,103,101,32,123,32,125,32,100,101,102,0],"i8",c);UB=d([109,105,115,116,121,114,111,115,101,0],"i8",c);SPa=d([47,114,100,98,117,53,47,50,0],"i8",c);DJ=d([104,101,97,100,99,108,105,112,0],"i8",c);TPa=d([97,101,108,105,103,0],"i8",c);UPa=d([47,114,100,98,117,53,47,49,0],"i8",c);VPa=d([47,114,100,98,117,52,47,52,0],"i8",c);WPa=d([47,114,100,98,117,52,47,51,0],"i8",c);vE=d([116,97,105,108,116,111,111,108,116,105,112,0],"i8",c);XPa=d([109,112,116,121,0],"i8",c);E=d(468,"i8",c);WT=d([118,109,108,95,116,101,120,116,112,97,114,97,0],"i8",c);fU=d([118,109,108,95,112,114,105,110,116,95,99,111,108,111,114,0],"i8",c);tP=d([116,114,97,110,115,112,111,115,101,95,115,116,101,112,0],"i8",c);bT=d([116,107,103,101,110,95,112,114,105,110,116,95,116,97,103,115,0],"i8",c);$S=d([116,107,103,101,110,95,112,114,105,110,116,95,99,111,108,111,114,0],"i8",c);BS=d([115,118,103,95,116,101,120,116,112,97,114,97,0],"i8",c);MS=d([115,118,103,95,112,114,105,110,116,95,99,111,108,111,114,0],"i8",c);d([115,112,108,105,110,101,95,97,116,95,121,0],"i8",c);YO=d([115,101,116,98,111,117,110,100,115,0],"i8",c);QO=d([115,97,102,101,95,100,101,108,101,116,101,95,102,97,115,116,95,101,100,103,101,0],"i8",c);Pt=d([114,111,117,110,100,95,99,111,114,110,101,114,115,0],"i8",c);AP=d([112,111,115,116,111,114,100,101,114,0],"i8",c);aD=d([112,111,112,95,111,98,106,95,115,116,97,116,101,0],"i8",c);d([112,111,108,121,108,105,110,101,77,105,100,112,111,105,110,116,0],"i8",c);sF=d([111,118,101,114,108,97,112,95,98,101,122,105,101,114,0],"i8",c);gy=d([109,105,110,109,97,120,95,101,100,103,101,115,0],"i8",c);UN=d([109,101,114,103,101,118,105,114,116,117,97,108,0],"i8",c);MO=d([109,101,114,103,101,95,111,110,101,119,97,121,0],"i8",c);eN=d([109,101,114,103,101,95,99,104,97,105,110,0],"i8",c);BN=d([109,97,112,95,112,97,116,104,0],"i8",c);Eq=d([109,97,112,95,111,117,116,112,117,116,95,115,104,97,112,101,0],"i8",c);LF=d([109,97,112,78,0],"i8",c);WF=d([109,97,107,101,95,108,97,98,101,108,0],"i8",c);Nw=d([109,97,107,101,95,99,104,97,105,110,0],"i8",c);VH=d([109,97,107,101,83,101,108,102,69,100,103,101,0],"i8",c);im=d([109,97,107,101,67,111,109,112,111,117,110,100,69,100,103,101,0],"i8",c);qN=d([105,110,116,101,114,99,108,101,120,112,0],"i8",c);qP=d([105,110,115,116,97,108,108,95,105,110,95,114,97,110,107,0],"i8",c);dE=d([105,110,105,116,95,115,112,108,105,110,101,115,95,98,98,0],"i8",c);Bv=d([103,118,117,115,101,114,115,104,97,112,101,95,102,105,108,101,95,97,99,99,101,115,115,0],"i8",c);xm=d([102,108,97,116,95,115,101,97,114,99,104,0],"i8",c);cR=d([102,105,103,95,114,101,115,111,108,118,101,95,99,111,108,111,114,0],"i8",c);gR=d([102,105,103,95,98,101,122,105,101,114,0],"i8",c);ey=d([102,97,115,116,95,110,111,100,101,97,112,112,0],"i8",c);FO=d([102,97,115,116,95,110,111,100,101,0],"i8",c);Cu=d([101,110,100,112,97,116,104,0],"i8",c);JE=d([101,109,105,116,95,101,100,103,101,95,108,97,98,101,108,0],"i8",c);KP=d([100,111,116,95,112,111,115,105,116,105,111,110,0],"i8",c);KO=d([100,101,108,101,116,101,95,102,108,97,116,95,101,100,103,101,0],"i8",c);HO=d([100,101,108,101,116,101,95,102,97,115,116,95,110,111,100,101,0],"i8",c);EO=d([100,101,108,101,116,101,95,102,97,115,116,95,101,100,103,101,0],"i8",c);$j=d([99,111,114,101,95,108,111,97,100,105,109,97,103,101,95,118,114,109,108,0],"i8",c);Pq=d([99,111,114,101,95,108,111,97,100,105,109,97,103,101,95,115,118,103,0],"i8",c);mr=d([99,111,114,101,95,108,111,97,100,105,109,97,103,101,95,112,115,108,105,98,0],"i8",c);Nq=d([99,111,114,101,95,108,111,97,100,105,109,97,103,101,95,112,115,0],"i8",c);Oq=d([99,111,114,101,95,108,111,97,100,105,109,97,103,101,95,102,105,103,0],"i8",c);PP=d([99,111,110,110,101,99,116,71,114,97,112,104,0],"i8",c);hy=d([99,108,117,115,116,101,114,95,108,101,97,100,101,114,0],"i8",c);MN=d([98,111,120,73,110,116,101,114,115,101,99,116,102,0],"i8",c);gs=d([98,101,122,105,101,114,95,98,98,0],"i8",c);SH=d([98,101,103,105,110,112,97,116,104,0],"i8",c);xP=d([98,97,108,97,110,99,101,0],"i8",c);UO=d([97,98,111,109,105,110,97,116,105,111,110,0],"i8",c);dO=d([95,100,111,116,95,115,112,108,105,110,101,115,0],"i8",c);xN=d([85,70,95,115,101,116,110,97,109,101,0],"i8",c);d([85,70,95,114,101,109,111,118,101,0],"i8",c);d([80,112,111,108,121,98,97,114,114,105,101,114,115,0],"i8",c);d([80,111,98,115,112,97,116,104,0],"i8",c);nn=d(20,"i8",c);d(1,"i8",c);on=d(20,"i8",c);d(1,"i8",c);YPa=d([83,116,57,98,97,100,95,97,108,108,111,99,0],"i8",c);ZPa=d([83,116,50,48,98,97,100,95,97,114,114,97,121,95,110,101,119,95,108,101,110,103,116,104,0],"i8",c);ak=d(12,"i8",c);pn=d(12,"i8",c);d(1,"i8",c);d(4,"i8",c);WB=d([360,0,0,0,4,0,0,0],["*",0,0,0,"i32",0,0,0],c);$Pa=d([4,0,0,0,32,0,0,0],["*",0,0,0,"i32",0,0,0],c);aQa=d([248,0,0,0,1,0,0,0],["*",0,0,0,"i32",0,0,0],c);bQa=d([4,0,0,0,64,0,0,0],["*",0,0,0,"i32",0,0,0],c);cQa=d([360,0,0,0,4,0,0,0],["*",0,0,0,"i32",0,0,0],c);dQa=d([360,0,0,0,8,0,0,0],["*",0,0,0,"i32",0,0,0],c);eQa=d([4,0,0,0,16,0,0,0],["*",0,0,0,"i32",0,0,0],c);fQa=d([248,0,0,0,1,0,0,0],["*",0,0,0,"i32",0,0,0],c);gQa=d([4,0,0,0,128,0,0,0],["*",0,0,0,"i32",0,0,0],c);hQa=d([248,0,0,0,2,0,0,0],["*",0,0,0,"i32",0,0,0],c);Nb=d(8,"i8",c);Ic=d(4,"i8",c);Ih=d(8,"i8",c);d(4,"i8",c);ld=d(4,"i8",c);Yk=d(4,"i8",c);sw=d([115,0,21,0,101,0,8,0,103,0,12,0,110,0,17,0,100,0,1,0,105,0,2,0,103,0,3,0,114,0,4,0,97,0,5,0,112,0,6,0,104,0,7,0,100,0,9,0,103,0,10,0,101,0,11,0,114,0,13,0,97,0,14,0,112,0,15,0,104,0,16,0,111,0,18,0,100,0,19,0,101,0,20,0,116,0,22,0,117,0,27,0,114,0,23,0,105,0,24,0,99,0,25,0,116,0,26,0,98,0,28,0,103,0,29,0,114,0,30,0,97,0,31,0,112,0,32,0,104,0,33,0],["i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0,"i16",0],c);Up=d([-1,0,0,0,270424,0,0,0,-1,0,5,0,256,0,0,0,-1,0,6,0,64,0,0,0,-1,0,7,0,131072,0,0,0,-1,0,8,0,1,0,0,0,-1,0,9,0,32768,0,0,0,-1,0,10,0,128,0,0,0,259,0,11,0,0,0,0,0,-1,0,11,0,8,0,0,0,-1,0,12,0,64,0,0,0,-1,0,13,0,16,0,0,0,262,0,14,0,0,0,0,0,-1,0,14,0,131072,0,0,0,-1,0,15,0,1,0,0,0,-1,0,16,0,32768,0,0,0,-1,0,17,0,128,0,0,0,258,0,18,0,0,0,0,0,-1,0,18,0,16384,0,0,0,-1,0,19,0,8,0,0,0,-1,0,20,0,16,0,0,0,261,0,21,0,0,0,0,0,-1,0,21,0,1572864,0,0,0,-1,0,23,0,131072,0,0,0,-1,0,24,0,256,0,0,0,-1,0,25,0,4,0,0,0,-1,0,26,0,524288,0,0,0,260,0,27,0,0,0,0,0,-1,0,27,0,2,0,0,0,-1,0,28,0,64,0,0,0,-1,0,29,0,131072,0,0,0,-1,0,30,0,1,0,0,0,-1,0,31,0,32768,0,0,0,-1,0,32,0,128,0,0,0,266,0,33,0,0,0,0,0],["i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0,"i16",0,"i16",0,"i32",0,0,0],c);dg=d(4,"i8",c);Vi=d(4,"i8",c);jf=d(4,"i8",c);eg=d(4,"i8",c);Wl=d(4,"i8",c);XB=d(4,"i8",c);pm=d(4,"i8",c);rj=d(4,"i8",c);om=d(4,"i8",c);ih=d(16,"i8",c);d(4,"i8",c);Ne=d(4,"i8",c);Ah=d(4,"i8",c);rw=d(4,"i8",c);Ff=d(4,"i8",c);d(4,"i8",c);Yn=d(4,"i8",c);W=d([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8","*",0,0,0,"*",0,0,0,"*",0,0,0,"i8","i8","i8","i8"],c);Qo=d(4,"i8",c);il=d(4,"i8",c);Te=d(4,"i8",c);sd=d(4,"i8",c);PM=d([12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);d(4,"i8",c);rq=d(4,"i8",c);kl=d(4,"i8",c);cm=d(4,"i8",c);d(4,"i8",c);d(8,"i8",c);d(4,"i8",c);Yb=d(16,"i8",c);d(4,"i8",c);d(4,"i8",c);oJ=d(4,"i8",c);Ks=d(4,"i8",c);rh=d(4,"i8",c);qu=d(4,"i8",c);ru=d(4,"i8",c);up=d(4,"i8",c);Ki=d(4,"i8",c);St=d(4,"i8",c);Tt=d(4,"i8",c);Ls=d(4,"i8",c);Fs=d(4,"i8",c);mu=d(4,"i8",c);nu=d(4,"i8",c);$o=d(4,"i8",c);iu=d(4,"i8",c);Rt=d(4,"i8",c);El=d(4,"i8",c);cp=d(4,"i8",c);Le=d(4,"i8",c);Un=d(4,"i8",c);no=d(4,"i8",c);zu=d(4,"i8",c);sh=d(4,"i8",c);Gh=d(4,"i8",c);bo=d(4,"i8",c);ao=d(4,"i8",c);Js=d(4,"i8",c);bp=d(4,"i8",c);gp=d(4,"i8",c);Ro=d(4,"i8",c);Ut=d(4,"i8",c);ou=d(4,"i8",c);pu=d(4,"i8",c);$r=d(4,"i8",c);Eh=d(4,"i8",c);su=d(4,"i8",c);tu=d(4,"i8",c);mo=d(4,"i8",c);Ou=d(4,"i8",c);Zp=d(4,"i8",c);So=d(4,"i8",c);qm=d(4,"i8",c);d(4,"i8",c);xh=d(4,"i8",c);rm=d(4,"i8",c);To=d(4,"i8",c);Qd=d(4,"i8",c);Xh=d(4,"i8",c);Uo=d(4,"i8",c);nk=d(12,"i8",c);iF=d(4,"i8",c);ow=d(4,"i8",c);Gc=d(4,"i8",c);kq=d(4,"i8",c);qj=d(4,"i8",c);Wu=d(8,"i8",c);bq=d(4,"i8",c);Kf=d(4,"i8",c);Xl=d(4,"i8",c);NK=d([8,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);Mu=d([8,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0,"*",0,0,0],c);Il=d(4,"i8",c);aF=d(4,"i8",c);st=d(4,"i8",c);yG=d(4,"i8",c);Lo=d(4,"i8",c);Ko=d(4,"i8",c);uG=d(4,"i8",c);vG=d(4,"i8",c);Tp=d(4,"i8",c);Bs=d(4,"i8",c);dm=d(256,"i8",c);Ex=d(4,"i8",c);Fx=d(4,"i8",c);sD=d(4,"i8",c);tD=d(4,"i8",c);d(4,"i8",c);d(4,"i8",c);Sn=d(4,"i8",c);Yr=d(4,"i8",c);Yu=d(4,"i8",c);qD=d(4,"i8",c);rD=d(4,"i8",c);Wr=d(4,"i8",c);Xr=d(4,"i8",c);uj=d(4,"i8",c);Bj=d(4,"i8",c);Vc=d(4,"i8",c);Ef=d(4,"i8",c);Ct=d(4,"i8",c);d(4,"i8",c);Si=d(4,"i8",c);ko=d(4,"i8",c);d(8,"i8",c);yh=d(4,"i8",c);Ps=d(4,"i8",c);Kg=d(4,"i8",c);DE=d(4,"i8",c);EE=d(4,"i8",c);$k=d(4,"i8",c);Rs=d(4,"i8",c);Vn=d(4,"i8",c);$u=d(4,"i8",c);zE=d(4,"i8",c);AE=d(4,"i8",c);Ej=d(4,"i8",c);di=d(4,"i8",c);hs=d(4,"i8",c);Hh=d(4,"i8",c);Tn=d(4,"i8",c);Ws=d(4,"i8",c);Xs=d(4,"i8",c);Ys=d(4,"i8",c);Gu=d(4,"i8",c);Fu=d(4,"i8",c);Os=d(4,"i8",c);Ms=d(4,"i8",c);Zk=d(4,"i8",c);Ss=d(4,"i8",c);Ts=d(4,"i8",c);Us=d(4,"i8",c);Vs=d(4,"i8",c);Hr=d(4,"i8",c);BE=d(4,"i8",c);CE=d(4,"i8",c);io=d(4,"i8",c);dj=d(4,"i8",c);bs=d(4,"i8",c);go=d(4,"i8",c);Jr=d(4,"i8",c);uk=d(4,"i8",c);Ir=d(4,"i8",c);FE=d(4,"i8",c);GE=d(4,"i8",c);bj=d(4,"i8",c);bm=d(4,"i8",c);Xc=d(4,"i8",c);iQa=d(4,"i8",c);jQa=d(4,"i8",c);Jo=d(4,"i8",c);Pn=d(4,"i8",c);kQa=d(4,"i8",c);lQa=d(4,"i8",c);mQa=d(4,"i8",c);nQa=d(4,"i8",c);oQa=d(4,"i8",c);pQa=d(4,"i8",c);rf=d(4,"i8",c);d(8,"i8",c);ye=d(4,"i8",c);Ul=d(4,"i8",c);sm=d(8,"i8",c);Wi=d(4,"i8",c);qw=d(4,"i8",c);d(4,"i8",c);pg=d(4,"i8",c);iM=d([1,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,16,0,0,0,32,0,0,0,64,0,0,0,128,0,0,0,256,0,0,0,512,0,0,0,1024,0,0,0,2048,0,0,0,4096,0,0,0,8192,0,0,0,16384,0,0,0,32768,0,0,0,65536,0,0,0,131072,0,0,0,262144,0,0,0,524288,0,0,0,1048576,0,0,0,2097152,0,0,0,4194304,0,0,0,8388608,0,0,0,16777216,0,0,0,33554432,0,0,0],["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0],c);bu=d([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0],["double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i8","i8","i8","i8","i8","i8",0,0,"*",0,0,0],c);Gw=d(4,"i8",c);Dl=d(4,"i8",c);Bi=d([1,0,0,0,1,0,0,0,0,0,0,0,240,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,38,0,0,0,3,0,0,0,.5,0,0,0,0,0,0,0,148,0,0,0,4,0,0,0,1,0,0,0,0,0,0,0,12,0,0,0,5,0,0,0,1.2,0,0,0,0,0,0,0,86,0,0,0,6,0,0,0,.8,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0,"i32",0,0,0,"double",0,0,0,0,0,0,0,"*",0,0,0],c);Mr=d([0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0],["*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0],c);xe=d([0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0],["*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0],c);gh=d([0,0,0,0,8,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0],["*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0],c);Ai=d([0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],["*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0,"*",0,0,0,"i32",0,0,0,"i32",0,0,0],c);tj=d(4,"i8",c);qa=d(44,"i8",c);Hf=d(4,"i8",c);a[Bd>>2]=U|0;a[Bd+4>>2]=U+16|0;a[Bd+8>>2]=U+32|0;a[Bd+12>>2]=U+48|0;a[Bd+16>>2]=U+64|0;a[Bd+20>>2]=U+80|0;a[Bd+24>>2]=U+96|0;a[Bd+28>>2]=U+112|0;a[Bd+32>>2]=U+16|0;a[Bd+36>>2]=U+16|0;a[Bd+40>>2]=U+80|0;a[Bd+44>>2]=U+80|0;a[cd>>2]=OB|0;a[cd+4>>2]=Ac|0;a[cd+8>>2]=Zj|0;a[cd+12>>2]=iB|0;a[cd+16>>2]=ir|0;a[cd+20>>2]=Yj|0;a[cd+24>>2]=RA|0;a[cd+28>>2]=hr|0;a[cd+32>>2]=fr|0;a[cd+36>>2]=MA|0;a[cd+40>>2]=er|0;a[cd+44>>2]=Vj|0;a[cd+48>>2]=HA|0;a[cd+52>>2]=GA|0;a[cd+56>>2]=hf|0;a[cd+60>>2]=Uj|0;a[L>>2]=IA|0;a[L+4>>2]=AA|0;a[L+8>>2]=OB|0;a[L+12>>2]=Xz|0;a[L+16>>2]=Mz|0;a[L+20>>2]=Bz|0;a[L+24>>2]=qz|0;a[L+28>>2]=Ac|0;a[L+32>>2]=SB|0;a[L+36>>2]=Zj|0;a[L+40>>2]=wB|0;a[L+44>>2]=mB|0;a[L+48>>2]=bB|0;a[L+52>>2]=WA|0;a[L+56>>2]=SA|0;a[L+60>>2]=QA|0;a[L+64>>2]=OA|0;a[L+68>>2]=NA|0;a[L+72>>2]=LA|0;a[L+76>>2]=JA|0;a[L+80>>2]=gn|0;a[L+84>>2]=gka|0;a[L+88>>2]=iia|0;a[L+92>>2]=EA|0;a[L+96>>2]=ega|0;a[L+100>>2]=DA|0;a[L+104>>2]=$ea|0;a[L+108>>2]=CA|0;a[L+112>>2]=dea|0;a[L+116>>2]=BA|0;a[L+120>>2]=zA|0;a[L+124>>2]=xA|0;a[L+128>>2]=Bca|0;a[L+132>>2]=wA|0;a[L+136>>2]=uA|0;a[L+140>>2]=sA|0;a[L+144>>2]=rA|0;a[L+148>>2]=qA|0;a[L+152>>2]=pA|0;a[L+156>>2]=nA|0;a[L+160>>2]=mA|0;a[L+164>>2]=lA|0;a[L+168>>2]=kA|0;a[L+172>>2]=hA|0;a[L+176>>2]=fA|0;a[L+180>>2]=dA|0;a[L+184>>2]=cA|0;a[L+188>>2]=aA|0;a[L+192>>2]=iB|0;a[L+196>>2]=Zz|0;a[L+200>>2]=Wz|0;a[L+204>>2]=Uz|0;a[L+208>>2]=Tz|0;a[L+212>>2]=ir|0;a[L+216>>2]=Yj|0;a[L+220>>2]=Sz|0;a[L+224>>2]=Rz|0;a[L+228>>2]=Pz|0;a[L+232>>2]=Oz|0;a[L+236>>2]=Nz|0;a[L+240>>2]=Lz|0;a[L+244>>2]=Kz|0;a[L+248>>2]=Jz|0;a[L+252>>2]=Iz|0;a[L+256>>2]=Hz|0;a[L+260>>2]=Gz|0;a[L+264>>2]=Fz|0;a[L+268>>2]=Ez|0;a[L+272>>2]=Dz|0;a[L+276>>2]=Cz|0;a[L+280>>2]=Az|0;a[L+284>>2]=zz|0;a[L+288>>2]=B1|0;a[L+292>>2]=qe|0;a[L+296>>2]=yz|0;a[L+300>>2]=xz|0;a[L+304>>2]=wz|0;a[L+308>>2]=uz|0;a[L+312>>2]=sz|0;a[L+316>>2]=rz|0;a[L+320>>2]=pz|0;a[L+324>>2]=oz|0;a[L+328>>2]=RA|0;a[L+332>>2]=nz|0;a[L+336>>2]=mz|0;a[L+340>>2]=Zm|0;a[L+344>>2]=hr|0;a[L+348>>2]=lz|0;a[L+352>>2]=kz|0;a[L+356>>2]=jz|0;a[L+360>>2]=iz|0;a[L+364>>2]=hz|0;a[L+368>>2]=gz|0;a[L+372>>2]=fz|0;a[L+376>>2]=ez|0;a[L+380>>2]=dz|0;a[L+384>>2]=cz|0;a[L+388>>2]=bz|0;a[L+392>>2]=UB|0;a[L+396>>2]=TB|0;a[L+400>>2]=RB|0;a[L+404>>2]=fr|0;a[L+408>>2]=PB|0;a[L+412>>2]=MA|0;a[L+416>>2]=MB|0;a[L+420>>2]=LB|0;a[L+424>>2]=KB|0;a[L+428>>2]=JB|0;a[L+432>>2]=IB|0;a[L+436>>2]=HB|0;a[L+440>>2]=GB|0;a[L+444>>2]=FB|0;a[L+448>>2]=EB|0;a[L+452>>2]=BB|0;a[L+456>>2]=AB|0;a[L+460>>2]=zB|0;a[L+464>>2]=yB|0;a[L+468>>2]=xB|0;a[L+472>>2]=er|0;a[L+476>>2]=Vj|0;a[L+480>>2]=vB|0;a[L+484>>2]=uB|0;a[L+488>>2]=tB|0;a[L+492>>2]=sB|0;a[L+496>>2]=rB|0;a[L+500>>2]=qB|0;a[L+504>>2]=pB|0;a[L+508>>2]=oB|0;a[L+512>>2]=HA|0;a[L+516>>2]=nB|0;a[L+520>>2]=lB|0;a[L+524>>2]=kB|0;a[L+528>>2]=jB|0;a[L+532>>2]=hB|0;a[L+536>>2]=gB|0;a[L+540>>2]=fB|0;a[L+544>>2]=eB|0;a[L+548>>2]=GA|0;a[L+552>>2]=dB|0;a[L+556>>2]=cB|0;a[L+560>>2]=aB|0;a[L+564>>2]=$A|0;a[L+568>>2]=ZA|0;a[L+572>>2]=hf|0;a[L+576>>2]=YA|0;a[L+580>>2]=Uj|0;a[L+584>>2]=XA|0;a[NU+16>>2]=208;a[Ty+12>>2]=cd|0;a[Uy+12>>2]=L|0;a[Vy+12>>2]=Pf|0;a[ei>>2]=p2|0;a[ei+4>>2]=H_|0;a[ei+8>>2]=jx|0;a[ei+12>>2]=BPa|0;a[ei+16>>2]=WMa|0;a[I>>2]=JMa|0;a[I+4>>2]=YMa|0;a[I+8>>2]=Foa|0;a[I+12>>2]=Y|0;a[I+16>>2]=daa|0;a[I+20>>2]=c8|0;a[I+24>>2]=m5|0;a[I+28>>2]=t2|0;a[I+32>>2]=Y|0;a[I+36>>2]=K_|0;a[I+40>>2]=WX|0;a[I+44>>2]=Y|0;a[I+48>>2]=FPa|0;a[I+52>>2]=aNa|0;a[I+56>>2]=vKa|0;a[I+60>>2]=PHa|0;a[I+64>>2]=gFa|0;a[I+68>>2]=GCa|0;a[I+72>>2]=lAa|0;a[I+76>>2]=ln|0;a[I+80>>2]=iva|0;a[I+84>>2]=jta|0;a[I+88>>2]=lra|0;a[I+92>>2]=Joa|0;a[I+96>>2]=ima|0;a[I+100>>2]=rka|0;a[I+104>>2]=tia|0;a[I+108>>2]=Lga|0;a[I+112>>2]=jga|0;a[I+116>>2]=Gfa|0;a[I+120>>2]=dfa|0;a[I+124>>2]=Bea|0;a[I+128>>2]=iea|0;a[I+132>>2]=ii|0;a[I+136>>2]=Y|0;a[I+140>>2]=tda|0;a[I+144>>2]=ada|0;a[I+148>>2]=Eca|0;a[I+152>>2]=jca|0;a[I+156>>2]=Y|0;a[I+160>>2]=Sba|0;a[I+164>>2]=yba|0;a[I+168>>2]=$aa|0;a[I+172>>2]=Jaa|0;a[I+176>>2]=ii|0;a[I+180>>2]=Y|0;a[I+184>>2]=raa|0;a[I+188>>2]=$$|0;a[I+192>>2]=L$|0;a[I+196>>2]=s$|0;a[I+200>>2]=b$|0;a[I+204>>2]=N9|0;a[I+208>>2]=y9|0;a[I+212>>2]=i9|0;a[I+216>>2]=U8|0;a[I+220>>2]=F8|0;a[I+224>>2]=Y|0;a[I+228>>2]=p8|0;a[I+232>>2]=$7|0;a[I+236>>2]=L7|0;a[I+240>>2]=x7|0;a[I+244>>2]=i7|0;a[I+248>>2]=Y|0;a[I+252>>2]=W6|0;a[I+256>>2]=H6|0;a[I+260>>2]=s6|0;a[I+264>>2]=e6|0;a[I+268>>2]=Q5|0;a[I+272>>2]=A5|0;a[I+276>>2]=j5|0;a[I+280>>2]=T4|0;a[I+284>>2]=E4|0;a[I+288>>2]=r4|0;a[I+292>>2]=c4|0;a[I+296>>2]=O3|0;a[I+300>>2]=ii|0;a[I+304>>2]=Y|0;a[I+308>>2]=y3|0;a[I+312>>2]=i3|0;a[I+316>>2]=V2|0;a[I+320>>2]=ln|0;a[I+324>>2]=Y|0;a[I+328>>2]=G2|0;a[I+332>>2]=v2|0;a[I+336>>2]=b2|0;a[I+340>>2]=N1|0;a[I+344>>2]=z1|0;a[I+348>>2]=l1|0;a[I+352>>2]=Y0|0;a[I+356>>2]=K0|0;a[I+360>>2]=x0|0;a[I+364>>2]=k0|0;a[I+368>>2]=ln|0;a[I+372>>2]=Y|0;a[I+376>>2]=X_|0;a[I+380>>2]=I_|0;a[I+384>>2]=t_|0;a[I+388>>2]=e_|0;a[I+392>>2]=RZ|0;a[I+396>>2]=BZ|0;a[I+400>>2]=nZ|0;a[I+404>>2]=ZY|0;a[I+408>>2]=ii|0;a[I+412>>2]=Y|0;a[I+416>>2]=LY|0;a[I+420>>2]=xY|0;a[I+424>>2]=iY|0;a[I+428>>2]=UX|0;a[I+432>>2]=GX|0;a[I+436>>2]=rX|0;a[I+440>>2]=dX|0;a[I+444>>2]=PW|0;a[I+448>>2]=BW|0;a[I+452>>2]=nW|0;a[I+456>>2]=aW|0;a[I+460>>2]=ii|0;a[I+464>>2]=Y|0;a[I+468>>2]=OV|0;a[I+472>>2]=RPa|0;a[I+476>>2]=Y|0;a[I+480>>2]=DPa|0;a[I+484>>2]=pPa|0;a[I+488>>2]=bPa|0;a[I+492>>2]=POa|0;a[I+496>>2]=AOa|0;a[I+500>>2]=mOa|0;a[I+504>>2]=ZNa|0;a[I+508>>2]=MNa|0;a[I+512>>2]=zNa|0;a[I+516>>2]=Y|0;a[I+520>>2]=mNa|0;a[I+524>>2]=Y|0;a[I+528>>2]=ZMa|0;a[I+532>>2]=NMa|0;a[I+536>>2]=wMa|0;a[I+540>>2]=jMa|0;a[I+544>>2]=WLa|0;a[I+548>>2]=HLa|0;a[I+552>>2]=ii|0;a[I+556>>2]=Y|0;a[I+560>>2]=tLa|0;a[I+564>>2]=Y|0;a[I+568>>2]=gLa|0;a[I+572>>2]=UKa|0;a[I+576>>2]=HKa|0;a[I+580>>2]=tKa|0;a[I+584>>2]=gKa|0;a[I+588>>2]=UJa|0;a[I+592>>2]=FJa|0;a[I+596>>2]=ln|0;a[I+600>>2]=Y|0;a[I+604>>2]=qJa|0;a[I+608>>2]=Y|0;a[I+612>>2]=cJa|0;a[I+616>>2]=SIa|0;a[I+620>>2]=CIa|0;a[I+624>>2]=pIa|0;a[I+628>>2]=aIa|0;a[I+632>>2]=NHa|0;a[I+636>>2]=AHa|0;a[I+640>>2]=Y|0;a[I+644>>2]=mHa|0;a[I+648>>2]=$Ga|0;a[I+652>>2]=NGa|0;a[I+656>>2]=BGa|0;a[I+660>>2]=hGa|0;a[I+664>>2]=TFa|0;a[I+668>>2]=GFa|0;a[I+672>>2]=tFa|0;a[I+676>>2]=Y|0;a[I+680>>2]=eFa|0;a[H>>2]=b_|0;a[H+4>>2]=Ym|0;a[H+8>>2]=QB|0;a[H+24>>2]=me|0;a[H+36>>2]=RJa|0;a[H+40>>2]=Ym|0;a[H+44>>2]=QB|0;a[H+52>>2]=vg|0;a[H+60>>2]=me|0;a[H+68>>2]=bc|0;a[H+72>>2]=dCa|0;a[H+76>>2]=Ym|0;a[H+80>>2]=mn|0;a[H+96>>2]=me|0;a[H+100>>2]=Wb|0;a[H+108>>2]=Eua|0;a[H+112>>2]=Ym|0;a[H+116>>2]=mn|0;a[H+124>>2]=vg|0;a[H+132>>2]=me|0;a[H+136>>2]=Wb|0;a[H+140>>2]=bc|0;a[H+144>>2]=Psa|0;a[H+148>>2]=jn|0;a[H+152>>2]=mn|0;a[H+168>>2]=qd|0;a[H+172>>2]=Wb|0;a[H+180>>2]=Jla|0;a[H+184>>2]=jn|0;a[H+188>>2]=mn|0;a[H+196>>2]=bc|0;a[H+204>>2]=qd|0;a[H+208>>2]=Wb|0;a[H+212>>2]=bc|0;a[H+216>>2]=Uja|0;a[H+220>>2]=jn|0;a[H+224>>2]=FA|0;a[H+240>>2]=qd|0;a[H+252>>2]=Fga|0;a[H+256>>2]=jn|0;a[H+260>>2]=FA|0;a[H+268>>2]=bc|0;a[H+276>>2]=qd|0;a[H+284>>2]=bc|0;a[H+288>>2]=Tj|0;a[H+292>>2]=Tj|0;a[H+312>>2]=fn|0;a[H+324>>2]=Vea|0;a[H+328>>2]=Tj|0;a[H+332>>2]=Wb|0;a[H+348>>2]=fn|0;a[H+352>>2]=Wb|0;a[H+360>>2]=xea|0;a[H+364>>2]=Tj|0;a[H+368>>2]=Wb|0;a[H+376>>2]=vg|0;a[H+384>>2]=fn|0;a[H+388>>2]=Wb|0;a[H+392>>2]=bc|0;a[H+396>>2]=aea|0;a[H+400>>2]=Tj|0;a[H+412>>2]=vg|0;a[H+420>>2]=fn|0;a[H+428>>2]=bc|0;a[H+432>>2]=Qf|0;a[H+436>>2]=Qf|0;a[H+456>>2]=me|0;a[H+468>>2]=pda|0;a[H+472>>2]=Qf|0;a[H+476>>2]=Wb|0;a[H+492>>2]=me|0;a[H+496>>2]=Wb|0;a[H+504>>2]=Uca|0;a[H+508>>2]=Qf|0;a[H+512>>2]=Wb|0;a[H+520>>2]=vg|0;a[H+528>>2]=me|0;a[H+532>>2]=Wb|0;a[H+536>>2]=bc|0;a[H+540>>2]=yca|0;a[H+544>>2]=Qf|0;a[H+552>>2]=en|0;a[H+564>>2]=me|0;a[H+576>>2]=Mba|0;a[H+580>>2]=Qf|0;a[H+584>>2]=Wb|0;a[H+588>>2]=en|0;a[H+600>>2]=me|0;a[H+604>>2]=Wb|0;a[H+612>>2]=sba|0;a[H+616>>2]=Qf|0;a[H+620>>2]=Wb|0;a[H+624>>2]=en|0;a[H+628>>2]=vg|0;a[H+636>>2]=me|0;a[H+640>>2]=Wb|0;a[H+644>>2]=bc|0;a[H+648>>2]=Zaa|0;a[H+652>>2]=Qf|0;a[H+660>>2]=en|0;a[H+664>>2]=vg|0;a[H+672>>2]=me|0;a[H+680>>2]=bc|0;a[H+684>>2]=Iaa|0;a[H+688>>2]=Qf|0;a[H+700>>2]=vg|0;a[H+708>>2]=me|0;a[H+716>>2]=bc|0;a[H+720>>2]=qaa|0;a[H+724>>2]=dn|0;a[H+728>>2]=Wb|0;a[H+744>>2]=qd|0;a[H+748>>2]=Wb|0;a[H+756>>2]=K$|0;a[H+760>>2]=dn|0;a[H+764>>2]=Wb|0;a[H+772>>2]=bc|0;a[H+780>>2]=qd|0;a[H+784>>2]=Wb|0;a[H+788>>2]=bc|0;a[H+792>>2]=r$|0;a[H+796>>2]=dn|0;a[H+808>>2]=bc|0;a[H+816>>2]=qd|0;a[H+824>>2]=bc|0;a[H+828>>2]=a$|0;a[H+832>>2]=dn|0;a[H+836>>2]=gA|0;a[H+852>>2]=qd|0;a[H+864>>2]=x9|0;a[H+868>>2]=cn|0;a[H+872>>2]=Wb|0;a[H+888>>2]=qd|0;a[H+892>>2]=Wb|0;a[H+900>>2]=T8|0;a[H+904>>2]=cn|0;a[H+908>>2]=Wb|0;a[H+916>>2]=bc|0;a[H+924>>2]=qd|0;a[H+928>>2]=Wb|0;a[H+932>>2]=bc|0;a[H+936>>2]=E8|0;a[H+940>>2]=cn|0;a[H+952>>2]=bc|0;a[H+960>>2]=qd|0;a[H+968>>2]=bc|0;a[H+972>>2]=o8|0;a[H+976>>2]=cn|0;a[H+980>>2]=gA|0;a[H+996>>2]=qd|0;a[H+1008>>2]=Yz|0;a[H+1012>>2]=Yz|0;a[H+1032>>2]=Vz|0;a[H+1044>>2]=w7|0;a[H+1048>>2]=bn|0;a[H+1052>>2]=Wb|0;a[H+1068>>2]=qd|0;a[H+1072>>2]=Wb|0;a[H+1080>>2]=V6|0;a[H+1084>>2]=bn|0;a[H+1088>>2]=Wb|0;a[H+1096>>2]=bc|0;a[H+1104>>2]=qd|0;a[H+1108>>2]=Wb|0;a[H+1112>>2]=bc|0;a[H+1116>>2]=G6|0;a[H+1120>>2]=bn|0;a[H+1132>>2]=bc|0;a[H+1140>>2]=qd|0;a[H+1148>>2]=bc|0;a[H+1152>>2]=Li|0;a[H+1156>>2]=bn|0;a[H+1176>>2]=qd|0;a[H+1188>>2]=c6|0;a[H+1192>>2]=O5|0;a[H+1196>>2]=y5|0;a[H+1204>>2]=bc|0;a[H+1212>>2]=qd|0;a[H+1220>>2]=bc|0;a[H+1224>>2]=h5|0;a[H+1228>>2]=R4|0;a[H+1248>>2]=Vz|0;a[rl>>2]=J3|0;a[rl+4>>2]=t3|0;a[vc>>2]=vd|0;a[vc+4>>2]=jqa|0;a[vc+8>>2]=Ena|0;a[vc+12>>2]=pla|0;a[vc+16>>2]=zja|0;a[vc+20>>2]=Bha|0;a[vc+24>>2]=Aga|0;a[vc+28>>2]=Xfa|0;a[vc+32>>2]=ufa|0;a[vc+36>>2]=Qea|0;a[vc+40>>2]=tea|0;a[vc+44>>2]=Xda|0;a[vc+48>>2]=Eda|0;a[vc+52>>2]=mda|0;a[vc+56>>2]=Qca|0;a[vc+60>>2]=tca|0;a[vc+64>>2]=bca|0;a[vc+68>>2]=Iba|0;a[vc+72>>2]=oba|0;a[vc+76>>2]=Waa|0;a[vc+80>>2]=Faa|0;a[Tq+12>>2]=164;a[Tq+16>>2]=252;a[Tq+20>>2]=132;a[vV>>2]=368;a[Qc>>2]=Hoa|0;a[Qc+12>>2]=gma|0;a[Qc+16>>2]=pka|0;a[Qc+28>>2]=jr|0;a[Qc+32>>2]=Kga|0;a[Qc+44>>2]=iga|0;a[Qc+48>>2]=Ffa|0;a[Qc+60>>2]=cfa|0;a[Qc+64>>2]=Aea|0;a[Qc+76>>2]=hea|0;a[Qc+80>>2]=Lda|0;a[Qc+92>>2]=sda|0;a[Qc+96>>2]=$ca|0;a[Qc+108>>2]=Dca|0;a[Qc+112>>2]=ica|0;a[Qc+124>>2]=Rba|0;a[Qm+4>>2]=JZ|0;a[Qm+12>>2]=KU;a[Qm+16>>2]=Ty;a[Rm+4>>2]=C$|0;a[Rm+12>>2]=LU;a[Rm+16>>2]=PU;a[Sm+4>>2]=Dp|0;a[Sm+12>>2]=MU;a[Sm+16>>2]=Uy;a[Tm+4>>2]=jr|0;a[Tm+12>>2]=TU;a[Tm+16>>2]=QU;a[Um+4>>2]=q2|0;a[Um+12>>2]=uV;a[Um+16>>2]=RU;a[Vm+4>>2]=Xca|0;a[Vm+12>>2]=wV;a[Vm+16>>2]=Vy;a[Wg+4>>2]=ok|0;a[Wg+12>>2]=AV;a[Wg+16>>2]=SU;a[Wg+24>>2]=x$|0;a[Wg+32>>2]=JU;a[Wg+36>>2]=OU;a[zn>>2]=gea|0;a[zn+4>>2]=az|0;a[yn>>2]=eea|0;a[yn+4>>2]=ed|0;a[R+4>>2]=c5|0;a[R+12>>2]=hi;a[R+24>>2]=eAa|0;a[R+32>>2]=hi;a[R+44>>2]=hga|0;a[R+52>>2]=hi;a[R+64>>2]=Pba|0;a[R+72>>2]=hi;a[R+84>>2]=A9|0;a[R+92>>2]=hi;a[R+104>>2]=J6|0;a[R+112>>2]=Rj;a[R+124>>2]=Q3|0;a[R+132>>2]=Rj;a[R+144>>2]=$0|0;a[R+152>>2]=Rj;a[R+164>>2]=pZ|0;a[R+172>>2]=Rj;a[R+184>>2]=DW|0;a[R+192>>2]=Rj;a[R+204>>2]=oOa|0;a[R+212>>2]=Pj;a[R+224>>2]=KLa|0;a[R+232>>2]=Pj;a[R+244>>2]=eJa|0;a[R+252>>2]=Pj;a[R+264>>2]=yGa|0;a[R+272>>2]=Pj;a[R+284>>2]=TDa|0;a[R+292>>2]=Pj;a[R+304>>2]=TA|0;a[R+312>>2]=Xm;a[R+324>>2]=cza|0;a[R+332>>2]=Xm;a[R+344>>2]=PA|0;a[R+352>>2]=Xm;a[R+364>>2]=fua|0;a[R+372>>2]=Xm;a[R+384>>2]=psa|0;a[R+392>>2]=xV;a[R+404>>2]=Ypa|0;a[R+412>>2]=Md;a[R+424>>2]=rna|0;a[R+432>>2]=Md;a[R+444>>2]=hla|0;a[R+452>>2]=Md;a[R+464>>2]=rja|0;a[R+472>>2]=Md;a[R+484>>2]=sha|0;a[R+492>>2]=Md;a[R+504>>2]=wga|0;a[R+512>>2]=Md;a[R+524>>2]=Tfa|0;a[R+532>>2]=Md;a[R+544>>2]=qfa|0;a[R+552>>2]=Md;a[R+564>>2]=Nea|0;a[R+572>>2]=Md;a[R+584>>2]=rea|0;a[R+592>>2]=Md;a[R+604>>2]=Vda|0;a[R+612>>2]=Md;a[R+624>>2]=Cda|0;a[R+632>>2]=Md;a[R+644>>2]=jda|0;a[R+652>>2]=Md;a[R+664>>2]=Oca|0;a[R+672>>2]=Md;a[R+684>>2]=rca|0;a[R+692>>2]=Md;a[R+704>>2]=$ba|0;a[R+712>>2]=Md;a[R+724>>2]=Gba|0;a[R+732>>2]=ug;a[R+744>>2]=lba|0;a[R+752>>2]=ug;a[R+764>>2]=Uaa|0;a[R+772>>2]=ug;a[R+784>>2]=Daa|0;a[R+792>>2]=ug;a[R+804>>2]=maa|0;a[R+812>>2]=ug;a[R+824>>2]=W$|0;a[R+832>>2]=ug;a[R+844>>2]=G$|0;a[R+852>>2]=ug;a[R+864>>2]=n$|0;a[R+872>>2]=ug;a[R+884>>2]=iA|0;a[R+892>>2]=hi;a[R+904>>2]=J9|0;a[R+912>>2]=Qj;a[R+924>>2]=t9|0;a[R+932>>2]=Qj;a[R+944>>2]=e9|0;a[R+952>>2]=Qj;a[R+964>>2]=P8|0;a[R+972>>2]=Qj;a[R+984>>2]=z8|0;a[R+992>>2]=Qj;a[Wm+4>>2]=ok|0;a[Wm+12>>2]=zV;a[Wm+16>>2]=yV;a[Oc>>2]=vba|0;a[Oc+8>>2]=VFa|0;a[Oc+16>>2]=Oia|0;a[Oc+24>>2]=Gca|0;a[Oc+32>>2]=f$|0;a[Oc+40>>2]=k7|0;a[Oc+48>>2]=q4|0;a[Oc+56>>2]=x1|0;a[Oc+64>>2]=OZ|0;a[Oc+72>>2]=$W|0;a[Oc+80>>2]=KOa|0;a[Oc+88>>2]=DB|0;a[Oc+96>>2]=xJa|0;a[Oc+104>>2]=xHa|0;a[Uq+4>>2]=WW|0;a[Uq+16>>2]=BV;a[Vq+4>>2]=IEa|0;a[Vq+16>>2]=CV;a[Wq+4>>2]=iA|0;a[Wq+16>>2]=DV;a[Xg+4>>2]=PA|0;a[Xg+16>>2]=$y;a[Xg+24>>2]=rEa|0;a[Xg+36>>2]=$y;a[Xg+44>>2]=TA|0;a[Xg+56>>2]=FV;a[De+4>>2]=Xwa|0;a[De+16>>2]=Zq;a[De+24>>2]=vfa|0;a[De+36>>2]=$q;a[De+44>>2]=mba|0;a[De+56>>2]=$q;a[De+64>>2]=c9|0;a[De+76>>2]=$q;a[De+84>>2]=l6|0;a[De+96>>2]=Zq;a[De+104>>2]=o3|0;a[De+116>>2]=Zq;a[Xq+4>>2]=xGa|0;a[Xq+16>>2]=EV;a[ae+4>>2]=C7|0;a[ae+16>>2]=Sj;a[ae+24>>2]=J4|0;a[ae+36>>2]=Sj;a[ae+44>>2]=S1|0;a[ae+56>>2]=GV;a[ae+64>>2]=j_|0;a[ae+76>>2]=Sj;a[ae+84>>2]=wX|0;a[ae+96>>2]=Sj;a[ae+104>>2]=gPa|0;a[ae+116>>2]=Sj;a[Cl>>2]=cea|0;a[Cl+4>>2]=Jda|0;a[Cl+8>>2]=sg|0;a[Bl>>2]=Yca|0;a[Bl+4>>2]=jr|0;a[Bl+8>>2]=Dp|0;a[Mf>>2]=Ac|0;a[Mf+4>>2]=Zj|0;a[Mf+8>>2]=Yj|0;a[Mf+12>>2]=gn|0;a[Mf+16>>2]=Vj|0;a[Mf+20>>2]=Zm|0;a[Mf+24>>2]=Uj|0;a[Mf+28>>2]=hf|0;a[Pf>>2]=Ac|0;a[Pf+4>>2]=Zj|0;a[Pf+8>>2]=gn|0;a[Pf+12>>2]=Yj|0;a[Pf+16>>2]=Zm|0;a[Pf+20>>2]=Vj|0;a[Pf+24>>2]=hf|0;a[Pf+28>>2]=Uj|0;a[Yq>>2]=356;a[Yq+4>>2]=82;a[F>>2]=cba|0;a[F+8>>2]=Maa|0;a[F+16>>2]=vaa|0;a[F+24>>2]=eaa|0;a[F+32>>2]=O$|0;a[F+40>>2]=v$|0;a[F+48>>2]=e$|0;a[F+56>>2]=Q9|0;a[F+64>>2]=C9|0;a[F+72>>2]=m9|0;a[F+80>>2]=X8|0;a[F+88>>2]=I8|0;a[F+96>>2]=s8|0;a[F+104>>2]=d8|0;a[F+112>>2]=O7|0;a[F+120>>2]=A7|0;a[F+128>>2]=m7|0;a[F+136>>2]=Z6|0;a[F+144>>2]=L6|0;a[F+152>>2]=w6|0;a[F+160>>2]=h6|0;a[F+168>>2]=T5|0;a[F+176>>2]=D5|0;a[F+184>>2]=n5|0;a[F+192>>2]=W4|0;a[F+200>>2]=H4|0;a[F+208>>2]=u4|0;a[F+216>>2]=f4|0;a[F+224>>2]=S3|0;a[F+232>>2]=C3|0;a[F+240>>2]=l3|0;a[F+248>>2]=Y2|0;a[F+256>>2]=J2|0;a[F+264>>2]=u2|0;a[F+272>>2]=e2|0;a[F+280>>2]=Q1|0;a[F+288>>2]=D1|0;a[F+296>>2]=o1|0;a[F+304>>2]=b1|0;a[F+312>>2]=O0|0;a[F+320>>2]=A0|0;a[F+328>>2]=n0|0;a[F+336>>2]=$_|0;a[F+344>>2]=M_|0;a[F+352>>2]=w_|0;a[F+360>>2]=h_|0;a[F+368>>2]=UZ|0;a[F+376>>2]=EZ|0;a[F+384>>2]=rZ|0;a[F+392>>2]=bZ|0;a[F+400>>2]=NY|0;a[F+408>>2]=zY|0;a[F+416>>2]=kY|0;a[F+424>>2]=XX|0;a[F+432>>2]=IX|0;a[F+440>>2]=tX|0;a[F+448>>2]=fX|0;a[F+456>>2]=RW|0;a[F+464>>2]=EW|0;a[F+472>>2]=qW|0;a[F+480>>2]=cW|0;a[F+488>>2]=QV|0;a[F+496>>2]=TPa|0;a[F+504>>2]=GPa|0;a[F+512>>2]=rPa|0;a[F+520>>2]=dPa|0;a[F+528>>2]=ROa|0;a[F+536>>2]=COa|0;a[F+544>>2]=pOa|0;a[F+552>>2]=bOa|0;a[F+560>>2]=ONa|0;a[F+568>>2]=BNa|0;a[F+576>>2]=oNa|0;a[F+584>>2]=bNa|0;a[F+592>>2]=LMa|0;a[F+600>>2]=yMa|0;a[F+608>>2]=oMa|0;a[F+616>>2]=bMa|0;a[F+624>>2]=OLa|0;a[F+632>>2]=zLa|0;a[F+640>>2]=lLa|0;a[F+648>>2]=ZKa|0;a[F+656>>2]=MKa|0;a[F+664>>2]=wKa|0;a[F+672>>2]=lKa|0;a[F+680>>2]=ZJa|0;a[F+688>>2]=LJa|0;a[F+696>>2]=vJa|0;a[F+704>>2]=iJa|0;a[F+712>>2]=VIa|0;a[F+720>>2]=HIa|0;a[F+728>>2]=uIa|0;a[F+736>>2]=gIa|0;a[F+744>>2]=THa|0;a[F+752>>2]=FHa|0;a[F+760>>2]=rHa|0;a[F+768>>2]=eHa|0;a[F+776>>2]=JGa|0;a[F+784>>2]=EGa|0;a[F+792>>2]=nGa|0;a[F+800>>2]=ZFa|0;a[F+808>>2]=LFa|0;a[F+816>>2]=yFa|0;a[F+824>>2]=kFa|0;a[F+832>>2]=XEa|0;a[F+840>>2]=KEa|0;a[F+848>>2]=wEa|0;a[F+856>>2]=jEa|0;a[F+864>>2]=YDa|0;a[F+872>>2]=KDa|0;a[F+880>>2]=xDa|0;a[F+888>>2]=kDa|0;a[F+896>>2]=WCa|0;a[F+904>>2]=KCa|0;a[F+912>>2]=wCa|0;a[F+920>>2]=kCa|0;a[F+928>>2]=YBa|0;a[F+936>>2]=MBa|0;a[F+944>>2]=ABa|0;a[F+952>>2]=nBa|0;a[F+960>>2]=aBa|0;a[F+968>>2]=PAa|0;a[F+976>>2]=CAa|0;a[F+984>>2]=pAa|0;a[F+992>>2]=bAa|0;a[F+1e3>>2]=Qza|0;a[F+1008>>2]=ap|0;a[F+1016>>2]=tza|0;a[F+1024>>2]=hza|0;a[F+1032>>2]=Uya|0;a[F+1040>>2]=Hya|0;a[F+1048>>2]=uya|0;a[F+1056>>2]=fya|0;a[F+1064>>2]=Sxa|0;a[F+1072>>2]=Exa|0;a[F+1080>>2]=qxa|0;a[F+1088>>2]=cxa|0;a[F+1096>>2]=Owa|0;a[F+1104>>2]=Awa|0;a[F+1112>>2]=mwa|0;a[F+1120>>2]=$va|0;a[F+1128>>2]=Ova|0;a[F+1136>>2]=Ava|0;a[F+1144>>2]=nva|0;a[F+1152>>2]=$ua|0;a[F+1160>>2]=Nua|0;a[F+1168>>2]=Bua|0;a[F+1176>>2]=rua|0;a[F+1184>>2]=hua|0;a[F+1192>>2]=$ta|0;a[F+1200>>2]=Pta|0;a[F+1208>>2]=Fta|0;a[F+1216>>2]=wta|0;a[F+1224>>2]=DB|0;a[F+1232>>2]=eta|0;a[F+1240>>2]=Vsa|0;a[F+1248>>2]=Msa|0;a[F+1256>>2]=Esa|0;a[F+1264>>2]=usa|0;a[F+1272>>2]=hsa|0;a[F+1280>>2]=$ra|0;a[F+1288>>2]=Pra|0;a[F+1296>>2]=Cra|0;a[F+1304>>2]=qra|0;a[F+1312>>2]=cra|0;a[F+1320>>2]=Rqa|0;a[F+1328>>2]=Fqa|0;a[F+1336>>2]=sqa|0;a[F+1344>>2]=dqa|0;a[F+1352>>2]=Ppa|0;a[F+1360>>2]=Apa|0;a[F+1368>>2]=npa|0;a[F+1376>>2]=bpa|0;a[F+1384>>2]=Ooa|0;a[F+1392>>2]=yoa|0;a[F+1400>>2]=moa|0;a[F+1408>>2]=$na|0;a[F+1416>>2]=Mna|0;a[F+1424>>2]=yna|0;a[F+1432>>2]=ina|0;a[F+1440>>2]=Vma|0;a[F+1448>>2]=Ima|0;a[F+1456>>2]=xma|0;a[F+1464>>2]=nma|0;a[F+1472>>2]=$la|0;a[F+1480>>2]=Sla|0;a[F+1488>>2]=Gla|0;a[F+1496>>2]=vla|0;a[F+1504>>2]=kla|0;a[F+1512>>2]=ala|0;a[F+1520>>2]=Qka|0;a[F+1528>>2]=Ika|0;a[F+1536>>2]=Aka|0;a[F+1544>>2]=uka|0;a[F+1552>>2]=kka|0;a[F+1560>>2]=aka|0;a[F+1568>>2]=Pja|0;a[F+1576>>2]=Gja|0;a[F+1584>>2]=vja|0;a[F+1592>>2]=lja|0;a[F+1600>>2]=aja|0;a[F+1608>>2]=Ria|0;a[F+1616>>2]=Fia|0;a[F+1624>>2]=xia|0;a[F+1632>>2]=mia|0;a[F+1640>>2]=bia|0;a[F+1648>>2]=Sha|0;a[F+1656>>2]=Iha|0;a[F+1664>>2]=nha|0;a[F+1672>>2]=lha|0;a[F+1680>>2]=$ga|0;a[F+1688>>2]=Sga|0;a[F+1696>>2]=Oga|0;a[F+1704>>2]=Mga|0;a[F+1712>>2]=Iga|0;a[F+1720>>2]=Gga|0;a[F+1728>>2]=Dga|0;a[F+1736>>2]=Bga|0;a[F+1744>>2]=yga|0;a[F+1752>>2]=tga|0;a[F+1760>>2]=qga|0;a[F+1768>>2]=oga|0;a[F+1776>>2]=mga|0;a[F+1784>>2]=kga|0;a[F+1792>>2]=fga|0;a[F+1800>>2]=cga|0;a[F+1808>>2]=aga|0;a[F+1816>>2]=Zfa|0;a[F+1824>>2]=Vfa|0;a[F+1832>>2]=Qfa|0;a[F+1840>>2]=Nfa|0;a[F+1848>>2]=Lfa|0;a[F+1856>>2]=Jfa|0;a[F+1864>>2]=Hfa|0;a[F+1872>>2]=Cfa|0;a[F+1880>>2]=Afa|0;a[F+1888>>2]=yfa|0;a[F+1896>>2]=wfa|0;a[F+1904>>2]=sfa|0;a[F+1912>>2]=nfa|0;a[F+1920>>2]=kfa|0;a[F+1928>>2]=ifa|0;a[F+1936>>2]=gfa|0;a[F+1944>>2]=efa|0;a[F+1952>>2]=afa|0;a[F+1960>>2]=Xea|0;a[F+1968>>2]=Uea|0;a[F+1976>>2]=Sea|0;a[F+1984>>2]=Pea|0;a[F+1992>>2]=Kea|0;a[F+2e3>>2]=Hea|0;a[F+2008>>2]=Fea|0;a[co>>2]=q5|0;a[co+4>>2]=Z4|0;a[e>>2]=Efa|0;a[e+12>>2]=wba|0;a[e+24>>2]=k9|0;a[e+36>>2]=u6|0;a[e+48>>2]=A3|0;a[e+60>>2]=M0|0;a[e+72>>2]=aZ|0;a[e+84>>2]=pW|0;a[e+96>>2]=aOa|0;a[e+108>>2]=vLa|0;a[e+120>>2]=QIa|0;a[e+132>>2]=iGa|0;a[e+144>>2]=FDa|0;a[e+156>>2]=iBa|0;a[e+168>>2]=Pya|0;a[e+180>>2]=hwa|0;a[e+192>>2]=Wta|0;a[e+204>>2]=gsa|0;a[e+216>>2]=Jpa|0;a[e+228>>2]=cna|0;a[e+240>>2]=Xka|0;a[e+252>>2]=gja|0;a[e+264>>2]=gha|0;a[e+276>>2]=sga|0;a[e+288>>2]=Pfa|0;a[e+300>>2]=mfa|0;a[e+312>>2]=Iea|0;a[e+324>>2]=nea|0;a[e+336>>2]=Rda|0;a[e+348>>2]=yda|0;a[e+360>>2]=fda|0;a[e+372>>2]=Kca|0;a[e+384>>2]=oca|0;a[e+396>>2]=Xba|0;a[e+408>>2]=Dba|0;a[e+420>>2]=iba|0;a[e+432>>2]=Raa|0;a[e+444>>2]=Aaa|0;a[e+456>>2]=jaa|0;a[e+468>>2]=T$|0;a[e+480>>2]=B$|0;a[e+492>>2]=k$|0;a[e+504>>2]=V9|0;a[e+516>>2]=H9|0;a[e+528>>2]=r9|0;a[e+540>>2]=b9|0;a[e+552>>2]=N8|0;a[e+564>>2]=x8|0;a[e+576>>2]=i8|0;a[e+588>>2]=T7|0;a[e+600>>2]=G7|0;a[e+612>>2]=r7|0;a[e+624>>2]=d7|0;a[e+636>>2]=Q6|0;a[e+648>>2]=B6|0;a[e+660>>2]=n6|0;a[e+672>>2]=Y5|0;a[e+684>>2]=I5|0;a[e+696>>2]=t5|0;a[e+708>>2]=b5|0;a[e+720>>2]=N4|0;a[e+732>>2]=z4|0;a[e+744>>2]=k4|0;a[e+756>>2]=X3|0;a[e+768>>2]=H3|0;a[e+780>>2]=r3|0;a[e+792>>2]=c3|0;a[e+804>>2]=P2|0;a[e+816>>2]=A2|0;a[e+828>>2]=j2|0;a[e+840>>2]=W1|0;a[e+852>>2]=I1|0;a[e+864>>2]=t1|0;a[e+876>>2]=g1|0;a[e+888>>2]=T0|0;a[e+900>>2]=F0|0;a[e+912>>2]=s0|0;a[e+924>>2]=f0|0;a[e+936>>2]=R_|0;a[e+948>>2]=B_|0;a[e+960>>2]=n_|0;a[e+972>>2]=YZ|0;a[e+984>>2]=IZ|0;a[e+996>>2]=vZ|0;a[e+1008>>2]=gZ|0;a[e+1020>>2]=SY|0;a[e+1032>>2]=EY|0;a[e+1044>>2]=qY|0;a[e+1056>>2]=bY|0;a[e+1068>>2]=NX|0;a[e+1080>>2]=zX|0;a[e+1092>>2]=kX|0;a[e+1104>>2]=XW|0;a[e+1116>>2]=JW|0;a[e+1128>>2]=vW|0;a[e+1140>>2]=hW|0;a[e+1152>>2]=VV|0;a[e+1164>>2]=IV|0;a[e+1176>>2]=LPa|0;a[e+1188>>2]=wPa|0;a[e+1200>>2]=jPa|0;a[e+1212>>2]=WOa|0;a[e+1224>>2]=HOa|0;a[e+1236>>2]=uOa|0;a[e+1248>>2]=gOa|0;a[e+1260>>2]=TNa|0;a[e+1272>>2]=GNa|0;a[e+1284>>2]=tNa|0;a[e+1296>>2]=gNa|0;a[e+1308>>2]=RMa|0;a[e+1320>>2]=DMa|0;a[e+1332>>2]=qMa|0;a[e+1344>>2]=dMa|0;a[e+1356>>2]=QLa|0;a[e+1368>>2]=BLa|0;a[e+1380>>2]=nLa|0;a[e+1392>>2]=aLa|0;a[e+1404>>2]=OKa|0;a[e+1416>>2]=BKa|0;a[e+1428>>2]=nKa|0;a[e+1440>>2]=aKa|0;a[e+1452>>2]=NJa|0;a[e+1464>>2]=zJa|0;a[e+1476>>2]=kJa|0;a[e+1488>>2]=XIa|0;a[e+1500>>2]=JIa|0;a[e+1512>>2]=wIa|0;a[e+1524>>2]=jIa|0;a[e+1536>>2]=VHa|0;a[e+1548>>2]=HHa|0;a[e+1560>>2]=tHa|0;a[e+1572>>2]=gHa|0;a[e+1584>>2]=UGa|0;a[e+1596>>2]=GGa|0;a[e+1608>>2]=pGa|0;a[e+1620>>2]=aGa|0;a[e+1632>>2]=NFa|0;a[e+1644>>2]=AFa|0;a[e+1656>>2]=mFa|0;a[e+1668>>2]=ZEa|0;a[e+1680>>2]=MEa|0;a[e+1692>>2]=yEa|0;a[e+1704>>2]=lEa|0;a[e+1716>>2]=$Da|0;a[e+1728>>2]=MDa|0;a[e+1740>>2]=zDa|0;a[e+1752>>2]=mDa|0;a[e+1764>>2]=ZCa|0;a[e+1776>>2]=MCa|0;a[e+1788>>2]=yCa|0;a[e+1800>>2]=mCa|0;a[e+1812>>2]=$Ba|0;a[e+1824>>2]=OBa|0;a[e+1836>>2]=CBa|0;a[e+1848>>2]=pBa|0;a[e+1860>>2]=cBa|0;a[e+1872>>2]=RAa|0;a[e+1884>>2]=FAa|0;a[e+1896>>2]=rAa|0;a[e+1908>>2]=dAa|0;a[e+1920>>2]=Sza|0;a[e+1932>>2]=Gza|0;a[e+1944>>2]=vza|0;a[e+1956>>2]=jza|0;a[e+1968>>2]=Wya|0;a[e+1980>>2]=Jya|0;a[e+1992>>2]=wya|0;a[e+2004>>2]=iya|0;a[e+2016>>2]=Uxa|0;a[e+2028>>2]=Gxa|0;a[e+2040>>2]=sxa|0;a[e+2052>>2]=exa|0;a[e+2064>>2]=Qwa|0;a[e+2076>>2]=Cwa|0;a[e+2088>>2]=owa|0;a[e+2100>>2]=bwa|0;a[e+2112>>2]=Qva|0;a[e+2124>>2]=Dva|0;a[e+2136>>2]=pva|0;a[e+2148>>2]=bva|0;a[e+2160>>2]=Pua|0;a[e+2172>>2]=Cua|0;a[e+2184>>2]=sua|0;a[e+2196>>2]=iua|0;a[e+2208>>2]=aua|0;a[e+2220>>2]=Qta|0;a[e+2232>>2]=Gta|0;a[e+2244>>2]=xta|0;a[e+2256>>2]=nta|0;a[e+2268>>2]=fta|0;a[e+2280>>2]=Wsa|0;a[e+2292>>2]=Nsa|0;a[e+2304>>2]=Fsa|0;a[e+2316>>2]=vsa|0;a[e+2328>>2]=isa|0;a[e+2340>>2]=asa|0;a[e+2352>>2]=Qra|0;a[e+2364>>2]=Era|0;a[e+2376>>2]=rra|0;a[e+2388>>2]=dra|0;a[e+2400>>2]=Sqa|0;a[e+2412>>2]=Gqa|0;a[e+2424>>2]=tqa|0;a[e+2436>>2]=eqa|0;a[e+2448>>2]=Qpa|0;a[e+2460>>2]=Bpa|0;a[e+2472>>2]=opa|0;a[e+2484>>2]=cpa|0;a[e+2496>>2]=Poa|0;a[e+2508>>2]=zoa|0;a[e+2520>>2]=noa|0;a[e+2532>>2]=aoa|0;a[e+2544>>2]=Nna|0;a[e+2556>>2]=zna|0;a[e+2568>>2]=jna|0;a[e+2580>>2]=Wma|0;a[e+2592>>2]=Jma|0;a[e+2604>>2]=yma|0;a[e+2616>>2]=oma|0;a[e+2628>>2]=bma|0;a[e+2640>>2]=Tla|0;a[e+2652>>2]=Hla|0;a[e+2664>>2]=wla|0;a[e+2676>>2]=lla|0;a[e+2688>>2]=bla|0;a[e+2700>>2]=Rka|0;a[e+2712>>2]=Jka|0;a[e+2724>>2]=Bka|0;a[e+2736>>2]=vka|0;a[e+2748>>2]=lka|0;a[e+2760>>2]=cka|0;a[e+2772>>2]=Qja|0;a[e+2784>>2]=Hja|0;a[e+2796>>2]=wja|0;a[e+2808>>2]=mja|0;a[e+2820>>2]=bja|0;a[e+2832>>2]=Sia|0;a[e+2844>>2]=Hia|0;a[e+2856>>2]=yia|0;a[e+2868>>2]=nia|0;a[e+2880>>2]=cia|0;a[e+2892>>2]=Tha|0;a[e+2904>>2]=Jha|0;a[e+2916>>2]=yha|0;a[e+2928>>2]=mha|0;a[e+2940>>2]=aha|0;a[e+2952>>2]=Tga|0;a[e+2964>>2]=Pga|0;a[e+2976>>2]=Nga|0;a[e+2988>>2]=Jga|0;a[e+3e3>>2]=Hga|0;a[e+3012>>2]=Ega|0;a[e+3024>>2]=Cga|0;a[e+3036>>2]=zga|0;a[e+3048>>2]=uga|0;a[e+3060>>2]=rga|0;a[e+3072>>2]=pga|0;a[e+3084>>2]=nga|0;a[e+3096>>2]=lga|0;a[e+3108>>2]=gga|0;a[e+3120>>2]=dga|0;a[e+3132>>2]=bga|0;a[e+3144>>2]=$fa|0;a[e+3156>>2]=Wfa|0;a[e+3168>>2]=Rfa|0;a[e+3180>>2]=Ofa|0;a[e+3192>>2]=Mfa|0;a[e+3204>>2]=Kfa|0;a[e+3216>>2]=Ifa|0;a[e+3228>>2]=Dfa|0;a[e+3240>>2]=Bfa|0;a[e+3252>>2]=zfa|0;a[e+3264>>2]=xfa|0;a[e+3276>>2]=tfa|0;a[e+3288>>2]=ofa|0;a[e+3300>>2]=lfa|0;a[e+3312>>2]=jfa|0;a[e+3324>>2]=hfa|0;a[e+3336>>2]=ffa|0;a[e+3348>>2]=bfa|0;a[e+3360>>2]=Yea|0;a[e+3372>>2]=Wea|0;a[e+3384>>2]=Tea|0;a[e+3396>>2]=Rea|0;a[e+3408>>2]=Oea|0;a[e+3420>>2]=Jea|0;a[e+3432>>2]=Gea|0;a[e+3444>>2]=Eea|0;a[e+3456>>2]=Dea|0;a[e+3468>>2]=Cea|0;a[e+3480>>2]=zea|0;a[e+3492>>2]=yea|0;a[e+3504>>2]=wea|0;a[e+3516>>2]=uea|0;a[e+3528>>2]=sea|0;a[e+3540>>2]=oea|0;a[e+3552>>2]=mea|0;a[e+3564>>2]=lea|0;a[e+3576>>2]=kea|0;a[e+3588>>2]=jea|0;a[e+3600>>2]=fea|0;a[e+3612>>2]=bea|0;a[e+3624>>2]=$da|0;a[e+3636>>2]=Zda|0;a[e+3648>>2]=Wda|0;a[e+3660>>2]=Sda|0;a[e+3672>>2]=Qda|0;a[e+3684>>2]=Pda|0;a[e+3696>>2]=Oda|0;a[e+3708>>2]=Nda|0;a[e+3720>>2]=Kda|0;a[e+3732>>2]=Ida|0;a[e+3744>>2]=Hda|0;a[e+3756>>2]=Gda|0;a[e+3768>>2]=Dda|0;a[e+3780>>2]=zda|0;a[e+3792>>2]=xda|0;a[e+3804>>2]=wda|0;a[e+3816>>2]=vda|0;a[e+3828>>2]=uda|0;a[e+3840>>2]=rda|0;a[e+3852>>2]=qda|0;a[e+3864>>2]=oda|0;a[e+3876>>2]=nda|0;a[e+3888>>2]=lda|0;a[e+3900>>2]=gda|0;a[e+3912>>2]=eda|0;a[e+3924>>2]=dda|0;a[e+3936>>2]=cda|0;a[e+3948>>2]=bda|0;a[e+3960>>2]=Zca|0;a[e+3972>>2]=Wca|0;a[e+3984>>2]=Tca|0;a[e+3996>>2]=Sca|0;a[e+4008>>2]=Pca|0;a[e+4020>>2]=Mca|0;a[e+4032>>2]=Jca|0;a[e+4044>>2]=Ica|0;a[e+4056>>2]=Hca|0;a[e+4068>>2]=Fca|0;a[e+4080>>2]=Cca|0;a[e+4092>>2]=Aca|0;a[e+4104>>2]=xca|0;a[e+4116>>2]=vca|0;a[e+4128>>2]=sca|0;a[e+4140>>2]=pca|0;a[e+4152>>2]=nca|0;a[e+4164>>2]=mca|0;a[e+4176>>2]=lca|0;a[e+4188>>2]=kca|0;a[e+4200>>2]=hca|0;a[e+4212>>2]=gca|0;a[e+4224>>2]=eca|0;a[e+4236>>2]=dca|0;a[e+4248>>2]=aca|0;a[e+4260>>2]=Yba|0;a[e+4272>>2]=Wba|0;a[e+4284>>2]=Vba|0;a[e+4296>>2]=Uba|0;a[e+4308>>2]=Tba|0;a[e+4320>>2]=Qba|0;a[e+4332>>2]=Oba|0;a[e+4344>>2]=Lba|0;a[e+4356>>2]=Jba|0;a[e+4368>>2]=Hba|0;a[e+4380>>2]=Eba|0;a[e+4392>>2]=Cba|0;a[e+4404>>2]=Bba|0;a[e+4416>>2]=Aba|0;a[e+4428>>2]=zba|0;a[e+4440>>2]=xba|0;a[e+4452>>2]=uba|0;a[e+4464>>2]=rba|0;a[e+4476>>2]=pba|0;a[e+4488>>2]=nba|0;a[e+4500>>2]=jba|0;a[e+4512>>2]=hba|0;a[e+4524>>2]=gba|0;a[e+4536>>2]=eba|0;a[e+4548>>2]=dba|0;a[e+4560>>2]=bba|0;a[e+4572>>2]=aba|0;a[e+4584>>2]=Yaa|0;a[e+4596>>2]=Xaa|0;a[e+4608>>2]=Vaa|0;a[e+4620>>2]=Saa|0;a[e+4632>>2]=Qaa|0;a[e+4644>>2]=Paa|0;a[e+4656>>2]=Oaa|0;a[e+4668>>2]=Naa|0;a[e+4680>>2]=Laa|0;a[e+4692>>2]=Kaa|0;a[e+4704>>2]=Haa|0;a[e+4716>>2]=Gaa|0;a[e+4728>>2]=Eaa|0;a[e+4740>>2]=Baa|0;a[e+4752>>2]=zaa|0;a[e+4764>>2]=yaa|0;a[e+4776>>2]=xaa|0;a[e+4788>>2]=waa|0;a[e+4800>>2]=uaa|0;a[e+4812>>2]=saa|0;a[e+4824>>2]=paa|0;a[e+4836>>2]=oaa|0;a[e+4848>>2]=naa|0;a[e+4860>>2]=kaa|0;a[e+4872>>2]=iaa|0;a[e+4884>>2]=haa|0;a[e+4896>>2]=gaa|0;a[e+4908>>2]=faa|0;a[e+4920>>2]=caa|0;a[e+4932>>2]=aaa|0;a[e+4944>>2]=Z$|0;a[e+4956>>2]=Y$|0;a[e+4968>>2]=X$|0;a[e+4980>>2]=U$|0;a[e+4992>>2]=S$|0;a[e+5004>>2]=R$|0;a[e+5016>>2]=Q$|0;a[e+5028>>2]=P$|0;a[e+5040>>2]=N$|0;a[e+5052>>2]=M$|0;a[e+5064>>2]=J$|0;a[e+5076>>2]=I$|0;a[e+5088>>2]=H$|0;a[e+5100>>2]=E$|0;a[e+5112>>2]=A$|0;a[e+5124>>2]=z$|0;a[e+5136>>2]=y$|0;a[e+5148>>2]=w$|0;a[e+5160>>2]=u$|0;a[e+5172>>2]=t$|0;a[e+5184>>2]=q$|0;a[e+5196>>2]=p$|0;a[e+5208>>2]=o$|0;a[e+5220>>2]=l$|0;a[e+5232>>2]=j$|0;a[e+5244>>2]=i$|0;a[e+5256>>2]=h$|0;a[e+5268>>2]=g$|0;a[e+5280>>2]=d$|0;a[e+5292>>2]=c$|0;a[e+5304>>2]=$9|0;a[e+5316>>2]=Z9|0;a[e+5328>>2]=Y9|0;a[e+5340>>2]=W9|0;a[e+5352>>2]=U9|0;a[e+5364>>2]=T9|0;a[e+5376>>2]=S9|0;a[e+5388>>2]=R9|0;a[e+5400>>2]=P9|0;a[e+5412>>2]=O9|0;a[e+5424>>2]=M9|0;a[e+5436>>2]=L9|0;a[e+5448>>2]=K9|0;a[e+5460>>2]=I9|0;a[e+5472>>2]=G9|0;a[e+5484>>2]=F9|0;a[e+5496>>2]=E9|0;a[e+5508>>2]=D9|0;a[e+5520>>2]=B9|0;a[e+5532>>2]=z9|0;a[e+5544>>2]=w9|0;a[e+5556>>2]=v9|0;a[e+5568>>2]=u9|0;a[e+5580>>2]=s9|0;a[e+5592>>2]=q9|0;a[e+5604>>2]=p9|0;a[e+5616>>2]=o9|0;a[e+5628>>2]=n9|0;a[e+5640>>2]=l9|0;a[e+5652>>2]=j9|0;a[e+5664>>2]=h9|0;a[e+5676>>2]=g9|0;a[e+5688>>2]=f9|0;a[e+5700>>2]=d9|0;a[e+5712>>2]=a9|0;a[e+5724>>2]=$8|0;a[e+5736>>2]=Z8|0;a[e+5748>>2]=Y8|0;a[e+5760>>2]=W8|0;a[e+5772>>2]=V8|0;a[e+5784>>2]=S8|0;a[e+5796>>2]=R8|0;a[e+5808>>2]=Q8|0;a[e+5820>>2]=O8|0;a[e+5832>>2]=M8|0;a[e+5844>>2]=L8|0;a[e+5856>>2]=K8|0;a[e+5868>>2]=J8|0;a[e+5880>>2]=H8|0;a[e+5892>>2]=G8|0;a[e+5904>>2]=D8|0;a[e+5916>>2]=C8|0;a[e+5928>>2]=A8|0;a[e+5940>>2]=y8|0;a[e+5952>>2]=w8|0;a[e+5964>>2]=v8|0;a[e+5976>>2]=u8|0;a[e+5988>>2]=t8|0;a[e+6e3>>2]=r8|0;a[e+6012>>2]=q8|0;a[e+6024>>2]=n8|0;a[e+6036>>2]=m8|0;a[e+6048>>2]=l8|0;a[e+6060>>2]=j8|0;a[e+6072>>2]=h8|0;a[e+6084>>2]=g8|0;a[e+6096>>2]=f8|0;a[e+6108>>2]=e8|0;a[e+6120>>2]=b8|0;a[e+6132>>2]=a8|0;a[e+6144>>2]=Z7|0;a[e+6156>>2]=Y7|0;a[e+6168>>2]=W7|0;a[e+6180>>2]=U7|0;a[e+6192>>2]=S7|0;a[e+6204>>2]=R7|0;a[e+6216>>2]=Q7|0;a[e+6228>>2]=P7|0;a[e+6240>>2]=N7|0;a[e+6252>>2]=M7|0;a[e+6264>>2]=K7|0;a[e+6276>>2]=J7|0;a[e+6288>>2]=I7|0;a[e+6300>>2]=H7|0;a[e+6312>>2]=F7|0;a[e+6324>>2]=E7|0;a[e+6336>>2]=D7|0;a[e+6348>>2]=B7|0;a[e+6360>>2]=z7|0;a[e+6372>>2]=y7|0;a[e+6384>>2]=v7|0;a[e+6396>>2]=u7|0;a[e+6408>>2]=t7|0;a[e+6420>>2]=s7|0;a[e+6432>>2]=q7|0;a[e+6444>>2]=p7|0;a[e+6456>>2]=o7|0;a[e+6468>>2]=n7|0;a[e+6480>>2]=l7|0;a[e+6492>>2]=j7|0;a[e+6504>>2]=h7|0;a[e+6516>>2]=g7|0;a[e+6528>>2]=f7|0;a[e+6540>>2]=e7|0;a[e+6552>>2]=c7|0;a[e+6564>>2]=b7|0;a[e+6576>>2]=a7|0;a[e+6588>>2]=$6|0;a[e+6600>>2]=Y6|0;a[e+6612>>2]=X6|0;a[e+6624>>2]=U6|0;a[e+6636>>2]=T6|0;a[e+6648>>2]=S6|0;a[e+6660>>2]=R6|0;a[e+6672>>2]=P6|0;a[e+6684>>2]=O6|0;a[e+6696>>2]=N6|0;a[e+6708>>2]=M6|0;a[e+6720>>2]=K6|0;a[e+6732>>2]=I6|0;a[e+6744>>2]=F6|0;a[e+6756>>2]=E6|0;a[e+6768>>2]=D6|0;a[e+6780>>2]=C6|0;a[e+6792>>2]=A6|0;a[e+6804>>2]=z6|0;a[e+6816>>2]=y6|0;a[e+6828>>2]=x6|0;a[e+6840>>2]=v6|0;a[e+6852>>2]=t6|0;a[e+6864>>2]=r6|0;a[e+6876>>2]=q6|0;a[e+6888>>2]=p6|0;a[e+6900>>2]=o6|0;a[e+6912>>2]=m6|0;a[e+6924>>2]=k6|0;a[e+6936>>2]=j6|0;a[e+6948>>2]=i6|0;a[e+6960>>2]=g6|0;a[e+6972>>2]=f6|0;a[e+6984>>2]=d6|0;a[e+6996>>2]=b6|0;a[e+7008>>2]=a6|0;a[e+7020>>2]=Z5|0;a[e+7032>>2]=X5|0;a[e+7044>>2]=W5|0;a[e+7056>>2]=V5|0;a[e+7068>>2]=U5|0;a[e+7080>>2]=S5|0;a[e+7092>>2]=R5|0;a[e+7104>>2]=P5|0;a[e+7116>>2]=N5|0;a[e+7128>>2]=L5|0;a[e+7140>>2]=J5|0;a[e+7152>>2]=H5|0;a[e+7164>>2]=G5|0;a[e+7176>>2]=F5|0;a[e+7188>>2]=E5|0;a[e+7200>>2]=C5|0;a[e+7212>>2]=B5|0;a[e+7224>>2]=z5|0;a[e+7236>>2]=x5|0;a[e+7248>>2]=v5|0;a[e+7260>>2]=u5|0;a[e+7272>>2]=s5|0;a[e+7284>>2]=r5|0;a[e+7296>>2]=p5|0;a[e+7308>>2]=o5|0;a[e+7320>>2]=l5|0;a[e+7332>>2]=k5|0;a[e+7344>>2]=i5|0;a[e+7356>>2]=g5|0;a[e+7368>>2]=e5|0;a[e+7380>>2]=d5|0;a[e+7392>>2]=a5|0;a[e+7404>>2]=$4|0;a[e+7416>>2]=Y4|0;a[e+7428>>2]=X4|0;a[e+7440>>2]=V4|0;a[e+7452>>2]=U4|0;a[e+7464>>2]=S4|0;a[e+7476>>2]=Q4|0;a[e+7488>>2]=P4|0;a[e+7500>>2]=O4|0;a[e+7512>>2]=M4|0;a[e+7524>>2]=L4|0;a[e+7536>>2]=K4|0;a[e+7548>>2]=I4|0;a[e+7560>>2]=G4|0;a[e+7572>>2]=F4|0;a[e+7584>>2]=D4|0;a[e+7596>>2]=C4|0;a[e+7608>>2]=B4|0;a[e+7620>>2]=A4|0;a[e+7632>>2]=y4|0;a[e+7644>>2]=x4|0;a[e+7656>>2]=w4|0;a[e+7668>>2]=v4|0;a[e+7680>>2]=t4|0;a[e+7692>>2]=s4|0;a[e+7704>>2]=p4|0;a[e+7716>>2]=o4|0;a[e+7728>>2]=m4|0;a[e+7740>>2]=l4|0;a[e+7752>>2]=j4|0;a[e+7764>>2]=i4|0;a[e+7776>>2]=h4|0;a[e+7788>>2]=g4|0;a[e+7800>>2]=e4|0;a[e+7812>>2]=d4|0;a[e+7824>>2]=b4|0;a[e+7836>>2]=a4|0;a[e+7848>>2]=$3|0;a[e+7860>>2]=Y3|0;a[e+7872>>2]=W3|0;a[e+7884>>2]=V3|0;a[e+7896>>2]=U3|0;a[e+7908>>2]=T3|0;a[e+7920>>2]=R3|0;a[e+7932>>2]=P3|0;a[e+7944>>2]=N3|0;a[e+7956>>2]=M3|0;a[e+7968>>2]=L3|0;a[e+7980>>2]=I3|0;a[e+7992>>2]=G3|0;a[e+8004>>2]=F3|0;a[e+8016>>2]=E3|0;a[e+8028>>2]=D3|0;a[e+8040>>2]=B3|0;a[e+8052>>2]=z3|0;a[e+8064>>2]=x3|0;a[e+8076>>2]=w3|0;a[e+8088>>2]=v3|0;a[e+8100>>2]=s3|0;a[e+8112>>2]=q3|0;a[e+8124>>2]=p3|0;a[e+8136>>2]=n3|0;a[e+8148>>2]=m3|0;a[e+8160>>2]=k3|0;a[e+8172>>2]=j3|0;a[e+8184>>2]=h3|0;a[e+8196>>2]=g3|0;a[e+8208>>2]=f3|0;a[e+8220>>2]=d3|0;a[e+8232>>2]=b3|0;a[e+8244>>2]=a3|0;a[e+8256>>2]=$2|0;a[e+8268>>2]=Z2|0;a[e+8280>>2]=X2|0;a[e+8292>>2]=W2|0;a[e+8304>>2]=U2|0;a[e+8316>>2]=T2|0;a[e+8328>>2]=S2|0;a[e+8340>>2]=Q2|0;a[e+8352>>2]=O2|0;a[e+8364>>2]=N2|0;a[e+8376>>2]=L2|0;a[e+8388>>2]=K2|0;a[e+8400>>2]=I2|0;a[e+8412>>2]=H2|0;a[e+8424>>2]=F2|0;a[e+8436>>2]=E2|0;a[e+8448>>2]=D2|0;a[e+8460>>2]=B2|0;a[e+8472>>2]=z2|0;a[e+8484>>2]=y2|0;a[e+8496>>2]=x2|0;a[e+8508>>2]=w2|0;a[e+8520>>2]=s2|0;a[e+8532>>2]=r2|0;a[e+8544>>2]=o2|0;a[e+8556>>2]=n2|0;a[e+8568>>2]=m2|0;a[e+8580>>2]=k2|0;a[e+8592>>2]=i2|0;a[e+8604>>2]=h2|0;a[e+8616>>2]=g2|0;a[e+8628>>2]=f2|0;a[e+8640>>2]=d2|0;a[e+8652>>2]=c2|0;a[e+8664>>2]=a2|0;a[e+8676>>2]=$1|0;a[e+8688>>2]=Z1|0;a[e+8700>>2]=X1|0;a[e+8712>>2]=V1|0;a[e+8724>>2]=U1|0;a[e+8736>>2]=T1|0;a[e+8748>>2]=R1|0;a[e+8760>>2]=P1|0;a[e+8772>>2]=O1|0;a[e+8784>>2]=M1|0;a[e+8796>>2]=L1|0;a[e+8808>>2]=K1|0;a[e+8820>>2]=J1|0;a[e+8832>>2]=H1|0;a[e+8844>>2]=G1|0;a[e+8856>>2]=F1|0;a[e+8868>>2]=E1|0;a[e+8880>>2]=C1|0;a[e+8892>>2]=A1|0;a[e+8904>>2]=y1|0;a[e+8916>>2]=w1|0;a[e+8928>>2]=v1|0;a[e+8940>>2]=u1|0;a[e+8952>>2]=s1|0;a[e+8964>>2]=r1|0;a[e+8976>>2]=q1|0;a[e+8988>>2]=p1|0;a[e+9e3>>2]=n1|0;a[e+9012>>2]=m1|0;a[e+9024>>2]=k1|0;a[e+9036>>2]=j1|0;a[e+9048>>2]=i1|0;a[e+9060>>2]=h1|0;a[e+9072>>2]=f1|0;a[e+9084>>2]=e1|0;a[e+9096>>2]=d1|0;a[e+9108>>2]=c1|0;a[e+9120>>2]=a1|0;a[e+9132>>2]=Z0|0;a[e+9144>>2]=X0|0;a[e+9156>>2]=W0|0;a[e+9168>>2]=V0|0;a[e+9180>>2]=U0|0;a[e+9192>>2]=S0|0;a[e+9204>>2]=R0|0;a[e+9216>>2]=Q0|0;a[e+9228>>2]=P0|0;a[e+9240>>2]=N0|0;a[e+9252>>2]=L0|0;a[e+9264>>2]=J0|0;a[e+9276>>2]=I0|0;a[e+9288>>2]=H0|0;a[e+9300>>2]=G0|0;a[e+9312>>2]=E0|0;a[e+9324>>2]=D0|0;a[e+9336>>2]=C0|0;a[e+9348>>2]=B0|0;a[e+9360>>2]=z0|0;a[e+9372>>2]=y0|0;a[e+9384>>2]=w0|0;a[e+9396>>2]=v0|0;a[e+9408>>2]=u0|0;a[e+9420>>2]=t0|0;a[e+9432>>2]=r0|0;a[e+9444>>2]=q0|0;a[e+9456>>2]=p0|0;a[e+9468>>2]=o0|0;a[e+9480>>2]=m0|0;a[e+9492>>2]=l0|0;a[e+9504>>2]=j0|0;a[e+9516>>2]=i0|0;a[e+9528>>2]=h0|0;a[e+9540>>2]=g0|0;a[e+9552>>2]=e0|0;a[e+9564>>2]=d0|0;a[e+9576>>2]=b0|0;a[e+9588>>2]=a0|0;a[e+9600>>2]=Z_|0;a[e+9612>>2]=Y_|0;a[e+9624>>2]=W_|0;a[e+9636>>2]=V_|0;a[e+9648>>2]=T_|0;a[e+9660>>2]=S_|0;a[e+9672>>2]=Q_|0;a[e+9684>>2]=P_|0;a[e+9696>>2]=O_|0;a[e+9708>>2]=N_|0;a[e+9720>>2]=L_|0;a[e+9732>>2]=J_|0;a[e+9744>>2]=G_|0;a[e+9756>>2]=F_|0;a[e+9768>>2]=D_|0;a[e+9780>>2]=C_|0;a[e+9792>>2]=A_|0;a[e+9804>>2]=z_|0;a[e+9816>>2]=y_|0;a[e+9828>>2]=x_|0;a[e+9840>>2]=v_|0;a[e+9852>>2]=u_|0;a[e+9864>>2]=s_|0;a[e+9876>>2]=r_|0;a[e+9888>>2]=p_|0;a[e+9900>>2]=o_|0;a[e+9912>>2]=m_|0;a[e+9924>>2]=l_|0;a[e+9936>>2]=k_|0;a[e+9948>>2]=i_|0;a[e+9960>>2]=g_|0;a[e+9972>>2]=f_|0;a[e+9984>>2]=d_|0;a[e+9996>>2]=c_|0;a[e+10008>>2]=a_|0;a[e+10020>>2]=$Z|0;a[e+10032>>2]=ZZ|0;a[e+10044>>2]=XZ|0;a[e+10056>>2]=WZ|0;a[e+10068>>2]=VZ|0;a[e+10080>>2]=TZ|0;a[e+10092>>2]=SZ|0;a[e+10104>>2]=QZ|0;a[e+10116>>2]=PZ|0;a[e+10128>>2]=MZ|0;a[e+10140>>2]=LZ|0;a[e+10152>>2]=KZ|0;a[e+10164>>2]=HZ|0;a[e+10176>>2]=GZ|0;a[e+10188>>2]=FZ|0;a[e+10200>>2]=DZ|0;a[e+10212>>2]=CZ|0;a[e+10224>>2]=AZ|0;a[e+10236>>2]=zZ|0;a[e+10248>>2]=yZ|0;a[e+10260>>2]=xZ|0;a[e+10272>>2]=wZ|0;a[e+10284>>2]=uZ|0;a[e+10296>>2]=tZ|0;a[e+10308>>2]=sZ|0;a[e+10320>>2]=qZ|0;a[e+10332>>2]=oZ|0;a[e+10344>>2]=mZ|0;a[e+10356>>2]=lZ|0;a[e+10368>>2]=jZ|0;a[e+10380>>2]=iZ|0;a[e+10392>>2]=hZ|0;a[e+10404>>2]=fZ|0;a[e+10416>>2]=eZ|0;a[e+10428>>2]=dZ|0;a[e+10440>>2]=cZ|0;a[e+10452>>2]=$Y|0;a[e+10464>>2]=YY|0;a[e+10476>>2]=XY|0;a[e+10488>>2]=VY|0;a[e+10500>>2]=UY|0;a[e+10512>>2]=TY|0;a[e+10524>>2]=RY|0;a[e+10536>>2]=QY|0;a[e+10548>>2]=PY|0;a[e+10560>>2]=OY|0;a[e+10572>>2]=MY|0;a[e+10584>>2]=KY|0;a[e+10596>>2]=JY|0;a[e+10608>>2]=HY|0;a[e+10620>>2]=GY|0;a[e+10632>>2]=FY|0;a[e+10644>>2]=DY|0;a[e+10656>>2]=CY|0;a[e+10668>>2]=BY|0;a[e+10680>>2]=AY|0;a[e+10692>>2]=yY|0;a[e+10704>>2]=wY|0;a[e+10716>>2]=vY|0;a[e+10728>>2]=tY|0;a[e+10740>>2]=sY|0;a[e+10752>>2]=rY|0;a[e+10764>>2]=pY|0;a[e+10776>>2]=nY|0;a[e+10788>>2]=mY|0;a[e+10800>>2]=lY|0;a[e+10812>>2]=jY|0;a[e+10824>>2]=hY|0;a[e+10836>>2]=gY|0;a[e+10848>>2]=eY|0;a[e+10860>>2]=dY|0;a[e+10872>>2]=cY|0;a[e+10884>>2]=aY|0;a[e+10896>>2]=$X|0;a[e+10908>>2]=ZX|0;a[e+10920>>2]=YX|0;a[e+10932>>2]=VX|0;a[e+10944>>2]=TX|0;a[e+10956>>2]=SX|0;a[e+10968>>2]=QX|0;a[e+10980>>2]=PX|0;a[e+10992>>2]=OX|0;a[e+11004>>2]=MX|0;a[e+11016>>2]=LX|0;a[e+11028>>2]=KX|0;a[e+11040>>2]=JX|0;a[e+11052>>2]=HX|0;a[e+11064>>2]=FX|0;a[e+11076>>2]=EX|0;a[e+11088>>2]=CX|0;a[e+11100>>2]=BX|0;a[e+11112>>2]=AX|0;a[e+11124>>2]=yX|0;a[e+11136>>2]=xX|0;a[e+11148>>2]=vX|0;a[e+11160>>2]=uX|0;a[e+11172>>2]=sX|0;a[e+11184>>2]=qX|0;a[e+11196>>2]=pX|0;a[e+11208>>2]=nX|0;a[e+11220>>2]=mX|0;a[e+11232>>2]=lX|0;a[e+11244>>2]=jX|0;a[e+11256>>2]=iX|0;a[e+11268>>2]=hX|0;a[e+11280>>2]=gX|0;a[e+11292>>2]=eX|0;a[e+11304>>2]=cX|0;a[e+11316>>2]=bX|0;a[e+11328>>2]=aX|0;a[e+11340>>2]=ZW|0;a[e+11352>>2]=YW|0;a[e+11364>>2]=VW|0;a[e+11376>>2]=UW|0;a[e+11388>>2]=TW|0;a[e+11400>>2]=SW|0;a[e+11412>>2]=QW|0;a[e+11424>>2]=OW|0;a[e+11436>>2]=NW|0;a[e+11448>>2]=MW|0;a[e+11460>>2]=LW|0;a[e+11472>>2]=KW|0;a[e+11484>>2]=IW|0;a[e+11496>>2]=HW|0;a[e+11508>>2]=GW|0;a[e+11520>>2]=FW|0;a[e+11532>>2]=CW|0;a[e+11544>>2]=AW|0;a[e+11556>>2]=zW|0;a[e+11568>>2]=yW|0;a[e+11580>>2]=xW|0;a[e+11592>>2]=wW|0;a[e+11604>>2]=uW|0;a[e+11616>>2]=tW|0;a[e+11628>>2]=sW|0;a[e+11640>>2]=rW|0;a[e+11652>>2]=oW|0;a[e+11664>>2]=mW|0;a[e+11676>>2]=lW|0;a[e+11688>>2]=kW|0;a[e+11700>>2]=jW|0;a[e+11712>>2]=iW|0;a[e+11724>>2]=gW|0;a[e+11736>>2]=fW|0;a[e+11748>>2]=eW|0;a[e+11760>>2]=dW|0;a[e+11772>>2]=bW|0;a[e+11784>>2]=$V|0;a[e+11796>>2]=ZV|0;a[e+11808>>2]=YV|0;a[e+11820>>2]=XV|0;a[e+11832>>2]=WV|0;a[e+11844>>2]=UV|0;a[e+11856>>2]=TV|0;a[e+11868>>2]=SV|0;a[e+11880>>2]=RV|0;a[e+11892>>2]=PV|0;a[e+11904>>2]=NV|0;a[e+11916>>2]=MV|0;a[e+11928>>2]=LV|0;a[e+11940>>2]=KV|0;a[e+11952>>2]=JV|0;a[e+11964>>2]=HV|0;a[e+11976>>2]=WPa|0;a[e+11988>>2]=VPa|0;a[e+12e3>>2]=UPa|0;a[e+12012>>2]=SPa|0;a[e+12024>>2]=QPa|0;a[e+12036>>2]=PPa|0;a[e+12048>>2]=OPa|0;a[e+12060>>2]=NPa|0;a[e+12072>>2]=MPa|0;a[e+12084>>2]=KPa|0;a[e+12096>>2]=JPa|0;a[e+12108>>2]=IPa|0;a[e+12120>>2]=HPa|0;a[e+12132>>2]=EPa|0;a[e+12144>>2]=CPa|0;a[e+12156>>2]=APa|0;a[e+12168>>2]=zPa|0;a[e+12180>>2]=yPa|0;a[e+12192>>2]=xPa|0;a[e+12204>>2]=vPa|0;a[e+12216>>2]=uPa|0;a[e+12228>>2]=tPa|0;a[e+12240>>2]=sPa|0;a[e+12252>>2]=qPa|0;a[e+12264>>2]=oPa|0;a[e+12276>>2]=nPa|0;a[e+12288>>2]=mPa|0;a[e+12300>>2]=lPa|0;a[e+12312>>2]=kPa|0;a[e+12324>>2]=iPa|0;a[e+12336>>2]=hPa|0;a[e+12348>>2]=fPa|0;a[e+12360>>2]=ePa|0;a[e+12372>>2]=cPa|0;a[e+12384>>2]=aPa|0;a[e+12396>>2]=$Oa|0;a[e+12408>>2]=ZOa|0;a[e+12420>>2]=YOa|0;a[e+12432>>2]=XOa|0;a[e+12444>>2]=VOa|0;a[e+12456>>2]=UOa|0;a[e+12468>>2]=TOa|0;a[e+12480>>2]=SOa|0;a[e+12492>>2]=QOa|0;a[e+12504>>2]=OOa|0;a[e+12516>>2]=NOa|0;a[e+12528>>2]=MOa|0;a[e+12540>>2]=LOa|0;a[e+12552>>2]=IOa|0;a[e+12564>>2]=GOa|0;a[e+12576>>2]=FOa|0;a[e+12588>>2]=EOa|0;a[e+12600>>2]=DOa|0;a[e+12612>>2]=BOa|0;a[e+12624>>2]=zOa|0;a[e+12636>>2]=yOa|0;a[e+12648>>2]=xOa|0;a[e+12660>>2]=wOa|0;a[e+12672>>2]=vOa|0;a[e+12684>>2]=tOa|0;a[e+12696>>2]=sOa|0;a[e+12708>>2]=rOa|0;a[e+12720>>2]=qOa|0;a[e+12732>>2]=nOa|0;a[e+12744>>2]=lOa|0;a[e+12756>>2]=kOa|0;a[e+12768>>2]=jOa|0;a[e+12780>>2]=iOa|0;a[e+12792>>2]=hOa|0;a[e+12804>>2]=fOa|0;a[e+12816>>2]=eOa|0;a[e+12828>>2]=dOa|0;a[e+12840>>2]=cOa|0;a[e+12852>>2]=$Na|0;a[e+12864>>2]=YNa|0;a[e+12876>>2]=XNa|0;a[e+12888>>2]=WNa|0;a[e+12900>>2]=VNa|0;a[e+12912>>2]=UNa|0;a[e+12924>>2]=SNa|0;a[e+12936>>2]=RNa|0;a[e+12948>>2]=QNa|0;a[e+12960>>2]=PNa|0;a[e+12972>>2]=NNa|0;a[e+12984>>2]=LNa|0;a[e+12996>>2]=KNa|0;a[e+13008>>2]=JNa|0;a[e+13020>>2]=INa|0;a[e+13032>>2]=HNa|0;a[e+13044>>2]=FNa|0;a[e+13056>>2]=ENa|0;a[e+13068>>2]=DNa|0;a[e+13080>>2]=CNa|0;a[e+13092>>2]=ANa|0;a[e+13104>>2]=yNa|0;a[e+13116>>2]=xNa|0;a[e+13128>>2]=wNa|0;a[e+13140>>2]=vNa|0;a[e+13152>>2]=uNa|0;a[e+13164>>2]=sNa|0;a[e+13176>>2]=rNa|0;a[e+13188>>2]=qNa|0;a[e+13200>>2]=pNa|0;a[e+13212>>2]=nNa|0;a[e+13224>>2]=lNa|0;a[e+13236>>2]=kNa|0;a[e+13248>>2]=jNa|0;a[e+13260>>2]=iNa|0;a[e+13272>>2]=hNa|0;a[e+13284>>2]=fNa|0;a[e+13296>>2]=eNa|0;a[e+13308>>2]=dNa|0;a[e+13320>>2]=cNa|0;a[e+13332>>2]=$Ma|0;a[e+13344>>2]=XMa|0;a[e+13356>>2]=VMa|0;a[e+13368>>2]=UMa|0;a[e+13380>>2]=TMa|0;a[e+13392>>2]=SMa|0;a[e+13404>>2]=QMa|0;a[e+13416>>2]=PMa|0;a[e+13428>>2]=OMa|0;a[e+13440>>2]=MMa|0;a[e+13452>>2]=KMa|0;a[e+13464>>2]=IMa|0;a[e+13476>>2]=HMa|0;a[e+13488>>2]=GMa|0;a[e+13500>>2]=FMa|0;a[e+13512>>2]=EMa|0;a[e+13524>>2]=CMa|0;a[e+13536>>2]=BMa|0;a[e+13548>>2]=AMa|0;a[e+13560>>2]=zMa|0;a[e+13572>>2]=xMa|0;a[e+13584>>2]=vMa|0;a[e+13596>>2]=uMa|0;a[e+13608>>2]=tMa|0;a[e+13620>>2]=sMa|0;a[e+13632>>2]=rMa|0;a[e+13644>>2]=pMa|0;a[e+13656>>2]=nMa|0;a[e+13668>>2]=mMa|0;a[e+13680>>2]=lMa|0;a[e+13692>>2]=kMa|0;a[e+13704>>2]=iMa|0;a[e+13716>>2]=hMa|0;a[e+13728>>2]=gMa|0;a[e+13740>>2]=fMa|0;a[e+13752>>2]=eMa|0;a[e+13764>>2]=cMa|0;a[e+13776>>2]=aMa|0;a[e+13788>>2]=$La|0;a[e+13800>>2]=ZLa|0;a[e+13812>>2]=XLa|0;a[e+13824>>2]=VLa|0;a[e+13836>>2]=ULa|0;a[e+13848>>2]=TLa|0;a[e+13860>>2]=SLa|0;a[e+13872>>2]=RLa|0;a[e+13884>>2]=PLa|0;a[e+13896>>2]=NLa|0;a[e+13908>>2]=MLa|0;a[e+13920>>2]=LLa|0;a[e+13932>>2]=JLa|0;a[e+13944>>2]=GLa|0;a[e+13956>>2]=FLa|0;a[e+13968>>2]=ELa|0;a[e+13980>>2]=DLa|0;a[e+13992>>2]=CLa|0;a[e+14004>>2]=ALa|0;a[e+14016>>2]=yLa|0;a[e+14028>>2]=xLa|0;a[e+14040>>2]=wLa|0;a[e+14052>>2]=uLa|0;a[e+14064>>2]=sLa|0;a[e+14076>>2]=rLa|0;a[e+14088>>2]=qLa|0;a[e+14100>>2]=pLa|0;a[e+14112>>2]=oLa|0;a[e+14124>>2]=mLa|0;a[e+14136>>2]=kLa|0;a[e+14148>>2]=jLa|0;a[e+14160>>2]=iLa|0;a[e+14172>>2]=hLa|0;a[e+14184>>2]=fLa|0;a[e+14196>>2]=eLa|0;a[e+14208>>2]=dLa|0;a[e+14220>>2]=cLa|0;a[e+14232>>2]=bLa|0;a[e+14244>>2]=$Ka|0;a[e+14256>>2]=YKa|0;a[e+14268>>2]=XKa|0;a[e+14280>>2]=WKa|0;a[e+14292>>2]=VKa|0;a[e+14304>>2]=TKa|0;a[e+14316>>2]=SKa|0;a[e+14328>>2]=RKa|0;a[e+14340>>2]=QKa|0;a[e+14352>>2]=PKa|0;a[e+14364>>2]=NKa|0;a[e+14376>>2]=LKa|0;a[e+14388>>2]=KKa|0;a[e+14400>>2]=JKa|0;a[e+14412>>2]=IKa|0;a[e+14424>>2]=GKa|0;a[e+14436>>2]=FKa|0;a[e+14448>>2]=EKa|0;a[e+14460>>2]=DKa|0;a[e+14472>>2]=CKa|0;a[e+14484>>2]=AKa|0;a[e+14496>>2]=zKa|0;a[e+14508>>2]=yKa|0;a[e+14520>>2]=xKa|0;a[e+14532>>2]=uKa|0;a[e+14544>>2]=sKa|0;a[e+14556>>2]=rKa|0;a[e+14568>>2]=qKa|0;a[e+14580>>2]=pKa|0;a[e+14592>>2]=oKa|0;a[e+14604>>2]=mKa|0;a[e+14616>>2]=kKa|0;a[e+14628>>2]=jKa|0;a[e+14640>>2]=iKa|0;a[e+14652>>2]=hKa|0;a[e+14664>>2]=fKa|0;a[e+14676>>2]=eKa|0;a[e+14688>>2]=dKa|0;a[e+14700>>2]=cKa|0;a[e+14712>>2]=bKa|0;a[e+14724>>2]=$Ja|0;a[e+14736>>2]=YJa|0;a[e+14748>>2]=XJa|0;a[e+14760>>2]=WJa|0;a[e+14772>>2]=VJa|0;a[e+14784>>2]=TJa|0;a[e+14796>>2]=SJa|0;a[e+14808>>2]=QJa|0;a[e+14820>>2]=PJa|0;a[e+14832>>2]=OJa|0;a[e+14844>>2]=MJa|0;a[e+14856>>2]=KJa|0;a[e+14868>>2]=JJa|0;a[e+14880>>2]=IJa|0;a[e+14892>>2]=GJa|0;a[e+14904>>2]=EJa|0;a[e+14916>>2]=DJa|0;a[e+14928>>2]=CJa|0;a[e+14940>>2]=BJa|0;a[e+14952>>2]=AJa|0;a[e+14964>>2]=yJa|0;a[e+14976>>2]=uJa|0;a[e+14988>>2]=tJa|0;a[e+15e3>>2]=sJa|0;a[e+15012>>2]=rJa|0;a[e+15024>>2]=pJa|0;a[e+15036>>2]=oJa|0;a[e+15048>>2]=nJa|0;a[e+15060>>2]=mJa|0;a[e+15072>>2]=lJa|0;a[e+15084>>2]=jJa|0;a[e+15096>>2]=hJa|0;a[e+15108>>2]=gJa|0;a[e+15120>>2]=fJa|0;a[e+15132>>2]=dJa|0;a[e+15144>>2]=bJa|0;a[e+15156>>2]=aJa|0;a[e+15168>>2]=$Ia|0;a[e+15180>>2]=ZIa|0;a[e+15192>>2]=YIa|0;a[e+15204>>2]=WIa|0;a[e+15216>>2]=UIa|0;a[e+15228>>2]=TIa|0;a[e+15240>>2]=RIa|0;a[e+15252>>2]=PIa|0;a[e+15264>>2]=OIa|0;a[e+15276>>2]=NIa|0;a[e+15288>>2]=MIa|0;a[e+15300>>2]=LIa|0;a[e+15312>>2]=KIa|0;a[e+15324>>2]=IIa|0;a[e+15336>>2]=GIa|0;a[e+15348>>2]=FIa|0;a[e+15360>>2]=EIa|0;a[e+15372>>2]=DIa|0;a[e+15384>>2]=BIa|0;a[e+15396>>2]=AIa|0;a[e+15408>>2]=zIa|0;a[e+15420>>2]=yIa|0;a[e+15432>>2]=xIa|0;a[e+15444>>2]=vIa|0;a[e+15456>>2]=tIa|0;a[e+15468>>2]=sIa|0;a[e+15480>>2]=rIa|0;a[e+15492>>2]=qIa|0;a[e+15504>>2]=oIa|0;a[e+15516>>2]=nIa|0;a[e+15528>>2]=mIa|0;a[e+15540>>2]=lIa|0;a[e+15552>>2]=kIa|0;a[e+15564>>2]=iIa|0;a[e+15576>>2]=fIa|0;a[e+15588>>2]=eIa|0;a[e+15600>>2]=dIa|0;a[e+15612>>2]=bIa|0;a[e+15624>>2]=$Ha|0;a[e+15636>>2]=ZHa|0;a[e+15648>>2]=YHa|0;a[e+15660>>2]=XHa|0;a[e+15672>>2]=WHa|0;a[e+15684>>2]=UHa|0;a[e+15696>>2]=SHa|0;a[e+15708>>2]=RHa|0;a[e+15720>>2]=QHa|0;a[e+15732>>2]=OHa|0;a[e+15744>>2]=MHa|0;a[e+15756>>2]=LHa|0;a[e+15768>>2]=KHa|0;a[e+15780>>2]=JHa|0;a[e+15792>>2]=IHa|0;a[e+15804>>2]=GHa|0;a[e+15816>>2]=EHa|0;a[e+15828>>2]=DHa|0;a[e+15840>>2]=CHa|0;a[e+15852>>2]=BHa|0;a[e+15864>>2]=zHa|0;a[e+15876>>2]=yHa|0;a[e+15888>>2]=wHa|0;a[e+15900>>2]=vHa|0;a[e+15912>>2]=uHa|0;a[e+15924>>2]=sHa|0;a[e+15936>>2]=qHa|0;a[e+15948>>2]=pHa|0;a[e+15960>>2]=oHa|0;a[e+15972>>2]=nHa|0;a[e+15984>>2]=lHa|0;a[e+15996>>2]=kHa|0;a[e+16008>>2]=jHa|0;a[e+16020>>2]=iHa|0;a[e+16032>>2]=hHa|0;a[e+16044>>2]=fHa|0;a[e+16056>>2]=dHa|0;a[e+16068>>2]=cHa|0;a[e+16080>>2]=bHa|0;a[e+16092>>2]=aHa|0;a[e+16104>>2]=ZGa|0;a[e+16116>>2]=YGa|0;a[e+16128>>2]=XGa|0;a[e+16140>>2]=WGa|0;a[e+16152>>2]=VGa|0;a[e+16164>>2]=TGa|0;a[e+16176>>2]=RGa|0;a[e+16188>>2]=QGa|0;a[e+16200>>2]=PGa|0;a[e+16212>>2]=OGa|0;a[e+16224>>2]=MGa|0;a[e+16236>>2]=LGa|0;a[e+16248>>2]=KGa|0;a[e+16260>>2]=IGa|0;a[e+16272>>2]=HGa|0;a[e+16284>>2]=FGa|0;a[e+16296>>2]=DGa|0;a[e+16308>>2]=CGa|0;a[e+16320>>2]=AGa|0;a[e+16332>>2]=zGa|0;a[e+16344>>2]=vGa|0;a[e+16356>>2]=uGa|0;a[e+16368>>2]=tGa|0;a[e+16380>>2]=rGa|0;a[e+16392>>2]=qGa|0;a[e+16404>>2]=oGa|0;a[e+16416>>2]=mGa|0;a[e+16428>>2]=lGa|0;a[e+16440>>2]=kGa|0;a[e+16452>>2]=jGa|0;a[e+16464>>2]=gGa|0;a[e+16476>>2]=fGa|0;a[e+16488>>2]=eGa|0;a[e+16500>>2]=cGa|0;a[e+16512>>2]=bGa|0;a[e+16524>>2]=$Fa|0;a[e+16536>>2]=YFa|0;a[e+16548>>2]=XFa|0;a[e+16560>>2]=WFa|0;a[e+16572>>2]=UFa|0;a[e+16584>>2]=SFa|0;a[e+16596>>2]=RFa|0;a[e+16608>>2]=QFa|0;a[e+16620>>2]=PFa|0;a[e+16632>>2]=OFa|0;a[e+16644>>2]=MFa|0;a[e+16656>>2]=KFa|0;a[e+16668>>2]=JFa|0;a[e+16680>>2]=IFa|0;a[e+16692>>2]=HFa|0;a[e+16704>>2]=FFa|0;a[e+16716>>2]=EFa|0;a[e+16728>>2]=DFa|0;a[e+16740>>2]=CFa|0;a[e+16752>>2]=BFa|0;a[e+16764>>2]=zFa|0;a[e+16776>>2]=xFa|0;a[e+16788>>2]=wFa|0;a[e+16800>>2]=vFa|0;a[e+16812>>2]=uFa|0;a[e+16824>>2]=sFa|0;a[e+16836>>2]=rFa|0;a[e+16848>>2]=qFa|0;a[e+16860>>2]=oFa|0;a[e+16872>>2]=nFa|0;a[e+16884>>2]=lFa|0;a[e+16896>>2]=jFa|0;a[e+16908>>2]=iFa|0;a[e+16920>>2]=hFa|0;a[e+16932>>2]=fFa|0;a[e+16944>>2]=dFa|0;a[e+16956>>2]=cFa|0;a[e+16968>>2]=bFa|0;a[e+16980>>2]=aFa|0;a[e+16992>>2]=$Ea|0;a[e+17004>>2]=YEa|0;a[e+17016>>2]=WEa|0;a[e+17028>>2]=VEa|0;a[e+17040>>2]=UEa|0;a[e+17052>>2]=TEa|0;a[e+17064>>2]=SEa|0;a[e+17076>>2]=REa|0;a[e+17088>>2]=PEa|0;a[e+17100>>2]=OEa|0;a[e+17112>>2]=NEa|0;a[e+17124>>2]=LEa|0;a[e+17136>>2]=JEa|0;a[e+17148>>2]=HEa|0;a[e+17160>>2]=GEa|0;a[e+17172>>2]=FEa|0;a[e+17184>>2]=DEa|0;a[e+17196>>2]=CEa|0;a[e+17208>>2]=BEa|0;a[e+17220>>2]=AEa|0;a[e+17232>>2]=zEa|0;a[e+17244>>2]=xEa|0;a[e+17256>>2]=vEa|0;a[e+17268>>2]=uEa|0;a[e+17280>>2]=tEa|0;a[e+17292>>2]=sEa|0;a[e+17304>>2]=qEa|0;a[e+17316>>2]=pEa|0;a[e+17328>>2]=oEa|0;a[e+17340>>2]=nEa|0;a[e+17352>>2]=mEa|0;a[e+17364>>2]=kEa|0;a[e+17376>>2]=iEa|0;a[e+17388>>2]=hEa|0;a[e+17400>>2]=gEa|0;a[e+17412>>2]=fEa|0;a[e+17424>>2]=eEa|0;a[e+17436>>2]=dEa|0;a[e+17448>>2]=cEa|0;a[e+17460>>2]=bEa|0;a[e+17472>>2]=aEa|0;a[e+17484>>2]=ZDa|0;a[e+17496>>2]=XDa|0;a[e+17508>>2]=WDa|0;a[e+17520>>2]=VDa|0;a[e+17532>>2]=UDa|0;a[e+17544>>2]=RDa|0;a[e+17556>>2]=QDa|0;a[e+17568>>2]=PDa|0;a[e+17580>>2]=ODa|0;a[e+17592>>2]=NDa|0;a[e+17604>>2]=LDa|0;a[e+17616>>2]=JDa|0;a[e+17628>>2]=IDa|0;a[e+17640>>2]=HDa|0;a[e+17652>>2]=GDa|0;a[e+17664>>2]=EDa|0;a[e+17676>>2]=DDa|0;a[e+17688>>2]=CDa|0;a[e+17700>>2]=BDa|0;a[e+17712>>2]=ADa|0;a[e+17724>>2]=yDa|0;a[e+17736>>2]=wDa|0;a[e+17748>>2]=vDa|0;a[e+17760>>2]=uDa|0;a[e+17772>>2]=tDa|0;a[e+17784>>2]=rDa|0;a[e+17796>>2]=qDa|0;a[e+17808>>2]=pDa|0;a[e+17820>>2]=oDa|0;a[e+17832>>2]=nDa|0;a[e+17844>>2]=lDa|0;a[e+17856>>2]=jDa|0;a[e+17868>>2]=iDa|0;a[e+17880>>2]=hDa|0;a[e+17892>>2]=gDa|0;a[e+17904>>2]=dDa|0;a[e+17916>>2]=cDa|0;a[e+17928>>2]=bDa|0;a[e+17940>>2]=aDa|0;a[e+17952>>2]=$Ca|0;a[e+17964>>2]=YCa|0;a[e+17976>>2]=VCa|0;a[e+17988>>2]=UCa|0;a[e+18e3>>2]=TCa|0;a[e+18012>>2]=SCa|0;a[e+18024>>2]=RCa|0;a[e+18036>>2]=QCa|0;a[e+18048>>2]=PCa|0;a[e+18060>>2]=OCa|0;a[e+18072>>2]=NCa|0;a[e+18084>>2]=LCa|0;a[e+18096>>2]=JCa|0;a[e+18108>>2]=ICa|0;a[e+18120>>2]=HCa|0;a[e+18132>>2]=FCa|0;a[e+18144>>2]=DCa|0;a[e+18156>>2]=CCa|0;a[e+18168>>2]=BCa|0;a[e+18180>>2]=ACa|0;a[e+18192>>2]=zCa|0;a[e+18204>>2]=xCa|0;a[e+18216>>2]=vCa|0;a[e+18228>>2]=uCa|0;a[e+18240>>2]=tCa|0;a[e+18252>>2]=sCa|0;a[e+18264>>2]=rCa|0;a[e+18276>>2]=qCa|0;a[e+18288>>2]=pCa|0;a[e+18300>>2]=oCa|0;a[e+18312>>2]=nCa|0;a[e+18324>>2]=lCa|0;a[e+18336>>2]=jCa|0;a[e+18348>>2]=iCa|0;a[e+18360>>2]=hCa|0;a[e+18372>>2]=gCa|0;a[e+18384>>2]=fCa|0;a[e+18396>>2]=eCa|0;a[e+18408>>2]=cCa|0;a[e+18420>>2]=bCa|0;a[e+18432>>2]=aCa|0;a[e+18444>>2]=ZBa|0;a[e+18456>>2]=XBa|0;a[e+18468>>2]=WBa|0;a[e+18480>>2]=VBa|0;a[e+18492>>2]=UBa|0;a[e+18504>>2]=TBa|0;a[e+18516>>2]=SBa|0;a[e+18528>>2]=RBa|0;a[e+18540>>2]=QBa|0;a[e+18552>>2]=PBa|0;a[e+18564>>2]=NBa|0;a[e+18576>>2]=LBa|0;a[e+18588>>2]=KBa|0;a[e+18600>>2]=JBa|0;a[e+18612>>2]=IBa|0;a[e+18624>>2]=HBa|0;a[e+18636>>2]=GBa|0;a[e+18648>>2]=FBa|0;a[e+18660>>2]=EBa|0;a[e+18672>>2]=DBa|0;a[e+18684>>2]=BBa|0;a[e+18696>>2]=zBa|0;a[e+18708>>2]=yBa|0;a[e+18720>>2]=xBa|0;a[e+18732>>2]=wBa|0;a[e+18744>>2]=uBa|0;a[e+18756>>2]=tBa|0;a[e+18768>>2]=sBa|0;a[e+18780>>2]=rBa|0;a[e+18792>>2]=qBa|0;a[e+18804>>2]=oBa|0;a[e+18816>>2]=mBa|0;a[e+18828>>2]=lBa|0;a[e+18840>>2]=kBa|0;a[e+18852>>2]=jBa|0;a[e+18864>>2]=hBa|0;a[e+18876>>2]=gBa|0;a[e+18888>>2]=fBa|0;a[e+18900>>2]=eBa|0;a[e+18912>>2]=dBa|0;a[e+18924>>2]=bBa|0;a[e+18936>>2]=$Aa|0;a[e+18948>>2]=ZAa|0;a[e+18960>>2]=YAa|0;a[e+18972>>2]=XAa|0;a[e+18984>>2]=WAa|0;a[e+18996>>2]=VAa|0;a[e+19008>>2]=UAa|0;a[e+19020>>2]=TAa|0;a[e+19032>>2]=SAa|0;a[e+19044>>2]=QAa|0;a[e+19056>>2]=OAa|0;a[e+19068>>2]=NAa|0;a[e+19080>>2]=MAa|0;a[e+19092>>2]=LAa|0;a[e+19104>>2]=KAa|0;a[e+19116>>2]=JAa|0;a[e+19128>>2]=IAa|0;a[e+19140>>2]=HAa|0;a[e+19152>>2]=GAa|0;a[e+19164>>2]=EAa|0;a[e+19176>>2]=BAa|0;a[e+19188>>2]=AAa|0;a[e+19200>>2]=zAa|0;a[e+19212>>2]=yAa|0;a[e+19224>>2]=wAa|0;a[e+19236>>2]=vAa|0;a[e+19248>>2]=uAa|0;a[e+19260>>2]=tAa|0;a[e+19272>>2]=sAa|0;a[e+19284>>2]=qAa|0;a[e+19296>>2]=oAa|0;a[e+19308>>2]=nAa|0;a[e+19320>>2]=mAa|0;a[e+19332>>2]=kAa|0;a[e+19344>>2]=jAa|0;a[e+19356>>2]=iAa|0;a[e+19368>>2]=hAa|0;a[e+19380>>2]=gAa|0;a[e+19392>>2]=fAa|0;a[e+19404>>2]=cAa|0;a[e+19416>>2]=aAa|0;a[e+19428>>2]=$za|0;a[e+19440>>2]=Zza|0;a[e+19452>>2]=Yza|0;a[e+19464>>2]=Xza|0;a[e+19476>>2]=Wza|0;a[e+19488>>2]=Vza|0;a[e+19500>>2]=Uza|0;a[e+19512>>2]=Tza|0;a[e+19524>>2]=Rza|0;a[e+19536>>2]=Pza|0;a[e+19548>>2]=Oza|0;a[e+19560>>2]=Nza|0;a[e+19572>>2]=Mza|0;a[e+19584>>2]=Lza|0;a[e+19596>>2]=Kza|0;a[e+19608>>2]=Jza|0;a[e+19620>>2]=Iza|0;a[e+19632>>2]=Hza|0;a[e+19644>>2]=Fza|0;a[e+19656>>2]=Eza|0;a[e+19668>>2]=Dza|0;a[e+19680>>2]=Cza|0;a[e+19692>>2]=Bza|0;a[e+19704>>2]=Aza|0;a[e+19716>>2]=zza|0;a[e+19728>>2]=yza|0;a[e+19740>>2]=xza|0;a[e+19752>>2]=wza|0;a[e+19764>>2]=uza|0;a[e+19776>>2]=sza|0;a[e+19788>>2]=rza|0;a[e+19800>>2]=qza|0;a[e+19812>>2]=pza|0;a[e+19824>>2]=oza|0;a[e+19836>>2]=nza|0;a[e+19848>>2]=mza|0;a[e+19860>>2]=lza|0;a[e+19872>>2]=kza|0;a[e+19884>>2]=iza|0;a[e+19896>>2]=gza|0;a[e+19908>>2]=fza|0;a[e+19920>>2]=eza|0;a[e+19932>>2]=dza|0;a[e+19944>>2]=aza|0;a[e+19956>>2]=$ya|0;a[e+19968>>2]=Zya|0;a[e+19980>>2]=Yya|0;a[e+19992>>2]=Xya|0;a[e+20004>>2]=Vya|0;a[e+20016>>2]=Tya|0;a[e+20028>>2]=Sya|0;a[e+20040>>2]=Rya|0;a[e+20052>>2]=Qya|0;a[e+20064>>2]=Oya|0;a[e+20076>>2]=Nya|0;a[e+20088>>2]=Mya|0;a[e+20100>>2]=Lya|0;a[e+20112>>2]=Kya|0;a[e+20124>>2]=Iya|0;a[e+20136>>2]=Gya|0;a[e+20148>>2]=Fya|0;a[e+20160>>2]=Eya|0;a[e+20172>>2]=Dya|0;a[e+20184>>2]=Bya|0;a[e+20196>>2]=Aya|0;a[e+20208>>2]=zya|0;a[e+20220>>2]=yya|0;a[e+20232>>2]=xya|0;a[e+20244>>2]=vya|0;a[e+20256>>2]=tya|0;a[e+20268>>2]=sya|0;a[e+20280>>2]=rya|0;a[e+20292>>2]=qya|0;a[e+20304>>2]=nya|0;a[e+20316>>2]=mya|0;a[e+20328>>2]=lya|0;a[e+20340>>2]=kya|0;a[e+20352>>2]=jya|0;a[e+20364>>2]=hya|0;a[e+20376>>2]=eya|0;a[e+20388>>2]=dya|0;a[e+20400>>2]=cya|0;a[e+20412>>2]=bya|0;a[e+20424>>2]=Zxa|0;a[e+20436>>2]=Yxa|0;a[e+20448>>2]=Xxa|0;a[e+20460>>2]=Wxa|0;a[e+20472>>2]=Vxa|0;a[e+20484>>2]=Txa|0;a[e+20496>>2]=Rxa|0;a[e+20508>>2]=Qxa|0;a[e+20520>>2]=Pxa|0;a[e+20532>>2]=Oxa|0;a[e+20544>>2]=Lxa|0;a[e+20556>>2]=Kxa|0;a[e+20568>>2]=Jxa|0;a[e+20580>>2]=Ixa|0;a[e+20592>>2]=Hxa|0;a[e+20604>>2]=Fxa|0;a[e+20616>>2]=Dxa|0;a[e+20628>>2]=Cxa|0;a[e+20640>>2]=Bxa|0;a[e+20652>>2]=Axa|0;a[e+20664>>2]=xxa|0;a[e+20676>>2]=wxa|0;a[e+20688>>2]=vxa|0;a[e+20700>>2]=uxa|0;a[e+20712>>2]=txa|0;a[e+20724>>2]=rxa|0;a[e+20736>>2]=pxa|0;a[e+20748>>2]=oxa|0;a[e+20760>>2]=nxa|0;a[e+20772>>2]=mxa|0;a[e+20784>>2]=jxa|0;a[e+20796>>2]=ixa|0;a[e+20808>>2]=hxa|0;a[e+20820>>2]=gxa|0;a[e+20832>>2]=fxa|0;a[e+20844>>2]=dxa|0;a[e+20856>>2]=bxa|0;a[e+20868>>2]=axa|0;a[e+20880>>2]=Zwa|0;a[e+20892>>2]=Ywa|0;a[e+20904>>2]=Vwa|0;a[e+20916>>2]=Uwa|0;a[e+20928>>2]=Twa|0;a[e+20940>>2]=Swa|0;a[e+20952>>2]=Rwa|0;a[e+20964>>2]=Pwa|0;a[e+20976>>2]=Nwa|0;a[e+20988>>2]=Mwa|0;a[e+21e3>>2]=Lwa|0;a[e+21012>>2]=Kwa|0;a[e+21024>>2]=Hwa|0;a[e+21036>>2]=Gwa|0;a[e+21048>>2]=Fwa|0;a[e+21060>>2]=Ewa|0;a[e+21072>>2]=Dwa|0;a[e+21084>>2]=Bwa|0;a[e+21096>>2]=zwa|0;a[e+21108>>2]=ywa|0;a[e+21120>>2]=xwa|0;a[e+21132>>2]=wwa|0;a[e+21144>>2]=twa|0;a[e+21156>>2]=swa|0;a[e+21168>>2]=rwa|0;a[e+21180>>2]=qwa|0;a[e+21192>>2]=pwa|0;a[e+21204>>2]=nwa|0;a[e+21216>>2]=lwa|0;a[e+21228>>2]=kwa|0;a[e+21240>>2]=jwa|0;a[e+21252>>2]=iwa|0;a[e+21264>>2]=gwa|0;a[e+21276>>2]=fwa|0;a[e+21288>>2]=ewa|0;a[e+21300>>2]=dwa|0;a[e+21312>>2]=cwa|0;a[e+21324>>2]=awa|0;a[e+21336>>2]=Zva|0;a[e+21348>>2]=Yva|0;a[e+21360>>2]=Xva|0;a[e+21372>>2]=Wva|0;a[e+21384>>2]=Vva|0;a[e+21396>>2]=Uva|0;a[e+21408>>2]=Tva|0;a[e+21420>>2]=Sva|0;a[e+21432>>2]=Rva|0;a[e+21444>>2]=Pva|0;a[e+21456>>2]=Nva|0;a[e+21468>>2]=Mva|0;a[e+21480>>2]=Lva|0;a[e+21492>>2]=Kva|0;a[e+21504>>2]=Iva|0;a[e+21516>>2]=Hva|0;a[e+21528>>2]=Gva|0;a[e+21540>>2]=Fva|0;a[e+21552>>2]=Eva|0;a[e+21564>>2]=Cva|0;a[e+21576>>2]=zva|0;a[e+21588>>2]=yva|0;a[e+21600>>2]=xva|0;a[e+21612>>2]=wva|0;a[e+21624>>2]=uva|0;a[e+21636>>2]=tva|0;a[e+21648>>2]=sva|0;a[e+21660>>2]=rva|0;a[e+21672>>2]=qva|0;a[e+21684>>2]=ova|0;a[e+21696>>2]=mva|0;a[e+21708>>2]=lva|0;a[e+21720>>2]=kva|0;a[e+21732>>2]=jva|0;a[e+21744>>2]=gva|0;a[e+21756>>2]=fva|0;a[e+21768>>2]=eva|0;a[e+21780>>2]=dva|0;a[e+21792>>2]=cva|0;a[e+21804>>2]=ava|0;a[e+21816>>2]=Zua|0;a[e+21828>>2]=Yua|0;a[e+21840>>2]=Xua|0;a[e+21852>>2]=Wua|0;a[e+21864>>2]=Uua|0;a[e+21876>>2]=Tua|0;a[e+21888>>2]=Sua|0;a[e+21900>>2]=Rua|0;a[e+21912>>2]=Qua|0;a[e+21924>>2]=Oua|0;a[e+21936>>2]=Mua|0;a[e+21948>>2]=Lua|0;a[e+21960>>2]=Kua|0;a[e+21972>>2]=Jua|0;a[e+21984>>2]=Hua|0;a[e+21996>>2]=Gua|0;a[e+22008>>2]=Fua|0;a[e+22020>>2]=Dua|0;a[e+22032>>2]=IA|0;a[e+22044>>2]=AA|0;a[e+22056>>2]=Aua|0;a[e+22068>>2]=zua|0;a[e+22080>>2]=yua|0;a[e+22092>>2]=xua|0;a[e+22104>>2]=Xz|0;a[e+22116>>2]=wua|0;a[e+22128>>2]=vua|0;a[e+22140>>2]=uua|0;a[e+22152>>2]=tua|0;a[e+22164>>2]=Mz|0;a[e+22176>>2]=qua|0;a[e+22188>>2]=pua|0;a[e+22200>>2]=oua|0;a[e+22212>>2]=nua|0;a[e+22224>>2]=Bz|0;a[e+22236>>2]=qz|0;a[e+22248>>2]=mua|0;a[e+22260>>2]=lua|0;a[e+22272>>2]=kua|0;a[e+22284>>2]=jua|0;a[e+22296>>2]=Ac|0;a[e+22308>>2]=SB|0;a[e+22320>>2]=Zj|0;a[e+22332>>2]=gua|0;a[e+22344>>2]=eua|0;a[e+22356>>2]=dua|0;a[e+22368>>2]=cua|0;a[e+22380>>2]=wB|0;a[e+22392>>2]=mB|0;a[e+22404>>2]=bua|0;a[e+22416>>2]=Zta|0;a[e+22428>>2]=Yta|0;a[e+22440>>2]=Xta|0;a[e+22452>>2]=bB|0;a[e+22464>>2]=Vta|0;a[e+22476>>2]=Uta|0;a[e+22488>>2]=Tta|0;a[e+22500>>2]=Sta|0;a[e+22512>>2]=WA|0;a[e+22524>>2]=Rta|0;a[e+22536>>2]=Ota|0;a[e+22548>>2]=Nta|0;a[e+22560>>2]=Mta|0;a[e+22572>>2]=SA|0;a[e+22584>>2]=Lta|0;a[e+22596>>2]=Kta|0;a[e+22608>>2]=Jta|0;a[e+22620>>2]=Ita|0;a[e+22632>>2]=QA|0;a[e+22644>>2]=Hta|0;a[e+22656>>2]=Eta|0;a[e+22668>>2]=Dta|0;a[e+22680>>2]=Cta|0;a[e+22692>>2]=OA|0;a[e+22704>>2]=Bta|0;a[e+22716>>2]=Ata|0;a[e+22728>>2]=zta|0;a[e+22740>>2]=yta|0;a[e+22752>>2]=NA|0;a[e+22764>>2]=LA|0;a[e+22776>>2]=vta|0;a[e+22788>>2]=uta|0;a[e+22800>>2]=tta|0;a[e+22812>>2]=sta|0;a[e+22824>>2]=JA|0;a[e+22836>>2]=gn|0;a[e+22848>>2]=rta|0;a[e+22860>>2]=qta|0;a[e+22872>>2]=pta|0;a[e+22884>>2]=ota|0;a[e+22896>>2]=EA|0;a[e+22908>>2]=mta|0;a[e+22920>>2]=lta|0;a[e+22932>>2]=kta|0;a[e+22944>>2]=ita|0;a[e+22956>>2]=DA|0;a[e+22968>>2]=CA|0;a[e+22980>>2]=BA|0;a[e+22992>>2]=hta|0;a[e+23004>>2]=gta|0;a[e+23016>>2]=dta|0;a[e+23028>>2]=cta|0;a[e+23040>>2]=zA|0;a[e+23052>>2]=bta|0;a[e+23064>>2]=ata|0;a[e+23076>>2]=$sa|0;a[e+23088>>2]=Zsa|0;a[e+23100>>2]=xA|0;a[e+23112>>2]=Ysa|0;a[e+23124>>2]=Xsa|0;a[e+23136>>2]=Usa|0;a[e+23148>>2]=Tsa|0;a[e+23160>>2]=wA|0;a[e+23172>>2]=uA|0;a[e+23184>>2]=Ssa|0;a[e+23196>>2]=Rsa|0;a[e+23208>>2]=Qsa|0;a[e+23220>>2]=Osa|0;a[e+23232>>2]=sA|0;a[e+23244>>2]=rA|0;a[e+23256>>2]=Lsa|0;a[e+23268>>2]=Ksa|0;a[e+23280>>2]=Jsa|0;a[e+23292>>2]=Isa|0;a[e+23304>>2]=qA|0;a[e+23316>>2]=pA|0;a[e+23328>>2]=nA|0;a[e+23340>>2]=mA|0;a[e+23352>>2]=Hsa|0;a[e+23364>>2]=Gsa|0;a[e+23376>>2]=Dsa|0;a[e+23388>>2]=Csa|0;a[e+23400>>2]=lA|0;a[e+23412>>2]=Bsa|0;a[e+23424>>2]=zsa|0;a[e+23436>>2]=xsa|0;a[e+23448>>2]=wsa|0;a[e+23460>>2]=kA|0;a[e+23472>>2]=hA|0;a[e+23484>>2]=fA|0;a[e+23496>>2]=tsa|0;a[e+23508>>2]=ssa|0;a[e+23520>>2]=rsa|0;a[e+23532>>2]=qsa|0;a[e+23544>>2]=dA|0;a[e+23556>>2]=msa|0;a[e+23568>>2]=lsa|0;a[e+23580>>2]=ksa|0;a[e+23592>>2]=jsa|0;a[e+23604>>2]=cA|0;a[e+23616>>2]=aA|0;a[e+23628>>2]=Zz|0;a[e+23640>>2]=Wz|0;a[e+23652>>2]=Uz|0;a[e+23664>>2]=fsa|0;a[e+23676>>2]=esa|0;a[e+23688>>2]=dsa|0;a[e+23700>>2]=csa|0;a[e+23712>>2]=Tz|0;a[e+23724>>2]=bsa|0;a[e+23736>>2]=Zra|0;a[e+23748>>2]=Yra|0;a[e+23760>>2]=Xra|0;a[e+23772>>2]=ir|0;a[e+23784>>2]=Wra|0;a[e+23796>>2]=Vra|0;a[e+23808>>2]=Ura|0;a[e+23820>>2]=Tra|0;a[e+23832>>2]=Sra|0;a[e+23844>>2]=Rra|0;a[e+23856>>2]=Ora|0;a[e+23868>>2]=Nra|0;a[e+23880>>2]=Mra|0;a[e+23892>>2]=Lra|0;a[e+23904>>2]=Kra|0;a[e+23916>>2]=Jra|0;a[e+23928>>2]=Ira|0;a[e+23940>>2]=Hra|0;a[e+23952>>2]=Gra|0;a[e+23964>>2]=Fra|0;a[e+23976>>2]=Bra|0;a[e+23988>>2]=Ara|0;a[e+24e3>>2]=zra|0;a[e+24012>>2]=yra|0;a[e+24024>>2]=xra|0;a[e+24036>>2]=wra|0;a[e+24048>>2]=vra|0;a[e+24060>>2]=ura|0;a[e+24072>>2]=tra|0;a[e+24084>>2]=sra|0;a[e+24096>>2]=pra|0;a[e+24108>>2]=ora|0;a[e+24120>>2]=nra|0;a[e+24132>>2]=mra|0;a[e+24144>>2]=kra|0;a[e+24156>>2]=ira|0;a[e+24168>>2]=hra|0;a[e+24180>>2]=gra|0;a[e+24192>>2]=fra|0;a[e+24204>>2]=era|0;a[e+24216>>2]=bra|0;a[e+24228>>2]=ara|0;a[e+24240>>2]=$qa|0;a[e+24252>>2]=Zqa|0;a[e+24264>>2]=Yqa|0;a[e+24276>>2]=Xqa|0;a[e+24288>>2]=Wqa|0;a[e+24300>>2]=Vqa|0;a[e+24312>>2]=Uqa|0;a[e+24324>>2]=Tqa|0;a[e+24336>>2]=Qqa|0;a[e+24348>>2]=Pqa|0;a[e+24360>>2]=Oqa|0;a[e+24372>>2]=Nqa|0;a[e+24384>>2]=Mqa|0;a[e+24396>>2]=Lqa|0;a[e+24408>>2]=Kqa|0;a[e+24420>>2]=Jqa|0;a[e+24432>>2]=Iqa|0;a[e+24444>>2]=Hqa|0;a[e+24456>>2]=Eqa|0;a[e+24468>>2]=Dqa|0;a[e+24480>>2]=Cqa|0;a[e+24492>>2]=Bqa|0;a[e+24504>>2]=zqa|0;a[e+24516>>2]=yqa|0;a[e+24528>>2]=xqa|0;a[e+24540>>2]=wqa|0;a[e+24552>>2]=vqa|0;a[e+24564>>2]=uqa|0;a[e+24576>>2]=rqa|0;a[e+24588>>2]=qqa|0;a[e+24600>>2]=pqa|0;a[e+24612>>2]=oqa|0;a[e+24624>>2]=mqa|0;a[e+24636>>2]=kqa|0;a[e+24648>>2]=iqa|0;a[e+24660>>2]=hqa|0;a[e+24672>>2]=gqa|0;a[e+24684>>2]=fqa|0;a[e+24696>>2]=cqa|0;a[e+24708>>2]=bqa|0;a[e+24720>>2]=aqa|0;a[e+24732>>2]=$pa|0;a[e+24744>>2]=Xpa|0;a[e+24756>>2]=Vpa|0;a[e+24768>>2]=Upa|0;a[e+24780>>2]=Tpa|0;a[e+24792>>2]=Spa|0;a[e+24804>>2]=Rpa|0;a[e+24816>>2]=Opa|0;a[e+24828>>2]=Npa|0;a[e+24840>>2]=Mpa|0;a[e+24852>>2]=Lpa|0;a[e+24864>>2]=Ipa|0;a[e+24876>>2]=Gpa|0;a[e+24888>>2]=Fpa|0;a[e+24900>>2]=Epa|0;a[e+24912>>2]=Dpa|0;a[e+24924>>2]=Cpa|0;a[e+24936>>2]=zpa|0;a[e+24948>>2]=ypa|0;a[e+24960>>2]=xpa|0;a[e+24972>>2]=wpa|0;a[e+24984>>2]=upa|0;a[e+24996>>2]=Yj|0;a[e+25008>>2]=spa|0;a[e+25020>>2]=rpa|0;a[e+25032>>2]=qpa|0;a[e+25044>>2]=ppa|0;a[e+25056>>2]=Sz|0;a[e+25068>>2]=Rz|0;a[e+25080>>2]=mpa|0;a[e+25092>>2]=lpa|0;a[e+25104>>2]=jpa|0;a[e+25116>>2]=hpa|0;a[e+25128>>2]=gpa|0;a[e+25140>>2]=fpa|0;a[e+25152>>2]=epa|0;a[e+25164>>2]=dpa|0;a[e+25176>>2]=apa|0;a[e+25188>>2]=$oa|0;a[e+25200>>2]=Zoa|0;a[e+25212>>2]=Yoa|0;a[e+25224>>2]=Woa|0;a[e+25236>>2]=Uoa|0;a[e+25248>>2]=Toa|0;a[e+25260>>2]=Soa|0;a[e+25272>>2]=Roa|0;a[e+25284>>2]=Qoa|0;a[e+25296>>2]=Noa|0;a[e+25308>>2]=Moa|0;a[e+25320>>2]=Loa|0;a[e+25332>>2]=Koa|0;a[e+25344>>2]=Ioa|0;a[e+25356>>2]=Eoa|0;a[e+25368>>2]=Doa|0;a[e+25380>>2]=Coa|0;a[e+25392>>2]=Boa|0;a[e+25404>>2]=Aoa|0;a[e+25416>>2]=xoa|0;a[e+25428>>2]=woa|0;a[e+25440>>2]=voa|0;a[e+25452>>2]=uoa|0;a[e+25464>>2]=toa|0;a[e+25476>>2]=soa|0;a[e+25488>>2]=roa|0;a[e+25500>>2]=qoa|0;a[e+25512>>2]=poa|0;a[e+25524>>2]=ooa|0;a[e+25536>>2]=loa|0;a[e+25548>>2]=koa|0;a[e+25560>>2]=joa|0;a[e+25572>>2]=ioa|0;a[e+25584>>2]=goa|0;a[e+25596>>2]=foa|0;a[e+25608>>2]=eoa|0;a[e+25620>>2]=doa|0;a[e+25632>>2]=coa|0;a[e+25644>>2]=boa|0;a[e+25656>>2]=Zna|0;a[e+25668>>2]=Yna|0;a[e+25680>>2]=Xna|0;a[e+25692>>2]=Wna|0;a[e+25704>>2]=Una|0;a[e+25716>>2]=Tna|0;a[e+25728>>2]=Rna|0;a[e+25740>>2]=Qna|0;a[e+25752>>2]=Pna|0;a[e+25764>>2]=Ona|0;a[e+25776>>2]=Lna|0;a[e+25788>>2]=Kna|0;a[e+25800>>2]=Jna|0;a[e+25812>>2]=Ina|0;a[e+25824>>2]=Gna|0;a[e+25836>>2]=Fna|0;a[e+25848>>2]=Dna|0;a[e+25860>>2]=Cna|0;a[e+25872>>2]=Bna|0;a[e+25884>>2]=Ana|0;a[e+25896>>2]=xna|0;a[e+25908>>2]=wna|0;a[e+25920>>2]=vna|0;a[e+25932>>2]=tna|0;a[e+25944>>2]=qna|0;a[e+25956>>2]=ona|0;a[e+25968>>2]=nna|0;a[e+25980>>2]=mna|0;a[e+25992>>2]=lna|0;a[e+26004>>2]=kna|0;a[e+26016>>2]=hna|0;a[e+26028>>2]=gna|0;a[e+26040>>2]=fna|0;a[e+26052>>2]=ena|0;a[e+26064>>2]=bna|0;a[e+26076>>2]=ana|0;a[e+26088>>2]=$ma|0;a[e+26100>>2]=Zma|0;a[e+26112>>2]=Yma|0;a[e+26124>>2]=Xma|0;a[e+26136>>2]=Uma|0;a[e+26148>>2]=Tma|0;a[e+26160>>2]=Sma|0;a[e+26172>>2]=Rma|0;a[e+26184>>2]=Pma|0;a[e+26196>>2]=Oma|0;a[e+26208>>2]=Nma|0;a[e+26220>>2]=Mma|0;a[e+26232>>2]=Lma|0;a[e+26244>>2]=Kma|0;a[e+26256>>2]=Hma|0;a[e+26268>>2]=Gma|0;a[e+26280>>2]=Fma|0;a[e+26292>>2]=Pz|0;a[e+26304>>2]=Dma|0;a[e+26316>>2]=Cma|0;a[e+26328>>2]=Bma|0;a[e+26340>>2]=Ama|0;a[e+26352>>2]=Oz|0;a[e+26364>>2]=zma|0;a[e+26376>>2]=wma|0;a[e+26388>>2]=vma|0;a[e+26400>>2]=uma|0;a[e+26412>>2]=Nz|0;a[e+26424>>2]=sma|0;a[e+26436>>2]=rma|0;a[e+26448>>2]=qma|0;a[e+26460>>2]=pma|0;a[e+26472>>2]=Lz|0;a[e+26484>>2]=qh|0;a[e+26496>>2]=Kz|0;a[e+26508>>2]=mma|0;a[e+26520>>2]=lma|0;a[e+26532>>2]=kma|0;a[e+26544>>2]=hma|0;a[e+26556>>2]=Jz|0;a[e+26568>>2]=fma|0;a[e+26580>>2]=ema|0;a[e+26592>>2]=dma|0;a[e+26604>>2]=cma|0;a[e+26616>>2]=Iz|0;a[e+26628>>2]=Hz|0;a[e+26640>>2]=ama|0;a[e+26652>>2]=Zla|0;a[e+26664>>2]=Xla|0;a[e+26676>>2]=Wla|0;a[e+26688>>2]=Gz|0;a[e+26700>>2]=Fz|0;a[e+26712>>2]=Vla|0;a[e+26724>>2]=Ula|0;a[e+26736>>2]=Rla|0;a[e+26748>>2]=Pla|0;a[e+26760>>2]=Ez|0;a[e+26772>>2]=Ola|0;a[e+26784>>2]=Mla|0;a[e+26796>>2]=Lla|0;a[e+26808>>2]=Kla|0;a[e+26820>>2]=Dz|0;a[e+26832>>2]=Cz|0;a[e+26844>>2]=Ila|0;a[e+26856>>2]=Fla|0;a[e+26868>>2]=Ela|0;a[e+26880>>2]=Dla|0;a[e+26892>>2]=Cla|0;a[e+26904>>2]=Ala|0;a[e+26916>>2]=zla|0;a[e+26928>>2]=yla|0;a[e+26940>>2]=xla|0;a[e+26952>>2]=Az|0;a[e+26964>>2]=zz|0;a[e+26976>>2]=qe|0;a[e+26988>>2]=yz|0;a[e+27e3>>2]=ula|0;a[e+27012>>2]=sla|0;a[e+27024>>2]=rla|0;a[e+27036>>2]=qla|0;a[e+27048>>2]=xz|0;a[e+27060>>2]=ola|0;a[e+27072>>2]=nla|0;a[e+27084>>2]=mla|0;a[e+27096>>2]=jla|0;a[e+27108>>2]=wz|0;a[e+27120>>2]=uz|0;a[e+27132>>2]=ila|0;a[e+27144>>2]=gla|0;a[e+27156>>2]=ela|0;a[e+27168>>2]=dla|0;a[e+27180>>2]=cla|0;a[e+27192>>2]=sz|0;a[e+27204>>2]=rz|0;a[e+27216>>2]=pz|0;a[e+27228>>2]=$ka|0;a[e+27240>>2]=Zka|0;a[e+27252>>2]=Yka|0;a[e+27264>>2]=Wka|0;a[e+27276>>2]=oz|0;a[e+27288>>2]=Vka|0;a[e+27300>>2]=Uka|0;a[e+27312>>2]=Tka|0;a[e+27324>>2]=Ska|0;a[e+27336>>2]=nz|0;a[e+27348>>2]=mz|0;a[e+27360>>2]=Zm|0;a[e+27372>>2]=Pka|0;a[e+27384>>2]=Oka|0;a[e+27396>>2]=Nka|0;a[e+27408>>2]=Mka|0;a[e+27420>>2]=hr|0;a[e+27432>>2]=Lka|0;a[e+27444>>2]=Kka|0;a[e+27456>>2]=Hka|0;a[e+27468>>2]=Gka|0;a[e+27480>>2]=lz|0;a[e+27492>>2]=kz|0;a[e+27504>>2]=jz|0;a[e+27516>>2]=Fka|0;a[e+27528>>2]=Eka|0;a[e+27540>>2]=Dka|0;a[e+27552>>2]=Cka|0;a[e+27564>>2]=iz|0;a[e+27576>>2]=zka|0;a[e+27588>>2]=yka|0;a[e+27600>>2]=xka|0;a[e+27612>>2]=wka|0;a[e+27624>>2]=hz|0;a[e+27636>>2]=gz|0;a[e+27648>>2]=fz|0;a[e+27660>>2]=ez|0;a[e+27672>>2]=dz|0;a[e+27684>>2]=cz|0;a[e+27696>>2]=bz|0;a[e+27708>>2]=UB|0;a[e+27720>>2]=tka|0;a[e+27732>>2]=ska|0;a[e+27744>>2]=qka|0;a[e+27756>>2]=oka|0;a[e+27768>>2]=TB|0;a[e+27780>>2]=RB|0;a[e+27792>>2]=nka|0;a[e+27804>>2]=mka|0;a[e+27816>>2]=jka|0;a[e+27828>>2]=ika|0;a[e+27840>>2]=fr|0;a[e+27852>>2]=hka|0;a[e+27864>>2]=sg|0;a[e+27876>>2]=PB|0;a[e+27888>>2]=MB|0;a[e+27900>>2]=fka|0;a[e+27912>>2]=eka|0;a[e+27924>>2]=dka|0;a[e+27936>>2]=$ja|0;a[e+27948>>2]=LB|0;a[e+27960>>2]=Yja|0;a[e+27972>>2]=Xja|0;a[e+27984>>2]=Wja|0;a[e+27996>>2]=Vja|0;a[e+28008>>2]=KB|0;a[e+28020>>2]=Tja|0;a[e+28032>>2]=Sja|0;a[e+28044>>2]=Rja|0;a[e+28056>>2]=Oja|0;a[e+28068>>2]=JB|0;a[e+28080>>2]=Nja|0;a[e+28092>>2]=Mja|0;a[e+28104>>2]=Lja|0;a[e+28116>>2]=Kja|0;a[e+28128>>2]=IB|0;a[e+28140>>2]=HB|0;a[e+28152>>2]=Jja|0;a[e+28164>>2]=Ija|0;a[e+28176>>2]=Fja|0;a[e+28188>>2]=Eja|0;a[e+28200>>2]=GB|0;a[e+28212>>2]=Dja|0;a[e+28224>>2]=Cja|0;a[e+28236>>2]=Bja|0;a[e+28248>>2]=Aja|0;a[e+28260>>2]=FB|0;a[e+28272>>2]=yja|0;a[e+28284>>2]=xja|0;a[e+28296>>2]=uja|0;a[e+28308>>2]=tja|0;a[e+28320>>2]=EB|0;a[e+28332>>2]=BB|0;a[e+28344>>2]=sja|0;a[e+28356>>2]=pja|0;a[e+28368>>2]=oja|0;a[e+28380>>2]=nja|0;a[e+28392>>2]=AB|0;a[e+28404>>2]=zB|0;a[e+28416>>2]=kja|0;a[e+28428>>2]=jja|0;a[e+28440>>2]=ija|0;a[e+28452>>2]=hja|0;a[e+28464>>2]=yB|0;a[e+28476>>2]=fja|0;a[e+28488>>2]=eja|0;a[e+28500>>2]=dja|0;a[e+28512>>2]=cja|0;a[e+28524>>2]=xB|0;a[e+28536>>2]=er|0;a[e+28548>>2]=$ia|0;a[e+28560>>2]=Zia|0;a[e+28572>>2]=Yia|0;a[e+28584>>2]=Xia|0;a[e+28596>>2]=Vj|0;a[e+28608>>2]=Wia|0;a[e+28620>>2]=Via|0;a[e+28632>>2]=Uia|0;a[e+28644>>2]=Tia|0;a[e+28656>>2]=vB|0;a[e+28668>>2]=Qia|0;a[e+28680>>2]=Pia|0;a[e+28692>>2]=Nia|0;a[e+28704>>2]=Mia|0;a[e+28716>>2]=uB|0;a[e+28728>>2]=Lia|0;a[e+28740>>2]=Kia|0;a[e+28752>>2]=Jia|0;a[e+28764>>2]=Iia|0;a[e+28776>>2]=tB|0;a[e+28788>>2]=sB|0;a[e+28800>>2]=Eia|0;a[e+28812>>2]=Dia|0;a[e+28824>>2]=Cia|0;a[e+28836>>2]=Bia|0;a[e+28848>>2]=rB|0;a[e+28860>>2]=qB|0;a[e+28872>>2]=Aia|0;a[e+28884>>2]=zia|0;a[e+28896>>2]=wia|0;a[e+28908>>2]=via|0;a[e+28920>>2]=pB|0;a[e+28932>>2]=uia|0;a[e+28944>>2]=sia|0;a[e+28956>>2]=ria|0;a[e+28968>>2]=qia|0;a[e+28980>>2]=oB|0;a[e+28992>>2]=pia|0;a[e+29004>>2]=oia|0;a[e+29016>>2]=lia|0;a[e+29028>>2]=kia|0;a[e+29040>>2]=nB|0;a[e+29052>>2]=jia|0;a[e+29064>>2]=hia|0;a[e+29076>>2]=gia|0;a[e+29088>>2]=fia|0;a[e+29100>>2]=lB|0;a[e+29112>>2]=eia|0;a[e+29124>>2]=dia|0;a[e+29136>>2]=aia|0;a[e+29148>>2]=$ha|0;a[e+29160>>2]=kB|0;a[e+29172>>2]=Zha|0;a[e+29184>>2]=Xha|0;a[e+29196>>2]=Wha|0;a[e+29208>>2]=Vha|0;a[e+29220>>2]=jB|0;a[e+29232>>2]=hB|0;a[e+29244>>2]=Uha|0;a[e+29256>>2]=Rha|0;a[e+29268>>2]=Qha|0;a[e+29280>>2]=Pha|0;a[e+29292>>2]=gB|0;a[e+29304>>2]=Oha|0;a[e+29316>>2]=Nha|0;a[e+29328>>2]=Mha|0;a[e+29340>>2]=Lha|0;a[e+29352>>2]=fB|0;a[e+29364>>2]=Kha|0;a[e+29376>>2]=Hha|0;a[e+29388>>2]=Gha|0;a[e+29400>>2]=Fha|0;a[e+29412>>2]=eB|0;a[e+29424>>2]=Eha|0;a[e+29436>>2]=Dha|0;a[e+29448>>2]=Cha|0;a[e+29460>>2]=Aha|0;a[e+29472>>2]=dB|0;a[e+29484>>2]=zha|0;a[e+29496>>2]=xha|0;a[e+29508>>2]=wha|0;a[e+29520>>2]=uha|0;a[e+29532>>2]=cB|0;a[e+29544>>2]=tha|0;a[e+29556>>2]=qha|0;a[e+29568>>2]=pha|0;a[e+29580>>2]=oha|0;a[e+29592>>2]=On|0;a[e+29604>>2]=aB|0;a[e+29616>>2]=kha|0;a[e+29628>>2]=jha|0;a[e+29640>>2]=iha|0;a[e+29652>>2]=hha|0;a[e+29664>>2]=$A|0;a[e+29676>>2]=fha|0;a[e+29688>>2]=eha|0;a[e+29700>>2]=dha|0;a[e+29712>>2]=cha|0;a[e+29724>>2]=bha|0;a[e+29736>>2]=ZA|0;a[e+29748>>2]=Zga|0;a[e+29760>>2]=Yga|0;a[e+29772>>2]=Xga|0;a[e+29784>>2]=Wga|0;a[e+29796>>2]=hf|0;a[e+29808>>2]=YA|0;a[e+29820>>2]=Uj|0;a[e+29832>>2]=Vga|0;a[e+29844>>2]=Uga|0;a[e+29856>>2]=Rga|0;a[e+29868>>2]=Qga|0;a[e+29880>>2]=XA|0;a[ed+4>>2]=ae|0;a[ed+12>>2]=Xq|0;a[ed+20>>2]=De|0;a[ed+28>>2]=Xg|0;a[ed+36>>2]=Wq|0;a[ed+44>>2]=Vq|0;a[ed+52>>2]=Uq|0;a[ed+60>>2]=Wg|0;a[ed+68>>2]=Vm|0;a[ed+76>>2]=Um|0;a[ed+84>>2]=Tm|0;a[ed+92>>2]=Sm|0;a[ed+100>>2]=Rm|0;a[ed+108>>2]=Qm|0;a[ed+116>>2]=R|0;a[az+4>>2]=Wm|0;a[Mh>>2]=fba|0;a[Mh+4>>2]=tv|0;a[Mh+8>>2]=yr|0;a[Mh+12>>2]=taa|0;a[Mh+16>>2]=baa|0;a[nj+20>>2]=328;a[Uh+20>>2]=244;a[aw+20>>2]=290;a[Rp+20>>2]=244;a[nn+4>>2]=ak;a[nn+8>>2]=374;a[nn+12>>2]=298;a[nn+16>>2]=42;a[on+4>>2]=pn;a[on+8>>2]=24;a[on+12>>2]=294;a[on+16>>2]=180;VB=d([2,0,0,0],["i8*",0,0,0],c);a[ak>>2]=VB+8|0;a[ak+4>>2]=YPa|0;a[ak+8>>2]=cc;a[pn>>2]=VB+8|0;a[pn+4>>2]=ZPa|0;a[pn+8>>2]=ak;a[W>>2]=NB|0;a[W+4>>2]=Jb;a[W+8>>2]=pl;a[W+16>>2]=ILa|0;a[W+20>>2]=Jb;a[W+24>>2]=aV;a[W+32>>2]=Gs|0;a[W+36>>2]=Jb;a[W+40>>2]=Yy;a[W+48>>2]=wGa|0;a[W+52>>2]=Jb;a[W+56>>2]=Yy;a[W+64>>2]=SDa|0;a[W+68>>2]=Jb;a[W+72>>2]=Zy;a[W+80>>2]=vBa|0;a[W+84>>2]=UU;a[W+88>>2]=Zy;a[W+96>>2]=bza|0;a[W+100>>2]=Jb;a[W+104>>2]=lV;a[W+112>>2]=uwa|0;a[W+116>>2]=Jb;a[W+120>>2]=WU;a[W+128>>2]=sg|0;a[W+132>>2]=Jb;a[W+136>>2]=Xy;a[W+144>>2]=osa|0;a[W+148>>2]=Jb;a[W+152>>2]=Xy;a[W+160>>2]=KA|0;a[W+164>>2]=Jb;a[W+168>>2]=oV;a[W+176>>2]=pna|0;a[W+180>>2]=Jb;a[W+184>>2]=XU;a[W+192>>2]=fla|0;a[W+196>>2]=Jb;a[W+200>>2]=cV;a[W+208>>2]=qja|0;a[W+212>>2]=Jb;a[W+216>>2]=iV;a[W+224>>2]=rha|0;a[W+228>>2]=Jb;a[W+232>>2]=bV;a[W+240>>2]=vga|0;a[W+244>>2]=Jb;a[W+248>>2]=jV;a[W+256>>2]=Sfa|0;a[W+260>>2]=Jb;a[W+264>>2]=$U;a[W+272>>2]=pfa|0;a[W+276>>2]=Jb;a[W+280>>2]=dV;a[W+288>>2]=Mea|0;a[W+292>>2]=Jb;a[W+296>>2]=eV;a[W+304>>2]=qea|0;a[W+308>>2]=Jb;a[W+312>>2]=YU;a[W+320>>2]=Uda|0;a[W+324>>2]=Jb;a[W+328>>2]=kV;a[W+336>>2]=Bda|0;a[W+340>>2]=Jb;a[W+344>>2]=qV;a[W+352>>2]=ida|0;a[W+356>>2]=Jb;a[W+360>>2]=pV;a[W+368>>2]=Nca|0;a[W+372>>2]=Jb;a[W+376>>2]=pl;a[W+384>>2]=qca|0;a[W+388>>2]=Jb;a[W+392>>2]=pl;a[W+400>>2]=Zba|0;a[W+404>>2]=Jb;a[W+408>>2]=ZU;a[W+416>>2]=Fba|0;a[W+420>>2]=Jb;a[W+424>>2]=nV;a[W+432>>2]=kba|0;a[W+436>>2]=Jb;a[W+440>>2]=mV;a[W+448>>2]=Taa|0;a[W+452>>2]=Jb;a[W+456>>2]=VU;a[W+464>>2]=Caa|0;a[W+468>>2]=Jb;a[W+472>>2]=fV;a[W+480>>2]=laa|0;a[W+484>>2]=Jb;a[W+488>>2]=gV;a[W+496>>2]=V$|0;a[W+500>>2]=Jb;a[W+504>>2]=hV;a[W+512>>2]=F$|0;a[W+516>>2]=Jb;a[W+520>>2]=sV;a[W+528>>2]=m$|0;a[W+532>>2]=Jb;a[W+536>>2]=rV;a[W+544>>2]=X9|0;a[W+548>>2]=Jb;a[W+552>>2]=tV;a[W+560>>2]=jv|0;a[W+564>>2]=Wy;a[W+576>>2]=eu|0;a[W+580>>2]=Wy;a[W+592>>2]=Hs|0;a[W+596>>2]=Yq;a[nk>>2]=QEa|0;a[nk+4>>2]=YLa|0;a[nk+8>>2]=una|0;a[Mu+16>>2]=246;a[Xc>>2]=WB;a[iQa>>2]=$Pa;a[jQa>>2]=aQa;a[Jo>>2]=bQa;a[Pn>>2]=cQa;a[kQa>>2]=WB;a[lQa>>2]=dQa;a[mQa>>2]=eQa;a[nQa>>2]=fQa;a[oQa>>2]=gQa;a[pQa>>2]=hQa;a[Mr>>2]=DAa|0;a[xe>>2]=Dra|0;a[xe+8>>2]=hIa|0;a[xe+16>>2]=Gia|0;a[xe+24>>2]=NB|0;a[xe+32>>2]=KA|0;a[xe+40>>2]=ok|0;a[xe+48>>2]=sg|0;a[xe+56>>2]=M2|0;a[xe+64>>2]=c0|0;a[xe+72>>2]=oY|0;a[xe+80>>2]=XPa|0;a[gh>>2]=ft|0;a[gh+8>>2]=cj|0;a[gh+16>>2]=SGa|0;a[gh+24>>2]=Zt|0;a[gh+32>>2]=XCa|0;a[Ai>>2]=gya|0;a[Ai+12>>2]=Bva|0;a[Ai+24>>2]=zv|0;a[Ai+36>>2]=sg|0;var $c=Math.sqrt,DQa,EQa,va={Fb:7,h:13,Gb:98,Hb:99,Ib:97,Jb:11,Kb:114,j:9,Lb:74,Mb:16,Nb:125,Ob:10,Pb:103,Qb:111,Rb:104,Sb:35,Tb:89,Ub:33,Vb:122,ha:17,Wb:14,Xb:27,Yb:113,Zb:43,$b:84,ac:115,bc:4,i:22,r:5,cc:106,N:21,Ea:40,dc:24,ec:31,fc:90,gc:72,hc:36,ic:100,jc:102,kc:101,lc:23,mc:105,nc:61,oc:19,O:2,pc:8,qc:37,rc:67,sc:12,tc:42,uc:92,vc:28,wc:63,xc:60,yc:38,zc:107,ia:20,Ac:39,Bc:131,Cc:88,Dc:95,Ec:25,ja:6,Fc:75,Gc:130,Hc:1,Ic:32,Jc:71,Kc:93,Lc:91,ka:34,Mc:30,Fa:29,Nc:3,Oc:116,Pc:62,Qc:110,Rc:26,Sc:11,Tc:18};oa=zg=Om=0;var Q={Sa:"/",gb:2,a:[xc],va:wc,bb:(function(a,b){for(var c=a[0],d=1;d<a.length;d++){"/"!=c[c.length-1]&&(c+="/"),c+=a[d]}b&&"/"==c[0]&&(c=c.substr(1));return c}),la:(function(a,b){if("string"!==typeof a){return xc}b===cc&&(b=Q.Sa);a&&"/"==a[0]&&(b="");for(var c=(b+"/"+a).split("/").reverse(),d=[""];c.length;){var e=c.pop();""==e||"."==e||(".."==e?1<d.length&&d.pop():d.push(e))}return 1==d.length?"/":d.join("/")}),D:(function(a,b,c){var d={$a:ee,I:ee,error:0,name:xc,path:xc,object:xc,L:ee,ba:xc,u:xc},a=Q.la(a);if("/"==a){d.$a=wc,d.I=d.L=wc,d.name="/",d.path=d.ba="/",d.object=d.u=Q.root}else{if(a!==xc){for(var c=c||0,a=a.slice(1).split("/"),e=Q.root,f=[""];a.length;){1==a.length&&e.e&&(d.L=wc,d.ba=1==f.length?"/":f.join("/"),d.u=e,d.name=a[0]);var h=a.shift();if(e.e){if(e.v){if(!e.b.hasOwnProperty(h)){d.error=va.O;break}}else{d.error=va.h;break}}else{d.error=va.ia;break}e=e.b[h];if(e.link&&!(b&&0==a.length)){if(40<c){d.error=va.Ea;break}d=Q.la(e.link,f.join("/"));d=Q.D([d].concat(a).join("/"),b,c+1);break}f.push(h);0==a.length&&(d.I=wc,d.path=f.join("/"),d.object=e)}}}return d}),o:(function(a,b){Q.ra();var c=Q.D(a,b);if(c.I){return c.object}Ea(c.error);return xc}),oa:(function(a,b,c,d,e){a||(a="/");"string"===typeof a&&(a=Q.o(a));a||(Ea(va.h),Ub(Error("Parent path must exist.")));a.e||(Ea(va.ia),Ub(Error("Parent must be a folder.")));!a.write&&!Q.va&&(Ea(va.h),Ub(Error("Parent folder must be writeable.")));if(!b||"."==b||".."==b){Ea(va.O),Ub(Error("Name must not be empty."))}a.b.hasOwnProperty(b)&&(Ea(va.ha),Ub(Error("Can't overwrite object.")));a.b[b]={v:d===cc?wc:d,write:e===cc?ee:e,timestamp:Date.now(),$:Q.gb++};for(var f in c){c.hasOwnProperty(f)&&(a.b[b][f]=c[f])}return a.b[b]}),H:(function(a,b,c,d){return Q.oa(a,b,{e:wc,d:ee,b:{}},c,d)}),pa:(function(a,b,c,d){a=Q.o(a);a===xc&&Ub(Error("Invalid parent."));for(b=b.split("/").reverse();b.length;){var e=b.pop();e&&(a.b.hasOwnProperty(e)||Q.H(a,e,c,d),a=a.b[e])}return a}),G:(function(a,b,c,d,e){c.e=ee;return Q.oa(a,b,c,d,e)}),S:(function(a,b,c,d,e){if("string"===typeof c){for(var f=Array(c.length),h=0,j=c.length;h<j;++h){f[h]=c.charCodeAt(h)}c=f}c={d:ee,b:c.subarray?c.subarray(0):c};return Q.G(a,b,c,d,e)}),Pa:(function(a,b,c,d,e){if("undefined"!==typeof XMLHttpRequest){Oj||Ub("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var f=(function(a,b){this.length=b;this.ma=a;this.F=[]});f.prototype.get=(function(a){if(!(a>this.length-1||0>a)){var b=a%m;return this.Xa(Math.floor(a/m))[b]}});f.prototype.ob=(function(a){this.Xa=a});var h=new XMLHttpRequest;h.open("HEAD",c,ee);h.send(xc);200<=h.status&&300>h.status||304===h.status||Ub(Error("Couldn't load "+c+". Status: "+h.status));var j=Number(h.getResponseHeader("Content-length")),n,m=1048576;if(!((n=h.getResponseHeader("Accept-Ranges"))&&"bytes"===n)){m=j}var p=new f(m,j);p.ob((function(a){var b=a*p.ma,d=(a+1)*p.ma-1,d=Math.min(d,j-1);if("undefined"===typeof p.F[a]){var e=p.F;b>d&&Ub(Error("invalid range ("+b+", "+d+") or no bytes requested!"));d>j-1&&Ub(Error("only "+j+" bytes available! programmer error!"));var f=new XMLHttpRequest;f.open("GET",c,ee);j!==m&&f.setRequestHeader("Range","bytes="+b+"-"+d);"undefined"!=typeof Uint8Array&&(f.responseType="arraybuffer");f.overrideMimeType&&f.overrideMimeType("text/plain; charset=x-user-defined");f.send(xc);200<=f.status&&300>f.status||304===f.status||Ub(Error("Couldn't load "+c+". Status: "+f.status));b=f.response!==cc?new Uint8Array(f.response||[]):Nd(f.responseText||"",wc);e[a]=b}"undefined"===typeof p.F[a]&&Ub(Error("doXHR failed!"));return p.F[a]}));f={d:ee,b:p}}else{f={d:ee,url:c}}return Q.G(a,b,f,d,e)}),Ra:(function(a,b,c,d,e,f,h,j){function n(c){function i(c){j||Q.S(a,b,c,d,e);f&&f();rn("cp "+m)}var n=ee;K.preloadPlugins.forEach((function(a){!n&&a.canHandle(m)&&(a.handle(c,m,i,(function(){h&&h();rn("cp "+m)})),n=wc)}));n||i(c)}Tb.Ua();var m=Q.bb([a,b],wc);pr("cp "+m);"string"==typeof c?Tb.Ka(c,(function(a){n(a)}),h):n(c)}),Qa:(function(a,b,c,d,e){return Q.G(a,b,{d:ee,link:c},d,e)}),s:(function(a,b,c,d){!c&&!d&&Ub(Error("A device must have at least one callback defined."));return Q.G(a,b,{d:wc,input:c,l:d},Boolean(c),Boolean(d))}),ua:(function(a){if(a.d||a.e||a.link||a.b){return wc}var b=wc;"undefined"!==typeof XMLHttpRequest&&Ub(Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread."));if(K.read){try{a.b=Nd(K.read(a.url),wc)}catch(c){b=ee}}else{Ub(Error("Cannot load without read() or XMLHttpRequest."))}b||Ea(va.r);return b}),ra:(function(){Q.root||(Q.root={v:wc,write:wc,e:wc,d:ee,timestamp:Date.now(),$:1,b:{}})}),t:(function(a,b,e){function f(a){a===xc||10===a?(b.M(b.buffer.join("")),b.buffer=[]):b.buffer.push(k.wa(a))}Ae(!Q.t.Z,"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)");Q.t.Z=wc;Q.ra();var a=a||K.stdin,b=b||K.stdout,e=e||K.stderr,h=wc,j=wc,l=wc;a||(h=ee,a=(function(){if(!a.R||!a.R.length){var b;"undefined"!=typeof window&&"function"==typeof window.prompt?(b=window.prompt("Input: "),b===xc&&(b=String.fromCharCode(0))):"function"==typeof readline&&(b=readline());b||(b="");a.R=Nd(b+"\n",wc)}return a.R.shift()}));var k=new Qa.Q;b||(j=ee,b=f);b.M||(b.M=K.print);b.buffer||(b.buffer=[]);e||(l=ee,e=f);e.M||(e.M=K.print);e.buffer||(e.buffer=[]);try{Q.H("/","tmp",wc,wc)}catch(n){}var m=Q.H("/","dev",wc,wc),p=Q.s(m,"stdin",a),s=Q.s(m,"stdout",xc,b),e=Q.s(m,"stderr",xc,e);Q.s(m,"tty",a,b);Q.a[1]={path:"/dev/stdin",object:p,position:0,p:wc,q:ee,K:ee,aa:!h,error:ee,f:ee,g:[]};Q.a[2]={path:"/dev/stdout",object:s,position:0,p:ee,q:wc,K:ee,aa:!j,error:ee,f:ee,g:[]};Q.a[3]={path:"/dev/stderr",object:e,position:0,p:ee,q:wc,K:ee,aa:!l,error:ee,f:ee,g:[]};Om=d([1],"void*",$g);zg=d([2],"void*",$g);oa=d([3],"void*",$g);Q.pa("/","dev/shm/tmp",wc,wc);for(h=Q.a.length;h<Math.max(Om,zg,oa)+4;h++){Q.a[h]=xc}Q.a[Om]=Q.a[1];Q.a[zg]=Q.a[2];Q.a[oa]=Q.a[3];d([d([0,0,0,0,Om,0,0,0,zg,0,0,0,oa,0,0,0],"void*",c)],"void*",c)}),jb:(function(){Q.t.Z&&(Q.a[2]&&0<Q.a[2].object.l.buffer.length&&Q.a[2].object.l(10),Q.a[3]&&0<Q.a[3].object.l.buffer.length&&Q.a[3].object.l(10))}),ud:(function(a){"./"==a.substr(0,2)&&(a=a.substr(2));return a}),$c:(function(a){a=Q.D(a);(!a.L||!a.I)&&Ub("Invalid path "+a);delete a.u.b[a.name]})},rr=0,se=Math.cos,Ce=Math.sin,Cf=Math.atan2,be=Math.abs,jC=xc,xQa={A:72,tb:0,vb:4,wb:8,yb:12,Bb:16,ub:20,zb:24,Ab:28,ea:32,qd:36,za:40,rd:44,ya:48,sd:52,qb:56,rb:60,td:64},ur=xc,Ee={},IQa,yQa={A:16,yd:0,xd:4,wd:8,vd:12},vr={1:"Operation not permitted",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",8:"Exec format error",9:"Bad file descriptor",10:"No child processes",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",16:"Device or resource busy",17:"File exists",18:"Invalid 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:"Inappropriate ioctl for device",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:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock avoided",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many levels of symbolic links",42:"No message of desired type",43:"Identifier removed",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",67:"Link has been severed",71:"Protocol error",72:"Multihop attempted",74:"Bad message",75:"Value too large for defined data type",84:"Invalid or incomplete multibyte or wide character",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:"Protocol not supported",95:"Operation not supported",97:"Address family not supported by protocol",98:"Address already in use",99:"Cannot assign requested address",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",103:"Software caused connection abort",104:"Connection reset by peer",105:"No buffer space available",106:"Transport endpoint is already connected",107:"Transport endpoint is not connected",110:"Connection timed out",111:"Connection refused",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale NFS file handle",122:"Disk quota exceeded",125:"Operation canceled",130:"Owner died",131:"State not recoverable"},JQa=Ma,kj=Math.pow,tM=Va,KQa=hC,cQ=Math.ceil,Tb={k:{nb:xc,xa:ee,paused:ee,ld:[],pause:(function(){Tb.k.xa=wc}),mb:(function(){Tb.k.paused&&(Tb.k.paused=ee,Tb.k.nb());Tb.k.xa=ee}),updateStatus:(function(){if(K.setStatus){var a=K.statusMessage||"Please wait...",b=Tb.k.md,c=Tb.k.ad;b?b<c?K.setStatus(a+" ("+(c-b)+"/"+c+")"):K.setStatus(a):K.setStatus("")}})},hb:ee,eb:[],Bd:[],Ua:(function(){function a(b){return{jpg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[b.substr(-3)]}if(!Tb.Va){Tb.Va=wc;try{new Blob,Tb.J=wc}catch(b){Tb.J=ee,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Tb.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:!Tb.J?console.log("warning: no BlobBuilder"):xc;Tb.P="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:console.log("warning: cannot create object URLs");K.preloadPlugins||(K.preloadPlugins=[]);K.preloadPlugins.push({canHandle:(function(a){return a.substr(-4)in{".jpg":1,".png":1,".bmp":1}}),handle:(function(b,c,d,e){var f=xc;if(Tb.J){try{f=new Blob([b],{type:a(c)})}catch(h){Qa.w("Blob constructor present but fails: "+h+"; falling back to blob builder")}}f||(f=new Tb.BlobBuilder,f.append((new Uint8Array(b)).buffer),f=f.getBlob());var j=Tb.P.createObjectURL(f);Ae("string"==typeof j,"createObjectURL must return a url as a string");var m=new Image;m.onload=(function(){Ae(m.complete,"Image "+c+" could not be decoded");var a=document.createElement("canvas");a.width=m.width;a.height=m.height;a.getContext("2d").drawImage(m,0,0);K.preloadedImages[c]=a;Tb.P.revokeObjectURL(j);d&&d(b)});m.onerror=(function(){console.log("Image "+j+" could not be decoded");e&&e()});m.src=j})});K.preloadPlugins.push({canHandle:(function(a){return a.substr(-4)in{".ogg":1,".wav":1,".mp3":1}}),handle:(function(b,c,d,e){function f(a){j||(j=wc,K.preloadedAudios[c]=a,d&&d(b))}function h(){j||(j=wc,K.preloadedAudios[c]=new Audio,e&&e())}var j=ee;if(Tb.J){try{var m=new Blob([b],{type:a(c)})}catch(p){return h()}m=Tb.P.createObjectURL(m);Ae("string"==typeof m,"createObjectURL must return a url as a string");var r=new Audio;r.addEventListener("canplaythrough",(function(){f(r)}),ee);r.onerror=(function(){if(!j){console.log("warning: browser could not fully decode audio "+c+", trying slower base64 approach");for(var a="",d=0,e=0,h=0;h<b.length;h++){d=d<<8|b[h];for(e+=8;6<=e;){var k=d>>e-6&63,e=e-6,a=a+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[k]}}2==e?(a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(d&3)<<4],a+="=="):4==e&&(a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(d&15)<<2],a+="=");r.src="data:audio/x-"+c.substr(-3)+";base64,"+a;f(r)}});r.src=m;setTimeout((function(){f(r)}),1e4)}else{return h()}})})}}),Yc:(function(a,b,c){try{var d=a.getContext(b?"experimental-webgl":"2d");d||Ub(":(")}catch(e){return K.print("Could not create canvas - "+e),xc}b&&(a.style.backgroundColor="black",a.addEventListener("webglcontextlost",(function(){alert("WebGL context lost. You will need to reload the page.")}),ee));c&&(K.Zc=d,K.Ad=b,Tb.eb.forEach((function(a){a()})));return d}),ca:(function(){function a(){var b=ee;if((document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement)===c){c.kb=c.requestPointerLock||c.mozRequestPointerLock||c.webkitRequestPointerLock,c.kb(),b=wc}if(K.onFullScreen){K.onFullScreen(b)}}function b(){Tb.hb=document.pointerLockElement===c||document.mozPointerLockElement===c||document.webkitPointerLockElement===c}var c=K.canvas;document.addEventListener("fullscreenchange",a,ee);document.addEventListener("mozfullscreenchange",a,ee);document.addEventListener("webkitfullscreenchange",a,ee);document.addEventListener("pointerlockchange",b,ee);document.addEventListener("mozpointerlockchange",b,ee);document.addEventListener("webkitpointerlockchange",b,ee);c.ca=c.requestFullScreen||c.mozRequestFullScreen||(c.webkitRequestFullScreen?(function(){c.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}):xc);c.ca()}),requestAnimationFrame:(function(a){window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||window.setTimeout);window.requestAnimationFrame(a)}),ed:(function(a){return a.movementX||a.mozMovementX||a.webkitMovementX||0}),fd:(function(a){return a.movementY||a.mozMovementY||a.webkitMovementY||0}),Db:(function(a,b,c){var d=new XMLHttpRequest;d.open("GET",a,wc);d.responseType="arraybuffer";d.onload=(function(){200==d.status?b(d.response):c()});d.onerror=c;d.send(xc)}),Ka:(function(a,b,c){Tb.Db(a,(function(c){Ae(c,'Loading data file "'+a+'" failed (no arrayBuffer).');b(new Uint8Array(c));rn("al "+a)}),(function(){c?c():Ub('Loading data file "'+a+'" failed.')}));pr("al "+a)}),lb:[],Cb:(function(){var a=K.canvas;Tb.lb.forEach((function(b){b(a.width,a.height)}))}),od:(function(a,b,c){var d=K.canvas;d.width=a;d.height=b;c||Tb.Cb()})};IU.unshift({U:(function(){!K.noFSInit&&!Q.t.Z&&Q.t()})});CU.push({U:(function(){Q.va=ee})});tr.push({U:(function(){Q.jb()})});K.FS_createFolder=Q.H;K.FS_createPath=Q.pa;K.FS_createDataFile=Q.S;K.FS_createPreloadedFile=Q.Ra;K.FS_createLazyFile=Q.Pa;K.FS_createLink=Q.Qa;K.FS_createDevice=Q.s;Ea(0);ni.c=d([0],"i8",c);kk.c=d([0],"i8",c);mC(Ee);pC.La=d(12,"void*",c);K.requestFullScreen=(function(){Tb.ca()});K.requestAnimationFrame=(function(a){Tb.requestAnimationFrame(a)});K.pauseMainLoop=(function(){Tb.k.pause()});K.resumeMainLoop=(function(){Tb.k.mb()});qC.X=1;K._vizRenderFromString=rC;Kc.X=1;pk.X=1;zC.X=1;Er.X=1;FC.X=1;Cn.X=1;Nc.X=1;GC.X=1;Ag.X=1;yC.X=1;JC.X=1;tk.X=1;Cg.X=1;Hn.X=1;In.X=1;LC.X=1;hh.X=1;MC.X=1;NC.X=1;OC.X=1;PC.X=1;QC.X=1;RC.X=1;Ei.X=1;Or.X=1;Kn.X=1;xk.X=1;Rr.X=1;eD.X=1;gD.X=1;hD.X=1;Ck.X=1;oh.X=1;Ji.X=1;nh.X=1;Br.X=1;HD.X=1;QD.X=1;RD.X=1;JD.X=1;GD.X=1;fs.X=1;wD.X=1;xD.X=1;yD.X=1;Qi.X=1;ms.X=1;LE.X=1;IE.X=1;yE.X=1;OE.X=1;ps.X=1;xE.X=1;UE.X=1;Gi.X=1;vD.X=1;kD.X=1;Ur.X=1;lD.X=1;Tk.X=1;Ld.X=1;Uk.X=1;NE.X=1;hF.X=1;kF.X=1;Qs.X=1;$s.X=1;at.X=1;bt.X=1;qF.X=1;rF.X=1;ct.X=1;yF.X=1;Zs.X=1;ht.X=1;so.X=1;ag.X=1;jt.X=1;Fg.X=1;nc.X=1;uF.X=1;Bo.X=1;OF.X=1;aG.X=1;nG.X=1;qt.X=1;rt.X=1;RF.X=1;AG.X=1;sG.X=1;gl.X=1;rG.X=1;hl.X=1;Oo.X=1;DG.X=1;EG.X=1;HG.X=1;RG.X=1;GG.X=1;KG.X=1;LG.X=1;fg.X=1;IG.X=1;yt.X=1;jl.X=1;Wo.X=1;Vo.X=1;SG.X=1;Xo.X=1;At.X=1;zt.X=1;Bt.X=1;Et.X=1;Dt.X=1;UG.X=1;XG.X=1;Ft.X=1;ff.X=1;Jg.X=1;cH.X=1;Ii.X=1;lH.X=1;tH.X=1;vH.X=1;xH.X=1;Yi.X=1;AH.X=1;CH.X=1;FH.X=1;GH.X=1;HH.X=1;gu.X=1;hu.X=1;LH.X=1;MH.X=1;NH.X=1;OH.X=1;dp.X=1;Wt.X=1;Xt.X=1;Yt.X=1;vk.X=1;jp.X=1;Au.X=1;Wd.X=1;QH.X=1;vl.X=1;Bu.X=1;xl.X=1;UH.X=1;YH.X=1;Du.X=1;XH.X=1;WH.X=1;Eu.X=1;$H.X=1;cI.X=1;iI.X=1;np.X=1;Pu.X=1;Qu.X=1;uI.X=1;VI.X=1;Tu.X=1;Vu.X=1;av.X=1;ev.X=1;kv.X=1;mv.X=1;An.X=1;OD.X=1;Bp.X=1;bK.X=1;YJ.X=1;fK.X=1;kK.X=1;mK.X=1;nK.X=1;rK.X=1;lK.X=1;vv.X=1;tK.X=1;sK.X=1;aK.X=1;eh.X=1;nv.X=1;Re.X=1;Bn.X=1;Ke.X=1;ut.X=1;MK.X=1;OK.X=1;PK.X=1;SK.X=1;Dv.X=1;Gp.X=1;dL.X=1;eL.X=1;gL.X=1;hL.X=1;iL.X=1;Gt.X=1;Mv.X=1;jL.X=1;Ov.X=1;mL.X=1;Hp.X=1;zL.X=1;AL.X=1;Ht.X=1;DL.X=1;CL.X=1;ng.X=1;Pl.X=1;Pk.X=1;Wv.X=1;uh.X=1;Np.X=1;Op.X=1;Sf.X=1;OL.X=1;Rl.X=1;fw.X=1;hw.X=1;iw.X=1;mw.X=1;Vl.X=1;aM.X=1;cw.X=1;pw.X=1;cM.X=1;eM.X=1;hM.X=1;uw.X=1;uM.X=1;Zv.X=1;Pp.X=1;$v.X=1;zr.X=1;Dw.X=1;Ew.X=1;UM.X=1;VM.X=1;WM.X=1;cq.X=1;ZM.X=1;cN.X=1;dN.X=1;wj.X=1;Lw.X=1;hN.X=1;hm.X=1;nN.X=1;vN.X=1;wN.X=1;Jw.X=1;gN.X=1;AN.X=1;Uw.X=1;Pw.X=1;uN.X=1;DN.X=1;jm.X=1;Ww.X=1;ON.X=1;NN.X=1;SN.X=1;Zw.X=1;Yw.X=1;jq.X=1;Cj.X=1;$w.X=1;YN.X=1;ZN.X=1;lq.X=1;bx.X=1;jO.X=1;gO.X=1;hO.X=1;dx.X=1;nO.X=1;Sg.X=1;bi.X=1;ex.X=1;hx.X=1;ix.X=1;qO.X=1;tO.X=1;fx.X=1;gx.X=1;kO.X=1;lO.X=1;cx.X=1;mO.X=1;mm.X=1;ux.X=1;uO.X=1;vO.X=1;xx.X=1;pq.X=1;gm.X=1;OO.X=1;RO.X=1;SO.X=1;zx.X=1;WO.X=1;XO.X=1;Bx.X=1;lx.X=1;tq.X=1;aP.X=1;Gx.X=1;qq.X=1;Nx.X=1;Dx.X=1;Ix.X=1;Sw.X=1;uq.X=1;nP.X=1;Rw.X=1;Px.X=1;vq.X=1;vm.X=1;wm.X=1;oP.X=1;sq.X=1;wq.X=1;Jx.X=1;Kx.X=1;hP.X=1;yP.X=1;zP.X=1;gP.X=1;fP.X=1;Ux.X=1;Tx.X=1;Xx.X=1;JP.X=1;MP.X=1;NP.X=1;YP.X=1;CP.X=1;Yx.X=1;SP.X=1;UP.X=1;hQ.X=1;iQ.X=1;cy.X=1;dy.X=1;DP.X=1;EP.X=1;FP.X=1;ay.X=1;Zx.X=1;$x.X=1;nQ.X=1;oQ.X=1;pQ.X=1;qQ.X=1;yQ.X=1;zQ.X=1;tQ.X=1;mx.X=1;iy.X=1;CQ.X=1;FQ.X=1;GQ.X=1;HQ.X=1;zm.X=1;PQ.X=1;SQ.X=1;XQ.X=1;YQ.X=1;aR.X=1;dR.X=1;fR.X=1;ry.X=1;ZQ.X=1;mR.X=1;Cq.X=1;HR.X=1;TR.X=1;eS.X=1;gS.X=1;mS.X=1;Fm.X=1;NS.X=1;VS.X=1;XS.X=1;Mj.X=1;Of.X=1;eT.X=1;MT.X=1;jU.X=1;mU.X=1;pU.X=1;Gb.X=1;uU.X=1;wU.X=1;vU.X=1;AU.X=1;G.X=1;BU.X=1;yU.X=1;zU.X=1;var hk=xc;K.Na=(function(a){function b(){for(var a=0;3>a;a++){f.push(0)}}var e=a.length+1,f=[d(Nd("/bin/this.program"),"i8",c)];b();for(var h=0;h<e-1;h+=1){f.push(d(Nd(a[h]),"i8",c)),b()}f.push(0);f=d(f,"i32",c);return _main(e,f,0)});J=[0,0,(function(a){y(a,Mm|0)}),0,FC,0,(function(a,b){G(b)}),0,(function(a,b){y(a,Yfa|0);y(a,Of(b));y(a,dr|0)}),0,(function(c){var d;m[c+528|0]=0;d=c+348|0;var e=10/(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);d=(c+340|0)>>2;e=(b[0]=a[d],b[1]=a[d+1],f[0])-e;f[0]=e;a[d]=b[0];a[d+1]=b[1];m[c+529|0]=1;return 0}),0,PC,0,(function(b,c){var d=$M(a[b>>2]),e=$M(a[c>>2]);return((e|0)<(d|0)&1)-((e|0)>(d|0)&1)|0}),0,(function(b){var c;y(b,qba|0);c=(b+12|0)>>2;y(b,a[a[a[c]>>2]>>2]);y(b,lr|0);y(b,a[a[a[c]>>2]+4>>2]);y(b,kr|0);y(b,a[a[a[c]>>2]+8>>2]);y(b,oA|0)}),0,(function(b,c){return a[b>>2]-a[c>>2]|0}),0,(function(a,b,c,d){y(a,tz|0);0!=(b|0)&&0!=m[b]<<24>>24&&(y(a,ysa|0),y(a,Bo(b)),y(a,ue|0));0!=(c|0)&&0!=m[c]<<24>>24&&(y(a,nsa|0),y(a,nc(c)),y(a,ue|0));0!=(d|0)&&0!=m[d]<<24>>24&&(y(a,vy|0),y(a,nc(d)),y(a,ue|0));y(a,ar|0)}),0,(function(b,c,d){var e;0==(c|0)&&(a[Pm>>2]=d);for(var c=c-1|0,d=0,f=b;;){if((d|0)>=(c|0)){var h=b,j=f;break}var k=a[Pm>>2],n=m[k];if(0==n<<24>>24){e=339;break}a[Pm>>2]=k+1|0;k=f+1|0;m[f]=n;if(10==n<<24>>24){h=b;j=k;break}else{d=d+1|0,f=k}}339==e&&(0==(d|0)?(h=a[Pm>>2]=0,j=f):(m[f]=10,h=b,j=f+1|0));m[j]=0;return h}),0,(function(a){cc(a|0)}),0,(function(a){y(a,Xj|0)}),0,fR,0,MH,0,(function(b){var c,d=h;c=(b+12|0)>>2;0!=(a[a[c]+20>>2]|0)&&(y(b,vva|0),np(b,0,a[a[c]+20>>2]+4|0));y(b,hva|0);y(b,Vua|0);N(b,Iua|0,(j=h,h+=4,a[j>>2]=a[a[c]+28>>2],j));h=d}),0,CH,0,(function(c){var d;m[c+528|0]=0;d=(c+348|0)>>2;var e=1.1*(b[0]=a[d],b[1]=a[d+1],f[0]);f[0]=e;a[d]=b[0];a[d+1]=b[1];m[c+529|0]=1;return 0}),0,NC,0,jU,0,(function(){return Vca|0}),0,(function(b){var c=a[b+16>>2];y(b,Wj|0);y(b,nc(a[c+152>>2]));y(b,Wpa|0);y(b,kn|0);y(b,nc(a[a[c+8>>2]+12>>2]));y(b,hn|0)}),0,HR,0,(function(c,d,e,g,j,m,l,k){m=h;h+=32;l=.5*$c(g*g+j*j);d=.5*g+d;g=m|0;f[0]=d-l;a[g>>2]=b[0];a[g+4>>2]=b[1];e=.5*j+e;j=m+8|0;f[0]=e-l;a[j>>2]=b[0];a[j+4>>2]=b[1];j=m+16|0;f[0]=d+l;a[j>>2]=b[0];a[j+4>>2]=b[1];j=m+24|0;f[0]=e+l;a[j>>2]=b[0];a[j+4>>2]=b[1];Qk(c,m|0,(k>>>3&1^1)&255);h=m}),0,(function(a){y(a,gr|0)}),0,(function(c,d,e){var g=h;h+=16;c=a[c>>2];Ui(g,d,e,90*(a[a[c+20>>2]+152>>2]&3)|0);var d=g|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),e=g+8|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),j=c+96|0,j=.5*(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);if(e<-j|e>j){return h=g,0}e=c+104|0;if(d<-(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])){return h=g,0}c=c+112|0;c=d<=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0]);h=g;return c&1}),0,vH,0,tH,0,(function(b,c){var d=a[c+8>>2];0!=(d|0)&&G(d);d=a[c+24>>2];0!=(d|0)&&Ho(d);d=c;G(d)}),0,nC,0,(function(c){var d=a[a[c+16>>2]+8>>2],c=d|0,e=a[a[a[Kb>>2]>>2]+8>>2],g=a[U+20>>2];g>>>0<a[U+24>>2]>>>0||(na(U+16|0,1),g=a[U+20>>2]);m[g]=0;g=a[U+16>>2];a[U+20>>2]=g;qc(c,e,g);0!=(a[d+48>>2]|0)&&(d=a[a[a[Kb>>2]+4>>2]+8>>2],e=a[U+84>>2],e>>>0<a[U+88>>2]>>>0||(na(U+80|0,1),e=a[U+84>>2]),m[e]=0,e=a[U+80>>2],a[U+84>>2]=e,qc(c,d,e));f[0]=1;a[kc+8>>2]=b[0];a[kc+12>>2]=b[1];f[0]=1;a[kc+40>>2]=b[0];a[kc+44>>2]=b[1]}),0,(function(b){var c=a[a[b>>2]+128>>2],d=b+572|0;0==(a[d>>2]|0)&&(a[d>>2]=c|0,d=c+148|0,m[d]|=2,vv(b,c));Rr(b,c);m[b+532|0]=1}),0,mS,0,(function(c,d,e,g,m,D){g=h;y(c,cr|0);var m=a[Ug>>2],l=a[$d>>2];N(c,eA|0,(j=h,h+=8,a[j>>2]=m,a[j+4>>2]=l,j));Oy(c,D);y(c,br|0);Mq(c);y(c,bA|0);D=h;if(0<(e|0)){m=0;for(l=$z|0;;){var k=(m<<4)+d|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),n=(m<<4)+d+8|0,n=(a[$d>>2]>>>0)-(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]);N(c,X7|0,(j=h,h+=20,a[j>>2]=l,f[0]=k,a[j+4>>2]=b[0],a[j+8>>2]=b[1],f[0]=n,a[j+12>>2]=b[0],a[j+16>>2]=b[1],j));l=0==(m|0)?ly|0:Y|0;m=m+1|0;if((m|0)==(e|0)){break}}}y(c,ue|0);h=D;y(c,B8|0);h=g}),0,(function(b,c){var d=h,e=a[a[c+16>>2]+12>>2],f=a[a[c+12>>2]+12>>2];la(3,Zea|0,(j=h,h+=12,a[j>>2]=c,a[j+4>>2]=e,a[j+8>>2]=f,j));h=d;return 0}),0,(function(c,d,e){var g=h;y(c,ECa|0);Fm(c,0);y(c,VA|0);if(0<(e|0)){for(var m=0;;){var D=(m<<4)+d|0,D=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),l=(m<<4)+d+8|0,l=-(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);N(c,UA|0,(j=h,h+=16,f[0]=D,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));m=m+1|0;if((m|0)==(e|0)){break}}}y(c,Dm|0);h=g}),0,(function(a,b){y(a,Yha|0);y(a,b);y(a,wd|0)}),0,(function(b){var c;y(b,Qma|0);c=V(a[a[b>>2]+128>>2]|0,Ema|0);0!=(c|0)&&0!=m[c]<<24>>24&&(y(b,tma|0),y(b,c),y(b,jma|0));y(b,Yla|0);y(b,Nla|0);y(b,Bla|0);c=(b+12|0)>>2;y(b,nc(a[a[a[c]>>2]>>2]));y(b,lr|0);y(b,nc(a[a[a[c]>>2]+4>>2]));y(b,kr|0);y(b,nc(a[a[a[c]>>2]+8>>2]));y(b,oA|0);y(b,dr|0)}),0,(function(b,c,d){var e,f=h;e=d>>2;d=h;h+=32;a[d>>2]=a[e];a[d+4>>2]=a[e+1];a[d+8>>2]=a[e+2];a[d+12>>2]=a[e+3];a[d+16>>2]=a[e+4];a[d+20>>2]=a[e+5];a[d+24>>2]=a[e+6];a[d+28>>2]=a[e+7];0==(b|0)&&sa(pd|0,114,$j|0,Nj|0);d=b+16|0;0==(a[d>>2]|0)&&sa(pd|0,116,$j|0,Nr|0);0==(c|0)&&sa(pd|0,117,$j|0,Oh|0);c=c+8|0;0==(a[c>>2]|0)&&sa(pd|0,118,$j|0,Ph|0);0==(a[a[d>>2]+8>>2]|0)&&sa(pd|0,121,$j|0,$t|0);N(b,Z3|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));N(b,K3|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));N(b,u3|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));N(b,e3|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));N(b,R2|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));N(b,C2|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));N(b,l2|0,(j=h,h+=4,a[j>>2]=a[c>>2],j));N(b,Y1|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));N(b,Sp|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));h=f}),0,(function(){a[tg>>2]=-1}),0,(function(b){b=a[b+28>>2];0!=(b|0)&&G(b)}),0,(function(a){y(a,NZ|0);y(a,$m|0);y(a,kZ|0);y(a,WY|0);y(a,$m|0);y(a,IY|0);y(a,uY|0);y(a,fY|0);y(a,$m|0);y(a,RX|0);y(a,DX|0);y(a,$m|0);y(a,oX|0)}),0,QC,0,(function(){a[rf>>2]=0}),0,(function(){return 0}),0,(function(b){var c=h;y(b,Aqa|0);var d=b+64|0,e=b+12|0;2!=(a[d>>2]|0)&&N(b,nqa|0,(j=h,h+=4,a[j>>2]=a[a[e>>2]+28>>2],j));if(0==(a[a[e>>2]+20>>2]|0)&&2!=(a[d>>2]|0)){var d=a[b+468>>2],e=a[b+472>>2],f=a[b+476>>2];N(b,wy|0,(j=h,h+=16,a[j>>2]=a[b+464>>2],a[j+4>>2]=d,a[j+8>>2]=e,a[j+12>>2]=f,j))}y(b,Zpa|0);y(b,Kpa|0);h=c}),0,wM,0,(function(c){var d;m[c+528|0]=0;d=(c+348|0)>>2;var e=(b[0]=a[d],b[1]=a[d+1],f[0])/1.1;f[0]=e;a[d]=b[0];a[d+1]=b[1];m[c+529|0]=1;return 0}),0,eS,0,(function(b){G(a[b+52>>2])}),0,(function(c,d,e){var g,m=h;g=e>>2;e=h;h+=32;a[e>>2]=a[g];a[e+4>>2]=a[g+1];a[e+8>>2]=a[g+2];a[e+12>>2]=a[g+3];a[e+16>>2]=a[g+4];a[e+20>>2]=a[g+5];a[e+24>>2]=a[g+6];a[e+28>>2]=a[g+7];g=c+228|0;var D=c+212|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0])&-1;var d=a[d+8>>2],D=e+16|0,D=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),l=e|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=e+24|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),e=e+8|0,e=k-(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);N(c,k8|0,(j=h,h+=36,a[j>>2]=d,f[0]=D-l,a[j+4>>2]=b[0],a[j+8>>2]=b[1],f[0]=e,a[j+12>>2]=b[0],a[j+16>>2]=b[1],f[0]=l,a[j+20>>2]=b[0],a[j+24>>2]=b[1],f[0]=(g>>>0)-k,a[j+28>>2]=b[0],a[j+32>>2]=b[1],j));y(c,V7|0);h=m}),0,(function(a,b,c,d){return jg(d,a,c)}),0,gS,0,(function(b){var c;y(b,sGa|0);y(b,dGa|0);c=(b+12|0)>>2;y(b,Of(a[a[a[c]>>2]>>2]));y(b,lr|0);y(b,Of(a[a[a[c]>>2]+4>>2]));y(b,kr|0);y(b,Of(a[a[a[c]>>2]+8>>2]));y(b,pFa|0)}),0,(function(b,c){return ka(a[b>>2],a[c>>2])}),0,(function(c){var d;m[c+528|0]=0;var e=c+348|0;d=(c+340|0)>>2;e=10/(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])+(b[0]=a[d],b[1]=a[d+1],f[0]);f[0]=e;a[d]=b[0];a[d+1]=b[1];m[c+529|0]=1;return 0}),0,(function(c,d,e){var g,m=h;h+=1024;g=e>>2;e=h;h+=32;a[e>>2]=a[g];a[e+4>>2]=a[g+1];a[e+8>>2]=a[g+2];a[e+12>>2]=a[g+3];a[e+16>>2]=a[g+4];a[e+20>>2]=a[g+5];a[e+24>>2]=a[g+6];a[e+28>>2]=a[g+7];c=c+16|0;g=a[Bd+(a[a[c>>2]+12>>2]<<2)>>2];db(g,cIa|0);var y=e|0,l=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]),y=e+8|0,k=(b[0]=a[y>>2],b[1]=a[y+4>>2],f[0]);Ap(g,l,k);var y=m|0,n=e+16|0,l=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0])-l,e=e+24|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])-k;Ma(y,Hl|0,(j=h,h+=8,a[j>>2]=(0>l?l-.5:l+.5)&-1,a[j+4>>2]=(0>e?e-.5:e+.5)&-1,j));db(g,y);fi(a[a[c>>2]+12>>2],Y|0,a[d+8>>2]);h=m}),0,eT,0,(function(b){var c=a[b+16>>2];y(b,Wj|0);y(b,nc(a[c+152>>2]));y(b,lqa|0);y(b,kn|0);y(b,nc(a[a[c+8>>2]+12>>2]));y(b,hn|0)}),0,(function(b,c){return a[a[b>>2]+20>>2]-a[a[c>>2]+20>>2]|0}),0,(function(c,d,e){var g=h;y(c,f5|0);var m=d+16|0,D=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]),m=d|0,m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]),D=D-m,l=d+24|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),d=d+8|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),l=l-d,d=(a[$d>>2]>>>0)-(d+l);N(c,Ky|0,(j=h,h+=16,f[0]=m-D,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=d,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));N(c,Ly|0,(j=h,h+=16,f[0]=2*D,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=2*l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));Oy(c,e);y(c,br|0);Mq(c);y(c,n4|0);h=g}),0,(function(c,d,e){var g=h;y(c,cr|0);var m=a[Ug>>2],D=a[$d>>2];N(c,vea|0,(j=h,h+=8,a[j>>2]=m,a[j+4>>2]=D,j));y(c,Yda|0);if(0<(e|0)){for(var m=e-1|0,D=d|0,l=d+8|0,k=0;;){if(0==(k|0)){y(c,Fda|0);var n=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),z=(a[$d>>2]>>>0)-(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);N(c,yA|0,(j=h,h+=16,f[0]=n,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=z,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));y(c,Rca|0)}else{n=(k<<4)+d|0,n=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),z=(k<<4)+d+8|0,z=(a[$d>>2]>>>0)-(b[0]=a[z>>2],b[1]=a[z+4>>2],f[0]),N(c,yA|0,(j=h,h+=16,f[0]=n,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=z,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j))}(k|0)==(m|0)&&y(c,uca|0);k=k+1|0;if((k|0)==(e|0)){break}}}y(c,cca|0);Mq(c);y(c,tA|0);h=g}),0,kK,0,(function(b,c){return ka(a[b>>2],a[c>>2])}),0,(function(c,d,e,g){var m=h;y(c,Mxa|0);Fm(c,g);y(c,VA|0);g=0<(e|0);a:do{if(g){for(var D=0;;){var l=(D<<4)+d|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=(D<<4)+d+8|0,k=-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);N(c,UA|0,(j=h,h+=16,f[0]=l,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=k,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));D=D+1|0;if((D|0)==(e|0)){break a}}}}while(0);e=d|0;e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);d=d+8|0;d=-(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);N(c,yxa|0,(j=h,h+=16,f[0]=e,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=d,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));y(c,Dm|0);h=m}),0,(function(b,c,d){var b=a[c>>2],e=a[d>>2];b>>>0<e>>>0?d=-1:b>>>0>e>>>0?d=1:(c=a[c+4>>2],d=a[d+4>>2],d=c>>>0<d>>>0?-1:c>>>0>d>>>0&1);return d}),0,(function(c,d,e){var g,j,m=h;h+=32;var l=m|0;j=m>>2;g=d>>2;a[j]=a[g];a[j+1]=a[g+1];a[j+2]=a[g+2];a[j+3]=a[g+3];g=d+16|0;j=d|0;g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]);j=m+16|0;f[0]=g;a[j>>2]=b[0];a[j+4>>2]=b[1];g=d+24|0;d=d+8|0;d=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])-(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);g=m+24|0;f[0]=d;a[g>>2]=b[0];a[g+4>>2]=b[1];d=(c+16|0)>>2;if(0!=(e|0)&&(e=a[d],g=e+76|0,.5<(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]))){Nf(c,e+52|0),kf(c,l,2),y(c,pya|0)}e=a[d]+40|0;if(.5<(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])){Em(c),Nf(c,a[d]+16|0),kf(c,l,2),y(c,aya|0)}h=m}),0,(function(c,d,e){var g=c+16|0,h=a[g>>2]+40|0;if(.5<(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0])){Em(c);Nf(c,a[g>>2]+16|0);y(c,Jj|0);g=d|0;h=d+8|0;Hd(c,(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]));y(c,Kj|0);g=1<(e|0);a:do{if(g){for(h=1;;){var j=(h<<4)+d|0,l=(h<<4)+d+8|0;Hd(c,(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]));y(c,Hq|0);h=h+1|0;if((h|0)==(e|0)){break a}}}}while(0);y(c,zy|0)}}),0,(function(b,c,d){var e,f=a[b+16>>2];e=(f+88|0)>>2;0!=(a[e]|0)&&(Gm(b),y(b,jA|0),kf(b,c,d),y(b,Lj|0),gi(b,f+16|0),c=a[e],1==(c|0)?(y(b,Hm|0),e=a[e]):e=c,2==(e|0)&&y(b,Im|0),Mj(b),y(b,wd|0))}),0,(function(c){var d=c>>2,e=h,g=a[d+4];y(c,Goa|0);g=g+8|0;0!=m[a[a[g>>2]+12>>2]]<<24>>24&&(y(c,vA|0),y(c,nc(a[a[g>>2]+12>>2])));N(c,hoa|0,(j=h,h+=4,a[j>>2]=a[d+41]*a[d+40]|0,j));g=a[d+111];N(c,Vna|0,(j=h,h+=8,a[j>>2]=a[d+110],a[j+4>>2]=g,j));var d=c+376|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),g=c+384|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),q=c+392|0,q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]),D=c+400|0,D=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]);N(c,Hna|0,(j=h,h+=32,f[0]=d,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=g,a[j+8>>2]=b[0],a[j+12>>2]=b[1],f[0]=q,a[j+16>>2]=b[0],a[j+20>>2]=b[1],f[0]=D,a[j+24>>2]=b[0],a[j+28>>2]=b[1],j));y(c,sna|0);y(c,dna|0);y(c,ar|0);h=e}),0,(function(c){var d=h;h+=36;JF(c,8);var e;var g=d>>2,q=h;h+=12;e=q>>2;var y=q+8;a[y>>2]=5;var l=V(c|0,tla|0);0!=(l|0)&&1<=(Cd(l,kda|0,(j=h,h+=8,a[j>>2]=q,a[j+4>>2]=y,j))|0)?(l=(b[0]=a[e],b[1]=a[e+1],f[0]),1>l?(f[0]=1,a[e]=b[0],a[e+1]=b[1],e=1):20<l?(f[0]=20,a[e]=b[0],a[e+1]=b[1],e=20):e=l,l=d|0,f[0]=e,a[l>>2]=b[0],a[l+4>>2]=b[1],a[g+6]=-1,a[g+7]=a[y>>2],a[g+8]=0,0!=m[ld]<<24>>24&&Va(a[oa>>2],D$|0,(j=h,h+=8,f[0]=e,a[j>>2]=b[0],a[j+4>>2]=b[1],j)),g=d):(a[g+6]=0,g=a[g+8]=0);h=q;e=g;XN(c);q=d+32|0;g=d+28|0;for(y=d+24|0;!(kx(c,e),0!=(a[q>>2]|0)&&(la(0,bka|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),e=a[y>>2]=0),lx(c,0!=(e|0)&1),zO(c,e),l=a[g>>2]-1|0,a[g>>2]=l,0==(a[y>>2]|0)|0==(l|0));){}mx(c);bx(c,1);if(0!=jo(V(c|0,HJa|0))<<24>>24&&(q=ra(c),0!=(q|0))){for(;;){g=Ib(c,q);y=0==(g|0);a:do{if(!y){for(e=g;;){if(DN(c,e),e=yb(c,e),0==(e|0)){break a}}}}while(0);q=ba(c,q);if(0==(q|0)){break}}}Bt(c,1);h=d}),0,(function(a,b,c){a=0==(c|0);0==(b|0)?b=a?0:Gb(c):a?(G(b),b=0):b=mc(b,c);return b}),0,mU,0,OC,0,(function(c){var d=h,e=a[c+16>>2];y(c,Wj|0);y(c,nc(a[e+152>>2]));y(c,Hpa|0);var g=c+480|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),q=c+488|0,q=(b[0]=a[q>>2],b[1]=a[q+4>>2],f[0]),D=-a[c+356>>2]|0,l=c+496|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=c+504|0,k=-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);N(c,tpa|0,(j=h,h+=36,f[0]=g,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=q,a[j+8>>2]=b[0],a[j+12>>2]=b[1],a[j+16>>2]=D,f[0]=l,a[j+20>>2]=b[0],a[j+24>>2]=b[1],f[0]=k,a[j+28>>2]=b[0],a[j+32>>2]=b[1],j));e=e+8|0;0!=m[a[a[e>>2]+12>>2]]<<24>>24&&(y(c,kn|0),y(c,nc(a[a[e>>2]+12>>2])),y(c,hn|0));h=d}),0,(function(b,c,d){zm(b);Am(b);Bm(a[a[b+16>>2]+12>>2],76,c,d)}),0,(function(a){y(a,Xj|0)}),0,(function(b){var c;for(c=b>>2;!(b=a[c+32],0==(b|0));){c=b>>2}var b=a[c+3],d=a[b+236>>2];c=a[c+4];var e=a[c+236>>2];return(d|0)>(e|0)?0:(d|0)<(e|0)?1:b=(a[b+240>>2]|0)<(a[c+240>>2]|0)&1}),0,bk(),0,(function(a){y(a,Mm|0)}),0,TR,0,(function(b,c){var d,e=fa(24);d=e>>2;a[d+2]=a[c+8>>2];a[d+3]=a[c+12>>2];a[d+4]=a[c+16>>2];a[d+5]=a[c+20>>2];return e}),0,(function(c,d,e,g){var q=h,D=a[c+16>>2],l=D+40|0;if(.5<=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])){Nf(c,D+16|0),D=g+24|0,gj(c,(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0])),N(c,Nxa|0,(j=h,h+=4,a[j>>2]=a[g+20>>2],j)),D=Qu(a[g>>2],a[Gq>>2]),l=m[g+72|0]<<24>>24,114==(l|0)?(l=g+56|0,d-=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])):108==(l|0)?l=g+56|0:(l=g+56|0,d-=.5*(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])),g=g+48|0,Hd(c,d,(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0])+e),y(c,zxa|0),gj(c,(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])),N(c,lxa|0,(j=h,h+=4,a[j>>2]=D,j))}h=q}),0,(function(a){y(a,gr|0)}),0,(function(b){return 0!=(a[a[b>>2]+116>>2]|0)||0!=(a[b+40>>2]|0)?0:b=nC(a[b+36>>2])}),0,(function(c,d,e,g){var m=h;y(c,cr|0);var D=a[Ug>>2],l=a[$d>>2];N(c,eA|0,(j=h,h+=8,a[j>>2]=D,a[j+4>>2]=l,j));Oy(c,g);y(c,br|0);Mq(c);y(c,bA|0);if(0<(e|0)){g=e-1|0;for(D=0;;){var l=(D<<4)+d|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=(D<<4)+d+8|0,k=(a[$d>>2]>>>0)-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);0==(D|0)?(y(c,$z|0),N(c,Qz|0,(j=h,h+=16,f[0]=l,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=k,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j)),y(c,M5|0)):N(c,Qz|0,(j=h,h+=16,f[0]=l,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=k,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));(D|0)==(g|0)&&y(c,w5|0);D=D+1|0;if((D|0)==(e|0)){break}}}y(c,tA|0);h=m}),0,(function(c,d,e){var g,h=a[c+16>>2];g=(h+88|0)>>2;0!=(a[g]|0)&&(Gm(c),y(c,jA|0),kf(c,d,e),y(c,Lj|0),gi(c,h+16|0),y(c,Jq|0),d=h+96|0,gj(c,(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])),d=a[g],1==(d|0)?(y(c,Hm|0),g=a[g]):g=d,2==(g|0)&&y(c,Im|0),y(c,Sna|0),Mj(c),y(c,wd|0))}),0,(function(b,c){var d=h;if(0!=(c|0)){var e=a[b+16>>2]+212|0;0!=(a[e>>2]|0)&&(y(b,$wa|0),kf(b,a[e>>2],2),y(b,Jwa|0),e=Qu(c,a[Gq>>2]),N(b,vwa|0,(j=h,h+=4,a[j>>2]=e,j)))}h=d}),0,YQ,0,(function(){return EEa|0}),0,Lc,0,(function(b){b=a[b+28>>2];0!=(b|0)&&(G(a[b+40>>2]),G(b))}),0,(function(b){var c=a[a[b+16>>2]+8>>2];UL(104,170);var d=a[b+64>>2];2==(d|0)?av(b,c,b,0):3==(d|0)?av(b,c,b,1):0==(d|0)||1==(d|0)?0==(a[b+148>>2]&134217728|0)&&iw(c,b):4==(d|0)&&(PQ(c),0==(a[b+148>>2]&134217728|0)&&iw(c,b));UL(0,0)}),0,(function(a){y(a,vz|0)}),0,pU,0,(function(){a[rf>>2]=2}),0,(function(c){var d;d=c+528|0;var e=0==m[d]<<24>>24;m[d]=e&1;if(!e){return 0}d=a[c+440>>2];e=a[c+444>>2];d=(d>>>0)/(d|0);var e=(e>>>0)/(e|0),g=c+348|0;f[0]=d<e?d:e;a[g>>2]=b[0];a[g+4>>2]=b[1];d=(c+332|0)>>2;a[d]=0;a[d+1]=0;a[d+2]=0;a[d+3]=0;m[c+529|0]=1;return 0}),0,ax,0,mR,0,(function(b){var c,d=h;y(b,vpa|0);2==(a[b+64>>2]|0)?y(b,kpa|0):y(b,wd|0);c=a[a[b+12>>2]>>2]>>2;var e=a[c+1],f=a[c+2];N(b,Xoa|0,(j=h,h+=12,a[j>>2]=a[c],a[j+4>>2]=e,a[j+8>>2]=f,j));h=d}),0,Mp,0,(function(b,c){var d=h;N(b,JOa|0,(j=h,h+=4,a[j>>2]=c,j));h=d}),0,(function(b){var c=h,d=a[b+16>>2];y(b,wca|0);d=d+8|0;0!=m[a[a[d>>2]+12>>2]]<<24>>24&&(y(b,vA|0),y(b,a[a[d>>2]+12>>2]));N(b,Kba|0,(j=h,h+=4,a[j>>2]=a[b+164>>2]*a[b+160>>2]|0,j));h=c}),0,(function(b,c){Kc(a[c+8>>2]);G(c)}),0,(function(c,d,e,g){var m,y=h;m=e>>2;e=h;h+=32;a[e>>2]=a[m];a[e+4>>2]=a[m+1];a[e+8>>2]=a[m+2];a[e+12>>2]=a[m+3];a[e+16>>2]=a[m+4];a[e+20>>2]=a[m+5];a[e+24>>2]=a[m+6];a[e+28>>2]=a[m+7];0==(c|0)&&sa(pd|0,205,mr|0,Nj|0);0==(d|0)&&sa(pd|0,206,mr|0,Oh|0);m=(d+8|0)>>2;0==(a[m]|0)&&sa(pd|0,207,mr|0,Ph|0);if(0!=(a[d+52>>2]|0)){var d=e|0,d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]),l=e+8|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=e+16|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]),e=e+24|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);0!=g<<24>>24&&(N(c,an|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j)),N(c,sf|0,(j=h,h+=16,f[0]=d,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j)),N(c,sf|0,(j=h,h+=16,f[0]=d,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=e,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j)),N(c,sf|0,(j=h,h+=16,f[0]=k,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=e,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j)),N(c,sf|0,(j=h,h+=16,f[0]=k,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j)),N(c,sf|0,(j=h,h+=16,f[0]=d,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j)),g=a[m],N(c,$5|0,(j=h,h+=8,a[j>>2]=4,a[j+4>>2]=g,j)));N(c,an|0,(j=h,h+=1,h=h+3>>2<<2,a[j>>2]=0,j));N(c,sf|0,(j=h,h+=16,f[0]=d,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));N(c,sf|0,(j=h,h+=16,f[0]=d,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=e,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));N(c,sf|0,(j=h,h+=16,f[0]=k,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=e,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));N(c,sf|0,(j=h,h+=16,f[0]=k,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));N(c,sf|0,(j=h,h+=16,f[0]=d,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));g=a[m];N(c,K5|0,(j=h,h+=8,a[j>>2]=4,a[j+4>>2]=g,j))}h=y}),0,xi,0,(function(){a[XB>>2]=0==(a[XB>>2]|0)&1}),0,(function(c,d,e,g,m){var D,l=h;D=(c+16|0)>>2;if(0!=(m|0)){var m=a[D],k=m+76|0;if(.5<(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])){Nf(c,m+52|0),y(c,an|0),kf(c,e,g),y(c,gc|0),m=e|0,k=e+8|0,Hd(c,(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]),(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])),N(c,sDa|0,(j=h,h+=8,a[j>>2]=g,a[j+4>>2]=d,j))}}m=a[D]+40|0;if(.5<(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0])){Em(c),Nf(c,a[D]+16|0),y(c,an|0),kf(c,e,g),y(c,gc|0),D=e|0,e=e+8|0,Hd(c,(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0]),(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])),N(c,fDa|0,(j=h,h+=8,a[j>>2]=g,a[j+4>>2]=d,j))}h=l}),0,(function(b){var c=h;N(b,Jva|0,(j=h,h+=4,a[j>>2]=a[a[a[b+16>>2]+8>>2]+12>>2],j));y(b,gr|0);h=c}),0,(function(a){y(a,Voa|0)}),0,(function(a){y(a,vha|0)}),0,(function(b){ju(a[b+28>>2])}),0,(function(b,c,d,e){var f=h;y(b,tz|0);0!=(c|0)&&0!=m[c]<<24>>24&&(c=Of(c),N(b,U_|0,(j=h,h+=4,a[j>>2]=c,j)));0!=(d|0)&&0!=m[d]<<24>>24&&(d=Of(d),N(b,E_|0,(j=h,h+=4,a[j>>2]=d,j)));0!=(e|0)&&0!=m[e]<<24>>24&&(e=Of(e),N(b,q_|0,(j=h,h+=4,a[j>>2]=e,j)));y(b,ar|0);h=f}),0,(function(c,d,e,g,m,D){y(c,Cya|0);Fm(c,D);y(c,oya|0);g=h;if(0<(e|0)){m=0;for(D=77;;){var l=(m<<4)+d|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]),k=(m<<4)+d+8|0,k=-(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0]);N(c,$xa|0,(j=h,h+=20,a[j>>2]=D,f[0]=l,a[j+4>>2]=b[0],a[j+8>>2]=b[1],f[0]=k,a[j+12>>2]=b[0],a[j+16>>2]=b[1],j));D=0==(m|0)?67:32;m=m+1|0;if((m|0)==(e|0)){break}}}h=g;y(c,Dm|0)}),0,(function(b,c){var d=a[Ul>>2];J[a[d>>2]](d,c,1);return 0}),0,(function(a,b){y(a,Wj|0);y(a,nc(b));y(a,ipa|0)}),0,(function(b,c,d){c=h;b=d>>2;d=h;h+=32;a[d>>2]=a[b];a[d+4>>2]=a[b+1];a[d+8>>2]=a[b+2];a[d+12>>2]=a[b+3];a[d+16>>2]=a[b+4];a[d+20>>2]=a[b+5];a[d+24>>2]=a[b+6];a[d+28>>2]=a[b+7];h=c}),0,AH,0,NS,0,MC,0,(function(b,c,d){b=a[b>>2];var e,f=a[a[b+128>>2]+32>>2];wC(b,c);c=a[b+124>>2];e=c>>2;a[e+14]=Bn(c,a[e+13]);if(0==(a[f+44>>2]|0)&&0==(a[e+37]&67108864|0)){Lc(Ar|0,20,1,a[oa>>2])}else{e=b+120|0;var h=a[e>>2];0==(h|0)?(h=fa(624),a[e>>2]=h,a[b+124>>2]=h,e=a[Lh>>2]=h):(e=a[Lh>>2],0==(e|0)?e=a[Lh>>2]=h:(e=a[e+4>>2],0==(e|0)&&(e=fa(624),a[a[Lh>>2]+4>>2]=e),a[Lh>>2]=e));a[e+32>>2]=d;a[e>>2]=b;Br(b,f);Cr(c);iK(c);Dr(b)}}),0,(function(b,c,d){return a[c>>2]-a[d>>2]|0}),0,(function(b,c){G(a[c+52>>2])}),0,zC,0,(function(b,c){var d=a[c+20>>2];0!=(d|0)&&ri(d);if(0!=(a[c+52>>2]|0)&&(d=a[c+60>>2],0!=(d|0))){J[d](c)}G(c)}),0,(function(a,b){G(b)}),0,(function(b,c){var d=a[c+8>>2],e=d+80|0,f=m[d+84|0];1==f<<24>>24?(e=a[e>>2],Kc(a[e+76>>2]),Io(e|0),G(e)):2==f<<24>>24&&rt(a[e>>2]);Io(d|0);G(d);G(c)}),0,(function(b,c,d,e){zm(b);Am(b);0==(e|0)?Bm(a[a[b+16>>2]+12>>2],112,c,d):(jy(b),Bm(a[a[b+16>>2]+12>>2],80,c,d))}),0,(function(c,d,e){var g,m=h;y(c,kxa|0);Fm(c,e);g=(d|0)>>2;var D=(b[0]=a[g],b[1]=a[g+1],f[0]),e=(d+8|0)>>2,l=-(b[0]=a[e],b[1]=a[e+1],f[0]);N(c,Wwa|0,(j=h,h+=16,f[0]=D,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=l,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));D=d+16|0;g=(b[0]=a[D>>2],b[1]=a[D+4>>2],f[0])-(b[0]=a[g],b[1]=a[g+1],f[0]);d=d+24|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])-(b[0]=a[e],b[1]=a[e+1],f[0]);N(c,Iwa|0,(j=h,h+=16,f[0]=g,a[j>>2]=b[0],a[j+4>>2]=b[1],f[0]=d,a[j+8>>2]=b[0],a[j+12>>2]=b[1],j));y(c,Py|0);h=m}),0,(function(){return 1}),0,HQ,0,NH,0,(function(b){7==(a[b>>2]|0)&&ZF(a[b+76>>2],1)}),0,(function(b,c){var d=c+12|0,e=D[d>>1];if(0!=e<<16>>16){var f=c+8|0,e=0<e<<16>>16;a:do{if(e){for(var h=a[f>>2],j=0;;){var k=a[h>>2];0!=(k|0)&&G(k);k=a[h+16>>2];0!=(k|0)&&Ho(k);j=j+1|0;if((j|0)<(D[d>>1]<<16>>16|0)){h=h+76|0}else{break a}}}}while(0);G(a[f>>2])}d=c;G(d)}),0,lH,0,(function(a){y(a,Mm|0)}),0,dR,0,nm,0,FQ,0,(function(a){y(a,Xj|0)}),0,(function(a){y(a,Xj|0)}),0,(function(b){var c=h;h+=8;var d=c+4,e=a[a[b+16>>2]+8>>2],b=a[b+64>>2];4==(b|0)?(ev(e,d,c),SQ(e,a[d>>2],a[c>>2])):1==(b|0)?0!=(D[e+164>>1]&1)<<16>>16&&oF(e):0==(b|0)&&(d=h,h+=8,ev(e,d+4,d),h=d);h=c}),0,Th,0,OH,0,(function(b,c,d){var b=a[c+16>>2],b=0==(b|0)?-1:a[b+16>>2],e=a[c+12>>2],e=0==(e|0)?-1:a[e+16>>2],f=a[d+16>>2],f=0==(f|0)?-1:a[f+16>>2],h=a[d+12>>2],h=0==(h|0)?-1:a[h+16>>2];return(e|0)!=(h|0)?e-h|0:c=(b|0)==(f|0)?JL(a[c+4>>2],d):b-f|0}),0,(function(b,c,d,e,f){var h;h=a[b+16>>2]>>2;Cq(b,a[h+51],a[h+53],a[h+52],c,d,e,f)}),0,(function(a){cc(a|0);0!=(a|0)&&G(a)}),0,(function(b){var c,d=h,e=a[b+16>>2];y(b,xga|0);c=a[a[b+12>>2]>>2]>>2;var f=a[c+1],m=a[c+2];N(b,Ufa|0,(j=h,h+=12,a[j>>2]=a[c],a[j+4>>2]=f,a[j+8>>2]=m,j));N(b,rfa|0,(j=h,h+=4,a[j>>2]=a[a[e+8>>2]+12>>2],j));N(b,Lea|0,(j=h,h+=4,a[j>>2]=a[b+164>>2]*a[b+160>>2]|0,j));y(b,pea|0);y(b,Tda|0);y(b,Ada|0);y(b,hda|0);y(b,Lca|0);y(b,zca|0);y(b,fca|0);y(b,Nba|0);y(b,tba|0);h=d}),0,(function(a){cc(a|0);0!=(a|0)&&G(a)}),0,MT,0,(function(a){m[a+530|0]=0;m[a+533|0]=0}),0,(function(c,d,e){var g=h;h+=12;var m=g+4,y=a[c+16>>2],l=y+96|0,l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0])&-1,k=a[y+16>>2],n=a[rf>>2];Aq(a[y+88>>2],g,m);y=a[g>>2];m=(b[0]=a[m>>2],b[1]=a[m+4>>2],f[0]);N(c,CB|0,(j=h,h+=68,a[j>>2]=2,a[j+4>>2]=1,a[j+8>>2]=y,a[j+12>>2]=l,a[j+16>>2]=k,a[j+20>>2]=0,a[j+24>>2]=n,a[j+28>>2]=0,a[j+32>>2]=0,f[0]=m,a[j+36>>2]=b[0],a[j+40>>2]=b[1],a[j+44>>2]=0,a[j+48>>2]=0,a[j+52>>2]=0,a[j+56>>2]=0,a[j+60>>2]=0,a[j+64>>2]=e,j));ry(c,d,e,0);h=g}),0,GQ,0,(function(a,b){dc(b)}),0,(function(b,c){return Lb(a[b>>2],a[c>>2])}),0,bk(),0,(function(b,c){return Lb(a[b>>2],a[c>>2])}),0,(function(a,b){y(a,xAa|0);y(a,b);y(a,wd|0)}),0,XS,0,VS,0,jO,0,(function(c,d,e,g){var q,y=h;h+=1024;q=(c+16|0)>>2;var l=a[a[q]+12>>2],k=y|0,n=g+24|0;Ma(k,Qla|0,(j=h,h+=8,f[0]=(b[0]=a[n>>2],b[1]=a[n+4>>2],f[0]),a[j>>2]=b[0],a[j+4>>2]=b[1],j));l=a[Bd+(l<<2)>>2];db(l,k);fi(a[a[q]+12>>2],Y|0,a[g+20>>2]);Am(c);c=m[g+72|0]<<24>>24;c=114==(c|0)?1:108==(c|0)?-1:0;db(l,Zja|0);Ap(l,d,e);d=g+56|0;d=(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0])&-1;Ma(k,Hl|0,(j=h,h+=8,a[j>>2]=c,a[j+4>>2]=d,j));db(l,k);fi(a[a[q]+12>>2],Y|0,a[g>>2]);h=y}),0,FH,0,(function(b,c,d){var b=a[c+16>>2],b=0==(b|0)?-1:a[b+16>>2],e=a[c+12>>2],e=0==(e|0)?-1:a[e+16>>2],f=a[d+16>>2],f=0==(f|0)?-1:a[f+16>>2],h=a[d+12>>2],h=0==(h|0)?-1:a[h+16>>2];return(b|0)!=(f|0)?b-f|0:c=(e|0)==(h|0)?JL(a[c+4>>2],d):e-h|0}),0,(function(){a[rf>>2]=1}),0,(function(c){var d;m[c+528|0]=0;var e=c+348|0;d=(c+332|0)>>2;e=10/(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0])+(b[0]=a[d],b[1]=a[d+1],f[0]);f[0]=e;a[d]=b[0];a[d+1]=b[1];m[c+529|0]=1;return 0}),0,(function(c,d){var e=a[Id>>2],g=e+36*a[d>>2]+20|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),e=e+36*a[c>>2]+20|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]);return(g>e&1)-(g<e&1)|0}),0,aR,0,(function(c,d,e){var g=a[c>>2],h=g|0,d=d-(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),g=g+8|0,e=e-(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]),c=a[c+4>>2];return d*d+e*e<=(b[0]=a[c>>2],b[1]=a[c+4>>2],f[0])&1}),0,(function(b){var c=a[b+16>>2];y(b,Wj|0);y(b,nc(a[c+152>>2]));y(b,jra|0);y(b,kn|0);c=ec(cg|0,a[c+8>>2]|0);y(b,nc(c));G(c);y(b,hn|0)}),0,GH,0,(function(a){y(a,vz|0)}),0,(function(){a[tg>>2]=1}),0,(function(b,c,d,e,f,h){zm(b);Am(b);0==(h|0)?Bm(a[a[b+16>>2]+12>>2],66,c,d):(jy(b),Bm(a[a[b+16>>2]+12>>2],98,c,d))}),0,(function(){a[rf>>2]=2}),0,nK,0,(function(b){var c;c=a[b+16>>2]>>2;var d=a[b+64>>2];3==(d|0)?(Cq(b,a[c+51],a[c+53],a[c+52],a[c+37],a[c+42],a[c+46],a[c+38]),y(b,Mda|0)):2==(d|0)&&Cq(b,a[c+51],a[c+53],a[c+52],a[c+37],a[c+42],a[c+46],a[c+38])}),0,(function(c){var d,e,g=h;e=Uk(V(c|0,Xk|0));if(0==(e|0)){la(0,wJa|0,(j=h,h+=4,a[j>>2]=a[c+12>>2],j))}else{var m=iI(e);e=m>>2;if(0!=(m|0)){var m=a[e+10],y=a[e+11];d=c+48|0;f[0]=(m|0)/72;a[d>>2]=b[0];a[d+4>>2]=b[1];d=c+56|0;f[0]=(y|0)/72;a[d>>2]=b[0];a[d+4>>2]=b[1];var l=fa(12);d=l>>2;a[c+28>>2]=l;a[d]=a[e+3];a[d+1]=((m|0)/-2&-1)-a[e+8]|0;a[d+2]=((y|0)/-2&-1)-a[e+9]|0}}h=g}),0,HH,0,GC,0,(function(a,b){y(a,eDa|0);y(a,nc(b));y(a,dr|0)}),0,(function(c,d){var e=a[a[c>>2]+108>>2],g=a[a[d>>2]+108>>2],h=0!=(g|0);if(0==(e|0)){return h&1}if(!h){return-1}var h=e+24|0,h=(b[0]=a[h>>2],b[1]=a[h+4>>2],f[0]),e=e+32|0,e=(b[0]=a[e>>2],b[1]=a[e+4>>2],f[0]),j=g+24|0,j=(b[0]=a[j>>2],b[1]=a[j+4>>2],f[0]),g=g+32|0,g=(b[0]=a[g>>2],b[1]=a[g+4>>2],f[0]);return h>j?-1:h<j?1:e>g?-1:e<g&1}),0,LH,0,rC,0,(function(b,c,d,e){c=h;N(b,Asa|0,(j=h,h+=8,a[j>>2]=d,a[j+4>>2]=e,j));h=c}),0,JC,0,(function(a){cc(a|0)}),0,(function(a){y(a,Xj|0)}),0,(function(){a[rf>>2]=2}),0,(function(b,c){return a[a[b>>2]+240>>2]-a[a[c>>2]+240>>2]|0}),0,(function(b,c){var d=a[b>>2];An(d,a[d+128>>2],c)}),0,(function(c,d,e,g){var m,y=h;h+=12;var l=y+4,k=a[c+16>>2];m=k>>2;var k=k+96|0,k=(b[0]=a[k>>2],b[1]=a[k+4>>2],f[0])&-1,n=a[m+4],z=a[m+13],p=a[rf>>2];Aq(a[m+22],y,l);m=a[y>>2];l=(b[0]=a[l>>2],b[1]=a[l+4>>2],f[0]);N(c,CB|0,(j=h,h+=68,a[j>>2]=2,a[j+4>>2]=3,a[j+8>>2]=m,a[j+12>>2]=k,a[j+16>>2]=n,a[j+20>>2]=z,a[j+24>>2]=p,a[j+28>>2]=0,a[j+32>>2]=0!=(g|0)?20:-1,f[0]=l,a[j+36>>2]=b[0],a[j+40>>2]=b[1],a[j+44>>2]=0,a[j+48>>2]=0,a[j+52>>2]=0,a[j+56>>2]=0,a[j+60>>2]=0,a[j+64>>2]=e+1|0,j));ry(c,d,e,1);h=y}),0,oi,0,(function(c){var d;m[c+528|0]=0;d=c+348|0;var e=10/(b[0]=a[d>>2],b[1]=a[d+4>>2],f[0]);d=(c+332|0)>>2;e=(b[0]=a[d],b[1]=a[d+1],f[0])-e;f[0]=e;a[d]=b[0];a[d+1]=b[1];m[c+529|0]=1;return 0}),0,mK,0,(function(b,c,d,e){var f=h;h+=40;if(0==m[d]<<24>>24){c=bu>>2}else{var e=0==(e|0)?cu|0:e,y=a[c+28>>2],l=KH(y,d);0==(l|0)?0!=(Yi(c,y+16|0,f,d,15,0)|0)&&BH(a[c+12>>2],d):0!=(Yi(c,l+16|0,f,e,m[l+65|0]&255,0)|0)&&la(0,du|0,(j=h,h+=12,a[j>>2]=a[c+12>>2],a[j+4>>2]=d,a[j+8>>2]=e,j));c=f>>2}b>>=2;for(d=c+10;c<d;c++,b++){a[b]=a[c]}h=f}),0];K.FUNCTION_TABLE=J;K.run=K.nd=qr;if(K.preInit){for("function"==typeof K.preInit&&(K.preInit=[K.preInit]);0<K.preInit.length;){K.preInit.pop()()}}qn(IU);var qQa=wc;K.noInitialRun&&(qQa=ee);qQa&&qr();K.ccall("vizRenderFromString","number",["string","string"],[nr,rQa]);return K["return"]})
-
-
-
-
diff --git a/shake.cabal b/shake.cabal
--- a/shake.cabal
+++ b/shake.cabal
@@ -1,21 +1,20 @@
-cabal-version:      >= 1.18
+cabal-version:      1.18
 build-type:         Simple
 name:               shake
-version:            0.15.11
+version:            0.19.9
 license:            BSD3
 license-file:       LICENSE
 category:           Development, Shake
 author:             Neil Mitchell <ndmitchell@gmail.com>
 maintainer:         Neil Mitchell <ndmitchell@gmail.com>
-copyright:          Neil Mitchell 2011-2017
+copyright:          Neil Mitchell 2011-2026
 synopsis:           Build system library, like Make, but more accurate dependencies.
 description:
     Shake is a Haskell library for writing build systems - designed as a
     replacement for @make@. See "Development.Shake" for an introduction,
-    including an example. Further examples are included in the Cabal tarball,
-    under the @Examples@ directory. The homepage contains links to a user
+    including an example. The homepage contains links to a user
     manual, an academic paper and further information:
-    <http://shakebuild.com>
+    <https://shakebuild.com>
     .
     To use Shake the user writes a Haskell program
     that imports "Development.Shake", defines some build rules, and calls
@@ -29,45 +28,39 @@
     Shake also provides more accurate dependency tracking, including seamless
     support for generated files, and dependencies on system information
     (e.g. compiler version).
-homepage:           http://shakebuild.com
+homepage:           https://shakebuild.com
 bug-reports:        https://github.com/ndmitchell/shake/issues
-tested-with:        GHC==8.0.1, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2
+tested-with:        GHC==9.12, GHC==9.10, GHC==9.8, GHC==9.6, GHC==9.4, GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8
 extra-doc-files:
     CHANGES.txt
     README.md
+    docs/Manual.md
+    docs/shake-progress.png
 extra-source-files:
+    src/Paths.hs
     src/Test/C/constants.c
     src/Test/C/constants.h
     src/Test/C/main.c
-    src/Test/MakeTutor/Makefile
-    src/Test/MakeTutor/hellofunc.c
-    src/Test/MakeTutor/hellomake.c
-    src/Test/MakeTutor/hellomake.h
-    src/Test/Tar/list.txt
     src/Test/Ninja/*.ninja
-    src/Test/Ninja/subdir/*.ninja
     src/Test/Ninja/*.output
+    src/Test/Ninja/subdir/*.ninja
     src/Test/Progress/*.prog
+    src/Test/Tar/list.txt
     src/Test/Tup/hello.c
-    src/Test/Tup/root.cfg
     src/Test/Tup/newmath/root.cfg
     src/Test/Tup/newmath/square.c
     src/Test/Tup/newmath/square.h
-    src/Paths.hs
-    docs/Manual.md
-    docs/shake-progress.png
-
+    src/Test/Tup/root.cfg
 data-files:
-    html/viz.js
-    html/profile.html
-    html/progress.html
-    html/shake.js
     docs/manual/build.bat
-    docs/manual/Build.hs
+    docs/manual/Shakefile.hs
     docs/manual/build.sh
     docs/manual/constants.c
     docs/manual/constants.h
     docs/manual/main.c
+    html/profile.html
+    html/progress.html
+    html/shake.js
 
 source-repository head
     type:     git
@@ -78,42 +71,70 @@
     manual: True
     description: Obtain FileTime using portable functions
 
+flag cloud
+    default: False
+    manual: True
+    description: Enable cloud build features
+
+flag embed-files
+    default: False
+    manual: True
+    description: Embed data files into the shake library
+
+flag threaded
+    default: True
+    manual: True
+    description: Build shake with the threaded RTS
+
 library
     default-language: Haskell2010
     hs-source-dirs:   src
     build-depends:
-        base >= 4.5,
-        directory,
-        hashable >= 1.1.2.3,
+        base >= 4.9 && < 5,
         binary,
-        filepath,
-        process >= 1.1,
-        unordered-containers >= 0.2.1,
         bytestring,
-        utf8-string >= 0.3,
-        time,
-        random,
-        js-jquery,
+        deepseq >= 1.1,
+        directory >= 1.2.7.0,
+        extra >= 1.6.19,
+        filepath >= 1.4,
+        filepattern,
+        hashable >= 1.1.2.3,
+        heaps >= 0.3.6.1,
+        js-dgtable,
         js-flot,
+        js-jquery,
+        primitive,
+        process >= 1.1,
+        random,
+        time,
         transformers >= 0.2,
-        extra >= 1.4.8,
-        deepseq >= 1.1
+        unordered-containers >= 0.2.7,
+        utf8-string >= 0.3
 
+    if flag(embed-files)
+        cpp-options: -DFILE_EMBED
+        build-depends:
+            file-embed >= 0.0.11,
+            template-haskell
+
     if flag(portable)
         cpp-options: -DPORTABLE
-        if impl(ghc < 7.6)
-            build-depends: old-time
     else
         if !os(windows)
             build-depends: unix >= 2.5.1
     if !os(windows)
         build-depends: unix
 
+    if flag(cloud)
+        cpp-options: -DNETWORK
+        build-depends: network, network-uri
+
     exposed-modules:
         Development.Shake
         Development.Shake.Classes
         Development.Shake.Command
         Development.Shake.Config
+        Development.Shake.Database
         Development.Shake.FilePath
         Development.Shake.Forward
         Development.Shake.Rule
@@ -124,140 +145,189 @@
         Development.Ninja.Lexer
         Development.Ninja.Parse
         Development.Ninja.Type
-        Development.Shake.Args
-        Development.Shake.ByteString
-        Development.Shake.Core
-        Development.Shake.CmdOption
-        Development.Shake.Database
-        Development.Shake.Demo
-        Development.Shake.Derived
-        Development.Shake.Errors
-        Development.Shake.FileInfo
-        Development.Shake.FilePattern
-        Development.Shake.Monad
-        Development.Shake.Pool
-        Development.Shake.Profile
-        Development.Shake.Progress
-        Development.Shake.Resource
-        Development.Shake.Rules.Directory
-        Development.Shake.Rules.File
-        Development.Shake.Rules.Files
-        Development.Shake.Rules.Oracle
-        Development.Shake.Rules.OrderOnly
-        Development.Shake.Rules.Rerun
-        Development.Shake.Shake
-        Development.Shake.Special
-        Development.Shake.Storage
-        Development.Shake.Types
-        Development.Shake.Value
+        Development.Shake.Internal.Args
+        Development.Shake.Internal.CmdOption
+        Development.Shake.Internal.CompactUI
+        Development.Shake.Internal.Core.Action
+        Development.Shake.Internal.Core.Build
+        Development.Shake.Internal.Core.Database
+        Development.Shake.Internal.History.Shared
+        Development.Shake.Internal.History.Symlink
+        Development.Shake.Internal.History.Bloom
+        Development.Shake.Internal.History.Cloud
+        Development.Shake.Internal.History.Network
+        Development.Shake.Internal.History.Server
+        Development.Shake.Internal.History.Serialise
+        Development.Shake.Internal.History.Types
+        Development.Shake.Internal.Core.Monad
+        Development.Shake.Internal.Core.Pool
+        Development.Shake.Internal.Core.Rules
+        Development.Shake.Internal.Core.Run
+        Development.Shake.Internal.Core.Storage
+        Development.Shake.Internal.Core.Types
+        Development.Shake.Internal.Demo
+        Development.Shake.Internal.Derived
+        Development.Shake.Internal.Errors
+        Development.Shake.Internal.FileInfo
+        Development.Shake.Internal.FileName
+        Development.Shake.Internal.FilePattern
+        Development.Shake.Internal.Options
+        Development.Shake.Internal.Paths
+        Development.Shake.Internal.Profile
+        Development.Shake.Internal.Progress
+        Development.Shake.Internal.Resource
+        Development.Shake.Internal.Rules.Default
+        Development.Shake.Internal.Rules.Directory
+        Development.Shake.Internal.Rules.File
+        Development.Shake.Internal.Rules.Files
+        Development.Shake.Internal.Rules.Oracle
+        Development.Shake.Internal.Rules.OrderOnly
+        Development.Shake.Internal.Rules.Rerun
+        Development.Shake.Internal.Value
         General.Bilist
         General.Binary
+        General.Chunks
         General.Cleanup
-        General.Concurrent
+        General.Fence
+        General.EscCodes
         General.Extra
         General.FileLock
+        General.GetOpt
+        General.Ids
         General.Intern
+        General.ListBuilder
+        General.Makefile
+        General.Pool
         General.Process
-        General.String
         General.Template
+        General.Thread
         General.Timing
+        General.TypeMap
+        General.Wait
         Paths_shake
 
 
 executable shake
     default-language: Haskell2010
     hs-source-dirs:   src
-    ghc-options: -main-is Run.main
+    ghc-options: -main-is Run.main -rtsopts
+    if flag(threaded)
+        ghc-options: -threaded "-with-rtsopts=-I0 -qg"
     main-is: Run.hs
-    ghc-options: -rtsopts
-    -- GHC bug 7646 means -threaded causes errors
-    if impl(ghc >= 7.8)
-        ghc-options: -threaded "-with-rtsopts=-I0 -qg -qb"
     build-depends:
         base == 4.*,
-        directory,
-        hashable >= 1.1.2.3,
         binary,
+        bytestring,
+        deepseq >= 1.1,
+        directory,
+        extra >= 1.6.19,
         filepath,
+        filepattern,
+        hashable >= 1.1.2.3,
+        heaps >= 0.3.6.1,
+        js-dgtable,
+        js-flot,
+        js-jquery,
+        primitive,
         process >= 1.1,
-        unordered-containers >= 0.2.1,
-        bytestring,
-        utf8-string >= 0.3,
-        time,
         random,
-        js-jquery,
-        js-flot,
+        time,
         transformers >= 0.2,
-        extra >= 1.4.8,
-        deepseq >= 1.1,
-        primitive
+        unordered-containers >= 0.2.7,
+        utf8-string >= 0.3
 
+    if flag(embed-files)
+        cpp-options: -DFILE_EMBED
+        build-depends:
+            file-embed >= 0.0.11,
+            template-haskell
+
     if flag(portable)
         cpp-options: -DPORTABLE
-        if impl(ghc < 7.6)
-            build-depends: old-time
     else
         if !os(windows)
             build-depends: unix >= 2.5.1
     if !os(windows)
         build-depends: unix
 
+    if flag(cloud)
+        cpp-options: -DNETWORK
+        build-depends: network, network-uri
+
+    if impl(ghc < 8.0)
+        build-depends: semigroups >= 0.18
+
     other-modules:
-        Development.Make.All
-        Development.Make.Env
-        Development.Make.Parse
-        Development.Make.Rules
-        Development.Make.Type
         Development.Ninja.All
         Development.Ninja.Env
         Development.Ninja.Lexer
         Development.Ninja.Parse
         Development.Ninja.Type
         Development.Shake
-        Development.Shake.Args
-        Development.Shake.ByteString
         Development.Shake.Classes
-        Development.Shake.CmdOption
         Development.Shake.Command
-        Development.Shake.Core
         Development.Shake.Database
-        Development.Shake.Demo
-        Development.Shake.Derived
-        Development.Shake.Errors
-        Development.Shake.FileInfo
         Development.Shake.FilePath
-        Development.Shake.FilePattern
-        Development.Shake.Forward
-        Development.Shake.Monad
-        Development.Shake.Pool
-        Development.Shake.Profile
-        Development.Shake.Progress
-        Development.Shake.Resource
-        Development.Shake.Rule
-        Development.Shake.Rules.Directory
-        Development.Shake.Rules.File
-        Development.Shake.Rules.Files
-        Development.Shake.Rules.Oracle
-        Development.Shake.Rules.OrderOnly
-        Development.Shake.Rules.Rerun
-        Development.Shake.Shake
-        Development.Shake.Special
-        Development.Shake.Storage
-        Development.Shake.Types
-        Development.Shake.Value
+        Development.Shake.Internal.Args
+        Development.Shake.Internal.CmdOption
+        Development.Shake.Internal.CompactUI
+        Development.Shake.Internal.Core.Action
+        Development.Shake.Internal.Core.Build
+        Development.Shake.Internal.Core.Database
+        Development.Shake.Internal.History.Shared
+        Development.Shake.Internal.History.Symlink
+        Development.Shake.Internal.History.Bloom
+        Development.Shake.Internal.History.Cloud
+        Development.Shake.Internal.History.Network
+        Development.Shake.Internal.History.Server
+        Development.Shake.Internal.History.Serialise
+        Development.Shake.Internal.History.Types
+        Development.Shake.Internal.Core.Monad
+        Development.Shake.Internal.Core.Pool
+        Development.Shake.Internal.Core.Rules
+        Development.Shake.Internal.Core.Run
+        Development.Shake.Internal.Core.Storage
+        Development.Shake.Internal.Core.Types
+        Development.Shake.Internal.Demo
+        Development.Shake.Internal.Derived
+        Development.Shake.Internal.Errors
+        Development.Shake.Internal.FileInfo
+        Development.Shake.Internal.FileName
+        Development.Shake.Internal.FilePattern
+        Development.Shake.Internal.Options
+        Development.Shake.Internal.Paths
+        Development.Shake.Internal.Profile
+        Development.Shake.Internal.Progress
+        Development.Shake.Internal.Resource
+        Development.Shake.Internal.Rules.Default
+        Development.Shake.Internal.Rules.Directory
+        Development.Shake.Internal.Rules.File
+        Development.Shake.Internal.Rules.Files
+        Development.Shake.Internal.Rules.Oracle
+        Development.Shake.Internal.Rules.OrderOnly
+        Development.Shake.Internal.Rules.Rerun
+        Development.Shake.Internal.Value
         General.Bilist
         General.Binary
+        General.Chunks
         General.Cleanup
-        General.Concurrent
+        General.Fence
+        General.EscCodes
         General.Extra
         General.FileLock
+        General.GetOpt
+        General.Ids
         General.Intern
+        General.ListBuilder
+        General.Makefile
+        General.Pool
         General.Process
-        General.String
         General.Template
+        General.Thread
         General.Timing
+        General.TypeMap
+        General.Wait
         Paths_shake
-        Run
 
 
 test-suite shake-test
@@ -265,122 +335,156 @@
     type: exitcode-stdio-1.0
     main-is: Test.hs
     hs-source-dirs: src
-
-    ghc-options: -main-is Test.main -rtsopts
-    if impl(ghc >= 7.6)
-        -- space leak introduced by -O1 in 7.4, see #445
-        ghc-options: -with-rtsopts=-K1K
-    if impl(ghc >= 7.8)
-        -- GHC bug 7646 (fixed in 7.8) means -threaded causes errors
+    ghc-options: -main-is Test.main -rtsopts -with-rtsopts=-K1K
+    if flag(threaded)
         ghc-options: -threaded
 
     build-depends:
         base == 4.*,
-        directory,
-        hashable >= 1.1.2.3,
         binary,
+        bytestring,
+        deepseq >= 1.1,
+        directory,
+        extra >= 1.6.19,
         filepath,
+        filepattern,
+        hashable >= 1.1.2.3,
+        heaps >= 0.3.6.1,
+        js-dgtable,
+        js-flot,
+        js-jquery,
+        primitive,
         process >= 1.1,
-        unordered-containers >= 0.2.1,
-        bytestring,
-        utf8-string >= 0.3,
-        time,
+        QuickCheck >= 2.0,
         random,
-        js-jquery,
-        js-flot,
+        time,
         transformers >= 0.2,
-        deepseq >= 1.1,
-        extra >= 1.4.8,
-        QuickCheck >= 2.0
+        unordered-containers >= 0.2.7,
+        utf8-string >= 0.3
 
+    if flag(embed-files)
+        cpp-options: -DFILE_EMBED
+        build-depends:
+            file-embed >= 0.0.11,
+            template-haskell
+
     if flag(portable)
         cpp-options: -DPORTABLE
-        if impl(ghc < 7.6)
-            build-depends: old-time
     else
         if !os(windows)
             build-depends: unix >= 2.5.1
     if !os(windows)
         build-depends: unix
 
+    if flag(cloud)
+        cpp-options: -DNETWORK
+        build-depends: network, network-uri
+
+    if impl(ghc < 8.0)
+        build-depends: semigroups >= 0.18
+
     other-modules:
-        Development.Make.All
-        Development.Make.Env
-        Development.Make.Parse
-        Development.Make.Rules
-        Development.Make.Type
         Development.Ninja.All
         Development.Ninja.Env
         Development.Ninja.Lexer
         Development.Ninja.Parse
         Development.Ninja.Type
         Development.Shake
-        Development.Shake.Args
-        Development.Shake.ByteString
         Development.Shake.Classes
-        Development.Shake.CmdOption
         Development.Shake.Command
         Development.Shake.Config
-        Development.Shake.Core
         Development.Shake.Database
-        Development.Shake.Demo
-        Development.Shake.Derived
-        Development.Shake.Errors
-        Development.Shake.FileInfo
         Development.Shake.FilePath
-        Development.Shake.FilePattern
         Development.Shake.Forward
-        Development.Shake.Monad
-        Development.Shake.Pool
-        Development.Shake.Profile
-        Development.Shake.Progress
-        Development.Shake.Resource
+        Development.Shake.Internal.Args
+        Development.Shake.Internal.CmdOption
+        Development.Shake.Internal.CompactUI
+        Development.Shake.Internal.Core.Action
+        Development.Shake.Internal.Core.Build
+        Development.Shake.Internal.Core.Database
+        Development.Shake.Internal.History.Shared
+        Development.Shake.Internal.History.Symlink
+        Development.Shake.Internal.History.Bloom
+        Development.Shake.Internal.History.Cloud
+        Development.Shake.Internal.History.Network
+        Development.Shake.Internal.History.Server
+        Development.Shake.Internal.History.Serialise
+        Development.Shake.Internal.History.Types
+        Development.Shake.Internal.Core.Monad
+        Development.Shake.Internal.Core.Pool
+        Development.Shake.Internal.Core.Rules
+        Development.Shake.Internal.Core.Run
+        Development.Shake.Internal.Core.Storage
+        Development.Shake.Internal.Core.Types
+        Development.Shake.Internal.Demo
+        Development.Shake.Internal.Derived
+        Development.Shake.Internal.Errors
+        Development.Shake.Internal.FileInfo
+        Development.Shake.Internal.FileName
+        Development.Shake.Internal.FilePattern
+        Development.Shake.Internal.Options
+        Development.Shake.Internal.Paths
+        Development.Shake.Internal.Profile
+        Development.Shake.Internal.Progress
+        Development.Shake.Internal.Resource
+        Development.Shake.Internal.Rules.Default
+        Development.Shake.Internal.Rules.Directory
+        Development.Shake.Internal.Rules.File
+        Development.Shake.Internal.Rules.Files
+        Development.Shake.Internal.Rules.Oracle
+        Development.Shake.Internal.Rules.OrderOnly
+        Development.Shake.Internal.Rules.Rerun
+        Development.Shake.Internal.Value
         Development.Shake.Rule
-        Development.Shake.Rules.Directory
-        Development.Shake.Rules.File
-        Development.Shake.Rules.Files
-        Development.Shake.Rules.Oracle
-        Development.Shake.Rules.OrderOnly
-        Development.Shake.Rules.Rerun
-        Development.Shake.Shake
-        Development.Shake.Special
-        Development.Shake.Storage
-        Development.Shake.Types
         Development.Shake.Util
-        Development.Shake.Value
         General.Bilist
         General.Binary
+        General.Chunks
         General.Cleanup
-        General.Concurrent
+        General.Fence
+        General.EscCodes
         General.Extra
         General.FileLock
+        General.GetOpt
+        General.Ids
         General.Intern
+        General.ListBuilder
+        General.Makefile
+        General.Pool
         General.Process
-        General.String
         General.Template
+        General.Thread
         General.Timing
+        General.TypeMap
+        General.Wait
         Paths_shake
         Run
-        Test.Assume
         Test.Basic
+        Test.Batch
         Test.Benchmark
+        Test.Builtin
+        Test.BuiltinOverride
         Test.C
         Test.Cache
+        Test.Cleanup
+        Test.CloseFileHandles
         Test.Command
         Test.Config
+        Test.Database
         Test.Digest
         Test.Directory
         Test.Docs
         Test.Errors
+        Test.Existence
         Test.FileLock
         Test.FilePath
         Test.FilePattern
         Test.Files
         Test.Forward
+        Test.History
         Test.Journal
         Test.Lint
         Test.Live
-        Test.Makefile
         Test.Manual
         Test.Match
         Test.Monad
@@ -391,9 +495,14 @@
         Test.Pool
         Test.Progress
         Test.Random
+        Test.Rebuild
+        Test.Reschedule
         Test.Resources
         Test.Self
+        Test.SelfMake
         Test.Tar
+        Test.Targets
+        Test.Thread
         Test.Tup
         Test.Type
         Test.Unicode
diff --git a/src/Development/Make/All.hs b/src/Development/Make/All.hs
deleted file mode 100644
--- a/src/Development/Make/All.hs
+++ /dev/null
@@ -1,133 +0,0 @@
-{-# LANGUAGE RecordWildCards, PatternGuards #-}
-
-module Development.Make.All(runMakefile) where
-
-import Development.Shake hiding (addEnv)
-import Development.Shake.FilePath
-import Development.Make.Parse
-import Development.Make.Env
-import Development.Make.Rules
-import Development.Make.Type
-import qualified System.Directory as IO
-import Data.List
-import Data.Maybe
-import Data.Tuple.Extra
-import Control.Applicative
-import Control.Monad.Extra
-import Control.Exception.Extra
-import System.Process
-import System.Exit
-import System.Environment.Extra
-import Control.Monad.Trans.State.Strict
-import Prelude
-
-
-runMakefile :: FilePath -> [String] -> IO (Rules ())
-runMakefile file args = do
-    env <- defaultEnv
-    mk <- parse file
-    rs <- eval env mk
-    return $ do
-        defaultRuleFile_
-        case filter (not . isPrefixOf "." . target) rs of
-            Ruler x _ _ : _ | null args, '%' `notElem` x -> want_ [x]
-            _ -> return ()
-        mapM_ (want_ . return) args
-        convert rs
-
-
-data Ruler = Ruler
-    {target :: String
-    ,prereq :: (Env, Expr) -- Env is the Env at this point
-    ,cmds :: (Env, [Command]) -- Env is the Env at the end
-    }
-
-
-eval :: Env -> Makefile -> IO [Ruler]
-eval env (Makefile xs) = do
-    (rs, env) <- runStateT (concatMapM f xs) env
-    return [r{cmds=(env,snd $ cmds r)} | r <- rs]
-    where
-        f :: Stmt -> StateT Env IO [Ruler]
-        f Assign{..} = do
-            e <- get
-            e <- liftIO $ addEnv name assign expr e
-            put e
-            return []
-
-        f Rule{..} = do
-            e <- get
-            target <- liftIO $ words <$> askEnv e targets
-            return $ map (\t -> Ruler t (e, prerequisites) (undefined, commands)) target
-
-
-convert :: [Ruler] -> Rules ()
-convert rs = match ??> run
-    where
-        match s = any (isJust . check s) rs
-        check s r = makePattern (target r) s
-
-        run target =  do
-            let phony = has False ".PHONY" target
-            let silent = has True ".SILENT" target
-            (deps, cmds) <- fmap (first concat . second concat . unzip) $ forM rs $ \r ->
-                case check target r of
-                    Nothing -> return ([], [])
-                    Just op -> do
-                        let (preEnv,preExp) = prereq r
-                        env <- liftIO $ addEnv "@" Equals (Lit target) preEnv
-                        pre <- liftIO $ askEnv env preExp
-                        vp <- liftIO $ fmap splitSearchPath $ askEnv env $ Var "VPATH"
-                        pre <- mapM (vpath vp) $ words $ op pre
-                        return (pre, [cmds r])
-            mapM_ (need_ . return) deps
-            forM_ cmds $ \(env,cmd) -> do
-                env <- liftIO $ addEnv "@" Equals (Lit target) env
-                env <- liftIO $ addEnv "^" Equals (Lit $ unwords deps) env
-                env <- liftIO $ addEnv "<" Equals (Lit $ head $ deps ++ [""]) env
-                forM_ cmd $ \c ->
-                    case c of
-                        Expr c -> (if silent then quietly else id) $
-                            execCommand =<< liftIO (askEnv env c)
-            return $ if phony then Phony else NotPhony
-
-        has auto name target =
-            or [(null ws && auto) || target `elem` ws | Ruler t (_,Lit s) _ <- rs, t == name, let ws = words s]
-
-
-execCommand :: String -> Action ()
-execCommand x = do
-    res <- if "@" `isPrefixOf` x then sys $ drop 1 x
-           else putNormal x >> sys x
-    when (res /= ExitSuccess) $
-        liftIO $ errorIO $ "System command failed: " ++ x
-    where sys = quietly . traced (unwords $ take 1 $ words x) . system
-
-
-makePattern :: String -> FilePath -> Maybe (String -> String)
-makePattern pat v = case break (== '%') pat of
-    (pre,'%':post) -> if pre `isPrefixOf` v && post `isSuffixOf` v && rest >= 0
-                      then Just $ concatMap (\x -> if x == '%' then subs else [x])
-                      else Nothing
-        where rest = length v - (length pre + length post)
-              subs = take rest $ drop (length pre) v
-    _ -> if pat == v then Just id else Nothing
-
-
-vpath :: [FilePath] -> FilePath -> Action FilePath
-vpath [] y = return y
-vpath (x:xs) y = do
-    b <- doesFileExist $ x </> y
-    if b then return $ x </> y else vpath xs y
-
-
-defaultEnv :: IO Env
-defaultEnv = do
-    exePath <- getExecutablePath
-    env <- getEnvironment
-    cur <- IO.getCurrentDirectory
-    return $ newEnv $
-        ("EXE",if null exe then "" else "." ++ exe) :
-        ("MAKE",normaliseEx exePath) :
-        ("CURDIR",normaliseEx cur) :
-        env
diff --git a/src/Development/Make/Env.hs b/src/Development/Make/Env.hs
deleted file mode 100644
--- a/src/Development/Make/Env.hs
+++ /dev/null
@@ -1,40 +0,0 @@
-{-# LANGUAGE PatternGuards #-}
-
--- | The IO in this module is only to evaluate an envrionment variable,
---   the 'Env' itself it passed around purely.
-module Development.Make.Env(Env, newEnv, addEnv, askEnv) where
-
-import Development.Make.Type
-import Data.Maybe
-import qualified Data.HashMap.Strict as Map
-
-
-newtype Env = Env (Map.HashMap String (Assign,Expr))
-
-newEnv :: [(String,String)] -> Env
-newEnv xs = Env $ Map.fromList [(a,(Equals,Lit b)) | (a,b) <- xs]
-
-
-addEnv :: String -> Assign -> Expr -> Env -> IO Env
-addEnv name ass val env@(Env e) = case ass of
-    QuestionEquals -> if isJust $ Map.lookup name e then return env else addEnv name Equals val env
-    Equals -> return $ Env $ Map.insert name (Equals,val) e
-    ColonEquals -> do l <- askEnv env val; return $ Env $ Map.insert name (ColonEquals,Lit l) e
-    PlusEquals -> case Map.lookup name e of
-        Just (Equals,x) -> return $ Env $ Map.insert name (Equals,Concat [x,Lit " ",val]) e
-        Just (ColonEquals,x) -> do l <- askEnv env val; return $ Env $ Map.insert name (ColonEquals,Concat [x,Lit " ",Lit l]) e
-        _ -> addEnv name Equals val env
-
-
-askEnv :: Env -> Expr -> IO String
-askEnv (Env e) x = do
-    res <- f [] x
-    case simplifyExpr res of
-        Lit x -> return x
-        x -> error $ "Internal error in askEnv, " ++ show x
-    where
-        f seen (Var x) | x `elem` seen = error $ "Recursion in variables, " ++ show seen
-                       | Just (_,y) <- Map.lookup x e = f (x:seen) y
-                       | otherwise = return $ Lit ""
-        f seen x = descendExprM (f seen) x
-
diff --git a/src/Development/Make/Parse.hs b/src/Development/Make/Parse.hs
deleted file mode 100644
--- a/src/Development/Make/Parse.hs
+++ /dev/null
@@ -1,72 +0,0 @@
-{-# LANGUAGE PatternGuards #-}
-
-module Development.Make.Parse(parse) where
-
-import Development.Make.Type
-import Data.Char
-import Data.List
-import Data.Maybe
-
-
-trim = dropWhile isSpace . reverse . dropWhile isSpace . reverse
-
-
-parse :: FilePath -> IO Makefile
-parse file = do
-    src <- if file == "-" then getContents else readFile file
-    return $ parseMakefile src
-
-
-parseMakefile :: String -> Makefile
-parseMakefile xs = Makefile $ rejoin $ concatMap (parse . comments) $ continuations $ lines xs
-    where
-        continuations (x:y:xs) | "\\" `isSuffixOf` x = continuations $ (init x ++ dropWhile isSpace y):xs
-        continuations (x:xs) = x : continuations xs
-        continuations [] = []
-
-        comments = takeWhile (/= '#')
-
-        parse x | all isSpace x = []
-                | all isSpace $ take 1 x = [Right $ parseCommand $ trim x]
-                | (a,b) <- break (== ';') x = Left (parseStmt a) : [Right $ parseCommand $ trim $ drop 1 b | b /= ""]
-
-        rejoin (Left r@Rule{}:Right e:xs) = rejoin $ Left r{commands = commands r ++ [e]} : xs
-        rejoin (Right e:xs) = error $ "Command must be under a rule: " ++ show e
-        rejoin (Left r:xs) = r : rejoin xs
-        rejoin [] = []
-
-
-parseStmt :: String -> Stmt
-parseStmt x
-    | (a,'=':b) <- break (== '=') x, ':' `notElem` a =
-        if "+" `isSuffixOf` a then Assign (trim $ init a) PlusEquals (parseExpr $ trim b)
-        else if "?" `isSuffixOf` a then Assign (trim $ init a) QuestionEquals (parseExpr $ trim b)
-        else Assign (trim a) Equals (parseExpr $ trim b)
-    | (a,':':b) <- break (== ':') x = case b of
-        '=':b -> Assign (trim a) ColonEquals (parseExpr $ trim b)
-        ':':'=':b -> Assign (trim a) ColonEquals (parseExpr $ trim b)
-        _ -> Rule (parseExpr $ trim a) (parseExpr $ trim $ fromMaybe b $ stripPrefix ":" b) []
-    | otherwise = error $ "Invalid statement: " ++ x
-
-
-parseExpr :: String -> Expr
-parseExpr x = simplifyExpr $ Concat $ f x
-    where
-        f ('$':'$':x) = Lit "$" : f x
-        f ('$':'(':xs) = case break (== ')') xs of
-            (var,')':rest) -> parseVar var : f rest
-            _ -> error $ "Couldn't find trailing `)' after " ++ xs
-        f ('$':'{':xs) = case break (== '}') xs of
-            (var,'}':rest) -> parseVar var : f rest
-            _ -> error $ "Couldn't find trailing `}' after " ++ xs
-        f ('$':x:xs) = Var [x] : f xs
-        f (x:xs) = Lit [x] : f xs
-        f [] = []
-
-
-parseVar :: String -> Expr
-parseVar = Var
-
-
-parseCommand :: String -> Command
-parseCommand = Expr . parseExpr
diff --git a/src/Development/Make/Rules.hs b/src/Development/Make/Rules.hs
deleted file mode 100644
--- a/src/Development/Make/Rules.hs
+++ /dev/null
@@ -1,67 +0,0 @@
-{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
-
--- | These are the additional rule types required by Makefile
-module Development.Make.Rules(
-    need_, want_,
-    defaultRuleFile_,
-    (??>), Phony(..)
-    ) where
-
-import Control.Monad.IO.Class
-import System.Directory
-import Control.Applicative
-import Prelude
-
-import Development.Shake
-import Development.Shake.Rule
-import Development.Shake.Classes
-import Development.Shake.FilePath
-
--- Internal imports
-import General.String(BSU, unpackU, packU)
-import Development.Shake.FileInfo(ModTime, getFileInfo)
-
-infix 1 ??>
-
----------------------------------------------------------------------
--- FILE_ RULES
--- These are like file rules, but a rule may not bother creating the result
--- Which matches the (insane) semantics of make
--- If a file is not produced, it will rebuild forever
-
-newtype File_Q = File_Q BSU
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-instance Show File_Q where show (File_Q x) = unpackU x
-
-newtype File_A = File_A (Maybe ModTime)
-    deriving (Typeable,Eq,Hashable,Binary,Show,NFData)
-
-instance Rule File_Q File_A where
-    storedValue _ (File_Q x) = fmap (File_A . Just . fst) <$> getFileInfo x
-
-
-defaultRuleFile_ :: Rules ()
-defaultRuleFile_ = priority 0 $ rule $ \(File_Q x) -> Just $ liftIO $ do
-    res <- getFileInfo x
-    case res of
-        Nothing -> error $ "Error, file does not exist and no rule available:\n  " ++ unpackU x
-        Just (mt,_) -> return $ File_A $ Just mt
-
-
-need_ :: [FilePath] -> Action ()
-need_ xs = (apply $ map (File_Q . packU) xs :: Action [File_A]) >> return ()
-
-want_ :: [FilePath] -> Rules ()
-want_ = action . need_
-
-data Phony = Phony | NotPhony deriving Eq
-
-(??>) :: (FilePath -> Bool) -> (FilePath -> Action Phony) -> Rules ()
-(??>) test act = rule $ \(File_Q x_) -> let x = unpackU x_ in
-    if not $ test x then Nothing else Just $ do
-        liftIO $ createDirectoryIfMissing True $ takeDirectory x
-        res <- act x
-        liftIO $ fmap (File_A . fmap fst) $ if res == Phony
-            then return Nothing
-            else getFileInfo x_
diff --git a/src/Development/Make/Type.hs b/src/Development/Make/Type.hs
deleted file mode 100644
--- a/src/Development/Make/Type.hs
+++ /dev/null
@@ -1,57 +0,0 @@
-
-module Development.Make.Type where
-
-import Control.Monad
-
-
-data Makefile = Makefile [Stmt] deriving Show
-
-data Stmt
-    = Rule
-        {targets :: Expr
-        ,prerequisites :: Expr
-        ,commands :: [Command]
-        }
-    | Assign
-        {name :: String
-        ,assign :: Assign
-        ,expr :: Expr
-        }
-      deriving Show
-
-data Assign = Equals | ColonEquals | PlusEquals | QuestionEquals deriving Show
-
-data Expr = Apply String [Expr]
-          | Concat [Expr]
-          | Var String
-          | Lit String
-            deriving Show
-
-data Command = Expr Expr | String := Expr deriving Show
-
-descendExpr :: (Expr -> Expr) -> Expr -> Expr
-descendExpr f (Apply a b) = Apply a $ map f b
-descendExpr f (Concat xs) = Concat $ map f xs
-descendExpr f x = x
-
-descendExprM :: Monad m => (Expr -> m Expr) -> Expr -> m Expr
-descendExprM f (Apply a b) = Apply a `liftM` mapM f b
-descendExprM f (Concat xs) = Concat `liftM` mapM f xs
-descendExprM f x = return x
-
-transformExpr :: (Expr -> Expr) -> Expr -> Expr
-transformExpr f = f . descendExpr (transformExpr f)
-
-simplifyExpr :: Expr -> Expr
-simplifyExpr = transformExpr f
-    where
-        f (Concat xs) = case g xs of
-            [] -> Lit ""
-            [x] -> x
-            xs -> Concat xs
-        f x = x
-
-        g (Concat x:xs) = g $ x ++ xs
-        g (Lit x:Lit y:xs) = g $ Lit (x ++ y) : xs
-        g (x:xs) = x : g xs
-        g [] = []
diff --git a/src/Development/Ninja/All.hs b/src/Development/Ninja/All.hs
--- a/src/Development/Ninja/All.hs
+++ b/src/Development/Ninja/All.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE RecordWildCards, ViewPatterns #-}
+{-# LANGUAGE RecordWildCards, ViewPatterns, ScopedTypeVariables, TupleSections #-}
 
 module Development.Ninja.All(runNinja) where
 
@@ -6,6 +6,7 @@
 import Development.Ninja.Type
 import Development.Ninja.Parse
 import Development.Shake hiding (addEnv)
+import Development.Shake.Classes
 import qualified Data.ByteString as BS8
 import qualified Data.ByteString.Char8 as BS
 
@@ -13,30 +14,33 @@
 import qualified Data.HashMap.Strict as Map
 import qualified Data.HashSet as Set
 import Data.Tuple.Extra
-import Control.Applicative
 import Control.Exception.Extra
 import Control.Monad
 import Data.Maybe
 import Data.Char
 import Data.List.Extra
 import System.Info.Extra
-import Prelude
 
 -- Internal imports
+import General.Extra(removeFile_, headErr)
 import General.Timing(addTiming)
-import Development.Shake.ByteString(filepathNormalise, parseMakefile)
-import Development.Shake.Errors(errorStructured)
-import Development.Shake.Rules.File(needBS, neededBS)
-import Development.Shake.Rules.OrderOnly(orderOnlyBS)
+import General.Makefile(parseMakefile)
+import Development.Shake.Internal.FileName(filepathNormalise, fileNameFromString)
+import Development.Shake.Internal.FileInfo(getFileInfo)
+import Development.Shake.Internal.Errors(throwM, errorStructured)
+import Development.Shake.Internal.Rules.File(needBS, neededBS)
+import Development.Shake.Internal.Rules.OrderOnly(orderOnlyBS)
 
 
-runNinja :: FilePath -> [String] -> Maybe String -> IO (Maybe (Rules ()))
-runNinja file args (Just "compdb") = do
+-- | Given the Ninja source file, a list of file arguments, a tool name.
+--   Return a bool if you should restart and the rules.
+runNinja :: IO () -> FilePath -> [String] -> Maybe String -> IO (Maybe (Rules ()))
+runNinja _ file args (Just "compdb") = do
     dir <- getCurrentDirectory
     Ninja{..} <- parse file =<< newEnv
-    rules <- return $ Map.fromList [r | r <- rules, BS.unpack (fst r) `elem` args]
+    rules<- pure $ Map.fromList [r | r <- rules, BS.unpack (fst r) `elem` args]
     -- the build items are generated in reverse order, hence the reverse
-    let xs = [(a,b,file,rule) | (a,b@Build{..}) <- reverse $ multiples ++ map (first return) singles
+    let xs = [(a,b,file,rule) | (a,b@Build{..}) <- reverse $ multiples ++ map (first pure) singles
                               , Just rule <- [Map.lookup ruleName rules], file:_ <- [depsNormal]]
     xs <- forM xs $ \(out,Build{..},file,Rule{..}) -> do
         -- the order of adding new environment variables matters
@@ -47,31 +51,39 @@
         forM_ buildBind $ \(a,b) -> addEnv env a b
         addBinds env ruleBind
         commandline <- fmap BS.unpack $ askVar env $ BS.pack "command"
-        return $ CompDb dir commandline $ BS.unpack $ head depsNormal
+        pure $ CompDb dir commandline $ BS.unpack file
     putStr $ printCompDb xs
-    return Nothing
+    pure Nothing
 
-runNinja file args (Just x) = errorIO $ "Unknown tool argument, expected 'compdb', got " ++ x
+runNinja _ _ _ (Just x) = errorIO $ "Unknown tool argument, expected 'compdb', got " ++ x
 
-runNinja file args tool = do
+runNinja restart file args Nothing = do
     addTiming "Ninja parse"
     ninja@Ninja{..} <- parse file =<< newEnv
-    return $ Just $ do
-        needDeps <- return $ needDeps ninja -- partial application
-        phonys <- return $ Map.fromList phonys
-        singles <- return $ Map.fromList $ map (first filepathNormalise) singles
-        multiples <- return $ Map.fromList [(x,(xs,b)) | (xs,b) <- map (first $ map filepathNormalise) multiples, x <- xs]
-        rules <- return $ Map.fromList rules
+    pure $ Just $ do
+        phonys<- pure $ Map.fromList phonys
+        needDeps<- pure $ needDeps ninja phonys -- partial application
+        singles<- pure $ Map.fromList $ map (first filepathNormalise) singles
+        multiples<- pure $ Map.fromList [(x,(xs,b)) | (xs,b) <- map (first $ map filepathNormalise) multiples, x <- xs]
+        rules<- pure $ Map.fromList rules
         pools <- fmap Map.fromList $ forM ((BS.pack "console",1):pools) $ \(name,depth) ->
-            (,) name <$> newResource (BS.unpack name) depth
+            (name,) <$> newResource (BS.unpack name) depth
 
-        action $ needBS $ concatMap (resolvePhony phonys) $
-            if not $ null args then map BS.pack args
-            else if not $ null defaults then defaults
-            else Map.keys singles ++ Map.keys multiples
+        action $ do
+            -- build the .ninja files, if they change, restart the build
+            before <- liftIO $ mapM (getFileInfo False . fileNameFromString) sources
+            need sources
+            after <- liftIO $ mapM (getFileInfo False . fileNameFromString) sources
+            if before /= after then
+                runAfter restart
+             else
+                needBS $ concatMap (resolvePhony phonys) $
+                    if not $ null args then map BS.pack args
+                    else if not $ null defaults then defaults
+                    else Map.keys singles ++ Map.keys multiples
 
-        (\x -> (map BS.unpack . fst) <$> Map.lookup (BS.pack x) multiples) &?> \out -> let out2 = map BS.pack out in
-            build needDeps phonys rules pools out2 $ snd $ multiples Map.! head out2
+        (\x -> map BS.unpack . fst <$> Map.lookup (BS.pack x) multiples) &?> \out -> let out2 = map BS.pack out in
+            build needDeps phonys rules pools out2 $ snd $ multiples Map.! headErr out2
 
         (flip Map.member singles . BS.pack) ?> \out -> let out2 = BS.pack out in
             build needDeps phonys rules pools [out2] $ singles Map.! out2
@@ -81,7 +93,7 @@
 resolvePhony mp = f $ Left 100
     where
         f (Left 0) x = f (Right []) x
-        f (Right xs) x | x `elem` xs = error $ "Recursive phony involving " ++ BS.unpack x
+        f (Right xs) x | x `elem` xs = error $ "Ninja recursive phony involving " ++ BS.unpack x
         f a x = case Map.lookup x mp of
             Nothing -> [x]
             Just xs -> concatMap (f $ either (Left . subtract 1) (Right . (x:)) a) xs
@@ -120,7 +132,7 @@
                         Nothing -> liftIO $ errorIO $ "Ninja pool named " ++ BS.unpack pool ++ " not found, required to build " ++ BS.unpack (BS.unwords out)
                         Just r -> withResource r 1 act
 
-                when (description /= "") $ putNormal description
+                when (description /= "") $ putInfo description
                 let (cmdOpts, cmdProg, cmdArgs) = toCommand commandline
                 if deps == "msvc" then do
                     Stdout stdout <- withPool $ command cmdOpts cmdProg cmdArgs
@@ -137,42 +149,46 @@
                     -- when (deps == "gcc") $ liftIO $ removeFile depfile
 
 
-needDeps :: Ninja -> Build -> [Str] -> Action ()
-needDeps Ninja{..} = \build xs -> do -- eta reduced so 'builds' is shared
+needDeps :: Ninja -> Map.HashMap Str [Str] -> Build -> [Str] -> Action ()
+needDeps Ninja{..} phonysMp = \build xs -> do -- eta reduced so 'builds' is shared
     opts <- getShakeOptions
     if isNothing $ shakeLint opts then needBS xs else do
         neededBS xs
         -- now try and statically validate needed will never fail
         -- first find which dependencies are generated files
-        xs <- return $ filter (`Map.member` builds) xs
+        xs<- pure $ filter (`Map.member` builds) xs
         -- now try and find them as dependencies
+        -- performance note: allDependencies generates lazily, and difference consumes lazily,
+        -- with the property that in the common case it won't generate much of the list at all
         let bad = xs `difference` allDependencies build
         case bad of
-            [] -> return ()
-            x:_ -> liftIO $ errorStructured
-                "Lint checking error - file in deps is generated and not a pre-dependency"
-                [("File", Just $ BS.unpack x)]
+            [] -> pure ()
+            xs -> throwM $ errorStructured
+                ("Lint checking error - " ++
+                    (if length xs == 1 then "file in deps is" else "files in deps are") ++
+                    " generated and not a pre-dependency")
+                [("File", Just $ BS.unpack x) | x <- xs]
                 ""
     where
         builds :: Map.HashMap FileStr Build
         builds = Map.fromList $ singles ++ [(x,y) | (xs,y) <- multiples, x <- xs]
 
         -- do list difference, assuming a small initial set, most of which occurs early in the list
-        difference :: [Str] -> [Str] -> [Str]
-        difference [] ys = []
+        difference :: (Eq a, Hashable a) => [a] -> [a] -> [a]
+        difference [] _ = []
         difference xs ys = f (Set.fromList xs) ys
             where
                 f xs [] = Set.toList xs
-                f xs (y:ys) | y `Set.member` xs = if Set.null xs2 then [] else f xs2 ys
-                    where xs2 = Set.delete y xs
-                f xs (y:ys) = f xs ys
+                f xs (y:ys)
+                    | y `Set.member` xs = let xs2 = Set.delete y xs in if Set.null xs2 then [] else f xs2 ys
+                    | otherwise = f xs ys
 
         -- find all dependencies of a rule, no duplicates, with all dependencies of this rule listed first
         allDependencies :: Build -> [FileStr]
         allDependencies rule = f Set.empty [] [rule]
             where
-                f seen [] [] = []
-                f seen [] (x:xs) = f seen (map filepathNormalise $ depsNormal x ++ depsImplicit x ++ depsOrderOnly x) xs
+                f _ [] [] = []
+                f seen [] (x:xs) = f seen (map filepathNormalise $ concatMap (resolvePhony phonysMp) $ depsNormal x ++ depsImplicit x ++ depsOrderOnly x) xs
                 f seen (x:xs) rest | x `Set.member` seen = f seen xs rest
                                    | otherwise = x : f (Set.insert x seen) xs (maybeToList (Map.lookup x builds) ++ rest)
 
@@ -184,7 +200,7 @@
     if rspfile == "" then
         act
      else
-        flip actionFinally (ignore $ removeFile rspfile) $ do
+        flip actionFinally (removeFile_ rspfile) $ do
             liftIO $ BS.writeFile rspfile rspfile_content
             act
 
@@ -213,7 +229,7 @@
     deriving Show
 
 printCompDb :: [CompDb] -> String
-printCompDb xs = unlines $ ["["] ++ concat (zipWith f [1..] xs) ++ ["]"]
+printCompDb xs = unlines $ ["["] ++ concat (zipWithFrom f 1 xs) ++ ["]"]
     where
         n = length xs
         f i CompDb{..} =
@@ -236,7 +252,7 @@
         -- Using the "cmd" program adds overhead (I measure 7ms), and a limit of 8191 characters,
         -- but is the most robust, requiring no additional escaping.
         ([Shell], s, [])
-    | (cmd,s) <- word1 s, map toUpper cmd `elem` ["CMD","CMD.EXE"], ("/c",s) <- word1 s =
+    | (cmd,s) <- word1 s, upper cmd `elem` ["CMD","CMD.EXE"], ("/c",s) <- word1 s =
         -- Given "cmd.exe /c <something>" we translate to Shell, which adds cmd.exe
         -- (looked up on the current path) and /c to the front. CMake uses this rule a lot.
         -- Adding quotes around pieces are /c goes very wrong.
@@ -244,7 +260,7 @@
     | otherwise =
         -- It's a long command line which doesn't call "cmd /c". We reverse the escaping
         -- Haskell applies, but each argument will still gain quotes around it.
-        let xs = splitArgs s in ([], head $ xs ++ [""], drop 1 xs)
+        let xs = splitArgs s in ([], headDef "" xs, drop1 xs)
 
 
 data State
@@ -268,7 +284,7 @@
                     | otherwise -> add (replicate ((a+1) `div` 2) '\\') $ f s ('\"':xs)
             xs -> add (replicate (a+1) '\\') $ f s xs
         f s (x:xs) = add [x] $ f s xs
-        f s [] = [[]]
+        f _ [] = [[]]
 
         add a (b:c) = (a++b):c
         add a [] = [a]
diff --git a/src/Development/Ninja/Env.hs b/src/Development/Ninja/Env.hs
--- a/src/Development/Ninja/Env.hs
+++ b/src/Development/Ninja/Env.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE PatternGuards #-}
 
--- | A Ninja style environment, basically a linked-list of mutable hash tables.
+-- | A Ninja style environment, equivalent to a non-empty list of mutable hash tables.
 module Development.Ninja.Env(
     Env, newEnv, scopeEnv, addEnv, askEnv, fromEnv
     ) where
@@ -16,11 +16,11 @@
 
 
 newEnv :: IO (Env k v)
-newEnv = do ref <- newIORef Map.empty; return $ Env ref Nothing
+newEnv = do ref <- newIORef Map.empty; pure $ Env ref Nothing
 
 
 scopeEnv :: Env k v -> IO (Env k v)
-scopeEnv e = do ref <- newIORef Map.empty; return $ Env ref $ Just e
+scopeEnv e = do ref <- newIORef Map.empty; pure $ Env ref $ Just e
 
 
 addEnv :: (Eq k, Hashable k) => Env k v -> k -> v -> IO ()
@@ -31,9 +31,9 @@
 askEnv (Env ref e) k = do
     mp <- readIORef ref
     case Map.lookup k mp of
-        Just v -> return $ Just v
+        Just v -> pure $ Just v
         Nothing | Just e <- e -> askEnv e k
-        _ -> return Nothing
+        _ -> pure Nothing
 
 fromEnv :: Env k v -> IO (Map.HashMap k v)
 fromEnv (Env ref _) = readIORef ref
diff --git a/src/Development/Ninja/Lexer.hs b/src/Development/Ninja/Lexer.hs
--- a/src/Development/Ninja/Lexer.hs
+++ b/src/Development/Ninja/Lexer.hs
@@ -3,10 +3,10 @@
 -- {-# OPTIONS_GHC -ddump-simpl #-}
 
 -- | Lexing is a slow point, the code below is optimised
-module Development.Ninja.Lexer(Lexeme(..), lexer, lexerFile) where
+module Development.Ninja.Lexer(Lexeme(..), lexerFile) where
 
-import Control.Applicative
 import Data.Tuple.Extra
+import Data.Char
 import qualified Data.ByteString.Char8 as BS
 import qualified Data.ByteString.Unsafe as BS
 import Development.Ninja.Type
@@ -16,7 +16,6 @@
 import Foreign.Ptr
 import Foreign.Storable
 import GHC.Exts
-import Prelude
 
 ---------------------------------------------------------------------
 -- LIBRARY BITS
@@ -25,11 +24,11 @@
 
 type S = Ptr Word8
 
-chr :: S -> Char
-chr x = Internal.w2c $ unsafePerformIO $ peek x
+char :: S -> Char
+char x = Internal.w2c $ unsafePerformIO $ peek x
 
-inc :: S -> S
-inc x = x `plusPtr` 1
+next :: S -> S
+next x = x `plusPtr` 1
 
 {-# INLINE dropWhile0 #-}
 dropWhile0 :: (Char -> Bool) -> Str0 -> Str0
@@ -46,11 +45,11 @@
         i = unsafePerformIO $ BS.unsafeUseAsCString bs $ \ptr -> do
             let start = castPtr ptr :: S
             let end = go start
-            return $! Ptr end `minusPtr` start
+            pure $! Ptr end `minusPtr` start
 
         go s@(Ptr a) | c == '\0' || f c = a
-                     | otherwise = go (inc s)
-            where c = chr s
+                     | otherwise = go (next s)
+            where c = char s
 
 {-# INLINE break00 #-}
 -- The predicate must return true for '\0'
@@ -60,11 +59,11 @@
         i = unsafePerformIO $ BS.unsafeUseAsCString bs $ \ptr -> do
             let start = castPtr ptr :: S
             let end = go start
-            return $! Ptr end `minusPtr` start
+            pure $! Ptr end `minusPtr` start
 
         go s@(Ptr a) | f c = a
-                     | otherwise = go (inc s)
-            where c = chr s
+                     | otherwise = go (next s)
+            where c = char s
 
 head0 :: Str0 -> Char
 head0 (Str0 x) = Internal.w2c $ BS.unsafeHead x
@@ -95,7 +94,7 @@
       deriving Show
 
 isVar, isVarDot :: Char -> Bool
-isVar x = x == '-' || x == '_' || (x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z') || (x >= '0' && x <= '9')
+isVar x = x == '-' || x == '_' || isAsciiLower x || isAsciiUpper x || isDigit x
 isVarDot x = x == '.' || isVar x
 
 endsDollar :: Str -> Bool
@@ -120,16 +119,16 @@
     '\n' -> lexerLoop x
     ' ' -> lexBind $ dropSpace x
     '#' -> lexerLoop $ dropWhile0 (/= '\n') x
-    'b' | Just x <- strip "uild " x -> lexBuild $ dropSpace x
-    'r' | Just x <- strip "ule " x -> lexRule $ dropSpace x
-    'd' | Just x <- strip "efault " x -> lexDefault $ dropSpace x
-    'p' | Just x <- strip "ool " x -> lexPool $ dropSpace x
-    'i' | Just x <- strip "nclude " x -> lexInclude $ dropSpace x
-    's' | Just x <- strip "ubninja " x -> lexSubninja $ dropSpace x
+    'b' | Just x <- strip "uild " x -> lexBuild x
+    'r' | Just x <- strip "ule " x -> lexRule x
+    'd' | Just x <- strip "efault " x -> lexDefault x
+    'p' | Just x <- strip "ool " x -> lexPool x
+    'i' | Just x <- strip "nclude " x -> lexInclude x
+    's' | Just x <- strip "ubninja " x -> lexSubninja x
     '\0' -> []
     _ -> lexDefine c_x
     where
-        strip str (Str0 x) = if b `BS.isPrefixOf` x then Just $ Str0 $ BS.drop (BS.length b) x else Nothing
+        strip str (Str0 x) = if b `BS.isPrefixOf` x then Just $ dropSpace $ Str0 $ BS.drop (BS.length b) x else Nothing
             where b = BS.pack str
 
 lexBind :: Str0 -> [Lexeme]
@@ -143,7 +142,7 @@
 lexBuild :: Str0 -> [Lexeme]
 lexBuild x
     | (outputs,x) <- lexxExprs True x
-    , (rule,x) <- span0 isVarDot $ dropSpace x
+    , (rule,x) <- span0 isVarDot $ jumpCont $ dropSpace x
     , (deps,x) <- lexxExprs False $ dropSpace x
     = LexBuild outputs rule deps : lexerLoop x
 
@@ -162,10 +161,10 @@
 lexxBind :: (Str -> Expr -> Lexeme) -> Str0 -> [Lexeme]
 lexxBind ctor x
     | (var,x) <- span0 isVarDot x
-    , ('=',x) <- list0 $ dropSpace x
-    , (exp,x) <- lexxExpr False False $ dropSpace x
+    , ('=',x) <- list0 $ jumpCont $ dropSpace x
+    , (exp,x) <- lexxExpr False False $ jumpCont $ dropSpace x
     = ctor var exp : lexerLoop x
-lexxBind _ x = error $ show ("parse failed when parsing binding", take0 100 x)
+lexxBind _ x = error $ "Ninja parse failed when parsing binding, " ++ show (take0 100 x)
 
 lexxFile :: (Expr -> Lexeme) -> Str0 -> [Lexeme]
 lexxFile ctor x
@@ -181,15 +180,17 @@
 lexxExprs :: Bool -> Str0 -> ([Expr], Str0)
 lexxExprs stopColon x = case lexxExpr stopColon True x of
     (a,c_x) | c <- head0 c_x, x <- tail0 c_x -> case c of
-        ' ' -> first (a:) $ lexxExprs stopColon $ dropSpace x
-        ':' | stopColon -> ([a], x)
-        _ | stopColon -> error "expected a colon"
-        '\r' -> a $: dropN x
-        '\n' -> a $: x
-        '\0' -> a $: c_x
+        ' ' -> add a $ lexxExprs stopColon $ dropSpace x
+        ':' | stopColon -> new a x
+        _ | stopColon -> error "Ninja parsing, expected a colon"
+        '\r' -> new a $ dropN x
+        '\n' -> new a x
+        '\0' -> new a c_x
+        _ -> error "Ninja parsing, unexpected expression"
     where
-        Exprs [] $: x = ([], x)
-        a $: x = ([a], x)
+        new a x = add a ([], x)
+        add (Exprs []) x = x
+        add a (as,x) = (a:as,x)
 
 
 {-# NOINLINE lexxExpr #-}
@@ -217,8 +218,17 @@
             '\r' -> f $ dropSpace $ dropN x
             '{' | (name,x) <- span0 isVarDot x, not $ BS.null name, ('}',x) <- list0 x -> Var name $: f x
             _ | (name,x) <- span0 isVar c_x, not $ BS.null name -> Var name $: f x
-            _ -> error "Unexpect $ followed by unexpected stuff"
+            _ -> error "Ninja parsing, unexpect $ followed by unexpected stuff"
 
+jumpCont :: Str0 -> Str0
+jumpCont o
+    | '$' <- head0 o
+    , let x = tail0 o
+    = case head0 x of
+        '\n' -> dropSpace $ tail0 x
+        '\r' -> dropSpace $ dropN $ tail0 x
+        _ -> o
+    | otherwise = o
 
 splitLineCont :: Str0 -> (Str, Str0)
 splitLineCont x = first BS.concat $ f x
diff --git a/src/Development/Ninja/Parse.hs b/src/Development/Ninja/Parse.hs
--- a/src/Development/Ninja/Parse.hs
+++ b/src/Development/Ninja/Parse.hs
@@ -6,9 +6,8 @@
 import Development.Ninja.Env
 import Development.Ninja.Type
 import Development.Ninja.Lexer
-import Control.Applicative
 import Control.Monad
-import Prelude
+import General.Extra
 
 
 parse :: FilePath -> Env Str Str -> IO Ninja
@@ -18,7 +17,7 @@
 parseFile :: FilePath -> Env Str Str -> Ninja -> IO Ninja
 parseFile file env ninja = do
     lexes <- lexerFile $ if file == "-" then Nothing else Just file
-    foldM (applyStmt env) ninja $ withBinds lexes
+    foldM (applyStmt env) ninja{sources=file:sources ninja} $ withBinds lexes
 
 withBinds :: [Lexeme] -> [(Lexeme, [(Str,Expr)])]
 withBinds [] = []
@@ -37,18 +36,18 @@
         binds <- mapM (\(a,b) -> (a,) <$> askExpr env b) binds
         let (normal,implicit,orderOnly) = splitDeps deps
         let build = Build rule env normal implicit orderOnly binds
-        return $
+        pure $
             if rule == BS.pack "phony" then ninja{phonys = [(x, normal ++ implicit ++ orderOnly) | x <- outputs] ++ phonys}
-            else if length outputs == 1 then ninja{singles = (head outputs, build) : singles}
+            else if length outputs == 1 then ninja{singles = (headErr outputs, build) : singles}
             else ninja{multiples = (outputs, build) : multiples}
     LexRule name ->
-        return ninja{rules = (name, Rule binds) : rules}
+        pure ninja{rules = (name, Rule binds) : rules}
     LexDefault xs -> do
         xs <- mapM (askExpr env) xs
-        return ninja{defaults = xs ++ defaults}
+        pure ninja{defaults = xs ++ defaults}
     LexPool name -> do
         depth <- getDepth env binds
-        return ninja{pools = (name, depth) : pools}
+        pure ninja{pools = (name, depth) : pools}
     LexInclude expr -> do
         file <- askExpr env expr
         parseFile (BS.unpack file) env ninja
@@ -58,9 +57,9 @@
         parseFile (BS.unpack file) e ninja
     LexDefine a b -> do
         addBind env a b
-        return ninja
-    LexBind a b ->
-        error $ "Unexpected binding defining " ++ BS.unpack a
+        pure ninja
+    LexBind a _ ->
+        error $ "Ninja parsing, unexpected binding defining " ++ BS.unpack a
 
 
 splitDeps :: [Str] -> ([Str], [Str], [Str])
@@ -73,9 +72,9 @@
 
 getDepth :: Env Str Str -> [(Str, Expr)] -> IO Int
 getDepth env xs = case lookup (BS.pack "depth") xs of
-    Nothing -> return 1
+    Nothing -> pure 1
     Just x -> do
         x <- askExpr env x
         case BS.readInt x of
-            Just (i, n) | BS.null n -> return i
-            _ -> error $ "Could not parse depth field in pool, got: " ++ BS.unpack x
+            Just (i, n) | BS.null n -> pure i
+            _ -> error $ "Ninja parsing, could not parse depth field in pool, got: " ++ BS.unpack x
diff --git a/src/Development/Ninja/Type.hs b/src/Development/Ninja/Type.hs
--- a/src/Development/Ninja/Type.hs
+++ b/src/Development/Ninja/Type.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE TupleSections #-}
 
--- | The IO in this module is only to evaluate an envrionment variable,
+-- | The IO in this module is only to evaluate an environment variable,
 --   the 'Env' itself it passed around purely.
 module Development.Ninja.Type(
     Str, FileStr,
@@ -8,11 +8,9 @@
     Ninja(..), newNinja, Build(..), Rule(..),
     ) where
 
-import Control.Applicative
 import Development.Ninja.Env
 import qualified Data.ByteString.Char8 as BS
 import Data.Maybe
-import Prelude
 
 
 type Str = BS.ByteString
@@ -27,7 +25,7 @@
 askExpr :: Env Str Str -> Expr -> IO Str
 askExpr e = f
     where f (Exprs xs) = BS.concat <$> mapM f xs
-          f (Lit x) = return x
+          f (Lit x) = pure x
           f (Var x) = askVar e x
 
 askVar :: Env Str Str -> Str -> IO Str
@@ -46,7 +44,8 @@
 -- STRUCTURE
 
 data Ninja = Ninja
-    {rules :: [(Str,Rule)]
+    {sources :: [FilePath]
+    ,rules :: [(Str,Rule)]
     ,singles :: [(FileStr,Build)]
     ,multiples :: [([FileStr], Build)]
     ,phonys :: [(Str, [FileStr])]
@@ -56,7 +55,7 @@
     deriving Show
 
 newNinja :: Ninja
-newNinja = Ninja [] [] [] [] [] []
+newNinja = Ninja [] [] [] [] [] [] []
 
 data Build = Build
     {ruleName :: Str
@@ -67,6 +66,6 @@
     ,buildBind :: [(Str,Str)]
     } deriving Show
 
-data Rule = Rule
+newtype Rule = Rule
     {ruleBind :: [(Str,Expr)]
     } deriving Show
diff --git a/src/Development/Shake.hs b/src/Development/Shake.hs
--- a/src/Development/Shake.hs
+++ b/src/Development/Shake.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE TypeFamilies, TypeOperators, ConstraintKinds, PatternSynonyms #-}
 
 -- | This module is used for defining Shake build systems. As a simple example of a Shake build system,
 --   let us build the file @result.tar@ from the files listed by @result.txt@:
@@ -30,82 +31,46 @@
 --   To find out more:
 --
 -- * The user manual contains a longer example and background information on how to use Shake
---   <http://www.shakebuild.com/manual>.
+--   <https://www.shakebuild.com/manual>.
 --
--- * The home page has links to additional information <http://www.shakebuild.com/>, including
+-- * The home page has links to additional information <https://www.shakebuild.com/>, including
 --   a mailing list.
 --
 -- * The theory behind Shake is described in an ICFP 2012 paper,
---   <http://community.haskell.org/~ndm/downloads/paper-shake_before_building-10_sep_2012.pdf Shake Before Building -- Replacing Make with Haskell>.
---   The <http://www.youtube.com/watch?v=xYCPpXVlqFM associated talk> forms a short overview of Shake .
---
---   /== WRITING A BUILD SYSTEM ==============================/
---
---   When writing a Shake build system, start by defining what you 'want', then write rules
---   with '%>' to produce the results. Before calling 'cmd' you should ensure that any files the command
---   requires are demanded with calls to 'need'. We offer the following advice to Shake users:
---
--- * If @ghc --make@ or @cabal@ is capable of building your project, use that instead. Custom build systems are
---   necessary for many complex projects, but many projects are not complex.
---
--- * The 'shakeArgs' function automatically handles command line arguments. To define non-file targets use 'phony'.
---
--- * Put all result files in a distinguished directory, for example @_make@. You can implement a @clean@
---   command by removing that directory, using @'removeFilesAfter' \"_make\" [\"\/\/\*\"]@.
---
--- * To obtain parallel builds set 'shakeThreads' to a number greater than 1.
---
--- * Lots of compilers produce @.o@ files. To avoid overlapping rules, use @.c.o@ for C compilers,
---   @.hs.o@ for Haskell compilers etc.
---
--- * Do not be afraid to mix Shake rules, system commands and other Haskell libraries -- use each for what
---   it does best.
---
--- * The more accurate the dependencies are, the better. Use additional rules like 'doesFileExist' and
---   'getDirectoryFiles' to track information other than just the contents of files. For information in the environment
---   that you suspect will change regularly (perhaps @ghc@ version number), either write the information to
---   a file with 'alwaysRerun' and 'writeFileChanged', or use 'addOracle'.
---
---   /== GHC BUILD FLAGS ==============================/
---
---   For large build systems the choice of GHC flags can have a significant impact. We recommend:
---
--- > ghc --make MyBuildSystem -rtsopts -with-rtsopts=-I0
---
---   * @-rtsopts@: Allow the setting of further GHC options at runtime.
---
---   * @-I0@: Disable idle garbage collection, to avoid frequent unnecessary garbage collection, see
---     <http://stackoverflow.com/questions/34588057/why-does-shake-recommend-disabling-idle-garbage-collection/ a full explanation>.
---
---   * With GHC 7.6 and before, omit @-threaded@: <http://ghc.haskell.org/trac/ghc/ticket/7646 GHC bug 7646>
---     can cause a race condition in build systems that write files then read them. Omitting @-threaded@ will
---     still allow your 'cmd' actions to run in parallel, so most build systems will still run in parallel.
---
---   * With GHC 7.8 and later you may add @-threaded@, and pass the options @-qg -qb@ to @-with-rtsopts@
---     to disable parallel garbage collection. Parallel garbage collection in Shake
---     programs typically goes slower than sequential garbage collection, while occupying many cores that
---     could be used for running system commands.
---
---   /Acknowledgements/: Thanks to Austin Seipp for properly integrating the profiling code.
+--   <https://ndmitchell.com/downloads/paper-shake_before_building-10_sep_2012.pdf Shake Before Building -- Replacing Make with Haskell>.
+--   The <https://www.youtube.com/watch?v=xYCPpXVlqFM associated talk> forms a short overview of Shake.
 module Development.Shake(
+    -- * Writing a build system
+    -- $writing
+
+    -- * GHC build flags
+    -- $flags
+
+    -- * Other Shake modules
+    -- $modules
+
     -- * Core
     shake,
     shakeOptions,
-    Rules, action, withoutActions, alternatives, priority,
+    Rules, action, withoutActions, alternatives, priority, versioned,
     Action, traced,
-    liftIO, actionOnException, actionFinally,
+    liftIO, actionOnException, actionFinally, actionBracket, actionCatch, actionRetry, runAfter,
     ShakeException(..),
     -- * Configuration
-    ShakeOptions(..), Assume(..), Lint(..), Change(..), getShakeOptions, getHashedShakeVersion,
+    ShakeOptions(..), Rebuild(..), Lint(..), Change(..),
+    getShakeOptions, getShakeOptionsRules, getHashedShakeVersion,
+    getShakeExtra, getShakeExtraRules, addShakeExtra,
     -- ** Command line
-    shakeArgs, shakeArgsWith, shakeOptDescrs,
+    shakeArgs, shakeArgsWith, shakeArgsOptionsWith, shakeOptDescrs, addHelpSuffix,
+    -- ** Targets
+    getTargets, addTarget, withTargetDocs, withoutTargets,
     -- ** Progress reporting
     Progress(..), progressSimple, progressDisplay, progressTitlebar, progressProgram, getProgress,
     -- ** Verbosity
-    Verbosity(..), getVerbosity, putLoud, putNormal, putQuiet, withVerbosity, quietly,
+    Verbosity(..), getVerbosity, putVerbose, putInfo, putWarn, putError, withVerbosity, quietly,
     -- * Running commands
-    command, command_, cmd, unit,
-    Stdout(..), Stderr(..), Stdouterr(..), Exit(..), CmdTime(..), CmdLine(..),
+    command, command_, cmd, cmd_, unit,
+    Stdout(..), StdoutTrim(..), Stderr(..), Stdouterr(..), Exit(..), Process(..), CmdTime(..), CmdLine(..), FSATrace(..),
     CmdResult, CmdString, CmdOption(..),
     addPath, addEnv,
     -- * Explicit parallelism
@@ -116,19 +81,20 @@
     writeFile', writeFileLines, writeFileChanged,
     removeFiles, removeFilesAfter,
     withTempFile, withTempDir,
+    withTempFileWithin, withTempDirWithin,
     -- * File rules
     need, want, (%>), (|%>), (?>), phony, (~>), phonys,
     (&%>), (&?>),
     orderOnly, orderOnlyAction,
-    FilePattern, (?==), (<//>),
+    FilePattern, (?==), (<//>), filePattern,
     needed, trackRead, trackWrite, trackAllow,
     -- * Directory rules
     doesFileExist, doesDirectoryExist, getDirectoryContents, getDirectoryFiles, getDirectoryDirs,
     getDirectoryFilesIO,
     -- * Environment rules
-    getEnv, getEnvWithDefault,
+    getEnv, getEnvWithDefault, getEnvError,
     -- * Oracle rules
-    ShakeValue, addOracle, askOracle, askOracleWith,
+    ShakeValue, RuleResult, addOracle, addOracleCache, addOracleHash, askOracle, askOracles,
     -- * Special rules
     alwaysRerun,
     -- * Resources
@@ -137,66 +103,153 @@
     unsafeExtraThread,
     -- * Cache
     newCache, newCacheIO,
+    historyDisable, produces,
+    -- * Batching
+    needHasChanged,
+    resultHasChanged,
+    batch,
+    reschedule,
     -- * Deprecated
-    (*>), (|*>), (&*>),
-    (**>), (*>>), (?>>),
-    system', systemCwd, systemOutput
+    askOracleWith,
+    deprioritize,
+    pattern Quiet, pattern Normal, pattern Loud, pattern Chatty,
+    putLoud, putNormal, putQuiet
     ) where
 
-import Prelude(Maybe, FilePath) -- Since GHC 7.10 duplicates *>
-
 -- I would love to use module export in the above export list, but alas Haddock
 -- then shows all the things that are hidden in the docs, which is terrible.
 import Control.Monad.IO.Class
-import Development.Shake.Types
-import Development.Shake.Core hiding (trackAllow)
-import Development.Shake.Derived
-import Development.Shake.Errors
-import Development.Shake.Progress
-import Development.Shake.Args
-import Development.Shake.Shake
+import Development.Shake.Internal.Value
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Resource
+import Development.Shake.Internal.Derived
+import Development.Shake.Internal.Errors
+import Development.Shake.Internal.Progress
+import Development.Shake.Internal.Args
 
 import Development.Shake.Command
-import Development.Shake.Rules.Directory
-import Development.Shake.Rules.File
-import Development.Shake.FilePattern
-import Development.Shake.Rules.Files
-import Development.Shake.Rules.Oracle
-import Development.Shake.Rules.OrderOnly
-import Development.Shake.Rules.Rerun
+import Development.Shake.Internal.FilePattern
+import Development.Shake.Internal.Rules.Directory
+import Development.Shake.Internal.Rules.File
+import Development.Shake.Internal.Rules.Files
+import Development.Shake.Internal.Rules.Oracle
+import Development.Shake.Internal.Rules.OrderOnly
+import Development.Shake.Internal.Rules.Rerun
 
+-- $writing
+--
+--   When writing a Shake build system, start by defining what you 'want', then write rules
+--   with '%>' to produce the results. Before calling 'cmd' you should ensure that any files the command
+--   requires are demanded with calls to 'need'. We offer the following advice to Shake users:
+--
+-- * If @ghc --make@ or @cabal@ is capable of building your project, use that instead. Custom build systems are
+--   necessary for many complex projects, but many projects are not complex.
+--
+-- * The 'shakeArgs' function automatically handles command line arguments. To define non-file targets use 'phony'.
+--
+-- * Put all result files in a distinguished directory, for example @_make@. You can implement a @clean@
+--   command by removing that directory, using @'removeFilesAfter' \"_make\" [\"\/\/\*\"]@.
+--
+-- * To obtain parallel builds set 'shakeThreads' to a number greater than 1.
+--
+-- * Lots of compilers produce @.o@ files. To avoid overlapping rules, use @.c.o@ for C compilers,
+--   @.hs.o@ for Haskell compilers etc.
+--
+-- * Do not be afraid to mix Shake rules, system commands and other Haskell libraries -- use each for what
+--   it does best.
+--
+-- * The more accurate the dependencies are, the better. Use additional rules like 'doesFileExist' and
+--   'getDirectoryFiles' to track information other than just the contents of files. For information in the environment
+--   that you suspect will change regularly (perhaps @ghc@ version number), either write the information to
+--   a file with 'alwaysRerun' and 'writeFileChanged', or use 'addOracle'.
 
----------------------------------------------------------------------
--- DEPRECATED SINCE 0.13, MAY 2014
+-- $flags
+--
+--   For large build systems the choice of GHC flags can have a significant impact. We recommend:
+--
+-- > ghc --make MyBuildSystem -threaded -rtsopts "-with-rtsopts=-I0 -qg"
+--
+--   * @-rtsopts@: Allow the setting of further GHC options at runtime.
+--
+--   * @-I0@: Disable idle garbage collection, to avoid frequent unnecessary garbage collection, see
+--     <https://stackoverflow.com/questions/34588057/why-does-shake-recommend-disabling-idle-garbage-collection/ a full explanation>.
+--
+--   * You may add @-threaded@, and pass the options @-qg@ to @-with-rtsopts@
+--     to disable parallel garbage collection. Parallel garbage collection in Shake
+--     programs typically goes slower than sequential garbage collection, while occupying many cores that
+--     could be used for running system commands.
 
-infix 1 **>, ?>>, *>>
+-- $modules
+--
+--   The main Shake module is this one, "Development.Shake", which should be sufficient for most
+--   people writing build systems using Shake. However, Shake provides some additional modules,
+--
+-- * "Development.Shake.Classes" provides convenience exports of the classes Shake relies on,
+--   in particular 'Binary', 'Hashable' and 'NFData'. Useful for deriving these types using
+--   @GeneralizedNewtypeDeriving@ without adding dependencies on the associated packages.
+--
+-- * "Development.Shake.Command" provides the command line wrappers. These are reexported by
+--   "Development.Shake", but if you want to reuse just the command-line running functionality
+--   in a non-Shake program you can import just that.
+--
+-- * "Development.Shake.Config" provides a way to write configuration files that are tracked.
+--   The configuration files are in the Ninja format. Useful for users of bigger systems who
+--   want to track the build rules not in Haskell.
+--
+-- * "Development.Shake.Database" provides lower level primitives to drive Shake, particularly
+--   useful if you want to run multiple Shake runs in a row without reloading from the database.
+--
+-- * "Development.Shake.FilePath" is an extension of "System.FilePath" with a few additional
+--   methods and safer extension manipulation code.
+--
+-- * "Development.Shake.Forward" is an alternative take on build systems, where you write the
+--   rules as a script where steps are skipped, rather than as a set of dependencies. Only really
+--   works if you use @fsatrace@.
+--
+-- * "Development.Shake.Rule" provides tools for writing your own types of Shake rules. Useful
+--   if you need something new, like a rule that queries a database or similar.
+--
+-- * "Development.Shake.Util" has general utilities that are useful for build systems, e.g.
+--   reading @Makefile@ syntax and alternative forms of argument parsing.
 
--- | /Deprecated:/ Alias for '|%>'.
-(**>) :: [FilePattern] -> (FilePath -> Action ()) -> Rules ()
-(**>) = (|%>)
 
--- | /Deprecated:/ Alias for '&?>'.
-(?>>) :: (FilePath -> Maybe [FilePath]) -> ([FilePath] -> Action ()) -> Rules ()
-(?>>) = (&?>)
-
--- | /Deprecated:/ Alias for '&%>'.
-(*>>) :: [FilePattern] -> ([FilePath] -> Action ()) -> Rules ()
-(*>>) = (&%>)
+---------------------------------------------------------------------
+-- DEPRECATED SINCE 0.16.1, NOV 2017
 
+-- | /Deprecated:/ Replace @'askOracleWith' q a@ by @'askOracle' q@
+--   since the 'RuleResult' type family now fixes the result type.
+{-# DEPRECATED askOracleWith "Use 'askOracle q' instead of 'askOracleWith q a', the result value is now unnecessary" #-}
+askOracleWith :: (RuleResult q ~ a, ShakeValue q, ShakeValue a) => q -> a -> Action a
+askOracleWith question _ = askOracle question
 
 ---------------------------------------------------------------------
--- DEPRECATED SINCE 0.14, MAY 2014
-
-infix 1 *>, |*>, &*>
+-- DEPRECATED SINCE 0.18.4, JUL 2019
 
--- | /Deprecated:/ Alias for '%>'. Note that @*>@ clashes with a Prelude operator in GHC 7.10.
-(*>) :: FilePattern -> (FilePath -> Action ()) -> Rules ()
-(*>) = (%>)
+-- | /Deprecated:/ Alias for 'reschedule'.
+{-# DEPRECATED deprioritize "Use 'reschedule' instead" #-}
+deprioritize :: Double -> Action ()
+deprioritize = reschedule
 
--- | /Deprecated:/ Alias for '|%>'.
-(|*>) :: [FilePattern] -> (FilePath -> Action ()) -> Rules ()
-(|*>) = (|%>)
+-- | /Deprecated:/ A bidirectional pattern synonym for 'Error'.
+pattern Quiet :: Verbosity
+pattern Quiet  = Error
+-- | /Deprecated:/ A bidirectional pattern synonym for 'Info'.
+pattern Normal :: Verbosity
+pattern Normal = Info
+-- | /Deprecated:/ A bidirectional pattern synonym for 'Verbose'.
+pattern Loud :: Verbosity
+pattern Loud   = Verbose
+-- | /Deprecated:/ A bidirectional pattern synonym for 'Verbose'.
+pattern Chatty :: Verbosity
+pattern Chatty = Verbose
 
--- | /Deprecated:/ Alias for '&%>'.
-(&*>) :: [FilePattern] -> ([FilePath] -> Action ()) -> Rules ()
-(&*>) = (&%>)
+putLoud, putNormal, putQuiet :: String -> Action ()
+-- | /Deprecated:/ Alias for 'putVerbose'.
+putLoud = putVerbose
+-- | /Deprecated:/ Alias for 'putInfo'.
+putNormal = putInfo
+-- | /Deprecated:/ Alias for 'putError'.
+putQuiet = putError
diff --git a/src/Development/Shake/Args.hs b/src/Development/Shake/Args.hs
deleted file mode 100644
--- a/src/Development/Shake/Args.hs
+++ /dev/null
@@ -1,350 +0,0 @@
-
--- | Command line parsing flags.
-module Development.Shake.Args(shakeOptDescrs, shakeArgs, shakeArgsWith) where
-
-import Paths_shake
-import Development.Shake.Types
-import Development.Shake.Core
-import Development.Shake.Demo
-import Development.Shake.FilePath
-import Development.Shake.Rules.File
-import Development.Shake.Progress
-import Development.Shake.Shake
-import General.Timing
-
-import Data.Tuple.Extra
-import Control.Concurrent
-import Control.Exception.Extra
-import Control.Monad
-import Data.Char
-import Data.Either
-import Data.List
-import Data.Maybe
-import Data.Time
-import Data.Version(showVersion)
-import System.Console.GetOpt
-import System.Directory
-import System.Environment
-import System.Exit
-import System.Time.Extra
-
-
--- | Run a build system using command line arguments for configuration.
---   The available flags are those from 'shakeOptDescrs', along with a few additional
---   @make@ compatible flags that are not represented in 'ShakeOptions', such as @--print-directory@.
---   If there are no file arguments then the 'Rules' are used directly, otherwise the file arguments
---   are 'want'ed (after calling 'withoutActions'). As an example:
---
--- @
--- main = 'shakeArgs' 'shakeOptions'{'shakeFiles' = \"_make\", 'shakeProgress' = 'progressSimple'} $ do
---     'phony' \"clean\" $ 'Development.Shake.removeFilesAfter' \"_make\" [\"\/\/*\"]
---     'want' [\"_make\/neil.txt\",\"_make\/emily.txt\"]
---     \"_make\/*.txt\" '%>' \\out ->
---         ... build action here ...
--- @
---
---   This build system will default to building @neil.txt@ and @emily.txt@, while showing progress messages,
---   and putting the Shake files in locations such as @_make\/.database@. Some example command line flags:
---
--- * @main --no-progress@ will turn off progress messages.
---
--- * @main -j6@ will build on 6 threads.
---
--- * @main --help@ will display a list of supported flags.
---
--- * @main clean@ will not build anything, but will remove the @_make@ directory, including the
---   any 'shakeFiles'.
---
--- * @main _make/henry.txt@ will not build @neil.txt@ or @emily.txt@, but will instead build @henry.txt@.
-shakeArgs :: ShakeOptions -> Rules () -> IO ()
-shakeArgs opts rules = shakeArgsWith opts [] f
-    where f _ files = return $ Just $ if null files then rules else want files >> withoutActions rules
-
-
--- | A version of 'shakeArgs' with more flexible handling of command line arguments.
---   The caller of 'shakeArgsWith' can add additional flags (the second argument) and chose how to convert
---   the flags/arguments into rules (the third argument). Given:
---
--- @
--- 'shakeArgsWith' opts flags (\\flagValues argValues -> result)
--- @
---
--- * @opts@ is the initial 'ShakeOptions' value, which may have some fields overriden by command line flags.
---   This argument is usually 'shakeOptions', perhaps with a few fields overriden.
---
--- * @flags@ is a list of flag descriptions, which either produce a 'String' containing an error
---   message (typically for flags with invalid arguments, .e.g. @'Left' \"could not parse as int\"@), or a value
---   that is passed as @flagValues@. If you have no custom flags, pass @[]@.
---
--- * @flagValues@ is a list of custom flags that the user supplied. If @flags == []@ then this list will
---   be @[]@.
---
--- * @argValues@ is a list of non-flag arguments, which are often treated as files and passed to 'want'.
---
--- * @result@ should produce a 'Nothing' to indicate that no building needs to take place, or a 'Just'
---   providing the rules that should be used.
---
---   As an example of a build system that can use either @gcc@ or @distcc@ for compiling:
---
--- @
--- import System.Console.GetOpt
---
--- data Flags = DistCC deriving Eq
--- flags = [Option \"\" [\"distcc\"] (NoArg $ Right DistCC) \"Run distributed.\"]
---
--- main = 'shakeArgsWith' 'shakeOptions' flags $ \\flags targets -> return $ Just $ do
---     if null targets then 'want' [\"result.exe\"] else 'want' targets
---     let compiler = if DistCC \`elem\` flags then \"distcc\" else \"gcc\"
---     \"*.o\" '%>' \\out -> do
---         'need' ...
---         'cmd' compiler ...
---     ...
--- @
---
---   Now you can pass @--distcc@ to use the @distcc@ compiler.
-shakeArgsWith :: ShakeOptions -> [OptDescr (Either String a)] -> ([a] -> [String] -> IO (Maybe (Rules ()))) -> IO ()
-shakeArgsWith baseOpts userOptions rules = do
-    addTiming "shakeArgsWith"
-    args <- getArgs
-    let (flags,files,errs) = getOpt Permute opts args
-        (flagsError,flag1) = partitionEithers flags
-        (self,user) = partitionEithers flag1
-        (flagsExtra,flagsShake) = first concat $ unzip self
-        assumeNew = [x | AssumeNew x <- flagsExtra]
-        assumeOld = [x | AssumeOld x <- flagsExtra]
-        progressReplays = [x | ProgressReplay x <- flagsExtra]
-        progressRecords = [x | ProgressRecord x <- flagsExtra]
-        changeDirectory = listToMaybe [x | ChangeDirectory x <- flagsExtra]
-        printDirectory = last $ False : [x | PrintDirectory x <- flagsExtra]
-        oshakeOpts = foldl' (flip ($)) baseOpts flagsShake
-        shakeOpts = oshakeOpts {shakeLintInside = map (toStandard . normalise . addTrailingPathSeparator) $
-                                                  shakeLintInside oshakeOpts
-                               ,shakeLintIgnore = map toStandard $
-                                                  shakeLintIgnore oshakeOpts
-                               }
-
-    -- error if you pass some clean and some dirty with specific flags
-    errs <- return $ errs ++ flagsError ++ ["cannot mix " ++ a ++ " and " ++ b | a:b:_ <-
-        [["`--assume-new'" | assumeNew/=[] ] ++ ["`--assume-old'" | assumeOld/=[] ] ++ ["explicit targets" | files/=[]]]]
-
-    when (errs /= []) $ do
-        putStr $ unlines $ map ("shake: " ++) $ filter (not . null) $ lines $ unlines errs
-        showHelp
-        exitFailure
-
-    if Help `elem` flagsExtra then
-        showHelp
-     else if Version `elem` flagsExtra then
-        putStrLn $ "Shake build system, version " ++ showVersion version
-     else if NumericVersion `elem` flagsExtra then
-        putStrLn $ showVersion version
-     else if Demo `elem` flagsExtra then
-        demo $ shakeStaunch shakeOpts
-     else if not $ null progressReplays then do
-        dat <- forM progressReplays $ \file -> do
-            src <- readFile file
-            return (file, map read $ lines src)
-        forM_ (if null $ shakeReport shakeOpts then ["-"] else shakeReport shakeOpts) $ \file -> do
-            putStrLn $ "Writing report to " ++ file
-            writeProgressReport file dat
-     else do
-        when (Sleep `elem` flagsExtra) $ threadDelay 1000000
-        start <- getCurrentTime
-        curdir <- getCurrentDirectory
-        let redir = case changeDirectory of
-                Nothing -> id
-                -- get the "html" directory so it caches with the current directory
-                -- required only for debug code
-                Just d -> bracket_ (getDataFileName "html" >> setCurrentDirectory d) (setCurrentDirectory curdir)
-        shakeOpts <- if null progressRecords then return shakeOpts else do
-            t <- offsetTime
-            return shakeOpts{shakeProgress = \p ->
-                bracket
-                    (forkIO $ shakeProgress shakeOpts p)
-                    killThread
-                    $ const $ progressDisplay 1 (const $ return ()) $ do
-                        p <- p
-                        t <- t
-                        forM_ progressRecords $ \file ->
-                            appendFile file $ show (t,p) ++ "\n"
-                        return p
-            }
-        (ran,res) <- redir $ do
-            when printDirectory $ putStrLn $ "shake: In directory `" ++ curdir ++ "'"
-            rules <- rules user files
-            case rules of
-                Nothing -> return (False,Right ())
-                Just rules -> do
-                    res <- try_ $ shake shakeOpts $
-                        if NoBuild `elem` flagsExtra then withoutActions rules else rules
-                    return (True, res)
-
-        if not ran || shakeVerbosity shakeOpts < Normal || NoTime `elem` flagsExtra then
-            either throwIO return res
-         else
-            let esc code = if Color `elem` flagsExtra then escape code else id
-            in case res of
-                Left err ->
-                    if Exception `elem` flagsExtra then
-                        throwIO err
-                    else do
-                        putStrLn $ esc "31" $ show err
-                        exitFailure
-                Right () -> do
-                    stop <- getCurrentTime
-                    let tot = diffUTCTime stop start
-                        (mins,secs) = divMod (ceiling tot) (60 :: Int)
-                        time = show mins ++ ":" ++ ['0' | secs < 10] ++ show secs
-                    putStrLn $ esc "32" $ "Build completed in " ++ time ++ "m"
-    where
-        opts = map (wrap Left . snd) shakeOptsEx ++ map (wrap Right) userOptions
-        showHelp = do
-            progName <- getProgName
-            putStr $ unlines $ ("Usage: " ++ progName ++ " [options] [target] ...") : "Options:" : showOptDescr opts
-
-        wrap :: (a -> b) -> OptDescr (Either String a) -> OptDescr (Either String b)
-        wrap = fmapOptDescr . fmap
-
-
-showOptDescr :: [OptDescr a] -> [String]
-showOptDescr xs = concat
-    [ if nargs <= 26 then ["  " ++ args ++ replicate (28 - nargs) ' ' ++ desc]
-                     else ["  " ++ args, replicate 30 ' ' ++ desc]
-    | Option s l arg desc <- xs
-    , let args = intercalate ", " $ map (short arg) s ++ map (long arg) l
-    , let nargs = length args]
-    where short NoArg{} x = "-" ++ [x]
-          short (ReqArg _ b) x = "-" ++ [x] ++ " " ++ b
-          short (OptArg _ b) x = "-" ++ [x] ++ "[=" ++ b ++ "]"
-          long NoArg{} x = "--" ++ x
-          long (ReqArg _ b) x = "--" ++ x ++ "=" ++ b
-          long (OptArg _ b) x = "--" ++ x ++ "[=" ++ b ++ "]"
-
-
-fmapOptDescr :: (a -> b) -> OptDescr a -> OptDescr b
-fmapOptDescr f (Option a b c d) = Option a b (g c) d
-    where g (NoArg a) = NoArg $ f a
-          g (ReqArg a b) = ReqArg (f . a) b
-          g (OptArg a b) = OptArg (f . a) b
-
-
--- | A list of command line options that can be used to modify 'ShakeOptions'. Each option returns
---   either an error message (invalid argument to the flag) or a function that changes some fields
---   in 'ShakeOptions'. The command line flags are @make@ compatible where possbile, but additional
---   flags have been added for the extra options Shake supports.
-shakeOptDescrs :: [OptDescr (Either String (ShakeOptions -> ShakeOptions))]
-shakeOptDescrs = [fmapOptDescr (fmap snd) o | (True, o) <- shakeOptsEx]
-
-data Extra = ChangeDirectory FilePath
-           | Version
-           | NumericVersion
-           | AssumeNew FilePath
-           | AssumeOld FilePath
-           | PrintDirectory Bool
-           | Color
-           | Help
-           | Sleep
-           | NoTime
-           | Exception
-           | NoBuild
-           | ProgressRecord FilePath
-           | ProgressReplay FilePath
-           | Demo
-             deriving Eq
-
-
-unescape :: String -> String
-unescape ('\ESC':'[':xs) = unescape $ drop 1 $ dropWhile (not . isAlpha) xs
-unescape (x:xs) = x : unescape xs
-unescape [] = []
-
-escape :: String -> String -> String
-escape code x = "\ESC[" ++ code ++ "m" ++ x ++ "\ESC[0m"
-
-
--- | True if it has a potential effect on ShakeOptions
-shakeOptsEx :: [(Bool, OptDescr (Either String ([Extra], ShakeOptions -> ShakeOptions)))]
-shakeOptsEx =
-    [yes $ Option "a" ["abbrev"] (pairArg "abbrev" "FULL=SHORT" $ \a s -> s{shakeAbbreviations=shakeAbbreviations s ++ [a]}) "Use abbreviation in status messages."
-    ,yes $ Option "B" ["always-make"] (noArg $ \s -> s{shakeAssume=Just AssumeDirty}) "Unconditionally make all targets."
-    ,no  $ Option ""  ["no-build"] (NoArg $ Right ([NoBuild], id)) "Don't build anything."
-    ,no  $ Option "C" ["directory"] (ReqArg (\x -> Right ([ChangeDirectory x],id)) "DIRECTORY") "Change to DIRECTORY before doing anything."
-    ,yes $ Option ""  ["color","colour"] (NoArg $ Right ([Color], \s -> s{shakeOutput=outputColor (shakeOutput s)})) "Colorize the output."
-    ,yes $ Option "d" ["debug"] (OptArg (\x -> Right ([], \s -> s{shakeVerbosity=Diagnostic, shakeOutput=outputDebug (shakeOutput s) x})) "FILE") "Print lots of debugging information."
-    ,no  $ Option ""  ["demo"] (NoArg $ Right ([Demo], id)) "Run in demo mode."
-    ,yes $ Option ""  ["digest"] (NoArg $ Right ([], \s -> s{shakeChange=ChangeDigest})) "Files change when digest changes."
-    ,yes $ Option ""  ["digest-and"] (NoArg $ Right ([], \s -> s{shakeChange=ChangeModtimeAndDigest})) "Files change when modtime and digest change."
-    ,yes $ Option ""  ["digest-and-input"] (NoArg $ Right ([], \s -> s{shakeChange=ChangeModtimeAndDigestInput})) "Files change on modtime (and digest for inputs)."
-    ,yes $ Option ""  ["digest-or"] (NoArg $ Right ([], \s -> s{shakeChange=ChangeModtimeOrDigest})) "Files change when modtime or digest change."
-    ,yes $ Option ""  ["digest-not"] (NoArg $ Right ([], \s -> s{shakeChange=ChangeModtime})) "Files change when modtime changes."
-    ,no  $ Option ""  ["exception"] (NoArg $ Right ([Exception], id)) "Throw exceptions directly."
-    ,yes $ Option ""  ["flush"] (intArg 1 "flush" "N" (\i s -> s{shakeFlush=Just i})) "Flush metadata every N seconds."
-    ,yes $ Option ""  ["never-flush"] (noArg $ \s -> s{shakeFlush=Nothing}) "Never explicitly flush metadata."
-    ,no  $ Option "h" ["help"] (NoArg $ Right ([Help],id)) "Print this message and exit."
-    ,yes $ Option "j" ["jobs"] (optIntArg 0 "jobs" "N" $ \i s -> s{shakeThreads=fromMaybe 0 i}) "Allow N jobs/threads at once [default CPUs]."
-    ,yes $ Option "k" ["keep-going"] (noArg $ \s -> s{shakeStaunch=True}) "Keep going when some targets can't be made."
-    ,yes $ Option "l" ["lint"] (noArg $ \s -> s{shakeLint=Just LintBasic}) "Perform limited validation after the run."
-    ,yes $ Option ""  ["lint-fsatrace"] (noArg $ \s -> s{shakeLint=Just LintFSATrace}) "Use fsatrace to do validation."
-    ,yes $ Option ""  ["no-lint"] (noArg $ \s -> s{shakeLint=Nothing}) "Turn off --lint."
-    ,yes $ Option ""  ["live"] (OptArg (\x -> Right ([], \s -> s{shakeLiveFiles=shakeLiveFiles s ++ [fromMaybe "live.txt" x]})) "FILE") "List the files that are live [to live.txt]."
-    ,yes $ Option "m" ["metadata"] (reqArg "PREFIX" $ \x s -> s{shakeFiles=x}) "Prefix for storing metadata files."
-    ,no  $ Option ""  ["numeric-version"] (NoArg $ Right ([NumericVersion],id)) "Print just the version number and exit."
-    ,no  $ Option "o" ["old-file","assume-old"] (ReqArg (\x -> Right ([AssumeOld x],id)) "FILE") "Consider FILE to be very old and don't remake it."
-    ,yes $ Option ""  ["old-all"] (noArg $ \s -> s{shakeAssume=Just AssumeClean}) "Don't remake any files."
-    ,yes $ Option ""  ["assume-skip"] (noArg $ \s -> s{shakeAssume=Just AssumeSkip}) "Don't remake any files this run."
-    ,yes $ Option ""  ["skip-commands"] (noArg $ \s -> s{shakeRunCommands=False}) "Try and avoid running external programs."
-    ,yes $ Option "r" ["report","profile"] (OptArg (\x -> Right ([], \s -> s{shakeReport=shakeReport s ++ [fromMaybe "report.html" x]})) "FILE") "Write out profiling information [to report.html]."
-    ,yes $ Option ""  ["no-reports"] (noArg $ \s -> s{shakeReport=[]}) "Turn off --report."
-    ,yes $ Option ""  ["rule-version"] (reqArg "VERSION" $ \x s -> s{shakeVersion=x}) "Version of the build rules."
-    ,yes $ Option ""  ["no-rule-version"] (noArg $ \s -> s{shakeVersionIgnore=True}) "Ignore the build rules version."
-    ,yes $ Option "s" ["silent"] (noArg $ \s -> s{shakeVerbosity=Silent}) "Don't print anything."
-    ,no  $ Option ""  ["sleep"] (NoArg $ Right ([Sleep],id)) "Sleep for a second before building."
-    ,yes $ Option "S" ["no-keep-going","stop"] (noArg $ \s -> s{shakeStaunch=False}) "Turns off -k."
-    ,yes $ Option ""  ["storage"] (noArg $ \s -> s{shakeStorageLog=True}) "Write a storage log."
-    ,yes $ Option "p" ["progress"] (progress $ optIntArg 1 "progress" "N" $ \i s -> s{shakeProgress=prog $ fromMaybe 5 i}) "Show progress messages [every N secs, default 5]."
-    ,yes $ Option ""  ["no-progress"] (noArg $ \s -> s{shakeProgress=const $ return ()}) "Don't show progress messages."
-    ,yes $ Option "q" ["quiet"] (noArg $ \s -> s{shakeVerbosity=move (shakeVerbosity s) pred}) "Don't print much."
-    ,no  $ Option ""  ["no-time"] (NoArg $ Right ([NoTime],id)) "Don't print build time."
-    ,yes $ Option ""  ["timings"] (noArg $ \s -> s{shakeTimings=True}) "Print phase timings."
-    ,yes $ Option ""  ["touch"] (noArg $ \s -> s{shakeAssume=Just AssumeClean}) "Assume targets are clean."
-    ,yes $ Option "V" ["verbose","trace"] (noArg $ \s -> s{shakeVerbosity=move (shakeVerbosity s) succ}) "Print tracing information."
-    ,no  $ Option "v" ["version"] (NoArg $ Right ([Version],id)) "Print the version number and exit."
-    ,no  $ Option "w" ["print-directory"] (NoArg $ Right ([PrintDirectory True],id)) "Print the current directory."
-    ,no  $ Option ""  ["no-print-directory"] (NoArg $ Right ([PrintDirectory False],id)) "Turn off -w, even if it was turned on implicitly."
-    ,no  $ Option "W" ["what-if","new-file","assume-new"] (ReqArg (\x -> Right ([AssumeNew x],id)) "FILE") "Consider FILE to be infinitely new."
-    ]
-    where
-        yes = (,) True
-        no  = (,) False
-
-        move :: Verbosity -> (Int -> Int) -> Verbosity
-        move x by = toEnum $ min (fromEnum mx) $ max (fromEnum mn) $ by $ fromEnum x
-            where (mn,mx) = (asTypeOf minBound x, asTypeOf maxBound x)
-
-        noArg f = NoArg $ Right ([], f)
-        reqArg a f = ReqArg (\x -> Right ([], f x)) a
-        intArg mn flag a f = flip ReqArg a $ \x -> case reads x of
-            [(i,"")] | i >= mn -> Right ([],f i)
-            _ -> Left $ "the `--" ++ flag ++ "' option requires a number, " ++ show mn ++ " or above"
-        optIntArg mn flag a f = flip OptArg a $ maybe (Right ([], f Nothing)) $ \x -> case reads x of
-            [(i,"")] | i >= mn -> Right ([],f $ Just i)
-            _ -> Left $ "the `--" ++ flag ++ "' option requires a number, " ++ show mn ++ " or above"
-        pairArg flag a f = flip ReqArg a $ \x -> case break (== '=') x of
-            (a,'=':b) -> Right ([],f (a,b))
-            _ -> Left $ "the `--" ++ flag ++ "' option requires an = in the argument"
-
-        progress (OptArg func msg) = flip OptArg msg $ \x -> case break (== '=') `fmap` x of
-            Just ("record",file) -> Right ([ProgressRecord $ if null file then "progress.txt" else tail file], id)
-            Just ("replay",file) -> Right ([ProgressReplay $ if null file then "progress.txt" else tail file], id)
-            _ -> func x
-
-        outputDebug output Nothing = output
-        outputDebug output (Just file) = \v msg -> do
-            when (v /= Diagnostic) $ output v msg
-            appendFile file $ unescape msg ++ "\n"
-
-        outputColor output v msg = output v $ escape "34" msg
-
-        prog i p = do
-            program <- progressProgram
-            progressDisplay i (\s -> progressTitlebar s >> program s) p
diff --git a/src/Development/Shake/ByteString.hs b/src/Development/Shake/ByteString.hs
deleted file mode 100644
--- a/src/Development/Shake/ByteString.hs
+++ /dev/null
@@ -1,76 +0,0 @@
-
-module Development.Shake.ByteString(parseMakefile, filepathNormalise, linesCR) where
-
-import qualified Data.ByteString.Char8 as BS
-import qualified System.FilePath as Native
-import System.Info.Extra
-import Data.Char
-import Data.List
-
-
-endsSlash :: BS.ByteString -> Bool
-endsSlash = BS.isSuffixOf (BS.singleton '\\')
-
-wordsMakefile :: BS.ByteString -> [BS.ByteString]
-wordsMakefile = f . BS.splitWith isSpace
-    where
-        f (x:xs) | BS.null x = f xs
-        f (x:y:xs) | endsSlash x = f $ BS.concat [BS.init x, BS.singleton ' ', y] : xs
-        f (x:xs) = x : f xs
-        f [] = []
-
-parseMakefile :: BS.ByteString -> [(BS.ByteString, [BS.ByteString])]
-parseMakefile = concatMap f . join . linesCR
-    where
-        join xs = case span endsSlash xs of
-            ([], []) -> []
-            (xs, []) -> [BS.unwords $ map BS.init xs]
-            ([], y:ys) -> y : join ys
-            (xs, y:ys) -> BS.unwords (map BS.init xs ++ [y]) : join ys
-
-        f x = [(a, wordsMakefile $ BS.drop 1 b) | a <- wordsMakefile a]
-            where (a,b) = BS.break (== ':') $ BS.takeWhile (/= '#') x
-
-
--- | This is a hot-spot, so optimised
-linesCR :: BS.ByteString -> [BS.ByteString]
-linesCR x = case BS.split '\n' x of
-    x:xs | Just ('\r',x) <- unsnoc x -> x : map (\x -> case unsnoc x of Just ('\r',x) -> x; _ -> x) xs
-    xs -> xs
-    where
-        -- the ByteString unsnoc was introduced in a newer version
-        unsnoc x | BS.null x = Nothing
-                 | otherwise = Just (BS.last x, BS.init x)
-
-
--- | Equivalent to @toStandard . normaliseEx@ from "Development.Shake.FilePath".
-filepathNormalise :: BS.ByteString -> BS.ByteString
-filepathNormalise xs
-    | isWindows, Just (a,xs) <- BS.uncons xs, sep a, Just (b,_) <- BS.uncons xs, sep b = '/' `BS.cons` f xs
-    | otherwise = f xs
-    where
-        sep = Native.isPathSeparator
-        f o = deslash o $ BS.concat $ (slash:) $ intersperse slash $ reverse $ (BS.empty:) $ g 0 $ reverse $ split o
-
-        deslash o x
-            | x == slash = case (pre,pos) of
-                (True,True) -> slash
-                (True,False) -> BS.pack "/."
-                (False,True) -> BS.pack "./"
-                (False,False) -> dot
-            | otherwise = (if pre then id else BS.tail) $ (if pos then id else BS.init) x
-            where pre = not (BS.null o) && sep (BS.head o)
-                  pos = not (BS.null o) && sep (BS.last o)
-
-        g i [] = replicate i dotDot
-        g i (x:xs) | BS.null x = g i xs
-        g i (x:xs) | x == dotDot = g (i+1) xs
-        g i (x:xs) | x == dot = g i xs
-        g 0 (x:xs) = x : g 0 xs
-        g i (x:xs) = g (i-1) xs
-
-        split = BS.splitWith sep
-
-dotDot = BS.pack ".."
-dot = BS.singleton '.'
-slash = BS.singleton '/'
diff --git a/src/Development/Shake/Classes.hs b/src/Development/Shake/Classes.hs
--- a/src/Development/Shake/Classes.hs
+++ b/src/Development/Shake/Classes.hs
@@ -1,8 +1,8 @@
 
--- | This module reexports the six necessary type classes that every 'Rule' type must support.
+-- | This module reexports the six necessary type classes that many rule types must support through 'ShakeValue'.
 --   You can use this module to define new rules without depending on the @binary@, @deepseq@ and @hashable@ packages.
 module Development.Shake.Classes(
-    Show(..), Typeable(..), Eq(..), Hashable(..), Binary(..), NFData(..)
+    Show(..), Typeable, Eq(..), Hashable(..), Binary(..), NFData(..)
     ) where
 
 -- I would probably reexport this module by default in Development.Shake,
diff --git a/src/Development/Shake/CmdOption.hs b/src/Development/Shake/CmdOption.hs
deleted file mode 100644
--- a/src/Development/Shake/CmdOption.hs
+++ /dev/null
@@ -1,28 +0,0 @@
-{-# LANGUAGE DeriveDataTypeable #-}
-module Development.Shake.CmdOption where
-
-import Data.Data
-import qualified Data.ByteString.Lazy.Char8 as LBS
-
--- | Options passed to 'command' or 'cmd' to control how processes are executed.
-data CmdOption
-    = Cwd FilePath -- ^ Change the current directory in the spawned process. By default uses this processes current directory.
-    | Env [(String,String)] -- ^ Change the environment variables in the spawned process. By default uses this processes environment.
-    | AddEnv String String -- ^ Add an environment variable in the child process.
-    | RemEnv String -- ^ Remove an environment variable from the child process.
-    | AddPath [String] [String] -- ^ Add some items to the prefix and suffix of the @$PATH@ variable.
-    | Stdin String -- ^ Given as the @stdin@ of the spawned process. By default the @stdin@ is inherited.
-    | StdinBS LBS.ByteString -- ^ Given as the @stdin@ of the spawned process.
-    | FileStdin FilePath -- ^ Take the @stdin@ from a file.
-    | Shell -- ^ Pass the command to the shell without escaping - any arguments will be joined with spaces. By default arguments are escaped properly.
-    | BinaryPipes -- ^ Treat the @stdin@\/@stdout@\/@stderr@ messages as binary. By default 'String' results use text encoding and 'ByteString' results use binary encoding.
-    | Traced String -- ^ Name to use with 'traced', or @\"\"@ for no tracing. By default traces using the name of the executable.
-    | Timeout Double -- ^ Abort the computation after N seconds, will raise a failure exit code. Calls 'interruptProcessGroupOf' and 'terminateProcess', but may sometimes fail to abort the process and not timeout.
-    | WithStdout Bool -- ^ Should I include the @stdout@ in the exception if the command fails? Defaults to 'False'.
-    | WithStderr Bool -- ^ Should I include the @stderr@ in the exception if the command fails? Defaults to 'True'.
-    | EchoStdout Bool -- ^ Should I echo the @stdout@? Defaults to 'True' unless a 'Stdout' result is required or you use 'FileStdout'.
-    | EchoStderr Bool -- ^ Should I echo the @stderr@? Defaults to 'True' unless a 'Stderr' result is required or you use 'FileStderr'.
-    | FileStdout FilePath -- ^ Should I put the @stdout@ to a file.
-    | FileStderr FilePath -- ^ Should I put the @stderr@ to a file.
-    | AutoDeps -- ^ Compute dependencies automatically.
-      deriving (Eq,Ord,Show,Data,Typeable)
diff --git a/src/Development/Shake/Command.hs b/src/Development/Shake/Command.hs
--- a/src/Development/Shake/Command.hs
+++ b/src/Development/Shake/Command.hs
@@ -1,5 +1,9 @@
-{-# LANGUAGE FlexibleInstances, TypeSynonymInstances, TypeOperators, ScopedTypeVariables, NamedFieldPuns #-}
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE FlexibleInstances, TypeOperators, ScopedTypeVariables, NamedFieldPuns #-}
+{-# LANGUAGE GADTs, GeneralizedNewtypeDeriving, DeriveDataTypeable, RecordWildCards #-}
 
+
 -- | This module provides functions for calling command line programs, primarily
 --   'command' and 'cmd'. As a simple example:
 --
@@ -10,41 +14,48 @@
 --   The functions from this module are now available directly from "Development.Shake".
 --   You should only need to import this module if you are using the 'cmd' function in the 'IO' monad.
 module Development.Shake.Command(
-    command, command_, cmd, unit, CmdArguments, (:->),
-    Stdout(..), Stderr(..), Stdouterr(..), Exit(..), Process(..), CmdTime(..), CmdLine(..),
+    command, command_, cmd, cmd_, unit, CmdArgument(..), CmdArguments(..), IsCmdArgument(..), (:->),
+    Stdout(..), StdoutTrim(..), Stderr(..), Stdouterr(..), Exit(..), Process(..), CmdTime(..), CmdLine(..), FSATrace(..),
     CmdResult, CmdString, CmdOption(..),
     addPath, addEnv,
     ) where
 
 import Data.Tuple.Extra
-import Control.Exception.Extra
 import Control.Monad.Extra
 import Control.Monad.IO.Class
+import Control.Exception.Extra
 import Data.Char
 import Data.Either.Extra
+import Data.Foldable (toList)
 import Data.List.Extra
+import Data.List.NonEmpty (NonEmpty)
+import qualified Data.HashSet as Set
 import Data.Maybe
+import Data.Data
+import Data.Semigroup
 import System.Directory
-import System.Environment.Extra
+import qualified System.IO.Extra as IO
+import System.Environment
 import System.Exit
 import System.IO.Extra hiding (withTempFile, withTempDir)
 import System.Process
 import System.Info.Extra
 import System.Time.Extra
-import System.IO.Unsafe(unsafeInterleaveIO)
-import qualified Data.ByteString as BS
+import System.IO.Unsafe (unsafeInterleaveIO)
+import qualified Data.ByteString.Char8 as BS
 import qualified Data.ByteString.Lazy.Char8 as LBS
+import qualified Data.ByteString.UTF8 as UTF8
+import General.Extra
 import General.Process
-import Control.Applicative
 import Prelude
 
-import Development.Shake.CmdOption
-import Development.Shake.Core
+import Development.Shake.Internal.CmdOption
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.Core.Types hiding (Result)
 import Development.Shake.FilePath
-import Development.Shake.FilePattern
-import Development.Shake.Types
-import Development.Shake.Rules.File
-import Development.Shake.Derived
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Rules.File
+import Development.Shake.Internal.Derived
 
 ---------------------------------------------------------------------
 -- ACTUAL EXECUTION
@@ -64,7 +75,7 @@
 addPath pre post = do
     args <- liftIO getEnvironment
     let (path,other) = partition ((== "PATH") . (if isWindows then upper else id) . fst) args
-    return $ Env $
+    pure $ Env $
         [("PATH",intercalate [searchPathSeparator] $ pre ++ post) | null path] ++
         [(a,intercalate [searchPathSeparator] $ pre ++ [b | b /= ""] ++ post) | (a,b) <- path] ++
         other
@@ -83,11 +94,22 @@
 addEnv :: MonadIO m => [(String, String)] -> m CmdOption
 addEnv extra = do
     args <- liftIO getEnvironment
-    return $ Env $ extra ++ filter (\(a,_) -> a `notElem` map fst extra) args
+    pure $ Env $ extra ++ filter (\(a,_) -> a `notElem` map fst extra) args
 
 
-data Str = Str String | BS BS.ByteString | LBS LBS.ByteString | Unit deriving Eq
+data Str = Str String | BS BS.ByteString | LBS LBS.ByteString | Unit deriving (Eq,Show)
 
+strTrim :: Str -> Str
+strTrim (Str x) = Str $ trim x
+strTrim (BS x) = BS $ fst $ BS.spanEnd isSpace $ BS.dropWhile isSpace x
+strTrim (LBS x) = LBS $ trimEnd $ LBS.dropWhile isSpace x
+    where
+        trimEnd x = case LBS.uncons x of
+            Just (c, x2) | isSpace c -> trimEnd x2
+            _ -> x
+strTrim Unit = Unit
+
+
 data Result
     = ResultStdout Str
     | ResultStderr Str
@@ -95,225 +117,327 @@
     | ResultCode ExitCode
     | ResultTime Double
     | ResultLine String
-    | ResultProcess Pid
-      deriving Eq
+    | ResultProcess PID
+    | ResultFSATrace [FSATrace FilePath]
+    | ResultFSATraceBS [FSATrace BS.ByteString]
+      deriving (Eq,Show)
 
-data Pid = Pid0 | Pid ProcessHandle
-instance Eq Pid where _ == _ = True
+data PID = PID0 | PID ProcessHandle
+instance Eq PID where _ == _ = True
+instance Show PID where show PID0 = "PID0"; show _ = "PID"
 
+data Params = Params
+    {funcName :: String
+    ,opts :: [CmdOption]
+    ,results :: [Result]
+    ,prog :: String
+    ,args :: [String]
+    } deriving Show
 
+class MonadIO m => MonadTempDir m where
+    runWithTempDir :: (FilePath -> m a) -> m a
+    runWithTempFile :: (FilePath -> m a) -> m a
+instance MonadTempDir IO where
+    runWithTempDir = IO.withTempDir
+    runWithTempFile = IO.withTempFile
+instance MonadTempDir Action where
+    runWithTempDir = withTempDir
+    runWithTempFile = withTempFile
+
 ---------------------------------------------------------------------
+-- DEAL WITH Shell
+
+removeOptionShell
+    :: MonadTempDir m
+    => Params -- ^ Given the parameter
+    -> (Params -> m a) -- ^ Call with the revised params, program name and command line
+    -> m a
+removeOptionShell params@Params{..} call
+    | Shell `elem` opts = do
+        -- put our UserCommand first, as the last one wins, and ours is lowest priority
+        let userCmdline = unwords $ prog : args
+        params <- pure params{opts = UserCommand userCmdline : filter (/= Shell) opts}
+
+        prog <- liftIO $ if isFSATrace params then copyFSABinary prog else pure prog
+        let realCmdline = unwords $ prog : args
+        if not isWindows then
+            call params{prog = "/bin/sh", args = ["-c",realCmdline]}
+        else
+            -- On Windows the Haskell behaviour isn't that clean and is very fragile, so we try and do better.
+            runWithTempDir $ \dir -> do
+                let file = dir </> "s.bat"
+                writeFile' file realCmdline
+                call params{prog = "cmd.exe", args = ["/d/q/c",file]}
+    | otherwise = call params
+
+
+---------------------------------------------------------------------
+-- DEAL WITH FSATrace
+
+isFSATrace :: Params -> Bool
+isFSATrace Params{..} = any isResultFSATrace  results || any isFSAOptions opts
+
+-- Mac disables tracing on system binaries, so we copy them over, yurk
+copyFSABinary :: FilePath -> IO FilePath
+copyFSABinary prog
+    | not isMac = pure prog
+    | otherwise = do
+        progFull <- findExecutable prog
+        case progFull of
+            Just x | any (`isPrefixOf` x) ["/bin/","/usr/","/sbin/"] -> do
+                -- The file is one of the ones we can't trace, so we make a copy of it in $TMP and run that
+                -- We deliberately don't clean up this directory, since otherwise we spend all our time copying binaries over
+                tmpdir <- getTemporaryDirectory
+                let fake = tmpdir </> "fsatrace-fakes" ++ x -- x is absolute, so must use ++
+                unlessM (doesFileExist fake) $ do
+                    createDirectoryRecursive $ takeDirectory fake
+                    copyFile x fake
+                pure fake
+            _ -> pure prog
+
+removeOptionFSATrace
+    :: MonadTempDir m
+    => Params -- ^ Given the parameter
+    -> (Params -> m [Result]) -- ^ Call with the revised params, program name and command line
+    -> m [Result]
+removeOptionFSATrace params@Params{..} call
+    | not $ isFSATrace params = call params
+    | ResultProcess PID0 `elem` results =
+        -- This is a bad state to get into, you could technically just ignore the tracing, but that's a bit dangerous
+        liftIO $ errorIO "Asyncronous process execution combined with FSATrace is not support"
+    | otherwise = runWithTempFile $ \file -> do
+        liftIO $ writeFile file "" -- ensures even if we fail before fsatrace opens the file, we can still read it
+        params <- liftIO $ fsaParams file params
+        res <- call params{opts = UserCommand (showCommandForUser2 prog args) : filter (not . isFSAOptions) opts}
+        fsaResBS <- liftIO $ parseFSA <$> BS.readFile file
+        let fsaRes = map (fmap UTF8.toString) fsaResBS
+        pure $ flip map res $ \case
+            ResultFSATrace [] -> ResultFSATrace fsaRes
+            ResultFSATraceBS [] -> ResultFSATraceBS fsaResBS
+            x -> x
+    where
+        fsaFlags = lastDef "rwmdqt" [x | FSAOptions x <- opts]
+
+        fsaParams file Params{..} = do
+            prog <- copyFSABinary prog
+            pure params{prog = "fsatrace", args = fsaFlags : file : "--" : prog : args }
+
+
+isFSAOptions FSAOptions{} = True
+isFSAOptions _ = False
+
+isResultFSATrace ResultFSATrace{} = True
+isResultFSATrace ResultFSATraceBS{} = True
+isResultFSATrace _ = False
+
+addFSAOptions :: String -> [CmdOption] -> [CmdOption]
+addFSAOptions x opts | any isFSAOptions opts = map f opts
+    where f (FSAOptions y) = FSAOptions $ nubOrd $ y ++ x
+          f x = x
+addFSAOptions x opts = FSAOptions x : opts
+
+
+-- | The results produced by @fsatrace@. All files will be absolute paths.
+--   You can get the results for a 'cmd' by requesting a value of type
+--   @['FSATrace']@.
+data FSATrace a
+    = -- | Writing to a file
+      FSAWrite a
+    | -- | Reading from a file
+      FSARead a
+    | -- | Deleting a file
+      FSADelete a
+    | -- | Moving, arguments destination, then source
+      FSAMove a a
+    | -- | Querying\/stat on a file
+      FSAQuery a
+    | -- | Touching a file
+      FSATouch a
+      deriving (Show,Eq,Ord,Data,Typeable,Functor)
+
+
+-- | Parse the 'FSATrace' entries, ignoring anything you don't understand.
+parseFSA :: BS.ByteString -> [FSATrace BS.ByteString]
+parseFSA = mapMaybe (f . dropR) . BS.lines
+    where
+        -- deal with CRLF on Windows
+        dropR x = case BS.unsnoc x of
+            Just (x, '\r') -> x
+            _ -> x
+
+        f x
+            | Just (k, x) <- BS.uncons x
+            , Just ('|', x) <- BS.uncons x =
+                case k of
+                    'w' -> Just $ FSAWrite x
+                    'r' -> Just $ FSARead  x
+                    'd' -> Just $ FSADelete x
+                    'm' | (xs, ys) <- BS.break (== '|') x, Just ('|',ys) <- BS.uncons ys ->
+                        Just $ FSAMove xs ys
+                    'q' -> Just $ FSAQuery x
+                    't' -> Just $ FSATouch x
+                    _ -> Nothing
+            | otherwise = Nothing
+
+
+---------------------------------------------------------------------
 -- ACTION EXPLICIT OPERATION
 
--- | Given explicit operations, apply the advance ones, like skip/trace/track/autodep
-commandExplicit :: String -> [CmdOption] -> [Result] -> String -> [String] -> Action [Result]
-commandExplicit funcName oopts results exe args = do
-    ShakeOptions
-        {shakeCommandOptions,shakeRunCommands
-        ,shakeLint,shakeLintInside,shakeLintIgnore} <- getShakeOptions
-    let fopts = shakeCommandOptions ++ oopts
-    let useShell = Shell `elem` fopts
-    let useLint = shakeLint == Just LintFSATrace
-    let useAutoDeps = AutoDeps `elem` fopts
-    let opts = filter (/= Shell) fopts
+-- | Given explicit operations, apply the Action ones, like skip/trace/track/autodep
+commandExplicitAction :: Partial => Params -> Action [Result]
+commandExplicitAction oparams = do
+    ShakeOptions{shakeCommandOptions,shakeRunCommands,shakeLint,shakeLintInside} <- getShakeOptions
+    params@Params{..}<- pure $ oparams{opts = shakeCommandOptions ++ opts oparams}
 
-    let skipper act = if null results && not shakeRunCommands then return [] else act
+    let skipper act = if null results && not shakeRunCommands then pure [] else act
 
     let verboser act = do
             let cwd = listToMaybe $ reverse [x | Cwd x <- opts]
-            putLoud $ maybe "" (\x -> "cd " ++ x ++ "; ") cwd ++ showCommandForUser2 exe args
+            putVerbose $
+                maybe "" (\x -> "cd " ++ x ++ "; ") cwd ++
+                lastDef (showCommandForUser2 prog args) [x | UserCommand x <- opts]
             verb <- getVerbosity
-            (if verb >= Loud then quietly else id) act
+            -- run quietly to suppress the tracer (don't want to print twice)
+            (if verb >= Verbose then quietly else id) act
 
-    let tracer = case reverse [x | Traced x <- opts] of
-            "":_ -> liftIO
-            msg:_ -> traced msg
-            [] -> traced (takeFileName exe)
+    let tracer act = do
+            -- note: use the oparams - find a good tracing before munging it for shell stuff
+            let msg = lastDef (defaultTraced oparams) [x | Traced x <- opts]
+            if msg == "" then liftIO act else traced msg act
 
+    let async = ResultProcess PID0 `elem` results
     let tracker act
-            | useLint = fsatrace act
-            | useAutoDeps = autodeps act
-            | useShell = shelled act
-            | otherwise = act exe args
-
-        shelled = runShell (unwords $ exe : args)
-                              
-        ignore = map (?==) shakeLintIgnore
-        ham cwd xs = [makeRelative cwd x | x <- map toStandard xs
-                                         , any (`isPrefixOf` x) shakeLintInside
-                                         , not $ any ($ x) ignore]
+            | AutoDeps `elem` opts = if async then liftIO $ errorIO "Can't use AutoDeps and asyncronous execution" else autodeps act
+            | shakeLint == Just LintFSATrace && not async = fsalint act
+            | otherwise = act params
 
-        fsaCmd act opts file
-            | isMac = fsaCmdMac act opts file
-            | useShell = runShell (unwords $ exe : args) $ \exe args -> act "fsatrace" $ opts : file : "--" : exe : args
-            | otherwise = act "fsatrace" $ opts : file : "--" : exe : args
+        autodeps act = do
+            ResultFSATrace pxs : res <- act params{opts = addFSAOptions "rwm" opts, results = ResultFSATrace [] : results}
+            let written = Set.fromList $ [x | FSAMove x _ <- pxs] ++ [x | FSAWrite x <- pxs]
+            -- If something both reads and writes to a file, it isn't eligible to be an autodeps
+            xs <- liftIO $ filterM doesFileExist [x | FSARead x <- pxs, not $ x `Set.member` written]
+            cwd <- liftIO getCurrentDirectory
+            temp <- fixPaths cwd xs
+            unsafeAllowApply $ need temp
+            pure res
 
-        fsaCmdMac act opts file = do
-            let fakeExe e = liftIO $ do
-                    me <- findExecutable e
-                    case me of
-                        Just re -> do
-                            let isSystem = any (`isPrefixOf` re) [ "/bin"
-                                                                 , "/usr"
-                                                                 , "/sbin"
-                                                                 ]
-                            if isSystem
-                                then do
-                                    tmpdir <- getTemporaryDirectory
-                                    let fake = tmpdir ++ "fsatrace-fakes" ++ re
-                                    unlessM (doesFileExist fake) $ do
-                                        createDirectoryIfMissing True $ takeDirectory fake
-                                        copyFile re fake
-                                    return fake
-                                else return re
-                        Nothing -> return e
-            fexe <- fakeExe exe
-            if useShell
-                then do
-                    fsh <- fakeExe "/bin/sh"
-                    act "fsatrace" $ opts : file : "--" : fsh : "-c" : [unwords $ fexe : args]
-                else act "fsatrace" $ opts : file : "--" : fexe : args
+        fixPaths cwd xs = liftIO $ do
+            xs<- pure $ map toStandard xs
+            xs<- pure $ filter (\x -> any (`isPrefixOf` x) shakeLintInside) xs
+            mapM (\x -> fromMaybe x <$> makeRelativeEx cwd x) xs
 
-        fsatrace act = withTempFile $ \file -> do
-            res <- fsaCmd act "rwm" file
-            xs <- liftIO $ parseFSAT <$> readFileUTF8' file
-            cwd <- liftIO getCurrentDirectory
-            let reader (FSATRead x) = Just x; reader _ = Nothing
-                writer (FSATWrite x) = Just x; writer (FSATMove x _) = Just x; writer _ = Nothing
+        fsalint act = do
+            ResultFSATrace xs : res <- act params{opts = addFSAOptions "rwm" opts, results = ResultFSATrace [] : results}
+            let reader (FSARead x) = Just x; reader _ = Nothing
+                writer (FSAWrite x) = Just x; writer (FSAMove x _) = Just x; writer _ = Nothing
                 existing f = liftIO . filterM doesFileExist . nubOrd . mapMaybe f
-            rs <- existing reader xs
-            ws <- existing writer xs
-            let reads = ham cwd rs
-                writes = ham cwd ws
-            when useAutoDeps $
-                unsafeAllowApply $ needed reads
-            trackRead reads
-            trackWrite writes
-            return res
-
-        autodeps act = withTempFile $ \file -> do
-            res <-  fsaCmd act "r" file
-            pxs <- liftIO $ parseFSAT <$> readFileUTF8' file
-            xs <- liftIO $ filterM doesFileExist [x | FSATRead x <- pxs]
             cwd <- liftIO getCurrentDirectory
-            unsafeAllowApply $ needNorm $ ham cwd xs
-            return res
+            trackRead  =<< fixPaths cwd =<< existing reader xs
+            trackWrite =<< fixPaths cwd =<< existing writer xs
+            pure res
 
-    skipper $ tracker $ \exe args -> verboser $ tracer $ commandExplicitIO funcName opts results exe args
+    skipper $ tracker $ \params -> verboser $ tracer $ commandExplicitIO params
 
 
--- | Given a shell command, call the continuation with the sanitised exec-style arguments
-runShell :: String -> (String -> [String] -> Action a) -> Action a
-runShell x act | not isWindows = act "/bin/sh" ["-c",x] -- do exactly what Haskell does
-runShell x act = withTempDir $ \dir -> do
-    let file = dir </> "s.bat"
-    writeFile' file x
-    act "cmd.exe" ["/d/q/c",file]
+defaultTraced :: Params -> String
+defaultTraced Params{..} = takeBaseName $ if Shell `elem` opts then fst (word1 prog) else prog
 
 
--- | Parse the FSATrace structure
-data FSAT
-    = FSATWrite FilePath
-    | FSATRead FilePath
-    | FSATDelete FilePath
-    | FSATMove FilePath FilePath
-
--- | Parse the 'FSAT' entries, ignoring anything you don't understand.
-parseFSAT :: String -> [FSAT]
-parseFSAT = mapMaybe f . lines
-    where f ('w':'|':xs) = Just $ FSATWrite xs
-          f ('r':'|':xs) = Just $ FSATRead xs
-          f ('d':'|':xs) = Just $ FSATDelete xs
-          f ('m':'|':xs) | (xs,'|':ys) <- break (== '|') xs = Just $ FSATMove xs ys
-          f _ = Nothing
-
 ---------------------------------------------------------------------
 -- IO EXPLICIT OPERATION
 
 -- | Given a very explicit set of CmdOption, translate them to a General.Process structure
-commandExplicitIO :: String -> [CmdOption] -> [Result] -> String -> [String] -> IO [Result]
-commandExplicitIO funcName opts results exe args = do
-    let (grabStdout, grabStderr) = both or $ unzip $ for results $ \r -> case r of
+commandExplicitIO :: Partial => Params -> IO [Result]
+commandExplicitIO params = removeOptionShell params $ \params -> removeOptionFSATrace params $ \Params{..} -> do
+    let (grabStdout, grabStderr) = both or $ unzip $ flip map results $ \case
             ResultStdout{} -> (True, False)
             ResultStderr{} -> (False, True)
             ResultStdouterr{} -> (True, True)
             _ -> (False, False)
 
     optEnv <- resolveEnv opts
-    let optCwd = let x = last $ "" : [x | Cwd x <- opts] in if x == "" then Nothing else Just x
-    let optStdin = flip mapMaybe opts $ \x -> case x of
+    let optCwd = mergeCwd [x | Cwd x <- opts]
+    let optStdin = flip mapMaybe opts $ \case
             Stdin x -> Just $ SrcString x
             StdinBS x -> Just $ SrcBytes x
             FileStdin x -> Just $ SrcFile x
+            InheritStdin -> Just SrcInherit
             _ -> Nothing
-    let optShell = Shell `elem` opts
     let optBinary = BinaryPipes `elem` opts
-    let optAsync = ResultProcess Pid0 `elem` results
+    let optAsync = ResultProcess PID0 `elem` results
     let optTimeout = listToMaybe $ reverse [x | Timeout x <- opts]
-    let optWithStdout = last $ False : [x | WithStdout x <- opts]
-    let optWithStderr = last $ True : [x | WithStderr x <- opts]
+    let optWithStdout = lastDef False [x | WithStdout x <- opts]
+    let optWithStderr = lastDef True [x | WithStderr x <- opts]
     let optFileStdout = [x | FileStdout x <- opts]
     let optFileStderr = [x | FileStderr x <- opts]
-    let optEchoStdout = last $ (not grabStdout && null optFileStdout) : [x | EchoStdout x <- opts]
-    let optEchoStderr = last $ (not grabStderr && null optFileStderr) : [x | EchoStderr x <- opts]
+    let optEchoStdout = lastDef (not grabStdout && null optFileStdout) [x | EchoStdout x <- opts]
+    let optEchoStderr = lastDef (not grabStderr && null optFileStderr) [x | EchoStderr x <- opts]
+    let optRealCommand = showCommandForUser2 prog args
+    let optUserCommand = lastDef optRealCommand [x | UserCommand x <- opts]
+    let optCloseFds = CloseFileHandles `elem` opts
+    let optProcessGroup = NoProcessGroup `notElem` opts
 
-    let cmdline = showCommandForUser2 exe args
-    let bufLBS f = do (a,b) <- buf $ LBS LBS.empty; return (a, (\(LBS x) -> f x) <$> b)
+    let bufLBS f = do (a,b) <- buf $ LBS LBS.empty; pure (a, (\(LBS x) -> f x) <$> b)
         buf Str{} | optBinary = bufLBS (Str . LBS.unpack)
-        buf Str{} = do x <- newBuffer; return ([DestString x | not optAsync], Str . concat <$> readBuffer x)
-        buf LBS{} = do x <- newBuffer; return ([DestBytes x | not optAsync], LBS . LBS.fromChunks <$> readBuffer x)
+        buf Str{} = do x <- newBuffer; pure ([DestString x | not optAsync], Str . concat <$> readBuffer x)
+        buf LBS{} = do x <- newBuffer; pure ([DestBytes x | not optAsync], LBS . LBS.fromChunks <$> readBuffer x)
         buf BS {} = bufLBS (BS . BS.concat . LBS.toChunks)
-        buf Unit  = return ([], return Unit)
+        buf Unit  = pure ([], pure Unit)
     (dStdout, dStderr, resultBuild) :: ([[Destination]], [[Destination]], [Double -> ProcessHandle -> ExitCode -> IO Result]) <-
-        fmap unzip3 $ forM results $ \r -> case r of
-            ResultCode _ -> return ([], [], \_ _ ex -> return $ ResultCode ex)
-            ResultTime _ -> return ([], [], \dur _ _ -> return $ ResultTime dur)
-            ResultLine _ -> return ([], [], \_ _ _ -> return $ ResultLine cmdline)
-            ResultProcess _ -> return ([], [], \_ pid _ -> return $ ResultProcess $ Pid pid)
-            ResultStdout    s -> do (a,b) <- buf s; return (a , [], \_ _ _ -> fmap ResultStdout b)
-            ResultStderr    s -> do (a,b) <- buf s; return ([], a , \_ _ _ -> fmap ResultStderr b)
-            ResultStdouterr s -> do (a,b) <- buf s; return (a , a , \_ _ _ -> fmap ResultStdouterr b)
+        fmap unzip3 $ forM results $ \case
+            ResultCode _ -> pure ([], [], \_ _ ex -> pure $ ResultCode ex)
+            ResultTime _ -> pure ([], [], \dur _ _ -> pure $ ResultTime dur)
+            ResultLine _ -> pure ([], [], \_ _ _ -> pure $ ResultLine optUserCommand)
+            ResultProcess _ -> pure ([], [], \_ pid _ -> pure $ ResultProcess $ PID pid)
+            ResultStdout    s -> do (a,b) <- buf s; pure (a , [], \_ _ _ -> fmap ResultStdout b)
+            ResultStderr    s -> do (a,b) <- buf s; pure ([], a , \_ _ _ -> fmap ResultStderr b)
+            ResultStdouterr s -> do (a,b) <- buf s; pure (a , a , \_ _ _ -> fmap ResultStdouterr b)
+            ResultFSATrace _ -> pure ([], [], \_ _ _ -> pure $ ResultFSATrace []) -- filled in elsewhere
+            ResultFSATraceBS _ -> pure ([], [], \_ _ _ -> pure $ ResultFSATraceBS []) -- filled in elsewhere
 
     exceptionBuffer <- newBuffer
     po <- resolvePath ProcessOpts
-        {poCommand = if optShell then ShellCommand $ unwords $ exe:args else RawCommand exe args
+        {poCommand = RawCommand prog args
         ,poCwd = optCwd, poEnv = optEnv, poTimeout = optTimeout
         ,poStdin = [SrcBytes LBS.empty | optBinary && not (null optStdin)] ++ optStdin
         ,poStdout = [DestEcho | optEchoStdout] ++ map DestFile optFileStdout ++ [DestString exceptionBuffer | optWithStdout && not optAsync] ++ concat dStdout
         ,poStderr = [DestEcho | optEchoStderr] ++ map DestFile optFileStderr ++ [DestString exceptionBuffer | optWithStderr && not optAsync] ++ concat dStderr
         ,poAsync = optAsync
+        ,poCloseFds = optCloseFds
+        ,poGroup = optProcessGroup
         }
-    res <- try_ $ duration $ process po
+    (dur,(pid,exit)) <- duration $ process po
+    if exit == ExitSuccess || ResultCode ExitSuccess `elem` results then
+        mapM (\f -> f dur pid exit) resultBuild
+     else do
+        exceptionBuffer <- readBuffer exceptionBuffer
+        let captured = ["Stderr" | optWithStderr] ++ ["Stdout" | optWithStdout]
+        cwd <- case optCwd of
+            Nothing -> pure ""
+            Just v -> do
+                v <- canonicalizePath v `catchIO` const (pure v)
+                pure $ "Current directory: " ++ v ++ "\n"
+        liftIO $ errorIO $
+            "Development.Shake." ++ funcName ++ ", system command failed\n" ++
+            "Command line: " ++ optRealCommand ++ "\n" ++
+            (if optRealCommand /= optUserCommand then "Original command line: " ++ optUserCommand ++ "\n" else "") ++
+            cwd ++
+            "Exit code: " ++ show (case exit of ExitFailure i -> i; _ -> 0) ++ "\n" ++
+            if null captured then "Stderr not captured because WithStderr False was used\n"
+            else if null exceptionBuffer then intercalate " and " captured ++ " " ++ (if length captured == 1 then "was" else "were") ++ " empty"
+            else intercalate " and " captured ++ ":\n" ++ unlines (dropWhile null $ lines $ concat exceptionBuffer)
 
-    let failure extra = do
-            cwd <- case optCwd of
-                Nothing -> return ""
-                Just v -> do
-                    v <- canonicalizePath v `catch_` const (return v)
-                    return $ "Current directory: " ++ v ++ "\n"
-            fail $
-                "Development.Shake." ++ funcName ++ ", system command failed\n" ++
-                "Command: " ++ cmdline ++ "\n" ++
-                cwd ++ extra
-    case res of
-        Left err -> failure $ show err
-        Right (_,(_,ex)) | ex /= ExitSuccess && ResultCode ExitSuccess `notElem` results -> do
-            exceptionBuffer <- readBuffer exceptionBuffer
-            let captured = ["Stderr" | optWithStderr] ++ ["Stdout" | optWithStdout]
-            failure $
-                "Exit code: " ++ show (case ex of ExitFailure i -> i; _ -> 0) ++ "\n" ++
-                if null captured then "Stderr not captured because WithStderr False was used\n"
-                else if null exceptionBuffer then intercalate " and " captured ++ " " ++ (if length captured == 1 then "was" else "were") ++ " empty"
-                else intercalate " and " captured ++ ":\n" ++ unlines (dropWhile null $ lines $ concat exceptionBuffer)
-        Right (dur,(pid,ex)) -> mapM (\f -> f dur pid ex) resultBuild
 
+mergeCwd :: [FilePath] -> Maybe FilePath
+mergeCwd [] = Nothing
+mergeCwd xs = Just $ foldl1 (</>) xs
 
 -- | Apply all environment operations, to produce a new environment to use.
 resolveEnv :: [CmdOption] -> IO (Maybe [(String, String)])
 resolveEnv opts
-    | null env, null addEnv, null addPath, null remEnv = return Nothing
+    | null env, null addEnv, null addPath, null remEnv = pure Nothing
     | otherwise = Just . unique . tweakPath . (++ addEnv) . filter (flip notElem remEnv . fst) <$>
-                  if null env then getEnvironment else return (concat env)
+                  if null env then getEnvironment else pure (concat env)
     where
         env = [x | Env x <- opts]
         addEnv = [(x,y) | AddEnv x y <- opts]
@@ -329,7 +453,7 @@
         unique = reverse . nubOrdOn (if isWindows then upper . fst else fst) . reverse
 
 
--- | If the user specifies a custom $PATH, and not Shell, then try and resolve their exe ourselves.
+-- | If the user specifies a custom $PATH, and not Shell, then try and resolve their prog ourselves.
 --   Tricky, because on Windows it doesn't look in the $PATH first.
 resolvePath :: ProcessOpts -> IO ProcessOpts
 resolvePath po
@@ -344,24 +468,24 @@
     new <- unsafeInterleaveIO $ findExecutableWith (splitSearchPath path) progExe
     old2 <- unsafeInterleaveIO $ findExecutableWith (splitSearchPath pathOld) progExe
 
-    switch <- return $ case () of
+    switch<- pure $ case () of
         _ | path == pathOld -> False -- The state I can see hasn't changed
           | Nothing <- new -> False -- I have nothing to offer
           | Nothing <- old -> True -- I failed last time, so this must be an improvement
           | Just old <- old, Just new <- new, equalFilePath old new -> False -- no different
           | Just old <- old, Just old2 <- old2, equalFilePath old old2 -> True -- I could predict last time
           | otherwise -> False
-    return $ case new of
+    pure $ case new of
         Just new | switch -> po{poCommand = RawCommand new args}
         _ -> po
-resolvePath po = return po
+resolvePath po = pure po
 
 
 -- | Given a list of directories, and a file name, return the complete path if you can find it.
 --   Like findExecutable, but with a custom PATH.
 findExecutableWith :: [FilePath] -> String -> IO (Maybe FilePath)
 findExecutableWith path x = flip firstJustM (map (</> x) path) $ \s ->
-    ifM (doesFileExist s) (return $ Just s) (return Nothing)
+    ifM (doesFileExist s) (pure $ Just s) (pure Nothing)
 
 
 ---------------------------------------------------------------------
@@ -370,8 +494,15 @@
 -- | Collect the @stdout@ of the process.
 --   If used, the @stdout@ will not be echoed to the terminal, unless you include 'EchoStdout'.
 --   The value type may be either 'String', or either lazy or strict 'ByteString'.
+--
+--   Note that most programs end their output with a trailing newline, so calling
+--   @ghc --numeric-version@ will result in 'Stdout' of @\"6.8.3\\n\"@. If you want to automatically
+--   trim the resulting string, see 'StdoutTrim'.
 newtype Stdout a = Stdout {fromStdout :: a}
 
+-- | Like 'Stdout' but remove all leading and trailing whitespaces.
+newtype StdoutTrim a = StdoutTrim {fromStdoutTrim :: a}
+
 -- | Collect the @stderr@ of the process.
 --   If used, the @stderr@ will not be echoed to the terminal, unless you include 'EchoStderr'.
 --   The value type may be either 'String', or either lazy or strict 'ByteString'.
@@ -387,8 +518,8 @@
 newtype Exit = Exit {fromExit :: ExitCode}
 
 -- | Collect the 'ProcessHandle' of the process.
---   If you do collect the process handle, the command will run asyncronously and the call to 'cmd'/'command'
---   will return as soon as the process is spawned. Any 'Stdout'\/'Stderr' captures will return empty strings.
+--   If you do collect the process handle, the command will run asyncronously and the call to 'cmd' \/ 'command'
+--   will return as soon as the process is spawned. Any 'Stdout' \/ 'Stderr' captures will return empty strings.
 newtype Process = Process {fromProcess :: ProcessHandle}
 
 -- | Collect the time taken to execute the process. Can be used in conjunction with 'CmdLine' to
@@ -399,7 +530,7 @@
 -- timer act = do
 --     ('CmdTime' t, 'CmdLine' x, r) <- act
 --     liftIO $ putStrLn $ \"Command \" ++ x ++ \" took \" ++ show t ++ \" seconds\"
---     return r
+--     pure r
 --
 -- run :: IO ()
 -- run = timer $ 'cmd' \"ghc --version\"
@@ -417,6 +548,12 @@
 instance CmdString BS.ByteString where cmdString = (BS BS.empty, \(BS x) -> x)
 instance CmdString LBS.ByteString where cmdString = (LBS LBS.empty, \(LBS x) -> x)
 
+
+class Unit a
+instance {-# OVERLAPPING #-} Unit b => Unit (a -> b)
+instance {-# OVERLAPPABLE #-} a ~ () => Unit (m a)
+
+
 -- | A class for specifying what results you want to collect from a process.
 --   Values are formed of 'Stdout', 'Stderr', 'Exit' and tuples of those.
 class CmdResult a where
@@ -431,10 +568,10 @@
     cmdResult = ([ResultCode ExitSuccess], \[ResultCode x] -> x)
 
 instance CmdResult Process where
-    cmdResult = ([ResultProcess Pid0], \[ResultProcess (Pid x)] -> Process x)
+    cmdResult = ([ResultProcess PID0], \[ResultProcess (PID x)] -> Process x)
 
 instance CmdResult ProcessHandle where
-    cmdResult = ([ResultProcess Pid0], \[ResultProcess (Pid x)] -> x)
+    cmdResult = ([ResultProcess PID0], \[ResultProcess (PID x)] -> x)
 
 instance CmdResult CmdLine where
     cmdResult = ([ResultLine ""], \[ResultLine x] -> CmdLine x)
@@ -442,9 +579,18 @@
 instance CmdResult CmdTime where
     cmdResult = ([ResultTime 0], \[ResultTime x] -> CmdTime x)
 
+instance CmdResult [FSATrace FilePath] where
+    cmdResult = ([ResultFSATrace []], \[ResultFSATrace x] -> x)
+
+instance CmdResult [FSATrace BS.ByteString] where
+    cmdResult = ([ResultFSATraceBS []], \[ResultFSATraceBS x] -> x)
+
 instance CmdString a => CmdResult (Stdout a) where
     cmdResult = let (a,b) = cmdString in ([ResultStdout a], \[ResultStdout x] -> Stdout $ b x)
 
+instance CmdString a => CmdResult (StdoutTrim a) where
+    cmdResult = let (a,b) = cmdString in ([ResultStdout a], \[ResultStdout x] -> StdoutTrim $ b $ strTrim x)
+
 instance CmdString a => CmdResult (Stderr a) where
     cmdResult = let (a,b) = cmdString in ([ResultStderr a], \[ResultStderr x] -> Stderr $ b x)
 
@@ -498,14 +644,14 @@
 --   By default the @stderr@ stream will be captured for use in error messages, and also echoed. To only echo
 --   pass @'WithStderr' 'False'@, which causes no streams to be captured by Shake, and certain programs (e.g. @gcc@)
 --   to detect they are running in a terminal.
-command :: CmdResult r => [CmdOption] -> String -> [String] -> Action r
-command opts x xs = b <$> commandExplicit "command" opts a x xs
+command :: (Partial, CmdResult r) => [CmdOption] -> String -> [String] -> Action r
+command opts x xs = withFrozenCallStack $ b <$> commandExplicitAction (Params "command" opts a x xs)
     where (a,b) = cmdResult
 
 -- | A version of 'command' where you do not require any results, used to avoid errors about being unable
 --   to deduce 'CmdResult'.
-command_ :: [CmdOption] -> String -> [String] -> Action ()
-command_ opts x xs = void $ commandExplicit "command_" opts [] x xs
+command_ :: Partial => [CmdOption] -> String -> [String] -> Action ()
+command_ opts x xs = withFrozenCallStack $ void $ commandExplicitAction (Params "command_" opts [] x xs)
 
 
 ---------------------------------------------------------------------
@@ -516,41 +662,46 @@
 type a :-> t = a
 
 
--- | Execute a system command. Before running 'cmd' make sure you 'Development.Shake.need' any files
+-- | Build or execute a system command. Before using 'cmd' to run a command, make sure you 'Development.Shake.need' any files
 --   that are used by the command.
 --
--- * @String@ arguments are treated as whitespace separated arguments.
+-- * @String@ arguments are treated as a list of whitespace separated arguments.
 --
--- * @[String]@ arguments are treated as literal arguments.
+-- * @[String]@ arguments are treated as a list of literal arguments.
 --
 -- * 'CmdOption' arguments are used as options.
 --
+-- * 'CmdArgument' arguments, which can be built by 'cmd' itself, are spliced into the containing command.
+--
+--   Typically only string literals should be passed as @String@ arguments. When using variables
+--   prefer @[myvar]@ so that if @myvar@ contains spaces they are properly escaped.
+--
 --   As some examples, here are some calls, and the resulting command string:
 --
 -- @
--- 'unit' $ 'cmd' \"git log --pretty=\" \"oneline\"           -- git log --pretty= oneline
--- 'unit' $ 'cmd' \"git log --pretty=\" [\"oneline\"]         -- git log --pretty= oneline
--- 'unit' $ 'cmd' \"git log\" (\"--pretty=\" ++ \"oneline\")    -- git log --pretty=oneline
--- 'unit' $ 'cmd' \"git log\" (\"--pretty=\" ++ \"one line\")   -- git log --pretty=one line
--- 'unit' $ 'cmd' \"git log\" [\"--pretty=\" ++ \"one line\"]   -- git log "--pretty=one line"
+-- 'cmd_' \"git log --pretty=\" \"oneline\"           -- git log --pretty= oneline
+-- 'cmd_' \"git log --pretty=\" [\"oneline\"]         -- git log --pretty= oneline
+-- 'cmd_' \"git log\" (\"--pretty=\" ++ \"oneline\")    -- git log --pretty=oneline
+-- 'cmd_' \"git log\" (\"--pretty=\" ++ \"one line\")   -- git log --pretty=one line
+-- 'cmd_' \"git log\" [\"--pretty=\" ++ \"one line\"]   -- git log "--pretty=one line"
 -- @
 --
 --   More examples, including return values, see this translation of the examples given for the 'command' function:
 --
 -- @
--- () <- 'cmd' \"gcc -c myfile.c\"                                  -- compile a file, throwing an exception on failure
--- 'unit' $ 'cmd' \"gcc -c myfile.c\"                                 -- alternative to () <- binding.
+-- 'cmd_' \"gcc -c myfile.c\"                                       -- compile a file, throwing an exception on failure
 -- 'Exit' c <- 'cmd' \"gcc -c\" [myfile]                              -- run a command, recording the exit code
 -- ('Exit' c, 'Stderr' err) <- 'cmd' \"gcc -c myfile.c\"                -- run a command, recording the exit code and error output
 -- 'Stdout' out <- 'cmd' \"gcc -MM myfile.c\"                         -- run a command, recording the output
 -- 'cmd' ('Cwd' \"generated\") \"gcc -c\" [myfile] :: 'Action' ()         -- run a command in a directory
--- @
 --
---   When passing file arguments we use @[myfile]@ so that if the @myfile@ variable contains spaces they are properly escaped.
+-- let gccCommand = 'cmd' \"gcc -c\" :: 'CmdArgument'                 -- build a sub-command. 'cmd' can return 'CmdArgument' values as well as execute commands
+-- cmd ('Cwd' \"generated\") gccCommand [myfile]                 -- splice that command into a greater command
+-- @
 --
 --   If you use 'cmd' inside a @do@ block and do not use the result, you may get a compile-time error about being
---   unable to deduce 'CmdResult'. To avoid this error, bind the result to @()@, or include a type signature, or use
---   the 'unit' function.
+--   unable to deduce 'CmdResult'. To avoid this error, use 'cmd_'. If you enable @OverloadedStrings@ or @OverloadedLists@
+--   you may have to give type signatures to the arguments, or use the more constrained 'command' instead.
 --
 --   The 'cmd' function can also be run in the 'IO' monad, but then 'Traced' is ignored and command lines are not echoed.
 --   As an example:
@@ -558,32 +709,47 @@
 -- @
 -- 'cmd' ('Cwd' \"generated\") 'Shell' \"gcc -c myfile.c\" :: IO ()
 -- @
-cmd :: CmdArguments args => args :-> Action r
-cmd = cmdArguments []
+cmd :: (Partial, CmdArguments args) => args :-> Action r
+cmd = withFrozenCallStack $ cmdArguments mempty
 
+-- | See 'cmd'. Same as 'cmd' except with a unit result.
+-- 'cmd' is to 'cmd_' as 'command' is to 'command_'.
+cmd_ :: (Partial, CmdArguments args, Unit args) => args :-> Action ()
+cmd_ = withFrozenCallStack cmd
+
 -- | The arguments to 'cmd' - see 'cmd' for examples and semantics.
-class CmdArguments t where cmdArguments :: [Either CmdOption String] -> t
-instance (Arg a, CmdArguments r) => CmdArguments (a -> r) where
-    cmdArguments xs x = cmdArguments $ xs ++ arg x
+newtype CmdArgument = CmdArgument [Either CmdOption String]
+  deriving (Eq, Semigroup, Monoid, Show)
+
+-- | The arguments to 'cmd' - see 'cmd' for examples and semantics.
+class CmdArguments t where
+    -- | Arguments to cmd
+    cmdArguments :: Partial => CmdArgument -> t
+instance (IsCmdArgument a, CmdArguments r) => CmdArguments (a -> r) where
+    cmdArguments xs x = cmdArguments $ xs `mappend` toCmdArgument x
 instance CmdResult r => CmdArguments (Action r) where
-    cmdArguments x = case partitionEithers x of
-        (opts, x:xs) -> let (a,b) = cmdResult in b <$> commandExplicit "cmd" opts a x xs
+    cmdArguments (CmdArgument x) = case partitionEithers x of
+        (opts, x:xs) -> let (a,b) = cmdResult in b <$> commandExplicitAction (Params "cmd" opts a x xs)
         _ -> error "Error, no executable or arguments given to Development.Shake.cmd"
 instance CmdResult r => CmdArguments (IO r) where
-    cmdArguments x = case partitionEithers x of
-        (opts, x:xs) -> let (a,b) = cmdResult in b <$> commandExplicitIO "cmd" opts a x xs
+    cmdArguments (CmdArgument x) = case partitionEithers x of
+        (opts, x:xs) -> let (a,b) = cmdResult in b <$> commandExplicitIO (Params "cmd" opts a x xs)
         _ -> error "Error, no executable or arguments given to Development.Shake.cmd"
-
-instance CmdArguments [Either CmdOption String] where
+instance CmdArguments CmdArgument where
     cmdArguments = id
 
-
-class Arg a where arg :: a -> [Either CmdOption String]
-instance Arg String where arg = map Right . words
-instance Arg [String] where arg = map Right
-instance Arg CmdOption where arg = return . Left
-instance Arg [CmdOption] where arg = map Left
-instance Arg a => Arg (Maybe a) where arg = maybe [] arg
+-- | Class to convert an a  to a CmdArgument
+class IsCmdArgument a where
+    -- | Conversion to a CmdArgument
+    toCmdArgument :: a -> CmdArgument
+instance IsCmdArgument () where toCmdArgument = mempty
+instance IsCmdArgument String where toCmdArgument = CmdArgument . map Right . words
+instance IsCmdArgument [String] where toCmdArgument = CmdArgument . map Right
+instance IsCmdArgument (NonEmpty String) where toCmdArgument = toCmdArgument . toList
+instance IsCmdArgument CmdOption where toCmdArgument = CmdArgument . pure . Left
+instance IsCmdArgument [CmdOption] where toCmdArgument = CmdArgument . map Left
+instance IsCmdArgument CmdArgument where toCmdArgument = id
+instance IsCmdArgument a => IsCmdArgument (Maybe a) where toCmdArgument = maybe mempty toCmdArgument
 
 
 ---------------------------------------------------------------------
@@ -593,5 +759,5 @@
 showCommandForUser2 :: FilePath -> [String] -> String
 showCommandForUser2 cmd args = unwords $ map (\x -> if safe x then x else showCommandForUser x []) $ cmd : args
     where
-        safe xs = not (null xs) && not (any bad xs)
-        bad x = isSpace x || (x == '\\' && not isWindows) || x `elem` "\"\'"
+        safe xs = xs /= "" && not (any bad xs)
+        bad x = isSpace x || (x == '\\' && not isWindows) || x `elem` ("\"\'" :: String)
diff --git a/src/Development/Shake/Config.hs b/src/Development/Shake/Config.hs
--- a/src/Development/Shake/Config.hs
+++ b/src/Development/Shake/Config.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, TypeFamilies #-}
 
 -- | A module for parsing and using config files in a Shake build system. Config files
 --   consist of variable bindings, for example:
@@ -13,6 +13,8 @@
 --   @CFLAGS@ (equal to @-g -I\/path\/to\/dir -O2@), and also includes the configuration
 --   statements in the file @extra/file.cfg@. The full lexical syntax for configuration
 --   files is defined here: <https://ninja-build.org/manual.html#_lexical_syntax>.
+--   The use of Ninja file syntax is due to convenience and the desire to reuse an
+--    externally-defined specification (but the choice of configuration language is mostly arbitrary).
 --
 --   To use the configuration file either use 'readConfigFile' to parse the configuration file
 --   and use the values directly, or 'usingConfigFile' and 'getConfig' to track the configuration
@@ -29,10 +31,8 @@
 import qualified Development.Ninja.Env as Ninja
 import qualified Data.HashMap.Strict as Map
 import qualified Data.ByteString.UTF8 as UTF8
-import Control.Applicative
 import Data.Tuple.Extra
 import Data.List
-import Prelude
 
 
 -- | Read a config file, returning a list of the variables and their bindings.
@@ -51,14 +51,17 @@
     mapM_ (uncurry (Ninja.addEnv env) . (UTF8.fromString *** UTF8.fromString)) vars
     Ninja.parse file env
     mp <- Ninja.fromEnv env
-    return $ Map.fromList $ map (UTF8.toString *** UTF8.toString) $ Map.toList mp
+    pure $ Map.fromList $ map (UTF8.toString *** UTF8.toString) $ Map.toList mp
 
 
 newtype Config = Config String deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
 
 newtype ConfigKeys = ConfigKeys () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
 
+type instance RuleResult Config = Maybe String
+type instance RuleResult ConfigKeys = [String]
 
+
 -- | Specify the file to use with 'getConfig'.
 usingConfigFile :: FilePath -> Rules ()
 usingConfigFile file = do
@@ -66,8 +69,8 @@
         need [file]
         liftIO $ readConfigFile file
     addOracle $ \(Config x) -> Map.lookup x <$> mp ()
-    addOracle $ \(ConfigKeys x) -> sort . Map.keys <$> mp ()
-    return ()
+    addOracle $ \(ConfigKeys ()) -> sort . Map.keys <$> mp ()
+    pure ()
 
 
 -- | Specify the values to use with 'getConfig', generally prefer
@@ -75,8 +78,9 @@
 --   of variables outside 'Action'.
 usingConfig :: Map.HashMap String String -> Rules ()
 usingConfig mp = do
-    addOracle $ \(Config x) -> return $ Map.lookup x mp
-    return ()
+    addOracle $ \(Config x) -> pure $ Map.lookup x mp
+    addOracle $ \(ConfigKeys ()) -> pure $ sort $ Map.keys mp
+    pure ()
 
 
 -- | Obtain the value of a configuration variable, returns 'Nothing' to indicate the variable
diff --git a/src/Development/Shake/Core.hs b/src/Development/Shake/Core.hs
deleted file mode 100644
--- a/src/Development/Shake/Core.hs
+++ /dev/null
@@ -1,971 +0,0 @@
-{-# LANGUAGE RecordWildCards, GeneralizedNewtypeDeriving, ScopedTypeVariables, PatternGuards #-}
-{-# LANGUAGE ExistentialQuantification, MultiParamTypeClasses, ConstraintKinds #-}
-
-module Development.Shake.Core(
-    run,
-    ShakeValue,
-    Rule(..), Rules, rule, action, withoutActions, alternatives, priority,
-    Action, actionOnException, actionFinally, apply, apply1, traced, getShakeOptions, getProgress,
-    trackUse, trackChange, trackAllow,
-    getVerbosity, putLoud, putNormal, putQuiet, withVerbosity, quietly,
-    Resource, newResource, newResourceIO, withResource, withResources, newThrottle, newThrottleIO,
-    newCache, newCacheIO,
-    unsafeExtraThread, unsafeAllowApply,
-    parallel,
-    orderOnlyAction,
-    -- Internal stuff
-    runAfter
-    ) where
-
-import Control.Exception.Extra
-import Control.Applicative
-import Data.Tuple.Extra
-import Control.Concurrent.Extra
-import Control.Monad.Extra
-import Control.Monad.Fix
-import Control.Monad.IO.Class
-import Control.Monad.Trans.Writer.Strict
-import Data.Typeable
-import Data.Function
-import Data.Either.Extra
-import Numeric.Extra
-import Data.List.Extra
-import qualified Data.HashMap.Strict as Map
-import Data.Maybe
-import Data.IORef
-import System.Directory
-import System.IO.Extra
-import System.Time.Extra
-import Data.Monoid
-import System.IO.Unsafe
-
-import Development.Shake.Classes
-import Development.Shake.Pool
-import Development.Shake.Database
-import Development.Shake.Monad
-import Development.Shake.Resource
-import Development.Shake.Value
-import Development.Shake.Profile
-import Development.Shake.Types
-import Development.Shake.Errors
-import Development.Shake.Special
-import General.Timing
-import General.Extra
-import General.Concurrent
-import General.Cleanup
-import General.String
-import Prelude
-
-
----------------------------------------------------------------------
--- RULES
-
--- | Define a pair of types that can be used by Shake rules.
---   To import all the type classes required see "Development.Shake.Classes".
---
---   A 'Rule' instance for a class of artifacts (e.g. /files/) provides:
---
--- * How to identify individual artifacts, given by the @key@ type, e.g. with file names.
---
--- * How to describe the state of an artifact, given by the @value@ type, e.g. the file modification time.
---
--- * A way to compare two states of the same individual artifact, with 'equalValue' returning either
---   'EqualCheap' or 'NotEqual'.
---
--- * A way to query the current state of an artifact, with 'storedValue' returning the current state,
---   or 'Nothing' if there is no current state (e.g. the file does not exist).
---
---   Checking if an artifact needs to be built consists of comparing two @value@s
---   of the same @key@ with 'equalValue'. The first value is obtained by applying
---   'storedValue' to the @key@ and the second is the value stored in the build
---   database after the last successful build.
---
---   As an example, below is a simplified rule for building files, where files are identified
---   by a 'FilePath' and their state is identified by a hash of their contents
---   (the builtin functions 'Development.Shake.need' and 'Development.Shake.%>'
---   provide a similar rule).
---
--- @
--- newtype File = File FilePath deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
--- newtype Modtime = Modtime Double deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
--- getFileModtime file = ...
---
--- instance Rule File Modtime where
---     storedValue _ (File x) = do
---         exists <- System.Directory.doesFileExist x
---         if exists then Just \<$\> getFileModtime x else return Nothing
---     equalValue _ _ t1 t2 =
---         if t1 == t2 then EqualCheap else NotEqual
--- @
---
---   This example instance means:
---
--- * A value of type @File@ uniquely identifies a generated file.
---
--- * A value of type @Modtime@ will be used to check if a file is up-to-date.
---
---   It is important to distinguish 'Rule' instances from actual /rules/. 'Rule'
---   instances are one component required for the creation of rules.
---   Actual /rules/ are functions from a @key@ to an 'Action'; they are
---   added to 'Rules' using the 'rule' function.
---
---   A rule can be created for the instance above with:
---
--- @
--- -- Compile foo files; for every foo output file there must be a
--- -- single input file named \"filename.foo\".
--- compileFoo :: 'Rules' ()
--- compileFoo = 'rule' (Just . compile)
---     where
---         compile :: File -> 'Action' Modtime
---         compile (File outputFile) = do
---             -- figure out the name of the input file
---             let inputFile = outputFile '<.>' \"foo\"
---             'unit' $ 'Development.Shake.cmd' \"fooCC\" inputFile outputFile
---             -- return the (new) file modtime of the output file:
---             getFileModtime outputFile
--- @
---
---   /Note:/ In this example, the timestamps of the input files are never
---   used, let alone compared to the timestamps of the ouput files.
---   Dependencies between output and input files are /not/ expressed by
---   'Rule' instances. Dependencies are created automatically by 'apply'.
---
---   For rules whose values are not stored externally,
---   'storedValue' should return 'Just' with a sentinel value
---   and 'equalValue' should always return 'EqualCheap' for that sentinel.
-class (ShakeValue key, ShakeValue value) => Rule key value where
-
-    -- | /[Required]/ Retrieve the @value@ associated with a @key@, if available.
-    --
-    --   As an example for filenames/timestamps, if the file exists you should return 'Just'
-    --   the timestamp, but otherwise return 'Nothing'.
-    storedValue :: ShakeOptions -> key -> IO (Maybe value)
-
-    -- | /[Optional]/ Equality check, with a notion of how expensive the check was.
-    equalValue :: ShakeOptions -> key -> value -> value -> EqualCost
-    equalValue _ _ v1 v2 = if v1 == v2 then EqualCheap else NotEqual
-
-
-data ARule m = forall key value . Rule key value => ARule (key -> Maybe (m value))
-
-ruleKey :: (key -> Maybe (m value)) -> key
-ruleKey = err "ruleKey"
-
-ruleValue :: (key -> Maybe (m value)) -> value
-ruleValue = err "ruleValue"
-
-
--- | Define a set of rules. Rules can be created with calls to functions such as 'Development.Shake.%>' or 'action'.
---   Rules are combined with either the 'Monoid' instance, or (more commonly) the 'Monad' instance and @do@ notation.
---   To define your own custom types of rule, see "Development.Shake.Rule".
-newtype Rules a = Rules (WriterT (SRules Action) IO a) -- All IO must be associative/commutative (e.g. creating IORef/MVars)
-    deriving (Functor, Applicative, Monad, MonadIO, MonadFix)
-
-newRules :: SRules Action -> Rules ()
-newRules = Rules . tell
-
-modifyRules :: (SRules Action -> SRules Action) -> Rules () -> Rules ()
-modifyRules f (Rules r) = Rules $ censor f r
-
-getRules :: Rules () -> IO (SRules Action)
-getRules (Rules r) = execWriterT r
-
-
-data SRules m = SRules
-    {actions :: [m ()]
-    ,rules :: Map.HashMap TypeRep{-k-} (TypeRep{-k-},TypeRep{-v-},[(Double,ARule m)]) -- higher fst is higher priority
-    }
-
-instance Monoid (SRules m) where
-    mempty = SRules [] (Map.fromList [])
-    mappend (SRules x1 x2) (SRules y1 y2) = SRules (x1++y1) (Map.unionWith f x2 y2)
-        where f (k, v1, xs) (_, v2, ys)
-                | v1 == v2 = (k, v1, xs ++ ys)
-                | otherwise = unsafePerformIO $ errorIncompatibleRules k v1 v2
-
-instance Monoid a => Monoid (Rules a) where
-    mempty = return mempty
-    mappend = liftA2 mappend
-
-
--- | Add a rule to build a key, returning an appropriate 'Action' if the @key@ matches,
---   or 'Nothing' otherwise.
---   All rules at a given priority must be disjoint on all used @key@ values, with at most one match.
---   Rules have priority 1 by default, which can be modified with 'priority'.
-rule :: Rule key value => (key -> Maybe (Action value)) -> Rules ()
-rule r = newRules mempty{rules = Map.singleton k (k, v, [(1,ARule r)])}
-    where k = typeOf $ ruleKey r; v = typeOf $ ruleValue r
-
-
--- | Change the priority of a given set of rules, where higher priorities take precedence.
---   All matching rules at a given priority must be disjoint, or an error is raised.
---   All builtin Shake rules have priority between 0 and 1.
---   Excessive use of 'priority' is discouraged. As an example:
---
--- @
--- 'priority' 4 $ \"hello.*\" %> \\out -> 'writeFile'' out \"hello.*\"
--- 'priority' 8 $ \"*.txt\" %> \\out -> 'writeFile'' out \"*.txt\"
--- @
---
---   In this example @hello.txt@ will match the second rule, instead of raising an error about ambiguity.
---
---   The 'priority' function obeys the invariants:
---
--- @
--- 'priority' p1 ('priority' p2 r1) === 'priority' p1 r1
--- 'priority' p1 (r1 >> r2) === 'priority' p1 r1 >> 'priority' p1 r2
--- @
-priority :: Double -> Rules () -> Rules ()
-priority i = modifyRules $ \s -> s{rules = Map.map (\(a,b,cs) -> (a,b,map (first $ const i) cs)) $ rules s}
-
-
--- | Change the matching behaviour of rules so rules do not have to be disjoint, but are instead matched
---   in order. Only recommended for small blocks containing a handful of rules.
---
--- @
--- 'alternatives' $ do
---     \"hello.*\" %> \\out -> 'writeFile'' out \"hello.*\"
---     \"*.txt\" %> \\out -> 'writeFile'' out \"*.txt\"
--- @
---
---   In this example @hello.txt@ will match the first rule, instead of raising an error about ambiguity.
---   Inside 'alternatives' the 'priority' of each rule is not used to determine which rule matches,
---   but the resulting match uses that priority compared to the rules outside the 'alternatives' block.
-alternatives :: Rules () -> Rules ()
-alternatives = modifyRules $ \r -> r{rules = Map.map f $ rules r}
-    where
-        f (k, v, []) = (k, v, [])
-        f (k, v, xs) = let (is,rs) = unzip xs in (k, v, [(maximum is, foldl1' g rs)])
-
-        g (ARule a) (ARule b) = ARule $ \x -> a x `mplus` b2 x
-            where b2 = fmap (fmap (fromJust . cast)) . b . fromJust . cast
-
-
--- | Run an action, usually used for specifying top-level requirements.
---
--- @
--- main = 'Development.Shake.shake' 'shakeOptions' $ do
---    'action' $ do
---        b <- 'Development.Shake.doesFileExist' \"file.src\"
---        when b $ 'Development.Shake.need' [\"file.out\"]
--- @
---
---   This 'action' builds @file.out@, but only if @file.src@ exists. The 'action'
---   will be run in every build execution (unless 'withoutActions' is used), so only cheap
---   operations should be performed. All arguments to 'action' may be run in parallel, in any order.
---
---   For the standard requirement of only 'Development.Shake.need'ing a fixed list of files in the 'action',
---   see 'Development.Shake.want'.
-action :: Action a -> Rules ()
-action a = newRules mempty{actions=[void a]}
-
-
--- | Remove all actions specified in a set of rules, usually used for implementing
---   command line specification of what to build.
-withoutActions :: Rules () -> Rules ()
-withoutActions = modifyRules $ \x -> x{actions=[]}
-
-
-registerWitnesses :: SRules m -> IO ()
-registerWitnesses SRules{..} =
-    forM_ (Map.elems rules) $ \(_, _, (_,ARule r):_) -> do
-        registerWitness $ ruleKey r
-        registerWitness $ ruleValue r
-
-
-data RuleInfo m = RuleInfo
-    {stored :: Key -> IO (Maybe Value)
-    ,equal :: Key -> Value -> Value -> EqualCost
-    ,execute :: Key -> m Value
-    ,resultType :: TypeRep
-    }
-
-createRuleinfo :: ShakeOptions -> SRules Action -> Map.HashMap TypeRep (RuleInfo Action)
-createRuleinfo opt SRules{..} = flip Map.map rules $ \(_,tv,rs) -> RuleInfo (stored rs) (equal rs) (execute rs) tv
-    where
-        stored ((_,ARule r):_) = fmap (fmap newValue) . f r . fromKey
-            where f :: Rule key value => (key -> Maybe (m value)) -> (key -> IO (Maybe value))
-                  f _ = storedValue opt
-
-        equal ((_,ARule r):_) = \k v1 v2 -> f r (fromKey k) (fromValue v1) (fromValue v2)
-            where f :: Rule key value => (key -> Maybe (m value)) -> key -> value -> value -> EqualCost
-                  f _ = equalValue opt
-
-        execute rs = \k -> case filter (not . null) $ map (mapMaybe ($ k)) rs2 of
-               [r]:_ -> r
-               rs -> liftIO $ errorMultipleRulesMatch (typeKey k) (show k) (length rs)
-            where rs2 = sets [(i, \k -> fmap newValue <$> r (fromKey k)) | (i,ARule r) <- rs]
-
-        sets :: Ord a => [(a, b)] -> [[b]] -- highest to lowest
-        sets = map snd . reverse . groupSort
-
-runStored :: Map.HashMap TypeRep (RuleInfo m) -> Key -> IO (Maybe Value)
-runStored mp k = case Map.lookup (typeKey k) mp of
-    Nothing -> return Nothing
-    Just RuleInfo{..} -> stored k
-
-runEqual :: Map.HashMap TypeRep (RuleInfo m) -> Key -> Value -> Value -> EqualCost
-runEqual mp k v1 v2 = case Map.lookup (typeKey k) mp of
-    Nothing -> NotEqual
-    Just RuleInfo{..} -> equal k v1 v2
-
-runExecute :: MonadIO m => Map.HashMap TypeRep (RuleInfo m) -> Key -> m Value
-runExecute mp k = let tk = typeKey k in case Map.lookup tk mp of
-    Nothing -> liftIO $ errorNoRuleToBuildType tk (Just $ show k) Nothing
-    Just RuleInfo{..} -> execute k
-
-
----------------------------------------------------------------------
--- MAKE
-
--- global constants of Action
-data Global = Global
-    {globalDatabase :: Database
-    ,globalPool :: Pool
-    ,globalCleanup :: Cleanup
-    ,globalTimestamp :: IO Seconds
-    ,globalRules :: Map.HashMap TypeRep (RuleInfo Action)
-    ,globalOutput :: Verbosity -> String -> IO ()
-    ,globalOptions  :: ShakeOptions
-    ,globalDiagnostic :: String -> IO ()
-    ,globalLint :: String -> IO ()
-    ,globalAfter :: IORef [IO ()]
-    ,globalTrackAbsent :: IORef [(Key, Key)] -- in rule fst, snd must be absent
-    ,globalProgress :: IO Progress
-    }
-
-
--- local variables of Action
-data Local = Local
-    -- constants
-    {localStack :: Stack
-    -- stack scoped local variables
-    ,localVerbosity :: Verbosity
-    ,localBlockApply ::  Maybe String -- reason to block apply, or Nothing to allow
-    -- mutable local variables
-    ,localDepends :: [Depends] -- built up in reverse
-    ,localDiscount :: !Seconds
-    ,localTraces :: [Trace] -- in reverse
-    ,localTrackAllows :: [Key -> Bool]
-    ,localTrackUsed :: [Key]
-    }
-
--- | The 'Action' monad, use 'liftIO' to raise 'IO' actions into it, and 'Development.Shake.need' to execute files.
---   Action values are used by 'rule' and 'action'. The 'Action' monad tracks the dependencies of a 'Rule'.
-newtype Action a = Action {fromAction :: RAW Global Local a}
-    deriving (Functor, Applicative, Monad, MonadIO)
-
-
-actionBoom :: Bool -> Action a -> IO b -> Action a
-actionBoom runOnSuccess act clean = do
-    cleanup <- Action $ getsRO globalCleanup
-    clean <- liftIO $ addCleanup cleanup $ void clean
-    res <- Action $ catchRAW (fromAction act) $ \e -> liftIO (clean True) >> throwRAW e
-    liftIO $ clean runOnSuccess
-    return res
-
--- | If an exception is raised by the 'Action', perform some 'IO'.
-actionOnException :: Action a -> IO b -> Action a
-actionOnException = actionBoom False
-
--- | After an 'Action', perform some 'IO', even if there is an exception.
-actionFinally :: Action a -> IO b -> Action a
-actionFinally = actionBoom True
-
-
--- | Internal main function (not exported publicly)
-run :: ShakeOptions -> Rules () -> IO ()
-run opts@ShakeOptions{..} rs = (if shakeLineBuffering then lineBuffering else id) $ do
-    opts@ShakeOptions{..} <- if shakeThreads /= 0 then return opts else do p <- getProcessorCount; return opts{shakeThreads=p}
-
-    start <- offsetTime
-    rs <- getRules rs
-    registerWitnesses rs
-
-    outputLocked <- do
-        lock <- newLock
-        return $ \v msg -> withLock lock $ shakeOutput v msg
-
-    let diagnostic = if shakeVerbosity >= Diagnostic then outputLocked Diagnostic . ("% "++) else const $ return ()
-    let output v = outputLocked v . abbreviate shakeAbbreviations
-    diagnostic "Starting run"
-
-    except <- newIORef (Nothing :: Maybe (String, ShakeException))
-    let raiseError err
-            | not shakeStaunch = throwIO err
-            | otherwise = do
-                let named = abbreviate shakeAbbreviations . shakeExceptionTarget
-                atomicModifyIORef except $ \v -> (Just $ fromMaybe (named err, err) v, ())
-                -- no need to print exceptions here, they get printed when they are wrapped
-
-    lint <- if isNothing shakeLint then return $ const $ return () else do
-        dir <- getCurrentDirectory
-        return $ \msg -> do
-            now <- getCurrentDirectory
-            when (dir /= now) $ errorStructured
-                "Lint checking error - current directory has changed"
-                [("When", Just msg)
-                ,("Wanted",Just dir)
-                ,("Got",Just now)]
-                ""
-    diagnostic "Starting run 2"
-
-    after <- newIORef []
-    absent <- newIORef []
-    withCleanup $ \cleanup -> do
-        _ <- addCleanup cleanup $ do
-            when shakeTimings printTimings
-            resetTimings -- so we don't leak memory
-        withNumCapabilities shakeThreads $ do
-            diagnostic "Starting run 3"
-            withDatabase opts diagnostic $ \database -> do
-                wait <- newBarrier
-                let getProgress = do
-                        failure <- fmap fst <$> readIORef except
-                        stats <- progress database
-                        return stats{isFailure=failure}
-                tid <- flip forkFinally (const $ signalBarrier wait ()) $
-                    shakeProgress getProgress
-                _ <- addCleanup cleanup $ do
-                    killThread tid
-                    void $ timeout 1000000 $ waitBarrier wait
-
-                let ruleinfo = createRuleinfo opts rs
-                addTiming "Running rules"
-                runPool (shakeThreads == 1) shakeThreads $ \pool -> do
-                    let s0 = Global database pool cleanup start ruleinfo output opts diagnostic lint after absent getProgress
-                    let s1 = Local emptyStack shakeVerbosity Nothing [] 0 [] [] []
-                    forM_ (actions rs) $ \act ->
-                        addPool pool $ runAction s0 s1 act $ \x -> case x of
-                            Left e -> raiseError =<< shakeException s0 (return ["Top-level action/want"]) e
-                            Right x -> return x
-                maybe (return ()) (throwIO . snd) =<< readIORef except
-                assertFinishedDatabase database
-
-                when (null $ actions rs) $
-                    when (shakeVerbosity >= Normal) $ output Normal "Warning: No want/action statements, nothing to do"
-
-                when (isJust shakeLint) $ do
-                    addTiming "Lint checking"
-                    absent <- readIORef absent
-                    checkValid database (runStored ruleinfo) (runEqual ruleinfo) absent
-                    when (shakeVerbosity >= Loud) $ output Loud "Lint checking succeeded"
-                when (shakeReport /= []) $ do
-                    addTiming "Profile report"
-                    report <- toReport database
-                    forM_ shakeReport $ \file -> do
-                        when (shakeVerbosity >= Normal) $
-                            output Normal $ "Writing report to " ++ file
-                        writeProfile file report
-                when (shakeLiveFiles /= []) $ do
-                    addTiming "Listing live"
-                    live <- listLive database
-                    let liveFiles = [show k | k <- live, specialIsFileKey $ typeKey k]
-                    forM_ shakeLiveFiles $ \file -> do
-                        when (shakeVerbosity >= Normal) $
-                            output Normal $ "Writing live list to " ++ file
-                        (if file == "-" then putStr else writeFile file) $ unlines liveFiles
-            sequence_ . reverse =<< readIORef after
-
-
-lineBuffering :: IO a -> IO a
-lineBuffering = withBuffering stdout LineBuffering . withBuffering stderr LineBuffering
-
-
-abbreviate :: [(String,String)] -> String -> String
-abbreviate [] = id
-abbreviate abbrev = f
-    where
-        -- order so longer abbreviations are preferred
-        ordAbbrev = sortOn (negate . length . fst) abbrev
-
-        f [] = []
-        f x | (to,rest):_ <- [(to,rest) | (from,to) <- ordAbbrev, Just rest <- [stripPrefix from x]] = to ++ f rest
-        f (x:xs) = x : f xs
-
-
-runAction :: Global -> Local -> Action a -> Capture (Either SomeException a)
-runAction g l (Action x) = runRAW g l x
-
-
-runAfter :: IO () -> Action ()
-runAfter op = do
-    Global{..} <- Action getRO
-    liftIO $ atomicModifyIORef globalAfter $ \ops -> (op:ops, ())
-
-
--- | Execute a rule, returning the associated values. If possible, the rules will be run in parallel.
---   This function requires that appropriate rules have been added with 'rule'.
---   All @key@ values passed to 'apply' become dependencies of the 'Action'.
-apply :: Rule key value => [key] -> Action [value]
-apply = applyForall
-
--- We don't want the forall in the Haddock docs
--- Don't short-circuit [] as we still want error messages
-applyForall :: forall key value . Rule key value => [key] -> Action [value]
-applyForall ks = do
-    let tk = typeOf (err "apply key" :: key)
-        tv = typeOf (err "apply type" :: value)
-    Global{..} <- Action getRO
-    block <- Action $ getsRW localBlockApply
-    whenJust block $ liftIO . errorNoApply tk (show <$> listToMaybe ks)
-    case Map.lookup tk globalRules of
-        Nothing -> liftIO $ errorNoRuleToBuildType tk (show <$> listToMaybe ks) (Just tv)
-        Just RuleInfo{resultType=tv2} | tv /= tv2 -> liftIO $ errorRuleTypeMismatch tk (show <$> listToMaybe ks) tv2 tv
-        _ -> fmap (map fromValue) $ applyKeyValue $ map newKey ks
-
-
-applyKeyValue :: [Key] -> Action [Value]
-applyKeyValue [] = return []
-applyKeyValue ks = do
-    global@Global{..} <- Action getRO
-    let exec stack k continue = do
-            let s = Local {localVerbosity=shakeVerbosity globalOptions, localDepends=[], localStack=stack, localBlockApply=Nothing
-                          ,localDiscount=0, localTraces=[], localTrackAllows=[], localTrackUsed=[]}
-            let top = showTopStack stack
-            time <- offsetTime
-            runAction global s (do
-                liftIO $ evaluate $ rnf k
-                liftIO $ globalLint $ "before building " ++ top
-                putWhen Chatty $ "# " ++ show k
-                res <- runExecute globalRules k
-                when (Just LintFSATrace == shakeLint globalOptions) trackCheckUsed
-                Action $ fmap ((,) res) getRW) $ \x -> case x of
-                    Left e -> continue . Left . toException =<< shakeException global (showStack globalDatabase stack) e
-                    Right (res, Local{..}) -> do
-                        dur <- time
-                        globalLint $ "after building " ++ top
-                        let ans = (res, reverse localDepends, dur - localDiscount, reverse localTraces)
-                        evaluate $ rnf ans
-                        continue $ Right ans
-    stack <- Action $ getsRW localStack
-    (dur, dep, vs) <- Action $ captureRAW $ build globalPool globalDatabase (Ops (runStored globalRules) (runEqual globalRules) exec) stack ks
-    Action $ modifyRW $ \s -> s{localDiscount=localDiscount s + dur, localDepends=dep : localDepends s}
-    return vs
-
-
--- | Turn a normal exception into a ShakeException, giving it a stack and printing it out if in staunch mode.
---   If the exception is already a ShakeException (e.g. it's a child of ours who failed and we are rethrowing)
---   then do nothing with it.
-shakeException :: Global -> IO [String] -> SomeException -> IO ShakeException
-shakeException Global{globalOptions=ShakeOptions{..},..} stk e@(SomeException inner) = case cast inner of
-    Just e@ShakeException{} -> return e
-    Nothing -> do
-        stk <- stk
-        e <- return $ ShakeException (last $ "Unknown call stack" : stk) stk e
-        when (shakeStaunch && shakeVerbosity >= Quiet) $
-            globalOutput Quiet $ show e ++ "Continuing due to staunch mode"
-        return e
-
-
--- | Apply a single rule, equivalent to calling 'apply' with a singleton list. Where possible,
---   use 'apply' to allow parallelism.
-apply1 :: Rule key value => key -> Action value
-apply1 = fmap head . apply . return
-
-
--- | Get the initial 'ShakeOptions', these will not change during the build process.
-getShakeOptions :: Action ShakeOptions
-getShakeOptions = Action $ getsRO globalOptions
-
--- | Get the current 'Progress' structure, as would be returned by 'shakeProgress'.
-getProgress :: Action Progress
-getProgress = do
-    res <- Action $ getsRO globalProgress
-    liftIO res
-
-
--- | Write an action to the trace list, along with the start/end time of running the IO action.
---   The 'Development.Shake.cmd' and 'Development.Shake.command' functions automatically call 'traced'.
---   The trace list is used for profile reports (see 'shakeReport').
---
---   By default 'traced' prints some useful extra context about what
---   Shake is building, e.g.:
---
--- > # traced message (for myobject.o)
---
---   To suppress the output of 'traced' (for example you want more control
---   over the message using 'putNormal'), use the 'quietly' combinator.
-traced :: String -> IO a -> Action a
-traced msg act = do
-    Global{..} <- Action getRO
-    stack <- Action $ getsRW localStack
-    start <- liftIO globalTimestamp
-    putNormal $ "# " ++ msg ++ " (for " ++ showTopStack stack ++ ")"
-    res <- liftIO act
-    stop <- liftIO globalTimestamp
-    Action $ modifyRW $ \s -> s{localTraces = Trace (pack msg) (doubleToFloat start) (doubleToFloat stop) : localTraces s}
-    return res
-
-
-putWhen :: Verbosity -> String -> Action ()
-putWhen v msg = do
-    Global{..} <- Action getRO
-    verb <- getVerbosity
-    when (verb >= v) $
-        liftIO $ globalOutput v msg
-
-
--- | Write an unimportant message to the output, only shown when 'shakeVerbosity' is higher than normal ('Loud' or above).
---   The output will not be interleaved with any other Shake messages (other than those generated by system commands).
-putLoud :: String -> Action ()
-putLoud = putWhen Loud
-
--- | Write a normal priority message to the output, only supressed when 'shakeVerbosity' is 'Quiet' or 'Silent'.
---   The output will not be interleaved with any other Shake messages (other than those generated by system commands).
-putNormal :: String -> Action ()
-putNormal = putWhen Normal
-
--- | Write an important message to the output, only supressed when 'shakeVerbosity' is 'Silent'.
---   The output will not be interleaved with any other Shake messages (other than those generated by system commands).
-putQuiet :: String -> Action ()
-putQuiet = putWhen Quiet
-
-
--- | Get the current verbosity level, originally set by 'shakeVerbosity'. If you
---   want to output information to the console, you are recommended to use
---   'putLoud' \/ 'putNormal' \/ 'putQuiet', which ensures multiple messages are
---   not interleaved. The verbosity can be modified locally by 'withVerbosity'.
-getVerbosity :: Action Verbosity
-getVerbosity = Action $ getsRW localVerbosity
-
-
--- | Run an action with a particular verbosity level.
---   Will not update the 'shakeVerbosity' returned by 'getShakeOptions' and will
---   not have any impact on 'Diagnostic' tracing.
-withVerbosity :: Verbosity -> Action a -> Action a
-withVerbosity new = Action . unmodifyRW f . fromAction
-    where f s0 = (s0{localVerbosity=new}, \s -> s{localVerbosity=localVerbosity s0})
-
-
--- | Run an action with 'Quiet' verbosity, in particular messages produced by 'traced'
---   (including from 'Development.Shake.cmd' or 'Development.Shake.command') will not be printed to the screen.
---   Will not update the 'shakeVerbosity' returned by 'getShakeOptions' and will
---   not turn off any 'Diagnostic' tracing.
-quietly :: Action a -> Action a
-quietly = withVerbosity Quiet
-
-
----------------------------------------------------------------------
--- TRACKING
-
--- | Track that a key has been used by the action preceeding it.
-trackUse :: ShakeValue key => key -> Action ()
--- One of the following must be true:
--- 1) you are the one building this key (e.g. key == topStack)
--- 2) you have already been used by apply, and are on the dependency list
--- 3) someone explicitly gave you permission with trackAllow
--- 4) at the end of the rule, a) you are now on the dependency list, and b) this key itself has no dependencies (is source file)
-trackUse key = do
-    let k = newKey key
-    Global{..} <- Action getRO
-    l@Local{..} <- Action getRW
-    deps <- liftIO $ concatMapM (listDepends globalDatabase) localDepends
-    let top = topStack localStack
-    if top == Just k then
-        return () -- condition 1
-     else if k `elem` deps then
-        return () -- condition 2
-     else if any ($ k) localTrackAllows then
-        return () -- condition 3
-     else
-        Action $ putRW l{localTrackUsed = k : localTrackUsed} -- condition 4
-
-
-trackCheckUsed :: Action ()
-trackCheckUsed = do
-    Global{..} <- Action getRO
-    Local{..} <- Action getRW
-    liftIO $ do
-        deps <- concatMapM (listDepends globalDatabase) localDepends
-
-        -- check 3a
-        bad <- return $ localTrackUsed \\ deps
-        unless (null bad) $ do
-            let n = length bad
-            errorStructured
-                ("Lint checking error - " ++ (if n == 1 then "value was" else show n ++ " values were") ++ " used but not depended upon")
-                [("Used", Just $ show x) | x <- bad]
-                ""
-
-        -- check 3b
-        bad <- flip filterM localTrackUsed $ \k -> (not . null) <$> lookupDependencies globalDatabase k
-        unless (null bad) $ do
-            let n = length bad
-            errorStructured
-                ("Lint checking error - " ++ (if n == 1 then "value was" else show n ++ " values were") ++ " depended upon after being used")
-                [("Used", Just $ show x) | x <- bad]
-                ""
-
-
--- | Track that a key has been changed by the action preceeding it.
-trackChange :: ShakeValue key => key -> Action ()
--- One of the following must be true:
--- 1) you are the one building this key (e.g. key == topStack)
--- 2) someone explicitly gave you permission with trackAllow
--- 3) this file is never known to the build system, at the end it is not in the database
-trackChange key = do
-    let k = newKey key
-    Global{..} <- Action getRO
-    Local{..} <- Action getRW
-    liftIO $ do
-        let top = topStack localStack
-        if top == Just k then
-            return () -- condition 1
-         else if any ($ k) localTrackAllows then
-            return () -- condition 2
-         else
-            -- condition 3
-            atomicModifyIORef globalTrackAbsent $ \ks -> ((fromMaybe k top, k):ks, ())
-
-
--- | Allow any matching key to violate the tracking rules.
-trackAllow :: ShakeValue key => (key -> Bool) -> Action ()
-trackAllow = trackAllowForall
-
--- We don't want the forall in the Haddock docs
-trackAllowForall :: forall key . ShakeValue key => (key -> Bool) -> Action ()
-trackAllowForall test = Action $ modifyRW $ \s -> s{localTrackAllows = f : localTrackAllows s}
-    where
-        tk = typeOf (err "trackAllow key" :: key)
-        f k = typeKey k == tk && test (fromKey k)
-
-
----------------------------------------------------------------------
--- RESOURCES
-
--- | Create a finite resource, given a name (for error messages) and a quantity of the resource that exists.
---   Shake will ensure that actions using the same finite resource do not execute in parallel.
---   As an example, only one set of calls to the Excel API can occur at one time, therefore
---   Excel is a finite resource of quantity 1. You can write:
---
--- @
--- 'Development.Shake.shake' 'Development.Shake.shakeOptions'{'Development.Shake.shakeThreads'=2} $ do
---    'Development.Shake.want' [\"a.xls\",\"b.xls\"]
---    excel <- 'Development.Shake.newResource' \"Excel\" 1
---    \"*.xls\" 'Development.Shake.%>' \\out ->
---        'Development.Shake.withResource' excel 1 $
---            'Development.Shake.cmd' \"excel\" out ...
--- @
---
---   Now the two calls to @excel@ will not happen in parallel.
---
---   As another example, calls to compilers are usually CPU bound but calls to linkers are usually
---   disk bound. Running 8 linkers will often cause an 8 CPU system to grid to a halt. We can limit
---   ourselves to 4 linkers with:
---
--- @
--- disk <- 'Development.Shake.newResource' \"Disk\" 4
--- 'Development.Shake.want' [show i 'Development.Shake.FilePath.<.>' \"exe\" | i <- [1..100]]
--- \"*.exe\" 'Development.Shake.%>' \\out ->
---     'Development.Shake.withResource' disk 1 $
---         'Development.Shake.cmd' \"ld -o\" [out] ...
--- \"*.o\" 'Development.Shake.%>' \\out ->
---     'Development.Shake.cmd' \"cl -o\" [out] ...
--- @
-newResource :: String -> Int -> Rules Resource
-newResource name mx = liftIO $ newResourceIO name mx
-
-
--- | Create a throttled resource, given a name (for error messages) and a number of resources (the 'Int') that can be
---   used per time period (the 'Double' in seconds). Shake will ensure that actions using the same throttled resource
---   do not exceed the limits. As an example, let us assume that making more than 1 request every 5 seconds to
---   Google results in our client being blacklisted, we can write:
---
--- @
--- google <- 'Development.Shake.newThrottle' \"Google\" 1 5
--- \"*.url\" 'Development.Shake.%>' \\out -> do
---     'Development.Shake.withResource' google 1 $
---         'Development.Shake.cmd' \"wget\" [\"http:\/\/google.com?q=\" ++ 'Development.Shake.FilePath.takeBaseName' out] \"-O\" [out]
--- @
---
---   Now we will wait at least 5 seconds after querying Google before performing another query. If Google change the rules to
---   allow 12 requests per minute we can instead use @'Development.Shake.newThrottle' \"Google\" 12 60@, which would allow
---   greater parallelisation, and avoid throttling entirely if only a small number of requests are necessary.
---
---   In the original example we never make a fresh request until 5 seconds after the previous request has /completed/. If we instead
---   want to throttle requests since the previous request /started/ we can write:
---
--- @
--- google <- 'Development.Shake.newThrottle' \"Google\" 1 5
--- \"*.url\" 'Development.Shake.%>' \\out -> do
---     'Development.Shake.withResource' google 1 $ return ()
---     'Development.Shake.cmd' \"wget\" [\"http:\/\/google.com?q=\" ++ 'Development.Shake.FilePath.takeBaseName' out] \"-O\" [out]
--- @
---
---   However, the rule may not continue running immediately after 'Development.Shake.withResource' completes, so while
---   we will never exceed an average of 1 request every 5 seconds, we may end up running an unbounded number of
---   requests simultaneously. If this limitation causes a problem in practice it can be fixed.
-newThrottle :: String -> Int -> Double -> Rules Resource
-newThrottle name count period = liftIO $ newThrottleIO name count period
-
-unsafeAllowApply :: Action a -> Action a
-unsafeAllowApply  = applyBlockedBy Nothing
-
-blockApply :: String -> Action a -> Action a
-blockApply = applyBlockedBy . Just
-
-applyBlockedBy :: Maybe String -> Action a -> Action a
-applyBlockedBy reason = Action . unmodifyRW f . fromAction
-    where f s0 = (s0{localBlockApply=reason}, \s -> s{localBlockApply=localBlockApply s0})
-
--- | Run an action which uses part of a finite resource. For more details see 'Resource'.
---   You cannot depend on a rule (e.g. 'need') while a resource is held.
-withResource :: Resource -> Int -> Action a -> Action a
-withResource r i act = do
-    Global{..} <- Action getRO
-    liftIO $ globalDiagnostic $ show r ++ " waiting to acquire " ++ show i
-    offset <- liftIO offsetTime
-    Action $ captureRAW $ \continue -> acquireResource r globalPool i $ continue $ Right ()
-    res <- Action $ tryRAW $ fromAction $ blockApply ("Within withResource using " ++ show r) $ do
-        offset <- liftIO offset
-        liftIO $ globalDiagnostic $ show r ++ " acquired " ++ show i ++ " in " ++ showDuration offset
-        Action $ modifyRW $ \s -> s{localDiscount = localDiscount s + offset}
-        act
-    liftIO $ releaseResource r globalPool i
-    liftIO $ globalDiagnostic $ show r ++ " released " ++ show i
-    Action $ either throwRAW return res
-
-
--- | Run an action which uses part of several finite resources. Acquires the resources in a stable
---   order, to prevent deadlock. If all rules requiring more than one resource acquire those
---   resources with a single call to 'withResources', resources will not deadlock.
-withResources :: [(Resource, Int)] -> Action a -> Action a
-withResources res act
-    | (r,i):_ <- filter ((< 0) . snd) res = error $ "You cannot acquire a negative quantity of " ++ show r ++ ", requested " ++ show i
-    | otherwise = f $ groupBy ((==) `on` fst) $ sortBy (compare `on` fst) res
-    where
-        f [] = act
-        f (r:rs) = withResource (fst $ head r) (sum $ map snd r) $ f rs
-
-
--- | A version of 'newCache' that runs in IO, and can be called before calling 'Development.Shake.shake'.
---   Most people should use 'newCache' instead.
-newCacheIO :: (Eq k, Hashable k) => (k -> Action v) -> IO (k -> Action v)
-newCacheIO act = do
-    var {- :: Var (Map k (Fence (Either SomeException ([Depends],v)))) -} <- newVar Map.empty
-    return $ \key ->
-        join $ liftIO $ modifyVar var $ \mp -> case Map.lookup key mp of
-            Just bar -> return $ (,) mp $ do
-                res <- liftIO $ testFence bar
-                (res,offset) <- case res of
-                    Just res -> return (res, 0)
-                    Nothing -> do
-                        pool <- Action $ getsRO globalPool
-                        offset <- liftIO offsetTime
-                        Action $ captureRAW $ \k -> waitFence bar $ \v ->
-                            addPool pool $ do offset <- liftIO offset; k $ Right (v,offset)
-                case res of
-                    Left err -> Action $ throwRAW err
-                    Right (deps,v) -> do
-                        Action $ modifyRW $ \s -> s{localDepends = deps ++ localDepends s, localDiscount = localDiscount s + offset}
-                        return v
-            Nothing -> do
-                bar <- newFence
-                return $ (,) (Map.insert key bar mp) $ do
-                    pre <- Action $ getsRW localDepends
-                    res <- Action $ tryRAW $ fromAction $ act key
-                    case res of
-                        Left err -> do
-                            liftIO $ signalFence bar $ Left err
-                            Action $ throwRAW err
-                        Right v -> do
-                            post <- Action $ getsRW localDepends
-                            let deps = take (length post - length pre) post
-                            liftIO $ signalFence bar $ Right (deps, v)
-                            return v
-
--- | Given an action on a key, produce a cached version that will execute the action at most once per key.
---   Using the cached result will still result include any dependencies that the action requires.
---   Each call to 'newCache' creates a separate cache that is independent of all other calls to 'newCache'.
---
---   This function is useful when creating files that store intermediate values,
---   to avoid the overhead of repeatedly reading from disk, particularly if the file requires expensive parsing.
---   As an example:
---
--- @
--- digits \<- 'newCache' $ \\file -> do
---     src \<- readFile\' file
---     return $ length $ filter isDigit src
--- \"*.digits\" 'Development.Shake.%>' \\x -> do
---     v1 \<- digits ('dropExtension' x)
---     v2 \<- digits ('dropExtension' x)
---     'Development.Shake.writeFile'' x $ show (v1,v2)
--- @
---
---   To create the result @MyFile.txt.digits@ the file @MyFile.txt@ will be read and counted, but only at most
---   once per execution.
-newCache :: (Eq k, Hashable k) => (k -> Action v) -> Rules (k -> Action v)
-newCache = liftIO . newCacheIO
-
-
--- | Run an action without counting to the thread limit, typically used for actions that execute
---   on remote machines using barely any local CPU resources.
---   Unsafe as it allows the 'shakeThreads' limit to be exceeded.
---   You cannot depend on a rule (e.g. 'need') while the extra thread is executing.
---   If the rule blocks (e.g. calls 'withResource') then the extra thread may be used by some other action.
---   Only really suitable for calling 'cmd'/'command'.
-unsafeExtraThread :: Action a -> Action a
-unsafeExtraThread act = Action $ do
-    Global{..} <- getRO
-    stop <- liftIO $ increasePool globalPool
-    res <- tryRAW $ fromAction $ blockApply "Within unsafeExtraThread" act
-    liftIO stop
-    captureRAW $ \continue -> (if isLeft res then addPoolPriority else addPool) globalPool $ continue res
-
-
--- | Execute a list of actions in parallel. In most cases 'need' will be more appropriate to benefit from parallelism.
-parallel :: [Action a] -> Action [a]
-parallel [] = return []
-parallel [x] = fmap return x
-parallel acts = Action $ do
-    global@Global{..} <- getRO
-    local <- getRW
-    -- number of items still to complete, or Nothing for has completed (by either failure or completion)
-    todo :: Var (Maybe Int) <- liftIO $ newVar $ Just $ length acts
-    -- a list of refs where the results go
-    results :: [IORef (Maybe (Either SomeException (Local, a)))] <- liftIO $ replicateM (length acts) $ newIORef Nothing
-
-    (locals, results) <- captureRAW $ \continue -> do
-        let resume = do
-                res <- liftIO $ sequence . catMaybes <$> mapM readIORef results
-                continue $ fmap unzip res
-
-        liftIO $ forM_ (zip acts results) $ \(act, result) -> do
-            let act2 = do
-                    b <- liftIO $ isJust <$> readVar todo
-                    when (not b) $ fail "parallel, one has already failed"
-                    res <- act
-                    old <- Action getRW
-                    return (old, res)
-            addPool globalPool $ runAction global local act2 $ \res -> do
-                writeIORef result $ Just res
-                modifyVar_ todo $ \v -> case v of
-                    Nothing -> return Nothing
-                    Just i | i == 1 || isLeft res -> do resume; return Nothing
-                    Just i -> return $ Just $ i - 1
-
-    -- don't construct with RecordWildCards so any new fields raise an error
-    modifyRW $ \root -> Local
-        -- immutable/stack that need copying
-        {localStack = localStack root
-        ,localVerbosity = localVerbosity root
-        ,localBlockApply = localBlockApply root
-        -- mutable locals that need integrating
-        ,localDepends = localDepends root ++ concatMap localDepends locals
-        ,localDiscount = localDiscount root + maximum (0:map localDiscount locals)
-        ,localTraces = localTraces root ++ concatMap localTraces locals
-        ,localTrackAllows = localTrackAllows root ++ concatMap localTrackAllows locals
-        ,localTrackUsed = localTrackUsed root ++ concatMap localTrackUsed locals
-        }
-    return results
-
--- | Run an action but do not depend on anything the action uses.
---   A more general version of 'orderOnly'.
-orderOnlyAction :: Action a -> Action a
-orderOnlyAction act = Action $ do
-    pre <- getsRW localDepends
-    res <- fromAction act
-    modifyRW $ \s -> s{localDepends=pre}
-    return res
diff --git a/src/Development/Shake/Database.hs b/src/Development/Shake/Database.hs
--- a/src/Development/Shake/Database.hs
+++ b/src/Development/Shake/Database.hs
@@ -1,557 +1,151 @@
-{-# LANGUAGE RecordWildCards, PatternGuards, ViewPatterns #-}
-{-# LANGUAGE MultiParamTypeClasses #-}
-{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE RecordWildCards #-}
 
+-- | Lower-level primitives to drive Shake, which are wrapped into the
+--   'Development.Shake.shake' function. Useful if you want to perform multiple Shake
+--   runs in a row without reloading from the database.
+--   Sometimes used in conjunction with @'shakeFiles'=\"\/dev\/null\"@.
+--   Using these functions you can approximate the 'Development.Shake.shake' experience with:
+--
+-- @
+-- shake opts rules = do
+--     (_, after) \<- 'shakeWithDatabase' opts rules $ \\db -> do
+--         'shakeOneShotDatabase' db
+--         'shakeRunDatabase' db []
+--     'shakeRunAfter' opts after
+-- @
 module Development.Shake.Database(
-    Trace(..),
-    Database, withDatabase, assertFinishedDatabase,
-    listDepends, lookupDependencies,
-    Ops(..), build, Depends,
-    progress,
-    Stack, emptyStack, topStack, showStack, showTopStack,
-    toReport, checkValid, listLive
+    ShakeDatabase,
+    shakeOpenDatabase,
+    shakeWithDatabase,
+    shakeOneShotDatabase,
+    shakeRunDatabase,
+    shakeLiveFilesDatabase,
+    shakeProfileDatabase,
+    shakeErrorsDatabase,
+    shakeRunAfter
     ) where
 
-import Development.Shake.Classes
-import General.Binary
-import Development.Shake.Pool
-import Development.Shake.Value
-import Development.Shake.Errors
-import Development.Shake.Storage
-import Development.Shake.Types
-import Development.Shake.Special
-import Development.Shake.Profile
-import Development.Shake.Monad
-import General.String
-import General.Intern as Intern
-
-import Numeric.Extra
-import Control.Applicative
-import Control.Exception
-import Control.Monad.Extra
 import Control.Concurrent.Extra
-import qualified Data.HashSet as Set
-import qualified Data.HashMap.Strict as Map
-import Data.IORef.Extra
-import Data.Maybe
-import Data.List
-import System.Time.Extra
-import Data.Monoid
-import Prelude
-
-type Map = Map.HashMap
-
-
----------------------------------------------------------------------
--- UTILITY TYPES
-
-newtype Step = Step Word32 deriving (Eq,Ord,Show,Binary,NFData,Hashable,Typeable)
-
-incStep (Step i) = Step $ i + 1
-
-
----------------------------------------------------------------------
--- CALL STACK
-
-data Stack = Stack (Maybe Key) [Id] !(Set.HashSet Id)
-
-showStack :: Database -> Stack -> IO [String]
-showStack Database{..} (Stack _ xs _) = do
-    status <- withLock lock $ readIORef status
-    return $ reverse $ map (maybe "<unknown>" (show . fst) . flip Map.lookup status) xs
-
-addStack :: Id -> Key -> Stack -> Stack
-addStack x key (Stack _ xs set) = Stack (Just key) (x:xs) (Set.insert x set)
-
-showTopStack :: Stack -> String
-showTopStack = maybe "<unknown>" show . topStack
-
-topStack :: Stack -> Maybe Key
-topStack (Stack key _ _) = key
-
-checkStack :: [Id] -> Stack -> Maybe Id
-checkStack new (Stack _ old set)
-    | bad:_ <- filter (`Set.member` set) new = Just bad
-    | otherwise = Nothing
-
-emptyStack :: Stack
-emptyStack = Stack Nothing [] Set.empty
-
-
----------------------------------------------------------------------
--- CENTRAL TYPES
-
-data Trace = Trace BS Float Float -- ^ (message, start, end)
-    deriving Show
-
-instance NFData Trace where
-    rnf (Trace a b c) = rnf a `seq` rnf b `seq` rnf c
-
-type StatusDB = IORef (Map Id (Key, Status))
-type InternDB = IORef (Intern Key)
-
--- | Invariant: The database does not have any cycles where a Key depends on itself
-data Database = Database
-    {lock :: Lock
-    ,intern :: InternDB
-    ,status :: StatusDB
-    ,step :: Step
-    ,journal :: Id -> (Key, Status {- Loaded or Missing -}) -> IO ()
-    ,diagnostic :: String -> IO () -- ^ logging function
-    ,assume :: Maybe Assume
-    }
-
-data Status
-    = Ready Result -- ^ I have a value
-    | Error SomeException -- ^ I have been run and raised an error
-    | Loaded Result -- ^ Loaded from the database
-    | Waiting Pending (Maybe Result) -- ^ Currently checking if I am valid or building
-    | Missing -- ^ I am only here because I got into the Intern table
-      deriving Show
-
-data Result = Result
-    {result :: Value -- ^ the result associated with the Key
-    ,built :: {-# UNPACK #-} !Step -- ^ when it was actually run
-    ,changed :: {-# UNPACK #-} !Step -- ^ the step for deciding if it's valid
-    ,depends :: [[Id]] -- ^ dependencies (don't run them early)
-    ,execution :: {-# UNPACK #-} !Float -- ^ how long it took when it was last run (seconds)
-    ,traces :: [Trace] -- ^ a trace of the expensive operations (start/end in seconds since beginning of run)
-    } deriving Show
-
-
-newtype Pending = Pending (IORef (IO ()))
-    -- you must run this action when you finish, while holding DB lock
-    -- after you have set the result to Error or Ready
-
-instance Show Pending where show _ = "Pending"
-
-
-statusType Ready{} = "Ready"
-statusType Error{} = "Error"
-statusType Loaded{} = "Loaded"
-statusType Waiting{} = "Waiting"
-statusType Missing{} = "Missing"
-
-isError Error{} = True; isError _ = False
-isWaiting Waiting{} = True; isWaiting _ = False
-isReady Ready{} = True; isReady _ = False
-
-
--- All the waiting operations are only valid when isWaiting
-type Waiting = Status
-
-afterWaiting :: Waiting -> IO () -> IO ()
-afterWaiting (Waiting (Pending p) _) act = modifyIORef' p (>> act)
-
-newWaiting :: Maybe Result -> IO Waiting
-newWaiting r = do ref <- newIORef $ return (); return $ Waiting (Pending ref) r
-
-runWaiting :: Waiting -> IO ()
-runWaiting (Waiting (Pending p) _) = join $ readIORef p
-
--- | Wait for a set of actions to complete.
---   If the action returns True, the function will not be called again.
---   If the first argument is True, the thing is ended.
-waitFor :: [(a, Waiting)] -> (Bool -> a -> IO Bool) -> IO ()
-waitFor ws@(_:_) act = do
-    todo <- newIORef $ length ws
-    forM_ ws $ \(k,w) -> afterWaiting w $ do
-        t <- readIORef todo
-        when (t /= 0) $ do
-            b <- act (t == 1) k
-            writeIORef' todo $ if b then 0 else t - 1
-
-
-getResult :: Status -> Maybe Result
-getResult (Ready r) = Just r
-getResult (Loaded r) = Just r
-getResult (Waiting _ r) = r
-getResult _ = Nothing
-
-
----------------------------------------------------------------------
--- OPERATIONS
-
-newtype Depends = Depends {fromDepends :: [Id]}
-    deriving (NFData)
-
-
-data Ops = Ops
-    {stored :: Key -> IO (Maybe Value)
-        -- ^ Given a Key, find the value stored on disk
-    ,equal :: Key -> Value -> Value -> EqualCost
-        -- ^ Given both Values, see if they are equal and how expensive that check was
-    ,execute :: Stack -> Key -> Capture (Either SomeException (Value, [Depends], Seconds, [Trace]))
-        -- ^ Given a stack and a key, either raise an exception or successfully build it
-    }
-
-
-internKey :: InternDB -> StatusDB -> Key -> IO Id
-internKey intern status k = do
-    is <- readIORef intern
-    case Intern.lookup k is of
-        Just i -> return i
-        Nothing -> do
-            (is, i) <- return $ Intern.add k is
-            writeIORef' intern is
-            modifyIORef' status $ Map.insert i (k,Missing)
-            return i
-
-queryKey :: StatusDB -> Id -> IO (Maybe (Key, Status))
-queryKey status i = Map.lookup i <$> readIORef status
-
--- | Return either an exception (crash), or (how much time you spent waiting, the value)
-build :: Pool -> Database -> Ops -> Stack -> [Key] -> Capture (Either SomeException (Seconds,Depends,[Value]))
-build pool database@Database{..} Ops{..} stack ks continue =
-    join $ withLock lock $ do
-        is <- forM ks $ internKey intern status
-
-        whenJust (checkStack is stack) $ \bad -> do
-            -- everything else gets thrown via Left and can be Staunch'd
-            -- recursion in the rules is considered a worse error, so fails immediately
-            status <- readIORef status
-            let Stack _ xs _ = stack
-            stack <- return $ reverse $ map (maybe "<unknown>" (show . fst) . flip Map.lookup status) $ bad:xs
-            (tk, tname) <- return $ case Map.lookup bad status of
-                Nothing -> (Nothing, Nothing)
-                Just (k,_) -> (Just $ typeKey k, Just $ show k)
-            errorRuleRecursion stack tk tname
-
-        vs <- mapM (reduce stack) is
-        let errs = [e | Error e <- vs]
-        if all isReady vs then
-            return $ continue $ Right (0, Depends is, [result r | Ready r <- vs])
-         else if not $ null errs then
-            return $ continue $ Left $ head errs
-         else do
-            time <- offsetTime
-            let done x = do
-                    case x of
-                        Left e -> addPoolPriority pool $ continue $ Left e
-                        Right v -> addPool pool $ do dur <- time; continue $ Right (dur, Depends is, v)
-                    return True
-            waitFor (filter (isWaiting . snd) $ zip is vs) $ \finish i -> do
-                s <- readIORef status
-                case Map.lookup i s of
-                    Just (_, Error e) -> done $ Left e -- on error make sure we immediately kick off our parent
-                    Just (_, Ready{}) | finish -> done $ Right [result r | i <- is, let Ready r = snd $ fromJust $ Map.lookup i s]
-                                      | otherwise -> return False
-            return $ return ()
-    where
-        (#=) :: Id -> (Key, Status) -> IO Status
-        i #= (k,v) = do
-            s <- readIORef status
-            writeIORef' status $ Map.insert i (k,v) s
-            diagnostic $ maybe "Missing" (statusType . snd) (Map.lookup i s) ++ " -> " ++ statusType v ++ ", " ++ maybe "<unknown>" (show . fst) (Map.lookup i s)
-            return v
-
-        atom x = let s = show x in if ' ' `elem` s then "(" ++ s ++ ")" else s
-
-        -- Rules for each eval* function
-        -- * Must NOT lock
-        -- * Must have an equal return to what is stored in the db at that point
-        -- * Must not return Loaded
-
-        reduce :: Stack -> Id -> IO Status
-        reduce stack i = do
-            s <- queryKey status i
-            case s of
-                Nothing -> err $ "interned value missing from database, " ++ show i
-                Just (k, Missing) -> run stack i k Nothing
-                Just (k, Loaded r) -> do
-                    let out b = diagnostic $ "valid " ++ show b ++ " for " ++ atom k ++ " " ++ atom (result r)
-                    let continue r = out True >> check stack i k r (depends r)
-                    let rebuild = out False >> run stack i k (Just r)
-                    case assume of
-                        Just AssumeDirty -> rebuild
-                        Just AssumeSkip -> continue r
-                        _ -> do
-                            s <- stored k
-                            case s of
-                                Just s -> case equal k (result r) s of
-                                    NotEqual -> rebuild
-                                    EqualCheap -> continue r
-                                    EqualExpensive -> do
-                                        -- warning, have the db lock while appending (may harm performance)
-                                        r <- return r{result=s}
-                                        journal i (k, Loaded r)
-                                        i #= (k, Loaded r)
-                                        continue r
-                                _ -> rebuild
-                Just (k, res) -> return res
-
-        run :: Stack -> Id -> Key -> Maybe Result -> IO Waiting
-        run stack i k r = do
-            w <- newWaiting r
-            addPool pool $ do
-                let reply res = do
-                        ans <- withLock lock $ do
-                            ans <- i #= (k, res)
-                            runWaiting w
-                            return ans
-                        case ans of
-                            Ready r -> do
-                                diagnostic $ "result " ++ atom k ++ " = "++ atom (result r) ++
-                                             " " ++ (if built r == changed r then "(changed)" else "(unchanged)")
-                                journal i (k, Loaded r) -- we leave the DB lock before appending
-                            Error _ -> do
-                                diagnostic $ "result " ++ atom k ++ " = error"
-                                journal i (k, Missing)
-                            _ -> return ()
-                let norm = execute (addStack i k stack) k $ \res ->
-                        reply $ case res of
-                            Left err -> Error err
-                            Right (v,deps,(doubleToFloat -> execution),traces) ->
-                                let c | Just r <- r, equal k (result r) v /= NotEqual = changed r
-                                      | otherwise = step
-                                in Ready Result{result=v,changed=c,built=step,depends=map fromDepends deps,..}
-
-                case r of
-                    Just r | assume == Just AssumeClean -> do
-                            v <- stored k
-                            case v of
-                                Just v -> reply $ Ready r{result=v}
-                                Nothing -> norm
-                    _ -> norm
-            i #= (k, w)
-
-        check :: Stack -> Id -> Key -> Result -> [[Id]] -> IO Status
-        check stack i k r [] =
-            i #= (k, Ready r)
-        check stack i k r (ds:rest) = do
-            vs <- mapM (reduce (addStack i k stack)) ds
-            let ws = filter (isWaiting . snd) $ zip ds vs
-            if any isError vs || any (> built r) [changed | Ready Result{..} <- vs] then
-                run stack i k $ Just r
-             else if null ws then
-                check stack i k r rest
-             else do
-                self <- newWaiting $ Just r
-                waitFor ws $ \finish d -> do
-                    s <- readIORef status
-                    let buildIt = do
-                            b <- run stack i k $ Just r
-                            afterWaiting b $ runWaiting self
-                            return True
-                    case Map.lookup d s of
-                        Just (_, Error{}) -> buildIt
-                        Just (_, Ready r2)
-                            | changed r2 > built r -> buildIt
-                            | finish -> do
-                                res <- check stack i k r rest
-                                if not $ isWaiting res
-                                    then runWaiting self
-                                    else afterWaiting res $ runWaiting self
-                                return True
-                            | otherwise -> return False
-                i #= (k, self)
-
-
----------------------------------------------------------------------
--- PROGRESS
-
-progress :: Database -> IO Progress
-progress Database{..} = do
-    s <- readIORef status
-    return $ foldl' f mempty $ map snd $ Map.elems s
-    where
-        g = floatToDouble
-
-        f s (Ready Result{..}) = if step == built
-            then s{countBuilt = countBuilt s + 1, timeBuilt = timeBuilt s + g execution}
-            else s{countSkipped = countSkipped s + 1, timeSkipped = timeSkipped s + g execution}
-        f s (Loaded Result{..}) = s{countUnknown = countUnknown s + 1, timeUnknown = timeUnknown s + g execution}
-        f s (Waiting _ r) =
-            let (d,c) = timeTodo s
-                t | Just Result{..} <- r = let d2 = d + g execution in d2 `seq` (d2,c)
-                  | otherwise = let c2 = c + 1 in c2 `seq` (d,c2)
-            in s{countTodo = countTodo s + 1, timeTodo = t}
-        f s _ = s
-
-
----------------------------------------------------------------------
--- QUERY DATABASE
-
-assertFinishedDatabase :: Database -> IO ()
-assertFinishedDatabase Database{..} = do
-    -- if you have anyone Waiting, and are not exiting with an error, then must have a complex recursion (see #400)
-    status <- readIORef status
-    let bad = [key | (_, (key, Waiting{})) <- Map.toList status]
-    when (bad /= []) $
-        errorComplexRecursion (map show bad)
-
-
--- | Given a map of representing a dependency order (with a show for error messages), find an ordering for the items such
---   that no item points to an item before itself.
---   Raise an error if you end up with a cycle.
-dependencyOrder :: (Eq a, Hashable a) => (a -> String) -> Map a [a] -> [a]
--- Algorithm:
---    Divide everyone up into those who have no dependencies [Id]
---    And those who depend on a particular Id, Dep :-> Maybe [(Key,[Dep])]
---    Where d :-> Just (k, ds), k depends on firstly d, then remaining on ds
---    For each with no dependencies, add to list, then take its dep hole and
---    promote them either to Nothing (if ds == []) or into a new slot.
---    k :-> Nothing means the key has already been freed
-dependencyOrder shw status = f (map fst noDeps) $ Map.map Just $ Map.fromListWith (++) [(d, [(k,ds)]) | (k,d:ds) <- hasDeps]
-    where
-        (noDeps, hasDeps) = partition (null . snd) $ Map.toList status
-
-        f [] mp | null bad = []
-                | otherwise = error $ unlines $
-                    "Internal invariant broken, database seems to be cyclic" :
-                    map ("    " ++) bad ++
-                    ["... plus " ++ show (length badOverflow) ++ " more ..." | not $ null badOverflow]
-            where (bad,badOverflow) = splitAt 10 [shw i | (i, Just _) <- Map.toList mp]
-
-        f (x:xs) mp = x : f (now++xs) later
-            where Just free = Map.lookupDefault (Just []) x mp
-                  (now,later) = foldl' g ([], Map.insert x Nothing mp) free
-
-        g (free, mp) (k, []) = (k:free, mp)
-        g (free, mp) (k, d:ds) = case Map.lookupDefault (Just []) d mp of
-            Nothing -> g (free, mp) (k, ds)
-            Just todo -> (free, Map.insert d (Just $ (k,ds) : todo) mp)
-
-
--- | Eliminate all errors from the database, pretending they don't exist
-resultsOnly :: Map Id (Key, Status) -> Map Id (Key, Result)
-resultsOnly mp = Map.map (\(k, v) -> (k, let Just r = getResult v in r{depends = map (filter (isJust . flip Map.lookup keep)) $ depends r})) keep
-    where keep = Map.filter (isJust . getResult . snd) mp
-
-removeStep :: Map Id (Key, Result) -> Map Id (Key, Result)
-removeStep = Map.filter (\(k,_) -> k /= stepKey)
-
-toReport :: Database -> IO [ProfileEntry]
-toReport Database{..} = do
-    status <- (removeStep . resultsOnly) <$> readIORef status
-    let order = let shw i = maybe "<unknown>" (show . fst) $ Map.lookup i status
-                in dependencyOrder shw $ Map.map (concat . depends . snd) status
-        ids = Map.fromList $ zip order [0..]
-
-        steps = let xs = Set.toList $ Set.fromList $ concat [[changed, built] | (_,Result{..}) <- Map.elems status]
-                in Map.fromList $ zip (sortBy (flip compare) xs) [0..]
-
-        f (k, Result{..}) = ProfileEntry
-            {prfName = show k
-            ,prfBuilt = fromStep built
-            ,prfChanged = fromStep changed
-            ,prfDepends = mapMaybe (`Map.lookup` ids) (concat depends)
-            ,prfExecution = floatToDouble execution
-            ,prfTraces = map fromTrace traces
-            }
-            where fromStep i = fromJust $ Map.lookup i steps
-                  fromTrace (Trace a b c) = ProfileTrace (unpack a) (floatToDouble b) (floatToDouble c)
-    return [maybe (err "toReport") f $ Map.lookup i status | i <- order]
-
-
-checkValid :: Database -> (Key -> IO (Maybe Value)) -> (Key -> Value -> Value -> EqualCost) -> [(Key, Key)] -> IO ()
-checkValid Database{..} stored equal missing = do
-    status <- readIORef status
-    intern <- readIORef intern
-    diagnostic "Starting validity/lint checking"
-
-    -- Do not use a forM here as you use too much stack space
-    bad <- (\f -> foldM f [] (Map.toList status)) $ \seen (i,v) -> case v of
-        (key, Ready Result{..}) -> do
-            now <- stored key
-            let good = maybe False ((==) EqualCheap . equal key result) now
-            diagnostic $ "Checking if " ++ show key ++ " is " ++ show result ++ ", " ++ if good then "passed" else "FAILED"
-            return $ [(key, result, now) | not good && not (specialAlwaysRebuilds result)] ++ seen
-        _ -> return seen
-    unless (null bad) $ do
-        let n = length bad
-        errorStructured
-            ("Lint checking error - " ++ (if n == 1 then "value has" else show n ++ " values have")  ++ " changed since being depended upon")
-            (intercalate [("",Just "")] [ [("Key", Just $ show key),("Old", Just $ show result),("New", Just $ maybe "<missing>" show now)]
-                                        | (key, result, now) <- bad])
-            ""
-
-    bad <- return [(parent,key) | (parent, key) <- missing, isJust $ Intern.lookup key intern]
-    unless (null bad) $ do
-        let n = length bad
-        errorStructured
-            ("Lint checking error - " ++ (if n == 1 then "value" else show n ++ " values") ++ " did not have " ++ (if n == 1 then "its" else "their") ++ " creation tracked")
-            (intercalate [("",Just "")] [ [("Rule", Just $ show parent), ("Created", Just $ show key)] | (parent,key) <- bad])
-            ""
-
-    diagnostic "Validity/lint check passed"
-
-
-listLive :: Database -> IO [Key]
-listLive Database{..} = do
-    diagnostic "Listing live keys"
-    status <- readIORef status
-    return [k | (k, Ready{}) <- Map.elems status]
-
-
-listDepends :: Database -> Depends -> IO [Key]
-listDepends Database{..} (Depends xs) =
-    withLock lock $ do
-        status <- readIORef status
-        return $ map (fst . fromJust . flip Map.lookup status) xs
-
-lookupDependencies :: Database -> Key -> IO [Key]
-lookupDependencies Database{..} k =
-    withLock lock $ do
-        intern <- readIORef intern
-        status <- readIORef status
-        let Just i = Intern.lookup k intern
-        let Just (_, Ready r) = Map.lookup i status
-        return $ map (fst . fromJust . flip Map.lookup status) $ concat $ depends r
+import Control.Exception
+import Control.Monad
+import Control.Monad.IO.Class
+import Data.IORef
+import General.Cleanup
+import Development.Shake.Internal.Errors
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Core.Run
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Rules.Default
 
 
----------------------------------------------------------------------
--- STORAGE
-
--- To simplify journaling etc we smuggle the Step in the database, with a special StepKey
-newtype StepKey = StepKey ()
-    deriving (Show,Eq,Typeable,Hashable,Binary,NFData)
-
-stepKey :: Key
-stepKey = newKey $ StepKey ()
-
-toStepResult :: Step -> Result
-toStepResult i = Result (newValue i) i i [] 0 []
+data UseState
+    = Closed
+    | Using String
+    | Open {openOneShot :: Bool, openRequiresReset :: Bool}
 
-fromStepResult :: Result -> Step
-fromStepResult = fromValue . result
+-- | The type of an open Shake database. Created with
+--   'shakeOpenDatabase' or 'shakeWithDatabase'. Used with
+--   'shakeRunDatabase'. You may not execute simultaneous calls using 'ShakeDatabase'
+--   on separate threads (it will raise an error).
+data ShakeDatabase = ShakeDatabase (Var UseState) RunState
 
+-- | Given some options and rules, return a pair. The first component opens the database,
+--   the second cleans it up. The creation /does not/ need to be run masked, because the
+--   cleanup is able to run at any point. Most users should prefer 'shakeWithDatabase'
+--   which handles exceptions duration creation properly.
+shakeOpenDatabase :: ShakeOptions -> Rules () -> IO (IO ShakeDatabase, IO ())
+shakeOpenDatabase opts rules = do
+    (cleanup, clean) <- newCleanup
+    use <- newVar $ Open False False
+    let alloc =
+            withOpen use "shakeOpenDatabase" id $ \_ ->
+                ShakeDatabase use <$> open cleanup opts (rules >> defaultRules)
+    let free = do
+            modifyVar_ use $ \case
+                    Using s -> throwM $ errorStructured "Error when calling shakeOpenDatabase close function, currently running" [("Existing call", Just s)] ""
+                    _ -> pure Closed
+            clean
+    pure (alloc, free)
 
-withDatabase :: ShakeOptions -> (String -> IO ()) -> (Database -> IO a) -> IO a
-withDatabase opts diagnostic act = do
-    registerWitness $ StepKey ()
-    registerWitness $ Step 0
-    witness <- currentWitness
-    withStorage opts diagnostic witness $ \mp2 journal -> do
-        let mp1 = Intern.fromList [(k, i) | (i, (k,_)) <- Map.toList mp2]
+withOpen :: Var UseState -> String -> (UseState -> UseState) -> (UseState -> IO a) -> IO a
+withOpen var name final act = mask $ \restore -> do
+    o <- modifyVar var $ \case
+        Using s -> throwM $ errorStructured ("Error when calling " ++ name ++ ", currently running") [("Existing call", Just s)] ""
+        Closed -> throwM $ errorStructured ("Error when calling " ++ name ++ ", already closed") [] ""
+        o@Open{} -> pure (Using name, o)
+    let clean = writeVar var $ final o
+    res <- restore (act o) `onException` clean
+    clean
+    pure res
 
-        (mp1, stepId) <- case Intern.lookup stepKey mp1 of
-            Just stepId -> return (mp1, stepId)
-            Nothing -> do
-                (mp1, stepId) <- return $ Intern.add stepKey mp1
-                return (mp1, stepId)
+-- | Declare that a just-openned database will be used to call 'shakeRunDatabase' at most once.
+--   If so, an optimisation can be applied to retain less memory.
+shakeOneShotDatabase :: ShakeDatabase -> IO ()
+shakeOneShotDatabase (ShakeDatabase use _) =
+    withOpen use "shakeOneShotDatabase" (\o -> o{openOneShot=True}) $ \_ -> pure ()
 
-        intern <- newIORef mp1
-        status <- newIORef mp2
-        let step = case Map.lookup stepId mp2 of
-                        Just (_, Loaded r) -> incStep $ fromStepResult r
-                        _ -> Step 1
-        journal stepId (stepKey, Loaded $ toStepResult step)
-        lock <- newLock
-        act Database{assume=shakeAssume opts,..}
+-- | Given some options and rules, create a 'ShakeDatabase' that can be used to run
+--   executions.
+shakeWithDatabase :: ShakeOptions -> Rules () -> (ShakeDatabase -> IO a) -> IO a
+shakeWithDatabase opts rules act = do
+    (db, clean) <- shakeOpenDatabase opts rules
+    (act =<< db) `finally` clean
 
+-- | Given a 'ShakeDatabase', what files did the execution ensure were up-to-date
+--   in the previous call to 'shakeRunDatabase'. Corresponds to the list of files
+--   written out to 'shakeLiveFiles'.
+shakeLiveFilesDatabase :: ShakeDatabase -> IO [FilePath]
+shakeLiveFilesDatabase (ShakeDatabase use s) =
+    withOpen use "shakeLiveFilesDatabase" id $ \_ ->
+        liveFilesState s
 
-instance BinaryWith Witness Result where
-    putWith ws (Result x1 x2 x3 x4 x5 x6) = putWith ws x1 >> put x2 >> put x3 >> put (BinList $ map BinList x4) >> put (BinFloat x5) >> put (BinList x6)
-    getWith ws = (\x1 x2 x3 (BinList x4) (BinFloat x5) (BinList x6) -> Result x1 x2 x3 (map fromBinList x4) x5 x6) <$>
-        getWith ws <*> get <*> get <*> get <*> get <*> get
+-- | Given a 'ShakeDatabase', generate profile information to the given file about the latest run.
+--   See 'shakeReport' for the types of file that can be generated.
+shakeProfileDatabase :: ShakeDatabase -> FilePath -> IO ()
+shakeProfileDatabase (ShakeDatabase use s) file =
+    withOpen use "shakeProfileDatabase" id $ \_ ->
+        profileState s file
 
-instance Binary Trace where
-    put (Trace a b c) = put a >> put (BinFloat b) >> put (BinFloat c)
-    get = (\a (BinFloat b) (BinFloat c) -> Trace a b c) <$> get <*> get <*> get
+-- | Given a 'ShakeDatabase', what files did the execution reach an error on last time.
+--   Some special considerations when using this function:
+--
+-- * The presence of an error does not mean the build will fail, specifically if a
+--   previously required dependency was run and raised an error, then the thing that previously
+--   required it will be run. If the build system has changed in an untracked manner,
+--   the build may succeed this time round.
+--
+-- * If the previous run actually failed then 'shakeRunDatabase' will have thrown an exception.
+--   You probably want to catch that exception so you can make the call to 'shakeErrorsDatabase'.
+--
+-- * You may see a single failure reported multiple times, with increasingly large call stacks, showing
+--   the ways in which the error lead to further errors throughout.
+--
+-- * The 'SomeException' values are highly likely to be of type 'ShakeException'.
+--
+-- * If you want as many errors as possible in one run set @'shakeStaunch'=True@.
+shakeErrorsDatabase :: ShakeDatabase -> IO [(String, SomeException)]
+shakeErrorsDatabase (ShakeDatabase use s) =
+    withOpen use "shakeErrorsDatabase" id $ \_ ->
+        errorsState s
 
-instance BinaryWith Witness Status where
-    putWith ctx Missing = putWord8 0
-    putWith ctx (Loaded x) = putWord8 1 >> putWith ctx x
-    putWith ctx x = err $ "putWith, Cannot write Status with constructor " ++ statusType x
-    getWith ctx = do i <- getWord8; if i == 0 then return Missing else Loaded <$> getWith ctx
+-- | Given an open 'ShakeDatabase', run both whatever actions were added to the 'Rules',
+--   plus the list of 'Action' given here. Returns the results from the explicitly passed
+--   actions along with a list of actions to run after the database was closed, as added with
+--   'Development.Shake.runAfter' and 'Development.Shake.removeFilesAfter'.
+shakeRunDatabase :: ShakeDatabase -> [Action a] -> IO ([a], [IO ()])
+shakeRunDatabase (ShakeDatabase use s) as =
+    withOpen use "shakeRunDatabase" (\o -> o{openRequiresReset=True}) $ \Open{..} -> do
+        when openRequiresReset $ do
+            when openOneShot $
+                throwM $ errorStructured "Error when calling shakeRunDatabase twice, after calling shakeOneShotDatabase" [] ""
+            reset s
+        (refs, as) <- fmap unzip $ forM as $ \a -> do
+            ref <- newIORef Nothing
+            pure (ref, liftIO . writeIORef ref . Just =<< a)
+        after <- run s openOneShot $ map void as
+        results <- mapM readIORef refs
+        case sequence results of
+            Just result -> pure (result, after)
+            Nothing -> throwM $ errorInternal "Expected all results were written, but some where not"
diff --git a/src/Development/Shake/Demo.hs b/src/Development/Shake/Demo.hs
deleted file mode 100644
--- a/src/Development/Shake/Demo.hs
+++ /dev/null
@@ -1,136 +0,0 @@
-
--- | Demo tutorial, accessed with --demo
-module Development.Shake.Demo(demo) where
-
-import Paths_shake
-import Development.Shake.Command
-
-import Control.Applicative
-import Control.Exception.Extra
-import Control.Monad
-import Data.Char
-import Data.List
-import Data.Maybe
-import Data.Version(showVersion)
-import System.Directory
-import System.Exit
-import System.FilePath
-import Development.Shake.FilePath(exe)
-import System.IO
-import System.Info.Extra
-import Prelude
-
-
-demo :: Bool -> IO ()
-demo auto = do
-    hSetBuffering stdout NoBuffering
-    putStrLn $ "% Welcome to the Shake v" ++ showVersion version ++ " demo mode!"
-    putStr "% Detecting machine configuration... "
-
-    -- CONFIGURE
-
-    manual <- getDataFileName "docs/manual"
-    hasManual <- wrap $ doesDirectoryExist manual
-    ghc <- findExecutable "ghc"
-    gcc <- do
-        v <- findExecutable "gcc"
-        case v of
-            Nothing | isWindows, Just ghc <- ghc -> do
-                let dir = takeDirectory (takeDirectory ghc) </> "bin/mingw/gcc.exe"
-                b <- wrap $ doesFileExist dir
-                return $ if b then Just dir else Nothing
-            _ -> return v
-    shakeLib <- wrap $ fmap (not . null . words . fromStdout) (cmd "ghc-pkg list --simple-output shake")
-    ninja <- findExecutable "ninja"
-    putStrLn "done\n"
-
-    let path = if isWindows then "%PATH%" else "$PATH"
-    require (isJust ghc) $ "% You don't have 'ghc' on your " ++ path ++ ", which is required to run the demo."
-    require (isJust gcc) $ "% You don't have 'gcc' on your " ++ path ++ ", which is required to run the demo."
-    require shakeLib "% You don't have the 'shake' library installed with GHC, which is required to run the demo."
-    require hasManual "% You don't have the Shake data files installed, which are required to run the demo."
-
-    empty <- (not . any (not . all (== '.'))) <$> getDirectoryContents "."
-    dir <- if empty then getCurrentDirectory else do
-        home <- getHomeDirectory
-        dir <- getDirectoryContents home
-        return $ home </> head (map ("shake-demo" ++) ("":map show [2..]) \\ dir)
-
-    putStrLn "% The Shake demo uses an empty directory, OK to use:"
-    putStrLn $ "%     " ++ dir
-    b <- yesNo auto
-    require b "% Please create an empty directory to run the demo from, then run 'shake --demo' again."
-
-    putStr "% Copying files... "
-    createDirectoryIfMissing True dir
-    forM_ ["Build.hs","main.c","constants.c","constants.h","build" <.> if isWindows then "bat" else "sh"] $ \file ->
-        copyFile (manual </> file) (dir </> file)
-    unless isWindows $ do
-         p <- getPermissions $ dir </> "build.sh"
-         setPermissions (dir </> "build.sh") p{executable=True}
-    putStrLn "done"
-
-    let pause = do
-            putStr "% Press ENTER to continue: "
-            if auto then putLine "" else getLine
-    let execute x = do
-            putStrLn $ "% RUNNING: " ++ x
-            cmd (Cwd dir) Shell x :: IO ()
-    let build = if isWindows then "build" else "./build.sh"
-
-    putStrLn "\n% [1/5] Building an example project with Shake."
-    pause
-    putStrLn $ "% RUNNING: cd " ++ dir
-    execute build
-
-    putStrLn "\n% [2/5] Running the produced example."
-    pause
-    execute $ "_build" </> "run" <.> exe
-
-    putStrLn "\n% [3/5] Rebuilding an example project with Shake (nothing should change)."
-    pause
-    execute build
-
-    putStrLn "\n% [4/5] Cleaning the build."
-    pause
-    execute $ build ++ " clean"
-
-    putStrLn "\n% [5/5] Rebuilding with 2 threads and profiling."
-    pause
-    execute $ build ++ " -j2 --report --report=-"
-    putStrLn "\n% See the profiling summary above, or look at the HTML profile report in"
-    putStrLn $ "%     " ++ dir </> "report.html"
-
-    putStrLn "\n% Demo complete - all the examples can be run from:"
-    putStrLn $ "%     " ++ dir
-    putStrLn "% For more info see http://shakebuild.com"
-    when (isJust ninja) $ do
-        putStrLn "\n% PS. Shake can also execute Ninja build files"
-        putStrLn "% For more info see http://shakebuild.com/ninja"
-
-
-
--- | Require the user to press @y@ before continuing.
-yesNo :: Bool -> IO Bool
-yesNo auto = do
-    putStr "% [Y/N] (then ENTER): "
-    x <- if auto then putLine "y" else fmap (map toLower) getLine
-    if "y" `isPrefixOf` x then
-        return True
-     else if "n" `isPrefixOf` x then
-        return False
-     else
-        yesNo auto
-
-putLine :: String -> IO String
-putLine x = putStrLn x >> return x
-
-
--- | Replace exceptions with 'False'.
-wrap :: IO Bool -> IO Bool
-wrap act = act `catch_` const (return False)
-
-
--- | Require a condition to be true, or exit with a message.
-require :: Bool -> String -> IO ()
-require b msg = unless b $ putStrLn msg >> exitFailure
diff --git a/src/Development/Shake/Derived.hs b/src/Development/Shake/Derived.hs
deleted file mode 100644
--- a/src/Development/Shake/Derived.hs
+++ /dev/null
@@ -1,191 +0,0 @@
-
-module Development.Shake.Derived(
-    system', systemCwd, systemOutput,
-    copyFile', copyFileChanged,
-    readFile', readFileLines,
-    writeFile', writeFileLines, writeFileChanged,
-    withTempFile, withTempDir,
-    getHashedShakeVersion,
-    par, forP
-    ) where
-
-import Control.Applicative
-import Control.Exception.Extra
-import Control.Monad.Extra
-import Control.Monad.IO.Class
-import System.Process
-import System.Directory
-import System.Exit
-import System.IO.Extra hiding (withTempFile, withTempDir, readFile')
-
-import Development.Shake.Core
-import Development.Shake.Rules.File
-import Development.Shake.FilePath
-import Development.Shake.Types
-import qualified Data.ByteString as BS
-import Data.Hashable
-import Prelude
-
-
--- | Get a checksum of a list of files, suitable for using as `shakeVersion`.
---   This will trigger a rebuild when the Shake rules defined in any of the files are changed.
---   For example:
---
--- @
--- main = do
---     ver <- 'getHashedShakeVersion' [\"Shakefile.hs\"]
---     'shakeArgs' 'shakeOptions'{'shakeVersion' = ver} ...
--- @
---
---   To automatically detect the name of the current file, turn on the @TemplateHaskell@
---   extension and write @$(LitE . StringL . loc_filename \<$\> location)@.
---
---   This feature can be turned off during development by passing
---   the flag @--no-rule-version@ or setting 'shakeVersionIgnore' to 'True'.
-getHashedShakeVersion :: [FilePath] -> IO String
-getHashedShakeVersion files = do
-    hashes <- mapM (fmap (hashWithSalt 0) . BS.readFile) files
-    return $ "hash-" ++ show (hashWithSalt 0 hashes)
-
-
-checkExitCode :: String -> ExitCode -> Action ()
-checkExitCode _ ExitSuccess = return ()
-checkExitCode cmd (ExitFailure i) = liftIO $ errorIO $ "System command failed (code " ++ show i ++ "):\n" ++ cmd
-
-{-# DEPRECATED system' "Use 'command' or 'cmd'" #-}
-{-# DEPRECATED systemCwd "Use 'command' or 'cmd' with 'Cwd'" #-}
-{-# DEPRECATED systemOutput "Use 'command' or 'cmd' with 'Stdout' or 'Stderr'" #-}
-
--- | /Deprecated:/ Please use 'command' or 'cmd' instead.
---   This function will be removed in a future version.
---
---   Execute a system command. This function will raise an error if the exit code is non-zero.
---   Before running 'system'' make sure you 'need' any required files.
-system' :: FilePath -> [String] -> Action ()
-system' path args = do
-    let path2 = toNative path
-    let cmd = unwords $ path2 : args
-    v <- getVerbosity
-    putLoud cmd
-    res <- (if v >= Loud then quietly else id) $ traced (takeBaseName path) $ rawSystem path2 args
-    checkExitCode cmd res
-
-
--- | /Deprecated:/ Please use 'command' or 'cmd' instead, with 'Cwd'.
---   This function will be removed in a future version.
---
---   Execute a system command with a specified current working directory (first argument).
---   This function will raise an error if the exit code is non-zero.
---   Before running 'systemCwd' make sure you 'need' any required files.
---
--- @
--- 'systemCwd' \"\/usr\/MyDirectory\" \"pwd\" []
--- @
-systemCwd :: FilePath -> FilePath -> [String] -> Action ()
-systemCwd cwd path args = do
-    let path2 = toNative path
-    let cmd = unwords $ path2 : args
-    putLoud cmd
-    res <- traced (takeBaseName path) $ do
-        -- FIXME: Should I be using the non-exported System.Process.syncProcess?
-        --        That installs/removes signal handlers.
-        hdl <- runProcess path2 args (Just cwd) Nothing Nothing Nothing Nothing
-        waitForProcess hdl
-    checkExitCode cmd res
-
-
--- | /Deprecated:/ Please use 'command' or 'cmd' instead, with 'Stdout' or 'Stderr'.
---   This function will be removed in a future version.
---
---   Execute a system command, returning @(stdout,stderr)@.
---   This function will raise an error if the exit code is non-zero.
---   Before running 'systemOutput' make sure you 'need' any required files.
-systemOutput :: FilePath -> [String] -> Action (String, String)
-systemOutput path args = do
-    let path2 = toNative path
-    let cmd = unwords $ path2 : args
-    putLoud cmd
-    (res,stdout,stderr) <- traced (takeBaseName path) $ readProcessWithExitCode path2 args ""
-    checkExitCode cmd res
-    return (stdout, stderr)
-
-
--- | @copyFile' old new@ copies the existing file from @old@ to @new@.
---   The @old@ file will be tracked as a dependency.
-copyFile' :: FilePath -> FilePath -> Action ()
-copyFile' old new = do
-    need [old]
-    putLoud $ "Copying from " ++ old ++ " to " ++ new
-    liftIO $ copyFile old new
-
-
--- | @copyFileChanged old new@ copies the existing file from @old@ to @new@, if the contents have changed.
---   The @old@ file will be tracked as a dependency.
-copyFileChanged :: FilePath -> FilePath -> Action ()
-copyFileChanged old new = do
-    need [old]
-    -- in newer versions of the directory package we can use copyFileWithMetadata which (we think) updates
-    -- the timestamp as well and thus no need to read the source file twice.
-    unlessM (liftIO $ doesFileExist new &&^ fileEq old new) $ do
-        putLoud $ "Copying from " ++ old ++ " to " ++ new
-        -- copyFile does a lot of clever stuff with permissions etc, so make sure we just reuse it
-        liftIO $ copyFile old new
-
-
--- | Read a file, after calling 'need'. The argument file will be tracked as a dependency.
-readFile' :: FilePath -> Action String
-readFile' x = need [x] >> liftIO (readFile x)
-
--- | Write a file, lifted to the 'Action' monad.
-writeFile' :: MonadIO m => FilePath -> String -> m ()
-writeFile' name x = liftIO $ writeFile name x
-
-
--- | A version of 'readFile'' which also splits the result into lines.
---   The argument file will be tracked as a dependency.
-readFileLines :: FilePath -> Action [String]
-readFileLines = fmap lines . readFile'
-
--- | A version of 'writeFile'' which writes out a list of lines.
-writeFileLines :: MonadIO m => FilePath -> [String] -> m ()
-writeFileLines name = writeFile' name . unlines
-
-
--- | Write a file, but only if the contents would change.
-writeFileChanged :: MonadIO m => FilePath -> String -> m ()
-writeFileChanged name x = liftIO $ do
-    b <- doesFileExist name
-    if not b then writeFile name x else do
-        -- Cannot use ByteString here, since it has different line handling
-        -- semantics on Windows
-        b <- withFile name ReadMode $ \h -> do
-            src <- hGetContents h
-            return $! src /= x
-        when b $ writeFile name x
-
-
--- | Create a temporary file in the temporary directory. The file will be deleted
---   after the action completes (provided the file is not still open).
---   The 'FilePath' will not have any file extension, will exist, and will be zero bytes long.
---   If you require a file with a specific name, use 'withTempDir'.
-withTempFile :: (FilePath -> Action a) -> Action a
-withTempFile act = do
-    (file, del) <- liftIO newTempFile
-    act file `actionFinally` del
-
-
--- | Create a temporary directory inside the system temporary directory.
---   The directory will be deleted after the action completes.
-withTempDir :: (FilePath -> Action a) -> Action a
-withTempDir act = do
-    (dir,del) <- liftIO newTempDir
-    act dir `actionFinally` del
-
-
--- | A 'parallel' version of 'forM'.
-forP :: [a] -> (a -> Action b) -> Action [b]
-forP xs f = parallel $ map f xs
-
--- | Execute two operations in parallel, based on 'parallel'.
-par :: Action a -> Action b -> Action (a,b)
-par a b = do [Left a, Right b] <- parallel [Left <$> a, Right <$> b]; return (a,b)
diff --git a/src/Development/Shake/Errors.hs b/src/Development/Shake/Errors.hs
deleted file mode 100644
--- a/src/Development/Shake/Errors.hs
+++ /dev/null
@@ -1,151 +0,0 @@
-{-# LANGUAGE DeriveDataTypeable, PatternGuards, RecordWildCards, CPP #-}
-
--- | Errors seen by the user
-module Development.Shake.Errors(
-    ShakeException(..),
-    errorStructured, err,
-    errorNoRuleToBuildType, errorRuleTypeMismatch, errorIncompatibleRules,
-    errorMultipleRulesMatch, errorRuleRecursion, errorComplexRecursion, errorNoApply,
-    errorDirectoryNotFile
-    ) where
-
-import Data.Tuple.Extra
-import Control.Exception.Extra
-import Data.Typeable
-import Data.List
-
-
-err :: String -> a
-err msg = error $ "Development.Shake: Internal error, please report to Neil Mitchell (" ++ msg ++ ")"
-
-alternatives = let (*) = (,) in
-    ["_rule_" * "oracle"
-    ,"_Rule_" * "Oracle"
-    ,"_key_" * "question"
-    ,"_Key_" * "Question"
-    ,"_result_" * "answer"
-    ,"_Result_" * "Answer"
-    ,"_rule/defaultRule_" * "addOracle"
-    ,"_apply_" * "askOracle"]
-
-
-errorStructured :: String -> [(String, Maybe String)] -> String -> IO a
-errorStructured msg args hint = errorIO $ errorStructuredContents msg args hint
-
-errorStructuredContents :: String -> [(String, Maybe String)] -> String -> String
-errorStructuredContents msg args hint = unlines $
-        [msg ++ ":"] ++
-        ["  " ++ a ++ [':' | a /= ""] ++ replicate (as - length a + 2) ' ' ++ b | (a,b) <- args2] ++
-        [hint | hint /= ""]
-    where
-        as = maximum $ 0 : map (length . fst) args2
-        args2 = [(a,b) | (a,Just b) <- args]
-
-
-
-structured :: Bool -> String -> [(String, Maybe String)] -> String -> IO a
-structured alt msg args hint = errorStructured (f msg) (map (first f) args) (f hint)
-    where
-        f = filter (/= '_') . (if alt then g else id)
-        g xs | (a,b):_ <- filter (\(a,b) -> a `isPrefixOf` xs) alternatives = b ++ g (drop (length a) xs)
-        g (x:xs) = x : g xs
-        g [] = []
-
-
-errorDirectoryNotFile :: FilePath -> IO a
-errorDirectoryNotFile dir = errorStructured
-    "Build system error - expected a file, got a directory"
-    [("Directory", Just dir)]
-    "Probably due to calling 'need' on a directory. Shake only permits 'need' on files."
-
-errorNoRuleToBuildType :: TypeRep -> Maybe String -> Maybe TypeRep -> IO a
-errorNoRuleToBuildType tk k tv = structured (specialIsOracleKey tk)
-    "Build system error - no _rule_ matches the _key_ type"
-    [("_Key_ type", Just $ show tk)
-    ,("_Key_ value", k)
-    ,("_Result_ type", fmap show tv)]
-    "Either you are missing a call to _rule/defaultRule_, or your call to _apply_ has the wrong _key_ type"
-
-errorRuleTypeMismatch :: TypeRep -> Maybe String -> TypeRep -> TypeRep -> IO a
-errorRuleTypeMismatch tk k tvReal tvWant = structured (specialIsOracleKey tk)
-    "Build system error - _rule_ used at the wrong _result_ type"
-    [("_Key_ type", Just $ show tk)
-    ,("_Key_ value", k)
-    ,("_Rule_ _result_ type", Just $ show tvReal)
-    ,("Requested _result_ type", Just $ show tvWant)]
-    "Either the function passed to _rule/defaultRule_ has the wrong _result_ type, or the result of _apply_ is used at the wrong type"
-
-errorIncompatibleRules :: TypeRep -> TypeRep -> TypeRep -> IO a
-errorIncompatibleRules tk tv1 tv2 = if specialIsOracleKey tk then errorDuplicateOracle tk Nothing [tv1,tv2] else errorStructured
-    "Build system error - rule has multiple result types"
-    [("Key type", Just $ show tk)
-    ,("First result type", Just $ show tv1)
-    ,("Second result type", Just $ show tv2)]
-    "A function passed to rule/defaultRule has the wrong result type"
-
-errorMultipleRulesMatch :: TypeRep -> String -> Int -> IO a
-errorMultipleRulesMatch tk k count
-    | specialIsOracleKey tk = if count == 0 then err $ "no oracle match for " ++ show tk else errorDuplicateOracle tk (Just k) []
-    | otherwise = errorStructured
-    ("Build system error - key matches " ++ (if count == 0 then "no" else "multiple") ++ " rules")
-    [("Key type",Just $ show tk)
-    ,("Key value",Just k)
-    ,("Rules matched",Just $ show count)]
-    (if count == 0 then "Either add a rule that produces the above key, or stop requiring the above key"
-     else "Modify your rules/defaultRules so only one can produce the above key")
-
-errorRuleRecursion :: [String] -> Maybe TypeRep -> Maybe String -> IO a
--- may involve both rules and oracle, so report as only rules
-errorRuleRecursion stack tk k = throwIO $ wrap $ toException $ ErrorCall $ errorStructuredContents
-    "Build system error - recursion detected"
-    [("Key type",fmap show tk)
-    ,("Key value",k)]
-    "Rules may not be recursive"
-    where
-        wrap = if null stack then id else toException . ShakeException (last stack) stack
-
-errorComplexRecursion :: [String] -> IO a
-errorComplexRecursion ks = errorStructured
-    "Build system error - indirect recursion detected"
-    [("Key value " ++ show i, Just k) | (i, k) <- zip [1..] ks]
-    "Rules may not be recursive"
-
-errorDuplicateOracle :: TypeRep -> Maybe String -> [TypeRep] -> IO a
-errorDuplicateOracle tk k tvs = errorStructured
-    "Build system error - duplicate oracles for the same question type"
-    ([("Question type",Just $ show tk)
-     ,("Question value",k)] ++
-     [("Answer type " ++ show i, Just $ show tv) | (i,tv) <- zip [1..] tvs])
-    "Only one call to addOracle is allowed per question type"
-
-errorNoApply :: TypeRep -> Maybe String -> String -> IO a
-errorNoApply tk k msg = structured (specialIsOracleKey tk)
-    "Build system error - cannot currently call _apply_"
-    [("Reason", Just msg)
-    ,("_Key_ type", Just $ show tk)
-    ,("_Key_ value", k)]
-    "Move the _apply_ call earlier/later"
-
-
--- Should be in Special, but then we get an import cycle
-specialIsOracleKey :: TypeRep -> Bool
-specialIsOracleKey t = con == "OracleQ"
-    where con = show $ fst $ splitTyConApp t
-
-
--- | Error representing all expected exceptions thrown by Shake.
---   Problems when executing rules will be raising using this exception type.
-data ShakeException = ShakeException
-    {shakeExceptionTarget :: String -- ^ The target that was being built when the exception occured.
-    ,shakeExceptionStack :: [String]  -- ^ The stack of targets, where the 'shakeExceptionTarget' is last.
-    ,shakeExceptionInner :: SomeException -- ^ The underlying exception that was raised.
-    }
-    deriving Typeable
-
-instance Exception ShakeException
-
-instance Show ShakeException where
-    show ShakeException{..} = unlines $
-        "Error when running Shake build system:" :
-        map ("* " ++) shakeExceptionStack ++
-        [displayException shakeExceptionInner]
diff --git a/src/Development/Shake/FileInfo.hs b/src/Development/Shake/FileInfo.hs
deleted file mode 100644
--- a/src/Development/Shake/FileInfo.hs
+++ /dev/null
@@ -1,177 +0,0 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, CPP, ForeignFunctionInterface #-}
-
-module Development.Shake.FileInfo(
-    FileInfo, fileInfoEq, fileInfoNeq,
-    FileSize, ModTime, FileHash,
-    getFileHash, getFileInfo, getFileInfoNoDirErr
-    ) where
-
-import Control.Exception.Extra
-import Development.Shake.Classes
-import Development.Shake.Errors
-import General.String
-import qualified Data.ByteString.Lazy as LBS
-import Data.Char
-import Data.Word
-import Numeric
-import System.IO
-
-#if defined(PORTABLE)
-import System.IO.Error
-import System.Directory
-import Data.Time
-#if __GLASGOW_HASKELL__ < 706
-import System.Time
-#endif
-
-#elif defined(mingw32_HOST_OS)
-import Control.Monad
-import qualified Data.ByteString.Char8 as BS
-import Foreign
-import Foreign.C.Types
-import Foreign.C.String
-
-#else
-import System.IO.Error
-import System.Posix.Files.ByteString
-#endif
-
--- A piece of file information, where 0 and 1 are special (see fileInfo* functions)
-newtype FileInfo a = FileInfo Word32
-    deriving (Typeable,Hashable,Binary,NFData)
-
-fileInfoEq, fileInfoNeq :: FileInfo a
-fileInfoEq  = FileInfo 0   -- Equal to everything
-fileInfoNeq = FileInfo 1   -- Equal to nothing
-
-fileInfo :: Word32 -> FileInfo a
-fileInfo a = FileInfo $ if a > maxBound - 2 then a else a + 2
-
-instance Show (FileInfo a) where
-    show (FileInfo x)
-        | x == 0 = "EQ"
-        | x == 1 = "NEQ"
-        | otherwise = "0x" ++ map toUpper (showHex (x-2) "")
-
-instance Eq (FileInfo a) where
-    FileInfo a == FileInfo b
-        | a == 0 || b == 0 = True
-        | a == 1 || b == 1 = False
-        | otherwise = a == b
-
-data FileInfoHash; type FileHash = FileInfo FileInfoHash
-data FileInfoMod ; type ModTime  = FileInfo FileInfoMod
-data FileInfoSize; type FileSize = FileInfo FileInfoSize
-
-
-getFileHash :: BSU -> IO FileHash
-getFileHash x = withFile (unpackU x) ReadMode $ \h -> do
-    s <- LBS.hGetContents h
-    let res = fileInfo $ fromIntegral $ hash s
-    evaluate res
-    return res
-
--- If the result isn't strict then we are referencing a much bigger structure,
--- and it causes a space leak I don't really understand on Linux when running
--- the 'tar' test, followed by the 'benchmark' test.
--- See this blog post: http://neilmitchell.blogspot.co.uk/2015/09/three-space-leaks.html
-result :: Word32 -> Word32 -> IO (Maybe (ModTime, FileSize))
-result x y = do
-    x <- evaluate $ fileInfo x
-    y <- evaluate $ fileInfo y
-    return $! Just (x, y)
-
-
-getFileInfo :: BSU -> IO (Maybe (ModTime, FileSize))
-getFileInfo = getFileInfoEx True
-
-getFileInfoNoDirErr :: BSU -> IO (Maybe (ModTime, FileSize))
-getFileInfoNoDirErr = getFileInfoEx False
-
-
-getFileInfoEx :: Bool -> BSU -> IO (Maybe (ModTime, FileSize))
-
-#if defined(PORTABLE)
--- Portable fallback
-getFileInfoEx direrr x = handleBool isDoesNotExistError (const $ return Nothing) $ do
-    let file = unpackU x
-    time <- getModificationTime file
-    size <- withFile file ReadMode hFileSize
-    result (extractFileTime time) (fromIntegral size)
-
--- deal with difference in return type of getModificationTime between directory versions
-class ExtractFileTime a where extractFileTime :: a -> Word32
-#if __GLASGOW_HASKELL__ < 706
-instance ExtractFileTime ClockTime where extractFileTime (TOD t _) = fromIntegral t
-#endif
-instance ExtractFileTime UTCTime where extractFileTime = floor . fromRational . toRational . utctDayTime
-
-
-#elif defined(mingw32_HOST_OS)
--- Directly against the Win32 API, twice as fast as the portable version
-getFileInfoEx direrr x = BS.useAsCString (unpackU_ x) $ \file ->
-    alloca_WIN32_FILE_ATTRIBUTE_DATA $ \fad -> do
-        res <- c_GetFileAttributesExA file 0 fad
-        code <- peekFileAttributes fad
-        let peek = do
-                code <- peekFileAttributes fad
-                if testBit code 4 then
-                    (if direrr then errorDirectoryNotFile $ unpackU x else return Nothing)
-                 else
-                    join $ liftM2 result (peekLastWriteTimeLow fad) (peekFileSizeLow fad)
-        if res then
-            peek
-         else if requireU x then withCWString (unpackU x) $ \file -> do
-            res <- c_GetFileAttributesExW file 0 fad
-            if res then peek else return Nothing
-         else
-            return Nothing
-
-#ifdef x86_64_HOST_ARCH
-#define CALLCONV ccall
-#else
-#define CALLCONV stdcall
-#endif
-
-foreign import CALLCONV unsafe "Windows.h GetFileAttributesExA" c_GetFileAttributesExA :: Ptr CChar  -> Int32 -> Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO Bool
-foreign import CALLCONV unsafe "Windows.h GetFileAttributesExW" c_GetFileAttributesExW :: Ptr CWchar -> Int32 -> Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO Bool
-
-data WIN32_FILE_ATTRIBUTE_DATA
-
-alloca_WIN32_FILE_ATTRIBUTE_DATA :: (Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO a) -> IO a
-alloca_WIN32_FILE_ATTRIBUTE_DATA act = allocaBytes size_WIN32_FILE_ATTRIBUTE_DATA act
-    where size_WIN32_FILE_ATTRIBUTE_DATA = 36
-
-peekFileAttributes :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO Word32
-peekFileAttributes p = peekByteOff p index_WIN32_FILE_ATTRIBUTE_DATA_dwFileAttributes
-    where index_WIN32_FILE_ATTRIBUTE_DATA_dwFileAttributes = 0
-
-peekLastWriteTimeLow :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO Word32
-peekLastWriteTimeLow p = peekByteOff p index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwLowDateTime
-    where index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwLowDateTime = 20
-
-peekFileSizeLow :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO Word32
-peekFileSizeLow p = peekByteOff p index_WIN32_FILE_ATTRIBUTE_DATA_nFileSizeLow
-    where index_WIN32_FILE_ATTRIBUTE_DATA_nFileSizeLow = 32
-
-
-#else
--- Unix version
-getFileInfoEx direrr x = handleBool isDoesNotExistError (const $ return Nothing) $ do
-    s <- getFileStatus $ unpackU_ x
-    if isDirectory s then
-        (if direrr then errorDirectoryNotFile $ unpackU x else return Nothing)
-     else
-        result (extractFileTime s) (fromIntegral $ fileSize s)
-
-extractFileTime :: FileStatus -> Word32
-#ifndef MIN_VERSION_unix
-#define MIN_VERSION_unix(a,b,c) 0
-#endif
-#if MIN_VERSION_unix(2,6,0)
-extractFileTime x = ceiling $ modificationTimeHiRes x * 1e4 -- precision of 0.1ms
-#else
-extractFileTime x = fromIntegral $ fromEnum $ modificationTime x
-#endif
-
-#endif
diff --git a/src/Development/Shake/FilePath.hs b/src/Development/Shake/FilePath.hs
--- a/src/Development/Shake/FilePath.hs
+++ b/src/Development/Shake/FilePath.hs
@@ -1,13 +1,4 @@
-{-# LANGUAGE CPP #-}
 
-#ifndef MIN_VERSION_filepath
-#if __GLASGOW_HASKELL__ >= 709
-#define MIN_VERSION_filepath(a,b,c) 1
-#else
-#define MIN_VERSION_filepath(a,b,c) 0
-#endif
-#endif
-
 -- | A module for 'FilePath' operations exposing "System.FilePath" plus some additional operations.
 --
 --   /Windows note:/ The extension methods ('<.>', 'takeExtension' etc) use the Posix variants since on
@@ -15,41 +6,28 @@
 --   (which is bad for 'Development.Shake.FilePattern' values).
 module Development.Shake.FilePath(
     module System.FilePath, module System.FilePath.Posix,
-    dropDirectory1, takeDirectory1, normaliseEx,
-#if !MIN_VERSION_filepath(1,4,0)
-    (-<.>),
-#endif
+    dropDirectory1, takeDirectory1, replaceDirectory1,
+    makeRelativeEx, normaliseEx,
     toNative, toStandard,
     exe
     ) where
 
+import System.Directory (canonicalizePath)
 import System.Info.Extra
+import Data.List.Extra
+import Data.Maybe
 import qualified System.FilePath as Native
 
 import System.FilePath hiding
     (splitExtension, takeExtension, replaceExtension, dropExtension, addExtension
     ,hasExtension, (<.>), splitExtensions, takeExtensions, dropExtensions
-#if MIN_VERSION_filepath(1,4,0)
-    ,(-<.>)
-#endif
     )
 import System.FilePath.Posix
     (splitExtension, takeExtension, replaceExtension, dropExtension, addExtension
     ,hasExtension, (<.>), splitExtensions, takeExtensions, dropExtensions
-#if MIN_VERSION_filepath(1,4,0)
-    ,(-<.>)
-#endif
     )
 
-#if !MIN_VERSION_filepath(1,4,0)
-infixr 7  -<.>
 
--- | Remove the current extension and add another, an alias for 'replaceExtension'.
-(-<.>) :: FilePath -> String -> FilePath
-(-<.>) = replaceExtension
-#endif
-
-
 -- | Drop the first directory from a 'FilePath'. Should only be used on
 --   relative paths.
 --
@@ -58,7 +36,7 @@
 -- > dropDirectory1 "aaa" == ""
 -- > dropDirectory1 "" == ""
 dropDirectory1 :: FilePath -> FilePath
-dropDirectory1 = drop 1 . dropWhile (not . isPathSeparator)
+dropDirectory1 = drop1 . dropWhile (not . isPathSeparator)
 
 
 -- | Take the first component of a 'FilePath'. Should only be used on
@@ -71,6 +49,61 @@
 takeDirectory1 = takeWhile (not . isPathSeparator)
 
 
+
+-- | Replace the first component of a 'FilePath'. Should only be used on
+--   relative paths.
+--
+-- > replaceDirectory1 "root/file.ext" "directory" == "directory/file.ext"
+-- > replaceDirectory1 "root/foo/bar/file.ext" "directory" == "directory/foo/bar/file.ext"
+replaceDirectory1 :: FilePath -> String -> FilePath
+replaceDirectory1 x dir = dir </> dropDirectory1 x
+
+-- | Make a path relative. Returns Nothing only when the given paths are on
+-- different drives. This will try the pure function makeRelative first. If that
+-- fails, the paths are canonicalised (removing any indirection and symlinks)
+-- and a relative path is derived from there.
+--
+-- > > -- Given that "/root/a/" is not a symlink
+-- > > makeRelativeEx "/root/a/" "/root/b/file.out"
+-- > Just "../b/file.out"
+-- >
+-- > > -- Given that "/root/c/" is a symlink to "/root/e/f/g/"
+-- > > makeRelativeEx "/root/c/" "/root/b/file.out"
+-- > Just "../../../b/file.out"
+-- >
+-- > > -- On Windows
+-- > > makeRelativeEx "C:\\foo" "D:\\foo\\bar"
+-- > Nothing
+--
+makeRelativeEx :: FilePath -> FilePath -> IO (Maybe FilePath)
+makeRelativeEx pathA pathB
+    | isRelative makeRelativePathAPathB =
+        pure (Just makeRelativePathAPathB)
+    | otherwise = do
+        a' <- canonicalizePath pathA
+        b' <- canonicalizePath pathB
+        if takeDrive a' /= takeDrive b'
+            then pure Nothing
+            else Just <$> makeRelativeEx' a' b'
+    where
+        makeRelativePathAPathB = makeRelative pathA pathB
+
+        makeRelativeEx' :: FilePath -> FilePath -> IO FilePath
+        makeRelativeEx' a b = do
+            let rel = makeRelative a b
+                parent = takeDirectory a
+            if isRelative rel
+                then pure rel
+                else if a /= parent
+                    then do
+                        parentToB <- makeRelativeEx' parent b
+                        pure (".." </> parentToB)
+
+                    -- Impossible: makeRelative should have succeeded in finding
+                    -- a relative path once `a == "/"`.
+                    else error $ "Error calculating relative path from \""
+                                ++ pathA ++ "\" to \"" ++ show pathB ++ "\""
+
 -- | Normalise a 'FilePath', applying the rules:
 --
 -- * All 'pathSeparators' become 'pathSeparator' (@\/@ on Linux, @\\@ on Windows)
@@ -96,22 +129,22 @@
                 (True,False) -> "/."
                 (False,True) -> "./"
                 (False,False) -> "."
-            | otherwise = (if pre then id else tail) $ (if pos then id else init) x
-            where pre = sep $ head $ o ++ " "
+            | otherwise = (if pre then id else drop1) $ (if pos then id else init) x
+            where pre = sep $ fromMaybe ' ' $ listToMaybe o
                   pos = sep $ last $ " " ++ o
 
         g i [] = replicate i ".."
         g i ("..":xs) = g (i+1) xs
         g i (".":xs) = g i xs
         g 0 (x:xs) = x : g 0 xs
-        g i (x:xs) = g (i-1) xs
+        g i (_:xs) = g (i-1) xs -- equivalent to eliminating ../x
 
         split xs = if null ys then [] else a : split b
             where (a,b) = break sep ys
                   ys = dropWhile sep xs
 
 
--- | Convert to native path separators, namely @\\@ on Windows. 
+-- | Convert to native path separators, namely @\\@ on Windows.
 toNative :: FilePath -> FilePath
 toNative = if isWindows then map (\x -> if x == '/' then '\\' else x) else id
 
diff --git a/src/Development/Shake/FilePattern.hs b/src/Development/Shake/FilePattern.hs
deleted file mode 100644
--- a/src/Development/Shake/FilePattern.hs
+++ /dev/null
@@ -1,309 +0,0 @@
-{-# LANGUAGE PatternGuards, ViewPatterns #-}
-
-module Development.Shake.FilePattern(
-    -- * Primitive API, as exposed
-    FilePattern, (?==), (<//>),
-    -- * Optimisation opportunities
-    simple,
-    -- * Multipattern file rules
-    compatible, extract, substitute,
-    -- * Accelerated searching
-    Walk(..), walk,
-    -- * Testing only
-    internalTest, isRelativePath, isRelativePattern
-    ) where
-
-import Development.Shake.Errors
-import System.FilePath(isPathSeparator)
-import Data.List.Extra
-import Control.Applicative
-import Control.Monad
-import Data.Char
-import Data.Tuple.Extra
-import Data.Maybe
-import System.Info.Extra
-import Prelude
-
-
--- | A type synonym for file patterns, containing @\/\/@ and @*@. For the syntax
---   and semantics of 'FilePattern' see '?=='.
---
---   Most 'normaliseEx'd 'FilePath' values are suitable as 'FilePattern' values which match
---   only that specific file. On Windows @\\@ is treated as equivalent to @\/@.
---
---   You can write 'FilePattern' values as a literal string, or build them
---   up using the operators 'Development.Shake.FilePath.<.>', 'Development.Shake.FilePath.</>'
---   and 'Development.Shake.<//>'. However, beware that:
---
--- * On Windows, use 'Development.Shake.FilePath.<.>' from "Development.Shake.FilePath" instead of from
---   "System.FilePath" - otherwise @\"\/\/*\" \<.\> exe@ results in @\"\/\/*\\\\.exe\"@.
---
--- * If the second argument of 'Development.Shake.FilePath.</>' has a leading path separator (namely @\/@)
---   then the second argument will be returned.
-type FilePattern = String
-
-infixr 5 <//>
-
--- | Join two 'FilePattern' values by inserting two @\/@ characters between them.
---   Will first remove any trailing path separators on the first argument, and any leading
---   separators on the second.
---
--- > "dir" <//> "*" == "dir//*"
-(<//>) :: FilePattern -> FilePattern -> FilePattern
-a <//> b = dropWhileEnd isPathSeparator a ++ "//" ++ dropWhile isPathSeparator b
-
-
----------------------------------------------------------------------
--- PATTERNS
-
-data Pat = Lit String -- ^ foo
-         | Star   -- ^ /*/
-         | Skip -- ^ //
-         | Skip1 -- ^ //, but must be at least 1 element
-         | Stars String [String] String -- ^ *foo*, prefix (fixed), infix floaters, suffix
-                                        -- e.g. *foo*bar = Stars "" ["foo"] "bar"
-            deriving (Show,Eq,Ord)
-
-isLit Lit{} = True; isLit _ = False
-fromLit (Lit x) = x
-
-
-data Lexeme = Str String | Slash | SlashSlash
-
-lexer :: FilePattern -> [Lexeme]
-lexer "" = []
-lexer (x1:x2:xs) | isPathSeparator x1, isPathSeparator x2 = SlashSlash : lexer xs
-lexer (x1:xs) | isPathSeparator x1 = Slash : lexer xs
-lexer xs = Str a : lexer b
-    where (a,b) = break isPathSeparator xs
-
-
--- | Parse a FilePattern. All optimisations I can think of are invalid because they change the extracted expressions.
-parse :: FilePattern -> [Pat]
-parse = f False True . lexer
-    where
-        -- str = I have ever seen a Str go past (equivalent to "can I be satisfied by no paths")
-        -- slash = I am either at the start, or my previous character was Slash
-        f str slash [] = [Lit "" | slash]
-        f str slash (Str "**":xs) = Skip : f True False xs
-        f str slash (Str x:xs) = parseLit x : f True False xs
-        f str slash (SlashSlash:Slash:xs) | not str = Skip1 : f str True xs
-        f str slash (SlashSlash:xs) = Skip : f str False xs
-        f str slash (Slash:xs) = [Lit "" | not str] ++ f str True xs
-
-
-parseLit :: String -> Pat
-parseLit "*" = Star
-parseLit x = case split (== '*') x of
-    [x] -> Lit x
-    pre:xs | Just (mid,post) <- unsnoc xs -> Stars pre mid post
-
-
-internalTest :: IO ()
-internalTest = do
-    let x # y = when (parse x /= y) $ fail $ show ("FilePattern.internalTest",x,parse x,y)
-    "" # [Lit ""]
-    "x" # [Lit "x"]
-    "/" # [Lit "",Lit ""]
-    "x/" # [Lit "x",Lit ""]
-    "/x" # [Lit "",Lit "x"]
-    "x/y" # [Lit "x",Lit "y"]
-    "//" # [Skip]
-    "**" # [Skip]
-    "//x" # [Skip, Lit "x"]
-    "**/x" # [Skip, Lit "x"]
-    "x//" # [Lit "x", Skip]
-    "x/**" # [Lit "x", Skip]
-    "x//y" # [Lit "x",Skip, Lit "y"]
-    "x/**/y" # [Lit "x",Skip, Lit "y"]
-    "///" # [Skip1, Lit ""]
-    "**/**" # [Skip,Skip]
-    "**/**/" # [Skip, Skip, Lit ""]
-    "///x" # [Skip1, Lit "x"]
-    "**/x" # [Skip, Lit "x"]
-    "x///" # [Lit "x", Skip, Lit ""]
-    "x/**/" # [Lit "x", Skip, Lit ""]
-    "x///y" # [Lit "x",Skip, Lit "y"]
-    "x/**/y" # [Lit "x",Skip, Lit "y"]
-    "////" # [Skip, Skip]
-    "**/**/**" # [Skip, Skip, Skip]
-    "////x" # [Skip, Skip, Lit "x"]
-    "x////" # [Lit "x", Skip, Skip]
-    "x////y" # [Lit "x",Skip, Skip, Lit "y"]
-    "**//x" # [Skip, Skip, Lit "x"]
-
-
--- | Optimisations that may change the matched expressions
-optimise :: [Pat] -> [Pat]
-optimise (Skip:Skip:xs) = optimise $ Skip:xs
-optimise (Skip:Star:xs) = optimise $ Skip1:xs
-optimise (Star:Skip:xs) = optimise $ Skip1:xs
-optimise (x:xs) = x : optimise xs
-optimise [] =[]
-
-
--- | A 'FilePattern' that will only match 'isRelativePath' values.
-isRelativePattern :: FilePattern -> Bool
-isRelativePattern ('*':'*':xs)
-    | [] <- xs = True
-    | x:xs <- xs, isPathSeparator x = True
-isRelativePattern _ = False
-
--- | A non-absolute 'FilePath'.
-isRelativePath :: FilePath -> Bool
-isRelativePath (x:_) | isPathSeparator x = False
-isRelativePath (x:':':_) | isWindows, isAlpha x = False
-isRelativePath _ = True
-
-
--- | Given a pattern, and a list of path components, return a list of all matches
---   (for each wildcard in order, what the wildcard matched).
-match :: [Pat] -> [String] -> [[String]]
-match (Skip:xs) (y:ys) = map ("":) (match xs (y:ys)) ++ match (Skip1:xs) (y:ys)
-match (Skip1:xs) (y:ys) = [(y++"/"++r):rs | r:rs <- match (Skip:xs) ys]
-match (Skip:xs) [] = map ("":) $ match xs []
-match (Star:xs) (y:ys) = map (y:) $ match xs ys
-match (Lit x:xs) (y:ys) | x == y = match xs ys
-match (x@Stars{}:xs) (y:ys) | Just rs <- matchStars x y = map (rs ++) $ match xs ys
-match [] [] = [[]]
-match _ _ = []
-
-
-matchOne :: Pat -> String -> Bool
-matchOne (Lit x) y = x == y
-matchOne x@Stars{} y = isJust $ matchStars x y
-matchOne Star _ = True
-
-
--- Only return the first (all patterns left-most) valid star matching
-matchStars :: Pat -> String -> Maybe [String]
-matchStars (Stars pre mid post) x = do
-    x <- stripPrefix pre x
-    x <- if null post then Just x else stripSuffix post x
-    stripInfixes mid x
-    where
-        stripInfixes [] x = Just [x]
-        stripInfixes (m:ms) x = do
-            (a,x) <- stripInfix m x
-            (a:) <$> stripInfixes ms x
-
-
--- | Match a 'FilePattern' against a 'FilePath', There are three special forms:
---
--- * @*@ matches an entire path component, excluding any separators.
---
--- * @\/\/@ matches an arbitrary number of path components, including absolute path
---   prefixes.
---
--- * @**@ as a path component matches an arbitrary number of path components, but not
---   absolute path prefixes.
---   Currently considered experimental.
---
---   Some examples:
---
--- * @test.c@ matches @test.c@ and nothing else.
---
--- * @*.c@ matches all @.c@ files in the current directory, so @file.c@ matches,
---   but @file.h@ and @dir\/file.c@ don't.
---
--- * @\/\/*.c@ matches all @.c@ files anywhere on the filesystem,
---   so @file.c@, @dir\/file.c@, @dir1\/dir2\/file.c@ and @\/path\/to\/file.c@ all match,
---   but @file.h@ and @dir\/file.h@ don't.
---
--- * @dir\/*\/*@ matches all files one level below @dir@, so @dir\/one\/file.c@ and
---   @dir\/two\/file.h@ match, but @file.c@, @one\/dir\/file.c@, @dir\/file.h@
---   and @dir\/one\/two\/file.c@ don't.
---
---   Patterns with constructs such as @foo\/..\/bar@ will never match
---   normalised 'FilePath' values, so are unlikely to be correct.
-(?==) :: FilePattern -> FilePath -> Bool
-(?==) p = case optimise $ parse p of
-    [x] | x == Skip || x == Skip1 -> if rp then isRelativePath else const True
-    p -> let f = not . null . match p . split isPathSeparator
-         in if rp then (\x -> isRelativePath x && f x) else f
-    where rp = isRelativePattern p
-
-
----------------------------------------------------------------------
--- MULTIPATTERN COMPATIBLE SUBSTITUTIONS
-
-specials :: FilePattern -> [Pat]
-specials = concatMap f . parse
-    where
-        f Lit{} = []
-        f Star = [Star]
-        f Skip = [Skip]
-        f Skip1 = [Skip]
-        f (Stars _ xs _) = replicate (length xs + 1) Star
-
--- | Is the pattern free from any * and //.
-simple :: FilePattern -> Bool
-simple = null . specials
-
--- | Do they have the same * and // counts in the same order
-compatible :: [FilePattern] -> Bool
-compatible [] = True
-compatible (x:xs) = all ((==) (specials x) . specials) xs
-
--- | Extract the items that match the wildcards. The pair must match with '?=='.
-extract :: FilePattern -> FilePath -> [String]
-extract p = let pat = parse p in \x ->
-    case match pat (split isPathSeparator x) of
-        [] | p ?== x -> err $ "extract with " ++ show p ++ " and " ++ show x
-           | otherwise -> error $ "Pattern " ++ show p ++ " does not match " ++ x ++ ", when trying to extract the FilePattern matches"
-        ms:_ -> ms
-
-
--- | Given the result of 'extract', substitute it back in to a 'compatible' pattern.
---
--- > p '?==' x ==> substitute (extract p x) p == x
-substitute :: [String] -> FilePattern -> FilePath
-substitute oms oxs = intercalate "/" $ concat $ snd $ mapAccumL f oms (parse oxs)
-    where
-        f ms (Lit x) = (ms, [x])
-        f (m:ms) Star = (ms, [m])
-        f (m:ms) Skip = (ms, split m)
-        f (m:ms) Skip1 = (ms, split m)
-        f ms (Stars pre mid post) = (ms2, [concat $ pre : zipWith (++) ms1 (mid++[post])])
-            where (ms1,ms2) = splitAt (length mid + 1) ms
-        f _ _ = error $ "Substitution failed into pattern " ++ show oxs ++ " with " ++ show (length oms) ++ " matches, namely " ++ show oms
-
-        split = linesBy (== '/')
-
-
----------------------------------------------------------------------
--- EFFICIENT PATH WALKING
-
--- | Given a list of files, return a list of things I can match in this directory
---   plus a list of subdirectories and walks that apply to them.
---   Use WalkTo when the list can be predicted in advance
-data Walk = Walk ([String] -> ([String],[(String,Walk)]))
-          | WalkTo            ([String],[(String,Walk)])
-
-walk :: [FilePattern] -> (Bool, Walk)
-walk ps = let ps2 = map (optimise . parse) ps in (any (\p -> isEmpty p || not (null $ match p [""])) ps2, f ps2)
-    where
-        f (nubOrd -> ps)
-            | all isLit fin, all (isLit . fst) nxt = WalkTo (map fromLit fin, map (fromLit *** f) nxt)
-            | otherwise = Walk $ \xs ->
-                (if finStar then xs else filter (\x -> any (`matchOne` x) fin) xs
-                ,[(x, f ys) | x <- xs, let ys = concat [b | (a,b) <- nxt, matchOne a x], not $ null ys])
-            where
-                finStar = Star `elem` fin
-                fin = nubOrd $ mapMaybe final ps
-                nxt = groupSort $ concatMap next ps
-
-
-next :: [Pat] -> [(Pat, [Pat])]
-next (Skip1:xs) = [(Star,Skip:xs)]
-next (Skip:xs) = (Star,Skip:xs) : next xs
-next (x:xs) = [(x,xs) | not $ null xs]
-next [] = []
-
-final :: [Pat] -> Maybe Pat
-final (Skip:xs) = if isEmpty xs then Just Star else final xs
-final (Skip1:xs) = if isEmpty xs then Just Star else Nothing
-final (x:xs) = if isEmpty xs then Just x else Nothing
-final [] = Nothing
-
-isEmpty = all (== Skip)
diff --git a/src/Development/Shake/Forward.hs b/src/Development/Shake/Forward.hs
--- a/src/Development/Shake/Forward.hs
+++ b/src/Development/Shake/Forward.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, Rank2Types, ScopedTypeVariables, MultiParamTypeClasses #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, Rank2Types, ScopedTypeVariables, ViewPatterns #-}
+{-# LANGUAGE TypeFamilies #-}
 
 -- | A module for producing forward-defined build systems, in contrast to standard backwards-defined
 --   build systems such as shake. Based around ideas from <https://code.google.com/p/fabricate/ fabricate>.
@@ -30,60 +31,95 @@
 -- * Where Haskell performs real computation, if zero-build performance is insufficient, use 'cacheAction'.
 --
 --   All forward-defined systems use 'AutoDeps', which requires @fsatrace@ to be on the @$PATH@.
---   You can obtain @fsatrace@ from <https://github.com/jacereda/fsatrace>.
+--   You can obtain @fsatrace@ from <https://github.com/jacereda/fsatrace>. You must set
+--   'shakeLintInside' to specify where 'AutoDeps' will look for dependencies - if you want all dependencies
+--   everywhere use @[\"\"]@.
+--
+--   This module is considered experimental - it has not been battle tested. There are now a few possible
+--   alternatives in this space:
+--
+-- * Pier <http://hackage.haskell.org/package/pier/docs/Pier-Core-Artifact.html> (built on Shake).
+--
+-- * Rattle <https://github.com/ndmitchell/rattle> (by the same author as Shake).
+--
+-- * Stroll <https://github.com/snowleopard/stroll>.
 module Development.Shake.Forward(
     shakeForward, shakeArgsForward,
     forwardOptions, forwardRule,
-    cache, cacheAction
+    cache, cacheAction, cacheActionWith,
     ) where
 
+import Control.Monad
 import Development.Shake
 import Development.Shake.Rule
 import Development.Shake.Command
 import Development.Shake.Classes
 import Development.Shake.FilePath
-import Data.IORef
+import Data.IORef.Extra
 import Data.Either
+import Data.Typeable
 import Data.List.Extra
 import Control.Exception.Extra
 import Numeric
 import System.IO.Unsafe
+import Data.Binary
+import qualified Data.ByteString as BS
+import qualified Data.ByteString.Lazy as LBS
 import qualified Data.HashMap.Strict as Map
 
 
 {-# NOINLINE forwards #-}
-forwards :: IORef (Map.HashMap ForwardQ (Action ()))
+forwards :: IORef (Map.HashMap Forward (Action Forward))
 forwards = unsafePerformIO $ newIORef Map.empty
 
-newtype ForwardQ = ForwardQ String
+-- I'd like to use TypeRep, but it doesn't have any instances in older versions
+newtype Forward = Forward (String, String, BS.ByteString) -- the type, the Show, the payload
     deriving (Hashable,Typeable,Eq,NFData,Binary)
 
-instance Show ForwardQ where
-    show (ForwardQ x) = x
+mkForward :: (Typeable a, Show a, Binary a) => a -> Forward
+mkForward x = Forward (show $ typeOf x, show x, encode' x)
 
-newtype ForwardA = ForwardA ()
-    deriving (Hashable,Typeable,Eq,NFData,Binary,Show)
+unForward :: forall a . (Typeable a, Binary a) => Forward -> a
+unForward (Forward (got,_,x))
+    | got /= want = error $ "Failed to match forward type, wanted " ++ show want ++ ", got " ++ show got
+    | otherwise = decode' x
+    where want = show $ typeRep (Proxy :: Proxy a)
 
-instance Rule ForwardQ ForwardA where
-    storedValue _ _ = return $ Just $ ForwardA ()
+encode' :: Binary a => a -> BS.ByteString
+encode' = BS.concat . LBS.toChunks . encode
 
+decode' :: Binary a => BS.ByteString -> a
+decode' = decode . LBS.fromChunks . pure
+
+type instance RuleResult Forward = Forward
+
+instance Show Forward where
+    show (Forward (_,x,_)) = x
+
 -- | Run a forward-defined build system.
 shakeForward :: ShakeOptions -> Action () -> IO ()
 shakeForward opts act = shake (forwardOptions opts) (forwardRule act)
 
--- | Run a forward-defined build system, interpretting command-line arguments.
+-- | Run a forward-defined build system, interpreting command-line arguments.
 shakeArgsForward :: ShakeOptions -> Action () -> IO ()
 shakeArgsForward opts act = shakeArgs (forwardOptions opts) (forwardRule act)
 
 -- | Given an 'Action', turn it into a 'Rules' structure which runs in forward mode.
 forwardRule :: Action () -> Rules ()
 forwardRule act = do
-    rule $ \k -> Just $ do
-        res <- liftIO $ atomicModifyIORef forwards $ \mp -> (Map.delete k mp, Map.lookup k mp)
-        case res of
-            Nothing -> liftIO $ errorIO "Failed to find action name"
-            Just act -> act
-        return $ ForwardA ()
+    opts <- getShakeOptionsRules
+    when (null $ shakeLintInside opts) $
+        fail "When running in forward mode you must set shakeLintInside to specify where to detect dependencies"
+    addBuiltinRule noLint noIdentity $ \k old mode ->
+        case old of
+            Just old | mode == RunDependenciesSame -> pure $ RunResult ChangedNothing old (decode' old)
+            _ -> do
+                res <- liftIO $ atomicModifyIORef forwards $ \mp -> (Map.delete k mp, Map.lookup k mp)
+                case res of
+                    Nothing -> liftIO $ errorIO $ "Failed to find action name, " ++ show k
+                    Just act -> do
+                        new <- act
+                        pure $ RunResult ChangedRecomputeSame (encode' new) new
     action act
 
 -- | Given a 'ShakeOptions', set the options necessary to execute in forward mode.
@@ -91,18 +127,47 @@
 forwardOptions opts = opts{shakeCommandOptions=[AutoDeps]}
 
 
--- | Cache an action. The name of the action must be unique for all different actions.
-cacheAction :: String -> Action () -> Action ()
-cacheAction name action = do
-    let key = ForwardQ name
-    liftIO $ atomicModifyIORef forwards $ \mp -> (Map.insert key action mp, ())
-    _ :: [ForwardA] <- apply [key]
-    liftIO $ atomicModifyIORef forwards $ \mp -> (Map.delete key mp, ())
+-- | Cache an action, given a key and an 'Action'. Each call in your program should specify a different
+--   key, but the key should remain consistent between runs. Ideally, the 'Action' will gather all its dependencies
+--   with tracked operations, e.g. 'readFile\''. However, if information is accessed from the environment
+--   (e.g. the action is a closure), you should call 'cacheActionWith' being explicit about what is captured.
+cacheAction :: (Typeable a, Binary a, Show a, Typeable b, Binary b, Show b) => a -> Action b -> Action b
+cacheAction (mkForward -> key) (action :: Action b) = do
+    liftIO $ atomicModifyIORef_ forwards $ Map.insert key (mkForward <$> action)
+    res <- apply1 key
+    liftIO $ atomicModifyIORef_ forwards $ Map.delete key
+    pure $ unForward res
 
--- | Apply caching to an external command.
+newtype With a = With a
+    deriving (Typeable, Binary, Show)
+
+-- | Like 'cacheAction', but also specify which information is captured by the closure of the 'Action'. If that
+--   information changes, the 'Action' will be rerun.
+cacheActionWith :: (Typeable a, Binary a, Show a, Typeable b, Binary b, Show b, Typeable c, Binary c, Show c) => a -> b ->  Action c -> Action c
+cacheActionWith key argument action = do
+    cacheAction (With argument) $ do
+        alwaysRerun
+        pure argument
+    cacheAction key $ do
+        apply1 $ mkForward $ With argument
+        action
+
+-- | Apply caching to an external command using the same arguments as 'cmd'.
+--
+-- > cache $ cmd "gcc -c" ["foo.c"] "-o" ["foo.o"]
+--
+--   This command will be cached, with the inputs/outputs traced. If any of the
+--   files used by this command (e.g. @foo.c@ or header files it imports) then
+--   the command will rerun.
 cache :: (forall r . CmdArguments r => r) -> Action ()
 cache cmd = do
-    let args :: [Either CmdOption String] = cmd
-    let isDull ['-',x] = True; isDull _ = False
-    let name = head $ filter (not . isDull) (drop 1 $ rights args) ++ ["unknown"]
-    cacheAction ("command " ++ toStandard name ++ " #" ++ upper (showHex (abs $ hash $ show args) "")) cmd
+    let CmdArgument args = cmd
+    let isDull ['-',_] = True; isDull _ = False
+    let name = headDef "unknown" $ filter (not . isDull) $ drop1 $ rights args
+    cacheAction (Command $ toStandard name ++ " #" ++ upper (showHex (abs $ hash $ show args) "")) cmd
+
+newtype Command = Command String
+    deriving (Typeable, Binary)
+
+instance Show Command where
+    show (Command x) = "command " ++ x
diff --git a/src/Development/Shake/Internal/Args.hs b/src/Development/Shake/Internal/Args.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Args.hs
@@ -0,0 +1,423 @@
+{-# LANGUAGE TupleSections #-}
+
+-- | Command line parsing flags.
+module Development.Shake.Internal.Args(
+    shakeOptDescrs,
+    shake,
+    shakeArgs, shakeArgsWith, shakeArgsOptionsWith
+    ) where
+
+import Development.Shake.Internal.Paths
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Errors
+import Development.Shake.Internal.CompactUI
+import Development.Shake.Internal.Demo
+import Development.Shake.Internal.Core.Action
+import Development.Shake.FilePath
+import Development.Shake.Internal.Rules.File
+import Development.Shake.Internal.Progress
+import Development.Shake.Database
+import General.Timing
+import General.Extra
+import General.Thread
+import General.GetOpt
+import General.EscCodes
+
+import Data.Tuple.Extra
+import Control.DeepSeq
+import Control.Exception.Extra
+import Control.Monad
+import Data.Either
+import Data.List.Extra
+import Data.Maybe
+import System.Directory.Extra
+import System.Environment
+import System.Exit
+import System.Time.Extra
+
+
+-- | Main entry point for running Shake build systems. For an example see the top of the module "Development.Shake".
+--   Use 'ShakeOptions' to specify how the system runs, and 'Rules' to specify what to build. The function will throw
+--   an exception if the build fails.
+--
+--   To use command line flags to modify 'ShakeOptions' see 'shakeArgs'.
+shake :: ShakeOptions -> Rules () -> IO ()
+shake opts rules = do
+    addTiming "Function shake"
+    (_, after) <- shakeWithDatabase opts rules $ \db -> do
+        shakeOneShotDatabase db
+        shakeRunDatabase db []
+    shakeRunAfter opts after
+
+
+-- | Run a build system using command line arguments for configuration.
+--   The available flags are those from 'shakeOptDescrs', along with a few additional
+--   @make@ compatible flags that are not represented in 'ShakeOptions', such as @--print-directory@.
+--   If there are no file arguments then the 'Rules' are used directly, otherwise the file arguments
+--   are 'want'ed (after calling 'withoutActions'). As an example:
+--
+-- @
+-- main = 'shakeArgs' 'shakeOptions'{'shakeFiles' = \"_make\", 'shakeProgress' = 'progressSimple'} $ do
+--     'phony' \"clean\" $ 'Development.Shake.removeFilesAfter' \"_make\" [\"\/\/*\"]
+--     'want' [\"_make\/neil.txt\",\"_make\/emily.txt\"]
+--     \"_make\/*.txt\" '%>' \\out ->
+--         ... build action here ...
+-- @
+--
+--   This build system will default to building @neil.txt@ and @emily.txt@, while showing progress messages,
+--   and putting the Shake files in locations such as @_make\/.database@. Some example command line flags:
+--
+-- * @main --no-progress@ will turn off progress messages.
+--
+-- * @main -j6@ will build on 6 threads.
+--
+-- * @main --help@ will display a list of supported flags.
+--
+-- * @main clean@ will not build anything, but will remove the @_make@ directory, including the
+--   any 'shakeFiles'.
+--
+-- * @main _make/henry.txt@ will not build @neil.txt@ or @emily.txt@, but will instead build @henry.txt@.
+shakeArgs :: ShakeOptions -> Rules () -> IO ()
+shakeArgs opts rules = shakeArgsWith opts [] f
+    where f _ files = pure $ Just $ if null files then rules else want files >> withoutActions rules
+
+
+-- | A version of 'shakeArgs' with more flexible handling of command line arguments.
+--   The caller of 'shakeArgsWith' can add additional flags (the second argument) and chose how to convert
+--   the flags/arguments into rules (the third argument). Given:
+--
+-- @
+-- 'shakeArgsWith' opts flags (\\flagValues argValues -> result)
+-- @
+--
+-- * @opts@ is the initial 'ShakeOptions' value, which may have some fields overridden by command line flags.
+--   This argument is usually 'shakeOptions', perhaps with a few fields overridden.
+--
+-- * @flags@ is a list of flag descriptions, which either produce a 'String' containing an error
+--   message (typically for flags with invalid arguments, .e.g. @'Left' \"could not parse as int\"@), or a value
+--   that is passed as @flagValues@. If you have no custom flags, pass @[]@.
+--
+-- * @flagValues@ is a list of custom flags that the user supplied. If @flags == []@ then this list will
+--   be @[]@.
+--
+-- * @argValues@ is a list of non-flag arguments, which are often treated as files and passed to 'want'.
+--   If arguments are specified then typically the 'want' calls from the rules are discarded using 'withoutActions'.
+--
+-- * @result@ should produce a 'Nothing' to indicate that no building needs to take place, or a 'Just'
+--   providing the rules that should be used.
+--
+--   As an example of a build system that can use either @gcc@ or @distcc@ for compiling:
+--
+-- @
+-- import System.Console.GetOpt
+--
+-- data Flags = DistCC deriving Eq
+-- flags = [Option \"\" [\"distcc\"] (NoArg $ Right DistCC) \"Run distributed.\"]
+--
+-- main = 'shakeArgsWith' 'shakeOptions' flags $ \\flags targets -> pure $ Just $ do
+--     let compiler = if DistCC \`elem\` flags then \"distcc\" else \"gcc\"
+--     let rules = do
+--         \"*.o\" '%>' \\out -> do
+--             'need' ...
+--             'cmd' compiler ...
+--         'want' [\"target.exe\"]
+--         ...
+--     if null targets then rules else 'want' targets >> 'withoutActions' rules
+-- @
+--
+--   Now you can pass @--distcc@ to use the @distcc@ compiler.
+shakeArgsWith :: ShakeOptions -> [OptDescr (Either String a)] -> ([a] -> [String] -> IO (Maybe (Rules ()))) -> IO ()
+shakeArgsWith opt args f = shakeArgsOptionsWith opt args $ \so a b -> fmap (so,) <$> f a b
+
+-- | Like 'shakeArgsWith', but also lets you manipulate the 'ShakeOptions'.
+shakeArgsOptionsWith
+    :: ShakeOptions
+    -> [OptDescr (Either String a)]
+    -> (ShakeOptions -> [a] -> [String] -> IO (Maybe (ShakeOptions, Rules ())))
+    -> IO ()
+shakeArgsOptionsWith baseOpts userOptions rules = do
+    addTiming "shakeArgsWith"
+    let baseOpts2 = removeOverlap userOptions $ map snd shakeOptsEx
+    args <- getArgs
+    let (flag1,files,errs) = getOpt (baseOpts2 `mergeOptDescr` userOptions) args
+        (self,user) = partitionEithers flag1
+        (flagsExtra,flagsShake) = first concat $ unzip self
+        progressReplays = [x | ProgressReplay x <- flagsExtra]
+        progressRecords = [x | ProgressRecord x <- flagsExtra]
+        changeDirectory = listToMaybe [x | ChangeDirectory x <- flagsExtra]
+        printDirectory = lastDef False [x | PrintDirectory x <- flagsExtra]
+        shareRemoves = [x | ShareRemove x <- flagsExtra]
+        oshakeOpts = foldl' (flip ($)) baseOpts flagsShake
+    lintInside <- mapM canonicalizePath $ shakeLintInside oshakeOpts
+    let shakeOpts = oshakeOpts {shakeLintInside = map (toStandard . addTrailingPathSeparator) lintInside
+                               ,shakeLintIgnore = map toStandard $ shakeLintIgnore oshakeOpts
+                               ,shakeOutput     = if shakeColor oshakeOpts
+                                                  then outputColor (shakeOutput oshakeOpts)
+                                                  else shakeOutput oshakeOpts
+                               }
+    let putWhen v msg = when (shakeVerbosity oshakeOpts >= v) $ shakeOutput oshakeOpts v msg
+    let putWhenLn v msg = putWhen v $ msg ++ "\n"
+    let showHelp long = do
+            progName <- getProgName
+            (targets, helpSuffix) <- if not long then pure ([], []) else
+                handleSynchronous (\e -> do putWhenLn Info $ "Failure to collect targets: " ++ show e; pure ([], [])) $ do
+                    -- run the rules as simply as we can
+                    rs <- rules shakeOpts [] []
+                    case rs of
+                        Just (_, rs) -> do
+                            xs <- getTargets shakeOpts rs
+                            helpSuffix <- getHelpSuffix shakeOpts rs
+                            evaluate $ force (["  - " ++ a ++ maybe "" (" - " ++) b | (a,b) <- xs], helpSuffix)
+                        _ -> pure ([], [])
+            changes<- pure $
+                let as = shakeOptionsFields baseOpts
+                    bs = shakeOptionsFields oshakeOpts
+                in ["  - " ++ lbl ++ ": " ++ v1 ++ " => " ++ v2 | long, ((lbl, v1), (_, v2)) <- zip as bs, v1 /= v2]
+
+            putWhen Error $ unlines $
+                ("Usage: " ++ progName ++ " [options] [target] ...") :
+                (if null baseOpts2 then [] else "" : (if null userOptions then "Options:" else "Standard options:") : showOptDescr baseOpts2) ++
+                (if null userOptions then [] else "" : "Extra options:" : showOptDescr userOptions) ++
+                (if null changes then [] else "" : "Changed ShakeOptions:" : changes) ++
+                (if null targets then [] else "" : "Targets:" : targets) ++
+                (if null helpSuffix then [] else "" : helpSuffix)
+
+    when (errs /= []) $ do
+        putWhen Error $ unlines $ map ("shake: " ++) $ filter (not . null) $ lines $ unlines errs
+        showHelp False
+        exitFailure
+
+    if Help `elem` flagsExtra then
+        showHelp True
+     else if Version `elem` flagsExtra then
+        putWhenLn Info $ "Shake build system, version " ++ shakeVersionString
+     else if NumericVersion `elem` flagsExtra then
+        putWhenLn Info shakeVersionString
+     else if Demo `elem` flagsExtra then
+        demo $ shakeStaunch shakeOpts
+     else if not $ null progressReplays then do
+        dat <- forM progressReplays $ \file -> do
+            src <- readFile file
+            pure (file, map read $ lines src)
+        forM_ (if null $ shakeReport shakeOpts then ["-"] else shakeReport shakeOpts) $ \file -> do
+            putWhenLn Info $ "Writing report to " ++ file
+            writeProgressReport file dat
+     else do
+        when (Sleep `elem` flagsExtra) $ sleep 1
+        start <- offsetTime
+        initDataDirectory -- must be done before we start changing directory
+        let redir = maybe id withCurrentDirectory changeDirectory
+        shakeOpts <- if null progressRecords then pure shakeOpts else do
+            t <- offsetTime
+            pure shakeOpts{shakeProgress = \p ->
+                void $ withThreadsBoth (shakeProgress shakeOpts p) $
+                    progressDisplay 1 (const $ pure ()) $ do
+                        p <- p
+                        t <- t
+                        forM_ progressRecords $ \file ->
+                            appendFile file $ show (t,p) ++ "\n"
+                        pure p
+            }
+        (ran,shakeOpts,res) <- redir $ do
+            when printDirectory $ do
+                curdir <- getCurrentDirectory
+                putWhenLn Info $ "shake: In directory `" ++ curdir ++ "'"
+            (shakeOpts, ui) <- do
+                let compact = lastDef No [x | Compact x <- flagsExtra]
+                use <- if compact == Auto then checkEscCodes else pure $ compact == Yes
+                if use
+                    then second withThreadSlave <$> compactUI shakeOpts
+                    else pure (shakeOpts, id)
+            rules <- rules shakeOpts user files
+            ui $ case rules of
+                Nothing -> pure (False, shakeOpts, Right ())
+                Just (shakeOpts, rules) -> do
+                    res <- try_ $ shake shakeOpts $
+                        if NoBuild `elem` flagsExtra then
+                            withoutActions rules
+                        else if ShareList `elem` flagsExtra ||
+                                not (null shareRemoves) ||
+                                ShareSanity `elem` flagsExtra then do
+                            action $ do
+                                unless (null shareRemoves) $
+                                    actionShareRemove shareRemoves
+                                when (ShareList `elem` flagsExtra)
+                                    actionShareList
+                                when (ShareSanity `elem` flagsExtra)
+                                    actionShareSanity
+                            withoutActions rules
+                        else
+                            rules
+                    pure (True, shakeOpts, res)
+
+        if not ran || shakeVerbosity shakeOpts < Info || NoTime `elem` flagsExtra then
+            either throwIO pure res
+         else
+            let esc = if shakeColor shakeOpts then escape else \_ x -> x
+            in case res of
+                Left err ->
+                    if Exception `elem` flagsExtra then
+                        throwIO err
+                    else do
+                        putWhenLn Error $ esc Red $ show err
+                        exitFailure
+                Right () -> do
+                    tot <- start
+                    putWhenLn Info $ esc Green $ "Build completed in " ++ showDuration tot
+
+
+-- | A list of command line options that can be used to modify 'ShakeOptions'. Each option returns
+--   either an error message (invalid argument to the flag) or a function that changes some fields
+--   in 'ShakeOptions'. The command line flags are @make@ compatible where possbile, but additional
+--   flags have been added for the extra options Shake supports.
+shakeOptDescrs :: [OptDescr (Either String (ShakeOptions -> ShakeOptions))]
+shakeOptDescrs = [fmapFmapOptDescr snd o | (True, o) <- shakeOptsEx]
+
+data Extra = ChangeDirectory FilePath
+           | Version
+           | NumericVersion
+           | PrintDirectory Bool
+           | Help
+           | Sleep
+           | NoTime
+           | Exception
+           | NoBuild
+           | ProgressRecord FilePath
+           | ProgressReplay FilePath
+           | Demo
+           | ShareList
+           | ShareSanity
+           | ShareRemove String
+           | Compact Auto
+             deriving Eq
+
+data Auto = Yes | No | Auto
+    deriving Eq
+
+escape :: Color -> String -> String
+escape color x = escForeground color ++ x ++ escNormal
+
+outputColor :: (Verbosity -> String -> IO ()) -> Verbosity -> String -> IO ()
+outputColor output v msg = output v $ color msg
+  where color = case v of
+            Silent -> id
+            Error  -> escape Red
+            Warn   -> escape Yellow
+            _      -> escape Blue
+
+-- | True if it has a potential effect on ShakeOptions
+shakeOptsEx :: [(Bool, OptDescr (Either String ([Extra], ShakeOptions -> ShakeOptions)))]
+shakeOptsEx =
+    [opts $ Option "a" ["abbrev"] (reqArgPair "abbrev" "FULL=SHORT" $ \a s -> s{shakeAbbreviations=shakeAbbreviations s ++ [a]}) "Use abbreviation in status messages."
+    ,opts $ Option ""  ["allow-redefine-rules"] (noArg $ \s -> s{shakeAllowRedefineRules = True}) "Allow redefining built-in rules"
+    ,opts $ Option ""  ["no-allow-redefine-rules"] (noArg $ \s -> s{shakeAllowRedefineRules = False}) "Forbid redefining built-in rules (default)"
+    ,extr $ Option ""  ["no-build"] (noArg [NoBuild]) "Don't build anything."
+    ,extr $ Option "C" ["directory"] (reqArg "DIRECTORY" $ \x -> [ChangeDirectory x]) "Change to DIRECTORY before doing anything."
+--    ,yes $ Option ""  ["cloud"] (reqArg "URL" $ \x s -> s{shakeCloud=shakeCloud s ++ [x]}) "HTTP server providing a cloud cache."
+    ,opts $ Option ""  ["color","colour"] (noArg $ \s -> s{shakeColor=True}) "Colorize the output."
+    ,opts $ Option ""  ["no-color","no-colour"] (noArg $ \s -> s{shakeColor=False}) "Don't colorize the output."
+    ,extr $ Option ""  ["compact"] (optArgAuto "auto" "yes|no|auto" $ \x -> [Compact x]) "Use a compact Bazel/Buck style output."
+    ,opts $ Option "d" ["debug"] (optArg "FILE" $ \x s -> s{shakeVerbosity=Diagnostic, shakeOutput=outputDebug (shakeOutput s) x}) "Print lots of debugging information."
+    ,extr $ Option ""  ["demo"] (noArg [Demo]) "Run in demo mode."
+    ,opts $ Option ""  ["digest"] (noArg $ \s -> s{shakeChange=ChangeDigest}) "Files change when digest changes."
+    ,opts $ Option ""  ["digest-and"] (noArg $ \s -> s{shakeChange=ChangeModtimeAndDigest}) "Files change when modtime and digest change."
+    ,opts $ Option ""  ["digest-and-input"] (noArg $ \s -> s{shakeChange=ChangeModtimeAndDigestInput}) "Files change on modtime (and digest for inputs)."
+    ,opts $ Option ""  ["digest-or"] (noArg $ \s -> s{shakeChange=ChangeModtimeOrDigest}) "Files change when modtime or digest change."
+    ,opts $ Option ""  ["digest-not"] (noArg $ \s -> s{shakeChange=ChangeModtime}) "Files change when modtime changes."
+    ,extr $ Option ""  ["exception"] (noArg [Exception]) "Throw exceptions directly."
+    ,opts $ Option ""  ["flush"] (reqIntArg 1 "flush" "N" (\i s -> s{shakeFlush=Just i})) "Flush metadata every N seconds."
+    ,opts $ Option ""  ["never-flush"] (noArg $ \s -> s{shakeFlush=Nothing}) "Never explicitly flush metadata."
+    ,extr $ Option "h" ["help"] (noArg [Help]) "Print this message and exit."
+    ,opts $ Option "j" ["jobs"] (optArgInt 0 "jobs" "N" $ \i s -> s{shakeThreads=fromMaybe 0 i}) "Allow N jobs/threads at once [default CPUs]."
+    ,opts $ Option "k" ["keep-going"] (noArg $ \s -> s{shakeStaunch=True}) "Keep going when some targets can't be made."
+    ,opts $ Option "l" ["lint"] (noArg $ \s -> s{shakeLint=Just LintBasic}) "Perform limited validation after the run."
+    ,opts $ Option ""  ["lint-watch"] (reqArg "PATTERN" $ \x s -> s{shakeLintWatch=shakeLintWatch s ++ [x]}) "Error if any of the patterns are created (expensive)."
+    ,opts $ Option ""  ["lint-fsatrace"] (optArg "DIR" $ \x s -> s{shakeLint=Just LintFSATrace, shakeLintInside=shakeLintInside s ++ [fromMaybe "." x]}) "Use fsatrace to do validation [in current dir]."
+    ,opts $ Option ""  ["lint-ignore"] (reqArg "PATTERN" $ \x s -> s{shakeLintIgnore=shakeLintIgnore s ++ [x]}) "Ignore any lint errors in these patterns."
+    ,opts $ Option ""  ["no-lint"] (noArg $ \s -> s{shakeLint=Nothing}) "Turn off --lint."
+    ,opts $ Option ""  ["live"] (optArg "FILE" $ \x s -> s{shakeLiveFiles=shakeLiveFiles s ++ [fromMaybe "live.txt" x]}) "List the files that are live [to live.txt]."
+    ,opts $ Option "m" ["metadata"] (reqArg "PREFIX" $ \x s -> s{shakeFiles=x}) "Prefix for storing metadata files."
+    ,extr $ Option ""  ["numeric-version"] (noArg [NumericVersion]) "Print just the version number and exit."
+    ,opts $ Option ""  ["skip-commands"] (noArg $ \s -> s{shakeRunCommands=False}) "Try and avoid running external programs."
+    ,opts $ Option "B" ["rebuild"] (optArg "PATTERN" $ \x s -> s{shakeRebuild=shakeRebuild s ++ [(RebuildNow, fromMaybe "**" x)]}) "If required, these files will rebuild even if nothing has changed."
+    ,opts $ Option ""  ["no-rebuild"] (optArg "PATTERN" $ \x s -> s{shakeRebuild=shakeRebuild s ++ [(RebuildNormal, fromMaybe "**" x)]}) "If required, these files will rebuild only if things have changed (default)."
+    ,opts $ Option ""  ["skip"] (optArg "PATTERN" $ \x s -> s{shakeRebuild=shakeRebuild s ++ [(RebuildLater, fromMaybe "**" x)]}) "Don't rebuild matching files this run."
+--    ,yes $ Option ""  ["skip-forever"] (OptArg (\x -> Right ([], \s -> s{shakeRebuild=shakeRebuild s ++ [(RebuildNever, fromMaybe "**" x)]})) "PATTERN") "Don't rebuild matching files until they change."
+    ,opts $ Option "r" ["report","profile"] (optArg "FILE" $ \x s -> s{shakeReport=shakeReport s ++ [fromMaybe "report.html" x]}) "Write out profiling information [to report.html]."
+    ,opts $ Option ""  ["no-reports"] (noArg $ \s -> s{shakeReport=[]}) "Turn off --report."
+    ,opts $ Option ""  ["rule-version"] (reqArg "VERSION" $ \x s -> s{shakeVersion=x}) "Version of the build rules."
+    ,opts $ Option ""  ["no-rule-version"] (noArg $ \s -> s{shakeVersionIgnore=True}) "Ignore the build rules version."
+    ,opts $ Option ""  ["share"] (optArg "DIRECTORY" $ \x s -> s{shakeShare=Just $ fromMaybe "" x, shakeChange=ensureHash $ shakeChange s}) "Shared cache location."
+    ,hide $ Option ""  ["share-list"] (noArg ([ShareList], ensureShare)) "List the shared cache files."
+    ,hide $ Option ""  ["share-sanity"] (noArg ([ShareSanity], ensureShare)) "Sanity check the shared cache files."
+    ,hide $ Option ""  ["share-remove"] (OptArg (\x -> Right ([ShareRemove $ fromMaybe "**" x], ensureShare)) "SUBSTRING") "Remove the shared cache keys."
+    ,opts $ Option ""  ["share-copy"] (noArg $ \s -> s{shakeSymlink=False}) "Copy files into the cache."
+    ,opts $ Option ""  ["share-symlink"] (noArg $ \s -> s{shakeSymlink=True}) "Symlink files into the cache."
+    ,opts $ Option "s" ["silent"] (noArg $ \s -> s{shakeVerbosity=Silent}) "Don't print anything."
+    ,extr $ Option ""  ["sleep"] (noArg [Sleep]) "Sleep for a second before building."
+    ,opts $ Option "S" ["no-keep-going","stop"] (noArg $ \s -> s{shakeStaunch=False}) "Turns off -k."
+    ,opts $ Option ""  ["storage"] (noArg $ \s -> s{shakeStorageLog=True}) "Write a storage log."
+    ,both $ Option "p" ["progress"] (progress $ optArgInt 1 "progress" "N" $ \i s -> s{shakeProgress=prog $ fromMaybe 5 i}) "Show progress messages [every N secs, default 5]."
+    ,opts $ Option ""  ["no-progress"] (noArg $ \s -> s{shakeProgress=const $ pure ()}) "Don't show progress messages."
+    ,opts $ Option "q" ["quiet"] (noArg $ \s -> s{shakeVerbosity=move (shakeVerbosity s) pred}) "Print less (pass repeatedly for even less)."
+    ,extr $ Option ""  ["no-time"] (noArg [NoTime]) "Don't print build time."
+    ,opts $ Option ""  ["timings"] (noArg $ \s -> s{shakeTimings=True}) "Print phase timings."
+    ,opts $ Option "V" ["verbose","trace"] (noArg $ \s -> s{shakeVerbosity=move (shakeVerbosity s) succ}) "Print more (pass repeatedly for even more)."
+    ,extr $ Option "v" ["version"] (noArg [Version]) "Print the version number and exit."
+    ,extr $ Option "w" ["print-directory"] (noArg [PrintDirectory True]) "Print the current directory."
+    ,extr $ Option ""  ["no-print-directory"] (noArg [PrintDirectory False]) "Turn off -w, even if it was turned on implicitly."
+    ]
+    where
+        opts o = (True, fmapFmapOptDescr ([],) o)
+        extr o = (False, fmapFmapOptDescr (,id) o)
+        both o = (True, o)
+        hide o = (False, o) -- I do modify the options, but not in a meaningful way
+
+        move :: Verbosity -> (Int -> Int) -> Verbosity
+        move x by = toEnum $ min (fromEnum mx) $ max (fromEnum mn) $ by $ fromEnum x
+            where (mn,mx) = (asTypeOf minBound x, asTypeOf maxBound x)
+
+        noArg = NoArg . Right
+        reqArg a f = ReqArg (Right . f) a
+        optArg a f = OptArg (Right . f) a
+
+        reqIntArg mn flag a f = flip ReqArg a $ \x -> case reads x of
+            [(i,"")] | i >= mn -> Right (f i)
+            _ -> Left $ "the `--" ++ flag ++ "' option requires a number, " ++ show mn ++ " or above"
+
+        optArgInt mn flag a f = flip OptArg a $ maybe (Right (f Nothing)) $ \x -> case reads x of
+            [(i,"")] | i >= mn -> Right (f $ Just i)
+            _ -> Left $ "the `--" ++ flag ++ "' option requires a number, " ++ show mn ++ " or above"
+
+        optArgAuto flag a f = flip OptArg a $ maybe (Right (f Yes)) $ \x -> case x of
+            "yes" -> Right $ f Yes
+            "no" -> Right $ f No
+            "auto" -> Right $ f Auto
+            _ -> Left $ "the `--" ++ flag ++ "' option requires yes|no|auto, but got " ++ show x
+
+        reqArgPair flag a f = flip ReqArg a $ \x -> case break (== '=') x of
+            (a,'=':b) -> Right $ f (a,b)
+            _ -> Left $ "the `--" ++ flag ++ "' option requires an = in the argument"
+
+        progress (OptArg func msg) = flip OptArg msg $ \x -> case break (== '=') `fmap` x of
+            Just ("record",file) -> Right ([ProgressRecord $ if null file then "progress.txt" else tailErr file], id)
+            Just ("replay",file) -> Right ([ProgressReplay $ if null file then "progress.txt" else tailErr file], id)
+            _ -> ([],) <$> func x
+        progress _ = throwImpure $ errorInternal "incomplete pattern, progress"
+
+        outputDebug output Nothing = output
+        outputDebug output (Just file) = \v msg -> do
+            when (v /= Diagnostic) $ output v msg
+            appendFile file $ removeEscCodes msg ++ "\n"
+
+        prog i p = do
+            program <- progressProgram
+            progressDisplay i (\s -> progressTitlebar s >> program s) p
+
+        -- ensure the file system always computes a hash, required for --share
+        ensureHash ChangeModtime = ChangeModtimeAndDigest
+        ensureHash ChangeModtimeAndDigestInput = ChangeModtimeAndDigest
+        ensureHash x = x
+
+        ensureShare s = s{shakeShare = Just $ fromMaybe "." $ shakeShare s}
diff --git a/src/Development/Shake/Internal/CmdOption.hs b/src/Development/Shake/Internal/CmdOption.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/CmdOption.hs
@@ -0,0 +1,34 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+module Development.Shake.Internal.CmdOption(CmdOption(..)) where
+
+import Data.Data
+import qualified Data.ByteString.Lazy.Char8 as LBS
+
+-- | Options passed to 'command' or 'cmd' to control how processes are executed.
+data CmdOption
+    = Cwd FilePath -- ^ Change the current directory in the spawned process. By default uses this processes current directory.
+                   --   Successive 'Cwd' options are joined together, to change into nested directories.
+    | Env [(String,String)] -- ^ Change the environment variables in the spawned process. By default uses this processes environment.
+    | AddEnv String String -- ^ Add an environment variable in the child process.
+    | RemEnv String -- ^ Remove an environment variable from the child process.
+    | AddPath [String] [String] -- ^ Add some items to the prefix and suffix of the @$PATH@ variable.
+    | Stdin String -- ^ Given as the @stdin@ of the spawned process.
+    | StdinBS LBS.ByteString -- ^ Given as the @stdin@ of the spawned process.
+    | FileStdin FilePath -- ^ Take the @stdin@ from a file.
+    | Shell -- ^ Pass the command to the shell without escaping - any arguments will be joined with spaces. By default arguments are escaped properly.
+    | BinaryPipes -- ^ Treat the @stdin@\/@stdout@\/@stderr@ messages as binary. By default 'String' results use text encoding and 'ByteString' results use binary encoding.
+    | Traced String -- ^ Name to use with 'traced', or @\"\"@ for no tracing. By default traces using the name of the executable.
+    | Timeout Double -- ^ Abort the computation after N seconds, will raise a failure exit code. Calls 'interruptProcessGroupOf' and 'terminateProcess', but may sometimes fail to abort the process and not timeout.
+    | WithStdout Bool -- ^ Should I include the @stdout@ in the exception if the command fails? Defaults to 'False'.
+    | WithStderr Bool -- ^ Should I include the @stderr@ in the exception if the command fails? Defaults to 'True'.
+    | EchoStdout Bool -- ^ Should I echo the @stdout@? Defaults to 'True' unless a 'Stdout' result is required or you use 'FileStdout'.
+    | EchoStderr Bool -- ^ Should I echo the @stderr@? Defaults to 'True' unless a 'Stderr' result is required or you use 'FileStderr'.
+    | FileStdout FilePath -- ^ Should I put the @stdout@ to a file.
+    | FileStderr FilePath -- ^ Should I put the @stderr@ to a file.
+    | AutoDeps -- ^ Compute dependencies automatically. Only works if 'shakeLintInside' has been set to the files where autodeps might live.
+    | UserCommand String -- ^ The command the user thinks about, before any munging. Defaults to the actual command.
+    | FSAOptions String -- ^ Options to @fsatrace@, a list of strings with characters such as @\"r\"@ (reads) @\"w\"@ (writes). Defaults to @\"rwmdqt\"@ if the output of @fsatrace@ is required.
+    | CloseFileHandles -- ^ Before starting the command in the child process, close all file handles except stdin, stdout, stderr in the child process. Uses @close_fds@ from package process and comes with the same caveats, i.e. runtime is linear with the maximum number of open file handles (@RLIMIT_NOFILE@, see @man 2 getrlimit@ on Linux).
+    | NoProcessGroup -- ^ Don't run the process in its own group. Required when running @docker@. Will mean that process timeouts and asyncronous exceptions may not properly clean up child processes.
+    | InheritStdin -- ^ Cause the stdin from the parent to be inherited. Might also require NoProcessGroup on Linux. Ignored if you explicitly pass a stdin.
+      deriving (Eq,Ord,Show,Data,Typeable)
diff --git a/src/Development/Shake/Internal/CompactUI.hs b/src/Development/Shake/Internal/CompactUI.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/CompactUI.hs
@@ -0,0 +1,77 @@
+
+-- | Provide a Buck/Bazel style UI.
+module Development.Shake.Internal.CompactUI(
+    compactUI
+    ) where
+
+import Development.Shake.Internal.CmdOption
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Progress
+
+import System.Time.Extra
+import General.Extra
+import Control.Exception
+import General.Thread
+import General.EscCodes
+import Data.IORef.Extra
+import Control.Monad.Extra
+
+
+data S = S
+    {sOutput :: [String] -- ^ Messages that haven't yet been printed, in reverse.
+    ,sProgress :: String -- ^ Last progress message.
+    ,sTraces :: [Maybe (String, String, Seconds)] -- ^ the traced items, in the order we display them
+    ,sUnwind :: Int -- ^ Number of lines we used last time around
+    }
+
+emptyS = S [] "Starting..." [] 0
+
+addOutput pri msg s = s{sOutput = msg : sOutput s}
+addProgress x s = s{sProgress = x}
+
+addTrace key msg start time s
+    | start = s{sTraces = insert (key,msg,time) $ sTraces s}
+    | otherwise = s{sTraces = remove (\(a,b,_) -> a == key && b == msg) $ sTraces s}
+    where
+        insert v (Nothing:xs) = Just v:xs
+        insert v (x:xs) = x : insert v xs
+        insert v [] = [Just v]
+
+        remove f (Just x:xs) | f x = Nothing:xs
+        remove f (x:xs) = x : remove f xs
+        remove f [] = []
+
+
+display :: Seconds -> S -> (S, String)
+display time s = (s{sOutput=[], sUnwind=length post}, escCursorUp (sUnwind s) ++ unlines (map pad $ pre ++ post))
+    where
+        pre = sOutput s
+        post = "" : (escForeground Green ++ "Status: " ++ sProgress s ++ escNormal) : map f (sTraces s)
+
+        pad x = x ++ escClearLine
+        f Nothing = " *"
+        f (Just (k,m,t)) = " * " ++ k ++ " (" ++ g (time - t) m ++ ")"
+
+        g i m | showDurationSecs i == "0s" = m
+              | i < 10 = s
+              | otherwise = escForeground (if i > 20 then Red else Yellow) ++ s ++ escNormal
+            where s = m ++ " " ++ showDurationSecs i
+
+
+-- | Run a compact UI, with the ShakeOptions modifier, combined with
+compactUI :: ShakeOptions -> IO (ShakeOptions, IO ())
+compactUI opts = do
+    unlessM checkEscCodes $
+        putStrLn "Your terminal does not appear to support escape codes, --compact mode may not work"
+    ref <- newIORef emptyS
+    let tweak = atomicModifyIORef_ ref
+    time <- offsetTime
+    opts <- pure $ opts
+        {shakeTrace = \a b c -> do t <- time; tweak (addTrace a b c t)
+        ,shakeOutput = \a b -> tweak (addOutput a b)
+        ,shakeProgress = \x -> void $ progressDisplay 1 (tweak . addProgress) x `withThreadsBoth` shakeProgress opts x
+        ,shakeCommandOptions = [EchoStdout False, EchoStderr False] ++ shakeCommandOptions opts
+        ,shakeVerbosity = Error
+        }
+    let tick = do t <- time; mask_ $ putStr =<< atomicModifyIORef ref (display t)
+    pure (opts, forever (tick >> sleep 0.4) `finally` tick)
diff --git a/src/Development/Shake/Internal/Core/Action.hs b/src/Development/Shake/Internal/Core/Action.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Core/Action.hs
@@ -0,0 +1,639 @@
+{-# LANGUAGE RecordWildCards, NamedFieldPuns, ScopedTypeVariables, ConstraintKinds, TupleSections #-}
+
+module Development.Shake.Internal.Core.Action(
+    actionOnException, actionFinally, actionBracket, actionCatch, actionRetry,
+    getShakeOptions, getProgress, runAfter,
+    lintTrackRead, lintTrackWrite, lintTrackAllow,
+    getVerbosity, putWhen, putVerbose, putInfo, putWarn, putError, withVerbosity, quietly,
+    orderOnlyAction,
+    newCacheIO,
+    unsafeExtraThread,
+    parallel,
+    batch,
+    reschedule,
+    historyDisable,
+    traced,
+    -- Internal only
+    producesChecked, producesUnchecked, producesCheck, lintCurrentDirectory, lintWatch,
+    blockApply, unsafeAllowApply, shakeException, lintTrackFinished,
+    getCurrentKey, getLocal,
+    actionShareList, actionShareRemove, actionShareSanity
+    ) where
+
+import Control.Exception
+import Control.Monad.Extra
+import Control.Monad.IO.Class
+import Control.DeepSeq
+import Data.Typeable
+import System.Directory
+import System.FilePattern
+import System.FilePattern.Directory
+import System.Time.Extra
+import Control.Concurrent.Extra
+import Data.Maybe
+import Data.Tuple.Extra
+import Data.IORef.Extra
+import Data.List.Extra
+import Numeric.Extra
+import General.Extra
+import qualified Data.HashMap.Strict as Map
+import qualified Data.HashSet as Set
+
+import Development.Shake.Classes
+import Development.Shake.Internal.Core.Monad
+import Development.Shake.Internal.Core.Database
+import Development.Shake.Internal.History.Shared
+import General.Pool
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Core.Pool
+import Development.Shake.Internal.Value
+import Development.Shake.Internal.FileInfo
+import Development.Shake.Internal.FileName
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Errors
+import General.Cleanup
+import General.Fence
+
+
+---------------------------------------------------------------------
+-- RAW WRAPPERS
+
+-- | Apply a modification, run an action, then run an undo action after.
+--   Doesn't actually require exception handling because we don't have the ability to catch exceptions to the user.
+actionThenUndoLocal :: (Local -> (Local, Local -> Local)) -> Action a -> Action a
+actionThenUndoLocal f m = Action $ do
+    s <- getRW
+    let (s2,undo) = f s
+    putRW s2
+    res <- fromAction m
+    modifyRW undo
+    pure res
+
+
+---------------------------------------------------------------------
+-- EXCEPTION HANDLING
+
+-- | Turn a normal exception into a ShakeException, giving it a stack and printing it out if in staunch mode.
+--   If the exception is already a ShakeException (e.g. it's a child of ours who failed and we are rethrowing)
+--   then do nothing with it.
+shakeException :: Global -> Stack -> SomeException -> IO ShakeException
+shakeException Global{globalOptions=ShakeOptions{..},..} stk e = case fromException e of
+    Just (e :: ShakeException) -> pure e
+    Nothing -> do
+        e<- pure $ exceptionStack stk e
+        when (shakeStaunch && shakeVerbosity >= Error) $
+            globalOutput Error $ show e ++ "Continuing due to staunch mode"
+        pure e
+
+
+actionBracketEx :: Bool -> IO a -> (a -> IO b) -> (a -> Action c) -> Action c
+actionBracketEx runOnSuccess alloc free act = do
+    Global{..} <- Action getRO
+    (v, key) <- liftIO $ mask_ $ do
+        v <- alloc
+        key <- liftIO $ register globalCleanup $ void $ free v
+        pure (v, key)
+    res <- Action $ catchRAW (fromAction $ act v) $ \e -> liftIO (release key) >> throwRAW e
+    liftIO $ if runOnSuccess then release key else unprotect key
+    pure res
+
+-- | If an exception is raised by the 'Action', perform some 'IO' then reraise the exception.
+--   This function is implemented using 'actionBracket'.
+actionOnException :: Action a -> IO b -> Action a
+actionOnException act free = actionBracketEx False (pure ()) (const free) (const act)
+
+-- | After an 'Action', perform some 'IO', even if there is an exception.
+--   This function is implemented using 'actionBracket'.
+actionFinally :: Action a -> IO b -> Action a
+actionFinally act free = actionBracket (pure ()) (const free) (const act)
+
+-- | Like 'bracket', but where the inner operation is of type 'Action'. Usually used as
+--   @'actionBracket' alloc free use@.
+--
+--   The @free@ action will be run masked. The cost of 'actionBracket' is _O(n log n)_
+--   in the number of simultaneous 'actionBracket' calls active in the program.
+actionBracket :: IO a -> (a -> IO b) -> (a -> Action c) -> Action c
+actionBracket = actionBracketEx True
+
+
+-- | If a syncronous exception is raised by the 'Action', perform some handler.
+--   Note that there is no guarantee that the handler will run on shutdown (use 'actionFinally' for that),
+--   and that 'actionCatch' /cannot/ catch exceptions thrown by dependencies, e.g. raised by 'need'
+--   (to do so would allow untracked dependencies on failure conditions).
+actionCatch :: Exception e => Action a -> (e -> Action a) -> Action a
+actionCatch act hdl = Action $ catchRAW (fromAction act) $ \e ->
+    case () of
+        _ | not $ isAsyncException e
+          , Nothing <- fromException e :: Maybe ShakeException
+          , Just e <- fromException e
+          -> fromAction $ hdl e
+        _ -> throwRAW e
+
+
+-- | Retry an 'Action' if it throws an exception, at most /n/ times (where /n/ must be positive).
+--   If you need to call this function, you should probably try and fix the underlying cause (but you also probably know that).
+actionRetry :: Int -> Action a -> Action a
+actionRetry i act
+    | i <= 0 = fail $ "actionRetry first argument must be positive, got " ++ show i
+    | i == 1 = act
+    | otherwise = Action $ catchRAW (fromAction act) $ \_ -> fromAction $ actionRetry (i-1) act
+
+
+---------------------------------------------------------------------
+-- QUERIES
+
+-- | Get the initial 'ShakeOptions', these will not change during the build process.
+getShakeOptions :: Action ShakeOptions
+getShakeOptions = Action $ globalOptions <$> getRO
+
+
+-- | Get the current 'Progress' structure, as would be returned by 'shakeProgress'.
+getProgress :: Action Progress
+getProgress = do
+    Global{..} <- Action getRO
+    liftIO globalProgress
+
+-- | Specify an action to be run after the database has been closed, if building completes successfully.
+runAfter :: IO () -> Action ()
+runAfter op = do
+    Global{..} <- Action getRO
+    liftIO $ atomicModifyIORef_ globalAfter (op:)
+
+
+---------------------------------------------------------------------
+-- VERBOSITY
+
+putWhen :: Verbosity -> String -> Action ()
+putWhen v msg = do
+    Global{..} <- Action getRO
+    verb <- getVerbosity
+    when (verb >= v) $
+        liftIO $ globalOutput v msg
+
+
+-- | Write an unimportant message to the output, only shown when 'shakeVerbosity' is higher than normal ('Verbose' or above).
+--   The output will not be interleaved with any other Shake messages (other than those generated by system commands).
+putVerbose :: String -> Action ()
+putVerbose = putWhen Verbose
+
+-- | Write a normal priority message to the output, only suppressed when 'shakeVerbosity' is 'Error', 'Warn' or 'Silent'.
+--   The output will not be interleaved with any other Shake messages (other than those generated by system commands).
+putInfo :: String -> Action ()
+putInfo = putWhen Info
+
+-- | Write a semi important message to the output, only suppressed when 'shakeVerbosity' is 'Error' or 'Silent'.
+--   The output will not be interleaved with any other Shake messages (other than those generated by system commands).
+putWarn :: String -> Action ()
+putWarn = putWhen Warn
+
+-- | Write an important message to the output, only suppressed when 'shakeVerbosity' is 'Silent'.
+--   The output will not be interleaved with any other Shake messages (other than those generated by system commands).
+putError :: String -> Action ()
+putError = putWhen Error
+
+
+-- | Get the current verbosity level, originally set by 'shakeVerbosity'. If you
+--   want to output information to the console, you are recommended to use
+--   'putVerbose' \/ 'putInfo' \/ 'putError', which ensures multiple messages are
+--   not interleaved. The verbosity can be modified locally by 'withVerbosity'.
+getVerbosity :: Action Verbosity
+getVerbosity = Action $ localVerbosity <$> getRW
+
+
+-- | Run an action with a particular verbosity level.
+--   Will not update the 'shakeVerbosity' returned by 'getShakeOptions' and will
+--   not have any impact on 'Diagnostic' tracing.
+withVerbosity :: Verbosity -> Action a -> Action a
+withVerbosity new = actionThenUndoLocal $ \s0 ->
+    (s0{localVerbosity=new}, \s -> s{localVerbosity=localVerbosity s0})
+
+
+-- | Run an action with 'Error' verbosity, in particular messages produced by 'traced'
+--   (including from 'Development.Shake.cmd' or 'Development.Shake.command') will not be printed to the screen.
+--   Will not update the 'shakeVerbosity' returned by 'getShakeOptions' and will
+--   not turn off any 'Diagnostic' tracing.
+quietly :: Action a -> Action a
+quietly = withVerbosity Error
+
+
+---------------------------------------------------------------------
+-- BLOCK APPLY
+
+unsafeAllowApply :: Action a -> Action a
+unsafeAllowApply  = applyBlockedBy Nothing
+
+blockApply :: String -> Action a -> Action a
+blockApply = applyBlockedBy . Just
+
+applyBlockedBy :: Maybe String -> Action a -> Action a
+applyBlockedBy reason = actionThenUndoLocal $ \s0 ->
+    (s0{localBlockApply=reason}, \s -> s{localBlockApply=localBlockApply s0})
+
+
+---------------------------------------------------------------------
+-- TRACING
+
+-- | Write an action to the trace list, along with the start/end time of running the IO action.
+--   The 'Development.Shake.cmd' and 'Development.Shake.command' functions automatically call 'traced'
+--   with the name of the executable. The trace list is used for profile reports (see 'shakeReport').
+--
+--   By default 'traced' prints some useful extra context about what
+--   Shake is building, e.g.:
+--
+-- > # traced message (for myobject.o)
+--
+--   To suppress the output of 'traced' (for example you want more control
+--   over the message using 'putInfo'), use the 'quietly' combinator.
+--
+--   It is recommended that the string passed to 'traced' is short and that only a small number of unique strings
+--   are used (makes profiling work better).
+--   The string does not need to make sense on its own, only in conjunction with the target it is building.
+traced :: String -> IO a -> Action a
+traced msg act = do
+    Global{..} <- Action getRO
+    Local{localStack} <- Action getRW
+    start <- liftIO globalTimestamp
+    let key = showTopStack localStack
+    putInfo $ "# " ++ msg ++ " (for " ++ key ++ ")"
+    res <- liftIO $
+        (shakeTrace globalOptions key msg True >> act)
+            `finally` shakeTrace globalOptions key msg False
+    stop <- liftIO globalTimestamp
+    let trace = newTrace msg start stop
+    liftIO $ evaluate $ rnf trace
+    Action $ modifyRW $ \s -> s{localTraces = addTrace (localTraces s) trace}
+    pure res
+
+
+---------------------------------------------------------------------
+-- TRACKING
+
+-- | Track that a key has been used/read by the action preceding it when 'shakeLint' is active.
+lintTrackRead :: ShakeValue key => [key] -> Action ()
+-- One of the following must be true:
+-- 1) you are the one building this key (e.g. key == topStack)
+-- 2) you have already been used by apply, and are on the dependency list
+-- 3) someone explicitly gave you permission with trackAllow
+-- 4) at the end of the rule, a) you are now on the dependency list, and b) this key itself has no dependencies (is source file)
+lintTrackRead ks = do
+    Global{..} <- Action getRO
+    when (isJust $ shakeLint globalOptions) $ do
+        l@Local{..} <- Action getRW
+        deps <- liftIO $ concatMapM (listDepends globalDatabase) $ enumerateDepends localDepends
+        let top = topStack localStack
+
+        let condition1 k = top == Just k
+        let condition2 k = k `elem` deps
+        let condition3 k = any ($ k) localTrackAllows
+        let condition4 = filter (\k -> not $ condition1 k || condition2 k || condition3 k) $ map newKey ks
+        unless (null condition4) $
+            Action $ putRW l{localTrackRead = condition4 ++ localTrackRead}
+
+
+-- | Track that a key has been changed/written by the action preceding it when 'shakeLint' is active.
+lintTrackWrite :: ShakeValue key => [key] -> Action ()
+-- One of the following must be true:
+-- 1) you are the one building this key (e.g. key == topStack)
+-- 2) someone explicitly gave you permission with trackAllow
+-- 3) this file is never known to the build system, at the end it is not in the database
+lintTrackWrite ks = do
+    Global{..} <- Action getRO
+    when (isJust $ shakeLint globalOptions) $ do
+        l@Local{..} <- Action getRW
+        let top = topStack localStack
+
+        let condition1 k = Just k == top
+        let condition2 k = any ($ k) localTrackAllows
+        let condition3 = filter (\k -> not $ condition1 k || condition2 k) $ map newKey ks
+        unless (null condition3) $
+            Action $ putRW l{localTrackWrite = condition3 ++ localTrackWrite}
+
+
+lintTrackFinished :: Action ()
+lintTrackFinished = do
+    -- only called when isJust shakeLint
+    Global{..} <- Action getRO
+    Local{..} <- Action getRW
+    liftIO $ do
+        let top = topStack localStack
+        -- must apply the ignore at the end, because we might have merged in more ignores that
+        -- apply to other branches
+        let ignore k = any ($ k) localTrackAllows
+
+        -- Read stuff
+        deps <- concatMapM (listDepends globalDatabase) $ enumerateDepends localDepends
+        let used = Set.filter (not . ignore) $ Set.fromList localTrackRead
+
+        -- check Read 4a
+        bad<- pure $ Set.toList $ used `Set.difference` Set.fromList deps
+        unless (null bad) $ do
+            let n = length bad
+            throwM $ errorStructured
+                ("Lint checking error - " ++ (if n == 1 then "value was" else show n ++ " values were") ++ " used but not depended upon")
+                [("Used", Just $ show x) | x <- bad]
+                ""
+
+        -- check Read 4b
+        bad <- flip filterM (Set.toList used) $ \k -> not . null <$> lookupDependencies globalDatabase k
+        unless (null bad) $ do
+            let n = length bad
+            throwM $ errorStructured
+                ("Lint checking error - " ++ (if n == 1 then "value was" else show n ++ " values were") ++ " depended upon after being used")
+                [("Used", Just $ show x) | x <- bad]
+                ""
+
+        -- check Write 3
+        bad<- pure $ filter (not . ignore) $ Set.toList $ Set.fromList localTrackWrite
+        unless (null bad) $
+            liftIO $ atomicModifyIORef_ globalTrackAbsent ([(fromMaybe k top, k) | k <- bad] ++)
+
+
+-- | Allow any matching key recorded with 'lintTrackRead' or 'lintTrackWrite' in this action,
+--   after this call, to violate the tracking rules.
+lintTrackAllow :: ShakeValue key => (key -> Bool) -> Action ()
+lintTrackAllow (test :: key -> Bool) = do
+    Global{..} <- Action getRO
+    when (isJust $ shakeLint globalOptions) $
+        Action $ modifyRW $ \s -> s{localTrackAllows = f : localTrackAllows s}
+    where
+        tk = typeRep (Proxy :: Proxy key)
+        f k = typeKey k == tk && test (fromKey k)
+
+
+lintCurrentDirectory :: FilePath -> String -> IO ()
+lintCurrentDirectory old msg = do
+    now <- getCurrentDirectory
+    when (old /= now) $ throwIO $ errorStructured
+        "Lint checking error - current directory has changed"
+        [("When", Just msg)
+        ,("Wanted",Just old)
+        ,("Got",Just now)]
+        ""
+
+lintWatch :: [FilePattern] -> IO (String -> IO ())
+lintWatch [] = pure $ const $ pure ()
+lintWatch pats = do
+    let op = getDirectoryFiles "." pats -- cache parsing of the pats
+    let record = do xs <- op; forM xs $ \x -> (x,) <$> getFileInfo False (fileNameFromString x)
+    old <- record
+    pure $ \msg -> do
+        now <- record
+        when (old /= now) $ throwIO $ errorStructured
+            "Lint checking error - watched files have changed"
+            (("When", Just msg) : changes (Map.fromList old) (Map.fromList now))
+            ""
+    where
+        changes old now =
+            [("Created", Just x) | x <- Map.keys $ Map.difference now old] ++
+            [("Deleted", Just x) | x <- Map.keys $ Map.difference old now] ++
+            [("Changed", Just x) | x <- Map.keys $ Map.filter id $ Map.intersectionWith (/=) old now]
+
+
+listDepends :: Database -> Depends -> IO [Key]
+listDepends db (Depends xs) = mapM (fmap (fst . fromJust) . getKeyValueFromId db) xs
+
+
+lookupDependencies :: Database -> Key -> IO [Depends]
+lookupDependencies db k = do
+    Just (Ready r) <- getValueFromKey db k
+    pure $ depends r
+
+
+-- | This rule should not be saved to shared/cloud storage via 'shakeShare'.
+--   There are usually two reasons to call this function:
+--
+--   1. It makes use of untracked dependencies that are specific to this machine,
+--      e.g. files in a system directory or items on the @$PATH@.
+--   2. The rule is trivial to compute locally, so there is no point sharing it.
+--
+--   If you want the rule to not be cached at all, use 'alwaysRerun'.
+historyDisable :: Action ()
+historyDisable = Action $ modifyRW $ \s -> s{localHistory = False}
+
+
+-- | A version of 'produces' that checks the files actually exist
+producesChecked :: [FilePath] -> Action ()
+producesChecked xs = Action $ modifyRW $ \s -> s{localProduces = map (True,) (reverse xs) ++ localProduces s}
+
+-- | A version of 'produces' that does not check.
+producesUnchecked :: [FilePath] -> Action ()
+producesUnchecked xs = Action $ modifyRW $ \s -> s{localProduces = map (False,) (reverse xs) ++ localProduces s}
+
+producesCheck :: Action ()
+producesCheck = do
+    Local{localProduces} <- Action getRW
+    missing <- liftIO $ filterM (notM . doesFileExist_) $ map snd $ filter fst localProduces
+    when (missing /= []) $ throwM $ errorStructured
+        "Files declared by 'produces' not produced"
+        [("File " ++ show i, Just x) | (i,x) <- zipFrom 1 missing]
+        ""
+
+
+-- | Run an action but do not depend on anything the action uses.
+--   A more general version of 'orderOnly'.
+orderOnlyAction :: Action a -> Action a
+orderOnlyAction act = Action $ do
+    Local{localDepends=pre} <- getRW
+    res <- fromAction act
+    modifyRW $ \s -> s{localDepends=pre}
+    pure res
+
+
+---------------------------------------------------------------------
+-- MORE COMPLEX
+
+-- | A version of 'Development.Shake.newCache' that runs in IO, and can be called before calling 'Development.Shake.shake'.
+--   Most people should use 'Development.Shake.newCache' instead.
+newCacheIO :: (Eq k, Hashable k) => (k -> Action v) -> IO (k -> Action v)
+newCacheIO (act :: k -> Action v) = do
+    var :: Var (Map.HashMap k (Fence IO (Either SomeException (DependsList,v)))) <- newVar Map.empty
+    pure $ \key ->
+        join $ liftIO $ modifyVar var $ \mp -> case Map.lookup key mp of
+            Just bar -> pure $ (,) mp $ do
+                (offset, (deps, v)) <- actionFenceRequeue bar
+                Action $ modifyRW $ \s -> addDiscount offset $ s{localDepends = addDepends (localDepends s) deps}
+                pure v
+            Nothing -> do
+                bar <- newFence
+                pure $ (Map.insert key bar mp,) $ do
+                    Local{localDepends=pre} <- Action getRW
+                    Action $ modifyRW $ \s -> s{localDepends = newDepends []}
+                    res <- Action $ tryRAW $ fromAction $ act key
+                    case res of
+                        Left err -> do
+                            liftIO $ signalFence bar $ Left err
+                            Action $ throwRAW err
+                        Right v -> do
+                            Local{localDepends=deps} <- Action getRW
+                            Action $ modifyRW $ \s -> s{localDepends = addDepends pre deps}
+                            liftIO $ signalFence bar $ Right (deps, v)
+                            pure v
+
+
+-- | Run an action without counting to the thread limit, typically used for actions that execute
+--   on remote machines using barely any local CPU resources.
+--   Unsafe as it allows the 'shakeThreads' limit to be exceeded.
+--   You cannot depend on a rule (e.g. 'need') while the extra thread is executing.
+--   If the rule blocks (e.g. calls 'withResource') then the extra thread may be used by some other action.
+--   Only really suitable for calling 'cmd' / 'command'.
+unsafeExtraThread :: Action a -> Action a
+unsafeExtraThread act = do
+    Global{..} <- Action getRO
+    stop <- liftIO $ increasePool globalPool
+    res <- Action $ tryRAW $ fromAction $ blockApply "Within unsafeExtraThread" act
+    liftIO stop
+    -- we start a new thread, giving up ours, to ensure the thread count goes down
+    (wait, res) <- actionAlwaysRequeue res
+    Action $ modifyRW $ addDiscount wait
+    pure res
+
+
+-- | Execute a list of actions in parallel. In most cases 'need' will be more appropriate to benefit from parallelism.
+--   If the two types of 'Action' are different dependencies which ultimately boil down to 'apply',
+--   using 'Applicative' operations will still ensure the dependencies occur in parallel.
+--   The main use of this function is to run work that happens in an 'Action' in parallel.
+parallel :: [Action a] -> Action [a]
+-- Note: There is no parallel_ unlike sequence_ because there is no stack benefit to doing so
+parallel [] = pure []
+parallel [x] = pure <$> x
+parallel acts = do
+    Global{..} <- Action getRO
+
+    done <- liftIO $ newIORef False
+    waits <- forM acts $ \act ->
+        addPoolWait PoolResume $ do
+            whenM (liftIO $ readIORef done) $
+                fail "parallel, one has already failed"
+            Action $ modifyRW localClearMutable
+            res <- act
+            old <- Action getRW
+            pure (old, res)
+    (wait, res) <- actionFenceSteal =<< liftIO (exceptFence waits)
+    liftIO $ atomicWriteIORef done True
+    let (waits, locals, results) = unzip3 $ map (\(a,(b,c)) -> (a,b,c)) res
+    Action $ modifyRW $ \root -> addDiscount (wait - sum waits) $ localMergeMutable root locals
+    pure results
+
+
+-- | Batch different outputs into a single 'Action', typically useful when a command has a high
+--   startup cost - e.g. @apt-get install foo bar baz@ is a lot cheaper than three separate
+--   calls to @apt-get install@. As an example, if we have a standard build rule:
+--
+-- @
+-- \"*.out\" 'Development.Shake.%>' \\out -> do
+--     'Development.Shake.need' [out '-<.>' \"in\"]
+--     'Development.Shake.cmd' "build-multiple" [out '-<.>' \"in\"]
+-- @
+--
+--   Assuming that @build-multiple@ can compile multiple files in a single run,
+--   and that the cost of doing so is a lot less than running each individually,
+--   we can write:
+--
+-- @
+-- 'batch' 3 (\"*.out\" 'Development.Shake.%>')
+--     (\\out -> do 'Development.Shake.need' [out '-<.>' \"in\"]; pure out)
+--     (\\outs -> 'Development.Shake.cmd' "build-multiple" [out '-<.>' \"in\" | out \<- outs])
+-- @
+--
+--   In constrast to the normal call, we have specified a maximum batch size of 3,
+--   an action to run on each output individually (typically all the 'need' dependencies),
+--   and an action that runs on multiple files at once. If we were to require lots of
+--   @*.out@ files, they would typically be built in batches of 3.
+--
+--   If Shake ever has nothing else to do it will run batches before they are at the maximum,
+--   so you may see much smaller batches, especially at high parallelism settings.
+batch
+    :: Int   -- ^ Maximum number to run in a single batch, e.g. @3@, must be positive.
+    -> ((a -> Action ()) -> Rules ()) -- ^ Way to match an entry, e.g. @\"*.ext\" '%>'@.
+    -> (a -> Action b)  -- ^ Preparation to run individually on each, e.g. using 'need'.
+    -> ([b] -> Action ())  -- ^ Combination action to run on all, e.g. using 'cmd'.
+    -> Rules ()
+batch mx pred one many
+    | mx <= 0 = error $ "Can't call batchable with <= 0, you used " ++ show mx
+    | mx == 1 = pred $ \a -> do b <- one a; many [b]
+    | otherwise = do
+        todo :: IORef (Int, [(b, Local, Fence IO (Either SomeException (Seconds, Local)))]) <- liftIO $ newIORef (0, [])
+        pred $ \a -> do
+            b <- one a
+            fence <- liftIO newFence
+            -- add one to the batch
+            local <- Action getRW
+            count <- liftIO $ atomicModifyIORef todo $ \(count, bs) -> let i = count+1 in ((i, (b,local,fence):bs), i)
+            requeue todo (==) count
+            (wait, (cost, local2)) <- actionFenceRequeue fence
+            Action $ modifyRW $ \root -> addDiscount (wait - cost) $ localMergeMutable root [local2]
+    where
+        -- When changing by one, only trigger on (==) so we don't have lots of waiting pool entries
+        -- When changing by many, trigger on (>=) because we don't hit all edges
+        requeue todo trigger count
+            | count `trigger` mx = addPoolWait_ PoolResume $ go todo
+            | count `trigger` 1  = addPoolWait_ PoolBatch  $ go todo
+            | otherwise = pure ()
+
+        go todo = do
+            -- delete at most mx from the batch
+            (now, count) <- liftIO $ atomicModifyIORef todo $ \(count, bs) ->
+                let (now,later) = splitAt mx bs
+                    count2 = if count > mx then count - mx else 0
+                in ((count2, later), (now, count2))
+            requeue todo (>=) count
+
+            unless (null now) $ do
+                res <- Action $ tryRAW $ do
+                    -- make sure we are using one of the local's that we are computing
+                    -- we things like stack, blockApply etc. work as expected
+                    modifyRW $ const $ localClearMutable $ snd3 $ headErr now
+                    start <- liftIO offsetTime
+                    fromAction $ many $ map fst3 now
+                    end <- liftIO start
+
+                    -- accounting for time is tricky, we spend time T, over N jobs
+                    -- so want to charge everyone for T / N time
+                    -- but that also means we need to subtract localDiscount so we don't apply that to all
+                    rw <- getRW
+                    let t = end - localDiscount rw
+                    let n = intToDouble (length now)
+                    pure (t / n, rw{localDiscount = 0})
+                liftIO $ mapM_ (flip signalFence res . thd3) now
+
+
+-- | Given a running task, reschedule so it only continues after all other pending tasks,
+--   and all rescheduled tasks with a higher pool priority. Note that due to parallelism there is no guarantee
+--   that all actions of a higher pool priority will have /completed/ before the action resumes.
+--   Only useful if the results are being interactively reported or consumed.
+reschedule :: Double -> Action ()
+reschedule x = do
+    (wait, _) <- actionAlwaysRequeuePriority (PoolDeprioritize $ negate x) $ pure ()
+    Action $ modifyRW $ addDiscount wait
+
+
+getCurrentKey :: Action (Maybe Key)
+getCurrentKey = Action $ topStack . localStack <$> getRW
+
+getLocal :: Action Local
+getLocal = Action getRW
+
+-- | Hooked up to --share-remove
+actionShareRemove :: [String] -> Action ()
+actionShareRemove substrs = do
+    Global{..} <- Action getRO
+    case globalShared of
+        Nothing -> throwM $ errorInternal "actionShareRemove with no shared"
+        Just x -> liftIO $ removeShared x $ \k -> any (`isInfixOf` show k) substrs
+
+-- | Hooked up to --share-list
+actionShareList :: Action ()
+actionShareList = do
+    Global{..} <- Action getRO
+    case globalShared of
+        Nothing -> throwM $ errorInternal "actionShareList with no shared"
+        Just x -> liftIO $ listShared x
+
+-- | Hooked up to --share-sanity
+actionShareSanity :: Action ()
+actionShareSanity = do
+    Global{..} <- Action getRO
+    case globalShared of
+        Nothing -> throwM $ errorInternal "actionShareSanity with no shared"
+        Just x -> liftIO $ sanityShared x
diff --git a/src/Development/Shake/Internal/Core/Build.hs b/src/Development/Shake/Internal/Core/Build.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Core/Build.hs
@@ -0,0 +1,346 @@
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE RecordWildCards, PatternGuards, ScopedTypeVariables, NamedFieldPuns, GADTs #-}
+{-# LANGUAGE Rank2Types, ConstraintKinds, TypeOperators, TupleSections, ViewPatterns #-}
+
+module Development.Shake.Internal.Core.Build(
+    getDatabaseValue, getDatabaseValueGeneric,
+    historyIsEnabled, historySave, historyLoad,
+    applyKeyValue,
+    apply, apply1,
+    ) where
+
+import Development.Shake.Classes
+import General.Pool
+import Development.Shake.Internal.Core.Database
+import Development.Shake.Internal.Value
+import Development.Shake.Internal.Errors
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.History.Shared
+import Development.Shake.Internal.History.Cloud
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Core.Monad
+import General.Wait
+import qualified Data.ByteString.Char8 as BS
+import Control.Monad.IO.Class
+import General.Extra
+import General.Intern(Id)
+
+import Control.Exception
+import Control.Monad.Extra
+import Numeric.Extra
+import qualified Data.HashMap.Strict as Map
+import Development.Shake.Internal.Core.Rules
+import Data.Typeable
+import Data.Maybe
+import Data.List.Extra
+import Data.Either.Extra
+import System.Time.Extra
+
+
+---------------------------------------------------------------------
+-- LOW-LEVEL OPERATIONS ON THE DATABASE
+
+setIdKeyStatus :: Global -> Database -> Id -> Key -> Status -> Locked ()
+setIdKeyStatus Global{..} db i k v = do
+    liftIO $ globalDiagnostic $ do
+        -- actually safe because we only lose the Locked to enter the diagnostic context
+        old <- getKeyValueFromId db i
+        let changeStatus = maybe "Missing" (statusType . snd) old ++ " -> " ++ statusType v ++ ", " ++ maybe "<unknown>" (show . fst) old
+        let changeValue = case v of
+                Ready r -> Just $ "    = " ++ showBracket (result r) ++ " " ++
+                    if changed r == globalStep then "(changed)"
+                    else if built r == globalStep then "(unchanged)"
+                    else "(didn't run)"
+                _ -> Nothing
+        pure $ changeStatus ++ maybe "" ("\n" ++) changeValue
+    setMem db i k v
+
+
+---------------------------------------------------------------------
+-- QUERIES
+
+getDatabaseValue :: (RuleResult key ~ value, ShakeValue key, Typeable value) => key -> Action (Maybe (Result (Either BS.ByteString value)))
+getDatabaseValue k =
+    fmap (fmap $ fmap $ fmap fromValue) $ getDatabaseValueGeneric $ newKey k
+
+getDatabaseValueGeneric :: Key -> Action (Maybe (Result (Either BS.ByteString Value)))
+getDatabaseValueGeneric k = do
+    Global{..} <- Action getRO
+    Just status <- liftIO $ getValueFromKey globalDatabase k
+    pure $ getResult status
+
+
+---------------------------------------------------------------------
+-- NEW STYLE PRIMITIVES
+
+-- | Lookup the value for a single Id, may need to spawn it
+lookupOne :: Global -> Stack -> Database -> Id -> Wait Locked (Either SomeException (Result (Value, BS_Store)))
+lookupOne global stack database i = do
+    res <- quickly $ liftIO $ getKeyValueFromId database i
+    case res of
+        Nothing -> Now $ Left $ errorStructured "Shake Id no longer exists" [("Id", Just $ show i)] ""
+        Just (k, s) -> case s of
+            Ready r -> Now $ Right r
+            Failed e _ -> Now $ Left e
+            Running{} | Left e <- addStack i k stack -> Now $ Left e
+            _ -> Later $ \continue -> do
+                Just (_, s) <- liftIO $ getKeyValueFromId database i
+                case s of
+                    Ready r -> continue $ Right r
+                    Failed e _ -> continue $ Left e
+                    Running (NoShow w) r -> do
+                        let w2 v = w v >> continue v
+                        setMem database i k $ Running (NoShow w2) r
+                    Loaded r -> buildOne global stack database i k (Just r) `fromLater` continue
+                    Missing -> buildOne global stack database i k Nothing `fromLater` continue
+
+
+-- | Build a key, must currently be either Loaded or Missing, changes to Waiting
+buildOne :: Global -> Stack -> Database -> Id -> Key -> Maybe (Result BS.ByteString) -> Wait Locked (Either SomeException (Result (Value, BS_Store)))
+buildOne global@Global{..} stack database i k r = case addStack i k stack of
+    Left e -> do
+        quickly $ setIdKeyStatus global database i k $ mkError e
+        pure $ Left e
+    Right stack -> Later $ \continue -> do
+        setIdKeyStatus global database i k (Running (NoShow continue) r)
+        let go = buildRunMode global stack database r
+        fromLater go $ \mode -> liftIO $ addPool PoolStart globalPool $
+            runKey global stack k r mode $ \res -> do
+                runLocked database $ do
+                    let val = fmap runValue res
+                    res <- liftIO $ getKeyValueFromId database i
+                    w <- case res of
+                        Just (_, Running (NoShow w) _) -> pure w
+                        -- We used to be able to hit here, but we fixed it by ensuring the thread pool workers are all
+                        -- dead _before_ any exception bubbles up
+                        _ -> throwM $ errorInternal $ "expected Waiting but got " ++ maybe "nothing" (statusType . snd) res ++ ", key " ++ show k
+                    setIdKeyStatus global database i k $ either mkError Ready val
+                    w val
+                case res of
+                    Right RunResult{..} | runChanged /= ChangedNothing -> setDisk database i k $ Loaded runValue{result=runStore}
+                    _ -> pure ()
+    where
+        mkError e = Failed e $ if globalOneShot then Nothing else r
+
+
+-- | Compute the value for a given RunMode and a restore function to run
+buildRunMode :: Global -> Stack -> Database -> Maybe (Result a) -> Wait Locked RunMode
+buildRunMode global stack database me = do
+    changed <- case me of
+        Nothing -> pure True
+        Just me -> buildRunDependenciesChanged global stack database me
+    pure $ if changed then RunDependenciesChanged else RunDependenciesSame
+
+
+-- | Have the dependencies changed
+buildRunDependenciesChanged :: Global -> Stack -> Database -> Result a -> Wait Locked Bool
+buildRunDependenciesChanged global stack database me = isJust <$> firstJustM id
+    [firstJustWaitUnordered (fmap test . lookupOne global stack database) x | Depends x <- depends me]
+    where
+        test (Right dep) | changed dep <= built me = Nothing
+        test _ = Just ()
+
+
+---------------------------------------------------------------------
+-- ACTUAL WORKERS
+
+applyKeyValue :: [String] -> [Key] -> Action [Value]
+applyKeyValue callStack ks = do
+    -- this is the only place a user can inject a key into our world, so check they aren't throwing
+    -- in unevaluated bottoms
+    liftIO $ mapM_ (evaluate . rnf) ks
+
+    global@Global{..} <- Action getRO
+    Local{localStack, localBlockApply} <- Action getRW
+    let stack = addCallStack callStack localStack
+
+    let tk = typeKey $ headDef (newKey ()) ks -- always called at non-empty so never see () key
+    whenJust localBlockApply $ throwM . errorNoApply tk (show <$> listToMaybe ks)
+
+    let database = globalDatabase
+    (is, wait) <- liftIO $ runLocked database $ do
+        is <- mapM (mkId database) ks
+        wait <- runWait $ do
+            x <- firstJustWaitUnordered (fmap (either Just (const Nothing)) . lookupOne global stack database) $ nubOrd is
+            case x of
+                Just e -> pure $ Left e
+                Nothing -> quickly $ Right <$> mapM (fmap (\(Just (_, Ready r)) -> fst $ result r) . liftIO . getKeyValueFromId database) is
+        pure (is, wait)
+    Action $ modifyRW $ \s -> s{localDepends = addDepends1 (localDepends s) $ Depends is}
+
+    case wait of
+        Now vs -> either throwM pure vs
+        _ -> do
+            offset <- liftIO offsetTime
+            vs <- Action $ captureRAW $ \continue ->
+                runLocked globalDatabase $ fromLater wait $ \x ->
+                    liftIO $ addPool (if isLeft x then PoolException else PoolResume) globalPool $ continue x
+            offset <- liftIO offset
+            Action $ modifyRW $ addDiscount offset
+            pure vs
+
+
+runKey
+    :: Global
+    -> Stack  -- Given the current stack with the key added on
+    -> Key -- The key to build
+    -> Maybe (Result BS.ByteString) -- A previous result, or Nothing if never been built before
+    -> RunMode -- True if any of the children were dirty
+    -> Capture (Either SomeException (RunResult (Result (Value, BS_Store))))
+        -- Either an error, or a (the produced files, the result).
+runKey global@Global{globalOptions=ShakeOptions{..},..} stack k r mode continue = do
+    let tk = typeKey k
+    BuiltinRule{..} <- case Map.lookup tk globalRules of
+        Nothing -> throwM $ errorNoRuleToBuildType tk (Just $ show k) Nothing
+        Just r -> pure r
+
+    let s = (newLocal stack shakeVerbosity){localBuiltinVersion = builtinVersion}
+    time <- offsetTime
+    runAction global s (do
+        res <- builtinRun k (fmap result r) mode
+        liftIO $ evaluate $ rnf res
+
+        -- completed, now track anything required afterwards
+        when (runChanged res `elem` [ChangedRecomputeSame,ChangedRecomputeDiff]) $ do
+            -- if the users code didn't run you don't have to check anything (we assume builtin rules are correct)
+            globalRuleFinished k
+            producesCheck
+
+        Action $ fmap (res,) getRW) $ \case
+            Left e ->
+                continue . Left . toException =<< shakeException global stack e
+            Right (RunResult{..}, Local{..})
+                | runChanged == ChangedNothing || runChanged == ChangedStore, Just r <- r ->
+                    continue $ Right $ RunResult runChanged runStore (r{result = mkResult runValue runStore})
+                | otherwise -> do
+                    dur <- time
+                    let (cr, c) | Just r <- r, runChanged == ChangedRecomputeSame = (ChangedRecomputeSame, changed r)
+                                | otherwise = (ChangedRecomputeDiff, globalStep)
+                    continue $ Right $ RunResult cr runStore Result
+                        {result = mkResult runValue runStore
+                        ,changed = c
+                        ,built = globalStep
+                        ,depends = flattenDepends localDepends
+                        ,execution = doubleToFloat $ dur - localDiscount
+                        ,traces = flattenTraces localTraces}
+            where
+                mkResult value store = (value, if globalOneShot then BS.empty else store)
+
+---------------------------------------------------------------------
+-- USER key/value WRAPPERS
+
+-- | Execute a rule, returning the associated values. If possible, the rules will be run in parallel.
+--   This function requires that appropriate rules have been added with 'addBuiltinRule'.
+--   All @key@ values passed to 'apply' become dependencies of the 'Action'.
+apply :: (Partial, RuleResult key ~ value, ShakeValue key, Typeable value) => [key] -> Action [value]
+apply [] =
+    -- if they do [] then we don't test localBlockApply, but unclear if that should be an error or not
+    pure []
+apply ks =
+    fmap (map fromValue) $ Action $ stepRAW (callStackFull, map newKey ks)
+
+
+-- | Apply a single rule, equivalent to calling 'apply' with a singleton list. Where possible,
+--   use 'apply' to allow parallelism.
+apply1 :: (Partial, RuleResult key ~ value, ShakeValue key, Typeable value) => key -> Action value
+apply1 = withFrozenCallStack $ fmap headErr . apply . pure
+
+
+
+---------------------------------------------------------------------
+-- HISTORY STUFF
+
+-- | Load a value from the history. Given a version from any user rule
+--   (or @0@), return the payload that was stored by 'historySave'.
+--
+--   If this function returns 'Just' it will also have restored any files that
+--   were saved by 'historySave'.
+historyLoad :: Int -> Action (Maybe BS.ByteString)
+historyLoad (Ver -> ver) = do
+    global@Global{..} <- Action getRO
+    Local{localStack, localBuiltinVersion} <- Action getRW
+    if isNothing globalShared && isNothing globalCloud then pure Nothing else do
+        key <- liftIO $ evaluate $ fromMaybe (error "Can't call historyLoad outside a rule") $ topStack localStack
+        let database = globalDatabase
+        res <- liftIO $ runLocked database $ runWait $ do
+            let ask k = do
+                    i <- quickly $ mkId database k
+                    let identify = runIdentify globalRules k . fst . result
+                    either (const Nothing) identify <$> lookupOne global localStack database i
+            x <- case globalShared of
+                Nothing -> pure Nothing
+                Just shared -> lookupShared shared ask key localBuiltinVersion ver
+            x <- case x of
+                Just res -> pure $ Just res
+                Nothing -> case globalCloud of
+                    Nothing -> pure Nothing
+                    Just cloud -> lookupCloud cloud ask key localBuiltinVersion ver
+            case x of
+                Nothing -> pure Nothing
+                Just (a,b,c) -> quickly $ Just . (a,,c) <$> mapM (mapM $ mkId database) b
+        -- FIXME: If running with cloud and shared, and you got a hit in cloud, should also add it to shared
+        res <- case res of
+            Now x -> pure x
+            _ -> do
+                offset <- liftIO offsetTime
+                res <- Action $ captureRAW $ \continue ->
+                    runLocked globalDatabase $ fromLater res $ \x ->
+                        liftIO $ addPool PoolResume globalPool $ continue $ Right x
+                offset <- liftIO offset
+                Action $ modifyRW $ addDiscount offset
+                pure res
+        case res of
+            Nothing -> pure Nothing
+            Just (res, deps, restore) -> do
+                liftIO $ globalDiagnostic $ pure $ "History hit for " ++ show key
+                liftIO restore
+                Action $ modifyRW $ \s -> s{localDepends = newDepends $ map Depends deps}
+                pure (Just res)
+
+
+-- | Is the history enabled, returns 'True' if you have a 'shakeShare' or 'shakeCloud',
+--   and haven't called 'historyDisable' so far in this rule.
+historyIsEnabled :: Action Bool
+historyIsEnabled = Action $ do
+    Global{..} <- getRO
+    Local{localHistory} <- getRW
+    pure $ localHistory && (isJust globalShared || isJust globalCloud)
+
+
+-- | Save a value to the history. Record the version of any user rule
+--   (or @0@), and a payload. Must be run at the end of the rule, after
+--   any dependencies have been captured. If history is enabled, stores the information
+--   in a cache.
+--
+--   This function relies on 'produces' to have been called correctly to describe
+--   which files were written during the execution of this rule.
+historySave :: Int -> BS.ByteString -> Action ()
+historySave (Ver -> ver) store = whenM historyIsEnabled $ Action $ do
+    Global{..} <- getRO
+    Local{localProduces, localDepends, localBuiltinVersion, localStack} <- getRW
+    liftIO $ do
+        -- make sure we throw errors before we get into the history
+        evaluate ver
+        evaluate store
+        key <- evaluate $ fromMaybe (error "Can't call historySave outside a rule") $ topStack localStack
+
+        let produced = reverse $ map snd localProduces
+        deps <-
+            -- can do this without the DB lock, since it reads things that are stable
+            forNothingM (flattenDepends localDepends) $ \(Depends is) -> forNothingM is $ \i -> do
+                Just (k, Ready r) <- getKeyValueFromId globalDatabase i
+                pure $ (k,) <$> runIdentify globalRules k (fst $ result r)
+        let k = topStack localStack
+        case deps of
+            Nothing -> liftIO $ globalDiagnostic $ pure $ "Dependency with no identity for " ++ show k
+            Just deps -> do
+                whenJust globalShared $ \shared -> addShared shared key localBuiltinVersion ver deps store produced
+                whenJust globalCloud  $ \cloud  -> addCloud  cloud  key localBuiltinVersion ver deps store produced
+                liftIO $ globalDiagnostic $ pure $ "History saved for " ++ show k
+
+
+runIdentify :: Map.HashMap TypeRep BuiltinRule -> Key -> Value -> Maybe BS.ByteString
+runIdentify mp k v
+    | Just BuiltinRule{..} <- Map.lookup (typeKey k) mp = builtinIdentity k v
+    | otherwise = throwImpure $ errorInternal "runIdentify can't find rule"
diff --git a/src/Development/Shake/Internal/Core/Database.hs b/src/Development/Shake/Internal/Core/Database.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Core/Database.hs
@@ -0,0 +1,110 @@
+{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving, RecordWildCards #-}
+
+module Development.Shake.Internal.Core.Database(
+    Locked, runLocked,
+    DatabasePoly, createDatabase,
+    mkId,
+    getValueFromKey, getIdFromKey, getKeyValues, getKeyValueFromId, getKeyValuesFromId,
+    setMem, setDisk, modifyAllMem
+    ) where
+
+import Data.Tuple.Extra
+import Data.IORef.Extra
+import General.Intern(Id, Intern)
+import Development.Shake.Classes
+import qualified Data.HashMap.Strict as Map
+import qualified General.Intern as Intern
+import Control.Concurrent.Extra
+import Control.Monad.IO.Class
+import qualified General.Ids as Ids
+import Control.Monad.Fail
+import Prelude
+
+
+newtype Locked a = Locked (IO a)
+    deriving (Functor, Applicative, Monad, MonadIO, MonadFail)
+
+runLocked :: DatabasePoly k v -> Locked b -> IO b
+runLocked db (Locked act) = withLock (lock db) act
+
+
+-- | Invariant: The database does not have any cycles where a Key depends on itself.
+--   Everything is mutable. intern and status must form a bijection.
+--   There may be dangling Id's as a result of version changes.
+--   Lock is used to prevent any torn updates
+data DatabasePoly k v = Database
+    {lock :: Lock
+    ,intern :: IORef (Intern k) -- ^ Key |-> Id mapping
+    ,status :: Ids.Ids (k, v) -- ^ Id |-> (Key, Status) mapping
+    ,journal :: Id -> k -> v -> IO () -- ^ Record all changes to status
+    ,vDefault :: v
+    }
+
+
+createDatabase
+    :: (Eq k, Hashable k)
+    => Ids.Ids (k, v)
+    -> (Id -> k -> v -> IO ())
+    -> v
+    -> IO (DatabasePoly k v)
+createDatabase status journal vDefault = do
+    xs <- Ids.toList status
+    intern <- newIORef $ Intern.fromList [(k, i) | (i, (k,_)) <- xs]
+    lock <- newLock
+    pure Database{..}
+
+
+---------------------------------------------------------------------
+-- SAFE READ-ONLY
+
+getValueFromKey :: (Eq k, Hashable k) => DatabasePoly k v -> k -> IO (Maybe v)
+getValueFromKey Database{..} k = do
+    is <- readIORef intern
+    case Intern.lookup k is of
+        Nothing -> pure Nothing
+        Just i -> fmap snd <$> Ids.lookup status i
+
+-- Returns Nothing only if the Id was serialised previously but then the Id disappeared
+getKeyValueFromId :: DatabasePoly k v -> Id -> IO (Maybe (k, v))
+getKeyValueFromId Database{..} = Ids.lookup status
+
+getKeyValues :: DatabasePoly k v -> IO [(k, v)]
+getKeyValues Database{..} = Ids.elems status
+
+getKeyValuesFromId :: DatabasePoly k v -> IO (Map.HashMap Id (k, v))
+getKeyValuesFromId Database{..} = Ids.toMap status
+
+getIdFromKey :: (Eq k, Hashable k) => DatabasePoly k v -> IO (k -> Maybe Id)
+getIdFromKey Database{..} = do
+    is <- readIORef intern
+    pure $ flip Intern.lookup is
+
+
+---------------------------------------------------------------------
+-- MUTATING
+
+-- | Ensure that a Key has a given Id, creating an Id if there is not one already
+mkId :: (Eq k, Hashable k) => DatabasePoly k v -> k -> Locked Id
+mkId Database{..} k = liftIO $ do
+    is <- readIORef intern
+    case Intern.lookup k is of
+        Just i -> pure i
+        Nothing -> do
+            (is, i)<- pure $ Intern.add k is
+            -- make sure to write it into Status first to maintain Database invariants
+            Ids.insert status i (k, vDefault)
+            writeIORef' intern is
+            pure i
+
+
+setMem :: DatabasePoly k v -> Id -> k -> v -> Locked ()
+setMem Database{..} i k v = liftIO $ Ids.insert status i (k,v)
+
+modifyAllMem :: DatabasePoly k v -> (v -> v) -> Locked ()
+modifyAllMem Database{..} f = liftIO $ Ids.forMutate status $ \(k,v) ->
+    let !v' = f v
+    in (k, v')
+
+setDisk :: DatabasePoly k v -> Id -> k -> v -> IO ()
+setDisk = journal
diff --git a/src/Development/Shake/Internal/Core/Monad.hs b/src/Development/Shake/Internal/Core/Monad.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Core/Monad.hs
@@ -0,0 +1,236 @@
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE GADTs, ScopedTypeVariables, TupleSections, GeneralizedNewtypeDeriving #-}
+
+module Development.Shake.Internal.Core.Monad(
+    RAW, Capture, runRAW,
+    getRO, getRW, putRW, modifyRW,
+    stepRAW,
+    catchRAW, tryRAW, throwRAW, finallyRAW,
+    captureRAW,
+    ) where
+
+import Control.Exception.Extra
+import Development.Shake.Internal.Errors
+import Control.Monad.IO.Class
+import Data.IORef
+import Control.Monad
+import System.IO
+import Data.Semigroup
+import Control.Monad.Fail
+import Prelude
+
+
+data RAW k v ro rw a where
+    Fmap :: (a -> b) -> RAW k v ro rw a -> RAW k v ro rw b
+    Pure :: a -> RAW k v ro rw a
+    Ap :: RAW k v ro rw (a -> b) -> RAW k v ro rw a -> RAW k v ro rw b
+    Next :: RAW k v ro rw a -> RAW k v ro rw b -> RAW k v ro rw b
+    Bind :: RAW k v ro rw a -> (a -> RAW k v ro rw b) -> RAW k v ro rw b
+    LiftIO :: IO a -> RAW k v ro rw a
+    GetRO :: RAW k v ro rw ro
+    GetRW :: RAW k v ro rw rw
+    PutRW :: !rw -> RAW k v ro rw ()
+    ModifyRW :: (rw -> rw) -> RAW k v ro rw ()
+    StepRAW :: k -> RAW k v ro rw v
+    CaptureRAW :: Capture (Either SomeException a) -> RAW k v ro rw a
+    CatchRAW :: RAW k v ro rw a -> (SomeException -> RAW k v ro rw a) -> RAW k v ro rw a
+
+instance Functor (RAW k v ro rw) where
+    fmap = Fmap
+
+instance Applicative (RAW k v ro rw) where
+    pure = Pure
+    (*>) = Next
+    (<*>) = Ap
+
+instance Monad (RAW k v ro rw) where
+    return = pure
+    (>>) = (*>)
+    (>>=) = Bind
+
+instance MonadIO (RAW k v ro rw) where
+    liftIO = LiftIO
+
+instance MonadFail (RAW k v ro rw) where
+    fail = liftIO . Control.Monad.Fail.fail
+
+instance Semigroup a => Semigroup (RAW k v ro rw a) where
+    (<>) a b = (<>) <$> a <*> b
+
+instance (Semigroup a, Monoid a) => Monoid (RAW k v ro rw a) where
+    mempty = pure mempty
+    mappend = (<>)
+
+
+type Capture a = (a -> IO ()) -> IO ()
+
+
+-- Useful for checking that all continuations are run only once
+-- Cannot be enabled for performance reasons and because some of
+-- "monad test" deliberately breaks the invariant to check it doesn't go wrong
+assertOnceCheck = False
+
+assertOnce :: MonadIO m => String -> (a -> m b) -> IO (a -> m b)
+assertOnce msg k
+    | not assertOnceCheck = pure k
+    | otherwise = do
+        ref <- liftIO $ newIORef False
+        pure $ \v -> do
+            liftIO $ join $ atomicModifyIORef ref $ \old -> (True,) $ when old $ do
+                hPutStrLn stderr "FATAL ERROR: assertOnce failed"
+                Prelude.fail $ "assertOnce failed: " ++ msg
+            k v
+
+-- | Run and then call a continuation.
+runRAW :: ([k] -> RAW k v ro rw [v]) -> ro -> rw -> RAW k v ro rw a -> Capture (Either SomeException a)
+runRAW step ro rw m k = do
+    k <- assertOnce "runRAW" k
+    rw <- newIORef rw
+    handler <- newIORef throwIO
+    steps <- newSteps
+    writeIORef handler $ \e -> do
+        -- make sure we never call the error continuation twice
+        writeIORef handler throwIO
+        k $ Left e
+    -- If the continuation itself throws an error we need to make sure we
+    -- don't end up running it twice (once with its result, once with its own exception)
+    goRAW step steps handler ro rw m (\v -> do writeIORef handler throwIO; k $ Right v)
+        `catch_` \e -> ($ e) =<< readIORef handler
+
+
+goRAW :: forall k v ro rw a . ([k] -> RAW k v ro rw [v]) -> Steps k v -> IORef (SomeException -> IO ()) -> ro -> IORef rw -> RAW k v ro rw a -> Capture a
+goRAW step steps handler ro rw = \x k -> go x $ \v -> sio v k
+    where
+        sio :: SIO b -> Capture b
+        sio (SIO v) k = flush $ do v <- v; k v
+
+        flush :: IO () -> IO ()
+        flush k = do
+            v <- flushSteps steps
+            case v of
+                Nothing -> k
+                Just f -> go (f step) $ const k
+
+        unflush :: IO ()
+        unflush = unflushSteps steps
+
+        go :: RAW k v ro rw b -> Capture (SIO b)
+        go x k = case x of
+            Fmap f a -> go a $ \v -> k $ fmap f v
+            Pure a -> k $ pure a
+            Ap f x -> go f $ \f -> go x $ \v -> k $ f <*> v
+            Next a b -> go a $ \a -> go b $ \b -> k $ a *> b
+            StepRAW q -> do
+                v <- addStep steps q
+                k v
+
+            Bind a b -> go a $ \a -> sio a $ \a -> go (b a) k
+            LiftIO act -> flush $ do v <- act; k $ pure v
+
+            GetRO -> k $ pure ro
+            GetRW -> flush $ k . pure =<< readIORef rw
+            PutRW x -> flush $ writeIORef rw x >> k (pure ())
+            ModifyRW f -> flush $ modifyIORef' rw f >> k (pure ())
+
+            CatchRAW m hdl -> flush $ do
+                hdl <- assertOnce "CatchRAW" hdl
+                old <- readIORef handler
+                writeIORef handler $ \e -> do
+                    writeIORef handler old
+                    go (hdl e) k `catch_`
+                        \e -> do unflush; ($ e) =<< readIORef handler
+                go m $ \x -> writeIORef handler old >> k x
+
+            CaptureRAW f -> flush $ do
+                f <- assertOnce "CaptureRAW" f
+                old <- readIORef handler
+                writeIORef handler throwIO
+                f $ \case
+                    Left e -> old e
+                    Right v -> do
+                        writeIORef handler old
+                        k (pure v) `catch_` \e -> do unflush; ($ e) =<< readIORef handler
+
+
+newtype SIO a = SIO (IO a)
+    deriving (Functor, Monad, Applicative)
+
+
+newtype Steps k v = Steps (IORef [(k, IORef v)])
+
+newSteps :: IO (Steps k v)
+newSteps = Steps <$> newIORef []
+
+addStep :: Steps k v -> k -> IO (SIO v)
+addStep (Steps ref) k = do
+    out <- newIORef $ throwImpure $ errorInternal "Monad, addStep not flushed"
+    modifyIORef ref ((k,out):)
+    pure $ SIO $ readIORef out
+
+unflushSteps :: Steps k v -> IO ()
+unflushSteps (Steps ref) = writeIORef ref []
+
+flushSteps :: MonadIO m => Steps k v -> IO (Maybe (([k] -> m [v]) -> m ()))
+flushSteps (Steps ref) = do
+    v <- reverse <$> readIORef ref
+    case v of
+        [] -> pure Nothing
+        xs -> do
+            writeIORef ref []
+            pure $ Just $ \step -> do
+                vs <- step $ map fst xs
+                liftIO $ zipWithM_ writeIORef (map snd xs) vs
+
+
+---------------------------------------------------------------------
+-- STANDARD
+
+getRO :: RAW k v ro rw ro
+getRO = GetRO
+
+getRW :: RAW k v ro rw rw
+getRW = GetRW
+
+-- | Strict version
+putRW :: rw -> RAW k v ro rw ()
+putRW = PutRW
+
+modifyRW :: (rw -> rw) -> RAW k v ro rw ()
+modifyRW = ModifyRW
+
+
+---------------------------------------------------------------------
+-- EXCEPTIONS
+
+catchRAW :: RAW k v ro rw a -> (SomeException -> RAW k v ro rw a) -> RAW k v ro rw a
+catchRAW = CatchRAW
+
+tryRAW :: RAW k v ro rw a -> RAW k v ro rw (Either SomeException a)
+tryRAW m = catchRAW (fmap Right m) (pure . Left)
+
+throwRAW :: Exception e => e -> RAW k v ro rw a
+-- Note that while we could directly pass this to the handler
+-- that would avoid triggering the catch, which would mean they built up on the stack
+throwRAW = liftIO . throwIO
+
+finallyRAW :: RAW k v ro rw a -> RAW k v ro rw b -> RAW k v ro rw a
+finallyRAW a undo = do
+    r <- catchRAW a (\e -> undo >> throwRAW e)
+    undo
+    pure r
+
+
+---------------------------------------------------------------------
+-- CONTINUATIONS
+
+-- | Capture a continuation. The continuation should be called at most once.
+--   Calling the same continuation, multiple times, in parallel, results in incorrect behaviour.
+captureRAW :: Capture (Either SomeException a) -> RAW k v ro rw a
+captureRAW = CaptureRAW
+
+
+---------------------------------------------------------------------
+-- STEPS
+
+stepRAW :: k -> RAW k v ro rw v
+stepRAW = StepRAW
diff --git a/src/Development/Shake/Internal/Core/Pool.hs b/src/Development/Shake/Internal/Core/Pool.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Core/Pool.hs
@@ -0,0 +1,86 @@
+{-# LANGUAGE RecordWildCards, TupleSections #-}
+
+module Development.Shake.Internal.Core.Pool(
+    addPoolWait, actionFenceSteal, actionFenceRequeue,
+    actionAlwaysRequeue, actionAlwaysRequeuePriority,
+    addPoolWait_,
+    actionFenceRequeueBy
+    ) where
+
+import Control.Exception
+import General.Pool
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Monad
+import System.Time.Extra
+import Data.Either.Extra
+import Control.Monad.IO.Class
+import General.Fence
+
+
+priority x = if isLeft x then PoolException else PoolResume
+
+
+-- | Enqueue an Action into the pool and return a Fence to wait for it.
+--   Returns the value along with how long it spent executing.
+addPoolWait :: PoolPriority -> Action a -> Action (Fence IO (Either SomeException (Seconds, a)))
+addPoolWait pri act = do
+    ro@Global{..} <- Action getRO
+    rw <- Action getRW
+    liftIO $ do
+        fence <- newFence
+        let act2 = do offset <- liftIO offsetTime; res <- act; offset <- liftIO offset; pure (offset, res)
+        addPool pri globalPool $ runAction ro rw act2 $ signalFence fence
+        pure fence
+
+-- | Like 'addPoolWait' but doesn't provide a fence to wait for it - a fire and forget version.
+--   Warning: If Action throws an exception, it would be lost, so must be executed with try. Seconds are not tracked.
+addPoolWait_ :: PoolPriority -> Action a -> Action ()
+addPoolWait_ pri act = do
+    ro@Global{..} <- Action getRO
+    rw <- Action getRW
+    liftIO $ addPool pri globalPool $ runAction ro rw act $ \_ -> pure ()
+
+
+actionFenceSteal :: Fence IO (Either SomeException a) -> Action (Seconds, a)
+actionFenceSteal fence = do
+    res <- liftIO $ testFence fence
+    case res of
+        Just (Left e) -> Action $ throwRAW e
+        Just (Right v) -> pure (0, v)
+        Nothing -> Action $ captureRAW $ \continue -> do
+            offset <- offsetTime
+            waitFence fence $ \v -> do
+                offset <- offset
+                continue $ (offset,) <$> v
+
+
+actionFenceRequeue :: Fence IO (Either SomeException b) -> Action (Seconds, b)
+actionFenceRequeue = actionFenceRequeueBy id
+
+actionFenceRequeueBy :: (a -> Either SomeException b) -> Fence IO a -> Action (Seconds, b)
+actionFenceRequeueBy op fence = Action $ do
+    res <- liftIO $ testFence fence
+    case fmap op res of
+        Just (Left e) -> throwRAW e
+        Just (Right v) -> pure (0, v)
+        Nothing -> do
+            Global{..} <- getRO
+            offset <- liftIO offsetTime
+            captureRAW $ \continue -> waitFence fence $ \v -> do
+                let v2 = op v
+                addPool (priority v2) globalPool $ do
+                    offset <- offset
+                    continue $ (offset,) <$> v2
+
+
+actionAlwaysRequeue :: Either SomeException a -> Action (Seconds, a)
+actionAlwaysRequeue res = actionAlwaysRequeuePriority (priority res) res
+
+actionAlwaysRequeuePriority :: PoolPriority -> Either SomeException a -> Action (Seconds, a)
+actionAlwaysRequeuePriority pri res = Action $ do
+    Global{..} <- getRO
+    offset <- liftIO offsetTime
+    captureRAW $ \continue ->
+        addPool pri globalPool $ do
+            offset <- offset
+            continue $ (offset,) <$> res
diff --git a/src/Development/Shake/Internal/Core/Rules.hs b/src/Development/Shake/Internal/Core/Rules.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Core/Rules.hs
@@ -0,0 +1,345 @@
+{-# LANGUAGE RecordWildCards, ScopedTypeVariables #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving, ConstraintKinds, NamedFieldPuns #-}
+{-# LANGUAGE ExistentialQuantification, RankNTypes #-}
+{-# LANGUAGE TypeFamilies, TypeOperators, DeriveDataTypeable #-}
+{-# LANGUAGE FlexibleInstances #-}
+
+module Development.Shake.Internal.Core.Rules(
+    Rules, SRules(..), runRules,
+    RuleResult, addBuiltinRule, addBuiltinRuleEx,
+    noLint, noIdentity,
+    getShakeOptionsRules,
+    getUserRuleInternal, getUserRuleOne, getUserRuleList, getUserRuleMaybe,
+    addUserRule, alternatives, priority, versioned,
+    getTargets, addTarget, withTargetDocs, withoutTargets,
+    addHelpSuffix, getHelpSuffix,
+    action, withoutActions
+    ) where
+
+import Control.Applicative
+import Data.Tuple.Extra
+import Control.Exception
+import Control.Monad.Extra
+import Control.Monad.Fix
+import Control.Monad.IO.Class
+import Control.Monad.Trans.Reader
+import Development.Shake.Classes
+import General.Binary
+import General.Extra
+import Data.Typeable
+import Data.Data
+import Data.List.Extra
+import qualified Data.HashMap.Strict as Map
+import qualified General.TypeMap as TMap
+import Data.Maybe
+import Data.IORef
+import Data.Semigroup
+import qualified Data.ByteString.Lazy as LBS
+import qualified Data.Binary.Builder as Bin
+import Data.Binary.Put
+import Data.Binary.Get
+import General.ListBuilder
+import Control.Monad.Fail
+import Prelude
+
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Monad
+import Development.Shake.Internal.Value
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Errors
+
+
+---------------------------------------------------------------------
+-- RULES
+
+-- | Get the 'ShakeOptions' that were used.
+getShakeOptionsRules :: Rules ShakeOptions
+getShakeOptionsRules = Rules $ asks fst
+
+
+-- | Internal variant, more flexible, but not such a nice API
+--   Same args as getuserRuleMaybe, but returns (guaranteed version, items, error to throw if wrong number)
+--   Fields are returned lazily, in particular ver can be looked up cheaper
+getUserRuleInternal :: forall key a b . (ShakeValue key, Typeable a) => key -> (a -> Maybe String) -> (a -> Maybe b) -> Action (Maybe Ver, [(Int, b)], SomeException)
+getUserRuleInternal key disp test = do
+    Global{..} <- Action getRO
+    let UserRuleVersioned versioned rules = fromMaybe mempty $ TMap.lookup globalUserRules
+    let ver = if versioned then Nothing else Just $ Ver 0
+    let items = headDef [] $ map snd $ reverse $ groupSort $ f (Ver 0) Nothing rules
+    let err = errorMultipleRulesMatch (typeOf key) (show key) (map snd3 items)
+    pure (ver, map (\(Ver v,_,x) -> (v,x)) items, err)
+    where
+        f :: Ver -> Maybe Double -> UserRule a -> [(Double,(Ver,Maybe String,b))]
+        f v p (UserRule x) = [(fromMaybe 1 p, (v,disp x,x2)) | Just x2 <- [test x]]
+        f v p (Unordered xs) = concatMap (f v p) xs
+        f v p (Priority p2 x) = f v (Just $ fromMaybe p2 p) x
+        f _ p (Versioned v x) = f v p x
+        f v p (Alternative x) = take 1 $ f v p x
+
+
+-- | Get the user rules that were added at a particular type which return 'Just' on a given function.
+--   Return all equally applicable rules, paired with the version of the rule
+--   (set by 'versioned'). Where rules are specified with 'alternatives' or 'priority'
+--   the less-applicable rules will not be returned.
+--
+--   If you can only deal with zero/one results, call 'getUserRuleMaybe' or 'getUserRuleOne',
+--   which raise informative errors.
+getUserRuleList :: Typeable a => (a -> Maybe b) -> Action [(Int, b)]
+getUserRuleList test = snd3 <$> getUserRuleInternal () (const Nothing) test
+
+
+-- | A version of 'getUserRuleList' that fails if there is more than one result
+--   Requires a @key@ for better error messages.
+getUserRuleMaybe :: (ShakeValue key, Typeable a) => key -> (a -> Maybe String) -> (a -> Maybe b) -> Action (Maybe (Int, b))
+getUserRuleMaybe key disp test = do
+    (_, xs, err) <- getUserRuleInternal key disp test
+    case xs of
+        [] -> pure Nothing
+        [x] -> pure $ Just x
+        _ -> throwM err
+
+-- | A version of 'getUserRuleList' that fails if there is not exactly one result
+--   Requires a @key@ for better error messages.
+getUserRuleOne :: (ShakeValue key, Typeable a) => key -> (a -> Maybe String) -> (a -> Maybe b) -> Action (Int, b)
+getUserRuleOne key disp test = do
+    (_, xs, err) <- getUserRuleInternal key disp test
+    case xs of
+        [x] -> pure x
+        _ -> throwM err
+
+
+-- | Define a set of rules. Rules can be created with calls to functions such as 'Development.Shake.%>' or 'action'.
+--   Rules are combined with either the 'Monoid' instance, or (more commonly) the 'Monad' instance and @do@ notation.
+--   To define your own custom types of rule, see "Development.Shake.Rule".
+newtype Rules a = Rules (ReaderT (ShakeOptions, IORef (SRules ListBuilder)) IO a) -- All IO must be associative/commutative (e.g. creating IORef/MVars)
+    deriving (Functor, Applicative, Monad, MonadIO, MonadFix, Control.Monad.Fail.MonadFail)
+
+newRules :: SRules ListBuilder -> Rules ()
+newRules x = Rules $ liftIO . flip modifyIORef' (<> x) =<< asks snd
+
+modifyRulesScoped :: (SRules ListBuilder -> SRules ListBuilder) -> Rules a -> Rules a
+modifyRulesScoped f (Rules r) = Rules $ do
+    (opts, refOld) <- ask
+    liftIO $ do
+        refNew <- newIORef mempty
+        res <- runReaderT r (opts, refNew)
+        rules <- readIORef refNew
+        modifyIORef' refOld (<> f rules)
+        pure res
+
+runRules :: ShakeOptions -> Rules () -> IO (SRules [])
+runRules opts (Rules r) = do
+    ref <- newIORef mempty{allowOverwrite = shakeAllowRedefineRules opts}
+    runReaderT r (opts, ref)
+    SRules{..} <- readIORef ref
+    pure $ SRules (runListBuilder actions) builtinRules userRules (runListBuilder targets) (runListBuilder helpSuffix) allowOverwrite
+
+-- | Get all targets registered in the given rules. The names in
+--   'Development.Shake.phony' and 'Development.Shake.~>' as well as the file patterns
+--   in 'Development.Shake.%>', 'Development.Shake.|%>' and 'Development.Shake.&%>' are
+--   registered as targets, plus any explicit calls to 'addTarget'.
+--   Returns the command, paired with the documentation (if any).
+getTargets :: ShakeOptions -> Rules () -> IO [(String, Maybe String)]
+getTargets opts rs = do
+    SRules{targets} <- runRules opts rs
+    pure [(target, documentation) | Target{..} <- targets]
+
+getHelpSuffix :: ShakeOptions -> Rules () -> IO [String]
+getHelpSuffix opts rs = do
+    SRules{helpSuffix} <- runRules opts rs
+    pure helpSuffix
+
+data Target = Target
+    {target :: !String
+    ,documentation :: !(Maybe String)
+    } deriving (Eq,Ord,Show,Read,Data,Typeable)
+
+data SRules list = SRules
+    {actions :: !(list (Stack, Action ()))
+    ,builtinRules :: !(Map.HashMap TypeRep{-k-} BuiltinRule)
+    ,userRules :: !(TMap.Map UserRuleVersioned)
+    ,targets :: !(list Target)
+    ,helpSuffix :: !(list String)
+    ,allowOverwrite :: Bool
+    }
+
+instance Semigroup (SRules ListBuilder) where
+    (SRules x1 x2 x3 x4 x5 x6) <> (SRules y1 y2 y3 y4 y5 y6) =
+      SRules (mappend x1 y1) (Map.unionWithKey f x2 y2) (TMap.unionWith (<>) x3 y3) (mappend x4 y4) (mappend x5 y5) canOverwrite
+      where
+        canOverwrite = x6 && y6
+        f k a b
+          | canOverwrite = b
+          | otherwise = throwImpure $ errorRuleDefinedMultipleTimes k [builtinLocation a, builtinLocation b]
+
+instance Monoid (SRules ListBuilder) where
+    mempty = SRules mempty Map.empty TMap.empty mempty mempty True
+    mappend = (<>)
+
+instance Semigroup a => Semigroup (Rules a) where
+    (<>) = liftA2 (<>)
+
+instance (Semigroup a, Monoid a) => Monoid (Rules a) where
+    mempty = pure mempty
+    mappend = (<>)
+
+
+-- | Add a user rule. In general these should be specialised to the type expected by a builtin rule.
+--   The user rules can be retrieved by 'getUserRuleList'.
+addUserRule :: Typeable a => a -> Rules ()
+addUserRule r = newRules mempty{userRules = TMap.singleton $ UserRuleVersioned False $ UserRule r}
+
+-- | Register a target, as available when passing @--help@ or through 'getTargets'.
+--   Called automatically by rules such as 'Development.Shake.phony' and
+--   'Development.Shake.%>' - to avoid that use 'withoutTargets'.
+--   To add documentation to a target use 'withTargetDocs'.
+addTarget :: String -> Rules ()
+addTarget t = newRules mempty{targets = newListBuilder $ Target t Nothing}
+
+-- | For all 'addTarget' targets within the 'Rules' provide the specified documentation, if they
+--   don't already have documentation.
+withTargetDocs :: String -> Rules () -> Rules ()
+withTargetDocs d = modifyRulesScoped $ \x -> x{targets = f <$> targets x}
+    where f (Target a b) = Target a $ Just $ fromMaybe d b
+
+-- | Remove all targets specified in a set of rules, typically because they are internal details.
+--   Overrides 'addTarget'.
+withoutTargets :: Rules a -> Rules a
+withoutTargets = modifyRulesScoped $ \x -> x{targets=mempty}
+
+-- | Adds some extra information at the end of @--help@.
+addHelpSuffix :: String -> Rules ()
+addHelpSuffix s = newRules mempty{helpSuffix = newListBuilder s}
+
+-- | A suitable 'BuiltinLint' that always succeeds.
+noLint :: BuiltinLint key value
+noLint _ _ = pure Nothing
+
+-- | A suitable 'BuiltinIdentity' that always fails with a runtime error, incompatible with 'shakeShare'.
+--   Use this function if you don't care about 'shakeShare', or if your rule provides a dependency that can
+--   never be cached (in which case you should also call 'Development.Shake.historyDisable').
+noIdentity :: BuiltinIdentity key value
+noIdentity _ _ = Nothing
+
+
+-- | The type mapping between the @key@ or a rule and the resulting @value@.
+--   See 'addBuiltinRule' and 'Development.Shake.Rule.apply'.
+type family RuleResult key -- = value
+
+-- | Before looking at this function, you should read the warnings at the top of this module.
+--   This function is not often necessary in build systems.
+--
+--   Define a builtin rule, passing the functions to run in the right circumstances.
+--   The @key@ and @value@ types will be what is used by 'Development.Shake.Rule.apply'.
+--   As a start, you can use 'noLint' and 'noIdentity' as the first two functions,
+--   but are required to supply a suitable 'BuiltinRun'.
+--
+--   Raises an error if any other rule exists at this type.
+--
+--   For a worked example of writing a rule see <https://tech-blog.capital-match.com/posts/5-upgrading-shake.html>.
+addBuiltinRule
+    :: (RuleResult key ~ value, ShakeValue key, Typeable value, NFData value, Show value, Partial)
+    => BuiltinLint key value -> BuiltinIdentity key value -> BuiltinRun key value -> Rules ()
+addBuiltinRule = withFrozenCallStack $ addBuiltinRuleInternal $ BinaryOp
+    (putEx . Bin.toLazyByteString . execPut . put)
+    (runGet get . LBS.fromChunks . pure)
+
+addBuiltinRuleEx
+    :: (RuleResult key ~ value, ShakeValue key, BinaryEx key, Typeable value, NFData value, Show value, Partial)
+    => BuiltinLint key value -> BuiltinIdentity key value -> BuiltinRun key value -> Rules ()
+addBuiltinRuleEx = addBuiltinRuleInternal $ BinaryOp putEx getEx
+
+
+-- | Unexpected version of 'addBuiltinRule', which also lets me set the 'BinaryOp'.
+addBuiltinRuleInternal
+    :: (RuleResult key ~ value, ShakeValue key, Typeable value, NFData value, Show value, Partial)
+    => BinaryOp key -> BuiltinLint key value -> BuiltinIdentity key value -> BuiltinRun key value -> Rules ()
+addBuiltinRuleInternal binary lint check (run :: BuiltinRun key value) = do
+    let k = Proxy :: Proxy key
+    let lint_ k v = lint (fromKey k) (fromValue v)
+    let check_ k v = check (fromKey k) (fromValue v)
+    let run_ k v b = fmap newValue <$> run (fromKey k) v b
+    let binary_ = BinaryOp (putOp binary . fromKey) (newKey . getOp binary)
+    newRules mempty{builtinRules = Map.singleton (typeRep k) $ BuiltinRule lint_ check_ run_ binary_ (Ver 0) callStackTop}
+
+
+-- | Change the priority of a given set of rules, where higher values take precedence.
+--   All matching rules at a given priority must be disjoint, or an error is raised.
+--   All builtin Shake rules have priority between 0 and 1.
+--   Excessive use of 'priority' is discouraged. As an example:
+--
+-- @
+-- 'priority' 4 $ \"hello.*\" %> \\out -> 'writeFile'' out \"hello.*\"
+-- 'priority' 8 $ \"*.txt\" %> \\out -> 'writeFile'' out \"*.txt\"
+-- @
+--
+--   In this example @hello.txt@ will match the second rule, instead of raising an error about ambiguity.
+--
+--   The 'priority' function obeys the invariants:
+--
+-- @
+-- 'priority' p1 ('priority' p2 r1) === 'priority' p1 r1
+-- 'priority' p1 (r1 >> r2) === 'priority' p1 r1 >> 'priority' p1 r2
+-- @
+priority :: Double -> Rules a -> Rules a
+priority d = modifyRulesScoped $ \s -> s{userRules = TMap.map (\(UserRuleVersioned b x) -> UserRuleVersioned b $ Priority d x) $ userRules s}
+
+
+-- | Indicate that the nested rules have a given version. If you change the semantics of the rule then updating (or adding)
+--   a version will cause the rule to rebuild in some circumstances.
+--
+-- @
+-- 'versioned' 1 $ \"hello.*\" %> \\out ->
+--     'writeFile'' out \"Writes v1 now\" -- previously wrote out v0
+-- @
+--
+--   You should only use 'versioned' to track changes in the build source, for standard runtime dependencies you should use
+--   other mechanisms, e.g. 'Development.Shake.addOracle'.
+versioned :: Int -> Rules a -> Rules a
+versioned v = modifyRulesScoped $ \s -> s
+    {userRules = TMap.map (\(UserRuleVersioned b x) -> UserRuleVersioned (b || v /= 0) $ Versioned (Ver v) x) $ userRules s
+    ,builtinRules = Map.map (\b -> b{builtinVersion = Ver v}) $ builtinRules s
+    }
+
+
+-- | Change the matching behaviour of rules so rules do not have to be disjoint, but are instead matched
+--   in order. Only recommended for small blocks containing a handful of rules.
+--
+-- @
+-- 'alternatives' $ do
+--     \"hello.*\" %> \\out -> 'writeFile'' out \"hello.*\"
+--     \"*.txt\" %> \\out -> 'writeFile'' out \"*.txt\"
+-- @
+--
+--   In this example @hello.txt@ will match the first rule, instead of raising an error about ambiguity.
+--   Inside 'alternatives' the 'priority' of each rule is not used to determine which rule matches,
+--   but the resulting match uses that priority compared to the rules outside the 'alternatives' block.
+alternatives :: Rules a -> Rules a
+alternatives = modifyRulesScoped $ \r -> r{userRules = TMap.map (\(UserRuleVersioned b x) -> UserRuleVersioned b $ Alternative x) $ userRules r}
+
+
+-- | Run an action, usually used for specifying top-level requirements.
+--
+-- @
+-- main = 'Development.Shake.shake' 'shakeOptions' $ do
+--    'action' $ do
+--        b <- 'Development.Shake.doesFileExist' \"file.src\"
+--        when b $ 'Development.Shake.need' [\"file.out\"]
+-- @
+--
+--   This 'action' builds @file.out@, but only if @file.src@ exists. The 'action'
+--   will be run in every build execution (unless 'withoutActions' is used), so only cheap
+--   operations should be performed. On the flip side, consulting system information
+--   (e.g. environment variables) can be done directly as the information will not be cached.
+--   All calls to 'action' may be run in parallel, in any order.
+--
+--   For the standard requirement of only 'Development.Shake.need'ing a fixed list of files in the 'action',
+--   see 'Development.Shake.want'.
+action :: Partial => Action a -> Rules ()
+action act = newRules mempty{actions=newListBuilder (addCallStack callStackFull emptyStack, void act)}
+
+
+-- | Remove all actions specified in a set of rules, usually used for implementing
+--   command line specification of what to build.
+withoutActions :: Rules a -> Rules a
+withoutActions = modifyRulesScoped $ \x -> x{actions=mempty}
diff --git a/src/Development/Shake/Internal/Core/Run.hs b/src/Development/Shake/Internal/Core/Run.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Core/Run.hs
@@ -0,0 +1,394 @@
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE RecordWildCards, ScopedTypeVariables, PatternGuards #-}
+{-# LANGUAGE ConstraintKinds, TupleSections, ViewPatterns #-}
+{-# LANGUAGE TypeFamilies, NamedFieldPuns #-}
+
+module Development.Shake.Internal.Core.Run(
+    RunState,
+    open,
+    reset,
+    run,
+    shakeRunAfter,
+    liveFilesState,
+    profileState,
+    errorsState
+    ) where
+
+import Control.Exception
+import Data.Tuple.Extra
+import Control.Concurrent.Extra hiding (withNumCapabilities)
+import Development.Shake.Internal.Core.Database
+import Control.Monad.IO.Class
+import General.Binary
+import Development.Shake.Classes
+import Development.Shake.Internal.Core.Storage
+import Development.Shake.Internal.Core.Build
+import Development.Shake.Internal.History.Shared
+import Development.Shake.Internal.History.Cloud
+import qualified General.TypeMap as TMap
+import Control.Monad.Extra
+import Data.Typeable
+import Numeric.Extra
+import Data.List.Extra
+import qualified Data.HashMap.Strict as Map
+import qualified Data.HashSet as Set
+import Data.Dynamic
+import Data.Maybe
+import Data.IORef.Extra
+import System.Directory
+import System.Time.Extra
+import qualified Data.ByteString as BS
+
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.Core.Rules
+import General.Pool
+import Development.Shake.Internal.Progress
+import Development.Shake.Internal.Value
+import Development.Shake.Internal.Profile
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Errors
+import General.Timing
+import General.Thread
+import General.Extra
+import General.Cleanup
+import Data.Monoid
+import Prelude
+
+
+---------------------------------------------------------------------
+-- MAKE
+
+data RunState = RunState
+    {opts :: ShakeOptions
+    ,builtinRules :: Map.HashMap TypeRep BuiltinRule
+    ,userRules :: TMap.Map UserRuleVersioned
+    ,database :: Database
+    ,curdir :: FilePath
+    ,shared :: Maybe Shared
+    ,cloud :: Maybe Cloud
+    ,actions :: [(Stack, Action ())]
+    }
+
+
+open :: Cleanup -> ShakeOptions -> Rules () -> IO RunState
+open cleanup opts rs = withInit opts $ \opts@ShakeOptions{..} diagnostic _ -> do
+    diagnostic $ pure "Starting run"
+    SRules{actions, builtinRules, userRules} <- runRules opts rs
+
+    diagnostic $ pure $ "Number of actions = " ++ show (length actions)
+    diagnostic $ pure $ "Number of builtin rules = " ++ show (Map.size builtinRules) ++ " " ++ show (Map.keys builtinRules)
+    diagnostic $ pure $ "Number of user rule types = " ++ show (TMap.size userRules)
+    diagnostic $ pure $ "Number of user rules = " ++ show (sum (TMap.toList (userRuleSize . userRuleContents) userRules))
+
+    checkShakeExtra shakeExtra
+    curdir <- getCurrentDirectory
+
+    database <- usingDatabase cleanup opts diagnostic builtinRules
+    (shared, cloud) <- loadSharedCloud database opts builtinRules
+    pure RunState{..}
+
+
+-- Prepare for a fresh run by changing Result to Loaded
+reset :: RunState -> IO ()
+reset RunState{..} = runLocked database $
+    modifyAllMem database f
+    where
+        f (Ready r) = Loaded (snd <$> r)
+        f (Failed _ x) = maybe Missing Loaded x
+        f (Running _ x) = maybe Missing Loaded x -- shouldn't ever happen, but Loaded is least worst
+        f x = x
+
+
+run :: RunState -> Bool -> [Action ()] -> IO [IO ()]
+run RunState{..} oneshot actions2 =
+    withInit opts $ \opts@ShakeOptions{..} diagnostic output -> do
+
+        -- timings are a bit delicate, we want to make sure we clear them before we leave (so each run is fresh)
+        -- but we also want to only print them if there is no exception, and have to caputre them before we clear them
+        -- we use this variable to stash them away, then print after the exception handling block
+        timingsToShow <- newIORef Nothing
+
+        res <- withCleanup $ \cleanup -> do
+            register cleanup $ do
+                when (shakeTimings && shakeVerbosity >= Info) $
+                    writeIORef timingsToShow . Just =<< getTimings
+                resetTimings
+
+            start <- offsetTime
+            except <- newIORef (Nothing :: Maybe (String, ShakeException))
+            let getFailure = fmap fst <$> readIORef except
+            let raiseError err
+                    | not shakeStaunch = throwIO err
+                    | otherwise = do
+                        let named = shakeAbbreviationsApply opts . shakeExceptionTarget
+                        atomicModifyIORef except $ \v -> (Just $ fromMaybe (named err, err) v, ())
+                        -- no need to print exceptions here, they get printed when they are wrapped
+
+            after <- newIORef []
+            absent <- newIORef []
+            step <- incrementStep database
+            getProgress <- usingProgress cleanup opts database step getFailure
+            lintCurrentDirectory curdir "When running"
+
+            watch <- lintWatch shakeLintWatch
+            let ruleFinished
+                    | isJust shakeLint = \k -> do
+                        liftIO $ lintCurrentDirectory curdir $ show k
+                        lintTrackFinished
+                        liftIO $ watch $ show k
+                    | otherwise = liftIO . watch . show
+
+            addTiming "Running rules"
+            locals <- newIORef []
+            runPool (shakeThreads == 1) shakeThreads $ \pool -> do
+                let global = Global applyKeyValue database pool cleanup start builtinRules output opts diagnostic ruleFinished after absent getProgress userRules shared cloud step oneshot
+                -- give each action a stack to start with!
+                forM_ (actions ++ map (emptyStack,) actions2) $ \(stack, act) -> do
+                    let local = newLocal stack shakeVerbosity
+                    addPool PoolStart pool $ runAction global local (act >> getLocal) $ \case
+                        Left e -> raiseError =<< shakeException global stack e
+                        Right local -> atomicModifyIORef_ locals (local:)
+
+            whenJustM (readIORef except) (throwIO . snd)
+            assertFinishedDatabase database
+            let putWhen lvl msg = when (shakeVerbosity >= lvl) $ output lvl msg
+
+            locals <- readIORef locals
+            end <- start
+            if null actions && null actions2 then
+                putWhen Info "Warning: No want/action statements, nothing to do"
+             else
+                recordRoot step locals end database
+
+            when (isJust shakeLint) $ do
+                addTiming "Lint checking"
+                lintCurrentDirectory curdir "After completion"
+                checkValid diagnostic database (runLint builtinRules) =<< readIORef absent
+                putWhen Verbose "Lint checking succeeded"
+            when (shakeReport /= []) $ do
+                addTiming "Profile report"
+                forM_ shakeReport $ \file -> do
+                    putWhen Info $ "Writing report to " ++ file
+                    writeProfile file database
+            when (shakeLiveFiles /= []) $ do
+                addTiming "Listing live"
+                diagnostic $ pure "Listing live keys"
+                xs <- liveFiles database
+                forM_ shakeLiveFiles $ \file -> do
+                    putWhen Info $ "Writing live list to " ++ file
+                    (if file == "-" then putStr else writeFile file) $ unlines xs
+
+            res <- readIORef after
+            addTiming "Cleanup"
+            pure res
+
+        whenJustM (readIORef timingsToShow) $
+            putStr . unlines
+        pure res
+
+
+-- | Run a set of IO actions, treated as \"after\" actions, typically returned from
+--   'Development.Shake.Database.shakeRunDatabase'. The actions will be run with diagnostics
+--   etc as specified in the 'ShakeOptions'.
+shakeRunAfter :: ShakeOptions -> [IO ()] -> IO ()
+shakeRunAfter _ [] = pure ()
+shakeRunAfter opts after = withInit opts $ \ShakeOptions{..} diagnostic _ -> do
+    let n = show $ length after
+    diagnostic $ pure $ "Running " ++ n ++ " after actions"
+    (time, _) <- duration $ sequence_ $ reverse after
+    when (shakeTimings && shakeVerbosity >= Info) $
+        putStrLn $ "(+ running " ++ show n ++ " after actions in " ++ showDuration time ++ ")"
+
+
+withInit :: ShakeOptions -> (ShakeOptions -> (IO String -> IO ()) -> (Verbosity -> String -> IO ()) -> IO a) -> IO a
+withInit opts act =
+    withCleanup $ \cleanup -> do
+        opts@ShakeOptions{..} <- usingShakeOptions cleanup opts
+        (diagnostic, output) <- outputFunctions opts <$> newLock
+        act opts diagnostic output
+
+
+usingShakeOptions :: Cleanup -> ShakeOptions -> IO ShakeOptions
+usingShakeOptions cleanup opts = do
+    opts@ShakeOptions{..} <- if shakeThreads opts /= 0 then pure opts else do p <- getProcessorCount; pure opts{shakeThreads=p}
+    when shakeLineBuffering $ usingLineBuffering cleanup
+    usingNumCapabilities cleanup shakeThreads
+    pure opts
+
+outputFunctions :: ShakeOptions -> Lock -> (IO String -> IO (), Verbosity -> String -> IO ())
+outputFunctions opts@ShakeOptions{..} outputLock = (diagnostic, output)
+    where
+        outputLocked v msg = withLock outputLock $ shakeOutput v msg
+
+        diagnostic | shakeVerbosity < Diagnostic = const $ pure ()
+                   | otherwise = \act -> do v <- act; outputLocked Diagnostic $ "% " ++ v
+        output v = outputLocked v . shakeAbbreviationsApply opts
+
+
+usingProgress :: Cleanup -> ShakeOptions -> Database -> Step -> IO (Maybe String) -> IO (IO Progress)
+usingProgress cleanup ShakeOptions{..} database step getFailure = do
+    let getProgress = do
+            failure <- getFailure
+            stats <- progress database step
+            pure stats{isFailure=failure}
+    allocateThread cleanup $ shakeProgress getProgress
+    pure getProgress
+
+checkShakeExtra :: Map.HashMap TypeRep Dynamic -> IO ()
+checkShakeExtra mp = do
+    let bad = [(k,t) | (k,v) <- Map.toList mp, let t = dynTypeRep v, t /= k]
+    case bad of
+        (k,t):xs -> throwIO $ errorStructured "Invalid Map in shakeExtra"
+            [("Key",Just $ show k),("Value type",Just $ show t)]
+            (if null xs then "" else "Plus " ++ show (length xs) ++ " other keys")
+        _ -> pure ()
+
+
+runLint :: Map.HashMap TypeRep BuiltinRule -> Key -> Value -> IO (Maybe String)
+runLint mp k v = case Map.lookup (typeKey k) mp of
+    Nothing -> pure Nothing
+    Just BuiltinRule{..} -> builtinLint k v
+
+
+assertFinishedDatabase :: Database -> IO ()
+assertFinishedDatabase database = do
+    -- if you have anyone Waiting, and are not exiting with an error, then must have a complex recursion (see #400)
+    status <- getKeyValues database
+    let bad = [key | (key, Running{}) <- status]
+    when (bad /= []) $
+        throwM $ errorComplexRecursion (map show bad)
+
+
+liveFilesState :: RunState -> IO [FilePath]
+liveFilesState RunState{..} = liveFiles database
+
+profileState :: RunState -> FilePath -> IO ()
+profileState RunState{..} file = writeProfile file database
+
+liveFiles :: Database -> IO [FilePath]
+liveFiles database = do
+    status <- getKeyValues database
+    let specialIsFileKey t = show (fst $ splitTyConApp t) == "FileQ"
+    pure [show k | (k, Ready{}) <- status, specialIsFileKey $ typeKey k]
+
+errorsState :: RunState -> IO [(String, SomeException)]
+errorsState RunState{..} = do
+    status <- getKeyValues database
+    pure [(show k, e) | (k, Failed e _) <- status]
+
+
+checkValid :: (IO String -> IO ()) -> Database -> (Key -> Value -> IO (Maybe String)) -> [(Key, Key)] -> IO ()
+checkValid diagnostic db check absent = do
+    status <- getKeyValues db
+    diagnostic $ pure "Starting validity/lint checking"
+
+    -- TEST 1: Have values changed since being depended on
+    -- Do not use a forM here as you use too much stack space
+    bad <- (\f -> foldM f [] status) $ \seen v -> case v of
+        (key, Ready Result{..}) -> do
+            good <- check key $ fst result
+            diagnostic $ pure $ "Checking if " ++ show key ++ " is " ++ show result ++ ", " ++ if isNothing good then "passed" else "FAILED"
+            pure $ [(key, result, now) | Just now <- [good]] ++ seen
+        _ -> pure seen
+    unless (null bad) $ do
+        let n = length bad
+        throwM $ errorStructured
+            ("Lint checking error - " ++ (if n == 1 then "value has" else show n ++ " values have")  ++ " changed since being depended upon")
+            (intercalate [("",Just "")] [ [("Key", Just $ show key),("Old", Just $ show result),("New", Just now)]
+                                        | (key, result, now) <- bad])
+            ""
+
+    -- TEST 2: Is anything from lintTrackWrite which promised not to exist actually been created
+    exists <- getIdFromKey db
+    bad <- pure [(parent,key) | (parent, key) <- Set.toList $ Set.fromList absent, isJust $ exists key]
+    unless (null bad) $ do
+        let n = length bad
+        throwM $ errorStructured
+            ("Lint checking error - " ++ (if n == 1 then "value" else show n ++ " values") ++ " did not have " ++ (if n == 1 then "its" else "their") ++ " creation tracked")
+            (intercalate [("",Just "")] [ [("Rule", Just $ show parent), ("Created", Just $ show key)] | (parent,key) <- bad])
+            ""
+
+    diagnostic $ pure "Validity/lint check passed"
+
+
+---------------------------------------------------------------------
+-- STORAGE
+
+usingDatabase :: Cleanup -> ShakeOptions -> (IO String -> IO ()) -> Map.HashMap TypeRep BuiltinRule -> IO Database
+usingDatabase cleanup opts diagnostic owitness = do
+    let step = (typeRep (Proxy :: Proxy StepKey), (Ver 0, BinaryOp (const mempty) (const stepKey)))
+    let root = (typeRep (Proxy :: Proxy Root), (Ver 0, BinaryOp (const mempty) (const rootKey)))
+    witness<- pure $ Map.fromList
+        [ (QTypeRep t, (version, BinaryOp (putDatabase putOp) (getDatabase getOp)))
+        | (t,(version, BinaryOp{..})) <- step : root : Map.toList (Map.map (\BuiltinRule{..} -> (builtinVersion, builtinKey)) owitness)]
+    (status, journal) <- usingStorage cleanup opts diagnostic witness
+    journal<- pure $ \i k v -> journal (QTypeRep $ typeKey k) i (k, v)
+    createDatabase status journal Missing
+
+
+incrementStep :: Database -> IO Step
+incrementStep db = runLocked db $ do
+    stepId <- mkId db stepKey
+    v <- liftIO $ getKeyValueFromId db stepId
+    step <- liftIO $ evaluate $ case v of
+        Just (_, Loaded r) -> incStep $ fromStepResult r
+        _ -> Step 1
+    let stepRes = toStepResult step
+    setMem db stepId stepKey $ Ready stepRes
+    liftIO $ setDisk db stepId stepKey $ Loaded $ fmap snd stepRes
+    pure step
+
+toStepResult :: Step -> Result (Value, BS_Store)
+toStepResult i = Result (newValue i, runBuilder $ putEx i) i i [] 0 []
+
+fromStepResult :: Result BS_Store -> Step
+fromStepResult = getEx . result
+
+
+recordRoot :: Step -> [Local] -> Seconds -> Database -> IO ()
+recordRoot step locals (doubleToFloat -> end) db = runLocked db $ do
+    rootId <- mkId db rootKey
+    let local = localMergeMutable (newLocal emptyStack Info) locals
+    let rootRes = Result
+            {result = (newValue (), BS.empty)
+            ,changed = step
+            ,built = step
+            ,depends = flattenDepends $ localDepends local
+            ,execution = 0
+            ,traces = flattenTraces $ addTrace (localTraces local) $ Trace BS.empty end end}
+    setMem db rootId rootKey $ Ready rootRes
+    liftIO $ setDisk db rootId rootKey $ Loaded $ fmap snd rootRes
+
+
+loadSharedCloud :: DatabasePoly k v -> ShakeOptions -> Map.HashMap TypeRep BuiltinRule -> IO (Maybe Shared, Maybe Cloud)
+loadSharedCloud var opts owitness = do
+    let mp = Map.fromList $ map (first $ show . QTypeRep) $ Map.toList owitness
+    let wit = binaryOpMap $ \a -> maybe (error $ "loadSharedCloud, couldn't find map for " ++ show a) builtinKey $ Map.lookup a mp
+    let wit2 = BinaryOp (\k -> putOp wit (show $ QTypeRep $ typeKey k, k)) (snd . getOp wit)
+    let keyVers = [(k, builtinVersion v) | (k,v) <- Map.toList owitness]
+    let ver = makeVer $ shakeVersion opts
+
+    shared <- case shakeShare opts of
+        Nothing -> pure Nothing
+        Just x -> Just <$> newShared (shakeSymlink opts) wit2 ver x
+    cloud <- case newCloud (runLocked var) (Map.map builtinKey owitness) ver keyVers $ shakeCloud opts of
+        _ | null $ shakeCloud opts -> pure Nothing
+        Nothing -> fail "shakeCloud set but Shake not compiled for cloud operation"
+        Just res -> Just <$> res
+    pure (shared, cloud)
+
+
+putDatabase :: (Key -> Builder) -> ((Key, Status) -> Builder)
+putDatabase putKey (key, Loaded (Result x1 x2 x3 x4 x5 x6)) =
+    putExN (putKey key) <> putExN (putEx x1) <> putEx x2 <> putEx x3 <> putEx x5 <> putExN (putEx x4) <> putEx x6
+putDatabase _ (_, x) = throwImpure $ errorInternal $ "putWith, Cannot write Status with constructor " ++ statusType x
+
+
+getDatabase :: (BS.ByteString -> Key) -> BS.ByteString -> (Key, Status)
+getDatabase getKey bs
+    | (key, bs) <- getExN bs
+    , (x1, bs) <- getExN bs
+    , (x2, x3, x5, bs) <- binarySplit3 bs
+    , (x4, x6) <- getExN bs
+    = (getKey key, Loaded (Result x1 x2 x3 (getEx x4) x5 (getEx x6)))
diff --git a/src/Development/Shake/Internal/Core/Storage.hs b/src/Development/Shake/Internal/Core/Storage.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Core/Storage.hs
@@ -0,0 +1,254 @@
+{-# LANGUAGE ScopedTypeVariables, RecordWildCards, FlexibleInstances #-}
+{-# LANGUAGE BangPatterns, GeneralizedNewtypeDeriving #-}
+{-
+This module stores the meta-data so its very important its always accurate
+We can't rely on getting any exceptions or termination at the end, so we'd better write out a journal
+We store a series of records, and if they contain twice as many records as needed, we compact
+-}
+
+module Development.Shake.Internal.Core.Storage(
+    usingStorage
+    ) where
+
+import General.Chunks
+import General.Cleanup
+import General.Binary
+import General.Intern
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Errors
+import General.Timing
+import General.FileLock
+import qualified General.Ids as Ids
+
+import Control.Exception.Extra
+import Control.Monad.Extra
+import Data.Monoid
+import Data.Either.Extra
+import Data.Time
+import Data.Char
+import Data.Word
+import System.Info
+import Development.Shake.Classes
+import Numeric
+import General.Extra
+import Data.List.Extra
+import Data.Maybe
+import System.FilePath
+import qualified Data.ByteString.UTF8 as UTF8
+import qualified Data.HashMap.Strict as Map
+
+import qualified Data.ByteString.Char8 as BS
+import qualified Data.ByteString as BS8
+import Prelude
+
+
+-- Increment every time the on-disk format/semantics change,
+-- @x@ is for the users version number
+databaseVersion :: String -> String
+-- THINGS I WANT TO DO ON THE NEXT CHANGE
+-- * Change filepaths to store a 1 byte prefix saying 8bit ASCII or UTF8
+-- * Duration and Time should be stored as number of 1/10000th seconds Int32
+databaseVersion x = "SHAKE-DATABASE-14-" ++ os ++ "-" ++ arch ++ "-" ++  s ++ "\r\n"
+    where s = tailErr $ init $ show x -- call show, then take off the leading/trailing quotes
+                                      -- ensures we do not get \r or \n in the user portion
+
+
+messageCorrupt :: FilePath -> SomeException -> IO [String]
+messageCorrupt dbfile err = do
+    msg <- showException err
+    pure $
+        ("Error when reading Shake database " ++ dbfile) :
+        map ("  "++) (lines msg) ++
+        ["All files will be rebuilt"]
+
+
+messageDatabaseVersionChange :: FilePath -> BS.ByteString -> BS.ByteString -> [String]
+messageDatabaseVersionChange dbfile old new =
+    ["Shake database version changed (either shake library version, or shakeVersion):"
+    ,"  File:         " ++ dbfile
+    ,"  Old version:  " ++ disp (limit $ BS.unpack old)
+    ,"  New version:  " ++ disp (BS.unpack new)
+    ,"All rules will be rebuilt"]
+    where
+        limit x = let (a,b) = splitAt 200 x in a ++ (if null b then "" else "...")
+        disp = map (\x -> if isPrint x && isAscii x then x else '?') . takeWhile (`notElem` ("\r\n" :: String))
+
+
+messageMissingTypes :: FilePath -> [String] -> [String]
+messageMissingTypes dbfile types =
+    ["Shake database rules have changed for the following types:"
+    ,"  File:  " ++ dbfile] ++
+    ["  Type:  " ++ x | x <- types] ++
+    ["All rules using these types will be rebuilt"]
+
+
+-- | Storage of heterogeneous things. In the particular case of Shake,
+--   k ~ QTypeRep, v ~ (Key, Status{Value}).
+--
+--   The storage starts with a witness table saying what can be contained.
+--   If any entries in the witness table don't have a current Witness then a fake
+--   error witness is manufactured. If the witness ever changes the entire DB is
+--   rewritten.
+usingStorage
+    :: (Show k, Eq k, Hashable k, NFData k, Show v, NFData v)
+    => Cleanup
+    -> ShakeOptions                                    -- ^ Storage options
+    -> (IO String -> IO ())                            -- ^ Logging function
+    -> Map.HashMap k (Ver, BinaryOp v)                 -- ^ Witnesses
+    -> IO (Ids.Ids v, k -> Id -> v -> IO ())
+usingStorage _ ShakeOptions{..} diagnostic _ | shakeFiles == "/dev/null" = do
+    diagnostic $ pure "Using in-memory database"
+    ids <- Ids.empty
+    pure (ids, \_ _ _ -> pure ())
+
+usingStorage cleanup ShakeOptions{..} diagnostic witness = do
+    let lockFile = shakeFiles </> ".shake.lock"
+    diagnostic $ pure $ "Before usingLockFile on " ++ lockFile
+    usingLockFile cleanup lockFile
+    diagnostic $ pure "After usingLockFile"
+
+    let dbfile = shakeFiles </> ".shake.database"
+    createDirectoryRecursive shakeFiles
+
+    -- complete a partially failed compress
+    whenM (restoreChunksBackup dbfile) $ do
+        unexpected "Backup file exists, restoring over the previous file\n"
+        diagnostic $ pure "Backup file move to original"
+
+    addTiming "Database read"
+    h <- usingChunks cleanup dbfile shakeFlush
+    let corrupt
+            | not shakeStorageLog = resetChunksCorrupt Nothing h
+            | otherwise = do
+                let file = dbfile <.> "corrupt"
+                resetChunksCorrupt (Just file) h
+                unexpected $ "Backup of corrupted file stored at " ++ file ++ "\n"
+
+    -- check the version information matches
+    let ver = BS.pack $ databaseVersion shakeVersion
+    oldVer <- readChunkMax h $ fromIntegral $ BS.length ver + 100000
+    let verEq = Right ver == oldVer
+    when (not shakeVersionIgnore && not verEq && oldVer /= Left BS.empty) $ do
+        outputErr $ messageDatabaseVersionChange dbfile (fromEither oldVer) ver
+        corrupt
+
+    (!witnessNew, !save) <- evaluate $ saveWitness witness
+    witnessOld <- readChunk h
+    ids <- case witnessOld of
+        Left _ -> do
+            resetChunksCorrupt Nothing h
+            pure Nothing
+        Right witnessOld ->  handleBool (not . isAsyncException) (\err -> do
+            outputErr =<< messageCorrupt dbfile err
+            corrupt
+            pure Nothing) $ do
+
+            (!missing, !load) <- evaluate $ loadWitness witness witnessOld
+            when (missing /= []) $ outputErr $ messageMissingTypes dbfile missing
+            ids <- Ids.empty
+            let raw bs = "[len " ++ show (BS.length bs) ++ "] " ++ concat
+                            [['0' | length c == 1] ++ c | x <- BS8.unpack bs, let c = showHex x ""]
+            let go !i = do
+                    v <- readChunk h
+                    case v of
+                        Left e -> do
+                            let slop = fromIntegral $ BS.length e
+                            when (slop > 0) $ unexpected $ "Last " ++ show slop ++ " bytes do not form a whole record\n"
+                            diagnostic $ pure $ "Read " ++ show i ++ " chunks, plus " ++ show slop ++ " slop"
+                            pure i
+                        Right bs | (id, Just (k,v)) <- load bs -> do
+                            evaluate $ rnf k
+                            evaluate $ rnf v
+                            Ids.insert ids id (k,v)
+                            diagnostic $ do
+                                let pretty (Left x) = "FAILURE: " ++ show x
+                                    pretty (Right x) = x
+                                x2 <- try_ $ evaluate $ let s = show v in rnf s `seq` s
+                                pure $ "Chunk " ++ show i ++ " " ++ raw bs ++ " " ++ show id ++ " = " ++ pretty x2
+                            go $ i+1
+                        Right bs -> do
+                            diagnostic $ pure $ "Chunk " ++ show i ++ " " ++ raw bs ++ " UNKNOWN WITNESS"
+                            go i
+            countItems <- go 0
+            countDistinct <- Ids.sizeUpperBound ids
+            diagnostic $ pure $ "Found at most " ++ show countDistinct ++ " distinct entries out of " ++ show countItems
+
+            when (countItems > countDistinct*2 || not verEq || witnessOld /= witnessNew) $ do
+                addTiming "Database compression"
+                resetChunksCompact h $ \out -> do
+                    out $ putEx ver
+                    out $ putEx witnessNew
+                    Ids.forWithKeyM_ ids $ \i (k,v) -> out $ save k i v
+            Just <$> Ids.forCopy ids snd
+
+    ids <- case ids of
+        Just ids -> pure ids
+        Nothing -> do
+            writeChunk h $ putEx ver
+            writeChunk h $ putEx witnessNew
+            Ids.empty
+
+    addTiming "With database"
+    out <- usingWriteChunks cleanup h
+    pure (ids, \k i v -> out $ save k i v)
+    where
+        unexpected x = when shakeStorageLog $ do
+            t <- getCurrentTime
+            appendFile (shakeFiles </> ".shake.storage.log") $ "\n[" ++ show t ++ "]: " ++ trimEnd x ++ "\n"
+        outputErr x = do
+            when (shakeVerbosity >= Warn) $ shakeOutput Warn $ unlines x
+            unexpected $ unlines x
+
+
+-- | A list oft witnesses, saved
+type Witnesses = BS.ByteString
+
+-- | The version and key, serialised
+newtype Witness = Witness BS.ByteString
+    deriving (Eq, Hashable, Ord)
+
+toWitness :: Show k => Ver -> k -> Witness
+toWitness (Ver v) k = Witness $ UTF8.fromString (show k ++ (if v == 0 then "" else ", v" ++ show v))
+
+instance BinaryEx [Witness] where
+    putEx xs = putEx [x | Witness x <- xs]
+    getEx = map Witness . getEx
+
+
+-- | Given the current witness table, and the serialised one from last time, return
+--   (witnesses that got removed, way to deserialise an entry into an Id, and (if the witness remains) the key and value)
+loadWitness :: forall k v . Show k => Map.HashMap k (Ver, BinaryOp v) -> Witnesses -> ([String], BS.ByteString -> (Id, Maybe (k, v)))
+loadWitness mp bs = (,) missing $ seq ind $ \bs ->
+            let (wInd :: Word16, i :: Id, bs2) = binarySplit2 bs
+            in case ind (fromIntegral wInd) of
+                    Nothing -> throwImpure $ errorInternal $ "Witness index out of bounds, " ++ show wInd
+                    Just f -> (i, f bs2)
+    where
+        ws :: [Witness] = getEx bs
+        missing = [UTF8.toString w | (i, Witness w) <- zipFrom 0 ws, isNothing $ fromJust (ind i) BS.empty]
+
+        mp2 :: Map.HashMap Witness (k, BinaryOp v) = Map.fromList [(toWitness ver k, (k, bin)) | (k,(ver,bin)) <- Map.toList mp]
+
+        ind :: (Int -> Maybe (BS.ByteString -> Maybe (k, v))) = seq mp2 $ fastAt $ flip map ws $ \w ->
+            case Map.lookup w mp2 of
+                Nothing -> const Nothing
+                Just (k, BinaryOp{..}) -> \bs -> Just (k, getOp bs)
+
+
+saveWitness :: forall k v . (Eq k, Hashable k, Show k) => Map.HashMap k (Ver, BinaryOp v) -> (Witnesses, k -> Id -> v -> Builder)
+saveWitness mp
+    | Map.size mp > fromIntegral (maxBound :: Word16) = throwImpure $ errorInternal $ "Number of distinct witness types exceeds limit, got " ++ show (Map.size mp)
+    | otherwise = (runBuilder $ putEx ws
+                  ,mpSave `seq` \k -> fromMaybe (throwImpure $ errorInternal $ "Don't know how to save, " ++ show k) $ Map.lookup k mpSave)
+    where
+        -- the entries in the witness table (in a stable order, to make it more likely to get a good equality)
+        ws :: [Witness] = sort $ map (\(k,(ver,_)) -> toWitness ver k) $ Map.toList mp
+
+        -- an index for each of the witness entries
+        wsIndex :: Map.HashMap Witness Word16 = Map.fromList $ zip ws [0 :: Word16 ..]
+
+        -- the save functions
+        mpSave :: Map.HashMap k (Id -> v -> Builder) = flip Map.mapWithKey mp $
+            \k (ver,BinaryOp{..}) ->
+                let tag = putEx $ wsIndex Map.! toWitness ver k
+                in \(Id w) v -> tag <> putEx w <> putOp v
diff --git a/src/Development/Shake/Internal/Core/Types.hs b/src/Development/Shake/Internal/Core/Types.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Core/Types.hs
@@ -0,0 +1,532 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, ScopedTypeVariables, DeriveDataTypeable, ViewPatterns #-}
+{-# LANGUAGE ExistentialQuantification, DeriveFunctor, RecordWildCards, FlexibleInstances #-}
+
+module Development.Shake.Internal.Core.Types(
+    BuiltinRun, BuiltinLint, BuiltinIdentity,
+    RunMode(..), RunResult(..), RunChanged(..),
+    UserRule(..), UserRuleVersioned(..), userRuleSize,
+    BuiltinRule(..), Global(..), Local(..), Action(..), runAction, addDiscount,
+    newLocal, localClearMutable, localMergeMutable,
+    Traces, newTrace, addTrace, flattenTraces,
+    DependsList, flattenDepends, enumerateDepends, addDepends, addDepends1, newDepends,
+    Stack, Step(..), Result(..), Database, DatabasePoly(..), Depends(..), Status(..), Trace(..), BS_Store,
+    getResult, exceptionStack, statusType, addStack, addCallStack,
+    incStep, emptyStack, topStack, showTopStack,
+    stepKey, StepKey(..),
+    rootKey, Root(..)
+    ) where
+
+import Control.Monad.IO.Class
+import Control.DeepSeq
+import Foreign.Storable
+import Data.Word
+import Data.Typeable
+import General.Binary
+import Data.Maybe
+import Data.List
+import Control.Exception
+import General.Extra
+import Development.Shake.Internal.Core.Database
+import Development.Shake.Internal.History.Shared
+import Development.Shake.Internal.History.Cloud
+import Development.Shake.Internal.History.Types
+import Development.Shake.Internal.Errors
+import qualified General.TypeMap as TMap
+import Data.IORef
+import qualified Data.ByteString.Char8 as BS
+import Numeric.Extra
+import System.Time.Extra
+import General.Intern(Id)
+import qualified Data.HashSet as Set
+import qualified Data.HashMap.Strict as Map
+import Data.Tuple.Extra
+
+import General.Pool
+import Development.Shake.Internal.Core.Monad
+import Development.Shake.Internal.Value
+import Development.Shake.Internal.Options
+import Development.Shake.Classes
+import Data.Semigroup
+import General.Cleanup
+import Control.Monad.Fail
+import Prelude
+
+
+---------------------------------------------------------------------
+-- UNDERLYING DATA TYPE
+
+-- | The 'Action' monad, use 'liftIO' to raise 'IO' actions into it, and 'Development.Shake.need' to execute files.
+--   Action values are used by 'addUserRule' and 'action'. The 'Action' monad tracks the dependencies of a rule.
+--   To raise an exception call 'error', 'fail' or @'liftIO' . 'throwIO'@.
+--
+--   The 'Action' type is both a 'Monad' and 'Applicative'. Anything that is depended upon applicatively
+--   will have its dependencies run in parallel. For example,
+--   @'Development.Shake.Internal.Rules.File.need' [\"a\"] '*>' 'Development.Shake.Internal.Rules.File.need' [\"b\"]@
+--   is equivalent to @'need' [\"a\", \"b\"]@.
+--
+--   Note that since Shake 0.18, the non-capturing monadic bind ('>>') will also run its dependencies in parallel.
+--   For example,
+--   @'Development.Shake.Internal.Rules.File.need' [\"a\"] '>>' 'Development.Shake.Internal.Rules.File.need' [\"b\"]@
+--   is also equivalent to @'Development.Shake.Internal.Rules.File.need' [\"a\", \"b\"]@.
+newtype Action a = Action {fromAction :: RAW ([String],[Key]) [Value] Global Local a}
+    deriving (Functor, Applicative, Monad, MonadIO, Typeable, Semigroup, Monoid, MonadFail)
+
+runAction :: Global -> Local -> Action a -> Capture (Either SomeException a)
+runAction g l (Action x) = runRAW (fromAction . build) g l x
+    where
+        -- first argument is a list of call stacks, since build only takes one we use the first
+        -- they are very probably all identical...
+        build :: [([String], [Key])] -> Action [[Value]]
+        build [] = pure []
+        build ks@((callstack,_):_) = do
+            let kss = map snd ks
+            unconcat kss <$> globalBuild g callstack (concat kss)
+
+
+---------------------------------------------------------------------
+-- PUBLIC TYPES
+
+-- | What mode a rule is running in, passed as an argument to 'BuiltinRun'.
+data RunMode
+    = RunDependenciesSame -- ^ My dependencies have not changed.
+    | RunDependenciesChanged -- ^ At least one of my dependencies from last time have changed, or I have no recorded dependencies.
+      deriving (Eq,Show)
+
+instance NFData RunMode where rnf x = x `seq` ()
+
+-- | How the output of a rule has changed.
+data RunChanged
+    = ChangedNothing -- ^ Nothing has changed.
+    | ChangedStore -- ^ The stored value has changed, but in a way that should be considered identical (used rarely).
+    | ChangedRecomputeSame -- ^ I recomputed the value and it was the same.
+    | ChangedRecomputeDiff -- ^ I recomputed the value and it was different.
+      deriving (Eq,Show)
+
+instance NFData RunChanged where rnf x = x `seq` ()
+
+
+-- | The result of 'BuiltinRun'.
+data RunResult value = RunResult
+    {runChanged :: RunChanged
+        -- ^ How has the 'RunResult' changed from what happened last time.
+    ,runStore :: BS.ByteString
+        -- ^ The value to store in the Shake database.
+    ,runValue :: value
+        -- ^ The value to return from 'Development.Shake.Rule.apply'.
+    } deriving Functor
+
+instance NFData value => NFData (RunResult value) where
+    rnf (RunResult x1 x2 x3) = rnf x1 `seq` x2 `seq` rnf x3
+
+
+
+---------------------------------------------------------------------
+-- UTILITY TYPES
+
+newtype Step = Step Word32 deriving (Eq,Ord,Show,Storable,BinaryEx,NFData,Hashable,Typeable)
+
+incStep (Step i) = Step $ i + 1
+
+
+-- To simplify journaling etc we smuggle the Step in the database, with a special StepKey
+newtype StepKey = StepKey ()
+    deriving (Show,Eq,Typeable,Hashable,Binary,BinaryEx,NFData)
+
+stepKey :: Key
+stepKey = newKey $ StepKey ()
+
+
+-- To make sure profiling has a complete view of what was demanded and all top-level 'action'
+-- things we fake up a Root node representing everything that was demanded
+newtype Root = Root () deriving (Eq,Typeable,Hashable,Binary,BinaryEx,NFData)
+
+instance Show Root where
+    show (Root ()) = "Root"
+
+rootKey :: Key
+rootKey = newKey $ Root ()
+
+
+---------------------------------------------------------------------
+-- CALL STACK
+
+-- Invariant: Every key must have its Id in the set
+data Stack = Stack (Maybe Key) [Either Key [String]] !(Set.HashSet Id) deriving Show
+
+exceptionStack :: Stack -> SomeException -> ShakeException
+exceptionStack stack@(Stack _ xs1 _) (callStackFromException -> (xs2, e)) =
+    ShakeException
+        (showTopStack stack)
+        (xs ++ ["* Raised the exception:" | not $ null xs])
+        e
+    where
+        xs = concatMap f $ reverse xs1 ++ [Right xs2]
+        f (Left x) = ["* Depends on: " ++ show x]
+        f (Right x) = map ("  at " ++) x
+
+
+showTopStack :: Stack -> String
+showTopStack = maybe "<unknown>" show . topStack
+
+addStack :: Id -> Key -> Stack -> Either SomeException Stack
+addStack i k (Stack _ ks is)
+    | i `Set.member` is = Left $ toException $ exceptionStack stack2 $ errorRuleRecursion (typeKey k) (show k)
+    | otherwise = Right stack2
+    where stack2 = Stack (Just k) (Left k:ks) (Set.insert i is)
+
+addCallStack :: [String] -> Stack -> Stack
+-- use group/head to squash adjacent duplicates, e.g. a want does an action and a need, both of which get the same location
+addCallStack xs (Stack t a b) = Stack t (Right xs : dropWhile (== Right xs) a) b
+
+topStack :: Stack -> Maybe Key
+topStack (Stack t _ _) = t
+
+emptyStack :: Stack
+emptyStack = Stack Nothing [] Set.empty
+
+
+---------------------------------------------------------------------
+-- TRACE
+
+data Trace = Trace
+    {traceMessage ::  {-# UNPACK #-} !BS.ByteString
+    ,traceStart :: {-# UNPACK #-} !Float
+    ,traceEnd :: {-# UNPACK #-} !Float
+    }
+    deriving Show
+
+instance NFData Trace where
+    rnf x = x `seq` () -- all strict atomic fields
+
+instance BinaryEx Trace where
+    putEx (Trace a b c) = putEx b <> putEx c <> putEx a
+    getEx x | (b,c,a) <- binarySplit2 x = Trace a b c
+
+instance BinaryEx [Trace] where
+    putEx = putExList . map putEx
+    getEx = map getEx . getExList
+
+newTrace :: String -> Seconds -> Seconds -> Trace
+newTrace msg start stop = Trace (BS.pack msg) (doubleToFloat start) (doubleToFloat stop)
+
+
+---------------------------------------------------------------------
+-- CENTRAL TYPES
+
+-- Things stored under OneShot are not required if we only do one compilation,
+-- but are if we do multiple, as we have to reset the database each time.
+-- globalOneShot controls that, and gives us a small memory optimisation.
+type OneShot a = a
+
+data Status
+    = Ready !(Result (Value, OneShot BS_Store)) -- ^ I have a value
+    | Failed !SomeException !(OneShot (Maybe (Result BS_Store))) -- ^ I have been run and raised an error
+    | Loaded !(Result BS_Store) -- ^ Loaded from the database
+    | Running !(NoShow (Either SomeException (Result (Value, BS_Store)) -> Locked ())) (Maybe (Result BS_Store)) -- ^ Currently in the process of being checked or built
+    | Missing -- ^ I am only here because I got into the Intern table
+      deriving Show
+
+instance NFData Status where
+    rnf x = case x of
+        Ready x -> rnf x
+        Failed x y -> rnfException x `seq` rnf y
+        Loaded x -> rnf x
+        Running _ x -> rnf x -- Can't RNF a waiting, but also unnecessary
+        Missing -> ()
+        where
+            -- best we can do for an arbitrary exception
+            rnfException = rnf . show
+
+
+data Result a = Result
+    {result :: !a -- ^ the result associated with the Key
+    ,built :: {-# UNPACK #-} !Step -- ^ when it was actually run
+    ,changed :: {-# UNPACK #-} !Step -- ^ the step for deciding if it's valid
+    ,depends :: ![Depends] -- ^ dependencies (don't run them early)
+    ,execution :: {-# UNPACK #-} !Float -- ^ how long it took when it was last run (seconds)
+    ,traces :: ![Trace] -- ^ a trace of the expensive operations (start/end in seconds since beginning of run)
+    } deriving (Show,Functor)
+
+instance NFData a => NFData (Result a) where
+    -- ignore unpacked fields
+    rnf (Result a _ _ b _ c) = rnf a `seq` rnf b `seq` rnf c
+
+statusType Ready{} = "Ready"
+statusType Failed{} = "Failed"
+statusType Loaded{} = "Loaded"
+statusType Running{} = "Running"
+statusType Missing{} = "Missing"
+
+
+getResult :: Status -> Maybe (Result (Either BS_Store Value))
+getResult (Ready r) = Just $ Right . fst <$> r
+getResult (Loaded r) = Just $ Left <$> r
+getResult (Running _ r) = fmap Left <$> r
+getResult _ = Nothing
+
+
+---------------------------------------------------------------------
+-- OPERATIONS
+
+newtype Depends = Depends {fromDepends :: [Id]}
+    deriving (NFData, Semigroup, Monoid)
+
+instance Show Depends where
+    -- Appears in diagnostic output and the Depends ctor is just verbose
+    show = show . fromDepends
+
+instance BinaryEx Depends where
+    putEx (Depends xs) = putExStorableList xs
+    getEx = Depends . getExStorableList
+
+instance BinaryEx [Depends] where
+    putEx = putExList . map putEx
+    getEx = map getEx . getExList
+
+data DependsList
+    = DependsNone
+    | DependsDirect [Depends]
+    | DependsSequence DependsList DependsList
+    | DependsSequence1 DependsList Depends
+    | DependsParallel [DependsList]
+
+-- Create a new set of depends, from a list in the right order
+newDepends :: [Depends] -> DependsList
+newDepends = DependsDirect
+
+-- Add two sequences of dependencies in order
+addDepends :: DependsList -> DependsList -> DependsList
+addDepends = DependsSequence
+
+addDepends1 :: DependsList -> Depends -> DependsList
+addDepends1 = DependsSequence1
+
+-- Two goals here, merge parallel lists so they retain as much leading parallelism as possible
+-- Afterwards each Id must occur at most once and there are no empty Depends
+flattenDepends :: DependsList -> [Depends]
+flattenDepends d = fMany Set.empty $ flat d []
+    where
+        flat :: DependsList -> [Depends] -> [Depends]
+        flat DependsNone rest = rest
+        flat (DependsDirect xs) rest = xs ++ rest
+        flat (DependsSequence xs ys) rest = flat xs $ flat ys rest
+        flat (DependsSequence1 xs y) rest = flat xs $ y:rest
+        -- for each element of xs, we want to pull off the things that must be done first
+        -- and then the stuff that can be done later
+        flat (DependsParallel xs) rest = map mconcat xss ++ rest
+            where xss = transpose $ map (`flat` []) xs
+
+        fMany _ [] = []
+        fMany seen (Depends d:ds) = [Depends d2 | d2 /= []] ++ fMany seen2 ds
+            where (d2,seen2) = fOne seen d
+
+        fOne seen [] = ([], seen)
+        fOne seen (x:xs) | x `Set.member` seen = fOne seen xs
+        fOne seen (x:xs) = first (x:) $ fOne (Set.insert x seen) xs
+
+
+
+
+-- List all the dependencies in whatever order you wish, used for linting
+enumerateDepends :: DependsList -> [Depends]
+enumerateDepends d = f d []
+    where
+        f DependsNone rest = rest
+        f (DependsDirect xs) rest = xs ++ rest
+        f (DependsSequence xs ys) rest = f xs $ f ys rest
+        f (DependsSequence1 xs y) rest = f xs (y:rest)
+        f (DependsParallel []) rest = rest
+        f (DependsParallel (x:xs)) rest = f x $ f (DependsParallel xs) rest
+
+
+-- | Define a rule between @key@ and @value@. As an example, a typical 'BuiltinRun' will look like:
+--
+-- > run key oldStore mode = do
+-- >     ...
+-- >     pure $ RunResult change newStore newValue
+--
+--   Where you have:
+--
+-- * @key@, how to identify individual artifacts, e.g. with file names.
+--
+-- * @oldStore@, the value stored in the database previously, e.g. the file modification time.
+--
+-- * @mode@, either 'RunDependenciesSame' (none of your dependencies changed, you can probably not rebuild) or
+--   'RunDependenciesChanged' (your dependencies changed, probably rebuild).
+--
+-- * @change@, usually one of either 'ChangedNothing' (no work was required) or 'ChangedRecomputeDiff'
+--   (I reran the rule and it should be considered different).
+--
+-- * @newStore@, the new value to store in the database, which will be passed in next time as @oldStore@.
+--
+-- * @newValue@, the result that 'Development.Shake.Rule.apply' will return when asked for the given @key@.
+type BuiltinRun key value
+    = key
+    -> Maybe BS.ByteString
+    -> RunMode
+    -> Action (RunResult value)
+
+-- | The action performed by @--lint@ for a given @key@/@value@ pair.
+--   At the end of the build the lint action will be called for each @key@ that was built this run,
+--   passing the @value@ it produced. Return 'Nothing' to indicate the value has not changed and
+--   is acceptable, or 'Just' an error message to indicate failure.
+--
+--   For builtin rules where the value is expected to change, or has no useful checks to perform.
+--   use 'Development.Shake.Rules.noLint'.
+type BuiltinLint key value = key -> value -> IO (Maybe String)
+
+
+-- | Produce an identity for a @value@ that can be used to do direct equality. If you have a custom
+--   notion of equality then the result should return only one member from each equivalence class,
+--   as values will be compared for literal equality.
+--   The result of the identity should be reasonably short (if it is excessively long, hash it).
+--
+--   For rules where the value is never compatible use 'Development.Shake.Rules.noIdentity', which
+--   returns 'Nothing'. This will disable shared caches of anything that depends on it.
+type BuiltinIdentity key value = key -> value -> Maybe BS.ByteString
+
+data BuiltinRule = BuiltinRule
+    {builtinLint :: BuiltinLint Key Value
+    ,builtinIdentity :: BuiltinIdentity Key Value
+    ,builtinRun :: BuiltinRun Key Value
+    ,builtinKey :: BinaryOp Key
+    ,builtinVersion :: Ver
+    ,builtinLocation :: String
+    }
+
+-- | A 'UserRule' data type, representing user-defined rules associated with a particular type.
+--   As an example 'Development.Shake.?>' and 'Development.Shake.%>' will add entries to the 'UserRule' data type.
+data UserRule a
+-- > priority p1 (priority p2 x) == priority p1 x
+-- > priority p (x `ordered` y) = priority p x `ordered` priority p y
+-- > priority p (x `unordered` y) = priority p x `unordered` priority p y
+-- > ordered is associative
+-- > unordered is associative and commutative
+-- > alternative does not obey priorities, until picking the best one
+    = UserRule a -- ^ Added to the state with @'addUserRule' :: Typeable a => a -> 'Rules' ()@.
+    | Unordered [UserRule a] -- ^ Rules combined with the 'Monad' \/ 'Monoid'.
+    | Priority Double (UserRule a) -- ^ Rules defined under 'priority'.
+    | Alternative (UserRule a) -- ^ Rule defined under 'alternatives', matched in order.
+    | Versioned Ver (UserRule a) -- ^ Rule defined under 'versioned', attaches a version.
+      deriving (Eq,Show,Functor,Typeable)
+
+data UserRuleVersioned a = UserRuleVersioned
+    {userRuleVersioned :: Bool -- ^ Does Versioned exist anywhere within userRuleContents
+    ,userRuleContents :: UserRule a -- ^ The actual rules
+    }
+
+instance Semigroup (UserRuleVersioned a) where
+    UserRuleVersioned b1 x1 <> UserRuleVersioned b2 x2 = UserRuleVersioned (b1 || b2) (x1 <> x2)
+
+instance Monoid (UserRuleVersioned a) where
+    mempty = UserRuleVersioned False mempty
+    mappend = (<>)
+
+instance Semigroup (UserRule a) where
+    x <> y = Unordered [x,y]
+
+instance Monoid (UserRule a) where
+    mempty = Unordered []
+    mappend = (<>)
+
+userRuleSize :: UserRule a -> Int
+userRuleSize UserRule{} = 1
+userRuleSize (Unordered xs) = sum $ map userRuleSize xs
+userRuleSize (Priority _ x) = userRuleSize x
+userRuleSize (Alternative x) = userRuleSize x
+userRuleSize (Versioned _ x) = userRuleSize x
+
+
+type Database = DatabasePoly Key Status
+
+-- global constants of Action
+data Global = Global
+    {globalBuild :: [String] -> [Key] -> Action [Value]
+    ,globalDatabase :: Database -- ^ Database, contains knowledge of the state of each key
+    ,globalPool :: Pool -- ^ Pool, for queuing new elements
+    ,globalCleanup :: Cleanup -- ^ Cleanup operations
+    ,globalTimestamp :: IO Seconds -- ^ Clock saying how many seconds through the build
+    ,globalRules :: Map.HashMap TypeRep BuiltinRule -- ^ Rules for this build
+    ,globalOutput :: Verbosity -> String -> IO () -- ^ Output function
+    ,globalOptions  :: ShakeOptions -- ^ Shake options
+    ,globalDiagnostic :: IO String -> IO () -- ^ Debugging function
+    ,globalRuleFinished :: Key -> Action () -- ^ actions to run after each rule
+    ,globalAfter :: IORef [IO ()] -- ^ Operations to run on success, e.g. removeFilesAfter
+    ,globalTrackAbsent :: IORef [(Key, Key)] -- ^ Tracked things, in rule fst, snd must be absent
+    ,globalProgress :: IO Progress -- ^ Request current progress state
+    ,globalUserRules :: TMap.Map UserRuleVersioned
+    ,globalShared :: Maybe Shared -- ^ The active shared state, if any
+    ,globalCloud :: Maybe Cloud
+    ,globalStep :: {-# UNPACK #-} !Step
+    ,globalOneShot :: Bool -- ^ I am running in one-shot mode so don't need to store BS's for Result/Failed
+    }
+
+-- local variables of Action
+data Local = Local
+    -- constants
+    {localStack :: Stack -- ^ The stack that ran to get here.
+    ,localBuiltinVersion :: Ver -- ^ The builtinVersion of the rule you are running
+    -- stack scoped local variables
+    ,localVerbosity :: Verbosity -- ^ Verbosity, may be changed locally
+    ,localBlockApply ::  Maybe String -- ^ Reason to block apply, or Nothing to allow
+    -- mutable local variables
+    ,localDepends :: DependsList -- ^ Dependencies that we rely on, morally a list of sets
+    ,localDiscount :: !Seconds -- ^ Time spend building dependencies (may be negative for parallel)
+    ,localTraces :: Traces -- ^ Traces that have occurred
+    ,localTrackAllows :: [Key -> Bool] -- ^ Things that are allowed to be used
+    ,localTrackRead :: [Key] -- ^ Calls to 'lintTrackRead'
+    ,localTrackWrite :: [Key] -- ^ Calls to 'lintTrackWrite'
+    ,localProduces :: [(Bool, FilePath)] -- ^ Things this rule produces, True to check them
+    ,localHistory :: !Bool -- ^ Is it valid to cache the result
+    }
+
+data Traces
+    = TracesNone -- no traces
+    | TracesSequence1 Traces Trace -- Like TracesSequence but with 1 element
+    | TracesSequence Traces Traces -- first the Traces happened, then Traces that happened after
+    | TracesParallel [Traces] -- these traces happened in parallel with each other
+
+flattenTraces :: Traces -> [Trace]
+flattenTraces t = f t []
+    where
+        f TracesNone rest = rest
+        f (TracesSequence1 a b) rest = f a (b:rest)
+        f (TracesSequence a b) rest = f a $ f b rest
+        f (TracesParallel []) rest = rest
+        -- Might want to resort them by time started?
+        f (TracesParallel (x:xs)) rest = f x $ f (TracesParallel xs) rest
+
+addTrace :: Traces -> Trace -> Traces
+addTrace ts t = ts `TracesSequence1` t
+
+addDiscount :: Seconds -> Local -> Local
+addDiscount s l = l{localDiscount = s + localDiscount l}
+
+newLocal :: Stack -> Verbosity -> Local
+newLocal stack verb = Local stack (Ver 0) verb Nothing DependsNone 0 TracesNone [] [] [] [] True
+
+-- Clear all the local mutable variables
+localClearMutable :: Local -> Local
+localClearMutable Local{..} = (newLocal localStack localVerbosity){localBlockApply=localBlockApply, localBuiltinVersion=localBuiltinVersion}
+
+-- Merge, works well assuming you clear the variables first with localClearMutable.
+-- Assume the first was run sequentially, and the list in parallel.
+localMergeMutable :: Local -> [Local] -> Local
+-- don't construct with RecordWildCards so any new fields raise an error
+localMergeMutable root xs = Local
+    -- immutable/stack that need copying
+    {localStack = localStack root
+    ,localBuiltinVersion = localBuiltinVersion root
+    ,localVerbosity = localVerbosity root
+    ,localBlockApply = localBlockApply root
+    -- mutable locals that need integrating
+    -- note that a lot of the lists are stored in reverse, assume root happened first
+    ,localDepends = DependsParallel (map localDepends xs) `DependsSequence` localDepends root
+    ,localDiscount = sum $ map localDiscount $ root : xs
+    ,localTraces = TracesParallel (map localTraces xs) `TracesSequence` localTraces root
+    ,localTrackAllows = localTrackAllows root ++ concatMap localTrackAllows xs
+    ,localTrackRead = localTrackRead root ++ concatMap localTrackRead xs
+    ,localTrackWrite = localTrackWrite root ++ concatMap localTrackWrite xs
+    ,localProduces = concatMap localProduces xs ++ localProduces root
+    ,localHistory = all localHistory $ root:xs
+    }
diff --git a/src/Development/Shake/Internal/Demo.hs b/src/Development/Shake/Internal/Demo.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Demo.hs
@@ -0,0 +1,121 @@
+
+-- | Demo tutorial, accessed with --demo
+module Development.Shake.Internal.Demo(demo) where
+
+import Development.Shake.Internal.Paths
+import Development.Shake.Command
+
+import Control.Exception.Extra
+import Control.Monad
+import Data.List.Extra
+import Data.Maybe
+import System.Directory
+import System.Exit
+import System.FilePath
+import General.Extra
+import Development.Shake.FilePath(exe)
+import System.IO
+import System.Info.Extra
+
+
+demo :: Bool -> IO ()
+demo auto = do
+    hSetBuffering stdout NoBuffering
+    putStrLn $ "% Welcome to the Shake v" ++ shakeVersionString ++ " demo mode!"
+
+    putStr "% Detecting machine configuration... "
+    hasManual <- hasManualData
+    ghc <- isJust <$> findExecutable "ghc"
+    (gcc, gccPath) <- findGcc
+    shakeLib <- wrap $ fmap (not . null . words . fromStdout) (cmd ("ghc-pkg list --simple-output shake" :: String))
+    ninja <- findExecutable "ninja"
+    putStrLn "done\n"
+
+    let path = if isWindows then "%PATH%" else "$PATH"
+    require ghc $ "% You don't have 'ghc' on your " ++ path ++ ", which is required to run the demo."
+    require gcc $ "% You don't have 'gcc' on your " ++ path ++ ", which is required to run the demo."
+    require shakeLib "% You don't have the 'shake' library installed with GHC, which is required to run the demo."
+    require hasManual "% You don't have the Shake data files installed, which are required to run the demo."
+
+    empty <- all (all (== '.')) <$> getDirectoryContents "."
+    dir <- if empty then getCurrentDirectory else do
+        home <- getHomeDirectory
+        dir <- getDirectoryContents home
+        pure $ home </> headErr (map ("shake-demo" ++) ("":map show [2..]) \\ dir)
+
+    putStrLn "% The Shake demo uses an empty directory, OK to use:"
+    putStrLn $ "%     " ++ dir
+    b <- yesNo auto
+    require b "% Please create an empty directory to run the demo from, then run 'shake --demo' again."
+
+    putStr "% Copying files... "
+    copyManualData dir
+    unless isWindows $ do
+         p <- getPermissions $ dir </> "build.sh"
+         setPermissions (dir </> "build.sh") p{executable=True}
+    putStrLn "done"
+
+    let pause = do
+            putStr "% Press ENTER to continue: "
+            if auto then putLine "" else getLine
+    let execute x = do
+            putStrLn $ "% RUNNING: " ++ x
+            cmd (Cwd dir) (AddPath [] (maybeToList gccPath)) Shell x :: IO ()
+    let build = if isWindows then "build" else "./build.sh"
+
+    putStrLn "\n% [1/5] Building an example project with Shake."
+    pause
+    putStrLn $ "% RUNNING: cd " ++ dir
+    execute build
+
+    putStrLn "\n% [2/5] Running the produced example."
+    pause
+    execute $ "_build" </> "run" <.> exe
+
+    putStrLn "\n% [3/5] Rebuilding an example project with Shake (nothing should change)."
+    pause
+    execute build
+
+    putStrLn "\n% [4/5] Cleaning the build."
+    pause
+    execute $ build ++ " clean"
+
+    putStrLn "\n% [5/5] Rebuilding with 2 threads and profiling."
+    pause
+    execute $ build ++ " -j2 --report --report=-"
+    putStrLn "\n% See the profiling summary above, or look at the HTML profile report in"
+    putStrLn $ "%     " ++ dir </> "report.html"
+
+    putStrLn "\n% Demo complete - all the examples can be run from:"
+    putStrLn $ "%     " ++ dir
+    putStrLn "% For more info see https://shakebuild.com"
+    when (isJust ninja) $ do
+        putStrLn "\n% PS. Shake can also execute Ninja build files"
+        putStrLn "% For more info see https://shakebuild.com/ninja"
+
+
+
+-- | Require the user to press @y@ before continuing.
+yesNo :: Bool -> IO Bool
+yesNo auto = do
+    putStr "% [Y/N] (then ENTER): "
+    x <- if auto then putLine "y" else lower <$> getLine
+    if "y" `isPrefixOf` x then
+        pure True
+     else if "n" `isPrefixOf` x then
+        pure False
+     else
+        yesNo auto
+
+putLine :: String -> IO String
+putLine x = putStrLn x >> pure x
+
+
+-- | Replace exceptions with 'False'.
+wrap :: IO Bool -> IO Bool
+wrap act = act `catch_` const (pure False)
+
+
+-- | Require a condition to be true, or exit with a message.
+require :: Bool -> String -> IO ()
+require b msg = unless b $ putStrLn msg >> exitFailure
diff --git a/src/Development/Shake/Internal/Derived.hs b/src/Development/Shake/Internal/Derived.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Derived.hs
@@ -0,0 +1,303 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+
+module Development.Shake.Internal.Derived(
+    copyFile', copyFileChanged,
+    readFile', readFileLines,
+    writeFile', writeFileLines, writeFileChanged,
+    withTempFile, withTempDir,
+    withTempFileWithin, withTempDirWithin,
+    getHashedShakeVersion,
+    getShakeExtra, getShakeExtraRules, addShakeExtra,
+    par, forP,
+    newResource, newThrottle, withResources,
+    newCache
+    ) where
+
+import Control.Monad.Extra
+import Control.Monad.IO.Class
+import System.Directory
+import System.FilePath (takeDirectory)
+import System.IO (IOMode (..), hGetContents, withFile)
+import qualified System.IO.Extra as IO
+
+import Development.Shake.Internal.Errors
+import Development.Shake.Internal.Resource
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Rules.File
+import qualified Data.ByteString as BS
+import qualified Data.HashMap.Strict as Map
+import General.Extra
+import Data.List.Extra
+import Data.Hashable
+import Data.Typeable
+import Data.Dynamic
+
+
+-- | Get a checksum of a list of files, suitable for using as `shakeVersion`.
+--   This will trigger a rebuild when the Shake rules defined in any of the files are changed.
+--   For example:
+--
+-- @
+-- main = do
+--     ver <- 'getHashedShakeVersion' [\"Shakefile.hs\"]
+--     'shakeArgs' 'shakeOptions'{'shakeVersion' = ver} ...
+-- @
+--
+--   To automatically detect the name of the current file, turn on the @TemplateHaskell@
+--   extension and write @$(LitE . StringL . loc_filename \<$\> location)@.
+--
+--   This feature can be turned off during development by passing
+--   the flag @--no-rule-version@ or setting 'shakeVersionIgnore' to 'True'.
+getHashedShakeVersion :: [FilePath] -> IO String
+getHashedShakeVersion files = do
+    hashes <- mapM (fmap (hashWithSalt 0) . BS.readFile) files
+    pure $ "hash-" ++ show (hashWithSalt 0 hashes)
+
+
+-- | Get an item from 'shakeExtra', using the requested type as the key. Fails
+-- if the value found at this key does not match the requested type.
+getShakeExtra :: Typeable a => Action (Maybe a)
+getShakeExtra = liftIO . lookupShakeExtra . shakeExtra =<< getShakeOptions
+
+-- | A version of 'getShakeExtra' in 'Rules'.
+getShakeExtraRules :: Typeable a => Rules (Maybe a)
+getShakeExtraRules = liftIO . lookupShakeExtra . shakeExtra =<< getShakeOptionsRules
+
+lookupShakeExtra :: forall a . Typeable a => Map.HashMap TypeRep Dynamic -> IO (Maybe a)
+lookupShakeExtra mp =
+    case Map.lookup want mp of
+        Just dyn
+            | Just x <- fromDynamic dyn -> pure $ Just x
+            | otherwise -> throwM $ errorStructured
+                "shakeExtra value is malformed, all keys and values must agree"
+                [("Key", Just $ show want)
+                ,("Value", Just $ show $ dynTypeRep dyn)]
+                "Use addShakeExtra to ensure shakeExtra is well-formed"
+        Nothing -> pure Nothing
+    where want = typeRep (Proxy :: Proxy a)
+
+-- | Add a properly structued value to 'shakeExtra' which can be retrieved with 'getShakeExtra'.
+addShakeExtra :: Typeable a => a -> Map.HashMap TypeRep Dynamic -> Map.HashMap TypeRep Dynamic
+addShakeExtra x = Map.insert (typeOf x) (toDyn x)
+
+
+-- | @copyFile' old new@ copies the existing file from @old@ to @new@.
+--   The @old@ file will be tracked as a dependency.
+--   Also creates the new directory if necessary.
+copyFile' :: Partial => FilePath -> FilePath -> Action ()
+copyFile' old new = do
+    need [old]
+    putVerbose $ "Copying from " ++ old ++ " to " ++ new
+    liftIO $ do
+        createDirectoryRecursive $ takeDirectory new
+        removeFile_ new -- symlink safety
+        copyFile old new
+
+-- | @copyFileChanged old new@ copies the existing file from @old@ to @new@, if the contents have changed.
+--   The @old@ file will be tracked as a dependency.
+--   Also creates the new directory if necessary.
+copyFileChanged :: Partial => FilePath -> FilePath -> Action ()
+copyFileChanged old new = do
+    need [old]
+    -- in newer versions of the directory package we can use copyFileWithMetadata which (we think) updates
+    -- the timestamp as well and thus no need to read the source file twice.
+    unlessM (liftIO $ doesFileExist new &&^ IO.fileEq old new) $ do
+        putVerbose $ "Copying from " ++ old ++ " to " ++ new
+        liftIO $ do
+            createDirectoryRecursive $ takeDirectory new
+            -- copyFile does a lot of clever stuff with permissions etc, so make sure we just reuse it
+            removeFile_ new -- symlink safety
+            liftIO $ copyFile old new
+
+
+-- | Read a file, after calling 'need'. The argument file will be tracked as a dependency.
+readFile' :: Partial => FilePath -> Action String
+readFile' x = need [x] >> liftIO (readFile x)
+
+-- | Write a file, lifted to the 'Action' monad.
+writeFile' :: (MonadIO m, Partial) => FilePath -> String -> m ()
+writeFile' name x = liftIO $ do
+    createDirectoryRecursive $ takeDirectory name
+    removeFile_ name -- symlink safety
+    writeFile name x
+
+
+-- | A version of 'readFile'' which also splits the result into lines.
+--   The argument file will be tracked as a dependency.
+readFileLines :: Partial => FilePath -> Action [String]
+readFileLines = fmap lines . readFile'
+
+-- | A version of 'writeFile'' which writes out a list of lines.
+writeFileLines :: (MonadIO m, Partial) => FilePath -> [String] -> m ()
+writeFileLines name = writeFile' name . unlines
+
+
+-- | Write a file, but only if the contents would change.
+writeFileChanged :: (MonadIO m, Partial) => FilePath -> String -> m ()
+writeFileChanged name x = liftIO $ do
+    createDirectoryRecursive $ takeDirectory name
+    b <- doesFileExist name
+    if not b then writeFile name x else do
+        -- Cannot use ByteString here, since it has different line handling
+        -- semantics on Windows
+        b <- withFile name ReadMode $ \h -> do
+            src <- hGetContents h
+            pure $! src /= x
+        when b $ do
+            removeFile_ name -- symlink safety
+            writeFile name x
+
+
+-- | Create a temporary file in the temporary directory. The file will be deleted
+--   after the action completes (provided the file is not still open).
+--   The 'FilePath' will not have any file extension, will exist, and will be zero bytes long.
+--   If you require a file with a specific name, use 'withTempDir'.
+withTempFile :: (FilePath -> Action a) -> Action a
+withTempFile act = do
+    (file, del) <- liftIO IO.newTempFile
+    act file `actionFinally` del
+
+-- | Like 'withTempFile' but using a custom temporary directory.
+withTempFileWithin :: FilePath -> (FilePath -> Action a) -> Action a
+withTempFileWithin tdir act = do
+    (file, del) <- liftIO $ IO.newTempFileWithin tdir
+    act file `actionFinally` del
+
+
+-- | Create a temporary directory inside the system temporary directory.
+--   The directory will be deleted after the action completes. As an example:
+--
+-- @
+-- 'withTempDir' $ \\mydir -> do
+--    'putInfo' $ \"Temp directory is \" ++ mydir
+--    'writeFile'' (mydir \</\> \"test.txt\") \"writing out a temp file\"
+-- @
+withTempDir :: (FilePath -> Action a) -> Action a
+withTempDir act = do
+    (dir,del) <- liftIO IO.newTempDir
+    act dir `actionFinally` del
+
+-- | Like 'withTempDir' but using a custom temporary directory.
+withTempDirWithin :: FilePath -> (FilePath -> Action a) -> Action a
+withTempDirWithin tdir act = do
+    (dir,del) <- liftIO $ IO.newTempDirWithin tdir
+    act dir `actionFinally` del
+
+
+
+-- | A 'parallel' version of 'forM'.
+forP :: [a] -> (a -> Action b) -> Action [b]
+forP xs f = parallel $ map f xs
+
+-- | Execute two operations in parallel, based on 'parallel'.
+par :: Action a -> Action b -> Action (a,b)
+par a b = (\[Left a, Right b] -> (a,b)) <$> parallel [Left <$> a, Right <$> b]
+
+
+-- | Create a finite resource, given a name (for error messages) and a quantity of the resource that exists.
+--   Shake will ensure that actions using the same finite resource do not execute in parallel.
+--   As an example, only one set of calls to the Excel API can occur at one time, therefore
+--   Excel is a finite resource of quantity 1. You can write:
+--
+-- @
+-- 'Development.Shake.shake' 'Development.Shake.shakeOptions'{'Development.Shake.shakeThreads'=2} $ do
+--    'Development.Shake.want' [\"a.xls\",\"b.xls\"]
+--    excel <- 'Development.Shake.newResource' \"Excel\" 1
+--    \"*.xls\" 'Development.Shake.%>' \\out ->
+--        'Development.Shake.withResource' excel 1 $
+--            'Development.Shake.cmd' \"excel\" out ...
+-- @
+--
+--   Now the two calls to @excel@ will not happen in parallel.
+--
+--   As another example, calls to compilers are usually CPU bound but calls to linkers are usually
+--   disk bound. Running 8 linkers will often cause an 8 CPU system to grid to a halt. We can limit
+--   ourselves to 4 linkers with:
+--
+-- @
+-- disk <- 'Development.Shake.newResource' \"Disk\" 4
+-- 'Development.Shake.want' [show i 'Development.Shake.FilePath.<.>' \"exe\" | i <- [1..100]]
+-- \"*.exe\" 'Development.Shake.%>' \\out ->
+--     'Development.Shake.withResource' disk 1 $
+--         'Development.Shake.cmd' \"ld -o\" [out] ...
+-- \"*.o\" 'Development.Shake.%>' \\out ->
+--     'Development.Shake.cmd' \"cl -o\" [out] ...
+-- @
+newResource :: String -> Int -> Rules Resource
+newResource name mx = liftIO $ newResourceIO name mx
+
+
+-- | Create a throttled resource, given a name (for error messages) and a number of resources (the 'Int') that can be
+--   used per time period (the 'Double' in seconds). Shake will ensure that actions using the same throttled resource
+--   do not exceed the limits. As an example, let us assume that making more than 1 request every 5 seconds to
+--   Google results in our client being blacklisted, we can write:
+--
+-- @
+-- google <- 'Development.Shake.newThrottle' \"Google\" 1 5
+-- \"*.url\" 'Development.Shake.%>' \\out -> do
+--     'Development.Shake.withResource' google 1 $
+--         'Development.Shake.cmd' \"wget\" [\"https:\/\/google.com?q=\" ++ 'Development.Shake.FilePath.takeBaseName' out] \"-O\" [out]
+-- @
+--
+--   Now we will wait at least 5 seconds after querying Google before performing another query. If Google change the rules to
+--   allow 12 requests per minute we can instead use @'Development.Shake.newThrottle' \"Google\" 12 60@, which would allow
+--   greater parallelisation, and avoid throttling entirely if only a small number of requests are necessary.
+--
+--   In the original example we never make a fresh request until 5 seconds after the previous request has /completed/. If we instead
+--   want to throttle requests since the previous request /started/ we can write:
+--
+-- @
+-- google <- 'Development.Shake.newThrottle' \"Google\" 1 5
+-- \"*.url\" 'Development.Shake.%>' \\out -> do
+--     'Development.Shake.withResource' google 1 $ pure ()
+--     'Development.Shake.cmd' \"wget\" [\"https:\/\/google.com?q=\" ++ 'Development.Shake.FilePath.takeBaseName' out] \"-O\" [out]
+-- @
+--
+--   However, the rule may not continue running immediately after 'Development.Shake.withResource' completes, so while
+--   we will never exceed an average of 1 request every 5 seconds, we may end up running an unbounded number of
+--   requests simultaneously. If this limitation causes a problem in practice it can be fixed.
+newThrottle :: String -> Int -> Double -> Rules Resource
+newThrottle name count period = liftIO $ newThrottleIO name count period
+
+
+-- | Run an action which uses part of several finite resources. Acquires the resources in a stable
+--   order, to prevent deadlock. If all rules requiring more than one resource acquire those
+--   resources with a single call to 'withResources', resources will not deadlock.
+withResources :: [(Resource, Int)] -> Action a -> Action a
+withResources res act
+    | (r,i):_ <- filter ((< 0) . snd) res = error $ "You cannot acquire a negative quantity of " ++ show r ++ ", requested " ++ show i
+    | otherwise = f $ groupSort res
+    where
+        f [] = act
+        f ((r,xs):rs) = withResource r (sum xs) $ f rs
+
+
+-- | Given an action on a key, produce a cached version that will execute the action at most once per key per run.
+--   Using the cached result will still result include any dependencies that the action requires - e.g. if the action
+--   does 'need' then those dependencies will be added to every rule that uses that cache.
+--   Each call to 'newCache' creates a separate cache that is independent of all other calls to 'newCache'.
+--
+--   The operations will not be cached between runs and nothing will be persisted to the Shake database.
+--   For an alternative that does persist the cache, see 'Development.Shake.addOracleCache'.
+--
+--   This function is useful when creating files that store intermediate values,
+--   to avoid the overhead of repeatedly reading from disk, particularly if the file requires expensive parsing.
+--   As an example:
+--
+-- @
+-- digits \<- 'newCache' $ \\file -> do
+--     src \<- readFile\' file
+--     pure $ length $ filter isDigit src
+-- \"*.digits\" 'Development.Shake.%>' \\x -> do
+--     v1 \<- digits ('dropExtension' x)
+--     v2 \<- digits ('dropExtension' x)
+--     'Development.Shake.writeFile'' x $ show (v1,v2)
+-- @
+--
+--   To create the result @MyFile.txt.digits@ the file @MyFile.txt@ will be read and counted, but only at most
+--   once per execution.
+newCache :: (Eq k, Hashable k) => (k -> Action v) -> Rules (k -> Action v)
+newCache = liftIO . newCacheIO
diff --git a/src/Development/Shake/Internal/Errors.hs b/src/Development/Shake/Internal/Errors.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Errors.hs
@@ -0,0 +1,143 @@
+{-# LANGUAGE DeriveDataTypeable, PatternGuards, RecordWildCards, ConstraintKinds #-}
+
+-- | Errors seen by the user
+module Development.Shake.Internal.Errors(
+    ShakeException(..),
+    throwM, throwImpure,
+    errorInternal,
+    errorStructured,
+    errorNoRuleToBuildType, errorRuleDefinedMultipleTimes,
+    errorMultipleRulesMatch, errorRuleRecursion, errorComplexRecursion, errorNoApply,
+    errorDirectoryNotFile, errorNoHash
+    ) where
+
+import Data.Tuple.Extra
+import Control.Exception.Extra
+import Control.Monad.IO.Class
+import General.Extra
+import Data.Typeable
+import Data.List.Extra
+import Data.Maybe
+
+
+throwM :: MonadIO m => SomeException -> m a
+throwM = liftIO . throwIO
+
+throwImpure :: SomeException -> a
+throwImpure = throw
+
+
+errorInternal :: Partial => String -> SomeException
+errorInternal msg = toException $ ErrorCall $ unlines $
+    ("Development.Shake: Internal error, please report to Neil Mitchell (" ++ msg ++ ")") : callStackFull
+
+alternatives = let (*) = (,) in
+    ["_rule_" * "oracle"
+    ,"_Rule_" * "Oracle"
+    ,"_key_" * "question"
+    ,"_Key_" * "Question"
+    ,"_result_" * "answer"
+    ,"_Result_" * "Answer"
+    ,"_addBuiltinRule_" * "addOracle"
+    ,"_apply_" * "askOracle"]
+
+
+errorStructured :: String -> [(String, Maybe String)] -> String -> SomeException
+errorStructured msg args hint = toException $ ErrorCall $ unlines $
+        [msg ++ (if null args then "." else ":")] ++
+        ["  " ++ a ++ [':' | a /= ""] ++ replicate (as - length a + 2) ' ' ++ b | (a,b) <- args2] ++
+        [hint | hint /= ""]
+    where
+        as = maximum $ 0 : map (length . fst) args2
+        args2 = [(a,b) | (a,Just b) <- args]
+
+
+
+structured :: Bool -> String -> [(String, Maybe String)] -> String -> SomeException
+structured alt msg args hint = errorStructured (f msg) (map (first f) args) (f hint)
+    where
+        f = filter (/= '_') . (if alt then g else id)
+        g xs | res:_ <- [to ++ g rest | (from, to) <- alternatives, Just rest <- [stripPrefix from xs]] = res
+        g (x:xs) = x : g xs
+        g [] = []
+
+
+errorDirectoryNotFile :: FilePath -> SomeException
+errorDirectoryNotFile dir = errorStructured
+    "Build system error - expected a file, got a directory"
+    [("Directory", Just dir)]
+    "Probably due to calling 'need' on a directory. Shake only permits 'need' on files."
+
+errorNoRuleToBuildType :: TypeRep -> Maybe String -> Maybe TypeRep -> SomeException
+errorNoRuleToBuildType tk k tv = structured (specialIsOracleKey tk)
+    "Build system error - no _rule_ matches the _key_ type"
+    [("_Key_ type", Just $ show tk)
+    ,("_Key_ value", k)
+    ,("_Result_ type", fmap show tv)]
+    "You are missing a call to _addBuiltinRule_, or your call to _apply_ has the wrong _key_ type"
+
+errorRuleDefinedMultipleTimes :: TypeRep -> [String] -> SomeException
+errorRuleDefinedMultipleTimes tk locations = structured (specialIsOracleKey tk)
+    "Build system error - _rule_ defined twice at one _key_ type"
+    (("_Key_ type", Just $ show tk) :
+     [("Location " ++ show i, Just x) | (i, x) <- zipFrom 1 locations])
+    "You have called _addBuiltinRule_ more than once on the same key type"
+
+errorMultipleRulesMatch :: TypeRep -> String -> [Maybe String] -> SomeException
+errorMultipleRulesMatch tk k names = errorStructured
+    ("Build system error - key matches " ++ (if null names then "no" else "multiple") ++ " rules")
+    ([("Key type",Just $ show tk)
+    ,("Key value",Just k)
+    ,("Rules matched",Just $ show $ length names)] ++
+    [("Rule " ++ show i, x) | any isJust names, (i, x) <- zipFrom 1 names])
+    (if null names then "Either add a rule that produces the above key, or stop requiring the above key"
+    else "Modify your rules so only one can produce the above key")
+
+errorNoHash :: SomeException
+errorNoHash = errorStructured "Cannot use shakeChange=ChangeModTime with shakeShare" [] ""
+
+errorRuleRecursion :: TypeRep -> String -> SomeException
+-- may involve both rules and oracle, so report as only rules
+errorRuleRecursion tk k = errorStructured
+    "Build system error - recursion detected"
+    [("Key type",Just $ show tk)
+    ,("Key value",Just k)]
+    "Rules may not be recursive"
+
+errorComplexRecursion :: [String] -> SomeException
+errorComplexRecursion ks = errorStructured
+    "Build system error - indirect recursion detected"
+    [("Key value " ++ show i, Just k) | (i, k) <- zipFrom 1 ks]
+    "Rules may not be recursive"
+
+errorNoApply :: TypeRep -> Maybe String -> String -> SomeException
+errorNoApply tk k msg = errorStructured
+    "Build system error - cannot currently introduce a dependency (e.g. calling 'apply')"
+    [("Reason", Just msg)
+    ,("Key type", Just $ show tk)
+    ,("Key value", k)]
+    "Move the call earlier/later"
+
+
+-- Should be in Special, but then we get an import cycle
+specialIsOracleKey :: TypeRep -> Bool
+specialIsOracleKey t = con == "OracleQ"
+    where con = show $ fst $ splitTyConApp t
+
+
+-- | Error representing all expected exceptions thrown by Shake.
+--   Problems when executing rules will be raising using this exception type.
+data ShakeException = ShakeException
+    {shakeExceptionTarget :: String -- ^ The target that was being built when the exception occurred.
+    ,shakeExceptionStack :: [String]  -- ^ A description of the call stack, one entry per line.
+    ,shakeExceptionInner :: SomeException -- ^ The underlying exception that was raised.
+    }
+    deriving Typeable
+
+instance Exception ShakeException
+
+instance Show ShakeException where
+    show ShakeException{..} = unlines $
+        "Error when running Shake build system:" :
+        shakeExceptionStack ++
+        [displayException shakeExceptionInner]
diff --git a/src/Development/Shake/Internal/FileInfo.hs b/src/Development/Shake/Internal/FileInfo.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/FileInfo.hs
@@ -0,0 +1,194 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, CPP, ForeignFunctionInterface #-}
+
+module Development.Shake.Internal.FileInfo(
+    noFileHash, isNoFileHash,
+    FileSize, ModTime, FileHash,
+    getFileHash, getFileInfo
+    ) where
+
+#ifndef MIN_VERSION_unix
+#define MIN_VERSION_unix(a,b,c) 0
+#endif
+
+#ifndef MIN_VERSION_time
+#define MIN_VERSION_time(a,b,c) 0
+#endif
+
+
+import Data.Hashable
+import Control.Exception.Extra
+import Development.Shake.Classes
+import Development.Shake.Internal.FileName
+import qualified Data.ByteString.Lazy.Internal as LBS (defaultChunkSize)
+import Data.List.Extra
+import Data.Word
+import Numeric
+import System.IO
+import Foreign
+
+#if defined(PORTABLE)
+import System.IO.Error
+import System.Directory
+import Data.Time
+
+#elif defined(mingw32_HOST_OS)
+import Development.Shake.Internal.Errors
+import Control.Monad
+import qualified Data.ByteString.Char8 as BS
+import Foreign.C.String
+import Data.Char
+
+#else
+
+#if MIN_VERSION_time(1,9,1)
+import Data.Time.Clock
+import Data.Fixed
+#endif
+
+import Development.Shake.Internal.Errors
+import GHC.IO.Exception
+import System.IO.Error
+import System.Posix.Files.ByteString
+#endif
+
+-- A piece of file information, where 0 and 1 are special (see fileInfo* functions)
+newtype FileInfo a = FileInfo Word32
+    deriving (Typeable,Hashable,Binary,Storable,NFData)
+
+noFileHash :: FileHash
+noFileHash = FileInfo 1   -- Equal to nothing
+
+isNoFileHash :: FileHash -> Bool
+isNoFileHash (FileInfo i) = i == 1
+
+fileInfo :: Word32 -> FileInfo a
+fileInfo a = FileInfo $ if a > maxBound - 2 then a else a + 2
+
+instance Show (FileInfo a) where
+    show (FileInfo x)
+        | x == 0 = "EQ"
+        | x == 1 = "NEQ"
+        | otherwise = "0x" ++ upper (showHex (x-2) "")
+
+instance Eq (FileInfo a) where
+    FileInfo a == FileInfo b
+        | a == 0 || b == 0 = True
+        | a == 1 || b == 1 = False
+        | otherwise = a == b
+
+data FileInfoHash; type FileHash = FileInfo FileInfoHash
+data FileInfoMod ; type ModTime  = FileInfo FileInfoMod
+data FileInfoSize; type FileSize = FileInfo FileInfoSize
+
+
+getFileHash :: FileName -> IO FileHash
+getFileHash x = withFile (fileNameToString x) ReadMode $ \h ->
+    allocaBytes LBS.defaultChunkSize $ \ptr ->
+        go h ptr (hash ())
+    where
+        go h ptr salt = do
+            n <- hGetBufSome h ptr LBS.defaultChunkSize
+            if n == 0 then
+                pure $! fileInfo $ fromIntegral salt
+            else
+                go h ptr =<< hashPtrWithSalt ptr n salt
+
+
+
+-- If the result isn't strict then we are referencing a much bigger structure,
+-- and it causes a space leak I don't really understand on Linux when running
+-- the 'tar' test, followed by the 'benchmark' test.
+-- See this blog post: https://neilmitchell.blogspot.co.uk/2015/09/three-space-leaks.html
+result :: Word32 -> Word32 -> IO (Maybe (ModTime, FileSize))
+result x y = do
+    x <- evaluate $ fileInfo x
+    y <- evaluate $ fileInfo y
+    pure $ Just (x, y)
+
+
+-- | True = allow directory, False = disallow
+getFileInfo :: Bool -> FileName -> IO (Maybe (ModTime, FileSize))
+
+#if defined(PORTABLE)
+-- Portable fallback
+getFileInfo allowDir x = handleBool isDoesNotExistError (const $ pure Nothing) $ do
+    let file = fileNameToString x
+    time <- getModificationTime file
+    size <- withFile file ReadMode hFileSize
+    result (extractFileTime time) (fromIntegral size)
+
+extractFileTime :: UTCTime -> Word32
+extractFileTime = floor . fromRational . toRational . utctDayTime
+
+
+#elif defined(mingw32_HOST_OS)
+-- Directly against the Win32 API, twice as fast as the portable version
+getFileInfo allowDir x = BS.useAsCString (fileNameToByteString x) $ \file ->
+    alloca_WIN32_FILE_ATTRIBUTE_DATA $ \fad -> do
+        res <- c_GetFileAttributesExA file 0 fad
+        let peek = do
+                code <- peekFileAttributes fad
+                if not allowDir && testBit code 4 then
+                    throwIO $ errorDirectoryNotFile $ fileNameToString x
+                 else
+                    join $ liftM2 result (peekLastWriteTimeLow fad) (peekFileSizeLow fad)
+        if res then
+            peek
+         else if BS.any (>= chr 0x80) (fileNameToByteString x) then withCWString (fileNameToString x) $ \file -> do
+            res <- c_GetFileAttributesExW file 0 fad
+            if res then peek else pure Nothing
+         else
+            pure Nothing
+
+#ifdef x86_64_HOST_ARCH
+#define CALLCONV ccall
+#else
+#define CALLCONV stdcall
+#endif
+
+foreign import CALLCONV unsafe "Windows.h GetFileAttributesExA" c_GetFileAttributesExA :: CString  -> Int32 -> Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO Bool
+foreign import CALLCONV unsafe "Windows.h GetFileAttributesExW" c_GetFileAttributesExW :: CWString -> Int32 -> Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO Bool
+
+data WIN32_FILE_ATTRIBUTE_DATA
+
+alloca_WIN32_FILE_ATTRIBUTE_DATA :: (Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO a) -> IO a
+alloca_WIN32_FILE_ATTRIBUTE_DATA act = allocaBytes size_WIN32_FILE_ATTRIBUTE_DATA act
+    where size_WIN32_FILE_ATTRIBUTE_DATA = 36
+
+peekFileAttributes :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO Word32
+peekFileAttributes p = peekByteOff p index_WIN32_FILE_ATTRIBUTE_DATA_dwFileAttributes
+    where index_WIN32_FILE_ATTRIBUTE_DATA_dwFileAttributes = 0
+
+peekLastWriteTimeLow :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO Word32
+peekLastWriteTimeLow p = peekByteOff p index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwLowDateTime
+    where index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwLowDateTime = 20
+
+peekFileSizeLow :: Ptr WIN32_FILE_ATTRIBUTE_DATA -> IO Word32
+peekFileSizeLow p = peekByteOff p index_WIN32_FILE_ATTRIBUTE_DATA_nFileSizeLow
+    where index_WIN32_FILE_ATTRIBUTE_DATA_nFileSizeLow = 32
+
+
+#else
+-- Unix version
+getFileInfo allowDir x = handleBool isDoesNotExistError' (const $ pure Nothing) $ do
+    s <- getFileStatus $ fileNameToByteString x
+    if not allowDir && isDirectory s then
+        throwM $ errorDirectoryNotFile $ fileNameToString x
+     else
+        result (extractFileTime s) (fromIntegral $ fileSize s)
+    where
+        isDoesNotExistError' e =
+            isDoesNotExistError e || ioeGetErrorType e == InappropriateType
+
+extractFileTime :: FileStatus -> Word32
+#if MIN_VERSION_unix(2,6,0)
+#if MIN_VERSION_time(1,9,1)
+extractFileTime = fromInteger . (\(MkFixed x) -> x) . nominalDiffTimeToSeconds . modificationTimeHiRes
+#else
+extractFileTime x = ceiling $ modificationTimeHiRes x * 1e4
+#endif
+#else
+extractFileTime x = fromIntegral $ fromEnum $ modificationTime x
+#endif
+
+#endif
diff --git a/src/Development/Shake/Internal/FileName.hs b/src/Development/Shake/Internal/FileName.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/FileName.hs
@@ -0,0 +1,79 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances #-}
+
+module Development.Shake.Internal.FileName(
+    FileName,
+    fileNameFromString, fileNameFromByteString,
+    fileNameToString, fileNameToByteString,
+    filepathNormalise
+    ) where
+
+import qualified Data.ByteString.Char8 as BS
+import qualified Data.ByteString.UTF8 as UTF8
+import Development.Shake.Classes
+import qualified System.FilePath as Native
+import General.Binary
+import System.Info.Extra
+import Data.List
+
+
+---------------------------------------------------------------------
+-- FileName newtype
+
+-- | UTF8 ByteString
+newtype FileName = FileName BS.ByteString
+    deriving (Hashable, Binary, BinaryEx, Eq, NFData)
+
+instance Show FileName where
+    show = fileNameToString
+
+instance BinaryEx [FileName] where
+    putEx = putEx . map (\(FileName x) -> x)
+    getEx = map FileName . getEx
+
+fileNameToString :: FileName -> FilePath
+fileNameToString = UTF8.toString . fileNameToByteString
+
+fileNameToByteString :: FileName -> BS.ByteString
+fileNameToByteString (FileName x) = x
+
+fileNameFromString :: FilePath -> FileName
+fileNameFromString = fileNameFromByteString . UTF8.fromString
+
+fileNameFromByteString :: BS.ByteString -> FileName
+fileNameFromByteString = FileName . filepathNormalise
+
+
+---------------------------------------------------------------------
+-- NORMALISATION
+
+-- | Equivalent to @toStandard . normaliseEx@ from "Development.Shake.FilePath".
+filepathNormalise :: BS.ByteString -> BS.ByteString
+filepathNormalise xs
+    | isWindows, Just (a,xs) <- BS.uncons xs, sep a, Just (b,_) <- BS.uncons xs, sep b = '/' `BS.cons` f xs
+    | otherwise = f xs
+    where
+        sep = Native.isPathSeparator
+        f o = deslash o $ BS.concat $ (slash:) $ intersperse slash $ reverse $ (BS.empty:) $ g 0 $ reverse $ split o
+
+        deslash o x
+            | x == slash = case (pre,pos) of
+                (True,True) -> slash
+                (True,False) -> BS.pack "/."
+                (False,True) -> BS.pack "./"
+                (False,False) -> dot
+            | otherwise = (if pre then id else BS.tail) $ (if pos then id else BS.init) x
+            where pre = not (BS.null o) && sep (BS.head o)
+                  pos = not (BS.null o) && sep (BS.last o)
+
+        g i [] = replicate i dotDot
+        g i (x:xs) | BS.null x = g i xs
+        g i (x:xs) | x == dotDot = g (i+1) xs
+        g i (x:xs) | x == dot = g i xs
+        g 0 (x:xs) = x : g 0 xs
+        g i (_:xs) = g (i-1) xs -- equivalent to eliminating ../x
+
+        split = BS.splitWith sep
+
+dotDot = BS.pack ".."
+dot = BS.singleton '.'
+slash = BS.singleton '/'
diff --git a/src/Development/Shake/Internal/FilePattern.hs b/src/Development/Shake/Internal/FilePattern.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/FilePattern.hs
@@ -0,0 +1,338 @@
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE PatternGuards, ViewPatterns, TupleSections #-}
+
+module Development.Shake.Internal.FilePattern(
+    -- * Primitive API, as exposed
+    FilePattern, (?==), (<//>),
+    -- * General API, used by other people.
+    filePattern,
+    -- * Optimisation opportunities
+    simple, (?==*),
+    -- * Multipattern file rules
+    compatible, extract, substitute,
+    -- * Accelerated searching
+    Walk(..), walk,
+    -- * Testing only
+    internalTest, isRelativePath, isRelativePattern
+    ) where
+
+import Development.Shake.Internal.Errors
+import System.FilePath(isPathSeparator)
+import Data.List.Extra
+import Control.Monad
+import Data.Char
+import Data.Maybe
+import System.Info.Extra
+
+
+-- | A type synonym for file patterns, containing @\/\/@ and @*@. For the syntax
+--   and semantics of 'FilePattern' see '?=='.
+--
+--   Most 'normaliseEx'd 'FilePath' values are suitable as 'FilePattern' values which match
+--   only that specific file. On Windows @\\@ is treated as equivalent to @\/@.
+--
+--   You can write 'FilePattern' values as a literal string, or build them
+--   up using the operators 'Development.Shake.FilePath.<.>', 'Development.Shake.FilePath.</>'
+--   and 'Development.Shake.<//>'. However, beware that:
+--
+-- * On Windows, use 'Development.Shake.FilePath.<.>' from "Development.Shake.FilePath" instead of from
+--   "System.FilePath" - otherwise @\"\/\/*\" \<.\> exe@ results in @\"\/\/*\\\\.exe\"@.
+--
+-- * If the second argument of 'Development.Shake.FilePath.</>' has a leading path separator (namely @\/@)
+--   then the second argument will be returned.
+type FilePattern = String
+
+infixr 5 <//>
+
+-- | Join two 'FilePattern' values by inserting two @\/@ characters between them.
+--   Will first remove any trailing path separators on the first argument, and any leading
+--   separators on the second.
+--
+-- > "dir" <//> "*" == "dir//*"
+(<//>) :: FilePattern -> FilePattern -> FilePattern
+a <//> b = dropWhileEnd isPathSeparator a ++ "//" ++ dropWhile isPathSeparator b
+
+
+---------------------------------------------------------------------
+-- PATTERNS
+
+data Pat = Lit String -- ^ foo
+         | Star   -- ^ /*/
+         | Skip -- ^ //
+         | Skip1 -- ^ //, but must be at least 1 element
+         | Stars String [String] String -- ^ *foo*, prefix (fixed), infix floaters, suffix
+                                        -- e.g. *foo*bar = Stars "" ["foo"] "bar"
+            deriving (Show,Eq,Ord)
+
+fromLit :: Pat -> Maybe String
+fromLit (Lit x) = Just x
+fromLit _ = Nothing
+
+
+data Lexeme = Str String | Slash | SlashSlash
+
+lexer :: FilePattern -> [Lexeme]
+lexer "" = []
+lexer (x1:x2:xs) | isPathSeparator x1, isPathSeparator x2 = SlashSlash : lexer xs
+lexer (x1:xs) | isPathSeparator x1 = Slash : lexer xs
+lexer xs = Str a : lexer b
+    where (a,b) = break isPathSeparator xs
+
+
+-- | Parse a FilePattern. All optimisations I can think of are invalid because they change the extracted expressions.
+parse :: FilePattern -> [Pat]
+parse = f False True . lexer
+    where
+        -- str = I have ever seen a Str go past (equivalent to "can I be satisfied by no paths")
+        -- slash = I am either at the start, or my previous character was Slash
+        f str slash = \case
+            [] -> [Lit "" | slash]
+            Str "**":xs -> Skip : f True False xs
+            Str x:xs -> parseLit x : f True False xs
+            SlashSlash:Slash:xs | not str -> Skip1 : f str True xs
+            SlashSlash:xs -> Skip : f str False xs
+            Slash:xs -> [Lit "" | not str] ++ f str True xs
+
+
+parseLit :: String -> Pat
+parseLit "*" = Star
+parseLit x = case split (== '*') x of
+    [x] -> Lit x
+    pre:xs | Just (mid,post) <- unsnoc xs -> Stars pre mid post
+    _ -> Lit ""
+
+
+internalTest :: IO ()
+internalTest = do
+    let x # y =
+            let p = parse x
+            in when (p /= y) $ fail $ show ("FilePattern.internalTest",x,p,y)
+    "" # [Lit ""]
+    "x" # [Lit "x"]
+    "/" # [Lit "",Lit ""]
+    "x/" # [Lit "x",Lit ""]
+    "/x" # [Lit "",Lit "x"]
+    "x/y" # [Lit "x",Lit "y"]
+    "//" # [Skip]
+    "**" # [Skip]
+    "//x" # [Skip, Lit "x"]
+    "**/x" # [Skip, Lit "x"]
+    "x//" # [Lit "x", Skip]
+    "x/**" # [Lit "x", Skip]
+    "x//y" # [Lit "x",Skip, Lit "y"]
+    "x/**/y" # [Lit "x",Skip, Lit "y"]
+    "///" # [Skip1, Lit ""]
+    "**/**" # [Skip,Skip]
+    "**/**/" # [Skip, Skip, Lit ""]
+    "///x" # [Skip1, Lit "x"]
+    "**/x" # [Skip, Lit "x"]
+    "x///" # [Lit "x", Skip, Lit ""]
+    "x/**/" # [Lit "x", Skip, Lit ""]
+    "x///y" # [Lit "x",Skip, Lit "y"]
+    "x/**/y" # [Lit "x",Skip, Lit "y"]
+    "////" # [Skip, Skip]
+    "**/**/**" # [Skip, Skip, Skip]
+    "////x" # [Skip, Skip, Lit "x"]
+    "x////" # [Lit "x", Skip, Skip]
+    "x////y" # [Lit "x",Skip, Skip, Lit "y"]
+    "**//x" # [Skip, Skip, Lit "x"]
+
+
+-- | Optimisations that may change the matched expressions
+optimise :: [Pat] -> [Pat]
+optimise (Skip:Skip:xs) = optimise $ Skip:xs
+optimise (Skip:Star:xs) = optimise $ Skip1:xs
+optimise (Star:Skip:xs) = optimise $ Skip1:xs
+optimise (x:xs) = x : optimise xs
+optimise [] =[]
+
+
+-- | A 'FilePattern' that will only match 'isRelativePath' values.
+isRelativePattern :: FilePattern -> Bool
+isRelativePattern ('*':'*':xs)
+    | [] <- xs = True
+    | x:_ <- xs, isPathSeparator x = True
+isRelativePattern _ = False
+
+-- | A non-absolute 'FilePath'.
+isRelativePath :: FilePath -> Bool
+isRelativePath (x:_) | isPathSeparator x = False
+isRelativePath (x:':':_) | isWindows, isAlpha x = False
+isRelativePath _ = True
+
+
+-- | Given a pattern, and a list of path components, return a list of all matches
+--   (for each wildcard in order, what the wildcard matched).
+match :: [Pat] -> [String] -> [[String]]
+match (Skip:xs) (y:ys) = map ("":) (match xs (y:ys)) ++ match (Skip1:xs) (y:ys)
+match (Skip1:xs) (y:ys) = [(y++"/"++r):rs | r:rs <- match (Skip:xs) ys]
+match (Skip:xs) [] = map ("":) $ match xs []
+match (Star:xs) (y:ys) = map (y:) $ match xs ys
+match (Lit x:xs) (y:ys) = concat $ [match xs ys | x == y] ++ [match xs (y:ys) | x == "."]
+match (x@Stars{}:xs) (y:ys) | Just rs <- matchStars x y = map (rs ++) $ match xs ys
+match [] [] = [[]]
+match _ _ = []
+
+
+matchOne :: Pat -> String -> Bool
+matchOne (Lit x) y = x == y
+matchOne x@Stars{} y = isJust $ matchStars x y
+matchOne Star _ = True
+matchOne p _ = throwImpure $ errorInternal $ "unreachablePattern, matchOne " ++ show p
+
+
+-- Only return the first (all patterns left-most) valid star matching
+matchStars :: Pat -> String -> Maybe [String]
+matchStars (Stars pre mid post) x = do
+    x <- stripPrefix pre x
+    x <- if null post then Just x else stripSuffix post x
+    stripInfixes mid x
+    where
+        stripInfixes [] x = Just [x]
+        stripInfixes (m:ms) x = do
+            (a,x) <- stripInfix m x
+            (a:) <$> stripInfixes ms x
+matchStars p _ = throwImpure $ errorInternal $ "unreachablePattern, matchStars " ++ show p
+
+-- | Match a 'FilePattern' against a 'FilePath', There are three special forms:
+--
+-- * @*@ matches an entire path component, excluding any separators.
+--
+-- * @\/\/@ matches an arbitrary number of path components, including absolute path
+--   prefixes.
+--
+-- * @**@ as a path component matches an arbitrary number of path components, but not
+--   absolute path prefixes.
+--   Currently considered experimental.
+--
+--   Some examples:
+--
+-- * @test.c@ matches @test.c@ and nothing else.
+--
+-- * @*.c@ matches all @.c@ files in the current directory, so @file.c@ matches,
+--   but @file.h@ and @dir\/file.c@ don't.
+--
+-- * @\/\/*.c@ matches all @.c@ files anywhere on the filesystem,
+--   so @file.c@, @dir\/file.c@, @dir1\/dir2\/file.c@ and @\/path\/to\/file.c@ all match,
+--   but @file.h@ and @dir\/file.h@ don't.
+--
+-- * @dir\/*\/*@ matches all files one level below @dir@, so @dir\/one\/file.c@ and
+--   @dir\/two\/file.h@ match, but @file.c@, @one\/dir\/file.c@, @dir\/file.h@
+--   and @dir\/one\/two\/file.c@ don't.
+--
+--   Patterns with constructs such as @foo\/..\/bar@ will never match
+--   normalised 'FilePath' values, so are unlikely to be correct.
+(?==) :: FilePattern -> FilePath -> Bool
+(?==) p = case optimise $ parse p of
+    [x] | x == Skip || x == Skip1 -> if rp then isRelativePath else const True
+    p -> let f = not . null . match p . split isPathSeparator
+         in if rp then (\x -> isRelativePath x && f x) else f
+    where rp = isRelativePattern p
+
+(?==*) :: [FilePattern] -> FilePath -> Bool
+(?==*) ps = \x -> any ($ x) vs
+    where vs = map (?==) ps
+
+-- | Like '?==', but returns 'Nothing' on if there is no match, otherwise 'Just' with the list
+--   of fragments matching each wildcard. For example:
+--
+-- @
+-- 'filePattern' \"**\/*.c\" \"test.txt\" == Nothing
+-- 'filePattern' \"**\/*.c\" \"foo.c\" == Just [\"",\"foo\"]
+-- 'filePattern' \"**\/*.c\" \"bar\/baz\/foo.c\" == Just [\"bar\/baz/\",\"foo\"]
+-- @
+--
+--   Note that the @**@ will often contain a trailing @\/@, and even on Windows any
+--   @\\@ separators will be replaced by @\/@.
+filePattern :: FilePattern -> FilePath -> Maybe [String]
+filePattern p = \x -> if eq x then Just $ ex x else Nothing
+    where eq = (?==) p
+          ex = extract p
+
+---------------------------------------------------------------------
+-- MULTIPATTERN COMPATIBLE SUBSTITUTIONS
+
+specials :: FilePattern -> [Pat]
+specials = concatMap f . parse
+    where
+        f Lit{} = []
+        f Star = [Star]
+        f Skip = [Skip]
+        f Skip1 = [Skip]
+        f (Stars _ xs _) = replicate (length xs + 1) Star
+
+-- | Is the pattern free from any * and //.
+simple :: FilePattern -> Bool
+simple = null . specials
+
+-- | Do they have the same * and // counts in the same order
+compatible :: [FilePattern] -> Bool
+compatible [] = True
+compatible (x:xs) = all ((==) (specials x) . specials) xs
+
+-- | Extract the items that match the wildcards. The pair must match with '?=='.
+extract :: FilePattern -> FilePath -> [String]
+extract p = let pat = parse p in \x ->
+    case match pat (split isPathSeparator x) of
+        [] | p ?== x -> throwImpure $ errorInternal $ "extract with " ++ show p ++ " and " ++ show x
+           | otherwise -> error $ "Pattern " ++ show p ++ " does not match " ++ x ++ ", when trying to extract the FilePattern matches"
+        ms:_ -> ms
+
+
+-- | Given the result of 'extract', substitute it back in to a 'compatible' pattern.
+--
+-- > p '?==' x ==> substitute (extract p x) p == x
+substitute :: [String] -> FilePattern -> FilePath
+substitute oms oxs = intercalate "/" $ concat $ snd $ mapAccumL f oms (parse oxs)
+    where
+        f ms (Lit x) = (ms, [x])
+        f (m:ms) Star = (ms, [m])
+        f (m:ms) Skip = (ms, split m)
+        f (m:ms) Skip1 = (ms, split m)
+        f ms (Stars pre mid post) = (ms2, [concat $ pre : zipWith (++) ms1 (mid++[post])])
+            where (ms1,ms2) = splitAt (length mid + 1) ms
+        f _ _ = error $ "Substitution failed into pattern " ++ show oxs ++ " with " ++ show (length oms) ++ " matches, namely " ++ show oms
+
+        split = linesBy (== '/')
+
+
+---------------------------------------------------------------------
+-- EFFICIENT PATH WALKING
+
+-- | Given a list of files, return a list of things I can match in this directory
+--   plus a list of subdirectories and walks that apply to them.
+--   Use WalkTo when the list can be predicted in advance
+data Walk = Walk ([String] -> ([String],[(String,Walk)]))
+          | WalkTo            ([String],[(String,Walk)])
+
+walk :: [FilePattern] -> (Bool, Walk)
+walk ps = (any (\p -> isEmpty p || not (null $ match p [""])) ps2, f ps2)
+    where
+        ps2 = map (filter (/= Lit ".") . optimise . parse) ps
+
+        f (nubOrd -> ps)
+            | Just fin <- mapM fromLit fin
+            , Just nxt <- mapM (\(a,b) -> (,f b) <$> fromLit a) nxt
+            = WalkTo (fin, nxt)
+            | otherwise = Walk $ \xs ->
+                (if finStar then xs else filter (\x -> any (`matchOne` x) fin) xs
+                ,[(x, f ys) | x <- xs, let ys = concat [b | (a,b) <- nxt, matchOne a x], not $ null ys])
+            where
+                finStar = Star `elem` fin
+                fin = nubOrd $ mapMaybe final ps
+                nxt = groupSort $ concatMap next ps
+
+
+next :: [Pat] -> [(Pat, [Pat])]
+next (Skip1:xs) = [(Star,Skip:xs)]
+next (Skip:xs) = (Star,Skip:xs) : next xs
+next (x:xs) = [(x,xs) | not $ null xs]
+next [] = []
+
+final :: [Pat] -> Maybe Pat
+final (Skip:xs) = if isEmpty xs then Just Star else final xs
+final (Skip1:xs) = if isEmpty xs then Just Star else Nothing
+final (x:xs) = if isEmpty xs then Just x else Nothing
+final [] = Nothing
+
+isEmpty = all (== Skip)
diff --git a/src/Development/Shake/Internal/History/Bloom.hs b/src/Development/Shake/Internal/History/Bloom.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/History/Bloom.hs
@@ -0,0 +1,53 @@
+{-# LANGUAGE ViewPatterns #-}
+
+-- | The endpoints on the cloud server
+module Development.Shake.Internal.History.Bloom(
+    Bloom, bloomTest, bloomCreate
+    ) where
+
+import Data.Word
+import Data.Bits
+import Data.Hashable
+import Data.Semigroup
+import Foreign.Storable
+import Foreign.Ptr
+import Prelude
+
+
+-- | Given an Int hash we store
+data Bloom a = Bloom
+    {-# UNPACK #-} !Word64
+    {-# UNPACK #-} !Word64
+    {-# UNPACK #-} !Word64
+    {-# UNPACK #-} !Word64
+    deriving (Eq,Show)
+
+instance Storable (Bloom a) where
+    sizeOf _ = 4 * sizeOf (0 :: Word64)
+    alignment _ = alignment (0 :: Word64)
+    peek (castPtr -> ptr) = Bloom <$> peekElemOff ptr 0 <*> peekElemOff ptr 1 <*> peekElemOff ptr 2 <*> peekElemOff ptr 3
+    poke (castPtr -> ptr) (Bloom x1 x2 x3 x4) = do
+        pokeElemOff ptr 0 x1
+        pokeElemOff ptr 1 x2
+        pokeElemOff ptr 2 x3
+        pokeElemOff ptr 3 x4
+
+instance Semigroup (Bloom a) where
+    Bloom x1 x2 x3 x4 <> Bloom y1 y2 y3 y4 =
+        Bloom (x1 .|. y1) (x2 .|. y2) (x3 .|. y3) (x4 .|. y4)
+
+instance Monoid (Bloom a) where
+    mempty = Bloom 0 0 0 0
+    mappend = (<>)
+
+-- Should the cloud need to know about Key's? It only needs to do Eq on them...
+-- If you Key has a smart Eq your build tree might be more diverse
+-- Have the Id resolved in Server.
+
+bloomTest :: Hashable a => Bloom a -> a -> Bool
+bloomTest bloom x = bloomCreate x <> bloom == bloom
+
+bloomCreate :: Hashable a => a -> Bloom a
+bloomCreate (fromIntegral . hash -> x) =
+    Bloom (f 1) (f 2) (f 3) (f 4)
+    where f i = x `xor` rotate x i
diff --git a/src/Development/Shake/Internal/History/Cloud.hs b/src/Development/Shake/Internal/History/Cloud.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/History/Cloud.hs
@@ -0,0 +1,79 @@
+
+-- | The endpoints on the server
+module Development.Shake.Internal.History.Cloud(
+    Cloud, newCloud, addCloud, lookupCloud
+    ) where
+
+import Development.Shake.Internal.Value
+import Development.Shake.Internal.Core.Database
+import Development.Shake.Internal.History.Types
+import Development.Shake.Internal.History.Network
+import Development.Shake.Internal.History.Server
+import Development.Shake.Internal.History.Bloom
+import Control.Concurrent.Extra
+import System.Time.Extra
+import Control.Monad
+import Control.Monad.IO.Class
+import Control.Monad.Trans.Maybe
+import Control.Monad.Trans.Class
+import General.Fence
+import qualified Data.HashMap.Strict as Map
+import Data.Typeable
+import Data.Either.Extra
+import General.Binary
+import General.Extra
+import General.Wait
+
+
+type Initial = Map.HashMap Key (Ver, [Key], Bloom [BS_Identity])
+
+data Cloud = Cloud Server (Locked () -> IO ()) (Fence Locked Initial)
+
+
+newLaterFence :: (Locked () -> IO ()) -> Seconds -> a -> IO a -> IO (Fence Locked a)
+newLaterFence relock maxTime def act = do
+    fence <- newFence
+    forkFinally (timeout maxTime act) $ \res -> relock $ signalFence fence $ case res of
+        Right (Just v) -> v
+        _ -> def
+    pure fence
+
+laterFence :: MonadIO m => Fence m a -> Wait m a
+laterFence fence = do
+    res <- liftIO $ testFence fence
+    case res of
+        Just v -> pure v
+        Nothing -> Later $ waitFence fence
+
+
+newCloud :: (Locked () -> IO ()) -> Map.HashMap TypeRep (BinaryOp Key) -> Ver -> [(TypeRep, Ver)] -> [String] -> Maybe (IO Cloud)
+newCloud relock binop globalVer ruleVer urls = flip fmap (if null urls then Nothing else connect $ last urls) $ \conn -> do
+    conn <- conn
+    server <- newServer conn binop globalVer
+    fence <- newLaterFence relock 10 Map.empty $ do
+        xs <- serverAllKeys server ruleVer
+        pure $ Map.fromList [(k,(v,ds,test)) | (k,v,ds,test) <- xs]
+    pure $ Cloud server relock fence
+
+
+addCloud :: Cloud -> Key -> Ver -> Ver -> [[(Key, BS_Identity)]] -> BS_Store -> [FilePath] -> IO ()
+addCloud (Cloud server _ _) x1 x2 x3 x4 x5 x6 = void $ forkIO $ serverUpload server x1 x2 x3 x4 x5 x6
+
+
+lookupCloud :: Cloud -> (Key -> Wait Locked (Maybe BS_Identity)) -> Key -> Ver -> Ver -> Wait Locked (Maybe (BS_Store, [[Key]], IO ()))
+lookupCloud (Cloud server relock initial) ask key builtinVer userVer = runMaybeT $ do
+    mp <- lift $ laterFence initial
+    Just (ver, deps, bloom)<- pure $ Map.lookup key mp
+    unless (ver == userVer) $ fail ""
+    Right vs <- lift $ firstLeftWaitUnordered (fmap (maybeToEither ()) . ask) deps
+    unless (bloomTest bloom vs) $ fail ""
+    fence <- liftIO $ newLaterFence relock 10 mempty $ serverOneKey server key builtinVer userVer $ zip deps vs
+    tree <- lift $ laterFence fence
+    f [deps] tree
+    where
+        f :: [[Key]] -> BuildTree Key -> MaybeT (Wait Locked) (BS_Store, [[Key]], IO ())
+        f ks (Done store xs) = pure (store, reverse ks, serverDownloadFiles server key xs)
+        f ks (Depend deps trees) = do
+            Right vs <- lift $ firstLeftWaitUnordered (fmap (maybeToEither ()) . ask) deps
+            Just tree<- pure $ lookup vs trees
+            f (deps:ks) tree
diff --git a/src/Development/Shake/Internal/History/Network.hs b/src/Development/Shake/Internal/History/Network.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/History/Network.hs
@@ -0,0 +1,49 @@
+{-# LANGUAGE CPP #-}
+
+-- | The network operations available
+module Development.Shake.Internal.History.Network(
+    Conn, connect, post
+    ) where
+
+#ifdef NETWORK
+import Network.HTTP
+import Network.URI
+import Data.List
+import Data.Maybe
+#endif
+
+import qualified Data.ByteString.Lazy as LBS
+
+
+newtype Conn = Conn String
+
+connect :: String -> Maybe (IO Conn)
+post :: Conn -> String -> LBS.ByteString -> IO LBS.ByteString
+
+
+#ifndef NETWORK
+
+connect _ = Nothing
+post (Conn _) _ _ = fail "impossible to get here"
+
+#else
+
+connect x = Just $ pure $ Conn $ x ++ ['/' | not $ "/" `isSuffixOf` x]
+
+post (Conn prefix) url send = do
+    let request = Request
+            {rqURI = parseURI_ $ prefix ++ url
+            ,rqMethod = POST
+            ,rqHeaders = [Header HdrContentType "application/octet-stream", Header HdrContentLength $ show $ LBS.length send]
+            ,rqBody = send}
+    response <- simpleHTTP request
+    case response of
+        Left e -> fail $ "Network.post, failed: " ++ show e
+        Right v | rspCode v /= (2,0,0) -> fail $ "Network.post, failed: " ++ show (rspCode v)
+                | otherwise -> pure $ rspBody v
+
+
+parseURI_ :: String -> URI
+parseURI_ x = fromMaybe (error $ "Failed to parse URI, " ++ x) $ parseURI x
+
+#endif
diff --git a/src/Development/Shake/Internal/History/Serialise.hs b/src/Development/Shake/Internal/History/Serialise.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/History/Serialise.hs
@@ -0,0 +1,108 @@
+{-# LANGUAGE FlexibleInstances, DeriveTraversable #-}
+
+-- | The endpoints on the cloud server
+module Development.Shake.Internal.History.Serialise(
+    BuildTree(..),
+    WithTypeReps(..), withTypeReps,
+    WithKeys(..), withKeys, withIds, withoutKeys,
+    SendAllKeys(..), RecvAllKeys(..),
+    SendOneKey(..), RecvOneKey(..),
+    SendDownloadFiles(..),
+    SendUpload(..)
+    ) where
+
+import Development.Shake.Internal.History.Bloom
+import General.Extra
+import General.Binary
+import General.Ids
+import Data.List.Extra
+import Development.Shake.Internal.Value
+import Development.Shake.Internal.FileInfo
+import Development.Shake.Internal.History.Types
+import qualified Data.HashMap.Strict as Map
+import Data.Semigroup
+import Data.Typeable
+import Prelude
+
+
+data BuildTree key
+    -- invariant: Entries are sorted
+    = Depend [key] [([BS_Identity], BuildTree key)]
+    | Done BS_Store [(FilePath, FileSize, FileHash)]
+
+instance BinaryEx (BuildTree Int) where
+    getEx = undefined
+    putEx = undefined
+
+instance Eq key => Semigroup (BuildTree key) where
+    Depend ks1 vs1 <> Depend ks2 vs2
+        | ks1 == ks2 = Depend ks1 $ mergeBy undefined vs1 vs2
+        | otherwise = Depend ks2 vs2 -- this shouldn't happen, so give up
+    x@Done{} <> _ = x
+    _ <> y@Done{} = y
+
+instance Eq key => Monoid (BuildTree key) where
+    mempty = Depend [] []
+    mappend = (<>)
+
+
+data WithTypeReps a = WithTypeReps [BS_QTypeRep] a
+
+instance BinaryEx a => BinaryEx (WithTypeReps a) where
+    putEx = undefined
+    getEx = undefined
+
+withTypeReps :: Traversable f => f TypeRep -> WithTypeReps (f Int)
+withTypeReps = undefined
+
+data WithKeys a = WithKeys [BS_Key] a
+
+instance BinaryEx a => BinaryEx (WithKeys a) where
+    putEx = undefined
+    getEx = undefined
+
+withKeys :: Traversable f => f Key -> WithKeys (f Int)
+withKeys = undefined
+
+withIds :: Traversable f => (Id -> m Key) -> f Id -> m (WithKeys (f Int))
+withIds = undefined
+
+withoutKeys :: Map.HashMap TypeRep (BinaryOp Key) -> WithKeys (f Int) -> f Key
+withoutKeys = undefined
+
+data SendAllKeys typ = SendAllKeys Ver [(typ, Ver)]
+    deriving (Functor, Foldable, Traversable)
+
+instance BinaryEx (SendAllKeys Int) where
+    putEx = undefined
+    getEx = undefined
+
+newtype RecvAllKeys key = RecvAllKeys [(key, Ver, [key], Bloom [BS_Identity])]
+
+instance BinaryEx (RecvAllKeys Int) where
+    getEx = undefined
+    putEx = undefined
+
+data SendOneKey key = SendOneKey Ver key Ver Ver [(key, BS_Identity)]
+
+instance BinaryEx (SendOneKey Int) where
+    getEx = undefined
+    putEx = undefined
+
+newtype RecvOneKey key = RecvOneKey (BuildTree key)
+
+instance BinaryEx (RecvOneKey Int) where
+    getEx = undefined
+    putEx = undefined
+
+data SendDownloadFiles key = SendDownloadFiles Ver key Ver Ver [(FilePath, FileSize, FileHash)]
+
+instance BinaryEx (SendDownloadFiles Int) where
+    getEx = undefined
+    putEx = undefined
+
+data SendUpload key = SendUpload Ver key Ver Ver [[(key, BS_Identity)]] BS_Store [(FilePath, FileSize, FileHash)]
+
+instance BinaryEx (SendUpload Int) where
+    getEx = undefined
+    putEx = undefined
diff --git a/src/Development/Shake/Internal/History/Server.hs b/src/Development/Shake/Internal/History/Server.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/History/Server.hs
@@ -0,0 +1,44 @@
+
+-- | The endpoints on the cloud server
+module Development.Shake.Internal.History.Server(
+    Server, BuildTree(..),
+    newServer,
+    serverAllKeys, serverOneKey, serverDownloadFiles,
+    serverUpload
+    ) where
+
+import Development.Shake.Internal.History.Bloom
+import Development.Shake.Internal.History.Serialise
+import Development.Shake.Internal.Value
+import General.Binary
+import General.Extra
+import qualified Data.HashMap.Strict as Map
+import qualified Data.ByteString.Lazy as LBS
+import qualified Data.ByteString as BS
+import Development.Shake.Internal.FileInfo
+import Development.Shake.Internal.History.Types
+import Development.Shake.Internal.History.Network
+import Data.Typeable
+
+
+data Server = Server Conn (Map.HashMap TypeRep (BinaryOp Key)) Ver
+
+newServer :: Conn -> Map.HashMap TypeRep (BinaryOp Key) -> Ver -> IO Server
+newServer a b c = pure $ Server a b c
+
+serverAllKeys :: Server -> [(TypeRep, Ver)] -> IO [(Key, Ver, [Key], Bloom [BS_Identity])]
+serverAllKeys (Server conn key ver) typs = do
+    res <- post conn "allkeys/v1" $ LBS.fromChunks [runBuilder $ putEx $ withTypeReps $ SendAllKeys ver typs]
+    let RecvAllKeys ans = withoutKeys key $ getEx $ BS.concat $ LBS.toChunks res
+    pure ans
+
+serverOneKey :: Server -> Key -> Ver -> Ver -> [(Key, BS_Identity)] -> IO (BuildTree Key)
+serverOneKey _ _ _ _ _ = pure $ Depend [] []
+
+
+serverDownloadFiles :: Server -> Key -> [(FilePath, FileSize, FileHash)] -> IO ()
+serverDownloadFiles _ _ _ = fail "Failed to download the files"
+
+
+serverUpload :: Server -> Key -> Ver -> Ver -> [[(Key, BS_Identity)]] -> BS_Store -> [FilePath] -> IO ()
+serverUpload _ key _ _ _ _ _  = print ("SERVER", "Uploading key", key)
diff --git a/src/Development/Shake/Internal/History/Shared.hs b/src/Development/Shake/Internal/History/Shared.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/History/Shared.hs
@@ -0,0 +1,198 @@
+{-# LANGUAGE RecordWildCards, ScopedTypeVariables, TupleSections #-}
+
+module Development.Shake.Internal.History.Shared(
+    Shared, newShared,
+    addShared, lookupShared,
+    removeShared, listShared,
+    sanityShared
+    ) where
+
+import Control.Exception
+import Development.Shake.Internal.Value
+import Development.Shake.Internal.History.Types
+import Development.Shake.Internal.History.Symlink
+import Development.Shake.Internal.Core.Database
+import Development.Shake.Classes
+import General.Binary
+import General.Extra
+import Data.List
+import Control.Monad.Extra
+import System.Directory.Extra
+import System.FilePath
+import System.IO.Extra
+import Numeric
+import Development.Shake.Internal.FileInfo
+import General.Wait
+import Development.Shake.Internal.FileName
+import Data.Monoid
+import Control.Monad.IO.Class
+import Data.Maybe
+import qualified Data.ByteString as BS
+import Prelude
+
+
+data Shared = Shared
+    {globalVersion :: !Ver
+    ,keyOp :: BinaryOp Key
+    ,sharedRoot :: FilePath
+    ,useSymlink :: Bool
+    }
+
+newShared :: Bool -> BinaryOp Key -> Ver -> FilePath -> IO Shared
+newShared useSymlink keyOp globalVersion sharedRoot = pure Shared{..}
+
+
+data Entry = Entry
+    {entryKey :: Key
+    ,entryGlobalVersion :: !Ver
+    ,entryBuiltinVersion :: !Ver
+    ,entryUserVersion :: !Ver
+    ,entryDepends :: [[(Key, BS_Identity)]]
+    ,entryResult :: BS_Store
+    ,entryFiles :: [(FilePath, FileHash)]
+    } deriving (Show, Eq)
+
+putEntry :: BinaryOp Key -> Entry -> Builder
+putEntry binop Entry{..} =
+    putExStorable entryGlobalVersion <>
+    putExStorable entryBuiltinVersion <>
+    putExStorable entryUserVersion <>
+    putExN (putOp binop entryKey) <>
+    putExN (putExList $ map (putExList . map putDepend) entryDepends) <>
+    putExN (putExList $ map putFile entryFiles) <>
+    putEx entryResult
+    where
+        putDepend (a,b) = putExN (putOp binop a) <> putEx b
+        putFile (a,b) = putExStorable b <> putEx a
+
+getEntry :: BinaryOp Key -> BS.ByteString -> Entry
+getEntry binop x
+    | (x1, x2, x3, x) <- binarySplit3 x
+    , (x4, x) <- getExN x
+    , (x5, x) <- getExN x
+    , (x6, x7) <- getExN x
+    = Entry
+        {entryGlobalVersion = x1
+        ,entryBuiltinVersion = x2
+        ,entryUserVersion = x3
+        ,entryKey = getOp binop x4
+        ,entryDepends = map (map getDepend . getExList) $ getExList x5
+        ,entryFiles = map getFile $ getExList x6
+        ,entryResult = getEx x7
+        }
+    where
+        getDepend x | (a, b) <- getExN x = (getOp binop a, getEx b)
+        getFile x | (b, a) <- binarySplit x = (getEx a, b)
+
+hexed x = showHex (abs $ hash x) ""
+
+-- | The path under which everything relating to a Key lives
+sharedFileDir :: Shared -> Key -> FilePath
+sharedFileDir shared key = sharedRoot shared </> ".shake.cache" </> hexed key
+
+-- | The list of files containing Entry values, given a result of 'sharedFileDir'
+sharedFileKeys :: FilePath -> IO [FilePath]
+sharedFileKeys dir = do
+    b <- doesDirectoryExist_ $ dir </> "_key"
+    if not b then pure [] else listFiles $ dir </> "_key"
+
+loadSharedEntry :: Shared -> Key -> Ver -> Ver -> IO [IO (Maybe Entry)]
+loadSharedEntry shared@Shared{..} key builtinVersion userVersion =
+    map f <$> sharedFileKeys (sharedFileDir shared key)
+    where
+        f file = do
+            e@Entry{..} <- getEntry keyOp <$> BS.readFile file
+            let valid = entryKey == key && entryGlobalVersion == globalVersion && entryBuiltinVersion == builtinVersion && entryUserVersion == userVersion
+            pure $ if valid then Just e else Nothing
+
+
+-- | Given a way to get the identity, see if you can find a stored cloud version
+lookupShared :: Shared -> (Key -> Wait Locked (Maybe BS_Identity)) -> Key -> Ver -> Ver -> Wait Locked (Maybe (BS_Store, [[Key]], IO ()))
+lookupShared shared ask key builtinVersion userVersion = do
+    ents <- liftIO $ loadSharedEntry shared key builtinVersion userVersion
+    flip firstJustWaitUnordered ents $ \act -> do
+        me <- liftIO act
+        case me of
+            Nothing -> pure Nothing
+            Just Entry{..} -> do
+                -- use Nothing to indicate success, Just () to bail out early on mismatch
+                let result x = if isJust x then Nothing else Just $ (entryResult, map (map fst) entryDepends, ) $ do
+                        let dir = sharedFileDir shared entryKey
+                        forM_ entryFiles $ \(file, hash) ->
+                            copyFileLink (useSymlink shared) (dir </> show hash) file
+                result <$> firstJustM id
+                    [ firstJustWaitUnordered id
+                        [ test <$> ask k | (k, i1) <- kis
+                        , let test = maybe (Just ()) (\i2 -> if i1 == i2 then Nothing else Just ())]
+                    | kis <- entryDepends]
+
+
+saveSharedEntry :: Shared -> Entry -> IO ()
+saveSharedEntry shared entry = do
+    let dir = sharedFileDir shared (entryKey entry)
+    createDirectoryRecursive dir
+    forM_ (entryFiles entry) $ \(file, hash) ->
+        unlessM (doesFileExist_ $ dir </> show hash) $
+            copyFileLink (useSymlink shared) file (dir </> show hash)
+    -- Write key after files to make sure cache is always useable
+    let v = runBuilder $ putEntry (keyOp shared) entry
+    let dirName = dir </> "_key"
+    createDirectoryRecursive dirName
+    -- #757, make sure we write this file atomically
+    (tempFile, cleanUp) <- newTempFileWithin dir
+    (BS.writeFile tempFile v >> renameFile tempFile (dirName </> hexed v)) `onException` cleanUp
+
+
+addShared :: Shared -> Key -> Ver -> Ver -> [[(Key, BS_Identity)]] -> BS_Store -> [FilePath] -> IO ()
+addShared shared entryKey entryBuiltinVersion entryUserVersion entryDepends entryResult files = do
+    files <- mapM (\x -> (x,) <$> getFileHash (fileNameFromString x)) files
+    saveSharedEntry shared Entry{entryFiles = files, entryGlobalVersion = globalVersion shared, ..}
+
+removeShared :: Shared -> (Key -> Bool) -> IO ()
+removeShared Shared{..} test = do
+    dirs <- listDirectories $ sharedRoot </> ".shake.cache"
+    deleted <- forM dirs $ \dir -> do
+        files <- sharedFileKeys dir
+        -- if any key matches, clean them all out
+        b <- flip anyM files $ \file -> handleSynchronous (\e -> putStrLn ("Warning: " ++ show e) >> pure False) $
+            evaluate . test . entryKey . getEntry keyOp =<< BS.readFile file
+        when b $ removePathForcibly dir
+        pure b
+    liftIO $ putStrLn $ "Deleted " ++ show (length (filter id deleted)) ++ " entries"
+
+listShared :: Shared -> IO ()
+listShared Shared{..} = do
+    dirs <- listDirectories $ sharedRoot </> ".shake.cache"
+    forM_ dirs $ \dir -> do
+        putStrLn $ "Directory: " ++ dir
+        keys <- sharedFileKeys dir
+        forM_ keys $ \key ->
+            handleSynchronous (\e -> putStrLn $ "Warning: " ++ show e) $ do
+                Entry{..} <- getEntry keyOp <$> BS.readFile key
+                putStrLn $ "  Key: " ++ show entryKey
+                forM_ entryFiles $ \(file,_) ->
+                    putStrLn $ "    File: " ++ file
+
+sanityShared :: Shared -> IO ()
+sanityShared Shared{..} = do
+    dirs <- listDirectories $ sharedRoot </> ".shake.cache"
+    forM_ dirs $ \dir -> do
+        putStrLn $ "Directory: " ++ dir
+        keys <- sharedFileKeys dir
+        forM_ keys $ \key ->
+            handleSynchronous (\e -> putStrLn $ "Warning: " ++ show e) $ do
+                Entry{..} <- getEntry keyOp <$> BS.readFile key
+                putStrLn $ "  Key: " ++ show entryKey
+                putStrLn $ "  Key file: " ++ key
+                forM_ entryFiles $ \(file,hash) ->
+                    checkFile file dir hash
+    where
+      checkFile filename dir keyHash = do
+          let cachefile = dir </> show keyHash
+          putStrLn $ "    File: " ++ filename
+          putStrLn $ "    Cache file: " ++ cachefile
+          ifM (not <$> doesFileExist_ cachefile)
+              (putStrLn "      Error: cache file does not exist") $
+              ifM ((/= keyHash) <$> getFileHash (fileNameFromString cachefile))
+                  (putStrLn "      Error: cache file hash does not match stored hash")
+                  (putStrLn "      OK")
diff --git a/src/Development/Shake/Internal/History/Symlink.hs b/src/Development/Shake/Internal/History/Symlink.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/History/Symlink.hs
@@ -0,0 +1,55 @@
+{-# LANGUAGE CPP #-}
+
+module Development.Shake.Internal.History.Symlink(
+    copyFileLink,
+    createLinkMaybe
+    ) where
+
+import Control.Monad.Extra
+import General.Extra
+import System.Directory
+import System.FilePath
+
+
+#ifdef mingw32_HOST_OS
+import Foreign.Ptr
+import Foreign.C.String
+#else
+import System.Posix.Files(createLink)
+#endif
+
+createLinkMaybe :: FilePath -> FilePath -> IO (Maybe String)
+
+#ifdef mingw32_HOST_OS
+
+#ifdef x86_64_HOST_ARCH
+#define CALLCONV ccall
+#else
+#define CALLCONV stdcall
+#endif
+
+foreign import CALLCONV unsafe "Windows.h CreateHardLinkW " c_CreateHardLinkW :: CWString -> CWString -> Ptr () -> IO Bool
+
+createLinkMaybe from to = withCWString from $ \cfrom -> withCWString to $ \cto -> do
+    res <- c_CreateHardLinkW cto cfrom nullPtr
+    pure $ if res then Nothing else Just "CreateHardLink failed."
+
+#else
+
+createLinkMaybe from to = handleIO (pure . Just . show) $ createLink from to >> pure Nothing
+
+#endif
+
+
+copyFileLink :: Bool -> FilePath -> FilePath -> IO ()
+copyFileLink useSymlink from to = do
+    createDirectoryRecursive $ takeDirectory to
+    removeFile_ to
+    if not useSymlink then copyFile from to else do
+        b <- createLinkMaybe from to
+        whenJust b $ \_ ->
+            copyFile from to
+        -- making files read only stops them from inadvertently mutating the cache
+        forM_ [from, to] $ \x -> do
+            perm <- getPermissions x
+            setPermissions x perm{writable=False}
diff --git a/src/Development/Shake/Internal/History/Types.hs b/src/Development/Shake/Internal/History/Types.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/History/Types.hs
@@ -0,0 +1,11 @@
+
+module Development.Shake.Internal.History.Types(
+    BS_QTypeRep, BS_Key, BS_Store, BS_Identity
+    ) where
+
+import qualified Data.ByteString as BS
+
+type BS_QTypeRep = BS.ByteString
+type BS_Key = BS.ByteString
+type BS_Store = BS.ByteString
+type BS_Identity = BS.ByteString
diff --git a/src/Development/Shake/Internal/Options.hs b/src/Development/Shake/Internal/Options.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Options.hs
@@ -0,0 +1,342 @@
+{-# LANGUAGE DeriveDataTypeable, PatternGuards #-}
+
+-- | Types exposed to the user
+module Development.Shake.Internal.Options(
+    Progress(..), Verbosity(..), Rebuild(..), Lint(..), Change(..),
+    ShakeOptions(..), shakeOptions,
+    -- Internal stuff
+    shakeRebuildApply, shakeAbbreviationsApply, shakeOptionsFields
+    ) where
+
+import Data.Data
+import Data.List.Extra
+import Data.Tuple.Extra
+import Data.Maybe
+import Data.Dynamic
+import Control.Monad
+import General.Extra
+import System.Time.Extra
+import qualified Data.HashMap.Strict as Map
+import Development.Shake.Internal.FilePattern
+import Development.Shake.Internal.Errors
+import qualified Data.ByteString.Char8 as BS
+import qualified Data.ByteString.UTF8 as UTF8
+import Development.Shake.Internal.CmdOption
+import Data.Semigroup
+import Prelude
+
+
+-- | The current assumptions made by the build system, used by 'shakeRebuild'. These options
+--   allow the end user to specify that any rules run are either to be treated as clean, or as
+--   dirty, regardless of what the build system thinks.
+--
+--   These assumptions only operate on files reached by the current 'Development.Shake.action' commands. Any
+--   other files in the database are left unchanged.
+data Rebuild
+    = RebuildNow
+        -- ^ Assume these files are dirty and require rebuilding.
+        --   for benchmarking rebuild speed and for rebuilding if untracked dependencies have changed.
+        --   This flag is safe, but may cause more rebuilding than necessary.
+    | RebuildNormal
+        -- ^ Useful to reset the rebuild status to how it was before, equivalent to passing no 'Rebuild' flags.
+    | RebuildLater
+        -- ^ /This assumption is unsafe, and may lead to incorrect build results in this run/.
+        --   Assume these files are clean in this run, but test them normally in future runs.
+{-
+    | RebuildNever
+        -- Add to RebuildNow: Useful to undo the results of 'RebuildNever',
+        -- ^ /This assumption is unsafe, and may lead to incorrect build results in this run, and in future runs/.
+        --   Assume and record that these files are clean and do not require rebuilding, provided the file
+        --   has been built before. Useful if you have modified a file in some
+        --   inconsequential way, such as only the comments or whitespace, and wish to avoid a rebuild.
+-}
+      deriving (Eq,Ord,Show,Read,Typeable,Data,Enum,Bounded)
+
+
+-- | Which lint checks to perform, used by 'shakeLint'.
+data Lint
+    = LintBasic
+        -- ^ The most basic form of linting. Checks that the current directory does not change and that results do not change after they
+        --   are first written. Any calls to 'needed' will assert that they do not cause a rule to be rebuilt.
+    | LintFSATrace
+        -- ^ Track which files are accessed by command line programs
+        -- using <https://github.com/jacereda/fsatrace fsatrace>.
+      deriving (Eq,Ord,Show,Read,Typeable,Data,Enum,Bounded)
+
+
+-- | How should you determine if a file has changed, used by 'shakeChange'. The most common values are
+--   'ChangeModtime' (the default, very fast, @touch@ causes files to rebuild) and 'ChangeModtimeAndDigestInput'
+--   (slightly slower, @touch@ and switching @git@ branches does not cause input files to rebuild).
+data Change
+    = ChangeModtime
+        -- ^ Compare equality of modification timestamps, a file has changed if its last modified time changes.
+        --   A @touch@ will force a rebuild. This mode is fast and usually sufficiently accurate, so is the default.
+    | ChangeDigest
+        -- ^ Compare equality of file contents digests, a file has changed if its digest changes.
+        --   A @touch@ will not force a rebuild. Use this mode if modification times on your file system are unreliable.
+    | ChangeModtimeAndDigest
+        -- ^ A file is rebuilt if both its modification time and digest have changed. For efficiency reasons, the modification
+        --   time is checked first, and if that has changed, the digest is checked.
+    | ChangeModtimeAndDigestInput
+        -- ^ Use 'ChangeModtimeAndDigest' for input\/source files and 'ChangeModtime' for output files.
+        --   An input file is one which is a dependency but is not built by Shake as it has no
+        --   matching rule and already exists on the file system.
+    | ChangeModtimeOrDigest
+        -- ^ A file is rebuilt if either its modification time or its digest has changed. A @touch@ will force a rebuild,
+        --   but even if a files modification time is reset afterwards, changes will also cause a rebuild.
+      deriving (Eq,Ord,Show,Read,Typeable,Data,Enum,Bounded)
+
+
+-- | Information about the current state of the build, obtained by either passing a callback function
+--   to 'Development.Shake.shakeProgress' (asynchronous output) or 'Development.Shake.getProgress'
+--   (synchronous output). Typically a build system will pass 'progressDisplay' to 'Development.Shake.shakeProgress',
+--   which will poll this value and produce status messages.
+data Progress = Progress
+-- In retrospect shakeProgress should have been done differently, as a feature you turn on in Rules
+-- but easiest way around that for now is put the Progress type in Options
+
+    {isFailure :: !(Maybe String) -- ^ Starts out 'Nothing', becomes 'Just' a target name if a rule fails.
+    ,countSkipped :: {-# UNPACK #-} !Int -- ^ Number of rules which were required, but were already in a valid state.
+    ,countBuilt :: {-# UNPACK #-} !Int -- ^ Number of rules which were have been built in this run.
+    ,countUnknown :: {-# UNPACK #-} !Int -- ^ Number of rules which have been built previously, but are not yet known to be required.
+    ,countTodo :: {-# UNPACK #-} !Int -- ^ Number of rules which are currently required (ignoring dependencies that do not change), but not built.
+    ,timeSkipped :: {-# UNPACK #-} !Double -- ^ Time spent building 'countSkipped' rules in previous runs.
+    ,timeBuilt :: {-# UNPACK #-} !Double -- ^ Time spent building 'countBuilt' rules.
+    ,timeUnknown :: {-# UNPACK #-} !Double -- ^ Time spent building 'countUnknown' rules in previous runs.
+    ,timeTodo :: {-# UNPACK #-} !(Double,Int) -- ^ Time spent building 'countTodo' rules in previous runs, plus the number which have no known time (have never been built before).
+    }
+    deriving (Eq,Ord,Show,Read,Data,Typeable)
+
+instance Semigroup Progress where
+    a <> b = Progress
+        {isFailure = isFailure a `mplus` isFailure b
+        ,countSkipped = countSkipped a + countSkipped b
+        ,countBuilt = countBuilt a + countBuilt b
+        ,countUnknown = countUnknown a + countUnknown b
+        ,countTodo = countTodo a + countTodo b
+        ,timeSkipped = timeSkipped a + timeSkipped b
+        ,timeBuilt = timeBuilt a + timeBuilt b
+        ,timeUnknown = timeUnknown a + timeUnknown b
+        ,timeTodo = let (a1,a2) = timeTodo a; (b1,b2) = timeTodo b
+                        x1 = a1 + b1; x2 = a2 + b2
+                    in x1 `seq` x2 `seq` (x1,x2)
+        }
+
+instance Monoid Progress where
+    mempty = Progress Nothing 0 0 0 0 0 0 0 (0,0)
+    mappend = (<>)
+
+
+-- | Options to control the execution of Shake, usually specified by overriding fields in
+--   'shakeOptions':
+--
+--   @ 'shakeOptions'{'shakeThreads'=4, 'shakeReport'=[\"report.html\"]} @
+--
+--   The 'Data' instance for this type reports the 'shakeProgress' and 'shakeOutput' fields as having the abstract type 'Hidden',
+--   because 'Data' cannot be defined for functions or 'TypeRep's.
+data ShakeOptions = ShakeOptions
+    {shakeFiles :: FilePath
+        -- ^ Defaults to @.shake@. The directory used for storing Shake metadata files.
+        --   All metadata files will be named @'shakeFiles'\/.shake./file-name/@, for some @/file-name/@.
+        --   If the 'shakeFiles' directory does not exist it will be created.
+        --   If set to @\"\/dev\/null\"@ then no shakeFiles are read or written (even on Windows).
+    ,shakeThreads :: Int
+        -- ^ Defaults to @1@. Maximum number of rules to run in parallel, similar to @make --jobs=/N/@.
+        --   For many build systems, a number equal to or slightly less than the number of physical processors
+        --   works well. Use @0@ to match the detected number of processors (when @0@, 'getShakeOptions' will
+        --   return the number of threads used).
+    ,shakeVersion :: String
+        -- ^ Defaults to @"1"@. The version number of your build rules.
+        --   Change the version number to force a complete rebuild, such as when making
+        --   significant changes to the rules that require a wipe. The version number should be
+        --   set in the source code, and not passed on the command line.
+    ,shakeVerbosity :: Verbosity
+        -- ^ Defaults to 'Info'. What level of messages should be printed out.
+    ,shakeStaunch :: Bool
+        -- ^ Defaults to 'False'. Operate in staunch mode, where building continues even after errors,
+        --   similar to @make --keep-going@.
+    ,shakeReport :: [FilePath]
+        -- ^ Defaults to @[]@. Write a profiling report to a file, showing which rules rebuilt,
+        --   why, and how much time they took. Useful for improving the speed of your build systems.
+        --   If the file extension is @.json@ it will write JSON data; if @.js@ it will write Javascript;
+        --   if @.trace@ it will write trace events (load into @about:\/\/tracing@ in Chrome);
+        --   otherwise it will write HTML.
+    ,shakeLint :: Maybe Lint
+        -- ^ Defaults to 'Nothing'. Perform sanity checks during building, see 'Lint' for details.
+    ,shakeLintInside :: [FilePath]
+        -- ^ Directories in which the files will be tracked by the linter.
+    ,shakeLintIgnore :: [FilePattern]
+        -- ^ File patterns which are ignored from linter tracking, a bit like calling 'Development.Shake.trackAllow' in every rule.
+    ,shakeLintWatch :: [FilePattern]
+        -- ^ File patterns whose modification causes an error. Raises an error even if 'shakeLint' is 'Nothing'.
+    ,shakeCommandOptions :: [CmdOption]
+        -- ^ Defaults to @[]@. Additional options to be passed to all command invocations.
+    ,shakeFlush :: Maybe Seconds
+        -- ^ Defaults to @'Just' 10@. How often to flush Shake metadata files in seconds, or 'Nothing' to never flush explicitly.
+        --   It is possible that on abnormal termination (not Haskell exceptions) any rules that completed in the last
+        --   'shakeFlush' seconds will be lost.
+    ,shakeRebuild :: [(Rebuild, FilePattern)]
+        -- ^ What to rebuild
+    ,shakeAbbreviations :: [(String,String)]
+        -- ^ Defaults to @[]@. A list of substrings that should be abbreviated in status messages, and their corresponding abbreviation.
+        --   Commonly used to replace the long paths (e.g. @.make\/i586-linux-gcc\/output@) with an abbreviation (e.g. @$OUT@).
+    ,shakeStorageLog :: Bool
+        -- ^ Defaults to 'False'. Write a message to @'shakeFiles'\/.shake.storage.log@ whenever a storage event happens which may impact
+        --   on the current stored progress. Examples include database version number changes, database compaction or corrupt files.
+    ,shakeLineBuffering :: Bool
+        -- ^ Defaults to 'True'. Change 'stdout' and 'stderr' to line buffering while running Shake.
+    ,shakeTimings :: Bool
+        -- ^ Defaults to 'False'. Print timing information for each stage at the end.
+    ,shakeRunCommands :: Bool
+        -- ^ Default to 'True'. Should you run command line actions, set to 'False' to skip actions whose output streams and exit code
+        --   are not used. Useful for profiling the non-command portion of the build system.
+    ,shakeChange :: Change
+        -- ^ Default to 'ChangeModtime'. How to check if a file has changed, see 'Change' for details.
+    ,shakeCreationCheck :: Bool
+        -- ^ Default to 'True'. After running a rule to create a file, is it an error if the file does not exist.
+        --   Provided for compatibility with @make@ and @ninja@ (which have ugly file creation semantics).
+    ,shakeLiveFiles :: [FilePath]
+        -- ^ Default to @[]@. After the build system completes, write a list of all files which were /live/ in that run,
+        --   i.e. those which Shake checked were valid or rebuilt. Produces best answers if nothing rebuilds.
+    ,shakeVersionIgnore :: Bool
+        -- ^ Defaults to 'False'. Ignore any differences in 'shakeVersion'.
+    ,shakeColor :: Bool
+        -- ^ Defaults to 'False'. Whether to colorize the output.
+    ,shakeShare :: Maybe FilePath
+        -- ^ Defaults to 'Nothing'. Whether to use and store outputs in a shared directory.
+    ,shakeCloud :: [String]
+        -- ^ Defaults to @[]@. Cloud servers to talk to forming a shared cache.
+    ,shakeSymlink :: Bool
+        -- ^ Defaults to @False@. Use symlinks for 'shakeShare' if they are available.
+        --   If this setting is @True@ (even if symlinks are not available) then files will be
+        --   made read-only to avoid inadvertantly poisoning the shared cache.
+        --   Note the links are actually hard links, not symlinks.
+    ,shakeNeedDirectory :: Bool
+        -- ^ Defaults to @False@. Is depending on a directory an error (default), or it is permitted with
+        --   undefined results. Provided for compatibility with @ninja@.
+    ,shakeAllowRedefineRules :: Bool
+        -- ^ Whether to allow calling addBuiltinRule for the same key more than once
+    ,shakeProgress :: IO Progress -> IO ()
+        -- ^ Defaults to no action. A function called when the build starts, allowing progress to be reported.
+        --   The function is called on a separate thread, and that thread is killed when the build completes.
+        --   For applications that want to display progress messages, 'progressSimple' is often sufficient, but more advanced
+        --   users should look at the 'Progress' data type.
+    ,shakeOutput :: Verbosity -> String -> IO ()
+        -- ^ Defaults to writing using 'putStrLn'. A function called to output messages from Shake, along with the 'Verbosity' at
+        --   which that message should be printed. This function will be called atomically from all other 'shakeOutput' functions.
+        --   The 'Verbosity' will always be greater than or higher than 'shakeVerbosity'.
+    ,shakeTrace :: String -> String -> Bool -> IO ()
+        -- ^ Defaults to doing nothing.
+        --   Called for each call of 'Development.Shake.traced', with the key, the command and 'True' for starting, 'False' for stopping.
+    ,shakeExtra :: Map.HashMap TypeRep Dynamic
+        -- ^ This a map which can be used to store arbitrary extra information that a user may need when writing rules.
+        --   The key of each entry must be the 'dynTypeRep' of the value.
+        --   Insert values using 'addShakeExtra' and retrieve them using 'getShakeExtra'.
+        --   The correct way to use this field is to define a hidden newtype for the key, so that conflicts cannot occur.
+    }
+    deriving Typeable
+
+-- | The default set of 'ShakeOptions'.
+shakeOptions :: ShakeOptions
+shakeOptions = ShakeOptions
+    ".shake" 1 "1" Info False [] Nothing [] [] [] [] (Just 10) [] [] False True False
+    True ChangeModtime True [] False False Nothing [] False False False
+    (const $ pure ())
+    (const $ BS.putStrLn . UTF8.fromString) -- try and output atomically using BS
+    (\_ _ _ -> pure ())
+    Map.empty
+
+fieldsShakeOptions =
+    ["shakeFiles", "shakeThreads", "shakeVersion", "shakeVerbosity", "shakeStaunch", "shakeReport"
+    ,"shakeLint", "shakeLintInside", "shakeLintIgnore", "shakeLintWatch", "shakeCommandOptions"
+    ,"shakeFlush", "shakeRebuild", "shakeAbbreviations", "shakeStorageLog"
+    ,"shakeLineBuffering", "shakeTimings", "shakeRunCommands", "shakeChange", "shakeCreationCheck"
+    ,"shakeLiveFiles", "shakeVersionIgnore", "shakeColor", "shakeShare", "shakeCloud", "shakeSymlink"
+    ,"shakeNeedDirectory", "shakeCanRedefineRules"
+    ,"shakeProgress", "shakeOutput", "shakeTrace", "shakeExtra"]
+tyShakeOptions = mkDataType "Development.Shake.Types.ShakeOptions" [conShakeOptions]
+conShakeOptions = mkConstr tyShakeOptions "ShakeOptions" fieldsShakeOptions Prefix
+unhide x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 y1 y2 y3 y4 =
+  ShakeOptions x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28
+        (fromHidden y1) (fromHidden y2) (fromHidden y3) (fromHidden y4)
+
+instance Data ShakeOptions where
+    gfoldl k z (ShakeOptions x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 y1 y2 y3 y4) =
+        z unhide `k` x1 `k` x2 `k` x3 `k` x4 `k` x5 `k` x6 `k` x7 `k` x8 `k` x9 `k` x10 `k` x11 `k`
+        x12 `k` x13 `k` x14 `k` x15 `k` x16 `k` x17 `k` x18 `k` x19 `k` x20 `k` x21 `k` x22 `k` x23 `k` x24 `k` x25 `k` x26 `k` x27 `k` x28 `k`
+        Hidden y1 `k` Hidden y2 `k` Hidden y3 `k` Hidden y4
+    gunfold k z _ = k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ z unhide
+    toConstr ShakeOptions{} = conShakeOptions
+    dataTypeOf _ = tyShakeOptions
+
+shakeOptionsFields :: ShakeOptions -> [(String, String)]
+shakeOptionsFields = zipExact fieldsShakeOptions . gmapQ f
+    where
+        f x | Just x <- cast x = show (x :: Int)
+            | Just x <- cast x = show (x :: FilePath)
+            | Just x <- cast x = show (x :: Verbosity)
+            | Just x <- cast x = show (x :: Change)
+            | Just x <- cast x = show (x :: Bool)
+            | Just x <- cast x = show (x :: [FilePath])
+            | Just x <- cast x = show (x :: [(Rebuild, FilePattern)])
+            | Just x <- cast x = show (x :: Maybe Lint)
+            | Just x <- cast x = show (x :: Maybe Double)
+            | Just x <- cast x = show (x :: Maybe String)
+            | Just x <- cast x = show (x :: [(String,String)])
+            | Just x <- cast x = show (x :: Hidden (IO Progress -> IO ()))
+            | Just x <- cast x = show (x :: Hidden (Verbosity -> String -> IO ()))
+            | Just x <- cast x = show (x :: Hidden (Map.HashMap TypeRep Dynamic))
+            | Just x <- cast x = show (x :: Hidden (String -> String -> Bool -> IO ()))
+            | Just x <- cast x = show (x :: [CmdOption])
+            | otherwise = throwImpure $ errorInternal $ "Error while showing ShakeOptions, missing alternative for " ++ show (typeOf x)
+
+instance Show ShakeOptions where
+    show x = "ShakeOptions {" ++ intercalate ", " (map (\(a,b) -> a ++ " = " ++ b) $ shakeOptionsFields x) ++ "}"
+
+
+-- | Internal type, copied from Hide in Uniplate
+newtype Hidden a = Hidden {fromHidden :: a}
+    deriving Typeable
+
+instance Show (Hidden a) where show _ = "<hidden>"
+
+instance Typeable a => Data (Hidden a) where
+    gfoldl _ z = z
+    gunfold _ _ _ = error "Development.Shake.Types.ShakeProgress: gunfold not implemented - data type has no constructors"
+    toConstr _ = error "Development.Shake.Types.ShakeProgress: toConstr not implemented - data type has no constructors"
+    dataTypeOf _ = tyHidden
+
+tyHidden = mkDataType "Development.Shake.Types.Hidden" []
+
+
+-- | The verbosity data type, used by 'shakeVerbosity'.
+data Verbosity
+    = Silent  -- ^ Don't print any messages.
+    | Error     -- ^ Only print error messages.
+    | Warn    -- ^ Print errors and warnings.
+    | Info    -- ^ Print errors, warnings and @# /command-name/ (for /file-name/)@ when running a 'Development.Shake.traced' command.
+    | Verbose -- ^ Print errors, warnings, full command lines when running a 'Development.Shake.command' or
+              --   'Development.Shake.cmd' command and status messages when starting a rule.
+    | Diagnostic -- ^ Print messages for virtually everything (mostly for debugging).
+      deriving (Eq,Ord,Show,Read,Typeable,Data,Enum,Bounded)
+
+
+-- | Apply the 'shakeRebuild' flags to a file, determining the desired behaviour
+shakeRebuildApply :: ShakeOptions -> (FilePath -> Rebuild)
+shakeRebuildApply ShakeOptions{shakeRebuild=rs}
+    | null rs = const RebuildNormal
+    | otherwise = \x -> fromMaybe RebuildNormal $ firstJust (\(r,pat) -> if pat x then Just r else Nothing) rs2
+        where rs2 = map (second (?==)) $ reverse rs
+
+
+shakeAbbreviationsApply :: ShakeOptions -> String -> String
+shakeAbbreviationsApply ShakeOptions{shakeAbbreviations=abbrev}
+    | null abbrev = id
+    | otherwise = f
+        where
+            -- order so longer abbreviations are preferred
+            ordAbbrev = sortOn (negate . length . fst) abbrev
+
+            f [] = []
+            f x | (to,rest):_ <- [(to,rest) | (from,to) <- ordAbbrev, Just rest <- [stripPrefix from x]] = to ++ f rest
+            f (x:xs) = x : f xs
diff --git a/src/Development/Shake/Internal/Paths.hs b/src/Development/Shake/Internal/Paths.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Paths.hs
@@ -0,0 +1,107 @@
+{-# LANGUAGE CPP #-}
+
+#ifdef FILE_EMBED
+{-# LANGUAGE TemplateHaskell #-}
+#endif
+
+-- | The information from Paths_shake cleaned up
+module Development.Shake.Internal.Paths(
+    shakeVersionString,
+    initDataDirectory,
+    hasManualData, copyManualData,
+    readDataFileHTML
+    ) where
+
+import Control.Monad.Extra
+import Data.Version
+import System.FilePath
+import General.Extra
+import qualified Data.ByteString.Lazy as LBS
+import Paths_shake
+
+#ifdef FILE_EMBED
+import qualified Data.ByteString as BS
+import Data.FileEmbed
+#else
+import Control.Exception
+import System.Directory
+import System.Info.Extra
+import System.IO.Unsafe
+import System.Environment
+#endif
+
+shakeVersionString :: String
+shakeVersionString = showVersion version
+
+#ifdef FILE_EMBED
+
+initDataDirectory :: IO ()
+initDataDirectory = pure ()
+
+htmlDataFiles :: [(FilePath, BS.ByteString)]
+htmlDataFiles =
+  [ ("profile.html",  $(embedFile "html/profile.html"))
+  , ("progress.html", $(embedFile "html/progress.html"))
+  , ("shake.js",      $(embedFile "html/shake.js"))
+  ]
+
+readDataFileHTML :: FilePath -> IO LBS.ByteString
+readDataFileHTML file = do
+    case lookup file htmlDataFiles of
+      Nothing -> fail $ "Could not find data file " ++ file ++ " in embedded data files!"
+      Just x  -> pure (LBS.fromStrict x)
+
+manualDirData :: [(FilePath, BS.ByteString)]
+manualDirData = $(embedDir "docs/manual")
+
+hasManualData :: IO Bool
+hasManualData = pure True
+
+copyManualData :: FilePath -> IO ()
+copyManualData dest = do
+    createDirectoryRecursive dest
+    forM_ manualDirData $ \(file, bs) -> do
+        BS.writeFile (dest </> file) bs
+
+#else
+-- We want getDataFileName to be relative to the current directory on program startup,
+-- even if we issue a change directory command. Therefore, first call caches, future ones read.
+{-# NOINLINE dataDirs #-}
+dataDirs :: [String]
+dataDirs = unsafePerformIO $ do
+    datdir <- getDataDir
+    exedir <- takeDirectory <$> getExecutablePath `catchIO` \_ -> pure ""
+    curdir <- getCurrentDirectory
+    pure $ [datdir] ++ [exedir | exedir /= ""] ++ [curdir]
+
+-- The data files may be located relative to the current directory, if so cache it in advance
+initDataDirectory :: IO ()
+initDataDirectory = void $ evaluate dataDirs
+
+getDataFile :: FilePath -> IO FilePath
+getDataFile file = do
+    let poss = map (</> file) dataDirs
+    res <- filterM doesFileExist_ poss
+    case res of
+        [] -> fail $ unlines $ ("Could not find data file " ++ file ++ ", looked in:") : map ("  " ++) poss
+        x:_ -> pure x
+
+hasDataFile :: FilePath -> IO Bool
+hasDataFile file = anyM (\dir -> doesFileExist_ $ dir </> file) dataDirs
+
+readDataFileHTML :: FilePath -> IO LBS.ByteString
+readDataFileHTML file = LBS.readFile =<< getDataFile ("html" </> file)
+
+manualFiles :: [FilePath]
+manualFiles = map ("docs/manual" </>) ["Shakefile.hs","main.c","constants.c","constants.h","build" <.> if isWindows then "bat" else "sh"]
+
+hasManualData :: IO Bool
+hasManualData = allM hasDataFile manualFiles
+
+copyManualData :: FilePath -> IO ()
+copyManualData dest = do
+    createDirectoryRecursive dest
+    forM_ manualFiles $ \file -> do
+        src <- getDataFile file
+        copyFile src (dest </> takeFileName file)
+#endif
diff --git a/src/Development/Shake/Internal/Profile.hs b/src/Development/Shake/Internal/Profile.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Profile.hs
@@ -0,0 +1,174 @@
+{-# LANGUAGE PatternGuards, RecordWildCards #-}
+
+module Development.Shake.Internal.Profile(writeProfile) where
+
+import General.Template
+import Data.Tuple.Extra
+import Data.Function
+import Data.List.Extra
+import Data.Maybe
+import System.FilePath
+import System.IO.Extra
+import Numeric.Extra
+import General.Extra
+import Development.Shake.Internal.Errors
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Database
+import Development.Shake.Internal.Value
+import qualified Data.HashSet as Set
+import Development.Shake.Internal.Paths
+import Development.Shake.Classes
+import System.Time.Extra
+import qualified Data.HashMap.Strict as Map
+import qualified Data.ByteString.Lazy.Char8 as LBS
+import qualified Data.ByteString.Char8 as BS
+import General.Intern(Id)
+
+
+-- | Given a map of representing a dependency order (with a show for error messages), find an ordering for the items such
+--   that no item points to an item before itself.
+--   Raise an error if you end up with a cycle.
+dependencyOrder :: (Eq a, Hashable a) => (a -> String) -> Map.HashMap a [a] -> [a]
+-- Algorithm:
+--    Divide everyone up into those who have no dependencies [Id]
+--    And those who depend on a particular Id, Dep :-> Maybe [(Key,[Dep])]
+--    Where d :-> Just (k, ds), k depends on firstly d, then remaining on ds
+--    For each with no dependencies, add to list, then take its dep hole and
+--    promote them either to Nothing (if ds == []) or into a new slot.
+--    k :-> Nothing means the key has already been freed
+dependencyOrder shw status = f (map fst noDeps) $ Map.map Just $ Map.fromListWith (++) [(d, [(k,ds)]) | (k,d:ds) <- hasDeps]
+    where
+        (noDeps, hasDeps) = partition (null . snd) $ Map.toList status
+
+        f [] mp | null bad = []
+                | otherwise = throwImpure $ errorInternal $ unlines $
+                    "Internal invariant broken, database seems to be cyclic" :
+                    map ("    " ++) bad ++
+                    ["... plus " ++ show (length badOverflow) ++ " more ..." | not $ null badOverflow]
+            where (bad,badOverflow) = splitAt 10 [shw i | (i, Just _) <- Map.toList mp]
+
+        f (x:xs) mp = x : f (now++xs) later
+            where Just free = Map.lookupDefault (Just []) x mp
+                  (now,later) = foldl' g ([], Map.insert x Nothing mp) free
+
+        g (free, mp) (k, []) = (k:free, mp)
+        g (free, mp) (k, d:ds) = case Map.lookupDefault (Just []) d mp of
+            Nothing -> g (free, mp) (k, ds)
+            Just todo -> (free, Map.insert d (Just $ (k,ds) : todo) mp)
+
+
+-- | Eliminate all errors from the database, pretending they don't exist
+resultsOnly :: Map.HashMap Id (Key, Status) -> Map.HashMap Id (Key, Result (Either BS.ByteString Value))
+resultsOnly mp = Map.map (\(k, v) -> (k, let Just r = getResult v in r{depends = map (Depends . filter (isJust . flip Map.lookup keep) . fromDepends) $ depends r})) keep
+    where keep = Map.filter (isJust . getResult . snd) mp
+
+removeStep :: Map.HashMap Id (Key, Result a) -> Map.HashMap Id (Key, Result a)
+removeStep = Map.filter (\(k,_) -> k /= stepKey)
+
+toReport :: Database -> IO [ProfileEntry]
+toReport db = do
+    status <- removeStep . resultsOnly <$> getKeyValuesFromId db
+    let order = let shw i = maybe "<unknown>" (show . fst) $ Map.lookup i status
+                in dependencyOrder shw $ Map.map (concatMap fromDepends . depends . snd) status
+        ids = Map.fromList $ zip order [0..]
+
+        steps = let xs = Set.toList $ Set.fromList $ concat [[changed, built] | (_,Result{..}) <- Map.elems status]
+                in Map.fromList $ zip (sortBy (flip compare) xs) [0..]
+
+        f (k, Result{..}) = ProfileEntry
+            {prfName = show k
+            ,prfBuilt = fromStep built
+            ,prfChanged = fromStep changed
+            ,prfDepends = filter (not . null) $ map (mapMaybe (`Map.lookup` ids) . fromDepends) depends
+            ,prfExecution = floatToDouble execution
+            ,prfTraces = map fromTrace $ sortOn traceStart traces
+            }
+            where fromStep i = fromJust $ Map.lookup i steps
+                  fromTrace (Trace a b c) = ProfileTrace (BS.unpack a) (floatToDouble b) (floatToDouble c)
+    pure [maybe (throwImpure $ errorInternal "toReport") f $ Map.lookup i status | i <- order]
+
+
+data ProfileEntry = ProfileEntry
+    {prfName :: String, prfBuilt :: Int, prfChanged :: Int, prfDepends :: [[Int]], prfExecution :: Double, prfTraces :: [ProfileTrace]}
+data ProfileTrace = ProfileTrace
+    {prfCommand :: String, prfStart :: Double, prfStop :: Double}
+prfTime ProfileTrace{..} = prfStop - prfStart
+
+-- | Generates an report given some build system profiling data.
+writeProfile :: FilePath -> Database -> IO ()
+writeProfile out db = writeProfileInternal out =<< toReport db
+
+writeProfileInternal :: FilePath -> [ProfileEntry] -> IO ()
+writeProfileInternal out xs
+    | takeExtension out == ".js" = writeFileBinary out $ "var profile = \n" ++ generateJSON xs
+    | takeExtension out == ".json" = writeFileBinary out $ generateJSON xs
+    | takeExtension out == ".trace" = writeFileBinary out $ generateTrace xs
+    | out == "-" = putStr $ unlines $ generateSummary xs
+    -- NOTE: On my laptop writing 1.5Mb of profile report takes 0.6s.
+    --       This is fundamentals of my laptop, not a Haskell profiling issue.
+    --       Verified with similar "type foo > bar" commands taking similar time.
+    | otherwise = LBS.writeFile out =<< generateHTML xs
+
+
+generateSummary :: [ProfileEntry] -> [String]
+generateSummary xs =
+    ["* This database has tracked " ++ show (maximum (0 : map prfChanged xs) + 1) ++ " runs."
+    ,let f = show . length in "* There are " ++ f xs ++ " rules (" ++ f ls ++ " rebuilt in the last run)."
+    ,let f = show . sum . map (length . prfTraces) in "* Building required " ++ f xs ++ " traced commands (" ++ f ls ++ " in the last run)."
+    ,"* The total (unparallelised) time is " ++ showDuration (sum $ map prfExecution xs) ++
+        " of which " ++ showDuration (sum $ map prfTime $ concatMap prfTraces xs) ++ " is traced commands."
+    ,let f xs = if null xs then "0s" else (\(a,b) -> showDuration a ++ " (" ++ b ++ ")") $ maximumBy' (compare `on` fst) xs in
+        "* The longest rule takes " ++ f (map (prfExecution &&& prfName) xs) ++
+        ", and the longest traced command takes " ++ f (map (prfTime &&& prfCommand) $ concatMap prfTraces xs) ++ "."
+    ,let sumLast = sum $ map prfTime $ concatMap prfTraces ls
+         maxStop = maximum $ 0 : map prfStop (concatMap prfTraces ls) in
+        "* Last run gave an average parallelism of " ++ showDP 2 (if maxStop == 0 then 0 else sumLast / maxStop) ++
+        " times over " ++ showDuration maxStop ++ "."
+    ]
+    where ls = filter ((==) 0 . prfBuilt) xs
+
+
+generateHTML :: [ProfileEntry] -> IO LBS.ByteString
+generateHTML xs = do
+    report <- readDataFileHTML "profile.html"
+    let f "data/profile-data.js" = pure $ LBS.pack $ "var profile =\n" ++ generateJSON xs
+    runTemplate f report
+
+
+generateTrace :: [ProfileEntry] -> String
+generateTrace xs = jsonListLines $
+    showEntries 0 [y{prfCommand=prfName x} | x <- onlyLast, y <- prfTraces x] ++
+    showEntries 1 (concatMap prfTraces onlyLast)
+    where
+        onlyLast = filter (\x -> prfBuilt x == 0) xs
+        showEntries pid xs = map (showEntry pid) $ snd $ mapAccumL alloc [] $ sortOn prfStart xs
+
+        alloc :: [ProfileTrace] -> ProfileTrace -> ([ProfileTrace], (Int, ProfileTrace))
+        -- FIXME: I don't really understand what this code is doing, or the invariants it ensures
+        alloc as r | (a1,_:a2) <- break (\a -> prfStop a <= prfStart r) as = (a1++r:a2, (length a1,r))
+                   | otherwise = (as++[r], (length as,r))
+
+        showEntry pid (tid, ProfileTrace{..}) = jsonObject
+            [("args","{}"), ("ph",show "X"), ("cat",show "target")
+            ,("name",show prfCommand), ("tid",show tid), ("pid",show pid)
+            ,("ts",show $ 1000000*prfStart), ("dur",show $ 1000000*(prfStop-prfStart))]
+
+
+generateJSON :: [ProfileEntry] -> String
+generateJSON = jsonListLines . map showEntry
+    where
+        showEntry ProfileEntry{..} = jsonList $
+            [show prfName
+            ,showTime prfExecution
+            ,show prfBuilt
+            ,show prfChanged] ++
+            [show prfDepends | not (null prfDepends) || not (null prfTraces)] ++
+            [jsonList $ map showTrace prfTraces | not (null prfTraces)]
+        showTrace ProfileTrace{..} = jsonList
+            [show prfCommand, showTime prfStart, showTime prfStop]
+        showTime x = if '.' `elem` y then dropWhileEnd (== '.') $ dropWhileEnd (== '0') y else y
+            where y = showDP 4 x
+
+jsonListLines xs = "[" ++ intercalate "\n," xs ++ "\n]"
+jsonList xs = "[" ++ intercalate "," xs ++ "]"
+jsonObject xs = "{" ++ intercalate "," [show a ++ ":" ++ b | (a,b) <- xs] ++ "}"
diff --git a/src/Development/Shake/Internal/Progress.hs b/src/Development/Shake/Internal/Progress.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Progress.hs
@@ -0,0 +1,347 @@
+{-# LANGUAGE RecordWildCards, CPP, ViewPatterns, ForeignFunctionInterface, TupleSections #-}
+
+-- | Progress tracking
+module Development.Shake.Internal.Progress(
+    progress,
+    progressSimple, progressDisplay, progressTitlebar, progressProgram,
+    ProgressEntry(..), progressReplay, writeProgressReport -- INTERNAL USE ONLY
+    ) where
+
+import Control.Applicative
+import Data.Tuple.Extra
+import Control.Exception.Extra
+import Control.Monad.Extra
+import System.Directory
+import System.Process
+import System.FilePath
+import Data.Char
+import Data.IORef
+import Data.List
+import Data.Maybe
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Database
+import qualified Data.ByteString.Char8 as BS
+import qualified Data.ByteString.Lazy.Char8 as LBS
+import Numeric.Extra
+import General.Template
+import General.EscCodes
+import General.Extra
+import Development.Shake.Internal.Paths
+import System.Time.Extra
+
+
+#ifdef mingw32_HOST_OS
+
+import Foreign.C.String
+
+#ifdef x86_64_HOST_ARCH
+#define CALLCONV ccall
+#else
+#define CALLCONV stdcall
+#endif
+
+foreign import CALLCONV "Windows.h SetConsoleTitleW" c_setConsoleTitleW :: CWString -> IO Bool
+
+#endif
+
+
+
+---------------------------------------------------------------------
+-- PROGRESS
+
+progress :: Database -> Step -> IO Progress
+progress db step = do
+    xs <- getKeyValues db
+    pure $! foldl' f mempty $ map snd xs
+    where
+        g = floatToDouble
+
+        f s (Ready Result{..}) = if step == built
+            then s{countBuilt = countBuilt s + 1, timeBuilt = timeBuilt s + g execution}
+            else s{countSkipped = countSkipped s + 1, timeSkipped = timeSkipped s + g execution}
+        f s (Loaded Result{..}) = s{countUnknown = countUnknown s + 1, timeUnknown = timeUnknown s + g execution}
+        f s (Running _ r) =
+            let (d,c) = timeTodo s
+                t | Just Result{..} <- r = let d2 = d + g execution in d2 `seq` (d2,c)
+                  | otherwise = let c2 = c + 1 in c2 `seq` (d,c2)
+            in s{countTodo = countTodo s + 1, timeTodo = t}
+        f s _ = s
+
+
+
+---------------------------------------------------------------------
+-- MEALY TYPE - for writing the progress functions
+-- See <https://hackage.haskell.org/package/machines-0.2.3.1/docs/Data-Machine-Mealy.html>
+
+-- | A machine that takes inputs and produces outputs
+newtype Mealy i a = Mealy {runMealy :: i -> (a, Mealy i a)}
+
+instance Functor (Mealy i) where
+    fmap f (Mealy m) = Mealy $ \i -> case m i of
+        (x, m) -> (f x, fmap f m)
+
+instance Applicative (Mealy i) where
+    pure x = let r = Mealy (const (x, r)) in r
+    Mealy mf <*> Mealy mx = Mealy $ \i -> case mf i of
+        (f, mf) -> case mx i of
+            (x, mx) -> (f x, mf <*> mx)
+
+echoMealy :: Mealy i i
+echoMealy = Mealy (,echoMealy)
+
+scanMealy :: (a -> b -> a) -> a -> Mealy i b -> Mealy i a
+scanMealy f z (Mealy m) = Mealy $ \i -> case m i of
+    (x, m) -> let z2 = f z x in (z2, scanMealy f z2 m)
+
+
+---------------------------------------------------------------------
+-- MEALY UTILITIES
+
+oldMealy :: a -> Mealy i a -> Mealy i (a,a)
+oldMealy old = scanMealy (\(_,old) new -> (old,new)) (old,old)
+
+latch :: Mealy i (Bool, a) -> Mealy i a
+latch s = fromJust <$> scanMealy f Nothing s
+    where f old (b,v) = Just $ if b then fromMaybe v old else v
+
+iff :: Mealy i Bool -> Mealy i a -> Mealy i a -> Mealy i a
+iff c t f = (\c t f -> if c then t else f) <$> c <*> t <*> f
+
+-- decay'd division, compute a/b, with a decay of f
+-- r' is the new result, r is the last result
+-- r' ~= a' / b'
+-- r' = r*b + f*(a'-a)
+--      -------------
+--      b + f*(b'-b)
+-- when f == 1, r == r'
+--
+-- both streams must only ever increase
+decay :: Double -> Mealy i Double -> Mealy i Double -> Mealy i Double
+decay f a b = scanMealy step 0 $ (,) <$> oldMealy 0 a <*> oldMealy 0 b
+    where step r ((a,a'),(b,b')) = if isNaN r then a' / b' else ((r*b) + f*(a'-a)) / (b + f*(b'-b))
+
+
+---------------------------------------------------------------------
+-- MESSAGE GENERATOR
+
+formatMessage :: Double -> Double -> String
+formatMessage secs perc =
+    (if isNaN secs || secs < 0 then "??s" else showMinSec $ ceiling secs) ++ " (" ++
+    (if isNaN perc || perc < 0 || perc > 100 then "??" else show $ floor perc) ++ "%)"
+
+showMinSec :: Int -> String
+showMinSec secs = (if m == 0 then "" else show m ++ "m" ++ ['0' | s < 10]) ++ show s ++ "s"
+    where (m,s) = divMod secs 60
+
+liftA2' :: Applicative m => m a -> m b -> (a -> b -> c) -> m c
+liftA2' a b f = liftA2 f a b
+
+
+-- | return (number of seconds, percentage, explanation)
+message :: Mealy (Double, Progress) (Double, Progress) -> Mealy (Double, Progress) (Double, Double, String)
+message input = liftA3 (,,) time perc debug
+    where
+        progress = snd <$> input
+        secs = fst <$> input
+        debug = (\donePerSec ruleTime (todoKnown,todoUnknown) ->
+            "Progress: " ++
+                "((known=" ++ showDP 2 todoKnown ++ "s) + " ++
+                "(unknown=" ++ show todoUnknown ++ " * time=" ++ showDP 2 ruleTime ++ "s)) " ++
+                "(rate=" ++ showDP 2 donePerSec ++ "))")
+            <$> donePerSec <*> ruleTime <*> (timeTodo <$> progress)
+
+        -- Number of seconds work completed in this build run
+        -- Ignores timeSkipped which would be more truthful, but it makes the % drop sharply
+        -- which isn't what users want
+        done = timeBuilt <$> progress
+
+        -- Work done per second, don't divide by 0 and don't update if 'done' doesn't change
+        donePerSec = iff ((==) 0 <$> done) (pure 1) perSecStable
+            where perSecStable = latch $ liftA2 (,) (uncurry (==) <$> oldMealy 0 done) perSecRaw
+                  perSecRaw = decay 1.2 done secs
+
+        -- Predicted build time for a rule that has never been built before
+        -- The high decay means if a build goes in "phases" - lots of source files, then lots of compiling
+        -- we reach a reasonable number fairly quickly, without bouncing too much
+        ruleTime = liftA2 weightedAverage
+            (f (decay 10) timeBuilt countBuilt)
+            (f (liftA2 (/)) (fst . timeTodo) (\Progress{..} -> countTodo - snd timeTodo))
+            -- don't call decay on todo, since it goes up and down (as things get done)
+            where
+                weightedAverage (w1,x1) (w2,x2)
+                    | w1 == 0 && w2 == 0 = 0
+                    | otherwise = ((w1 *. x1) + (w2 *. x2)) / intToDouble (w1+w2)
+                    where i *. d = if i == 0 then 0 else intToDouble i * d -- since d might be NaN
+
+                f divide time count = let xs = count <$> progress in liftA2 (,) xs $ divide (time <$> progress) (intToDouble <$> xs)
+
+        -- Number of seconds work remaining, ignoring multiple threads
+        todo = f <$> progress <*> ruleTime
+            where f Progress{..} ruleTime = fst timeTodo + (fromIntegral (snd timeTodo) * ruleTime)
+
+        -- Display information
+        time = liftA2 (/) todo donePerSec
+        perc = iff ((==) 0 <$> done) (pure 0) $
+            liftA2' done todo $ \done todo -> 100 * done / (done + todo)
+
+
+---------------------------------------------------------------------
+-- EXPOSED FUNCTIONS
+
+-- | Given a sampling interval (in seconds) and a way to display the status message,
+--   produce a function suitable for using as 'Development.Shake.shakeProgress'.
+--   This function polls the progress information every /n/ seconds, produces a status
+--   message and displays it using the display function.
+--
+--   Typical status messages will take the form of @1m25s (15%)@, indicating that the build
+--   is predicted to complete in 1 minute 25 seconds (85 seconds total), and 15% of the necessary build time has elapsed.
+--   This function uses past observations to predict future behaviour, and as such, is only
+--   guessing. The time is likely to go up as well as down, and will be less accurate from a
+--   clean build (as the system has fewer past observations).
+--
+--   The current implementation is to predict the time remaining (based on 'timeTodo') and the
+--   work already done ('timeBuilt'). The percentage is then calculated as @remaining / (done + remaining)@,
+--   while time left is calculated by scaling @remaining@ by the observed work rate in this build,
+--   roughly @done / time_elapsed@.
+progressDisplay :: Double -> (String -> IO ()) -> IO Progress -> IO ()
+progressDisplay sample disp prog = do
+    disp "Starting..." -- no useful info at this stage
+    time <- offsetTime
+    catchJust (\x -> if x == ThreadKilled then Just () else Nothing)
+        (loop time $ message echoMealy)
+        (const $ do t <- time; disp $ "Finished in " ++ showDuration t)
+    where
+        loop :: IO Double -> Mealy (Double, Progress) (Double, Double, String) -> IO ()
+        loop time mealy = do
+            sleep sample
+            p <- prog
+            t <- time
+            ((secs,perc,_debug), mealy)<- pure $ runMealy mealy (t, p)
+            -- putStrLn _debug
+            let done = countSkipped p + countBuilt p
+            let todo = done + countUnknown p + countTodo p
+            disp $
+                "Running for " ++ showDurationSecs t ++ " [" ++ show done ++ "/" ++ show todo ++ "]" ++
+                ", predicted " ++ formatMessage secs perc ++
+                maybe "" (", Failure! " ++) (isFailure p)
+            loop time mealy
+
+
+data ProgressEntry = ProgressEntry
+    {idealSecs :: Double, idealPerc :: Double
+    ,actualSecs :: Double, actualPerc :: Double
+    }
+
+isInvalid :: ProgressEntry -> Bool
+isInvalid ProgressEntry{..} = isNaN actualSecs || isNaN actualPerc
+
+
+-- | Given a list of progress inputs, what would you have suggested (seconds, percentage)
+progressReplay :: [(Double, Progress)] -> [ProgressEntry]
+progressReplay [] = []
+progressReplay ps = snd $ mapAccumL f (message echoMealy) ps
+    where
+        end = fst $ last ps
+        f a (time,p) = (a2, ProgressEntry (end - time) (time * 100 / end) secs perc)
+            where ((secs,perc,_),a2) = runMealy a (time,p)
+
+
+-- | Given a trace, display information about how well we did
+writeProgressReport :: FilePath -> [(FilePath, [(Double, Progress)])] -> IO ()
+writeProgressReport out (map (second progressReplay) -> xs)
+    | (bad,_):_ <- filter (any isInvalid . snd) xs = errorIO $ "Progress generates NaN for " ++ bad
+    | takeExtension out == ".js" = writeFile out $ "var shake = \n" ++ generateJSON xs
+    | takeExtension out == ".json" = writeFile out $ generateJSON xs
+    | out == "-" = putStr $ unlines $ generateSummary xs
+    | otherwise = LBS.writeFile out =<< generateHTML xs
+
+
+generateSummary :: [(FilePath, [ProgressEntry])] -> [String]
+generateSummary xs = flip concatMap xs $ \(file,xs) ->
+    ["# " ++ file, f xs "Seconds" idealSecs actualSecs, f xs "Percent" idealPerc actualPerc]
+    where
+        levels = [100,90,80,50]
+        f xs lbl ideal actual = lbl ++ ": " ++ intercalate ", "
+            [show l ++ "% within " ++ show (ceiling $ maximum $ 0 : take ((length xs * l) `div` 100) diff) | l <- levels]
+            where diff = sort [abs $ ideal x - actual x | x <- xs]
+
+
+generateHTML :: [(FilePath, [ProgressEntry])] -> IO LBS.ByteString
+generateHTML xs = do
+    report <- readDataFileHTML "progress.html"
+    let f "data/progress-data.js" = pure $ LBS.pack $ "var progress =\n" ++ generateJSON xs
+    runTemplate f report
+
+generateJSON :: [(FilePath, [ProgressEntry])] -> String
+generateJSON = concat . jsonList . map ((++"}") . unlines . f)
+    where
+        f (file,ps) =
+            ("{\"name\":" ++ show (takeFileName file) ++ ", \"values\":") :
+            indent (jsonList $ map g ps)
+
+        shw = showDP 1
+        g ProgressEntry{..} = jsonObject
+            [("idealSecs",shw idealSecs),("idealPerc",shw idealPerc)
+            ,("actualSecs",shw actualSecs),("actualPerc",shw actualPerc)]
+
+indent = map ("  "++)
+jsonList xs = zipWith (:) ('[':repeat ',') xs ++ ["]"]
+jsonObject xs = "{" ++ intercalate ", " [show a ++ ":" ++ b | (a,b) <- xs] ++ "}"
+
+
+-- | Set the title of the current console window to the given text. If the
+--   environment variable @$TERM@ is set to @xterm@ this uses xterm escape sequences.
+--   On Windows, if not detected as an xterm, this function uses the @SetConsoleTitle@ API.
+progressTitlebar :: String -> IO ()
+progressTitlebar x = unlessM win lin
+    where
+#ifdef mingw32_HOST_OS
+        win = withCWString x c_setConsoleTitleW
+#else
+        win = pure False
+#endif
+
+        lin = whenM checkEscCodes $ BS.putStr $ BS.pack $ escWindowTitle x
+
+
+-- | Call the program @shake-progress@ if it is on the @$PATH@. The program is called with
+--   the following arguments:
+--
+-- * @--title=string@ - the string passed to @progressProgram@.
+--
+-- * @--state=Normal@, or one of @NoProgress@, @Normal@, or @Error@ to indicate
+--   what state the progress bar should be in.
+--
+-- * @--value=25@ - the percent of the build that has completed, if not in @NoProgress@ state.
+--
+--   The program will not be called consecutively with the same @--state@ and @--value@ options.
+--
+--   Windows 7 or higher users can get taskbar progress notifications by placing the following
+--   program in their @$PATH@: <https://github.com/ndmitchell/shake/releases>.
+progressProgram :: IO (String -> IO ())
+progressProgram = do
+    exe <- findExecutable "shake-progress"
+    case exe of
+        Nothing -> pure $ const $ pure ()
+        Just exe -> do
+            lastArgs <- newIORef Nothing -- the arguments we passed to shake-progress last time
+            pure $ \msg -> do
+                let failure = " Failure! " `isInfixOf` msg
+                let perc = let (a,b) = break (== '%') msg
+                           in if null b then "" else reverse $ takeWhile isDigit $ reverse a
+                let state | perc == "" = "NoProgress"
+                          | failure = "Error"
+                          | otherwise = "Normal"
+                let args = ["--title=" ++ msg, "--state=" ++ state] ++ ["--value=" ++ perc | perc /= ""]
+                same <- atomicModifyIORef lastArgs $ \old -> (Just args, old == Just args)
+                unless same $ void $ rawSystem exe args
+
+
+-- | A simple method for displaying progress messages, suitable for using as 'Development.Shake.shakeProgress'.
+--   This function writes the current progress to the titlebar every five seconds using 'progressTitlebar',
+--   and calls any @shake-progress@ program on the @$PATH@ using 'progressProgram'.
+progressSimple :: IO Progress -> IO ()
+progressSimple p = do
+    program <- progressProgram
+    progressDisplay 5 (\s -> progressTitlebar s >> program s) p
diff --git a/src/Development/Shake/Internal/Resource.hs b/src/Development/Shake/Internal/Resource.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Resource.hs
@@ -0,0 +1,185 @@
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE RecordWildCards, ViewPatterns #-}
+
+module Development.Shake.Internal.Resource(
+    Resource, newResourceIO, newThrottleIO, withResource
+    ) where
+
+import Data.Function
+import System.IO.Unsafe
+import Control.Concurrent.Extra
+import General.Fence
+import Control.Exception.Extra
+import Data.Tuple.Extra
+import Data.IORef
+import Control.Monad.Extra
+import General.Bilist
+import General.Pool
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Monad
+import Development.Shake.Internal.Core.Pool
+import Control.Monad.IO.Class
+import System.Time.Extra
+
+
+{-# NOINLINE resourceId #-}
+resourceId :: IO Int
+resourceId = unsafePerformIO resourceCounter
+
+-- Work around for GHC bug https://gitlab.haskell.org/ghc/ghc/-/issues/19413
+{-# NOINLINE  resourceCounter #-}
+resourceCounter :: IO (IO Int)
+resourceCounter = do
+    ref <- newIORef 0
+    pure $ atomicModifyIORef' ref $ \i -> let j = i + 1 in (j, j)
+
+
+-- | Run an action which uses part of a finite resource. For more details see 'Resource'.
+--   You cannot depend on a rule (e.g. 'need') while a resource is held.
+withResource :: Resource -> Int -> Action a -> Action a
+withResource r i act = do
+    Global{..} <- Action getRO
+    liftIO $ globalDiagnostic $ pure $ show r ++ " waiting to acquire " ++ show i
+
+    fence <- liftIO $ acquireResource r globalPool i
+    whenJust fence $ \fence -> do
+        (offset, ()) <- actionFenceRequeueBy Right fence
+        Action $ modifyRW $ addDiscount offset
+
+    liftIO $ globalDiagnostic $ pure $ show r ++ " running with " ++ show i
+    Action $ fromAction (blockApply ("Within withResource using " ++ show r) act) `finallyRAW` do
+        liftIO $ releaseResource r globalPool i
+        liftIO $ globalDiagnostic $ pure $ show r ++ " released " ++ show i
+
+
+
+-- | A type representing an external resource which the build system should respect. There
+--   are two ways to create 'Resource's in Shake:
+--
+-- * 'Development.Shake.newResource' creates a finite resource, stopping too many actions running
+--   simultaneously.
+--
+-- * 'Development.Shake.newThrottle' creates a throttled resource, stopping too many actions running
+--   over a short time period.
+--
+--   These resources are used with 'Development.Shake.withResource' when defining rules. Typically only
+--   system commands (such as 'Development.Shake.cmd') should be run inside 'Development.Shake.withResource',
+--   not commands such as 'Development.Shake.need'.
+--
+--   Be careful that the actions run within 'Development.Shake.withResource' do not themselves require further
+--   resources, or you may get a \"thread blocked indefinitely in an MVar operation\" exception.
+--   If an action requires multiple resources, use 'Development.Shake.withResources' to avoid deadlock.
+data Resource = Resource
+    {resourceOrd :: Int
+        -- ^ Key used for Eq/Ord operations. To make withResources work, we require newResourceIO < newThrottleIO
+    ,resourceShow :: String
+        -- ^ String used for Show
+    ,acquireResource :: Pool -> Int -> IO (Maybe (Fence IO ()))
+        -- ^ Acquire the resource and call the function.
+    ,releaseResource :: Pool -> Int -> IO ()
+        -- ^ You should only ever releaseResource that you obtained with acquireResource.
+    }
+
+instance Show Resource where show = resourceShow
+instance Eq Resource where (==) = (==) `on` resourceOrd
+instance Ord Resource where compare = compare `on` resourceOrd
+
+
+---------------------------------------------------------------------
+-- FINITE RESOURCES
+
+data Finite = Finite
+    {finiteAvailable :: !Int
+        -- ^ number of currently available resources
+    ,finiteWaiting :: Bilist (Int, Fence IO ())
+        -- ^ queue of people with how much they want and the action when it is allocated to them
+    }
+
+-- | A version of 'Development.Shake.newResource' that runs in IO, and can be called before calling 'Development.Shake.shake'.
+--   Most people should use 'Development.Shake.newResource' instead.
+newResourceIO :: String -> Int -> IO Resource
+newResourceIO name mx = do
+    when (mx < 0) $
+        errorIO $ "You cannot create a resource named " ++ name ++ " with a negative quantity, you used " ++ show mx
+    key <- resourceId
+    var <- newVar $ Finite mx mempty
+    pure $ Resource (negate key) shw (acquire var) (release var)
+    where
+        shw = "Resource " ++ name
+
+        acquire :: Var Finite -> Pool -> Int -> IO (Maybe (Fence IO ()))
+        acquire var _ want
+            | want < 0 = errorIO $ "You cannot acquire a negative quantity of " ++ shw ++ ", requested " ++ show want
+            | want > mx = errorIO $ "You cannot acquire more than " ++ show mx ++ " of " ++ shw ++ ", requested " ++ show want
+            | otherwise = modifyVar var $ \x@Finite{..} ->
+                if want <= finiteAvailable then
+                    pure (x{finiteAvailable = finiteAvailable - want}, Nothing)
+                else do
+                    fence <- newFence
+                    pure (x{finiteWaiting = finiteWaiting `snoc` (want, fence)}, Just fence)
+
+        release :: Var Finite -> Pool -> Int -> IO ()
+        release var _ i = join $ modifyVar var $ \x -> pure $ f x{finiteAvailable = finiteAvailable x + i}
+            where
+                f (Finite i (uncons -> Just ((wi,wa),ws)))
+                    | wi <= i = second (signalFence wa () >>) $ f $ Finite (i-wi) ws
+                    | otherwise = first (add (wi,wa)) $ f $ Finite i ws
+                f (Finite i _) = (Finite i mempty, pure ())
+                add a s = s{finiteWaiting = a `cons` finiteWaiting s}
+
+
+---------------------------------------------------------------------
+-- THROTTLE RESOURCES
+
+
+-- call a function after a certain delay
+waiter :: Seconds -> IO () -> IO ()
+waiter period act = void $ forkIO $ do
+    sleep period
+    act
+
+
+data Throttle
+      -- | Some number of resources are available
+    = ThrottleAvailable !Int
+      -- | Some users are blocked (non-empty), plus an action to call once we go back to Available
+    | ThrottleWaiting (IO ()) (Bilist (Int, Fence IO ()))
+
+
+-- | A version of 'Development.Shake.newThrottle' that runs in IO, and can be called before calling 'Development.Shake.shake'.
+--   Most people should use 'Development.Shake.newThrottle' instead.
+newThrottleIO :: String -> Int -> Double -> IO Resource
+newThrottleIO name count period = do
+    when (count < 0) $
+        errorIO $ "You cannot create a throttle named " ++ name ++ " with a negative quantity, you used " ++ show count
+    key <- resourceId
+    var <- newVar $ ThrottleAvailable count
+    pure $ Resource key shw (acquire var) (release var)
+    where
+        shw = "Throttle " ++ name
+
+        acquire :: Var Throttle -> Pool -> Int -> IO (Maybe (Fence IO ()))
+        acquire var pool want
+            | want < 0 = errorIO $ "You cannot acquire a negative quantity of " ++ shw ++ ", requested " ++ show want
+            | want > count = errorIO $ "You cannot acquire more than " ++ show count ++ " of " ++ shw ++ ", requested " ++ show want
+            | otherwise = modifyVar var $ \case
+                ThrottleAvailable i
+                    | i >= want -> pure (ThrottleAvailable $ i - want, Nothing)
+                    | otherwise -> do
+                        stop <- keepAlivePool pool
+                        fence <- newFence
+                        pure (ThrottleWaiting stop $ (want - i, fence) `cons` mempty, Just fence)
+                ThrottleWaiting stop xs -> do
+                    fence <- newFence
+                    pure (ThrottleWaiting stop $ xs `snoc` (want, fence), Just fence)
+
+        release :: Var Throttle -> Pool -> Int -> IO ()
+        release var _ n = waiter period $ join $ modifyVar var $ \x -> pure $ case x of
+                ThrottleAvailable i -> (ThrottleAvailable $ i+n, pure ())
+                ThrottleWaiting stop xs -> f stop n xs
+            where
+                f stop i (uncons -> Just ((wi,wa),ws))
+                    | i >= wi = second (signalFence wa () >>) $ f stop (i-wi) ws
+                    | otherwise = (ThrottleWaiting stop $ (wi-i,wa) `cons` ws, pure ())
+                f stop i _ = (ThrottleAvailable i, stop)
diff --git a/src/Development/Shake/Internal/Rules/Default.hs b/src/Development/Shake/Internal/Rules/Default.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Rules/Default.hs
@@ -0,0 +1,18 @@
+
+module Development.Shake.Internal.Rules.Default(
+    defaultRules
+    ) where
+
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Rules.Directory
+import Development.Shake.Internal.Rules.File
+import Development.Shake.Internal.Rules.Files
+import Development.Shake.Internal.Rules.Rerun
+
+-- All the rules baked into Shake
+defaultRules :: Rules ()
+defaultRules = do
+    defaultRuleFile
+    defaultRuleFiles
+    defaultRuleDirectory
+    defaultRuleRerun
diff --git a/src/Development/Shake/Internal/Rules/Directory.hs b/src/Development/Shake/Internal/Rules/Directory.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Rules/Directory.hs
@@ -0,0 +1,354 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, ScopedTypeVariables, DeriveDataTypeable #-}
+{-# LANGUAGE TypeFamilies, TypeOperators, ConstraintKinds #-}
+
+-- | Both System.Directory and System.Environment wrappers
+module Development.Shake.Internal.Rules.Directory(
+    doesFileExist, doesDirectoryExist,
+    getDirectoryContents, getDirectoryFiles, getDirectoryDirs,
+    getEnv, getEnvWithDefault, getEnvError,
+    removeFiles, removeFilesAfter,
+    getDirectoryFilesIO,
+    defaultRuleDirectory
+    ) where
+
+import Control.Exception.Extra
+import Control.Monad.Extra
+import Control.Monad.IO.Class
+import Data.Maybe
+import Data.Binary
+import Data.List
+import Data.Tuple.Extra
+import qualified Data.HashSet as Set
+import qualified System.Directory as IO
+import qualified System.Environment as IO
+
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Core.Build
+import Development.Shake.Internal.Value
+import Development.Shake.Classes
+import Development.Shake.FilePath
+import Development.Shake.Internal.FilePattern
+import General.Extra
+import General.Binary
+
+
+---------------------------------------------------------------------
+-- KEY/VALUE TYPES
+
+type instance RuleResult DoesFileExistQ = DoesFileExistA
+
+newtype DoesFileExistQ = DoesFileExistQ FilePath
+    deriving (Typeable,Eq,Hashable,Binary,BinaryEx,NFData)
+
+instance Show DoesFileExistQ where
+    show (DoesFileExistQ a) = "doesFileExist " ++ wrapQuote a
+
+newtype DoesFileExistA = DoesFileExistA {fromDoesFileExistA :: Bool}
+    deriving (Typeable,Eq,BinaryEx,NFData)
+
+instance Show DoesFileExistA where
+    show (DoesFileExistA a) = show a
+
+type instance RuleResult DoesDirectoryExistQ = DoesDirectoryExistA
+
+newtype DoesDirectoryExistQ = DoesDirectoryExistQ FilePath
+    deriving (Typeable,Eq,Hashable,Binary,BinaryEx,NFData)
+
+instance Show DoesDirectoryExistQ where
+    show (DoesDirectoryExistQ a) = "doesDirectoryExist " ++ wrapQuote a
+
+newtype DoesDirectoryExistA = DoesDirectoryExistA {fromDoesDirectoryExistA :: Bool}
+    deriving (Typeable,Eq,BinaryEx,NFData)
+
+instance Show DoesDirectoryExistA where
+    show (DoesDirectoryExistA a) = show a
+
+
+type instance RuleResult GetEnvQ = GetEnvA
+
+newtype GetEnvQ = GetEnvQ String
+    deriving (Typeable,Eq,Hashable,Binary,BinaryEx,NFData)
+
+instance Show GetEnvQ where
+    show (GetEnvQ a) = "getEnv " ++ wrapQuote a
+
+newtype GetEnvA = GetEnvA {fromGetEnvA :: Maybe String}
+    deriving (Typeable,Eq,Hashable,BinaryEx,NFData)
+
+instance Show GetEnvA where
+    show (GetEnvA a) = maybe "<unset>" wrapQuote a
+
+
+type instance RuleResult GetDirectoryContentsQ = GetDirectoryA
+type instance RuleResult GetDirectoryFilesQ = GetDirectoryA
+type instance RuleResult GetDirectoryDirsQ = GetDirectoryA
+
+newtype GetDirectoryContentsQ = GetDirectoryContentsQ FilePath
+    deriving (Typeable,Eq,Hashable,Binary,BinaryEx,NFData)
+
+instance Show GetDirectoryContentsQ where
+    show (GetDirectoryContentsQ dir) = "getDirectoryContents " ++ wrapQuote dir
+
+newtype GetDirectoryFilesQ = GetDirectoryFilesQ (FilePath, [FilePattern])
+    deriving (Typeable,Eq,Hashable,Binary,BinaryEx,NFData)
+
+instance Show GetDirectoryFilesQ where
+    show (GetDirectoryFilesQ (dir, pat)) = "getDirectoryFiles " ++ wrapQuote dir ++ " [" ++ unwords (map wrapQuote pat) ++ "]"
+
+newtype GetDirectoryDirsQ = GetDirectoryDirsQ FilePath
+    deriving (Typeable,Eq,Hashable,Binary,BinaryEx,NFData)
+
+instance Show GetDirectoryDirsQ where
+    show (GetDirectoryDirsQ dir) = "getDirectoryDirs " ++ wrapQuote dir
+
+newtype GetDirectoryA = GetDirectoryA {fromGetDirectoryA :: [FilePath]}
+    deriving (Typeable,Eq,Hashable,BinaryEx,NFData)
+
+instance Show GetDirectoryA where
+    show (GetDirectoryA xs) = unwords $ map wrapQuote xs
+
+
+---------------------------------------------------------------------
+-- RULE DEFINITIONS
+
+queryRule :: (RuleResult key ~ value
+             ,BinaryEx witness, Eq witness
+             ,BinaryEx key, ShakeValue key
+             ,Typeable value, NFData value, Show value, Eq value)
+          => (value -> witness) -> (key -> IO value) -> Rules ()
+queryRule witness query = addBuiltinRuleEx
+    (\k old -> do
+        new <- query k
+        pure $ if old == new then Nothing else Just $ show new)
+    (\_ v -> Just $ runBuilder $ putEx $ witness v)
+    (\k old _ -> liftIO $ do
+        new <- query k
+        let wnew = witness new
+        pure $ case old of
+            Just old | wnew == getEx old -> RunResult ChangedNothing old new
+            _ -> RunResult ChangedRecomputeDiff (runBuilder $ putEx wnew) new)
+
+
+defaultRuleDirectory :: Rules ()
+defaultRuleDirectory = do
+    -- for things we are always going to rerun, and which might take up a lot of memory to store,
+    -- we only store their hash, so we can compute change, but not know what changed happened
+    queryRule id (\(DoesFileExistQ x) -> DoesFileExistA <$> IO.doesFileExist x)
+    queryRule id (\(DoesDirectoryExistQ x) -> DoesDirectoryExistA <$> IO.doesDirectoryExist x)
+    queryRule hash (\(GetEnvQ x) -> GetEnvA <$> IO.lookupEnv x)
+    queryRule hash (\(GetDirectoryContentsQ x) -> GetDirectoryA <$> getDirectoryContentsIO x)
+    queryRule hash (\(GetDirectoryFilesQ (a,b)) -> GetDirectoryA <$> getDirectoryFilesIO a b)
+    queryRule hash (\(GetDirectoryDirsQ x) -> GetDirectoryA <$> getDirectoryDirsIO x)
+
+
+---------------------------------------------------------------------
+-- RULE ENTRY POINTS
+
+-- | Returns 'True' if the file exists. The existence of the file is tracked as a
+--   dependency, and if the file is created or deleted the rule will rerun in subsequent builds.
+--   Usually used to implement include paths. For example, given a include path of @foo@ and @bar@,
+--   and a file @hello.txt@, you might write:
+--
+-- @
+-- b <- 'doesFileExist' \"foo\/hello.txt\"
+-- let file = if b then \"foo\/hello.txt\" else "\bar\/hello.txt\"
+-- @
+--
+--   Now if the user had a file @bar\/hello.txt@, and then creates a file @foo\/hello.txt@, the
+--   rule would correctly rerun, as while the @hello.txt@ that was used didn't change, which
+--   file should be used has changed.
+--
+--   You should not call 'doesFileExist' on files which can be created by the build system.
+--   The reason is that Shake operations such as this one are both cached for the duration of the build,
+--   and may be run preemptively during a recheck. That means you can't control the time at which
+--   'doesFileExist' is called. For that to be consistent, 'doesFileExist' must return the same result at the
+--   start and end of the build, a property that is partially checked by the @--lint@ flag. Given a
+--   file created by the build system, a build from clean will return 'False' at the beginning and 'True'
+--   at the end, leading to a change, and thus rebuilds in subsequent runs.
+--
+--   If you do want to know whether a file exists separate to the build system, e.g. you can perfectly
+--   predict the files contents and can save some meaningful work if the file already exists, you should
+--   use the untracked "System.Directory" version. Such calls are not tracked by the file system, and you
+--   should take care not to result in unpredictable results.
+doesFileExist :: FilePath -> Action Bool
+doesFileExist = fmap fromDoesFileExistA . apply1 . DoesFileExistQ . toStandard
+
+-- | Returns 'True' if the directory exists. The existence of the directory is tracked as a
+--   dependency, and if the directory is created or delete the rule will rerun in subsequent builds.
+--
+--   You should not call 'doesDirectoryExist' on directories which can be created by the build system,
+--   for reasons explained in 'doesFileExist'.
+doesDirectoryExist :: FilePath -> Action Bool
+doesDirectoryExist = fmap fromDoesDirectoryExistA . apply1 . DoesDirectoryExistQ . toStandard
+
+-- | Return 'Just' the value of the environment variable, or 'Nothing'
+--   if the variable is not set. The environment variable is tracked as a
+--   dependency, and if it changes the rule will rerun in subsequent builds.
+--   This function is a tracked version of 'getEnv' / 'lookupEnv' from the base library.
+--
+-- @
+-- flags <- getEnv \"CFLAGS\"
+-- 'cmd' \"gcc -c\" [out] (maybe [] words flags)
+-- @
+getEnv :: String -> Action (Maybe String)
+getEnv = fmap fromGetEnvA . apply1 . GetEnvQ
+
+-- | @'getEnvWithDefault' def var@ returns the value of the environment variable @var@, or the
+--   default value @def@ if it is not set. Similar to 'getEnv'.
+--
+-- @
+-- flags <- getEnvWithDefault \"-Wall\" \"CFLAGS\"
+-- 'cmd' \"gcc -c\" [out] flags
+-- @
+getEnvWithDefault :: String -> String -> Action String
+getEnvWithDefault def var = fromMaybe def <$> getEnv var
+
+-- | A partial variant of 'getEnv' that returns the environment variable variable or fails.
+getEnvError :: Partial => String -> Action String
+getEnvError name = getEnvWithDefault (error $ "getEnvError: Environment variable " ++ name ++ " is undefined") name
+
+-- | Get the contents of a directory. The result will be sorted, and will not contain
+--   the entries @.@ or @..@ (unlike the standard Haskell version).
+--   The resulting paths will be relative to the first argument.
+--   The result itself is tracked as a dependency, but the files in the result are not.
+--   If the list of files changes in subsequent builds any rule calling it will rerun.
+--
+--   It is usually simpler to call either 'getDirectoryFiles' or 'getDirectoryDirs'.
+getDirectoryContents :: FilePath -> Action [FilePath]
+getDirectoryContents = fmap fromGetDirectoryA . apply1 . GetDirectoryContentsQ
+
+-- | Get the files anywhere under a directory that match any of a set of patterns.
+--   For the interpretation of the patterns see '?=='. All results will be
+--   relative to the directory argument.
+--   The result itself is tracked as a dependency, but the files in the result are not.
+--   If the list of files changes in subsequent builds any rule calling it will rerun.
+--   Some examples:
+--
+-- > getDirectoryFiles "Config" ["//*.xml"]
+-- >     -- All .xml files anywhere under the Config directory
+-- >     -- If Config/foo/bar.xml exists it will return ["foo/bar.xml"]
+-- > getDirectoryFiles "Modules" ["*.hs","*.lhs"]
+-- >     -- All .hs or .lhs in the Modules directory
+-- >     -- If Modules/foo.hs and Modules/foo.lhs exist, it will return ["foo.hs","foo.lhs"]
+--
+--   If you require a qualified file name it is often easier to use @\"\"@ as the 'FilePath' argument,
+--   for example the following two expressions are equivalent:
+--
+-- > fmap (map ("Config" </>)) (getDirectoryFiles "Config" ["//*.xml"])
+-- > getDirectoryFiles "" ["Config//*.xml"]
+--
+--   If the first argument directory does not exist it will raise an error.
+--   If @foo@ does not exist, then the first of these error, but the second will not.
+--
+-- > getDirectoryFiles "foo" ["//*"] -- error
+-- > getDirectoryFiles "" ["foo//*"] -- returns []
+--
+--   This function is tracked and serves as a dependency. If a rule calls
+--   @getDirectoryFiles \"\" [\"*.c\"]@ and someone adds @foo.c@ to the
+--   directory, that rule will rebuild. If someone changes one of the @.c@ files,
+--   but the /list/ of @.c@ files doesn't change, then it will not rebuild.
+--   As a consequence of being tracked, if the contents change during the build
+--   (e.g. you are generating @.c@ files in this directory) then the build not reach
+--   a stable point, which is an error - detected by running with @--lint@.
+--   You should normally only call this function returning source files.
+--
+--   For an untracked variant see 'getDirectoryFilesIO'.
+getDirectoryFiles :: FilePath -> [FilePattern] -> Action [FilePath]
+getDirectoryFiles dir pat = fmap fromGetDirectoryA $ apply1 $ GetDirectoryFilesQ (dir,pat)
+
+-- | Get the directories in a directory, not including @.@ or @..@.
+--   All directories are relative to the argument directory.
+--   The result itself is tracked as a dependency, but the directories in the result are not.
+--   If the list of directories changes in subsequent builds any rule calling it will rerun.
+
+--   The rules about creating entries described in 'getDirectoryFiles' also apply here.
+--
+-- > getDirectoryDirs "/Users"
+-- >    -- Return all directories in the /Users directory
+-- >    -- e.g. ["Emily","Henry","Neil"]
+getDirectoryDirs :: FilePath -> Action [FilePath]
+getDirectoryDirs = fmap fromGetDirectoryA . apply1 . GetDirectoryDirsQ
+
+
+---------------------------------------------------------------------
+-- IO ROUTINES
+
+getDirectoryContentsIO :: FilePath -> IO [FilePath]
+-- getDirectoryContents "" is equivalent to getDirectoryContents "." on Windows,
+-- but raises an error on Linux. We smooth out the difference.
+getDirectoryContentsIO dir = fmap (sort . filter (not . all (== '.'))) $ IO.getDirectoryContents $ if dir == "" then "." else dir
+
+
+getDirectoryDirsIO :: FilePath -> IO [FilePath]
+getDirectoryDirsIO dir = filterM f =<< getDirectoryContentsIO dir
+    where f x = IO.doesDirectoryExist $ dir </> x
+
+
+-- | A version of 'getDirectoryFiles' that is in IO, and thus untracked.
+getDirectoryFilesIO :: FilePath -> [FilePattern] -> IO [FilePath]
+-- Known infelicity: on Windows, if you search for "foo", but have the file "FOO",
+-- it will match if on its own, or not if it is paired with "*", since that forces
+-- a full directory scan, and then it uses Haskell equality (case sensitive)
+getDirectoryFilesIO root pat = f "" $ snd $ walk pat
+    where
+        -- Even after we know they are there because we called contents, we still have to check they are directories/files
+        -- as required
+        f dir (Walk op) = f dir . WalkTo . op =<< getDirectoryContentsIO (root </> dir)
+        f dir (WalkTo (files, dirs)) = do
+            files <- filterM (IO.doesFileExist . (root </>)) $ map (dir </>) files
+            dirs <- concatMapM (uncurry f) =<< filterM (IO.doesDirectoryExist . (root </>) . fst) (map (first (dir </>)) dirs)
+            pure $ files ++ dirs
+
+
+---------------------------------------------------------------------
+-- REMOVE UTILITIES
+
+-- | Remove all files and directories that match any of the patterns within a directory.
+--   Some examples:
+--
+-- @
+-- 'removeFiles' \"output\" [\"\/\/*\"]        -- delete everything inside \'output\'
+-- 'removeFiles' \"output\" [\"\/\/\"]         -- delete \'output\' itself
+-- 'removeFiles' \".\" [\"\/\/*.hi\",\"\/\/*.o\"] -- delete all \'.hi\' and \'.o\' files
+-- @
+--
+--   If the argument directory is missing no error is raised.
+--   This function will follow symlinks, so should be used with care.
+--
+--   This function is often useful when writing a @clean@ action for your build system,
+--   often as a 'phony' rule.
+removeFiles :: FilePath -> [FilePattern] -> IO ()
+removeFiles dir pat =
+    whenM (IO.doesDirectoryExist dir) $ do
+        let (b,w) = walk pat
+        if b then removeDir dir else f dir w
+    where
+        f dir (Walk op) = f dir . WalkTo . op =<< getDirectoryContentsIO dir
+        f dir (WalkTo (files, dirs)) = do
+            forM_ files $ \fil ->
+                tryIO $ removeItem $ dir </> fil
+            let done = Set.fromList files
+            forM_ (filter (not . flip Set.member done . fst) dirs) $ \(d,w) -> do
+                let dir2 = dir </> d
+                whenM (IO.doesDirectoryExist dir2) $ f dir2 w
+
+        removeItem :: FilePath -> IO ()
+        removeItem x = IO.removeFile x `catchIO` \_ -> removeDir x
+
+        -- In newer GHC's removeDirectoryRecursive is probably better, but doesn't follow
+        -- symlinks, so it's got different behaviour
+        removeDir :: FilePath -> IO ()
+        removeDir x = do
+            mapM_ (removeItem . (x </>)) =<< getDirectoryContentsIO x
+            IO.removeDirectory x
+
+
+-- | Remove files, like 'removeFiles', but executed after the build completes successfully using 'runAfter'.
+--   Useful for implementing @clean@ actions that delete files Shake may have open for building, e.g. 'shakeFiles'.
+--   Where possible, delete the files as a normal part of the build, e.g. using @'liftIO' $ 'removeFiles' dir pats@.
+removeFilesAfter :: FilePath -> [FilePattern] -> Action ()
+removeFilesAfter a b = do
+    putVerbose $ "Will remove " ++ unwords b ++ " from " ++ a
+    runAfter $ removeFiles a b
diff --git a/src/Development/Shake/Internal/Rules/File.hs b/src/Development/Shake/Internal/Rules/File.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Rules/File.hs
@@ -0,0 +1,614 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables, NamedFieldPuns #-}
+{-# LANGUAGE ViewPatterns, RecordWildCards, FlexibleInstances, TypeFamilies, ConstraintKinds #-}
+
+module Development.Shake.Internal.Rules.File(
+    need, needHasChanged, needBS, needed, neededBS, want,
+    trackRead, trackWrite, trackAllow, produces,
+    defaultRuleFile,
+    (%>), (|%>), (?>), phony, (~>), phonys,
+    resultHasChanged,
+    -- * Internal only
+    FileQ(..), FileA(..), fileStoredValue, fileEqualValue, EqualCost(..), fileForward
+    ) where
+
+import Control.Monad.Extra
+import Control.Monad.IO.Class
+import Data.Typeable
+import Data.List
+import Data.Maybe
+import qualified Data.ByteString.Char8 as BS
+import qualified Data.HashSet as Set
+import Foreign.Storable
+import Data.Word
+import Data.Monoid
+import General.Binary
+import General.Extra
+
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Core.Build
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.FileName
+import Development.Shake.Internal.Rules.Rerun
+import Development.Shake.Classes
+import Development.Shake.FilePath(toStandard)
+import Development.Shake.Internal.FilePattern
+import Development.Shake.Internal.FileInfo
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Errors
+
+import System.FilePath(takeDirectory) -- important that this is the system local filepath, or wrong slashes go wrong
+import System.IO.Unsafe(unsafeInterleaveIO)
+
+import Prelude
+
+
+infix 1 %>, ?>, |%>, ~>
+
+---------------------------------------------------------------------
+-- TYPES
+
+type instance RuleResult FileQ = FileR
+
+-- | The unique key we use to index File rules, to avoid name clashes.
+newtype FileQ = FileQ {fromFileQ :: FileName}
+    deriving (Typeable,Eq,Hashable,Binary,BinaryEx,NFData)
+
+-- | Raw information about a file.
+data FileA = FileA {-# UNPACK #-} !ModTime {-# UNPACK #-} !FileSize FileHash
+    deriving (Typeable)
+
+-- | Result of a File rule, may contain raw file information and whether the rule did run this build
+data FileR = FileR { answer :: !(Maybe FileA) -- ^ Raw information about the file built by this rule.
+                                              --   Set to 'Nothing' for 'phony' files.
+                   , useLint :: !Bool       -- ^ Should we lint the resulting file
+                   }
+    deriving (Typeable)
+
+-- | The types of file rule that occur.
+data Mode
+    = ModePhony (Action ()) -- ^ An action with no file value
+    | ModeDirect (Action ()) -- ^ An action that produces this file
+    | ModeForward (Action (Maybe FileA)) -- ^ An action that looks up a file someone else produced
+
+-- | The results of the various 'Mode' rules.
+data Answer
+    = AnswerPhony
+    | AnswerDirect Ver FileA
+    | AnswerForward Ver FileA
+
+-- | The file rules we use, first is the name (as pretty as you can get).
+data FileRule = FileRule String (FilePath -> Maybe Mode)
+    deriving Typeable
+
+
+---------------------------------------------------------------------
+-- INSTANCES
+
+instance Show FileQ where show (FileQ x) = fileNameToString x
+
+instance BinaryEx [FileQ] where
+    putEx = putEx . map fromFileQ
+    getEx = map FileQ . getEx
+
+instance NFData FileA where
+    rnf (FileA a b c) = rnf a `seq` rnf b `seq` rnf c
+
+instance NFData FileR where
+    rnf (FileR a b) = rnf a `seq` rnf b
+
+instance Show FileA where
+    show (FileA m s h) = "File {mod=" ++ show m ++ ",size=" ++ show s ++ ",digest=" ++ show h ++ "}"
+
+instance Show FileR where
+    show FileR{..} = show answer
+
+instance Storable FileA where
+    sizeOf _ = 4 * 3 -- 4 Word32's
+    alignment _ = alignment (undefined :: ModTime)
+    peekByteOff p i = FileA <$> peekByteOff p i <*> peekByteOff p (i+4) <*> peekByteOff p (i+8)
+    pokeByteOff p i (FileA a b c) = pokeByteOff p i a >> pokeByteOff p (i+4) b >> pokeByteOff p (i+8) c
+
+instance BinaryEx FileA where
+    putEx = putExStorable
+    getEx = getExStorable
+
+instance BinaryEx [FileA] where
+    putEx = putExStorableList
+    getEx = getExStorableList
+
+fromAnswer :: Answer -> Maybe FileA
+fromAnswer AnswerPhony = Nothing
+fromAnswer (AnswerDirect _ x) = Just x
+fromAnswer (AnswerForward _ x) = Just x
+
+instance BinaryEx Answer where
+    putEx AnswerPhony = mempty
+    putEx (AnswerDirect ver x) = putExStorable ver <> putEx x
+    putEx (AnswerForward ver x) = putEx (0 :: Word8) <> putExStorable ver <> putEx x
+
+    getEx x = case BS.length x of
+        0 -> AnswerPhony
+        i -> if i == sz then f AnswerDirect x else f AnswerForward $ BS.tail x
+        where
+            sz = sizeOf (undefined :: Ver) + sizeOf (undefined :: FileA)
+            f ctor x = let (a,b) = binarySplit x in ctor a $ getEx b
+
+
+---------------------------------------------------------------------
+-- FILE CHECK QUERIES
+
+-- | An equality check and a cost.
+data EqualCost
+    = EqualCheap -- ^ The equality check was cheap.
+    | EqualExpensive -- ^ The equality check was expensive, as the results are not trivially equal.
+    | NotEqual -- ^ The values are not equal.
+      deriving (Eq,Ord,Show,Read,Typeable,Enum,Bounded)
+
+fileStoredValue :: ShakeOptions -> FileQ -> IO (Maybe FileA)
+fileStoredValue ShakeOptions{shakeChange=c, shakeNeedDirectory=allowDir} (FileQ x) = do
+    res <- getFileInfo allowDir x
+    case res of
+        Nothing -> pure Nothing
+        Just (time,size) | c == ChangeModtime -> pure $ Just $ FileA time size noFileHash
+        Just (time,size) -> do
+            hash <- unsafeInterleaveIO $ getFileHash x
+            pure $ Just $ FileA time size hash
+
+
+fileEqualValue :: ShakeOptions -> FileA -> FileA -> EqualCost
+fileEqualValue ShakeOptions{shakeChange=c} (FileA x1 x2 x3) (FileA y1 y2 y3) = case c of
+    ChangeModtime -> bool $ x1 == y1
+    ChangeDigest -> bool $ x2 == y2 && x3 == y3
+    ChangeModtimeOrDigest -> bool $ x1 == y1 && x2 == y2 && x3 == y3
+    _ | x1 == y1 -> EqualCheap
+      | x2 == y2 && x3 == y3 -> EqualExpensive
+      | otherwise -> NotEqual
+    where bool b = if b then EqualCheap else NotEqual
+
+
+-- | Arguments: options; is the file an input; a message for failure if the file does not exist; filename
+storedValueError :: ShakeOptions -> Bool -> String -> FileQ -> IO (Maybe FileA)
+{-
+storedValueError opts False msg x | False && not (shakeOutputCheck opts) = do
+    when (shakeCreationCheck opts) $ do
+        whenM (isNothing <$> (storedValue opts x :: IO (Maybe FileA))) $ error $ msg ++ "\n  " ++ unpackU (fromFileQ x)
+    pure $ FileA fileInfoEq fileInfoEq fileInfoEq
+-}
+storedValueError opts input msg x = maybe def Just <$> fileStoredValue opts2 x
+    where def = if shakeCreationCheck opts || input then error err else Nothing
+          err = msg ++ "\n  " ++ fileNameToString (fromFileQ x)
+          opts2 = if not input && shakeChange opts == ChangeModtimeAndDigestInput then opts{shakeChange=ChangeModtime} else opts
+
+
+---------------------------------------------------------------------
+-- THE DEFAULT RULE
+
+defaultRuleFile :: Rules ()
+defaultRuleFile = do
+    opts@ShakeOptions{..} <- getShakeOptionsRules
+    -- A rule from FileQ to (Maybe FileA). The result value is only useful for linting.
+    addBuiltinRuleEx (ruleLint opts) (ruleIdentity opts) (ruleRun opts $ shakeRebuildApply opts)
+
+ruleLint :: ShakeOptions -> BuiltinLint FileQ FileR
+ruleLint opts k (FileR (Just v) True) = do
+    now <- fileStoredValue opts k
+    pure $ case now of
+        Nothing -> Just "<missing>"
+        Just now | fileEqualValue opts v now == EqualCheap -> Nothing
+                 | otherwise -> Just $ show now
+ruleLint _ _ _ = pure Nothing
+
+ruleIdentity :: ShakeOptions -> BuiltinIdentity FileQ FileR
+ruleIdentity opts | shakeChange opts == ChangeModtime = throwImpure errorNoHash
+ruleIdentity _ = \k v -> case answer v of
+    Just (FileA _ size hash) -> Just $ runBuilder $ putExStorable size <> putExStorable hash
+    Nothing -> Nothing
+
+ruleRun :: ShakeOptions -> (FilePath -> Rebuild) -> BuiltinRun FileQ FileR
+ruleRun opts@ShakeOptions{..} rebuildFlags o@(FileQ (fileNameToString -> xStr)) oldBin@(fmap getEx -> (old :: Maybe Answer)) mode = do
+    -- for One, rebuild makes perfect sense
+    -- for Forward, we expect the child will have already rebuilt - Rebuild just lets us deal with code changes
+    -- for Phony, it doesn't make that much sense, but probably isn't harmful?
+    let r = rebuildFlags xStr
+
+    (ruleVer, ruleAct, ruleErr) <- getUserRuleInternal o (\(FileRule s _) -> Just s) $ \(FileRule _ f) -> f xStr
+    let verEq v = Just v == ruleVer || case ruleAct of [] -> v == Ver 0; [(v2,_)] -> v == Ver v2; _ -> False
+    let rebuild = do
+            putWhen Verbose $ "# " ++ show o
+            case ruleAct of
+                [] -> rebuildWith Nothing
+                [x] -> rebuildWith $ Just x
+                _ -> throwM ruleErr
+
+    case old of
+        _ | r == RebuildNow -> rebuild
+        _ | r == RebuildLater -> case old of
+            Just _ ->
+                -- ignoring the currently stored value, which may trigger lint has changed
+                -- so disable lint on this file
+                unLint <$> retOld ChangedNothing
+            Nothing -> do
+                -- i don't have a previous value, so assume this is a source node, and mark rebuild in future
+                now <- liftIO $ fileStoredValue opts o
+                case now of
+                    Nothing -> rebuild
+                    Just now -> do alwaysRerun; retNew ChangedStore $ AnswerDirect (Ver 0) now
+        {-
+        _ | r == RebuildNever -> do
+            now <- liftIO $ fileStoredValue opts o
+            case now of
+                Nothing -> rebuild
+                Just now -> do
+                    let diff | Just (AnswerDirect old) <- old, fileEqualValue opts old now /= NotEqual = ChangedRecomputeSame
+                                | otherwise = ChangedRecomputeDiff
+                    retNew diff $ AnswerDirect now
+        -}
+        Just (AnswerDirect ver old) | mode == RunDependenciesSame, verEq ver -> do
+            now <- liftIO $ fileStoredValue opts o
+            let noHash (FileA _ _ x) = isNoFileHash x
+            case now of
+                Nothing -> rebuild
+                Just now -> case fileEqualValue opts old now of
+                    NotEqual ->
+                        rebuild
+                    -- if our last build used no file hashing, but this build should, then we must refresh the hash
+                    EqualCheap | if noHash old then shakeChange == ChangeModtimeAndDigestInput || noHash now else True ->
+                        retOld ChangedNothing
+                    _ ->
+                        retNew ChangedStore $ AnswerDirect ver now
+        Just (AnswerForward ver _) | verEq ver, mode == RunDependenciesSame -> retOld ChangedNothing
+        _ -> rebuild
+    where
+        -- no need to lint check forward files
+        -- but more than that, it goes wrong if you do, see #427
+        fileR (AnswerDirect _ x) = FileR (Just x) True
+        fileR (AnswerForward _ x) = FileR (Just x) False
+        fileR AnswerPhony = FileR Nothing False
+        unLint (RunResult a b c) = RunResult a b c{useLint = False}
+
+        retNew :: RunChanged -> Answer -> Action (RunResult FileR)
+        retNew c v = pure $ RunResult c (runBuilder $ putEx v) $ fileR v
+
+        retOld :: RunChanged -> Action (RunResult FileR)
+        retOld c = pure $ RunResult c (fromJust oldBin) $ fileR (fromJust old)
+
+        -- actually run the rebuild
+        rebuildWith act = do
+            let answer ctor new = do
+                    let b = case () of
+                                _ | Just old <- old
+                                    , Just old <- fromAnswer old
+                                    , fileEqualValue opts old new /= NotEqual -> ChangedRecomputeSame
+                                _ -> ChangedRecomputeDiff
+                    retNew b $ ctor new
+            case act of
+                Nothing -> do
+                    new <- liftIO $ storedValueError opts True "Error, file does not exist and no rule available:" o
+                    answer (AnswerDirect $ Ver 0)  $ fromJust new
+                Just (ver, ModeForward act) -> do
+                    new <- act
+                    case new of
+                        Nothing -> do
+                            -- Not 100% sure how you get here, but I think it involves RebuildLater and multi-file rules
+                            historyDisable
+                            retNew ChangedRecomputeDiff AnswerPhony
+                        Just new -> answer (AnswerForward $ Ver ver) new
+                Just (ver, ModeDirect act) -> do
+                    cache <- historyLoad ver
+                    case cache of
+                        Just encodedHash -> do
+                            Just (FileA mod size _) <- liftIO $ storedValueError opts False "Error, restored the rule but did not produce file:" o
+                            answer (AnswerDirect $ Ver ver) $ FileA mod size $ getExStorable encodedHash
+                        Nothing -> do
+                            act
+                            new <- liftIO $ storedValueError opts False "Error, rule finished running but did not produce file:" o
+                            case new of
+                                Nothing -> do
+                                    -- rule ran, but didn't compute an answer, because shakeCreationCheck=False
+                                    -- I think it should probably not return phony, but return a different valid-but-no-file
+                                    -- but it's just too rare to bother
+                                    historyDisable
+                                    retNew ChangedRecomputeDiff AnswerPhony
+                                Just new@(FileA _ _ fileHash) -> do
+                                    producesUnchecked [xStr]
+                                    res <- answer (AnswerDirect $ Ver ver) new
+                                    historySave ver $ runBuilder $
+                                        if isNoFileHash fileHash then throwImpure errorNoHash else putExStorable fileHash
+                                    pure res
+                Just (_, ModePhony act) -> do
+                    -- See #523 and #524
+                    -- Shake runs the dependencies first, but stops when one has changed.
+                    -- We don't want to run the existing deps first if someone changes the build system,
+                    -- so insert a fake dependency that cuts the process dead.
+                    alwaysRerun
+                    act
+                    retNew ChangedRecomputeDiff AnswerPhony
+
+
+apply_ :: Partial => (a -> FileName) -> [a] -> Action [FileR]
+apply_ f = apply . map (FileQ . f)
+
+
+-- | Has a file changed. This function will only give the correct answer if called in the rule
+--   producing the file, /before/ the rule has modified the file in question.
+--   Best avoided, but sometimes necessary in conjunction with 'needHasChanged' to cause rebuilds
+--   to happen if the result is deleted or modified.
+resultHasChanged :: FilePath -> Action Bool
+resultHasChanged file = do
+    let filename = FileQ $ fileNameFromString file
+    res <- getDatabaseValue filename
+    old<- pure $ case result <$> res of
+        Nothing -> Nothing
+        Just (Left bs) -> fromAnswer $ getEx bs
+        Just (Right v) -> answer v
+    case old of
+        Nothing -> pure True
+        Just old -> do
+            opts <- getShakeOptions
+            new <- liftIO $ fileStoredValue opts filename
+            pure $ case new of
+                Nothing -> True
+                Just new -> fileEqualValue opts old new == NotEqual
+
+
+---------------------------------------------------------------------
+-- OPTIONS ON TOP
+
+-- | Internal method for adding forwarding actions
+fileForward :: String -> (FilePath -> Maybe (Action (Maybe FileA))) -> Rules ()
+fileForward help act = addUserRule $ FileRule help $ fmap ModeForward . act
+
+
+-- | Add a dependency on the file arguments, ensuring they are built before continuing.
+--   The file arguments may be built in parallel, in any order. This function is particularly
+--   necessary when calling 'Development.Shake.cmd' or 'Development.Shake.command'. As an example:
+--
+-- @
+-- \"\/\/*.rot13\" '%>' \\out -> do
+--     let src = 'Development.Shake.FilePath.dropExtension' out
+--     'need' [src]
+--     'Development.Shake.cmd' \"rot13\" [src] \"-o\" [out]
+-- @
+--
+--   Note that the following expressions are all equivalent. @foo@ and @bar@ are built in parallel:
+--
+--   - @need [foo,bar]@
+--   - @need [foo] '*>' need [bar]@
+--   - @need [foo] '>>' need [bar]@
+--
+--   In this situation, @need [foo, bar]@ is preferable, since the parallelism is the most obvious.
+--
+--   This function should not be called with wildcards (e.g. @*.txt@ - use 'getDirectoryFiles' to expand them),
+--   environment variables (e.g. @$HOME@ - use 'getEnv' to expand them) or directories (directories cannot be
+--   tracked directly - track files within the directory instead).
+need :: Partial => [FilePath] -> Action ()
+need = withFrozenCallStack $ void . apply_ fileNameFromString
+
+
+-- | Like 'need' but returns a list of rebuilt dependencies since the calling rule last built successfully.
+--
+--   The following example writes a list of changed dependencies to a file as its action.
+--
+-- @
+-- \"target\" '%>' \\out -> do
+--       let sourceList = [\"source1\", \"source2\"]
+--       rebuildList <- 'needHasChanged' sourceList
+--       'Development.Shake.writeFileLines' out rebuildList
+-- @
+--
+--   This function can be used to alter the action depending on which dependency needed
+--   to be rebuild.
+--
+--   Note that a rule can be run even if no dependency has changed, for example
+--   because of 'shakeRebuild' or because the target has changed or been deleted.
+--   To detect the latter case you may wish to use 'resultHasChanged'.
+needHasChanged :: Partial => [FilePath] -> Action [FilePath]
+needHasChanged paths = withFrozenCallStack $ do
+    apply_ fileNameFromString paths
+    self <- getCurrentKey
+    selfVal <- case self of
+        Nothing -> pure Nothing
+        Just self -> getDatabaseValueGeneric self
+    case selfVal of
+        Nothing -> pure paths -- never build before or not a key, so everything has changed
+        Just selfVal -> flip filterM paths $ \path -> do
+            pathVal <- getDatabaseValue (FileQ $ fileNameFromString path)
+            pure $ case pathVal of
+                Just pathVal | changed pathVal > built selfVal -> True
+                _ -> False
+
+
+needBS :: Partial => [BS.ByteString] -> Action ()
+needBS = withFrozenCallStack $ void . apply_ fileNameFromByteString
+
+-- | Like 'need', but if 'shakeLint' is set, check that the file does not rebuild.
+--   Used for adding dependencies on files that have already been used in this rule.
+needed :: Partial => [FilePath] -> Action ()
+needed xs = withFrozenCallStack $ do
+    opts <- getShakeOptions
+    if isNothing $ shakeLint opts then need xs else neededCheck $ map fileNameFromString xs
+
+
+neededBS :: Partial => [BS.ByteString] -> Action ()
+neededBS xs = withFrozenCallStack $ do
+    opts <- getShakeOptions
+    if isNothing $ shakeLint opts then needBS xs else neededCheck $ map fileNameFromByteString xs
+
+
+neededCheck :: Partial => [FileName] -> Action ()
+neededCheck xs = withFrozenCallStack $ do
+    opts <- getShakeOptions
+    pre <- liftIO $ mapM (fileStoredValue opts . FileQ) xs
+    post <- apply_ id xs
+    let bad = [ (x, if isJust a then "File change" else "File created")
+              | (x, a, FileR (Just b) _) <- zip3 xs pre post, maybe NotEqual (\a -> fileEqualValue opts a b) a == NotEqual]
+    case bad of
+        [] -> pure ()
+        (file,msg):_ -> throwM $ errorStructured
+            "Lint checking error - 'needed' file required rebuilding"
+            [("File", Just $ fileNameToString file)
+            ,("Error",Just msg)]
+            ""
+
+
+-- Either trackRead or trackWrite
+track :: ([FileQ] -> Action ()) -> [FilePath] -> Action ()
+track tracker xs = do
+    ShakeOptions{shakeLintIgnore} <- getShakeOptions
+    let ignore = (?==*) shakeLintIgnore
+    let ys = filter (not . ignore) xs
+    when (ys /= []) $
+        tracker $ map (FileQ . fileNameFromString) ys
+
+
+-- | Track that a file was read by the action preceding it. If 'shakeLint' is activated
+--   then these files must be dependencies of this rule. Calls to 'trackRead' are
+--   automatically inserted in 'LintFSATrace' mode.
+trackRead :: [FilePath] -> Action ()
+trackRead = track lintTrackRead
+
+
+-- | Track that a file was written by the action preceding it. If 'shakeLint' is activated
+--   then these files must either be the target of this rule, or never referred to by the build system.
+--   Calls to 'trackWrite' are automatically inserted in 'LintFSATrace' mode.
+trackWrite :: [FilePath] -> Action ()
+trackWrite = track lintTrackWrite
+
+-- | Allow accessing a file in this rule, ignoring any subsequent 'trackRead' \/ 'trackWrite' calls matching
+--   the pattern.
+trackAllow :: [FilePattern] -> Action ()
+trackAllow ps = do
+    let ignore = (?==*) ps
+    lintTrackAllow $ \(FileQ x) -> ignore $ fileNameToString x
+
+
+-- | This rule builds the following files, in addition to any defined by its target.
+--   At the end of the rule these files must have been written.
+--   These files must /not/ be tracked as part of the build system - two rules cannot produce
+--   the same file and you cannot 'need' the files it produces.
+produces :: [FilePath] -> Action ()
+produces xs = do
+    producesChecked xs
+    trackWrite xs
+
+
+-- | Require that the argument files are built by the rules, used to specify the target.
+--
+-- @
+-- main = 'Development.Shake.shake' 'shakeOptions' $ do
+--    'want' [\"Main.exe\"]
+--    ...
+-- @
+--
+--   This program will build @Main.exe@, given sufficient rules. All arguments to all 'want' calls
+--   may be built in parallel, in any order.
+--
+--   This function is defined in terms of 'action' and 'need', use 'action' if you need more complex
+--   targets than 'want' allows.
+want :: Partial => [FilePath] -> Rules ()
+want [] = pure ()
+want xs = withFrozenCallStack $ action $ need xs
+
+
+root :: String -> (FilePath -> Bool) -> (FilePath -> Action ()) -> Rules ()
+root help test act = addUserRule $ FileRule help $ \x -> if not $ test x then Nothing else Just $ ModeDirect $ do
+    liftIO $ createDirectoryRecursive $ takeDirectory x
+    act x
+
+
+-- | Declare a Make-style phony action.  A phony target does not name
+--   a file (despite living in the same namespace as file rules);
+--   rather, it names some action to be executed when explicitly
+--   requested.  You can demand 'phony' rules using 'want'. (And 'need',
+--   although that's not recommended.)
+--
+--   Phony actions are intended to define recipes that can be executed
+--   by the user. If you 'need' a phony action in a rule then every
+--   execution where that rule is required will rerun both the rule and
+--   the phony action.  However, note that phony actions are never
+--   executed more than once in a single build run.
+--
+--   In make, the @.PHONY@ attribute on non-file-producing rules has a
+--   similar effect.  However, while in make it is acceptable to omit
+--   the @.PHONY@ attribute as long as you don't create the file in
+--   question, a Shake rule which behaves this way will fail lint.
+--   For file-producing rules which should be
+--   rerun every execution of Shake, see 'Development.Shake.alwaysRerun'.
+phony :: Located => String -> Action () -> Rules ()
+phony oname@(toStandard -> name) act = do
+    addTarget oname
+    addPhony ("phony " ++ show oname ++ " at " ++ callStackTop) $ \s -> if s == name then Just act else Nothing
+
+-- | A predicate version of 'phony', return 'Just' with the 'Action' for the matching rules.
+phonys :: Located => (String -> Maybe (Action ())) -> Rules ()
+phonys = addPhony ("phonys at " ++ callStackTop)
+
+-- | Infix operator alias for 'phony', for sake of consistency with normal
+--   rules.
+(~>) :: Located => String -> Action () -> Rules ()
+(~>) oname@(toStandard -> name) act = do
+    addTarget oname
+    addPhony (show oname ++ " ~> at " ++ callStackTop) $ \s -> if s == name then Just act else Nothing
+
+addPhony :: String -> (String -> Maybe (Action ())) -> Rules ()
+addPhony help act = addUserRule $ FileRule help $ fmap ModePhony . act
+
+
+-- | Define a rule to build files. If the first argument returns 'True' for a given file,
+--   the second argument will be used to build it. Usually '%>' is sufficient, but '?>' gives
+--   additional power. For any file used by the build system, only one rule should return 'True'.
+--   This function will create the directory for the result file, if necessary.
+--
+-- @
+-- (all isUpper . 'Development.Shake.FilePath.takeBaseName') '?>' \\out -> do
+--     let src = 'Development.Shake.FilePath.replaceBaseName' out $ map toLower $ takeBaseName out
+--     'Development.Shake.writeFile'' out . map toUpper =<< 'Development.Shake.readFile'' src
+-- @
+--
+--   If the 'Action' completes successfully the file is considered up-to-date, even if the file
+--   has not changed.
+(?>) :: Located => (FilePath -> Bool) -> (FilePath -> Action ()) -> Rules ()
+(?>) test act = priority 0.5 $ root ("?> at " ++ callStackTop) test act
+
+
+-- | Define a set of patterns, and if any of them match, run the associated rule. Defined in terms of '%>'.
+--   Think of it as the OR (@||@) equivalent of '%>'.
+(|%>) :: Located => [FilePattern] -> (FilePath -> Action ()) -> Rules ()
+(|%>) pats act = do
+    mapM_ addTarget pats
+    let (simp,other) = partition simple pats
+    case map toStandard simp of
+        [] -> pure ()
+        [p] -> root help (\x -> toStandard x == p) act
+        ps -> let set = Set.fromList ps in root help (flip Set.member set . toStandard) act
+    unless (null other) $
+        let ps = map (?==) other in priority 0.5 $ root help (\x -> any ($ x) ps) act
+    where help = show pats ++ " |%> at " ++ callStackTop
+
+-- | Define a rule that matches a 'FilePattern', see '?==' for the pattern rules.
+--   Patterns with no wildcards have higher priority than those with wildcards, and no file
+--   required by the system may be matched by more than one pattern at the same priority
+--   (see 'priority' and 'alternatives' to modify this behaviour).
+--   This function will create the directory for the result file, if necessary.
+--
+-- @
+-- \"*.asm.o\" '%>' \\out -> do
+--     let src = 'Development.Shake.FilePath.dropExtension' out
+--     'need' [src]
+--     'Development.Shake.cmd' \"as\" [src] \"-o\" [out]
+-- @
+--
+--   To define a build system for multiple compiled languages, we recommend using @.asm.o@,
+--   @.cpp.o@, @.hs.o@, to indicate which language produces an object file.
+--   I.e., the file @foo.cpp@ produces object file @foo.cpp.o@.
+--
+--   Note that matching is case-sensitive, even on Windows.
+--
+--   If the 'Action' completes successfully the file is considered up-to-date, even if the file
+--   has not changed.
+(%>) :: Located => FilePattern -> (FilePath -> Action ()) -> Rules ()
+(%>) test act = withFrozenCallStack $
+    (if simple test then id else priority 0.5) $ do
+        addTarget test
+        root (show test ++ " %> at " ++ callStackTop) (test ?==) act
diff --git a/src/Development/Shake/Internal/Rules/Files.hs b/src/Development/Shake/Internal/Rules/Files.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Rules/Files.hs
@@ -0,0 +1,249 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-}
+{-# LANGUAGE ViewPatterns, TypeFamilies, ConstraintKinds #-}
+
+module Development.Shake.Internal.Rules.Files(
+    (&?>), (&%>), defaultRuleFiles
+    ) where
+
+import Control.Monad
+import Control.Monad.IO.Class
+import Data.Maybe
+import Data.List.Extra
+import Data.Typeable
+import General.Binary
+
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.Core.Types hiding (Result)
+import Development.Shake.Internal.Core.Build
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Errors
+import General.Extra
+import Development.Shake.Internal.FileName
+import Development.Shake.Classes
+import Development.Shake.Internal.Rules.Rerun
+import Development.Shake.Internal.Rules.File
+import Development.Shake.Internal.FilePattern
+import Development.Shake.FilePath
+import Development.Shake.Internal.FileInfo
+import Development.Shake.Internal.Options
+import Data.Monoid
+import Prelude
+
+
+infix 1 &?>, &%>
+
+
+type instance RuleResult FilesQ = FilesA
+
+newtype FilesQ = FilesQ {fromFilesQ :: [FileQ]}
+    deriving (Typeable,Eq,Hashable,Binary,BinaryEx,NFData)
+
+newtype FilesA = FilesA [FileA]
+    deriving (Typeable,BinaryEx,NFData)
+
+instance Show FilesA where show (FilesA xs) = unwords $ "Files" : map (drop 5 . show) xs
+
+instance Show FilesQ where show (FilesQ xs) = unwords $ map (wrapQuote . show) xs
+
+data FilesRule = FilesRule String (FilesQ -> Maybe (Action FilesA))
+    deriving Typeable
+
+data Result = Result Ver FilesA
+
+instance BinaryEx Result where
+    putEx (Result v x) = putExStorable v <> putEx x
+    getEx s = let (a,b) = binarySplit s in Result a $ getEx b
+
+
+filesStoredValue :: ShakeOptions -> FilesQ -> IO (Maybe FilesA)
+filesStoredValue opts (FilesQ xs) = fmap FilesA . sequence <$> mapM (fileStoredValue opts) xs
+
+filesEqualValue :: ShakeOptions -> FilesA -> FilesA -> EqualCost
+filesEqualValue opts (FilesA xs) (FilesA ys)
+    | length xs /= length ys = NotEqual
+    | otherwise = foldr and_ EqualCheap $ zipWithExact (fileEqualValue opts) xs ys
+        where and_ NotEqual _ = NotEqual
+              and_ EqualCheap x = x
+              and_ EqualExpensive x = if x == NotEqual then NotEqual else EqualExpensive
+
+defaultRuleFiles :: Rules ()
+defaultRuleFiles = do
+    opts <- getShakeOptionsRules
+    -- A rule from FilesQ to FilesA. The result value is only useful for linting.
+    addBuiltinRuleEx (ruleLint opts) (ruleIdentity opts) (ruleRun opts $ shakeRebuildApply opts)
+
+ruleLint :: ShakeOptions -> BuiltinLint FilesQ FilesA
+ruleLint _ _ (FilesA []) = pure Nothing -- in the case of disabling lint
+ruleLint opts k v = do
+    now <- filesStoredValue opts k
+    pure $ case now of
+        Nothing -> Just "<missing>"
+        Just now | filesEqualValue opts v now == EqualCheap -> Nothing
+                 | otherwise -> Just $ show now
+
+ruleIdentity :: ShakeOptions -> BuiltinIdentity FilesQ FilesA
+ruleIdentity opts | shakeChange opts == ChangeModtime = throwImpure $ errorStructured
+    "Cannot use shakeChange=ChangeModTime with shakeShare" [] ""
+ruleIdentity _ = \_ (FilesA files) ->
+    Just $ runBuilder $ putExList [putExStorable size <> putExStorable hash | FileA _ size hash <- files]
+
+
+
+ruleRun :: ShakeOptions -> (FilePath -> Rebuild) -> BuiltinRun FilesQ FilesA
+ruleRun opts rebuildFlags k o@(fmap getEx -> (old :: Maybe Result)) mode = do
+    let r = map (rebuildFlags . fileNameToString . fromFileQ) $ fromFilesQ k
+
+    (ruleVer, ruleAct, ruleErr) <- getUserRuleInternal k (\(FilesRule s _) -> Just s) $ \(FilesRule _ f) -> f k
+    let verEq v = Just v == ruleVer || map (Ver . fst) ruleAct == [v]
+    let rebuild = do
+            putWhen Verbose $ "# " ++ show k
+            case ruleAct of
+                [x] -> rebuildWith x
+                _ -> throwM ruleErr
+
+    case old of
+        _ | RebuildNow `elem` r -> rebuild
+        _ | RebuildLater `elem` r -> case old of
+            Just _ ->
+                -- ignoring the currently stored value, which may trigger lint has changed
+                -- so disable lint on this file
+                pure $ RunResult ChangedNothing (fromJust o) $ FilesA []
+            Nothing -> do
+                -- i don't have a previous value, so assume this is a source node, and mark rebuild in future
+                now <- liftIO $ filesStoredValue opts k
+                case now of
+                    Nothing -> rebuild
+                    Just now -> do alwaysRerun; pure $ RunResult ChangedStore (runBuilder $ putEx $ Result (Ver 0) now) now
+        Just (Result ver old) | mode == RunDependenciesSame, verEq ver -> do
+            v <- liftIO $ filesStoredValue opts k
+            case v of
+                Just v -> case filesEqualValue opts old v of
+                    NotEqual -> rebuild
+                    -- See #810, important we pass old (which can be cheaply evaluated)
+                    -- and not v, which might have some lazily-evaluated file hashes in
+                    EqualCheap -> pure $ RunResult ChangedNothing (fromJust o) old
+                    EqualExpensive -> pure $ RunResult ChangedStore (runBuilder $ putEx $ Result ver v) v
+                Nothing -> rebuild
+        _ -> rebuild
+    where
+        rebuildWith (ver, act) = do
+            cache <- historyLoad ver
+            v <- case cache of
+                Just res ->
+                    fmap FilesA $ forM (zipExact (getExList res) (fromFilesQ k)) $ \(bin, file) -> do
+                        Just (FileA mod size _) <- liftIO $ fileStoredValue opts file
+                        pure $ FileA mod size $ getExStorable bin
+                Nothing -> do
+                    FilesA v <- act
+                    producesUnchecked $ map (fileNameToString . fromFileQ) $ fromFilesQ k
+                    historySave ver $ runBuilder $ putExList
+                        [if isNoFileHash hash then throwImpure errorNoHash else putExStorable hash | FileA _ _ hash <- v]
+                    pure $ FilesA v
+            let c | Just (Result _ old) <- old, filesEqualValue opts old v /= NotEqual = ChangedRecomputeSame
+                  | otherwise = ChangedRecomputeDiff
+            pure $ RunResult c (runBuilder $ putEx $ Result (Ver ver) v) v
+
+
+
+-- | Define a rule for building multiple files at the same time.
+--   Think of it as the AND (@&&@) equivalent of '%>'.
+--   As an example, a single invocation of GHC produces both @.hi@ and @.o@ files:
+--
+-- @
+-- [\"*.o\",\"*.hi\"] '&%>' \\[o,hi] -> do
+--     let hs = o 'Development.Shake.FilePath.-<.>' \"hs\"
+--     'Development.Shake.need' ... -- all files the .hs import
+--     'Development.Shake.cmd' \"ghc -c\" [hs]
+-- @
+--
+--   However, in practice, it's usually easier to define rules with '%>' and make the @.hi@ depend
+--   on the @.o@. When defining rules that build multiple files, all the 'FilePattern' values must
+--   have the same sequence of @\/\/@ and @*@ wildcards in the same order.
+--   This function will create directories for the result files, if necessary.
+(&%>) :: Located => [FilePattern] -> ([FilePath] -> Action ()) -> Rules ()
+[p] &%> act = withFrozenCallStack $ p %> act . pure
+ps &%> act
+    | not $ compatible ps = error $ unlines $
+        "All patterns to &%> must have the same number and position of ** and * wildcards" :
+        ["* " ++ p ++ (if compatible [p, headErr ps] then "" else " (incompatible)") | p <- ps]
+    | otherwise = withFrozenCallStack $ do
+        forM_ (zipFrom 0 ps) $ \(i,p) ->
+            (if simple p then id else priority 0.5) $
+                fileForward (show ps ++ " &%> at " ++ callStackTop) $ let op = (p ?==) in \file -> if not $ op file then Nothing else Just $ do
+                    FilesA res <- apply1 $ FilesQ $ map (FileQ . fileNameFromString . substitute (extract p file)) ps
+                    pure $ if null res then Nothing else Just $ res !! i
+        (if all simple ps then id else priority 0.5) $ do
+            mapM_ addTarget ps
+            addUserRule $ FilesRule (show ps ++ " &%> " ++ callStackTop) $ \(FilesQ xs_) -> let xs = map (fileNameToString . fromFileQ) xs_ in
+                if not $ length xs == length ps && and (zipWithExact (?==) ps xs) then Nothing else Just $ do
+                    liftIO $ mapM_ createDirectoryRecursive $ nubOrd $ map takeDirectory xs
+                    trackAllow xs
+                    act xs
+                    getFileTimes "&%>" xs_
+
+
+-- | Define a rule for building multiple files at the same time, a more powerful
+--   and more dangerous version of '&%>'. Think of it as the AND (@&&@) equivalent of '?>'.
+--
+--   Given an application @test &?> ...@, @test@ should return @Just@ if the rule applies, and should
+--   return the list of files that will be produced. This list /must/ include the file passed as an argument and should
+--   obey the invariant:
+--
+-- > forAll $ \x ys -> test x == Just ys ==> x `elem` ys && all ((== Just ys) . test) ys
+--
+--   Intuitively, the function defines a set partitioning, mapping each element to the partition that contains it.
+--   As an example of a function satisfying the invariant:
+--
+-- @
+-- test x | 'Development.Shake.FilePath.takeExtension' x \`elem\` [\".hi\",\".o\"]
+--        = Just ['Development.Shake.FilePath.dropExtension' x 'Development.Shake.FilePath.<.>' \"hi\", 'Development.Shake.FilePath.dropExtension' x 'Development.Shake.FilePath.<.>' \"o\"]
+-- test _ = Nothing
+-- @
+--
+--   Regardless of whether @Foo.hi@ or @Foo.o@ is passed, the function always returns @[Foo.hi, Foo.o]@.
+(&?>) :: Located => (FilePath -> Maybe [FilePath]) -> ([FilePath] -> Action ()) -> Rules ()
+(&?>) test act = priority 0.5 $ do
+    let inputOutput suf inp out =
+            ["Input" ++ suf ++ ":", "  " ++ inp] ++
+            ["Output" ++ suf ++ ":"] ++ map ("  "++) out
+    let normTest = fmap (map $ toStandard . normaliseEx) . test
+    let checkedTest x = case normTest x of
+            Nothing -> Nothing
+            Just ys | x `notElem` ys -> error $ unlines $
+                "Invariant broken in &?>, did not pure the input (after normalisation)." :
+                inputOutput "" x ys
+            Just ys | bad:_ <- filter ((/= Just ys) . normTest) ys -> error $ unlines $
+                ["Invariant broken in &?>, not equalValue for all arguments (after normalisation)."] ++
+                inputOutput "1" x ys ++
+                inputOutput "2" bad (fromMaybe ["Nothing"] $ normTest bad)
+            Just ys -> Just ys
+
+    fileForward ("&?> at " ++ callStackTop) $ \x -> case checkedTest x of
+        Nothing -> Nothing
+        Just ys -> Just $ do
+            FilesA res <- apply1 $ FilesQ $ map (FileQ . fileNameFromString) ys
+            pure $ if null res then Nothing else Just $ res !! fromJust (elemIndex x ys)
+
+    addUserRule $ FilesRule ("&?> " ++ callStackTop) $ \(FilesQ xs_) -> let xs@(x:_) = map (fileNameToString . fromFileQ) xs_ in
+        case checkedTest x of
+            Just ys | ys == xs -> Just $ do
+                liftIO $ mapM_ createDirectoryRecursive $ nubOrd $ map takeDirectory xs
+                act xs
+                getFileTimes "&?>" xs_
+            Just ys -> error $ "Error, &?> is incompatible with " ++ show xs ++ " vs " ++ show ys
+            Nothing -> Nothing
+
+
+getFileTimes :: String -> [FileQ] -> Action FilesA
+getFileTimes name xs = do
+    opts <- getShakeOptions
+    let opts2 = if shakeChange opts == ChangeModtimeAndDigestInput then opts{shakeChange=ChangeModtime} else opts
+    ys <- liftIO $ mapM (fileStoredValue opts2) xs
+    case sequence ys of
+        Just ys -> pure $ FilesA ys
+        Nothing | not $ shakeCreationCheck opts -> pure $ FilesA []
+        Nothing -> do
+            let missing = length $ filter isNothing ys
+            error $ "Error, " ++ name ++ " rule failed to produce " ++ show missing ++
+                    " file" ++ (if missing == 1 then "" else "s") ++ " (out of " ++ show (length xs) ++ ")" ++
+                    concat ["\n  " ++ fileNameToString x ++ if isNothing y then " - MISSING" else "" | (FileQ x,y) <- zipExact xs ys]
diff --git a/src/Development/Shake/Internal/Rules/Oracle.hs b/src/Development/Shake/Internal/Rules/Oracle.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Rules/Oracle.hs
@@ -0,0 +1,163 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-}
+{-# LANGUAGE TypeFamilies, TypeOperators, ConstraintKinds #-}
+
+module Development.Shake.Internal.Rules.Oracle(
+    addOracle, addOracleCache, addOracleHash,
+    askOracle, askOracles
+    ) where
+
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Options
+import Development.Shake.Internal.Core.Build
+import Development.Shake.Internal.Value
+import Development.Shake.Classes
+import qualified Data.ByteString as BS
+import qualified Data.ByteString.Lazy as LBS
+import Control.Monad
+import Data.Binary
+import General.Binary
+import General.Extra
+
+
+-- Use short type names, since the names appear in the Haddock, and are too long if they are in full
+newtype OracleQ question = OracleQ question
+    deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
+newtype OracleA answer = OracleA answer
+    deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
+
+fromOracleA :: OracleA a -> a
+fromOracleA (OracleA x) = x
+
+type instance RuleResult (OracleQ a) = OracleA (RuleResult a)
+
+data Flavor = Norm | Cache | Hash deriving Eq
+
+addOracleFlavor :: (Located, RuleResult q ~ a, ShakeValue q, ShakeValue a) => Flavor -> (q -> Action a) -> Rules (q -> Action a)
+addOracleFlavor flavor act = do
+        -- rebuild is automatic for oracles, skip just means we don't rebuild
+        opts <- getShakeOptionsRules
+        let skip = shakeRebuildApply opts "" == RebuildLater
+
+        addBuiltinRule noLint (\_ v -> Just $ runBuilder $ putEx $ hash v) $ \(OracleQ q) old mode -> case old of
+            Just old | (flavor /= Hash && skip) || (flavor == Cache && mode == RunDependenciesSame) ->
+                pure $ RunResult ChangedNothing old $ decode' old
+            _ -> do
+                -- can only use cmpHash if flavor == Hash
+                let cmpValue new = if fmap decode' old == Just new then ChangedRecomputeSame else ChangedRecomputeDiff
+                let cmpHash newHash = if old == Just newHash then ChangedRecomputeSame else ChangedRecomputeDiff
+
+                cache <- if flavor == Cache then historyLoad 0 else pure Nothing
+                case cache of
+                    Just newEncode -> do
+                        let new = decode' newEncode
+                        pure $ RunResult (cmpValue new) newEncode new
+                    Nothing -> do
+                        new <- OracleA <$> act q
+                        let newHash = encodeHash new
+                        let newEncode = encode' new
+                        when (flavor == Cache) $
+                            historySave 0 newEncode
+                        pure $
+                            if flavor == Hash
+                                then RunResult (cmpHash newHash) newHash new
+                                else RunResult (cmpValue new) newEncode new
+        pure askOracle
+    where
+        encodeHash :: Hashable a => a -> BS.ByteString
+        encodeHash = runBuilder . putEx . hash
+
+        encode' :: Binary a => a -> BS.ByteString
+        encode' = BS.concat . LBS.toChunks . encode
+
+        decode' :: Binary a => BS.ByteString -> a
+        decode' = decode . LBS.fromChunks . pure
+
+
+-- | Add extra information which rules can depend on.
+--   An oracle is a function from a question type @q@, to an answer type @a@.
+--   As an example, we can define an oracle allowing you to depend on the current version of GHC:
+--
+-- @
+-- newtype GhcVersion = GhcVersion () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
+-- type instance RuleResult GhcVersion = String
+-- rules = do
+--     'addOracle' $ \\(GhcVersion _) -> 'Development.Shake.fromStdout' \<$\> 'Development.Shake.cmd' \"ghc --numeric-version\" :: Action String
+--     ... rules ...
+-- @
+--
+--   If a rule calls @'askOracle' (GhcVersion ())@, that rule will be rerun whenever the GHC version changes.
+--   Some notes:
+--
+-- * We define @GhcVersion@ with a @newtype@ around @()@, allowing the use of @GeneralizedNewtypeDeriving@.
+--   All the necessary type classes are exported from "Development.Shake.Classes".
+--
+-- * The @type instance@ requires the extension @TypeFamilies@.
+--
+-- * Each call to 'addOracle' must use a different type of question.
+--
+-- * Actions passed to 'addOracle' will be run in every build they are required, even if nothing else changes,
+--   so be careful of slow actions.
+--   If the result of an oracle does not change it will not invalidate any rules depending on it.
+--   To always rerun files rules see 'Development.Shake.alwaysRerun'.
+--
+--   As a more complex example, consider tracking Haskell package versions:
+--
+-- @
+-- newtype GhcPkgList = GhcPkgList () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
+-- type instance RuleResult GhcPkgList = [(String, String)]
+-- newtype GhcPkgVersion = GhcPkgVersion String deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
+-- type instance RuleResult GhcPkgVersion = Maybe String
+--
+-- rules = do
+--     getPkgList \<- 'addOracle' $ \\GhcPkgList{} -> do
+--         Stdout out <- 'Development.Shake.cmd' \"ghc-pkg list --simple-output\"
+--         pure [(reverse b, reverse a) | x <- words out, let (a,_:b) = break (== \'-\') $ reverse x]
+--
+--     getPkgVersion \<- 'addOracle' $ \\(GhcPkgVersion pkg) -> do
+--         pkgs <- getPkgList $ GhcPkgList ()
+--         pure $ lookup pkg pkgs
+--
+--     \"myrule\" %> \\_ -> do
+--         getPkgVersion $ GhcPkgVersion \"shake\"
+--         ... rule using the shake version ...
+-- @
+--
+--   Using these definitions, any rule depending on the version of @shake@
+--   should call @getPkgVersion $ GhcPkgVersion \"shake\"@ to rebuild when @shake@ is upgraded.
+--
+--   If you apply 'versioned' to an oracle it will cause that oracle result to be discarded, and not do early-termination.
+addOracle :: (RuleResult q ~ a, ShakeValue q, ShakeValue a, Partial) => (q -> Action a) -> Rules (q -> Action a)
+addOracle = withFrozenCallStack $ addOracleFlavor Norm
+
+
+-- | An alternative to to 'addOracle' that relies on the 'hash' function providing a perfect equality,
+--   doesn't support @--skip@, but requires less storage.
+addOracleHash :: (RuleResult q ~ a, ShakeValue q, ShakeValue a, Partial) => (q -> Action a) -> Rules (q -> Action a)
+addOracleHash = withFrozenCallStack $ addOracleFlavor Hash
+
+-- | A combination of 'addOracle' and 'newCache' - an action that only runs when its dependencies change,
+--   whose result is stored in the database.
+--
+-- * Does the information need recomputing every time? e.g. looking up stuff in the environment?
+--   If so, use 'addOracle' instead.
+--
+-- * Is the action mostly deserisalising some file? If so, use 'newCache'.
+--
+-- * Is the operation expensive computation from other results? If so, use 'addOracleCache'.
+--
+--   An alternative to using 'addOracleCache' is introducing an intermediate file containing the result,
+--   which requires less storage in the Shake database and can be inspected by existing file-system viewing
+--   tools.
+addOracleCache ::(RuleResult q ~ a, ShakeValue q, ShakeValue a, Partial) => (q -> Action a) -> Rules (q -> Action a)
+addOracleCache = withFrozenCallStack $ addOracleFlavor Cache
+
+
+-- | Get information previously added with 'addOracle' or 'addOracleCache'.
+--   The question/answer types must match those provided previously.
+askOracle :: (RuleResult q ~ a, ShakeValue q, ShakeValue a) => q -> Action a
+askOracle = fmap fromOracleA . apply1 . OracleQ
+
+-- | A parallel version of 'askOracle'.
+askOracles :: (RuleResult q ~ a, ShakeValue q, ShakeValue a) => [q] -> Action [a]
+askOracles = fmap (map fromOracleA) . apply . map OracleQ
diff --git a/src/Development/Shake/Internal/Rules/OrderOnly.hs b/src/Development/Shake/Internal/Rules/OrderOnly.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Rules/OrderOnly.hs
@@ -0,0 +1,31 @@
+
+module Development.Shake.Internal.Rules.OrderOnly(
+     orderOnly, orderOnlyBS
+    ) where
+
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.Rules.File
+import qualified Data.ByteString.Char8 as BS
+
+
+-- | Define order-only dependencies, these are dependencies that will always
+--   be built before continuing, but which aren't dependencies of this action.
+--   Mostly useful for defining generated dependencies you think might be real dependencies.
+--   If they turn out to be real dependencies, you should add an explicit dependency afterwards.
+--
+-- @
+-- \"source.o\" %> \\out -> do
+--     'orderOnly' [\"header.h\"]
+--     'cmd_' \"gcc -c source.c -o source.o -MMD -MF source.m\"
+--     'neededMakefileDependencies' \"source.m\"
+-- @
+--
+--   If @header.h@ is included by @source.c@ then the call to 'needMakefileDependencies' will cause
+--   it to be added as a real dependency. If it isn't, then the rule won't rebuild if it changes.
+orderOnly :: [FilePath] -> Action ()
+orderOnly = orderOnlyAction . need
+
+
+orderOnlyBS :: [BS.ByteString] -> Action ()
+orderOnlyBS = orderOnlyAction . needBS
diff --git a/src/Development/Shake/Internal/Rules/Rerun.hs b/src/Development/Shake/Internal/Rules/Rerun.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Rules/Rerun.hs
@@ -0,0 +1,46 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-}
+{-# LANGUAGE TypeFamilies #-}
+
+module Development.Shake.Internal.Rules.Rerun(
+    defaultRuleRerun, alwaysRerun
+    ) where
+
+import Development.Shake.Internal.Core.Rules
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Build
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Classes
+import qualified Data.ByteString as BS
+import General.Binary
+
+
+newtype AlwaysRerunQ = AlwaysRerunQ ()
+    deriving (Typeable,Eq,Hashable,Binary,BinaryEx,NFData)
+instance Show AlwaysRerunQ where show _ = "alwaysRerun"
+
+type instance RuleResult AlwaysRerunQ = ()
+
+
+-- | Always rerun the associated action. Useful for defining rules that query
+--   the environment. For example:
+--
+-- @
+-- \"ghcVersion.txt\" 'Development.Shake.%>' \\out -> do
+--     'alwaysRerun'
+--     'Development.Shake.Stdout' stdout <- 'Development.Shake.cmd' \"ghc --numeric-version\"
+--     'Development.Shake.writeFileChanged' out stdout
+-- @
+--
+--   In @make@, the @.PHONY@ attribute on file-producing rules has a similar effect.
+--
+--   Note that 'alwaysRerun' is applied when a rule is executed. Modifying an existing rule
+--   to insert 'alwaysRerun' will /not/ cause that rule to rerun next time.
+alwaysRerun :: Action ()
+alwaysRerun = do
+    historyDisable
+    apply1 $ AlwaysRerunQ ()
+
+defaultRuleRerun :: Rules ()
+defaultRuleRerun =
+    addBuiltinRuleEx noLint noIdentity $
+        \AlwaysRerunQ{} _ _ -> pure $ RunResult ChangedRecomputeDiff BS.empty ()
diff --git a/src/Development/Shake/Internal/Value.hs b/src/Development/Shake/Internal/Value.hs
new file mode 100644
--- /dev/null
+++ b/src/Development/Shake/Internal/Value.hs
@@ -0,0 +1,111 @@
+{-# LANGUAGE ExistentialQuantification, RecordWildCards, ScopedTypeVariables #-}
+{-# LANGUAGE ConstraintKinds #-}
+
+-- | This module implements the Key/Value types, to abstract over hetrogenous data types.
+module Development.Shake.Internal.Value(
+    Value, newValue, fromValue,
+    Key, newKey, fromKey, typeKey,
+    ShakeValue
+    ) where
+
+import Development.Shake.Classes
+import Development.Shake.Internal.Errors
+import Data.Typeable
+
+import Unsafe.Coerce
+
+
+-- | Define an alias for the six type classes required for things involved in Shake rules.
+--   Using this alias requires the @ConstraintKinds@ extension.
+--
+--   To define your own values meeting the necessary constraints it is convenient to use the extensions
+--   @GeneralizedNewtypeDeriving@ and @DeriveDataTypeable@ to write:
+--
+-- > newtype MyType = MyType (String, Bool) deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
+--
+--   Shake needs these instances on keys and values. They are used for:
+--
+-- * 'Show' is used to print out keys in errors, profiling, progress messages
+--   and diagnostics.
+--
+-- * 'Typeable' is used because Shake indexes its database by the
+--   type of the key and value involved in the rule (overlap is not
+--   allowed for type classes and not allowed in Shake either).
+--
+-- * 'Eq' and 'Hashable' are used on keys in order to build hash maps
+--   from keys to values.  'Eq' is used on values to test if the value
+--   has changed or not (this is used to support unchanging rebuilds,
+--   where Shake can avoid rerunning rules if it runs a dependency,
+--   but it turns out that no changes occurred.)  The 'Hashable'
+--   instances are only use at runtime (never serialised to disk),
+--   so they do not have to be stable across runs.
+--   Hashable on values is not used, and only required for a consistent interface.
+--
+-- * 'Binary' is used to serialize keys and values into Shake's
+--   build database; this lets Shake cache values across runs and
+--   implement unchanging rebuilds.
+--
+-- * 'NFData' is used to avoid space and thunk leaks, especially
+--   when Shake is parallelized.
+type ShakeValue a = (Show a, Typeable a, Eq a, Hashable a, Binary a, NFData a)
+
+-- We deliberately avoid Typeable instances on Key/Value to stop them accidentally
+-- being used inside themselves
+data Key = forall a . Key
+    {keyType :: TypeRep
+    ,keyShow :: a -> String
+    ,keyRnf :: a -> ()
+    ,keyEq :: a -> a -> Bool
+    ,keyHash :: Int -> a -> Int
+    ,keyValue :: a
+    }
+
+data Value = forall a . Value
+    {valueType :: TypeRep
+    ,valueShow :: a -> String
+    ,valueRnf :: a -> ()
+    ,valueValue :: a
+    }
+
+
+newKey :: forall a . ShakeValue a => a -> Key
+newKey = Key (typeRep (Proxy :: Proxy a)) show rnf (==) hashWithSalt
+
+newValue :: forall a . (Typeable a, Show a, NFData a) => a -> Value
+newValue = Value (typeRep (Proxy :: Proxy a)) show rnf
+
+typeKey :: Key -> TypeRep
+typeKey Key{..} = keyType
+
+fromKey :: forall a . Typeable a => Key -> a
+fromKey Key{..}
+    | keyType == resType = unsafeCoerce keyValue
+    | otherwise = throwImpure $ errorInternal $ "fromKey, bad cast, have " ++ show keyType ++ ", wanted " ++ show resType
+    where resType = typeRep (Proxy :: Proxy a)
+
+fromValue :: forall a . Typeable a => Value -> a
+fromValue Value{..}
+    | valueType == resType = unsafeCoerce valueValue
+    | otherwise = throwImpure $ errorInternal $ "fromValue, bad cast, have " ++ show valueType ++ ", wanted " ++ show resType
+    where resType = typeRep (Proxy :: Proxy a)
+
+instance Show Key where
+    show Key{..} = keyShow keyValue
+
+instance Show Value where
+    show Value{..} = valueShow valueValue
+
+instance NFData Key where
+    rnf Key{..} = keyRnf keyValue
+
+instance NFData Value where
+    rnf Value{..} = valueRnf valueValue
+
+instance Hashable Key where
+    hash Key{..} = keyHash (hash keyType) keyValue
+    hashWithSalt salt Key{..} = keyHash (hashWithSalt salt keyType) keyValue
+
+instance Eq Key where
+    Key{keyType=at,keyValue=a,keyEq=eq} == Key{keyType=bt,keyValue=b}
+        | at /= bt = False
+        | otherwise = eq a (unsafeCoerce b)
diff --git a/src/Development/Shake/Monad.hs b/src/Development/Shake/Monad.hs
deleted file mode 100644
--- a/src/Development/Shake/Monad.hs
+++ /dev/null
@@ -1,128 +0,0 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-
-module Development.Shake.Monad(
-    RAW, Capture, runRAW,
-    getRO, getRW, getsRO, getsRW, putRW, modifyRW,
-    withRO, withRW,
-    catchRAW, tryRAW, throwRAW,
-    unmodifyRW, captureRAW,
-    ) where
-
-import Control.Exception.Extra
-import Control.Monad.IO.Class
-import Control.Monad.Trans.Cont
-import Control.Monad.Trans.Reader
-import Data.IORef
-import Control.Applicative
-import Control.Monad
-import Prelude
-
-
-data S ro rw = S
-    {handler :: IORef (SomeException -> IO ())
-    ,ro :: ro
-    ,rww :: IORef rw -- Read/Write Writeable var (rww)
-    }
-
-newtype RAW ro rw a = RAW {fromRAW :: ReaderT (S ro rw) (ContT () IO) a}
-    deriving (Functor, Applicative, Monad, MonadIO)
-
-type Capture a = (a -> IO ()) -> IO ()
-
-
--- See https://ghc.haskell.org/trac/ghc/ticket/11555
-catchSafe :: IO a -> (SomeException -> IO a) -> IO a
-catchSafe = catch_
-
--- | Run and then call a continuation.
-runRAW :: ro -> rw -> RAW ro rw a -> Capture (Either SomeException a)
-runRAW ro rw m k = do
-    rww <- newIORef rw
-    handler <- newIORef $ k . Left
-    -- see https://ghc.haskell.org/trac/ghc/ticket/11555
-    fromRAW m `runReaderT` S handler ro rww `runContT` (k . Right)
-        `catchSafe` \e -> ($ e) =<< readIORef handler
-
-
----------------------------------------------------------------------
--- STANDARD
-
-getRO :: RAW ro rw ro
-getRO = RAW $ asks ro
-
-getRW :: RAW ro rw rw
-getRW = RAW $ liftIO . readIORef =<< asks rww
-
-getsRO :: (ro -> a) -> RAW ro rw a
-getsRO f = fmap f getRO
-
-getsRW :: (rw -> a) -> RAW ro rw a
-getsRW f = fmap f getRW
-
--- | Strict version
-putRW :: rw -> RAW ro rw ()
-putRW rw = rw `seq` RAW $ liftIO . flip writeIORef rw =<< asks rww
-
-withRAW :: (S ro rw -> S ro2 rw2) -> RAW ro2 rw2 a -> RAW ro rw a
-withRAW f m = RAW $ withReaderT f $ fromRAW m
-
-modifyRW :: (rw -> rw) -> RAW ro rw ()
-modifyRW f = do x <- getRW; putRW $ f x
-
-withRO :: (ro -> ro2) -> RAW ro2 rw a -> RAW ro rw a
-withRO f = withRAW $ \s -> s{ro=f $ ro s}
-
-withRW :: (rw -> rw2) -> RAW ro rw2 a -> RAW ro rw a
-withRW f m = do
-    rw <- getRW
-    rww <- liftIO $ newIORef $ f rw
-    withRAW (\s -> s{rww=rww}) m
-
-
----------------------------------------------------------------------
--- EXCEPTIONS
-
-catchRAW :: RAW ro rw a -> (SomeException -> RAW ro rw a) -> RAW ro rw a
-catchRAW m hdl = RAW $ ReaderT $ \s -> ContT $ \k -> do
-    old <- readIORef $ handler s
-    writeIORef (handler s) $ \e -> do
-        writeIORef (handler s) old
-        fromRAW (hdl e) `runReaderT` s `runContT` k `catchSafe`
-            \e -> ($ e) =<< readIORef (handler s)
-    fromRAW m `runReaderT` s `runContT` \v -> do
-        writeIORef (handler s) old
-        k v
-
-
-tryRAW :: RAW ro rw a -> RAW ro rw (Either SomeException a)
-tryRAW m = catchRAW (fmap Right m) (return . Left)
-
-throwRAW :: Exception e => e -> RAW ro rw a
-throwRAW = liftIO . throwIO
-
-
----------------------------------------------------------------------
--- WEIRD STUFF
-
--- | Apply a modification, run an action, then undo the changes after.
-unmodifyRW :: (rw -> (rw, rw -> rw)) -> RAW ro rw a -> RAW ro rw a
-unmodifyRW f m = do
-    (s2,undo) <- fmap f getRW
-    putRW s2
-    res <- m
-    modifyRW undo
-    return res
-
-
--- | Capture a continuation. The continuation should be called at most once.
---   Calling the same continuation, multiple times, in parallel, results in incorrect behaviour.
-captureRAW :: Capture (Either SomeException a) -> RAW ro rw a
-captureRAW f = RAW $ ReaderT $ \s -> ContT $ \k -> do
-    old <- readIORef (handler s)
-    writeIORef (handler s) throwIO
-    f $ \x -> case x of
-        Left e -> old e
-        Right v -> do
-            writeIORef (handler s) old
-            k v `catchSafe` \e -> ($ e) =<< readIORef (handler s)
-            writeIORef (handler s) throwIO
diff --git a/src/Development/Shake/Pool.hs b/src/Development/Shake/Pool.hs
deleted file mode 100644
--- a/src/Development/Shake/Pool.hs
+++ /dev/null
@@ -1,189 +0,0 @@
-
--- | Thread pool implementation.
-module Development.Shake.Pool(
-    Pool, runPool,
-    addPool, addPoolPriority,
-    increasePool
-    ) where
-
-import Control.Concurrent.Extra
-import System.Time.Extra
-import Control.Exception
-import Control.Monad
-import General.Timing
-import qualified Data.HashSet as Set
-import qualified Data.HashMap.Strict as Map
-import System.Random
-
-
----------------------------------------------------------------------
--- UNFAIR/RANDOM QUEUE
-
--- Monad for non-deterministic (but otherwise pure) computations
-type NonDet a = IO a
-
--- Left = deterministic list, Right = non-deterministic tree
-data Queue a = Queue [a] (Either [a] (Tree a))
-
-newQueue :: Bool -> Queue a
-newQueue deterministic = Queue [] $ if deterministic then Left [] else Right emptyTree
-
-enqueuePriority :: a -> Queue a -> Queue a
-enqueuePriority x (Queue p t) = Queue (x:p) t
-
-enqueue :: a -> Queue a -> Queue a
-enqueue x (Queue p (Left xs)) = Queue p $ Left $ x:xs
-enqueue x (Queue p (Right t)) = Queue p $ Right $ insertTree x t
-
-dequeue :: Queue a -> NonDet (Maybe (a, Queue a))
-dequeue (Queue (p:ps) t) = return $ Just (p, Queue ps t)
-dequeue (Queue [] (Left (x:xs))) = return $ Just (x, Queue [] $ Left xs)
-dequeue (Queue [] (Left [])) = return Nothing
-dequeue (Queue [] (Right t)) = do
-    bs <- randomIO
-    return $ case removeTree bs t of
-        Nothing -> Nothing
-        Just (x,t) -> Just (x, Queue [] $ Right t)
-
-
----------------------------------------------------------------------
--- TREE
-
--- A tree where removal is random. Nodes are stored at indicies 0..n-1
-data Tree a = Tree {-# UNPACK #-} !Int (Map.HashMap Int a)
-
-
-emptyTree :: Tree a
-emptyTree = Tree 0 Map.empty
-
-insertTree :: a -> Tree a -> Tree a
-insertTree x (Tree n mp) = Tree (n+1) $ Map.insert n x mp
-
--- Remove an item at random, put the n-1 item to go in it's place
-removeTree :: Int -> Tree a -> Maybe (a, Tree a)
-removeTree rnd (Tree n mp)
-        | n == 0 = Nothing
-        | n == 1 = Just (mp Map.! 0, emptyTree)
-        | i == n-1 = Just (mp Map.! i, Tree (n-1) $ Map.delete i mp)
-        | otherwise = Just (mp Map.! i, Tree (n-1) $ Map.insert i (mp Map.! (n-1)) $ Map.delete (n-1) mp)
-    where
-        i = abs rnd `mod` n
-
-
----------------------------------------------------------------------
--- THREAD POOL
-
-{-
-Must keep a list of active threads, so can raise exceptions in a timely manner
-If any worker throws an exception, must signal to all the other workers
--}
-
-data Pool = Pool
-    !(Var (Maybe S)) -- Current state, 'Nothing' to say we are aborting
-    !(Barrier (Either SomeException S)) -- Barrier to signal that we are
-
-data S = S
-    {threads :: !(Set.HashSet ThreadId) -- IMPORTANT: Must be strict or we leak thread stacks
-    ,threadsLimit :: {-# UNPACK #-} !Int -- user supplied thread limit, Set.size threads <= threadsLimit
-    ,threadsMax :: {-# UNPACK #-} !Int -- high water mark of Set.size threads (accounting only)
-    ,threadsSum :: {-# UNPACK #-} !Int -- number of threads we have been through (accounting only)
-    ,todo :: !(Queue (IO ())) -- operations waiting a thread
-    }
-
-
-emptyS :: Int -> Bool -> S
-emptyS n deterministic = S Set.empty n 0 0 $ newQueue deterministic
-
-
-worker :: Pool -> IO ()
-worker pool@(Pool var done) = do
-    let onVar act = modifyVar var $ maybe (return (Nothing, return ())) act
-    join $ onVar $ \s -> do
-        res <- dequeue $ todo s
-        case res of
-            Nothing -> return (Just s, return ())
-            Just (now, todo2) -> return (Just s{todo = todo2}, now >> worker pool)
-
-
--- | Given a pool, and a function that breaks the S invariants, restore them
---   They are only allowed to touch threadsLimit or todo
-step :: Pool -> (S -> NonDet S) -> IO ()
-step pool@(Pool var done) op = do
-    let onVar act = modifyVar_ var $ maybe (return Nothing) act
-    onVar $ \s -> do
-        s <- op s
-        res <- dequeue $ todo s
-        case res of
-            Just (now, todo2) | Set.size (threads s) < threadsLimit s -> do
-                -- spawn a new worker
-                t <- forkFinally (now >> worker pool) $ \res -> case res of
-                    Left e -> onVar $ \s -> do
-                        t <- myThreadId
-                        mapM_ killThread $ Set.toList $ Set.delete t $ threads s
-                        signalBarrier done $ Left e
-                        return Nothing
-                    Right _ -> do
-                        t <- myThreadId
-                        step pool $ \s -> return s{threads = Set.delete t $ threads s}
-                let threads2 = Set.insert t $ threads s
-                return $ Just s{todo = todo2, threads = threads2
-                               ,threadsSum = threadsSum s + 1, threadsMax = threadsMax s `max` Set.size threads2}
-            Nothing | Set.null $ threads s -> do
-                signalBarrier done $ Right s
-                return Nothing
-            _ -> return $ Just s
-
-
--- | Add a new task to the pool, may be cancelled by sending it an exception
-addPool :: Pool -> IO a -> IO ()
-addPool pool act = step pool $ \s -> do
-    todo <- return $ enqueue (void act) (todo s)
-    return s{todo = todo}
-
--- | Add a new task to the pool, may be cancelled by sending it an exception.
---   Takes priority over everything else.
-addPoolPriority :: Pool -> IO a -> IO ()
-addPoolPriority pool act = step pool $ \s -> do
-    todo <- return $ enqueuePriority (void act) (todo s)
-    return s{todo = todo}
-
-
--- | Temporarily increase the pool by 1 thread. Call the cleanup action to restore the value.
---   After calling cleanup you should requeue onto a new thread.
-increasePool :: Pool -> IO (IO ())
-increasePool pool = do
-    step pool $ \s -> return s{threadsLimit = threadsLimit s + 1}
-    return $ step pool $ \s -> return s{threadsLimit = threadsLimit s - 1}
-
-
--- | Run all the tasks in the pool on the given number of works.
---   If any thread throws an exception, the exception will be reraised.
-runPool :: Bool -> Int -> (Pool -> IO ()) -> IO () -- run all tasks in the pool
-runPool deterministic n act = do
-    s <- newVar $ Just $ emptyS n deterministic
-    done <- newBarrier
-
-    let cleanup = modifyVar_ s $ \s -> do
-            -- if someone kills our thread, make sure we kill our child threads
-            case s of
-                Just s -> mapM_ killThread $ Set.toList $ threads s
-                Nothing -> return ()
-            return Nothing
-
-    let ghc10793 = do
-            -- if this thread dies because it is blocked on an MVar there's a chance we have
-            -- a better error in the done barrier, and GHC raised the exception wrongly, see:
-            -- https://ghc.haskell.org/trac/ghc/ticket/10793
-            sleep 1 -- give it a little bit of time for the finally to run
-                    -- no big deal, since the blocked indefinitely takes a while to fire anyway
-            res <- waitBarrierMaybe done
-            case res of
-                Just (Left e) -> throwIO e
-                _ -> throwIO BlockedIndefinitelyOnMVar
-    handle (\BlockedIndefinitelyOnMVar -> ghc10793) $ flip onException cleanup $ do
-        let pool = Pool s done
-        addPool pool $ act pool
-        res <- waitBarrier done
-        case res of
-            Left e -> throwIO e
-            Right s -> addTiming $ "Pool finished (" ++ show (threadsSum s) ++ " threads, " ++ show (threadsMax s) ++ " max)"
diff --git a/src/Development/Shake/Profile.hs b/src/Development/Shake/Profile.hs
deleted file mode 100644
--- a/src/Development/Shake/Profile.hs
+++ /dev/null
@@ -1,92 +0,0 @@
-{-# LANGUAGE PatternGuards, RecordWildCards #-}
-
-module Development.Shake.Profile(ProfileEntry(..), ProfileTrace(..), writeProfile) where
-
-import General.Template
-import Data.Tuple.Extra
-import Data.Function
-import Data.List
-import Data.Version
-import System.FilePath
-import Numeric.Extra
-import General.Extra
-import Paths_shake
-import System.Time.Extra
-import qualified Data.ByteString.Lazy.Char8 as LBS
-
-
-data ProfileEntry = ProfileEntry
-    {prfName :: String, prfBuilt :: Int, prfChanged :: Int, prfDepends :: [Int], prfExecution :: Double, prfTraces :: [ProfileTrace]}
-data ProfileTrace = ProfileTrace
-    {prfCommand :: String, prfStart :: Double, prfStop :: Double}
-prfTime ProfileTrace{..} = prfStop - prfStart
-
-
--- | Generates an report given some build system profiling data.
-writeProfile :: FilePath -> [ProfileEntry] -> IO ()
-writeProfile out xs
-    | takeExtension out == ".js" = writeFile out $ "var shake = \n" ++ generateJSON xs
-    | takeExtension out == ".json" = writeFile out $ generateJSON xs
-    | takeExtension out == ".trace" = writeFile out $ generateTrace xs
-    | out == "-" = putStr $ unlines $ generateSummary xs
-    | otherwise = LBS.writeFile out =<< generateHTML xs
-
-
-generateSummary :: [ProfileEntry] -> [String]
-generateSummary xs =
-    ["* This database has tracked " ++ show (maximum (0 : map prfChanged xs) + 1) ++ " runs."
-    ,let f = show . length in "* There are " ++ f xs ++ " rules (" ++ f ls ++ " rebuilt in the last run)."
-    ,let f = show . sum . map (length . prfTraces) in "* Building required " ++ f xs ++ " traced commands (" ++ f ls ++ " in the last run)."
-    ,"* The total (unparallelised) time is " ++ showDuration (sum $ map prfExecution xs) ++
-        " of which " ++ showDuration (sum $ map prfTime $ concatMap prfTraces xs) ++ " is traced commands."
-    ,let f xs = if null xs then "0s" else (\(a,b) -> showDuration a ++ " (" ++ b ++ ")") $ maximumBy' (compare `on` fst) xs in
-        "* The longest rule takes " ++ f (map (prfExecution &&& prfName) xs) ++
-        ", and the longest traced command takes " ++ f (map (prfTime &&& prfCommand) $ concatMap prfTraces xs) ++ "."
-    ,let sumLast = sum $ map prfTime $ concatMap prfTraces ls
-         maxStop = maximum $ 0 : map prfStop (concatMap prfTraces ls) in
-        "* Last run gave an average parallelism of " ++ showDP 2 (if maxStop == 0 then 0 else sumLast / maxStop) ++
-        " times over " ++ showDuration maxStop ++ "."
-    ]
-    where ls = filter ((==) 0 . prfBuilt) xs
-
-
-generateHTML :: [ProfileEntry] -> IO LBS.ByteString
-generateHTML xs = do
-    htmlDir <- getDataFileName "html"
-    report <- LBS.readFile $ htmlDir </> "profile.html"
-    let f name | name == "profile-data.js" = return $ LBS.pack $ "var profile =\n" ++ generateJSON xs
-               | name == "version.js" = return $ LBS.pack $ "var version = " ++ show (showVersion version)
-               | otherwise = LBS.readFile $ htmlDir </> name
-    runTemplate f report
-
-
-generateTrace :: [ProfileEntry] -> String
-generateTrace xs = jsonListLines $
-    showEntries 0 [y{prfCommand=prfName x} | x <- xs, y <- prfTraces x] ++
-    showEntries 1 (concatMap prfTraces xs)
-    where
-        showEntries pid xs = map (showEntry pid) $ snd $ mapAccumL alloc [] $ sortBy (compare `on` prfStart) xs
-        alloc as r | (a1,an:a2) <- break (\a -> prfStop a <= prfStart r) as = (a1++r:a2, (length a1,r))
-                   | otherwise = (as++[r], (length as,r))
-        showEntry pid (tid, ProfileTrace{..}) = jsonObject
-            [("args","{}"), ("ph",show "X"), ("cat",show "target")
-            ,("name",show prfCommand), ("tid",show tid), ("pid",show pid)
-            ,("ts",show $ 1000000*prfStart), ("dur",show $ 1000000*(prfStop-prfStart))]
-
-
-generateJSON :: [ProfileEntry] -> String
-generateJSON = jsonListLines . map showEntry
-    where
-        showEntry ProfileEntry{..} = jsonObject $
-            [("name", show prfName)
-            ,("built", show prfBuilt)
-            ,("changed", show prfChanged)
-            ,("depends", show prfDepends)
-            ,("execution", showDP 4 prfExecution)] ++
-            [("traces", jsonList $ map showTrace prfTraces) | not $ null prfTraces]
-        showTrace ProfileTrace{..} = jsonObject
-            [("command",show prfCommand), ("start",show prfStart), ("stop",show prfStop)]
-
-jsonListLines xs = "[" ++ intercalate "\n," xs ++ "\n]"
-jsonList xs = "[" ++ intercalate "," xs ++ "]"
-jsonObject xs = "{" ++ intercalate "," [show a ++ ":" ++ b | (a,b) <- xs] ++ "}"
diff --git a/src/Development/Shake/Progress.hs b/src/Development/Shake/Progress.hs
deleted file mode 100644
--- a/src/Development/Shake/Progress.hs
+++ /dev/null
@@ -1,364 +0,0 @@
-{-# LANGUAGE DeriveDataTypeable, RecordWildCards, CPP, ViewPatterns, ForeignFunctionInterface #-}
-
--- | Progress tracking
-module Development.Shake.Progress(
-    Progress(..),
-    progressSimple, progressDisplay, progressTitlebar, progressProgram,
-    ProgressEntry(..), progressReplay, writeProgressReport -- INTERNAL USE ONLY
-    ) where
-
-import Control.Applicative
-import Data.Tuple.Extra
-import Control.Exception.Extra
-import Control.Monad
-import System.Environment
-import System.Directory
-import System.Process
-import System.FilePath
-import Data.Char
-import Data.Data
-import Data.IORef
-import Data.List
-import Data.Maybe
-import Data.Version
-import qualified Data.ByteString.Char8 as BS
-import qualified Data.ByteString.Lazy.Char8 as LBS
-import Numeric.Extra
-import General.Template
-import System.IO.Unsafe
-import Paths_shake
-import System.Time.Extra
-import Data.Monoid
-import Prelude
-
-#ifdef mingw32_HOST_OS
-
-import Foreign
-import Foreign.C.Types
-
-#ifdef x86_64_HOST_ARCH
-#define CALLCONV ccall
-#else
-#define CALLCONV stdcall
-#endif
-
-foreign import CALLCONV "Windows.h SetConsoleTitleA" c_setConsoleTitle :: Ptr CChar -> IO Bool
-
-#endif
-
-
----------------------------------------------------------------------
--- PROGRESS TYPES - exposed to the user
-
--- | Information about the current state of the build, obtained by either passing a callback function
---   to 'Development.Shake.shakeProgress' (asynchronous output) or 'Development.Shake.getProgress'
---   (synchronous output). Typically a build system will pass 'progressDisplay' to 'Development.Shake.shakeProgress',
---   which will poll this value and produce status messages.
-data Progress = Progress
-    {isFailure :: !(Maybe String) -- ^ Starts out 'Nothing', becomes 'Just' a target name if a rule fails.
-    ,countSkipped :: {-# UNPACK #-} !Int -- ^ Number of rules which were required, but were already in a valid state.
-    ,countBuilt :: {-# UNPACK #-} !Int -- ^ Number of rules which were have been built in this run.
-    ,countUnknown :: {-# UNPACK #-} !Int -- ^ Number of rules which have been built previously, but are not yet known to be required.
-    ,countTodo :: {-# UNPACK #-} !Int -- ^ Number of rules which are currently required (ignoring dependencies that do not change), but not built.
-    ,timeSkipped :: {-# UNPACK #-} !Double -- ^ Time spent building 'countSkipped' rules in previous runs.
-    ,timeBuilt :: {-# UNPACK #-} !Double -- ^ Time spent building 'countBuilt' rules.
-    ,timeUnknown :: {-# UNPACK #-} !Double -- ^ Time spent building 'countUnknown' rules in previous runs.
-    ,timeTodo :: {-# UNPACK #-} !(Double,Int) -- ^ Time spent building 'countTodo' rules in previous runs, plus the number which have no known time (have never been built before).
-    }
-    deriving (Eq,Ord,Show,Read,Data,Typeable)
-
-instance Monoid Progress where
-    mempty = Progress Nothing 0 0 0 0 0 0 0 (0,0)
-    mappend a b = Progress
-        {isFailure = isFailure a `mplus` isFailure b
-        ,countSkipped = countSkipped a + countSkipped b
-        ,countBuilt = countBuilt a + countBuilt b
-        ,countUnknown = countUnknown a + countUnknown b
-        ,countTodo = countTodo a + countTodo b
-        ,timeSkipped = timeSkipped a + timeSkipped b
-        ,timeBuilt = timeBuilt a + timeBuilt b
-        ,timeUnknown = timeUnknown a + timeUnknown b
-        ,timeTodo = let (a1,a2) = timeTodo a; (b1,b2) = timeTodo b
-                        x1 = a1 + b1; x2 = a2 + b2
-                    in x1 `seq` x2 `seq` (x1,x2)
-        }
-
-
----------------------------------------------------------------------
--- MEALY TYPE - for writing the progress functions
--- See <http://hackage.haskell.org/package/machines-0.2.3.1/docs/Data-Machine-Mealy.html>
-
--- | A machine that takes inputs and produces outputs
-newtype Mealy i a = Mealy {runMealy :: i -> (a, Mealy i a)}
-
-instance Functor (Mealy i) where
-    fmap f (Mealy m) = Mealy $ \i -> case m i of
-        (x, m) -> (f x, fmap f m)
-
-instance Applicative (Mealy i) where
-    pure x = let r = Mealy (const (x, r)) in r
-    Mealy mf <*> Mealy mx = Mealy $ \i -> case mf i of
-        (f, mf) -> case mx i of
-            (x, mx) -> (f x, mf <*> mx)
-
-echoMealy :: Mealy i i
-echoMealy = Mealy $ \i -> (i, echoMealy)
-
-scanMealy :: (a -> b -> a) -> a -> Mealy i b -> Mealy i a
-scanMealy f z (Mealy m) = Mealy $ \i -> case m i of
-    (x, m) -> let z2 = f z x in (z2, scanMealy f z2 m)
-
-
----------------------------------------------------------------------
--- MEALY UTILITIES
-
-oldMealy :: a -> Mealy i a -> Mealy i (a,a)
-oldMealy old = scanMealy (\(_,old) new -> (old,new)) (old,old)
-
-latch :: Mealy i (Bool, a) -> Mealy i a
-latch s = fromJust <$> scanMealy f Nothing s
-    where f old (b,v) = Just $ if b then fromMaybe v old else v
-
-iff :: Mealy i Bool -> Mealy i a -> Mealy i a -> Mealy i a
-iff c t f = (\c t f -> if c then t else f) <$> c <*> t <*> f
-
--- decay'd division, compute a/b, with a decay of f
--- r' is the new result, r is the last result
--- r' ~= a' / b'
--- r' = r*b + f*(a'-a)
---      -------------
---      b + f*(b'-b)
--- when f == 1, r == r'
---
--- both streams must only ever increase
-decay :: Double -> Mealy i Double -> Mealy i Double -> Mealy i Double
-decay f a b = scanMealy step 0 $ (,) <$> oldMealy 0 a <*> oldMealy 0 b
-    where step r ((a,a'),(b,b')) = if isNaN r then a' / b' else ((r*b) + f*(a'-a)) / (b + f*(b'-b))
-
-
----------------------------------------------------------------------
--- MESSAGE GENERATOR
-
-formatMessage :: Double -> Double -> String
-formatMessage secs perc =
-    (if isNaN secs || secs < 0 then "??s" else showMinSec $ ceiling secs) ++ " (" ++
-    (if isNaN perc || perc < 0 || perc > 100 then "??" else show $ floor perc) ++ "%)"
-
-showMinSec :: Int -> String
-showMinSec secs = (if m == 0 then "" else show m ++ "m" ++ ['0' | s < 10]) ++ show s ++ "s"
-    where (m,s) = divMod secs 60
-
-liftA2' :: Applicative m => m a -> m b -> (a -> b -> c) -> m c
-liftA2' a b f = liftA2 f a b
-
-
--- | return (number of seconds, percentage, explanation)
-message :: Mealy (Double, Progress) (Double, Progress) -> Mealy (Double, Progress) (Double, Double, String)
-message input = liftA3 (,,) time perc debug
-    where
-        progress = snd <$> input
-        secs = fst <$> input
-        debug = (\donePerSec ruleTime (todoKnown,todoUnknown) ->
-            "Progress: " ++
-                "((known=" ++ showDP 2 todoKnown ++ "s) + " ++
-                "(unknown=" ++ show todoUnknown ++ " * time=" ++ showDP 2 ruleTime ++ "s)) " ++
-                "(rate=" ++ showDP 2 donePerSec ++ "))")
-            <$> donePerSec <*> ruleTime <*> (timeTodo <$> progress)
-
-        -- Number of seconds work completed in this build run
-        -- Ignores timeSkipped which would be more truthful, but it makes the % drop sharply
-        -- which isn't what users want
-        done = timeBuilt <$> progress
-
-        -- Work done per second, don't divide by 0 and don't update if 'done' doesn't change
-        donePerSec = iff ((==) 0 <$> done) (pure 1) perSecStable
-            where perSecStable = latch $ liftA2 (,) (uncurry (==) <$> oldMealy 0 done) perSecRaw
-                  perSecRaw = decay 1.2 done secs
-
-        -- Predicted build time for a rule that has never been built before
-        -- The high decay means if a build goes in "phases" - lots of source files, then lots of compiling
-        -- we reach a reasonable number fairly quickly, without bouncing too much
-        ruleTime = liftA2 weightedAverage
-            (f (decay 10) timeBuilt countBuilt)
-            (f (liftA2 (/)) (fst . timeTodo) (\Progress{..} -> countTodo - snd timeTodo))
-            -- don't call decay on todo, since it goes up and down (as things get done)
-            where
-                weightedAverage (w1,x1) (w2,x2)
-                    | w1 == 0 && w2 == 0 = 0
-                    | otherwise = ((w1 *. x1) + (w2 *. x2)) / intToDouble (w1+w2)
-                    where i *. d = if i == 0 then 0 else intToDouble i * d -- since d might be NaN
-
-                f divide time count = let xs = count <$> progress in liftA2 (,) xs $ divide (time <$> progress) (intToDouble <$> xs)
-
-        -- Number of seconds work remaining, ignoring multiple threads
-        todo = f <$> progress <*> ruleTime
-            where f Progress{..} ruleTime = fst timeTodo + (fromIntegral (snd timeTodo) * ruleTime)
-
-        -- Display information
-        time = liftA2 (/) todo donePerSec
-        perc = iff ((==) 0 <$> done) (pure 0) $
-            liftA2' done todo $ \done todo -> 100 * done / (done + todo)
-
-
----------------------------------------------------------------------
--- EXPOSED FUNCTIONS
-
--- | Given a sampling interval (in seconds) and a way to display the status message,
---   produce a function suitable for using as 'Development.Shake.shakeProgress'.
---   This function polls the progress information every /n/ seconds, produces a status
---   message and displays it using the display function.
---
---   Typical status messages will take the form of @1m25s (15%)@, indicating that the build
---   is predicted to complete in 1 minute 25 seconds (85 seconds total), and 15% of the necessary build time has elapsed.
---   This function uses past observations to predict future behaviour, and as such, is only
---   guessing. The time is likely to go up as well as down, and will be less accurate from a
---   clean build (as the system has fewer past observations).
---
---   The current implementation is to predict the time remaining (based on 'timeTodo') and the
---   work already done ('timeBuilt'). The percentage is then calculated as @remaining / (done + remaining)@,
---   while time left is calculated by scaling @remaining@ by the observed work rate in this build,
---   roughly @done / time_elapsed@.
-progressDisplay :: Double -> (String -> IO ()) -> IO Progress -> IO ()
-progressDisplay sample disp prog = do
-    disp "Starting..." -- no useful info at this stage
-    time <- offsetTime
-    catchJust (\x -> if x == ThreadKilled then Just () else Nothing) (loop time $ message echoMealy) (const $ disp "Finished")
-    where
-        loop :: IO Double -> Mealy (Double, Progress) (Double, Double, String) -> IO ()
-        loop time mealy = do
-            sleep sample
-            p <- prog
-            t <- time
-            ((secs,perc,debug), mealy) <- return $ runMealy mealy (t, p)
-            -- putStrLn debug
-            disp $ formatMessage secs perc ++ maybe "" (\err -> ", Failure! " ++ err) (isFailure p)
-            loop time mealy
-
-
-data ProgressEntry = ProgressEntry
-    {idealSecs :: Double, idealPerc :: Double
-    ,actualSecs :: Double, actualPerc :: Double
-    }
-
-isInvalid :: ProgressEntry -> Bool
-isInvalid ProgressEntry{..} = isNaN actualSecs || isNaN actualPerc
-
-
--- | Given a list of progress inputs, what would you have suggested (seconds, percentage)
-progressReplay :: [(Double, Progress)] -> [ProgressEntry]
-progressReplay [] = []
-progressReplay ps = snd $ mapAccumL f (message echoMealy) ps
-    where
-        end = fst $ last ps
-        f a (time,p) = (a2, ProgressEntry (end - time) (time * 100 / end) secs perc)
-            where ((secs,perc,_),a2) = runMealy a (time,p)
-
-
--- | Given a trace, display information about how well we did
-writeProgressReport :: FilePath -> [(FilePath, [(Double, Progress)])] -> IO ()
-writeProgressReport out (map (second progressReplay) -> xs)
-    | (bad,_):_ <- filter (any isInvalid . snd) xs = errorIO $ "Progress generates NaN for " ++ bad
-    | takeExtension out == ".js" = writeFile out $ "var shake = \n" ++ generateJSON xs
-    | takeExtension out == ".json" = writeFile out $ generateJSON xs
-    | out == "-" = putStr $ unlines $ generateSummary xs
-    | otherwise = LBS.writeFile out =<< generateHTML xs
-
-
-generateSummary :: [(FilePath, [ProgressEntry])] -> [String]
-generateSummary xs = flip concatMap xs $ \(file,xs) ->
-    ["# " ++ file, f xs "Seconds" idealSecs actualSecs, f xs "Percent" idealPerc actualPerc]
-    where
-        levels = [100,90,80,50]
-        f xs lbl ideal actual = lbl ++ ": " ++ intercalate ", "
-            [show l ++ "% within " ++ show (ceiling $ maximum $ 0 : take ((length xs * l) `div` 100) diff) | l <- levels]
-            where diff = sort [abs $ ideal x - actual x | x <- xs]
-
-
-generateHTML :: [(FilePath, [ProgressEntry])] -> IO LBS.ByteString
-generateHTML xs = do
-    htmlDir <- getDataFileName "html"
-    report <- LBS.readFile $ htmlDir </> "progress.html"
-    let f name | name == "progress-data.js" = return $ LBS.pack $ "var progress =\n" ++ generateJSON xs
-               | name == "version.js" = return $ LBS.pack $ "var version = " ++ show (showVersion version)
-               | otherwise = LBS.readFile $ htmlDir </> name
-    runTemplate f report
-
-generateJSON :: [(FilePath, [ProgressEntry])] -> String
-generateJSON = concat . jsonList . map ((++"}") . unlines . f)
-    where
-        f (file,ps) =
-            ("{\"name\":" ++ show (takeFileName file) ++ ", \"values\":") :
-            indent (jsonList $ map g ps)
-
-        shw = showDP 1
-        g ProgressEntry{..} = jsonObject
-            [("idealSecs",shw idealSecs),("idealPerc",shw idealPerc)
-            ,("actualSecs",shw actualSecs),("actualPerc",shw actualPerc)]
-
-indent = map ("  "++)
-jsonList xs = zipWith (:) ('[':repeat ',') xs ++ ["]"]
-jsonObject xs = "{" ++ intercalate ", " [show a ++ ":" ++ b | (a,b) <- xs] ++ "}"
-
-
-{-# NOINLINE xterm #-}
-xterm :: Bool
-xterm = unsafePerformIO $
-    -- Terminal.app uses "xterm-256color" as its env variable
-    catch_ (("xterm" `isPrefixOf`) <$> getEnv "TERM") $
-    \e -> return False
-
-
--- | Set the title of the current console window to the given text. If the
---   environment variable @$TERM@ is set to @xterm@ this uses xterm escape sequences.
---   On Windows, if not detected as an xterm, this function uses the @SetConsoleTitle@ API.
-progressTitlebar :: String -> IO ()
-progressTitlebar x
-    | xterm = BS.putStr $ BS.pack $ "\ESC]0;" ++ x ++ "\BEL"
-#ifdef mingw32_HOST_OS
-    | otherwise = BS.useAsCString (BS.pack x) $ \x -> c_setConsoleTitle x >> return ()
-#else
-    | otherwise = return ()
-#endif
-
-
--- | Call the program @shake-progress@ if it is on the @$PATH@. The program is called with
---   the following arguments:
---
--- * @--title=string@ - the string passed to @progressProgram@.
---
--- * @--state=Normal@, or one of @NoProgress@, @Normal@, or @Error@ to indicate
---   what state the progress bar should be in.
---
--- * @--value=25@ - the percent of the build that has completed, if not in @NoProgress@ state.
---
---   The program will not be called consecutively with the same @--state@ and @--value@ options.
---
---   Windows 7 or higher users can get taskbar progress notifications by placing the following
---   program in their @$PATH@: <https://github.com/ndmitchell/shake/releases>.
-progressProgram :: IO (String -> IO ())
-progressProgram = do
-    exe <- findExecutable "shake-progress"
-    case exe of
-        Nothing -> return $ const $ return ()
-        Just exe -> do
-            ref <- newIORef Nothing
-            return $ \msg -> do
-                let failure = " Failure! " `isInfixOf` msg
-                let perc = let (a,b) = break (== '%') msg
-                           in if null b then "" else reverse $ takeWhile isDigit $ reverse a
-                let key = (failure, perc)
-                same <- atomicModifyIORef ref $ \old -> (Just key, old == Just key)
-                let state | perc == "" = "NoProgress"
-                          | failure = "Error"
-                          | otherwise = "Normal"
-                rawSystem exe $ ["--title=" ++ msg, "--state=" ++ state] ++ ["--value=" ++ perc | perc /= ""]
-                return ()
-
-
--- | A simple method for displaying progress messages, suitable for using as 'Development.Shake.shakeProgress'.
---   This function writes the current progress to the titlebar every five seconds using 'progressTitlebar',
---   and calls any @shake-progress@ program on the @$PATH@ using 'progressProgram'.
-progressSimple :: IO Progress -> IO ()
-progressSimple p = do
-    program <- progressProgram
-    progressDisplay 5 (\s -> progressTitlebar s >> program s) p
diff --git a/src/Development/Shake/Resource.hs b/src/Development/Shake/Resource.hs
deleted file mode 100644
--- a/src/Development/Shake/Resource.hs
+++ /dev/null
@@ -1,162 +0,0 @@
-{-# LANGUAGE RecordWildCards, ViewPatterns #-}
-
-module Development.Shake.Resource(
-    Resource, newResourceIO, newThrottleIO, acquireResource, releaseResource
-    ) where
-
-import Data.Function
-import System.IO.Unsafe
-import Control.Concurrent.Extra
-import Control.Exception.Extra
-import Data.Tuple.Extra
-import Control.Monad
-import General.Bilist
-import Development.Shake.Pool
-import System.Time.Extra
-import Data.Monoid
-import Prelude
-
-
-{-# NOINLINE resourceIds #-}
-resourceIds :: Var Int
-resourceIds = unsafePerformIO $ newVar 0
-
-resourceId :: IO Int
-resourceId = modifyVar resourceIds $ \i -> let j = i + 1 in j `seq` return (j, j)
-
-
--- | A type representing an external resource which the build system should respect. There
---   are two ways to create 'Resource's in Shake:
---
--- * 'Development.Shake.newResource' creates a finite resource, stopping too many actions running
---   simultaneously.
---
--- * 'Development.Shake.newThrottle' creates a throttled resource, stopping too many actions running
---   over a short time period.
---
---   These resources are used with 'Development.Shake.withResource' when defining rules. Typically only
---   system commands (such as 'Development.Shake.cmd') should be run inside 'Development.Shake.withResource',
---   not commands such as 'Development.Shake.need'.
---
---   Be careful that the actions run within 'Development.Shake.withResource' do not themselves require further
---   resources, or you may get a \"thread blocked indefinitely in an MVar operation\" exception.
---   If an action requires multiple resources, use 'Development.Shake.withResources' to avoid deadlock.
-data Resource = Resource
-    {resourceOrd :: Int
-        -- ^ Key used for Eq/Ord operations. To make withResources work, we require newResourceIO < newThrottleIO
-    ,resourceShow :: String
-        -- ^ String used for Show
-    ,acquireResource :: Pool -> Int -> IO () -> IO ()
-        -- ^ Acquire the resource and call the function.
-    ,releaseResource :: Pool -> Int -> IO ()
-        -- ^ You should only ever releaseResource that you obtained with acquireResource.
-    }
-
-instance Show Resource where show = resourceShow
-instance Eq Resource where (==) = (==) `on` resourceOrd
-instance Ord Resource where compare = compare `on` resourceOrd
-
-
----------------------------------------------------------------------
--- FINITE RESOURCES
-
-data Finite = Finite
-    {finiteAvailable :: !Int
-        -- ^ number of currently available resources
-    ,finiteWaiting :: Bilist (Int, IO ())
-        -- ^ queue of people with how much they want and the action when it is allocated to them
-    }
-
--- | A version of 'Development.Shake.newResource' that runs in IO, and can be called before calling 'Development.Shake.shake'.
---   Most people should use 'Development.Shake.newResource' instead.
-newResourceIO :: String -> Int -> IO Resource
-newResourceIO name mx = do
-    when (mx < 0) $
-        errorIO $ "You cannot create a resource named " ++ name ++ " with a negative quantity, you used " ++ show mx
-    key <- resourceId
-    var <- newVar $ Finite mx mempty
-    return $ Resource (negate key) shw (acquire var) (release var)
-    where
-        shw = "Resource " ++ name
-
-        acquire :: Var Finite -> Pool -> Int -> IO () -> IO ()
-        acquire var pool want continue
-            | want < 0 = errorIO $ "You cannot acquire a negative quantity of " ++ shw ++ ", requested " ++ show want
-            | want > mx = errorIO $ "You cannot acquire more than " ++ show mx ++ " of " ++ shw ++ ", requested " ++ show want
-            | otherwise = join  $ modifyVar var $ \x@Finite{..} -> return $
-                if want <= finiteAvailable then
-                    (x{finiteAvailable = finiteAvailable - want}, continue)
-                else
-                    (x{finiteWaiting = finiteWaiting `snoc` (want, addPool pool continue)}, return ())
-
-        release :: Var Finite -> Pool -> Int -> IO ()
-        release var _ i = join $ modifyVar var $ \x -> return $ f x{finiteAvailable = finiteAvailable x + i}
-            where
-                f (Finite i (uncons -> Just ((wi,wa),ws)))
-                    | wi <= i = second (wa >>) $ f $ Finite (i-wi) ws
-                    | otherwise = first (add (wi,wa)) $ f $ Finite i ws
-                f (Finite i _) = (Finite i mempty, return ())
-                add a s = s{finiteWaiting = a `cons` finiteWaiting s}
-
-
----------------------------------------------------------------------
--- THROTTLE RESOURCES
-
-
--- call a function after a certain delay
-waiter :: Seconds -> IO () -> IO ()
-waiter period act = void $ forkIO $ do
-    sleep period
-    act
-
--- Make sure the pool cannot run try until after you have finished with it
-blockPool :: Pool -> IO (IO ())
-blockPool pool = do
-    bar <- newBarrier
-    addPool pool $ do
-        cancel <- increasePool pool
-        waitBarrier bar
-        cancel
-    return $ signalBarrier bar ()
-
-
-data Throttle
-      -- | Some number of resources are available
-    = ThrottleAvailable !Int
-      -- | Some users are blocked (non-empty), plus an action to call once we go back to Available
-    | ThrottleWaiting (IO ()) (Bilist (Int, IO ()))
-
-
--- | A version of 'Development.Shake.newThrottle' that runs in IO, and can be called before calling 'Development.Shake.shake'.
---   Most people should use 'Development.Shake.newThrottle' instead.
-newThrottleIO :: String -> Int -> Double -> IO Resource
-newThrottleIO name count period = do
-    when (count < 0) $
-        errorIO $ "You cannot create a throttle named " ++ name ++ " with a negative quantity, you used " ++ show count
-    key <- resourceId
-    var <- newVar $ ThrottleAvailable count
-    return $ Resource key shw (acquire var) (release var)
-    where
-        shw = "Throttle " ++ name
-
-        acquire :: Var Throttle -> Pool -> Int -> IO () -> IO ()
-        acquire var pool want continue
-            | want < 0 = errorIO $ "You cannot acquire a negative quantity of " ++ shw ++ ", requested " ++ show want
-            | want > count = errorIO $ "You cannot acquire more than " ++ show count ++ " of " ++ shw ++ ", requested " ++ show want
-            | otherwise = join $ modifyVar var $ \x -> case x of
-                ThrottleAvailable i
-                    | i >= want -> return (ThrottleAvailable $ i - want, continue)
-                    | otherwise -> do
-                        stop <- blockPool pool
-                        return (ThrottleWaiting stop $ (want - i, addPool pool continue) `cons` mempty, return ())
-                ThrottleWaiting stop xs -> return (ThrottleWaiting stop $ xs `snoc` (want, addPool pool continue), return ())
-
-        release :: Var Throttle -> Pool -> Int -> IO ()
-        release var pool n = waiter period $ join $ modifyVar var $ \x -> return $ case x of
-                ThrottleAvailable i -> (ThrottleAvailable $ i+n, return ())
-                ThrottleWaiting stop xs -> f stop n xs
-            where
-                f stop i (uncons -> Just ((wi,wa),ws))
-                    | i >= wi = second (wa >>) $ f stop (i-wi) ws
-                    | otherwise = (ThrottleWaiting stop $ (wi-i,wa) `cons` ws, return ())
-                f stop i _ = (ThrottleAvailable i, stop)
diff --git a/src/Development/Shake/Rule.hs b/src/Development/Shake/Rule.hs
--- a/src/Development/Shake/Rule.hs
+++ b/src/Development/Shake/Rule.hs
@@ -1,22 +1,144 @@
 
--- | This module is used for defining new types of rules for Shake build systems.
---   Most users will find the built-in set of rules sufficient.
+-- | This module is used for defining new types of rules for Shake build systems, e.g. to support values stored in a database.
+--   Most users will find the built-in set of rules sufficient. The functions in this module are designed for high-performance,
+--   not ease of use or abstraction. As a result, they are difficult to work with and change more often than the other parts of Shake.
+--   Before writing a builtin rule you are encouraged to use 'Development.Shake.addOracle' or 'Development.Shake.addOracleCache' if possible.
+--   With all those warnings out the way, read on for the grungy details.
 module Development.Shake.Rule(
-    Rule(..), EqualCost(..), rule, apply, apply1,
-    trackUse, trackChange, trackAllow,
-    -- * Deprecated
-    defaultRule
+    -- * Builtin rules
+    -- $builtin_rules
+
+    -- ** Extensions
+    -- $extensions
+
+    -- ** Worked example
+    -- $example
+
+    -- * Defining builtin rules
+    -- | Functions and types for defining new types of Shake rules.
+    addBuiltinRule,
+    BuiltinLint, noLint, BuiltinIdentity, noIdentity, BuiltinRun, RunMode(..), RunChanged(..), RunResult(..),
+    -- * Calling builtin rules
+    -- | Wrappers around calling Shake rules. In general these should be specialised to a builtin rule.
+    apply, apply1,
+    -- * User rules
+    -- | Define user rules that can be used by builtin rules.
+    --   Absent any builtin rule making use of a user rule at a given type, a user rule will have on effect -
+    --   they have no inherent effect or interpretation on their own.
+    addUserRule, getUserRuleList, getUserRuleMaybe, getUserRuleOne,
+    -- * Lint integration
+    -- | Provide lint warnings when running code.
+    lintTrackRead, lintTrackWrite, lintTrackAllow,
+    -- * History caching
+    -- | Interact with the non-local cache. When using the cache it is important that all
+    --   rules have accurate 'BuiltinIdentity' functions.
+    historyIsEnabled, historySave, historyLoad
     ) where
 
-import Development.Shake.Core
-import Development.Shake.Types
+import Development.Shake.Internal.Core.Types
+import Development.Shake.Internal.Core.Action
+import Development.Shake.Internal.Core.Build
+import Development.Shake.Internal.Core.Rules
 
-{-# DEPRECATED defaultRule "Use 'rule' with 'priority' 0" #-}
+-- $builtin_rules
+--
+--   Shake \"Builtin\" rules are ones map keys to values - e.g. files to file contents. For each builtin rule you need to think:
+--
+-- * What is the @key@ type, which uniquely identifies each location, e.g. a filename.
+--
+-- * What is the @value@ type. The @value@ is not necessarily the full value, but is the result people can get if they ask
+--   for the value associated with the @key@. As an example, for files when you 'need' a file you don't get any value back from
+--   the file, so a simple file rule could have @()@ as its value.
+--
+-- * What information is stored between runs. This information should be sufficient to check if the value has changed since last time,
+--   e.g. the modification time for files.
+--
+--   Typically a custom rule will define a wrapper of type 'Rules' that calls 'addBuiltinRule', along with a type-safe wrapper over
+--   'apply' so users can introduce dependencies.
 
--- | A deprecated way of defining a low priority rule. Defined as:
+-- $extensions
 --
--- @
--- defaultRule = 'priority' 0 . 'rule'
--- @
-defaultRule :: Rule key value => (key -> Maybe (Action value)) -> Rules ()
-defaultRule = priority 0 . rule
+--   Once you have implemented the basic functionality there is more scope for embracing additional features of Shake, e.g.:
+--
+-- * You can integrate with cached history by providing a working 'BuiltinIdentity' and using 'historySave' and 'historyLoad'.
+--
+-- * You can let users provide their own rules which you interpret with 'addUserRule'.
+--
+-- * You can integrate with linting by specifying a richer 'BuiltinLint' and options like 'lintTrackRead'.
+--
+--   There are lots of rules defined in the Shake repo at <https://github.com/ndmitchell/shake/tree/master/src/Development/Shake/Internal/Rules>.
+--   You are encouraged to read those for inspiration.
+
+-- $example
+--
+--   Shake provides a very comprehensive file rule which currently runs to over 500 lines of code, and supports lots of features
+--   and optimisations. However, let's imagine we want to define a simpler rule type for files. As mentioned earlier, we have to make some decisions.
+--
+-- * A @key@ will just be the file name.
+--
+-- * A @value@ will be @()@ - when the user depends on a file they don't expect any information in return.
+--
+-- * The stored information will be the contents of the file, in it's entirety. Alternative choices would be the modtime or a hash of the contents,
+--   but Shake doesn't require that. The stored information in Shake must be stored in a 'ByteString', so we 'Data.ByteString.pack' and
+--   'Data.ByteString.unpack' to convert.
+--
+-- * We will allow user rules to be defined saying how to build any individual file.
+--
+--   First we define the type of key and value, deriving all the necessary type classes. We define a @newtype@ over 'FilePath' so we can
+--   guarantee not to conflict with anyone else. Typically you wouldn't export the @File@ type, providing only sugar functions over it.
+--
+-- > newtype File = File FilePath
+-- >     deriving (Show,Eq,Hashable,Binary,NFData)
+-- > type instance RuleResult File = ()
+--
+--   Since we have decided we are also going to have user rules, we need to define a new type to capture the information stored by the rules.
+--   We need to store at least the file it is producing and the action, which we do with:
+--
+-- > data FileRule = FileRule File (Action ())
+--
+--   With the definitions above users could call 'apply' and 'addUserRule' directly, but that's tedious and not very type safe. To make it easier
+--   we introduce some helpers:
+--
+-- > fileRule :: FilePath -> Action () -> Rules ()
+-- > fileRule file act = addUserRule $ FileRule (File file) act
+-- >
+-- > fileNeed :: FilePath -> Action ()
+-- > fileNeed = apply1 . File
+--
+--   These helpers just add our type names, providing a more pleasant interface for the user. Using these function we can
+--   exercise our build system with:
+--
+-- > example = do
+-- >     fileRule "a.txt" $ pure ()
+-- >     fileRule "b.txt" $ do
+-- >         fileNeed "a.txt"
+-- >         liftIO $ writeFile "b.txt" . reverse =<< readFile "a.txt"
+-- >
+-- >     action $ fileNeed "b.txt"
+--
+--   This example defines rules for @a.txt@ (a source file) and @b.txt@ (the 'reverse' of @a.txt@). At runtime this example will
+--   complain about not having a builtin rule for @File@, so the only thing left is to provide one.
+--
+-- > addBuiltinFileRule :: Rules ()
+-- > addBuiltinFileRule = addBuiltinRule noLint noIdentity run
+-- >     where
+-- >         fileContents (File x) = do b <- IO.doesFileExist x; if b then IO.readFile' x else pure ""
+-- >
+-- >         run :: BuiltinRun File ()
+-- >         run key old mode = do
+-- >             now <- liftIO $ fileContents key
+-- >             if mode == RunDependenciesSame && fmap BS.unpack old == Just now then
+-- >                 pure $ RunResult ChangedNothing (BS.pack now) ()
+-- >             else do
+-- >                 (_, act) <- getUserRuleOne key (const Nothing) $ \(FileRule k act) -> if k == key then Just act else Nothing
+-- >                 act
+-- >                 now <- liftIO $ fileContents key
+-- >                 pure $ RunResult ChangedRecomputeDiff (BS.pack now) ()
+--
+--   We define a wrapper @addBuiltinFileRule@ that calls @addBuiltinRule@, opting out of linting and cached storage.
+--   The only thing we provide is a 'BuiltinRun' function which gets the previous state, and whether any dependency has changed,
+--   and decides whether to rebuild. If something has changed we call 'getUserRuleOne' to find the users rule and rerun it.
+--   The 'RunResult' says what changed (either 'ChangedNothing' or 'ChangedRecomputeDiff' in our cases), gives us a new stored value
+--   (just packing the contents) and the @value@ which is @()@.
+--
+--   To execute our example we need to also call @addBuiltinFileRule@, and now everything works.
diff --git a/src/Development/Shake/Rules/Directory.hs b/src/Development/Shake/Rules/Directory.hs
deleted file mode 100644
--- a/src/Development/Shake/Rules/Directory.hs
+++ /dev/null
@@ -1,320 +0,0 @@
-{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving, ScopedTypeVariables, DeriveDataTypeable, RecordWildCards, FlexibleContexts #-}
-
--- | Both System.Directory and System.Environment wrappers
-module Development.Shake.Rules.Directory(
-    doesFileExist, doesDirectoryExist,
-    getDirectoryContents, getDirectoryFiles, getDirectoryDirs,
-    getEnv, getEnvWithDefault,
-    removeFiles, removeFilesAfter,
-    getDirectoryFilesIO,
-    defaultRuleDirectory
-    ) where
-
-import Control.Applicative
-import Control.Exception as C
-import Control.Monad.Extra
-import Control.Monad.IO.Class
-import Data.Maybe
-import Data.Binary
-import Data.List
-import Data.Tuple.Extra
-import qualified Data.HashSet as Set
-import qualified System.Directory as IO
-import qualified System.Environment.Extra as IO
-
-import Development.Shake.Core
-import Development.Shake.Classes
-import Development.Shake.FilePath
-import Development.Shake.FilePattern
-import General.Extra
-import Prelude
-
-
-newtype DoesFileExistQ = DoesFileExistQ FilePath
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-instance Show DoesFileExistQ where
-    show (DoesFileExistQ a) = "doesFileExist " ++ showQuote a
-
-newtype DoesFileExistA = DoesFileExistA Bool
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-instance Show DoesFileExistA where
-    show (DoesFileExistA a) = show a
-
-
-newtype DoesDirectoryExistQ = DoesDirectoryExistQ FilePath
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-instance Show DoesDirectoryExistQ where
-    show (DoesDirectoryExistQ a) = "doesDirectoryExist " ++ showQuote a
-
-newtype DoesDirectoryExistA = DoesDirectoryExistA Bool
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-instance Show DoesDirectoryExistA where
-    show (DoesDirectoryExistA a) = show a
-
-
-newtype GetEnvQ = GetEnvQ String
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-instance Show GetEnvQ where
-    show (GetEnvQ a) = "getEnv " ++ showQuote a
-
-newtype GetEnvA = GetEnvA (Maybe String)
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-instance Show GetEnvA where
-    show (GetEnvA a) = maybe "<unset>" showQuote a
-
-
-data GetDirectoryQ
-    = GetDir {dir :: FilePath}
-    | GetDirFiles {dir :: FilePath, pat :: [FilePattern]}
-    | GetDirDirs {dir :: FilePath}
-    deriving (Typeable,Eq)
-
-newtype GetDirectoryA = GetDirectoryA [FilePath]
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-instance Show GetDirectoryQ where
-    show (GetDir x) = "getDirectoryContents " ++ showQuote x
-    show (GetDirFiles a b) = "getDirectoryFiles " ++ showQuote a ++ " [" ++ unwords (map showQuote b) ++ "]"
-    show (GetDirDirs x) = "getDirectoryDirs " ++ showQuote x
-
-instance Show GetDirectoryA where
-    show (GetDirectoryA xs) = unwords $ map showQuote xs
-
-instance NFData GetDirectoryQ where
-    rnf (GetDir a) = rnf a
-    rnf (GetDirFiles a b) = rnf a `seq` rnf b
-    rnf (GetDirDirs a) = rnf a
-
-instance Hashable GetDirectoryQ where
-    hashWithSalt salt = hashWithSalt salt . f
-        where f (GetDir x) = (0 :: Int, x, [])
-              f (GetDirFiles x y) = (1, x, y)
-              f (GetDirDirs x) = (2, x, [])
-
-instance Binary GetDirectoryQ where
-    get = do
-        i <- getWord8
-        case i of
-            0 -> GetDir <$> get
-            1 -> GetDirFiles <$> get <*> get
-            2 -> GetDirDirs <$> get
-
-    put (GetDir x) = putWord8 0 >> put x
-    put (GetDirFiles x y) = putWord8 1 >> put x >> put y
-    put (GetDirDirs x) = putWord8 2 >> put x
-
-
-instance Rule DoesFileExistQ DoesFileExistA where
-    storedValue _ (DoesFileExistQ x) = (Just . DoesFileExistA) <$> IO.doesFileExist x
-
-instance Rule DoesDirectoryExistQ DoesDirectoryExistA where
-    storedValue _ (DoesDirectoryExistQ x) = (Just . DoesDirectoryExistA) <$> IO.doesDirectoryExist x
-
-instance Rule GetEnvQ GetEnvA where
-    storedValue _ (GetEnvQ x) = (Just . GetEnvA) <$> IO.lookupEnv x
-
-instance Rule GetDirectoryQ GetDirectoryA where
-    storedValue _ x = Just <$> getDir x
-
-
--- | This function is not actually exported, but Haddock is buggy. Please ignore.
-defaultRuleDirectory :: Rules ()
-defaultRuleDirectory = do
-    rule $ \(DoesFileExistQ x) -> Just $
-        liftIO $ DoesFileExistA <$> IO.doesFileExist x
-    rule $ \(DoesDirectoryExistQ x) -> Just $
-        liftIO $ DoesDirectoryExistA <$> IO.doesDirectoryExist x
-    rule $ \(x :: GetDirectoryQ) -> Just $
-        liftIO $ getDir x
-    rule $ \(GetEnvQ x) -> Just $
-        liftIO $ GetEnvA <$> IO.lookupEnv x
-
-
--- | Returns 'True' if the file exists. The existence of the file is tracked as a
---   dependency, and if the file is created or deleted the rule will rerun in subsequent builds.
---
---   You should not call 'doesFileExist' on files which can be created by the build system.
-doesFileExist :: FilePath -> Action Bool
-doesFileExist file = do
-    DoesFileExistA res <- apply1 $ DoesFileExistQ $ toStandard file
-    return res
-
--- | Returns 'True' if the directory exists. The existence of the directory is tracked as a
---   dependency, and if the directory is created or delete the rule will rerun in subsequent builds.
---
---   You should not call 'doesDirectoryExist' on directories which can be created by the build system.
-doesDirectoryExist :: FilePath -> Action Bool
-doesDirectoryExist file = do
-    DoesDirectoryExistA res <- apply1 $ DoesDirectoryExistQ $ toStandard file
-    return res
-
--- | Return 'Just' the value of the environment variable, or 'Nothing'
---   if the variable is not set. The environment variable is tracked as a
---   dependency, and if it changes the rule will rerun in subsequent builds.
---   This function is a tracked version of 'getEnv'/'lookupEnv' from the base library.
---
--- @
--- flags <- getEnv \"CFLAGS\"
--- 'cmd' \"gcc -c\" [out] (maybe [] words flags)
--- @
-getEnv :: String -> Action (Maybe String)
-getEnv var = do
-    GetEnvA res <- apply1 $ GetEnvQ var
-    return res
-
--- | Return the value of the environment variable (second argument), or the
---   default value (first argument) if it is not set. Similar to 'getEnv'.
---
--- @
--- flags <- getEnvWithDefault \"-Wall\" \"CFLAGS\"
--- 'cmd' \"gcc -c\" [out] flags
--- @
-getEnvWithDefault :: String -> String -> Action String
-getEnvWithDefault def var = fromMaybe def <$> getEnv var
-
--- | Get the contents of a directory. The result will be sorted, and will not contain
---   the entries @.@ or @..@ (unlike the standard Haskell version). The resulting paths will be relative
---   to the first argument. The result is tracked as a
---   dependency, and if it changes the rule will rerun in subsequent builds.
---
---   It is usually simpler to call either 'getDirectoryFiles' or 'getDirectoryDirs'.
-getDirectoryContents :: FilePath -> Action [FilePath]
-getDirectoryContents x = getDirAction $ GetDir x
-
--- | Get the files anywhere under a directory that match any of a set of patterns.
---   For the interpretation of the patterns see '?=='. All results will be
---   relative to the directory argument. The result is tracked as a
---   dependency, and if it changes the rule will rerun in subsequent builds.
---   Some examples:
---
--- > getDirectoryFiles "Config" ["//*.xml"]
--- >     -- All .xml files anywhere under the Config directory
--- >     -- If Config/foo/bar.xml exists it will return ["foo/bar.xml"]
--- > getDirectoryFiles "Modules" ["*.hs","*.lhs"]
--- >     -- All .hs or .lhs in the Modules directory
--- >     -- If Modules/foo.hs and Modules/foo.lhs exist, it will return ["foo.hs","foo.lhs"]
---
---   If you require a qualified file name it is often easier to use @\"\"@ as the 'FilePath' argument,
---   for example the following two expressions are equivalent:
---
--- > fmap (map ("Config" </>)) (getDirectoryFiles "Config" ["//*.xml"])
--- > getDirectoryFiles "" ["Config//*.xml"]
---
---   If the first argument directory does not exist it will raise an error.
---   If @foo@ does not exist, then the first of these error, but the second will not.
---
--- > getDirectoryFiles "foo" ["//*"] -- error
--- > getDirectoryFiles "" ["foo//*"] -- returns []
---
---   This function is tracked and serves as a dependency. If a rule calls
---   @getDirectoryFiles \"\" [\"*.c\"]@ and someone adds @foo.c@ to the
---   directory, that rule will rebuild. If someone changes one of the @.c@ files,
---   but the /list/ of @.c@ files doesn't change, then it will not rebuild.
---   As a consequence of being tracked, if the contents change during the build
---   (e.g. you are generating @.c@ files in this directory) then the build not reach
---   a stable point, which is an error - detected by running with @--lint@.
---   You should only call this function returning source files.
---
---   For an untracked variant see 'getDirectoryFilesIO'.
-getDirectoryFiles :: FilePath -> [FilePattern] -> Action [FilePath]
-getDirectoryFiles x f = getDirAction $ GetDirFiles x f
-
--- | Get the directories in a directory, not including @.@ or @..@.
---   All directories are relative to the argument directory. The result is tracked as a
---   dependency, and if it changes the rule will rerun in subsequent builds.
---   The rules about creating entries described in 'getDirectoryFiles' also apply here.
---
--- > getDirectoryDirs "/Users"
--- >    -- Return all directories in the /Users directory
--- >    -- e.g. ["Emily","Henry","Neil"]
-getDirectoryDirs :: FilePath -> Action [FilePath]
-getDirectoryDirs x = getDirAction $ GetDirDirs x
-
-getDirAction x = do GetDirectoryA y <- apply1 x; return y
-
-contents :: FilePath -> IO [FilePath]
--- getDirectoryContents "" is equivalent to getDirectoryContents "." on Windows,
--- but raises an error on Linux. We smooth out the difference.
-contents x = fmap (filter $ not . all (== '.')) $ IO.getDirectoryContents $ if x == "" then "." else x
-
-
-answer :: [FilePath] -> GetDirectoryA
-answer = GetDirectoryA . sort
-
-getDir :: GetDirectoryQ -> IO GetDirectoryA
-getDir GetDir{..} = answer <$> contents dir
-
-getDir GetDirDirs{..} = fmap answer $ filterM f =<< contents dir
-    where f x = IO.doesDirectoryExist $ dir </> x
-
-getDir GetDirFiles{..} = answer <$> getDirectoryFilesIO dir pat
-
-
--- | A version of 'getDirectoryFiles' that is in IO, and thus untracked.
-getDirectoryFilesIO :: FilePath -> [FilePattern] -> IO [FilePath]
--- Known infelicity: on Windows, if you search for "foo", but have the file "FOO",
--- it will match if on its own, or not if it is paired with "*", since that forces
--- a full directory scan, and then it uses Haskell equality (case sensitive)
-getDirectoryFilesIO root pat = f "" $ snd $ walk pat
-    where
-        -- Even after we know they are there because we called contents, we still have to check they are directories/files
-        -- as required
-        f dir (Walk op) = f dir . WalkTo . op =<< contents (root </> dir)
-        f dir (WalkTo (files, dirs)) = do
-            files <- filterM (IO.doesFileExist . (root </>)) $ map (dir </>) files
-            dirs <- concatMapM (uncurry f) =<< filterM (IO.doesDirectoryExist . (root </>) . fst) (map (first (dir </>)) dirs)
-            return $ files ++ dirs
-
-
--- | Remove all files and directories that match any of the patterns within a directory.
---   Some examples:
---
--- @
--- 'removeFiles' \"output\" [\"\/\/*\"]        -- delete everything inside \'output\'
--- 'removeFiles' \"output\" [\"\/\/\"]         -- delete \'output\' itself
--- 'removeFiles' \".\" [\"\/\/*.hi\",\"\/\/*.o\"] -- delete all \'.hi\' and \'.o\' files
--- @
---
---   If the argument directory is missing no error is raised.
---   This function will follow symlinks, so should be used with care.
---
---   This function is often useful when writing a @clean@ action for your build system,
---   often as a 'phony' rule.
-removeFiles :: FilePath -> [FilePattern] -> IO ()
-removeFiles dir pat =
-    whenM (IO.doesDirectoryExist dir) $ do
-        let (b,w) = walk pat
-        if b then removeDir dir else f dir w
-    where
-        f dir (Walk op) = f dir . WalkTo . op =<< contents dir
-        f dir (WalkTo (files, dirs)) = do
-            forM_ files $ \fil ->
-                try $ removeItem $ dir </> fil :: IO (Either IOException ())
-            let done = Set.fromList files
-            forM_ (filter (not . flip Set.member done . fst) dirs) $ \(d,w) -> do
-                let dir2 = dir </> d
-                whenM (IO.doesDirectoryExist dir2) $ f dir2 w
-
-        removeItem :: FilePath -> IO ()
-        removeItem x = IO.removeFile x `C.catch` \(_ :: IOException) -> removeDir x
-
-        -- In newer GHC's removeDirectoryRecursive is probably better, but doesn't follow
-        -- symlinks, so it's got different behaviour
-        removeDir :: FilePath -> IO ()
-        removeDir x = do
-            mapM_ (removeItem . (x </>)) =<< contents x
-            IO.removeDirectory x
-
-
--- | Remove files, like 'removeFiles', but executed after the build completes successfully.
---   Useful for implementing @clean@ actions that delete files Shake may have open for building.
-removeFilesAfter :: FilePath -> [FilePattern] -> Action ()
-removeFilesAfter a b = do
-    putLoud $ "Will remove " ++ unwords b ++ " from " ++ a
-    runAfter $ removeFiles a b
diff --git a/src/Development/Shake/Rules/File.hs b/src/Development/Shake/Rules/File.hs
deleted file mode 100644
--- a/src/Development/Shake/Rules/File.hs
+++ /dev/null
@@ -1,306 +0,0 @@
-{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-}
-{-# LANGUAGE ViewPatterns #-}
-
-module Development.Shake.Rules.File(
-    need, needBS, needed, neededBS, needNorm, want,
-    trackRead, trackWrite, trackAllow,
-    defaultRuleFile,
-    (%>), (|%>), (?>), phony, (~>), phonys,
-    -- * Internal only
-    FileQ(..), FileA
-    ) where
-
-import Control.Applicative
-import Control.Monad.Extra
-import Control.Monad.IO.Class
-import System.Directory
-import qualified Data.ByteString.Char8 as BS
-import qualified Data.HashSet as Set
-
-import Development.Shake.Core hiding (trackAllow)
-import qualified Development.Shake.Core as S
-import General.String
-import Development.Shake.ByteString
-import Development.Shake.Classes
-import Development.Shake.FilePath(toStandard)
-import Development.Shake.FilePattern
-import Development.Shake.FileInfo
-import Development.Shake.Types
-import Development.Shake.Errors
-
-import Data.Bits
-import Data.List
-import Data.Maybe
-import System.FilePath(takeDirectory) -- important that this is the system local filepath, or wrong slashes go wrong
-import System.IO.Unsafe(unsafeInterleaveIO)
-
-
-infix 1 %>, ?>, |%>, ~>
-
-
-newtype FileQ = FileQ {fromFileQ :: BSU}
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-instance Show FileQ where show (FileQ x) = unpackU x
-
-data FileA = FileA {-# UNPACK #-} !ModTime {-# UNPACK #-} !FileSize FileHash
-    deriving (Typeable,Eq)
-
-instance Hashable FileA where
-    hashWithSalt salt (FileA a b c) = hashWithSalt salt a `xor` hashWithSalt salt b `xor` hashWithSalt salt c
-
-instance NFData FileA where
-    rnf (FileA a b c) = rnf a `seq` rnf b `seq` rnf c
-
-instance Binary FileA where
-    put (FileA a b c) = put a >> put b >> put c
-    get = liftA3 FileA get get get
-
-instance Show FileA where
-    show (FileA m s h) = "File {mod=" ++ show m ++ ",size=" ++ show s ++ ",digest=" ++ show h ++ "}"
-
-instance Rule FileQ FileA where
-    storedValue ShakeOptions{shakeChange=c} (FileQ x) = do
-        res <- getFileInfoNoDirErr x
-        case res of
-            Nothing -> return Nothing
-            Just (time,size) | c == ChangeModtime -> return $ Just $ FileA time size fileInfoNeq
-            Just (time,size) -> do
-                hash <- unsafeInterleaveIO $ getFileHash x
-                return $ Just $ FileA (if c == ChangeDigest then fileInfoNeq else time) size hash
-
-    equalValue ShakeOptions{shakeChange=c} q (FileA x1 x2 x3) (FileA y1 y2 y3) = case c of
-        ChangeModtime -> bool $ x1 == y1
-        ChangeDigest -> bool $ x2 == y2 && x3 == y3
-        ChangeModtimeOrDigest -> bool $ x1 == y1 && x2 == y2 && x3 == y3
-        _ | x1 == y1 -> EqualCheap
-          | x2 == y2 && x3 == y3 -> EqualExpensive
-          | otherwise -> NotEqual
-        where bool b = if b then EqualCheap else NotEqual
-
-
-storedValueErrDir :: ShakeOptions -> FileQ -> IO (Maybe FileA)
-storedValueErrDir ShakeOptions{shakeChange=c} (FileQ x) = do
-    res <- getFileInfo x
-    case res of
-        Nothing -> return Nothing
-        Just (time,size) | c == ChangeModtime -> return $ Just $ FileA time size fileInfoNeq
-        Just (time,size) -> do
-            hash <- unsafeInterleaveIO $ getFileHash x
-            return $ Just $ FileA (if c == ChangeDigest then fileInfoNeq else time) size hash
-
-
-
--- | Arguments: options; is the file an input; a message for failure if the file does not exist; filename
-storedValueError :: ShakeOptions -> Bool -> String -> FileQ -> IO FileA
-{-
-storedValueError opts False msg x | False && not (shakeOutputCheck opts) = do
-    when (shakeCreationCheck opts) $ do
-        whenM (isNothing <$> (storedValue opts x :: IO (Maybe FileA))) $ error $ msg ++ "\n  " ++ unpackU (fromFileQ x)
-    return $ FileA fileInfoEq fileInfoEq fileInfoEq
--}
-storedValueError opts input msg x = fromMaybe def <$> storedValueErrDir opts2 x
-    where def = if shakeCreationCheck opts || input then error err else FileA fileInfoNeq fileInfoNeq fileInfoNeq
-          err = msg ++ "\n  " ++ unpackU (fromFileQ x)
-          opts2 = if not input && shakeChange opts == ChangeModtimeAndDigestInput then opts{shakeChange=ChangeModtime} else opts
-
-
--- | This function is not actually exported, but Haddock is buggy. Please ignore.
-defaultRuleFile :: Rules ()
-defaultRuleFile = priority 0 $ rule $ \x -> Just $ do
-    opts <- getShakeOptions
-    liftIO $ storedValueError opts True "Error, file does not exist and no rule available:" x
-
-
--- | Add a dependency on the file arguments, ensuring they are built before continuing.
---   The file arguments may be built in parallel, in any order. This function is particularly
---   necessary when calling 'Development.Shake.cmd' or 'Development.Shake.command'. As an example:
---
--- @
--- \"\/\/*.rot13\" '%>' \\out -> do
---     let src = 'Development.Shake.FilePath.dropExtension' out
---     'need' [src]
---     'Development.Shake.cmd' \"rot13\" [src] \"-o\" [out]
--- @
---
---   Usually @need [foo,bar]@ is preferable to @need [foo] >> need [bar]@ as the former allows greater
---   parallelism, while the latter requires @foo@ to finish building before starting to build @bar@.
---
---   This function should not be called with wildcards (e.g. @*.txt@ - use 'getDirectoryFiles' to expand them),
---   environment variables (e.g. @$HOME@ - use 'getEnv' to expand them) or directories (directories cannot be
---   tracked directly - track files within the directory instead).
-need :: [FilePath] -> Action ()
-need xs = (apply $ map (FileQ . packU_ . filepathNormalise . unpackU_ . packU) xs :: Action [FileA]) >> return ()
-
-needNorm :: [FilePath] -> Action ()
-needNorm xs = (apply $ map (FileQ . packU) xs :: Action [FileA]) >> return ()
-
-needBS :: [BS.ByteString] -> Action ()
-needBS xs = (apply $ map (FileQ . packU_ . filepathNormalise) xs :: Action [FileA]) >> return ()
-
-
--- | Like 'need', but if 'shakeLint' is set, check that the file does not rebuild.
---   Used for adding dependencies on files that have already been used in this rule.
-needed :: [FilePath] -> Action ()
-needed xs = do
-    opts <- getShakeOptions
-    if isNothing $ shakeLint opts then need xs else neededCheck $ map packU xs
-
-
-neededBS :: [BS.ByteString] -> Action ()
-neededBS xs = do
-    opts <- getShakeOptions
-    if isNothing $ shakeLint opts then needBS xs else neededCheck $ map packU_ xs
-
-
-neededCheck :: [BSU] -> Action ()
-neededCheck (map (packU_ . filepathNormalise . unpackU_) -> xs) = do
-    opts <- getShakeOptions
-    pre <- liftIO $ mapM (storedValueErrDir opts . FileQ) xs
-    post <- apply $ map FileQ xs :: Action [FileA]
-    let bad = [ (x, if isJust a then "File change" else "File created")
-              | (x, a, b) <- zip3 xs pre post, maybe NotEqual (\a -> equalValue opts (FileQ x) a b) a == NotEqual]
-    case bad of
-        [] -> return ()
-        (file,msg):_ -> liftIO $ errorStructured
-            "Lint checking error - 'needed' file required rebuilding"
-            [("File", Just $ unpackU file)
-            ,("Error",Just msg)]
-            ""
-
-
--- | Track that a file was read by the action preceeding it. If 'shakeLint' is activated
---   then these files must be dependencies of this rule. Calls to 'trackRead' are
---   automatically inserted in 'LintFSATrace' mode.
-trackRead :: [FilePath] -> Action ()
-trackRead = mapM_ (trackUse . FileQ . packU)
-
--- | Track that a file was written by the action preceeding it. If 'shakeLint' is activated
---   then these files must either be the target of this rule, or never referred to by the build system.
---   Calls to 'trackWrite' are automatically inserted in 'LintFSATrace' mode.
-trackWrite :: [FilePath] -> Action ()
-trackWrite = mapM_ (trackChange . FileQ . packU)
-
--- | Allow accessing a file in this rule, ignoring any 'trackRead'\/'trackWrite' calls matching
---   the pattern.
-trackAllow :: [FilePattern] -> Action ()
-trackAllow ps = do
-    opts <- getShakeOptions
-    when (isJust $ shakeLint opts) $
-        S.trackAllow $ \(FileQ x) -> any (?== unpackU x) ps
-
-
--- | Require that the argument files are built by the rules, used to specify the target.
---
--- @
--- main = 'Development.Shake.shake' 'shakeOptions' $ do
---    'want' [\"Main.exe\"]
---    ...
--- @
---
---   This program will build @Main.exe@, given sufficient rules. All arguments to all 'want' calls
---   may be built in parallel, in any order.
---
---   This function is defined in terms of 'action' and 'need', use 'action' if you need more complex
---   targets than 'want' allows.
-want :: [FilePath] -> Rules ()
-want [] = return ()
-want xs = action $ need xs
-
-
-root :: String -> (FilePath -> Bool) -> (FilePath -> Action ()) -> Rules ()
-root help test act = rule $ \(FileQ x_) -> let x = unpackU x_ in
-    if not $ test x then Nothing else Just $ do
-        liftIO $ createDirectoryIfMissing True $ takeDirectory x
-        act x
-        opts <- getShakeOptions
-        liftIO $ storedValueError opts False ("Error, rule " ++ help ++ " failed to build file:") $ FileQ x_
-
-
--- | Declare a Make-style phony action.  A phony target does not name
---   a file (despite living in the same namespace as file rules);
---   rather, it names some action to be executed when explicitly
---   requested.  You can demand 'phony' rules using 'want'. (And 'need',
---   although that's not recommended.)
---
---   Phony actions are intended to define recipes that can be executed
---   by the user. If you 'need' a phony action in a rule then every
---   execution where that rule is required will rerun both the rule and
---   the phony action.  However, note that phony actions are never
---   executed more than once in a single build run.
---
---   In make, the @.PHONY@ attribute on non-file-producing rules has a
---   similar effect.  However, while in make it is acceptable to omit
---   the @.PHONY@ attribute as long as you don't create the file in
---   question, a Shake rule which behaves this way will fail lint.
---   Use a phony rule!  For file-producing rules which should be
---   rerun every execution of Shake, see 'Development.Shake.alwaysRerun'.
-phony :: String -> Action () -> Rules ()
-phony (toStandard -> name) act = phonys $ \s -> if s == name then Just act else Nothing
-
--- | A predicate version of 'phony', return 'Just' with the 'Action' for the matching rules.
-phonys :: (String -> Maybe (Action ())) -> Rules ()
-phonys act = rule $ \(FileQ x_) -> case act $ unpackU x_ of
-    Nothing -> Nothing
-    Just act -> Just $ do
-        act
-        return $ FileA fileInfoNeq fileInfoNeq fileInfoNeq
-
--- | Infix operator alias for 'phony', for sake of consistency with normal
---   rules.
-(~>) :: String -> Action () -> Rules ()
-(~>) = phony
-
-
--- | Define a rule to build files. If the first argument returns 'True' for a given file,
---   the second argument will be used to build it. Usually '%>' is sufficient, but '?>' gives
---   additional power. For any file used by the build system, only one rule should return 'True'.
---   This function will create the directory for the result file, if necessary.
---
--- @
--- (all isUpper . 'Development.Shake.FilePath.takeBaseName') '?>' \\out -> do
---     let src = 'Development.Shake.FilePath.replaceBaseName' out $ map toLower $ takeBaseName out
---     'Development.Shake.writeFile'' out . map toUpper =<< 'Development.Shake.readFile'' src
--- @
---
---   If the 'Action' completes successfully the file is considered up-to-date, even if the file
---   has not changed.
-(?>) :: (FilePath -> Bool) -> (FilePath -> Action ()) -> Rules ()
-(?>) test act = priority 0.5 $ root "with ?>" test act
-
-
--- | Define a set of patterns, and if any of them match, run the associated rule. Defined in terms of '%>'.
---   Think of it as the OR (@||@) equivalent of '%>'.
-(|%>) :: [FilePattern] -> (FilePath -> Action ()) -> Rules ()
-(|%>) pats act = do
-    let (simp,other) = partition simple pats
-    case simp of
-        [] -> return ()
-        [p] -> let pp = toStandard p in root "with |%>" (\x -> toStandard x == pp) act
-        ps -> let ps = Set.fromList $ map toStandard pats in root "with |%>" (flip Set.member ps . toStandard) act
-    unless (null other) $
-        let ps = map (?==) other in priority 0.5 $ root "with |%>" (\x -> any ($ x) ps) act
-
--- | Define a rule that matches a 'FilePattern', see '?==' for the pattern rules.
---   Patterns with no wildcards have higher priority than those with wildcards, and no file
---   required by the system may be matched by more than one pattern at the same priority
---   (see 'priority' and 'alternatives' to modify this behaviour).
---   This function will create the directory for the result file, if necessary.
---
--- @
--- \"*.asm.o\" '%>' \\out -> do
---     let src = 'Development.Shake.FilePath.dropExtension' out
---     'need' [src]
---     'Development.Shake.cmd' \"as\" [src] \"-o\" [out]
--- @
---
---   To define a build system for multiple compiled languages, we recommend using @.asm.o@,
---   @.cpp.o@, @.hs.o@, to indicate which language produces an object file.
---   I.e., the file @foo.cpp@ produces object file @foo.cpp.o@.
---
---   Note that matching is case-sensitive, even on Windows.
---
---   If the 'Action' completes successfully the file is considered up-to-date, even if the file
---   has not changed.
-(%>) :: FilePattern -> (FilePath -> Action ()) -> Rules ()
-(%>) test act = (if simple test then id else priority 0.5) $ root (show test) (test ?==) act
diff --git a/src/Development/Shake/Rules/Files.hs b/src/Development/Shake/Rules/Files.hs
deleted file mode 100644
--- a/src/Development/Shake/Rules/Files.hs
+++ /dev/null
@@ -1,150 +0,0 @@
-{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-}
-
-module Development.Shake.Rules.Files(
-    (&?>), (&%>)
-    ) where
-
-import Control.Monad
-import Control.Monad.IO.Class
-import Data.Maybe
-import Data.List.Extra
-import System.Directory
-import Control.Applicative
-import Prelude
-
-import Development.Shake.Core hiding (trackAllow)
-import General.Extra
-import General.String
-import Development.Shake.Classes
-import Development.Shake.Rules.File
-import Development.Shake.FilePattern
-import Development.Shake.FilePath
-import Development.Shake.Types
-import Development.Shake.ByteString
-
-
-infix 1 &?>, &%>
-
-
-newtype FilesQ = FilesQ [FileQ]
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-
-
-newtype FilesA = FilesA [FileA]
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-
-instance Show FilesA where show (FilesA xs) = unwords $ "Files" : map (drop 5 . show) xs
-
-instance Show FilesQ where show (FilesQ xs) = unwords $ map (showQuote . show) xs
-
-
-instance Rule FilesQ FilesA where
-    storedValue opts (FilesQ xs) = (fmap FilesA . sequence) <$> mapM (storedValue opts) xs
-    equalValue opts (FilesQ qs) (FilesA xs) (FilesA ys)
-        | let n = length qs in n /= length xs || n /= length ys = NotEqual
-        | otherwise = foldr and_ EqualCheap (zipWith3 (equalValue opts) qs xs ys)
-            where and_ NotEqual x = NotEqual
-                  and_ EqualCheap x = x
-                  and_ EqualExpensive x = if x == NotEqual then NotEqual else EqualExpensive
-
-
--- | Define a rule for building multiple files at the same time.
---   Think of it as the AND (@&&@) equivalent of '%>'.
---   As an example, a single invocation of GHC produces both @.hi@ and @.o@ files:
---
--- @
--- [\"*.o\",\"*.hi\"] '&%>' \\[o,hi] -> do
---     let hs = o 'Development.Shake.FilePath.-<.>' \"hs\"
---     'Development.Shake.need' ... -- all files the .hs import
---     'Development.Shake.cmd' \"ghc -c\" [hs]
--- @
---
---   However, in practice, it's usually easier to define rules with '%>' and make the @.hi@ depend
---   on the @.o@. When defining rules that build multiple files, all the 'FilePattern' values must
---   have the same sequence of @\/\/@ and @*@ wildcards in the same order.
---   This function will create directories for the result files, if necessary.
-(&%>) :: [FilePattern] -> ([FilePath] -> Action ()) -> Rules ()
-ps &%> act
-    | not $ compatible ps = error $ unlines $
-        "All patterns to &%> must have the same number and position of // and * wildcards" :
-        ["* " ++ p ++ (if compatible [p, head ps] then "" else " (incompatible)") | p <- ps]
-    | otherwise = do
-        forM_ ps $ \p ->
-            p %> \file -> do
-                _ :: FilesA <- apply1 $ FilesQ $ map (FileQ . packU_ . filepathNormalise . unpackU_ . packU . substitute (extract p file)) ps
-                return ()
-        (if all simple ps then id else priority 0.5) $
-            rule $ \(FilesQ xs_) -> let xs = map (unpackU . fromFileQ) xs_ in
-                if not $ length xs == length ps && and (zipWith (?==) ps xs) then Nothing else Just $ do
-                    liftIO $ mapM_ (createDirectoryIfMissing True) $ nubOrd $ map takeDirectory xs
-                    trackAllow xs
-                    act xs
-                    getFileTimes "&%>" xs_
-
-
--- | Define a rule for building multiple files at the same time, a more powerful
---   and more dangerous version of '&%>'. Think of it as the AND (@&&@) equivalent of '?>'.
---
---   Given an application @test &?> ...@, @test@ should return @Just@ if the rule applies, and should
---   return the list of files that will be produced. This list /must/ include the file passed as an argument and should
---   obey the invariant:
---
--- > forAll $ \x ys -> test x == Just ys ==> x `elem` ys && all ((== Just ys) . test) ys
---
---   As an example of a function satisfying the invariaint:
---
--- @
--- test x | 'Development.Shake.FilePath.takeExtension' x \`elem\` [\".hi\",\".o\"]
---        = Just ['Development.Shake.FilePath.dropExtension' x 'Development.Shake.FilePath.<.>' \"hi\", 'Development.Shake.FilePath.dropExtension' x 'Development.Shake.FilePath.<.>' \"o\"]
--- test _ = Nothing
--- @
---
---   Regardless of whether @Foo.hi@ or @Foo.o@ is passed, the function always returns @[Foo.hi, Foo.o]@.
-(&?>) :: (FilePath -> Maybe [FilePath]) -> ([FilePath] -> Action ()) -> Rules ()
-(&?>) test act = priority 0.5 $ do
-    let norm = toStandard . normaliseEx
-    let inputOutput suf inp out =
-            ["Input" ++ suf ++ ":", "  " ++ inp] ++
-            ["Output" ++ suf ++ ":"] ++ map ("  "++) out
-    let normTest = fmap (map norm) . test
-    let checkedTest x = case normTest x of
-            Nothing -> Nothing
-            Just ys | x `notElem` ys -> error $ unlines $
-                "Invariant broken in &?>, did not return the input (after normalisation)." :
-                inputOutput "" x ys
-            Just ys | bad:_ <- filter ((/= Just ys) . normTest) ys -> error $ unlines $
-                ["Invariant broken in &?>, not equal for all arguments (after normalisation)."] ++
-                inputOutput "1" x ys ++
-                inputOutput "2" bad (fromMaybe ["Nothing"] $ normTest bad)
-            Just ys -> Just ys
-
-    isJust . checkedTest ?> \x -> do
-        -- FIXME: Could optimise this test by calling rule directly and returning FileA Eq Eq Eq
-        --        But only saves noticable time on uncommon Change modes
-        _ :: FilesA <- apply1 $ FilesQ $ map (FileQ . packU_ . filepathNormalise . unpackU_ . packU) $ fromJust $ test x
-        return ()
-
-    rule $ \(FilesQ xs_) -> let xs@(x:_) = map (unpackU . fromFileQ) xs_ in
-        case checkedTest x of
-            Just ys | ys == xs -> Just $ do
-                liftIO $ mapM_ (createDirectoryIfMissing True) $ nubOrd $ map takeDirectory xs
-                act xs
-                getFileTimes "&?>" xs_
-            Just ys -> error $ "Error, &?> is incompatible with " ++ show xs ++ " vs " ++ show ys
-            Nothing -> Nothing
-
-
-getFileTimes :: String -> [FileQ] -> Action FilesA
-getFileTimes name xs = do
-    opts <- getShakeOptions
-    let opts2 = if shakeChange opts == ChangeModtimeAndDigestInput then opts{shakeChange=ChangeModtime} else opts
-    ys <- liftIO $ mapM (storedValue opts2) xs
-    case sequence ys of
-        Just ys -> return $ FilesA ys
-        Nothing | not $ shakeCreationCheck opts -> return $ FilesA []
-        Nothing -> do
-            let missing = length $ filter isNothing ys
-            error $ "Error, " ++ name ++ " rule failed to build " ++ show missing ++
-                    " file" ++ (if missing == 1 then "" else "s") ++ " (out of " ++ show (length xs) ++ ")" ++
-                    concat ["\n  " ++ unpackU x ++ if isNothing y then " - MISSING" else "" | (FileQ x,y) <- zip xs ys]
diff --git a/src/Development/Shake/Rules/Oracle.hs b/src/Development/Shake/Rules/Oracle.hs
deleted file mode 100644
--- a/src/Development/Shake/Rules/Oracle.hs
+++ /dev/null
@@ -1,87 +0,0 @@
-{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables, ConstraintKinds #-}
-{-# LANGUAGE UndecidableInstances #-}
-
-module Development.Shake.Rules.Oracle(
-    addOracle, askOracle, askOracleWith
-    ) where
-
-import Development.Shake.Core
-import Development.Shake.Classes
-import Control.Applicative
-import Prelude
-
-
--- Use short type names, since the names appear in the Haddock, and are too long if they are in full
-newtype OracleQ question = OracleQ question
-    deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
-newtype OracleA answer = OracleA answer
-    deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
-
-instance (ShakeValue q, ShakeValue a) => Rule (OracleQ q) (OracleA a) where
-    storedValue _ _ = return Nothing
-
-
--- | Add extra information which rules can depend on.
---   An oracle is a function from a question type @q@, to an answer type @a@.
---   As an example, we can define an oracle allowing you to depend on the current version of GHC:
---
--- @
--- newtype GhcVersion = GhcVersion () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
--- rules = do
---     'addOracle' $ \\(GhcVersion _) -> fmap 'Development.Shake.fromStdout' $ 'Development.Shake.cmd' \"ghc --numeric-version\" :: Action String
---     ... rules ...
--- @
---
---   If a rule calls @'askOracle' (GhcVersion ())@, that rule will be rerun whenever the GHC version changes.
---   Some notes:
---
--- * We define @GhcVersion@ with a @newtype@ around @()@, allowing the use of @GeneralizedNewtypeDeriving@.
---   All the necessary type classes are exported from "Development.Shake.Classes".
---
--- * Each call to 'addOracle' must use a different type of question.
---
--- * Actions passed to 'addOracle' will be run in every build they are required, even if nothing else changes,
---   so be careful of slow actions.
---   If the result of an oracle does not change it will not invalidate any rules depending on it.
---   To always rerun files rules see 'Development.Shake.alwaysRerun'.
---
--- * If the value returned by 'askOracle' is ignored then 'askOracleWith' may help avoid ambiguous type messages.
---   Alternatively, use the result of 'addOracle', which is 'askOracle' restricted to the correct type.
---
---   As a more complex example, consider tracking Haskell package versions:
---
--- @
--- newtype GhcPkgList = GhcPkgList () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
--- newtype GhcPkgVersion = GhcPkgVersion String deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
---
--- rules = do
---     getPkgList \<- 'addOracle' $ \\GhcPkgList{} -> do
---         Stdout out <- 'Development.Shake.cmd' \"ghc-pkg list --simple-output\"
---         return [(reverse b, reverse a) | x <- words out, let (a,_:b) = break (== \'-\') $ reverse x]
---
---     getPkgVersion \<- 'addOracle' $ \\(GhcPkgVersion pkg) -> do
---         pkgs <- getPkgList $ GhcPkgList ()
---         return $ lookup pkg pkgs
---
---     \"myrule\" %> \\_ -> do
---         getPkgVersion $ GhcPkgVersion \"shake\"
---         ... rule using the shake version ...
--- @
---
---   Using these definitions, any rule depending on the version of @shake@
---   should call @getPkgVersion $ GhcPkgVersion \"shake\"@ to rebuild when @shake@ is upgraded.
-addOracle :: (ShakeValue q, ShakeValue a) => (q -> Action a) -> Rules (q -> Action a)
-addOracle act = do
-    rule $ \(OracleQ q) -> Just $ OracleA <$> act q
-    return askOracle
-
-
--- | Get information previously added with 'addOracle'. The question/answer types must match those provided
---   to 'addOracle'.
-askOracle :: (ShakeValue q, ShakeValue a) => q -> Action a
-askOracle question = do OracleA answer <- apply1 $ OracleQ question; return answer
-
--- | Get information previously added with 'addOracle'. The second argument is not used, but can
---   be useful to fix the answer type, avoiding ambiguous type error messages.
-askOracleWith :: (ShakeValue q, ShakeValue a) => q -> a -> Action a
-askOracleWith question _ = askOracle question
diff --git a/src/Development/Shake/Rules/OrderOnly.hs b/src/Development/Shake/Rules/OrderOnly.hs
deleted file mode 100644
--- a/src/Development/Shake/Rules/OrderOnly.hs
+++ /dev/null
@@ -1,30 +0,0 @@
-
-module Development.Shake.Rules.OrderOnly(
-     orderOnly, orderOnlyBS
-    ) where
-
-import Development.Shake.Core
-import Development.Shake.Rules.File
-import qualified Data.ByteString.Char8 as BS
-
-
--- | Define order-only dependencies, these are dependencies that will always
---   be built before continuing, but which aren't dependencies of this action.
---   Mostly useful for defining generated dependencies you think might be real dependencies.
---   If they turn out to be real dependencies, you should add an explicit dependency afterwards.
---
--- @
--- \"source.o\" %> \\out -> do
---     'orderOnly' [\"header.h\"]
---     () <- 'cmd' \"gcc -c source.c -o source.o -MMD -MF source.m\"
---     'neededMakefileDependencies' \"source.m\"
--- @
---
---   If @header.h@ is included by @source.c@ then the call to 'needMakefileDependencies' will cause
---   it to be added as a real dependency. If it isn't, then the rule won't rebuild if it changes.
-orderOnly :: [FilePath] -> Action ()
-orderOnly = orderOnlyAction . need
-
-
-orderOnlyBS :: [BS.ByteString] -> Action ()
-orderOnlyBS = orderOnlyAction . needBS
diff --git a/src/Development/Shake/Rules/Rerun.hs b/src/Development/Shake/Rules/Rerun.hs
deleted file mode 100644
--- a/src/Development/Shake/Rules/Rerun.hs
+++ /dev/null
@@ -1,42 +0,0 @@
-{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-}
-
-module Development.Shake.Rules.Rerun(
-    defaultRuleRerun, alwaysRerun
-    ) where
-
-import Development.Shake.Core
-import Development.Shake.Classes
-
-
-newtype AlwaysRerunQ = AlwaysRerunQ ()
-    deriving (Typeable,Eq,Hashable,Binary,NFData)
-instance Show AlwaysRerunQ where show _ = "alwaysRerun"
-
-newtype AlwaysRerunA = AlwaysRerunA ()
-    deriving (Typeable,Hashable,Binary,NFData)
-instance Show AlwaysRerunA where show _ = "<none>"
-instance Eq AlwaysRerunA where a == b = False
-
-instance Rule AlwaysRerunQ AlwaysRerunA where
-    storedValue _ _ = return Nothing
-
-
--- | Always rerun the associated action. Useful for defining rules that query
---   the environment. For example:
---
--- @
--- \"ghcVersion.txt\" 'Development.Shake.%>' \\out -> do
---     'alwaysRerun'
---     'Development.Shake.Stdout' stdout <- 'Development.Shake.cmd' \"ghc --numeric-version\"
---     'Development.Shake.writeFileChanged' out stdout
--- @
---
---   In make, the @.PHONY@ attribute on file-producing rules has a similar effect.
---
---   Note that 'alwaysRerun' is applied when a rule is executed. Modifying an existing rule
---   to insert 'alwaysRerun' will /not/ cause that rule to rerun next time.
-alwaysRerun :: Action ()
-alwaysRerun = do AlwaysRerunA _ <- apply1 $ AlwaysRerunQ (); return ()
-
-defaultRuleRerun :: Rules ()
-defaultRuleRerun = rule $ \AlwaysRerunQ{} -> Just $ return $ AlwaysRerunA()
diff --git a/src/Development/Shake/Shake.hs b/src/Development/Shake/Shake.hs
deleted file mode 100644
--- a/src/Development/Shake/Shake.hs
+++ /dev/null
@@ -1,27 +0,0 @@
-
--- | The main entry point that calls all the default rules
-module Development.Shake.Shake(shake) where
-
-import Development.Shake.Types
-import General.Timing
-import Development.Shake.Core
-
-import Development.Shake.Rules.Directory
-import Development.Shake.Rules.File
-import Development.Shake.Rules.Rerun
-
-
--- | Main entry point for running Shake build systems. For an example see the top of the module "Development.Shake".
---   Use 'ShakeOptions' to specify how the system runs, and 'Rules' to specify what to build. The function will throw
---   an exception if the build fails.
---
---   To use command line flags to modify 'ShakeOptions' see 'Development.Shake.shakeArgs'.
-shake :: ShakeOptions -> Rules () -> IO ()
-shake opts r = do
-    addTiming "Function shake"
-    run opts $ do
-        r
-        defaultRuleFile
-        defaultRuleDirectory
-        defaultRuleRerun
-    return ()
diff --git a/src/Development/Shake/Special.hs b/src/Development/Shake/Special.hs
deleted file mode 100644
--- a/src/Development/Shake/Special.hs
+++ /dev/null
@@ -1,20 +0,0 @@
-
--- | This module contains rule types that have special behaviour in some way.
---   Everything in this module is a hack.
-module Development.Shake.Special(
-    specialAlwaysRebuilds,
-    specialIsFileKey
-    ) where
-
-import Development.Shake.Value
-import Data.Typeable
-
-
-specialAlwaysRebuilds :: Value -> Bool
-specialAlwaysRebuilds v = con `elem` ["AlwaysRerunA","OracleA"] || (con == "FileA" && show v == "File {mod=NEQ,size=NEQ,digest=NEQ}")
-    where con = show $ fst $ splitTyConApp $ typeValue v
-
-
-specialIsFileKey :: TypeRep -> Bool
-specialIsFileKey t = con == "FileQ"
-    where con = show $ fst $ splitTyConApp t
diff --git a/src/Development/Shake/Storage.hs b/src/Development/Shake/Storage.hs
deleted file mode 100644
--- a/src/Development/Shake/Storage.hs
+++ /dev/null
@@ -1,256 +0,0 @@
-{-# LANGUAGE ScopedTypeVariables, PatternGuards, RecordWildCards, FlexibleInstances, MultiParamTypeClasses #-}
-{-
-This module stores the meta-data so its very important its always accurate
-We can't rely on getting any exceptions or termination at the end, so we'd better write out a journal
-We store a series of records, and if they contain twice as many records as needed, we compress
--}
-
-module Development.Shake.Storage(
-    withStorage
-    ) where
-
-import General.Binary
-import Development.Shake.Types
-import General.Timing
-import General.FileLock
-
-import Data.Tuple.Extra
-import Control.Exception.Extra
-import Control.Monad.Extra
-import Control.Concurrent.Extra
-import Data.Binary.Get
-import Data.Binary.Put
-import Data.Time
-import Data.Char
-import Development.Shake.Classes
-import qualified Data.HashMap.Strict as Map
-import Data.List
-import Numeric
-import System.Directory
-import System.Exit
-import System.FilePath
-import System.IO
-
-import qualified Data.ByteString.Lazy.Char8 as LBS
-import qualified Data.ByteString.Lazy as LBS8
-
-
-type Map = Map.HashMap
-
--- Increment every time the on-disk format/semantics change,
--- @x@ is for the users version number
-databaseVersion :: String -> String
--- THINGS I WANT TO DO ON THE NEXT CHANGE
--- * Change filepaths to store a 1 byte prefix saying 8bit ASCII or UTF8
--- * Duration and Time should be stored as number of 1/10000th seconds Int32
-databaseVersion x = "SHAKE-DATABASE-11-" ++ s ++ "\r\n"
-    where s = tail $ init $ show x -- call show, then take off the leading/trailing quotes
-                                   -- ensures we do not get \r or \n in the user portion
-
--- Split the version off a file
-splitVersion :: LBS.ByteString -> (LBS.ByteString, LBS.ByteString)
-splitVersion abc = (a `LBS.append` b, c)
-    where (a,bc) = LBS.break (== '\r') abc
-          (b,c) = LBS.splitAt 2 bc
-
-
-withStorage
-    :: (Show k, Show v, Eq w, Eq k, Hashable k
-       ,Binary w, BinaryWith w k, BinaryWith w v)
-    => ShakeOptions             -- ^ Storage options
-    -> (String -> IO ())        -- ^ Logging function
-    -> w                        -- ^ Witness
-    -> (Map k v -> (k -> v -> IO ()) -> IO a)  -- ^ Execute
-    -> IO a
-withStorage ShakeOptions{..} diagnostic witness act = do
-  diagnostic $ "Before fileLock on " ++ shakeFiles </> ".shake.lock"
-  withLockFile (shakeFiles </> ".shake.lock") $ do
-    diagnostic "After fileLock"
-    let dbfile = shakeFiles </> ".shake.database"
-        bupfile = shakeFiles </> ".shake.backup"
-    createDirectoryIfMissing True shakeFiles
-
-    -- complete a partially failed compress
-    b <- doesFileExist bupfile
-    when b $ do
-        unexpected "Backup file exists, restoring over the previous file\n"
-        diagnostic "Backup file move to original"
-        ignore $ removeFile dbfile
-        renameFile bupfile dbfile
-
-    addTiming "Database read"
-    withBinaryFile dbfile ReadWriteMode $ \h -> do
-        n <- hFileSize h
-        diagnostic $ "Reading file of size " ++ show n
-        (oldVer,src) <- fmap splitVersion $ LBS.hGet h $ fromInteger n
-
-        verEqual <- evaluate $ ver == oldVer -- force it so we don't leak the bytestring
-        if not verEqual && not shakeVersionIgnore then do
-            unless (n == 0) $ do
-                let limit x = let (a,b) = splitAt 200 x in a ++ (if null b then "" else "...")
-                let disp = map (\x -> if isPrint x && isAscii x then x else '?') . takeWhile (`notElem` "\r\n")
-                outputErr $ unlines
-                    ["Error when reading Shake database - invalid version stamp detected:"
-                    ,"  File:      " ++ dbfile
-                    ,"  Expected:  " ++ disp (LBS.unpack ver)
-                    ,"  Found:     " ++ disp (limit $ LBS.unpack oldVer)
-                    ,"All rules will be rebuilt"]
-            continue h Map.empty
-         else
-            -- make sure you are not handling exceptions from inside
-            join $ handleBool (not . asyncException) (\err -> do
-                msg <- showException err
-                outputErr $ unlines $
-                    ("Error when reading Shake database " ++ dbfile) :
-                    map ("  "++) (lines msg) ++
-                    ["All files will be rebuilt"]
-                when shakeStorageLog $ do
-                    hSeek h AbsoluteSeek 0
-                    i <- hFileSize h
-                    bs <- LBS.hGet h $ fromInteger i
-                    let cor = shakeFiles </> ".shake.corrupt"
-                    LBS.writeFile cor bs
-                    unexpected $ "Backup of corrupted file stored at " ++ cor ++ ", " ++ show i ++ " bytes\n"
-
-                -- exitFailure -- should never happen without external corruption
-                               -- add back to check during random testing
-                return $ continue h Map.empty) $
-                case readChunks src of
-                    ([], slop) -> do
-                        when (LBS.length slop > 0) $ unexpected $ "Last " ++ show slop ++ " bytes do not form a whole record\n"
-                        diagnostic $ "Read 0 chunks, plus " ++ show slop ++ " slop"
-                        return $ continue h Map.empty
-                    (w:xs, slopRaw) -> do
-                        let slop = fromIntegral $ LBS.length slopRaw
-                        when (slop > 0) $ unexpected $ "Last " ++ show slop ++ " bytes do not form a whole record\n"
-                        diagnostic $ "Read " ++ show (length xs + 1) ++ " chunks, plus " ++ show slop ++ " slop"
-                        let ws = decode w
-                            f mp (k, v) = Map.insert k v mp
-                            ents = map (runGet $ getWith ws) xs
-                            mp = foldl' f Map.empty ents
-
-                        when (shakeVerbosity == Diagnostic) $ do
-                            let raw x = "[len " ++ show (LBS.length x) ++ "] " ++ concat
-                                        [['0' | length c == 1] ++ c | x <- LBS8.unpack x, let c = showHex x ""]
-                            let pretty (Left x) = "FAILURE: " ++ show x
-                                pretty (Right x) = x
-                            diagnostic $ "Witnesses " ++ raw w
-                            forM_ (zip3 [1..] xs ents) $ \(i,x,ent) -> do
-                                x2 <- try_ $ evaluate $ let s = show ent in rnf s `seq` s
-                                diagnostic $ "Chunk " ++ show i ++ " " ++ raw x ++ " " ++ pretty x2
-                            diagnostic $ "Slop " ++ raw slopRaw
-
-                        diagnostic $ "Found " ++ show (Map.size mp) ++ " real entries"
-
-                        -- if mp is null, continue will reset it, so no need to clean up
-                        if verEqual && (Map.null mp || (ws == witness && Map.size mp * 2 > length xs - 2)) then do
-                            -- make sure we reset to before the slop
-                            when (not (Map.null mp) && slop /= 0) $ do
-                                diagnostic $ "Dropping last " ++ show slop ++ " bytes of database (incomplete)"
-                                now <- hFileSize h
-                                hSetFileSize h $ now - slop
-                                hSeek h AbsoluteSeek $ now - slop
-                                hFlush h
-                                diagnostic "Drop complete"
-                            return $ continue h mp
-                         else do
-                            addTiming "Database compression"
-                            unexpected "Compressing database\n"
-                            diagnostic "Compressing database"
-                            hClose h -- two hClose are fine
-                            return $ do
-                                renameFile dbfile bupfile
-                                withBinaryFile dbfile ReadWriteMode $ \h -> do
-                                    reset h mp
-                                    removeFile bupfile
-                                    diagnostic "Compression complete"
-                                    continue h mp
-    where
-        unexpected x = when shakeStorageLog $ do
-            t <- getCurrentTime
-            appendFile (shakeFiles </> ".shake.storage.log") $ "\n[" ++ show t ++ "]: " ++ x
-        outputErr x = do
-            when (shakeVerbosity >= Quiet) $ shakeOutput Quiet x
-            unexpected x
-
-        ver = LBS.pack $ databaseVersion shakeVersion
-
-        writeChunk h s = do
-            diagnostic $ "Writing chunk " ++ show (LBS.length s)
-            LBS.hPut h $ toChunk s
-
-        reset h mp = do
-            diagnostic $ "Resetting database to " ++ show (Map.size mp) ++ " elements"
-            hSetFileSize h 0
-            hSeek h AbsoluteSeek 0
-            LBS.hPut h ver
-            writeChunk h $ encode witness
-            mapM_ (writeChunk h . runPut . putWith witness) $ Map.toList mp
-            hFlush h
-            diagnostic "Flush"
-
-        -- continuation (since if we do a compress, h changes)
-        continue h mp = do
-            when (Map.null mp) $
-                reset h mp -- might as well, no data to lose, and need to ensure a good witness table
-                           -- also lets us recover in the case of corruption
-            flushThread shakeFlush h $ \out -> do
-                addTiming "With database"
-                act mp $ \k v -> out $ toChunk $ runPut $ putWith witness (k, v)
-
-
--- We avoid calling flush too often on SSD drives, as that can be slow
--- Make sure all exceptions happen on the caller, so we don't have to move exceptions back
--- Make sure we only write on one thread, otherwise async exceptions can cause partial writes
-flushThread :: Maybe Double -> Handle -> ((LBS.ByteString -> IO ()) -> IO a) -> IO a
-flushThread flush h act = do
-    chan <- newChan -- operations to perform on the file
-    kick <- newEmptyMVar -- kicked whenever something is written
-    died <- newBarrier -- has the writing thread finished
-
-    flusher <- case flush of
-        Nothing -> return Nothing
-        Just flush -> fmap Just $ forkIO $ forever $ do
-            takeMVar kick
-            threadDelay $ ceiling $ flush * 1000000
-            tryTakeMVar kick
-            writeChan chan $ hFlush h >> return True
-
-    root <- myThreadId
-    writer <- forkIO $ handle_ (\e -> signalBarrier died () >> throwTo root e) $
-        -- only one thread ever writes, ensuring only the final write can be torn
-        whileM $ join $ readChan chan
-
-    (act $ \s -> do
-            evaluate $ LBS.length s -- ensure exceptions occur on this thread
-            writeChan chan $ LBS.hPut h s >> tryPutMVar kick () >> return True)
-        `finally` do
-            maybe (return ()) killThread flusher
-            writeChan chan $ signalBarrier died () >> return False
-            waitBarrier died
-
-
--- Return the amount of junk at the end, along with all the chunk
-readChunks :: LBS.ByteString -> ([LBS.ByteString], LBS.ByteString)
-readChunks x
-    | Just (n, x) <- grab 4 x
-    , Just (y, x) <- grab (fromIntegral (decode n :: Word32)) x
-    = first (y :) $ readChunks x
-    | otherwise = ([], x)
-    where
-        grab i x | LBS.length a == i = Just (a, b)
-                 | otherwise = Nothing
-            where (a,b) = LBS.splitAt i x
-
-
-toChunk :: LBS.ByteString -> LBS.ByteString
-toChunk x = n `LBS.append` x
-    where n = encode (fromIntegral $ LBS.length x :: Word32)
-
-
--- | Is the exception asyncronous, not a "coding error" that should be ignored
-asyncException :: SomeException -> Bool
-asyncException e
-    | Just (_ :: AsyncException) <- fromException e = True
-    | Just (_ :: ExitCode) <- fromException e = True
-    | otherwise = False
diff --git a/src/Development/Shake/Types.hs b/src/Development/Shake/Types.hs
deleted file mode 100644
--- a/src/Development/Shake/Types.hs
+++ /dev/null
@@ -1,248 +0,0 @@
-{-# LANGUAGE DeriveDataTypeable, PatternGuards #-}
-
--- | Types exposed to the user
-module Development.Shake.Types(
-    Progress(..), Verbosity(..), Assume(..), Lint(..), Change(..), EqualCost(..),
-    ShakeOptions(..), shakeOptions
-    ) where
-
-import Data.Data
-import Data.List
-import Data.Dynamic
-import qualified Data.HashMap.Strict as HashMap
-import Development.Shake.Progress
-import Development.Shake.FilePattern
-import qualified Data.ByteString.Char8 as BS
-import qualified Data.ByteString.UTF8 as UTF8
-import Development.Shake.CmdOption
-
-
--- | The current assumptions made by the build system, used by 'shakeAssume'. These options
---   allow the end user to specify that any rules run are either to be treated as clean, or as
---   dirty, regardless of what the build system thinks.
---
---   These assumptions only operate on files reached by the current 'Development.Shake.action' commands. Any
---   other files in the database are left unchanged.
-data Assume
-    = AssumeDirty
-        -- ^ Assume that all rules reached are dirty and require rebuilding, equivalent to 'Development.Shake.Rule.storedValue' always
-        --   returning 'Nothing'. Useful to undo the results of 'AssumeClean', for benchmarking rebuild speed and
-        --   for rebuilding if untracked dependencies have changed. This assumption is safe, but may cause
-        --   more rebuilding than necessary.
-    | AssumeClean
-        -- ^ /This assumption is unsafe, and may lead to incorrect build results in this run, and in future runs/.
-        --   Assume and record that all rules reached are clean and do not require rebuilding, provided the rule
-        --   has a 'Development.Shake.Rule.storedValue' and has been built before. Useful if you have modified a file in some
-        --   inconsequential way, such as only the comments or whitespace, and wish to avoid a rebuild.
-    | AssumeSkip
-        -- ^ /This assumption is unsafe, and may lead to incorrect build results in this run/.
-        --   Assume that all rules reached are clean in this run. Only useful for benchmarking, to remove any overhead
-        --   from running 'Development.Shake.Rule.storedValue' operations.
-      deriving (Eq,Ord,Show,Read,Typeable,Data,Enum,Bounded)
-
-
--- | Which lint checks to perform, used by 'shakeLint'.
-data Lint
-    = LintBasic
-        -- ^ The most basic form of linting. Checks that the current directory does not change and that results do not change after they
-        --   are first written. Any calls to 'needed' will assert that they do not cause a rule to be rebuilt.
-    | LintFSATrace
-        -- ^ Track which files are accessed by command line programs
-        -- using <https://github.com/jacereda/fsatrace fsatrace>.
-      deriving (Eq,Ord,Show,Read,Typeable,Data,Enum,Bounded)
-
-
--- | How should you determine if a file has changed, used by 'shakeChange'. The most common values are
---   'ChangeModtime' (very fast, @touch@ causes files to rebuild) and 'ChangeModtimeAndDigestInput'
---   (a bit slower, @touch@ does not cause input files to rebuild).
-data Change
-    = ChangeModtime
-        -- ^ Compare equality of modification timestamps, a file has changed if its last modified time changes.
-        --   A @touch@ will force a rebuild. This mode is fast and usually sufficiently accurate, so is the default.
-    | ChangeDigest
-        -- ^ Compare equality of file contents digests, a file has changed if its digest changes.
-        --   A @touch@ will not force a rebuild. Use this mode if modification times on your file system are unreliable.
-    | ChangeModtimeAndDigest
-        -- ^ A file is rebuilt if both its modification time and digest have changed. For efficiency reasons, the modification
-        --   time is checked first, and if that has changed, the digest is checked.
-    | ChangeModtimeAndDigestInput
-        -- ^ Use 'ChangeModtimeAndDigest' for input\/source files and 'ChangeModtime' for output files.
-    | ChangeModtimeOrDigest
-        -- ^ A file is rebuilt if either its modification time or its digest has changed. A @touch@ will force a rebuild,
-        --   but even if a files modification time is reset afterwards, changes will also cause a rebuild.
-      deriving (Eq,Ord,Show,Read,Typeable,Data,Enum,Bounded)
-
-
--- | Options to control the execution of Shake, usually specified by overriding fields in
---   'shakeOptions':
---
---   @ 'shakeOptions'{'shakeThreads'=4, 'shakeReport'=[\"report.html\"]} @
---
---   The 'Data' instance for this type reports the 'shakeProgress' and 'shakeOutput' fields as having the abstract type 'Hidden',
---   because 'Data' cannot be defined for functions or 'TypeRep's.
-data ShakeOptions = ShakeOptions
-    {shakeFiles :: FilePath
-        -- ^ Defaults to @.shake@. The directory used for storing Shake metadata files.
-        --   All metadata files will be named @'shakeFiles'\/.shake./file-name/@, for some @/file-name/@.
-        --   If the 'shakeFiles' directory does not exist it will be created.
-    ,shakeThreads :: Int
-        -- ^ Defaults to @1@. Maximum number of rules to run in parallel, similar to @make --jobs=/N/@.
-        --   For many build systems, a number equal to or slightly less than the number of physical processors
-        --   works well. Use @0@ to match the detected number of processors (when @0@, 'getShakeOptions' will
-        --   return the number of threads used).
-    ,shakeVersion :: String
-        -- ^ Defaults to @"1"@. The version number of your build rules.
-        --   Change the version number to force a complete rebuild, such as when making
-        --   significant changes to the rules that require a wipe. The version number should be
-        --   set in the source code, and not passed on the command line.
-    ,shakeVerbosity :: Verbosity
-        -- ^ Defaults to 'Normal'. What level of messages should be printed out.
-    ,shakeStaunch :: Bool
-        -- ^ Defaults to 'False'. Operate in staunch mode, where building continues even after errors,
-        --   similar to @make --keep-going@.
-    ,shakeReport :: [FilePath]
-        -- ^ Defaults to @[]@. Write a profiling report to a file, showing which rules rebuilt,
-        --   why, and how much time they took. Useful for improving the speed of your build systems.
-        --   If the file extension is @.json@ it will write JSON data; if @.js@ it will write Javascript;
-        --   if @.trace@ it will write trace events (load into @about:\/\/tracing@ in Chrome);
-        --   otherwise it will write HTML.
-    ,shakeLint :: Maybe Lint
-        -- ^ Defaults to 'Nothing'. Perform sanity checks during building, see 'Lint' for details.
-    ,shakeLintInside :: [FilePath]
-        -- ^ Directories in which the files will be tracked by the linter.
-    ,shakeLintIgnore :: [FilePattern]
-        -- ^ File patterns which are ignored from linter tracking, a bit like calling 'Development.Shake.trackAllow' in every rule.
-    ,shakeCommandOptions :: [CmdOption]
-        -- ^ Defaults to @[]@. Additional options to be passed to all command invocations.
-    ,shakeFlush :: Maybe Double
-        -- ^ Defaults to @'Just' 10@. How often to flush Shake metadata files in seconds, or 'Nothing' to never flush explicitly.
-        --   It is possible that on abnormal termination (not Haskell exceptions) any rules that completed in the last
-        --   'shakeFlush' seconds will be lost.
-    ,shakeAssume :: Maybe Assume
-        -- ^ Defaults to 'Nothing'. Assume all build objects are clean/dirty, see 'Assume' for details.
-        --   Can be used to implement @make --touch@.
-    ,shakeAbbreviations :: [(String,String)]
-        -- ^ Defaults to @[]@. A list of substrings that should be abbreviated in status messages, and their corresponding abbreviation.
-        --   Commonly used to replace the long paths (e.g. @.make\/i586-linux-gcc\/output@) with an abbreviation (e.g. @$OUT@).
-    ,shakeStorageLog :: Bool
-        -- ^ Defaults to 'False'. Write a message to @'shakeFiles'\/.shake.storage.log@ whenever a storage event happens which may impact
-        --   on the current stored progress. Examples include database version number changes, database compaction or corrupt files.
-    ,shakeLineBuffering :: Bool
-        -- ^ Defaults to 'True'. Change 'stdout' and 'stderr' to line buffering while running Shake.
-    ,shakeTimings :: Bool
-        -- ^ Defaults to 'False'. Print timing information for each stage at the end.
-    ,shakeRunCommands :: Bool
-        -- ^ Default to 'True'. Should you run command line actions, set to 'False' to skip actions whose output streams and exit code
-        --   are not used. Useful for profiling the non-command portion of the build system.
-    ,shakeChange :: Change
-        -- ^ Default to 'ChangeModtime'. How to check if a file has changed, see 'Change' for details.
-    ,shakeCreationCheck :: Bool
-        -- ^ Default to 'True'. After running a rule to create a file, is it an error if the file does not exist.
-        --   Provided for compatibility with @make@ and @ninja@ (which have ugly file creation semantics).
-
---    ,shakeOutputCheck :: Bool
---        -- ^ Default to 'True'. If a file produced by a rule changes, should you rebuild it.
-    ,shakeLiveFiles :: [FilePath]
-        -- ^ Default to @[]@. After the build system completes, write a list of all files which were /live/ in that run,
-        --   i.e. those which Shake checked were valid or rebuilt. Produces best answers if nothing rebuilds.
-    ,shakeVersionIgnore :: Bool
-        -- ^ Defaults to 'False'. Ignore any differences in 'shakeVersion'.
-    ,shakeProgress :: IO Progress -> IO ()
-        -- ^ Defaults to no action. A function called when the build starts, allowing progress to be reported.
-        --   The function is called on a separate thread, and that thread is killed when the build completes.
-        --   For applications that want to display progress messages, 'progressSimple' is often sufficient, but more advanced
-        --   users should look at the 'Progress' data type.
-    ,shakeOutput :: Verbosity -> String -> IO ()
-        -- ^ Defaults to writing using 'putStrLn'. A function called to output messages from Shake, along with the 'Verbosity' at
-        --   which that message should be printed. This function will be called atomically from all other 'shakeOutput' functions.
-        --   The 'Verbosity' will always be greater than or higher than 'shakeVerbosity'.
-    ,shakeExtra :: HashMap.HashMap TypeRep Dynamic
-        -- ^ This a map which can be used to store arbitrary extra
-        --   information that a user may need when writing 'Rule's.  The
-        --   correct way to use this is to define a (hidden) newtype to
-        --   use as a key, so that conflicts cannot occur.
-    }
-    deriving Typeable
-
--- | The default set of 'ShakeOptions'.
-shakeOptions :: ShakeOptions
-shakeOptions = ShakeOptions
-    ".shake" 1 "1" Normal False [] Nothing [] [] [] (Just 10) Nothing [] False True False
-    True ChangeModtime True [] False
-    (const $ return ())
-    (const $ BS.putStrLn . UTF8.fromString) -- try and output atomically using BS
-    HashMap.empty
-
-fieldsShakeOptions =
-    ["shakeFiles", "shakeThreads", "shakeVersion", "shakeVerbosity", "shakeStaunch", "shakeReport"
-    ,"shakeLint", "shakeLintInside", "shakeLintIgnore", "shakeCommandOptions"
-    ,"shakeFlush", "shakeAssume", "shakeAbbreviations", "shakeStorageLog"
-    ,"shakeLineBuffering", "shakeTimings", "shakeRunCommands", "shakeChange", "shakeCreationCheck"
-    ,"shakeLiveFiles","shakeVersionIgnore","shakeProgress", "shakeOutput", "shakeExtra"]
-tyShakeOptions = mkDataType "Development.Shake.Types.ShakeOptions" [conShakeOptions]
-conShakeOptions = mkConstr tyShakeOptions "ShakeOptions" fieldsShakeOptions Prefix
-unhide x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 y1 y2 y3 =
-    ShakeOptions x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 (fromHidden y1) (fromHidden y2) (fromHidden y3)
-
-instance Data ShakeOptions where
-    gfoldl k z (ShakeOptions x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 y1 y2 y3) =
-        z unhide `k` x1 `k` x2 `k` x3 `k` x4 `k` x5 `k` x6 `k` x7 `k` x8 `k` x9 `k` x10 `k` x11 `k`
-        x12 `k` x13 `k` x14 `k` x15 `k` x16 `k` x17 `k` x18 `k` x19 `k` x20 `k` x21 `k`
-        Hidden y1 `k` Hidden y2 `k` Hidden y3
-    gunfold k z c = k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ k $ z unhide
-    toConstr ShakeOptions{} = conShakeOptions
-    dataTypeOf _ = tyShakeOptions
-
-instance Show ShakeOptions where
-    show x = "ShakeOptions {" ++ intercalate ", " inner ++ "}"
-        where
-            inner = zipWith (\x y -> x ++ " = " ++ y) fieldsShakeOptions $ gmapQ f x
-
-            f x | Just x <- cast x = show (x :: Int)
-                | Just x <- cast x = show (x :: FilePath)
-                | Just x <- cast x = show (x :: Verbosity)
-                | Just x <- cast x = show (x :: Change)
-                | Just x <- cast x = show (x :: Bool)
-                | Just x <- cast x = show (x :: [FilePath])
-                | Just x <- cast x = show (x :: Maybe Assume)
-                | Just x <- cast x = show (x :: Maybe Lint)
-                | Just x <- cast x = show (x :: Maybe Double)
-                | Just x <- cast x = show (x :: [(String,String)])
-                | Just x <- cast x = show (x :: Hidden (IO Progress -> IO ()))
-                | Just x <- cast x = show (x :: Hidden (Verbosity -> String -> IO ()))
-                | Just x <- cast x = show (x :: Hidden (HashMap.HashMap TypeRep Dynamic))
-                | Just x <- cast x = show (x :: [CmdOption])
-                | otherwise = error $ "Error while showing ShakeOptions, missing alternative for " ++ show (typeOf x)
-
-
--- | Internal type, copied from Hide in Uniplate
-newtype Hidden a = Hidden {fromHidden :: a}
-    deriving Typeable
-
-instance Show (Hidden a) where show _ = "<hidden>"
-
-instance Typeable a => Data (Hidden a) where
-    gfoldl k z = z
-    gunfold k z c = error "Development.Shake.Types.ShakeProgress: gunfold not implemented - data type has no constructors"
-    toConstr _ = error "Development.Shake.Types.ShakeProgress: toConstr not implemented - data type has no constructors"
-    dataTypeOf _ = tyHidden
-
-tyHidden = mkDataType "Development.Shake.Types.Hidden" []
-
-
--- | The verbosity data type, used by 'shakeVerbosity'.
-data Verbosity
-    = Silent -- ^ Don't print any messages.
-    | Quiet  -- ^ Only print essential messages, typically errors.
-    | Normal -- ^ Print errors and @# /command-name/ (for /file-name/)@ when running a 'Development.Shake.traced' command.
-    | Loud   -- ^ Print errors and full command lines when running a 'Development.Shake.command' or 'Development.Shake.cmd' command.
-    | Chatty -- ^ Print errors, full command line and status messages when starting a rule.
-    | Diagnostic -- ^ Print messages for virtually everything (mostly for debugging).
-      deriving (Eq,Ord,Show,Read,Typeable,Data,Enum,Bounded)
-
--- | An equality check and a cost.
-data EqualCost
-    = EqualCheap -- ^ The equality check was cheap.
-    | EqualExpensive -- ^ The equality check was expensive, as the results are not trivially equal.
-    | NotEqual -- ^ The values are not equal.
-      deriving (Eq,Ord,Show,Read,Typeable,Data,Enum,Bounded)
diff --git a/src/Development/Shake/Util.hs b/src/Development/Shake/Util.hs
--- a/src/Development/Shake/Util.hs
+++ b/src/Development/Shake/Util.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -Wno-unused-imports #-} -- Required since foldl' moves to the prelude
 
 -- | A module for useful utility functions for Shake build systems.
 module Development.Shake.Util(
@@ -6,17 +7,15 @@
     ) where
 
 import Development.Shake
-import Development.Shake.Rules.File
+import Development.Shake.Internal.Rules.File
 import qualified Data.ByteString.Char8 as BS
-import qualified Development.Shake.ByteString as BS
+import qualified General.Makefile as BS
 import Data.Tuple.Extra
-import Control.Applicative
-import Data.List
-import System.Console.GetOpt
+import Data.List (foldl')
+import General.GetOpt
 import Data.IORef
 import Data.Maybe
 import Control.Monad.Extra
-import Prelude
 import System.IO.Extra as IO
 
 
@@ -52,7 +51,7 @@
 -- data Flags = Flags {distCC :: Bool} deriving Eq
 -- flags = [Option \"\" [\"distcc\"] (NoArg $ Right $ \\x -> x{distCC=True}) \"Run distributed.\"]
 --
--- main = 'shakeArgsAccumulate' 'shakeOptions' flags (Flags False) $ \\flags targets -> return $ Just $ do
+-- main = 'shakeArgsAccumulate' 'shakeOptions' flags (Flags False) $ \\flags targets -> pure $ Just $ do
 --     if null targets then 'want' [\"result.exe\"] else 'want' targets
 --     let compiler = if distCC flags then \"distcc\" else \"gcc\"
 --     \"*.o\" '%>' \\out -> do
@@ -70,32 +69,23 @@
 --   the second argument is called with a list of the files that the build checked were up-to-date.
 shakeArgsPrune :: ShakeOptions -> ([FilePath] -> IO ()) -> Rules () -> IO ()
 shakeArgsPrune opts prune rules = shakeArgsPruneWith opts prune [] f
-    where f _ files = return $ Just $ if null files then rules else want files >> withoutActions rules
+    where f _ files = pure $ Just $ if null files then rules else want files >> withoutActions rules
 
 
 -- | A version of 'shakeArgsPrune' that also takes a list of extra options to use.
 shakeArgsPruneWith :: ShakeOptions -> ([FilePath] -> IO ()) -> [OptDescr (Either String a)] -> ([a] -> [String] -> IO (Maybe (Rules ()))) -> IO ()
 shakeArgsPruneWith opts prune flags act = do
-    let flags2 = Option "P" ["prune"] (NoArg $ Right Nothing) "Remove stale files" : map (fmapOptDescr $ fmap Just) flags
+    let flags2 = Option "P" ["prune"] (NoArg $ Right Nothing) "Remove stale files" : map (fmapFmapOptDescr Just) flags
     pruning <- newIORef False
     shakeArgsWith opts flags2 $ \opts args ->
-        if any isNothing opts then do
-            writeIORef pruning True
-            return Nothing
-        else
-            act (map fromJust opts) args
+        case sequence opts of
+            Nothing -> do
+                writeIORef pruning True
+                pure Nothing
+            Just opts -> act opts args
     whenM (readIORef pruning) $
         IO.withTempFile $ \file -> do
             shakeArgsWith opts{shakeLiveFiles=file : shakeLiveFiles opts} flags2 $ \opts args ->
                 act (catMaybes opts) args
             src <- lines <$> IO.readFile' file
             prune src
-
--- fmap is only an instance in later GHC versions, so fake our own version
-fmapOptDescr :: (a -> b) -> OptDescr a -> OptDescr b
-fmapOptDescr f (Option a b argDescr c) = Option a b (fmapArgDescr f argDescr) c
-
-fmapArgDescr :: (a -> b) -> ArgDescr a -> ArgDescr b
-fmapArgDescr f (NoArg a)    = NoArg (f a)
-fmapArgDescr f (ReqArg g s) = ReqArg (f . g) s
-fmapArgDescr f (OptArg g s) = OptArg (f . g) s
diff --git a/src/Development/Shake/Value.hs b/src/Development/Shake/Value.hs
deleted file mode 100644
--- a/src/Development/Shake/Value.hs
+++ /dev/null
@@ -1,172 +0,0 @@
-{-# LANGUAGE ExistentialQuantification, GeneralizedNewtypeDeriving, MultiParamTypeClasses, ConstraintKinds #-}
-
-{- |
-This module implements the Key/Value types, to abstract over hetrogenous data types.
--}
-module Development.Shake.Value(
-    Value, newValue, fromValue, typeValue,
-    Key, newKey, fromKey, typeKey,
-    Witness, currentWitness, registerWitness,
-    ShakeValue
-    ) where
-
-import General.Binary
-import Development.Shake.Classes
-import Development.Shake.Errors
-import Data.Typeable
-
-import Data.Bits
-import Data.Function
-import Data.IORef
-import Data.List
-import Data.Maybe
-import qualified Data.HashMap.Strict as Map
-import qualified Data.ByteString.Char8 as BS
-import System.IO.Unsafe
-
--- | Define an alias for the six type classes required for things involved in Shake 'Development.Shake.Rule's.
---   Using this alias requires the @ConstraintKinds@ extension.
---
---   To define your own values meeting the necessary constraints it is convenient to use the extensions
---   @GeneralizedNewtypeDeriving@ and @DeriveDataTypeable@ to write:
---
--- > newtype MyType = MyType (String, Bool) deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
---
---   Shake needs these instances on keys and values. They are used for:
---
--- * 'Show' is used to print out keys in errors, profiling, progress messages
---   and diagnostics.
---
--- * 'Typeable' is used because Shake indexes its database by the
---   type of the key and value involved in the rule (overlap is not
---   allowed for type classes and not allowed in Shake either).
---
--- * 'Eq' and 'Hashable' are used on keys in order to build hash maps
---   from keys to values.  'Eq' is used on values to test if the value
---   has changed or not (this is used to support unchanging rebuilds,
---   where Shake can avoid rerunning rules if it runs a dependency,
---   but it turns out that no changes occurred.)  The 'Hashable'
---   instances are only use at runtime (never serialised to disk),
---   so they do not have to be stable across runs.
---   Hashable on values is not used, and only required for a consistent interface.
---
--- * 'Binary' is used to serialize keys and values into Shake's
---   build database; this lets Shake cache values across runs and
---   implement unchanging rebuilds.
---
--- * 'NFData' is used to avoid space and thunk leaks, especially
---   when Shake is parallelized.
-type ShakeValue a = (Show a, Typeable a, Eq a, Hashable a, Binary a, NFData a)
-
--- We deliberately avoid Typeable instances on Key/Value to stop them accidentally
--- being used inside themselves
-newtype Key = Key Value
-    deriving (Eq,Hashable,NFData,BinaryWith Witness)
-
-data Value = forall a . ShakeValue a => Value a
-
-
-newKey :: ShakeValue a => a -> Key
-newKey = Key . newValue
-
-newValue :: ShakeValue a => a -> Value
-newValue = Value
-
-typeKey :: Key -> TypeRep
-typeKey (Key v) = typeValue v
-
-typeValue :: Value -> TypeRep
-typeValue (Value x) = typeOf x
-
-fromKey :: Typeable a => Key -> a
-fromKey (Key v) = fromValue v
-
-fromValue :: Typeable a => Value -> a
-fromValue (Value x) = fromMaybe (err "fromValue, bad cast") $ cast x
-
-instance Show Key where
-    show (Key a) = show a
-
-instance Show Value where
-    show (Value a) = show a
-
-instance NFData Value where
-    rnf (Value a) = rnf a
-
-instance Hashable Value where
-    hashWithSalt salt (Value a) = hashWithSalt salt (typeOf a) `xor` hashWithSalt salt a
-
-instance Eq Value where
-    Value a == Value b = maybe False (a ==) $ cast b
-    Value a /= Value b = maybe True (a /=) $ cast b
-
-
----------------------------------------------------------------------
--- BINARY INSTANCES
-
-{-# NOINLINE witness #-}
-witness :: IORef (Map.HashMap TypeRep Value)
-witness = unsafePerformIO $ newIORef Map.empty
-
-registerWitness :: ShakeValue a => a -> IO ()
-registerWitness x = atomicModifyIORef witness $ \mp -> (Map.insert (typeOf x) (Value $ err msg `asTypeOf` x) mp, ())
-    where msg = "registerWitness, type " ++ show (typeOf x)
-
-
--- Produce a list in a predictable order from a Map TypeRep, which should be consistent regardless of the order
--- elements were added and stable between program executions.
--- Cannot rely on hash (not pure in hashable-1.2) or compare (not available before 7.2)
-toStableList :: Map.HashMap TypeRep v -> [(TypeRep,v)]
-toStableList = sortBy (compare `on` show . fst) . Map.toList
-
-
-data Witness = Witness
-    {typeNames :: [String] -- the canonical data, the names of the types
-    ,witnessIn :: Map.HashMap Word16 Value -- for reading in, the find the values (some may be missing)
-    ,witnessOut :: Map.HashMap TypeRep Word16 -- for writing out, find the value
-    } deriving Show
-
-instance Eq Witness where
-    -- Type names are produced by toStableList so should to remain consistent
-    -- regardless of the order of registerWitness calls.
-    a == b = typeNames a == typeNames b
-
-currentWitness :: IO Witness
-currentWitness = do
-    ws <- readIORef witness
-    let (ks,vs) = unzip $ toStableList ws
-    return $ Witness (map show ks) (Map.fromList $ zip [0..] vs) (Map.fromList $ zip ks [0..])
-
-
-instance Binary Witness where
-    put (Witness ts _ _) = put $ BS.unlines $ map BS.pack ts
-    get = do
-        ts <- fmap (map BS.unpack . BS.lines) get
-        let ws = toStableList $ unsafePerformIO $ readIORefAfter ts witness
-        let (is,ks,vs) = unzip3 [(i,k,v) | (i,t) <- zip [0..] ts, (k,v):_ <- [filter ((==) t . show . fst) ws]]
-        return $ Witness ts (Map.fromList $ zip is vs) (Map.fromList $ zip ks is)
-        where
-            -- Read an IORef after examining a variable, used to avoid GHC over-optimisation
-            {-# NOINLINE readIORefAfter #-}
-            readIORefAfter :: a -> IORef b -> IO b
-            readIORefAfter v ref = v `seq` readIORef ref
-
-
-instance BinaryWith Witness Value where
-    putWith ws (Value x) = do
-        let msg = "no witness for " ++ show (typeOf x)
-        put $ fromMaybe (error msg) $ Map.lookup (typeOf x) (witnessOut ws)
-        put x
-
-    getWith ws = do
-        h <- get
-        case Map.lookup h $ witnessIn ws of
-            Nothing | h >= 0 && h < genericLength (typeNames ws) -> error $
-                "Failed to find a type " ++ (typeNames ws !! fromIntegral h) ++ " which is stored in the database.\n" ++
-                "The most likely cause is that your build tool has changed significantly."
-            Nothing -> error $
-                -- should not happen, unless proper data corruption
-                "Corruption when reading Value, got type " ++ show h ++ ", but should be in range 0.." ++ show (length (typeNames ws) - 1)
-            Just (Value t) -> do
-                x <- get
-                return $ Value $ x `asTypeOf` t
diff --git a/src/General/Bilist.hs b/src/General/Bilist.hs
--- a/src/General/Bilist.hs
+++ b/src/General/Bilist.hs
@@ -1,9 +1,10 @@
 
+-- | List type that supports O(1) amortized 'cons', 'snoc', 'uncons' and 'isEmpty'.
 module General.Bilist(
     Bilist, cons, snoc, uncons, toList, isEmpty
     ) where
 
-import Data.Monoid
+import Data.Semigroup
 import Prelude
 
 
@@ -18,9 +19,12 @@
 instance Eq a => Eq (Bilist a) where
     a == b = toList a == toList b
 
+instance Semigroup (Bilist a) where
+    a <> b = Bilist (toList a ++ toList b) []
+
 instance Monoid (Bilist a) where
     mempty = Bilist [] []
-    mappend a b = Bilist (toList a ++ toList b) []
+    mappend = (<>)
 
 cons :: a -> Bilist a -> Bilist a
 cons x (Bilist as bs) = Bilist (x:as) bs
diff --git a/src/General/Binary.hs b/src/General/Binary.hs
--- a/src/General/Binary.hs
+++ b/src/General/Binary.hs
@@ -1,63 +1,232 @@
-{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
+{-# LANGUAGE FlexibleInstances, ScopedTypeVariables, Rank2Types #-}
 
 module General.Binary(
-    BinaryWith(..), module Data.Binary,
-    BinList(..), BinFloat(..)
+    BinaryOp(..), binaryOpMap,
+    binarySplit, binarySplit2, binarySplit3, unsafeBinarySplit,
+    Builder(..), runBuilder, sizeBuilder,
+    BinaryEx(..),
+    Storable, putExStorable, getExStorable, putExStorableList, getExStorableList,
+    putExList, getExList, putExN, getExN
     ) where
 
-import Control.Applicative
+import Development.Shake.Classes
 import Control.Monad
 import Data.Binary
-import Data.List
-import Foreign
+import Data.List.Extra
+import Data.Tuple.Extra
+import Foreign.Marshal.Utils
+import Foreign.Storable
+import Foreign.Ptr
 import System.IO.Unsafe as U
+import qualified Data.ByteString as BS
+import qualified Data.ByteString.Internal as BS
+import qualified Data.ByteString.Unsafe as BS
+import qualified Data.ByteString.Lazy as LBS
+import qualified Data.ByteString.UTF8 as UTF8
+import Data.Semigroup
+import Prelude
 
 
-class BinaryWith ctx a where
-    putWith :: ctx -> a -> Put
-    getWith :: ctx -> Get a
+---------------------------------------------------------------------
+-- STORE TYPE
 
-instance (BinaryWith ctx a, BinaryWith ctx b) => BinaryWith ctx (a,b) where
-    putWith ctx (a,b) = putWith ctx a >> putWith ctx b
-    getWith ctx = liftA2 (,) (getWith ctx) (getWith ctx)
+-- | An explicit and more efficient version of Binary
+data BinaryOp v = BinaryOp
+    {putOp :: v -> Builder
+    ,getOp :: BS.ByteString -> v
+    }
 
-instance BinaryWith ctx a => BinaryWith ctx [a] where
-    putWith ctx xs = put (length xs) >> mapM_ (putWith ctx) xs
-    getWith ctx = do n <- get; replicateM n $ getWith ctx
+binaryOpMap :: BinaryEx a => (a -> BinaryOp b) -> BinaryOp (a, b)
+binaryOpMap mp = BinaryOp
+    {putOp = \(a, b) -> putExN (putEx a) <> putOp (mp a) b
+    ,getOp = \bs -> let (bs1,bs2) = getExN bs; a = getEx bs1 in (a, getOp (mp a) bs2)
+    }
 
-instance BinaryWith ctx a => BinaryWith ctx (Maybe a) where
-    putWith _ Nothing = putWord8 0
-    putWith ctx (Just x) = putWord8 1 >> putWith ctx x
-    getWith ctx = do i <- getWord8; if i == 0 then return Nothing else Just <$> getWith ctx
 
+binarySplit :: forall a . Storable a => BS.ByteString -> (a, BS.ByteString)
+binarySplit bs | BS.length bs < sizeOf (undefined :: a) = error "Reading from ByteString, insufficient left"
+               | otherwise = unsafeBinarySplit bs
 
-newtype BinList a = BinList {fromBinList :: [a]}
+binarySplit2 :: forall a b . (Storable a, Storable b) => BS.ByteString -> (a, b, BS.ByteString)
+binarySplit2 bs | BS.length bs < sizeOf (undefined :: a) + sizeOf (undefined :: b) = error "Reading from ByteString, insufficient left"
+                | (a,bs) <- unsafeBinarySplit bs, (b,bs) <- unsafeBinarySplit bs = (a,b,bs)
 
-instance Show a => Show (BinList a) where show = show . fromBinList
+binarySplit3 :: forall a b c . (Storable a, Storable b, Storable c) => BS.ByteString -> (a, b, c, BS.ByteString)
+binarySplit3 bs | BS.length bs < sizeOf (undefined :: a) + sizeOf (undefined :: b) + sizeOf (undefined :: c) = error "Reading from ByteString, insufficient left"
+                | (a,bs) <- unsafeBinarySplit bs, (b,bs) <- unsafeBinarySplit bs, (c,bs) <- unsafeBinarySplit bs = (a,b,c,bs)
 
-instance Binary a => Binary (BinList a) where
-    put (BinList xs) = case splitAt 254 xs of
-        (_, []) -> putWord8 (genericLength xs) >> mapM_ put xs
-        (a, b) -> putWord8 255 >> mapM_ put a >> put (BinList b)
-    get = do
-        x <- getWord8
-        case x of
-            255 -> do xs <- replicateM 254 get; BinList ys <- get; return $ BinList $ xs ++ ys
-            n -> BinList <$> replicateM (fromInteger $ toInteger n) get
 
+unsafeBinarySplit :: Storable a => BS.ByteString -> (a, BS.ByteString)
+unsafeBinarySplit bs = (v, BS.unsafeDrop (sizeOf v) bs)
+    where v = unsafePerformIO $ BS.unsafeUseAsCString bs $ \ptr -> peek (castPtr ptr)
 
-newtype BinFloat = BinFloat {fromBinFloat :: Float}
 
-instance Show BinFloat where show = show . fromBinFloat
+-- forM for zipWith
+for2M_ as bs f = zipWithM_ f as bs
 
-instance Binary BinFloat where
-    put (BinFloat x) = put (convert x :: Word32)
-    get = fmap (BinFloat . convert) (get :: Get Word32)
+---------------------------------------------------------------------
+-- BINARY SERIALISATION
 
+-- We can't use the Data.ByteString builder as that doesn't track the size of the chunk.
+data Builder = Builder {-# UNPACK #-} !Int (forall a . Ptr a -> Int -> IO ())
 
--- Originally from data-binary-ieee754 package
+sizeBuilder :: Builder -> Int
+sizeBuilder (Builder i _) = i
 
-convert :: (Storable a, Storable b) => a -> b
-convert x = U.unsafePerformIO $ alloca $ \buf -> do
-    poke (castPtr buf) x
-    peek buf
+runBuilder :: Builder -> BS.ByteString
+runBuilder (Builder i f) = unsafePerformIO $ BS.create i $ \ptr -> f ptr 0
+
+instance Semigroup Builder where
+    (Builder x1 x2) <> (Builder y1 y2) = Builder (x1+y1) $ \p i -> do x2 p i; y2 p $ i+x1
+
+instance Monoid Builder where
+    mempty = Builder 0 $ \_ _ -> pure ()
+    mappend = (<>)
+
+-- | Methods for Binary serialisation that go directly between strict ByteString values.
+--   When the Database is read each key/value will be loaded as a separate ByteString,
+--   and for certain types (e.g. file rules) this may remain the preferred format for storing keys.
+--   Optimised for performance.
+class BinaryEx a where
+    putEx :: a -> Builder
+    getEx :: BS.ByteString -> a
+
+instance BinaryEx BS.ByteString where
+    putEx x = Builder n $ \ptr i -> BS.unsafeUseAsCString x $ \bs -> copyBytes (ptr `plusPtr` i) (castPtr bs) (fromIntegral n)
+        where n = BS.length x
+    getEx = id
+
+instance BinaryEx LBS.ByteString where
+    putEx x = Builder (fromIntegral $ LBS.length x) $ \ptr i -> do
+        let go _ [] = pure ()
+            go i (x:xs) = do
+                let n = BS.length x
+                BS.unsafeUseAsCString x $ \bs -> copyBytes (ptr `plusPtr` i) (castPtr bs) (fromIntegral n)
+                go (i+n) xs
+        go i $ LBS.toChunks x
+    getEx = LBS.fromChunks . pure
+
+instance BinaryEx [BS.ByteString] where
+    -- Format:
+    -- n :: Word32 - number of strings
+    -- ns :: [Word32]{n} - length of each string
+    -- contents of each string concatenated (sum ns bytes)
+    putEx xs = Builder (4 + (n * 4) + sum ns) $ \p i -> do
+        pokeByteOff p i (fromIntegral n :: Word32)
+        for2M_ [4+i,8+i..] ns $ \i x -> pokeByteOff p i (fromIntegral x :: Word32)
+        p<- pure $ p `plusPtr` (i + 4 + (n * 4))
+        for2M_ (scanl (+) 0 ns) xs $ \i x -> BS.unsafeUseAsCStringLen x $ \(bs, n) ->
+            copyBytes (p `plusPtr` i) (castPtr bs) (fromIntegral n)
+        where ns = map BS.length xs
+              n = length ns
+
+    getEx bs = unsafePerformIO $ BS.unsafeUseAsCString bs $ \p -> do
+        n <- fromIntegral <$> (peekByteOff p 0 :: IO Word32)
+        ns :: [Word32] <- forM [1..fromIntegral n] $ \i -> peekByteOff p (i * 4)
+        pure $ snd $ mapAccumL (\bs i -> swap $ BS.splitAt (fromIntegral i) bs) (BS.drop (4 + (n * 4)) bs) ns
+
+instance BinaryEx () where
+    putEx () = mempty
+    getEx _ = ()
+
+instance BinaryEx String where
+    putEx = putEx . UTF8.fromString
+    getEx = UTF8.toString
+
+instance BinaryEx (Maybe String) where
+    putEx Nothing = mempty
+    putEx (Just xs) = putEx $ UTF8.fromString $ '\0' : xs
+    getEx = fmap snd . uncons . UTF8.toString
+
+instance BinaryEx [String] where
+    putEx = putEx . map UTF8.fromString
+    getEx = map UTF8.toString . getEx
+
+instance BinaryEx (String, [String]) where
+    putEx (a,bs) = putEx $ a:bs
+    getEx x = let a:bs = getEx x in (a,bs)
+
+instance BinaryEx Bool where
+    putEx False = Builder 1 $ \ptr i -> pokeByteOff ptr i (0 :: Word8)
+    putEx True = mempty
+    getEx = BS.null
+
+instance BinaryEx Word8 where
+    putEx = putExStorable
+    getEx = getExStorable
+
+instance BinaryEx Word16 where
+    putEx = putExStorable
+    getEx = getExStorable
+
+instance BinaryEx Word32 where
+    putEx = putExStorable
+    getEx = getExStorable
+
+instance BinaryEx Int where
+    putEx = putExStorable
+    getEx = getExStorable
+
+instance BinaryEx Float where
+    putEx = putExStorable
+    getEx = getExStorable
+
+
+putExStorable :: forall a . Storable a => a -> Builder
+putExStorable x = Builder (sizeOf x) $ \p i -> pokeByteOff p i x
+
+getExStorable :: forall a . Storable a => BS.ByteString -> a
+getExStorable = \bs -> unsafePerformIO $ BS.unsafeUseAsCStringLen bs $ \(p, size) ->
+        if size /= n then error "size mismatch" else peek (castPtr p)
+    where n = sizeOf (undefined :: a)
+
+
+putExStorableList :: forall a . Storable a => [a] -> Builder
+putExStorableList xs = Builder (n * length xs) $ \ptr i ->
+    for2M_ [i,i+n..] xs $ \i x -> pokeByteOff ptr i x
+    where n = sizeOf (undefined :: a)
+
+getExStorableList :: forall a . Storable a => BS.ByteString -> [a]
+getExStorableList = \bs -> unsafePerformIO $ BS.unsafeUseAsCStringLen bs $ \(p, size) ->
+    let (d,m) = size `divMod` n in
+    if m /= 0 then error "size mismatch" else forM [0..d-1] $ \i -> peekElemOff (castPtr p) i
+    where n = sizeOf (undefined :: a)
+
+
+-- repeating:
+--     Word32, length of BS
+--     BS
+putExList :: [Builder] -> Builder
+putExList xs = Builder (sum $ map (\b -> sizeBuilder b + 4) xs) $ \p i -> do
+    let go _ [] = pure ()
+        go i (Builder n b:xs) = do
+            pokeByteOff p i (fromIntegral n :: Word32)
+            b p (i+4)
+            go (i+4+n) xs
+    go i xs
+
+getExList :: BS.ByteString -> [BS.ByteString]
+getExList bs
+    | len == 0 = []
+    | len >= 4
+    , (n :: Word32, bs) <- unsafeBinarySplit bs
+    , n <- fromIntegral n
+    , (len - 4) >= n
+    = BS.unsafeTake n bs : getExList (BS.unsafeDrop n bs)
+    | otherwise = error "getList, corrupted binary"
+    where len = BS.length bs
+
+putExN :: Builder -> Builder
+putExN (Builder n old) = Builder (n+4) $ \p i -> do
+    pokeByteOff p i (fromIntegral n :: Word32)
+    old p $ i+4
+
+getExN :: BS.ByteString -> (BS.ByteString, BS.ByteString)
+getExN bs
+    | len >= 4
+    , (n :: Word32, bs) <- unsafeBinarySplit bs
+    , n <- fromIntegral n
+    , (len - 4) >= n
+    = (BS.unsafeTake n bs, BS.unsafeDrop n bs)
+    | otherwise = error "getList, corrupted binary"
+    where len = BS.length bs
diff --git a/src/General/Chunks.hs b/src/General/Chunks.hs
new file mode 100644
--- /dev/null
+++ b/src/General/Chunks.hs
@@ -0,0 +1,147 @@
+{-# LANGUAGE RecordWildCards, ScopedTypeVariables #-}
+
+module General.Chunks(
+    Chunks,
+    readChunk, readChunkMax, usingWriteChunks, writeChunk,
+    restoreChunksBackup, usingChunks, resetChunksCompact, resetChunksCorrupt
+    ) where
+
+import System.Time.Extra
+import System.FilePath
+import Control.Concurrent.Extra
+import Control.Monad.Extra
+import Control.Exception
+import System.IO
+import System.Directory
+import qualified Data.ByteString as BS
+import Data.Word
+import Data.Monoid
+import General.Binary
+import General.Extra
+import General.Cleanup
+import General.Thread
+import Prelude
+
+
+data Chunks = Chunks
+    {chunksFileName :: FilePath
+    ,chunksFlush :: Maybe Seconds
+    ,chunksHandle :: MVar Handle
+    }
+
+
+---------------------------------------------------------------------
+-- READ/WRITE OPERATIONS
+
+readChunk :: Chunks -> IO (Either BS.ByteString BS.ByteString)
+readChunk c = readChunkMax c maxBound
+
+-- | Return either a valid chunk (Right), or a trailing suffix with no information (Left)
+readChunkMax :: Chunks -> Word32 -> IO (Either BS.ByteString BS.ByteString)
+readChunkMax Chunks{..} mx = withMVar chunksHandle $ \h -> readChunkDirect h mx
+
+readChunkDirect :: Handle -> Word32 -> IO (Either BS.ByteString BS.ByteString)
+readChunkDirect h mx = do
+    let slop x = do
+            unless (BS.null x) $ hSetFileSize h . subtract (toInteger $ BS.length x) =<< hFileSize h
+            pure $ Left x
+    n <- BS.hGet h 4
+    if BS.length n < 4 then slop n else do
+        let count = fromIntegral $ min mx $ fst $ unsafeBinarySplit n
+        v <- BS.hGet h count
+        if BS.length v < count then slop (n `BS.append` v) else pure $ Right v
+
+writeChunkDirect :: Handle -> Builder -> IO ()
+writeChunkDirect h x = bs `seq` BS.hPut h bs
+    where bs = runBuilder $ putEx (fromIntegral $ sizeBuilder x :: Word32) <> x
+
+
+-- | If 'writeChunks' and any of the reopen operations are interleaved it will cause issues.
+usingWriteChunks :: Cleanup -> Chunks -> IO (Builder -> IO ())
+-- We avoid calling flush too often on SSD drives, as that can be slow
+-- Make sure all exceptions happen on the caller, so we don't have to move exceptions back
+-- Make sure we only write on one thread, otherwise async exceptions can cause partial writes
+usingWriteChunks cleanup Chunks{..} = do
+    h <- allocate cleanup (takeMVar chunksHandle) (putMVar chunksHandle)
+    chan <- newChan -- operations to perform on the file
+    kick <- newEmptyMVar -- kicked whenever something is written
+    died <- newBarrier -- has the writing thread finished
+
+    whenJust chunksFlush $ \flush ->
+        allocateThread cleanup $ forever $ do
+            takeMVar kick
+            sleep flush
+            tryTakeMVar kick
+            writeChan chan $ hFlush h >> pure True
+
+    -- pump the thread while we are running
+    -- once we abort, let everything finish flushing first
+    -- the mask_ is very important - we don't want to abort until everything finishes
+    allocateThread cleanup $ mask_ $ whileM $ join $ readChan chan
+    -- this cleanup will run before we attempt to kill the thread
+    register cleanup $ writeChan chan $ pure False
+
+    pure $ \s -> do
+        out <- evaluate $ writeChunkDirect h s -- ensure exceptions occur on this thread
+        writeChan chan $ out >> tryPutMVar kick () >> pure True
+
+
+writeChunk :: Chunks -> Builder -> IO ()
+writeChunk Chunks{..} x = withMVar chunksHandle $ \h -> writeChunkDirect h x
+
+
+---------------------------------------------------------------------
+-- FILENAME OPERATIONS
+
+backup x = x <.> "backup"
+
+restoreChunksBackup :: FilePath -> IO Bool
+restoreChunksBackup file = do
+    -- complete a partially failed compress
+    b <- doesFileExist $ backup file
+    if not b then pure False else do
+        removeFile_ file
+        renameFile (backup file) file
+        pure True
+
+
+usingChunks :: Cleanup -> FilePath -> Maybe Seconds -> IO Chunks
+usingChunks cleanup file flush = do
+    h <- newEmptyMVar
+    allocate cleanup
+        (putMVar h =<< openFile file ReadWriteMode)
+        (const $ hClose =<< takeMVar h)
+    pure $ Chunks file flush h
+
+
+-- | The file is being compacted, if the process fails, use a backup.
+resetChunksCompact :: Chunks -> ((Builder -> IO ()) -> IO a) -> IO a
+resetChunksCompact Chunks{..} act = mask $ \restore -> do
+    h <- takeMVar chunksHandle
+    flip onException (putMVar chunksHandle h) $ restore $ do
+        hClose h
+        copyFile chunksFileName $ backup chunksFileName
+    h <- openFile chunksFileName ReadWriteMode
+    flip finally (putMVar chunksHandle h) $ restore $ do
+        hSetFileSize h 0
+        hSeek h AbsoluteSeek 0
+        res <- act $ writeChunkDirect h
+        hFlush h
+        removeFile $ backup chunksFileName
+        pure res
+
+
+-- | The file got corrupted, return a new version.
+resetChunksCorrupt :: Maybe FilePath -> Chunks -> IO ()
+resetChunksCorrupt copy Chunks{..} = mask $ \restore -> do
+    h <- takeMVar chunksHandle
+    h <- case copy of
+        Nothing -> pure h
+        Just copy -> do
+            flip onException (putMVar chunksHandle h) $ restore $ do
+                hClose h
+                copyFile chunksFileName copy
+            openFile chunksFileName ReadWriteMode
+    flip finally (putMVar chunksHandle h) $ do
+        hSetFileSize h 0
+        hSeek h AbsoluteSeek 0
diff --git a/src/General/Cleanup.hs b/src/General/Cleanup.hs
--- a/src/General/Cleanup.hs
+++ b/src/General/Cleanup.hs
@@ -1,38 +1,63 @@
 
 -- | Code for ensuring cleanup actions are run.
 module General.Cleanup(
-    Cleanup, withCleanup, addCleanup
+    Cleanup, newCleanup, withCleanup,
+    register, release, allocate, unprotect
     ) where
 
-import Control.Exception as E
-import Control.Monad
+import Control.Exception
 import qualified Data.HashMap.Strict as Map
-import Data.Function
 import Data.IORef
-import Data.List
+import Data.List.Extra
+import Data.Maybe
 
 
-data S = S {unique :: !Int, items :: Map.HashMap Int (IO ())}
+data S = S
+    {unique :: {-# UNPACK #-} !Int -- next index to be used to items
+    ,items :: !(Map.HashMap Int (IO ()))
+    }
 
 newtype Cleanup = Cleanup (IORef S)
 
+data ReleaseKey = ReleaseKey (IORef S) {-# UNPACK #-} !Int
 
--- | Run with some cleanup scope. Regardless of exceptions/threads, all 'addCleanup' actions
---   will be run by the time it exits. The 'addCleanup' actions will be run in reverse order.
+
+-- | Run with some cleanup scope. Regardless of exceptions/threads, all 'register' actions
+--   will be run by the time it exits.
+--   The 'register' actions will be run in reverse order, i.e. the last to be added will be run first.
 withCleanup :: (Cleanup -> IO a) -> IO a
 withCleanup act = do
+    (c, clean) <- newCleanup
+    act c `finally` clean
+
+newCleanup :: IO (Cleanup, IO ())
+newCleanup = do
     ref <- newIORef $ S 0 Map.empty
-    act (Cleanup ref) `finally` do
-        items <- atomicModifyIORef ref $ \s -> (s{items=Map.empty}, items s)
-        mapM_ snd $ sortBy (compare `on` negate . fst) $ Map.toList items
+    -- important to use uninterruptibleMask_ otherwise in things like allocateThread
+    -- we might end up being interrupted and failing to close down the thread
+    -- e.g. see https://github.com/digital-asset/ghcide/issues/381
+    -- note that packages like safe-exceptions also use uninterruptibleMask_
+    let clean = uninterruptibleMask_ $ do
+            items <- atomicModifyIORef' ref $ \s -> (s{items=Map.empty}, items s)
+            mapM_ snd $ sortOn (negate . fst) $ Map.toList items
+    pure (Cleanup ref, clean)
 
 
--- | Add a cleanup action to a 'Cleanup' scope. If the return action is not run by the time
---   'withCleanup' terminates then it will be run then. The argument 'Bool' is 'True' to say
---   run the action, 'False' to say ignore the action (and never run it).
-addCleanup :: Cleanup -> IO () -> IO (Bool -> IO ())
-addCleanup (Cleanup ref) act = atomicModifyIORef ref $ \s -> let i = unique s in
-    (,) (S (unique s + 1) (Map.insert i act $ items s)) $ \b ->
-        join $ atomicModifyIORef ref $ \s -> case Map.lookup i $ items s of
-            Nothing -> (s, return ())
-            Just act -> (s{items = Map.delete i $ items s}, when b act)
+register :: Cleanup -> IO () -> IO ReleaseKey
+register (Cleanup ref) act = atomicModifyIORef' ref $ \s -> let i = unique s in
+    (S (unique s + 1) (Map.insert i act $ items s), ReleaseKey ref i)
+
+unprotect :: ReleaseKey -> IO ()
+unprotect (ReleaseKey ref i) = atomicModifyIORef' ref $ \s -> (s{items = Map.delete i $ items s}, ())
+
+release :: ReleaseKey -> IO ()
+release (ReleaseKey ref i) = uninterruptibleMask_ $ do
+    undo <- atomicModifyIORef' ref $ \s -> (s{items = Map.delete i $ items s}, Map.lookup i $ items s)
+    fromMaybe (pure ()) undo
+
+allocate :: Cleanup -> IO a -> (a -> IO ()) -> IO a
+allocate cleanup acquire release =
+    mask_ $ do
+        v <- acquire
+        register cleanup $ release v
+        pure v
diff --git a/src/General/Concurrent.hs b/src/General/Concurrent.hs
deleted file mode 100644
--- a/src/General/Concurrent.hs
+++ /dev/null
@@ -1,33 +0,0 @@
-
-module General.Concurrent(
-    Fence, newFence, signalFence, waitFence, testFence,
-    ) where
-
-import Control.Applicative
-import Control.Monad
-import Data.IORef
-import Prelude
-
-
----------------------------------------------------------------------
--- FENCE
-
--- | Like a barrier, but based on callbacks
-newtype Fence a = Fence (IORef (Either [a -> IO ()] a))
-instance Show (Fence a) where show _ = "Fence"
-
-newFence :: IO (Fence a)
-newFence = Fence <$> newIORef (Left [])
-
-signalFence :: Fence a -> a -> IO ()
-signalFence (Fence ref) v = join $ atomicModifyIORef ref $ \x -> case x of
-    Left queue -> (Right v, mapM_ ($ v) $ reverse queue)
-    Right v -> error "Shake internal error, signalFence called twice on one Fence"
-
-waitFence :: Fence a -> (a -> IO ()) -> IO ()
-waitFence (Fence ref) call = join $ atomicModifyIORef ref $ \x -> case x of
-    Left queue -> (Left (call:queue), return ())
-    Right v -> (Right v, call v)
-
-testFence :: Fence a -> IO (Maybe a)
-testFence (Fence x) = either (const Nothing) Just <$> readIORef x
diff --git a/src/General/EscCodes.hs b/src/General/EscCodes.hs
new file mode 100644
--- /dev/null
+++ b/src/General/EscCodes.hs
@@ -0,0 +1,100 @@
+{-# LANGUAGE CPP #-}
+
+-- | Working with escape sequences
+module General.EscCodes(
+    Color(..),
+    checkEscCodes,
+    removeEscCodes,
+    escWindowTitle,
+    escCursorUp,
+    escClearLine,
+    escForeground,
+    escNormal
+    ) where
+
+import Data.Char
+import Data.List.Extra
+import System.IO
+import System.Environment
+import System.IO.Unsafe
+
+#ifdef mingw32_HOST_OS
+import Data.Word
+import Data.Bits
+import Foreign.Ptr
+import Foreign.Storable
+import Foreign.Marshal.Alloc
+#endif
+
+checkEscCodes :: IO Bool
+checkEscCodes = pure checkEscCodesOnce
+
+{-# NOINLINE checkEscCodesOnce #-}
+checkEscCodesOnce :: Bool
+checkEscCodesOnce = unsafePerformIO $ do
+    hdl <- hIsTerminalDevice stdout
+    env <- maybe False (/= "dumb") <$> lookupEnv "TERM"
+    if hdl && env then pure True else
+#ifdef mingw32_HOST_OS
+        checkEscCodesWindows
+#else
+        pure False
+#endif
+
+#ifdef mingw32_HOST_OS
+
+#ifdef x86_64_HOST_ARCH
+#define CALLCONV ccall
+#else
+#define CALLCONV stdcall
+#endif
+
+foreign import CALLCONV unsafe "Windows.h GetStdHandle" c_GetStdHandle :: Word32 -> IO (Ptr ())
+foreign import CALLCONV unsafe "Windows.h GetConsoleMode" c_GetConsoleModule :: Ptr () -> Ptr Word32 -> IO Bool
+foreign import CALLCONV unsafe "Windows.h SetConsoleMode" c_SetConsoleMode :: Ptr () -> Word32 -> IO Bool
+
+c_STD_OUTPUT_HANDLE = 4294967285 :: Word32 -- (-11) for some reason
+c_ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004 :: Word32
+
+
+-- | Try and get the handle attributes, if they are all satisifed, return True.
+--   If they aren't, try and set it to emulated mode.
+checkEscCodesWindows :: IO Bool
+checkEscCodesWindows = do
+    h <- c_GetStdHandle c_STD_OUTPUT_HANDLE
+    -- might return INVALID_HANDLE_VALUE, but then the next step will happily fail
+    mode <- alloca $ \v -> do
+        b <- c_GetConsoleModule h v
+        if b then Just <$> peek v else pure Nothing
+    case mode of
+        Nothing -> pure False
+        Just mode -> do
+            let modeNew = mode .|. c_ENABLE_VIRTUAL_TERMINAL_PROCESSING
+            if mode == modeNew then pure True else do
+                c_SetConsoleMode h modeNew
+#endif
+
+removeEscCodes :: String -> String
+removeEscCodes ('\ESC':'[':xs) = removeEscCodes $ drop1 $ dropWhile (not . isAlpha) xs
+removeEscCodes (x:xs) = x : removeEscCodes xs
+removeEscCodes [] = []
+
+
+escWindowTitle :: String -> String
+escWindowTitle x = "\ESC]0;" ++ x ++ "\BEL"
+
+escCursorUp :: Int -> String
+escCursorUp i = "\ESC[" ++ show i ++ "A"
+
+escClearLine :: String
+escClearLine = "\ESC[K"
+
+
+data Color = Black | Red | Green | Yellow | Blue | Magenta | Cyan | White
+    deriving (Show,Enum)
+
+escForeground :: Color -> String
+escForeground x = "\ESC[" ++ show (30 + fromEnum x) ++ "m"
+
+escNormal :: String
+escNormal = "\ESC[0m"
diff --git a/src/General/Extra.hs b/src/General/Extra.hs
--- a/src/General/Extra.hs
+++ b/src/General/Extra.hs
@@ -1,72 +1,323 @@
+{-# LANGUAGE CPP, ScopedTypeVariables, ConstraintKinds, GeneralizedNewtypeDeriving #-}
+{-# OPTIONS_GHC -Wno-x-partial -Wno-unrecognised-warning-flags #-}
 
 module General.Extra(
     getProcessorCount,
+    findGcc,
+    whenLeft,
     randomElem,
-    showQuote,
-    withs,
-    maximum', maximumBy'
+    wrapQuote, showBracket,
+    withs, forNothingM,
+    maximum', maximumBy',
+    unconcat,
+    fastAt,
+    headErr, tailErr,
+    zipExact, zipWithExact,
+    isAsyncException,
+    showDurationSecs,
+    usingLineBuffering,
+    doesFileExist_, doesDirectoryExist_,
+    usingNumCapabilities,
+    removeFile_, createDirectoryRecursive,
+    catchIO, tryIO, handleIO, handleSynchronous,
+    Located, Partial, callStackTop, callStackFull, withFrozenCallStack, callStackFromException,
+    Ver(..), makeVer,
+    QTypeRep(..),
+    NoShow(..)
     ) where
 
 import Control.Exception.Extra
 import Data.Char
-import Data.List
-import System.Environment.Extra
+import Data.List.Extra
+import System.Environment
+import Development.Shake.FilePath
+import Control.DeepSeq
+import General.Cleanup
+import Data.Typeable
+import System.IO.Error
 import System.IO.Extra
+import System.Time.Extra
 import System.IO.Unsafe
+import System.Info.Extra
 import System.Random
-import Control.Concurrent
-import GHC.Conc
+import System.Directory
+import System.Exit
+import Numeric.Extra
+import Foreign.Storable
+import Control.Concurrent.Extra
+import Data.Maybe
+import Data.Hashable
+import Data.Primitive.Array
+import Control.Monad
+import Control.Monad.ST
+import GHC.Conc(getNumProcessors)
+import GHC.Stack
 
 
 ---------------------------------------------------------------------
+-- Prelude
+
+-- See https://ghc.haskell.org/trac/ghc/ticket/10830 - they broke maximumBy
+maximumBy' :: (a -> a -> Ordering) -> [a] -> a
+maximumBy' cmp = foldl1' $ \x y -> if cmp x y == GT then x else y
+
+maximum' :: Ord a => [a] -> a
+maximum' = maximumBy' compare
+
+newtype NoShow a = NoShow a
+instance Show (NoShow a) where show _ = "NoShow"
+
+unconcat :: [[a]] -> [b] -> [[b]]
+unconcat [] _ = []
+unconcat (a:as) bs = b1 : unconcat as b2
+    where (b1,b2) = splitAt (length a) bs
+
+headErr :: [a] -> a
+headErr = head
+
+tailErr :: [a] -> [a]
+tailErr = tail
+
+
+---------------------------------------------------------------------
 -- Data.List
 
-showQuote :: String -> String
-showQuote xs | any isSpace xs = "\"" ++ concatMap (\x -> if x == '\"' then "\"\"" else [x]) xs ++ "\""
+-- | If a string has any spaces then put quotes around and double up all internal quotes.
+--   Roughly the inverse of Windows command line parsing.
+wrapQuote :: String -> String
+wrapQuote xs | any isSpace xs = "\"" ++ concatMap (\x -> if x == '\"' then "\"\"" else [x]) xs ++ "\""
              | otherwise = xs
 
+-- | If a string has any spaces then put brackets around it.
+wrapBracket :: String -> String
+wrapBracket xs | any isSpace xs = "(" ++ xs ++ ")"
+               | otherwise = xs
 
+-- | Alias for @wrapBracket . show@.
+showBracket :: Show a => a -> String
+showBracket = wrapBracket . show
+
+
+-- | Version of '!!' which is fast and returns 'Nothing' if the index is not present.
+fastAt :: [a] -> (Int -> Maybe a)
+fastAt xs = \i -> if i < 0 || i >= n then Nothing else Just $ indexArray arr i
+    where
+        n = length xs
+        arr = runST $ do
+            let n = length xs
+            arr <- newArray n undefined
+            forM_ (zipFrom 0 xs) $ \(i,x) ->
+                writeArray arr i x
+            unsafeFreezeArray arr
+
+zipWithExact :: Partial => (a -> b -> c) -> [a] -> [b] -> [c]
+zipWithExact f = g
+    where
+        g [] [] = []
+        g (a:as) (b:bs) = f a b : g as bs
+        g _ _ = error "zipWithExacts: unequal lengths"
+
+zipExact :: Partial => [a] -> [b] -> [(a,b)]
+zipExact = zipWithExact (,)
+
+
 ---------------------------------------------------------------------
 -- System.Info
 
 {-# NOINLINE getProcessorCount #-}
 getProcessorCount :: IO Int
 -- unsafePefromIO so we cache the result and only compute it once
-getProcessorCount = let res = unsafePerformIO act in return res
+getProcessorCount = let res = unsafePerformIO act in pure res
     where
         act =
             if rtsSupportsBoundThreads then
-                fmap fromIntegral $ getNumProcessors
-            else
-                handle_ (const $ return 1) $ do
-                    env <- lookupEnv "NUMBER_OF_PROCESSORS"
-                    case env of
-                        Just s | [(i,"")] <- reads s -> return i
-                        _ -> do
-                            src <- readFile' "/proc/cpuinfo"
-                            return $! length [() | x <- lines src, "processor" `isPrefixOf` x]
+                fromIntegral <$> getNumProcessors
+            else do
+                env <- lookupEnv "NUMBER_OF_PROCESSORS"
+                case env of
+                    Just s | [(i,"")] <- reads s -> pure i
+                    _ -> do
+                        src <- readFile' "/proc/cpuinfo" `catchIO` \_ -> pure ""
+                        pure $! max 1 $ length [() | x <- lines src, "processor" `isPrefixOf` x]
 
 
+-- Can you find a GCC executable? return a Bool, and optionally something to add to $PATH to run it
+findGcc :: IO (Bool, Maybe FilePath)
+findGcc = do
+    v <- findExecutable "gcc"
+    case v of
+        Nothing | isWindows -> do
+            ghc <- findExecutable "ghc"
+            case ghc of
+                Just ghc -> do
+                    let gcc = takeDirectory (takeDirectory ghc) </> "mingw/bin/gcc.exe"
+                    b <- doesFileExist_ gcc
+                    pure $ if b then (True, Just $ takeDirectory gcc) else (False, Nothing)
+                _ -> pure (False, Nothing)
+        _ -> pure (isJust v, Nothing)
+
+
+
 ---------------------------------------------------------------------
 -- System.Random
 
 randomElem :: [a] -> IO a
 randomElem xs = do
+    when (null xs) $ fail "General.Extra.randomElem called with empty list, can't pick a random element"
     i <- randomRIO (0, length xs - 1)
-    return $ xs !! i
+    pure $ xs !! i
 
 
 ---------------------------------------------------------------------
+-- System.IO
+
+usingLineBuffering :: Cleanup -> IO ()
+usingLineBuffering cleanup = do
+    out <- hGetBuffering stdout
+    err <- hGetBuffering stderr
+    when (out /= LineBuffering || err /= LineBuffering) $ do
+        register cleanup $ hSetBuffering stdout out >> hSetBuffering stderr err
+        hSetBuffering stdout LineBuffering >> hSetBuffering stderr LineBuffering
+
+
+---------------------------------------------------------------------
+-- System.Time
+
+showDurationSecs :: Seconds -> String
+showDurationSecs = replace ".00s" "s" . showDuration . intToDouble . round
+
+
+---------------------------------------------------------------------
 -- Control.Monad
 
 withs :: [(a -> r) -> r] -> ([a] -> r) -> r
 withs [] act = act []
 withs (f:fs) act = f $ \a -> withs fs $ \as -> act $ a:as
 
+forNothingM :: Monad m => [a] -> (a -> m (Maybe b)) -> m (Maybe [b])
+forNothingM [] f = pure $ Just []
+forNothingM (x:xs) f = do
+    v <- f x
+    case v of
+        Nothing -> pure Nothing
+        Just v -> liftM (v:) `liftM` forNothingM xs f
 
--- See https://ghc.haskell.org/trac/ghc/ticket/10830 - they broke maximumBy
-maximumBy' :: (a -> a -> Ordering) -> [a] -> a
-maximumBy' cmp = foldl1' $ \x y -> if cmp x y == GT then x else y
 
-maximum' :: Ord a => [a] -> a
-maximum' = maximumBy' compare
+---------------------------------------------------------------------
+-- Control.Concurrent
+
+usingNumCapabilities :: Cleanup -> Int -> IO ()
+usingNumCapabilities cleanup new = when rtsSupportsBoundThreads $ do
+    old <- getNumCapabilities
+    when (old /= new) $ do
+        register cleanup $ setNumCapabilities old
+        setNumCapabilities new
+
+
+---------------------------------------------------------------------
+-- Control.Exception
+
+-- | Is the exception asynchronous, not a "coding error" that should be ignored
+isAsyncException :: SomeException -> Bool
+isAsyncException e
+    | Just (_ :: AsyncException) <- fromException e = True
+    | Just (_ :: ExitCode) <- fromException e = True
+    | otherwise = False
+
+catchIO :: IO a -> (IOException -> IO a) -> IO a
+catchIO = catch
+
+tryIO :: IO a -> IO (Either IOException a)
+tryIO = try
+
+handleIO :: (IOException -> IO a) -> IO a -> IO a
+handleIO = handle
+
+handleSynchronous :: (SomeException -> IO a) -> IO a -> IO a
+handleSynchronous = handleBool (not . isAsyncException)
+
+---------------------------------------------------------------------
+-- System.Directory
+
+doesFileExist_ :: FilePath -> IO Bool
+doesFileExist_ x = doesFileExist x `catchIO` \_ -> pure False
+
+doesDirectoryExist_ :: FilePath -> IO Bool
+doesDirectoryExist_ x = doesDirectoryExist x `catchIO` \_ -> pure False
+
+-- | Remove a file, but don't worry if it fails
+removeFile_ :: FilePath -> IO ()
+removeFile_ x =
+    removeFile x `catchIO` \e ->
+        when (isPermissionError e) $ handleIO (\_ -> pure ()) $ do
+            perms <- getPermissions x
+            setPermissions x perms{readable = True, searchable = True, writable = True}
+            removeFile x
+
+
+-- | Like @createDirectoryIfMissing True@ but faster, as it avoids
+--   any work in the common case the directory already exists.
+createDirectoryRecursive :: FilePath -> IO ()
+createDirectoryRecursive dir = do
+    x <- tryIO $ doesDirectoryExist dir
+    when (x /= Right True) $ createDirectoryIfMissing True dir
+
+
+---------------------------------------------------------------------
+-- Data.Either
+
+whenLeft :: Applicative m => Either a b -> (a -> m ()) -> m ()
+whenLeft x f = either f (const $ pure ()) x
+
+
+---------------------------------------------------------------------
+-- Data.CallStack
+
+type Located = Partial
+
+callStackTop :: Partial => String
+callStackTop = withFrozenCallStack $ headDef "unknown location" callStackFull
+
+callStackFull :: Partial => [String]
+callStackFromException :: SomeException -> ([String], SomeException)
+
+
+-- | Invert 'prettyCallStack', which GHC pre-applies in certain cases
+parseCallStack = reverse . map trimStart . drop1 . lines
+
+callStackFull = parseCallStack $ prettyCallStack $ popCallStack callStack
+
+#if __GLASGOW_HASKELL__ < 912
+callStackFromException e | Just (ErrorCallWithLocation msg loc) <- fromException e = (parseCallStack loc, toException $ ErrorCall msg)
+#endif
+callStackFromException e = ([], e)
+
+
+---------------------------------------------------------------------
+-- Data.Version
+
+-- | A version number that indicates change, not ordering or compatibility.
+--   Always presented as an 'Int' to the user, but a newtype inside the library for safety.
+newtype Ver = Ver Int
+    deriving (Show,Eq,Storable)
+
+makeVer :: String -> Ver
+makeVer = Ver . hash
+
+
+---------------------------------------------------------------------
+-- Data.Typeable
+
+-- | Like TypeRep, but the Show includes enough information to be unique
+--   so I can rely on @a == b === show a == show b@.
+newtype QTypeRep = QTypeRep {fromQTypeRep :: TypeRep}
+    deriving (Eq,Hashable,NFData)
+
+instance Show QTypeRep where
+    -- Need to show enough so that different types with the same names don't clash
+    -- But can't show too much or the history is not portable https://github.com/ndmitchell/shake/issues/670
+    show (QTypeRep x) = f x
+        where
+            f x = ['(' | xs /= []] ++ (unwords $ g c : map f xs) ++ [')' | xs /= []]
+                where (c, xs) = splitTyConApp x
+            g x = tyConModule x ++ "." ++ tyConName x
diff --git a/src/General/Fence.hs b/src/General/Fence.hs
new file mode 100644
--- /dev/null
+++ b/src/General/Fence.hs
@@ -0,0 +1,55 @@
+{-# LANGUAGE LambdaCase #-}
+
+module General.Fence(
+    Fence, newFence, signalFence, waitFence, testFence,
+    exceptFence
+    ) where
+
+import Control.Monad
+import Control.Monad.IO.Class
+import Control.Exception.Extra
+import Development.Shake.Internal.Errors
+import Data.Maybe
+import Data.Either.Extra
+import Data.IORef
+
+
+---------------------------------------------------------------------
+-- FENCE
+
+-- | Like a barrier, but based on callbacks
+newtype Fence m a = Fence (IORef (Either (a -> m ()) a))
+instance Show (Fence m a) where show _ = "Fence"
+
+newFence :: MonadIO m => IO (Fence m a)
+newFence = Fence <$> newIORef (Left $ const $ pure ())
+
+signalFence :: (Partial, MonadIO m) => Fence m a -> a -> m ()
+signalFence (Fence ref) v = join $ liftIO $ atomicModifyIORef' ref $ \case
+    Left queue -> (Right v, queue v)
+    Right _ -> throwImpure $ errorInternal "signalFence called twice on one Fence"
+
+waitFence :: MonadIO m => Fence m a -> (a -> m ()) -> m ()
+waitFence (Fence ref) call = join $ liftIO $ atomicModifyIORef' ref $ \case
+    Left queue -> (Left (\a -> queue a >> call a), pure ())
+    Right v -> (Right v, call v)
+
+testFence :: Fence m a -> IO (Maybe a)
+testFence (Fence x) = eitherToMaybe <$> readIORef x
+
+
+---------------------------------------------------------------------
+-- FENCE COMPOSITES
+
+exceptFence :: MonadIO m => [Fence m (Either e r)] -> m (Fence m (Either e [r]))
+exceptFence xs = do
+    -- number of items still to complete, becomes negative after it has triggered
+    todo <- liftIO $ newIORef $ length xs
+    fence <- liftIO newFence
+
+    forM_ xs $ \x -> waitFence x $ \res ->
+        join $ liftIO $ atomicModifyIORef' todo $ \i -> case res of
+            Left e | i >= 0 -> (-1, signalFence fence $ Left e)
+            _ | i == 1 -> (-1, signalFence fence . Right =<< liftIO (mapM (fmap (fromRight' . fromJust) . testFence) xs))
+              | otherwise -> (i-1, pure ())
+    pure fence
diff --git a/src/General/FileLock.hs b/src/General/FileLock.hs
--- a/src/General/FileLock.hs
+++ b/src/General/FileLock.hs
@@ -1,15 +1,16 @@
-{-# LANGUAGE CPP, ScopedTypeVariables #-}
+{-# LANGUAGE CPP #-}
 
-module General.FileLock(withLockFile) where
+module General.FileLock(usingLockFile) where
 
 import Control.Exception.Extra
-import System.Directory
 import System.FilePath
+import General.Extra
+import General.Cleanup
 #ifdef mingw32_HOST_OS
+import Control.Monad
 import Data.Bits
 import Data.Word
 import Foreign.Ptr
-import Foreign.C.Types
 import Foreign.C.String
 #else
 import System.IO
@@ -24,7 +25,7 @@
 #define CALLCONV stdcall
 #endif
 
-foreign import CALLCONV unsafe "Windows.h CreateFileW" c_CreateFileW :: Ptr CWchar -> Word32 -> Word32 -> Ptr () -> Word32 -> Word32 -> Ptr () -> IO (Ptr ())
+foreign import CALLCONV unsafe "Windows.h CreateFileW" c_CreateFileW :: CWString -> Word32 -> Word32 -> Ptr () -> Word32 -> Word32 -> Ptr () -> IO (Ptr ())
 foreign import CALLCONV unsafe "Windows.h CloseHandle" c_CloseHandle :: Ptr () -> IO Bool
 foreign import CALLCONV unsafe "Windows.h GetLastError" c_GetLastError :: IO Word32
 
@@ -37,40 +38,45 @@
 c_ERROR_SHARING_VIOLATION = 32
 #endif
 
-withLockFile :: FilePath -> IO a -> IO a
+usingLockFile :: Cleanup -> FilePath -> IO ()
 
 #ifdef mingw32_HOST_OS
 
-withLockFile file act = withCWString file $ \cfile -> do
-    createDirectoryIfMissing True $ takeDirectory file
-    let open = c_CreateFileW cfile (c_GENERIC_READ .|. c_GENERIC_WRITE) c_FILE_SHARE_NONE nullPtr c_OPEN_ALWAYS c_FILE_ATTRIBUTE_NORMAL nullPtr
-    bracket open c_CloseHandle $ \h ->
-        if h == c_INVALID_HANDLE_VALUE then do
-            err <- c_GetLastError
-            errorIO $ "Shake failed to acquire a file lock on " ++ file ++ "\n" ++
-                      (if err == c_ERROR_SHARING_VIOLATION
-                          then "ERROR_SHARING_VIOLATION - Shake is probably already running."
-                          else "Code " ++ show err ++ ", unknown reason for failure.")
-        else
-            act
+usingLockFile b file = do
+    createDirectoryRecursive $ takeDirectory file
+    let open = withCWString file $ \cfile ->
+            c_CreateFileW cfile (c_GENERIC_READ .|. c_GENERIC_WRITE) c_FILE_SHARE_NONE nullPtr c_OPEN_ALWAYS c_FILE_ATTRIBUTE_NORMAL nullPtr
+    h <- allocate b open (void . c_CloseHandle)
+    when (h == c_INVALID_HANDLE_VALUE) $ do
+        err <- c_GetLastError
+        errorIO $ "Shake failed to acquire a file lock on " ++ file ++ "\n" ++
+                    (if err == c_ERROR_SHARING_VIOLATION
+                        then "ERROR_SHARING_VIOLATION - Shake is probably already running."
+                        else "Code " ++ show err ++ ", unknown reason for failure.")
 
 #else
 
-withLockFile file act = do
-    createDirectoryIfMissing True $ takeDirectory file
-    try $ writeFile file "" :: IO (Either IOException ())
+usingLockFile cleanup file = do
+    createDirectoryRecursive $ takeDirectory file
+    tryIO $ writeFile file ""
 
-    bracket (openFd file ReadWrite Nothing defaultFileFlags) closeFd $ \fd -> do
-        let lock = (WriteLock, AbsoluteSeek, 0, 0)
-        res <- try $ setLock fd lock
-        case res of
-            Right () -> act
-            Left (e :: IOException) -> do
-                res <- getLock fd lock
-                errorIO $ "Shake failed to acquire a file lock on " ++ file ++ "\n" ++
-                          (case res of
-                               Nothing -> ""
-                               Just (pid, _) -> "Shake process ID " ++ show pid ++ " is using this lock.\n") ++
-                          show e
+    fd <- allocate cleanup (openSimpleFd file ReadWrite) closeFd
+    let lock = (WriteLock, AbsoluteSeek, 0, 0)
+    setLock fd lock `catchIO` \e -> do
+        res <- getLock fd lock
+        errorIO $ "Shake failed to acquire a file lock on " ++ file ++ "\n" ++
+                    (case res of
+                        Nothing -> ""
+                        Just (pid, _) -> "Shake process ID " ++ show pid ++ " is using this lock.\n") ++
+                    show e
+
+#ifndef MIN_VERSION_unix
+#define MIN_VERSION_unix(a,b,c) 0
+#endif
+#if MIN_VERSION_unix(2,8,0)
+openSimpleFd file mode = openFd file mode defaultFileFlags
+#else
+openSimpleFd file mode = openFd file mode Nothing defaultFileFlags
+#endif
 
 #endif
diff --git a/src/General/GetOpt.hs b/src/General/GetOpt.hs
new file mode 100644
--- /dev/null
+++ b/src/General/GetOpt.hs
@@ -0,0 +1,64 @@
+
+module General.GetOpt(
+    OptDescr(..), ArgDescr(..),
+    getOpt,
+    fmapFmapOptDescr,
+    showOptDescr,
+    mergeOptDescr,
+    removeOverlap,
+    optionsEnum,
+    optionsEnumDesc
+    ) where
+
+import qualified System.Console.GetOpt as O
+import System.Console.GetOpt hiding (getOpt)
+import qualified Data.HashSet as Set
+import Data.Maybe
+import Data.Either
+import Data.List.Extra
+
+
+getOpt :: [OptDescr (Either String a)] -> [String] -> ([a], [String], [String])
+getOpt opts args = (flagGood, files, flagBad ++ errs)
+    where (flags, files, errs) = O.getOpt O.Permute opts args
+          (flagBad, flagGood) = partitionEithers flags
+
+
+fmapFmapOptDescr :: (a -> b) -> OptDescr (Either String a) -> OptDescr (Either String b)
+fmapFmapOptDescr f = fmap (fmap f)
+
+
+showOptDescr :: [OptDescr a] -> [String]
+showOptDescr xs = concat
+    [ if nargs <= 26 then ["  " ++ args ++ replicate (28 - nargs) ' ' ++ desc]
+                     else ["  " ++ args, replicate 30 ' ' ++ desc]
+    | Option s l arg desc <- xs
+    , let args = intercalate ", " $ map (short arg) s ++ map (long arg) l
+    , let nargs = length args]
+    where short NoArg{} x = "-" ++ [x]
+          short (ReqArg _ b) x = "-" ++ [x] ++ " " ++ b
+          short (OptArg _ b) x = "-" ++ [x] ++ "[" ++ b ++ "]"
+          long NoArg{} x = "--" ++ x
+          long (ReqArg _ b) x = "--" ++ x ++ "=" ++ b
+          long (OptArg _ b) x = "--" ++ x ++ "[=" ++ b ++ "]"
+
+
+-- | Remove flags from the first field that are present in the second
+removeOverlap :: [OptDescr b] -> [OptDescr a] -> [OptDescr a]
+removeOverlap bad = mapMaybe f
+    where
+        short = Set.fromList $ concat [x | Option x _ _ _ <- bad]
+        long  = Set.fromList $ concat [x | Option _ x _ _ <- bad]
+        f (Option a b c d) | null a2 && null b2 = Nothing
+                           | otherwise = Just $ Option a2 b2 c d
+            where a2 = filter (not . flip Set.member short) a
+                  b2 = filter (not . flip Set.member long) b
+
+mergeOptDescr :: [OptDescr (Either String a)] -> [OptDescr (Either String b)] -> [OptDescr (Either String (Either a b))]
+mergeOptDescr xs ys = map (fmapFmapOptDescr Left) xs ++ map (fmapFmapOptDescr Right) ys
+
+optionsEnum :: (Enum a, Bounded a, Show a) => [OptDescr (Either String a)]
+optionsEnum = optionsEnumDesc [(x, "Flag " ++ lower (show x) ++ ".") | x <- enumerate]
+
+optionsEnumDesc :: Show a => [(a, String)] -> [OptDescr (Either String a)]
+optionsEnumDesc xs = [Option "" [lower $ show x] (NoArg $ Right x) d | (x,d) <- xs]
diff --git a/src/General/Ids.hs b/src/General/Ids.hs
new file mode 100644
--- /dev/null
+++ b/src/General/Ids.hs
@@ -0,0 +1,157 @@
+{-# LANGUAGE RecordWildCards, BangPatterns, GADTs, UnboxedTuples #-}
+
+-- Note that argument order is more like IORef than Map, because its mutable
+module General.Ids(
+    Ids, Id(..),
+    empty, insert, lookup, fromList,
+    null, size, sizeUpperBound,
+    forWithKeyM_, forCopy, forMutate,
+    toList, elems, toMap
+    ) where
+
+import Data.IORef.Extra
+import Data.Primitive.Array hiding (fromList)
+import Control.Exception
+import General.Intern(Id(..))
+import Control.Monad.Extra
+import Data.List.Extra(zipFrom)
+import Data.Maybe
+import Data.Functor
+import qualified Data.HashMap.Strict as Map
+import Prelude hiding (lookup, null)
+import GHC.IO(IO(..))
+import GHC.Exts(RealWorld)
+
+
+newtype Ids a = Ids (IORef (S a))
+
+data S a = S
+    {capacity :: {-# UNPACK #-} !Int -- ^ Number of entries in values, initially 0
+    ,used :: {-# UNPACK #-} !Int -- ^ Capacity that has been used, assuming no gaps from index 0, initially 0
+    ,values :: {-# UNPACK #-} !(MutableArray RealWorld (Maybe a))
+    }
+
+
+empty :: IO (Ids a)
+empty = do
+    let capacity = 0
+    let used = 0
+    values <- newArray capacity Nothing
+    Ids <$> newIORef S{..}
+
+fromList :: [a] -> IO (Ids a)
+fromList xs = do
+    let capacity = length xs
+    let used = capacity
+    values <- newArray capacity Nothing
+    forM_ (zipFrom 0 xs) $ \(i, x) ->
+        writeArray values i $ Just x
+    Ids <$> newIORef S{..}
+
+sizeUpperBound :: Ids a -> IO Int
+sizeUpperBound (Ids ref) = do
+    S{..} <- readIORef ref
+    pure used
+
+
+size :: Ids a -> IO Int
+size (Ids ref) = do
+    S{..} <- readIORef ref
+    let go !acc i
+            | i < 0 = pure acc
+            | otherwise = do
+                v <- readArray values i
+                if isJust v then go (acc+1) (i-1) else go acc (i-1)
+    go 0 (used-1)
+
+
+toMap :: Ids a -> IO (Map.HashMap Id a)
+toMap ids = do
+    mp <- Map.fromList <$> toListUnsafe ids
+    pure $! mp
+
+forWithKeyM_ :: Ids a -> (Id -> a -> IO ()) -> IO ()
+forWithKeyM_ (Ids ref) f = do
+    S{..} <- readIORef ref
+    let go !i | i >= used = pure ()
+              | otherwise = do
+                v <- readArray values i
+                whenJust v $ f $ Id $ fromIntegral i
+                go $ i+1
+    go 0
+
+forCopy :: Ids a -> (a -> b) -> IO (Ids b)
+forCopy (Ids ref) f = do
+    S{..} <- readIORef ref
+    values2 <- newArray capacity Nothing
+    let go !i | i >= used = pure ()
+              | otherwise = do
+                v <- readArray values i
+                whenJust v $ \v -> writeArray values2 i $ Just $ f v
+                go $ i+1
+    go 0
+    Ids <$> newIORef (S capacity used values2)
+
+
+forMutate :: Ids a -> (a -> a) -> IO ()
+forMutate (Ids ref) f = do
+    S{..} <- readIORef ref
+    let go !i | i >= used = pure ()
+              | otherwise = do
+                v <- readArray values i
+                whenJust v $ \v -> writeArray values i $! Just $! f v
+                go $ i+1
+    go 0
+
+
+toListUnsafe :: Ids a -> IO [(Id, a)]
+toListUnsafe (Ids ref) = do
+    S{..} <- readIORef ref
+
+    -- execute in O(1) stack
+    -- see https://neilmitchell.blogspot.co.uk/2015/09/making-sequencemapm-for-io-take-o1-stack.html
+    let index _ i | i >= used = []
+        index r i | IO io <- readArray values i = case io r of
+            (# r, Nothing #) -> index r (i+1)
+            (# r, Just v  #) -> (Id $ fromIntegral i, v) : index r (i+1)
+
+    IO $ \r -> (# r, index r 0 #)
+
+
+toList :: Ids a -> IO [(Id, a)]
+toList ids = do
+    xs <- toListUnsafe ids
+    let demand (_:xs) = demand xs
+        demand [] = ()
+    evaluate $ demand xs
+    pure xs
+
+elems :: Ids a -> IO [a]
+elems ids = map snd <$> toList ids
+
+null :: Ids a -> IO Bool
+null ids = (== 0) <$> sizeUpperBound ids
+
+
+insert :: Ids a -> Id -> a -> IO ()
+insert (Ids ref) (Id i) v = do
+    S{..} <- readIORef ref
+    let ii = fromIntegral i
+    if ii < capacity then do
+        writeArray values ii $ Just v
+        when (ii >= used) $ writeIORef' ref S{used=ii+1,..}
+     else do
+        c2<- pure $ max (capacity * 2) (ii + 10000)
+        v2 <- newArray c2 Nothing
+        copyMutableArray v2 0 values 0 capacity
+        writeArray v2 ii $ Just v
+        writeIORef' ref $ S c2 (ii+1) v2
+
+lookup :: Ids a -> Id -> IO (Maybe a)
+lookup (Ids ref) (Id i) = do
+    S{..} <- readIORef ref
+    let ii = fromIntegral i
+    if ii < used then
+        readArray values ii
+     else
+        pure Nothing
diff --git a/src/General/Intern.hs b/src/General/Intern.hs
--- a/src/General/Intern.hs
+++ b/src/General/Intern.hs
@@ -1,27 +1,24 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances, MultiParamTypeClasses #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# OPTIONS_GHC -Wno-unused-imports #-} -- Required since foldl' moves to the prelude
 
 module General.Intern(
     Intern, Id(..),
     empty, insert, add, lookup, toList, fromList
     ) where
 
-import General.Binary
 import Development.Shake.Classes
-import Prelude hiding (lookup)
+import Foreign.Storable
+import Data.Word
 import qualified Data.HashMap.Strict as Map
 import Data.List(foldl')
+import Prelude hiding (lookup)
 
 
 -- Invariant: The first field is the highest value in the Map
 data Intern a = Intern {-# UNPACK #-} !Word32 !(Map.HashMap a Id)
 
 newtype Id = Id Word32
-    deriving (Eq,Hashable,Binary,Show,NFData)
-
-instance BinaryWith w Id where
-    putWith ctx = put
-    getWith ctx = get
-
+    deriving (Eq,Hashable,Ord,Binary,Show,NFData,Storable)
 
 empty :: Intern a
 empty = Intern 0 Map.empty
@@ -37,11 +34,11 @@
 
 
 lookup :: (Eq a, Hashable a) => a -> Intern a -> Maybe Id
-lookup k (Intern n mp) = Map.lookup k mp
+lookup k (Intern _ mp) = Map.lookup k mp
 
 
 toList :: Intern a -> [(a, Id)]
-toList (Intern a b) = Map.toList b
+toList (Intern _ mp) = Map.toList mp
 
 
 fromList :: (Eq a, Hashable a) => [(a, Id)] -> Intern a
diff --git a/src/General/ListBuilder.hs b/src/General/ListBuilder.hs
new file mode 100644
--- /dev/null
+++ b/src/General/ListBuilder.hs
@@ -0,0 +1,52 @@
+{-# LANGUAGE DeriveFunctor, GeneralizedNewtypeDeriving #-}
+
+module General.ListBuilder(
+    ListBuilder, runListBuilder, newListBuilder,
+    Tree(..), flattenTree, unflattenTree
+    ) where
+
+import Data.Semigroup
+import Prelude
+
+
+-- ListBuilder is opaque outside this module
+newtype ListBuilder a = ListBuilder (Tree a)
+    deriving (Semigroup, Monoid, Functor)
+
+data Tree a
+    = Empty
+    | Leaf a
+    | Branch (Tree a) (Tree a)
+      deriving (Functor,Eq,Ord,Show)
+
+
+instance Semigroup (Tree a) where
+    Empty <> x = x
+    x <> Empty = x
+    x <> y = Branch x y
+
+instance Monoid (Tree a) where
+    mempty = Empty
+    mappend = (<>)
+
+flattenTree :: Tree a -> [a]
+flattenTree x = f x []
+    where
+        f Empty acc = acc
+        f (Leaf x) acc = x : acc
+        f (Branch x y) acc = f x (f y acc)
+
+unflattenTree :: Tree a -> [b] -> Tree b
+unflattenTree t xs = fst $ f t xs
+    where
+        f Empty xs = (Empty, xs)
+        f Leaf{} (x:xs) = (Leaf x, xs)
+        f (Branch a b) xs = (Branch a2 b2, xs3)
+            where (a2, xs2) = f a xs
+                  (b2, xs3) = f b xs2
+
+newListBuilder :: a -> ListBuilder a
+newListBuilder = ListBuilder . Leaf
+
+runListBuilder :: ListBuilder a -> [a]
+runListBuilder (ListBuilder x) = flattenTree x
diff --git a/src/General/Makefile.hs b/src/General/Makefile.hs
new file mode 100644
--- /dev/null
+++ b/src/General/Makefile.hs
@@ -0,0 +1,40 @@
+
+module General.Makefile(parseMakefile) where
+
+import qualified Data.ByteString.Char8 as BS
+import Data.Char
+
+
+endsSlash :: BS.ByteString -> Bool
+endsSlash = BS.isSuffixOf (BS.singleton '\\')
+
+wordsMakefile :: BS.ByteString -> [BS.ByteString]
+wordsMakefile = f . BS.splitWith isSpace
+    where
+        f (x:xs) | BS.null x = f xs
+        f (x:y:xs) | endsSlash x = f $ BS.concat [BS.init x, BS.singleton ' ', y] : xs
+        f (x:xs) = x : f xs
+        f [] = []
+
+parseMakefile :: BS.ByteString -> [(BS.ByteString, [BS.ByteString])]
+parseMakefile = concatMap f . join . linesCR
+    where
+        join xs = case span endsSlash xs of
+            ([], []) -> []
+            (xs, []) -> [BS.unwords $ map BS.init xs]
+            ([], y:ys) -> y : join ys
+            (xs, y:ys) -> BS.unwords (map BS.init xs ++ [y]) : join ys
+
+        f x = [(a, wordsMakefile $ BS.drop 1 b) | a <- wordsMakefile a]
+            where (a,b) = BS.break (== ':') $ BS.takeWhile (/= '#') x
+
+
+-- | This is a hot-spot, so optimised
+linesCR :: BS.ByteString -> [BS.ByteString]
+linesCR x = case BS.split '\n' x of
+    x:xs | Just ('\r',x) <- unsnoc x -> x : map (\x -> case unsnoc x of Just ('\r',x) -> x; _ -> x) xs
+    xs -> xs
+    where
+        -- the ByteString unsnoc was introduced in a newer version
+        unsnoc x | BS.null x = Nothing
+                 | otherwise = Just (BS.last x, BS.init x)
diff --git a/src/General/Pool.hs b/src/General/Pool.hs
new file mode 100644
--- /dev/null
+++ b/src/General/Pool.hs
@@ -0,0 +1,169 @@
+{-# LANGUAGE TupleSections #-}
+
+-- | Thread pool implementation. The three names correspond to the following
+--   priority levels (highest to lowest):
+--
+-- * 'addPoolException' - things that probably result in a build error,
+--   so kick them off quickly.
+--
+-- * 'addPoolResume' - things that started, blocked, and may have open
+--   resources in their closure.
+--
+-- * 'addPoolStart' - rules that haven't yet started.
+--
+-- * 'addPoolBatch' - rules that might batch if other rules start first.
+module General.Pool(
+    Pool, runPool,
+    addPool, PoolPriority(..),
+    increasePool, keepAlivePool
+    ) where
+
+import Control.Concurrent.Extra
+import System.Time.Extra
+import Control.Exception
+import Control.Monad.Extra
+import General.Timing
+import General.Thread
+import qualified Data.Heap as Heap
+import qualified Data.HashSet as Set
+import Data.IORef.Extra
+import System.Random
+
+
+---------------------------------------------------------------------
+-- THREAD POOL
+
+{-
+Must keep a list of active threads, so can raise exceptions in a timely manner
+If any worker throws an exception, must signal to all the other workers
+-}
+
+data S = S
+    {alive :: !Bool -- True until there's an exception, after which don't spawn more tasks
+    ,threads :: !(Set.HashSet Thread) -- IMPORTANT: Must be strict or we leak thread stacks
+    ,threadsLimit :: {-# UNPACK #-} !Int -- user supplied thread limit, Set.size threads <= threadsLimit
+    ,threadsCount :: {-# UNPACK #-} !Int -- Set.size threads, but in O(1)
+    ,threadsMax :: {-# UNPACK #-} !Int -- high water mark of Set.size threads (accounting only)
+    ,threadsSum :: {-# UNPACK #-} !Int -- number of threads we have been through (accounting only)
+    ,rand :: IO Int -- operation to give us the next random Int
+    ,todo :: !(Heap.Heap (Heap.Entry (PoolPriority, Int) (IO ()))) -- operations waiting a thread
+    }
+
+
+emptyS :: Int -> Bool -> IO S
+emptyS n deterministic = do
+    rand <- if not deterministic then pure randomIO else do
+        ref <- newIORef 0
+        -- no need to be thread-safe - if two threads race they were basically the same time anyway
+        pure $ do i <- readIORef ref; writeIORef' ref (i+1); pure i
+    pure $ S True Set.empty n 0 0 0 rand Heap.empty
+
+
+data Pool = Pool
+    !(Var S) -- Current state, 'alive' = False to say we are aborting
+    !(Barrier (Either SomeException S)) -- Barrier to signal that we are finished
+
+
+withPool :: Pool -> (S -> IO (S, IO ())) -> IO ()
+withPool (Pool var _) f = join $ modifyVar var $ \s ->
+    if alive s then f s else pure (s, pure ())
+
+withPool_ :: Pool -> (S -> IO S) -> IO ()
+withPool_ pool act = withPool pool $ fmap (, pure()) . act
+
+
+worker :: Pool -> IO ()
+worker pool = withPool pool $ \s -> pure $ case Heap.uncons $ todo s of
+    Nothing -> (s, pure ())
+    Just (Heap.Entry _ now, todo2) -> (s{todo = todo2}, now >> worker pool)
+
+-- | Given a pool, and a function that breaks the S invariants, restore them.
+--   They are only allowed to touch threadsLimit or todo.
+--   Assumes only requires spawning a most one job (e.g. can't increase the pool by more than one at a time)
+step :: Pool -> (S -> IO S) -> IO ()
+-- mask_ is so we don't spawn and not record it
+step pool@(Pool _ done) op = mask_ $ withPool_ pool $ \s -> do
+    s <- op s
+    case Heap.uncons $ todo s of
+        Just (Heap.Entry _ now, todo2) | threadsCount s < threadsLimit s -> do
+            -- spawn a new worker
+            t <- newThreadFinally (now >> worker pool) $ \t res -> case res of
+                Left e -> withPool_ pool $ \s -> do
+                    signalBarrier done $ Left e
+                    pure (remThread t s){alive = False}
+                Right _ ->
+                    step pool $ pure . remThread t
+            pure (addThread t s){todo = todo2}
+        Nothing | threadsCount s == 0 -> do
+            signalBarrier done $ Right s
+            pure s{alive = False}
+        _ -> pure s
+    where
+        addThread t s = s{threads = Set.insert t $ threads s, threadsCount = threadsCount s + 1
+                         ,threadsSum = threadsSum s + 1, threadsMax = threadsMax s `max` (threadsCount s + 1)}
+        remThread t s = s{threads = Set.delete t $ threads s, threadsCount = threadsCount s - 1}
+
+
+-- | Add a new task to the pool. See the top of the module for the relative ordering
+--   and semantics.
+addPool :: PoolPriority -> Pool -> IO a -> IO ()
+addPool priority pool act = step pool $ \s -> do
+    i <- rand s
+    pure s{todo = Heap.insert (Heap.Entry (priority, i) $ void act) $ todo s}
+
+
+data PoolPriority
+    = PoolException
+    | PoolResume
+    | PoolStart
+    | PoolBatch
+    | PoolDeprioritize Double
+      deriving (Eq,Ord)
+
+-- | Temporarily increase the pool by 1 thread. Call the cleanup action to restore the value.
+--   After calling cleanup you should requeue onto a new thread.
+increasePool :: Pool -> IO (IO ())
+increasePool pool = do
+    step pool $ \s -> pure s{threadsLimit = threadsLimit s + 1}
+    pure $ step pool $ \s -> pure s{threadsLimit = threadsLimit s - 1}
+
+
+-- | Make sure the pool cannot run out of tasks (and thus everything finishes) until after the cancel is called.
+--   Ensures that a pool that will requeue in time doesn't go idle.
+keepAlivePool :: Pool -> IO (IO ())
+keepAlivePool pool = do
+    bar <- newBarrier
+    addPool PoolResume pool $ do
+        cancel <- increasePool pool
+        waitBarrier bar
+        cancel
+    pure $ signalBarrier bar ()
+
+
+-- | Run all the tasks in the pool on the given number of works.
+--   If any thread throws an exception, the exception will be reraised.
+runPool :: Bool -> Int -> (Pool -> IO ()) -> IO () -- run all tasks in the pool
+runPool deterministic n act = do
+    s <- newVar =<< emptyS n deterministic
+    done <- newBarrier
+    let pool = Pool s done
+
+    -- if someone kills our thread, make sure we kill our child threads
+    let cleanup = join $ modifyVar s $ \s -> pure (s{alive=False}, stopThreads $ Set.toList $ threads s)
+
+    let ghc10793 = do
+            -- if this thread dies because it is blocked on an MVar there's a chance we have
+            -- a better error in the done barrier, and GHC raised the exception wrongly, see:
+            -- https://ghc.haskell.org/trac/ghc/ticket/10793
+            sleep 1 -- give it a little bit of time for the finally to run
+                    -- no big deal, since the blocked indefinitely takes a while to fire anyway
+            res <- waitBarrierMaybe done
+            case res of
+                Just (Left e) -> throwIO e
+                _ -> throwIO BlockedIndefinitelyOnMVar
+    flip finally cleanup $ handle (\BlockedIndefinitelyOnMVar -> ghc10793) $ do
+        addPool PoolStart pool $ act pool
+        res <- waitBarrier done
+        case res of
+            Left e -> throwIO e
+            Right s -> addTiming $ "Pool finished (" ++ show (threadsSum s) ++ " threads, " ++ show (threadsMax s) ++ " max)"
diff --git a/src/General/Process.hs b/src/General/Process.hs
--- a/src/General/Process.hs
+++ b/src/General/Process.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase #-}
 {-# LANGUAGE RecordWildCards #-}
 
 -- | A wrapping of createProcess to provide a more flexible interface.
@@ -6,8 +7,7 @@
     process, ProcessOpts(..), Source(..), Destination(..)
     ) where
 
-import Control.Applicative
-import Control.Concurrent
+import Control.Concurrent.Extra
 import Control.DeepSeq
 import Control.Exception.Extra as C
 import Control.Monad.Extra
@@ -20,12 +20,11 @@
 import System.Process
 import System.Time.Extra
 import Data.Unique
-import Data.IORef
+import Data.IORef.Extra
 import qualified Data.ByteString.Char8 as BS
-import qualified Data.ByteString.Internal as BS(createAndTrim)
 import qualified Data.ByteString.Lazy as LBS
 import General.Extra
-import Prelude
+import Development.Shake.Internal.Errors
 
 import GHC.IO.Exception (IOErrorType(..), IOException(..))
 
@@ -40,7 +39,7 @@
 newBuffer = liftM2 Buffer newUnique (newIORef [])
 
 addBuffer :: Buffer a -> a -> IO ()
-addBuffer (Buffer _ ref) x = atomicModifyIORef ref $ \xs -> (x:xs, ())
+addBuffer (Buffer _ ref) x = atomicModifyIORef_ ref (x:)
 
 readBuffer :: Buffer a -> IO [a]
 readBuffer (Buffer _ ref) = reverse <$> readIORef ref
@@ -53,6 +52,7 @@
     = SrcFile FilePath
     | SrcString String
     | SrcBytes LBS.ByteString
+    | SrcInherit
 
 data Destination
     = DestEcho
@@ -73,6 +73,8 @@
     ,poStdout :: [Destination]
     ,poStderr :: [Destination]
     ,poAsync :: Bool
+    ,poCloseFds :: Bool
+    ,poGroup :: Bool
     }
 
 
@@ -81,32 +83,45 @@
 
 -- | If two buffers can be replaced by one and a copy, do that (only if they start empty)
 optimiseBuffers :: ProcessOpts -> IO (ProcessOpts, IO ())
-optimiseBuffers po@ProcessOpts{..} = return (po{poStdout = nubOrd poStdout, poStderr = nubOrd poStderr}, return ())
+optimiseBuffers po@ProcessOpts{..} = pure (po{poStdout = nubOrd poStdout, poStderr = nubOrd poStderr}, pure ())
 
 stdStream :: (FilePath -> Handle) -> [Destination] -> [Destination] -> StdStream
-stdStream file [DestEcho] other = Inherit
+stdStream _ [DestEcho] _ = Inherit
 stdStream file [DestFile x] other | other == [DestFile x] || DestFile x `notElem` other = UseHandle $ file x
-stdStream file _ _ = CreatePipe
+stdStream _ _ _ = CreatePipe
 
 
 stdIn :: (FilePath -> Handle) -> [Source] -> (StdStream, Handle -> IO ())
-stdIn file [] = (Inherit, const $ return ())
-stdIn file [SrcFile x] = (UseHandle $ file x, const $ return ())
-stdIn file src = (,) CreatePipe $ \h ->
-    void $ tryBool isPipeGone $ do
-        forM_ src $ \x -> case x of
-            SrcString x -> hPutStr h x
-            SrcBytes x -> LBS.hPutStr h x
-            SrcFile x -> LBS.hPutStr h =<< LBS.hGetContents (file x)
-        hFlush h
-        hClose h
-    where
-        isPipeGone IOError{ioe_type=ResourceVanished, ioe_errno=Just ioe} = Errno ioe == ePIPE
-        isPipeGone _ = False
+stdIn _ [SrcInherit] = (Inherit, const $ pure ())
+stdIn file [SrcFile x] = (UseHandle $ file x, const $ pure ())
+stdIn file src = (,) CreatePipe $ \h -> ignoreSigPipe $ do
+    forM_ src $ \case
+        SrcString x -> hPutStr h x
+        SrcBytes x -> LBS.hPutStr h x
+        SrcFile x -> LBS.hPutStr h =<< LBS.hGetContents (file x)
+        SrcInherit -> pure () -- Can't both inherit and set it
+    hClose h
 
 
+ignoreSigPipe :: IO () -> IO ()
+ignoreSigPipe = handleIO $ \e -> case e of
+    IOError {ioe_type=ResourceVanished, ioe_errno=Just ioe} | Errno ioe == ePIPE -> pure ()
+    _ -> throwIO e
+
+
+withExceptions :: IO () -> IO a -> IO a
+withExceptions stop go = do
+    bar <- newBarrier
+    v <- mask $ \unmask -> do
+        forkFinally (unmask go) $ signalBarrier bar
+        unmask (waitBarrier bar) `onException` do
+            forkIO stop
+            waitBarrier bar
+    either throwIO pure v
+
+
 withTimeout :: Maybe Double -> IO () -> IO a -> IO a
-withTimeout Nothing stop go = go
+withTimeout Nothing _ go = go
 withTimeout (Just s) stop go = bracket (forkIO $ sleep s >> stop) killThread $ const go
 
 
@@ -120,32 +135,20 @@
 forkWait a = do
     res <- newEmptyMVar
     _ <- mask $ \restore -> forkIO $ try_ (restore a) >>= putMVar res
-    return $ takeMVar res >>= either throwIO return
+    pure $ takeMVar res >>= either throwIO pure
 
 
-abort :: ProcessHandle -> IO ()
-abort pid = do
-    interruptProcessGroupOf pid
-    sleep 5 -- give the process a few seconds grace period to die nicely
-    -- seems to happen with some GHC 7.2 compiled binaries with FFI etc
+abort :: Bool -> ProcessHandle -> IO ()
+abort poGroup pid = do
+    when poGroup $ do
+        interruptProcessGroupOf pid
+        sleep 3 -- give the process a few seconds grace period to die nicely
     terminateProcess pid
 
--- FIXME: There is a new withCreateProcess in process-1.4.3.0 which is probably better than ours...
-withCreateProcessOld :: CreateProcess -> ((Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO a) -> IO a
-withCreateProcessOld cp act = mask $ \restore -> do
-    ans@(inh, outh, errh, pid) <- createProcess cp
-    onException (restore $ act ans) $ do
-        mapM_ (`whenJust` hClose) [inh, outh, errh]
-        ignore $ do
-            -- sometimes we fail before the process is valid
-            -- therefore if terminate process fails, skip waiting on the process
-            terminateProcess pid
-            void $ waitForProcess pid
 
-
 withFiles :: IOMode -> [FilePath] -> ((FilePath -> Handle) -> IO a) -> IO a
 withFiles mode files act = withs (map (`withFile` mode) files) $ \handles ->
-    act $ \x -> fromJust $ lookup x $ zip files handles
+    act $ \x -> fromJust $ lookup x $ zipExact files handles
 
 
 -- General approach taken from readProcessWithExitCode
@@ -155,71 +158,81 @@
     let outFiles = nubOrd [x | DestFile x <- poStdout ++ poStderr]
     let inFiles = nubOrd [x | SrcFile x <- poStdin]
     withFiles WriteMode outFiles $ \outHandle -> withFiles ReadMode inFiles $ \inHandle -> do
-        let cp = (cmdSpec poCommand){cwd = poCwd, env = poEnv, create_group = isJust poTimeout, close_fds = True
+        let cp = (cmdSpec poCommand){cwd = poCwd, env = poEnv, create_group = poGroup, close_fds = poCloseFds
                  ,std_in = fst $ stdIn inHandle poStdin
                  ,std_out = stdStream outHandle poStdout poStderr, std_err = stdStream outHandle poStderr poStdout}
-        withCreateProcessOld cp $ \(inh, outh, errh, pid) ->
-            withTimeout poTimeout (abort pid) $ do
+        withCreateProcessCompat cp $ \inh outh errh pid ->
+            withTimeout poTimeout (abort poGroup pid) $ withExceptions (abort poGroup pid) $ do
 
                 let streams = [(outh, stdout, poStdout) | Just outh <- [outh], CreatePipe <- [std_out cp]] ++
                               [(errh, stderr, poStderr) | Just errh <- [errh], CreatePipe <- [std_err cp]]
                 wait <- forM streams $ \(h, hh, dest) -> do
                     -- no point tying the streams together if one is being streamed directly
                     let isTied = not (poStdout `disjoint` poStderr) && length streams == 2
-                    let isBinary = not $ any isDestString dest && not (any isDestBytes dest)
+                    let isBinary = any isDestBytes dest || not (any isDestString dest)
                     when isTied $ hSetBuffering h LineBuffering
                     when (DestEcho `elem` dest) $ do
                         buf <- hGetBuffering hh
                         case buf of
-                            BlockBuffering{} -> return ()
+                            BlockBuffering{} -> pure ()
                             _ -> hSetBuffering h buf
 
                     if isBinary then do
                         hSetBinaryMode h True
-                        dest <- return $ for dest $ \d -> case d of
+                        dest<- pure $ flip map dest $ \case
                             DestEcho -> BS.hPut hh
                             DestFile x -> BS.hPut (outHandle x)
                             DestString x -> addBuffer x . (if isWindows then replace "\r\n" "\n" else id) . BS.unpack
                             DestBytes x -> addBuffer x
                         forkWait $ whileM $ do
-                            src <- bs_hGetSome h 4096
+                            src <- BS.hGetSome h 4096
                             mapM_ ($ src) dest
                             notM $ hIsEOF h
                      else if isTied then do
-                        dest <- return $ for dest $ \d -> case d of
+                        dest<- pure $ flip map dest $ \case
                             DestEcho -> hPutStrLn hh
                             DestFile x -> hPutStrLn (outHandle x)
                             DestString x -> addBuffer x . (++ "\n")
+                            DestBytes{} -> throwImpure $ errorInternal "Not reachable due to isBinary condition"
                         forkWait $ whileM $
-                            ifM (hIsEOF h) (return False) $ do
+                            ifM (hIsEOF h) (pure False) $ do
                                 src <- hGetLine h
                                 mapM_ ($ src) dest
-                                return True
+                                pure True
                      else do
                         src <- hGetContents h
                         wait1 <- forkWait $ C.evaluate $ rnf src
-                        waits <- forM dest $ \d -> case d of
+                        waits <- forM dest $ \case
                             DestEcho -> forkWait $ hPutStr hh src
                             DestFile x -> forkWait $ hPutStr (outHandle x) src
-                            DestString x -> do addBuffer x src; return $ return ()
-                        return $ sequence_ $ wait1 : waits
+                            DestString x -> do addBuffer x src; pure $ pure ()
+                            DestBytes{} -> throwImpure $ errorInternal "Not reachable due to isBinary condition"
+                        pure $ sequence_ $ wait1 : waits
 
                 whenJust inh $ snd $ stdIn inHandle poStdin
                 if poAsync then
-                    return (pid, ExitSuccess)
+                    pure (pid, ExitSuccess)
                  else do
                     sequence_ wait
                     flushBuffers
                     res <- waitForProcess pid
                     whenJust outh hClose
                     whenJust errh hClose
-                    return (pid, res)
+                    pure (pid, res)
 
 
 ---------------------------------------------------------------------
 -- COMPATIBILITY
 
--- available in bytestring-0.9.1.10 and above
--- implementation copied below
-bs_hGetSome :: Handle -> Int -> IO BS.ByteString
-bs_hGetSome h i = BS.createAndTrim i $ \p -> hGetBufSome h p i
+-- available in process-1.4.3.0, GHC ??? (Nov 2015)
+-- logic copied directly (apart from Ctrl-C handling magic using internal pieces)
+withCreateProcessCompat :: CreateProcess -> (Maybe Handle -> Maybe Handle -> Maybe Handle -> ProcessHandle -> IO a) -> IO a
+withCreateProcessCompat cp act = bracketOnError (createProcess cp) cleanup
+    (\(m_in, m_out, m_err, ph) -> act m_in m_out m_err ph)
+    where
+        cleanup (inh, outh, errh, pid) = do
+            terminateProcess pid
+            whenJust inh $ ignoreSigPipe . hClose
+            whenJust outh hClose
+            whenJust errh hClose
+            forkIO $ void $ waitForProcess pid
diff --git a/src/General/String.hs b/src/General/String.hs
deleted file mode 100644
--- a/src/General/String.hs
+++ /dev/null
@@ -1,67 +0,0 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-
-module General.String(
-    BS, pack, unpack, pack_, unpack_,
-    BSU, packU, unpackU, packU_, unpackU_, requireU
-    ) where
-
-import qualified Data.ByteString as BS (any)
-import qualified Data.ByteString.Char8 as BS hiding (any)
-import qualified Data.ByteString.UTF8 as UTF8
-import Development.Shake.Classes
-
-
----------------------------------------------------------------------
--- Data.ByteString
--- Mostly because ByteString does not have an NFData instance in GHC 7.4
-
--- | ASCII ByteString
-newtype BS = BS BS.ByteString
-    deriving (Hashable, Binary, Eq)
-
-instance Show BS where
-    show (BS x) = show x
-
-instance NFData BS where
-    -- some versions of ByteString do not have NFData instances, but seq is equivalent
-    -- for a strict bytestring. Therefore, we write our own instance.
-    rnf (BS x) = x `seq` ()
-
-
--- | UTF8 ByteString
-newtype BSU = BSU BS.ByteString
-    deriving (Hashable, Binary, Eq)
-
-instance NFData BSU where
-    rnf (BSU x) = x `seq` ()
-
-instance Show BSU where
-    show = unpackU
-
-
-pack :: String -> BS
-pack = pack_ . BS.pack
-
-unpack :: BS -> String
-unpack = BS.unpack . unpack_
-
-pack_ :: BS.ByteString -> BS
-pack_ = BS
-
-unpack_ :: BS -> BS.ByteString
-unpack_ (BS x) = x
-
-packU :: String -> BSU
-packU = packU_ . UTF8.fromString
-
-unpackU :: BSU -> String
-unpackU = UTF8.toString . unpackU_
-
-unpackU_ :: BSU -> BS.ByteString
-unpackU_ (BSU x) = x
-
-packU_ :: BS.ByteString -> BSU
-packU_ = BSU
-
-requireU :: BSU -> Bool
-requireU = BS.any (>= 0x80) . unpackU_
diff --git a/src/General/Template.hs b/src/General/Template.hs
--- a/src/General/Template.hs
+++ b/src/General/Template.hs
@@ -1,47 +1,96 @@
+{-# LANGUAGE CPP #-}
 {-# LANGUAGE ViewPatterns #-}
 
+-- Keep using iso8601DateFormat, since the alternative was introduced in time-1.9
+-- while GHC 8.6 still has time-1.8.
+-- Safe once we no longer support GHC 8.6.
+{-# OPTIONS_GHC -Wno-deprecations #-}
+
+#ifdef FILE_EMBED
+{-# LANGUAGE TemplateHaskell #-}
+#endif
+
 module General.Template(runTemplate) where
 
 import System.FilePath.Posix
 import Control.Exception.Extra
-import Control.Monad
-import Control.Monad.IO.Class
 import Data.Char
+import Data.Time
+import System.IO.Unsafe
+import Development.Shake.Internal.Paths
 import qualified Data.ByteString.Lazy.Char8 as LBS
+import qualified Language.Javascript.DGTable as DGTable
 import qualified Language.Javascript.Flot as Flot
 import qualified Language.Javascript.JQuery as JQuery
 
+#ifdef FILE_EMBED
+import Data.FileEmbed
+import Language.Haskell.TH.Syntax ( runIO )
+#endif
 
+{- HLINT ignore "Redundant bracket" -} -- a result of CPP expansion
+
+-- Very hard to abstract over TH, so we do it with CPP
+#ifdef FILE_EMBED
+#define FILE(x) (pure (LBS.fromStrict $(embedFile =<< runIO (x))))
+#else
+#define FILE(x) (LBS.readFile =<< (x))
+#endif
+
+libraries :: [(String, IO LBS.ByteString)]
 libraries =
-    [("jquery.js", JQuery.file)
-    ,("jquery.flot.js", Flot.file Flot.Flot)
-    ,("jquery.flot.stack.js", Flot.file Flot.FlotStack)
+    [("jquery.js",            FILE(JQuery.file))
+    ,("jquery.dgtable.js",    FILE(DGTable.file))
+    ,("jquery.flot.js",       FILE(Flot.file Flot.Flot))
+    ,("jquery.flot.stack.js", FILE(Flot.file Flot.FlotStack))
     ]
 
+
 -- | Template Engine. Perform the following replacements on a line basis:
 --
 -- * <script src="foo"></script> ==> <script>[[foo]]</script>
 --
 -- * <link href="foo" rel="stylesheet" type="text/css" /> ==> <style type="text/css">[[foo]]</style>
-runTemplate :: MonadIO m => (FilePath -> m LBS.ByteString) -> LBS.ByteString -> m LBS.ByteString
-runTemplate ask = liftM LBS.unlines . mapM f . LBS.lines
+runTemplate :: (FilePath -> IO LBS.ByteString) -> LBS.ByteString -> IO LBS.ByteString
+runTemplate ask = lbsMapLinesIO f
     where
         link = LBS.pack "<link href=\""
         script = LBS.pack "<script src=\""
 
-        f x | Just file <- lbs_stripPrefix script y = do res <- grab file; return $ LBS.pack "<script>\n" `LBS.append` res `LBS.append` LBS.pack "\n</script>"
-            | Just file <- lbs_stripPrefix link y = do res <- grab file; return $ LBS.pack "<style type=\"text/css\">\n" `LBS.append` res `LBS.append` LBS.pack "\n</style>"
-            | otherwise = return x
+        f x | Just file <- lbsStripPrefix script y = do res <- grab file; pure $ LBS.pack "<script>\n" `LBS.append` res `LBS.append` LBS.pack "\n</script>"
+            | Just file <- lbsStripPrefix link y = do res <- grab file; pure $ LBS.pack "<style type=\"text/css\">\n" `LBS.append` res `LBS.append` LBS.pack "\n</style>"
+            | otherwise = pure x
             where
                 y = LBS.dropWhile isSpace x
                 grab = asker . takeWhile (/= '\"') . LBS.unpack
 
-        asker o@(splitFileName -> ("lib/",x)) = case lookup x libraries of
-            Just act -> liftIO $ LBS.readFile =<< act
-            Nothing -> liftIO $ errorIO $ "Template library, unknown library: " ++ o
+        asker o@(splitFileName -> ("lib/",x)) =
+            case lookup x libraries of
+                Nothing -> errorIO $ "Template library, unknown library: " ++ o
+                Just act -> act
+
+        asker "shake.js" = readDataFileHTML "shake.js"
+        asker "data/metadata.js" = do
+            time <- getCurrentTime
+            pure $ LBS.pack $
+                "var version = " ++ show shakeVersionString ++
+                "\nvar generated = " ++ show (formatTime defaultTimeLocale (iso8601DateFormat (Just "%H:%M:%S")) time)
         asker x = ask x
 
+-- Perform a mapM on each line and put the result back together again
+lbsMapLinesIO :: (LBS.ByteString -> IO LBS.ByteString) -> LBS.ByteString -> IO LBS.ByteString
+-- If we do the obvious @fmap LBS.unlines . mapM f@ then all the monadic actions are run on all the lines
+-- before it starts producing the lazy result, killing streaming and having more stack usage.
+-- The real solution (albeit with too many dependencies for something small) is a streaming library,
+-- but a little bit of unsafePerformIO does the trick too.
+lbsMapLinesIO f = pure . LBS.unlines . map (unsafePerformIO . f) . LBS.lines
 
-lbs_stripPrefix :: LBS.ByteString -> LBS.ByteString -> Maybe LBS.ByteString
-lbs_stripPrefix prefix text = if a == prefix then Just b else Nothing
+
+---------------------------------------------------------------------
+-- COMPATIBILITY
+
+-- available in bytestring-0.10.8.0, GHC 8.0 and above
+-- alternative implementation below
+lbsStripPrefix :: LBS.ByteString -> LBS.ByteString -> Maybe LBS.ByteString
+lbsStripPrefix prefix text = if a == prefix then Just b else Nothing
     where (a,b) = LBS.splitAt (LBS.length prefix) text
diff --git a/src/General/Thread.hs b/src/General/Thread.hs
new file mode 100644
--- /dev/null
+++ b/src/General/Thread.hs
@@ -0,0 +1,98 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+
+-- | A bit like 'Fence', but not thread safe and optimised for avoiding taking the fence
+module General.Thread(
+    withThreadsBoth,
+    withThreadSlave,
+    allocateThread,
+    Thread, newThreadFinally, stopThreads
+    ) where
+
+import General.Cleanup
+import Data.Hashable
+import Control.Concurrent.Extra
+import Control.Exception
+import General.Extra
+import Control.Monad.Extra
+
+
+data Thread = Thread ThreadId (Barrier ())
+
+instance Eq Thread where
+    Thread a _ == Thread b _ = a == b
+
+instance Hashable Thread where
+    hashWithSalt salt (Thread a _) = hashWithSalt salt a
+
+-- | The inner thread is unmasked even if you started masked.
+newThreadFinally :: IO a -> (Thread -> Either SomeException a -> IO ()) -> IO Thread
+newThreadFinally act cleanup = do
+    bar <- newBarrier
+    t <- mask_ $ forkIOWithUnmask $ \unmask -> flip finally (signalBarrier bar ()) $ do
+        res <- try $ unmask act
+        me <- myThreadId
+        cleanup (Thread me bar) res
+    pure $ Thread t bar
+
+
+stopThreads :: [Thread] -> IO ()
+stopThreads threads = do
+    -- if a thread is in a masked action, killing it may take some time, so kill them in parallel
+    bars <- sequence [do forkIO $ killThread t; pure bar | Thread t bar <- threads]
+    mapM_ waitBarrier bars
+
+
+-- Run both actions. If either throws an exception, both threads
+-- are killed and an exception reraised.
+-- Not called much, so simplicity over performance (2 threads).
+withThreadsBoth :: IO a -> IO b -> IO (a, b)
+withThreadsBoth act1 act2 = do
+    bar1 <- newBarrier
+    bar2 <- newBarrier
+    parent <- myThreadId
+    ignore <- newVar False
+    mask $ \unmask -> do
+        t1 <- forkIOWithUnmask $ \unmask -> do
+            res1 :: Either SomeException a <- try $ unmask act1
+            unlessM (readVar ignore) $ whenLeft res1 $ throwTo parent
+            signalBarrier bar1 res1
+        t2 <- forkIOWithUnmask $ \unmask -> do
+            res2 :: Either SomeException b <- try $ unmask act2
+            unlessM (readVar ignore) $ whenLeft res2 $ throwTo parent
+            signalBarrier bar2 res2
+        res :: Either SomeException (a,b) <- try $ unmask $ do
+            Right v1 <- waitBarrier bar1
+            Right v2 <- waitBarrier bar2
+            pure (v1,v2)
+        writeVar ignore True
+        killThread t1
+        forkIO $ killThread t2
+        waitBarrier bar1
+        waitBarrier bar2
+        either throwIO pure res
+
+
+-- | Run an action in a separate thread.
+--   After the first action terminates, the thread will be killed.
+--   If the action raises an exception it will be rethrown on the parent thread.
+withThreadSlave :: IO () -> IO a -> IO a
+withThreadSlave slave act = withCleanup $ \cleanup -> do
+    allocateThread cleanup slave
+    act
+
+
+-- | Run the given action in a separate thread.
+--   On cleanup, the thread will be killed before continuing.
+--   If the action raises an exception it will be rethrown on the parent thread.
+allocateThread :: Cleanup -> IO () -> IO ()
+allocateThread cleanup act = do
+    bar <- newBarrier
+    parent <- myThreadId
+    ignore <- newVar False
+    void $ allocate cleanup
+        (mask_ $ forkIOWithUnmask $ \unmask -> do
+            res :: Either SomeException () <- try $ unmask act
+            unlessM (readVar ignore) $ whenLeft res $ throwTo parent
+            signalBarrier bar ()
+        )
+        (\t -> do writeVar ignore True; killThread t; waitBarrier bar)
diff --git a/src/General/Timing.hs b/src/General/Timing.hs
--- a/src/General/Timing.hs
+++ b/src/General/Timing.hs
@@ -1,11 +1,15 @@
 
-module General.Timing(resetTimings, addTiming, printTimings) where
+module General.Timing(resetTimings, addTiming, getTimings) where
 
-import Data.IORef
+import Data.IORef.Extra
 import System.IO.Unsafe
+import Data.Tuple.Extra
+import Data.List.Extra
 import Numeric.Extra
+import General.Extra
 import System.Time.Extra
 
+
 {-# NOINLINE timer #-}
 timer :: IO Seconds
 timer = unsafePerformIO offsetTime
@@ -22,18 +26,18 @@
     writeIORef timings [(now, "Start")]
 
 
--- | Print all withTiming information and clear the information.
-printTimings :: IO ()
-printTimings = do
+-- | Print all withTiming information and clear it.
+getTimings :: IO [String]
+getTimings = do
     now <- timer
-    old <- atomicModifyIORef timings $ \ts -> ([(now, "Start")], ts)
-    putStr $ unlines $ showTimings now $ reverse old
+    old <- atomicModifyIORef timings dupe
+    pure $ showTimings now $ reverse old
 
 
 addTiming :: String -> IO ()
 addTiming msg = do
     now <- timer
-    atomicModifyIORef timings $ \ts -> ((now,msg):ts, ())
+    atomicModifyIORef_ timings ((now,msg):)
 
 
 showTimings :: Seconds -> [(Seconds, String)] -> [String]
@@ -48,7 +52,7 @@
         mx = maximum $ map snd xs
         sm = sum $ map snd xs
         xs = [ (name, stop - start)
-             | ((start, name), stop) <- zip times $ map fst (drop 1 times) ++ [stop]]
+             | ((start, name), stop) <- zipExact times $ map fst (drop1 times) ++ [stop]]
 
 
 showGap :: [(String,String)] -> [String]
diff --git a/src/General/TypeMap.hs b/src/General/TypeMap.hs
new file mode 100644
--- /dev/null
+++ b/src/General/TypeMap.hs
@@ -0,0 +1,44 @@
+{-# LANGUAGE ExistentialQuantification, ConstraintKinds, KindSignatures, GADTs, ScopedTypeVariables, Rank2Types #-}
+
+module General.TypeMap(
+    Map, empty, singleton, insert, map, lookup, unionWith, toList, size
+    ) where
+
+import qualified Data.HashMap.Strict as Map
+import Data.Typeable
+import Unsafe.Coerce
+import Data.Functor
+import qualified Prelude
+import Prelude hiding (lookup, map)
+
+
+data F f = forall a . F !(f a)
+
+unF :: F f -> f a
+unF x = case x of F x -> unsafeCoerce x
+
+newtype Map f = Map (Map.HashMap TypeRep (F f))
+
+empty :: Map f
+empty = Map Map.empty
+
+singleton :: Typeable a => f a -> Map f
+singleton x = Map $ Map.singleton (typeRep x) (F x)
+
+insert :: Typeable a => f a -> Map f -> Map f
+insert x (Map mp) = Map $ Map.insert (typeRep x) (F x) mp
+
+lookup :: forall a f . Typeable a => Map f -> Maybe (f a)
+lookup (Map mp) = unF <$> Map.lookup (typeRep (Proxy :: Proxy a)) mp
+
+unionWith :: (forall a . f a -> f a -> f a) -> Map f -> Map f -> Map f
+unionWith f (Map mp1) (Map mp2) = Map $ Map.unionWith (\x1 x2 -> F $ f (unF x1) (unF x2)) mp1 mp2
+
+map :: (forall a . f1 a -> f2 a) -> Map f1 -> Map f2
+map f (Map mp) = Map $ Map.map (\(F a) -> F $ f a) mp
+
+toList :: (forall a . f a -> b) -> Map f -> [b]
+toList f (Map mp) = Prelude.map (\(F a) -> f a) $ Map.elems mp
+
+size :: Map f -> Int
+size (Map mp) = Map.size mp
diff --git a/src/General/Wait.hs b/src/General/Wait.hs
new file mode 100644
--- /dev/null
+++ b/src/General/Wait.hs
@@ -0,0 +1,122 @@
+{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE DeriveFunctor #-}
+
+-- | A bit like 'Fence', but not thread safe and optimised for avoiding taking the fence
+module General.Wait(
+    Wait(Now,Later), runWait, quickly, fromLater,
+    firstJustWaitUnordered, firstLeftWaitUnordered
+    ) where
+
+import Control.Monad.Extra
+import Control.Monad.IO.Class
+import Data.IORef.Extra
+import Data.List.Extra
+import Data.Primitive.Array
+import GHC.Exts(RealWorld)
+import Control.Monad.Fail
+import Prelude
+
+
+runWait :: Monad m => Wait m a -> m (Wait m a)
+runWait (Lift x) = runWait =<< x
+runWait x = pure x
+
+fromLater :: Monad m => Wait m a -> (a -> m ()) -> m ()
+fromLater (Lift x) f = do x <- x; fromLater x f
+fromLater (Now x) f = f x
+fromLater (Later x) f = x f
+
+quickly :: Functor m => m a -> Wait m a
+quickly = Lift . fmap Now
+
+data Wait m a = Now a
+              | Lift (m (Wait m a))
+              | Later ((a -> m ()) -> m ())
+                deriving Functor
+
+instance (Monad m, Applicative m) => Applicative (Wait m) where
+    pure = Now
+    Now x <*> y = x <$> y
+    Lift x <*> y = Lift $ (<*> y) <$> x
+    Later x <*> Now y = Later $ \c -> x $ \x -> c $ x y
+    -- Note: We pull the Lift from the right BEFORE the Later, to enable parallelism
+    Later x <*> Lift y = Lift $ do y <- y; pure $ Later x <*> y
+    Later x <*> Later y = Later $ \c -> x $ \x -> y $ \y -> c $ x y
+
+instance (Monad m, Applicative m) => Monad (Wait m) where
+    return = pure
+    (>>) = (*>)
+    Now x >>= f = f x
+    Lift x >>= f = Lift $ do x <- x; pure $ x >>= f
+    Later x >>= f = Later $ \c -> x $ \x -> do
+        x <- runWait $ f x
+        case x of
+            Now x -> c x
+            _ -> fromLater x c
+
+instance (MonadIO m,  Applicative m) => MonadIO (Wait m) where
+    liftIO = Lift . liftIO . fmap Now
+
+instance MonadFail m => MonadFail (Wait m) where
+    fail = Lift . Control.Monad.Fail.fail
+
+firstJustWaitUnordered :: MonadIO m => (a -> Wait m (Maybe b)) -> [a] -> Wait m (Maybe b)
+firstJustWaitUnordered f = go 0 [] . map f
+    where
+        -- keep a list of those things we might visit later, and ask for each we see in turn
+        go :: MonadIO m => Int -> [(Maybe a -> m ()) -> m ()] -> [Wait m (Maybe a)] -> Wait m (Maybe a)
+        go !nlater later (x:xs) = case x of
+            Now (Just a) -> Now $ Just a
+            Now Nothing -> go nlater later xs
+            Later l -> go (succ nlater) (l:later) xs
+            Lift x -> Lift $ do
+                x <- x
+                pure $ go nlater later (x:xs)
+        go _ [] [] = Now Nothing
+        go _ [l] [] = Later l
+        go nls ls [] = Later $ \callback -> do
+            ref <- liftIO $ newIORef nls
+            forM_ ls $ \l -> l $ \r -> do
+                old <- liftIO $ readIORef ref
+                when (old > 0) $ case r of
+                    Just a -> do
+                        liftIO $ writeIORef' ref 0
+                        callback $ Just a
+                    Nothing -> do
+                        liftIO $ writeIORef' ref $ old-1
+                        when (old == 1) $ callback Nothing
+
+
+firstLeftWaitUnordered :: MonadIO m => (a -> Wait m (Either e b)) -> [a] -> Wait m (Either e [b])
+firstLeftWaitUnordered f xs = do
+        let n = length xs
+        mut <- liftIO $ newArray n undefined
+        res <- go mut [] $ zipFrom 0 $ map f xs
+        case res of
+            Just e -> pure $ Left e
+            Nothing -> liftIO $ Right <$> mapM (readArray mut) [0..n-1]
+    where
+        -- keep a list of those things we might visit later, and ask for each we see in turn
+        go :: MonadIO m => MutableArray RealWorld b -> [(Int, (Either e b -> m ()) -> m ())] -> [(Int, Wait m (Either e b))] -> Wait m (Maybe e)
+        go mut later ((i,x):xs) = case x of
+            Now (Left e) -> Now $ Just e
+            Now (Right b) -> do
+                liftIO $ writeArray mut i b
+                go mut later xs
+            Later l -> go mut ((i,l):later) xs
+            Lift x -> Lift $ do
+                x <- x
+                pure $ go mut later ((i,x):xs)
+        go _ [] [] = Now Nothing
+        go mut ls [] = Later $ \callback -> do
+            ref <- liftIO $ newIORef $ length ls
+            forM_ ls $ \(i,l) -> l $ \r -> do
+                old <- liftIO $ readIORef ref
+                when (old > 0) $ case r of
+                    Left a -> do
+                        liftIO $ writeIORef' ref 0
+                        callback $ Just a
+                    Right v -> do
+                        liftIO $ writeArray mut i v
+                        liftIO $ writeIORef' ref $ old-1
+                        when (old == 1) $ callback Nothing
diff --git a/src/Paths.hs b/src/Paths.hs
--- a/src/Paths.hs
+++ b/src/Paths.hs
@@ -1,23 +1,12 @@
 -- | Fake cabal module for local building
 
-module Paths_shake where
+module Paths_shake(getDataDir, version) where
 
 import Data.Version.Extra
-import System.IO.Unsafe
-import System.Directory
-import Control.Exception
 
-
--- We want getDataFileName to be relative to the current directory even if
--- we issue a change directory command. Therefore, first call caches, future ones read.
-{-# NOINLINE curdir #-}
-curdir :: String
-curdir = unsafePerformIO getCurrentDirectory
-
-getDataFileName :: FilePath -> IO FilePath
-getDataFileName x = do
-    evaluate curdir
-    return $ curdir ++ "/" ++ x
+-- If Shake can't find files in the data directory it tries relative to the executable
+getDataDir :: IO FilePath
+getDataDir = pure "random_path_that_cannot_possibly_exist"
 
 version :: Version
 version = makeVersion [0,0]
diff --git a/src/Run.hs b/src/Run.hs
--- a/src/Run.hs
+++ b/src/Run.hs
@@ -1,21 +1,20 @@
 
 module Run(main) where
 
-import Development.Make.All
 import Development.Ninja.All
 import System.Environment
 import Development.Shake
 import Development.Shake.FilePath
 import General.Timing(resetTimings)
-import Control.Applicative
 import Control.Monad.Extra
 import Control.Exception.Extra
 import Data.Maybe
 import qualified System.Directory as IO
-import System.Console.GetOpt
+import General.Extra
+import General.GetOpt
 import System.Process
 import System.Exit
-import Prelude
+import Data.Either.Extra
 
 
 main :: IO ()
@@ -27,26 +26,23 @@
         ,"Shakefile.hs","Shakefile.lhs"]
     case hsExe of
         Just file -> do
-            (prog,args) <- return $
+            (prog,args)<- pure $
                 if takeExtension file `elem` [".hs",".lhs"] then ("runhaskell", file:args) else (toNative file, args)
             e <- rawSystem prog args
             when (e /= ExitSuccess) $ exitWith e
-        Nothing -> 
-            withArgs ("--no-time":args) $
-                shakeArgsWith shakeOptions{shakeCreationCheck=False} flags $ \opts targets -> do
-                    let tool = listToMaybe [x | Tool x <- opts]
-                    makefile <- case reverse [x | UseMakefile x <- opts] of
-                        x:_ -> return x
-                        _ -> do
-                            res <- findFile ["makefile","Makefile","build.ninja"]
-                            case res of
-                                Just x -> return x
-                                Nothing -> errorIO "Could not find `makefile', `Makefile' or `build.ninja'"
-                    case () of
-                        _ | takeExtension makefile == ".ninja" -> runNinja makefile targets tool
-                        _ | isJust tool -> error "--tool flag is not supported without a .ninja Makefile"
-                        _ -> Just <$> runMakefile makefile targets
-
+        Nothing -> do
+            let opts = shakeOptions{shakeThreads=0,shakeCreationCheck=False,shakeNeedDirectory=True}
+            let go = shakeArgsWith opts flags $ \opts targets -> do
+                        let tool = listToMaybe [x | Tool x <- opts]
+                        makefile <- case reverse [x | UseMakefile x <- opts] of
+                            x:_ -> pure x
+                            _ -> do
+                                res <- findFile ["build.ninja"]
+                                case res of
+                                    Just x -> pure x
+                                    Nothing -> errorIO "Could not find `build.ninja'"
+                        runNinja go makefile targets tool
+            withArgs ("--no-time":args) go
 
 data Flag = UseMakefile FilePath
           | Tool String
@@ -56,4 +52,4 @@
         ]
 
 findFile :: [FilePath] -> IO (Maybe FilePath)
-findFile = findM (fmap (either (const False) id) . try_ . IO.doesFileExist)
+findFile = findM (fmap (fromRight False) . tryIO . IO.doesFileExist)
diff --git a/src/Test.hs b/src/Test.hs
--- a/src/Test.hs
+++ b/src/Test.hs
@@ -1,57 +1,68 @@
 
 module Test(main) where
 
-import Control.Applicative
-import Control.Exception
-import Control.Monad
+import Control.Exception.Extra
+import Control.Monad.Extra
 import Data.Maybe
-import System.Environment.Extra
+import Data.List.Extra
+import System.Directory
+import System.Environment
 import General.Timing
-import Development.Shake.FileInfo
-import General.String
+import Development.Shake.Internal.FileInfo
+import Development.Shake.Internal.FileName
 import qualified Data.ByteString.Char8 as BS
 import Test.Type(sleepFileTimeCalibrate)
-import Control.Concurrent
-import Prelude
+import Control.Concurrent.Extra
 
-import qualified Test.Assume as Assume
-import qualified Test.Basic as Basic
-import qualified Test.Benchmark as Benchmark
-import qualified Test.C as C
-import qualified Test.Cache as Cache
-import qualified Test.Command as Command
-import qualified Test.Config as Config
-import qualified Test.Digest as Digest
-import qualified Test.Directory as Directory
-import qualified Test.Docs as Docs
-import qualified Test.Errors as Errors
-import qualified Test.FileLock as FileLock
-import qualified Test.Files as Files
-import qualified Test.FilePath as FilePath
-import qualified Test.FilePattern as FilePattern
-import qualified Test.Forward as Forward
-import qualified Test.Journal as Journal
-import qualified Test.Lint as Lint
-import qualified Test.Live as Live
-import qualified Test.Makefile as Makefile
-import qualified Test.Manual as Manual
-import qualified Test.Match as Match
-import qualified Test.Monad as Monad
-import qualified Test.Ninja as Ninja
-import qualified Test.Oracle as Oracle
-import qualified Test.OrderOnly as OrderOnly
-import qualified Test.Parallel as Parallel
-import qualified Test.Pool as Pool
-import qualified Test.Progress as Progress
-import qualified Test.Random as Random
-import qualified Test.Resources as Resources
-import qualified Test.Self as Self
-import qualified Test.Tar as Tar
-import qualified Test.Tup as Tup
-import qualified Test.Unicode as Unicode
-import qualified Test.Util as Util
-import qualified Test.Verbosity as Verbosity
-import qualified Test.Version as Version
+import qualified Test.Basic
+import qualified Test.Batch
+import qualified Test.Benchmark
+import qualified Test.Builtin
+import qualified Test.BuiltinOverride
+import qualified Test.C
+import qualified Test.Cache
+import qualified Test.Cleanup
+import qualified Test.CloseFileHandles
+import qualified Test.Command
+import qualified Test.Config
+import qualified Test.Database
+import qualified Test.Digest
+import qualified Test.Directory
+import qualified Test.Docs
+import qualified Test.Errors
+import qualified Test.Existence
+import qualified Test.FileLock
+import qualified Test.FilePath
+import qualified Test.FilePattern
+import qualified Test.Files
+import qualified Test.Forward
+import qualified Test.History
+import qualified Test.Journal
+import qualified Test.Lint
+import qualified Test.Live
+import qualified Test.Manual
+import qualified Test.Match
+import qualified Test.Monad
+import qualified Test.Ninja
+import qualified Test.Oracle
+import qualified Test.OrderOnly
+import qualified Test.Parallel
+import qualified Test.Pool
+import qualified Test.Progress
+import qualified Test.Random
+import qualified Test.Rebuild
+import qualified Test.Reschedule
+import qualified Test.Resources
+import qualified Test.Self
+import qualified Test.SelfMake
+import qualified Test.Tar
+import qualified Test.Targets
+import qualified Test.Thread
+import qualified Test.Tup
+import qualified Test.Unicode
+import qualified Test.Util
+import qualified Test.Verbosity
+import qualified Test.Version
 
 import qualified Run
 
@@ -59,17 +70,56 @@
 fakes = ["clean" * clean, "test" * test, "make" * makefile, "filetime" * filetime]
     where (*) = (,)
 
-mains = ["tar" * Tar.main, "self" * Self.main, "c" * C.main
-        ,"basic" * Basic.main, "cache" * Cache.main, "command" * Command.main
-        ,"config" * Config.main, "digest" * Digest.main, "directory" * Directory.main
-        ,"docs" * Docs.main, "errors" * Errors.main, "orderonly" * OrderOnly.main
-        ,"filepath" * FilePath.main, "filepattern" * FilePattern.main, "files" * Files.main, "filelock" * FileLock.main
-        ,"forward" * Forward.main, "match" * Match.main
-        ,"journal" * Journal.main, "lint" * Lint.main, "live" * Live.main, "makefile" * Makefile.main, "manual" * Manual.main
-        ,"monad" * Monad.main, "parallel" * Parallel.main, "pool" * Pool.main, "random" * Random.main, "ninja" * Ninja.main
-        ,"resources" * Resources.main, "assume" * Assume.main, "benchmark" * Benchmark.main
-        ,"oracle" * Oracle.main, "progress" * Progress.main, "unicode" * Unicode.main, "util" * Util.main
-        ,"verbosity" * Verbosity.main, "version" * Version.main, "tup" * Tup.main]
+mains =
+    ["basic" * Test.Basic.main
+    ,"batch" * Test.Batch.main
+    ,"benchmark" * Test.Benchmark.main
+    ,"builtin" * Test.Builtin.main
+    ,"builtinOverride" * Test.BuiltinOverride.main
+    ,"c" * Test.C.main
+    ,"cache" * Test.Cache.main
+    ,"cleanup" * Test.Cleanup.main
+    ,"closefilehandles" * Test.CloseFileHandles.main
+    ,"command" * Test.Command.main
+    ,"config" * Test.Config.main
+    ,"database" * Test.Database.main
+    ,"digest" * Test.Digest.main
+    ,"directory" * Test.Directory.main
+    ,"docs" * Test.Docs.main
+    ,"errors" * Test.Errors.main
+    ,"existence" * Test.Existence.main
+    ,"filelock" * Test.FileLock.main
+    ,"filepath" * Test.FilePath.main
+    ,"filepattern" * Test.FilePattern.main
+    ,"files" * Test.Files.main
+    ,"forward" * Test.Forward.main
+    ,"history" * Test.History.main
+    ,"journal" * Test.Journal.main
+    ,"lint" * Test.Lint.main
+    ,"live" * Test.Live.main
+    ,"manual" * Test.Manual.main
+    ,"match" * Test.Match.main
+    ,"monad" * Test.Monad.main
+    ,"ninja" * Test.Ninja.main
+    ,"oracle" * Test.Oracle.main
+    ,"orderonly" * Test.OrderOnly.main
+    ,"parallel" * Test.Parallel.main
+    ,"pool" * Test.Pool.main
+    ,"progress" * Test.Progress.main
+    ,"random" * Test.Random.main
+    ,"rebuild" * Test.Rebuild.main
+    ,"reschedule" * Test.Reschedule.main
+    ,"resources" * Test.Resources.main
+    ,"self" * Test.Self.main
+    ,"selfmake" * Test.SelfMake.main
+    ,"tar" * Test.Tar.main
+    ,"targets" * Test.Targets.main
+    ,"thread" * Test.Thread.main
+    ,"tup" * Test.Tup.main
+    ,"unicode" * Test.Unicode.main
+    ,"util" * Test.Util.main
+    ,"verbosity" * Test.Verbosity.main
+    ,"version" * Test.Version.main]
     where (*) = (,)
 
 
@@ -77,12 +127,14 @@
 main = do
     resetTimings
     xs <- getArgs
-    exePath <- getExecutablePath
     case flip lookup (fakes ++ mains) =<< listToMaybe xs of
         _ | null xs -> do
             putStrLn "******************************************************************"
             putStrLn "** Running shake test suite, run with '--help' to see arguments **"
             putStrLn "******************************************************************"
+            unlessM (doesFileExist "shake.cabal") $ do
+                putStrLn ""
+                errorIO "\nERROR: Must run the test suite from a directory containing the Shake repo."
             withArgs ["test"] main
             withArgs ["random","test","3m"] main
         Nothing -> putStrLn $ unlines
@@ -93,38 +145,35 @@
             ,""
             ,"As an example, try:"
             ,""
-            ,unwords ["  ", exePath, "self",  "--jobs=2", "--trace"]
+            ,"  shake-test self --jobs=2 --trace"
             ,""
-            ,"Which will build Shake, using Shake, on 2 threads."]
-        Just main -> main =<< sleepFileTimeCalibrate
+            ,"Which will build Shake, using Shake, on 2 threads."
+            ,"You must run the test suite from a directory containing the Shake repo."
+            ]
+        Just main -> main =<< sleepFileTimeCalibrate "output/calibrate"
 
 
 makefile :: IO () -> IO ()
 makefile _ = do
     args <- getArgs
-    withArgs (drop 1 args) Run.main
+    withArgs (drop1 args) Run.main
 
 
 filetime :: IO () -> IO ()
 filetime _ = do
     args <- getArgs
     addTiming "Reading files"
-    files <- fmap concat $ forM (drop 1 args) $ \file ->
-        (BS.lines . BS.filter (/= '\r')) <$> BS.readFile file
+    files <- concatForM (drop1 args) $ \file ->
+        BS.lines . BS.filter (/= '\r') <$> BS.readFile file
     let n = length files
     evaluate n
     addTiming "Modtime"
     let (a,bcd) = splitAt (n `div` 4) files
     let (b,cd) = splitAt (n `div` 4) bcd
     let (c,d) = splitAt (n `div` 4) cd
-    vars <- forM [a,b,c,d] $ \xs -> do
-        mvar <- newEmptyMVar
-        forkIO $ do
-            mapM_ (getFileInfo . packU_) xs
-            putMVar mvar ()
-        return $ takeMVar mvar
+    vars <- forM [a,b,c,d] $ \xs ->
+        onceFork $ mapM_ (getFileInfo False . fileNameFromByteString) xs
     sequence_ vars
-    printTimings
 
 
 clean :: IO () -> IO ()
@@ -135,4 +184,4 @@
 test yield = do
     args <- getArgs
     flip onException (putStrLn "TESTS FAILED") $
-        sequence_ [withArgs (name:"test":drop 1 args) $ test yield | (name,test) <- mains, name /= "random"]
+        sequence_ [withArgs (name:"test":drop1 args) $ test yield | (name,test) <- mains, name /= "random"]
diff --git a/src/Test/Assume.hs b/src/Test/Assume.hs
deleted file mode 100644
--- a/src/Test/Assume.hs
+++ /dev/null
@@ -1,45 +0,0 @@
-
-module Test.Assume(main) where
-
-import Development.Shake
-import Test.Type
-import Control.Monad
-import Development.Shake.FilePath
-
-
-main = shakenCwd test $ \args obj -> do
-    want $ map obj args
-    obj "*.out" %> \out -> do
-        cs <- mapM (readFile' . obj . (:".src")) $ takeBaseName out
-        writeFile' out $ concat cs
-
-
-test build obj = do
-    let set file c = writeFile (obj $ file : ".src") [c]
-    let ask file c = do src <- readFile (obj $ file ++ ".out"); src === c
-
-    forM_ ['a'..'f'] $ \c -> set c c
-    build ["--sleep","abc.out"]
-    ask "abc" "abc"
-
-    set 'b' 'd'
-    build ["--sleep","abc.out"]
-    ask "abc" "adc"
-    set 'b' 'p'
-    build ["--sleep","abc.out","--touch"]
-    build ["abc.out"]
-    ask "abc" "adc"
-    set 'c' 'z'
-    build ["--sleep","abc.out"]
-    ask "abc" "apz"
-
-    build ["bc.out","c.out"]
-    ask "bc" "pz"
-    set 'b' 'r'
-    set 'c' 'n'
-    build ["--sleep","abc.out","--touch"]
-    ask "abc" "apz"
-    build ["ab.out","--always-make"]
-    ask "ab" "ar"
-    build ["c.out"]
-    ask "c" "z"
diff --git a/src/Test/Basic.hs b/src/Test/Basic.hs
--- a/src/Test/Basic.hs
+++ b/src/Test/Basic.hs
@@ -6,182 +6,214 @@
 import Test.Type
 import System.Directory as IO
 import Data.List
-import Data.Maybe
 import Control.Monad
 import General.Extra
 
 
-main = shaken test $ \args obj -> do
-    want $ map (\x -> fromMaybe (obj x) $ stripPrefix "!" x) args
-
-    obj "AB.txt" %> \out -> do
-        need [obj "A.txt", obj "B.txt"]
-        text1 <- readFile' $ obj "A.txt"
-        text2 <- readFile' $ obj "B.txt"
+main = testBuild test $ do
+    "AB.txt" %> \out -> do
+        need ["A.txt", "B.txt"]
+        text1 <- readFile' "A.txt"
+        text2 <- readFile' "B.txt"
         writeFile' out $ text1 ++ text2
 
-    obj "twice.txt" %> \out -> do
-        let src = obj "once.txt"
+    "twice.txt" %> \out -> do
+        let src = "once.txt"
         need [src, src]
         copyFile' src out
 
-    obj "once.txt" %> \out -> do
-        src <- readFile' $ obj "zero.txt"
+    "once.txt" %> \out -> do
+        src <- readFile' "zero.txt"
         writeFile' out src
 
     phonys $ \x -> if x /= "halfclean" then Nothing else Just $
-        removeFilesAfter (obj "") ["//*e.txt"]
+        removeFilesAfter "dir" ["//*e.txt"]
 
     phony "cleaner" $
-        removeFilesAfter (obj "") ["//*"]
+        removeFilesAfter "dir" ["//*"]
 
-    phony (obj "configure") $
-        liftIO $ appendFile (obj "configure") "1"
+    phony "cleandb" $
+        removeFilesAfter "." [".shake.database"]
 
+    phony "configure" $
+        liftIO $ appendFile "configure" "1"
+
     phony "install" $ do
-        need [obj "configure",obj "once.txt"]
-        liftIO $ appendFile (obj "install") "1"
+        need ["configure","once.txt"]
+        liftIO $ appendFile "install" "1"
 
     phony "duplicate1" $ need ["duplicate2","duplicate3"]
     phony "duplicate2" $ need ["duplicate3"]
-    phony "duplicate3" $ liftIO $ appendFile (obj "duplicate") "1"
+    phony "duplicate3" $ liftIO $ appendFile "duplicate" "1"
 
     phony "dummy" $
-        liftIO $ appendFile (obj "dummy") "1"
+        liftIO $ appendFile "dummy" "1"
 
     phony "threads" $ do
         x <- getShakeOptions
-        writeFile' (obj "threads.txt") $ show $ shakeThreads x
+        writeFile' "threads.txt" $ show $ shakeThreads x
 
-    phony ("slash" </> "platform") $ return ()
-    phony ("slash/forward") $ return ()
+    phony ("slash" </> "platform") $ pure ()
+    phony "slash/forward" $ pure ()
 
-    obj "dummer.txt" %> \out -> do
+    phony "options" $ do
+        opts <- getShakeOptions
+        putInfo $ show opts
+
+    "dummer.txt" %> \out -> do
         need ["dummy","dummy"]
         need ["dummy"]
         liftIO $ appendFile out "1"
 
     r <- newResource ".log file" 1
-    let trace x = withResource r 1 $ liftIO $ appendFile (obj ".log") x
-    obj "*.par" %> \out -> do
+    let trace x = withResource r 1 $ liftIO $ appendFile ".log" x
+    "*.par" %> \out -> do
         trace "["
         (if "unsafe" `isInfixOf` out then unsafeExtraThread else id) $ liftIO $ sleep 0.1
         trace "]"
         writeFile' out out
 
-    obj "sep" </> "1.txt" %> \out -> writeFile' out ""
-    obj "sep/2.txt" %> \out -> writeFile' out ""
-    [obj "sep" </> "3.txt", obj "sep" </> "4.txt", obj "sep" </> "5.*", obj "sep/6.txt"] |%> \out -> writeFile' out ""
-    [obj "sep" </> "7.txt"] |%> \out -> writeFile' out ""
+    "sep" </> "1.txt" %> \out -> writeFile' out ""
+    "sep/2.txt" %> \out -> writeFile' out ""
+    ["sep" </> "3.txt", "sep" </> "4.txt", "sep" </> "5.*", "sep/6.txt"] |%> \out -> writeFile' out ""
+    ["sep" </> "7.txt"] |%> \out -> writeFile' out ""
 
-    obj "ids/source" %> \out -> return ()
-    obj "ids/out" %> \out -> do need =<< readFileLines (obj "ids/source"); writeFile' out ""
-    obj "ids/*" %> \out -> do alwaysRerun; trace (takeFileName out); writeFile' out $ takeFileName out
+    "ids/source" %> \_ -> pure ()
+    "ids/out" %> \out -> do need =<< readFileLines "ids/source"; writeFile' out ""
+    "ids/*" %> \out -> do alwaysRerun; trace (takeFileName out); writeFile' out $ takeFileName out
 
-    phony (obj "foo") $ do
-        liftIO $ createDirectoryIfMissing True $ obj "foo"
+    "rerun" %> \out -> do alwaysRerun; liftIO $ appendFile out "."
 
-test build obj = do
-    writeFile (obj "A.txt") "AAA"
-    writeFile (obj "B.txt") "BBB"
+    phony "foo" $
+        liftIO $ createDirectoryRecursive "foo"
+
+    phony "ordering2" $
+        liftIO $ appendFile "order.log" "X"
+    phony "ordering" $ do
+        liftIO $ appendFile "order.log" "Y"
+        need ["ordering2"]
+
+test build = do
+    build ["clean"]
+    writeFile "A.txt" "AAA"
+    writeFile "B.txt" "BBB"
     build ["AB.txt","--sleep"]
-    assertContents (obj "AB.txt") "AAABBB"
-    appendFile (obj "A.txt") "aaa"
+    assertContents "AB.txt" "AAABBB"
+    appendFile "A.txt" "aaa"
     build ["AB.txt"]
-    assertContents (obj "AB.txt") "AAAaaaBBB"
-    removeFile $ obj "AB.txt"
+    assertContents "AB.txt" "AAAaaaBBB"
+    removeFile "AB.txt"
     build ["AB.txt"]
-    assertContents (obj "AB.txt") "AAAaaaBBB"
+    assertContents "AB.txt" "AAAaaaBBB"
 
-    writeFile (obj "zero.txt") "xxx"
+    writeFile "zero.txt" "xxx"
     build ["twice.txt","--sleep"]
-    assertContents (obj "twice.txt") "xxx"
-    writeFile (obj "zero.txt") "yyy"
+    assertContents "twice.txt" "xxx"
+    writeFile "zero.txt" "yyy"
     build ["once.txt","--sleep"]
-    assertContents (obj "twice.txt") "xxx"
-    assertContents (obj "once.txt") "yyy"
-    writeFile (obj "zero.txt") "zzz"
+    assertContents "twice.txt" "xxx"
+    assertContents "once.txt" "yyy"
+    writeFile "zero.txt" "zzz"
     build ["once.txt","twice.txt","--sleep"]
-    assertContents (obj "twice.txt") "zzz"
-    assertContents (obj "once.txt") "zzz"
+    assertContents "twice.txt" "zzz"
+    assertContents "once.txt" "zzz"
 
-    removeFile $ obj "twice.txt"
+    removeFile "twice.txt"
     build ["twice.txt"]
-    assertContents (obj "twice.txt") "zzz"
+    assertContents "twice.txt" "zzz"
 
     show shakeOptions === show shakeOptions
+    build ["options"]
 
-    build ["!halfclean"]
-    b <- IO.doesDirectoryExist (obj "")
-    assert b "Directory should exist, cleaner should not have removed it"
+    createDirectoryRecursive "dir"
+    writeFile "dir/ae.txt" ""
+    writeFile "dir/ea.txt" ""
+    build ["halfclean"]
+    assertBoolIO (IO.doesDirectoryExist "dir") "Directory should exist, cleaner should not have removed it"
 
-    build ["!cleaner"]
+    build ["cleaner"]
     sleep 1 -- sometimes takes a while for the file system to notice
-    b <- IO.doesDirectoryExist (obj "")
-    assert (not b) "Directory should not exist, cleaner should have removed it"
+    assertBoolIO (not <$> IO.doesDirectoryExist "dir") "Directory should not exist, cleaner should have removed it"
 
-    IO.createDirectory $ obj ""
-    writeFile (obj "zero.txt") ""
+    assertBoolIO (IO.doesFileExist ".shake.database") "Precondition not met"
+    build ["cleandb"]
+    assertBoolIO (not <$> IO.doesFileExist ".shake.database") "Postcondition not met"
+
+    writeFile "zero.txt" ""
+    writeFile "configure" ""
+    writeFile "install" ""
     build ["configure"]
-    build ["!install"]
-    build ["!install"]
-    assertContents (obj "configure") "111"
-    assertContents (obj "install") "11"
+    build ["install"]
+    build ["install"]
+    assertContents "configure" "111"
+    assertContents "install" "11"
 
-    writeFile (obj "dummy.txt") ""
-    build ["!dummy"]
-    assertContents (obj "dummy") "1"
-    build ["!dummy"]
-    assertContents (obj "dummy") "11"
-    build ["!dummy","!dummy"]
-    assertContents (obj "dummy") "111"
+    build ["dummy"]
+    assertContents "dummy" "1"
+    build ["dummy"]
+    assertContents "dummy" "11"
+    build ["dummy","dummy"]
+    assertContents "dummy" "111"
 
-    writeFile (obj "dummer.txt") ""
+    writeFile "dummer.txt" ""
     build ["dummer.txt"]
-    assertContents (obj "dummer.txt") "1"
+    assertContents "dummer.txt" "1"
     build ["dummer.txt"]
-    assertContents (obj "dummer.txt") "11"
+    assertContents "dummer.txt" "11"
 
     build ["1.par","2.par","-j1"]
-    assertContents (obj ".log") "[][]"
-    writeFile (obj ".log") ""
+    assertContents ".log" "[][]"
+    writeFile ".log" ""
     build ["3.par","4.par","-j2"]
-    assertContents (obj ".log") "[[]]"
-    writeFile (obj ".log") ""
+    assertContents ".log" "[[]]"
+    writeFile ".log" ""
     processors <- getProcessorCount
     putStrLn $ "getProcessorCount returned " ++ show processors
     when (processors > 1) $ do
         build ["5.par","6.par","-j0"]
-        assertContents (obj ".log") "[[]]"
+        assertContents ".log" "[[]]"
 
-    writeFile (obj ".log") ""
+    writeFile ".log" ""
     build ["unsafe1.par","unsafe2.par","-j2"]
-    assertContents (obj ".log") "[[]]"
+    assertContents ".log" "[[]]"
 
-    build ["!threads","-j3"]
-    assertContents (obj "threads.txt") "3"
-    build ["!threads","-j0"]
-    assertContents (obj "threads.txt") (show processors)
+    build ["threads","-j3"]
+    assertContents "threads.txt" "3"
+    build ["threads","-j0"]
+    assertContents "threads.txt" (show processors)
 
-    writeFile (obj "duplicate") ""
-    build ["!duplicate1","!duplicate3"]
-    assertContents (obj "duplicate") "1"
+    writeFile "duplicate" ""
+    build ["duplicate1","duplicate3"]
+    assertContents "duplicate" "1"
 
     build $ concat [["sep/" ++ show i ++ ".txt", "sep" </> show i ++ ".txt"] | i <- [1..7]]
 
-    build ["!slash" </> "platform","!slash" </> "forward"]
-    build ["!slash/platform","!slash/forward"]
+    build ["slash" </> "platform","slash" </> "forward"]
+    build ["slash/platform","slash/forward"]
 
-    createDirectoryIfMissing True (obj "ids")
-    writeFile (obj "ids/source") (obj "ids/a")
+    createDirectoryRecursive "ids"
+    writeFile "ids/source" "ids/a"
     build ["ids/out","--sleep"]
-    writeFile (obj ".log") ""
-    writeFile (obj "ids/source") (obj "ids/b")
+    writeFile ".log" ""
+    writeFile "ids/source" "ids/b"
     build ["ids/out","-j4"]
     -- if you collapse depends to [Id] then this ends up asking for the stale 'a'
-    assertContents (obj ".log") "b"
+    assertContents ".log" "b"
 
+    writeFile "rerun" ""
+    build ["rerun"]
+    assertContents "rerun" "."
+    build ["rerun","rerun"]
+    assertContents "rerun" ".."
+
     build ["foo"]
     build ["foo"]
 
     build [] -- should say "no want/action statements, nothing to do" (checked manually)
+
+    -- #523, #524 - phony children should not run first
+    writeFile "order.log" ""
+    build ["ordering"]
+    assertContents "order.log" "YX"
+    build ["ordering"]
+    assertContents "order.log" "YXYX"
diff --git a/src/Test/Batch.hs b/src/Test/Batch.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Batch.hs
@@ -0,0 +1,109 @@
+
+module Test.Batch(main) where
+
+import Development.Shake
+import Development.Shake.FilePath
+import System.Directory
+import Data.List
+import General.Extra
+import Test.Type
+import Control.Monad
+
+
+main = testBuild test $ do
+    let inp x = x -<.> "in"
+    file <- newResource "log.txt" 1
+    batch 3 ("*.out" %>) (\out -> do need [inp out]; pure out) $ \outs -> do
+        liftIO $ assertBool (length outs <= 3) "length outs <= 3"
+        withResource file 1 $ liftIO $ appendFile "log.txt" $ show (length outs) ++ "\n"
+        putInfo $ "Building batch: " ++ unwords outs
+        forM_ outs $ \out -> liftIO $ copyFile (inp out) out
+    want [show i <.> "out" | i <- [1..6]]
+
+    "ABn.txt" %> \out -> do
+        xs <- needHasChanged ["An.txt", "Bn.txt"]
+        writeFileLines out xs
+
+    ["An", "Bn"] &?%> \outs -> do
+        xs <- needHasChanged $ map (-<.> "in") outs
+        os <- mapM resultHasChanged outs
+        forM_ (zip outs os) $ \(out, o) ->
+            when (o || (out -<.> "in" `elem` xs)) $
+                writeFile' out "1"
+
+    "On" %> \out -> do
+        xs <- needHasChanged ["An", "Bn"]
+        o <- resultHasChanged out
+        writeFileLines out $ xs ++ ["On" | o]
+
+    batch maxBound ("batch_max.*" %>) pure $ \outs ->
+        forM_ outs $ \out -> writeFile' out $ show $ length outs
+
+    phony "sleep2" $ liftIO $ sleep 2
+    batch 2 ("batch_profile.*" %>) (\x -> when ("1" `isSuffixOf` x) (liftIO $ sleep 1) >> pure x) $ \outs -> do
+        liftIO $ sleep 2
+        need ["sleep2"]
+        forM_ outs $ \out -> writeFile' out ""
+
+
+test build = do
+    forM_ [1..6] $ \i -> writeFile (show i <.> "in") $ show i
+    build ["--sleep","-j2"]
+    assertBoolIO (do src <- readFile "log.txt"; pure $ length (lines src) < 6) "some batching"
+    writeFile "log.txt" ""
+    writeFile "2.in" "22"
+    writeFile "5.in" "55"
+    build []
+    assertContents "log.txt" "2\n"
+
+    writeFile "An.txt" "1"
+    writeFile "Bn.txt" "1"
+    build ["ABn.txt", "--sleep"]
+    assertContents "ABn.txt" "An.txt\nBn.txt\n"
+    writeFile "An.txt" "1"
+    build ["ABn.txt", "--sleep"]
+    assertContents "ABn.txt" "An.txt\n"
+    writeFile "Bn.txt" "1"
+    build ["ABn.txt", "--sleep"]
+    assertContents "ABn.txt" "Bn.txt\n"
+    build ["ABn.txt", "--sleep"]
+    assertContents "ABn.txt" "Bn.txt\n"
+    writeFile "ABn.txt" "bogus"
+    build ["ABn.txt", "--sleep"]
+    assertContents "ABn.txt" ""
+    writeFile "Bn.txt" "1"
+    build ["Bn.txt", "--sleep"]
+    build ["ABn.txt"]
+    assertContents "ABn.txt" "Bn.txt\n"
+
+    forM_ [[],["--usepredicate"]] $ \args -> do
+        writeFile "An.in" "1"
+        writeFile "Bn.in" "1"
+        removeFile_ "On"
+        build $ ["On", "--sleep"] ++ args
+        assertContents "On" "An\nBn\nOn\n"
+        writeFile "An.in" "1"
+        build $ ["On", "--sleep"] ++ args
+        assertContents "On" "An\n"
+        writeFile "Bn.in" "1"
+        build $ ["On", "--sleep"] ++ args
+        assertContents "On" "Bn\n"
+        build $ ["On", "--sleep"] ++ args
+        assertContents "On" "Bn\n"
+        removeFile "An"
+        build $ ["On", "--sleep"] ++ args
+        assertContents "On" "An\n"
+        removeFile "An"
+        writeFile "Bn.in" "2"
+        build $ ["On", "--sleep"] ++ args
+        assertContents "On" "An\nBn\n"
+        removeFile "On"
+        build $ ["On", "--sleep"] ++ args
+        assertContents "On" "On\n"
+
+    build ["batch_max." ++ show i | i <- [1..100]]
+    assertContents "batch_max.72" "100"
+
+    let names = ["batch_profile." ++ show i | i <- [1..2]]
+    build names
+    assertTimings build $ ("sleep2",2) : zip names [2,1]
diff --git a/src/Test/Benchmark.hs b/src/Test/Benchmark.hs
--- a/src/Test/Benchmark.hs
+++ b/src/Test/Benchmark.hs
@@ -1,27 +1,31 @@
 
 module Test.Benchmark(main) where
 
+import General.GetOpt
 import Development.Shake
 import Test.Type
-import Data.List
+import Text.Read
+import Data.List.Extra
 import Development.Shake.FilePath
 
 
+data Opts = Depth Int | Breadth Int
+opts = [Option "" ["depth"  ] (ReqArg (fmap Depth   . readEither) "INT") ""
+       ,Option "" ["breadth"] (ReqArg (fmap Breadth . readEither) "INT") ""]
+
 -- | Given a breadth and depth come up with a set of build files
-main = shakenCwd test $ \args obj -> do
-    let get ty = head $ [read $ drop (length ty + 1) a | a <- args, (ty ++ "=") `isPrefixOf` a] ++
-                        error ("Could not find argument, expected " ++ ty ++ "=Number")
-        depth = get "depth"
-        breadth = get "breadth"
+main = testBuildArgs test opts $ \opts -> do
+    let depth   = lastDef 75 [x | Depth   x <- opts]
+    let breadth = lastDef 75 [x | Breadth x <- opts]
 
-    want [obj $ "0." ++ show i | i <- [1..breadth]]
-    obj "*" %> \out -> do
+    want ["0." ++ show i | i <- [1..breadth]]
+    "*" %> \out -> do
         let d = read $ takeBaseName out
-        need [obj $ show (d + 1) ++ "." ++ show i | d < depth, i <- [1..breadth]]
+        need [show (d + 1) ++ "." ++ show i | d < depth, i <- [1..breadth]]
         writeFile' out ""
 
-test build obj = do
+test build = do
     -- these help to test the stack limit
     build ["clean"]
-    build ["breadth=75","depth=75"]
-    build ["breadth=75","depth=75"]
+    build []
+    build []
diff --git a/src/Test/Builtin.hs b/src/Test/Builtin.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Builtin.hs
@@ -0,0 +1,71 @@
+{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
+
+module Test.Builtin(main) where
+
+import Development.Shake
+import Development.Shake.Classes
+import Development.Shake.Rule
+import System.Directory as IO
+import qualified System.IO.Extra as IO
+import qualified Data.ByteString.Char8 as BS
+import Test.Type
+
+
+-- WARNING: This code is also reproduced in "Development.Shake.Rule" as documentation.
+-- If it needs editing, you probably need to edit it there too.
+
+newtype File = File FilePath
+    deriving (Show,Eq,Hashable,Binary,NFData,Typeable)
+type instance RuleResult File = ()
+
+data FileRule = FileRule File (Action ())
+    deriving Typeable
+
+addBuiltinFileRule :: Rules ()
+addBuiltinFileRule = addBuiltinRule noLint noIdentity run
+    where
+        fileContents (File x) = do b <- IO.doesFileExist x; if b then IO.readFile' x else pure ""
+
+        run :: BuiltinRun File ()
+        run key old mode = do
+            now <- liftIO $ fileContents key
+            if mode == RunDependenciesSame && fmap BS.unpack old == Just now then
+                pure $ RunResult ChangedNothing (BS.pack now) ()
+            else do
+                (_, act) <- getUserRuleOne key (const Nothing) $ \(FileRule k act) -> if k == key then Just act else Nothing
+                act
+                now <- liftIO $ fileContents key
+                pure $ RunResult ChangedRecomputeDiff (BS.pack now) ()
+
+fileRule :: FilePath -> Action () -> Rules ()
+fileRule file act = addUserRule $ FileRule (File file) act
+
+fileNeed :: FilePath -> Action ()
+fileNeed = apply1 . File
+
+
+main = testBuild test $ do
+    addBuiltinFileRule
+
+    fileRule "a.txt" $ pure ()
+    fileRule "b.txt" $ do
+        fileNeed "a.txt"
+        liftIO $ appendFile "log.txt" "X"
+        liftIO $ writeFile "b.txt" . reverse =<< readFile "a.txt"
+
+    action $ fileNeed "b.txt"
+
+
+test build = do
+    writeFile "log.txt" ""
+    writeFile "a.txt" "test"
+    build []
+    assertContents "b.txt" "tset"
+    assertContents "log.txt" "X"
+
+    build []
+    assertContents "log.txt" "X" -- it doesn't rebuild
+
+    writeFile "a.txt" "more"
+    build []
+    assertContents "b.txt" "erom"
diff --git a/src/Test/BuiltinOverride.hs b/src/Test/BuiltinOverride.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/BuiltinOverride.hs
@@ -0,0 +1,38 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE TypeFamilies #-}
+
+module Test.BuiltinOverride (main) where
+
+import Control.Concurrent
+import Development.Shake
+import Development.Shake.Classes
+import Development.Shake.Rule
+import Test.Type
+
+newtype Key = Key Int
+  deriving (Show, Eq, Hashable, Binary, NFData, Typeable)
+
+type instance RuleResult Key = ()
+
+main sleep = do
+  store <- newEmptyMVar
+
+  testBuild (test store) (setRules store) sleep
+
+setRules resultsStore = do
+  addBuiltinRule noLint noIdentity $ \(Key n) _ _ -> do
+    liftIO $ putMVar resultsStore n
+    pure $ RunResult ChangedRecomputeDiff mempty ()
+  addBuiltinRule noLint noIdentity $ \(Key n) _ _ -> do
+    liftIO $ putMVar resultsStore (n + 1)
+    pure $ RunResult ChangedRecomputeDiff mempty ()
+  action $ apply1 $ Key 1
+
+test store build = do
+  build ["--allow-redefine-rules"]
+
+  res <- takeMVar store
+  assertBool (res == 2) "Rule was not overridden"
+
+  assertException ["rule defined twice"] $ build ["--quiet"]
diff --git a/src/Test/C.hs b/src/Test/C.hs
--- a/src/Test/C.hs
+++ b/src/Test/C.hs
@@ -5,17 +5,17 @@
 import Development.Shake.FilePath
 import Test.Type
 
-main = shaken noTest $ \args obj -> do
-    let src = "src/Test/C"
-    want [obj "Main.exe"]
+main = testBuild defaultTest $ do
+    let src = shakeRoot </> "src/Test/C"
+    want ["Main.exe"]
 
-    obj "Main.exe" %> \out -> do
+    "Main.exe" %> \out -> do
         cs <- getDirectoryFiles src ["*.c"]
-        let os = map (obj . (<.> "o")) cs
+        let os = map (<.> "o") cs
         need os
         cmd "gcc -o" [out] os
 
-    obj "*.c.o" %> \out -> do
+    "*.c.o" %> \out -> do
         let c = src </> takeBaseName out
         need [c]
         headers <- cIncludes c
@@ -25,4 +25,4 @@
 cIncludes :: FilePath -> Action [FilePath]
 cIncludes x = do
     Stdout stdout <- cmd "gcc" ["-MM",x]
-    return $ drop 2 $ words stdout
+    pure $ drop 2 $ words stdout
diff --git a/src/Test/Cache.hs b/src/Test/Cache.hs
--- a/src/Test/Cache.hs
+++ b/src/Test/Cache.hs
@@ -3,37 +3,72 @@
 
 import Development.Shake
 import Development.Shake.FilePath
+import System.Directory
 import Data.Char
 import Test.Type
 
 
-main = shakenCwd test $ \args obj -> do
-    want $ map obj args
+main = testBuild test $ do
     vowels <- newCache $ \file -> do
         src <- readFile' file
-        liftIO $ appendFile (obj "trace.txt") "1"
-        return $ length $ filter isDigit src
-    obj "*.out*" %> \x ->
+        liftIO $ appendFile "trace.txt" "1"
+        pure $ length $ filter isDigit src
+    "*.out*" %> \x ->
         writeFile' x . show =<< vowels (dropExtension x <.> "txt")
 
+    startCompiler <- newCache $ \() -> do
+        liftIO $ writeFile "compiler.txt" "on"
+        runAfter $ writeFile "compiler.txt" "off"
 
-test build obj = do
-    writeFile (obj "trace.txt") ""
-    writeFile (obj "vowels.txt") "abc123a"
+    "*.lang" %> \out -> do
+        startCompiler ()
+        liftIO $ copyFile "compiler.txt" out
+
+    -- Bug fixed in https://github.com/ndmitchell/shake/pull/796
+    bug796_2 <- newCache $ \() -> do
+        readFile' "bug796.2"
+    "bug796" %> \out -> do
+        a <- readFile' "bug796.1"
+        b <- bug796_2 ()
+        writeFile' out $ a ++ b
+
+
+test build = do
+    build ["clean"]
+    writeFile "trace.txt" ""
+    writeFile "vowels.txt" "abc123a"
     build ["vowels.out1","vowels.out2","-j3","--sleep"]
-    assertContents (obj "trace.txt") "1"
-    assertContents (obj "vowels.out1") "3"
-    assertContents (obj "vowels.out2") "3"
+    assertContents "trace.txt" "1"
+    assertContents "vowels.out1" "3"
+    assertContents "vowels.out2" "3"
 
     build ["vowels.out2","-j3"]
-    assertContents (obj "trace.txt") "1"
-    assertContents (obj "vowels.out1") "3"
+    assertContents "trace.txt" "1"
+    assertContents "vowels.out1" "3"
 
-    writeFile (obj "vowels.txt") "12xyz34"
+    writeFile "vowels.txt" "12xyz34"
     build ["vowels.out2","-j3","--sleep"]
-    assertContents (obj "trace.txt") "11"
-    assertContents (obj "vowels.out2") "4"
+    assertContents "trace.txt" "11"
+    assertContents "vowels.out2" "4"
 
     build ["vowels.out1","-j3","--sleep"]
-    assertContents (obj "trace.txt") "111"
-    assertContents (obj "vowels.out1") "4"
+    assertContents "trace.txt" "111"
+    assertContents "vowels.out1" "4"
+
+    build ["foo.lang","bar.lang"]
+    assertContents "foo.lang" "on"
+    assertContents "compiler.txt" "off"
+    writeFile "compiler.txt" "unstarted"
+    build ["foo.lang","bar.lang"]
+    assertContents "compiler.txt" "unstarted"
+
+    writeFile "bug796.1" "a"
+    writeFile "bug796.2" "b"
+    build ["bug796", "--sleep"]
+    assertContents "bug796" "ab"
+    writeFile "bug796.1" "A"
+    build ["bug796", "--sleep"]
+    assertContents "bug796" "Ab"
+    writeFile "bug796.2" "B"
+    build ["bug796", "--sleep"]
+    assertContents "bug796" "AB"
diff --git a/src/Test/Cleanup.hs b/src/Test/Cleanup.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Cleanup.hs
@@ -0,0 +1,55 @@
+{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable #-}
+
+-- Initially copied from https://raw.githubusercontent.com/snoyberg/conduit/master/resourcet/test/main.hs
+-- on 2018-10-11
+module Test.Cleanup(main) where
+
+import General.Cleanup
+import Data.Typeable
+import Control.Monad
+import Data.IORef
+import Control.Exception
+import Test.Type
+
+
+main = testSimple $ do
+    do -- survives releasing bottom
+        x <- newIORef (0 :: Int)
+        handle (\(_ :: SomeException) -> pure ()) $ withCleanup $ \cleanup -> do
+            _ <- register cleanup $ modifyIORef x (+1)
+            release undefined
+        (=== 1) =<< readIORef x
+
+    do -- early release
+        x <- newIORef (0 :: Int)
+        withCleanup $ \cleanup -> do
+            undo <- register cleanup $ modifyIORef x (+1)
+            release undo
+            (=== 1) =<< readIORef x
+        (=== 1) =<< readIORef x
+
+    do -- unprotect keeps resource from being cleared
+        x <- newIORef (0 :: Int)
+        _ <- withCleanup $ \cleanup -> do
+            key <- register cleanup $ writeIORef x 1
+            unprotect key
+        (=== 0) =<< readIORef x
+
+
+    do -- cleanup actions are masked https://github.com/snoyberg/conduit/issues/144
+        let checkMasked name = do
+                ms <- getMaskingState
+                unless (ms == MaskedUninterruptible) $
+                    error $ show (name, ms)
+        withCleanup $ \cleanup -> do
+            register cleanup (checkMasked "release") >>= release
+            register cleanup (checkMasked "normal")
+        Left Dummy <- try $ withCleanup $ \cleanup -> do
+            register cleanup (checkMasked "exception")
+            throwIO Dummy
+        pure ()
+
+
+data Dummy = Dummy
+    deriving (Show, Typeable)
+instance Exception Dummy
diff --git a/src/Test/CloseFileHandles.hs b/src/Test/CloseFileHandles.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/CloseFileHandles.hs
@@ -0,0 +1,69 @@
+{-# LANGUAGE CPP #-}
+module Test.CloseFileHandles(main) where
+
+import Test.Type
+
+#ifdef mingw32_HOST_OS
+
+main = testNone -- don't know how to do this on windows
+
+#else
+
+import Development.Shake
+import Development.Shake.FilePath
+import System.Posix.IO
+import Control.Monad.Extra
+import System.Exit
+import System.IO
+
+main = testBuild test $ do
+    let helper = toNative $ "helper/close_file_handles_helper" <.> exe
+    let name !> test = do want [name]
+                          name ~> do need ["helper/close_file_handles_helper" <.> exe]; test
+
+    let helper_source = unlines
+            ["import System.Environment"
+            ,"import System.Posix.IO"
+            ,"import System.IO"
+            ,"import System.Exit"
+            ,""
+            ,"main = do"
+            ,"  args <- getArgs"
+            ,"  case args of"
+            ,"    [fdString] -> do"
+            ,"       handle <- fdToHandle (read fdString)"
+            ,"       hClose handle"
+            ,"       exitSuccess"
+            ,"    _ -> do"
+            ,"      progName <- getProgName"
+            ,"      hPutStrLn stderr (\"usage: \" ++ progName ++ \" <file descriptor number>\\n    tries closing the file descriptor number\\n    exits successful, if the file descriptor was open\")"
+            ,"      exitWith (ExitFailure 3)"]
+
+    "close_file_handles_helper.hs" %> \out -> do
+        need ["../../src/Test/CloseFileHandles.hs"]
+        writeFileChanged out helper_source
+
+    ["helper/close_file_handles_helper"<.>exe, "close_file_handles_helper.hi", "close_file_handles_helper.o"] &%> \_ -> do
+        need ["close_file_handles_helper.hs"]
+        cmd "ghc --make" "close_file_handles_helper.hs -o helper/close_file_handles_helper"
+
+    let callWithOpenFile cmdWithOpts = withTempFile $
+            \file -> actionBracket (openFile file AppendMode) hClose $
+                \h -> do fd <- liftIO $ handleToFd h
+                         (Exit c, Stdout _, Stderr _) <- cmdWithOpts helper (show fd) :: Action (Exit, Stdout String, Stderr String)
+                         pure c
+
+    "defaultbehaviour" !> do
+        c <- callWithOpenFile cmd
+        liftIO $ assertBool (c == ExitSuccess) "handle closed without option CloseFileHandles"
+
+    "closing" !> do
+        c <- callWithOpenFile (cmd CloseFileHandles)
+        liftIO $ assertBool (c /= ExitSuccess) "handle not closed with option CloseFileHandles"
+
+test build = do
+    whenM hasTracker $
+        build ["-j4", "--no-lint"]
+    build ["-j4"]
+
+#endif
diff --git a/src/Test/Command.hs b/src/Test/Command.hs
--- a/src/Test/Command.hs
+++ b/src/Test/Command.hs
@@ -2,11 +2,11 @@
 
 module Test.Command(main) where
 
-import Control.Applicative
 import Development.Shake
 import Development.Shake.FilePath
 import Control.Exception.Extra
 import System.Time.Extra
+import General.Extra
 import Control.Monad.Extra
 import System.Directory
 import Test.Type
@@ -18,18 +18,18 @@
 import System.Info.Extra
 import qualified Data.ByteString.Char8 as BS
 import qualified Data.ByteString.Lazy.Char8 as LBS
-import Prelude
 
 
-main = shakenCwd test $ \args obj -> do
+main = testBuild test $ do
     -- shake_helper must be in a subdirectory so we can test placing that subdir on the $PATH
-    let helper = toNative $ obj "helper/shake_helper" <.> exe
-    let name !> test = do want [name | null args || name `elem` args]
-                          name ~> do need [obj "helper/shake_helper" <.> exe]; test
+    let helper = toNative $ "helper/shake_helper" <.> exe
+    let name !> test = do want [name]
+                          name ~> do need ["helper/shake_helper" <.> exe]; test
 
     let helper_source = unlines
-            ["import Control.Concurrent"
+            ["import System.Process"
             ,"import Control.Monad"
+            ,"import Control.Concurrent"
             ,"import System.Directory"
             ,"import System.Environment"
             ,"import System.Exit"
@@ -37,6 +37,7 @@
             ,"import qualified Data.ByteString.Lazy.Char8 as LBS"
             ,"main = do"
             ,"    args <- getArgs"
+            ,"    exe <- getExecutablePath"
             ,"    forM_ args $ \\(a:rg) -> do"
             ,"        case a of"
             ,"            'o' -> putStrLn rg"
@@ -44,19 +45,20 @@
             ,"            'x' -> exitFailure"
             ,"            'c' -> putStrLn =<< getCurrentDirectory"
             ,"            'v' -> putStrLn =<< getEnv rg"
-            ,"            'w' -> threadDelay $ floor $ 1000000 * (read rg :: Double)"
+            ,"            'w' -> threadDelay $ ceiling $ (read rg :: Double) * 1000000"
             ,"            'r' -> LBS.putStr $ LBS.replicate (read rg) 'x'"
             ,"            'i' -> putStr =<< getContents"
+            ,"            's' -> void $ readProcess exe [rg] \"\""
             ,"        hFlush stdout"
             ,"        hFlush stderr"
             ]
 
-    obj "shake_helper.hs" %> \out -> do
+    "shake_helper.hs" %> \out -> do
         need ["../../src/Test/Command.hs"]
         writeFileChanged out helper_source
-    [obj "helper/shake_helper" <.> exe, obj "shake_helper.o", obj "shake_helper.hi"] &%> \_ -> do
-        need [obj "shake_helper.hs"]
-        cmd (Cwd $ obj "") "ghc --make" "shake_helper.hs -o helper/shake_helper"
+    ["helper/shake_helper" <.> exe, "shake_helper.o", "shake_helper.hi"] &%> \_ -> do
+        need ["shake_helper.hs"]
+        cmd "ghc --make" "shake_helper.hs -o helper/shake_helper"
 
     "capture" !> do
         (Stderr err, Stdout out) <- cmd helper ["ostuff goes here","eother stuff here"]
@@ -69,31 +71,47 @@
     "failure" !> do
         (Exit e, Stdout (), Stderr ()) <- cmd helper "oo ee x"
         when (e == ExitSuccess) $ error "/= ExitSuccess"
-        liftIO $ assertException ["BAD"] $ cmd helper "oo eBAD x" (EchoStdout False) (EchoStderr False)
-        liftIO $ assertException ["MORE"] $ cmd helper "oMORE eBAD x" (WithStdout True) (WithStderr False) (EchoStdout False) (EchoStderr False)
+        liftIO $ assertException ["BAD"] $ cmd_ helper "oo eBAD x" (EchoStdout False) (EchoStderr False)
+        liftIO $ assertException ["MORE"] $ cmd_ helper "oMORE eBAD x" (WithStdout True) (WithStderr False) (EchoStdout False) (EchoStderr False)
 
+    "throws" ~>
+        cmd Shell "not_a_process foo"
+
     "cwd" !> do
         -- FIXME: Linux searches the Cwd argument for the file, Windows searches getCurrentDirectory
-        helper <- liftIO $ canonicalizePath $ obj "helper/shake_helper" <.> exe
-        Stdout out <- cmd (Cwd $ obj "") helper "c"
+        helper <- liftIO $ canonicalizePath $ "helper/shake_helper" <.> exe
+        liftIO $ createDirectoryRecursive "helper/tests"
+        Stdout out <- cmd (Cwd "helper/tests") (Cwd "..") helper "c"
         let norm = fmap dropTrailingPathSeparator . canonicalizePath . trim
-        liftIO $ join $ liftM2 (===) (norm out) (norm $ obj "")
+        liftIO $ join $ liftM2 (===) (norm out) (norm "helper")
 
-    "timeout" !> do
-        opts <- getShakeOptions
-        offset <- liftIO offsetTime
+    let checkTimeout act = do
+            offset <- liftIO offsetTime
+            act
+            t <- liftIO offset
+            putInfo $ "Timed out in " ++ showDuration t
+            when (t < 2 || t > 8) $ error $ "failed to timeout, took " ++ show t
+
+    "timeout1" !> checkTimeout (do
         Exit exit <- cmd (Timeout 2) helper "w20"
-        t <- liftIO offset
-        putNormal $ "Timed out in " ++ showDuration t
-        when (exit == ExitSuccess) $ error "== ExitSuccess"
-        when (t < 2 || t > 8) $ error $ "failed to timeout, took " ++ show t
+        liftIO $ assertBool (exit /= ExitSuccess) "exit was ExitSuccess")
 
+    "timeout2" !> do checkTimeout $ liftIO $ timeout 2 $ cmd_ helper "w20"
+
+    -- disabled on Windows because when you abort a Shell process you get a
+    -- "Do you want to terminate the batch file (Y/N)"
+    unless isWindows $ "timeout3" !> do checkTimeout $ liftIO $ timeout 2 $ cmd_ Shell helper "w20"
+
+    "timeout4" !> do checkTimeout $ liftIO $ timeout 2 $ cmd_ helper "sw20"
+
+    "timeout5" !> do checkTimeout $ liftIO $ timeout 2 $ cmd_ helper "i w20"
+
     "env" !> do
         -- use liftIO since it blows away PATH which makes lint-tracker stop working
         Stdout out <- liftIO $ cmd (Env [("FOO","HELLO SHAKE")]) Shell helper "vFOO"
         liftIO $ out === "HELLO SHAKE\n"
-        Stdout out <- cmd (AddEnv "FOO" "GOODBYE SHAKE") Shell helper "vFOO"
-        liftIO $ out === "GOODBYE SHAKE\n"
+        StdoutTrim out <- cmd (AddEnv "FOO" "GOODBYE SHAKE") Shell helper "vFOO"
+        liftIO $ out === "GOODBYE SHAKE"
 
     "space" !> do
         Stdout out <- cmd helper ["oSPACE 1"]
@@ -108,15 +126,15 @@
             fail $ "Invalid CmdLine, " ++ x
 
     "path" !> do
-        let path = AddPath [dropTrailingPathSeparator $ obj "helper"] []
-        unit $ cmd $ obj "helper/shake_helper"
-        unit $ cmd $ obj "helper/shake_helper" <.> exe
-        unit $ cmd path Shell "shake_helper"
-        unit $ cmd path "shake_helper"
+        let path = AddPath [dropTrailingPathSeparator "helper"] []
+        cmd_ "helper/shake_helper"
+        cmd_ $ "helper/shake_helper" <.> exe
+        cmd_ path Shell "shake_helper"
+        cmd_ path "shake_helper"
 
     "file" !> do
-        let file = obj "file.txt"
-        unit $ cmd helper (FileStdout file) (FileStderr file) (EchoStdout False) (EchoStderr False) (WithStderr False) "ofoo ebar obaz"
+        let file = "file.txt"
+        cmd_ helper (FileStdout file) (FileStderr file) (EchoStdout False) (EchoStderr False) (WithStderr False) "ofoo ebar obaz"
         liftIO $ assertContents file "foo\nbar\nbaz\n"
         liftIO $ waits $ \w -> do
             Stderr err <- cmd helper (FileStdout file) (FileStderr file) ["ofoo",w,"ebar",w,"obaz"]
@@ -131,7 +149,7 @@
         liftIO $ (===) (str, bs) $ second BS.pack $ dupe $ if isWindows then "foo\r\n" else "foo\n"
         (Stdout str, Stdout bs) <- cmd helper "ofoo"
         liftIO $ (str, bs) === ("foo\n", BS.pack $ if isWindows then "foo\r\n" else "foo\n")
-        return ()
+        pure ()
 
     "large" !> do
         (Stdout (_ :: String), CmdTime t1) <- cmd helper "r10000000"
@@ -147,26 +165,28 @@
             liftIO $ x === "hello world"
 
     "async" !> do
-        let file = obj "async.txt"
+        let file = "async.txt"
         pid <- cmd helper (FileStdout file) "w2" "ohello"
         Nothing <- liftIO $ getProcessExitCode pid
         ExitSuccess <- liftIO $ waitForProcess pid
         liftIO $ assertContents file "hello\n"
 
 
-test build obj = do
+test build = do
     -- reduce the overhead by running all the tests in parallel
     -- lint can make a big different to the command lines, so test with and without
     whenM hasTracker $
         build ["-j4","--no-lint"]
     build ["-j4"]
 
+    assertException ["not_a_process foo"] (build ["throws","--quiet"])
 
+
 timer :: (CmdResult r, MonadIO m) => (forall r . CmdResult r => m r) -> m r
 timer act = do
     (CmdTime t, CmdLine x, r) <- act
     liftIO $ putStrLn $ "Command " ++ x ++ " took " ++ show t ++ " seconds"
-    return r
+    pure r
 
 waits :: (String -> IO ()) -> IO ()
 waits op = f 0
diff --git a/src/Test/Config.hs b/src/Test/Config.hs
--- a/src/Test/Config.hs
+++ b/src/Test/Config.hs
@@ -5,57 +5,54 @@
 import Development.Shake.FilePath
 import Development.Shake.Config
 import Test.Type
-import Data.Char
+import Data.List.Extra
 import qualified Data.HashMap.Strict as Map
 import Data.Maybe
-import System.Directory
 
 
-main = shakenCwd test $ \args obj -> do
-    want $ map obj ["hsflags.var","cflags.var","none.var","keys"]
-    usingConfigFile $ obj "config"
-    obj "*.var" %> \out -> do
-        cfg <- getConfig $ map toUpper $ takeBaseName out
+main = testBuild test $ do
+    want ["hsflags.var","cflags.var","none.var","keys"]
+    usingConfigFile "config"
+    "*.var" %> \out -> do
+        cfg <- getConfig $ upper $ takeBaseName out
         liftIO $ appendFile (out -<.> "times") "X"
         writeFile' out $ fromMaybe "" cfg
-    obj "keys" %> \out -> do
-        liftIO $ appendFile (obj "keys.times") "X"
+    "keys" %> \out -> do
+        liftIO $ appendFile "keys.times" "X"
         liftIO . writeFile out . unwords =<< getConfigKeys
 
 
-test build obj = do
+test build = do
     build ["clean"]
-    createDirectoryIfMissing True $ obj ""
-    writeFile (obj "config") $ unlines
+    writeFile "config" $ unlines
         ["HEADERS_DIR = /path/to/dir"
         ,"CFLAGS = -O2 -I${HEADERS_DIR} -g"
         ,"HSFLAGS = -O2"]
     build []
-    assertContents (obj "cflags.var") "-O2 -I/path/to/dir -g"
-    assertContents (obj "hsflags.var") "-O2"
-    assertContents (obj "none.var") ""
-    assertContents (obj "keys") "CFLAGS HEADERS_DIR HSFLAGS"
+    assertContents "cflags.var" "-O2 -I/path/to/dir -g"
+    assertContents "hsflags.var" "-O2"
+    assertContents "none.var" ""
+    assertContents "keys" "CFLAGS HEADERS_DIR HSFLAGS"
 
-    appendFile (obj "config") $ unlines
+    appendFile "config" $ unlines
         ["CFLAGS = $CFLAGS -w"]
     build []
-    assertContents (obj "cflags.var") "-O2 -I/path/to/dir -g -w"
-    assertContents (obj "hsflags.var") "-O2"
-    assertContents (obj "cflags.times") "XX"
-    assertContents (obj "hsflags.times") "X"
-    assertContents (obj "keys.times") "X"
+    assertContents "cflags.var" "-O2 -I/path/to/dir -g -w"
+    assertContents "hsflags.var" "-O2"
+    assertContents "cflags.times" "XX"
+    assertContents "hsflags.times" "X"
+    assertContents "keys.times" "X"
 
     -- Test readConfigFileWithEnv
-    writeFile (obj "config") $ unlines
+    writeFile "config" $ unlines
       ["HEADERS_DIR = ${SOURCE_DIR}/path/to/dir"
       ,"CFLAGS = -O2 -I${HEADERS_DIR} -g"]
-    vars <- readConfigFileWithEnv [("SOURCE_DIR", "/path/to/src")]
-                                  (obj "config")
-    assert (Map.lookup "HEADERS_DIR" vars == Just "/path/to/src/path/to/dir")
+    vars <- readConfigFileWithEnv [("SOURCE_DIR", "/path/to/src")] "config"
+    assertBool (Map.lookup "HEADERS_DIR" vars == Just "/path/to/src/path/to/dir")
         $ "readConfigFileWithEnv:"
             ++ " Expected: " ++ show (Just "/path/to/src/path/to/dir")
             ++ " Got: " ++ show (Map.lookup "HEADERS_DIR" vars)
-    assert (Map.lookup "CFLAGS" vars == Just "-O2 -I/path/to/src/path/to/dir -g")
+    assertBool (Map.lookup "CFLAGS" vars == Just "-O2 -I/path/to/src/path/to/dir -g")
         $ "readConfigFileWithEnv:"
             ++ " Expected: " ++ show (Just "-O2 -I/path/to/src/path/to/dir -g")
             ++ " Got: " ++ show (Map.lookup "CFLAGS" vars)
diff --git a/src/Test/Database.hs b/src/Test/Database.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Database.hs
@@ -0,0 +1,102 @@
+
+module Test.Database(main) where
+
+import Control.Concurrent.Extra
+import Control.Exception.Extra
+import Control.Monad
+import Data.List
+import Data.IORef
+import Development.Shake
+import Development.Shake.Database
+import Development.Shake.FilePath
+import System.Time.Extra
+import System.Directory as IO
+import Test.Type
+
+
+rules = do
+    "*.out" %> \out -> do
+        liftIO $ appendFile "log.txt" "x"
+        copyFile' (out -<.> "in") out
+        removeFilesAfter "." ["log.txt"]
+
+    "*.err" %> \out -> fail out
+
+    phony "sleep" $ liftIO $ sleep 20
+
+main = testSimple $ do
+    let opts = shakeOptions{shakeFiles="/dev/null"}
+    writeFile "a.in" "a"
+    writeFile "b.in" "b"
+    sleepFileTime
+    writeFile "log.txt" ""
+    (open, close) <- shakeOpenDatabase opts rules
+    db <- open
+
+    ([12], after) <- shakeRunDatabase db [need ["a.out"] >> pure 12]
+    assertContents "log.txt" "x"
+
+    writeFile "a.in" "A"
+    shakeRunDatabase db [need ["a.out","b.out"]]
+    assertContents "a.out" "A"
+    assertContents "log.txt" "xxx"
+
+    ([13,14], _) <- shakeRunDatabase db [need ["a.out"] >> pure 13, pure 14]
+    assertContents "log.txt" "xxx"
+
+    live <- shakeLiveFilesDatabase db
+    sort live === ["a.in","a.out"]
+
+    shakeProfileDatabase db "-"
+
+    -- check that parallel runs blow up, and that we can throw async exceptions to kill it
+    assertWithin 10 $ do
+        threads <- newBarrier
+        results <- replicateM 2 newBarrier
+        ts <- forM results $ \result -> forkFinally (void $ shakeRunDatabase db [need ["sleep"]]) $ \r -> mask_ $ do
+            print $ "Failed with " ++ show r
+            signalBarrier result r
+            threads <- waitBarrier threads
+            me <- myThreadId
+            forM_ threads $ \t -> when (t /= me) $ throwTo t $ ErrorCall "ab123c"
+        signalBarrier threads ts
+        results <- show <$> mapM waitBarrier results
+        assertBool ("ab123c" `isInfixOf` results) "Contains ab123c"
+        assertBool ("currently running" `isInfixOf` results) "Contains 'currently using'"
+
+    close
+    assertException ["already closed"] $ shakeRunDatabase db []
+
+    shakeRunAfter opts after
+    assertBoolIO (not <$> IO.doesFileExist "log.txt") "Log must be deleted"
+
+    errs <- shakeWithDatabase opts{shakeStaunch=True, shakeVerbosity=Silent} rules $ \db -> do
+        assertException ["Error when running"] $ shakeRunDatabase db [need ["foo.err","bar.err"]]
+        shakeErrorsDatabase db
+    sort (map fst errs) === ["bar.err","foo.err"]
+
+    -- check the progress thread gets killed properly on normal cleanup
+    ref <- newIORef 0
+    opts <- pure opts{shakeProgress = const $ bracket_ (modifyIORef ref succ) (modifyIORef ref succ) $ sleep 100}
+    (open, close) <- shakeOpenDatabase opts rules
+    db <- open
+    ([12], after) <- shakeRunDatabase db [need ["a.out"] >> liftIO (modifyIORef ref succ) >> pure 12]
+    (=== 3) =<< readIORef ref -- success if it all shuts down cleanly
+
+    -- and on an exception
+    writeIORef ref 0
+    assertException ["terminate"] $ shakeRunDatabase db [liftIO (modifyIORef ref succ) >> fail "terminate"]
+    (=== 3) =<< readIORef ref
+
+    -- and on an external exception
+    writeIORef ref 0
+    bar <- newBarrier; bar2 <- newBarrier
+    t <- flip forkFinally (signalBarrier bar2)  $ void $ shakeRunDatabase db $ pure $ do
+        liftIO $ modifyIORef ref succ
+        liftIO $ signalBarrier bar ()
+        need ["sleep"]
+    waitBarrier bar
+    sleep 0.1
+    killThread t
+    waitBarrier bar2
+    (=== 3) =<< readIORef ref
diff --git a/src/Test/Digest.hs b/src/Test/Digest.hs
--- a/src/Test/Digest.hs
+++ b/src/Test/Digest.hs
@@ -6,32 +6,36 @@
 import Test.Type
 
 
-main = shakenCwd test $ \args obj -> do
-    if null args then want [obj "Out.txt",obj "Out2.txt"] else want $ map obj args
+main = testBuild test $ do
+    want ["Out.txt","Out2.txt"]
 
-    obj "Out.txt" %> \out -> do
-        txt <- readFile' $ obj "In.txt"
+    "Out.txt" %> \out -> do
+        txt <- readFile' "In.txt"
         liftIO $ appendFile out txt
 
-    [obj "Out1.txt",obj "Out2.txt"] &%> \[out1,out2] -> do
-        txt <- readFile' $ obj "In.txt"
+    ["Out1.txt","Out2.txt"] &%> \[out1,out2] -> do
+        txt <- readFile' "In.txt"
         liftIO $ appendFile out1 txt
         liftIO $ appendFile out2 txt
 
-    [obj "Bug1.txt",obj "Bug2.txt"] &%> \[out1,out2] -> do
-        need [obj "Bug3.txt"]
+    ["Bug1.txt","Bug2.txt"] &%> \[out1,out2] -> do
+        need ["Bug3.txt"]
         writeFile' out1 "X"
         writeFile' out2 "Y"
 
-    "leaf" ~> return ()
-    obj "node1.txt" %> \file -> do need ["leaf"]; writeFile' file "x"
-    obj "node2.txt" %> \file -> do need [obj "node1.txt"]; liftIO $ appendFile file "x"
+    "leaf" ~> pure ()
+    "node1.txt" %> \file -> do need ["leaf"]; writeFile' file "x"
+    "node2.txt" %> \file -> do need ["node1.txt"]; liftIO $ appendFile file "x"
 
+    ["rewrite1","rewrite2"] &%> \outs -> do
+        alwaysRerun
+        forM_ outs $ \out -> writeFile' out "rewrite"
 
-test build obj = do
-    let outs = take 1 $ map obj ["Out.txt","Out1.txt","Out2.txt"]
+
+test build = do
+    let outs = ["Out.txt","Out1.txt","Out2.txt"]
     let writeOut x = forM_ outs $ \out -> writeFile out x
-    let writeIn = writeFile (obj "In.txt")
+    let writeIn = writeFile "In.txt"
     let assertOut x = forM_ outs $ \out -> assertContents out x
 
     writeOut ""
@@ -88,12 +92,16 @@
 
     -- test for #218
     forM_ [("--digest",1),("--digest-and",1),("--digest-or",2),("--digest-and-input",2),("",2)] $ \(flag,count) -> do
-        writeFile (obj "node2.txt") "y"
+        writeFile "node2.txt" "y"
         replicateM_ 2 $ build $ ["node2.txt","--sleep"] ++ [flag | flag /= ""]
-        assertContents (obj "node2.txt") $ 'y' : replicate count 'x'
+        assertContents "node2.txt" $ 'y' : replicate count 'x'
 
     -- test for #296
-    writeFile (obj "Bug3.txt") "X"
+    writeFile "Bug3.txt" "X"
     build ["--digest-and-input","Bug1.txt","--sleep"]
-    writeFile (obj "Bug3.txt") "Y"
+    writeFile "Bug3.txt" "Y"
     build ["--digest-and-input","Bug1.txt","--lint"]
+
+    -- test for #427
+    build ["rewrite1","--digest-and"]
+    build ["rewrite1","--digest-and","--lint","--sleep"]
diff --git a/src/Test/Directory.hs b/src/Test/Directory.hs
--- a/src/Test/Directory.hs
+++ b/src/Test/Directory.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE TupleSections #-}
 
 module Test.Directory(main) where
 
@@ -7,7 +8,8 @@
 import Data.List
 import Data.Function
 import Control.Monad
-import System.Directory(getCurrentDirectory, setCurrentDirectory, createDirectory, createDirectoryIfMissing)
+import General.Extra
+import System.Directory(createDirectory)
 import qualified System.Directory as IO
 import qualified System.IO.Extra as IO
 
@@ -26,49 +28,44 @@
           f x = [x]
 
 
-main = shakenCwd test $ \args obj -> do
-    let unobj = id
-    want $ map obj args
-    obj "*.contents" %> \out ->
-        writeFileLines out =<< getDirectoryContents (obj $ readEsc $ dropExtension $ unobj out)
-    obj "*.dirs" %> \out ->
-        writeFileLines out =<< getDirectoryDirs (obj $ readEsc $ dropExtension $ unobj out)
-    obj "*.files" %> \out -> do
-        let pats = readEsc $ dropExtension $ unobj out
+main = testBuild test $ do
+    "*.contents" %> \out ->
+        writeFileLines out =<< getDirectoryContents (readEsc $ dropExtension out)
+    "*.dirs" %> \out ->
+        writeFileLines out =<< getDirectoryDirs (readEsc $ dropExtension out)
+    "*.files" %> \out -> do
+        let pats = readEsc $ dropExtension out
         let (x:xs) = ["" | " " `isPrefixOf` pats] ++ words pats
-        writeFileLines out . map toStandard =<< getDirectoryFiles (obj x) xs
+        writeFileLines out . map toStandard =<< getDirectoryFiles x xs
 
-    obj "*.exist" %> \out -> do
-        let xs = map obj $ words $ readEsc $ dropExtension $ unobj out
+    "*.exist" %> \out -> do
+        let xs = words $ readEsc $ dropExtension out
         fs <- mapM doesFileExist xs
         ds <- mapM doesDirectoryExist xs
         let bool x = if x then "1" else "0"
         writeFileLines out $ zipWith ((++) `on` bool) fs ds
 
-    obj "dots" %> \out -> do
-        cwd <- liftIO getCurrentDirectory
-        liftIO $ setCurrentDirectory $ obj ""
+    "dots" %> \out -> do
         b1 <- liftM2 (==) (getDirectoryContents ".") (getDirectoryContents "")
         b2 <- liftM2 (==) (getDirectoryDirs ".") (getDirectoryDirs "")
         b3 <- liftM2 (==) (getDirectoryFiles "." ["*.txt"]) (getDirectoryFiles "" ["*.txt"])
         b4 <- liftM2 (==) (getDirectoryFiles "." ["C.txt/*.txt"]) (getDirectoryFiles "" ["C.txt/*.txt"])
         b5 <- liftM2 (==) (getDirectoryFiles "." ["//*.txt"]) (getDirectoryFiles "" ["//*.txt"])
-        liftIO $ setCurrentDirectory cwd
         writeFileLines out $ map show [b1,b2,b3,b4,b5]
 
-test build obj = do
-    let demand x ys = let f = showEsc x in do build [f]; assertContents (obj f) $ unlines $ words ys
+test build = do
+    let demand x ys = let f = showEsc x in do build [f]; assertContents f $ unlines $ words ys
     build ["clean"]
     demand " *.txt.files" ""
     demand " //*.txt.files" ""
     demand ".dirs" ""
     demand "A.txt B.txt C.txt.exist" "00 00 00"
 
-    writeFile (obj "A.txt") ""
-    writeFile (obj "B.txt") ""
-    createDirectory (obj "C.txt")
-    writeFile (obj "C.txt/D.txt") ""
-    writeFile (obj "C.txt/E.xtx") ""
+    writeFile "A.txt" ""
+    writeFile "B.txt" ""
+    createDirectory "C.txt"
+    writeFile "C.txt/D.txt" ""
+    writeFile "C.txt/E.xtx" ""
     demand " *.txt.files" "A.txt B.txt"
     demand ".dirs" "C.txt"
     demand "A.txt B.txt C.txt.exist" "10 10 01"
@@ -83,17 +80,17 @@
     assertException ["missing_dir","does not exist"] $ build ["--quiet",showEsc "missing_dir *.files"]
 
     build ["dots","--no-lint"]
-    assertContents (obj "dots") $ unlines $ words "True True True True True"
+    assertContents "dots" $ unlines $ words "True True True True True"
 
     let removeTest pat del keep =
             IO.withTempDir $ \dir -> do
                 forM_ (del ++ keep) $ \s -> do
-                    createDirectoryIfMissing True $ dir </> takeDirectory s
+                    createDirectoryRecursive $ dir </> takeDirectory s
                     unless (hasTrailingPathSeparator s) $
                         writeFile (dir </> s) ""
                 removeFiles dir pat
-                createDirectoryIfMissing True dir
-                forM_ (map ((,) False) del ++ map ((,) True) keep) $ \(b,s) -> do
+                createDirectoryRecursive dir
+                forM_ (map (False,) del ++ map (True,) keep) $ \(b,s) -> do
                     b2 <- (if hasTrailingPathSeparator s then IO.doesDirectoryExist else IO.doesFileExist) $ dir </> s
                     when (b /= b2) $ do
                         let f b = if b then "present" else "missing"
diff --git a/src/Test/Docs.hs b/src/Test/Docs.hs
--- a/src/Test/Docs.hs
+++ b/src/Test/Docs.hs
@@ -4,83 +4,111 @@
 
 import Development.Shake
 import Development.Shake.FilePath
+import qualified System.FilePattern.Directory as IO
+import System.Directory
 import Test.Type
-import Control.Monad
 import Data.Char
 import Data.List.Extra
-import Data.Maybe
-import System.Info
-import Data.Version.Extra
 
 
--- Older versions of Haddock garbage the --@ markup
-brokenHaddock = compilerVersion < makeVersion [7,8]
+-- Can't get the paths to work on CI with tracking etc
+main = testBuild (notCI . defaultTest) $ do
+    let index = "dist/doc/html/shake/index.html"
+    let setup = "dist/setup.exe"
+    let config = "dist/setup-config"
+    want ["Success.txt"]
+    let trackIgnore = trackAllow ["dist/**", "dist-newstyle/**"]
 
-main = shaken (\a b -> unless brokenHaddock $ noTest a b) $ \args obj -> do
-    let index = obj "dist/doc/html/shake/index.html"
-    let config = obj "dist/setup-config"
-    want [obj "Success.txt"]
+    let needSource = need =<< getDirectoryFiles "." (map (shakeRoot </>)
+            ["src/Development/Shake.hs","src/Development/Shake//*.hs","src/Development/Ninja/*.hs","src/General//*.hs"])
 
-    want $ map (\x -> fromMaybe (obj x) $ stripPrefix "!" x) args
+    let runSetup :: [String] -> Action ()
+        runSetup args = do
+            trackIgnore
+            need [setup]
+            -- Make Cabal and Stack play nicely with GHC_PACKAGE_PATH
+            setup <- liftIO $ canonicalizePath setup
+            cmd_ (RemEnv "GHC_PACKAGE_PATH") (Cwd shakeRoot) setup args
 
-    let needSource = need =<< getDirectoryFiles "." ["src/Development/Shake.hs","src/Development/Shake//*.hs","src/Development/Ninja/*.hs","src/General//*.hs"]
+    setup %> \_ -> do
+        -- Important to compile the setup binary, or we run foul of
+        -- https://gitlab.haskell.org/ghc/ghc/issues/17575
+        trackIgnore
+        need [shakeRoot </> "Setup.hs"]
+        setup <- liftIO $ canonicalizePath setup
+        curdir <- liftIO $ canonicalizePath "dist"
+        cmd_ (Cwd shakeRoot) "ghc -package=Cabal Setup.hs -o" [setup] "-outputdir" [curdir]
 
     config %> \_ -> do
-        need ["shake.cabal","Setup.hs"]
-        -- Make Cabal and Stack play nicely
         path <- getEnv "GHC_PACKAGE_PATH"
-        unit $ cmd (RemEnv "GHC_PACKAGE_PATH") "runhaskell Setup.hs configure"
-            ["--builddir=" ++ obj "dist","--user"]
+        dist <- liftIO $ canonicalizePath "dist" -- make sure it works even if we cwd
+        need [shakeRoot </> "shake.cabal"]
+        runSetup $
+            ["configure","--builddir=" ++ dist,"--user"] ++
             -- package-db is very sensitive, see #267
-            ["--package-db=" ++ x | x <- maybe [] (filter (`notElem` [".",""]) . splitSearchPath) path]
-        trackAllow [obj "dist//*"]
+            -- note that the reverse ensures the behaviour is consistent between the flags and the env variable
+            ["--package-db=" ++ x | x <- maybe [] (reverse . filter (`notElem` [".",""]) . splitSearchPath) path]
 
+        -- Paths_shake is only created by "Setup build" (which we want to skip), and required by "Setup haddock", so we fake it
+        copyFile' (shakeRoot </> "src/Paths.hs") "dist/build/autogen/Paths_shake.hs"
+        copyFile' (shakeRoot </> "src/Paths.hs") "dist/build/shake/autogen/Paths_shake.hs"
+        writeFile' "dist/build/autogen/cabal_macros.h" ""
+        writeFile' "dist/build/shake/autogen/cabal_macros.h" ""
+
     index %> \_ -> do
-        need [config,"shake.cabal","Setup.hs","README.md","CHANGES.txt"]
+        need $ config : map (shakeRoot </>) ["shake.cabal","Setup.hs","README.md","CHANGES.txt","docs/Manual.md","docs/shake-progress.png"]
         needSource
-        trackAllow [obj "dist//*"]
-        cmd "runhaskell Setup.hs haddock" ["--builddir=" ++ obj "dist"]
-
-    obj "Paths_shake.hs" %> \out ->
-        copyFile' "src/Paths.hs" out
+        trackIgnore
+        dist <- liftIO $ canonicalizePath "dist"
+        runSetup ["haddock", "--builddir=" ++ dist]
 
-    obj "Part_*.hs" %> \out -> do
-        need ["src/Test/Docs.hs"] -- so much of the generator is in this module
+    "Part_*.hs" %> \out -> do
+        need [shakeRoot </> "src/Test/Docs.hs"] -- so much of the generator is in this module
         let noR = filter (/= '\r')
         src <- if "_md" `isSuffixOf` takeBaseName out then
-            fmap (findCodeMarkdown . lines . noR) $ readFile' $ "docs/" ++ drop 5 (reverse (drop 3 $ reverse $ takeBaseName out)) ++ ".md"
+            fmap (findCodeMarkdown . lines . checkBlacklist . noR) $ readFile' $ shakeRoot </> "docs/" ++ drop 5 (reverse (drop 3 $ reverse $ takeBaseName out)) ++ ".md"
          else
-            fmap (findCodeHaddock . noR) $ readFile' $ obj $ "dist/doc/html/shake/" ++ replace "_" "-" (drop 5 $ takeBaseName out) ++ ".html"
+            fmap (findCodeHaddock . checkBlacklist . noR) $ readFile' $ "dist/doc/html/shake/" ++ replace "_" "-" (drop 5 $ takeBaseName out) ++ ".html"
 
         let (imports,rest) = partition ("import " `isPrefixOf`) $ showCode src
         writeFileChanged out $ unlines $
-            ["{-# LANGUAGE DeriveDataTypeable, RankNTypes, MultiParamTypeClasses, ExtendedDefaultRules, GeneralizedNewtypeDeriving #-}"
-            ,"{-# LANGUAGE NoMonomorphismRestriction, ScopedTypeVariables, ConstraintKinds #-}"
+            ["{-# LANGUAGE DeriveDataTypeable, RankNTypes, ExtendedDefaultRules, GeneralizedNewtypeDeriving #-}"
+            ,"{-# LANGUAGE NoMonomorphismRestriction, ScopedTypeVariables, ConstraintKinds, FlexibleContexts, TypeFamilies #-}"
             ,"{-# OPTIONS_GHC -w #-}"
             ,"module " ++ takeBaseName out ++ "() where"
             ,"import Control.Applicative"
             ,"import Control.Concurrent"
+            ,"import Control.Exception"
             ,"import Control.Monad"
-            ,"import Data.ByteString(ByteString)"
+            ,"import Control.Monad.Trans.Reader"
+            ,"import Data.ByteString(ByteString, pack, unpack)"
+            ,"import qualified Data.ByteString.Char8 as BS"
+            ,"import qualified System.Directory.Extra as IO"
+            ,"import qualified System.IO.Extra as IO"
             ,"import Data.Char"
             ,"import Data.Data"
+            ,"import Data.Dynamic"
             ,"import Data.List.Extra"
             ,"import System.Time.Extra"
             ,"import Data.Maybe"
             ,"import Data.Monoid"
-            ,"import Development.Shake hiding ((*>),trackAllow)"
+            ,"import Development.Shake hiding ((*>))"
+            ,"import Development.Shake.Command"
             ,"import Development.Shake.Classes"
-            ,"import Development.Shake.Rule hiding (trackAllow)"
+            ,"import Development.Shake.Database"
+            ,"import Development.Shake.Rule"
             ,"import Development.Shake.Util"
             ,"import Development.Shake.FilePath"
             ,"import System.Console.GetOpt"
-            ,"import System.Directory(setCurrentDirectory)"
+            ,"import System.Directory(setCurrentDirectory, withCurrentDirectory)"
             ,"import qualified System.Directory"
+            ,"import System.Environment(withArgs, lookupEnv, getEnvironment)"
             ,"import System.Process"
             ,"import System.Exit"
             ,"import Control.Applicative"
             ,"import Control.Monad.IO.Class"
-            ,"import System.IO"] ++
+            ,"import Control.Monad.Fail"
+            ,"import System.IO hiding (readFile')"] ++
             ["import " ++ replace "_" "." (drop 5 $ takeBaseName out) | not $ "_md.hs" `isSuffixOf` out] ++
             imports ++
             ["(==>) :: Bool -> Bool -> Bool"
@@ -96,6 +124,7 @@
             ,"time_elapsed = 1.1"
             ,"old = \"\""
             ,"new = \"\""
+            ,"myvar = \"\""
             ,"myfile = \"\""
             ,"inputs = [\"\"]"
             ,"files = [\"\"]"
@@ -108,37 +137,52 @@
             ,"instance Eq (OptDescr a)"
             ,"(foo,bar,baz) = undefined"
             ,"(p1,p2) = (0.0, 0.0)"
-            ,"(r1,r2) = (return () :: Rules(), return () :: Rules())"
+            ,"(r1,r2) = (pure () :: Rules(), pure () :: Rules())"
             ,"xs = []"
             ,"ys = []"
+            ,"os = [\"file.o\"]"
             ,"out = \"\""
             ,"str1 = \"\""
             ,"str2 = \"\""
+            ,"def = undefined"
+            ,"var = undefined"
+            ,"newValue = undefined"
+            ,"newStore = BS.empty"
+            ,"change = ChangedNothing"
             ,"str = \"\""] ++
             rest
 
-    obj "Files.lst" %> \out -> do
-        need ["src/Test/Docs.hs"] -- so much of the generator is in this module
-        need [index,obj "Paths_shake.hs"]
-        filesHs <- getDirectoryFiles (obj "dist/doc/html/shake") ["Development-*.html"]
-        filesMd <- getDirectoryFiles "docs" ["*.md"]
+    "Files.lst" %> \out -> do
+        need [shakeRoot </> "src/Test/Docs.hs"] -- so much of the generator is in this module
+        need [index]
+        filesHs <- liftIO $ IO.getDirectoryFiles "dist/doc/html/shake" ["Development-*.html"]
+        -- filesMd on Travis will only include Manual.md, since it's the only one listed in the .cabal
+        -- On AppVeyor, where we build from source, it will check the rest of the website
+        filesMd <- getDirectoryFiles (shakeRoot </> "docs") ["*.md"]
         writeFileChanged out $ unlines $
-            ["Part_" ++ replace "-" "_" (takeBaseName x) | x <- filesHs, not $ "-Classes.html" `isSuffixOf` x] ++
-            ["Part_" ++ takeBaseName x ++ "_md" | x <- filesMd, takeBaseName x `notElem` ["Developing","Model"]]
+            ["Part_" ++ replace "-" "_" (takeBaseName x) | x <- filesHs,
+                not $ any (`isSuffixOf` x) ["-Classes.html", "-FilePath.html"]] ++
+            ["Part_" ++ takeBaseName x ++ "_md" | x <- filesMd,
+                takeBaseName x `notElem` ["Developing","Model","Architecture"]]
 
-    let needModules = do mods <- readFileLines $ obj "Files.lst"; need [obj m <.> "hs" | m <- mods]; return mods
+    let needModules = do mods <- readFileLines "Files.lst"; need [m <.> "hs" | m <- mods]; pure mods
 
-    obj "Main.hs" %> \out -> do
+    "Main.hs" %> \out -> do
         mods <- needModules
-        writeFileLines out $ ["module Main(main) where"] ++ ["import " ++ m | m <- mods] ++ ["main = return ()"]
+        writeFileLines out $ ["module Main(main) where"] ++ ["import " ++ m ++ "()" | m <- mods] ++ ["main = pure ()"]
 
-    obj "Success.txt" %> \out -> do
+    "Success.txt" %> \out -> do
+        putInfo . ("Checking documentation for:\n" ++) =<< readFile' "Files.lst"
         needModules
-        need [obj "Main.hs", obj "Paths_shake.hs"]
+        need ["Main.hs"]
+        trackIgnore
         needSource
-        unit $ cmd "runhaskell -ignore-package=hashmap " ["-i" ++ obj "","-isrc",obj "Main.hs"]
+        cmd_ "ghc -fno-code -ignore-package=hashmap" ["-idist/build/autogen","-i" ++ shakeRoot </> "src","Main.hs"]
         writeFile' out ""
 
+checkBlacklist :: String -> String
+checkBlacklist xs = if null bad then xs else error $ show ("Blacklist", bad)
+    where bad = [(w, x) | x <- map lower $ lines xs, w <- blacklist, w `isInfixOf` x]
 
 ---------------------------------------------------------------------
 -- FIND THE CODE
@@ -152,18 +196,19 @@
     | tag <- ["code","pre"]
     , x <- insideTag tag src
     , let bad = nubOrd (insideTag "em" x) \\ italics
-    , if null bad then True else error $ "Bad italics, " ++ show bad]
+    , if null bad then True else error $ "Bad italics, " ++ show bad
+    ]
 
 
 findCodeMarkdown :: [String] -> [Code]
 findCodeMarkdown (x:xs) | indented x && not (isBlank x) =
     let (a,b) = span (\x -> indented x || isBlank x) (x:xs)
-    in Code (unindent a) : findCodeMarkdown b
+    in Code (dropWhileEnd isBlank $ unindent a) : findCodeMarkdown b
     where
         indented x = length (takeWhile isSpace x) >= 4
-findCodeMarkdown (x:xs) = map (Code . return) (evens $ splitOn "`" x) ++ findCodeMarkdown xs
+findCodeMarkdown (x:xs) = map (Code . pure) (evens $ splitOn "`" x) ++ findCodeMarkdown xs
     where
-        evens (x:y:xs) = y : evens xs
+        evens (_:x:xs) = x : evens xs
         evens _ = []
 findCodeMarkdown [] = []
 
@@ -172,31 +217,32 @@
 -- RENDER THE CODE
 
 showCode :: [Code] -> [String]
-showCode = concat . zipWith f [1..] . nubOrd
+showCode = concat . zipWithFrom f 1 . nubOrd
     where
         f i (Code x) | "#" `isPrefixOf` concat x = []
                      | all whitelist x = []
-                     | otherwise = showStmt i $ filter (not . isBlank . dropComment) $ map (fixCmd . undefDots) x
+                     | otherwise = showStmt i $ filter (not . isBlank . dropComment) $ fixCmd $ map undefDots x
 
 
-fixCmd :: String -> String
-fixCmd x | "cmd " `isPrefixOf` x || "command " `isPrefixOf` x = "unit $ " ++ x
-fixCmd x = replace "Stdout out" "Stdout (out :: String)" $ replace "Stderr err" "Stderr (err :: String)" x
+fixCmd :: [String] -> [String]
+fixCmd xs
+    | all ("cmd_ " `isPrefixOf`) xs = xs ++ ["pure () :: IO () "]
+    | otherwise = map (replace "Stdout out" "Stdout (out :: String)" . replace "Stderr err" "Stderr (err :: String)") xs
 
 -- | Replace ... with undefined (don't use undefined with cmd; two ...'s should become one replacement)
 undefDots :: String -> String
 undefDots x | Just x <- stripSuffix "..." x, Just (x,_) <- stripInfix "..." x = x ++ new
             | otherwise = replace "..." new x
-    where new = if words x `disjoint` ["cmd","Development.Shake.cmd"] then "undefined" else "[\"\"]"
+    where new = if words x `disjoint` ["cmd","cmd_","Development.Shake.cmd","Development.Shake.cmd_"] then "undefined" else "[\"\"]"
 
 showStmt :: Int -> [String] -> [String]
-showStmt i [] = []
+showStmt _ [] = []
 showStmt i xs | isDecl $ unlines xs = map f xs
     where f x = if fst (word1 x) `elem` dupes then "_" ++ show i ++ "_" ++ x else x
-showStmt i (x:xs) | fst (word1 x) `elem` types = ["type Code_" ++ show i ++ " = " ++ x]
+showStmt i [x] | filter isAlpha (fst $ word1 x) `elem` types = ["type Code_" ++ show i ++ " = " ++ x]
 showStmt i [x] | length (words x) <= 2 = ["code_" ++ show i ++ " = (" ++ x ++ ")"] -- deal with operators and sections
 showStmt i xs | all isPredicate xs, length xs > 1 =
-    zipWith (\j x -> "code_" ++ show i ++ "_" ++ show j ++ " = " ++ x) [1..] xs
+    zipWithFrom (\j x -> "code_" ++ show i ++ "_" ++ show j ++ " = " ++ x) 1 xs
 showStmt i xs = ("code_" ++ show i ++ " = do") : map ("  " ++) xs ++ ["  undefined" | isBindStmt $ last xs]
 
 isPredicate :: String -> Bool
@@ -206,7 +252,7 @@
 isBindStmt x = "let " `isPrefixOf` x || " <- " `isInfixOf` x
 
 isDecl :: String -> Bool
-isDecl x | fst (word1 x) `elem` ["import","infix","instance","newtype"] = True
+isDecl x | fst (word1 x) `elem` ["import","infix","instance","newtype","data"] = True
 isDecl (words -> name:"::":_) | all isAlphaNum name = True -- foo :: Type Signature
 isDecl x | "=" `elem` takeWhile (`notElem` ["let","where"]) (words $ takeWhile (/= '{') x) = True -- foo arg1 arg2 = an implementation
 isDecl _ = False
@@ -230,11 +276,11 @@
 
 -- | Find all pieces of text inside a given tag
 insideTag :: String -> String -> [String]
-insideTag tag = map (fst . breakOn ("</" ++ tag ++ ">")) . drop 1 . splitOn ("<" ++ tag ++ ">")
+insideTag tag = map (fst . breakOn ("</" ++ tag ++ ">")) . drop1 . splitOn ("<" ++ tag ++ ">")
 
 -- | Given some HTML, find the raw text
 innerText :: String -> String
-innerText ('<':xs) = innerText $ drop 1 $ dropWhile (/= '>') xs
+innerText ('<':xs) = innerText $ drop1 $ dropWhile (/= '>') xs
 innerText ('&':xs)
     | Just xs <- stripPrefix "quot;" xs = '\"' : innerText xs
     | Just xs <- stripPrefix "lt;" xs = '<' : innerText xs
@@ -255,11 +301,12 @@
 -- | Identifiers that indicate the fragment is a type
 types :: [String]
 types = words $
-    "MVar IO String FilePath Maybe [String] Char ExitCode Change " ++
-    "Action Resource Assume FilePattern Development.Shake.FilePattern " ++
+    "MVar IO String FilePath Maybe [String] FSATrace Char ExitCode ReaderT Change " ++
+    "Action Resource Rebuild FilePattern Development.Shake.FilePattern " ++
     "Lint Verbosity Rules CmdOption Int Double " ++
     "NFData Binary Hashable Eq Typeable Show Applicative " ++
-    "CmdResult ByteString ProcessHandle Rule Monad Monoid Data TypeRep"
+    "CmdResult ByteString ProcessHandle Rule Monad MonadFail Monoid Data TypeRep " ++
+    "BuiltinRun BuiltinLint BuiltinCheck ShakeDatabase"
 
 -- | Duplicated identifiers which require renaming
 dupes :: [String]
@@ -267,7 +314,7 @@
 
 
 isFilePath :: String -> Bool
-isFilePath x = all validChar  x && ("foo/" `isPrefixOf` x || takeExtension x `elem` exts)
+isFilePath x = "C:\\" `isPrefixOf` x || (all validChar  x && ("foo/" `isPrefixOf` x || takeExtension x `elem` exts))
     where
         validChar x = isAlphaNum x || x `elem` "_./*"
         exts = words $ ".txt .hi .hs .o .exe .tar .cpp .cfg .dep .out .deps .m .h .c .html .zip " ++
@@ -275,11 +322,11 @@
 
 isCmdFlag :: String -> Bool
 isCmdFlag "+RTS" = True
-isCmdFlag x = length a >= 1 && length a <= 2 && all (\x -> isAlphaNum x || x `elem` "-=/_[]") b
+isCmdFlag x = length a `elem` [1,2] && all (\x -> isAlphaNum x || x `elem` "-=/_[]") b
     where (a,b) = span (== '-') x
 
 isCmdFlags :: String -> Bool
-isCmdFlags = all (\x -> let y = fromMaybe x $ stripSuffix "," x in isCmdFlag y || isArg y) . words
+isCmdFlags = all (\x -> let y = dropSuffix "," x in isCmdFlag y || isArg y) . words
     where isArg = all (\x -> isUpper x || x == '=')
 
 isEnvVar :: String -> Bool
@@ -290,32 +337,37 @@
 
 isProgram :: String -> Bool
 isProgram (words -> x:xs) = x `elem` programs && all (\x -> isCmdFlag x || isFilePath x || all isAlpha x || x == "&&") xs
-    where programs = words "excel gcc cl make ghc cabal distcc build tar git fsatrace ninja touch pwd runhaskell rot13 main shake stack"
+    where programs = words "excel gcc docker cl make ghc ghci cabal distcc npm build tar git fsatrace ninja touch pwd runhaskell rot13 main shake stack rm cat sed sh apt-get build-multiple"
+isProgram _ = False
 
 -- | Should a fragment be whitelisted and not checked
 whitelist :: String -> Bool
 whitelist x | null x || isFilePath x || isCmdFlags x || isEnvVar x || isProgram x = True
 whitelist x | elem x $ words $
     "newtype do a q m c x value key os contents clean _make " ++
-    ".. /. // \\ //* dir/*/* dir " ++
-    "ConstraintKinds TemplateHaskell GeneralizedNewtypeDeriving DeriveDataTypeable SetConsoleTitle " ++
+    ".. /. // \\ //* dir/*/* dir [ " ++
+    "ConstraintKinds TemplateHaskell ApplicativeDo OverloadedLists OverloadedStrings GeneralizedNewtypeDeriving DeriveDataTypeable TypeFamilies SetConsoleTitle " ++
     "Data.List System.Directory Development.Shake.FilePath run " ++
     "NoProgress Error src about://tracing " ++
     ".make/i586-linux-gcc/output build " ++
     "/usr/special /usr/special/userbinary " ++
-    "Hidden extension xterm main opts result flagValues argValues " ++
+    "Hidden extension xterm main opts result flagValues argValues fail " ++
     "HEADERS_DIR /path/to/dir CFLAGS let linkFlags temp code out err " ++
     "_shake _shake/build manual chrome://tracing/ compdb " ++
     "docs/manual foo.* _build _build/run depfile 0.000s " ++
     "@ndm_haskell file-name .PHONY filepath trim base stack extra #include " ++
-    "*> "
+    "*> BuiltinRun BuiltinLint BuiltinIdentity RuleResult " ++
+    "oldStore mode node_modules llbuild Makefile " ++
+    "RebuildNever RLIMIT_NOFILE "
     = True
 whitelist x = x `elem`
     ["[Foo.hi, Foo.o]"
     ,"shake-progress"
+    ,"type instance"
     ,"1m25s (15%)"
     ,"3m12s (82%)"
     ,"getPkgVersion $ GhcPkgVersion \"shake\""
+    ,"ghc --make MyBuildSystem -threaded -rtsopts \"-with-rtsopts=-I0 -qg\""
     ,"# command-name (for file-name)"
     ,"<i>build rules</i>"
     ,"<i>actions</i>"
@@ -326,7 +378,23 @@
     ,"#!/bin/sh"
     ,"shake-build-system"
     ,"\"_build\" </> x -<.> \"o\""
-    ,"cmd \"gcc -o\" [out] os"
     ,"[item1,item2,item2]"
     ,"$(LitE . StringL . loc_filename <$> location)"
+    ,"-d[ FILE], --debug[=FILE]"
+    ,"-r[ FILE], --report[=FILE], --profile[=FILE]"
+    ,"man 2 getrlimit"
+    ]
+
+blacklist :: [String]
+blacklist =
+    -- from https://twitter.com/jesstelford/status/992756386160234497
+    ["obviously"
+    ,"basically"
+    ,"simply"
+    ,"of course"
+    ,"clearly"
+    ,"everyone knows"
+    -- ,"however"
+    -- ,"so,"
+    -- ,"easy"
     ]
diff --git a/src/Test/Errors.hs b/src/Test/Errors.hs
--- a/src/Test/Errors.hs
+++ b/src/Test/Errors.hs
@@ -1,170 +1,296 @@
+{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-}
 
 module Test.Errors(main) where
 
 import Development.Shake
+import Development.Shake.Classes
 import Development.Shake.FilePath
 import Test.Type
-import Data.List
+import Data.List.Extra
 import Control.Monad
-import Control.Concurrent
-import Control.Exception.Extra hiding (assert)
+import Control.Concurrent.Extra
+import General.GetOpt
+import General.Extra
+import Data.IORef
+import Control.Exception.Extra
 import System.Directory as IO
+import System.Time.Extra
 import qualified System.IO.Extra as IO
 
 
-main = shakenCwd test $ \args obj -> do
-    want args
-    obj "norule" %> \_ ->
-        need [obj "norule_isavailable"]
+data Args = Die deriving (Eq,Enum,Bounded,Show)
 
-    obj "failcreate" %> \_ ->
-        return ()
+newtype BadBinary = BadBinary String deriving (NFData,Show,Eq,Hashable,Typeable)
+type instance RuleResult BadBinary = BadBinary
+instance Binary BadBinary where
+    put (BadBinary x) = put x
+    get = do x <- get; if x == "bad" then error "get: BadBinary \"bad\"" else pure $ BadBinary x
 
-    [obj "failcreates", obj "failcreates2"] &%> \_ ->
-        writeFile' (obj "failcreates") ""
+main = testBuildArgs test optionsEnum $ \args -> do
+    "norule" %> \_ ->
+        need ["norule_isavailable"]
 
-    obj "recursive_" %> \out -> need [obj "intermediate_"]
-    obj "intermediate_" %> \out -> need [obj "recursive_"]
+    "failcreate" %> \_ ->
+        pure ()
 
-    "rec1" %> \out -> need ["rec2"]
-    "rec2" %> \out -> need ["rec1"]
+    ["failcreates", "failcreates2"] &%> \_ ->
+        writeFile' "failcreates" ""
 
-    obj "systemcmd" %> \_ ->
+    "recursive_" %> \_ -> need ["intermediate_"]
+    "intermediate_" %> \_ -> need ["recursive_"]
+
+    "rec1" %> \_ -> need ["rec2"]
+    "rec2" %> \_ -> need ["rec1"]
+
+    "systemcmd" %> \_ ->
         cmd "random_missing_command"
 
-    obj "stack1" %> \_ -> need [obj "stack2"]
-    obj "stack2" %> \_ -> need [obj "stack3"]
-    obj "stack3" %> \_ -> error "crash"
+    "stack1" %> \_ -> need ["stack2"]
+    "stack2" %> \_ -> need ["stack3"]
+    "stack3" %> \_ -> error "crash"
 
-    obj "staunch1" %> \out -> do
+    "staunch1" %> \out -> do
         liftIO $ sleep 0.1
         writeFile' out "test"
-    obj "staunch2" %> \_ -> error "crash"
+    "staunch2" %> \_ -> error "crash"
 
-    let catcher out op = obj out %> \out -> do
+    let catcher out op = out %> \out -> do
             writeFile' out "0"
             op $ do src <- IO.readFile' out; writeFile out $ show (read src + 1 :: Int)
     catcher "finally1" $ actionFinally $ fail "die"
-    catcher "finally2" $ actionFinally $ return ()
+    catcher "finally2" $ actionFinally $ pure ()
     catcher "finally3" $ actionFinally $ liftIO $ sleep 10
     catcher "finally4" $ actionFinally $ need ["wait"]
     "wait" ~> do liftIO $ sleep 10
     catcher "exception1" $ actionOnException $ fail "die"
-    catcher "exception2" $ actionOnException $ return ()
+    catcher "exception2" $ actionOnException $ pure ()
 
+    "retry*" %> \out -> do
+        ref <- liftIO $ newIORef 3
+        actionRetry (read [last out]) $ liftIO $ do
+            old <- readIORef ref
+            writeIORef ref $ old - 1
+            if old == 0 then writeFile' out "" else fail "die"
+
     res <- newResource "resource_name" 1
-    obj "resource" %> \out ->
+    "resource" %> \_ ->
         withResource res 1 $
             need ["resource-dep"]
 
-    obj "overlap.txt" %> \out -> writeFile' out "overlap.txt"
-    obj "overlap.t*" %> \out -> writeFile' out "overlap.t*"
-    obj "overlap.*" %> \out -> writeFile' out "overlap.*"
+    "overlap.txt" %> \out -> writeFile' out "overlap.txt"
+    "overlap.t*" %> \out -> writeFile' out "overlap.t*"
+    "overlap.*" %> \out -> writeFile' out "overlap.*"
+    ["*.txx","*.tox"] &%> \_ -> fail "do not run"
+    ["*p.txx"] &%> \_ -> fail "do not run"
 
-    obj "chain.2" %> \out -> do
-        src <- readFile' $ obj "chain.1"
+    "chain.2" %> \out -> do
+        src <- readFile' "chain.1"
         if src == "err" then error "err_chain" else writeFileChanged out src
-    obj "chain.3" %> \out -> copyFile' (obj "chain.2") out
+    "chain.3" %> \out -> copyFile' "chain.2" out
 
-    obj "tempfile" %> \out -> do
+    "tempfile" %> \out -> do
         file <- withTempFile $ \file -> do
             liftIO $ assertExists file
-            return file
+            pure file
         liftIO $ assertMissing file
         withTempFile $ \file -> do
             liftIO $ assertExists file
             writeFile' out file
             fail "tempfile-died"
 
-    obj "tempdir" %> \out -> do
+    "tempdir" %> \out -> do
         file <- withTempDir $ \dir -> do
             let file = dir </> "foo.txt"
             liftIO $ writeFile (dir </> "foo.txt") ""
                 -- will throw if the directory does not exist
             writeFile' out ""
-            return file
+            pure file
         liftIO $ assertMissing file
 
     phony "fail1" $ fail "die1"
     phony "fail2" $ fail "die2"
 
-    when ("die" `elem` args) $ action $ error "death error"
+    when (Die `elem` args) $ action $ error "death error"
 
-    obj "fresh_dir" %> \out -> liftIO $ createDirectoryIfMissing True out
-    obj "need_dir" %> \out -> do
-        liftIO $ createDirectoryIfMissing True $ obj "existing_dir"
-        need [obj "existing_dir"]
+    "fresh_dir" %> \out -> liftIO $ createDirectoryRecursive out
+    "need_dir" %> \out -> do
+        liftIO $ createDirectoryRecursive "existing_dir"
+        need ["existing_dir"]
         writeFile' out ""
 
+    "persist_failure.1" %> \out -> do
+        liftIO $ appendFile "persist_failure.log" "[pre]"
+        need ["persist_failure.2"]
+        liftIO $ appendFile "persist_failure.log" "[post]"
+        writeFile' out ""
+    "persist_failure.2" %> \out -> do
+        src <- readFile' "persist_failure.3"
+        liftIO $ print ("persist_failure.3", src)
+        if src == "die" then do
+            liftIO $ appendFile "persist_failure.log" "[err]"
+            fail "die"
+        else
+            writeFileChanged out src
 
+    "fast_failure" %> \_ -> do
+        liftIO $ sleep 0.1
+        fail "die"
+    "slow_success" %> \out -> do
+        liftIO $ sleep 20
+        writeFile' out ""
+
+    addOracle $ \(BadBinary x) -> pure $ BadBinary $ 'b':x
+    "badinput" %> \out -> do
+        askOracle $ BadBinary "bad"
+        liftIO $ appendFile out "x"
+    "badoutput" %> \out -> do
+        askOracle $ BadBinary "ad"
+        liftIO $ appendFile out "x"
+    "badnone" %> \out -> do
+        alwaysRerun
+        liftIO $ appendFile out "x"
+
+    "produces1" %> \out -> do
+        produces [out <.> "also"]
+        writeFile' (out <.> "also") ""
+        writeFile' out ""
+    "produces2" %> \out -> do
+        produces [out <.> "also"]
+        writeFile' out ""
+
+    "finalfinal" %> \out -> do
+        writeFile' out ""
+        lock <- liftIO newLock
+        let output = withLock lock . appendFile out
+        liftIO (sleep 100)
+            `actionFinally` (output "X" >> sleep 0.1)
+            `actionFinally` output "Y"
+
+    let catching out = flip actionCatch $ \(e :: SomeException) -> writeFile' out $ show e
+    "catch1" %> \out -> catching out $ fail "magic1"
+    "catch2" %> \out -> catching out $ liftIO $ killThread =<< myThreadId
+    "catch3.1" %> \out -> fail "magic3"
+    "catch3.2" %> \out -> catching out $ need ["catch3.1"]
+
     -- not tested by default since only causes an error when idle GC is turned on
     phony "block" $
         liftIO $ putStrLn $ let x = x in x
 
-test build obj = do
-    let crash args parts = assertException parts (build $ "--quiet" : args)
+test build = do
+    -- on Windows, file paths may end up with \ separators, make sure we can still match them
+    let crash args parts = assertExceptionAfter (replace "\\" "/") parts (build $ "--quiet" : args)
     build ["clean"]
-    build ["--sleep"]
 
-    writeFile (obj "chain.1") "x"
+    writeFile "chain.1" "x"
     build ["chain.3","--sleep"]
-    writeFile (obj "chain.1") "err"
+    writeFile "chain.1" "err"
     crash ["chain.3"] ["err_chain"]
 
     crash ["norule"] ["norule_isavailable"]
     crash ["failcreate"] ["failcreate"]
     crash ["failcreates"] ["failcreates"]
     crash ["recursive_"] ["recursive_","intermediate_","recursive"]
-    crash ["rec1","rec2"] ["rec1","rec2","recursive"]
-    crash ["systemcmd"] ["systemcmd","random_missing_command"]
+    crash ["rec1","rec2"] ["rec1","rec2","indirect recursion","recursive"]
+    notMacCI $ crash ["systemcmd"] ["systemcmd","random_missing_command", "at cmd, called at"]
     crash ["stack1"] ["stack1","stack2","stack3","crash"]
 
-    b <- IO.doesFileExist $ obj "staunch1"
-    when b $ removeFile $ obj "staunch1"
+    b <- IO.doesFileExist "staunch1"
+    when b $ removeFile "staunch1"
     crash ["staunch1","staunch2","-j2"] ["crash"]
-    b <- IO.doesFileExist $ obj "staunch1"
-    assert (not b) "File should not exist, should have crashed first"
+    assertBoolIO (not <$> IO.doesFileExist "staunch1") "File should not exist, should have crashed first"
     crash ["staunch1","staunch2","-j2","--keep-going","--silent"] ["crash"]
-    b <- IO.doesFileExist $ obj "staunch1"
-    assert b "File should exist, staunch should have let it be created"
+    assertBoolIO (IO.doesFileExist "staunch1") "File should exist, staunch should have let it be created"
 
     crash ["finally1"] ["die"]
-    assertContents (obj "finally1") "1"
+    assertContents "finally1" "1"
     build ["finally2"]
-    assertContents (obj "finally2") "1"
+    assertContents "finally2" "1"
     crash ["exception1"] ["die"]
-    assertContents (obj "exception1") "1"
+    assertContents "exception1" "1"
     build ["exception2"]
-    assertContents (obj "exception2") "0"
+    assertContents "exception2" "0"
 
+    crash ["retry0"] ["positive","0"]
+    crash ["retry1"] ["die"]
+    build ["retry4"]
+
     forM_ ["finally3","finally4"] $ \name -> do
         t <- forkIO $ ignore $ build [name,"--exception"]
-        retry 10 $ sleep 0.1 >> assertContents (obj name) "0"
+        retry 10 $ sleep 0.1 >> assertContents name "0"
         throwTo t (IndexOutOfBounds "test")
-        retry 10 $ sleep 0.1 >> assertContents (obj name) "1"
+        retry 10 $ sleep 0.1 >> assertContents name "1"
 
-    crash ["resource"] ["cannot currently call apply","withResource","resource_name"]
+    crash ["resource"] ["cannot currently introduce a dependency","withResource","resource_name"]
 
     build ["overlap.foo"]
-    assertContents (obj "overlap.foo") "overlap.*"
+    assertContents "overlap.foo" "overlap.*"
     build ["overlap.txt"]
-    assertContents (obj "overlap.txt") "overlap.txt"
-    crash ["overlap.txx"] ["key matches multiple rules","overlap.txx"]
+    assertContents "overlap.txt" "overlap.txt"
+    crash ["overlap.txx"] $
+        ["key matches multiple rules","matched:  4","overlap.txx","overlap.t*","overlap.*","*.tox"] ++
+        ["Test/Errors.hs"]
 
     crash ["tempfile"] ["tempfile-died"]
-    src <- readFile $ obj "tempfile"
+    src <- readFile "tempfile"
     assertMissing src
     build ["tempdir"]
 
-    crash ["die"] ["Shake","action","death error"]
+    crash ["--die"] ["Shake","death error","Test/Errors.hs"]
 
     putStrLn "## BUILD errors"
     (out,_) <- IO.captureOutput $ build []
-    assert ("nothing to do" `isInfixOf` out) $ "Expected 'nothing to do', but got: " ++ out
+    assertBool ("nothing to do" `isInfixOf` out) $ "Expected 'nothing to do', but got: " ++ out
 
     putStrLn "## BUILD errors fail1 fail2 -k -j2"
     (out,_) <- IO.captureOutput $ try_ $ build ["fail1","fail2","-k","-j2",""]
-    assert ("die1" `isInfixOf` out && "die2" `isInfixOf` out) $ "Expected 'die1' and 'die2', but got: " ++ out
+    assertBool ("die1" `isInfixOf` out && "die2" `isInfixOf` out) $ "Expected 'die1' and 'die2', but got: " ++ out
 
     crash ["fresh_dir"] ["expected a file, got a directory","fresh_dir"]
     crash ["need_dir"] ["expected a file, got a directory","existing_dir"]
+
+    -- check errors don't persist to the database, #428
+    writeFile "persist_failure.log" ""
+    writeFile "persist_failure.3" "test"
+    build ["persist_failure.1","--sleep"]
+    writeFile "persist_failure.3" "die"
+    crash ["persist_failure.1","--sleep"] []
+    assertContents "persist_failure.log" "[pre][post][err][pre]"
+    writeFile "persist_failure.3" "test"
+    build ["persist_failure.1","--sleep"]
+    assertContents "persist_failure.log" "[pre][post][err][pre]"
+    writeFile "persist_failure.3" "more"
+    build ["persist_failure.1"]
+    assertContents "persist_failure.log" "[pre][post][err][pre][pre][post]"
+
+    -- check a fast failure aborts a slow success
+    (t, _) <- duration $ crash ["fast_failure","slow_success","-j2"] ["die"]
+    assertBool (t < 10) $ "Took too long, expected < 10, got " ++ show t
+
+    -- for exceptions on Key we die while reading the database, and restart from scratch
+    build ["badinput"]
+    build ["badinput","--silent"]
+    assertContents "badinput" "xx"
+    build ["badnone","--silent"] -- must be able to still run other rules
+    assertContents "badnone" "x"
+
+    -- for exceptions on Value we die while running the rule that requires it
+    build ["badoutput"]
+    crash ["badoutput"] ["badoutput","BadBinary"]
+    build ["badnone"] -- must be able to still run other rules
+    assertContents "badnone" "xx"
+
+    -- check that produces works
+    build ["produces1"]
+    crash ["produces2"] ["produces","produces2.also"]
+
+    -- check finally doesn't run twice, See https://github.com/ndmitchell/shake/issues/611
+    t <- forkIO $ build ["finalfinal","--quiet"]
+    sleep 0.2
+    killThread t
+    sleep 0.5
+    assertContents "finalfinal" "XY"
+
+    build ["catch1"]
+    assertContentsInfix "catch1" "magic1"
+    crash ["catch2"] [show ThreadKilled]
+    crash ["catch3.2"] ["magic3"]
diff --git a/src/Test/Existence.hs b/src/Test/Existence.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Existence.hs
@@ -0,0 +1,28 @@
+module Test.Existence(main) where
+
+import Development.Shake
+import Development.Shake.Internal.FileInfo
+import Development.Shake.Internal.FileName
+import System.Directory
+import System.FilePath
+import General.Extra
+
+main :: IO () -> IO ()
+main _ = do
+    cwd <- getCurrentDirectory
+    someFiles <- getDirectoryFilesIO cwd ["*"]
+    let someFile = headErr someFiles
+    assertIsJust $ getFileInfo False $ fileNameFromString someFile
+
+    let fileThatCantExist = someFile </> "fileThatCantExist"
+    assertIsNothing $ getFileInfo False $ fileNameFromString fileThatCantExist
+
+assertIsJust :: IO (Maybe a) -> IO ()
+assertIsJust action = do
+    Just _ <- action
+    pure ()
+
+assertIsNothing :: IO (Maybe a) -> IO ()
+assertIsNothing action = do
+    Nothing <- action
+    pure ()
diff --git a/src/Test/FileLock.hs b/src/Test/FileLock.hs
--- a/src/Test/FileLock.hs
+++ b/src/Test/FileLock.hs
@@ -7,17 +7,20 @@
 import Control.Monad
 import Data.Either.Extra
 import System.Time.Extra
+import System.Info.Extra
 import Test.Type
 
 
-main = shaken test $ \args obj ->
+main = testBuild test $
     action $ do
-        putNormal "Starting sleep"
+        putInfo "Starting sleep"
         liftIO $ sleep 5
-        putNormal "Finished sleep"
+        putInfo "Finished sleep"
 
 
-test build obj = do
+-- Disabled under Mac because it fails, see #560
+-- Reported as working locally under APFS, so may just be the older HFS+ as used by Travis CI
+test build = unless isMac $ do
     -- check it fails exactly once
     time <- offsetTime
     lock <- newLock
@@ -31,6 +34,6 @@
     b <- try_ b
     out "after try b"
     when (length (filter isLeft [a,b]) /= 1) $
-        error $ "Expected one success and one failure, got " ++ show [a,b]
+        fail $ "Expected one success and one failure, got " ++ show [a,b]
     -- check it succeeds after the lock has been held
     build []
diff --git a/src/Test/FilePath.hs b/src/Test/FilePath.hs
--- a/src/Test/FilePath.hs
+++ b/src/Test/FilePath.hs
@@ -7,29 +7,31 @@
 import Test.Type
 import Test.QuickCheck
 import Control.Monad
-import Data.List
+import Data.List.Extra
 import qualified Data.ByteString.Char8 as BS
-import qualified Development.Shake.ByteString as BS
+import qualified Development.Shake.Internal.FileName as BS
 import System.Info.Extra
-
-
-main = shakenCwd test $ \args obj -> return ()
+import System.Directory
+import qualified System.IO.Extra as IO
+import General.Extra
 
 
 newtype File = File String deriving Show
 
 instance Arbitrary File where
-    arbitrary = fmap File $ listOf $ oneof $ map return "a /\\:."
+    arbitrary = fmap File $ listOf $ oneof $ map pure "a /\\:."
     shrink (File x) = map File $ shrink x
 
 
-test build obj = do
-    let a === b = a Test.Type.=== b -- duplicate definition in QuickCheck 2.7 and above
+main = testSimple $ do
+    let infix 1 ===
+        a === b = a Test.Type.=== b -- duplicate definition in QuickCheck 2.7 and above
 
     let norm x =
             let s = toStandard $ normaliseEx x
                 b = BS.unpack (BS.filepathNormalise $ BS.pack x)
             in if s == b then s else error $ show ("Normalise functions differ",x,s,b)
+
     -- basic examples
     norm "" === "."
     norm "." === "."
@@ -65,9 +67,9 @@
     Success{} <- quickCheckWithResult stdArgs{maxSuccess=1000} $ \(File x) ->
         let y = norm x
             sep = Native.isPathSeparator
-            noDrive = if isWindows then drop 1 else id
-            ps = [length y >= 1
-                 ,null x || (sep (head x) == sep (head y) && sep (last x) == sep (last y))
+            noDrive = if isWindows then drop1 else id
+            ps = [y /= ""
+                 ,null x || (sep (headErr x) == sep (headErr y) && sep (last x) == sep (last y))
                  ,not $ "/./" `isInfixOf` y
                  ,not isWindows || '\\' `notElem` y
                  ,not $ "//" `isInfixOf` noDrive y
@@ -84,6 +86,9 @@
     takeDirectory1 "aaa/" === "aaa"
     takeDirectory1 "aaa" === "aaa"
 
+    replaceDirectory1 "root/file.ext" "directory" === "directory" ++ [pathSeparator] ++ "file.ext"
+    replaceDirectory1 "root/foo/bar/file.ext" "directory" === "directory" ++ [pathSeparator] ++ "foo/bar/file.ext"
+
     searchPathSeparator === Native.searchPathSeparator
     pathSeparators === Native.pathSeparators
 
@@ -96,3 +101,29 @@
     ("//*" <.> "foo") === "//*.foo"
     toStandard ("a" </> "b" </> "c" <//> "*" <.> "exe") === "a/b/c//*.exe"
     ("a" <//> "/b/c") === "a//b/c"
+
+    -- check makeRelativeEx
+    IO.withTempDir $ \ cwd -> do
+        setCurrentDirectory cwd
+        createDirectory (cwd </> "a")
+        createDirectory (cwd </> "b")
+        writeFile (toNative (cwd </> "b/file.out")) "foo"
+        createDirectory (cwd </> "e")
+        createDirectory (cwd </> "e/f")
+        createDirectory (cwd </> "e/f/g")
+        -- on Windows creating symlinks requires additional privileges
+        -- so skip the test there
+
+        -- portable symlinks only available on GHC 8.4
+        -- unless isWindows $
+        --    createFileLink  (cwd </> "e/f/g/") (cwd </> "c")
+
+        let f a b c = makeRelativeEx a (normalise b) >>= (=== fmap normalise c)
+        f "/x/y/" "/x/y/z" $ Just "z"
+        f (cwd </> "c") "../b/file.out" $ Just "../b/file.out"
+        f "a" "b/file.out" $ Just "b/file.out"
+        f (cwd </> "a") (cwd </> "b/file.out") $ Just "../b/file.out"
+        -- unless isWindows $ do
+        --    f (cwd </> "c") (cwd </> "b/file.out") $ Just "../../../b/file.out"
+        --    f "c" (cwd </> "b/file.out") $ Just "../../../b/file.out"
+        --    f (cwd </> "c/../../../a") (cwd </> "b/file.out") $ Just "../b/file.out"
diff --git a/src/Test/FilePattern.hs b/src/Test/FilePattern.hs
--- a/src/Test/FilePattern.hs
+++ b/src/Test/FilePattern.hs
@@ -1,7 +1,7 @@
 
 module Test.FilePattern(main) where
 
-import Development.Shake.FilePattern
+import Development.Shake.Internal.FilePattern
 import Development.Shake.FilePath
 import Control.Monad
 import System.IO.Unsafe
@@ -10,7 +10,6 @@
 import Test.Type
 import Test.QuickCheck hiding ((===))
 
-main = shakenCwd test $ \args obj -> return ()
 
 
 newtype Pattern = Pattern FilePattern deriving (Show,Eq)
@@ -27,12 +26,13 @@
     shrink (Path x) = map Path $ shrinkList (\x -> ['/' | x == '\\']) x
 
 
-test build obj = do
+main = testSimple $ do
     internalTest
+    let norm = filter (/= ".") . split isPathSeparator
     let f b pat file = do
-            assert (b == (pat ?== file)) $ show pat ++ " ?== " ++ show file ++ "\nEXPECTED: " ++ show b
-            assert (b == (pat `walker` file)) $ show pat ++ " `walker` " ++ show file ++ "\nEXPECTED: " ++ show b
-            when b $ assert (toStandard (substitute (extract pat file) pat) == toStandard file) $
+            assertBool (b == (pat ?== file)) $ show pat ++ " ?== " ++ show file ++ "\nEXPECTED: " ++ show b
+            assertBool (b == (pat `walker` file)) $ show pat ++ " `walker` " ++ show file ++ "\nEXPECTED: " ++ show b
+            when b $ assertBool (norm (substitute (extract pat file) pat) == norm file) $
                 "FAILED substitute/extract property\nPattern: " ++ show pat ++ "\nFile: " ++ show file ++ "\n" ++
                 "Extracted: " ++ show (extract pat file) ++ "\nSubstitute: " ++ show (substitute (extract pat file) pat)
 
@@ -130,6 +130,19 @@
     f (not isWindows) "**" "C:\\drive"
     f (not isWindows) "**" "C:drive"
 
+    -- We support ignoring '.' values in FilePath as they are inserted by @filepath@ a lot
+    f True "./file" "file"
+    f True ("" </> "file") "file"
+    f True "foo/./bar" "foo/bar"
+    f True "foo/./bar" "foo/./bar"
+    f False "foo/./bar" "foo/bob"
+
+    filePattern "**/*.c" "test.txt" === Nothing
+    filePattern "**/*.c" "foo.c" === Just ["","foo"]
+    filePattern "**/*.c" "bar/baz/foo.c" === Just ["bar/baz/","foo"]
+    filePattern "**/*.c" "bar\\baz\\foo.c" === Just
+        (if isWindows then ["bar/baz/","foo"] else ["","bar\\baz\\foo"])
+
     simple "a*b" === False
     simple "a//b" === False
     simple "a/**/b" === False
@@ -137,12 +150,12 @@
     simple "a///b" === False
     simple "a/**/b" === False
 
-    assert (compatible []) "compatible"
-    assert (compatible ["//*a.txt","foo//a*.txt"]) "compatible"
-    assert (compatible ["**/*a.txt","foo/**/a*.txt"]) "compatible"
-    assert (compatible ["//*a.txt","foo/**/a*.txt"]) "compatible"
-    assert (not $ compatible ["//*a.txt","foo//a*.*txt"]) "compatible"
-    assert (not $ compatible ["**/*a.txt","foo/**/a*.*txt"]) "compatible"
+    assertBool (compatible []) "compatible"
+    assertBool (compatible ["//*a.txt","foo//a*.txt"]) "compatible"
+    assertBool (compatible ["**/*a.txt","foo/**/a*.txt"]) "compatible"
+    assertBool (compatible ["//*a.txt","foo/**/a*.txt"]) "compatible"
+    assertBool (not $ compatible ["//*a.txt","foo//a*.*txt"]) "compatible"
+    assertBool (not $ compatible ["**/*a.txt","foo/**/a*.*txt"]) "compatible"
     extract "//*a.txt" "foo/bar/testa.txt" === ["foo/bar/","test"]
     extract "**/*a.txt" "foo/bar/testa.txt" === ["foo/bar/","test"]
     extract "//*a.txt" "testa.txt" === ["","test"]
@@ -167,27 +180,27 @@
     substitute  ["foo/bar/","test"] "//*a.txt" === "foo/bar/testa.txt"
     substitute  ["foo/bar/","test"] "**/*a.txt" === "foo/bar/testa.txt"
 
-    (False, Walk _) <- return $ walk ["*.xml"]
-    (False, Walk _) <- return $ walk ["//*.xml"]
-    (False, Walk _) <- return $ walk ["**/*.xml"]
-    (False, WalkTo ([], [("foo",Walk _)])) <- return $ walk ["foo//*.xml"]
-    (False, WalkTo ([], [("foo",Walk _)])) <- return $ walk ["foo/**/*.xml"]
-    (False, WalkTo ([], [("foo",WalkTo ([],[("bar",Walk _)]))])) <- return $ walk ["foo/bar/*.xml"]
-    (False, WalkTo (["a"],[("b",WalkTo (["c"],[]))])) <- return $ walk ["a","b/c"]
-    ([], [("foo",WalkTo ([],[("bar",Walk _)]))]) <- let (False, Walk f) = walk ["*/bar/*.xml"] in return $ f ["foo"]
-    (False, WalkTo ([],[("bar",Walk _),("baz",Walk _)])) <- return $ walk ["bar/*.xml","baz//*.c"]
-    (False, WalkTo ([],[("bar",Walk _),("baz",Walk _)])) <- return $ walk ["bar/*.xml","baz/**/*.c"]
-    (False, WalkTo ([], [])) <- return $ walk []
-    (True, Walk _) <- return $ walk ["//"]
-    (True, Walk _) <- return $ walk ["**"]
-    (True, WalkTo _) <- return $ walk [""]
+    (False, Walk _) <- pure $ walk ["*.xml"]
+    (False, Walk _) <- pure $ walk ["//*.xml"]
+    (False, Walk _) <- pure $ walk ["**/*.xml"]
+    (False, WalkTo ([], [("foo",Walk _)])) <- pure $ walk ["foo//*.xml"]
+    (False, WalkTo ([], [("foo",Walk _)])) <- pure $ walk ["foo/**/*.xml"]
+    (False, WalkTo ([], [("foo",WalkTo ([],[("bar",Walk _)]))])) <- pure $ walk ["foo/bar/*.xml"]
+    (False, WalkTo (["a"],[("b",WalkTo (["c"],[]))])) <- pure $ walk ["a","b/c"]
+    ([], [("foo",WalkTo ([],[("bar",Walk _)]))]) <- let (False, Walk f) = walk ["*/bar/*.xml"] in pure $ f ["foo"]
+    (False, WalkTo ([],[("bar",Walk _),("baz",Walk _)])) <- pure $ walk ["bar/*.xml","baz//*.c"]
+    (False, WalkTo ([],[("bar",Walk _),("baz",Walk _)])) <- pure $ walk ["bar/*.xml","baz/**/*.c"]
+    (False, WalkTo ([], [])) <- pure $ walk []
+    (True, Walk _) <- pure $ walk ["//"]
+    (True, Walk _) <- pure $ walk ["**"]
+    (True, WalkTo _) <- pure $ walk [""]
 
     Success{} <- quickCheckWithResult stdArgs{maxSuccess=1000} $ \(Pattern p) (Path x) ->
         let label _ = property in
             -- Ignore label to workaround QuickCheck space-leak
             -- See #450 and https://github.com/nick8325/quickcheck/pull/93
-        let b = p ?== x in (if b then property else label "No match") $ unsafePerformIO $ do f b p x; return True
-    return ()
+        let b = p ?== x in (if b then property else label "No match") $ unsafePerformIO $ do f b p x; pure True
+    pure ()
 
 
 walker :: FilePattern -> FilePath -> Bool
@@ -195,7 +208,8 @@
 walker a b | isRelativePattern a, not $ isRelativePath b = False
 walker a b = f (split isPathSeparator b) $ snd $ walk [a]
     where
+        f (".":xs) w = f xs w
         f (x:xs) (Walk op) = f (x:xs) $ WalkTo $ op [x]
-        f [x]    (WalkTo (file, dir)) = x `elem` file
-        f (x:xs) (WalkTo (file, dir)) | Just w <- lookup x dir = f xs w
+        f [x]    (WalkTo (file, _  )) = x `elem` file
+        f (x:xs) (WalkTo (_   , dir)) | Just w <- lookup x dir = f xs w
         f _ _ = False
diff --git a/src/Test/Files.hs b/src/Test/Files.hs
--- a/src/Test/Files.hs
+++ b/src/Test/Files.hs
@@ -3,44 +3,62 @@
 
 import Development.Shake
 import Development.Shake.FilePath
+import System.Directory
 import Test.Type
 import Control.Monad
 import Data.List
 
 
-main = shakenCwd test $ \args obj -> do
-    let fun = "@" `elem` args
-    let rest = delete "@" args
-    want $ map obj $ if null rest then ["even.txt","odd.txt"] else rest
+main = testBuild test $ do
+    want ["even.txt","odd.txt"]
 
-    -- Since &?> and &%> are implemented separately we test everything in both modes
-    let deps &?%> act | fun = (\x -> if x `elem` deps then Just deps else Nothing) &?> act
-                      | otherwise = deps &%> act
+    "A1-plus-B" %> \out -> do
+        a1 <- readFileLines "A1"
+        b  <- readFileLines "B"
+        writeFileLines out $ a1 ++ b
 
-    map obj ["even.txt","odd.txt"] &?%> \[evens,odds] -> do
-        src <- readFileLines $ obj "numbers.txt"
+    ["A1", "A2"] &%> \[o1, o2] -> do
+        writeFileLines o1 ["This is", "A1"]
+        writeFileLines o2 ["This is", "A2"]
+
+    "B" %> \out ->
+        writeFileLines out ["This is", "B"]
+
+    ["even.txt","odd.txt"] &?%> \[evens,odds] -> do
+        src <- readFileLines "numbers.txt"
         let (es,os) = partition even $ map read src
         writeFileLines evens $ map show es
         writeFileLines odds  $ map show os
 
-    map obj ["dir1/out.txt","dir2/out.txt"] &?%> \[a,b] -> do
+    ["dir1/out.txt","dir2/out.txt"] &?%> \[a,b] -> do
         writeFile' a "a"
         writeFile' b "b"
 
+    ["or1.txt","or2.txt","or*.txt"] |%> \x ->
+        writeFile' x x
+
     (\x -> let dir = takeDirectory x in
            if takeFileName dir /= "pred" then Nothing else Just [dir </> "a.txt",dir </> "b.txt"]) &?> \outs ->
         mapM_ (`writeFile'` "") outs
 
 
-test build obj = do
-    forM_ [[],["@"]] $ \args -> do
+test build = do
+    forM_ [[],["--usepredicate"]] $ \args -> do
         let nums = unlines . map show
-        writeFile (obj "numbers.txt") $ nums [1,2,4,5,2,3,1]
+        writeFile "numbers.txt" $ nums [1,2,4,5,2,3,1]
         build ("--sleep":args)
-        assertContents (obj "even.txt") $ nums [2,4,2]
-        assertContents (obj "odd.txt" ) $ nums [1,5,3,1]
+        assertContents "even.txt" $ nums [2,4,2]
+        assertContents "odd.txt"  $ nums [1,5,3,1]
         build ["clean"]
         build ["--no-build","--report=-"]
         build ["dir1/out.txt"]
 
     build ["pred/a.txt"]
+
+    -- Test #496
+    build ["A1-plus-B"]
+    removeFile "A2"
+    build ["A1-plus-B"]
+
+    build ["or2.txt","or4.txt"]
+    assertContents "or4.txt" "or4.txt"
diff --git a/src/Test/Forward.hs b/src/Test/Forward.hs
--- a/src/Test/Forward.hs
+++ b/src/Test/Forward.hs
@@ -1,22 +1,65 @@
 
 module Test.Forward(main) where
 
+import Data.Char
+import Data.List.Extra
 import Development.Shake
+import System.Info.Extra
 import Development.Shake.Forward
 import Development.Shake.FilePath
-import Control.Monad.Extra
 import Test.Type
+import System.IO.Extra as IO
 
-main = shaken test $ \args obj -> forwardRule $ do
-    let src = "src/Test/C"
-    cs <- getDirectoryFiles src ["*.c"]
+
+main = testBuild test $ forwardRule $ do
+    cs <- getDirectoryFiles "" ["*.c"]
     os <- forP cs $ \c -> do
-        let o = obj c <.> "o"
-        cache $ cmd "gcc -c" [src </> c] "-o" [o]
-        return o
-    cache $ cmd "gcc -o" [obj "Main" <.> exe] os
+        let o = c <.> "o"
+        cache $ cmd "gcc -c" [c] "-o" [o]
+        pure o
+    cache $ cmd "gcc -o" ["Main" <.> exe] os
+    cache $ cmd ["." </> "Main" <.> exe] (FileStdout "output.txt")
 
-test build obj = do
-    whenM hasTracker $ do
-        build ["--forward","--clean"]
-        build ["--forward","-j2"]
+    -- Doing this way to test cacheAction with arguments
+    -- any real code should use a tracked readFile and avoid passing arguments to the closure
+    src <- liftIO $ IO.readFile' "output.txt"
+    cacheActionWith "reducer" src $ writeFile' "out.txt" $ filter isUpper src
+
+
+checkVaild act = do
+    b <- hasTracker
+    if not b then
+        putStrLn "Warning: Not running forward test (no tracker)"
+     else if isMac then
+        putStrLn "Warning: Not running forward test (doesn't work on Mac)"
+     else
+        act
+
+test build = checkVaild $ do
+    -- first clean then copy the source files over
+    build ["clean"]
+    copyDirectoryChanged (shakeRoot </> "src/Test/C") "."
+
+    -- build and rebuild
+    build ["--forward"]
+    assertContents "output.txt" "Hello Shake Users!\n"
+    assertContents "out.txt" "HSU"
+
+    -- check that cacheAction doesn't rerun when it shouldn't
+    writeFile "out.txt" "HHH"
+    build ["-j2","--forward"]
+    assertContents "output.txt" "Hello Shake Users!\n"
+    assertContents "out.txt" "HHH"
+
+    -- modify the constants
+    orig <- IO.readFile' "constants.c"
+    writeFile "constants.c" $ replace "Shake" "Rattle" orig
+    build ["-j2","--forward"]
+    assertContents "output.txt" "Hello Rattle Users!\n"
+    assertContents "out.txt" "HRU"
+
+    -- put it back
+    writeFile "constants.c" orig
+    build ["-j2","--forward"]
+    assertContents "output.txt" "Hello Shake Users!\n"
+    assertContents "out.txt" "HSU"
diff --git a/src/Test/History.hs b/src/Test/History.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/History.hs
@@ -0,0 +1,72 @@
+{-# LANGUAGE TypeFamilies #-}
+{-# OPTIONS_GHC -Wno-orphans #-}
+
+module Test.History(main) where
+
+import Control.Monad.Extra
+import Development.Shake
+import Test.Type
+import General.Extra
+import General.GetOpt
+import System.Directory
+import Development.Shake.Internal.History.Symlink
+
+
+data Args = Die deriving (Eq,Enum,Bounded,Show)
+
+type instance RuleResult FilePath = String
+
+main = testBuildArgs test optionsEnum $ \args -> do
+    let die :: a -> a
+        die x = if Die `elem` args then error "Die" else x
+
+    phony "Phony" $ pure ()
+    "Phony.txt" %> \out -> do
+        need ["Phony"]
+        copyFile' "In.txt" out
+
+    "OutFile.txt" %> \out -> die $ copyFile' "In.txt" out
+
+    "OutFile.link.txt" %> \out -> die $ do
+        need ["In.txt"]
+        whenJustM (liftIO $ createLinkMaybe "In.txt" out) $ \_ ->
+            -- just is equivalent to an error happening, so just copy the file
+            writeFile' out =<< readFile' "In.txt"
+
+    reader <- addOracleCache $ \x -> die (readFile' x)
+    "OutOracle.txt" %> \out -> do
+        historyDisable
+        writeFile' out =<< reader "In.txt"
+
+    ["OutFiles1.txt","OutFiles2.txt"] &%> \[out1, out2] -> die $ do
+        copyFile' "In.txt" out1
+        copyFile' "In.txt" out2
+
+test build =
+    forM_ [[],["--share-copy"]] $ \args -> do
+        let setIn = writeFile "In.txt"
+        let outs = ["OutFile.txt","OutOracle.txt","OutFiles1.txt","OutFiles2.txt","Phony.txt"] -- ,"OutFile.link.txt"]
+        let checkOut x = mapM_ (`assertContents` x) outs
+
+        build ["clean"]
+        setIn "1"
+        build $ args ++ ["--share","--sleep"] ++ outs
+        checkOut "1"
+        setIn "2"
+        build $ args ++ ["--share","--sleep"] ++ outs
+        checkOut "2"
+
+        setIn "1"
+        assertException [] $ build ["OutFile.txt","--die","--quiet","--sleep"]
+        build $ args ++ ["--die","--share"] ++ outs
+        checkOut "1"
+
+        setIn "2"
+        mapM_ removeFile_ outs
+        build $ args ++ ["--die","--share"] ++ outs
+        checkOut "2"
+
+        setIn "2"
+        removeFile ".shake.database"
+        build $ args ++ ["--die","--share"] ++ outs
+        checkOut "2"
diff --git a/src/Test/Journal.hs b/src/Test/Journal.hs
--- a/src/Test/Journal.hs
+++ b/src/Test/Journal.hs
@@ -14,16 +14,15 @@
 rebuilt = unsafePerformIO $ newIORef 0
 
 
-main = shakenCwd test $ \args obj -> do
-    want $ map obj ["a.out","b.out","c.out"]
-    obj "*.out" %> \out -> do
+main = testBuild test $ do
+    want ["a.out","b.out","c.out"]
+    "*.out" %> \out -> do
         liftIO $ atomicModifyIORef rebuilt $ \a -> (a+1,())
         copyFile' (out -<.> "in") out
 
 
-test build obj = do
-    
-    let change x = writeFile (obj $ x <.> "in") x
+test build = do
+    let change x = writeFile (x <.> "in") x
     let count x = do
             before <- readIORef rebuilt
             build ["--sleep"]
diff --git a/src/Test/Lint.hs b/src/Test/Lint.hs
--- a/src/Test/Lint.hs
+++ b/src/Test/Lint.hs
@@ -1,110 +1,131 @@
+{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
 
 module Test.Lint(main) where
 
 import Development.Shake
+import Development.Shake.Classes
 import Development.Shake.FilePath
+import General.Extra
 import Test.Type
-import Control.Exception hiding (assert)
+import Control.Exception
 import System.Directory as IO
 import System.Info.Extra
 import Control.Monad.Extra
 
+newtype Zero = Zero () deriving (Eq, Show, NFData, Typeable, Hashable, Binary)
 
-main = shaken test $ \args obj -> do
-    want $ map obj args
+type instance RuleResult Zero = Zero
 
-    addOracle $ \() -> do
-        liftIO $ createDirectoryIfMissing True $ obj "dir"
-        liftIO $ setCurrentDirectory $ obj "dir"
-        return ()
+main = testBuild test $ do
+    addOracle $ \Zero{} -> do
+        liftIO $ createDirectoryRecursive "dir"
+        liftIO $ setCurrentDirectory "dir"
+        pure $ Zero ()
 
-    obj "changedir" %> \out -> do
-        () <- askOracle ()
+    "changedir" %> \out -> do
+        Zero () <- askOracle $ Zero ()
         writeFile' out ""
 
-    obj "pause.*" %> \out -> do
-        liftIO $ sleep 0.1
-        need [obj "cdir" <.> takeExtension out]
+    "pause.*" %> \out -> do
+        liftIO $ sleep 0.2
+        need ["cdir" <.> takeExtension out]
         writeFile' out ""
 
-    obj "cdir.*" %> \out -> do
+    "cdir.*" %> \out -> do
         pwd <- liftIO getCurrentDirectory
-        let dir2 = obj $ "dir" ++ takeExtension out
-        liftIO $ createDirectoryIfMissing True dir2
+        let dir2 = "dir" ++ takeExtension out
+        liftIO $ createDirectoryRecursive dir2
         liftIO $ setCurrentDirectory dir2
-        liftIO $ sleep 0.2
+        liftIO $ sleep 0.4
         liftIO $ setCurrentDirectory pwd
         writeFile' out ""
 
-    obj "createonce" %> \out ->
+    "createonce" %> \out ->
         writeFile' out "X"
 
-    obj "createtwice" %> \out -> do
-        need [obj "createonce"]
+    "createtwice" %> \out -> do
+        need ["createonce"]
         liftIO sleepFileTime
-        writeFile' (obj "createonce") "Y"
+        writeFile' "createonce" "Y"
         writeFile' out ""
 
-    obj "listing" %> \out -> do
+    "recordtwice" %> \out -> do
+        alwaysRerun
+        trackWrite ["recordtwice_"]
+        trackWrite ["recordtwice_"]
+        writeFile' "recordtwice_" ""
+        writeFile' out ""
+
+    "listing" %> \out -> do
         writeFile' (out <.> "ls1") ""
-        getDirectoryFiles (obj "") ["//*.ls*"]
+        getDirectoryFiles "" ["//*.ls*"]
         writeFile' (out <.> "ls2") ""
         writeFile' out ""
 
-    obj "existance" %> \out -> do
-        Development.Shake.doesFileExist $ obj "exists"
-        writeFile' (obj "exists") ""
+    "existance" %> \out -> do
+        Development.Shake.doesFileExist "exists"
+        writeFile' "exists" ""
         writeFile' out ""
 
-    obj "gen*" %> \out ->
+    "gen*" %> \out ->
         writeFile' out out
 
-    obj "needed1" %> \out -> do
-        needed [obj "gen1"]
+    "needed1" %> \out -> do
+        needed ["gen1"]
         writeFile' out ""
 
-    obj "needed2" %> \out -> do
-        orderOnly [obj "gen2"]
-        needed [obj "gen2"]
+    "needed2" %> \out -> do
+        orderOnly ["gen2"]
+        needed ["gen2"]
         writeFile' out ""
 
-    obj "tracker-write1" %> \out -> do
+    "tracker-write1" %> \out -> do
         gen "x" $ out <.> "txt"
         need [out <.> "txt"]
         writeFile' out ""
 
-    obj "tracker-write2" %> \out -> do
+    "tracker-write2" %> \out -> do
         gen "x" $ out <.> "txt"
         writeFile' out ""
 
-    obj "tracker-source2" %> \out -> copyFile' (obj "tracker-source1") out
-    obj "tracker-read1" %> \out -> do
-        access $ obj "tracker-source1"
+    "tracker-source2" %> \out -> copyFile' "tracker-source1" out
+    "tracker-read1" %> \out -> do
+        access "tracker-source1"
         writeFile' out ""
-    obj "tracker-read2" %> \out -> do
-        access $ obj "tracker-source1"
-        need [obj "tracker-source1"]
+    "tracker-read2" %> \out -> do
+        access "tracker-source1"
+        need ["tracker-source1"]
         writeFile' out ""
-    obj "tracker-read3" %> \out -> do
-        access $ obj "tracker-source2"
-        need [obj "tracker-source2"]
+    "tracker-read3" %> \out -> do
+        access "tracker-source2"
+        need ["tracker-source2"]
         writeFile' out ""
 
-    obj "tracker-compile.o" %> \out -> do
-        need [obj "tracker-source.c", obj "tracker-source.h"]
-        cmd "gcc" ["-c", obj "tracker-source.c", "-o", out]
+    "tracker-compile.o" %> \out -> do
+        need ["tracker-source.c", "tracker-source.h"]
+        cmd "gcc" ["-c", "tracker-source.c", "-o", out]
 
-    obj "tracker-compile-auto.o" %> \out -> do
-        need [obj "tracker-source.c"]
-        cmd AutoDeps "gcc" ["-c", obj "tracker-source.c", "-o", out]
+    "tracker-compile-auto.o" %> \out -> do
+        need ["tracker-source.c"]
+        cmd AutoDeps "gcc" ["-c", "tracker-source.c", "-o", out]
 
-    where gen t f = unit $ cmd Shell "echo" t ">" (toNative f)
-          access f = unit $ if isWindows
-                            then cmd Shell "type" (toNative f) "> nul"
-                            else cmd Shell "cat" f "> /dev/null"
+    "../lint2/tracker-relative" %> \out ->
+        writeFile' out "tracker-relative"
+    "tracker-relative1" %> \out -> do
+        need ["../lint2/tracker-relative"]
+        access "../lint2/tracker-relative"
+        writeFile' out "tracker-relative"
+    "tracker-relative2" %> \out -> do
+        access "../lint2/tracker-relative"
+        writeFile' out "tracker-relative"
 
+    where gen t f = cmd Shell "echo" t ">" (toNative f) :: Action ()
+          access f = if isWindows
+                     then cmd_ Shell "type" (toNative f) "> nul"
+                     else cmd_ Shell "cat" f "> /dev/null"
 
-test build obj = do
+
+test build = do
     dir <- getCurrentDirectory
     let crash args parts =
             assertException parts (build $ "--quiet" : args)
@@ -113,22 +134,25 @@
     crash ["changedir"] ["current directory has changed"]
     build ["cdir.1","cdir.2","-j1"]
     build ["--clean","cdir.1","pause.2","-j1"]
-    crash ["--clean","cdir.1","pause.2","-j2"] ["before building output/lint/","current directory has changed"]
+    crash ["--clean","cdir.1","pause.2","-j2"] ["output","lint","current directory has changed"]
     crash ["existance"] ["changed since being depended upon"]
     crash ["createtwice"] ["changed since being depended upon"]
-    crash ["listing"] ["changed since being depended upon","output/lint"]
+    build ["recordtwice"]
+    crash ["listing"] ["changed since being depended upon","listing.ls2"]
     crash ["--clean","listing","existance"] ["changed since being depended upon"]
     crash ["needed1"] ["'needed' file required rebuilding"]
     build ["needed2"]
     whenM hasTracker $ do
-        writeFile (obj "tracker-source1") ""
-        writeFile (obj "tracker-source2") ""
-        writeFile (obj "tracker-source.c") "#include <stdio.h>\n#include \"tracker-source.h\"\n"
-        writeFile (obj "tracker-source.h") ""
-        crash ["tracker-write1"] ["not have its creation tracked","lint/tracker-write1","lint/tracker-write1.txt"]
+        writeFile "tracker-source1" ""
+        writeFile "tracker-source2" ""
+        writeFile "tracker-source.c" "#include <stdio.h>\n#include \"tracker-source.h\"\n"
+        writeFile "tracker-source.h" ""
+        crash ["tracker-write1"] ["not have its creation tracked","tracker-write1","tracker-write1.txt"]
         build ["tracker-write2"]
-        crash ["tracker-read1"] ["used but not depended upon","lint/tracker-source1"]
+        crash ["tracker-read1"] ["used but not depended upon","tracker-source1"]
         build ["tracker-read2"]
-        crash ["tracker-read3"] ["depended upon after being used","lint/tracker-source2"]
+        crash ["tracker-read3"] ["depended upon after being used","tracker-source2"]
         build ["tracker-compile.o"]
         build ["tracker-compile-auto.o"]
+        build ["tracker-relative1"]
+        crash ["tracker-relative2"] ["lint2/tracker-relative"]
diff --git a/src/Test/Live.hs b/src/Test/Live.hs
--- a/src/Test/Live.hs
+++ b/src/Test/Live.hs
@@ -5,24 +5,22 @@
 import Test.Type
 
 
-main = shakenCwd test $ \args obj -> do
-    want $ map obj args
-
-    obj "foo" %> \ out -> do
-        need [obj "bar"]
+main = testBuild test $ do
+    "foo" %> \ out -> do
+        need ["bar"]
         writeFile' out ""
 
-    obj "bar" %> \out -> writeFile' out ""
-    obj "baz" %> \out -> writeFile' out ""
+    "bar" %> \out -> writeFile' out ""
+    "baz" %> \out -> writeFile' out ""
 
 
-test build obj = do
+test build = do
     build ["clean"]
-    build ["foo","baz","--live=" ++ obj "live.txt"]
-    assertContentsUnordered (obj "live.txt") $ map obj $ words "foo bar baz"
-    build ["foo","baz","--live=" ++ obj "live.txt"]
-    assertContentsUnordered (obj "live.txt") $ map obj $ words "foo bar baz"
-    build ["foo","--live=" ++ obj "live.txt"]
-    assertContentsUnordered (obj "live.txt") $ map obj $ words "foo bar"
-    build ["bar","--live=" ++ obj "live.txt"]
-    assertContentsUnordered (obj "live.txt") $ map obj $ words "bar"
+    build ["foo","baz","--live=live.txt"]
+    assertContentsUnordered "live.txt" $ words "foo bar baz"
+    build ["foo","baz","--live=live.txt"]
+    assertContentsUnordered "live.txt" $ words "foo bar baz"
+    build ["foo","--live=live.txt"]
+    assertContentsUnordered "live.txt" $ words "foo bar"
+    build ["bar","--live=live.txt"]
+    assertContentsUnordered "live.txt" $ words "bar"
diff --git a/src/Test/MakeTutor/Makefile b/src/Test/MakeTutor/Makefile
deleted file mode 100644
--- a/src/Test/MakeTutor/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# From http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/, Makefile 4
-
-CC=gcc
-CFLAGS=-I.
-DEPS = hellomake.h
-OBJ = hellomake.o hellofunc.o 
-
-hellomake$(EXE): $(OBJ)
-	$(CC) -o $@ $^ $(CFLAGS)
-
-%.o: %.c $(DEPS)
-	$(CC) -c -o $@ $< $(CFLAGS)
-
-.PHONY: clean
-clean:
-	rm hellomake$(EXE)
-	rm *.o
diff --git a/src/Test/MakeTutor/hellofunc.c b/src/Test/MakeTutor/hellofunc.c
deleted file mode 100644
--- a/src/Test/MakeTutor/hellofunc.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <stdio.h>
-#include <hellomake.h>
-
-void myPrintHelloMake(void) {
-
-  printf("Hello makefiles!\n");
-
-  return;
-}
diff --git a/src/Test/MakeTutor/hellomake.c b/src/Test/MakeTutor/hellomake.c
deleted file mode 100644
--- a/src/Test/MakeTutor/hellomake.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <hellomake.h>
-
-int main() {
-  // call a function in another file
-  myPrintHelloMake();
-
-  return(0);
-}
diff --git a/src/Test/MakeTutor/hellomake.h b/src/Test/MakeTutor/hellomake.h
deleted file mode 100644
--- a/src/Test/MakeTutor/hellomake.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
-example include file
-*/
-
-void myPrintHelloMake(void);
diff --git a/src/Test/Makefile.hs b/src/Test/Makefile.hs
deleted file mode 100644
--- a/src/Test/Makefile.hs
+++ /dev/null
@@ -1,28 +0,0 @@
-
-module Test.Makefile(main) where
-
-import Development.Shake(action, liftIO)
-import qualified Run as Makefile
-import System.Environment
-import Test.Type
-import Control.Monad
-import Data.List
-import Data.Maybe
-
-
-main = shaken test $ \args obj ->
-    action $ liftIO $ do
-        unless (["@@"] `isPrefixOf` args) $
-            error "The 'makefile' example should only be used in test mode, to test using a makefile use the 'make' example."
-        withArgs [fromMaybe x $ stripPrefix "@" x | x <- drop 1 args] Makefile.main
-
-
-test build obj = do
-    copyDirectoryChanged "src/Test/MakeTutor" $ obj "MakeTutor"
-    build ["@@","--directory=" ++ obj "MakeTutor","--no-report"]
-    build ["@@","--directory=" ++ obj "MakeTutor","--no-report"]
-    build ["@@","--directory=" ++ obj "MakeTutor","@clean","--no-report"]
-    writeFile (obj "output.txt") "goodbye"
-    writeFile (obj "Shakefile.hs") "main = writeFile \"output.txt\" \"hello\""
-    build ["@@","--directory=" ++ obj ""]
-    assertContents (obj "output.txt") "hello"
diff --git a/src/Test/Manual.hs b/src/Test/Manual.hs
--- a/src/Test/Manual.hs
+++ b/src/Test/Manual.hs
@@ -1,23 +1,27 @@
 
 module Test.Manual(main) where
 
-import Development.Shake hiding (copyFileChanged)
+import Development.Shake
 import Development.Shake.FilePath
 import Test.Type
+import General.Extra
+import Data.Maybe
 import System.Info.Extra
 
 
-main = shaken test $ \args obj ->
-    action $ liftIO $ error "The 'manual' example should only be used in test mode"
-
-test build obj = do
-    copyDirectoryChanged "docs/manual" $ obj "manual"
-    copyDirectoryChanged "src/Development" $ obj "manual/Development"
-    copyDirectoryChanged "src/General" $ obj "manual/General"
-    copyFileChanged "src/Paths.hs" $ obj "manual/Paths_shake.hs"
+main = testSimple $ do
+    -- we use .git as our destination, despite not being a real git repo
+    -- so that search tools ignore it, and I don't get dupes for every source file
+    let dest = ".git"
+    copyDirectoryChanged (shakeRoot </> "docs/manual") dest
+    copyDirectoryChanged (shakeRoot </> "src/Development") $ dest </> "Development"
+    copyDirectoryChanged (shakeRoot </> "src/General") $ dest </> "General"
+    copyFileChangedIO (shakeRoot </> "src/Paths.hs") $ dest </> "Paths_shake.hs"
+    (_, gccPath) <- findGcc
+    let opts = [Cwd dest, Shell, AddPath [] (maybeToList gccPath)]
     let cmdline = if isWindows then "build.bat" else "/bin/sh build.sh"
-    () <- cmd [Cwd $ obj "manual", Shell] cmdline "-j2"
-    assertExists $ obj "manual/_build/run" <.> exe
-    () <- cmd [Cwd $ obj "manual", Shell] cmdline
-    () <- cmd [Cwd $ obj "manual", Shell] [cmdline,"clean"]
-    assertMissing $ obj "manual/_build/run" <.> exe
+    cmd_ opts cmdline "-j2"
+    assertExists $ dest </> "_build/run" <.> exe
+    cmd_ opts cmdline
+    cmd_ opts [cmdline,"clean"]
+    assertMissing $ dest </> "_build/run" <.> exe
diff --git a/src/Test/Match.hs b/src/Test/Match.hs
--- a/src/Test/Match.hs
+++ b/src/Test/Match.hs
@@ -6,58 +6,58 @@
 import Test.Type
 
 
-main = shakenCwd test $ \args obj -> do
-    want $ map obj args
-    let output x = \file -> writeFile' file x
+main = testBuild test $ do
+    let output x file = writeFile' file x
 
     ["or*","*or"] |%> output ""
 
     alternatives $ do
-        obj "alternative.t*" %> output "alternative.t*"
-        obj "alternative.*" %> output "alternative.*"
+        "alternative.t*" %> output "alternative.t*"
+        "alternative.*" %> output "alternative.*"
 
-    priority 100 $ priority 0 $ obj "priority.txt" %> output "100"
-    priority 50 $ obj "priority.txt" %> output "50"
+    priority 100 $ priority 0 $ "priority.txt" %> output "100"
+    priority 50 $ "priority.txt" %> output "50"
 
     alternatives $ do
-        priority 20 $ obj "altpri.txt" %> output "20"
-        priority 40 $ obj "altpri.txt" %> output "40"
-    priority 30 $ obj "altpri.txt" %> output "30"
+        priority 20 $ "altpri.txt" %> output "20"
+        priority 40 $ "altpri.txt" %> output "40"
+    priority 30 $ "altpri.txt" %> output "30"
 
     alternatives $ do
-        priority 21 $ obj "altpri2.txt" %> output "21"
-        priority 22 $ obj "altpri2.txt" %> output "22"
-    priority 23 $ obj "altpri2.txt" %> output "23"
+        priority 21 $ "altpri2.txt" %> output "21"
+        priority 22 $ "altpri2.txt" %> output "22"
+    priority 23 $ "altpri2.txt" %> output "23"
 
-    priority 55 $ alternatives $ obj "x" %> output "55"
-    priority 51 $ obj "x" %> output "51"
+    priority 55 $ alternatives $ "x" %> output "55"
+    priority 51 $ "x" %> output "51"
 
-    priority 42 $ alternatives $ obj "xx" %> output "42"
-    priority 43 $ obj "xx" %> output "43"
+    priority 42 $ alternatives $ "xx" %> output "42"
+    priority 43 $ "xx" %> output "43"
 
     priority 10 $ do
-        priority 7 $ obj "change" %> output "7"
-        priority 8 $ obj "change" %> output "8"
-    priority 9 $ obj "change" %> output "9"
+        priority 6 $ "change" %> output "6"
+        priority 7 $ "change" %> output "7"
+        priority 8 $ "change" %> output "8"
+    priority 9 $ "change" %> output "9"
 
 
-test build obj = do
+test build = do
     build ["clean"]
     build ["or"]
 
     build ["alternative.foo","alternative.txt"]
-    assertContents (obj "alternative.foo") "alternative.*"
-    assertContents (obj "alternative.txt") "alternative.t*"
+    assertContents "alternative.foo" "alternative.*"
+    assertContents "alternative.txt" "alternative.t*"
 
     build ["priority.txt"]
-    assertContents (obj "priority.txt") "100"
+    assertContents "priority.txt" "100"
 
     build ["altpri.txt","altpri2.txt"]
-    assertContents (obj "altpri.txt") "20"
-    assertContents (obj "altpri2.txt") "23"
+    assertContents "altpri.txt" "30"
+    assertContents "altpri2.txt" "23"
 
     build ["x","xx"]
-    assertContents (obj "x") "55"
-    assertContents (obj "xx") "43"
+    assertContents "x" "55"
+    assertContents "xx" "43"
 
-    assertException ["matches multiple rules"] $ build ["change","--quiet"]
+    assertException ["matches multiple rules","3"] $ build ["change","--quiet"]
diff --git a/src/Test/Monad.hs b/src/Test/Monad.hs
--- a/src/Test/Monad.hs
+++ b/src/Test/Monad.hs
@@ -2,59 +2,58 @@
 module Test.Monad(main) where
 
 import Test.Type
-import Development.Shake.Monad
+import Development.Shake.Internal.Core.Monad
 
+import Data.Either.Extra
 import Data.IORef
 import Control.Concurrent
-import Control.Exception hiding (assert)
-import Control.Monad
+import Control.Exception
+import Control.Monad.Extra
 import Control.Monad.IO.Class
 
 
-main = shakenCwd test $ \args obj -> return ()
 
 
-run :: ro -> rw -> RAW ro rw a -> IO a
+run :: ro -> rw -> RAW () () ro rw a -> IO a
 run ro rw m = do
     res <- newEmptyMVar
-    runRAW ro rw m $ void . tryPutMVar res
-    either throwIO return =<< readMVar res
+    runRAW pure ro rw m $ void . tryPutMVar res
+    eitherM throwIO pure (readMVar res)
 
 
-test build obj = do
-    let conv x = either (Left . fromException) Right x :: Either (Maybe ArithException) Int
-    let dump ro rw = do liftIO . (=== ro) =<< getRO; liftIO . (=== rw) =<< getRW
+main = testSimple $ do
+    let conv x = mapLeft fromException x :: Either (Maybe ArithException) Int
+    let dump rw = liftIO . (=== rw) =<< getRW
 
     -- test the basics plus exception handling
     run 1 "test" $ do
-        dump 1 "test"
+        dump "test"
         putRW "more"
-        dump 1 "more"
-        res <- tryRAW $ withRO (+3) $ do
-            dump 4 "more"
-            withRW (++ "x") $
-                dump 4 "morex"
-            dump 4 "more"
-            return 100
+        dump "more"
+        res <- tryRAW $ do
+            dump "more"
+            modifyRW (++ "x")
+            dump "morex"
+            pure 100
         liftIO $ conv res === Right 100
-        dump 1 "more"
+        dump "morex"
         putRW "new"
-        dump 1 "new"
-        res <- tryRAW $ withRO (+2) $ do
-            dump 3 "new"
-            withRW (++ "x") $ do
-                dump 3 "newx"
-                throwRAW Overflow
+        dump "new"
+        res <- tryRAW $ do
+            dump "new"
+            modifyRW (++ "z")
+            dump "newz"
+            throwRAW Overflow
             error "Should not have reached here"
-            return 9
+            pure 9
         liftIO $ conv res === Left (Just Overflow)
-        dump 1 "new"
+        dump "newz"
         catchRAW (catchRAW (throwRAW Overflow) $ \_ -> modifyRW (++ "x")) $
             \_ -> modifyRW (++ "y")
-        dump 1 "newx"
+        dump "newzx"
         catchRAW (catchRAW (throwRAW Overflow) $ \e -> modifyRW (++ "x") >> throwRAW e) $
             \_ -> modifyRW (++ "y")
-        dump 1 "newxxy"
+        dump "newzxxy"
 
     -- test capture
     run 1 "test" $ do
@@ -68,15 +67,15 @@
 
     -- catch does not scope too far
     res <- try $ run 1 "test" $
-        fmap (either show id) $ tryRAW $ captureRAW $ \k -> throwIO Overflow
+        fmap (either show id) $ tryRAW $ captureRAW $ \_ -> throwIO Overflow
     res === Left Overflow
     res <- try $ run 1 "test" $ do
-        captureRAW $ \k -> throwIO Overflow
-        return "x"
+        captureRAW $ \_ -> throwIO Overflow
+        pure "x"
     res === Left Overflow
     -- test for GHC bug 11555
-    runRAW 1 "test" (throw Overflow :: RAW Int String ()) $ \res ->
-        either (Left . fromException) Right res === Left (Just Overflow)
+    runRAW pure 1 "test" (throw Overflow :: RAW () () Int String ()) $ \res ->
+        mapLeft fromException res === Left (Just Overflow)
 
     -- catch works properly if continuation called multiple times
     ref <- newIORef []
@@ -90,3 +89,11 @@
                 k $ Left $ toException Overflow
             flip catchRAW (const $ liftIO $ modifyIORef ref ('y':)) $ throwRAW $ toException Overflow
     (===) "xyxyy" =<< readIORef ref
+
+    -- what if we throw an exception inside the continuation of run
+    ref <- newIORef 0
+    res <- try $ runRAW pure 1 "test" (pure 1) $ \_ -> do
+        modifyIORef ref (+1)
+        throwIO Overflow
+    res === Left Overflow
+    (=== 1) =<< readIORef ref
diff --git a/src/Test/Ninja.hs b/src/Test/Ninja.hs
--- a/src/Test/Ninja.hs
+++ b/src/Test/Ninja.hs
@@ -3,87 +3,95 @@
 
 import Development.Shake
 import qualified Development.Shake.Config as Config
-import System.Directory(copyFile, createDirectoryIfMissing, removeFile)
-import Control.Applicative
+import System.Directory(copyFile, removeFile)
 import Control.Monad
+import General.GetOpt
+import General.Extra
 import Test.Type
 import qualified Data.HashMap.Strict as Map
-import Data.List
-import Data.Maybe
+import Data.List.Extra
 import System.IO.Extra
 import qualified Run
 import System.Environment
-import Prelude
 
 
-main = shaken test $ \args obj -> do
-    let args2 = ("-C" ++ obj "") : map tail (filter ("@" `isPrefixOf`) args)
-    let real = "real" `elem` args
-    action $
-        if real then cmd "ninja" args2 else liftIO $ withArgs args2 Run.main
+opts = Option "" ["arg"] (ReqArg Right "") ""
 
+-- | Set to True to test with real Ninja
+--   On Windows doesn't work because echo foo > 1 isn't supported
+real_ninja = False
 
-test build obj = do
-    -- when calling run anything with a leading @ gets given to Shake, anything without gets given to Ninja
-    let run xs = build $ "--exception" : map (\x -> fromMaybe ('@':x) $ stripPrefix "@" x) (words xs)
-    let runFail xs bad = assertException [bad] $ run $ xs ++ " --quiet"
+main = testBuildArgs test [opts] $ \opts -> do
+    let real = "real" `elem` opts
+    action $ if real || real_ninja
+        then cmd "ninja" opts
+        else liftIO $ withArgs ("--lint":"--report=report.html":opts) Run.main
 
+
+test build = do
+    let runEx ninja shake = build $ "--exception" : "--no-report" : map ("--arg=" ++) (words ninja) ++ words shake
+    let run ninja = runEx ninja []
+    let runFail ninja bad = assertException [bad] $ runEx ninja "--quiet"
+
     build ["clean"]
     run "-f../../src/Test/Ninja/test1.ninja"
-    assertExists $ obj "out1.txt"
+    assertExists "out1.txt"
 
     run "-f../../src/Test/Ninja/test2.ninja"
-    assertExists $ obj "out2.2"
-    assertMissing $ obj "out2.1"
+    assertExists "out2.2"
+    assertMissing "out2.1"
     build ["clean"]
     run "-f../../src/Test/Ninja/test2.ninja out2.1"
-    assertExists $ obj "out2.1"
-    assertMissing $ obj "out2.2"
+    assertExists "out2.1"
+    assertMissing "out2.2"
 
-    copyFile "src/Test/Ninja/test3-sub.ninja" $ obj "test3-sub.ninja"
-    copyFile "src/Test/Ninja/test3-inc.ninja" $ obj "test3-inc.ninja"
-    createDirectoryIfMissing True $ obj "subdir"
-    copyFile "src/Test/Ninja/subdir/1.ninja" $ obj "subdir/1.ninja"
-    copyFile "src/Test/Ninja/subdir/2.ninja" $ obj "subdir/2.ninja"
+    copyFile "../../src/Test/Ninja/test3-sub.ninja" "test3-sub.ninja"
+    copyFile "../../src/Test/Ninja/test3-inc.ninja" "test3-inc.ninja"
+    createDirectoryRecursive "subdir"
+    copyFile "../../src/Test/Ninja/subdir/1.ninja" "subdir/1.ninja"
+    copyFile "../../src/Test/Ninja/subdir/2.ninja" "subdir/2.ninja"
     run "-f../../src/Test/Ninja/test3.ninja"
-    assertContentsWords (obj "out3.1") "g4+b1+++i1"
-    assertContentsWords (obj "out3.2") "g4++++i1"
-    assertContentsWords (obj "out3.3") "g4++++i1"
-    assertContentsWords (obj "out3.4") "g4+++s1+s2"
+    assertContentsWords "out3.1" "g4+b1+++i1"
+    assertContentsWords "out3.2" "g4++++i1"
+    assertContentsWords "out3.3" "g4++++i1"
+    assertContentsWords "out3.4" "g4+++s1+s2"
 
     run "-f../../src/Test/Ninja/test4.ninja out"
-    assertExists $ obj "out.txt"
-    assertExists $ obj "out2.txt"
+    assertExists "out.txt"
+    assertExists "out2.txt"
 
     run "-f../../src/Test/Ninja/test5.ninja"
-    assertExists $ obj "output file"
+    assertExists "output file"
 
-    writeFile (obj "nocreate.log") ""
-    writeFile (obj "nocreate.in") ""
+    -- #565, check multi-file rules that don't create their contents
+    run "-f../../src/Test/Ninja/test7.ninja"
+
+    writeFile "nocreate.log" ""
+    writeFile "nocreate.in" ""
     run "-f../../src/Test/Ninja/nocreate.ninja"
-    assertContentsWords (obj "nocreate.log") "x"
+    assertContentsWords "nocreate.log" "x"
     run "-f../../src/Test/Ninja/nocreate.ninja"
     run "-f../../src/Test/Ninja/nocreate.ninja"
-    assertContentsWords (obj "nocreate.log") "x x x"
+    assertContentsWords "nocreate.log" "x x x"
 
-    writeFile (obj "input") ""
+    writeFile "input" ""
     runFail "-f../../src/Test/Ninja/lint.ninja bad --lint" "'needed' file required rebuilding"
     run "-f../../src/Test/Ninja/lint.ninja good --lint"
     runFail "-f../../src/Test/Ninja/lint.ninja bad --lint" "not a pre-dependency"
 
-    res <- fmap (drop 1 . lines . fst) $ captureOutput $ run "-f../../src/Test/Ninja/compdb.ninja -t compdb cxx @--no-report @--quiet"
-    want <- lines <$> readFile "src/Test/Ninja/compdb.output"
+    res <- fmap (drop1 . lines . fst) $ captureOutput $ runEx "-f../../src/Test/Ninja/compdb.ninja -t compdb cxx" "--quiet"
+    want <- lines <$> readFile "../../src/Test/Ninja/compdb.output"
     let eq a b | (a1,'*':a2) <- break (== '*') a = unless (a1 `isPrefixOf` b && a2 `isSuffixOf` b) $ a === b
                | otherwise = a === b
     length want === length res
     zipWithM_ eq want res
 
     -- Test initial variable bindings and variables in include/subninja statements
-    let test6 = obj "test6"
+    let test6 = "test6"
 
-    copyFile "src/Test/Ninja/test6-sub.ninja" $ test6 ++ "-sub.ninja"
-    copyFile "src/Test/Ninja/test6-inc.ninja" $ test6 ++ "-inc.ninja"
-    copyFile "src/Test/Ninja/test6.ninja" $ test6 ++ ".ninja"
+    copyFile "../../src/Test/Ninja/test6-sub.ninja" $ test6 ++ "-sub.ninja"
+    copyFile "../../src/Test/Ninja/test6-inc.ninja" $ test6 ++ "-inc.ninja"
+    copyFile "../../src/Test/Ninja/test6.ninja" $ test6 ++ ".ninja"
 
     config <- Config.readConfigFileWithEnv [("v1", test6)] $ test6 ++ ".ninja"
     -- The file included by subninja should have a separate variable scope
@@ -93,21 +101,32 @@
 
     -- tests from ninjasmith: https://github.com/ndmitchell/ninjasmith/
     run "-f../../src/Test/Ninja/redefine.ninja"
-    assertContentsWords (obj "redefine.txt") "version3 version2"
+    assertContentsWords "redefine.txt" "version3 version2"
 
     run "-f../../src/Test/Ninja/buildseparate.ninja"
-    assertContentsWords (obj "buildseparate.txt") "XX"
+    assertContentsWords "buildseparate.txt" "XX"
 
     run "-f../../src/Test/Ninja/lexical.ninja"
-    assertContentsWords (obj "lexical.txt") "XFoo_BarXXFooX.bar"
+    assertContentsWords "lexical.txt" "XFoo_BarXXFooX.bar"
 
+    run "-f../../src/Test/Ninja/continuations.ninja"
+    assertExists "continuations.txt"
+
+    copyFile "../../src/Test/Ninja/restart.ninja" "restart.ninja"
+    runEx "-frestart.ninja" "--sleep"
+    assertExists "restart.txt"
+
+    createDirectoryRecursive "directory1"
+    createDirectoryRecursive "directory2"
+    run "-f../../src/Test/Ninja/allow_directory.ninja"
+
     when False $ do
         -- currently fails because Shake doesn't match Ninja here
         run "-f../../src/Test/Ninja/outputtouch.ninja"
-        assertContentsWords (obj "outputtouch.txt") "hello"
-        writeFile (obj "outputtouch.txt") "goodbye"
+        assertContentsWords "outputtouch.txt" "hello"
+        writeFile "outputtouch.txt" "goodbye"
         run "-f../../src/Test/Ninja/outputtouch.ninja"
-        assertContentsWords (obj "outputtouch.txt") "goodbye"
-        removeFile (obj "outputtouch.txt")
+        assertContentsWords "outputtouch.txt" "goodbye"
+        removeFile "outputtouch.txt"
         run "-f../../src/Test/Ninja/outputtouch.ninja"
-        assertContentsWords (obj "outputtouch.txt") "hello"
+        assertContentsWords "outputtouch.txt" "hello"
diff --git a/src/Test/Ninja/allow_directory.ninja b/src/Test/Ninja/allow_directory.ninja
new file mode 100644
--- /dev/null
+++ b/src/Test/Ninja/allow_directory.ninja
@@ -0,0 +1,6 @@
+rule create
+    command = echo 1 > $out
+
+build root: phony || allow_directory.txt directory1
+build allow_directory.txt: create | directory2
+default root
diff --git a/src/Test/Ninja/continuations.ninja b/src/Test/Ninja/continuations.ninja
new file mode 100644
--- /dev/null
+++ b/src/Test/Ninja/continuations.ninja
@@ -0,0 +1,12 @@
+
+rule $
+    run
+    command $
+    = $
+    touch $
+    $out
+
+build $
+    continuations.txt $
+    : $
+    run
diff --git a/src/Test/Ninja/lint.ninja b/src/Test/Ninja/lint.ninja
--- a/src/Test/Ninja/lint.ninja
+++ b/src/Test/Ninja/lint.ninja
@@ -6,8 +6,14 @@
     command = (echo $out : $out.gen > $out.d) && (echo $out > $out)
     depfile = $out.d
 
-build good: run || good.gen bad.gen
-build good.gen: gen
+build good: phony good1 good2
+
+build good1: run || good1.gen
+build good1.gen: gen
+
+build good2: run || good2_phony
+build good2_phony: phony good2.gen
+build good2.gen: gen
 
 build bad: run | input
 build bad.gen: gen
diff --git a/src/Test/Ninja/restart.ninja b/src/Test/Ninja/restart.ninja
new file mode 100644
--- /dev/null
+++ b/src/Test/Ninja/restart.ninja
@@ -0,0 +1,8 @@
+
+rule add
+    command = echo build restart.txt: self >> $out
+
+build restart.ninja: add
+
+rule self
+    command = echo $out > $out
diff --git a/src/Test/Ninja/test7.ninja b/src/Test/Ninja/test7.ninja
new file mode 100644
--- /dev/null
+++ b/src/Test/Ninja/test7.ninja
@@ -0,0 +1,7 @@
+# #565, check multi-file rules that don't create their contents
+ninja_required_version = 1.5
+build test : phony a b
+rule CUSTOM_COMMAND
+   command = $COMMAND
+build a b : CUSTOM_COMMAND
+  COMMAND = cd
diff --git a/src/Test/Oracle.hs b/src/Test/Oracle.hs
--- a/src/Test/Oracle.hs
+++ b/src/Test/Oracle.hs
@@ -1,76 +1,118 @@
-{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TypeFamilies, ConstraintKinds, ScopedTypeVariables #-}
+{-# LANGUAGE DeriveDataTypeable, TypeOperators, GeneralizedNewtypeDeriving #-}
+{-# OPTIONS_GHC -Wno-orphans #-}
 
 module Test.Oracle(main) where
 
 import Development.Shake
-import Test.Type
+import Development.Shake.Classes
+import Development.Shake.FilePath
+import General.GetOpt
+import Data.List.Extra
+import Data.Tuple.Extra
+import Test.Type hiding (RandomType)
+import qualified Test.Type as T
 import Control.Monad
+import General.Extra
 
 
-main = shakenCwd test $ \args obj -> do
-    let f name lhs rhs = (,) name
-            (do addOracle $ \k -> let _ = k `asTypeOf` lhs in return rhs; return ()
-            ,let o = obj name ++ ".txt" in do want [o]; o %> \_ -> do v <- askOracleWith lhs rhs; writeFile' o $ show v)
-    let tbl = [f "str-bool" "" True
-              ,f "str-int" "" (0::Int)
-              ,f "bool-str" True ""
-              ,f "int-str" (0::Int) ""]
+-- These are instances we'll compute over
+type instance RuleResult String = String
+type instance RuleResult Int = String
+type instance RuleResult () = String
 
-    forM_ args $ \a -> case a of
-        '+':x | Just (add,_) <- lookup x tbl -> add
-        '*':x | Just (_,use) <- lookup x tbl -> use
-        '@':key -> do addOracle $ \() -> return key; return ()
-        '%':name -> let o = obj "unit.txt" in do want [o]; o %> \_ -> do {askOracleWith () ""; writeFile' o name}
-        '!':name -> do want [obj "rerun"]; obj "rerun" %> \out -> do alwaysRerun; writeFile' out name
+type instance RuleResult Bool = Bool -- test results don't have to be a boolean
 
-test build obj = do
-    build ["clean"]
+newtype FileLen = FileLen FilePath
+    deriving (Eq,Show,NFData,Typeable,Hashable,Binary)
+type instance RuleResult FileLen = Int
 
-    -- check it rebuilds when it should
-    build ["@key","%name"]
-    assertContents (obj "unit.txt") "name"
-    build ["@key","%test"]
-    assertContents (obj "unit.txt") "name"
-    build ["@foo","%test"]
-    assertContents (obj "unit.txt") "test"
+newtype RandomType = RandomType (BinarySentinel String)
+    deriving (Eq,Show,NFData,Typeable,Hashable,Binary)
 
-    -- check adding/removing redundant oracles does not trigger a rebuild
-    build ["@foo","%newer","+str-bool"]
-    assertContents (obj "unit.txt") "test"
-    build ["@foo","%newer","+str-int"]
-    assertContents (obj "unit.txt") "test"
-    build ["@foo","%newer"]
-    assertContents (obj "unit.txt") "test"
+type instance RuleResult RandomType = Int
+type instance RuleResult T.RandomType = Int
 
-    -- check always run works
-    build ["!foo"]
-    assertContents (obj "rerun") "foo"
-    build ["!bar"]
-    assertContents (obj "rerun") "bar"
+data Define = Define String String -- this type produces this result
+opt = [Option "" ["def"] (ReqArg (Right . uncurry Define . second tailErr . breakOn "=") "type=value") ""]
 
-    -- check error messages are good
-    let errors args err = assertException [err] $ build $ "--quiet" : args
+main = testBuildArgs test opt $ \args -> do
+    addOracle $ \(T.RandomType _) -> pure 42
+    addOracle $ \(RandomType _) -> pure (-42)
+    "randomtype.txt" %> \out -> do
+        a <- askOracle $ T.RandomType $ BinarySentinel ()
+        b <- askOracle $ RandomType $ BinarySentinel ()
+        writeFile' out $ show (a,b)
 
-    build ["+str-int","*str-int"]
-    errors ["*str-int"] -- Building with an an Oracle that has been removed
-        "missing a call to addOracle"
+    addOracle $ \b -> pure $ not b
+    "true.txt" %> \out -> writeFile' out . show =<< askOracle False
 
-    errors ["*str-bool"] -- Building with an Oracle that I know nothing about
-        "missing a call to addOracle"
+    let add :: forall a . (ShakeValue a, RuleResult a ~ String) => String -> a -> Rules ()
+        add name key = do
+            name <.> "txt" %> \out -> do
+                liftIO $ appendFile ".log" "."
+                writeFile' out =<< askOracle key
+            forM_ [val | Define nam val <- args, nam == name] $ \val ->
+                addOracle $ \(_ :: a) -> pure val
+    add "string" ""
+    add "unit" ()
+    add "int" (0 :: Int)
 
-    build ["+str-int","*str-int"]
-    errors ["+str-bool","*str-int"] -- Building with an Oracle that has changed type
-        "askOracle is used at the wrong type"
+    addOracleCache $ \(FileLen file) -> do
+        liftIO $ appendFile ".log" "#"
+        length <$> readFile' file
+    "cache_out.txt" %> \out -> do
+        o <- askOracle (FileLen "cache_in.txt")
+        liftIO $ appendFile ".log" "!"
+        writeFile' out $ show o
 
-    errors ["+str-int","+str-bool"] -- Two Oracles with the same question type
-        "Only one call to addOracle is allowed"
+test build = do
+    build ["clean"]
 
-    errors ["+str-int","*str-bool"] -- Using an Oracle at the wrong answer type
-        "askOracle is used at the wrong type"
+    build ["randomtype.txt"]
+    assertContents "randomtype.txt" "(42,-42)"
 
-    build ["+str-int","+str-int"] -- Two Oracles work if they aren't used
-    errors ["+str-int","+str-int","*str-int"] -- Two Oracles fail if they are used
-        "Only one call to addOracle is allowed"
+    -- check it rebuilds when it should
+    writeFile ".log" ""
+    build ["--def=string=name","string.txt"]
+    assertContents "string.txt" "name"
+    build ["--def=string=name","string.txt"]
+    assertContents "string.txt" "name"
+    build ["--def=string=test","string.txt"]
+    assertContents "string.txt" "test"
+    assertContents ".log" ".."
 
-    errors ["+str-int","+str-bool"] -- Two Oracles with the same answer type
-        "Only one call to addOracle is allowed"
+    -- check adding/removing redundant oracles does not trigger a rebuild
+    build ["--def=string=test","string.txt","--def=unit=bob"]
+    build ["--def=string=test","string.txt","--def=int=fred"]
+    build ["--def=string=test","string.txt"]
+    assertContents "string.txt" "test"
+    assertContents ".log" ".."
+
+    writeFile ".log" ""
+    writeFile "cache_in.txt" "aaa"
+    build ["cache_out.txt","--sleep"]
+    assertContents "cache_out.txt" "3"
+    assertContents ".log" "#!"
+    writeFile "cache_in.txt" "zzz"
+    build ["cache_out.txt","--sleep"]
+    build ["cache_out.txt","--sleep"]
+    assertContents "cache_out.txt" "3"
+    assertContents ".log" "#!#"
+    writeFile "cache_in.txt" "zzzz"
+    build ["cache_out.txt","--sleep"]
+    assertContents "cache_out.txt" "4"
+    assertContents ".log" "#!##!"
+
+    -- check error messages are good
+    let errors args err = assertExceptionAfter (replace "\\" "/") err $ build $ "--quiet" : args
+
+    build ["--def=unit=test","unit.txt"]
+    errors ["unit.txt"] -- Building with an an Oracle that has been removed
+        ["missing a call to addOracle"]
+
+    errors ["int.txt"] -- Building with an Oracle that I know nothing about
+        ["missing a call to addOracle"]
+
+    errors ["--def=string=1","--def=string=1"] -- Two Oracles defined in one go
+        ["oracle defined twice", "Test/Oracle.hs"]
diff --git a/src/Test/OrderOnly.hs b/src/Test/OrderOnly.hs
--- a/src/Test/OrderOnly.hs
+++ b/src/Test/OrderOnly.hs
@@ -7,56 +7,54 @@
 import Control.Exception.Extra
 
 
-main = shakenCwd test $ \args obj -> do
-    want $ map obj args
-
-    obj "bar.txt" %> \out -> do
+main = testBuild test $ do
+    "bar.txt" %> \out -> do
         alwaysRerun
-        writeFile' out =<< liftIO (readFile $ obj "bar.in")
+        writeFile' out =<< liftIO (readFile "bar.in")
 
-    obj "foo.txt" %> \out -> do
-        let src = obj "bar.txt"
+    "foo.txt" %> \out -> do
+        let src = "bar.txt"
         orderOnly [src]
         writeFile' out =<< liftIO (readFile src)
         need [src]
 
-    obj "baz.txt" %> \out -> do
-        let src = obj "bar.txt"
+    "baz.txt" %> \out -> do
+        let src = "bar.txt"
         orderOnly [src]
         liftIO $ appendFile out "x"
 
-    obj "primary.txt" %> \out -> do
-        need [obj "source.txt"]
-        orderOnly [obj "intermediate.txt"]
-        writeFile' out =<< liftIO (readFile $ obj "intermediate.txt")
+    "primary.txt" %> \out -> do
+        need ["source.txt"]
+        orderOnly ["intermediate.txt"]
+        writeFile' out =<< liftIO (readFile "intermediate.txt")
 
-    obj "intermediate.txt" %> \out ->
-        copyFile' (obj "source.txt") out
+    "intermediate.txt" %> \out ->
+        copyFile' "source.txt" out
 
 
-test build obj = do
-    writeFile (obj "bar.in") "in"
+test build = do
+    writeFile "bar.in" "in"
     build ["foo.txt","--sleep"]
-    assertContents (obj "foo.txt") "in"
-    writeFile (obj "bar.in") "out"
+    assertContents "foo.txt" "in"
+    writeFile "bar.in" "out"
     build ["foo.txt","--sleep"]
-    assertContents (obj "foo.txt") "out"
+    assertContents "foo.txt" "out"
 
-    writeFile (obj "baz.txt") ""
-    writeFile (obj "bar.in") "in"
+    writeFile "baz.txt" ""
+    writeFile "bar.in" "in"
     build ["baz.txt","--sleep"]
-    assertContents (obj "baz.txt") "x"
-    writeFile (obj "bar.in") "out"
+    assertContents "baz.txt" "x"
+    writeFile "bar.in" "out"
     build ["baz.txt"]
-    assertContents (obj "baz.txt") "x"
+    assertContents "baz.txt" "x"
 
-    ignore $ removeFile $ obj "intermediate.txt"
-    writeFile (obj "source.txt") "x"
+    ignore $ removeFile "intermediate.txt"
+    writeFile "source.txt" "x"
     build ["primary.txt","--sleep"]
-    assertContents (obj "intermediate.txt") "x"
-    removeFile $ obj "intermediate.txt"
+    assertContents "intermediate.txt" "x"
+    removeFile "intermediate.txt"
     build ["primary.txt","--sleep"]
-    assertMissing $ obj "intermediate.txt"
-    writeFile (obj "source.txt") "y"
+    assertMissing "intermediate.txt"
+    writeFile "source.txt" "y"
     build ["primary.txt","--sleep"]
-    assertContents (obj "intermediate.txt") "y"
+    assertContents "intermediate.txt" "y"
diff --git a/src/Test/Parallel.hs b/src/Test/Parallel.hs
--- a/src/Test/Parallel.hs
+++ b/src/Test/Parallel.hs
@@ -3,40 +3,114 @@
 
 import Development.Shake
 import Test.Type
+import Data.Foldable
 import Data.Tuple.Extra
 import Control.Monad
 import Control.Concurrent.Extra
 import Data.IORef
 
 
-main = shakenCwd test $ \args obj -> do
-    want args
+main = testBuild test $ do
+    "AB.txt" %> \out -> do
+        -- need [obj "A.txt", obj "B.txt"]
+        (text1,text2) <- readFile' "A.txt" `par` readFile' "B.txt"
+        writeFile' out $ text1 ++ text2
 
+
+    sem <- liftIO $ newQSemN 0
+    "papplicative_*" %> \out -> do
+        -- wait for both to do the initial start before continuing
+        liftIO $ assertWithin 1 $ do
+            signalQSemN sem 1
+            waitQSemN sem 3
+            signalQSemN sem 3
+        writeFile' out ""
+
+    phony "papplicative" $ do
+        need ["papplicative_1"]
+        need ["papplicative_2"]
+        let ensureReturn = pure ()
+        ensureReturn -- should work even though we have a pure
+        need ["papplicative_3"]
+
+    "pseparate_*" %> \out -> do
+        liftIO $ appendFile "pseparate.log" "["
+        liftIO $ sleep 0.1
+        liftIO $ appendFile "pseparate.log" "]"
+        writeFile' out ""
+
+    phony "pseparate" $ do
+        need ["pseparate_1"]
+        liftIO $ pure ()
+        need ["pseparate_2"]
+
+    sem <- liftIO $ newQSemN 0
+    "ptraverse_*" %> \out -> do
+        -- wait for all to do the initial start before continuing
+        liftIO $ assertWithin 1 $ do
+            signalQSemN sem 1
+            waitQSemN sem 8
+            signalQSemN sem 8
+        writeFile' out ""
+
+    phony "ptraverse" $
+        traverse_ (need . pure) ["ptraverse_" ++ show i | i <- [1..8]]
+
     phony "cancel" $ do
-        writeFile' (obj "cancel") ""
+        writeFile' "cancel" ""
         done <- liftIO $ newIORef 0
         lock <- liftIO newLock
         void $ parallel $ replicate 5 $ liftIO $ do
             x <- atomicModifyIORef done $ dupe . succ
             when (x == 3) $ do sleep 0.1; fail "boom"
-            withLock lock $ appendFile (obj "cancel") "x"
+            withLock lock $ appendFile "cancel" "x"
 
     phony "parallel" $ do
         active <- liftIO $ newIORef 0
-        peak <- liftIO $ newIORef 0    
+        peak <- liftIO $ newIORef 0
         void $ parallel $ replicate 8 $ liftIO $ do
             now <- atomicModifyIORef active $ dupe . succ
             atomicModifyIORef peak $ dupe . max now
             sleep 0.1
             atomicModifyIORef active $ dupe . pred
         peak <- liftIO $ readIORef peak
-        writeFile' (obj "parallel") $ show peak
+        writeFile' "parallel" $ show peak
 
+    "parallels" %> \out -> do
+        xs <- parallel $ replicate 5 $ parallel $ map pure [1..5]
+        writeFile' out $ show xs
 
-test build obj = do
+    phony "timings" $
+        void $ parallel $ map (liftIO . sleep) [1, 2, 0, 1]
+
+
+test build = do
+    build ["clean"]
+    writeFile "A.txt" "AAA"
+    writeFile "B.txt" "BBB"
+    build ["AB.txt","--sleep"]
+    assertContents "AB.txt" "AAABBB"
+    appendFile "A.txt" "aaa"
+    build ["AB.txt"]
+    assertContents "AB.txt" "AAAaaaBBB"
+
     assertException ["boom"] $ build ["cancel","-j1","--quiet"]
-    assertContents (obj "cancel") "xx"
+    assertContents "cancel" "xx"
     build ["parallel","-j1"]
-    assertContents (obj "parallel") "1"
+    assertContents "parallel" "1"
     build ["parallel","-j5"]
-    assertContents (obj "parallel") "5"
+    assertContents "parallel" "5"
+
+    build ["parallels"]
+    assertContents "parallels" $ show $ replicate 5 [1..5]
+
+    writeFile "pseparate.log" ""
+    build ["pseparate","-j2"]
+    assertContents "pseparate.log" "[][]"
+    build ["papplicative","-j3"]
+    build ["ptraverse","-j8"]
+
+    build ["timings","-j6"]
+    assertTimings build [("timings",4)]
+    build ["timings","-j1"]
+    assertTimings build [("timings",4)]
diff --git a/src/Test/Pool.hs b/src/Test/Pool.hs
--- a/src/Test/Pool.hs
+++ b/src/Test/Pool.hs
@@ -2,67 +2,104 @@
 module Test.Pool(main) where
 
 import Test.Type
-import Development.Shake.Pool
+import General.Pool
 
-import Control.Concurrent
-import Control.Exception hiding (assert)
+import Control.Concurrent.Extra
+import Control.Exception.Extra
 import Control.Monad
+import System.Time.Extra
+import Data.Either.Extra
+import General.Timing
 
 
-main = shakenCwd test $ \args obj -> return ()
-
+main = testSimple $ do
+    -- See #474, we should never be running pool actions masked
+    let add pool act = addPool PoolStart pool $ do
+            Unmasked <- getMaskingState
+            act
 
-test build obj = do
-    let wait = sleep 0.01
     forM_ [False,True] $ \deterministic -> do
-
         -- check that it aims for exactly the limit
         forM_ [1..6] $ \n -> do
-            var <- newMVar (0,0) -- (maximum, current)
+            var <- newVar (0,0) -- (maximum, current)
             runPool deterministic n $ \pool ->
-                forM_ [1..5] $ \i ->
-                    addPool pool $ do
-                        modifyMVar_ var $ \(mx,now) -> return (max (now+1) mx, now+1)
-                        wait
-                        modifyMVar_ var $ \(mx,now) -> return (mx,now-1)
-            res <- takeMVar var
+                replicateM_ 5 $
+                    add pool $ do
+                        modifyVar_ var $ \(mx,now) -> pure (max (now+1) mx, now+1)
+                        -- requires that all tasks get spawned within 0.1s
+                        sleep 0.1
+                        modifyVar_ var $ \(mx,now) -> pure (mx,now-1)
+            res <- readVar var
             res === (min n 5, 0)
 
         -- check that exceptions are immediate
-        self <- myThreadId
-        handle (\(ErrorCall msg) -> msg === "pass") $
-            runPool deterministic 3 $ \pool -> do
-                addPool pool $ do
-                    wait
-                    error "pass"
-                addPool pool $ do
-                    wait >> wait
-                    throwTo self $ ErrorCall "fail" 
-        wait >> wait -- give chance for a delayed exception
+        good <- newVar True
+        started <- newBarrier
+        stopped <- newBarrier
+        res <- try_ $ runPool deterministic 3 $ \pool -> do
+                add pool $ do
+                    waitBarrier started
+                    throwIO Underflow
+                add pool $
+                    flip finally (signalBarrier stopped ()) $ do
+                        signalBarrier started ()
+                        sleep 10
+                        modifyVar_ good $ const $ pure False
+        -- note that the pool finishing means we started killing our threads
+        -- not that they have actually died
+        mapLeft fromException res === Left (Just Underflow)
+        waitBarrier stopped
+        assertBoolIO (readVar good) "Must be true"
 
         -- check someone spawned when at zero todo still gets run
-        done <- newMVar False
+        done <- newBarrier
         runPool deterministic 1 $ \pool ->
-            addPool pool $ do
-                wait
-                addPool pool $ do
-                    wait
-                    modifyMVar_ done $ const $ return True
-        done <- readMVar done
-        assert done "Waiting on someone"
+            add pool $
+                add pool $
+                    signalBarrier done ()
+        assertWithin 1 $ waitBarrier done
 
+        -- check high priority stuff runs first
+        res <- newVar ""
+        runPool deterministic 1 $ \pool -> do
+            let note c = modifyVar_ res $ pure . (c:)
+            -- deliberately in a random order
+            addPool PoolBatch pool $ note 'b'
+            addPool PoolException pool $ note 'e'
+            addPool PoolStart pool $ note 's'
+            addPool PoolStart pool $ note 's'
+            addPool PoolResume pool $ note 'r'
+            addPool PoolException pool $ note 'e'
+        (=== "bssree") =<< readVar res
+
         -- check that killing a thread pool stops the tasks, bug 545
-        thread <- newEmptyMVar
-        done <- newEmptyMVar
-        res <- newMVar True
-        t <- forkIO $ flip finally (putMVar done ()) $ runPool deterministic 1 $ \pool ->
-            addPool pool $ do
-                t <- takeMVar thread
-                killThread t
-                wait -- allow the thread to die first
-                modifyMVar_ res (const $ return False)
-        putMVar thread t
-        takeMVar done
-        wait >> wait >> wait -- allow the bad thread to continue
-        res <- readMVar res
-        assert res "Early termination"
+        -- and propagates the right exception
+        thread <- newBarrier
+        died <- newBarrier
+        done <- newBarrier
+        t <- flip forkFinally (signalBarrier died) $ runPool deterministic 1 $ \pool ->
+            add pool $
+                flip onException (signalBarrier done ()) $ do
+                    flip throwTo Overflow =<< waitBarrier thread
+                    sleep 10
+        signalBarrier thread t
+        assertWithin 1 $ waitBarrier done
+        res <- assertWithin 1 $ waitBarrier died
+        mapLeft fromException res === Left (Just Overflow)
+
+        -- check that killing a thread pool aborts all threads before it returns
+        started <- newBarrier
+        var <- newVar False
+        try_ $ runPool deterministic 2 $ \pool -> do
+            add pool $ try_ $ (do signalBarrier started (); sleep 10) `finally` (do sleep 1; writeVar var True)
+            add pool $ do waitBarrier started; throw Overflow
+        (=== True) =<< readVar var
+
+    -- benchmark for testing thread performance, see https://github.com/ndmitchell/shake/pull/751
+    when False $ do
+        resetTimings
+        withNumCapabilities 4 $ do
+            (d, _) <- duration $ runPool False 4 $ \pool ->
+                replicateM_ 200000 $ addPool PoolStart pool $ pure ()
+            print d
+            print =<< getTimings
diff --git a/src/Test/Progress.hs b/src/Test/Progress.hs
--- a/src/Test/Progress.hs
+++ b/src/Test/Progress.hs
@@ -1,14 +1,14 @@
 module Test.Progress(main) where
 
-import Development.Shake.Progress
+import Development.Shake.Internal.Progress
+import Development.Shake.Internal.Options
 import Test.Type
-import System.Directory
+import System.Directory.Extra
 import System.FilePath
-import Data.Monoid
-import Prelude
+import General.Extra
 
 
-main = shaken test $ \args obj -> return ()
+main = testBuild test $ pure ()
 
 
 -- | Given a list of todo times, get out a list of how long is predicted
@@ -18,12 +18,12 @@
 progEx :: Double -> [Double] -> IO [Double]
 progEx mxDone todo = do
     let resolution = 10000 -- Use resolution to get extra detail on the numbers
-    let done = scanl (+) 0 $ map (min mxDone . max 0) $ zipWith (-) todo (tail todo)
-    let res = progressReplay $ zip (map (*resolution) [1..]) $ tail $ zipWith (\t d -> mempty{timeBuilt=d*resolution,timeTodo=(t*resolution,0)}) todo done
-    return $ (0/0) : map ((/ resolution) . actualSecs) res
+    let done = scanl (+) 0 $ map (min mxDone . max 0) $ zipWith (-) todo (tailErr todo)
+    let res = progressReplay $ zip (map (*resolution) [1..]) $ tailErr $ zipWith (\t d -> mempty{timeBuilt=d*resolution,timeTodo=(t*resolution,0)}) todo done
+    pure $ (0/0) : map ((/ resolution) . actualSecs) res
 
 
-test build obj = do
+test build = do
     -- perfect functions should match perfectly
     xs <- prog [10,9..1]
     drop 2 xs === [8,7..1]
@@ -41,13 +41,13 @@
 
     -- the first value must be plausible, or missing
     xs <- prog [187]
-    assert (isNaN $ head xs) "No first value"
+    assertBool (isNaN $ headErr xs) "No first value"
 
     -- desirable properties, could be weakened
     xs <- progEx 2 $ 100:map (*2) [10,9..1]
     drop 5 xs === [6,5..1]
     xs <- progEx 1 [10,9,100,8,7,6,5,4,3,2,1]
-    assert (all (<= 1.5) $ map abs $ zipWith (-) (drop 5 xs) [6,5..1]) "Close"
+    assertBool (all ((<= 1.5) . abs) $ zipWith (-) (drop 5 xs) [6,5..1]) "Close"
 
     -- if no progress is made, don't keep the time going up
     xs <- prog [10,9,8,7,7,7,7,7]
@@ -55,8 +55,8 @@
 
     -- if the work rate changes, should somewhat reflect that
     xs <- prog [10,9,8,7,6.5,6,5.5,5]
-    assert (last xs > 7.1) "Some discounting (factor=0 would give 7)"
+    assertBool (last xs > 7.1) "Some discounting (factor=0 would give 7)"
 
-    xs <- getDirectoryContents "src/Test/Progress"
-    build $ ["--progress=replay=src/Test/Progress/" ++ x | x <- xs, takeExtension x == ".prog"] ++
-            ["--no-report","--report=-","--report=" ++ obj "progress.html"]
+    xs <- listFiles $ shakeRoot </> "src/Test/Progress"
+    build $ ["--progress=replay=" ++ x | x <- xs, takeExtension x == ".prog"] ++
+            ["--no-report","--report=-","--report=" ++ "progress.html"]
diff --git a/src/Test/Random.hs b/src/Test/Random.hs
--- a/src/Test/Random.hs
+++ b/src/Test/Random.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase #-}
 {-# LANGUAGE PatternGuards #-}
 
 module Test.Random(main) where
@@ -5,18 +6,17 @@
 import Development.Shake
 import Numeric.Extra
 import Test.Type
-import Control.Applicative
 import Control.Exception.Extra
 import Control.Monad
 import Data.List
 import Data.Maybe
+import General.GetOpt
 import System.Environment
 import System.Exit
 import System.Random
 import General.Extra
 import qualified System.IO.Extra as IO
 import System.Time.Extra
-import Prelude
 
 
 inputRange = [1..10]
@@ -31,17 +31,18 @@
            | Want [Int]
     deriving (Read,Show)
 
+arg = [Option "" ["arg"] (ReqArg Right "") ""]
 
-main = shaken test $ \args obj -> do
-    let toFile (Input i) = obj $ "input-" ++ show i ++ ".txt"
-        toFile (Output i) = obj $ "output-" ++ show i ++ ".txt"
+main = testBuildArgs test arg $ \args -> do
+    let toFile (Input i) = "input-" ++ show i ++ ".txt"
+        toFile (Output i) = "output-" ++ show i ++ ".txt"
         toFile Bang = error "BANG"
 
     let randomSleep = liftIO $ do
             i <- randomRIO (0, 25)
             sleep $ intToDouble i / 100
 
-    forM_ (map read $ filter (isNothing . asDuration) args) $ \x -> case x of
+    forM_ (map read $ filter (isNothing . asDuration) args) $ \case
         Want xs -> want $ map (toFile . Output) xs
         Logic out srcs -> toFile (Output out) %> \out -> do
             res <- fmap (show . Multiple) $ forM srcs $ \src -> do
@@ -59,12 +60,12 @@
     | otherwise = Nothing
 
 
-test build obj = do
+test build = do
     limit <- do
         args <- getArgs
         let bound = listToMaybe $ reverse $ mapMaybe asDuration args
         time <- offsetTime
-        return $ when (isJust bound) $ do
+        pure $ when (isJust bound) $ do
             now <- time
             when (now > fromJust bound) exitSuccess
 
@@ -74,23 +75,23 @@
         build ["clean"]
         build [] -- to create the directory
         forM_ inputRange $ \i ->
-            writeFile (obj $ "input-" ++ show i ++ ".txt") $ show $ Single i
+            writeFile ("input-" ++ show i ++ ".txt") $ show $ Single i
         logic <- randomLogic
         runLogic [] logic
-        chng <- filterM (const randomIO) inputRange   
+        chng <- filterM (const randomIO) inputRange
         forM_ chng $ \i ->
-            writeFile (obj $ "input-" ++ show i ++ ".txt") $ show $ Single $ negate i
+            writeFile ("input-" ++ show i ++ ".txt") $ show $ Single $ negate i
         runLogic chng logic
         forM_ inputRange $ \i ->
-            writeFile (obj $ "input-" ++ show i ++ ".txt") $ show $ Single i
+            writeFile ("input-" ++ show i ++ ".txt") $ show $ Single i
         logicBang <- addBang =<< addBang logic
         j <- randomRIO (1::Int,8)
-        res <- try_ $ build $ "--exception" : ("-j" ++ show j) : map show (logicBang ++ [Want [i | Logic i _ <- logicBang]])
+        res <- try_ $ build $ "--exception" : ("-j" ++ show j) : map ((++) "--arg=" . show) (logicBang ++ [Want [i | Logic i _ <- logicBang]])
         case res of
             Left err
-                | "BANG" `isInfixOf` show err -> return () -- error I expected
+                | "BANG" `isInfixOf` show err -> pure () -- error I expected
                 | otherwise -> error $ "UNEXPECTED ERROR: " ++ show err
-            _ -> return () -- occasionally we only put BANG in places with no dependenies that don't get rebuilt
+            _ -> pure () -- occasionally we only put BANG in places with no dependenies that don't get rebuilt
         runLogic [] $ logic ++ [Want [i | Logic i _ <- logic]]
         where
             runLogic :: [Int] -> [Logic] -> IO ()
@@ -102,15 +103,17 @@
                     replicateM i $ randomElem poss
                 sleepFileTime
                 j <- randomRIO (1::Int,8)
-                build $ ("-j" ++ show j) : map show (xs ++ map Want wants)
+                build $ ("-j" ++ show j) : map ((++) "--arg=" . show) (xs ++ map Want wants)
 
-                let value i = case [ys | Logic j ys <- xs, j == i] of
-                        [ys] -> Multiple $ flip map ys $ map $ \i -> case i of
+                let value i =
+                        let ys = headErr [ys | Logic j ys <- xs, j == i]
+                        in Multiple $ flip map ys $ map $ \case
                             Input i -> Single $ if i `elem` negated then negate i else i
                             Output i -> value i
+                            Bang -> error "BANG"
                 forM_ (concat wants) $ \i -> do
                     let wanted = value i
-                    got <- fmap read $ IO.readFile' $ obj $ "output-" ++ show i ++ ".txt"
+                    got <- fmap read $ IO.readFile' $ "output-" ++ show i ++ ".txt"
                     when (wanted /= got) $
                         error $ "INCORRECT VALUE for " ++ show i
 
@@ -120,12 +123,13 @@
     i <- randomRIO (0, length xs - 1)
     let (before,now:after) = splitAt i xs
     now <- f now
-    return $ before ++ now : after
+    pure $ before ++ now : after
     where
         f (Logic log xs) = do
             i <- randomRIO (0, length xs)
             let (before,after) = splitAt i xs
-            return $ Logic log $ before ++ [Bang] : after
+            pure $ Logic log $ before ++ [Bang] : after
+        f x = pure x
 
 
 randomLogic :: IO [Logic] -- only Logic constructors
@@ -133,7 +137,7 @@
     rules <- randomRIO (1,100)
     f rules $ map Input inputRange
     where
-        f 0 avail = return []
+        f 0 _ = pure []
         f i avail = do
             needs <- randomRIO (0,3)
             xs <- replicateM needs $ do
diff --git a/src/Test/Rebuild.hs b/src/Test/Rebuild.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Rebuild.hs
@@ -0,0 +1,66 @@
+
+module Test.Rebuild(main) where
+
+import Development.Shake
+import Test.Type
+import Text.Read
+import Data.List.Extra
+import Control.Monad
+import General.GetOpt
+
+data Opt = Timestamp String | Pattern Pat
+
+opts = [Option "" ["timestamp"] (ReqArg (Right . Timestamp) "VALUE") "Value used to detect what has rebuilt when"
+       ,Option "" ["pattern"] (ReqArg (fmap Pattern . readEither) "PATTERN")  "Which file rules to use (%>, &?> etc)"]
+
+main = testBuildArgs test opts $ \args -> do
+    let timestamp = concat [x | Timestamp x <- args]
+    let p = lastDef PatWildcard [x | Pattern x <- args]
+    want ["a.txt"]
+    pat p "a.txt" $ \out -> do
+        src <- readFile' "b.txt"
+        writeFile' out $ src ++ timestamp
+
+    pat p "b.txt" $ \out -> do
+        src <- readFile' "c.txt"
+        writeFile' out $ src ++ timestamp
+
+test build =
+    forM_ [minBound..maxBound :: Pat] $ \pat -> do
+        build ["clean"]
+        let go arg c b a flags = do
+                writeFileChanged "c.txt" c
+                build $ ["--timestamp=" ++ arg, "--sleep","--no-reports","--pattern=" ++ show pat] ++ flags
+                assertContents "b.txt" b
+                assertContents "a.txt" a
+
+        -- check rebuild works
+        go "1" "x" "x1" "x11" []
+        go "2" "x" "x1" "x11" []
+        go "3" "x" "x1" "x13" ["--rebuild=a.*"]
+        go "4" "x" "x1" "x13" []
+        go "5" "x" "x5" "x55" ["--rebuild=b.*"]
+        go "6" "x" "x6" "x66" ["--rebuild"]
+        go "7" "x" "x6" "x66" []
+        go "8" "y" "y8" "y88" []
+
+        -- check skip works
+        go "1" "x" "x1" "x11" []
+        go "2" "y" "y2" "x11" ["--skip=a.*"]
+        go "3" "y" "y2" "y23" []
+        go "4" "z" "y2" "y23" ["--skip=b.*"]
+        go "5" "z" "y2" "y23" ["--skip=b.*"]
+        go "6" "z" "z6" "z66" []
+        go "7" "a" "z6" "z66" ["--skip=c.*"]
+        go "8" "a" "z6" "z66" ["--skip=b.*"]
+        go "9" "a" "a9" "z66" ["--skip=a.*"]
+        go "0" "a" "a9" "a90" []
+
+    {-
+        -- check skip-forever works
+        -- currently it does not work properly
+        go "1" "x" "x1" "x11" []
+        go "2" "y" "y2" "x11" ["--skip-forever=a.*"]
+        go "3" "y" "y2" "x11" []
+        go "4" "z" "z4" "z44" []
+    -}
diff --git a/src/Test/Reschedule.hs b/src/Test/Reschedule.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Reschedule.hs
@@ -0,0 +1,27 @@
+
+module Test.Reschedule(main) where
+
+import Development.Shake
+import Test.Type
+
+
+main = testBuild test $ do
+    file <- newResource "log.txt" 1
+    let log x = withResource file 1 $ liftIO $ appendFile "log.txt" x
+    "*.p0" %> \out -> do
+        log "0"
+        writeFile' out ""
+    "*.p1" %> \out -> do
+        reschedule 1
+        log "1"
+        writeFile' out ""
+    "*.p2" %> \out -> do
+        reschedule 2
+        log "2"
+        writeFile' out ""
+
+
+test build = do
+    build ["clean"]
+    build ["foo.p1","bar.p1","baz.p0","qux.p2"]
+    assertContents "log.txt" "0211"
diff --git a/src/Test/Resources.hs b/src/Test/Resources.hs
--- a/src/Test/Resources.hs
+++ b/src/Test/Resources.hs
@@ -3,33 +3,32 @@
 
 import Development.Shake
 import Test.Type
-import Data.List
+import Data.List.Extra
 import System.FilePath
-import Control.Exception.Extra hiding (assert)
+import Control.Exception.Extra
 import System.Time.Extra
 import Control.Monad
 import Data.IORef
 
 
-main = shakenCwd test $ \args obj -> do
+main = testBuild test $ do
     -- test I have good Ord and Show
-    want args
     do
         r1 <- newResource "test" 2
         r2 <- newResource "special" 67
-        unless (r1 < r2 || r2 < r1) $ error "Resources should have a good ordering"
-        unless ("special" `isInfixOf` show r2) $ error "Resource should contain their name when shown"
+        unless (r1 < r2 || r2 < r1) $ fail "Resources should have a good ordering"
+        unless ("special" `isInfixOf` show r2) $ fail "Resource should contain their name when shown"
 
     -- test you are capped to a maximum value
     do
         let cap = 2
         inside <- liftIO $ newIORef 0
         res <- newResource "test" cap
-        phony "cap" $ need [obj $ "c_file" ++ show i ++ ".txt" | i <- [1..4]]
-        obj "c_*.txt" %> \out ->
+        phony "cap" $ need ["c_file" ++ show i ++ ".txt" | i <- [1..4]]
+        "c_*.txt" %> \out ->
             withResource res 1 $ do
                 old <- liftIO $ atomicModifyIORef inside $ \i -> (i+1,i)
-                when (old >= cap) $ error "Too many resources in use at one time"
+                when (old >= cap) $ fail "Too many resources in use at one time"
                 liftIO $ sleep 0.1
                 liftIO $ atomicModifyIORef inside $ \i -> (i-1,i)
                 writeFile' out ""
@@ -38,31 +37,31 @@
     do
         done <- liftIO $ newIORef 0
         lock <- newResource "lock" 1
-        phony "schedule" $ do
-            need $ map (\x -> obj $ "s_" ++ x) $ "lock1":"done":["free" ++ show i | i <- [1..10]] ++ ["lock2"]
-        obj "s_done" %> \out -> do
-            need [obj "s_lock1",obj "s_lock2"]
+        phony "schedule" $
+            need $ map ("s_" ++) $ "lock1":"done":["free" ++ show i | i <- [1..10]] ++ ["lock2"]
+        "s_done" %> \out -> do
+            need ["s_lock1","s_lock2"]
             done <- liftIO $ readIORef done
-            when (done < 10) $ error "Not all managed to schedule while waiting"
+            when (done < 10) $ fail "Not all managed to schedule while waiting"
             writeFile' out ""
-        obj "s_lock*" %> \out -> do
+        "s_lock*" %> \out -> do
             withResource lock 1 $ liftIO $ sleep 0.5
             writeFile' out ""
-        obj "s_free*" %> \out -> do
+        "s_free*" %> \out -> do
             liftIO $ atomicModifyIORef done $ \i -> (i+1,())
             writeFile' out ""
 
     -- test that throttle works properly
     do
         res <- newThrottle "throttle" 2 0.4
-        phony "throttle" $ need $ map obj ["t_file1.1","t_file2.1","t_file3.2","t_file4.1","t_file5.2"]
-        obj "t_*.*" %> \out -> do
-            withResource res (read $ drop 1 $ takeExtension out) $
+        phony "throttle" $ need ["t_file1.1","t_file2.1","t_file3.2","t_file4.1","t_file5.2"]
+        "t_*.*" %> \out -> do
+            withResource res (read $ drop1 $ takeExtension out) $
                 when (takeBaseName out == "t_file3") $ liftIO $ sleep 0.2
             writeFile' out ""
 
 
-test build obj = do
+test build = do
     build ["-j2","cap","--clean"]
     build ["-j4","cap","--clean"]
     build ["-j10","cap","--clean"]
@@ -75,5 +74,5 @@
             (s, _) <- duration $ build [flags,"throttle","--no-report","--clean"]
             -- the 0.1s cap is a guess at an upper bound for how long everything else should take
             -- and should be raised on slower machines
-            assert (s >= 1.4 && s < 1.6) $
-                "Bad throttling, expected to take 1.4s + computation time (cap of 0.2s), took " ++ show s ++ "s"
+            assertBool (s >= 1.4 && s < 1.8) $
+                "Bad throttling, expected to take 1.4s + computation time (cap of 0.4s), took " ++ show s ++ "s"
diff --git a/src/Test/Self.hs b/src/Test/Self.hs
--- a/src/Test/Self.hs
+++ b/src/Test/Self.hs
@@ -1,75 +1,75 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, TypeFamilies #-}
 
-module Test.Self(main) where
+module Test.Self(main, cabalBuildDepends) where
 
 import Development.Shake
 import Development.Shake.Classes
 import Development.Shake.FilePath
 import Test.Type
 
-import Control.Applicative
 import Control.Monad.Extra
 import Data.Char
 import Data.List.Extra
-import System.Info
-import Data.Version.Extra
-import Prelude
+import System.Info.Extra
 
 
 newtype GhcPkg = GhcPkg () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
 newtype GhcFlags = GhcFlags () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
 
+type instance RuleResult GhcPkg = [String]
+type instance RuleResult GhcFlags = [String]
 
-main = shaken noTest $ \args obj -> do
-    let moduleToFile ext xs = map (\x -> if x == '.' then '/' else x) xs <.> ext
-    want $ if null args then [obj "Main" <.> exe] else args
+-- Doesn't work on CI, seems self-building under `cabal test` is just hard
+main = testBuild (notCI . defaultTest) $ do
+    let moduleToFile ext xs = replace "." "/" xs <.> ext
+    want ["Main" <.> exe]
 
     -- fixup to cope with Cabal's generated files
     let fixPaths x = if x == "Paths_shake.hs" then "Paths.hs" else x
 
-    ghcPkg <- addOracle $ \GhcPkg{} -> do
+    ghcPkg <- addOracleHash $ \GhcPkg{} -> do
         Stdout out <- quietly $ cmd "ghc-pkg list --simple-output"
-        return $ words out
+        pure $ words out
 
-    ghcFlags <- addOracle $ \GhcFlags{} -> do
-        pkgs <- readFileLines $ obj ".pkgs"
-        return $ map ("-package=" ++) pkgs
+    ghcFlags <- addOracleHash $ \GhcFlags{} ->
+        map ("-package=" ++) <$> readFileLines ".pkgs"
 
     let ghc args = do
+            trackAllow ["**/package.cache", "**/.ghc.environment.*"]
             -- since ghc-pkg includes the ghc package, it changes if the version does
             ghcPkg $ GhcPkg ()
             flags <- ghcFlags $ GhcFlags ()
             cmd "ghc" flags args
 
-    obj "Main" <.> exe %> \out -> do
-        src <- readFileLines $ obj "Run.deps"
-        let os = map (obj . moduleToFile "o") $ "Run" : src
+    "Main" <.> exe %> \out -> do
+        src <- readFileLines "Run.deps"
+        let os = map (moduleToFile "o") $ "Run" : src
         need os
         ghc $ ["-o",out] ++ os
 
-    obj "//*.deps" %> \out -> do
+    "**/*.deps" %> \out -> do
         dep <- readFileLines $ out -<.> "dep"
-        let xs = map (obj . moduleToFile "deps") dep
+        let xs = map (moduleToFile "deps") dep
         need xs
         ds <- nubOrd . sort . (++) dep <$> concatMapM readFileLines xs
         writeFileLines out ds
 
-    obj "//*.dep" %> \out -> do
-        src <- readFile' $ "src" </> fixPaths (unobj $ out -<.> "hs")
+    "**/*.dep" %> \out -> do
+        src <- readFile' $ shakeRoot </> "src" </> fixPaths (out -<.> "hs")
         let xs = hsImports src
-        xs <- filterM (doesFileExist . ("src" </>) . fixPaths . moduleToFile "hs") xs
+        xs <- filterM (doesFileExist . (\x -> shakeRoot </> "src" </> x) . fixPaths . moduleToFile "hs") xs
         writeFileLines out xs
 
-    [obj "//*.o",obj "//*.hi"] &%> \[out,_] -> do
+    ["**/*.o","**/*.hi"] &%> \[out,_] -> do
         deps <- readFileLines $ out -<.> "deps"
-        let hs = "src" </> fixPaths (unobj $ out -<.> "hs")
-        need $ hs : map (obj . moduleToFile "hi") deps
-        ghc $ ["-c",hs,"-isrc","-main-is","Run.main"
-              ,"-hide-all-packages","-odir=output/self","-hidir=output/self","-i=output/self"] ++
-              ["-DPORTABLE","-fwarn-unused-imports"] -- to test one CPP branch
+        let hs = shakeRoot </> "src" </> fixPaths (out -<.> "hs")
+        need $ hs : map (moduleToFile "hi") deps
+        ghc ["-c",hs,"-i" ++ shakeRoot </> "src","-main-is","Run.main"
+            ,"-hide-all-packages","-outputdir=."
+            ,"-DPORTABLE"] -- to test one CPP branch
 
-    obj ".pkgs" %> \out -> do
-        src <- readFile' "shake.cabal"
+    ".pkgs" %> \out -> do
+        src <- readFile' $ shakeRoot </> "shake.cabal"
         writeFileLines out $ sort $ cabalBuildDepends src
 
 
@@ -83,9 +83,8 @@
 
 -- FIXME: Should actually parse the list from the contents of the .cabal file
 cabalBuildDepends :: String -> [String]
-cabalBuildDepends _ = packages ++ ["unix" | os /= "mingw32"]
+cabalBuildDepends _ = packages ++ ["unix" | not isWindows]
 
-packages = words
-    ("base transformers binary unordered-containers hashable time bytestring " ++
-     "filepath directory process deepseq random utf8-string extra js-jquery js-flot") ++
-    ["old-time" | compilerVersion < makeVersion [7,6]]
+packages = words $
+    "base transformers binary unordered-containers hashable heaps time bytestring primitive " ++
+    "filepath directory process deepseq random utf8-string extra js-dgtable js-jquery js-flot filepattern"
diff --git a/src/Test/SelfMake.hs b/src/Test/SelfMake.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/SelfMake.hs
@@ -0,0 +1,54 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, TypeFamilies #-}
+
+module Test.SelfMake(main) where
+
+import Development.Shake
+import Development.Shake.Classes
+import Development.Shake.FilePath
+import Development.Shake.Util
+import Test.Self(cabalBuildDepends)
+import Test.Type
+
+import Data.List.Extra
+
+
+newtype GhcPkg = GhcPkg () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
+newtype GhcFlags = GhcFlags () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
+
+type instance RuleResult GhcPkg = [String]
+type instance RuleResult GhcFlags = [String]
+
+-- Doesn't work on CI, seems self-building under `cabal test` is just hard
+main = testBuild (notCI . defaultTest) $ do
+    want ["Main" <.> exe]
+
+    ghcPkg <- addOracleHash $ \GhcPkg{} -> do
+        Stdout out <- quietly $ cmd "ghc-pkg list --simple-output"
+        pure $ words out
+
+    ghcFlags <- addOracleHash $ \GhcFlags{} ->
+        map ("-package=" ++) <$> readFileLines ".pkgs"
+
+    let ghc args = do
+            trackAllow ["**/package.cache", "**/.ghc.environment.*"]
+            -- since ghc-pkg includes the ghc package, it changes if the version does
+            ghcPkg $ GhcPkg ()
+            flags <- ghcFlags $ GhcFlags ()
+            cmd "ghc" flags args
+
+    "Main" <.> exe %> \out -> do
+        let run = shakeRoot </> "src/Run.hs"
+        copyFileChanged (shakeRoot </> "src" </> "Paths.hs") "Paths_shake.hs"
+        let flags =
+                ["-i" ++ shakeRoot </> "src","-dep-suffix=.","-main-is","Run.main"
+                ,"-hide-all-packages","-outputdir=."
+                ,"-DPORTABLE","-fwarn-unused-imports","-Werror"] -- to test one CPP branch
+
+        trackAllow ["**/*.o","**/*.hi","Makefile"]
+        ghc $ ["-M",run] ++ flags
+        need . concatMap (filter (\x -> takeExtension x == ".hs") . snd) . parseMakefile =<< liftIO (readFile "Makefile")
+        ghc $ ["-o",out,run,"-j4"] ++ flags
+
+    ".pkgs" %> \out -> do
+        src <- readFile' $ shakeRoot </> "shake.cabal"
+        writeFileLines out $ sort $ cabalBuildDepends src
diff --git a/src/Test/Tar.hs b/src/Test/Tar.hs
--- a/src/Test/Tar.hs
+++ b/src/Test/Tar.hs
@@ -2,12 +2,13 @@
 module Test.Tar(main) where
 
 import Development.Shake
+import System.FilePath
 import Test.Type
 
 
-main = shaken noTest $ \args obj -> do
-    want [obj "result.tar"]
-    obj "result.tar" %> \out -> do
-        contents <- readFileLines "src/Test/Tar/list.txt"
+main = testBuild defaultTest $ do
+    want ["result.tar"]
+    "result.tar" %> \out -> do
+        contents <- fmap (map (shakeRoot </>)) $ readFileLines $ shakeRoot </> "src/Test/Tar/list.txt"
         need contents
         cmd "tar -cf" [out] contents
diff --git a/src/Test/Targets.hs b/src/Test/Targets.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Targets.hs
@@ -0,0 +1,60 @@
+module Test.Targets(main) where
+
+import Development.Shake
+import Development.Shake.Internal.Core.Rules (getHelpSuffix)
+import Test.Type
+
+main :: IO () -> IO ()
+main _sleeper = do
+    targets <- getTargets shakeOptions rules
+    targets === expected
+    helpSuffix <- getHelpSuffix shakeOptions rules
+    helpSuffix === ["Don't Panic", "Know where your towel is"]
+
+rules :: Rules ()
+rules = do
+    withTargetDocs "A phony target" $ phony "phony1" $ pure ()
+
+    "file1" %> \_ -> pure ()
+    ["file2", "file3"] |%> \_ -> pure ()
+    ["file4", "file5"] &%> \_ -> pure ()
+
+    "file6" %> \_ -> pure ()
+    ["file7", "file8"] |%> \_ -> pure ()
+    ["file9", "file10"] &%> \_ -> pure ()
+
+    withTargetDocs "Builds something really good" $ phony "phony2" $ pure ()
+    withTargetDocs "bad docs" $ do
+        withTargetDocs "a great file" $ "file11" %> \_ -> pure ()
+        withTargetDocs "awesome files" $ ["file12", "file13"] &%> \_ -> pure ()
+        phony "Foo" $ pure ()
+        withoutTargets $ phony "Bar" $ pure ()
+
+    addHelpSuffix "Don't Panic"
+    addHelpSuffix "Know where your towel is"
+
+
+expected :: [(String, Maybe String)]
+expected =
+    [ "phony1" * Just "A phony target"
+
+    , "file1" *  Nothing
+    , "file2" *  Nothing
+    , "file3" *  Nothing
+    , "file4" *  Nothing
+    , "file5" *  Nothing
+
+    , "file6" *  Nothing
+    , "file7" *  Nothing
+    , "file8" *  Nothing
+    , "file9" *  Nothing
+    , "file10" * Nothing
+
+    , "phony2" * Just "Builds something really good"
+
+    , "file11" * Just "a great file"
+    , "file12" * Just "awesome files"
+    , "file13" * Just "awesome files"
+    , "Foo" * Just "bad docs"
+    ]
+    where (*) = (,)
diff --git a/src/Test/Thread.hs b/src/Test/Thread.hs
new file mode 100644
--- /dev/null
+++ b/src/Test/Thread.hs
@@ -0,0 +1,69 @@
+{-# LANGUAGE ScopedTypeVariables, TupleSections #-}
+
+module Test.Thread(main) where
+
+import General.Cleanup
+import General.Thread
+import Control.Exception.Extra
+import Control.Concurrent.Extra
+import Data.Either.Extra
+import Data.IORef
+import Test.Type
+
+
+main = testSimple $ do
+    ref <- newIORef 0
+    let finish = atomicModifyIORef ref $ \x -> (x+1, ())
+    let finished want = do
+            got <- atomicModifyIORef ref (0,)
+            want === got
+
+    pauser <- newEmptyMVar
+    let pause = takeMVar pauser
+    let unpause = putMVar pauser ()
+
+    let isAnswer x act = do
+            r <- assertWithin 1 $ try_ act
+            mapLeft show r === Right x
+    let isException x act = do
+            r <- assertWithin 1 $ try_ act
+            mapLeft fromException r === Left (Just x)
+
+    putStrLn "## allocateThread, spanwed finishes first"
+    isAnswer 1 $ withCleanup $ \cleanup -> do
+        allocateThread cleanup finish
+        sleep 0.1
+        pure 1
+    finished 1
+
+    putStrLn "## allocateThread, main finishes first"
+    isAnswer 1 $ withCleanup $ \cleanup -> do
+        allocateThread cleanup $ (unpause >> sleep 100) `finally` finish
+        pause
+        pure 1
+    finished 1
+
+    putStrLn "## allocateThread, spawned throws an exception"
+    isException Overflow $ withCleanup $ \cleanup -> do
+        allocateThread cleanup $ pause >> throw Overflow
+        (unpause >> sleep 100) `finally` finish
+    finished 1
+
+    putStrLn "## allocateThread, main throws an exception"
+    isException Overflow $ withCleanup $ \cleanup -> do
+        allocateThread cleanup $ (unpause >> sleep 100) `finally` finish
+        pause
+        throw Overflow
+        pure 1
+    finished 1
+
+    putStrLn "## withThreadsBoth, both succeed"
+    isAnswer (2,3) $ withThreadsBoth (pure 2) (pure 3)
+
+    putStrLn "## withThreadsBoth, left fails"
+    isException Overflow $ withThreadsBoth (pause >> throw Overflow >> pure 1) ((unpause >> pure 3) `finally` finish)
+    finished 1
+
+    putStrLn "## withThreadsBoth, right fails"
+    isException Overflow $ withThreadsBoth ((unpause >> pure 3) `finally` finish) (pause >> throw Overflow >> pure 1)
+    finished 1
diff --git a/src/Test/Tup.hs b/src/Test/Tup.hs
--- a/src/Test/Tup.hs
+++ b/src/Test/Tup.hs
@@ -6,38 +6,39 @@
 import Development.Shake.FilePath
 import Development.Shake.Util
 import Test.Type
-import Control.Applicative
 import Data.Maybe
-import Prelude
+import Control.Monad
+import System.Info.Extra
 
 
-main = shaken noTest $ \args obj -> do
+-- Running ar on Mac seems to break in CI - not sure why
+main = testBuild (unless isMac . defaultTest) $ do
     -- Example inspired by http://gittup.org/tup/ex_multiple_directories.html
-    usingConfigFile "src/Test/Tup/root.cfg"
+    usingConfigFile $ shakeRoot </> "src/Test/Tup/root.cfg"
 
     action $ do
         keys <- getConfigKeys
-        need [obj $ x -<.> exe | x <- keys, takeExtension x == ".exe"]
+        need [x -<.> exe | x <- keys, takeExtension x == ".exe"]
 
     let objects dir key = do
-            let f x | takeExtension x == ".c" = obj $ dir </> x -<.> "o"
-                    | takeExtension x == ".a" = obj $ takeBaseName x </> "lib" ++ x
+            let f x | takeExtension x == ".c" = dir </> x -<.> "o"
+                    | takeExtension x == ".a" = takeBaseName x </> "lib" ++ x
                     | otherwise = error $ "Unknown extension, " ++ x
             x <- fromMaybe (error $ "Missing config key, " ++ key) <$> getConfig key
-            return $ map f $ words x
+            pure $ map f $ words x
 
     (\x -> x -<.> exe == x) ?> \out -> do
         os <- objects "" $ takeBaseName out <.> "exe"
         need os
         cmd "gcc" os "-o" [out]
 
-    obj "//lib*.a" %> \out -> do
+    "//lib*.a" %> \out -> do
         os <- objects (drop 3 $ takeBaseName out) $ drop 3 $ takeFileName out
         need os
         cmd "ar crs" [out] os
 
-    obj "//*.o" %> \out -> do
-        let src = "src/Test/Tup" </> unobj out -<.> "c"
+    "//*.o" %> \out -> do
+        let src = shakeRoot </> "src/Test/Tup" </> out -<.> "c"
         need [src]
-        () <- cmd "gcc -c -MMD -MF" [out -<.> "d"] [src] "-o" [out] "-O2 -Wall -Isrc/Test/Tup/newmath"
+        cmd_ "gcc -c -MMD -MF" [out -<.> "d"] [src] "-o" [out] "-O2 -Wall" ["-I" ++ shakeRoot </> "src/Test/Tup/newmath"]
         neededMakefileDependencies $ out -<.> "d"
diff --git a/src/Test/Tup/root.cfg b/src/Test/Tup/root.cfg
--- a/src/Test/Tup/root.cfg
+++ b/src/Test/Tup/root.cfg
@@ -1,4 +1,4 @@
 
 hello.exe = hello.c newmath.a
 
-include src/Test/Tup/newmath/root.cfg
+include ../../src/Test/Tup/newmath/root.cfg
diff --git a/src/Test/Type.hs b/src/Test/Type.hs
--- a/src/Test/Type.hs
+++ b/src/Test/Type.hs
@@ -1,178 +1,264 @@
+{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-}
 
-module Test.Type(sleep, module Test.Type) where
+module Test.Type(
+    sleep, sleepFileTime, sleepFileTimeCalibrate,
+    testBuildArgs, testBuild, testSimple, testNone,
+    shakeRoot,
+    defaultTest, hasTracker, notCI, notWindowsCI, notMacCI,
+    copyDirectoryChanged, copyFileChangedIO,
+    assertWithin,
+    assertBool, assertBoolIO, assertException, assertExceptionAfter,
+    assertContents, assertContentsUnordered, assertContentsWords, assertContentsInfix,
+    assertExists, assertMissing,
+    assertTimings,
+    (===),
+    (&?%>),
+    Pat(PatWildcard), pat,
+    BinarySentinel(..), RandomType(..),
+    ) where
 
-import Development.Shake hiding (copyFileChanged)
+import Development.Shake
+import Development.Shake.Classes
 import Development.Shake.Forward
-import Development.Shake.Rule() -- ensure the module gets imported, and thus tested
-import General.String
+import Development.Shake.Internal.FileName
 import General.Extra
-import Development.Shake.FileInfo
+import Development.Shake.Internal.FileInfo
 import Development.Shake.FilePath
-import Paths_shake
+import Development.Shake.Internal.Paths
 
-import Control.Exception.Extra hiding (assert)
+import Control.Exception.Extra
 import Control.Monad.Extra
-import Data.List
+import Data.List.Extra
+import Text.Read(readMaybe)
 import Data.Maybe
-import qualified Data.ByteString as BS
+import Data.Either
+import Data.Typeable
 import System.Directory.Extra as IO
-import System.Environment.Extra
+import System.Environment
 import System.Random
-import System.Console.GetOpt
+import General.GetOpt
 import System.IO.Extra as IO
 import System.Time.Extra
-import Prelude
+import System.Info.Extra
 
 
-shaken, shakenCwd
-    :: (([String] -> IO ()) -> (String -> String) -> IO ())
-    -> ([String] -> (String -> String) -> Rules ())
+testBuildArgs
+    :: (([String] -> IO ()) -> IO ()) -- ^ The test driver
+    -> [OptDescr (Either String a)] -- ^ Arguments the test can accept
+    -> ([a] -> Rules ()) -- ^ The Shake script under test
+    -> IO () -- ^ Sleep function, driven by passing @--sleep@
     -> IO ()
+testBuildArgs f opts g = shakenEx False opts f
+    (\os args -> if null args then g os else want args >> withoutActions (g os))
+
+testBuild
+    :: (([String] -> IO ()) -> IO ()) -- ^ The test driver
+    -> Rules () -- ^ The Shake script under test
+    -> IO () -- ^ Sleep function, driven by passing @--sleep@
     -> IO ()
-shaken = shakenEx False
-shakenCwd = shakenEx True
+testBuild f g = testBuildArgs f [] (const g)
 
+testSimple :: IO () -> IO () -> IO ()
+testSimple act = testBuild (const act) (pure ())
+
+testNone :: IO () -> IO ()
+testNone _ = pure ()
+
 shakenEx
     :: Bool
-    -> (([String] -> IO ()) -> (String -> String) -> IO ())
-    -> ([String] -> (String -> String) -> Rules ())
+    -> [OptDescr (Either String a)]
+    -> (([String] -> IO ()) -> IO ())
+    -> ([a] -> [String] -> Rules ())
     -> IO ()
     -> IO ()
-shakenEx changeDir test rules sleeper = do
-    -- my debug getDataFileName (in Paths) uses a cache of the Cwd
-    -- make sure we force the cache before changing directory
-    getDataFileName ""
+shakenEx reenter options test rules sleeper = do
+    initDataDirectory
 
     name:args <- getArgs
-    when ("--sleep" `elem` args) sleeper
     putStrLn $ "## BUILD " ++ unwords (name:args)
     let forward = "--forward" `elem` args
-    args <- return $ args \\ ["--sleep","--forward"]
-    cwd <- getCurrentDirectory
+    args <- pure $ delete "--forward" args
     let out = "output/" ++ name ++ "/"
-    let obj x | changeDir = if null x then "." else x
-              | otherwise = if "/" `isPrefixOf` x || null x then init out ++ x else out ++ x
-    let change = if changeDir then withCurrentDirectory out else id
-    let unchange act = do
-            new <- getCurrentDirectory
-            withCurrentDirectory cwd $ do act; createDirectoryIfMissing True new -- to deal with clean
-    createDirectoryIfMissing True out
+    let change = if not reenter then withCurrentDirectory out else id
+    let clean = do
+            now <- getCurrentDirectory
+            when (takeBaseName now /= name) $
+                fail $ "Clean went horribly wrong! Dangerous deleting: " ++ show now
+            withCurrentDirectory (now </> "..") $ do
+                removePathForcibly now
+                createDirectoryRecursive now
+    unless reenter $ createDirectoryRecursive out
     case args of
-        "test":extra -> do
+        "test":_ -> do
             putStrLn $ "## TESTING " ++ name
-            -- if the extra arguments are not --quiet/--loud it's probably going to go wrong
-            change $ test (\args -> withArgs (name:args ++ extra) $ unchange $ shakenEx changeDir test rules sleeper) obj
+            change $ test (\args -> withArgs (name:args) $ shakenEx True options test rules sleeper)
             putStrLn $ "## FINISHED TESTING " ++ name
 
-        "clean":_ -> removeDirectoryRecursive out
+        "clean":args -> do
+            when (args /= []) $ fail "Unexpected additional arguments to 'clean'"
+            change clean
 
         "perturb":args -> forever $ do
             del <- removeFilesRandom out
             threads <- randomRIO (1,4)
             putStrLn $ "## TESTING PERTURBATION (" ++ show del ++ " files, " ++ show threads ++ " threads)"
-            shake shakeOptions{shakeFiles=out, shakeThreads=threads, shakeVerbosity=Quiet} $ rules args (out++)
+            shake shakeOptions{shakeFiles=out, shakeThreads=threads, shakeVerbosity=Error} $ rules [] args
 
-        args -> do
+        args -> change $ do
             t <- tracker
-            let (_,files,_) = getOpt Permute [] args
-            opts <- return $ shakeOptions
-                {shakeFiles = obj ""
-                ,shakeReport = [obj "report.html"]}
-            opts <- return $ if forward then forwardOptions opts else opts
+            opts <- pure shakeOptions{shakeFiles = "."}
+            cwd <- getCurrentDirectory
+            opts <- pure $ if forward then forwardOptions opts{shakeLintInside=[""]} else opts
                 {shakeLint = Just t
-                ,shakeLintInside = [cwd]
-                ,shakeLintIgnore = map (cwd </>) [".cabal-sandbox//",".stack-work//"]}
-            withArgs (args \\ files) $
-                change $ shakeWithClean
-                    (unchange $ removeDirectoryRecursive out)
-                    opts
-                    -- if you have passed sleep, supress the "no errors" warning
-                    (do rules files obj; when ("--sleep" `elem` args) $ action $ return ())
+                ,shakeLintInside = [cwd </> ".." </> ".."]
+                ,shakeLintIgnore = [".cabal-sandbox/**",".stack-work/**","../../.stack-work/**"]}
+            withArgs args $ do
+                let optionsBuiltin = optionsEnumDesc
+                        [(Clean, "Clean before building.")
+                        ,(Sleep, "Pause before executing.")
+                        ,(UsePredicate, "Use &?> in preference to &%>")]
+                shakeArgsOptionsWith opts (optionsBuiltin `mergeOptDescr` options) $ \so extra files -> do
+                    let (extra1, extra2) = partitionEithers extra
+                    when (Clean `elem` extra1) clean
+                    when (Sleep `elem` extra1) sleeper
+                    so <- pure $ if UsePredicate `notElem` extra1 then so else
+                        so{shakeExtra = addShakeExtra UsePredicateYes $ shakeExtra so}
+                    if "clean" `elem` files then
+                        clean >> pure Nothing
+                    else pure $ Just $ (,) so $ do
+                        -- if you have passed sleep, suppress the "no actions" warning
+                        when (Sleep `elem` extra1) $ action $ pure ()
+                        rules extra2 files
 
+data Flags
+    = Clean -- ^ Clean all the files before starting
+    | Sleep -- ^ Call 'sleepFileTimeCalibrate' before starting
+    | UsePredicate -- ^ Use &?> in preference to &%>
+      deriving (Eq,Show)
 
+data UsePredicateYes = UsePredicateYes deriving Typeable
+
+(&?%>) :: [FilePattern] -> ([FilePath] -> Action ()) -> Rules ()
+deps &?%> act = do
+    so :: Maybe UsePredicateYes <- getShakeExtraRules
+    if isJust so
+        then (\x -> if x `elem` deps then Just deps else Nothing) &?> act
+        else deps &%> act
+
+-- A way to get back to the source files after you get directory changed
+shakeRoot :: FilePath
+shakeRoot = "../.."
+
 tracker :: IO Lint
 tracker = do
-  fsatrace <- findExecutable $ "fsatrace" <.> exe
-  return $ if isJust fsatrace
-           then LintFSATrace
-           else LintBasic
+    fsatrace <- findExecutable $ "fsatrace" <.> exe
+    -- Tracking on a Mac is pretty unreliable
+    pure $ if not isMac && isJust fsatrace then LintFSATrace else LintBasic
 
-hasTracker :: IO Bool
-hasTracker = do
-  t <- tracker
-  return $ t == LintFSATrace
+-- Tests that don't currently work on CI
+notCI :: IO () -> IO ()
+notCI act = do
+    b <- lookupEnv "CI"
+    when (isNothing b) act
 
+-- Tests that don't currently work on Windows CI
+notWindowsCI :: IO () -> IO ()
+notWindowsCI = if isWindows then notCI else id
 
-shakeWithClean :: IO () -> ShakeOptions -> Rules () -> IO ()
-shakeWithClean clean opts rules = shakeArgsWith opts [cleanOpt] f
-    where
-        cleanOpt = Option "c" ["clean"] (NoArg $ Right ()) "Clean before building."
+-- Tests that don't currently work on Mac CI
+notMacCI :: IO () -> IO ()
+notMacCI = if isMac then notCI else id
 
-        f extra files = do
-            when (extra /= []) clean
-            if "clean" `elem` files then
-                clean >> return Nothing
-             else
-                return $ Just $ if null files then rules else want files >> withoutActions rules
+hasTracker :: IO Bool
+hasTracker = do
+    t <- tracker
+    pure $ t == LintFSATrace
 
+assertFail :: String -> IO a
+assertFail msg = error $ "ASSERTION FAILED: " ++ msg
 
-unobj :: FilePath -> FilePath
-unobj = dropDirectory1 . dropDirectory1
+assertBool :: Bool -> String -> IO ()
+assertBool b msg = unless b $ assertFail msg
 
-assert :: Bool -> String -> IO ()
-assert b msg = unless b $ error $ "ASSERTION FAILED: " ++ msg
+assertBoolIO :: IO Bool -> String -> IO ()
+assertBoolIO b msg = do b <- b; assertBool b msg
 
 infix 4 ===
 
 (===) :: (Show a, Eq a) => a -> a -> IO ()
-a === b = assert (a == b) $ "failed in ===\nLHS: " ++ show a ++ "\nRHS: " ++ show b
+a === b = assertBool (a == b) $ "failed in ===\nLHS: " ++ show a ++ "\nRHS: " ++ show b
 
 
 assertExists :: FilePath -> IO ()
 assertExists file = do
     b <- IO.doesFileExist file
-    assert b $ "File was expected to exist, but is missing: " ++ file
+    assertBool b $ "File was expected to exist, but is missing: " ++ file
 
 assertMissing :: FilePath -> IO ()
 assertMissing file = do
     b <- IO.doesFileExist file
-    assert (not b) $ "File was expected to be missing, but exists: " ++ file
+    assertBool (not b) $ "File was expected to be missing, but exists: " ++ file
 
+assertWithin :: Seconds -> IO a -> IO a
+assertWithin n act = do
+    t <- timeout n act
+    case t of
+        Nothing -> assertFail $ "Expected to complete within " ++ show n ++ " seconds, but did not"
+        Just v -> pure v
+
 assertContents :: FilePath -> String -> IO ()
 assertContents file want = do
     got <- IO.readFile' file
-    assert (want == got) $ "File contents are wrong: " ++ file ++ "\nWANT: " ++ want ++ "\nGOT: " ++ got
+    assertBool (want == got) $ "File contents are wrong: " ++ file ++ "\nWANT: " ++ want ++ "\nGOT: " ++ got
 
+assertContentsInfix :: FilePath -> String -> IO ()
+assertContentsInfix file want = do
+    got <- IO.readFile' file
+    assertBool (want `isInfixOf` got) $ "File contents are wrong: " ++ file ++ "\nWANT (infix): " ++ want ++ "\nGOT: " ++ got
+
 assertContentsOn :: (String -> String) -> FilePath -> String -> IO ()
 assertContentsOn f file want = do
     got <- IO.readFile' file
-    assert (f want == f got) $ "File contents are wrong: " ++ file ++ "\nWANT: " ++ want ++ "\nGOT: " ++ got ++
-                               "\nWANT (transformed): " ++ f want ++ "\nGOT (transformed): " ++ f got
+    assertBool (f want == f got) $ "File contents are wrong: " ++ file ++ "\nWANT: " ++ want ++ "\nGOT: " ++ got ++
+                                   "\nWANT (transformed): " ++ f want ++ "\nGOT (transformed): " ++ f got
 
 assertContentsWords :: FilePath -> String -> IO ()
 assertContentsWords = assertContentsOn (unwords . words)
 
-
-assertContentsInfix :: FilePath -> String -> IO ()
-assertContentsInfix file want = do
-    got <- IO.readFile' file
-    assert (want `isInfixOf` got) $ "File contents are wrong: " ++ file ++ "\nWANT (anywhere): " ++ want ++ "\nGOT: " ++ got
-
 assertContentsUnordered :: FilePath -> [String] -> IO ()
 assertContentsUnordered file xs = assertContentsOn (unlines . sort . lines) file (unlines xs)
 
-assertException :: [String] -> IO () -> IO ()
-assertException parts act = do
+assertExceptionAfter :: (String -> String) -> [String] -> IO a -> IO ()
+assertExceptionAfter tweak parts act = do
     res <- try_ act
     case res of
-        Left err -> let s = show err in forM_ parts $ \p ->
-            assert (p `isInfixOf` s) $ "Incorrect exception, missing part:\nGOT: " ++ s ++ "\nWANTED: " ++ p
+        Left err -> let s = tweak $ show err in forM_ parts $ \p ->
+            assertBool (p `isInfixOf` s) $ "Incorrect exception, missing part:\nGOT: " ++ s ++ "\nWANTED: " ++ p
         Right _ -> error $ "Expected an exception containing " ++ show parts ++ ", but succeeded"
 
+assertException :: [String] -> IO a -> IO ()
+assertException = assertExceptionAfter id
 
-noTest :: ([String] -> IO ()) -> (String -> String) -> IO ()
-noTest build obj = do
-    build ["--abbrev=output=$OUT","-j3"]
+assertTimings :: ([String] -> IO ()) -> [(String, Seconds)] -> IO ()
+assertTimings build expect = do
+    build ["--report=report.json","--no-build"]
+    src <- IO.readFile' "report.json"
+    let f ('[':'\"':xs)
+            | (name,_:',':xs) <- break (== '\"') xs
+            , num <- takeWhile (`notElem` ",]") xs
+            , Just num <- readMaybe num
+            = (name, num :: Double)
+        f x = error $ "Failed to parse JSON output in assertTimings, " ++ show x
+    let got = [f x | x <- map drop1 $ lines src, x /= ""]
+    forM_ expect $ \(name, val) ->
+        case lookup name got of
+            Nothing -> assertFail $ "Couldn't find key " ++ show name ++ " in profiling output"
+            Just v -> assertBool (v >= val && v < (val + 1)) $ "Unexpected value, got " ++ show v ++ ", hoping for " ++ show val ++ " (+ 1 sec)"
+
+
+defaultTest :: ([String] -> IO ()) -> IO ()
+defaultTest build = do
+    build ["--abbrev=output=$OUT","-j3","--report"]
     build ["--no-build","--report=-"]
     build []
 
@@ -182,22 +268,22 @@
 sleepFileTime = sleep 1
 
 
-sleepFileTimeCalibrate :: IO (IO ())
-sleepFileTimeCalibrate = do
-    let file = "output/calibrate"
-    createDirectoryIfMissing True $ takeDirectory file
+sleepFileTimeCalibrate :: FilePath -> IO (IO ())
+sleepFileTimeCalibrate file = do
+    createDirectoryRecursive $ takeDirectory file
     -- with 10 measurements can get a bit slow, see #451
     -- if it rounds to a second then 1st will be a fraction, but 2nd will be full second
     mtimes <- forM [1..2] $ \i -> fmap fst $ duration $ do
         writeFile file $ show i
-        let time = fmap (fst . fromMaybe (error "File missing during sleepFileTimeCalibrate")) $ getFileInfo $ packU file
+        let time = fmap (fst . fromMaybe (error "File missing during sleepFileTimeCalibrate")) $
+                        getFileInfo False $ fileNameFromString file
         t1 <- time
         flip loopM 0 $ \j -> do
             writeFile file $ show (i,j)
             t2 <- time
-            return $ if t1 == t2 then Left $ j+1 else Right ()
+            pure $ if t1 == t2 then Left $ j+1 else Right ()
     putStrLn $ "Longest file modification time lag was " ++ show (ceiling (maximum' mtimes * 1000)) ++ "ms"
-    return $ sleep $ min 1 $ maximum' mtimes * 2
+    pure $ sleep $ min 1 $ maximum' mtimes * 2
 
 
 removeFilesRandom :: FilePath -> IO Int
@@ -206,7 +292,7 @@
     n <- randomRIO (0,length files)
     rs <- replicateM (length files) (randomIO :: IO Double)
     mapM_ (removeFile . snd) $ sort $ zip rs files
-    return n
+    pure n
 
 
 getDirectoryContentsRecursive :: FilePath -> IO [FilePath]
@@ -214,7 +300,7 @@
     xs <- IO.getDirectoryContents dir
     (dirs,files) <- partitionM IO.doesDirectoryExist [dir </> x | x <- xs, not $ "." `isPrefixOf` x]
     rest <- concatMapM getDirectoryContentsRecursive dirs
-    return $ files++rest
+    pure $ files++rest
 
 
 copyDirectoryChanged :: FilePath -> FilePath -> IO ()
@@ -222,12 +308,44 @@
     xs <- getDirectoryContentsRecursive old
     forM_ xs $ \from -> do
         let to = new </> drop (length $ addTrailingPathSeparator old) from
-        createDirectoryIfMissing True $ takeDirectory to
-        copyFileChanged from to
+        createDirectoryRecursive $ takeDirectory to
+        copyFileChangedIO from to
 
 
-copyFileChanged :: FilePath -> FilePath -> IO ()
-copyFileChanged old new = do
-    good <- IO.doesFileExist new
-    good <- if not good then return False else liftM2 (==) (BS.readFile old) (BS.readFile new)
-    unless good $ copyFile old new
+copyFileChangedIO :: FilePath -> FilePath -> IO ()
+copyFileChangedIO old new =
+    unlessM (liftIO $ IO.doesFileExist new &&^ IO.fileEq old new) $
+        copyFile old new
+
+-- The operators %> ?> &*> &?> |?> |*> all have an isomorphism
+data Pat = PatWildcard | PatPredicate | PatOrWildcard | PatAndWildcard | PatAndPredicate
+    deriving (Read, Show, Enum, Bounded)
+
+pat :: Pat -> FilePattern -> (FilePath -> Action ()) -> Rules ()
+pat PatWildcard p act = p %> act
+pat PatPredicate p act = (p ?==) ?> act
+pat PatOrWildcard p act = [p] |%> act
+pat PatAndWildcard p act =
+    -- single wildcard shortcircuits, so we use multiple to avoid that
+    -- and thus have to fake writing an extra file
+    [p, p ++ "'"] &%> \[x,x'] -> do act x; writeFile' x' ""
+pat PatAndPredicate p act = (\x -> if p ?== x then Just [x] else Nothing) &?> \[x] -> act x
+
+
+---------------------------------------------------------------------
+-- TEST MATERIAL
+-- Some errors require multiple modules to replicate (e.g. #506), so put that here
+
+newtype BinarySentinel a = BinarySentinel ()
+    deriving (Eq,Show,NFData,Typeable,Hashable)
+
+instance forall a . Typeable a => Binary (BinarySentinel a) where
+    put (BinarySentinel ()) = put $ show (typeRep (Proxy :: Proxy a))
+    get = do
+        x <- get
+        let want = show (typeRep (Proxy :: Proxy a))
+        if x == want then pure $ BinarySentinel () else
+            error $ "BinarySentinel failed, got " ++ show x ++ " but wanted " ++ show want
+
+newtype RandomType = RandomType (BinarySentinel ())
+    deriving (Eq,Show,NFData,Typeable,Hashable,Binary)
diff --git a/src/Test/Unicode.hs b/src/Test/Unicode.hs
--- a/src/Test/Unicode.hs
+++ b/src/Test/Unicode.hs
@@ -4,9 +4,10 @@
 import Development.Shake
 import Development.Shake.FilePath
 import Test.Type
-import Control.Exception.Extra
+import Data.List.Extra
+import General.GetOpt
 import Control.Monad
-import System.Directory(createDirectoryIfMissing)
+import GHC.IO.Encoding
 
 
 -- | Decode a dull ASCII string to certain unicode points, necessary because
@@ -17,44 +18,49 @@
 decode (x:xs) = x : decode xs
 decode [] = []
 
+data Arg = Prefix String | Want String
+opts =
+    [Option "" ["prefix"] (ReqArg (Right . Prefix) "") ""
+    ,Option "" ["want"] (ReqArg (Right . Want) "") ""]
 
-main = shakenCwd test $ \xs obj -> do
-    let pre:args = map decode xs
-    want $ map obj args
+main = testBuildArgs test opts $ \xs -> do
+    let pre = lastDef "" [decode x | Prefix x <- xs :: [Arg]]
+    want [decode x | Want x <- xs]
 
-    obj (pre ++ "dir/*") %> \out -> do
+    pre ++ "dir/*" %> \out -> do
         let src = takeDirectory (takeDirectory out) </> takeFileName out
         copyFile' src out
 
-    obj (pre ++ ".out") %> \out -> do
-        a <- readFile' $ obj $ pre ++ "dir" </> pre <.> "source"
-        b <- readFile' $ obj pre <.> "multi1"
+    pre ++ ".out" %> \out -> do
+        a <- readFile' $ pre ++ "dir" </> pre <.> "source"
+        b <- readFile' $ pre <.> "multi1"
         writeFile' out $ a ++ b
 
-    map obj ["*.multi1","*.multi2"] &%> \[m1,m2] -> do
+    ["*.multi1","*.multi2"] &%> \[m1,m2] -> do
         b <- doesFileExist $ m1 -<.> "exist"
         writeFile' m1 $ show b
         writeFile' m2 $ show b
 
 
-test build obj = do
+test build = do
     build ["clean"]
     -- Useful, if the error message starts crashing...
     -- IO.hSetEncoding IO.stdout IO.char8
     -- IO.hSetEncoding IO.stderr IO.char8
     forM_ ["normal","e^",":)","e^-:)"] $ \pre -> do
-        createDirectoryIfMissing True $ obj ""
-        let ext x = obj $ decode pre <.> x
-        res <- try_ $ writeFile (ext "source") "x"
-        case res of
-            Left err ->
-                putStrLn $ "WARNING: Failed to write file " ++ pre ++ ", skipping unicode test (LANG=C ?)"
-            Right _ -> do
-                build [pre,pre <.> "out","--sleep"]
+        -- If you aren't on UTF-8 file encoding it goes wrong, see
+        -- https://github.com/ndmitchell/shake/pull/681
+        enc <- liftIO getFileSystemEncoding
+        if textEncodingName enc /= "UTF-8"
+        then putStrLn "WARNING: filesystem encoding is not UTF-8, skipping unicode test (LANG=C ?)"
+        else do
+                let ext x = decode pre <.> x
+                writeFile (ext "source") "x"
+                build ["--prefix=" ++ pre, "--want=" ++ pre <.> "out", "--sleep"]
                 assertContents (ext "out") $ "x" ++ "False"
                 writeFile (ext "source") "y"
-                build [pre,pre <.> "out","--sleep"]
+                build ["--prefix=" ++ pre, "--want=" ++ pre <.> "out", "--sleep"]
                 assertContents (ext "out") $ "y" ++ "False"
                 writeFile (ext "exist") ""
-                build [pre,pre <.> "out"]
+                build ["--prefix=" ++ pre, "--want=" ++ pre <.> "out"]
                 assertContents (ext "out") $ "y" ++ "True"
diff --git a/src/Test/Util.hs b/src/Test/Util.hs
--- a/src/Test/Util.hs
+++ b/src/Test/Util.hs
@@ -5,10 +5,7 @@
 import Test.Type
 
 
-main = shakenCwd test $ \args obj -> return ()
-
-
-test build obj = do
+main = testSimple $ do
     parseMakefile "" === []
     parseMakefile "a:b c\ndef : ee" === [("a",["b","c"]),("def",["ee"])]
     parseMakefile "a: #comment\n#comment : b\nc : d" === [("a",[]),("c",["d"])]
diff --git a/src/Test/Verbosity.hs b/src/Test/Verbosity.hs
--- a/src/Test/Verbosity.hs
+++ b/src/Test/Verbosity.hs
@@ -5,35 +5,33 @@
 import Test.Type
 
 
-main = shakenCwd test $ \args obj -> do
-    want $ map obj args
-
-    obj "in.txt" %> \out -> do
+main = testBuild test $ do
+    "in.txt" %> \out -> do
         a <- getVerbosity
-        b <- withVerbosity Normal getVerbosity
+        b <- withVerbosity Info getVerbosity
         writeFile' out $ unwords $ map show [a,b]
 
-    obj "out.txt" %> \out -> do
+    "out.txt" %> \out -> do
         x <- getVerbosity
-        ys <- withVerbosity Loud $ do
+        ys <- withVerbosity Verbose $ do
             a <- getVerbosity
-            need [obj "in.txt"] -- make sure the inherited verbosity does not get passed along
+            need ["in.txt"] -- make sure the inherited verbosity does not get passed along
             b <- getVerbosity
             c <- quietly getVerbosity
             d <- fmap shakeVerbosity getShakeOptions
-            return [a,b,c,d]
+            pure [a,b,c,d]
         z <- getVerbosity
         writeFile' out $ unwords $ map show $ [x] ++ ys ++ [z]
 
-test build obj = do
+test build = do
     build ["out.txt","--clean"]
-    assertContents (obj "in.txt") "Normal Normal"
-    assertContents (obj "out.txt") "Normal Loud Loud Quiet Normal Normal"
+    assertContents "in.txt" "Info Info"
+    assertContents "out.txt" "Info Verbose Verbose Error Info Info"
 
     build ["out.txt","--clean","--verbose"]
-    assertContents (obj "in.txt") "Loud Normal"
-    assertContents (obj "out.txt") "Loud Loud Loud Quiet Loud Loud"
+    assertContents "in.txt" "Verbose Info"
+    assertContents "out.txt" "Verbose Verbose Verbose Error Verbose Verbose"
 
     build ["out.txt","--clean","--quiet"]
-    assertContents (obj "in.txt") "Quiet Normal"
-    assertContents (obj "out.txt") "Quiet Loud Loud Quiet Quiet Quiet"
+    assertContents "in.txt" "Warn Info"
+    assertContents "out.txt" "Warn Verbose Verbose Error Warn Warn"
diff --git a/src/Test/Version.hs b/src/Test/Version.hs
--- a/src/Test/Version.hs
+++ b/src/Test/Version.hs
@@ -1,33 +1,73 @@
+{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving, DeriveDataTypeable #-}
 
 module Test.Version(main) where
 
 import Development.Shake
+import Development.Shake.Classes
+import General.GetOpt
+import Data.List.Extra
+import Text.Read
 import Test.Type
 
 
-main = shakenCwd test $ \args obj -> do
-    want [obj "foo.txt"]
-    obj "foo.txt" %> \file -> liftIO $ appendFile file "x"
+newtype Opts = Ver Int
+opts = [Option "" ["ver"] (ReqArg (fmap Ver . readEither) "INT") ""]
 
-test build obj = do
-    writeFile (obj "foo.txt") ""
-    v1 <- getHashedShakeVersion [obj "foo.txt"]
-    writeFile (obj "foo.txt") "y"
-    v2 <- getHashedShakeVersion [obj "foo.txt"]
-    assert (v1 /= v2) "Hashes must not be equal"
+newtype Oracle = Oracle ()
+    deriving (Show,Eq,Hashable,Binary,NFData,Typeable)
+type instance RuleResult Oracle = Int
 
+main = testBuildArgs test opts $ \opts -> do
+    want ["foo.txt","ver.txt","oracle.txt"]
+
+    "foo.txt" %> \file -> liftIO $ appendFile file "x"
+
+    let ver = headDef 0 [x | Ver x <- opts]
+    versioned ver $ "ver.txt" %> \out -> liftIO $ appendFile out $ show ver
+
+    versioned ver $ addOracleCache $ \(Oracle ()) -> do
+        liftIO $ appendFile "oracle.in" $ show ver
+        pure $ ver `mod` 2
+    "oracle.txt" %> \out -> do
+        v <- askOracle $ Oracle ()
+        liftIO $ appendFile out $ show v
+
+
+test build = do
+    writeFile "foo.txt" ""
+    v1 <- getHashedShakeVersion ["foo.txt"]
+    writeFile "foo.txt" "y"
+    v2 <- getHashedShakeVersion ["foo.txt"]
+    assertBool (v1 /= v2) "Hashes must not be equal"
+
     build ["clean"]
     build []
-    assertContents (obj "foo.txt") "x"
-    build ["--rule-version=new","--silent"]
-    assertContents (obj "foo.txt") "xx"
+    assertContents "foo.txt" "x"
     build ["--rule-version=new"]
-    assertContents (obj "foo.txt") "xx"
+    assertContents "foo.txt" "xx"
+    build ["--rule-version=new"]
+    assertContents "foo.txt" "xx"
     build ["--rule-version=extra","--silent"]
-    assertContents (obj "foo.txt") "xxx"
+    assertContents "foo.txt" "xxx"
     build ["--rule-version=more","--no-rule-version"]
-    assertContents (obj "foo.txt") "xxx"
+    assertContents "foo.txt" "xxx"
     build ["--rule-version=more"]
-    assertContents (obj "foo.txt") "xxx"
+    assertContents "foo.txt" "xxx"
     build ["--rule-version=final","--silent"]
-    assertContents (obj "foo.txt") "xxxx"
+    assertContents "foo.txt" "xxxx"
+
+    build ["clean"]
+    build []
+    assertContents "ver.txt" "0"
+    assertContents "foo.txt" "x"
+    build ["--ver=0","--silent"]
+    assertContents "ver.txt" "0"
+    build ["--ver=8"]
+    build ["--ver=9","--silent"]
+    build ["--ver=9","--silent"]
+    build ["--ver=3","--silent"]
+    assertContents "ver.txt" "0893"
+    assertContents "oracle.in" "0893"
+    -- when you change version you don't do cutoff
+    assertContents "oracle.txt" "0011"
+    assertContents "foo.txt" "x"
