pcjs/docs/pcx86/examples/pcx86-dbg.js

1817 lines
402 KiB
JavaScript

(function(){/*
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
FPU instruction description excerpts from the PC Magazine "Programmer's Technical Reference:
The Processor and Coprocessor," Copyright 1992 by Ziff-Davis Press (ISBN 1-56276-016-5).
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
Jeff Parsons 2012-2016
This file is part of PCjs, a computer emulation software project at <http://pcjs.org/>.
PCjs is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
PCjs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with PCjs. If not,
see <http://www.gnu.org/licenses/gpl.html>.
You are required to include the above copyright notice in every source code file of every
copy or modified version of this work, and to display that copyright notice on every screen
that loads or runs any version of this software (see COPYRIGHT in /modules/shared/lib/defines.js).
Some PCjs files also attempt to load external resource files, such as character-image files,
ROM files, and disk image files. Those external resource files are not considered part of PCjs
for purposes of the GNU General Public License, and the author does not claim any copyright
as to their contents.
*/
var l,aa,ba={163840:[40,1,8],184320:[40,1,9],327680:[40,2,8],368640:[40,2,9],737280:[80,2,9],1228800:[80,2,15],1474560:[80,2,18],2949120:[80,2,36],21368320:[615,4,17]},p={uo:1,dl:3,vo:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,ue:65,Bi:66,Ci:67,Di:68,E:69,Ei:70,Fi:71,Gi:72,Hi:73,Ii:74,Ji:75,Ki:76,Li:77,Mi:78,Ni:79,Oi:80,Q:81,Pi:82,
Qi:83,Ri:84,Si:85,Ti:86,Ui:87,Vi:88,Wi:89,ng:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,ve:97,ol:98,ql:99,d:100,e:101,Al:102,Bl:103,Cl:104,Dl:105,Tm:106,k:107,Um:108,Ym:109,n:110,en:111,p:112,q:113,r:114,lo:115,t:116,oo:117,po:118,qo:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126},ca={};ca[186]=p[";"];ca[187]=p["="];ca[188]=p[","];ca[189]=p["-"];ca[190]=p["."];ca[191]=p["/"];ca[192]=p["`"];ca[219]=p["["];ca[220]=p["\\"];ca[221]=p["]"];ca[222]=p["'"];ca[173]=p["-"];var da={};da[p["1"]]=p["!"];
da[p["2"]]=p["@"];da[p["3"]]=p["#"];da[p["4"]]=p.$;da[p["5"]]=p["%"];da[p["6"]]=p["^"];da[p["7"]]=p["&"];da[p["8"]]=p["*"];da[p["9"]]=p["("];da[p["0"]]=p[")"];da[186]=p[":"];da[187]=p["+"];da[188]=p["<"];da[189]=p._;da[190]=p[">"];da[191]=p["?"];da[192]=p["~"];da[219]=p["{"];da[220]=p["|"];da[221]=p["}"];da[222]=p['"'];da[173]=p._;da[61]=p["+"];da[59]=p[":"];
function ea(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function fa(a,b){var c="";b?32<b&&(b=32):b=32;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=(a&1?"1":"0")+c,a>>=1;return c}function ha(a,b,c){var d="";if(!b||4<b)b=4;for(var e=0;e<b;e++)d&&(d=","+d),d=fa(a&255,8)+d,a>>=8;return(c?"0b":"")+d}
function ia(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function r(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function u(a){return r(a,2,!0)}function v(a){return r(a,4,!0)}
function ja(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ka(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ma(a,b){return-1!==a.indexOf(b,a.length-b.length)}var na={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function oa(a){return a.replace(/[&<>"']/g,function(a){return na[a]})}
function pa(a,b,c){return c?(" "+a).slice(-b):(a+" ").slice(0,b)}function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
function sa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var ta=Date.now||function(){return+new Date};function ua(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}var va=[31,28,31,30,31,30,31,31,30,31,30,31];
function wa(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.vh|g<<f.shift&f.vh}return c}function xa(a,b){return(b&a.vh)>>a.shift}function ya(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c<d;c++)if(c in a&&a[c]===b)return c;return-1}
function Aa(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
typeof b){var k="",m;for(m in b)b.hasOwnProperty(m)&&(k&&(k+="&"),k+=m+"="+encodeURIComponent(b[m]));k=k.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}function Ba(){return"http://"+(window?window.location.host:"www.pcjs.org")}
function Ca(){return window?window.navigator.userAgent:""}function w(a){window&&window.alert(a)}function Ea(a){var b=!1;window&&(b=window.confirm(a));return b}var Fa=null;function Ga(){if(null==Fa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Fa=a}return Fa}
function Ha(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Ia(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function La(a){if(window){var b=Ca();return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}
function Na(a,b,c,d){var e=null;b="data:application/"+b+(c?";base64":"")+",";b=La("Firefox")?b+(c?a:encodeURIComponent(a)):b+(c?a:encodeURI(a));d&&(e=document.createElement("a"),"string"!=typeof e.download&&(e=null));e?(e.href=b,e.download=d,document.body.appendChild(e),e.click(),document.body.removeChild(e),a="Check your Downloads folder for "+d+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(d?" ("+d+")":"")+".");return a}
function Oa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}function Qa(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Ra={init:[],show:[],exit:[]},Sa=!1,Ta=!1,Ua=!0;
function Va(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Xa(a){Ra.init.push(a)}function Ya(a){if(Ua)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){w(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Za(a){!Ua&&a?(Ua=!0,Sa&&$a("init"),Ta&&$a("show")):Ua=a}function $a(a){Ra[a]&&Ya(Ra[a])}Va("onload",function(){Sa=!0;Ya(Ra.init)});Va("onpageshow",function(){Ta=!0;Ya(Ra.show)});
Va(La("Opera")||La("iOS")?"onunload":"onbeforeunload",function(){Ya(Ra.exit)});function bb(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.al=b.comment;this.Ok=b;b=this.id.indexOf(".");0>b?this.xd=this.id:(this.ce=this.id.substr(0,b),this.xd=this.id.substr(b+1));this[a]=c;this.la={ready:!1,Ff:!1,hh:!1,ic:!1,error:!1};this.yg=null;this.la.error=!1;this.qa={};this.ha=null;this.wc=d||0;cb.push(this)}var db=void 0,eb={};
if(window){db||(db=window.location.search.substr(1));for(var fb,gb=/\+/g,hb=/([^&=]+)=?([^&]*)/g;fb=hb.exec(db);)eb[decodeURIComponent(fb[1].replace(gb," "))]=decodeURIComponent(fb[2].replace(gb," "))}function ib(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
function jb(a,b){b||(b=bb);a.prototype=ib(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var lb=window.PCjs.Machines||(window.PCjs.Machines={}),cb=window.PCjs.Components||(window.PCjs.Components=[])}else lb={},cb=[];function mb(a,b,c){lb[a]&&b&&(lb[a][b]=c)}function nb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<cb.length;b++){var d=cb[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function ob(a,b){if(void 0!==a){var c;b&&0<(c=b.indexOf("."))&&(a=b.substr(0,c+1)+a);for(c=0;c<cb.length;c++)if(cb[c].id===a)return cb[c]}return null}function pb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<cb.length;d++)if(c)c==cb[d]&&(c=null);else if(!(a!=cb[d].type||b&&cb[d].id.indexOf(b)))return cb[d]}return null}function qb(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){w(c.message+" ("+a+")")}return b}
function rb(a,b,c){var d;b&&(void 0===d&&(d="Panel"),(d=pb(d,a.id))&&(b=d.qa[b])&&a.Pb(null,c,b))}function sb(a,b){b=tb(b.parentNode,"pcx86-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),k=0;k<h.length;k++)switch(g=h[k],g){case "pcx86-binding":(g=qb(f))&&g.binding&&a.Pb(g.type,g.binding,f,g.value),k=h.length}}}}
function tb(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
bb.prototype={constructor:bb,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Pb:function(a,b,c){switch(b){case "clear":return this.qa[b]||(this.qa[b]=c,c.onclick=function(a){return function(){a.qa.print&&(a.qa.print.value="")}}(this)),!0;case "print":return this.qa[b]||(this.Gf=this.qa[b]=c,c.value="",this.O=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.Na=function(a){this.O(a,this.xd)}),!0;default:return!1}},log:function(){},O:function(){},status:function(a){this.O(this.xd+": "+a)},Na:function(a,b,c){c=c||this.type;b||w((c?c+": ":"")+a)},hc:function(){return this.la.ic=!0},gc:function(a,b){b&&(this.la.ic=!1);return!0}};function x(a,b,c,d,e,f,g){a.ha&&(!0===g?g=0:null==g&&(g=a.wc),ub(a.ha,a,b,c,d,e,f,g))}function y(a,b,c,d){a.ha&&(!0===c||z(a,c|0))&&a.ha.message(b,d)}
function z(a,b){if(a.ha){a===a.ha?b|=0:b=b||a.wc;var c=a.ha.wc&b;return!!b&&c===b||!!(c&a.ha.pl)}return!1}function vb(a,b){if(a.la.hh)return a.la.Ff=!1,a.la.hh=!1;if(a.la.error)return a.O(a.toString()+" error"),!1;a.la.Ff=b;return a.la.Ff}function wb(a,b){a.la.Ff&&(b?a.la.hh=!0:void 0===b&&a.O(a.toString()+" busy"));return a.la.Ff}function xb(a,b){a.la.error||(a.la.ready=!1!==b,a.la.ready&&(b=a.yg,a.yg=null,b&&b()))}function yb(a,b){b&&(a.la.ready?b():a.yg=b);return a.la.ready}
function zb(a,b){a.la.error=!0;a.Na(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
var Ab="undefined"!==typeof ArrayBuffer,Bb={Kg:4,Jc:5,Jd:6,dd:7,ed:8,ib:9,dc:11,ec:12,Je:4,Gj:60,Hj:83,yc:3,Vb:9,Nc:16,Jg:1,Lj:19,Nj:28,Pj:16,Oj:21,Mj:37,Jj:2,Ih:9,Kj:5,Ij:33,Kh:10,Jh:8,Tf:3,Sf:15,ck:51,dk:1,ek:2,fk:4,bk:32,Lh:15,hk:15,ab:16,bb:4,jk:11,ik:18,gk:24,fc:4,kk:2,pf:16,lk:17,Qh:18,mk:19,Ph:5,Rh:6,sk:2,rk:8,pk:9,qk:10,nk:10,Sh:10,Th:10,Rj:80,Tj:144,Qj:86,Sj:154,Vj:101,Xj:165,Uj:107,Wj:171,uk:70,wk:113,tk:76,vk:124,Zj:80,ak:128,Yj:86,$j:134,Vf:3,Uf:16,Yh:10,Xh:8,xk:51,zc:8,yk:17,zk:36,Rc:11,
Ak:16,Ke:10,nd:2,Fh:18,Gh:7,Hh:15,Mh:12,Nh:7,Oh:11,Uh:18,Vh:7,Wh:15,Zh:15,$h:7,ai:13,ei:11,fi:7,gi:8,Bk:8,Ek:12,Ck:18,Dk:17,Fk:15,ci:8,bi:20,di:2,ji:3,Wf:9,ii:5,hi:11,li:4,ki:17,Gk:11},Cb={Kg:0,Jc:0,Jd:0,dd:0,ed:0,ib:0,dc:1,ec:1,Je:3,Gj:14,Hj:16,yc:2,Vb:7,Nc:7,Jg:0,Lj:7,Nj:13,Pj:7,Oj:11,Mj:16,Jj:3,Ih:6,Kj:2,Ij:13,Kh:5,Jh:5,Tf:2,Sf:7,ck:23,dk:0,ek:1,fk:3,bk:17,Lh:7,hk:11,ab:7,bb:3,jk:7,ik:11,gk:15,fc:2,kk:3,pf:7,lk:8,Qh:8,mk:8,Ph:4,Rh:4,sk:2,rk:3,pk:5,qk:2,nk:3,Sh:5,Th:3,Rj:14,Tj:22,Qj:17,Sj:25,Vj:17,
Xj:25,Uj:20,Wj:28,uk:13,wk:21,tk:16,vk:24,Zj:13,ak:21,Yj:16,$j:24,Vf:2,Uf:7,Yh:5,Xh:5,xk:19,zc:5,yk:5,zk:17,Rc:3,Ak:5,Ke:3,nd:0,Fh:8,Gh:5,Hh:9,Mh:5,Nh:5,Oh:4,Uh:5,Vh:5,Wh:4,Zh:7,$h:5,ai:8,ei:3,fi:4,gi:3,Bk:11,Ek:11,Ck:15,Dk:15,Fk:7,ci:5,bi:8,di:0,ji:2,Wf:6,ii:3,hi:6,li:3,ki:5,Gk:5},Db={19:{0:"disk reset",1:"get status",2:"read drive @DL (@CH:@DH:@CL,@AL) into @ES:@BX",3:"write drive @DL (@CH:@DH:@CL,@AL) from @ES:@BX",4:"verify drive @DL (@CH:@DH:@CL,@AL)",5:"format drive @DL using @ES:@BX",8:"read drive @DL parameters",
21:"get drive @DL DASD type",22:"get drive @DL change line status",23:"set drive @DL DASD type",24:"set drive @DL media type"},21:{128:"open device",129:"close device",130:"program termination",131:"wait @CX:@DXus for event",132:"joystick support",133:"SYSREQ pressed",134:"wait @CX:@DXus",135:"move block (@CX words)",136:"get extended memory size",137:"processor to virtual mode",144:"device busy loop",145:"interrupt complete flag set"},33:{0:"terminate program",1:"read character (AL) from stdin with echo",
2:"write character #@DL to stdout",3:"read character (AL) from stdaux",4:"write character #@DL to stdaux",5:"write character #@DL to stdprn",6:"direct console output (input if @DL=FF)",7:"direct console input without echo",8:"read character (AL) from stdin without echo",9:"write string $@DS:@DX to stdout",10:"buffered input (DS:DX)",11:"get stdin status",12:"flush buffer and read stdin",13:"disk reset",14:"select default drive @DL",15:"open file using FCB ^@DS:@DX",16:"close file using FCB ^@DS:@DX",
17:"find first matching file using FCB ^@DS:@DX",18:"find next matching file using FCB ^@DS:@DX",19:"delete file using FCB ^@DS:@DX",20:"sequential read from file using FCB ^@DS:@DX",21:"sequential write to file using FCB ^@DS:@DX",22:"create or truncate file using FCB ^@DS:@DX",23:"rename file using FCB ^@DS:@DX",25:"get current default drive (AL)",26:"set disk transfer area (DTA=@DS:@DX)",27:"get allocation information for default drive",28:"get allocation information for specific drive @DL",31:"get drive parameter block for default drive",
33:"read random record from file using FCB ^@DS:@DX",34:"write random record to file using FCB ^@DS:@DX",35:"get file size using FCB ^@DS:@DX",36:"set random record number for FCB ^@DS:@DX",37:"set address @DS:@DX of interrupt vector @AL",38:"create new PSP at segment @DX",39:"random block read from file using FCB ^@DS:@DX",40:"random block write to file using FCB ^@DS:@DX",41:"parse filename $@DS:@SI into FCB @ES:@DI using @AL",42:"get system date (year=CX, mon=DH, day=DL)",43:"set system date (year=@CX, mon=@DH, day=@DL)",
44:"get system time (hour=CH, min=CL, sec=DH, 100ths=DL)",45:"set system time (hour=@CH, min=@CL, sec=@DH, 100ths=@DL)",46:"set verify flag @AL",47:"get disk transfer area (DTA=ES:BX)",48:"get DOS version (AL=major, AH=minor)",49:"terminate and stay resident",50:"get drive parameter block (DPB=DS:BX) for drive @DL",51:"extended break check",52:"get address (ES:BX) of InDOS flag",53:"get address (ES:BX) of interrupt vector @AL",54:"get free disk space of drive @DL",55:"get(0)/set(1) switch character @DL (@AL)",
56:"get country-specific information",57:"create subdirectory $@DS:@DX",58:"remove subdirectory $@DS:@DX",59:"set current directory $@DS:@DX",60:"create or truncate file $@DS:@DX with attributes @CX",61:"open file $@DS:@DX with mode @AL",62:"close file @BX",63:"read @CX bytes from file @BX into buffer @DS:@DX",64:"write @CX bytes to file @BX from buffer @DS:@DX",65:"delete file $@DS:@DX",66:"set position @CX:@DX of file @BX relative to @AL",67:"get(0)/set(1) attributes @CX of file $@DS:@DX (@AL)",
68:"get device information (IOCTL)",69:"duplicate file handle @BX",70:"force file handle @CX to duplicate file handle @BX",71:"get current directory (DS:SI) for drive @DL",72:"allocate memory segment with @BX paragraphs",73:"free memory segment @ES",74:"resize memory segment @ES to @BX paragraphs",75:"load program $@DS:@DX using parameter block @ES:@BX",76:"terminate with return code @AL",77:"get return code (AL)",78:"find first matching file $@DS:@DX with attributes @CX",79:"find next matching file",
80:"set current PSP @BX",81:"get current PSP (bx)",82:"get system variables (ES:BX)",83:"translate BPB @DS:@SI to DPB (ES:BP)",84:"get verify flag (AL)",85:"create child PSP at segment @DX",86:"rename file $@DS:@DX to $@ES:@DI",87:"get(0)/set(1) file @BX date @DX and time @CX (@AL)",88:"get(0)/set(1) memory allocation strategy (@AL)",89:"get extended error information",90:"create temporary file $@DS:@DX with attributes @CX",91:"create file $@DS:@DX with attributes @CX",92:"lock(0)/unlock(1) file @BX region @CX:@DX length @SI:@DI (@AL)",
93:"critical error information (@AL)",96:"get fully-qualified filename from $@DS:@SI",99:"get lead byte table (@AL)",108:"extended open file $@DS:@SI"},65:{79:"check debugger loaded"}},Eb={cpu:1,seg:2,desc:4,tss:8,"int":16,fault:32,bus:64,mem:128,port:256,dma:512,pic:1024,timer:2048,cmos:4096,rtc:8192,8042:16384,chipset:32768,keyboard:65536,key:131072,video:262144,fdc:524288,hdc:1048576,disk:2097152,parallel:4194304,serial:8388608,mouse:16777216,speaker:33554432,computer:67108864,dos:134217728,data:268435456,
log:536870912,warn:1073741824,halt:-2147483648};function Fb(a){bb.call(this,"Panel",a,Fb);this.L=this.V=this.ea=-1}jb(Fb);function Gb(a,b,c,d){this.A=[a,b,c,d];this.B=null;void 0===a&&(this.A[0]=256*Math.random()|0,this.A[1]=256*Math.random()|0,this.A[2]=256*Math.random()|0,this.A[3]=255,this.B=null)}Gb.prototype.toString=function(){this.B||(this.B="#"+r(this.A[0],2)+r(this.A[1],2)+r(this.A[2],2));return this.B};function Hb(a,b,c,d){this.x=a;this.y=b;this.ad=c;this.A=d}
Hb.prototype.contains=function(a,b){return a>=this.x&&a<this.x+this.ad&&b>=this.y&&b<this.y+this.A};function Ib(a,b,c,d){void 0===d&&(d=b>=c>>2);d?(b=new Hb(a.x,a.y,a.ad,a.A*b/c|0),a.y+=b.A,a.A-=b.A):(b=new Hb(a.x,a.y,a.ad*b/c|0,a.A),a.x+=b.ad,a.ad-=b.ad);return b}l=Fb.prototype;l.Pb=function(a,b,c,d){return this.X&&this.X.Pb(a,b,c,d)||this.F&&this.F.Pb(a,b,c,d)||this.B&&this.B.Pb(a,b,c,d)||this.ha&&this.ha.Pb(a,b,c,d)?!0:this.parent.Pb.call(this,a,b,c,d)};
l.Ic=function(a,b,c,d){this.X=a;this.ga=b;this.F=c;this.ha=d;this.B=Jb(a,"Keyboard")};l.hc=function(a,b){b||Kb();return!0};l.gc=function(){return!0};l.he=function(a,b){a.button||(this.ea=b?0:-1,Mb(this,a,b))};l.Kf=function(a){Mb(this,a)};
function Mb(a,b,c){var d=1280/null.offsetWidth,e=720/null.offsetHeight,f=null.getBoundingClientRect(),d=(b.clientX-f.left)*d|0;b=(b.clientY-f.top)*e|0;null==c&&(a.ea||(a.ea=Math.abs(a.L-d)>Math.abs(a.V-b)?1:2),1==a.ea?b=a.V:2==a.ea&&(d=a.L));a.L=d;a.V=b;if(0<=d&&1280>d&&0<=b&&720>b){a:{c=d;if(960>c&&a.A&&a.A.Se)for(f=0;f<a.A.Se.length;f++)if(e=a.A.Se[f],e.contains(c,b)){c-=e.x;b-=e.y;var d=a.A.Bf[f],g=xa(Nb.Hk,a.A.Yg[d.El]),f=g*a.ga.Sb,d=(g+d.Td)*a.ga.Sb-1;0<b&&(f+=e.ad*(b-1)*a.ya);f+=c*a.ya;f|=0;
f>d&&(f=d);c=f;break a}c=-1}if(-1!==c&&(c&=-16,c!=a.Ca)){b=c;if(a.context&&a.ia&&a.ka){e=a.ia.width;a.ka.fillStyle="black";a.ka.fillRect(0,360,e,360);Ob(a,378,a.ia,a.ka);a.pa=a.Da.width/24|0;if(null==b)Pb(a,"Mouse over memory to dump");else for(Pb(a,r(b,8,!0),null,0,1),f=1;16>=f;f++){d="";for(g=1;8>=g;g++){var h;h=a.ga;var k=b++;h=h.sa[(k&h.Gb)>>>h.La].re(k&h.A,k);Pb(a,r(h,2),null,1);d+=32<=h&&128>h?String.fromCharCode(h):"."}Pb(a,d,null,0,1)}a.context.drawImage(a.ia,0,360,e,360,a.qb,a.Db,a.Pa,a.cb)}a.Ca=
c}}}l.pd=function(){};function Qb(a,b,c,d){a.A.Bf[a.A.fj++]={El:b,Td:c,type:d};return wa(Nb,b,c,0,d)}function Ob(a,b,c,d){var e,f=null.style.color,g=a.Oa=10;a.C=g;a.U=b;a.W=a.va=18;e||(e=a.ua||a.va+"px Monaco, Lucida Console, Courier New");a.fa=a.ua=e;c&&(a.Da=c);d&&(a.N=d,a.Fa=f||"white")}
function Pb(a,b,c,d,e){a.N.font=a.fa;a.N.fillStyle=a.Fa;a.N.fillText(b,a.C,a.U);a.C+=a.pa;null!=c&&(16!=a.Tb?b=c.toString():(b=8>a.Ka?"0x":"",b+=r(c,a.Ka)),a.N.fillText(b,a.C,a.U),a.C+=a.pa);d&&(a.C+=a.pa*d);e&&(a.C=a.Oa,a.U+=(a.W+2)*(e||1))}function Kb(){for(var a=!1,b=tb(document,"pcx86","panel"),c=0;c<b.length;c++){var d=b[c],e=qb(d),f=ob(e.id);f||(a=!0,f=new Fb(e));sb(f,d);a&&xb(f)}}Xa(Kb);
function Rb(a,b,c){bb.call(this,"Bus",a,Rb);this.F=b;this.ha=c;this.N=a.busWidth||20;this.W=Math.pow(2,this.N);this.Dg=this.Gb=this.W-1|0;this.La=32==this.N||20>=this.N?12:24>=this.N?14:15;this.Sb=1<<this.La;this.fa=this.Sb>>2;this.A=this.Sb-1;this.U=this.W/this.Sb|0;this.ga=this.U-1;this.B=[];this.C=[];this.L=this.V=!1;this.aa=[];this.ea=[];a=new B;Sb(a,this.ha);this.sa=Array(this.U);for(b=0;b<this.U;b++)this.sa[b]=a;a=this.F;b=this.sa;c=this.La;a.kd=a.sa=b;a.La=c;a.Sb=1<<a.La;a.Fa=a.Sb-1;a.Fd=b.length;
a.hd=a.Fd-1;a=this.F;a.Gb=a.Db=this.Gb;xb(this)}jb(Rb);Rb.prototype.reset=function(){Tb(this,!0)};Rb.prototype.hc=function(a,b){b||this.reset();return!0};
function Ub(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.La;0<g&&h<a.sa.length;){var k=a.sa[h],m=h*a.Sb,n=a.Sb-(f-m);n>g&&(n=g);if(k&&k.size){if(k.type==d&&k.controller==e){if(f+g<=k.Ea)return k.Qe+=k.Ea-f,k.Ea=f,!0;if(f>=k.Ea+k.Qe){n=k.size-(f-m);n>g&&(n=g);k.Qe=f-k.Ea+n;f=m+a.Sb;g-=n;h++;continue}}return Wb(a,1,f,g)}f=new B(f,n,a.Sb,d,e);Sb(f,a.ha,k);a.sa[h++]=f;f=m+a.Sb;g-=n}return 0>=g?(Xb(a.F),a.F.la.Ib||a.status(Math.floor(c/1024)+"Kb "+Yb[d]+" at "+r(b)),!0):Wb(a,2,b,c)}
var Nb,$b={Hk:20,count:8,Ko:1,type:3},ac=0,bc;for(bc in $b){var cc=$b[bc];$b[bc]={vh:(1<<cc)-1<<ac,shift:ac};ac+=cc}Nb=$b;function Tb(a,b){32==a.N?b?a.X&&(dc(a,1048576,1048576,a.X),a.X=null):a.X||(a.X=ec(a,1048576,1048576),dc(a,1048576,1048576,ec(a,0,1048576))):20<a.N&&(b=a.Gb&-1048577|(b?1048576:0),b!=a.Gb&&(a.Gb=b,a.F&&(a=a.F,a.Gb=a.Db=b)))}l=Rb.prototype;
l.Vg=function(a,b,c,d){if(!(a&this.A||!b||b&this.A)){for(var e=a>>>this.La;0<b;){var f=this.sa[e];if(!f.controller)return Wb(this,3,a,b,d);fc(f,c,!0);b-=this.Sb;e++}return!0}return Wb(this,4,a,b)};function gc(a,b,c){if(!(b&a.A||!c||c&a.A)){for(var d=b>>>a.La;0<c;){var e=a.sa[d];b=new B(b);Sb(b,a.ha,e);a.sa[d++]=b;b=d*a.Sb;c-=a.Sb}Xb(a.F);return!0}return Wb(a,5,b,c)}function ec(a,b,c){var d=[];for(b>>>=a.La;0<c&&b<a.sa.length;)d.push(a.sa[b++]),c-=a.Sb;return d}
function dc(a,b,c,d,e){for(var f=0,g=b>>>a.La;0<c&&g<a.sa.length;){var h=d[f++];if(!h)break;if(void 0!==e){var k=new B(b),m=k,n=e,t=a.ha;m.id=h.id|1;m.Qe=h.Qe;m.size=h.size;n&&(m.type=n,m.N=n==hc);Ab?(m.X=h.X,m.qa=h.qa,m.Za=h.Za,m.de=h.de,m.da=h.da,fc(m,ic?jc:kc)):(m.da=h.da,fc(m,lc));Sb(m,t,h);h=k}a.sa[g++]=h;c-=a.Sb}}l.Qa=function(a){return this.sa[(a&this.Gb)>>>this.La].pc(a&this.A,a)};
l.na=function(a){var b=a&this.A,c=(a&this.Gb)>>>this.La;return b!=this.A?this.sa[c].sf(b,a):this.sa[c++].pc(b,a)|this.sa[c&this.ga].pc(0,a+1)<<8};function mc(a,b){var c=b&a.A,d=(b&a.Gb)>>>a.La;return c!=a.A?a.sa[d].fg(c,b):a.sa[d++].re(c,b)|a.sa[d&a.ga].re(0,b+1)<<8}l.oa=function(a){var b=a&this.A,c=(a&this.Gb)>>>this.La;if(b<this.A-2)return this.sa[c].Md(b,a);for(var d=0,e=4,f=0,g=4-(b&3);e--;)d|=this.sa[c].pc(b++,a++)<<f,--g||(c=c+1&this.ga,b=0),f+=8;return d};
l.qc=function(a,b){this.sa[(a&this.Gb)>>>this.La].sc(a&this.A,b&255,a)};l.jb=function(a,b){var c=a&this.A,d=(a&this.Gb)>>>this.La;c!=this.A?this.sa[d].zf(c,b&65535,a):(this.sa[d++].sc(c,b&255,a),this.sa[d&this.ga].sc(0,b>>8&255,a+1))};function nc(a,b,c){var d=b&a.A,e=(b&a.Gb)>>>a.La;d!=a.A?a.sa[e].zi(d,c&65535,b):(a.sa[e++].xf(d,c&255,b),a.sa[e&a.ga].xf(0,c>>8&255,b+1))}
l.nb=function(a,b){var c=a&this.A,d=(a&this.Gb)>>>this.La;if(c<this.A-2)this.sa[d].yf(c,b);else for(var e=4,f=4-(c&3);e--;)this.sa[d].sc(c++,b&255,a++),--f||(d=d+1&this.ga,c=0),b>>>=8};l.xj=function(){return null};
function oc(a,b){var c=0,d=[],e=!a.X&&a.Dg==a.Gb;e||Tb(a,!0);for(var f=0;f<a.U;f++){var g=a.sa[f];if(b&&g.type!=hc||g.Wa||g.tj){d[c++]=f;var h=c++;if(g=g.save()){for(var k=0,m=0,n=[];k<g.length;){for(var t=g[k],q=k+1;q<g.length&&g[q]===t;)q++;n[m++]=q-k;n[m++]=t;k=q}n.length<g.length&&(g=n)}d[h]=g}}e||Tb(a,!1);d[c]=e;return d}function pc(a,b){if(void 0===b)return a.L=!a.L,a.L;void 0===a.B[b]&&(a.B[b]=[null,!1]);a.B[b][1]=!a.B[b][1];return a.B[b][1]}
function qc(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.B[k]?w("Input port "+v(k)+" already registered"):f.B[k]=[h,!1]}}function rc(a,b,c,d){for(var e=0,f=0;0<c;){var g=a.B[b],h=a.aa[b]||1,k=1==h?255:2==h?65535:-1,m=k;void 0!==g?(g[0]&&(m=g[0](b,d),void 0===m?m=k:m&=k),a.ha&&a.L!=g[1]&&wc(a.ha,b,m)):a.ha&&(ub(a.ha,a,b,null,d),a.L&&wc(a.ha,b,m));e|=m<<f;f+=h<<3;b+=h;c-=h}return e}
function xc(a,b){if(void 0===b)return a.V=!a.V,a.V;void 0===a.C[b]&&(a.C[b]=[null,!1]);a.C[b][1]=!a.C[b][1];return a.C[b][1]}function yc(a,b,c,d){void 0===d&&(d=0);for(var e in c){var f=a,g=+e+d,h=c[e].bind(b);if(h)for(var k=+e+d;k<=g;k++)void 0!==f.C[k]?w("Output port "+v(k)+" already registered"):f.C[k]=[h,!1]}}
function zc(a,b,c,d,e){for(var f=0;0<c;){var g=a.C[b],h=a.ea[b]||1,k=1==h?255:2==h?65535:-1,k=(d>>>=f)&k;if(void 0!==g){if(g[0])g[0](b,k,e);a.ha&&a.V!=g[1]&&Ac(a.ha,b,k)}else a.ha&&(ub(a.ha,a,b,k,e),a.V&&Ac(a.ha,b,k));f+=h<<3;b+=h;c-=h}}function Wb(a,b,c,d,e){b="Memory block error ("+b+": "+r(c)+","+r(d)+")";e?a.ha?a.ha.message(b):a.log(b):w(b);return!1}var Bc;if(Ab){var Cc=new ArrayBuffer(2);(new DataView(Cc)).setUint16(0,256,!0);Bc=256===(new Uint16Array(Cc))[0]}else Bc=!1;var ic=Bc;
function B(a,b,c,d,e,f){this.id=Dc+=2;this.da=null;this.C=0;this.Ea=a;this.Qe=b;this.size=c||0;this.type=d||Ec;this.N=d==hc;this.controller=null;this.F=f;Sb(this);this.Wa=this.tj=!1;if(c)if(e)this.controller=e,a=e.wj(a),this.da=a[0],this.C=a[1],fc(this,e.nh());else if(Ab)this.X=new ArrayBuffer(c),this.qa=new DataView(this.X,0,c),this.Za=new Uint8Array(this.X,0,c),this.de=new Uint16Array(this.X,0,c>>1),this.da=new Int32Array(this.X,0,c>>2),fc(this,ic?jc:kc);else{this.da=Array(c>>2);for(e=0;e<this.da.length;e++)this.da[e]=
0;fc(this,lc)}else fc(this)}var Ec=0,hc=2,Fc=["black","blue","green","cyan"],Yb="NONE RAM ROM VIDEO H/W UNPAGED PAGED".split(" "),Dc=0;function Gc(a){Ab&&!ic&&(a=a<<24|a<<8&16711680|a>>8&65280|a>>>24);return a}
B.prototype={constructor:B,parent:null,qh:function(a){this.Ea=a},save:function(){var a,b;if(this.controller)a=null;else if(Ab)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.qa.getInt32(b<<2,!0);else a=this.da;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ab)for(b=0;b<a.length;b++)this.qa.setInt32(b<<2,a[b],!0);else this.da=a;return this.Wa=!0}return!1},Rd:function(a,b,c){b?this.Ae++||(c&&(this.F=c),Jc(this,Ic,!1)):this.ze++||(c&&(this.F=c),
Hc(this,Ic,!1))},ia:function(){this.ha&&z(this.ha,129)&&this.ha.message("attempt to read invalid block %"+r(this.Ea),!0);return 255},L:function(a,b){this.ha&&z(this.ha,129)&&this.ha.message("attempt to write "+v(b)+" to invalid block %"+r(this.Ea),!0)},ka:function(a,b){return this.pc(a++,b++)|this.pc(a,b)<<8},ea:function(a,b){return this.pc(a++,b++)|this.pc(a++,b++)<<8|this.pc(a++,b++)<<16|this.pc(a,b)<<24},W:function(a,b,c){this.sc(a++,b&255,c++);this.sc(a,b>>8,c)},U:function(a,b,c){this.sc(a++,
b&255,c++);this.sc(a++,b>>8&255,c++);this.sc(a++,b>>16&255,c++);this.sc(a,b>>>24,c)},Fa:function(a){return this.da[a>>2]>>>((a&3)<<3)&255},sb:function(a){var b=a>>2;a=(a&3)<<3;var c=this.da[b]>>a;return 24>a?c&65535:c&255|(this.da[b+1]&255)<<8},Ya:function(a){var b=a>>2;a=(a&3)<<3;var c=this.da[b];a&&(c=c>>>a|this.da[b+1]<<32-a);return c},tc:function(a,b){var c=a>>2;a=(a&3)<<3;this.da[c]=this.da[c]&~(255<<a)|b<<a;this.Wa=!0},Cd:function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.da[c]=this.da[c]&~(65535<<
a)|b<<a:(this.da[c]=this.da[c]&16777215|b<<24,c++,this.da[c]=this.da[c]&-256|b>>8);this.Wa=!0},Wc:function(a,b){var c=a>>2;if(a=(a&3)<<3){var d=-1<<a;this.da[c]=this.da[c]&~d|b<<a;c++;this.da[c]=this.da[c]&d|b>>>32-a}else this.da[c]=b;this.Wa=!0},Da:function(a,b){this.ha&&null!=this.Ea&&Kc(this.ha,this.Ea+a)||this.F&&Lc(this.F,b,1,!1);return this.re(a,b)},qb:function(a,b){this.ha&&null!=this.Ea&&Kc(this.ha,this.Ea+a,2)||this.F&&Lc(this.F,b,2,!1);return this.fg(a,b)},Pa:function(a,b){this.ha&&null!=
this.Ea&&Kc(this.ha,this.Ea+a,4)||this.F&&Lc(this.F,b,4,!1);return this.si(a,b)},bc:function(a,b,c){this.ha&&null!=this.Ea&&Mc(this.ha,this.Ea+a)||this.F&&Lc(this.F,c,1,!0);this.N?this.L(a,b,c):this.xf(a,b,c)},sd:function(a,b,c){this.ha&&null!=this.Ea&&Mc(this.ha,this.Ea+a,2)||this.F&&Lc(this.F,c,2,!0);this.N?this.L(a,b,c):this.zi(a,b,c)},Vc:function(a,b,c){this.ha&&null!=this.Ea&&Mc(this.ha,this.Ea+a,4)||this.F&&Lc(this.F,c,4,!0);this.N?this.L(a,b,c):this.ua(a,b,c)},Ja:function(a,b){this.yb.da[this.A]|=
this.ga;this.zb.da[this.B]|=this.ga;return this.Bd.pc(a,b)},Jb:function(a,b){this.yb.da[this.A]|=this.ga;this.zb.da[this.B]|=this.ga;return this.Bd.sf(a,b)},fb:function(a,b){this.yb.da[this.A]|=this.ga;this.zb.da[this.B]|=this.ga;return this.Bd.Md(a,b)},Cc:function(a,b,c){this.yb.da[this.A]|=this.ga;this.zb.da[this.B]|=this.V;this.Bd.sc(a,b,c)},Gd:function(a,b,c){this.yb.da[this.A]|=this.ga;this.zb.da[this.B]|=this.V;this.Bd.zf(a,b,c)},hd:function(a,b,c){this.yb.da[this.A]|=this.ga;this.zb.da[this.B]|=
this.V;this.Bd.yf(a,b,c)},Ka:function(a,b){return Nc(this.F,b,!1).pc(a,b)},xd:function(a,b){return Nc(this.F,b,!1).sf(a,b)},gb:function(a,b){return Nc(this.F,b,!1).Md(a,b)},Uc:function(a,b,c){Nc(this.F,c,!0).sc(a,b,c)},Hd:function(a,b,c){Nc(this.F,c,!0).zf(a,b,c)},jd:function(a,b,c){Nc(this.F,c,!0).yf(a,b,c)},Ca:function(a){return this.Za[a]},aa:function(a){return this.Za[a]},Ga:function(a){this.yb.da[this.A]|=32;this.zb.da[this.B]|=32;this.pc=this.aa;return this.Za[a]},Tb:function(a){return this.qa.getUint16(a,
!0)},pa:function(a){return a&1?this.Za[a]|this.Za[a+1]<<8:this.de[a>>1]},Db:function(a){this.yb.da[this.A]|=32;this.zb.da[this.B]|=32;this.sf=this.pa;return a&1?this.Za[a]|this.Za[a+1]<<8:this.de[a>>1]},Oa:function(a){return this.qa.getInt32(a,!0)},fa:function(a){return a&3?this.Za[a]|this.Za[a+1]<<8|this.Za[a+2]<<16|this.Za[a+3]<<24:this.da[a>>2]},cb:function(a){this.yb.da[this.A]|=32;this.zb.da[this.B]|=32;this.Md=this.fa;return a&3?this.Za[a]|this.Za[a+1]<<8|this.Za[a+2]<<16|this.Za[a+3]<<24:this.da[a>>
2]},Ub:function(a,b){this.Za[a]=b;this.Wa=!0},ra:function(a,b){this.Za[a]=b;this.Wa=!0},uc:function(a,b){this.Za[a]=b;this.yb.da[this.A]|=32;this.zb.da[this.B]|=96;this.sc=this.ra;this.Bd.Wa=!0},qd:function(a,b){this.qa.setUint16(a,b,!0);this.Wa=!0},ya:function(a,b){a&1?(this.Za[a]=b,this.Za[a+1]=b>>8):this.de[a>>1]=b;this.Wa=!0},Fd:function(a,b){a&1?(this.Za[a]=b,this.Za[a+1]=b>>8):this.de[a>>1]=b;this.yb.da[this.A]|=32;this.zb.da[this.B]|=96;this.zf=this.ya;this.Bd.Wa=!0},ce:function(a,b){this.qa.setInt32(a,
b,!0);this.Wa=!0},va:function(a,b){a&3?(this.Za[a]=b,this.Za[a+1]=b>>8,this.Za[a+2]=b>>16,this.Za[a+3]=b>>24):this.da[a>>2]=b;this.Wa=!0},Xc:function(a,b){a&3?(this.Za[a]=b,this.Za[a+1]=b>>8,this.Za[a+2]=b>>16,this.Za[a+3]=b>>24):this.da[a>>2]=b;this.yb.da[this.A]|=32;this.zb.da[this.B]|=96;this.yf=this.va;this.Bd.Wa=!0}};function Sb(a,b,c){a.ha=b;a.ze=a.Ae=0;c&&(c.F&&(a.F=c.F),(a.ze=c.ze)&&Hc(a,Ic,!1),(a.Ae=c.Ae)&&Jc(a,Ic,!1))}
function Oc(a){a.sc=a.N?a.L:a.xf;a.zf=a.N?a.W:a.zi;a.yf=a.N?a.U:a.ua}function Pc(a){a.pc=a.re;a.sf=a.fg;a.Md=a.si}function Jc(a,b,c){c&&a.Ae||(a.sc=!a.N&&b[1]||a.L,a.zf=!a.N&&b[3]||a.W,a.yf=!a.N&&b[5]||a.U);if(c||void 0===c)a.xf=b[1]||a.L,a.zi=b[3]||a.W,a.ua=b[5]||a.U}function Hc(a,b,c){c&&a.ze||(a.pc=b[0]||a.ia,a.sf=b[2]||a.ka,a.Md=b[4]||a.ea);if(c||void 0===c)a.re=b[0]||a.ia,a.fg=b[2]||a.ka,a.si=b[4]||a.ea}function fc(a,b,c){b||(b=5==a.type?Qc:6==a.type?Sc:Tc);Hc(a,b,c);Jc(a,b,c)}
var Tc=[],lc=[B.prototype.Fa,B.prototype.tc,B.prototype.sb,B.prototype.Cd,B.prototype.Ya,B.prototype.Wc],Ic=[B.prototype.Da,B.prototype.bc,B.prototype.qb,B.prototype.sd,B.prototype.Pa,B.prototype.Vc],Sc=[B.prototype.Ja,B.prototype.Cc,B.prototype.Jb,B.prototype.Gd,B.prototype.fb,B.prototype.hd],Qc=[B.prototype.Ka,B.prototype.Uc,B.prototype.xd,B.prototype.Hd,B.prototype.gb,B.prototype.jd];
if(Ab)var kc=[B.prototype.Ca,B.prototype.Ub,B.prototype.Tb,B.prototype.qd,B.prototype.Oa,B.prototype.ce],jc=[B.prototype.aa,B.prototype.ra,B.prototype.pa,B.prototype.ya,B.prototype.fa,B.prototype.va],Vc=[B.prototype.Ga,B.prototype.uc,B.prototype.Db,B.prototype.Fd,B.prototype.cb,B.prototype.Xc];
function Wc(a,b){bb.call(this,"CPU",a,Wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Y={};this.Y.Id=b;this.Y.Wd=c;this.Y.Ag=Math.round(this.Y.Id/1E4)/100;this.Y.He=this.Y.Ag*this.Y.Wd;this.la.Ib=!1;this.la.yi=!1;this.la.Cf=a.autoStart;this.la.oj=!1;this.la.Xe=!1;this.Y.Lf=this.Y.kf=0;this.Y.Mf=a.csStart;this.Y.jf=a.csInterval;this.Y.lf=a.csStop;this.Ai=this.Ne.bind(this);xb(this)}jb(Wc);var Xc=["power","reset"];l=Wc.prototype;
l.Ic=function(a,b,c,d){this.X=a;this.ga=b;this.ha=d;for(b=0;b<Xc.length;b++)(c=this.qa[Xc[b]])&&this.X.Pb(null,Xc[b],c);this.Tb=Jb(a,"FPU");this.N=Jb(a,"ChipSet");a=Yc(a,"autoStart");null!=a&&(this.la.Cf="true"==a?!0:"false"==a?!1:!!a);xb(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
l.hc=function(a,b){if(!b){if(a&&this.restore){Zc(this);if(!this.restore(a))return!1;$c(this)}else this.reset();this.ha?this.ha.qh():this.O("No debugger detected")}ad(this);return!0};l.gc=function(a){return a?this.save():!0};l.Cf=function(){return this.la.Cf||!this.ha&&void 0===this.qa.run?(this.Ne(!0),!0):!1};l.vj=function(){return 0};
function $c(a){void 0===a.Y.Mf&&(a.Y.Mf=0);void 0===a.Y.jf&&(a.Y.jf=-1);void 0===a.Y.lf&&(a.Y.lf=-1);a.la.Xe=0<=a.Y.Mf&&0<a.Y.jf;a.la.Xe&&(a.Y.Lf=0,a.Y.kf=a.Y.Mf-a.uc)}function bd(a,b){if(a.la.Xe){var c=!1;a.Y.Lf=a.Y.Lf+a.vj()|0;a.Y.kf-=b;0>=a.Y.kf&&(a.Y.kf+=a.Y.jf,c=!0);0<=a.Y.lf&&a.Y.lf<=cd(a)&&(a.Y.jf=a.Y.lf=-1,$c(a),a.Wb(),c=!0);c&&a.O(cd(a)+" cycles: checksum="+r(a.Y.Lf))}}
l.Pb=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.qa[b]=c;a=!0;break;case "run":this.qa[b]=c;c.onclick=function(){var a;if(a=d.X)if(a=d.X,a.la.ic)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.la.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.la.ic);c++);c==h.length&&(b=a);w("The "+b.type+" component ("+b.id+") is not "+(b.la.ready?"powered yet":"ready yet"+(b.yg?" (waiting for notification)":""))+".");a=!1}a&&(d.la.Ib?d.Wb(!0):
d.Ne(!0))};a=!0;break;case "speed":this.qa[b]=c;a=!0;break;case "setSpeed":this.qa[b]=c,c.onclick=function(){dd(d,d.Y.Wd<<1,!0)},c.textContent=this.Y.He.toFixed(2)+"Mhz",a=!0}return a};function ed(a,b){a.la.Ib&&(b=a.A-b,a.A-=b,a.fb-=b)}function fd(a,b,c){a.uc+=b;c&&(a.fb=a.A=0)}
function gd(a,b){var c=30;60>c&&(c=60);2>c&&(c=2);var d=1;b&&1<a.Y.Wd&&a.Y.ne&&(d=a.Y.ne/a.Y.Ag);a.Y.Dj=Math.round(1E3/30);a.Y.bn=Math.floor(a.Y.Id/c*d);a.Y.Ah=Math.floor(a.Y.Id/30*d);a.Y.Fj=Math.floor(a.Y.Id/60*d);a.Y.Ej=Math.floor(a.Y.Id/2*d);b||(a.Y.mf=a.Y.Ah,a.Y.Of=a.Y.Fj,a.Y.Nf=a.Y.Ej);a.Y.Bh=0}function cd(a,b){var c=a.uc+a.Ub+a.fb-a.A;b&&1<a.Y.Wd&&a.Y.ne>a.Y.Ag&&(c=Math.round(c/a.Y.Wd));return c}function Zc(a){a.Y.ne=0;a.uc=a.Ub=a.fb=a.A=0;$c(a);dd(a,1)}
function dd(a,b,c){var d=!1;if(void 0!==b){.8>a.Y.ne/a.Y.He?b=1:d=!0;a.Y.Wd=b;b=a.Y.Ag*a.Y.Wd;if(a.Y.He!=b){a.Y.He=b;b=a.Y.He.toFixed(2)+"Mhz";var e=a.qa.setSpeed;e&&(e.textContent=b);a.O("target speed: "+b)}c&&a.X&&a.X.wd()}fd(a,a.Ub);a.Ub=0;a.Y.oe=ta();a.Y.Ie=0;gd(a);return d}
l.Ne=function(a){if(vb(this,!0)){if(!this.la.Ib){dd(this);this.X&&this.X.start(this.Y.oe,cd(this));this.la.Ib=!0;this.la.yi=!0;this.N&&this.N.start();var b=this.qa.run;b&&(b.textContent="Halt");this.X&&(this.X.pd(!0),a&&this.X.wd(!0))}this.Y.Bh>=this.Y.Id&&gd(this,!0);this.Y.Pf=0;this.Y.Bg=ta();this.Y.Ie&&(a=this.Y.Bg-this.Y.Ie,a>this.Y.Dj&&(this.Y.oe+=a,this.Y.oe>this.Y.Bg&&(this.Y.oe=this.Y.Bg)));try{do{var c=this.la.Xe?1:this.Y.bn;if(this.N){hd(this.N);var d=this.N;a=c;var e=d.V[0];if(e.De){var f=
(cd(d.F,d.ka)-e.vd)/d.gb|0,g=id(d,0)-f;6==e.mode&&(g-=f);var h=g*d.gb|0;6==e.mode&&(h>>=1);a>h&&(a=h)}var c=a,k=this.N;a=c;if(k.A&&k.A[11]&64){var m=k.ua-cd(k.F,k.ka);0<m&&a>m&&(a=m)}c=a}try{this.wf(c)}catch(t){if("number"!=typeof t)throw t;}var n=this.fb-this.A;this.Ub+=n;this.Y.Pf+=n;fd(this,0,!0);bd(this,n);this.Y.Of-=n;0>=this.Y.Of&&(this.Y.Of+=this.Y.Fj,this.X&&jd(this.X));this.Y.Nf-=n;0>=this.Y.Nf&&(this.Y.Nf+=this.Y.Ej,this.X&&this.X.pd());this.Y.mf-=n;if(0>=this.Y.mf){this.Y.mf+=this.Y.Ah;
break}}while(this.la.Ib)}catch(t){this.Wb();ad(this);this.X&&this.X.stop(ta(),cd(this));vb(this,!1);zb(this,t.stack||t.message);return}c=setTimeout;d=this.Ai;this.Y.Ie=ta();e=this.Y.Dj;this.Y.Pf&&(e=Math.round(e*this.Y.Pf/this.Y.Ah));e-=this.Y.Ie-this.Y.Bg;if(f=this.Y.Ie-this.Y.oe)this.Y.ne=Math.round(this.Ub/(10*f))/100,864E5<=f&&(this.uc=0,this.N&&hd(this.N,!0),dd(this));if(0>e||this.Y.ne<this.Y.He)-1E3>e&&(this.Y.oe-=e),e=0;this.Y.Bh+=this.Y.Pf;this.Y.Ie+=e;c(d,e)}else ad(this),this.X&&this.X.stop(ta(),
cd(this))};l.wf=function(){return 0};l.Wb=function(a){wb(this,!0);this.fb-=this.A;this.A=0;fd(this,this.Ub);this.Ub=0;if(this.la.Ib){this.la.Ib=!1;this.N&&this.N.stop();var b=this.qa.run;b&&(b.textContent="Run")}this.la.complete=a};function ad(a,b){a.X&&(jd(a.X,b),a.X.pd(b))}
function kd(a,b,c,d){this.F=a;this.ha=a.ha;this.id=b;this.kc=c||"";this.Z=0;this.Ta=65535;this.Zb=this.Ta+1;this.Lb=this.Gc=this.ext=this.wb=this.type=this.Aa=0;this.Xb=-1;this.ba=this.Tc=2;this.R=this.Ba=65535;this.X=this.uh;this.ga=this.ij;this.qa=this.kj;this.A={Z:-1,Aa:0,Ta:0,wb:0,type:0,ext:0,Xb:-1};1==this.id&&(this.$f=0,this.C=null,this.df=!1,this.N=Array(32),this.B=[]);ld(this,!0,d)}function md(a,b){a.B.push(b);return[a.B.length,1]}l=kd.prototype;
l.uh=function(a){this.Z=a&65535;return this.Aa=this.Z<<4};l.zg=function(a,b){var c,d,e=this.F;a&=65535;a&4?(c=e.Bc.Aa,d=c+e.Bc.Ta|0):(c=e.Ec,d=e.zd);if(c){c=c+(a&65528)|0;if(d-c|0)return e.A-=15,nd(this,c,a,b);6>this.id&&E.call(e,b&&3==this.id?10:13,a&65532)}return-1};l.Xm=function(a){var b=this.F;a=b.Mc+(a<<2);var c=b.na(a);b.ca&=-769;return this.load(b.na(a+2))+c|0};
l.Wm=function(a){var b=this.F;a<<=3;var c=b.Mc+a|0;if(7<=(b.Sd-c|0))return this.C=!0,a=nd(this,c,a),-1!==a&&(a+=this.$f),a;E.call(b,13,a|2);return-1};l.ij=function(a){return this.Aa+a|0};l.kj=function(a){return this.Aa+a|0};l.hj=function(a,b){return(a>>>0)+b<=this.Zb?this.Aa+a|0:this.tg()};l.sl=function(a,b){return(a>>>0)+b>this.Zb?this.Aa+a|0:this.tg()};l.tg=function(){E.call(this.F,13,0);return-1};l.jj=function(a,b){return(a>>>0)+b<=this.Zb?this.Aa+a|0:this.ug()};
l.tl=function(a,b){return(a>>>0)+b>this.Zb?this.Aa+a|0:this.ug()};l.ug=function(){E.call(this.F,13,0);return-1};function sd(a,b,c,d,e){a.Z=b;a.Aa=d;a.Ta=e;a.Zb=(e>>>0)+1;a.wb=c;a.type=c&7936;a.ext=c>>16&192;a.Xb=(b&4?a.F.Bc.Aa:a.F.Ec)+(b&65528)|0;4>a.id&&ld(a,!0)}function td(a,b,c){var d=a.F,e=d.na(b+2),f=d.na(b)|(e&255)<<16,d=d.na(b+4);a.Z=c;a.Aa=f;a.Ta=d;a.Zb=(d>>>0)+1;a.wb=e;a.type=e&7936;a.ext=0;a.Xb=b;4>a.id&&ld(a,!0)}
function nd(a,b,c,d){var e=a.F;if(!d&&c===a.A.Z)return a.Z=c,a.Aa=a.A.Aa,a.Ta=a.A.Ta,a.Zb=(a.A.Ta>>>0)+1,a.wb=a.A.wb,a.type=a.A.type,a.ext=a.A.ext,a.Xb=a.A.Xb,a.A.Z=-1,ld(a,!0,!0,!1),a.Aa;a.A.Z=-1;var f=e.na(b+0),g=e.na(b+4),h=g&7936,k=e.na(b+2)|(g&255)<<16,m=e.na(b+6),n=c&65528;if(80386<=e.ja){var t=f,k=k|(m&65280)<<16,f=f|(m&15)<<16;m&128&&(f=f<<12|4095)}switch(a.id){case 1:var q=a.C;a.df=!1;if(q&&1==c&&a.B.length){var A=a.B[a.$f-1];if(A&&!A())return-1}var F=c&3,C=(g&24576)>>13,A=-1,D,L;n||b>=e.Ec&&
b<e.zd&&(h=0);if(6144<=h)null!=d?A=0:!1!==q?(h&1024?C<=a.Lb&&(A=0):F<=a.Lb&&C==a.Lb&&(A=0),A||(c=c&-4|a.Lb&3)):F>=a.Lb&&(F>a.Lb&&(A=H(e),ud(e,H(e),!0),I(e,A),a.df=!0),A=0);else{if(256==h||2304==h)return vd(a,c,q)?a.Aa:-1;if(1024==h)A=2,L=0,F<a.Lb&&(F=a.Lb);else if(3072==h)A=4,L=0,F<a.Lb&&(F=a.Lb);else if(1536==h)A=2,L=148224;else if(3584==h)A=4,L=148224;else if(1792==h)A=2,L=147712;else if(3840==h)A=4,L=147712;else if(1280==h)return vd(a,k&65535,q)?a.Aa:-1}0<A&&!(g&32768)&&(A=0);if(0<A&&(n=a.Lb,D=
b==e.Mc+c,F<=C&&(!D||0<=e.qb||n<=C))){b=k&65535;h&2048&&(f=t|m<<16);m=h=0;d=b&3;if(d<n){if(-1===a.zg(b,!0))return-1;m=e.Sa.Aa;e.Sa.type&2048?(c=(d<<3)+4,k=4):(c=(d<<2)+2,k=2);h=e.na(m+c+k);if(!h)return E.call(e,10,h),-1;if(-1===e.ta.zg(h,!0))return-1;m=2==k?e.na(m+c):e.oa(m+c)}c=e.ca;e.ca&=~L;c&131072&&wd(e,!0,!1);if(-1===a.zg(b,!1))return-1;xd(e,A);a.$f=f;if(d<n){if(!0!==q)return-1;A=J(e);f=0;for(g&=31;g--;)a.N[f++]=yd(e,e.ta,A),A+=2;q=e.ta.Z;g=J(e);ud(e,h,!0);I(e,m);c&131072&&(xd(e,4),zd(e,e.Ob.Z,
4,2),e.Ob.load(0),zd(e,e.Nb.Z,4,2),e.Nb.load(0),zd(e,e.vb.Z,4,2),Ad(e,0),zd(e,e.Xa.Z,4,2),Bd(e,0));zd(e,q,e.ba,2);for(K(e,g);f;)K(e,a.N[--f]);a.df=!0}return a.Aa}if(A)return E.call(e,13,c&65532|(D?2:0)),-1;if(!(g&32768))return E.call(e,11,c&65532|(D?2:0)),-1;break;case 2:if(n){if(4096>h||2048==(h&2560))return E.call(e,13,c&65532),-1;if(!(g&32768))return E.call(e,11,c&65532),-1}break;case 3:if(!n||4096>h||512!=(h&2560))return E.call(e,13,c&65532),-1;if(!(g&32768))return E.call(e,12,c&65532),-1;break;
case 4:q=h&-513;if(!n||256!=q&&2304!=q)return E.call(e,13,c&65532),-1;2304==q&&(a.Zi=k+e.na(k+102)|0,a.ml=k+a.Ta|0);break;case 6:if(!(h&4096)&&768<h&&2304!=h&&2816!=h)return-1}d?(a.A.Z=c,a.A.Aa=k,a.A.Ta=f,a.A.wb=g,a.A.type=h,a.A.ext=m,a.A.Xb=b):(a.Z=c,a.Aa=k,a.Ta=f,a.Zb=(f>>>0)+1,a.wb=g,a.type=h,a.ext=m,a.Xb=b,ld(a,!0,!0,!1));return k}
function vd(a,b,c){var d=a.F,e=a.Lb,f=d.Sa.Z,g=d.Sa.Aa;if(!c){if(!(d.Sa.type&512))return E.call(d,13,b&65532),!1;d.jb(d.Sa.Xb+4,d.Sa.wb&=-513)}if(-1===d.Sa.load(b))return!1;var h=d.Sa.Aa;if(!1!==c){if(d.Sa.type&512)return E.call(d,13,b&65532),!1;d.jb(d.Sa.Xb+4,d.Sa.wb|=512)}d.Sa.type=d.Sa.type&-513|d.Sa.wb&512;256==d.Sa.type||768==d.Sa.type?(d.jb(g+14,M(d)),d.jb(g+16,Cd(d)),d.jb(g+18,d.G),d.jb(g+20,d.I),d.jb(g+22,d.M),d.jb(g+24,d.H),d.jb(g+26,J(d)),d.jb(g+28,d.P),d.jb(g+30,d.K),d.jb(g+32,d.J),d.jb(g+
34,d.Xa.Z),d.jb(g+36,d.wa.Z),d.jb(g+38,d.ta.Z),d.jb(g+40,d.vb.Z),d.Bc.load(d.na(h+42)),Dd(d,d.na(h+16)|(c?16384:0)),d.G=d.na(h+18),d.I=d.na(h+20),d.M=d.na(h+22),d.H=d.na(h+24),d.P=d.na(h+28),d.K=d.na(h+30),d.J=d.na(h+32),d.Xa.load(d.na(h+34)),d.vb.load(d.na(h+40)),Ed(d,d.na(h+14),d.na(h+36)),b=38,g=26,a.Lb<e&&(g=(a.Lb<<2)+2,b=g+2),ud(d,d.na(h+b),!0),I(d,d.na(h+g))):(d.nb(g+28,d.Od),d.nb(g+32,M(d)),d.nb(g+36,Cd(d)),d.nb(g+40,d.G),d.nb(g+44,d.I),d.nb(g+48,d.M),d.nb(g+52,d.H),d.nb(g+56,J(d)),d.nb(g+
60,d.P),d.nb(g+64,d.K),d.nb(g+68,d.J),d.nb(g+72,d.Xa.Z),d.nb(g+76,d.wa.Z),d.nb(g+80,d.ta.Z),d.nb(g+84,d.vb.Z),d.nb(g+88,d.Nb.Z),d.nb(g+92,d.Ob.Z),Fd.call(d,d.oa(h+28)),d.Bc.load(d.na(h+96)),Dd(d,d.oa(h+36)|(c?16384:0)),d.G=d.oa(h+40),d.I=d.oa(h+44),d.M=d.oa(h+48),d.H=d.oa(h+52),d.P=d.oa(h+60),d.K=d.oa(h+64),d.J=d.oa(h+68),d.Xa.load(d.na(h+72)),d.vb.load(d.na(h+84)),d.Nb.load(d.na(h+88)),d.Ob.load(d.na(h+92)),Ed(d,d.oa(h+32),d.na(h+76)),b=80,g=56,a.Lb<e&&(g=(a.Lb<<3)+4,b=g+4),ud(d,d.na(h+b),!0),I(d,
d.oa(h+g)));c&&d.jb(h+0,f);d.$a|=8;return!0}l.save=function(){return[this.Z,this.Aa,this.Ta,this.wb,this.id,this.kc,this.Lb,this.Gc,this.Xb,this.Tc,this.Ba,this.ba,this.R,this.type,this.Zb]};l.restore=function(a){"number"==typeof a?this.load(a):(this.Z=a[0],this.Aa=a[1],this.Ta=a[2],this.wb=a[3],this.id=a[4],this.kc=a[5],this.Lb=a[6],this.Gc=a[7],this.Xb=a[8],this.Tc=a[9]||2,this.Ba=a[10]||65535,this.ba=a[11]||2,this.R=a[12]||65535,this.type=a[13]||this.wb&7936,this.Zb=a[14]||(this.Ta>>>0)+1)};
function ld(a,b,c,d){void 0===c&&(c=!!(a.F.$a&1));a.bd=!1;if(c)if(a.load=a.zg,a.Cj=a.Wm,a.mc=a.hj,a.nc=a.jj,void 0===d&&(d=!!(a.F.ca&131072)),d)a.load=a.X,a.mc=a.ga,a.nc=a.qa,a.Lb=a.Gc=3,a.ba=2,a.R=a.Ba=65535,a.Ta=65535,a.Zb=a.Ta+1,a.Tc=a.ba,a.Xb=-1,a.df=!1;else{if(!(a.Z&-4))a.mc=a.tg,a.nc=a.ug;else if(a.type&4096){6144==(a.type&6656)&&(a.mc=a.tg);if(a.type&2048||!(a.type&512))a.nc=a.ug;1024==(a.type&3072)&&(a.mc==a.hj&&(a.mc=a.sl),a.nc==a.jj&&(a.nc=a.tl),a.bd=!0);b&&6>a.id&&a.Z&-4&&-1!==a.Xb&&(c=
a.Xb+5,d=a.F.Qa(c),d&1||a.F.qc(c,d|1))}b&&(a.Lb=a.Z&3,a.Gc=(a.wb&24576)>>13,80386>a.F.ja||!(a.ext&64)?(a.ba=2,a.R=65535):(a.ba=4,a.R=-1),a.Tc=a.ba,a.Ba=a.R)}else a.load=a.uh,a.Cj=a.Xm,a.mc=a.ij,a.nc=a.kj,a.Lb=a.Gc=0,a.Xb=-1,a.df=!1}
function Gd(a){this.ja=+a.model||8088;var b=a.stepping;this.Uc=this.ja+(b?ea(b,16):0);switch(this.ja){default:b=4772727;break;case 80286:b=6E6;break;case 80386:b=16E6}Wc.call(this,a,b);this.ag=61442;this.Cc=1792;this.Zf=28672;this.Cd=4;this.ra=255;this.B=80286<=this.ja?Cb:Bb;this.W=Hd;this.eg=Id;this.kg=Jd;this.lg=Kd;if(80186<=this.ja&&(this.W=Hd.slice(),this.eg=Id.slice(),this.kg=Jd.slice(),this.ra=31,this.W[15]=Ld,this.W[96]=Md,this.W[97]=Nd,this.W[98]=Od,this.W[99]=Ld,this.W[100]=Ld,this.W[101]=
Ld,this.W[102]=Ld,this.W[103]=Ld,this.W[104]=Pd,this.W[105]=Qd,this.W[106]=Rd,this.W[107]=Sd,this.W[108]=Td,this.W[109]=Xd,this.W[110]=Yd,this.W[111]=Zd,this.W[192]=ee,this.W[193]=fe,this.W[200]=ge,this.W[201]=he,this.W[241]=ie,this.eg[7]=je,this.kg[7]=je,80286<=this.ja)){this.ag=2;this.Cc|=28672;this.Cd=0;this.W[15]=ke;this.tc=le.slice();for(a=0;a<this.tc.length;a++)this.tc[a]||(this.tc[a]=me);this.W[84]=ne;this.W[99]=oe;if(80386<=this.ja){var c;this.Zf=0;this.Cc|=196608;this.W[100]=pe;this.W[101]=
qe;this.W[102]=re;this.W[103]=se;for(c in N)this.tc[+c]=N[+c];80546<=this.Uc&&80562>=this.Uc&&(this.tc[166]=te,this.tc[167]=ue)}}this.Hd=[];this.je=[];this.le=0;Zc(this);this.la.complete=this.la.nj=!1;this.Wg=0;this.kd=this.sa=[];this.La=this.Sb=this.Fa=this.Fd=this.hd=this.Gb=this.Db=0;ve(this)}jb(Gd,Wc);function we(a,b,c,d){b=(d?a.kd:a.sa)[b>>>a.La];c?--b.Ae||Oc(b):--b.ze||Pc(b);d&&Xb(a)}
function xe(a){var b;if(a.sa===a.kd){a.sa=Array(a.Fd);a.ke=new B(null,0,0,5,null,a);Sb(a.ke,a.ha);for(b=0;b<a.Fd;b++)a.sa[b]=a.ke;a.jd=new B;a.dg=Array(512);a.me=0}else for(var c=0;c<a.Gd.length;c++){b=a.Gd[c];var d=a.sa[b];512>a.me&&(a.dg[a.me++]=d);a.sa[b]=a.ke}a.Gd=[]}function Xb(a){a.$a&-2147483648&&xe(a)}
function Nc(a,b,c,d){var e=(b&-4194304)>>>20,f=a.kd[(a.Od+e&a.Gb)>>>a.La],g=f.Md(e);if(!(g&1))return d||ye.call(a,b,!1,c),a.jd;if(!(g&4)&&3==a.pa)return d||ye.call(a,b,!0,c),a.jd;var h=(b&4190208)>>>10,g=a.kd[((g&-4096)+h&a.Gb)>>>a.La],k=g.Md(h);if(!(k&1))return d||ye.call(a,b,!1,c),a.jd;if(!(k&4)&&3==a.pa)return d||ye.call(a,b,!0,c),a.jd;c=a.kd[((k&-4096)+(b&4095)&a.Gb)>>>a.La];if(d)return c;d=b>>>a.La;k=a.sa[d];b&=-4096;var m;0<a.me?(m=a.dg[--a.me],m.qh(b)):m=new B(b,0,0,6);b=m;b.Bd=c;b.yb=f;b.A=
e>>2;b.zb=g;b.B=h>>2;Ab&&ic&&c.da&&!c.controller&&!c.ze&&!c.Ae?(b.Za=c.Za,b.de=c.de,b.da=c.da,fc(b,Vc)):(b.ga=c?Gc(32):0,b.V=c?Gc(96):0,fc(b,Sc));Sb(b,a.ha,k);a.sa[d]=b;a.Gd.push(d);return b}function ze(a){a.sa!==a.kd&&(a.sa=a.kd,a.ke=null,a.Gd=null,a.jd=null)}l=Gd.prototype;l.reset=function(){this.la.Ib&&this.Wb();ve(this);Zc(this);this.la.error=!1};
function Ae(a,b){var c;switch(b){case 0:c=a.G;break;case 1:c=a.I;break;case 2:c=a.M;break;case 3:c=a.H;break;case 4:c=J(a);break;case 5:c=a.P;break;case 6:c=a.K;break;case 7:c=a.J}return c}function Be(a,b,c){switch(b){case 0:a.G=c;break;case 1:a.I=c;break;case 2:a.M=c;break;case 3:a.H=c;break;case 4:I(a,c);break;case 5:a.P=c;break;case 6:a.K=c;break;case 7:a.J=c}}
function ve(a){a.G=0;a.H=0;a.I=0;a.M=0;a.gb=0;a.P=0;a.K=0;a.J=0;a.cb=!1;a.ia=a.va=0;a.aa=0;a.mg=0;a.L=0;a.$a=65520;a.Mc=0;a.Sd=1023;a.ca=a.Pa=0;a.Wc=a.sd=a.Vc=a.Xc=0;a.qb=-1;a.bc=a.sb=-1;a.qe=a.U=-1;a.wa=new kd(a,1,"CS");a.vb=new kd(a,2,"DS");a.Xa=new kd(a,2,"ES");a.ta=new kd(a,3,"SS");I(a,0);ud(a,0);if(80386<=a.ja){switch(a.Uc){case 80562:case 80563:a.M=771;break;case 80578:a.M=772;break;case 80594:a.M=773;break;case 80595:case 80596:a.M=776}a.$a=16;a.ti=0;a.se=0;a.Od=0;a.Ja=[0,0,0,0,null,null,0,
0];a.Ee=[null,null,null,null,null,null,0,0];a.Nb=new kd(a,2,"FS");a.Ob=new kd(a,2,"GS");ze(a)}a.rf=new kd(a,0,"NULL");a.ka=a.vb;a.Ka=a.ta;a.S=a.Ia=0;a.D=a.C=-1;a.$b=a.rf;a.ua=0;if(80286>a.ja)Ed(a,0,65535);else{a.Ec=0;a.zd=65535;a.Bc=new kd(a,5,"LDT",!0);a.Sa=new kd(a,4,"TSS",!0);a.Da=new kd(a,6,"VER",!0);Ed(a,65520,61440);var b,c=M(a);b=a.wa;var d=-65536;80386>b.F.ja&&(d&=16777215);b=b.Aa=d;a.Ha=b+c|0;a.hf=(b>>>0)+(a.wa.Ta>>>0)+1}Dd(a,0);wd(a)}
function Ce(a){2==a.Tc?(a.cc=a.na,a.Oa=De,a.Ya=Ee,a.Jb=Fe,2==a.ba?(a.V=Ie,a.ea=Je,a.ya=Ke):(a.V=Le,a.ea=Me,a.ya=Ne)):(a.cc=a.oa,a.Oa=Oe,a.Ya=Pe,a.Jb=Qe,2==a.ba?(a.V=cf,a.ea=df,a.ya=ef):(a.V=ff,a.ea=gf,a.ya=hf))}function xd(a,b){a.ba!=b&&(a.Ia|=1024,a.ba=b,a.R=2==b?65535:-1,jf(a))}function jf(a){2==a.ba?(a.Ga=32768,a.tb=a.na,a.rc=a.jb,2==a.Tc?(a.V=Ie,a.ea=Je,a.ya=Ke):(a.V=cf,a.ea=df,a.ya=ef)):(a.Ga=-2147483648,a.tb=a.oa,a.rc=a.nb,2==a.Tc?(a.V=Le,a.ea=Me,a.ya=Ne):(a.V=ff,a.ea=gf,a.ya=hf))}
function kf(a){a.Tc=a.wa.Tc;a.Ba=a.wa.Ba;Ce(a);a.ba=a.wa.ba;a.R=a.wa.R;jf(a);a.Ia&=-3073}l.vj=function(){var a=this.G+this.H+this.I+this.M+J(this)+this.P+this.K+this.J|0;return a=a+M(this)+this.wa.Z+this.vb.Z+this.ta.Z+this.Xa.Z+Cd(this)|0};function lf(a,b,c){void 0===a.Hd[b]&&(a.Hd[b]=[]);a.Hd[b].push(c)}function mf(a,b,c){c&&(null==a.je[b]&&a.le++,a.je[b]=c)}function nf(a,b){var c=a.je[b];null!=c&&(c(--a.le),delete a.je[b])}
function of(a,b){for(var c=a.Ja[7],d=c>>16,e=0;4>e;e++){if(c&3){var f=!!(d&1),g=a.Ja[e],g=g&~(d>>2&3);b?a.sa[g>>>a.La].Rd(g&a.Fa,f,a):(g=a.sa[g>>>a.La],f?--g.Ae||Oc(g):--g.ze||Pc(g))}c>>=2;d>>=4}}function Lc(a,b,c,d){if(!(a.S&8192)&&a.Ja[7]&255){c--;var e=a.Ja[7],f=e>>16;d=d?1:0==d?3:0;for(var g=0;4>g;g++){if(e&3&&(f&3)==d){var h=f>>2;if(b+c>=a.Ja[g]&&b<=a.Ja[g]+h){a.Ja[6]|=1<<g;a.ua|=2;break}}e>>=2;f>>=4}}}
function wd(a,b,c){void 0===b&&(b=!!(a.$a&1));void 0===c&&(c=!!(a.ca&131072));a.lg=b&&!c?pf:Kd;ld(a.wa,!1,b,c);ld(a.vb,!1,b,c);ld(a.ta,!1,b,c);ld(a.Xa,!1,b,c);80386<=a.ja&&(ld(a.Nb,!1,b,c),ld(a.Ob,!1,b,c));kf(a)}
l.save=function(){var a=new qf(this);a.set(0,[this.G,this.H,this.I,this.M,J(this),this.P,this.K,this.J]);var b=M(this),c=this.wa.save(),d=this.vb.save(),e=this.ta.save(),f=this.Xa.save(),g;null!=this.Ec?(g=[this.$a,this.Ec,this.zd,this.Mc,this.Sd,this.Bc.save(),this.Sa.save(),this.Pa],80386<=this.ja&&(g.push(this.ti),g.push(this.se),g.push(this.Od),g.push(this.Ja),g.push(this.Ee))):g=null;b=[b,c,d,e,f,g,Cd(this)];80386<=this.ja&&(b.push(this.Nb.save()),b.push(this.Ob.save()));a.set(1,b);a.set(2,[this.ka.kc,
this.Ka.kc,this.S,this.Ia,this.ua,this.D,this.C]);a.set(3,[0,this.uc,this.Y.Wd]);a.set(4,oc(this.ga,!!(this.$a&-2147483648)));return a.data()};
l.restore=function(a){var b=a[0];this.G=b[0];this.H=b[1];this.I=b[2];this.M=b[3];var c=b[4];this.P=b[5];this.K=b[6];this.J=b[7];b=a[1];this.wa.restore(b[1]);this.vb.restore(b[2]);this.ta.restore(b[3]);this.Xa.restore(b[4]);var d=b[5];d&&d.length&&(this.$a=d[0],this.Ec=d[1],this.zd=d[2],this.Mc=d[3],this.Sd=d[4],this.Bc.restore(d[5]),this.Sa.restore(d[6]),this.Pa=d[7],80386<=this.ja&&(this.ti=d[8],this.se=d[9],this.Od=d[10],this.Ja=d[11],this.Ee=d[12]),wd(this));Dd(this,b[6]);var d=!1,e;a:{e=this.ga;
var f=a[4],g;for(g=0;g<f.length-1;g+=2){var h=f[g],k=f[g+1];if(k&&k.length<e.fa){for(var m=0,n=Array(e.fa),t=0;t<k.length-1;)for(var q=k[t++],A=k[t++];q--;)n[m++]=A;k=n}m=e.sa[h];if(!m||!m.restore(k)){w("Unable to restore memory block "+h);e=!1;break a}}void 0!==f[g]&&Tb(e,f[g]);e=!0}e&&(Ed(this,b[0],this.wa.Z),I(this,c),ud(this,this.ta.Z),80386<=this.ja&&(this.Nb.restore(b[7]),this.Ob.restore(b[8])),d=!0);b=a[2];this.ka=null!=b[0]&&rf(this,b[0])||this.vb;this.Ka=null!=b[1]&&rf(this,b[1])||this.ta;
this.S=b[2];this.Ia=b[3];this.ua=b[4];this.D=b[5];this.C=b[6];b=a[3];this.uc=b[1];dd(this,b[2]);return d};function rf(a,b){switch(b){case "CS":return a.wa;case "DS":return a.vb;case "SS":return a.ta;case "ES":return a.Xa;case "NULL":return a.rf;default:return[0,b,0,0,""]}}function sf(a,b){null!=Ed(a,M(a),b)&&(a.S|=a.Cd)}function Ad(a,b){-1!==a.vb.load(b)&&(a.S|=a.Cd)}
function ud(a,b,c){var d=J(a);-1!==a.ta.load(b)&&(I(a,d),a.ta.bd?(a.Sg=a.ta.Aa+a.ta.Ba|0,a.qd=a.ta.Aa+a.ta.Ta|0):(a.Sg=a.ta.Aa+a.ta.Ta|0,a.qd=a.ta.Aa),c||(a.S|=4))}function Bd(a,b){-1!==a.Xa.load(b)&&(a.S|=a.Cd)}function M(a){return a.Ha-a.wa.Aa|0}function O(a,b){a.Ha=a.wa.Aa+(b&a.R)|0}function tf(a,b){a.Ha=b;a.hf=(a.wa.Aa>>>0)+(a.wa.Ta>>>0)+1;a.pa=a.wa.Lb;kf(a)}function Ed(a,b,c,d){var e=a.wa;e.$f=b;e.C=d;b=e.load(c);return-1!==b?(tf(a,b+(a.wa.$f&a.wa.R)),a.wa.df):null}
function uf(a,b){b=(a.Ha>>>0)+b;b>a.hf&&(8088>=a.ja||a.wa.Ta==a.wa.Ba?b=a.wa.Aa+(b-a.hf&a.R):E.call(a,13,0));return b|0}function vf(a){a.Ha=a.qe}function J(a){return a.gb&~a.ta.Ba|a.fa-a.ta.Aa}function I(a,b){a.gb=b;a.fa=a.ta.Aa+(b&a.ta.Ba)|0}function wf(a,b,c,d,e,f){if(63!=(e&63)&&e!=a.resultType){var g=(e^a.resultType)&a.resultType;g&&(g&1&&xf(a),g&2&&yf(a),g&4&&zf(a),g&8&&Af(a),g&16&&Bf(a),g&32&&Cf(a))}f?(a.Wc=d,a.Vc=b):(a.Wc=b,a.Vc=d);a.sd=c;a.Xc=d;a.resultType=e}
function Df(a,b,c,d,e){a.resultType=c|26;a.Xc=b;d?Ef(a):Ff(a);e?Gf(a):Hf(a);return b}function If(a,b,c,d){c&d?Ef(a):Ff(a);(b^c)&d?Gf(a):Hf(a)}function Jf(a){return xf(a)?1:0}function xf(a){a.resultType&1&&(a.ca&=-2,(a.Wc^(a.Wc^a.sd)&(a.sd^a.Vc))&a.resultType&-2147450752&&(a.ca|=1),a.resultType&=-2);return a.ca&1}function yf(a){a.resultType&2&&(a.ca&=-5,38505>>((a.Xc^a.Xc>>4)&15)&1&&(a.ca|=4),a.resultType&=-3);return a.ca&4}
function zf(a){a.resultType&4&&(a.ca&=-17,(a.Vc^a.Wc^a.sd)&16&&(a.ca|=16),a.resultType&=-5);return a.ca&16}function Af(a){a.resultType&8&&(a.ca&=-65,a.Xc&((a.resultType&-2147450752)-1|a.resultType&-2147450752)||(a.ca|=64),a.resultType&=-9);return a.ca&64}function Bf(a){a.resultType&16&&(a.ca&=-129,a.Xc&a.resultType&-2147450752&&(a.ca|=128),a.resultType&=-17);return a.ca&128}
function Cf(a){a.resultType&32&&(a.ca&=-2049,(a.Wc^a.Vc)&(a.sd^a.Vc)&a.resultType&-2147450752&&(a.ca|=2048),a.resultType&=-33);return a.ca&2048}function Ff(a){a.resultType&=-2;a.ca&=-2}function Kf(a){a.resultType&=-5;a.ca&=-17}function Lf(a){a.resultType&=-9;a.ca&=-65}function Hf(a){a.resultType&=-33;a.ca&=-2049}function Ef(a){a.resultType&=-2;a.ca|=1}function Mf(a){a.resultType&=-5;a.ca|=16}function Nf(a){a.resultType&=-9;a.ca|=64}function Gf(a){a.resultType&=-33;a.ca|=2048}
function Cd(a){return a.ca&-2262|xf(a)|yf(a)|zf(a)|Af(a)|Bf(a)|Cf(a)}function Of(a,b){b|=a.$a&1|65520;a.$a=a.$a&-65536|b&65535;a.$a&1&&wd(a,!0)}function Dd(a,b,c){a.$a&1||(b&=~a.Zf);void 0===c&&(c=a.pa);c?b=b&-12289|a.ca&12288:a.Pa=(b&12288)>>12;c>a.Pa&&(b=b&-513|a.ca&512);a.resultType=128;a.ca=a.ca&~(a.Cc|2261)|b&(a.Cc|2261)|a.ag;a.ca&256&&(a.ua|=2,a.S|=4)}
function Pf(a,b,c,d){var e=0;if(a.$a&1&&(a.pa>a.Pa||a.ca&131072)&&a.Sa.Zi)for(var f=a.Sa.Zi+(b>>>3),e=(1<<c)-1<<(b&7);e&&f<=a.Sa.ml&&!(a.Qa(f)&e);)e>>>=8,f++;return e?(z(a,256)&&y(a,"checkIOPM("+v(b)+","+c+","+(d?"input":"output")+"): trapped",!0,!0),E.call(a,13,0),!1):!0}
l.Pb=function(a,b,c){switch(b){case "EAX":case "EBX":case "ECX":case "EDX":case "ESP":case "EBP":case "ESI":case "EDI":case "EIP":case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "IP":case "PC":case "CS":case "DS":case "SS":case "ES":case "FS":case "GS":case "CR0":case "CR2":case "CR3":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "V":this.qa[b]=c;this.Wg++;a=!0;break;default:a=this.parent.Pb.call(this,a,b,c)}return a};
function Qf(a,b,c,d){var e=(d?a.kd:a.sa)[(b&a.Db)>>>a.La];e&&5==e.type&&(e=Nc(a,b,!1,!0));if(e){var f=b&a.Fa;if(!c||1==c)return e.re(f,b);if(2==c)return f<a.Fa?e.fg(f,b):e.re(f,b)|Qf(a,b+1,1,d)<<8;if(4==c)return f<a.Fa-2?e.si(f,b):f==a.Fa-1?e.fg(f,b)|Qf(a,b+2,2,d)<<16:e.re(f,b)|Qf(a,b+1,1,d)<<8|Qf(a,b+2,1,d)<<16|Qf(a,b+3,1,d)<<24}return null}l.Qa=function(a){return this.sa[(a&this.Db)>>>this.La].pc(a&this.Fa,a)};
l.na=function(a){var b=a&this.Fa,c=(a&this.Db)>>>this.La;this.A-=this.B.Kg;if(b<this.Fa)return this.sa[c].sf(b,a);b=this.sa[c].pc(b,a);this.S&4096||(b|=this.sa[c+1&this.hd].pc(0,a+1)<<8);return b};l.oa=function(a){var b=a&this.Fa,c=(a&this.Db)>>>this.La;if(b<this.Fa-2)return this.sa[c].Md(b,a);for(var d=0,e=4,f=0,g=4-(b&3);e--;){d|=this.sa[c].pc(b++,a++)<<f;if(this.S&4096)break;--g||(c=c+1&this.hd,b=0);f+=8}return d};l.qc=function(a,b){this.sa[(a&this.Db)>>>this.La].sc(a&this.Fa,b&255,a)};
l.jb=function(a,b){var c=a&this.Fa,d=(a&this.Db)>>>this.La;this.A-=this.B.Kg;c<this.Fa?this.sa[d].zf(c,b&65535,a):(this.sa[d++].sc(c,b&255,a),this.S&4096||this.sa[d&this.hd].sc(0,b>>8&255,a+1))};l.nb=function(a,b){var c=a&this.Fa,d=(a&this.Db)>>>this.La;this.A-=this.B.Kg;if(c<this.Fa-2)this.sa[d].yf(c,b,a);else for(var e=4,f=4-(c&3);e--;){this.sa[d].sc(c++,b&255,a++);if(this.S&4096)break;--f||(d=d+1&this.hd,c=0);b>>>=8}};
function Rf(a,b,c){a.$b=b;a.Ca=c&a.Ba;a.D=b.mc(a.Ca,1);return a.S&1?0:a.Qa(a.D)}function P(a,b){return Rf(a,a.ka,b)}function Sf(a,b){return Rf(a,a.Ka,b)}function Tf(a,b,c){a.$b=b;a.Ca=c&a.Ba;a.D=b.mc(a.Ca,a.ba);return a.S&1?0:a.tb(a.D)}function Q(a,b){a.$b=a.ka;a.Ca=b&a.Ba;a.D=a.$b.mc(a.Ca,2);return a.S&1?0:a.na(a.D)}function Uf(a,b){a.$b=a.Ka;a.Ca=b&a.Ba;a.D=a.$b.mc(a.Ca,2);return a.S&1?0:a.na(a.D)}function R(a,b){a.$b=a.ka;a.Ca=b&a.Ba;a.D=a.$b.mc(a.Ca,4);return a.S&1?0:a.oa(a.D)}
function Vf(a,b){a.$b=a.Ka;a.Ca=b&a.Ba;a.D=a.$b.mc(a.Ca,4);return a.S&1?0:a.oa(a.D)}function Wf(a,b){a.S&2||a.qc(a.$b.nc(a.Ca,1),b)}function Xf(a,b){a.S&2||a.jb(a.$b.nc(a.Ca,2),b)}function Yf(a,b){a.S&2||a.nb(a.$b.nc(a.Ca,4),b)}function yd(a,b,c){return a.tb(b.mc(c,a.ba))}l.xa=function(){var a=uf(this,1),b=this.Qa(this.Ha);this.Ha=a;return b};function Zf(a){var b=uf(a,2),c=a.na(a.Ha);a.Ha=b;return c}function T(a){var b=uf(a,a.Tc),c=a.cc(a.Ha);a.Ha=b;return c}
l.Ma=function(){var a=uf(this,this.ba),b=this.tb(this.Ha);this.Ha=a;return b};l.T=function(){var a=uf(this,1),b=this.Qa(this.Ha)<<24>>24;this.Ha=a;return b};function H(a){var b=a.tb(a.fa);a.fa=a.fa+a.ba|0;var c=a.Sg-a.fa|0;0>c&&0<=(a.Sg^a.fa)&&(8088>=a.ja||!a.ta.bd&&a.ta.Ta==a.ta.Ba||a.ta.bd&&!a.ta.Ta?I(a,a.fa-a.ta.Aa&a.ta.Ba):-1>c&&E.call(a,12,0));return b}
function zd(a,b,c,d){c=a.fa-c|0;0>(c-a.qd|0)&&0<=(a.qd^c)&&(8088>=a.ja||!a.ta.bd&&a.ta.Ta==a.ta.Ba||a.ta.bd&&!a.ta.Ta?(I(a,c-a.ta.Aa&a.ta.Ba),c=a.fa):E.call(a,12,0));switch(d){case 1:a.qc(c,b);break;case 2:a.jb(c,b);break;case 4:a.nb(c,b)}a.fa=c}function K(a,b){var c=a.fa-a.ba|0;0>(c-a.qd|0)&&0<=(a.qd^c)&&(8088>=a.ja||!a.ta.bd&&a.ta.Ta==a.ta.Ba||a.ta.bd&&!a.ta.Ta?(I(a,c-a.ta.Aa&a.ta.Ba),c=a.fa):E.call(a,12,0));a.rc(c,b);a.fa=c}
function $f(a,b,c){var d=4;1==b.length&&(d=1,c=c?1:0);if(80386>a.ja)2<b.length&&(b=b.substr(1,2));else if("PS"==b||2<b.length)d=8;a.qa[b]&&(void 0===c&&(zb(a,"Value for "+b+" is invalid"),a.Wb()),d=!a.la.Ib||a.la.oj?r(c,d):"--------".substr(0,d),a.qa[b].textContent!=d&&(a.qa[b].textContent=d))}
l.pd=function(a){this.Wg&&(a||!this.la.Ib||this.la.oj)&&($f(this,"EAX",this.G),$f(this,"EBX",this.H),$f(this,"ECX",this.I),$f(this,"EDX",this.M),$f(this,"ESP",J(this)),$f(this,"EBP",this.P),$f(this,"ESI",this.K),$f(this,"EDI",this.J),$f(this,"CS",this.wa.Z),$f(this,"DS",this.vb.Z),$f(this,"SS",this.ta.Z),$f(this,"ES",this.Xa.Z),$f(this,"EIP",M(this)),a=Cd(this),$f(this,"PS",a),$f(this,"V",a&2048),$f(this,"D",a&1024),$f(this,"I",a&512),$f(this,"T",a&256),$f(this,"S",a&128),$f(this,"Z",a&64),$f(this,
"A",a&16),$f(this,"P",a&4),$f(this,"C",a&1),80386==this.ja&&($f(this,"FS",this.Nb.Z),$f(this,"GS",this.Ob.Z),$f(this,"CR0",this.$a),$f(this,"CR2",this.se),$f(this,"CR3",this.Od)));if(a=this.qa.speed)a.textContent=this.la.Ib&&this.Y.ne?this.Y.ne.toFixed(2)+"Mhz":"Stopped"};
l.wf=function(a){this.la.complete=!0;var b=this.la.nj=this.ha&&ag(this.ha),c=a?this.la.yi?0:1:-1;this.la.yi=!1;this.fb=this.A=a;this.N&&!a&&hd(this.N);a||z(this,1024)||(this.S|=4);do{var d=this.S&3312;if(d)this.Ia|=d;else if(this.qe=this.Ha,this.ka=this.vb,this.Ka=this.ta,this.D=this.C=-1,this.Ia&3072&&kf(this),this.Ia=this.S&256,this.ua){a:{if(!(this.S&4))for(var d=80286>this.ja?0:1,e=0;2>e;e++){switch(d){case 0:if(this.ua&1&&this.ca&512){var f=bg(this.N);if(-1<=f&&(this.ua&=-2,0<=f)){this.ua&=-5;
cg.call(this,f);d=!0;break a}}break;case 1:if(this.ua&2){this.ua&=-3;80386<=this.ja&&(this.Ja[6]|=16384);cg.call(this,1);d=!0;break a}}d=1-d}d=!1}if(d&&!a){this.O("interrupt dispatched");this.S=0;break}if(this.ua&4){this.S=this.A=0;break}}if(b){if(dg(this.ha,this.Ha,c)){this.Wb();break}c=1}this.S=0;this.W[this.xa()].call(this)}while(0<this.A);return this.la.complete?this.fb-this.A:void 0===this.la.complete?0:-1};
Xa(function(){for(var a=tb(document,"pcx86","cpu"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new Gd(d);sb(d,c)}});
function eg(a){bb.call(this,"FPU",a,eg);this.ja=a.model||8087;this.X=new Float64Array(8);this.aa=new Int32Array(this.X.buffer);this.pa=new Float32Array(1);this.ua=new Int32Array(this.pa.buffer);this.W=new Float64Array(1);this.L=new Int32Array(this.W.buffer);this.ga=Array(3);this.ea=this.fa=-1;this.V=this.U=this.ia=this.A=0;this.ka=new Float64Array(1);this.ra=new Int32Array(this.ka.buffer);this.ra[0]=0;this.ra[1]=268402688;fg(this)}jb(eg);l=eg.prototype;
l.Ic=function(a,b,c){this.F=c;this.N=Jb(a,"ChipSet");xb(this)};l.hc=function(a,b){if(!b)if(!a||!this.restore)fg(this);else if(!this.restore(a))return!1;return!0};l.gc=function(a){return a?this.save():!0};l.save=function(){var a=new qf(this),b=[],c=0;b[c++]=this.jc;b[c++]=gg(this);b[c++]=hg(this);for(var d=0;d<this.X.length;d++)b[c++]=this.X[d];a.set(0,b);return a.data()};
l.restore=function(a){a=a[0];var b=0;this.jc=a[b++]&-57409;var c=a[b++];this.ma=c&-14337;this.B=(c&14336)>>11;ig(this);jg(this,a[b++]);for(c=0;c<this.X.length;c++)this.X[c]=a[b++];return!0};function fg(a){a.C=0;a.jc=959;a.ma=0;a.B=0;a.N&&(a=a.N,a.ja>=kg&&lg(a,13))}function ig(a){a.ma&=-129;a.ma&~a.jc&63&&(a.ma|=128);if(a.ma&128&&!(a.jc&128))return a=a.N,a.ja>=kg?mg(a,13):a.ya&0||cg.call(a.F,2),!0;a=a.N;a.ja>=kg&&lg(a,13);return!1}function xg(a,b){80387<=a.ja||(b&=-65);a.ma|=b;return ig(a)}
function gg(a){return a.ma|a.B<<11}function yg(a,b){return isFinite(b)?!0:!xg(a,Infinity===b?8:16)}function zg(a,b,c){var d=null;null!=b&&null!=c&&(d=b+c,yg(a,d)||(d=null));return d}function Ag(a,b,c){var d=null;null!=b&&null!=c&&(d=b-c,yg(a,d)||(d=null));return d}function Bg(a,b,c){var d=null;null!=b&&null!=c&&(d=b*c,yg(a,d)||(d=null));return d}function Cg(a,b,c){var d=null;null==b||null==c||!c&&xg(a,2)||(d=b/c,yg(a,d)||(d=null));return d}
function Dg(a,b,c){if(null!=b&&null!=c){var d=0;isNaN(b)||isNaN(c)?d=17664:(b-=c,0>b?d=256:b||(d=16384));a.ma=a.ma&-18177|d;return!0}return!1}function Eg(a,b,c){if(null==b)return null;var d=a.jc&3072;d?d=1024==d||3072==d&&0<b?Math.floor(b):Math.ceil(b):(d=Math.round(b),.5===d-b&&d%2&&d--);if(c){if(d>=c){if(xg(a,1))return null;d=-c}else if(d<-c){if(xg(a,1))return null;d=-c}a.L[0]=d|0;2147483648<c&&(a.L[1]=d/4294967296|0,!a.L[1]&&0>d&&(a.L[1]=-1))}return d}
function Fg(a,b){var c=3;a.C&1<<b&&(a=a.X[b],c=0,a?isFinite(a)||(c=2):c=1);return c}function hg(a){for(var b=0,c=a.X.length-1;0<=c;c--)b<<=2,b|=Fg(a,c);return b}function jg(a,b){a.C=0;for(var c=1;128>=c;c<<=1)3!=(b&3)&&(a.C|=c),b>>=2}function Gg(a){var b=a.B+0&7;return a.C&1<<b?(a.pa[0]=a.X[b],!0):xg(a,1)?!1:(a.pa[0]=a.ka[0],!0)}function Hg(a){var b=a.B+0&7;return a.C&1<<b?(a.W[0]=a.X[b],!0):xg(a,1)?!1:(a.W[0]=a.ka[0],!0)}
function U(a,b){var c=null;b=a.B+b&7;a.C&1<<b?c=a.X[b]:xg(a,1)||(c=a.ka[0]);return c}function V(a,b,c){return null!=c&&(isNaN(c)?!xg(a,1):1)?(b=a.B+b&7,a.X[b]=c,a.C|=1<<b,!0):!1}function Ig(a,b,c){var d=null;b=a.B+b&7;if(c||a.C&1<<b||!xg(a,1))c=b<<1,d=Jg(a,a.aa[c],a.aa[c+1]);return d}function Kg(a){return a.F.na(a.F.D)<<16>>16}function Lg(a){return a.F.oa(a.F.D)}function Mg(a){a.ua[0]=a.F.oa(a.F.D);return a.pa[0]}function Ng(a){a.L[0]=a.F.oa(a.F.D);a.L[1]=a.F.oa(a.F.D+4);return a.W[0]}
function Og(a){a.ga[0]=a.F.oa(a.F.D);a.ga[1]=a.F.oa(a.F.D+4);a.ga[2]=a.F.na(a.F.D+8);return a.ga}l.xi=function(){this.F.nb(this.F.D,this.L[0])};l.Wk=function(){this.F.nb(this.F.D,this.L[0]);this.F.nb(this.F.D+4,this.L[1])};l.Yk=eg.prototype.xi;l.Xk=eg.prototype.Wk;function Pg(a){a.F.nb(a.F.D,a.ga[0]);a.F.nb(a.F.D+4,a.ga[1]);a.F.jb(a.F.D+8,a.ga[2])}
function Qg(a,b){var c=b[1],d=(b[2]&32768)>>4,e=b[2]&32767;b=b[0]>>>11|c<<21;c=c>>11&1048575;32767==e?e=2047:e&&(e+=-15360,0>=e&&(e=2047,b=c=0));a.L[0]=b;a.L[1]=c|(d|e)<<20;return a.W[0]}function Jg(a,b,c){var d=c>>20&2047,e=2147483648|(c&1048575)<<11|b>>>21;2047==d?d=32767:d?d+=15360:e&=2147483647;a.ga[0]=b<<11;a.ga[1]=e;a.ga[2]=c>>16&32768|d;return a.ga}function Rg(a,b){for(var c=0,d=1;b--;)c+=(a&15)*d,d*=10,a>>=4;return c}function Sg(a,b){for(var c=0,d=0;b--;)c|=a%10<<d,a/=10,d+=4;return c}
function Tg(a){var b=null,c=1<<a.B;if(!(a.C&c)&&(a.ma&=-513,xg(a,65)))return b;a.C&=~c;b=a.X[a.B];a.B=a.B+1&7;return b}function Ug(a,b){if(null!=b){var c=a.B-1&7,d=1<<c;if(a.C&d&&(a.ma|=512,xg(a,65)))return;if(isNaN(b)&&xg(a,1)){if(xg(a,1))return;b=NaN}a.X[a.B=c]=b;a.C|=d}}
function Vg(a,b){var c,d=a.F;c=d.tb(b);a.jc=c&-57409;c=d.tb(b+=d.ba);a.ma=c&-14337;a.B=(c&14336)>>11;ig(a);jg(a,d.tb(b+=d.ba));!(d.$a&1)||d.ca&131072?(a.V=d.tb(b+=d.ba),c=d.tb(b+=d.ba),a.ia=c&2047,a.V|=(c&-4096)<<4,a.ea=-1,a.U=d.tb(b+=d.ba),a.U|=(d.tb(b+=d.ba)&-4096)<<4,a.fa=-1):(a.V=d.tb(b+=d.ba),c=d.tb(b+=d.ba),a.ea=c&65535,a.ia=c>>16&2047,a.U=d.tb(b+=d.ba),a.fa=d.tb(b+=d.ba)&65535);return b+d.ba}
function Wg(a,b){var c=a.F;c.rc(b,a.jc);c.rc(b+=c.ba,gg(a));c.rc(b+=c.ba,hg(a));if(!(c.$a&1)||c.ca&131072){var d=(a.ea<<4)+a.V;c.rc(b+=c.ba,d);c.rc(b+=c.ba,d>>4&-4096|a.ia);d=(a.fa<<4)+a.U;c.rc(b+=c.ba,d);c.rc(b+=c.ba,d>>4&-4096)}else c.rc(b+=c.ba,a.V),c.rc(b+=c.ba,a.ea|a.ia<<16),c.rc(b+=c.ba,a.U),c.rc(b+=c.ba,a.fa);return b+c.ba}var Xg=Math.log(10)/Math.LN2,Yg=Math.LOG2E,Zg=Math.PI,$g=Math.log(2)/Math.LN10,ah=Math.LN2,bh=Math.pow(2,63);function ch(){this.ma&=-32896;ig(this)}
function dh(){Dg(this,U(this,0),U(this,this.A))}function eh(){Dg(this,U(this,0),U(this,this.A))&&Tg(this)}function fh(){eh.call(this)}function gh(){V(this,0,Cg(this,U(this,0),Mg(this)))}function hh(){this.C&=~(1<<this.B)}function ih(){fg(this)}function jh(){this.jc=this.F.na(this.F.D)&-57409}function kh(){Vg(this,this.F.D)}function lh(){for(var a=this.F,b=Vg(this,a.D),c=this.ga,d=0;d<this.X.length;d++)c[0]=a.oa(b),c[1]=a.oa(b+=4),c[2]=a.na(b+=4),c&&V(this,d,Qg(this,c)),b+=2}
function mh(){for(var a=this.F,b=Wg(this,a.D),c=0;c<this.X.length;c++){var d=Ig(this,c,!0);a.nb(b,d[0]);a.nb(b+=4,d[1]);a.jb(b+=4,d[2]);b+=2}fg(this)}function nh(){Wg(this,this.F.D);this.jc|=63}function oh(){V(this,this.A,U(this,0))&&Tg(this)}function ph(){oh.call(this)}function qh(){this.F.jb(this.F.D,this.jc)}function rh(){this.F.jb(this.F.D,gg(this))}function sh(){80287<=this.ja&&(this.F.G=this.F.G&-65536|gg(this))}function th(){var a=U(this,0);V(this,0,U(this,this.A));V(this,this.A,a)}
function uh(){th.call(this)}
var vh={216:{0:function(){V(this,0,zg(this,U(this,0),Mg(this)))},1:function(){V(this,0,Bg(this,U(this,0),Mg(this)))},2:function(){Dg(this,U(this,0),Mg(this))},3:function(){Dg(this,U(this,0),Mg(this))&&Tg(this)},4:function(){V(this,0,Ag(this,U(this,0),Mg(this)))},5:function(){V(this,0,Ag(this,Mg(this),U(this,0)))},6:gh,7:gh,48:function(){V(this,0,zg(this,U(this,0),U(this,this.A)))},49:function(){V(this,0,Bg(this,U(this,0),U(this,this.A)))},50:dh,51:eh,52:function(){V(this,0,Ag(this,U(this,0),U(this,
this.A)))},53:function(){V(this,0,Ag(this,U(this,this.A),U(this,0)))},54:function(){V(this,0,Cg(this,U(this,0),U(this,this.A)))},55:function(){V(this,0,Cg(this,U(this,this.A),U(this,0)))}},217:{0:function(){Ug(this,Mg(this))},2:function(){Gg(this)&&this.Yk()},3:function(){Gg(this)&&(this.Yk(),Tg(this))},4:kh,5:jh,6:nh,7:qh,48:function(){Ug(this,U(this,this.A))},49:th,50:function(){},51:ph,64:function(){V(this,0,-U(this,0))},65:function(){V(this,0,Math.abs(U(this,0)))},68:function(){Dg(this,U(this,
0),0)},69:function(){this.ma&=-18177;this.aa[((this.B+0&7)<<1)+1]&-2147483648&&(this.ma|=512);if(3==Fg(this,this.B))this.ma|=16640;else{var a=U(this,0);this.ma=isNaN(a)?this.ma|256:0===a?this.ma|16384:Infinity===a||-Infinity===a?this.ma|1280:this.ma|1024}},80:function(){Ug(this,1)},81:function(){Ug(this,Xg)},82:function(){Ug(this,Yg)},83:function(){Ug(this,Zg)},84:function(){Ug(this,$g)},85:function(){Ug(this,ah)},86:function(){Ug(this,0)},96:function(){V(this,0,Math.pow(2,U(this,0))-1)},97:function(){V(this,
1,U(this,1)*Math.log(U(this,0))/Math.LN2)&&Tg(this)},98:function(){V(this,0,Math.tan(U(this,0)))&&Ug(this,1)},99:function(){V(this,1,Math.atan2(U(this,1),U(this,0)))&&Tg(this)},100:function(){var a=U(this,0);null!=a&&(this.W[0]=a,V(this,0,(this.L[1]>>20&2047)-1023),this.L[1]=(this.L[1]|1072693248)&-1073741825,Ug(this,this.W[0]))},102:function(){this.B=this.B-1&7;this.ma&=-513},103:function(){this.B=this.B+1&7;this.ma&=-513},112:function(){V(this,0,U(this,0)%U(this,1))},113:function(){V(this,1,U(this,
1)*Math.log(U(this,0)+1)/Math.LN2)&&Tg(this)},114:function(){var a=U(this,0),b=null;if(0<=a||!xg(this,1))b=Math.sqrt(a),yg(this,b)||(b=null);V(this,0,b)},116:function(){V(this,0,Eg(this,U(this,0),bh))},117:function(){var a=U(this,0),b=U(this,1);null!=a&&null!=b&&V(this,0,a*Math.pow(2,0<b?Math.floor(b):Math.ceil(b)))}},218:{0:function(){V(this,0,zg(this,U(this,0),Lg(this)))},1:function(){V(this,0,Bg(this,U(this,0),Lg(this)))},2:function(){Dg(this,U(this,0),Lg(this))},3:function(){Dg(this,U(this,0),
Lg(this))&&Tg(this)},4:function(){V(this,0,Ag(this,U(this,0),Lg(this)))},5:function(){V(this,0,Ag(this,Lg(this),U(this,0)))},6:function(){V(this,0,Cg(this,U(this,0),Lg(this)))},7:function(){V(this,0,Cg(this,Lg(this),U(this,0)))}},219:{0:function(){Ug(this,Lg(this))},2:function(){null!=Eg(this,U(this,0),2147483648)&&this.xi()},3:function(){null!=Eg(this,U(this,0),2147483648)&&(this.xi(),Tg(this))},5:function(){Ug(this,Qg(this,Og(this)))},7:function(){Ig(this,0)&&(Pg(this),Tg(this))},64:function(){8087==
this.ja&&(this.jc&=-129)},65:function(){8087==this.ja&&(this.jc|=128)},66:ch,67:ih,68:function(){},115:function(){}},220:{0:function(){V(this,0,zg(this,U(this,0),Ng(this)))},1:function(){V(this,0,Bg(this,U(this,0),Ng(this)))},2:function(){Dg(this,U(this,0),Ng(this))},3:function(){Dg(this,U(this,0),Ng(this))&&Tg(this)},4:function(){V(this,0,Ag(this,U(this,0),Ng(this)))},5:function(){V(this,0,Ag(this,Ng(this),U(this,0)))},6:function(){V(this,0,Cg(this,U(this,0),Ng(this)))},7:function(){V(this,0,Cg(this,
Ng(this),U(this,0)))},48:function(){V(this,this.A,zg(this,U(this,this.A),U(this,0)))},49:function(){V(this,this.A,Bg(this,U(this,this.A),U(this,0)))},50:function(){dh.call(this)},51:fh,52:function(){V(this,this.A,Ag(this,U(this,0),U(this,this.A)))},53:function(){V(this,this.A,Ag(this,U(this,this.A),U(this,0)))},54:function(){V(this,this.A,Cg(this,U(this,0),U(this,this.A)))},55:function(){V(this,this.A,Cg(this,U(this,this.A),U(this,0)))}},221:{0:function(){Ug(this,Ng(this))},2:function(){Hg(this)&&
this.Xk()},3:function(){Hg(this)&&(this.Xk(),Tg(this))},4:lh,6:mh,7:rh,48:hh,49:uh,50:function(){V(this,this.A,U(this,0))},51:oh},222:{0:function(){V(this,0,zg(this,U(this,0),Kg(this)))},1:function(){V(this,0,Bg(this,U(this,0),Kg(this)))},2:function(){Dg(this,U(this,0),Kg(this))},3:function(){Dg(this,U(this,0),Kg(this))&&Tg(this)},4:function(){V(this,0,Ag(this,U(this,0),Kg(this)))},5:function(){V(this,0,Ag(this,Kg(this),U(this,0)))},6:function(){V(this,0,Cg(this,U(this,0),Kg(this)))},7:function(){V(this,
0,Cg(this,Kg(this),U(this,0)))},48:function(){V(this,this.A,zg(this,U(this,this.A),U(this,0)))&&Tg(this)},49:function(){V(this,this.A,Bg(this,U(this,this.A),U(this,0)))&&Tg(this)},50:fh,51:function(){Dg(this,U(this,0),U(this,1))&&null!=Tg(this)&&Tg(this)},52:function(){V(this,this.A,Ag(this,U(this,0),U(this,this.A)))&&Tg(this)},53:function(){V(this,this.A,Ag(this,U(this,this.A),U(this,0)))&&Tg(this)},54:function(){V(this,this.A,Cg(this,U(this,0),U(this,this.A)))&&Tg(this)},55:function(){V(this,this.A,
Cg(this,U(this,this.A),U(this,0)))&&Tg(this)}},223:{0:function(){Ug(this,Kg(this))},2:function(){null!=Eg(this,U(this,0),32768)&&this.F.jb(this.F.D,this.L[0])},3:function(){null!=Eg(this,U(this,0),32768)&&(this.F.jb(this.F.D,this.L[0]),Tg(this))},4:function(){var a=Og(this),b=Rg(a[0],8)+1E8*Rg(a[1],8)+1E16*Rg(a[2],2);a[2]&32768&&(b=-b);Ug(this,b)},5:function(){var a;a=this.F.oa(this.F.D);a=4294967296*this.F.oa(this.F.D+4)+(a>>>0);Ug(this,a)},6:function(){var a=Eg(this,Tg(this));null!=a&&(this.ga[0]=
Sg(a,8),this.ga[1]=Sg(a/1E8,8),this.ga[2]=Sg(a/1E16,2),0>a&&(this.ga[2]|=32768),Pg(this))},7:function(){null!=Eg(this,U(this,0),bh)&&(this.Wk(),Tg(this))},48:function(){hh.call(this);Tg(this)},49:uh,50:ph,51:ph,52:sh}},wh=[ch,ih,jh,kh,lh,mh,qh,nh,rh,sh];Xa(function(){for(var a=tb(document,"pcx86","fpu"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new eg(d);sb(d,c)}});function xh(a,b){var c=a+b+Jf(this)|0;wf(this,a,b,c,191);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return c&255}
function yh(a,b){var c=a+b+Jf(this)|0;wf(this,a,b,c,this.Ga|63);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return c&this.R}function zh(a,b){var c=a+b|0;wf(this,a,b,c,191);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return c&255}function Ah(a,b){var c=a+b|0;wf(this,a,b,c,this.Ga|63);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return c&this.R}
function Bh(a,b){a&=b;Df(this,a,128);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return a}function Ch(a,b){this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return Df(this,a&b,this.Ga)&this.R}function Dh(a,b){this.A-=10+(-1===this.D?0:1);if((a&3)<(b&3))return a=a&-4|b&3,Nf(this),a;Lf(this);return a}
function Eh(a){if(-1===this.D)return E.call(this,6),a;var b=a,c=this.tb(this.D),d=this.tb(this.D+this.ba);2==this.ba&&(b=a<<16>>16,c=c<<16>>16,d=d<<16>>16);this.A-=this.B.Ij;(b<c||b>d)&&E.call(this,5);this.S|=2;return a}function Fh(a,b){var c=0;if(b){Lf(this);for(var d=1;d&this.R;){if(b&d){a=c;break}d<<=1;c++}}else Nf(this);this.A-=11+3*c;return a}function Gh(a,b){var c=0;if(b){Lf(this);for(var d=2==this.ba?15:31,e=1<<d;e;){if(b&e){a=d;break}e>>>=1;c++;d--}}else Nf(this);this.A-=11+3*c;return a}
function Hh(a,b){a&1<<(b&(2==this.ba?15:31))?Ef(this):Ff(this);this.A-=-1===this.D?3:6;this.S|=2;return a}function Ih(a,b){b=1<<(b&(2==this.ba?15:31));a&b?Ef(this):Ff(this);this.A-=-1===this.D?6:8;return a^b}function Jh(a,b){b=1<<(b&(2==this.ba?15:31));a&b?Ef(this):Ff(this);this.A-=-1===this.D?6:8;return a&~b}function Kh(a,b){b=1<<(b&(2==this.ba?15:31));a&b?Ef(this):Ff(this);this.A-=-1===this.D?6:8;return a|b}
function Lh(a,b){if(-1===this.D)return Hh.call(this,a,b);var c=this.ba<<3;if(b>=c||b<-c)a=Tf(this,this.$b,this.Ca+(b>>(2==this.ba?4:5))*this.ba);b=1<<(b&(2==this.ba?15:31));a&b?Ef(this):Ff(this);this.A-=6;this.S|=2;return a}function Mh(a,b){if(-1===this.D)return Ih.call(this,a,b);var c=this.ba<<3;if(b>=c||b<-c)a=Tf(this,this.$b,this.Ca+(b>>(2==this.ba?4:5))*this.ba);b=1<<(b&(2==this.ba?15:31));a&b?Ef(this):Ff(this);this.A-=8;return a^b}
function Nh(a,b){if(-1===this.D)return Jh.call(this,a,b);var c=this.ba<<3;if(b>=c||b<-c)a=Tf(this,this.$b,this.Ca+(b>>(2==this.ba?4:5))*this.ba);b=1<<(b&(2==this.ba?15:31));a&b?Ef(this):Ff(this);this.A-=8;return a&~b}function Oh(a,b){if(-1===this.D)return Kh.call(this,a,b);var c=this.ba<<3;if(b>=c||b<-c)a=Tf(this,this.$b,this.Ca+(b>>(2==this.ba?4:5))*this.ba);b=1<<(b&(2==this.ba?15:31));a&b?Ef(this):Ff(this);this.A-=8;return a|b}
function Ph(a,b){wf(this,a,b,a-b|0,191,!0);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Ih:this.B.Vb;this.S|=2;return a}function Qh(a,b){wf(this,a,b,a-b|0,this.Ga|63,!0);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Ih:this.B.Vb;this.S|=2;return a}
function Rh(a){if(this.Tb){var b=this.Tb,c=this.mg,d=this.L,e=d>>3&7;b.A=d&7;var f=(3>(d>>6&3)?0:48)+e;(217==c||219==c)&&52<=f&&(f=e<<4|b.A);if(e=vh[c][f]){if(0>wh.indexOf(e)){var f=b.F,g=f.qe;8087==b.ja&&(f.Ia&16&&g++,f.Ia&32&&g++);b.ea=f.wa.Z;b.V=g-f.wa.Aa;-1!==f.D&&(b.fa=f.$b.Z,b.U=f.D-f.$b.Aa);b.ia=(c&7)<<8|d}e.call(b)}}this.A-=-1===this.D?2:8;return a}function Sh(a){if(80186>this.ja)return W.call(this,a);E.call(this,13,0);return a}function je(a){E.call(this,6);return a}
function W(a){me.call(this);return a}function Th(a,b){a=Uh.call(this,this.T(),b);80386>this.ja&&(this.A-=12);return a}function Vh(a,b){a=this.Ma();a=2==this.ba?Uh.call(this,a,b):Wh.call(this,a,b);80386>this.ja&&(this.A-=12);return a}function Xh(a,b){var c=!1;0>b&&(b=-b|0,c=!c);0>a&&(a=-a|0,c=!c);Yh.call(this,a,b);c&&(this.ia=~this.ia+1|0,this.va=~this.va+(this.ia?0:1)|0)}
function Uh(a,b){a=(a<<16>>16)*(b<<16>>16)|0;32767<a||-32768>a?(Ef(this),Gf(this)):(Ff(this),Hf(this));this.A-=-1===this.D?9:12;return a&65535}function Wh(a,b){Xh.call(this,a,b);this.va!=this.ia>>31?(Ef(this),Gf(this)):(Ff(this),Hf(this));this.A-=-1===this.D?9:12;return this.ia}function Zh(a,b){this.A-=14+(-1===this.D?0:2);Lf(this);-1!==this.Da.load(b)&&this.Da.Gc>=this.pa&&this.Da.Gc>=(b&3)&&(Nf(this),a=this.Da.wb&-256,2<this.ba&&(a|=(this.Da.ext&-65281)<<16));return a}
function $h(a,b){if(-1===this.D)return me.call(this),a;Ad(this,this.na(this.D+this.ba));this.A-=this.B.pf;return b}function ai(){this.A-=this.B.kk;return this.D}function bi(a,b){if(-1===this.D)return me.call(this),a;Bd(this,this.na(this.D+this.ba));this.A-=this.B.pf;return b}function ci(a,b){if(-1===this.D)return me.call(this),a;a=this.na(this.D+this.ba);this.Nb.load(a);this.A-=this.B.pf;return b}
function di(a,b){if(-1===this.D)return me.call(this),a;a=this.na(this.D+this.ba);this.Ob.load(a);this.A-=this.B.pf;return b}function ei(a,b){this.A-=14+(-1===this.D?0:2);if(b&65528&&-1!==this.Da.load(b)&&(7168==(this.Da.wb&7168)||this.Da.Gc>=this.pa)&&this.Da.Gc>=(b&3))return Nf(this),this.Da.Ta;Lf(this);return a}function fi(a,b){if(-1===this.D)return me.call(this),a;ud(this,this.na(this.D+this.ba));this.A-=this.B.pf;return b}
function gi(a,b){this.A-=-1===this.C?-1===this.D?this.B.sk:this.B.rk:this.B.pk;return b}function yi(a,b){switch(this.L>>3&7){case 4:this.aa=this.G;break;case 5:this.aa=this.I;break;case 6:this.aa=this.M;break;case 7:this.aa=this.H}return b}function zi(a,b){return b}
function Ai(a,b){a=this.L>>3&7;switch(a){case 0:this.aa=this.G;break;case 2:this.aa=this.M;break;case 3:this.aa=this.H;break;default:if(80286==this.ja||80386==this.ja&&4!=a&&5!=a)E.call(this,6);else switch(a){case 1:this.aa=this.I;break;case 4:this.aa=J(this);break;case 5:this.aa=this.P;break;case 6:this.aa=this.K;break;case 7:this.aa=this.J}}return gi.call(this,0,b)}
function Bi(a,b){switch(this.L>>3&7){case 0:b=this.Xa.Z;break;case 1:b=this.wa.Z;break;case 2:b=this.ta.Z;break;case 3:b=this.vb.Z;break;case 4:if(80386<=this.ja){b=this.Nb.Z;break}E.call(this,6);b=a;break;case 5:if(80386<=this.ja){b=this.Ob.Z;break}default:E.call(this,6),b=a}-1!==this.C&&xd(this,2);return gi.call(this,0,b)}
function Yh(a,b){if(a&-65536||b&-65536){var c=b&65535;b>>>=16;var d=a&65535;a>>>=16;var e=c*d,d=(e>>>16)+b*d,f=d>>>16,d=(d&65535)+c*a;this.ia=d<<16|e&65535;this.va=f+((d>>>16)+b*a)|0}else this.ia=a*b|0,this.va=0}function Ci(a,b){this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return Df(this,a|b,128)}function Di(a,b){this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return Df(this,a|b,this.Ga)&this.R}
function Ei(a,b){var c=a-b-Jf(this)|0;wf(this,a,b,c,191,!0);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return c&255}function Fi(a,b){var c=a-b-Jf(this)|0;wf(this,a,b,c,this.Ga|63,!0);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return c&this.R}function Gi(){return Cf(this)?1:0}function Hi(){return xf(this)?1:0}function Ii(){return xf(this)?0:1}function Ji(){return Af(this)?1:0}function Ki(){return Af(this)?0:1}function Li(){return xf(this)||Af(this)?1:0}
function Mi(){return xf(this)||Af(this)?0:1}function Ni(){return Bf(this)?1:0}function Oi(){return Bf(this)?0:1}function Pi(){return yf(this)?1:0}function Qi(){return yf(this)?0:1}function Ri(){return!Bf(this)!=!Cf(this)?1:0}function Si(){return!Bf(this)!=!Cf(this)?0:1}function Ti(){return Af(this)||!Bf(this)!=!Cf(this)?1:0}function Ui(){return Af(this)||!Bf(this)!=!Cf(this)?0:1}function Vi(a,b){return Wi.call(this,a,b,this.xa())}function Xi(a,b){return Yi.call(this,a,b,this.xa())}
function Zi(a,b){return Wi.call(this,a,b,this.I&31)}function $i(a,b){return Yi.call(this,a,b,this.I&31)}function aj(a,b){return bj.call(this,a,b,this.xa())}function cj(a,b){return dj.call(this,a,b,this.xa())}function ej(a,b){return bj.call(this,a,b,this.I&31)}function fj(a,b){return dj.call(this,a,b,this.I&31)}function gj(a,b){var c=a-b|0;wf(this,a,b,c,191,!0);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return c&255}
function hj(a,b){var c=a-b|0;wf(this,a,b,c,this.Ga|63,!0);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return c&this.R}function ij(a,b){Df(this,a&b,128);this.A-=-1===this.C?-1===this.D?this.B.ji:this.B.Wf:this.B.Wf;this.S|=2;return a}function jj(a,b){Df(this,a&b,this.Ga);this.A-=-1===this.C?-1===this.D?this.B.ji:this.B.Wf:this.B.Wf;this.S|=2;return a}function kj(a,b){var c=this.G&this.R,d=(1<<(this.I&31))-1;return a&~(d<<c)|(b&d)<<c}
function lj(a,b){return b>>(this.G&this.R)&(1<<(this.I&31))-1&this.R}function mj(a,b){if(-1===this.D){switch(this.L&7){case 0:this.G=this.G&-256|a;break;case 1:this.I=this.I&-256|a;break;case 2:this.M=this.M&-256|a;break;case 3:this.H=this.H&-256|a;break;case 4:this.G=this.G&-65281|a<<8;break;case 5:this.I=this.I&-65281|a<<8;break;case 6:this.M=this.M&-65281|a<<8;break;case 7:this.H=this.H&-65281|a<<8}this.A-=this.B.li}else this.C=this.D,Wf(this,a),this.A-=this.B.ki;return b}
function nj(a,b){if(-1===this.D){switch(this.L&7){case 0:this.G=this.G&~this.R|a;break;case 1:this.I=this.I&~this.R|a;break;case 2:this.M=this.M&~this.R|a;break;case 3:this.H=this.H&~this.R|a;break;case 4:I(this,J(this)&~this.R|a);break;case 5:this.P=this.H&~this.R|a;break;case 6:this.K=this.K&~this.R|a;break;case 7:this.J=this.J&~this.R|a}this.A-=this.B.li}else this.C=this.D,this.S&2||this.rc(this.$b.nc(this.Ca,this.ba),a),this.A-=this.B.ki;return b}
function oj(a,b){a^=b;Df(this,a,128);this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return a}function pj(a,b){this.A-=-1===this.C?-1===this.D?this.B.yc:this.B.Vb:this.B.Nc;return Df(this,a^b,this.Ga)&this.R}function qj(a,b){var c=a[1]-b[1];c||(c=a[0]-b[0]);return c}function rj(a){var b=a-1|0;wf(this,a,1,b,this.Ga|62,!0);this.A-=2;return a&~this.R|b&this.R}
function sj(a,b,c){c>>>=0;if(!c||c<=b>>>0)return!1;var d=0,e=1;c=[c>>>0,0];for(a=[a>>>0,b>>>0];0<qj(a,c);){var f=b=c;b[0]+=f[0];b[1]+=f[1];4294967295<b[0]&&(b[0]>>>=0,b[1]++);e+=e}do 0<=qj(a,c)&&(b=a,f=c,b[0]-=f[0],b[1]-=f[1],0>b[0]&&(b[0]>>>=0,b[1]--),d+=e),b=c,b[0]>>>=1,b[1]&1&&(b[0]=(b[0]|2147483648)>>>0),b[1]>>>=1,e/=2;while(1<=e);this.ia=d;this.va=a[0];return!0}function tj(a){var b=a+1|0;wf(this,a,1,b,this.Ga|62);this.A-=2;return a&~this.R|b&this.R}
function uj(a){this.$a=a;wd(this);this.$a&-2147483648?xe(this):ze(this)}function Fd(a){this.Od=a;Xb(this)}function vj(a){this.S|=1;this.Ya.call(this,a);this.A-=-1===this.D?4:5}function Wi(a,b,c){if(c){16<c&&(a=b,c-=16);var d=a<<c-1;a=(d<<1|b>>>16-c)&65535;Df(this,a,32768,d&32768)}return a}function Yi(a,b,c){if(c){var d=a<<c-1;a=d<<1|b>>>32-c;Df(this,a,-2147483648,d&-2147483648)}return a}
function bj(a,b,c){if(c){16<c&&(a=b,c-=16);var d=a>>>c-1;a=(d>>>1|b<<16-c)&65535;Df(this,a,32768,d&1)}return a}function dj(a,b,c){if(c){var d=a>>>c-1;a=d>>>1|b<<32-c;Df(this,a,-2147483648,d&1)}return a}function wj(){this.A-=-1===this.D?2:this.B.Fk;return 1}function xj(){var a=this.I&255;this.A-=(-1===this.D?this.B.ci:this.B.bi)+(a<<this.B.di);return a}function yj(){var a=this.xa();this.A-=(-1===this.D?this.B.ci:this.B.bi)+(a<<this.B.di);return a}function zj(){return null}
function Aj(){return this.aa}function Bj(a,b){this.bc=this.wa.Z;this.sb=this.ta.Z;this.U=this.fa;var c=M(this),d=this.ba;null!=Ed(this,a,b,!0)&&(zd(this,this.bc,d,2),zd(this,c,d,d));this.bc=this.sb=this.U=-1}function Cj(a,b,c){this.A-=this.B.ck+(c||0);c=Cd(this);var d=this.wa.Z,e=M(this);a=this.wa.Cj(a);-1!==a&&(K(this,c),K(this,d),K(this,e),null!=b&&K(this,b),this.qb=-1,tf(this,a))}
function Dj(a){this.sb=this.ta.Z;this.U=this.fa;var b=H(this),c=H(this);a&&I(this,J(this)+a);Ed(this,b,c,!1)&&(a&&I(this,J(this)+a),Ej.call(this,this.vb),Ej.call(this,this.Xa),80386<=this.ja&&(Ej.call(this,this.Nb),Ej.call(this,this.Ob)));2==a&&this.le&&nf(this,this.Ha);this.sb=this.U=-1}function Fj(){8086==this.ja?(this.qb=-1,Cj.call(this,0,null,2)):E.call(this,0,null,2)}function cg(a,b){this.qb=a;void 0===b&&(b=11);Cj.call(this,a,null,b)}
function E(a,b,c,d){var e=!1;this.la.complete?80186<=this.ja&&(e=!0,0>this.qb?(-1!=this.bc&&(this.bc!==this.wa.Z&&(this.wa.Lb=this.bc&3,sf(this,this.bc)),this.bc=-1),this.qe!==this.Ha&&tf(this,this.qe),-1!=this.sb&&(this.sb!==this.ta.Z&&ud(this,this.sb),this.sb=-1),-1!==this.U&&(this.U!==this.fa&&I(this,this.gb&~this.ta.Ba|this.U-this.ta.Aa),this.U=-1)):8!=this.qb?(b=0,a=8):(b=0,a=-1,ve(this),e=d=!1)):tf(this,this.qe);var f=a,g=b,h=32,k=Qf(this,this.Ha);204!=k||this.Sd||(d=!1);this.ca&131072&&(6==
f&&99==k||13==f&&205==k)&&(d=!1);!1===d&&(h|=1);983040<=this.Ha&&1048575>=this.Ha&&(d=!1);z(this,h|-2147483648)&&(d=!0);if(z(this,h)||d){var m=this.la.Ib,f="Fault "+u(f)+(null!=g?" ("+v(g)+")":"")+" on opcode "+u(k);d&&m&&(f+=" (blocked)");this.ha?(y(this,f,d||h,!0),d&&(d=m,this.ha.Wb())):(this.Na(f),this.Wb())}if(d&&e)throw-1;if(e)throw this.qb=a,Cj.call(this,a,b,c),this.qe=this.Ha,this.S=1==a?this.S|8192:this.S|4096,a;}
function ye(a,b,c){this.se=a;a=0;b&&(a|=1);c&&(a|=2);3==this.pa&&(a|=4);E.call(this,14,a)}function Ej(a){var b=a.wb&7680;a.Z&65528&&(6144==b||7168==b||7168>b&&a.Gc<this.pa&&a.Gc<(a.Z&3))&&a.load(0)}
function De(a){var b,c;switch((this.L=this.xa())&199){case 0:c=P(this,this.H+this.K);this.A-=this.B.dd;break;case 1:c=P(this,this.H+this.J);this.A-=this.B.ed;break;case 2:c=Sf(this,this.P+this.K);this.A-=this.B.ed;break;case 3:c=Sf(this,this.P+this.J);this.A-=this.B.dd;break;case 4:c=P(this,this.K);this.A-=this.B.Jc;break;case 5:c=P(this,this.J);this.A-=this.B.Jc;break;case 6:c=P(this,T(this));this.A-=this.B.Jd;break;case 7:c=P(this,this.H);this.A-=this.B.Jc;break;case 64:c=P(this,this.H+this.K+this.T());
this.A-=this.B.dc;break;case 65:c=P(this,this.H+this.J+this.T());this.A-=this.B.ec;break;case 66:c=Sf(this,this.P+this.K+this.T());this.A-=this.B.ec;break;case 67:c=Sf(this,this.P+this.J+this.T());this.A-=this.B.dc;break;case 68:c=P(this,this.K+this.T());this.A-=this.B.ib;break;case 69:c=P(this,this.J+this.T());this.A-=this.B.ib;break;case 70:c=Sf(this,this.P+this.T());this.A-=this.B.ib;break;case 71:c=P(this,this.H+this.T());this.A-=this.B.ib;break;case 128:c=P(this,this.H+this.K+T(this));this.A-=
this.B.dc;break;case 129:c=P(this,this.H+this.J+T(this));this.A-=this.B.ec;break;case 130:c=Sf(this,this.P+this.K+T(this));this.A-=this.B.ec;break;case 131:c=Sf(this,this.P+this.J+T(this));this.A-=this.B.dc;break;case 132:c=P(this,this.K+T(this));this.A-=this.B.ib;break;case 133:c=P(this,this.J+T(this));this.A-=this.B.ib;break;case 134:c=Sf(this,this.P+T(this));this.A-=this.B.ib;break;case 135:c=P(this,this.H+T(this));this.A-=this.B.ib;break;case 192:c=this.G&255;break;case 193:c=this.I&255;break;
case 194:c=this.M&255;break;case 195:c=this.H&255;break;case 196:c=this.G>>8&255;break;case 197:c=this.I>>8&255;break;case 198:c=this.M>>8&255;break;case 199:c=this.H>>8&255;break;default:c=0}var d=this.L>>3&7;switch(d){case 0:b=this.G&255;break;case 1:b=this.I&255;break;case 2:b=this.M&255;break;case 3:b=this.H&255;break;case 4:b=this.G>>8&255;break;case 5:b=this.I>>8&255;break;case 6:b=this.M>>8&255;break;case 7:b=this.H>>8&255;break;default:b=0}a=a.call(this,b,c);switch(d){case 0:this.G=this.G&
-256|a;break;case 1:this.I=this.I&-256|a;break;case 2:this.M=this.M&-256|a;break;case 3:this.H=this.H&-256|a;break;case 4:this.G=this.G&-65281|a<<8;break;case 5:this.I=this.I&-65281|a<<8;break;case 6:this.M=this.M&-65281|a<<8;break;case 7:this.H=this.H&-65281|a<<8}}
function Ee(a){var b,c,d=(this.L=this.xa())&199;switch(d){case 0:b=P(this,this.H+this.K);this.C=this.D;break;case 1:b=P(this,this.H+this.J);this.C=this.D;break;case 2:b=Sf(this,this.P+this.K);this.C=this.D;break;case 3:b=Sf(this,this.P+this.J);this.C=this.D;break;case 4:b=P(this,this.K);this.C=this.D;break;case 5:b=P(this,this.J);this.C=this.D;break;case 6:b=P(this,T(this));this.C=this.D;break;case 7:b=P(this,this.H);this.C=this.D;break;case 64:b=P(this,this.H+this.K+this.T());this.C=this.D;break;
case 65:b=P(this,this.H+this.J+this.T());this.C=this.D;break;case 66:b=Sf(this,this.P+this.K+this.T());this.C=this.D;break;case 67:b=Sf(this,this.P+this.J+this.T());this.C=this.D;break;case 68:b=P(this,this.K+this.T());this.C=this.D;break;case 69:b=P(this,this.J+this.T());this.C=this.D;break;case 70:b=Sf(this,this.P+this.T());this.C=this.D;break;case 71:b=P(this,this.H+this.T());this.C=this.D;break;case 128:b=P(this,this.H+this.K+T(this));this.C=this.D;break;case 129:b=P(this,this.H+this.J+T(this));
this.C=this.D;break;case 130:b=Sf(this,this.P+this.K+T(this));this.C=this.D;break;case 131:b=Sf(this,this.P+this.J+T(this));this.C=this.D;break;case 132:b=P(this,this.K+T(this));this.C=this.D;break;case 133:b=P(this,this.J+T(this));this.C=this.D;break;case 134:b=Sf(this,this.P+T(this));this.C=this.D;break;case 135:b=P(this,this.H+T(this));this.C=this.D;break;case 192:b=this.G&255;break;case 193:b=this.I&255;break;case 194:b=this.M&255;break;case 195:b=this.H&255;break;case 196:b=this.G>>8&255;break;
case 197:b=this.I>>8&255;break;case 198:b=this.M>>8&255;break;case 199:b=this.H>>8&255;break;default:b=0}switch(this.L>>3&7){case 0:c=this.G&255;break;case 1:c=this.I&255;break;case 2:c=this.M&255;break;case 3:c=this.H&255;break;case 4:c=this.G>>8&255;break;case 5:c=this.I>>8&255;break;case 6:c=this.M>>8&255;break;case 7:c=this.H>>8&255;break;default:c=0}a=a.call(this,b,c);switch(d){case 0:case 3:Wf(this,a);this.A-=this.B.dd;break;case 1:case 2:Wf(this,a);this.A-=this.B.ed;break;case 4:case 5:case 7:Wf(this,
a);this.A-=this.B.Jc;break;case 6:Wf(this,a);this.A-=this.B.Jd;break;case 64:case 67:case 128:case 131:Wf(this,a);this.A-=this.B.dc;break;case 65:case 66:case 129:case 130:Wf(this,a);this.A-=this.B.ec;break;case 68:case 69:case 70:case 71:case 132:case 133:case 134:case 135:Wf(this,a);this.A-=this.B.ib;break;case 192:this.G=this.G&-256|a;break;case 193:this.I=this.I&-256|a;break;case 194:this.M=this.M&-256|a;break;case 195:this.H=this.H&-256|a;break;case 196:this.G=this.G&-65281|a<<8;break;case 197:this.I=
this.I&-65281|a<<8;break;case 198:this.M=this.M&-65281|a<<8;break;case 199:this.H=this.H&-65281|a<<8}}
function Fe(a,b){var c,d=(this.L=this.xa())&199;switch(d){case 0:c=P(this,this.H+this.K);this.C=this.D;break;case 1:c=P(this,this.H+this.J);this.C=this.D;break;case 2:c=Sf(this,this.P+this.K);this.C=this.D;break;case 3:c=Sf(this,this.P+this.J);this.C=this.D;break;case 4:c=P(this,this.K);this.C=this.D;break;case 5:c=P(this,this.J);this.C=this.D;break;case 6:c=P(this,T(this));this.C=this.D;break;case 7:c=P(this,this.H);this.C=this.D;break;case 64:c=P(this,this.H+this.K+this.T());this.C=this.D;break;
case 65:c=P(this,this.H+this.J+this.T());this.C=this.D;break;case 66:c=Sf(this,this.P+this.K+this.T());this.C=this.D;break;case 67:c=Sf(this,this.P+this.J+this.T());this.C=this.D;break;case 68:c=P(this,this.K+this.T());this.C=this.D;break;case 69:c=P(this,this.J+this.T());this.C=this.D;break;case 70:c=Sf(this,this.P+this.T());this.C=this.D;break;case 71:c=P(this,this.H+this.T());this.C=this.D;break;case 128:c=P(this,this.H+this.K+T(this));this.C=this.D;break;case 129:c=P(this,this.H+this.J+T(this));
this.C=this.D;break;case 130:c=Sf(this,this.P+this.K+T(this));this.C=this.D;break;case 131:c=Sf(this,this.P+this.J+T(this));this.C=this.D;break;case 132:c=P(this,this.K+T(this));this.C=this.D;break;case 133:c=P(this,this.J+T(this));this.C=this.D;break;case 134:c=Sf(this,this.P+T(this));this.C=this.D;break;case 135:c=P(this,this.H+T(this));this.C=this.D;break;case 192:c=this.G&255;break;case 193:c=this.I&255;break;case 194:c=this.M&255;break;case 195:c=this.H&255;break;case 196:c=this.G>>8&255;break;
case 197:c=this.I>>8&255;break;case 198:c=this.M>>8&255;break;case 199:c=this.H>>8&255;break;default:c=0}a=a[this.L>>3&7].call(this,c,b.call(this));switch(d){case 0:case 3:Wf(this,a);this.A-=this.B.dd;break;case 1:case 2:Wf(this,a);this.A-=this.B.ed;break;case 4:case 5:case 7:Wf(this,a);this.A-=this.B.Jc;break;case 6:Wf(this,a);this.A-=this.B.Jd;break;case 64:case 67:case 128:case 131:Wf(this,a);this.A-=this.B.dc;break;case 65:case 66:case 129:case 130:Wf(this,a);this.A-=this.B.ec;break;case 68:case 69:case 70:case 71:case 132:case 133:case 134:case 135:Wf(this,
a);this.A-=this.B.ib;break;case 192:this.G=this.G&-256|a;break;case 193:this.I=this.I&-256|a;break;case 194:this.M=this.M&-256|a;break;case 195:this.H=this.H&-256|a;break;case 196:this.G=this.G&-65281|a<<8;break;case 197:this.I=this.I&-65281|a<<8;break;case 198:this.M=this.M&-65281|a<<8;break;case 199:this.H=this.H&-65281|a<<8}}
function Ie(a){var b,c;switch((this.L=this.xa())&199){case 0:c=Q(this,this.H+this.K);this.A-=this.B.dd;break;case 1:c=Q(this,this.H+this.J);this.A-=this.B.ed;break;case 2:c=Uf(this,this.P+this.K);this.A-=this.B.ed;break;case 3:c=Uf(this,this.P+this.J);this.A-=this.B.dd;break;case 4:c=Q(this,this.K);this.A-=this.B.Jc;break;case 5:c=Q(this,this.J);this.A-=this.B.Jc;break;case 6:c=Q(this,T(this));this.A-=this.B.Jd;break;case 7:c=Q(this,this.H);this.A-=this.B.Jc;break;case 64:c=Q(this,this.H+this.K+this.T());
this.A-=this.B.dc;break;case 65:c=Q(this,this.H+this.J+this.T());this.A-=this.B.ec;break;case 66:c=Uf(this,this.P+this.K+this.T());this.A-=this.B.ec;break;case 67:c=Uf(this,this.P+this.J+this.T());this.A-=this.B.dc;break;case 68:c=Q(this,this.K+this.T());this.A-=this.B.ib;break;case 69:c=Q(this,this.J+this.T());this.A-=this.B.ib;break;case 70:c=Uf(this,this.P+this.T());this.A-=this.B.ib;break;case 71:c=Q(this,this.H+this.T());this.A-=this.B.ib;break;case 128:c=Q(this,this.H+this.K+T(this));this.A-=
this.B.dc;break;case 129:c=Q(this,this.H+this.J+T(this));this.A-=this.B.ec;break;case 130:c=Uf(this,this.P+this.K+T(this));this.A-=this.B.ec;break;case 131:c=Uf(this,this.P+this.J+T(this));this.A-=this.B.dc;break;case 132:c=Q(this,this.K+T(this));this.A-=this.B.ib;break;case 133:c=Q(this,this.J+T(this));this.A-=this.B.ib;break;case 134:c=Uf(this,this.P+T(this));this.A-=this.B.ib;break;case 135:c=Q(this,this.H+T(this));this.A-=this.B.ib;break;case 192:c=this.G&65535;break;case 193:c=this.I&65535;break;
case 194:c=this.M&65535;break;case 195:c=this.H&65535;break;case 196:c=J(this)&65535;break;case 197:c=this.P&65535;break;case 198:c=this.K&65535;break;case 199:c=this.J&65535;break;default:c=0}var d=this.L>>3&7;switch(d){case 0:b=this.G&65535;break;case 1:b=this.I&65535;break;case 2:b=this.M&65535;break;case 3:b=this.H&65535;break;case 4:b=J(this)&65535;break;case 5:b=this.P&65535;break;case 6:b=this.K&65535;break;case 7:b=this.J&65535;break;default:b=0}a=a.call(this,b,c);switch(d){case 0:this.G=
this.G&-65536|a;break;case 1:this.I=this.I&-65536|a;break;case 2:this.M=this.M&-65536|a;break;case 3:this.H=this.H&-65536|a;break;case 4:I(this,J(this)&-65536|a);break;case 5:this.P=this.P&-65536|a;break;case 6:this.K=this.K&-65536|a;break;case 7:this.J=this.J&-65536|a}}
function Je(a){var b,c,d=(this.L=this.xa())&199;switch(d){case 0:b=Q(this,this.H+this.K);this.C=this.D;break;case 1:b=Q(this,this.H+this.J);this.C=this.D;break;case 2:b=Uf(this,this.P+this.K);this.C=this.D;break;case 3:b=Uf(this,this.P+this.J);this.C=this.D;break;case 4:b=Q(this,this.K);this.C=this.D;break;case 5:b=Q(this,this.J);this.C=this.D;break;case 6:b=Q(this,T(this));this.C=this.D;break;case 7:b=Q(this,this.H);this.C=this.D;break;case 64:b=Q(this,this.H+this.K+this.T());this.C=this.D;break;
case 65:b=Q(this,this.H+this.J+this.T());this.C=this.D;break;case 66:b=Uf(this,this.P+this.K+this.T());this.C=this.D;break;case 67:b=Uf(this,this.P+this.J+this.T());this.C=this.D;break;case 68:b=Q(this,this.K+this.T());this.C=this.D;break;case 69:b=Q(this,this.J+this.T());this.C=this.D;break;case 70:b=Uf(this,this.P+this.T());this.C=this.D;break;case 71:b=Q(this,this.H+this.T());this.C=this.D;break;case 128:b=Q(this,this.H+this.K+T(this));this.C=this.D;break;case 129:b=Q(this,this.H+this.J+T(this));
this.C=this.D;break;case 130:b=Uf(this,this.P+this.K+T(this));this.C=this.D;break;case 131:b=Uf(this,this.P+this.J+T(this));this.C=this.D;break;case 132:b=Q(this,this.K+T(this));this.C=this.D;break;case 133:b=Q(this,this.J+T(this));this.C=this.D;break;case 134:b=Uf(this,this.P+T(this));this.C=this.D;break;case 135:b=Q(this,this.H+T(this));this.C=this.D;break;case 192:b=this.G&65535;break;case 193:b=this.I&65535;break;case 194:b=this.M&65535;break;case 195:b=this.H&65535;break;case 196:b=J(this)&65535;
break;case 197:b=this.P&65535;break;case 198:b=this.K&65535;break;case 199:b=this.J&65535;break;default:b=0}switch(this.L>>3&7){case 0:c=this.G&65535;break;case 1:c=this.I&65535;break;case 2:c=this.M&65535;break;case 3:c=this.H&65535;break;case 4:c=J(this)&65535;break;case 5:c=this.P&65535;break;case 6:c=this.K&65535;break;case 7:c=this.J&65535;break;default:c=0}a=a.call(this,b,c);switch(d){case 0:case 3:Xf(this,a);this.A-=this.B.dd;break;case 1:case 2:Xf(this,a);this.A-=this.B.ed;break;case 4:case 5:case 7:Xf(this,
a);this.A-=this.B.Jc;break;case 6:Xf(this,a);this.A-=this.B.Jd;break;case 64:case 67:case 128:case 131:Xf(this,a);this.A-=this.B.dc;break;case 65:case 66:case 129:case 130:Xf(this,a);this.A-=this.B.ec;break;case 68:case 69:case 70:case 71:case 132:case 133:case 134:case 135:Xf(this,a);this.A-=this.B.ib;break;case 192:this.G=this.G&-65536|a;break;case 193:this.I=this.I&-65536|a;break;case 194:this.M=this.M&-65536|a;break;case 195:this.H=this.H&-65536|a;break;case 196:I(this,J(this)&-65536|a);break;
case 197:this.P=this.P&-65536|a;break;case 198:this.K=this.K&-65536|a;break;case 199:this.J=this.J&-65536|a}}
function Ke(a,b){var c,d=(this.L=this.xa())&199;switch(d){case 0:c=Q(this,this.H+this.K);this.C=this.D;break;case 1:c=Q(this,this.H+this.J);this.C=this.D;break;case 2:c=Uf(this,this.P+this.K);this.C=this.D;break;case 3:c=Uf(this,this.P+this.J);this.C=this.D;break;case 4:c=Q(this,this.K);this.C=this.D;break;case 5:c=Q(this,this.J);this.C=this.D;break;case 6:c=Q(this,T(this));this.C=this.D;break;case 7:c=Q(this,this.H);this.C=this.D;break;case 64:c=Q(this,this.H+this.K+this.T());this.C=this.D;break;
case 65:c=Q(this,this.H+this.J+this.T());this.C=this.D;break;case 66:c=Uf(this,this.P+this.K+this.T());this.C=this.D;break;case 67:c=Uf(this,this.P+this.J+this.T());this.C=this.D;break;case 68:c=Q(this,this.K+this.T());this.C=this.D;break;case 69:c=Q(this,this.J+this.T());this.C=this.D;break;case 70:c=Uf(this,this.P+this.T());this.C=this.D;break;case 71:c=Q(this,this.H+this.T());this.C=this.D;break;case 128:c=Q(this,this.H+this.K+T(this));this.C=this.D;break;case 129:c=Q(this,this.H+this.J+T(this));
this.C=this.D;break;case 130:c=Uf(this,this.P+this.K+T(this));this.C=this.D;break;case 131:c=Uf(this,this.P+this.J+T(this));this.C=this.D;break;case 132:c=Q(this,this.K+T(this));this.C=this.D;break;case 133:c=Q(this,this.J+T(this));this.C=this.D;break;case 134:c=Uf(this,this.P+T(this));this.C=this.D;break;case 135:c=Q(this,this.H+T(this));this.C=this.D;break;case 192:c=this.G&65535;break;case 193:c=this.I&65535;break;case 194:c=this.M&65535;break;case 195:c=this.H&65535;break;case 196:c=J(this)&65535;
break;case 197:c=this.P&65535;break;case 198:c=this.K&65535;break;case 199:c=this.J&65535;break;default:c=0}a=a[this.L>>3&7].call(this,c,b.call(this));switch(d){case 0:case 3:Xf(this,a);this.A-=this.B.dd;break;case 1:case 2:Xf(this,a);this.A-=this.B.ed;break;case 4:case 5:case 7:Xf(this,a);this.A-=this.B.Jc;break;case 6:Xf(this,a);this.A-=this.B.Jd;break;case 64:case 67:case 128:case 131:Xf(this,a);this.A-=this.B.dc;break;case 65:case 66:case 129:case 130:Xf(this,a);this.A-=this.B.ec;break;case 68:case 69:case 70:case 71:case 132:case 133:case 134:case 135:Xf(this,
a);this.A-=this.B.ib;break;case 192:this.G=this.G&-65536|a;break;case 193:this.I=this.I&-65536|a;break;case 194:this.M=this.M&-65536|a;break;case 195:this.H=this.H&-65536|a;break;case 196:I(this,J(this)&-65536|a);break;case 197:this.P=this.P&-65536|a;break;case 198:this.K=this.K&-65536|a;break;case 199:this.J=this.J&-65536|a}}
function Le(a){var b,c;switch((this.L=this.xa())&199){case 0:c=R(this,this.H+this.K);this.A-=this.B.dd;break;case 1:c=R(this,this.H+this.J);this.A-=this.B.ed;break;case 2:c=Vf(this,this.P+this.K);this.A-=this.B.ed;break;case 3:c=Vf(this,this.P+this.J);this.A-=this.B.dd;break;case 4:c=R(this,this.K);this.A-=this.B.Jc;break;case 5:c=R(this,this.J);this.A-=this.B.Jc;break;case 6:c=R(this,T(this));this.A-=this.B.Jd;break;case 7:c=R(this,this.H);this.A-=this.B.Jc;break;case 64:c=R(this,this.H+this.K+this.T());
this.A-=this.B.dc;break;case 65:c=R(this,this.H+this.J+this.T());this.A-=this.B.ec;break;case 66:c=Vf(this,this.P+this.K+this.T());this.A-=this.B.ec;break;case 67:c=Vf(this,this.P+this.J+this.T());this.A-=this.B.dc;break;case 68:c=R(this,this.K+this.T());this.A-=this.B.ib;break;case 69:c=R(this,this.J+this.T());this.A-=this.B.ib;break;case 70:c=Vf(this,this.P+this.T());this.A-=this.B.ib;break;case 71:c=R(this,this.H+this.T());this.A-=this.B.ib;break;case 128:c=R(this,this.H+this.K+T(this));this.A-=
this.B.dc;break;case 129:c=R(this,this.H+this.J+T(this));this.A-=this.B.ec;break;case 130:c=Vf(this,this.P+this.K+T(this));this.A-=this.B.ec;break;case 131:c=Vf(this,this.P+this.J+T(this));this.A-=this.B.dc;break;case 132:c=R(this,this.K+T(this));this.A-=this.B.ib;break;case 133:c=R(this,this.J+T(this));this.A-=this.B.ib;break;case 134:c=Vf(this,this.P+T(this));this.A-=this.B.ib;break;case 135:c=R(this,this.H+T(this));this.A-=this.B.ib;break;case 192:c=this.G;break;case 193:c=this.I;break;case 194:c=
this.M;break;case 195:c=this.H;break;case 196:c=J(this);break;case 197:c=this.P;break;case 198:c=this.K;break;case 199:c=this.J;break;default:c=0}var d=this.L>>3&7;switch(d){case 0:b=this.G;break;case 1:b=this.I;break;case 2:b=this.M;break;case 3:b=this.H;break;case 4:b=J(this);break;case 5:b=this.P;break;case 6:b=this.K;break;case 7:b=this.J;break;default:b=0}a=a.call(this,b,c);switch(d){case 0:this.G=a;break;case 1:this.I=a;break;case 2:this.M=a;break;case 3:this.H=a;break;case 4:I(this,a);break;
case 5:this.P=a;break;case 6:this.K=a;break;case 7:this.J=a}}
function Me(a){var b,c,d=(this.L=this.xa())&199;switch(d){case 0:b=R(this,this.H+this.K);this.C=this.D;break;case 1:b=R(this,this.H+this.J);this.C=this.D;break;case 2:b=Vf(this,this.P+this.K);this.C=this.D;break;case 3:b=Vf(this,this.P+this.J);this.C=this.D;break;case 4:b=R(this,this.K);this.C=this.D;break;case 5:b=R(this,this.J);this.C=this.D;break;case 6:b=R(this,T(this));this.C=this.D;break;case 7:b=R(this,this.H);this.C=this.D;break;case 64:b=R(this,this.H+this.K+this.T());this.C=this.D;break;
case 65:b=R(this,this.H+this.J+this.T());this.C=this.D;break;case 66:b=Vf(this,this.P+this.K+this.T());this.C=this.D;break;case 67:b=Vf(this,this.P+this.J+this.T());this.C=this.D;break;case 68:b=R(this,this.K+this.T());this.C=this.D;break;case 69:b=R(this,this.J+this.T());this.C=this.D;break;case 70:b=Vf(this,this.P+this.T());this.C=this.D;break;case 71:b=R(this,this.H+this.T());this.C=this.D;break;case 128:b=R(this,this.H+this.K+T(this));this.C=this.D;break;case 129:b=R(this,this.H+this.J+T(this));
this.C=this.D;break;case 130:b=Vf(this,this.P+this.K+T(this));this.C=this.D;break;case 131:b=Vf(this,this.P+this.J+T(this));this.C=this.D;break;case 132:b=R(this,this.K+T(this));this.C=this.D;break;case 133:b=R(this,this.J+T(this));this.C=this.D;break;case 134:b=Vf(this,this.P+T(this));this.C=this.D;break;case 135:b=R(this,this.H+T(this));this.C=this.D;break;case 192:b=this.G;break;case 193:b=this.I;break;case 194:b=this.M;break;case 195:b=this.H;break;case 196:b=J(this);break;case 197:b=this.P;break;
case 198:b=this.K;break;case 199:b=this.J;break;default:b=0}switch(this.L>>3&7){case 0:c=this.G;break;case 1:c=this.I;break;case 2:c=this.M;break;case 3:c=this.H;break;case 4:c=J(this);break;case 5:c=this.P;break;case 6:c=this.K;break;case 7:c=this.J;break;default:c=0}a=a.call(this,b,c);switch(d){case 0:case 3:Yf(this,a);this.A-=this.B.dd;break;case 1:case 2:Yf(this,a);this.A-=this.B.ed;break;case 4:case 5:case 7:Yf(this,a);this.A-=this.B.Jc;break;case 6:Yf(this,a);this.A-=this.B.Jd;break;case 64:case 67:case 128:case 131:Yf(this,
a);this.A-=this.B.dc;break;case 65:case 66:case 129:case 130:Yf(this,a);this.A-=this.B.ec;break;case 68:case 69:case 70:case 71:case 132:case 133:case 134:case 135:Yf(this,a);this.A-=this.B.ib;break;case 192:this.G=a;break;case 193:this.I=a;break;case 194:this.M=a;break;case 195:this.H=a;break;case 196:I(this,a);break;case 197:this.P=a;break;case 198:this.K=a;break;case 199:this.J=a}}
function Ne(a,b){var c,d=(this.L=this.xa())&199;switch(d){case 0:c=R(this,this.H+this.K);this.C=this.D;break;case 1:c=R(this,this.H+this.J);this.C=this.D;break;case 2:c=Vf(this,this.P+this.K);this.C=this.D;break;case 3:c=Vf(this,this.P+this.J);this.C=this.D;break;case 4:c=R(this,this.K);this.C=this.D;break;case 5:c=R(this,this.J);this.C=this.D;break;case 6:c=R(this,T(this));this.C=this.D;break;case 7:c=R(this,this.H);this.C=this.D;break;case 64:c=R(this,this.H+this.K+this.T());this.C=this.D;break;
case 65:c=R(this,this.H+this.J+this.T());this.C=this.D;break;case 66:c=Vf(this,this.P+this.K+this.T());this.C=this.D;break;case 67:c=Vf(this,this.P+this.J+this.T());this.C=this.D;break;case 68:c=R(this,this.K+this.T());this.C=this.D;break;case 69:c=R(this,this.J+this.T());this.C=this.D;break;case 70:c=Vf(this,this.P+this.T());this.C=this.D;break;case 71:c=R(this,this.H+this.T());this.C=this.D;break;case 128:c=R(this,this.H+this.K+T(this));this.C=this.D;break;case 129:c=R(this,this.H+this.J+T(this));
this.C=this.D;break;case 130:c=Vf(this,this.P+this.K+T(this));this.C=this.D;break;case 131:c=Vf(this,this.P+this.J+T(this));this.C=this.D;break;case 132:c=R(this,this.K+T(this));this.C=this.D;break;case 133:c=R(this,this.J+T(this));this.C=this.D;break;case 134:c=Vf(this,this.P+T(this));this.C=this.D;break;case 135:c=R(this,this.H+T(this));this.C=this.D;break;case 192:c=this.G;break;case 193:c=this.I;break;case 194:c=this.M;break;case 195:c=this.H;break;case 196:c=J(this);break;case 197:c=this.P;break;
case 198:c=this.K;break;case 199:c=this.J}a=a[this.L>>3&7].call(this,c,b.call(this));switch(d){case 0:case 3:Yf(this,a);this.A-=this.B.dd;break;case 1:case 2:Yf(this,a);this.A-=this.B.ed;break;case 4:case 5:case 7:Yf(this,a);this.A-=this.B.Jc;break;case 6:Yf(this,a);this.A-=this.B.Jd;break;case 64:case 67:case 128:case 131:Yf(this,a);this.A-=this.B.dc;break;case 65:case 66:case 129:case 130:Yf(this,a);this.A-=this.B.ec;break;case 68:case 69:case 70:case 71:case 132:case 133:case 134:case 135:Yf(this,
a);this.A-=this.B.ib;break;case 192:this.G=a;break;case 193:this.I=a;break;case 194:this.M=a;break;case 195:this.H=a;break;case 196:I(this,a);break;case 197:this.P=a;break;case 198:this.K=a;break;case 199:this.J=a}}
function Oe(a){var b,c;switch((this.L=this.xa())&199){case 0:c=P(this,this.G);break;case 1:c=P(this,this.I);break;case 2:c=P(this,this.M);break;case 3:c=P(this,this.H);break;case 4:c=P(this,Gj.call(this,0));break;case 5:c=P(this,T(this));break;case 6:c=P(this,this.K);break;case 7:c=P(this,this.J);break;case 64:c=P(this,this.G+this.T());break;case 65:c=P(this,this.I+this.T());break;case 66:c=P(this,this.M+this.T());break;case 67:c=P(this,this.H+this.T());break;case 68:c=P(this,Gj.call(this,1)+this.T());
break;case 69:c=Sf(this,this.P+this.T());break;case 70:c=P(this,this.K+this.T());break;case 71:c=P(this,this.J+this.T());break;case 128:c=P(this,this.G+T(this));break;case 129:c=P(this,this.I+T(this));break;case 130:c=P(this,this.M+T(this));break;case 131:c=P(this,this.H+T(this));break;case 132:c=P(this,Gj.call(this,2)+T(this));break;case 133:c=Sf(this,this.P+T(this));break;case 134:c=P(this,this.K+T(this));break;case 135:c=P(this,this.J+T(this));break;case 192:c=this.G&255;break;case 193:c=this.I&
255;break;case 194:c=this.M&255;break;case 195:c=this.H&255;break;case 196:c=this.G>>8&255;break;case 197:c=this.I>>8&255;break;case 198:c=this.M>>8&255;break;case 199:c=this.H>>8&255;break;default:c=0}var d=this.L>>3&7;switch(d){case 0:b=this.G&255;break;case 1:b=this.I&255;break;case 2:b=this.M&255;break;case 3:b=this.H&255;break;case 4:b=this.G>>8&255;break;case 5:b=this.I>>8&255;break;case 6:b=this.M>>8&255;break;case 7:b=this.H>>8&255;break;default:b=0}a=a.call(this,b,c);switch(d){case 0:this.G=
this.G&-256|a;break;case 1:this.I=this.I&-256|a;break;case 2:this.M=this.M&-256|a;break;case 3:this.H=this.H&-256|a;break;case 4:this.G=this.G&-65281|a<<8;break;case 5:this.I=this.I&-65281|a<<8;break;case 6:this.M=this.M&-65281|a<<8;break;case 7:this.H=this.H&-65281|a<<8}}
function Pe(a){var b,c,d=(this.L=this.xa())&199;switch(d){case 0:b=P(this,this.G);this.C=this.D;break;case 1:b=P(this,this.I);this.C=this.D;break;case 2:b=P(this,this.M);this.C=this.D;break;case 3:b=P(this,this.H);this.C=this.D;break;case 4:b=P(this,Gj.call(this,0));this.C=this.D;break;case 5:b=P(this,T(this));this.C=this.D;break;case 6:b=P(this,this.K);this.C=this.D;break;case 7:b=P(this,this.J);this.C=this.D;break;case 64:b=P(this,this.G+this.T());this.C=this.D;break;case 65:b=P(this,this.I+this.T());
this.C=this.D;break;case 66:b=P(this,this.M+this.T());this.C=this.D;break;case 67:b=P(this,this.H+this.T());this.C=this.D;break;case 68:b=P(this,Gj.call(this,1)+this.T());this.C=this.D;break;case 69:b=Sf(this,this.P+this.T());this.C=this.D;break;case 70:b=P(this,this.K+this.T());this.C=this.D;break;case 71:b=P(this,this.J+this.T());this.C=this.D;break;case 128:b=P(this,this.G+T(this));this.C=this.D;break;case 129:b=P(this,this.I+T(this));this.C=this.D;break;case 130:b=P(this,this.M+T(this));this.C=
this.D;break;case 131:b=P(this,this.H+T(this));this.C=this.D;break;case 132:b=P(this,Gj.call(this,2)+T(this));this.C=this.D;break;case 133:b=Sf(this,this.P+T(this));this.C=this.D;break;case 134:b=P(this,this.K+T(this));this.C=this.D;break;case 135:b=P(this,this.J+T(this));this.C=this.D;break;case 192:b=this.G&255;break;case 193:b=this.I&255;break;case 194:b=this.M&255;break;case 195:b=this.H&255;break;case 196:b=this.G>>8&255;break;case 197:b=this.I>>8&255;break;case 198:b=this.M>>8&255;break;case 199:b=
this.H>>8&255;break;default:b=0}switch(this.L>>3&7){case 0:c=this.G&255;break;case 1:c=this.I&255;break;case 2:c=this.M&255;break;case 3:c=this.H&255;break;case 4:c=this.G>>8&255;break;case 5:c=this.I>>8&255;break;case 6:c=this.M>>8&255;break;case 7:c=this.H>>8&255;break;default:c=0}a=a.call(this,b,c);switch(d){case 192:this.G=this.G&-256|a;break;case 193:this.I=this.I&-256|a;break;case 194:this.M=this.M&-256|a;break;case 195:this.H=this.H&-256|a;break;case 196:this.G=this.G&-65281|a<<8;break;case 197:this.I=
this.I&-65281|a<<8;break;case 198:this.M=this.M&-65281|a<<8;break;case 199:this.H=this.H&-65281|a<<8;break;default:Wf(this,a)}}
function Qe(a,b){var c,d=(this.L=this.xa())&199;switch(d){case 0:c=P(this,this.G);this.C=this.D;break;case 1:c=P(this,this.I);this.C=this.D;break;case 2:c=P(this,this.M);this.C=this.D;break;case 3:c=P(this,this.H);this.C=this.D;break;case 4:c=P(this,Gj.call(this,0));this.C=this.D;break;case 5:c=P(this,T(this));this.C=this.D;break;case 6:c=P(this,this.K);this.C=this.D;break;case 7:c=P(this,this.J);this.C=this.D;break;case 64:c=P(this,this.G+this.T());this.C=this.D;break;case 65:c=P(this,this.I+this.T());
this.C=this.D;break;case 66:c=P(this,this.M+this.T());this.C=this.D;break;case 67:c=P(this,this.H+this.T());this.C=this.D;break;case 68:c=P(this,Gj.call(this,1)+this.T());this.C=this.D;break;case 69:c=Sf(this,this.P+this.T());this.C=this.D;break;case 70:c=P(this,this.K+this.T());this.C=this.D;break;case 71:c=P(this,this.J+this.T());this.C=this.D;break;case 128:c=P(this,this.G+T(this));this.C=this.D;break;case 129:c=P(this,this.I+T(this));this.C=this.D;break;case 130:c=P(this,this.M+T(this));this.C=
this.D;break;case 131:c=P(this,this.H+T(this));this.C=this.D;break;case 132:c=P(this,Gj.call(this,2)+T(this));this.C=this.D;break;case 133:c=Sf(this,this.P+T(this));this.C=this.D;break;case 134:c=P(this,this.K+T(this));this.C=this.D;break;case 135:c=P(this,this.J+T(this));this.C=this.D;break;case 192:c=this.G&255;break;case 193:c=this.I&255;break;case 194:c=this.M&255;break;case 195:c=this.H&255;break;case 196:c=this.G>>8&255;break;case 197:c=this.I>>8&255;break;case 198:c=this.M>>8&255;break;case 199:c=
this.H>>8&255;break;default:c=0}a=a[this.L>>3&7].call(this,c,b.call(this));switch(d){case 192:this.G=this.G&-256|a;break;case 193:this.I=this.I&-256|a;break;case 194:this.M=this.M&-256|a;break;case 195:this.H=this.H&-256|a;break;case 196:this.G=this.G&-65281|a<<8;break;case 197:this.I=this.I&-65281|a<<8;break;case 198:this.M=this.M&-65281|a<<8;break;case 199:this.H=this.H&-65281|a<<8;break;default:Wf(this,a)}}
function cf(a){var b,c;switch((this.L=this.xa())&199){case 0:c=Q(this,this.G);break;case 1:c=Q(this,this.I);break;case 2:c=Q(this,this.M);break;case 3:c=Q(this,this.H);break;case 4:c=Q(this,Gj.call(this,0));break;case 5:c=Q(this,T(this));break;case 6:c=Q(this,this.K);break;case 7:c=Q(this,this.J);break;case 64:c=Q(this,this.G+this.T());break;case 65:c=Q(this,this.I+this.T());break;case 66:c=Q(this,this.M+this.T());break;case 67:c=Q(this,this.H+this.T());break;case 68:c=Q(this,Gj.call(this,1)+this.T());
break;case 69:c=Uf(this,this.P+this.T());break;case 70:c=Q(this,this.K+this.T());break;case 71:c=Q(this,this.J+this.T());break;case 128:c=Q(this,this.G+T(this));break;case 129:c=Q(this,this.I+T(this));break;case 130:c=Q(this,this.M+T(this));break;case 131:c=Q(this,this.H+T(this));break;case 132:c=Q(this,Gj.call(this,2)+T(this));break;case 133:c=Uf(this,this.P+T(this));break;case 134:c=Q(this,this.K+T(this));break;case 135:c=Q(this,this.J+T(this));break;case 192:c=this.G&65535;break;case 193:c=this.I&
65535;break;case 194:c=this.M&65535;break;case 195:c=this.H&65535;break;case 196:c=J(this)&65535;break;case 197:c=this.P&65535;break;case 198:c=this.K&65535;break;case 199:c=this.J&65535;break;default:c=0}var d=this.L>>3&7;switch(d){case 0:b=this.G&65535;break;case 1:b=this.I&65535;break;case 2:b=this.M&65535;break;case 3:b=this.H&65535;break;case 4:b=J(this)&65535;break;case 5:b=this.P&65535;break;case 6:b=this.K&65535;break;case 7:b=this.J&65535;break;default:b=0}a=a.call(this,b,c);switch(d){case 0:this.G=
this.G&-65536|a;break;case 1:this.I=this.I&-65536|a;break;case 2:this.M=this.M&-65536|a;break;case 3:this.H=this.H&-65536|a;break;case 4:I(this,J(this)&-65536|a);break;case 5:this.P=this.P&-65536|a;break;case 6:this.K=this.K&-65536|a;break;case 7:this.J=this.J&-65536|a}}
function df(a){var b,c,d=(this.L=this.xa())&199;switch(d){case 0:b=Q(this,this.G);this.C=this.D;break;case 1:b=Q(this,this.I);this.C=this.D;break;case 2:b=Q(this,this.M);this.C=this.D;break;case 3:b=Q(this,this.H);this.C=this.D;break;case 4:b=Q(this,Gj.call(this,0));this.C=this.D;break;case 5:b=Q(this,T(this));this.C=this.D;break;case 6:b=Q(this,this.K);this.C=this.D;break;case 7:b=Q(this,this.J);this.C=this.D;break;case 64:b=Q(this,this.G+this.T());this.C=this.D;break;case 65:b=Q(this,this.I+this.T());
this.C=this.D;break;case 66:b=Q(this,this.M+this.T());this.C=this.D;break;case 67:b=Q(this,this.H+this.T());this.C=this.D;break;case 68:b=Q(this,Gj.call(this,1)+this.T());this.C=this.D;break;case 69:b=Uf(this,this.P+this.T());this.C=this.D;break;case 70:b=Q(this,this.K+this.T());this.C=this.D;break;case 71:b=Q(this,this.J+this.T());this.C=this.D;break;case 128:b=Q(this,this.G+T(this));this.C=this.D;break;case 129:b=Q(this,this.I+T(this));this.C=this.D;break;case 130:b=Q(this,this.M+T(this));this.C=
this.D;break;case 131:b=Q(this,this.H+T(this));this.C=this.D;break;case 132:b=Q(this,Gj.call(this,2)+T(this));this.C=this.D;break;case 133:b=Uf(this,this.P+T(this));this.C=this.D;break;case 134:b=Q(this,this.K+T(this));this.C=this.D;break;case 135:b=Q(this,this.J+T(this));this.C=this.D;break;case 192:b=this.G&65535;break;case 193:b=this.I&65535;break;case 194:b=this.M&65535;break;case 195:b=this.H&65535;break;case 196:b=J(this)&65535;break;case 197:b=this.P&65535;break;case 198:b=this.K&65535;break;
case 199:b=this.J&65535;break;default:b=0}switch(this.L>>3&7){case 0:c=this.G&65535;break;case 1:c=this.I&65535;break;case 2:c=this.M&65535;break;case 3:c=this.H&65535;break;case 4:c=J(this)&65535;break;case 5:c=this.P&65535;break;case 6:c=this.K&65535;break;case 7:c=this.J&65535;break;default:c=0}a=a.call(this,b,c);switch(d){case 192:this.G=this.G&-65536|a;break;case 193:this.I=this.I&-65536|a;break;case 194:this.M=this.M&-65536|a;break;case 195:this.H=this.H&-65536|a;break;case 196:I(this,J(this)&
-65536|a);break;case 197:this.P=this.P&-65536|a;break;case 198:this.K=this.K&-65536|a;break;case 199:this.J=this.J&-65536|a;break;default:Xf(this,a)}}
function ef(a,b){var c,d=(this.L=this.xa())&199;switch(d){case 0:c=Q(this,this.G);this.C=this.D;break;case 1:c=Q(this,this.I);this.C=this.D;break;case 2:c=Q(this,this.M);this.C=this.D;break;case 3:c=Q(this,this.H);this.C=this.D;break;case 4:c=Q(this,Gj.call(this,0));this.C=this.D;break;case 5:c=Q(this,T(this));this.C=this.D;break;case 6:c=Q(this,this.K);this.C=this.D;break;case 7:c=Q(this,this.J);this.C=this.D;break;case 64:c=Q(this,this.G+this.T());this.C=this.D;break;case 65:c=Q(this,this.I+this.T());
this.C=this.D;break;case 66:c=Q(this,this.M+this.T());this.C=this.D;break;case 67:c=Q(this,this.H+this.T());this.C=this.D;break;case 68:c=Q(this,Gj.call(this,1)+this.T());this.C=this.D;break;case 69:c=Uf(this,this.P+this.T());this.C=this.D;break;case 70:c=Q(this,this.K+this.T());this.C=this.D;break;case 71:c=Q(this,this.J+this.T());this.C=this.D;break;case 128:c=Q(this,this.G+T(this));this.C=this.D;break;case 129:c=Q(this,this.I+T(this));this.C=this.D;break;case 130:c=Q(this,this.M+T(this));this.C=
this.D;break;case 131:c=Q(this,this.H+T(this));this.C=this.D;break;case 132:c=Q(this,Gj.call(this,2)+T(this));this.C=this.D;break;case 133:c=Uf(this,this.P+T(this));this.C=this.D;break;case 134:c=Q(this,this.K+T(this));this.C=this.D;break;case 135:c=Q(this,this.J+T(this));this.C=this.D;break;case 192:c=this.G&65535;break;case 193:c=this.I&65535;break;case 194:c=this.M&65535;break;case 195:c=this.H&65535;break;case 196:c=J(this)&65535;break;case 197:c=this.P&65535;break;case 198:c=this.K&65535;break;
case 199:c=this.J&65535;break;default:c=0}a=a[this.L>>3&7].call(this,c,b.call(this));switch(d){case 192:this.G=this.G&-65536|a;break;case 193:this.I=this.I&-65536|a;break;case 194:this.M=this.M&-65536|a;break;case 195:this.H=this.H&-65536|a;break;case 196:I(this,J(this)&-65536|a);break;case 197:this.P=this.P&-65536|a;break;case 198:this.K=this.K&-65536|a;break;case 199:this.J=this.J&-65536|a;break;default:Xf(this,a)}}
function ff(a){var b,c;switch((this.L=this.xa())&199){case 0:c=R(this,this.G);break;case 1:c=R(this,this.I);break;case 2:c=R(this,this.M);break;case 3:c=R(this,this.H);break;case 4:c=R(this,Gj.call(this,0));break;case 5:c=R(this,T(this));break;case 6:c=R(this,this.K);break;case 7:c=R(this,this.J);break;case 64:c=R(this,this.G+this.T());break;case 65:c=R(this,this.I+this.T());break;case 66:c=R(this,this.M+this.T());break;case 67:c=R(this,this.H+this.T());break;case 68:c=R(this,Gj.call(this,1)+this.T());
break;case 69:c=Vf(this,this.P+this.T());break;case 70:c=R(this,this.K+this.T());break;case 71:c=R(this,this.J+this.T());break;case 128:c=R(this,this.G+T(this));break;case 129:c=R(this,this.I+T(this));break;case 130:c=R(this,this.M+T(this));break;case 131:c=R(this,this.H+T(this));break;case 132:c=R(this,Gj.call(this,2)+T(this));break;case 133:c=Vf(this,this.P+T(this));break;case 134:c=R(this,this.K+T(this));break;case 135:c=R(this,this.J+T(this));break;case 192:c=this.G;break;case 193:c=this.I;break;
case 194:c=this.M;break;case 195:c=this.H;break;case 196:c=J(this);break;case 197:c=this.P;break;case 198:c=this.K;break;case 199:c=this.J;break;default:c=0}var d=this.L>>3&7;switch(d){case 0:b=this.G;break;case 1:b=this.I;break;case 2:b=this.M;break;case 3:b=this.H;break;case 4:b=J(this);break;case 5:b=this.P;break;case 6:b=this.K;break;case 7:b=this.J;break;default:b=0}a=a.call(this,b,c);switch(d){case 0:this.G=a;break;case 1:this.I=a;break;case 2:this.M=a;break;case 3:this.H=a;break;case 4:I(this,
a);break;case 5:this.P=a;break;case 6:this.K=a;break;case 7:this.J=a}}
function gf(a){var b,c,d=(this.L=this.xa())&199;switch(d){case 0:b=R(this,this.G);this.C=this.D;break;case 1:b=R(this,this.I);this.C=this.D;break;case 2:b=R(this,this.M);this.C=this.D;break;case 3:b=R(this,this.H);this.C=this.D;break;case 4:b=R(this,Gj.call(this,0));this.C=this.D;break;case 5:b=R(this,T(this));this.C=this.D;break;case 6:b=R(this,this.K);this.C=this.D;break;case 7:b=R(this,this.J);this.C=this.D;break;case 64:b=R(this,this.G+this.T());this.C=this.D;break;case 65:b=R(this,this.I+this.T());
this.C=this.D;break;case 66:b=R(this,this.M+this.T());this.C=this.D;break;case 67:b=R(this,this.H+this.T());this.C=this.D;break;case 68:b=R(this,Gj.call(this,1)+this.T());this.C=this.D;break;case 69:b=Vf(this,this.P+this.T());this.C=this.D;break;case 70:b=R(this,this.K+this.T());this.C=this.D;break;case 71:b=R(this,this.J+this.T());this.C=this.D;break;case 128:b=R(this,this.G+T(this));this.C=this.D;break;case 129:b=R(this,this.I+T(this));this.C=this.D;break;case 130:b=R(this,this.M+T(this));this.C=
this.D;break;case 131:b=R(this,this.H+T(this));this.C=this.D;break;case 132:b=R(this,Gj.call(this,2)+T(this));this.C=this.D;break;case 133:b=Vf(this,this.P+T(this));this.C=this.D;break;case 134:b=R(this,this.K+T(this));this.C=this.D;break;case 135:b=R(this,this.J+T(this));this.C=this.D;break;case 192:b=this.G;break;case 193:b=this.I;break;case 194:b=this.M;break;case 195:b=this.H;break;case 196:b=J(this);break;case 197:b=this.P;break;case 198:b=this.K;break;case 199:b=this.J;break;default:b=0}switch(this.L>>
3&7){case 0:c=this.G;break;case 1:c=this.I;break;case 2:c=this.M;break;case 3:c=this.H;break;case 4:c=J(this);break;case 5:c=this.P;break;case 6:c=this.K;break;case 7:c=this.J;break;default:c=0}a=a.call(this,b,c);switch(d){case 192:this.G=a;break;case 193:this.I=a;break;case 194:this.M=a;break;case 195:this.H=a;break;case 196:I(this,a);break;case 197:this.P=a;break;case 198:this.K=a;break;case 199:this.J=a;break;default:Yf(this,a)}}
function hf(a,b){var c,d=(this.L=this.xa())&199;switch(d){case 0:c=R(this,this.G);this.C=this.D;break;case 1:c=R(this,this.I);this.C=this.D;break;case 2:c=R(this,this.M);this.C=this.D;break;case 3:c=R(this,this.H);this.C=this.D;break;case 4:c=R(this,Gj.call(this,0));this.C=this.D;break;case 5:c=R(this,T(this));this.C=this.D;break;case 6:c=R(this,this.K);this.C=this.D;break;case 7:c=R(this,this.J);this.C=this.D;break;case 64:c=R(this,this.G+this.T());this.C=this.D;break;case 65:c=R(this,this.I+this.T());
this.C=this.D;break;case 66:c=R(this,this.M+this.T());this.C=this.D;break;case 67:c=R(this,this.H+this.T());this.C=this.D;break;case 68:c=R(this,Gj.call(this,1)+this.T());this.C=this.D;break;case 69:c=Vf(this,this.P+this.T());this.C=this.D;break;case 70:c=R(this,this.K+this.T());this.C=this.D;break;case 71:c=R(this,this.J+this.T());this.C=this.D;break;case 128:c=R(this,this.G+T(this));this.C=this.D;break;case 129:c=R(this,this.I+T(this));this.C=this.D;break;case 130:c=R(this,this.M+T(this));this.C=
this.D;break;case 131:c=R(this,this.H+T(this));this.C=this.D;break;case 132:c=R(this,Gj.call(this,2)+T(this));this.C=this.D;break;case 133:c=Vf(this,this.P+T(this));this.C=this.D;break;case 134:c=R(this,this.K+T(this));this.C=this.D;break;case 135:c=R(this,this.J+T(this));this.C=this.D;break;case 192:c=this.G;break;case 193:c=this.I;break;case 194:c=this.M;break;case 195:c=this.H;break;case 196:c=J(this);break;case 197:c=this.P;break;case 198:c=this.K;break;case 199:c=this.J;break;default:c=0}a=a[this.L>>
3&7].call(this,c,b.call(this));switch(d){case 192:this.G=a;break;case 193:this.I=a;break;case 194:this.M=a;break;case 195:this.H=a;break;case 196:I(this,a);break;case 197:this.P=a;break;case 198:this.K=a;break;case 199:this.J=a;break;default:Yf(this,a)}}
function Gj(a){var b=this.xa(),c=b>>6,d,e;switch(b>>3&7){case 0:d=this.G;break;case 1:d=this.I;break;case 2:d=this.M;break;case 3:d=this.H;break;case 4:d=0;break;case 5:d=this.P;break;case 6:d=this.K;break;case 7:d=this.J}switch(b&7){case 0:e=this.G;break;case 1:e=this.I;break;case 2:e=this.M;break;case 3:e=this.H;break;case 4:e=J(this);this.ka=this.Ka;break;case 5:a?(e=this.P,this.ka=this.Ka):e=T(this);break;case 6:e=this.K;break;case 7:e=this.J}return(d<<c)+e|0}
function ke(){this.tc[this.xa()].call(this)}function ne(){K(this,J(this)&this.R);this.A-=this.B.Rc}function Md(){this.U=this.fa;var a=J(this)&this.R;K(this,this.G&this.R);K(this,this.I&this.R);K(this,this.M&this.R);K(this,this.H&this.R);K(this,a);K(this,this.P&this.R);K(this,this.K&this.R);K(this,this.J&this.R);this.A-=this.B.zk;this.U=-1}
function Nd(){this.U=this.fa;this.J=this.J&~this.R|H(this);this.K=this.K&~this.R|H(this);this.P=this.P&~this.R|H(this);I(this,J(this)+this.ba);this.H=this.H&~this.R|H(this);this.M=this.M&~this.R|H(this);this.I=this.I&~this.R|H(this);this.G=this.G&~this.R|H(this);this.A-=this.B.xk;this.U=-1}function Od(){this.V.call(this,Eh)}function oe(){!(this.$a&1)||this.ca&131072?E.call(this,6):this.ea.call(this,Dh)}function pe(){this.S|=20;this.ka=this.Ka=this.Nb;this.A-=this.B.nd}
function qe(){this.S|=20;this.ka=this.Ka=this.Ob;this.A-=this.B.nd}function re(){this.S|=1024;this.Ia&1024||(this.ba^=6,this.R^=-65536,jf(this));this.A-=this.B.nd}function se(){this.S|=2048;this.Ia&2048||(this.Tc^=6,this.Ba^=-65536,Ce(this));this.A-=this.B.nd}function Pd(){K(this,this.Ma());this.A-=this.B.Rc}function Qd(){this.V.call(this,Vh)}function Rd(){K(this,this.T());this.A-=this.B.Rc}function Sd(){this.V.call(this,Th)}
function Td(){var a=1,b=0,c=this.Ba,d=5;this.Ia&192&&(a=this.I&c,b=1,this.Ia&256&&(d=4));if(a--){var e=this.M&65535;Pf(this,e,1,!0)&&(e=rc(this.ga,e,1,this.Ha-b-1),this.qc(this.Xa.nc(this.J&c,1),e),this.J=this.J&~c|this.J+(this.ca&1024?-1:1)&c,this.I=this.I&~c|this.I-b&c,this.A-=d,a&&(vf(this),this.S|=256))}}
function Xd(){var a=1,b=0,c=this.Ba,d=5;this.Ia&192&&(a=this.I&c,b=1,this.Ia&256&&(d=4));if(a--){var e=this.M&65535;Pf(this,e,this.ba,!0)&&(e=rc(this.ga,e,this.ba,this.Ha-b-1),this.rc(this.Xa.nc(this.J&c,this.ba),e),this.J=this.J&~c|this.J+(this.ca&1024?-this.ba:this.ba)&c,this.I=this.I&~c|this.I-b&c,this.A-=d,a&&(vf(this),this.S|=256))}}
function Yd(){var a=1,b=0,c=this.Ba,d=5;this.Ia&192&&(a=this.I&c,b=1,this.Ia&256&&(d=4));if(a--){var e=this.M&65535;if(Pf(this,e,1,!1)){var f=this.Qa(this.vb.mc(this.K&c,1));zc(this.ga,e,1,f,this.Ha-b-1);this.K=this.K&~c|this.K+(this.ca&1024?-1:1)&c;this.I=this.I&~c|this.I-b&c;this.A-=d;a&&(vf(this),this.S|=256)}}}
function Zd(){var a=1,b=0,c=this.Ba,d=5;this.Ia&192&&(a=this.I&c,b=1,this.Ia&256&&(d=4));if(a--){var e=yd(this,this.vb,this.K&c),f=this.M&65535;Pf(this,f,this.ba,!1)&&(zc(this.ga,f,this.ba,e,this.Ha-b-1),this.K=this.K&~c|this.K+(this.ca&1024?-this.ba:this.ba)&c,this.I=this.I&~c|this.I-b&c,this.A-=d,a&&(vf(this),this.S|=256))}}function Hj(){var a=this.T();Cf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb}
function Ij(){var a=this.T();Cf(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)}function Jj(){var a=this.T();xf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb}function Kj(){var a=this.T();xf(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)}function Lj(){var a=this.T();Af(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb}function Mj(){var a=this.T();Af(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)}
function Nj(){var a=this.T();xf(this)||Af(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb}function Oj(){var a=this.T();xf(this)||Af(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)}function Pj(){var a=this.T();Bf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb}function Qj(){var a=this.T();Bf(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)}function Rj(){var a=this.T();yf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb}
function Sj(){var a=this.T();yf(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)}function Tj(){var a=this.T();!Bf(this)!=!Cf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb}function Uj(){var a=this.T();!Bf(this)==!Cf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb}function Vj(){var a=this.T();Af(this)||!Bf(this)!=!Cf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb}
function Wj(){var a=this.T();Af(this)||!Bf(this)!=!Cf(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)}function Xj(){this.Jb.call(this,Yj,this.xa);this.A-=-1===this.C?1:this.B.Jg}function Zj(){this.S|=1;this.Ya.call(this,gi)}function ak(){this.S|=1;this.ea.call(this,gi)}function bk(){this.Oa.call(this,gi)}function ck(){this.V.call(this,gi)}function ee(){this.Jb.call(this,dk,yj)}function fe(){this.ya.call(this,2==this.ba?ek:fk,yj)}
function gk(){var a=Zf(this),b=H(this);O(this,b);a&&I(this,J(this)+a);this.A-=this.B.Ek}function hk(){var a=H(this);O(this,a);this.A-=this.B.Bk}function ge(){this.U=this.fa;var a=Zf(this),b=this.xa()&31;this.A-=11;K(this,this.P);var c=J(this)&this.R;if(0<b){for(this.A-=(b<<2)+(1<b?1:0);--b;)this.P=this.P&~this.R|this.P-this.ba&this.R,K(this,yd(this,this.ta,this.P&this.R));K(this,c)}this.P=this.P&~this.R|c;I(this,J(this)&~this.ta.Ba|J(this)-a&this.ta.Ba);this.U=-1}
function he(){this.U=this.fa;I(this,J(this)&~this.ta.Ba|this.P&this.ta.Ba);this.P=this.P&~this.R|H(this)&this.R;this.A-=5;this.U=-1}function ik(){Dj.call(this,Zf(this));this.A-=this.B.Dk}function jk(){Dj.call(this,0);this.A-=this.B.Ck}function kk(a){this.mg=a;this.V.call(this,Rh)}function lk(){this.S|=36;this.A-=this.B.nd}function ie(){me.call(this)}function Ld(){E.call(this,6)}
function me(){O(this,this.qe-this.wa.Aa);zb(this,"Undefined opcode "+u(this.Qa(this.Ha))+" at "+r(this.Ha,8,!0));this.Wb()}
var Hd=[function(){this.Ya.call(this,zh)},function(){this.ea.call(this,Ah)},function(){this.Oa.call(this,zh)},function(){this.V.call(this,Ah)},function(){this.G=this.G&-256|zh.call(this,this.G&255,this.xa());this.A--},function(){this.G=this.G&~this.R|Ah.call(this,this.G&this.R,this.Ma());this.A--},function(){zd(this,this.Xa.Z,this.ba,2);this.A-=this.B.Ke},function(){this.U=this.fa;Bd(this,H(this));this.A-=this.B.zc;this.U=-1},function(){this.Ya.call(this,Ci)},function(){this.ea.call(this,Di)},function(){this.Oa.call(this,
Ci)},function(){this.V.call(this,Di)},function(){this.G=this.G&-256|Ci.call(this,this.G&255,this.xa());this.A--},function(){this.G=this.G&~this.R|Di.call(this,this.G&this.R,this.Ma());this.A--},function(){zd(this,this.wa.Z,this.ba,2);this.A-=this.B.Ke},function(){sf(this,H(this));this.A-=this.B.zc},function(){this.Ya.call(this,xh)},function(){this.ea.call(this,yh)},function(){this.Oa.call(this,xh)},function(){this.V.call(this,yh)},function(){this.G=this.G&-256|xh.call(this,this.G&255,this.xa());this.A--},
function(){this.G=this.G&~this.R|yh.call(this,this.G&this.R,this.Ma());this.A--},function(){zd(this,this.ta.Z,this.ba,2);this.A-=this.B.Ke},function(){this.U=this.fa;ud(this,H(this));this.A-=this.B.zc;this.U=-1},function(){this.Ya.call(this,Ei)},function(){this.ea.call(this,Fi)},function(){this.Oa.call(this,Ei)},function(){this.V.call(this,Fi)},function(){this.G=this.G&-256|Ei.call(this,this.G&255,this.xa());this.A--},function(){this.G=this.G&~this.R|Fi.call(this,this.G&this.R,this.Ma());this.A--},
function(){zd(this,this.vb.Z,this.ba,2);this.A-=this.B.Ke},function(){this.U=this.fa;Ad(this,H(this));this.A-=this.B.zc;this.U=-1},function(){this.Ya.call(this,Bh)},function(){this.ea.call(this,Ch)},function(){this.Oa.call(this,Bh)},function(){this.V.call(this,Ch)},function(){this.G=this.G&-256|Bh.call(this,this.G&255,this.xa());this.A--},function(){this.G=this.G&~this.R|Ch.call(this,this.G&this.R,this.Ma());this.A--},function(){this.S|=20;this.ka=this.Ka=this.Xa;this.A-=this.B.nd},function(){var a=
this.G&255,b=zf(this),c=xf(this);9<(a&15)||b?(a+=6,b=16):b=0;159<a||c?(a+=96,c=1):c=0;a&=255;this.G=this.G&-256|a;Df(this,a,128);c?Ef(this):Ff(this);b?Mf(this):Kf(this);this.A-=this.B.Je},function(){this.Ya.call(this,gj)},function(){this.ea.call(this,hj)},function(){this.Oa.call(this,gj)},function(){this.V.call(this,hj)},function(){this.G=this.G&-256|gj.call(this,this.G&255,this.xa());this.A--},function(){this.G=this.G&~this.R|hj.call(this,this.G&this.R,this.Ma());this.A--},function(){this.S|=20;
this.ka=this.Ka=this.wa;this.A-=this.B.nd},function(){var a=this.G&255,b=zf(this),c=xf(this);9<(a&15)||b?(a-=6,b=16):b=0;159<a||c?(a-=96,c=1):c=0;a&=255;this.G=this.G&-256|a;Df(this,a,128);c?Ef(this):Ff(this);b?Mf(this):Kf(this);this.A-=this.B.Je},function(){this.Ya.call(this,oj)},function(){this.ea.call(this,pj)},function(){this.Oa.call(this,oj)},function(){this.V.call(this,pj)},function(){this.G=this.G&-256|oj.call(this,this.G&255,this.xa());this.A--},function(){this.G=this.G&~this.R|pj.call(this,
this.G&this.R,this.Ma());this.A--},function(){this.S|=20;this.ka=this.Ka=this.ta;this.A-=this.B.nd},function(){var a,b,c=this.G&255,d=this.G>>8&255;9<(c&15)||zf(this)?(c+=6,80286<=this.ja&&255<c&&d++,d++,a=b=1):a=b=0;this.G=this.G&-65536|(d<<8|c)&65295;a?Ef(this):Ff(this);b?Mf(this):Kf(this);this.A-=this.B.Je},function(){this.Ya.call(this,Ph)},function(){this.ea.call(this,Qh)},function(){this.Oa.call(this,Ph)},function(){this.V.call(this,Qh)},function(){Ph.call(this,this.G&255,this.xa());this.A--},
function(){Qh.call(this,this.G&this.R,this.Ma());this.A--},function(){this.S|=20;this.ka=this.Ka=this.vb;this.A-=this.B.nd},function(){var a,b,c=this.G&255,d=this.G>>8&255;9<(c&15)||zf(this)?(c=c-6&15,d=d-1&255,a=b=1):a=b=0;this.G=this.G&-65536|d<<8|c;a?Ef(this):Ff(this);b?Mf(this):Kf(this);this.A-=this.B.Je},function(){this.G=tj.call(this,this.G)},function(){this.I=tj.call(this,this.I)},function(){this.M=tj.call(this,this.M)},function(){this.H=tj.call(this,this.H)},function(){I(this,tj.call(this,
J(this)))},function(){this.P=tj.call(this,this.P)},function(){this.K=tj.call(this,this.K)},function(){this.J=tj.call(this,this.J)},function(){this.G=rj.call(this,this.G)},function(){this.I=rj.call(this,this.I)},function(){this.M=rj.call(this,this.M)},function(){this.H=rj.call(this,this.H)},function(){I(this,rj.call(this,J(this)))},function(){this.P=rj.call(this,this.P)},function(){this.K=rj.call(this,this.K)},function(){this.J=rj.call(this,this.J)},function(){K(this,this.G&this.R);this.A-=this.B.Rc},
function(){K(this,this.I&this.R);this.A-=this.B.Rc},function(){K(this,this.M&this.R);this.A-=this.B.Rc},function(){K(this,this.H&this.R);this.A-=this.B.Rc},function(){K(this,J(this)-2&65535);this.A-=this.B.Rc},function(){K(this,this.P&this.R);this.A-=this.B.Rc},function(){K(this,this.K&this.R);this.A-=this.B.Rc},function(){K(this,this.J&this.R);this.A-=this.B.Rc},function(){this.G=this.G&~this.R|H(this);this.A-=this.B.zc},function(){this.I=this.I&~this.R|H(this);this.A-=this.B.zc},function(){this.M=
this.M&~this.R|H(this);this.A-=this.B.zc},function(){this.H=this.H&~this.R|H(this);this.A-=this.B.zc},function(){I(this,J(this)&~this.R|H(this));this.A-=this.B.zc},function(){this.P=this.P&~this.R|H(this);this.A-=this.B.zc},function(){this.K=this.K&~this.R|H(this);this.A-=this.B.zc},function(){this.J=this.J&~this.R|H(this);this.A-=this.B.zc},Hj,Ij,Jj,Kj,Lj,Mj,Nj,Oj,Pj,Qj,Rj,Sj,Tj,Uj,Vj,Wj,Hj,Ij,Jj,Kj,Lj,Mj,Nj,Oj,Pj,Qj,Rj,Sj,Tj,Uj,Vj,Wj,Xj,function(){this.ya.call(this,mk,this.Ma);this.A-=-1===this.C?
1:this.B.Jg},Xj,function(){this.ya.call(this,mk,this.T);this.A-=-1===this.C?1:this.B.Jg},function(){this.Ya.call(this,ij)},function(){this.ea.call(this,jj)},function(){this.Oa.call(this,mj)},function(){this.V.call(this,nj)},Zj,ak,bk,ck,function(){this.S|=1;this.ea.call(this,Bi)},function(){this.S|=1;this.ka=this.Ka=this.rf;this.V.call(this,ai)},function(){var a;this.V.call(this,Ai);switch(this.L>>3&7){case 0:a=this.G;this.G=this.aa;Bd(this,a);break;case 1:a=this.I;this.I=this.aa;sf(this,a);break;
case 2:a=this.M;this.M=this.aa;ud(this,a);break;case 3:a=this.H;this.H=this.aa;Ad(this,a);break;case 4:a=J(this);I(this,this.aa);80386<=this.ja?this.Nb.load(a):Bd(this,a);break;case 5:a=this.P;this.P=this.aa;80386<=this.ja?this.Ob.load(a):sf(this,a);break;case 6:a=this.K;this.K=this.aa;ud(this,a);break;case 7:a=this.J,this.J=this.aa,Ad(this,a)}},function(){this.S|=1;this.U=this.fa;this.aa=H(this);this.ya.call(this,nk,Aj);this.U=-1},function(){this.A-=3},function(){var a=this.G;this.G=this.G&~this.R|
this.I&this.R;this.I=this.I&~this.R|a&this.R;this.A-=3},function(){var a=this.G;this.G=this.G&~this.R|this.M&this.R;this.M=this.M&~this.R|a&this.R;this.A-=3},function(){var a=this.G;this.G=this.G&~this.R|this.H&this.R;this.H=this.H&~this.R|a&this.R;this.A-=3},function(){var a=this.G,b=J(this);this.G=this.G&~this.R|b&this.R;I(this,b&~this.R|a&this.R);this.A-=3},function(){var a=this.G;this.G=this.G&~this.R|this.P&this.R;this.P=this.P&~this.R|a&this.R;this.A-=3},function(){var a=this.G;this.G=this.G&
~this.R|this.K&this.R;this.K=this.K&~this.R|a&this.R;this.A-=3},function(){var a=this.G;this.G=this.G&~this.R|this.J&this.R;this.J=this.J&~this.R|a&this.R;this.A-=3},function(){this.G=2==this.ba?this.G&-65536|this.G<<24>>24&65535:this.G<<16>>16;this.A-=2},function(){this.M=2==this.ba?this.M&-65536|(this.G&32768?65535:0):this.G&-2147483648?-1:0;this.A-=this.B.Kj},function(){Bj.call(this,this.Ma(),Zf(this));this.A-=this.B.Nj},function(){this.A-=3},function(){var a=Cd(this);a&131072&&3>this.Pa?E.call(this,
13,0):(K(this,a&-196609),this.A-=this.B.Rc)},function(){if(this.ca&131072&&3>this.Pa)E.call(this,13,0);else{var a=H(this),a=a&65535|this.ca&-65536;Dd(this,a);this.A-=this.B.zc}},function(){var a=this.G>>8&255;a&1?Ef(this):Ff(this);a&4?(this.resultType&=-3,this.ca|=4):(this.resultType&=-3,this.ca&=-5);a&16?Mf(this):Kf(this);a&64?Nf(this):Lf(this);a&128?(this.resultType&=-17,this.ca|=128):(this.resultType&=-17,this.ca&=-129);this.A-=this.B.fc},function(){this.G=this.G&-65281|(Cd(this)&213)<<8;this.A-=
this.B.fc},function(){var a=this.G&-256,b;b=T(this);b=this.Qa(this.ka.mc(b,1));this.G=a|b;this.A-=this.B.Sh},function(){this.G=this.G&~this.R|yd(this,this.ka,T(this));this.A-=this.B.Sh},function(){var a=T(this),b=this.G;this.qc(this.ka.nc(a,1),b);this.A-=this.B.Th},function(){var a=T(this),b=this.G;this.rc(this.ka.nc(a,this.ba),b);this.A-=this.B.Th},function(){var a=1,b=0,c=this.Ba,d=this.B.Uh;this.Ia&192&&(a=this.I&c,b=1,d=this.B.Wh,this.Ia&256||(this.A-=this.B.Vh));if(a--){var e=this.Qa(this.ka.mc(this.K&
c,1));this.qc(this.Xa.nc(this.J&c,1),e);e=this.ca&1024?-1:1;this.K=this.K&~c|this.K+e&c;this.J=this.J&~c|this.J+e&c;this.A-=d;this.I=this.I&~c|this.I-b&c;a&&(vf(this),this.S|=256)}},function(){var a=1,b=0,c=this.Ba,d=this.B.Uh;this.Ia&192&&(a=this.I&c,b=1,d=this.B.Wh,this.Ia&256||(this.A-=this.B.Vh));if(a--){var e=yd(this,this.ka,this.K&c);this.rc(this.Xa.nc(this.J&c,this.ba),e);e=this.ca&1024?-this.ba:this.ba;this.K=this.K&~c|this.K+e&c;this.J=this.J&~c|this.J+e&c;this.A-=d;this.I=this.I&~c|this.I-
b&c;a&&(vf(this),this.S|=256)}},function(){var a=1,b=0,c=this.Ba,d=this.B.Fh;this.Ia&192&&(a=this.I&c,b=1,d=this.B.Hh,this.Ia&256||(this.A-=this.B.Gh));if(a--){var e=Rf(this,this.ka,this.K),f=Rf(this,this.Xa,this.J);this.C=this.D;Ph.call(this,e,f);e=this.ca&1024?-1:1;this.K=this.K&~c|this.K+e&c;this.J=this.J&~c|this.J+e&c;this.I=this.I&~c|this.I-b&c;this.A-=d-this.B.Vb;a&&Af(this)==(this.Ia&64)&&(vf(this),this.S|=256)}},function(){var a=1,b=0,c=this.Ba,d=this.B.Fh;this.Ia&192&&(a=this.I&c,b=1,d=this.B.Hh,
this.Ia&256||(this.A-=this.B.Gh));if(a--){var e=Tf(this,this.ka,this.K&c),f=Tf(this,this.Xa,this.J&c);this.C=this.D;Qh.call(this,e,f);e=this.ca&1024?-this.ba:this.ba;this.K=this.K&~c|this.K+e&c;this.J=this.J&~c|this.J+e&c;this.I=this.I&~c|this.I-b&c;this.A-=d-this.B.Vb;a&&Af(this)==(this.Ia&64)&&(vf(this),this.S|=256)}},function(){Df(this,this.G&this.xa(),128);this.A-=this.B.Je},function(){Df(this,this.G&this.Ma(),this.Ga);this.A-=this.B.Je},function(){var a=1,b=0,c=this.Ba,d=this.B.ei;this.Ia&192&&
(a=this.I&c,b=1,d=this.B.gi,this.Ia&256||(this.A-=this.B.fi));if(a--){var e=this.G;this.qc(this.Xa.nc(this.J&c,1),e);this.I=this.I&~c|this.I-b&c;80546<=this.Uc&&80564>=this.Uc&&!(this.Ia&2048)!=(103!=this.Qa(this.Ha))&&(c^=-65536);this.J=this.J&~c|this.J+(this.ca&1024?-1:1)&c;this.A-=d;a&&(vf(this),this.S|=256)}},function(){var a=1,b=0,c=this.Ba,d=this.B.ei;this.Ia&192&&(a=this.I&c,b=1,d=this.B.gi,this.Ia&256||(this.A-=this.B.fi));if(a--){var e=this.G;this.rc(this.Xa.nc(this.J&c,this.ba),e);this.J=
this.J&~c|this.J+(this.ca&1024?-this.ba:this.ba)&c;this.I=this.I&~c|this.I-b&c;this.A-=d;a&&(vf(this),this.S|=256)}},function(){var a=1,b=0,c=this.Ba,d=this.B.Mh;this.Ia&192&&(a=this.I&c,b=1,d=this.B.Oh,this.Ia&256||(this.A-=this.B.Nh));if(a--){var e=this.Qa(this.ka.mc(this.K&c,1));this.G=this.G&-256|e;this.K=this.K&~c|this.K+(this.ca&1024?-1:1)&c;this.I=this.I&~c|this.I-b&c;this.A-=d;a&&(vf(this),this.S|=256)}},function(){var a=1,b=0,c=this.Ba,d=this.B.Mh;this.Ia&192&&(a=this.I&c,b=1,d=this.B.Oh,
this.Ia&256||(this.A-=this.B.Nh));if(a--){var e=yd(this,this.ka,this.K&c);this.G=this.G&~this.R|e;this.K=this.K&~c|this.K+(this.ca&1024?-this.ba:this.ba)&c;this.I=this.I&~c|this.I-b&c;this.A-=d;a&&(vf(this),this.S|=256)}},function(){var a=1,b=0,c=this.Ba,d=this.B.Zh;this.Ia&192&&(a=this.I&c,b=1,d=this.B.ai,this.Ia&256||(this.A-=this.B.$h));if(a--){var e=this.G&255,f=Rf(this,this.Xa,this.J);this.C=this.D;Ph.call(this,e,f);this.J=this.J&~c|this.J+(this.ca&1024?-1:1)&c;this.I=this.I&~c|this.I-b&c;this.A-=
d-this.B.Vb;a&&Af(this)==(this.Ia&64)&&(vf(this),this.S|=256)}},function(){var a=1,b=0,c=this.Ba,d=this.B.Zh;this.Ia&192&&(a=this.I&c,b=1,d=this.B.ai,this.Ia&256||(this.A-=this.B.$h));if(a--){var e=this.G&this.R,f=Tf(this,this.Xa,this.J&c);this.C=this.D;Qh.call(this,e,f);this.J=this.J&~c|this.J+(this.ca&1024?-this.ba:this.ba)&c;this.I=this.I&~c|this.I-b&c;this.A-=d-this.B.Vb;a&&Af(this)==(this.Ia&64)&&(vf(this),this.S|=256)}},function(){this.G=this.G&-256|this.xa();this.A-=this.B.fc},function(){this.I=
this.I&-256|this.xa();this.A-=this.B.fc},function(){this.M=this.M&-256|this.xa();this.A-=this.B.fc},function(){this.H=this.H&-256|this.xa();this.A-=this.B.fc},function(){this.G=this.G&-65281|this.xa()<<8;this.A-=this.B.fc},function(){this.I=this.I&-65281|this.xa()<<8;this.A-=this.B.fc},function(){this.M=this.M&-65281|this.xa()<<8;this.A-=this.B.fc},function(){this.H=this.H&-65281|this.xa()<<8;this.A-=this.B.fc},function(){this.G=this.G&~this.R|this.Ma();this.A-=this.B.fc},function(){this.I=this.I&
~this.R|this.Ma();this.A-=this.B.fc},function(){this.M=this.M&~this.R|this.Ma();this.A-=this.B.fc},function(){this.H=this.H&~this.R|this.Ma();this.A-=this.B.fc},function(){I(this,J(this)&~this.R|this.Ma());this.A-=this.B.fc},function(){this.P=this.P&~this.R|this.Ma();this.A-=this.B.fc},function(){this.K=this.K&~this.R|this.Ma();this.A-=this.B.fc},function(){this.J=this.J&~this.R|this.Ma();this.A-=this.B.fc},gk,hk,gk,hk,function(){this.V.call(this,bi)},function(){this.V.call(this,$h)},function(){this.S|=
1;this.Jb.call(this,ok,this.xa)},function(){this.S|=1;this.ya.call(this,ok,this.Ma)},ik,jk,ik,jk,function(){if(this.ca&131072&&3>this.Pa)E.call(this,13,0);else{var a=this.B.dk;this.qb=-1;Cj.call(this,3,null,a)}},function(){var a=this.xa();if(this.ca&131072&&3>this.Pa)E.call(this,13,0);else{var b;a:{b=this.Hd[a];if(void 0!==b)for(var c=0;c<b.length;c++)if(!b[c](this.Ha)){b=!1;break a}this.la.nj&&z(this,16)&&pk(this.ha,a,this.Ha);b=!0}b?(this.qb=-1,Cj.call(this,a,null,0)):this.A--}},function(){if(Cf(this))if(this.ca&
131072&&3>this.Pa)E.call(this,13,0);else{var a=this.B.ek;this.qb=-1;Cj.call(this,4,null,a)}else this.A-=this.B.fk},function(){if(this.ca&131072&&3>this.Pa)E.call(this,13,0);else{this.sb=this.ta.Z;this.U=this.fa;this.A-=this.B.bk;if(this.$a&1&&this.ca&16384){var a=this.na(this.Sa.Aa+0);vd(this.wa,a,!1)}else{var a=this.pa,b=H(this),c=H(this),d=H(this);if(this.ca&131072)d=d&131071|this.ca&-131072;else if(d&131072){var e=H(this),f=H(this),g=H(this),h=H(this),k=H(this),m=H(this);wd(this,!0,!0);ud(this,
f);I(this,e);Bd(this,g);Ad(this,h);this.Nb.load(k);this.Ob.load(m)}null!=Ed(this,b,c,!1)&&(Dd(this,d,a),this.le&&nf(this,this.Ha))}this.sb=this.U=-1}},function(){this.Jb.call(this,dk,wj)},function(){this.ya.call(this,2==this.ba?ek:fk,wj)},function(){this.Jb.call(this,dk,xj)},function(){this.ya.call(this,2==this.ba?ek:fk,xj)},function(){var a=this.xa();if(a){var b=this.G&255;this.G=this.G&-65536|b/a<<8|b%a;Df(this,this.G,128);this.A-=this.B.Hj}else Fj.call(this)},function(){var a=this.G&255,b=(this.G>>
8&255)*this.xa()|0,c=a+b|0;this.G=this.G&-65536|c&255;wf(this,a,b,c,191);this.A-=this.B.Gj},function(){this.G=this.G&-256|(xf(this)?255:0);this.A-=2},function(){this.G=this.G&-256|Rf(this,this.ka,this.H+(this.G&255));this.A-=this.B.Gk},function(){kk.call(this,216)},function(){kk.call(this,217)},function(){kk.call(this,218)},function(){kk.call(this,219)},function(){kk.call(this,220)},function(){kk.call(this,221)},function(){kk.call(this,222)},function(){kk.call(this,223)},function(){var a=this.T(),
b=this.I-1&this.Ba;this.I=this.I&~this.Ba|b;b&&!Af(this)?(O(this,M(this)+a),this.A-=this.B.mk):this.A-=this.B.Ph},function(){var a=this.T(),b=this.I-1&this.Ba;this.I=this.I&~this.Ba|b;b&&Af(this)?(O(this,M(this)+a),this.A-=this.B.Qh):this.A-=this.B.Rh},function(){var a=this.T(),b=this.I-1&this.Ba;this.I=this.I&~this.Ba|b;b?(O(this,M(this)+a),this.A-=this.B.lk):this.A-=this.B.Ph},function(){var a=this.T();this.I&this.Ba?this.A-=this.B.Rh:(O(this,M(this)+a),this.A-=this.B.Qh)},function(){var a=this.xa();
Pf(this,a,1,!0)&&(this.G=this.G&-256|rc(this.ga,a,1,this.Ha-2)&255,this.A-=this.B.Kh)},function(){var a=this.xa();Pf(this,a,this.ba,!0)&&(this.G=this.G&~this.R|rc(this.ga,a,this.ba,this.Ha-2)&this.R,this.A-=this.B.Kh)},function(){var a=this.xa();Pf(this,a,1,!1)&&(zc(this.ga,a,1,this.G&255,this.Ha-2),this.A-=this.B.Yh)},function(){var a=this.xa();Pf(this,a,this.ba,!1)&&(zc(this.ga,a,this.ba,this.G&this.R,this.Ha-2),this.A-=this.B.Yh)},function(){var a=this.Ma(),b=M(this),a=b+a;K(this,b);O(this,a);
this.A-=this.B.Lj},function(){var a=this.Ma();O(this,M(this)+a);this.A-=this.B.Lh},function(){Ed(this,this.Ma(),Zf(this));this.A-=this.B.hk},function(){var a=this.T();O(this,M(this)+a);this.A-=this.B.Lh},function(){var a=this.M&65535;Pf(this,a,1,!0)&&(this.G=this.G&-256|rc(this.ga,a,1,this.Ha-1)&255,this.A-=this.B.Jh)},function(){var a=this.M&65535;Pf(this,a,this.ba,!0)&&(this.G=this.G&~this.R|rc(this.ga,a,this.ba,this.Ha-1)&this.R,this.A-=this.B.Jh)},function(){var a=this.M&65535;Pf(this,a,1,!1)&&
(zc(this.ga,a,1,this.G&255,this.Ha-1),this.A-=this.B.Xh)},function(){var a=this.M&65535;Pf(this,a,2,!1)&&(zc(this.ga,a,this.ba,this.G&this.R,this.Ha-1),this.A-=this.B.Xh)},lk,lk,function(){this.S|=132;this.A-=this.B.nd},function(){this.S|=68;this.A-=this.B.nd},function(){this.ca&131072?E.call(this,13,0):(this.ua|=4,this.A-=2,this.ha&&z(this,-2147483648)?(vf(this),this.ha.Wb()):this.ca&512||(this.ha&&vf(this),this.Wb()))},function(){xf(this)?Ff(this):Ef(this);this.A-=2},function(){this.cb=!1;this.Jb.call(this,
qk,zj);this.cb&&(this.G=this.G&~this.R|this.ia&this.R)},function(){this.cb=!1;this.ya.call(this,rk,zj);this.cb&&(this.G=this.G&~this.R|this.ia&this.R,this.M=this.M&~this.R|this.va&this.R)},function(){Ff(this);this.A-=2},function(){Ef(this);this.A-=2},function(){this.pa>this.Pa?E.call(this,13,0):(this.ca&=-513,this.A-=this.B.Jj)},function(){this.pa>this.Pa?E.call(this,13,0):(this.ca|=512,this.S|=4,this.A-=2)},function(){this.ca&=-1025;this.A-=2},function(){this.ca|=1024;this.A-=2},function(){this.Jb.call(this,
Id,zj)},function(){this.ya.call(this,Jd,zj)}],Yj=[zh,Ci,xh,Ei,Bh,gj,oj,Ph],mk=[Ah,Di,yh,Fi,Ch,hj,pj,Qh],nk=[function(a,b){this.A-=-1===this.C?this.B.zc:this.B.yk;return b},Sh,Sh,Sh,Sh,Sh,Sh,Sh],ok=[function(a,b){this.A-=-1===this.C?this.B.qk:this.B.nk;return b},W,W,W,W,W,W,W],dk=[function(a,b){var c=a;if(b&=this.ra){var d;(b&=7)?(d=a<<b-1,c=(a<<b|a>>8-b)&255):d=a<<7;If(this,c,d,128)}return c},function(a,b){var c=a;if(b&=this.ra){var d;(b&=7)?(d=a<<8-b,c=(a>>>b|d)&255):d=a;If(this,c,d,128)}return c},
function(a,b){var c=a;if(b&=this.ra){var d=Jf(this);(b%=9)?(c=(a<<b|d<<b-1|a>>9-b)&255,d=a<<b-1):d<<=7;If(this,c,d,128)}return c},function(a,b){var c=a;if(b&=this.ra){var d=Jf(this);(b%=9)?(c=(a>>b|d<<8-b|a<<9-b)&255,d=a<<8-b):d<<=7;If(this,c,d,128)}return c},function(a,b){var c=a;if(b&=this.ra){var d=0;8<b?c=0:(d=a<<b-1,c=d<<1&255);Df(this,c,128,d&128,(c^d)&128)}return c},function(a,b){if(b&=this.ra)b=8<b?0:a>>>b-1,a=b>>>1&255,Df(this,a,128,b&1,a&128);return a},W,function(a,b){if(b&=this.ra)9<b&&
(b=9),b=a<<24>>24>>b-1,a=b>>1&255,Df(this,a,128,b&1);return a}],ek=[function(a,b){var c=a;if(b&=this.ra){var d;(b&=15)?(d=a<<b-1,c=(a<<b|a>>16-b)&65535):d=a<<15;If(this,c,d,32768)}return c},function(a,b){var c=a;if(b&=this.ra){var d;(b&=15)?(d=a<<16-b,c=(a>>>b|d)&65535):d=a;If(this,c,d,32768)}return c},function(a,b){var c=a;if(b&=this.ra){var d=Jf(this);(b%=17)?(c=(a<<b|d<<b-1|a>>17-b)&65535,d=a<<b-1):d<<=15;If(this,c,d,32768)}return c},function(a,b){var c=a;if(b&=this.ra){var d=Jf(this);(b%=17)?
(c=(a>>b|d<<16-b|a<<17-b)&65535,d=a<<16-b):d<<=15;If(this,c,d,32768)}return c},function(a,b){var c=a;if(b&=this.ra){var d=0;16<b?c=0:(d=a<<b-1,c=d<<1&65535);Df(this,c,32768,d&32768,(c^d)&32768)}return c},function(a,b){if(b&=this.ra)b=16<b?0:a>>>b-1,a=b>>>1&65535,Df(this,a,32768,b&1,a&32768);return a},W,function(a,b){if(b&=this.ra)17<b&&(b=17),b=a<<16>>16>>b-1,a=b>>1&65535,Df(this,a,32768,b&1);return a}],fk=[function(a,b){var c=a;if(b&=this.ra)c=a<<b|a>>>32-b,If(this,c,a<<b-1,-2147483648);return c},
function(a,b){var c=a;if(b&=this.ra){var d=a<<32-b,c=a>>>b|d;If(this,c,d,-2147483648)}return c},function(a,b){var c=a;if(b&=this.ra)c=Jf(this),c=a<<b|c<<b-1|a>>>32-b>>>1,If(this,c,a<<b-1,-2147483648);return c},function(a,b){var c=a;if(b&=this.ra)c=Jf(this),c=a>>>b|c<<32-b|a<<32-b<<1,If(this,c,a<<32-b,-2147483648);return c},function(a,b){var c=a;if(b&=this.ra)a<<=b-1,c=a<<1,Df(this,c,-2147483648,a&-2147483648,(c^a)&-2147483648);return c},function(a,b){if(b&=this.ra)b=a>>>b-1,a=b>>>1,Df(this,a,-2147483648,
b&1,a&-2147483648);return a},W,function(a,b){if(b&=this.ra)b=a>>b-1,a=b>>1,Df(this,a,-2147483648,b&1);return a}],qk=[function(a,b){b=this.xa();Df(this,a&b,128);this.A-=-1===this.D?this.B.ii:this.B.hi;this.S|=2;return a},W,function(a){this.A-=-1===this.D?this.B.Vf:this.B.Uf;return a^255},function(a){var b=-a|0;wf(this,0,a,b,191,!0);this.A-=-1===this.D?this.B.Vf:this.B.Uf;return b&255},function(a){this.ia=(this.G&255)*a&65535;this.ia&65280?(Ef(this),Gf(this)):(Ff(this),Hf(this));this.cb=!0;this.A-=
-1===this.D?this.B.uk:this.B.tk;this.S|=2;return a},function(a){var b=(this.G<<24>>24)*(a<<24>>24)|0;this.ia=b&65535;127<b||-128>b?(Ef(this),Gf(this)):(Ff(this),Hf(this));this.cb=!0;this.A-=-1===this.D?this.B.Zj:this.B.Yj;this.S|=2;return a},function(a,b){if(!a)return Fj.call(this),a;var c=(b=this.G&65535)/a;if(255<c)return Fj.call(this),a;this.ia=c&255|(b%a&255)<<8;this.cb=!0;this.A-=-1===this.D?this.B.Rj:this.B.Qj;this.S|=2;return a},function(a,b){if(!a)return Fj.call(this),a;var c=a<<24>>24,d=
(b=this.G<<16>>16)/c|0;if(d!=d<<24>>24||8086==this.ja&&-128==d)return Fj.call(this),a;this.ia=d&255|(b%c&255)<<8;this.cb=!0;this.A-=-1===this.D?this.B.Vj:this.B.Uj;this.S|=2;return a}],rk=[function(a,b){b=this.Ma();Df(this,a&b,this.Ga);this.A-=-1===this.D?this.B.ii:this.B.hi;this.S|=2;return a},W,function(a){this.A-=-1===this.D?this.B.Vf:this.B.Uf;return a^this.R},function(a){var b=-a|0;wf(this,0,a,b,this.Ga|63,!0);this.A-=-1===this.D?this.B.Vf:this.B.Uf;return b&this.R},function(a,b){2==this.ba?
(b=this.G&65535,b=b*a|0,this.ia=b&65535,this.va=b>>16&65535):(Yh.call(this,a,this.G),80563==this.Uc&&68657152==this.G&&129==a&&(this.va=0));this.va?(Ef(this),Gf(this)):(Ff(this),Hf(this));this.cb=!0;this.A-=-1===this.D?this.B.wk:this.B.vk;this.S|=2;return a},function(a,b){2==this.ba?(b=this.G&65535,b=(b<<16>>16)*(a<<16>>16)|0,this.ia=b&65535,this.va=b>>16&65535,b=32767<b||-32768>b):(Xh.call(this,a,this.G),b=this.va!=this.ia>>31);b?(Ef(this),Gf(this)):(Ff(this),Hf(this));this.cb=!0;this.A-=-1===this.D?
this.B.ak:this.B.$j;this.S|=2;return a},function(a,b){if(2==this.ba){if(!a)return Fj.call(this),a;b=65536*(this.M&65535)+(this.G&65535);var c=b/a;if(65536<=c)return Fj.call(this),a;this.ia=c&65535;this.va=b%a&65535}else{if(!sj.call(this,this.G,this.M,a))return Fj.call(this),a;this.ia|=0;this.va|=0}this.cb=!0;this.A-=-1===this.D?this.B.Tj:this.B.Sj;this.S|=2;return a},function(a,b){if(2==this.ba){if(!a)return Fj.call(this),a;var c=a<<16>>16,d=(b=this.M<<16|this.G&65535)/c|0;if(d!=d<<16>>16||8086==
this.ja&&-32768==d)return Fj.call(this),a;this.ia=d&65535;this.va=b%c&65535}else{b=this.G;var c=this.M,d=a,e=0,f=0;0>d&&(d=-d|0,e=1-e);0>c&&(b=-b|0,c=~c+(b?0:1)|0,f=1,e=1-e);!sj.call(this,b,c,d)||this.ia>2147483647+e||this.va>2147483647+f?b=!1:(e&&(this.ia=-this.ia),f&&(this.va=-this.va),b=!0);if(!b)return Fj.call(this),a;this.ia|=0;this.va|=0}this.cb=!0;this.A-=-1===this.D?this.B.Xj:this.B.Wj;this.S|=2;return a}],Id=[function(a){var b=a+1|0;wf(this,a,1,b,190);this.A-=-1===this.D?this.B.Tf:this.B.Sf;
return b&255},function(a){var b=a-1|0;wf(this,a,1,b,190,!0);this.A-=-1===this.D?this.B.Tf:this.B.Sf;return b&255},W,W,W,W,W,W],Jd=[function(a){var b=a+1|0;wf(this,a,1,b,this.Ga|62);this.A-=-1===this.D?this.B.Tf:this.B.Sf;return b&this.R},function(a){var b=a-1|0;wf(this,a,1,b,this.Ga|62,!0);this.A-=-1===this.D?this.B.Tf:this.B.Sf;return b&this.R},function(a){K(this,M(this));O(this,a);this.A-=-1===this.D?this.B.Pj:this.B.Oj;this.S|=2;return a},function(a){if(-1===this.D)return W.call(this,a);this.U=
this.fa;Bj.call(this,a,this.na(this.D+this.ba));this.A-=this.B.Mj;this.S|=2;this.U=-1;return a},function(a){O(this,a);this.A-=-1===this.D?this.B.jk:this.B.ik;this.S|=2;return a},function(a){if(-1===this.D)return W.call(this,a);Ed(this,a,this.na(this.D+this.ba));this.A-=this.B.gk;this.S|=2;return a},function(a){var b=a;this.S&512&&(a=a-2&65535,80286>this.ja&&(b=a));K(this,b);this.A-=-1===this.D?this.B.Rc:this.B.Ak;this.S|=2;return a},W];function te(){this.V.call(this,lj);this.A-=-1===this.D?6:13}
function ue(){this.ea.call(this,kj);this.A-=-1===this.D?12:19}var le=Array(256);le[0]=function(){16>(this.Qa(this.Ha)&56)&&(this.S|=1);this.ya.call(this,this.lg,zj)};le[1]=function(){this.Qa(this.Ha)&16||(this.S|=1);this.ya.call(this,sk,zj)};le[2]=function(){!(this.$a&1)||this.ca&131072?E.call(this,6):this.V.call(this,Zh)};le[3]=function(){!(this.$a&1)||this.ca&131072?E.call(this,6):this.V.call(this,ei)};
le[5]=function(){this.pa?E.call(this,13,0,0,!0):(Of(this,this.na(2054)),this.J=this.na(2086),this.K=this.na(2088),this.P=this.na(2090),this.H=this.na(2094),this.M=this.na(2096),this.I=this.na(2098),this.G=this.na(2100),td(this.Xa,2102,this.na(2084)),td(this.wa,2108,this.na(2082)),td(this.ta,2114,this.na(2080)),td(this.vb,2120,this.na(2078)),Dd(this,this.na(2072)),O(this,this.na(2074)),I(this,this.na(2092)),this.Ec=this.na(2126)|this.Qa(2128)<<16,this.zd=this.Ec+this.na(2130),this.Mc=this.na(2138)|
this.Qa(2140)<<16,this.Sd=this.Mc+this.na(2142),td(this.Bc,2132,this.na(2076)),td(this.Sa,2144,this.na(2070)),this.A-=195)};le[6]=function(){this.pa?E.call(this,13,0):(this.$a&=-9,this.A-=2)};le[11]=Ld;le[166]=Ld;le[255]=Ld;var N=[];N[5]=Ld;
N[7]=function(){if(this.pa)E.call(this,13,0,0,!0);else{var a=this.Xa.mc(this.J&this.Ba,204);if(-1!==a){uj.call(this,this.oa(a));var b=this.oa(a+168),c=(b&24576)>>13;Dd(this,this.oa(a+4),c);this.Ec=this.oa(a+112);this.zd=this.Ec+this.oa(a+116);this.Mc=this.oa(a+100);this.Sd=this.Mc+this.oa(a+104);sd(this.Bc,this.oa(a+56),this.oa(a+120),this.oa(a+124),this.oa(a+128));sd(this.Sa,this.oa(a+52),this.oa(a+84),this.oa(a+88),this.oa(a+92));this.J=this.oa(a+12);this.K=this.oa(a+16);this.P=this.oa(a+20);this.H=
this.oa(a+28);this.M=this.oa(a+32);this.I=this.oa(a+36);this.G=this.oa(a+40);sd(this.Ob,this.oa(a+60),this.oa(a+132),this.oa(a+136),this.oa(a+140));sd(this.Nb,this.oa(a+64),this.oa(a+144),this.oa(a+148),this.oa(a+152));sd(this.vb,this.oa(a+68),this.oa(a+156),this.oa(a+160),this.oa(a+164));sd(this.ta,this.oa(a+72),b,this.oa(a+172),this.oa(a+176));sd(this.wa,this.oa(a+76),this.oa(a+180),this.oa(a+184),this.oa(a+188));sd(this.Xa,this.oa(a+80),this.oa(a+192),this.oa(a+196),this.oa(a+200));O(this,this.oa(a+
8));I(this,this.oa(a+24))}this.A-=122<<(a&3?1:0)}};N[16]=Zj;N[17]=ak;N[18]=bk;N[19]=ck;N[32]=function(){if(this.pa)E.call(this,13,0);else{var a,b=this.xa();switch((b&56)>>3){case 0:a=this.$a;break;case 2:a=this.se;break;case 3:a=this.Od;break;default:me.call(this);return}Be(this,b&7,a);this.A-=6}};N[33]=function(){if(this.pa)E.call(this,13,0);else{var a=this.xa(),b=(a&56)>>3;4==b||5==b?me.call(this):(Be(this,a&7,this.Ja[b]),this.A-=22)}};
N[34]=function(){if(this.pa)E.call(this,13,0);else{var a=this.xa(),b=Ae(this,a&7);switch((a&56)>>3){case 0:uj.call(this,b);this.A-=10;break;case 2:this.se=b;this.A-=4;break;case 3:Fd.call(this,b);this.A-=5;break;default:me.call(this)}}};N[35]=function(){if(this.pa)E.call(this,13,0);else{var a=this.xa(),b=(a&56)>>3;4==b||5==b?me.call(this):(a=Ae(this,a&7),a!=this.Ja[b]&&(of(this,!1),this.Ja[b]=a,of(this,!0)),this.A-=4>b?22:14)}};
N[36]=function(){if(this.pa)E.call(this,13,0);else{var a=this.xa(),b=(a&56)>>3;6>b?me.call(this):(Be(this,a&7,this.Ee[b]),this.A-=12)}};N[38]=function(){if(this.pa)E.call(this,13,0);else{var a=this.xa(),b=(a&56)>>3;6>b?me.call(this):(this.Ee[b]=Ae(this,a&7),this.A-=12)}};N[128]=function(){var a=this.Ma();Cf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb};N[129]=function(){var a=this.Ma();Cf(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)};
N[130]=function(){var a=this.Ma();xf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb};N[131]=function(){var a=this.Ma();xf(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)};N[132]=function(){var a=this.Ma();Af(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb};N[133]=function(){var a=this.Ma();Af(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)};N[134]=function(){var a=this.Ma();xf(this)||Af(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb};
N[135]=function(){var a=this.Ma();xf(this)||Af(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)};N[136]=function(){var a=this.Ma();Bf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb};N[137]=function(){var a=this.Ma();Bf(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)};N[138]=function(){var a=this.Ma();yf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb};N[139]=function(){var a=this.Ma();yf(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)};
N[140]=function(){var a=this.Ma();!Bf(this)!=!Cf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb};N[141]=function(){var a=this.Ma();!Bf(this)==!Cf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb};N[142]=function(){var a=this.Ma();Af(this)||!Bf(this)!=!Cf(this)?(O(this,M(this)+a),this.A-=this.B.ab):this.A-=this.B.bb};N[143]=function(){var a=this.Ma();Af(this)||!Bf(this)!=!Cf(this)?this.A-=this.B.bb:(O(this,M(this)+a),this.A-=this.B.ab)};N[144]=function(){vj.call(this,Gi)};
N[145]=function(){vj.call(this,Gi)};N[146]=function(){vj.call(this,Hi)};N[147]=function(){vj.call(this,Ii)};N[148]=function(){vj.call(this,Ji)};N[149]=function(){vj.call(this,Ki)};N[150]=function(){vj.call(this,Li)};N[151]=function(){vj.call(this,Mi)};N[152]=function(){vj.call(this,Ni)};N[153]=function(){vj.call(this,Oi)};N[154]=function(){vj.call(this,Pi)};N[155]=function(){vj.call(this,Qi)};N[156]=function(){vj.call(this,Ri)};N[157]=function(){vj.call(this,Si)};N[158]=function(){vj.call(this,Ti)};
N[159]=function(){vj.call(this,Ui)};N[160]=function(){zd(this,this.Nb.Z,this.ba,2);this.A-=this.B.Ke};N[161]=function(){this.U=this.fa;var a=H(this);this.Nb.load(a);this.A-=this.B.zc;this.U=-1};N[163]=function(){this.ea.call(this,Lh);-1!==this.D&&(this.A-=6)};N[164]=function(){this.ea.call(this,2==this.ba?Vi:Xi);this.A-=-1===this.D?3:7};N[165]=function(){this.ea.call(this,2==this.ba?Zi:$i);this.A-=-1===this.D?3:7};N[168]=function(){zd(this,this.Ob.Z,this.ba,2);this.A-=this.B.Ke};
N[169]=function(){this.U=this.fa;var a=H(this);this.Ob.load(a);this.A-=this.B.zc;this.U=-1};N[171]=function(){this.ea.call(this,Oh);-1!==this.D&&(this.A-=5)};N[172]=function(){this.ea.call(this,2==this.ba?aj:cj);this.A-=-1===this.D?3:7};N[173]=function(){this.ea.call(this,2==this.ba?ej:fj);this.A-=-1===this.D?3:7};N[175]=function(){this.V.call(this,2==this.ba?Uh:Wh)};N[178]=function(){this.V.call(this,fi)};N[179]=function(){this.ea.call(this,Nh);-1!==this.D&&(this.A-=5)};
N[180]=function(){this.V.call(this,ci)};N[181]=function(){this.V.call(this,di)};
N[182]=function(){this.Oa.call(this,yi);switch(this.L>>3&7){case 0:this.G=this.G&~this.R|this.G&255;break;case 1:this.I=this.I&~this.R|this.I&255;break;case 2:this.M=this.M&~this.R|this.M&255;break;case 3:this.H=this.H&~this.R|this.H&255;break;case 4:this.gb=this.gb&~this.R|this.G>>8&255;this.G=this.aa;break;case 5:this.P=this.P&~this.R|this.I>>8&255;this.I=this.aa;break;case 6:this.K=this.K&~this.R|this.M>>8&255;this.M=this.aa;break;case 7:this.J=this.J&~this.R|this.H>>8&255,this.H=this.aa}this.A-=
-1===this.D?3:6};N[183]=function(){xd(this,2);this.V.call(this,zi);switch(this.L>>3&7){case 0:this.G=this.G&65535;break;case 1:this.I=this.I&65535;break;case 2:this.M=this.M&65535;break;case 3:this.H=this.H&65535;break;case 4:this.gb=this.gb&65535;break;case 5:this.P=this.P&65535;break;case 6:this.K=this.K&65535;break;case 7:this.J=this.J&65535}this.A-=-1===this.D?3:6};N[186]=function(){this.ya.call(this,tk,this.xa)};N[187]=function(){this.ea.call(this,Mh);-1!==this.D&&(this.A-=5)};
N[188]=function(){this.V.call(this,Fh)};N[189]=function(){this.V.call(this,Gh)};
N[190]=function(){this.Oa.call(this,yi);switch(this.L>>3&7){case 0:this.G=this.G&~this.R|(this.G&255)<<24>>24&this.R;break;case 1:this.I=this.I&~this.R|(this.I&255)<<24>>24&this.R;break;case 2:this.M=this.M&~this.R|(this.M&255)<<24>>24&this.R;break;case 3:this.H=this.H&~this.R|(this.H&255)<<24>>24&this.R;break;case 4:this.gb=this.gb&~this.R|this.G<<16>>24&this.R;this.G=this.aa;break;case 5:this.P=this.P&~this.R|this.I<<16>>24&this.R;this.I=this.aa;break;case 6:this.K=this.K&~this.R|this.M<<16>>24&
this.R;this.M=this.aa;break;case 7:this.J=this.J&~this.R|this.H<<16>>24&this.R,this.H=this.aa}this.A-=-1===this.D?3:6};N[191]=function(){xd(this,2);this.V.call(this,zi);switch(this.L>>3&7){case 0:this.G=this.G<<16>>16;break;case 1:this.I=this.I<<16>>16;break;case 2:this.M=this.M<<16>>16;break;case 3:this.H=this.H<<16>>16;break;case 4:this.gb=this.gb<<16>>16;break;case 5:this.P=this.P<<16>>16;break;case 6:this.K=this.K<<16>>16;break;case 7:this.J=this.J<<16>>16}this.A-=-1===this.D?3:6};
var pf=[function(){this.A-=2+(-1===this.D?0:1);return this.Bc.Z},function(){this.A-=2+(-1===this.D?0:1);return this.Sa.Z},function(a){this.S|=2;this.Bc.load(a);this.A-=17+(-1===this.D?0:2);return a},function(a){this.S|=2;-1!==this.Sa.load(a)&&(this.jb(this.Sa.Xb+4,this.Sa.wb|=512),this.Sa.type|=512);this.A-=17+(-1===this.D?0:2);return a},function(a){this.S|=2;this.A-=14+(-1===this.D?0:2);if(-1!==this.Da.load(a)&&2048!=(this.Da.wb&2560)&&(this.Da.Gc>=this.pa&&this.Da.Gc>=(a&3)||7168==(this.Da.wb&7168)))return Nf(this),
a;Lf(this);return a},function(a){this.S|=2;this.A-=14+(-1===this.D?0:2);if(-1!==this.Da.load(a)&&512==(this.Da.wb&2560)&&this.Da.Gc>=this.pa&&this.Da.Gc>=(a&3))return Nf(this),a;Lf(this);return a},W,W],Kd=[je,je,je,je,je,je,W,W],sk=[function(a){if(-1===this.D)E.call(this,6);else{a=this.zd-this.Ec;var b=this.Ec;80286==this.ja?b|=-16777216:80386<=this.ja&&2!=this.ba&&(a|=b<<16);this.nb(this.D+2,b);this.A-=11}return a},function(a){if(-1===this.D)E.call(this,6);else{a=this.Sd-this.Mc;var b=this.Mc;80286==
this.ja?b|=-16777216:80386<=this.ja&&2!=this.ba&&(a|=b<<16);this.nb(this.D+2,b);this.A-=12}return a},function(a){-1===this.D||this.ca&131072?E.call(this,6):(this.Ec=this.oa(this.D+2)&(this.R|this.R<<8),a&=65535,this.zd=this.Ec+a,this.S|=2,this.A-=11);return a},function(a){-1===this.D||this.ca&131072?E.call(this,6):(this.Mc=this.oa(this.D+2)&(this.R|this.R<<8),a&=65535,this.Sd=this.Mc+a,this.S|=2,this.A-=12);return a},function(){this.A-=2+(-1===this.D?0:1);return this.$a},W,function(a){this.ca&131072?
E.call(this,6):(Of(this,a),this.A-=-1===this.D?3:6,this.S|=2);return a},W],tk=[W,W,W,W,Hh,Kh,Jh,Ih];
function X(a){bb.call(this,"ChipSet",a,X,32768);var b=a.model;b&&!uk[b]&&w("Unrecognized ChipSet model: "+b);this.ja=uk[b]||vk;this.C=[];b=wk(a[xk]);this.C[0]=[b,b];null==b&&(this.ia=[360,360],(b=a.floppies)&&b.length&&(this.ia=b),yk(this,zk,this.ia.length),yk(this,Ak,a.monitor||(this.ja<kg?"mono":"ega")));b=wk(a[Bk]);this.C[1]=[b,b];this.cb=this.Da=1;this.ja>=kg&&(this.cb=this.Da=2);this.ka=a.scaleTimers||!1;this.Ub=a.rtcDate;this.Db=!1;a.sound&&(this.sb=this.Fa=null,window&&(this.sb=window.AudioContext||
window.webkitAudioContext),this.sb&&(this.Fa=new this.sb));this.reset(!0);xb(this)}jb(X);var vk=5150.9,kg=5170,uk={5150:5150,5160:5160,5170:kg,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:vk,deskpro386:5180},xk="sw1",Bk="sw2",Ck={jl:1,ONE:0,Io:64,Go:128,xo:192,Lc:192,Xg:6},Dk={Ho:16,to:32,yo:48,Lc:48,Xg:4},zk=1,Ak=4,Ek={5150:[{},{}]};Ek[5150][0][zk]={Lc:192,gd:{1:0,2:64,3:128,4:192},Pd:"Number of Floppy Drives"};Ek[5150][0][3]={Lc:2,gd:{0:0,1:2},Pd:"FPU"};
Ek[5150][0][Ak]={Lc:48,gd:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},Pd:"Monitor Type"};Ek[5150][0][5]={Lc:12,gd:{16:0,32:4,48:8,64:12},Pd:"Base Memory (16Kb Increments)"};Ek[5150][1][6]={Lc:31,gd:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},Pd:"Expansion Memory (32Kb Increments)"};Ek[5160]=[{},{}];Ek[5160][0][zk]=Ek[5150][0][zk];Ek[5160][0][3]=Ek[5150][0][3];Ek[5160][0][Ak]=Ek[5150][0][Ak];
Ek[5160][0][5]={Lc:12,gd:{64:0,128:4,192:8,256:12},Pd:"Base Memory (64Kb Increments)"};Ek[5160][1][6]=Ek[5150][1][6];Ek[5160.101]=[{},{}];Ek[5160.101][0][5]={Lc:143,gd:{128:1,256:130,512:8,640:141},Pd:"Base Memory (128Kb Increments)"};Ek[5160.101][0][3]={Lc:16,gd:{0:0,1:16},Pd:"FPU"};Ek[5160.101][1][2]={Lc:1,gd:{0:0,1:1},Pd:"Floppy Type"};Ek[5160.101][1][zk]=Ek[5150][0][zk];Ek[5160.101][1][Ak]=Ek[5150][0][Ak];l=X.prototype;
l.Pb=function(a,b,c){switch(b){case xk:return this.qa[b]=c,Fk(this,0,b),!0;case Bk:if(5150==(this.ja|0)||5160.101==this.ja)return this.qa[b]=c,Fk(this,1,b),!0;break;case "swdesc":return this.qa[b]=c,!0}return!1};
l.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.X=a;this.Tb=Jb(a,"FPU");yk(this,3,this.Tb?1:0,!0);this.B=Jb(a,"Keyboard");this.gb=c.Y.Id/1193181;qc(b,this,Gk);yc(b,this,Hk);this.ja<kg?5160.101!=this.ja?(qc(b,this,Ik),yc(b,this,Jk)):(qc(b,this,Kk),yc(b,this,Lk)):(qc(b,this,Mk),yc(b,this,Nk),5180==(this.ja|0)&&(qc(b,this,Ok),yc(b,this,Pk)));if(d){var e=this;Qk(d,1024,function(){for(var a=0;a<e.vc.length;a++){for(var b=e.vc[a],c="PIC"+a+":",d=0;d<b.Yc.length;d++)c+=" IC"+(d+1)+"="+u(b.Yc[d]);
c+=" IMR="+u(b.Ad)+" IRR="+u(b.lc)+" ISR="+u(b.Oc)+" DELAY="+b.nf;e.ha.O(c)}});Qk(d,2048,function(a){a=(a=a[0])?+a:null;for(var b=0;b<e.V.length;b++)if(null==a||b==a){Rk(e,b);var c=e.V[b],d="TIMER"+b+":",f=0;if(null!=c.md)for(var n=0;n<=c.md;n++)f|=c.Ab[n]<<8*n;d+=" mode="+(c.mode>>1)+" bytes="+c.md+" count="+v(f);e.ha.O(d)}});Qk(d,4096,function(){for(var a="",b=0;64>b;b++){var c=13>=b?Sk(e,b):e.A[b];a&&(a+="\n");a+="CMOS["+u(b)+"]: "+u(c)}e.ha.O(a)})}lf(c,26,this.Pm.bind(this))};
l.hc=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};l.gc=function(a){return a?this.save():!0};
l.reset=function(a){var b;Tk(this);this.L=Array(this.cb);for(b=0;b<this.cb;b++)Uk(this,b);this.vc=Array(this.Da);Vk(this,0,32);1<this.Da&&Vk(this,1,160);this.Pa=this.Oa=null;this.V=Array(5180==(this.ja|0)?6:3);for(b=0;b<this.V.length;b++)Wk(this,b);this.Ca=this.qb=this.W=this.Ya=null;this.ya=0;5160.101==this.ja&&(this.va=0);if(this.ja>=kg){this.N=16;this.ea=0;this.aa=16;this.Ja=0;this.fa=160;512<=Xk(this)&&(this.fa|=16);3==+Yk(this,Ak,void 0)&&(this.fa|=64);5180==(this.ja|0)&&(this.fa|=12);this.Ka=
3;this.ra=Array(8);this.pa=0;a&&(this.A=Array(64));Zk(this,this.Ub);for(a=21;24>=a;a++)this.A[a]=0;for(a=14;46>a;a++)void 0===this.A[a]&&(this.A[a]=0);a=0|+Yk(this,Ak,void 0)<<Dk.Xg&Dk.Lc;a|=+Yk(this,3,void 0)?2:0;b=+Yk(this,zk,void 0);a|=b?b-1<<Ck.Xg&Ck.Lc|Ck.jl:0;this.A[20]=a;this.A[16]=$k(this,0)<<4|$k(this,1);al(this)}};
function Zk(a,b){var c=b?new Date(b):new Date;"[object Date]"!==Object.prototype.toString.call(c)||isNaN(c.getTime())?(c=new Date,a.O("CMOS date invalid ("+b+"), using "+c)):b&&a.O("CMOS date: "+c);a.A[0]=c.getSeconds();a.A[1]=0;a.A[2]=c.getMinutes();a.A[3]=0;a.A[4]=c.getHours();a.A[5]=0;a.A[6]=c.getDay()+1;a.A[7]=c.getDate();a.A[8]=c.getMonth()+1;b=c.getFullYear();a.A[9]=b%100;b/=100;a.A[50]=b%10|b/10<<4;a.A[10]=38;a.A[11]=2;a.A[12]=0;a.A[13]=128;a.Ga=a.ua=0;a.Jb=a.fb=null}
function Sk(a,b){var c=a.A[b];if(10>b){var d=!1;4!=b&&5!=b||a.A[11]&2||(12>c?c=c?c:12:c=(c-=12)?c+128:140,d=!0);a.A[11]&4||(d&&128<c&&(c-=48),c=c%10|c/10<<4)}else 10==b&&(a.A[b]^=128);return c}function bl(a){var b;void 0===b&&(b=a.fb);a.ua=cd(a.F,a.ka)+b;a.A[11]&64&&ed(a.F,b)}function al(a){for(var b=0,c=16;46>c;c++)b+=a.A[c];a.A[47]=b&255;a.A[46]=b>>8}
l.save=function(){var a=new qf(this);a.set(0,[this.C]);for(var b=[],c=0;c<this.L;c++){for(var d=this.L[c],e=d,f=[],g=0;g<e.Dc.length;g++){var h=e.Dc[g];f[g]=[h.Ge,h.og,h.Fc,h.Eb,h.Ab,h.mode,h.qg,h.mo,h.no]}b[c]=[d.Yb,d.eh,d.dj,d.Kb,f,d.ej]}a.set(1,[b]);b=[];for(c=0;c<this.vc.length;c++)d=this.vc[c],b[c]=[d.nf,d.Yc,d.Xd,d.Ad,d.lc,d.Oc,d.ye,d.Ef];a.set(2,[b]);b=[];for(c=0;c<this.V.length;c++)d=this.V[c],b[c]=[d.Fc,d.$c,d.Ab,d.Be,d.gh,d.mode,d.ig,d.Ed,d.md,d.td,d.af,d.De,d.vd,d.Yb,d.ef];a.set(3,[this.Oa,
b,this.Pa]);a.set(4,[this.Ya,this.W,this.qb,this.Ca,this.ya]);this.ja>=kg&&(a.set(5,[this.N,this.ea,this.aa,this.Ja,this.fa,this.Ka]),a.set(6,[this.ra[7],this.ra,this.pa,this.A,this.Ga,this.ua]));return a.data()};
l.restore=function(a){var b,c;b=a[0];Array.isArray(b[0])?this.C=b[0]:(this.C[0][0]=b[0],this.C[1][0]=b[1]&15,this.C[0][1]=b[2],this.C[1][1]=b[3]&15);Tk(this);b=a[1];for(c=0;c<this.cb;c++)Uk(this,c,1==b.length?b[0][c]:b);b=a[2];for(c=0;c<this.Da;c++)Vk(this,c,c?160:32,b[0][c]);b=a[3];this.Oa=b[0];this.Pa=b[2];for(c=0;c<this.V.length;c++)Wk(this,c,b[1][c]);b=a[4];this.Ya=b[0];this.W=b[1];this.qb=b[2];this.Ca=b[3];this.ya=b[4];if(b=a[5])this.N=b[0],this.ea=b[1],this.aa=b[2],this.Ja=b[3],this.fa=b[4],
this.Ka=b[5];if(b=a[6])this.ra=b[1],this.ra[7]=b[0],this.pa=b[2],this.A=b[3],this.Ga=b[4],this.ua=b[5],Zk(this);return!0};l.start=function(){cl(this)};l.stop=function(){cl(this)};var dl=[0,null,null,0,Array(4),0];function Uk(a,b,c){var d=a.L[b];d||(d={Dc:Array(4)});c=c&&5<=c.length?c:dl;d.Yb=c[0];d.eh=c[1];d.dj=c[2];d.Kb=c[3];d.Zm=b<<2;for(var e=0;e<d.Dc.length;e++)el(d,e,c[4][e]);d.ej=c[5]||0;a.L[b]=d}var fl=[!0,[0,0],[0,0],[0,0],[0,0]];
function el(a,b,c){var d=a.Dc[b];d||(d={og:[0,0],Fc:[0,0],Eb:[0,0],Ab:[0,0]});c=c&&8==c.length?c:fl;d.Ge=c[0];d.og[0]=c[1][0];d.og[1]=c[1][1];d.Fc[0]=c[2][0];d.Fc[1]=c[2][1];d.Eb[0]=c[3][0];d.Eb[1]=c[3][1];d.Ab[0]=c[4][0];d.Ab[1]=c[4][1];d.mode=c[5];d.qg=c[6];d.controller=a;d.yj=b;gl(d,c[8],c[9]);a.Dc[b]=d}function gl(a,b,c,d){"string"==typeof b&&(b=ob(b));b&&(a.done=null,a.mo=b.id,a.no=c,a.vg=b,a.mh=b[c],a.Lg=d)}var hl=[0,Array(4)];
function Vk(a,b,c,d){var e=a.vc[b];e||(e={Yc:[null,null,null,null]});d=d&&8==d.length?d:hl;e.port=c;e.Lo=b<<3;e.nf=d[0];e.Yc[0]=d[1][0];e.Yc[1]=d[1][1];e.Yc[2]=d[1][2];e.Yc[3]=d[1][3];e.Xd=d[2];e.Ad=d[3];e.lc=d[4];e.Oc=d[5];e.ye=d[6];e.Ef=d[7];a.vc[b]=e}var il=[[0,0],[0,0],[0,0],[0,0]];
function Wk(a,b,c){var d=a.V[b];d||(d={Fc:[0,0],$c:[0,0],Ab:[0,0],Be:[0,0]});c=c&&13<=c.length?c:il;d.Fc[0]=c[0][0];d.Fc[1]=c[0][1];d.$c[0]=c[1][0];d.$c[1]=c[1][1];d.Ab[0]=c[2][0];d.Ab[1]=c[2][1];d.Be[0]=c[3][0];d.Be[1]=c[3][1];d.gh=c[4];d.mode=c[5];d.ig=c[6];d.Ed=c[7];d.md=c[8];d.td=c[9];d.af=c[10];d.De=c[11];d.vd=c[12];d.Yb=c[13]||0;d.ef=c[14]||!1;a.V[b]=d}
function Fk(a,b,c){for(var d="",e=a.qa[c],f=1;8>=f;f++){var g="pcjs-bitCell";f||(g+=" pcjs-bitCellLeft");d+='<div id="'+(c+"-"+f)+'" class="'+g+'" data-value="0">'+f+"</div>\n"}e.innerHTML=d;jl(a,b,c,!0)}function kl(a,b,c){if(b=(a=Ek[a.ja|0])&&a[b])for(var d in b)if(a=b[d],a.Lc&1<<c)return a;return null}
function Yk(a,b,c){for(var d=null,e=Ek[a.ja]||Ek[a.ja|0]||Ek[5150],f=0;f<e.length;f++){var g=e[f];if(g&&(g=g[b])){a=a.C[f][c?0:1]&g.Lc;for(var h in g.gd)if(g.gd[h]==a&&(d=h,"number"==typeof+d))break;break}}return d}function $k(a,b){if(b<+Yk(a,zk,void 0)){if(!a.ia)return 1;if(b<a.ia.length)switch(a.ia[b]){case 160:case 180:case 320:case 360:return 1;case 720:return 3;case 1200:return 2;case 1440:return 4}}return 0}function Xk(a,b){return+Yk(a,5,b)+ +Yk(a,6,b)}
function wk(a,b){if(a){b=0;for(var c=1,d=0;d<a.length;d++)"0"==a.charAt(d)&&(b|=c),c<<=1}return b}function yk(a,b,c,d){for(var e=Ek[a.ja]||Ek[a.ja|0]||Ek[5150],f=0;f<e.length;f++){var g=e[f];if(g&&(g=g[b]))for(var h in g.gd)if(h==c){a.C[f][d?0:1]&=~g.Lc;a.C[f][d?0:1]|=g.gd[h];return}}}function ll(a,b){a.setAttribute("data-value",b?"1":"0");a.style.color=b?"#ffffff":"#000000";a.style.backgroundColor=b?"#000000":"#ffffff"}function Tk(a){jl(a,0,xk);jl(a,1,Bk);ml(a)}
function jl(a,b,c,d){if(c=a.qa[c]){d=d?a.C[b][0]:a.C[b][1]=a.C[b][0];c=tb(c,"pcjs-bitCell");for(var e=0;e<c.length;e++){var f=kl(a,b,e);c[e].setAttribute("title",f&&f.Pd||"Reserved");ll(c[e],d&1<<e?!1:!0);c[e].onclick=function(a,b){return function(){var c="1"!=b.getAttribute("data-value");ll(b,c);var d=b.getAttribute("id").split("-"),e=1<<+d[1]-1;switch(d[0]){case xk:a.C[0][0]=a.C[0][0]&~e|(c?0:e);break;case Bk:a.C[1][0]=a.C[1][0]&~e|(c?0:e)}ml(a)}}(a,c[e])}}}
function ml(a){var b=a.qa.swdesc;if(null!=b){var c;c=""+(Xk(a,!0)+"Kb");c+=", "+(+ +Yk(a,3,!0)?"":"No ")+"FPU";c+=", "+{0:"Enhanced Color",1:"TV",2:"Color",3:"Monochrome"}[+Yk(a,Ak,!0)]+" Monitor";c+=", "+ +Yk(a,zk,!0)+" Floppy Drives";if(null!=a.C[0][1]&&a.C[0][1]!=a.C[0][0]||null!=a.C[1][1]&&a.C[1][1]!=a.C[1][0])c+=" (Reset required)";b.textContent=c}}
function nl(a,b,c,d,e){var f=a.L[b],g=f.Dc[c],h=g.Eb[f.Kb];z(a,768)&&x(a,d,null,e,"DMA"+b+".CHANNEL"+c+".ADDR["+f.Kb+"]",h,!0);f.Kb^=1;b||c||f.Kb||(g.Eb[0]++,255<g.Eb[0]&&(g.Eb[0]=0,g.Eb[1]++,255<g.Eb[1]&&(g.Eb[1]=0)));return h}function ol(a,b,c,d,e,f){var g=a.L[b];z(a,768)&&x(a,d,e,f,"DMA"+b+".CHANNEL"+c+".ADDR["+g.Kb+"]",null,!0);a=g.Dc[c];a.Eb[g.Kb]=a.og[g.Kb]=e;g.Kb^=1}
function pl(a,b,c,d,e){var f=a.L[b],g=f.Dc[c],h=g.Ab[f.Kb];z(a,768)&&x(a,d,null,e,"DMA"+b+".CHANNEL"+c+".COUNT["+f.Kb+"]",h,!0);f.Kb^=1;b||c||f.Kb||(g.Ab[0]--,0>g.Ab[0]&&(g.Ab[0]=255,g.Ab[1]--,0>g.Ab[1]&&(g.Ab[1]=255)));return h}function ql(a,b,c,d,e,f){var g=a.L[b];z(a,768)&&x(a,d,e,f,"DMA"+b+".CHANNEL"+c+".COUNT["+g.Kb+"]",null,!0);a=g.Dc[c];a.Ab[g.Kb]=a.Fc[g.Kb]=e;g.Kb^=1}function rl(a,b,c,d){var e=a.L[b],f=e.Yb|1;e.Yb&=-16;z(a,768)&&x(a,c,null,d,"DMA"+b+".STATUS",f,!0);return f}
function sl(a,b,c,d,e){var f=a.L[b];z(a,768)&&x(a,c,d,e,"DMA"+b+".REQ",null,!0);a=d&3;f.Yb=f.Yb&~(16<<a)|(d&4)<<a+2;f.dj=d}function tl(a,b,c,d,e){var f=a.L[b];z(a,768)&&x(a,c,d,e,"DMA"+b+".MASK",null,!0);b=d&3;c=f.Dc[b];c.Ge=!!(d&4);c.Ge||ul(a,f.Zm+b)}function vl(a,b,c,d,e){z(a,768)&&x(a,c,d,e,"DMA"+b+".MODE",null,!0);a.L[b].Dc[d&3].mode=d}function wl(a,b,c,d){var e=a.L[b].ej;z(a,768)&&x(a,c,null,d,"DMA"+b+".TEMP",e,!0);return e}
function xl(a,b,c,d,e){z(a,768)&&x(a,c,d,e,"DMA"+b+".MASTER_CLEAR",null,!0);a=a.L[b];for(b=0;b<a.Dc.length;b++)el(a,b)}function yl(a,b,c,d,e){var f=a.L[b].Dc[c].qg;z(a,768)&&x(a,d,null,e,"DMA"+b+".CHANNEL"+c+".PAGE",f,!0);return f}function zl(a,b,c,d,e,f){z(a,768)&&x(a,d,e,f,"DMA"+b+".CHANNEL"+c+".PAGE",null,!0);a.L[b].Dc[c].qg=e}function Al(a,b,c,d){var e=a.ra[b];z(a,768)&&x(a,c,null,d,"DMA.SPARE"+b+".PAGE",e,!0);return e}
function Bl(a,b,c,d,e){z(a,768)&&x(a,c,d,e,"DMA.SPARE"+b+".PAGE",null,!0);a.ra[b]=d}function Cl(a,b,c,d,e){gl(a.L[b>>2].Dc[b&3],c,d,e)}function ul(a,b,c){b=a.L[b>>2].Dc[b&3];b.vg&&b.mh&&b.Lg?(c&&(b.done=c),b.Ge||Dl(a,b,!0)):c&&c(!0)}
function Dl(a,b,c){c&&(b.count=b.Ab[1]<<8|b.Ab[0],b.type=b.mode&12,b.uj=b.wg=!1);for(var d=!1;0<=b.count&&(c=b.qg<<16|b.Eb[1]<<8|b.Eb[0],4==b.type?(d=!0,function(c){b.mh.call(b.vg,b.Lg,-1,function(e,g){0>e&&(b.uj||(b.uj=!0),e=255);b.Ge||a.ga.qc(c,e);(d=g)&&setTimeout(function(){El(b)||Dl(a,b)},0)})}(c)):8==b.type?(c=a.ga.Qa(c),0>b.mh.call(b.vg,b.Lg,c)&&(b.wg=!0)):0!=b.type&&(b.wg=!0)),!d&&!El(b););}
function El(a){if(!a.wg&&0<=--a.count&&(a.mode&32?(a.Eb[0]--,0>a.Eb[0]&&(a.Eb[0]=255,a.Eb[1]--,0>a.Eb[1]&&(a.Eb[1]=255))):(a.Eb[0]++,255<a.Eb[0]&&(a.Eb[0]=0,a.Eb[1]++,255<a.Eb[1]&&(a.Eb[1]=0))),!a.Ge))return!1;var b=a.controller;b.Yb=b.Yb&~(16<<a.yj)|1<<a.yj;a.mode&16||(a.Ge=!0,a.vg=a.Lg=null);a.done&&(a.done(!a.wg),a.done=null);return!0}function Fl(a,b,c){var d=0,e=a.vc[b];if(null!=e.Ef)switch(e.Ef&3){case 2:d=e.lc;break;case 3:d=e.Oc}z(a,34048)&&x(a,e.port,null,c,"PIC"+b,d,!0);return d}
function Gl(a,b,c,d){var e=a.vc[b];z(a,34048)&&x(a,e.port,c,d,"PIC"+b,null,!0);if(c&16)e.Xd=0,e.Yc[e.Xd++]=c,e.Ad=0,e.ye=7,e.lc=e.Oc=0,e.Ef=10;else if(c&8)c&100&&z(a,1073741824)&&y(a,"PIC"+b+"("+u(e.port)+"): unsupported OCW3 command "+u(c),!0,!0),e.Ef=c;else if(d=c&224,d&32){var f,g=0;if(96==(d&96))g=1<<(c&7);else for(f=e.ye+1;;){f&=7;var h=1<<f;if(e.Oc&h){g=h;break}if(f++==e.ye)break}e.Oc&g&&(e.Oc&=~g,Hl(a));d&128&&z(a,1073741824)&&y(a,"PIC"+b+"("+u(e.port)+"): unsupported OCW2 rotate command "+
u(c),!0,!0)}else 192==d?e.ye=c&7:z(a,1073741824)&&y(a,"PIC"+b+"("+u(e.port)+"): unsupported OCW2 automatic EOI command "+u(c),!0,!0)}function Il(a,b,c){var d=a.vc[b],e=d.Ad;z(a,34048)&&x(a,d.port+1,null,c,"PIC"+b,e,!0);return e}function Jl(a,b,c,d){var e=a.vc[b];z(a,34048)&&x(a,e.port+1,c,d,"PIC"+b,null,!0);e.Xd<e.Yc.length?(e.Yc[e.Xd++]=c,2==e.Xd&&e.Yc[0]&2&&e.Xd++,3!=e.Xd||e.Yc[0]&1||e.Xd++):(e.Ad=c,d=a.F,d.S|=4,Hl(a,b||253!=c?0:6))}
function mg(a,b,c){var d=a.vc[b>>3];b=1<<(b&7);d.lc&b||(d.lc|=b,d.nf=c||0,Hl(a))}function lg(a,b){var c=a.vc[b>>3];b=1<<(b&7);c.lc&b&&(c.lc&=~b,Hl(a))}function Hl(a,b){var c,d=-1;1<a.Da&&(c=a.vc[1],d=~(c.Oc|c.Ad)&c.lc);c=a.vc[0];0<=d&&(c.lc=d?c.lc|4:c.lc&-5);d=~(c.Oc|c.Ad)&c.lc;a=a.F;a.N&&(a.ua=d?a.ua|1:a.ua&-2);d&&b&&(c.nf=b)}
function bg(a,b){void 0===b&&(b=0);var c=-1,d=a.vc[b];if(d.nf)c=-2,d.nf--;else for(var e=d.lc&((d.Oc|d.Ad)^255),f=d.ye+1;;){var f=f&7,g=1<<f;if(d.Oc&g)break;if(e&g){b||2!=f?c=d.Yc[1]+f:c=bg(a,1);0<=c&&(d.Oc|=g,d.lc&=~g);break}if(f++==d.ye)break}return c}function Kl(a,b,c,d,e){var f;f=b?3:0;var g=a.V[f+c];g.ef?(f=g.Yb,g.ef=!1):(g.Ed==g.md&&Ll(a,f+c),g.af?(f=g.Be[g.Ed++],g.Ed==g.md&&(g.af=!1)):(Rk(a,f+c),f=g.Ab[g.Ed++]));z(a,2304)&&x(a,d,null,e,"PIT"+b+".TIMER"+c,f,!0);return f}
function Ml(a,b,c,d,e,f){z(a,2304)&&x(a,d,e,f,"PIT"+b+".TIMER"+c,null,!0);f=b?3:0;d=a.V[f+c];d.Ed==d.md&&Ll(a,f+c);d.Fc[d.Ed++]=e;d.Ed==d.md&&(d.De&&0!=d.mode&&8!=d.mode||(d.af=!1,d.Ab[0]=d.$c[0]=d.Fc[0],d.Ab[1]=d.$c[1]=d.Fc[1],d.vd=cd(a.F,a.ka),d.De=!0,d.td=0!=d.mode,b||c||(lg(a,0),e=Nl(a,0)*a.gb|0,6==d.mode&&(e>>=1),ed(a.F,e))),b||2!=c||cl(a))}function Ol(a,b,c,d){x(a,c,null,d,"PIT"+b+".CTRL",null,2048);return b?a.Pa:a.Oa}
function Pl(a,b,c,d,e){x(a,c,d,e,"PIT"+b+".CTRL",null,2048);e=0;c=d&192;b?(e=3,a.Pa=d):a.Oa=d;if(192==c){if(!(d&16))for(c=0;2>=c;c++)if(d&2<<c){b=e+c;var f=a.V[b];f.ef||(Rk(a,b),f.Yb=f.gh|f.mode|f.ig|(f.Ed<f.md?64:0)|(f.td?128:0),f.ef=!0)}if(!(d&32))for(c=0;2>=c;c++)d&2<<c&&Ql(a,e+c)}else{c>>=6;var f=d&1,g=d&14;if(d&=48){e+=c;var h=a.V[e];h.ig=d;h.mode=g;h.gh=f;h.Fc=[0,0];h.Ab=[0,0];h.Be=[0,0];h.td=!1;h.af=!1;h.De=!1;h.ef=!1;Ll(a,e);b||c||lg(a,0);b||2!=c||255!=a.vc[0].Ad||77!=a.W||(b=a.V[0],b.$c[0]=
b.Fc[0],b.$c[1]=b.Fc[1],b.vd=cd(a.F,a.ka))}else Ql(a,e+c)}}function Nl(a,b){a=a.V[b];(b=a.Fc[1]<<8|a.Fc[0])||(b=1==a.md?256:65536);return b}function id(a,b){a=a.V[b];(b=a.$c[1]<<8|a.$c[0])||(b=1==a.md?256:65536);return b}function Ql(a,b){Rk(a,b);var c=a.V[b];c.Be[0]=c.Ab[0];c.Be[1]=c.Ab[1];c.af=!0;Ll(a,b)}function Ll(a,b){a=a.V[b];a.Ed=32==a.ig?1:0;a.md=48==a.ig?2:1}
function Rk(a,b,c){var d=a.V[b];if(d.De&&(2!=b||a.W&1)){var e=cd(a.F,a.ka),f=(e-d.vd)/a.gb|0;0>f&&(d.vd=e,f=0);var g=Nl(a,b),h=id(a,b)-f;0==d.mode?(0>=h&&(h=0),h||(d.td=!0,d.De=!1,b||mg(a,0))):4==d.mode?(d.td=1!=h,0>=h&&(h=g+h,0>=h&&(h=g),d.$c[0]=h&255,d.$c[1]=h>>8&255,d.vd=e,!b&&d.td&&mg(a,0))):6==d.mode&&(h-=f,0>=h&&(d.td=!d.td,h=g+h,0>=h&&(h=g),d.$c[0]=h&255,d.$c[1]=h>>8&255,d.vd=e,!b&&d.td&&mg(a,0)));d.Ab[0]=h&255;d.Ab[1]=h>>8&255;c&&(a.vd=0)}return d}
function hd(a,b){for(var c=0;c<a.V.length;c++)Rk(a,c,b);if(a.ja>=kg){b=a.F.Y.Id;c=cd(a.F,a.ka);null==a.fb&&(a.Ga=cd(a.F,a.ka),a.Jb=1024,a.fb=Math.floor(a.F.Y.Id/a.Jb),bl(a));c>=a.ua&&(a.A[12]|=64,a.A[11]&64&&(a.A[12]|=128,mg(a,8)),a.ua=c+a.fb);a.A[0]==a.A[1]&&a.A[2]==a.A[3]&&a.A[4]==a.A[5]&&(a.A[12]|=32,a.A[11]&32&&(a.A[12]|=128,mg(a,8)));var d=c-a.Ga,e=Math.floor(d/b);if(e&&!(a.A[11]&128)){for(;e--;)if(60<=++a.A[0]&&(a.A[0]=0,60<=++a.A[2]&&(a.A[2]=0,24<=++a.A[4]))){a.A[4]=0;a.A[6]=a.A[6]%7+1;var f;
f=a.A[9];var g=va[a.A[8]-1];28==g&&(f%4||!(f%100)&&f%400||g++);f=g;++a.A[7]>f&&(a.A[7]=1,12<++a.A[8]&&(a.A[8]=1,a.A[9]=(a.A[9]+1)%100))}a.A[12]|=16;a.A[11]&16&&(a.A[12]|=128,mg(a,8))}a.Ga=c-d%b}}l=X.prototype;l.ym=function(a,b){var c=this.Ya;this.Ca&16&&(this.W&128?c=this.C[0][1]:this.B&&(c=Rl(this.B)));x(this,a,null,b,"PPI_A",c);return c};l.Yn=function(a,b,c){x(this,a,b,c,"PPI_A");this.Ya=b};l.zm=function(a,b){var c=this.W;x(this,a,null,b,"PPI_B",c);return c};
l.Zn=function(a,b,c){x(this,a,b,c,"PPI_B");Sl(this,b)};function Sl(a,b){var c=!!(b&2),d=!!(a.W&2);a.W=b;a.B&&Tl(a.B,!(b&128),!!(b&64));c!=d&&cl(a,c)}l.Am=function(a,b){var c=0,c=5150==(this.ja|0)?this.W&4?c|this.C[1][1]&15:c|this.C[1][1]>>4&1:this.W&8?c|this.C[0][1]>>4:c|this.C[0][1]&15;this.W&1&&Rk(this,2).td&&(c=this.W&2?c|32:c|16);x(this,a,null,b,"PPI_C",c,32896);return c};l.$n=function(a,b,c){x(this,a,b,c,"PPI_C");this.qb=b};l.Bm=function(a,b){var c=this.Ca;x(this,a,null,b,"PPI_CTRL",c);return c};
l.ao=function(a,b,c){x(this,a,b,c,"PPI_CTRL");this.Ca=b};l.Kl=function(a,b){var c=this.B?Rl(this.B):0;x(this,a,null,b,"8041_KBD",c);this.va&=-2;return c};l.hn=function(a,b,c){x(this,a,b,c,"8041_KBD")};l.Jl=function(a,b){var c=this.W;x(this,a,null,b,"8041_CTRL",c);return c};l.gn=function(a,b,c){x(this,a,b,c,"8041_CTRL");Sl(this,b)};l.Ll=function(a,b){var c=this.va;x(this,a,null,b,"8041_STATUS",c);return c};
l.Ml=function(a,b){var c=this.Ja;x(this,a,null,b,"8042_OUTBUFF",c,16384);this.N&=-258;this.B&&Ul(this.B);return c};
l.kn=function(a,b,c){x(this,a,b,c,"8042_INBUF.DATA",null,16384);if(this.N&8)switch(this.ea){case 96:Vl(this,b);break;case 209:Wl(this,b);break;default:if(Vl(this,this.aa&-17),this.B){a=this.B;c=b;var d=-1;z(a)&&y(a,"sendCmd("+u(c)+")");switch(a.V||c){case 255:d=250;Xl(a);break;case 243:a.V&&(c=0);Yl(a,250);a.V=c;break;case 237:a.V&&(c=0);Yl(a,250);a.V=c;break;default:y(a,"sendCmd(): unrecognized command")}Zl(this,d)}}this.ea=b;this.N&=-9};
l.Nl=function(a,b){var c=this.W&-209|(cd(this.F)&64?16:0);x(this,a,null,b,"8042_RWREG",c,16384);return c};l.mn=function(a,b,c){x(this,a,b,c,"8042_RWREG",null,16384);Sl(this,b)};l.Ol=function(a,b){x(this,a,null,b,"8042_STATUS",this.N,16384);a=this.N&255;this.N&256&&(this.N|=1,this.N&=-257);return a};
l.jn=function(a,b,c){x(this,a,b,c,"8042_INBUFF.CMD",null,16384);this.ea=b;this.N|=8;a=0;240<=this.ea&&(a=this.ea^15,this.ea=240);switch(this.ea){case 32:Zl(this,this.aa);break;case 173:Vl(this,this.aa|16);break;case 174:Vl(this,this.aa&-17);this.B&&Ul(this.B);break;case 170:this.B&&(a=this.B,a.A=[],z(a)&&y(a,"scan codes flushed"));Vl(this,this.aa|16);Zl(this,85);Wl(this,3);break;case 171:Zl(this,0);break;case 192:Zl(this,this.fa);break;case 208:Zl(this,this.Ka);break;case 224:Zl(this,this.aa&16?0:
1);break;case 240:a&1&&ve(this.F)}};function Vl(a,b){a.aa=b;a.N=a.N&-5|b&4;a.B&&Tl(a.B,!!(b&8),!(b&16))}function Zl(a,b,c){0<=b&&(a.Ja=b,c?a.N|=1:(a.N&=-2,a.N|=256))}function Wl(a,b){a.Ka=b;Tb(a.ga,!!(b&2));b&1||ve(a.F)}function $l(a,b){a.ja<kg?(mg(a,1,4),a.va|=1):a.aa&16||a.N&257||(Zl(a,b,!0),am(a.B),mg(a,1,120))}function bm(a,b,c,d){var e=a.C[b][1];x(a,c,null,d,"DIPSW-"+b,e,32768);return e}l.bm=function(a,b){x(this,a,null,b,"CMOS.ADDR",this.pa,4096);return this.pa};
l.An=function(a,b,c){x(this,a,b,c,"CMOS.ADDR",null,4096);this.pa=b;this.ya=b&128?0:128};l.cm=function(a,b){var c=this.pa&63,d=13>=c?Sk(this,c):this.A[c];z(this,4352)&&x(this,a,null,b,"CMOS.DATA["+u(c)+"]",d,!0);null!=b&&12==c&&(this.A[c]&=15,d&128&&lg(this,8),d&64&&this.A[11]&64&&bl(this));return d};
l.Bn=function(a,b,c){var d=this.pa&63;z(this,4352)&&x(this,a,b,c,"CMOS.DATA["+u(d)+"]",null,!0);a=b^this.A[d];if(13>=d){if(c=b,10>d){var e=!1;this.A[11]&4||(c=10*(c>>4)+(c&15),e=!0);if(4==d||5==d)e&&23<c&&(c+=48),this.A[11]&2||(12>=c?c=12==c?0:c:(c-=116,c=24==c?12:c))}}else c=b;this.A[d]=c;11==d&&a&64&&b&64&&bl(this)};l.Nk=function(a,b,c){x(this,a,b,c,"NMI");this.ya=b};l.Ln=function(a,b,c){x(this,a,b,c,"FPU.CLEAR")};l.Mn=function(a,b,c){x(this,a,b,c,"FPU.RESET");this.Tb&&fg(this.Tb)};
l.Pm=function(a){if(z(this,16)&&pk(this.ha,26,a)){var b=this.F.G>>8;mf(this.F,a,function(a,d){return function(c){d=cd(a.F)-d;var e,g=a.F.M&255,h=a.F.M>>8,k=a.F.M&255,m=a.F.M>>8;if(2==b||3==b)e=" CH(hour)="+v(h)+" CL(min)="+u(g)+" DH(sec)="+u(m);else if(4==b||5==b)e=" CX(year)="+v(a.F.I)+" DH(month)="+u(m)+" DL(day)="+u(k);g=a.ha;h=d;g.message("INT "+u(26)+": C="+(xf(g.F)?1:0)+(e||"")+" (cycles="+h+(c?",level="+(c+1):"")+")")}}(this,cd(this.F)))}return!0};
function cl(a,b){if(a.Fa)try{void 0!==b?a.Db=b:b=a.Db&&a.F&&a.F.la.Ib;var c=Math.round(1193181/Nl(a,2));if(20>c||2E4<c)b=!1;b?a.U?(a.U.frequency.value=c,z(a,33554432)&&y(a,"speaker set to "+c+"hz",!0)):(a.U=a.Fa.createOscillator(),a.U&&(a.U.type="number"==typeof a.U.type?1:"square",a.U.connect(a.Fa.destination),a.U.frequency.value=c,"start"in a.U?a.U.start(0):a.U.noteOn(0),z(a,33554432)&&y(a,"speaker on at "+c+"hz",!0))):a.U&&("stop"in a.U?a.U.stop(0):a.U.noteOff(0),a.U.disconnect(),delete a.U,z(a,
33554432)&&y(a,"speaker off at "+c+"hz",!0))}catch(d){a.Na("AudioContext exception: "+d.message),a.Fa=null}else b&&y(a,"BEEP",33554432)}
var Gk={0:function(a,b){return nl(this,0,0,a,b)},1:function(a,b){return pl(this,0,0,a,b)},2:function(a,b){return nl(this,0,1,a,b)},3:function(a,b){return pl(this,0,1,a,b)},4:function(a,b){return nl(this,0,2,a,b)},5:function(a,b){return pl(this,0,2,a,b)},6:function(a,b){return nl(this,0,3,a,b)},7:function(a,b){return pl(this,0,3,a,b)},8:function(a,b){return rl(this,0,a,b)},13:function(a,b){return wl(this,0,a,b)},32:function(a,b){return Fl(this,0,b)},33:function(a,b){return Il(this,0,b)},64:function(a,
b){return Kl(this,0,0,a,b)},65:function(a,b){return Kl(this,0,1,a,b)},66:function(a,b){return Kl(this,0,2,a,b)},67:function(a,b){return Ol(this,0,a,b)},129:function(a,b){return yl(this,0,2,a,b)},130:function(a,b){return yl(this,0,3,a,b)},131:function(a,b){return yl(this,0,1,a,b)},135:function(a,b){return yl(this,0,0,a,b)}},Ik={96:X.prototype.ym,97:X.prototype.zm,98:X.prototype.Am,99:X.prototype.Bm},Mk={96:X.prototype.Ml,97:X.prototype.Nl,100:X.prototype.Ol,112:X.prototype.bm,113:X.prototype.cm,128:function(a,
b){return Al(this,7,a,b)},132:function(a,b){return Al(this,0,a,b)},133:function(a,b){return Al(this,1,a,b)},134:function(a,b){return Al(this,2,a,b)},136:function(a,b){return Al(this,3,a,b)},137:function(a,b){return yl(this,1,2,a,b)},138:function(a,b){return yl(this,1,3,a,b)},139:function(a,b){return yl(this,1,1,a,b)},140:function(a,b){return Al(this,4,a,b)},141:function(a,b){return Al(this,5,a,b)},142:function(a,b){return Al(this,6,a,b)},143:function(a,b){return yl(this,1,0,a,b)},160:function(a,b){return Fl(this,
1,b)},161:function(a,b){return Il(this,1,b)},192:function(a,b){return nl(this,1,0,a,b)},194:function(a,b){return pl(this,1,0,a,b)},196:function(a,b){return nl(this,1,1,a,b)},198:function(a,b){return pl(this,1,1,a,b)},200:function(a,b){return nl(this,1,2,a,b)},202:function(a,b){return pl(this,1,2,a,b)},204:function(a,b){return nl(this,1,3,a,b)},206:function(a,b){return pl(this,1,3,a,b)},208:function(a,b){return rl(this,1,a,b)},218:function(a,b){return wl(this,1,a,b)}},Kk={96:X.prototype.Kl,97:X.prototype.Jl,
100:X.prototype.Ll,102:function(a,b){return bm(this,0,a,b)},103:function(a,b){return bm(this,1,a,b)}},Ok={72:function(a,b){return Kl(this,1,0,a,b)},73:function(a,b){return Kl(this,1,1,a,b)},74:function(a,b){return Kl(this,1,2,a,b)},75:function(a,b){return Ol(this,1,a,b)}},Hk={0:function(a,b,c){ol(this,0,0,a,b,c)},1:function(a,b,c){ql(this,0,0,a,b,c)},2:function(a,b,c){ol(this,0,1,a,b,c)},3:function(a,b,c){ql(this,0,1,a,b,c)},4:function(a,b,c){ol(this,0,2,a,b,c)},5:function(a,b,c){ql(this,0,2,a,b,
c)},6:function(a,b,c){ol(this,0,3,a,b,c)},7:function(a,b,c){ql(this,0,3,a,b,c)},8:function(a,b,c){z(this,768)&&x(this,a,b,c,"DMA0.CMD",null,!0);this.L[0].eh=b},9:function(a,b,c){sl(this,0,a,b,c)},10:function(a,b,c){tl(this,0,a,b,c)},11:function(a,b,c){vl(this,0,a,b,c)},12:function(a,b,c){z(this,768)&&x(this,a,b,c,"DMA0.RESET_FF",null,!0);this.L[0].Kb=0},13:function(a,b,c){xl(this,0,a,b,c)},32:function(a,b,c){Gl(this,0,b,c)},33:function(a,b,c){Jl(this,0,b,c)},64:function(a,b,c){Ml(this,0,0,a,b,c)},
65:function(a,b,c){Ml(this,0,1,a,b,c)},66:function(a,b,c){Ml(this,0,2,a,b,c)},67:function(a,b,c){Pl(this,0,a,b,c)},129:function(a,b,c){zl(this,0,2,a,b,c)},130:function(a,b,c){zl(this,0,3,a,b,c)},131:function(a,b,c){zl(this,0,1,a,b,c)},135:function(a,b,c){zl(this,0,0,a,b,c)}},Jk={96:X.prototype.Yn,97:X.prototype.Zn,98:X.prototype.$n,99:X.prototype.ao,160:X.prototype.Nk},Nk={96:X.prototype.kn,97:X.prototype.mn,100:X.prototype.jn,112:X.prototype.An,113:X.prototype.Bn,128:function(a,b,c){Bl(this,7,a,
b,c)},132:function(a,b,c){Bl(this,0,a,b,c)},133:function(a,b,c){Bl(this,1,a,b,c)},134:function(a,b,c){Bl(this,2,a,b,c)},136:function(a,b,c){Bl(this,3,a,b,c)},137:function(a,b,c){zl(this,1,2,a,b,c)},138:function(a,b,c){zl(this,1,3,a,b,c)},139:function(a,b,c){zl(this,1,1,a,b,c)},140:function(a,b,c){Bl(this,4,a,b,c)},141:function(a,b,c){Bl(this,5,a,b,c)},142:function(a,b,c){Bl(this,6,a,b,c)},143:function(a,b,c){zl(this,1,0,a,b,c)},160:function(a,b,c){Gl(this,1,b,c)},161:function(a,b,c){Jl(this,1,b,c)},
192:function(a,b,c){ol(this,1,0,a,b,c)},194:function(a,b,c){ql(this,1,0,a,b,c)},196:function(a,b,c){ol(this,1,1,a,b,c)},198:function(a,b,c){ql(this,1,1,a,b,c)},200:function(a,b,c){ol(this,1,2,a,b,c)},202:function(a,b,c){ql(this,1,2,a,b,c)},204:function(a,b,c){ol(this,1,3,a,b,c)},206:function(a,b,c){ql(this,1,3,a,b,c)},208:function(a,b,c){z(this,768)&&x(this,a,b,c,"DMA1.CMD",null,!0);this.L[1].eh=b},210:function(a,b,c){sl(this,1,a,b,c)},212:function(a,b,c){tl(this,1,a,b,c)},214:function(a,b,c){vl(this,
1,a,b,c)},216:function(a,b,c){z(this,768)&&x(this,a,b,c,"DMA1.RESET_FF",null,!0);this.L[1].Kb=0},218:function(a,b,c){xl(this,1,a,b,c)},240:X.prototype.Ln,241:X.prototype.Mn},Lk={96:X.prototype.hn,97:X.prototype.gn,160:X.prototype.Nk},Pk={72:function(a,b,c){Ml(this,1,0,a,b,c)},73:function(a,b,c){Ml(this,1,1,a,b,c)},74:function(a,b,c){Ml(this,1,2,a,b,c)},75:function(a,b,c){Pl(this,1,a,b,c)}};
Xa(function(){for(var a=tb(document,"pcx86","chipset"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new X(d);sb(d,c);ml(d)}});
function cm(a){bb.call(this,"ROM",a,cm);this.A=null;this.X=a.addr;this.C=a.size;this.N=a.alias;this.L=a.file;this.B=a.notify;this.V=null;if(this.B&&(a=this.B.indexOf("["),0<a)){try{this.V=eval(this.B.substr(a))}catch(d){}this.B=this.B.substr(0,a)}if(this.L){a=this.L;var b=ka(ja(a));"json"!=b&&"hex"!=b&&(a=Ba()+"/api/v1/dump?file="+this.L+"&format=bytes&decimal=true");var c=this;Aa(a,null,!0,function(a,b,f){dm(c,a,b,f)})}}jb(cm);cm.prototype.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;em(this)};
cm.prototype.hc=function(){this.Qd&&(this.ha&&fm(this.ha,this.id,0,this.X>>>4,0,this.X,this.C,this.Qd),delete this.Qd);return!0};cm.prototype.gc=function(){return!0};
function dm(a,b,c,d){if(d)a.Na("Unable to load system ROM (error "+d+": "+b+")");else{mb(a.ce,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,g=e.data;if(f)a.A=f;else if(g)for(a.A=Array(4*g.length),d=c=0;c<g.length;c++)a.A[d++]=g[c]&255,a.A[d++]=g[c]>>8&255,a.A[d++]=g[c]>>16&255,a.A[d++]=g[c]>>24&255;else a.A=e;a.Qd=e.symbols;if(!a.A.length){w("Empty ROM: "+b);return}if(1==a.A.length){w(a.A[0]);return}}catch(h){a.Na("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm,
" ").replace(/ +$/,"").split(" "),a.A=Array(b.length),e=0;e<b.length;e++)a.A[e]=ea(b[e],16);em(a)}}
function em(a){if(!yb(a))if(!a.L)xb(a);else if(a.A&&a.ga){a.C||(a.C=a.A.length);if(a.A.length!=a.C)zb(a,"ROM size ("+r(a.A.length,8,!0)+") does not match specified size ("+r(a.C,8,!0)+")");else{var b;b=a.X;if(Ub(a.ga,b,a.C,hc)){for(var c=0;c<a.A.length;c++){var d=a.ga,e=b+c;d.sa[(e&d.Gb)>>>d.La].xf(e&d.A,a.A[c]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.N?b.push(a.N):null!=a.N&&a.N.length&&(b=a.N);for(c=0;c<b.length;c++){var d=a,e=b[c],f=ec(d.ga,d.X,d.C);dc(d.ga,e,d.C,f)}a.B&&((b=ob(a.B,
a.id))?(c=a.A,d=a.V,5==b.Ua?gm(b,c,d||[12640,8752],8):b.Ua==hm&&gm(b,c,d||[14221,16269],8),xb(b)):a.Na("Unable to find component: "+a.B));delete a.A}}xb(a)}}Xa(function(){for(var a=tb(document,"pcx86","rom"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new cm(d);sb(d,c)}});function im(a){bb.call(this,"RAM",a,im);this.B=a.addr;this.A=a.size;this.L=a.test;this.X=!!this.A;this.C=!1}jb(im);l=im.prototype;l.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.N=Jb(a,"ChipSet");xb(this)};
l.hc=function(a,b){return!b&&(this.reset(),a&&this.controller&&!this.restore(a))?!1:!0};l.gc=function(a){return a&&this.controller?this.save():!0};
l.reset=function(){if(!this.B&&!this.X&&this.N){var a=1024*Xk(this.N);this.A&&a!=this.A&&(gc(this.ga,this.B,this.A),this.C=!1);this.A=a}!this.C&&this.A&&Ub(this.ga,this.B,this.A,1)&&(this.C=!0,"ramCPQ"==this.xd&&(this.controller=new jm(this),Ub(this.ga,km,4,4,this.controller)));if(this.C){if(this.L||nc(this.ga,1138,4660),"ramCPQ"!=this.xd&&this.N&&(a=this.N,a.A)){var b=1048576>this.B?21:23,c=a.A[b]|a.A[b+1]<<8,c=c+(this.A>>10);a.A[b]=c&255;a.A[b+1]=c>>8;al(a)}}else w("No RAM allocated")};
l.save=function(){var a=new qf(this);this.controller&&a.set(0,this.controller.save());return a.data()};l.restore=function(a){return this.controller?this.controller.restore(a[0]):!0};function jm(a){this.N=a;this.C=lm;this.ha=mm;this.B=nm;this.A=null}var km=-2134900736,lm=65535,mm=2575,nm=2,om=[null,0],pm=[function(a){return this.controller.Qa(a)},null,null,function(a,b){this.controller.qc(a,b)},null,null];l=jm.prototype;l.save=function(){return[this.C,this.B]};
l.restore=function(a){this.qc(0,a[0]&255);this.qc(2,a[1]&255);return!0};l.Qa=function(a){var b=255;2>a?b=a&1?this.ha>>8:this.ha&255:4>a&&(b=a&1?this.B>>8:this.B&255);return b};l.qc=function(a,b){if(a)2==a&&(this.B=this.B&-256|b);else if(b!=(this.C&255)){a=this.N.ga;if(b&1)this.A&&(dc(a,917504,131072,this.A),this.A=null);else{this.A||(this.A=ec(a,917504,131072));var c=ec(a,16646144,131072);dc(a,917504,131072,c,b&2?1:hc)}this.C=this.C&-256|b}};l.wj=function(){return om};l.nh=function(){return pm};
Xa(function(){for(var a=tb(document,"pcx86","ram"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new im(d);sb(d,c)}});function qm(a){bb.call(this,"Keyboard",a,qm,65536);rm(this,a.model);this.ia=La("Mobi");this.pa=La("MSIE");y(this,"mobile keyboard support: "+(this.ia?"true":"false"));this.fa=0;this.ka=this.kh=!1;this.B=[];this.ua=50;xb(this)}jb(qm);
var sm=["US83","US84","US101"],tm=p.dl+4E3,um={3016:1,1016:2,1017:8,1018:32,1091:128,1093:64,1224:128,1020:512,1144:1024,1145:2048},vm={TAB:1009,ESC:1027,F1:1112,F2:1113,F3:1114,F4:1115,F5:1116,F6:1117,F7:1118,F8:1119,F9:1120,F10:1121,LEFT:1037,UP:1038,RIGHT:1039,DOWN:1040,SYSREQ:4027,CTRL_C:tm,CTRL_BREAK:4008,CTRL_ALT_DEL:4046,CTRL_ALT_INS:4045,CTRL_ALT_ENTER:4013},wm={esc:1027,1:p["1"],2:p["2"],3:p["3"],4:p["4"],5:p["5"],6:p["6"],7:p["7"],8:p["8"],9:p["9"],0:p["0"],"-":p["-"],"=":p["="],bs:1008,
tab:1009,q:p.Q,w:p.Ui,e:p.E,r:p.Pi,t:p.Ri,y:p.Wi,u:p.Si,i:p.Hi,o:p.Ni,p:p.Oi,"[":p["["],"]":p["]"],enter:13,ctrl:1017,a:p.ue,s:p.Qi,d:p.Di,f:p.Ei,g:p.Fi,h:p.Gi,j:p.Ii,k:p.Ji,l:p.Ki,";":p[";"],quote:p["'"],"`":p["`"],shift:1016,"\\":p["\\"],z:p.ng,x:p.Vi,c:p.Ci,v:p.Ti,b:p.Bi,n:p.Mi,m:p.Li,",":p[","],".":p["."],"/":p["/"],"right-shift":3016,prtsc:1044,alt:1018,space:1032,"caps-lock":1020,f1:1112,f2:1113,f3:1114,f4:1115,f5:1116,f6:1117,f7:1118,f8:1119,f9:1120,f10:1121,"num-lock":1144,"scroll-lock":1145,
"num-home":1036,"num-up":1038,"num-pgup":1033,"num-sub":1109,"num-left":1037,"num-center":1101,"num-right":1039,"num-add":1107,"num-end":1035,"num-down":1040,"num-pgdn":1034,"num-ins":1045,"num-del":1046,sysreq:84},xm={"caps-lock":512,"num-lock":1024,"scroll-lock":2048},Y={1027:1};Y[p["1"]]=2;Y[p["!"]]=10754;Y[p["2"]]=3;Y[p["@"]]=10755;Y[p["3"]]=4;Y[p["#"]]=10756;Y[p["4"]]=5;Y[p.$]=10757;Y[p["5"]]=6;Y[p["%"]]=10758;Y[p["6"]]=7;Y[p["^"]]=10759;Y[p["7"]]=8;Y[p["&"]]=10760;Y[p["8"]]=9;Y[p["*"]]=10761;
Y[p["9"]]=10;Y[p["("]]=10762;Y[p["0"]]=11;Y[p[")"]]=10763;Y[p["-"]]=12;Y[p._]=10764;Y[p["="]]=13;Y[p["+"]]=10765;Y[1008]=14;Y[1009]=15;Y[p.q]=16;Y[p.Q]=10768;Y[p.qo]=17;Y[p.Ui]=10769;Y[p.e]=18;Y[p.E]=10770;Y[p.r]=19;Y[p.Pi]=10771;Y[p.t]=20;Y[p.Ri]=10772;Y[p.y]=21;Y[p.Wi]=10773;Y[p.oo]=22;Y[p.Si]=10774;Y[p.Dl]=23;Y[p.Hi]=10775;Y[p.en]=24;Y[p.Ni]=10776;Y[p.p]=25;Y[p.Oi]=10777;Y[p["["]]=26;Y[p["{"]]=10778;Y[p["]"]]=27;Y[p["}"]]=10779;Y[13]=28;Y[1017]=29;Y[p.ve]=30;Y[p.ue]=10782;Y[p.lo]=31;Y[p.Qi]=10783;
Y[p.d]=32;Y[p.Di]=10784;Y[p.Al]=33;Y[p.Ei]=10785;Y[p.Bl]=34;Y[p.Fi]=10786;Y[p.Cl]=35;Y[p.Gi]=10787;Y[p.Tm]=36;Y[p.Ii]=10788;Y[p.k]=37;Y[p.Ji]=10789;Y[p.Um]=38;Y[p.Ki]=10790;Y[p[";"]]=39;Y[p[":"]]=10791;Y[p["'"]]=40;Y[p['"']]=10792;Y[p["`"]]=41;Y[p["~"]]=10793;Y[1016]=42;Y[p["\\"]]=43;Y[p["|"]]=10795;Y[p.z]=44;Y[p.ng]=10796;Y[p.x]=45;Y[p.Vi]=10797;Y[p.ql]=46;Y[p.Ci]=10798;Y[p.po]=47;Y[p.Ti]=10799;Y[p.ol]=48;Y[p.Bi]=10800;Y[p.n]=49;Y[p.Mi]=10801;Y[p.Ym]=50;Y[p.Li]=10802;Y[p[","]]=51;Y[p["<"]]=10803;
Y[p["."]]=52;Y[p[">"]]=10804;Y[p["/"]]=53;Y[p["?"]]=10805;Y[3016]=54;Y[1044]=55;Y[1018]=56;Y[1032]=57;Y[1020]=58;Y[1112]=59;Y[1113]=60;Y[1114]=61;Y[1115]=62;Y[1116]=63;Y[1117]=64;Y[1118]=65;Y[1119]=66;Y[1120]=67;Y[1121]=68;Y[1144]=69;Y[1145]=70;Y[1036]=71;Y[1038]=72;Y[1033]=73;Y[1109]=74;Y[1037]=75;Y[1101]=76;Y[1039]=77;Y[1107]=78;Y[1035]=79;Y[1040]=80;Y[1034]=81;Y[1045]=82;Y[1046]=83;Y[4027]=84;Y[1122]=87;Y[1123]=88;Y[1091]=91;Y[1093]=93;Y[1224]=91;Y[tm]=7470;Y[4008]=7494;Y[4046]=3677523;
Y[4045]=3677522;Y[4013]=3677468;l=qm.prototype;
l.Pb=function(a,b,c,d){var e=this,f=a+"-"+b;if(void 0===this.qa[f])switch(b){case "kbd":return c.onkeydown=function(a){return ym(e,a,!0)},c.onkeypress=function(a){a=a||window.event;a=a.which||a.keyCode;e.L="";var b=!Y[a]||!!(e.xc&128);b||zm(e,a,!0);return b},c.onkeyup=function(a){return ym(e,a,!1)},!0;case "caps-lock":return this.qa[f]=c,c.onclick=function(){e.X&&e.X.wd();zm(e,1020,!0)},!0;case "num-lock":return this.qa[f]=c,c.onclick=function(){e.X&&e.X.wd();zm(e,1144,!0)},!0;case "scroll-lock":return this.qa[f]=
c,c.onclick=function(){e.X&&e.X.wd();zm(e,1145,!0)},!0;default:var g=b.toUpperCase().replace(/-/g,"_");if(void 0!==vm[g]&&"button"==a)return this.qa[f]=c,c.onclick=function(a,b,c){return function(){a.X&&a.X.wd();Am(a,c,!0);zm(a,c,!0)}}(this,g,vm[g]),!0;if(void 0!==wm[b])return this.fa++,this.qa[f]=c,a=function(a,b,c){return function(){zm(a,c)}}(this,b,wm[b]),b=function(a,b,c){return function(){Bm(a,c)}}(this,b,wm[b]),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=a,c.onmouseup=
c.onmouseout=b),!0;if(d)return this.qa[f]=c,c.onclick=function(){e.X&&e.X.wd();d&&!e.L&&(e.L=d,Cm(e,300))},!0}return!1};function Dm(a,b,c){if(a.fa){for(var d in da)if(b==da[d]){b=+d;(d=ca[d])&&(b=d);break}for(var e in wm)if((d=wm[e]==b)||(d=b,d>=p.ve&&d<=p.z&&(d-=p.ve-p.ue),d=wm[e]==d),d){(a=a.qa["key-"+e])&&void 0!==c&&(a.style.color=c?"#ffffff":"#000000",a.style.backgroundColor=c?"#000000":"#ffffff");break}}}l.Ic=function(a,b,c,d){this.X=a;this.ga=b;this.F=c;this.ha=d;this.N=Jb(a,"ChipSet")};
function rm(a,b){var c=0;a.ja=null;"string"==typeof b&&(a.ja=b.toUpperCase(),c=sm.indexOf(a.ja),0>c&&(c=0));if(b=sm[c])a.ra=parseInt(b.substr(2),10)}function Xl(a){y(a,"keyboard reset",65792);a.A=[];Yl(a,170)}function Tl(a,b,c){a.aa!==c&&(a.aa=a.ea=c)&&(a.U=!0);a.W!==b&&(a.W=b)&&!a.ea&&am(a,!0);a.W&&a.ea&&(Xl(a),a.ea=!1)}function Yl(a,b){a.N&&(a.A.unshift(b),a.U=!0,$l(a.N,b))}
function Ul(a){var b=0;a.A.length&&a.U&&(b=a.A[0],a.N&&$l(a.N,b));z(a)&&y(a,b?"scan code "+u(b)+" available":"no scan codes available")}function Rl(a){var b=0;a.A.length&&(b=a.A[0]);z(a)&&y(a,"scan code "+u(b)+" delivered");return b}function am(a,b){0<a.A.length&&(a.A.shift(),(a.U=b)&&(a.A.length&&a.N?$l(a.N,a.A[0]):b=!1),z(a)&&y(a,"scan codes shifted, notify "+(b?"true":"false")))}l.hc=function(a,b){return!b&&(this.reset(),a&&this.restore&&!this.restore(a))?!1:!0};
l.gc=function(a){return a?this.save():!0};l.reset=function(){if(!this.ja&&this.N)switch(this.N.ja){case 5150:case 5160:rm(this,sm[0]);break;default:rm(this,sm[1])}Em(this);this.xc=this.C=0;this.A=[];this.U=!0;this.L=""};l.save=function(){var a=new qf(this),b=[];b[0]=this.aa;b[1]=this.W;a.set(0,b);return a.data()};l.restore=function(a){return Em(this,a[0])};function Em(a,b){var c=0;b||(b=[]);a.aa=a.U=b[c++];a.W=b[c];a.V=0;return!0}
function Cm(a,b){if(0<a.L.length){var c=a.L.charCodeAt(0);10==c&&(c=13);a.L=a.L.substr(1);zm(a,c,!0)}0<a.L.length&&setTimeout(function(a){return function(){Cm(a,b)}}(a),b)}
function Am(a,b,c,d){if(Y[b]){var e=Math.floor(b/1E3)&2;if(b=um[b]||0){!e||b&85||(b>>=1);if(b&3584){if(!1===d)return!0;d=null}null==d?d=!((c?a.C:a.xc)&b):d||b&255&&(b=255);if(c){a.C&=~b;d&&(a.C|=b);c=b;var f,g;for(g in xm)d="led-"+g,e=xm[g],c&&c!=e||!(f=a.qa[d])||(f.style.backgroundColor=a.C&e?"#00ff00":"#000000")}else a.xc&=~b,d&&(a.xc|=b);return!0}}return!1}
function zm(a,b,c){if(Y[b]&&a.F&&a.F.la.Ib){um[b]&&a.B.length&&0<a.B[0].Kd&&(a.B[0].Kd=0);for(var d,e=0;e<a.B.length;e++)if(d=a.B[e],d.Pe==b){if(!c||0<=d.Kd){e=-1;break}0<e&&(0<a.B[0].Kd&&(a.B[0].Kd=0),a.B.splice(e,1));break}0>e||(e==a.B.length&&(d={},d.Pe=b,d.xc=a.xc,Dm(a,b,!0),e++),0<e&&a.B.splice(0,0,d),d.Hf=!0,d.Kd=c?-1:um[b]?0:1,Fm(a,d))}}
function Bm(a,b,c){if(!Y[b]||!(c||a.F&&a.F.la.Ib))return!1;for(var d=!1,e=0;e<a.B.length;e++){var f=a.B[e];if(f.Pe==b||f.Pe==da[b]){a.B.splice(e,1);f.Zk&&clearTimeout(f.Zk);f.Hf&&!c&&Gm(a,f.Pe,!1);Dm(a,b,!1);d=!0;break}}!a.B.length&&a.ka&&(Am(a,1020),a.ka=!1);return d}function Fm(a,b){if(!a.F||!a.F.la.Ib)Bm(a,b.Pe,!0);else if(Gm(a,b.Pe,b.Hf)&&b.Kd){var c;if(0>b.Kd){if(!b.Hf){Bm(a,b.Pe);return}b.Hf=!1;c=a.ua}else c=1==b.Kd++?500:100;b.Zk=setTimeout(function(a){return function(){Fm(a,b)}}(a),c)}}
function Hm(a,b,c){var d=b;if(b>=p.ue&&b<=p.ng)!(a.xc&515)==c&&(d=b+(p.ve-p.ue));else if(b>=p.ve&&b<=p.z)!!(a.xc&515)==c&&(d=b-(p.ve-p.ue));else if(!!(a.xc&3)==c){if(a=da[b])d=a}else if(a=ca[b])d=a;return d}l.Mg=function(a){a||(this.xc&=-256)};
function ym(a,b,c){var d=!0,e=!1,f=!1,g=b.keyCode,h=Hm(a,g,!0);a.kh&&h==p["`"]&&(g=h=27);if(Y[g+1E3])if(h+=1E3,2==b.location&&(h+=2E3),Am(a,h,!1,c)){if(20==g||144==g||145==g)a.pa||(c=e=!0);if(!(c||91!=g&&93!=g))for(var k=0;k<a.B.length;k++){var m=a.B[k];m.Hf=!1;0<m.Kd&&(m.Kd=0)}}else 8==g&&8==(a.xc&40)&&(h=4008),d=!1;else if(Y[h]&&a.xc&60&&(d=!1),d&&c||a.xc&192)f=!0;d||b.preventDefault();f||a.ia&&d||(c?zm(a,h,e):Bm(a,h)||(b=Hm(a,g,!1),b!=h&&Bm(a,b)));return d}
function Gm(a,b,c){var d=!1;Am(a,b,!0,c);var e=Y[b]||Y[b+1E3];if(void 0!==e){14==e&&40==(a.xc&40)&&(e=83);var d=[],f=e&255;if(83<f&&83==a.ra)return!1;d.push(f|(c?0:128));for(b=b>=p.ue&&b<=p.ng||b>=p.ve&&b<=p.z;e>>>=8;){var g=0,h=e&255;224==f||225==f?d.push(f|(c?0:128)):(42==h?a.C&3||a.C&512&&b||(g=h):29==h?a.C&12||(g=h):56==h?a.C&48||(g=h):d.push(f|(c?0:128)),g&&(c?d.unshift(g):d.push(g|128)))}for(c=0;c<d.length;c++)e=a,f=d[c],e.A&&(20>e.A.length?(z(e)&&y(e,"scan code "+u(f)+" buffered"),e.A.push(f),
1==e.A.length&&e.N&&$l(e.N,f)):(20==e.A.length&&e.A.push(255),y(e,"scan code buffer overflow")));d=!0}return d}Xa(function(){for(var a=tb(document,"pcx86","keyboard"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new qm(d);sb(d,c)}});
function Z(a,b,c,d,e){var f=this;this.rf=La("Gecko/");var g=["","moz","ms","webkit"];bb.call(this,"Video",a,Z,262144);this.ja=a.model;var h=Im[this.ja]||Im.mda;this.Ua=h[0];this.Dd=a.memory||0;this.eg=a.switches;this.va=a.mode;if(null==this.va||null==Jm[this.va])this.va=h[1];this.jd=a.charCols;this.je=a.charRows;if(void 0===this.jd||void 0===this.je)this.jd=Jm[this.va][0],this.je=Jm[this.va][1];this.ra=a.screenWidth;this.Da=a.screenHeight;this.Zf=a.scale;this.ro=12<=Math.round(this.ra/this.jd);this.ka=
b;this.ea=c;this.X=(this.cl=d)||b||null;b=a.smoothing;(c=eb.smoothing)&&(b="true"==c);if(null!=b)for(c=0;c<g.length;c++)if(d=(d=g[c])?d+"ImageSmoothingEnabled":"imageSmoothingEnabled",void 0!==this.ea[d]){this.ea[d]=b;break}this.kg=a.touchScreen;this.ke=Km;this.V=null;this.Ai=a.autoLock;this.ob=this.ac=0;this.Oa=[];this.Ca=Array(this.Ua==hm?256:16);this.qb=!1;if(this.ia=e)if(this.ia.Ye=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.ia.Ye){for(c=
0;c<g.length;c++)if(d=g[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){Lm(f,document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?!0:!1)},!1);break}for(c=0;c<g.length;c++)if(d=g[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){Lm(f,null)},!1);break}}this.X&&(this.X.onfocus=function(){return f.Mg(!0)},this.X.onblur=function(){return f.Mg(!1)},this.X.Fe=this.X.requestPointerLock||
this.X.mozRequestPointerLock||this.X.webkitRequestPointerLock,this.X.$k=this.X.exitPointerLock||this.X.mozExitPointerLock||this.X.webkitExitPointerLock,this.X.Fe&&(e=function(){f.Yf(document.pointerLockElement===f.X||document.mozPointerLockElement===f.X||document.webkitPointerLockElement===f.X)},"onpointerlockchange"in document?document.addEventListener("pointerlockchange",e,!1):"onmozpointerlockchange"in document?document.addEventListener("mozpointerlockchange",e,!1):"onwebkitpointerlockchange"in
document&&document.addEventListener("webkitpointerlockchange",e,!1)));if(a=a.fontROM)"json"!=ka(a)&&(a=Ba()+"/api/v1/dump?file="+a+"&format=bytes"),Aa(a,null,!0,function(a,b,c){Mm(f,a,b,c)})}jb(Z);
var hm=7,Im={mda:[1,7],cga:[3,3],ega:[5,3],vga:[hm,3]},Nm={2:{Ig:15700,Hg:208,Og:85,Pg:96},3:{Ig:18432,Hg:364,Og:85,Pg:96},4:{Ig:21850,Hg:364,Og:85,Pg:96},7:{Ig:16700,Hg:480,Og:85,Pg:83}},Om={6:[1,3,!0],7:[2,3,!0],8:[6,3,!0],9:[4,3,!0],10:[3,1,!0],11:[3,2,!0],0:[1,3,!1],1:[2,3,!1],2:[6,3,!1],3:[4,3,!1],4:[3,1,!1],5:[3,2,!1]},Jm=[,[40,25,1,0,3],,[80,25,1,0,3],[320,200,8,192],,[640,200,16,192],[80,25,1,0,1]];Jm[13]=[320,200,8];Jm[14]=[640,200,8];Jm[15]=[640,350,8];Jm[16]=[640,350,8];
Jm[17]=[640,480,8];Jm[18]=[640,480,8];Jm[19]=[320,200,1];Jm[20]=[320,240,4];Jm[21]=[320,400,4];Jm[0]=Jm[1];Jm[2]=Jm[3];Jm[5]=Jm[4];
var Pm=[[0,0,0,255],[127,192,127,255],[127,192,127,255],[127,255,127,255],[127,255,127,255]],Qm=[0,1,2,2,2,2,2,2,0,3,4,4,4,4,4,4],Rm=[[0,0,0,255],[0,0,170,255],[0,170,0,255],[0,170,170,255],[170,0,0,255],[170,0,170,255],[170,85,0,255],[170,170,170,255],[85,85,85,255],[85,85,255,255],[85,255,85,255],[85,255,255,255],[255,85,85,255],[255,85,255,255],[255,255,85,255],[255,255,255,255]],Sm=[2,4,6],Tm=[3,5,7],Um=[0,1,2,3,4,5,20,7,56,57,58,59,60,61,62,63],Vm=[0,255,65280,65535,16711680,16711935,16776960,
16777215,-16777216,-16776961,-16711936,-16711681,-65536,-65281,-256,-1],Wm=[0];Wm[128]=1;Wm[32768]=2;Wm[32896]=3;Wm[8388608]=4;Wm[8388736]=5;Wm[8421376]=6;Wm[8421504]=7;Wm[-2147483648]=8;Wm[-2147483520]=9;Wm[-2147450880]=10;Wm[-2147450752]=11;Wm[-2139095040]=12;Wm[-2139094912]=13;Wm[-2139062272]=14;Wm[-2139062144]=15;
function Xm(a,b,c,d){if(void 0!==b&&(!c||c.length)){this.video=a;var e=Ym[b],f=a.ya||e[5];if(!c||6>c.length)c=[!1,0,null,null,0,Array(5>b?Zm:$m)];this.ha=a.ha;this.type=e[0];this.port=e[1];this.Ua=b;this.ob=e[2];this.ac=e[3];this.Dd=d||e[4];65536<=this.Dd&&720896<=this.ob&&(this.ac=Math.min(this.Dd>>2,32768));this.Hc=c[0];this.fd=c[1];this.tf=c[2];this.ma=c[3];this.Ac=c[4]&255;this.Qg=c[4]>>8&255;this.mb=c[5];this.wh=Zm;this.pg=an;if(5<=b){this.wh=$m;this.pg=bn;(b=c[6])||(b=[!1,0,Array(20),0,3==f?
0:1,0,0,Array(5),0,0,0,Array(9),0,[this.ob,this.ac,this.Dd],Array(this.Dd>>2),-2147478512,0,-1,0,-1,0,-1,0,0,0,0,1,255,0,0,0,Array(256)]);this.Ze=b[0];this.Nd=b[1];this.Sc=b[2];this.$g=cn;this.Tg=b[3];this.vf=b[4];this.hg=b[5];this.ae=b[6];this.Me=b[7];this.bh=dn;this.Qk=b[8];this.Rk=b[9];this.$d=b[10];this.Zd=b[11];this.ah=en;this.Fb=b[12];d=b[13];"number"==typeof d&&(d=[this.ob,this.ac,d]);this.ob=d[0];this.ac=d[1];d=this.Dd>>2;if((this.rd=b[14])&&this.rd.length<d){for(var e=this.rd,g=0,h=Array(d),
k=0;k<e.length-1;){for(var m=e[k++],n=e[k++];m--;)h[g]=n,g+=2;g==d&&(g=1)}this.rd=h}(d=b[15])&&(d&-2147483648?d&=2147483647:d=fn[d&65280]|fn[d&255]);this.Vg(d);this.mi=b[16];this.rb=b[17];this.cd=b[18];this.Mb=b[19];this.Xf=b[20];this.Yd=b[21];this.pe=b[22];this.xh=b[23];this.yh=b[24];this.Ld=b[25];this.ni=this.qf=0;this.Ua==hm&&(this.vi=b[26],this.ui=b[27],this.od=b[28],this.Kc=b[29],this.Rg=b[30],this.uf=b[31])}f=Nm[f]||Nm[3];this.zh=a.F.Y.Id/f.Ig|0;this.an=this.zh*f.Og/100|0;this.Ch=this.zh*f.Hg|
0;this.cn=this.Ch*f.Pg/100|0;this.Eh=c[7]||0}}
var Zm=18,$m=25,an="HTOTAL HDISP HSYNC_POS HSYNC_WIDTH VTOTAL VTOTAL_ADJ VDISP VSYNC_POS INTERLACE_POS MAX_SCAN CURSOR_START CURSOR_END START_ADDR_HI START_ADDR_LO CURSOR_ADDR_HI CURSOR_ADDR_LO LIGHT_PEN_HI LIGHT_PEN_LO".split(" "),bn="HTOTAL HDISP_END HBLANK_START HBLANK_END HRETRACE_START HRETRACE_END VTOTAL OVERFLOW PRESET_SCAN MAX_SCAN CURSOR_START CURSOR_END START_ADDR_HI START_ADDR_LO CURSOR_ADDR_HI CURSOR_ADDR_LO VRETRACE_START VRETRACE_END VDISP_END OFFSET UNDERLINE VBLANK_START VBLANK_END MODE_CTRL LINE_COMPARE".split(" "),cn=
"PAL00 PAL01 PAL02 PAL03 PAL04 PAL05 PAL06 PAL07 PAL08 PAL09 PAL0A PAL0B PAL0C PAL0D PAL0E PAL0F MODE OVERSCAN PLANES HPAN".split(" "),dn=["RESET","CLOCKING","MAPMASK","CHARMAP","MEMMODE"],en="SRESET ESRESET COLORCMP DATAROT READMAP MODE MISC COLORDC BITMASK".split(" "),fn=[,,1024,5120];fn[16]=1280;fn[512]=0;fn[1024]=32;fn[1536]=96;fn[2560]=160;fn[3584]=224;fn[768]=16;fn[4096]=1;fn[8192]=2;fn[24576]=98;fn[40960]=162;fn[57344]=226;var gn=[];
gn[1024]=function(a){a+=this.C;return(this.controller.Fb=this.da[a])>>this.controller.mi&255};gn[17408]=function(a){return(this.controller.Fb=this.da[(a&-4)+this.C])>>((a&3)<<3)&255};gn[5120]=function(a){a+=this.C;var b=this.controller.Fb=this.da[a&-2];return(a&1?b>>8:b)&255};gn[1280]=function(a){a+=this.C;a=this.controller.Fb=this.da[a];for(var b=this.controller.yh,c=this.controller.xh&b,d=0,e=128;e;)(a&b)==c&&(d|=e),c>>>=1,b>>>=1,e>>=1;return d};
gn[0]=function(a,b){a+=this.C;b=(b|b<<8|b<<16|b<<24)&this.controller.Yd|this.controller.pe;b=b&this.controller.Mb|this.controller.Fb&~this.controller.Mb;b=b&this.controller.rb|this.da[a]&~this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};
gn[32]=function(a,b){a+=this.C;b=b>>this.controller.cd|b<<8-this.controller.cd&255;b=(b|b<<8|b<<16|b<<24)&this.controller.Yd|this.controller.pe;b=b&this.controller.Mb|this.controller.Fb&~this.controller.Mb;b=b&this.controller.rb|this.da[a]&~this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};
gn[96]=function(a,b){a+=this.C;b=b>>this.controller.cd|b<<8-this.controller.cd&255;b=(b|b<<8|b<<16|b<<24)&this.controller.Yd|this.controller.pe;b&=this.controller.Fb;b=b&this.controller.Mb|this.controller.Fb&~this.controller.Mb;b=b&this.controller.rb|this.da[a]&~this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};
gn[160]=function(a,b){a+=this.C;b=b>>this.controller.cd|b<<8-this.controller.cd&255;b=(b|b<<8|b<<16|b<<24)&this.controller.Yd|this.controller.pe;b|=this.controller.Fb;b=b&this.controller.Mb|this.controller.Fb&~this.controller.Mb;b=b&this.controller.rb|this.da[a]&~this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};
gn[224]=function(a,b){a+=this.C;b=b>>this.controller.cd|b<<8-this.controller.cd&255;b=(b|b<<8|b<<16|b<<24)&this.controller.Yd|this.controller.pe;b^=this.controller.Fb;b=b&this.controller.Mb|this.controller.Fb&~this.controller.Mb;b=b&this.controller.rb|this.da[a]&~this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};gn[4]=function(a,b){var c=(a&-4)+this.C;a=(a&3)<<3;b=b<<a&this.controller.rb|this.da[c]&~(255<<a&this.controller.rb);this.da[c]!=b&&(this.da[c]=b,this.Wa=!0)};
gn[16]=function(a,b){a+=this.C;var c=a&-2;b=(b|b<<8|b<<16|b<<24)&this.controller.Mb|this.controller.Fb&~this.controller.Mb;a=this.controller.rb&(c==a?16711935:-16711936);b=b&a|this.da[c]&~a;this.da[c]!=b&&(this.da[c]=b,this.Wa=!0)};gn[1]=function(a){a+=this.C;var b=this.da[a]&~this.controller.rb|this.controller.Fb&this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};
gn[17]=function(a){a+=this.C;var b=a&-2;a=this.controller.rb&(b==a?16711935:-16711936);a=this.da[b]&~a|this.controller.Fb&a;this.da[b]!=a&&(this.da[b]=a,this.Wa=!0)};gn[2]=function(a,b){a+=this.C;b=Vm[b&15];b=b&this.controller.Mb|this.controller.Fb&~this.controller.Mb;b=b&this.controller.rb|this.da[a]&~this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};
gn[98]=function(a,b){a+=this.C;b=Vm[b&15];b&=this.controller.Fb;b=b&this.controller.Mb|this.controller.Fb&~this.controller.Mb;b=b&this.controller.rb|this.da[a]&~this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};gn[162]=function(a,b){a+=this.C;b=Vm[b&15];b|=this.controller.Fb;b=b&this.controller.Mb|this.controller.Fb&~this.controller.Mb;b=b&this.controller.rb|this.da[a]&~this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};
gn[226]=function(a,b){a+=this.C;b=Vm[b&15];b^=this.controller.Fb;b=b&this.controller.Mb|this.controller.Fb&~this.controller.Mb;b=b&this.controller.rb|this.da[a]&~this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};gn[3]=function(a,b){a+=this.C;b=b>>this.controller.cd|b<<8-this.controller.cd&255;b=(b|b<<8|b<<16|b<<24)&this.controller.Mb;b=this.controller.Xf&b|this.controller.Fb&~b;b=b&this.controller.rb|this.da[a]&~this.controller.rb;this.da[a]!=b&&(this.da[a]=b,this.Wa=!0)};
function hn(a){var b=[];if(void 0!==a.Ua){b[0]=a.Hc;b[1]=a.fd;b[2]=a.tf;b[3]=a.ma;b[4]=a.Ac|a.Qg<<8;b[5]=a.mb;if(5<=a.Ua){var c=[];c[0]=a.Ze;c[1]=a.Nd;c[2]=a.Sc;c[3]=a.Tg;c[4]=a.vf;c[5]=a.hg;c[6]=a.ae;c[7]=a.Me;c[8]=a.Qk;c[9]=a.Rk;c[10]=a.$d;c[11]=a.Zd;c[12]=a.Fb;c[13]=[a.ob,a.ac,a.Dd];var d;if(d=a.rd){var e=0,f=[];if(void 0!==d[0])for(var g=0;2>g;g++)for(var h=g;h<d.length;){for(var k=d[h],m=h+2;m<d.length&&d[m]===k;)m+=2;f[e++]=m-h>>1;f[e++]=k;h=m}f.length<d.length&&(d=f)}c[14]=d;c[15]=a.Cg|-2147483648;
c[16]=a.mi;c[17]=a.rb;c[18]=a.cd;c[19]=a.Mb;c[20]=a.Xf;c[21]=a.Yd;c[22]=a.pe;c[23]=a.xh;c[24]=a.yh;c[25]=a.Ld;a.Ua==hm&&(c[26]=a.vi,c[27]=a.ui,c[28]=a.od,c[29]=a.Kc,c[30]=a.Rg,c[31]=a.uf);b[6]=c}b[7]=a.Eh}return b}function jn(a,b,c,d,e){if(d){var f,g="";for(f=0;f<e.length;f++){var h=d===a.mb?kn(a,f):d[f];g&&(g+="\n");g+=b+"["+r(f,2)+"]: "+pa(e[f],18)+(f===c?"*":" ")+r(h,255<h?4:2);null!=h&&(g+=" ("+h+".)")}a.ha.O(g)}else a.ha.O(b+": "+r(c,2))}Xm.prototype.wj=function(a){return[this.rd,a-this.ob]};
Xm.prototype.nh=function(){return this.A};Xm.prototype.Vg=function(a){if(null!=a&&a!=this.Cg){var b=a&65280,c=gn[b];c||b&4096&&(c=gn[4096]);var b=a&255,d=gn[b];d||b&16&&(d=gn[16]);this.A||(this.A=Array(6));this.A[0]=c;this.A[1]=d;this.Cg=a}};
function kn(a,b){var c=a.mb[b];if(null!=c&&5<=a.Ua){var d=0,e=0,f=0;switch(b){case 6:d=1;a.Ua==hm&&(e=32);break;case 10:5==a.Ua&&(d=32);break;case 16:d=4;a.Ua==hm&&(e=128);break;case 18:d=2;a.Ua==hm&&(e=64);break;case 21:d=8;a.Ua==hm&&(f=32);break;case 24:d=16,a.Ua==hm&&(f=64)}d&&(c|=a.mb[7]&d?256:0,c|=a.mb[7]&e?512:0,c|=a.mb[9]&f?512:0)}return c}var Ym=[,["MDA",948,720896,4096,0,3],,["CGA",980,753664,16384,0,2],,["EGA",980,753664,16384,65536,4]];Ym[hm]=["VGA",980,753664,16384,262144,7];var Km=0;
l=Z.prototype;
l.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;c=(c=Im[this.ja])&&c[0];3!==c&&(qc(b,this,ln),yc(b,this,mn));1!==c&&(qc(b,this,nn),yc(b,this,on));5<=this.Ua&&(qc(b,this,pn),yc(b,this,qn));this.Ua==hm&&(qc(b,this,rn),yc(b,this,sn));if(d){var e=this;Qk(d,262144,function(a){if(e.C)if(a[0]){var b=e.C;if(b.rd){var c,d,f,g=!1,q=8,A=8,F=-1,C=b.video.L>>3;for(c=0;c<a.length;c++){var D=a[c];if(c){var L=D.charAt(0);d=ea(D.substr(1),16);switch(L){case "l":q=d;break;case "n":1<=d&&8>=d&&(A=d,g=!0);break;
case "p":0<=d&&3>=d&&(F=d);break;case "w":d<C&&(C=d);break;default:b.ha.O("unrecognized argument: "+D)}}else f=ea(D,16)}void 0===f?f=b.B||0:f>=b.ob&&(f-=b.ob);a="";for(c=0;c<q;c++){D=r(b.ob+f)+":";for(d=0;d<A&&f<b.rd.length;d++)L=b.rd[f++],D+=" "+(0>F?r(L):fa(L>>(F<<3),8));g&&(f+=C-A);a&&(a+="\n");a+=D}a&&b.ha.O(a);b.B=f}else b.ha.O("no buffer")}else e.ha.O("BIOSMODE: "+u(e.Ga)),b=e.C,jn(b,"CRTC",b.Ac,b.mb,b.pg),5<=b.Ua&&(jn(b," GRC",b.$d,b.Zd,b.ah),jn(b," SEQ",b.ae,b.Me,b.bh),jn(b," ATC",b.Nd,b.Sc,
b.$g),jn(b," ATCINDX",b.Nd),b.ha.O(" ATCDATA: "+b.Ze),jn(b," FEAT",b.hg),jn(b," MISC",b.vf),jn(b," STATUS0",b.Tg)),jn(b," STATUS1",b.ma),1!=b.Ua&&3!=b.Ua||jn(b," MODEREG",b.fd),3==b.Ua&&jn(b," COLOR",b.tf),5<=b.Ua&&(b.ha.O(" LATCHES: "+r(b.Fb)),b.ha.O(" ACCESS: "+r(b.Cg,4)),b.ha.O("Use 'dump video [addr]' to dump video memory"));else e.ha.O("no active video card")})}if((this.B=Jb(a,"Keyboard"))&&this.ka){for(var f in this.qa)0<f.indexOf("lock")&&this.B.Pb("led",f,this.qa[f]);this.B.Pb(this.cl?
"textarea":"canvas","kbd",this.X)}this.Vc=9;(this.N=Jb(a,"ChipSet"))&&this.eg&&5==this.Ua&&(this.Vc=wk(this.eg,this.Vc));"mouse"==this.kg?(this.V=Jb(a,"Mouse"))&&tn(this,2):"keygrid"==this.kg&&this.B&&tn(this,1)};
l.Pb=function(a,b,c){var d=this;if(!this.qa[b])switch(this.qa[b]=c,b){case "fullScreen":return this.ia&&this.ia.Ye?c.onclick=function(){d.Ye()}:c.parentNode.removeChild(c),!0;case "lockPointer":return this.bl=c.textContent,this.X&&this.X.Fe?c.onclick=function(){d.Fe(!0)}:c.parentNode.removeChild(c),!0;case "refresh":return c.onclick=function(){un(d,!0)},!0}return!1};
l.Ye=function(){var a=!1;if(this.ia){if(this.ia.Ye){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.ra/this.Da;b>c&&(a=Math.round(c/b*100)+"%")}this.rf?(this.ka.style.width=a,this.ka.style.width=a,this.ka.style.display="block",this.ka.style.margin="auto"):(this.ia.style.width=a,this.ia.style.height="auto");this.ia.style.backgroundColor="black";this.ia.Ye();a=!0}this.X&&this.X.focus()}return a};
function Lm(a,b){!b&&a.ia&&(a.rf?a.ka.style.width=a.ka.style.height="":a.ia.style.width=a.ia.style.height="");y(a,"notifyFullScreen("+b+")",!0);a.B&&(a.B.kh=b)}l.Fe=function(a){var b=!1;this.X&&(a?this.X.Fe&&(this.X.Fe(),this.V&&this.V.Yf(!0),b=!0):this.X.$k&&(this.X.$k(),this.V&&this.V.Yf(!1),b=!0),this.X&&this.X.focus());return b};l.Yf=function(a){this.V&&(this.V.Yf(a),this.B&&(this.B.kh=a));var b=this.qa.lockPointer;b&&(b.textContent=a?"Press Esc to Unlock Pointer":this.bl)};
function tn(a,b){var c=a.X;c&&!a.ke&&(c.addEventListener("touchstart",function(b){vn(a,b,!0)},!1),c.addEventListener("touchmove",function(b){vn(a,b)},!0),c.addEventListener("touchend",function(b){vn(a,b,!1)},!1),a.ke=b,a.uc=a.Cc=a.lg=-1,a.Hd=!1,a.Xc=null,a.Gd=!1,a.so=function(){a.Gd=!0;a.V.he(wn,!0)})}l.Mg=function(a){this.B&&this.B.Mg(a)};
function vn(a,b,c){var d,e,f=0,g=0;e=a.ka;do isNaN(e.offsetLeft)||(f+=e.offsetLeft,g+=e.offsetTop);while(e=e.offsetParent);var h=a.ra/a.ka.offsetWidth,k=a.Da/a.ka.offsetHeight;b.targetTouches&&b.targetTouches.length?(d=b.targetTouches[0].pageX,e=b.targetTouches[0].pageY):(d=b.pageX,e=b.pageY);d=(d-f)*h;e=(e-g)*k;if(1==a.ke)d=d/(a.ra/3)|0,e=e/(a.Da/3)|0,1!=e?e?zm(a.B,1040,!0):zm(a.B,1038,!0):1!=d&&(d?zm(a.B,1039,!0):zm(a.B,1037,!0));else if(a.V){g=a.Hd;f=b.timeStamp-a.lg;!0===c?(a.Hd=500<f,a.lg=b.timeStamp,
a.Xc=setTimeout(a.so,500)):null!=a.Xc&&(clearTimeout(a.Xc),a.Xc=null);void 0===c&&(a.Hd=!1);g||b.preventDefault();if(!1===c){a.Gd?(a.V.he(wn,!1),a.Gd=!1,b=!0):b=!1;if(b)return;if(200>f){a.V.he(wn,!0);a.V.he(wn,!1);return}}if(c||0>a.uc||0>a.Cc)a.uc=d,a.Cc=e;c=Math.round(d-a.uc);b=Math.round(e-a.Cc);a.uc=d;a.Cc=e;a.V.Kf(c,b,a.uc,a.Cc)}}l.hc=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.gc=function(a){return a?this.save():!0};
l.reset=function(){var a=!0,b=0;this.N&&(b=+Yk(this.N,Ak,void 0));this.ja||(this.Ua=3==b?1:3);this.va=3;switch(this.Ua){case hm:b=7;break;case 5:var c=Om[this.Vc];c&&(b=c[0]);b||(b=4);break;case 1:b=3;this.va=7;break;default:b=2}this.ya!==b&&(this.ya=b,a=!0);this.C=null;this.pa=this.qd=new Xm(this,1);this.aa=this.Wc=new Xm(this,3);5>this.Ua?this.A=new Xm:(this.A=new Xm(this,this.Ua,null,this.Dd),xn(this));Xn(this);this.Ga=null;this.cb=this.ua=-1;this.Pa=0;Yn(this,this.va);if(this.C.ob&&a){a=this.C.ob+
this.Ub;for(b=this.C.ob;b<a;b+=2){var d=65536*Math.random()|0;4==this.ya||7==this.ya?(c=b>>1&255,d=d>>8&-129,d>>4==(d&15)&&(d^=15)):(c=d&255,d=(d&256?7:112)|8&d>>8);nc(this.ga,b,c|d<<8)}un(this,!0)}};function xn(a){a.A.vf&1?(a.pa=a.qd,a.aa=a.A):(a.pa=a.A,a.aa=a.Wc)}l.save=function(){var a=new qf(this);a.set(0,hn(this.qd));a.set(1,hn(this.Wc));a.set(2,[this.ya,this.va,this.Ga]);a.set(3,hn(this.A));return a.data()};
l.restore=function(a){var b=a[2];this.ya=b[0];this.va=b[1];this.Ga=b[2];this.C=null;this.pa=this.qd=new Xm(this,1,a[0]);this.aa=this.Wc=new Xm(this,3,a[1]);this.A=new Xm(this,this.Ua,a[3],this.Dd);this.A.Hc&&xn(this);Xn(this);if(!Zn(this))return!1;$n(this);return!0};
function Mm(a,b,c,d){if(d)a.Na("Unable to load font ROM (error "+d+": "+b+")");else{mb(a.ce,b,c);try{var e=eval("("+c+")"),f=e.bytes||e;if(!f.length){w("Empty font ROM: "+b);return}if(1==f.length){w(f[0]);return}if(8192==f.length)gm(a,f,[6144,0]);else if(2048==f.length)gm(a,f,[0]);else{a.Na("Unrecognized font data length ("+f.length+")");return}}catch(g){a.Na("Font ROM data error: "+g.message);return}(a.ea||a.ha)&&xb(a)}}
function ao(a,b){if(1==b)return a.Ca[0]=Rm[0],a.Ca[1]=Rm[7],a.Ca;if(2==b){var c=a.C.tf;if(a.C===a.A){var d=a.A.Sc[0],c=d&7;d&16&&(c|=8);18!=a.A.Sc[1]&&(c|=32)}a.Ca[0]=Rm[c&15];c=c&32?Tm:Sm;for(d=0;d<c.length;d++)a.Ca[d+1]=Rm[c[d]];return a.Ca}if(a.aa===a.Wc)return Rm;a.qb&&b&&!a.Ca[16]&&(a.qb=!1);if(!a.qb){var c=a.A,d=c.uf,e,f,g,h;if(8==b)for(e=0;256>e;e++)f=d[e]||0,g=f<<2&252,h=f>>4&252,f=f>>10&252,a.Ca[e]=[g,h,f,255];else{var k=d&&d[255];b=null!=c.Sc[15]?c.Sc:Um;for(e=0;16>e;e++)f=b[e]&63,k?(f|=
(c.Sc[20]&12)<<4,c.Sc[16]&128&&(f&=-49,f|=(c.Sc[20]&3)<<4),f=d[f],g=f<<2&252,h=f>>4&252,f=f>>10&252):(g=(f&4?170:0)|(f&32?85:0),h=(f&2?170:0)|(f&16?85:0),f=(f&1?170:0)|(f&8?85:0)),a.Ca[e]=[g,h,f,255]}a.qb=!0}return a.Ca}function gm(a,b,c,d){a.Uc=b;a.Jb=c;a.Tb=d}
function Xn(a,b){var c=!1;if(window&&a.Uc&&(!b||a.U)){b=0;var d=a.Tb?a.Tb:8,e=ao(a);null!=a.Jb[0]&&bo(a,3,a.Jb[0],b,d,8,a.Uc,e)&&(c=!0);b=a.Tb?0:2048;d=a.Tb?a.Tb:9;null!=a.Jb[1]&&(bo(a,1,a.Jb[1],b,d,14,a.Uc,Pm,Qm)&&(c=!0),a.Tb&&bo(a,a.Ua,a.Jb[1],0,a.Tb,14,a.Uc,e)&&(c=!0))}return c}function bo(a,b,c,d,e,f,g,h,k){var m=!1;null!=c&&(co(a,b,c,d,e,f,g,h,k)&&(m=!0),a.ro&&co(a,b<<1,c,d,e,f,g,h,k)&&(m=!0));return m}
function co(a,b,c,d,e,f,g,h,k){var m=!1,n=b&1?0:1,t=a.Oa[b],q=16>h.length?h.length:16;t||(t={Pc:e<<n,Qc:f<<n,Re:Array(q),Yi:h.slice(0,q),Af:k,Zg:Array(q)});for(k=0;k<q;k++){var A=h[k],F=t.Re[k]?t.Yi[k]:[];if(A[0]!==F[0]||A[1]!==F[1]||A[2]!==F[2]){var m=t,F=k,C=n,D=c,L=d,G=e,ga=f,S=g,ab=[0,0,0,0],la=document.createElement("canvas");la.width=m.Pc<<4;la.height=m.Qc<<4;var Ja=la.getContext("2d"),Da,Wa,Ka,Vb=8>ga||!L?ga:8,Pa=Ja.createImageData(m.Pc,m.Qc);for(Da=0;256>Da;Da++){for(Ka=0;Ka<ga;Ka++)for(var Ud=
m.Af&&F&1&&Ka>=ga-2,Rc=S[Ka<Vb?D+Da*Vb+Ka:L+Da*Vb+Ka-Vb],Vd=0;Vd<=C;Vd++)for(Wa=0;Wa<G;Wa++){var Ge=Wa<<C,Wd=(Ka<<C)+Vd,He=Ud||Rc&128>>(8<=Wa&&192<=Da&&223>=Da?7:Wa)?A:ab;eo(Pa,Ge,Wd,He);C&&eo(Pa,Ge+1,Wd,He)}Ja.putImageData(Pa,(Da&15)*m.Pc,(Da>>4)*m.Qc)}m.Re[F]="#"+r(A[0],2)+r(A[1],2)+r(A[2],2);m.Yi[F]=A;m.Zg[F]=la;m=!0}}a.Oa[b]=t;return m}function fo(a){0<a.Pa||0<=a.ua?0>a.cb&&(a.cb=0):a.cb=-1}
function $n(a){if(a.U){for(var b=10;15>=b;b++)if(null==a.C.mb[b])return;var c=a.C.mb[10],b=c&31,d=a.C.mb[11]&31,e=a.C.mb[9]&31,f=!1;a.C===a.A&&(f=!0,7!=e||4!=b||d||(d=7));if(c&32||b>d&&!f||b>e)go(a);else{c=a.C.mb[15]+((a.C.mb[14]&63)<<8);a.ua!=c&&(go(a),a.ua=c);d=d-b+1;if(a.mg!=b||a.Ee!=d)a.mg=b,a.Ee=d;a.Ya=e+1;fo(a)}}}
function go(a){if(0<=a.ua){if(void 0!==a.fa){var b=a.fa[a.ua];if(b&131072){var b=b&-131073,c=a.ua%a.L,d=a.ua/a.L|0;a.U&&a.Oa[a.U]&&(a.gb&&ho(a,c,d,b,a.gb),ho(a,c,d,b));a.fa[a.ua]=b}}a.ua=-1}}
function io(a){var b,c=a.C;a.hf=!1;var d=c.Zd[5];if(null!=d){b=1024;var e=0,f=c.Zd[3]&31;switch(d&3){case 0:if(f){e=32;switch(f&24){case 8:e=96;break;case 16:e=160;break;case 24:e=224}c.cd=f&7}break;case 1:e=1;break;case 2:switch(f&24){default:e=2;break;case 8:e=98;break;case 16:e=162;break;case 24:e=226}break;case 3:a.Ua==hm&&(e=3,c.cd=f&7)}d&8&&(b=1280);c=c.Me[4];null!=c&&(c&4||(b|=4096,e|=16),d&64&&(c&8&&(b|=16384,e|=4),a.hf=!0));b|=e}return b}
function jo(a,b){var c=a.C;return c&&null!=b&&b!=c.Cg?(c.Vg(b),a.ga.Vg(c.ob,c.ac,c.nh(),!0),!0):!1}
function Zn(a,b){var c,d=a.Ga,e=a.C;if(e)if(1==e.Ua)d=7;else if(5<=e.Ua){var d=null,f=e.Dd>>2,g=32768<f?32768:f,h=e.Zd[6];if(null!=h){switch(h&12){case 0:e.ob=655360;e.ac=f;d=255;break;case 4:e.ob=655360;e.ac=f;d=3==a.ya?15:16;break;case 8:e.ob=720896;e.ac=g;d=7;break;case 12:e.ob=753664,e.ac=g,d=3==a.ya?2:3}c=80==(e.Zd[5]&80);!c||e.ob==a.ob&&e.ac==a.ac||(b=!0);var f=kn(e,6),g=e.mb[9],k=e.mb[23],m=e.Me[1]&8;255!=d&&(h&1?655360==e.ob||c||k&1?e.Zd[5]&64?d=g&31?143>=e.mb[18]?19:20:21:g&128||350>f?d=
m?13:14:480<=f&&(d=3==a.ya?17:18):d=m?7-d:6:d-=m?2:0);c=io(a)}}else e.fd&8&&(e.fd&2?(d=e.fd&16?6:5,e.fd&4||--d):(d=e.fd&1?3:1,e.fd&4&&--d));else a.Ga=null,null==d&&(d=a.va);if(!Yn(a,d,b))return!1;jo(a,c);return!0}
function Yn(a,b,c){if(null!=b&&(b!=a.Ga||c)){a.Wg=0;a.Ga=b;a.qb=!1;b=a.C||(7==b?a.pa:a.aa);if(b!=a.C||b.ob!=a.ob||b.ac!=a.ac){go(a);if(a.ob){if(!gc(a.ga,a.ob,a.ac))return!1;a.C&&(a.C.Hc=!1)}a.C=b;b.Hc=!0;a.ob=b.ob;a.ac=b.ac;if(!Ub(a.ga,b.ob,b.ac,3,b===a.A?b:null))return!1}a:{a.U=0;a.L=a.jd;a.W=a.je;a.Db=a.L;a.hd=Jm[7][2];b=0;if(c=Jm[a.Ga])a.L=c[0],a.W=c[1],a.hd=c[2],b=c[3],a.U=c[4],4!=a.ya&&7!=a.ya||a.C!==a.A||3!=a.U||(7==(a.A.mb[9]&31)?a.W=350>kn(a.A,18)?43:50:a.U=a.Ua);a.dg=a.L*a.W|0;a.ag=a.dg/
a.hd|0;a.Ub=a.ag;a.sd=0;void 0!==b&&(a.Ub=(a.Ub<<1)+b|0,a.sd=a.Ub+b>>1);if(a.Oa.length){a.Ja=a.ra/a.L|0;a.Ka=a.Da/a.W|0;if(a.U){b=a.Oa[a.U];if(!b)break a;c=a.Oa[a.U<<1];a.Zf&&80==a.L?c&&a.Ja>=3*c.Pc>>2&&(a.U<<=1,b=c):(c&&a.Ja>=c.Pc&&(a.U<<=1,b=c),a.Zf||(a.Ja=b.Pc,a.Ka=b.Qc));a.bc=a.tc=0;b&&(a.bc=a.L*b.Pc,a.tc=a.W*b.Qc)}else a.Ja=a.Ka=1,a.bc=a.L,a.tc=a.W;a.sb=a.ea.createImageData(a.bc,a.tc);a.fb=document.createElement("canvas");a.fb.width=a.bc;a.fb.height=a.tc;a.gb=a.fb.getContext("2d");a.le=a.me=
0;a.Cd=a.ra;a.Fd=a.Da;b=a.ra-a.L*a.Ja;c=a.Da-a.W*a.Ka;0<b&&(a.le=b>>1,a.Cd-=b);0<c&&(a.me=c>>1,a.Fd-=c);if(b||c)a.ea.fillStyle=a.ka.style.backgroundColor,a.ea.fillRect(0,0,a.ra,a.Da)}}ko(a,!0);un(a)}return!0}function eo(a,b,c,d){b=(b+c*a.width)*d.length;a.data[b]=d[0];a.data[b+1]=d[1];a.data[b+2]=d[2];a.data[b+3]=d[3]}function lo(a){a.Pa=-1;a.Fa=!1;var b=a.ag;if(void 0===a.fa||a.fa.length!=b)a.fa=Array(b)}function ko(a,b){b||(a.qb=!1);lo(a)}
function ho(a,b,c,d,e){var f=d&255,g=d>>8;d=g&15;var h=a.Oa[a.U];h.Af&&(d=h.Af[d]);var k=g>>4&15;h.Af&&(k=h.Af[k]);e?(b*=h.Pc,c*=h.Qc,e.fillStyle=h.Re[k],e.fillRect(b,c,h.Pc,h.Qc)):(b=b*a.Ja+a.le,c=c*a.Ka+a.me,a.ea.fillStyle=h.Re[k],a.ea.fillRect(b,c,a.Ja,a.Ka));g&256&&(k=(f&15)*h.Pc,f=(f>>4)*h.Qc,e?e.drawImage(h.Zg[d],k,f,h.Pc,h.Qc,b,c,h.Pc,h.Qc):a.ea.drawImage(h.Zg[d],k,f,h.Pc,h.Qc,b,c,a.Ja,a.Ka));g&512&&(f=a.mg,g=a.Ee,e?(a.Ya&&a.Ya!==h.Qc&&(f=f*h.Qc/a.Ya|0,g=g*h.Qc/a.Ya|0),e.fillStyle=h.Re[d],
e.fillRect(b,c+f,h.Pc,g)):(a.Ya&&a.Ya!==a.Ka&&(f=f*a.Ka/a.Ya|0,g=g*a.Ka/a.Ya|0),a.ea.fillStyle=h.Re[d],a.ea.fillRect(b,c+f,a.Ja,g)))}
function un(a,b){if(a.la.ic){var c=!1,d=a.C;d&&(d!==a.A?d.fd&8&&(c=!0):d.Nd&32&&(c=!0));if(c||b){if(b)lo(a);else if(void 0===a.fa)return;var e=!1;!(b||++a.Wg&15)&&0<=a.cb&&(a.cb++,e=!0);var f=0,g=a.dg,h=a.ob,c=h,k=c+a.ac;19<=a.Ga&&(h=c=655360,k=c+65536);if(mo(a,d)&8||d.qf&&d.qf<d.ni){var m=(d.mb[12]<<8)+d.mb[13]|0;d.Ld!==m&&(d.Ld=m,ko(a));d.qf=0}m=d.Ld;a.U&&(m<<=1);c+=m;m=a.Ub;5<=a.Ua&&d.mb[19]&&d.mb[19]<<1!=d.mb[1]+1&&(a.Db=d.mb[19]<<(a.U?1:d.mb[20]&64?3:4),m=(a.Db*(a.W-1)+a.L)/a.hd|0,7>=a.Ga&&(m<<=
1));c+m>k&&(m=k-c,0>m&&(m=0));k=c+m;if(b=!b&&a.Fa){b=a.ga;for(var n=!0,t=c>>>b.La;0<m&&t<b.sa.length;)b.sa[t].Wa&&(b.sa[t].Wa=n=!1,b.sa[t].tj=!0),m-=b.Sb,t++;b=n}if(b){if(!e)return;if(!a.Pa){f=a.ua-d.Ld;if(0>f)return;g=f+1}}if(a.U){if(a.Oa[a.U]){d=f;f=0;e=a.Pa=0;h=1048575;m=a.C.fd&32;5<=a.Ua&&(m=a.C.Sc[16]&8);b=a.ua-a.C.Ld;m&&(e=32768,h&=~e,a.cb&2||(h&=-65537));for(c+=d<<1;c<k&&d<g;)m=mc(a.ga,c),m|=65536,m&e&&(a.Pa++,m&=h),d==b&&(m|=a.cb&1?131072:0),a.Fa&&m===a.fa[d]||(ho(a,d%a.L,d/a.L|0,m,a.gb),
a.fa[d]=m,f++),c+=2,d++;a.Fa=!0;f&&a.gb&&a.ea.drawImage(a.fb,0,0,a.bc,a.tc,a.le,a.me,a.Cd,a.Fd);fo(a)}}else if(a.sd){var g=k,q,k=c,d=a.Pa=0,f=a.hd,e=16==f?65536:196608,h=16==f?1:2;b=ao(a,h);for(var n=m=0,t=a.L,A=0,F=a.W,C=0;k<g;){q=mc(a.ga,k);if(a.Fa&&q===a.fa[d])m+=f;else{a.fa[d]=q;q=q>>8|(q&255)<<8;var D=e,L=16;m<t&&(t=m);for(var G=0;G<f;G++){var ga=(q&(D>>=h))>>(L-=h);eo(a.sb,m++,n,b[ga])}m>A&&(A=m);n<F&&(F=n);n>=C&&(C=n+1)}k+=2;d++;if(m>=a.L){m=0;n+=2;if(n>a.W)break;n==a.W&&(n=1,k=c+a.sd)}}a.Fa=
!0;t<a.L&&(a.gb.putImageData(a.sb,0,0,t,F,A-t,C-F),a.ea.drawImage(a.fb,0,0,a.L,a.W,0,0,a.ra,a.Da))}else if(a.hf){g=h;f=a.Pa=0;e=ao(a,8);h=a.C.rd;m=b=0;n=a.L;t=0;A=a.W;F=0;C=a.C.Me[4]&8?4:1;q=a.C.Sc[19]&15;for(D=a.Db>a.L?a.Db-a.L-q>>3:0;c<k;){d=h[c-g];G=4;q||(a.Fa&&d===a.fa[f]?(b+=G,G=0):a.fa[f]=d,f++);if(G){b<n&&(n=b);for(L=0;L<G;L++)eo(a.sb,b++,m,e[d&255]),d>>=8;b>t&&(t=b);m<A&&(A=m);m>=F&&(F=m+1)}c+=C;if(b>=a.L){b=0;if(++m>a.W)break;c+=D}}q||(a.Fa=!0);n<a.L&&(a.gb.putImageData(a.sb,0,0,n,A,t-n,
F-A),a.ea.drawImage(a.fb,0,0,a.L,a.W,0,0,a.ra,a.Da))}else{g=h;d=a.Pa=0;f=ao(a);e=a.C.rd;b=h=0;m=a.L;n=0;t=a.W;A=0;F=a.C.Sc[19]&15;for(C=a.Db>a.L?a.Db-a.L-F>>3:0;c<k;){q=c++-g;q=e[q];L=8;F?h?(D=a.L-h,L>D&&(L=D)):(q<<=F,L-=F,a.Fa=!1):(a.Fa&&q===a.fa[d]?(h+=L,L=0):a.fa[d]=q,d++);if(L){h<m&&(m=h);for(D=0;D<L;D++)G=Wm[q&2155905152]||0,eo(a.sb,h++,b,f[G]),q<<=1;h>n&&(n=h);b<t&&(t=b);b>=A&&(A=b+1)}if(h>=a.L){h=0;if(++b>a.W)break;c+=C}}F||(a.Fa=!0);m<a.L&&(a.gb.putImageData(a.sb,0,0,m,t,n-m,A-t),a.ea.drawImage(a.fb,
0,0,a.L,a.W,0,0,a.ra,a.Da))}}}}function mo(a,b){var c=0;a=cd(a.F)-b.Eh;0>a&&(b.Eh=a,a=-a|0);a%b.zh>b.an&&(c|=1);a%b.Ch>b.cn&&(c|=9);b.ni=a/b.Ch|0;return c}l.um=function(a,b){return no(this,this.pa,a,b)};l.Vn=function(a,b,c){var d=this.pa;d.Qg=d.Ac;d.Ac=b&31;x(this,a,b,c,"CRTC.INDX")};l.tm=function(a,b){return oo(this,this.pa,a,b)};l.Un=function(a,b,c){po(this,this.pa,a,b,c)};l.vm=function(a,b){return qo(this,this.pa,b)};l.Wn=function(a,b,c){a=this.pa;x(this,a.port+4,b,c,"MODE");a.fd=b;Zn(this,!1)};
l.wm=function(a,b){return ro(this,this.pa,b)};l.Mk=function(a,b,c){this.A.hg=this.A.hg&-4|b&3;x(this,a,b,c,"FEAT")};l.Tl=function(a,b){a=this.A.Nd;b&&!z(this)||x(this,960,null,b,"ATC.INDX",a);return a};l.kl=function(a,b){a=this.A.Sc[this.A.Nd&31];b&&!z(this)||x(this,960,null,b,"ATC."+this.A.$g[this.A.Nd&31],a);return a};
l.Lk=function(a,b,c){var d=this.A,e=d.Nd&32;if(d.Ze){d.Ze=!1;var f=d.Nd&31;if(16<=f||!e)c&&!z(this)||x(this,a,b,c,"ATC."+d.$g[f]),d.Sc[f]=b,ko(this,!1)}else d.Nd=b,x(this,a,b,c,"ATC.INDX"),d.Ze=!0,b&32&&!e&&Xn(this,!0)&&un(this,!0),a=(d.mb[12]<<8)+d.mb[13]|0,d.Ld!=a&&(d.Ld=a,ko(this)),d.qf=0};
l.Gm=function(a,b){a=0;if(5==this.Ua)a=3-((this.A.vf&12)>>2),a=(this.Vc&1<<a)<<4-a;else{var c=this.A.uf[0];45!=(c&63)&&2880!=(c&4032)&&184320!=(c&258048)&&(a|=16)}a|=this.A.Tg&-17;this.A.Tg=a;x(this,962,null,b,"STATUS0",a);return a};l.Xn=function(a,b,c){this.A.vf=b;xn(this);x(this,962,b,c,"MISC")};l.Hm=function(a,b){a=this.A.vi;x(this,963,null,b,"VGA_ENABLE",a);return a};l.fo=function(a,b,c){this.A.vi=b;x(this,963,b,c,"VGA_ENABLE")};l.Em=function(a,b){a=this.A.ae;x(this,964,null,b,"SEQ.INDX",a);return a};
l.co=function(a,b,c){this.A.ae=b;x(this,964,b,c,"SEQ.INDX")};l.Dm=function(a,b){a=this.A.Me[this.A.ae];b&&!z(this)||x(this,965,null,b,"SEQ."+this.A.bh[this.A.ae],a);return a};l.bo=function(a,b,c){c&&!z(this)||x(this,965,b,c,"SEQ."+this.A.bh[this.A.ae]);this.A.Me[this.A.ae]=b;switch(this.A.ae){case 2:this.A.rb=Vm[b&15];break;case 4:jo(this,io(this))&&un(this,!0)}};l.fm=function(a,b){a=this.A.ui;b&&!z(this)||x(this,966,null,b,"DAC.MASK",a);return a};
l.En=function(a,b,c){c&&!z(this)||x(this,966,b,c,"DAC.MASK");this.A.ui=b};l.gm=function(a,b){a=this.A.Rg;b&&!z(this)||x(this,967,null,b,"DAC.STATE",a);return a};l.Fn=function(a,b,c){c&&!z(this)||x(this,967,b,c,"DAC.READ");this.A.od=b;this.A.Rg=3;this.A.Kc=0};l.Gn=function(a,b,c){c&&!z(this)||x(this,968,b,c,"DAC.WRITE");this.A.od=b;this.A.Rg=0;this.A.Kc=0};
l.em=function(a,b){a=this.A.uf[this.A.od]>>this.A.Kc&63;b&&!z(this)||x(this,969,null,b,"DAC.DATA["+u(this.A.od)+"]["+u(this.A.Kc)+"]",a);this.A.Kc+=6;12<this.A.Kc&&(this.A.Kc=0,this.A.od=this.A.od+1&255);return a};l.Dn=function(a,b,c){a=this.A.uf[this.A.od];c&&!z(this)||x(this,969,b,c,"DAC.DATA["+u(this.A.od)+"]["+u(this.A.Kc)+"]");b=a&~(63<<this.A.Kc)|(b&63)<<this.A.Kc;a!==b&&(this.A.uf[this.A.od]=b,ko(this,!1));this.A.Kc+=6;12<this.A.Kc&&(this.A.Kc=0,this.A.od=this.A.od+1&255)};
l.Im=function(a,b){a=this.A.hg;x(this,970,null,b,"FEAT",a);return a};l.Qn=function(a,b,c){this.A.Rk=b;x(this,970,b,c,"GRC2")};l.Jm=function(a,b){a=this.A.vf;x(this,972,null,b,"MISC",a);return a};l.Pn=function(a,b,c){this.A.Qk=b;x(this,972,b,c,"GRC1")};l.nm=function(a,b){a=this.A.$d;x(this,974,null,b,"GRC.INDX",a);return a};l.On=function(a,b,c){this.A.$d=b;x(this,974,b,c,"GRC.INDX")};l.mm=function(a,b){a=this.A.Zd[this.A.$d];b&&!z(this)||x(this,975,null,b,"GRC."+this.A.ah[this.A.$d],a);return a};
l.Nn=function(a,b,c){c&&!z(this)||x(this,975,b,c,"GRC."+this.A.ah[this.A.$d]);this.A.Zd[this.A.$d]=b;switch(this.A.$d){case 0:this.A.Xf=Vm[b&15];this.A.pe=this.A.Xf&~this.A.Yd;break;case 1:this.A.Yd=~Vm[b&15];this.A.pe=this.A.Xf&~this.A.Yd;break;case 2:this.A.xh=Vm[b&15]&-2139062144;break;case 3:case 5:jo(this,io(this));break;case 4:this.A.mi=(b&3)<<3;break;case 6:Zn(this,!1);break;case 7:this.A.yh=Vm[b&15]&-2139062144;break;case 8:this.A.Mb=b|b<<8|b<<16|b<<24}};
l.Zl=function(a,b){return no(this,this.aa,a,b)};l.yn=function(a,b,c){var d=this.aa;d.Qg=d.Ac;d.Ac=b&31;x(this,a,b,c,"CRTC.INDX")};l.Yl=function(a,b){return oo(this,this.aa,a,b)};l.xn=function(a,b,c){po(this,this.aa,a,b,c)};l.$l=function(a,b){return qo(this,this.aa,b)};l.zn=function(a,b,c){a=this.aa;x(this,a.port+4,b,c,"MODE");a.fd=b;Zn(this,!1)};l.Xl=function(a,b){var c=this.aa.tf;b&&!z(this)||x(this,a,null,b,this.aa.type+".COLOR",c);return c};
l.wn=function(a,b,c){c&&!z(this)||x(this,a,b,c,this.aa.type+".COLOR");this.aa.tf!==b&&(this.aa.tf=b,ko(this,!1))};l.am=function(a,b){return ro(this,this.aa,b)};function no(a,b,c,d){var e;b.Hc&&(e=b.Ac);x(a,c,null,d,"CRTC.INDX",e);return e}function oo(a,b,c,d){var e;b.Hc&&b.Ac<b.wh&&(e=b.mb[b.Ac]);d&&!z(a)||x(a,c,null,d,"CRTC."+b.pg[b.Ac],e);return e}
function po(a,b,c,d,e){if(b.Ac<b.wh){e&&!z(a)||x(a,c,d,e,"CRTC."+b.pg[b.Ac]);b.mb[b.Ac]=d;if(12==b.Ac||13==b.Ac)mo(a,b)&1?(c=(b.mb[12]<<8)+b.mb[13]|0,b.Ld!==c&&(b.Ld=c,ko(a))):b.qf||(b.qf=b.ni);(9==b.Ac&&8!=b.Qg||18==b.Ac&&223==d)&&Zn(a,!0);$n(a)}}function qo(a,b,c){var d=b.fd;x(a,b.port+4,null,c,"MODE",d);return d}function ro(a,b,c){var d=mo(a,b);b===a.A?(d|=b.ma&48^48,b.Ze=!1):d=(b.ma^=9)|240;b.ma=d;x(a,b.port+6,null,c,b===a.A?"STATUS1":"STATUS",d);return d}
var ln={948:Z.prototype.um,949:Z.prototype.tm,952:Z.prototype.vm,954:Z.prototype.wm},mn={948:Z.prototype.Vn,949:Z.prototype.Un,952:Z.prototype.Wn},nn={980:Z.prototype.Zl,981:Z.prototype.Yl,984:Z.prototype.$l,985:Z.prototype.Xl,986:Z.prototype.am},on={980:Z.prototype.yn,981:Z.prototype.xn,984:Z.prototype.zn,985:Z.prototype.wn},pn={960:Z.prototype.Tl,961:Z.prototype.kl,962:Z.prototype.Gm,964:Z.prototype.Em,965:Z.prototype.Dm,974:Z.prototype.nm,975:Z.prototype.mm},qn={954:Z.prototype.Mk,960:Z.prototype.Lk,
961:Z.prototype.Lk,962:Z.prototype.Xn,964:Z.prototype.co,965:Z.prototype.bo,970:Z.prototype.Qn,972:Z.prototype.Pn,974:Z.prototype.On,975:Z.prototype.Nn,986:Z.prototype.Mk},rn={963:Z.prototype.Hm,966:Z.prototype.fm,967:Z.prototype.gm,969:Z.prototype.em,970:Z.prototype.Im,972:Z.prototype.Jm},sn={963:Z.prototype.fo,966:Z.prototype.En,967:Z.prototype.Fn,968:Z.prototype.Gn,969:Z.prototype.Dn};
Xa(function(){for(var a=tb(document,"pcx86","video"),b=0;b<a.length;b++){var c=a[b],d=qb(c),e=document.createElement("canvas");if(!e||!e.getContext){c.innerHTML="<br/>Missing &lt;canvas&gt; support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=Ca().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||eb.aspect);f&&.3<=f&&3.33>=f&&(Va("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");La("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var g=e.getContext("2d"),d=new Z(d,e,g,f,c);sb(d,c)}});
function so(a){this.V=a.adapter;switch(this.V){case 1:this.X=956;this.C=7;break;case 2:this.X=888;this.C=7;break;case 3:this.X=632;this.C=5;break;default:w("Unrecognized parallel adapter #"+this.V);return}this.A=this.B=null;bb.call(this,"ParallelPort",a,so,4194304);a=a.binding;"console"==a?this.B="":rb(this,a,to)}jb(so);var to="buffer";l=so.prototype;l.Pb=function(a,b,c){switch(b){case to:return this.qa[b]=this.A=c,!0}return!1};
l.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.N=Jb(a,"ChipSet");qc(b,this,uo,this.X);yc(b,this,vo,this.X);xb(this)};l.hc=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.gc=function(a){return a?this.save():!0};l.reset=function(){wo(this)};l.save=function(){var a=new qf(this),b=0,c=[];c[b++]=this.L;c[b++]=this.Yb;c[b]=this.Df;a.set(0,c);return a.data()};l.restore=function(a){return wo(this,a[0])};
function wo(a,b){var c=0;b||(b=[0,0,0]);a.L=b[c++];a.Yb=b[c++];a.Df=b[c];return!0}l.hm=function(a,b){var c=this.L;x(this,a,null,b,"DATA",c);return c};l.Fm=function(a,b){var c=this.Yb;x(this,a,null,b,"STAT",c);return c};l.dm=function(a,b){var c=this.Df;x(this,a,null,b,"CTRL",c);return c};
l.Hn=function(a,b,c){x(this,a,b,c,"DATA");this.L=b;this.Yb|=64;a=!1;y(this,"transmitByte("+u(b)+")");this.A&&(8==b?this.A.value=this.A.value.slice(0,-1):(this.A.value+=String.fromCharCode(b),this.A.scrollTop=this.A.scrollHeight),a=!0);if(null!=this.B){if(10==b||1024<=this.B.length)this.O(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b));a=!0}a&&(this.Yb&=-65);xo(this)};l.Cn=function(a,b,c){x(this,a,b,c,"CTRL");this.Df=b;xo(this)};
function xo(a){a.N&&a.C&&(a.Df&16&&!(a.Yb&64)?mg(a.N,a.C):lg(a.N,a.C))}var uo={0:so.prototype.hm,1:so.prototype.Fm,2:so.prototype.dm},vo={0:so.prototype.Hn,2:so.prototype.Cn};Xa(function(){for(var a=tb(document,"pcx86","parallel"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new so(d);sb(d,c)}});
function yo(a){this.ya=a.adapter;switch(this.ya){case 1:this.ua=1016;this.ka=4;break;case 2:this.ua=760;this.ka=3;break;default:w("Unrecognized serial adapter #"+this.ya);return}this.L=this.W=null;this.Ga=a.tabSize;this.Fa=a.charBOL;this.ea=0;bb.call(this,"SerialPort",a,yo,8388608);a=a.binding;"console"==a?this.W="":rb(this,a,zo);this.ia=this.ra=null;this.exports={connect:this.zj,receiveData:this.gg}}jb(yo);var zo="buffer";l=yo.prototype;l.bj=function(a,b){return a==this.xd?(this.V=b,this):null};
l.Pb=function(a,b,c){var d=this;switch(b){case zo:return this.qa[b]=this.L=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.gg(b);return!0},c.onkeypress=function(a){a=a||window.event;d.gg(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
l.Ic=function(a,b,c,d){this.X=a;this.ga=b;this.F=c;this.ha=d;this.N=Jb(a,"ChipSet");qc(b,this,Ao,this.ua);yc(b,this,Bo,this.ua);xb(this)};l.zj=function(){if(!this.ia){var a=Yc(this.X,"connection");if(a){var b=a.split("->");if(2==b.length){var c=qa(b[0]);if(c!=this.xd)return;b=qa(b[1]);if(this.ia=ob(b)){var d=this.ia.exports;if(d){var e=d.connect;e&&e.call(this.ia);if(this.ra=d.receiveData){this.status(this.ce+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};
l.hc=function(a,b){if(!b)if(this.zj(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.gc=function(a){return a?this.save():!0};l.reset=function(){Co(this)};l.save=function(){var a=new qf(this),b=0,c=[];c[b++]=this.va;c[b++]=this.Da;c[b++]=this.fa;c[b++]=this.pa;c[b++]=this.U;c[b++]=this.B;c[b++]=this.C;c[b++]=this.A;c[b++]=this.Ca;c[b]=this.aa;a.set(0,c);return a.data()};l.restore=function(a){return Co(this,a[0])};
function Co(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,48,[]]);a.va=b[c++];a.Da=b[c++];a.fa=b[c++];a.pa=b[c++];a.U=b[c++];a.B=b[c++];a.C=b[c++];a.A=b[c++];a.Ca=b[c++];a.aa=b[c];return!0}l.gg=function(a){if("number"==typeof a)this.aa.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.aa.push(a.charCodeAt(b));else this.aa=this.aa.concat(a);Do(this);return!0};
function Do(a){0<a.aa.length&&!(a.A&1)&&(a.va=a.aa.shift(),a.A|=1);var b=-1;a.A&1&&a.pa&1&&(b=4);0<=b?(a.U&=-8,a.U|=b,a.N&&a.ka&&mg(a.N,a.ka,100)):(a.U|=1,a.N&&a.ka&&lg(a.N,a.ka))}l.Cm=function(a,b){var c=this.B&128?this.fa&255:this.va;x(this,a,null,b,this.B&128?"DLL":"RBR",c);this.A&=-2;Do(this);return c};l.om=function(a,b){var c=this.B&128?this.fa>>8:this.pa;x(this,a,null,b,this.B&128?"DLM":"IER",c);return c};l.pm=function(a,b){var c=this.U;x(this,a,null,b,"IIR",c);return c};
l.qm=function(a,b){var c=this.B;x(this,a,null,b,"LCR",c);return c};l.sm=function(a,b){var c=this.C;x(this,a,null,b,"MCR",c);return c};l.rm=function(a,b){var c=this.A;x(this,a,null,b,"LSR",c);return c};l.xm=function(a,b){var c=this.Ca;x(this,a,null,b,"MSR",c);return c};
l.eo=function(a,b,c){x(this,a,b,c,this.B&128?"DLL":"THR");if(this.B&128)this.fa=this.fa&-256|b;else{this.Da=b;this.A&=-97;a=!1;y(this,"transmitByte("+u(b)+")");this.ra&&this.ra.call(this.ia,b)&&(a=!0);if(this.L)13==b?this.ea=0:8==b?(this.L.value=this.L.value.slice(0,-1),0<this.ea&&this.ea--):(a=(a=ra[b])?"<"+a+">":String.fromCharCode(b),c=a.length,32>b&&1==c&&(c=0),9==b&&(b=this.Ga||8,c=b-this.ea%b,this.Ga&&(a=pa("",c))),this.Fa&&!this.ea&&c&&(a=String.fromCharCode(this.Fa)+a),this.L.value+=a,this.L.scrollTop=
this.L.scrollHeight,this.ea+=c),a=!0;else if(null!=this.W){if(10==b||1024<=this.W.length)this.O(this.W),this.W="";10!=b&&(this.W+=String.fromCharCode(b));a=!0}a&&(this.A|=96)}};l.Rn=function(a,b,c){x(this,a,b,c,this.B&128?"DLM":"IER");this.B&128?this.fa=this.fa&255|b<<8:this.pa=b};l.Sn=function(a,b,c){x(this,a,b,c,"LCR");this.B=b};
l.Tn=function(a,b,c){var d=this.C;x(this,a,b,c,"MCR");this.C=b;this.V&&(d^b)&3&&(a=this.V,b=this.C,(c=3==(b&3))?a.Hc||(d=!1,a.C&2||(a.reset(),y(a,"serial mouse reset"),d=!0),a.C&1||(y(a,"serial mouse ID requested"),d=!0),d&&(a.N.gg([77,77]),y(a,"serial mouse ID sent")),Eo(a),a.Hc=c):a.Hc&&(y(a,"serial mouse inactive"),Fo(a),a.Hc=c),a.C=b)};
var Ao={0:yo.prototype.Cm,1:yo.prototype.om,2:yo.prototype.pm,3:yo.prototype.qm,4:yo.prototype.sm,5:yo.prototype.rm,6:yo.prototype.xm},Bo={0:yo.prototype.eo,1:yo.prototype.Rn,3:yo.prototype.Sn,4:yo.prototype.Tn};Xa(function(){for(var a=tb(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new yo(d);sb(d,c)}});function Go(a){bb.call(this,"Mouse",a,Go,16777216);if(this.ka=a.serial)this.pa="SerialPort";this.ia=this.fa=this.Hc=!1;this.B=[];this.A=[];xb(this)}jb(Go);var wn=0;l=Go.prototype;
l.Ic=function(a,b,c,d){this.X=a;this.ga=b;this.F=c;this.ha=d;for(b=null;b=Jb(a,"Video",b);)this.B.push(b)};l.hc=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.pa&&!this.N){for(a=null;(a=Jb(this.X,this.pa,a))&&(!a.bj||!(this.N=a.bj(this.ka,this))););if(this.N)for(this.A=[],a=0;a<this.B.length;a++)b=this.B[a],b.V=this,(b=b.X)&&this.A.push(b);else w(this.id+": "+this.pa+" "+this.ka+" unavailable")}this.Hc?Eo(this):Fo(this)}return!0};
l.gc=function(a){return a?this.save():!0};l.reset=function(){Ho(this)};l.save=function(){var a=new qf(this),b=0,c=[];c[b++]=this.Hc;c[b++]=this.L;c[b++]=this.V;c[b++]=this.U;c[b++]=this.W;c[b++]=this.aa;c[b++]=this.ea;c[b]=this.C;a.set(0,c);return a.data()};l.restore=function(a){return Ho(this,a[0])};function Ho(a,b){var c=0;b||(b=[!1,-1,-1,0,0,!1,!1,0]);var d=b[c++];a.Hc=d;a.L=b[c++];a.V=b[c++];a.U=b[c++];a.W=b[c++];a.aa=b[c++];a.ea=b[c++];a.C=b[c];return!0}l.Yf=function(a){this.fa=a};
function Eo(a){if(!a.ia)for(var b=0;b<a.A.length;b++)Io(a,a.A[b])&&(a.ia=!0)}function Fo(a){if(a.ia)for(var b=0;b<a.A.length;b++){var c=a.A[b];c&&(c.style.cursor="auto")}}function Io(a,b){return b?(b.addEventListener("mousemove",function(b){Jo(a,b)},!1),b.addEventListener("mousedown",function(b){Jo(a,b,!0)},!1),b.addEventListener("mouseup",function(b){Jo(a,b,!1)},!1),b.style.cursor="none",!0):!1}
function Jo(a,b,c){if(void 0!==c){var d;!(d=!1!==a.fa)&&(d=a.B.length)&&(d=a.B[0],d=d.Ai?d.Fe(!0):!1);d||(a.fa=null);a.he(b.button,c)}else{if(0>a.L||0>a.V)a.L=b.clientX,a.V=b.clientY;a.fa?(c=b.movementX||b.mozMovementX||b.webkitMovementX||0,d=b.movementY||b.mozMovementY||b.webkitMovementY||0):(c=b.clientX-a.L,d=b.clientY-a.V);a.L=b.clientX;a.V=b.clientY;a.Kf(c,d,a.L,a.V)}}
l.he=function(a,b){if(this.Hc&&this.F&&this.F.la.Ib){var c="mouse button"+a+" "+(b?"dn":"up");switch(a){case wn:if(this.aa!=b){this.aa=b;Ko(this,c);return}break;case 2:if(this.ea!=b){this.ea=b;Ko(this,c);return}}y(this,c+": ignored")}};l.Kf=function(a,b,c,d){this.Hc&&this.F&&this.F.la.Ib&&(a||b)&&(this.U=a,this.W=b,Ko(this,null,c,d))};
function Ko(a,b,c,d){var e=64|(a.aa?32:0)|(a.ea?16:0)|(a.W&192)>>4|(a.U&192)>>6,f=a.U&63,g=a.W&63;z(a,8388608)&&y(a,(b?b+": ":"")+(void 0!==d?"mouse ("+c+","+d+"): ":"")+"serial packet ["+u(e)+","+u(f)+","+u(g)+"]",0,!0);a.N.gg([e,f,g]);a.U=a.W=0}Xa(function(){for(var a=tb(document,"pcx86","mouse"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new Go(d);sb(d,c)}});
function Lo(a,b,c){bb.call(this,"Disk",{id:a.ce+".disk"+r(++Mo,4)},Lo,2097152);this.controller=a;this.X=a.X;this.ha=a.ha;this.B=b;this.ga=b.name;this.cf=b.cf;this.xg=this.N=!1;No(this,c,b.Bb,b.ub,b.lb,b.Va);this.U=[];this.ea=[];this.L=null;this.ia=0;this.fa=!1;xb(this)}var Mo=0;jb(Lo);function Oo(a,b,c,d,e,f){this.za=a;this.kc=c;this.dh=d;this.gj=e;this.xe=f}var Po=[0,2],Qo=[24,2],Ro=[60,4],So=[0,2],To=[4,2],Uo=[6,2],Vo=[28,2],Wo=[32,2],Xo=[34,2],Yo=[38,2],Zo=[44,4],$o=[50,2];
function ap(a,b,c){var d;c=c||2;var e=b&511,f=bp(a.za,a.xe[b>>9]);if(f){if(e+c<=f.length)return cp(a.za,f,e,c);for(e=d=0;c--;)d|=ap(a,b++,1)<<e,e+=8}return d}function dp(a,b,c){return ap(a,b[0]+(c||0),b[1])}function ep(a,b,c){for(var d=0;!c||b<c;){var e=ap(a,b,1);if(!e)break;var f;f=a;var g=b+1,h=e,k="";for(h||(h=-1);h--;){var m=ap(f,g++,1);if(!m)break;k+=String.fromCharCode(m)}f=k;if(!f)break;b+=1+e;if(d){if(e=ap(a,b),g=a.A[e])g=g[0],a.yd[g]&&a.yd[g].we[e].push(f)}else c||(a.jg=f);b+=2;d++}}
Oo.prototype.xj=function(a,b){var c=null;if(this.yd)for(var d in this.yd){var e=this.yd[d];if(a>=e.oi&&a<=e.Ik){d=a-=e.oi;var f,g;for(g in e.we){var h=e.we[g],k=a-h[0];if(!k){c=this.jg+"!"+h[1];break}b&&0<k&&k<d&&(f=h,d=k)}!c&&f&&(c=this.jg+"!"+f[1]+"+"+v(d));break}}return c||this.kc+"+"+r(a,8,!0)};l=Lo.prototype;l.Ic=function(a,b,c,d){this.ha=d};l.hc=function(a,b){b||!this.xg||this.N||(xb(this,!1),this.load(this.ga,this.V,null,this.zl,this));return!0};l.zl=function(){xb(this,!0)};
l.gc=function(a,b){if(this.N){var c,d=0;if(this.fa&&!Ea("Disk writes are still in progress, shut down anyway?"))return!1;for(;c=fp(this,!1);)if(d=c[0]){this.controller.Na('Unable to save "'+this.ga+'" (error '+d+")");break}b&&this.N&&(b="action=close&volume="+this.V,b+="&machine="+this.controller.gf(),b+="&user="+this.controller.ie(),Aa(Ba()+"/api/v1/disk?"+b,null,!0),this.N=!1);!d&&a&&this.controller.Na(this.ga+" saved")}return!0};
function No(a,b,c,d,e,f){a.mode=b;a.Bb=c;a.ub=d;a.lb=e;a.Va=f;a.A=[];if("preload"!=a.mode){b=Array(a.Bb);for(c=0;c<b.length;c++){d=Array(a.ub);for(e=0;e<d.length;e++){f=Array(a.lb);for(var g=1;g<=f.length;g++)f[g-1]=gp(null,c,e,g,a.Va,"local"==a.mode?0:null);d[e]=f}b[c]=d}a.A=b}a.aa=null}
l.load=function(a,b,c,d,e){var f=b;if(this.W)return!0;this.ga=a;this.V=b;this.Ug=ja(b);var g=this;this.W=d;this.ka=e||this.controller;if(c){var h=new FileReader;h.onload=function(){var a=h.result,b,c=a?a.byteLength:0,d=ba[c];if(d){g.Bb=d[0];g.ub=d[1];g.lb=d[2];g.Va=512;b=g.Va>>2;var e=d=0,a=new DataView(a,0,c);g.A=Array(g.Bb);for(c=0;c<g.A.length;c++)for(var f=g.A[c]=Array(g.ub),F=0;F<f.length;F++)for(var C=f[F]=Array(g.lb),D=0;D<C.length;D++){for(var L=gp(null,c,F,D+1,g.Va,0),G=L.data,ga=0;ga<b;ga++,
e+=4)var S=G[ga]=a.getInt32(e,!0),d=d+S&-1;L.Zc=b;C[D]=L}g.aa=d;b=g}else g.Na("Unrecognized diskette format ("+c+" bytes)");g.W&&(g.W.call(g.controller,g.B,b,g.ga,g.V),g.W=null)};h.readAsArrayBuffer(c);return!0}0>b.indexOf("/api/v1/dump")&&(a=ka(b),"json"==a||"gz"==a?f=encodeURI(b):"demandrw"==this.mode||"demandro"==this.mode?(f=hp(this,b),this.xg=!0):(c="path",d="&mbhd=10",!b.indexOf("http:")||!b.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(a)?(c="disk",d="&mbhd=0"):ma(b,"/")&&
(c="dir"),f=Ba()+"/api/v1/dump?"+c+"="+encodeURIComponent(b)+(this.cf?"":d)+"&format=json"));return!!Aa(f,null,!0,function(a,b,c){ip(g,a,b,c)})};
function ip(a,b,c,d){var e=null;a.ff=!1;var f=0>d&&a.X&&!a.X.la.ic;if(a.xg)d?a.controller.Na('Unable to connect to disk "'+a.V+'" (error '+d+": "+c+")",f):(a.N=!0,jp(a),e=a);else if(d)a.controller.Na('Unable to load disk "'+a.ga+'" (error '+d+": "+b+")",f);else{mb(a.controller.ce,b,c);try{if(0<ja(a.Ug,!0).toLowerCase().indexOf("-readonly"))a.ff=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.ff=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.ga]:
h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+c+")");if(h.length)if(1==h.length)w(h[0]);else{a.Bb=h.length;a.ub=h[0].length;a.lb=h[0][0].length;var k=h[0][0][0];a.Va=k&&k.length||512;for(d=c=0;d<a.Bb;d++)for(f=0;f<a.ub;f++)for(g=0;g<a.lb;g++)if(k=h[d][f][g]){var m=k.length;void 0===m&&(m=k.length=512);var m=m>>2,n=k.pattern;void 0===n&&(n=k.pattern=0);var t=k.data;if(void 0===t){var q=k.bytes;if(void 0!==q&&q.length){for(var A=
m<<2,F=q.length;F<A;F++)q[F]=n;kp(k,q,0)}else t=[],n=k.pattern=n|n<<8|n<<16|n<<24,k.data=t;delete k.bytes}gp(k,d,f);for(A=0;A<t.length;A++)c=c+t[A]&-1}a.A=h;a.aa=c;jp(a);e=a}else w("Empty disk image: "+a.ga)}catch(C){w("Disk image error ("+b+"): "+C.message)}}a.W&&(a.W.call(a.ka,a.B,e,a.ga,a.V),a.W=null)}
function jp(a){var b,c,d={},e;if(a.C&&a.C.length)for(b=a.A,c=0;c<b.length;c++)for(var f=0;f<b[c].length;f++)for(e=0;e<b[c][f].length;e++){var g=b[c][f][e];g&&(delete g.file,delete g.fn)}a.C=[];d.bg=d.Jf=0;b=a.Bb*a.ub*a.lb*a.Va;a.N&&a.log("ignore any synchronous XMLHttpRequest warnings here (for now)");if(e=bp(a,0)){d.Va=cp(a,e,11,2);if(d.Va!=a.Va){f=!1;d.If=1;d.Gg=12;d.th=d.If+2;d.Eg=1;d.Va=a.Va;if(163840==b&&254==lp(a,d,0,0))d.Jf=320,d.Dh=64,f=!0;else if(327680==b&&255==lp(a,d,0,0))d.Jf=640,d.Dh=
112,f=!0;else for(c=446,b=0;4>b;b++){if(128==cp(a,e,c+0,1)){d.bg=cp(a,e,c+8,4);(e=bp(a,d.bg))&&(f=!0);break}c+=16}if(!f)return}d.Jf||(d.Jf=cp(a,e,19,2)||cp(a,e,32,4),d.If=cp(a,e,14,2),d.th=d.If+cp(a,e,22,2)*cp(a,e,16,1),d.Dh=cp(a,e,17,2),d.Eg=cp(a,e,13,1));d.rh=d.th+((32*d.Dh+(d.Va-1))/d.Va|0);d.$m=(d.Jf-d.rh)/d.Eg|0;d.Gg=4084>=d.$m?12:16;d.Gl=12==d.Gg?4086:65526;b=[];for(e=d.th;e<d.rh;e++)b.push(d.bg+e);mp(a,d,a.Ug,"",b);for(b=0;b<a.C.length;b++){d=a.C[b];for(e=c=0;e<d.xe.length;e++){var f=d.xe[e],
g=c,h=a.ub*a.lb,k=f%h,m=k/a.lb|0,k=k%a.lb,n=void 0,t=void 0,q=void 0;(n=a.A[f/h|0])&&(t=n[m])&&(q=t[k])&&!q.file&&(q.file=d,q.fn=g);c+=a.Va}e=d;if((ma(e.kc,".EXE")||ma(e.kc,".DLL")||ma(e.kc,".DRV"))&&23117==dp(e,Po)&&64==dp(e,Qo)&&(c=dp(e,Ro),17742==dp(e,So,c))){m=dp(e,Vo,c);g=dp(e,Xo,c);h=dp(e,$o,c);if(g&&m){d=e;f=g+c;g=m;h=h||0;m=1;d.yd=[];for(d.A=[];g--;){if(k=ap(d,f)<<h)n=ap(d,f+2)||65536,d.yd[m++]={oi:k,Ik:k+n-1,we:[]};f+=8}d.yd[254]={oi:0,Ik:0,we:[]}}g=dp(e,To,c);h=dp(e,Uo,c);if(g&&h)for(d=
e,f=g+=c,g+=h,h=1;f<g;){k=ap(d,f);m=k&255;if(!m)break;k>>=8;f+=2;if(k)for(;m--;)ap(d,f,1),254>=k?(n=k,t=ap(d,f+1),f+=3):(n=ap(d,f+3,1),t=ap(d,f+4),f+=6),d.yd[n]&&(d.yd[n].we[h]=[t]),d.A[h]=[n,t],h++;else h+=m}(g=dp(e,Yo,c))&&ep(e,g+c);g=dp(e,Zo,c);h=dp(e,Wo,c);g&&h&&ep(e,g,g+h)}}}}
function mp(a,b,c,d,e){var f,g=a.C.length,h=b.Va/32|0;b.Mo=d+"\\";for(var k=0;k<e.length;k++)for(var m=e[k],n=0;n<h;n++){var t=a,q=b;f=n;q.te&&q.ri&&q.ri==m||(q.ri=m,q.te=bp(t,q.ri));if(q.te){f*=32;var A=cp(t,q.te,f,1);if(A){if(229==A)q.kc=null;else{q.kc=qa(np(t,q.te,f+0,8));A=qa(np(t,q.te,f+8,3));A.length&&(q.kc+="."+A);q.dh=cp(t,q.te,f+11,1);q.gj=cp(t,q.te,f+28,2);q.Fl=cp(t,q.te,f+26,2);f=q;var A=[],F=q.Fl;if(F){do{if(2>F)break;for(var C=q.rh+(F-2)*q.Eg,D=0;D<q.Eg;D++)A.push(q.bg+C++);F=lp(t,q,
F,0)|lp(t,q,F,1)}while(F<=q.Gl)}f.xe=A}f=!0}else f=!1}else f=!1;if(!f){k=e.length;break}null!=b.kc&&"."!=b.kc&&".."!=b.kc&&(f=new Oo(a,0,b.kc,b.dh,b.gj,b.xe),a.C.push(f))}for(e=a.C.length;g<e;g++)f=a.C[g],f.dh&16&&f.xe.length&&mp(a,b,c,d+"\\"+f.kc,f.xe)}function lp(a,b,c,d){var e=0,f=8*b.Va;c=b.Gg*c+(d?8:0);var g=c/f|0;b.wi&&b.sh&&b.sh==b.If+g||(b.sh=b.If+g,b.wi=bp(a,b.bg+b.sh));b.wi&&(c=c%f|0,e=cp(a,b.wi,c>>3,1),d?e=16==b.Gg?e<<8:c&7?e<<4:(e&15)<<8:c&7&&(e>>=4));return e}
function bp(a,b){var c=a.ub*a.lb,d=b/c|0;return d<a.Bb?(b%=c,a.seek(d,b/a.lb|0,b%a.lb+1)):null}function cp(a,b,c,d){for(var e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}function np(a,b,c,d){for(var e="";d--;){var f=a.read(b,c++);if(0>=f)break;e+=String.fromCharCode(f)}return e}function gp(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Hl=b;a.Il=c;a.ud=a.Zc=0;a.Wa=!1;return a}
function hp(a,b){b="action=open&volume="+b+("&mode="+a.mode);b+="&chs="+a.Bb+":"+a.ub+":"+a.lb+":"+a.Va;b+="&machine="+a.controller.gf();b+="&user="+a.controller.ie();return Ba()+"/api/v1/disk?"+b}
function op(a,b,c,d,e,f,g){if(a.N){var h;h="action=read&volume="+a.V;h+="&chs="+a.Bb+":"+a.ub+":"+a.lb+":"+a.Va;h=h+("&addr="+b+":"+c+":"+d+":"+e)+("&machine="+a.controller.gf());h+="&user="+a.controller.ie();Aa(Ba()+"/api/v1/disk?"+h,null,f,function(h,m,n){h=[b,c,d,e,f,g];var k=!1,q=h[0],A=h[1],F=h[2],C=h[3];if(!n){m=JSON.parse(m);for(k=0;C--;){var D=a.seek(q,A,F,!0);if(!D)break;kp(D,m,k);k+=D.length;F++}k=h[4]}(h=h[5])&&h(n,k)})}else g&&g(-1,!1)}
function pp(a,b,c,d,e,f,g){if(a.N){var h={};a.fa=!0;h.action="write";h.volume=a.V;h.chs=a.Bb+":"+a.ub+":"+a.lb+":"+a.Va;h.addr=b+":"+c+":"+d+":"+e;h.machine=a.controller.gf();h.user=a.controller.ie();h.data=JSON.stringify(f);Aa(Ba()+"/api/v1/disk",h,g,function(f,h,n){var k=[b,c,d,e,g];f=k[0];h=k[1];var m=k[2],A=k[3],k=k[4];a.fa=!1;if(0<=f&&f<a.A.length&&0<=h&&h<a.A[f].length)for(--m;0<A--&&0<=m&&m<a.A[f][h].length;m++){var F=a.A[f][h][m];n?qp(a,F,!1):F.Wa||(F.ud=F.Zc=0)}k&&rp(a)})}return!1}
function qp(a,b,c){b.Wa=!0;var d=a.U.indexOf(b);0<=d&&(a.U.splice(d,1),a.ea.splice(d,1));a.U.push(b);a.ea.push(ta());c&&rp(a)}function rp(a){if(a.U.length){var b=a.ea[0]+2E3;a.L&&a.ia<b&&(clearTimeout(a.L),a.L=null);if(!a.L){var c=ta(),b=b-c;0>b&&(b=0);2E3<b&&(b=2E3);a.L=setTimeout(function(){fp(a,!0)},b);a.ia=c+b}}else a.L&&(clearTimeout(a.L),a.L=null)}
function fp(a,b){b&&(a.L=null);var c=a.U[0];if(c){for(var d=c.Hl,e=c.Il,c=c.sector,f=0,g=[],h=c-1;h<a.A[d][e].length;h++){var k=a.A[d][e][h];if(!k.Wa)break;var m=a.U.indexOf(k);a.U.splice(m,1);a.ea.splice(m,1);g=g.concat(sp(k));k.Wa=!1;f++}a=pp(a,d,e,c,f,g,b);return b||a}return!1}l.info=function(){return this.A.length?[this.A.length,this.A[0].length,this.A[0][0].length,this.A[0][0][0].length]:[0,0,0,0]};
l.seek=function(a,b,c,d,e){var f=null,g=this.B,h=this.A[a];if(h){var k=h[b];if(!k&&g.fh&&b<g.ub)for(k=h[b]=Array(g.fe),h=0;h<k.length;h++)k[h]=gp(null,a,b,h+1,g.Hb,0);if(k){for(h=0;h<k.length;h++)if(k[h]&&k[h].sector==c){f=k[h];if(null===f.pattern)if(d)f.pattern=0;else{for(d=1;++h<k.length;)null===k[h].pattern&&d++;op(this,a,b,c,d,!!e,function(a,b){a&&(f=null);e&&e(f,b)});return e?null:f}break}!f&&g.fh&&9==g.xb&&(f=k[h]=gp(null,a,b,g.xb,g.Hb,0))}}e&&e(f,!1);return f};
function kp(a,b,c){for(var d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}function sp(a){var b=a.length,c=Array(b),d=0,b=b>>2,e=a.data;a=a.pattern;for(var f=0;f<b;f++){var g=f<e.length?e[f]:a;c[d++]=g&255;c[d++]=g>>8&255;c[d++]=g>>16&255;c[d++]=g>>24&255}return c}l.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};
l.write=function(a,b,c){if(this.ff)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Zc?f<a.ud?(a.Zc+=a.ud-f,a.ud=f):f>=a.ud+a.Zc&&(a.Zc+=f-(a.ud+a.Zc)+1):(a.ud=f,a.Zc=1);d[f]=d[f]&~(255<<b)|c<<b;this.N&&qp(this,a,!0)}return!0}return null};function tp(a){for(var b="",c=0,d;d=bp(a,c++);)for(var e=0,f=d.length;e<f;e++)b+=String.fromCharCode(cp(a,d,e,1));return btoa(b)}
l.save=function(){var a=0,b=[];b[a++]=[this.V,this.aa,this.Bb,this.ub,this.lb,this.Va];if(!this.N&&!this.ff)for(var c=this.A,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Zc){for(var h=[],k=0,m=g.ud,n=g.ud+g.Zc;m<n;)h[k++]=g.data[m++];b[a++]=[d,e,f,g.ud,h]}}return b};
l.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.A.length&&6<=e.length?No(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.aa&&e[1]!=this.aa&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.aa+")",b=-2));for(this.A.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],k=g[f++],m=g[f++];if(h>=this.A.length||k>=this.A[h].length||m>=this.A[h][k].length){c="sector (CHS="+h+":"+k+":"+m+") out of range ("+
b+" changes applied)";b=-1;break}if(this.ff){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.A[h][k][m]){for(k=h.data.length;k<e;)h.data[k++]=h.pattern;k=0;h.ud=e;for(h.Zc=f.length;e<g;)h.data[e++]=f[k++];b++}}}0>b?-2!=b&&this.controller.Na("Unable to restore disk '"+this.ga+": "+c):jp(this);return b};
l.toJSON=function(){var a;a=0;for(var b;b=bp(this,a++);)up(b);a=JSON.stringify(this.A,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function up(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function vp(a){bb.call(this,"FDC",a,vp,524288);this.dmaRead=this.el;this.dmaWrite=this.fl;this.dmaFormat=this.vl;this.U=a.autoMount||null;this.fa=a.sortBy||"name";"none"==this.fa&&(this.fa=null);this.B=[];this.ia=!La("Mobi")&&window&&"FileReader"in window}jb(vp);aa={};
var wp={3:{Ud:3,ge:0,name:aa.Fo},4:{Ud:2,ge:1,name:aa.Do},5:{Ud:9,ge:7,name:aa.Jo},6:{Ud:9,ge:7,name:aa.zo},7:{Ud:2,ge:0,name:aa.Bo},8:{Ud:1,ge:2,name:aa.Eo},10:{Ud:2,ge:7,name:aa.Ao},13:{Ud:6,ge:7,name:aa.wo},15:{Ud:3,ge:0,name:aa.Co}};l=vp.prototype;
l.Pb=function(a,b,c){var d=this;switch(b){case "listDisks":this.qa[b]=c;if(this.fa){b=[];for(a=0;a<c.options.length;a++)b.push(c.options[a]);b.sort(function(a,b){return"path"!=d.fa?a.text.localeCompare(b.text):a.value.localeCompare(b.value)});for(a=0;a<b.length;a++)c.options[a]=b[a]}c.onchange=function(){var a=d.qa.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("FDC option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=
g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}};return!0;case "descDisk":case "listDrives":return this.qa[b]=c,c.onchange=function(){var a=ea(c.value,10);null!=a&&xp(d,a)},!0;case "loadDrive":return this.qa[b]=c,c.onclick=function(){var a=d.qa.listDisks;a&&yp(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.ia){c.parentNode.removeChild(c);break}this.qa[b]=c;c.onclick=function(){var a=d.qa.listDrives;a&&a.options&&d.A&&((a=d.A[ea(a.value,10)])?
(a=a.za)?(a=Na(tp(a),"octet-stream",!0,a.Ug.replace(".json",".img")),w(a)):d.Na("No diskette loaded in drive."):d.Na("No diskette drive selected."))};return!0;case "mountDrive":if(this.ia)return this.qa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;yp(d,ja(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
l.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.X=a;this.N=Jb(a,"ChipSet");if((this.U=Yc(this.X,"autoMount")||this.U)&&"string"==typeof this.U)try{this.U=eval("("+this.U+")")}catch(e){w("FDC auto-mount error: "+e.message+" ("+this.U+")"),this.U=null}zp(this);qc(b,this,Ap);yc(b,this,Bp);Cp(this,"None","",!0);this.ia&&Cp(this,"Local Disk","?");Cp(this,"Remote Disk","??");Dp(this)||xb(this)};
l.hc=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.X.lh){this.B=[];for(a=0;a<this.A.length;a++)Ep(this,a,!0);Dp(this,!0)}}else if(!this.restore(a))return!1;if(a=this.qa.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;b<this.ka;b++){var c=document.createElement("option");c.value=b;c.text=String.fromCharCode(65+b)+":";a.appendChild(c)}0<this.ka&&(a.value="0",xp(this,0))}}return!0};l.gc=function(a){return a?this.save():!0};l.reset=function(){zp(this)};
l.save=function(){var a=new qf(this);a.set(0,Fp(this));return a.data()};l.restore=function(a){return zp(this,a[0])};
function zp(a,b){var c=0,d,e=!0;b||(b=[0,0,128,Array(9),0,0,0,[]]);a.hb=b[c++];c++;a.ma=b[c++];a.V=b[c++];a.L=b[c++];a.C=b[c++];a.aa=b[c++];var f=b[c++];d=b[c++];null!=d&&(a.B=d);void 0===a.A&&(a.ka=4,a.N&&(a.ka=+Yk(a.N,zk,void 0)),a.A=Array(4));for(d=0;d<a.A.length;d++){var g=a.A[d];if(void 0===g){var g=a.A[d]={},h;if(a.N)a:{h=a.N;if(d<+Yk(h,zk,void 0)){if(!h.ia){h=360;break a}if(d<h.ia.length){h=h.ia[d];break a}}h=0}else h=0;switch(h){case 160:case 180:g.ub=1;default:g.Bb=40;g.lb=9;break;case 720:g.Bb=
80;g.lb=9;break;case 1200:g.Bb=80;g.lb=15;break;case 1440:g.Bb=80,g.lb=18}}var k=a,m=d,n=f[d],t=0;h=!0;g.hb=m;g.$e=g.bf=!1;n||(n=[192,!0,0,2,0]);"boolean"==typeof n[1]&&(n[1]=["Floppy Drive",g.Bb||40,g.ub||n[3],g.lb||9,g.Va||512,n[1],g.Fg,g.Qf,g.Rf]);g.Cb=n[t++];var q=n[t++];g.name=q[0];g.Bb=q[1];g.ub=q[2];g.lb=q[3];g.Va=q[4];g.cf=q[5];(g.Fg=q[6])?(g.Qf=q[7],g.Rf=q[8]):(g.Fg=g.Bb,g.Qf=g.ub,g.Rf=g.lb);g.kb=n[t++];g.ee=n[t++];g.Qb=n[t++];g.ee=100<=g.ee?g.ee-100:g.ee-g.Qb;g.xb=n[t++];g.fe=n[t++];g.Hb=
n[t++];g.eb=n[t++];g.pb=null;g.za||(g.Oe="");var A=n[t++];102==A&&(A=!1);"boolean"==typeof A?(q=n[t++],n=n[t],A?(t=k.A[m],Ep(k,m,!0,!0),t.bf=!0,m=new Lo(k,t,"preload"),k.pj(t,m,q,n,!0)):Gp(k,m,q,n,!0)?g.za&&n&&Hp(k,q,n,g.za):xb(k,!1)):void 0!==A&&g.za&&0>g.za.restore(A)&&(h=!1);h&&g.za&&void 0!==g.eb&&(g.pb=g.za.seek(g.Qb,g.kb,g.xb));h||(e=!1)}a.W=b[c++]||0;a.jc=b[c]||0;return e}
function Fp(a){var b=0,c=[];c[b++]=a.hb;c[b++]=0;c[b++]=a.ma;c[b++]=a.V;c[b++]=a.L;c[b++]=a.C;c[b++]=a.aa;for(var d=b++,e=0,f=[],g=0;g<a.A.length;g++){var h=e++,k=a.A[g],m=0,n=[];n[m++]=k.Cb;n[m++]=[k.name,k.Bb,k.ub,k.lb,k.Va,k.cf,k.Fg,k.Qf,k.Rf];n[m++]=k.kb;n[m++]=k.ee+100;n[m++]=k.Qb;n[m++]=k.xb;n[m++]=k.fe;n[m++]=k.Hb;n[m++]=k.eb;n[m++]=k.bf;n[m++]=k.Tk;n[m]=k.Oe;f[h]=n}c[d]=f;d=b++;for(e=0;e<a.A.length;e++)f=a.A[e],f.za&&Ip(a,f.Oe,f.za);c[d]=a.B;c[b++]=a.W;c[b]=a.jc;return c}
l.mj=function(a){var b;a=this.A[a];if(void 0!==a){b={};for(var c in a)b[c]=a[c]}return b};l.Uk=function(a,b,c){if(a.za){var d=a.za.info(),e=d[2],f=d[1]*e;if(b+c<=d[0]*f)return a.Qb=Math.floor(b/f),b%=f,a.kb=Math.floor(b/e),a.xb=b%e+1,a.Hb=c*d[3],a.Cb=0,!0}return!1};
function Dp(a,b){b||(a.ea=0);if(a.U)for(var c in a.U){var d=a.U[c],e=d.path,f;if(!(f=d.name))a:{if((f=a.qa.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=ja(e,!0)}if(e&&f&&(g=c.charCodeAt(0)-65,0<=g&&g<a.A.length)){!Gp(a,g,f,e,!0)&&b&&xb(a,!1);continue}a.Na("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.ea}
function yp(a,b,c,d){var e,f=a.qa.listDrives;if(f&&!isNaN(e=ea(f.value,10))&&0<=e&&e<a.A.length)if(c)if("?"==c)a.Na('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=ja(c)}for(;0>Gp(a,e,b,c,!1,d)&&window.confirm("Click OK to reload the original disk.\n(WARNING: All disk changes will be discarded)");){var f=a,g=c,h;for(h=0;h<f.B.length;h++)if(f.B[h][1]==g){f.B.splice(h,1);break}Ep(a,e,!1,
!0)}}else Ep(a,e);else a.Na("Unable to load the selected drive")}function Gp(a,b,c,d,e,f){var g=a.A[b];if(d&&(d=d.replace("/disks/pc/","/disks/pcx86/"),g.Oe.toLowerCase()!=d.toLowerCase())){Ep(a,b,e,!0);if(g.$e)return a.Na("Drive "+b+" busy"),0;g.$e=!0;e&&(g.Ce=!0,a.ea++,z(a)&&y(a,"loading diskette '"+c+"'"));g.bf=!!f;return(new Lo(a,g,"preload")).load(c,d,f,a.pj)?1:0}return-1}
l.pj=function(a,b,c,d,e){var f;a.$e=!1;b&&(f=b.info(),b&&f[0]>a.Bb||f[1]>a.ub)&&(this.Na('Diskette "'+c+'" too large for drive '+String.fromCharCode(65+a.hb)),b=null);b?(a.za=b,a.Tk=c,a.Oe=d,Hp(this,c,d,b),f=b.info(),this.W|=128,this.Na('Mounted diskette "'+c+'" in drive '+String.fromCharCode(65+a.hb),a.Ce||e),a.Fg=f[0],a.Qf=f[1],a.Rf=f[2],this.X&&this.X.wd()):a.bf=!1;a.Ce&&(a.Ce=!1,--this.ea||xb(this));xp(this,a.hb)};
function Cp(a,b,c,d){if((a=a.qa.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function xp(a,b){if(0<=b&&b<a.A.length){var c=a.A[b],d=a.qa.listDisks;a=a.qa.listDrives;if(d&&a&&d.options&&a.options&&(a=ea(a.value,10),c=c.bf?"?":c.Oe,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Ep(a,b,c,d){var e=a.A[b];e.za&&(Ip(a,e.Oe,e.za),e.Tk="",e.Oe="",e.za=null,e.bf=!1,a.W|=128,d||a.Na("Drive "+String.fromCharCode(65+b)+" unloaded",c),c||d||xp(a,b))}
function Hp(a,b,c,d){var e;for(e=0;e<a.B.length;e++)if(a.B[e][1]==c){d.restore(a.B[e][2]);return}a.B[e]=[b,c,[]]}function Ip(a,b,c){var d;for(d=0;d<a.B.length;d++)if(a.B[d][1]==b){a.B[d][2]=c.save();break}}l.Kn=function(a,b,c){x(this,a,b,c,"OUTPUT");b&4?this.aa&4||this.aa&8&&this.N&&mg(this.N,6):zp(this);this.aa=b};l.jm=function(a,b){x(this,a,null,b,"DIAG",80);return 80};l.lm=function(a,b){x(this,a,null,b,"STATUS",this.ma);return this.ma};
l.im=function(a,b){var c=0;this.L<this.C&&(c=this.V[this.L]);this.aa&8&&this.N&&lg(this.N,6);z(this)&&x(this,a,null,b,"DATA["+this.L+"]",c);++this.L>=this.C&&(this.ma&=-81,this.L=this.C=0);return c};
l.Jn=function(a,b,c){z(this)&&x(this,a,b,c,"DATA["+this.C+"]");this.C<this.V.length&&(this.V[this.C++]=b);a=this.V[0]&31;if(void 0!==wp[a]&&this.C>=wp[a].Ud){b=!1;this.L=0;a=Jp(this);var d,e,f,g,h=a&31;switch(h){case 3:Jp(this);Jp(this);Kp(this);break;case 4:c=Jp(this);this.hb=c&3;d=this.A[this.hb];Kp(this);Lp(this,(d.Cb&-16777216)>>>24);break;case 5:case 6:c=Jp(this);b=c>>2&1;this.hb=c&3;d=this.A[this.hb];d.kb=b;c=d.Qb=Jp(this);e=Jp(this);f=d.xb=Jp(this);g=Jp(this);d.Hb=128<<g;d.fe=Jp(this);Jp(this);
Jp(this);6==h?(h=d,h.Cb=72,h.za&&(h.pb=null,h.Cb=0,this.N&&(Cl(this.N,2,this,"dmaRead",h),ul(this.N,2)))):(h=d,h.Cb=72,h.za&&(h.za.ff?h.Cb=576:(h.pb=null,h.Cb=0,this.N&&(Cl(this.N,2,this,"dmaWrite",h),ul(this.N,2)))));Mp(this,d,a,b,c,e,f,g);b=!0;break;case 7:c=Jp(this);this.hb=c&3;d=this.A[this.hb];d.Qb=d.ee=0;d.Cb=268435488;Kp(this);b=!0;break;case 8:d=this.A[this.hb];d.kb=0;Kp(this);Lp(this,d.hb|d.kb<<2|d.Cb&255);Lp(this,d.Qb);this.hb=this.hb+1&3;break;case 10:c=Jp(this);b=c>>2&1;this.hb=c&3;d=
this.A[this.hb];c=d.Qb;e=d.kb=b;f=d.xb=1;g=0;d.Cb=0;d.za&&(d.pb=d.za.seek(d.Qb,d.kb,d.xb))?g=d.pb.length>>8:d.Cb=72;Mp(this,d,a,b,c,e,f,g);b=!0;break;case 13:c=Jp(this);b=c>>2&1;this.hb=c&3;d=this.A[this.hb];c=d.Qb;e=d.kb=b;f=1;g=Jp(this);d.Hb=128<<g;d.fe=Jp(this);Jp(this);d.cj=Jp(this);h=d;h.Cb=72;h.za&&(h.pb=null,h.Cb=0,this.N&&(h.We=0,h.ld=Array(4),h.fh=!0,h.sg=0,Cl(this.N,2,this,"dmaFormat",h),ul(this.N,2),h.fh=!1));Mp(this,d,a,b,c,e,f,g);b=!0;break;case 15:c=Jp(this),this.hb=c&3,d=this.A[this.hb],
d.kb=c>>2&1,c=Jp(this),d.Qb+=c-d.ee,0>d.Qb&&(d.Qb=0),d.Qb>=d.Bb&&(d.Qb=d.Bb-1),d.ee=c,d.Cb=32,d.Qb||(d.Cb|=268435456),Kp(this),b=!0}0<this.C&&(this.ma|=80);this.aa&8&&(!d||d.Cb&8||!b||this.N&&mg(this.N,6))}};l.km=function(a,b){var c=this.W;this.W&=-129;x(this,a,null,b,"INPUT",c);return c};l.In=function(a,b,c){x(this,a,b,c,"CONTROL");this.jc=b};
function Mp(a,b,c,d,e,f,g,h){Kp(a);Lp(a,b.hb|b.kb<<2|b.Cb&255);Lp(a,(b.Cb&65280)>>>8);Lp(a,(b.Cb&16711680)>>>16);var k=0;if(e!=b.Qb||f!=b.kb)k=g=1;c&128&&(f^=k,d||(k=0));Lp(a,e+k);Lp(a,f);Lp(a,g);Lp(a,h)}function Jp(a){var b=a.V[a.L];a.L++;return b}function Kp(a){a.L=a.C=0}function Lp(a,b){a.V[a.C++]=b}l.el=function(a,b,c){void 0===b||0>b?this.Le(a,c):c(-1,!1)};l.fl=function(a,b){return void 0!==b&&0<=b?Np(a,b):-1};
l.vl=function(a,b){if(void 0!==b&&0<=b)a:if(a.Cb)a=-1;else{a.ld[a.We++]=b;if(a.We==a.ld.length){a.Qb=a.ld[0];a.kb=a.ld[1];a.xb=a.ld[2];a.Hb=128<<a.ld[3];for(var c=a.We=0;c<a.Hb;c++)if(0>Np(a,a.cj)){a=-1;break a}a.sg++}a.sg>=a.fe&&(b=-1);a=b}else a=-1;return a};l.Le=function(a,b){var c=-1,d=null,e=0;if(!a.Cb&&a.za){do{if(a.pb&&(e=a.eb,0<=(c=a.za.read(a.pb,a.eb++)))){d=a.pb;break}a.pb=a.za.seek(a.Qb,a.kb,a.xb);if(!a.pb){a.Cb=1088;break}a.eb=0;Op(a)}while(1)}b(c,!1,d,e)};
function Np(a,b){if(a.Cb||!a.za)return-1;do{if(a.pb&&a.za.write(a.pb,a.eb++,b))break;a.pb=a.za.seek(a.Qb,a.kb,a.xb);if(!a.pb){a.Cb=8256;b=-1;break}a.eb=0;Op(a)}while(1);return b}function Op(a){a.xb++;a.xb>=a.Rf+1&&(a.xb=1,a.kb++,a.kb>=a.Qf&&(a.kb=0,a.Qb++))}var Ap={1009:vp.prototype.jm,1012:vp.prototype.lm,1013:vp.prototype.im,1015:vp.prototype.km},Bp={1010:vp.prototype.Kn,1013:vp.prototype.Jn,1015:vp.prototype.In};
Xa(function(){for(var a=tb(document,"pcx86","fdc"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new vp(d);sb(d,c)}});function Pp(a){bb.call(this,"HDC",a,Pp,1048576);this.dmaRead=this.gl;this.dmaWrite=this.hl;this.dmaWriteBuffer=this.wl;this.dmaWriteFormat=this.xl;this.ua=[];this.Fa=a.drives;this.ia="at"==a.type}jb(Pp);
var Qp=["XTC","ATC","COMPAQ"],Rp=[{0:[306,2],1:[375,8],2:[306,6],3:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[940,8],5:[940,6],6:[615,4],7:[462,8],8:[733,5],9:[900,15],10:[820,3],11:[855,5],12:[855,7],13:[306,8],14:[733,7],16:[612,4],17:[977,5],18:[977,7],19:[1024,7],20:[733,5],21:[733,7],22:[733,5],23:[306,4]},{1:[306,4],2:[615,4],3:[615,6],4:[1023,8],5:[940,6],6:[697,5],7:[462,8],8:[925,5],9:[900,15],10:[980,5],11:[925,7],12:[925,9],13:[612,8],14:[980,4],16:[612,4],17:[980,5],18:[966,6],19:[1023,
8],20:[733,5],21:[733,7],22:[524,4,40],23:[924,8],24:[966,14],25:[966,16],26:[1023,14],27:[832,6,33],28:[1222,15,34],29:[1240,7,34],30:[615,4,25],31:[615,8,25],32:[905,9,25],33:[832,8,33],34:[966,7,34],35:[966,8,34],36:[966,9,34],37:[966,5,34],38:[612,16,63],39:[1023,11,33],40:[1023,15,34],41:[1630,15,52],42:[1023,16,63],43:[805,4,26],44:[805,2,26],45:[748,8,33],46:[748,6,33],47:[966,5,25]}];l=Pp.prototype;
l.Pb=function(a,b,c){var d=this;switch(b){case "saveHD0":case "saveHD1":return this.qa[b]=c,c.onclick=function(a){return function(){var b=d.A&&d.A[a];b&&b.za?(b=b.za,b=Na(tp(b),"octet-stream",!0,b.Ug.replace(".json",".img")),w(b)):d.Na("Hard drive "+a+" is not available.")}}(+b.slice(-1)),!0}return!1};
l.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.X=a;if(d=Yc(a,"drives"))this.ua=d;else if(this.Fa)try{this.ua=eval("("+this.Fa+")")}catch(e){w("HDC drive configuration error: "+e.message+" ("+this.Fa+")")}this.N=Jb(a,"ChipSet");this.U=0;this.Ga=3;qc(b,this,this.ia?Sp:Tp);yc(b,this,this.ia?Up:Vp);this.ia&&(this.U++,this.N&&5180==this.N.ja&&this.U++,this.Ga=2,b.aa[496]=2,b.ea[496]=2);lf(c,19,this.Nm.bind(this));lf(c,64,this.Om.bind(this));this.reset();Wp(this)||xb(this)};
l.hc=function(a,b){if(!b)if(!a||!this.restore)Xp(this),this.X.lh&&Wp(this,!0);else if(!this.restore(a))return!1;return!0};l.gc=function(a){return a?this.save():!0};l.gf=function(){return this.X?this.X.gf():""};l.ie=function(){return this.X?this.X.ie():""};l.reset=function(){Xp(this,null,!0)};l.save=function(){var a=new qf(this);a.set(0,Yp(this));return a.data()};l.restore=function(a){return Xp(this,a[0])};
function Xp(a,b,c){var d=0,e=!0;a.hb=-1;if(a.ia){if(b||(b=[0,0,0,0,0,0,0,64,0,[0,-1]]),a.W=b[d++],a.Pa=b[d++],a.aa=b[d++],a.Ca=b[d++],a.ya=b[d++],a.va=b[d++],a.ra=b[d++],a.ma=b[d++],a.Da=b[d++],a.fa=b[d++],"object"==typeof a.fa){var f=a.fa;a.fa=f[0];a.hb=f[1]}}else b||(b=[0,0,Array(14),0,0]),a.pa=b[d++],a.ma=b[d++],a.V=b[d++],a.L=b[d++],a.C=b[d++],a.Oa=b[d++],a.Ka=b[d++],a.Ja=b[d++],f=b[d++],void 0!==f?a.ka=f:void 0===a.ka&&(a.ka=-1);void 0===a.A&&(a.A=Array(a.ua.length));b=b[d];void 0===b&&(b=[]);
for(d=0;d<a.A.length;d++){void 0===a.A[d]&&(a.A[d]={});var f=a.A[d],g=a,h=d,k=f,m=a.ua[d],n=b[d],t=c,q=0,A=!0;n||(n=[0,0,!1,Array(8)]);k.hb=h;k.errorCode=n[q++];k.Vk=n[q++];k.cf=n[q++];k.Te=n[q++];k.Ue=n[q++];k.kb=n[q++];k.ub=n[q++];k.be=n[q++];k.xb=n[q++];k.fe=n[q++];k.Hb=n[q++];k.rg=g.ia?0:1;k.name=m.name;void 0===k.name&&(k.name="Hard Drive");k.path=m.path;k.mode=m.mode||(k.path?"preload":"local");"demandro"!=k.mode&&"demandrw"!=k.mode||g.ie()||(k.mode="local");k.type=m.type;if(void 0===k.type||
void 0===Rp[g.U][k.type])k.type=g.Ga;m=Rp[g.U][k.type];k.lb=m[2]||17;k.Va=m[3]||512;if(t&&g.N){var m=g.N,F=k.type;if(m.A){var t=null,C=m.A[18];15<F&&(t=F,F=15);h?(C=C&240|F,F=26):(C=C&15|F<<4,F=25);var D=m;D.A&&(D.A[18]=C,al(D));null!=t&&m.A&&(m.A[F]=t,al(m))}}void 0===k.za&&(k.za=null,g.Na("Type "+k.type+' "'+k.name+'" is fixed disk '+h,!0));Zp(g,k);k.eb=n[q++];k.pb=null;k.za&&(g=n[q],void 0!==g&&0>k.za.restore(g)&&(A=!1),A&&void 0!==k.eb&&(k.pb=k.za.seek(k.be,k.kb,k.xb+k.rg)));A||(e=!1);null!=a.pa&&
1>=d&&(a.pa|=(f.type&3)<<(1-d<<1))}0<=a.hb&&(a.B=a.A[a.hb]);return e}
function Yp(a){var b=0,c=[];a.ia?(c[b++]=a.W,c[b++]=a.Pa,c[b++]=a.aa,c[b++]=a.Ca,c[b++]=a.ya,c[b++]=a.va,c[b++]=a.ra,c[b++]=a.ma,c[b++]=a.Da,c[b++]=[a.fa,a.hb]):(c[b++]=a.pa,c[b++]=a.ma,c[b++]=a.V,c[b++]=a.L,c[b++]=a.C,c[b++]=a.Oa,c[b++]=a.Ka,c[b++]=a.Ja,c[b++]=a.ka);for(var d=0,e=[],f=0;f<a.A.length;f++){var g=d++,h=a.A[f],k=0,m=[];m[k++]=h.errorCode;m[k++]=h.Vk;m[k++]=h.cf;m[k++]=h.Te;m[k++]=h.Ue;m[k++]=h.kb;m[k++]=h.ub;m[k++]=h.be;m[k++]=h.xb;m[k++]=h.fe;m[k++]=h.Hb;m[k++]=h.eb;m[k]=h.za?h.za.save():
null;e[g]=m}c[b]=e;return c}l.mj=function(a){var b;a=this.A[a];if(void 0!==a){b={};for(var c in a)b[c]=a[c]}return b};function Zp(a,b,c){if(b){var d=0,e=0;null==c&&((d=b.Te[2])?e=b.Te[0]<<8|b.Te[1]:c=b.type);null==c||d||(d=Rp[a.U][c][1],e=Rp[a.U][c][0]);d&&((c=Rp[a.U][b.type])&&e!=c[0]&&d!=c[1]&&a.Na("Warning: drive parameters ("+e+","+d+") do not match drive type "+b.type+" ("+c[0]+","+c[1]+")"),b.Bb=e,b.ub=d,null==b.za&&(b.za=new Lo(a,b,b.mode)))}}
l.Uk=function(a,b,c){if(a.za){var d=a.za.info(),e=d[0];if(e){var f=d[2],g=d[1]*f;if(b+c<=e*g)return a.be=Math.floor(b/g),b%=g,a.kb=Math.floor(b/f),a.xb=b%f,a.Hb=c*d[3],a.errorCode=0,!0}}return!1};
function Wp(a,b){b||(a.ea=0);for(var c=0;c<a.A.length;c++){var d=a.A[c];if(d.name&&d.path){if(!(b&&d.za&&d.za.xg)){var e;e=a;var f=d.name,d=d.path,g=e.A[c];g.$e?(e.Na("Drive "+c+" busy"),e=!0):(g.$e=!0,g.Ce=!0,e.ea++,z(e)&&y(e,"loading "+f),(g.za||new Lo(e,g,g.mode)).load(f,d,null,e.yl),e=!1);!e&&b&&xb(a,!1)}}else b&&void 0!==d.type&&(d.za=null,Zp(a,d,d.type))}return!!a.ea}
l.yl=function(a,b,c){a.$e=!1;if(a.za=b)this.Na('Mounted disk "'+c+'" in drive '+String.fromCharCode(67+a.hb),a.Ce),b=b.info(),b[0]==a.Bb&&b[1]==a.ub&&b[2]==a.lb&&b[3]==a.Va||this.Na("Warning: disk geometry ("+b[0]+":"+b[1]+":"+b[2]+") does not match "+Qp[this.U]+" drive type "+a.type+" ("+a.Bb+":"+a.ub+":"+a.lb+")");a.Ce&&(a.Ce=!1,--this.ea||xb(this))};
l.Lm=function(a,b){var c=0;this.L<this.C&&(c=this.V[this.L]);this.N&&lg(this.N,5);this.ma&=-33;x(this,a,null,b,"DATA["+this.L+"]",c);++this.L>=this.C&&(this.L=this.C=0,this.ma&=-15);return c};l.ho=function(a,b,c){x(this,a,b,c,"DATA["+this.C+"]");this.C<this.V.length&&(this.V[this.C++]=b);a=12!=this.V[0]?6:this.V.length;6==this.C&&(this.ma&=-2);this.C>=a&&(this.ma|=2,this.ma&=-2,$p(this))};l.Mm=function(a,b){var c=this.ma;x(this,a,null,b,"STATUS",c);this.L<this.C&&(this.ma|=1);return c};
l.ko=function(a,b,c){x(this,a,b,c,"RESET");this.Oa=b;this.N&&lg(this.N,5);Xp(this)};l.Km=function(a,b){x(this,a,null,b,"CONFIG",this.pa);return this.pa};l.jo=function(a,b,c){x(this,a,b,c,"PULSE");this.Ka=b;this.ma=13};l.io=function(a,b,c){x(this,a,b,c,"PATTERN");this.Ja=b};l.pi=function(a,b,c){x(this,a,b,c,"NOISE")};
function aq(a,b,c){var d=-1;a.B&&(d=a.Le(a.B,function(){}),1==a.B.eb||a.B.eb==a.B.Va)&&(z(a,1048832)&&x(a,b,null,c,"DATA["+a.B.eb+"]",d),1<a.B.eb&&(a.B.Hb-=a.B.Va,a.aa=a.aa-1&255,a.B.Hb>=a.B.Va?(a.ma=128,a.Le(a.B,function(b){0<=b?(bq(a),a.N&&5180==a.N.ja&&(a.ma=0),a.ma|=88):(a.ma=1,a.W=16)},!1)):a.ma=80));return d}l.il=function(a,b){return aq(this,a,b)|aq(this,a,b)<<8};
function cq(a,b,c,d){if(a.B&&a.B.Hb>=a.B.Va)if(0>dq(a.B,c))a.ma=1,a.W=16;else if(1==a.B.eb||a.B.eb==a.B.Va)z(a,1048832)&&x(a,b,c,d,"DATA["+a.B.eb+"]"),1<a.B.eb&&(a.B.Hb-=a.B.Va,a.aa=a.aa-1&255,bq(a),a.ma=80,a.B.Hb>=a.B.Va&&(a.ma|=8))}l.qn=function(a,b,c){cq(this,a,b&255,c);cq(this,a,b>>8&255,c)};l.Sl=function(a,b){var c=this.W;x(this,a,null,b,"ERROR",c);return c};l.vn=function(a,b,c){x(this,a,b,c,"WPREC");this.Pa=b};l.Ul=function(a,b){var c=this.aa;x(this,a,null,b,"SECCNT",c);return c};
l.tn=function(a,b,c){x(this,a,b,c,"SECCNT");this.aa=b};l.Vl=function(a,b){var c=this.Ca;x(this,a,null,b,"SECNUM",c);return c};l.un=function(a,b,c){x(this,a,b,c,"SECNUM");this.Ca=b};l.Ql=function(a,b){var c=this.ya;x(this,a,null,b,"CYLLO",c);return c};l.pn=function(a,b,c){x(this,a,b,c,"CYLLO");this.ya=b};l.Pl=function(a,b){var c=this.va;x(this,a,null,b,"CYLHI",c);return c};l.on=function(a,b,c){x(this,a,b,c,"CYLHI");this.va=b};l.Rl=function(a,b){var c=this.ra;x(this,a,null,b,"DRVHD",c);return c};
l.rn=function(a,b,c){x(this,a,b,c,"DRVHD");this.ra=b;this.ma=this.A[this.ra&16?1:0]?this.ma|80:this.ma&-65};l.Wl=function(a,b){var c=this.ma;x(this,a,null,b,"STATUS",c);this.ma&64&&(this.ma&=-129);return c};l.nn=function(a,b,c){x(this,a,b,c,"COMMAND");this.Da=b;this.N&&lg(this.N,14);eq(this)};l.sn=function(a,b,c){x(this,a,b,c,"FDR");this.fa&4&&!(b&4)&&(this.W=1);this.fa=b};
function eq(a){var b=!1,c=a.Da,d=a.ra&16?1:0,e=a.ra&15,f=a.ya|(a.va&3)<<8,g=a.Ca,h=a.aa||256;a.hb=-1;a.B=null;a.W=0;a.ma=80;var k=a.A[d];k?(k.be=f,k.kb=e,k.xb=g,k.Hb=h*k.Va,c=144<=c?c:c&240,k.pb=null,k.eb=0,k.errorCode=0,a.hb=d,a.B=k):c=-1;switch(c&240){case 16:b=!0;break;case 32:a.ma=128;a.Le(k,function(b){0<=b&&a.N?(bq(a),a.ma=88):(a.ma=1,a.W=16)},!1);break;case 48:a.ma=8;break;case 64:b=!0;break;case 112:b=!0;break;case 144:a.W=1;b=!0;break;case 145:k.ub=e+1,k.lb=h,b=!0}b&&bq(a)}
function bq(a){!a.N||a.fa&2||mg(a.N,14,120)}
function $p(a){a.L=0;var b=fq(a),c=fq(a),d=c&32,e=d>>5,f=c&31,g=fq(a),h=fq(a),k=g<<2&768|h,m=g&63,n=fq(a),t=fq(a),q=a.A[e];q&&(q.be=k,q.kb=f,q.xb=m,q.Hb=n*q.Va);switch(b){case 3:gq(a,q?q.errorCode:4);hq(a,c);hq(a,g);hq(a,h);hq(a,0|d);b=-1;break;case 12:for(c=0;0<=(b=fq(a));)q&&c<q.Te.length&&(q.Te[c++]=b);q&&Zp(a,q);b=0;q||a.ka!=e||(a.ka=-1,b=2);gq(a,b|d);b=-1;break;case 224:case 228:gq(a,0|d),b=-1}if(0<=b)switch(void 0===q?b=-1:(q.errorCode=0,q.Vk=0),b){case 0:gq(a,0|d);break;case 1:q.Df=t;gq(a,
0|d);break;case 5:gq(a,0|d);break;case 8:iq(a,q,function(b){gq(a,b|d)});break;case 10:jq(a,q,function(b){gq(a,b|d)});break;case 15:kq(a,q,function(b){gq(a,b|d)});break;default:gq(a,2|d)}}function fq(a){var b=-1;a.L<a.C&&(b=a.V[a.L++]);return b}function gq(a,b){a.L=a.C=0;void 0!==b&&hq(a,b);a.N&&mg(a.N,5);a.ma|=32}function hq(a,b){a.V[a.C++]=b}l.gl=function(a,b,c){void 0===b||0>b?this.Le(a,c):c(-1,!1)};l.hl=function(a,b){return void 0!==b&&0<=b?dq(a,b):-1};
l.wl=function(a,b){void 0!==b&&0<=b?(a.eb<a.Ue.length?a.Ue[a.eb++]=b:(a.errorCode=20,b=-1),a=b):a=-1;return a};l.xl=function(a,b){if(void 0!==b&&0<=b)a:if(a.errorCode)a=-1;else{a.ld[a.We++]=b;if(a.We==a.ld.length){a.be=a.ld[0];a.kb=a.ld[1];a.xb=a.ld[2];a.Hb=128<<a.ld[3];for(var c=a.We=0;c<a.Hb;c++)if(0>dq(a,a.cj)){a=-1;break a}a.sg++}a.sg>=a.fe&&(b=-1);a=b}else a=-1;return a};
function iq(a,b,c){b.errorCode=4;if(b.za&&(b.pb=null,a.N)){b.errorCode=0;Cl(a.N,3,a,"dmaRead",b);ul(a.N,3,function(a){a||0!=b.errorCode||(b.errorCode=4);c(b.errorCode?2:0)});return}c(b.errorCode?2:0)}function jq(a,b,c){b.errorCode=4;if(b.za&&(b.pb=null,a.N)){b.errorCode=0;Cl(a.N,3,a,"dmaWrite",b);ul(a.N,3,function(a){a||(0==b.errorCode&&(b.errorCode=4),20==b.errorCode&&(b.errorCode=0));c(b.errorCode?2:0)});return}c(b.errorCode?2:0)}
function kq(a,b,c){b.errorCode=4;b.Ue&&b.Ue.length==b.Hb||(b.Ue=Array(b.Hb));b.eb=0;a.N?(b.errorCode=0,Cl(a.N,3,a,"dmaWriteBuffer",b),ul(a.N,3,function(a){a||0!=b.errorCode||(b.errorCode=4);c(b.errorCode?2:0)})):c(b.errorCode?2:0)}
l.Le=function(a,b,c){var d=-1,e=null,f=0;if(a.errorCode)return b&&b(d,!1,e,f),d;var g=!1!==c?1:0;if(a.pb&&(f=a.eb,d=a.za.read(a.pb,a.eb),a.eb+=g,0<=d))return e=a.pb,b&&b(d,!1,e,f),d;if(b){if(a.za)return a.za.seek(a.be,a.kb,a.xb+a.rg,!1,function(c,k){(a.pb=c)?(e=c,f=a.eb=0,lq(a),d=a.za.read(a.pb,a.eb),a.eb+=g):a.errorCode=20;b(d,k,e,f)}),d;a.errorCode=20;b(d,!1,e,f)}return d};
function dq(a,b){if(a.errorCode)return-1;do{if(a.pb&&a.za.write(a.pb,a.eb++,b))break;a.za&&a.za.seek(a.be,a.kb,a.xb+a.rg,!0,function(b){a.pb=b});if(!a.pb){a.errorCode=20;b=-1;break}a.eb=0;lq(a)}while(1);return b}function lq(a){a.xb++;var b=1-a.rg;a.xb>=a.lb+b&&(a.xb=b,a.kb++,a.kb>=a.ub&&(a.kb=0,a.be++))}l.Nm=function(){var a=this.F.M&255;!(this.F.G>>8)&&128<a&&(this.ka=a-128);return!0};l.Om=function(){var a;(a=this.F.G>>8||!this.N)||(a=!(this.N.vc[0].Ad&64));return a?!0:!1};
var Tp={800:Pp.prototype.Lm,801:Pp.prototype.Mm,802:Pp.prototype.Km},Sp={496:Pp.prototype.il,497:Pp.prototype.Sl,498:Pp.prototype.Ul,499:Pp.prototype.Vl,500:Pp.prototype.Ql,501:Pp.prototype.Pl,502:Pp.prototype.Rl,503:Pp.prototype.Wl},Vp={800:Pp.prototype.ho,801:Pp.prototype.ko,802:Pp.prototype.jo,803:Pp.prototype.io,807:Pp.prototype.pi,811:Pp.prototype.pi,815:Pp.prototype.pi},Up={496:Pp.prototype.qn,497:Pp.prototype.vn,498:Pp.prototype.tn,499:Pp.prototype.un,500:Pp.prototype.pn,501:Pp.prototype.on,
502:Pp.prototype.rn,503:Pp.prototype.nn,1014:Pp.prototype.sn};Xa(function(){for(var a=tb(document,"pcx86","hdc"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new Pp(d);sb(d,c)}});function mq(a){bb.call(this,"Debugger",a,mq);this.Ya=a.base||16;this.pa=this.Ca=this.ea=0;this.va=!1;this.A=-1;this.C=[];this.ya={}}jb(mq);var nq={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};mq.prototype.oh=function(){return-1};mq.prototype.ph=function(){};
mq.prototype.Pk=function(a,b){return a.replace("["+b+"]","unimplemented")};mq.prototype.Ng=function(a,b,c){if(b)if(a){0>this.A&&this.C.length&&(this.A=0);if(0>this.A||a!=this.C[this.A])this.C.splice(0,0,a),this.A=0;this.A--}else this.va?a="end":a=this.C[this.A+1];b=[];if(a){a=a.replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(qa(a.substring(d,f))),d=f+1}}return b};
function oq(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<<e;break;case ">>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f<e?1:0;break;case "<=":d=f<=e?1:0;break;case ">":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break;
case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0}
function pq(a,b,c){var d;if(b){b=qq(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],t=n.length,n=qa(n);if(!n){f=!0;break}n=rq(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],q=n.length;k.length&&nq[n]<nq[k[k.length-1]]&&oq(h,k,1);k.push(n);b=b.substr(t+q)}oq(h,k)&&1==h.length||(f=!0);f?c&&a.O("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&sq(a,null,
d))}return d}function qq(a,b){for(var c,d=/\{(.*?)\}/;(c=b.match(d))&&!(0<=c[1].indexOf("{"));){var e=pq(a,c[1]);b=b.replace("{"+c[1]+"}",null!=e?tq(a,e):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=a.Pk(b,c[1]);for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.pa-a.Ca}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
function rq(a,b,c,d){var e;null!=b?(e=a.oh(b),0<=e?e=a.ph(e):(e=a.ya[b],null==e&&(e=ea(b,a.Ya))),null!=e||d||a.O("invalid "+(c?c:"value")+": "+b)):d||a.O("missing "+(c||"value"));return e}function sq(a,b,c){var d,e=!1;void 0!==c&&(e=!0,d=r(c,0,!0)+" "+c+". "+ia(c,0,!0)+" "+ha(c,0,!0),32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'"));a.O((null!=b?b+": ":"")+d);return e}function uq(a,b){if(b)return sq(a,b,a.ya[b]);var c=0;for(b in a.ya)sq(a,b,a.ya[b]),c++;return 0<c}
function tq(a,b){switch(a.Ya){case 8:a=ia(b,NaN);break;case 10:a=b.toString();break;default:a=r(b,NaN)}return a}function vq(a){mq.call(this,a);this.Ja=4;this.Da=5;this.Ba=1048575;this.aa=wq(this);this.Db=wq(this);this.ua=wq(this);this.N=[];this.B=this.ra=this.fa=[];xq(this);this.Oa=0;yq(this);this.cb={};zq(this,a.messages);this.qb=a.commands;var b=this;window?void 0===window.pcx86&&(window.pcx86=function(a){return Aq(b,a)}):void 0===global.pcx86&&(global.pcx86=function(a){return Aq(b,a)})}jb(vq,mq);
var Bq={16:262144,19:524288,21:32768,22:65536,28:2048,33:134217728,51:16777216},Cq=[26,28,40,42,109],Dq={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression",k:"stack trace",l:"load sector(s)",ln:"list nearest symbol(s)",m:"messages",mouse:"mouse action","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",
"t [#]":"trace","u [#]":"unassemble",x:"execution options",v:"print version","var":"assign variable"},Eq="INVALID AAA AAD AAM AAS ADC ADD AND ARPL AS: BOUND BSF BSR BT BTC BTR BTS CALL CBW CLC CLD CLI CLTS CMC CMP CMPSB CMPSW CS: CWD DAA DAS DEC DIV DS: ENTER ES: ESC FS: GS: HLT IBTS IDIV IMUL IN INC INS INT INT3 INTO IRET JBE JC JCXZ JG JGE JL JLE JMP JA JNC JNO JNP JNS JNZ JO JP JS JZ LAHF LAR LDS LEA LEAVE LES LFS LGDT LGS LIDT LLDT LMSW LOADALL LOCK LODSB LODSW LOOP LOOPNZ LOOPZ LSL LSS LTR MOV MOVSB MOVSW MOVSX MOVZX MUL NEG NOP NOT OR OS: OUT OUTS POP POPA POPF PUSHF PUSHA PUSH RCL RCR REPNZ REPZ RET RETF ROL ROR SAHF SALC SAR SBB SCASB SCASW SETBE SETC SETG SETGE SETL SETLE SETNBE SETNC SETNO SETNP SETNS SETNZ SETO SETP SETS SETZ SGDT SHL SHLD SHR SHRD SIDT SLDT SMSW SS: STC STD STI STOSB STOSW STR SUB TEST VERR VERW WAIT XBTS XCHG XLAT XOR".split(" "),
Fq="FLD FST FSTP FXCH FILD FIST FISTP FBLD FBSTP FADD FADDP FIADD FSUB FSUBP FISUB FSUBR FSUBRP FISUBR FMUL FMULP FIMUL FDIV FDIVP FIDIV FDIVR FDIVRP FIDIVR FSQRT FSCALE FPREM FRNDINT FXTRACT FABS FCHS FCOM FCOMP FCOMPP FICOM FICOMP FTST FXAM FPTAN FPATAN F2XM1 FYL2X FYL2XP1 FLDZ FLD1 FLDPI FLDL2T FLDL2E FLDLG2 FLDLN2 FINIT FNINIT FDISI FNDISI FENI FNENI FLDCW FSTCW FNSTCW FSTSW FNSTSW FCLEX FNCLEX FSTENV FNSTENV FLDENV FSAVE FNSAVE FRSTOR FINCSTP FDECSTP FFREE FFREEP FNOP FWAIT FSETPM FSINCOS FSTSWAX".split(" "),
Gq=["VALID","ZERO ","SPEC ","EMPTY"],Hq=[8086,80186,80286,80386],Iq=["AL","CL","DL","BL","AH","CH","DH","BH","AX","CX","DX","BX","SP","BP","SI","DI","ES","CS","SS","DS","FS","GS","IP","PS","EAX","ECX","EDX","EBX","ESP","EBP","ESI","EDI","CR0","CR1","CR2","CR3",null,null,null,null,"DR0","DR1","DR2","DR3",null,null,"DR6","DR7",null,null,null,null,null,null,"TR6","TR7","EIP"],Jq="BX+SI BX+DI BP+SI BP+DI SI DI BP BX EAX ECX EDX EBX ESP EBP ESI EDI".split(" "),Kq=[0,0],Lq=[176,12291],Mq=[[6,12417,4273],
[6,12420,4276],[6,12465,4225],[6,12468,4228],[6,12385,4097],[6,14436,4100],[108,4211],[103,8307],[99,12417,4273],[99,12420,4276],[99,12465,4225],[99,12468,4228],[99,12385,4097],[99,14436,4100],[108,4467],[103,8563],[5,12417,4273],[5,12420,4276],[5,12465,4225],[5,12468,4228],[5,12385,4097],[5,14436,4100],[108,4723],[103,8819],[120,12417,4273],[120,12420,4276],[120,12465,4225],[120,12468,4228],[120,12385,4097],[120,14436,4100],[108,4979],[103,9075],[7,12417,4273],[7,12420,4276],[7,12465,4225],[7,12468,
4228],[7,12385,4097],[7,14436,4100],[35,8],[29],[154,12417,4273],[154,12420,4276],[154,12465,4225],[154,12468,4228],[154,12385,4097],[154,14436,4100],[27,8],[30],[162,12417,4273],[162,12420,4276],[162,12465,4225],[162,12468,4228],[162,12385,4097],[162,14436,4100],[147,8],[1],[24,4225,4273],[24,4228,4276],[24,4273,4225],[24,4276,4228],[24,4193,4097],[24,6244,4100],[33,8],[4],[44,14436],[44,14692],[44,14948],[44,15204],[44,15460],[44,15716],[44,15972],[44,16228],[31,14436],[31,14692],[31,14948],[31,
15204],[31,15460],[31,15716],[31,15972],[31,16228],[108,6244],[108,6500],[108,6756],[108,7012],[108,7268],[108,7524],[108,7780],[108,8036],[103,10340],[103,10596],[103,10852],[103,11108],[103,11364],[103,11620],[103,11876],[103,12132],[107,32768],[104,32768],[10,37044,4228],[8,8323,4275],[37,49160],[38,49160],[100,49160],[9,49160],[108,36868],[42,45235,4228,4100],[108,36866],[42,41139,4228,4097],[45,41041,6756],[45,41044,6756],[102,39524,4161],[102,39524,4164],[64,4145],[60,4145],[51,4145],[59,4145],
[67,4145],[63,4145],[50,4145],[58,4145],[66,4145],[62,4145],[65,4145],[61,4145],[55,4145],[54,4145],[56,4145],[53,4145],[163,12417,4097],[164,12420,4100],[163,12417,4097],[165,12420,4097],[155,4225,4273],[155,4228,4276],[160,12465,12417],[160,12468,12420],[90,8321,4273],[90,8324,4276],[90,8369,4225],[90,8372,4228],[90,8324,4291],[71,8372,148],[90,8387,4228],[103,8324],[97],[160,14436,14692],[160,14436,14948],[160,14436,15204],[160,14436,15460],[160,14436,15716],[160,14436,15972],[160,14436,16228],
[18],[28],[17,4103],[158],[106],[105],[117],[68],[90,8289,4129],[90,10340,4132],[90,8225,4193],[90,8228,6244],[91,8273,4161],[92,8276,4164],[25,4177,4161],[26,4180,4164],[155,4193,4097],[155,6244,4100],[151,8273,4193],[152,8276,6244],[82,8289,4161],[83,10340,4164],[121,4193,4177],[122,6244,4180],[90,8289,4097],[90,8545,4097],[90,8801,4097],[90,9057,4097],[90,9313,4097],[90,9569,4097],[90,9825,4097],[90,10081,4097],[90,10340,4100],[90,10596,4100],[90,10852,4100],[90,11108,4100],[90,11364,4100],[90,
11620,4100],[90,11876,4100],[90,12132,4100],[166,28801,4097],[167,28804,4097],[113,4099],[113],[73,8372,4246],[70,8372,4246],[90,8321,4097],[90,8324,4100],[34,36867,4097],[72,32768],[114,4099],[114],[47],[46,4097],[48],[49],[168,12417,4113],[169,12420,4113],[170,12417,4449],[171,12420,4449],[3,1],[2,1],[118],[161],[36,4228],[36,4228],[36,4228],[36,4228],[36,4228],[36,4228],[36,4228],[36,4228],[85,4145],[86,4145],[84,4145],[52,4145],[43,8289,4097],[43,10340,4097],[101,4097,4193],[101,4097,6244],[17,
4148],[57,4148],[57,4103],[57,4145],[43,8289,6759],[43,10340,6759],[101,6759,4193],[101,6759,6244],[81,8],[0],[111,8],[112,8],[39],[23],[172,12417],[173,12420],[19],[148],[21],[150],[20],[149],[174,12417],[175,12420]],Nq={0:[177,12419],1:[178,12419],2:[69,41139,4243],3:[87,41139,4243],5:[80,32768],6:[22,32768],7:[80,49152],32:[90,57509,4309],33:[90,57509,4325],34:[90,57557,4261],35:[90,57573,4261],36:[90,57509,4341],38:[90,57589,4261],128:[64,53300],129:[60,53300],130:[51,53300],131:[59,53300],132:[67,
53300],133:[63,53300],134:[50,53300],135:[58,53300],136:[66,53300],137:[62,53300],138:[65,53300],139:[61,53300],140:[55,53300],141:[54,53300],142:[56,53300],143:[53,53300],144:[135,57473],145:[131,57473],146:[124,57473],147:[130,57473],148:[138,57473],149:[134,57473],150:[123,57473],151:[129,57473],152:[137,57473],153:[133,57473],154:[136,57473],155:[132,57473],156:[127,57473],157:[126,57473],158:[128,57473],159:[125,57473],160:[108,54387],161:[103,58483],163:[13,53380,4276],164:[141,57476,4276,4097],
165:[141,57476,4276,4449],166:[159,57524,4228,6244,4449],167:[40,57476,6244,4449,4276],168:[108,54643],169:[103,58739],171:[16,57476,4276],172:[143,57476,4276,4097],173:[143,57476,4276,4449],175:[42,61572,4276],178:[88,8372,4246],179:[15,57476,4276],180:[74,8372,4246],181:[76,8372,4246],182:[94,57524,4225],183:[94,57525,4227],186:[179,61572,4097],187:[14,57476,4276],188:[11,57524,4228],189:[12,57524,4228],190:[93,57524,4225],191:[93,57525,4227]},Oq={216:{0:[9,4235],1:[18,4235],2:[34,4235],3:[35,4235],
4:[12,4235],5:[15,4235],6:[21,4235],7:[24,4235],48:[9,8297,4202],49:[18,8297,4202],50:[34,8297,4202],51:[35,8297,4202],52:[12,8297,4202],53:[15,8297,4202],54:[21,8297,4202],55:[24,8297,4202]},217:{0:[0,4235],2:[1,8331],3:[2,8331],4:[68,4239],5:[59,4227],6:[66,8335],7:[60,8323],48:[0,8298],49:[3,8298],50:[76],51:[2,8298],64:[33],65:[32],68:[39],69:[40],80:[47],81:[49],82:[50],83:[48],84:[51],85:[52],86:[46],96:[43],97:[44],98:[41],99:[42],100:[31],102:[73],103:[72],112:[29],113:[45],114:[27],116:[30],
117:[28]},218:{0:[11,4235],1:[20,4235],2:[37,4235],3:[38,4235],4:[14,4235],5:[17,4235],6:[23,4235],7:[26,4235]},219:{0:[4,4235],2:[5,8331],3:[6,8331],5:[0,4237],7:[2,8333],64:[57],65:[55],66:[64],67:[53],68:[78,32768],115:[79,49152]},220:{0:[9,4236],1:[18,4236],2:[34,4236],3:[35,4236],4:[12,4236],5:[15,4236],6:[21,4236],7:[24,4236],48:[9,8298,4201],49:[18,8298,4201],50:[34,4202],51:[35,4202],52:[15,8298,4201],53:[12,8298,4201],54:[24,8298,4201],55:[21,8298,4201]},221:{0:[0,4236],2:[1,8332],3:[2,8332],
4:[71,4239],6:[69,8335],7:[62,8323],48:[74,4202],49:[3,8298],50:[1,4202],51:[2,4202]},222:{0:[11,4227],1:[20,4227],2:[37,4227],3:[38,4227],4:[14,4227],5:[17,4227],6:[23,4227],7:[26,4227],48:[10,8298,4201],49:[19,8298,4201],50:[35,4202],51:[36,4202],52:[16,8298,4201],53:[13,8298,4201],54:[25,8298,4201],55:[22,8298,4201]},223:{0:[4,4227],2:[5,8323],3:[6,8323],4:[7,4238],5:[4,4236],6:[8,8334],7:[6,8332],48:[75,4202],49:[3,8298],50:[2,4202],51:[2,4202],52:[80,32768]}},Pq=[[[6,12417,4097],[99,12417,4097],
[5,12417,4097],[120,12417,4097],[7,12417,4097],[154,12417,4097],[162,12417,4097],[24,4225,4097]],[[6,12420,4100],[99,12420,4100],[5,12420,4100],[120,12420,4100],[7,12420,4100],[154,12420,4100],[162,12420,4100],[24,4228,4100]],[[6,12420,4098],[99,12420,4098],[5,12420,4098],[120,12420,4098],[7,12420,4098],[154,12420,4098],[162,12420,4098],[24,4228,4098]],[[115,45185,4097],[116,45185,4097],[109,45185,4097],[110,45185,4097],[140,45185,4097],[142,45185,4097],Kq,[119,45185,4097]],[[115,45188,4097],[116,
45188,4097],[109,45188,4097],[110,45188,4097],[140,45188,4097],[142,45188,4097],Kq,[119,45188,4097]],[[115,12417,4113],[116,12417,4113],[109,12417,4113],[110,12417,4113],[140,12417,4113],[142,12417,4113],Kq,[119,12417,4113]],[[115,12420,4113],[116,12420,4113],[109,12420,4113],[110,12420,4113],[140,12420,4113],[142,12420,4113],Kq,[119,12420,4113]],[[115,12417,4449],[116,12417,4449],[109,12417,4449],[110,12417,4449],[140,12417,4449],[142,12417,4449],Kq,[119,12417,4449]],[[115,12420,4449],[116,12420,
4449],[109,12420,4449],[110,12420,4449],[140,12420,4449],[142,12420,4449],Kq,[119,12420,4449]],[[155,4225,4097],Kq,[98,12417],[96,12417],[95,4225],[42,12417],[32,4225],[41,12417]],[[155,4228,4100],Kq,[98,12420],[96,12420],[95,4228],[42,12420],[32,4228],[41,12420]],[[44,12417],[31,12417],Kq,Kq,Kq,Kq,Kq,Kq],[[44,12420],[31,12420],[17,4228],[17,4231],[57,4228],[57,4231],[108,4228],Kq],[],[[145,41091],[153,41091],[78,36995],[89,36995],[156,36995],[157,36995],Kq,Kq],[[139,41091],[144,41091],[75,36995],
[77,36995],[146,41091],Kq,[79,36995],Kq],[Kq,Kq,Kq,Kq,[13,53380,4097],[16,57476,4097],[15,57476,4097],[14,57476,4097]]];l=vq.prototype;
l.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.X=a;this.tc=Jb(a,"FDC");this.Jb=Jb(a,"HDC");this.Tb=Jb(a,"FPU");this.V=Jb(a,"Mouse");(a=Yc(a,"messages"))&&zq(this,a);this.Da=b.N>>2;this.Ba=b.Dg;this.bc=new kd(this.F,7,"DBG");this.Ga=Mq;80186<=this.F.ja&&(this.Ga=Mq.slice(),this.Ga[15]=Kq,80286<=this.F.ja&&(this.Ga[15]=Lq,80386<=this.F.ja&&(this.Ja=8)));Qk(this,64,function(a){Qq(d,d.F.kd,a[0])});Qk(this,4,function(a){if(a=a[0]){var b=rq(d,a);if(void 0===b)d.O("invalid selector: "+a);else if(a=Rq(d,
b,2),d.O("dumpSel("+v(a?a.Z:b)+"): %"+r(a?a.Xb:null,d.Da)),a){var c,b=!1;if(a.type&4096)a.type&2048?(c="code"+(a.type&512?",readable":",execonly"),a.type&1024&&(c+=",conforming")):(c="data"+(a.type&512?",writable":",readonly"),a.type&1024&&(c+=",expdown")),a.type&256&&(c+=",accessed");else{var e=Sq[a.type];e&&(c=e[0],b=e[1])}!c||a.wb&32768||(c+=",not present");d.O((b?"seg="+v(a.Aa&65535)+" off="+v(a.Ta):"base="+r(a.Aa,d.Da)+" limit="+Tq(a.Ta))+" type="+u(a.type>>8)+" ("+c+") ext="+v(a.ext&-65296)+
" dpl="+u(a.Gc))}}else d.O("no selector")});Qk(this,134217728,function(a){var b;(a=a[0])&&(b=rq(d,a));if(void 0===b)d.O("invalid MCB");else for(d.O("dumpMCB("+v(b)+")");b;){a=wq(d,0,b);var c=d.Qa(a,1),e=d.na(a,2),k=d.na(a,5);if(77!=c&&90!=c)break;d.O(Uq(0,b)+": '"+String.fromCharCode(c)+"' PID="+v(e)+" LEN="+v(k)+' "'+Vq(d,a,8)+'"');b+=1+k}});Qk(this,128,function(a){Qq(d,d.F.sa,a[0],d.F.sa!==d.F.kd)});Qk(this,8,function(a){a:{if(a=a[0]){var b=rq(d,a);if(void 0===b){d.O("invalid task selector: "+a);
break a}a=Rq(d,b,2)}else a=d.F.Sa;d.O("dumpTSS("+v(a?a.Z:b)+"): %"+r(a?a.Aa:null,d.Da));if(a){var b="",c=a.type&-513,e=256==c?4:8,k=256==c?Wq:Xq,m,n,t,q;for(q in k)m=k[q],n=a.Aa+m,t=Qf(d.F,n,2),2304==c&&(t|=Qf(d.F,n+2,2)<<16),b&&(b+="\n"),b+=v(m)+" "+pa(q+":",11)+r(t,e);if(2304==c)for(q=0,m=t>>>16;m<a.Zb&&1023>q;)n=a.Aa+m,t=Qf(d.F,n,2),b+="\n"+v(m)+" ports "+v(q)+"-"+v(q+15)+": "+ha(t,2),q+=16,m+=2;d.O(b)}}});this.L=null;this.sb=0;this.fb=!1;lf(this.F,48,this.Qm.bind(this));lf(this.F,65,this.Rm.bind(this));
this.ka=null;lf(this.F,104,this.Sm.bind(this));xb(this)};function Yq(a,b,c,d,e,f){b=Vq(a,b);var g=Rq(a,d),g=g?g.Ta+1:0,h=(e?"_CODE":"_DATA")+r(c,2);f&&z(a,128)&&a.message(b+" "+(e?"code":"data")+"("+r(c,4)+")=#"+r(d,4)+" len "+r(g));e=Zq(a,b,c);e[b+h]=0;fm(a,b,c,d,0,null,g,e)}
function $q(a,b,c,d){var e=a.na(b,2),f=a.na(b,2),g=a.oa(b,4),h=a.oa(b,4),k=wq(a,a.oa(b,4),a.na(b,2));b=wq(a,a.oa(b,4),a.na(b,2));b=Vq(a,b).toUpperCase();var k=Vq(a,k).toUpperCase(),m=(c?"_CODE":"_DATA")+r(e,2);d&&z(a,128)&&a.message((b==k?"":b+"!")+k+" "+(c?"code":"data")+"("+r(e,4)+")="+r(f,4)+":"+r(g)+" len "+r(h));c=Zq(a,k,e);c[k+m]=g;fm(a,k,e,f,g,null,h,c)}function ar(a,b,c){c=Vq(a,c).toUpperCase();br(a,c,b)}
l.Qm=function(){var a=this.F;if(null!=this.L&&2752554==a.G){var b=a.M&65535,c=a.K&65535,d=wq(this,J(a)+12,a.ta.Z);switch(this.oa(d)){case 336:$q(this,wq(this,a.H,b),!c,!!this.L)}}return!0};
l.Rm=function(a){var b=this.F,c=b.G&65535,d=b.H&65535,e=b.I&65535,f=b.M&65535,g=b.K&65535,h=b.J&65535,k=b.Xa.Z;if(null==this.L)return 79==c&&mf(b,a,function(a){return function(){62342!=(b.G&65535)?(b.G=b.G&-65536|62342,y(a,"INT 0x41 handling enabled",128),a.L=!0):(y(a,"INT 0x41 monitoring enabled",128),a.L=!1)}}(this)),!0;switch(c){case 79:this.L&&(b.G=b.G&-65536|62342,y(this,"INT 0x41 handling enabled",128));break;case 80:Yq(this,wq(this,h,k),d+1,e,!(g&1),!!this.L);break;case 82:br(this,null,d);
break;case 127:this.L&&(b.G=b.G&-65536|(this.fb?0:1));break;case 131:this.L&&(a=wq(this,b.M,e),this.sb++?(this.O("TRAPFAULT failed"),cr(this,this.B,a,!0,!0),this.sb=0,this.Wb()):(this.O("INT 0x41 TRAPFAULT: fault="+v(d)+" error="+r(b.K,8,!0)+" addr="+dr(a)),this.Rd(this.B,a,!0),yq(this,!0)));break;case 141:this.L&&(b.G=b.G&-65536|1);break;case 336:$q(this,wq(this,b.H,f),!g,!!this.L);break;case 338:ar(this,d,wq(this,b.J,f))}this.fb=!1;return!this.L};
l.Sm=function(a){var b=this.F,c=b.G&255,d=b.G>>8&255,e=b.H&65535,f=b.I&65535,g=b.M&65535,h=b.J&65535,k=b.Xa.Z;if(null==this.ka){if(67==d){if(609437257==b.oa((b.wa.Z<<4)+10)||1111835735==b.oa((b.wa.Z<<4)+95))return!0;mf(b,a,function(a){return function(){62342!=(b.G&65535)?(b.G=b.G&-65536|62342,y(a,"INT 0x68 handling enabled",128),a.L=a.ka=!0):(y(a,"INT 0x68 monitoring enabled",128),a.ka=!1)}}(this))}return!0}switch(d){case 67:this.ka&&(b.G=b.G&-65536|62342);break;case 68:this.ka&&(a=md(b.wa,this.rl.bind(this)))&&
(b.J=a[0],Bd(b,a[1]));break;case 72:br(this,null,e);break;case 80:32==c?Yq(this,wq(this,h,k),0,f,!0,!!this.ka):128>c?Yq(this,wq(this,h,k),e+1,c&64?g:f,!(c&1),!!this.ka):$q(this,wq(this,h,k),!(c&1),!!this.ka),this.ka&&(b.G=b.G&-256|1)}return!this.ka};l.rl=function(){var a=this.F;5==(a.G&255)&&(a.I=a.K=0,a.G=a.G&-256|1);return!1};
l.Pb=function(a,b,c){var d=this;switch(b){case "debugInput":return this.Ka=this.qa[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Aq(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.A<d.C.length-1&&(b=d.C[++d.A])):40==a.keyCode&&(0<d.A?b=d.C[--d.A]:(b="",d.A=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.qa[b]=c,Qa(c,function(){if(d.Ka){var a=d.Ka.value;
d.Ka.value="";Aq(d,a,!0);return!0}return!1}),!0;case "step":return this.qa[b]=c,Qa(c,function(a){var b=!1;wb(d,!0)||(vb(d,!0),b=d.wf(a?1:0),vb(d,!1));return b}),!0}return!1};l.wd=function(){this.Ka&&this.Ka.focus()};function er(a){return a.F&&!!(a.F.$a&1)&&!(a.F.ca&131072)}
function Rq(a,b,c){var d=er(a)?2:1;c||(c=d);if(c==d){if(b===a.F.wa.Z)return a.F.wa;if(b===a.F.vb.Z)return a.F.vb;if(b===a.F.Xa.Z)return a.F.Xa;if(b===a.F.ta.Z)return a.F.ta;if(80386<=a.F.ja){if(b===a.F.Nb.Z)return a.F.Nb;if(b===a.F.Ob.Z)return a.F.Ob}if(a.gb&&2==c||!a.bc)return null}a=a.bc;if(2!=c)a.uh(b),a.Ta=65535,a.Zb=65536;else{var e;c=a.F;b&=65535;b&4?(d=c.Bc.Aa,e=d+c.Bc.Ta|0):(d=c.Ec,e=c.zd);d=d+(b&65528)|0;if(e-d|0){e=Qf(c,d+0,2);var f=Qf(c,d+4,2),g=f&7936,h=Qf(c,d+2,2)|(f&255)<<16,k=Qf(c,
d+6,2);80386<=c.ja&&(h|=(k&65280)<<16,e|=(k&15)<<16,k&128&&(e=e<<12|4095));a.Z=b;a.Aa=h;a.Ta=e;a.Zb=(e>>>0)+1;a.wb=f;a.type=g;a.ext=k;a.Xb=d;ld(a,!0,!0,!1)}}return a}l.cc=function(a,b,c){var d=a&&a.Ea;if(null==d&&(d=-1,a)){var e=Rq(this,a.Z,a.type);e&&(b=a.Ra||0,c=c||1,d=e=-1===e.Xb||e.bd&&(b>>>0)+c>e.Zb||!e.bd&&(b>>>0)+c<=e.Zb?e.Aa+b|0:-1,a.Ea=d)}return d};l.Qa=function(a,b){var c=255,d=this.cc(a,!1,1);-1!==d&&(c=Qf(this.F,d,1,5==a.type)|0,b&&fr(this,a,b));return c};
l.tb=function(a,b){return a.Rb?this.oa(a,b?4:0):this.na(a,b?2:0)};l.na=function(a,b){var c=65535,d=this.cc(a,!1,2);-1!==d&&(c=Qf(this.F,d,2,5==a.type),b&&fr(this,a,b));return c};l.oa=function(a,b){var c=-1,d=this.cc(a,!1,4);-1!==d&&(c=Qf(this.F,d,4,5==a.type),b&&fr(this,a,b));return c};l.qc=function(a,b,c,d){var e=this.cc(a,!0,1);if(-1!==e){if(5!=a.type)this.F.qc(e,b);else{var f=this.ga;f.sa[(e&f.Gb)>>>f.La].xf(e&f.A,b&255,e)}c&&fr(this,a,c);d||ad(this.F,!0)}};
l.jb=function(a,b,c){var d=this.cc(a,!0,2);-1!==d&&(5!=a.type?this.F.jb(d,b):nc(this.ga,d,b),c&&fr(this,a,c),ad(this.F,!0))};function wq(a,b,c,d,e,f,g){return gr(a,{},b,c,d,e,f,g)}function gr(a,b,c,d,e,f,g,h){b.Ra=c||0;b.Z=d;b.Ea=e;b.type=f||(er(a)?2:1);b.Rb=null!=g?g:a.F&&4==a.F.wa.ba;b.oc=null!=h?h:a.F&&4==a.F.wa.Tc;b.Vd=!1;return b}function hr(a){return[a.Ra,a.Z,a.Ea,a.Vd,a.Rb,a.oc,a.Ve,a.jh]}function ir(a){return{Ra:a[0],Z:a[1],Ea:a[2],Vd:a[3],Rb:a[4],oc:a[5],Ve:a[6],jh:a[7]}}
function jr(a,b,c){if(null!=b.Z&&(a=Rq(a,b.Z,b.type))){var d=b.Ra&a.Ba;if(!a.bd){if(d>>>0>=a.Zb)return!1}else if(d>>>0<a.Zb)return!1;c&&(b.Ra=d,b.Rb=4==a.ba,b.oc=4==a.Tc)}return!0}
function kr(a,b,c,d){var e,f=c?a.aa:a.Db;c=d?0:f.type;var g=f.Ra,h=f.Z,f=f.Ea;if(void 0!==b){b=qq(a,b);e=b.charAt(0);f=b.indexOf(":");switch(e){case "&":c=1;break;case "#":c=2;break;case "%":c=4;e=b.charAt(1);"%"==e&&(c=5,e+=e);g=0;h=null;break;default:0<=f&&(c=0),e=""}e&&(b=b.substr(e.length),f-=e.length);e=b;var k;if(e.match(/^[a-z_][a-z0-9_]*$/i))for(var m=e.toUpperCase(),n=0;n<a.N.length;n++){e=a.N[n];var t=e.Qd[m];if(void 0!==t){m=t.o;void 0!==m&&(k=t.s,void 0===k&&(k=e.Z),k=wq(a,m,k,t.p));break}}if(e=
k)return e;0>f?null!=h?(g=pq(a,b,void 0),f=null):(f=pq(a,b,void 0),null==f&&(g=null)):(h=pq(a,b.substring(0,f),void 0),g=pq(a,b.substring(f+1),void 0),f=null)}null!=g&&(e=wq(a,g,h,f,c),d||jr(a,e,!0)||(a.O("invalid offset: "+dr(e)),e=null));return e}function lr(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.ll=a.Ng(b.Sk=c[2]))}l.Pk=function(a,b){var c=kr(this,b);return a.replace("["+b+"]",c?r(this.tb(c),c.Rb?8:4):"undefined")};
function fr(a,b,c){c=c||1;null!=b.Ea&&(b.Ea+=c);null!=b.Z&&(b.Ra+=c,jr(a,b)||(b.Ra=0,b.Ea=null))}function Uq(a,b,c){return null!=b?r(b,4)+":"+r(a,a&-65536||c?8:4):r(a)}function dr(a){var b;switch(a.type){case 1:case 3:b="&";break;case 2:b="#";break;case 4:b="%";break;case 5:b="%%";break;default:b=a.Z?"":"%"}return 4<=a.type||null==a.Z?b+r(a.Ea):b+Uq(a.Ra,a.Z,a.oc)}
function Vq(a,b,c){var d="";for(c=c||256;d.length<c;){var e=a.Qa(b,1);if(!e||36==e||127<=e)break;d+=32<=e?String.fromCharCode(e):"."}return d}
function Qq(a,b,c,d){var e=0,f=0,g=b.length;if(c){e=a.cc(kr(a,c));if(-1===e){a.O("invalid address: "+c);return}f=e>>>a.F.La;g=1}a.O("blockid "+(d?"linear ":"physical")+" blockaddr used size type");a.O("-------- --------- ---------- ------ ------ ----");c=-1;for(var h=0;g--;)(d=b[f])&&5==d.type&&(d=Nc(a.F,e,!1,!0)),d.type==c?h++||a.O("..."):(c=d.type,h=Yb[c],6==c&&(d=d.Bd,h+=" -> "+Yb[d.type]),d&&a.O(r(d.id,8)+" %"+r(f<<a.F.La,8)+" %%"+r(d.Ea,8)+" "+v(d.Qe)+" "+v(d.size)+" "+
h),c!=Ec&&5!=c&&(c=-1),h=0),e+=a.F.Sb,f++}function mr(a,b,c){a=r(a)+" "+r(b)+" ";a=a+(c&&b&64?"D":"-")+(b&32?"A":"-")+(b&4?"U":"S");a+=b&2?"W":"R";return a+=b&1?"P":"N"}
var Sq={256:["tss286",!1],512:["ldt",!1],768:["busy tss286",!1],1024:["call gate",!0],1280:["task gate",!0],1536:["int gate286",!0],1792:["trap gate286",!0],2304:["tss386",!1],2816:["busy tss386",!1],3072:["call gate386",!0],3584:["int gate386",!0],3840:["trap gate386",!0]},Wq={PREV_TSS:0,CPL0_SP:2,CPL0_SS:4,CPL1_SP:6,CPL1_SS:8,CPL2_SP:10,CPL2_SS:12,TASK_IP:14,TASK_PS:16,TASK_AX:18,TASK_CX:20,TASK_DX:22,TASK_BX:24,TASK_SP:26,TASK_BP:28,TASK_SI:30,TASK_DI:32,TASK_ES:34,TASK_CS:36,TASK_SS:38,TASK_DS:40,
TASK_LDT:42},Xq={PREV_TSS:0,CPL0_ESP:4,CPL0_SS:8,CPL1_ESP:12,CPL1_SS:16,CPL2_ESP:20,CPL2_SS:24,TASK_CR3:28,TASK_EIP:32,TASK_PS:36,TASK_EAX:40,TASK_ECX:44,TASK_EDX:48,TASK_EBX:52,TASK_ESP:56,TASK_EBP:60,TASK_ESI:64,TASK_EDI:68,TASK_ES:72,TASK_CS:76,TASK_SS:80,TASK_DS:84,TASK_FS:88,TASK_GS:92,TASK_LDT:96,TASK_IOPM:100};
function Zq(a,b,c){var d=[],e;for(e=null;e=Jb(a.X,"Disk",e);){var f=e,g=b,h=c,d={};if(f.C)for(var k=0;k<f.C.length;k++){var m=f.C[k];if(m.jg==g&&(m=m.yd[h])){for(var n in m.we)f=m.we[n],d[f[1]]=f[0];break}}if(d.length)break}return d}function zq(a,b){a.ha=a;a.wc=a.pl=1073741824;a.Pa=null;b=a.Ng(b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Eb)0<=ya(b,c)&&(a.wc|=Eb[c],a.O(c+" messages enabled"));yq(a)}
function Qk(a,b,c){for(var d in Eb)if(b==Eb[d]){a.cb[d]=c;break}}l=vq.prototype;l.oh=function(a,b){var c;a=a.toUpperCase();null==b?c=ya(Iq,a):(c=ya(Iq,a.substr(b,3)),0>c&&(c=ya(Iq,a.substr(b,2))));return c};
function nr(a,b){var c=0,d=a.ph(b);if(null!=d)switch(b){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c=2;break;case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 22:case 16:case 17:case 18:case 19:case 20:case 21:c=4;break;case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 56:c=8;break;case 23:c=a.Ja}return c?r(d,c):"??"}
l.ph=function(a){var b;if(0<=a){var c=this.F;switch(a){case 0:b=c.G&255;break;case 1:b=c.I&255;break;case 2:b=c.M&255;break;case 3:b=c.H&255;break;case 4:b=c.G>>8&255;break;case 5:b=c.I>>8&255;break;case 6:b=c.M>>8&255;break;case 7:b=c.H>>8&255;break;case 8:b=c.G&65535;break;case 9:b=c.I&65535;break;case 10:b=c.M&65535;break;case 11:b=c.H&65535;break;case 12:b=J(c)&65535;break;case 13:b=c.P&65535;break;case 14:b=c.K&65535;break;case 15:b=c.J&65535;break;case 22:b=M(c)&65535;break;case 23:b=Cd(c);
break;case 16:b=c.Xa.Z;break;case 17:b=c.wa.Z;break;case 18:b=c.ta.Z;break;case 19:b=c.vb.Z;break;default:if(80286==this.F.ja)32==a&&(b=c.$a);else if(80386<=this.F.ja)switch(a){case 24:b=c.G;break;case 25:b=c.I;break;case 26:b=c.M;break;case 27:b=c.H;break;case 28:b=J(c);break;case 29:b=c.P;break;case 30:b=c.K;break;case 31:b=c.J;break;case 32:b=c.$a;break;case 33:b=c.ti;break;case 34:b=c.se;break;case 35:b=c.Od;break;case 20:b=c.Nb.Z;break;case 21:b=c.Ob.Z;break;case 56:b=M(c)}}}return b};
function or(a,b){b=qq(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=a.oh(b,c+1),0<=e&&(b=b.substr(0,c)+nr(a,e)+b.substr(c+1+Iq[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=ea(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=kr(a,e))?(d=e+' "'+Vq(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=kr(a,e))?(fr(a,d),d=
e+' "'+Vq(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}l.message=function(a,b){b&&(a+=" at "+dr(wq(this,M(this.F),this.F.wa.Z))+" (%"+r(this.F.Ha)+")");this.Pa&&a==this.Pa||(this.Pa=a,this.wc&-2147483648&&(this.Wb(),a+=" (cpu halted)"),this.O(a),this.F&&(a=this.F,a.fb-=a.A,a.A=0,a.Y.mf=0,ad(a)))};
function pk(a,b,c,d){var e,f;if(!d&&(d=z(a,1)&&0>Cq.indexOf(b),!d)){var g=Bq[b];g&&(d=z(a,g)?!0:524288==g&&z(a,g=1048576))}d&&(e=a.F.G>>8&255,f=a.F.M&255,33==b&&11==e||524288==g&&128<=f||1048576==g&&128>f)&&(d=!1);d&&((g=(g=Db[b])&&g[e]||"")&&(g=" "+or(a,g)),a.message("INT "+u(b)+": AH="+u(e)+" at "+Uq(c-2-a.F.wa.Aa,a.F.wa.Z)+g));return d}
function ub(a,b,c,d,e,f,g,h){h|=256;if(null==e||(a.wc&h)==h)h=null,null!=e&&(h=a.F.wa.Z,e-=a.F.wa.Aa),a.message(b.xd+"."+(null!=d?"outPort":"inPort")+"("+v(c)+","+(f?f:"unknown")+(null!=d?","+u(d):"")+")"+(null!=g?": "+u(g):"")+(null!=e?" at "+Uq(e,h):""))}l.qh=function(){this.O("Type ? for help with PCx86 Debugger commands");this.pd();if(this.qb){var a=this.qb;this.qb=null;Aq(this,a)}};
function yq(a,b){var c;if(ag(a)){if(!a.ia||!a.ia.length){a.ia=Array(1E3);for(c=0;c<a.ia.length;c++)a.ia[c]=wq(a);a.Fa=0;b||a.O("instruction history buffer allocated")}if(!a.W||!a.W.length)for(a.W=Array(256),c=0;c<a.W.length;c++)a.W[c]=[c,0]}else a.ia&&a.ia.length&&!b&&a.O("instruction history buffer freed"),a.Fa=0,a.ia=[],a.W=[]}l.Ne=function(a){if(!pr(this))return!1;this.F.Ne(a);return!0};
l.wf=function(a,b,c){if(!pr(this))return!1;this.ea=0;do{a||ag(this)&&dg(this,this.F.Ha,0);try{var d=this.F.wf(a);0<d&&(this.ea+=d,fd(this.F,d,!0),bd(this.F,d),this.pa++)}catch(f){if("number"!=typeof f){var e=f;this.ea=0;zb(this.F,e.stack||e.message)}}}while(this.F.S&3312);!1!==c&&ad(this.F);this.pd(b||!1);return 0<this.ea};l.Wb=function(a){this.F&&this.F.Wb(a)};l.pd=function(a){void 0===a&&(a=!0);this.aa=wq(this,M(this.F),this.F.wa.Z);a&&1!=this.U?qr(this):rr(this)};
function pr(a){var b;if(b=a.F&&yb(a.F))b=a.F,b.la.ic?b=!0:(b.O(b.toString()+" not powered"),b=!1);b&&!wb(a.F)?(a=a.F,a.la.error?(a.O(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}l.hc=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};l.gc=function(a,b){b&&this.O(a?"suspending":"shutting down");return a?this.save():!0};l.reset=function(a){yq(this);this.pa=this.Ca=0;this.Pa=null;this.ea=0;this.aa=wq(this,M(this.F),this.F.wa.Z);this.la.Ib=!1;sr(this);a||this.pd()};
l.save=function(){var a=new qf(this);a.set(0,hr(this.aa));a.set(1,hr(this.ua));a.set(2,[this.C,this.va,this.wc]);a.set(3,this.N);return a.data()};l.restore=function(a){var b=0;void 0!==a[2]&&(this.aa=ir(a[b++]),this.ua=ir(a[b++]),this.C=a[b][0],"string"==typeof this.C&&(this.C=[this.C]),this.va=a[b][1],this.wc|=a[b][2]);a[3]&&(this.N=a[3]);return!0};l.start=function(a,b){this.U||this.O("running");this.la.Ib=!0;this.uc=a;this.vd=b};
l.stop=function(a,b){if(this.la.Ib){this.la.Ib=!1;this.ea=b-this.vd;if(!this.U){b="stopped";if(this.ea){a-=this.uc;var c=0<a?Math.round(1E3*this.ea/a):0;b+=" (";ag(this)&&(b+=this.pa+" opcodes, ",this.Ca-=this.pa,this.pa=0);b+=this.ea+" cycles, "+a+" ms, "+c+" hz)"}else z(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.O(b)}this.pd(!0);this.wd();sr(this,this.F.Ha)}};function ag(a){return 1<a.B.length||!!a.Oa||z(a,16)}
function dg(a,b,c){var d=a.F;if(0<c&&(a.Oa&&!--a.Oa||tr(a,b,1,a.B)))return!0;0<=c&&a.W.length&&(a.pa++,b=Qf(d,b),null!=b&&(a.W[b][1]++,gr(a,a.ia[a.Fa],M(d),d.wa.Z),++a.Fa==a.ia.length&&(a.Fa=0)));return!1}function Kc(a,b,c){return tr(a,b,c||1,a.ra)?(a.Wb(!0),!0):!1}function Mc(a,b,c){return tr(a,b,c||1,a.fa)?(a.Wb(!0),!0):!1}function wc(a,b,c){a.O("break on input from port "+v(b)+": "+r(c));a.Wb(!0)}function Ac(a,b,c){a.O("break on output to port "+v(b)+": "+r(c));a.Wb(!0)}
function xq(a){var b,c;a.B=["bp"];if(a.ra)for(b=1;b<a.ra.length;b++)c=a.ra[b],we(a.F,a.cc(c),!1,5==c.type);a.ra=["br"];if(a.fa)for(b=1;b<a.fa.length;b++)c=a.fa[b],we(a.F,a.cc(c),!0,5==c.type);a.fa=["bw"];a.gb=0}
l.Rd=function(a,b,c){var d=!0;c||cr(this,a,b,!1,!0);if(a!=this.B){var e=this.cc(b);if(-1===e)this.O("invalid address: "+dr(b)),d=!1;else{var f=this.F,g=5==b.type;(g?f.kd:f.sa)[e>>>f.La].Rd(e&f.Fa,a==this.fa);g&&Xb(f)}}d&&(a.push(b),c?(null!=b.Ea&&(b.Z=null),b.Vd=!0):(ur(this,a,a.length-1,"set"),yq(this)));return d};
function cr(a,b,c,d,e){for(var f=!1,g=vr(a,a.cc(c)),h=1;h<b.length;h++){var k=b[h];if(-1!==g&&g==vr(a,a.cc(k))||-1===g&&c.Z==k.Z&&c.Ra==k.Ra)if(!d||k.Vd){f=!0;k.Vd||e||ur(a,b,h,"cleared");b.splice(h,1);b!=a.B&&we(a.F,g,b==a.fa,5==k.type);k.Vd||yq(a);break}}return f}function wr(a,b){for(var c=1;c<b.length;c++)ur(a,b,c);return b.length-1}function ur(a,b,c,d){c=b[c];a.O(b[0]+" "+dr(c)+(d?" "+d:c.Sk?' "'+c.Sk+'"':""))}
function sr(a,b){if(void 0!==b)tr(a,b,1,a.B,!0),a.U=0;else for(b=1;b<a.B.length;b++){var c=a.B[b];if(c.Vd){if(!cr(a,a.B,c,!0))break;b=0}}}function vr(a,b){-1!==b&&(a=a.Ba&-65536,(b&a)==a&&(b&=1048575));return b}
function tr(a,b,c,d,e){var f=!1;if(!a.gb++){b=vr(a,b);z(a,-2147483632)&&204==Qf(a.F,b)&&(f=!0);for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Vd){null!=h.Z&&(h.Ea=null);for(var k=vr(a,a.cc(h)),m=0;m<c;m++)if(b+m==k){var n,f=!0;h.Vd&&(cr(a,d,h,!0),e=!0);if(n=h.ll){for(var f=!1,t=0;t<n.length;t++)if(!xr(a,n[t],!0)){if(n[t].indexOf("if")){f=!0;break}for(var q=t+1;q<n.length&&n[q].indexOf("else");q++)t++;if(q==n.length){f=!0;break}}a.F.la.Ib||(f=!0)}if(f){e||ur(a,d,g,"hit");break}}}}}a.gb--;return f}
function yr(a,b,c,d){for(var e=wq(a,b.Ra,b.Z,b.Ea,b.type),f=a.Qa(b,1),g=4,h=0,k=!1,m=!1;(102==f||103==f)&&g--;)102==f?k||(b.Rb=!b.Rb,k=!0):m||(b.oc=!b.oc,m=!0),h++,f=a.Qa(b,1);var g=-1,n=Eq,k=a.Ga[f],m=k[0];176==m&&(m=a.Qa(b,1),k=Nq[m]||Kq,f|=m<<8,m=k[0]);if(36==m){var g=a.Qa(b,1),t;t=null;var q=g>>3&7,A=(3>(g>>6&3)?0:48)+q;(217==f||219==f)&&52<=A&&(A=q<<4|g&7);(q=Oq[f])&&(t=q[A]);t&&(n=Fq,k=t,m=k[0])}m>=n.length&&(g=a.Qa(b,1),k=Pq[m-n.length][g>>3&7],m=k[0]);n=n[m];q=k.length-1;t="";b.Rb&&(18==m?
n="CWDE":28==m?n="CDQ":104<=m&&107>=m&&(n+="D"));if(164<=f&&167>=f||170<=f&&175>=f)q=0,b.Rb&&"W"==n.slice(-1)&&(n=n.slice(0,-1)+"D");for(var f=-1,A=!0,F=1;F<=q;F++){var C,D;C="";D=k[F];if(void 0!==D){0>f&&(f=D>>14);80==m&&(2==f?t="[%800]":3==f&&(t="ES:["+(b.oc?"E":"")+"DI]"));var L=D&15;if(L)if(8==L)A=!1;else{var G=D&240;if(128<=G)if(0>g&&(g=a.Qa(b,1)),160>G){G=a;C=D;var ga=q;D=b;var S="",ab=g>>6,la=g&7;if(3>ab){L=!n.indexOf("FI");if(!ab&&(!D.oc&&6==la||D.oc&&5==la))ab=2;else{if(D.oc)if(4!=la)la+=
8;else{var S=G,Ja=ab,Da=D,Wa=S.Qa(Da,1),Ka=Wa>>6,Vb=Wa>>3&7,Wa=Wa&7,Pa="";if(Ja||5!=Wa)Pa=Jq[Wa+8];4!=Vb&&(Pa&&(Pa+="+"),Pa+=Jq[Vb+8],Ka&&(Pa+="*"+(1<<Ka)));Ja||5!=Wa||(Pa&&(Pa+="+"),Pa+=r(S.oa(Da,4)));S=Pa}S||(S=Jq[la])}1==ab?(G=G.Qa(D,1),S=G&128?S+("-"+r(-(G<<24>>24),2)):S+("+"+r(G,2))):2==ab&&(S&&(S+="+"),D.oc?(G=G.oa(D,4),S+=r(G)):(G=G.na(D,2),S+=r(G,4)));S="["+S+"]";if(1==ga){G="";C&=15;4==C&&(C=D.Rb?5:3);switch(C){case 7:G="FAR";break;case 1:G="BYTE";break;case 3:if(L){G="INT16";break}G="WORD";
break;case 5:G="DWORD";break;case 11:if(L){G="INT32";break}case 11:G="REAL32";break;case 12:if(L){G="INT64";break}case 12:G="REAL64";break;case 13:G="REAL80";break;case 14:G="BCD80"}G&&(S=G+" "+S)}}else S=zr(G,la,C,D);C=S}else C=160==G?zr(a,g&7,D,b):zr(a,g>>3&7,D,b);else if(16==G)C="1";else if(G)32==G?(b.oc?(C=8,D=a.oa(b,4)):(C=4,D=a.na(b,2)),C="["+r(D,C)+"]"):48==G?(C=1==L?a.Qa(b,1)<<24>>24:a.tb(b,!0),D=b.Ra+C&(b.Rb?-1:65535),C=r(D,b.Rb?8:4),D=Ar(a,wq(a,D,b.Z)),D[0]&&(C+=" ("+D[0]+")")):96==G?C=
9==L?"ST":10==L?"ST("+(g&7)+")":zr(a,(D&3840)>>8,D,b):112==G?C=zr(a,(D&3840)>>8,192,b):64==G?C="DS:[SI]":80==G&&(C="ES:[DI]");else{C=a;L=D;G=b;D=" ";switch(L&15){case 1:L&12288&&(D=r(C.Qa(G,1),2));break;case 2:D=r(C.Qa(G,1)<<24>>24,G.Rb?8:4);break;case 4:if(G.Rb){D=r(C.oa(G,4));break}case 3:D=r(C.na(G,2),4);break;case 7:G=wq(C,C.tb(G,!0),C.na(G,2),null,G.type,G.Rb,G.oc);D=dr(G);C=Ar(C,G);C[0]&&(D+=" ("+C[0]+")");break;default:D="imm("+v(L)+")"}C=D}if(!C||!C.length){t="INVALID";break}0<t.length&&(t+=
",");t+=C||"???"}}}g="";k=dr(e)+" ";if(-1!==e.Ea&&-1!==b.Ea){do if(g+=r(a.Qa(e,1),2),null==e.Ea)break;while(e.Ea!=b.Ea)}k+=pa(g,e.oc?24:16);k+=pa(n,8);t&&(k+=" "+t);a.F.ja<Hq[f]&&(c=Hq[f]+" CPU only");c&&A&&(k=pa(k,e.oc?74:56)+";"+c,k=a.F.la.Xe?k+("cycles="+cd(a.F).toString()+" cs="+r(a.F.Y.Lf)):k+(null!=d?"="+d.toString():""));Br(b,A,h);return k}
function zr(a,b,c,d){var e=c&240;if(192==e){if(5<b||4<=b&&80386>a.F.ja)return"??";b+=16}else if(208==e)b+=32;else if(224==e)b+=40;else if(240==e)b+=48;else if(a=c&15,3<=a&&(8>b&&(b+=8),5==a||4==a&&d.Rb))b+=16;return Iq[b]}
function Cr(a,b){switch(b){case "V":a=Cf(a.F);break;case "D":a=a.F.ca&1024;break;case "I":a=a.F.ca&512;break;case "T":a=a.F.ca&256;break;case "S":a=Bf(a.F);break;case "Z":a=Af(a.F);break;case "A":a=zf(a.F);break;case "P":a=yf(a.F);break;case "C":a=xf(a.F);break;default:a=0}return b+(a?"1":"0")+" "}function Tq(a){return r(a,a&-65536?8:4)}function Dr(a,b){8<=b&&15>=b&&4<a.Ja&&(b+=16);var c=Iq[b];32==b&&80286==a.F.ja&&(c="MS");return c+"="+nr(a,b)+" "}
function Er(a,b,c){return b.kc+"="+r(b.Z,4)+(c?"["+r(b.Aa,a.Da)+","+Tq(b.Ta)+"]":"")}function Fr(a,b,c,d,e){return b+"="+(null!=c?r(c,4):"")+"["+r(d,a.Da)+","+r(e-d,4)+"]"}
function Gr(a,b){var c;void 0===b&&(b=er(a));c=Dr(a,8)+Dr(a,11)+Dr(a,9)+Dr(a,10)+(4<a.Ja?"\n":"")+Dr(a,12)+Dr(a,13)+Dr(a,14)+Dr(a,15)+"\n"+Er(a,a.F.ta,b)+" "+Er(a,a.F.vb,b)+" "+Er(a,a.F.Xa,b)+" ";if(b){var d="TR="+r(a.F.Sa.Z,4),e=a.ga,e="A20="+(e.X||e.Dg!=e.Gb?"OFF ":"ON ");80386>a.F.ja&&(d="\n"+d,c+=e,e="");c+="\n"+Er(a,a.F.wa,b)+" ";80386<=a.F.ja&&(e+="\n",c+=Er(a,a.F.Nb,b)+" "+Er(a,a.F.Ob,b)+"\n");c+=Fr(a,"LD",a.F.Bc.Z,a.F.Bc.Aa,a.F.Bc.Aa+a.F.Bc.Ta)+" "+Fr(a,"GD",null,a.F.Ec,a.F.zd)+" "+Fr(a,"ID",
null,a.F.Mc,a.F.Sd)+" ";c=c+(d+" "+e)+Dr(a,32);80386<=a.F.ja&&(c+=Dr(a,34)+Dr(a,35))}else 80386<=a.F.ja&&(c+=Er(a,a.F.Nb,b)+" "+Er(a,a.F.Ob,b)+" ");return c+=Dr(a,23)+Cr(a,"V")+Cr(a,"D")+Cr(a,"I")+Cr(a,"T")+Cr(a,"S")+Cr(a,"Z")+Cr(a,"A")+Cr(a,"P")+Cr(a,"C")}l.lj=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
function fm(a,b,c,d,e,f,g,h){var k={},m=[],n;for(n in h){var t=h[n];"number"==typeof t&&(h[n]=t={o:t});var q=t.o,A=t.s,F=t.a;if(void 0!==q){void 0!==A&&(k.Ra=q,k.Z=A,k.Ea=null,a.cc(k),(k.Ea&-65536)==(a.ga.Dg&-65536)&&(k.Ea&=1048575),t.p=k.Ea);var A=m,q=[q>>>0,n],C=sa(A,q,a.lj);0>C&&A.splice(-(C+1),0,q)}F&&(t.a=F.replace(/''/g,'"'))}a.N.push({jg:b,dn:c,Z:d,Ra:e,Ea:f,Vm:g,Qd:h,Xi:m})}
function br(a,b,c){for(var d=0;d<a.N.length;d++){var e=a.N[d];if(!b||e.jg==b)if(b&&c==e.dn||!b&&c==e.Z){a.N.splice(d,1);break}}}function Ar(a,b,c){for(var d=[],e=b.Ra>>>0,f=a.cc(b)>>>0,g=0;g<a.N.length;g++){var h=a.N[g],k=h.Z,m=h.Ra>>>0,n=h.Ea;null!=n&&(n>>>=0);var t=h.Vm;48==k&&(k=40);if(k==b.Z&&e>=m&&e<m+t||null!=n&&f>=n&&f<n+t){b=sa(h.Xi,[e],a.lj);0<=b?Hr(a,g,b,d):c&&(b=~b,Hr(a,g,b-1,d),Hr(a,g,b,d));break}}!d.length&&(a=a.ga.xj(f,!0))&&(d.push(a),d.push(f));return d}
function Hr(a,b,c,d){var e={},f=a.N[b].Xi,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.N[b].Qd[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function Ir(a){a.Gf&&(a.Gf.value="")}
function Jr(a,b){if("?"==b)a.O("frequency commands:"),a.O("\tclear\tclear all frequency counts");else{var c=0;if(a.W)if("clear"==b){for(b=0;b<a.W.length;b++)a.W[b]=[b,0];a.O("frequency data cleared");c++}else if(void 0!==b)a.O("unknown frequency command: "+b),c++;else{var d=a.W.slice();d.sort(function(a,b){return b[1]-a[1]});for(b=0;b<d.length;b++){var e=d[b][0],f=d[b][1];f&&(a.O((Eq[a.Ga[e][0]]+" ").substr(0,5)+" ("+u(e)+"): "+f+" times"),c++)}}c||a.O("no frequency data available")}}
function Kr(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return uq(a)||a.O("no variables"),!0;if(!c[2])return uq(a,c[1]);if(!c[3])return delete a.ya[c[1]],!0;b=pq(a,c[3]);return void 0!==b?(a.ya[c[1]]=b,!0):!1}a.O("invalid assignment:"+b);return!1}
function Lr(a,b,c){var d=null;if(b=kr(a,b,!0)){a.cc(b);var e=Ar(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.Ra-e[1])&&(g=" + "+v(f)),f=e[0]+" ("+Uq(e[1],b.Z)+")"+g,c&&a.O(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.Ra)&&(g=" - "+v(f)),f=e[4]+" ("+Uq(e[5],b.Z)+")"+g,c&&a.O(f),d||(d=f))}else c&&a.O("no symbols")}return d}
function Mr(a,b){if(b[1]&&"?"!=b[1]){var c="json"==b[1],d,e=0,f=0,g=c?{}:kr(a,b[1]);if(g&&(d=rq(a,b[2],"drive #"),void 0!==d)){if(!c){e=rq(a,b[3],"sector #");if(void 0===e)return;f=rq(a,b[4],"# of sectors");void 0===f&&(f=1)}var h=a.tc;2<=d&&a.Jb&&(d-=2,h=a.Jb);if(h){var k=h.mj(d);if(k)if(k.za)if(c)Ir(a),a.O(k.za.toJSON());else if(h.Uk(k,e,f)){var m=0,n=!1;for(b=dr(g);!n&&0<k.Hb--;)(function(a,b){h.Le(k,function(c){0>c?(a.O("out of data at address "+dr(b)),n=!0):(a.qc(b,c,1,!0),m++)})})(a,g);ad(a.F,
!0);a.O(m+" bytes read at "+b)}else a.O("sector "+e+" request out of range");else a.O("drive "+d+" not loaded");else a.O("invalid drive: "+d)}else a.O("disk controller not present")}}else a.O("load commands:"),a.O("\tl [address] [drive #] [sector #] [# sectors]")}
function qr(a,b){var c;if(b&&"?"==b[1])a.O("register commands:"),a.O("\tr\tdump registers"),a.Tb&&a.O("\trfp\tdump floating-point registers"),a.O("\trp\tdump all registers"),a.O("\trx [#]\tset flag or register x to [#]");else{var d;null==c&&(c=!0);if(b&&1<b.length){var e=b[1];if(a.Tb&&"fp"==e){c=a.Tb;d=gg(c);b=c.jc;for(var f=0;8>f;f++){var g=c,e=null;if(f<g.X.length){var e=[],h=g.B+f&7;e[0]=h;e[1]=Fg(g,h);e[2]=g.X[h];h<<=1;e[3]=g.aa[h];e[4]=g.aa[h+1];g=Jg(g,e[3],e[4]);e[5]=g[0];e[6]=g[1];e[7]=g[2]}if(!e)break;
a.O("ST"+f+": "+pa(e[2].toFixed(15),24,!0)+" "+r(e[4])+","+r(e[3])+" ["+e[0]+":"+Gq[e[1]]+"]")}a.O(" B3SSS210ESPUOZDI xxxIRRPPIxPUOZDI");a.O("SW: "+fa(d,16)+" ("+v(d)+") CW: "+fa(b,16)+" ("+v(b)+")");return}if("p"==e)d=80286<=a.F.ja;else{f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.O("missing value for "+b[1]);return}g=pq(a,b);if(void 0===g)return;f=!0;h=e.toUpperCase();"E"==h.charAt(0)&&4>=a.Ja&&(h=null);switch(h){case "AL":a.F.G=a.F.G&
-256|g&255;break;case "AH":a.F.G=a.F.G&-65281|g<<8&255;break;case "AX":a.F.G=a.F.G&-65536|g&65535;break;case "BL":a.F.H=a.F.H&-256|g&255;break;case "BH":a.F.H=a.F.H&-65281|g<<8&255;break;case "BX":a.F.H=a.F.H&-65536|g&65535;break;case "CL":a.F.I=a.F.I&-256|g&255;break;case "CH":a.F.I=a.F.I&-65281|g<<8&255;break;case "CX":a.F.I=a.F.I&-65536|g&65535;break;case "DL":a.F.M=a.F.M&-256|g&255;break;case "DH":a.F.M=a.F.M&-65281|g<<8&255;break;case "DX":a.F.M=a.F.M&-65536|g&65535;break;case "SP":I(a.F,J(a.F)&
-65536|g&65535);break;case "BP":a.F.P=a.F.P&-65536|g&65535;break;case "SI":a.F.K=a.F.K&-65536|g&65535;break;case "DI":a.F.J=a.F.J&-65536|g&65535;break;case "DS":Ad(a.F,g);break;case "ES":Bd(a.F,g);break;case "SS":ud(a.F,g);break;case "CS":sf(a.F,g);a.aa=wq(a,M(a.F),a.F.wa.Z);break;case "IP":case "EIP":O(a.F,g);a.aa=wq(a,M(a.F),a.F.wa.Z);break;case "PC":case "PS":Dd(a.F,g);break;case "C":g?Ef(a.F):Ff(a.F);break;case "P":g?(e=a.F,e.resultType&=-3,e.ca|=4):(e=a.F,e.resultType&=-3,e.ca&=-5);break;case "A":g?
Mf(a.F):Kf(a.F);break;case "Z":g?Nf(a.F):Lf(a.F);break;case "S":g?(e=a.F,e.resultType&=-17,e.ca|=128):(e=a.F,e.resultType&=-17,e.ca&=-129);break;case "I":g?(e=a.F,e.ca|=512):(e=a.F,e.ca&=-513);break;case "D":g?(e=a.F,e.ca|=1024):(e=a.F,e.ca&=-1025);break;case "V":g?Gf(a.F):Hf(a.F);break;default:var k=!0;if(80286<=a.F.ja)switch(k=!1,h){case "MS":Of(a.F,g);break;case "TR":-1===a.F.Sa.load(g)&&(f=!1);break;default:if(k=!0,80386<=a.F.ja)switch(k=!1,h){case "EAX":a.F.G=g;break;case "EBX":a.F.H=g;break;
case "ECX":a.F.I=g;break;case "EDX":a.F.M=g;break;case "ESP":I(a.F,g);break;case "EBP":a.F.P=g;break;case "ESI":a.F.K=g;break;case "EDI":a.F.J=g;break;case "FS":a.F.Nb.load(g);break;case "GS":a.F.Ob.load(g);break;case "CR0":a.F.$a=g;uj.call(a.F,g);break;case "CR2":a.F.se=g;break;case "CR3":a.F.Od=g;Fd.call(a.F,g);break;default:k=!0}}if(k){a.O("unknown register: "+e);return}}if(!f){a.O("invalid value: "+b);return}ad(a.F);a.O("updated registers:")}}a.O(Gr(a,d));c&&(a.aa=wq(a,M(a.F),a.F.wa.Z),rr(a,dr(a.aa)))}}
function Nr(a,b){b=qa(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.O(or(a,c[2])):pq(a,b,!0)}function Or(a,b,c){for(var d=null,e=b.Ra,f=e,g=1;6>=g&&e;g++){if(2<g){b.Ra=e;b.Ea=null;var h=yr(a,b);if(0<=h.indexOf("CALL")||c&&0<=h.indexOf("INT")){var k=h.indexOf(" ");if(e+(h.indexOf(" ",k+1)-k-1)/2==f){d=h;break}}}e--}b.Ra=f;return d}function Pr(a,b,c){var d="t"!=b;c=rq(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Oa(c,function(){return vb(a,!0)&&a.wf(e,d,!1)},function(){ad(a.F);vb(a,!1)})}
function Br(a,b,c){if(a.jh=b)null!=a.sj&&(a.Rb=a.sj),null!=a.rj&&(a.oc=a.rj),a.sj=a.Rb,a.rj=a.oc;a.Ve=c||0}
function rr(a,b,c,d){if(b=kr(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=kr(a,c,!0);if(!d||d.Ra<b.Ra)return;e=d.Ra-b.Ra;if(256<e){a.O("range too large");return}d=-1}c=0;var f;for(Br(b,!0);0<e&&d--;){f=wb(a,!1)||a.U?a.ea:null;var g=null!=f?"cycles":null,h=Ar(a,b),k=b.Ea;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.O(m)}h[3]&&(g=h[3],f=null);f=yr(a,b,g,f);b.jh||d||d++;a.O(f);a.aa=b;e-=b.Ea-k;c++}}}
l.Ng=function(a,b,c){if(b)if(a){0>this.A&&this.C.length&&(this.A=0);if(0>this.A||a!=this.C[this.A])this.C.splice(0,0,a),this.A=0;this.A--}else a=this.C[this.A+1];b=[];if(a){a=a.toLowerCase().replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(qa(a.substring(d,f))),d=f+1}}return b};
function xr(a,b,c){var d=!0;try{if(!b.length||"end"==b)a.va&&(a.O("ended assemble at "+dr(a.ua)),a.aa=a.ua,a.va=!1),b="";else if(!c){var e=">> ";a.F.$a&1&&(e=a.F.ca&131072?"-- ":"## ");a.O(e+b)}var f=b.charAt(0);if('"'==f||"'"==f)return!0;a.Pa=null;if(yb(a)&&0<b.length){a.va&&(b="a "+dr(a.ua)+" "+b);var g=b.replace(/ +/g," ").split(" ");if(g&&g.length)for(var h=g[0],k=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==k||"r"==k||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var t=
kr(a,g[1],!0);if(t)if(a.ua=t,void 0===g[2])a.O("begin assemble at "+dr(t)),a.va=!0,ad(a.F);else{var q;a.O("not supported yet");q=[];if(q.length){for(var A=0;A<q.length;A++)a.qc(t,q[A],1);a.O(yr(a,a.ua))}}break;case "b":a:{var F=g[0],C=g[1],D=b;if("?"==C)a.O("breakpoint commands:"),a.O("\tbi [p]\ttoggle break on input port [p]"),a.O("\tbo [p]\ttoggle break on output port [p]"),a.O("\tbp [a]\tset exec breakpoint at addr [a]"),a.O("\tbr [a]\tset read breakpoint at addr [a]"),a.O("\tbw [a]\tset write breakpoint at addr [a]"),
a.O("\tbc [a]\tclear breakpoint at addr [a]"),a.O("\tbl\tlist all breakpoints"),a.O("\tbn [n]\tbreak after [n] instruction(s)");else{var L=F.charAt(1);if("l"==L){var G;G=0+wr(a,a.B);G+=wr(a,a.ra);(G+=wr(a,a.fa))||a.O("no breakpoints")}else if("n"==L)a.Oa=rq(a,C),a.O("break after "+a.Oa+" instruction(s)");else if(void 0===C)a.O("missing breakpoint address");else{var ga={};if("*"!=C&&(ga=kr(a,C,!0,!0),!ga))break a;C=null==ga.Ra?C:v(ga.Ra);"c"==L?null==ga.Ra?(xq(a),a.O("all breakpoints cleared")):cr(a,
a.B,ga)||cr(a,a.ra,ga)||cr(a,a.fa,ga)||a.O("breakpoint missing: "+dr(ga)):"i"==L?a.O("breakpoint "+(pc(a.ga,ga.Ra)?"enabled":"cleared")+": port "+C+" (input)"):"o"==L?a.O("breakpoint "+(xc(a.ga,ga.Ra)?"enabled":"cleared")+": port "+C+" (output)"):null!=ga.Ra&&(lr(a,ga,D),"p"==L?a.Rd(a.B,ga):"r"==L?a.Rd(a.ra,ga):"w"==L?a.Rd(a.fa,ga):a.O("unknown breakpoint command: "+L))}}}break;case "c":Ir(a);break;case "d":a:{var S=g,ab,la=S[0],Ja=S[1],Da=S[2],Wa=S[3];if("?"==Ja){var Ka="";for(ab in Eb)a.cb[ab]&&
(Ka&&(Ka+=","),Ka+=ab);Ka+=",state,symbols";a.O("dump memory commands:");a.O("\tdb [a] [#] dump # bytes at address a");a.O("\tdw [a] [#] dump # words at address a");a.O("\tdd [a] [#] dump # dwords at address a");a.O("\tdh [#] [#] dump # instructions from history");a.O("\tdi [#] dump descriptor info for IDT #");a.O("\tds [#] dump descriptor info for selector #");Ka.length&&a.O("dump extension commands:\n\t"+Ka)}else if("state"==Ja){var Vb=Qr(a.X,!0);"console"==Da?console.log(Vb):
(Ir(a),a.O(Vb))}else if("symbols"==Ja)for(var Pa=0;Pa<a.N.length;Pa++){var Ud=a.N[Pa],Rc;for(Rc in Ud.Qd)if("."!=Rc.charAt(0)){var Vd=Ud.Qd[Rc],Ge=Vd.o;if(void 0!==Ge){var Wd=Vd.s;void 0===Wd&&(Wd=Ud.Z);var He=Ud.Qd[Rc].l;He&&(Rc=He);a.O(Uq(Ge,Wd)+" "+Rc)}}}else{if("ds"==la||"dg"==la||"dl"==la)la="d",S=[la,"desc",Ja];"d"==la&&"page"==Ja&&(la="dp",S.shift());if("dp"==la){S.shift();var hi=S[0];if(hi){var Re=a.cc(kr(a,hi));if(-1===Re)a.O("invalid address: "+hi);else{var $d,za=null;if(80386<=a.F.ja){var ae=
a.ga,za={};za.Jk=(Re&-4194304)>>>20;za.$i=a.F.Od+za.Jk;za.yb=ae.sa[(za.$i&ae.Gb)>>>ae.La];za.Aj=za.yb.Md(za.Jk);za.Kk=(Re&4190208)>>>10;za.aj=(za.Aj&-4096)+za.Kk;za.zb=ae.sa[(za.aj&ae.Gb)>>>ae.La];za.Bj=za.zb.Md(za.Kk);za.nl=(za.Bj&-4096)+(Re&4095)}if($d=za){a.O("linear PDE addr PDE PTE addr PTE physical");a.O("--------- ---------- -------- ---------- -------- ----------");var od="%"+r(Re),od=od+(" %%"+mr($d.$i,$d.Aj)),od=od+(" %%"+mr($d.aj,$d.Bj,!0)),
od=od+(" %%"+r($d.nl));a.O(od)}else a.O("unsupported operation")}}else a.O("missing address")}else{if("d"==la){if("disk"==Ja){S[0]="l";S[1]="json";Mr(a,S);break a}for(ab in Eb)if(S[1]==ab){var yn=a.cb[ab];yn?(S.shift(),S.shift(),yn(S)):a.O("no dump registered for "+Ja);break a}Ja||(la=a.Cc||"db")}else a.Cc=la;if("dh"==la){var zn=Ja,An=Da,Bn="",Cn=0,Zb=a.Fa,sc=a.ia;if(sc.length){var Lb=+zn||a.Ub,Se=+An||10;isNaN(Lb)?Lb=Se:Bn="more ";Lb>sc.length&&(a.O("note: only "+sc.length+" available"),Lb=sc.length);
Zb-=Lb;0>Zb&&(null==sc[sc.length-1].Z?(Lb=Zb+Lb,Zb=0):Zb+=sc.length);var ii=[];"call"==An&&(Se=1E5,ii=["CALL"]);for(void 0!==zn&&a.O(Lb+" instructions earlier:");0<Se&&Zb!=a.Fa;){var pd=sc[Zb++];if(null==pd.Z)break;var Te=wq(a,pd.Ra,pd.Z,pd.Ea,pd.type,pd.Rb,pd.oc),is=Lb--,Dn=yr(a,Te,"history",is);(!ii.length||0<=Dn.indexOf(ii[0]))&&a.O(Dn);Te.Ve&&(Zb+=Te.Ve,Se-=Te.Ve,Lb-=Te.Ve);Zb>=sc.length&&(Zb=0);a.Ub=Lb;Cn++;Se--}}Cn||(a.O("no "+Bn+"history available"),a.Ub=void 0)}else if("di"==la){S.shift();
var ji=S[0];if(ji){var Ue=rq(a,ji);if(void 0===Ue||0>Ue||255<Ue)a.O("invalid vector: "+ji);else{var En="&",Fn=!!(a.F.$a&1),Gn=!1,ng=a.F.Mc+(Ue<<(Fn?3:2)),Hn=a.F.na(ng+0),js=a.F.na(ng+2);Fn&&(En="#",a.F.na(ng+4)&2048&&(Gn=!0,Hn|=a.F.na(ng+6)<<16));a.O("dumpIDT("+v(Ue)+"): "+En+r(js,4)+":"+r(Hn,Gn?8:4))}}else a.O("no IDT vector")}else if("dt"==la)S.shift(),a.O("no information");else{var be=kr(a,Ja);if(be&&(null!=be.Z||null!=be.Ea)){var og=0;Da&&("l"==Da.charAt(0)&&(Da=Da.substr(1)||Wa),og=rq(a,Da)>>>
0,65536<og&&(og=65536));for(var Ve="",ce="dd"==la?4:"dw"==la?2:1,pg=ce*og||128,ks=pg+15>>4||1;ks--&&0<pg;){var We=0,ki=0,Xe,li="",In="",Ja=dr(be);for(Xe=4==ce?16:a.Ya;0<Xe&&0<pg;Xe--){var qg=a.Qa(be,1),We=We|qg<<(ki++<<3);ki==ce&&(li+=8==a.Ya?ia(We,3*ce):r(We,2*ce),li+=1==ce?9==Xe?"-":" ":" ",We=ki=0);In+=32<=qg&&128>qg?String.fromCharCode(qg):".";pg--}Ve&&(Ve+="\n");Ve+=Ja+" "+li+(0==Xe?" "+In:"")}Ve&&a.O(Ve);a.Db=be}}}}}break;case "e":if("else"==g[0])break;var rg=1,Jn=255,Kn=a.Qa,Ln=a.qc;"ew"==
g[0]&&(rg=2,Jn=65535,Kn=a.na,Ln=a.jb);var Mn=rg<<1,Nn=g[1];if(null==Nn)a.O("edit memory commands:"),a.O("\teb [a] [...] edit bytes at address a"),a.O("\tew [a] [...] edit words at address a");else{var sg=kr(a,Nn);if(sg)for(var tg=2;tg<g.length;tg++){var Ye=pq(a,g[tg]);if(void 0===Ye){a.O("unrecognized value: "+g[tg]);break}Ye&~Jn&&a.O("warning: "+r(Ye)+" exceeds "+rg+"-byte value");var ls=Kn.call(a,sg);a.O("changing "+dr(sg)+" from "+r(ls,Mn,!0)+" to "+r(Ye,Mn,!0));Ln.call(a,sg,Ye,rg)}}break;case "f":Jr(a,
g[1]);break;case "g":a:{var On=g[1],ms=b;"gt"==g[0]&&(a.fb=!0);if(void 0!==On){var mi=kr(a,On,!0);if(!mi)break a;lr(a,mi,ms);a.Rd(a.B,mi,!0)}a.Ne(!0)||c||a.O("cpu busy or unavailable, run command ignored")}break;case "h":a:{var ni;if(a.la.Ib)ni="halting",a.Wb();else{if(wb(a,!0))break a;ni="already halted"}c||a.O(ni)}break;case "i":if("if"==g[0]){var oi;var Ze=b.substr(2),Ze=qa(Ze);pq(a,Ze)?(c||a.O("true: "+Ze),oi=!0):(c||a.O("false: "+Ze),oi=!1);oi||(d=!1);break}if("int"==g[0]){var ug;a:switch(rq(a,
g[1])){case 19:pk(a,19,a.F.Ha,!0);a.Ca=a.pa;ug=!0;break a;case 33:pk(a,33,a.F.Ha,!0);a.Ca=a.pa;ug=!0;break a;default:ug=!1}ug||(d=!1);break}var pi=g[1];if(pi&&"?"!=pi){var qi=rq(a,pi);if(void 0!==qi){var ns=rc(a.ga,qi,1);a.O(v(qi)+": "+u(ns))}}else a.O("input commands:"),a.O("\ti [p]\tread port [p]"),a.O("warning: port accesses can affect hardware state");break;case "k":var os=g[0];if("?"==g[1])a.O("stack trace commands:"),a.O("\tk\tshow frame addresses"),a.O("\tks\tshow symbol information");else{var ri=
0,Pn=a.F.wa.Z,$e=wq(a),Uc=wq(a,J(a.F),a.F.ta.Z);for(a.O("stack trace for "+dr(Uc));10>ri;){for(var tc=null,ps=256;Uc.Ra>>>0<a.F.Sg>>>0;){$e.Ra=a.tb(Uc,!0);if(null==Uc.Ea||!ps--)break;$e.Z=Pn;if(tc=Or(a,$e))break;$e.Z=a.tb(Uc);if(tc=Or(a,$e,!0)){Pn=a.tb(Uc,!0);0<tc.indexOf("INT")&&a.tb(Uc,!0);break}}if(!tc||null==tc)break;var Qn=null;if("ks"==os){var Rn=tc.match(/[0-9A-F]+$/);Rn&&(Qn=Lr(a,Rn[0]))}tc=pa(tc,50)+" ;"+(Qn||"stack="+dr(Uc));a.O(tc);ri++}ri||a.O("no return addresses found")}break;case "l":if("ln"==
g[0]){Lr(a,g[1],!0);break}Mr(a,g);break;case "m":if("mouse"==g[0]){var si=g[1],vg=g[2];if(a.V){var Sn=1;"-"==vg.charAt(0)&&(Sn=-1,vg=vg.substr(1));var qd=rq(a,vg,si);if(void 0!==qd)switch(qd=qd*Sn|0,si){case "x":a.V.Kf(qd,0);break;case "y":a.V.Kf(0,qd);break;case "click":a.V.he(qd,!0);a.V.he(qd,!1);break;default:a.O("unknown action: "+si)}}else a.O("no mouse");break}a:{var uc,vc=null,Ma=g[1];"?"==Ma&&(Ma=void 0);if(void 0!==Ma){var rd=0;if("all"==Ma)rd=1610481663,Ma=null;else if("on"==Ma)vc=!0,Ma=
null;else if("off"==Ma)vc=!1,Ma=null;else{"keys"==Ma&&(Ma="key");"kbd"==Ma&&(Ma="keyboard");for(uc in Eb)if(Ma==uc){rd=Eb[uc];vc=!!(a.wc&rd);break}if(!rd){a.O("unknown message category: "+Ma);break a}}rd&&("on"==g[2]?(a.wc|=rd,vc=!0):"off"==g[2]&&(a.wc&=~rd,vc=!1))}var qs=0,af="";for(uc in Eb)if(!Ma||Ma==uc){var rs=!!(a.wc&Eb[uc]);if(null===vc||vc==rs)af&&(af+=","),++qs%10||(af+="\n\t"),"key"==uc&&(uc="keys"),af+=uc}void 0===Ma&&a.O("message commands:\n\tm [category] [on|off]\tturn categories on/off");
a.O((null!==vc?vc?"messages on: ":"messages off: ":"message categories:\n\t")+(af||"none"));yq(a)}break;case "o":var ti=g[1],ss=g[2];if(ti&&"?"!=ti){var ui=rq(a,ti,"port #"),vi=rq(a,ss);void 0!==ui&&void 0!==vi&&(zc(a.ga,ui,1,vi),a.O(v(ui)+": "+u(vi)))}else a.O("output commands:"),a.O("\to [p] [b]\twrite byte [b] to port [p]"),a.O("warning: port accesses can affect hardware state");break;case "p":if("print"==g[0]){Nr(a,b.substr(5));break}var Tn="pr"==g[0]?1:0,de=1+Tn;if(a.U)a.O("step in progress");
else{var wg,Un=!1,kb=wq(a,M(a.F),a.F.wa.Z);do switch(wg=!1,a.Qa(kb)){case 38:case 46:case 54:case 62:case 100:case 101:case 102:case 103:case 240:fr(a,kb,1);wg=!0;break;case 204:case 206:a.U=de;fr(a,kb,1);break;case 205:case 224:case 225:case 226:a.U=de;fr(a,kb,kb.Rb?4:2);break;case 232:a.U=de;fr(a,kb,kb.Rb?5:3);break;case 154:a.U=de;fr(a,kb,kb.Rb?7:5);break;case 255:var Vn=a.tb(kb)&14591;if(4351==Vn||6399==Vn)a.U=de,yr(a,kb);break;case 243:case 242:fr(a,kb,1);Un=wg=!0;break;case 108:case 109:case 110:case 111:case 164:case 165:case 166:case 167:case 170:case 171:case 172:case 173:case 174:case 175:Un&&
(a.U=de,fr(a,kb,1))}while(wg);a.U?(a.Rd(a.B,kb,!0),a.Ne()||(a.X&&a.X.wd(),a.U=0)):Pr(a,Tn?"tr":"t")}break;case "r":if("reset"==b){a.X&&a.X.reset();break}qr(a,g);break;case "t":Pr(a,g[0],g[1]);break;case "u":rr(a,g[1],g[2],8);break;case "v":if("var"==g[0]){Kr(a,b.substr(3))||(d=!1);break}a.O("PCx86 version 1.30.1 ("+a.F.ja+",RELEASE,NOPREFETCH"+(Ab?",TYPEDARRAYS":",LONGARRAYS")+",NOBACKTRACK)");a.O(Ca());break;case "x":a:if(g[1]&&"?"!=g[1])switch(g[1]){case "cs":var bf;void 0!==g[3]&&(bf=+g[3]);switch(g[2]){case "int":a.F.Y.jf=
bf;break;case "start":a.F.Y.Mf=bf;break;case "stop":a.F.Y.lf=bf;break;default:a.O("unknown cs option");break a}void 0!==bf&&$c(a.F);a.O("checksums "+(a.F.la.Xe?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(dd(a.F,+g[2])||a.O("warning: using 1x multiplier, previous target not reached"));a.O("target speed: "+(a.F.Y.He.toFixed(2)+"Mhz")+" ("+a.F.Y.Wd+"x)");break;default:a.O("unknown option: "+g[1])}else a.O("execution options:"),a.O("\tcs int #\tset checksum cycle interval to #"),a.O("\tcs start #\tset checksum cycle start count to #"),
a.O("\tcs stop #\tset checksum cycle stop count to #"),a.O("\tsp #\t\tset speed multiplier to #");break;case "?":if(g[1]){Nr(a,b.substr(1));break}var wi="commands:",xi;for(xi in Dq)wi+="\n"+pa(xi,7)+Dq[xi];ag(a)||(wi+="\nnote: frequency/history disabled if no exec breakpoints");a.O(wi);break;default:a.O("unknown command: "+b),d=!1}}}catch(Wn){a.O("debugger error: "+(Wn.stack||Wn.message)),d=!1}return d}function Aq(a,b,c){b=a.Ng(b,c);for(var d in b)if(!xr(a,b[+d]))return!1;return!0}
Xa(function(){for(var a=tb(document,"pcx86","debugger"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new vq(d);sb(d,c)}});
function Rr(a,b,c){bb.call(this,"Computer",a,Rr,67108864);this.la.ic=!1;Sr(this,b);this.fa=Yc(this,"autoPower",a);this.N=0;this.ra=a.busWidth||a.buswidth;this.A=Tr;this.aa=null;this.V=this.pa=!1;this.ua=Yc(this,"url")||"";this.ya=(Math.random()+.1).toString(36).substr(2,12);this.B=Ur(this);if(this.F=pb("CPU",this.id)){this.ha=pb("Debugger",this.id);this.L=[];for(b=null;b=Jb(this,"Video",b);)this.L.push(b);this.ga=new Rb({id:this.ce+".bus",busWidth:this.ra},this.F,this.ha);var d,e=nb(this.id);if((this.C=
pb("Panel",this.id))&&this.C.Gf)for(b=0;b<e.length;b++)d=e[b],d.Na=this.C.Na,d.O=this.C.O,d.Gf=this.C.Gf;this.O("PCx86 v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.Ic&&d.Ic(this,this.ga,this.F,this.ha);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.W=d:this.A=parseInt(d,10));var f;if(a=Yc(this,"state")||(f=!0,a.state))b=this.ia=a,f||(this.V=!0,this.A=Tr),this.A&&(this.ea=new qf(this,
"1.30.1"),this.ea.load()?b=null:delete this.ea);!b&&this.A&&(b=Vr(this))&&(this.V=!0);if(b){var g=this;Aa(b,null,!0,function(a,b,c){c?(g.W=null,g.V=!1,g.Na("Unable to load machine state from server (error "+c+(b?": "+qa(b):"")+")")):(g.aa=b,g.pa=!0);xb(g)})}else xb(this);this.qa.power||(this.fa=!0);!c&&this.fa&&Wr(this,this.cg)}else w("Unable to find CPU component")}jb(Rr);var Tr=0;l=Rr.prototype;l.gf=function(){return this.ya};
function Sr(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){w(d.message+" ("+c+")")}}a.U=b}function Yc(a,b,c){var d=b.toLowerCase(),d=eb[b]||eb[d];void 0===d&&a.U&&(d=a.U[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}l.ie=function(){return this.B||""};function Wr(a,b,c){for(var d=nb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!yb(f)){yb(f,function(){Wr(a,b,c)});return}}b.call(a,c)}
function Xr(a,b){var c=new qf(a,"1.30.1","validate");if(c.load()&&Yr(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.Na("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}
l.cg=function(a){void 0===a&&(a=this.A||(this.aa?1:Tr));if(!this.N){this.N++;var b=!1,c=!1;this.ka=!1;var d=this.ea||new qf(this,"1.30.1");if(-1==a)b=!0;else if(a>Tr){if(d.load(this.aa)){this.X=new qf(this,"1.30.1","failsafe");this.X.load()&&(Zr(this,d),a=2,$r(this.X));this.X.set("timestamp",ua());as(this.X);var e=this.A&&!this.V;if(1==a||Ea("Click OK to restore the previous PCx86 machine state, or CANCEL to reset the machine.")){if(c=Yr(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):
("error"==f&&"no machine state"!=g?(this.Na("Error: "+g),"unable to verify user"==g&&(Ia("user",""),this.B=null)):this.O(f+": "+g),$r(d),d.load()?(c=Yr(d),e=!0):c=!1))}e&&Xr(this,c?d:null)}else 2==a&&d.clear()}else Xr(this);delete this.aa;delete this.ea}e=nb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.F&&(c=bs(this,g,d,b,c));b=[d,a,c];-1!=a?Wr(this,this.qj,b):this.qj(b)}};
function bs(a,b,c,d,e){if(!b.la.ic){b.la.ic=!0;if(b.hc){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.hc(f,d)&&f&&(w("Unable to restore state for "+b.type),a.ia&&!a.pa?(c.clear(),a.A=Tr,window&&window.location.reload()):a.ka=!0,b.hc(null),e=!1)}if(!d&&b.al)for(a=b.al.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
l.qj=function(a){var b=a[0],c=0>a[1];a=a[2];this.va=!0;this.la.ic=!0;var d=this.qa.power;d&&(d.textContent="Shutdown");this.F&&(bs(this,this.F,b,c,a),this.F.Cf());this.ka&&(Zr(this,b),b.clear());!c&&this.X&&(this.X.clear(),delete this.X);this.N=0};
function Zr(a,b){if(Ea("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.ie();b=b.toString();var d={app:"PCx86",ver:"1.30.1"};d.url=a.ua;d.user=c;d.type="bug";d.data=b;Aa("http://www.pcjs.org/api/v1/report",d,!0)}}
function Qr(a,b,c){var d,e="none";if(a.N)return null;a.N--;var f=new qf(a,"1.30.1"),g=new qf(a,"1.30.1","validate"),h=ua();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",Ca());a.F&&a.F.gc&&(c&&a.F.Wb(),d=a.F.gc(b,c),"object"===typeof d&&f.set(a.F.id,d),c&&(a.F.la.ic=!1,!1===d&&(e=null)));for(var h=nb(a.id),k=0;k<h.length;k++){var m=h[k];m.la.ic&&(m.gc&&(d=m.gc(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.la.ic=!1,
!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.B&&cs(a,a.B,f.toString()),as(g)&&as(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=3==a.A),d&&f.clear(h)):e=f.toString());c&&(a.la.ic=!1,b=a.qa.power)&&(b.textContent="Power");a.N=0;return e}l.reset=function(){this.ga&&this.ga.reset&&(y(this,"Resetting "+this.ga.type),this.ga.reset());for(var a=nb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ga&&c.reset&&(y(this,"Resetting "+c.type),c.reset())}};
l.start=function(a,b){for(var c=nb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};l.stop=function(a,b){for(var c=nb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
l.Pb=function(a,b,c){var d=this;switch(b){case "power":return this.qa[b]=c,c.onclick=function(){d.N||(d.la.ic?Qr(d,!1,!0):Wr(d,d.cg))},!0;case "reset":return this.qa[b]=c,c.onclick=function(){if(d.la.ic&&!d.N)if(d.A&&!d.W){var a=Ea("Click OK to save changes to this PCx86 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Qr(d,a,!0);!a&&d.ia?window&&window.location.reload():(a||(d.lh=!0),d.cg(Tr),d.lh=!1)}else d.reset(),d.F&&d.F.Cf()},!0;case "save":if(ma(Ba(),"pcjs.org"))c.parentNode.removeChild(c);
else return this.qa[b]=c,c.onclick=function(){var a=Ur(d,!0);if(a){var b=!!(d.A&&!d.W||d.ia),c=Qr(d,b);b?cs(d,a,c):d.Na("Resume disabled, machine state not saved")}},!0}return!1};
function Ur(a,b){var c=a.B;c||((c=Ha("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ds(a,c))||a.Na("The user ID is invalid.")):b&&a.Na("Browser local storage is not available"));return c}
function ds(a,b){a.B=null;b=Aa(Ba()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ia("user",b.data),a.B=b.data)}catch(d){w(d.message+" ("+c+")")}return a.B}function Vr(a){var b=null;a.B&&(b=Ba()+"/api/v1/user?req=load&user="+a.B+"&state="+es(a,"1.30.1"));return b}
function cs(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=es(a,"1.30.1");d.data=c;b=Aa(Ba()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Na("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.Na(c),Ia("user",""),a.B=null)}}
function Jb(a,b,c){a=nb(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}l.wd=function(a){if(this.L.length){var b=0,c=0;a&&window&&(b=window.scrollX,c=window.scrollY);var d=this.L[0];d.X&&d.X.focus();a&&window&&window.scrollTo(b,c)}};l.pd=function(a){this.F&&this.F.pd(a);this.C&&this.C.pd(a)};
function jd(a,b){for(var c=0;c<a.L.length;c++)un(a.L[c],b);if(a.C&&(a=a.C,a.Ja)){Ob(a,18,a.aa,a.Ga);if(a.gb){b=a.ga;var c=a.A,d,e;null==d&&(d=0);null==e&&(e=b.W-d|0);c||(c={ih:0,Td:0,Yg:[]});var f=d>>>b.La;d=d+e-1>>>b.La;c.ih=0;for(c.Td=0;f<=d;)e=b.sa[f],c.ih+=e.size,e.size&&(c.Yg.push(wa(Nb,f,0,0,e.type)),c.Td++),f++;a.A=c;a.ya=a.A.Td*a.ga.Sb/691200;d=0;a.A.fj=0;a.A.Bf||(a.A.Bf=[]);e=-1;b=0;for(var g=-1,c=0;c<a.A.Td;c++){var h=a.A.Yg[c],f=xa(Nb.type,h),h=xa(Nb.Hk,h);if(f!=e||h!=g+1)(g=c-b)&&(d+=
Qb(a,b,g,e)),e=f,b=c;g=h}d+=Qb(a,b,c-b,e);e=a.A.ul!=d;a.A.ul=d;if(e){e=new Hb(0,0,a.aa.width,a.aa.height);a.A.Se=[];b=a.A.Td;for(d=0;d<a.A.fj;d++)c=a.A.Bf[d].Td,a.A.Se.push(Ib(e,c,b,!d)),b-=c;for(d=0;d<a.A.Se.length;d++)e=a.A.Bf[d],b=c=a.A.Se[d],f=a.Ga,(g=Fc[e.type])||(g=new Gb),f.strokeStyle="black",f.strokeRect(b.x,b.y,b.ad,b.A),f.fillStyle="string"==typeof g?g:g.toString(),f.fillRect(b.x,b.y,b.ad,b.A),b=a,f=c,b.fa=b.ua,b.W=b.va,c=f.x+(f.ad>>1),g=f.y+(f.A>>1),h=f.A,f.ad<f.A&&(h=f.ad,b.ra=!0,b.N.save(),
b.N.translate(c,g),b.N.rotate(-Math.PI/2),c=g=0),h<b.W&&(b.W=h,b.fa=b.W+"px Monaco, Lucida Console, Courier New"),f=g,b.C=c,b.U=f,b=a,e=Yb[e.type]+" ("+(e.Td*a.ga.Sb/1024|0)+"Kb)",b.N.font=b.fa,b.C-=b.N.measureText(e).width>>1,b.U+=(b.W>>1)-2,Pb(b,e),b.ra&&(b.N.restore(),b.ra=!1)}}else Pb(a,"This space intentionally left blank");a.context.drawImage(a.aa,0,0,a.aa.width,a.aa.height,a.sb,a.Jb,a.Ya,a.fb);a.Ja=!1}}
Xa(function(){for(var a=tb(document,"pcx86-machine"),b=0;b<a.length;b++)for(var c=a[b],d=qb(c),c=tb(c,"pcx86","computer"),e=0;e<c.length;e++){var f=c[e],g=qb(f),g=new Rr(g,d,!0);sb(g,f);g.fa&&Wr(g,g.cg)}});Ra.show.push(function(){for(var a=tb(document,"pcx86","computer"),b=0;b<a.length;b++){var c=qb(a[b]);(c=pb("Computer",c.id))&&c.va&&!c.la.ic&&c.cg(-1)}});
Ra.exit.push(function(){for(var a=tb(document,"pcx86","computer"),b=0;b<a.length;b++){var c=qb(a[b]);(c=pb("Computer",c.id))&&c.la.ic&&Qr(c,!(!c.A||c.W),!0)}});function qf(a,b,c){this.id=a.id;this.key=es(a,b,c);this.ha=a.ha;$r(this,a.Ok)}function es(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
qf.prototype={constructor:qf,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},load:function(a){return a?(this[this.id]=a,this.A=!0):this.A?!0:Ga()&&(a=Ha(this.key))?(this[this.id]=a,this.A=!0):!1},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){$r(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=
0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}}};function $r(a,b){a[a.id]={};b&&a.set("parms",b);a.A=!1}function as(a){var b=!0;if(Ga()){var c=JSON.stringify(a[a.id]);Ia(a.key,c)||(w("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Yr(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){w(c.message||c),b=!1}return b}var fs=0;
function gs(a,b,c,d,e,f){e("Loading "+a+"...");Aa(a,null,!0,function(g,h,k){k?(h||(h="unable to load "+a+" ("+k+")"),f(h,null)):hs(h,a,b,c,d,e,f)})}
function hs(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(mb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PCx86$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pcx86$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?ts(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
function ts(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Aa(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)k=0>k.indexOf(m[1])?k.replace(">",m[0]+">"):k.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=k&&(g=g.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],g);ts(a,b,c)}})}else c(a,null)}
function us(a,b,c,d){function e(a){if(void 0===h){var b=g&&tb(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=oa(a))}function f(a){e("Error: "+a);k&&(--fs||Za(!0));k=!1}var g,h,k=!0;fs++;lb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css";t.styleSheet?t.styleSheet.cssText=m:t.appendChild(document.createTextNode(m));n.appendChild(t)}c||
(c="/versions/pcx86/1.30.1/components.xsl");m=function(d,h){h?gs(c,null,null,!1,e,function(d,k){k?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(k=h.transformNode(k))?(g.outerHTML=k,--fs||Za(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(k),(k=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(k,g),--fs||Za(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?gs(b,a,d,!0,e,m):hs(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(q){f(q.message)}return k}function vs(a,b,c,d){Za(!1);return us(a,b,c,d)}window.embedPC=vs;window.embedPCx86=vs;window.enableEvents=Za;window.sendEvent=$a;
function ws(a,b,c,d){if(!c&&b){d.push(b);a=lb[d[0]];b=null;for(var e in a)if(ma(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?Aa(b,null,!0,function(a,b){xs(b,d)}):xs(null,d)}else w("Error ("+c+") requesting "+a)}
function xs(a,b){var c,d,e,f=b[0],g=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=lb[f],k={},m;for(m in h){var n=h[m],t=ka(m);if("xml"==t){for(t=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=t.exec(h[m]);){var q=d[2];q&&(h[q]||(n=n.replace(d[0],"")))}d=m=ja(m)}else"xsl"==t&&(e=m=ja(m));k[m]=n}a&&(k[m="css"]=a);b[2]&&(k[m="parms"]=b[2]);b[3]&&(k[m="state"]=b[3]);d&&e?(a=JSON.stringify(k),g+=".js",c=c[1]+"var resources="+a+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
"&#xA9;"),a=Na(c,"javascript",!1,g),a=a+(', copy it to your web server as "'+g+'", and then add the following to your web page:\n\n')+('<div id="'+f+'"></div>\n')+"...\n",a=a+('<script type="text/javascript" src="'+g+'">\x3c/script>\n')+('<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n')+"The machine should appear where the <div> is located.",w(a)):w("Missing XML/XSL resources")}
window.savePC=function(a,b,c){var d=pb("Computer",a),e=pb("Debugger",a);if(d){var f=Qr(d,!0),g=d.U?JSON.stringify(d.U):null;b||(b="/versions/pcjs/1.30.1/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Ok:g}))return!0;Aa(b,null,!0,function(c,d,e){ws(c,d,e,[a,ja(b,!0),g,f])});return!0}w("Unable to identify machine '"+a+"'");return!1};})();